vue-devui 1.0.0-rc.1 → 1.0.0-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +149 -200
- package/alert/index.es.js +46 -15
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/auto-complete/index.es.js +8166 -287
- package/auto-complete/index.umd.js +29 -1
- package/auto-complete/style.css +1 -1
- package/avatar/index.es.js +153 -146
- package/avatar/index.umd.js +1 -1
- package/avatar/style.css +1 -1
- package/badge/index.es.js +29 -4
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.es.js +5726 -111
- package/button/index.umd.js +27 -1
- package/button/style.css +1 -1
- package/card/index.es.js +59 -35
- package/card/index.umd.js +1 -1
- package/card/style.css +1 -1
- package/checkbox/index.es.js +8060 -255
- package/checkbox/index.umd.js +27 -1
- package/checkbox/style.css +1 -1
- package/{accordion → collapse}/index.d.ts +0 -0
- package/collapse/index.es.js +379 -0
- package/collapse/index.umd.js +1 -0
- package/{anchor → collapse}/package.json +1 -1
- package/collapse/style.css +1 -0
- package/countdown/index.es.js +3 -6
- package/countdown/index.umd.js +1 -1
- package/date-picker/index.es.js +8130 -242
- package/date-picker/index.umd.js +27 -1
- package/date-picker/style.css +1 -1
- package/drawer/index.es.js +31 -4
- package/drawer/index.umd.js +1 -1
- package/drawer/style.css +1 -1
- package/dropdown/index.es.js +209 -148
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/index.es.js +521 -153
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.es.js +1040 -1187
- package/form/index.umd.js +16 -16
- package/form/style.css +1 -1
- package/fullscreen/index.es.js +29 -5
- package/fullscreen/index.umd.js +1 -1
- package/fullscreen/style.css +1 -1
- package/grid/index.es.js +101 -86
- package/grid/index.umd.js +1 -1
- package/grid/style.css +1 -1
- package/icon/index.es.js +182 -23
- package/icon/index.umd.js +1 -1
- package/icon/style.css +1 -0
- package/image-preview/index.es.js +53 -30
- package/image-preview/index.umd.js +1 -1
- package/image-preview/style.css +1 -1
- package/input/index.es.js +8066 -144
- package/input/index.umd.js +27 -1
- package/input/style.css +1 -1
- package/input-number/index.es.js +274 -177
- package/input-number/index.umd.js +1 -1
- package/input-number/style.css +1 -1
- package/layout/index.es.js +40 -25
- package/layout/index.umd.js +1 -1
- package/layout/style.css +1 -1
- package/loading/index.es.js +74 -35
- package/loading/index.umd.js +1 -1
- package/loading/style.css +1 -1
- package/modal/index.es.js +374 -171
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +292 -40
- package/notification/index.umd.js +1 -1
- package/notification/style.css +1 -1
- package/nuxt/components/ButtonGroup.js +3 -0
- package/nuxt/components/CheckboxButton.js +3 -0
- package/nuxt/components/CheckboxGroup.js +3 -0
- package/nuxt/components/Collapse.js +3 -0
- package/nuxt/components/CollapseItem.js +3 -0
- package/nuxt/components/DropdownPropsKey.js +3 -0
- package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
- package/nuxt/components/FORM_TOKEN.js +3 -0
- package/nuxt/components/Icon.js +1 -0
- package/nuxt/components/IconGroup.js +3 -0
- package/nuxt/components/LABEL_DATA.js +3 -0
- package/nuxt/components/LoadingOptions.js +3 -0
- package/nuxt/components/Option.js +3 -0
- package/nuxt/components/RadioButton.js +3 -0
- package/nuxt/components/Tab.js +3 -0
- package/nuxt/components/autoCompleteProps.js +3 -0
- package/nuxt/components/avatarProps.js +3 -0
- package/nuxt/components/buttonGroupInjectionKey.js +3 -0
- package/nuxt/components/buttonGroupProps.js +3 -0
- package/nuxt/components/cardProps.js +3 -0
- package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
- package/nuxt/components/checkboxGroupProps.js +3 -0
- package/nuxt/components/checkboxProps.js +3 -0
- package/nuxt/components/colProps.js +3 -0
- package/nuxt/components/colPropsBaseClass.js +3 -0
- package/nuxt/components/colPropsBaseStyle.js +3 -0
- package/nuxt/components/collapseItemProps.js +3 -0
- package/nuxt/components/collapseProps.js +3 -0
- package/nuxt/components/countdownProps.js +3 -0
- package/nuxt/components/editableSelectProps.js +3 -0
- package/nuxt/components/formItemProps.js +3 -0
- package/nuxt/components/formProps.js +3 -0
- package/nuxt/components/iconProps.js +1 -0
- package/nuxt/components/imagePreviewProps.js +3 -0
- package/nuxt/components/inputProps.js +3 -0
- package/nuxt/components/loadingProps.js +3 -0
- package/nuxt/components/modalProps.js +3 -0
- package/nuxt/components/progressProps.js +3 -0
- package/nuxt/components/rateProps.js +3 -0
- package/nuxt/components/resultProps.js +3 -0
- package/nuxt/components/rowProps.js +3 -0
- package/nuxt/components/screenSizes.js +3 -0
- package/nuxt/components/skeletonProps.js +3 -0
- package/nuxt/components/sliderProps.js +3 -0
- package/nuxt/components/splitterProps.js +3 -0
- package/nuxt/components/statisticProps.js +3 -0
- package/nuxt/components/svgIconProps.js +3 -0
- package/nuxt/components/switchProps.js +3 -0
- package/nuxt/components/tabsProps.js +3 -0
- package/nuxt/components/tagProps.js +3 -0
- package/nuxt/components/textareaProps.js +3 -0
- package/nuxt/components/timeAxisProps.js +3 -0
- package/nuxt/components/treeProps.js +3 -0
- package/overlay/index.es.js +104 -133
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +3 -2
- package/pagination/index.es.js +148 -136
- package/pagination/index.umd.js +1 -1
- package/pagination/style.css +1 -1
- package/panel/style.css +1 -1
- package/popover/index.es.js +294 -230
- package/popover/index.umd.js +15 -15
- package/popover/style.css +1 -1
- package/progress/index.es.js +110 -56
- package/progress/index.umd.js +3 -3
- package/progress/style.css +1 -1
- package/radio/index.es.js +7959 -146
- package/radio/index.umd.js +27 -1
- package/radio/style.css +1 -1
- package/rate/index.es.js +77 -55
- package/rate/index.umd.js +1 -1
- package/rate/style.css +1 -1
- package/result/index.es.js +169 -27
- package/result/index.umd.js +1 -1
- package/result/style.css +1 -1
- package/ripple/index.es.js +43 -42
- package/ripple/index.umd.js +1 -1
- package/search/index.es.js +3620 -1095
- package/search/index.umd.js +18 -18
- package/search/style.css +1 -1
- package/select/index.es.js +9131 -584
- package/select/index.umd.js +27 -1
- package/select/style.css +1 -1
- package/skeleton/index.es.js +46 -24
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.es.js +108 -75
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.es.js +443 -335
- package/splitter/index.umd.js +15 -15
- package/splitter/style.css +1 -1
- package/statistic/index.es.js +7 -18
- package/statistic/index.umd.js +1 -1
- package/status/index.es.js +26 -2
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- package/style.css +1 -1
- package/switch/index.es.js +7794 -64
- package/switch/index.umd.js +27 -1
- package/switch/style.css +1 -1
- package/table/index.es.js +10038 -1180
- package/table/index.umd.js +27 -1
- package/table/style.css +1 -1
- package/tabs/index.es.js +342 -141
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.es.js +47 -23
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/textarea/index.es.js +7913 -83
- package/textarea/index.umd.js +35 -1
- package/textarea/style.css +1 -1
- package/timeline/index.es.js +176 -37
- package/timeline/index.umd.js +1 -1
- package/timeline/style.css +1 -1
- package/tooltip/index.es.js +285 -220
- package/tooltip/index.umd.js +15 -15
- package/tooltip/style.css +1 -1
- package/tree/index.es.js +4190 -1857
- package/tree/index.umd.js +18 -18
- package/tree/style.css +1 -1
- package/upload/index.es.js +365 -106
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +20102 -25264
- package/vue-devui.umd.js +25 -15
- package/accordion/index.es.js +0 -723
- package/accordion/index.umd.js +0 -1
- package/accordion/package.json +0 -7
- package/accordion/style.css +0 -1
- package/anchor/index.d.ts +0 -7
- package/anchor/index.es.js +0 -263
- package/anchor/index.umd.js +0 -1
- package/anchor/style.css +0 -1
- package/back-top/index.d.ts +0 -7
- package/back-top/index.es.js +0 -130
- package/back-top/index.umd.js +0 -1
- package/back-top/package.json +0 -7
- package/back-top/style.css +0 -1
- package/breadcrumb/index.d.ts +0 -7
- package/breadcrumb/index.es.js +0 -128
- package/breadcrumb/index.umd.js +0 -1
- package/breadcrumb/package.json +0 -7
- package/breadcrumb/style.css +0 -1
- package/carousel/index.d.ts +0 -7
- package/carousel/index.es.js +0 -314
- package/carousel/index.umd.js +0 -1
- package/carousel/package.json +0 -7
- package/carousel/style.css +0 -1
- package/cascader/index.d.ts +0 -7
- package/cascader/index.es.js +0 -5971
- package/cascader/index.umd.js +0 -27
- package/cascader/package.json +0 -7
- package/cascader/style.css +0 -1
- package/color-picker/index.d.ts +0 -7
- package/color-picker/index.es.js +0 -8196
- package/color-picker/index.umd.js +0 -27
- package/color-picker/package.json +0 -7
- package/color-picker/style.css +0 -1
- package/comment/index.d.ts +0 -7
- package/comment/index.es.js +0 -86
- package/comment/index.umd.js +0 -1
- package/comment/package.json +0 -7
- package/comment/style.css +0 -1
- package/dragdrop/index.d.ts +0 -7
- package/dragdrop/index.es.js +0 -157
- package/dragdrop/index.umd.js +0 -1
- package/dragdrop/package.json +0 -7
- package/gantt/index.d.ts +0 -7
- package/gantt/index.es.js +0 -523
- package/gantt/index.umd.js +0 -1
- package/gantt/package.json +0 -7
- package/gantt/style.css +0 -1
- package/input-icon/index.d.ts +0 -7
- package/input-icon/index.es.js +0 -332
- package/input-icon/index.umd.js +0 -1
- package/input-icon/package.json +0 -7
- package/input-icon/style.css +0 -1
- package/list/index.d.ts +0 -7
- package/list/index.es.js +0 -39
- package/list/index.umd.js +0 -1
- package/list/package.json +0 -7
- package/list/style.css +0 -1
- package/nav-sprite/index.d.ts +0 -7
- package/nav-sprite/index.es.js +0 -68
- package/nav-sprite/index.umd.js +0 -1
- package/nav-sprite/package.json +0 -7
- package/nuxt/components/Accordion.js +0 -3
- package/nuxt/components/Anchor.js +0 -3
- package/nuxt/components/BackTop.js +0 -3
- package/nuxt/components/Breadcrumb.js +0 -3
- package/nuxt/components/Carousel.js +0 -3
- package/nuxt/components/CarouselItem.js +0 -3
- package/nuxt/components/Cascader.js +0 -3
- package/nuxt/components/ColorPicker.js +0 -3
- package/nuxt/components/Comment.js +0 -3
- package/nuxt/components/FormControl.js +0 -3
- package/nuxt/components/FormLabel.js +0 -3
- package/nuxt/components/Gantt.js +0 -3
- package/nuxt/components/InputIcon.js +0 -3
- package/nuxt/components/List.js +0 -3
- package/nuxt/components/ListItem.js +0 -3
- package/nuxt/components/NavSprite.js +0 -2
- package/nuxt/components/QuadrantDiagram.js +0 -3
- package/nuxt/components/ReadTip.js +0 -3
- package/nuxt/components/StepsGuide.js +0 -3
- package/nuxt/components/Sticky.js +0 -2
- package/nuxt/components/TagInput.js +0 -3
- package/nuxt/components/TimePicker.js +0 -3
- package/nuxt/components/Transfer.js +0 -3
- package/nuxt/components/TreeSelect.js +0 -3
- package/nuxt/components/overlayEmits.js +0 -3
- package/nuxt/components/overlayProps.js +0 -3
- package/quadrant-diagram/index.d.ts +0 -7
- package/quadrant-diagram/index.es.js +0 -5728
- package/quadrant-diagram/index.umd.js +0 -27
- package/quadrant-diagram/package.json +0 -7
- package/quadrant-diagram/style.css +0 -1
- package/read-tip/index.d.ts +0 -7
- package/read-tip/index.es.js +0 -261
- package/read-tip/index.umd.js +0 -1
- package/read-tip/package.json +0 -7
- package/read-tip/style.css +0 -1
- package/steps-guide/index.d.ts +0 -7
- package/steps-guide/index.es.js +0 -242
- package/steps-guide/index.umd.js +0 -1
- package/steps-guide/package.json +0 -7
- package/steps-guide/style.css +0 -1
- package/sticky/index.d.ts +0 -7
- package/sticky/index.es.js +0 -197
- package/sticky/index.umd.js +0 -1
- package/sticky/package.json +0 -7
- package/tag-input/index.d.ts +0 -7
- package/tag-input/index.es.js +0 -331
- package/tag-input/index.umd.js +0 -1
- package/tag-input/package.json +0 -7
- package/tag-input/style.css +0 -1
- package/time-picker/index.d.ts +0 -7
- package/time-picker/index.es.js +0 -1238
- package/time-picker/index.umd.js +0 -1
- package/time-picker/package.json +0 -7
- package/time-picker/style.css +0 -1
- package/transfer/index.d.ts +0 -7
- package/transfer/index.es.js +0 -7615
- package/transfer/index.umd.js +0 -27
- package/transfer/package.json +0 -7
- package/transfer/style.css +0 -1
- package/tree-select/index.d.ts +0 -7
- package/tree-select/index.es.js +0 -627
- package/tree-select/index.umd.js +0 -1
- package/tree-select/package.json +0 -7
- package/tree-select/style.css +0 -1
package/dropdown/index.es.js
CHANGED
|
@@ -17,8 +17,8 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { toRefs, watch, onMounted, onUnmounted, ref, computed, defineComponent, createVNode,
|
|
21
|
-
import {
|
|
20
|
+
import { toRefs, watch, onMounted, onUnmounted, ref, computed, defineComponent, createVNode, Transition, mergeProps, unref, nextTick, Comment, Text, h, Fragment, inject, withDirectives, cloneVNode, provide, Teleport, vShow } from "vue";
|
|
21
|
+
import { offset, autoPlacement, arrow, shift, computePosition } from "@floating-ui/dom";
|
|
22
22
|
import { onClickOutside } from "@vueuse/core";
|
|
23
23
|
const dropdownProps = {
|
|
24
24
|
visible: {
|
|
@@ -45,6 +45,9 @@ const dropdownProps = {
|
|
|
45
45
|
type: [Number, Object],
|
|
46
46
|
default: 4
|
|
47
47
|
},
|
|
48
|
+
shiftOffset: {
|
|
49
|
+
type: Number
|
|
50
|
+
},
|
|
48
51
|
closeOnMouseLeaveMenu: {
|
|
49
52
|
type: Boolean,
|
|
50
53
|
default: false
|
|
@@ -62,6 +65,7 @@ const dropdownProps = {
|
|
|
62
65
|
default: true
|
|
63
66
|
}
|
|
64
67
|
};
|
|
68
|
+
const POPPER_TRIGGER_TOKEN = Symbol("popper-trigger");
|
|
65
69
|
function getElement(element) {
|
|
66
70
|
if (element instanceof Element) {
|
|
67
71
|
return element;
|
|
@@ -107,7 +111,7 @@ const useDropdownEvent = ({ id, isOpen, origin, dropdownRef, props, emit }) => {
|
|
|
107
111
|
setTimeout(() => {
|
|
108
112
|
subscriptions.push(subscribeEvent(document, "click", (e) => {
|
|
109
113
|
const dropdownValues = [...dropdownMap.values()];
|
|
110
|
-
if (!isOpen.value || closeScope.value === "none" || dropdownEl.contains(e.target) && closeScope.value === "blank" || dropdownValues.some((item) => {
|
|
114
|
+
if (!isOpen.value || closeScope.value === "none" || (dropdownEl == null ? void 0 : dropdownEl.contains(e.target)) && closeScope.value === "blank" || dropdownValues.some((item) => {
|
|
111
115
|
var _a;
|
|
112
116
|
return (_a = item.toggleEl) == null ? void 0 : _a.contains(e.target);
|
|
113
117
|
}) && dropdownValues.some((item) => {
|
|
@@ -222,132 +226,109 @@ function useOverlayProps(props, currentPosition, isOpen) {
|
|
|
222
226
|
});
|
|
223
227
|
return { overlayModelValue, overlayShowValue, styles, classes, handlePositionChange };
|
|
224
228
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
228
|
-
}
|
|
229
|
-
const CommonOverlay = defineComponent({
|
|
230
|
-
setup(props, ctx) {
|
|
231
|
-
return () => {
|
|
232
|
-
let _slot;
|
|
233
|
-
return createVNode(Teleport, {
|
|
234
|
-
"to": "#d-overlay-anchor"
|
|
235
|
-
}, {
|
|
236
|
-
default: () => [createVNode(Transition, {
|
|
237
|
-
"name": "devui-overlay-fade"
|
|
238
|
-
}, _isSlot(_slot = renderSlot(ctx.slots, "default")) ? _slot : {
|
|
239
|
-
default: () => [_slot]
|
|
240
|
-
})]
|
|
241
|
-
});
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
|
-
const overlayProps = {
|
|
246
|
-
visible: {
|
|
247
|
-
type: Boolean
|
|
248
|
-
},
|
|
249
|
-
backgroundBlock: {
|
|
229
|
+
const fixedOverlayProps = {
|
|
230
|
+
modelValue: {
|
|
250
231
|
type: Boolean,
|
|
251
232
|
default: false
|
|
252
233
|
},
|
|
253
|
-
|
|
254
|
-
type: String,
|
|
255
|
-
default: ""
|
|
256
|
-
},
|
|
257
|
-
backgroundStyle: {
|
|
258
|
-
type: [String, Object]
|
|
259
|
-
},
|
|
260
|
-
onBackdropClick: {
|
|
261
|
-
type: Function
|
|
262
|
-
},
|
|
263
|
-
backdropClose: {
|
|
234
|
+
lockScroll: {
|
|
264
235
|
type: Boolean,
|
|
265
236
|
default: true
|
|
266
237
|
},
|
|
267
|
-
|
|
238
|
+
closeOnClickOverlay: {
|
|
268
239
|
type: Boolean,
|
|
269
240
|
default: true
|
|
270
241
|
}
|
|
271
242
|
};
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
243
|
+
function lockScroll() {
|
|
244
|
+
if (document.documentElement.scrollHeight > document.documentElement.clientHeight) {
|
|
245
|
+
const scrollTop = document.documentElement.scrollTop;
|
|
246
|
+
const style = document.documentElement.getAttribute("style");
|
|
247
|
+
document.documentElement.style.position = "fixed";
|
|
248
|
+
document.documentElement.style.top = `-${scrollTop}px`;
|
|
249
|
+
document.documentElement.style.width = document.documentElement.style.width || "100%";
|
|
250
|
+
document.documentElement.style.overflowY = "scroll";
|
|
251
|
+
return () => {
|
|
252
|
+
if (style) {
|
|
253
|
+
document.documentElement.setAttribute("style", style);
|
|
254
|
+
} else {
|
|
255
|
+
document.documentElement.removeAttribute("style");
|
|
256
|
+
}
|
|
257
|
+
document.documentElement.scrollTop = scrollTop;
|
|
258
|
+
};
|
|
276
259
|
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
function
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
"devui-overlay-background",
|
|
283
|
-
props.backgroundClass,
|
|
284
|
-
!props.hasBackdrop ? "devui-overlay-background__disabled" : "devui-overlay-background__color"
|
|
285
|
-
];
|
|
286
|
-
});
|
|
287
|
-
const overlayClass = computed(() => {
|
|
288
|
-
return "devui-overlay";
|
|
289
|
-
});
|
|
290
|
-
const handleBackdropClick = (event) => {
|
|
291
|
-
var _a;
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
function useFixedOverlay(props, ctx) {
|
|
263
|
+
let lockScrollCb;
|
|
264
|
+
const onClick = (event) => {
|
|
292
265
|
event.preventDefault();
|
|
293
|
-
(
|
|
294
|
-
if (props.
|
|
295
|
-
ctx.emit("update:
|
|
266
|
+
ctx.emit("click", event);
|
|
267
|
+
if (props.closeOnClickOverlay) {
|
|
268
|
+
ctx.emit("update:modelValue", false);
|
|
296
269
|
}
|
|
297
270
|
};
|
|
298
|
-
const
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
body.style.overflowY = "scroll";
|
|
308
|
-
body.style.position = visible ? "fixed" : "";
|
|
309
|
-
body.style.top = `${top}px`;
|
|
310
|
-
} else {
|
|
311
|
-
body.style.overflowY = originOverflow;
|
|
312
|
-
body.style.position = originPosition;
|
|
313
|
-
body.style.top = "";
|
|
314
|
-
window.scrollTo(0, -top);
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
});
|
|
318
|
-
onUnmounted(() => {
|
|
319
|
-
document.body.style.overflow = originOverflow;
|
|
320
|
-
});
|
|
271
|
+
const removeBodyAdditions = () => {
|
|
272
|
+
lockScrollCb == null ? void 0 : lockScrollCb();
|
|
273
|
+
};
|
|
274
|
+
watch(() => props.modelValue, (val) => {
|
|
275
|
+
if (val) {
|
|
276
|
+
props.lockScroll && (lockScrollCb = lockScroll());
|
|
277
|
+
} else {
|
|
278
|
+
removeBodyAdditions();
|
|
279
|
+
}
|
|
321
280
|
});
|
|
281
|
+
onUnmounted(removeBodyAdditions);
|
|
282
|
+
return { onClick };
|
|
283
|
+
}
|
|
284
|
+
function createBem(namespace, element, modifier) {
|
|
285
|
+
let cls = namespace;
|
|
286
|
+
if (element) {
|
|
287
|
+
cls += `__${element}`;
|
|
288
|
+
}
|
|
289
|
+
if (modifier) {
|
|
290
|
+
cls += `--${modifier}`;
|
|
291
|
+
}
|
|
292
|
+
return cls;
|
|
293
|
+
}
|
|
294
|
+
function useNamespace(block, needDot = false) {
|
|
295
|
+
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
296
|
+
const b = () => createBem(namespace);
|
|
297
|
+
const e = (element) => element ? createBem(namespace, element) : "";
|
|
298
|
+
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
299
|
+
const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
|
|
322
300
|
return {
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
301
|
+
b,
|
|
302
|
+
e,
|
|
303
|
+
m,
|
|
304
|
+
em
|
|
327
305
|
};
|
|
328
306
|
}
|
|
329
307
|
var fixedOverlay = "";
|
|
330
308
|
defineComponent({
|
|
331
309
|
name: "DFixedOverlay",
|
|
310
|
+
inheritAttrs: false,
|
|
332
311
|
props: fixedOverlayProps,
|
|
333
|
-
emits:
|
|
312
|
+
emits: ["update:modelValue", "click"],
|
|
334
313
|
setup(props, ctx) {
|
|
335
314
|
const {
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
315
|
+
modelValue
|
|
316
|
+
} = toRefs(props);
|
|
317
|
+
const ns2 = useNamespace("fixed-overlay");
|
|
318
|
+
const {
|
|
319
|
+
onClick
|
|
320
|
+
} = useFixedOverlay(props, ctx);
|
|
321
|
+
return () => createVNode(Transition, {
|
|
322
|
+
"name": ns2.m("fade")
|
|
323
|
+
}, {
|
|
324
|
+
default: () => {
|
|
325
|
+
var _a, _b;
|
|
326
|
+
return [modelValue.value && createVNode("div", mergeProps({
|
|
327
|
+
"class": ns2.b()
|
|
328
|
+
}, ctx.attrs, {
|
|
329
|
+
"onClick": onClick
|
|
330
|
+
}), [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)])];
|
|
331
|
+
}
|
|
351
332
|
});
|
|
352
333
|
}
|
|
353
334
|
});
|
|
@@ -368,6 +349,9 @@ const flexibleOverlayProps = {
|
|
|
368
349
|
type: [Number, Object],
|
|
369
350
|
default: 8
|
|
370
351
|
},
|
|
352
|
+
shiftOffset: {
|
|
353
|
+
type: Number
|
|
354
|
+
},
|
|
371
355
|
align: {
|
|
372
356
|
type: String,
|
|
373
357
|
default: null
|
|
@@ -413,6 +397,7 @@ function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
|
|
|
413
397
|
function useOverlay(props, emit) {
|
|
414
398
|
const overlayRef = ref();
|
|
415
399
|
const arrowRef = ref();
|
|
400
|
+
let originParent = null;
|
|
416
401
|
const updateArrowPosition = (arrowEl, placement, point, overlayEl) => {
|
|
417
402
|
const { x, y } = adjustArrowPosition(props.isArrowCenter, point, placement, overlayEl.getBoundingClientRect());
|
|
418
403
|
const staticSide = {
|
|
@@ -434,7 +419,6 @@ function useOverlay(props, emit) {
|
|
|
434
419
|
const overlayEl = unref(overlayRef.value);
|
|
435
420
|
const arrowEl = unref(arrowRef.value);
|
|
436
421
|
const middleware = [
|
|
437
|
-
shift(),
|
|
438
422
|
offset(props.offset),
|
|
439
423
|
autoPlacement({
|
|
440
424
|
alignment: props.align,
|
|
@@ -442,30 +426,39 @@ function useOverlay(props, emit) {
|
|
|
442
426
|
})
|
|
443
427
|
];
|
|
444
428
|
props.showArrow && middleware.push(arrow({ element: arrowEl }));
|
|
429
|
+
props.shiftOffset !== void 0 && middleware.push(shift());
|
|
445
430
|
const { x, y, placement, middlewareData } = await computePosition(hostEl, overlayEl, {
|
|
446
431
|
strategy: "fixed",
|
|
447
432
|
middleware
|
|
448
433
|
});
|
|
434
|
+
let applyX = x;
|
|
435
|
+
let applyY = y;
|
|
436
|
+
if (props.shiftOffset !== void 0) {
|
|
437
|
+
const { x: shiftX, y: shiftY } = middlewareData.shift;
|
|
438
|
+
shiftX < 0 && (applyX -= props.shiftOffset);
|
|
439
|
+
shiftX > 0 && (applyX += props.shiftOffset);
|
|
440
|
+
shiftY < 0 && (applyY -= props.shiftOffset);
|
|
441
|
+
shiftY > 0 && (applyY += props.shiftOffset);
|
|
442
|
+
}
|
|
449
443
|
emit("positionChange", placement);
|
|
450
|
-
Object.assign(overlayEl.style, { top: `${
|
|
444
|
+
Object.assign(overlayEl.style, { top: `${applyY}px`, left: `${applyX}px` });
|
|
451
445
|
props.showArrow && updateArrowPosition(arrowEl, placement, middlewareData.arrow, overlayEl);
|
|
452
446
|
};
|
|
453
447
|
watch(() => props.modelValue, () => {
|
|
454
|
-
const originParent = getScrollParent(props.origin);
|
|
455
448
|
if (props.modelValue && props.origin) {
|
|
449
|
+
originParent = getScrollParent(props.origin);
|
|
456
450
|
nextTick(updatePosition);
|
|
457
|
-
originParent.addEventListener("scroll", updatePosition);
|
|
451
|
+
originParent == null ? void 0 : originParent.addEventListener("scroll", updatePosition);
|
|
458
452
|
originParent !== window && window.addEventListener("scroll", updatePosition);
|
|
459
453
|
window.addEventListener("resize", updatePosition);
|
|
460
454
|
} else {
|
|
461
|
-
originParent.removeEventListener("scroll", updatePosition);
|
|
455
|
+
originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
|
|
462
456
|
originParent !== window && window.removeEventListener("scroll", updatePosition);
|
|
463
457
|
window.removeEventListener("resize", updatePosition);
|
|
464
458
|
}
|
|
465
459
|
});
|
|
466
460
|
onUnmounted(() => {
|
|
467
|
-
|
|
468
|
-
originParent.removeEventListener("scroll", updatePosition);
|
|
461
|
+
originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
|
|
469
462
|
originParent !== window && window.removeEventListener("scroll", updatePosition);
|
|
470
463
|
window.removeEventListener("resize", updatePosition);
|
|
471
464
|
});
|
|
@@ -483,6 +476,7 @@ const FlexibleOverlay = defineComponent({
|
|
|
483
476
|
emit,
|
|
484
477
|
expose
|
|
485
478
|
}) {
|
|
479
|
+
const ns2 = useNamespace("flexible-overlay");
|
|
486
480
|
const {
|
|
487
481
|
arrowRef,
|
|
488
482
|
overlayRef,
|
|
@@ -495,14 +489,69 @@ const FlexibleOverlay = defineComponent({
|
|
|
495
489
|
var _a;
|
|
496
490
|
return props.modelValue && createVNode("div", mergeProps({
|
|
497
491
|
"ref": overlayRef,
|
|
498
|
-
"class":
|
|
492
|
+
"class": ns2.b()
|
|
499
493
|
}, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots), props.showArrow && createVNode("div", {
|
|
500
494
|
"ref": arrowRef,
|
|
501
|
-
"class": "
|
|
495
|
+
"class": ns2.e("arrow")
|
|
502
496
|
}, null)]);
|
|
503
497
|
};
|
|
504
498
|
}
|
|
505
499
|
});
|
|
500
|
+
const isObject = (val) => val !== null && typeof val === "object";
|
|
501
|
+
const ns = useNamespace("popper-trigger");
|
|
502
|
+
function wrapContent(content) {
|
|
503
|
+
return h("span", { class: ns.b() }, content);
|
|
504
|
+
}
|
|
505
|
+
function getFirstValidChild(nodes) {
|
|
506
|
+
for (const child of nodes) {
|
|
507
|
+
if (isObject(child)) {
|
|
508
|
+
if (child.type === Comment) {
|
|
509
|
+
continue;
|
|
510
|
+
}
|
|
511
|
+
if (child.type === "svg" || child.type === Text) {
|
|
512
|
+
return wrapContent(child);
|
|
513
|
+
}
|
|
514
|
+
if (child.type === Fragment) {
|
|
515
|
+
return getFirstValidChild(child.children);
|
|
516
|
+
}
|
|
517
|
+
return child;
|
|
518
|
+
}
|
|
519
|
+
return wrapContent(child);
|
|
520
|
+
}
|
|
521
|
+
return null;
|
|
522
|
+
}
|
|
523
|
+
var PopperTrigger = defineComponent({
|
|
524
|
+
name: "DPopperTrigger",
|
|
525
|
+
setup(_, ctx) {
|
|
526
|
+
const {
|
|
527
|
+
slots,
|
|
528
|
+
attrs
|
|
529
|
+
} = ctx;
|
|
530
|
+
return () => {
|
|
531
|
+
var _a;
|
|
532
|
+
const defaultSlot = (_a = slots.default) == null ? void 0 : _a.call(slots, attrs);
|
|
533
|
+
const triggerRef = inject(POPPER_TRIGGER_TOKEN);
|
|
534
|
+
if (!defaultSlot) {
|
|
535
|
+
return null;
|
|
536
|
+
}
|
|
537
|
+
const firstValidChild = getFirstValidChild(defaultSlot);
|
|
538
|
+
if (!firstValidChild) {
|
|
539
|
+
return null;
|
|
540
|
+
}
|
|
541
|
+
return withDirectives(cloneVNode(firstValidChild, attrs), [[{
|
|
542
|
+
mounted(el) {
|
|
543
|
+
triggerRef.value = el;
|
|
544
|
+
},
|
|
545
|
+
updated(el) {
|
|
546
|
+
triggerRef.value = el;
|
|
547
|
+
},
|
|
548
|
+
unmounted() {
|
|
549
|
+
triggerRef.value = null;
|
|
550
|
+
}
|
|
551
|
+
}]]);
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
});
|
|
506
555
|
var dropdown = "";
|
|
507
556
|
let dropdownId = 1;
|
|
508
557
|
var Dropdown = defineComponent({
|
|
@@ -521,6 +570,8 @@ var Dropdown = defineComponent({
|
|
|
521
570
|
position,
|
|
522
571
|
align,
|
|
523
572
|
offset: offset2,
|
|
573
|
+
destroyOnHide,
|
|
574
|
+
shiftOffset,
|
|
524
575
|
showAnimation
|
|
525
576
|
} = toRefs(props);
|
|
526
577
|
const origin = ref();
|
|
@@ -529,6 +580,8 @@ var Dropdown = defineComponent({
|
|
|
529
580
|
const id = `dropdown_${dropdownId++}`;
|
|
530
581
|
const isOpen = ref(false);
|
|
531
582
|
const currentPosition = ref("bottom");
|
|
583
|
+
const ns2 = useNamespace("dropdown");
|
|
584
|
+
provide(POPPER_TRIGGER_TOKEN, origin);
|
|
532
585
|
useDropdownEvent({
|
|
533
586
|
id,
|
|
534
587
|
isOpen,
|
|
@@ -545,43 +598,50 @@ var Dropdown = defineComponent({
|
|
|
545
598
|
classes,
|
|
546
599
|
handlePositionChange
|
|
547
600
|
} = useOverlayProps(props, currentPosition, isOpen);
|
|
601
|
+
watch(overlayShowValue, (overlayShowValueVal) => {
|
|
602
|
+
nextTick(() => {
|
|
603
|
+
if (!destroyOnHide.value && overlayShowValueVal) {
|
|
604
|
+
overlayRef.value.updatePosition();
|
|
605
|
+
}
|
|
606
|
+
});
|
|
607
|
+
});
|
|
548
608
|
expose({
|
|
549
609
|
updatePosition: () => overlayRef.value.updatePosition()
|
|
550
610
|
});
|
|
551
|
-
return () => {
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
611
|
+
return () => createVNode(Fragment, null, [createVNode(PopperTrigger, null, {
|
|
612
|
+
default: () => {
|
|
613
|
+
var _a;
|
|
614
|
+
return [(_a = slots.default) == null ? void 0 : _a.call(slots)];
|
|
615
|
+
}
|
|
616
|
+
}), createVNode(Teleport, {
|
|
617
|
+
"to": "body"
|
|
618
|
+
}, {
|
|
619
|
+
default: () => [createVNode(Transition, {
|
|
620
|
+
"name": showAnimation.value ? ns2.m(`fade-${currentPosition.value}`) : ""
|
|
558
621
|
}, {
|
|
559
|
-
default: () => [createVNode(
|
|
560
|
-
"
|
|
622
|
+
default: () => [withDirectives(createVNode(FlexibleOverlay, {
|
|
623
|
+
"modelValue": overlayModelValue.value,
|
|
624
|
+
"onUpdate:modelValue": ($event) => overlayModelValue.value = $event,
|
|
625
|
+
"ref": overlayRef,
|
|
626
|
+
"origin": origin.value,
|
|
627
|
+
"position": position.value,
|
|
628
|
+
"align": align.value,
|
|
629
|
+
"offset": offset2.value,
|
|
630
|
+
"shiftOffset": shiftOffset == null ? void 0 : shiftOffset.value,
|
|
631
|
+
"onPositionChange": handlePositionChange,
|
|
632
|
+
"class": classes.value,
|
|
633
|
+
"style": styles.value
|
|
561
634
|
}, {
|
|
562
|
-
default: () =>
|
|
563
|
-
|
|
564
|
-
"
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
"style": styles.value
|
|
573
|
-
}, {
|
|
574
|
-
default: () => {
|
|
575
|
-
var _a2;
|
|
576
|
-
return [createVNode("div", mergeProps({
|
|
577
|
-
"ref": dropdownRef,
|
|
578
|
-
"class": "devui-dropdown-menu-wrap"
|
|
579
|
-
}, attrs), [(_a2 = slots.menu) == null ? void 0 : _a2.call(slots)])];
|
|
580
|
-
}
|
|
581
|
-
}), [[vShow, overlayShowValue.value]])]
|
|
582
|
-
})]
|
|
583
|
-
})]);
|
|
584
|
-
};
|
|
635
|
+
default: () => {
|
|
636
|
+
var _a;
|
|
637
|
+
return [createVNode("div", mergeProps({
|
|
638
|
+
"ref": dropdownRef,
|
|
639
|
+
"class": ns2.e("menu-wrap")
|
|
640
|
+
}, attrs), [(_a = slots.menu) == null ? void 0 : _a.call(slots)])];
|
|
641
|
+
}
|
|
642
|
+
}), [[vShow, overlayShowValue.value]])]
|
|
643
|
+
})]
|
|
644
|
+
})]);
|
|
585
645
|
}
|
|
586
646
|
});
|
|
587
647
|
const dropdownMenuProps = {
|
|
@@ -639,6 +699,7 @@ var DropdownMenu = defineComponent({
|
|
|
639
699
|
overlayClass
|
|
640
700
|
} = toRefs(props);
|
|
641
701
|
const dropdownMenuRef = ref(null);
|
|
702
|
+
const ns2 = useNamespace("dropdown");
|
|
642
703
|
onClickOutside(dropdownMenuRef, (value) => {
|
|
643
704
|
var _a, _b;
|
|
644
705
|
if (((_a = clickOutside.value) == null ? void 0 : _a.call(clickOutside)) && !((_b = origin == null ? void 0 : origin.value) == null ? void 0 : _b.contains(value.target))) {
|
|
@@ -656,7 +717,7 @@ var DropdownMenu = defineComponent({
|
|
|
656
717
|
"to": "body"
|
|
657
718
|
}, {
|
|
658
719
|
default: () => [createVNode(Transition, {
|
|
659
|
-
"name": showAnimation.value ? `
|
|
720
|
+
"name": showAnimation.value ? ns2.m(`fade-${currentPosition.value}`) : ""
|
|
660
721
|
}, {
|
|
661
722
|
default: () => [createVNode(FlexibleOverlay, {
|
|
662
723
|
"modelValue": modelValue.value,
|
|
@@ -673,7 +734,7 @@ var DropdownMenu = defineComponent({
|
|
|
673
734
|
var _a;
|
|
674
735
|
return [createVNode("div", mergeProps({
|
|
675
736
|
"ref": dropdownMenuRef,
|
|
676
|
-
"class": "
|
|
737
|
+
"class": ns2.e("menu-wrap")
|
|
677
738
|
}, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots)])];
|
|
678
739
|
}
|
|
679
740
|
})]
|
package/dropdown/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var te=Object.defineProperty,oe=Object.defineProperties;var ne=Object.getOwnPropertyDescriptors;var R=Object.getOwnPropertySymbols;var le=Object.prototype.hasOwnProperty,ae=Object.prototype.propertyIsEnumerable;var $=(c,e,g)=>e in c?te(c,e,{enumerable:!0,configurable:!0,writable:!0,value:g}):c[e]=g,A=(c,e)=>{for(var g in e||(e={}))le.call(e,g)&&$(c,g,e[g]);if(R)for(var g of R(e))ae.call(e,g)&&$(c,g,e[g]);return c},D=(c,e)=>oe(c,ne(e));(function(c,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue"),require("@floating-ui/dom"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["exports","vue","@floating-ui/dom","@vueuse/core"],e):(c=typeof globalThis!="undefined"?globalThis:c||self,e(c.index={},c.Vue,c.dom,c.core))})(this,function(c,e,g,_){"use strict";const F={visible:{type:Boolean,default:!1},trigger:{type:String,default:"click"},closeScope:{type:String,default:"all"},position:{type:Array,default:["bottom"]},align:{type:String,default:null},offset:{type:[Number,Object],default:4},closeOnMouseLeaveMenu:{type:Boolean,default:!1},showAnimation:{type:Boolean,default:!0},overlayClass:{type:String,default:""},destroyOnHide:{type:Boolean,default:!0}};function q(t){return t instanceof Element?t:t&&typeof t=="object"&&t.$el instanceof Element?t.$el:null}const V=new Map;function E(t,n,l){return t==null||t.addEventListener(n,l),()=>{t==null||t.removeEventListener(n,l)}}const H=({id:t,isOpen:n,origin:l,dropdownRef:i,props:u,emit:a})=>{let o=!1,r=!1;const{trigger:f,closeScope:s,closeOnMouseLeaveMenu:y}=e.toRefs(u),d=v=>{n.value=v,a("toggle",n.value)},m=async(v,B)=>{await new Promise(p=>setTimeout(p,50)),!(v==="origin"&&o||v==="dropdown"&&r)&&(B&&[...V.values()].reverse().forEach(p=>{setTimeout(()=>{var w;(w=p.toggle)==null||w.call(p)},0)}),d(!1))};e.watch([f,l,i],([v,B,p],w,S)=>{const C=q(B),O=[];setTimeout(()=>{O.push(E(document,"click",b=>{const k=[...V.values()];!n.value||s.value==="none"||p.contains(b.target)&&s.value==="blank"||k.some(h=>{var P;return(P=h.toggleEl)==null?void 0:P.contains(b.target)})&&k.some(h=>{var P;return(P=h.menuEl)==null?void 0:P.contains(b.target)})||([...V.values()].reverse().forEach(h=>{setTimeout(()=>{var P,L;((P=h.toggleEl)==null?void 0:P.contains(b.target))||(L=h.toggle)==null||L.call(h)},0)}),o=!1)}))},0),v==="click"?O.push(E(C,"click",()=>d(!n.value)),E(p,"mouseleave",b=>{var k;y.value&&!((k=V.get(t).child)==null?void 0:k.contains(b.relatedTarget))&&m("dropdown",!0)})):v==="hover"&&O.push(E(C,"mouseenter",()=>{r=!0,d(!0)}),E(C,"mouseleave",()=>{r=!1,m("origin")}),E(p,"mouseenter",()=>{o=!0,n.value=!0}),E(p,"mouseleave",b=>{var k;o=!1,!(b.relatedTarget&&((C==null?void 0:C.contains(b.relatedTarget))||((k=V.get(t).child)==null?void 0:k.contains(b.relatedTarget))))&&m("dropdown",!0)})),S(()=>O.forEach(b=>b()))})};function U(t,n,l,i,u,a,o){const r=f=>{const s=f.offsetHeight;window.innerHeight-i.value.getBoundingClientRect().bottom>=s?a.value="bottom":a.value="top"};e.watch(n,(f,s)=>{s!==void 0&&(l.value=f,o("toggle",l.value))},{immediate:!0}),e.watch([l,u],([f,s])=>{var y;if(f){V.set(t,D(A({},V.get(t)),{menuEl:s,toggle:()=>{l.value=!1,o("toggle",l.value)}}));for(const d of V.values())((y=d.menuEl)==null?void 0:y.contains(i.value))&&(d.child=s)}s&&r(s)}),e.onMounted(()=>{V.set(t,{toggleEl:i.value})}),e.onUnmounted(()=>{V.delete(t)})}function z(t,n,l){const{showAnimation:i,overlayClass:u,destroyOnHide:a}=e.toRefs(t),o=e.ref(!1),r=e.ref(!1),f=e.computed(()=>({transformOrigin:n.value==="top"?"0% 100%":"0% 0%"})),s=e.computed(()=>({"fade-in-bottom":i.value&&l.value&&n.value==="bottom","fade-in-top":i.value&&l.value&&n.value==="top",[`${u.value}`]:!0})),y=d=>{n.value=d.includes("top")||d.includes("end")?"top":"bottom"};return e.watch(l,d=>{o.value=a.value?d:!0,r.value=d}),{overlayModelValue:o,overlayShowValue:r,styles:f,classes:s,handlePositionChange:y}}var re="";function Y(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!e.isVNode(t)}const I=e.defineComponent({setup(t,n){return()=>{let l;return e.createVNode(e.Teleport,{to:"#d-overlay-anchor"},{default:()=>[e.createVNode(e.Transition,{name:"devui-overlay-fade"},Y(l=e.renderSlot(n.slots,"default"))?l:{default:()=>[l]})]})}}}),X=D(A({},{visible:{type:Boolean},backgroundBlock:{type:Boolean,default:!1},backgroundClass:{type:String,default:""},backgroundStyle:{type:[String,Object]},onBackdropClick:{type:Function},backdropClose:{type:Boolean,default:!0},hasBackdrop:{type:Boolean,default:!0}}),{overlayStyle:{type:[String,Object],default:void 0}}),G=["update:visible","backdropClick"];function J(t,n){const l=e.computed(()=>["devui-overlay-background",t.backgroundClass,t.hasBackdrop?"devui-overlay-background__color":"devui-overlay-background__disabled"]),i=e.computed(()=>"devui-overlay"),u=o=>{var r;o.preventDefault(),(r=t.onBackdropClick)==null||r.call(t),t.backdropClose&&n.emit("update:visible",!1)},a=o=>o.cancelBubble=!0;return e.onMounted(()=>{const o=document.body,r=o.style.overflow,f=o.style.position;e.watch([()=>t.visible,()=>t.backgroundBlock],([s,y])=>{if(y){const d=o.getBoundingClientRect().y;s?(o.style.overflowY="scroll",o.style.position=s?"fixed":"",o.style.top=`${d}px`):(o.style.overflowY=r,o.style.position=f,o.style.top="",window.scrollTo(0,-d))}}),e.onUnmounted(()=>{document.body.style.overflow=r})}),{backgroundClass:l,overlayClass:i,handleBackdropClick:u,handleOverlayBubbleCancel:a}}var se="";e.defineComponent({name:"DFixedOverlay",props:X,emits:G,setup(t,n){const{backgroundClass:l,overlayClass:i,handleBackdropClick:u,handleOverlayBubbleCancel:a}=J(t,n);return()=>e.createVNode(I,null,{default:()=>[t.visible&&e.createVNode("div",{class:l.value,style:t.backgroundStyle,onClick:u},[e.createVNode("div",{class:i.value,style:t.overlayStyle,onClick:a},[e.renderSlot(n.slots,"default")])])]})}});const K={modelValue:{type:Boolean,default:!1},origin:{type:Object,require:!0},position:{type:Array,default:["bottom"]},offset:{type:[Number,Object],default:8},align:{type:String,default:null},showArrow:{type:Boolean,default:!1},isArrowCenter:{type:Boolean,default:!0}};function M(t){const n=/(auto|scroll|hidden)/;for(let l=t;l=l.parentElement;l.parentElement!==document.body){const i=window.getComputedStyle(l);if(n.test(i.overflow+i.overflowX+i.overflowY))return l}return window}function Q(t,n,l,i){let{x:u,y:a}=n;if(!t){const{width:o,height:r}=i;u&&l.includes("start")&&(u=12),u&&l.includes("end")&&(u=Math.round(o-24)),a&&l.includes("start")&&(a=10),a&&l.includes("end")&&(a=r-14)}return{x:u,y:a}}function W(t,n){const l=e.ref(),i=e.ref(),u=(o,r,f,s)=>{const{x:y,y:d}=Q(t.isArrowCenter,f,r,s.getBoundingClientRect()),m={top:"bottom",right:"left",bottom:"top",left:"right"}[r.split("-")[0]];Object.assign(o.style,{left:y?`${y}px`:"",top:d?`${d}px`:"",right:"",bottom:"",[m]:"-4px"})},a=async()=>{const o=t.origin,r=e.unref(l.value),f=e.unref(i.value),s=[g.shift(),g.offset(t.offset),g.autoPlacement({alignment:t.align,allowedPlacements:t.position})];t.showArrow&&s.push(g.arrow({element:f}));const{x:y,y:d,placement:m,middlewareData:v}=await g.computePosition(o,r,{strategy:"fixed",middleware:s});n("positionChange",m),Object.assign(r.style,{top:`${d}px`,left:`${y}px`}),t.showArrow&&u(f,m,v.arrow,r)};return e.watch(()=>t.modelValue,()=>{const o=M(t.origin);t.modelValue&&t.origin?(e.nextTick(a),o.addEventListener("scroll",a),o!==window&&window.addEventListener("scroll",a),window.addEventListener("resize",a)):(o.removeEventListener("scroll",a),o!==window&&window.removeEventListener("scroll",a),window.removeEventListener("resize",a))}),e.onUnmounted(()=>{const o=M(t.origin);o.removeEventListener("scroll",a),o!==window&&window.removeEventListener("scroll",a),window.removeEventListener("resize",a)}),{arrowRef:i,overlayRef:l,updatePosition:a}}var de="";const T=e.defineComponent({name:"DFlexibleOverlay",inheritAttrs:!1,props:K,emits:["update:modelValue","positionChange"],setup(t,{slots:n,attrs:l,emit:i,expose:u}){const{arrowRef:a,overlayRef:o,updatePosition:r}=W(t,i);return u({updatePosition:r}),()=>{var f;return t.modelValue&&e.createVNode("div",e.mergeProps({ref:o,class:"devui-flexible-overlay"},l),[(f=n.default)==null?void 0:f.call(n),t.showArrow&&e.createVNode("div",{ref:a,class:"devui-flexible-overlay-arrow"},null)])}}});var ue="";let Z=1;var x=e.defineComponent({name:"DDropdown",inheritAttrs:!1,props:F,emits:["toggle"],setup(t,{slots:n,attrs:l,emit:i,expose:u}){const{visible:a,position:o,align:r,offset:f,showAnimation:s}=e.toRefs(t),y=e.ref(),d=e.ref(),m=e.ref(),v=`dropdown_${Z++}`,B=e.ref(!1),p=e.ref("bottom");H({id:v,isOpen:B,origin:y,dropdownRef:d,props:t,emit:i}),U(v,a,B,y,d,p,i);const{overlayModelValue:w,overlayShowValue:S,styles:C,classes:O,handlePositionChange:b}=z(t,p,B);return u({updatePosition:()=>m.value.updatePosition()}),()=>{var k;return e.createVNode(e.Fragment,null,[e.createVNode("div",{ref:y,class:"devui-dropdown-toggle"},[(k=n.default)==null?void 0:k.call(n)]),e.createVNode(e.Teleport,{to:"body"},{default:()=>[e.createVNode(e.Transition,{name:s.value?`devui-dropdown-fade-${p.value}`:""},{default:()=>[e.withDirectives(e.createVNode(T,{modelValue:w.value,"onUpdate:modelValue":h=>w.value=h,ref:m,origin:y.value,position:o.value,align:r.value,offset:f.value,onPositionChange:b,class:O.value,style:C.value},{default:()=>{var h;return[e.createVNode("div",e.mergeProps({ref:d,class:"devui-dropdown-menu-wrap"},l),[(h=n.menu)==null?void 0:h.call(n)])]}}),[[e.vShow,S.value]])]})]})])}}});const j={modelValue:{type:Boolean,default:!1},origin:{type:Object,require:!0},position:{type:Array,default:["bottom"]},align:{type:String,default:null},offset:{type:[Number,Object],default:4},clickOutside:{type:Function,default:()=>!0},showAnimation:{type:Boolean,default:!0},overlayClass:{type:String,default:""}};var N=e.defineComponent({name:"DDropdownMenu",inheritAttrs:!1,props:j,emits:["update:modelValue"],setup(t,{slots:n,attrs:l,emit:i}){const{modelValue:u,origin:a,position:o,align:r,offset:f,clickOutside:s,showAnimation:y,overlayClass:d}=e.toRefs(t),m=e.ref(null);_.onClickOutside(m,w=>{var S,C;((S=s.value)==null?void 0:S.call(s))&&!((C=a==null?void 0:a.value)==null?void 0:C.contains(w.target))&&i("update:modelValue",!1)});const v=e.ref("bottom"),B=w=>{v.value=w.split("-")[0]==="top"?"top":"bottom"},p=e.computed(()=>({transformOrigin:v.value==="top"?"0% 100%":"0% 0%"}));return()=>e.createVNode(e.Teleport,{to:"body"},{default:()=>[e.createVNode(e.Transition,{name:y.value?`devui-dropdown-fade-${v.value}`:""},{default:()=>[e.createVNode(T,{modelValue:u.value,"onUpdate:modelValue":w=>u.value=w,origin:a==null?void 0:a.value,position:o.value,align:r.value,offset:f.value,onPositionChange:B,class:d.value,style:p.value},{default:()=>{var w;return[e.createVNode("div",e.mergeProps({ref:m,class:"devui-dropdown-menu-wrap"},l),[(w=n.default)==null?void 0:w.call(n)])]}})]})]})}}),ee={title:"Dropdown \u4E0B\u62C9\u83DC\u5355",category:"\u5BFC\u822A",status:"10%",install(t){t.component(x.name,x),t.component(N.name,N)}};c.Dropdown=x,c.DropdownMenu=N,c.default=ee,c.dropdownMenuProps=j,Object.defineProperty(c,"__esModule",{value:!0}),c[Symbol.toStringTag]="Module"});
|
|
1
|
+
var se=Object.defineProperty,ie=Object.defineProperties;var ue=Object.getOwnPropertyDescriptors;var F=Object.getOwnPropertySymbols;var ce=Object.prototype.hasOwnProperty,de=Object.prototype.propertyIsEnumerable;var H=(d,e,w)=>e in d?se(d,e,{enumerable:!0,configurable:!0,writable:!0,value:w}):d[e]=w,_=(d,e)=>{for(var w in e||(e={}))ce.call(e,w)&&H(d,w,e[w]);if(F)for(var w of F(e))de.call(e,w)&&H(d,w,e[w]);return d},q=(d,e)=>ie(d,ue(e));(function(d,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue"),require("@floating-ui/dom"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["exports","vue","@floating-ui/dom","@vueuse/core"],e):(d=typeof globalThis!="undefined"?globalThis:d||self,e(d.index={},d.Vue,d.dom,d.core))})(this,function(d,e,w,U){"use strict";const Y={visible:{type:Boolean,default:!1},trigger:{type:String,default:"click"},closeScope:{type:String,default:"all"},position:{type:Array,default:["bottom"]},align:{type:String,default:null},offset:{type:[Number,Object],default:4},shiftOffset:{type:Number},closeOnMouseLeaveMenu:{type:Boolean,default:!1},showAnimation:{type:Boolean,default:!0},overlayClass:{type:String,default:""},destroyOnHide:{type:Boolean,default:!0}},M=Symbol("popper-trigger");function z(t){return t instanceof Element?t:t&&typeof t=="object"&&t.$el instanceof Element?t.$el:null}const O=new Map;function N(t,o,n){return t==null||t.addEventListener(o,n),()=>{t==null||t.removeEventListener(o,n)}}const X=({id:t,isOpen:o,origin:n,dropdownRef:r,props:l,emit:a})=>{let s=!1,i=!1;const{trigger:u,closeScope:c,closeOnMouseLeaveMenu:p}=e.toRefs(l),f=g=>{o.value=g,a("toggle",o.value)},v=async(g,E)=>{await new Promise(m=>setTimeout(m,50)),!(g==="origin"&&s||g==="dropdown"&&i)&&(E&&[...O.values()].reverse().forEach(m=>{setTimeout(()=>{var V;(V=m.toggle)==null||V.call(m)},0)}),f(!1))};e.watch([u,n,r],([g,E,m],V,y)=>{const h=z(E),P=[];setTimeout(()=>{P.push(N(document,"click",b=>{const A=[...O.values()];!o.value||c.value==="none"||(m==null?void 0:m.contains(b.target))&&c.value==="blank"||A.some(T=>{var x;return(x=T.toggleEl)==null?void 0:x.contains(b.target)})&&A.some(T=>{var x;return(x=T.menuEl)==null?void 0:x.contains(b.target)})||([...O.values()].reverse().forEach(T=>{setTimeout(()=>{var x,C;((x=T.toggleEl)==null?void 0:x.contains(b.target))||(C=T.toggle)==null||C.call(T)},0)}),s=!1)}))},0),g==="click"?P.push(N(h,"click",()=>f(!o.value)),N(m,"mouseleave",b=>{var A;p.value&&!((A=O.get(t).child)==null?void 0:A.contains(b.relatedTarget))&&v("dropdown",!0)})):g==="hover"&&P.push(N(h,"mouseenter",()=>{i=!0,f(!0)}),N(h,"mouseleave",()=>{i=!1,v("origin")}),N(m,"mouseenter",()=>{s=!0,o.value=!0}),N(m,"mouseleave",b=>{var A;s=!1,!(b.relatedTarget&&((h==null?void 0:h.contains(b.relatedTarget))||((A=O.get(t).child)==null?void 0:A.contains(b.relatedTarget))))&&v("dropdown",!0)})),y(()=>P.forEach(b=>b()))})};function G(t,o,n,r,l,a,s){const i=u=>{const c=u.offsetHeight;window.innerHeight-r.value.getBoundingClientRect().bottom>=c?a.value="bottom":a.value="top"};e.watch(o,(u,c)=>{c!==void 0&&(n.value=u,s("toggle",n.value))},{immediate:!0}),e.watch([n,l],([u,c])=>{var p;if(u){O.set(t,q(_({},O.get(t)),{menuEl:c,toggle:()=>{n.value=!1,s("toggle",n.value)}}));for(const f of O.values())((p=f.menuEl)==null?void 0:p.contains(r.value))&&(f.child=c)}c&&i(c)}),e.onMounted(()=>{O.set(t,{toggleEl:r.value})}),e.onUnmounted(()=>{O.delete(t)})}function I(t,o,n){const{showAnimation:r,overlayClass:l,destroyOnHide:a}=e.toRefs(t),s=e.ref(!1),i=e.ref(!1),u=e.computed(()=>({transformOrigin:o.value==="top"?"0% 100%":"0% 0%"})),c=e.computed(()=>({"fade-in-bottom":r.value&&n.value&&o.value==="bottom","fade-in-top":r.value&&n.value&&o.value==="top",[`${l.value}`]:!0})),p=f=>{o.value=f.includes("top")||f.includes("end")?"top":"bottom"};return e.watch(n,f=>{s.value=a.value?f:!0,i.value=f}),{overlayModelValue:s,overlayShowValue:i,styles:u,classes:c,handlePositionChange:p}}const K={modelValue:{type:Boolean,default:!1},lockScroll:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0}};function J(){if(document.documentElement.scrollHeight>document.documentElement.clientHeight){const t=document.documentElement.scrollTop,o=document.documentElement.getAttribute("style");return document.documentElement.style.position="fixed",document.documentElement.style.top=`-${t}px`,document.documentElement.style.width=document.documentElement.style.width||"100%",document.documentElement.style.overflowY="scroll",()=>{o?document.documentElement.setAttribute("style",o):document.documentElement.removeAttribute("style"),document.documentElement.scrollTop=t}}}function Q(t,o){let n;const r=a=>{a.preventDefault(),o.emit("click",a),t.closeOnClickOverlay&&o.emit("update:modelValue",!1)},l=()=>{n==null||n()};return e.watch(()=>t.modelValue,a=>{a?t.lockScroll&&(n=J()):l()}),e.onUnmounted(l),{onClick:r}}function S(t,o,n){let r=t;return o&&(r+=`__${o}`),n&&(r+=`--${n}`),r}function D(t,o=!1){const n=o?`.devui-${t}`:`devui-${t}`;return{b:()=>S(n),e:i=>i?S(n,i):"",m:i=>i?S(n,"",i):"",em:(i,u)=>i&&u?S(n,i,u):""}}var fe="";e.defineComponent({name:"DFixedOverlay",inheritAttrs:!1,props:K,emits:["update:modelValue","click"],setup(t,o){const{modelValue:n}=e.toRefs(t),r=D("fixed-overlay"),{onClick:l}=Q(t,o);return()=>e.createVNode(e.Transition,{name:r.m("fade")},{default:()=>{var a,s;return[n.value&&e.createVNode("div",e.mergeProps({class:r.b()},o.attrs,{onClick:l}),[(s=(a=o.slots).default)==null?void 0:s.call(a)])]}})}});const W={modelValue:{type:Boolean,default:!1},origin:{type:Object,require:!0},position:{type:Array,default:["bottom"]},offset:{type:[Number,Object],default:8},shiftOffset:{type:Number},align:{type:String,default:null},showArrow:{type:Boolean,default:!1},isArrowCenter:{type:Boolean,default:!0}};function Z(t){const o=/(auto|scroll|hidden)/;for(let n=t;n=n.parentElement;n.parentElement!==document.body){const r=window.getComputedStyle(n);if(o.test(r.overflow+r.overflowX+r.overflowY))return n}return window}function ee(t,o,n,r){let{x:l,y:a}=o;if(!t){const{width:s,height:i}=r;l&&n.includes("start")&&(l=12),l&&n.includes("end")&&(l=Math.round(s-24)),a&&n.includes("start")&&(a=10),a&&n.includes("end")&&(a=i-14)}return{x:l,y:a}}function te(t,o){const n=e.ref(),r=e.ref();let l=null;const a=(i,u,c,p)=>{const{x:f,y:v}=ee(t.isArrowCenter,c,u,p.getBoundingClientRect()),g={top:"bottom",right:"left",bottom:"top",left:"right"}[u.split("-")[0]];Object.assign(i.style,{left:f?`${f}px`:"",top:v?`${v}px`:"",right:"",bottom:"",[g]:"-4px"})},s=async()=>{const i=t.origin,u=e.unref(n.value),c=e.unref(r.value),p=[w.offset(t.offset),w.autoPlacement({alignment:t.align,allowedPlacements:t.position})];t.showArrow&&p.push(w.arrow({element:c})),t.shiftOffset!==void 0&&p.push(w.shift());const{x:f,y:v,placement:g,middlewareData:E}=await w.computePosition(i,u,{strategy:"fixed",middleware:p});let m=f,V=v;if(t.shiftOffset!==void 0){const{x:y,y:h}=E.shift;y<0&&(m-=t.shiftOffset),y>0&&(m+=t.shiftOffset),h<0&&(V-=t.shiftOffset),h>0&&(V+=t.shiftOffset)}o("positionChange",g),Object.assign(u.style,{top:`${V}px`,left:`${m}px`}),t.showArrow&&a(c,g,E.arrow,u)};return e.watch(()=>t.modelValue,()=>{t.modelValue&&t.origin?(l=Z(t.origin),e.nextTick(s),l==null||l.addEventListener("scroll",s),l!==window&&window.addEventListener("scroll",s),window.addEventListener("resize",s)):(l==null||l.removeEventListener("scroll",s),l!==window&&window.removeEventListener("scroll",s),window.removeEventListener("resize",s))}),e.onUnmounted(()=>{l==null||l.removeEventListener("scroll",s),l!==window&&window.removeEventListener("scroll",s),window.removeEventListener("resize",s)}),{arrowRef:r,overlayRef:n,updatePosition:s}}var me="";const k=e.defineComponent({name:"DFlexibleOverlay",inheritAttrs:!1,props:W,emits:["update:modelValue","positionChange"],setup(t,{slots:o,attrs:n,emit:r,expose:l}){const a=D("flexible-overlay"),{arrowRef:s,overlayRef:i,updatePosition:u}=te(t,r);return l({updatePosition:u}),()=>{var c;return t.modelValue&&e.createVNode("div",e.mergeProps({ref:i,class:a.b()},n),[(c=o.default)==null?void 0:c.call(o),t.showArrow&&e.createVNode("div",{ref:s,class:a.e("arrow")},null)])}}}),oe=t=>t!==null&&typeof t=="object",ne=D("popper-trigger");function $(t){return e.h("span",{class:ne.b()},t)}function j(t){for(const o of t){if(oe(o)){if(o.type===e.Comment)continue;return o.type==="svg"||o.type===e.Text?$(o):o.type===e.Fragment?j(o.children):o}return $(o)}return null}var le=e.defineComponent({name:"DPopperTrigger",setup(t,o){const{slots:n,attrs:r}=o;return()=>{var i;const l=(i=n.default)==null?void 0:i.call(n,r),a=e.inject(M);if(!l)return null;const s=j(l);return s?e.withDirectives(e.cloneVNode(s,r),[[{mounted(u){a.value=u},updated(u){a.value=u},unmounted(){a.value=null}}]]):null}}}),pe="";let ae=1;var B=e.defineComponent({name:"DDropdown",inheritAttrs:!1,props:Y,emits:["toggle"],setup(t,{slots:o,attrs:n,emit:r,expose:l}){const{visible:a,position:s,align:i,offset:u,destroyOnHide:c,shiftOffset:p,showAnimation:f}=e.toRefs(t),v=e.ref(),g=e.ref(),E=e.ref(),m=`dropdown_${ae++}`,V=e.ref(!1),y=e.ref("bottom"),h=D("dropdown");e.provide(M,v),X({id:m,isOpen:V,origin:v,dropdownRef:g,props:t,emit:r}),G(m,a,V,v,g,y,r);const{overlayModelValue:P,overlayShowValue:b,styles:A,classes:T,handlePositionChange:x}=I(t,y,V);return e.watch(b,C=>{e.nextTick(()=>{!c.value&&C&&E.value.updatePosition()})}),l({updatePosition:()=>E.value.updatePosition()}),()=>e.createVNode(e.Fragment,null,[e.createVNode(le,null,{default:()=>{var C;return[(C=o.default)==null?void 0:C.call(o)]}}),e.createVNode(e.Teleport,{to:"body"},{default:()=>[e.createVNode(e.Transition,{name:f.value?h.m(`fade-${y.value}`):""},{default:()=>[e.withDirectives(e.createVNode(k,{modelValue:P.value,"onUpdate:modelValue":C=>P.value=C,ref:E,origin:v.value,position:s.value,align:i.value,offset:u.value,shiftOffset:p==null?void 0:p.value,onPositionChange:x,class:T.value,style:A.value},{default:()=>{var C;return[e.createVNode("div",e.mergeProps({ref:g,class:h.e("menu-wrap")},n),[(C=o.menu)==null?void 0:C.call(o)])]}}),[[e.vShow,b.value]])]})]})])}});const L={modelValue:{type:Boolean,default:!1},origin:{type:Object,require:!0},position:{type:Array,default:["bottom"]},align:{type:String,default:null},offset:{type:[Number,Object],default:4},clickOutside:{type:Function,default:()=>!0},showAnimation:{type:Boolean,default:!0},overlayClass:{type:String,default:""}};var R=e.defineComponent({name:"DDropdownMenu",inheritAttrs:!1,props:L,emits:["update:modelValue"],setup(t,{slots:o,attrs:n,emit:r}){const{modelValue:l,origin:a,position:s,align:i,offset:u,clickOutside:c,showAnimation:p,overlayClass:f}=e.toRefs(t),v=e.ref(null),g=D("dropdown");U.onClickOutside(v,y=>{var h,P;((h=c.value)==null?void 0:h.call(c))&&!((P=a==null?void 0:a.value)==null?void 0:P.contains(y.target))&&r("update:modelValue",!1)});const E=e.ref("bottom"),m=y=>{E.value=y.split("-")[0]==="top"?"top":"bottom"},V=e.computed(()=>({transformOrigin:E.value==="top"?"0% 100%":"0% 0%"}));return()=>e.createVNode(e.Teleport,{to:"body"},{default:()=>[e.createVNode(e.Transition,{name:p.value?g.m(`fade-${E.value}`):""},{default:()=>[e.createVNode(k,{modelValue:l.value,"onUpdate:modelValue":y=>l.value=y,origin:a==null?void 0:a.value,position:s.value,align:i.value,offset:u.value,onPositionChange:m,class:f.value,style:V.value},{default:()=>{var y;return[e.createVNode("div",e.mergeProps({ref:v,class:g.e("menu-wrap")},n),[(y=o.default)==null?void 0:y.call(o)])]}})]})]})}}),re={title:"Dropdown \u4E0B\u62C9\u83DC\u5355",category:"\u5BFC\u822A",status:"10%",install(t){t.component(B.name,B),t.component(R.name,R)}};d.Dropdown=B,d.DropdownMenu=R,d.default=re,d.dropdownMenuProps=L,Object.defineProperty(d,"__esModule",{value:!0}),d[Symbol.toStringTag]="Module"});
|
package/dropdown/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
.devui-fixed-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background-color:var(--devui-shadow, rgba(37, 43, 58, .2));z-index:1050}.devui-fixed-overlay--fade-enter-active,.devui-fixed-overlay--fade-leave-active{transition:opacity .1s cubic-bezier(0,0,1,1)}.devui-fixed-overlay--fade-enter-from,.devui-fixed-overlay--fade-leave-to{opacity:0}.devui-flexible-overlay{position:fixed;border-radius:var(--devui-border-radius, 4px);background-color:var(--devui-connected-overlay-bg, #ffffff);box-shadow:var(--devui-shadow-length-connected-overlay, 0 4px 8px 0) var(--devui-shadow, rgba(37, 43, 58, .2));z-index:1000}.devui-flexible-overlay__arrow{position:absolute;width:8px;height:8px;transform:rotate(45deg);background-color:inherit}.devui-dropdown span.icon-chevron-down,.devui-dropdown span.icon-select-arrow{display:inline-block;vertical-align:text-top}.devui-dropdown__menu-wrap .devui-dropdown-menu{width:100%}.devui-dropdown-animation span.icon-chevron-down,.devui-dropdown-animation span.icon-select-arrow{transition:transform var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-dropdown.open span.icon-chevron-down,.devui-dropdown.open span.icon-select-arrow{transform:rotate(180deg)}.fade-in-top{animation:fadeInTop .2s cubic-bezier(.16,.75,.5,1)}.fade-in-bottom{animation:fadeInBottom .2s cubic-bezier(.16,.75,.5,1)}@keyframes fadeInTop{0%{opacity:.8;transform:scaleY(.8) translateY(4px)}to{opacity:1;transform:scaleY(.9999) translateY(0)}}@keyframes fadeInBottom{0%{opacity:.8;transform:scaleY(.8) translateY(-4px)}to{opacity:1;transform:scaleY(.9999) translateY(0)}}.devui-dropdown--fade-bottom-enter-from,.devui-dropdown--fade-bottom-leave-to{opacity:.8;transform:scaleY(.8) translateY(-4px)}.devui-dropdown--fade-bottom-enter-to,.devui-dropdown--fade-bottom-leave-from{opacity:1;transform:scaleY(.9999) translateY(0)}.devui-dropdown--fade-bottom-enter-active{transition:transform .2s cubic-bezier(.16,.75,.5,1),opacity .2s cubic-bezier(.16,.75,.5,1)}.devui-dropdown--fade-bottom-leave-active{transition:transform .2s cubic-bezier(.5,0,.84,.25),opacity .2s cubic-bezier(.5,0,.84,.25)}.devui-dropdown--fade-top-enter-from,.devui-dropdown--fade-top-leave-to{opacity:.8;transform:scaleY(.8) translateY(4px)}.devui-dropdown--fade-top-enter-to,.devui-dropdown--fade-top-leave-from{opacity:1;transform:scaleY(.9999) translateY(0)}.devui-dropdown--fade-top-enter-active{transition:transform .2s cubic-bezier(.16,.75,.5,1),opacity .2s cubic-bezier(.16,.75,.5,1)}.devui-dropdown--fade-top-leave-active{transition:transform .2s cubic-bezier(.5,0,.84,.25),opacity .2s cubic-bezier(.5,0,.84,.25)}
|