bfg-common 1.3.489 → 1.3.490
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.
- package/components/common/layout/theHeader/userMenu/UserMenu.vue +1 -0
- package/components/common/layout/theHeader/userMenu/modals/preferences/Preferences.vue +37 -96
- package/components/common/layout/theHeader/userMenu/modals/preferences/PreferencesNew.vue +91 -0
- package/components/common/layout/theHeader/userMenu/modals/preferences/PreferencesOld.vue +119 -0
- package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/ChangeLanguageNew.vue +155 -0
- package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/{ChangeLanguage.vue → ChangeLanguageOld.vue} +0 -1
- package/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/TimeFormatNew.vue +78 -0
- package/components/common/layout/theHeader/userMenu/modals/preferences/view/ViewNew.vue +124 -0
- package/package.json +2 -2
- /package/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/{TimeFormat.vue → TimeFormatOld.vue} +0 -0
- /package/components/common/layout/theHeader/userMenu/modals/preferences/{View.vue → view/ViewOld.vue} +0 -0
|
@@ -1,92 +1,53 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
v-if="selectedTab === 'inventory-tab' && isSphere"
|
|
35
|
-
:vm-cluster="props.user?.ui_options?.vm_in_hosts_clusters"
|
|
36
|
-
/>
|
|
37
|
-
|
|
38
|
-
<common-layout-the-header-user-menu-modals-preferences-default-console
|
|
39
|
-
v-if="selectedTab === 'console-tab' && isSphere"
|
|
40
|
-
:remote-console="props.user?.ui_options?.remote_console"
|
|
41
|
-
:project="props.project"
|
|
42
|
-
/>
|
|
43
|
-
|
|
44
|
-
<common-layout-the-header-user-menu-modals-preferences-view
|
|
45
|
-
v-if="selectedTab === 'view-tab'"
|
|
46
|
-
:project="props.project"
|
|
47
|
-
:is-new-view="props.newView"
|
|
48
|
-
@update="emits('update-is-new-view', $event)"
|
|
49
|
-
/>
|
|
50
|
-
</template>
|
|
51
|
-
|
|
52
|
-
<template #modalFooter>
|
|
53
|
-
<button
|
|
54
|
-
id="user-preferences-cancel-button"
|
|
55
|
-
data-id="user-preferences-cancel-button"
|
|
56
|
-
class="btn btn-outline"
|
|
57
|
-
@click="onHide"
|
|
58
|
-
>
|
|
59
|
-
{{ localization.cancel }}
|
|
60
|
-
</button>
|
|
61
|
-
<button
|
|
62
|
-
id="user-preferences-apply-button"
|
|
63
|
-
data-id="user-preferences-apply-button"
|
|
64
|
-
class="btn btn-primary"
|
|
65
|
-
@click="emits('submit')"
|
|
66
|
-
>
|
|
67
|
-
{{ localization.save }}
|
|
68
|
-
</button>
|
|
69
|
-
</template>
|
|
70
|
-
</atoms-modal>
|
|
2
|
+
<common-layout-the-header-user-menu-modals-preferences-new
|
|
3
|
+
v-if="props.isNewView"
|
|
4
|
+
:project="props.project"
|
|
5
|
+
:time-format="props.timeFormat"
|
|
6
|
+
:user="props.user"
|
|
7
|
+
:new-view="props.newView"
|
|
8
|
+
:selected-language-type="props.selectedLanguageType"
|
|
9
|
+
:selected-language="props.selectedLanguage"
|
|
10
|
+
@hide="emits('hide')"
|
|
11
|
+
@update-time-format="emits('update-time-format', $event)"
|
|
12
|
+
@update-language="emits('update-language', $event)"
|
|
13
|
+
@update-language-type="emits('update-language-type', $event)"
|
|
14
|
+
@update-is-browser="emits('update-is-browser', $event)"
|
|
15
|
+
@update-is-new-view="emits('update-is-new-view', $event)"
|
|
16
|
+
@submit="emits('submit')"
|
|
17
|
+
/>
|
|
18
|
+
<common-layout-the-header-user-menu-modals-preferences-old
|
|
19
|
+
v-else
|
|
20
|
+
:project="props.project"
|
|
21
|
+
:time-format="props.timeFormat"
|
|
22
|
+
:user="props.user"
|
|
23
|
+
:new-view="props.newView"
|
|
24
|
+
:selected-language-type="props.selectedLanguageType"
|
|
25
|
+
:selected-language="props.selectedLanguage"
|
|
26
|
+
@hide="emits('hide')"
|
|
27
|
+
@update-time-format="emits('update-time-format', $event)"
|
|
28
|
+
@update-language="emits('update-language', $event)"
|
|
29
|
+
@update-language-type="emits('update-language-type', $event)"
|
|
30
|
+
@update-is-browser="emits('update-is-browser', $event)"
|
|
31
|
+
@update-is-new-view="emits('update-is-new-view', $event)"
|
|
32
|
+
@submit="emits('submit')"
|
|
33
|
+
/>
|
|
71
34
|
</template>
|
|
72
35
|
|
|
73
36
|
<script setup lang="ts">
|
|
74
|
-
import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/models/interfaces'
|
|
75
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
76
37
|
import type { UI_T_LangValue, UI_T_Project } from '~/lib/models/types'
|
|
77
|
-
import type { UI_T_UserPreferenceTab } from '~/components/common/layout/theHeader/userMenu/modals/preferences/lib/models/types'
|
|
78
38
|
import type { UI_I_User } from '~/components/common/layout/theHeader/userMenu/lib/models/interfaces'
|
|
79
39
|
import type { UI_T_TimeValue } from '~/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/lib/models/types'
|
|
80
|
-
import { preferencesTabs } from '~/components/common/layout/theHeader/userMenu/modals/preferences/lib/config/preferencesTabs'
|
|
81
40
|
|
|
82
41
|
const props = defineProps<{
|
|
83
42
|
project: UI_T_Project
|
|
84
43
|
timeFormat: UI_T_TimeValue
|
|
85
|
-
selectedLanguage: UI_T_LangValue
|
|
86
|
-
selectedLanguageType: UI_T_LangValue
|
|
87
|
-
newView: boolean
|
|
88
44
|
user?: UI_I_User
|
|
45
|
+
newView: boolean
|
|
46
|
+
selectedLanguageType: UI_T_LangValue
|
|
47
|
+
selectedLanguage: UI_T_LangValue
|
|
48
|
+
isNewView: boolean
|
|
89
49
|
}>()
|
|
50
|
+
|
|
90
51
|
const emits = defineEmits<{
|
|
91
52
|
(event: 'hide'): void
|
|
92
53
|
(event: 'update-time-format', value: UI_T_TimeValue): void
|
|
@@ -96,24 +57,4 @@ const emits = defineEmits<{
|
|
|
96
57
|
(event: 'update-is-new-view', value: boolean): void
|
|
97
58
|
(event: 'submit'): void
|
|
98
59
|
}>()
|
|
99
|
-
|
|
100
|
-
const { $store }: any = useNuxtApp()
|
|
101
|
-
|
|
102
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
103
|
-
|
|
104
|
-
const isSphere = ref<boolean>(props.project === 'sphere')
|
|
105
|
-
const selectedTab = ref<UI_T_UserPreferenceTab>('time-tab')
|
|
106
|
-
|
|
107
|
-
const tabsItems = computed<UI_I_CollapseNavItem[]>(() =>
|
|
108
|
-
preferencesTabs(localization.value, props.project)
|
|
109
|
-
)
|
|
110
|
-
|
|
111
|
-
const onHide = (): void => {
|
|
112
|
-
emits('hide')
|
|
113
|
-
|
|
114
|
-
if (isSphere.value) {
|
|
115
|
-
selectedTab.value = 'time-tab'
|
|
116
|
-
$store.dispatch('profile/A_PREFERENCES_FOR_CHANGING', { clear: true })
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
60
|
</script>
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ui-modal
|
|
3
|
+
test-id="user-preferences-modal"
|
|
4
|
+
width="580px"
|
|
5
|
+
:title="localization.preferences"
|
|
6
|
+
@submit="emits('submit')"
|
|
7
|
+
@hide="onHide"
|
|
8
|
+
>
|
|
9
|
+
<template #content>
|
|
10
|
+
<ui-modal-block-standard>
|
|
11
|
+
<ui-modal-block-form-standard>
|
|
12
|
+
<common-layout-the-header-user-menu-modals-preferences-time-format-new
|
|
13
|
+
:time-format="props.timeFormat"
|
|
14
|
+
@update="emits('update-time-format', $event)"
|
|
15
|
+
/>
|
|
16
|
+
</ui-modal-block-form-standard>
|
|
17
|
+
|
|
18
|
+
<ui-modal-block-form-standard>
|
|
19
|
+
<common-layout-the-header-user-menu-modals-preferences-change-language-new
|
|
20
|
+
:selected-type="props.selectedLanguageType"
|
|
21
|
+
:selected-language="props.selectedLanguage"
|
|
22
|
+
:project="props.project"
|
|
23
|
+
@update-language-type="emits('update-language-type', $event)"
|
|
24
|
+
@update="emits('update-language', $event)"
|
|
25
|
+
@update-is-browser="emits('update-is-browser', $event)"
|
|
26
|
+
/>
|
|
27
|
+
</ui-modal-block-form-standard>
|
|
28
|
+
|
|
29
|
+
<ui-modal-block-form-standard v-if="isSphere">
|
|
30
|
+
<common-layout-the-header-user-menu-modals-preferences-inventory
|
|
31
|
+
:vm-cluster="props.user?.ui_options?.vm_in_hosts_clusters"
|
|
32
|
+
/>
|
|
33
|
+
</ui-modal-block-form-standard>
|
|
34
|
+
|
|
35
|
+
<ui-modal-block-form-standard v-if="isSphere">
|
|
36
|
+
<common-layout-the-header-user-menu-modals-preferences-default-console
|
|
37
|
+
:remote-console="props.user?.ui_options?.remote_console"
|
|
38
|
+
:project="props.project"
|
|
39
|
+
/>
|
|
40
|
+
</ui-modal-block-form-standard>
|
|
41
|
+
|
|
42
|
+
<ui-modal-block-form-standard without-border-bottom>
|
|
43
|
+
<common-layout-the-header-user-menu-modals-preferences-view-new
|
|
44
|
+
:project="props.project"
|
|
45
|
+
:is-new-view="props.newView"
|
|
46
|
+
@update="emits('update-is-new-view', $event)"
|
|
47
|
+
/>
|
|
48
|
+
</ui-modal-block-form-standard>
|
|
49
|
+
</ui-modal-block-standard>
|
|
50
|
+
</template>
|
|
51
|
+
</ui-modal>
|
|
52
|
+
</template>
|
|
53
|
+
|
|
54
|
+
<script setup lang="ts">
|
|
55
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
56
|
+
import type { UI_T_LangValue, UI_T_Project } from '~/lib/models/types'
|
|
57
|
+
import type { UI_I_User } from '~/components/common/layout/theHeader/userMenu/lib/models/interfaces'
|
|
58
|
+
import type { UI_T_TimeValue } from '~/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/lib/models/types'
|
|
59
|
+
|
|
60
|
+
const props = defineProps<{
|
|
61
|
+
project: UI_T_Project
|
|
62
|
+
timeFormat: UI_T_TimeValue
|
|
63
|
+
selectedLanguage: UI_T_LangValue
|
|
64
|
+
selectedLanguageType: UI_T_LangValue
|
|
65
|
+
newView: boolean
|
|
66
|
+
user?: UI_I_User
|
|
67
|
+
}>()
|
|
68
|
+
const emits = defineEmits<{
|
|
69
|
+
(event: 'hide'): void
|
|
70
|
+
(event: 'update-time-format', value: UI_T_TimeValue): void
|
|
71
|
+
(event: 'update-language-type', value: string): void
|
|
72
|
+
(event: 'update-language', value: string): void
|
|
73
|
+
(event: 'update-is-browser', value: string): void
|
|
74
|
+
(event: 'update-is-new-view', value: boolean): void
|
|
75
|
+
(event: 'submit'): void
|
|
76
|
+
}>()
|
|
77
|
+
|
|
78
|
+
const { $store }: any = useNuxtApp()
|
|
79
|
+
|
|
80
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
81
|
+
|
|
82
|
+
const isSphere = ref<boolean>(props.project === 'sphere')
|
|
83
|
+
|
|
84
|
+
const onHide = (): void => {
|
|
85
|
+
emits('hide')
|
|
86
|
+
|
|
87
|
+
if (isSphere.value) {
|
|
88
|
+
$store.dispatch('profile/A_PREFERENCES_FOR_CHANGING', { clear: true })
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
</script>
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<atoms-modal
|
|
3
|
+
show
|
|
4
|
+
test-id="user-preferences-modal"
|
|
5
|
+
width="580px"
|
|
6
|
+
height="345px"
|
|
7
|
+
:title="localization.preferences"
|
|
8
|
+
@hide="onHide"
|
|
9
|
+
>
|
|
10
|
+
<template #modalBody>
|
|
11
|
+
<atoms-nav-bar
|
|
12
|
+
v-model="selectedTab"
|
|
13
|
+
test-id="user-preferences-nav-bar"
|
|
14
|
+
:items="tabsItems"
|
|
15
|
+
/>
|
|
16
|
+
|
|
17
|
+
<common-layout-the-header-user-menu-modals-preferences-time-format-old
|
|
18
|
+
v-if="selectedTab === 'time-tab'"
|
|
19
|
+
:time-format="props.timeFormat"
|
|
20
|
+
@update="emits('update-time-format', $event)"
|
|
21
|
+
/>
|
|
22
|
+
|
|
23
|
+
<common-layout-the-header-user-menu-modals-preferences-change-language-old
|
|
24
|
+
v-if="selectedTab === 'language-tab'"
|
|
25
|
+
:selected-type="props.selectedLanguageType"
|
|
26
|
+
:selected-language="props.selectedLanguage"
|
|
27
|
+
:project="props.project"
|
|
28
|
+
@update-language-type="emits('update-language-type', $event)"
|
|
29
|
+
@update="emits('update-language', $event)"
|
|
30
|
+
@update-is-browser="emits('update-is-browser', $event)"
|
|
31
|
+
/>
|
|
32
|
+
|
|
33
|
+
<common-layout-the-header-user-menu-modals-preferences-inventory
|
|
34
|
+
v-if="selectedTab === 'inventory-tab' && isSphere"
|
|
35
|
+
:vm-cluster="props.user?.ui_options?.vm_in_hosts_clusters"
|
|
36
|
+
/>
|
|
37
|
+
|
|
38
|
+
<common-layout-the-header-user-menu-modals-preferences-default-console
|
|
39
|
+
v-if="selectedTab === 'console-tab' && isSphere"
|
|
40
|
+
:remote-console="props.user?.ui_options?.remote_console"
|
|
41
|
+
:project="props.project"
|
|
42
|
+
/>
|
|
43
|
+
|
|
44
|
+
<common-layout-the-header-user-menu-modals-preferences-view-old
|
|
45
|
+
v-if="selectedTab === 'view-tab'"
|
|
46
|
+
:project="props.project"
|
|
47
|
+
:is-new-view="props.newView"
|
|
48
|
+
@update="emits('update-is-new-view', $event)"
|
|
49
|
+
/>
|
|
50
|
+
</template>
|
|
51
|
+
|
|
52
|
+
<template #modalFooter>
|
|
53
|
+
<button
|
|
54
|
+
id="user-preferences-cancel-button"
|
|
55
|
+
data-id="user-preferences-cancel-button"
|
|
56
|
+
class="btn btn-outline"
|
|
57
|
+
@click="onHide"
|
|
58
|
+
>
|
|
59
|
+
{{ localization.cancel }}
|
|
60
|
+
</button>
|
|
61
|
+
<button
|
|
62
|
+
id="user-preferences-apply-button"
|
|
63
|
+
data-id="user-preferences-apply-button"
|
|
64
|
+
class="btn btn-primary"
|
|
65
|
+
@click="emits('submit')"
|
|
66
|
+
>
|
|
67
|
+
{{ localization.save }}
|
|
68
|
+
</button>
|
|
69
|
+
</template>
|
|
70
|
+
</atoms-modal>
|
|
71
|
+
</template>
|
|
72
|
+
|
|
73
|
+
<script setup lang="ts">
|
|
74
|
+
import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/models/interfaces'
|
|
75
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
76
|
+
import type { UI_T_LangValue, UI_T_Project } from '~/lib/models/types'
|
|
77
|
+
import type { UI_T_UserPreferenceTab } from '~/components/common/layout/theHeader/userMenu/modals/preferences/lib/models/types'
|
|
78
|
+
import type { UI_I_User } from '~/components/common/layout/theHeader/userMenu/lib/models/interfaces'
|
|
79
|
+
import type { UI_T_TimeValue } from '~/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/lib/models/types'
|
|
80
|
+
import { preferencesTabs } from '~/components/common/layout/theHeader/userMenu/modals/preferences/lib/config/preferencesTabs'
|
|
81
|
+
|
|
82
|
+
const props = defineProps<{
|
|
83
|
+
project: UI_T_Project
|
|
84
|
+
timeFormat: UI_T_TimeValue
|
|
85
|
+
selectedLanguage: UI_T_LangValue
|
|
86
|
+
selectedLanguageType: UI_T_LangValue
|
|
87
|
+
newView: boolean
|
|
88
|
+
user?: UI_I_User
|
|
89
|
+
}>()
|
|
90
|
+
const emits = defineEmits<{
|
|
91
|
+
(event: 'hide'): void
|
|
92
|
+
(event: 'update-time-format', value: UI_T_TimeValue): void
|
|
93
|
+
(event: 'update-language-type', value: string): void
|
|
94
|
+
(event: 'update-language', value: string): void
|
|
95
|
+
(event: 'update-is-browser', value: string): void
|
|
96
|
+
(event: 'update-is-new-view', value: boolean): void
|
|
97
|
+
(event: 'submit'): void
|
|
98
|
+
}>()
|
|
99
|
+
|
|
100
|
+
const { $store }: any = useNuxtApp()
|
|
101
|
+
|
|
102
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
103
|
+
|
|
104
|
+
const isSphere = ref<boolean>(props.project === 'sphere')
|
|
105
|
+
const selectedTab = ref<UI_T_UserPreferenceTab>('time-tab')
|
|
106
|
+
|
|
107
|
+
const tabsItems = computed<UI_I_CollapseNavItem[]>(() =>
|
|
108
|
+
preferencesTabs(localization.value, props.project)
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
const onHide = (): void => {
|
|
112
|
+
emits('hide')
|
|
113
|
+
|
|
114
|
+
if (isSphere.value) {
|
|
115
|
+
selectedTab.value = 'time-tab'
|
|
116
|
+
$store.dispatch('profile/A_PREFERENCES_FOR_CHANGING', { clear: true })
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
</script>
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<form id="change-language-form">
|
|
3
|
+
<div class="flex">
|
|
4
|
+
<ui-modal-icon>
|
|
5
|
+
<ui-icon-icon3 name="language-new" width="20" height="20" />
|
|
6
|
+
</ui-modal-icon>
|
|
7
|
+
|
|
8
|
+
<div>
|
|
9
|
+
<div class="form-first-title">
|
|
10
|
+
{{ localization.language }}
|
|
11
|
+
</div>
|
|
12
|
+
<div class="form-second-title">
|
|
13
|
+
{{ description }}
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<div v-for="(item, key) in radioOptions" :key="key" class="radio flex">
|
|
17
|
+
<input
|
|
18
|
+
:id="item.label"
|
|
19
|
+
v-model="languageMode"
|
|
20
|
+
:data-id="item.testId"
|
|
21
|
+
type="radio"
|
|
22
|
+
:value="item.value"
|
|
23
|
+
@change="onChange"
|
|
24
|
+
/>
|
|
25
|
+
<label :for="item.label"> {{ item.label }} </label>
|
|
26
|
+
|
|
27
|
+
<span v-if="item.selectLang" class="select select-lang">
|
|
28
|
+
<select
|
|
29
|
+
id="language-select"
|
|
30
|
+
v-model="selectedLanguageLocal"
|
|
31
|
+
:disabled="languageMode !== item.value"
|
|
32
|
+
data-id="language-select"
|
|
33
|
+
@change="onSelectLang"
|
|
34
|
+
>
|
|
35
|
+
<option
|
|
36
|
+
v-for="(item2, key2) in langOptions"
|
|
37
|
+
:key="key2"
|
|
38
|
+
:value="item2.value"
|
|
39
|
+
>
|
|
40
|
+
{{ item2.text }}
|
|
41
|
+
</option>
|
|
42
|
+
</select>
|
|
43
|
+
</span>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</form>
|
|
48
|
+
</template>
|
|
49
|
+
|
|
50
|
+
<script setup lang="ts">
|
|
51
|
+
import type { UI_T_LangValue, UI_T_Project } from '~/lib/models/types'
|
|
52
|
+
import type { UI_T_SelectedRadio } from '~/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/lib/models/types'
|
|
53
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
54
|
+
import type {
|
|
55
|
+
UI_I_LanguageItem,
|
|
56
|
+
UI_I_RadioItemLang,
|
|
57
|
+
} from '~/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/lib/models/interfaces'
|
|
58
|
+
import { UI_E_DetectSelectedRadio } from '~/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/lib/models/enums'
|
|
59
|
+
import { langConfig } from '~/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/lib/config/lang'
|
|
60
|
+
import { radioOptionsFunc } from '~/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/lib/config/radioOptions'
|
|
61
|
+
import { defineBrowserLangFunc } from '~/components/common/layout/theHeader/lib/utils/localization'
|
|
62
|
+
|
|
63
|
+
const props = defineProps<{
|
|
64
|
+
selectedType: UI_T_LangValue
|
|
65
|
+
selectedLanguage: UI_T_LangValue
|
|
66
|
+
project: UI_T_Project
|
|
67
|
+
}>()
|
|
68
|
+
|
|
69
|
+
const emits = defineEmits<{
|
|
70
|
+
(event: 'update', value: string): void
|
|
71
|
+
(event: 'update-language-type', value: UI_T_SelectedRadio): void
|
|
72
|
+
(event: 'update-is-browser', value: string): void
|
|
73
|
+
}>()
|
|
74
|
+
|
|
75
|
+
const config = useRuntimeConfig()
|
|
76
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
77
|
+
|
|
78
|
+
const description = computed<string>(() => {
|
|
79
|
+
return localization.value.languageDesc.replaceAll(
|
|
80
|
+
'{trademark}',
|
|
81
|
+
String(config.public[`TRADEMARK_${useEnvLanguage()}`])
|
|
82
|
+
)
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
const languageMode = ref<UI_T_SelectedRadio>(
|
|
86
|
+
UI_E_DetectSelectedRadio[props.selectedType]
|
|
87
|
+
)
|
|
88
|
+
const radioOptions = readonly<UI_I_RadioItemLang[]>(
|
|
89
|
+
radioOptionsFunc(localization.value)
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
const langOptions = ref<UI_I_LanguageItem[]>(langConfig)
|
|
93
|
+
|
|
94
|
+
const selectedLanguageLocal = ref<string>(props.selectedLanguage)
|
|
95
|
+
|
|
96
|
+
const setPreferenceLang = (language: string): void => {
|
|
97
|
+
let browserLang = language
|
|
98
|
+
|
|
99
|
+
language === 'BROWSER' && (browserLang = defineBrowserLangFunc())
|
|
100
|
+
|
|
101
|
+
if (props.project === 'sphere') {
|
|
102
|
+
const { $store }: any = useNuxtApp()
|
|
103
|
+
|
|
104
|
+
$store.dispatch('profile/A_PREFERENCES_FOR_CHANGING', {
|
|
105
|
+
language: browserLang,
|
|
106
|
+
})
|
|
107
|
+
} else if (props.project === 'procurator') {
|
|
108
|
+
emits('update', browserLang)
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const onSelectLang = (): void => {
|
|
113
|
+
selectedLanguageLocal.value && setPreferenceLang(selectedLanguageLocal.value)
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const onChange = (): void => {
|
|
117
|
+
const lang =
|
|
118
|
+
languageMode.value === 'LANG'
|
|
119
|
+
? selectedLanguageLocal.value
|
|
120
|
+
: languageMode.value
|
|
121
|
+
|
|
122
|
+
lang && setPreferenceLang(lang)
|
|
123
|
+
|
|
124
|
+
props.project === 'sphere' &&
|
|
125
|
+
emits('update-language-type', languageMode.value)
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const updateIsBrowser = (value: string): void => {
|
|
129
|
+
emits('update-is-browser', value)
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
watch(
|
|
133
|
+
languageMode,
|
|
134
|
+
(newValue) => {
|
|
135
|
+
newValue && updateIsBrowser(newValue)
|
|
136
|
+
},
|
|
137
|
+
{ immediate: true }
|
|
138
|
+
)
|
|
139
|
+
</script>
|
|
140
|
+
|
|
141
|
+
<style lang="scss" scoped>
|
|
142
|
+
.radio {
|
|
143
|
+
margin-bottom: 5px;
|
|
144
|
+
&:nth-child(2) {
|
|
145
|
+
margin-top: 10px;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
.select-lang {
|
|
149
|
+
margin-left: 3px;
|
|
150
|
+
height: 24px;
|
|
151
|
+
& > select {
|
|
152
|
+
height: 100%;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
</style>
|
package/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/TimeFormatNew.vue
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<form id="time-format-form">
|
|
3
|
+
<div class="flex">
|
|
4
|
+
<ui-modal-icon>
|
|
5
|
+
<ui-icon-icon3 name="clock" width="20" height="20" />
|
|
6
|
+
</ui-modal-icon>
|
|
7
|
+
|
|
8
|
+
<div>
|
|
9
|
+
<div class="form-first-title">
|
|
10
|
+
{{ localization.timeFormat }}
|
|
11
|
+
</div>
|
|
12
|
+
<div class="form-second-title">
|
|
13
|
+
{{ description }}
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<div v-for="(item, key) in formatOptions" :key="key" class="radio">
|
|
17
|
+
<input
|
|
18
|
+
:id="item.value"
|
|
19
|
+
v-model="timeItem"
|
|
20
|
+
:data-id="item.testId"
|
|
21
|
+
type="radio"
|
|
22
|
+
:value="item.value"
|
|
23
|
+
@change="onChange"
|
|
24
|
+
/>
|
|
25
|
+
<label :for="item.value">
|
|
26
|
+
{{ item.label }}
|
|
27
|
+
</label>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
</form>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<script setup lang="ts">
|
|
35
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
36
|
+
import type { UI_I_RadioItem } from '~/components/common/layout/theHeader/userMenu/lib/models/interfaces'
|
|
37
|
+
import type { UI_T_TimeValue } from '~/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/lib/models/types'
|
|
38
|
+
import { formatOptionsFunc } from '~/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/lib/config/formatOptions'
|
|
39
|
+
|
|
40
|
+
const props = defineProps<{
|
|
41
|
+
timeFormat: UI_T_TimeValue
|
|
42
|
+
}>()
|
|
43
|
+
const emits = defineEmits<{
|
|
44
|
+
(event: 'update', value: UI_T_TimeValue): void
|
|
45
|
+
}>()
|
|
46
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
47
|
+
|
|
48
|
+
const config = useRuntimeConfig()
|
|
49
|
+
const description = computed<string>(() =>
|
|
50
|
+
localization.value.timeFormatDesc.replaceAll(
|
|
51
|
+
'{trademark}',
|
|
52
|
+
String(config.public[`TRADEMARK_${useEnvLanguage()}`])
|
|
53
|
+
)
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
const formatOptions = readonly<UI_I_RadioItem[]>(
|
|
57
|
+
formatOptionsFunc(localization.value)
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
const timeItem = ref<UI_T_TimeValue>(props.timeFormat)
|
|
61
|
+
|
|
62
|
+
const onChange = (): void => {
|
|
63
|
+
emits('update', timeItem.value)
|
|
64
|
+
}
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<style lang="scss" scoped>
|
|
68
|
+
.radio {
|
|
69
|
+
margin-bottom: 5px;
|
|
70
|
+
&:nth-child(2) {
|
|
71
|
+
margin-top: 10px;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
input[type='radio']:focus:checked + label::before,
|
|
75
|
+
input[type='radio']:focus + label::before {
|
|
76
|
+
box-shadow: inset 0 0 0 0.25rem #0094d2;
|
|
77
|
+
}
|
|
78
|
+
</style>
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<form id="view-form">
|
|
3
|
+
<!-- TODO Shorten code by the new component for the form -->
|
|
4
|
+
<div class="flex">
|
|
5
|
+
<ui-modal-icon>
|
|
6
|
+
<ui-icon-icon3 name="eye-open" width="20" height="20" />
|
|
7
|
+
</ui-modal-icon>
|
|
8
|
+
<div>
|
|
9
|
+
<div class="form-first-title">
|
|
10
|
+
{{ localization.view }}
|
|
11
|
+
</div>
|
|
12
|
+
<div class="form-second-title">
|
|
13
|
+
{{ description }}
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<div class="flex-align-center">
|
|
17
|
+
<label for="view">{{ localization.newView }}</label>
|
|
18
|
+
<input
|
|
19
|
+
id="view"
|
|
20
|
+
v-model="isNewViewLocal"
|
|
21
|
+
type="checkbox"
|
|
22
|
+
class="switch"
|
|
23
|
+
@change="onChange"
|
|
24
|
+
/>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</form>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<script setup lang="ts">
|
|
32
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
33
|
+
|
|
34
|
+
const props = defineProps<{
|
|
35
|
+
isNewView: boolean
|
|
36
|
+
}>()
|
|
37
|
+
|
|
38
|
+
const isNewViewLocal = ref<boolean>(props.isNewView)
|
|
39
|
+
|
|
40
|
+
const emits = defineEmits<{
|
|
41
|
+
(event: 'update', value: boolean): void
|
|
42
|
+
}>()
|
|
43
|
+
|
|
44
|
+
const config = useRuntimeConfig()
|
|
45
|
+
|
|
46
|
+
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
|
+
const onChange = (): void => {
|
|
56
|
+
emits('update', isNewViewLocal.value)
|
|
57
|
+
}
|
|
58
|
+
</script>
|
|
59
|
+
|
|
60
|
+
<style lang="scss" scoped>
|
|
61
|
+
.description {
|
|
62
|
+
margin-bottom: 10px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
label {
|
|
66
|
+
margin-right: 6px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
input[type='checkbox'] {
|
|
70
|
+
--active: var(--checkbox-value-active-color);
|
|
71
|
+
--active-inner: var(--checkbox-mark-color);
|
|
72
|
+
--border: var(--checkbox-mark-color);
|
|
73
|
+
--background: var(--checkbox-mark-background-color);
|
|
74
|
+
-webkit-appearance: none;
|
|
75
|
+
-moz-appearance: none;
|
|
76
|
+
height: 20px;
|
|
77
|
+
outline: none;
|
|
78
|
+
display: inline-block;
|
|
79
|
+
vertical-align: top;
|
|
80
|
+
position: relative;
|
|
81
|
+
margin: 0;
|
|
82
|
+
cursor: pointer;
|
|
83
|
+
border: 1px solid var(--bc, var(--border));
|
|
84
|
+
background: var(--b, var(--background));
|
|
85
|
+
transition: background 0.3s, border-color 0.3s, box-shadow 0.2s;
|
|
86
|
+
&:after {
|
|
87
|
+
content: '';
|
|
88
|
+
display: block;
|
|
89
|
+
left: 0;
|
|
90
|
+
top: 0;
|
|
91
|
+
position: absolute;
|
|
92
|
+
transition: transform var(--d-t, 0.3s) var(--d-t-e, ease),
|
|
93
|
+
opacity var(--d-o, 0.2s);
|
|
94
|
+
}
|
|
95
|
+
&:checked {
|
|
96
|
+
--b: var(--active);
|
|
97
|
+
--bc: var(--active);
|
|
98
|
+
--d-o: 0.3s;
|
|
99
|
+
--d-t: 0.6s;
|
|
100
|
+
--d-t-e: cubic-bezier(0.2, 0.85, 0.32, 1.2);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
input[type='checkbox'] {
|
|
104
|
+
&.switch {
|
|
105
|
+
width: 35px;
|
|
106
|
+
border-radius: 11px;
|
|
107
|
+
&:after {
|
|
108
|
+
left: 2px;
|
|
109
|
+
top: 2px;
|
|
110
|
+
bottom: 2px;
|
|
111
|
+
border-radius: 50%;
|
|
112
|
+
width: 14px;
|
|
113
|
+
height: 14px;
|
|
114
|
+
border: 1px solid var(--bc, var(--border));
|
|
115
|
+
background: var(--ab, var(--border));
|
|
116
|
+
transform: translateX(var(--x, 0));
|
|
117
|
+
}
|
|
118
|
+
&:checked {
|
|
119
|
+
--ab: var(--active-inner);
|
|
120
|
+
--x: 14px;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
</style>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bfg-common",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.490",
|
|
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.
|
|
38
|
+
"bfg-uikit": "1.0.66",
|
|
39
39
|
"html2canvas": "^1.4.1",
|
|
40
40
|
"prettier-eslint": "^15.0.1"
|
|
41
41
|
}
|
|
File without changes
|
|
File without changes
|