wave-ui 1.45.7 → 1.45.11
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.es.js +16 -7
- package/dist/wave-ui.umd.js +1 -1
- package/package.json +1 -1
- package/src/wave-ui/components/w-input.vue +17 -3
package/package.json
CHANGED
|
@@ -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,
|
|
@@ -280,9 +285,18 @@ export default {
|
|
|
280
285
|
}
|
|
281
286
|
},
|
|
282
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
|
+
}, 350)
|
|
293
|
+
},
|
|
294
|
+
|
|
283
295
|
watch: {
|
|
284
296
|
value (value) {
|
|
285
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
|
|
286
300
|
}
|
|
287
301
|
}
|
|
288
302
|
}
|