@stubber/ui 1.0.19 → 1.0.23
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,6 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
export let type = "info";
|
|
3
3
|
export let message = "";
|
|
4
|
+
// export let hide = () => {};
|
|
4
5
|
|
|
5
6
|
let colorClass = "";
|
|
6
7
|
$: switch (type) {
|
|
@@ -28,7 +29,9 @@
|
|
|
28
29
|
{@html message}
|
|
29
30
|
</div>
|
|
30
31
|
<div class="ml-auto flex items-center">
|
|
31
|
-
<
|
|
32
|
+
<!-- <button on:click={ hide() }> -->
|
|
33
|
+
<span class="text-white far fa-lg fa-xmark" />
|
|
34
|
+
<!-- </button> -->
|
|
32
35
|
</div>
|
|
33
36
|
</div>
|
|
34
37
|
</div>
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
<script>import PasswordStrengthItem from "./PasswordStrengthItem.svelte";
|
|
2
2
|
export let value = "";
|
|
3
3
|
export let isStrong = true;
|
|
4
|
-
let
|
|
4
|
+
export let validate_password = validate_password_default;
|
|
5
|
+
export let password_length = 8;
|
|
6
|
+
let is_enough_characters = false;
|
|
5
7
|
let hasNumber = false;
|
|
6
8
|
let hasSymbol = false;
|
|
7
9
|
let hasUpper = false;
|
|
8
10
|
let hasLower = false;
|
|
9
|
-
$:
|
|
10
|
-
function
|
|
11
|
-
|
|
11
|
+
$: validate_password(value);
|
|
12
|
+
function validate_password_default(password) {
|
|
13
|
+
is_enough_characters = password.length >= password_length;
|
|
12
14
|
hasLower = /[a-z]/.test(password);
|
|
13
15
|
hasUpper = /[A-Z]/.test(password);
|
|
14
16
|
hasNumber = /\d/.test(password);
|
|
15
17
|
hasSymbol = /[!@#$%^&*]/.test(password);
|
|
16
|
-
isStrong =
|
|
18
|
+
isStrong = is_enough_characters && hasLower && hasUpper && hasNumber && hasSymbol;
|
|
17
19
|
}
|
|
18
20
|
$: firstColumn = [
|
|
19
21
|
{ isPassed: hasLower, value: "At least one lower case character" },
|
|
@@ -22,7 +24,7 @@ $: firstColumn = [
|
|
|
22
24
|
];
|
|
23
25
|
$: secondColumn = [
|
|
24
26
|
{ isPassed: hasSymbol, value: "Contains a symbol" },
|
|
25
|
-
{ isPassed:
|
|
27
|
+
{ isPassed: is_enough_characters, value: `At least ${password_length} characters` }
|
|
26
28
|
];
|
|
27
29
|
</script>
|
|
28
30
|
|