vue-devui 1.0.0-rc.1 → 1.0.0-rc.12
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 +70 -121
- 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 +8204 -296
- 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 +36 -5
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.es.js +5727 -111
- package/button/index.umd.js +27 -1
- package/button/style.css +1 -1
- package/card/index.es.js +63 -35
- package/card/index.umd.js +1 -1
- package/card/style.css +1 -1
- package/checkbox/index.es.js +8068 -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 +213 -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 +59 -19
- package/countdown/index.umd.js +1 -1
- package/{anchor → date-picker-pro}/index.d.ts +0 -0
- package/date-picker-pro/index.es.js +10856 -0
- package/date-picker-pro/index.umd.js +27 -0
- package/{breadcrumb → date-picker-pro}/package.json +1 -1
- package/date-picker-pro/style.css +1 -0
- 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 +210 -149
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/index.es.js +569 -159
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.es.js +1048 -1187
- package/form/index.umd.js +15 -15
- 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 +183 -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 +8101 -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 +375 -171
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +293 -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/DRangeDatePickerPro.js +3 -0
- package/nuxt/components/DatePickerPro.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/OptionGroup.js +3 -0
- package/nuxt/components/RadioButton.js +3 -0
- package/nuxt/components/Step.js +3 -0
- package/nuxt/components/Steps.js +3 -0
- package/nuxt/components/TABLE_TOKEN.js +3 -0
- package/nuxt/components/Tab.js +3 -0
- package/nuxt/components/TimeSelect.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/datePickerProCommonProps.js +3 -0
- package/nuxt/components/datePickerProPanelProps.js +3 -0
- package/nuxt/components/datePickerProProps.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/stepProps.js +3 -0
- package/nuxt/components/stepsProps.js +3 -0
- package/nuxt/components/svgIconProps.js +3 -0
- package/nuxt/components/switchProps.js +3 -0
- package/nuxt/components/tableProps.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/timerPickerPanelProps.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 +4 -2
- package/pagination/index.es.js +171 -141
- 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 +7967 -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 +170 -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 +3660 -1097
- package/search/index.umd.js +18 -18
- package/search/style.css +1 -1
- package/select/index.es.js +8998 -487
- 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 +144 -138
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.es.js +468 -340
- package/splitter/index.umd.js +16 -16
- package/splitter/style.css +1 -1
- package/statistic/index.es.js +41 -34
- package/statistic/index.umd.js +1 -1
- package/statistic/style.css +1 -1
- package/status/index.es.js +26 -2
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- package/{back-top → steps}/index.d.ts +0 -0
- package/steps/index.es.js +385 -0
- package/steps/index.umd.js +1 -0
- package/{gantt → steps}/package.json +1 -1
- package/steps/style.css +1 -0
- package/style.css +1 -1
- package/switch/index.es.js +7802 -64
- package/switch/index.umd.js +27 -1
- package/switch/style.css +1 -1
- package/table/index.es.js +10315 -1147
- package/table/index.umd.js +27 -1
- package/table/style.css +1 -1
- package/tabs/index.es.js +345 -142
- 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 +7921 -83
- package/textarea/index.umd.js +35 -1
- package/textarea/style.css +1 -1
- package/time-picker/index.es.js +8704 -559
- package/time-picker/index.umd.js +27 -1
- package/time-picker/style.css +1 -1
- package/{breadcrumb → time-select}/index.d.ts +0 -0
- package/{color-picker → time-select}/index.es.js +4116 -2914
- package/time-select/index.umd.js +27 -0
- package/{back-top → time-select}/package.json +1 -1
- package/time-select/style.css +1 -0
- package/timeline/index.es.js +177 -37
- package/timeline/index.umd.js +1 -1
- package/timeline/style.css +1 -1
- package/tooltip/index.es.js +286 -221
- package/tooltip/index.umd.js +15 -15
- package/tooltip/style.css +1 -1
- package/tree/index.es.js +5325 -1855
- package/tree/index.umd.js +18 -18
- package/tree/style.css +1 -1
- package/upload/index.es.js +456 -133
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +14986 -16343
- package/vue-devui.umd.js +30 -20
- 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.es.js +0 -263
- package/anchor/index.umd.js +0 -1
- package/anchor/style.css +0 -1
- package/back-top/index.es.js +0 -130
- package/back-top/index.umd.js +0 -1
- package/back-top/style.css +0 -1
- package/breadcrumb/index.es.js +0 -128
- package/breadcrumb/index.umd.js +0 -1
- 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.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/date-picker/index.d.ts +0 -7
- package/date-picker/index.es.js +0 -1154
- package/date-picker/index.umd.js +0 -1
- package/date-picker/package.json +0 -7
- package/date-picker/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/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/DatePicker.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/StickSlider.js +0 -3
- package/nuxt/components/Sticky.js +0 -2
- package/nuxt/components/TagInput.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/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/drawer/index.es.js
CHANGED
|
@@ -53,14 +53,41 @@ const drawerOverlayProps = {
|
|
|
53
53
|
visible: {
|
|
54
54
|
type: Boolean,
|
|
55
55
|
default: false
|
|
56
|
+
},
|
|
57
|
+
onClick: {
|
|
58
|
+
type: Function
|
|
56
59
|
}
|
|
57
60
|
};
|
|
61
|
+
function createBem(namespace, element, modifier) {
|
|
62
|
+
let cls = namespace;
|
|
63
|
+
if (element) {
|
|
64
|
+
cls += `__${element}`;
|
|
65
|
+
}
|
|
66
|
+
if (modifier) {
|
|
67
|
+
cls += `--${modifier}`;
|
|
68
|
+
}
|
|
69
|
+
return cls;
|
|
70
|
+
}
|
|
71
|
+
function useNamespace(block, needDot = false) {
|
|
72
|
+
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
73
|
+
const b = () => createBem(namespace);
|
|
74
|
+
const e = (element) => element ? createBem(namespace, element) : "";
|
|
75
|
+
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
76
|
+
const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
|
|
77
|
+
return {
|
|
78
|
+
b,
|
|
79
|
+
e,
|
|
80
|
+
m,
|
|
81
|
+
em
|
|
82
|
+
};
|
|
83
|
+
}
|
|
58
84
|
var drawerOverlay = "";
|
|
59
85
|
var DrawerOverlay = defineComponent({
|
|
60
86
|
name: "DDrawerOverlay",
|
|
61
87
|
props: drawerOverlayProps,
|
|
62
88
|
emits: ["click"],
|
|
63
89
|
setup(props, ctx) {
|
|
90
|
+
const ns = useNamespace("drawer");
|
|
64
91
|
const handleClick = (e) => {
|
|
65
92
|
ctx.emit("click", e);
|
|
66
93
|
};
|
|
@@ -68,7 +95,7 @@ var DrawerOverlay = defineComponent({
|
|
|
68
95
|
"name": "drawer-overlay-fade"
|
|
69
96
|
}, {
|
|
70
97
|
default: () => [props.visible && createVNode("div", {
|
|
71
|
-
"class": "
|
|
98
|
+
"class": ns.e("overlay"),
|
|
72
99
|
"onClick": handleClick
|
|
73
100
|
}, null)]
|
|
74
101
|
});
|
|
@@ -94,10 +121,11 @@ function lockScroll() {
|
|
|
94
121
|
return;
|
|
95
122
|
}
|
|
96
123
|
function useDrawer(props, emit) {
|
|
124
|
+
const ns = useNamespace("drawer");
|
|
97
125
|
const drawerRef = ref();
|
|
98
126
|
const drawerClasses = computed(() => ({
|
|
99
|
-
|
|
100
|
-
[
|
|
127
|
+
[ns.b()]: true,
|
|
128
|
+
[ns.m(props.position)]: true
|
|
101
129
|
}));
|
|
102
130
|
const close = () => {
|
|
103
131
|
emit("update:modelValue", false);
|
|
@@ -195,7 +223,6 @@ function initInstance(state) {
|
|
|
195
223
|
state.modelValue = false;
|
|
196
224
|
};
|
|
197
225
|
onUnmounted(() => {
|
|
198
|
-
console.log(111);
|
|
199
226
|
document.body.removeChild(container);
|
|
200
227
|
});
|
|
201
228
|
return () => createVNode(Drawer, mergeProps(state, {
|
package/drawer/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var T=Object.defineProperty;var h=Object.getOwnPropertySymbols;var I=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable;var V=(l,t,a)=>t in l?T(l,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):l[t]=a,p=(l,t)=>{for(var a in t||(t={}))I.call(t,a)&&V(l,a,t[a]);if(h)for(var a of h(t))$.call(t,a)&&V(l,a,t[a]);return l};(function(l,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["exports","vue","@vueuse/core"],t):(l=typeof globalThis!="undefined"?globalThis:l||self,t(l.index={},l.Vue,l.core))})(this,function(l,t,a){"use strict";const O={modelValue:{type:Boolean,default:!1},zIndex:{type:Number,default:1e3},showOverlay:{type:Boolean,default:!0},escKeyCloseable:{type:Boolean,default:!0},position:{type:String,default:"right"},lockScroll:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0},beforeClose:{type:Function}},E={visible:{type:Boolean,default:!1},onClick:{type:Function}};function i(e,o,n){let r=e;return o&&(r+=`__${o}`),n&&(r+=`--${n}`),r}function w(e,o=!1){const n=o?`.devui-${e}`:`devui-${e}`;return{b:()=>i(n),e:c=>c?i(n,c):"",m:c=>c?i(n,"",c):"",em:(c,f)=>c&&f?i(n,c,f):""}}var z="",k=t.defineComponent({name:"DDrawerOverlay",props:E,emits:["click"],setup(e,o){const n=w("drawer"),r=d=>{o.emit("click",d)};return()=>t.createVNode(t.Transition,{name:"drawer-overlay-fade"},{default:()=>[e.visible&&t.createVNode("div",{class:n.e("overlay"),onClick:r},null)]})}});function g(){if(document.documentElement.scrollHeight>document.documentElement.clientHeight){const e=document.documentElement.scrollTop,o=document.documentElement.getAttribute("style");return document.documentElement.style.position="fixed",document.documentElement.style.top=`-${e}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=e}}}function D(e,o){const n=w("drawer"),r=t.ref(),d=t.computed(()=>({[n.b()]:!0,[n.m(e.position)]:!0})),s=()=>{o("update:modelValue",!1),o("close")};let u;const c=()=>{e.beforeClose?e.beforeClose(s):s()},f=()=>{e.closeOnClickOverlay&&c()},b=y=>{y.code==="Escape"&&c()};a.onClickOutside(r,c);const v=()=>{u==null||u(),document.removeEventListener("keyup",b)};return t.watch(()=>e.modelValue,y=>{y?(o("open"),e.lockScroll&&(u=g()),e.escKeyCloseable&&document.addEventListener("keyup",b)):v()}),t.onUnmounted(v),{drawerRef:r,drawerClasses:d,handleOverlayClick:f}}var A="",m=t.defineComponent({name:"DDrawer",inheritAttrs:!1,props:O,emits:["close","update:modelValue","open"],setup(e,{emit:o,slots:n,attrs:r}){const{drawerRef:d,drawerClasses:s,handleOverlayClick:u}=D(e,o);return()=>t.createVNode(t.Teleport,{to:"body"},{default:()=>[e.showOverlay&&t.createVNode(k,{visible:e.modelValue,style:{zIndex:e.zIndex},onClick:u},null),t.createVNode(t.Transition,{name:`drawer-fly-${e.position}`},{default:()=>{var c;return[e.modelValue&&t.createVNode("div",t.mergeProps({ref:d,class:s.value,style:{zIndex:e.zIndex+1}},r),[(c=n.default)==null?void 0:c.call(n)])]}})]})}});function S(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const x={modelValue:!1,content:"",zIndex:1e3,showOverlay:!0,escKeyCloseable:!0,position:"right",lockScroll:!0,closeOnClickOverlay:!0};function N(e){const o=document.createElement("div"),n=e.content;delete e.content;const r=t.createApp({setup(){const d=()=>{e.modelValue=!1};return t.onUnmounted(()=>{document.body.removeChild(o)}),()=>t.createVNode(m,t.mergeProps(e,{"onUpdate:modelValue":d}),S(n)?n:{default:()=>[n]})}});return document.body.appendChild(o),r.mount(o),r}class C{open(o){const n=t.reactive(p(p({},x),o)),r=N(n);return n.modelValue=!0,{close:()=>{n.modelValue=!1,r.unmount()}}}}var B={title:"Drawer \u62BD\u5C49\u677F",category:"\u53CD\u9988",status:"75%",install(e){e.component(m.name,m),e.config.globalProperties.$drawerService=new C}};l.Drawer=m,l.DrawerService=C,l.default=B,Object.defineProperty(l,"__esModule",{value:!0}),l[Symbol.toStringTag]="Module"});
|
package/drawer/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.devui-
|
|
1
|
+
.devui-drawer__overlay{position:fixed;top:0;right:0;bottom:0;left:0;background-color:var(--devui-shadow, rgba(37, 43, 58, .2))}.drawer-overlay-fade-enter-active,.drawer-overlay-fade-leave-active{transition:opacity .1s linear}.drawer-overlay-fade-enter-from,.drawer-overlay-fade-leave-to{opacity:0}.devui-drawer{position:fixed;top:0;bottom:0;width:300px;border-radius:var(--devui-border-radius, 4px);background-color:var(--devui-base-bg, #ffffff);transform:translate(0);opacity:1;overflow:auto;box-shadow:var(--devui-shadow-length-fullscreen-overlay, 0 12px 24px 0) var(--devui-shadow, rgba(37, 43, 58, .2))}.devui-drawer--left{left:0}.devui-drawer--right{right:0}.drawer-fly-right-enter-active{transition:all .3s cubic-bezier(.16,.75,.5,1)}.drawer-fly-right-leave-active{transition:all .3s cubic-bezier(.5,0,.84,.25)}.drawer-fly-right-enter-from,.drawer-fly-right-leave-to{opacity:0;transform:translate(100%)}.drawer-fly-left-enter-active{transition:all .3s cubic-bezier(.16,.75,.5,1)}.drawer-fly-left-leave-active{transition:all .3s cubic-bezier(.5,0,.84,.25)}.drawer-fly-left-enter-from,.drawer-fly-left-leave-to{opacity:0;transform:translate(-100%)}
|
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
|
})]
|
|
@@ -684,7 +745,7 @@ var DropdownMenu = defineComponent({
|
|
|
684
745
|
var index = {
|
|
685
746
|
title: "Dropdown \u4E0B\u62C9\u83DC\u5355",
|
|
686
747
|
category: "\u5BFC\u822A",
|
|
687
|
-
status: "
|
|
748
|
+
status: "50%",
|
|
688
749
|
install(app) {
|
|
689
750
|
app.component(Dropdown.name, Dropdown);
|
|
690
751
|
app.component(DropdownMenu.name, DropdownMenu);
|