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.

87 lines
2.2 KiB

import { EVENT_CODE } from '../../../utils/aria.mjs';
import { buildProps, definePropType } from '../../../utils/props.mjs';
import '../../collection/index.mjs';
import '../../tooltip/index.mjs';
import { useTooltipTriggerProps, useTooltipContentProps } from '../../tooltip/src/tooltip2.mjs';
import { createCollectionWithScope } from '../../collection/src/collection.mjs';
const dropdownProps = {
trigger: useTooltipTriggerProps.trigger,
effect: {
...useTooltipContentProps.effect,
default: "light"
},
...buildProps({
type: {
type: definePropType(String)
},
placement: {
type: definePropType(String),
default: "bottom"
},
size: {
type: String,
default: ""
},
splitButton: Boolean,
hideOnClick: {
type: Boolean,
default: true
},
loop: {
type: Boolean
},
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: ""
}
})
};
const dropdownItemProps = buildProps({
command: {
type: [Object, String, Number],
default: () => ({})
},
disabled: Boolean,
divided: Boolean,
textValue: String,
icon: {
type: definePropType([String, Object])
}
});
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 {
ElCollection,
ElCollectionItem,
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, ElCollection, ElCollectionItem, FIRST_KEYS, FIRST_LAST_KEYS, LAST_KEYS, dropdownItemProps, dropdownMenuProps, dropdownProps };
//# sourceMappingURL=dropdown.mjs.map