tdesign-vue-next
Version:
TDesign Component for vue-next
35 lines (29 loc) • 1.59 kB
JavaScript
/**
* tdesign v1.11.5
* (c) 2025 tdesign
* @license MIT
*/
;
Object.defineProperty(exports, '__esModule', { value: true });
var Vue = require('vue');
var isBoolean = require('../_chunks/dep-82a90f9f.js');
require('../_chunks/dep-bbe343d7.js');
require('@babel/runtime/helpers/typeof');
require('../_chunks/dep-0c2ad01b.js');
function useDisabled(context) {
var currentInstance = Vue.getCurrentInstance();
var componentDisabled = Vue.computed(function () {
return currentInstance.props.disabled;
});
var formDisabled = Vue.inject("formDisabled", /* @__PURE__ */Object.create(null));
return Vue.computed(function () {
var _context$beforeDisabl, _context$afterDisable, _formDisabled$disable;
if (isBoolean.isBoolean(context === null || context === void 0 || (_context$beforeDisabl = context.beforeDisabled) === null || _context$beforeDisabl === void 0 ? void 0 : _context$beforeDisabl.value)) return context.beforeDisabled.value;
if (isBoolean.isBoolean(componentDisabled.value)) return componentDisabled.value;
if (isBoolean.isBoolean(context === null || context === void 0 || (_context$afterDisable = context.afterDisabled) === null || _context$afterDisable === void 0 ? void 0 : _context$afterDisable.value)) return context.afterDisabled.value;
if (isBoolean.isBoolean((_formDisabled$disable = formDisabled.disabled) === null || _formDisabled$disable === void 0 ? void 0 : _formDisabled$disable.value)) return formDisabled.disabled.value;
return false;
});
}
exports.useDisabled = useDisabled;
//# sourceMappingURL=useDisabled.js.map