vueless 0.0.579 → 0.0.581
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 +48 -59
- package/constants.js +3 -0
- package/package.json +1 -1
- package/types.ts +39 -48
- package/ui.button/UButton.vue +2 -3
- package/ui.button/types.ts +2 -2
- package/ui.button-link/ULink.vue +23 -24
- package/ui.button-link/storybook/stories.ts +2 -2
- package/ui.button-link/types.ts +7 -6
- package/ui.button-toggle/UToggle.vue +15 -16
- package/ui.button-toggle/storybook/stories.ts +2 -2
- package/ui.button-toggle/types.ts +6 -4
- package/ui.button-toggle-item/UToggleItem.vue +29 -20
- package/ui.button-toggle-item/storybook/stories.ts +2 -2
- package/ui.button-toggle-item/types.ts +5 -4
- package/ui.container-accordion/UAccordion.vue +22 -17
- package/ui.container-accordion/storybook/stories.ts +2 -2
- package/ui.container-accordion/types.ts +5 -4
- package/ui.container-card/UCard.vue +12 -5
- package/ui.container-card/storybook/stories.ts +2 -2
- package/ui.container-card/types.ts +4 -3
- package/ui.container-col/UCol.vue +11 -12
- package/ui.container-col/storybook/stories.ts +2 -2
- package/ui.container-col/types.ts +5 -3
- package/ui.container-divider/UDivider.vue +13 -13
- package/ui.container-divider/storybook/stories.ts +2 -2
- package/ui.container-divider/types.ts +5 -3
- package/ui.container-group/UGroup.vue +10 -8
- package/ui.container-group/storybook/stories.ts +2 -2
- package/ui.container-group/types.ts +5 -3
- package/ui.container-groups/UGroups.vue +10 -7
- package/ui.container-groups/storybook/stories.ts +2 -2
- package/ui.container-groups/types.ts +5 -3
- package/ui.container-modal/UModal.vue +43 -43
- package/ui.container-modal/storybook/stories.ts +2 -3
- package/ui.container-modal/types.ts +5 -3
- package/ui.container-modal-confirm/UModalConfirm.vue +14 -17
- package/ui.container-modal-confirm/storybook/stories.ts +8 -6
- package/ui.container-modal-confirm/types.ts +5 -3
- package/ui.container-page/UPage.vue +32 -31
- package/ui.container-page/storybook/stories.ts +2 -2
- package/ui.container-page/types.ts +4 -3
- package/ui.container-row/URow.vue +10 -13
- package/ui.container-row/storybook/stories.ts +2 -2
- package/ui.container-row/types.ts +5 -3
- package/ui.data-list/UDataList.vue +40 -51
- package/ui.data-list/storybook/stories.ts +2 -2
- package/ui.data-list/types.ts +4 -4
- package/ui.data-table/UTable.vue +61 -60
- package/ui.data-table/types.ts +4 -3
- package/ui.dropdown-badge/UDropdownBadge.vue +21 -25
- package/ui.dropdown-badge/storybook/stories.ts +3 -3
- package/ui.dropdown-badge/types.ts +4 -3
- package/ui.dropdown-button/UDropdownButton.vue +20 -23
- package/ui.dropdown-button/storybook/stories.ts +3 -3
- package/ui.dropdown-button/types.ts +4 -3
- package/ui.dropdown-link/UDropdownLink.vue +20 -23
- package/ui.dropdown-link/storybook/stories.ts +3 -3
- package/ui.dropdown-link/types.ts +4 -3
- package/ui.dropdown-list/UDropdownList.vue +28 -32
- package/ui.dropdown-list/storybook/stories.ts +4 -4
- package/ui.dropdown-list/types.ts +4 -4
- package/ui.form-calendar/UCalendar.vue +36 -34
- package/ui.form-calendar/UCalendarDayView.vue +28 -23
- package/ui.form-calendar/UCalendarMonthView.vue +24 -19
- package/ui.form-calendar/UCalendarYearView.vue +24 -19
- package/ui.form-calendar/config.ts +2 -2
- package/ui.form-calendar/storybook/stories.ts +2 -2
- package/ui.form-calendar/types.ts +8 -7
- package/ui.form-checkbox/UCheckbox.vue +23 -21
- package/ui.form-checkbox/storybook/stories.ts +2 -2
- package/ui.form-checkbox/types.ts +7 -5
- package/ui.form-checkbox-group/UCheckboxGroup.vue +17 -14
- package/ui.form-checkbox-group/storybook/stories.ts +2 -2
- package/ui.form-checkbox-group/types.ts +6 -6
- package/ui.form-checkbox-multi-state/UCheckboxMultiState.vue +33 -14
- package/ui.form-checkbox-multi-state/storybook/stories.ts +2 -2
- package/ui.form-checkbox-multi-state/types.ts +4 -4
- package/ui.form-color-picker/UColorPicker.vue +23 -21
- package/ui.form-color-picker/storybook/stories.ts +2 -2
- package/ui.form-color-picker/types.ts +5 -5
- package/ui.form-date-picker/UDatePicker.vue +42 -27
- package/ui.form-date-picker/config.ts +5 -5
- package/ui.form-date-picker/types.ts +5 -2
- package/ui.form-date-picker-range/UDatePickerRange.vue +80 -53
- package/ui.form-date-picker-range/types.ts +7 -4
- package/ui.form-input/UInput.vue +32 -28
- package/ui.form-input/storybook/stories.ts +2 -2
- package/ui.form-input/types.ts +5 -3
- package/ui.form-input-file/UInputFile.vue +37 -32
- package/ui.form-input-file/storybook/stories.ts +2 -2
- package/ui.form-input-file/types.ts +6 -4
- package/ui.form-input-money/UInputMoney.vue +13 -18
- package/ui.form-input-money/storybook/stories.ts +2 -2
- package/ui.form-input-money/types.ts +5 -3
- package/ui.form-input-number/UInputNumber.vue +23 -24
- package/ui.form-input-number/types.ts +4 -2
- package/ui.form-input-rating/UInputRating.vue +24 -19
- package/ui.form-input-rating/storybook/stories.ts +2 -2
- package/ui.form-input-rating/types.ts +5 -3
- package/ui.form-input-search/UInputSearch.vue +22 -20
- package/ui.form-input-search/storybook/stories.ts +2 -2
- package/ui.form-input-search/types.ts +5 -3
- package/ui.form-label/ULabel.vue +19 -11
- package/ui.form-label/config.ts +0 -1
- package/ui.form-label/storybook/stories.ts +2 -2
- package/ui.form-label/types.ts +10 -8
- package/ui.form-radio/URadio.vue +22 -12
- package/ui.form-radio/storybook/stories.ts +2 -2
- package/ui.form-radio/types.ts +5 -5
- package/ui.form-radio-group/URadioGroup.vue +16 -12
- package/ui.form-radio-group/storybook/stories.ts +2 -2
- package/ui.form-radio-group/types.ts +7 -7
- package/ui.form-select/USelect.vue +53 -39
- package/ui.form-switch/USwitch.vue +30 -23
- package/ui.form-switch/storybook/stories.ts +2 -2
- package/ui.form-switch/types.ts +5 -3
- package/ui.form-textarea/UTextarea.vue +19 -15
- package/ui.form-textarea/storybook/stories.ts +2 -2
- package/ui.form-textarea/types.ts +5 -3
- package/ui.image-avatar/UAvatar.vue +12 -11
- package/ui.image-avatar/types.ts +4 -2
- package/ui.image-icon/UIcon.vue +31 -18
- package/ui.image-icon/storybook/stories.ts +2 -2
- package/ui.image-icon/types.ts +12 -5
- package/ui.loader/ULoader.vue +11 -9
- package/ui.loader/storybook/stories.ts +2 -2
- package/ui.loader/types.ts +10 -3
- package/ui.loader-overlay/ULoaderOverlay.vue +11 -7
- package/ui.loader-overlay/storybook/stories.ts +2 -2
- package/ui.loader-overlay/types.ts +4 -3
- package/ui.loader-progress/ULoaderProgress.vue +14 -10
- package/ui.loader-progress/storybook/stories.ts +2 -2
- package/ui.loader-progress/types.ts +4 -3
- package/ui.navigation-pagination/UPagination.vue +34 -33
- package/ui.navigation-pagination/storybook/stories.ts +2 -2
- package/ui.navigation-pagination/types.ts +4 -3
- package/ui.navigation-progress/StepperProgress.vue +25 -12
- package/ui.navigation-progress/UProgress.vue +12 -12
- package/ui.navigation-progress/types.ts +4 -3
- package/ui.navigation-tab/UTab.vue +18 -9
- package/ui.navigation-tab/storybook/stories.ts +2 -2
- package/ui.navigation-tab/types.ts +4 -3
- package/ui.navigation-tabs/UTabs.vue +13 -8
- package/ui.navigation-tabs/storybook/stories.ts +2 -2
- package/ui.navigation-tabs/types.ts +5 -5
- package/ui.other-dot/UDot.vue +10 -8
- package/ui.other-dot/storybook/stories.ts +2 -2
- package/ui.other-dot/types.ts +4 -3
- package/ui.text-alert/UAlert.vue +24 -27
- package/ui.text-alert/storybook/stories.ts +2 -2
- package/ui.text-alert/types.ts +4 -3
- package/ui.text-badge/UBadge.vue +25 -13
- package/ui.text-badge/storybook/stories.ts +2 -2
- package/ui.text-badge/types.ts +4 -3
- package/ui.text-block/UText.vue +10 -9
- package/ui.text-block/storybook/stories.ts +2 -2
- package/ui.text-block/types.ts +4 -3
- package/ui.text-empty/UEmpty.vue +22 -19
- package/ui.text-empty/storybook/stories.ts +2 -2
- package/ui.text-empty/types.ts +4 -3
- package/ui.text-file/UFile.vue +23 -20
- package/ui.text-file/storybook/stories.ts +2 -2
- package/ui.text-file/types.ts +4 -3
- package/ui.text-files/UFiles.vue +16 -10
- package/ui.text-files/storybook/stories.ts +2 -2
- package/ui.text-files/types.ts +4 -3
- package/ui.text-header/UHeader.vue +11 -11
- package/ui.text-header/storybook/stories.ts +2 -2
- package/ui.text-header/types.ts +4 -3
- package/ui.text-money/UMoney.vue +20 -27
- package/ui.text-money/storybook/stories.ts +2 -2
- package/ui.text-money/types.ts +4 -3
- package/ui.text-notify/UNotify.vue +58 -41
- package/ui.text-notify/config.ts +3 -3
- package/ui.text-notify/constants.ts +18 -20
- package/ui.text-notify/storybook/stories.ts +2 -2
- package/ui.text-notify/types.ts +10 -5
- package/ui.text-notify/utilNotify.ts +17 -11
- package/utils/helper.ts +5 -5
- package/utils/storybook.ts +11 -1
- package/utils/ui.ts +19 -9
- package/web-types.json +521 -368
- package/ui.button-link/useAttrs.ts +0 -20
- package/ui.button-toggle/useAttrs.ts +0 -12
- package/ui.button-toggle-item/useAttrs.ts +0 -29
- package/ui.container-accordion/useAttrs.ts +0 -26
- package/ui.container-card/useAttrs.ts +0 -12
- package/ui.container-col/useAttrs.ts +0 -12
- package/ui.container-divider/useAttrs.ts +0 -17
- package/ui.container-group/useAttrs.ts +0 -12
- package/ui.container-groups/useAttrs.ts +0 -12
- package/ui.container-modal/useAttrs.ts +0 -12
- package/ui.container-modal-confirm/useAttrs.ts +0 -12
- package/ui.container-page/useAttrs.ts +0 -12
- package/ui.container-row/useAttrs.ts +0 -12
- package/ui.data-list/useAttrs.ts +0 -12
- package/ui.data-table/useAttrs.ts +0 -31
- package/ui.dropdown-badge/useAttrs.ts +0 -26
- package/ui.dropdown-button/useAttrs.ts +0 -26
- package/ui.dropdown-link/useAttrs.ts +0 -26
- package/ui.dropdown-list/useAttrs.ts +0 -12
- package/ui.form-calendar/useAttrs.ts +0 -12
- package/ui.form-checkbox/useAttrs.ts +0 -29
- package/ui.form-checkbox-group/useAttrs.ts +0 -12
- package/ui.form-checkbox-multi-state/useAttrs.ts +0 -37
- package/ui.form-color-picker/useAttrs.ts +0 -15
- package/ui.form-date-picker/useAttrs.ts +0 -43
- package/ui.form-date-picker-range/useAttrs.ts +0 -53
- package/ui.form-input/useAttrs.ts +0 -31
- package/ui.form-input-file/useAttrs.ts +0 -21
- package/ui.form-input-money/useAttrs.ts +0 -15
- package/ui.form-input-number/useAttrs.ts +0 -15
- package/ui.form-input-rating/useAttrs.ts +0 -14
- package/ui.form-input-search/useAttrs.ts +0 -15
- package/ui.form-label/useAttrs.ts +0 -20
- package/ui.form-radio/useAttrs.ts +0 -29
- package/ui.form-radio-group/useAttrs.ts +0 -12
- package/ui.form-select/useAttrs.js +0 -19
- package/ui.form-switch/useAttrs.ts +0 -28
- package/ui.form-textarea/useAttrs.ts +0 -21
- package/ui.image-avatar/useAttrs.ts +0 -12
- package/ui.image-icon/useAttrs.ts +0 -12
- package/ui.loader/useAttrs.ts +0 -12
- package/ui.loader-overlay/useAttrs.ts +0 -12
- package/ui.loader-progress/useAttrs.ts +0 -12
- package/ui.navigation-pagination/useAttrs.ts +0 -12
- package/ui.navigation-progress/useAttrs.ts +0 -17
- package/ui.navigation-tab/useAttrs.ts +0 -28
- package/ui.navigation-tabs/useAttrs.ts +0 -12
- package/ui.other-dot/useAttrs.ts +0 -12
- package/ui.text-alert/useAttrs.ts +0 -12
- package/ui.text-badge/useAttrs.ts +0 -21
- package/ui.text-block/useAttrs.ts +0 -12
- package/ui.text-empty/useAttrs.ts +0 -12
- package/ui.text-file/useAttrs.ts +0 -12
- package/ui.text-files/useAttrs.ts +0 -12
- package/ui.text-header/useAttrs.ts +0 -12
- package/ui.text-money/useAttrs.ts +0 -12
- package/ui.text-notify/useAttrs.ts +0 -12
package/composables/useUI.ts
CHANGED
|
@@ -10,19 +10,19 @@ import {
|
|
|
10
10
|
EXTENDS_PATTERN_REG_EXP,
|
|
11
11
|
} from "../constants.js";
|
|
12
12
|
|
|
13
|
-
import type { ComponentInternalInstance, ComputedRef } from "vue";
|
|
13
|
+
import type { ComponentInternalInstance, Ref, ComputedRef } from "vue";
|
|
14
14
|
import type {
|
|
15
|
-
BrandColors,
|
|
16
|
-
Strategies,
|
|
17
|
-
UnknownObject,
|
|
18
|
-
Component,
|
|
19
|
-
NestedComponent,
|
|
20
|
-
ComponentNames,
|
|
21
15
|
CVA,
|
|
22
16
|
UseUI,
|
|
23
17
|
KeyAttrs,
|
|
24
18
|
KeysAttrs,
|
|
25
|
-
|
|
19
|
+
Strategies,
|
|
20
|
+
BrandColors,
|
|
21
|
+
MutatedProps,
|
|
22
|
+
UnknownObject,
|
|
23
|
+
ComponentNames,
|
|
24
|
+
ComponentConfig,
|
|
25
|
+
KeyAttrsWithConfig,
|
|
26
26
|
} from "../types.ts";
|
|
27
27
|
|
|
28
28
|
/**
|
|
@@ -33,45 +33,41 @@ import type {
|
|
|
33
33
|
* 4. Component classes (class="...")
|
|
34
34
|
*/
|
|
35
35
|
export default function useUI<T>(
|
|
36
|
-
defaultConfig: T
|
|
37
|
-
|
|
36
|
+
defaultConfig: T,
|
|
37
|
+
mutatedProps?: MutatedProps,
|
|
38
38
|
topLevelClassKey?: string,
|
|
39
|
-
|
|
40
|
-
): UseUI<T> {
|
|
39
|
+
) {
|
|
41
40
|
const { type, props } = getCurrentInstance() as ComponentInternalInstance;
|
|
41
|
+
|
|
42
42
|
const componentName = type.__name as ComponentNames;
|
|
43
43
|
const globalConfig = vuelessConfig?.component?.[componentName] || {};
|
|
44
44
|
|
|
45
|
-
const
|
|
46
|
-
vuelessConfig.strategy && Object.values(STRATEGY_TYPE).includes(vuelessConfig.strategy);
|
|
47
|
-
|
|
48
|
-
const vuelessStrategy = isStrategyValid
|
|
45
|
+
const vuelessStrategy = Object.values(STRATEGY_TYPE).includes(vuelessConfig.strategy || "")
|
|
49
46
|
? (vuelessConfig.strategy as Strategies)
|
|
50
47
|
: (STRATEGY_TYPE.merge as Strategies);
|
|
51
48
|
|
|
52
|
-
const firstClassKey =
|
|
53
|
-
const
|
|
49
|
+
const firstClassKey = Object.keys(defaultConfig || {})[0];
|
|
50
|
+
const propsConfig = props.config as ComponentConfig<T>;
|
|
51
|
+
const config = ref({}) as Ref<ComponentConfig<T>>;
|
|
54
52
|
const attrs = useAttrs();
|
|
55
53
|
|
|
56
54
|
watchEffect(() => {
|
|
57
|
-
const propsConfig = propsConfigGetter ? propsConfigGetter() : {};
|
|
58
|
-
|
|
59
55
|
config.value = getMergedConfig({
|
|
60
56
|
defaultConfig,
|
|
61
57
|
globalConfig,
|
|
62
58
|
propsConfig,
|
|
63
59
|
vuelessStrategy,
|
|
64
|
-
})
|
|
60
|
+
}) as ComponentConfig<T>;
|
|
65
61
|
});
|
|
66
62
|
|
|
67
63
|
/**
|
|
68
64
|
* Get classes by given key (including CVA if config set).
|
|
69
65
|
*/
|
|
70
|
-
function getClasses(key: string, mutatedProps
|
|
66
|
+
function getClasses(key: string, mutatedProps?: MutatedProps) {
|
|
71
67
|
return computed(() => {
|
|
72
68
|
const mutatedPropsValue = toValue(mutatedProps);
|
|
73
|
-
const color = (toValue(mutatedProps
|
|
74
|
-
const value = config.value
|
|
69
|
+
const color = (toValue(mutatedProps || {}).color || props.color) as BrandColors;
|
|
70
|
+
const value = (config.value as ComponentConfig<T>)[key];
|
|
75
71
|
|
|
76
72
|
let classes = "";
|
|
77
73
|
|
|
@@ -95,28 +91,13 @@ export default function useUI<T>(
|
|
|
95
91
|
});
|
|
96
92
|
}
|
|
97
93
|
|
|
98
|
-
/**
|
|
99
|
-
* Get an object where:
|
|
100
|
-
* – key: extendingKey
|
|
101
|
-
* – value: reactive string of extendingKey classes.
|
|
102
|
-
*/
|
|
103
|
-
function getExtendingKeysClasses(extendingKeys: string[], mutatedProps = {}) {
|
|
104
|
-
const extendingClasses: ExtendedKeyClasses = {};
|
|
105
|
-
|
|
106
|
-
for (const key of extendingKeys) {
|
|
107
|
-
extendingClasses[key] = getClasses(key, mutatedProps);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
return extendingClasses;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
94
|
/**
|
|
114
95
|
* Returns an object where:
|
|
115
96
|
* – key: elementKey
|
|
116
97
|
* – value: reactive object of string element attributes (with classes).
|
|
117
98
|
*/
|
|
118
|
-
function getKeysAttrs(mutatedProps
|
|
119
|
-
const keysAttrs: KeysAttrs = {};
|
|
99
|
+
function getKeysAttrs(mutatedProps?: MutatedProps) {
|
|
100
|
+
const keysAttrs: KeysAttrs<T> = {};
|
|
120
101
|
|
|
121
102
|
for (const key in config.value) {
|
|
122
103
|
if (isSystemKey(key)) continue;
|
|
@@ -127,10 +108,9 @@ export default function useUI<T>(
|
|
|
127
108
|
const extendsKeys = getExtendsKeys(baseClasses);
|
|
128
109
|
|
|
129
110
|
if (extendsKeys.length) {
|
|
130
|
-
const
|
|
131
|
-
const extendsClasses = Object.values(classes).map((item) => toValue(item));
|
|
111
|
+
const extendsClasses = extendsKeys.map((key) => toValue(getClasses(key, mutatedProps)));
|
|
132
112
|
|
|
133
|
-
const keyAttrs = keysAttrs[`${key}Attrs`]
|
|
113
|
+
const keyAttrs = keysAttrs[`${key}Attrs`];
|
|
134
114
|
|
|
135
115
|
keysAttrs[`${key}Attrs`] = computed(() => ({
|
|
136
116
|
...keyAttrs.value,
|
|
@@ -138,11 +118,13 @@ export default function useUI<T>(
|
|
|
138
118
|
...extendsClasses,
|
|
139
119
|
keyAttrs.value.class?.replaceAll(EXTENDS_PATTERN_REG_EXP, ""),
|
|
140
120
|
]),
|
|
121
|
+
// TODO: Cannot merge several keys
|
|
141
122
|
config: getMergedConfig({
|
|
142
123
|
defaultConfig: config.value[extendsKeys[0]],
|
|
143
|
-
globalConfig: keyAttrs.value.config
|
|
124
|
+
globalConfig: keyAttrs.value.config,
|
|
125
|
+
propsConfig: propsConfig[extendsKeys[0]],
|
|
144
126
|
}),
|
|
145
|
-
}))
|
|
127
|
+
})) as ComputedRef<KeyAttrsWithConfig<T>>;
|
|
146
128
|
}
|
|
147
129
|
}
|
|
148
130
|
|
|
@@ -152,24 +134,24 @@ export default function useUI<T>(
|
|
|
152
134
|
/**
|
|
153
135
|
* Get an element attributes for a given key.
|
|
154
136
|
*/
|
|
155
|
-
function getAttrs(configKey: string, classes: ComputedRef) {
|
|
137
|
+
function getAttrs(configKey: string, classes: ComputedRef<string>) {
|
|
156
138
|
const nestedComponent = getNestedComponent(config.value[configKey] || "");
|
|
157
139
|
|
|
158
|
-
const attrs = useAttrs();
|
|
140
|
+
const attrs = useAttrs() as KeyAttrs;
|
|
159
141
|
const isDev = isCSR && import.meta.env?.DEV;
|
|
160
142
|
const vuelessAttrs = ref({});
|
|
161
143
|
const isTopLevelKey = (topLevelClassKey || firstClassKey) === configKey;
|
|
162
144
|
|
|
163
145
|
const commonAttrs: KeyAttrs = {
|
|
164
146
|
...(isTopLevelKey ? attrs : {}),
|
|
165
|
-
"vl-component": isDev ?
|
|
166
|
-
"vl-key": isDev ?
|
|
147
|
+
"vl-component": isDev ? attrs["vl-component"] || componentName || null : null,
|
|
148
|
+
"vl-key": isDev ? attrs["vl-key"] || configKey || null : null,
|
|
167
149
|
"vl-child-component":
|
|
168
150
|
isDev && attrs["vl-component"] ? nestedComponent || componentName : null,
|
|
169
151
|
"vl-child-key": isDev && attrs["vl-component"] ? configKey : null,
|
|
170
152
|
};
|
|
171
153
|
|
|
172
|
-
|
|
154
|
+
/* Delete value key to prevent v-model overwrite. */
|
|
173
155
|
delete commonAttrs.value;
|
|
174
156
|
|
|
175
157
|
watch(config, updateVuelessAttrs, { immediate: true });
|
|
@@ -180,28 +162,35 @@ export default function useUI<T>(
|
|
|
180
162
|
}
|
|
181
163
|
|
|
182
164
|
function updateVuelessAttrs() {
|
|
183
|
-
const configKeyValue = config.value[configKey]
|
|
184
|
-
|
|
165
|
+
const configKeyValue = config.value[configKey];
|
|
166
|
+
|
|
167
|
+
let configAttr = {};
|
|
168
|
+
let defaultAttrs = {};
|
|
169
|
+
|
|
170
|
+
if (typeof configKeyValue === "object") {
|
|
171
|
+
configAttr = configKeyValue;
|
|
172
|
+
defaultAttrs = configKeyValue?.defaults;
|
|
173
|
+
}
|
|
185
174
|
|
|
186
175
|
vuelessAttrs.value = {
|
|
187
176
|
...commonAttrs,
|
|
188
177
|
class: toValue(classes),
|
|
189
|
-
|
|
190
|
-
...
|
|
178
|
+
config: configAttr,
|
|
179
|
+
...defaultAttrs,
|
|
191
180
|
};
|
|
192
181
|
}
|
|
193
182
|
|
|
194
183
|
return vuelessAttrs;
|
|
195
184
|
}
|
|
196
185
|
|
|
197
|
-
return { config, getKeysAttrs, ...getKeysAttrs(mutatedProps) }
|
|
186
|
+
return { config, getKeysAttrs, ...getKeysAttrs(mutatedProps) } as UseUI<T>;
|
|
198
187
|
}
|
|
199
188
|
|
|
200
189
|
/**
|
|
201
190
|
* Return base classes.
|
|
202
191
|
*/
|
|
203
|
-
function getBaseClasses(value: string | CVA
|
|
204
|
-
return typeof value === "object" ?
|
|
192
|
+
function getBaseClasses(value: string | CVA) {
|
|
193
|
+
return typeof value === "object" ? value.base || "" : value || "";
|
|
205
194
|
}
|
|
206
195
|
|
|
207
196
|
/**
|
|
@@ -217,7 +206,7 @@ function getExtendsKeys(values: string = ""): string[] {
|
|
|
217
206
|
/**
|
|
218
207
|
* Check is config key contains component name and returns it.
|
|
219
208
|
*/
|
|
220
|
-
function getNestedComponent(value: string |
|
|
209
|
+
function getNestedComponent(value: string | CVA) {
|
|
221
210
|
const classes = getBaseClasses(value);
|
|
222
211
|
const match = classes.match(NESTED_COMPONENT_PATTERN_REG_EXP);
|
|
223
212
|
|
package/constants.js
CHANGED
|
@@ -72,6 +72,9 @@ export const SYSTEM_CONFIG_KEY = {
|
|
|
72
72
|
...CVA_CONFIG_KEY,
|
|
73
73
|
};
|
|
74
74
|
|
|
75
|
+
/* Vueless system non-props defaults */
|
|
76
|
+
export const SYSTEM_NON_PROPS_DEFAULTS = ["library", "style", "weight"];
|
|
77
|
+
|
|
75
78
|
/* Component to folder mapping. */
|
|
76
79
|
export const COMPONENTS = {
|
|
77
80
|
/* Buttons & Links */
|
package/package.json
CHANGED
package/types.ts
CHANGED
|
@@ -55,7 +55,7 @@ import UInputFileConfig from "./ui.form-input-file/config.ts";
|
|
|
55
55
|
import UInputMoneyConfig from "./ui.form-input-money/config.ts";
|
|
56
56
|
import UDataListConfig from "./ui.data-list/config.ts";
|
|
57
57
|
|
|
58
|
-
import type { ComputedRef, MaybeRef, Ref
|
|
58
|
+
import type { ComputedRef, MaybeRef, Ref } from "vue";
|
|
59
59
|
import type { Props } from "tippy.js";
|
|
60
60
|
import type { LocaleOptions } from "./adatper.locale/vueless.ts";
|
|
61
61
|
|
|
@@ -67,10 +67,6 @@ export enum ColorMode {
|
|
|
67
67
|
Auto = "auto",
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
export interface ExtendedKeyClasses {
|
|
71
|
-
[key: string]: Ref<string>;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
70
|
export interface ThemeConfig {
|
|
75
71
|
/**
|
|
76
72
|
* Components brand (primary) color.
|
|
@@ -141,10 +137,12 @@ export interface Config extends ThemeConfig {
|
|
|
141
137
|
}
|
|
142
138
|
|
|
143
139
|
export type UnknownObject = Record<string, unknown>;
|
|
144
|
-
export type UnknownArray =
|
|
140
|
+
export type UnknownArray = unknown[];
|
|
145
141
|
export type UnknownType = string | number | boolean | UnknownObject | undefined | null;
|
|
142
|
+
|
|
146
143
|
export type ComponentNames = keyof Components; // keys union
|
|
147
144
|
export type Strategies = "merge" | "replace" | "override";
|
|
145
|
+
|
|
148
146
|
export type Gray = "gray";
|
|
149
147
|
export type GrayColors = "slate" | "cool" | "zinc" | "neutral" | "stone";
|
|
150
148
|
export type BrandColors =
|
|
@@ -167,6 +165,10 @@ export type BrandColors =
|
|
|
167
165
|
| "pink"
|
|
168
166
|
| "rose";
|
|
169
167
|
|
|
168
|
+
export interface Directives {
|
|
169
|
+
tooltip?: Partial<Props>;
|
|
170
|
+
}
|
|
171
|
+
|
|
170
172
|
export interface Components {
|
|
171
173
|
UText?: Partial<typeof UTextDefaultConfig>;
|
|
172
174
|
UAlert?: Partial<typeof UAlertDefaultConfig>;
|
|
@@ -226,49 +228,30 @@ export interface Components {
|
|
|
226
228
|
UDataList?: Partial<typeof UDataListConfig>;
|
|
227
229
|
}
|
|
228
230
|
|
|
229
|
-
export
|
|
230
|
-
tooltip?: Partial<Props>;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
export interface Component {
|
|
231
|
+
export type Component = {
|
|
234
232
|
i18n?: UnknownObject;
|
|
235
233
|
defaults?: Defaults;
|
|
236
234
|
safelist?: (string: string) => TailwindSafelist[];
|
|
237
235
|
strategy?: Strategies;
|
|
238
236
|
transition?: Transition;
|
|
239
|
-
safelistColors?: BrandColors;
|
|
240
|
-
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
export type Defaults = {
|
|
244
|
-
color?: string;
|
|
245
|
-
[key: string]: unknown;
|
|
246
|
-
};
|
|
247
|
-
|
|
248
|
-
export interface NestedComponent {
|
|
249
|
-
component: string;
|
|
250
|
-
[key: string]: Record<string, string | object> | string;
|
|
251
|
-
}
|
|
237
|
+
safelistColors?: BrandColors[];
|
|
238
|
+
} & (CVA & NestedComponent);
|
|
252
239
|
|
|
253
240
|
/* Make all config keys optional and allow to have string and object values. */
|
|
254
241
|
export type ComponentConfig<T> = Partial<{
|
|
255
|
-
[K in keyof T]: T[K] | string;
|
|
242
|
+
[K in keyof T]: T[K] | string | UnknownObject;
|
|
256
243
|
}> &
|
|
257
244
|
Component;
|
|
258
245
|
|
|
259
|
-
export
|
|
260
|
-
|
|
261
|
-
: Ref<UnwrapRef<T & Component>, T & Component>;
|
|
262
|
-
|
|
263
|
-
export interface UseUI<T> {
|
|
264
|
-
config: ComponentConfigRef<T>;
|
|
265
|
-
getKeysAttrs: (mutatedProps?: ComputedRef) => KeysAttrs;
|
|
266
|
-
[key: string]:
|
|
267
|
-
| ComputedRef<KeyAttrs>
|
|
268
|
-
| ComponentConfigRef<T>
|
|
269
|
-
| ((mutatedProps?: ComputedRef) => KeysAttrs);
|
|
246
|
+
export interface NestedComponent {
|
|
247
|
+
[key: string]: Record<string, string | UnknownObject> | string;
|
|
270
248
|
}
|
|
271
249
|
|
|
250
|
+
export type Defaults = {
|
|
251
|
+
color?: string;
|
|
252
|
+
[key: string]: unknown;
|
|
253
|
+
};
|
|
254
|
+
|
|
272
255
|
export interface Transition {
|
|
273
256
|
enterFromClass?: string;
|
|
274
257
|
enterActiveClass?: string;
|
|
@@ -290,26 +273,34 @@ export interface CVACompoundVariants {
|
|
|
290
273
|
[key: string]: string | number | undefined | null;
|
|
291
274
|
}
|
|
292
275
|
|
|
293
|
-
export
|
|
294
|
-
id?: string;
|
|
295
|
-
class?: string;
|
|
296
|
-
value?: string;
|
|
297
|
-
}
|
|
276
|
+
export type MutatedProps = ComputedRef<UnknownObject>;
|
|
298
277
|
|
|
299
|
-
export type
|
|
278
|
+
export type UseUI<T> = {
|
|
279
|
+
config: Ref<T & ComponentConfig<T>>;
|
|
280
|
+
getKeysAttrs: (mutatedProps?: MutatedProps) => KeysAttrs<T>;
|
|
281
|
+
} & KeysAttrs<T>;
|
|
300
282
|
|
|
301
|
-
export
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
283
|
+
export type KeysAttrs<T> = Record<
|
|
284
|
+
string,
|
|
285
|
+
Ref<KeyAttrsWithConfig<T>> | ComputedRef<KeyAttrsWithConfig<T>>
|
|
286
|
+
>;
|
|
287
|
+
|
|
288
|
+
export type KeyAttrsWithConfig<T> = {
|
|
289
|
+
config?: ComponentConfig<T>;
|
|
290
|
+
} & KeyAttrs;
|
|
305
291
|
|
|
306
292
|
export interface KeyAttrs extends VueAttrs {
|
|
307
293
|
"vl-component"?: string | null;
|
|
308
294
|
"vl-key"?: string | null;
|
|
309
295
|
"vl-child-component"?: string | null;
|
|
310
296
|
"vl-child-key"?: string | null;
|
|
311
|
-
|
|
312
|
-
|
|
297
|
+
[key: string]: string | undefined | null;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export interface VueAttrs {
|
|
301
|
+
id?: string;
|
|
302
|
+
class?: string;
|
|
303
|
+
value?: string;
|
|
313
304
|
}
|
|
314
305
|
|
|
315
306
|
export interface CreateVuelessOptions {
|
package/ui.button/UButton.vue
CHANGED
|
@@ -17,7 +17,8 @@ import type { Props, LoaderSize, IconSize, Config } from "./types.ts";
|
|
|
17
17
|
defineOptions({ inheritAttrs: false });
|
|
18
18
|
|
|
19
19
|
const props = withDefaults(defineProps<Props>(), {
|
|
20
|
-
...getDefaults<Props>(defaultConfig, UButton),
|
|
20
|
+
...getDefaults<Props, Config>(defaultConfig, UButton),
|
|
21
|
+
label: "",
|
|
21
22
|
});
|
|
22
23
|
|
|
23
24
|
const slots = useSlots();
|
|
@@ -102,8 +103,6 @@ const mutatedProps = computed(() => ({
|
|
|
102
103
|
|
|
103
104
|
const { buttonAttrs, loaderAttrs, leftIconAttrs, rightIconAttrs, centerIconAttrs } = useUI<Config>(
|
|
104
105
|
defaultConfig,
|
|
105
|
-
() => props.config,
|
|
106
|
-
"",
|
|
107
106
|
mutatedProps,
|
|
108
107
|
);
|
|
109
108
|
</script>
|
package/ui.button/types.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import defaultConfig from "./config.ts";
|
|
2
2
|
import type { ComponentConfig } from "../types.ts";
|
|
3
3
|
|
|
4
|
-
export type Config =
|
|
4
|
+
export type Config = typeof defaultConfig;
|
|
5
5
|
|
|
6
6
|
export type LoaderSize = "sm" | "md" | "lg";
|
|
7
7
|
export type IconSize = "2xs" | "xs" | "sm" | "md";
|
|
@@ -116,7 +116,7 @@ export interface Props {
|
|
|
116
116
|
/**
|
|
117
117
|
* Component config object.
|
|
118
118
|
*/
|
|
119
|
-
config?: Config
|
|
119
|
+
config?: ComponentConfig<Config>;
|
|
120
120
|
|
|
121
121
|
/**
|
|
122
122
|
* Data-test attribute for automated testing.
|
package/ui.button-link/ULink.vue
CHANGED
|
@@ -1,34 +1,22 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed, ref } from "vue";
|
|
2
|
+
import { computed, ref, useSlots } from "vue";
|
|
3
3
|
import { RouterLink, useLink } from "vue-router";
|
|
4
|
-
import { getDefault } from "../utils/ui.ts";
|
|
5
4
|
|
|
6
|
-
import
|
|
5
|
+
import useUI from "../composables/useUI.ts";
|
|
6
|
+
import { hasSlotContent } from "../utils/helper.ts";
|
|
7
|
+
import { getDefaults } from "../utils/ui.ts";
|
|
8
|
+
|
|
7
9
|
import defaultConfig from "./config.ts";
|
|
8
10
|
import { ULink } from "./constants.ts";
|
|
9
11
|
|
|
10
|
-
import type {
|
|
12
|
+
import type { Props, Config } from "./types.ts";
|
|
11
13
|
|
|
12
14
|
defineOptions({ inheritAttrs: false });
|
|
13
15
|
|
|
14
|
-
const props = withDefaults(defineProps<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
targetBlank: getDefault<ULinkProps>(defaultConfig, ULink).targetBlank,
|
|
19
|
-
ariaCurrentValue: getDefault<ULinkProps>(defaultConfig, ULink).ariaCurrentValue,
|
|
20
|
-
custom: getDefault<ULinkProps>(defaultConfig, ULink).custom,
|
|
21
|
-
replace: getDefault<ULinkProps>(defaultConfig, ULink).replace,
|
|
22
|
-
activeClass: getDefault<ULinkProps>(defaultConfig, ULink).activeClass,
|
|
23
|
-
exactActiveClass: getDefault<ULinkProps>(defaultConfig, ULink).exactActiveClass,
|
|
24
|
-
wrapperActiveClass: getDefault<ULinkProps>(defaultConfig, ULink).wrapperActiveClass,
|
|
25
|
-
wrapperExactActiveClass: getDefault<ULinkProps>(defaultConfig, ULink).wrapperExactActiveClass,
|
|
26
|
-
underlined: getDefault<ULinkProps>(defaultConfig, ULink).underlined,
|
|
27
|
-
dashed: getDefault<ULinkProps>(defaultConfig, ULink).dashed,
|
|
28
|
-
disabled: getDefault<ULinkProps>(defaultConfig, ULink).disabled,
|
|
29
|
-
block: getDefault<ULinkProps>(defaultConfig, ULink).block,
|
|
30
|
-
noRing: getDefault<ULinkProps>(defaultConfig, ULink).noRing,
|
|
31
|
-
dataTest: "",
|
|
16
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
17
|
+
...getDefaults<Props, Config>(defaultConfig, ULink),
|
|
18
|
+
label: "",
|
|
19
|
+
to: undefined,
|
|
32
20
|
});
|
|
33
21
|
|
|
34
22
|
const emit = defineEmits([
|
|
@@ -58,6 +46,8 @@ const emit = defineEmits([
|
|
|
58
46
|
"keydown",
|
|
59
47
|
]);
|
|
60
48
|
|
|
49
|
+
const slots = useSlots();
|
|
50
|
+
|
|
61
51
|
const isPresentRoute = computed(() => {
|
|
62
52
|
return typeof props.to === "string" || typeof props.to === "object";
|
|
63
53
|
});
|
|
@@ -83,8 +73,6 @@ const { route, isActive, isExactActive } = useLink(useLinkOptions);
|
|
|
83
73
|
|
|
84
74
|
const wrapperRef = ref(null);
|
|
85
75
|
|
|
86
|
-
const { wrapperAttrs, linkAttrs } = useAttrs(props);
|
|
87
|
-
|
|
88
76
|
const wrapperActiveClasses = computed(() => [
|
|
89
77
|
isActive.value && props.wrapperActiveClass,
|
|
90
78
|
isExactActive.value && props.wrapperExactActiveClass,
|
|
@@ -136,6 +124,17 @@ defineExpose({
|
|
|
136
124
|
*/
|
|
137
125
|
wrapperRef,
|
|
138
126
|
});
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Get element / nested component attributes for each config token ✨
|
|
130
|
+
* Applies: `class`, `config`, redefined default `props` and dev `vl-...` attributes.
|
|
131
|
+
*/
|
|
132
|
+
const mutatedProps = computed(() => ({
|
|
133
|
+
/* component state, not a props */
|
|
134
|
+
defaultSlot: hasSlotContent(slots["default"]),
|
|
135
|
+
}));
|
|
136
|
+
|
|
137
|
+
const { wrapperAttrs, linkAttrs } = useUI<Config>(defaultConfig, mutatedProps);
|
|
139
138
|
</script>
|
|
140
139
|
|
|
141
140
|
<template>
|
|
@@ -11,9 +11,9 @@ import UButton from "../../ui.button/UButton.vue";
|
|
|
11
11
|
import URow from "../../ui.container-row/URow.vue";
|
|
12
12
|
|
|
13
13
|
import type { Meta, StoryFn } from "@storybook/vue3";
|
|
14
|
-
import type {
|
|
14
|
+
import type { Props } from "../types.ts";
|
|
15
15
|
|
|
16
|
-
interface ULinkArgs extends
|
|
16
|
+
interface ULinkArgs extends Props {
|
|
17
17
|
slotTemplate?: string;
|
|
18
18
|
enum: "size" | "color";
|
|
19
19
|
}
|
package/ui.button-link/types.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import defaultConfig from "./config.ts";
|
|
2
|
+
import type { ComponentConfig } from "../types.ts";
|
|
2
3
|
|
|
3
4
|
import type { RouteLocationRaw } from "vue-router";
|
|
4
5
|
|
|
5
|
-
export type Config =
|
|
6
|
+
export type Config = typeof defaultConfig;
|
|
6
7
|
|
|
7
|
-
export interface
|
|
8
|
+
export interface Props {
|
|
8
9
|
/**
|
|
9
10
|
* Button label.
|
|
10
11
|
*/
|
|
@@ -52,7 +53,7 @@ export interface ULinkProps {
|
|
|
52
53
|
| "brand";
|
|
53
54
|
|
|
54
55
|
/**
|
|
55
|
-
* Link open type
|
|
56
|
+
* Link open type behavior.
|
|
56
57
|
*/
|
|
57
58
|
type?: "phone" | "email" | "link";
|
|
58
59
|
|
|
@@ -67,12 +68,12 @@ export interface ULinkProps {
|
|
|
67
68
|
ariaCurrentValue?: string;
|
|
68
69
|
|
|
69
70
|
/**
|
|
70
|
-
* Whether RouterLink should not wrap its content in
|
|
71
|
+
* Whether RouterLink should not wrap its content in a tag.
|
|
71
72
|
*/
|
|
72
73
|
custom?: boolean;
|
|
73
74
|
|
|
74
75
|
/**
|
|
75
|
-
* Whether RouterLink should not wrap its content in
|
|
76
|
+
* Whether RouterLink should not wrap its content in a tag.
|
|
76
77
|
*/
|
|
77
78
|
replace?: boolean;
|
|
78
79
|
|
|
@@ -124,7 +125,7 @@ export interface ULinkProps {
|
|
|
124
125
|
/**
|
|
125
126
|
* Component config object.
|
|
126
127
|
*/
|
|
127
|
-
config?: Config
|
|
128
|
+
config?: ComponentConfig<Config>;
|
|
128
129
|
|
|
129
130
|
/**
|
|
130
131
|
* Data-test attribute for automated testing.
|
|
@@ -3,27 +3,22 @@ import { computed, provide, readonly } from "vue";
|
|
|
3
3
|
|
|
4
4
|
import ULabel from "../ui.form-label/ULabel.vue";
|
|
5
5
|
import UToggleItem from "../ui.button-toggle-item/UToggleItem.vue";
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
import useUI from "../composables/useUI.ts";
|
|
8
|
+
import { getDefaults } from "../utils/ui.ts";
|
|
7
9
|
|
|
8
10
|
import defaultConfig from "./config.ts";
|
|
9
11
|
import { UToggle, TYPE_RADIO, TYPE_CHECKBOX } from "./constants.ts";
|
|
10
|
-
import useAttrs from "./useAttrs.ts";
|
|
11
12
|
|
|
12
|
-
import type {
|
|
13
|
+
import type { Props, LabelSize, Config } from "./types.ts";
|
|
13
14
|
|
|
14
15
|
defineOptions({ inheritAttrs: false });
|
|
15
16
|
|
|
16
|
-
const props = withDefaults(defineProps<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
separated: getDefault<UToggleProps>(defaultConfig, UToggle).separated,
|
|
22
|
-
disabled: getDefault<UToggleProps>(defaultConfig, UToggle).disabled,
|
|
23
|
-
block: getDefault<UToggleProps>(defaultConfig, UToggle).block,
|
|
24
|
-
round: getDefault<UToggleProps>(defaultConfig, UToggle).round,
|
|
25
|
-
square: getDefault<UToggleProps>(defaultConfig, UToggle).square,
|
|
26
|
-
dataTest: "",
|
|
17
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
18
|
+
...getDefaults<Props, Config>(defaultConfig, UToggle),
|
|
19
|
+
options: () => [],
|
|
20
|
+
modelValue: "",
|
|
21
|
+
label: "",
|
|
27
22
|
});
|
|
28
23
|
|
|
29
24
|
const emit = defineEmits([
|
|
@@ -34,8 +29,6 @@ const emit = defineEmits([
|
|
|
34
29
|
"update:modelValue",
|
|
35
30
|
]);
|
|
36
31
|
|
|
37
|
-
const { toggleLabelAttrs, itemsAttrs, itemAttrs } = useAttrs(props);
|
|
38
|
-
|
|
39
32
|
const selectedValue = computed({
|
|
40
33
|
get: () => props.modelValue,
|
|
41
34
|
set: (value) => emit("update:modelValue", value),
|
|
@@ -88,6 +81,12 @@ provide("toggleSelectedValue", {
|
|
|
88
81
|
selectedValue: readonly(selectedValue),
|
|
89
82
|
updateSelectedValue,
|
|
90
83
|
});
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Get element / nested component attributes for each config token ✨
|
|
87
|
+
* Applies: `class`, `config`, redefined default `props` and dev `vl-...` attributes.
|
|
88
|
+
*/
|
|
89
|
+
const { toggleLabelAttrs, itemsAttrs, itemAttrs } = useUI<Config>(defaultConfig);
|
|
91
90
|
</script>
|
|
92
91
|
|
|
93
92
|
<template>
|
|
@@ -12,9 +12,9 @@ import UToggleItem from "../../ui.button-toggle-item/UToggleItem.vue";
|
|
|
12
12
|
import URow from "../../ui.container-row/URow.vue";
|
|
13
13
|
|
|
14
14
|
import type { Meta, StoryFn } from "@storybook/vue3";
|
|
15
|
-
import type {
|
|
15
|
+
import type { Props } from "../types.ts";
|
|
16
16
|
|
|
17
|
-
interface UToggleArgs extends
|
|
17
|
+
interface UToggleArgs extends Props {
|
|
18
18
|
slotTemplate?: string;
|
|
19
19
|
enum: "variant" | "size";
|
|
20
20
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import defaultConfig from "./config.ts";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import type { ComponentConfig } from "../types.ts";
|
|
4
|
+
|
|
5
|
+
export type Config = typeof defaultConfig;
|
|
4
6
|
|
|
5
7
|
export type LabelSize = "sm" | "md" | "lg";
|
|
6
8
|
|
|
@@ -9,11 +11,11 @@ export interface UToggleOption {
|
|
|
9
11
|
label: string;
|
|
10
12
|
}
|
|
11
13
|
|
|
12
|
-
export interface
|
|
14
|
+
export interface Props {
|
|
13
15
|
/**
|
|
14
16
|
* Selected value.
|
|
15
17
|
*/
|
|
16
|
-
modelValue?: string | number |
|
|
18
|
+
modelValue?: string | number | (string | number)[];
|
|
17
19
|
|
|
18
20
|
/**
|
|
19
21
|
* Toggle item options.
|
|
@@ -83,7 +85,7 @@ export interface UToggleProps {
|
|
|
83
85
|
/**
|
|
84
86
|
* Component config object.
|
|
85
87
|
*/
|
|
86
|
-
config?: Config
|
|
88
|
+
config?: ComponentConfig<Config>;
|
|
87
89
|
|
|
88
90
|
/**
|
|
89
91
|
* Data-test attribute for automated testing.
|