@gitlab/ui 135.0.1 → 135.1.0
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/components/base/form/form_password_input/form_password_input.js +134 -0
- package/dist/components/index.js +1 -0
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/tailwind.css.map +1 -1
- package/package.json +4 -4
- package/src/components/base/form/form_password_input/form_password_input.scss +42 -0
- package/src/components/base/form/form_password_input/form_password_input.vue +123 -0
- package/src/components/base/nav_item/nav_item.scss +4 -4
- package/src/components/index.js +1 -0
- package/src/scss/components.scss +1 -0
- package/src/scss/themes.scss +26 -26
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import GlButton from '../../button/button';
|
|
2
|
+
import { GlTooltipDirective } from '../../../../directives/tooltip/tooltip';
|
|
3
|
+
import GlFormInput from '../form_input/form_input';
|
|
4
|
+
import GlFormInputGroup from '../form_input_group/form_input_group';
|
|
5
|
+
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
6
|
+
|
|
7
|
+
var script = {
|
|
8
|
+
name: 'GlFormPasswordInput',
|
|
9
|
+
components: {
|
|
10
|
+
GlButton,
|
|
11
|
+
GlFormInput,
|
|
12
|
+
GlFormInputGroup
|
|
13
|
+
},
|
|
14
|
+
directives: {
|
|
15
|
+
GlTooltip: GlTooltipDirective
|
|
16
|
+
},
|
|
17
|
+
inheritAttrs: false,
|
|
18
|
+
props: {
|
|
19
|
+
/**
|
|
20
|
+
* The input's value. Bound to the inner input and supports `v-model`.
|
|
21
|
+
* @model
|
|
22
|
+
*/
|
|
23
|
+
value: {
|
|
24
|
+
type: String,
|
|
25
|
+
required: false,
|
|
26
|
+
default: ''
|
|
27
|
+
},
|
|
28
|
+
/**
|
|
29
|
+
* Whether the value is revealed (unmasked) on initial render.
|
|
30
|
+
*/
|
|
31
|
+
initialVisibility: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
required: false,
|
|
34
|
+
default: false
|
|
35
|
+
},
|
|
36
|
+
/**
|
|
37
|
+
* Accessible label and tooltip for the toggle button while the value is masked.
|
|
38
|
+
* Pass a translated string.
|
|
39
|
+
*/
|
|
40
|
+
revealLabel: {
|
|
41
|
+
type: String,
|
|
42
|
+
required: false,
|
|
43
|
+
default: 'Reveal password'
|
|
44
|
+
},
|
|
45
|
+
/**
|
|
46
|
+
* Accessible label and tooltip for the toggle button while the value is revealed.
|
|
47
|
+
* Pass a translated string.
|
|
48
|
+
*/
|
|
49
|
+
hideLabel: {
|
|
50
|
+
type: String,
|
|
51
|
+
required: false,
|
|
52
|
+
default: 'Hide password'
|
|
53
|
+
},
|
|
54
|
+
/**
|
|
55
|
+
* Disables the field while keeping it in the focus order and announced by
|
|
56
|
+
* assistive technology (via `aria-disabled`), rather than removing it from
|
|
57
|
+
* the tab sequence.
|
|
58
|
+
*/
|
|
59
|
+
accessibleDisabled: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
required: false,
|
|
62
|
+
default: false
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
data() {
|
|
66
|
+
return {
|
|
67
|
+
isMasked: !this.initialVisibility
|
|
68
|
+
};
|
|
69
|
+
},
|
|
70
|
+
computed: {
|
|
71
|
+
type() {
|
|
72
|
+
return this.isMasked ? 'password' : 'text';
|
|
73
|
+
},
|
|
74
|
+
toggleLabel() {
|
|
75
|
+
return this.isMasked ? this.revealLabel : this.hideLabel;
|
|
76
|
+
},
|
|
77
|
+
toggleIcon() {
|
|
78
|
+
return this.isMasked ? 'eye' : 'eye-slash';
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
methods: {
|
|
82
|
+
toggleVisibility() {
|
|
83
|
+
if (this.accessibleDisabled) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
this.isMasked = !this.isMasked;
|
|
87
|
+
/**
|
|
88
|
+
* Emitted when the reveal/hide button is clicked.
|
|
89
|
+
*
|
|
90
|
+
* @event visibility-change
|
|
91
|
+
* @property {boolean} visible Whether the value is now revealed.
|
|
92
|
+
*/
|
|
93
|
+
this.$emit('visibility-change', !this.isMasked);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
/* script */
|
|
99
|
+
const __vue_script__ = script;
|
|
100
|
+
|
|
101
|
+
/* template */
|
|
102
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-form-input-group',{staticClass:"gl-form-password-input",scopedSlots:_vm._u([{key:"append",fn:function(){return [_c('gl-button',{directives:[{name:"gl-tooltip",rawName:"v-gl-tooltip",value:(_vm.toggleLabel),expression:"toggleLabel"}],staticClass:"gl-form-password-input-toggle !gl-border-0",attrs:{"category":"tertiary","accessible-disabled":"","aria-label":_vm.toggleLabel,"icon":_vm.toggleIcon,"disabled":_vm.accessibleDisabled},on:{"click":_vm.toggleVisibility}})]},proxy:true}])},[_c('gl-form-input',_vm._g(_vm._b({attrs:{"value":_vm.value,"type":_vm.type,"readonly":_vm.accessibleDisabled,"aria-disabled":_vm.accessibleDisabled ? 'true' : null}},'gl-form-input',_vm.$attrs,false),_vm.$listeners))],1)};
|
|
103
|
+
var __vue_staticRenderFns__ = [];
|
|
104
|
+
|
|
105
|
+
/* style */
|
|
106
|
+
const __vue_inject_styles__ = undefined;
|
|
107
|
+
/* scoped */
|
|
108
|
+
const __vue_scope_id__ = undefined;
|
|
109
|
+
/* module identifier */
|
|
110
|
+
const __vue_module_identifier__ = undefined;
|
|
111
|
+
/* functional template */
|
|
112
|
+
const __vue_is_functional_template__ = false;
|
|
113
|
+
/* style inject */
|
|
114
|
+
|
|
115
|
+
/* style inject SSR */
|
|
116
|
+
|
|
117
|
+
/* style inject shadow dom */
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
const __vue_component__ = /*#__PURE__*/__vue_normalize__(
|
|
122
|
+
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
123
|
+
__vue_inject_styles__,
|
|
124
|
+
__vue_script__,
|
|
125
|
+
__vue_scope_id__,
|
|
126
|
+
__vue_is_functional_template__,
|
|
127
|
+
__vue_module_identifier__,
|
|
128
|
+
false,
|
|
129
|
+
undefined,
|
|
130
|
+
undefined,
|
|
131
|
+
undefined
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
export { __vue_component__ as default };
|
package/dist/components/index.js
CHANGED
|
@@ -40,6 +40,7 @@ export { default as GlFormCharacterCount } from './base/form/form_character_coun
|
|
|
40
40
|
export { default as GlFormDate } from './base/form/form_date/form_date';
|
|
41
41
|
export { default as GlFormInput } from './base/form/form_input/form_input';
|
|
42
42
|
export { default as GlFormInputGroup } from './base/form/form_input_group/form_input_group';
|
|
43
|
+
export { default as GlFormPasswordInput } from './base/form/form_password_input/form_password_input';
|
|
43
44
|
export { default as GlFormRadio } from './base/form/form_radio/form_radio';
|
|
44
45
|
export { default as GlFormRadioGroup } from './base/form/form_radio_group/form_radio_group';
|
|
45
46
|
export { default as GlFormSelect } from './base/form/form_select/form_select';
|