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
@@ -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 '../../auto-complete/style.css'
2
+
3
+ export { DropdownPropsKey as default } from '../../auto-complete/index.es.js'
@@ -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 '../../auto-complete/style.css'
2
+
3
+ export { autoCompleteProps as default } from '../../auto-complete/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../avatar/style.css'
2
+
3
+ export { avatarProps as default } from '../../avatar/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../card/style.css'
2
+
3
+ export { cardProps as default } from '../../card/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../checkbox/style.css'
2
+
3
+ export { checkboxGroupInjectionKey as default } from '../../checkbox/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../checkbox/style.css'
2
+
3
+ export { checkboxGroupProps as default } from '../../checkbox/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../checkbox/style.css'
2
+
3
+ export { checkboxProps as default } from '../../checkbox/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../grid/style.css'
2
+
3
+ export { colProps as default } from '../../grid/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../grid/style.css'
2
+
3
+ export { colPropsBaseClass as default } from '../../grid/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../grid/style.css'
2
+
3
+ export { colPropsBaseStyle as default } from '../../grid/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../comment/style.css'
2
+
3
+ export { commentProps as default } from '../../comment/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../countdown/style.css'
2
+
3
+ export { countdownProps as default } from '../../countdown/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../editable-select/style.css'
2
+
3
+ export { editableSelectProps as default } from '../../editable-select/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 '../../image-preview/style.css'
2
+
3
+ export { imagePreviewProps as default } from '../../image-preview/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../input/style.css'
2
+
3
+ export { inputProps as default } from '../../input/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 '../../progress/style.css'
2
+
3
+ export { progressProps as default } from '../../progress/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../rate/style.css'
2
+
3
+ export { rateProps as default } from '../../rate/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../read-tip/style.css'
2
+
3
+ export { readTipProps as default } from '../../read-tip/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../result/style.css'
2
+
3
+ export { resultProps as default } from '../../result/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../grid/style.css'
2
+
3
+ export { rowProps as default } from '../../grid/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../grid/style.css'
2
+
3
+ export { screenSizes as default } from '../../grid/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 '../../skeleton/style.css'
2
+
3
+ export { skeletonProps as default } from '../../skeleton/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../splitter/style.css'
2
+
3
+ export { splitterProps as default } from '../../splitter/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../statistic/style.css'
2
+
3
+ export { statisticProps as default } from '../../statistic/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../switch/style.css'
2
+
3
+ export { switchProps as default } from '../../switch/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../tag-input/style.css'
2
+
3
+ export { tagInputProps as default } from '../../tag-input/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../tag/style.css'
2
+
3
+ export { tagProps as default } from '../../tag/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../textarea/style.css'
2
+
3
+ export { textareaProps as default } from '../../textarea/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../timeline/style.css'
2
+
3
+ export { timeAxisProps as default } from '../../timeline/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) {
@@ -209,6 +210,7 @@ function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
209
210
  function useOverlay(props, emit) {
210
211
  const overlayRef = ref();
211
212
  const arrowRef = ref();
213
+ let originParent = null;
212
214
  const updateArrowPosition = (arrowEl, placement, point, overlayEl) => {
213
215
  const { x, y } = adjustArrowPosition(props.isArrowCenter, point, placement, overlayEl.getBoundingClientRect());
214
216
  const staticSide = {
@@ -230,6 +232,7 @@ function useOverlay(props, emit) {
230
232
  const overlayEl = unref(overlayRef.value);
231
233
  const arrowEl = unref(arrowRef.value);
232
234
  const middleware = [
235
+ shift(),
233
236
  offset(props.offset),
234
237
  autoPlacement({
235
238
  alignment: props.align,
@@ -246,25 +249,24 @@ function useOverlay(props, emit) {
246
249
  props.showArrow && updateArrowPosition(arrowEl, placement, middlewareData.arrow, overlayEl);
247
250
  };
248
251
  watch(() => props.modelValue, () => {
249
- const originParent = getScrollParent(props.origin);
250
252
  if (props.modelValue && props.origin) {
253
+ originParent = getScrollParent(props.origin);
251
254
  nextTick(updatePosition);
252
- originParent.addEventListener("scroll", updatePosition);
255
+ originParent == null ? void 0 : originParent.addEventListener("scroll", updatePosition);
253
256
  originParent !== window && window.addEventListener("scroll", updatePosition);
254
257
  window.addEventListener("resize", updatePosition);
255
258
  } else {
256
- originParent.removeEventListener("scroll", updatePosition);
259
+ originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
257
260
  originParent !== window && window.removeEventListener("scroll", updatePosition);
258
261
  window.removeEventListener("resize", updatePosition);
259
262
  }
260
263
  });
261
264
  onUnmounted(() => {
262
- const originParent = getScrollParent(props.origin);
263
- originParent.removeEventListener("scroll", updatePosition);
265
+ originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
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({
@@ -1 +1 @@
1
- var _=Object.defineProperty,R=Object.defineProperties;var T=Object.getOwnPropertyDescriptors;var O=Object.getOwnPropertySymbols;var $=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var x=(n,e,a)=>e in n?_(n,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[e]=a,B=(n,e)=>{for(var a in e||(e={}))$.call(e,a)&&x(n,a,e[a]);if(O)for(var a of O(e))z.call(e,a)&&x(n,a,e[a]);return n},E=(n,e)=>R(n,T(e));(function(n,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):(n=typeof globalThis!="undefined"?globalThis:n||self,e(n.index={},n.Vue,n.dom))})(this,function(n,e,a){"use strict";var D="";function P(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!e.isVNode(t)}const S=e.defineComponent({setup(t,l){return()=>{let r;return e.createVNode(e.Teleport,{to:"#d-overlay-anchor"},{default:()=>[e.createVNode(e.Transition,{name:"devui-overlay-fade"},P(r=e.renderSlot(l.slots,"default"))?r:{default:()=>[r]})]})}}}),g={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}},p=["update:visible","backdropClick"],h=E(B({},g),{overlayStyle:{type:[String,Object],default:void 0}}),k={modelValue:{type:Boolean,default:!1},origin:{type:Object,require:!0},position:{type:Array,default:["bottom"]},offset:{type:[Number,Object],default:8},align:{type:String,default:null},showArrow:{type:Boolean,default:!1},isArrowCenter:{type:Boolean,default:!0}};function V(t,l){const r=e.computed(()=>["devui-overlay-background",t.backgroundClass,t.hasBackdrop?"devui-overlay-background__color":"devui-overlay-background__disabled"]),d=e.computed(()=>"devui-overlay"),c=o=>{var s;o.preventDefault(),(s=t.onBackdropClick)==null||s.call(t),t.backdropClose&&l.emit("update:visible",!1)},i=o=>o.cancelBubble=!0;return e.onMounted(()=>{const o=document.body,s=o.style.overflow,y=o.style.position;e.watch([()=>t.visible,()=>t.backgroundBlock],([u,v])=>{if(v){const f=o.getBoundingClientRect().y;u?(o.style.overflowY="scroll",o.style.position=u?"fixed":"",o.style.top=`${f}px`):(o.style.overflowY=s,o.style.position=y,o.style.top="",window.scrollTo(0,-f))}}),e.onUnmounted(()=>{document.body.style.overflow=s})}),{backgroundClass:r,overlayClass:d,handleBackdropClick:c,handleOverlayBubbleCancel:i}}const m=e.defineComponent({name:"DFixedOverlay",props:h,emits:p,setup(t,l){const{backgroundClass:r,overlayClass:d,handleBackdropClick:c,handleOverlayBubbleCancel:i}=V(t,l);return()=>e.createVNode(S,null,{default:()=>[t.visible&&e.createVNode("div",{class:r.value,style:t.backgroundStyle,onClick:c},[e.createVNode("div",{class:d.value,style:t.overlayStyle,onClick:i},[e.renderSlot(l.slots,"default")])])]})}});function C(t){const l=/(auto|scroll|hidden)/;for(let r=t;r=r.parentElement;r.parentElement!==document.body){const d=window.getComputedStyle(r);if(l.test(d.overflow+d.overflowX+d.overflowY))return r}return window}function A(t,l,r,d){let{x:c,y:i}=l;if(!t){const{width:o,height:s}=d;c&&r.includes("start")&&(c=12),c&&r.includes("end")&&(c=Math.round(o-24)),i&&r.includes("start")&&(i=10),i&&r.includes("end")&&(i=s-14)}return{x:c,y:i}}function j(t,l){const r=e.ref(),d=e.ref(),c=(o,s,y,u)=>{const{x:v,y:f}=A(t.isArrowCenter,y,s,u.getBoundingClientRect()),w={top:"bottom",right:"left",bottom:"top",left:"right"}[s.split("-")[0]];Object.assign(o.style,{left:v?`${v}px`:"",top:f?`${f}px`:"",right:"",bottom:"",[w]:"-4px"})},i=async()=>{const o=t.origin,s=e.unref(r.value),y=e.unref(d.value),u=[a.offset(t.offset),a.autoPlacement({alignment:t.align,allowedPlacements:t.position})];t.showArrow&&u.push(a.arrow({element:y}));const{x:v,y:f,placement:w,middlewareData:F}=await a.computePosition(o,s,{strategy:"fixed",middleware:u});l("positionChange",w),Object.assign(s.style,{top:`${f}px`,left:`${v}px`}),t.showArrow&&c(y,w,F.arrow,s)};return e.watch(()=>t.modelValue,()=>{const o=C(t.origin);t.modelValue&&t.origin?(e.nextTick(i),o.addEventListener("scroll",i),o!==window&&window.addEventListener("scroll",i),window.addEventListener("resize",i)):(o.removeEventListener("scroll",i),o!==window&&window.removeEventListener("scroll",i),window.removeEventListener("resize",i))}),e.onUnmounted(()=>{const o=C(t.origin);o.removeEventListener("scroll",i),o!==window&&window.removeEventListener("scroll",i),window.removeEventListener("resize",i)}),{arrowRef:d,overlayRef:r}}var M="";const b=e.defineComponent({name:"DFlexibleOverlay",inheritAttrs:!1,props:k,emits:["update:modelValue","positionChange"],setup(t,{slots:l,attrs:r,emit:d}){const{arrowRef:c,overlayRef:i}=j(t,d);return()=>{var o;return t.modelValue&&e.createVNode("div",e.mergeProps({ref:i,class:"devui-flexible-overlay"},r),[(o=l.default)==null?void 0:o.call(l),t.showArrow&&e.createVNode("div",{ref:c,class:"devui-flexible-overlay-arrow"},null)])}}}),L=typeof window!="undefined";var N={title:"Overlay \u906E\u7F69\u5C42",category:"\u901A\u7528",status:"100%",install(t){if(t.component(m.name,m),t.component(b.name,b),L&&!document.getElementById("d-overlay-anchor")){const l=document.createElement("div");l.setAttribute("id","d-overlay-anchor"),l.style.position="fixed",l.style.left="0",l.style.top="0",l.style.zIndex="1000",document.body.appendChild(l)}}};n.FixedOverlay=m,n.FlexibleOverlay=b,n.default=N,n.fixedOverlayProps=h,n.flexibleOverlayProps=k,n.overlayEmits=p,n.overlayProps=g,Object.defineProperty(n,"__esModule",{value:!0}),n[Symbol.toStringTag]="Module"});
1
+ var R=Object.defineProperty,T=Object.defineProperties;var $=Object.getOwnPropertyDescriptors;var O=Object.getOwnPropertySymbols;var z=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable;var x=(l,e,a)=>e in l?R(l,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):l[e]=a,B=(l,e)=>{for(var a in e||(e={}))z.call(e,a)&&x(l,a,e[a]);if(O)for(var a of O(e))D.call(e,a)&&x(l,a,e[a]);return l},E=(l,e)=>T(l,$(e));(function(l,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):(l=typeof globalThis!="undefined"?globalThis:l||self,e(l.index={},l.Vue,l.dom))})(this,function(l,e,a){"use strict";var M="";function S(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!e.isVNode(t)}const V=e.defineComponent({setup(t,r){return()=>{let i;return e.createVNode(e.Teleport,{to:"#d-overlay-anchor"},{default:()=>[e.createVNode(e.Transition,{name:"devui-overlay-fade"},S(i=e.renderSlot(r.slots,"default"))?i:{default:()=>[i]})]})}}}),p={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}},h=E(B({},p),{overlayStyle:{type:[String,Object],default:void 0}}),k=["update:visible","backdropClick"];function A(t,r){const i=e.computed(()=>["devui-overlay-background",t.backgroundClass,t.hasBackdrop?"devui-overlay-background__color":"devui-overlay-background__disabled"]),d=e.computed(()=>"devui-overlay"),n=o=>{var c;o.preventDefault(),(c=t.onBackdropClick)==null||c.call(t),t.backdropClose&&r.emit("update:visible",!1)},s=o=>o.cancelBubble=!0;return e.onMounted(()=>{const o=document.body,c=o.style.overflow,u=o.style.position;e.watch([()=>t.visible,()=>t.backgroundBlock],([f,v])=>{if(v){const y=o.getBoundingClientRect().y;f?(o.style.overflowY="scroll",o.style.position=f?"fixed":"",o.style.top=`${y}px`):(o.style.overflowY=c,o.style.position=u,o.style.top="",window.scrollTo(0,-y))}}),e.onUnmounted(()=>{document.body.style.overflow=c})}),{backgroundClass:i,overlayClass:d,handleBackdropClick:n,handleOverlayBubbleCancel:s}}var q="";const m=e.defineComponent({name:"DFixedOverlay",props:h,emits:k,setup(t,r){const{backgroundClass:i,overlayClass:d,handleBackdropClick:n,handleOverlayBubbleCancel:s}=A(t,r);return()=>e.createVNode(V,null,{default:()=>[t.visible&&e.createVNode("div",{class:i.value,style:t.backgroundStyle,onClick:n},[e.createVNode("div",{class:d.value,style:t.overlayStyle,onClick:s},[e.renderSlot(r.slots,"default")])])]})}}),C={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 j(t){const r=/(auto|scroll|hidden)/;for(let i=t;i=i.parentElement;i.parentElement!==document.body){const d=window.getComputedStyle(i);if(r.test(d.overflow+d.overflowX+d.overflowY))return i}return window}function P(t,r,i,d){let{x:n,y:s}=r;if(!t){const{width:o,height:c}=d;n&&i.includes("start")&&(n=12),n&&i.includes("end")&&(n=Math.round(o-24)),s&&i.includes("start")&&(s=10),s&&i.includes("end")&&(s=c-14)}return{x:n,y:s}}function L(t,r){const i=e.ref(),d=e.ref();let n=null;const s=(c,u,f,v)=>{const{x:y,y:w}=P(t.isArrowCenter,f,u,v.getBoundingClientRect()),b={top:"bottom",right:"left",bottom:"top",left:"right"}[u.split("-")[0]];Object.assign(c.style,{left:y?`${y}px`:"",top:w?`${w}px`:"",right:"",bottom:"",[b]:"-4px"})},o=async()=>{const c=t.origin,u=e.unref(i.value),f=e.unref(d.value),v=[a.shift(),a.offset(t.offset),a.autoPlacement({alignment:t.align,allowedPlacements:t.position})];t.showArrow&&v.push(a.arrow({element:f}));const{x:y,y:w,placement:b,middlewareData:_}=await a.computePosition(c,u,{strategy:"fixed",middleware:v});r("positionChange",b),Object.assign(u.style,{top:`${w}px`,left:`${y}px`}),t.showArrow&&s(f,b,_.arrow,u)};return e.watch(()=>t.modelValue,()=>{t.modelValue&&t.origin?(n=j(t.origin),e.nextTick(o),n==null||n.addEventListener("scroll",o),n!==window&&window.addEventListener("scroll",o),window.addEventListener("resize",o)):(n==null||n.removeEventListener("scroll",o),n!==window&&window.removeEventListener("scroll",o),window.removeEventListener("resize",o))}),e.onUnmounted(()=>{n==null||n.removeEventListener("scroll",o),n!==window&&window.removeEventListener("scroll",o),window.removeEventListener("resize",o)}),{arrowRef:d,overlayRef:i,updatePosition:o}}var Y="";const g=e.defineComponent({name:"DFlexibleOverlay",inheritAttrs:!1,props:C,emits:["update:modelValue","positionChange"],setup(t,{slots:r,attrs:i,emit:d,expose:n}){const{arrowRef:s,overlayRef:o,updatePosition:c}=L(t,d);return n({updatePosition:c}),()=>{var u;return t.modelValue&&e.createVNode("div",e.mergeProps({ref:o,class:"devui-flexible-overlay"},i),[(u=r.default)==null?void 0:u.call(r),t.showArrow&&e.createVNode("div",{ref:s,class:"devui-flexible-overlay-arrow"},null)])}}}),N=typeof window!="undefined";var F={title:"Overlay \u906E\u7F69\u5C42",category:"\u901A\u7528",status:"100%",install(t){if(t.component(m.name,m),t.component(g.name,g),N&&!document.getElementById("d-overlay-anchor")){const r=document.createElement("div");r.setAttribute("id","d-overlay-anchor"),r.style.position="fixed",r.style.left="0",r.style.top="0",r.style.zIndex="1000",document.body.appendChild(r)}}};l.FixedOverlay=m,l.FlexibleOverlay=g,l.default=F,l.fixedOverlayProps=h,l.flexibleOverlayProps=C,l.overlayEmits=k,l.overlayProps=p,Object.defineProperty(l,"__esModule",{value:!0}),l[Symbol.toStringTag]="Module"});
package/overlay/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}
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}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-devui",
3
- "version": "1.0.0-rc.0",
3
+ "version": "1.0.0-rc.3",
4
4
  "license": "MIT",
5
5
  "description": "DevUI components based on Vite and Vue3",
6
6
  "keywords": [
@@ -15,6 +15,11 @@
15
15
  "jsx",
16
16
  "devui"
17
17
  ],
18
+ "homepage": "https://vue-devui.github.io/",
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git@github.com:DevCloudFE/vue-devui.git"
22
+ },
18
23
  "main": "vue-devui.umd.js",
19
24
  "module": "vue-devui.es.js",
20
25
  "style": "style.css",
@@ -24,52 +29,12 @@
24
29
  "@types/lodash-es": "^4.17.4",
25
30
  "@vueuse/core": "^7.7.1",
26
31
  "async-validator": "^4.0.2",
27
- "devui-theme": "workspace:^0.0.1",
32
+ "devui-theme": "^0.0.1",
28
33
  "fs-extra": "^10.0.0",
29
34
  "lodash": "^4.17.21",
30
35
  "lodash-es": "^4.17.20",
31
36
  "mitt": "^3.0.0",
32
37
  "vue": "^3.1.1",
33
38
  "vue-router": "^4.0.3"
34
- },
35
- "devDependencies": {
36
- "@babel/parser": "^7.15.5",
37
- "@babel/preset-env": "^7.14.5",
38
- "@babel/preset-typescript": "^7.14.5",
39
- "@babel/traverse": "^7.15.4",
40
- "@commitlint/cli": "^11.0.0",
41
- "@commitlint/config-conventional": "^11.0.0",
42
- "@docsearch/css": "^3.0.0-alpha.50",
43
- "@docsearch/js": "^3.0.0-alpha.50",
44
- "@types/chalk": "^2.2.0",
45
- "@types/commander": "^2.12.2",
46
- "@types/jest": "^26.0.23",
47
- "@types/ora": "^3.2.0",
48
- "@typescript-eslint/eslint-plugin": "^4.27.0",
49
- "@typescript-eslint/parser": "^4.27.0",
50
- "@vitejs/plugin-vue": "^1.3.0",
51
- "@vitejs/plugin-vue-jsx": "^1.1.0",
52
- "@vue/babel-plugin-jsx": "^1.0.6",
53
- "@vue/compiler-sfc": "^3.0.5",
54
- "@vue/test-utils": "^2.0.0-rc.9",
55
- "@vuedx/typecheck": "^0.4.1",
56
- "@vuedx/typescript-plugin-vue": "^0.4.1",
57
- "babel-jest": "^27.0.2",
58
- "chalk": "^4.1.2",
59
- "commander": "^8.1.0",
60
- "devui-cli": "workspace:^0.0.2",
61
- "inquirer": "^8.1.2",
62
- "jest": "^27.0.4",
63
- "ora": "^5.4.1",
64
- "patch-vue-directive-ssr": "^0.0.1",
65
- "sass": "^1.32.2",
66
- "shelljs": "^0.8.4",
67
- "typescript": "^4.3.2",
68
- "vite": "^2.4.4",
69
- "vite-plugin-md": "^0.6.0",
70
- "vite-svg-loader": "^2.2.0",
71
- "vitepress": "0.20.1",
72
- "vitepress-theme-demoblock": "1.3.2",
73
- "vue-tsc": "^0.2.2"
74
39
  }
75
- }
40
+ }