vue-devui 1.0.0-pre.0 → 1.0.0-rc.2
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 +126 -187
- package/alert/index.es.js +28 -30
- package/alert/index.umd.js +1 -1
- package/auto-complete/index.es.js +67 -82
- package/auto-complete/index.umd.js +3 -1
- package/auto-complete/style.css +1 -1
- package/badge/index.es.js +1 -1
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.es.js +39 -40
- package/button/index.umd.js +1 -1
- package/countdown/index.es.js +2 -1
- package/editable-select/index.es.js +122 -163
- package/editable-select/index.umd.js +1 -1
- package/fullscreen/index.es.js +13 -16
- package/fullscreen/index.umd.js +1 -1
- package/icon/index.es.js +39 -57
- package/icon/index.umd.js +1 -1
- package/image-preview/index.es.js +2 -1
- package/modal/index.es.js +81 -76
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +38 -40
- package/notification/index.umd.js +1 -1
- package/nuxt/components/PanelBody.js +3 -0
- package/nuxt/components/PanelFooter.js +3 -0
- package/nuxt/components/PanelHeader.js +3 -0
- package/nuxt/components/Timeline.js +3 -0
- package/nuxt/components/TimelineItem.js +3 -0
- package/nuxt/components/alertProps.js +3 -0
- package/nuxt/components/fullscreenProps.js +3 -0
- package/nuxt/components/iconProps.js +2 -0
- package/nuxt/components/paginationProps.js +3 -0
- package/nuxt/components/panelProps.js +3 -0
- package/nuxt/components/searchProps.js +3 -0
- package/nuxt/components/tagProps.js +3 -0
- package/overlay/index.es.js +44 -37
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +8 -43
- package/pagination/index.es.js +10 -12
- package/pagination/index.umd.js +1 -1
- package/panel/index.es.js +45 -32
- package/panel/index.umd.js +1 -1
- package/popover/index.es.js +46 -39
- package/popover/index.umd.js +6 -6
- package/popover/style.css +1 -1
- package/progress/index.es.js +1 -1
- package/progress/index.umd.js +1 -1
- package/progress/style.css +1 -1
- package/radio/index.es.js +11 -11
- package/radio/index.umd.js +1 -1
- package/radio/style.css +1 -1
- package/read-tip/index.es.js +6 -3
- package/result/index.es.js +38 -53
- package/result/index.umd.js +1 -1
- package/ripple/index.es.js +47 -42
- package/ripple/index.umd.js +1 -1
- package/search/index.es.js +2 -5
- package/search/index.umd.js +4 -4
- package/skeleton/index.es.js +17 -17
- package/skeleton/index.umd.js +1 -1
- package/slider/index.es.js +60 -59
- package/slider/index.umd.js +1 -1
- package/splitter/index.es.js +215 -160
- package/splitter/index.umd.js +11 -11
- package/splitter/style.css +1 -1
- package/status/index.es.js +1 -4
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- package/style.css +1 -1
- package/tag/index.es.js +15 -18
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/tag-input/index.es.js +4 -2
- package/{accordion → timeline}/index.d.ts +0 -0
- package/{time-axis → timeline}/index.es.js +65 -78
- package/timeline/index.umd.js +1 -0
- package/{anchor → timeline}/package.json +1 -1
- package/timeline/style.css +1 -0
- package/upload/index.es.js +38 -40
- package/upload/index.umd.js +1 -1
- package/vue-devui.es.js +1478 -1196
- package/vue-devui.umd.js +19 -17
- package/accordion/index.es.js +0 -720
- 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 -128
- 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 -127
- 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 -329
- 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 -5963
- 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 -8187
- package/color-picker/index.umd.js +0 -27
- package/color-picker/package.json +0 -7
- package/color-picker/style.css +0 -1
- package/date-picker/index.d.ts +0 -7
- package/date-picker/index.es.js +0 -1171
- 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/drawer/index.d.ts +0 -7
- package/drawer/index.es.js +0 -234
- package/drawer/index.umd.js +0 -1
- package/drawer/package.json +0 -7
- package/drawer/style.css +0 -1
- package/dropdown/index.d.ts +0 -7
- package/dropdown/index.es.js +0 -638
- package/dropdown/index.umd.js +0 -1
- package/dropdown/package.json +0 -7
- package/dropdown/style.css +0 -1
- package/form/index.d.ts +0 -7
- package/form/index.es.js +0 -7865
- package/form/index.umd.js +0 -27
- package/form/package.json +0 -7
- package/form/style.css +0 -1
- 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 -331
- package/input-icon/index.umd.js +0 -1
- package/input-icon/package.json +0 -7
- package/input-icon/style.css +0 -1
- package/input-number/index.d.ts +0 -7
- package/input-number/index.es.js +0 -240
- package/input-number/index.umd.js +0 -1
- package/input-number/package.json +0 -7
- package/input-number/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/Column.js +0 -3
- package/nuxt/components/DatePicker.js +0 -3
- package/nuxt/components/Drawer.js +0 -3
- package/nuxt/components/DrawerService.js +0 -3
- package/nuxt/components/Dropdown.js +0 -3
- package/nuxt/components/DropdownMenu.js +0 -3
- package/nuxt/components/Form.js +0 -3
- package/nuxt/components/FormControl.js +0 -3
- package/nuxt/components/FormItem.js +0 -3
- package/nuxt/components/FormLabel.js +0 -3
- package/nuxt/components/FormOperation.js +0 -3
- package/nuxt/components/Gantt.js +0 -3
- package/nuxt/components/InputIcon.js +0 -3
- package/nuxt/components/InputNumber.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/Select.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/Table.js +0 -3
- package/nuxt/components/Tabs.js +0 -3
- package/nuxt/components/TimeAxis.js +0 -3
- package/nuxt/components/TimeAxisItem.js +0 -3
- package/nuxt/components/TimePicker.js +0 -3
- package/nuxt/components/Tooltip.js +0 -3
- package/nuxt/components/Transfer.js +0 -3
- package/nuxt/components/Tree.js +0 -3
- package/nuxt/components/TreeSelect.js +0 -3
- package/nuxt/components/dropdownMenuProps.js +0 -3
- package/nuxt/components/tooltipProps.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/select/index.d.ts +0 -7
- package/select/index.es.js +0 -706
- package/select/index.umd.js +0 -1
- package/select/package.json +0 -7
- package/select/style.css +0 -1
- package/steps-guide/index.d.ts +0 -7
- package/steps-guide/index.es.js +0 -239
- 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/table/index.d.ts +0 -7
- package/table/index.es.js +0 -1969
- package/table/index.umd.js +0 -1
- package/table/package.json +0 -7
- package/table/style.css +0 -1
- package/tabs/index.d.ts +0 -7
- package/tabs/index.es.js +0 -194
- package/tabs/index.umd.js +0 -1
- package/tabs/package.json +0 -7
- package/tabs/style.css +0 -1
- package/time-axis/index.d.ts +0 -7
- package/time-axis/index.umd.js +0 -1
- package/time-axis/package.json +0 -7
- package/time-axis/style.css +0 -1
- package/time-picker/index.d.ts +0 -7
- package/time-picker/index.es.js +0 -1237
- package/time-picker/index.umd.js +0 -1
- package/time-picker/package.json +0 -7
- package/time-picker/style.css +0 -1
- package/tooltip/index.d.ts +0 -7
- package/tooltip/index.es.js +0 -5828
- package/tooltip/index.umd.js +0 -27
- package/tooltip/package.json +0 -7
- package/tooltip/style.css +0 -1
- package/transfer/index.d.ts +0 -7
- package/transfer/index.es.js +0 -7608
- package/transfer/index.umd.js +0 -27
- package/transfer/package.json +0 -7
- package/transfer/style.css +0 -1
- package/tree/index.d.ts +0 -7
- package/tree/index.es.js +0 -6490
- package/tree/index.umd.js +0 -27
- package/tree/package.json +0 -7
- package/tree/style.css +0 -1
- package/tree-select/index.d.ts +0 -7
- package/tree-select/index.es.js +0 -623
- 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
DELETED
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __spreadValues = (a, b) => {
|
|
7
|
-
for (var prop in b || (b = {}))
|
|
8
|
-
if (__hasOwnProp.call(b, prop))
|
|
9
|
-
__defNormalProp(a, prop, b[prop]);
|
|
10
|
-
if (__getOwnPropSymbols)
|
|
11
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
-
if (__propIsEnum.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
}
|
|
15
|
-
return a;
|
|
16
|
-
};
|
|
17
|
-
import { defineComponent, createVNode, Transition, ref, computed, watch, onUnmounted, Teleport, mergeProps, reactive, createApp, isVNode } from "vue";
|
|
18
|
-
import { onClickOutside } from "@vueuse/core";
|
|
19
|
-
const drawerProps = {
|
|
20
|
-
modelValue: {
|
|
21
|
-
type: Boolean,
|
|
22
|
-
default: false
|
|
23
|
-
},
|
|
24
|
-
zIndex: {
|
|
25
|
-
type: Number,
|
|
26
|
-
default: 1e3
|
|
27
|
-
},
|
|
28
|
-
showOverlay: {
|
|
29
|
-
type: Boolean,
|
|
30
|
-
default: true
|
|
31
|
-
},
|
|
32
|
-
escKeyCloseable: {
|
|
33
|
-
type: Boolean,
|
|
34
|
-
default: true
|
|
35
|
-
},
|
|
36
|
-
position: {
|
|
37
|
-
type: String,
|
|
38
|
-
default: "right"
|
|
39
|
-
},
|
|
40
|
-
lockScroll: {
|
|
41
|
-
type: Boolean,
|
|
42
|
-
default: true
|
|
43
|
-
},
|
|
44
|
-
closeOnClickOverlay: {
|
|
45
|
-
type: Boolean,
|
|
46
|
-
default: true
|
|
47
|
-
},
|
|
48
|
-
beforeClose: {
|
|
49
|
-
type: Function
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
const drawerOverlayProps = {
|
|
53
|
-
visible: {
|
|
54
|
-
type: Boolean,
|
|
55
|
-
default: false
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
var drawerOverlay = "";
|
|
59
|
-
var DrawerOverlay = defineComponent({
|
|
60
|
-
name: "DDrawerOverlay",
|
|
61
|
-
props: drawerOverlayProps,
|
|
62
|
-
emits: ["click"],
|
|
63
|
-
setup(props, ctx) {
|
|
64
|
-
const handleClick = (e) => {
|
|
65
|
-
ctx.emit("click", e);
|
|
66
|
-
};
|
|
67
|
-
return () => createVNode(Transition, {
|
|
68
|
-
"name": "drawer-overlay-fade"
|
|
69
|
-
}, {
|
|
70
|
-
default: () => [props.visible && createVNode("div", {
|
|
71
|
-
"class": "devui-drawer-overlay",
|
|
72
|
-
"onClick": handleClick
|
|
73
|
-
}, null)]
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
function lockScroll() {
|
|
78
|
-
if (document.documentElement.scrollHeight > document.documentElement.clientHeight) {
|
|
79
|
-
const scrollTop = document.documentElement.scrollTop;
|
|
80
|
-
const style = document.documentElement.getAttribute("style");
|
|
81
|
-
document.documentElement.style.position = "fixed";
|
|
82
|
-
document.documentElement.style.top = `-${scrollTop}px`;
|
|
83
|
-
document.documentElement.style.width = document.documentElement.style.width || "100%";
|
|
84
|
-
document.documentElement.style.overflowY = "scroll";
|
|
85
|
-
return () => {
|
|
86
|
-
if (style) {
|
|
87
|
-
document.documentElement.setAttribute("style", style);
|
|
88
|
-
} else {
|
|
89
|
-
document.documentElement.removeAttribute("style");
|
|
90
|
-
}
|
|
91
|
-
document.documentElement.scrollTop = scrollTop;
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
function useDrawer(props, emit) {
|
|
97
|
-
const drawerRef = ref();
|
|
98
|
-
const drawerClasses = computed(() => ({
|
|
99
|
-
"devui-drawer": true,
|
|
100
|
-
[`devui-drawer-${props.position}`]: true
|
|
101
|
-
}));
|
|
102
|
-
const close = () => {
|
|
103
|
-
emit("update:modelValue", false);
|
|
104
|
-
emit("close");
|
|
105
|
-
};
|
|
106
|
-
let lockScrollCb;
|
|
107
|
-
const execClose = () => {
|
|
108
|
-
props.beforeClose ? props.beforeClose(close) : close();
|
|
109
|
-
};
|
|
110
|
-
const handleOverlayClick = () => {
|
|
111
|
-
props.closeOnClickOverlay && execClose();
|
|
112
|
-
};
|
|
113
|
-
const handleEscClose = (e) => {
|
|
114
|
-
e.code === "Escape" && execClose();
|
|
115
|
-
};
|
|
116
|
-
onClickOutside(drawerRef, execClose);
|
|
117
|
-
const removeBodyAdditions = () => {
|
|
118
|
-
lockScrollCb == null ? void 0 : lockScrollCb();
|
|
119
|
-
document.removeEventListener("keyup", handleEscClose);
|
|
120
|
-
};
|
|
121
|
-
watch(() => props.modelValue, (val) => {
|
|
122
|
-
if (val) {
|
|
123
|
-
emit("open");
|
|
124
|
-
props.lockScroll && (lockScrollCb = lockScroll());
|
|
125
|
-
props.escKeyCloseable && document.addEventListener("keyup", handleEscClose);
|
|
126
|
-
} else {
|
|
127
|
-
removeBodyAdditions();
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
onUnmounted(removeBodyAdditions);
|
|
131
|
-
return { drawerRef, drawerClasses, handleOverlayClick };
|
|
132
|
-
}
|
|
133
|
-
var drawer = "";
|
|
134
|
-
var Drawer = defineComponent({
|
|
135
|
-
name: "DDrawer",
|
|
136
|
-
inheritAttrs: false,
|
|
137
|
-
props: drawerProps,
|
|
138
|
-
emits: ["close", "update:modelValue", "open"],
|
|
139
|
-
setup(props, {
|
|
140
|
-
emit,
|
|
141
|
-
slots,
|
|
142
|
-
attrs
|
|
143
|
-
}) {
|
|
144
|
-
const {
|
|
145
|
-
drawerRef,
|
|
146
|
-
drawerClasses,
|
|
147
|
-
handleOverlayClick
|
|
148
|
-
} = useDrawer(props, emit);
|
|
149
|
-
return () => createVNode(Teleport, {
|
|
150
|
-
"to": "body"
|
|
151
|
-
}, {
|
|
152
|
-
default: () => [props.showOverlay && createVNode(DrawerOverlay, {
|
|
153
|
-
"visible": props.modelValue,
|
|
154
|
-
"style": {
|
|
155
|
-
zIndex: props.zIndex
|
|
156
|
-
},
|
|
157
|
-
"onClick": handleOverlayClick
|
|
158
|
-
}, null), createVNode(Transition, {
|
|
159
|
-
"name": `drawer-fly-${props.position}`
|
|
160
|
-
}, {
|
|
161
|
-
default: () => {
|
|
162
|
-
var _a;
|
|
163
|
-
return [props.modelValue && createVNode("div", mergeProps({
|
|
164
|
-
"ref": drawerRef,
|
|
165
|
-
"class": drawerClasses.value,
|
|
166
|
-
"style": {
|
|
167
|
-
zIndex: props.zIndex + 1
|
|
168
|
-
}
|
|
169
|
-
}, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots)])];
|
|
170
|
-
}
|
|
171
|
-
})]
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
function _isSlot(s) {
|
|
176
|
-
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
177
|
-
}
|
|
178
|
-
const defaultOptions = {
|
|
179
|
-
modelValue: false,
|
|
180
|
-
content: "",
|
|
181
|
-
zIndex: 1e3,
|
|
182
|
-
showOverlay: true,
|
|
183
|
-
escKeyCloseable: true,
|
|
184
|
-
position: "right",
|
|
185
|
-
lockScroll: true,
|
|
186
|
-
closeOnClickOverlay: true
|
|
187
|
-
};
|
|
188
|
-
function initInstance(state) {
|
|
189
|
-
const container = document.createElement("div");
|
|
190
|
-
const content = state.content;
|
|
191
|
-
delete state.content;
|
|
192
|
-
const app = createApp({
|
|
193
|
-
setup() {
|
|
194
|
-
const handleVisibleChange = () => {
|
|
195
|
-
state.modelValue = false;
|
|
196
|
-
};
|
|
197
|
-
onUnmounted(() => {
|
|
198
|
-
console.log(111);
|
|
199
|
-
document.body.removeChild(container);
|
|
200
|
-
});
|
|
201
|
-
return () => createVNode(Drawer, mergeProps(state, {
|
|
202
|
-
"onUpdate:modelValue": handleVisibleChange
|
|
203
|
-
}), _isSlot(content) ? content : {
|
|
204
|
-
default: () => [content]
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
document.body.appendChild(container);
|
|
209
|
-
app.mount(container);
|
|
210
|
-
return app;
|
|
211
|
-
}
|
|
212
|
-
class DrawerService {
|
|
213
|
-
open(options) {
|
|
214
|
-
const state = reactive(__spreadValues(__spreadValues({}, defaultOptions), options));
|
|
215
|
-
const app = initInstance(state);
|
|
216
|
-
state.modelValue = true;
|
|
217
|
-
return {
|
|
218
|
-
close: () => {
|
|
219
|
-
state.modelValue = false;
|
|
220
|
-
app.unmount();
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
var index = {
|
|
226
|
-
title: "Drawer \u62BD\u5C49\u677F",
|
|
227
|
-
category: "\u53CD\u9988",
|
|
228
|
-
status: "75%",
|
|
229
|
-
install(app) {
|
|
230
|
-
app.component(Drawer.name, Drawer);
|
|
231
|
-
app.config.globalProperties.$drawerService = new DrawerService();
|
|
232
|
-
}
|
|
233
|
-
};
|
|
234
|
-
export { Drawer, DrawerService, index as default };
|
package/drawer/index.umd.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var x=Object.defineProperty;var C=Object.getOwnPropertySymbols;var N=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var v=(o,e,r)=>e in o?x(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,f=(o,e)=>{for(var r in e||(e={}))N.call(e,r)&&v(o,r,e[r]);if(C)for(var r of C(e))T.call(e,r)&&v(o,r,e[r]);return o};(function(o,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["exports","vue","@vueuse/core"],e):(o=typeof globalThis!="undefined"?globalThis:o||self,e(o.index={},o.Vue,o.core))})(this,function(o,e,r){"use strict";const h={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}},b={visible:{type:Boolean,default:!1}};var B="",V=e.defineComponent({name:"DDrawerOverlay",props:b,emits:["click"],setup(t,n){const l=d=>{n.emit("click",d)};return()=>e.createVNode(e.Transition,{name:"drawer-overlay-fade"},{default:()=>[t.visible&&e.createVNode("div",{class:"devui-drawer-overlay",onClick:l},null)]})}});function O(){if(document.documentElement.scrollHeight>document.documentElement.clientHeight){const t=document.documentElement.scrollTop,n=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",()=>{n?document.documentElement.setAttribute("style",n):document.documentElement.removeAttribute("style"),document.documentElement.scrollTop=t}}}function E(t,n){const l=e.ref(),d=e.computed(()=>({"devui-drawer":!0,[`devui-drawer-${t.position}`]:!0})),c=()=>{n("update:modelValue",!1),n("close")};let a;const u=()=>{t.beforeClose?t.beforeClose(c):c()},s=()=>{t.closeOnClickOverlay&&u()},p=m=>{m.code==="Escape"&&u()};r.onClickOutside(l,u);const w=()=>{a==null||a(),document.removeEventListener("keyup",p)};return e.watch(()=>t.modelValue,m=>{m?(n("open"),t.lockScroll&&(a=O()),t.escKeyCloseable&&document.addEventListener("keyup",p)):w()}),e.onUnmounted(w),{drawerRef:l,drawerClasses:d,handleOverlayClick:s}}var I="",i=e.defineComponent({name:"DDrawer",inheritAttrs:!1,props:h,emits:["close","update:modelValue","open"],setup(t,{emit:n,slots:l,attrs:d}){const{drawerRef:c,drawerClasses:a,handleOverlayClick:u}=E(t,n);return()=>e.createVNode(e.Teleport,{to:"body"},{default:()=>[t.showOverlay&&e.createVNode(V,{visible:t.modelValue,style:{zIndex:t.zIndex},onClick:u},null),e.createVNode(e.Transition,{name:`drawer-fly-${t.position}`},{default:()=>{var s;return[t.modelValue&&e.createVNode("div",e.mergeProps({ref:c,class:a.value,style:{zIndex:t.zIndex+1}},d),[(s=l.default)==null?void 0:s.call(l)])]}})]})}});function k(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!e.isVNode(t)}const g={modelValue:!1,content:"",zIndex:1e3,showOverlay:!0,escKeyCloseable:!0,position:"right",lockScroll:!0,closeOnClickOverlay:!0};function D(t){const n=document.createElement("div"),l=t.content;delete t.content;const d=e.createApp({setup(){const c=()=>{t.modelValue=!1};return e.onUnmounted(()=>{console.log(111),document.body.removeChild(n)}),()=>e.createVNode(i,e.mergeProps(t,{"onUpdate:modelValue":c}),k(l)?l:{default:()=>[l]})}});return document.body.appendChild(n),d.mount(n),d}class y{open(n){const l=e.reactive(f(f({},g),n)),d=D(l);return l.modelValue=!0,{close:()=>{l.modelValue=!1,d.unmount()}}}}var S={title:"Drawer \u62BD\u5C49\u677F",category:"\u53CD\u9988",status:"75%",install(t){t.component(i.name,i),t.config.globalProperties.$drawerService=new y}};o.Drawer=i,o.DrawerService=y,o.default=S,Object.defineProperty(o,"__esModule",{value:!0}),o[Symbol.toStringTag]="Module"});
|
package/drawer/package.json
DELETED
package/drawer/style.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.devui-drawer-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background-color:var(--devui-shadow, rgba(0, 0, 0, .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, 2px);background-color:var(--devui-base-bg, #ffffff);transform:translate(0);opacity:1;overflow:auto;box-shadow:var(--devui-shadow-fullscreen-overlay, 0 8px 40px 0) var(--devui-shadow, rgba(0, 0, 0, .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%)}
|