bfg-common 1.5.812 → 1.5.813

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 (105) hide show
  1. package/CODE_STYLE.md +109 -109
  2. package/assets/img/icons/icons-sprite-dark-3.svg +227 -227
  3. package/assets/img/icons/icons-sprite-dark-5.svg +488 -488
  4. package/assets/img/icons/icons-sprite-light-3.svg +227 -227
  5. package/assets/img/icons/icons-sprite-light-5.svg +488 -488
  6. package/components/atoms/TheIcon3.vue +50 -50
  7. package/components/atoms/collapse/CollapseNav.vue +170 -170
  8. package/components/atoms/perPage/PerPage.vue +58 -58
  9. package/components/atoms/table/dataGrid/DataGridPagination.vue +97 -97
  10. package/components/atoms/table/dataGrid/lib/config/settingsTable.ts +94 -94
  11. package/components/atoms/table/dataGrid/lib/utils/export.ts +16 -16
  12. package/components/common/backup/storage/actions/add/lib/utils.ts +51 -51
  13. package/components/common/browse/blocks/contents/filesNew/Skeleton.vue +18 -18
  14. package/components/common/configure/advancedSystemSettings/AdvancedSystemSettings.vue +47 -47
  15. package/components/common/configure/advancedSystemSettings/modals/edit/Edit.vue +78 -78
  16. package/components/common/configure/advancedSystemSettings/modals/edit/New.vue +56 -56
  17. package/components/common/configure/advancedSystemSettings/modals/edit/Old.vue +66 -66
  18. package/components/common/configure/advancedSystemSettings/tableView/TableView.vue +40 -40
  19. package/components/common/configure/advancedSystemSettings/tableView/old/Old.vue +122 -122
  20. package/components/common/configure/advancedSystemSettings/tableView/old/field/Field.vue +139 -139
  21. package/components/common/configure/advancedSystemSettings/tableView/old/field/lib/models/enums.ts +13 -13
  22. package/components/common/configure/advancedSystemSettings/tableView/old/lib/config/table.ts +131 -131
  23. package/components/common/diagramMain/modals/lib/config/vCenterModal.ts +48 -48
  24. package/components/common/diagramMain/port/Port.vue +580 -580
  25. package/components/common/layout/theHeader/userMenu/UserMenu.vue +116 -116
  26. package/components/common/layout/theHeader/userMenu/modals/preferences/lib/models/types.ts +7 -7
  27. package/components/common/layout/topNotification/TopNotification.vue +37 -37
  28. package/components/common/layout/topNotification/lib/models/enums.ts +3 -3
  29. package/components/common/pages/backups/DetailView.vue +52 -52
  30. package/components/common/pages/backups/lib/models/interfaces.ts +36 -36
  31. package/components/common/pages/backups/modals/Modals.vue +243 -243
  32. package/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/lib/config/options.ts +6 -6
  33. package/components/common/pages/backups/modals/restore/disks/tableView/old/Table.vue +117 -117
  34. package/components/common/pages/backups/modals/restore/lib/config/readyToCompleteOptions.ts +96 -96
  35. package/components/common/pages/backups/modals/restore/lib/config/steps.ts +134 -134
  36. package/components/common/pages/backups/modals/restore/name/lib/models/interfaces.ts +6 -6
  37. package/components/common/pages/home/lib/models/interfaces.ts +48 -48
  38. package/components/common/pages/home/widgets/hosts/Hosts.vue +27 -27
  39. package/components/common/pages/home/widgets/hosts/lib/config/items.ts +23 -23
  40. package/components/common/pages/home/widgets/vms/VmsOld.vue +35 -35
  41. package/components/common/pages/home/widgets/vms/lib/config/items.ts +19 -19
  42. package/components/common/pages/scheduledTasks/lib/utils/utils.ts +84 -84
  43. package/components/common/readyToComplete/ReadyToComplete.vue +17 -17
  44. package/components/common/select/radio/RadioGroup.vue +137 -137
  45. package/components/common/spiceConsole/Drawer.vue +420 -420
  46. package/components/common/spiceConsole/SpiceConsole.vue +184 -184
  47. package/components/common/spiceConsole/lib/models/interfaces.ts +5 -5
  48. package/components/common/tools/Actions.vue +207 -207
  49. package/components/common/treeView/TreeView.vue +52 -52
  50. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/lib/config/options.ts +28 -28
  51. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Memory.vue +283 -283
  52. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/New.vue +340 -340
  53. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +511 -502
  54. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/Old.vue +279 -279
  55. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/vmStoragePolicy/New.vue +53 -53
  56. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/vmStoragePolicy/Old.vue +45 -45
  57. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/vmStoragePolicy/VmStoragePolicy.vue +31 -31
  58. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/vmStoragePolicy/lib/config/options.ts +12 -12
  59. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +156 -156
  60. package/components/common/vm/actions/common/lib/models/interfaces.ts +192 -192
  61. package/components/common/vm/actions/common/select/compatibility/Old.vue +107 -107
  62. package/components/common/vm/actions/common/select/createType/lib/models/interfaces.ts +5 -5
  63. package/components/common/vm/actions/common/select/options/Options.vue +58 -58
  64. package/components/common/vm/actions/common/select/storage/Old.vue +125 -125
  65. package/components/common/vm/actions/common/select/storage/new/lib/models/interfaces.ts +5 -5
  66. package/components/common/vm/actions/common/select/storage/new/lib/utils/utils.ts +21 -21
  67. package/components/common/vm/actions/common/select/template/old/Old.vue +50 -50
  68. package/components/common/vm/actions/editSettings/new/Skeleton.vue +88 -88
  69. package/components/common/wizards/common/compatibility/Compatibility.vue +35 -35
  70. package/components/common/wizards/common/steps/name/Old.vue +121 -121
  71. package/components/common/wizards/common/steps/name/lib/models/interfaces.ts +4 -4
  72. package/components/common/wizards/common/steps/name/location/New.vue +40 -40
  73. package/components/common/wizards/datastore/add/steps/typeMode/lib/config/typeOptions.ts +43 -43
  74. package/components/common/wizards/network/add/steps/portProperties/PortProperties.vue +192 -192
  75. package/composables/useAppVersion.ts +21 -21
  76. package/composables/useLocal.ts +6 -6
  77. package/composables/useLocalCommon.ts +39 -39
  78. package/lib/config/regExp.ts +53 -53
  79. package/package.json +1 -1
  80. package/plugins/console.ts +21 -21
  81. package/plugins/helpers.ts +34 -34
  82. package/plugins/mouse.ts +21 -21
  83. package/plugins/panelStates.ts +70 -70
  84. package/plugins/text.ts +59 -59
  85. package/public/spice-console/application/clientgui.js +854 -854
  86. package/public/spice-console/application/packetfactory.js +211 -211
  87. package/public/spice-console/application/virtualmouse.js +147 -147
  88. package/public/spice-console/lib/images/bitmap.js +203 -203
  89. package/public/spice-console/network/spicechannel.js +440 -440
  90. package/public/spice-console/process/cursorprocess.js +128 -128
  91. package/public/spice-console/process/inputprocess.js +227 -227
  92. package/public/spice-console/process/mainprocess.js +212 -212
  93. package/public/spice-console/run.js +210 -210
  94. package/store/inventory/modules/configure/advancedSystemSettings/actions.ts +92 -92
  95. package/store/inventory/modules/configure/advancedSystemSettings/getters.ts +17 -17
  96. package/store/inventory/modules/configure/advancedSystemSettings/lib/models/interfaces.ts +45 -45
  97. package/store/inventory/modules/configure/advancedSystemSettings/lib/models/types.ts +30 -30
  98. package/store/inventory/modules/configure/advancedSystemSettings/mappers/mapSettings.ts +50 -50
  99. package/store/main/actions.ts +28 -28
  100. package/store/main/getters.ts +14 -14
  101. package/store/main/lib/interfaces.ts +18 -18
  102. package/store/main/mutations.ts +28 -28
  103. package/store/main/state.ts +9 -9
  104. package/store/tasks/mappers/recentTasks.ts +123 -123
  105. package/store/tasks/mutations.ts +82 -82
@@ -1,192 +1,192 @@
1
- <template>
2
- <common-wizards-network-add-steps-port-properties-new
3
- v-if="isNewView"
4
- v-model="fields"
5
- :messages-fields="props.messagesFields"
6
- :tcp-stacks="props.tcpStacks"
7
- :port-properties-enabled-services="portPropertiesEnabledServices"
8
- />
9
- <common-wizards-network-add-steps-port-properties-old
10
- v-else
11
- v-model="fields"
12
- :messages-fields="props.messagesFields"
13
- :alert-messages="props.alertMessages"
14
- :tcp-stacks="props.tcpStacks"
15
- :port-properties-enabled-services="portPropertiesEnabledServices"
16
- @hide-alert="onHideAlert"
17
- />
18
- </template>
19
-
20
- <script setup lang="ts">
21
- import type { UI_I_ErrorFields } from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/interfaces'
22
- import type Wizard from '~/node_modules/bfg-uikit/components/ui/wizard/lib/utils/utils'
23
- import type {
24
- UI_I_ArbitraryObject,
25
- UI_I_Localization,
26
- } from '~/lib/models/interfaces'
27
- import type { UI_T_Project } from '~/lib/models/types'
28
- import type {
29
- UI_I_PortProperties,
30
- UI_I_TCPStack,
31
- UI_I_PortPropertiesEnabledService,
32
- } from '~/components/common/wizards/network/add/lib/models/interfaces'
33
- import type { UI_T_TCP } from '~/components/common/wizards/network/add/lib/models/types'
34
- import {
35
- servicesInitial,
36
- portPropertiesEnabledServicesFunc,
37
- } from '~/components/common/wizards/network/add/lib/config/config'
38
- import {
39
- validateMtuPortPropertiesLocal,
40
- validateNetworkPortPropertiesLocal,
41
- validateVlanIdPortPropertiesLocal,
42
- } from '~/components/common/wizards/network/add/validations/validations'
43
-
44
- const props = withDefaults(
45
- defineProps<{
46
- wizard: Wizard
47
- portProperties: UI_I_PortProperties
48
- mtuFromSwitch?: number
49
- project: UI_T_Project
50
- messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
51
- alertMessages: string[]
52
- tcpStacks?: UI_I_TCPStack[]
53
- }>(),
54
- {
55
- mtuFromSwitch: 1500,
56
- tcpStacks: () => [],
57
- }
58
- )
59
-
60
- const emits = defineEmits<{
61
- (event: 'change-port-properties', portProperties: UI_I_PortProperties): void
62
- (event: 'change-gateway-flag', value: boolean): void
63
- (event: 'hide-alert', stepId: 3): void
64
- }>()
65
-
66
- const localization = computed<UI_I_Localization>(() => useLocal())
67
-
68
- const { $store }: any = useNuxtApp()
69
-
70
- const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
71
-
72
- const portPropertiesEnabledServices = computed<
73
- UI_I_PortPropertiesEnabledService[]
74
- >(() => portPropertiesEnabledServicesFunc(localization.value))
75
-
76
- const mtuCustom = ref<number>()
77
-
78
- const fields = ref<UI_I_PortProperties>({
79
- ...props.portProperties,
80
- mtu: {
81
- ...props.portProperties.mtu,
82
- size:
83
- !mtuCustom.value && props.portProperties.mtu.option !== '1'
84
- ? props.mtuFromSwitch
85
- : props.portProperties.mtu.size,
86
- },
87
- })
88
-
89
- const setEnabledService = (
90
- tcp: UI_T_TCP,
91
- currentFields: UI_I_PortProperties,
92
- newFields?: UI_I_PortProperties
93
- ): void => {
94
- if (tcp === 'default') {
95
- fields.value = {
96
- ...currentFields,
97
- services: useDeepCopy(servicesInitial),
98
- }
99
- } else if (servicesInitial.hasOwnProperty(tcp)) {
100
- fields.value = {
101
- ...(newFields || currentFields),
102
- services: {
103
- ...useDeepCopy(servicesInitial),
104
- [tcp]: true,
105
- },
106
- }
107
- } else {
108
- fields.value = {
109
- ...(newFields || currentFields),
110
- services: useDeepCopy(servicesInitial),
111
- }
112
- }
113
- }
114
-
115
- let oldFields = useDeepCopy(fields.value)
116
-
117
- watch(
118
- fields,
119
- (newFields: UI_I_PortProperties) => {
120
- if (newFields.tcp && newFields.tcp !== oldFields.tcp) {
121
- emits('change-gateway-flag', false)
122
- setEnabledService(newFields.tcp, fields.value, newFields)
123
- }
124
-
125
- oldFields.networkLabel !== newFields.networkLabel &&
126
- validateNetworkPortPropertiesLocal(
127
- localization.value,
128
- newFields,
129
- props.wizard
130
- )
131
-
132
- oldFields.vlanId !== newFields.vlanId &&
133
- validateVlanIdPortPropertiesLocal(
134
- localization.value,
135
- newFields,
136
- props.wizard
137
- )
138
-
139
- oldFields.mtu.size !== newFields.mtu.size &&
140
- validateMtuPortPropertiesLocal(
141
- localization.value,
142
- newFields,
143
- props.wizard
144
- )
145
-
146
- oldFields = useDeepCopy(newFields)
147
-
148
- emits('change-port-properties', newFields)
149
- },
150
- { deep: true, immediate: true }
151
- )
152
-
153
- watch(
154
- () => fields.value.mtu,
155
- (newMtu: { size: number; option: string }) => {
156
- if (newMtu.option === '0') {
157
- mtuCustom.value = props.mtuFromSwitch
158
- fields.value.mtu.size = props.mtuFromSwitch
159
- return
160
- }
161
- mtuCustom.value = newMtu.size
162
- },
163
- { deep: true, immediate: true }
164
- )
165
-
166
- watch(
167
- () => fields.value.tcp,
168
- (newTcp: UI_T_TCP, oldTcp: UI_T_TCP) => {
169
- if (newTcp !== oldTcp) {
170
- setEnabledService(newTcp, fields.value)
171
- }
172
- emits('change-port-properties', fields.value)
173
- }
174
- )
175
-
176
- watch(
177
- () => props.tcpStacks,
178
- (newValue: UI_I_TCPStack[]) => {
179
- if (fields.value.tcp === '') {
180
- fields.value.tcp =
181
- newValue?.find?.((item) => item.id === 'default')?.id ||
182
- newValue?.[0]?.id ||
183
- ''
184
- }
185
- },
186
- { deep: true, immediate: true }
187
- )
188
-
189
- const onHideAlert = (): void => {
190
- emits('hide-alert', 3)
191
- }
192
- </script>
1
+ <template>
2
+ <common-wizards-network-add-steps-port-properties-new
3
+ v-if="isNewView"
4
+ v-model="fields"
5
+ :messages-fields="props.messagesFields"
6
+ :tcp-stacks="props.tcpStacks"
7
+ :port-properties-enabled-services="portPropertiesEnabledServices"
8
+ />
9
+ <common-wizards-network-add-steps-port-properties-old
10
+ v-else
11
+ v-model="fields"
12
+ :messages-fields="props.messagesFields"
13
+ :alert-messages="props.alertMessages"
14
+ :tcp-stacks="props.tcpStacks"
15
+ :port-properties-enabled-services="portPropertiesEnabledServices"
16
+ @hide-alert="onHideAlert"
17
+ />
18
+ </template>
19
+
20
+ <script setup lang="ts">
21
+ import type { UI_I_ErrorFields } from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/interfaces'
22
+ import type Wizard from '~/node_modules/bfg-uikit/components/ui/wizard/lib/utils/utils'
23
+ import type {
24
+ UI_I_ArbitraryObject,
25
+ UI_I_Localization,
26
+ } from '~/lib/models/interfaces'
27
+ import type { UI_T_Project } from '~/lib/models/types'
28
+ import type {
29
+ UI_I_PortProperties,
30
+ UI_I_TCPStack,
31
+ UI_I_PortPropertiesEnabledService,
32
+ } from '~/components/common/wizards/network/add/lib/models/interfaces'
33
+ import type { UI_T_TCP } from '~/components/common/wizards/network/add/lib/models/types'
34
+ import {
35
+ servicesInitial,
36
+ portPropertiesEnabledServicesFunc,
37
+ } from '~/components/common/wizards/network/add/lib/config/config'
38
+ import {
39
+ validateMtuPortPropertiesLocal,
40
+ validateNetworkPortPropertiesLocal,
41
+ validateVlanIdPortPropertiesLocal,
42
+ } from '~/components/common/wizards/network/add/validations/validations'
43
+
44
+ const props = withDefaults(
45
+ defineProps<{
46
+ wizard: Wizard
47
+ portProperties: UI_I_PortProperties
48
+ mtuFromSwitch?: number
49
+ project: UI_T_Project
50
+ messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
51
+ alertMessages: string[]
52
+ tcpStacks?: UI_I_TCPStack[]
53
+ }>(),
54
+ {
55
+ mtuFromSwitch: 1500,
56
+ tcpStacks: () => [],
57
+ }
58
+ )
59
+
60
+ const emits = defineEmits<{
61
+ (event: 'change-port-properties', portProperties: UI_I_PortProperties): void
62
+ (event: 'change-gateway-flag', value: boolean): void
63
+ (event: 'hide-alert', stepId: 3): void
64
+ }>()
65
+
66
+ const localization = computed<UI_I_Localization>(() => useLocal())
67
+
68
+ const { $store }: any = useNuxtApp()
69
+
70
+ const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
71
+
72
+ const portPropertiesEnabledServices = computed<
73
+ UI_I_PortPropertiesEnabledService[]
74
+ >(() => portPropertiesEnabledServicesFunc(localization.value))
75
+
76
+ const mtuCustom = ref<number>()
77
+
78
+ const fields = ref<UI_I_PortProperties>({
79
+ ...props.portProperties,
80
+ mtu: {
81
+ ...props.portProperties.mtu,
82
+ size:
83
+ !mtuCustom.value && props.portProperties.mtu.option !== '1'
84
+ ? props.mtuFromSwitch
85
+ : props.portProperties.mtu.size,
86
+ },
87
+ })
88
+
89
+ const setEnabledService = (
90
+ tcp: UI_T_TCP,
91
+ currentFields: UI_I_PortProperties,
92
+ newFields?: UI_I_PortProperties
93
+ ): void => {
94
+ if (tcp === 'default') {
95
+ fields.value = {
96
+ ...currentFields,
97
+ services: useDeepCopy(servicesInitial),
98
+ }
99
+ } else if (servicesInitial.hasOwnProperty(tcp)) {
100
+ fields.value = {
101
+ ...(newFields || currentFields),
102
+ services: {
103
+ ...useDeepCopy(servicesInitial),
104
+ [tcp]: true,
105
+ },
106
+ }
107
+ } else {
108
+ fields.value = {
109
+ ...(newFields || currentFields),
110
+ services: useDeepCopy(servicesInitial),
111
+ }
112
+ }
113
+ }
114
+
115
+ let oldFields = useDeepCopy(fields.value)
116
+
117
+ watch(
118
+ fields,
119
+ (newFields: UI_I_PortProperties) => {
120
+ if (newFields.tcp && newFields.tcp !== oldFields.tcp) {
121
+ emits('change-gateway-flag', false)
122
+ setEnabledService(newFields.tcp, fields.value, newFields)
123
+ }
124
+
125
+ oldFields.networkLabel !== newFields.networkLabel &&
126
+ validateNetworkPortPropertiesLocal(
127
+ localization.value,
128
+ newFields,
129
+ props.wizard
130
+ )
131
+
132
+ oldFields.vlanId !== newFields.vlanId &&
133
+ validateVlanIdPortPropertiesLocal(
134
+ localization.value,
135
+ newFields,
136
+ props.wizard
137
+ )
138
+
139
+ oldFields.mtu.size !== newFields.mtu.size &&
140
+ validateMtuPortPropertiesLocal(
141
+ localization.value,
142
+ newFields,
143
+ props.wizard
144
+ )
145
+
146
+ oldFields = useDeepCopy(newFields)
147
+
148
+ emits('change-port-properties', newFields)
149
+ },
150
+ { deep: true, immediate: true }
151
+ )
152
+
153
+ watch(
154
+ () => fields.value.mtu,
155
+ (newMtu: { size: number; option: string }) => {
156
+ if (newMtu.option === '0') {
157
+ mtuCustom.value = props.mtuFromSwitch
158
+ fields.value.mtu.size = props.mtuFromSwitch
159
+ return
160
+ }
161
+ mtuCustom.value = newMtu.size
162
+ },
163
+ { deep: true, immediate: true }
164
+ )
165
+
166
+ watch(
167
+ () => fields.value.tcp,
168
+ (newTcp: UI_T_TCP, oldTcp: UI_T_TCP) => {
169
+ if (newTcp !== oldTcp) {
170
+ setEnabledService(newTcp, fields.value)
171
+ }
172
+ emits('change-port-properties', fields.value)
173
+ }
174
+ )
175
+
176
+ watch(
177
+ () => props.tcpStacks,
178
+ (newValue: UI_I_TCPStack[]) => {
179
+ if (fields.value.tcp === '') {
180
+ fields.value.tcp =
181
+ newValue?.find?.((item) => item.id === 'default')?.id ||
182
+ newValue?.[0]?.id ||
183
+ ''
184
+ }
185
+ },
186
+ { deep: true, immediate: true }
187
+ )
188
+
189
+ const onHideAlert = (): void => {
190
+ emits('hide-alert', 3)
191
+ }
192
+ </script>
@@ -1,21 +1,21 @@
1
- import type { UI_I_UseAppVersionReturnType } from '~/lib/models/composables/useAppVersion/interfaces'
2
-
3
- export function useAppVersion(): UI_I_UseAppVersionReturnType {
4
- const config = useRuntimeConfig()
5
- const version = config.public.APP_VERSION as string
6
-
7
- // const regexHasDot = /\./
8
- // const regexHasDotAndB = /\.\d*b$/
9
- // const regexHasDotAndD = /\..*d/
10
-
11
- // const isBeta = regexHasDotAndB.test(version)
12
- // const isDev =
13
- // regexHasDotAndD.test(version) ||
14
- // (!regexHasDot.test(version) && version.length < 8)
15
-
16
- return {
17
- version,
18
- // isBeta,
19
- // isDev,
20
- }
21
- }
1
+ import type { UI_I_UseAppVersionReturnType } from '~/lib/models/composables/useAppVersion/interfaces'
2
+
3
+ export function useAppVersion(): UI_I_UseAppVersionReturnType {
4
+ const config = useRuntimeConfig()
5
+ const version = config.public.APP_VERSION as string
6
+
7
+ // const regexHasDot = /\./
8
+ // const regexHasDotAndB = /\.\d*b$/
9
+ // const regexHasDotAndD = /\..*d/
10
+
11
+ // const isBeta = regexHasDotAndB.test(version)
12
+ // const isDev =
13
+ // regexHasDotAndD.test(version) ||
14
+ // (!regexHasDot.test(version) && version.length < 8)
15
+
16
+ return {
17
+ version,
18
+ // isBeta,
19
+ // isDev,
20
+ }
21
+ }
@@ -1,6 +1,6 @@
1
- import type { UI_I_Localization } from '~/lib/models/interfaces'
2
- import { useLocalCommon } from '~/composables/useLocalCommon'
3
-
4
- export const useLocal = (): UI_I_Localization => {
5
- return useLocalCommon()
6
- }
1
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
2
+ import { useLocalCommon } from '~/composables/useLocalCommon'
3
+
4
+ export const useLocal = (): UI_I_Localization => {
5
+ return useLocalCommon()
6
+ }
@@ -1,39 +1,39 @@
1
- import type { UI_I_Localization } from '~/lib/models/interfaces'
2
- import localAr from '~/assets/scss/clarity/local_ar.json'
3
- import localRu from '~/assets/localization/local_ru.json'
4
- import localEn from '~/assets/localization/local_en.json'
5
- import localHy from '~/assets/localization/local_hy.json'
6
- import localZh from '~/assets/localization/local_zh.json'
7
- import localKk from '~/assets/localization/local_kk.json'
8
- import localBe from '~/assets/localization/local_be.json'
9
- import { productNameLocal } from '~/lib/utils/localizationMapper'
10
-
11
- const rawLocals: Record<string, any> = {
12
- ar: localAr,
13
- ru: localRu,
14
- en: localEn,
15
- hy: localHy,
16
- zh: localZh,
17
- kk: localKk,
18
- be: localBe,
19
- }
20
-
21
- // Кешируем уже обработанные локали
22
- const processedCache: Record<string, UI_I_Localization | undefined> = {}
23
-
24
- export const useLocalCommon = (): UI_I_Localization => {
25
- const config = useRuntimeConfig()
26
- let code = String(config?.public?.LOCALIZATION_CODE || 'ru').toLowerCase()
27
-
28
- if (code === 'ar' && !useLocalStorage('rtl')) code = 'ru'
29
-
30
- if (typeof document !== 'undefined') document.documentElement.lang = code
31
-
32
- // если в кеше нет — создаём и сохраняем
33
- if (!processedCache[code]) {
34
- const raw = rawLocals[code] || rawLocals['ru']
35
- processedCache[code] = productNameLocal(raw)
36
- }
37
-
38
- return processedCache[code] as UI_I_Localization
39
- }
1
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
2
+ import localAr from '~/assets/scss/clarity/local_ar.json'
3
+ import localRu from '~/assets/localization/local_ru.json'
4
+ import localEn from '~/assets/localization/local_en.json'
5
+ import localHy from '~/assets/localization/local_hy.json'
6
+ import localZh from '~/assets/localization/local_zh.json'
7
+ import localKk from '~/assets/localization/local_kk.json'
8
+ import localBe from '~/assets/localization/local_be.json'
9
+ import { productNameLocal } from '~/lib/utils/localizationMapper'
10
+
11
+ const rawLocals: Record<string, any> = {
12
+ ar: localAr,
13
+ ru: localRu,
14
+ en: localEn,
15
+ hy: localHy,
16
+ zh: localZh,
17
+ kk: localKk,
18
+ be: localBe,
19
+ }
20
+
21
+ // Кешируем уже обработанные локали
22
+ const processedCache: Record<string, UI_I_Localization | undefined> = {}
23
+
24
+ export const useLocalCommon = (): UI_I_Localization => {
25
+ const config = useRuntimeConfig()
26
+ let code = String(config?.public?.LOCALIZATION_CODE || 'ru').toLowerCase()
27
+
28
+ if (code === 'ar' && !useLocalStorage('rtl')) code = 'ru'
29
+
30
+ if (typeof document !== 'undefined') document.documentElement.lang = code
31
+
32
+ // если в кеше нет — создаём и сохраняем
33
+ if (!processedCache[code]) {
34
+ const raw = rawLocals[code] || rawLocals['ru']
35
+ processedCache[code] = productNameLocal(raw)
36
+ }
37
+
38
+ return processedCache[code] as UI_I_Localization
39
+ }
@@ -1,53 +1,53 @@
1
- const ip =
2
- /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/
3
- const email = /^[^\s@]+@[^\s@]+\.[^\s@]+$/
4
- const password =
5
- /(?=.*[0-9])(?=.*[!@#$%^&*])(?=.*[a-z])(?=.*[A-Z])[0-9a-zA-Z!@#$%^&*]{8,}/
6
- // const url = /https?:\/\/([a-zA-Zа-яА-Я0-9.-]+)\.([a-zA-Zа-яА-Я]{2,})(?:$|\/|:)/
7
- const url = /https?:\/\/([a-zA-Zа-яА-Я0-9.-]+\.[a-zA-Zа-яА-Я]{2,6})\b/
8
- const specialChar = /[!@#$%^&*(),.?":{}|<>]/
9
- const specialCharWidthSpace = /[!@#$%^&*(),?":{}|<>]|(\s)|\.$/
10
- const cron =
11
- /^(\*|([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])|\*\/([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])) (\*|([0-9]|1[0-9]|2[0-3])|\*\/([0-9]|1[0-9]|2[0-3])) (\*|([1-9]|1[0-9]|2[0-9]|3[0-1])|\*\/([1-9]|1[0-9]|2[0-9]|3[0-1])) (\*|([1-9]|1[0-2])|\*\/([1-9]|1[0-2])) (\*|([0-6])|\*\/([0-6]))$/
12
-
13
- const unixPath = /^(?:(?:\/|~|\.\/|\.\.\/)?(?:[A-Za-z0-9._-]+(?:\/|$))+|\.)$/;
14
- // Примеры: /, /foo/bar, ./foo, ../foo, ~/dir
15
- const winPath = /^(?:[a-zA-Z]:\\|\\\\)(?:[^<>:"/\\|?*\r\n]+\\?)*$/;
16
- // Примеры: C:\path\to\file, \\server\share\folder\
17
- const mac = /^([0-9A-Fa-f]{2}[:-]){5}[0-9A-Fa-f]{2}$/;
18
- // MAC адреса: 01:23:45:67:89:ab или 01-23-45-67-89-ab
19
- const ip4 = /^(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)){3}$/;
20
- const ip6 = /^((?:[0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}|(?:[0-9A-Fa-f]{1,4}:){1,7}:|:(?::[0-9A-Fa-f]{1,4}){1,7}|(?:[0-9A-Fa-f]{1,4}:){1,6}:[0-9A-Fa-f]{1,4}|(?:[0-9A-Fa-f]{1,4}:){1,5}(?::[0-9A-Fa-f]{1,4}){1,2}|(?:[0-9A-Fa-f]{1,4}:){1,4}(?::[0-9A-Fa-f]{1,4}){1,3}|(?:[0-9A-Fa-f]{1,4}:){1,3}(?::[0-9A-Fa-f]{1,4}){1,4}|(?:[0-9A-Fa-f]{1,4}:){1,2}(?::[0-9A-Fa-f]{1,4}){1,5})$/i;
21
- // Покрывает обычные формы IPv6 с сокращениями (::)
22
- // const url = /^(https?:\/\/)?([^\s:@\/]+(:[^\s:@\/]+)?@)?([A-Za-z0-9\.-]+\.[A-Za-z]{2,})(:[0-9]{2,5})?(\/[^\s]*)?$/i;
23
- // Поддерживает http/https, optional credentials, домен, порт, путь. (Не полное RFC-3986)
24
- const uuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
25
- const semver = /^v?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/;
26
- const domain = /^(?=.{1,253}$)(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[A-Za-z]{2,63}$/i;
27
- const base64 = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;
28
- // Примечание: это стандартный base64 (не url-safe variant)
29
- const regex = /^\/(?:[^\/\\]|\\.)+\/[gimsuy]*$/;
30
- // Соответствует JavaScript-подобным литералам /.../flags (учитывает экранированные слэши)
31
- const hexColor = /^#(?:[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;
32
-
33
-
34
- export const allRegExp = {
35
- ip,
36
- email,
37
- password,
38
- url,
39
- specialChar,
40
- specialCharWidthSpace,
41
- cron,
42
- unixPath,
43
- winPath,
44
- mac,
45
- ip4,
46
- ip6,
47
- uuid,
48
- semver,
49
- domain,
50
- base64,
51
- regex,
52
- hexColor,
53
- }
1
+ const ip =
2
+ /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/
3
+ const email = /^[^\s@]+@[^\s@]+\.[^\s@]+$/
4
+ const password =
5
+ /(?=.*[0-9])(?=.*[!@#$%^&*])(?=.*[a-z])(?=.*[A-Z])[0-9a-zA-Z!@#$%^&*]{8,}/
6
+ // const url = /https?:\/\/([a-zA-Zа-яА-Я0-9.-]+)\.([a-zA-Zа-яА-Я]{2,})(?:$|\/|:)/
7
+ const url = /https?:\/\/([a-zA-Zа-яА-Я0-9.-]+\.[a-zA-Zа-яА-Я]{2,6})\b/
8
+ const specialChar = /[!@#$%^&*(),.?":{}|<>]/
9
+ const specialCharWidthSpace = /[!@#$%^&*(),?":{}|<>]|(\s)|\.$/
10
+ const cron =
11
+ /^(\*|([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])|\*\/([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])) (\*|([0-9]|1[0-9]|2[0-3])|\*\/([0-9]|1[0-9]|2[0-3])) (\*|([1-9]|1[0-9]|2[0-9]|3[0-1])|\*\/([1-9]|1[0-9]|2[0-9]|3[0-1])) (\*|([1-9]|1[0-2])|\*\/([1-9]|1[0-2])) (\*|([0-6])|\*\/([0-6]))$/
12
+
13
+ const unixPath = /^(?:(?:\/|~|\.\/|\.\.\/)?(?:[A-Za-z0-9._-]+(?:\/|$))+|\.)$/;
14
+ // Примеры: /, /foo/bar, ./foo, ../foo, ~/dir
15
+ const winPath = /^(?:[a-zA-Z]:\\|\\\\)(?:[^<>:"/\\|?*\r\n]+\\?)*$/;
16
+ // Примеры: C:\path\to\file, \\server\share\folder\
17
+ const mac = /^([0-9A-Fa-f]{2}[:-]){5}[0-9A-Fa-f]{2}$/;
18
+ // MAC адреса: 01:23:45:67:89:ab или 01-23-45-67-89-ab
19
+ const ip4 = /^(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)){3}$/;
20
+ const ip6 = /^((?:[0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}|(?:[0-9A-Fa-f]{1,4}:){1,7}:|:(?::[0-9A-Fa-f]{1,4}){1,7}|(?:[0-9A-Fa-f]{1,4}:){1,6}:[0-9A-Fa-f]{1,4}|(?:[0-9A-Fa-f]{1,4}:){1,5}(?::[0-9A-Fa-f]{1,4}){1,2}|(?:[0-9A-Fa-f]{1,4}:){1,4}(?::[0-9A-Fa-f]{1,4}){1,3}|(?:[0-9A-Fa-f]{1,4}:){1,3}(?::[0-9A-Fa-f]{1,4}){1,4}|(?:[0-9A-Fa-f]{1,4}:){1,2}(?::[0-9A-Fa-f]{1,4}){1,5})$/i;
21
+ // Покрывает обычные формы IPv6 с сокращениями (::)
22
+ // const url = /^(https?:\/\/)?([^\s:@\/]+(:[^\s:@\/]+)?@)?([A-Za-z0-9\.-]+\.[A-Za-z]{2,})(:[0-9]{2,5})?(\/[^\s]*)?$/i;
23
+ // Поддерживает http/https, optional credentials, домен, порт, путь. (Не полное RFC-3986)
24
+ const uuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
25
+ const semver = /^v?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/;
26
+ const domain = /^(?=.{1,253}$)(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[A-Za-z]{2,63}$/i;
27
+ const base64 = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;
28
+ // Примечание: это стандартный base64 (не url-safe variant)
29
+ const regex = /^\/(?:[^\/\\]|\\.)+\/[gimsuy]*$/;
30
+ // Соответствует JavaScript-подобным литералам /.../flags (учитывает экранированные слэши)
31
+ const hexColor = /^#(?:[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;
32
+
33
+
34
+ export const allRegExp = {
35
+ ip,
36
+ email,
37
+ password,
38
+ url,
39
+ specialChar,
40
+ specialCharWidthSpace,
41
+ cron,
42
+ unixPath,
43
+ winPath,
44
+ mac,
45
+ ip4,
46
+ ip6,
47
+ uuid,
48
+ semver,
49
+ domain,
50
+ base64,
51
+ regex,
52
+ hexColor,
53
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.5.812",
4
+ "version": "1.5.813",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",