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.
Files changed (80) hide show
  1. package/package.json +6 -1
  2. package/src/components/ActionTable/ActionTable.vue +49 -41
  3. package/src/components/ActionTable/BatchActionMenu.vue +20 -20
  4. package/src/components/ActionTable/EmptyTableState.vue +5 -5
  5. package/src/components/ActionTable/Filters/CollapsableFiltersSidebar.vue +11 -11
  6. package/src/components/ActionTable/Filters/FilterGroupItem.vue +7 -7
  7. package/src/components/ActionTable/Filters/FilterGroupList.vue +29 -29
  8. package/src/components/ActionTable/Filters/FilterListToggle.vue +15 -15
  9. package/src/components/ActionTable/Filters/FilterableField.vue +82 -80
  10. package/src/components/ActionTable/Filters/index.ts +5 -0
  11. package/src/components/ActionTable/Form/Fields/BooleanField.vue +13 -13
  12. package/src/components/ActionTable/Form/Fields/ConfirmPasswordField.vue +11 -11
  13. package/src/components/ActionTable/Form/Fields/DateField.vue +13 -13
  14. package/src/components/ActionTable/Form/Fields/DateRangeField.vue +25 -25
  15. package/src/components/ActionTable/Form/Fields/DateTimeField.vue +21 -21
  16. package/src/components/ActionTable/Form/Fields/DateTimePicker.vue +23 -23
  17. package/src/components/ActionTable/Form/Fields/FileUploadButton.vue +31 -31
  18. package/src/components/ActionTable/Form/Fields/InlineDateTimeField.vue +19 -19
  19. package/src/components/ActionTable/Form/Fields/IntegerField.vue +7 -7
  20. package/src/components/ActionTable/Form/Fields/LabelValueBlock.vue +22 -0
  21. package/src/components/ActionTable/Form/Fields/LabeledInput.vue +19 -19
  22. package/src/components/ActionTable/Form/Fields/MultiFileField.vue +40 -40
  23. package/src/components/ActionTable/Form/Fields/MultiKeywordField.vue +23 -23
  24. package/src/components/ActionTable/Form/Fields/NewPasswordField.vue +10 -10
  25. package/src/components/ActionTable/Form/Fields/NumberField.vue +29 -29
  26. package/src/components/ActionTable/Form/Fields/NumberRangeField.vue +33 -33
  27. package/src/components/ActionTable/Form/Fields/SelectDrawer.vue +36 -36
  28. package/src/components/ActionTable/Form/Fields/SelectField.vue +66 -66
  29. package/src/components/ActionTable/Form/Fields/SelectWithChildrenField.vue +23 -23
  30. package/src/components/ActionTable/Form/Fields/SingleFileField.vue +32 -32
  31. package/src/components/ActionTable/Form/Fields/TextField.vue +36 -36
  32. package/src/components/ActionTable/Form/Fields/WysiwygField.vue +16 -16
  33. package/src/components/ActionTable/Form/Fields/index.ts +23 -23
  34. package/src/components/ActionTable/Form/RenderedForm.vue +27 -25
  35. package/src/components/ActionTable/Form/index.ts +2 -0
  36. package/src/components/ActionTable/TableSummaryRow.vue +33 -33
  37. package/src/components/ActionTable/index.ts +8 -13
  38. package/src/components/ActionTable/listActions.ts +340 -339
  39. package/src/components/ActionTable/listHelpers.ts +74 -0
  40. package/src/components/ActionTable/tableColumns.ts +56 -56
  41. package/src/components/DragAndDrop/HandleDraggable.vue +29 -29
  42. package/src/components/DragAndDrop/ListItemDraggable.vue +10 -10
  43. package/src/components/DragAndDrop/index.ts +0 -1
  44. package/src/components/DragAndDrop/listDragAndDrop.ts +1 -1
  45. package/src/components/Utility/CollapsableSidebar.vue +35 -35
  46. package/src/components/Utility/ContentDrawer.vue +20 -20
  47. package/src/components/Utility/Dialogs/ConfirmDialog.vue +55 -55
  48. package/src/components/Utility/Dialogs/FullScreenDialog.vue +18 -18
  49. package/src/components/Utility/Dialogs/FullscreenCarouselDialog.vue +105 -0
  50. package/src/components/Utility/Dialogs/InfoDialog.vue +10 -10
  51. package/src/components/Utility/Dialogs/InputDialog.vue +13 -13
  52. package/src/components/Utility/ImagePreview.vue +192 -0
  53. package/src/components/Utility/Popover/PopoverMenu.vue +64 -0
  54. package/src/components/Utility/Transitions/StaggeredListTransition.vue +15 -15
  55. package/src/components/Utility/index.ts +11 -9
  56. package/src/components/index.ts +1 -1
  57. package/src/helpers/FileUpload.ts +274 -273
  58. package/src/helpers/compatibility.ts +45 -45
  59. package/src/helpers/date.ts +2 -2
  60. package/src/helpers/download.ts +166 -158
  61. package/src/helpers/downloadPdf.ts +48 -48
  62. package/src/helpers/files.ts +42 -42
  63. package/src/helpers/index.ts +2 -0
  64. package/src/helpers/multiFileUpload.ts +56 -56
  65. package/src/helpers/singleFileUpload.ts +49 -49
  66. package/src/index.esm.js +3 -4
  67. package/src/svg/FilterIcon.svg +7 -0
  68. package/src/svg/ImageIcon.svg +30 -0
  69. package/src/svg/PdfIcon.svg +21 -0
  70. package/src/svg/PercentIcon.svg +13 -0
  71. package/src/svg/TrashIcon.svg +15 -0
  72. package/src/svg/XIcon.svg +18 -0
  73. package/src/svg/index.ts +8 -0
  74. package/src/vendor/tinymce-config.ts +1 -0
  75. package/src/vue-plugin.js +7 -4
  76. package/tsconfig.json +14 -13
  77. package/src/components/ActionTable/tableHelpers.ts +0 -83
  78. package/src/components/DragAndDrop/Icons/index.ts +0 -2
  79. /package/src/{components/DragAndDrop/Icons → svg}/DragHandleDotsIcon.svg +0 -0
  80. /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
- 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"
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
- v-else
18
- class="mt-2"
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
- 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"
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
- v-else-if="field.type === 'date'"
36
- :model-value="modelValue"
37
- :label="field.label"
38
- class="mt-2"
39
- @update:model-value="onUpdate"
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
- 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"
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
- 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"
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
- 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"
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
- 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"
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
- 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"
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
- v-else-if="field.type === 'multi-keywords'"
86
- :model-value="modelValue"
87
- :field="field"
88
- @update:model-value="onUpdate"
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
- 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"
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 &quot;{{ field.name }}&quot;: Unknown filter type {{ field.type }}
@@ -102,15 +102,17 @@
102
102
  </div>
103
103
  </template>
104
104
  <script setup>
105
- import BooleanField from "danx/src/components/ActionTable/Form/Fields/BooleanField";
106
- import DateField from "danx/src/components/ActionTable/Form/Fields/DateField";
107
- import DateRangeField from "danx/src/components/ActionTable/Form/Fields/DateRangeField";
108
- import MultiKeywordField from "danx/src/components/ActionTable/Form/Fields/MultiKeywordField";
109
- import NumberRangeField from "danx/src/components/ActionTable/Form/Fields/NumberRangeField";
110
- import SelectField from "danx/src/components/ActionTable/Form/Fields/SelectField";
111
- import SelectWithChildrenField from "danx/src/components/ActionTable/Form/Fields/SelectWithChildrenField";
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(["update:model-value"]);
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 "multi-select":
132
+ case 'multi-select':
131
133
  newVal = val.length > 0 ? val : undefined;
132
134
  break;
133
- case "single-select":
134
- case "boolean":
135
+ case 'single-select':
136
+ case 'boolean':
135
137
  newVal = val === null ? undefined : val;
136
138
  break;
137
139
  }
138
140
 
139
- emit("update:model-value", newVal);
141
+ emit('update:model-value', newVal);
140
142
  }
141
143
  </script>
@@ -0,0 +1,5 @@
1
+ export {
2
+ default as CollapsableFiltersSidebar
3
+ } from "./CollapsableFiltersSidebar.vue";
4
+ export { default as FilterGroupList } from "./FilterGroupList.vue";
5
+ export { default as FilterListToggle } from "./FilterListToggle.vue";
@@ -1,23 +1,23 @@
1
1
  <template>
2
- <QToggle
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)"
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
- :field="field"
11
- :show-name="showName"
12
- :class="labelClass"
10
+ :field="field"
11
+ :show-name="showName"
12
+ :class="labelClass"
13
13
  />
14
- </QToggle>
14
+ </q-toggle>
15
15
  </template>
16
16
 
17
17
  <script setup>
18
- import FieldLabel from "./FieldLabel";
18
+ import FieldLabel from './FieldLabel';
19
19
 
20
- defineEmits(["update:model-value"]);
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: "text-sm"
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
- type="password"
4
- v-bind="props"
5
- :rules="rules"
6
- @update:model-value="$emit('update:model-value', $event)"
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 "danx/src/components/ActionTable/Form/Fields/LabeledInput";
11
+ import LabeledInput from './LabeledInput';
12
12
 
13
- defineEmits(["update:model-value"]);
13
+ defineEmits(['update:model-value']);
14
14
  const props = defineProps({
15
15
  name: {
16
16
  type: String,
17
- default: "password_confirmation"
17
+ default: 'password_confirmation'
18
18
  },
19
19
  label: {
20
20
  type: String,
21
- default: "Confirm Password"
21
+ default: 'Confirm Password'
22
22
  },
23
23
  placeholder: {
24
24
  type: String,
25
- default: "Confirm Password"
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
- val === props.password || "The password and confirmation do not match"
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
- v-if="label"
5
- class="font-bold text-xs mb-2"
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
- <QPopupProxy>
21
- <QDate
22
- v-model="date"
23
- @update:model-value="onSave"
20
+ <q-popup-proxy>
21
+ <q-date
22
+ v-model="date"
23
+ @update:model-value="onSave"
24
24
  />
25
- </QPopupProxy>
25
+ </q-popup-proxy>
26
26
  </div>
27
27
  </template>
28
28
 
29
29
  <script setup>
30
- import { CalendarIcon as DateIcon } from "@heroicons/vue/outline";
31
- import { fDate, parseQDate } from "danx/src/helpers/formats";
32
- import { computed, ref, watch } from "vue";
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(["update:model-value"]);
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 || "0000-00-00"));
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("update:model-value", date.value);
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
- v-if="label"
5
- class="font-bold text-xs mb-2"
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
- <QDate
11
- v-model="dateRange"
12
- range
13
- class="reactive"
14
- @update:model-value="onSave"
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
- <QPopupProxy>
30
- <QDate
31
- v-model="dateRange"
32
- range
33
- @update:model-value="onSave"
29
+ <q-popup-proxy>
30
+ <q-date
31
+ v-model="dateRange"
32
+ range
33
+ @update:model-value="onSave"
34
34
  />
35
- </QPopupProxy>
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 "@heroicons/vue/outline";
42
- import { fDate, parseQDate, parseQDateTime } from "danx/src/helpers/formats";
43
- import { computed, ref, watch } from "vue";
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(["update:model-value"]);
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 || "0000-00-00")),
64
- to: fDate(parseQDateTime(dateRangeValue.value.to || "9999-12-31"))
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 || "0000-00-00")),
70
- to: fDate(parseQDate(dateRangeValue.value.to || "9999-12-31"))
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 === "string") {
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 += " 00:00:00";
101
- range.to += " 23:59:59";
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("update:model-value", dateRangeValue.value);
108
+ emit('update:model-value', dateRangeValue.value);
109
109
  }
110
110
  </script>
@@ -1,34 +1,34 @@
1
1
  <template>
2
2
  <div>
3
- <QInput
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"
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
- <QIcon name="event" class="cursor-pointer">
13
- <QPopupProxy v-model="isShowing">
12
+ <q-icon name="event" class="cursor-pointer">
13
+ <q-popup-proxy v-model="isShowing">
14
14
  <DateTimePicker
15
- v-model="dateTime"
16
- @cancel="isShowing = false"
17
- @save="onSave"
15
+ v-model="dateTime"
16
+ @cancel="isShowing = false"
17
+ @save="onSave"
18
18
  />
19
- </QPopupProxy>
20
- </QIcon>
19
+ </q-popup-proxy>
20
+ </q-icon>
21
21
  </template>
22
- </QInput>
22
+ </q-input>
23
23
  </div>
24
24
  </template>
25
25
 
26
26
  <script setup>
27
- import DateTimePicker from "danx/src/components/ActionTable/Form/Fields/DateTimePicker";
28
- import { fLocalizedDateTime } from "danx/src/helpers/formats";
29
- import { ref } from "vue";
27
+ import { fLocalizedDateTime } from '@ui/helpers/formats';
28
+ import { ref } from 'vue';
29
+ import DateTimePicker from './DateTimePicker';
30
30
 
31
- const emit = defineEmits(["update:model-value"]);
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: "blue-base"
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("update:model-value", dateTime.value);
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
- <QPopupProxy
3
- :model-value="true"
4
- cover
5
- transition-show="scale"
6
- transition-hide="scale"
7
- class="bg-transparent shadow-none flex items-stretch"
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
- <QDate v-model="dateTime" :mask="mask" :color="color">
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
- <QBtn label="Clear" color="blue-base" flat @click="dateTime = null" />
12
+ <q-btn label="Clear" color="blue-base" flat @click="dateTime = null" />
13
13
  </div>
14
14
  <div>
15
- <QBtn
16
- label="Cancel"
17
- color="blue-base"
18
- flat
19
- @click="$emit('cancel')"
15
+ <q-btn
16
+ label="Cancel"
17
+ color="blue-base"
18
+ flat
19
+ @click="$emit('cancel')"
20
20
  />
21
- <QBtn label="Set" color="blue-base" flat @click="$emit('save')" />
21
+ <q-btn label="Set" color="blue-base" flat @click="$emit('save')" />
22
22
  </div>
23
23
  </div>
24
- </QDate>
25
- <QTime v-model="dateTime" :mask="mask" :color="color" class="ml-3" />
26
- </QPopupProxy>
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 "danx/src/helpers/formats";
30
- import { computed } from "vue";
29
+ import { dbDateTime, localizedDateTime, remoteDateTime } from '@ui/helpers/formats';
30
+ import { computed } from 'vue';
31
31
 
32
- const emit = defineEmits(["update:modelValue", "save", "cancel", "clear"]);
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: "YYYY-MM-DD HH:mm"
40
+ default: 'YYYY-MM-DD HH:mm'
41
41
  },
42
42
  color: {
43
43
  type: String,
44
- default: "blue-base"
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("update:modelValue", newValue);
55
+ emit('update:modelValue', newValue);
56
56
  }
57
57
  }
58
58
  });