wave-ui 3.27.0 → 3.27.2
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/dist/wave-ui.cjs.js +3 -3
- package/dist/wave-ui.esm.js +505 -471
- package/dist/wave-ui.umd.js +3 -3
- package/package.json +1 -1
- package/src/wave-ui/components/w-checkbox.vue +5 -1
- package/src/wave-ui/components/w-checkboxes.vue +5 -1
- package/src/wave-ui/components/w-input.vue +5 -1
- package/src/wave-ui/components/w-list.vue +2 -2
- package/src/wave-ui/components/w-radio.vue +6 -1
- package/src/wave-ui/components/w-radios.vue +5 -1
- package/src/wave-ui/components/w-rating.vue +5 -1
- package/src/wave-ui/components/w-select.vue +11 -7
- package/src/wave-ui/components/w-slider.vue +6 -2
- package/src/wave-ui/components/w-switch.vue +5 -1
- package/src/wave-ui/components/w-tabs/index.vue +3 -3
- package/src/wave-ui/components/w-textarea.vue +5 -1
- package/src/wave-ui/components/w-tooltip.vue +3 -2
- package/src/wave-ui/mixins/form-elements.js +7 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wave-ui",
|
|
3
|
-
"version": "3.27.
|
|
3
|
+
"version": "3.27.2",
|
|
4
4
|
"description": "A UI framework for Vue.js 3 (and 2) with only the bright side. :sunny:",
|
|
5
5
|
"author": "Antoni Andre <antoniandre.web@gmail.com>",
|
|
6
6
|
"homepage": "https://antoniandre.github.io/wave-ui",
|
|
@@ -49,12 +49,16 @@ component(
|
|
|
49
49
|
</template>
|
|
50
50
|
|
|
51
51
|
<script>
|
|
52
|
-
import FormElementMixin from '../mixins/form-elements'
|
|
52
|
+
import FormElementMixin, { useWaveUiFormIds } from '../mixins/form-elements'
|
|
53
53
|
|
|
54
54
|
export default {
|
|
55
55
|
name: 'w-checkbox',
|
|
56
56
|
mixins: [FormElementMixin],
|
|
57
57
|
|
|
58
|
+
setup () {
|
|
59
|
+
return useWaveUiFormIds()
|
|
60
|
+
},
|
|
61
|
+
|
|
58
62
|
inject: {
|
|
59
63
|
wCheckboxes: { default: null }
|
|
60
64
|
},
|
|
@@ -31,12 +31,16 @@ component(
|
|
|
31
31
|
|
|
32
32
|
<script>
|
|
33
33
|
import { reactive } from 'vue'
|
|
34
|
-
import FormElementMixin from '../mixins/form-elements'
|
|
34
|
+
import FormElementMixin, { useWaveUiFormIds } from '../mixins/form-elements'
|
|
35
35
|
|
|
36
36
|
export default {
|
|
37
37
|
name: 'w-checkboxes',
|
|
38
38
|
mixins: [FormElementMixin],
|
|
39
39
|
|
|
40
|
+
setup () {
|
|
41
|
+
return useWaveUiFormIds()
|
|
42
|
+
},
|
|
43
|
+
|
|
40
44
|
props: {
|
|
41
45
|
items: { type: Array, required: true }, // All the possible options.
|
|
42
46
|
modelValue: { type: Array }, // v-model on selected option.
|
|
@@ -128,7 +128,7 @@ component(
|
|
|
128
128
|
* - option to fit to the content using contenteditable div
|
|
129
129
|
**/
|
|
130
130
|
|
|
131
|
-
import FormElementMixin from '../mixins/form-elements'
|
|
131
|
+
import FormElementMixin, { useWaveUiFormIds } from '../mixins/form-elements'
|
|
132
132
|
import { reactive } from 'vue'
|
|
133
133
|
|
|
134
134
|
export default {
|
|
@@ -136,6 +136,10 @@ export default {
|
|
|
136
136
|
mixins: [FormElementMixin],
|
|
137
137
|
inheritAttrs: false, // The attrs should only be added to the input not the wrapper.
|
|
138
138
|
|
|
139
|
+
setup () {
|
|
140
|
+
return useWaveUiFormIds()
|
|
141
|
+
},
|
|
142
|
+
|
|
139
143
|
props: {
|
|
140
144
|
modelValue: { default: '' },
|
|
141
145
|
type: { type: String, default: 'text' },
|
|
@@ -49,7 +49,7 @@ export default {
|
|
|
49
49
|
name: 'w-list',
|
|
50
50
|
|
|
51
51
|
setup () {
|
|
52
|
-
return {
|
|
52
|
+
return { waveUiUseId: useId() }
|
|
53
53
|
},
|
|
54
54
|
|
|
55
55
|
props: {
|
|
@@ -96,7 +96,7 @@ export default {
|
|
|
96
96
|
|
|
97
97
|
listId () {
|
|
98
98
|
if (!this.addIds) return null
|
|
99
|
-
return typeof this.addIds === 'string' ? this.addIds : `w-list--${this.
|
|
99
|
+
return typeof this.addIds === 'string' ? this.addIds : `w-list--${this.waveUiUseId}`
|
|
100
100
|
},
|
|
101
101
|
|
|
102
102
|
selectedItems () {
|
|
@@ -47,11 +47,16 @@ component(
|
|
|
47
47
|
</template>
|
|
48
48
|
|
|
49
49
|
<script>
|
|
50
|
-
import FormElementMixin from '../mixins/form-elements'
|
|
50
|
+
import FormElementMixin, { useWaveUiFormIds } from '../mixins/form-elements'
|
|
51
51
|
|
|
52
52
|
export default {
|
|
53
53
|
name: 'w-radio',
|
|
54
54
|
mixins: [FormElementMixin],
|
|
55
|
+
|
|
56
|
+
setup () {
|
|
57
|
+
return useWaveUiFormIds()
|
|
58
|
+
},
|
|
59
|
+
|
|
55
60
|
inject: { wRadios: { default: null } },
|
|
56
61
|
|
|
57
62
|
props: {
|
|
@@ -30,12 +30,16 @@ component(
|
|
|
30
30
|
</template>
|
|
31
31
|
|
|
32
32
|
<script>
|
|
33
|
-
import FormElementMixin from '../mixins/form-elements'
|
|
33
|
+
import FormElementMixin, { useWaveUiFormIds } from '../mixins/form-elements'
|
|
34
34
|
|
|
35
35
|
export default {
|
|
36
36
|
name: 'w-radios',
|
|
37
37
|
mixins: [FormElementMixin],
|
|
38
38
|
|
|
39
|
+
setup () {
|
|
40
|
+
return useWaveUiFormIds()
|
|
41
|
+
},
|
|
42
|
+
|
|
39
43
|
props: {
|
|
40
44
|
items: { type: Array, required: true }, // All the possible options.
|
|
41
45
|
modelValue: { type: [String, Number, Boolean] }, // v-model on selected option.
|
|
@@ -29,12 +29,16 @@ component(
|
|
|
29
29
|
</template>
|
|
30
30
|
|
|
31
31
|
<script>
|
|
32
|
-
import FormElementMixin from '../mixins/form-elements'
|
|
32
|
+
import FormElementMixin, { useWaveUiFormIds } from '../mixins/form-elements'
|
|
33
33
|
|
|
34
34
|
export default {
|
|
35
35
|
name: 'w-rating',
|
|
36
36
|
mixins: [FormElementMixin],
|
|
37
37
|
|
|
38
|
+
setup () {
|
|
39
|
+
return useWaveUiFormIds()
|
|
40
|
+
},
|
|
41
|
+
|
|
38
42
|
props: {
|
|
39
43
|
modelValue: {},
|
|
40
44
|
max: { type: [Number, String], default: 5 },
|
|
@@ -108,12 +108,21 @@ component(
|
|
|
108
108
|
* @todo Share the common parts between w-input, w-textarea & w-select.
|
|
109
109
|
**/
|
|
110
110
|
|
|
111
|
-
import
|
|
111
|
+
import { computed } from 'vue'
|
|
112
|
+
import FormElementMixin, { useWaveUiFormIds } from '../mixins/form-elements'
|
|
112
113
|
|
|
113
114
|
export default {
|
|
114
115
|
name: 'w-select',
|
|
115
116
|
mixins: [FormElementMixin],
|
|
116
117
|
|
|
118
|
+
setup (props) {
|
|
119
|
+
const { waveUiUseId } = useWaveUiFormIds()
|
|
120
|
+
const selectListId = computed(() =>
|
|
121
|
+
props.id ? `${props.id}__listbox` : `w-select-menu--${waveUiUseId}`
|
|
122
|
+
)
|
|
123
|
+
return { waveUiUseId, selectListId }
|
|
124
|
+
},
|
|
125
|
+
|
|
117
126
|
props: {
|
|
118
127
|
items: { type: Array, required: true },
|
|
119
128
|
modelValue: {}, // v-model on selected item if any.
|
|
@@ -147,7 +156,7 @@ export default {
|
|
|
147
156
|
light: { type: Boolean },
|
|
148
157
|
fitToContent: { type: Boolean }
|
|
149
158
|
// Props from mixin: id, name, disabled, readonly, required, tabindex, validators.
|
|
150
|
-
// Computed from mixin: inputId,
|
|
159
|
+
// Computed from mixin: inputId, inputName, isDisabled & isReadonly. `selectListId` from setup.
|
|
151
160
|
},
|
|
152
161
|
|
|
153
162
|
emits: ['input', 'update:modelValue', 'focus', 'blur', 'item-click', 'item-select', 'click:inner-icon-left', 'click:inner-icon-right'],
|
|
@@ -166,11 +175,6 @@ export default {
|
|
|
166
175
|
}),
|
|
167
176
|
|
|
168
177
|
computed: {
|
|
169
|
-
/** Prefix for w-list item ids (`id_item-N`) and ARIA listbox linkage; stable with SSR. */
|
|
170
|
-
selectListId () {
|
|
171
|
-
return this.id ? `${this.id}__listbox` : `w-select-menu--${this._waveUiUseId}`
|
|
172
|
-
},
|
|
173
|
-
|
|
174
178
|
// Check all the items and add a `value` if missing, containing either: value, label or index
|
|
175
179
|
// in this order.
|
|
176
180
|
selectItems () {
|
|
@@ -78,12 +78,16 @@ component(
|
|
|
78
78
|
</template>
|
|
79
79
|
|
|
80
80
|
<script>
|
|
81
|
-
import FormElementMixin from '../mixins/form-elements'
|
|
81
|
+
import FormElementMixin, { useWaveUiFormIds } from '../mixins/form-elements'
|
|
82
82
|
|
|
83
83
|
export default {
|
|
84
84
|
name: 'w-slider',
|
|
85
85
|
mixins: [FormElementMixin],
|
|
86
86
|
|
|
87
|
+
setup () {
|
|
88
|
+
return useWaveUiFormIds()
|
|
89
|
+
},
|
|
90
|
+
|
|
87
91
|
props: {
|
|
88
92
|
modelValue: { type: Number, default: 0 },
|
|
89
93
|
color: { type: String, default: 'primary' },
|
|
@@ -121,7 +125,7 @@ export default {
|
|
|
121
125
|
computed: {
|
|
122
126
|
/** DOM id for the thumb control and related labels (distinct from `inputId` on `w-slider`). */
|
|
123
127
|
thumbId () {
|
|
124
|
-
return this.id ? `${this.id}__thumb` : `button--${this.
|
|
128
|
+
return this.id ? `${this.id}__thumb` : `button--${this.waveUiUseId}`
|
|
125
129
|
},
|
|
126
130
|
|
|
127
131
|
minVal () {
|
|
@@ -53,13 +53,17 @@ component(
|
|
|
53
53
|
</template>
|
|
54
54
|
|
|
55
55
|
<script>
|
|
56
|
-
import FormElementMixin from '../mixins/form-elements'
|
|
56
|
+
import FormElementMixin, { useWaveUiFormIds } from '../mixins/form-elements'
|
|
57
57
|
|
|
58
58
|
export default {
|
|
59
59
|
name: 'w-switch',
|
|
60
60
|
mixins: [FormElementMixin],
|
|
61
61
|
inheritAttrs: false, // The attrs should only be added to the input not the wrapper.
|
|
62
62
|
|
|
63
|
+
setup () {
|
|
64
|
+
return useWaveUiFormIds()
|
|
65
|
+
},
|
|
66
|
+
|
|
63
67
|
props: {
|
|
64
68
|
modelValue: { default: false }, // v-model.
|
|
65
69
|
label: { type: String, default: '' },
|
|
@@ -79,7 +79,7 @@ export default {
|
|
|
79
79
|
name: 'w-tabs',
|
|
80
80
|
|
|
81
81
|
setup () {
|
|
82
|
-
return {
|
|
82
|
+
return { tabsStableId: useId() }
|
|
83
83
|
},
|
|
84
84
|
|
|
85
85
|
props: {
|
|
@@ -183,7 +183,7 @@ export default {
|
|
|
183
183
|
addTab (item) {
|
|
184
184
|
// If there is no unique ID provided, inject one in each tab.
|
|
185
185
|
// This will cause a single other update from watching the tabs items and stop there.
|
|
186
|
-
if (!(item[this.itemIdKey] ?? item._uid ?? false)) item._uid = `${this.
|
|
186
|
+
if (!(item[this.itemIdKey] ?? item._uid ?? false)) item._uid = `${this.tabsStableId}-${this.tabs.length}`
|
|
187
187
|
|
|
188
188
|
this.tabs.push({
|
|
189
189
|
_uid: item[this.itemIdKey] ?? item._uid,
|
|
@@ -200,7 +200,7 @@ export default {
|
|
|
200
200
|
this.tabs = items.map((item, _index) => {
|
|
201
201
|
// If there is no unique ID provided, inject one in each tab.
|
|
202
202
|
// This will cause a single other update from watching the tabs items and stop there.
|
|
203
|
-
if (!(item[this.itemIdKey] ?? item._uid ?? false)) item._uid = `${this.
|
|
203
|
+
if (!(item[this.itemIdKey] ?? item._uid ?? false)) item._uid = `${this.tabsStableId}-${_index}`
|
|
204
204
|
|
|
205
205
|
return {
|
|
206
206
|
...item,
|
|
@@ -67,13 +67,17 @@ component(
|
|
|
67
67
|
* @todo Share the common parts between w-input, w-textarea & w-select.
|
|
68
68
|
**/
|
|
69
69
|
|
|
70
|
-
import FormElementMixin from '../mixins/form-elements'
|
|
70
|
+
import FormElementMixin, { useWaveUiFormIds } from '../mixins/form-elements'
|
|
71
71
|
|
|
72
72
|
export default {
|
|
73
73
|
name: 'w-textarea',
|
|
74
74
|
mixins: [FormElementMixin],
|
|
75
75
|
inheritAttrs: false, // The attrs should only be added to the textarea not the wrapper.
|
|
76
76
|
|
|
77
|
+
setup () {
|
|
78
|
+
return useWaveUiFormIds()
|
|
79
|
+
},
|
|
80
|
+
|
|
77
81
|
props: {
|
|
78
82
|
modelValue: { default: '' },
|
|
79
83
|
label: { type: String },
|
|
@@ -4,7 +4,7 @@ transition(:name="transitionName" appear @after-leave="onAfterLeave")
|
|
|
4
4
|
.w-tooltip(
|
|
5
5
|
v-if="detachableVisible"
|
|
6
6
|
ref="detachable"
|
|
7
|
-
:key="
|
|
7
|
+
:key="tooltipInstanceId"
|
|
8
8
|
:class="classes"
|
|
9
9
|
:style="styles")
|
|
10
10
|
slot
|
|
@@ -20,7 +20,8 @@ export default {
|
|
|
20
20
|
mixins: [DetachableMixin],
|
|
21
21
|
|
|
22
22
|
setup () {
|
|
23
|
-
|
|
23
|
+
// No leading `_`/`$`: Vue omits those from the render context (setup() reserved prefixes).
|
|
24
|
+
return { tooltipInstanceId: useId() }
|
|
24
25
|
},
|
|
25
26
|
|
|
26
27
|
props: {
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { useId } from 'vue'
|
|
2
2
|
|
|
3
|
+
/** SSR-safe id suffix; call from each component's `setup()` (mixin `setup` is not reliably merged). */
|
|
4
|
+
export function useWaveUiFormIds () {
|
|
5
|
+
return { waveUiUseId: useId() }
|
|
6
|
+
}
|
|
7
|
+
|
|
3
8
|
export default {
|
|
4
9
|
inject: {
|
|
5
10
|
// Used in each form component to determine whether to use the w-form-element wrap or not.
|
|
@@ -9,13 +14,6 @@ export default {
|
|
|
9
14
|
formProps: { default: () => ({ disabled: false, readonly: false }) }
|
|
10
15
|
},
|
|
11
16
|
|
|
12
|
-
setup () {
|
|
13
|
-
return {
|
|
14
|
-
// SSR-safe unique suffix (Vue 3.5+). Exposed on `this` for Options API templates.
|
|
15
|
-
_waveUiUseId: useId()
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
|
|
19
17
|
props: {
|
|
20
18
|
/** When set, used as the DOM `id` and for associated labels (`for`). SSR-safe when provided. */
|
|
21
19
|
id: { type: String },
|
|
@@ -37,11 +35,11 @@ export default {
|
|
|
37
35
|
/** Stable DOM id for the control (and labels), including SSR/hydration. */
|
|
38
36
|
inputId () {
|
|
39
37
|
const componentName = this.$options.name || 'w-field'
|
|
40
|
-
return this.id || `${componentName}--${this.
|
|
38
|
+
return this.id || `${componentName}--${this.waveUiUseId}`
|
|
41
39
|
},
|
|
42
40
|
|
|
43
41
|
inputName () {
|
|
44
|
-
return this.name || `${this.$options.name}--${this.
|
|
42
|
+
return this.name || `${this.$options.name}--${this.waveUiUseId}`
|
|
45
43
|
},
|
|
46
44
|
isDisabled () {
|
|
47
45
|
return this.disabled || this.formProps.disabled
|