bfg-common 1.3.558 → 1.3.559

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.
Files changed (35) hide show
  1. package/components/common/browse/Browse.vue +221 -186
  2. package/components/common/browse/blocks/Container.vue +5 -5
  3. package/components/common/browse/blocks/Title.vue +91 -66
  4. package/components/common/browse/blocks/contents/Files.vue +1 -1
  5. package/components/common/browse/blocks/info/Date.vue +21 -21
  6. package/components/common/browse/blocks/info/Size.vue +1 -1
  7. package/components/common/layout/theHeader/TheHeader.vue +17 -3
  8. package/components/common/layout/theHeader/TheHeaderNew.vue +10 -0
  9. package/components/common/layout/theHeader/TheHeaderOld.vue +10 -0
  10. package/components/common/layout/theHeader/ThemeSwitch.vue +1 -1
  11. package/components/common/layout/theHeader/userMenu/UserMenu.vue +11 -9
  12. package/components/common/layout/theHeader/userMenu/modals/preferences/Preferences.vue +16 -9
  13. package/components/common/layout/theHeader/userMenu/modals/preferences/PreferencesNew.vue +22 -21
  14. package/components/common/layout/theHeader/userMenu/modals/preferences/PreferencesOld.vue +20 -17
  15. package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/ChangeLanguage.vue +110 -0
  16. package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/ChangeLanguageNew.vue +22 -88
  17. package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/ChangeLanguageOld.vue +28 -82
  18. package/components/common/layout/theHeader/userMenu/modals/preferences/defaultConsole/DefaultConsole.vue +23 -47
  19. package/components/common/layout/theHeader/userMenu/modals/preferences/defaultConsole/DefaultConsoleNew.vue +52 -0
  20. package/components/common/layout/theHeader/userMenu/modals/preferences/defaultConsole/DefaultConsoleOld.vue +48 -0
  21. package/components/common/layout/theHeader/userMenu/modals/preferences/inventory/Inventory.vue +36 -0
  22. package/components/common/layout/theHeader/userMenu/modals/preferences/inventory/InventoryNew.vue +35 -0
  23. package/components/common/layout/theHeader/userMenu/modals/preferences/{Inventory.vue → inventory/InventoryOld.vue} +1 -13
  24. package/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/TimeFormat.vue +54 -0
  25. package/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/TimeFormatNew.vue +10 -27
  26. package/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/TimeFormatOld.vue +6 -28
  27. package/components/common/layout/theHeader/userMenu/modals/preferences/view/View.vue +45 -0
  28. package/components/common/layout/theHeader/userMenu/modals/preferences/view/ViewNew.vue +5 -92
  29. package/components/common/layout/theHeader/userMenu/modals/preferences/view/ViewOld.vue +5 -27
  30. package/components/common/selectLanguage/SelectLanguage.vue +10 -14
  31. package/components/common/vm/actions/common/customizeHardware/virtualHardware/browseView/BrowseView.vue +7 -7
  32. package/composables/useEnvLanguage.ts +4 -1
  33. package/package.json +2 -2
  34. package/plugins/recursion.ts +293 -271
  35. package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/lib/config/lang.ts +0 -10
@@ -10,9 +10,13 @@
10
10
  {{ localization.timeFormat }}
11
11
  </div>
12
12
  <div class="form-second-title">
13
- {{ description }}
13
+ {{ props.description }}
14
14
  </div>
15
- <div v-for="(item, key) in formatOptions" :key="key" class="radio">
15
+ <div
16
+ v-for="(item, key) in props.formatOptions"
17
+ :key="key"
18
+ class="radio"
19
+ >
16
20
  <ui-radio
17
21
  v-model="timeItem"
18
22
  :test-id="item.testId"
@@ -30,36 +34,15 @@
30
34
  import type { UI_I_Localization } from '~/lib/models/interfaces'
31
35
  import type { UI_I_RadioItem } from '~/components/common/layout/theHeader/userMenu/lib/models/interfaces'
32
36
  import type { UI_T_TimeValue } from '~/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/lib/models/types'
33
- import { formatOptionsFunc } from '~/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/lib/config/formatOptions'
34
37
 
35
38
  const props = defineProps<{
36
- timeFormat: UI_T_TimeValue
39
+ description: string
40
+ formatOptions: UI_I_RadioItem[]
37
41
  }>()
38
- const emits = defineEmits<{
39
- (event: 'update', value: UI_T_TimeValue): void
40
- }>()
41
- const localization = computed<UI_I_Localization>(() => useLocal())
42
42
 
43
- const config = useRuntimeConfig()
44
- const description = computed<string>(() =>
45
- localization.value.timeFormatDesc.replaceAll(
46
- '{trademark}',
47
- String(config.public[`TRADEMARK_${useEnvLanguage()}`])
48
- )
49
- )
50
-
51
- const formatOptions = readonly<UI_I_RadioItem[]>(
52
- formatOptionsFunc(localization.value)
53
- )
43
+ const localization = computed<UI_I_Localization>(() => useLocal())
54
44
 
55
- const timeItem = computed({
56
- get() {
57
- return props.timeFormat
58
- },
59
- set(newValue: UI_T_TimeValue) {
60
- emits('update', newValue)
61
- },
62
- })
45
+ const timeItem = defineModel<UI_T_TimeValue>()
63
46
  </script>
64
47
 
65
48
  <style lang="scss" scoped>
@@ -1,17 +1,16 @@
1
1
  <template>
2
- <form id="time-format-form" class="compact ng-valid ng-dirty ng-touched">
2
+ <form id="time-format-form" class="compact">
3
3
  <div class="description">
4
- {{ description }}
4
+ {{ props.description }}
5
5
  </div>
6
6
 
7
- <div v-for="(item, key) in formatOptions" :key="key" class="radio">
7
+ <div v-for="(item, key) in props.formatOptions" :key="key" class="radio">
8
8
  <input
9
9
  :id="item.value"
10
10
  v-model="timeItem"
11
11
  :data-id="item.testId"
12
12
  type="radio"
13
13
  :value="item.value"
14
- @change="onChange"
15
14
  />
16
15
  <label :for="item.value">
17
16
  {{ item.label }}
@@ -21,36 +20,15 @@
21
20
  </template>
22
21
 
23
22
  <script setup lang="ts">
24
- import type { UI_I_Localization } from '~/lib/models/interfaces'
25
23
  import type { UI_I_RadioItem } from '~/components/common/layout/theHeader/userMenu/lib/models/interfaces'
26
24
  import type { UI_T_TimeValue } from '~/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/lib/models/types'
27
- import { formatOptionsFunc } from '~/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/lib/config/formatOptions'
28
25
 
29
26
  const props = defineProps<{
30
- timeFormat: UI_T_TimeValue
27
+ description: string
28
+ formatOptions: UI_I_RadioItem[]
31
29
  }>()
32
- const emits = defineEmits<{
33
- (event: 'update', value: UI_T_TimeValue): void
34
- }>()
35
- const localization = computed<UI_I_Localization>(() => useLocal())
36
-
37
- const config = useRuntimeConfig()
38
- const description = computed<string>(() =>
39
- localization.value.timeFormatDesc.replaceAll(
40
- '{trademark}',
41
- String(config.public[`TRADEMARK_${useEnvLanguage()}`])
42
- )
43
- )
44
-
45
- const formatOptions = readonly<UI_I_RadioItem[]>(
46
- formatOptionsFunc(localization.value)
47
- )
48
30
 
49
- const timeItem = ref<UI_T_TimeValue>(props.timeFormat)
50
-
51
- const onChange = (): void => {
52
- emits('update', timeItem.value)
53
- }
31
+ const timeItem = defineModel<UI_T_TimeValue>()
54
32
  </script>
55
33
 
56
34
  <style lang="scss" scoped>
@@ -0,0 +1,45 @@
1
+ <template>
2
+ <common-layout-the-header-user-menu-modals-preferences-view-new
3
+ v-if="props.newView"
4
+ v-model="model"
5
+ :description="description"
6
+ />
7
+ <common-layout-the-header-user-menu-modals-preferences-view-old
8
+ v-else
9
+ v-model="model"
10
+ :description="description"
11
+ />
12
+ </template>
13
+
14
+ <script setup lang="ts">
15
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
16
+
17
+ const props = defineProps<{
18
+ newView: boolean
19
+ newViewLocal: boolean
20
+ }>()
21
+
22
+ const emits = defineEmits<{
23
+ (event: 'update-is-new-view', value: boolean): void
24
+ }>()
25
+
26
+ const config = useRuntimeConfig()
27
+
28
+ const localization = computed<UI_I_Localization>(() => useLocal())
29
+
30
+ const description = computed<string>(() => {
31
+ return localization.value.viewDesc.replaceAll(
32
+ '{trademark}',
33
+ String(config.public[`TRADEMARK_${useEnvLanguage()}`])
34
+ )
35
+ })
36
+
37
+ const model = computed<boolean>({
38
+ get() {
39
+ return props.newViewLocal
40
+ },
41
+ set(newValue: boolean) {
42
+ emits('update-is-new-view', newValue)
43
+ },
44
+ })
45
+ </script>
@@ -10,11 +10,11 @@
10
10
  {{ localization.view }}
11
11
  </div>
12
12
  <div class="form-second-title">
13
- {{ description }}
13
+ {{ props.description }}
14
14
  </div>
15
15
 
16
16
  <div class="flex-align-center">
17
- <ui-switch v-model="isNewViewLocal" :label="localization.newView" />
17
+ <ui-switch v-model="newViewLocal" :label="localization.newView" />
18
18
  </div>
19
19
  </div>
20
20
  </div>
@@ -25,97 +25,10 @@
25
25
  import type { UI_I_Localization } from '~/lib/models/interfaces'
26
26
 
27
27
  const props = defineProps<{
28
- isNewView: boolean
28
+ description: string
29
29
  }>()
30
30
 
31
- const isNewViewLocal = computed({
32
- get() {
33
- return props.isNewView
34
- },
35
- set(newValue: boolean) {
36
- emits('update', newValue)
37
- },
38
- })
39
-
40
- const emits = defineEmits<{
41
- (event: 'update', value: boolean): void
42
- }>()
43
-
44
- const config = useRuntimeConfig()
31
+ const newViewLocal = defineModel<boolean>()
45
32
 
46
33
  const localization = computed<UI_I_Localization>(() => useLocal())
47
-
48
- const description = computed<string>(() => {
49
- return localization.value.viewDesc.replaceAll(
50
- '{trademark}',
51
- String(config.public[`TRADEMARK_${useEnvLanguage()}`])
52
- )
53
- })
54
-
55
- </script>
56
-
57
- <style lang="scss" scoped>
58
- .description {
59
- margin-bottom: 10px;
60
- }
61
-
62
- label {
63
- margin-right: 6px;
64
- }
65
-
66
- input[type='checkbox'] {
67
- --active: var(--checkbox-value-active-color);
68
- --active-inner: var(--checkbox-mark-color);
69
- --border: var(--checkbox-mark-color);
70
- --background: var(--checkbox-mark-background-color);
71
- -webkit-appearance: none;
72
- -moz-appearance: none;
73
- height: 20px;
74
- outline: none;
75
- display: inline-block;
76
- vertical-align: top;
77
- position: relative;
78
- margin: 0;
79
- cursor: pointer;
80
- border: 1px solid var(--bc, var(--border));
81
- background: var(--b, var(--background));
82
- transition: background 0.3s, border-color 0.3s, box-shadow 0.2s;
83
- &:after {
84
- content: '';
85
- display: block;
86
- left: 0;
87
- top: 0;
88
- position: absolute;
89
- transition: transform var(--d-t, 0.3s) var(--d-t-e, ease),
90
- opacity var(--d-o, 0.2s);
91
- }
92
- &:checked {
93
- --b: var(--active);
94
- --bc: var(--active);
95
- --d-o: 0.3s;
96
- --d-t: 0.6s;
97
- --d-t-e: cubic-bezier(0.2, 0.85, 0.32, 1.2);
98
- }
99
- }
100
- input[type='checkbox'] {
101
- &.switch {
102
- width: 35px;
103
- border-radius: 11px;
104
- &:after {
105
- left: 2px;
106
- top: 2px;
107
- bottom: 2px;
108
- border-radius: 50%;
109
- width: 14px;
110
- height: 14px;
111
- border: 1px solid var(--bc, var(--border));
112
- background: var(--ab, var(--border));
113
- transform: translateX(var(--x, 0));
114
- }
115
- &:checked {
116
- --ab: var(--active-inner);
117
- --x: 14px;
118
- }
119
- }
120
- }
121
- </style>
34
+ </script>
@@ -1,19 +1,13 @@
1
1
  <template>
2
2
  <form id="view-form" class="compact">
3
3
  <div class="description">
4
- {{ description }}
4
+ {{ props.description }}
5
5
  </div>
6
6
 
7
7
  <div class="flex-align-center">
8
8
  <label for="view">{{ localization.newView }}</label>
9
- <input
10
- id="view"
11
- v-model="isNewViewLocal"
12
- type="checkbox"
13
- class="switch"
14
- :disabled="isDisabled"
15
- @change="onChange"
16
- />
9
+ <!-- :disabled="isDisabled"-->
10
+ <input id="view" v-model="newViewLocal" type="checkbox" class="switch" />
17
11
  </div>
18
12
  </form>
19
13
  </template>
@@ -22,29 +16,13 @@
22
16
  import type { UI_I_Localization } from '~/lib/models/interfaces'
23
17
 
24
18
  const props = defineProps<{
25
- isNewView: boolean
19
+ description: string
26
20
  }>()
27
21
 
28
- const isNewViewLocal = ref<boolean>(props.isNewView)
29
-
30
- const emits = defineEmits<{
31
- (event: 'update', value: boolean): void
32
- }>()
33
-
34
- const config = useRuntimeConfig()
35
-
36
22
  const localization = computed<UI_I_Localization>(() => useLocal())
37
23
 
38
- const description = computed<string>(() => {
39
- return localization.value.viewDesc.replaceAll(
40
- '{trademark}',
41
- String(config.public[`TRADEMARK_${useEnvLanguage()}`])
42
- )
43
- })
24
+ const newViewLocal = defineModel<boolean>()
44
25
 
45
- const onChange = (): void => {
46
- emits('update', isNewViewLocal.value)
47
- }
48
26
  const isDisabled = ref<boolean>(true)
49
27
  // @ts-ignore
50
28
  window.tools = new Proxy(
@@ -9,7 +9,6 @@
9
9
  :disabled="props.disabled"
10
10
  :size="props.size"
11
11
  max-height="inherit"
12
- @change="onSelect"
13
12
  >
14
13
  <template #toggleContent>
15
14
  <span class="language-dropdown__icon content-icon"
@@ -37,11 +36,12 @@
37
36
 
38
37
  <script lang="ts" setup>
39
38
  import type { UI_I_Dropdown } from '~/node_modules/bfg-uikit/components/ui/dropdown/models/interfaces'
39
+ import { findInLocals } from '~/components/common/selectLanguage/lib/utils/utils'
40
40
 
41
41
  const props = withDefaults(
42
42
  defineProps<{
43
43
  normalizeLang: UI_I_Dropdown[]
44
- selectedLang: UI_I_Dropdown
44
+ modelValue: UI_I_Dropdown
45
45
  disabled?: boolean
46
46
  width?: string
47
47
  size?: 'sm' | 'md'
@@ -54,21 +54,17 @@ const props = withDefaults(
54
54
  )
55
55
 
56
56
  const emits = defineEmits<{
57
- (event: 'change', lang: UI_I_Dropdown): void
57
+ (event: 'update:model-value', newValue: UI_I_Dropdown): void
58
58
  }>()
59
59
 
60
- const selectedLang = ref<UI_I_Dropdown>(props.selectedLang)
61
- const onSelect = (lang: UI_I_Dropdown): void => {
62
- emits('change', lang)
63
- }
64
-
65
- watch(
66
- () => props.selectedLang,
67
- (newValue: UI_I_Dropdown) => {
68
- selectedLang.value = newValue
60
+ const selectedLang = computed<UI_I_Dropdown>({
61
+ get() {
62
+ return props.modelValue
69
63
  },
70
- { deep: true, immediate: true }
71
- )
64
+ set(newValue: UI_I_Dropdown) {
65
+ emits('update:model-value', newValue)
66
+ },
67
+ })
72
68
  </script>
73
69
 
74
70
  <style lang="scss" scoped>
@@ -17,13 +17,13 @@
17
17
  </template>
18
18
 
19
19
  <script lang="ts" setup>
20
- import { UI_I_FileTreeNode } from '~/components/lib/models/interfaces'
21
- import { UI_I_TablePayload } from '~/lib/models/table/interfaces'
22
- import { UI_I_FolderOrFileTreePayload } from '~/lib/models/store/storage/interfaces'
23
- import { UI_I_CurrentDirNodesArguments } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/browseView/lib/models/interfaces'
24
- import { UI_I_Localization } from '~/lib/models/interfaces'
25
- import { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
26
- import { UI_I_FileInfo } from '~/components/common/browse/lib/models/interfaces'
20
+ import type { UI_I_FileTreeNode } from '~/components/lib/models/interfaces'
21
+ import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
22
+ import type { UI_I_FolderOrFileTreePayload } from '~/lib/models/store/storage/interfaces'
23
+ import type { UI_I_CurrentDirNodesArguments } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/browseView/lib/models/interfaces'
24
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
25
+ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
26
+ import type { UI_I_FileInfo } from '~/components/common/browse/lib/models/interfaces'
27
27
 
28
28
  const props = defineProps<{
29
29
  show: boolean
@@ -3,7 +3,10 @@ export function useEnvLanguage(): string {
3
3
 
4
4
  let localizationCode = 'en_US'
5
5
  const langFromLocalStorage =
6
- useLocalStorage('lang') || $store.getters['main/getInterfaceLang'] // Из $store для Сферы, но думаю нужно сделать одинаково из localStorage
6
+ useLocalStorage('lang') ||
7
+ useLocalStorage('languageType') ||
8
+ $store.getters['main/getInterfaceLang'] // Из $store для Сферы, но думаю нужно сделать одинаково из localStorage
9
+
7
10
  if (langFromLocalStorage) {
8
11
  if (
9
12
  langFromLocalStorage === 'en_US' ||
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.3.558",
4
+ "version": "1.3.559",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",
@@ -35,7 +35,7 @@
35
35
  "@vueuse/components": "^10.1.2",
36
36
  "date-fns": "^2.29.3",
37
37
  "bfg-nuxt-3-graph": "^1.0.15",
38
- "bfg-uikit": "1.0.79",
38
+ "bfg-uikit": "1.0.86",
39
39
  "html2canvas": "^1.4.1",
40
40
  "prettier-eslint": "^15.0.1"
41
41
  }