UNPKG

xdesign-vue-next

Version:

XDesign Component for vue-next

32 lines (28 loc) 1.29 kB
/** * xdesign v1.0.6 * (c) 2023 xdesign * @license MIT */ import { getCurrentInstance, computed, inject } from 'vue'; import { i as isBoolean_1 } from '../_chunks/dep-b9fae426.mjs'; import '../_chunks/dep-10a947a6.mjs'; import '../_chunks/dep-b75d8d74.mjs'; import '../_chunks/dep-82805301.mjs'; import '../_chunks/dep-addc2a84.mjs'; function useDisabled(context) { var currentInstance = getCurrentInstance(); var componentDisabled = computed(function () { return currentInstance.props.disabled; }); var formDisabled = inject("formDisabled", /* @__PURE__ */Object.create(null)); return computed(function () { var _formDisabled$disable; if (isBoolean_1(context === null || context === void 0 ? void 0 : context.beforeDisabled.value)) return context.beforeDisabled.value; if (isBoolean_1(componentDisabled.value)) return componentDisabled.value; if (isBoolean_1(context === null || context === void 0 ? void 0 : context.afterDisabled.value)) return context.afterDisabled.value; if (isBoolean_1((_formDisabled$disable = formDisabled.disabled) === null || _formDisabled$disable === void 0 ? void 0 : _formDisabled$disable.value)) return formDisabled.disabled.value; return false; }); } export { useDisabled }; //# sourceMappingURL=useDisabled.mjs.map