vueless 0.0.247 → 0.0.249
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.data-list/index.stories.js +10 -28
- package/ui.data-table/index.stories.js +10 -35
- package/ui.image-avatar/index.stories.js +22 -73
- package/ui.image-icon/index.stories.js +18 -57
- package/ui.loader/index.stories.js +23 -42
- package/ui.loader-rendering/index.stories.js +12 -9
- package/ui.loader-top/index.stories.js +18 -9
- package/ui.other-dot/index.stories.js +20 -29
- package/ui.text-alert/configs/default.config.js +1 -1
- package/ui.text-alert/index.stories.js +8 -9
- package/ui.text-money/index.stories.js +1 -5
- package/web-types.json +1 -1
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getArgTypes, getSlotNames,
|
|
1
|
+
import { getArgTypes, getSlotNames, getSlotsFragment } from "../service.storybook";
|
|
2
2
|
|
|
3
3
|
import UDataList from "../ui.data-list";
|
|
4
4
|
import UIcon from "../ui.image-icon";
|
|
@@ -42,39 +42,21 @@ export default {
|
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
const DefaultTemplate = (args) => ({
|
|
45
|
-
components: { UDataList },
|
|
45
|
+
components: { UDataList, UIcon, URow },
|
|
46
46
|
setup() {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
return { args, slots };
|
|
50
|
-
},
|
|
51
|
-
template: `
|
|
52
|
-
<UDataList v-bind="args" @dragSort="onDragSort">
|
|
53
|
-
${allSlotsFragment}
|
|
54
|
-
</UDataList>
|
|
55
|
-
`,
|
|
56
|
-
methods: {
|
|
57
|
-
onDragSort(value) {
|
|
47
|
+
function onDragSort(value) {
|
|
58
48
|
this.list = value;
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
});
|
|
49
|
+
}
|
|
62
50
|
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
return { args };
|
|
51
|
+
const slots = getSlotNames(UDataList.name);
|
|
52
|
+
|
|
53
|
+
return { args, slots, onDragSort };
|
|
67
54
|
},
|
|
68
55
|
template: `
|
|
69
56
|
<UDataList v-bind="args" @dragSort="onDragSort">
|
|
70
|
-
${args.slotTemplate}
|
|
57
|
+
${args.slotTemplate || getSlotsFragment()}
|
|
71
58
|
</UDataList>
|
|
72
59
|
`,
|
|
73
|
-
methods: {
|
|
74
|
-
onDragSort(value) {
|
|
75
|
-
this.list = value;
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
60
|
});
|
|
79
61
|
|
|
80
62
|
export const Default = DefaultTemplate.bind({});
|
|
@@ -90,7 +72,7 @@ emptyState.args = {
|
|
|
90
72
|
export const nesting = DefaultTemplate.bind({});
|
|
91
73
|
nesting.args = { nesting: true };
|
|
92
74
|
|
|
93
|
-
export const slotLabel =
|
|
75
|
+
export const slotLabel = DefaultTemplate.bind({});
|
|
94
76
|
slotLabel.args = {
|
|
95
77
|
slotTemplate: `
|
|
96
78
|
<template #label="{ item }">
|
|
@@ -102,7 +84,7 @@ slotLabel.args = {
|
|
|
102
84
|
`,
|
|
103
85
|
};
|
|
104
86
|
|
|
105
|
-
export const slotActions =
|
|
87
|
+
export const slotActions = DefaultTemplate.bind({});
|
|
106
88
|
slotActions.args = {
|
|
107
89
|
slotTemplate: `
|
|
108
90
|
<template #actions>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getArgTypes, getSlotNames } from "../service.storybook";
|
|
1
|
+
import { getArgTypes, getSlotNames, getSlotsFragment } from "../service.storybook";
|
|
2
2
|
import { getRandomId } from "../service.ui";
|
|
3
3
|
|
|
4
4
|
import UTable from "../ui.data-table";
|
|
@@ -157,7 +157,7 @@ function getRow() {
|
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
const DefaultTemplate = (args) => ({
|
|
160
|
-
components: { UTable },
|
|
160
|
+
components: { UTable, UButton, ULink, UMoney, UBadge, URow },
|
|
161
161
|
setup() {
|
|
162
162
|
const slots = getSlotNames(UTable.name);
|
|
163
163
|
|
|
@@ -168,6 +168,7 @@ const DefaultTemplate = (args) => ({
|
|
|
168
168
|
v-bind="args"
|
|
169
169
|
:rows="itemsData"
|
|
170
170
|
>
|
|
171
|
+
${args.slotTemplate || getSlotsFragment()}
|
|
171
172
|
</UTable>
|
|
172
173
|
`,
|
|
173
174
|
computed: {
|
|
@@ -195,32 +196,6 @@ const EmptyTemplate = (args) => ({
|
|
|
195
196
|
`,
|
|
196
197
|
});
|
|
197
198
|
|
|
198
|
-
const SlotTemplate = (args) => ({
|
|
199
|
-
components: { UTable, UButton, ULink, UMoney, UBadge, URow },
|
|
200
|
-
setup() {
|
|
201
|
-
return { args };
|
|
202
|
-
},
|
|
203
|
-
template: `
|
|
204
|
-
<UTable
|
|
205
|
-
v-bind="args"
|
|
206
|
-
:rows="itemsData"
|
|
207
|
-
>
|
|
208
|
-
${args.slotTemplate}
|
|
209
|
-
</UTable>
|
|
210
|
-
`,
|
|
211
|
-
computed: {
|
|
212
|
-
itemsData() {
|
|
213
|
-
let rows = [];
|
|
214
|
-
|
|
215
|
-
for (let i = 0; i < args.numberOfRows; i++) {
|
|
216
|
-
rows.push(args.row());
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
return rows;
|
|
220
|
-
},
|
|
221
|
-
},
|
|
222
|
-
});
|
|
223
|
-
|
|
224
199
|
export const Default = DefaultTemplate.bind({});
|
|
225
200
|
Default.args = {};
|
|
226
201
|
|
|
@@ -247,7 +222,7 @@ stickyHeader.args = {
|
|
|
247
222
|
stickyHeader: true,
|
|
248
223
|
};
|
|
249
224
|
|
|
250
|
-
export const stickyFooter =
|
|
225
|
+
export const stickyFooter = DefaultTemplate.bind({});
|
|
251
226
|
stickyFooter.parameters = STICKY_PARAMETERS;
|
|
252
227
|
stickyFooter.args = {
|
|
253
228
|
numberOfRows: 50,
|
|
@@ -281,7 +256,7 @@ DateDividerCustomLabel.args = {
|
|
|
281
256
|
],
|
|
282
257
|
};
|
|
283
258
|
|
|
284
|
-
export const slotDefault =
|
|
259
|
+
export const slotDefault = DefaultTemplate.bind({});
|
|
285
260
|
slotDefault.args = {
|
|
286
261
|
slotTemplate: `
|
|
287
262
|
<template #cell-key_3="{value}">
|
|
@@ -290,7 +265,7 @@ slotDefault.args = {
|
|
|
290
265
|
`,
|
|
291
266
|
};
|
|
292
267
|
|
|
293
|
-
export const slotHeaderActions =
|
|
268
|
+
export const slotHeaderActions = DefaultTemplate.bind({});
|
|
294
269
|
slotHeaderActions.args = {
|
|
295
270
|
numberOfRows: 50,
|
|
296
271
|
stickyHeader: true,
|
|
@@ -316,7 +291,7 @@ slotHeaderActions.args = {
|
|
|
316
291
|
`,
|
|
317
292
|
};
|
|
318
293
|
|
|
319
|
-
export const slotBeforeFirstRow =
|
|
294
|
+
export const slotBeforeFirstRow = DefaultTemplate.bind({});
|
|
320
295
|
slotBeforeFirstRow.args = {
|
|
321
296
|
slotTemplate: `
|
|
322
297
|
<template #before-first-row>
|
|
@@ -330,7 +305,7 @@ slotBeforeFirstRow.args = {
|
|
|
330
305
|
`,
|
|
331
306
|
};
|
|
332
307
|
|
|
333
|
-
export const slotAfterLastRow =
|
|
308
|
+
export const slotAfterLastRow = DefaultTemplate.bind({});
|
|
334
309
|
slotAfterLastRow.args = {
|
|
335
310
|
slotTemplate: `
|
|
336
311
|
<template #after-last-row>
|
|
@@ -344,7 +319,7 @@ slotAfterLastRow.args = {
|
|
|
344
319
|
`,
|
|
345
320
|
};
|
|
346
321
|
|
|
347
|
-
export const slotFooter =
|
|
322
|
+
export const slotFooter = DefaultTemplate.bind({});
|
|
348
323
|
slotFooter.args = {
|
|
349
324
|
slotTemplate: `
|
|
350
325
|
<template #footer>
|
|
@@ -360,7 +335,7 @@ slotFooter.args = {
|
|
|
360
335
|
`,
|
|
361
336
|
};
|
|
362
337
|
|
|
363
|
-
export const cellSlots =
|
|
338
|
+
export const cellSlots = DefaultTemplate.bind({});
|
|
364
339
|
cellSlots.args = {
|
|
365
340
|
columns: [
|
|
366
341
|
{ key: "link", label: "link" },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getArgTypes } from "../service.storybook";
|
|
1
|
+
import { getArgTypes, getSlotNames, getSlotsFragment } from "../service.storybook";
|
|
2
2
|
|
|
3
3
|
import UAvatar from "../ui.image-avatar";
|
|
4
4
|
import URow from "../ui.container-row";
|
|
@@ -19,94 +19,43 @@ export default {
|
|
|
19
19
|
const DefaultTemplate = (args) => ({
|
|
20
20
|
components: { UAvatar },
|
|
21
21
|
setup() {
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
template: `
|
|
25
|
-
<UAvatar v-bind="args" />
|
|
26
|
-
`,
|
|
27
|
-
});
|
|
22
|
+
const slots = getSlotNames(UAvatar.name);
|
|
28
23
|
|
|
29
|
-
|
|
30
|
-
components: { UCol, URow, UAvatar },
|
|
31
|
-
setup() {
|
|
32
|
-
return {
|
|
33
|
-
args,
|
|
34
|
-
sizes: argTypes.size.options,
|
|
35
|
-
};
|
|
24
|
+
return { args, slots };
|
|
36
25
|
},
|
|
37
26
|
template: `
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
v-for="(size, index) in sizes"
|
|
42
|
-
:key="index"
|
|
43
|
-
v-bind="args"
|
|
44
|
-
:size="size"
|
|
45
|
-
:label="size"
|
|
46
|
-
/>
|
|
47
|
-
</URow>
|
|
48
|
-
<URow>
|
|
49
|
-
<UAvatar
|
|
50
|
-
v-for="(size, index) in sizes"
|
|
51
|
-
:key="index"
|
|
52
|
-
v-bind="args"
|
|
53
|
-
:size="size"
|
|
54
|
-
:label="''"
|
|
55
|
-
/>
|
|
56
|
-
</URow>
|
|
57
|
-
</UCol>
|
|
27
|
+
<UAvatar v-bind="args">
|
|
28
|
+
${args.slotTemplate || getSlotsFragment()}
|
|
29
|
+
</UAvatar>
|
|
58
30
|
`,
|
|
59
31
|
});
|
|
60
32
|
|
|
61
|
-
const
|
|
33
|
+
const EnumVariantTemplate = (args, { argTypes } = {}) => ({
|
|
62
34
|
components: { UCol, URow, UAvatar },
|
|
63
35
|
setup() {
|
|
64
36
|
return {
|
|
65
37
|
args,
|
|
66
|
-
|
|
38
|
+
options: argTypes[args.enum].options,
|
|
67
39
|
};
|
|
68
40
|
},
|
|
69
41
|
template: `
|
|
70
42
|
<UCol gap="xl">
|
|
71
43
|
<URow>
|
|
72
44
|
<UAvatar
|
|
73
|
-
v-for="(
|
|
74
|
-
v-bind="args"
|
|
75
|
-
:color="color"
|
|
76
|
-
:key="index"
|
|
77
|
-
:label="color"
|
|
78
|
-
/>
|
|
79
|
-
</URow>
|
|
80
|
-
<URow>
|
|
81
|
-
<UAvatar
|
|
82
|
-
v-for="(color, index) in colors"
|
|
45
|
+
v-for="(option, index) in options"
|
|
83
46
|
:key="index"
|
|
84
47
|
v-bind="args"
|
|
85
|
-
:
|
|
86
|
-
:label="
|
|
48
|
+
:[args.enum]="option"
|
|
49
|
+
:label="option"
|
|
87
50
|
/>
|
|
88
51
|
</URow>
|
|
89
|
-
</UCol>
|
|
90
|
-
`,
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
const RoundedTemplate = (args, { argTypes } = {}) => ({
|
|
94
|
-
components: { UCol, UAvatar, URow },
|
|
95
|
-
setup() {
|
|
96
|
-
return {
|
|
97
|
-
args,
|
|
98
|
-
roundedValues: argTypes.rounded.options,
|
|
99
|
-
};
|
|
100
|
-
},
|
|
101
|
-
template: `
|
|
102
|
-
<UCol>
|
|
103
52
|
<URow>
|
|
104
53
|
<UAvatar
|
|
105
|
-
v-for="(
|
|
54
|
+
v-for="(option, index) in options"
|
|
106
55
|
:key="index"
|
|
107
56
|
v-bind="args"
|
|
108
|
-
:
|
|
109
|
-
:label="
|
|
57
|
+
:[args.enum]="option"
|
|
58
|
+
:label="''"
|
|
110
59
|
/>
|
|
111
60
|
</URow>
|
|
112
61
|
</UCol>
|
|
@@ -128,23 +77,23 @@ label.args = { label: "Name Surname", size: "3xl" };
|
|
|
128
77
|
/**
|
|
129
78
|
* Hold cursor above an avatar to see value.
|
|
130
79
|
*/
|
|
131
|
-
export const sizes =
|
|
132
|
-
sizes.args = {};
|
|
80
|
+
export const sizes = EnumVariantTemplate.bind({});
|
|
81
|
+
sizes.args = { enum: "size" };
|
|
133
82
|
|
|
134
83
|
/**
|
|
135
84
|
* Hold cursor above an avatar to see value.
|
|
136
85
|
*/
|
|
137
|
-
export const rounded =
|
|
138
|
-
rounded.args = { label: "John Doe", color: "orange" };
|
|
86
|
+
export const rounded = EnumVariantTemplate.bind({});
|
|
87
|
+
rounded.args = { enum: "rounded", label: "John Doe", color: "orange" };
|
|
139
88
|
|
|
140
89
|
/**
|
|
141
90
|
* Hold cursor above an avatar to see value.
|
|
142
91
|
*/
|
|
143
|
-
export const colors =
|
|
144
|
-
colors.args = {};
|
|
92
|
+
export const colors = EnumVariantTemplate.bind({});
|
|
93
|
+
colors.args = { enum: "color" };
|
|
145
94
|
|
|
146
95
|
/**
|
|
147
96
|
* Hold cursor above an avatar to see value.
|
|
148
97
|
*/
|
|
149
|
-
export const bordered =
|
|
150
|
-
bordered.args = { bordered: true };
|
|
98
|
+
export const bordered = EnumVariantTemplate.bind({});
|
|
99
|
+
bordered.args = { enum: "color", bordered: true };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getArgTypes } from "../service.storybook";
|
|
1
|
+
import { getArgTypes, getSlotNames, getSlotsFragment } from "../service.storybook";
|
|
2
2
|
|
|
3
3
|
import UIcon from "../ui.image-icon";
|
|
4
4
|
import URow from "../ui.container-row";
|
|
@@ -21,70 +21,31 @@ export default {
|
|
|
21
21
|
const DefaultTemplate = (args) => ({
|
|
22
22
|
components: { UIcon },
|
|
23
23
|
setup() {
|
|
24
|
-
|
|
25
|
-
},
|
|
26
|
-
template: `
|
|
27
|
-
<UIcon v-bind="args"/>
|
|
28
|
-
`,
|
|
29
|
-
});
|
|
24
|
+
const slots = getSlotNames(UIcon.name);
|
|
30
25
|
|
|
31
|
-
|
|
32
|
-
components: { UIcon, URow },
|
|
33
|
-
setup() {
|
|
34
|
-
return {
|
|
35
|
-
args,
|
|
36
|
-
colors: argTypes.color.options,
|
|
37
|
-
};
|
|
26
|
+
return { args, slots };
|
|
38
27
|
},
|
|
39
28
|
template: `
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
v-bind="args"
|
|
44
|
-
:color="color"
|
|
45
|
-
name="close"
|
|
46
|
-
:key="index"
|
|
47
|
-
/>
|
|
48
|
-
</URow>
|
|
49
|
-
`,
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
const SizesTemplate = (args, { argTypes } = {}) => ({
|
|
53
|
-
components: { UIcon, URow },
|
|
54
|
-
setup() {
|
|
55
|
-
return {
|
|
56
|
-
args,
|
|
57
|
-
sizes: argTypes.size.options,
|
|
58
|
-
};
|
|
59
|
-
},
|
|
60
|
-
template: `
|
|
61
|
-
<URow>
|
|
62
|
-
<UIcon
|
|
63
|
-
v-for="(size, index) in sizes"
|
|
64
|
-
v-bind="args"
|
|
65
|
-
:size="size"
|
|
66
|
-
name="close"
|
|
67
|
-
:key="index"
|
|
68
|
-
/>
|
|
69
|
-
</URow>
|
|
29
|
+
<UIcon v-bind="args">
|
|
30
|
+
${args.slotTemplate || getSlotsFragment()}
|
|
31
|
+
</UIcon>
|
|
70
32
|
`,
|
|
71
33
|
});
|
|
72
34
|
|
|
73
|
-
const
|
|
35
|
+
const EnumVariantTemplate = (args, { argTypes } = {}) => ({
|
|
74
36
|
components: { UIcon, URow },
|
|
75
37
|
setup() {
|
|
76
38
|
return {
|
|
77
39
|
args,
|
|
78
|
-
|
|
40
|
+
options: argTypes[args.enum].options,
|
|
79
41
|
};
|
|
80
42
|
},
|
|
81
43
|
template: `
|
|
82
44
|
<URow>
|
|
83
45
|
<UIcon
|
|
84
|
-
v-for="(
|
|
85
|
-
:variant="variant"
|
|
86
|
-
name="close"
|
|
46
|
+
v-for="(option, index) in options"
|
|
87
47
|
v-bind="args"
|
|
48
|
+
:[args.enum]="option"
|
|
88
49
|
:key="index"
|
|
89
50
|
/>
|
|
90
51
|
</URow>
|
|
@@ -94,14 +55,14 @@ const VariantsTemplate = (args, { argTypes } = {}) => ({
|
|
|
94
55
|
export const Default = DefaultTemplate.bind({});
|
|
95
56
|
Default.args = {};
|
|
96
57
|
|
|
97
|
-
export const colors =
|
|
98
|
-
colors.args = {};
|
|
58
|
+
export const colors = EnumVariantTemplate.bind({});
|
|
59
|
+
colors.args = { enum: "color" };
|
|
99
60
|
|
|
100
|
-
export const sizes =
|
|
101
|
-
sizes.args = {};
|
|
61
|
+
export const sizes = EnumVariantTemplate.bind({});
|
|
62
|
+
sizes.args = { enum: "size" };
|
|
102
63
|
|
|
103
|
-
export const variants =
|
|
104
|
-
variants.args = { color: "red" };
|
|
64
|
+
export const variants = EnumVariantTemplate.bind({});
|
|
65
|
+
variants.args = { enum: "variant", color: "red" };
|
|
105
66
|
|
|
106
67
|
export const tooltip = DefaultTemplate.bind({});
|
|
107
68
|
tooltip.args = { tooltip: "Some text" };
|
|
@@ -109,5 +70,5 @@ tooltip.args = { tooltip: "Some text" };
|
|
|
109
70
|
export const interactive = DefaultTemplate.bind({});
|
|
110
71
|
interactive.args = { interactive: true };
|
|
111
72
|
|
|
112
|
-
export const pill =
|
|
113
|
-
pill.args = { pill: true };
|
|
73
|
+
export const pill = EnumVariantTemplate.bind({});
|
|
74
|
+
pill.args = { enum: "color", pill: true };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import ULoader from "../ui.loader";
|
|
2
2
|
import URow from "../ui.container-row";
|
|
3
3
|
import UButton from "../ui.button";
|
|
4
|
+
import { ref } from "vue";
|
|
4
5
|
|
|
5
|
-
import { getArgTypes } from "../service.storybook";
|
|
6
|
+
import { getArgTypes, getSlotNames, getSlotsFragment } from "../service.storybook";
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* The `ULoader` component. | [View on GitHub](https://github.com/vuelessjs/vueless/tree/main/src/ui.loader)
|
|
@@ -22,48 +23,32 @@ export default {
|
|
|
22
23
|
const DefaultTemplate = (args) => ({
|
|
23
24
|
components: { ULoader },
|
|
24
25
|
setup() {
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
template: `
|
|
28
|
-
<ULoader v-bind="args" />
|
|
29
|
-
`,
|
|
30
|
-
});
|
|
26
|
+
const slots = getSlotNames(ULoader.name);
|
|
31
27
|
|
|
32
|
-
|
|
33
|
-
components: { ULoader, URow },
|
|
34
|
-
setup() {
|
|
35
|
-
return {
|
|
36
|
-
args,
|
|
37
|
-
colors: argTypes.color.options,
|
|
38
|
-
};
|
|
28
|
+
return { args, slots };
|
|
39
29
|
},
|
|
40
30
|
template: `
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
:key="index"
|
|
45
|
-
v-bind="args"
|
|
46
|
-
:color="color"
|
|
47
|
-
/>
|
|
48
|
-
</URow>
|
|
31
|
+
<ULoader v-bind="args">
|
|
32
|
+
${args.slotTemplate || getSlotsFragment()}
|
|
33
|
+
</ULoader>
|
|
49
34
|
`,
|
|
50
35
|
});
|
|
51
36
|
|
|
52
|
-
const
|
|
37
|
+
const EnumVariantTemplate = (args, { argTypes } = {}) => ({
|
|
53
38
|
components: { ULoader, URow },
|
|
54
39
|
setup() {
|
|
55
40
|
return {
|
|
56
41
|
args,
|
|
57
|
-
|
|
42
|
+
options: argTypes[args.enum].options,
|
|
58
43
|
};
|
|
59
44
|
},
|
|
60
45
|
template: `
|
|
61
|
-
<URow>
|
|
46
|
+
<URow class="flex-wrap">
|
|
62
47
|
<ULoader
|
|
63
|
-
v-for="(
|
|
48
|
+
v-for="(option, index) in options"
|
|
64
49
|
:key="index"
|
|
65
50
|
v-bind="args"
|
|
66
|
-
:
|
|
51
|
+
:[args.enum]="option"
|
|
67
52
|
/>
|
|
68
53
|
</URow>
|
|
69
54
|
`,
|
|
@@ -72,17 +57,13 @@ const SizesTemplate = (args, { argTypes } = {}) => ({
|
|
|
72
57
|
const LoadingTemplate = (args) => ({
|
|
73
58
|
components: { ULoader, UButton, URow },
|
|
74
59
|
setup() {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
methods: {
|
|
83
|
-
toggleLoader() {
|
|
84
|
-
this.isLoading = !this.isLoading;
|
|
85
|
-
},
|
|
60
|
+
function toggleLoader() {
|
|
61
|
+
isLoading.value = !isLoading.value;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const isLoading = ref(false);
|
|
65
|
+
|
|
66
|
+
return { args, isLoading, toggleLoader };
|
|
86
67
|
},
|
|
87
68
|
template: `
|
|
88
69
|
<URow>
|
|
@@ -95,11 +76,11 @@ const LoadingTemplate = (args) => ({
|
|
|
95
76
|
export const Default = DefaultTemplate.bind({});
|
|
96
77
|
Default.args = {};
|
|
97
78
|
|
|
98
|
-
export const sizes =
|
|
99
|
-
sizes.args = {};
|
|
79
|
+
export const sizes = EnumVariantTemplate.bind({});
|
|
80
|
+
sizes.args = { enum: "size" };
|
|
100
81
|
|
|
101
|
-
export const colors =
|
|
102
|
-
colors.args = {};
|
|
82
|
+
export const colors = EnumVariantTemplate.bind({});
|
|
83
|
+
colors.args = { enum: "color" };
|
|
103
84
|
|
|
104
85
|
export const loading = LoadingTemplate.bind({});
|
|
105
86
|
loading.args = {};
|
|
@@ -4,7 +4,7 @@ import UCol from "../ui.container-col";
|
|
|
4
4
|
|
|
5
5
|
import { useLoaderRendering } from "./composables/useLoaderRendering";
|
|
6
6
|
|
|
7
|
-
import { getArgTypes } from "../service.storybook";
|
|
7
|
+
import { getArgTypes, getSlotNames, getSlotsFragment } from "../service.storybook";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* The `ULoaderRendering` component. | [View on GitHub](https://github.com/vuelessjs/vueless/tree/main/src/ui.loader-rendering)
|
|
@@ -28,10 +28,14 @@ export default {
|
|
|
28
28
|
const DefaultTemplate = (args) => ({
|
|
29
29
|
components: { ULoaderRendering },
|
|
30
30
|
setup() {
|
|
31
|
-
|
|
31
|
+
const slots = getSlotNames(ULoaderRendering.name);
|
|
32
|
+
|
|
33
|
+
return { args, slots };
|
|
32
34
|
},
|
|
33
35
|
template: `
|
|
34
|
-
<ULoaderRendering v-bind="args" class="w-full h-full"
|
|
36
|
+
<ULoaderRendering v-bind="args" class="w-full h-full">
|
|
37
|
+
${args.slotTemplate || getSlotsFragment()}
|
|
38
|
+
</ULoaderRendering>
|
|
35
39
|
`,
|
|
36
40
|
});
|
|
37
41
|
|
|
@@ -40,12 +44,11 @@ const LoadingTemplate = (args) => ({
|
|
|
40
44
|
setup() {
|
|
41
45
|
const { loaderRenderingOn, loaderRenderingOff, isLoading } = useLoaderRendering();
|
|
42
46
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
},
|
|
47
|
+
function toggleLoading() {
|
|
48
|
+
isLoading.value ? loaderRenderingOff() : loaderRenderingOn();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return { args, loaderRenderingOn, loaderRenderingOff, isLoading, toggleLoading };
|
|
49
52
|
},
|
|
50
53
|
template: `
|
|
51
54
|
<UCol align="center" class="pb-4">
|
|
@@ -7,7 +7,7 @@ import UBadge from "../ui.text-badge";
|
|
|
7
7
|
import { useLoaderTop } from "./composables/useLoaderTop";
|
|
8
8
|
import { loaderTopOff, loaderTopOn } from "./services/loaderTop.service";
|
|
9
9
|
|
|
10
|
-
import { getArgTypes } from "../service.storybook";
|
|
10
|
+
import { getArgTypes, getSlotNames } from "../service.storybook";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* The `ULoaderTop` component. | [View on GitHub](https://github.com/vuelessjs/vueless/tree/main/src/ui.loader-top)
|
|
@@ -26,7 +26,9 @@ const DefaultTemplate = (args) => ({
|
|
|
26
26
|
setup() {
|
|
27
27
|
const { loaderTopOn, loaderTopOff } = useLoaderTop();
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
const slots = getSlotNames(ULoaderTop.name);
|
|
30
|
+
|
|
31
|
+
return { args, slots, loaderTopOn, loaderTopOff };
|
|
30
32
|
},
|
|
31
33
|
template: `
|
|
32
34
|
<ULoaderTop color="blue" v-bind="args" resources="https://api.publicapis.org/entries"/>
|
|
@@ -38,14 +40,14 @@ const DefaultTemplate = (args) => ({
|
|
|
38
40
|
`,
|
|
39
41
|
});
|
|
40
42
|
|
|
41
|
-
const
|
|
43
|
+
const EnumVariantTemplate = (args, { argTypes } = {}) => ({
|
|
42
44
|
components: { ULoaderTop, UButton, UCol, URow, UBadge },
|
|
43
45
|
setup() {
|
|
44
46
|
return {
|
|
45
47
|
args,
|
|
46
48
|
loaderTopOff,
|
|
47
49
|
loaderTopOn,
|
|
48
|
-
|
|
50
|
+
options: argTypes[args.enum].options,
|
|
49
51
|
};
|
|
50
52
|
},
|
|
51
53
|
template: `
|
|
@@ -55,12 +57,19 @@ const ColorsTemplate = (args, { argTypes } = {}) => ({
|
|
|
55
57
|
<UButton label="Off" size="sm" @click="loaderTopOff('https://api.publicapis.org/images')" />
|
|
56
58
|
</URow>
|
|
57
59
|
|
|
58
|
-
<URow
|
|
59
|
-
|
|
60
|
+
<URow
|
|
61
|
+
align="center"
|
|
62
|
+
v-for="(option, index) in options"
|
|
63
|
+
:key="index"
|
|
64
|
+
>
|
|
65
|
+
<UBadge
|
|
66
|
+
:label="option"
|
|
67
|
+
:[args.enum]="option"
|
|
68
|
+
/>
|
|
60
69
|
<ULoaderTop
|
|
61
70
|
resources="https://api.publicapis.org/images"
|
|
62
71
|
class="static"
|
|
63
|
-
:
|
|
72
|
+
:[args.enum]="option"
|
|
64
73
|
v-bind="args"
|
|
65
74
|
/>
|
|
66
75
|
</URow>
|
|
@@ -72,5 +81,5 @@ const ColorsTemplate = (args, { argTypes } = {}) => ({
|
|
|
72
81
|
export const Default = DefaultTemplate.bind({});
|
|
73
82
|
Default.args = {};
|
|
74
83
|
|
|
75
|
-
export const Color =
|
|
76
|
-
Color.args = {};
|
|
84
|
+
export const Color = EnumVariantTemplate.bind({});
|
|
85
|
+
Color.args = { enum: "color" };
|
|
@@ -3,7 +3,7 @@ import URow from "../ui.container-row";
|
|
|
3
3
|
import UCol from "../ui.container-col";
|
|
4
4
|
import UBadge from "../ui.text-badge";
|
|
5
5
|
|
|
6
|
-
import { getArgTypes } from "../service.storybook";
|
|
6
|
+
import { getArgTypes, getSlotNames, getSlotsFragment } from "../service.storybook";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* The `UDot` component. | [View on GitHub](https://github.com/vuelessjs/vueless/tree/main/src/ui.other-dot)
|
|
@@ -20,44 +20,35 @@ export default {
|
|
|
20
20
|
const DefaultTemplate = (args) => ({
|
|
21
21
|
components: { UDot },
|
|
22
22
|
setup() {
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
template: `
|
|
26
|
-
<UDot v-bind="args" />
|
|
27
|
-
`,
|
|
28
|
-
});
|
|
23
|
+
const slots = getSlotNames(UDot.name);
|
|
29
24
|
|
|
30
|
-
|
|
31
|
-
components: { UCol, URow, UDot, UBadge },
|
|
32
|
-
setup() {
|
|
33
|
-
return {
|
|
34
|
-
args,
|
|
35
|
-
colors: argTypes.color.options,
|
|
36
|
-
};
|
|
25
|
+
return { args, slots };
|
|
37
26
|
},
|
|
38
27
|
template: `
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
<UBadge :label="color" :color="color" variant="thirdary" />
|
|
43
|
-
</URow>
|
|
44
|
-
</UCol>
|
|
28
|
+
<UDot v-bind="args">
|
|
29
|
+
${args.slotTemplate || getSlotsFragment()}
|
|
30
|
+
</UDot>
|
|
45
31
|
`,
|
|
46
32
|
});
|
|
47
33
|
|
|
48
|
-
const
|
|
34
|
+
const EnumVariantTemplate = (args, { argTypes } = {}) => ({
|
|
49
35
|
components: { UCol, URow, UDot, UBadge },
|
|
50
36
|
setup() {
|
|
51
37
|
return {
|
|
52
38
|
args,
|
|
53
|
-
|
|
39
|
+
options: argTypes[args.enum].options,
|
|
54
40
|
};
|
|
55
41
|
},
|
|
56
42
|
template: `
|
|
57
43
|
<UCol>
|
|
58
|
-
<URow
|
|
59
|
-
|
|
60
|
-
|
|
44
|
+
<URow
|
|
45
|
+
v-for="(color, index) in colors"
|
|
46
|
+
:key="index"
|
|
47
|
+
gap="none"
|
|
48
|
+
align="center"
|
|
49
|
+
>
|
|
50
|
+
<UDot v-bind="args" :[args.enum]="option"/>
|
|
51
|
+
<UBadge :label="option" :[args.enum]="option" variant="thirdary" />
|
|
61
52
|
</URow>
|
|
62
53
|
</UCol>
|
|
63
54
|
`,
|
|
@@ -66,8 +57,8 @@ const SizesTemplate = (args, { argTypes } = {}) => ({
|
|
|
66
57
|
export const Default = DefaultTemplate.bind({});
|
|
67
58
|
Default.args = {};
|
|
68
59
|
|
|
69
|
-
export const Colors =
|
|
70
|
-
Colors.args = {};
|
|
60
|
+
export const Colors = EnumVariantTemplate.bind({});
|
|
61
|
+
Colors.args = { enum: "color" };
|
|
71
62
|
|
|
72
|
-
export const Sizes =
|
|
73
|
-
Sizes.args = {};
|
|
63
|
+
export const Sizes = EnumVariantTemplate.bind({});
|
|
64
|
+
Sizes.args = { enum: "size" };
|
|
@@ -30,7 +30,7 @@ const DefaultTemplate = (args) => ({
|
|
|
30
30
|
},
|
|
31
31
|
template: `
|
|
32
32
|
<UAlert v-bind="args">
|
|
33
|
-
${args.slotTemplate || getSlotsFragment(
|
|
33
|
+
${args.slotTemplate || getSlotsFragment()}
|
|
34
34
|
</UAlert>
|
|
35
35
|
`,
|
|
36
36
|
});
|
|
@@ -38,17 +38,16 @@ const DefaultTemplate = (args) => ({
|
|
|
38
38
|
const EnumVariantTemplate = (args, { argTypes } = {}) => ({
|
|
39
39
|
components: { UAlert, UCol },
|
|
40
40
|
setup() {
|
|
41
|
-
const options = argTypes[args.enum].options;
|
|
42
|
-
let prefixedOptions = options;
|
|
43
|
-
|
|
44
|
-
if (argTypes[args.enum].name === "size") {
|
|
45
|
-
prefixedOptions = options.map((option) => getText(option));
|
|
46
|
-
}
|
|
47
|
-
|
|
48
41
|
function getText(value) {
|
|
49
42
|
return `This is Alert's ${value} size`;
|
|
50
43
|
}
|
|
51
44
|
|
|
45
|
+
let prefixedOptions = argTypes[args.enum].options;
|
|
46
|
+
|
|
47
|
+
if (argTypes[args.enum].name === "size") {
|
|
48
|
+
prefixedOptions = prefixedOptions.map((option) => getText(option));
|
|
49
|
+
}
|
|
50
|
+
|
|
52
51
|
return { args, options: argTypes[args.enum].options, prefixedOptions };
|
|
53
52
|
},
|
|
54
53
|
template: `
|
|
@@ -80,7 +79,7 @@ export const HTML = DefaultTemplate.bind({});
|
|
|
80
79
|
HTML.args = {
|
|
81
80
|
title: "",
|
|
82
81
|
description: "",
|
|
83
|
-
|
|
82
|
+
slotTemplate: `
|
|
84
83
|
<h3 class="text-lg font-medium mb-2">Important Security Update</h3>
|
|
85
84
|
<p class="mb-0.5">
|
|
86
85
|
<b>Your account password will expire in 10 days,</b> please update it to maintain account security.
|
|
@@ -60,11 +60,7 @@ const EnumVariantTemplate = (args, { argTypes } = {}) => ({
|
|
|
60
60
|
template: `
|
|
61
61
|
<URow>
|
|
62
62
|
<div class="${COMPONENT_CLASSES}" v-for="(option, index) in options" :key="index">
|
|
63
|
-
<UMoney v-bind="args" :[args.enum]="option"
|
|
64
|
-
<template v-for="(slot) in slots" v-slot:[slot]>
|
|
65
|
-
<template v-if="args[slot]">{{ args[slot] }}</template>
|
|
66
|
-
</template>
|
|
67
|
-
</UMoney>
|
|
63
|
+
<UMoney v-bind="args" :[args.enum]="option" />
|
|
68
64
|
</div>
|
|
69
65
|
</URow>
|
|
70
66
|
`,
|