hongluan-ui
Version:
Hongluan Component Library for Vue 3
102 lines (99 loc) • 2.29 kB
JavaScript
import { NOOP, isString, isObject } from '@vue/shared';
import '../../../utils/index.mjs';
import '../../tooltip/index.mjs';
import '../../../constants/index.mjs';
import '../../../hooks/index.mjs';
import { useTooltipContentProps } from '../../tooltip/src/content2.mjs';
import { isValidComponentSize } from '../../../utils/vue/validator.mjs';
import { useAriaProps } from '../../../hooks/use-aria/index.mjs';
import { UPDATE_MODEL_EVENT, INPUT_EVENT, CHANGE_EVENT } from '../../../constants/event.mjs';
const autocompleteProps = {
valueKey: {
type: String,
default: "value"
},
modelValue: {
type: [String, Number],
default: ""
},
debounce: {
type: Number,
default: 300
},
placement: {
type: String,
validator: (val) => {
return ["top", "top-start", "top-end", "bottom", "bottom-start", "bottom-end"].includes(val);
},
default: "bottom-start"
},
fetchSuggestions: {
type: [Function, Array],
default: NOOP
},
popperClass: {
type: String,
default: ""
},
triggerOnFocus: {
type: Boolean,
default: true
},
selectWhenUnmatched: {
type: Boolean,
default: false
},
hideLoading: {
type: Boolean,
default: false
},
popperAppendToBody: {
type: Boolean,
default: void 0
},
teleported: useTooltipContentProps.teleported,
highlightFirstItem: {
type: Boolean,
default: false
},
block: {
type: Boolean,
default: false
},
size: {
type: String,
validator: isValidComponentSize
},
clearable: {
type: Boolean,
default: false
},
disabled: Boolean,
fill: Boolean,
thin: Boolean,
popperOffset: {
type: Number,
default: 4
},
fitInputWidth: {
type: Boolean,
default: false
},
transition: {
type: String,
default: "dropdown"
},
name: String,
...useAriaProps(["ariaLabel"])
};
const autocompleteEmits = {
[UPDATE_MODEL_EVENT]: (value) => isString(value),
[INPUT_EVENT]: (value) => isString(value),
[CHANGE_EVENT]: (value) => isString(value),
focus: (evt) => evt instanceof FocusEvent,
blur: (evt) => evt instanceof FocusEvent,
clear: () => true,
select: (item) => isObject(item)
};
export { autocompleteEmits, autocompleteProps };
//# sourceMappingURL=autocomplete2.mjs.map