bfg-common 1.5.209 → 1.5.211

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.
@@ -118,7 +118,7 @@ const emits = defineEmits<{
118
118
  padding: 8px;
119
119
 
120
120
  //overflow-x: hidden;
121
- overflow-y: auto;
121
+ //overflow-y: auto;
122
122
 
123
123
  .context-loader {
124
124
  position: absolute;
@@ -42,11 +42,13 @@ const navigate = computed<string>(() => '/' + props.item.navigateTo)
42
42
 
43
43
  <style>
44
44
  :root {
45
- --shortcut-item-hover-bg: #e9ebed33;
45
+ --shortcut-item-hover-bg: linear-gradient(135deg, #FFFFFF 0%, #F0F8FD 100%);
46
+ --shortcut-item-hover-box-shadow: inset 0 0 0 1.5px #008fd6, 0px 2px 24px 0px #0000001f;
46
47
  --shortcut-item-disabled-text-icon-color: #bdc3c7;
47
48
  }
48
49
  :root.dark-theme {
49
- --shortcut-item-hover-bg: #e9ebed08;
50
+ --shortcut-item-hover-bg: linear-gradient(135deg, #334453 0%, #324C5E 100%);
51
+ --shortcut-item-hover-box-shadow: inset 0 0 0 1.5px #2BA2DE, 0px -1px 12px 0px rgba(0, 0, 0, 0.1), 0px 4px 20px 0px rgba(0, 0, 0, 0.12);
50
52
  --shortcut-item-disabled-text-icon-color: #bdc3c770;
51
53
  }
52
54
  </style>
@@ -55,6 +57,7 @@ const navigate = computed<string>(() => '/' + props.item.navigateTo)
55
57
  .category-block-item {
56
58
  max-width: 176px;
57
59
  min-height: 110px;
60
+ transition: background 200ms ease-in-out, box-shadow 200ms ease-in-out, transform 200ms ease-in-out, color 150ms ease-in-out;
58
61
 
59
62
  &.disabled {
60
63
  opacity: 0.6;
@@ -90,6 +93,8 @@ const navigate = computed<string>(() => '/' + props.item.navigateTo)
90
93
 
91
94
  &:hover:not(.disabled) {
92
95
  background: var(--shortcut-item-hover-bg);
96
+ box-shadow: var(--shortcut-item-hover-box-shadow);
97
+ transform: translateY(-1px);
93
98
  cursor: pointer;
94
99
  .unit {
95
100
  &-icon {
@@ -61,6 +61,7 @@ setForm()
61
61
 
62
62
  const showValidationErrors = (): void => {
63
63
  const valid = validation.touch()
64
+ console.log(valid, 111)
64
65
  passwordErrorText.value = !valid.isValid ? valid.errors.password[0] : ''
65
66
  emits('valid', valid.isValid)
66
67
  }
@@ -82,9 +83,9 @@ const setPasswordDisable = (): void => {
82
83
  const passwordErrorText = ref<string>('')
83
84
 
84
85
  const changePassword = (value: string): void => {
85
- showValidationErrors()
86
-
87
86
  password.value = value
87
+
88
+ showValidationErrors()
88
89
  }
89
90
 
90
91
  const isEnabledPassword = ref<boolean>(!!password.value)
@@ -94,6 +95,8 @@ const onGeneratePassword = (): void => {
94
95
 
95
96
  form.value.password.value = generatedPassword
96
97
  password.value = generatedPassword
98
+
99
+ showValidationErrors()
97
100
  }
98
101
  </script>
99
102
 
@@ -1,12 +1,24 @@
1
- export const generatePassword = (passwordLength = 12): string => {
2
- const chars =
3
- '0123456789abcdefghijklmnopqrstuvwxyz!@#$%^&*()ABCDEFGHIJKLMNOPQRSTUVWXYZ'
1
+ export const generatePassword = (length = 12): string => {
2
+ const lowercase = 'abcdefghijklmnopqrstuvwxyz';
3
+ const uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
4
+ const digits = '0123456789';
5
+ const special = '!@#$%^&*';
6
+ const all = lowercase + uppercase + digits + special;
4
7
 
5
- let password = ''
6
- for (let i = 0; i <= passwordLength; i++) {
7
- const randomNumber = Math.floor(Math.random() * chars.length)
8
- password += chars.substring(randomNumber, randomNumber + 1)
8
+ // Гарантируем наличие обязательных символов
9
+ const requiredChars = [
10
+ lowercase[Math.floor(Math.random() * lowercase.length)],
11
+ uppercase[Math.floor(Math.random() * uppercase.length)],
12
+ digits[Math.floor(Math.random() * digits.length)],
13
+ special[Math.floor(Math.random() * special.length)]
14
+ ];
15
+
16
+ // Оставшиеся символы
17
+ const remainingLength = length - requiredChars.length;
18
+ for (let i = 0; i < remainingLength; i++) {
19
+ requiredChars.push(all[Math.floor(Math.random() * all.length)]);
9
20
  }
10
21
 
11
- return password
22
+ // Перемешиваем
23
+ return requiredChars.sort(() => 0.5 - Math.random()).join('');
12
24
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.5.209",
4
+ "version": "1.5.211",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",