5
5
:style =" inlineFieldsContainerStyle"
6
6
>
7
7
<div
8
- v-if =" (!showField && !settings.fieldOnly) || settings. cardField"
8
+ v-if =" (!showField && !settings.fieldOnly) || cardField"
9
9
:class =" displayContainerClass"
10
10
@click =" settings.cell ? toggleField() : undefined"
11
11
>
44
44
</div >
45
45
46
46
<div
47
- v-if =" showField || settings. fieldOnly || settings. cardField"
47
+ v-if =" showField || fieldOnly || cardField"
48
48
:class =" fieldContainerClass"
49
49
>
50
50
<Teleport
51
- :disabled =" !settings. cardField"
51
+ :disabled =" !cardField"
52
52
:to =" cardFieldRef"
53
53
>
54
54
<v-checkbox
55
55
v-bind =" bindingSettings"
56
- :color =" settings. color"
56
+ :color =" color"
57
57
:density =" settings.density"
58
- :disabled =" loadingProp || disabledProp "
58
+ :disabled =" loadingProp || disabled "
59
59
:error =" error"
60
60
:false-icon =" theFalseIcon"
61
61
:false-value =" settings.falseValue"
62
- :hide-details =" settings. hideDetails"
62
+ :hide-details =" hideDetails"
63
63
:label =" settings.label"
64
64
:model-value =" truthyModelValue"
65
65
:true-icon =" theTrueIcon"
82
82
#append
83
83
>
84
84
<SaveFieldButtons
85
- :cancel-button-color =" settings. cancelButtonColor"
86
- :cancel-button-size =" settings. cancelButtonSize"
87
- :cancel-button-title =" settings. cancelButtonTitle"
88
- :cancel-button-variant =" settings. cancelButtonVariant"
89
- :cancel-icon =" settings. cancelIcon"
90
- :cancel-icon-color =" settings. cancelIconColor"
85
+ :cancel-button-color =" cancelButtonColor"
86
+ :cancel-button-size =" cancelButtonSize"
87
+ :cancel-button-title =" cancelButtonTitle"
88
+ :cancel-button-variant =" cancelButtonVariant"
89
+ :cancel-icon =" cancelIcon"
90
+ :cancel-icon-color =" cancelIconColor"
91
91
:error =" error"
92
- :field-only =" settings. fieldOnly"
93
- :hide-cancel-icon =" settings. hideCancelIcon"
92
+ :field-only =" fieldOnly"
93
+ :hide-cancel-icon =" hideCancelIcon"
94
94
:hide-save-icon =" true"
95
95
:loading =" loadingProp"
96
- :loading-icon =" settings. loadingIcon"
97
- :loading-icon-color =" settings. loadingIconColor"
98
- :save-button-color =" settings. saveButtonColor"
99
- :save-button-size =" settings. saveButtonSize"
100
- :save-button-title =" settings. saveButtonTitle"
101
- :save-button-variant =" settings. saveButtonVariant"
102
- :save-icon =" settings. saveIcon"
103
- :save-icon-color =" settings. saveIconColor"
96
+ :loading-icon =" loadingIcon"
97
+ :loading-icon-color =" loadingIconColor"
98
+ :save-button-color =" saveButtonColor"
99
+ :save-button-size =" saveButtonSize"
100
+ :save-button-title =" saveButtonTitle"
101
+ :save-button-variant =" saveButtonVariant"
102
+ :save-icon =" saveIcon"
103
+ :save-icon-color =" saveIconColor"
104
104
@close =" closeField"
105
105
@save =" saveValue"
106
106
/>
111
111
112
112
<!-- Card Field-->
113
113
<div
114
- v-if =" settings. cardField"
114
+ v-if =" cardField"
115
115
:class =" cardContainerClass"
116
116
:style =" cardContainerStyle"
117
117
>
@@ -175,8 +175,30 @@ const theme = useTheme();
175
175
176
176
const props = withDefaults (defineProps <VInlineCheckboxProps >(), { ... checkboxProps });
177
177
let settings = reactive ({ ... attrs , ... props , ... injectedOptions });
178
+
179
+ const { cancelButtonColor,
180
+ cancelButtonSize,
181
+ cancelButtonTitle,
182
+ cancelButtonVariant,
183
+ cancelIcon,
184
+ cancelIconColor,
185
+ cardField,
186
+ closeSiblings,
187
+ color,
188
+ fieldOnly,
189
+ hideCancelIcon,
190
+ hideDetails,
191
+ loadingIcon,
192
+ loadingIconColor,
193
+ saveButtonColor,
194
+ saveButtonSize,
195
+ saveButtonTitle,
196
+ saveButtonVariant,
197
+ saveIcon,
198
+ saveIconColor } = toRefs (settings );
199
+
200
+ const disabled = computed (() => props .disabled );
178
201
const loadingProp = computed (() => props .loading );
179
- const disabledProp = computed (() => props .disabled );
180
202
181
203
const error = ref <boolean >(false );
182
204
const showField = ref <boolean >(false );
@@ -231,7 +253,7 @@ const truthyModelValue = computed(() => useTruthyModelValue({
231
253
const inlineFieldsContainerClass = computed (() => useInlineFieldsContainerClass ({
232
254
cell: settings .cell && ! showField .value ,
233
255
density: settings .density ,
234
- disabled: disabledProp .value ,
256
+ disabled: disabled .value ,
235
257
field: ' v-checkbox' ,
236
258
loading: loadingProp .value ,
237
259
loadingWait: settings .loadingWait ,
@@ -311,7 +333,7 @@ watch(() => windowSize, () => {
311
333
312
334
// ------------------------------------------------ Toggle the field //
313
335
function toggleField() {
314
- if (disabledProp .value || (settings .loadingWait && loadingProp .value )) {
336
+ if (disabled .value || (settings .loadingWait && loadingProp .value )) {
315
337
return ;
316
338
}
317
339
@@ -326,7 +348,7 @@ function toggleField() {
326
348
327
349
const response = useToggleField ({
328
350
attrs ,
329
- closeSiblings: settings . closeSiblings ,
351
+ closeSiblings: closeSiblings . value ,
330
352
fieldOnly: settings .fieldOnly ,
331
353
props ,
332
354
showField ,
@@ -337,7 +359,7 @@ function toggleField() {
337
359
showField .value = response .showField ;
338
360
timeOpened .value = response .timeOpened ;
339
361
340
- if (closeSiblingsBus !== null && settings . closeSiblings && showField .value && ! settings .fieldOnly ) {
362
+ if (closeSiblingsBus !== null && closeSiblings . value && showField .value && ! settings .fieldOnly ) {
341
363
closeSiblingsBus .emit (response .timeOpened );
342
364
}
343
365
}
@@ -361,7 +383,7 @@ function saveValue(value: any) {
361
383
let closeSiblingsBus: unknown | any ;
362
384
let unsubscribeBus: () => void ;
363
385
364
- if (settings . closeSiblings ) {
386
+ if (closeSiblings . value ) {
365
387
import (' @vueuse/core' ).then (({ useEventBus }) => {
366
388
closeSiblingsBus = useEventBus (CloseSiblingsBus );
367
389
unsubscribeBus = closeSiblingsBus .on (closeSiblingsListener );
0 commit comments