bfg-common 1.5.648 → 1.5.649

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.
@@ -121,6 +121,7 @@
121
121
  <template #content>
122
122
  <common-vm-actions-common-select-options
123
123
  :is-new-vm-from-template="props.isNewVmFromTemplate"
124
+ :project="props.project"
124
125
  @change="emits('change-select-options', $event)"
125
126
  @change-count="emits('change-clone-count', $event)"
126
127
  />
@@ -72,6 +72,7 @@
72
72
  <common-vm-actions-common-select-options
73
73
  v-show="selectedStep.id === props.dynamicSteps.selectOptions"
74
74
  :is-new-vm-from-template="props.isNewVmFromTemplate"
75
+ :project="props.project"
75
76
  @change="emits('change-select-options', $event)"
76
77
  @change-count="emits('change-clone-count', $event)"
77
78
  />
@@ -1,259 +1,263 @@
1
- <template>
2
- <div
3
- ref="mainContainer"
4
- :class="[
5
- 'select-options grid gap-3 mt-4',
6
- { 'is-sm-size': isContainerSm },
7
- { 'three-items': !props.isNewVmFromTemplate },
8
- ]"
9
- >
10
- <div
11
- :class="[
12
- 'checkbox-container',
13
- { checked: isCustomizeOs },
14
- { disabled: props.isNewVmFromTemplate },
15
- ]"
16
- @click.stop.prevent="onToggleCustomizeOs"
17
- >
18
- <ui-checkbox
19
- v-model="isCustomizeOs"
20
- :label-text="localization.vmWizard.customizeOS"
21
- :title="localization.vmWizard.customizeOS"
22
- :disabled="props.isNewVmFromTemplate"
23
- test-id="customize-os"
24
- size="md"
25
- />
26
- <p
27
- :class="[
28
- 'checkbox-block-description mt-2 ml-7 mr-3',
29
- { disabled: props.isNewVmFromTemplate },
30
- ]"
31
- >
32
- {{ localization.vmWizard.customizeOperatingSystem }}
33
- </p>
34
- </div>
35
- <div
36
- v-if="!props.isNewVmFromTemplate"
37
- :class="[
38
- 'checkbox-container',
39
- { checked: isCustomizeHardware },
40
- { disabled: props.isNewVmFromTemplate },
41
- ]"
42
- @click.stop.prevent="onToggleCustomizeHardware"
43
- >
44
- <ui-checkbox
45
- v-model="isCustomizeHardware"
46
- :label-text="localization.common.customizeHardware"
47
- :title="localization.common.customizeHardware"
48
- :disabled="props.isNewVmFromTemplate"
49
- test-id="customize-hardware"
50
- size="md"
51
- />
52
- <p
53
- :class="[
54
- 'checkbox-block-description mt-2 ml-7 mr-3',
55
- { disabled: props.isNewVmFromTemplate },
56
- ]"
57
- >
58
- {{ localization.vmWizard.customizeVMHardware }}
59
- </p>
60
- </div>
61
- <div
62
- :class="[
63
- 'checkbox-container',
64
- { checked: isPowerOn },
65
- { disabled: props.isNewVmFromTemplate },
66
- ]"
67
- @click.stop.prevent="onTogglePowerOn"
68
- >
69
- <!-- :disabled="props.isNewVmFromTemplate"-->
70
- <ui-checkbox
71
- v-model="isPowerOn"
72
- :label-text="localization.vmWizard.autoPowerOn"
73
- :title="localization.vmWizard.autoPowerOn"
74
- :disabled="props.isNewVmFromTemplate"
75
- test-id="power-on"
76
- size="md"
77
- />
78
- <!-- { disabled: props.isNewVmFromTemplate },-->
79
- <p :class="['checkbox-block-description mt-2 ml-7 mr-3']">
80
- {{ localization.vmWizard.powerVMAfterCreation }}
81
- </p>
82
- </div>
83
- <div
84
- v-if="props.isNewVmFromTemplate"
85
- :class="['checkbox-container', { checked: isLinkedClone }]"
86
- @click.stop.prevent="onToggleLinkedClone"
87
- >
88
- <ui-checkbox
89
- v-model="isLinkedClone"
90
- :label-text="localization.vmWizard.createLinkedClone"
91
- :title="localization.vmWizard.createLinkedClone"
92
- test-id="create-linked-clone"
93
- size="md"
94
- />
95
-
96
- <ui-input
97
- v-model="cloneCount"
98
- :disabled="!isLinkedClone"
99
- test-id="clone-count"
100
- type="number"
101
- class="ml-1 mt-2"
102
- />
103
- </div>
104
- </div>
105
- </template>
106
-
107
- <script setup lang="ts">
108
- import { useElementSize } from '@vueuse/core'
109
- import type { UI_I_Localization } from '~/lib/models/interfaces'
110
-
111
- const modelValue = defineModel<string[]>({ required: true })
112
- const cloneCount = defineModel<number>('cloneCount')
113
-
114
- const props = withDefaults(
115
- defineProps<{
116
- isNewVmFromTemplate?: boolean // TODO change
117
- }>(),
118
- {
119
- isNewVmFromTemplate: undefined,
120
- }
121
- )
122
-
123
- const localization = computed<UI_I_Localization>(() => useLocal())
124
-
125
- const mainContainer = ref<HTMLElement | null>(null)
126
- const { width: mainContainerWidth } = useElementSize(mainContainer)
127
-
128
- const isCustomizeOs = ref<boolean>(false)
129
- const isCustomizeHardware = ref<boolean>(false)
130
- const isPowerOn = ref<boolean>(false)
131
- const isLinkedClone = ref<boolean>(false)
132
-
133
- const onToggleCustomizeOs = (): void => {
134
- if (props.isNewVmFromTemplate) return
135
-
136
- isCustomizeOs.value = !isCustomizeOs.value
137
- if (isCustomizeOs.value) {
138
- !modelValue.value.includes('customize-os') &&
139
- modelValue.value.push('customize-os')
140
- } else {
141
- modelValue.value = modelValue.value.filter(
142
- (item) => item !== 'customize-os'
143
- )
144
- }
145
- }
146
-
147
- const onToggleCustomizeHardware = (): void => {
148
- if (props.isNewVmFromTemplate) return
149
-
150
- isCustomizeHardware.value = !isCustomizeHardware.value
151
- if (isCustomizeHardware.value) {
152
- !modelValue.value.includes('customize-hardware') &&
153
- modelValue.value.push('customize-hardware')
154
- } else {
155
- modelValue.value = modelValue.value.filter(
156
- (item) => item !== 'customize-hardware'
157
- )
158
- }
159
- }
160
-
161
- const onTogglePowerOn = (): void => {
162
- if (props.isNewVmFromTemplate) return
163
-
164
- isPowerOn.value = !isPowerOn.value
165
- if (isPowerOn.value) {
166
- !modelValue.value.includes('power-on') && modelValue.value.push('power-on')
167
- } else {
168
- modelValue.value = modelValue.value.filter((item) => item !== 'power-on')
169
- }
170
- }
171
-
172
- const onToggleLinkedClone = (): void => {
173
- isLinkedClone.value = !isLinkedClone.value
174
- if (isLinkedClone.value) {
175
- !modelValue.value.includes('create-linked-clone') &&
176
- modelValue.value.push('create-linked-clone')
177
- } else {
178
- modelValue.value = modelValue.value.filter(
179
- (item) => item !== 'create-linked-clone'
180
- )
181
- }
182
- }
183
-
184
- const isContainerSm = ref<boolean>(false)
185
- watch(
186
- mainContainerWidth,
187
- (newValue) => {
188
- isContainerSm.value = newValue <= 600
189
- },
190
- { immediate: true }
191
- )
192
- </script>
193
-
194
- <style>
195
- :root {
196
- --select-option-target-vm-checkbox-description-disabled: #bdc3c7;
197
- }
198
- :root.dark-theme {
199
- --select-option-target-vm-checkbox-description-disabled: #bdc3c770;
200
- }
201
- </style>
202
-
203
- <style scoped lang="scss">
204
- .select-options {
205
- grid-template-columns: 1fr 1fr;
206
- grid-template-rows: max-content;
207
- overflow-y: auto;
208
- padding-bottom: 16px;
209
-
210
- &.is-sm-size {
211
- grid-template-columns: 1fr;
212
- }
213
-
214
- &.three-items {
215
- grid-template-columns: 1fr 1fr 1fr;
216
- }
217
-
218
- .checkbox-container {
219
- width: 100%;
220
- background-color: var(--select-bg);
221
- border-radius: 8px;
222
- padding: 12px;
223
- transition: box-shadow 0.1s ease-in-out;
224
- box-shadow: inset 0 0 0 1px var(--line-color);
225
-
226
- &.disabled {
227
- cursor: not-allowed;
228
- }
229
- &:not(.disabled):hover {
230
- cursor: pointer;
231
- }
232
- &:not(.disabled):not(.checked):hover {
233
- box-shadow: inset 0 0 0 1px var(--select-border);
234
- }
235
- &.checked {
236
- background-color: var(--radio-btn-active-label-bg-color);
237
- box-shadow: inset 0 0 0 1.5px var(--radio-btn-active-label-border-color);
238
- }
239
-
240
- :deep(.ui-checkbox-label) {
241
- align-items: flex-start;
242
-
243
- .ui-checkbox-label-text {
244
- line-height: 18px;
245
- margin-top: 1px;
246
- }
247
- }
248
-
249
- .checkbox-block-description {
250
- color: #9da6ad;
251
- line-height: 18px;
252
-
253
- &.disabled {
254
- color: var(--select-option-target-vm-checkbox-description-disabled);
255
- }
256
- }
257
- }
258
- }
259
- </style>
1
+ <template>
2
+ <div
3
+ ref="mainContainer"
4
+ :class="[
5
+ 'select-options grid gap-3 mt-4',
6
+ { 'is-sm-size': isContainerSm },
7
+ { 'three-items': !props.isNewVmFromTemplate },
8
+ ]"
9
+ >
10
+ <div
11
+ :class="[
12
+ 'checkbox-container',
13
+ { checked: isCustomizeOs },
14
+ { disabled: props.isNewVmFromTemplate },
15
+ ]"
16
+ @click.stop.prevent="onToggleCustomizeOs"
17
+ >
18
+ <ui-checkbox
19
+ v-model="isCustomizeOs"
20
+ :label-text="localization.vmWizard.customizeOS"
21
+ :title="localization.vmWizard.customizeOS"
22
+ :disabled="props.isNewVmFromTemplate"
23
+ test-id="customize-os"
24
+ size="md"
25
+ />
26
+ <p
27
+ :class="[
28
+ 'checkbox-block-description mt-2 ml-7 mr-3',
29
+ { disabled: props.isNewVmFromTemplate },
30
+ ]"
31
+ >
32
+ {{ localization.vmWizard.customizeOperatingSystem }}
33
+ </p>
34
+ </div>
35
+ <div
36
+ v-if="!props.isNewVmFromTemplate"
37
+ :class="[
38
+ 'checkbox-container',
39
+ { checked: isCustomizeHardware },
40
+ { disabled: props.isNewVmFromTemplate },
41
+ ]"
42
+ @click.stop.prevent="onToggleCustomizeHardware"
43
+ >
44
+ <ui-checkbox
45
+ v-model="isCustomizeHardware"
46
+ :label-text="localization.common.customizeHardware"
47
+ :title="localization.common.customizeHardware"
48
+ :disabled="props.isNewVmFromTemplate"
49
+ test-id="customize-hardware"
50
+ size="md"
51
+ />
52
+ <p
53
+ :class="[
54
+ 'checkbox-block-description mt-2 ml-7 mr-3',
55
+ { disabled: props.isNewVmFromTemplate },
56
+ ]"
57
+ >
58
+ {{ localization.vmWizard.customizeVMHardware }}
59
+ </p>
60
+ </div>
61
+ <div
62
+ :class="[
63
+ 'checkbox-container',
64
+ { checked: isPowerOn },
65
+ { disabled: props.isNewVmFromTemplate },
66
+ ]"
67
+ @click.stop.prevent="onTogglePowerOn"
68
+ >
69
+ <!-- :disabled="props.isNewVmFromTemplate"-->
70
+ <ui-checkbox
71
+ v-model="isPowerOn"
72
+ :label-text="localization.vmWizard.autoPowerOn"
73
+ :title="localization.vmWizard.autoPowerOn"
74
+ :disabled="props.isNewVmFromTemplate"
75
+ test-id="power-on"
76
+ size="md"
77
+ />
78
+ <!-- { disabled: props.isNewVmFromTemplate },-->
79
+ <p :class="['checkbox-block-description mt-2 ml-7 mr-3']">
80
+ {{ localization.vmWizard.powerVMAfterCreation }}
81
+ </p>
82
+ </div>
83
+ <div
84
+ v-if="props.isNewVmFromTemplate"
85
+ :class="['checkbox-container', { checked: isLinkedClone }]"
86
+ @click.stop.prevent="onToggleLinkedClone"
87
+ >
88
+ <ui-checkbox
89
+ v-model="isLinkedClone"
90
+ :label-text="localization.vmWizard.createLinkedClone"
91
+ :title="localization.vmWizard.createLinkedClone"
92
+ test-id="create-linked-clone"
93
+ size="md"
94
+ />
95
+
96
+ <ui-input
97
+ v-if="props.project !== 'sphere'"
98
+ v-model="cloneCount"
99
+ :disabled="!isLinkedClone"
100
+ test-id="clone-count"
101
+ type="number"
102
+ class="ml-1 mt-2"
103
+ />
104
+ </div>
105
+ </div>
106
+ </template>
107
+
108
+ <script setup lang="ts">
109
+ import { useElementSize } from '@vueuse/core'
110
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
111
+ import type { UI_T_Project } from '~/lib/models/types'
112
+
113
+ const modelValue = defineModel<string[]>({ required: true })
114
+ const cloneCount = defineModel<number>('cloneCount')
115
+
116
+ const props = withDefaults(
117
+ defineProps<{
118
+ project?: UI_T_Project
119
+ isNewVmFromTemplate?: boolean // TODO change
120
+ }>(),
121
+ {
122
+ project: undefined,
123
+ isNewVmFromTemplate: undefined,
124
+ }
125
+ )
126
+
127
+ const localization = computed<UI_I_Localization>(() => useLocal())
128
+
129
+ const mainContainer = ref<HTMLElement | null>(null)
130
+ const { width: mainContainerWidth } = useElementSize(mainContainer)
131
+
132
+ const isCustomizeOs = ref<boolean>(false)
133
+ const isCustomizeHardware = ref<boolean>(false)
134
+ const isPowerOn = ref<boolean>(false)
135
+ const isLinkedClone = ref<boolean>(false)
136
+
137
+ const onToggleCustomizeOs = (): void => {
138
+ if (props.isNewVmFromTemplate) return
139
+
140
+ isCustomizeOs.value = !isCustomizeOs.value
141
+ if (isCustomizeOs.value) {
142
+ !modelValue.value.includes('customize-os') &&
143
+ modelValue.value.push('customize-os')
144
+ } else {
145
+ modelValue.value = modelValue.value.filter(
146
+ (item) => item !== 'customize-os'
147
+ )
148
+ }
149
+ }
150
+
151
+ const onToggleCustomizeHardware = (): void => {
152
+ if (props.isNewVmFromTemplate) return
153
+
154
+ isCustomizeHardware.value = !isCustomizeHardware.value
155
+ if (isCustomizeHardware.value) {
156
+ !modelValue.value.includes('customize-hardware') &&
157
+ modelValue.value.push('customize-hardware')
158
+ } else {
159
+ modelValue.value = modelValue.value.filter(
160
+ (item) => item !== 'customize-hardware'
161
+ )
162
+ }
163
+ }
164
+
165
+ const onTogglePowerOn = (): void => {
166
+ if (props.isNewVmFromTemplate) return
167
+
168
+ isPowerOn.value = !isPowerOn.value
169
+ if (isPowerOn.value) {
170
+ !modelValue.value.includes('power-on') && modelValue.value.push('power-on')
171
+ } else {
172
+ modelValue.value = modelValue.value.filter((item) => item !== 'power-on')
173
+ }
174
+ }
175
+
176
+ const onToggleLinkedClone = (): void => {
177
+ isLinkedClone.value = !isLinkedClone.value
178
+ if (isLinkedClone.value) {
179
+ !modelValue.value.includes('create-linked-clone') &&
180
+ modelValue.value.push('create-linked-clone')
181
+ } else {
182
+ modelValue.value = modelValue.value.filter(
183
+ (item) => item !== 'create-linked-clone'
184
+ )
185
+ }
186
+ }
187
+
188
+ const isContainerSm = ref<boolean>(false)
189
+ watch(
190
+ mainContainerWidth,
191
+ (newValue) => {
192
+ isContainerSm.value = newValue <= 600
193
+ },
194
+ { immediate: true }
195
+ )
196
+ </script>
197
+
198
+ <style>
199
+ :root {
200
+ --select-option-target-vm-checkbox-description-disabled: #bdc3c7;
201
+ }
202
+ :root.dark-theme {
203
+ --select-option-target-vm-checkbox-description-disabled: #bdc3c770;
204
+ }
205
+ </style>
206
+
207
+ <style scoped lang="scss">
208
+ .select-options {
209
+ grid-template-columns: 1fr 1fr;
210
+ grid-template-rows: max-content;
211
+ overflow-y: auto;
212
+ padding-bottom: 16px;
213
+
214
+ &.is-sm-size {
215
+ grid-template-columns: 1fr;
216
+ }
217
+
218
+ &.three-items {
219
+ grid-template-columns: 1fr 1fr 1fr;
220
+ }
221
+
222
+ .checkbox-container {
223
+ width: 100%;
224
+ background-color: var(--select-bg);
225
+ border-radius: 8px;
226
+ padding: 12px;
227
+ transition: box-shadow 0.1s ease-in-out;
228
+ box-shadow: inset 0 0 0 1px var(--line-color);
229
+
230
+ &.disabled {
231
+ cursor: not-allowed;
232
+ }
233
+ &:not(.disabled):hover {
234
+ cursor: pointer;
235
+ }
236
+ &:not(.disabled):not(.checked):hover {
237
+ box-shadow: inset 0 0 0 1px var(--select-border);
238
+ }
239
+ &.checked {
240
+ background-color: var(--radio-btn-active-label-bg-color);
241
+ box-shadow: inset 0 0 0 1.5px var(--radio-btn-active-label-border-color);
242
+ }
243
+
244
+ :deep(.ui-checkbox-label) {
245
+ align-items: flex-start;
246
+
247
+ .ui-checkbox-label-text {
248
+ line-height: 18px;
249
+ margin-top: 1px;
250
+ }
251
+ }
252
+
253
+ .checkbox-block-description {
254
+ color: #9da6ad;
255
+ line-height: 18px;
256
+
257
+ &.disabled {
258
+ color: var(--select-option-target-vm-checkbox-description-disabled);
259
+ }
260
+ }
261
+ }
262
+ }
263
+ </style>
@@ -1,102 +1,109 @@
1
- <template>
2
- <div class="select-options">
3
- <div v-show="!props.isNewVmFromTemplate" :class="['checkbox', { disabled: props.isNewVmFromTemplate }]">
4
- <input
5
- id="customize-os"
6
- v-model="modelValue"
7
- data-id="customize-os"
8
- type="checkbox"
9
- value="customize-os"
10
- />
11
- <label for="customize-os">{{
12
- localization.common.customizeTheOperatingSystem
13
- }}</label>
14
- </div>
15
- <div v-if="!props.isNewVmFromTemplate" class="checkbox">
16
- <input
17
- id="customize-hardware"
18
- v-model="modelValue"
19
- data-id="customize-hardware"
20
- type="checkbox"
21
- value="customize-hardware"
22
- />
23
- <label for="customize-hardware">{{
24
- localization.common.customizeThisVirtualMachineHardware
25
- }}</label>
26
- </div>
27
- <div class="checkbox">
28
- <!-- :disabled="props.isNewVmFromTemplate"-->
29
- <input
30
- id="power-on"
31
- v-model="modelValue"
32
- data-id="power-on"
33
- type="checkbox"
34
- value="power-on"
35
- />
36
- <label for="power-on">{{
37
- localization.common.powerOnVirtualMachineAfterCreation
38
- }}</label>
39
- </div>
40
- <div v-if="props.isNewVmFromTemplate" class="checkbox">
41
- <!-- :disabled="props.isNewVmFromTemplate"-->
42
- <input
43
- id="create-linked-clone"
44
- v-model="modelValue"
45
- data-id="create-linked-clone"
46
- type="checkbox"
47
- value="create-linked-clone"
48
- />
49
- <label for="create-linked-clone">{{
50
- localization.vmWizard.createLinkedClone
51
- }}</label>
52
-
53
- <input
54
- v-model="cloneCount"
55
- :disabled="!isLinkedClone"
56
- data-id="clone-count"
57
- type="number"
58
- class="ml-1"
59
- :min="0"
60
- :max="1000"
61
- />
62
- </div>
63
- </div>
64
- </template>
65
-
66
- <script setup lang="ts">
67
- import type { UI_I_Localization } from '~/lib/models/interfaces'
68
-
69
- const modelValue = defineModel<string[]>()
70
- const cloneCount = defineModel<number>('cloneCount')
71
-
72
- const props = withDefaults(
73
- defineProps<{
74
- isNewVmFromTemplate?: boolean // TODO change
75
- }>(),
76
- {
77
- isNewVmFromTemplate: undefined,
78
- }
79
- )
80
-
81
- const localization = computed<UI_I_Localization>(() => useLocal())
82
-
83
- const isLinkedClone = computed<boolean>(
84
- () => modelValue.value?.includes('create-linked-clone') || false
85
- )
86
- </script>
87
-
88
- <style scoped lang="scss">
89
- .select-options {
90
- padding: 12px 0 0;
91
-
92
- .disabled {
93
- input,
94
- label {
95
- cursor: not-allowed;
96
- }
97
- }
98
- .checkbox {
99
- margin: 6px 0;
100
- }
101
- }
102
- </style>
1
+ <template>
2
+ <div class="select-options">
3
+ <div
4
+ v-show="!props.isNewVmFromTemplate"
5
+ :class="['checkbox', { disabled: props.isNewVmFromTemplate }]"
6
+ >
7
+ <input
8
+ id="customize-os"
9
+ v-model="modelValue"
10
+ data-id="customize-os"
11
+ type="checkbox"
12
+ value="customize-os"
13
+ />
14
+ <label for="customize-os">{{
15
+ localization.common.customizeTheOperatingSystem
16
+ }}</label>
17
+ </div>
18
+ <div v-if="!props.isNewVmFromTemplate" class="checkbox">
19
+ <input
20
+ id="customize-hardware"
21
+ v-model="modelValue"
22
+ data-id="customize-hardware"
23
+ type="checkbox"
24
+ value="customize-hardware"
25
+ />
26
+ <label for="customize-hardware">{{
27
+ localization.common.customizeThisVirtualMachineHardware
28
+ }}</label>
29
+ </div>
30
+ <div class="checkbox">
31
+ <!-- :disabled="props.isNewVmFromTemplate"-->
32
+ <input
33
+ id="power-on"
34
+ v-model="modelValue"
35
+ data-id="power-on"
36
+ type="checkbox"
37
+ value="power-on"
38
+ />
39
+ <label for="power-on">{{
40
+ localization.common.powerOnVirtualMachineAfterCreation
41
+ }}</label>
42
+ </div>
43
+ <div v-if="props.isNewVmFromTemplate" class="checkbox">
44
+ <!-- :disabled="props.isNewVmFromTemplate"-->
45
+ <input
46
+ id="create-linked-clone"
47
+ v-model="modelValue"
48
+ data-id="create-linked-clone"
49
+ type="checkbox"
50
+ value="create-linked-clone"
51
+ />
52
+ <label for="create-linked-clone">{{
53
+ localization.vmWizard.createLinkedClone
54
+ }}</label>
55
+
56
+ <input
57
+ v-if="props.project !== 'sphere'"
58
+ v-model="cloneCount"
59
+ :disabled="!isLinkedClone"
60
+ data-id="clone-count"
61
+ type="number"
62
+ class="ml-1"
63
+ :min="0"
64
+ :max="1000"
65
+ />
66
+ </div>
67
+ </div>
68
+ </template>
69
+
70
+ <script setup lang="ts">
71
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
72
+ import type { UI_T_Project } from '~/lib/models/types'
73
+
74
+ const modelValue = defineModel<string[]>()
75
+ const cloneCount = defineModel<number>('cloneCount')
76
+
77
+ const props = withDefaults(
78
+ defineProps<{
79
+ project?: UI_T_Project
80
+ isNewVmFromTemplate?: boolean // TODO change
81
+ }>(),
82
+ {
83
+ project: undefined,
84
+ isNewVmFromTemplate: undefined,
85
+ }
86
+ )
87
+
88
+ const localization = computed<UI_I_Localization>(() => useLocal())
89
+
90
+ const isLinkedClone = computed<boolean>(
91
+ () => modelValue.value?.includes('create-linked-clone') || false
92
+ )
93
+ </script>
94
+
95
+ <style scoped lang="scss">
96
+ .select-options {
97
+ padding: 12px 0 0;
98
+
99
+ .disabled {
100
+ input,
101
+ label {
102
+ cursor: not-allowed;
103
+ }
104
+ }
105
+ .checkbox {
106
+ margin: 6px 0;
107
+ }
108
+ }
109
+ </style>
@@ -1,53 +1,58 @@
1
- <template>
2
- <component
3
- :is="currentComponent"
4
- v-model="selectedOptions"
5
- v-model:clone-count="cloneCount"
6
- :is-new-vm-from-template="props.isNewVmFromTemplate"
7
- />
8
- </template>
9
-
10
- <script setup lang="ts">
11
- const props = withDefaults(
12
- defineProps<{
13
- isNewVmFromTemplate?: boolean // TODO change
14
- }>(),
15
- {
16
- isNewVmFromTemplate: undefined,
17
- }
18
- )
19
-
20
- const emits = defineEmits<{
21
- (event: 'change', value: string[]): void
22
- (event: 'change-count', value: number): void
23
- }>()
24
-
25
- const { $store }: any = useNuxtApp()
26
-
27
- const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
28
- const currentComponent = computed(() =>
29
- isNewView.value
30
- ? defineAsyncComponent(() => import('./New.vue'))
31
- : defineAsyncComponent(() => import('./Old.vue'))
32
- )
33
-
34
- const selectedOptions = ref<string[]>([])
35
- watch(selectedOptions, (newValue) => {
36
- emits('change', newValue)
37
- })
38
- const cloneCount = ref<number>(0) // For Deploy
39
- watch(cloneCount, (newValue) => {
40
- if (newValue < 0) {
41
- cloneCount.value = 0
42
- return
43
- }
44
- if (newValue > 1000) {
45
- cloneCount.value = 1000
46
- return
47
- }
48
-
49
- emits('change-count', newValue)
50
- })
51
- </script>
52
-
53
- <style scoped lang="scss"></style>
1
+ <template>
2
+ <component
3
+ v-model="selectedOptions"
4
+ v-model:clone-count="cloneCount"
5
+ :is="currentComponent"
6
+ :project="props.project"
7
+ :is-new-vm-from-template="props.isNewVmFromTemplate"
8
+ />
9
+ </template>
10
+
11
+ <script setup lang="ts">
12
+ import type { UI_T_Project } from '~/lib/models/types'
13
+
14
+ const props = withDefaults(
15
+ defineProps<{
16
+ project?: UI_T_Project
17
+ isNewVmFromTemplate?: boolean // TODO change
18
+ }>(),
19
+ {
20
+ project: undefined,
21
+ isNewVmFromTemplate: undefined,
22
+ }
23
+ )
24
+
25
+ const emits = defineEmits<{
26
+ (event: 'change', value: string[]): void
27
+ (event: 'change-count', value: number): void
28
+ }>()
29
+
30
+ const { $store }: any = useNuxtApp()
31
+
32
+ const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
33
+ const currentComponent = computed(() =>
34
+ isNewView.value
35
+ ? defineAsyncComponent(() => import('./New.vue'))
36
+ : defineAsyncComponent(() => import('./Old.vue'))
37
+ )
38
+
39
+ const selectedOptions = ref<string[]>([])
40
+ watch(selectedOptions, (newValue) => {
41
+ emits('change', newValue)
42
+ })
43
+ const cloneCount = ref<number>(0) // For Deploy
44
+ watch(cloneCount, (newValue) => {
45
+ if (newValue < 0) {
46
+ cloneCount.value = 0
47
+ return
48
+ }
49
+ if (newValue > 1000) {
50
+ cloneCount.value = 1000
51
+ return
52
+ }
53
+
54
+ emits('change-count', newValue)
55
+ })
56
+ </script>
57
+
58
+ <style scoped lang="scss"></style>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.5.648",
4
+ "version": "1.5.649",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",