hongluan-ui
Version:
Hongluan Component Library for Vue 3
114 lines (111 loc) • 2.72 kB
JavaScript
import '../../../utils/index.mjs';
import '../../../constants/index.mjs';
import '../../collection/index.mjs';
import '../../tooltip/index.mjs';
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
import { useTooltipTriggerProps } from '../../tooltip/src/trigger.mjs';
import { useTooltipContentProps } from '../../tooltip/src/content2.mjs';
import { EVENT_CODE } from '../../../constants/aria.mjs';
import { createCollectionWithScope } from '../../collection/src/collection2.mjs';
const dropdownProps = buildProps({
trigger: useTooltipTriggerProps.trigger,
effect: {
...useTooltipContentProps.effect,
default: "light"
},
popperAppendToBody: {
type: Boolean,
default: void 0
},
teleported: useTooltipContentProps.teleported,
type: {
type: definePropType(String)
},
placement: {
type: definePropType(String),
default: "bottom"
},
popperOptions: {
type: definePropType(Object),
default: () => ({})
},
id: String,
size: {
type: String,
default: ""
},
split: {
type: definePropType(String),
default: ""
},
hideOnClick: {
type: Boolean,
default: true
},
loop: {
type: Boolean,
default: true
},
showTimeout: {
type: Number,
default: 150
},
hideTimeout: {
type: Number,
default: 150
},
tabindex: {
type: definePropType([Number, String]),
default: 0
},
maxHeight: {
type: definePropType([Number, String]),
default: ""
},
popperClass: {
type: String,
default: ""
},
popperOffset: {
type: Number,
default: 4
},
disabled: {
type: Boolean,
default: false
},
role: {
type: String,
default: "menu"
},
buttonProps: {
type: definePropType(Object)
}
});
const dropdownItemProps = buildProps({
command: {
type: [Object, String, Number],
default: () => ({})
},
disabled: Boolean,
divider: Boolean,
textValue: String
});
const dropdownMenuProps = buildProps({
onKeydown: { type: definePropType(Function) }
});
const FIRST_KEYS = [
EVENT_CODE.down,
EVENT_CODE.pageDown,
EVENT_CODE.home
];
const LAST_KEYS = [EVENT_CODE.up, EVENT_CODE.pageUp, EVENT_CODE.end];
const FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS];
const {
HlCollection,
HlCollectionItem,
COLLECTION_INJECTION_KEY,
COLLECTION_ITEM_INJECTION_KEY
} = createCollectionWithScope("Dropdown");
export { COLLECTION_INJECTION_KEY as DROPDOWN_COLLECTION_INJECTION_KEY, COLLECTION_ITEM_INJECTION_KEY as DROPDOWN_COLLECTION_ITEM_INJECTION_KEY, FIRST_KEYS, FIRST_LAST_KEYS, HlCollection, HlCollectionItem, LAST_KEYS, dropdownItemProps, dropdownMenuProps, dropdownProps };
//# sourceMappingURL=dropdown2.mjs.map