UNPKG

yanzhen-design-vue

Version:

49 lines (48 loc) 1.34 kB
import { propsSeparate, defineCommonPropType, epPropType, definePropType, buildProps } from "@yanzhen-libs/utils-vue"; import { switchProps as switchProps$1 } from "ant-design-vue/es/switch"; import { mergeWith } from "@yanzhen-libs/utils"; import "../../../hooks/index.mjs"; import { useNamespace } from "../../../hooks/use-namespace/index.mjs"; const ns = useNamespace("switch"); const switchOptions = { ns, class: ns.b(), name: ns.defineVNodeName() }; const switchName = switchOptions.name; const AntSwitchProps = propsSeparate({ ...switchProps$1(), size: defineCommonPropType(["default", "small"], String), checkedChildren: epPropType.any, unCheckedChildren: epPropType.any, tabindex: definePropType([String, Number]), checked: definePropType([String, Number, Boolean]), checkedValue: { type: definePropType([String, Number, Boolean]), default: true }, unCheckedValue: { type: definePropType([String, Number, Boolean]), default: false } }); const switchProps = buildProps({ ...AntSwitchProps.props, value: AntSwitchProps.props["checked"], activeColor: String }); const switchEmits = mergeWith( { ...AntSwitchProps.emits }, { "update:value": AntSwitchProps.emits["update:checked"] } ); export { AntSwitchProps, switchEmits, switchName, switchOptions, switchProps };