wave-ui 1.45.5 → 1.45.10
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 +22 -12
- package/dist/wave-ui.umd.js +1 -1
- package/package.json +1 -1
- package/src/wave-ui/components/w-accordion.vue +7 -4
- package/src/wave-ui/components/w-app.vue +1 -1
- package/src/wave-ui/components/w-flex.vue +2 -0
- package/src/wave-ui/components/w-input.vue +17 -4
- package/src/wave-ui/components/w-tabs/index.vue +1 -0
- package/src/wave-ui/utils/index.js +1 -1
package/package.json
CHANGED
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
:tabindex="-1"
|
|
20
20
|
text
|
|
21
21
|
@keypress.stop
|
|
22
|
-
@click.stop="!item._disabled && toggleItem(item, $event)"
|
|
22
|
+
@click.stop="!item._disabled && toggleItem(item, $event)"
|
|
23
|
+
:class="{ 'w-accordion__expand-icon--expanded': item._expanded }")
|
|
23
24
|
//- Title.
|
|
24
25
|
slot(
|
|
25
26
|
v-if="$scopedSlots[`item-title.${item.id || i + 1}`]"
|
|
@@ -34,7 +35,8 @@
|
|
|
34
35
|
:icon="(item._expanded && collapseIcon) || expandIcon"
|
|
35
36
|
text
|
|
36
37
|
@keypress.stop
|
|
37
|
-
@click.stop="!item._disabled && toggleItem(item, $event)"
|
|
38
|
+
@click.stop="!item._disabled && toggleItem(item, $event)"
|
|
39
|
+
:class="{ 'w-accordion__expand-icon--expanded': item._expanded }")
|
|
38
40
|
//- Content.
|
|
39
41
|
w-transition-expand(y)
|
|
40
42
|
.w-accordion__item-content(v-if="item._expanded" :class="contentClass")
|
|
@@ -76,6 +78,7 @@ export default {
|
|
|
76
78
|
computed: {
|
|
77
79
|
accordionItems () {
|
|
78
80
|
const items = typeof this.items === 'number' ? Array(this.items).fill({}) : this.items || []
|
|
81
|
+
// eslint-disable-next-line new-cap
|
|
79
82
|
return items.map((item, _index) => new Vue.observable({
|
|
80
83
|
...item,
|
|
81
84
|
_index,
|
|
@@ -148,8 +151,8 @@ export default {
|
|
|
148
151
|
margin-right: $base-increment;
|
|
149
152
|
|
|
150
153
|
.w-accordion--rotate-icon & {@include default-transition;}
|
|
151
|
-
|
|
152
|
-
.w-accordion--
|
|
154
|
+
&--expanded {transform: rotate(-180deg);}
|
|
155
|
+
.w-accordion--icon-right &--expanded {transform: rotate(180deg);}
|
|
153
156
|
|
|
154
157
|
.w-icon:before {font-size: 1.1em;}
|
|
155
158
|
}
|
|
@@ -26,6 +26,7 @@ export default {
|
|
|
26
26
|
justifyEnd: { type: Boolean },
|
|
27
27
|
justifySpaceBetween: { type: Boolean },
|
|
28
28
|
justifySpaceAround: { type: Boolean },
|
|
29
|
+
justifySpaceEvenly: { type: Boolean },
|
|
29
30
|
basisZero: { type: Boolean },
|
|
30
31
|
gap: { type: Number, default: 0 }
|
|
31
32
|
},
|
|
@@ -48,6 +49,7 @@ export default {
|
|
|
48
49
|
'justify-end': this.justifyEnd,
|
|
49
50
|
'justify-space-between': this.justifySpaceBetween,
|
|
50
51
|
'justify-space-around': this.justifySpaceAround,
|
|
52
|
+
'justify-space-evenly': this.justifySpaceEvenly,
|
|
51
53
|
'basis-zero': this.basisZero,
|
|
52
54
|
[`w-flex--gap${this.gap}`]: this.gap
|
|
53
55
|
}
|
|
@@ -23,8 +23,10 @@ component(
|
|
|
23
23
|
tag="label"
|
|
24
24
|
:for="`w-input--${_uid}`"
|
|
25
25
|
@click="$emit('click:inner-icon-left', $event)") {{ innerIconLeft }}
|
|
26
|
+
//- All types of input except file.
|
|
26
27
|
input.w-input__input(
|
|
27
28
|
v-if="type !== 'file'"
|
|
29
|
+
ref="input"
|
|
28
30
|
v-model="inputValue"
|
|
29
31
|
v-on="listeners"
|
|
30
32
|
@input="onInput"
|
|
@@ -45,8 +47,10 @@ component(
|
|
|
45
47
|
:required="required || null"
|
|
46
48
|
:tabindex="tabindex || null"
|
|
47
49
|
v-bind="attrs")
|
|
48
|
-
|
|
50
|
+
//- Input type file.
|
|
51
|
+
template(v-else)
|
|
49
52
|
input(
|
|
53
|
+
ref="input"
|
|
50
54
|
:id="`w-input--${_uid}`"
|
|
51
55
|
type="file"
|
|
52
56
|
:name="name || null"
|
|
@@ -148,7 +152,8 @@ export default {
|
|
|
148
152
|
inputNumberError: false,
|
|
149
153
|
isFocused: false,
|
|
150
154
|
inputFiles: [], // For input type file.
|
|
151
|
-
fileReader: null // For input type file.
|
|
155
|
+
fileReader: null, // For input type file.
|
|
156
|
+
isAutofilled: false
|
|
152
157
|
}
|
|
153
158
|
},
|
|
154
159
|
|
|
@@ -191,7 +196,7 @@ export default {
|
|
|
191
196
|
'w-input--file': this.type === 'file',
|
|
192
197
|
'w-input--disabled': this.isDisabled,
|
|
193
198
|
'w-input--readonly': this.isReadonly,
|
|
194
|
-
[`w-input--${this.hasValue ? 'filled' : 'empty'}`]: true,
|
|
199
|
+
[`w-input--${this.hasValue || this.isAutofilled ? 'filled' : 'empty'}`]: true,
|
|
195
200
|
'w-input--focused': this.isFocused && !this.isReadonly,
|
|
196
201
|
'w-input--dark': this.dark,
|
|
197
202
|
'w-input--floating-label': this.hasLabel && this.labelPosition === 'inside' && !this.staticLabel,
|
|
@@ -273,7 +278,6 @@ export default {
|
|
|
273
278
|
reader.addEventListener('progress', event => {
|
|
274
279
|
if (event.loaded && event.total) {
|
|
275
280
|
this.$set(file, 'progress', event.loaded * 100 / event.total)
|
|
276
|
-
console.log(`Progress: ${Math.round(file.progress)}`)
|
|
277
281
|
}
|
|
278
282
|
})
|
|
279
283
|
|
|
@@ -281,9 +285,18 @@ export default {
|
|
|
281
285
|
}
|
|
282
286
|
},
|
|
283
287
|
|
|
288
|
+
mounted () {
|
|
289
|
+
// On page load, check if the field is autofilled by the browser.
|
|
290
|
+
setTimeout(() => {
|
|
291
|
+
if (this.$refs.input.value) this.isAutofilled = true
|
|
292
|
+
}, 250)
|
|
293
|
+
},
|
|
294
|
+
|
|
284
295
|
watch: {
|
|
285
296
|
value (value) {
|
|
286
297
|
this.inputValue = value
|
|
298
|
+
// When clearing the field value, also reset the isAutofilled var for the CSS class.
|
|
299
|
+
if (!value && value !== 0) this.isAutofilled = false
|
|
287
300
|
}
|
|
288
301
|
}
|
|
289
302
|
}
|
|
@@ -106,6 +106,7 @@ export default {
|
|
|
106
106
|
tabsItems () {
|
|
107
107
|
const items = typeof this.items === 'number' ? Array(this.items).fill({}) : this.items
|
|
108
108
|
|
|
109
|
+
// eslint-disable-next-line new-cap
|
|
109
110
|
return items.map((item, _index) => new Vue.observable({
|
|
110
111
|
...item,
|
|
111
112
|
_index,
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export const objectifyClasses = (classes = {}) => {
|
|
8
8
|
if (typeof classes === 'string') classes = { [classes]: true }
|
|
9
|
-
else if (
|
|
9
|
+
else if (Array.isArray(classes)) classes = { [classes.join(' ')]: true }
|
|
10
10
|
return classes
|
|
11
11
|
}
|