bfg-common 1.4.245 → 1.4.246

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.
@@ -184,7 +184,7 @@ const frequencyMethodOptions = computed<UI_I_SelectInputItem[]>(() =>
184
184
  }
185
185
  }
186
186
  }
187
-
187
+ /* TODO нужно перенести в глобально */
188
188
  input[type='checkbox'] {
189
189
  --active: var(--checkbox-value-active-color);
190
190
  --active-inner: var(--checkbox-mark-color);
@@ -0,0 +1,11 @@
1
+ import type { UI_I_ArbitraryObject } from '~/lib/models/interfaces'
2
+ export const enumKeyFromValue = (
3
+ enumObj: UI_I_ArbitraryObject<string | number>,
4
+ value: string
5
+ ): string | undefined => {
6
+ // Преобразуем enum в массив пар [ключ, значение] и находим нужную пару
7
+ const dataFromEnum = Object.entries(enumObj).find(([_, val]) => val === value)
8
+
9
+ // Возвращаем ключ, если найдена пара, иначе undefined
10
+ return dataFromEnum ? dataFromEnum[0] : undefined
11
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.4.245",
4
+ "version": "1.4.246",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",