vueless 0.0.254 → 0.0.256
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/composable.ui/index.js +21 -4
- package/package.json +1 -1
- package/ui.button/composables/attrs.composable.js +11 -14
- package/ui.button/index.stories.js +1 -1
- package/ui.button-link/composables/attrs.composable.js +8 -11
- package/ui.button-link/index.stories.js +1 -1
- package/ui.button-toggle/composables/attrs.composable.js +5 -5
- package/ui.button-toggle/index.stories.js +2 -2
- package/ui.button-toggle-item/composables/attrs.composable.js +5 -5
- package/ui.button-toggle-item/index.stories.js +6 -2
- package/ui.container-card/index.stories.js +1 -1
- package/ui.dropdown-button/index.stories.js +3 -6
- package/ui.form-checkbox/index.stories.js +13 -26
- package/ui.form-checkbox-group/index.stories.js +28 -74
- package/ui.form-checkbox-multi-state/index.stories.js +17 -13
- package/ui.form-color-picker/index.stories.js +3 -3
- package/ui.form-date-picker/index.stories.js +11 -15
- package/ui.form-input/index.stories.js +1 -1
- package/ui.form-input-file/index.stories.js +1 -1
- package/ui.form-input-money/index.stories.js +1 -1
- package/ui.form-input-number/index.stories.js +3 -3
- package/ui.form-input-search/index.stories.js +1 -1
- package/ui.form-label/index.stories.js +28 -51
- package/ui.form-radio-group/index.stories.js +6 -14
- package/ui.form-select/index.stories.js +62 -159
- package/ui.form-switch/index.stories.js +17 -33
- package/ui.form-textarea/index.stories.js +1 -3
- package/ui.image-icon/index.stories.js +1 -1
- package/ui.navigation-progress/index.stories.js +1 -1
- package/ui.navigation-tabs/index.stories.js +3 -3
- package/ui.text-badge/index.stories.js +2 -2
- package/ui.text-block/index.stories.js +2 -2
- package/ui.text-empty/index.stories.js +1 -1
- package/web-types.json +1 -1
|
@@ -13,6 +13,7 @@ export default {
|
|
|
13
13
|
component: UDatePicker,
|
|
14
14
|
args: {
|
|
15
15
|
label: "Label",
|
|
16
|
+
modelValue: null,
|
|
16
17
|
},
|
|
17
18
|
argTypes: {
|
|
18
19
|
...getArgTypes(UDatePicker.name),
|
|
@@ -33,18 +34,13 @@ const DefaultTemplate = (args) => ({
|
|
|
33
34
|
|
|
34
35
|
return { args, slots };
|
|
35
36
|
},
|
|
36
|
-
data() {
|
|
37
|
-
return {
|
|
38
|
-
value: this.args.value,
|
|
39
|
-
};
|
|
40
|
-
},
|
|
41
37
|
template: `
|
|
42
|
-
<UDatePicker v-bind="args" v-model="
|
|
38
|
+
<UDatePicker v-bind="args" v-model="args.modelValue">
|
|
43
39
|
${args.slotTemplate || getSlotsFragment()}
|
|
44
40
|
</UDatePicker>
|
|
45
41
|
|
|
46
42
|
<div class="mt-4">
|
|
47
|
-
{{
|
|
43
|
+
{{ args.modelValue }}
|
|
48
44
|
</div>
|
|
49
45
|
`,
|
|
50
46
|
});
|
|
@@ -84,7 +80,7 @@ const OpenDirectionTemplate = (args) => ({
|
|
|
84
80
|
open-direction-y="top"
|
|
85
81
|
open-direction-x="left"
|
|
86
82
|
v-bind="args"
|
|
87
|
-
v-model="args.
|
|
83
|
+
v-model="args.modelValue"
|
|
88
84
|
label="Top Left"
|
|
89
85
|
/>
|
|
90
86
|
<UDatePicker
|
|
@@ -92,7 +88,7 @@ const OpenDirectionTemplate = (args) => ({
|
|
|
92
88
|
open-direction-y="top"
|
|
93
89
|
open-direction-x="right"
|
|
94
90
|
v-bind="args"
|
|
95
|
-
v-model="args.
|
|
91
|
+
v-model="args.modelValue"
|
|
96
92
|
label="Top Right"
|
|
97
93
|
/>
|
|
98
94
|
<UDatePicker
|
|
@@ -100,7 +96,7 @@ const OpenDirectionTemplate = (args) => ({
|
|
|
100
96
|
open-direction-y="bottom"
|
|
101
97
|
open-direction-x="left"
|
|
102
98
|
v-bind="args"
|
|
103
|
-
v-model="args.
|
|
99
|
+
v-model="args.modelValue"
|
|
104
100
|
label="Bottom Left"
|
|
105
101
|
/>
|
|
106
102
|
<UDatePicker
|
|
@@ -108,7 +104,7 @@ const OpenDirectionTemplate = (args) => ({
|
|
|
108
104
|
open-direction-y="bottom"
|
|
109
105
|
open-direction-x="right"
|
|
110
106
|
v-bind="args"
|
|
111
|
-
v-model="args.
|
|
107
|
+
v-model="args.modelValue"
|
|
112
108
|
label="Bottom Right"
|
|
113
109
|
/>
|
|
114
110
|
</URow>
|
|
@@ -116,7 +112,7 @@ const OpenDirectionTemplate = (args) => ({
|
|
|
116
112
|
});
|
|
117
113
|
|
|
118
114
|
export const Default = DefaultTemplate.bind({});
|
|
119
|
-
Default.args = {
|
|
115
|
+
Default.args = { modelValue: new Date() };
|
|
120
116
|
|
|
121
117
|
export const sizes = EnumVariantTemplate.bind({});
|
|
122
118
|
sizes.args = { enum: "size", label: "" };
|
|
@@ -137,16 +133,16 @@ export const placeholder = DefaultTemplate.bind({});
|
|
|
137
133
|
placeholder.args = { placeholder: "some placeholder" };
|
|
138
134
|
|
|
139
135
|
export const DateFormat = DefaultTemplate.bind({});
|
|
140
|
-
DateFormat.args = { dateFormat: "d.m.Y", userFormat: "d.m.Y",
|
|
136
|
+
DateFormat.args = { dateFormat: "d.m.Y", userFormat: "d.m.Y", modelValue: "28.06.2024" };
|
|
141
137
|
|
|
142
138
|
export const Timepicker = DefaultTemplate.bind({});
|
|
143
|
-
Timepicker.args = { timepicker: true,
|
|
139
|
+
Timepicker.args = { timepicker: true, modelValue: new Date(2024, 2, 14, 12, 24, 14) };
|
|
144
140
|
|
|
145
141
|
export const MinMax = DefaultTemplate.bind({});
|
|
146
142
|
MinMax.args = {
|
|
147
143
|
minDate: new Date(2022, 2, 22),
|
|
148
144
|
maxDate: new Date(2022, 2, 26),
|
|
149
|
-
|
|
145
|
+
modelValue: new Date(2022, 2, 24),
|
|
150
146
|
};
|
|
151
147
|
|
|
152
148
|
export const slotIcon = DefaultTemplate.bind({});
|
|
@@ -29,7 +29,7 @@ const DefaultTemplate = (args) => ({
|
|
|
29
29
|
};
|
|
30
30
|
},
|
|
31
31
|
template: `
|
|
32
|
-
<UInputNumber v-
|
|
32
|
+
<UInputNumber v-bind="args" v-model="count">
|
|
33
33
|
${args.slotTemplate || getSlotsFragment()}
|
|
34
34
|
</UInputNumber>
|
|
35
35
|
`,
|
|
@@ -56,11 +56,11 @@ const EnumVariantTemplate = (args, { argTypes } = {}) => ({
|
|
|
56
56
|
<UCol gap="xl">
|
|
57
57
|
<UInputNumber
|
|
58
58
|
v-for="(option, index) in options"
|
|
59
|
+
:key="index"
|
|
59
60
|
v-bind="args"
|
|
61
|
+
v-model="sizeValues[index].count"
|
|
60
62
|
:[args.enum]="option"
|
|
61
|
-
:key="index"
|
|
62
63
|
:label="sizeValues[index].label"
|
|
63
|
-
v-model="sizeValues[index].count"
|
|
64
64
|
/>
|
|
65
65
|
</UCol>
|
|
66
66
|
`,
|
|
@@ -42,10 +42,10 @@ const EnumVariantTemplate = (args, { argTypes } = {}) => ({
|
|
|
42
42
|
<URow>
|
|
43
43
|
<UInputSearch
|
|
44
44
|
v-for="(option, index) in options"
|
|
45
|
+
:key="index"
|
|
45
46
|
v-bind="args"
|
|
46
47
|
v-model="args.modelValue"
|
|
47
48
|
:[args.enum]="option"
|
|
48
|
-
:key="index"
|
|
49
49
|
>
|
|
50
50
|
</UInputSearch>
|
|
51
51
|
</URow>
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import ULabel from "../ui.form-label";
|
|
2
|
-
import URow from "../ui.container-row";
|
|
3
2
|
import UCol from "../ui.container-col";
|
|
4
3
|
import UText from "../ui.text-block";
|
|
5
4
|
import UIcon from "../ui.image-icon";
|
|
6
5
|
|
|
7
|
-
import { getArgTypes } from "../service.storybook";
|
|
6
|
+
import { getArgTypes, getSlotNames, getSlotsFragment } from "../service.storybook";
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* The `ULabel` component. | [View on GitHub](https://github.com/vuelessjs/vueless/tree/main/src/ui.form-label)
|
|
@@ -22,73 +21,51 @@ export default {
|
|
|
22
21
|
},
|
|
23
22
|
};
|
|
24
23
|
|
|
25
|
-
const
|
|
24
|
+
const defaultTemplate = "This is plain text";
|
|
26
25
|
|
|
27
26
|
const DefaultTemplate = (args) => ({
|
|
28
|
-
components: { ULabel, UText },
|
|
29
|
-
setup() {
|
|
30
|
-
return { args };
|
|
31
|
-
},
|
|
32
|
-
template: `
|
|
33
|
-
<ULabel v-bind="args">
|
|
34
|
-
<UText v-bind="args">${message}</UText>
|
|
35
|
-
</ULabel>
|
|
36
|
-
`,
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
const SlotTemplate = (args) => ({
|
|
40
27
|
components: { ULabel, UText, UIcon },
|
|
41
28
|
setup() {
|
|
42
|
-
|
|
29
|
+
const slots = getSlotNames(ULabel.name);
|
|
30
|
+
|
|
31
|
+
return { args, slots };
|
|
43
32
|
},
|
|
44
33
|
template: `
|
|
45
34
|
<ULabel v-bind="args">
|
|
46
|
-
<UText v-bind="args">${
|
|
47
|
-
${args.slotTemplate}
|
|
35
|
+
<UText v-bind="args">${getSlotsFragment(defaultTemplate)}</UText>
|
|
36
|
+
${args.slotTemplate ? args.slotTemplate : ""}
|
|
48
37
|
</ULabel>
|
|
49
38
|
`,
|
|
50
39
|
});
|
|
51
40
|
|
|
52
|
-
const
|
|
53
|
-
components: { ULabel, URow, UText },
|
|
54
|
-
setup() {
|
|
55
|
-
return {
|
|
56
|
-
args,
|
|
57
|
-
sizes: argTypes.size.options,
|
|
58
|
-
};
|
|
59
|
-
},
|
|
60
|
-
template: `
|
|
61
|
-
<URow>
|
|
62
|
-
<ULabel
|
|
63
|
-
v-for="(size, index) in sizes"
|
|
64
|
-
v-bind="args"
|
|
65
|
-
:size="size"
|
|
66
|
-
:key="index"
|
|
67
|
-
>
|
|
68
|
-
<UText :size="size">This is <b>"{{ size }}"</b> size.</UText>
|
|
69
|
-
</ULabel>
|
|
70
|
-
</URow>
|
|
71
|
-
`,
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
const LabelPlacementTemplate = (args, { argTypes } = {}) => ({
|
|
41
|
+
const EnumVariantTemplate = (args, { argTypes } = {}) => ({
|
|
75
42
|
components: { ULabel, UCol, UText },
|
|
76
43
|
setup() {
|
|
44
|
+
function getText(value, name) {
|
|
45
|
+
return name === "size" ? `This is ${value} size.` : `This is ${value} label placement.`;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const { name, options } = argTypes[args.enum];
|
|
49
|
+
const prefixedOptions = options.map((option) => getText(option, name));
|
|
50
|
+
|
|
77
51
|
return {
|
|
78
52
|
args,
|
|
79
|
-
|
|
53
|
+
options: argTypes[args.enum].options,
|
|
54
|
+
prefixedOptions,
|
|
80
55
|
};
|
|
81
56
|
},
|
|
82
57
|
template: `
|
|
83
58
|
<UCol>
|
|
84
59
|
<ULabel
|
|
85
|
-
v-for="(
|
|
86
|
-
v-bind="args"
|
|
87
|
-
:align="align"
|
|
60
|
+
v-for="(option, index) in options"
|
|
88
61
|
:key="index"
|
|
62
|
+
v-bind="args"
|
|
63
|
+
:[args.enum]="option"
|
|
89
64
|
class="border border-gray-200 rounded p-4"
|
|
90
65
|
>
|
|
91
|
-
<UText
|
|
66
|
+
<UText :[args.enum]="option">
|
|
67
|
+
{{ prefixedOptions[index] }}
|
|
68
|
+
</UText>
|
|
92
69
|
</ULabel>
|
|
93
70
|
</UCol>
|
|
94
71
|
`,
|
|
@@ -97,11 +74,11 @@ const LabelPlacementTemplate = (args, { argTypes } = {}) => ({
|
|
|
97
74
|
export const Default = DefaultTemplate.bind({});
|
|
98
75
|
Default.args = {};
|
|
99
76
|
|
|
100
|
-
export const Sizes =
|
|
101
|
-
Sizes.args = {};
|
|
77
|
+
export const Sizes = EnumVariantTemplate.bind({});
|
|
78
|
+
Sizes.args = { enum: "size" };
|
|
102
79
|
|
|
103
|
-
export const LabelPlacement =
|
|
104
|
-
LabelPlacement.args = {};
|
|
80
|
+
export const LabelPlacement = EnumVariantTemplate.bind({});
|
|
81
|
+
LabelPlacement.args = { enum: "align" };
|
|
105
82
|
|
|
106
83
|
export const Error = DefaultTemplate.bind({});
|
|
107
84
|
Error.args = { error: "Error description" };
|
|
@@ -109,7 +86,7 @@ Error.args = { error: "Error description" };
|
|
|
109
86
|
export const Disabled = DefaultTemplate.bind({});
|
|
110
87
|
Disabled.args = { disabled: true };
|
|
111
88
|
|
|
112
|
-
export const slotFooter =
|
|
89
|
+
export const slotFooter = DefaultTemplate.bind({});
|
|
113
90
|
slotFooter.args = {
|
|
114
91
|
slotTemplate: `
|
|
115
92
|
<template #footer>
|
|
@@ -13,7 +13,9 @@ export default {
|
|
|
13
13
|
id: "3160",
|
|
14
14
|
title: "Form Inputs & Controls / Radio Group",
|
|
15
15
|
component: URadioGroup,
|
|
16
|
-
args: {
|
|
16
|
+
args: {
|
|
17
|
+
modelValue: "One",
|
|
18
|
+
},
|
|
17
19
|
argTypes: {
|
|
18
20
|
...getArgTypes(URadioGroup.name),
|
|
19
21
|
},
|
|
@@ -36,14 +38,9 @@ const DefaultTemplate = (args) => ({
|
|
|
36
38
|
|
|
37
39
|
return { args, slots, radios };
|
|
38
40
|
},
|
|
39
|
-
data() {
|
|
40
|
-
return {
|
|
41
|
-
value: args.value,
|
|
42
|
-
};
|
|
43
|
-
},
|
|
44
41
|
template: `
|
|
45
42
|
<UCol gap="2xl">
|
|
46
|
-
<URadioGroup v-bind="args" v-model="
|
|
43
|
+
<URadioGroup v-bind="args" v-model="args.modelValue">
|
|
47
44
|
<URadio
|
|
48
45
|
v-for="(radio, index) in radios"
|
|
49
46
|
:key="index"
|
|
@@ -53,7 +50,7 @@ const DefaultTemplate = (args) => ({
|
|
|
53
50
|
</URadio>
|
|
54
51
|
</URadioGroup>
|
|
55
52
|
<UAlert color="gray" size="xs">
|
|
56
|
-
<code>Selected value: <b>{{
|
|
53
|
+
<code>Selected value: <b>{{ args.modelValue }}</b></code>
|
|
57
54
|
</UAlert>
|
|
58
55
|
</UCol>
|
|
59
56
|
`,
|
|
@@ -70,18 +67,13 @@ const EnumVariantTemplate = (args, { argTypes } = {}) => ({
|
|
|
70
67
|
radios,
|
|
71
68
|
};
|
|
72
69
|
},
|
|
73
|
-
data() {
|
|
74
|
-
return {
|
|
75
|
-
value: args.value,
|
|
76
|
-
};
|
|
77
|
-
},
|
|
78
70
|
template: `
|
|
79
71
|
<URow class="!flex-col">
|
|
80
72
|
<URadioGroup
|
|
81
73
|
v-for="(option, index) in options"
|
|
82
74
|
:key="index"
|
|
83
75
|
v-bind="args"
|
|
84
|
-
v-model="
|
|
76
|
+
v-model="args.modelValue"
|
|
85
77
|
:[args.enum]="option"
|
|
86
78
|
:label="option"
|
|
87
79
|
:options="radios"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getArgTypes, getSlotNames,
|
|
1
|
+
import { getArgTypes, getSlotNames, getSlotsFragment } from "../service.storybook";
|
|
2
2
|
|
|
3
3
|
import USelect from "../ui.form-select";
|
|
4
4
|
import URow from "../ui.container-row";
|
|
@@ -36,66 +36,42 @@ export default {
|
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
const DefaultTemplate = (args) => ({
|
|
39
|
-
components: { USelect },
|
|
39
|
+
components: { USelect, UIcon, UBadge },
|
|
40
40
|
setup() {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
},
|
|
45
|
-
template: `
|
|
46
|
-
<USelect v-bind="args" v-model="args.modelValue">
|
|
47
|
-
${allSlotsFragment}
|
|
48
|
-
</USelect>
|
|
49
|
-
`,
|
|
50
|
-
});
|
|
41
|
+
function getSelectedBadge(options, currentValue) {
|
|
42
|
+
return options?.find((option) => option.id === currentValue);
|
|
43
|
+
}
|
|
51
44
|
|
|
52
|
-
const multipleTemplate = (args) => ({
|
|
53
|
-
components: { USelect },
|
|
54
|
-
setup() {
|
|
55
45
|
const slots = getSlotNames(USelect.name);
|
|
56
46
|
|
|
57
|
-
return { args, slots };
|
|
47
|
+
return { args, slots, getSelectedBadge };
|
|
58
48
|
},
|
|
59
49
|
template: `
|
|
60
|
-
<USelect v-bind="args"
|
|
61
|
-
|
|
62
|
-
<template v-if="args[slot]">{{ args[slot] }}</template>
|
|
63
|
-
</template>
|
|
50
|
+
<USelect v-bind="args" v-model="args.modelValue">
|
|
51
|
+
${args.slotTemplate || getSlotsFragment()}
|
|
64
52
|
</USelect>
|
|
65
53
|
`,
|
|
66
54
|
});
|
|
67
55
|
|
|
68
|
-
const
|
|
56
|
+
const EnumVariantTemplate = (args, { argTypes } = {}) => ({
|
|
69
57
|
components: { USelect, URow },
|
|
70
58
|
setup() {
|
|
71
59
|
return {
|
|
72
60
|
args,
|
|
73
|
-
|
|
61
|
+
options: argTypes[args.enum].options,
|
|
74
62
|
};
|
|
75
63
|
},
|
|
76
64
|
template: `
|
|
77
|
-
<
|
|
78
|
-
<
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
</URow>
|
|
88
|
-
<URow>
|
|
89
|
-
<USelect
|
|
90
|
-
v-for="(openDirection, index) in openDirections"
|
|
91
|
-
:key="index"
|
|
92
|
-
v-bind="args"
|
|
93
|
-
:open-direction="openDirection"
|
|
94
|
-
v-model="args.modelValue"
|
|
95
|
-
label=""
|
|
96
|
-
/>
|
|
97
|
-
</URow>
|
|
98
|
-
</div>
|
|
65
|
+
<URow>
|
|
66
|
+
<USelect
|
|
67
|
+
v-for="(option, index) in options"
|
|
68
|
+
:key="index"
|
|
69
|
+
v-bind="args"
|
|
70
|
+
v-model="args.modelValue"
|
|
71
|
+
:[args.enum]="option"
|
|
72
|
+
:label="option"
|
|
73
|
+
/>
|
|
74
|
+
</URow>
|
|
99
75
|
`,
|
|
100
76
|
});
|
|
101
77
|
|
|
@@ -109,8 +85,8 @@ const GroupValuesTemplate = (args) => ({
|
|
|
109
85
|
template: `
|
|
110
86
|
<USelect
|
|
111
87
|
v-bind="args"
|
|
112
|
-
label="Single"
|
|
113
88
|
v-model="args.modelValue"
|
|
89
|
+
label="Single"
|
|
114
90
|
/>
|
|
115
91
|
<USelect
|
|
116
92
|
class="mt-5"
|
|
@@ -122,104 +98,14 @@ const GroupValuesTemplate = (args) => ({
|
|
|
122
98
|
`,
|
|
123
99
|
});
|
|
124
100
|
|
|
125
|
-
const SizesTemplate = (args, { argTypes } = {}) => ({
|
|
126
|
-
components: { USelect, URow },
|
|
127
|
-
setup() {
|
|
128
|
-
return {
|
|
129
|
-
args,
|
|
130
|
-
sizes: argTypes.size.options,
|
|
131
|
-
};
|
|
132
|
-
},
|
|
133
|
-
template: `
|
|
134
|
-
<div class="flex flex-col gap-6">
|
|
135
|
-
<URow>
|
|
136
|
-
<USelect
|
|
137
|
-
v-for="(size, index) in sizes"
|
|
138
|
-
v-bind="args"
|
|
139
|
-
:key="index"
|
|
140
|
-
:size="size"
|
|
141
|
-
:label="size"
|
|
142
|
-
v-model="args.modelValue"
|
|
143
|
-
/>
|
|
144
|
-
</URow>
|
|
145
|
-
<URow>
|
|
146
|
-
<USelect
|
|
147
|
-
v-for="(size, index) in sizes"
|
|
148
|
-
v-bind="args"
|
|
149
|
-
:key="index"
|
|
150
|
-
:size="size"
|
|
151
|
-
:label="size"
|
|
152
|
-
label-outside
|
|
153
|
-
v-model="args.modelValue"
|
|
154
|
-
/>
|
|
155
|
-
</URow>
|
|
156
|
-
<URow>
|
|
157
|
-
<USelect
|
|
158
|
-
v-for="(size, index) in sizes"
|
|
159
|
-
v-bind="args"
|
|
160
|
-
:key="index"
|
|
161
|
-
:label="size"
|
|
162
|
-
:size="size"
|
|
163
|
-
multiple
|
|
164
|
-
v-model="args.multipleModelValue"
|
|
165
|
-
/>
|
|
166
|
-
</URow>
|
|
167
|
-
</div>
|
|
168
|
-
`,
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
const SlotTemplate = (args) => ({
|
|
172
|
-
components: { USelect, UIcon },
|
|
173
|
-
setup() {
|
|
174
|
-
return { args };
|
|
175
|
-
},
|
|
176
|
-
template: `
|
|
177
|
-
<USelect
|
|
178
|
-
v-bind="args"
|
|
179
|
-
v-model="args.modelValue"
|
|
180
|
-
>
|
|
181
|
-
${args.slotTemplate}
|
|
182
|
-
</USelect>
|
|
183
|
-
`,
|
|
184
|
-
});
|
|
185
|
-
|
|
186
|
-
const BadgeTemplate = (args) => ({
|
|
187
|
-
components: { USelect, UBadge },
|
|
188
|
-
setup() {
|
|
189
|
-
return { args };
|
|
190
|
-
},
|
|
191
|
-
methods: {
|
|
192
|
-
getSelectedBadge(options, currentValue) {
|
|
193
|
-
return options?.find((option) => option.id === currentValue);
|
|
194
|
-
},
|
|
195
|
-
},
|
|
196
|
-
template: `
|
|
197
|
-
<USelect
|
|
198
|
-
v-bind="args"
|
|
199
|
-
v-model="args.modelValue"
|
|
200
|
-
>
|
|
201
|
-
<template #after-caret="{ scopeProps }">
|
|
202
|
-
<UBadge
|
|
203
|
-
v-show="scopeProps?.modelValue"
|
|
204
|
-
:label="getSelectedBadge(scopeProps?.options, scopeProps?.modelValue)?.badge"
|
|
205
|
-
/>
|
|
206
|
-
</template>
|
|
207
|
-
<template #option="{ option }">
|
|
208
|
-
{{ option.label }}
|
|
209
|
-
<UBadge :label="option.badge" />
|
|
210
|
-
</template>
|
|
211
|
-
</USelect>
|
|
212
|
-
`,
|
|
213
|
-
});
|
|
214
|
-
|
|
215
101
|
export const Default = DefaultTemplate.bind({});
|
|
216
102
|
Default.args = {};
|
|
217
103
|
|
|
218
|
-
export const Multiple =
|
|
219
|
-
Multiple.args = { modelValue: [] };
|
|
104
|
+
export const Multiple = DefaultTemplate.bind({});
|
|
105
|
+
Multiple.args = { multiple: true, modelValue: [] };
|
|
220
106
|
|
|
221
|
-
export const openDirection =
|
|
222
|
-
openDirection.args = {};
|
|
107
|
+
export const openDirection = EnumVariantTemplate.bind({});
|
|
108
|
+
openDirection.args = { enum: "openDirection" };
|
|
223
109
|
|
|
224
110
|
export const groupValue = GroupValuesTemplate.bind({});
|
|
225
111
|
groupValue.args = {
|
|
@@ -280,53 +166,70 @@ optionIsHidden.args = {
|
|
|
280
166
|
],
|
|
281
167
|
};
|
|
282
168
|
|
|
283
|
-
export const sizes =
|
|
284
|
-
sizes.args = {
|
|
169
|
+
export const sizes = EnumVariantTemplate.bind({});
|
|
170
|
+
sizes.args = {
|
|
171
|
+
enum: "size",
|
|
172
|
+
multiple: true,
|
|
173
|
+
multipleModelValue: [],
|
|
174
|
+
};
|
|
285
175
|
|
|
286
|
-
export const slotSelectedValueLabel =
|
|
176
|
+
export const slotSelectedValueLabel = DefaultTemplate.bind({});
|
|
287
177
|
slotSelectedValueLabel.args = {
|
|
288
178
|
slotTemplate: `
|
|
289
179
|
<template #selected-label>
|
|
290
|
-
|
|
180
|
+
🤘🤘🤘
|
|
291
181
|
</template>
|
|
292
182
|
`,
|
|
293
183
|
};
|
|
294
184
|
|
|
295
|
-
export const slotSelectedValueLabelAfter =
|
|
185
|
+
export const slotSelectedValueLabelAfter = DefaultTemplate.bind({});
|
|
296
186
|
slotSelectedValueLabelAfter.args = {
|
|
297
187
|
slotTemplate: `
|
|
298
188
|
<template #selected-label-after>
|
|
299
|
-
|
|
189
|
+
🤘🤘🤘
|
|
300
190
|
</template>
|
|
301
191
|
`,
|
|
302
192
|
};
|
|
303
193
|
|
|
304
|
-
export const slotOption =
|
|
194
|
+
export const slotOption = DefaultTemplate.bind({});
|
|
305
195
|
slotOption.args = {
|
|
306
196
|
slotTemplate: `
|
|
307
197
|
<template #option>
|
|
308
|
-
|
|
198
|
+
🤘🤘🤘
|
|
309
199
|
</template>
|
|
310
200
|
`,
|
|
311
201
|
};
|
|
312
202
|
|
|
313
|
-
export const slotAfterCaret =
|
|
314
|
-
slotAfterCaret.args = {
|
|
203
|
+
export const slotAfterCaret = DefaultTemplate.bind({});
|
|
204
|
+
slotAfterCaret.args = {
|
|
205
|
+
slotTemplate: `
|
|
206
|
+
<template #after-caret="{ scopeProps }">
|
|
207
|
+
<UBadge
|
|
208
|
+
v-show="scopeProps?.modelValue"
|
|
209
|
+
:label="getSelectedBadge(scopeProps?.options, scopeProps?.modelValue)?.badge"
|
|
210
|
+
/>
|
|
211
|
+
</template>
|
|
212
|
+
<template #option="{ option }">
|
|
213
|
+
{{ option.label }}
|
|
214
|
+
<UBadge :label="option.badge" />
|
|
215
|
+
</template>
|
|
216
|
+
`,
|
|
217
|
+
};
|
|
315
218
|
|
|
316
|
-
export const slotBeforeCaret =
|
|
219
|
+
export const slotBeforeCaret = DefaultTemplate.bind({});
|
|
317
220
|
slotBeforeCaret.args = {
|
|
318
221
|
slotTemplate: `
|
|
319
222
|
<template #before-caret>
|
|
320
|
-
|
|
223
|
+
🤘
|
|
321
224
|
</template>
|
|
322
225
|
`,
|
|
323
226
|
};
|
|
324
227
|
|
|
325
|
-
export const slotBeforeOption =
|
|
228
|
+
export const slotBeforeOption = DefaultTemplate.bind({});
|
|
326
229
|
slotBeforeOption.args = {
|
|
327
230
|
slotTemplate: `
|
|
328
231
|
<template #before-option>
|
|
329
|
-
|
|
232
|
+
🤘
|
|
330
233
|
</template>
|
|
331
234
|
`,
|
|
332
235
|
};
|
|
@@ -341,7 +244,7 @@ iconRight.args = {
|
|
|
341
244
|
iconRight: "star",
|
|
342
245
|
};
|
|
343
246
|
|
|
344
|
-
export const iconLeftSlot =
|
|
247
|
+
export const iconLeftSlot = DefaultTemplate.bind({});
|
|
345
248
|
iconLeftSlot.args = {
|
|
346
249
|
slotTemplate: `
|
|
347
250
|
<template #icon-left>
|
|
@@ -350,7 +253,7 @@ iconLeftSlot.args = {
|
|
|
350
253
|
`,
|
|
351
254
|
};
|
|
352
255
|
|
|
353
|
-
export const iconRightSlot =
|
|
256
|
+
export const iconRightSlot = DefaultTemplate.bind({});
|
|
354
257
|
iconRightSlot.args = {
|
|
355
258
|
slotTemplate: `
|
|
356
259
|
<template #icon-right>
|
|
@@ -359,20 +262,20 @@ iconRightSlot.args = {
|
|
|
359
262
|
`,
|
|
360
263
|
};
|
|
361
264
|
|
|
362
|
-
export const slotLeft =
|
|
265
|
+
export const slotLeft = DefaultTemplate.bind({});
|
|
363
266
|
slotLeft.args = {
|
|
364
267
|
slotTemplate: `
|
|
365
268
|
<template #left>
|
|
366
|
-
|
|
269
|
+
🤘
|
|
367
270
|
</template>
|
|
368
271
|
`,
|
|
369
272
|
};
|
|
370
273
|
|
|
371
|
-
export const slotRight =
|
|
274
|
+
export const slotRight = DefaultTemplate.bind({});
|
|
372
275
|
slotRight.args = {
|
|
373
276
|
slotTemplate: `
|
|
374
277
|
<template #right>
|
|
375
|
-
|
|
278
|
+
🤘
|
|
376
279
|
</template>
|
|
377
280
|
`,
|
|
378
281
|
};
|