vueless 0.0.579 → 0.0.580
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 +46 -60
- 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
|
@@ -3,7 +3,8 @@ import { computed } from "vue";
|
|
|
3
3
|
import draggable from "vuedraggable";
|
|
4
4
|
import { merge } from "lodash-es";
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import useUI from "../composables/useUI.ts";
|
|
7
|
+
import { getDefaults } from "../utils/ui.ts";
|
|
7
8
|
import { hasSlotContent } from "../utils/helper.ts";
|
|
8
9
|
|
|
9
10
|
import UIcon from "../ui.image-icon/UIcon.vue";
|
|
@@ -11,23 +12,15 @@ import UEmpty from "../ui.text-empty/UEmpty.vue";
|
|
|
11
12
|
|
|
12
13
|
import { UDataList as UDataListName } from "./constants.ts";
|
|
13
14
|
import defaultConfig from "./config.ts";
|
|
14
|
-
import useAttrs from "./useAttrs.ts";
|
|
15
15
|
import { useLocale } from "../composables/useLocale.ts";
|
|
16
16
|
|
|
17
|
-
import type {
|
|
18
|
-
import type { UDataListProps, IconSize, DragMoveEvent, DataListItem } from "./types.ts";
|
|
17
|
+
import type { Props, IconSize, DragMoveEvent, DataListItem, Config } from "./types.ts";
|
|
19
18
|
|
|
20
19
|
defineOptions({ inheritAttrs: false });
|
|
21
20
|
|
|
22
|
-
const props = withDefaults(defineProps<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
valueKey: getDefault<UDataListProps>(defaultConfig, UDataListName).valueKey,
|
|
26
|
-
animationDuration: getDefault<UDataListProps>(defaultConfig, UDataListName).animationDuration,
|
|
27
|
-
nesting: getDefault<UDataListProps>(defaultConfig, UDataListName).nesting,
|
|
28
|
-
hideEmptyStateForNesting: false,
|
|
29
|
-
dataTest: "",
|
|
30
|
-
config: () => ({}),
|
|
21
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
22
|
+
...getDefaults<Props, Config>(defaultConfig, UDataListName),
|
|
23
|
+
list: () => [],
|
|
31
24
|
});
|
|
32
25
|
|
|
33
26
|
const emit = defineEmits([
|
|
@@ -52,33 +45,6 @@ const emit = defineEmits([
|
|
|
52
45
|
"clickDelete",
|
|
53
46
|
]);
|
|
54
47
|
|
|
55
|
-
defineSlots<{
|
|
56
|
-
edit: { element: UnknownObject };
|
|
57
|
-
delete: { element: UnknownObject };
|
|
58
|
-
drag: { element: UnknownObject };
|
|
59
|
-
empty: {
|
|
60
|
-
emptyTitle: string;
|
|
61
|
-
emptyDescription: string;
|
|
62
|
-
};
|
|
63
|
-
label: { item: DataListItem; active: boolean };
|
|
64
|
-
actions: { item: DataListItem };
|
|
65
|
-
}>();
|
|
66
|
-
|
|
67
|
-
const {
|
|
68
|
-
config,
|
|
69
|
-
wrapperAttrs,
|
|
70
|
-
emptyAttrs,
|
|
71
|
-
draggableAttrs,
|
|
72
|
-
nestedAttrs,
|
|
73
|
-
itemWrapperAttrs,
|
|
74
|
-
itemAttrs,
|
|
75
|
-
labelAttrs,
|
|
76
|
-
labelCrossedAttrs,
|
|
77
|
-
customActionsAttrs,
|
|
78
|
-
deleteIconAttrs,
|
|
79
|
-
editIconAttrs,
|
|
80
|
-
dragIconAttrs,
|
|
81
|
-
} = useAttrs(props);
|
|
82
48
|
const { tm } = useLocale();
|
|
83
49
|
|
|
84
50
|
const i18nGlobal = tm(UDataListName);
|
|
@@ -143,6 +109,26 @@ function prepareSortData(list: DataListItem[] = [], parentValue: string | number
|
|
|
143
109
|
|
|
144
110
|
return sortData;
|
|
145
111
|
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Get element / nested component attributes for each config token ✨
|
|
115
|
+
* Applies: `class`, `config`, redefined default `props` and dev `vl-...` attributes.
|
|
116
|
+
*/
|
|
117
|
+
const {
|
|
118
|
+
config,
|
|
119
|
+
wrapperAttrs,
|
|
120
|
+
emptyAttrs,
|
|
121
|
+
draggableAttrs,
|
|
122
|
+
nestedAttrs,
|
|
123
|
+
itemWrapperAttrs,
|
|
124
|
+
itemAttrs,
|
|
125
|
+
labelAttrs,
|
|
126
|
+
labelCrossedAttrs,
|
|
127
|
+
customActionsAttrs,
|
|
128
|
+
deleteIconAttrs,
|
|
129
|
+
editIconAttrs,
|
|
130
|
+
dragIconAttrs,
|
|
131
|
+
} = useUI<Config>(defaultConfig);
|
|
146
132
|
</script>
|
|
147
133
|
|
|
148
134
|
<template>
|
|
@@ -191,7 +177,7 @@ function prepareSortData(list: DataListItem[] = [], parentValue: string | number
|
|
|
191
177
|
<slot
|
|
192
178
|
name="drag"
|
|
193
179
|
:item="element"
|
|
194
|
-
:icon-name="config.defaults
|
|
180
|
+
:icon-name="config.defaults.dragIcon"
|
|
195
181
|
:icon-size="iconSize"
|
|
196
182
|
>
|
|
197
183
|
<UIcon
|
|
@@ -199,7 +185,7 @@ function prepareSortData(list: DataListItem[] = [], parentValue: string | number
|
|
|
199
185
|
color="gray"
|
|
200
186
|
variant="light"
|
|
201
187
|
:size="iconSize"
|
|
202
|
-
:name="config.defaults
|
|
188
|
+
:name="config.defaults.dragIcon"
|
|
203
189
|
v-bind="dragIconAttrs"
|
|
204
190
|
/>
|
|
205
191
|
</slot>
|
|
@@ -236,7 +222,7 @@ function prepareSortData(list: DataListItem[] = [], parentValue: string | number
|
|
|
236
222
|
<slot
|
|
237
223
|
name="delete"
|
|
238
224
|
:item="element"
|
|
239
|
-
:icon-name="config.defaults
|
|
225
|
+
:icon-name="config.defaults.deleteIcon"
|
|
240
226
|
:icon-size="iconSize"
|
|
241
227
|
>
|
|
242
228
|
<UIcon
|
|
@@ -245,7 +231,7 @@ function prepareSortData(list: DataListItem[] = [], parentValue: string | number
|
|
|
245
231
|
interactive
|
|
246
232
|
color="red"
|
|
247
233
|
:size="iconSize"
|
|
248
|
-
:name="config.defaults
|
|
234
|
+
:name="config.defaults.deleteIcon"
|
|
249
235
|
:tooltip="currentLocale.delete"
|
|
250
236
|
v-bind="deleteIconAttrs"
|
|
251
237
|
:data-test="`${dataTest}-delete`"
|
|
@@ -262,7 +248,7 @@ function prepareSortData(list: DataListItem[] = [], parentValue: string | number
|
|
|
262
248
|
<slot
|
|
263
249
|
name="edit"
|
|
264
250
|
:item="element"
|
|
265
|
-
:icon-name="config.defaults
|
|
251
|
+
:icon-name="config.defaults.editIcon"
|
|
266
252
|
:icon-size="iconSize"
|
|
267
253
|
>
|
|
268
254
|
<UIcon
|
|
@@ -271,7 +257,7 @@ function prepareSortData(list: DataListItem[] = [], parentValue: string | number
|
|
|
271
257
|
interactive
|
|
272
258
|
color="gray"
|
|
273
259
|
:size="iconSize"
|
|
274
|
-
:name="config.defaults
|
|
260
|
+
:name="config.defaults.editIcon"
|
|
275
261
|
:tooltip="currentLocale.edit"
|
|
276
262
|
v-bind="editIconAttrs"
|
|
277
263
|
:data-test="`${dataTest}-edit`"
|
|
@@ -293,23 +279,26 @@ function prepareSortData(list: DataListItem[] = [], parentValue: string | number
|
|
|
293
279
|
@click-edit="onClickEdit"
|
|
294
280
|
@drag-sort="onDragEnd"
|
|
295
281
|
>
|
|
296
|
-
<template #label="{ item
|
|
282
|
+
<template #label="slotProps: { item: DataListItem; active: boolean }">
|
|
297
283
|
<!--
|
|
298
284
|
@slot Use it to modify label.
|
|
299
285
|
@binding {object} item
|
|
300
286
|
@binding {boolean} active
|
|
301
287
|
-->
|
|
302
|
-
<slot name="label" :item="item" :active="active">
|
|
303
|
-
<div
|
|
288
|
+
<slot name="label" :item="slotProps.item" :active="slotProps.active">
|
|
289
|
+
<div
|
|
290
|
+
v-bind="slotProps.active ? labelAttrs : labelCrossedAttrs"
|
|
291
|
+
v-text="slotProps.item[labelKey]"
|
|
292
|
+
/>
|
|
304
293
|
</slot>
|
|
305
294
|
</template>
|
|
306
295
|
|
|
307
|
-
<template #actions="{ item }">
|
|
296
|
+
<template #actions="slotProps: { item: DataListItem }">
|
|
308
297
|
<!--
|
|
309
298
|
@slot Use it to add custom actions.
|
|
310
299
|
@binding {object} item
|
|
311
300
|
-->
|
|
312
|
-
<slot name="actions" :item="item" />
|
|
301
|
+
<slot name="actions" :item="slotProps.item" />
|
|
313
302
|
</template>
|
|
314
303
|
</UDataList>
|
|
315
304
|
</div>
|
|
@@ -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 UDataListArgs extends
|
|
16
|
+
interface UDataListArgs extends Props {
|
|
17
17
|
slotTemplate?: string;
|
|
18
18
|
}
|
|
19
19
|
|
package/ui.data-list/types.ts
CHANGED
|
@@ -2,9 +2,9 @@ import defaultConfig from "./config.ts";
|
|
|
2
2
|
|
|
3
3
|
import DraggableContext from "vuedraggable";
|
|
4
4
|
|
|
5
|
-
import type { UnknownType } from "../types.ts";
|
|
5
|
+
import type { ComponentConfig, UnknownType } from "../types.ts";
|
|
6
6
|
|
|
7
|
-
export type Config =
|
|
7
|
+
export type Config = typeof defaultConfig;
|
|
8
8
|
|
|
9
9
|
export type IconSize = "xs" | "sm" | "md";
|
|
10
10
|
|
|
@@ -24,7 +24,7 @@ export interface DataListItem {
|
|
|
24
24
|
[key: string]: UnknownType | DataListItem[];
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
export interface
|
|
27
|
+
export interface Props {
|
|
28
28
|
/**
|
|
29
29
|
* Data item options.
|
|
30
30
|
*/
|
|
@@ -79,7 +79,7 @@ export interface UDataListProps {
|
|
|
79
79
|
/**
|
|
80
80
|
* Component config object.
|
|
81
81
|
*/
|
|
82
|
-
config?: Config
|
|
82
|
+
config?: ComponentConfig<Config>;
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
85
|
* Data-test attribute for automated testing.
|
package/ui.data-table/UTable.vue
CHANGED
|
@@ -18,7 +18,8 @@ import UCheckbox from "../ui.form-checkbox/UCheckbox.vue";
|
|
|
18
18
|
import ULoaderProgress from "../ui.loader-progress/ULoaderProgress.vue";
|
|
19
19
|
import UTableRow from "./UTableRow.vue";
|
|
20
20
|
|
|
21
|
-
import
|
|
21
|
+
import useUI from "../composables/useUI.ts";
|
|
22
|
+
import { getDefaults, cx } from "../utils/ui.ts";
|
|
22
23
|
import { hasSlotContent } from "../utils/helper.ts";
|
|
23
24
|
import { useLocale } from "../composables/useLocale.ts";
|
|
24
25
|
import { PX_IN_REM } from "../constants.js";
|
|
@@ -35,23 +36,17 @@ import {
|
|
|
35
36
|
} from "./utilTable.ts";
|
|
36
37
|
|
|
37
38
|
import { UTable } from "./constants.ts";
|
|
38
|
-
import useAttrs from "./useAttrs.ts";
|
|
39
39
|
|
|
40
|
-
import type { Cell, Row, RowId, UTableProps, UTableRowAttrs } from "./types.ts";
|
|
40
|
+
import type { Cell, Row, RowId, UTableProps, UTableRowAttrs, Config } from "./types.ts";
|
|
41
41
|
import type { Ref, RendererElement, ComputedRef } from "vue";
|
|
42
42
|
|
|
43
43
|
defineOptions({ inheritAttrs: false });
|
|
44
44
|
|
|
45
45
|
const props = withDefaults(defineProps<UTableProps>(), {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
stickyHeader: getDefault<UTableProps>(defaultConfig, UTable).stickyHeader,
|
|
51
|
-
stickyFooter: getDefault<UTableProps>(defaultConfig, UTable).stickyFooter,
|
|
52
|
-
loading: getDefault<UTableProps>(defaultConfig, UTable).loading,
|
|
53
|
-
dataTest: "",
|
|
54
|
-
config: () => ({}),
|
|
46
|
+
...getDefaults<UTableProps, Config>(defaultConfig, UTable),
|
|
47
|
+
columns: () => [],
|
|
48
|
+
rows: () => [],
|
|
49
|
+
dateDivider: () => [],
|
|
55
50
|
});
|
|
56
51
|
|
|
57
52
|
const emit = defineEmits([
|
|
@@ -198,54 +193,6 @@ const isSelectedAllRows = computed(() => {
|
|
|
198
193
|
return selectedRows.value.length === rows.length;
|
|
199
194
|
});
|
|
200
195
|
|
|
201
|
-
const {
|
|
202
|
-
config,
|
|
203
|
-
wrapperAttrs,
|
|
204
|
-
stickyHeaderCellAttrs,
|
|
205
|
-
stickyHeaderAttrs,
|
|
206
|
-
tableWrapperAttrs,
|
|
207
|
-
headerRowAttrs,
|
|
208
|
-
bodyRowAfterAttrs,
|
|
209
|
-
bodyRowBeforeAttrs,
|
|
210
|
-
bodyRowBeforeCheckedAttrs,
|
|
211
|
-
bodyRowBeforeCellAttrs,
|
|
212
|
-
footerAttrs,
|
|
213
|
-
bodyRowDateDividerAttrs,
|
|
214
|
-
headerCellBaseAttrs,
|
|
215
|
-
headerCellCheckboxAttrs,
|
|
216
|
-
headerActionsCheckboxAttrs,
|
|
217
|
-
stickyHeaderCheckboxAttrs,
|
|
218
|
-
headerCheckboxAttrs,
|
|
219
|
-
headerCounterAttrs,
|
|
220
|
-
bodyEmptyStateAttrs,
|
|
221
|
-
bodyDateDividerAttrs,
|
|
222
|
-
bodyCellDateDividerAttrs,
|
|
223
|
-
headerActionsCounterAttrs,
|
|
224
|
-
stickyHeaderCounterAttrs,
|
|
225
|
-
stickyHeaderLoaderAttrs,
|
|
226
|
-
tableAttrs,
|
|
227
|
-
headerLoaderAttrs,
|
|
228
|
-
bodyAttrs,
|
|
229
|
-
footerRowAttrs,
|
|
230
|
-
stickyFooterRowAttrs,
|
|
231
|
-
headerAttrs,
|
|
232
|
-
bodyCellContentAttrs,
|
|
233
|
-
bodyCellCheckboxAttrs,
|
|
234
|
-
bodyCheckboxAttrs,
|
|
235
|
-
bodyCellNestedAttrs,
|
|
236
|
-
bodyCellNestedExpandIconAttrs,
|
|
237
|
-
bodyCellNestedCollapseIconAttrs,
|
|
238
|
-
bodyCellBaseAttrs,
|
|
239
|
-
bodyCellNestedExpandIconWrapperAttrs,
|
|
240
|
-
bodyRowCheckedAttrs,
|
|
241
|
-
bodyRowAttrs,
|
|
242
|
-
} = useAttrs(props, {
|
|
243
|
-
tableRows,
|
|
244
|
-
isShownActionsHeader,
|
|
245
|
-
isHeaderSticky,
|
|
246
|
-
isFooterSticky,
|
|
247
|
-
});
|
|
248
|
-
|
|
249
196
|
const tableRowAttrs = computed(() => ({
|
|
250
197
|
bodyCellContentAttrs,
|
|
251
198
|
bodyCellCheckboxAttrs,
|
|
@@ -448,6 +395,60 @@ defineExpose({
|
|
|
448
395
|
*/
|
|
449
396
|
clearSelectedItems,
|
|
450
397
|
});
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Get element / nested component attributes for each config token ✨
|
|
401
|
+
* Applies: `class`, `config`, redefined default `props` and dev `vl-...` attributes.
|
|
402
|
+
*/
|
|
403
|
+
const mutatedProps = computed(() => ({
|
|
404
|
+
/* component state, not a props */
|
|
405
|
+
actionsHeader: isShownActionsHeader.value,
|
|
406
|
+
stickedHeader: isHeaderSticky.value,
|
|
407
|
+
stickedFooter: isFooterSticky.value,
|
|
408
|
+
}));
|
|
409
|
+
|
|
410
|
+
const {
|
|
411
|
+
config,
|
|
412
|
+
wrapperAttrs,
|
|
413
|
+
stickyHeaderCellAttrs,
|
|
414
|
+
stickyHeaderAttrs,
|
|
415
|
+
tableWrapperAttrs,
|
|
416
|
+
headerRowAttrs,
|
|
417
|
+
bodyRowAfterAttrs,
|
|
418
|
+
bodyRowBeforeAttrs,
|
|
419
|
+
bodyRowBeforeCheckedAttrs,
|
|
420
|
+
bodyRowBeforeCellAttrs,
|
|
421
|
+
footerAttrs,
|
|
422
|
+
bodyRowDateDividerAttrs,
|
|
423
|
+
headerCellBaseAttrs,
|
|
424
|
+
headerCellCheckboxAttrs,
|
|
425
|
+
headerActionsCheckboxAttrs,
|
|
426
|
+
stickyHeaderCheckboxAttrs,
|
|
427
|
+
headerCheckboxAttrs,
|
|
428
|
+
headerCounterAttrs,
|
|
429
|
+
bodyEmptyStateAttrs,
|
|
430
|
+
bodyDateDividerAttrs,
|
|
431
|
+
bodyCellDateDividerAttrs,
|
|
432
|
+
headerActionsCounterAttrs,
|
|
433
|
+
stickyHeaderCounterAttrs,
|
|
434
|
+
stickyHeaderLoaderAttrs,
|
|
435
|
+
tableAttrs,
|
|
436
|
+
headerLoaderAttrs,
|
|
437
|
+
bodyAttrs,
|
|
438
|
+
footerRowAttrs,
|
|
439
|
+
stickyFooterRowAttrs,
|
|
440
|
+
headerAttrs,
|
|
441
|
+
bodyCellContentAttrs,
|
|
442
|
+
bodyCellCheckboxAttrs,
|
|
443
|
+
bodyCheckboxAttrs,
|
|
444
|
+
bodyCellNestedAttrs,
|
|
445
|
+
bodyCellNestedExpandIconAttrs,
|
|
446
|
+
bodyCellNestedCollapseIconAttrs,
|
|
447
|
+
bodyCellBaseAttrs,
|
|
448
|
+
bodyCellNestedExpandIconWrapperAttrs,
|
|
449
|
+
bodyRowCheckedAttrs,
|
|
450
|
+
bodyRowAttrs,
|
|
451
|
+
} = useUI<Config>(defaultConfig, mutatedProps);
|
|
451
452
|
</script>
|
|
452
453
|
|
|
453
454
|
<template>
|
package/ui.data-table/types.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import defaultConfig from "./config.ts";
|
|
2
2
|
|
|
3
|
-
import type { UnknownObject } from "../types.ts";
|
|
4
3
|
import type { Ref } from "vue";
|
|
4
|
+
import type { ComponentConfig, UnknownObject } from "../types.ts";
|
|
5
|
+
|
|
6
|
+
export type Config = typeof defaultConfig;
|
|
5
7
|
|
|
6
8
|
type RowKeys =
|
|
7
9
|
| number
|
|
@@ -53,7 +55,6 @@ export interface ColumnObject {
|
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
export type Column = ColumnObject | string;
|
|
56
|
-
export type Config = Partial<typeof defaultConfig>;
|
|
57
58
|
|
|
58
59
|
export interface RowScopedProps {
|
|
59
60
|
value: unknown | string | number;
|
|
@@ -109,7 +110,7 @@ export interface UTableProps {
|
|
|
109
110
|
/**
|
|
110
111
|
* Component config object.
|
|
111
112
|
*/
|
|
112
|
-
config?: Config
|
|
113
|
+
config?: ComponentConfig<Config>;
|
|
113
114
|
|
|
114
115
|
/**
|
|
115
116
|
* Data-test attribute for automated testing.
|
|
@@ -1,36 +1,27 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { ref, computed, nextTick, useId, useTemplateRef } from "vue";
|
|
3
|
+
|
|
4
|
+
import useUI from "../composables/useUI.ts";
|
|
5
|
+
import { getDefaults } from "../utils/ui.ts";
|
|
3
6
|
|
|
4
7
|
import UIcon from "../ui.image-icon/UIcon.vue";
|
|
5
8
|
import UBadge from "../ui.text-badge/UBadge.vue";
|
|
6
9
|
import UDropdownList from "../ui.dropdown-list/UDropdownList.vue";
|
|
7
10
|
|
|
8
|
-
import { getDefault } from "../utils/ui.ts";
|
|
9
|
-
|
|
10
11
|
import { vClickOutside } from "../directives";
|
|
11
12
|
|
|
12
13
|
import defaultConfig from "./config.ts";
|
|
13
14
|
import { UDropdownBadge } from "./constants.ts";
|
|
14
|
-
import useAttrs from "./useAttrs.ts";
|
|
15
15
|
|
|
16
|
-
import type {
|
|
16
|
+
import type { Props, Config } from "./types.ts";
|
|
17
17
|
import type { Option } from "../ui.dropdown-list/types.ts";
|
|
18
18
|
|
|
19
19
|
defineOptions({ inheritAttrs: false });
|
|
20
20
|
|
|
21
|
-
const props = withDefaults(defineProps<
|
|
21
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
22
|
+
...getDefaults<Props, Config>(defaultConfig, UDropdownBadge),
|
|
22
23
|
options: () => [],
|
|
23
|
-
|
|
24
|
-
variant: getDefault<UDropdownBadgeProps>(defaultConfig, UDropdownBadge).variant,
|
|
25
|
-
color: getDefault<UDropdownBadgeProps>(defaultConfig, UDropdownBadge).color,
|
|
26
|
-
size: getDefault<UDropdownBadgeProps>(defaultConfig, UDropdownBadge).size,
|
|
27
|
-
round: getDefault<UDropdownBadgeProps>(defaultConfig, UDropdownBadge).round,
|
|
28
|
-
noIcon: getDefault<UDropdownBadgeProps>(defaultConfig, UDropdownBadge).noIcon,
|
|
29
|
-
yPosition: getDefault<UDropdownBadgeProps>(defaultConfig, UDropdownBadge).yPosition,
|
|
30
|
-
xPosition: getDefault<UDropdownBadgeProps>(defaultConfig, UDropdownBadge).xPosition,
|
|
31
|
-
id: "",
|
|
32
|
-
dataTest: "",
|
|
33
|
-
config: () => ({}),
|
|
24
|
+
label: "",
|
|
34
25
|
});
|
|
35
26
|
|
|
36
27
|
const emit = defineEmits([
|
|
@@ -48,13 +39,6 @@ const dropdownListRef = useTemplateRef<UDropdownListRef>("dropdown-list");
|
|
|
48
39
|
|
|
49
40
|
const elementId = props.id || useId();
|
|
50
41
|
|
|
51
|
-
const { config, wrapperAttrs, dropdownBadgeAttrs, dropdownListAttrs, dropdownIconAttrs } = useAttrs(
|
|
52
|
-
props,
|
|
53
|
-
{
|
|
54
|
-
isShownOptions,
|
|
55
|
-
},
|
|
56
|
-
);
|
|
57
|
-
|
|
58
42
|
function onClickBadge() {
|
|
59
43
|
isShownOptions.value = !isShownOptions.value;
|
|
60
44
|
|
|
@@ -72,6 +56,18 @@ function onClickOption(option: Option) {
|
|
|
72
56
|
|
|
73
57
|
hideOptions();
|
|
74
58
|
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Get element / nested component attributes for each config token ✨
|
|
62
|
+
* Applies: `class`, `config`, redefined default `props` and dev `vl-...` attributes.
|
|
63
|
+
*/
|
|
64
|
+
const mutatedProps = computed(() => ({
|
|
65
|
+
/* component state, not a props */
|
|
66
|
+
opened: isShownOptions.value,
|
|
67
|
+
}));
|
|
68
|
+
|
|
69
|
+
const { config, wrapperAttrs, dropdownBadgeAttrs, dropdownListAttrs, dropdownIconAttrs } =
|
|
70
|
+
useUI<Config>(defaultConfig, mutatedProps);
|
|
75
71
|
</script>
|
|
76
72
|
|
|
77
73
|
<template>
|
|
@@ -117,7 +113,7 @@ function onClickOption(option: Option) {
|
|
|
117
113
|
internal
|
|
118
114
|
:color="iconColor"
|
|
119
115
|
:size="size"
|
|
120
|
-
:name="config.defaults
|
|
116
|
+
:name="config.defaults.dropdownIcon"
|
|
121
117
|
v-bind="dropdownIconAttrs"
|
|
122
118
|
:data-test="`${dataTest}-dropdown`"
|
|
123
119
|
/>
|
|
@@ -10,14 +10,14 @@ import URow from "../../ui.container-row/URow.vue";
|
|
|
10
10
|
import UIcon from "../../ui.image-icon/UIcon.vue";
|
|
11
11
|
|
|
12
12
|
import type { Meta, StoryFn } from "@storybook/vue3";
|
|
13
|
-
import type {
|
|
13
|
+
import type { Props } from "../types.ts";
|
|
14
14
|
|
|
15
|
-
interface DefaultUDropdownBadgeArgs extends
|
|
15
|
+
interface DefaultUDropdownBadgeArgs extends Props {
|
|
16
16
|
slotTemplate?: string;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
interface EnumUDropdownBadgeArgs extends DefaultUDropdownBadgeArgs {
|
|
20
|
-
enum: keyof Pick<
|
|
20
|
+
enum: keyof Pick<Props, "color" | "size">;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export default {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import defaultConfig from "./config.ts";
|
|
2
2
|
|
|
3
3
|
import type { Option } from "../ui.dropdown-list/types.ts";
|
|
4
|
+
import type { ComponentConfig } from "../types.ts";
|
|
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
|
* Badge label.
|
|
10
11
|
*/
|
|
@@ -84,7 +85,7 @@ export interface UDropdownBadgeProps {
|
|
|
84
85
|
/**
|
|
85
86
|
* Component config object.
|
|
86
87
|
*/
|
|
87
|
-
config?: Config
|
|
88
|
+
config?: ComponentConfig<Config>;
|
|
88
89
|
|
|
89
90
|
/**
|
|
90
91
|
* Data-test attribute for automated testing.
|
|
@@ -1,39 +1,27 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { nextTick, computed, provide, ref, useId, useTemplateRef } from "vue";
|
|
3
3
|
|
|
4
|
+
import useUI from "../composables/useUI.ts";
|
|
5
|
+
import { getDefaults } from "../utils/ui.ts";
|
|
6
|
+
|
|
4
7
|
import UIcon from "../ui.image-icon/UIcon.vue";
|
|
5
8
|
import UButton from "../ui.button/UButton.vue";
|
|
6
9
|
import UDropdownList from "../ui.dropdown-list/UDropdownList.vue";
|
|
7
10
|
|
|
8
|
-
import { getDefault } from "../utils/ui.ts";
|
|
9
|
-
|
|
10
11
|
import { vClickOutside } from "../directives";
|
|
11
12
|
|
|
12
13
|
import defaultConfig from "./config.ts";
|
|
13
|
-
import useAttrs from "./useAttrs.ts";
|
|
14
14
|
import { UDropdownButton, BUTTON_VARIANT } from "./constants.ts";
|
|
15
15
|
|
|
16
|
-
import type {
|
|
16
|
+
import type { Props, IconSize, DropdownSize, Config } from "./types.ts";
|
|
17
17
|
import type { Option } from "../ui.dropdown-list/types.ts";
|
|
18
18
|
|
|
19
19
|
defineOptions({ inheritAttrs: false });
|
|
20
20
|
|
|
21
|
-
const props = withDefaults(defineProps<
|
|
21
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
22
|
+
...getDefaults<Props, Config>(defaultConfig, UDropdownButton),
|
|
22
23
|
options: () => [],
|
|
23
|
-
|
|
24
|
-
variant: getDefault<UDropdownButtonProps>(defaultConfig, UDropdownButton).variant,
|
|
25
|
-
color: getDefault<UDropdownButtonProps>(defaultConfig, UDropdownButton).color,
|
|
26
|
-
filled: getDefault<UDropdownButtonProps>(defaultConfig, UDropdownButton).filled,
|
|
27
|
-
size: getDefault<UDropdownButtonProps>(defaultConfig, UDropdownButton).size,
|
|
28
|
-
round: getDefault<UDropdownButtonProps>(defaultConfig, UDropdownButton).round,
|
|
29
|
-
square: getDefault<UDropdownButtonProps>(defaultConfig, UDropdownButton).square,
|
|
30
|
-
disabled: getDefault<UDropdownButtonProps>(defaultConfig, UDropdownButton).disabled,
|
|
31
|
-
noIcon: getDefault<UDropdownButtonProps>(defaultConfig, UDropdownButton).noIcon,
|
|
32
|
-
yPosition: getDefault<UDropdownButtonProps>(defaultConfig, UDropdownButton).yPosition,
|
|
33
|
-
xPosition: getDefault<UDropdownButtonProps>(defaultConfig, UDropdownButton).xPosition,
|
|
34
|
-
id: "",
|
|
35
|
-
dataTest: "",
|
|
36
|
-
config: () => ({}),
|
|
24
|
+
label: "",
|
|
37
25
|
});
|
|
38
26
|
|
|
39
27
|
const emit = defineEmits([
|
|
@@ -53,9 +41,6 @@ const dropdownListRef = useTemplateRef<UDropdownListRef>("dropdown-list");
|
|
|
53
41
|
|
|
54
42
|
const elementId = props.id || useId();
|
|
55
43
|
|
|
56
|
-
const { config, dropdownButtonAttrs, dropdownListAttrs, dropdownIconAttrs, wrapperAttrs } =
|
|
57
|
-
useAttrs(props, { isShownOptions });
|
|
58
|
-
|
|
59
44
|
const iconColor = computed(() => {
|
|
60
45
|
return props.variant === BUTTON_VARIANT.primary ? "white" : props.color;
|
|
61
46
|
});
|
|
@@ -105,6 +90,18 @@ function hideOptions() {
|
|
|
105
90
|
function onClickList() {
|
|
106
91
|
hideOptions();
|
|
107
92
|
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Get element / nested component attributes for each config token ✨
|
|
96
|
+
* Applies: `class`, `config`, redefined default `props` and dev `vl-...` attributes.
|
|
97
|
+
*/
|
|
98
|
+
const mutatedProps = computed(() => ({
|
|
99
|
+
/* component state, not a props */
|
|
100
|
+
opened: isShownOptions.value,
|
|
101
|
+
}));
|
|
102
|
+
|
|
103
|
+
const { config, dropdownButtonAttrs, dropdownListAttrs, dropdownIconAttrs, wrapperAttrs } =
|
|
104
|
+
useUI<Config>(defaultConfig, mutatedProps);
|
|
108
105
|
</script>
|
|
109
106
|
|
|
110
107
|
<template>
|
|
@@ -151,7 +148,7 @@ function onClickList() {
|
|
|
151
148
|
internal
|
|
152
149
|
:size="iconSize"
|
|
153
150
|
:color="iconColor"
|
|
154
|
-
:name="config.defaults
|
|
151
|
+
:name="config.defaults.dropdownIcon"
|
|
155
152
|
v-bind="dropdownIconAttrs"
|
|
156
153
|
:data-test="`${dataTest}-dropdown`"
|
|
157
154
|
/>
|
|
@@ -11,14 +11,14 @@ import UCol from "../../ui.container-col/UCol.vue";
|
|
|
11
11
|
import UIcon from "../../ui.image-icon/UIcon.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 DefaultUDropdownButtonArgs extends
|
|
16
|
+
interface DefaultUDropdownButtonArgs extends Props {
|
|
17
17
|
slotTemplate?: string;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
interface EnumUDropdownButtonArgs extends DefaultUDropdownButtonArgs {
|
|
21
|
-
enum: keyof Pick<
|
|
21
|
+
enum: keyof Pick<Props, "size" | "variant">;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export default {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import defaultConfig from "./config.ts";
|
|
2
2
|
|
|
3
3
|
import type { Option } from "../ui.dropdown-list/types.ts";
|
|
4
|
+
import type { ComponentConfig } from "../types.ts";
|
|
4
5
|
|
|
5
|
-
export type Config =
|
|
6
|
+
export type Config = typeof defaultConfig;
|
|
6
7
|
|
|
7
8
|
export type IconSize = "2xs" | "xs" | "sm" | "md" | "lg" | "xl";
|
|
8
9
|
export type DropdownSize = "sm" | "md" | "lg";
|
|
9
10
|
|
|
10
|
-
export interface
|
|
11
|
+
export interface Props {
|
|
11
12
|
/**
|
|
12
13
|
* Button label.
|
|
13
14
|
*/
|
|
@@ -102,7 +103,7 @@ export interface UDropdownButtonProps {
|
|
|
102
103
|
/**
|
|
103
104
|
* Component config object.
|
|
104
105
|
*/
|
|
105
|
-
config?: Config
|
|
106
|
+
config?: ComponentConfig<Config>;
|
|
106
107
|
|
|
107
108
|
/**
|
|
108
109
|
* Data-test attribute for automated testing.
|