vueless 0.0.163 → 0.0.165
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.
- package/composable.ui/index.js +2 -5
- package/package.json +2 -2
- package/service.ui/index.js +27 -8
- package/ui.button/composables/attrs.composable.js +3 -3
- package/ui.button/configs/default.config.js +1 -2
- package/ui.button-link/composables/attrs.composable.js +6 -3
- package/ui.container-modal-confirm/composable/attrs.composable.js +18 -29
- package/ui.form-calendar/components/DayView.vue +1 -1
- package/ui.form-calendar/configs/default.config.js +1 -1
- package/ui.form-calendar/index.stories.js +21 -10
- package/ui.form-calendar/index.vue +22 -15
- package/ui.form-calendar/services/calendar.service.js +5 -7
- package/ui.form-calendar/services/date.service.js +1 -23
- package/ui.form-checkbox/composables/attrs.composable.js +3 -3
- package/ui.form-date-picker/configs/default.config.js +1 -1
- package/ui.form-date-picker/index.stories.js +19 -7
- package/ui.form-date-picker/index.vue +7 -12
- package/ui.form-date-picker-range/configs/default.config.js +1 -1
- package/ui.form-date-picker-range/index.stories.js +22 -6
- package/ui.form-date-picker-range/index.vue +79 -84
- package/ui.form-date-picker-range/services/dateRange.service.js +8 -10
- package/ui.form-radio/composables/attrs.composable.js +2 -2
- package/ui.form-switch/composables/attrs.composable.js +3 -3
- package/ui.image-avatar/composables/attrs.composable.js +2 -2
- package/ui.image-icon/composables/attrs.composable.js +3 -3
- package/ui.loader/composables/attrs.composable.js +2 -2
- package/ui.loader-rendering/composables/attrs.composable.js +2 -2
- package/ui.loader-top/composables/attrs.composable.js +7 -2
- package/ui.navigation-progress/composables/attrs.composable.js +2 -2
- package/ui.other-dot/composables/attrs.composable.js +2 -2
- package/ui.text-alert/composables/attrs.composable.js +5 -2
- package/ui.text-alert/configs/default.config.js +5 -1
- package/ui.text-badge/composables/attrs.composable.js +5 -2
- package/ui.text-header/composables/attrs.composable.js +2 -2
- package/ui.text-money/composables/attrs.composable.js +5 -2
- package/web-types.json +14 -17
|
@@ -14,8 +14,8 @@ export default {
|
|
|
14
14
|
component: UDatePickerRange,
|
|
15
15
|
args: {
|
|
16
16
|
value: {
|
|
17
|
-
from:
|
|
18
|
-
to:
|
|
17
|
+
from: new Date(2022, 1, 14),
|
|
18
|
+
to: new Date(2022, 2, 20),
|
|
19
19
|
},
|
|
20
20
|
},
|
|
21
21
|
argTypes: {
|
|
@@ -37,12 +37,21 @@ const DefaultTemplate = (args) => ({
|
|
|
37
37
|
|
|
38
38
|
return { args, slots };
|
|
39
39
|
},
|
|
40
|
+
data() {
|
|
41
|
+
return {
|
|
42
|
+
value: this.args.value,
|
|
43
|
+
};
|
|
44
|
+
},
|
|
40
45
|
template: `
|
|
41
|
-
<UDatePickerRange v-bind="args" v-model="
|
|
46
|
+
<UDatePickerRange v-bind="args" v-model="value">
|
|
42
47
|
<template v-for="(slot, index) of slots" :key="index" v-slot:[slot]>
|
|
43
48
|
<template v-if="args[slot]">{{ args[slot] }}</template>
|
|
44
49
|
</template>
|
|
45
50
|
</UDatePickerRange>
|
|
51
|
+
|
|
52
|
+
<div class="mt-4">
|
|
53
|
+
{{ value }}
|
|
54
|
+
</div>
|
|
46
55
|
`,
|
|
47
56
|
});
|
|
48
57
|
|
|
@@ -142,9 +151,16 @@ error.args = { variant: "input", error: "some error" };
|
|
|
142
151
|
|
|
143
152
|
export const MinMax = DefaultTemplate.bind({});
|
|
144
153
|
MinMax.args = {
|
|
145
|
-
minDate:
|
|
146
|
-
maxDate:
|
|
147
|
-
value: { from:
|
|
154
|
+
minDate: new Date(2022, 2, 22),
|
|
155
|
+
maxDate: new Date(2022, 2, 26),
|
|
156
|
+
value: { from: new Date(2022, 2, 24), to: null },
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
export const DateFormat = DefaultTemplate.bind({});
|
|
160
|
+
DateFormat.args = {
|
|
161
|
+
dateFormat: "d.m.Y",
|
|
162
|
+
userFormat: "d.m.Y",
|
|
163
|
+
value: { from: "28.06.2024", to: "30.06.2024" },
|
|
148
164
|
};
|
|
149
165
|
|
|
150
166
|
export const customRangeButton = DefaultTemplate.bind({});
|
|
@@ -199,13 +199,9 @@ import UIService, { getRandomId } from "../service.ui";
|
|
|
199
199
|
|
|
200
200
|
import {
|
|
201
201
|
addDays,
|
|
202
|
-
gmtToUTC,
|
|
203
|
-
getUnixTimestampFromDate,
|
|
204
202
|
addMonths,
|
|
205
203
|
addYears,
|
|
206
|
-
getDateFromUnixTimestamp,
|
|
207
204
|
getSortedLocale,
|
|
208
|
-
utcToGMT,
|
|
209
205
|
getEndOfMonth,
|
|
210
206
|
getEndOfQuarter,
|
|
211
207
|
getEndOfWeek,
|
|
@@ -251,7 +247,7 @@ defineOptions({ name: "UDatePickerRange", inheritAttrs: false });
|
|
|
251
247
|
|
|
252
248
|
const props = defineProps({
|
|
253
249
|
/**
|
|
254
|
-
*
|
|
250
|
+
* Datepicker value in JS Date Objects or Strings formatted in provided props.dateFormat.
|
|
255
251
|
*/
|
|
256
252
|
modelValue: {
|
|
257
253
|
type: Object,
|
|
@@ -267,7 +263,7 @@ const props = defineProps({
|
|
|
267
263
|
customRangeButton: {
|
|
268
264
|
type: Object,
|
|
269
265
|
default: () => ({
|
|
270
|
-
range: { from:
|
|
266
|
+
range: { from: null, to: null },
|
|
271
267
|
label: "",
|
|
272
268
|
description: "",
|
|
273
269
|
}),
|
|
@@ -444,9 +440,32 @@ const {
|
|
|
444
440
|
} = useAttrs(props, { isShownMenu, isTop, isRight });
|
|
445
441
|
const { tm } = useLocale();
|
|
446
442
|
|
|
443
|
+
const i18nGlobal = tm(UDatePickerRange);
|
|
444
|
+
|
|
445
|
+
const currentLocale = computed(() => merge(defaultConfig.i18n, i18nGlobal, props.config.i18n));
|
|
446
|
+
|
|
447
|
+
const locale = computed(() => {
|
|
448
|
+
const { months, weekdays } = currentLocale.value;
|
|
449
|
+
|
|
450
|
+
// formatted locale
|
|
451
|
+
return {
|
|
452
|
+
...currentLocale.value,
|
|
453
|
+
months: {
|
|
454
|
+
shorthand: getSortedLocale(months.shorthand, LOCALE_TYPE.month),
|
|
455
|
+
longhand: getSortedLocale(months.longhand, LOCALE_TYPE.month),
|
|
456
|
+
},
|
|
457
|
+
weekdays: {
|
|
458
|
+
shorthand: getSortedLocale(weekdays.shorthand, LOCALE_TYPE.day),
|
|
459
|
+
longhand: getSortedLocale(weekdays.longhand, LOCALE_TYPE.day),
|
|
460
|
+
},
|
|
461
|
+
};
|
|
462
|
+
});
|
|
463
|
+
|
|
447
464
|
const calendarValue = ref(props.modelValue);
|
|
448
465
|
const activeDate = ref(
|
|
449
|
-
props.modelValue.from !== null
|
|
466
|
+
props.modelValue.from !== null
|
|
467
|
+
? parseDate(props.modelValue.from, props.dateFormat, locale.value)
|
|
468
|
+
: new Date(),
|
|
450
469
|
);
|
|
451
470
|
const period = ref(PERIOD.ownRange);
|
|
452
471
|
const rangeStart = ref("");
|
|
@@ -457,39 +476,39 @@ const isHoverEvent = ref(false);
|
|
|
457
476
|
const periodDateList = ref(null);
|
|
458
477
|
|
|
459
478
|
const { isMobileBreakpoint } = useBreakpoint();
|
|
460
|
-
const i18nGlobal = tm(UDatePickerRange);
|
|
461
479
|
|
|
462
480
|
const localValue = computed({
|
|
463
|
-
get: () =>
|
|
481
|
+
get: () => {
|
|
482
|
+
return {
|
|
483
|
+
from: parseDate(props.modelValue.from || null, props.dateFormat, locale.value),
|
|
484
|
+
to: parseDate(props.modelValue.to || null, props.dateFormat, locale.value),
|
|
485
|
+
};
|
|
486
|
+
},
|
|
464
487
|
set: (value) => {
|
|
465
|
-
if (value.from && value.to) {
|
|
488
|
+
if (value.from && value.to && !props.dateFormat) {
|
|
466
489
|
emit("update:modelValue", value);
|
|
467
490
|
}
|
|
468
491
|
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
});
|
|
492
|
+
const parsedDateFrom = parseDate(value.from || null, props.dateFormat, locale.value);
|
|
493
|
+
const parsedDateTo = parseDate(value.to || null, props.dateFormat, locale.value);
|
|
472
494
|
|
|
473
|
-
|
|
474
|
-
const
|
|
495
|
+
if (value.from && value.to && props.dateFormat) {
|
|
496
|
+
const newValue = {
|
|
497
|
+
from: formatDate(parsedDateFrom, props.dateFormat, locale.value),
|
|
498
|
+
to: formatDate(parsedDateTo, props.dateFormat, locale.value),
|
|
499
|
+
};
|
|
475
500
|
|
|
476
|
-
|
|
477
|
-
|
|
501
|
+
emit("update:modelValue", newValue);
|
|
502
|
+
}
|
|
478
503
|
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
shorthand: getSortedLocale(months.shorthand, LOCALE_TYPE.month),
|
|
484
|
-
longhand: getSortedLocale(months.longhand, LOCALE_TYPE.month),
|
|
485
|
-
},
|
|
486
|
-
weekdays: {
|
|
487
|
-
shorthand: getSortedLocale(weekdays.shorthand, LOCALE_TYPE.day),
|
|
488
|
-
longhand: getSortedLocale(weekdays.longhand, LOCALE_TYPE.day),
|
|
489
|
-
},
|
|
490
|
-
};
|
|
504
|
+
activeDate.value = props.dateFormat
|
|
505
|
+
? formatDate(parsedDateFrom || new Date(), props.dateFormat, locale.value)
|
|
506
|
+
: value.from || new Date();
|
|
507
|
+
},
|
|
491
508
|
});
|
|
492
509
|
|
|
510
|
+
const rangeInputName = computed(() => `rangeInput-${props.id}`);
|
|
511
|
+
|
|
493
512
|
const userFormatLocale = computed(() => {
|
|
494
513
|
const { months, weekdays } = currentLocale.value;
|
|
495
514
|
|
|
@@ -575,8 +594,8 @@ const userFormatDate = computed(() => {
|
|
|
575
594
|
|
|
576
595
|
const isDefaultTitle = isPeriod.value.week || isPeriod.value.custom || isPeriod.value.ownRange;
|
|
577
596
|
|
|
578
|
-
const from =
|
|
579
|
-
const to = localValue.value.to !== null ?
|
|
597
|
+
const from = localValue.value.from;
|
|
598
|
+
const to = localValue.value.to !== null ? localValue.value.to : null;
|
|
580
599
|
|
|
581
600
|
if (isDefaultTitle) {
|
|
582
601
|
let startMonthName = userFormatLocale.value.months.longhand[from.getMonth()];
|
|
@@ -637,14 +656,8 @@ watch(
|
|
|
637
656
|
calendarValue,
|
|
638
657
|
() => {
|
|
639
658
|
localValue.value = {
|
|
640
|
-
from:
|
|
641
|
-
|
|
642
|
-
? calendarValue.value.from
|
|
643
|
-
: getUnixTimestampFromDate(gmtToUTC(getDateFromUnixTimestamp(calendarValue.value.from))),
|
|
644
|
-
to:
|
|
645
|
-
calendarValue.value.to === null
|
|
646
|
-
? calendarValue.value.to
|
|
647
|
-
: getUnixTimestampFromDate(gmtToUTC(getDateFromUnixTimestamp(calendarValue.value.to))),
|
|
659
|
+
from: calendarValue.value.from,
|
|
660
|
+
to: calendarValue.value.to,
|
|
648
661
|
};
|
|
649
662
|
|
|
650
663
|
nextTick(() => menuRef.value?.focus());
|
|
@@ -655,21 +668,22 @@ watch(
|
|
|
655
668
|
watch(
|
|
656
669
|
() => props.modelValue,
|
|
657
670
|
() => {
|
|
658
|
-
if (props.modelValue.to !== calendarValue.value.to) {
|
|
671
|
+
if (String(props.modelValue.to) !== String(calendarValue.value.to)) {
|
|
659
672
|
calendarValue.value.to = props.modelValue.to;
|
|
660
673
|
}
|
|
661
674
|
|
|
662
|
-
if (props.modelValue.from !== calendarValue.value.from) {
|
|
675
|
+
if (String(props.modelValue.from) !== String(calendarValue.value.from)) {
|
|
663
676
|
calendarValue.value.from = props.modelValue.from;
|
|
664
677
|
}
|
|
665
678
|
|
|
679
|
+
const parsedDateFrom = parseDate(props.modelValue.from, props.dateFormat, locale.value);
|
|
680
|
+
const parsedDateTo = parseDate(props.modelValue.to, props.dateFormat, locale.value);
|
|
681
|
+
|
|
666
682
|
rangeStart.value = props.modelValue.from
|
|
667
|
-
? formatDate(
|
|
683
|
+
? formatDate(parsedDateFrom, "d.m.Y", locale.value)
|
|
668
684
|
: "";
|
|
669
685
|
|
|
670
|
-
rangeEnd.value = props.modelValue.to
|
|
671
|
-
? formatDate(getDateFromUnixTimestamp(props.modelValue.to), props.dateFormat, locale.value)
|
|
672
|
-
: "";
|
|
686
|
+
rangeEnd.value = props.modelValue.to ? formatDate(parsedDateTo, "d.m.Y", locale.value) : "";
|
|
673
687
|
|
|
674
688
|
inputRangeStartError.value = "";
|
|
675
689
|
inputRangeEndError.value = "";
|
|
@@ -678,13 +692,11 @@ watch(
|
|
|
678
692
|
);
|
|
679
693
|
|
|
680
694
|
watch(period, () => {
|
|
681
|
-
activeDate.value =
|
|
682
|
-
localValue.value.from !== null ? getDateFromUnixTimestamp(localValue.value.from) : new Date();
|
|
695
|
+
activeDate.value = localValue.value.from !== null ? localValue.value.from : new Date();
|
|
683
696
|
});
|
|
684
697
|
|
|
685
698
|
function onClickPeriodButton(periodName) {
|
|
686
|
-
const localDate =
|
|
687
|
-
localValue.value.from !== null ? getDateFromUnixTimestamp(localValue.value.from) : new Date();
|
|
699
|
+
const localDate = localValue.value.from !== null ? localValue.value.from : new Date();
|
|
688
700
|
|
|
689
701
|
if (periodName === PERIOD.week) {
|
|
690
702
|
periodDateList.value = getWeekDateList(localDate, locale.value.months.shorthand);
|
|
@@ -736,37 +748,21 @@ function onClickCustomRangeButton() {
|
|
|
736
748
|
}
|
|
737
749
|
|
|
738
750
|
function selectCustomRange() {
|
|
739
|
-
const from =
|
|
740
|
-
typeof props.customRangeButton.range.from === "number"
|
|
741
|
-
? getDateFromUnixTimestamp(props.customRangeButton.range.from)
|
|
742
|
-
: props.customRangeButton.range.from;
|
|
743
|
-
|
|
744
|
-
const to =
|
|
745
|
-
typeof props.customRangeButton.range.to === "number"
|
|
746
|
-
? getDateFromUnixTimestamp(props.customRangeButton.range.to)
|
|
747
|
-
: props.customRangeButton.range.to;
|
|
748
|
-
|
|
749
751
|
localValue.value = {
|
|
750
|
-
from:
|
|
751
|
-
to:
|
|
752
|
+
from: props.customRangeButton.range.from,
|
|
753
|
+
to: props.customRangeButton.range.to,
|
|
752
754
|
};
|
|
753
755
|
}
|
|
754
756
|
|
|
755
757
|
function isDatePeriodOutOfRange(datePeriod) {
|
|
756
758
|
return (
|
|
757
759
|
dateIsOutOfRange(
|
|
758
|
-
|
|
760
|
+
datePeriod.startRange,
|
|
759
761
|
props.minDate,
|
|
760
762
|
props.maxDate,
|
|
761
763
|
locale.value,
|
|
762
764
|
props.dateFormat,
|
|
763
|
-
) ||
|
|
764
|
-
dateIsOutOfRange(
|
|
765
|
-
getDateFromUnixTimestamp(datePeriod.endRange),
|
|
766
|
-
props.minDate,
|
|
767
|
-
props.maxDate,
|
|
768
|
-
props.dateFormat,
|
|
769
|
-
)
|
|
765
|
+
) || dateIsOutOfRange(datePeriod.endRange, props.minDate, props.maxDate, props.dateFormat)
|
|
770
766
|
);
|
|
771
767
|
}
|
|
772
768
|
|
|
@@ -874,8 +870,7 @@ function onInputRangeInput(value, type) {
|
|
|
874
870
|
inputRangeEndError.value = error;
|
|
875
871
|
}
|
|
876
872
|
|
|
877
|
-
const parsedValue =
|
|
878
|
-
const unixTimeValue = getUnixTimestampFromDate(parsedValue);
|
|
873
|
+
const parsedValue = parseDate(value || new Date(), props.dateFormat, locale.value);
|
|
879
874
|
const isOutOfRange = dateIsOutOfRange(
|
|
880
875
|
parsedValue,
|
|
881
876
|
props.minDate,
|
|
@@ -883,25 +878,25 @@ function onInputRangeInput(value, type) {
|
|
|
883
878
|
locale.value,
|
|
884
879
|
props.dateFormat,
|
|
885
880
|
);
|
|
886
|
-
const isToLessThanFrom =
|
|
881
|
+
const isToLessThanFrom = parsedValue <= localValue.value.from;
|
|
887
882
|
|
|
888
883
|
if (type === INPUT_RANGE_TYPE.start && !error && !isOutOfRange) {
|
|
889
|
-
localValue.value.from = value ?
|
|
884
|
+
localValue.value.from = value ? parsedValue : "";
|
|
890
885
|
}
|
|
891
886
|
|
|
892
887
|
if (type === INPUT_RANGE_TYPE.end && !error && !isOutOfRange && !isToLessThanFrom) {
|
|
893
|
-
localValue.value.to = value ?
|
|
888
|
+
localValue.value.to = value ? parsedValue : "";
|
|
894
889
|
}
|
|
895
890
|
}
|
|
896
891
|
|
|
897
892
|
setDefaultPeriodForButton();
|
|
898
893
|
|
|
899
894
|
function setDefaultPeriodForButton() {
|
|
900
|
-
const from =
|
|
901
|
-
const to =
|
|
895
|
+
const from = props.modelValue.from || new Date();
|
|
896
|
+
const to = props.modelValue.to || new Date();
|
|
902
897
|
|
|
903
|
-
const customFrom =
|
|
904
|
-
const customTo =
|
|
898
|
+
const customFrom = props.customRangeButton.range.from || new Date();
|
|
899
|
+
const customTo = props.customRangeButton.range.to || new Date();
|
|
905
900
|
|
|
906
901
|
const isWeekPeriod =
|
|
907
902
|
String(from) === String(getStartOfWeek(from, { weekStartsOn: 1 })) &&
|
|
@@ -946,15 +941,15 @@ function onClickShiftRange(action) {
|
|
|
946
941
|
const millisecondsPerDay =
|
|
947
942
|
millisecondsPerSecond * secondsPerMinute * minutesPerHour * hoursPerDay;
|
|
948
943
|
|
|
949
|
-
const from =
|
|
950
|
-
const to = localValue.value.to ?
|
|
944
|
+
const from = localValue.value.from;
|
|
945
|
+
const to = localValue.value.to ? localValue.value.to : addDays(from, 1);
|
|
951
946
|
const daysDifference = Math.ceil(Math.abs(getDatesDifference(from, to)) / millisecondsPerDay);
|
|
952
947
|
|
|
953
948
|
if (action === "next") {
|
|
954
949
|
if (isPeriod.value.ownRange) {
|
|
955
950
|
const nextDate = {
|
|
956
|
-
to:
|
|
957
|
-
from:
|
|
951
|
+
to: addDays(to, daysDifference),
|
|
952
|
+
from: addDays(from, daysDifference),
|
|
958
953
|
};
|
|
959
954
|
|
|
960
955
|
if (isDatePeriodOutOfRange(nextDate)) return;
|
|
@@ -979,8 +974,8 @@ function onClickShiftRange(action) {
|
|
|
979
974
|
} else {
|
|
980
975
|
if (isPeriod.value.ownRange) {
|
|
981
976
|
const previousDate = {
|
|
982
|
-
to:
|
|
983
|
-
from:
|
|
977
|
+
to: addDays(to, daysDifference * -1),
|
|
978
|
+
from: addDays(from, daysDifference * -1),
|
|
984
979
|
};
|
|
985
980
|
|
|
986
981
|
if (isDatePeriodOutOfRange(previousDate)) return;
|
|
@@ -2,9 +2,7 @@ import {
|
|
|
2
2
|
getWeeksInMonth,
|
|
3
3
|
getStartOfWeek,
|
|
4
4
|
getEndOfWeek,
|
|
5
|
-
gmtToUTC,
|
|
6
5
|
addWeeks,
|
|
7
|
-
getUnixTimestampFromDate,
|
|
8
6
|
getEndOfMonth,
|
|
9
7
|
getStartOfMonth,
|
|
10
8
|
getEndOfQuarter,
|
|
@@ -27,8 +25,8 @@ export function getYearDateList(date) {
|
|
|
27
25
|
|
|
28
26
|
years.push({
|
|
29
27
|
title: currentYear,
|
|
30
|
-
startRange:
|
|
31
|
-
endRange:
|
|
28
|
+
startRange: getStartOfYear(new Date(currentYear, month)),
|
|
29
|
+
endRange: getEndOfYear(new Date(currentYear, month)),
|
|
32
30
|
});
|
|
33
31
|
}
|
|
34
32
|
|
|
@@ -51,8 +49,8 @@ export function getQuartersDateList(date, quarterLocales = "") {
|
|
|
51
49
|
|
|
52
50
|
quarters.push({
|
|
53
51
|
title: `${currentQuarter} ${quarterLocales}`,
|
|
54
|
-
startRange:
|
|
55
|
-
endRange:
|
|
52
|
+
startRange: getStartOfQuarter(newQuarter),
|
|
53
|
+
endRange: getEndOfQuarter(newQuarter),
|
|
56
54
|
});
|
|
57
55
|
}
|
|
58
56
|
|
|
@@ -65,8 +63,8 @@ export function getMonthsDateList(date, monthLocales = []) {
|
|
|
65
63
|
const months = monthLocales.map((item, index) => {
|
|
66
64
|
return {
|
|
67
65
|
title: item,
|
|
68
|
-
startRange:
|
|
69
|
-
endRange:
|
|
66
|
+
startRange: getStartOfMonth(new Date(year, index)),
|
|
67
|
+
endRange: getEndOfMonth(new Date(year, index)),
|
|
70
68
|
};
|
|
71
69
|
});
|
|
72
70
|
|
|
@@ -105,8 +103,8 @@ export function getWeekDateList(date, monthShortLocales = {}) {
|
|
|
105
103
|
|
|
106
104
|
weeks.push({
|
|
107
105
|
title,
|
|
108
|
-
startRange:
|
|
109
|
-
endRange:
|
|
106
|
+
startRange: startOfWeekDate,
|
|
107
|
+
endRange: endOfWeekDate,
|
|
110
108
|
});
|
|
111
109
|
}
|
|
112
110
|
|
|
@@ -5,7 +5,7 @@ import { cva } from "../../service.ui";
|
|
|
5
5
|
import defaultConfig from "../configs/default.config";
|
|
6
6
|
|
|
7
7
|
export function useAttrs(props, { radioColor, radioSize }) {
|
|
8
|
-
const { config, getAttrs, setColor } = useUI(defaultConfig, () => props.config);
|
|
8
|
+
const { config, getAttrs, getColor, setColor } = useUI(defaultConfig, () => props.config);
|
|
9
9
|
const { radio } = config.value;
|
|
10
10
|
|
|
11
11
|
const cvaRadio = cva({
|
|
@@ -17,7 +17,7 @@ export function useAttrs(props, { radioColor, radioSize }) {
|
|
|
17
17
|
const radioClasses = computed(() =>
|
|
18
18
|
setColor(
|
|
19
19
|
cvaRadio({
|
|
20
|
-
color: radioColor.value,
|
|
20
|
+
color: getColor(radioColor.value),
|
|
21
21
|
size: radioSize.value,
|
|
22
22
|
}),
|
|
23
23
|
radioColor.value,
|
|
@@ -5,7 +5,7 @@ import defaultConfig from "../configs/default.config";
|
|
|
5
5
|
import { computed } from "vue";
|
|
6
6
|
|
|
7
7
|
export function useAttrs(props, { checked }) {
|
|
8
|
-
const { config, getAttrs, setColor } = useUI(defaultConfig, () => props.config);
|
|
8
|
+
const { config, getAttrs, getColor, setColor } = useUI(defaultConfig, () => props.config);
|
|
9
9
|
const { wrapper, circle, toggleLabel } = config.value;
|
|
10
10
|
|
|
11
11
|
const cvaWrapper = cva({
|
|
@@ -30,7 +30,7 @@ export function useAttrs(props, { checked }) {
|
|
|
30
30
|
setColor(
|
|
31
31
|
cvaWrapper({
|
|
32
32
|
size: props.size,
|
|
33
|
-
color: props.color,
|
|
33
|
+
color: getColor(props.color),
|
|
34
34
|
disabled: props.disabled,
|
|
35
35
|
checked: Boolean(checked.value),
|
|
36
36
|
toggleLabel: props.toggleLabel,
|
|
@@ -50,7 +50,7 @@ export function useAttrs(props, { checked }) {
|
|
|
50
50
|
setColor(
|
|
51
51
|
cvaToggleLabel({
|
|
52
52
|
size: props.size,
|
|
53
|
-
color: props.color,
|
|
53
|
+
color: getColor(props.color),
|
|
54
54
|
toggleLabel: props.toggleLabel,
|
|
55
55
|
checked: Boolean(checked.value),
|
|
56
56
|
}),
|
|
@@ -5,7 +5,7 @@ import defaultConfig from "../configs/default.config";
|
|
|
5
5
|
import { computed } from "vue";
|
|
6
6
|
|
|
7
7
|
export function useAttrs(props) {
|
|
8
|
-
const { config, getAttrs, setColor } = useUI(defaultConfig, () => props.config);
|
|
8
|
+
const { config, getAttrs, getColor, setColor } = useUI(defaultConfig, () => props.config);
|
|
9
9
|
const { avatar } = config.value;
|
|
10
10
|
|
|
11
11
|
const cvaAvatar = cva({
|
|
@@ -18,7 +18,7 @@ export function useAttrs(props) {
|
|
|
18
18
|
setColor(
|
|
19
19
|
cvaAvatar({
|
|
20
20
|
size: props.size,
|
|
21
|
-
color: props.color,
|
|
21
|
+
color: getColor(props.color),
|
|
22
22
|
rounded: props.rounded,
|
|
23
23
|
bordered: props.bordered,
|
|
24
24
|
}),
|
|
@@ -5,7 +5,7 @@ import defaultConfig from "../configs/default.config";
|
|
|
5
5
|
import { computed } from "vue";
|
|
6
6
|
|
|
7
7
|
export function useAttrs(props) {
|
|
8
|
-
const { config, getAttrs, setColor } = useUI(defaultConfig, () => props.config);
|
|
8
|
+
const { config, getAttrs, getColor, setColor } = useUI(defaultConfig, () => props.config);
|
|
9
9
|
const { wrapper, container, icon } = config.value;
|
|
10
10
|
|
|
11
11
|
const cvaWrapper = cva({
|
|
@@ -31,7 +31,7 @@ export function useAttrs(props) {
|
|
|
31
31
|
cvaWrapper({
|
|
32
32
|
pill: props.pill,
|
|
33
33
|
size: props.size,
|
|
34
|
-
color: props.color,
|
|
34
|
+
color: getColor(props.color),
|
|
35
35
|
}),
|
|
36
36
|
props.color,
|
|
37
37
|
),
|
|
@@ -42,7 +42,7 @@ export function useAttrs(props) {
|
|
|
42
42
|
cvaContainer({
|
|
43
43
|
pill: props.pill,
|
|
44
44
|
size: props.size,
|
|
45
|
-
color: props.color,
|
|
45
|
+
color: getColor(props.color),
|
|
46
46
|
variant: props.variant,
|
|
47
47
|
interactive: props.interactive,
|
|
48
48
|
}),
|
|
@@ -5,7 +5,7 @@ import defaultConfig from "../configs/default.config";
|
|
|
5
5
|
import { computed } from "vue";
|
|
6
6
|
|
|
7
7
|
export function useAttrs(props) {
|
|
8
|
-
const { config, getAttrs, setColor } = useUI(defaultConfig, () => props.config);
|
|
8
|
+
const { config, getAttrs, getColor, setColor } = useUI(defaultConfig, () => props.config);
|
|
9
9
|
const { loader, ellipse } = config.value;
|
|
10
10
|
|
|
11
11
|
const cvaLoader = cva({
|
|
@@ -30,7 +30,7 @@ export function useAttrs(props) {
|
|
|
30
30
|
setColor(
|
|
31
31
|
cvaEllipse({
|
|
32
32
|
size: props.size,
|
|
33
|
-
color: props.color,
|
|
33
|
+
color: getColor(props.color),
|
|
34
34
|
}),
|
|
35
35
|
props.color,
|
|
36
36
|
),
|
|
@@ -5,7 +5,7 @@ import { cva } from "../../service.ui";
|
|
|
5
5
|
import defaultConfig from "../configs/default.config";
|
|
6
6
|
|
|
7
7
|
export function useAttrs(props) {
|
|
8
|
-
const { getAttrs,
|
|
8
|
+
const { config, getAttrs, getColor, setColor } = useUI(defaultConfig, () => props.config);
|
|
9
9
|
const { wrapper } = config.value;
|
|
10
10
|
|
|
11
11
|
const cvaWrapper = cva({
|
|
@@ -17,7 +17,7 @@ export function useAttrs(props) {
|
|
|
17
17
|
const wrapperClasses = computed(() =>
|
|
18
18
|
setColor(
|
|
19
19
|
cvaWrapper({
|
|
20
|
-
color: props.color,
|
|
20
|
+
color: getColor(props.color),
|
|
21
21
|
}),
|
|
22
22
|
props.color,
|
|
23
23
|
),
|
|
@@ -5,7 +5,7 @@ import defaultConfig from "../configs/default.config";
|
|
|
5
5
|
import { computed } from "vue";
|
|
6
6
|
|
|
7
7
|
export function useAttrs(props) {
|
|
8
|
-
const { config, getAttrs, setColor } = useUI(defaultConfig, () => props.config);
|
|
8
|
+
const { config, getAttrs, getColor, setColor } = useUI(defaultConfig, () => props.config);
|
|
9
9
|
const { progress } = config.value;
|
|
10
10
|
|
|
11
11
|
const cvaProgress = cva({
|
|
@@ -15,7 +15,12 @@ export function useAttrs(props) {
|
|
|
15
15
|
});
|
|
16
16
|
|
|
17
17
|
const progressClasses = computed(() =>
|
|
18
|
-
setColor(
|
|
18
|
+
setColor(
|
|
19
|
+
cvaProgress({
|
|
20
|
+
color: getColor(props.color),
|
|
21
|
+
}),
|
|
22
|
+
props.color,
|
|
23
|
+
),
|
|
19
24
|
);
|
|
20
25
|
|
|
21
26
|
const progressAttrs = getAttrs("progress", { classes: progressClasses.value });
|
|
@@ -5,7 +5,7 @@ import defaultConfig from "../configs/default.config";
|
|
|
5
5
|
import { computed } from "vue";
|
|
6
6
|
|
|
7
7
|
export function useAttrs(props) {
|
|
8
|
-
const { config, getAttrs, setColor } = useUI(defaultConfig, () => props.config);
|
|
8
|
+
const { config, getAttrs, getColor, setColor } = useUI(defaultConfig, () => props.config);
|
|
9
9
|
const { progress } = config.value;
|
|
10
10
|
|
|
11
11
|
const cvaProgress = cva({
|
|
@@ -18,7 +18,7 @@ export function useAttrs(props) {
|
|
|
18
18
|
setColor(
|
|
19
19
|
cvaProgress({
|
|
20
20
|
size: props.size,
|
|
21
|
-
color: props.color,
|
|
21
|
+
color: getColor(props.color),
|
|
22
22
|
}),
|
|
23
23
|
props.color,
|
|
24
24
|
),
|
|
@@ -5,7 +5,7 @@ import defaultConfig from "../configs/default.config";
|
|
|
5
5
|
import { computed } from "vue";
|
|
6
6
|
|
|
7
7
|
export function useAttrs(props) {
|
|
8
|
-
const { config, getAttrs, setColor } = useUI(defaultConfig, () => props.config);
|
|
8
|
+
const { config, getAttrs, getColor, setColor } = useUI(defaultConfig, () => props.config);
|
|
9
9
|
const { wrapper } = config.value;
|
|
10
10
|
|
|
11
11
|
const cvaWrapper = cva({
|
|
@@ -18,7 +18,7 @@ export function useAttrs(props) {
|
|
|
18
18
|
setColor(
|
|
19
19
|
cvaWrapper({
|
|
20
20
|
size: props.size,
|
|
21
|
-
color: props.color,
|
|
21
|
+
color: getColor(props.color),
|
|
22
22
|
}),
|
|
23
23
|
props.color,
|
|
24
24
|
),
|
|
@@ -5,7 +5,10 @@ import defaultConfig from "../configs/default.config";
|
|
|
5
5
|
import { computed } from "vue";
|
|
6
6
|
|
|
7
7
|
export function useAttrs(props) {
|
|
8
|
-
const { config, getAttrs,
|
|
8
|
+
const { config, getAttrs, hasSlotContent, getColor, setColor } = useUI(
|
|
9
|
+
defaultConfig,
|
|
10
|
+
() => props.config,
|
|
11
|
+
);
|
|
9
12
|
const { wrapper, body } = config.value;
|
|
10
13
|
|
|
11
14
|
const cvaWrapper = cva({
|
|
@@ -23,7 +26,7 @@ export function useAttrs(props) {
|
|
|
23
26
|
const wrapperClasses = computed(() =>
|
|
24
27
|
setColor(
|
|
25
28
|
cvaWrapper({
|
|
26
|
-
color: props.color,
|
|
29
|
+
color: getColor(props.color),
|
|
27
30
|
bordered: props.bordered,
|
|
28
31
|
}),
|
|
29
32
|
props.color,
|
|
@@ -43,5 +43,9 @@ export default /*tw*/ {
|
|
|
43
43
|
bordered: false,
|
|
44
44
|
closeIcon: false,
|
|
45
45
|
},
|
|
46
|
-
safelist: (colors) => [
|
|
46
|
+
safelist: (colors) => [
|
|
47
|
+
{ pattern: `bg-(${colors})-50` },
|
|
48
|
+
{ pattern: `text-(${colors})-700` },
|
|
49
|
+
{ pattern: `border-(${colors})-100` },
|
|
50
|
+
],
|
|
47
51
|
};
|
|
@@ -5,7 +5,10 @@ import defaultConfig from "../configs/default.config";
|
|
|
5
5
|
import { computed } from "vue";
|
|
6
6
|
|
|
7
7
|
export function useAttrs(props) {
|
|
8
|
-
const { config, getAttrs, hasSlotContent, setColor } = useUI(
|
|
8
|
+
const { config, getAttrs, hasSlotContent, getColor, setColor } = useUI(
|
|
9
|
+
defaultConfig,
|
|
10
|
+
() => props.config,
|
|
11
|
+
);
|
|
9
12
|
const { wrapper, body } = config.value;
|
|
10
13
|
|
|
11
14
|
const cvaWrapper = cva({
|
|
@@ -25,7 +28,7 @@ export function useAttrs(props) {
|
|
|
25
28
|
cvaWrapper({
|
|
26
29
|
variant: props.variant,
|
|
27
30
|
size: props.size,
|
|
28
|
-
color: props.color,
|
|
31
|
+
color: getColor(props.color),
|
|
29
32
|
weight: props.weight,
|
|
30
33
|
}),
|
|
31
34
|
props.color,
|