wave-ui 1.67.4 → 1.68.1
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 +1 -1
- package/dist/wave-ui.css +1 -1
- package/dist/wave-ui.es.js +9 -5
- package/dist/wave-ui.umd.js +1 -1
- package/package.json +1 -1
- package/src/wave-ui/components/w-button/index.vue +2 -0
- package/src/wave-ui/components/w-checkbox.vue +14 -10
- package/src/wave-ui/components/w-radio.vue +4 -3
- package/src/wave-ui/components/w-select.vue +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wave-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.68.1",
|
|
4
4
|
"description": "An emerging UI framework for Vue.js (2 & 3) with only the bright side. :sunny:",
|
|
5
5
|
"author": "Antoni Andre <antoniandre.web@gmail.com>",
|
|
6
6
|
"homepage": "https://antoniandre.github.io/wave-ui",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
component(
|
|
3
3
|
ref="formEl"
|
|
4
4
|
:is="formRegister && !wCheckboxes ? 'w-form-element' : 'div'"
|
|
5
|
-
v-bind="formRegister && { validators, inputValue: isChecked, disabled: isDisabled }"
|
|
5
|
+
v-bind="formRegister && { validators, inputValue: isChecked, disabled: isDisabled, readonly: isReadonly }"
|
|
6
6
|
:valid.sync="valid"
|
|
7
7
|
@reset="$emit('update:modelValue', isChecked = null);$emit('input', null)"
|
|
8
8
|
:class="classes")
|
|
@@ -12,12 +12,12 @@ component(
|
|
|
12
12
|
type="checkbox"
|
|
13
13
|
:name="inputName"
|
|
14
14
|
:checked="isChecked || null"
|
|
15
|
-
:disabled="isDisabled || null"
|
|
15
|
+
:disabled="isDisabled || isReadonly || null"
|
|
16
16
|
:required="required || null"
|
|
17
17
|
:tabindex="tabindex || null"
|
|
18
18
|
@focus="$emit('focus', $event)"
|
|
19
19
|
@blur="$emit('blur', $event)"
|
|
20
|
-
@change="onInput() /* Edge doesn't
|
|
20
|
+
@change="onInput() /* Edge doesn't emit an `input` event on checkbox/radio/select change */"
|
|
21
21
|
@keypress.enter="onInput"
|
|
22
22
|
:aria-checked="isChecked || 'false'"
|
|
23
23
|
role="checkbox")
|
|
@@ -93,6 +93,7 @@ export default {
|
|
|
93
93
|
return {
|
|
94
94
|
[`w-checkbox w-checkbox--${this.isChecked ? 'checked' : 'unchecked'}`]: true,
|
|
95
95
|
'w-checkbox--disabled': this.isDisabled,
|
|
96
|
+
'w-checkbox--readonly': this.isReadonly,
|
|
96
97
|
'w-checkbox--indeterminate': this.indeterminate,
|
|
97
98
|
'w-checkbox--ripple': this.ripple.start,
|
|
98
99
|
'w-checkbox--rippled': this.ripple.end,
|
|
@@ -142,11 +143,8 @@ $inactive-color: #666;
|
|
|
142
143
|
vertical-align: middle;
|
|
143
144
|
// Contain the hidden radio button, so browser doesn't pan to it when outside of the screen.
|
|
144
145
|
position: relative;
|
|
145
|
-
cursor: pointer;
|
|
146
146
|
-webkit-tap-highlight-color: transparent;
|
|
147
147
|
|
|
148
|
-
&--disabled {cursor: not-allowed;}
|
|
149
|
-
|
|
150
148
|
// The hidden real checkbox.
|
|
151
149
|
input[type="checkbox"] {
|
|
152
150
|
position: absolute;
|
|
@@ -164,8 +162,10 @@ $inactive-color: #666;
|
|
|
164
162
|
flex: 0 0 auto; // Prevent stretching width or height.
|
|
165
163
|
align-items: center;
|
|
166
164
|
justify-content: center;
|
|
167
|
-
cursor:
|
|
165
|
+
cursor: pointer;
|
|
168
166
|
z-index: 0;
|
|
167
|
+
|
|
168
|
+
.w-checkbox--disabled & {cursor: not-allowed;}
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
// The checkmark - visible when checked.
|
|
@@ -192,6 +192,7 @@ $inactive-color: #666;
|
|
|
192
192
|
|
|
193
193
|
.w-checkbox--indeterminate & {opacity: 0;}
|
|
194
194
|
}
|
|
195
|
+
|
|
195
196
|
&__input:after {
|
|
196
197
|
content: '';
|
|
197
198
|
position: absolute;
|
|
@@ -242,7 +243,7 @@ $inactive-color: #666;
|
|
|
242
243
|
}
|
|
243
244
|
|
|
244
245
|
:focus ~ &__input:before,
|
|
245
|
-
:active ~ &__input:before {
|
|
246
|
+
&:not(.w-checkbox--disabled) :active ~ &__input:before {
|
|
246
247
|
transform: scale(1.8);
|
|
247
248
|
opacity: 0.2;
|
|
248
249
|
}
|
|
@@ -258,10 +259,13 @@ $inactive-color: #666;
|
|
|
258
259
|
&__label {
|
|
259
260
|
display: flex;
|
|
260
261
|
align-items: center;
|
|
261
|
-
cursor:
|
|
262
|
+
cursor: pointer;
|
|
262
263
|
user-select: none;
|
|
263
264
|
|
|
264
|
-
.w-checkbox--disabled & {
|
|
265
|
+
.w-checkbox--disabled & {
|
|
266
|
+
cursor: not-allowed;
|
|
267
|
+
opacity: 0.7;
|
|
268
|
+
}
|
|
265
269
|
}
|
|
266
270
|
}
|
|
267
271
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
component(
|
|
3
3
|
ref="formEl"
|
|
4
4
|
:is="formRegister && !wRadios ? 'w-form-element' : 'div'"
|
|
5
|
-
v-bind="formRegister && { validators, inputValue, disabled: isDisabled }"
|
|
5
|
+
v-bind="formRegister && { validators, inputValue, disabled: isDisabled, readonly: isReadonly }"
|
|
6
6
|
:valid.sync="valid"
|
|
7
7
|
@reset="$emit('update:modelValue', inputValue = null);$emit('input', null)"
|
|
8
8
|
:class="classes")
|
|
@@ -12,11 +12,11 @@ component(
|
|
|
12
12
|
type="radio"
|
|
13
13
|
:name="inputName"
|
|
14
14
|
:checked="inputValue || null"
|
|
15
|
-
:disabled="isDisabled || null"
|
|
15
|
+
:disabled="isDisabled || isReadonly || null"
|
|
16
16
|
:required="required || null"
|
|
17
17
|
:tabindex="tabindex || null"
|
|
18
18
|
@focus="$emit('focus', $event)"
|
|
19
|
-
@change="onInput($event) /* Edge doesn't
|
|
19
|
+
@change="onInput($event) /* Edge doesn't emit an `input` event on checkbox/radio/select change */"
|
|
20
20
|
:aria-checked="inputValue || 'false'"
|
|
21
21
|
role="radio")
|
|
22
22
|
template(v-if="hasLabel && labelOnLeft")
|
|
@@ -87,6 +87,7 @@ export default {
|
|
|
87
87
|
return {
|
|
88
88
|
[`w-radio w-radio--${this.inputValue ? 'checked' : 'unchecked'}`]: true,
|
|
89
89
|
'w-radio--disabled': this.isDisabled,
|
|
90
|
+
'w-radio--readonly': this.isReadonly,
|
|
90
91
|
'w-radio--ripple': this.ripple.start,
|
|
91
92
|
'w-radio--rippled': this.ripple.end
|
|
92
93
|
}
|
|
@@ -252,7 +252,7 @@ export default {
|
|
|
252
252
|
if (!e.metaKey && !e.ctrlKey && e.keyCode !== 9) e.preventDefault()
|
|
253
253
|
|
|
254
254
|
if (e.keyCode === 27 && this.showMenu) this.closeMenu() // Escape.
|
|
255
|
-
else if (e.keyCode
|
|
255
|
+
else if ([13, 32].includes(e.keyCode)) this.openMenu() // Enter or Space.
|
|
256
256
|
|
|
257
257
|
// Up & down arrows.
|
|
258
258
|
else if ([38, 40].includes(e.keyCode)) {
|
|
@@ -321,7 +321,7 @@ export default {
|
|
|
321
321
|
|
|
322
322
|
return items.map(item => {
|
|
323
323
|
let value = item
|
|
324
|
-
if (typeof item === 'object') {
|
|
324
|
+
if (item && typeof item === 'object') { // `null` is also an object!
|
|
325
325
|
value = item[this.itemValueKey] !== undefined ? item[this.itemValueKey] : (item[this.itemLabelKey] !== undefined ? item[this.itemLabelKey] : item)
|
|
326
326
|
}
|
|
327
327
|
|