quasar-ui-sellmate-ui-kit 2.2.13 → 2.2.15

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.
@@ -1,661 +1,660 @@
1
- <template>
2
- <q-input
3
- dense
4
- outlined
5
- :class="{
6
- 'text-Grey_Default bg-Grey_Lighten-5': isDisable,
7
- 's-date-range-picker--inside': insideLabel,
8
- }"
9
- readonly
10
- class="q-pa-none s-date-range-picker bg-white"
11
- v-model="inputDate"
12
- :disable="isDisable"
13
- @click="calendarOpen = true"
14
- data-cy="rangeCalendar"
15
- >
16
- <template #before v-if="insideLabel">
17
- <div class="date-picker-label">
18
- {{ insideLabel }}
19
- </div>
20
- </template>
21
- <template #prepend>
22
- <q-btn
23
- :icon="dateRangeIcon"
24
- dense
25
- :ripple="false"
26
- flat
27
- class="q-pa-none no-hover"
28
- color="Grey_Darken-4"
29
- >
30
- <q-menu
31
- v-model="calendarOpen"
32
- fit
33
- class="date-picker-range-wrapper"
34
- ref="dateMenuRef"
35
- >
36
- <q-date
37
- v-model="dateValue.from"
38
- minimal
39
- square
40
- color="positive"
41
- class="q-pa-none"
42
- mask="YYYY-MM-DD"
43
- :locale="lang ? locale[lang] : {}"
44
- :options="optionsStartFn"
45
- @range-start="getRangeStartDay"
46
- />
47
- <q-separator vertical />
48
- <q-date
49
- v-model="dateValue.to"
50
- minimal
51
- square
52
- color="positive"
53
- class="q-pa-none"
54
- mask="YYYY-MM-DD"
55
- :locale="lang ? locale[lang] : {}"
56
- :options="optionsEndFn"
57
- @range-end="getRangeEndDay"
58
- >
59
- <q-btn
60
- class="reset-to-today-btn no-shadow no-hover"
61
- unelevated
62
- text-color="black"
63
- :label="lang ? locale[lang].today : '오늘'"
64
- @click="resetDate"
65
- />
66
- </q-date>
67
- </q-menu>
68
- </q-btn>
69
- </template>
70
- <template #default>
71
- <div class="flex no-wrap items-center">
72
- <q-input
73
- v-if="useInput"
74
- dense
75
- borderless
76
- v-model="dateValue.from"
77
- autocomplete="off"
78
- mask="####-##-##"
79
- class="inner-input"
80
- />
81
- <span v-else class="text-center text-Grey_Darken-4 date-str">{{
82
- dateValue.from
83
- }}</span>
84
- <span class="q-mx-sm" style="min-width: 0">~</span>
85
- <q-input
86
- v-if="useInput"
87
- dense
88
- borderless
89
- v-model="dateValue.to"
90
- autocomplete="off"
91
- mask="####-##-##"
92
- class="inner-input"
93
- />
94
- <span v-else class="text-center text-Grey_Darken-4 date-str">{{
95
- dateValue.to
96
- }}</span>
97
- </div>
98
- </template>
99
- <template #append v-if="useDelete">
100
- <q-icon
101
- :name="closeIcon"
102
- size="16px"
103
- class="cursor-pointer"
104
- @click="deleteDate"
105
- data-cy="delete-icon"
106
- />
107
- </template>
108
- </q-input>
109
- </template>
110
-
111
- <script>
112
- const locale = {
113
- ko: {
114
- today: '오늘',
115
- daysShort: ['일', '월', '화', '수', '목', '금', '토'],
116
- months: [
117
- '1월',
118
- '2월',
119
- '3월',
120
- '4월',
121
- '5월',
122
- '6월',
123
- '7월',
124
- '8월',
125
- '9월',
126
- '10월',
127
- '11월',
128
- '12월',
129
- ],
130
- monthsShort: [
131
- '1월',
132
- '2월',
133
- '3월',
134
- '4월',
135
- '5월',
136
- '6월',
137
- '7월',
138
- '8월',
139
- '9월',
140
- '10월',
141
- '11월',
142
- '12월',
143
- ],
144
- },
145
- ja: {
146
- today: '今日',
147
- daysShort: ['日', '月', '火', '水', '木', '金', '土'],
148
- months: [
149
- '1月',
150
- '2月',
151
- '3月',
152
- '4月',
153
- '5月',
154
- '6月',
155
- '7月',
156
- '8月',
157
- '9月',
158
- '10月',
159
- '11月',
160
- '12月',
161
- ],
162
- monthsShort: [
163
- '1月',
164
- '2月',
165
- '3月',
166
- '4月',
167
- '5月',
168
- '6月',
169
- '7月',
170
- '8月',
171
- '9月',
172
- '10月',
173
- '11月',
174
- '12月',
175
- ],
176
- },
177
- };
178
- import { defineComponent, ref, watch } from 'vue';
179
- import { QInput, QBtn, QDate, QMenu, QIcon, QSeparator, date } from 'quasar';
180
- import { dateRangeIcon, closeIcon } from '../assets/icons.js';
181
- import { useModelBinder } from '../composables/modelBinder';
182
-
183
- export default defineComponent({
184
- name: 'SDateRangePicker',
185
- components: {
186
- QInput,
187
- QBtn,
188
- QDate,
189
- QMenu,
190
- QIcon,
191
- QSeparator,
192
- },
193
- props: {
194
- isDisable: Boolean,
195
- insideLabel: String,
196
- useInput: Boolean,
197
- rangeDate: {
198
- type: [Number, Object, null],
199
- /**
200
- * 얼마 후인지 제한
201
- * 기본 디폴트 month
202
- * day, month, year
203
- */
204
- default: () => 1,
205
- },
206
- modelValue: {
207
- type: [String, Object],
208
- },
209
- useDelete: {
210
- type: Boolean,
211
- default: false,
212
- },
213
- lang: {
214
- type: String,
215
- default: '',
216
- require: false,
217
- },
218
- // 날짜 제한
219
- dateLimit: {
220
- type: Object,
221
- default: () => ({ from: '', to: '' }),
222
- },
223
- },
224
- setup(props, { emit }) {
225
- const calendarOpen = ref(false);
226
- const dateValue = useModelBinder(props);
227
- const inputDate = ref(`${dateValue.value.from} ~ ${dateValue.value.to}`);
228
- const dateMenuRef = ref(null);
229
-
230
- function resetDate() {
231
- const todayReset = date.formatDate(new Date(), 'YYYY/MM/DD');
232
- dateValue.value.from = date.formatDate(todayReset, 'YYYY-MM-DD');
233
- dateValue.value.to = date.formatDate(todayReset, 'YYYY-MM-DD');
234
- }
235
-
236
- function deleteDate() {
237
- if (dateValue.value.from && dateValue.value.to) {
238
- dateValue.value.from = null;
239
- dateValue.value.to = null;
240
- emit('update:modelValue', dateValue.value);
241
- }
242
- }
243
-
244
- watch(
245
- () => props.isDisable,
246
- val => {
247
- if (val) {
248
- dateMenuRef.value.hide();
249
- }
250
- },
251
- );
252
-
253
- const startDate = date.formatDate(new Date(), 'YYYY/MM/DD');
254
- const endDate = date.formatDate(new Date(), 'YYYY/MM/DD');
255
-
256
- function getRangeStartDay(from) {
257
- startDate.value = from;
258
- }
259
- function getRangeEndDay(to) {
260
- endDate.value = to;
261
- }
262
-
263
- function optionsStartFn(day) {
264
- if (props.rangeDate === null) return true;
265
- let maxFromDate = date.formatDate(
266
- date.subtractFromDate(
267
- new Date(dateValue.value.to),
268
- typeof props.rangeDate === 'number'
269
- ? { month: props.rangeDate }
270
- : props.rangeDate,
271
- ),
272
- 'YYYY/MM/DD',
273
- );
274
- console.log('maxFromDate', maxFromDate);
275
-
276
- if (props.dateLimit.from) {
277
- maxFromDate = date.formatDate(
278
- new Date(
279
- Math.max(new Date(maxFromDate), new Date(props.dateLimit.from)),
280
- ),
281
- 'YYYY/MM/DD',
282
- );
283
- }
284
-
285
- if (!dateValue.value.to) {
286
- return true;
287
- }
288
-
289
- const dayTo = date.formatDate(dateValue.value.to, 'YYYY/MM/DD');
290
- return maxFromDate <= day && day <= dayTo;
291
- }
292
-
293
- function optionsEndFn(day) {
294
- const todayForat = date.formatDate(new Date(), 'YYYY/MM/DD');
295
- if (props.rangeDate === null) return day <= todayForat;
296
- const dayFrom = date.formatDate(dateValue.value.from, 'YYYY/MM/DD');
297
- let maxToDate = date.formatDate(
298
- date.addToDate(
299
- new Date(dateValue.value.from),
300
- typeof props.rangeDate === 'number'
301
- ? { month: props.rangeDate }
302
- : props.rangeDate,
303
- ),
304
- 'YYYY/MM/DD',
305
- );
306
-
307
- if (props.dateLimit.to) {
308
- maxToDate = date.formatDate(
309
- new Date(
310
- Math.min(new Date(maxToDate), new Date(props.dateLimit.to)),
311
- ),
312
- 'YYYY/MM/DD',
313
- );
314
- }
315
- if (!dateValue.value.from) {
316
- return true;
317
- }
318
- return dayFrom <= day && day <= maxToDate;
319
- }
320
-
321
- return {
322
- dateRangeIcon,
323
- locale,
324
- calendarOpen,
325
- dateValue,
326
- inputDate,
327
- resetDate,
328
- getRangeStartDay,
329
- getRangeEndDay,
330
- optionsStartFn,
331
- optionsEndFn,
332
- closeIcon,
333
- deleteDate,
334
- dateMenuRef,
335
- };
336
- },
337
- });
338
- </script>
339
-
340
- <style lang="scss">
341
- @import '../css/quasar.variables.scss';
342
-
343
- .s-date-range-picker {
344
- width: fit-content;
345
- height: $default-height;
346
-
347
- &.q-field--dense .q-field__before {
348
- padding: 0;
349
- height: 100%;
350
- }
351
-
352
- .q-field__inner {
353
- font-size: 12px;
354
-
355
- .q-field__control {
356
- padding: 4px 0 4px 8px !important;
357
- align-items: center;
358
- height: 100%;
359
-
360
- .q-field__prepend {
361
- .q-icon {
362
- width: 20px;
363
- height: 20px;
364
- color: $Grey_Darken-1;
365
- }
366
- }
367
-
368
- &:after {
369
- border: 1px solid $Grey_Lighten-1;
370
- box-shadow: none;
371
- }
372
-
373
- &:hover,
374
- &:active {
375
- background: $Grey_Lighten-5;
376
- }
377
-
378
- .q-field__prepend {
379
- height: $default-content-height;
380
- padding: 0;
381
-
382
- > div {
383
- min-height: 0;
384
- height: 100%;
385
- display: flex !important;
386
- align-items: center;
387
- justify-content: center;
388
-
389
- .q-btn {
390
- width: $default-content-size;
391
- height: $default-content-size;
392
- min-height: $default-content-size;
393
-
394
- .q-icon {
395
- font-size: $icon-size-lg;
396
- }
397
- }
398
- }
399
- }
400
-
401
- &-container {
402
- > input {
403
- display: none;
404
- }
405
-
406
- display: flex;
407
- justify-content: center;
408
- height: $default-content-height;
409
- margin-left: 12px;
410
- margin-right: 16px;
411
-
412
- .q-field__native {
413
- height: 100%;
414
- line-height: $default-line-height;
415
- text-align: center;
416
- padding: 0 !important;
417
- display: none;
418
-
419
- font: {
420
- size: $default-font;
421
- weight: $default-font-weight;
422
- }
423
-
424
- input::placeholder {
425
- color: $Grey_Darken-4;
426
- }
427
- }
428
- }
429
-
430
- .q-field__append {
431
- padding: 0 6px 0 0;
432
- }
433
- }
434
- }
435
-
436
- .inner-input {
437
- > .q-field__inner {
438
- > .q-field__control {
439
- width: 70px;
440
- padding: 0px !important;
441
-
442
- &::before,
443
- &::after {
444
- border: none;
445
- }
446
-
447
- > .q-field__control-container {
448
- margin: 0px;
449
-
450
- input {
451
- display: block !important;
452
- }
453
- }
454
- }
455
- }
456
- }
457
-
458
- .date-str {
459
- width: 70px;
460
- line-height: $default-content-height;
461
- justify-content: center;
462
- }
463
-
464
- &--inside {
465
- .q-field__before {
466
- height: 100%;
467
- padding: 4px 12px !important;
468
- border: 1px solid $Grey_Lighten-1;
469
- border-right: none;
470
- border-radius: $generic-border-radius 0 0 $generic-border-radius;
471
- background: $Grey_Lighten-5;
472
-
473
- .date-picker-label {
474
- font-size: $default-font;
475
- font-weight: $default-font-weight;
476
- color: $Grey_Darken-4;
477
- }
478
- }
479
-
480
- .q-field__inner {
481
- .q-field__control {
482
- border-radius: 0 2px 2px 0;
483
- width: 220px;
484
-
485
- .q-field__prepend {
486
- .q-icon {
487
- width: 20px;
488
- height: 20px;
489
- color: $Grey_Darken-1;
490
- }
491
- }
492
-
493
- &-container {
494
- > input {
495
- display: none;
496
- }
497
-
498
- > div {
499
- margin-left: 6.5px;
500
-
501
- > span {
502
- display: inline-flex;
503
- min-width: 70px;
504
- font-size: 12px !important;
505
- }
506
- }
507
- }
508
- }
509
- }
510
-
511
- &.q-field--disabled {
512
- .q-field__before {
513
- border: 1px solid $Grey_Lighten-2;
514
- border-right: none;
515
-
516
- .date-picker-label {
517
- color: $Grey_Default;
518
- }
519
- }
520
- }
521
- }
522
- }
523
-
524
- .date-picker-range-wrapper.q-menu {
525
- width: 609px;
526
- height: 330px;
527
- max-height: 330px;
528
- overflow: hidden;
529
- border-radius: 8px;
530
- position: relative;
531
-
532
- min: {
533
- width: 0 !important;
534
- height: 0 !important;
535
- }
536
-
537
- .q-separator {
538
- position: absolute;
539
- height: 244px;
540
- left: 304px;
541
- top: 62px;
542
- }
543
-
544
- .q-date {
545
- position: absolute;
546
- min-height: 330px;
547
- top: 0;
548
- box-shadow: none;
549
- width: 304px;
550
-
551
- &:first-of-type {
552
- left: 0;
553
- }
554
-
555
- &:last-of-type {
556
- right: 0;
557
- }
558
-
559
- &__main {
560
- .q-date__actions {
561
- padding: 0 !important;
562
-
563
- > .reset-to-today-btn {
564
- padding: 0;
565
- width: 28px;
566
- height: 22px;
567
- min-height: 22px;
568
- position: absolute;
569
- background: transparent;
570
- top: 20px;
571
- right: 24px;
572
-
573
- > span {
574
- color: $Grey_Darken-4;
575
- text-decoration: underline;
576
- color: $Grey_Darken-4;
577
- }
578
- }
579
-
580
- &:hover {
581
- .q-btn__content {
582
- text-decoration: underline;
583
- color: $positive;
584
- }
585
- }
586
- }
587
-
588
- .q-date__content {
589
- margin-top: 42px;
590
-
591
- .q-date__view {
592
- min-height: 0 !important;
593
- padding-bottom: 0;
594
-
595
- .q-date__navigation {
596
- div {
597
- height: 28px;
598
-
599
- .q-btn {
600
- .q-icon {
601
- font-size: $default-font;
602
- }
603
- }
604
- }
605
-
606
- .relative-position {
607
- div {
608
- .q-btn--dense {
609
- padding: 0 !important;
610
-
611
- .q-btn__content {
612
- > span {
613
- font-size: 14px;
614
- }
615
- }
616
- }
617
- }
618
- }
619
- }
620
-
621
- .q-date__calendar-days-container {
622
- min-height: 172px;
623
-
624
- .q-date__calendar-days {
625
- .q-date__calendar-item {
626
- .q-btn {
627
- padding: 0;
628
-
629
- .q-btn__content {
630
- > span {
631
- font-size: 14px;
632
- }
633
- }
634
-
635
- &:hover {
636
- .q-focus-helper {
637
- background: $positive;
638
- opacity: 1;
639
-
640
- &:before,
641
- &:after {
642
- display: none;
643
- }
644
- }
645
-
646
- .q-btn__content {
647
- > span {
648
- color: white;
649
- }
650
- }
651
- }
652
- }
653
- }
654
- }
655
- }
656
- }
657
- }
658
- }
659
- }
660
- }
661
- </style>
1
+ <template>
2
+ <q-input
3
+ dense
4
+ outlined
5
+ :class="{
6
+ 'text-Grey_Default bg-Grey_Lighten-5': isDisable,
7
+ 's-date-range-picker--inside': insideLabel,
8
+ }"
9
+ readonly
10
+ class="q-pa-none s-date-range-picker bg-white"
11
+ v-model="inputDate"
12
+ :disable="isDisable"
13
+ @click="calendarOpen = true"
14
+ data-cy="rangeCalendar"
15
+ >
16
+ <template #before v-if="insideLabel">
17
+ <div class="date-picker-label">
18
+ {{ insideLabel }}
19
+ </div>
20
+ </template>
21
+ <template #prepend>
22
+ <q-btn
23
+ :icon="dateRangeIcon"
24
+ dense
25
+ :ripple="false"
26
+ flat
27
+ class="q-pa-none no-hover"
28
+ color="Grey_Darken-4"
29
+ >
30
+ <q-menu
31
+ v-model="calendarOpen"
32
+ fit
33
+ class="date-picker-range-wrapper"
34
+ ref="dateMenuRef"
35
+ >
36
+ <q-date
37
+ v-model="dateValue.from"
38
+ minimal
39
+ square
40
+ color="positive"
41
+ class="q-pa-none"
42
+ mask="YYYY-MM-DD"
43
+ :locale="lang ? locale[lang] : {}"
44
+ :options="optionsStartFn"
45
+ @range-start="getRangeStartDay"
46
+ />
47
+ <q-separator vertical />
48
+ <q-date
49
+ v-model="dateValue.to"
50
+ minimal
51
+ square
52
+ color="positive"
53
+ class="q-pa-none"
54
+ mask="YYYY-MM-DD"
55
+ :locale="lang ? locale[lang] : {}"
56
+ :options="optionsEndFn"
57
+ @range-end="getRangeEndDay"
58
+ >
59
+ <q-btn
60
+ class="reset-to-today-btn no-shadow no-hover"
61
+ unelevated
62
+ text-color="black"
63
+ :label="lang ? locale[lang].today : '오늘'"
64
+ @click="resetDate"
65
+ />
66
+ </q-date>
67
+ </q-menu>
68
+ </q-btn>
69
+ </template>
70
+ <template #default>
71
+ <div class="flex no-wrap items-center">
72
+ <q-input
73
+ v-if="useInput"
74
+ dense
75
+ borderless
76
+ v-model="dateValue.from"
77
+ autocomplete="off"
78
+ mask="####-##-##"
79
+ class="inner-input"
80
+ />
81
+ <span v-else class="text-center text-Grey_Darken-4 date-str">{{
82
+ dateValue.from
83
+ }}</span>
84
+ <span class="q-mx-sm" style="min-width: 0">~</span>
85
+ <q-input
86
+ v-if="useInput"
87
+ dense
88
+ borderless
89
+ v-model="dateValue.to"
90
+ autocomplete="off"
91
+ mask="####-##-##"
92
+ class="inner-input"
93
+ />
94
+ <span v-else class="text-center text-Grey_Darken-4 date-str">{{
95
+ dateValue.to
96
+ }}</span>
97
+ </div>
98
+ </template>
99
+ <template #append v-if="useDelete">
100
+ <q-icon
101
+ :name="closeIcon"
102
+ size="16px"
103
+ class="cursor-pointer"
104
+ @click="deleteDate"
105
+ data-cy="delete-icon"
106
+ />
107
+ </template>
108
+ </q-input>
109
+ </template>
110
+
111
+ <script>
112
+ const locale = {
113
+ ko: {
114
+ today: '오늘',
115
+ daysShort: ['일', '월', '화', '수', '목', '금', '토'],
116
+ months: [
117
+ '1월',
118
+ '2월',
119
+ '3월',
120
+ '4월',
121
+ '5월',
122
+ '6월',
123
+ '7월',
124
+ '8월',
125
+ '9월',
126
+ '10월',
127
+ '11월',
128
+ '12월',
129
+ ],
130
+ monthsShort: [
131
+ '1월',
132
+ '2월',
133
+ '3월',
134
+ '4월',
135
+ '5월',
136
+ '6월',
137
+ '7월',
138
+ '8월',
139
+ '9월',
140
+ '10월',
141
+ '11월',
142
+ '12월',
143
+ ],
144
+ },
145
+ ja: {
146
+ today: '今日',
147
+ daysShort: ['日', '月', '火', '水', '木', '金', '土'],
148
+ months: [
149
+ '1月',
150
+ '2月',
151
+ '3月',
152
+ '4月',
153
+ '5月',
154
+ '6月',
155
+ '7月',
156
+ '8月',
157
+ '9月',
158
+ '10月',
159
+ '11月',
160
+ '12月',
161
+ ],
162
+ monthsShort: [
163
+ '1月',
164
+ '2月',
165
+ '3月',
166
+ '4月',
167
+ '5月',
168
+ '6月',
169
+ '7月',
170
+ '8月',
171
+ '9月',
172
+ '10月',
173
+ '11月',
174
+ '12月',
175
+ ],
176
+ },
177
+ };
178
+ import { defineComponent, ref, watch } from 'vue';
179
+ import { QInput, QBtn, QDate, QMenu, QIcon, QSeparator, date } from 'quasar';
180
+ import { dateRangeIcon, closeIcon } from '../assets/icons.js';
181
+ import { useModelBinder } from '../composables/modelBinder';
182
+
183
+ export default defineComponent({
184
+ name: 'SDateRangePicker',
185
+ components: {
186
+ QInput,
187
+ QBtn,
188
+ QDate,
189
+ QMenu,
190
+ QIcon,
191
+ QSeparator,
192
+ },
193
+ props: {
194
+ isDisable: Boolean,
195
+ insideLabel: String,
196
+ useInput: Boolean,
197
+ rangeDate: {
198
+ type: [Number, Object, null],
199
+ /**
200
+ * 얼마 후인지 제한
201
+ * 기본 디폴트 month
202
+ * day, month, year
203
+ */
204
+ default: () => 1,
205
+ },
206
+ modelValue: {
207
+ type: [String, Object],
208
+ },
209
+ useDelete: {
210
+ type: Boolean,
211
+ default: false,
212
+ },
213
+ lang: {
214
+ type: String,
215
+ default: '',
216
+ require: false,
217
+ },
218
+ // 날짜 제한
219
+ dateLimit: {
220
+ type: Object,
221
+ default: () => ({ from: '', to: '' }),
222
+ },
223
+ },
224
+ setup(props, { emit }) {
225
+ const calendarOpen = ref(false);
226
+ const dateValue = useModelBinder(props);
227
+ const inputDate = ref(`${dateValue.value.from} ~ ${dateValue.value.to}`);
228
+ const dateMenuRef = ref(null);
229
+
230
+ function resetDate() {
231
+ const todayReset = date.formatDate(new Date(), 'YYYY/MM/DD');
232
+ dateValue.value.from = date.formatDate(todayReset, 'YYYY-MM-DD');
233
+ dateValue.value.to = date.formatDate(todayReset, 'YYYY-MM-DD');
234
+ }
235
+
236
+ function deleteDate() {
237
+ if (dateValue.value.from && dateValue.value.to) {
238
+ dateValue.value.from = null;
239
+ dateValue.value.to = null;
240
+ emit('update:modelValue', dateValue.value);
241
+ }
242
+ }
243
+
244
+ watch(
245
+ () => props.isDisable,
246
+ val => {
247
+ if (val) {
248
+ dateMenuRef.value.hide();
249
+ }
250
+ },
251
+ );
252
+
253
+ const startDate = date.formatDate(new Date(), 'YYYY/MM/DD');
254
+ const endDate = date.formatDate(new Date(), 'YYYY/MM/DD');
255
+
256
+ function getRangeStartDay(from) {
257
+ startDate.value = from;
258
+ }
259
+ function getRangeEndDay(to) {
260
+ endDate.value = to;
261
+ }
262
+
263
+ function optionsStartFn(day) {
264
+ if (props.rangeDate === null) return true;
265
+ let maxFromDate = date.formatDate(
266
+ date.subtractFromDate(
267
+ new Date(dateValue.value.to),
268
+ typeof props.rangeDate === 'number'
269
+ ? { month: props.rangeDate }
270
+ : props.rangeDate,
271
+ ),
272
+ 'YYYY/MM/DD',
273
+ );
274
+
275
+ if (props.dateLimit.from) {
276
+ maxFromDate = date.formatDate(
277
+ new Date(
278
+ Math.max(new Date(maxFromDate), new Date(props.dateLimit.from)),
279
+ ),
280
+ 'YYYY/MM/DD',
281
+ );
282
+ }
283
+
284
+ if (!dateValue.value.to) {
285
+ return true;
286
+ }
287
+
288
+ const dayTo = date.formatDate(dateValue.value.to, 'YYYY/MM/DD');
289
+ return maxFromDate <= day && day <= dayTo;
290
+ }
291
+
292
+ function optionsEndFn(day) {
293
+ const todayForat = date.formatDate(new Date(), 'YYYY/MM/DD');
294
+ if (props.rangeDate === null) return day <= todayForat;
295
+ const dayFrom = date.formatDate(dateValue.value.from, 'YYYY/MM/DD');
296
+ let maxToDate = date.formatDate(
297
+ date.addToDate(
298
+ new Date(dateValue.value.from),
299
+ typeof props.rangeDate === 'number'
300
+ ? { month: props.rangeDate }
301
+ : props.rangeDate,
302
+ ),
303
+ 'YYYY/MM/DD',
304
+ );
305
+
306
+ if (props.dateLimit.to) {
307
+ maxToDate = date.formatDate(
308
+ new Date(
309
+ Math.min(new Date(maxToDate), new Date(props.dateLimit.to)),
310
+ ),
311
+ 'YYYY/MM/DD',
312
+ );
313
+ }
314
+ if (!dateValue.value.from) {
315
+ return true;
316
+ }
317
+ return dayFrom <= day && day <= maxToDate;
318
+ }
319
+
320
+ return {
321
+ dateRangeIcon,
322
+ locale,
323
+ calendarOpen,
324
+ dateValue,
325
+ inputDate,
326
+ resetDate,
327
+ getRangeStartDay,
328
+ getRangeEndDay,
329
+ optionsStartFn,
330
+ optionsEndFn,
331
+ closeIcon,
332
+ deleteDate,
333
+ dateMenuRef,
334
+ };
335
+ },
336
+ });
337
+ </script>
338
+
339
+ <style lang="scss">
340
+ @import '../css/quasar.variables.scss';
341
+
342
+ .s-date-range-picker {
343
+ width: fit-content;
344
+ height: $default-height;
345
+
346
+ &.q-field--dense .q-field__before {
347
+ padding: 0;
348
+ height: 100%;
349
+ }
350
+
351
+ .q-field__inner {
352
+ font-size: 12px;
353
+
354
+ .q-field__control {
355
+ padding: 4px 0 4px 8px !important;
356
+ align-items: center;
357
+ height: 100%;
358
+
359
+ .q-field__prepend {
360
+ .q-icon {
361
+ width: 20px;
362
+ height: 20px;
363
+ color: $Grey_Darken-1;
364
+ }
365
+ }
366
+
367
+ &:after {
368
+ border: 1px solid $Grey_Lighten-1;
369
+ box-shadow: none;
370
+ }
371
+
372
+ &:hover,
373
+ &:active {
374
+ background: $Grey_Lighten-5;
375
+ }
376
+
377
+ .q-field__prepend {
378
+ height: $default-content-height;
379
+ padding: 0;
380
+
381
+ > div {
382
+ min-height: 0;
383
+ height: 100%;
384
+ display: flex !important;
385
+ align-items: center;
386
+ justify-content: center;
387
+
388
+ .q-btn {
389
+ width: $default-content-size;
390
+ height: $default-content-size;
391
+ min-height: $default-content-size;
392
+
393
+ .q-icon {
394
+ font-size: $icon-size-lg;
395
+ }
396
+ }
397
+ }
398
+ }
399
+
400
+ &-container {
401
+ > input {
402
+ display: none;
403
+ }
404
+
405
+ display: flex;
406
+ justify-content: center;
407
+ height: $default-content-height;
408
+ margin-left: 12px;
409
+ margin-right: 16px;
410
+
411
+ .q-field__native {
412
+ height: 100%;
413
+ line-height: $default-line-height;
414
+ text-align: center;
415
+ padding: 0 !important;
416
+ display: none;
417
+
418
+ font: {
419
+ size: $default-font;
420
+ weight: $default-font-weight;
421
+ }
422
+
423
+ input::placeholder {
424
+ color: $Grey_Darken-4;
425
+ }
426
+ }
427
+ }
428
+
429
+ .q-field__append {
430
+ padding: 0 6px 0 0;
431
+ }
432
+ }
433
+ }
434
+
435
+ .inner-input {
436
+ > .q-field__inner {
437
+ > .q-field__control {
438
+ width: 70px;
439
+ padding: 0px !important;
440
+
441
+ &::before,
442
+ &::after {
443
+ border: none;
444
+ }
445
+
446
+ > .q-field__control-container {
447
+ margin: 0px;
448
+
449
+ input {
450
+ display: block !important;
451
+ }
452
+ }
453
+ }
454
+ }
455
+ }
456
+
457
+ .date-str {
458
+ width: 70px;
459
+ line-height: $default-content-height;
460
+ justify-content: center;
461
+ }
462
+
463
+ &--inside {
464
+ .q-field__before {
465
+ height: 100%;
466
+ padding: 4px 12px !important;
467
+ border: 1px solid $Grey_Lighten-1;
468
+ border-right: none;
469
+ border-radius: $generic-border-radius 0 0 $generic-border-radius;
470
+ background: $Grey_Lighten-5;
471
+
472
+ .date-picker-label {
473
+ font-size: $default-font;
474
+ font-weight: $default-font-weight;
475
+ color: $Grey_Darken-4;
476
+ }
477
+ }
478
+
479
+ .q-field__inner {
480
+ .q-field__control {
481
+ border-radius: 0 2px 2px 0;
482
+ width: 220px;
483
+
484
+ .q-field__prepend {
485
+ .q-icon {
486
+ width: 20px;
487
+ height: 20px;
488
+ color: $Grey_Darken-1;
489
+ }
490
+ }
491
+
492
+ &-container {
493
+ > input {
494
+ display: none;
495
+ }
496
+
497
+ > div {
498
+ margin-left: 6.5px;
499
+
500
+ > span {
501
+ display: inline-flex;
502
+ min-width: 70px;
503
+ font-size: 12px !important;
504
+ }
505
+ }
506
+ }
507
+ }
508
+ }
509
+
510
+ &.q-field--disabled {
511
+ .q-field__before {
512
+ border: 1px solid $Grey_Lighten-2;
513
+ border-right: none;
514
+
515
+ .date-picker-label {
516
+ color: $Grey_Default;
517
+ }
518
+ }
519
+ }
520
+ }
521
+ }
522
+
523
+ .date-picker-range-wrapper.q-menu {
524
+ width: 609px;
525
+ height: 330px;
526
+ max-height: 330px;
527
+ overflow: hidden;
528
+ border-radius: 8px;
529
+ position: relative;
530
+
531
+ min: {
532
+ width: 0 !important;
533
+ height: 0 !important;
534
+ }
535
+
536
+ .q-separator {
537
+ position: absolute;
538
+ height: 244px;
539
+ left: 304px;
540
+ top: 62px;
541
+ }
542
+
543
+ .q-date {
544
+ position: absolute;
545
+ min-height: 330px;
546
+ top: 0;
547
+ box-shadow: none;
548
+ width: 304px;
549
+
550
+ &:first-of-type {
551
+ left: 0;
552
+ }
553
+
554
+ &:last-of-type {
555
+ right: 0;
556
+ }
557
+
558
+ &__main {
559
+ .q-date__actions {
560
+ padding: 0 !important;
561
+
562
+ > .reset-to-today-btn {
563
+ padding: 0;
564
+ width: 28px;
565
+ height: 22px;
566
+ min-height: 22px;
567
+ position: absolute;
568
+ background: transparent;
569
+ top: 20px;
570
+ right: 24px;
571
+
572
+ > span {
573
+ color: $Grey_Darken-4;
574
+ text-decoration: underline;
575
+ color: $Grey_Darken-4;
576
+ }
577
+ }
578
+
579
+ &:hover {
580
+ .q-btn__content {
581
+ text-decoration: underline;
582
+ color: $positive;
583
+ }
584
+ }
585
+ }
586
+
587
+ .q-date__content {
588
+ margin-top: 42px;
589
+
590
+ .q-date__view {
591
+ min-height: 0 !important;
592
+ padding-bottom: 0;
593
+
594
+ .q-date__navigation {
595
+ div {
596
+ height: 28px;
597
+
598
+ .q-btn {
599
+ .q-icon {
600
+ font-size: $default-font;
601
+ }
602
+ }
603
+ }
604
+
605
+ .relative-position {
606
+ div {
607
+ .q-btn--dense {
608
+ padding: 0 !important;
609
+
610
+ .q-btn__content {
611
+ > span {
612
+ font-size: 14px;
613
+ }
614
+ }
615
+ }
616
+ }
617
+ }
618
+ }
619
+
620
+ .q-date__calendar-days-container {
621
+ min-height: 172px;
622
+
623
+ .q-date__calendar-days {
624
+ .q-date__calendar-item {
625
+ .q-btn {
626
+ padding: 0;
627
+
628
+ .q-btn__content {
629
+ > span {
630
+ font-size: 14px;
631
+ }
632
+ }
633
+
634
+ &:hover {
635
+ .q-focus-helper {
636
+ background: $positive;
637
+ opacity: 1;
638
+
639
+ &:before,
640
+ &:after {
641
+ display: none;
642
+ }
643
+ }
644
+
645
+ .q-btn__content {
646
+ > span {
647
+ color: white;
648
+ }
649
+ }
650
+ }
651
+ }
652
+ }
653
+ }
654
+ }
655
+ }
656
+ }
657
+ }
658
+ }
659
+ }
660
+ </style>