UNPKG

@vuesax-alpha/nightly

Version:
54 lines (51 loc) 1.38 kB
import '../../../utils/index.mjs'; import '../../../hooks/index.mjs'; import '../../../constants/index.mjs'; import { buildProps } from '../../../utils/vue/props/runtime.mjs'; import { useColorProp } from '../../../hooks/use-common-props/index.mjs'; import { UPDATE_MODEL_EVENT, CHANGE_EVENT, INPUT_EVENT } from '../../../constants/event.mjs'; import { isBoolean, isNumber } from '../../../utils/types.mjs'; import { isString } from '@vue/shared'; const switchProps = buildProps({ color: useColorProp, modelValue: { type: [Boolean, String, Number], default: false }, activeValue: { type: [Boolean, String, Number], default: true }, inactiveValue: { type: [Boolean, String, Number], default: false }, disabled: { type: Boolean, default: false }, loading: { type: Boolean, default: false }, shape: { type: String, values: ["square"], default: null }, indeterminate: { type: Boolean, default: false }, icon: { type: Boolean, default: false } }); const switchEmits = { [UPDATE_MODEL_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val), [CHANGE_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val), [INPUT_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val) }; export { switchEmits, switchProps }; //# sourceMappingURL=switch.mjs.map