55 :style =" inlineFieldsContainerStyle"
66 >
77 <div
8- v-if =" (!showField && !settings.fieldOnly) || settings. cardField"
8+ v-if =" (!showField && !settings.fieldOnly) || cardField"
99 :class =" displayContainerClass"
1010 @click =" settings.cell ? toggleField() : undefined"
1111 >
4444 </div >
4545
4646 <div
47- v-if =" showField || settings. fieldOnly || settings. cardField"
47+ v-if =" showField || fieldOnly || cardField"
4848 :class =" fieldContainerClass"
4949 >
5050 <Teleport
51- :disabled =" !settings. cardField"
51+ :disabled =" !cardField"
5252 :to =" cardFieldRef"
5353 >
5454 <v-checkbox
5555 v-bind =" bindingSettings"
56- :color =" settings. color"
56+ :color =" color"
5757 :density =" settings.density"
58- :disabled =" loadingProp || disabledProp "
58+ :disabled =" loadingProp || disabled "
5959 :error =" error"
6060 :false-icon =" theFalseIcon"
6161 :false-value =" settings.falseValue"
62- :hide-details =" settings. hideDetails"
62+ :hide-details =" hideDetails"
6363 :label =" settings.label"
6464 :model-value =" truthyModelValue"
6565 :true-icon =" theTrueIcon"
8282 #append
8383 >
8484 <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"
9191 :error =" error"
92- :field-only =" settings. fieldOnly"
93- :hide-cancel-icon =" settings. hideCancelIcon"
92+ :field-only =" fieldOnly"
93+ :hide-cancel-icon =" hideCancelIcon"
9494 :hide-save-icon =" true"
9595 :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"
104104 @close =" closeField"
105105 @save =" saveValue"
106106 />
111111
112112 <!-- Card Field-->
113113 <div
114- v-if =" settings. cardField"
114+ v-if =" cardField"
115115 :class =" cardContainerClass"
116116 :style =" cardContainerStyle"
117117 >
@@ -175,8 +175,30 @@ const theme = useTheme();
175175
176176const props = withDefaults (defineProps <VInlineCheckboxProps >(), { ... checkboxProps });
177177let 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 );
178201const loadingProp = computed (() => props .loading );
179- const disabledProp = computed (() => props .disabled );
180202
181203const error = ref <boolean >(false );
182204const showField = ref <boolean >(false );
@@ -231,7 +253,7 @@ const truthyModelValue = computed(() => useTruthyModelValue({
231253const inlineFieldsContainerClass = computed (() => useInlineFieldsContainerClass ({
232254 cell: settings .cell && ! showField .value ,
233255 density: settings .density ,
234- disabled: disabledProp .value ,
256+ disabled: disabled .value ,
235257 field: ' v-checkbox' ,
236258 loading: loadingProp .value ,
237259 loadingWait: settings .loadingWait ,
@@ -311,7 +333,7 @@ watch(() => windowSize, () => {
311333
312334// ------------------------------------------------ Toggle the field //
313335function toggleField() {
314- if (disabledProp .value || (settings .loadingWait && loadingProp .value )) {
336+ if (disabled .value || (settings .loadingWait && loadingProp .value )) {
315337 return ;
316338 }
317339
@@ -326,7 +348,7 @@ function toggleField() {
326348
327349 const response = useToggleField ({
328350 attrs ,
329- closeSiblings: settings . closeSiblings ,
351+ closeSiblings: closeSiblings . value ,
330352 fieldOnly: settings .fieldOnly ,
331353 props ,
332354 showField ,
@@ -337,7 +359,7 @@ function toggleField() {
337359 showField .value = response .showField ;
338360 timeOpened .value = response .timeOpened ;
339361
340- if (closeSiblingsBus !== null && settings . closeSiblings && showField .value && ! settings .fieldOnly ) {
362+ if (closeSiblingsBus !== null && closeSiblings . value && showField .value && ! settings .fieldOnly ) {
341363 closeSiblingsBus .emit (response .timeOpened );
342364 }
343365}
@@ -361,7 +383,7 @@ function saveValue(value: any) {
361383let closeSiblingsBus: unknown | any ;
362384let unsubscribeBus: () => void ;
363385
364- if (settings . closeSiblings ) {
386+ if (closeSiblings . value ) {
365387 import (' @vueuse/core' ).then (({ useEventBus }) => {
366388 closeSiblingsBus = useEventBus (CloseSiblingsBus );
367389 unsubscribeBus = closeSiblingsBus .on (closeSiblingsListener );
0 commit comments