hongluan-ui
Version:
Hongluan Component Library for Vue 3
77 lines (74 loc) • 1.78 kB
JavaScript
import '../../../constants/index.mjs';
import '../../../utils/index.mjs';
import '../../../hooks/index.mjs';
import { isValidComponentType, isValidComponentSize } from '../../../utils/vue/validator.mjs';
import { useAriaProps } from '../../../hooks/use-aria/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 = {
modelValue: {
type: [Boolean, String, Number],
default: false
},
value: {
type: [Boolean, String, Number],
default: false
},
disabled: Boolean,
type: {
type: String,
validator: isValidComponentType
},
size: {
type: String,
validator: isValidComponentSize
},
width: String,
activeColor: {
type: String,
default: ""
},
inactiveColor: {
type: String,
default: ""
},
borderColor: {
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
},
id: String,
loading: Boolean,
beforeChange: Function,
tabindex: {
type: [String, Number]
},
label: {
type: String,
default: void 0
},
...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)
};
export { switchEmits, switchProps };
//# sourceMappingURL=switch2.mjs.map