quasar-ui-sellmate-ui-kit 3.0.3 → 3.0.5

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 (67) hide show
  1. package/.prettierrc +25 -25
  2. package/README.md +156 -156
  3. package/dist/index.common.js +2 -2
  4. package/dist/index.css +1 -1
  5. package/dist/index.esm.js +2 -2
  6. package/dist/index.min.css +1 -1
  7. package/dist/index.rtl.css +1 -1
  8. package/dist/index.rtl.min.css +1 -1
  9. package/dist/index.umd.js +3829 -3829
  10. package/dist/index.umd.min.js +2 -2
  11. package/package.json +83 -83
  12. package/src/assets/icons.js +28 -28
  13. package/src/components/SBreadcrumbs.vue +55 -55
  14. package/src/components/SButton.vue +206 -206
  15. package/src/components/SButtonGroup.vue +41 -41
  16. package/src/components/SButtonToggle.vue +200 -200
  17. package/src/components/SCaution.vue +102 -102
  18. package/src/components/SCheckbox.vue +123 -123
  19. package/src/components/SChip.vue +99 -99
  20. package/src/components/SDate.vue +717 -717
  21. package/src/components/SDateAutoRangePicker.vue +341 -341
  22. package/src/components/SDatePicker.vue +472 -472
  23. package/src/components/SDateRange.vue +470 -470
  24. package/src/components/SDateRangePicker.vue +660 -660
  25. package/src/components/SDateTimePicker.vue +349 -349
  26. package/src/components/SDialog.vue +250 -250
  27. package/src/components/SDropdown.vue +216 -216
  28. package/src/components/SEditor.vue +490 -490
  29. package/src/components/SFilePicker.vue +207 -207
  30. package/src/components/SHelp.vue +146 -146
  31. package/src/components/SInput.vue +343 -343
  32. package/src/components/SInputCounter.vue +46 -46
  33. package/src/components/SInputNumber.vue +179 -179
  34. package/src/components/SList.vue +29 -29
  35. package/src/components/SMarkupTable.vue +141 -141
  36. package/src/components/SPagination.vue +266 -266
  37. package/src/components/SRadio.vue +78 -78
  38. package/src/components/SRouteTab.vue +67 -67
  39. package/src/components/SSelect.vue +294 -294
  40. package/src/components/SSelectCheckbox.vue +222 -222
  41. package/src/components/SSelectCustom.vue +189 -189
  42. package/src/components/SSelectGroupCheckbox.vue +235 -235
  43. package/src/components/SSelectSearch.vue +261 -261
  44. package/src/components/SSelectSearchAutoComplete.vue +172 -172
  45. package/src/components/SSelectSearchCheckbox.vue +356 -356
  46. package/src/components/SStringToInput.vue +66 -66
  47. package/src/components/STab.vue +77 -77
  48. package/src/components/STable.vue +425 -425
  49. package/src/components/STableTree.vue +210 -210
  50. package/src/components/STabs.vue +32 -32
  51. package/src/components/STimePicker.vue +159 -159
  52. package/src/components/SToggle.vue +68 -68
  53. package/src/components/STooltip.vue +209 -209
  54. package/src/components/SelelctItem.vue +21 -21
  55. package/src/components/TimePickerCard.vue +352 -352
  56. package/src/composables/date.js +11 -11
  57. package/src/composables/modelBinder.js +13 -13
  58. package/src/composables/table/use-navigator.js +110 -110
  59. package/src/composables/table/use-resizable.js +80 -80
  60. package/src/css/app.scss +90 -90
  61. package/src/css/default.scss +875 -875
  62. package/src/css/extends.scss +154 -154
  63. package/src/css/quasar.variables.scss +189 -189
  64. package/src/directives/Directive.js +7 -7
  65. package/src/index.scss +3 -3
  66. package/src/vue-plugin.js +91 -91
  67. package/tsconfig.json +35 -35
@@ -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-xs">:</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-xs" 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>