vueless 0.0.235 → 0.0.237
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/service.storybook/index.js +19 -3
- package/ui.form-input/configs/default.config.js +2 -2
- package/ui.form-input/index.vue +8 -8
- package/ui.form-input-search/configs/default.config.js +2 -2
- package/ui.form-input-search/index.vue +4 -3
- package/ui.text-alert/configs/default.config.js +27 -33
- package/ui.text-alert/index.stories.js +70 -135
- package/ui.text-alert/index.vue +52 -54
- package/ui.text-badge/index.stories.js +21 -89
- package/ui.text-block/index.stories.js +13 -15
- package/ui.text-empty/index.stories.js +15 -27
- package/ui.text-file/index.stories.js +4 -2
- package/ui.text-files/index.stories.js +4 -2
- package/ui.text-header/index.stories.js +17 -57
- package/ui.text-money/index.stories.js +24 -148
- package/ui.text-notify/index.stories.js +24 -24
- package/web-types.json +31 -40
|
@@ -4,7 +4,7 @@ import URow from "../ui.container-row";
|
|
|
4
4
|
import DebitIcon from "../ui.text-money/assets/debit.svg?component";
|
|
5
5
|
import CreditIcon from "../ui.text-money/assets/credit.svg?component";
|
|
6
6
|
|
|
7
|
-
import { getArgTypes, getSlotNames,
|
|
7
|
+
import { getArgTypes, getSlotNames, getSlotsFragment } from "../service.storybook";
|
|
8
8
|
|
|
9
9
|
const COMPONENT_CLASSES = "flex justify-center w-1/6";
|
|
10
10
|
|
|
@@ -26,145 +26,41 @@ export default {
|
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
const DefaultTemplate = (args) => ({
|
|
29
|
-
components: { UMoney },
|
|
29
|
+
components: { UMoney, UIcon },
|
|
30
30
|
setup() {
|
|
31
31
|
const slots = getSlotNames(UMoney.name);
|
|
32
32
|
|
|
33
|
-
return { args, slots };
|
|
34
|
-
},
|
|
35
|
-
template: `
|
|
36
|
-
<div class="${COMPONENT_CLASSES}">
|
|
37
|
-
<UMoney v-bind="args">
|
|
38
|
-
${allSlotsFragment}
|
|
39
|
-
</UMoney>
|
|
40
|
-
</div>
|
|
41
|
-
`,
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
const SlotTemplate = (args) => ({
|
|
45
|
-
components: { UMoney, UIcon },
|
|
46
|
-
setup() {
|
|
47
33
|
const icons = {
|
|
48
34
|
Debit: DebitIcon,
|
|
49
35
|
Credit: CreditIcon,
|
|
50
36
|
};
|
|
51
37
|
|
|
52
|
-
return { args, icons };
|
|
38
|
+
return { args, slots, icons };
|
|
53
39
|
},
|
|
54
40
|
template: `
|
|
55
41
|
<div class="${COMPONENT_CLASSES}">
|
|
56
42
|
<UMoney v-bind="args">
|
|
57
|
-
${args.slotTemplate}
|
|
43
|
+
${args.slotTemplate || getSlotsFragment()}
|
|
58
44
|
</UMoney>
|
|
59
45
|
</div>
|
|
60
46
|
`,
|
|
61
47
|
});
|
|
62
48
|
|
|
63
|
-
const
|
|
64
|
-
components: { UMoney, URow },
|
|
65
|
-
setup() {
|
|
66
|
-
return {
|
|
67
|
-
args,
|
|
68
|
-
sizes: argTypes.size.options,
|
|
69
|
-
};
|
|
70
|
-
},
|
|
71
|
-
template: `
|
|
72
|
-
<URow>
|
|
73
|
-
<div class="${COMPONENT_CLASSES}" v-for="(size, index) in sizes" :key="index">
|
|
74
|
-
<UMoney v-bind="args" :size="size" >
|
|
75
|
-
<template v-for="(slot) in slots" v-slot:[slot]>
|
|
76
|
-
<template v-if="args[slot]">{{ args[slot] }}</template>
|
|
77
|
-
</template>
|
|
78
|
-
</UMoney>
|
|
79
|
-
</div>
|
|
80
|
-
</URow>
|
|
81
|
-
`,
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
const WeightTemplate = (args, { argTypes } = {}) => ({
|
|
85
|
-
components: { UMoney, URow },
|
|
86
|
-
setup() {
|
|
87
|
-
return {
|
|
88
|
-
args,
|
|
89
|
-
weights: argTypes.weight.options,
|
|
90
|
-
};
|
|
91
|
-
},
|
|
92
|
-
template: `
|
|
93
|
-
<URow>
|
|
94
|
-
<div class="${COMPONENT_CLASSES}" v-for="(weight, index) in weights" :key="index">
|
|
95
|
-
<UMoney v-bind="args" :weight="weight" >
|
|
96
|
-
<template v-for="(slot) in slots" v-slot:[slot]>
|
|
97
|
-
<template v-if="args[slot]">{{ args[slot] }}</template>
|
|
98
|
-
</template>
|
|
99
|
-
</UMoney>
|
|
100
|
-
</div>
|
|
101
|
-
</URow>
|
|
102
|
-
`,
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
const ColorsTemplate = (args, { argTypes } = {}) => ({
|
|
49
|
+
const EnumVariantTemplate = (args, { argTypes } = {}) => ({
|
|
106
50
|
components: { UMoney, URow },
|
|
107
51
|
setup() {
|
|
108
|
-
|
|
109
|
-
args,
|
|
110
|
-
colors: argTypes.color.options,
|
|
111
|
-
};
|
|
112
|
-
},
|
|
113
|
-
template: `
|
|
114
|
-
<URow>
|
|
115
|
-
<div class="${COMPONENT_CLASSES}" v-for="(color, index) in colors" :key="index">
|
|
116
|
-
<UMoney v-bind="args" :color="color" >
|
|
117
|
-
<template v-for="(slot) in slots" v-slot:[slot]>
|
|
118
|
-
<template v-if="args[slot]">{{ args[slot] }}</template>
|
|
119
|
-
</template>
|
|
120
|
-
</UMoney>
|
|
121
|
-
</div>
|
|
122
|
-
</URow>
|
|
123
|
-
`,
|
|
124
|
-
created() {
|
|
125
|
-
this.mxArgTypes = argTypes;
|
|
126
|
-
},
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
const SignsTemplate = (args, { argTypes } = {}) => ({
|
|
130
|
-
components: { UMoney, URow },
|
|
131
|
-
setup() {
|
|
132
|
-
return {
|
|
133
|
-
args,
|
|
134
|
-
signs: argTypes.sign.options,
|
|
135
|
-
};
|
|
136
|
-
},
|
|
137
|
-
template: `
|
|
138
|
-
<URow>
|
|
139
|
-
<div class="${COMPONENT_CLASSES}" v-for="(sign, index) in signs" :key="index">
|
|
140
|
-
<UMoney v-bind="args" :sign="sign" >
|
|
141
|
-
<template v-for="(slot) in slots" v-slot:[slot]>
|
|
142
|
-
<template v-if="args[slot]">{{ args[slot] }}</template>
|
|
143
|
-
</template>
|
|
144
|
-
</UMoney>
|
|
145
|
-
</div>
|
|
146
|
-
</URow>
|
|
147
|
-
`,
|
|
148
|
-
created() {
|
|
149
|
-
this.mxArgTypes = argTypes;
|
|
150
|
-
},
|
|
151
|
-
});
|
|
52
|
+
const slots = getSlotNames(UMoney.name);
|
|
152
53
|
|
|
153
|
-
const SymbolAlignTemplate = (args, { argTypes } = {}) => ({
|
|
154
|
-
components: { UMoney, URow },
|
|
155
|
-
setup() {
|
|
156
54
|
return {
|
|
157
55
|
args,
|
|
158
|
-
|
|
56
|
+
slots,
|
|
57
|
+
options: argTypes[args.enum].options,
|
|
159
58
|
};
|
|
160
59
|
},
|
|
161
60
|
template: `
|
|
162
61
|
<URow>
|
|
163
|
-
<div class="${COMPONENT_CLASSES}" v-for="(
|
|
164
|
-
<UMoney
|
|
165
|
-
v-bind="args"
|
|
166
|
-
:symbol-align="symbolAlign"
|
|
167
|
-
>
|
|
62
|
+
<div class="${COMPONENT_CLASSES}" v-for="(option, index) in options" :key="index">
|
|
63
|
+
<UMoney v-bind="args" :[args.enum]="option" >
|
|
168
64
|
<template v-for="(slot) in slots" v-slot:[slot]>
|
|
169
65
|
<template v-if="args[slot]">{{ args[slot] }}</template>
|
|
170
66
|
</template>
|
|
@@ -177,27 +73,6 @@ const SymbolAlignTemplate = (args, { argTypes } = {}) => ({
|
|
|
177
73
|
},
|
|
178
74
|
});
|
|
179
75
|
|
|
180
|
-
const AlignTemplate = (args, { argTypes } = {}) => ({
|
|
181
|
-
components: { UMoney, URow },
|
|
182
|
-
setup() {
|
|
183
|
-
return {
|
|
184
|
-
args,
|
|
185
|
-
aligns: argTypes.align.options,
|
|
186
|
-
};
|
|
187
|
-
},
|
|
188
|
-
template: `
|
|
189
|
-
<URow>
|
|
190
|
-
<div class="${COMPONENT_CLASSES}" v-for="(align, index) in aligns" :key="index">
|
|
191
|
-
<UMoney :align="align" v-bind="args" >
|
|
192
|
-
<template v-for="(slot) in slots" v-slot:[slot]>
|
|
193
|
-
<template v-if="args[slot]">{{ args[slot] }}</template>
|
|
194
|
-
</template>
|
|
195
|
-
</UMoney>
|
|
196
|
-
</div>
|
|
197
|
-
</URow>
|
|
198
|
-
`,
|
|
199
|
-
});
|
|
200
|
-
|
|
201
76
|
export const Default = DefaultTemplate.bind({});
|
|
202
77
|
Default.args = {};
|
|
203
78
|
|
|
@@ -208,24 +83,25 @@ otherValues.args = {
|
|
|
208
83
|
sign: "negative",
|
|
209
84
|
};
|
|
210
85
|
|
|
211
|
-
export const colors =
|
|
86
|
+
export const colors = EnumVariantTemplate.bind({});
|
|
212
87
|
colors.args = {
|
|
88
|
+
enum: "color",
|
|
213
89
|
sum: 0,
|
|
214
90
|
symbol: "$",
|
|
215
91
|
sign: "default",
|
|
216
92
|
};
|
|
217
93
|
|
|
218
|
-
export const sizes =
|
|
219
|
-
sizes.args = {};
|
|
94
|
+
export const sizes = EnumVariantTemplate.bind({});
|
|
95
|
+
sizes.args = { enum: "size" };
|
|
220
96
|
|
|
221
|
-
export const weights =
|
|
222
|
-
weights.args = {};
|
|
97
|
+
export const weights = EnumVariantTemplate.bind({});
|
|
98
|
+
weights.args = { enum: "weight" };
|
|
223
99
|
|
|
224
|
-
export const sign =
|
|
225
|
-
sign.args = {};
|
|
100
|
+
export const sign = EnumVariantTemplate.bind({});
|
|
101
|
+
sign.args = { enum: "sign" };
|
|
226
102
|
|
|
227
|
-
export const symbolAlign =
|
|
228
|
-
symbolAlign.args = {};
|
|
103
|
+
export const symbolAlign = EnumVariantTemplate.bind({});
|
|
104
|
+
symbolAlign.args = { enum: "symbolAlign" };
|
|
229
105
|
|
|
230
106
|
export const planned = DefaultTemplate.bind({});
|
|
231
107
|
planned.args = { planned: true };
|
|
@@ -236,10 +112,10 @@ integer.args = { integer: true };
|
|
|
236
112
|
export const numeralDecimalScale3 = DefaultTemplate.bind({});
|
|
237
113
|
numeralDecimalScale3.args = { numeralDecimalScale: 3 };
|
|
238
114
|
|
|
239
|
-
export const align =
|
|
240
|
-
align.args = {};
|
|
115
|
+
export const align = EnumVariantTemplate.bind({});
|
|
116
|
+
align.args = { enum: "align" };
|
|
241
117
|
|
|
242
|
-
export const slotLeft =
|
|
118
|
+
export const slotLeft = DefaultTemplate.bind({});
|
|
243
119
|
slotLeft.args = {
|
|
244
120
|
slotTemplate: `
|
|
245
121
|
<template #left>
|
|
@@ -248,7 +124,7 @@ slotLeft.args = {
|
|
|
248
124
|
`,
|
|
249
125
|
};
|
|
250
126
|
|
|
251
|
-
export const slotRight =
|
|
127
|
+
export const slotRight = DefaultTemplate.bind({});
|
|
252
128
|
slotRight.args = {
|
|
253
129
|
slotTemplate: `
|
|
254
130
|
<template #right>
|
|
@@ -4,7 +4,7 @@ import UNotify from "../ui.text-notify";
|
|
|
4
4
|
import UButton from "../ui.button";
|
|
5
5
|
import UGroup from "../ui.container-group";
|
|
6
6
|
|
|
7
|
-
import { getArgTypes } from "../service.storybook";
|
|
7
|
+
import { getArgTypes, getSlotsFragment } from "../service.storybook";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* The `UNotify` component. | [View on GitHub](https://github.com/vuelessjs/vueless/tree/main/src/ui.text-notify)
|
|
@@ -28,39 +28,28 @@ export default {
|
|
|
28
28
|
const DefaultTemplate = (args) => ({
|
|
29
29
|
components: { UNotify, UButton },
|
|
30
30
|
setup() {
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
template: `
|
|
34
|
-
<UNotify class="m-4" v-bind="args" />
|
|
35
|
-
<UButton label="Show notify" @click="onClick"/>
|
|
36
|
-
`,
|
|
37
|
-
methods: {
|
|
38
|
-
onClick() {
|
|
31
|
+
function onClick() {
|
|
39
32
|
notify({
|
|
40
33
|
type: "success",
|
|
41
34
|
label: "Hurray!",
|
|
42
35
|
description: "The file successfully downloaded.",
|
|
43
36
|
});
|
|
44
|
-
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return { args, onClick };
|
|
45
40
|
},
|
|
41
|
+
template: `
|
|
42
|
+
<UNotify class="m-4" v-bind="args">
|
|
43
|
+
${args.slotTemplate || getSlotsFragment()}
|
|
44
|
+
</UNotify>
|
|
45
|
+
<UButton label="Show notify" @click="onClick"/>
|
|
46
|
+
`,
|
|
46
47
|
});
|
|
47
48
|
|
|
48
49
|
const TypesTemplate = (args) => ({
|
|
49
50
|
components: { UNotify, UButton, UGroup },
|
|
50
51
|
setup() {
|
|
51
|
-
|
|
52
|
-
},
|
|
53
|
-
template: `
|
|
54
|
-
<UNotify class="m-4" />
|
|
55
|
-
|
|
56
|
-
<UGroup>
|
|
57
|
-
<UButton label="Success" color="green" @click="onClick('success')"/>
|
|
58
|
-
<UButton label="Warning" color="orange" @click="onClick('warning')"/>
|
|
59
|
-
<UButton label="Error" color="red" @click="onClick('error')"/>
|
|
60
|
-
</UGroup>
|
|
61
|
-
`,
|
|
62
|
-
methods: {
|
|
63
|
-
onClick(type) {
|
|
52
|
+
function onClick(type) {
|
|
64
53
|
if (type === "success") {
|
|
65
54
|
notify({
|
|
66
55
|
type,
|
|
@@ -84,8 +73,19 @@ const TypesTemplate = (args) => ({
|
|
|
84
73
|
description: "The file can't be downloaded, please check the fields and try again.",
|
|
85
74
|
});
|
|
86
75
|
}
|
|
87
|
-
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return { args, onClick };
|
|
88
79
|
},
|
|
80
|
+
template: `
|
|
81
|
+
<UNotify class="m-4" />
|
|
82
|
+
|
|
83
|
+
<UGroup>
|
|
84
|
+
<UButton label="Success" color="green" @click="onClick('success')"/>
|
|
85
|
+
<UButton label="Warning" color="orange" @click="onClick('warning')"/>
|
|
86
|
+
<UButton label="Error" color="red" @click="onClick('error')"/>
|
|
87
|
+
</UGroup>
|
|
88
|
+
`,
|
|
89
89
|
});
|
|
90
90
|
|
|
91
91
|
export const Default = DefaultTemplate.bind({});
|
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"framework": "vue",
|
|
3
3
|
"name": "vueless",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.237",
|
|
5
5
|
"contributions": {
|
|
6
6
|
"html": {
|
|
7
7
|
"description-markup": "markdown",
|
|
@@ -413,21 +413,31 @@
|
|
|
413
413
|
"description": "",
|
|
414
414
|
"attributes": [
|
|
415
415
|
{
|
|
416
|
-
"name": "
|
|
417
|
-
"description": "Alert
|
|
416
|
+
"name": "title",
|
|
417
|
+
"description": "Alert title.",
|
|
418
418
|
"value": {
|
|
419
419
|
"kind": "expression",
|
|
420
|
-
"type": "
|
|
420
|
+
"type": "string"
|
|
421
421
|
},
|
|
422
|
-
"default": "
|
|
422
|
+
"default": "\"\""
|
|
423
423
|
},
|
|
424
424
|
{
|
|
425
|
-
"name": "
|
|
426
|
-
"description": "
|
|
425
|
+
"name": "description",
|
|
426
|
+
"description": "Alert description.",
|
|
427
427
|
"value": {
|
|
428
428
|
"kind": "expression",
|
|
429
429
|
"type": "string"
|
|
430
|
-
}
|
|
430
|
+
},
|
|
431
|
+
"default": "\"\""
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
"name": "variant",
|
|
435
|
+
"description": "Alert variant.",
|
|
436
|
+
"value": {
|
|
437
|
+
"kind": "expression",
|
|
438
|
+
"type": "'primary' | 'secondary' | 'thirdary'"
|
|
439
|
+
},
|
|
440
|
+
"default": "primary"
|
|
431
441
|
},
|
|
432
442
|
{
|
|
433
443
|
"name": "size",
|
|
@@ -491,24 +501,6 @@
|
|
|
491
501
|
"type": "string"
|
|
492
502
|
},
|
|
493
503
|
"default": "\"\""
|
|
494
|
-
},
|
|
495
|
-
{
|
|
496
|
-
"name": "title",
|
|
497
|
-
"description": "Alert title.",
|
|
498
|
-
"value": {
|
|
499
|
-
"kind": "expression",
|
|
500
|
-
"type": "string"
|
|
501
|
-
},
|
|
502
|
-
"default": "\"\""
|
|
503
|
-
},
|
|
504
|
-
{
|
|
505
|
-
"name": "description",
|
|
506
|
-
"description": "Alert description.",
|
|
507
|
-
"value": {
|
|
508
|
-
"kind": "expression",
|
|
509
|
-
"type": "string"
|
|
510
|
-
},
|
|
511
|
-
"default": "\"\""
|
|
512
504
|
}
|
|
513
505
|
],
|
|
514
506
|
"events": [
|
|
@@ -522,6 +514,10 @@
|
|
|
522
514
|
"name": "top",
|
|
523
515
|
"description": "Use it to add something above the text."
|
|
524
516
|
},
|
|
517
|
+
{
|
|
518
|
+
"name": "left",
|
|
519
|
+
"description": "Use it to add something before the text."
|
|
520
|
+
},
|
|
525
521
|
{
|
|
526
522
|
"name": "title",
|
|
527
523
|
"scoped": true,
|
|
@@ -545,12 +541,7 @@
|
|
|
545
541
|
]
|
|
546
542
|
},
|
|
547
543
|
{
|
|
548
|
-
"name": "
|
|
549
|
-
"description": "Use it to add something before the text."
|
|
550
|
-
},
|
|
551
|
-
{
|
|
552
|
-
"name": "default",
|
|
553
|
-
"description": "Use it to add something inside."
|
|
544
|
+
"name": "default"
|
|
554
545
|
},
|
|
555
546
|
{
|
|
556
547
|
"name": "right",
|
|
@@ -4184,6 +4175,10 @@
|
|
|
4184
4175
|
}
|
|
4185
4176
|
],
|
|
4186
4177
|
"slots": [
|
|
4178
|
+
{
|
|
4179
|
+
"name": "left",
|
|
4180
|
+
"description": "Use it to add something before the text."
|
|
4181
|
+
},
|
|
4187
4182
|
{
|
|
4188
4183
|
"name": "icon-left",
|
|
4189
4184
|
"scoped": true,
|
|
@@ -4199,14 +4194,6 @@
|
|
|
4199
4194
|
}
|
|
4200
4195
|
]
|
|
4201
4196
|
},
|
|
4202
|
-
{
|
|
4203
|
-
"name": "left",
|
|
4204
|
-
"description": "Use it to add something before the text."
|
|
4205
|
-
},
|
|
4206
|
-
{
|
|
4207
|
-
"name": "right",
|
|
4208
|
-
"description": "Use it to add something after the text."
|
|
4209
|
-
},
|
|
4210
4197
|
{
|
|
4211
4198
|
"name": "icon-right",
|
|
4212
4199
|
"scoped": true,
|
|
@@ -4221,6 +4208,10 @@
|
|
|
4221
4208
|
"name": "icon-size"
|
|
4222
4209
|
}
|
|
4223
4210
|
]
|
|
4211
|
+
},
|
|
4212
|
+
{
|
|
4213
|
+
"name": "right",
|
|
4214
|
+
"description": "Use it to add something after the text."
|
|
4224
4215
|
}
|
|
4225
4216
|
],
|
|
4226
4217
|
"source": {
|