vueless 0.0.411 → 0.0.413
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-table/UTable.vue +3 -3
- package/ui.data-table/UTableRow.vue +10 -1
- package/ui.form-checkbox/UCheckbox.vue +3 -2
- package/ui.form-checkbox-group/UCheckboxGroup.vue +1 -0
- package/ui.form-checkbox-multi-state/UCheckboxMultiState.vue +2 -2
- package/ui.form-checkbox-multi-state/config.js +1 -1
- package/ui.form-checkbox-multi-state/useAttrs.js +1 -1
- package/ui.form-color-picker/UColorPicker.vue +4 -4
- package/ui.form-color-picker/config.js +2 -2
- package/ui.form-date-picker/UDatePicker.vue +1 -1
- package/ui.form-input/UInput.vue +1 -1
- package/ui.form-input-file/UInputFile.vue +41 -41
- package/ui.form-input-file/config.js +6 -6
- package/ui.form-input-money/UInputMoney.vue +3 -3
- package/ui.form-input-money/config.js +1 -1
- package/ui.form-input-number/UInputNumber.vue +37 -4
- package/ui.form-input-number/config.js +1 -1
- package/ui.form-input-rating/UInputRating.vue +2 -2
- package/ui.form-input-rating/config.js +1 -1
- package/ui.form-input-search/UInputSearch.vue +30 -26
- package/ui.form-input-search/config.js +2 -2
- package/ui.form-label/ULabel.vue +42 -36
- package/ui.form-radio/URadio.vue +4 -3
- package/ui.form-radio-group/URadioGroup.vue +2 -1
- package/ui.form-select/USelect.vue +1 -1
- package/ui.form-switch/USwitch.vue +8 -8
- package/ui.form-textarea/UTextarea.vue +1 -1
- package/utils/utilStorybook.js +7 -0
- package/web-types.json +149 -107
package/ui.form-label/ULabel.vue
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
@click="onClick"
|
|
7
7
|
>
|
|
8
8
|
<div v-bind="contentAttrs">
|
|
9
|
-
<!-- @slot Use it to
|
|
9
|
+
<!-- @slot Use it to add label content. -->
|
|
10
10
|
<slot />
|
|
11
11
|
</div>
|
|
12
12
|
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
/>
|
|
46
46
|
|
|
47
47
|
<div v-bind="contentAttrs">
|
|
48
|
-
<!-- @slot Use it to
|
|
48
|
+
<!-- @slot Use it to add label content. -->
|
|
49
49
|
<slot />
|
|
50
50
|
</div>
|
|
51
51
|
|
|
@@ -83,7 +83,7 @@ const emit = defineEmits([
|
|
|
83
83
|
|
|
84
84
|
const props = defineProps({
|
|
85
85
|
/**
|
|
86
|
-
*
|
|
86
|
+
* Label text.
|
|
87
87
|
*/
|
|
88
88
|
label: {
|
|
89
89
|
type: String,
|
|
@@ -91,16 +91,23 @@ const props = defineProps({
|
|
|
91
91
|
},
|
|
92
92
|
|
|
93
93
|
/**
|
|
94
|
-
*
|
|
95
|
-
* @values sm, md, lg
|
|
94
|
+
* Label description.
|
|
96
95
|
*/
|
|
97
|
-
|
|
96
|
+
description: {
|
|
98
97
|
type: String,
|
|
99
|
-
default:
|
|
98
|
+
default: "",
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Label error message.
|
|
103
|
+
*/
|
|
104
|
+
error: {
|
|
105
|
+
type: String,
|
|
106
|
+
default: "",
|
|
100
107
|
},
|
|
101
108
|
|
|
102
109
|
/**
|
|
103
|
-
* Label
|
|
110
|
+
* Label align.
|
|
104
111
|
* @values top, topInside, topWithDesc, left, right
|
|
105
112
|
*/
|
|
106
113
|
align: {
|
|
@@ -109,46 +116,38 @@ const props = defineProps({
|
|
|
109
116
|
},
|
|
110
117
|
|
|
111
118
|
/**
|
|
112
|
-
*
|
|
119
|
+
* Label size.
|
|
120
|
+
* @values sm, md, lg
|
|
113
121
|
*/
|
|
114
|
-
|
|
115
|
-
type:
|
|
116
|
-
default: getDefault(defaultConfig, ULabel).
|
|
122
|
+
size: {
|
|
123
|
+
type: String,
|
|
124
|
+
default: getDefault(defaultConfig, ULabel).size,
|
|
117
125
|
},
|
|
118
126
|
|
|
119
127
|
/**
|
|
120
|
-
*
|
|
128
|
+
* Make label disabled.
|
|
121
129
|
*/
|
|
122
|
-
|
|
123
|
-
type:
|
|
124
|
-
default:
|
|
130
|
+
disabled: {
|
|
131
|
+
type: Boolean,
|
|
132
|
+
default: getDefault(defaultConfig, ULabel).disabled,
|
|
125
133
|
},
|
|
126
134
|
|
|
127
135
|
/**
|
|
128
|
-
*
|
|
136
|
+
* Centre label horizontally.
|
|
129
137
|
*/
|
|
130
|
-
|
|
131
|
-
type:
|
|
132
|
-
default:
|
|
138
|
+
centred: {
|
|
139
|
+
type: Boolean,
|
|
140
|
+
default: getDefault(defaultConfig, ULabel).centred,
|
|
133
141
|
},
|
|
134
142
|
|
|
135
143
|
/**
|
|
136
|
-
* Set id label for.
|
|
137
|
-
* @ignore
|
|
144
|
+
* Set input id for label `for` attribute.
|
|
138
145
|
*/
|
|
139
146
|
for: {
|
|
140
147
|
type: String,
|
|
141
148
|
default: "",
|
|
142
149
|
},
|
|
143
150
|
|
|
144
|
-
/**
|
|
145
|
-
* Make label disabled.
|
|
146
|
-
*/
|
|
147
|
-
disabled: {
|
|
148
|
-
type: Boolean,
|
|
149
|
-
default: getDefault(defaultConfig, ULabel).disabled,
|
|
150
|
-
},
|
|
151
|
-
|
|
152
151
|
/**
|
|
153
152
|
* Component config object.
|
|
154
153
|
*/
|
|
@@ -171,14 +170,21 @@ const wrapperRef = ref(null);
|
|
|
171
170
|
|
|
172
171
|
const { wrapperAttrs, contentAttrs, labelAttrs, descriptionAttrs } = useAttrs(props);
|
|
173
172
|
|
|
174
|
-
const isHorizontalPlacement = computed(
|
|
175
|
-
|
|
176
|
-
);
|
|
173
|
+
const isHorizontalPlacement = computed(() => {
|
|
174
|
+
return props.align === PLACEMENT.left || props.align === PLACEMENT.right;
|
|
175
|
+
});
|
|
177
176
|
|
|
178
|
-
const isTopWithDescPlacement = computed(() =>
|
|
177
|
+
const isTopWithDescPlacement = computed(() => {
|
|
178
|
+
return props.align === PLACEMENT.topWithDesc;
|
|
179
|
+
});
|
|
179
180
|
|
|
180
|
-
const labelElement = computed(() =>
|
|
181
|
-
|
|
181
|
+
const labelElement = computed(() => {
|
|
182
|
+
return labelRef.value;
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
const wrapperElement = computed(() => {
|
|
186
|
+
return wrapperRef.value;
|
|
187
|
+
});
|
|
182
188
|
|
|
183
189
|
function onClick(event) {
|
|
184
190
|
emit("click", event);
|
package/ui.form-radio/URadio.vue
CHANGED
|
@@ -22,8 +22,9 @@
|
|
|
22
22
|
@change="onChange"
|
|
23
23
|
/>
|
|
24
24
|
|
|
25
|
-
<template #
|
|
26
|
-
|
|
25
|
+
<template #bottom>
|
|
26
|
+
<!-- @slot Use it to add something below the radio. -->
|
|
27
|
+
<slot name="bottom" />
|
|
27
28
|
</template>
|
|
28
29
|
</ULabel>
|
|
29
30
|
</template>
|
|
@@ -48,7 +49,7 @@ const getRadioGroupSelectedItem = inject("getRadioGroupSelectedItem", null);
|
|
|
48
49
|
|
|
49
50
|
const props = defineProps({
|
|
50
51
|
/**
|
|
51
|
-
*
|
|
52
|
+
* Radio value.
|
|
52
53
|
*/
|
|
53
54
|
modelValue: {
|
|
54
55
|
type: [Boolean, String, Number, Array, Object],
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
:data-test="dataTest"
|
|
11
11
|
>
|
|
12
12
|
<div v-bind="listAttrs">
|
|
13
|
+
<!-- @slot Use it to add URadio directly. -->
|
|
13
14
|
<slot>
|
|
14
15
|
<URadio
|
|
15
16
|
v-for="(option, index) in options"
|
|
@@ -128,7 +129,7 @@ const props = defineProps({
|
|
|
128
129
|
*/
|
|
129
130
|
dataTest: {
|
|
130
131
|
type: String,
|
|
131
|
-
default: "
|
|
132
|
+
default: "",
|
|
132
133
|
},
|
|
133
134
|
});
|
|
134
135
|
|
|
@@ -54,7 +54,7 @@ defineOptions({ inheritAttrs: false });
|
|
|
54
54
|
|
|
55
55
|
const props = defineProps({
|
|
56
56
|
/**
|
|
57
|
-
*
|
|
57
|
+
* Switch value.
|
|
58
58
|
*/
|
|
59
59
|
modelValue: {
|
|
60
60
|
type: Boolean,
|
|
@@ -71,7 +71,7 @@ const props = defineProps({
|
|
|
71
71
|
},
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
|
-
*
|
|
74
|
+
* Switch label.
|
|
75
75
|
*/
|
|
76
76
|
label: {
|
|
77
77
|
type: String,
|
|
@@ -79,7 +79,7 @@ const props = defineProps({
|
|
|
79
79
|
},
|
|
80
80
|
|
|
81
81
|
/**
|
|
82
|
-
*
|
|
82
|
+
* Switch description.
|
|
83
83
|
*/
|
|
84
84
|
description: {
|
|
85
85
|
type: String,
|
|
@@ -87,7 +87,7 @@ const props = defineProps({
|
|
|
87
87
|
},
|
|
88
88
|
|
|
89
89
|
/**
|
|
90
|
-
*
|
|
90
|
+
* Switch size.
|
|
91
91
|
* @values sm, md, lg
|
|
92
92
|
*/
|
|
93
93
|
size: {
|
|
@@ -96,7 +96,7 @@ const props = defineProps({
|
|
|
96
96
|
},
|
|
97
97
|
|
|
98
98
|
/**
|
|
99
|
-
*
|
|
99
|
+
* Switch color.
|
|
100
100
|
* @values brand, grayscale, gray, red, orange, amber, yellow, lime, green, emerald, teal, cyan, sky, blue, indigo, violet, purple, fuchsia, pink, rose, white */
|
|
101
101
|
color: {
|
|
102
102
|
type: String,
|
|
@@ -104,7 +104,7 @@ const props = defineProps({
|
|
|
104
104
|
},
|
|
105
105
|
|
|
106
106
|
/**
|
|
107
|
-
* Show
|
|
107
|
+
* Show toggle icons inside the circle.
|
|
108
108
|
*/
|
|
109
109
|
toggleIcon: {
|
|
110
110
|
type: Boolean,
|
|
@@ -112,7 +112,7 @@ const props = defineProps({
|
|
|
112
112
|
},
|
|
113
113
|
|
|
114
114
|
/**
|
|
115
|
-
*
|
|
115
|
+
* Show toggle labels (on / off).
|
|
116
116
|
*/
|
|
117
117
|
toggleLabel: {
|
|
118
118
|
type: Boolean,
|
|
@@ -120,7 +120,7 @@ const props = defineProps({
|
|
|
120
120
|
},
|
|
121
121
|
|
|
122
122
|
/**
|
|
123
|
-
*
|
|
123
|
+
* Set switch disabled.
|
|
124
124
|
*/
|
|
125
125
|
disabled: {
|
|
126
126
|
type: Boolean,
|
package/utils/utilStorybook.js
CHANGED
|
@@ -73,6 +73,13 @@ export function getArgTypes(componentName) {
|
|
|
73
73
|
defaultValue: { summary: attribute.default || "" },
|
|
74
74
|
},
|
|
75
75
|
};
|
|
76
|
+
} else {
|
|
77
|
+
types[attribute.name] = {
|
|
78
|
+
control: type.split("|")[0],
|
|
79
|
+
table: {
|
|
80
|
+
defaultValue: { summary: attribute.default || "" },
|
|
81
|
+
},
|
|
82
|
+
};
|
|
76
83
|
}
|
|
77
84
|
}
|
|
78
85
|
|