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.
Files changed (264) hide show
  1. package/README.md +126 -187
  2. package/alert/index.es.js +28 -30
  3. package/alert/index.umd.js +1 -1
  4. package/auto-complete/index.es.js +67 -82
  5. package/auto-complete/index.umd.js +3 -1
  6. package/auto-complete/style.css +1 -1
  7. package/badge/index.es.js +1 -1
  8. package/badge/index.umd.js +1 -1
  9. package/badge/style.css +1 -1
  10. package/button/index.es.js +39 -40
  11. package/button/index.umd.js +1 -1
  12. package/countdown/index.es.js +2 -1
  13. package/editable-select/index.es.js +122 -163
  14. package/editable-select/index.umd.js +1 -1
  15. package/fullscreen/index.es.js +13 -16
  16. package/fullscreen/index.umd.js +1 -1
  17. package/icon/index.es.js +39 -57
  18. package/icon/index.umd.js +1 -1
  19. package/image-preview/index.es.js +2 -1
  20. package/modal/index.es.js +81 -76
  21. package/modal/index.umd.js +1 -1
  22. package/modal/style.css +1 -1
  23. package/notification/index.es.js +38 -40
  24. package/notification/index.umd.js +1 -1
  25. package/nuxt/components/PanelBody.js +3 -0
  26. package/nuxt/components/PanelFooter.js +3 -0
  27. package/nuxt/components/PanelHeader.js +3 -0
  28. package/nuxt/components/Timeline.js +3 -0
  29. package/nuxt/components/TimelineItem.js +3 -0
  30. package/nuxt/components/alertProps.js +3 -0
  31. package/nuxt/components/fullscreenProps.js +3 -0
  32. package/nuxt/components/iconProps.js +2 -0
  33. package/nuxt/components/paginationProps.js +3 -0
  34. package/nuxt/components/panelProps.js +3 -0
  35. package/nuxt/components/searchProps.js +3 -0
  36. package/nuxt/components/tagProps.js +3 -0
  37. package/overlay/index.es.js +44 -37
  38. package/overlay/index.umd.js +1 -1
  39. package/overlay/style.css +1 -1
  40. package/package.json +8 -43
  41. package/pagination/index.es.js +10 -12
  42. package/pagination/index.umd.js +1 -1
  43. package/panel/index.es.js +45 -32
  44. package/panel/index.umd.js +1 -1
  45. package/popover/index.es.js +46 -39
  46. package/popover/index.umd.js +6 -6
  47. package/popover/style.css +1 -1
  48. package/progress/index.es.js +1 -1
  49. package/progress/index.umd.js +1 -1
  50. package/progress/style.css +1 -1
  51. package/radio/index.es.js +11 -11
  52. package/radio/index.umd.js +1 -1
  53. package/radio/style.css +1 -1
  54. package/read-tip/index.es.js +6 -3
  55. package/result/index.es.js +38 -53
  56. package/result/index.umd.js +1 -1
  57. package/ripple/index.es.js +47 -42
  58. package/ripple/index.umd.js +1 -1
  59. package/search/index.es.js +2 -5
  60. package/search/index.umd.js +4 -4
  61. package/skeleton/index.es.js +17 -17
  62. package/skeleton/index.umd.js +1 -1
  63. package/slider/index.es.js +60 -59
  64. package/slider/index.umd.js +1 -1
  65. package/splitter/index.es.js +215 -160
  66. package/splitter/index.umd.js +11 -11
  67. package/splitter/style.css +1 -1
  68. package/status/index.es.js +1 -4
  69. package/status/index.umd.js +1 -1
  70. package/status/style.css +1 -1
  71. package/style.css +1 -1
  72. package/tag/index.es.js +15 -18
  73. package/tag/index.umd.js +1 -1
  74. package/tag/style.css +1 -1
  75. package/tag-input/index.es.js +4 -2
  76. package/{accordion → timeline}/index.d.ts +0 -0
  77. package/{time-axis → timeline}/index.es.js +65 -78
  78. package/timeline/index.umd.js +1 -0
  79. package/{anchor → timeline}/package.json +1 -1
  80. package/timeline/style.css +1 -0
  81. package/upload/index.es.js +38 -40
  82. package/upload/index.umd.js +1 -1
  83. package/vue-devui.es.js +1478 -1196
  84. package/vue-devui.umd.js +19 -17
  85. package/accordion/index.es.js +0 -720
  86. package/accordion/index.umd.js +0 -1
  87. package/accordion/package.json +0 -7
  88. package/accordion/style.css +0 -1
  89. package/anchor/index.d.ts +0 -7
  90. package/anchor/index.es.js +0 -263
  91. package/anchor/index.umd.js +0 -1
  92. package/anchor/style.css +0 -1
  93. package/back-top/index.d.ts +0 -7
  94. package/back-top/index.es.js +0 -128
  95. package/back-top/index.umd.js +0 -1
  96. package/back-top/package.json +0 -7
  97. package/back-top/style.css +0 -1
  98. package/breadcrumb/index.d.ts +0 -7
  99. package/breadcrumb/index.es.js +0 -127
  100. package/breadcrumb/index.umd.js +0 -1
  101. package/breadcrumb/package.json +0 -7
  102. package/breadcrumb/style.css +0 -1
  103. package/carousel/index.d.ts +0 -7
  104. package/carousel/index.es.js +0 -329
  105. package/carousel/index.umd.js +0 -1
  106. package/carousel/package.json +0 -7
  107. package/carousel/style.css +0 -1
  108. package/cascader/index.d.ts +0 -7
  109. package/cascader/index.es.js +0 -5963
  110. package/cascader/index.umd.js +0 -27
  111. package/cascader/package.json +0 -7
  112. package/cascader/style.css +0 -1
  113. package/color-picker/index.d.ts +0 -7
  114. package/color-picker/index.es.js +0 -8187
  115. package/color-picker/index.umd.js +0 -27
  116. package/color-picker/package.json +0 -7
  117. package/color-picker/style.css +0 -1
  118. package/date-picker/index.d.ts +0 -7
  119. package/date-picker/index.es.js +0 -1171
  120. package/date-picker/index.umd.js +0 -1
  121. package/date-picker/package.json +0 -7
  122. package/date-picker/style.css +0 -1
  123. package/dragdrop/index.d.ts +0 -7
  124. package/dragdrop/index.es.js +0 -157
  125. package/dragdrop/index.umd.js +0 -1
  126. package/dragdrop/package.json +0 -7
  127. package/drawer/index.d.ts +0 -7
  128. package/drawer/index.es.js +0 -234
  129. package/drawer/index.umd.js +0 -1
  130. package/drawer/package.json +0 -7
  131. package/drawer/style.css +0 -1
  132. package/dropdown/index.d.ts +0 -7
  133. package/dropdown/index.es.js +0 -638
  134. package/dropdown/index.umd.js +0 -1
  135. package/dropdown/package.json +0 -7
  136. package/dropdown/style.css +0 -1
  137. package/form/index.d.ts +0 -7
  138. package/form/index.es.js +0 -7865
  139. package/form/index.umd.js +0 -27
  140. package/form/package.json +0 -7
  141. package/form/style.css +0 -1
  142. package/gantt/index.d.ts +0 -7
  143. package/gantt/index.es.js +0 -523
  144. package/gantt/index.umd.js +0 -1
  145. package/gantt/package.json +0 -7
  146. package/gantt/style.css +0 -1
  147. package/input-icon/index.d.ts +0 -7
  148. package/input-icon/index.es.js +0 -331
  149. package/input-icon/index.umd.js +0 -1
  150. package/input-icon/package.json +0 -7
  151. package/input-icon/style.css +0 -1
  152. package/input-number/index.d.ts +0 -7
  153. package/input-number/index.es.js +0 -240
  154. package/input-number/index.umd.js +0 -1
  155. package/input-number/package.json +0 -7
  156. package/input-number/style.css +0 -1
  157. package/list/index.d.ts +0 -7
  158. package/list/index.es.js +0 -39
  159. package/list/index.umd.js +0 -1
  160. package/list/package.json +0 -7
  161. package/list/style.css +0 -1
  162. package/nav-sprite/index.d.ts +0 -7
  163. package/nav-sprite/index.es.js +0 -68
  164. package/nav-sprite/index.umd.js +0 -1
  165. package/nav-sprite/package.json +0 -7
  166. package/nuxt/components/Accordion.js +0 -3
  167. package/nuxt/components/Anchor.js +0 -3
  168. package/nuxt/components/BackTop.js +0 -3
  169. package/nuxt/components/Breadcrumb.js +0 -3
  170. package/nuxt/components/Carousel.js +0 -3
  171. package/nuxt/components/CarouselItem.js +0 -3
  172. package/nuxt/components/Cascader.js +0 -3
  173. package/nuxt/components/ColorPicker.js +0 -3
  174. package/nuxt/components/Column.js +0 -3
  175. package/nuxt/components/DatePicker.js +0 -3
  176. package/nuxt/components/Drawer.js +0 -3
  177. package/nuxt/components/DrawerService.js +0 -3
  178. package/nuxt/components/Dropdown.js +0 -3
  179. package/nuxt/components/DropdownMenu.js +0 -3
  180. package/nuxt/components/Form.js +0 -3
  181. package/nuxt/components/FormControl.js +0 -3
  182. package/nuxt/components/FormItem.js +0 -3
  183. package/nuxt/components/FormLabel.js +0 -3
  184. package/nuxt/components/FormOperation.js +0 -3
  185. package/nuxt/components/Gantt.js +0 -3
  186. package/nuxt/components/InputIcon.js +0 -3
  187. package/nuxt/components/InputNumber.js +0 -3
  188. package/nuxt/components/List.js +0 -3
  189. package/nuxt/components/ListItem.js +0 -3
  190. package/nuxt/components/NavSprite.js +0 -2
  191. package/nuxt/components/QuadrantDiagram.js +0 -3
  192. package/nuxt/components/Select.js +0 -3
  193. package/nuxt/components/StepsGuide.js +0 -3
  194. package/nuxt/components/StickSlider.js +0 -3
  195. package/nuxt/components/Sticky.js +0 -2
  196. package/nuxt/components/Table.js +0 -3
  197. package/nuxt/components/Tabs.js +0 -3
  198. package/nuxt/components/TimeAxis.js +0 -3
  199. package/nuxt/components/TimeAxisItem.js +0 -3
  200. package/nuxt/components/TimePicker.js +0 -3
  201. package/nuxt/components/Tooltip.js +0 -3
  202. package/nuxt/components/Transfer.js +0 -3
  203. package/nuxt/components/Tree.js +0 -3
  204. package/nuxt/components/TreeSelect.js +0 -3
  205. package/nuxt/components/dropdownMenuProps.js +0 -3
  206. package/nuxt/components/tooltipProps.js +0 -3
  207. package/quadrant-diagram/index.d.ts +0 -7
  208. package/quadrant-diagram/index.es.js +0 -5728
  209. package/quadrant-diagram/index.umd.js +0 -27
  210. package/quadrant-diagram/package.json +0 -7
  211. package/quadrant-diagram/style.css +0 -1
  212. package/select/index.d.ts +0 -7
  213. package/select/index.es.js +0 -706
  214. package/select/index.umd.js +0 -1
  215. package/select/package.json +0 -7
  216. package/select/style.css +0 -1
  217. package/steps-guide/index.d.ts +0 -7
  218. package/steps-guide/index.es.js +0 -239
  219. package/steps-guide/index.umd.js +0 -1
  220. package/steps-guide/package.json +0 -7
  221. package/steps-guide/style.css +0 -1
  222. package/sticky/index.d.ts +0 -7
  223. package/sticky/index.es.js +0 -197
  224. package/sticky/index.umd.js +0 -1
  225. package/sticky/package.json +0 -7
  226. package/table/index.d.ts +0 -7
  227. package/table/index.es.js +0 -1969
  228. package/table/index.umd.js +0 -1
  229. package/table/package.json +0 -7
  230. package/table/style.css +0 -1
  231. package/tabs/index.d.ts +0 -7
  232. package/tabs/index.es.js +0 -194
  233. package/tabs/index.umd.js +0 -1
  234. package/tabs/package.json +0 -7
  235. package/tabs/style.css +0 -1
  236. package/time-axis/index.d.ts +0 -7
  237. package/time-axis/index.umd.js +0 -1
  238. package/time-axis/package.json +0 -7
  239. package/time-axis/style.css +0 -1
  240. package/time-picker/index.d.ts +0 -7
  241. package/time-picker/index.es.js +0 -1237
  242. package/time-picker/index.umd.js +0 -1
  243. package/time-picker/package.json +0 -7
  244. package/time-picker/style.css +0 -1
  245. package/tooltip/index.d.ts +0 -7
  246. package/tooltip/index.es.js +0 -5828
  247. package/tooltip/index.umd.js +0 -27
  248. package/tooltip/package.json +0 -7
  249. package/tooltip/style.css +0 -1
  250. package/transfer/index.d.ts +0 -7
  251. package/transfer/index.es.js +0 -7608
  252. package/transfer/index.umd.js +0 -27
  253. package/transfer/package.json +0 -7
  254. package/transfer/style.css +0 -1
  255. package/tree/index.d.ts +0 -7
  256. package/tree/index.es.js +0 -6490
  257. package/tree/index.umd.js +0 -27
  258. package/tree/package.json +0 -7
  259. package/tree/style.css +0 -1
  260. package/tree-select/index.d.ts +0 -7
  261. package/tree-select/index.es.js +0 -623
  262. package/tree-select/index.umd.js +0 -1
  263. package/tree-select/package.json +0 -7
  264. package/tree-select/style.css +0 -1
package/modal/index.es.js CHANGED
@@ -33,8 +33,8 @@ var __publicField = (obj, key, value) => {
33
33
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
34
34
  return value;
35
35
  };
36
- import { defineComponent, createVNode, Teleport, Transition, renderSlot, isVNode, computed, onMounted, watch, onUnmounted, ref, nextTick, unref, mergeProps, toRefs, h, render } from "vue";
37
- import { offset, autoPlacement, arrow, computePosition } from "@floating-ui/dom";
36
+ import { defineComponent, toRefs, createVNode, Teleport, Transition, renderSlot, isVNode, computed, onMounted, watch, onUnmounted, ref, unref, nextTick, mergeProps, h, render } from "vue";
37
+ import { shift, offset, autoPlacement, arrow, computePosition } from "@floating-ui/dom";
38
38
  const modalProps = {
39
39
  modelValue: {
40
40
  type: Boolean,
@@ -56,56 +56,54 @@ const modalProps = {
56
56
  type: Function
57
57
  }
58
58
  };
59
+ const iconProps = {
60
+ name: {
61
+ type: String,
62
+ default: "",
63
+ required: true
64
+ },
65
+ size: {
66
+ type: String,
67
+ default: "inherit"
68
+ },
69
+ color: {
70
+ type: String,
71
+ default: "inherit"
72
+ },
73
+ classPrefix: {
74
+ type: String,
75
+ default: "icon"
76
+ }
77
+ };
59
78
  var Icon = defineComponent({
60
79
  name: "DIcon",
61
- props: {
62
- name: {
63
- type: String,
64
- required: true
65
- },
66
- size: {
67
- type: String,
68
- default: "inherit"
69
- },
70
- color: {
71
- type: String,
72
- default: "inherit"
73
- },
74
- classPrefix: {
75
- type: String,
76
- default: "icon"
77
- }
78
- },
80
+ props: iconProps,
79
81
  setup(props) {
80
- return __spreadValues({}, props);
81
- },
82
- render() {
83
82
  const {
84
83
  name,
85
84
  size,
86
85
  color,
87
86
  classPrefix
88
- } = this;
89
- return /^((https?):)?\/\//.test(name) ? createVNode("img", {
90
- "src": name,
91
- "alt": name.split("/")[name.split("/").length - 1],
92
- "style": {
93
- width: size,
94
- verticalAlign: "text-bottom"
95
- }
96
- }, null) : createVNode("i", {
97
- "class": `${classPrefix} ${classPrefix}-${name}`,
98
- "style": {
99
- fontSize: size,
100
- color
101
- }
102
- }, null);
87
+ } = toRefs(props);
88
+ return () => {
89
+ return /^((https?):)?\/\//.test(name.value) ? createVNode("img", {
90
+ "src": name.value,
91
+ "alt": name.value.split("/")[name.value.split("/").length - 1],
92
+ "style": {
93
+ width: size.value,
94
+ verticalAlign: "text-bottom"
95
+ }
96
+ }, null) : createVNode("i", {
97
+ "class": `${classPrefix.value} ${classPrefix.value}-${name.value}`,
98
+ "style": {
99
+ fontSize: size.value,
100
+ color: color.value
101
+ }
102
+ }, null);
103
+ };
103
104
  }
104
105
  });
105
- Icon.install = function(app) {
106
- app.component(Icon.name, Icon);
107
- };
108
- var overlay = "";
106
+ var baseOverlay = "";
109
107
  function _isSlot(s) {
110
108
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
111
109
  }
@@ -152,43 +150,13 @@ const overlayProps = {
152
150
  default: true
153
151
  }
154
152
  };
155
- const overlayEmits = ["update:visible", "backdropClick"];
156
153
  const fixedOverlayProps = __spreadProps(__spreadValues({}, overlayProps), {
157
154
  overlayStyle: {
158
155
  type: [String, Object],
159
156
  default: void 0
160
157
  }
161
158
  });
162
- const flexibleOverlayProps = {
163
- modelValue: {
164
- type: Boolean,
165
- default: false
166
- },
167
- origin: {
168
- type: Object,
169
- require: true
170
- },
171
- position: {
172
- type: Array,
173
- default: ["bottom"]
174
- },
175
- offset: {
176
- type: [Number, Object],
177
- default: 8
178
- },
179
- align: {
180
- type: String,
181
- default: null
182
- },
183
- showArrow: {
184
- type: Boolean,
185
- default: false
186
- },
187
- isArrowCenter: {
188
- type: Boolean,
189
- default: true
190
- }
191
- };
159
+ const overlayEmits = ["update:visible", "backdropClick"];
192
160
  function useOverlayLogic(props, ctx) {
193
161
  const backgroundClass = computed(() => {
194
162
  return [
@@ -239,6 +207,7 @@ function useOverlayLogic(props, ctx) {
239
207
  handleOverlayBubbleCancel
240
208
  };
241
209
  }
210
+ var fixedOverlay = "";
242
211
  const FixedOverlay = defineComponent({
243
212
  name: "DFixedOverlay",
244
213
  props: fixedOverlayProps,
@@ -263,6 +232,36 @@ const FixedOverlay = defineComponent({
263
232
  });
264
233
  }
265
234
  });
235
+ const flexibleOverlayProps = {
236
+ modelValue: {
237
+ type: Boolean,
238
+ default: false
239
+ },
240
+ origin: {
241
+ type: Object,
242
+ require: true
243
+ },
244
+ position: {
245
+ type: Array,
246
+ default: ["bottom"]
247
+ },
248
+ offset: {
249
+ type: [Number, Object],
250
+ default: 8
251
+ },
252
+ align: {
253
+ type: String,
254
+ default: null
255
+ },
256
+ showArrow: {
257
+ type: Boolean,
258
+ default: false
259
+ },
260
+ isArrowCenter: {
261
+ type: Boolean,
262
+ default: true
263
+ }
264
+ };
266
265
  function getScrollParent(element) {
267
266
  const overflowRegex = /(auto|scroll|hidden)/;
268
267
  for (let parent = element; parent = parent.parentElement; parent.parentElement !== document.body) {
@@ -316,6 +315,7 @@ function useOverlay(props, emit) {
316
315
  const overlayEl = unref(overlayRef.value);
317
316
  const arrowEl = unref(arrowRef.value);
318
317
  const middleware = [
318
+ shift(),
319
319
  offset(props.offset),
320
320
  autoPlacement({
321
321
  alignment: props.align,
@@ -350,7 +350,7 @@ function useOverlay(props, emit) {
350
350
  originParent !== window && window.removeEventListener("scroll", updatePosition);
351
351
  window.removeEventListener("resize", updatePosition);
352
352
  });
353
- return { arrowRef, overlayRef };
353
+ return { arrowRef, overlayRef, updatePosition };
354
354
  }
355
355
  var flexibleOverlay = "";
356
356
  defineComponent({
@@ -361,12 +361,17 @@ defineComponent({
361
361
  setup(props, {
362
362
  slots,
363
363
  attrs,
364
- emit
364
+ emit,
365
+ expose
365
366
  }) {
366
367
  const {
367
368
  arrowRef,
368
- overlayRef
369
+ overlayRef,
370
+ updatePosition
369
371
  } = useOverlay(props, emit);
372
+ expose({
373
+ updatePosition
374
+ });
370
375
  return () => {
371
376
  var _a;
372
377
  return props.modelValue && createVNode("div", mergeProps({
@@ -1 +1 @@
1
- var X=Object.defineProperty,G=Object.defineProperties;var J=Object.getOwnPropertyDescriptors;var h=Object.getOwnPropertySymbols;var P=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable;var B=(r,e,d)=>e in r?X(r,e,{enumerable:!0,configurable:!0,writable:!0,value:d}):r[e]=d,g=(r,e)=>{for(var d in e||(e={}))P.call(e,d)&&B(r,d,e[d]);if(h)for(var d of h(e))M.call(e,d)&&B(r,d,e[d]);return r},C=(r,e)=>G(r,J(e));var A=(r,e)=>{var d={};for(var p in r)P.call(r,p)&&e.indexOf(p)<0&&(d[p]=r[p]);if(r!=null&&h)for(var p of h(r))e.indexOf(p)<0&&M.call(r,p)&&(d[p]=r[p]);return d};var j=(r,e,d)=>(B(r,typeof e!="symbol"?e+"":e,d),d);(function(r,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue"),require("@floating-ui/dom")):typeof define=="function"&&define.amd?define(["exports","vue","@floating-ui/dom"],e):(r=typeof globalThis!="undefined"?globalThis:r||self,e(r.index={},r.Vue,r.dom))})(this,function(r,e,d){"use strict";const p={modelValue:{type:Boolean,default:!1},title:{type:String,default:""},lockScroll:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0},beforeClose:{type:Function}};var v=e.defineComponent({name:"DIcon",props:{name:{type:String,required:!0},size:{type:String,default:"inherit"},color:{type:String,default:"inherit"},classPrefix:{type:String,default:"icon"}},setup(t){return g({},t)},render(){const{name:t,size:o,color:n,classPrefix:i}=this;return/^((https?):)?\/\//.test(t)?e.createVNode("img",{src:t,alt:t.split("/")[t.split("/").length-1],style:{width:o,verticalAlign:"text-bottom"}},null):e.createVNode("i",{class:`${i} ${i}-${t}`,style:{fontSize:o,color:n}},null)}});v.install=function(t){t.component(v.name,v)};var Q="";function D(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!e.isVNode(t)}const L=e.defineComponent({setup(t,o){return()=>{let n;return e.createVNode(e.Teleport,{to:"#d-overlay-anchor"},{default:()=>[e.createVNode(e.Transition,{name:"devui-overlay-fade"},D(n=e.renderSlot(o.slots,"default"))?n:{default:()=>[n]})]})}}}),T={visible:{type:Boolean},backgroundBlock:{type:Boolean,default:!1},backgroundClass:{type:String,default:""},backgroundStyle:{type:[String,Object]},onBackdropClick:{type:Function},backdropClose:{type:Boolean,default:!0},hasBackdrop:{type:Boolean,default:!0}},_=["update:visible","backdropClick"],R=C(g({},T),{overlayStyle:{type:[String,Object],default:void 0}}),z={modelValue:{type:Boolean,default:!1},origin:{type:Object,require:!0},position:{type:Array,default:["bottom"]},offset:{type:[Number,Object],default:8},align:{type:String,default:null},showArrow:{type:Boolean,default:!1},isArrowCenter:{type:Boolean,default:!0}};function F(t,o){const n=e.computed(()=>["devui-overlay-background",t.backgroundClass,t.hasBackdrop?"devui-overlay-background__color":"devui-overlay-background__disabled"]),i=e.computed(()=>"devui-overlay"),c=l=>{var s;l.preventDefault(),(s=t.onBackdropClick)==null||s.call(t),t.backdropClose&&o.emit("update:visible",!1)},a=l=>l.cancelBubble=!0;return e.onMounted(()=>{const l=document.body,s=l.style.overflow,m=l.style.position;e.watch([()=>t.visible,()=>t.backgroundBlock],([f,y])=>{if(y){const u=l.getBoundingClientRect().y;f?(l.style.overflowY="scroll",l.style.position=f?"fixed":"",l.style.top=`${u}px`):(l.style.overflowY=s,l.style.position=m,l.style.top="",window.scrollTo(0,-u))}}),e.onUnmounted(()=>{document.body.style.overflow=s})}),{backgroundClass:n,overlayClass:i,handleBackdropClick:c,handleOverlayBubbleCancel:a}}const $=e.defineComponent({name:"DFixedOverlay",props:R,emits:_,setup(t,o){const{backgroundClass:n,overlayClass:i,handleBackdropClick:c,handleOverlayBubbleCancel:a}=F(t,o);return()=>e.createVNode(L,null,{default:()=>[t.visible&&e.createVNode("div",{class:n.value,style:t.backgroundStyle,onClick:c},[e.createVNode("div",{class:i.value,style:t.overlayStyle,onClick:a},[e.renderSlot(o.slots,"default")])])]})}});function S(t){const o=/(auto|scroll|hidden)/;for(let n=t;n=n.parentElement;n.parentElement!==document.body){const i=window.getComputedStyle(n);if(o.test(i.overflow+i.overflowX+i.overflowY))return n}return window}function q(t,o,n,i){let{x:c,y:a}=o;if(!t){const{width:l,height:s}=i;c&&n.includes("start")&&(c=12),c&&n.includes("end")&&(c=Math.round(l-24)),a&&n.includes("start")&&(a=10),a&&n.includes("end")&&(a=s-14)}return{x:c,y:a}}function I(t,o){const n=e.ref(),i=e.ref(),c=(l,s,m,f)=>{const{x:y,y:u}=q(t.isArrowCenter,m,s,f.getBoundingClientRect()),b={top:"bottom",right:"left",bottom:"top",left:"right"}[s.split("-")[0]];Object.assign(l.style,{left:y?`${y}px`:"",top:u?`${u}px`:"",right:"",bottom:"",[b]:"-4px"})},a=async()=>{const l=t.origin,s=e.unref(n.value),m=e.unref(i.value),f=[d.offset(t.offset),d.autoPlacement({alignment:t.align,allowedPlacements:t.position})];t.showArrow&&f.push(d.arrow({element:m}));const{x:y,y:u,placement:b,middlewareData:x}=await d.computePosition(l,s,{strategy:"fixed",middleware:f});o("positionChange",b),Object.assign(s.style,{top:`${u}px`,left:`${y}px`}),t.showArrow&&c(m,b,x.arrow,s)};return e.watch(()=>t.modelValue,()=>{const l=S(t.origin);t.modelValue&&t.origin?(e.nextTick(a),l.addEventListener("scroll",a),l!==window&&window.addEventListener("scroll",a),window.addEventListener("resize",a)):(l.removeEventListener("scroll",a),l!==window&&window.removeEventListener("scroll",a),window.removeEventListener("resize",a))}),e.onUnmounted(()=>{const l=S(t.origin);l.removeEventListener("scroll",a),l!==window&&window.removeEventListener("scroll",a),window.removeEventListener("resize",a)}),{arrowRef:i,overlayRef:n}}var W="";e.defineComponent({name:"DFlexibleOverlay",inheritAttrs:!1,props:z,emits:["update:modelValue","positionChange"],setup(t,{slots:o,attrs:n,emit:i}){const{arrowRef:c,overlayRef:a}=I(t,i);return()=>{var l;return t.modelValue&&e.createVNode("div",e.mergeProps({ref:a,class:"devui-flexible-overlay"},n),[(l=o.default)==null?void 0:l.call(o),t.showArrow&&e.createVNode("div",{ref:c,class:"devui-flexible-overlay-arrow"},null)])}}});const U=typeof window!="undefined";function H(t,o){function n(){o("update:modelValue",!1)}function i(c){c||(t.beforeClose?t.beforeClose(n):n())}return{handleVisibleChange:i}}var k=e.defineComponent({name:"DModalHeader",setup(t,{slots:o}){return()=>{var n;return e.createVNode("div",{class:"devui-modal-header"},[(n=o.default)==null?void 0:n.call(o)])}}}),V=e.defineComponent({name:"DModalBody",setup(t,{slots:o}){return()=>{var n;return e.createVNode("div",{class:"devui-modal-body"},[(n=o.default)==null?void 0:n.call(o)])}}}),Z="",w=e.defineComponent({name:"DModal",inheritAttrs:!1,props:p,emits:["update:modelValue"],setup(t,{slots:o,attrs:n,emit:i,expose:c}){const{modelValue:a,lockScroll:l,closeOnClickOverlay:s,title:m}=e.toRefs(t),{handleVisibleChange:f}=H(t,i);return c({handleVisibleChange:f}),()=>e.createVNode($,{visible:a.value,"onUpdate:visible":f,"background-class":"devui-modal-mask","background-block":l.value,"backdrop-close":s.value},{default:()=>[e.createVNode(e.Transition,{name:"devui-modal-wipe"},{default:()=>{var y;return[e.createVNode("div",e.mergeProps({class:"devui-modal"},n),[e.createVNode(v,{name:"close",class:"btn-close",size:"var(--devui-font-size-md,12px)",onClick:()=>f(!1)},null),o.header?o.header():m.value&&e.createVNode(k,null,{default:()=>[m.value]}),e.createVNode(V,null,{default:()=>{var u;return[(u=o.default)==null?void 0:u.call(o)]}}),(y=o.footer)==null?void 0:y.call(o)])]}})]})}}),N=e.defineComponent({name:"DModalFooter",setup(t,{slots:o}){return()=>{var n;return e.createVNode("div",{class:"devui-modal-footer"},[(n=o.default)==null?void 0:n.call(o)])}}});class Y{constructor(o){this.anchorContainer=o}renderModal(o,n,i){const c=e.h(this.component(),n,i);return e.render(c,o),c}renderNull(o){setTimeout(()=>{e.render(null,o)},500)}}let E;class O extends Y{component(){return w}open(o={}){const n=document.createElement("div");this.anchorContainer.appendChild(n);const y=o,{header:i,content:c,footer:a}=y,l=A(y,["header","content","footer"]),s=u=>{u||f()},m=(u,b=s)=>this.renderModal(n,C(g({},u),{modelValue:!0,"onUpdate:modelValue":b}),{header:i,default:c,footer:a}),f=()=>{var u,b;m(l,x=>{x?m(l):(this.renderModal(n,C(g({},l),{modelValue:!1})),this.renderNull(n))}),(b=(u=E.component.exposed).handleVisibleChange)==null||b.call(u,!1)};return this.renderModal(n,{modelValue:!1}),E=m(l),{hide:f}}}j(O,"token","MODAL_SERVICE_TOKEN");var K={title:"Modal \u5F39\u7A97",category:"\u53CD\u9988",status:"100%",install(t){if(t.component(w.name,w),t.component(k.name,k),t.component(V.name,V),t.component(N.name,N),!U)return;let o=document.getElementById("d-modal-anchors-container");o||(o=document.createElement("div"),o.setAttribute("id","d-modal-anchors-container"),document.body.appendChild(o)),t.provide(O.token,new O(o))}};r.Modal=w,r.default=K,Object.defineProperty(r,"__esModule",{value:!0}),r[Symbol.toStringTag]="Module"});
1
+ var X=Object.defineProperty,G=Object.defineProperties;var J=Object.getOwnPropertyDescriptors;var g=Object.getOwnPropertySymbols;var P=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var x=(r,e,c)=>e in r?X(r,e,{enumerable:!0,configurable:!0,writable:!0,value:c}):r[e]=c,w=(r,e)=>{for(var c in e||(e={}))P.call(e,c)&&x(r,c,e[c]);if(g)for(var c of g(e))E.call(e,c)&&x(r,c,e[c]);return r},h=(r,e)=>G(r,J(e));var M=(r,e)=>{var c={};for(var p in r)P.call(r,p)&&e.indexOf(p)<0&&(c[p]=r[p]);if(r!=null&&g)for(var p of g(r))e.indexOf(p)<0&&E.call(r,p)&&(c[p]=r[p]);return c};var A=(r,e,c)=>(x(r,typeof e!="symbol"?e+"":e,c),c);(function(r,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue"),require("@floating-ui/dom")):typeof define=="function"&&define.amd?define(["exports","vue","@floating-ui/dom"],e):(r=typeof globalThis!="undefined"?globalThis:r||self,e(r.index={},r.Vue,r.dom))})(this,function(r,e,c){"use strict";const p={modelValue:{type:Boolean,default:!1},title:{type:String,default:""},lockScroll:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0},beforeClose:{type:Function}},j={name:{type:String,default:"",required:!0},size:{type:String,default:"inherit"},color:{type:String,default:"inherit"},classPrefix:{type:String,default:"icon"}};var D=e.defineComponent({name:"DIcon",props:j,setup(o){const{name:t,size:n,color:d,classPrefix:i}=e.toRefs(o);return()=>/^((https?):)?\/\//.test(t.value)?e.createVNode("img",{src:t.value,alt:t.value.split("/")[t.value.split("/").length-1],style:{width:n.value,verticalAlign:"text-bottom"}},null):e.createVNode("i",{class:`${i.value} ${i.value}-${t.value}`,style:{fontSize:n.value,color:d.value}},null)}}),Q="";function L(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Object]"&&!e.isVNode(o)}const R=e.defineComponent({setup(o,t){return()=>{let n;return e.createVNode(e.Teleport,{to:"#d-overlay-anchor"},{default:()=>[e.createVNode(e.Transition,{name:"devui-overlay-fade"},L(n=e.renderSlot(t.slots,"default"))?n:{default:()=>[n]})]})}}}),T=h(w({},{visible:{type:Boolean},backgroundBlock:{type:Boolean,default:!1},backgroundClass:{type:String,default:""},backgroundStyle:{type:[String,Object]},onBackdropClick:{type:Function},backdropClose:{type:Boolean,default:!0},hasBackdrop:{type:Boolean,default:!0}}),{overlayStyle:{type:[String,Object],default:void 0}}),_=["update:visible","backdropClick"];function z(o,t){const n=e.computed(()=>["devui-overlay-background",o.backgroundClass,o.hasBackdrop?"devui-overlay-background__color":"devui-overlay-background__disabled"]),d=e.computed(()=>"devui-overlay"),i=l=>{var s;l.preventDefault(),(s=o.onBackdropClick)==null||s.call(o),o.backdropClose&&t.emit("update:visible",!1)},a=l=>l.cancelBubble=!0;return e.onMounted(()=>{const l=document.body,s=l.style.overflow,f=l.style.position;e.watch([()=>o.visible,()=>o.backgroundBlock],([m,y])=>{if(y){const u=l.getBoundingClientRect().y;m?(l.style.overflowY="scroll",l.style.position=m?"fixed":"",l.style.top=`${u}px`):(l.style.overflowY=s,l.style.position=f,l.style.top="",window.scrollTo(0,-u))}}),e.onUnmounted(()=>{document.body.style.overflow=s})}),{backgroundClass:n,overlayClass:d,handleBackdropClick:i,handleOverlayBubbleCancel:a}}var Z="";const F=e.defineComponent({name:"DFixedOverlay",props:T,emits:_,setup(o,t){const{backgroundClass:n,overlayClass:d,handleBackdropClick:i,handleOverlayBubbleCancel:a}=z(o,t);return()=>e.createVNode(R,null,{default:()=>[o.visible&&e.createVNode("div",{class:n.value,style:o.backgroundStyle,onClick:i},[e.createVNode("div",{class:d.value,style:o.overlayStyle,onClick:a},[e.renderSlot(t.slots,"default")])])]})}}),$={modelValue:{type:Boolean,default:!1},origin:{type:Object,require:!0},position:{type:Array,default:["bottom"]},offset:{type:[Number,Object],default:8},align:{type:String,default:null},showArrow:{type:Boolean,default:!1},isArrowCenter:{type:Boolean,default:!0}};function B(o){const t=/(auto|scroll|hidden)/;for(let n=o;n=n.parentElement;n.parentElement!==document.body){const d=window.getComputedStyle(n);if(t.test(d.overflow+d.overflowX+d.overflowY))return n}return window}function q(o,t,n,d){let{x:i,y:a}=t;if(!o){const{width:l,height:s}=d;i&&n.includes("start")&&(i=12),i&&n.includes("end")&&(i=Math.round(l-24)),a&&n.includes("start")&&(a=10),a&&n.includes("end")&&(a=s-14)}return{x:i,y:a}}function I(o,t){const n=e.ref(),d=e.ref(),i=(l,s,f,m)=>{const{x:y,y:u}=q(o.isArrowCenter,f,s,m.getBoundingClientRect()),v={top:"bottom",right:"left",bottom:"top",left:"right"}[s.split("-")[0]];Object.assign(l.style,{left:y?`${y}px`:"",top:u?`${u}px`:"",right:"",bottom:"",[v]:"-4px"})},a=async()=>{const l=o.origin,s=e.unref(n.value),f=e.unref(d.value),m=[c.shift(),c.offset(o.offset),c.autoPlacement({alignment:o.align,allowedPlacements:o.position})];o.showArrow&&m.push(c.arrow({element:f}));const{x:y,y:u,placement:v,middlewareData:O}=await c.computePosition(l,s,{strategy:"fixed",middleware:m});t("positionChange",v),Object.assign(s.style,{top:`${u}px`,left:`${y}px`}),o.showArrow&&i(f,v,O.arrow,s)};return e.watch(()=>o.modelValue,()=>{const l=B(o.origin);o.modelValue&&o.origin?(e.nextTick(a),l.addEventListener("scroll",a),l!==window&&window.addEventListener("scroll",a),window.addEventListener("resize",a)):(l.removeEventListener("scroll",a),l!==window&&window.removeEventListener("scroll",a),window.removeEventListener("resize",a))}),e.onUnmounted(()=>{const l=B(o.origin);l.removeEventListener("scroll",a),l!==window&&window.removeEventListener("scroll",a),window.removeEventListener("resize",a)}),{arrowRef:d,overlayRef:n,updatePosition:a}}var ee="";e.defineComponent({name:"DFlexibleOverlay",inheritAttrs:!1,props:$,emits:["update:modelValue","positionChange"],setup(o,{slots:t,attrs:n,emit:d,expose:i}){const{arrowRef:a,overlayRef:l,updatePosition:s}=I(o,d);return i({updatePosition:s}),()=>{var f;return o.modelValue&&e.createVNode("div",e.mergeProps({ref:l,class:"devui-flexible-overlay"},n),[(f=t.default)==null?void 0:f.call(t),o.showArrow&&e.createVNode("div",{ref:a,class:"devui-flexible-overlay-arrow"},null)])}}});const U=typeof window!="undefined";function H(o,t){function n(){t("update:modelValue",!1)}function d(i){i||(o.beforeClose?o.beforeClose(n):n())}return{handleVisibleChange:d}}var C=e.defineComponent({name:"DModalHeader",setup(o,{slots:t}){return()=>{var n;return e.createVNode("div",{class:"devui-modal-header"},[(n=t.default)==null?void 0:n.call(t)])}}}),k=e.defineComponent({name:"DModalBody",setup(o,{slots:t}){return()=>{var n;return e.createVNode("div",{class:"devui-modal-body"},[(n=t.default)==null?void 0:n.call(t)])}}}),te="",b=e.defineComponent({name:"DModal",inheritAttrs:!1,props:p,emits:["update:modelValue"],setup(o,{slots:t,attrs:n,emit:d,expose:i}){const{modelValue:a,lockScroll:l,closeOnClickOverlay:s,title:f}=e.toRefs(o),{handleVisibleChange:m}=H(o,d);return i({handleVisibleChange:m}),()=>e.createVNode(F,{visible:a.value,"onUpdate:visible":m,"background-class":"devui-modal-mask","background-block":l.value,"backdrop-close":s.value},{default:()=>[e.createVNode(e.Transition,{name:"devui-modal-wipe"},{default:()=>{var y;return[e.createVNode("div",e.mergeProps({class:"devui-modal"},n),[e.createVNode(D,{name:"close",class:"btn-close",size:"var(--devui-font-size-md,12px)",onClick:()=>m(!1)},null),t.header?t.header():f.value&&e.createVNode(C,null,{default:()=>[f.value]}),e.createVNode(k,null,{default:()=>{var u;return[(u=t.default)==null?void 0:u.call(t)]}}),(y=t.footer)==null?void 0:y.call(t)])]}})]})}}),S=e.defineComponent({name:"DModalFooter",setup(o,{slots:t}){return()=>{var n;return e.createVNode("div",{class:"devui-modal-footer"},[(n=t.default)==null?void 0:n.call(t)])}}});class Y{constructor(t){this.anchorContainer=t}renderModal(t,n,d){const i=e.h(this.component(),n,d);return e.render(i,t),i}renderNull(t){setTimeout(()=>{e.render(null,t)},500)}}let N;class V extends Y{component(){return b}open(t={}){const n=document.createElement("div");this.anchorContainer.appendChild(n);const y=t,{header:d,content:i,footer:a}=y,l=M(y,["header","content","footer"]),s=u=>{u||m()},f=(u,v=s)=>this.renderModal(n,h(w({},u),{modelValue:!0,"onUpdate:modelValue":v}),{header:d,default:i,footer:a}),m=()=>{var u,v;f(l,O=>{O?f(l):(this.renderModal(n,h(w({},l),{modelValue:!1})),this.renderNull(n))}),(v=(u=N.component.exposed).handleVisibleChange)==null||v.call(u,!1)};return this.renderModal(n,{modelValue:!1}),N=f(l),{hide:m}}}A(V,"token","MODAL_SERVICE_TOKEN");var K={title:"Modal \u5F39\u7A97",category:"\u53CD\u9988",status:"100%",install(o){if(o.component(b.name,b),o.component(C.name,C),o.component(k.name,k),o.component(S.name,S),!U)return;let t=document.getElementById("d-modal-anchors-container");t||(t=document.createElement("div"),t.setAttribute("id","d-modal-anchors-container"),document.body.appendChild(t)),o.provide(V.token,new V(t))}};r.Modal=b,r.default=K,Object.defineProperty(r,"__esModule",{value:!0}),r[Symbol.toStringTag]="Module"});
package/modal/style.css CHANGED
@@ -1 +1 @@
1
- .devui-overlay-background{position:fixed;top:0;left:0;height:100vh;width:100vw;display:flex}.devui-overlay-background__color{background:rgba(0,0,0,.4)}.devui-overlay-background .devui-overlay{position:relative;z-index:1000;pointer-events:auto}.devui-overlay-background__disabled{pointer-events:none}@keyframes d-overlay-fade{0%{opacity:0}to{opacity:1}}.devui-overlay-fade-enter{opacity:0}.devui-overlay-fade-enter-active{animation-name:d-overlay-fade;animation-duration:.3s}.devui-overlay-fade-leave{opacity:1}.devui-overlay-fade-leave-active{animation-name:d-overlay-fade;animation-duration:.3s;animation-direction:reverse}.devui-flexible-overlay{position:fixed;border-radius:var(--devui-border-radius, 2px);background-color:var(--devui-connected-overlay-bg, #ffffff);box-shadow:var(--devui-shadow-connected-overlay, 0 2px 8px 0) var(--devui-shadow, rgba(0, 0, 0, .2));z-index:1000}.devui-flexible-overlay-arrow{position:absolute;width:8px;height:8px;transform:rotate(45deg);background-color:inherit}.devui-modal-mask{justify-content:center;align-items:center;background-color:var(--devui-shadow, rgba(0, 0, 0, .2))}.devui-modal{position:relative;width:300px;background-color:var(--devui-global-bg-normal, #ffffff)}.devui-modal .btn-close{position:absolute;right:20px;top:20px;width:20px;height:20px;line-height:20px;text-align:center;color:#000;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.devui-modal .btn-close:hover{color:var(--devui-icon-fill-active-hover, #526ecc);background-color:var(--devui-list-item-hover-bg, #f2f5fc)}.devui-modal-content{background:var(--devui-fullscreen-overlay-bg, #ffffff);border-radius:var(--devui-border-radius, 2px)}.devui-modal-header{width:100%;height:56px;padding:32px 32px 0;font-size:var(--devui-font-size-card-title, 14px);font-weight:700;box-sizing:border-box;border:none;user-select:none}.devui-modal-header .header-alert-icon{display:inline-block;vertical-align:middle;margin-right:8px;line-height:16px;text-align:center}.devui-modal-body{padding:20px 32px;font-size:var(--devui-font-size, 12px);color:var(--devui-text-weak, #575d6c);box-sizing:border-box}.devui-modal-footer{width:100%;border-top:none;text-align:center;padding:0 32px 24px;box-sizing:border-box}.devui-modal-footer>*{margin:0 4px}@keyframes wipe-in-out{0%{opacity:.2;transform:translateY(-24px)}to{opacity:1;transform:translateY(0)}}.devui-modal-wipe-enter-from{opacity:.2}.devui-modal-wipe-enter-active{animation-name:wipe-in-out;animation-duration:.3s}.devui-modal-wipe-leave-to{opacity:1}.devui-modal-wipe-leave-active{animation-name:wipe-in-out;animation-duration:.3s;animation-direction:reverse}
1
+ @keyframes d-overlay-fade{0%{opacity:0}to{opacity:1}}.devui-overlay-fade-enter{opacity:0}.devui-overlay-fade-enter-active{animation-name:d-overlay-fade;animation-duration:.3s}.devui-overlay-fade-leave{opacity:1}.devui-overlay-fade-leave-active{animation-name:d-overlay-fade;animation-duration:.3s;animation-direction:reverse}.devui-overlay-background{position:fixed;top:0;left:0;height:100vh;width:100vw;display:flex}.devui-overlay-background__color{background:rgba(0,0,0,.4)}.devui-overlay-background .devui-overlay{position:relative;z-index:1000;pointer-events:auto}.devui-overlay-background__disabled{pointer-events:none}.devui-flexible-overlay{position:fixed;border-radius:var(--devui-border-radius, 2px);background-color:var(--devui-connected-overlay-bg, #ffffff);box-shadow:var(--devui-shadow-connected-overlay, 0 2px 8px 0) var(--devui-shadow, rgba(0, 0, 0, .2));z-index:1000}.devui-flexible-overlay-arrow{position:absolute;width:8px;height:8px;transform:rotate(45deg);background-color:inherit}.devui-modal-mask{justify-content:center;align-items:center;background-color:var(--devui-shadow, rgba(0, 0, 0, .2))}.devui-modal{position:relative;width:300px;background-color:var(--devui-global-bg-normal, #ffffff)}.devui-modal .btn-close{position:absolute;right:20px;top:20px;width:20px;height:20px;line-height:20px;text-align:center;color:#000;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.devui-modal .btn-close:hover{color:var(--devui-icon-fill-active-hover, #526ecc);background-color:var(--devui-list-item-hover-bg, #f2f5fc)}.devui-modal-content{background:var(--devui-fullscreen-overlay-bg, #ffffff);border-radius:var(--devui-border-radius, 2px)}.devui-modal-header{width:100%;height:56px;padding:32px 32px 0;font-size:var(--devui-font-size-card-title, 14px);font-weight:700;box-sizing:border-box;border:none;user-select:none}.devui-modal-header .header-alert-icon{display:inline-block;vertical-align:middle;margin-right:8px;line-height:16px;text-align:center}.devui-modal-body{padding:20px 32px;font-size:var(--devui-font-size, 12px);color:var(--devui-text-weak, #575d6c);box-sizing:border-box}.devui-modal-footer{width:100%;border-top:none;text-align:center;padding:0 32px 24px;box-sizing:border-box}.devui-modal-footer>*{margin:0 4px}@keyframes wipe-in-out{0%{opacity:.2;transform:translateY(-24px)}to{opacity:1;transform:translateY(0)}}.devui-modal-wipe-enter-from{opacity:.2}.devui-modal-wipe-enter-active{animation-name:wipe-in-out;animation-duration:.3s}.devui-modal-wipe-leave-to{opacity:1}.devui-modal-wipe-leave-active{animation-name:wipe-in-out;animation-duration:.3s;animation-direction:reverse}
@@ -17,7 +17,7 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import { defineComponent, createVNode, toRefs, computed, watch, Transition, reactive, createApp, onUnmounted, mergeProps, isVNode } from "vue";
20
+ import { defineComponent, toRefs, createVNode, computed, watch, Transition, reactive, createApp, onUnmounted, mergeProps, isVNode } from "vue";
21
21
  const notificationProps = {
22
22
  modelValue: {
23
23
  type: Boolean,
@@ -39,55 +39,53 @@ const notificationProps = {
39
39
  type: Function
40
40
  }
41
41
  };
42
+ const iconProps = {
43
+ name: {
44
+ type: String,
45
+ default: "",
46
+ required: true
47
+ },
48
+ size: {
49
+ type: String,
50
+ default: "inherit"
51
+ },
52
+ color: {
53
+ type: String,
54
+ default: "inherit"
55
+ },
56
+ classPrefix: {
57
+ type: String,
58
+ default: "icon"
59
+ }
60
+ };
42
61
  var Icon = defineComponent({
43
62
  name: "DIcon",
44
- props: {
45
- name: {
46
- type: String,
47
- required: true
48
- },
49
- size: {
50
- type: String,
51
- default: "inherit"
52
- },
53
- color: {
54
- type: String,
55
- default: "inherit"
56
- },
57
- classPrefix: {
58
- type: String,
59
- default: "icon"
60
- }
61
- },
63
+ props: iconProps,
62
64
  setup(props) {
63
- return __spreadValues({}, props);
64
- },
65
- render() {
66
65
  const {
67
66
  name,
68
67
  size,
69
68
  color,
70
69
  classPrefix
71
- } = this;
72
- return /^((https?):)?\/\//.test(name) ? createVNode("img", {
73
- "src": name,
74
- "alt": name.split("/")[name.split("/").length - 1],
75
- "style": {
76
- width: size,
77
- verticalAlign: "text-bottom"
78
- }
79
- }, null) : createVNode("i", {
80
- "class": `${classPrefix} ${classPrefix}-${name}`,
81
- "style": {
82
- fontSize: size,
83
- color
84
- }
85
- }, null);
70
+ } = toRefs(props);
71
+ return () => {
72
+ return /^((https?):)?\/\//.test(name.value) ? createVNode("img", {
73
+ "src": name.value,
74
+ "alt": name.value.split("/")[name.value.split("/").length - 1],
75
+ "style": {
76
+ width: size.value,
77
+ verticalAlign: "text-bottom"
78
+ }
79
+ }, null) : createVNode("i", {
80
+ "class": `${classPrefix.value} ${classPrefix.value}-${name.value}`,
81
+ "style": {
82
+ fontSize: size.value,
83
+ color: color.value
84
+ }
85
+ }, null);
86
+ };
86
87
  }
87
88
  });
88
- Icon.install = function(app) {
89
- app.component(Icon.name, Icon);
90
- };
91
89
  var Close = defineComponent({
92
90
  emits: ["click"],
93
91
  setup(props, {
@@ -1 +1 @@
1
- var z=Object.defineProperty,I=Object.defineProperties;var M=Object.getOwnPropertyDescriptors;var N=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var g=(i,e,c)=>e in i?z(i,e,{enumerable:!0,configurable:!0,writable:!0,value:c}):i[e]=c,f=(i,e)=>{for(var c in e||(e={}))k.call(e,c)&&g(i,c,e[c]);if(N)for(var c of N(e))A.call(e,c)&&g(i,c,e[c]);return i},v=(i,e)=>I(i,M(e));(function(i,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(i=typeof globalThis!="undefined"?globalThis:i||self,e(i.index={},i.Vue))})(this,function(i,e){"use strict";const c={modelValue:{type:Boolean,default:!1},title:{type:String,default:""},type:{type:String,default:"normal"},duration:{type:Number,default:3e3},onClose:{type:Function}};var u=e.defineComponent({name:"DIcon",props:{name:{type:String,required:!0},size:{type:String,default:"inherit"},color:{type:String,default:"inherit"},classPrefix:{type:String,default:"icon"}},setup(t){return f({},t)},render(){const{name:t,size:n,color:o,classPrefix:a}=this;return/^((https?):)?\/\//.test(t)?e.createVNode("img",{src:t,alt:t.split("/")[t.split("/").length-1],style:{width:n,verticalAlign:"text-bottom"}},null):e.createVNode("i",{class:`${a} ${a}-${t}`,style:{fontSize:n,color:o}},null)}});u.install=function(t){t.component(u.name,u)};var h=e.defineComponent({emits:["click"],setup(t,{emit:n}){return()=>e.createVNode("div",{class:"devui-notification-icon-close",onClick:o=>n("click",o)},[e.createVNode(u,{name:"close",size:"14px"},null)])}}),S=e.defineComponent({props:{type:{type:String,default:"normal"}},setup(t){const{type:n}=e.toRefs(t),o=e.computed(()=>({"devui-notification-image":!0,[`devui-notification-image-${n.value}`]:!0})),a={info:"info-o",success:"right-o",warning:"warning-o",error:"error-o"};return()=>e.createVNode("span",{class:o.value},[n.value!=="normal"&&e.createVNode(u,{name:a[n.value],size:"16px"},null)])}});function C(t){return{classes:e.computed(()=>({"devui-notification-item-container":!0,[`devui-notification-message-${t.type}`]:!0}))}}function T(t,n){let o=null,a;const l=()=>{var s;clearTimeout(o),o=null,(s=t.onClose)==null||s.call(t),n("update:modelValue",!1)},r=()=>{o&&(clearTimeout(o),o=null)},m=()=>{if(!t.modelValue){const s=t.duration-(Date.now()-a);o=setTimeout(l,s)}},p=()=>{n("destroy")};return e.watch(()=>t.modelValue,s=>{s&&(a=Date.now(),t.duration&&(o=setTimeout(l,t.duration)))}),{interrupt:r,removeReset:m,close:l,handleDestroy:p}}var R="",d=e.defineComponent({name:"DNotification",props:c,emits:["update:modelValue","destroy"],setup(t,{emit:n,slots:o}){const{modelValue:a,title:l,type:r}=e.toRefs(t),{classes:m}=C(t),{interrupt:p,removeReset:s,close:j,handleDestroy:x}=T(t,n);return()=>e.createVNode(e.Transition,{name:"notification-fade",onAfterLeave:x},{default:()=>{var V;return[a.value&&e.createVNode("div",{class:"devui-notification"},[e.createVNode("div",{class:m.value,onMouseenter:p,onMouseleave:s},[e.createVNode("div",{class:"devui-notification-item"},[e.createVNode(h,{onClick:j},null),l.value&&e.createVNode(S,{type:r.value},null),e.createVNode("div",{class:"devui-notification-message"},[e.createVNode("span",{class:"devui-notification-title"},[l.value]),e.createVNode("span",{class:"devui-notification-content"},[(V=o.default)==null?void 0:V.call(o)])])])])])]}})}});function b(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!e.isVNode(t)}const D={modelValue:!1,duration:3e3,type:"normal"};function P(t,n){const o=document.createElement("div"),a=e.createApp({setup(){return e.onUnmounted(()=>{document.body.removeChild(o)}),()=>e.createVNode(d,e.mergeProps(t,{onDestroy:a.unmount}),b(n)?n:{default:()=>[n]})}});return document.body.appendChild(o),a.mount(o),a}function w(t,n){t.modelValue=!1,n==null||n()}class y{static open(n){const o=n.onClose||null,a=n.content;let l;delete n.content;const r=e.reactive(v(f(f({},D),n),{onClose:()=>{w(r,o)}}));P(r,a),r.modelValue=!0,clearTimeout(l),n.duration&&(l=setTimeout(r.onClose,n.duration))}}var $={title:"Notification \u5168\u5C40\u901A\u77E5",category:"\u53CD\u9988",status:"100%",install(t){t.component(d.name,d),t.config.globalProperties.$notificationService=y}};i.Notification=d,i.NotificationService=y,i.default=$,i.notificationProps=c,Object.defineProperty(i,"__esModule",{value:!0}),i[Symbol.toStringTag]="Module"});
1
+ var I=Object.defineProperty,M=Object.defineProperties;var R=Object.getOwnPropertyDescriptors;var v=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var N=(i,e,l)=>e in i?I(i,e,{enumerable:!0,configurable:!0,writable:!0,value:l}):i[e]=l,m=(i,e)=>{for(var l in e||(e={}))k.call(e,l)&&N(i,l,e[l]);if(v)for(var l of v(e))A.call(e,l)&&N(i,l,e[l]);return i},g=(i,e)=>M(i,R(e));(function(i,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(i=typeof globalThis!="undefined"?globalThis:i||self,e(i.index={},i.Vue))})(this,function(i,e){"use strict";const l={modelValue:{type:Boolean,default:!1},title:{type:String,default:""},type:{type:String,default:"normal"},duration:{type:Number,default:3e3},onClose:{type:Function}},S={name:{type:String,default:"",required:!0},size:{type:String,default:"inherit"},color:{type:String,default:"inherit"},classPrefix:{type:String,default:"icon"}};var p=e.defineComponent({name:"DIcon",props:S,setup(n){const{name:t,size:o,color:a,classPrefix:c}=e.toRefs(n);return()=>/^((https?):)?\/\//.test(t.value)?e.createVNode("img",{src:t.value,alt:t.value.split("/")[t.value.split("/").length-1],style:{width:o.value,verticalAlign:"text-bottom"}},null):e.createVNode("i",{class:`${c.value} ${c.value}-${t.value}`,style:{fontSize:o.value,color:a.value}},null)}}),h=e.defineComponent({emits:["click"],setup(n,{emit:t}){return()=>e.createVNode("div",{class:"devui-notification-icon-close",onClick:o=>t("click",o)},[e.createVNode(p,{name:"close",size:"14px"},null)])}}),C=e.defineComponent({props:{type:{type:String,default:"normal"}},setup(n){const{type:t}=e.toRefs(n),o=e.computed(()=>({"devui-notification-image":!0,[`devui-notification-image-${t.value}`]:!0})),a={info:"info-o",success:"right-o",warning:"warning-o",error:"error-o"};return()=>e.createVNode("span",{class:o.value},[t.value!=="normal"&&e.createVNode(p,{name:a[t.value],size:"16px"},null)])}});function T(n){return{classes:e.computed(()=>({"devui-notification-item-container":!0,[`devui-notification-message-${n.type}`]:!0}))}}function b(n,t){let o=null,a;const c=()=>{var s;clearTimeout(o),o=null,(s=n.onClose)==null||s.call(n),t("update:modelValue",!1)},r=()=>{o&&(clearTimeout(o),o=null)},d=()=>{if(!n.modelValue){const s=n.duration-(Date.now()-a);o=setTimeout(c,s)}},f=()=>{t("destroy")};return e.watch(()=>n.modelValue,s=>{s&&(a=Date.now(),n.duration&&(o=setTimeout(c,n.duration)))}),{interrupt:r,removeReset:d,close:c,handleDestroy:f}}var E="",u=e.defineComponent({name:"DNotification",props:l,emits:["update:modelValue","destroy"],setup(n,{emit:t,slots:o}){const{modelValue:a,title:c,type:r}=e.toRefs(n),{classes:d}=T(n),{interrupt:f,removeReset:s,close:x,handleDestroy:z}=b(n,t);return()=>e.createVNode(e.Transition,{name:"notification-fade",onAfterLeave:z},{default:()=>{var V;return[a.value&&e.createVNode("div",{class:"devui-notification"},[e.createVNode("div",{class:d.value,onMouseenter:f,onMouseleave:s},[e.createVNode("div",{class:"devui-notification-item"},[e.createVNode(h,{onClick:x},null),c.value&&e.createVNode(C,{type:r.value},null),e.createVNode("div",{class:"devui-notification-message"},[e.createVNode("span",{class:"devui-notification-title"},[c.value]),e.createVNode("span",{class:"devui-notification-content"},[(V=o.default)==null?void 0:V.call(o)])])])])])]}})}});function D(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!e.isVNode(n)}const P={modelValue:!1,duration:3e3,type:"normal"};function w(n,t){const o=document.createElement("div"),a=e.createApp({setup(){return e.onUnmounted(()=>{document.body.removeChild(o)}),()=>e.createVNode(u,e.mergeProps(n,{onDestroy:a.unmount}),D(t)?t:{default:()=>[t]})}});return document.body.appendChild(o),a.mount(o),a}function $(n,t){n.modelValue=!1,t==null||t()}class y{static open(t){const o=t.onClose||null,a=t.content;let c;delete t.content;const r=e.reactive(g(m(m({},P),t),{onClose:()=>{$(r,o)}}));w(r,a),r.modelValue=!0,clearTimeout(c),t.duration&&(c=setTimeout(r.onClose,t.duration))}}var j={title:"Notification \u5168\u5C40\u901A\u77E5",category:"\u53CD\u9988",status:"100%",install(n){n.component(u.name,u),n.config.globalProperties.$notificationService=y}};i.Notification=u,i.NotificationService=y,i.default=j,i.notificationProps=l,Object.defineProperty(i,"__esModule",{value:!0}),i[Symbol.toStringTag]="Module"});
@@ -0,0 +1,3 @@
1
+ import '../../panel/style.css'
2
+
3
+ export { PanelBody as default } from '../../panel/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../panel/style.css'
2
+
3
+ export { PanelFooter as default } from '../../panel/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../panel/style.css'
2
+
3
+ export { PanelHeader as default } from '../../panel/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../timeline/style.css'
2
+
3
+ export { Timeline as default } from '../../timeline/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../timeline/style.css'
2
+
3
+ export { TimelineItem as default } from '../../timeline/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../alert/style.css'
2
+
3
+ export { alertProps as default } from '../../alert/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../fullscreen/style.css'
2
+
3
+ export { fullscreenProps as default } from '../../fullscreen/index.es.js'
@@ -0,0 +1,2 @@
1
+
2
+ export { iconProps as default } from '../../icon/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../pagination/style.css'
2
+
3
+ export { paginationProps as default } from '../../pagination/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../panel/style.css'
2
+
3
+ export { panelProps as default } from '../../panel/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../search/style.css'
2
+
3
+ export { searchProps as default } from '../../search/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../tag/style.css'
2
+
3
+ export { tagProps as default } from '../../tag/index.es.js'
@@ -17,9 +17,9 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import { defineComponent, createVNode, Teleport, Transition, renderSlot, isVNode, computed, onMounted, watch, onUnmounted, ref, nextTick, unref, mergeProps } from "vue";
21
- import { offset, autoPlacement, arrow, computePosition } from "@floating-ui/dom";
22
- var overlay = "";
20
+ import { defineComponent, createVNode, Teleport, Transition, renderSlot, isVNode, computed, onMounted, watch, onUnmounted, ref, unref, nextTick, mergeProps } from "vue";
21
+ import { shift, offset, autoPlacement, arrow, computePosition } from "@floating-ui/dom";
22
+ var baseOverlay = "";
23
23
  function _isSlot(s) {
24
24
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
25
25
  }
@@ -66,43 +66,13 @@ const overlayProps = {
66
66
  default: true
67
67
  }
68
68
  };
69
- const overlayEmits = ["update:visible", "backdropClick"];
70
69
  const fixedOverlayProps = __spreadProps(__spreadValues({}, overlayProps), {
71
70
  overlayStyle: {
72
71
  type: [String, Object],
73
72
  default: void 0
74
73
  }
75
74
  });
76
- const flexibleOverlayProps = {
77
- modelValue: {
78
- type: Boolean,
79
- default: false
80
- },
81
- origin: {
82
- type: Object,
83
- require: true
84
- },
85
- position: {
86
- type: Array,
87
- default: ["bottom"]
88
- },
89
- offset: {
90
- type: [Number, Object],
91
- default: 8
92
- },
93
- align: {
94
- type: String,
95
- default: null
96
- },
97
- showArrow: {
98
- type: Boolean,
99
- default: false
100
- },
101
- isArrowCenter: {
102
- type: Boolean,
103
- default: true
104
- }
105
- };
75
+ const overlayEmits = ["update:visible", "backdropClick"];
106
76
  function useOverlayLogic(props, ctx) {
107
77
  const backgroundClass = computed(() => {
108
78
  return [
@@ -153,6 +123,7 @@ function useOverlayLogic(props, ctx) {
153
123
  handleOverlayBubbleCancel
154
124
  };
155
125
  }
126
+ var fixedOverlay = "";
156
127
  const FixedOverlay = defineComponent({
157
128
  name: "DFixedOverlay",
158
129
  props: fixedOverlayProps,
@@ -177,6 +148,36 @@ const FixedOverlay = defineComponent({
177
148
  });
178
149
  }
179
150
  });
151
+ const flexibleOverlayProps = {
152
+ modelValue: {
153
+ type: Boolean,
154
+ default: false
155
+ },
156
+ origin: {
157
+ type: Object,
158
+ require: true
159
+ },
160
+ position: {
161
+ type: Array,
162
+ default: ["bottom"]
163
+ },
164
+ offset: {
165
+ type: [Number, Object],
166
+ default: 8
167
+ },
168
+ align: {
169
+ type: String,
170
+ default: null
171
+ },
172
+ showArrow: {
173
+ type: Boolean,
174
+ default: false
175
+ },
176
+ isArrowCenter: {
177
+ type: Boolean,
178
+ default: true
179
+ }
180
+ };
180
181
  function getScrollParent(element) {
181
182
  const overflowRegex = /(auto|scroll|hidden)/;
182
183
  for (let parent = element; parent = parent.parentElement; parent.parentElement !== document.body) {
@@ -230,6 +231,7 @@ function useOverlay(props, emit) {
230
231
  const overlayEl = unref(overlayRef.value);
231
232
  const arrowEl = unref(arrowRef.value);
232
233
  const middleware = [
234
+ shift(),
233
235
  offset(props.offset),
234
236
  autoPlacement({
235
237
  alignment: props.align,
@@ -264,7 +266,7 @@ function useOverlay(props, emit) {
264
266
  originParent !== window && window.removeEventListener("scroll", updatePosition);
265
267
  window.removeEventListener("resize", updatePosition);
266
268
  });
267
- return { arrowRef, overlayRef };
269
+ return { arrowRef, overlayRef, updatePosition };
268
270
  }
269
271
  var flexibleOverlay = "";
270
272
  const FlexibleOverlay = defineComponent({
@@ -275,12 +277,17 @@ const FlexibleOverlay = defineComponent({
275
277
  setup(props, {
276
278
  slots,
277
279
  attrs,
278
- emit
280
+ emit,
281
+ expose
279
282
  }) {
280
283
  const {
281
284
  arrowRef,
282
- overlayRef
285
+ overlayRef,
286
+ updatePosition
283
287
  } = useOverlay(props, emit);
288
+ expose({
289
+ updatePosition
290
+ });
284
291
  return () => {
285
292
  var _a;
286
293
  return props.modelValue && createVNode("div", mergeProps({