You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
97 lines
2.0 KiB
97 lines
2.0 KiB
|
2 years ago
|
import '../../../utils/index.mjs';
|
||
|
|
import '../../../constants/index.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 { 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({
|
||
|
|
modelValue: {
|
||
|
|
type: [Boolean, String, Number],
|
||
|
|
default: false
|
||
|
|
},
|
||
|
|
value: {
|
||
|
|
type: [Boolean, String, Number],
|
||
|
|
default: false
|
||
|
|
},
|
||
|
|
disabled: {
|
||
|
|
type: Boolean,
|
||
|
|
default: false
|
||
|
|
},
|
||
|
|
width: {
|
||
|
|
type: [String, Number],
|
||
|
|
default: ""
|
||
|
|
},
|
||
|
|
inlinePrompt: {
|
||
|
|
type: Boolean,
|
||
|
|
default: false
|
||
|
|
},
|
||
|
|
activeIcon: {
|
||
|
|
type: iconPropType
|
||
|
|
},
|
||
|
|
inactiveIcon: {
|
||
|
|
type: iconPropType
|
||
|
|
},
|
||
|
|
activeText: {
|
||
|
|
type: String,
|
||
|
|
default: ""
|
||
|
|
},
|
||
|
|
inactiveText: {
|
||
|
|
type: String,
|
||
|
|
default: ""
|
||
|
|
},
|
||
|
|
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: {
|
||
|
|
type: Boolean,
|
||
|
|
default: false
|
||
|
|
},
|
||
|
|
beforeChange: {
|
||
|
|
type: definePropType(Function)
|
||
|
|
},
|
||
|
|
size: {
|
||
|
|
type: String,
|
||
|
|
validator: isValidComponentSize
|
||
|
|
},
|
||
|
|
tabindex: {
|
||
|
|
type: [String, Number]
|
||
|
|
}
|
||
|
|
});
|
||
|
|
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
|