@live-change/user-frontend 0.9.32 → 0.9.34
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/front/locales/en.json +3 -1
- package/front/src/App.vue +32 -1
- package/front/src/Index.vue +3 -3
- package/front/src/NavBar.vue +8 -8
- package/front/src/SettingsTabs.vue +1 -1
- package/front/src/config.js +19 -0
- package/front/src/connected/ConnectEmail.vue +13 -10
- package/front/src/connected/ConnectFinished.vue +4 -4
- package/front/src/connected/ConnectPhone.vue +13 -9
- package/front/src/connected/Connected.vue +13 -13
- package/front/src/delete/Delete.vue +5 -5
- package/front/src/delete/DeleteFeedbackSent.vue +4 -4
- package/front/src/delete/DeleteFinished.vue +6 -6
- package/front/src/google-access/GoogleAccess.vue +4 -4
- package/front/src/google-access/GoogleAccessGained.vue +6 -6
- package/front/src/identification/IdentificationSettings.vue +17 -14
- package/front/src/identification/UserIdentification.vue +8 -8
- package/front/src/locale/LocaleSettings.vue +9 -7
- package/front/src/message-auth/MessageLink.vue +12 -12
- package/front/src/message-auth/MessageSent.vue +20 -17
- package/front/src/message-auth/email/ConnectEmail.vue +1 -1
- package/front/src/message-auth/email/ResetPasswordEmail.vue +1 -1
- package/front/src/message-auth/email/SignInEmail.vue +1 -1
- package/front/src/message-auth/email/SignUpEmail.vue +1 -1
- package/front/src/nav/UserIcon.vue +11 -12
- package/front/src/nav/UserMenu.vue +20 -15
- package/front/src/notifications/NotificationButtons.vue +3 -3
- package/front/src/notifications/NotificationListPage.vue +2 -2
- package/front/src/notifications/NotificationsIcon.vue +12 -10
- package/front/src/notifications/NotificationsList.vue +4 -4
- package/front/src/notifications/NotificationsSettings.vue +4 -4
- package/front/src/notifications/SimpleNotification.vue +3 -3
- package/front/src/password/ChangePassword.vue +19 -14
- package/front/src/password/ChangePasswordFinished.vue +4 -4
- package/front/src/password/Password.vue +406 -449
- package/front/src/password/ResetPassword.vue +11 -8
- package/front/src/password/ResetPasswordFinished.vue +4 -4
- package/front/src/password/ResetPasswordForm.vue +22 -19
- package/front/src/phone/CountryInput.vue +13 -15
- package/front/src/phone/PhoneInput.vue +3 -3
- package/front/src/settings/Settings.vue +5 -5
- package/front/src/settings/SettingsIndex.vue +4 -4
- package/front/src/settings/SettingsMenu.vue +10 -10
- package/front/src/sign/GoogleAuth.vue +4 -4
- package/front/src/sign/GoogleAuthReturn.vue +4 -4
- package/front/src/sign/LinkedinAuth.vue +4 -4
- package/front/src/sign/LinkedinAuthReturn.vue +4 -4
- package/front/src/sign/SignInEmail.vue +22 -21
- package/front/src/sign/SignInFinished.vue +6 -6
- package/front/src/sign/SignOut.vue +5 -5
- package/front/src/sign/SignOutFinished.vue +4 -4
- package/front/src/sign/SignUpEmail.vue +14 -13
- package/front/src/sign/SignUpFinished.vue +19 -16
- package/package.json +26 -26
|
@@ -1,48 +1,64 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="
|
|
3
|
-
<
|
|
2
|
+
<div :class="cx('root')" :style="sx('root')" v-bind="ptmi('root')">
|
|
3
|
+
<InputText
|
|
4
4
|
ref="input"
|
|
5
5
|
:id="inputId"
|
|
6
6
|
:type="inputType"
|
|
7
|
-
:class="
|
|
7
|
+
:class="[cx('pcInputText'), inputClass]"
|
|
8
8
|
:style="inputStyle"
|
|
9
|
-
:
|
|
9
|
+
:defaultValue="d_value"
|
|
10
|
+
:name="$formName"
|
|
10
11
|
:aria-labelledby="ariaLabelledby"
|
|
11
12
|
:aria-label="ariaLabel"
|
|
12
|
-
:aria-controls="(panelProps && panelProps.id) || panelId ||
|
|
13
|
+
:aria-controls="(overlayProps && overlayProps.id) || overlayId || (panelProps && panelProps.id) || panelId || overlayUniqueId"
|
|
13
14
|
:aria-expanded="overlayVisible"
|
|
14
15
|
:aria-haspopup="true"
|
|
15
16
|
:placeholder="placeholder"
|
|
16
17
|
:required="required"
|
|
18
|
+
:fluid="fluid"
|
|
19
|
+
:disabled="disabled"
|
|
20
|
+
:variant="variant"
|
|
21
|
+
:invalid="invalid"
|
|
22
|
+
:size="size"
|
|
23
|
+
:autofocus="autofocus"
|
|
17
24
|
@input="onInput"
|
|
18
25
|
@focus="onFocus"
|
|
19
26
|
@blur="onBlur"
|
|
20
27
|
@keyup="onKeyUp"
|
|
21
28
|
@invalid="onInvalid"
|
|
22
29
|
v-bind="inputProps"
|
|
30
|
+
:pt="ptm('pcInputText')"
|
|
31
|
+
:unstyled="unstyled"
|
|
23
32
|
/>
|
|
24
|
-
|
|
25
|
-
<
|
|
33
|
+
<!-- TODO: hideicon and showicon slots are deprecated since v4.0-->
|
|
34
|
+
<slot v-if="toggleMask && unmasked" :name="$slots.maskicon ? 'maskicon' : 'hideicon'" :toggleCallback="onMaskToggle">
|
|
35
|
+
<component :is="maskIcon ? 'i' : 'EyeSlashIcon'" :class="[cx('maskIcon'), maskIcon]" @click="onMaskToggle" v-bind="ptm('maskIcon')" />
|
|
36
|
+
</slot>
|
|
37
|
+
<slot v-if="toggleMask && !unmasked" :name="$slots.unmaskicon ? 'unmaskicon' : 'showicon'" :toggleCallback="onMaskToggle">
|
|
38
|
+
<component :is="unmaskIcon ? 'i' : 'EyeIcon'" :class="[cx('unmaskIcon'), unmaskIcon]" @click="onMaskToggle" v-bind="ptm('unmaskIcon')" />
|
|
39
|
+
</slot>
|
|
40
|
+
<span class="p-hidden-accessible" aria-live="polite" v-bind="ptm('hiddenAccesible')" :data-p-hidden-accessible="true">
|
|
26
41
|
{{ infoText }}
|
|
27
42
|
</span>
|
|
28
43
|
<Portal :appendTo="appendTo">
|
|
29
|
-
<transition name="p-connected-overlay"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
v-bind="panelProps">
|
|
44
|
+
<transition name="p-connected-overlay" @enter="onOverlayEnter" @leave="onOverlayLeave" @after-leave="onOverlayAfterLeave" v-bind="ptm('transition')">
|
|
45
|
+
<div
|
|
46
|
+
v-if="overlayVisible"
|
|
47
|
+
:ref="overlayRef"
|
|
48
|
+
:id="overlayId || panelId || overlayUniqueId"
|
|
49
|
+
:class="[cx('overlay'), panelClass, overlayClass]"
|
|
50
|
+
:style="[overlayStyle, panelStyle]"
|
|
51
|
+
@click="onOverlayClick"
|
|
52
|
+
v-bind="{ ...panelProps, ...overlayProps, ...ptm('overlay') }"
|
|
53
|
+
>
|
|
40
54
|
<slot name="header"></slot>
|
|
41
55
|
<slot name="content">
|
|
42
|
-
<div class="
|
|
43
|
-
<div :class="
|
|
56
|
+
<div :class="cx('content')" v-bind="ptm('content')">
|
|
57
|
+
<div :class="cx('meter')" v-bind="ptm('meter')">
|
|
58
|
+
<div :class="cx('meterLabel')" :style="{ width: meter ? meter.width : '' }" v-bind="ptm('meterLabel')"></div>
|
|
59
|
+
</div>
|
|
60
|
+
<div :class="cx('meterText')" v-bind="ptm('meterText')">{{ infoText }}</div>
|
|
44
61
|
</div>
|
|
45
|
-
<div class="p-password-info">{{ infoText }}</div>
|
|
46
62
|
</slot>
|
|
47
63
|
<slot name="footer"></slot>
|
|
48
64
|
</div>
|
|
@@ -52,463 +68,404 @@
|
|
|
52
68
|
</template>
|
|
53
69
|
|
|
54
70
|
<script>
|
|
55
|
-
import
|
|
56
|
-
import
|
|
57
|
-
import
|
|
58
|
-
import
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
71
|
+
import { absolutePosition, addStyle, getOuterWidth, isTouchDevice, relativePosition } from '@primeuix/utils/dom';
|
|
72
|
+
import { ZIndex } from '@primeuix/utils/zindex';
|
|
73
|
+
import { ConnectedOverlayScrollHandler } from '@primevue/core/utils';
|
|
74
|
+
import EyeIcon from '@primevue/icons/eye';
|
|
75
|
+
import EyeSlashIcon from '@primevue/icons/eyeslash';
|
|
76
|
+
import InputText from 'primevue/inputtext';
|
|
77
|
+
import OverlayEventBus from 'primevue/overlayeventbus';
|
|
78
|
+
import Portal from 'primevue/portal';
|
|
79
|
+
import BaseInput from '@primevue/core/baseinput';
|
|
80
|
+
import PasswordStyle from 'primevue/password/style';
|
|
81
|
+
|
|
82
|
+
export default {
|
|
83
|
+
name: 'Password',
|
|
84
|
+
extends: BaseInput,
|
|
85
|
+
props: {
|
|
86
|
+
promptLabel: {
|
|
87
|
+
type: String,
|
|
88
|
+
default: null
|
|
89
|
+
},
|
|
90
|
+
mediumRegex: {
|
|
91
|
+
type: [String, RegExp],
|
|
92
|
+
default: '^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})' // eslint-disable-line
|
|
93
|
+
},
|
|
94
|
+
strongRegex: {
|
|
95
|
+
type: [String, RegExp],
|
|
96
|
+
default: '^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})' // eslint-disable-line
|
|
97
|
+
},
|
|
98
|
+
weakLabel: {
|
|
99
|
+
type: String,
|
|
100
|
+
default: null
|
|
101
|
+
},
|
|
102
|
+
mediumLabel: {
|
|
103
|
+
type: String,
|
|
104
|
+
default: null
|
|
105
|
+
},
|
|
106
|
+
strongLabel: {
|
|
107
|
+
type: String,
|
|
108
|
+
default: null
|
|
109
|
+
},
|
|
110
|
+
feedback: {
|
|
111
|
+
type: Boolean,
|
|
112
|
+
default: true
|
|
113
|
+
},
|
|
114
|
+
appendTo: {
|
|
115
|
+
type: [String, Object],
|
|
116
|
+
default: 'body'
|
|
117
|
+
},
|
|
118
|
+
toggleMask: {
|
|
119
|
+
type: Boolean,
|
|
120
|
+
default: false
|
|
121
|
+
},
|
|
122
|
+
hideIcon: {
|
|
123
|
+
type: String,
|
|
124
|
+
default: undefined
|
|
125
|
+
},
|
|
126
|
+
maskIcon: {
|
|
127
|
+
type: String,
|
|
128
|
+
default: undefined
|
|
129
|
+
},
|
|
130
|
+
showIcon: {
|
|
131
|
+
type: String,
|
|
132
|
+
default: undefined
|
|
133
|
+
},
|
|
134
|
+
unmaskIcon: {
|
|
135
|
+
type: String,
|
|
136
|
+
default: undefined
|
|
137
|
+
},
|
|
138
|
+
disabled: {
|
|
139
|
+
type: Boolean,
|
|
140
|
+
default: false
|
|
141
|
+
},
|
|
142
|
+
placeholder: {
|
|
143
|
+
type: String,
|
|
144
|
+
default: null
|
|
145
|
+
},
|
|
146
|
+
required: {
|
|
147
|
+
type: Boolean,
|
|
148
|
+
default: false
|
|
149
|
+
},
|
|
150
|
+
inputId: {
|
|
151
|
+
type: String,
|
|
152
|
+
default: null
|
|
153
|
+
},
|
|
154
|
+
inputClass: {
|
|
155
|
+
type: [String, Object],
|
|
156
|
+
default: null
|
|
157
|
+
},
|
|
158
|
+
inputStyle: {
|
|
159
|
+
type: Object,
|
|
160
|
+
default: null
|
|
161
|
+
},
|
|
162
|
+
inputProps: {
|
|
163
|
+
type: null,
|
|
164
|
+
default: null
|
|
165
|
+
},
|
|
166
|
+
panelId: {
|
|
167
|
+
type: String,
|
|
168
|
+
default: null
|
|
169
|
+
},
|
|
170
|
+
panelClass: {
|
|
171
|
+
type: [String, Object],
|
|
172
|
+
default: null
|
|
173
|
+
},
|
|
174
|
+
panelStyle: {
|
|
175
|
+
type: Object,
|
|
176
|
+
default: null
|
|
177
|
+
},
|
|
178
|
+
panelProps: {
|
|
179
|
+
type: null,
|
|
180
|
+
default: null
|
|
181
|
+
},
|
|
182
|
+
overlayId: {
|
|
183
|
+
type: String,
|
|
184
|
+
default: null
|
|
185
|
+
},
|
|
186
|
+
overlayClass: {
|
|
187
|
+
type: [String, Object],
|
|
188
|
+
default: null
|
|
189
|
+
},
|
|
190
|
+
overlayStyle: {
|
|
191
|
+
type: Object,
|
|
192
|
+
default: null
|
|
193
|
+
},
|
|
194
|
+
overlayProps: {
|
|
195
|
+
type: null,
|
|
196
|
+
default: null
|
|
197
|
+
},
|
|
198
|
+
ariaLabelledby: {
|
|
199
|
+
type: String,
|
|
200
|
+
default: null
|
|
201
|
+
},
|
|
202
|
+
ariaLabel: {
|
|
203
|
+
type: String,
|
|
204
|
+
default: null
|
|
205
|
+
},
|
|
206
|
+
autofocus: {
|
|
207
|
+
type: Boolean,
|
|
208
|
+
default: null
|
|
209
|
+
},
|
|
210
|
+
masked: {
|
|
211
|
+
type: Boolean,
|
|
212
|
+
default: false
|
|
79
213
|
}
|
|
80
|
-
/* } else {
|
|
81
|
-
top = targetOuterHeight + targetOffset.top + windowScrollTop;
|
|
82
|
-
element.style.transformOrigin = 'top';
|
|
83
|
-
}*/
|
|
84
|
-
|
|
85
|
-
if (targetOffset.left + elementOuterWidth > viewport.width) left = Math.max(0, targetOffset.left + windowScrollLeft + targetOuterWidth - elementOuterWidth);
|
|
86
|
-
else left = targetOffset.left + windowScrollLeft;
|
|
87
|
-
|
|
88
|
-
element.style.top = top + 'px';
|
|
89
|
-
element.style.left = left + 'px';
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export default {
|
|
94
|
-
name: 'Password',
|
|
95
|
-
emits: ['update:modelValue', 'change', 'focus', 'blur', 'invalid', 'update:masked'],
|
|
96
|
-
props: {
|
|
97
|
-
modelValue: String,
|
|
98
|
-
promptLabel: {
|
|
99
|
-
type: String,
|
|
100
|
-
default: null
|
|
101
|
-
},
|
|
102
|
-
mediumRegex: {
|
|
103
|
-
type: String,
|
|
104
|
-
default: '^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})' // eslint-disable-line
|
|
105
|
-
},
|
|
106
|
-
strongRegex: {
|
|
107
|
-
type: String,
|
|
108
|
-
default: '^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})' // eslint-disable-line
|
|
109
|
-
},
|
|
110
|
-
weakLabel: {
|
|
111
|
-
type: String,
|
|
112
|
-
default: null
|
|
113
|
-
},
|
|
114
|
-
mediumLabel: {
|
|
115
|
-
type: String,
|
|
116
|
-
default: null
|
|
117
|
-
},
|
|
118
|
-
strongLabel: {
|
|
119
|
-
type: String,
|
|
120
|
-
default: null
|
|
121
|
-
},
|
|
122
|
-
feedback: {
|
|
123
|
-
type: Boolean,
|
|
124
|
-
default: true
|
|
125
|
-
},
|
|
126
|
-
appendTo: {
|
|
127
|
-
type: String,
|
|
128
|
-
default: 'body'
|
|
129
|
-
},
|
|
130
|
-
toggleMask: {
|
|
131
|
-
type: Boolean,
|
|
132
|
-
default: false
|
|
133
|
-
},
|
|
134
|
-
hideIcon: {
|
|
135
|
-
type: String,
|
|
136
|
-
default: 'pi pi-eye-slash'
|
|
137
|
-
},
|
|
138
|
-
showIcon: {
|
|
139
|
-
type: String,
|
|
140
|
-
default: 'pi pi-eye'
|
|
141
|
-
},
|
|
142
|
-
disabled: {
|
|
143
|
-
type: Boolean,
|
|
144
|
-
default: false
|
|
145
|
-
},
|
|
146
|
-
placeholder: {
|
|
147
|
-
type: String,
|
|
148
|
-
default: null
|
|
149
|
-
},
|
|
150
|
-
required: {
|
|
151
|
-
type: Boolean,
|
|
152
|
-
default: false
|
|
153
|
-
},
|
|
154
|
-
inputId: {
|
|
155
|
-
type: String,
|
|
156
|
-
default: null
|
|
157
|
-
},
|
|
158
|
-
inputClass: {
|
|
159
|
-
type: [String, Object],
|
|
160
|
-
default: null
|
|
161
|
-
},
|
|
162
|
-
inputStyle: {
|
|
163
|
-
type: Object,
|
|
164
|
-
default: null
|
|
165
|
-
},
|
|
166
|
-
inputProps: {
|
|
167
|
-
type: null,
|
|
168
|
-
default: null
|
|
169
|
-
},
|
|
170
|
-
panelId: {
|
|
171
|
-
type: String,
|
|
172
|
-
default: null
|
|
173
|
-
},
|
|
174
|
-
panelClass: {
|
|
175
|
-
type: [String, Object],
|
|
176
|
-
default: null
|
|
177
|
-
},
|
|
178
|
-
panelStyle: {
|
|
179
|
-
type: Object,
|
|
180
|
-
default: null
|
|
181
|
-
},
|
|
182
|
-
panelProps: {
|
|
183
|
-
type: null,
|
|
184
|
-
default: null
|
|
185
|
-
},
|
|
186
|
-
'aria-labelledby': {
|
|
187
|
-
type: String,
|
|
188
|
-
default: null
|
|
189
214
|
},
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
215
|
+
style: PasswordStyle,
|
|
216
|
+
provide() {
|
|
217
|
+
return {
|
|
218
|
+
$pcPassword: this,
|
|
219
|
+
$parentInstance: this
|
|
220
|
+
};
|
|
221
|
+
},
|
|
222
|
+
inheritAttrs: false,
|
|
223
|
+
emits: ['change', 'focus', 'blur', 'invalid', 'update:masked'],
|
|
224
|
+
inject: {
|
|
225
|
+
$pcFluid: { default: null }
|
|
226
|
+
},
|
|
227
|
+
data() {
|
|
228
|
+
return {
|
|
229
|
+
overlayVisible: false,
|
|
230
|
+
meter: null,
|
|
231
|
+
infoText: null,
|
|
232
|
+
focused: false,
|
|
233
|
+
unmasked: false
|
|
234
|
+
};
|
|
235
|
+
},
|
|
236
|
+
mediumCheckRegExp: null,
|
|
237
|
+
strongCheckRegExp: null,
|
|
238
|
+
resizeListener: null,
|
|
239
|
+
scrollHandler: null,
|
|
240
|
+
overlay: null,
|
|
241
|
+
mounted() {
|
|
242
|
+
this.infoText = this.promptText;
|
|
243
|
+
this.mediumCheckRegExp = new RegExp(this.mediumRegex);
|
|
244
|
+
this.strongCheckRegExp = new RegExp(this.strongRegex);
|
|
245
|
+
},
|
|
246
|
+
beforeUnmount() {
|
|
247
|
+
this.unbindResizeListener();
|
|
220
248
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
249
|
+
if (this.scrollHandler) {
|
|
250
|
+
this.scrollHandler.destroy();
|
|
251
|
+
this.scrollHandler = null;
|
|
252
|
+
}
|
|
225
253
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
}
|
|
230
|
-
},
|
|
231
|
-
methods: {
|
|
232
|
-
onOverlayEnter(el) {
|
|
233
|
-
ZIndexUtils.set('overlay', el, this.$primevue.config.zIndex.overlay);
|
|
234
|
-
this.alignOverlay();
|
|
235
|
-
this.bindScrollListener();
|
|
236
|
-
this.bindResizeListener();
|
|
237
|
-
},
|
|
238
|
-
onOverlayLeave() {
|
|
239
|
-
this.unbindScrollListener();
|
|
240
|
-
this.unbindResizeListener();
|
|
241
|
-
this.overlay = null;
|
|
242
|
-
},
|
|
243
|
-
onOverlayAfterLeave(el) {
|
|
244
|
-
ZIndexUtils.clear(el);
|
|
245
|
-
},
|
|
246
|
-
alignOverlay() {
|
|
247
|
-
if (this.appendTo === 'self') {
|
|
248
|
-
DomHandler.relativePosition(this.overlay, this.$refs.input.$el);
|
|
249
|
-
} else {
|
|
250
|
-
this.overlay.style.minWidth = DomHandler.getOuterWidth(this.$refs.input.$el) + 'px';
|
|
251
|
-
absolutePosition(this.overlay, this.$refs.input.$el);
|
|
254
|
+
if (this.overlay) {
|
|
255
|
+
ZIndex.clear(this.overlay);
|
|
256
|
+
this.overlay = null;
|
|
252
257
|
}
|
|
253
258
|
},
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
259
|
+
methods: {
|
|
260
|
+
onOverlayEnter(el) {
|
|
261
|
+
ZIndex.set('overlay', el, this.$primevue.config.zIndex.overlay);
|
|
262
|
+
|
|
263
|
+
addStyle(el, { position: 'absolute', top: '0', left: '0' });
|
|
264
|
+
this.alignOverlay();
|
|
265
|
+
this.bindScrollListener();
|
|
266
|
+
this.bindResizeListener();
|
|
267
|
+
},
|
|
268
|
+
onOverlayLeave() {
|
|
269
|
+
this.unbindScrollListener();
|
|
270
|
+
this.unbindResizeListener();
|
|
271
|
+
this.overlay = null;
|
|
272
|
+
},
|
|
273
|
+
onOverlayAfterLeave(el) {
|
|
274
|
+
ZIndex.clear(el);
|
|
275
|
+
},
|
|
276
|
+
alignOverlay() {
|
|
277
|
+
if (this.appendTo === 'self') {
|
|
278
|
+
relativePosition(this.overlay, this.$refs.input.$el);
|
|
279
|
+
} else {
|
|
280
|
+
this.overlay.style.minWidth = getOuterWidth(this.$refs.input.$el) + 'px';
|
|
281
|
+
absolutePosition(this.overlay, this.$refs.input.$el);
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
testStrength(str) {
|
|
285
|
+
let level = 0;
|
|
286
|
+
|
|
287
|
+
if (this.strongCheckRegExp.test(str)) level = 3;
|
|
288
|
+
else if (this.mediumCheckRegExp.test(str)) level = 2;
|
|
289
|
+
else if (str.length) level = 1;
|
|
290
|
+
|
|
291
|
+
return level;
|
|
292
|
+
},
|
|
293
|
+
onInput(event) {
|
|
294
|
+
this.writeValue(event.target.value, event);
|
|
295
|
+
this.$emit('change', event);
|
|
296
|
+
},
|
|
297
|
+
onFocus(event) {
|
|
298
|
+
this.focused = true;
|
|
299
|
+
|
|
300
|
+
if (this.feedback) {
|
|
301
|
+
this.setPasswordMeter(this.d_value);
|
|
302
|
+
this.overlayVisible = true;
|
|
303
|
+
}
|
|
260
304
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
},
|
|
266
|
-
onFocus(event) {
|
|
267
|
-
this.focused = true;
|
|
305
|
+
this.$emit('focus', event);
|
|
306
|
+
},
|
|
307
|
+
onBlur(event) {
|
|
308
|
+
this.focused = false;
|
|
268
309
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
}
|
|
310
|
+
if (this.feedback) {
|
|
311
|
+
this.overlayVisible = false;
|
|
312
|
+
}
|
|
273
313
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
314
|
+
this.$emit('blur', event);
|
|
315
|
+
},
|
|
316
|
+
onKeyUp(event) {
|
|
317
|
+
if (this.feedback) {
|
|
318
|
+
const value = event.target.value;
|
|
319
|
+
const { meter, label } = this.checkPasswordStrength(value);
|
|
278
320
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}
|
|
321
|
+
this.meter = meter;
|
|
322
|
+
this.infoText = label;
|
|
282
323
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
onKeyUp(event) {
|
|
286
|
-
if (this.feedback) {
|
|
287
|
-
const value = event.target.value;
|
|
288
|
-
const { meter, label } = this.checkPasswordStrength(value);
|
|
324
|
+
if (event.code === 'Escape') {
|
|
325
|
+
this.overlayVisible && (this.overlayVisible = false);
|
|
289
326
|
|
|
290
|
-
|
|
291
|
-
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
292
329
|
|
|
293
|
-
|
|
294
|
-
|
|
330
|
+
if (!this.overlayVisible) {
|
|
331
|
+
this.overlayVisible = true;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
setPasswordMeter() {
|
|
336
|
+
if (!this.d_value) {
|
|
337
|
+
this.meter = null;
|
|
338
|
+
this.infoText = this.promptText;
|
|
295
339
|
|
|
296
340
|
return;
|
|
297
341
|
}
|
|
298
342
|
|
|
343
|
+
const { meter, label } = this.checkPasswordStrength(this.d_value);
|
|
344
|
+
|
|
345
|
+
this.meter = meter;
|
|
346
|
+
this.infoText = label;
|
|
347
|
+
|
|
299
348
|
if (!this.overlayVisible) {
|
|
300
349
|
this.overlayVisible = true;
|
|
301
350
|
}
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
351
|
+
},
|
|
352
|
+
checkPasswordStrength(value) {
|
|
353
|
+
let label = null;
|
|
354
|
+
let meter = null;
|
|
355
|
+
|
|
356
|
+
switch (this.testStrength(value)) {
|
|
357
|
+
case 1:
|
|
358
|
+
label = this.weakText;
|
|
359
|
+
meter = {
|
|
360
|
+
strength: 'weak',
|
|
361
|
+
width: '33.33%'
|
|
362
|
+
};
|
|
363
|
+
break;
|
|
364
|
+
|
|
365
|
+
case 2:
|
|
366
|
+
label = this.mediumText;
|
|
367
|
+
meter = {
|
|
368
|
+
strength: 'medium',
|
|
369
|
+
width: '66.66%'
|
|
370
|
+
};
|
|
371
|
+
break;
|
|
372
|
+
|
|
373
|
+
case 3:
|
|
374
|
+
label = this.strongText;
|
|
375
|
+
meter = {
|
|
376
|
+
strength: 'strong',
|
|
377
|
+
width: '100%'
|
|
378
|
+
};
|
|
379
|
+
break;
|
|
380
|
+
|
|
381
|
+
default:
|
|
382
|
+
label = this.promptText;
|
|
383
|
+
meter = null;
|
|
384
|
+
break;
|
|
385
|
+
}
|
|
328
386
|
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
387
|
+
return { label, meter };
|
|
388
|
+
},
|
|
389
|
+
onInvalid(event) {
|
|
390
|
+
this.$emit('invalid', event);
|
|
391
|
+
},
|
|
392
|
+
bindScrollListener() {
|
|
393
|
+
if (!this.scrollHandler) {
|
|
394
|
+
this.scrollHandler = new ConnectedOverlayScrollHandler(this.$refs.input.$el, () => {
|
|
395
|
+
if (this.overlayVisible) {
|
|
396
|
+
this.overlayVisible = false;
|
|
397
|
+
}
|
|
398
|
+
});
|
|
399
|
+
}
|
|
336
400
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
401
|
+
this.scrollHandler.bindScrollListener();
|
|
402
|
+
},
|
|
403
|
+
unbindScrollListener() {
|
|
404
|
+
if (this.scrollHandler) {
|
|
405
|
+
this.scrollHandler.unbindScrollListener();
|
|
406
|
+
}
|
|
407
|
+
},
|
|
408
|
+
bindResizeListener() {
|
|
409
|
+
if (!this.resizeListener) {
|
|
410
|
+
this.resizeListener = () => {
|
|
411
|
+
if (this.overlayVisible && !isTouchDevice()) {
|
|
412
|
+
this.overlayVisible = false;
|
|
413
|
+
}
|
|
342
414
|
};
|
|
343
|
-
break;
|
|
344
|
-
|
|
345
|
-
default:
|
|
346
|
-
label = this.promptText;
|
|
347
|
-
meter = null;
|
|
348
|
-
break;
|
|
349
|
-
}
|
|
350
415
|
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
416
|
+
window.addEventListener('resize', this.resizeListener);
|
|
417
|
+
}
|
|
418
|
+
},
|
|
419
|
+
unbindResizeListener() {
|
|
420
|
+
if (this.resizeListener) {
|
|
421
|
+
window.removeEventListener('resize', this.resizeListener);
|
|
422
|
+
this.resizeListener = null;
|
|
423
|
+
}
|
|
424
|
+
},
|
|
425
|
+
overlayRef(el) {
|
|
426
|
+
this.overlay = el;
|
|
427
|
+
},
|
|
428
|
+
onMaskToggle() {
|
|
429
|
+
this.unmasked = !this.unmasked;
|
|
430
|
+
this.$emit('update:masked', !this.unmasked);
|
|
431
|
+
},
|
|
432
|
+
onOverlayClick(event) {
|
|
433
|
+
OverlayEventBus.emit('overlay-click', {
|
|
434
|
+
originalEvent: event,
|
|
435
|
+
target: this.$el
|
|
362
436
|
});
|
|
363
437
|
}
|
|
364
|
-
|
|
365
|
-
this.scrollHandler.bindScrollListener();
|
|
366
438
|
},
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
this.
|
|
439
|
+
computed: {
|
|
440
|
+
inputType() {
|
|
441
|
+
return this.unmasked ? 'text' : 'password';
|
|
442
|
+
},
|
|
443
|
+
weakText() {
|
|
444
|
+
return this.weakLabel || this.$primevue.config.locale.weak;
|
|
445
|
+
},
|
|
446
|
+
mediumText() {
|
|
447
|
+
return this.mediumLabel || this.$primevue.config.locale.medium;
|
|
448
|
+
},
|
|
449
|
+
strongText() {
|
|
450
|
+
return this.strongLabel || this.$primevue.config.locale.strong;
|
|
451
|
+
},
|
|
452
|
+
promptText() {
|
|
453
|
+
return this.promptLabel || this.$primevue.config.locale.passwordPrompt;
|
|
454
|
+
},
|
|
455
|
+
overlayUniqueId() {
|
|
456
|
+
return this.$id + '_overlay';
|
|
370
457
|
}
|
|
371
458
|
},
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
this.
|
|
375
|
-
if (this.overlayVisible && !DomHandler.isTouchDevice()) {
|
|
376
|
-
this.overlayVisible = false;
|
|
377
|
-
}
|
|
378
|
-
};
|
|
379
|
-
|
|
380
|
-
window.addEventListener('resize', this.resizeListener);
|
|
459
|
+
watch: {
|
|
460
|
+
masked(value) {
|
|
461
|
+
this.unmasked = !value
|
|
381
462
|
}
|
|
382
463
|
},
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
},
|
|
389
|
-
overlayRef(el) {
|
|
390
|
-
this.overlay = el;
|
|
391
|
-
},
|
|
392
|
-
onMaskToggle() {
|
|
393
|
-
this.unmasked = !this.unmasked;
|
|
394
|
-
this.$emit('update:masked', !this.unmasked);
|
|
395
|
-
},
|
|
396
|
-
onOverlayClick(event) {
|
|
397
|
-
OverlayEventBus.emit('overlay-click', {
|
|
398
|
-
originalEvent: event,
|
|
399
|
-
target: this.$el
|
|
400
|
-
});
|
|
464
|
+
components: {
|
|
465
|
+
InputText,
|
|
466
|
+
Portal,
|
|
467
|
+
EyeSlashIcon,
|
|
468
|
+
EyeIcon
|
|
401
469
|
}
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
containerClass() {
|
|
405
|
-
return [
|
|
406
|
-
'p-password p-component p-inputwrapper',
|
|
407
|
-
{
|
|
408
|
-
'p-inputwrapper-filled': this.filled,
|
|
409
|
-
'p-inputwrapper-focus': this.focused,
|
|
410
|
-
'p-input-icon-right': this.toggleMask
|
|
411
|
-
}
|
|
412
|
-
];
|
|
413
|
-
},
|
|
414
|
-
inputFieldClass() {
|
|
415
|
-
return [
|
|
416
|
-
'p-password-input',
|
|
417
|
-
this.inputClass,
|
|
418
|
-
{
|
|
419
|
-
'p-disabled': this.disabled
|
|
420
|
-
}
|
|
421
|
-
];
|
|
422
|
-
},
|
|
423
|
-
panelStyleClass() {
|
|
424
|
-
return [
|
|
425
|
-
'p-password-panel p-component',
|
|
426
|
-
this.panelClass,
|
|
427
|
-
{
|
|
428
|
-
'p-input-filled': this.$primevue.config.inputStyle === 'filled',
|
|
429
|
-
'p-ripple-disabled': this.$primevue.config.ripple === false
|
|
430
|
-
}
|
|
431
|
-
];
|
|
432
|
-
},
|
|
433
|
-
toggleIconClass() {
|
|
434
|
-
return this.unmasked ? this.hideIcon : this.showIcon;
|
|
435
|
-
},
|
|
436
|
-
strengthClass() {
|
|
437
|
-
return `p-password-strength ${this.meter ? this.meter.strength : ''}`;
|
|
438
|
-
},
|
|
439
|
-
inputType() {
|
|
440
|
-
return this.unmasked ? 'text' : 'password';
|
|
441
|
-
},
|
|
442
|
-
filled() {
|
|
443
|
-
return this.modelValue != null && this.modelValue.toString().length > 0;
|
|
444
|
-
},
|
|
445
|
-
weakText() {
|
|
446
|
-
return this.weakLabel || this.$primevue.config.locale.weak;
|
|
447
|
-
},
|
|
448
|
-
mediumText() {
|
|
449
|
-
return this.mediumLabel || this.$primevue.config.locale.medium;
|
|
450
|
-
},
|
|
451
|
-
strongText() {
|
|
452
|
-
return this.strongLabel || this.$primevue.config.locale.strong;
|
|
453
|
-
},
|
|
454
|
-
promptText() {
|
|
455
|
-
return this.promptLabel || this.$primevue.config.locale.passwordPrompt;
|
|
456
|
-
},
|
|
457
|
-
panelUniqueId() {
|
|
458
|
-
return UniqueComponentId() + '_panel';
|
|
459
|
-
}
|
|
460
|
-
},
|
|
461
|
-
watch: {
|
|
462
|
-
masked(value) {
|
|
463
|
-
this.unmasked = !value;
|
|
464
|
-
},
|
|
465
|
-
},
|
|
466
|
-
components: {
|
|
467
|
-
PInputText: InputText,
|
|
468
|
-
Portal: Portal
|
|
469
|
-
}
|
|
470
|
-
};
|
|
471
|
-
</script>
|
|
472
|
-
|
|
473
|
-
<style>
|
|
474
|
-
.p-password {
|
|
475
|
-
position: relative;
|
|
476
|
-
display: inline-flex;
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
.p-password-panel {
|
|
480
|
-
position: absolute;
|
|
481
|
-
top: 0;
|
|
482
|
-
left: 0;
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
.p-password .p-password-panel {
|
|
486
|
-
min-width: 100%;
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
.p-password-meter {
|
|
490
|
-
height: 10px;
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
.p-password-strength {
|
|
494
|
-
height: 100%;
|
|
495
|
-
width: 0;
|
|
496
|
-
transition: width 1s ease-in-out;
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
.p-fluid .p-password {
|
|
500
|
-
display: flex;
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
.p-password-input::-ms-reveal,
|
|
504
|
-
.p-password-input::-ms-clear {
|
|
505
|
-
display: none;
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
.p-password i {
|
|
509
|
-
position: absolute;
|
|
510
|
-
top: 0.69em;
|
|
511
|
-
top: calc(50% - 0.5em);
|
|
512
|
-
right: 1em
|
|
513
|
-
}
|
|
514
|
-
</style>
|
|
470
|
+
};
|
|
471
|
+
</script>
|