vueless 0.0.554 → 0.0.556
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/composables/useUI.ts +28 -64
- package/constants.js +21 -2
- package/index.d.ts +8 -1
- package/index.ts +1 -1
- package/package.json +1 -1
- package/types.ts +4 -10
- package/ui.button/UButton.vue +21 -7
- package/ui.button-link/ULink.vue +14 -2
- package/ui.button-link/config.ts +6 -1
- package/ui.button-link/useAttrs.ts +8 -39
- package/ui.button-toggle/useAttrs.ts +2 -8
- package/ui.button-toggle-item/config.ts +9 -11
- package/ui.button-toggle-item/useAttrs.ts +4 -18
- package/ui.container-accordion/config.ts +3 -1
- package/ui.container-accordion/useAttrs.ts +6 -17
- package/ui.container-card/UCard.vue +2 -1
- package/ui.container-card/useAttrs.ts +2 -8
- package/ui.container-col/useAttrs.ts +2 -8
- package/ui.container-divider/useAttrs.ts +2 -8
- package/ui.container-group/useAttrs.ts +2 -8
- package/ui.container-groups/useAttrs.ts +2 -8
- package/ui.container-modal/UModal.vue +1 -1
- package/ui.container-modal/useAttrs.ts +2 -12
- package/ui.container-modal-confirm/UModalConfirm.vue +3 -7
- package/ui.container-modal-confirm/useAttrs.ts +2 -8
- package/ui.container-page/UPage.vue +4 -5
- package/ui.container-page/useAttrs.ts +3 -32
- package/ui.container-row/useAttrs.ts +2 -8
- package/ui.data-list/UDataList.vue +3 -2
- package/ui.data-list/config.js +1 -1
- package/ui.data-list/useAttrs.js +2 -18
- package/ui.data-table/UTable.vue +6 -6
- package/ui.data-table/UTableRow.vue +1 -5
- package/ui.data-table/config.ts +28 -13
- package/ui.data-table/useAttrs.ts +10 -75
- package/ui.dropdown-badge/config.ts +10 -2
- package/ui.dropdown-badge/useAttrs.ts +8 -21
- package/ui.dropdown-button/config.ts +6 -6
- package/ui.dropdown-button/useAttrs.ts +6 -19
- package/ui.dropdown-link/config.ts +8 -2
- package/ui.dropdown-link/useAttrs.ts +10 -20
- package/ui.dropdown-list/config.ts +3 -2
- package/ui.dropdown-list/useAttrs.ts +2 -25
- package/ui.form-calendar/config.ts +36 -36
- package/ui.form-calendar/useAttrs.ts +2 -264
- package/ui.form-checkbox/useAttrs.ts +2 -8
- package/ui.form-checkbox-group/useAttrs.ts +2 -8
- package/ui.form-checkbox-multi-state/useAttrs.ts +2 -6
- package/ui.form-color-picker/useAttrs.js +2 -8
- package/ui.form-date-picker/useAttrs.ts +2 -6
- package/ui.form-date-picker-range/UDatePickerRange.vue +28 -28
- package/ui.form-date-picker-range/config.ts +30 -16
- package/ui.form-date-picker-range/useAttrs.ts +9 -70
- package/ui.form-input/UInput.vue +1 -1
- package/ui.form-input/useAttrs.js +2 -8
- package/ui.form-input-file/UInputFile.vue +3 -4
- package/ui.form-input-file/useAttrs.js +2 -8
- package/ui.form-input-money/useAttrs.js +2 -8
- package/ui.form-input-number/useAttrs.js +2 -8
- package/ui.form-input-rating/UInputRating.vue +5 -11
- package/ui.form-input-rating/useAttrs.js +2 -8
- package/ui.form-input-search/useAttrs.js +2 -8
- package/ui.form-label/useAttrs.js +2 -8
- package/ui.form-radio/useAttrs.ts +2 -8
- package/ui.form-radio-group/useAttrs.ts +2 -8
- package/ui.form-select/USelect.vue +37 -38
- package/ui.form-select/config.js +30 -11
- package/ui.form-select/useAttrs.js +6 -50
- package/ui.form-switch/useAttrs.js +2 -8
- package/ui.form-textarea/UTextarea.vue +5 -9
- package/ui.form-textarea/useAttrs.js +2 -8
- package/ui.image-avatar/useAttrs.ts +2 -8
- package/ui.image-icon/useAttrs.ts +2 -8
- package/ui.loader/config.ts +4 -1
- package/ui.loader/useAttrs.ts +2 -17
- package/ui.loader-overlay/useAttrs.ts +2 -12
- package/ui.loader-progress/ULoaderProgress.vue +2 -2
- package/ui.loader-progress/config.ts +8 -2
- package/ui.loader-progress/types.ts +5 -0
- package/ui.loader-progress/useAttrs.ts +3 -27
- package/ui.navigation-pagination/config.ts +6 -6
- package/ui.navigation-pagination/useAttrs.ts +2 -34
- package/ui.navigation-progress/config.ts +3 -1
- package/ui.navigation-progress/useAttrs.ts +5 -17
- package/ui.navigation-tab/config.ts +3 -1
- package/ui.navigation-tab/useAttrs.ts +4 -18
- package/ui.navigation-tabs/useAttrs.ts +2 -8
- package/ui.other-dot/useAttrs.ts +2 -8
- package/ui.text-alert/UAlert.vue +2 -1
- package/ui.text-alert/useAttrs.ts +2 -8
- package/ui.text-badge/useAttrs.ts +3 -8
- package/ui.text-block/UText.vue +2 -1
- package/ui.text-block/useAttrs.ts +2 -8
- package/ui.text-empty/useAttrs.ts +2 -8
- package/ui.text-file/useAttrs.ts +2 -8
- package/ui.text-files/useAttrs.ts +2 -8
- package/ui.text-header/useAttrs.ts +2 -8
- package/ui.text-money/UMoney.vue +1 -1
- package/ui.text-money/useAttrs.ts +2 -8
- package/ui.text-notify/useAttrs.ts +2 -8
- package/utils/helper.ts +29 -0
- package/utils/node/tailwindSafelist.js +2 -2
- package/utils/ui.ts +3 -4
- package/web-types.json +17 -1
- package/ui.button/useAttrs.ts +0 -26
|
@@ -15,25 +15,12 @@ export default function useAttrs(
|
|
|
15
15
|
props: UDropdownButtonProps,
|
|
16
16
|
{ isShownOptions }: DropdownButtonState,
|
|
17
17
|
): UseAttrs<Config> {
|
|
18
|
-
const { config, getKeysAttrs
|
|
19
|
-
defaultConfig,
|
|
20
|
-
() => props.config,
|
|
21
|
-
);
|
|
18
|
+
const { config, getKeysAttrs } = useUI(defaultConfig, () => props.config);
|
|
22
19
|
|
|
23
|
-
const
|
|
24
|
-
|
|
20
|
+
const mutatedProps = computed(() => ({
|
|
21
|
+
/* component state, not a props */
|
|
22
|
+
opened: isShownOptions.value,
|
|
23
|
+
}));
|
|
25
24
|
|
|
26
|
-
|
|
27
|
-
dropdownButton: {
|
|
28
|
-
extend: computed(() => [
|
|
29
|
-
isShownOptions.value && extendingKeysClasses.dropdownButtonActive.value,
|
|
30
|
-
]),
|
|
31
|
-
},
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
return {
|
|
35
|
-
config,
|
|
36
|
-
...keysAttrs,
|
|
37
|
-
hasSlotContent,
|
|
38
|
-
};
|
|
25
|
+
return { config, ...getKeysAttrs(mutatedProps) };
|
|
39
26
|
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
export default /*tw*/ {
|
|
2
|
-
wrapper:
|
|
3
|
-
|
|
2
|
+
wrapper: {
|
|
3
|
+
base: "relative inline-block",
|
|
4
|
+
variants: {
|
|
5
|
+
opened: {
|
|
6
|
+
true: "group",
|
|
7
|
+
},
|
|
8
|
+
},
|
|
9
|
+
},
|
|
4
10
|
dropdownLink: "{ULink}",
|
|
5
11
|
dropdownIcon: "{UIcon} block transition duration-300 group-[]:rotate-180",
|
|
6
12
|
dropdownList: {
|
|
@@ -1,36 +1,26 @@
|
|
|
1
|
-
import { computed
|
|
1
|
+
import { computed } from "vue";
|
|
2
2
|
import useUI from "../composables/useUI.ts";
|
|
3
3
|
|
|
4
4
|
import defaultConfig from "./config.ts";
|
|
5
5
|
|
|
6
|
+
import type { Ref } from "vue";
|
|
6
7
|
import type { Config, UDropdownLinkProps } from "./types.ts";
|
|
7
8
|
import type { UseAttrs } from "../types.ts";
|
|
8
9
|
|
|
9
|
-
interface
|
|
10
|
+
interface ComponentState {
|
|
10
11
|
isShownOptions: Ref<boolean>;
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
export default function useAttrs(
|
|
14
15
|
props: UDropdownLinkProps,
|
|
15
|
-
{ isShownOptions }:
|
|
16
|
+
{ isShownOptions }: ComponentState,
|
|
16
17
|
): UseAttrs<Config> {
|
|
17
|
-
const { config, getKeysAttrs
|
|
18
|
-
defaultConfig,
|
|
19
|
-
() => props.config,
|
|
20
|
-
);
|
|
18
|
+
const { config, getKeysAttrs } = useUI(defaultConfig, () => props.config);
|
|
21
19
|
|
|
22
|
-
const
|
|
23
|
-
|
|
20
|
+
const mutatedProps = computed(() => ({
|
|
21
|
+
/* component state, not a props */
|
|
22
|
+
opened: isShownOptions.value,
|
|
23
|
+
}));
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
wrapper: {
|
|
27
|
-
extend: computed(() => [isShownOptions.value && extendingKeysClasses.wrapperActive.value]),
|
|
28
|
-
},
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
return {
|
|
32
|
-
config,
|
|
33
|
-
...keysAttrs,
|
|
34
|
-
hasSlotContent,
|
|
35
|
-
};
|
|
25
|
+
return { config, ...getKeysAttrs(mutatedProps) };
|
|
36
26
|
}
|
|
@@ -39,12 +39,13 @@ export default /*tw*/ {
|
|
|
39
39
|
},
|
|
40
40
|
},
|
|
41
41
|
group: `
|
|
42
|
+
{>groupBase}
|
|
42
43
|
border-t border-gray-100 group-first/item:border-none
|
|
43
44
|
mt-1.5 group-first/item:mt-0
|
|
44
45
|
pt-4 group-first/item:pt-2
|
|
45
46
|
`,
|
|
46
|
-
subGroup: "pt-2",
|
|
47
|
-
addOptionLabelWrapper: "-mb-[1.375rem] active:bg-brand-100",
|
|
47
|
+
subGroup: "{>groupBase} pt-2",
|
|
48
|
+
addOptionLabelWrapper: "{>option} -mb-[1.375rem] active:bg-brand-100",
|
|
48
49
|
addOptionLabel: "leading-none font-medium",
|
|
49
50
|
addOptionLabelHotkey: "text-gray-500",
|
|
50
51
|
addOptionButton: "{UButton} !leading-none sticky left-[calc(100%-2.15rem)] bottom-2 p-1",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { computed } from "vue";
|
|
2
1
|
import useUI from "../composables/useUI.ts";
|
|
3
2
|
|
|
4
3
|
import defaultConfig from "./config.ts";
|
|
@@ -7,29 +6,7 @@ import type { Config, UDropdownListProps } from "./types.ts";
|
|
|
7
6
|
import type { UseAttrs } from "../types.ts";
|
|
8
7
|
|
|
9
8
|
export default function useAttrs(props: UDropdownListProps): UseAttrs<Config> {
|
|
10
|
-
const { config, getKeysAttrs
|
|
11
|
-
defaultConfig,
|
|
12
|
-
() => props.config,
|
|
13
|
-
);
|
|
9
|
+
const { config, getKeysAttrs } = useUI(defaultConfig, () => props.config);
|
|
14
10
|
|
|
15
|
-
|
|
16
|
-
const extendingKeysClasses = getExtendingKeysClasses(extendingKeys);
|
|
17
|
-
|
|
18
|
-
const keysAttrs = getKeysAttrs({}, [], {
|
|
19
|
-
addOptionLabelWrapper: {
|
|
20
|
-
base: computed(() => [extendingKeysClasses.option.value]),
|
|
21
|
-
},
|
|
22
|
-
group: {
|
|
23
|
-
base: computed(() => [extendingKeysClasses.groupBase.value]),
|
|
24
|
-
},
|
|
25
|
-
subGroup: {
|
|
26
|
-
base: computed(() => [extendingKeysClasses.groupBase.value]),
|
|
27
|
-
},
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
return {
|
|
31
|
-
config,
|
|
32
|
-
...keysAttrs,
|
|
33
|
-
hasSlotContent,
|
|
34
|
-
};
|
|
11
|
+
return { config, ...getKeysAttrs() };
|
|
35
12
|
}
|
|
@@ -23,51 +23,51 @@ export default /*tw*/ {
|
|
|
23
23
|
selectedDate: "",
|
|
24
24
|
currentDate: "border-2 border-brand-600",
|
|
25
25
|
day: "{UButton} size-9 w-full",
|
|
26
|
-
currentDay: "",
|
|
27
|
-
dayInRange: "",
|
|
28
|
-
currentDayInRange: "",
|
|
29
|
-
anotherMonthDay: "font-normal",
|
|
30
|
-
firstDayInRange: "",
|
|
31
|
-
anotherMonthFirstDayInRange: "",
|
|
32
|
-
lastDayInRange: "",
|
|
33
|
-
currentLastDayInRange: "",
|
|
26
|
+
currentDay: "{>day} {>currentDate}",
|
|
27
|
+
dayInRange: "{>day} {>dateInRange}",
|
|
28
|
+
currentDayInRange: "{>day} {>dateInRange} {>currentDate}",
|
|
29
|
+
anotherMonthDay: "{>day} {>anotherMonthDate} font-normal",
|
|
30
|
+
firstDayInRange: "{>day} {>edgeDateInRange} {>firstDateInRange}",
|
|
31
|
+
anotherMonthFirstDayInRange: "{>day} {>anotherMonthDay} {>edgeDateInRange} {>firstDateInRange}",
|
|
32
|
+
lastDayInRange: "{>day} {>edgeDateInRange} {>lastDateInRange}",
|
|
33
|
+
currentLastDayInRange: "{>day} {>edgeDateInRange} {>lastDateInRange} {>currentDate}",
|
|
34
34
|
currentFirstDayInRange: "",
|
|
35
|
-
anotherMonthLastDayInRange: "",
|
|
36
|
-
selectedDay: "",
|
|
37
|
-
activeDay: "",
|
|
35
|
+
anotherMonthLastDayInRange: "{>day} {>anotherMonthDay} {>edgeDateInRange} {>lastDateInRange}",
|
|
36
|
+
selectedDay: "{>day} {>selectedDate}",
|
|
37
|
+
activeDay: "{>day} {>activeDate}",
|
|
38
38
|
monthView: "grid grid-cols-4 justify-items-center gap-1",
|
|
39
39
|
month: "{UButton} mx-auto flex h-12 w-full",
|
|
40
|
-
currentMonth: "",
|
|
41
|
-
currentMonthInRange: "",
|
|
42
|
-
currentLastMonthInRange: "",
|
|
43
|
-
currentFirstMonthInRange: "",
|
|
44
|
-
lastMonthInRange: "",
|
|
45
|
-
firstMonthInRange: "",
|
|
46
|
-
singleMonthInRange: "rounded-dynamic",
|
|
47
|
-
singleCurrentMonthInRange: "rounded-dynamic",
|
|
48
|
-
monthInRange: "",
|
|
49
|
-
selectedMonth: "",
|
|
50
|
-
activeMonth: "",
|
|
40
|
+
currentMonth: "{>month} {>currentDate}",
|
|
41
|
+
currentMonthInRange: "{>month} {>currentDate} {>dateInRange}",
|
|
42
|
+
currentLastMonthInRange: "{>month} {>edgeDateInRange} {>lastDateInRange} {>currentDate}",
|
|
43
|
+
currentFirstMonthInRange: "{>month} {>edgeDateInRange} {>firstDateInRange} {>currentDate}",
|
|
44
|
+
lastMonthInRange: "{>month} {>edgeDateInRange} {>lastDateInRange}",
|
|
45
|
+
firstMonthInRange: "{>month} {>edgeDateInRange} {>firstDateInRange}",
|
|
46
|
+
singleMonthInRange: "{>month} {>dateInRange} rounded-dynamic",
|
|
47
|
+
singleCurrentMonthInRange: "{>month} {>dateInRange} {>currentDate} rounded-dynamic",
|
|
48
|
+
monthInRange: "{>month} {>dateInRange}",
|
|
49
|
+
selectedMonth: "{>month} {>selectedDate}",
|
|
50
|
+
activeMonth: "{>month} {>activeDate}",
|
|
51
51
|
yearView: "grid grid-cols-4 justify-items-center gap-1",
|
|
52
52
|
year: "{UButton} mx-auto flex h-12 w-full",
|
|
53
|
-
currentYear: "",
|
|
54
|
-
currentYearInRange: "",
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
selectedYear: "",
|
|
63
|
-
activeYear: "",
|
|
53
|
+
currentYear: "{>year} {>currentDate}",
|
|
54
|
+
currentYearInRange: "{>year} {>currentDate} {>dateInRange}",
|
|
55
|
+
currentLastYearInRange: "{>year} {>edgeDateInRange} {>lastDateInRange} {>currentDate}",
|
|
56
|
+
currentFirstYearInRange: "{>year} {>edgeDateInRange} {>firstDateInRange} {>currentDate}",
|
|
57
|
+
lastYearInRange: "{>year} {>edgeDateInRange} {>lastDateInRange}",
|
|
58
|
+
firstYearInRange: "{>year} {>edgeDateInRange} {>firstDateInRange}",
|
|
59
|
+
yearInRange: "{>year} {>dateInRange}",
|
|
60
|
+
singleYearInRange: "{>year} {>dateInRange} rounded-dynamic",
|
|
61
|
+
singleCurrentYearInRange: "{>year} {>dateInRange} {>currentDate} rounded-dynamic",
|
|
62
|
+
selectedYear: "{>year} {>selectedDate}",
|
|
63
|
+
activeYear: "{>year} {>activeDate}",
|
|
64
64
|
timepicker: "mt-2 pl-1 pt-3 text-sm flex items-stretch justify-between gap-2 border-t border-gray-200",
|
|
65
65
|
timepickerLabel: "w-full self-center",
|
|
66
66
|
timepickerInputWrapper: "flex items-center rounded-dynamic border border-brand-300",
|
|
67
67
|
timepickerInput: "w-10 border-none px-1.5 py-1.5 text-center text-sm focus:ring-0 focus:placeholder:text-gray-900",
|
|
68
|
-
timepickerInputHours: "rounded-l-dynamic",
|
|
69
|
-
timepickerInputMinutes: "",
|
|
70
|
-
timepickerInputSeconds: "rounded-r-dynamic",
|
|
68
|
+
timepickerInputHours: "{>timepickerInput} rounded-l-dynamic",
|
|
69
|
+
timepickerInputMinutes: "{>timepickerInput}",
|
|
70
|
+
timepickerInputSeconds: "{>timepickerInput} rounded-r-dynamic",
|
|
71
71
|
timepickerSubmitButton: "{UButton} py-2 border-0",
|
|
72
72
|
i18n: {
|
|
73
73
|
weekdays: {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { computed } from "vue";
|
|
2
1
|
import useUI from "../composables/useUI.ts";
|
|
3
2
|
|
|
4
3
|
import defaultConfig from "./config.js";
|
|
@@ -7,268 +6,7 @@ import type { UseAttrs } from "../types.ts";
|
|
|
7
6
|
import type { UCalendarProps, Config } from "./types.ts";
|
|
8
7
|
|
|
9
8
|
export default function useAttrs(props: UCalendarProps<unknown>): UseAttrs<Config> {
|
|
10
|
-
const { config, getKeysAttrs
|
|
11
|
-
defaultConfig,
|
|
12
|
-
() => props.config,
|
|
13
|
-
);
|
|
9
|
+
const { config, getKeysAttrs } = useUI<Config>(defaultConfig, () => props.config);
|
|
14
10
|
|
|
15
|
-
|
|
16
|
-
"firstDateInRange",
|
|
17
|
-
"lastDateInRange",
|
|
18
|
-
"anotherMonthDate",
|
|
19
|
-
"activeDate",
|
|
20
|
-
"selectedDate",
|
|
21
|
-
"currentDate",
|
|
22
|
-
"edgeDateInRange",
|
|
23
|
-
"dateInRange",
|
|
24
|
-
"timepickerInput",
|
|
25
|
-
];
|
|
26
|
-
|
|
27
|
-
const extendingKeysClasses = getExtendingKeysClasses([...extendingKeys, "day", "month", "year"]);
|
|
28
|
-
|
|
29
|
-
const keysAttrs = getKeysAttrs({}, extendingKeys, {
|
|
30
|
-
timepickerInputHours: {
|
|
31
|
-
base: computed(() => [extendingKeysClasses.timepickerInput.value]),
|
|
32
|
-
},
|
|
33
|
-
timepickerInputMinutes: {
|
|
34
|
-
base: computed(() => [extendingKeysClasses.timepickerInput.value]),
|
|
35
|
-
},
|
|
36
|
-
timepickerInputSeconds: {
|
|
37
|
-
base: computed(() => [extendingKeysClasses.timepickerInput.value]),
|
|
38
|
-
},
|
|
39
|
-
dayInRange: {
|
|
40
|
-
base: computed(() => [
|
|
41
|
-
extendingKeysClasses.day.value,
|
|
42
|
-
extendingKeysClasses.dateInRange.value,
|
|
43
|
-
]),
|
|
44
|
-
},
|
|
45
|
-
selectedDay: {
|
|
46
|
-
base: computed(() => [
|
|
47
|
-
extendingKeysClasses.day.value,
|
|
48
|
-
extendingKeysClasses.selectedDate.value,
|
|
49
|
-
]),
|
|
50
|
-
},
|
|
51
|
-
activeDay: {
|
|
52
|
-
base: computed(() => [extendingKeysClasses.day.value, extendingKeysClasses.activeDate.value]),
|
|
53
|
-
},
|
|
54
|
-
anotherMonthDay: {
|
|
55
|
-
base: computed(() => [
|
|
56
|
-
extendingKeysClasses.day.value,
|
|
57
|
-
extendingKeysClasses.anotherMonthDate.value,
|
|
58
|
-
]),
|
|
59
|
-
},
|
|
60
|
-
currentDay: {
|
|
61
|
-
base: computed(() => [
|
|
62
|
-
extendingKeysClasses.day.value,
|
|
63
|
-
extendingKeysClasses.currentDate.value,
|
|
64
|
-
]),
|
|
65
|
-
},
|
|
66
|
-
currentDayInRange: {
|
|
67
|
-
base: computed(() => [
|
|
68
|
-
extendingKeysClasses.day.value,
|
|
69
|
-
extendingKeysClasses.dateInRange.value,
|
|
70
|
-
extendingKeysClasses.currentDate.value,
|
|
71
|
-
]),
|
|
72
|
-
},
|
|
73
|
-
currentFirstDayInRange: {
|
|
74
|
-
base: computed(() => [
|
|
75
|
-
extendingKeysClasses.day.value,
|
|
76
|
-
extendingKeysClasses.edgeDateInRange.value,
|
|
77
|
-
extendingKeysClasses.firstDateInRange.value,
|
|
78
|
-
extendingKeysClasses.currentDate.value,
|
|
79
|
-
]),
|
|
80
|
-
},
|
|
81
|
-
currentLastDayInRange: {
|
|
82
|
-
base: computed(() => [
|
|
83
|
-
extendingKeysClasses.day.value,
|
|
84
|
-
extendingKeysClasses.edgeDateInRange.value,
|
|
85
|
-
extendingKeysClasses.lastDateInRange.value,
|
|
86
|
-
extendingKeysClasses.currentDate.value,
|
|
87
|
-
]),
|
|
88
|
-
},
|
|
89
|
-
firstDayInRange: {
|
|
90
|
-
base: computed(() => [
|
|
91
|
-
extendingKeysClasses.day.value,
|
|
92
|
-
extendingKeysClasses.edgeDateInRange.value,
|
|
93
|
-
extendingKeysClasses.firstDateInRange.value,
|
|
94
|
-
]),
|
|
95
|
-
},
|
|
96
|
-
lastDayInRange: {
|
|
97
|
-
base: computed(() => [
|
|
98
|
-
extendingKeysClasses.day.value,
|
|
99
|
-
extendingKeysClasses.edgeDateInRange.value,
|
|
100
|
-
extendingKeysClasses.lastDateInRange.value,
|
|
101
|
-
]),
|
|
102
|
-
},
|
|
103
|
-
anotherMonthLastDayInRange: {
|
|
104
|
-
base: computed(() => [
|
|
105
|
-
extendingKeysClasses.day.value,
|
|
106
|
-
extendingKeysClasses.anotherMonthDay.value,
|
|
107
|
-
extendingKeysClasses.edgeDateInRange.value,
|
|
108
|
-
extendingKeysClasses.lastDateInRange.value,
|
|
109
|
-
]),
|
|
110
|
-
},
|
|
111
|
-
anotherMonthFirstDayInRange: {
|
|
112
|
-
base: computed(() => [
|
|
113
|
-
extendingKeysClasses.day.value,
|
|
114
|
-
extendingKeysClasses.anotherMonthDay.value,
|
|
115
|
-
extendingKeysClasses.edgeDateInRange.value,
|
|
116
|
-
extendingKeysClasses.firstDateInRange.value,
|
|
117
|
-
]),
|
|
118
|
-
},
|
|
119
|
-
currentMonth: {
|
|
120
|
-
base: computed(() => [
|
|
121
|
-
extendingKeysClasses.month.value,
|
|
122
|
-
extendingKeysClasses.currentDate.value,
|
|
123
|
-
]),
|
|
124
|
-
},
|
|
125
|
-
monthInRange: {
|
|
126
|
-
base: computed(() => [
|
|
127
|
-
extendingKeysClasses.month.value,
|
|
128
|
-
extendingKeysClasses.dateInRange.value,
|
|
129
|
-
]),
|
|
130
|
-
},
|
|
131
|
-
singleMonthInRange: {
|
|
132
|
-
base: computed(() => [
|
|
133
|
-
extendingKeysClasses.month.value,
|
|
134
|
-
extendingKeysClasses.dateInRange.value,
|
|
135
|
-
]),
|
|
136
|
-
},
|
|
137
|
-
singleCurrentMonthInRange: {
|
|
138
|
-
base: computed(() => [
|
|
139
|
-
extendingKeysClasses.year.value,
|
|
140
|
-
extendingKeysClasses.dateInRange.value,
|
|
141
|
-
extendingKeysClasses.currentDate.value,
|
|
142
|
-
]),
|
|
143
|
-
},
|
|
144
|
-
currentFirstYearInRange: {
|
|
145
|
-
base: computed(() => [
|
|
146
|
-
extendingKeysClasses.year.value,
|
|
147
|
-
extendingKeysClasses.edgeDateInRange.value,
|
|
148
|
-
extendingKeysClasses.firstDateInRange.value,
|
|
149
|
-
extendingKeysClasses.currentDate.value,
|
|
150
|
-
]),
|
|
151
|
-
},
|
|
152
|
-
currentLastYearInRange: {
|
|
153
|
-
base: computed(() => [
|
|
154
|
-
extendingKeysClasses.year.value,
|
|
155
|
-
extendingKeysClasses.edgeDateInRange.value,
|
|
156
|
-
extendingKeysClasses.lastDateInRange.value,
|
|
157
|
-
extendingKeysClasses.currentDate.value,
|
|
158
|
-
]),
|
|
159
|
-
},
|
|
160
|
-
currentMonthInRange: {
|
|
161
|
-
base: computed(() => [
|
|
162
|
-
extendingKeysClasses.month.value,
|
|
163
|
-
extendingKeysClasses.currentDate.value,
|
|
164
|
-
extendingKeysClasses.dateInRange.value,
|
|
165
|
-
]),
|
|
166
|
-
},
|
|
167
|
-
lastMonthInRange: {
|
|
168
|
-
base: computed(() => [
|
|
169
|
-
extendingKeysClasses.month.value,
|
|
170
|
-
extendingKeysClasses.edgeDateInRange.value,
|
|
171
|
-
extendingKeysClasses.lastDateInRange.value,
|
|
172
|
-
]),
|
|
173
|
-
},
|
|
174
|
-
currentFirstMonthInRange: {
|
|
175
|
-
base: computed(() => [
|
|
176
|
-
extendingKeysClasses.month.value,
|
|
177
|
-
extendingKeysClasses.edgeDateInRange.value,
|
|
178
|
-
extendingKeysClasses.firstDateInRange.value,
|
|
179
|
-
extendingKeysClasses.currentDate.value,
|
|
180
|
-
]),
|
|
181
|
-
},
|
|
182
|
-
currentLastMonthInRange: {
|
|
183
|
-
base: computed(() => [
|
|
184
|
-
extendingKeysClasses.month.value,
|
|
185
|
-
extendingKeysClasses.edgeDateInRange.value,
|
|
186
|
-
extendingKeysClasses.lastDateInRange.value,
|
|
187
|
-
extendingKeysClasses.currentDate.value,
|
|
188
|
-
]),
|
|
189
|
-
},
|
|
190
|
-
firstMonthInRange: {
|
|
191
|
-
base: computed(() => [
|
|
192
|
-
extendingKeysClasses.month.value,
|
|
193
|
-
extendingKeysClasses.edgeDateInRange.value,
|
|
194
|
-
extendingKeysClasses.firstDateInRange.value,
|
|
195
|
-
]),
|
|
196
|
-
},
|
|
197
|
-
selectedMonth: {
|
|
198
|
-
base: computed(() => [
|
|
199
|
-
extendingKeysClasses.month.value,
|
|
200
|
-
extendingKeysClasses.selectedDate.value,
|
|
201
|
-
]),
|
|
202
|
-
},
|
|
203
|
-
activeMonth: {
|
|
204
|
-
base: computed(() => [
|
|
205
|
-
extendingKeysClasses.month.value,
|
|
206
|
-
extendingKeysClasses.activeDate.value,
|
|
207
|
-
]),
|
|
208
|
-
},
|
|
209
|
-
currentYear: {
|
|
210
|
-
base: computed(() => [
|
|
211
|
-
extendingKeysClasses.year.value,
|
|
212
|
-
extendingKeysClasses.currentDate.value,
|
|
213
|
-
]),
|
|
214
|
-
},
|
|
215
|
-
yearInRange: {
|
|
216
|
-
base: computed(() => [
|
|
217
|
-
extendingKeysClasses.year.value,
|
|
218
|
-
extendingKeysClasses.dateInRange.value,
|
|
219
|
-
]),
|
|
220
|
-
},
|
|
221
|
-
singleCurrentYearInRange: {
|
|
222
|
-
base: computed(() => [
|
|
223
|
-
extendingKeysClasses.year.value,
|
|
224
|
-
extendingKeysClasses.dateInRange.value,
|
|
225
|
-
extendingKeysClasses.currentDate.value,
|
|
226
|
-
]),
|
|
227
|
-
},
|
|
228
|
-
singleYearInRange: {
|
|
229
|
-
base: computed(() => [
|
|
230
|
-
extendingKeysClasses.year.value,
|
|
231
|
-
extendingKeysClasses.dateInRange.value,
|
|
232
|
-
]),
|
|
233
|
-
},
|
|
234
|
-
currentYearInRange: {
|
|
235
|
-
base: computed(() => [
|
|
236
|
-
extendingKeysClasses.year.value,
|
|
237
|
-
extendingKeysClasses.currentDate.value,
|
|
238
|
-
extendingKeysClasses.dateInRange.value,
|
|
239
|
-
]),
|
|
240
|
-
},
|
|
241
|
-
lastYearInRange: {
|
|
242
|
-
base: computed(() => [
|
|
243
|
-
extendingKeysClasses.year.value,
|
|
244
|
-
extendingKeysClasses.edgeDateInRange.value,
|
|
245
|
-
extendingKeysClasses.lastDateInRange.value,
|
|
246
|
-
]),
|
|
247
|
-
},
|
|
248
|
-
firstYearInRange: {
|
|
249
|
-
base: computed(() => [
|
|
250
|
-
extendingKeysClasses.year.value,
|
|
251
|
-
extendingKeysClasses.edgeDateInRange.value,
|
|
252
|
-
extendingKeysClasses.firstDateInRange.value,
|
|
253
|
-
]),
|
|
254
|
-
},
|
|
255
|
-
selectedYear: {
|
|
256
|
-
base: computed(() => [
|
|
257
|
-
extendingKeysClasses.year.value,
|
|
258
|
-
extendingKeysClasses.selectedDate.value,
|
|
259
|
-
]),
|
|
260
|
-
},
|
|
261
|
-
activeYear: {
|
|
262
|
-
base: computed(() => [
|
|
263
|
-
extendingKeysClasses.year.value,
|
|
264
|
-
extendingKeysClasses.activeDate.value,
|
|
265
|
-
]),
|
|
266
|
-
},
|
|
267
|
-
});
|
|
268
|
-
|
|
269
|
-
return {
|
|
270
|
-
config,
|
|
271
|
-
...keysAttrs,
|
|
272
|
-
hasSlotContent,
|
|
273
|
-
};
|
|
11
|
+
return { config, ...getKeysAttrs() };
|
|
274
12
|
}
|
|
@@ -16,7 +16,7 @@ export default function useAttrs(
|
|
|
16
16
|
props: UCheckboxProps,
|
|
17
17
|
{ checkboxColor, checkboxSize }: ComponentState,
|
|
18
18
|
): UseAttrs<Config> {
|
|
19
|
-
const { config, getKeysAttrs
|
|
19
|
+
const { config, getKeysAttrs } = useUI<Config>(defaultConfig, () => props.config);
|
|
20
20
|
|
|
21
21
|
const mutatedProps = computed(() => ({
|
|
22
22
|
color: checkboxColor.value,
|
|
@@ -25,11 +25,5 @@ export default function useAttrs(
|
|
|
25
25
|
error: Boolean(props.error),
|
|
26
26
|
}));
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return {
|
|
31
|
-
config,
|
|
32
|
-
...keysAttrs,
|
|
33
|
-
hasSlotContent,
|
|
34
|
-
};
|
|
28
|
+
return { config, ...getKeysAttrs(mutatedProps) };
|
|
35
29
|
}
|
|
@@ -6,13 +6,7 @@ import type { UseAttrs } from "../types.ts";
|
|
|
6
6
|
import type { UCheckboxGroupProps, Config } from "./types.ts";
|
|
7
7
|
|
|
8
8
|
export default function useAttrs(props: UCheckboxGroupProps): UseAttrs<Config> {
|
|
9
|
-
const { config, getKeysAttrs
|
|
9
|
+
const { config, getKeysAttrs } = useUI<Config>(defaultConfig, () => props.config);
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return {
|
|
14
|
-
config,
|
|
15
|
-
...keysAttrs,
|
|
16
|
-
hasSlotContent,
|
|
17
|
-
};
|
|
11
|
+
return { config, ...getKeysAttrs() };
|
|
18
12
|
}
|
|
@@ -15,7 +15,7 @@ export default function useAttrs(
|
|
|
15
15
|
props: UCheckboxMultiStateProps,
|
|
16
16
|
{ selected }: ComponentState,
|
|
17
17
|
): UseAttrs<Config> {
|
|
18
|
-
const { config, getKeysAttrs
|
|
18
|
+
const { config, getKeysAttrs } = useUI<Config>(defaultConfig, () => props.config);
|
|
19
19
|
const keysAttrs = getKeysAttrs();
|
|
20
20
|
|
|
21
21
|
const checkboxAttrs = keysAttrs.multiStateCheckboxAttrs as Ref<{
|
|
@@ -33,9 +33,5 @@ export default function useAttrs(
|
|
|
33
33
|
return checkboxAttrs.value;
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
-
return {
|
|
37
|
-
config,
|
|
38
|
-
...keysAttrs,
|
|
39
|
-
hasSlotContent,
|
|
40
|
-
};
|
|
36
|
+
return { config, ...keysAttrs };
|
|
41
37
|
}
|
|
@@ -3,13 +3,7 @@ import useUI from "../composables/useUI.ts";
|
|
|
3
3
|
import defaultConfig from "./config.js";
|
|
4
4
|
|
|
5
5
|
export default function useAttrs(props) {
|
|
6
|
-
const { config, getKeysAttrs
|
|
6
|
+
const { config, getKeysAttrs } = useUI(defaultConfig, () => props.config);
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
config,
|
|
12
|
-
...keysAttrs,
|
|
13
|
-
hasSlotContent,
|
|
14
|
-
};
|
|
8
|
+
return { config, ...getKeysAttrs() };
|
|
15
9
|
}
|
|
@@ -18,7 +18,7 @@ export default function useAttrs(
|
|
|
18
18
|
props: UDatePickerProps<unknown>,
|
|
19
19
|
{ isTop, isRight }: ComponentState,
|
|
20
20
|
): UseAttrs<Config> {
|
|
21
|
-
const { config, getKeysAttrs
|
|
21
|
+
const { config, getKeysAttrs } = useUI(defaultConfig, () => props.config);
|
|
22
22
|
|
|
23
23
|
const mutatedProps = computed(() => ({
|
|
24
24
|
openDirectionY: isTop.value ? Direction.Top : Direction.Bottom,
|
|
@@ -39,9 +39,5 @@ export default function useAttrs(
|
|
|
39
39
|
}
|
|
40
40
|
});
|
|
41
41
|
|
|
42
|
-
return {
|
|
43
|
-
config,
|
|
44
|
-
...keysAttrs,
|
|
45
|
-
hasSlotContent,
|
|
46
|
-
};
|
|
42
|
+
return { config, ...keysAttrs };
|
|
47
43
|
}
|
|
@@ -130,34 +130,6 @@ const isPeriod = computed(() => {
|
|
|
130
130
|
|
|
131
131
|
const elementId = props.id || useId();
|
|
132
132
|
|
|
133
|
-
const {
|
|
134
|
-
config,
|
|
135
|
-
wrapperAttrs,
|
|
136
|
-
calendarAttrs,
|
|
137
|
-
datepickerInputAttrs,
|
|
138
|
-
menuAttrs,
|
|
139
|
-
buttonWrapperAttrs,
|
|
140
|
-
buttonAttrs,
|
|
141
|
-
shiftRangeButtonAttrs,
|
|
142
|
-
rangeInputWrapperAttrs,
|
|
143
|
-
rangeInputErrorAttrs,
|
|
144
|
-
datepickerActiveInputAttrs,
|
|
145
|
-
rangeInputFirstAttrs,
|
|
146
|
-
rangeInputLastAttrs,
|
|
147
|
-
periodRowAttrs,
|
|
148
|
-
periodButtonAttrs,
|
|
149
|
-
periodButtonActiveAttrs,
|
|
150
|
-
periodDateAttrs,
|
|
151
|
-
periodDateCurrentAttrs,
|
|
152
|
-
periodDateSelectedAttrs,
|
|
153
|
-
periodDateCurrentSelectedAttrs,
|
|
154
|
-
periodDateListAttrs,
|
|
155
|
-
rangeSwitchButtonAttrs,
|
|
156
|
-
rangeSwitchTitleAttrs,
|
|
157
|
-
rangeSwitchWrapperAttrs,
|
|
158
|
-
customRangeDescriptionAttrs,
|
|
159
|
-
} = useAttrs(props, { isShownMenu, isTop, isRight, isPeriod });
|
|
160
|
-
|
|
161
133
|
const calendarValue = ref(props.modelValue);
|
|
162
134
|
const activeDate: Ref<string | Date | null> = ref(
|
|
163
135
|
props.modelValue.from !== null
|
|
@@ -249,6 +221,34 @@ const clickOutsideOptions = computed(() => {
|
|
|
249
221
|
};
|
|
250
222
|
});
|
|
251
223
|
|
|
224
|
+
const {
|
|
225
|
+
config,
|
|
226
|
+
wrapperAttrs,
|
|
227
|
+
calendarAttrs,
|
|
228
|
+
datepickerInputAttrs,
|
|
229
|
+
menuAttrs,
|
|
230
|
+
buttonWrapperAttrs,
|
|
231
|
+
buttonAttrs,
|
|
232
|
+
shiftRangeButtonAttrs,
|
|
233
|
+
rangeInputWrapperAttrs,
|
|
234
|
+
rangeInputErrorAttrs,
|
|
235
|
+
datepickerActiveInputAttrs,
|
|
236
|
+
rangeInputFirstAttrs,
|
|
237
|
+
rangeInputLastAttrs,
|
|
238
|
+
periodRowAttrs,
|
|
239
|
+
periodButtonAttrs,
|
|
240
|
+
periodButtonActiveAttrs,
|
|
241
|
+
periodDateAttrs,
|
|
242
|
+
periodDateCurrentAttrs,
|
|
243
|
+
periodDateSelectedAttrs,
|
|
244
|
+
periodDateCurrentSelectedAttrs,
|
|
245
|
+
periodDateListAttrs,
|
|
246
|
+
rangeSwitchButtonAttrs,
|
|
247
|
+
rangeSwitchTitleAttrs,
|
|
248
|
+
rangeSwitchWrapperAttrs,
|
|
249
|
+
customRangeDescriptionAttrs,
|
|
250
|
+
} = useAttrs(props, { isShownMenu, isTop, isRight, isPeriod });
|
|
251
|
+
|
|
252
252
|
const { userFormatDate } = useUserFormat(
|
|
253
253
|
localValue,
|
|
254
254
|
userFormatLocale,
|