vueless 0.0.616 → 0.0.617
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/package.json +1 -1
- package/ui.button/UButton.vue +0 -3
- package/ui.button-toggle/UToggle.vue +1 -15
- package/ui.button-toggle/config.ts +10 -0
- package/ui.button-toggle/types.ts +0 -2
- package/ui.container-accordion/UAccordion.vue +3 -14
- package/ui.container-accordion/config.ts +10 -1
- package/ui.container-accordion/types.ts +0 -1
- package/ui.data-list/UDataList.vue +4 -35
- package/ui.data-list/config.ts +13 -3
- package/ui.data-list/types.ts +0 -2
- package/ui.dropdown-button/UDropdownButton.vue +1 -29
- package/ui.dropdown-button/config.ts +23 -1
- package/ui.dropdown-button/types.ts +0 -3
- package/ui.dropdown-link/UDropdownLink.vue +1 -12
- package/ui.dropdown-link/config.ts +10 -1
- package/ui.dropdown-link/types.ts +0 -2
- package/ui.form-checkbox/UCheckbox.vue +1 -12
- package/ui.form-checkbox/config.ts +10 -1
- package/ui.form-checkbox/types.ts +0 -2
- package/ui.form-color-picker/UColorPicker.vue +1 -14
- package/ui.form-color-picker/config.ts +12 -1
- package/ui.form-color-picker/types.ts +0 -2
- package/ui.form-date-picker/UDatePicker.vue +5 -7
- package/ui.form-date-picker/config.ts +10 -1
- package/ui.form-date-picker-range/UDatePickerRange.vue +3 -4
- package/ui.form-date-picker-range/config.ts +10 -1
- package/ui.form-input/UInput.vue +5 -29
- package/ui.form-input/config.ts +13 -3
- package/ui.form-input/types.ts +0 -2
- package/ui.form-input-file/UInputFile.vue +1 -13
- package/ui.form-input-file/config.ts +17 -1
- package/ui.form-input-file/types.ts +0 -2
- package/ui.form-input-rating/UInputRating.vue +1 -12
- package/ui.form-input-rating/config.ts +10 -1
- package/ui.form-input-rating/types.ts +0 -2
- package/ui.form-input-search/UInputSearch.vue +2 -26
- package/ui.form-input-search/config.ts +30 -3
- package/ui.form-input-search/types.ts +0 -3
- package/ui.form-select/USelect.vue +8 -47
- package/ui.form-select/config.ts +15 -5
- package/ui.form-select/types.ts +0 -1
- package/ui.form-switch/USwitch.vue +1 -12
- package/ui.form-switch/config.ts +10 -1
- package/ui.form-switch/types.ts +0 -2
- package/ui.image-avatar/UAvatar.vue +1 -8
- package/ui.navigation-pagination/UPagination.vue +4 -50
- package/ui.navigation-pagination/config.ts +21 -4
- package/ui.navigation-pagination/types.ts +0 -3
- package/ui.navigation-progress/UProgress.vue +3 -17
- package/ui.navigation-progress/config.ts +14 -0
- package/ui.navigation-progress/types.ts +0 -2
- package/ui.text-alert/UAlert.vue +9 -32
- package/ui.text-alert/config.ts +22 -2
- package/ui.text-alert/types.ts +0 -3
- package/ui.text-badge/UBadge.vue +6 -34
- package/ui.text-badge/config.ts +13 -3
- package/ui.text-badge/types.ts +0 -2
- package/ui.text-empty/UEmpty.vue +4 -32
- package/ui.text-empty/config.ts +20 -2
- package/ui.text-empty/types.ts +0 -3
- package/ui.text-file/UFile.vue +2 -24
- package/ui.text-file/config.ts +20 -2
- package/ui.text-file/types.ts +0 -3
- package/web-types.json +1 -80
package/package.json
CHANGED
package/ui.button/UButton.vue
CHANGED
|
@@ -92,7 +92,6 @@ const { buttonAttrs, loaderAttrs, leftIconAttrs, rightIconAttrs, centerIconAttrs
|
|
|
92
92
|
<!--
|
|
93
93
|
@slot Use it to add something before the label.
|
|
94
94
|
@binding {string} icon-name
|
|
95
|
-
@binding {string} icon-size
|
|
96
95
|
-->
|
|
97
96
|
<slot name="left" :icon-name="leftIcon">
|
|
98
97
|
<UIcon v-if="leftIcon" internal color="inherit" :name="leftIcon" v-bind="leftIconAttrs" />
|
|
@@ -102,7 +101,6 @@ const { buttonAttrs, loaderAttrs, leftIconAttrs, rightIconAttrs, centerIconAttrs
|
|
|
102
101
|
@slot Use it to add something instead of the label.
|
|
103
102
|
@binding {string} label
|
|
104
103
|
@binding {string} icon-name
|
|
105
|
-
@binding {string} icon-size
|
|
106
104
|
-->
|
|
107
105
|
<slot name="default" :label="label" :icon-name="icon">
|
|
108
106
|
<UIcon v-if="icon" internal color="inherit" :name="icon" v-bind="centerIconAttrs" />
|
|
@@ -114,7 +112,6 @@ const { buttonAttrs, loaderAttrs, leftIconAttrs, rightIconAttrs, centerIconAttrs
|
|
|
114
112
|
<!--
|
|
115
113
|
@slot Use it to add something after the label.
|
|
116
114
|
@binding {string} icon-name
|
|
117
|
-
@binding {string} icon-size
|
|
118
115
|
-->
|
|
119
116
|
<slot name="right" :icon-name="rightIcon">
|
|
120
117
|
<UIcon
|
|
@@ -10,7 +10,7 @@ import { getDefaults } from "../utils/ui.ts";
|
|
|
10
10
|
import defaultConfig from "./config.ts";
|
|
11
11
|
import { COMPONENT_NAME, TYPE_RADIO, TYPE_CHECKBOX } from "./constants.ts";
|
|
12
12
|
|
|
13
|
-
import type { Props,
|
|
13
|
+
import type { Props, Config } from "./types.ts";
|
|
14
14
|
|
|
15
15
|
defineOptions({ inheritAttrs: false });
|
|
16
16
|
|
|
@@ -34,19 +34,6 @@ const selectedValue = computed({
|
|
|
34
34
|
set: (value) => emit("update:modelValue", value),
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
-
const labelSize = computed(() => {
|
|
38
|
-
const sizes = {
|
|
39
|
-
"2xs": "sm",
|
|
40
|
-
xs: "sm",
|
|
41
|
-
sm: "md",
|
|
42
|
-
md: "md",
|
|
43
|
-
lg: "lg",
|
|
44
|
-
xl: "lg",
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
return sizes[props.size] as LabelSize;
|
|
48
|
-
});
|
|
49
|
-
|
|
50
37
|
const type = computed(() => {
|
|
51
38
|
return props.multiple ? TYPE_CHECKBOX : TYPE_RADIO;
|
|
52
39
|
});
|
|
@@ -90,7 +77,6 @@ const { toggleLabelAttrs, itemsAttrs, itemAttrs } = useUI<Config>(defaultConfig)
|
|
|
90
77
|
|
|
91
78
|
<template>
|
|
92
79
|
<ULabel
|
|
93
|
-
:size="labelSize"
|
|
94
80
|
:label="label"
|
|
95
81
|
:description="description"
|
|
96
82
|
:align="labelAlign"
|
|
@@ -10,7 +10,7 @@ import UDivider from "../ui.container-divider/UDivider.vue";
|
|
|
10
10
|
import { COMPONENT_NAME } from "./constants.ts";
|
|
11
11
|
import defaultConfig from "./config.ts";
|
|
12
12
|
|
|
13
|
-
import type { Props,
|
|
13
|
+
import type { Props, Config } from "./types.ts";
|
|
14
14
|
|
|
15
15
|
defineOptions({ inheritAttrs: false });
|
|
16
16
|
|
|
@@ -35,16 +35,6 @@ const toggleIcon = computed(() =>
|
|
|
35
35
|
isOpened.value ? config.value.defaults.collapseIcon : config.value.defaults.expandIcon,
|
|
36
36
|
);
|
|
37
37
|
|
|
38
|
-
const dividerSize = computed(() => {
|
|
39
|
-
const sizes = {
|
|
40
|
-
sm: "md",
|
|
41
|
-
md: "lg",
|
|
42
|
-
lg: "xl",
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
return sizes[props.size] as DividerSize;
|
|
46
|
-
});
|
|
47
|
-
|
|
48
38
|
function onClickItem() {
|
|
49
39
|
isOpened.value = !isOpened.value;
|
|
50
40
|
|
|
@@ -75,10 +65,9 @@ const {
|
|
|
75
65
|
<!--
|
|
76
66
|
@slot Use it to add something instead of the toggle icon.
|
|
77
67
|
@binding {string} icon-name
|
|
78
|
-
@binding {string} icon-size
|
|
79
68
|
@binding {boolean} opened
|
|
80
69
|
-->
|
|
81
|
-
<slot name="toggle" :icon-name="toggleIcon" :
|
|
70
|
+
<slot name="toggle" :icon-name="toggleIcon" :opened="isOpened">
|
|
82
71
|
<UIcon :name="toggleIcon" :size="size" color="gray" internal v-bind="toggleIconAttrs" />
|
|
83
72
|
</slot>
|
|
84
73
|
</div>
|
|
@@ -86,6 +75,6 @@ const {
|
|
|
86
75
|
<div :id="`description-${elementId}`" v-bind="descriptionAttrs" v-text="description" />
|
|
87
76
|
</div>
|
|
88
77
|
|
|
89
|
-
<UDivider
|
|
78
|
+
<UDivider v-bind="accordionDividerAttrs" />
|
|
90
79
|
</div>
|
|
91
80
|
</template>
|
|
@@ -25,7 +25,16 @@ export default /*tw*/ {
|
|
|
25
25
|
},
|
|
26
26
|
},
|
|
27
27
|
toggleIcon: "{UIcon}",
|
|
28
|
-
accordionDivider:
|
|
28
|
+
accordionDivider: {
|
|
29
|
+
base: "{UDivider} group-last:hidden",
|
|
30
|
+
defaults: {
|
|
31
|
+
size: {
|
|
32
|
+
sm: "md",
|
|
33
|
+
md: "lg",
|
|
34
|
+
lg: "xl",
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
29
38
|
defaults: {
|
|
30
39
|
size: "md",
|
|
31
40
|
/* icons */
|
|
@@ -14,7 +14,7 @@ import { COMPONENT_NAME } from "./constants.ts";
|
|
|
14
14
|
import defaultConfig from "./config.ts";
|
|
15
15
|
import { useLocale } from "../composables/useLocale.ts";
|
|
16
16
|
|
|
17
|
-
import type { Props,
|
|
17
|
+
import type { Props, DragMoveEvent, DataListItem, Config } from "./types.ts";
|
|
18
18
|
|
|
19
19
|
defineOptions({ inheritAttrs: false });
|
|
20
20
|
|
|
@@ -50,16 +50,6 @@ const { tm } = useLocale();
|
|
|
50
50
|
const i18nGlobal = tm(COMPONENT_NAME);
|
|
51
51
|
const currentLocale = computed(() => merge({}, defaultConfig.i18n, i18nGlobal, props.config.i18n));
|
|
52
52
|
|
|
53
|
-
const iconSize = computed(() => {
|
|
54
|
-
const sizes = {
|
|
55
|
-
sm: "xs",
|
|
56
|
-
md: "sm",
|
|
57
|
-
lg: "md",
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
return sizes[props.size] as IconSize;
|
|
61
|
-
});
|
|
62
|
-
|
|
63
53
|
function isActive(element: DataListItem) {
|
|
64
54
|
return element.isActive === undefined || element.isActive;
|
|
65
55
|
}
|
|
@@ -172,19 +162,12 @@ const {
|
|
|
172
162
|
@slot Use it to add something instead of the drag icon.
|
|
173
163
|
@binding {object} item
|
|
174
164
|
@binding {string} icon-name
|
|
175
|
-
@binding {string} icon-size
|
|
176
165
|
-->
|
|
177
|
-
<slot
|
|
178
|
-
name="drag"
|
|
179
|
-
:item="element"
|
|
180
|
-
:icon-name="config.defaults.dragIcon"
|
|
181
|
-
:icon-size="iconSize"
|
|
182
|
-
>
|
|
166
|
+
<slot name="drag" :item="element" :icon-name="config.defaults.dragIcon">
|
|
183
167
|
<UIcon
|
|
184
168
|
internal
|
|
185
169
|
color="gray"
|
|
186
170
|
variant="light"
|
|
187
|
-
:size="iconSize"
|
|
188
171
|
:name="config.defaults.dragIcon"
|
|
189
172
|
v-bind="dragIconAttrs"
|
|
190
173
|
/>
|
|
@@ -217,20 +200,13 @@ const {
|
|
|
217
200
|
@slot Use it to add something instead of the delete icon.
|
|
218
201
|
@binding {object} item
|
|
219
202
|
@binding {string} icon-name
|
|
220
|
-
@binding {string} icon-size
|
|
221
203
|
-->
|
|
222
|
-
<slot
|
|
223
|
-
name="delete"
|
|
224
|
-
:item="element"
|
|
225
|
-
:icon-name="config.defaults.deleteIcon"
|
|
226
|
-
:icon-size="iconSize"
|
|
227
|
-
>
|
|
204
|
+
<slot name="delete" :item="element" :icon-name="config.defaults.deleteIcon">
|
|
228
205
|
<UIcon
|
|
229
206
|
v-if="!element.isHiddenDelete"
|
|
230
207
|
internal
|
|
231
208
|
interactive
|
|
232
209
|
color="red"
|
|
233
|
-
:size="iconSize"
|
|
234
210
|
:name="config.defaults.deleteIcon"
|
|
235
211
|
:tooltip="currentLocale.delete"
|
|
236
212
|
v-bind="deleteIconAttrs"
|
|
@@ -243,20 +219,13 @@ const {
|
|
|
243
219
|
@slot Use it to add something instead of the edit icon.
|
|
244
220
|
@binding {object} item
|
|
245
221
|
@binding {string} icon-name
|
|
246
|
-
@binding {string} icon-size
|
|
247
222
|
-->
|
|
248
|
-
<slot
|
|
249
|
-
name="edit"
|
|
250
|
-
:item="element"
|
|
251
|
-
:icon-name="config.defaults.editIcon"
|
|
252
|
-
:icon-size="iconSize"
|
|
253
|
-
>
|
|
223
|
+
<slot name="edit" :item="element" :icon-name="config.defaults.editIcon">
|
|
254
224
|
<UIcon
|
|
255
225
|
v-if="!element.isHiddenEdit"
|
|
256
226
|
internal
|
|
257
227
|
interactive
|
|
258
228
|
color="gray"
|
|
259
|
-
:size="iconSize"
|
|
260
229
|
:name="config.defaults.editIcon"
|
|
261
230
|
:tooltip="currentLocale.edit"
|
|
262
231
|
v-bind="editIconAttrs"
|
package/ui.data-list/config.ts
CHANGED
|
@@ -10,7 +10,17 @@ export default /*tw*/ {
|
|
|
10
10
|
group-last/item-wrapper:border-b-0 group-[]/nested:group-last/item-wrapper:border-b
|
|
11
11
|
py-4 space-x-4 flex flex-auto items-center justify-between
|
|
12
12
|
`,
|
|
13
|
-
|
|
13
|
+
dataListIcon: {
|
|
14
|
+
base: "{UIcon}",
|
|
15
|
+
defaults: {
|
|
16
|
+
size: {
|
|
17
|
+
sm: "xs",
|
|
18
|
+
md: "sm",
|
|
19
|
+
lg: "md",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
dragIcon: "{UIcon} {>dataListIcon} icon-drag cursor-move opacity-100",
|
|
14
24
|
label: {
|
|
15
25
|
base: "font-normal text-gray-900 flex-auto pt-px",
|
|
16
26
|
variants: {
|
|
@@ -26,8 +36,8 @@ export default /*tw*/ {
|
|
|
26
36
|
space-x-5 opacity-50 md:flex md:items-center md:opacity-0
|
|
27
37
|
group-hover/item:md:block group-hover/item:opacity-100
|
|
28
38
|
`,
|
|
29
|
-
deleteIcon: "{UIcon} hidden md:block md:opacity-0 group-hover/item:md:opacity-100",
|
|
30
|
-
editIcon: "{UIcon} fill-gray-500 opacity-50",
|
|
39
|
+
deleteIcon: "{UIcon} {>dataListIcon} hidden md:block md:opacity-0 group-hover/item:md:opacity-100",
|
|
40
|
+
editIcon: "{UIcon} {>dataListIcon} fill-gray-500 opacity-50",
|
|
31
41
|
divider: "{UDivider}",
|
|
32
42
|
empty: "{UEmpty}",
|
|
33
43
|
nested: "{UDataList} group/nested ml-6",
|
package/ui.data-list/types.ts
CHANGED
|
@@ -6,8 +6,6 @@ import type { ComponentConfig, UnknownType } from "../types.ts";
|
|
|
6
6
|
|
|
7
7
|
export type Config = typeof defaultConfig;
|
|
8
8
|
|
|
9
|
-
export type IconSize = "xs" | "sm" | "md";
|
|
10
|
-
|
|
11
9
|
export interface DragMoveEvent extends DragEvent {
|
|
12
10
|
draggedContext: typeof DraggableContext;
|
|
13
11
|
relatedContext: typeof DraggableContext | null;
|
|
@@ -13,7 +13,7 @@ import { vClickOutside } from "../directives";
|
|
|
13
13
|
import defaultConfig from "./config.ts";
|
|
14
14
|
import { COMPONENT_NAME } from "./constants.ts";
|
|
15
15
|
|
|
16
|
-
import type { Props,
|
|
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 });
|
|
@@ -41,32 +41,6 @@ const dropdownListRef = useTemplateRef<UDropdownListRef>("dropdown-list");
|
|
|
41
41
|
|
|
42
42
|
const elementId = props.id || useId();
|
|
43
43
|
|
|
44
|
-
const iconSize = computed(() => {
|
|
45
|
-
const sizes = {
|
|
46
|
-
"2xs": "xs",
|
|
47
|
-
xs: "xs",
|
|
48
|
-
sm: "sm",
|
|
49
|
-
md: "sm",
|
|
50
|
-
lg: "md",
|
|
51
|
-
xl: "md",
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
return sizes[props.size] as IconSize;
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
const dropdownSize = computed(() => {
|
|
58
|
-
const sizes = {
|
|
59
|
-
"2xs": "sm",
|
|
60
|
-
xs: "sm",
|
|
61
|
-
sm: "sm",
|
|
62
|
-
md: "md",
|
|
63
|
-
lg: "lg",
|
|
64
|
-
xl: "lg",
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
return sizes[props.size] as DropdownSize;
|
|
68
|
-
});
|
|
69
|
-
|
|
70
44
|
function onClickOption(option: Option) {
|
|
71
45
|
emit("clickOption", option);
|
|
72
46
|
}
|
|
@@ -143,7 +117,6 @@ const { config, dropdownButtonAttrs, dropdownListAttrs, dropdownIconAttrs, wrapp
|
|
|
143
117
|
v-if="!noIcon"
|
|
144
118
|
internal
|
|
145
119
|
color="inherit"
|
|
146
|
-
:size="iconSize"
|
|
147
120
|
:name="config.defaults.dropdownIcon"
|
|
148
121
|
v-bind="dropdownIconAttrs"
|
|
149
122
|
:data-test="`${dataTest}-dropdown`"
|
|
@@ -155,7 +128,6 @@ const { config, dropdownButtonAttrs, dropdownListAttrs, dropdownIconAttrs, wrapp
|
|
|
155
128
|
<UDropdownList
|
|
156
129
|
v-if="isShownOptions"
|
|
157
130
|
ref="dropdown-list"
|
|
158
|
-
:size="dropdownSize"
|
|
159
131
|
:options="options"
|
|
160
132
|
:label-key="labelKey"
|
|
161
133
|
v-bind="dropdownListAttrs"
|
|
@@ -9,7 +9,19 @@ export default /*tw*/ {
|
|
|
9
9
|
},
|
|
10
10
|
compoundVariants: [{ opened: true, color: ["grayscale", "white"], class: "ring-gray-700/15" }],
|
|
11
11
|
},
|
|
12
|
-
dropdownIcon:
|
|
12
|
+
dropdownIcon: {
|
|
13
|
+
base: "{UIcon} transition duration-300 group-[]:rotate-180",
|
|
14
|
+
defaults: {
|
|
15
|
+
size: {
|
|
16
|
+
"2xs": "sm",
|
|
17
|
+
xs: "sm",
|
|
18
|
+
sm: "sm",
|
|
19
|
+
md: "md",
|
|
20
|
+
lg: "lg",
|
|
21
|
+
xl: "lg",
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
13
25
|
dropdownList: {
|
|
14
26
|
base: "{UDropdownList} w-fit",
|
|
15
27
|
variants: {
|
|
@@ -22,6 +34,16 @@ export default /*tw*/ {
|
|
|
22
34
|
right: "right-0",
|
|
23
35
|
},
|
|
24
36
|
},
|
|
37
|
+
defaults: {
|
|
38
|
+
size: {
|
|
39
|
+
"2xs": "sm",
|
|
40
|
+
xs: "sm",
|
|
41
|
+
sm: "sm",
|
|
42
|
+
md: "md",
|
|
43
|
+
lg: "lg",
|
|
44
|
+
xl: "lg",
|
|
45
|
+
},
|
|
46
|
+
},
|
|
25
47
|
},
|
|
26
48
|
defaults: {
|
|
27
49
|
color: "brand",
|
|
@@ -5,9 +5,6 @@ import type { ComponentConfig } from "../types.ts";
|
|
|
5
5
|
|
|
6
6
|
export type Config = typeof defaultConfig;
|
|
7
7
|
|
|
8
|
-
export type IconSize = "2xs" | "xs" | "sm" | "md" | "lg" | "xl";
|
|
9
|
-
export type DropdownSize = "sm" | "md" | "lg";
|
|
10
|
-
|
|
11
8
|
export interface Props {
|
|
12
9
|
/**
|
|
13
10
|
* Button label.
|
|
@@ -13,7 +13,7 @@ import { vClickOutside } from "../directives";
|
|
|
13
13
|
import { COMPONENT_NAME } from "./constants.ts";
|
|
14
14
|
import defaultConfig from "./config.ts";
|
|
15
15
|
|
|
16
|
-
import type { Props,
|
|
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 });
|
|
@@ -41,16 +41,6 @@ const dropdownListRef = useTemplateRef<UDropdownListRef>("dropdown-list");
|
|
|
41
41
|
|
|
42
42
|
const elementId = props.id || useId();
|
|
43
43
|
|
|
44
|
-
const iconSize = computed(() => {
|
|
45
|
-
const sizes = {
|
|
46
|
-
sm: "2xs",
|
|
47
|
-
md: "xs",
|
|
48
|
-
lg: "sm",
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
return sizes[props.size] as IconSize;
|
|
52
|
-
});
|
|
53
|
-
|
|
54
44
|
function onClickLink() {
|
|
55
45
|
isShownOptions.value = !isShownOptions.value;
|
|
56
46
|
|
|
@@ -129,7 +119,6 @@ const { config, wrapperAttrs, dropdownLinkAttrs, dropdownListAttrs, dropdownIcon
|
|
|
129
119
|
internal
|
|
130
120
|
interactive
|
|
131
121
|
:color="color"
|
|
132
|
-
:size="iconSize"
|
|
133
122
|
:name="config.defaults.dropdownIcon"
|
|
134
123
|
v-bind="dropdownIconAttrs"
|
|
135
124
|
:data-test="`${dataTest}-dropdown`"
|
|
@@ -8,7 +8,16 @@ export default /*tw*/ {
|
|
|
8
8
|
},
|
|
9
9
|
},
|
|
10
10
|
dropdownLink: "{ULink}",
|
|
11
|
-
dropdownIcon:
|
|
11
|
+
dropdownIcon: {
|
|
12
|
+
base: "{UIcon} block transition duration-300 group-[]:rotate-180",
|
|
13
|
+
defaults: {
|
|
14
|
+
size: {
|
|
15
|
+
sm: "2xs",
|
|
16
|
+
md: "xs",
|
|
17
|
+
lg: "sm",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
12
21
|
dropdownList: {
|
|
13
22
|
base: "{UDropdownList} w-fit",
|
|
14
23
|
variants: {
|
|
@@ -12,7 +12,7 @@ import defaultConfig from "./config.ts";
|
|
|
12
12
|
import { COMPONENT_NAME } from "./constants.ts";
|
|
13
13
|
|
|
14
14
|
import type { UnknownObject } from "../types.ts";
|
|
15
|
-
import type { Props,
|
|
15
|
+
import type { Props, Config } from "./types.ts";
|
|
16
16
|
|
|
17
17
|
defineOptions({ inheritAttrs: false });
|
|
18
18
|
|
|
@@ -54,16 +54,6 @@ const checkboxColor = ref(props.color);
|
|
|
54
54
|
|
|
55
55
|
const elementId = props.id || useId();
|
|
56
56
|
|
|
57
|
-
const iconSize = computed(() => {
|
|
58
|
-
const sizes = {
|
|
59
|
-
sm: "2xs",
|
|
60
|
-
md: "xs",
|
|
61
|
-
lg: "sm",
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
return sizes[props.size] as IconSize;
|
|
65
|
-
});
|
|
66
|
-
|
|
67
57
|
const isBinary = computed(() => !Array.isArray(props.modelValue));
|
|
68
58
|
const isCheckboxInGroup = computed(() => Boolean(toValue(getCheckboxGroupName)));
|
|
69
59
|
|
|
@@ -164,7 +154,6 @@ const { config, checkboxAttrs, iconWrapperAttrs, checkboxLabelAttrs, checkedIcon
|
|
|
164
154
|
<UIcon
|
|
165
155
|
internal
|
|
166
156
|
:name="partial ? config.defaults.partiallyCheckedIcon : config.defaults.checkedIcon"
|
|
167
|
-
:size="iconSize"
|
|
168
157
|
color="white"
|
|
169
158
|
v-bind="checkedIconAttrs"
|
|
170
159
|
/>
|
|
@@ -4,8 +4,6 @@ import type { ComponentConfig, UnknownObject, UnknownArray } from "../types.ts";
|
|
|
4
4
|
|
|
5
5
|
export type Config = typeof defaultConfig;
|
|
6
6
|
|
|
7
|
-
export type IconSize = "2xs" | "xs" | "sm";
|
|
8
|
-
|
|
9
7
|
export interface UCheckboxOption {
|
|
10
8
|
value?: string | number | boolean | UnknownObject | UnknownArray;
|
|
11
9
|
falseValue?: string | number | boolean | UnknownObject | UnknownArray;
|
|
@@ -11,7 +11,7 @@ import ULabel from "../ui.form-label/ULabel.vue";
|
|
|
11
11
|
import { COMPONENT_NAME } from "./constants.ts";
|
|
12
12
|
import defaultConfig from "./config.ts";
|
|
13
13
|
|
|
14
|
-
import type { Props,
|
|
14
|
+
import type { Props, Config } from "./types.ts";
|
|
15
15
|
import type { BrandColors } from "../types.ts";
|
|
16
16
|
|
|
17
17
|
defineOptions({ inheritAttrs: false });
|
|
@@ -39,18 +39,6 @@ const selectedItem = computed({
|
|
|
39
39
|
set: (value) => emit("update:modelValue", value),
|
|
40
40
|
});
|
|
41
41
|
|
|
42
|
-
const iconSize = computed(() => {
|
|
43
|
-
const sizes = {
|
|
44
|
-
xs: "3xs",
|
|
45
|
-
sm: "2xs",
|
|
46
|
-
md: "xs",
|
|
47
|
-
lg: "sm",
|
|
48
|
-
xl: "md",
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
return sizes[props.size] as IconSize;
|
|
52
|
-
});
|
|
53
|
-
|
|
54
42
|
function onUpdateValue(value: string) {
|
|
55
43
|
selectedItem.value = value;
|
|
56
44
|
}
|
|
@@ -98,7 +86,6 @@ const {
|
|
|
98
86
|
<UIcon
|
|
99
87
|
v-if="selectedItem === ''"
|
|
100
88
|
internal
|
|
101
|
-
:size="iconSize"
|
|
102
89
|
color="gray"
|
|
103
90
|
:name="config.defaults.unselectedIcon"
|
|
104
91
|
v-bind="unselectedIconAttrs"
|
|
@@ -11,7 +11,18 @@ export default /*tw*/ {
|
|
|
11
11
|
},
|
|
12
12
|
},
|
|
13
13
|
unselected: "relative flex",
|
|
14
|
-
unselectedIcon:
|
|
14
|
+
unselectedIcon: {
|
|
15
|
+
base: "{UIcon} absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full",
|
|
16
|
+
defaults: {
|
|
17
|
+
size: {
|
|
18
|
+
xs: "3xs",
|
|
19
|
+
sm: "2xs",
|
|
20
|
+
md: "xs",
|
|
21
|
+
lg: "sm",
|
|
22
|
+
xl: "md",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
15
26
|
unselectedColorPickerRadio: {
|
|
16
27
|
base: "{URadio}",
|
|
17
28
|
radio: "checked:text-white !border-gray-300",
|
|
@@ -305,23 +305,21 @@ watchEffect(() => {
|
|
|
305
305
|
<slot name="left" />
|
|
306
306
|
</template>
|
|
307
307
|
|
|
308
|
-
<template #left-icon="{ iconName
|
|
308
|
+
<template #left-icon="{ iconName }">
|
|
309
309
|
<!--
|
|
310
310
|
@slot Use it add an icon before the date.
|
|
311
311
|
@binding {string} icon-name
|
|
312
|
-
@binding {string} icon-size
|
|
313
312
|
-->
|
|
314
|
-
<slot name="left-icon" :icon-name="iconName"
|
|
313
|
+
<slot name="left-icon" :icon-name="iconName" />
|
|
315
314
|
</template>
|
|
316
315
|
|
|
317
|
-
<template #right-icon="{ iconName
|
|
316
|
+
<template #right-icon="{ iconName }">
|
|
318
317
|
<!--
|
|
319
318
|
@slot Use it add an icon after the date.
|
|
320
319
|
@binding {string} icon-name
|
|
321
|
-
@binding {string} icon-size
|
|
322
320
|
-->
|
|
323
|
-
<slot name="right-icon" :icon-name="iconName"
|
|
324
|
-
<UIcon :name="iconName"
|
|
321
|
+
<slot name="right-icon" :icon-name="iconName">
|
|
322
|
+
<UIcon :name="iconName" color="gray" v-bind="rightIconAttrs" />
|
|
325
323
|
</slot>
|
|
326
324
|
</template>
|
|
327
325
|
|
|
@@ -12,7 +12,16 @@ export default /*tw*/ {
|
|
|
12
12
|
},
|
|
13
13
|
},
|
|
14
14
|
},
|
|
15
|
-
rightIcon:
|
|
15
|
+
rightIcon: {
|
|
16
|
+
base: "{UIcon}",
|
|
17
|
+
defaults: {
|
|
18
|
+
size: {
|
|
19
|
+
sm: "xs",
|
|
20
|
+
md: "sm",
|
|
21
|
+
lg: "md",
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
16
25
|
datepickerCalendar: {
|
|
17
26
|
base: "{UCalendar} absolute mb-3 z-40",
|
|
18
27
|
variants: {
|
|
@@ -610,14 +610,13 @@ watchEffect(() => {
|
|
|
610
610
|
<slot name="left-icon" />
|
|
611
611
|
</template>
|
|
612
612
|
|
|
613
|
-
<template #right-icon="{ iconName
|
|
613
|
+
<template #right-icon="{ iconName }">
|
|
614
614
|
<!--
|
|
615
615
|
@slot Use it add an icon after the date.
|
|
616
616
|
@binding {string} icon-name
|
|
617
|
-
@binding {string} icon-size
|
|
618
617
|
-->
|
|
619
|
-
<slot name="right-icon" :icon-name="iconName"
|
|
620
|
-
<UIcon :name="iconName"
|
|
618
|
+
<slot name="right-icon" :icon-name="iconName">
|
|
619
|
+
<UIcon :name="iconName" color="gray" v-bind="rightIconAttrs" />
|
|
621
620
|
</slot>
|
|
622
621
|
</template>
|
|
623
622
|
|