bfg-common 1.5.697 → 1.5.698
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/CODE_STYLE.md +109 -109
- package/assets/img/icons/icons-sprite-dark-3.svg +227 -227
- package/assets/img/icons/icons-sprite-dark-5.svg +488 -488
- package/assets/img/icons/icons-sprite-light-3.svg +227 -227
- package/assets/img/icons/icons-sprite-light-5.svg +488 -488
- package/assets/scss/common/icons/icons-2.scss +282 -282
- package/components/atoms/TheIcon3.vue +50 -50
- package/components/atoms/collapse/CollapseNav.vue +170 -170
- package/components/atoms/perPage/PerPage.vue +58 -58
- package/components/atoms/switch/Switch.vue +103 -103
- package/components/atoms/table/dataGrid/DataGrid.vue +1718 -1718
- package/components/atoms/table/dataGrid/DataGridPagination.vue +97 -97
- package/components/atoms/table/dataGrid/lib/config/settingsTable.ts +94 -94
- package/components/atoms/table/dataGrid/lib/utils/export.ts +16 -16
- package/components/common/backup/storage/actions/add/lib/utils.ts +51 -51
- package/components/common/browse/blocks/contents/filesNew/Skeleton.vue +18 -18
- package/components/common/diagramMain/modals/lib/config/vCenterModal.ts +48 -48
- package/components/common/diagramMain/port/Port.vue +580 -580
- package/components/common/layout/theHeader/TheHeaderNew.vue +315 -315
- package/components/common/layout/theHeader/TheHeaderOld.vue +262 -262
- package/components/common/layout/theHeader/helpMenu/About.vue +79 -79
- package/components/common/layout/theHeader/helpMenu/aboutOld/AboutOld.vue +79 -79
- package/components/common/layout/theHeader/userMenu/modals/preferences/PreferencesOld.vue +144 -144
- package/components/common/layout/theHeader/userMenu/modals/preferences/lib/models/types.ts +7 -7
- package/components/common/pages/backups/DetailView.vue +52 -52
- package/components/common/pages/backups/lib/models/interfaces.ts +36 -36
- package/components/common/pages/backups/modals/Modals.vue +243 -243
- package/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/lib/config/options.ts +6 -6
- package/components/common/pages/backups/modals/createBackup/lib/config/readyToCompleteOptions.ts +69 -69
- package/components/common/pages/backups/modals/lib/config/restore.ts +115 -115
- package/components/common/pages/backups/modals/lib/models/interfaces.ts +186 -186
- package/components/common/pages/backups/modals/restore/name/lib/models/interfaces.ts +6 -6
- package/components/common/pages/home/lib/models/interfaces.ts +48 -48
- package/components/common/pages/home/widgets/hosts/Hosts.vue +27 -27
- package/components/common/pages/home/widgets/hosts/lib/config/items.ts +23 -23
- package/components/common/pages/home/widgets/vms/VmsOld.vue +35 -35
- package/components/common/pages/home/widgets/vms/lib/config/items.ts +19 -19
- package/components/common/pages/scheduledTasks/lib/utils/utils.ts +84 -84
- package/components/common/readyToComplete/ReadyToComplete.vue +17 -17
- package/components/common/select/radio/RadioGroup.vue +137 -137
- package/components/common/spiceConsole/Drawer.vue +420 -420
- package/components/common/spiceConsole/SpiceConsole.vue +184 -184
- package/components/common/spiceConsole/lib/models/interfaces.ts +5 -5
- package/components/common/tools/Actions.vue +207 -207
- package/components/common/treeView/TreeView.vue +52 -52
- package/components/common/vm/actions/clone/lib/config/steps.ts +295 -295
- package/components/common/vm/actions/clone/new/New.vue +438 -438
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +706 -706
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/lib/config/options.ts +28 -28
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Memory.vue +283 -283
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +489 -489
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +253 -253
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +156 -156
- package/components/common/vm/actions/common/select/compatibility/Old.vue +107 -107
- package/components/common/vm/actions/common/select/createType/lib/models/interfaces.ts +5 -5
- package/components/common/vm/actions/common/select/options/New.vue +264 -264
- package/components/common/vm/actions/common/select/options/Old.vue +109 -109
- package/components/common/vm/actions/common/select/options/Options.vue +58 -58
- package/components/common/vm/actions/common/select/storage/Old.vue +125 -125
- package/components/common/vm/actions/common/select/storage/new/New.vue +311 -311
- package/components/common/vm/actions/common/select/storage/new/lib/models/interfaces.ts +5 -5
- package/components/common/vm/actions/common/select/storage/new/lib/utils/utils.ts +21 -21
- package/components/common/vm/actions/common/select/template/old/Old.vue +50 -50
- package/components/common/vm/actions/editSettings/new/Skeleton.vue +88 -88
- package/components/common/wizards/common/compatibility/Compatibility.vue +35 -35
- package/components/common/wizards/common/steps/computeResource/New.vue +93 -93
- package/components/common/wizards/common/steps/name/Name.vue +178 -178
- package/components/common/wizards/common/steps/name/New.vue +221 -221
- package/components/common/wizards/common/steps/name/Old.vue +121 -121
- package/components/common/wizards/common/steps/name/lib/models/interfaces.ts +4 -4
- package/components/common/wizards/common/steps/name/location/New.vue +40 -40
- package/components/common/wizards/datastore/add/Add.vue +228 -228
- package/components/common/wizards/datastore/add/lib/utils.ts +85 -85
- package/components/common/wizards/datastore/add/steps/nameAndDevice/NameAndDeviceNew.vue +232 -232
- package/components/common/wizards/datastore/add/steps/nameAndDevice/NameAndDeviceOld.vue +231 -231
- package/components/common/wizards/datastore/add/steps/nameAndDevice/advancedOptions/AdvancedOptions.vue +43 -43
- package/components/common/wizards/datastore/add/steps/nameAndDevice/advancedOptions/New.vue +114 -101
- package/components/common/wizards/datastore/add/steps/nameAndDevice/advancedOptions/Old.vue +114 -101
- package/components/common/wizards/datastore/add/steps/typeMode/lib/config/typeOptions.ts +43 -43
- package/composables/useAppVersion.ts +21 -21
- package/composables/useEnvLanguage.ts +22 -22
- package/composables/useLocal.ts +6 -6
- package/composables/useLocalCommon.ts +39 -39
- package/package.json +1 -1
- package/plugins/console.ts +21 -21
- package/plugins/date.ts +375 -375
- package/plugins/mouse.ts +21 -21
- package/plugins/panelStates.ts +70 -70
- package/plugins/text.ts +59 -59
- package/public/spice-console/application/clientgui.js +854 -854
- package/public/spice-console/application/packetfactory.js +211 -211
- package/public/spice-console/application/virtualmouse.js +147 -147
- package/public/spice-console/lib/images/bitmap.js +203 -203
- package/public/spice-console/network/spicechannel.js +440 -440
- package/public/spice-console/process/cursorprocess.js +128 -128
- package/public/spice-console/process/inputprocess.js +227 -227
- package/public/spice-console/process/mainprocess.js +212 -212
- package/public/spice-console/run.js +210 -210
- package/store/main/mutations.ts +7 -7
- package/store/main/state.ts +7 -7
- package/store/tasks/mappers/recentTasks.ts +123 -123
- package/store/tasks/mutations.ts +82 -82
|
@@ -1,170 +1,170 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="tabs-overflow bottom-right">
|
|
3
|
-
<button
|
|
4
|
-
:id="collapsedBtnId"
|
|
5
|
-
:class="[
|
|
6
|
-
'btn btn-link nav-link dropdown-toggle',
|
|
7
|
-
{ active: collapsedBtnActive },
|
|
8
|
-
]"
|
|
9
|
-
:data-id="`${props.testId}-toggle-button`"
|
|
10
|
-
@mouseenter="hover = true"
|
|
11
|
-
@mouseleave="hover = false"
|
|
12
|
-
@mousedown="showMenu"
|
|
13
|
-
>
|
|
14
|
-
<atoms-the-icon
|
|
15
|
-
:class="['collapse-icon', { active: open }]"
|
|
16
|
-
name="ellipsis-horizontal"
|
|
17
|
-
width="16px"
|
|
18
|
-
height="16px"
|
|
19
|
-
/>
|
|
20
|
-
</button>
|
|
21
|
-
|
|
22
|
-
<Teleport to="body">
|
|
23
|
-
<ul
|
|
24
|
-
v-show="open"
|
|
25
|
-
:class="['navbar-dropdown-menu', props.popupClass]"
|
|
26
|
-
:style="dropdownMenuStyles"
|
|
27
|
-
>
|
|
28
|
-
<li
|
|
29
|
-
v-for="(item, key) in props.items"
|
|
30
|
-
:key="key"
|
|
31
|
-
v-permission="item.permission"
|
|
32
|
-
:title="item.title"
|
|
33
|
-
class="navbar-dropdown-menu-item"
|
|
34
|
-
@mousedown.stop
|
|
35
|
-
>
|
|
36
|
-
<div
|
|
37
|
-
v-if="item.separate"
|
|
38
|
-
class="navbar-dropdown-menu-separator"
|
|
39
|
-
></div>
|
|
40
|
-
<atoms-collapse-nav-item
|
|
41
|
-
v-else
|
|
42
|
-
:is-link="props.isLink"
|
|
43
|
-
:item="item"
|
|
44
|
-
:value="value"
|
|
45
|
-
btn-class="btn"
|
|
46
|
-
@change="change"
|
|
47
|
-
@select-file="onSelectFile($event, key)"
|
|
48
|
-
/>
|
|
49
|
-
</li>
|
|
50
|
-
</ul>
|
|
51
|
-
</Teleport>
|
|
52
|
-
</div>
|
|
53
|
-
</template>
|
|
54
|
-
|
|
55
|
-
<script setup lang="ts">
|
|
56
|
-
import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/models/interfaces'
|
|
57
|
-
|
|
58
|
-
const props = withDefaults(
|
|
59
|
-
defineProps<{
|
|
60
|
-
items: UI_I_CollapseNavItem[]
|
|
61
|
-
isLink?: boolean
|
|
62
|
-
value?: number | string
|
|
63
|
-
popupClass?: string
|
|
64
|
-
closeAfterClick?: boolean
|
|
65
|
-
testId?: string
|
|
66
|
-
}>(),
|
|
67
|
-
{
|
|
68
|
-
isLink: undefined,
|
|
69
|
-
value: undefined,
|
|
70
|
-
popupClass: undefined,
|
|
71
|
-
closeAfterClick: undefined,
|
|
72
|
-
testId: '',
|
|
73
|
-
}
|
|
74
|
-
)
|
|
75
|
-
const emits = defineEmits<{
|
|
76
|
-
(event: 'change', value: number): void
|
|
77
|
-
(event: 'select-file', value1: Event, value2: string, value3: number): void
|
|
78
|
-
}>()
|
|
79
|
-
|
|
80
|
-
const change = (value: number): void => {
|
|
81
|
-
emits('change', value)
|
|
82
|
-
props.closeAfterClick && (open.value = false)
|
|
83
|
-
}
|
|
84
|
-
const onSelectFile = (event: Event, type: string, key: number): void => {
|
|
85
|
-
emits('select-file', event, type, key)
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const collapsedBtnId = ref<string>('')
|
|
89
|
-
|
|
90
|
-
const route = useRoute()
|
|
91
|
-
const collapsedBtnActive = computed<boolean>(() => {
|
|
92
|
-
if (props.isLink)
|
|
93
|
-
return props.items.some((item) => route.path.includes(item.path || ''))
|
|
94
|
-
|
|
95
|
-
return props.items.some((item) => item.value === props.value)
|
|
96
|
-
})
|
|
97
|
-
|
|
98
|
-
const open = ref<boolean>(false)
|
|
99
|
-
const hover = ref<boolean>(false)
|
|
100
|
-
const dropdownMenuStyles = ref<any>({})
|
|
101
|
-
const showMenu = (): void => {
|
|
102
|
-
if (open.value) {
|
|
103
|
-
hideMenu(true)
|
|
104
|
-
return
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
open.value = true
|
|
108
|
-
|
|
109
|
-
const btn = document.querySelector(`#${collapsedBtnId.value}`)
|
|
110
|
-
const { top, height, right } = btn!.getBoundingClientRect()
|
|
111
|
-
dropdownMenuStyles.value = {
|
|
112
|
-
top: `${top + height}px`,
|
|
113
|
-
left: `${right}px`,
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
const hideMenu = (force?: boolean): void => {
|
|
117
|
-
if (hover.value && !force) return
|
|
118
|
-
|
|
119
|
-
open.value = false
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
const windowClick = (): void => {
|
|
123
|
-
hideMenu()
|
|
124
|
-
}
|
|
125
|
-
const windowResize = (): void => {
|
|
126
|
-
hideMenu(true)
|
|
127
|
-
}
|
|
128
|
-
onMounted(() => {
|
|
129
|
-
collapsedBtnId.value = `collapsed-btn${useUniqueId()}`
|
|
130
|
-
window.addEventListener('mousedown', windowClick)
|
|
131
|
-
window.addEventListener('resize', windowResize)
|
|
132
|
-
})
|
|
133
|
-
onUnmounted(() => {
|
|
134
|
-
window.removeEventListener('mousedown', windowClick)
|
|
135
|
-
window.removeEventListener('resize', windowResize)
|
|
136
|
-
})
|
|
137
|
-
</script>
|
|
138
|
-
|
|
139
|
-
<style scoped lang="scss">
|
|
140
|
-
.tabs-overflow {
|
|
141
|
-
position: absolute;
|
|
142
|
-
top: 0;
|
|
143
|
-
right: 24px;
|
|
144
|
-
|
|
145
|
-
.dropdown-toggle {
|
|
146
|
-
.collapse-icon {
|
|
147
|
-
fill: var(--main-color-mode);
|
|
148
|
-
|
|
149
|
-
&.active {
|
|
150
|
-
fill: #0077b8;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.navbar-dropdown-menu {
|
|
157
|
-
position: fixed;
|
|
158
|
-
z-index: var(--z-dropdown);
|
|
159
|
-
transform: translateX(-100%);
|
|
160
|
-
border: 1px solid var(--global-border-color);
|
|
161
|
-
border-radius: 3px;
|
|
162
|
-
margin-top: 2px;
|
|
163
|
-
background-color: var(--global-bg-color);
|
|
164
|
-
padding: 12px 0;
|
|
165
|
-
}
|
|
166
|
-
.navbar-dropdown-menu-separator {
|
|
167
|
-
margin: 6px 0;
|
|
168
|
-
border-bottom: 0.8px solid #e8e8e8;
|
|
169
|
-
}
|
|
170
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tabs-overflow bottom-right">
|
|
3
|
+
<button
|
|
4
|
+
:id="collapsedBtnId"
|
|
5
|
+
:class="[
|
|
6
|
+
'btn btn-link nav-link dropdown-toggle',
|
|
7
|
+
{ active: collapsedBtnActive },
|
|
8
|
+
]"
|
|
9
|
+
:data-id="`${props.testId}-toggle-button`"
|
|
10
|
+
@mouseenter="hover = true"
|
|
11
|
+
@mouseleave="hover = false"
|
|
12
|
+
@mousedown="showMenu"
|
|
13
|
+
>
|
|
14
|
+
<atoms-the-icon
|
|
15
|
+
:class="['collapse-icon', { active: open }]"
|
|
16
|
+
name="ellipsis-horizontal"
|
|
17
|
+
width="16px"
|
|
18
|
+
height="16px"
|
|
19
|
+
/>
|
|
20
|
+
</button>
|
|
21
|
+
|
|
22
|
+
<Teleport to="body">
|
|
23
|
+
<ul
|
|
24
|
+
v-show="open"
|
|
25
|
+
:class="['navbar-dropdown-menu', props.popupClass]"
|
|
26
|
+
:style="dropdownMenuStyles"
|
|
27
|
+
>
|
|
28
|
+
<li
|
|
29
|
+
v-for="(item, key) in props.items"
|
|
30
|
+
:key="key"
|
|
31
|
+
v-permission="item.permission"
|
|
32
|
+
:title="item.title"
|
|
33
|
+
class="navbar-dropdown-menu-item"
|
|
34
|
+
@mousedown.stop
|
|
35
|
+
>
|
|
36
|
+
<div
|
|
37
|
+
v-if="item.separate"
|
|
38
|
+
class="navbar-dropdown-menu-separator"
|
|
39
|
+
></div>
|
|
40
|
+
<atoms-collapse-nav-item
|
|
41
|
+
v-else
|
|
42
|
+
:is-link="props.isLink"
|
|
43
|
+
:item="item"
|
|
44
|
+
:value="value"
|
|
45
|
+
btn-class="btn"
|
|
46
|
+
@change="change"
|
|
47
|
+
@select-file="onSelectFile($event, key)"
|
|
48
|
+
/>
|
|
49
|
+
</li>
|
|
50
|
+
</ul>
|
|
51
|
+
</Teleport>
|
|
52
|
+
</div>
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
<script setup lang="ts">
|
|
56
|
+
import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/models/interfaces'
|
|
57
|
+
|
|
58
|
+
const props = withDefaults(
|
|
59
|
+
defineProps<{
|
|
60
|
+
items: UI_I_CollapseNavItem[]
|
|
61
|
+
isLink?: boolean
|
|
62
|
+
value?: number | string
|
|
63
|
+
popupClass?: string
|
|
64
|
+
closeAfterClick?: boolean
|
|
65
|
+
testId?: string
|
|
66
|
+
}>(),
|
|
67
|
+
{
|
|
68
|
+
isLink: undefined,
|
|
69
|
+
value: undefined,
|
|
70
|
+
popupClass: undefined,
|
|
71
|
+
closeAfterClick: undefined,
|
|
72
|
+
testId: '',
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
const emits = defineEmits<{
|
|
76
|
+
(event: 'change', value: number): void
|
|
77
|
+
(event: 'select-file', value1: Event, value2: string, value3: number): void
|
|
78
|
+
}>()
|
|
79
|
+
|
|
80
|
+
const change = (value: number): void => {
|
|
81
|
+
emits('change', value)
|
|
82
|
+
props.closeAfterClick && (open.value = false)
|
|
83
|
+
}
|
|
84
|
+
const onSelectFile = (event: Event, type: string, key: number): void => {
|
|
85
|
+
emits('select-file', event, type, key)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const collapsedBtnId = ref<string>('')
|
|
89
|
+
|
|
90
|
+
const route = useRoute()
|
|
91
|
+
const collapsedBtnActive = computed<boolean>(() => {
|
|
92
|
+
if (props.isLink)
|
|
93
|
+
return props.items.some((item) => route.path.includes(item.path || ''))
|
|
94
|
+
|
|
95
|
+
return props.items.some((item) => item.value === props.value)
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
const open = ref<boolean>(false)
|
|
99
|
+
const hover = ref<boolean>(false)
|
|
100
|
+
const dropdownMenuStyles = ref<any>({})
|
|
101
|
+
const showMenu = (): void => {
|
|
102
|
+
if (open.value) {
|
|
103
|
+
hideMenu(true)
|
|
104
|
+
return
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
open.value = true
|
|
108
|
+
|
|
109
|
+
const btn = document.querySelector(`#${collapsedBtnId.value}`)
|
|
110
|
+
const { top, height, right } = btn!.getBoundingClientRect()
|
|
111
|
+
dropdownMenuStyles.value = {
|
|
112
|
+
top: `${top + height}px`,
|
|
113
|
+
left: `${right}px`,
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
const hideMenu = (force?: boolean): void => {
|
|
117
|
+
if (hover.value && !force) return
|
|
118
|
+
|
|
119
|
+
open.value = false
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const windowClick = (): void => {
|
|
123
|
+
hideMenu()
|
|
124
|
+
}
|
|
125
|
+
const windowResize = (): void => {
|
|
126
|
+
hideMenu(true)
|
|
127
|
+
}
|
|
128
|
+
onMounted(() => {
|
|
129
|
+
collapsedBtnId.value = `collapsed-btn${useUniqueId()}`
|
|
130
|
+
window.addEventListener('mousedown', windowClick)
|
|
131
|
+
window.addEventListener('resize', windowResize)
|
|
132
|
+
})
|
|
133
|
+
onUnmounted(() => {
|
|
134
|
+
window.removeEventListener('mousedown', windowClick)
|
|
135
|
+
window.removeEventListener('resize', windowResize)
|
|
136
|
+
})
|
|
137
|
+
</script>
|
|
138
|
+
|
|
139
|
+
<style scoped lang="scss">
|
|
140
|
+
.tabs-overflow {
|
|
141
|
+
position: absolute;
|
|
142
|
+
top: 0;
|
|
143
|
+
right: 24px;
|
|
144
|
+
|
|
145
|
+
.dropdown-toggle {
|
|
146
|
+
.collapse-icon {
|
|
147
|
+
fill: var(--main-color-mode);
|
|
148
|
+
|
|
149
|
+
&.active {
|
|
150
|
+
fill: #0077b8;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.navbar-dropdown-menu {
|
|
157
|
+
position: fixed;
|
|
158
|
+
z-index: var(--z-dropdown);
|
|
159
|
+
transform: translateX(-100%);
|
|
160
|
+
border: 1px solid var(--global-border-color);
|
|
161
|
+
border-radius: 3px;
|
|
162
|
+
margin-top: 2px;
|
|
163
|
+
background-color: var(--global-bg-color);
|
|
164
|
+
padding: 12px 0;
|
|
165
|
+
}
|
|
166
|
+
.navbar-dropdown-menu-separator {
|
|
167
|
+
margin: 6px 0;
|
|
168
|
+
border-bottom: 0.8px solid #e8e8e8;
|
|
169
|
+
}
|
|
170
|
+
</style>
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="page-size">
|
|
3
|
-
{{ selectLabel }}
|
|
4
|
-
|
|
5
|
-
<div class="clr-select-wrapper">
|
|
6
|
-
<select
|
|
7
|
-
:id="`${props.testId}-select`"
|
|
8
|
-
v-development="props.development"
|
|
9
|
-
:data-id="`${props.testId}-select`"
|
|
10
|
-
:value="props.pageSize"
|
|
11
|
-
class="clr-page-size-select"
|
|
12
|
-
@change="change"
|
|
13
|
-
>
|
|
14
|
-
<option
|
|
15
|
-
v-for="(item, key) in props.options"
|
|
16
|
-
:key="key"
|
|
17
|
-
:value="item.value"
|
|
18
|
-
>
|
|
19
|
-
{{ item.text }}
|
|
20
|
-
</option>
|
|
21
|
-
</select>
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
24
|
-
</template>
|
|
25
|
-
|
|
26
|
-
<script setup lang="ts">
|
|
27
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
28
|
-
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
|
29
|
-
|
|
30
|
-
const props = withDefaults(
|
|
31
|
-
defineProps<{
|
|
32
|
-
pageSize: number
|
|
33
|
-
options: UI_I_OptionItem[]
|
|
34
|
-
label?: string
|
|
35
|
-
testId?: string
|
|
36
|
-
development?: boolean
|
|
37
|
-
}>(),
|
|
38
|
-
{
|
|
39
|
-
testId: 'ui-per-page',
|
|
40
|
-
label: 'itemsPerPage',
|
|
41
|
-
development: false,
|
|
42
|
-
}
|
|
43
|
-
)
|
|
44
|
-
const emits = defineEmits<{
|
|
45
|
-
(event: 'change', value: number): void
|
|
46
|
-
}>()
|
|
47
|
-
|
|
48
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
49
|
-
const selectLabel = computed<string>(
|
|
50
|
-
() => localization.value.common[props.label]
|
|
51
|
-
)
|
|
52
|
-
|
|
53
|
-
const change = (event: InputEvent): void => {
|
|
54
|
-
emits('change', +(event.target as HTMLInputElement).value)
|
|
55
|
-
}
|
|
56
|
-
</script>
|
|
57
|
-
|
|
58
|
-
<style scoped></style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="page-size">
|
|
3
|
+
{{ selectLabel }}
|
|
4
|
+
|
|
5
|
+
<div class="clr-select-wrapper">
|
|
6
|
+
<select
|
|
7
|
+
:id="`${props.testId}-select`"
|
|
8
|
+
v-development="props.development"
|
|
9
|
+
:data-id="`${props.testId}-select`"
|
|
10
|
+
:value="props.pageSize"
|
|
11
|
+
class="clr-page-size-select"
|
|
12
|
+
@change="change"
|
|
13
|
+
>
|
|
14
|
+
<option
|
|
15
|
+
v-for="(item, key) in props.options"
|
|
16
|
+
:key="key"
|
|
17
|
+
:value="item.value"
|
|
18
|
+
>
|
|
19
|
+
{{ item.text }}
|
|
20
|
+
</option>
|
|
21
|
+
</select>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script setup lang="ts">
|
|
27
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
28
|
+
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
|
29
|
+
|
|
30
|
+
const props = withDefaults(
|
|
31
|
+
defineProps<{
|
|
32
|
+
pageSize: number
|
|
33
|
+
options: UI_I_OptionItem[]
|
|
34
|
+
label?: string
|
|
35
|
+
testId?: string
|
|
36
|
+
development?: boolean
|
|
37
|
+
}>(),
|
|
38
|
+
{
|
|
39
|
+
testId: 'ui-per-page',
|
|
40
|
+
label: 'itemsPerPage',
|
|
41
|
+
development: false,
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
const emits = defineEmits<{
|
|
45
|
+
(event: 'change', value: number): void
|
|
46
|
+
}>()
|
|
47
|
+
|
|
48
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
49
|
+
const selectLabel = computed<string>(
|
|
50
|
+
() => localization.value.common[props.label]
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
const change = (event: InputEvent): void => {
|
|
54
|
+
emits('change', +(event.target as HTMLInputElement).value)
|
|
55
|
+
}
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<style scoped></style>
|
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="flex-align-center">
|
|
3
|
-
<div class="switch-body">
|
|
4
|
-
<input
|
|
5
|
-
:id="props.testId"
|
|
6
|
-
v-model="value"
|
|
7
|
-
type="checkbox"
|
|
8
|
-
@change="emits('change', value)"
|
|
9
|
-
/>
|
|
10
|
-
<label :for="props.testId" class="switch-label"></label>
|
|
11
|
-
</div>
|
|
12
|
-
<label :for="props.testId"><slot></slot></label>
|
|
13
|
-
</div>
|
|
14
|
-
</template>
|
|
15
|
-
|
|
16
|
-
<script setup lang="ts">
|
|
17
|
-
const props = withDefaults(
|
|
18
|
-
defineProps<{
|
|
19
|
-
modelValue: boolean
|
|
20
|
-
testId?: string
|
|
21
|
-
}>(),
|
|
22
|
-
{ testId: 'ui-switch' }
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
const emits = defineEmits<{
|
|
26
|
-
(event: 'update:model-value', value: boolean): void
|
|
27
|
-
(event: 'change', value: boolean): void
|
|
28
|
-
}>()
|
|
29
|
-
|
|
30
|
-
const value = computed<boolean>({
|
|
31
|
-
get() {
|
|
32
|
-
return props.modelValue
|
|
33
|
-
},
|
|
34
|
-
set(newValue) {
|
|
35
|
-
emits('update:model-value', newValue)
|
|
36
|
-
},
|
|
37
|
-
})
|
|
38
|
-
</script>
|
|
39
|
-
|
|
40
|
-
<style scoped lang="scss">
|
|
41
|
-
.switch-body {
|
|
42
|
-
width: 33px;
|
|
43
|
-
height: 18px;
|
|
44
|
-
position: relative;
|
|
45
|
-
margin-right: 4px;
|
|
46
|
-
|
|
47
|
-
input[type='checkbox'] {
|
|
48
|
-
position: absolute;
|
|
49
|
-
top: 0.3rem;
|
|
50
|
-
right: 0.3rem;
|
|
51
|
-
height: 0.8rem;
|
|
52
|
-
width: 0.8rem;
|
|
53
|
-
opacity: 0;
|
|
54
|
-
}
|
|
55
|
-
.switch-label {
|
|
56
|
-
display: block;
|
|
57
|
-
position: relative;
|
|
58
|
-
cursor: pointer;
|
|
59
|
-
height: 1.2rem;
|
|
60
|
-
}
|
|
61
|
-
.switch-label {
|
|
62
|
-
&:before {
|
|
63
|
-
position: absolute;
|
|
64
|
-
display: inline-block;
|
|
65
|
-
content: '';
|
|
66
|
-
height: 18px;
|
|
67
|
-
width: 33px;
|
|
68
|
-
border-radius: 0.45rem;
|
|
69
|
-
border: 2px solid var(--label-before-bg-color);
|
|
70
|
-
background-color: var(--label-before-bg-color);
|
|
71
|
-
transition: 0.15s ease-in;
|
|
72
|
-
transition-property: border-color, background-color;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
&:after {
|
|
76
|
-
position: absolute;
|
|
77
|
-
display: inline-block;
|
|
78
|
-
content: '';
|
|
79
|
-
height: 14.5px;
|
|
80
|
-
width: 14.5px;
|
|
81
|
-
border: 1px solid var(--label-after-bg-color);
|
|
82
|
-
border-radius: 50%;
|
|
83
|
-
background-color: var(--label-after-bg-color);
|
|
84
|
-
bottom: 12.5px;
|
|
85
|
-
transition: 0.15s ease-in;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
& input[type='checkbox']:focus + label:before {
|
|
90
|
-
box-shadow: var(--label-before-box-shadow);
|
|
91
|
-
}
|
|
92
|
-
& input[type='checkbox']:checked + label:before {
|
|
93
|
-
border-color: #62a420;
|
|
94
|
-
background-color: #62a420;
|
|
95
|
-
}
|
|
96
|
-
& input[type='checkbox']:checked + label:after {
|
|
97
|
-
left: 15px;
|
|
98
|
-
}
|
|
99
|
-
& input[type='checkbox'] + label:after {
|
|
100
|
-
left: 3px;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex-align-center">
|
|
3
|
+
<div class="switch-body">
|
|
4
|
+
<input
|
|
5
|
+
:id="props.testId"
|
|
6
|
+
v-model="value"
|
|
7
|
+
type="checkbox"
|
|
8
|
+
@change="emits('change', value)"
|
|
9
|
+
/>
|
|
10
|
+
<label :for="props.testId" class="switch-label"></label>
|
|
11
|
+
</div>
|
|
12
|
+
<label :for="props.testId"><slot></slot></label>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script setup lang="ts">
|
|
17
|
+
const props = withDefaults(
|
|
18
|
+
defineProps<{
|
|
19
|
+
modelValue: boolean
|
|
20
|
+
testId?: string
|
|
21
|
+
}>(),
|
|
22
|
+
{ testId: 'ui-switch' }
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
const emits = defineEmits<{
|
|
26
|
+
(event: 'update:model-value', value: boolean): void
|
|
27
|
+
(event: 'change', value: boolean): void
|
|
28
|
+
}>()
|
|
29
|
+
|
|
30
|
+
const value = computed<boolean>({
|
|
31
|
+
get() {
|
|
32
|
+
return props.modelValue
|
|
33
|
+
},
|
|
34
|
+
set(newValue) {
|
|
35
|
+
emits('update:model-value', newValue)
|
|
36
|
+
},
|
|
37
|
+
})
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<style scoped lang="scss">
|
|
41
|
+
.switch-body {
|
|
42
|
+
width: 33px;
|
|
43
|
+
height: 18px;
|
|
44
|
+
position: relative;
|
|
45
|
+
margin-right: 4px;
|
|
46
|
+
|
|
47
|
+
input[type='checkbox'] {
|
|
48
|
+
position: absolute;
|
|
49
|
+
top: 0.3rem;
|
|
50
|
+
right: 0.3rem;
|
|
51
|
+
height: 0.8rem;
|
|
52
|
+
width: 0.8rem;
|
|
53
|
+
opacity: 0;
|
|
54
|
+
}
|
|
55
|
+
.switch-label {
|
|
56
|
+
display: block;
|
|
57
|
+
position: relative;
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
height: 1.2rem;
|
|
60
|
+
}
|
|
61
|
+
.switch-label {
|
|
62
|
+
&:before {
|
|
63
|
+
position: absolute;
|
|
64
|
+
display: inline-block;
|
|
65
|
+
content: '';
|
|
66
|
+
height: 18px;
|
|
67
|
+
width: 33px;
|
|
68
|
+
border-radius: 0.45rem;
|
|
69
|
+
border: 2px solid var(--label-before-bg-color);
|
|
70
|
+
background-color: var(--label-before-bg-color);
|
|
71
|
+
transition: 0.15s ease-in;
|
|
72
|
+
transition-property: border-color, background-color;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&:after {
|
|
76
|
+
position: absolute;
|
|
77
|
+
display: inline-block;
|
|
78
|
+
content: '';
|
|
79
|
+
height: 14.5px;
|
|
80
|
+
width: 14.5px;
|
|
81
|
+
border: 1px solid var(--label-after-bg-color);
|
|
82
|
+
border-radius: 50%;
|
|
83
|
+
background-color: var(--label-after-bg-color);
|
|
84
|
+
bottom: 12.5px;
|
|
85
|
+
transition: 0.15s ease-in;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
& input[type='checkbox']:focus + label:before {
|
|
90
|
+
box-shadow: var(--label-before-box-shadow);
|
|
91
|
+
}
|
|
92
|
+
& input[type='checkbox']:checked + label:before {
|
|
93
|
+
border-color: #62a420;
|
|
94
|
+
background-color: #62a420;
|
|
95
|
+
}
|
|
96
|
+
& input[type='checkbox']:checked + label:after {
|
|
97
|
+
left: 15px;
|
|
98
|
+
}
|
|
99
|
+
& input[type='checkbox'] + label:after {
|
|
100
|
+
left: 3px;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
</style>
|