| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- import { CHANGE_EVENT, INPUT_EVENT, UPDATE_MODEL_EVENT } from "../../../constants/event.mjs";
- import { isBoolean, isNumber, isString } from "../../../utils/types.mjs";
- import { buildProps, definePropType } from "../../../utils/vue/props/runtime.mjs";
- import { iconPropType } from "../../../utils/vue/icon.mjs";
- import { isValidComponentSize } from "../../../utils/vue/validator.mjs";
- import { useAriaProps } from "../../../hooks/use-aria/index.mjs";
- //#region ../../packages/components/switch/src/switch.ts
- /**
- * @deprecated Removed after 3.0.0, Use `SwitchProps` instead.
- */
- const switchProps = buildProps({
- modelValue: {
- type: [
- Boolean,
- String,
- Number
- ],
- default: false
- },
- disabled: {
- type: Boolean,
- default: void 0
- },
- loading: Boolean,
- size: {
- type: String,
- validator: isValidComponentSize
- },
- width: {
- type: [String, Number],
- default: ""
- },
- inlinePrompt: Boolean,
- inactiveActionIcon: { type: iconPropType },
- activeActionIcon: { type: iconPropType },
- activeIcon: { type: iconPropType },
- inactiveIcon: { type: iconPropType },
- activeText: {
- type: String,
- default: ""
- },
- inactiveText: {
- type: String,
- default: ""
- },
- activeValue: {
- type: [
- Boolean,
- String,
- Number
- ],
- default: true
- },
- inactiveValue: {
- type: [
- Boolean,
- String,
- Number
- ],
- default: false
- },
- name: {
- type: String,
- default: ""
- },
- validateEvent: {
- type: Boolean,
- default: true
- },
- beforeChange: { type: definePropType(Function) },
- id: String,
- tabindex: { type: [String, Number] },
- ...useAriaProps(["ariaLabel"])
- });
- 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)
- };
- //#endregion
- export { switchEmits, switchProps };
- //# sourceMappingURL=switch.mjs.map
|