@propelinc/citrus-ui 0.3.6 → 0.3.7
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/citrus-ui.common.js +35 -29
- package/dist/citrus-ui.common.js.map +1 -1
- package/dist/citrus-ui.css +1 -1
- package/dist/citrus-ui.umd.js +35 -29
- package/dist/citrus-ui.umd.js.map +1 -1
- package/dist/citrus-ui.umd.min.js +2 -2
- package/dist/citrus-ui.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/CTextField.vue +11 -2
package/package.json
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
<form-field :data-test="dataTest" :field-id="id" :disabled="disabled" :label="label">
|
|
3
3
|
<v-text-field
|
|
4
4
|
:id="id"
|
|
5
|
+
ref="input"
|
|
5
6
|
v-bind="$attrs"
|
|
6
7
|
:data-test="`${dataTest}-input`"
|
|
7
8
|
class="text-field__field"
|
|
@@ -22,8 +23,9 @@
|
|
|
22
23
|
<slot name="append">
|
|
23
24
|
<button
|
|
24
25
|
v-if="hideable"
|
|
26
|
+
type="button"
|
|
25
27
|
:data-test="`${dataTest}-hide-toggle`"
|
|
26
|
-
@click="
|
|
28
|
+
@click="toggleHideInput"
|
|
27
29
|
>
|
|
28
30
|
<font-awesome-icon v-if="hideInput" :icon="faEye" />
|
|
29
31
|
<font-awesome-icon v-else :icon="faEyeSlash" />
|
|
@@ -41,6 +43,8 @@ import { Component, Vue, Prop } from 'vue-property-decorator';
|
|
|
41
43
|
|
|
42
44
|
import FormField from '@/components/helpers/FormField.vue';
|
|
43
45
|
|
|
46
|
+
type VTextField = Vue & { focus: () => void };
|
|
47
|
+
|
|
44
48
|
@Component({ name: 'CTextField', inheritAttrs: false, components: { FormField, FontAwesomeIcon } })
|
|
45
49
|
export default class CTextField extends Vue {
|
|
46
50
|
faEye = faEye;
|
|
@@ -70,12 +74,17 @@ export default class CTextField extends Vue {
|
|
|
70
74
|
return this.hideInput && this.hideable ? 'password' : this.type;
|
|
71
75
|
}
|
|
72
76
|
|
|
73
|
-
|
|
77
|
+
toggleHideInput(): void {
|
|
74
78
|
if (!this.hideable) {
|
|
75
79
|
return;
|
|
76
80
|
}
|
|
77
81
|
|
|
78
82
|
this.hideInput = !this.hideInput;
|
|
83
|
+
this.$emit('click:hide', this.hideInput);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
focus(): void {
|
|
87
|
+
(this.$refs.input as VTextField).focus();
|
|
79
88
|
}
|
|
80
89
|
}
|
|
81
90
|
</script>
|