vueless 0.0.647 → 0.0.648
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-toggle/UToggle.vue +8 -0
- package/ui.form-checkbox/UCheckbox.vue +8 -0
- package/ui.form-checkbox-group/UCheckboxGroup.vue +8 -0
- package/ui.form-color-picker/UColorPicker.vue +8 -0
- package/ui.form-input/UInput.vue +8 -0
- package/ui.form-input-file/UInputFile.vue +8 -0
- package/ui.form-input-number/UInputNumber.vue +8 -0
- package/ui.form-input-rating/UInputRating.vue +8 -0
- package/ui.form-label/ULabel.vue +18 -15
- package/ui.form-label/storybook/stories.ts +13 -2
- package/ui.form-radio/URadio.vue +8 -0
- package/ui.form-radio-group/URadioGroup.vue +8 -0
- package/ui.form-select/USelect.vue +8 -0
- package/ui.form-switch/USwitch.vue +8 -0
- package/ui.form-textarea/UTextarea.vue +8 -0
- package/ui.text-files/UFiles.vue +8 -0
package/package.json
CHANGED
|
@@ -86,6 +86,14 @@ const { toggleLabelAttrs, itemsAttrs, itemAttrs } = useUI<Config>(defaultConfig)
|
|
|
86
86
|
v-bind="toggleLabelAttrs"
|
|
87
87
|
:data-test="dataTest"
|
|
88
88
|
>
|
|
89
|
+
<template #label>
|
|
90
|
+
<!--
|
|
91
|
+
@slot Use this to add custom content instead of the label.
|
|
92
|
+
@binding {string} label
|
|
93
|
+
-->
|
|
94
|
+
<slot name="label" :label="label" />
|
|
95
|
+
</template>
|
|
96
|
+
|
|
89
97
|
<div v-bind="itemsAttrs">
|
|
90
98
|
<!-- @slot Use it to add UToggleItem directly. -->
|
|
91
99
|
<slot>
|
|
@@ -136,6 +136,14 @@ const { config, checkboxAttrs, iconWrapperAttrs, checkboxLabelAttrs, checkedIcon
|
|
|
136
136
|
v-bind="checkboxLabelAttrs"
|
|
137
137
|
:data-test="`${dataTest}-label`"
|
|
138
138
|
>
|
|
139
|
+
<template #label>
|
|
140
|
+
<!--
|
|
141
|
+
@slot Use this to add custom content instead of the label.
|
|
142
|
+
@binding {string} label
|
|
143
|
+
-->
|
|
144
|
+
<slot name="label" :label="label" />
|
|
145
|
+
</template>
|
|
146
|
+
|
|
139
147
|
<input
|
|
140
148
|
:id="elementId"
|
|
141
149
|
type="checkbox"
|
|
@@ -77,6 +77,14 @@ const { groupLabelAttrs, groupCheckboxAttrs, listAttrs } = useUI<Config>(default
|
|
|
77
77
|
v-bind="groupLabelAttrs"
|
|
78
78
|
:data-test="dataTest"
|
|
79
79
|
>
|
|
80
|
+
<template #label>
|
|
81
|
+
<!--
|
|
82
|
+
@slot Use this to add custom content instead of the label.
|
|
83
|
+
@binding {string} label
|
|
84
|
+
-->
|
|
85
|
+
<slot name="label" :label="label" />
|
|
86
|
+
</template>
|
|
87
|
+
|
|
80
88
|
<div v-bind="listAttrs">
|
|
81
89
|
<!-- @slot Use it to add URadio directly. -->
|
|
82
90
|
<slot>
|
|
@@ -69,6 +69,14 @@ const {
|
|
|
69
69
|
v-bind="colorPickerLabelAttrs"
|
|
70
70
|
:data-test="dataTest"
|
|
71
71
|
>
|
|
72
|
+
<template #label>
|
|
73
|
+
<!--
|
|
74
|
+
@slot Use this to add custom content instead of the label.
|
|
75
|
+
@binding {string} label
|
|
76
|
+
-->
|
|
77
|
+
<slot name="label" :label="label" />
|
|
78
|
+
</template>
|
|
79
|
+
|
|
72
80
|
<div v-bind="listAttrs">
|
|
73
81
|
<div v-bind="unselectedAttrs">
|
|
74
82
|
<URadio
|
package/ui.form-input/UInput.vue
CHANGED
|
@@ -266,6 +266,14 @@ const {
|
|
|
266
266
|
interactive
|
|
267
267
|
v-bind="inputLabelAttrs"
|
|
268
268
|
>
|
|
269
|
+
<template #label>
|
|
270
|
+
<!--
|
|
271
|
+
@slot Use this to add custom content instead of the label.
|
|
272
|
+
@binding {string} label
|
|
273
|
+
-->
|
|
274
|
+
<slot name="label" :label="label" />
|
|
275
|
+
</template>
|
|
276
|
+
|
|
269
277
|
<label :for="elementId" v-bind="wrapperAttrs">
|
|
270
278
|
<span
|
|
271
279
|
v-if="hasSlotContent($slots['left']) || leftIcon"
|
|
@@ -274,6 +274,14 @@ const {
|
|
|
274
274
|
interactive
|
|
275
275
|
v-bind="inputLabelAttrs"
|
|
276
276
|
>
|
|
277
|
+
<template #label>
|
|
278
|
+
<!--
|
|
279
|
+
@slot Use this to add custom content instead of the label.
|
|
280
|
+
@binding {string} label
|
|
281
|
+
-->
|
|
282
|
+
<slot name="label" :label="label" />
|
|
283
|
+
</template>
|
|
284
|
+
|
|
277
285
|
<div ref="dropZoneRef" :ondrop="onDrop" v-bind="dropzoneAttrs">
|
|
278
286
|
<UText v-if="hasSlotContent($slots['top'])" :size="size" v-bind="descriptionTopAttrs">
|
|
279
287
|
<!-- @slot Use it to add something above the component content. -->
|
|
@@ -76,6 +76,14 @@ const {
|
|
|
76
76
|
v-bind="labelAttrs"
|
|
77
77
|
:data-test="dataTest"
|
|
78
78
|
>
|
|
79
|
+
<template #label>
|
|
80
|
+
<!--
|
|
81
|
+
@slot Use this to add custom content instead of the label.
|
|
82
|
+
@binding {string} label
|
|
83
|
+
-->
|
|
84
|
+
<slot name="label" :label="label" />
|
|
85
|
+
</template>
|
|
86
|
+
|
|
79
87
|
<UButton
|
|
80
88
|
variant="thirdary"
|
|
81
89
|
size="sm"
|
|
@@ -74,6 +74,14 @@ const { config, inputLabelAttrs, containerAttrs, counterAttrs, totalAttrs, stars
|
|
|
74
74
|
v-bind="inputLabelAttrs"
|
|
75
75
|
:data-test="dataTest"
|
|
76
76
|
>
|
|
77
|
+
<template #label>
|
|
78
|
+
<!--
|
|
79
|
+
@slot Use this to add custom content instead of the label.
|
|
80
|
+
@binding {string} label
|
|
81
|
+
-->
|
|
82
|
+
<slot name="label" :label="label" />
|
|
83
|
+
</template>
|
|
84
|
+
|
|
77
85
|
<div v-bind="containerAttrs">
|
|
78
86
|
<div v-if="counter || hasSlotContent($slots['counter'])" v-bind="counterAttrs">
|
|
79
87
|
<!--
|
package/ui.form-label/ULabel.vue
CHANGED
|
@@ -88,13 +88,15 @@ const { wrapperAttrs, contentAttrs, labelAttrs, descriptionAttrs } = useUI<Confi
|
|
|
88
88
|
|
|
89
89
|
<!-- `v-bind` isn't assigned, because the div is system -->
|
|
90
90
|
<div v-if="label || error || description">
|
|
91
|
-
<label
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
91
|
+
<label v-if="label" :for="props.for" v-bind="labelAttrs" :data-test="`${dataTest}-label`">
|
|
92
|
+
<!--
|
|
93
|
+
@slot Use this to add custom content instead of the label.
|
|
94
|
+
@binding {string} label
|
|
95
|
+
-->
|
|
96
|
+
<slot name="label" :label="label">
|
|
97
|
+
{{ label }}
|
|
98
|
+
</slot>
|
|
99
|
+
</label>
|
|
98
100
|
|
|
99
101
|
<div v-if="error" v-bind="descriptionAttrs" :data-test="`${dataTest}-error`" v-text="error" />
|
|
100
102
|
|
|
@@ -111,14 +113,15 @@ const { wrapperAttrs, contentAttrs, labelAttrs, descriptionAttrs } = useUI<Confi
|
|
|
111
113
|
</div>
|
|
112
114
|
|
|
113
115
|
<div v-else v-bind="wrapperAttrs">
|
|
114
|
-
<label
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
:
|
|
120
|
-
|
|
121
|
-
|
|
116
|
+
<label v-if="label" :for="props.for" v-bind="labelAttrs" :data-test="`${dataTest}-label`">
|
|
117
|
+
<!--
|
|
118
|
+
@slot Use this to add custom content instead of the label.
|
|
119
|
+
@binding {string} label
|
|
120
|
+
-->
|
|
121
|
+
<slot name="label" :label="label">
|
|
122
|
+
{{ label }}
|
|
123
|
+
</slot>
|
|
124
|
+
</label>
|
|
122
125
|
|
|
123
126
|
<div v-bind="contentAttrs">
|
|
124
127
|
<!-- @slot Use it to add label content. -->
|
|
@@ -9,6 +9,7 @@ import ULabel from "../../ui.form-label/ULabel.vue";
|
|
|
9
9
|
import UCol from "../../ui.container-col/UCol.vue";
|
|
10
10
|
import UText from "../../ui.text-block/UText.vue";
|
|
11
11
|
import UIcon from "../../ui.image-icon/UIcon.vue";
|
|
12
|
+
import UBadge from "../../ui.text-badge/UBadge.vue";
|
|
12
13
|
|
|
13
14
|
import type { Meta, StoryFn } from "@storybook/vue3";
|
|
14
15
|
import type { Props } from "../types.ts";
|
|
@@ -39,7 +40,7 @@ export default {
|
|
|
39
40
|
const defaultTemplate = "This is plain text";
|
|
40
41
|
|
|
41
42
|
const DefaultTemplate: StoryFn<ULabelArgs> = (args: ULabelArgs) => ({
|
|
42
|
-
components: { ULabel, UText, UIcon },
|
|
43
|
+
components: { ULabel, UText, UIcon, UBadge },
|
|
43
44
|
setup() {
|
|
44
45
|
const slots = getSlotNames(ULabel.__name);
|
|
45
46
|
|
|
@@ -108,10 +109,20 @@ Error.args = { error: "Error description" };
|
|
|
108
109
|
export const Disabled = DefaultTemplate.bind({});
|
|
109
110
|
Disabled.args = { disabled: true };
|
|
110
111
|
|
|
112
|
+
export const SlotLabel = DefaultTemplate.bind({});
|
|
113
|
+
SlotLabel.args = {
|
|
114
|
+
label: "Custom badge label",
|
|
115
|
+
slotTemplate: `
|
|
116
|
+
<template #label="{ label }">
|
|
117
|
+
<UBadge :label="label" color="green" />
|
|
118
|
+
</template>
|
|
119
|
+
`,
|
|
120
|
+
};
|
|
121
|
+
|
|
111
122
|
export const SlotFooter = DefaultTemplate.bind({});
|
|
112
123
|
SlotFooter.args = {
|
|
113
124
|
slotTemplate: `
|
|
114
|
-
<template #
|
|
125
|
+
<template #bottom>
|
|
115
126
|
<UIcon name="star" color="green" />
|
|
116
127
|
</template>
|
|
117
128
|
`,
|
package/ui.form-radio/URadio.vue
CHANGED
|
@@ -107,6 +107,14 @@ const { radioAttrs, radioLabelAttrs } = useUI<Config>(defaultConfig, mutatedProp
|
|
|
107
107
|
v-bind="radioLabelAttrs"
|
|
108
108
|
:data-test="`${dataTest}-label`"
|
|
109
109
|
>
|
|
110
|
+
<template #label>
|
|
111
|
+
<!--
|
|
112
|
+
@slot Use this to add custom content instead of the label.
|
|
113
|
+
@binding {string} label
|
|
114
|
+
-->
|
|
115
|
+
<slot name="label" :label="label" />
|
|
116
|
+
</template>
|
|
117
|
+
|
|
110
118
|
<input
|
|
111
119
|
:id="elementId"
|
|
112
120
|
type="radio"
|
|
@@ -60,6 +60,14 @@ const { groupLabelAttrs, listAttrs, groupRadioAttrs } = useUI<Config>(defaultCon
|
|
|
60
60
|
v-bind="groupLabelAttrs"
|
|
61
61
|
:data-test="dataTest"
|
|
62
62
|
>
|
|
63
|
+
<template #label>
|
|
64
|
+
<!--
|
|
65
|
+
@slot Use this to add custom content instead of the label.
|
|
66
|
+
@binding {string} label
|
|
67
|
+
-->
|
|
68
|
+
<slot name="label" :label="label" />
|
|
69
|
+
</template>
|
|
70
|
+
|
|
63
71
|
<div v-bind="listAttrs">
|
|
64
72
|
<!-- @slot Use it to add URadio directly. -->
|
|
65
73
|
<slot>
|
|
@@ -456,6 +456,14 @@ const {
|
|
|
456
456
|
:data-test="dataTest"
|
|
457
457
|
:tabindex="-1"
|
|
458
458
|
>
|
|
459
|
+
<template #label>
|
|
460
|
+
<!--
|
|
461
|
+
@slot Use this to add custom content instead of the label.
|
|
462
|
+
@binding {string} label
|
|
463
|
+
-->
|
|
464
|
+
<slot name="label" :label="label" />
|
|
465
|
+
</template>
|
|
466
|
+
|
|
459
467
|
<div
|
|
460
468
|
ref="wrapperRef"
|
|
461
469
|
:tabindex="searchable || disabled ? -1 : 0"
|
|
@@ -100,6 +100,14 @@ const {
|
|
|
100
100
|
:data-test="dataTest"
|
|
101
101
|
@click="onClickToggle"
|
|
102
102
|
>
|
|
103
|
+
<template #label>
|
|
104
|
+
<!--
|
|
105
|
+
@slot Use this to add custom content instead of the label.
|
|
106
|
+
@binding {string} label
|
|
107
|
+
-->
|
|
108
|
+
<slot name="label" :label="label" />
|
|
109
|
+
</template>
|
|
110
|
+
|
|
103
111
|
<label :for="elementId" v-bind="wrapperAttrs">
|
|
104
112
|
<input
|
|
105
113
|
:id="elementId"
|
|
@@ -207,6 +207,14 @@ const { textareaAttrs, textareaLabelAttrs, wrapperAttrs, leftSlotAttrs, rightSlo
|
|
|
207
207
|
v-bind="textareaLabelAttrs"
|
|
208
208
|
:data-test="dataTest"
|
|
209
209
|
>
|
|
210
|
+
<template #label>
|
|
211
|
+
<!--
|
|
212
|
+
@slot Use this to add custom content instead of the label.
|
|
213
|
+
@binding {string} label
|
|
214
|
+
-->
|
|
215
|
+
<slot name="label" :label="label" />
|
|
216
|
+
</template>
|
|
217
|
+
|
|
210
218
|
<label ref="wrapperRef" :for="elementId" v-bind="wrapperAttrs">
|
|
211
219
|
<div
|
|
212
220
|
v-if="hasSlotContent($slots['left'])"
|
package/ui.text-files/UFiles.vue
CHANGED
|
@@ -62,6 +62,14 @@ const { filesLabelAttrs, itemsAttrs, itemAttrs } = useUI<Config>(defaultConfig);
|
|
|
62
62
|
:align="labelAlign"
|
|
63
63
|
v-bind="filesLabelAttrs"
|
|
64
64
|
>
|
|
65
|
+
<template #label>
|
|
66
|
+
<!--
|
|
67
|
+
@slot Use this to add custom content instead of the label.
|
|
68
|
+
@binding {string} label
|
|
69
|
+
-->
|
|
70
|
+
<slot name="label" :label="label" />
|
|
71
|
+
</template>
|
|
72
|
+
|
|
65
73
|
<div v-bind="itemsAttrs">
|
|
66
74
|
<!-- @slot Use it to add UFile. -->
|
|
67
75
|
<slot>
|