quasar-ui-sellmate-ui-kit 2.2.33 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/README.md +142 -142
  2. package/dist/index.common.js +3 -3
  3. package/dist/index.css +2 -2
  4. package/dist/index.esm.js +3 -3
  5. package/dist/index.min.css +2 -2
  6. package/dist/index.rtl.css +2 -2
  7. package/dist/index.rtl.min.css +2 -2
  8. package/dist/index.umd.js +3558 -3550
  9. package/dist/index.umd.min.js +3 -3
  10. package/package.json +75 -75
  11. package/src/components/SBreadcrumbs.vue +55 -55
  12. package/src/components/SButton.vue +206 -206
  13. package/src/components/SButtonGroup.vue +41 -41
  14. package/src/components/SCaution.vue +102 -102
  15. package/src/components/SCheckbox.vue +123 -123
  16. package/src/components/SChip.vue +99 -99
  17. package/src/components/SDate.vue +717 -717
  18. package/src/components/SDateAutoRangePicker.vue +341 -341
  19. package/src/components/SDatePicker.vue +472 -472
  20. package/src/components/SDateRange.vue +470 -470
  21. package/src/components/SDateRangePicker.vue +660 -660
  22. package/src/components/SDateTimePicker.vue +349 -349
  23. package/src/components/SDialog.vue +250 -250
  24. package/src/components/SDropdown.vue +216 -216
  25. package/src/components/SEditor.vue +490 -490
  26. package/src/components/SFilePicker.vue +207 -207
  27. package/src/components/SHelp.vue +146 -146
  28. package/src/components/SInput.vue +343 -343
  29. package/src/components/SInputCounter.vue +46 -46
  30. package/src/components/SInputNumber.vue +179 -179
  31. package/src/components/SList.vue +29 -29
  32. package/src/components/SMarkupTable.vue +141 -141
  33. package/src/components/SPagination.vue +266 -266
  34. package/src/components/SRadio.vue +78 -78
  35. package/src/components/SRouteTab.vue +67 -67
  36. package/src/components/SSelect.vue +294 -294
  37. package/src/components/SSelectCheckbox.vue +222 -225
  38. package/src/components/SSelectCustom.vue +25 -17
  39. package/src/components/SSelectGroupCheckbox.vue +235 -235
  40. package/src/components/SSelectSearch.vue +261 -261
  41. package/src/components/SSelectSearchAutoComplete.vue +172 -172
  42. package/src/components/SSelectSearchCheckbox.vue +356 -356
  43. package/src/components/SStringToInput.vue +66 -66
  44. package/src/components/STab.vue +80 -80
  45. package/src/components/STableTree.vue +208 -208
  46. package/src/components/STimePicker.vue +159 -159
  47. package/src/components/SToggle.vue +68 -68
  48. package/src/components/STooltip.vue +209 -209
  49. package/src/components/SelelctItem.vue +21 -21
  50. package/src/components/TimePickerCard.vue +352 -352
  51. package/src/composables/date.js +11 -11
  52. package/src/composables/modelBinder.js +13 -13
  53. package/src/composables/table/use-navigator.js +110 -110
  54. package/src/composables/table/use-resizable.js +80 -80
  55. package/src/css/app.scss +90 -90
  56. package/src/css/extends.scss +154 -154
  57. package/src/css/quasar.variables.scss +189 -189
  58. package/src/index.common.js +1 -1
  59. package/src/index.esm.js +4 -4
  60. package/src/index.scss +9 -9
  61. package/src/index.umd.js +3 -3
  62. package/src/vue-plugin.js +92 -92
@@ -1,352 +1,352 @@
1
- <template>
2
- <q-card class="time-picker-card flex no-wrap">
3
- <q-card-section class="ampm-section flex column flex-cneter">
4
- <s-button
5
- :label="language[lang].am"
6
- :outline="!isAm"
7
- :color="isAm ? 'positive' : 'Grey_Default'"
8
- @click="onClickAmPm(language[lang].am)"
9
- />
10
- <s-button
11
- :label="language[lang].pm"
12
- :outline="isAm"
13
- :color="!isAm ? 'positive' : 'Grey_Default'"
14
- class="q-mt-sm"
15
- @click="onClickAmPm(language[lang].pm)"
16
- />
17
- </q-card-section>
18
- <q-separator vertical color="Grey_Lighten-4" />
19
- <q-card-section class="time-section flex no-wrap flex-center">
20
- <div class="flex column flex-center">
21
- <s-button
22
- flat
23
- :icon="arrowUpIcon"
24
- color="Grey_Lighten-2"
25
- class="no-hover"
26
- @click="onClickUp('hh')"
27
- />
28
- <s-input
29
- v-model="timeUnitModel.hour"
30
- mask="##"
31
- maxlength="2"
32
- placeholder="00"
33
- debounce="600"
34
- @update:modelValue="
35
- val => {
36
- onUpdateTimeUnit(val, 'hour');
37
- }
38
- "
39
- @blur="formatTimeUnit"
40
- />
41
-
42
- <s-button
43
- flat
44
- :icon="arrowDownIcon"
45
- color="Grey_Lighten-2"
46
- class="no-hover"
47
- @click="onClickDown('hh')"
48
- />
49
- </div>
50
- <div class="q-mx-sm">:</div>
51
- <div class="flex column flex-center">
52
- <s-button
53
- flat
54
- :icon="arrowUpIcon"
55
- color="Grey_Lighten-2"
56
- class="no-hover"
57
- @click="onClickUp('mm')"
58
- />
59
- <s-input
60
- v-model="timeUnitModel.min"
61
- mask="##"
62
- maxlength="2"
63
- placeholder="00"
64
- debounce="600"
65
- @update:modelValue="
66
- val => {
67
- onUpdateTimeUnit(val, 'min');
68
- }
69
- "
70
- @blur="formatTimeUnit"
71
- />
72
-
73
- <s-button
74
- flat
75
- :icon="arrowDownIcon"
76
- color="Grey_Lighten-2"
77
- class="no-hover"
78
- @click="onClickDown('mm')"
79
- />
80
- </div>
81
- <div class="q-mx-sm" v-if="useSecond">:</div>
82
- <div class="flex column flex-center" v-if="useSecond">
83
- <s-button
84
- flat
85
- :icon="arrowUpIcon"
86
- color="Grey_Lighten-2"
87
- class="no-hover"
88
- @click="onClickUp('ss')"
89
- />
90
- <s-input
91
- v-model="timeUnitModel.sec"
92
- mask="##"
93
- maxlength="2"
94
- placeholder="00"
95
- debounce="600"
96
- @update:modelValue="
97
- val => {
98
- onUpdateTimeUnit(val, 'sec');
99
- }
100
- "
101
- @blur="formatTimeUnit"
102
- />
103
-
104
- <s-button
105
- flat
106
- :icon="arrowDownIcon"
107
- color="Grey_Lighten-2"
108
- class="no-hover"
109
- @click="onClickDown('ss')"
110
- />
111
- </div>
112
- </q-card-section>
113
- </q-card>
114
- </template>
115
-
116
- <script>
117
- import { ref, nextTick, watch } from 'vue';
118
- import { QCard, QCardSection, QSeparator, date } from 'quasar';
119
- import { useModelBinder } from '../composables/modelBinder';
120
- import { arrowUpIcon, arrowDownIcon } from '../assets/icons';
121
-
122
- export default {
123
- name: 'TimePickerCard',
124
- emits: ['update:model-value'],
125
- components: {
126
- QCard,
127
- QCardSection,
128
- QSeparator,
129
- },
130
- props: {
131
- lang: {
132
- type: String,
133
- default: 'ko',
134
- },
135
- modelValue: String,
136
- useSecond: {
137
- type: Boolean,
138
- default: false,
139
- },
140
- },
141
- setup(props) {
142
- const language = { ko: { am: '오전', pm: '오후' }, en: { am: 'AM', pm: 'PM' }, ja: { am: '午前', pm: '午後' } };
143
- const model = useModelBinder(props);
144
- const modelFormat = props.useSecond ? 'HH:mm:ss' : 'HH:mm';
145
- const timeRegex = props.useSecond ? /(\d{2}):(\d{2}):(\d{2})/ : /(\d{2}):(\d{2})/;
146
- const initialTimeUnits = props.modelValue.match(timeRegex).slice(1, 4);
147
- const initialDate = date.buildDate({
148
- hour: +initialTimeUnits[0],
149
- minute: +initialTimeUnits[1],
150
- second: +initialTimeUnits[2] || 0,
151
- });
152
- const amPmTimeUnits = date.formatDate(initialDate, 'hh:mm:ss').match(timeRegex).slice(1, 4);
153
- const isAm = ref(initialDate.getHours() < 12);
154
-
155
- const timeUnitModel = ref({
156
- hour: amPmTimeUnits[0],
157
- min: amPmTimeUnits[1],
158
- sec: props.useSecond ? amPmTimeUnits[2] : '00',
159
- });
160
-
161
- function onClickUp(type) {
162
- const timeModelUnits = model.value.match(timeRegex).slice(1, 4);
163
- const modelDate = date.buildDate({
164
- hour: +timeModelUnits[0],
165
- minute: +timeModelUnits[1],
166
- second: +timeModelUnits[2] || 0,
167
- });
168
- const addedDate = date.addToDate(modelDate, {
169
- hour: +(type === 'hh'),
170
- minute: +(type === 'mm'),
171
- second: +(type === 'ss'),
172
- });
173
- const addedTimeUnits = date.formatDate(addedDate, 'hh:mm:ss').match(timeRegex).slice(1, 4);
174
-
175
- isAm.value = addedDate.getHours() < 12;
176
- model.value = date.formatDate(addedDate, modelFormat);
177
- [
178
- timeUnitModel.value.hour,
179
- timeUnitModel.value.min,
180
- timeUnitModel.value.sec,
181
- ] = addedTimeUnits;
182
- }
183
-
184
- function onClickDown(type) {
185
- const timeModelUnits = model.value.match(timeRegex).slice(1, 4);
186
- const modelDate = date.buildDate({
187
- hour: +timeModelUnits[0],
188
- minute: +timeModelUnits[1],
189
- second: +timeModelUnits[2] || 0,
190
- });
191
- const subtractedDate = date.subtractFromDate(modelDate, {
192
- hour: +(type === 'hh'),
193
- minute: +(type === 'mm'),
194
- second: +(type === 'ss'),
195
- });
196
- const subtractedTimeUnits = date
197
- .formatDate(subtractedDate, 'hh:mm:ss')
198
- .match(timeRegex)
199
- .slice(1, 4);
200
-
201
- isAm.value = subtractedDate.getHours() < 12;
202
- model.value = date.formatDate(subtractedDate, modelFormat);
203
- [
204
- timeUnitModel.value.hour,
205
- timeUnitModel.value.min,
206
- timeUnitModel.value.sec,
207
- ] = subtractedTimeUnits;
208
- }
209
-
210
- function onClickAmPm(type) {
211
- const timeModelUnits = model.value.match(timeRegex).slice(1, 4);
212
- const modelDate = date.buildDate({
213
- hour: +timeModelUnits[0],
214
- minute: +timeModelUnits[1],
215
- second: +timeModelUnits[2] || 0,
216
- });
217
-
218
- isAm.value = type === language[props.lang].am;
219
- if (type === language[props.lang].am && modelDate.getHours() >= 12) {
220
- const resultDate = date.subtractFromDate(modelDate, { hour: 12 });
221
- model.value = date.formatDate(resultDate, modelFormat);
222
- } else if (type === language[props.lang].pm && modelDate.getHours() < 12) {
223
- const resultDate = date.addToDate(modelDate, { hour: 12 });
224
- model.value = date.formatDate(resultDate, modelFormat);
225
- }
226
- }
227
-
228
- function onUpdateTimeUnit(val, unit) {
229
- const inputLimitDict = {
230
- hour: 12,
231
- min: 59,
232
- sec: 59,
233
- };
234
-
235
- const timeUnitEnum = {
236
- hour: 0,
237
- min: 1,
238
- sec: 2,
239
- };
240
-
241
- const timeModelUnits = model.value.match(timeRegex).slice(1, 4);
242
- const modelDate = date.buildDate({
243
- hour: +timeModelUnits[0],
244
- minute: +timeModelUnits[1],
245
- second: +timeModelUnits[2] || 0,
246
- });
247
- const amPmModelTimeUnits = date
248
- .formatDate(modelDate, 'hh:mm:ss')
249
- .match(timeRegex)
250
- .slice(1, 4);
251
- if (+val > inputLimitDict[unit]) {
252
- nextTick(() => {
253
- timeUnitModel.value[unit] = +amPmModelTimeUnits[timeUnitEnum[unit]];
254
- });
255
- return;
256
- }
257
-
258
- const resultDate = date.adjustDate(modelDate, {
259
- hour:
260
- +timeUnitModel.value.hour + (!isAm.value && +timeUnitModel.value.hour < 12 ? 12 : 0),
261
- minute: +timeUnitModel.value.min,
262
- second: +timeUnitModel.value.sec || 0,
263
- });
264
- model.value = date.formatDate(resultDate, modelFormat);
265
- }
266
-
267
- function formatTimeUnit() {
268
- const timeModelUnits = model.value.match(timeRegex).slice(1, 4);
269
- const modelDate = date.buildDate({
270
- hour: +timeModelUnits[0],
271
- minute: +timeModelUnits[1],
272
- second: +timeModelUnits[2] || 0,
273
- });
274
- const amPmModelTimeUnits = date
275
- .formatDate(modelDate, 'hh:mm:ss')
276
- .match(timeRegex)
277
- .slice(1, 4);
278
- [
279
- timeUnitModel.value.hour,
280
- timeUnitModel.value.min,
281
- timeUnitModel.value.sec,
282
- ] = amPmModelTimeUnits;
283
- isAm.value = +timeModelUnits[0] < 12;
284
- }
285
-
286
- watch(
287
- () => props.modelValue,
288
- () => {
289
- formatTimeUnit();
290
- },
291
- );
292
-
293
- return {
294
- arrowUpIcon,
295
- arrowDownIcon,
296
- language,
297
-
298
- model,
299
- isAm,
300
- timeUnitModel,
301
- onClickUp,
302
- onClickDown,
303
- onClickAmPm,
304
- onUpdateTimeUnit,
305
- formatTimeUnit,
306
- };
307
- },
308
- };
309
- </script>
310
-
311
- <style lang="scss">
312
- @import '../css/quasar.variables.scss';
313
-
314
- .time-picker-card {
315
- height: 124px;
316
- .ampm-section {
317
- padding: 30px 24px;
318
- .s-button {
319
- min-width: 0;
320
- width: 47px;
321
- height: 28px;
322
- }
323
- .q-btn--outline {
324
- .q-btn__content {
325
- > span {
326
- color: $Grey_Darken-2;
327
- }
328
- }
329
- }
330
- }
331
- .time-section {
332
- padding: 24px;
333
- > div {
334
- .s-input {
335
- width: 38px;
336
- height: 28px;
337
- .q-field__inner {
338
- .q-field__control {
339
- border-radius: 4px;
340
- .q-field__control-container {
341
- .q-field__native {
342
- text-align: center;
343
- color: $Grey_Darken-2;
344
- }
345
- }
346
- }
347
- }
348
- }
349
- }
350
- }
351
- }
352
- </style>
1
+ <template>
2
+ <q-card class="time-picker-card flex no-wrap">
3
+ <q-card-section class="ampm-section flex column flex-cneter">
4
+ <s-button
5
+ :label="language[lang].am"
6
+ :outline="!isAm"
7
+ :color="isAm ? 'positive' : 'Grey_Default'"
8
+ @click="onClickAmPm(language[lang].am)"
9
+ />
10
+ <s-button
11
+ :label="language[lang].pm"
12
+ :outline="isAm"
13
+ :color="!isAm ? 'positive' : 'Grey_Default'"
14
+ class="q-mt-sm"
15
+ @click="onClickAmPm(language[lang].pm)"
16
+ />
17
+ </q-card-section>
18
+ <q-separator vertical color="Grey_Lighten-4" />
19
+ <q-card-section class="time-section flex no-wrap flex-center">
20
+ <div class="flex column flex-center">
21
+ <s-button
22
+ flat
23
+ :icon="arrowUpIcon"
24
+ color="Grey_Lighten-2"
25
+ class="no-hover"
26
+ @click="onClickUp('hh')"
27
+ />
28
+ <s-input
29
+ v-model="timeUnitModel.hour"
30
+ mask="##"
31
+ maxlength="2"
32
+ placeholder="00"
33
+ debounce="600"
34
+ @update:modelValue="
35
+ val => {
36
+ onUpdateTimeUnit(val, 'hour');
37
+ }
38
+ "
39
+ @blur="formatTimeUnit"
40
+ />
41
+
42
+ <s-button
43
+ flat
44
+ :icon="arrowDownIcon"
45
+ color="Grey_Lighten-2"
46
+ class="no-hover"
47
+ @click="onClickDown('hh')"
48
+ />
49
+ </div>
50
+ <div class="q-mx-sm">:</div>
51
+ <div class="flex column flex-center">
52
+ <s-button
53
+ flat
54
+ :icon="arrowUpIcon"
55
+ color="Grey_Lighten-2"
56
+ class="no-hover"
57
+ @click="onClickUp('mm')"
58
+ />
59
+ <s-input
60
+ v-model="timeUnitModel.min"
61
+ mask="##"
62
+ maxlength="2"
63
+ placeholder="00"
64
+ debounce="600"
65
+ @update:modelValue="
66
+ val => {
67
+ onUpdateTimeUnit(val, 'min');
68
+ }
69
+ "
70
+ @blur="formatTimeUnit"
71
+ />
72
+
73
+ <s-button
74
+ flat
75
+ :icon="arrowDownIcon"
76
+ color="Grey_Lighten-2"
77
+ class="no-hover"
78
+ @click="onClickDown('mm')"
79
+ />
80
+ </div>
81
+ <div class="q-mx-sm" v-if="useSecond">:</div>
82
+ <div class="flex column flex-center" v-if="useSecond">
83
+ <s-button
84
+ flat
85
+ :icon="arrowUpIcon"
86
+ color="Grey_Lighten-2"
87
+ class="no-hover"
88
+ @click="onClickUp('ss')"
89
+ />
90
+ <s-input
91
+ v-model="timeUnitModel.sec"
92
+ mask="##"
93
+ maxlength="2"
94
+ placeholder="00"
95
+ debounce="600"
96
+ @update:modelValue="
97
+ val => {
98
+ onUpdateTimeUnit(val, 'sec');
99
+ }
100
+ "
101
+ @blur="formatTimeUnit"
102
+ />
103
+
104
+ <s-button
105
+ flat
106
+ :icon="arrowDownIcon"
107
+ color="Grey_Lighten-2"
108
+ class="no-hover"
109
+ @click="onClickDown('ss')"
110
+ />
111
+ </div>
112
+ </q-card-section>
113
+ </q-card>
114
+ </template>
115
+
116
+ <script>
117
+ import { ref, nextTick, watch } from 'vue';
118
+ import { QCard, QCardSection, QSeparator, date } from 'quasar';
119
+ import { useModelBinder } from '../composables/modelBinder';
120
+ import { arrowUpIcon, arrowDownIcon } from '../assets/icons';
121
+
122
+ export default {
123
+ name: 'TimePickerCard',
124
+ emits: ['update:model-value'],
125
+ components: {
126
+ QCard,
127
+ QCardSection,
128
+ QSeparator,
129
+ },
130
+ props: {
131
+ lang: {
132
+ type: String,
133
+ default: 'ko',
134
+ },
135
+ modelValue: String,
136
+ useSecond: {
137
+ type: Boolean,
138
+ default: false,
139
+ },
140
+ },
141
+ setup(props) {
142
+ const language = { ko: { am: '오전', pm: '오후' }, en: { am: 'AM', pm: 'PM' }, ja: { am: '午前', pm: '午後' } };
143
+ const model = useModelBinder(props);
144
+ const modelFormat = props.useSecond ? 'HH:mm:ss' : 'HH:mm';
145
+ const timeRegex = props.useSecond ? /(\d{2}):(\d{2}):(\d{2})/ : /(\d{2}):(\d{2})/;
146
+ const initialTimeUnits = props.modelValue.match(timeRegex).slice(1, 4);
147
+ const initialDate = date.buildDate({
148
+ hour: +initialTimeUnits[0],
149
+ minute: +initialTimeUnits[1],
150
+ second: +initialTimeUnits[2] || 0,
151
+ });
152
+ const amPmTimeUnits = date.formatDate(initialDate, 'hh:mm:ss').match(timeRegex).slice(1, 4);
153
+ const isAm = ref(initialDate.getHours() < 12);
154
+
155
+ const timeUnitModel = ref({
156
+ hour: amPmTimeUnits[0],
157
+ min: amPmTimeUnits[1],
158
+ sec: props.useSecond ? amPmTimeUnits[2] : '00',
159
+ });
160
+
161
+ function onClickUp(type) {
162
+ const timeModelUnits = model.value.match(timeRegex).slice(1, 4);
163
+ const modelDate = date.buildDate({
164
+ hour: +timeModelUnits[0],
165
+ minute: +timeModelUnits[1],
166
+ second: +timeModelUnits[2] || 0,
167
+ });
168
+ const addedDate = date.addToDate(modelDate, {
169
+ hour: +(type === 'hh'),
170
+ minute: +(type === 'mm'),
171
+ second: +(type === 'ss'),
172
+ });
173
+ const addedTimeUnits = date.formatDate(addedDate, 'hh:mm:ss').match(timeRegex).slice(1, 4);
174
+
175
+ isAm.value = addedDate.getHours() < 12;
176
+ model.value = date.formatDate(addedDate, modelFormat);
177
+ [
178
+ timeUnitModel.value.hour,
179
+ timeUnitModel.value.min,
180
+ timeUnitModel.value.sec,
181
+ ] = addedTimeUnits;
182
+ }
183
+
184
+ function onClickDown(type) {
185
+ const timeModelUnits = model.value.match(timeRegex).slice(1, 4);
186
+ const modelDate = date.buildDate({
187
+ hour: +timeModelUnits[0],
188
+ minute: +timeModelUnits[1],
189
+ second: +timeModelUnits[2] || 0,
190
+ });
191
+ const subtractedDate = date.subtractFromDate(modelDate, {
192
+ hour: +(type === 'hh'),
193
+ minute: +(type === 'mm'),
194
+ second: +(type === 'ss'),
195
+ });
196
+ const subtractedTimeUnits = date
197
+ .formatDate(subtractedDate, 'hh:mm:ss')
198
+ .match(timeRegex)
199
+ .slice(1, 4);
200
+
201
+ isAm.value = subtractedDate.getHours() < 12;
202
+ model.value = date.formatDate(subtractedDate, modelFormat);
203
+ [
204
+ timeUnitModel.value.hour,
205
+ timeUnitModel.value.min,
206
+ timeUnitModel.value.sec,
207
+ ] = subtractedTimeUnits;
208
+ }
209
+
210
+ function onClickAmPm(type) {
211
+ const timeModelUnits = model.value.match(timeRegex).slice(1, 4);
212
+ const modelDate = date.buildDate({
213
+ hour: +timeModelUnits[0],
214
+ minute: +timeModelUnits[1],
215
+ second: +timeModelUnits[2] || 0,
216
+ });
217
+
218
+ isAm.value = type === language[props.lang].am;
219
+ if (type === language[props.lang].am && modelDate.getHours() >= 12) {
220
+ const resultDate = date.subtractFromDate(modelDate, { hour: 12 });
221
+ model.value = date.formatDate(resultDate, modelFormat);
222
+ } else if (type === language[props.lang].pm && modelDate.getHours() < 12) {
223
+ const resultDate = date.addToDate(modelDate, { hour: 12 });
224
+ model.value = date.formatDate(resultDate, modelFormat);
225
+ }
226
+ }
227
+
228
+ function onUpdateTimeUnit(val, unit) {
229
+ const inputLimitDict = {
230
+ hour: 12,
231
+ min: 59,
232
+ sec: 59,
233
+ };
234
+
235
+ const timeUnitEnum = {
236
+ hour: 0,
237
+ min: 1,
238
+ sec: 2,
239
+ };
240
+
241
+ const timeModelUnits = model.value.match(timeRegex).slice(1, 4);
242
+ const modelDate = date.buildDate({
243
+ hour: +timeModelUnits[0],
244
+ minute: +timeModelUnits[1],
245
+ second: +timeModelUnits[2] || 0,
246
+ });
247
+ const amPmModelTimeUnits = date
248
+ .formatDate(modelDate, 'hh:mm:ss')
249
+ .match(timeRegex)
250
+ .slice(1, 4);
251
+ if (+val > inputLimitDict[unit]) {
252
+ nextTick(() => {
253
+ timeUnitModel.value[unit] = +amPmModelTimeUnits[timeUnitEnum[unit]];
254
+ });
255
+ return;
256
+ }
257
+
258
+ const resultDate = date.adjustDate(modelDate, {
259
+ hour:
260
+ +timeUnitModel.value.hour + (!isAm.value && +timeUnitModel.value.hour < 12 ? 12 : 0),
261
+ minute: +timeUnitModel.value.min,
262
+ second: +timeUnitModel.value.sec || 0,
263
+ });
264
+ model.value = date.formatDate(resultDate, modelFormat);
265
+ }
266
+
267
+ function formatTimeUnit() {
268
+ const timeModelUnits = model.value.match(timeRegex).slice(1, 4);
269
+ const modelDate = date.buildDate({
270
+ hour: +timeModelUnits[0],
271
+ minute: +timeModelUnits[1],
272
+ second: +timeModelUnits[2] || 0,
273
+ });
274
+ const amPmModelTimeUnits = date
275
+ .formatDate(modelDate, 'hh:mm:ss')
276
+ .match(timeRegex)
277
+ .slice(1, 4);
278
+ [
279
+ timeUnitModel.value.hour,
280
+ timeUnitModel.value.min,
281
+ timeUnitModel.value.sec,
282
+ ] = amPmModelTimeUnits;
283
+ isAm.value = +timeModelUnits[0] < 12;
284
+ }
285
+
286
+ watch(
287
+ () => props.modelValue,
288
+ () => {
289
+ formatTimeUnit();
290
+ },
291
+ );
292
+
293
+ return {
294
+ arrowUpIcon,
295
+ arrowDownIcon,
296
+ language,
297
+
298
+ model,
299
+ isAm,
300
+ timeUnitModel,
301
+ onClickUp,
302
+ onClickDown,
303
+ onClickAmPm,
304
+ onUpdateTimeUnit,
305
+ formatTimeUnit,
306
+ };
307
+ },
308
+ };
309
+ </script>
310
+
311
+ <style lang="scss">
312
+ @import '../css/quasar.variables.scss';
313
+
314
+ .time-picker-card {
315
+ height: 124px;
316
+ .ampm-section {
317
+ padding: 30px 24px;
318
+ .s-button {
319
+ min-width: 0;
320
+ width: 47px;
321
+ height: 28px;
322
+ }
323
+ .q-btn--outline {
324
+ .q-btn__content {
325
+ > span {
326
+ color: $Grey_Darken-2;
327
+ }
328
+ }
329
+ }
330
+ }
331
+ .time-section {
332
+ padding: 24px;
333
+ > div {
334
+ .s-input {
335
+ width: 38px;
336
+ height: 28px;
337
+ .q-field__inner {
338
+ .q-field__control {
339
+ border-radius: 4px;
340
+ .q-field__control-container {
341
+ .q-field__native {
342
+ text-align: center;
343
+ color: $Grey_Darken-2;
344
+ }
345
+ }
346
+ }
347
+ }
348
+ }
349
+ }
350
+ }
351
+ }
352
+ </style>