bfg-common 1.3.508 → 1.3.510

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.
@@ -14,6 +14,7 @@
14
14
  :new-view="props.newViewLocal"
15
15
  :time-format="props.timeFormat"
16
16
  :project="props.project"
17
+ :is-dark-theme="props.isDarkTheme"
17
18
  @toggle-main-menu="emits('toggle-main-menu')"
18
19
  @show-preference="emits('show-preference')"
19
20
  @hide-preference="emits('hide-preference')"
@@ -72,6 +73,7 @@ const props = defineProps<{
72
73
  newView: boolean
73
74
  newViewLocal: boolean
74
75
  timeFormat: string
76
+ isDarkTheme: boolean
75
77
  }>()
76
78
 
77
79
  const emits = defineEmits<{
@@ -43,7 +43,8 @@
43
43
  </button>
44
44
  <div class="divider" />
45
45
  <div class="container-content">
46
- <common-layout-the-header-language-switch
46
+ <common-layout-the-header-theme-switch
47
+ :is-dark-theme="props.isDarkTheme"
47
48
  @change-theme-mode="emits('change-theme-mode')"
48
49
  />
49
50
  </div>
@@ -96,6 +97,7 @@ const props = defineProps<{
96
97
  selectedLang: string
97
98
  newView: boolean
98
99
  timeFormat: string
100
+ isDarkTheme: boolean
99
101
  }>()
100
102
 
101
103
  const emits = defineEmits<{
@@ -0,0 +1,29 @@
1
+ <template>
2
+ <ui-switch v-model="model" size="lg" dark>
3
+ <template #rightIcon>
4
+ <ui-icon name="light-theme" width="14" height="14" />
5
+ </template>
6
+ <template #leftIcon>
7
+ <ui-icon name="dark-theme" width="14" height="14" />
8
+ </template>
9
+ </ui-switch>
10
+ </template>
11
+
12
+ <script setup lang="ts">
13
+ const props = defineProps<{
14
+ isDarkTheme: boolean
15
+ }>()
16
+
17
+ const emits = defineEmits<{
18
+ (event: 'change-theme-mode'): void
19
+ }>()
20
+
21
+ const model = computed({
22
+ get() {
23
+ return props.isDarkTheme
24
+ },
25
+ set() {
26
+ emits('change-theme-mode')
27
+ },
28
+ })
29
+ </script>
@@ -39,13 +39,13 @@
39
39
  </template>
40
40
 
41
41
  <script setup lang="ts">
42
- import type { UI_T_LangValue } from '~/lib/models/types'
42
+ import type { UI_T_LangValue, UI_T_Project } from '~/lib/models/types'
43
43
  import type { UI_I_User } from '~/components/common/layout/theHeader/userMenu/lib/models/interfaces'
44
44
  import type { UI_T_TimeValue } from '~/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/lib/models/types'
45
45
 
46
46
  const props = defineProps<{
47
47
  hostname: string
48
- project: string
48
+ project: UI_T_Project
49
49
  isPreference: boolean
50
50
  newView: boolean
51
51
  timeFormat: UI_T_TimeValue
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.3.508",
4
+ "version": "1.3.510",
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.66",
38
+ "bfg-uikit": "1.0.71",
39
39
  "html2canvas": "^1.4.1",
40
40
  "prettier-eslint": "^15.0.1"
41
41
  }
@@ -1,102 +0,0 @@
1
- <template>
2
- <div class="language-switch-content">
3
- <label class="switch">
4
- <input type="checkbox" @change="emits('change-theme-mode')" />
5
- <span class="slider"></span>
6
- <span class="theme-icon light">
7
- <ui-icon name="light-theme" width="14" height="14" />
8
- </span>
9
- <span class="theme-icon dark">
10
- <ui-icon name="dark-theme" width="14" height="14" />
11
- </span>
12
- </label>
13
- </div>
14
- </template>
15
-
16
- <script setup lang="ts">
17
- const emits = defineEmits<{
18
- (event: 'change-theme-mode'): void
19
- }>()
20
- </script>
21
-
22
- <style>
23
- :root {
24
- --switch-bg-color: #e9ebed;
25
- --switch-item-color: #213444;
26
- }
27
- :root.dark-theme {
28
- --switch-bg-color: #4d5d69;
29
- --switch-item-color: #ffffff;
30
- }
31
- </style>
32
-
33
- <style scoped lang="scss">
34
- .language-switch-content {
35
- .switch {
36
- position: relative;
37
- display: inline-block;
38
- width: 48px;
39
- height: 24px;
40
- color: var(--switch-item-color);
41
-
42
- input {
43
- opacity: 0;
44
- width: 0;
45
- height: 0;
46
-
47
- &:checked + .slider {
48
- background-color: var(--switch-bg-color);
49
- }
50
- &:focus + .slider {
51
- box-shadow: 0 0 1px var(--switch-bg-color);
52
- }
53
- &:checked + .slider:before {
54
- -webkit-transform: translateX(26px);
55
- -ms-transform: translateX(26px);
56
- transform: translateX(26px);
57
- }
58
- }
59
-
60
- .slider {
61
- position: absolute;
62
- cursor: pointer;
63
- top: 0;
64
- left: 0;
65
- right: 0;
66
- bottom: 0;
67
- background-color: var(--switch-bg-color);
68
- -webkit-transition: 0.4s;
69
- transition: 0.4s;
70
- border-radius: 34px;
71
-
72
- &:before {
73
- position: absolute;
74
- content: '';
75
- height: 18px;
76
- width: 18px;
77
- left: 2px;
78
- bottom: 3px;
79
- background-color: var(--switch-item-color);
80
- -webkit-transition: 0.4s;
81
- transition: 0.4s;
82
- border-radius: 50%;
83
- }
84
- }
85
-
86
- .theme-icon {
87
- position: absolute;
88
- display: flex;
89
- top: 5px;
90
- color: var(--switch-item-color);
91
- pointer-events: none;
92
-
93
- &.light {
94
- right: 5px;
95
- }
96
- &.dark {
97
- left: 5px;
98
- }
99
- }
100
- }
101
- }
102
- </style>