{"version":3,"file":"index.mjs","sources":["../../../../components/form/hooks/index.ts"],"sourcesContent":["import { Ref, inject, computed, getCurrentInstance } from 'vue';\nimport { TdFormProps } from '../type';\n\nexport interface FormDisabledProvider {\n  disabled: Ref<TdFormProps['disabled']>;\n}\n\nexport interface FormReadonlyProvider {\n  readonly: Ref<TdFormProps['readonly']>;\n}\n\n/**\n * @deprecated use @tdesign/shared-hooks useDisabled instead\n */\nexport function useFormDisabled(extend?: Ref<boolean>) {\n  const ctx = getCurrentInstance();\n  const propsDisabled = computed(() => ctx.props.disabled as boolean);\n  const { disabled } = inject<FormDisabledProvider>('formDisabled', Object.create(null));\n  return computed(() => propsDisabled.value || disabled?.value || extend?.value || false);\n}\n"],"names":["useFormDisabled","extend","ctx","getCurrentInstance","propsDisabled","computed","props","disabled","_inject","inject","Object","create","value"],"mappings":";;;;;;;;AAcO,SAASA,gBAAgBC,MAAuB,EAAA;AACrD,EAAA,IAAMC,MAAMC,kBAAmB,EAAA,CAAA;EAC/B,IAAMC,aAAgB,GAAAC,QAAA,CAAS,YAAA;AAAA,IAAA,OAAMH,GAAA,CAAII,MAAMC,QAAmB,CAAA;GAAA,CAAA,CAAA;AAC5D,EAAA,IAAAC,OAAA,GAAeC,MAAA,CAA6B,+BAAuBC,MAAA,CAAAC,MAAA,CAAO,IAAI,CAAC,CAAA;IAA7EJ,mBAAAA;AACD,EAAA,OAAAF,QAAA,CAAS,YAAA;IAAA,OAAMD,aAAc,CAAAQ,KAAA,KAASL,aAAAA,IAAAA,IAAAA,+BAAAA,SAAUK,KAAS,CAAAX,KAAAA,MAAA,aAAAA,MAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAAA,MAAA,CAAQW,UAAS,KAAK,CAAA;GAAA,CAAA,CAAA;AACxF;;;;"}