bfg-common 1.4.244 → 1.4.246
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.
|
@@ -50,6 +50,20 @@
|
|
|
50
50
|
</div>
|
|
51
51
|
</div>
|
|
52
52
|
|
|
53
|
+
<div class="clr-form-control clr-row switch">
|
|
54
|
+
<label class="clr-control-label clr-col-md-3">
|
|
55
|
+
{{ localization.common.active }}
|
|
56
|
+
</label>
|
|
57
|
+
|
|
58
|
+
<input
|
|
59
|
+
id="scheduled-task-active-switch-input"
|
|
60
|
+
v-model="model.toggle"
|
|
61
|
+
data-id="scheduled-task-active-switch-input"
|
|
62
|
+
type="checkbox"
|
|
63
|
+
class="switch"
|
|
64
|
+
/>
|
|
65
|
+
</div>
|
|
66
|
+
|
|
53
67
|
<common-select-input
|
|
54
68
|
v-model="model.frequency"
|
|
55
69
|
:label="localization.common.run"
|
|
@@ -64,20 +78,6 @@
|
|
|
64
78
|
</template>
|
|
65
79
|
</common-select-input>
|
|
66
80
|
|
|
67
|
-
<div class="clr-form-control clr-row email">
|
|
68
|
-
<label class="clr-control-label clr-col-md-3">
|
|
69
|
-
{{ localization.common.active }}
|
|
70
|
-
</label>
|
|
71
|
-
|
|
72
|
-
<input
|
|
73
|
-
id="scheduled-task-active-switch-input"
|
|
74
|
-
v-model="model.toggle"
|
|
75
|
-
data-id="scheduled-task-active-switch-input"
|
|
76
|
-
type="checkbox"
|
|
77
|
-
class="switch"
|
|
78
|
-
/>
|
|
79
|
-
</div>
|
|
80
|
-
|
|
81
81
|
<div class="clr-form-control clr-row email">
|
|
82
82
|
<label class="clr-control-label clr-col-md-3">
|
|
83
83
|
{{ localization.common.emailNotificationUponCompletion }}
|
|
@@ -133,6 +133,11 @@ const frequencyMethodOptions = computed<UI_I_SelectInputItem[]>(() =>
|
|
|
133
133
|
@include flex($dir: row);
|
|
134
134
|
margin-top: 0;
|
|
135
135
|
margin-bottom: 12px;
|
|
136
|
+
&.switch {
|
|
137
|
+
.clr-control-label {
|
|
138
|
+
text-transform: capitalize;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
136
141
|
.clr-control-label {
|
|
137
142
|
width: 100%;
|
|
138
143
|
padding: 0 12px;
|
|
@@ -179,7 +184,7 @@ const frequencyMethodOptions = computed<UI_I_SelectInputItem[]>(() =>
|
|
|
179
184
|
}
|
|
180
185
|
}
|
|
181
186
|
}
|
|
182
|
-
|
|
187
|
+
/* TODO нужно перенести в глобально */
|
|
183
188
|
input[type='checkbox'] {
|
|
184
189
|
--active: var(--checkbox-value-active-color);
|
|
185
190
|
--active-inner: var(--checkbox-mark-color);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { UI_I_ArbitraryObject } from '~/lib/models/interfaces'
|
|
2
|
+
export const enumKeyFromValue = (
|
|
3
|
+
enumObj: UI_I_ArbitraryObject<string | number>,
|
|
4
|
+
value: string
|
|
5
|
+
): string | undefined => {
|
|
6
|
+
// Преобразуем enum в массив пар [ключ, значение] и находим нужную пару
|
|
7
|
+
const dataFromEnum = Object.entries(enumObj).find(([_, val]) => val === value)
|
|
8
|
+
|
|
9
|
+
// Возвращаем ключ, если найдена пара, иначе undefined
|
|
10
|
+
return dataFromEnum ? dataFromEnum[0] : undefined
|
|
11
|
+
}
|