vue-devui 1.0.0-rc.0 → 1.0.0-rc.3

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.
Files changed (320) hide show
  1. package/README.md +55 -113
  2. package/alert/index.es.js +28 -30
  3. package/alert/index.umd.js +1 -1
  4. package/auto-complete/index.es.js +143 -103
  5. package/auto-complete/index.umd.js +5 -1
  6. package/auto-complete/style.css +1 -1
  7. package/avatar/index.es.js +77 -81
  8. package/avatar/index.umd.js +1 -1
  9. package/badge/index.es.js +1 -1
  10. package/badge/index.umd.js +1 -1
  11. package/badge/style.css +1 -1
  12. package/button/index.es.js +43 -43
  13. package/button/index.umd.js +1 -1
  14. package/card/index.es.js +3 -6
  15. package/card/index.umd.js +1 -1
  16. package/checkbox/index.es.js +5 -11
  17. package/checkbox/index.umd.js +1 -1
  18. package/comment/index.es.js +2 -5
  19. package/comment/index.umd.js +1 -1
  20. package/countdown/index.es.js +5 -7
  21. package/countdown/index.umd.js +1 -1
  22. package/editable-select/index.es.js +124 -168
  23. package/editable-select/index.umd.js +1 -1
  24. package/fullscreen/index.es.js +13 -16
  25. package/fullscreen/index.umd.js +1 -1
  26. package/grid/index.es.js +30 -36
  27. package/grid/index.umd.js +1 -1
  28. package/icon/index.es.js +39 -57
  29. package/icon/index.umd.js +1 -1
  30. package/image-preview/index.es.js +21 -20
  31. package/image-preview/index.umd.js +1 -1
  32. package/input/index.es.js +2 -5
  33. package/input/index.umd.js +1 -1
  34. package/layout/index.es.js +6 -21
  35. package/layout/index.umd.js +1 -1
  36. package/loading/index.es.js +20 -12
  37. package/loading/index.umd.js +1 -1
  38. package/modal/index.es.js +135 -122
  39. package/modal/index.umd.js +1 -1
  40. package/modal/style.css +1 -1
  41. package/notification/index.es.js +38 -40
  42. package/notification/index.umd.js +1 -1
  43. package/nuxt/components/DropdownPropsKey.js +3 -0
  44. package/nuxt/components/PanelBody.js +3 -0
  45. package/nuxt/components/PanelFooter.js +3 -0
  46. package/nuxt/components/PanelHeader.js +3 -0
  47. package/nuxt/components/Timeline.js +3 -0
  48. package/nuxt/components/TimelineItem.js +3 -0
  49. package/nuxt/components/alertProps.js +3 -0
  50. package/nuxt/components/autoCompleteProps.js +3 -0
  51. package/nuxt/components/avatarProps.js +3 -0
  52. package/nuxt/components/cardProps.js +3 -0
  53. package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
  54. package/nuxt/components/checkboxGroupProps.js +3 -0
  55. package/nuxt/components/checkboxProps.js +3 -0
  56. package/nuxt/components/colProps.js +3 -0
  57. package/nuxt/components/colPropsBaseClass.js +3 -0
  58. package/nuxt/components/colPropsBaseStyle.js +3 -0
  59. package/nuxt/components/commentProps.js +3 -0
  60. package/nuxt/components/countdownProps.js +3 -0
  61. package/nuxt/components/editableSelectProps.js +3 -0
  62. package/nuxt/components/fullscreenProps.js +3 -0
  63. package/nuxt/components/iconProps.js +2 -0
  64. package/nuxt/components/imagePreviewProps.js +3 -0
  65. package/nuxt/components/inputProps.js +3 -0
  66. package/nuxt/components/paginationProps.js +3 -0
  67. package/nuxt/components/panelProps.js +3 -0
  68. package/nuxt/components/progressProps.js +3 -0
  69. package/nuxt/components/rateProps.js +3 -0
  70. package/nuxt/components/readTipProps.js +3 -0
  71. package/nuxt/components/resultProps.js +3 -0
  72. package/nuxt/components/rowProps.js +3 -0
  73. package/nuxt/components/screenSizes.js +3 -0
  74. package/nuxt/components/searchProps.js +3 -0
  75. package/nuxt/components/skeletonProps.js +3 -0
  76. package/nuxt/components/splitterProps.js +3 -0
  77. package/nuxt/components/statisticProps.js +3 -0
  78. package/nuxt/components/switchProps.js +3 -0
  79. package/nuxt/components/tagInputProps.js +3 -0
  80. package/nuxt/components/tagProps.js +3 -0
  81. package/nuxt/components/textareaProps.js +3 -0
  82. package/nuxt/components/timeAxisProps.js +3 -0
  83. package/overlay/index.es.js +49 -42
  84. package/overlay/index.umd.js +1 -1
  85. package/overlay/style.css +1 -1
  86. package/package.json +8 -43
  87. package/pagination/index.es.js +24 -25
  88. package/pagination/index.umd.js +1 -1
  89. package/panel/index.es.js +45 -32
  90. package/panel/index.umd.js +1 -1
  91. package/popover/index.es.js +51 -44
  92. package/popover/index.umd.js +12 -12
  93. package/popover/style.css +1 -1
  94. package/progress/index.es.js +34 -36
  95. package/progress/index.umd.js +3 -3
  96. package/progress/style.css +1 -1
  97. package/radio/index.es.js +11 -11
  98. package/radio/index.umd.js +1 -1
  99. package/radio/style.css +1 -1
  100. package/rate/index.es.js +4 -7
  101. package/rate/index.umd.js +1 -1
  102. package/read-tip/index.es.js +8 -8
  103. package/read-tip/index.umd.js +1 -1
  104. package/result/index.es.js +40 -58
  105. package/result/index.umd.js +1 -1
  106. package/ripple/index.es.js +47 -42
  107. package/ripple/index.umd.js +1 -1
  108. package/search/index.es.js +13 -16
  109. package/search/index.umd.js +8 -8
  110. package/skeleton/index.es.js +20 -23
  111. package/skeleton/index.umd.js +1 -1
  112. package/slider/index.es.js +60 -59
  113. package/slider/index.umd.js +1 -1
  114. package/splitter/index.es.js +223 -171
  115. package/splitter/index.umd.js +13 -13
  116. package/splitter/style.css +1 -1
  117. package/statistic/index.es.js +7 -18
  118. package/statistic/index.umd.js +1 -1
  119. package/status/index.es.js +1 -4
  120. package/status/index.umd.js +1 -1
  121. package/status/style.css +1 -1
  122. package/style.css +1 -1
  123. package/switch/index.es.js +3 -6
  124. package/switch/index.umd.js +1 -1
  125. package/tag/index.es.js +15 -18
  126. package/tag/index.umd.js +1 -1
  127. package/tag/style.css +1 -1
  128. package/tag-input/index.es.js +7 -8
  129. package/tag-input/index.umd.js +1 -1
  130. package/textarea/index.es.js +2 -5
  131. package/textarea/index.umd.js +1 -1
  132. package/{accordion → timeline}/index.d.ts +0 -0
  133. package/{time-axis → timeline}/index.es.js +64 -83
  134. package/timeline/index.umd.js +1 -0
  135. package/{anchor → timeline}/package.json +1 -1
  136. package/timeline/style.css +1 -0
  137. package/upload/index.es.js +98 -97
  138. package/upload/index.umd.js +1 -1
  139. package/vue-devui.es.js +12477 -24991
  140. package/vue-devui.umd.js +24 -20
  141. package/accordion/index.es.js +0 -720
  142. package/accordion/index.umd.js +0 -1
  143. package/accordion/package.json +0 -7
  144. package/accordion/style.css +0 -1
  145. package/anchor/index.d.ts +0 -7
  146. package/anchor/index.es.js +0 -263
  147. package/anchor/index.umd.js +0 -1
  148. package/anchor/style.css +0 -1
  149. package/back-top/index.d.ts +0 -7
  150. package/back-top/index.es.js +0 -128
  151. package/back-top/index.umd.js +0 -1
  152. package/back-top/package.json +0 -7
  153. package/back-top/style.css +0 -1
  154. package/breadcrumb/index.d.ts +0 -7
  155. package/breadcrumb/index.es.js +0 -127
  156. package/breadcrumb/index.umd.js +0 -1
  157. package/breadcrumb/package.json +0 -7
  158. package/breadcrumb/style.css +0 -1
  159. package/carousel/index.d.ts +0 -7
  160. package/carousel/index.es.js +0 -329
  161. package/carousel/index.umd.js +0 -1
  162. package/carousel/package.json +0 -7
  163. package/carousel/style.css +0 -1
  164. package/cascader/index.d.ts +0 -7
  165. package/cascader/index.es.js +0 -5963
  166. package/cascader/index.umd.js +0 -27
  167. package/cascader/package.json +0 -7
  168. package/cascader/style.css +0 -1
  169. package/color-picker/index.d.ts +0 -7
  170. package/color-picker/index.es.js +0 -8187
  171. package/color-picker/index.umd.js +0 -27
  172. package/color-picker/package.json +0 -7
  173. package/color-picker/style.css +0 -1
  174. package/date-picker/index.d.ts +0 -7
  175. package/date-picker/index.es.js +0 -1171
  176. package/date-picker/index.umd.js +0 -1
  177. package/date-picker/package.json +0 -7
  178. package/date-picker/style.css +0 -1
  179. package/dragdrop/index.d.ts +0 -7
  180. package/dragdrop/index.es.js +0 -157
  181. package/dragdrop/index.umd.js +0 -1
  182. package/dragdrop/package.json +0 -7
  183. package/drawer/index.d.ts +0 -7
  184. package/drawer/index.es.js +0 -234
  185. package/drawer/index.umd.js +0 -1
  186. package/drawer/package.json +0 -7
  187. package/drawer/style.css +0 -1
  188. package/dropdown/index.d.ts +0 -7
  189. package/dropdown/index.es.js +0 -638
  190. package/dropdown/index.umd.js +0 -1
  191. package/dropdown/package.json +0 -7
  192. package/dropdown/style.css +0 -1
  193. package/form/index.d.ts +0 -7
  194. package/form/index.es.js +0 -7865
  195. package/form/index.umd.js +0 -27
  196. package/form/package.json +0 -7
  197. package/form/style.css +0 -1
  198. package/gantt/index.d.ts +0 -7
  199. package/gantt/index.es.js +0 -523
  200. package/gantt/index.umd.js +0 -1
  201. package/gantt/package.json +0 -7
  202. package/gantt/style.css +0 -1
  203. package/input-icon/index.d.ts +0 -7
  204. package/input-icon/index.es.js +0 -331
  205. package/input-icon/index.umd.js +0 -1
  206. package/input-icon/package.json +0 -7
  207. package/input-icon/style.css +0 -1
  208. package/input-number/index.d.ts +0 -7
  209. package/input-number/index.es.js +0 -240
  210. package/input-number/index.umd.js +0 -1
  211. package/input-number/package.json +0 -7
  212. package/input-number/style.css +0 -1
  213. package/list/index.d.ts +0 -7
  214. package/list/index.es.js +0 -39
  215. package/list/index.umd.js +0 -1
  216. package/list/package.json +0 -7
  217. package/list/style.css +0 -1
  218. package/nav-sprite/index.d.ts +0 -7
  219. package/nav-sprite/index.es.js +0 -68
  220. package/nav-sprite/index.umd.js +0 -1
  221. package/nav-sprite/package.json +0 -7
  222. package/nuxt/components/Accordion.js +0 -3
  223. package/nuxt/components/Anchor.js +0 -3
  224. package/nuxt/components/BackTop.js +0 -3
  225. package/nuxt/components/Breadcrumb.js +0 -3
  226. package/nuxt/components/Carousel.js +0 -3
  227. package/nuxt/components/CarouselItem.js +0 -3
  228. package/nuxt/components/Cascader.js +0 -3
  229. package/nuxt/components/ColorPicker.js +0 -3
  230. package/nuxt/components/Column.js +0 -3
  231. package/nuxt/components/DatePicker.js +0 -3
  232. package/nuxt/components/Drawer.js +0 -3
  233. package/nuxt/components/DrawerService.js +0 -3
  234. package/nuxt/components/Dropdown.js +0 -3
  235. package/nuxt/components/DropdownMenu.js +0 -3
  236. package/nuxt/components/Form.js +0 -3
  237. package/nuxt/components/FormControl.js +0 -3
  238. package/nuxt/components/FormItem.js +0 -3
  239. package/nuxt/components/FormLabel.js +0 -3
  240. package/nuxt/components/FormOperation.js +0 -3
  241. package/nuxt/components/Gantt.js +0 -3
  242. package/nuxt/components/InputIcon.js +0 -3
  243. package/nuxt/components/InputNumber.js +0 -3
  244. package/nuxt/components/List.js +0 -3
  245. package/nuxt/components/ListItem.js +0 -3
  246. package/nuxt/components/NavSprite.js +0 -2
  247. package/nuxt/components/QuadrantDiagram.js +0 -3
  248. package/nuxt/components/Select.js +0 -3
  249. package/nuxt/components/StepsGuide.js +0 -3
  250. package/nuxt/components/StickSlider.js +0 -3
  251. package/nuxt/components/Sticky.js +0 -2
  252. package/nuxt/components/Table.js +0 -3
  253. package/nuxt/components/Tabs.js +0 -3
  254. package/nuxt/components/TimeAxis.js +0 -3
  255. package/nuxt/components/TimeAxisItem.js +0 -3
  256. package/nuxt/components/TimePicker.js +0 -3
  257. package/nuxt/components/Tooltip.js +0 -3
  258. package/nuxt/components/Transfer.js +0 -3
  259. package/nuxt/components/Tree.js +0 -3
  260. package/nuxt/components/TreeSelect.js +0 -3
  261. package/nuxt/components/dropdownMenuProps.js +0 -3
  262. package/nuxt/components/tooltipProps.js +0 -3
  263. package/quadrant-diagram/index.d.ts +0 -7
  264. package/quadrant-diagram/index.es.js +0 -5728
  265. package/quadrant-diagram/index.umd.js +0 -27
  266. package/quadrant-diagram/package.json +0 -7
  267. package/quadrant-diagram/style.css +0 -1
  268. package/select/index.d.ts +0 -7
  269. package/select/index.es.js +0 -706
  270. package/select/index.umd.js +0 -1
  271. package/select/package.json +0 -7
  272. package/select/style.css +0 -1
  273. package/steps-guide/index.d.ts +0 -7
  274. package/steps-guide/index.es.js +0 -239
  275. package/steps-guide/index.umd.js +0 -1
  276. package/steps-guide/package.json +0 -7
  277. package/steps-guide/style.css +0 -1
  278. package/sticky/index.d.ts +0 -7
  279. package/sticky/index.es.js +0 -197
  280. package/sticky/index.umd.js +0 -1
  281. package/sticky/package.json +0 -7
  282. package/table/index.d.ts +0 -7
  283. package/table/index.es.js +0 -1969
  284. package/table/index.umd.js +0 -1
  285. package/table/package.json +0 -7
  286. package/table/style.css +0 -1
  287. package/tabs/index.d.ts +0 -7
  288. package/tabs/index.es.js +0 -194
  289. package/tabs/index.umd.js +0 -1
  290. package/tabs/package.json +0 -7
  291. package/tabs/style.css +0 -1
  292. package/time-axis/index.d.ts +0 -7
  293. package/time-axis/index.umd.js +0 -1
  294. package/time-axis/package.json +0 -7
  295. package/time-axis/style.css +0 -1
  296. package/time-picker/index.d.ts +0 -7
  297. package/time-picker/index.es.js +0 -1237
  298. package/time-picker/index.umd.js +0 -1
  299. package/time-picker/package.json +0 -7
  300. package/time-picker/style.css +0 -1
  301. package/tooltip/index.d.ts +0 -7
  302. package/tooltip/index.es.js +0 -5828
  303. package/tooltip/index.umd.js +0 -27
  304. package/tooltip/package.json +0 -7
  305. package/tooltip/style.css +0 -1
  306. package/transfer/index.d.ts +0 -7
  307. package/transfer/index.es.js +0 -7608
  308. package/transfer/index.umd.js +0 -27
  309. package/transfer/package.json +0 -7
  310. package/transfer/style.css +0 -1
  311. package/tree/index.d.ts +0 -7
  312. package/tree/index.es.js +0 -6490
  313. package/tree/index.umd.js +0 -27
  314. package/tree/package.json +0 -7
  315. package/tree/style.css +0 -1
  316. package/tree-select/index.d.ts +0 -7
  317. package/tree-select/index.es.js +0 -623
  318. package/tree-select/index.umd.js +0 -1
  319. package/tree-select/package.json +0 -7
  320. package/tree-select/style.css +0 -1
@@ -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 };
@@ -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"});
@@ -1,7 +0,0 @@
1
- {
2
- "name": "drawer",
3
- "version": "0.0.0",
4
- "main": "index.umd.js",
5
- "module": "index.es.js",
6
- "style": "style.css"
7
- }
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%)}
@@ -1,7 +0,0 @@
1
- import { App } from 'vue';
2
- declare function install(app: App): void
3
- declare const _default: {
4
- install: typeof install;
5
- version: string;
6
- };
7
- export default _default;