mirror of
https://github.com/frappe/books.git
synced 2025-02-02 12:08:27 +00:00
commit
1d22688416
@ -25,6 +25,7 @@ import Password from './Password';
|
||||
import Select from './Select';
|
||||
import Table from './Table';
|
||||
import Text from './Text';
|
||||
import Time from './Time';
|
||||
|
||||
export default {
|
||||
props: ['docfield', 'value', 'onlyInput', 'doc'],
|
||||
@ -55,7 +56,8 @@ export default {
|
||||
Password,
|
||||
Select,
|
||||
Table,
|
||||
Text
|
||||
Text,
|
||||
Time
|
||||
}[this.docfield.fieldtype];
|
||||
},
|
||||
isDisabled() {
|
||||
|
39
ui/components/controls/Time.vue
Normal file
39
ui/components/controls/Time.vue
Normal file
@ -0,0 +1,39 @@
|
||||
<template>
|
||||
<div :class="{ 'form-group': !onlyInput }">
|
||||
<label v-if="!onlyInput">{{ docfield.label }}</label>
|
||||
<flat-pickr
|
||||
:value="value"
|
||||
:config="config"
|
||||
class="form-control"
|
||||
@on-change="emitChange"
|
||||
>
|
||||
</flat-pickr>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import flatPickr from 'vue-flatpickr-component';
|
||||
import Data from './Data';
|
||||
|
||||
export default {
|
||||
extends: Data,
|
||||
data() {
|
||||
return {
|
||||
config: {
|
||||
enableTime: true,
|
||||
noCalendar: true
|
||||
}
|
||||
};
|
||||
},
|
||||
components: {
|
||||
flatPickr
|
||||
},
|
||||
methods: {
|
||||
emitChange(times, timeString) {
|
||||
this.$emit('change', timeString);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
@import "flatpickr/dist/flatpickr.css";
|
||||
</style>
|
Loading…
x
Reference in New Issue
Block a user