quasar-ui-danx 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +6 -1
- package/src/components/ActionTable/ActionTable.vue +49 -41
- package/src/components/ActionTable/BatchActionMenu.vue +20 -20
- package/src/components/ActionTable/EmptyTableState.vue +5 -5
- package/src/components/ActionTable/Filters/CollapsableFiltersSidebar.vue +11 -11
- package/src/components/ActionTable/Filters/FilterGroupItem.vue +7 -7
- package/src/components/ActionTable/Filters/FilterGroupList.vue +29 -29
- package/src/components/ActionTable/Filters/FilterListToggle.vue +15 -15
- package/src/components/ActionTable/Filters/FilterableField.vue +82 -80
- package/src/components/ActionTable/Filters/index.ts +5 -0
- package/src/components/ActionTable/Form/Fields/BooleanField.vue +13 -13
- package/src/components/ActionTable/Form/Fields/ConfirmPasswordField.vue +11 -11
- package/src/components/ActionTable/Form/Fields/DateField.vue +13 -13
- package/src/components/ActionTable/Form/Fields/DateRangeField.vue +25 -25
- package/src/components/ActionTable/Form/Fields/DateTimeField.vue +21 -21
- package/src/components/ActionTable/Form/Fields/DateTimePicker.vue +23 -23
- package/src/components/ActionTable/Form/Fields/FileUploadButton.vue +31 -31
- package/src/components/ActionTable/Form/Fields/InlineDateTimeField.vue +19 -19
- package/src/components/ActionTable/Form/Fields/IntegerField.vue +7 -7
- package/src/components/ActionTable/Form/Fields/LabelValueBlock.vue +22 -0
- package/src/components/ActionTable/Form/Fields/LabeledInput.vue +19 -19
- package/src/components/ActionTable/Form/Fields/MultiFileField.vue +40 -40
- package/src/components/ActionTable/Form/Fields/MultiKeywordField.vue +23 -23
- package/src/components/ActionTable/Form/Fields/NewPasswordField.vue +10 -10
- package/src/components/ActionTable/Form/Fields/NumberField.vue +29 -29
- package/src/components/ActionTable/Form/Fields/NumberRangeField.vue +33 -33
- package/src/components/ActionTable/Form/Fields/SelectDrawer.vue +36 -36
- package/src/components/ActionTable/Form/Fields/SelectField.vue +66 -66
- package/src/components/ActionTable/Form/Fields/SelectWithChildrenField.vue +23 -23
- package/src/components/ActionTable/Form/Fields/SingleFileField.vue +32 -32
- package/src/components/ActionTable/Form/Fields/TextField.vue +36 -36
- package/src/components/ActionTable/Form/Fields/WysiwygField.vue +16 -16
- package/src/components/ActionTable/Form/Fields/index.ts +23 -23
- package/src/components/ActionTable/Form/RenderedForm.vue +27 -25
- package/src/components/ActionTable/Form/index.ts +2 -0
- package/src/components/ActionTable/TableSummaryRow.vue +33 -33
- package/src/components/ActionTable/index.ts +8 -13
- package/src/components/ActionTable/listActions.ts +340 -339
- package/src/components/ActionTable/listHelpers.ts +74 -0
- package/src/components/ActionTable/tableColumns.ts +56 -56
- package/src/components/DragAndDrop/HandleDraggable.vue +29 -29
- package/src/components/DragAndDrop/ListItemDraggable.vue +10 -10
- package/src/components/DragAndDrop/index.ts +0 -1
- package/src/components/DragAndDrop/listDragAndDrop.ts +1 -1
- package/src/components/Utility/CollapsableSidebar.vue +35 -35
- package/src/components/Utility/ContentDrawer.vue +20 -20
- package/src/components/Utility/Dialogs/ConfirmDialog.vue +55 -55
- package/src/components/Utility/Dialogs/FullScreenDialog.vue +18 -18
- package/src/components/Utility/Dialogs/FullscreenCarouselDialog.vue +105 -0
- package/src/components/Utility/Dialogs/InfoDialog.vue +10 -10
- package/src/components/Utility/Dialogs/InputDialog.vue +13 -13
- package/src/components/Utility/ImagePreview.vue +192 -0
- package/src/components/Utility/Popover/PopoverMenu.vue +64 -0
- package/src/components/Utility/Transitions/StaggeredListTransition.vue +15 -15
- package/src/components/Utility/index.ts +11 -9
- package/src/components/index.ts +1 -1
- package/src/helpers/FileUpload.ts +274 -273
- package/src/helpers/compatibility.ts +45 -45
- package/src/helpers/date.ts +2 -2
- package/src/helpers/download.ts +166 -158
- package/src/helpers/downloadPdf.ts +48 -48
- package/src/helpers/files.ts +42 -42
- package/src/helpers/index.ts +2 -0
- package/src/helpers/multiFileUpload.ts +56 -56
- package/src/helpers/singleFileUpload.ts +49 -49
- package/src/index.esm.js +3 -4
- package/src/svg/FilterIcon.svg +7 -0
- package/src/svg/ImageIcon.svg +30 -0
- package/src/svg/PdfIcon.svg +21 -0
- package/src/svg/PercentIcon.svg +13 -0
- package/src/svg/TrashIcon.svg +15 -0
- package/src/svg/XIcon.svg +18 -0
- package/src/svg/index.ts +8 -0
- package/src/vendor/tinymce-config.ts +1 -0
- package/src/vue-plugin.js +7 -4
- package/tsconfig.json +14 -13
- package/src/components/ActionTable/tableHelpers.ts +0 -83
- package/src/components/DragAndDrop/Icons/index.ts +0 -2
- /package/src/{components/DragAndDrop/Icons → svg}/DragHandleDotsIcon.svg +0 -0
- /package/src/{components/DragAndDrop/Icons → svg}/DragHandleIcon.svg +0 -0
@@ -2,20 +2,20 @@
|
|
2
2
|
<div>
|
3
3
|
<template v-if="field.type === 'multi-select'">
|
4
4
|
<SelectField
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
5
|
+
v-if="field.options?.length > 0 || loading"
|
6
|
+
:model-value="modelValue"
|
7
|
+
:options="field.options"
|
8
|
+
multiple
|
9
|
+
:loading="loading"
|
10
|
+
:chip-limit="1"
|
11
|
+
filterable
|
12
|
+
:placeholder="field.placeholder"
|
13
|
+
:label="field.label"
|
14
|
+
@update:model-value="onUpdate"
|
15
15
|
/>
|
16
16
|
<div
|
17
|
-
|
18
|
-
|
17
|
+
v-else
|
18
|
+
class="mt-2"
|
19
19
|
>
|
20
20
|
<div class="text-xs font-bold">{{ field.label }}</div>
|
21
21
|
<div class="text-sm ml-3 py-2">No Available Options</div>
|
@@ -23,78 +23,78 @@
|
|
23
23
|
</template>
|
24
24
|
|
25
25
|
<SelectField
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
26
|
+
v-else-if="field.type === 'single-select'"
|
27
|
+
:model-value="modelValue"
|
28
|
+
:options="field.options"
|
29
|
+
:placeholder="field.placeholder"
|
30
|
+
:loading="loading"
|
31
|
+
:label="field.label"
|
32
|
+
@update:model-value="onUpdate"
|
33
33
|
/>
|
34
34
|
<DateField
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
35
|
+
v-else-if="field.type === 'date'"
|
36
|
+
:model-value="modelValue"
|
37
|
+
:label="field.label"
|
38
|
+
class="mt-2"
|
39
|
+
@update:model-value="onUpdate"
|
40
40
|
/>
|
41
41
|
<DateRangeField
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
42
|
+
v-else-if="field.type === 'date-range'"
|
43
|
+
:model-value="modelValue"
|
44
|
+
:label="field.label"
|
45
|
+
:inline="field.inline"
|
46
|
+
with-time
|
47
|
+
class="mt-2 reactive"
|
48
|
+
@update:model-value="onUpdate"
|
49
49
|
/>
|
50
50
|
<NumberRangeField
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
51
|
+
v-else-if="field.type === 'number-range'"
|
52
|
+
:model-value="modelValue"
|
53
|
+
:label="field.label"
|
54
|
+
class="mt-2"
|
55
|
+
:debounce="1000"
|
56
|
+
@update:model-value="onUpdate"
|
57
57
|
/>
|
58
58
|
<NumberRangeField
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
59
|
+
v-else-if="field.type === 'currency-range'"
|
60
|
+
:model-value="modelValue"
|
61
|
+
:label="field.label"
|
62
|
+
class="mt-2"
|
63
|
+
:debounce="1000"
|
64
|
+
currency
|
65
|
+
@update:model-value="onUpdate"
|
66
66
|
/>
|
67
67
|
<NumberRangeField
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
68
|
+
v-else-if="field.type === 'percent-range'"
|
69
|
+
:model-value="modelValue"
|
70
|
+
:label="field.label"
|
71
|
+
class="mt-2"
|
72
|
+
:debounce="1000"
|
73
|
+
percent
|
74
|
+
@update:model-value="onUpdate"
|
75
75
|
/>
|
76
76
|
<BooleanField
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
77
|
+
v-else-if="field.type === 'boolean'"
|
78
|
+
:field="field"
|
79
|
+
:model-value="modelValue"
|
80
|
+
class="mt-2"
|
81
|
+
label-class="text-xs font-bold"
|
82
|
+
@update:model-value="onUpdate"
|
83
83
|
/>
|
84
84
|
<MultiKeywordField
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
85
|
+
v-else-if="field.type === 'multi-keywords'"
|
86
|
+
:model-value="modelValue"
|
87
|
+
:field="field"
|
88
|
+
@update:model-value="onUpdate"
|
89
89
|
/>
|
90
90
|
<SelectWithChildrenField
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
91
|
+
v-else-if="field.type === 'select-with-children'"
|
92
|
+
:model-value="modelValue"
|
93
|
+
:options="field.options"
|
94
|
+
:loading="loading"
|
95
|
+
:label="field.label"
|
96
|
+
:placeholder="field.placeholder"
|
97
|
+
@update:model-value="onUpdate"
|
98
98
|
/>
|
99
99
|
<template v-else>
|
100
100
|
Field "{{ field.name }}": Unknown filter type {{ field.type }}
|
@@ -102,15 +102,17 @@
|
|
102
102
|
</div>
|
103
103
|
</template>
|
104
104
|
<script setup>
|
105
|
-
import
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
105
|
+
import {
|
106
|
+
BooleanField,
|
107
|
+
DateField,
|
108
|
+
DateRangeField,
|
109
|
+
MultiKeywordField,
|
110
|
+
NumberRangeField,
|
111
|
+
SelectField,
|
112
|
+
SelectWithChildrenField
|
113
|
+
} from '@ui/components';
|
112
114
|
|
113
|
-
const emit = defineEmits([
|
115
|
+
const emit = defineEmits(['update:model-value']);
|
114
116
|
const props = defineProps({
|
115
117
|
field: {
|
116
118
|
type: Object,
|
@@ -127,15 +129,15 @@ function onUpdate(val) {
|
|
127
129
|
let newVal = val || undefined;
|
128
130
|
|
129
131
|
switch (props.field.type) {
|
130
|
-
case
|
132
|
+
case 'multi-select':
|
131
133
|
newVal = val.length > 0 ? val : undefined;
|
132
134
|
break;
|
133
|
-
case
|
134
|
-
case
|
135
|
+
case 'single-select':
|
136
|
+
case 'boolean':
|
135
137
|
newVal = val === null ? undefined : val;
|
136
138
|
break;
|
137
139
|
}
|
138
140
|
|
139
|
-
emit(
|
141
|
+
emit('update:model-value', newVal);
|
140
142
|
}
|
141
143
|
</script>
|
@@ -1,23 +1,23 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
2
|
+
<q-toggle
|
3
|
+
:data-testid="'boolean-field-' + field.id"
|
4
|
+
:model-value="modelValue"
|
5
|
+
:toggle-indeterminate="toggleIndeterminate"
|
6
|
+
:indeterminate-value="undefined"
|
7
|
+
@update:model-value="$emit('update:model-value', $event)"
|
8
8
|
>
|
9
9
|
<FieldLabel
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
:field="field"
|
11
|
+
:show-name="showName"
|
12
|
+
:class="labelClass"
|
13
13
|
/>
|
14
|
-
|
14
|
+
</q-toggle>
|
15
15
|
</template>
|
16
16
|
|
17
17
|
<script setup>
|
18
|
-
import FieldLabel from
|
18
|
+
import FieldLabel from './FieldLabel';
|
19
19
|
|
20
|
-
defineEmits([
|
20
|
+
defineEmits(['update:model-value']);
|
21
21
|
defineProps({
|
22
22
|
modelValue: {
|
23
23
|
type: [Boolean],
|
@@ -29,7 +29,7 @@ defineProps({
|
|
29
29
|
},
|
30
30
|
labelClass: {
|
31
31
|
type: String,
|
32
|
-
default:
|
32
|
+
default: 'text-sm'
|
33
33
|
},
|
34
34
|
showName: Boolean,
|
35
35
|
toggleIndeterminate: Boolean
|
@@ -1,28 +1,28 @@
|
|
1
1
|
<template>
|
2
2
|
<LabeledInput
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
type="password"
|
4
|
+
v-bind="props"
|
5
|
+
:rules="rules"
|
6
|
+
@update:model-value="$emit('update:model-value', $event)"
|
7
7
|
/>
|
8
8
|
</template>
|
9
9
|
|
10
10
|
<script setup>
|
11
|
-
import LabeledInput from
|
11
|
+
import LabeledInput from './LabeledInput';
|
12
12
|
|
13
|
-
defineEmits([
|
13
|
+
defineEmits(['update:model-value']);
|
14
14
|
const props = defineProps({
|
15
15
|
name: {
|
16
16
|
type: String,
|
17
|
-
default:
|
17
|
+
default: 'password_confirmation'
|
18
18
|
},
|
19
19
|
label: {
|
20
20
|
type: String,
|
21
|
-
default:
|
21
|
+
default: 'Confirm Password'
|
22
22
|
},
|
23
23
|
placeholder: {
|
24
24
|
type: String,
|
25
|
-
default:
|
25
|
+
default: 'Confirm Password'
|
26
26
|
},
|
27
27
|
modelValue: {
|
28
28
|
type: [String, Number],
|
@@ -34,13 +34,13 @@ const props = defineProps({
|
|
34
34
|
},
|
35
35
|
password: {
|
36
36
|
type: String,
|
37
|
-
default:
|
37
|
+
default: ''
|
38
38
|
},
|
39
39
|
disabled: Boolean
|
40
40
|
});
|
41
41
|
|
42
42
|
const rules = [
|
43
43
|
(val) =>
|
44
|
-
|
44
|
+
val === props.password || 'The password and confirmation do not match'
|
45
45
|
];
|
46
46
|
</script>
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<template>
|
2
2
|
<div>
|
3
3
|
<div
|
4
|
-
|
5
|
-
|
4
|
+
v-if="label"
|
5
|
+
class="font-bold text-xs mb-2"
|
6
6
|
>
|
7
7
|
{{ label }}
|
8
8
|
</div>
|
@@ -17,21 +17,21 @@
|
|
17
17
|
</template>
|
18
18
|
</div>
|
19
19
|
</div>
|
20
|
-
<
|
21
|
-
<
|
22
|
-
|
23
|
-
|
20
|
+
<q-popup-proxy>
|
21
|
+
<q-date
|
22
|
+
v-model="date"
|
23
|
+
@update:model-value="onSave"
|
24
24
|
/>
|
25
|
-
</
|
25
|
+
</q-popup-proxy>
|
26
26
|
</div>
|
27
27
|
</template>
|
28
28
|
|
29
29
|
<script setup>
|
30
|
-
import { CalendarIcon as DateIcon } from
|
31
|
-
import { fDate, parseQDate } from
|
32
|
-
import { computed, ref, watch } from
|
30
|
+
import { CalendarIcon as DateIcon } from '@heroicons/vue/outline';
|
31
|
+
import { fDate, parseQDate } from '@ui/helpers/formats';
|
32
|
+
import { computed, ref, watch } from 'vue';
|
33
33
|
|
34
|
-
const emit = defineEmits([
|
34
|
+
const emit = defineEmits(['update:model-value']);
|
35
35
|
const props = defineProps({
|
36
36
|
modelValue: {
|
37
37
|
type: [String, Object],
|
@@ -45,7 +45,7 @@ const props = defineProps({
|
|
45
45
|
|
46
46
|
const formattedDate = computed(() => {
|
47
47
|
if (props.modelValue) {
|
48
|
-
return fDate(parseQDate(props.modelValue ||
|
48
|
+
return fDate(parseQDate(props.modelValue || '0000-00-00'));
|
49
49
|
}
|
50
50
|
return null;
|
51
51
|
});
|
@@ -54,6 +54,6 @@ const date = ref(props.modelValue);
|
|
54
54
|
watch(() => props.modelValue, val => date.value = val);
|
55
55
|
|
56
56
|
function onSave() {
|
57
|
-
emit(
|
57
|
+
emit('update:model-value', date.value);
|
58
58
|
}
|
59
59
|
</script>
|
@@ -1,17 +1,17 @@
|
|
1
1
|
<template>
|
2
2
|
<div>
|
3
3
|
<div
|
4
|
-
|
5
|
-
|
4
|
+
v-if="label"
|
5
|
+
class="font-bold text-xs mb-2"
|
6
6
|
>
|
7
7
|
{{ label }}
|
8
8
|
</div>
|
9
9
|
<template v-if="inline">
|
10
|
-
<
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
<q-date
|
11
|
+
v-model="dateRange"
|
12
|
+
range
|
13
|
+
class="reactive"
|
14
|
+
@update:model-value="onSave"
|
15
15
|
/>
|
16
16
|
</template>
|
17
17
|
<template v-else>
|
@@ -26,23 +26,23 @@
|
|
26
26
|
</template>
|
27
27
|
</div>
|
28
28
|
</div>
|
29
|
-
<
|
30
|
-
<
|
31
|
-
|
32
|
-
|
33
|
-
|
29
|
+
<q-popup-proxy>
|
30
|
+
<q-date
|
31
|
+
v-model="dateRange"
|
32
|
+
range
|
33
|
+
@update:model-value="onSave"
|
34
34
|
/>
|
35
|
-
</
|
35
|
+
</q-popup-proxy>
|
36
36
|
</template>
|
37
37
|
</div>
|
38
38
|
</template>
|
39
39
|
|
40
40
|
<script setup>
|
41
|
-
import { CalendarIcon as DateIcon } from
|
42
|
-
import { fDate, parseQDate, parseQDateTime } from
|
43
|
-
import { computed, ref, watch } from
|
41
|
+
import { CalendarIcon as DateIcon } from '@heroicons/vue/outline';
|
42
|
+
import { fDate, parseQDate, parseQDateTime } from '@ui/helpers/formats';
|
43
|
+
import { computed, ref, watch } from 'vue';
|
44
44
|
|
45
|
-
const emit = defineEmits([
|
45
|
+
const emit = defineEmits(['update:model-value']);
|
46
46
|
const props = defineProps({
|
47
47
|
modelValue: {
|
48
48
|
type: Object,
|
@@ -60,14 +60,14 @@ const formattedDates = computed(() => {
|
|
60
60
|
if (dateRangeValue.value) {
|
61
61
|
if (props.withTime) {
|
62
62
|
return {
|
63
|
-
from: fDate(parseQDateTime(dateRangeValue.value.from ||
|
64
|
-
to: fDate(parseQDateTime(dateRangeValue.value.to ||
|
63
|
+
from: fDate(parseQDateTime(dateRangeValue.value.from || '0000-00-00')),
|
64
|
+
to: fDate(parseQDateTime(dateRangeValue.value.to || '9999-12-31'))
|
65
65
|
};
|
66
66
|
}
|
67
67
|
|
68
68
|
return {
|
69
|
-
from: fDate(parseQDate(dateRangeValue.value.from ||
|
70
|
-
to: fDate(parseQDate(dateRangeValue.value.to ||
|
69
|
+
from: fDate(parseQDate(dateRangeValue.value.from || '0000-00-00')),
|
70
|
+
to: fDate(parseQDate(dateRangeValue.value.to || '9999-12-31'))
|
71
71
|
};
|
72
72
|
}
|
73
73
|
return {
|
@@ -89,7 +89,7 @@ function toQDateValue(val) {
|
|
89
89
|
const dateRangeValue = computed(() => {
|
90
90
|
let range = dateRange.value;
|
91
91
|
|
92
|
-
if (typeof range ===
|
92
|
+
if (typeof range === 'string') {
|
93
93
|
range = {
|
94
94
|
from: range,
|
95
95
|
to: range
|
@@ -97,14 +97,14 @@ const dateRangeValue = computed(() => {
|
|
97
97
|
}
|
98
98
|
|
99
99
|
if (range?.from && range?.to && props.withTime) {
|
100
|
-
range.from +=
|
101
|
-
range.to +=
|
100
|
+
range.from += ' 00:00:00';
|
101
|
+
range.to += ' 23:59:59';
|
102
102
|
}
|
103
103
|
|
104
104
|
return range;
|
105
105
|
});
|
106
106
|
|
107
107
|
function onSave() {
|
108
|
-
emit(
|
108
|
+
emit('update:model-value', dateRangeValue.value);
|
109
109
|
}
|
110
110
|
</script>
|
@@ -1,34 +1,34 @@
|
|
1
1
|
<template>
|
2
2
|
<div>
|
3
|
-
<
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
3
|
+
<q-input
|
4
|
+
:model-value="fLocalizedDateTime(modelValue)"
|
5
|
+
:color="color"
|
6
|
+
class="bg-white rounded overflow-hidden px-2 w-48"
|
7
|
+
dense
|
8
|
+
readonly
|
9
|
+
@click="isShowing = true"
|
10
10
|
>
|
11
11
|
<template #append>
|
12
|
-
<
|
13
|
-
<
|
12
|
+
<q-icon name="event" class="cursor-pointer">
|
13
|
+
<q-popup-proxy v-model="isShowing">
|
14
14
|
<DateTimePicker
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
v-model="dateTime"
|
16
|
+
@cancel="isShowing = false"
|
17
|
+
@save="onSave"
|
18
18
|
/>
|
19
|
-
</
|
20
|
-
</
|
19
|
+
</q-popup-proxy>
|
20
|
+
</q-icon>
|
21
21
|
</template>
|
22
|
-
|
22
|
+
</q-input>
|
23
23
|
</div>
|
24
24
|
</template>
|
25
25
|
|
26
26
|
<script setup>
|
27
|
-
import
|
28
|
-
import {
|
29
|
-
import
|
27
|
+
import { fLocalizedDateTime } from '@ui/helpers/formats';
|
28
|
+
import { ref } from 'vue';
|
29
|
+
import DateTimePicker from './DateTimePicker';
|
30
30
|
|
31
|
-
const emit = defineEmits([
|
31
|
+
const emit = defineEmits(['update:model-value']);
|
32
32
|
const props = defineProps({
|
33
33
|
modelValue: {
|
34
34
|
type: String,
|
@@ -36,7 +36,7 @@ const props = defineProps({
|
|
36
36
|
},
|
37
37
|
color: {
|
38
38
|
type: String,
|
39
|
-
default:
|
39
|
+
default: 'blue-base'
|
40
40
|
}
|
41
41
|
});
|
42
42
|
|
@@ -44,7 +44,7 @@ const isShowing = ref(false);
|
|
44
44
|
const dateTime = ref(props.modelValue);
|
45
45
|
|
46
46
|
function onSave() {
|
47
|
-
emit(
|
47
|
+
emit('update:model-value', dateTime.value);
|
48
48
|
isShowing.value = false;
|
49
49
|
}
|
50
50
|
</script>
|
@@ -1,35 +1,35 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
2
|
+
<q-popup-proxy
|
3
|
+
:model-value="true"
|
4
|
+
cover
|
5
|
+
transition-show="scale"
|
6
|
+
transition-hide="scale"
|
7
|
+
class="bg-transparent shadow-none flex items-stretch"
|
8
8
|
>
|
9
|
-
<
|
9
|
+
<q-date v-model="dateTime" :mask="mask" :color="color">
|
10
10
|
<div class="flex items-center justify-center">
|
11
11
|
<div v-if="nullable" class="flex-grow">
|
12
|
-
<
|
12
|
+
<q-btn label="Clear" color="blue-base" flat @click="dateTime = null" />
|
13
13
|
</div>
|
14
14
|
<div>
|
15
|
-
<
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
15
|
+
<q-btn
|
16
|
+
label="Cancel"
|
17
|
+
color="blue-base"
|
18
|
+
flat
|
19
|
+
@click="$emit('cancel')"
|
20
20
|
/>
|
21
|
-
<
|
21
|
+
<q-btn label="Set" color="blue-base" flat @click="$emit('save')" />
|
22
22
|
</div>
|
23
23
|
</div>
|
24
|
-
</
|
25
|
-
<
|
26
|
-
</
|
24
|
+
</q-date>
|
25
|
+
<q-time v-model="dateTime" :mask="mask" :color="color" class="ml-3" />
|
26
|
+
</q-popup-proxy>
|
27
27
|
</template>
|
28
28
|
<script setup>
|
29
|
-
import { dbDateTime, localizedDateTime, remoteDateTime } from
|
30
|
-
import { computed } from
|
29
|
+
import { dbDateTime, localizedDateTime, remoteDateTime } from '@ui/helpers/formats';
|
30
|
+
import { computed } from 'vue';
|
31
31
|
|
32
|
-
const emit = defineEmits([
|
32
|
+
const emit = defineEmits(['update:modelValue', 'save', 'cancel', 'clear']);
|
33
33
|
const props = defineProps({
|
34
34
|
modelValue: {
|
35
35
|
type: String,
|
@@ -37,11 +37,11 @@ const props = defineProps({
|
|
37
37
|
},
|
38
38
|
mask: {
|
39
39
|
type: String,
|
40
|
-
default:
|
40
|
+
default: 'YYYY-MM-DD HH:mm'
|
41
41
|
},
|
42
42
|
color: {
|
43
43
|
type: String,
|
44
|
-
default:
|
44
|
+
default: 'blue-base'
|
45
45
|
},
|
46
46
|
nullable: Boolean
|
47
47
|
});
|
@@ -52,7 +52,7 @@ const dateTime = computed({
|
|
52
52
|
const newValue = value ? dbDateTime(remoteDateTime(value)) : null;
|
53
53
|
|
54
54
|
if (newValue || props.nullable) {
|
55
|
-
emit(
|
55
|
+
emit('update:modelValue', newValue);
|
56
56
|
}
|
57
57
|
}
|
58
58
|
});
|