UNPKG

tdesign-mobile-vue

Version:
1 lines 3.66 kB
{"version":3,"file":"useCommonClassName.mjs","sources":["../../src/hooks/useCommonClassName.tsx"],"sourcesContent":["import { computed } from 'vue';\nimport { useConfig } from './useClass';\n\nexport function useCommonClassName() {\n const { classPrefix } = useConfig('classPrefix');\n\n return {\n classPrefix,\n SIZE: computed(() => ({\n small: `${classPrefix.value}-size-s`,\n medium: `${classPrefix.value}-size-m`,\n large: `${classPrefix.value}-size-l`,\n default: '',\n xs: `${classPrefix.value}-size-xs`,\n xl: `${classPrefix.value}-size-xl`,\n block: `${classPrefix.value}-size-full-width`,\n })),\n STATUS: computed(() => ({\n loading: `${classPrefix.value}-is-loading`,\n loadMore: `${classPrefix.value}-is-load-more`,\n disabled: `${classPrefix.value}-is-disabled`,\n focused: `${classPrefix.value}-is-focused`,\n success: `${classPrefix.value}-is-success`,\n error: `${classPrefix.value}-is-error`,\n warning: `${classPrefix.value}-is-warning`,\n selected: `${classPrefix.value}-is-selected`,\n active: `${classPrefix.value}-is-active`,\n checked: `${classPrefix.value}-is-checked`,\n current: `${classPrefix.value}-is-current`,\n hidden: `${classPrefix.value}-is-hidden`,\n visible: `${classPrefix.value}-is-visible`,\n expanded: `${classPrefix.value}-is-expanded`,\n indeterminate: `${classPrefix.value}-is-indeterminate`,\n })),\n };\n}\n\nexport type CommonClassNameType = ReturnType<typeof useCommonClassName>;\n"],"names":["useCommonClassName","_useConfig","useConfig","classPrefix","SIZE","computed","small","concat","value","medium","large","default","xs","xl","block","STATUS","loading","loadMore","disabled","focused","success","error","warning","selected","active","checked","current","hidden","visible","expanded","indeterminate"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAGO,SAASA,kBAAqBA,GAAA;AACnC,EAAA,IAAAC,UAAA,GAAwBC,SAAA,CAAU,aAAa,CAAA;IAAvCC,WAAA,GAAAF,UAAA,CAAAE,WAAA,CAAA;EAED,OAAA;AACLA,IAAAA,WAAA,EAAAA,WAAA;IACAC,IAAA,EAAMC,SAA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