Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flatpickr wrapper #178

Merged
merged 8 commits into from
May 3, 2018
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
"shelljs": "0.7.6",
"url-loader": "0.5.8",
"vue-component-tree": "^2.2.1",
"vue-flatpickr-component": "^7.0.1",
"vue-loader": "13.3.0",
"vue-style-loader": "3.0.1",
"vue-template-compiler": "2.5.2",
Expand Down
93 changes: 93 additions & 0 deletions src/components/ui/date-time-pickers/DateTimePickers.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<template>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move datepickers to a separate widget on Forms Elements page in a separate widget below 'Inputs widget'

<div class="sets-list row">
<div class="col-md-12">
<div class="row">
<div class="col-lg-4">
<vuestic-widget :headerText="$t('dateTimePicker.basic')">
<div class="form-group">
<div class="input-group">
<vuestic-date-picker
id="date-picker-basic"
v-model="simple"
/>
<label class="control-label" for="date-picker-basic">{{ $t('dateTimePicker.basic') }}</label>
<i class="bar"></i>
</div>
</div>
</vuestic-widget>
</div>
<div class="col-lg-4">
<vuestic-widget :headerText="$t('dateTimePicker.time')">
<div class="form-group">
<div class="input-group">
<vuestic-date-picker
id="date-picker-time"
:config="{enableTime: true}"
v-model="time"
/>
<label class="control-label" for="date-picker-time">{{ $t('dateTimePicker.time') }}</label>
<i class="bar"></i>
</div>
</div>
</vuestic-widget>
</div>
<div class="col-lg-4">
<vuestic-widget :headerText="$t('dateTimePicker.range')">
<div class="form-group">
<div class="input-group">
<vuestic-date-picker
id="date-picker-range"
:config="{mode: 'range'}"
v-model="range"
/>
<label class="control-label" for="date-picker-range">{{ $t('dateTimePicker.range') }}</label>
<i class="bar"></i>
</div>
</div>
</vuestic-widget>
</div>
<div class="col-lg-4">
<vuestic-widget :headerText="$t('dateTimePicker.multiple')">
<div class="form-group">
<div class="input-group">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

label doesn't go down
screen shot 2018-04-27 at 5 09 15 pm

<vuestic-date-picker
id="date-picker-multiple"
:config="{mode: 'multiple'}"
v-model="multiple"
/>
<label class="control-label" for="date-picker-multiple">{{ $t('dateTimePicker.multiple') }}</label>
<i class="bar"></i>
</div>
</div>
</vuestic-widget>
</div>
</div>
</div>
</div>
</template>

<script>
import VuesticWidget
from '../../../vuestic-theme/vuestic-components/vuestic-widget/VuesticWidget.vue'
import VuesticDatePicker from '../../../vuestic-theme/vuestic-components/vuestick-date-picker/VuesticDatePicker.vue'

export default {
name: 'date-time-pickers',
data () {
return {
simple: '2018-06-12',
time: '2018-04-26 12:20',
range: '2018-04-10 to 2018-04-18',
multiple: '2018-04-25, 2018-04-27',
}
},
components: {
VuesticDatePicker,
VuesticWidget
},
}
</script>

<style lang="scss">

</style>
1 change: 0 additions & 1 deletion src/components/ui/tree-view/TreeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,3 @@
<style lang="scss">

</style>

9 changes: 8 additions & 1 deletion src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@
"tables": "Tables",
"typography": "Typography",
"uiElements": "UI Elements",
"treeView": "Tree view"
"treeView": "Tree view",
"dateTimePickers": "Date time pickers"
},
"messages": {
"all": "See all messages",
Expand Down Expand Up @@ -237,5 +238,11 @@
"selectable": "Selectable",
"editable": "Editable",
"advanced": "Advanced"
},
"dateTimePicker": {
"basic": "Basic",
"time": "Time",
"range": "Range",
"multiple": "Multiple"
}
}
4 changes: 2 additions & 2 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Vue.use(Router)

const demoRoutes = []
if (process.env.NODE_ENV === 'development') {
const VueComponentTree = require('vue-component-tree')
const VueComponentTree = require('vue-component-tree').default

demoRoutes.push(
VueComponentTree.default(require.context('./..', true, /.demo.vue$/), '/demo')
VueComponentTree(require.context('./..', true, /.demo.vue$/), '/demo')
)
}

Expand Down
6 changes: 6 additions & 0 deletions src/sass/_mixins.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
@mixin flex-center () {
display: flex;
justify-content: center;
align-items: center;
}

@mixin theme-button-variant($color, $background, $border, $shadow) {
$hover-bg: lighten($background, 10%);
$disabled-bg: darken($background, 15%);
Expand Down
1 change: 1 addition & 0 deletions src/sass/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
@import "~awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.scss";
@import "~medium-editor/src/sass/medium-editor";
@import "_icons-styles.scss";
@import "~flatpickr/dist/flatpickr.css";

@import "base";
@import "typography";
Expand Down
8 changes: 8 additions & 0 deletions src/store/modules/menu/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ export default {
meta: {
title: 'menu.treeView'
}
},
{
name: 'DateTimePickers',
path: '/ui/date-time-pickers',
component: lazyLoading('ui/date-time-pickers/DateTimePickers'),
meta: {
title: 'menu.dateTimePickers'
}
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
```

```javascript
import VuesticTreeViewRootMapper from 'vuestic-admin/src/vuestic-theme/vuestic-components/vuestic-tree-view/VuesticTreeRootMapper.js'
import VuesticTreeViewRootMapper from '~vuestic-admin/src/vuestic-theme/vuestic-components/vuestic-tree-view/VuesticTreeRootMapper.js'

data () {
vuesticTreeRoot: VuesticTreeRootMapper.map([
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<template>
<div
style="left: 420px; top: 180px; background-color: white; position: absolute"
>
<div class="form-group">
<div class="input-group">
<vuestic-date-picker
id="simple-input"
v-model="one"
/>
<label class="control-label" for="simple-input">Simple</label>
<i class="bar"></i>
</div>
<div class="input-group">
<vuestic-date-picker
id="simple-input-2"
v-model="two"
:config="{mode: 'range'}"
/>
<label class="control-label" for="simple-input-2">Range</label>
<i class="bar"></i>
</div>
<div class="input-group">
<vuestic-date-picker
id="simple-input-3"
v-model="three"
:config="{enableTime: true}"
/>
<label class="control-label" for="simple-input-3">Day time</label>
<i class="bar"></i>
</div>
<div class="input-group">
<vuestic-date-picker
id="simple-input-4"
v-model="three"
:config="{enableTime: true}"
@on-change="doSomethingOnChange"
/>
<label class="control-label" for="simple-input-4">Day time</label>
<i class="bar"></i>
</div>
</div>
</div>
</template>

<script>
import VuesticDatePicker from './VuesticDatePicker.vue'

export default {
components: { VuesticDatePicker },
data () {
return {
one: null,
two: null,
three: null,
}
},
methods: {
doSomethingOnChange (input) {
console.log('input', input)
},
},
}
</script>