vue3-password-strength-meter 1.7.6 → 1.7.9

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.
@@ -1,412 +0,0 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory(require("zxcvbn"));
4
- else if(typeof define === 'function' && define.amd)
5
- define("Password", ["zxcvbn"], factory);
6
- else if(typeof exports === 'object')
7
- exports["Password"] = factory(require("zxcvbn"));
8
- else
9
- root["Password"] = factory(root["zxcvbn"]);
10
- })(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_4__) {
11
- return /******/ (function(modules) { // webpackBootstrap
12
- /******/ // The module cache
13
- /******/ var installedModules = {};
14
- /******/
15
- /******/ // The require function
16
- /******/ function __webpack_require__(moduleId) {
17
- /******/
18
- /******/ // Check if module is in cache
19
- /******/ if(installedModules[moduleId]) {
20
- /******/ return installedModules[moduleId].exports;
21
- /******/ }
22
- /******/ // Create a new module (and put it into the cache)
23
- /******/ var module = installedModules[moduleId] = {
24
- /******/ i: moduleId,
25
- /******/ l: false,
26
- /******/ exports: {}
27
- /******/ };
28
- /******/
29
- /******/ // Execute the module function
30
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31
- /******/
32
- /******/ // Flag the module as loaded
33
- /******/ module.l = true;
34
- /******/
35
- /******/ // Return the exports of the module
36
- /******/ return module.exports;
37
- /******/ }
38
- /******/
39
- /******/
40
- /******/ // expose the modules object (__webpack_modules__)
41
- /******/ __webpack_require__.m = modules;
42
- /******/
43
- /******/ // expose the module cache
44
- /******/ __webpack_require__.c = installedModules;
45
- /******/
46
- /******/ // define getter function for harmony exports
47
- /******/ __webpack_require__.d = function(exports, name, getter) {
48
- /******/ if(!__webpack_require__.o(exports, name)) {
49
- /******/ Object.defineProperty(exports, name, {
50
- /******/ configurable: false,
51
- /******/ enumerable: true,
52
- /******/ get: getter
53
- /******/ });
54
- /******/ }
55
- /******/ };
56
- /******/
57
- /******/ // getDefaultExport function for compatibility with non-harmony modules
58
- /******/ __webpack_require__.n = function(module) {
59
- /******/ var getter = module && module.__esModule ?
60
- /******/ function getDefault() { return module['default']; } :
61
- /******/ function getModuleExports() { return module; };
62
- /******/ __webpack_require__.d(getter, 'a', getter);
63
- /******/ return getter;
64
- /******/ };
65
- /******/
66
- /******/ // Object.prototype.hasOwnProperty.call
67
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
68
- /******/
69
- /******/ // __webpack_public_path__
70
- /******/ __webpack_require__.p = "";
71
- /******/
72
- /******/ // Load entry module and return exports
73
- /******/ return __webpack_require__(__webpack_require__.s = 1);
74
- /******/ })
75
- /************************************************************************/
76
- /******/ ([
77
- /* 0 */
78
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
79
-
80
- "use strict";
81
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_zxcvbn__ = __webpack_require__(4);
82
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_zxcvbn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_zxcvbn__);
83
-
84
-
85
-
86
- /* harmony default export */ __webpack_exports__["a"] = ({
87
- name: 'VuePasswordStrengthMeter',
88
- inheritAttrs: false,
89
- emits: ['input', 'blur', 'focus', 'score', 'hide', 'show', 'update:modelValue', 'feedback'],
90
- props: {
91
- /**
92
- * Binded value
93
- * @type {Object}
94
- */
95
- value: {
96
- type: String
97
- },
98
- modelValue: {
99
- type: String
100
- },
101
- /**
102
- * Password min length.
103
- * Right now only visual for the badge
104
- * @type {Number}
105
- */
106
- secureLength: {
107
- type: Number,
108
- default: 7
109
- },
110
- /**
111
- * Display badge:
112
- * The badge shows your
113
- * password character count
114
- * up to the defined secureLength
115
- * @type {Boolean}
116
- */
117
- badge: {
118
- type: Boolean,
119
- default: true
120
- },
121
- /**
122
- * Show password toggle:
123
- * Show icon to toggle
124
- * the password visibility
125
- */
126
- toggle: {
127
- type: Boolean,
128
- default: false
129
- },
130
- /**
131
- * Prop to toggle the
132
- * cleartext password if
133
- * toggle is disabled
134
- */
135
- showPassword: {
136
- type: Boolean,
137
- default: false
138
- },
139
- /**
140
- * Prop to change the
141
- * ref of the input
142
- */
143
- referenceValue: {
144
- type: String,
145
- default: 'input'
146
- },
147
- /**
148
- * Prop to toggle the
149
- * strength Meter if
150
- * User wants to implement
151
- * their own
152
- */
153
- showStrengthMeter: {
154
- type: Boolean,
155
- default: true
156
- },
157
- /**
158
- * Prop to toggle the
159
- * input element if
160
- * User wants to implement
161
- * their own input element
162
- */
163
- strengthMeterOnly: {
164
- type: Boolean,
165
- default: false
166
- },
167
- /**
168
- * CSS Class for the Input field
169
- * @type {String}
170
- */
171
- defaultClass: {
172
- type: String,
173
- default: 'Password__field'
174
- },
175
- /**
176
- * CSS Class for the disabled Input field
177
- * @type {String}
178
- */
179
- disabledClass: {
180
- type: String,
181
- default: 'Password__field--disabled'
182
- },
183
- /**
184
- * CSS Class for the badge
185
- * if a password does not match
186
- * the secureLength. Later for errors
187
- * @type {String}
188
- */
189
- errorClass: {
190
- type: String,
191
- default: 'Password__badge--error'
192
- },
193
- /**
194
- * CSS Class for the badge
195
- * if a password does match
196
- * the secureLength. Later for
197
- * success messages possible.
198
- * @type {String}
199
- */
200
- successClass: {
201
- type: String,
202
- default: 'Password__badge--success'
203
- },
204
- /**
205
- * CSS class for styling the
206
- * strength meter bars.
207
- * @type {String}
208
- */
209
- strengthMeterClass: {
210
- type: String,
211
- default: 'Password__strength-meter'
212
- },
213
- /**
214
- * strengthMeterFillClass sets the
215
- * individual strength width and fill
216
- * color of the strength meter bars.
217
- * @type {String}
218
- */
219
- strengthMeterFillClass: {
220
- type: String,
221
- default: 'Password__strength-meter--fill'
222
- },
223
- /**
224
- * Label for the show password icon
225
- */
226
- labelShow: {
227
- type: String,
228
- default: 'Show Password'
229
- },
230
- /**
231
- * Label for the hide password icon
232
- */
233
- labelHide: {
234
- type: String,
235
- default: 'Hide Password'
236
- },
237
- /**
238
- * @type String
239
- */
240
- userInputs: {
241
- type: Array,
242
- default: () => []
243
- }
244
- },
245
- data () {
246
- return {
247
- password: null,
248
- _showPassword: false
249
- }
250
- },
251
-
252
- methods: {
253
- togglePassword () {
254
- if (this.$data._showPassword) {
255
- this.$emit('hide')
256
- this.$data._showPassword = false
257
- } else {
258
- this.$emit('show')
259
- this.$data._showPassword = true
260
- }
261
- },
262
- emitValue (type, value) {
263
- if (type === 'input') {
264
- this.$emit('update:modelValue', value) // Changed in Vue 3
265
- } else {
266
- this.$emit(type, value)
267
- }
268
- this.password = value
269
- }
270
- },
271
-
272
- computed: {
273
- /**
274
- * passwordStrength is the score calculated by zxcvbn
275
- * @return {Number} Password Strength Score
276
- */
277
- passwordStrength () {
278
- return this.password ? __WEBPACK_IMPORTED_MODULE_0_zxcvbn___default()(this.password, (this.userInputs.length >= 1 ? this.userInputs : null)).score : null
279
- },
280
-
281
- /**
282
- * isSecure checks if the length of the password is longer then
283
- * the defined `secureLength`
284
- * @return {Boolean} Password length longer then minLength
285
- */
286
- isSecure () {
287
- return this.password ? this.password.length >= this.secureLength : null
288
- },
289
-
290
- /**
291
- * isActive checks if a password is entered.
292
- * It's required for the password count badge.
293
- * @return {Boolean} Password entered
294
- */
295
- isActive () {
296
- return this.password && this.password.length > 0
297
- },
298
-
299
- /**
300
- * passwordCount holds the character count of the
301
- * current password. It shows the count up to the `secureLength`.
302
- * @return {Number} Password Character Count
303
- */
304
- passwordCount () {
305
- return this.password && (this.password.length > this.secureLength ? `${this.secureLength}+` : this.password.length)
306
- },
307
- /**
308
- * Changing the input type from password to text
309
- * based on the local _showPassword data or the showPassword prop
310
- */
311
- inputType () {
312
- return this.$data._showPassword || this.showPassword ? 'text' : 'password'
313
- },
314
-
315
- showPasswordLabel () {
316
- return this.$data._showPassword || this.showPassword ? this.labelHide : this.labelShow
317
- }
318
- },
319
-
320
- watch: {
321
- modelValue (newValue) {
322
- if (this.strengthMeterOnly) {
323
- this.emitValue('input', newValue)
324
- }
325
- this.$emit('feedback', __WEBPACK_IMPORTED_MODULE_0_zxcvbn___default()(newValue).feedback)
326
- },
327
- passwordStrength (score) {
328
- this.$emit('score', score)
329
- }
330
- }
331
- });
332
-
333
-
334
- /***/ }),
335
- /* 1 */
336
- /***/ (function(module, exports, __webpack_require__) {
337
-
338
- "use strict";
339
-
340
-
341
- var _PasswordStrengthMeter = __webpack_require__(2);
342
-
343
- var _PasswordStrengthMeter2 = _interopRequireDefault(_PasswordStrengthMeter);
344
-
345
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
346
-
347
- module.exports = _PasswordStrengthMeter2.default;
348
-
349
- /***/ }),
350
- /* 2 */
351
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
352
-
353
- "use strict";
354
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
355
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__PasswordStrengthMeter_vue_vue_type_template_id_6432a730__ = __webpack_require__(3);
356
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__PasswordStrengthMeter_vue_vue_type_template_id_6432a730___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__PasswordStrengthMeter_vue_vue_type_template_id_6432a730__);
357
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__PasswordStrengthMeter_vue_vue_type_script_lang_js__ = __webpack_require__(0);
358
- /* empty harmony namespace reexport */
359
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__PasswordStrengthMeter_vue_vue_type_style_index_0_id_6432a730_lang_scss__ = __webpack_require__(5);
360
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__PasswordStrengthMeter_vue_vue_type_style_index_0_id_6432a730_lang_scss___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__PasswordStrengthMeter_vue_vue_type_style_index_0_id_6432a730_lang_scss__);
361
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_D_Users_ahmad_Documents_vue3_password_strength_meter_node_modules_vue_loader_dist_exportHelper_js__ = __webpack_require__(6);
362
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_D_Users_ahmad_Documents_vue3_password_strength_meter_node_modules_vue_loader_dist_exportHelper_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_D_Users_ahmad_Documents_vue3_password_strength_meter_node_modules_vue_loader_dist_exportHelper_js__);
363
-
364
-
365
-
366
-
367
-
368
-
369
-
370
- const __exports__ = /*#__PURE__*/__WEBPACK_IMPORTED_MODULE_3_D_Users_ahmad_Documents_vue3_password_strength_meter_node_modules_vue_loader_dist_exportHelper_js___default()(__WEBPACK_IMPORTED_MODULE_1__PasswordStrengthMeter_vue_vue_type_script_lang_js__["a" /* default */], [['render',__WEBPACK_IMPORTED_MODULE_0__PasswordStrengthMeter_vue_vue_type_template_id_6432a730__["render"]]])
371
-
372
- /* harmony default export */ __webpack_exports__["default"] = (__exports__);
373
-
374
- /***/ }),
375
- /* 3 */
376
- /***/ (function(module, exports) {
377
-
378
- throw new Error("Module parse failed: Unexpected token (2:2)\nYou may need an appropriate loader to handle this file type.\n| \r\n| <div class=\"Password\">\r\n| <div\r\n| v-if=\"!strengthMeterOnly\"\r");
379
-
380
- /***/ }),
381
- /* 4 */
382
- /***/ (function(module, exports) {
383
-
384
- module.exports = __WEBPACK_EXTERNAL_MODULE_4__;
385
-
386
- /***/ }),
387
- /* 5 */
388
- /***/ (function(module, exports) {
389
-
390
- throw new Error("Module parse failed: Unexpected token (2:10)\nYou may need an appropriate loader to handle this file type.\n| \r\n| [v-cloak] {\r\n| display: none;\r\n| }\r");
391
-
392
- /***/ }),
393
- /* 6 */
394
- /***/ (function(module, exports, __webpack_require__) {
395
-
396
- "use strict";
397
-
398
- Object.defineProperty(exports, "__esModule", { value: true });
399
- // runtime helper for setting properties on components
400
- // in a tree-shakable way
401
- exports.default = (sfc, props) => {
402
- const target = sfc.__vccOpts || sfc;
403
- for (const [key, val] of props) {
404
- target[key] = val;
405
- }
406
- return target;
407
- };
408
-
409
-
410
- /***/ })
411
- /******/ ]);
412
- });