vueless 0.0.657 → 0.0.659
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/config.ts +3 -3
- package/ui.button/storybook/stories.ts +1 -1
- package/ui.button/types.ts +2 -2
- package/ui.button-link/config.ts +3 -3
- package/ui.button-link/storybook/stories.ts +1 -1
- package/ui.button-link/types.ts +2 -2
- package/ui.button-toggle/UToggle.vue +2 -1
- package/ui.button-toggle/storybook/stories.ts +63 -29
- package/ui.button-toggle/types.ts +7 -2
- package/ui.button-toggle-item/UToggleItem.vue +2 -2
- package/ui.button-toggle-item/storybook/stories.ts +28 -21
- package/ui.container-divider/config.ts +3 -3
- package/ui.container-divider/storybook/stories.ts +1 -1
- package/ui.container-divider/types.ts +2 -2
- package/ui.container-group/UGroup.vue +1 -1
- package/ui.container-modal/UModal.vue +7 -4
- package/ui.container-modal/config.ts +2 -3
- package/ui.container-modal/types.ts +1 -1
- package/ui.container-page/UPage.vue +1 -1
- package/ui.dropdown-button/UDropdownButton.vue +1 -1
- package/ui.dropdown-button/storybook/stories.ts +30 -13
- package/ui.dropdown-link/UDropdownLink.vue +1 -1
- package/ui.dropdown-link/config.ts +1 -1
- package/ui.dropdown-link/types.ts +2 -2
- package/ui.form-calendar/UCalendar.vue +6 -6
- package/ui.form-calendar/UCalendarDayView.vue +13 -13
- package/ui.form-calendar/UCalendarMonthView.vue +12 -12
- package/ui.form-calendar/UCalendarYearView.vue +12 -12
- package/ui.form-date-picker-range/UDatePickerRange.vue +3 -3
- package/ui.form-date-picker-range/UDatePickerRangePeriodMenu.vue +18 -18
- package/ui.form-input-file/UInputFile.vue +2 -2
- package/ui.form-input-search/UInputSearch.vue +1 -1
- package/ui.form-select/USelect.vue +15 -11
- package/ui.form-select/config.ts +6 -6
- package/ui.form-select/storybook/stories.ts +6 -6
- package/ui.navigation-pagination/UPagination.vue +7 -7
- package/ui.text-alert/UAlert.vue +1 -1
- package/ui.text-file/UFile.vue +9 -2
package/package.json
CHANGED
package/ui.button/config.ts
CHANGED
|
@@ -47,8 +47,8 @@ export default /*tw*/ {
|
|
|
47
47
|
false: "rounded-dynamic",
|
|
48
48
|
true: "rounded-full",
|
|
49
49
|
},
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
ring: {
|
|
51
|
+
false: "!ring-0 !ring-offset-0",
|
|
52
52
|
},
|
|
53
53
|
loading: {
|
|
54
54
|
true: "gap-0 pointer-events-none",
|
|
@@ -187,7 +187,7 @@ export default /*tw*/ {
|
|
|
187
187
|
block: false,
|
|
188
188
|
square: false,
|
|
189
189
|
filled: false,
|
|
190
|
-
|
|
190
|
+
ring: true,
|
|
191
191
|
loading: false,
|
|
192
192
|
disabled: false,
|
|
193
193
|
},
|
|
@@ -156,7 +156,7 @@ export const Disabled = EnumVariantTemplate.bind({});
|
|
|
156
156
|
Disabled.args = { enum: "variant", disabled: true };
|
|
157
157
|
|
|
158
158
|
export const NoRing = DefaultTemplate.bind({});
|
|
159
|
-
NoRing.args = {
|
|
159
|
+
NoRing.args = { ring: false };
|
|
160
160
|
|
|
161
161
|
export const Colors = ColorTemplate.bind({});
|
|
162
162
|
Colors.args = {};
|
package/ui.button/types.ts
CHANGED
package/ui.button-link/config.ts
CHANGED
|
@@ -20,8 +20,8 @@ export default /*tw*/ {
|
|
|
20
20
|
defaultSlot: {
|
|
21
21
|
true: "flex items-center focus-within:ring-0 focus-within:ring-offset-0",
|
|
22
22
|
},
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
ring: {
|
|
24
|
+
false: "!ring-0 !ring-offset-0",
|
|
25
25
|
},
|
|
26
26
|
block: {
|
|
27
27
|
true: "w-full",
|
|
@@ -87,7 +87,7 @@ export default /*tw*/ {
|
|
|
87
87
|
wrapperExactActiveClass: "",
|
|
88
88
|
underlined: undefined,
|
|
89
89
|
block: false,
|
|
90
|
-
|
|
90
|
+
ring: true,
|
|
91
91
|
dashed: false,
|
|
92
92
|
disabled: false,
|
|
93
93
|
targetBlank: false,
|
|
@@ -183,7 +183,7 @@ export const Disabled = DefaultTemplate.bind({});
|
|
|
183
183
|
Disabled.args = { disabled: true };
|
|
184
184
|
|
|
185
185
|
export const NoRing = DefaultTemplate.bind({});
|
|
186
|
-
NoRing.args = {
|
|
186
|
+
NoRing.args = { ring: false };
|
|
187
187
|
|
|
188
188
|
export const Block = DefaultTemplate.bind({});
|
|
189
189
|
Block.args = { block: true };
|
package/ui.button-link/types.ts
CHANGED
|
@@ -61,7 +61,7 @@ provide("getToggleRound", () => props.round);
|
|
|
61
61
|
provide("getToggleBlock", () => props.block);
|
|
62
62
|
provide("getToggleSquare", () => props.square);
|
|
63
63
|
provide("getToggleDisabled", () => props.disabled);
|
|
64
|
-
provide("
|
|
64
|
+
provide("getToggleRing", () => props.ring);
|
|
65
65
|
provide("getToggleSplit", () => props.split);
|
|
66
66
|
|
|
67
67
|
provide("toggleSelectedValue", {
|
|
@@ -82,6 +82,7 @@ const { toggleLabelAttrs, itemsAttrs, itemAttrs } = useUI<Config>(defaultConfig)
|
|
|
82
82
|
:description="description"
|
|
83
83
|
:align="labelAlign"
|
|
84
84
|
:disabled="disabled"
|
|
85
|
+
:error="error"
|
|
85
86
|
centred
|
|
86
87
|
v-bind="toggleLabelAttrs"
|
|
87
88
|
:data-test="dataTest"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref } from "vue";
|
|
1
|
+
import { ref, computed } from "vue";
|
|
2
2
|
import {
|
|
3
3
|
getArgTypes,
|
|
4
4
|
getSlotNames,
|
|
@@ -10,6 +10,7 @@ import UToggle from "../../ui.button-toggle/UToggle.vue";
|
|
|
10
10
|
import UIcon from "../../ui.image-icon/UIcon.vue";
|
|
11
11
|
import UToggleItem from "../../ui.button-toggle-item/UToggleItem.vue";
|
|
12
12
|
import URow from "../../ui.container-row/URow.vue";
|
|
13
|
+
import UBadge from "../../ui.text-badge/UBadge.vue";
|
|
13
14
|
|
|
14
15
|
import type { Meta, StoryFn } from "@storybook/vue3";
|
|
15
16
|
import type { Props } from "../types.ts";
|
|
@@ -24,12 +25,13 @@ export default {
|
|
|
24
25
|
title: "Buttons & Links / Toggle",
|
|
25
26
|
component: UToggle,
|
|
26
27
|
args: {
|
|
28
|
+
label: "Please choose an option",
|
|
27
29
|
modelValue: "11",
|
|
28
30
|
options: [
|
|
29
|
-
{ value: "11", label: "
|
|
30
|
-
{ value: "12", label: "
|
|
31
|
-
{ value: "13", label: "
|
|
32
|
-
{ value: "14", label: "
|
|
31
|
+
{ value: "11", label: "Admin" },
|
|
32
|
+
{ value: "12", label: "Editor" },
|
|
33
|
+
{ value: "13", label: "Viewer" },
|
|
34
|
+
{ value: "14", label: "Guest" },
|
|
33
35
|
],
|
|
34
36
|
},
|
|
35
37
|
argTypes: {
|
|
@@ -44,14 +46,26 @@ export default {
|
|
|
44
46
|
} as Meta;
|
|
45
47
|
|
|
46
48
|
const DefaultTemplate: StoryFn<UToggleArgs> = (args: UToggleArgs) => ({
|
|
47
|
-
components: { UToggle, UIcon, UToggleItem },
|
|
49
|
+
components: { UToggle, UIcon, UToggleItem, UBadge },
|
|
48
50
|
setup() {
|
|
49
51
|
const slots = getSlotNames(UToggle.__name);
|
|
52
|
+
const modelValueRef = ref(args.modelValue);
|
|
53
|
+
const error = computed(() => {
|
|
54
|
+
if (args.name === "error" && Array.isArray(modelValueRef.value)) {
|
|
55
|
+
return modelValueRef.value?.length === 0 ? "Please select at least one option" : "";
|
|
56
|
+
}
|
|
50
57
|
|
|
51
|
-
|
|
58
|
+
return "";
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
return { args, slots, modelValueRef, error };
|
|
52
62
|
},
|
|
53
63
|
template: `
|
|
54
|
-
<UToggle
|
|
64
|
+
<UToggle
|
|
65
|
+
v-bind="args"
|
|
66
|
+
v-model="modelValueRef"
|
|
67
|
+
:error="error"
|
|
68
|
+
>
|
|
55
69
|
${args.slotTemplate || getSlotsFragment("")}
|
|
56
70
|
</UToggle>
|
|
57
71
|
`,
|
|
@@ -60,11 +74,11 @@ const DefaultTemplate: StoryFn<UToggleArgs> = (args: UToggleArgs) => ({
|
|
|
60
74
|
const EnumVariantTemplate: StoryFn<UToggleArgs> = (args: UToggleArgs, { argTypes }) => ({
|
|
61
75
|
components: { UToggle, URow },
|
|
62
76
|
setup() {
|
|
63
|
-
const
|
|
77
|
+
const values = ref(["2xs", "xs", "sm", "md", "lg", "xl"]);
|
|
64
78
|
|
|
65
79
|
return {
|
|
66
80
|
args,
|
|
67
|
-
|
|
81
|
+
values,
|
|
68
82
|
options: argTypes?.[args.enum]?.options,
|
|
69
83
|
};
|
|
70
84
|
},
|
|
@@ -74,13 +88,14 @@ const EnumVariantTemplate: StoryFn<UToggleArgs> = (args: UToggleArgs, { argTypes
|
|
|
74
88
|
v-for="(option, index) in options"
|
|
75
89
|
:key="index"
|
|
76
90
|
v-bind="args"
|
|
77
|
-
v-model="
|
|
91
|
+
v-model="values[option]"
|
|
78
92
|
:[args.enum]="option"
|
|
79
93
|
:label="option"
|
|
80
94
|
:options="[
|
|
81
95
|
{ value: option + 1, label: option },
|
|
82
96
|
{ value: option + 2, label: option },
|
|
83
97
|
]"
|
|
98
|
+
class="w-auto"
|
|
84
99
|
/>
|
|
85
100
|
</URow>
|
|
86
101
|
`,
|
|
@@ -94,24 +109,35 @@ Default.args = {
|
|
|
94
109
|
export const Disabled = DefaultTemplate.bind({});
|
|
95
110
|
Disabled.args = {
|
|
96
111
|
name: "Disabled",
|
|
97
|
-
|
|
112
|
+
label: "You can disable the whole toggle or specific items",
|
|
113
|
+
options: [
|
|
114
|
+
{ value: "11", label: "Admin" },
|
|
115
|
+
{ value: "12", label: "Editor", disabled: true },
|
|
116
|
+
{ value: "13", label: "Viewer" },
|
|
117
|
+
{ value: "14", label: "Guest", disabled: true },
|
|
118
|
+
],
|
|
98
119
|
};
|
|
99
120
|
|
|
100
|
-
export const
|
|
101
|
-
|
|
102
|
-
name: "Label",
|
|
103
|
-
label: "Label",
|
|
104
|
-
description: "description",
|
|
105
|
-
};
|
|
121
|
+
export const Description = DefaultTemplate.bind({});
|
|
122
|
+
Description.args = { name: "Description", description: "You can also add description" };
|
|
106
123
|
|
|
107
124
|
export const Sizes = EnumVariantTemplate.bind({});
|
|
108
|
-
Sizes.args = {
|
|
109
|
-
name: "sizeTemplate",
|
|
110
|
-
enum: "size",
|
|
111
|
-
};
|
|
125
|
+
Sizes.args = { name: "sizeTemplate", enum: "size" };
|
|
112
126
|
|
|
113
127
|
export const Multiple = DefaultTemplate.bind({});
|
|
114
|
-
Multiple.args = {
|
|
128
|
+
Multiple.args = {
|
|
129
|
+
name: "multiple",
|
|
130
|
+
multiple: true,
|
|
131
|
+
label: "You can choose more than one option",
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export const Error = DefaultTemplate.bind({});
|
|
135
|
+
Error.args = {
|
|
136
|
+
name: "error",
|
|
137
|
+
multiple: true,
|
|
138
|
+
modelValue: [],
|
|
139
|
+
label: "If no option is selected, error message is displayed",
|
|
140
|
+
};
|
|
115
141
|
|
|
116
142
|
export const Block = DefaultTemplate.bind({});
|
|
117
143
|
Block.args = { name: "block", block: true };
|
|
@@ -126,6 +152,7 @@ export const Square = DefaultTemplate.bind({});
|
|
|
126
152
|
Square.args = {
|
|
127
153
|
name: "square",
|
|
128
154
|
square: true,
|
|
155
|
+
label: "Square prop is useful when icons are present",
|
|
129
156
|
slotTemplate: `
|
|
130
157
|
<template #default>
|
|
131
158
|
<UToggleItem value="1">
|
|
@@ -143,14 +170,21 @@ Square.args = {
|
|
|
143
170
|
`,
|
|
144
171
|
};
|
|
145
172
|
|
|
146
|
-
export const
|
|
147
|
-
|
|
148
|
-
name: "
|
|
173
|
+
export const DefaultSlot = DefaultTemplate.bind({});
|
|
174
|
+
DefaultSlot.args = {
|
|
175
|
+
name: "defaultSlot",
|
|
176
|
+
label: "Please select an operation to proceed",
|
|
149
177
|
slotTemplate: `
|
|
150
178
|
<template #default>
|
|
151
|
-
<UToggleItem
|
|
152
|
-
|
|
153
|
-
|
|
179
|
+
<UToggleItem value="1">
|
|
180
|
+
<UBadge label="Download" color="green" right-icon="download" />
|
|
181
|
+
</UToggleItem>
|
|
182
|
+
<UToggleItem value="2">
|
|
183
|
+
<UBadge label="Edit" color="amber" right-icon="edit" />
|
|
184
|
+
</UToggleItem>
|
|
185
|
+
<UToggleItem value="3">
|
|
186
|
+
<UBadge label="Delete" color="red" right-icon="delete" />
|
|
187
|
+
</UToggleItem>
|
|
154
188
|
</template>
|
|
155
189
|
`,
|
|
156
190
|
};
|
|
@@ -26,6 +26,11 @@ export interface Props {
|
|
|
26
26
|
*/
|
|
27
27
|
size?: "2xs" | "xs" | "sm" | "md" | "lg" | "xl";
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* Error message.
|
|
31
|
+
*/
|
|
32
|
+
error?: string;
|
|
33
|
+
|
|
29
34
|
/**
|
|
30
35
|
* Label placement.
|
|
31
36
|
*/
|
|
@@ -77,9 +82,9 @@ export interface Props {
|
|
|
77
82
|
square?: boolean;
|
|
78
83
|
|
|
79
84
|
/**
|
|
80
|
-
*
|
|
85
|
+
* Show button ring on focus.
|
|
81
86
|
*/
|
|
82
|
-
|
|
87
|
+
ring?: boolean;
|
|
83
88
|
|
|
84
89
|
/**
|
|
85
90
|
* Component config object.
|
|
@@ -37,7 +37,7 @@ const getToggleSize = inject<() => ButtonSize>("getToggleSize", () => "md" as Bu
|
|
|
37
37
|
const getToggleRound = inject<() => boolean>("getToggleRound", () => false);
|
|
38
38
|
const getToggleBlock = inject<() => boolean>("getToggleBlock", () => false);
|
|
39
39
|
const getToggleSquare = inject<() => boolean>("getToggleSquare", () => false);
|
|
40
|
-
const
|
|
40
|
+
const getToggleRing = inject<() => boolean>("getToggleRing", () => false);
|
|
41
41
|
const getToggleSplit = inject<() => boolean>("getToggleSplit", () => true);
|
|
42
42
|
|
|
43
43
|
const getToggleDisabled = inject<() => boolean>(
|
|
@@ -109,7 +109,7 @@ const { toggleButtonInactiveAttrs, toggleButtonActiveAttrs, toggleInputAttrs } =
|
|
|
109
109
|
:block="getToggleBlock()"
|
|
110
110
|
:square="getToggleSquare()"
|
|
111
111
|
:disabled="getToggleDisabled() || disabled"
|
|
112
|
-
:
|
|
112
|
+
:ring="getToggleRing() || getToggleSplit()"
|
|
113
113
|
v-bind="isSelected ? toggleButtonActiveAttrs : toggleButtonInactiveAttrs"
|
|
114
114
|
@click="onClickSetValue"
|
|
115
115
|
>
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
|
|
8
8
|
import UToggleItem from "../../ui.button-toggle-item/UToggleItem.vue";
|
|
9
9
|
import UIcon from "../../ui.image-icon/UIcon.vue";
|
|
10
|
+
import URow from "../../ui.container-row/URow.vue";
|
|
10
11
|
|
|
11
12
|
import type { Meta, StoryFn } from "@storybook/vue3";
|
|
12
13
|
import type { Props } from "../types.ts";
|
|
@@ -58,26 +59,32 @@ Default.args = {};
|
|
|
58
59
|
export const Disabled = DefaultTemplate.bind({});
|
|
59
60
|
Disabled.args = { disabled: true };
|
|
60
61
|
|
|
61
|
-
export const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
62
|
+
export const Slots: StoryFn<UToggleItemArgs> = (args) => ({
|
|
63
|
+
components: { UToggleItem, UIcon, URow },
|
|
64
|
+
setup() {
|
|
65
|
+
return { args };
|
|
66
|
+
},
|
|
67
|
+
template: `
|
|
68
|
+
<URow>
|
|
69
|
+
<UToggleItem label="Download">
|
|
70
|
+
<template #left>
|
|
71
|
+
<UIcon
|
|
72
|
+
name="download"
|
|
73
|
+
color="green"
|
|
74
|
+
size="sm"
|
|
75
|
+
/>
|
|
76
|
+
</template>
|
|
77
|
+
</UToggleItem>
|
|
72
78
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
</
|
|
79
|
+
<UToggleItem label="Edit">
|
|
80
|
+
<template #right>
|
|
81
|
+
<UIcon
|
|
82
|
+
name="edit"
|
|
83
|
+
color="orange"
|
|
84
|
+
size="sm"
|
|
85
|
+
/>
|
|
86
|
+
</template>
|
|
87
|
+
</UToggleItem>
|
|
88
|
+
</URow>
|
|
82
89
|
`,
|
|
83
|
-
};
|
|
90
|
+
});
|
|
@@ -46,8 +46,8 @@ export default /*tw*/ {
|
|
|
46
46
|
dotted: {
|
|
47
47
|
true: "border-dotted",
|
|
48
48
|
},
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
border: {
|
|
50
|
+
false: "border-transparent",
|
|
51
51
|
},
|
|
52
52
|
},
|
|
53
53
|
},
|
|
@@ -68,9 +68,9 @@ export default /*tw*/ {
|
|
|
68
68
|
variant: "default",
|
|
69
69
|
padding: "all",
|
|
70
70
|
size: "md",
|
|
71
|
+
border: true,
|
|
71
72
|
dashed: false,
|
|
72
73
|
dotted: false,
|
|
73
74
|
vertical: false,
|
|
74
|
-
noBorder: false,
|
|
75
75
|
},
|
|
76
76
|
};
|
|
@@ -53,7 +53,7 @@ const {
|
|
|
53
53
|
<slot name="header-right" />
|
|
54
54
|
</div>
|
|
55
55
|
|
|
56
|
-
<UDivider size="xl" padding="after" :
|
|
56
|
+
<UDivider size="xl" padding="after" :border="underlined" v-bind="underlineAttrs" />
|
|
57
57
|
</template>
|
|
58
58
|
|
|
59
59
|
<div v-bind="contentAttrs">
|
|
@@ -117,7 +117,6 @@ const {
|
|
|
117
117
|
backLinkIconAttrs,
|
|
118
118
|
closeIconAttrs,
|
|
119
119
|
modalDividerAttrs,
|
|
120
|
-
dividerSpacingAttrs,
|
|
121
120
|
overlayAttrs,
|
|
122
121
|
wrapperAttrs,
|
|
123
122
|
innerWrapperAttrs,
|
|
@@ -216,11 +215,15 @@ const {
|
|
|
216
215
|
<slot />
|
|
217
216
|
</div>
|
|
218
217
|
|
|
219
|
-
<UDivider
|
|
218
|
+
<UDivider
|
|
219
|
+
v-if="divider || !isExistFooter"
|
|
220
|
+
:border="divider && isExistFooter"
|
|
221
|
+
variant="dark"
|
|
222
|
+
padding="before"
|
|
223
|
+
v-bind="modalDividerAttrs"
|
|
224
|
+
/>
|
|
220
225
|
|
|
221
226
|
<template v-if="isExistFooter">
|
|
222
|
-
<UDivider v-if="!noDivider" variant="dark" padding="none" v-bind="modalDividerAttrs" />
|
|
223
|
-
|
|
224
227
|
<div v-bind="footerAttrs">
|
|
225
228
|
<div v-if="hasSlotContent($slots['footer-left'])" v-bind="footerLeftAttrs">
|
|
226
229
|
<!-- @slot Use it to add something to the left side of the footer. -->
|
|
@@ -28,8 +28,7 @@ export default /*tw*/ {
|
|
|
28
28
|
headerRight: "",
|
|
29
29
|
closeIcon: "{UIcon}",
|
|
30
30
|
body: "space-y-4 px-4 md:px-8 text-sm",
|
|
31
|
-
modalDivider: "{UDivider}",
|
|
32
|
-
dividerSpacing: "{UDivider}",
|
|
31
|
+
modalDivider: "{UDivider} pt-8",
|
|
33
32
|
footer: "flex justify-between px-4 md:px-8 py-8 max-md:flex-col max-md:gap-4",
|
|
34
33
|
footerLeft: "flex flex-col md:flex-row space-y-4 md:space-x-4 md:space-y-0 w-full",
|
|
35
34
|
footerRight: "flex flex-col md:flex-row space-y-4 md:space-x-4 md:space-y-0 w-full justify-end",
|
|
@@ -55,7 +54,7 @@ export default /*tw*/ {
|
|
|
55
54
|
defaults: {
|
|
56
55
|
size: "sm",
|
|
57
56
|
inner: false,
|
|
58
|
-
|
|
57
|
+
divider: true,
|
|
59
58
|
closeOnEsc: true,
|
|
60
59
|
closeOnCross: true,
|
|
61
60
|
closeOnOverlay: true,
|
|
@@ -110,7 +110,7 @@ const { config, dropdownButtonAttrs, dropdownListAttrs, dropdownIconAttrs, wrapp
|
|
|
110
110
|
@slot Use it to add something after the label.
|
|
111
111
|
@binding {boolean} opened
|
|
112
112
|
-->
|
|
113
|
-
<slot name="
|
|
113
|
+
<slot name="toggle" :opened="isShownOptions">
|
|
114
114
|
<UIcon
|
|
115
115
|
v-if="!noIcon"
|
|
116
116
|
internal
|
|
@@ -9,6 +9,7 @@ import UDropdownButton from "../../ui.dropdown-button/UDropdownButton.vue";
|
|
|
9
9
|
import URow from "../../ui.container-row/URow.vue";
|
|
10
10
|
import UCol from "../../ui.container-col/UCol.vue";
|
|
11
11
|
import UIcon from "../../ui.image-icon/UIcon.vue";
|
|
12
|
+
import ULink from "../../ui.button-link/ULink.vue";
|
|
12
13
|
|
|
13
14
|
import type { Meta, StoryFn } from "@storybook/vue3";
|
|
14
15
|
import type { Props } from "../types.ts";
|
|
@@ -18,7 +19,7 @@ interface DefaultUDropdownButtonArgs extends Props {
|
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
interface EnumUDropdownButtonArgs extends DefaultUDropdownButtonArgs {
|
|
21
|
-
enum: keyof Pick<Props, "size" | "variant">;
|
|
22
|
+
enum: keyof Pick<Props, "size" | "variant" | "xPosition" | "yPosition">;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
export default {
|
|
@@ -36,7 +37,7 @@ export default {
|
|
|
36
37
|
docs: {
|
|
37
38
|
...getDocsDescription(UDropdownButton.__name),
|
|
38
39
|
story: {
|
|
39
|
-
height: "
|
|
40
|
+
height: "250px",
|
|
40
41
|
},
|
|
41
42
|
},
|
|
42
43
|
},
|
|
@@ -45,7 +46,7 @@ export default {
|
|
|
45
46
|
const DefaultTemplate: StoryFn<DefaultUDropdownButtonArgs> = (
|
|
46
47
|
args: DefaultUDropdownButtonArgs,
|
|
47
48
|
) => ({
|
|
48
|
-
components: { UDropdownButton, UIcon },
|
|
49
|
+
components: { UDropdownButton, UIcon, ULink },
|
|
49
50
|
setup() {
|
|
50
51
|
const slots = getSlotNames(UDropdownButton.__name);
|
|
51
52
|
|
|
@@ -122,19 +123,35 @@ Variants.args = { enum: "variant" };
|
|
|
122
123
|
export const Sizes = EnumVariantTemplate.bind({});
|
|
123
124
|
Sizes.args = { enum: "size" };
|
|
124
125
|
|
|
126
|
+
export const DropdownListXPosition = EnumVariantTemplate.bind({});
|
|
127
|
+
DropdownListXPosition.args = { enum: "xPosition" };
|
|
128
|
+
|
|
129
|
+
export const DropdownListYPosition = EnumVariantTemplate.bind({});
|
|
130
|
+
DropdownListYPosition.args = { enum: "yPosition" };
|
|
131
|
+
|
|
125
132
|
export const VariantColors = VariantColorsTemplate.bind({});
|
|
126
133
|
VariantColors.args = {};
|
|
127
134
|
|
|
128
135
|
export const WithoutDropdownIcon = EnumVariantTemplate.bind({});
|
|
129
136
|
WithoutDropdownIcon.args = { enum: "variant", noIcon: true };
|
|
130
137
|
|
|
138
|
+
export const CustomDropdownIcon = DefaultTemplate.bind({});
|
|
139
|
+
CustomDropdownIcon.args = {
|
|
140
|
+
config: {
|
|
141
|
+
defaults: {
|
|
142
|
+
dropdownIcon: "expand_circle_down",
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
|
|
131
147
|
export const DefaultSlot = DefaultTemplate.bind({});
|
|
132
148
|
DefaultSlot.args = {
|
|
133
149
|
slotTemplate: `
|
|
134
150
|
<template #default>
|
|
135
|
-
|
|
151
|
+
<UIcon name="unfold_more" color="white" />
|
|
136
152
|
</template>
|
|
137
153
|
`,
|
|
154
|
+
noIcon: true,
|
|
138
155
|
};
|
|
139
156
|
|
|
140
157
|
export const LeftSlot = DefaultTemplate.bind({});
|
|
@@ -142,22 +159,22 @@ LeftSlot.args = {
|
|
|
142
159
|
slotTemplate: `
|
|
143
160
|
<template #left>
|
|
144
161
|
<UIcon
|
|
145
|
-
name="
|
|
146
|
-
color="red"
|
|
162
|
+
name="heart_plus"
|
|
147
163
|
size="sm"
|
|
164
|
+
color="green"
|
|
148
165
|
/>
|
|
149
166
|
</template>
|
|
150
167
|
`,
|
|
151
168
|
};
|
|
152
169
|
|
|
153
|
-
export const
|
|
154
|
-
|
|
170
|
+
export const SlotToggle = DefaultTemplate.bind({});
|
|
171
|
+
SlotToggle.args = {
|
|
155
172
|
slotTemplate: `
|
|
156
|
-
<template #
|
|
157
|
-
<
|
|
158
|
-
|
|
159
|
-
color="
|
|
160
|
-
|
|
173
|
+
<template #toggle="{ opened }">
|
|
174
|
+
<ULink
|
|
175
|
+
:label="opened ? 'collapse' : 'expand'"
|
|
176
|
+
color="green"
|
|
177
|
+
:ring=false
|
|
161
178
|
/>
|
|
162
179
|
</template>
|
|
163
180
|
`,
|
|
@@ -76,11 +76,11 @@ const { config, wrapperAttrs, dropdownLinkAttrs, dropdownListAttrs, dropdownIcon
|
|
|
76
76
|
<div v-click-outside="hideOptions" v-bind="wrapperAttrs">
|
|
77
77
|
<ULink
|
|
78
78
|
:id="elementId"
|
|
79
|
+
:ring="ring"
|
|
79
80
|
:size="size"
|
|
80
81
|
:label="label"
|
|
81
82
|
:color="color"
|
|
82
83
|
:dashed="dashed"
|
|
83
|
-
:no-ring="noRing"
|
|
84
84
|
:disabled="disabled"
|
|
85
85
|
:underlined="underlined"
|
|
86
86
|
v-bind="dropdownLinkAttrs"
|