vueless 0.0.553 → 0.0.555
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 +36 -5
- package/constants.js +2 -1
- package/package.json +1 -1
- package/ui.form-calendar/UCalendar.vue +0 -1
- package/ui.form-calendar/config.ts +47 -47
- package/ui.form-calendar/useAttrs.ts +2 -258
- package/utils/node/tailwindSafelist.js +2 -2
- package/utils/ui.ts +3 -2
- package/web-types.json +1 -1
package/composables/useUI.ts
CHANGED
|
@@ -17,7 +17,8 @@ import {
|
|
|
17
17
|
STRATEGY_TYPE,
|
|
18
18
|
CVA_CONFIG_KEY,
|
|
19
19
|
SYSTEM_CONFIG_KEY,
|
|
20
|
-
|
|
20
|
+
NESTED_COMPONENT_PATTERN_REG_EXP,
|
|
21
|
+
EXTENDS_PATTERN_REG_EXP,
|
|
21
22
|
} from "../constants.js";
|
|
22
23
|
|
|
23
24
|
import type { ComponentInternalInstance, Slot, VNode, ComputedRef } from "vue";
|
|
@@ -127,14 +128,16 @@ export default function useUI<T>(
|
|
|
127
128
|
extendingKeys: string[] = [],
|
|
128
129
|
keysToExtendConfig: Record<string, KeysToExtend> = {},
|
|
129
130
|
) {
|
|
130
|
-
const keysToExtend = Object.keys(keysToExtendConfig);
|
|
131
131
|
const keysAttrs: UnknownObject = {};
|
|
132
132
|
|
|
133
|
-
|
|
133
|
+
// TODO: should be removed after migration of all components to the new api.
|
|
134
|
+
for (const key in config.value) {
|
|
134
135
|
if (isSystemKey(key) || extendingKeys.includes(key)) continue;
|
|
135
136
|
|
|
136
137
|
keysAttrs[`${key}Attrs`] = getAttrs(key, getClasses(key, mutatedProps));
|
|
137
138
|
|
|
139
|
+
const keysToExtend = Object.keys(keysToExtendConfig);
|
|
140
|
+
|
|
138
141
|
if (keysToExtend.includes(key)) {
|
|
139
142
|
const { base, extend } = keysToExtendConfig[key];
|
|
140
143
|
const keyAttrs = keysAttrs[`${key}Attrs`] as ComputedRef<KeyAttrs>;
|
|
@@ -150,6 +153,33 @@ export default function useUI<T>(
|
|
|
150
153
|
}
|
|
151
154
|
}
|
|
152
155
|
|
|
156
|
+
for (const key in config.value) {
|
|
157
|
+
if (isSystemKey(key)) continue;
|
|
158
|
+
|
|
159
|
+
const baseClasses = getBaseClasses(config.value[key]);
|
|
160
|
+
const extendsMatches = baseClasses.match(EXTENDS_PATTERN_REG_EXP);
|
|
161
|
+
|
|
162
|
+
if (extendsMatches) {
|
|
163
|
+
keysAttrs[`${key}Attrs`] = getAttrs(key, getClasses(key, mutatedProps));
|
|
164
|
+
|
|
165
|
+
// retrieves extends keys from patterns:
|
|
166
|
+
// Example: `{>someKey} {>someOtherKey}` >>> `["someKey", "someOtherKey"]`.
|
|
167
|
+
const extendsKeys = extendsMatches.map((pattern) => pattern.slice(2, -1));
|
|
168
|
+
const classes = getExtendingKeysClasses(extendsKeys, mutatedProps);
|
|
169
|
+
const extendsClasses = Object.values(classes).map((item) => toValue(item));
|
|
170
|
+
|
|
171
|
+
const keyAttrs = keysAttrs[`${key}Attrs`] as ComputedRef<KeyAttrs>;
|
|
172
|
+
|
|
173
|
+
keysAttrs[`${key}Attrs`] = computed(() => ({
|
|
174
|
+
...keyAttrs.value,
|
|
175
|
+
class: cx([
|
|
176
|
+
...extendsClasses,
|
|
177
|
+
keyAttrs.value.class?.replaceAll(EXTENDS_PATTERN_REG_EXP, ""),
|
|
178
|
+
]),
|
|
179
|
+
}));
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
153
183
|
return keysAttrs;
|
|
154
184
|
}
|
|
155
185
|
|
|
@@ -157,7 +187,7 @@ export default function useUI<T>(
|
|
|
157
187
|
* Get an element attributes for a given key.
|
|
158
188
|
*/
|
|
159
189
|
function getAttrs(configKey: string, classes: ComputedRef) {
|
|
160
|
-
const nestedComponent = getNestedComponent(
|
|
190
|
+
const nestedComponent = getNestedComponent(config.value[configKey] || "");
|
|
161
191
|
|
|
162
192
|
const attrs = useAttrs();
|
|
163
193
|
const isDev = isCSR && import.meta.env?.DEV;
|
|
@@ -221,7 +251,8 @@ function getNestedComponent(value: string | NestedComponent | CVA) {
|
|
|
221
251
|
const component = (value as NestedComponent)?.component as ComponentNames;
|
|
222
252
|
|
|
223
253
|
const match =
|
|
224
|
-
classes.match(
|
|
254
|
+
classes.match(NESTED_COMPONENT_PATTERN_REG_EXP) ||
|
|
255
|
+
component?.match(NESTED_COMPONENT_PATTERN_REG_EXP);
|
|
225
256
|
|
|
226
257
|
return match ? match[1] : "";
|
|
227
258
|
}
|
package/constants.js
CHANGED
|
@@ -200,7 +200,8 @@ export const VUELESS_ICONS_CACHED_DIR = `${VUELESS_CACHE_DIR}/${ICONS_DIR}`;
|
|
|
200
200
|
|
|
201
201
|
/* Other */
|
|
202
202
|
export const PX_IN_REM = 16;
|
|
203
|
-
export const
|
|
203
|
+
export const NESTED_COMPONENT_PATTERN_REG_EXP = /\{U[^}]*}/g;
|
|
204
|
+
export const EXTENDS_PATTERN_REG_EXP = /\{>[^}]*}/g;
|
|
204
205
|
export const DYNAMIC_COLOR_PATTERN = "{color}";
|
|
205
206
|
export const TAILWIND_COLOR_OPACITY_DELIMITER = "/";
|
|
206
207
|
export const TAILWIND_VARIANT_DELIMITER = ":";
|
package/package.json
CHANGED
|
@@ -1,73 +1,73 @@
|
|
|
1
1
|
export default /*tw*/ {
|
|
2
|
-
wrapper: "p-
|
|
2
|
+
wrapper: "p-3 w-[19rem] border border-gray-300 rounded-dynamic bg-white shadow overflow-hidden focus:outline-none",
|
|
3
3
|
navigation: "mb-2 pb-2 border-b flex items-center justify-between",
|
|
4
4
|
viewSwitchButton: "{UButton}",
|
|
5
5
|
nextPrevButton: "{UButton}",
|
|
6
6
|
dayView: "",
|
|
7
7
|
weekDays: "grid grid-cols-7 justify-items-center gap-1",
|
|
8
|
-
weekDay: "flex size-8 items-center justify-center text-xs
|
|
8
|
+
weekDay: "flex size-8 items-center justify-center text-xs capitalize text-gray-500 font-medium",
|
|
9
9
|
days: {
|
|
10
|
-
base: "grid grid-cols-7 justify-items-center gap-
|
|
10
|
+
base: "grid grid-cols-7 justify-items-center gap-0.5",
|
|
11
11
|
variants: {
|
|
12
12
|
range: {
|
|
13
13
|
true: "gap-0 gap-y-0.5",
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
|
-
dateInRange: "bg-brand/
|
|
17
|
+
dateInRange: "bg-brand/5 !text-brand-900 hover:bg-brand/15 rounded-none",
|
|
18
18
|
edgeDateInRange: "",
|
|
19
19
|
firstDateInRange: "rounded-r-none",
|
|
20
20
|
lastDateInRange: "rounded-l-none",
|
|
21
21
|
anotherMonthDate: "text-gray-400",
|
|
22
22
|
activeDate: "bg-brand-100",
|
|
23
|
-
selectedDate: "
|
|
24
|
-
currentDate: "border-2 border-brand-600
|
|
25
|
-
day: "{UButton} size-9 w-full
|
|
26
|
-
currentDay: "",
|
|
27
|
-
dayInRange: "",
|
|
28
|
-
currentDayInRange: "",
|
|
29
|
-
anotherMonthDay: "",
|
|
30
|
-
firstDayInRange: "
|
|
31
|
-
anotherMonthFirstDayInRange: "",
|
|
32
|
-
lastDayInRange: "
|
|
33
|
-
currentLastDayInRange: "",
|
|
23
|
+
selectedDate: "",
|
|
24
|
+
currentDate: "border-2 border-brand-600",
|
|
25
|
+
day: "{UButton} size-9 w-full",
|
|
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: "",
|
|
64
|
-
timepicker: "mt-2 pl-1 pt-3 text-sm flex items-
|
|
65
|
-
timepickerLabel: "w-full",
|
|
66
|
-
timepickerInputWrapper: "flex items-center
|
|
67
|
-
timepickerInput: "w-
|
|
68
|
-
timepickerInputHours: "rounded-l-dynamic",
|
|
69
|
-
timepickerInputMinutes: "",
|
|
70
|
-
timepickerInputSeconds: "rounded-r-dynamic",
|
|
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
|
+
timepicker: "mt-2 pl-1 pt-3 text-sm flex items-stretch justify-between gap-2 border-t border-gray-200",
|
|
65
|
+
timepickerLabel: "w-full self-center",
|
|
66
|
+
timepickerInputWrapper: "flex items-center rounded-dynamic border border-brand-300",
|
|
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: "{>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,264 +6,9 @@ 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, hasSlotContent
|
|
11
|
-
defaultConfig,
|
|
12
|
-
() => props.config,
|
|
13
|
-
);
|
|
9
|
+
const { config, getKeysAttrs, hasSlotContent } = useUI<Config>(defaultConfig, () => props.config);
|
|
14
10
|
|
|
15
|
-
const
|
|
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
|
-
});
|
|
11
|
+
const keysAttrs = getKeysAttrs();
|
|
268
12
|
|
|
269
13
|
return {
|
|
270
14
|
config,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
DYNAMIC_COLOR_PATTERN,
|
|
18
18
|
TAILWIND_VARIANT_DELIMITER,
|
|
19
19
|
TAILWIND_MERGE_EXTENSION,
|
|
20
|
-
|
|
20
|
+
NESTED_COMPONENT_PATTERN_REG_EXP,
|
|
21
21
|
TAILWIND_COLOR_OPACITY_DELIMITER,
|
|
22
22
|
TAILWIND_VARIANT_DELIMITER_REG_EXP,
|
|
23
23
|
STRATEGY_TYPE,
|
|
@@ -28,7 +28,7 @@ const twMerge = extendTailwindMerge(merge(TAILWIND_MERGE_EXTENSION, vuelessConfi
|
|
|
28
28
|
|
|
29
29
|
export const { cx } = defineConfig({
|
|
30
30
|
hooks: {
|
|
31
|
-
onComplete: (classNames) => twMerge(classNames).replace(
|
|
31
|
+
onComplete: (classNames) => twMerge(classNames).replace(NESTED_COMPONENT_PATTERN_REG_EXP, ""),
|
|
32
32
|
},
|
|
33
33
|
});
|
|
34
34
|
|
package/utils/ui.ts
CHANGED
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
BRAND_COLOR,
|
|
8
8
|
GRAYSCALE_COLOR,
|
|
9
9
|
DEFAULT_BRAND_COLOR,
|
|
10
|
-
NESTED_COMPONENT_REG_EXP,
|
|
11
10
|
TAILWIND_MERGE_EXTENSION,
|
|
11
|
+
NESTED_COMPONENT_PATTERN_REG_EXP,
|
|
12
12
|
} from "../constants.js";
|
|
13
13
|
|
|
14
14
|
import type {
|
|
@@ -79,7 +79,8 @@ export const {
|
|
|
79
79
|
cva: classVarianceAuthority,
|
|
80
80
|
} = defineConfig({
|
|
81
81
|
hooks: {
|
|
82
|
-
onComplete: (classNames) =>
|
|
82
|
+
onComplete: (classNames) =>
|
|
83
|
+
twMerge(classNames).replaceAll(NESTED_COMPONENT_PATTERN_REG_EXP, ""),
|
|
83
84
|
},
|
|
84
85
|
});
|
|
85
86
|
|