vue-devui 1.0.0-alpha.4 → 1.0.0-beta.10

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 (346) hide show
  1. package/accordion/index.d.ts +7 -0
  2. package/accordion/index.es.js +237 -1
  3. package/accordion/index.umd.js +1 -1
  4. package/accordion/style.css +1 -1
  5. package/alert/index.d.ts +7 -0
  6. package/alert/index.es.js +175 -1
  7. package/alert/index.umd.js +1 -1
  8. package/alert/style.css +1 -1
  9. package/anchor/index.d.ts +7 -0
  10. package/anchor/index.es.js +263 -1
  11. package/anchor/index.umd.js +1 -1
  12. package/avatar/index.d.ts +7 -0
  13. package/avatar/index.es.js +301 -1
  14. package/avatar/index.umd.js +1 -1
  15. package/back-top/index.d.ts +7 -0
  16. package/back-top/index.es.js +128 -0
  17. package/back-top/index.umd.js +1 -0
  18. package/back-top/package.json +7 -0
  19. package/back-top/style.css +1 -0
  20. package/badge/index.d.ts +7 -0
  21. package/badge/index.es.js +95 -1
  22. package/badge/index.umd.js +1 -1
  23. package/breadcrumb/index.d.ts +7 -0
  24. package/breadcrumb/index.es.js +127 -1
  25. package/breadcrumb/index.umd.js +1 -1
  26. package/breadcrumb/style.css +1 -1
  27. package/button/index.d.ts +7 -0
  28. package/button/index.es.js +190 -1
  29. package/button/index.umd.js +1 -1
  30. package/card/index.d.ts +7 -0
  31. package/card/index.es.js +61 -1
  32. package/card/index.umd.js +1 -1
  33. package/carousel/index.d.ts +7 -0
  34. package/carousel/index.es.js +329 -1
  35. package/carousel/index.umd.js +1 -1
  36. package/cascader/index.d.ts +7 -0
  37. package/cascader/index.es.js +1343 -1
  38. package/cascader/index.umd.js +1 -1
  39. package/cascader/style.css +1 -1
  40. package/checkbox/index.d.ts +7 -0
  41. package/checkbox/index.es.js +377 -1
  42. package/checkbox/index.umd.js +1 -1
  43. package/comment/index.d.ts +7 -0
  44. package/comment/index.es.js +85 -0
  45. package/comment/index.umd.js +1 -0
  46. package/comment/package.json +7 -0
  47. package/comment/style.css +1 -0
  48. package/countdown/index.d.ts +7 -0
  49. package/countdown/index.es.js +176 -0
  50. package/countdown/index.umd.js +1 -0
  51. package/countdown/package.json +7 -0
  52. package/countdown/style.css +1 -0
  53. package/date-picker/index.d.ts +7 -0
  54. package/date-picker/index.es.js +1172 -1
  55. package/date-picker/index.umd.js +1 -1
  56. package/date-picker/style.css +1 -1
  57. package/dragdrop/index.d.ts +7 -0
  58. package/dragdrop/index.es.js +32 -0
  59. package/dragdrop/index.umd.js +1 -0
  60. package/dragdrop/package.json +7 -0
  61. package/drawer/index.d.ts +7 -0
  62. package/drawer/index.es.js +288 -0
  63. package/drawer/index.umd.js +1 -0
  64. package/drawer/package.json +7 -0
  65. package/drawer/style.css +1 -0
  66. package/dropdown/index.d.ts +7 -0
  67. package/dropdown/index.es.js +527 -0
  68. package/dropdown/index.umd.js +1 -0
  69. package/dropdown/package.json +7 -0
  70. package/dropdown/style.css +1 -0
  71. package/editable-select/index.d.ts +7 -0
  72. package/editable-select/index.es.js +5793 -1
  73. package/editable-select/index.umd.js +27 -1
  74. package/editable-select/style.css +1 -1
  75. package/form/index.d.ts +7 -0
  76. package/form/index.es.js +2244 -0
  77. package/form/index.umd.js +1 -0
  78. package/form/package.json +7 -0
  79. package/form/style.css +1 -0
  80. package/fullscreen/index.d.ts +7 -0
  81. package/fullscreen/index.es.js +163 -1
  82. package/fullscreen/index.umd.js +1 -1
  83. package/gantt/index.d.ts +7 -0
  84. package/gantt/index.es.js +535 -0
  85. package/gantt/index.umd.js +1 -0
  86. package/gantt/package.json +7 -0
  87. package/gantt/style.css +1 -0
  88. package/grid/index.d.ts +7 -0
  89. package/grid/index.es.js +269 -0
  90. package/grid/index.umd.js +1 -0
  91. package/grid/package.json +7 -0
  92. package/grid/style.css +1 -0
  93. package/icon/index.d.ts +7 -0
  94. package/icon/index.es.js +75 -1
  95. package/icon/index.umd.js +1 -1
  96. package/image-preview/index.d.ts +7 -0
  97. package/image-preview/index.es.js +480 -1
  98. package/image-preview/index.umd.js +1 -1
  99. package/image-preview/style.css +1 -1
  100. package/index.d.ts +7 -0
  101. package/input/index.d.ts +7 -0
  102. package/input/index.es.js +190 -1
  103. package/input/index.umd.js +1 -1
  104. package/input-icon/index.d.ts +7 -0
  105. package/input-icon/index.es.js +332 -0
  106. package/input-icon/index.umd.js +1 -0
  107. package/input-icon/package.json +7 -0
  108. package/input-icon/style.css +1 -0
  109. package/input-number/index.d.ts +7 -0
  110. package/input-number/index.es.js +240 -1
  111. package/input-number/index.umd.js +1 -1
  112. package/input-number/style.css +1 -1
  113. package/layout/index.d.ts +7 -0
  114. package/layout/index.es.js +100 -0
  115. package/layout/index.umd.js +1 -0
  116. package/layout/package.json +7 -0
  117. package/layout/style.css +1 -0
  118. package/loading/index.d.ts +7 -0
  119. package/loading/index.es.js +256 -1
  120. package/loading/index.umd.js +1 -1
  121. package/modal/index.d.ts +7 -0
  122. package/modal/index.es.js +1027 -1
  123. package/modal/index.umd.js +1 -1
  124. package/modal/style.css +1 -1
  125. package/nav-sprite/index.d.ts +7 -0
  126. package/nav-sprite/index.es.js +742 -0
  127. package/nav-sprite/index.umd.js +1 -0
  128. package/nav-sprite/package.json +7 -0
  129. package/nuxt/components/Accordion.js +3 -0
  130. package/nuxt/components/Alert.js +3 -0
  131. package/nuxt/components/Anchor.js +3 -0
  132. package/nuxt/components/Aside.js +3 -0
  133. package/nuxt/components/Avatar.js +3 -0
  134. package/nuxt/components/BackTop.js +3 -0
  135. package/nuxt/components/Badge.js +3 -0
  136. package/nuxt/components/Breadcrumb.js +3 -0
  137. package/nuxt/components/Button.js +3 -0
  138. package/nuxt/components/Card.js +3 -0
  139. package/nuxt/components/Carousel.js +3 -0
  140. package/nuxt/components/Cascader.js +3 -0
  141. package/nuxt/components/Checkbox.js +3 -0
  142. package/nuxt/components/Col.js +3 -0
  143. package/nuxt/components/Column.js +3 -0
  144. package/nuxt/components/Comment.js +3 -0
  145. package/nuxt/components/Content.js +3 -0
  146. package/nuxt/components/Countdown.js +3 -0
  147. package/nuxt/components/DatePicker.js +3 -0
  148. package/nuxt/components/Drawer.js +3 -0
  149. package/nuxt/components/Dropdown.js +3 -0
  150. package/nuxt/components/EditableSelect.js +3 -0
  151. package/nuxt/components/FixedOverlay.js +3 -0
  152. package/nuxt/components/FlexibleOverlay.js +3 -0
  153. package/nuxt/components/Footer.js +3 -0
  154. package/nuxt/components/Form.js +3 -0
  155. package/nuxt/components/FormControl.js +3 -0
  156. package/nuxt/components/FormItem.js +3 -0
  157. package/nuxt/components/FormLabel.js +3 -0
  158. package/nuxt/components/FormOperation.js +3 -0
  159. package/nuxt/components/Fullscreen.js +3 -0
  160. package/nuxt/components/Gantt.js +3 -0
  161. package/nuxt/components/Header.js +3 -0
  162. package/nuxt/components/Icon.js +2 -0
  163. package/nuxt/components/ImagePreviewService.js +3 -0
  164. package/nuxt/components/Input.js +3 -0
  165. package/nuxt/components/InputIcon.js +3 -0
  166. package/nuxt/components/InputNumber.js +3 -0
  167. package/nuxt/components/Layout.js +3 -0
  168. package/nuxt/components/Loading.js +3 -0
  169. package/nuxt/components/LoadingService.js +3 -0
  170. package/nuxt/components/Modal.js +3 -0
  171. package/nuxt/components/MultiUpload.js +3 -0
  172. package/nuxt/components/NavSprite.js +2 -0
  173. package/nuxt/components/Pagination.js +3 -0
  174. package/nuxt/components/Panel.js +3 -0
  175. package/nuxt/components/Popover.js +3 -0
  176. package/nuxt/components/Progress.js +3 -0
  177. package/nuxt/components/QuadrantDiagram.js +3 -0
  178. package/nuxt/components/Radio.js +3 -0
  179. package/nuxt/components/RadioGroup.js +3 -0
  180. package/nuxt/components/Rate.js +3 -0
  181. package/nuxt/components/ReadTip.js +3 -0
  182. package/nuxt/components/Result.js +3 -0
  183. package/nuxt/components/Row.js +3 -0
  184. package/nuxt/components/Search.js +3 -0
  185. package/nuxt/components/Select.js +3 -0
  186. package/nuxt/components/Skeleton.js +3 -0
  187. package/nuxt/components/SkeletonItem.js +3 -0
  188. package/nuxt/components/Slider.js +3 -0
  189. package/nuxt/components/Splitter.js +3 -0
  190. package/nuxt/components/Statistic.js +3 -0
  191. package/nuxt/components/Status.js +3 -0
  192. package/nuxt/components/StepsGuide.js +3 -0
  193. package/nuxt/components/StickSlider.js +3 -0
  194. package/nuxt/components/Sticky.js +2 -0
  195. package/nuxt/components/Switch.js +3 -0
  196. package/nuxt/components/Table.js +3 -0
  197. package/nuxt/components/Tabs.js +3 -0
  198. package/nuxt/components/Tag.js +3 -0
  199. package/nuxt/components/TagInput.js +3 -0
  200. package/nuxt/components/Textarea.js +3 -0
  201. package/nuxt/components/TimeAxis.js +3 -0
  202. package/nuxt/components/TimeAxisItem.js +3 -0
  203. package/nuxt/components/TimePicker.js +3 -0
  204. package/nuxt/components/Toast.js +3 -0
  205. package/nuxt/components/ToastService.js +3 -0
  206. package/nuxt/components/Tooltip.js +3 -0
  207. package/nuxt/components/Transfer.js +3 -0
  208. package/nuxt/components/Tree.js +3 -0
  209. package/nuxt/components/TreeSelect.js +3 -0
  210. package/nuxt/components/Upload.js +3 -0
  211. package/nuxt/components/buttonProps.js +3 -0
  212. package/nuxt/index.js +13 -0
  213. package/overlay/index.d.ts +7 -0
  214. package/overlay/index.es.js +368 -1
  215. package/overlay/index.umd.js +1 -1
  216. package/overlay/style.css +1 -1
  217. package/package.json +8 -33
  218. package/pagination/index.d.ts +7 -0
  219. package/pagination/index.es.js +642 -1
  220. package/pagination/index.umd.js +1 -1
  221. package/panel/index.d.ts +7 -0
  222. package/panel/index.es.js +205 -1
  223. package/panel/index.umd.js +1 -1
  224. package/panel/style.css +1 -1
  225. package/popover/index.d.ts +7 -0
  226. package/popover/index.es.js +236 -1
  227. package/popover/index.umd.js +1 -1
  228. package/popover/style.css +1 -1
  229. package/progress/index.d.ts +7 -0
  230. package/progress/index.es.js +153 -1
  231. package/progress/index.umd.js +3 -1
  232. package/quadrant-diagram/index.d.ts +7 -0
  233. package/quadrant-diagram/index.es.js +489 -1
  234. package/quadrant-diagram/index.umd.js +1 -1
  235. package/radio/index.d.ts +7 -0
  236. package/radio/index.es.js +225 -1
  237. package/radio/index.umd.js +1 -1
  238. package/rate/index.d.ts +7 -0
  239. package/rate/index.es.js +220 -1
  240. package/rate/index.umd.js +1 -1
  241. package/read-tip/index.d.ts +7 -0
  242. package/read-tip/index.es.js +258 -0
  243. package/read-tip/index.umd.js +1 -0
  244. package/read-tip/package.json +7 -0
  245. package/read-tip/style.css +1 -0
  246. package/result/index.d.ts +7 -0
  247. package/result/index.es.js +119 -0
  248. package/result/index.umd.js +1 -0
  249. package/result/package.json +7 -0
  250. package/result/style.css +1 -0
  251. package/ripple/index.d.ts +7 -0
  252. package/ripple/index.es.js +181 -1
  253. package/ripple/index.umd.js +1 -1
  254. package/search/index.d.ts +7 -0
  255. package/search/index.es.js +543 -1
  256. package/search/index.umd.js +1 -1
  257. package/select/index.d.ts +7 -0
  258. package/select/index.es.js +706 -1
  259. package/select/index.umd.js +1 -1
  260. package/skeleton/index.d.ts +7 -0
  261. package/skeleton/index.es.js +297 -1
  262. package/skeleton/index.umd.js +1 -1
  263. package/skeleton/style.css +1 -1
  264. package/slider/index.d.ts +7 -0
  265. package/slider/index.es.js +199 -1
  266. package/slider/index.umd.js +1 -1
  267. package/slider/style.css +1 -1
  268. package/splitter/index.d.ts +7 -0
  269. package/splitter/index.es.js +636 -1
  270. package/splitter/index.umd.js +1 -1
  271. package/statistic/index.d.ts +7 -0
  272. package/statistic/index.es.js +280 -0
  273. package/statistic/index.umd.js +1 -0
  274. package/statistic/package.json +7 -0
  275. package/statistic/style.css +1 -0
  276. package/status/index.d.ts +7 -0
  277. package/status/index.es.js +42 -1
  278. package/status/index.umd.js +1 -1
  279. package/steps-guide/index.d.ts +7 -0
  280. package/steps-guide/index.es.js +239 -1
  281. package/steps-guide/index.umd.js +1 -1
  282. package/steps-guide/style.css +1 -1
  283. package/sticky/index.d.ts +7 -0
  284. package/sticky/index.es.js +197 -1
  285. package/sticky/index.umd.js +1 -1
  286. package/style.css +1 -1
  287. package/switch/index.d.ts +7 -0
  288. package/switch/index.es.js +100 -1
  289. package/switch/index.umd.js +1 -1
  290. package/switch/style.css +1 -1
  291. package/table/index.d.ts +7 -0
  292. package/table/index.es.js +1626 -1
  293. package/table/index.umd.js +1 -1
  294. package/table/style.css +1 -1
  295. package/tabs/index.d.ts +7 -0
  296. package/tabs/index.es.js +195 -1
  297. package/tabs/index.umd.js +1 -1
  298. package/tabs/style.css +1 -1
  299. package/tag/index.d.ts +7 -0
  300. package/tag/index.es.js +131 -0
  301. package/tag/index.umd.js +1 -0
  302. package/tag/package.json +7 -0
  303. package/tag/style.css +1 -0
  304. package/tag-input/index.d.ts +7 -0
  305. package/tag-input/index.es.js +329 -1
  306. package/tag-input/index.umd.js +1 -1
  307. package/textarea/index.d.ts +7 -0
  308. package/textarea/index.es.js +132 -0
  309. package/textarea/index.umd.js +1 -0
  310. package/textarea/package.json +7 -0
  311. package/textarea/style.css +1 -0
  312. package/time-axis/index.d.ts +7 -0
  313. package/time-axis/index.es.js +299 -0
  314. package/time-axis/index.umd.js +1 -0
  315. package/time-axis/package.json +7 -0
  316. package/time-axis/style.css +1 -0
  317. package/time-picker/index.d.ts +7 -0
  318. package/time-picker/index.es.js +1053 -1
  319. package/time-picker/index.umd.js +1 -1
  320. package/time-picker/style.css +1 -1
  321. package/toast/index.d.ts +7 -0
  322. package/toast/index.es.js +2060 -1
  323. package/toast/index.umd.js +1 -1
  324. package/toast/style.css +1 -1
  325. package/tooltip/index.d.ts +7 -0
  326. package/tooltip/index.es.js +171 -1
  327. package/tooltip/index.umd.js +1 -1
  328. package/transfer/index.d.ts +7 -0
  329. package/transfer/index.es.js +1725 -1
  330. package/transfer/index.umd.js +1 -1
  331. package/transfer/style.css +1 -1
  332. package/tree/index.d.ts +7 -0
  333. package/tree/index.es.js +907 -1
  334. package/tree/index.umd.js +1 -1
  335. package/tree/style.css +1 -1
  336. package/tree-select/index.d.ts +7 -0
  337. package/tree-select/index.es.js +528 -0
  338. package/tree-select/index.umd.js +1 -0
  339. package/tree-select/package.json +7 -0
  340. package/tree-select/style.css +1 -0
  341. package/upload/index.d.ts +7 -0
  342. package/upload/index.es.js +3179 -1
  343. package/upload/index.umd.js +1 -1
  344. package/upload/style.css +1 -1
  345. package/vue-devui.es.js +27755 -1
  346. package/vue-devui.umd.js +29 -1
@@ -1 +1,368 @@
1
- var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,i=(t,n,o)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,a=(e,t)=>{for(var n in t||(t={}))l.call(t,n)&&i(e,n,t[n]);if(o)for(var n of o(t))r.call(t,n)&&i(e,n,t[n]);return e};"undefined"!=typeof require&&require;import{defineComponent as s,createVNode as c,Teleport as u,Transition as d,renderSlot as y,isVNode as v,computed as p,watch as f,onUnmounted as b,withDirectives as g,vShow as m,ref as k,reactive as w,getCurrentInstance as h,onMounted as C,nextTick as O,toRef as x,onBeforeUnmount as B,isRef as E}from"vue";const j=s({setup:(e,t)=>()=>{let e;return c(u,{to:"#d-overlay-anchor"},{default:()=>{return[c(d,{name:"devui-overlay-fade"},(n=e=y(t.slots,"default"),"function"==typeof n||"[object Object]"===Object.prototype.toString.call(n)&&!v(n)?e:{default:()=>[e]}))];var n}})}}),S={visible:{type:Boolean},"onUpdate:visible":{type:Function},backgroundBlock:{type:Boolean,default:!1},backgroundClass:{type:String,default:""},backgroundStyle:{type:[String,Object]},backdropClick:{type:Function},backdropClose:{type:Boolean,default:!0}};function Y(e){const t=p((()=>["devui-overlay-background","devui-overlay-background__color",e.backgroundClass])),n=p((()=>"devui-overlay")),o=document.body,l=o.style.overflow,r=o.style.position;return f([()=>e.visible,()=>e.backgroundBlock],(([e,t])=>{if(t){const t=o.getBoundingClientRect().y;e?(o.style.overflowY="scroll",o.style.position=e?"fixed":"",o.style.top=`${t}px`):(o.style.overflowY=l,o.style.position=r,o.style.top="",window.scrollTo(0,-t))}})),b((()=>{o.style.overflow=l})),{backgroundClass:t,overlayClass:n,handleBackdropClick:t=>{var n,o;t.preventDefault(),null==(n=e.backdropClick)||n.call(e),e.backdropClose&&(null==(o=e["onUpdate:visible"])||o.call(e,!1))},handleOverlayBubbleCancel:e=>e.cancelBubble=!0}}const L=s({name:"DFixedOverlay",props:(R=a({},S),X={overlayStyle:{type:Object,default:void 0}},t(R,n(X))),setup(e,t){const{backgroundClass:n,overlayClass:o,handleBackdropClick:l,handleOverlayBubbleCancel:r}=Y(e);return()=>c(j,null,{default:()=>[g(c("div",{class:n.value,style:e.backgroundStyle,onClick:l},[c("div",{class:o.value,style:e.overlayStyle,onClick:r},[y(t.slots,"default")])]),[[m,e.visible]])]})}});var R,X;const F=s({name:"DFlexibleOverlay",props:a({origin:{type:Object,require:!0},position:{type:Object,default:()=>({originX:"left",originY:"top",overlayX:"left",overlayY:"top"})}},S),emits:["onUpdate:visible"],setup(e,t){const n=k(null),o=w({position:"absolute"}),l=h();C((async()=>{await O();const t=n.value;if(!t)return;const r=function(e){if(e instanceof Element)return e;if(E(e))return function(e){if(e instanceof Element)return e;if(e&&"object"==typeof e&&e.$el instanceof Element)return e.$el;return null}(e.value);return e}(e.origin);if(!r)return;const i=t=>{const n=function(e,t,n){const o=function(e,t){let n,o;if("center"==t.originX)n=e.left+e.width/2;else{const o=e.left,l=e.right;n="left"==t.originX?o:l}o="center"==t.originY?e.top+e.height/2:"top"==t.originY?e.top:e.bottom;return{x:n,y:o}}(function(e){if(e instanceof Element)return e.getBoundingClientRect();const t=e.width||0,n=e.height||0;return{top:e.y,bottom:e.y+n,left:e.x,right:e.x+t,height:n,width:t}}(n),e);let l;l=t instanceof HTMLElement?t.getBoundingClientRect():t;return function(e,t,n){let o;const{width:l,height:r}=t;o="center"==n.overlayX?e.x-l/2:"left"==n.overlayX?e.x:e.x-l;let i;i="center"==n.overlayY?e.y-r/2:"top"==n.overlayY?e.y:e.y-r;return{x:o,y:i}}(o,l,e)}(e.position,t,r);o.left=`${n.x}px`,o.top=`${n.y}px`},a=()=>i(t.getBoundingClientRect());f(x(e,"visible"),((e,t,n)=>{var o;e?(o=a,window.addEventListener("scroll",o,!0),window.addEventListener("resize",o),window.addEventListener("orientationchange",o)):P(a),n((()=>{P(a)}))})),f(x(e,"position"),(()=>{a()}));const s=new ResizeObserver((e=>{i(e[0].contentRect)}));if(s.observe(t),B((()=>{s.disconnect()}),l),r instanceof Element){const e=new MutationObserver(a);e.observe(r,{attributeFilter:["style"]}),B((()=>{e.disconnect()}),l)}}),l);const{backgroundClass:r,overlayClass:i,handleBackdropClick:a,handleOverlayBubbleCancel:s}=Y(e);return()=>c(j,null,{default:()=>[g(c("div",{class:r.value,onClick:a},[c("div",{ref:n,class:i.value,style:o,onClick:s},[y(t.slots,"default")])]),[[m,e.visible]])]})}});function P(e){window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e),window.removeEventListener("orientationchange",e)}F.install=function(e){e.component(F.name,F)},L.install=function(e){e.component(L.name,L)};var $={title:"Overlay 遮罩层",category:"通用",install(e){if(e.use(L),e.use(F),!document.getElementById("d-overlay-anchor")){const e=document.createElement("div");e.setAttribute("id","d-overlay-anchor"),e.style.position="fixed",e.style.left="0",e.style.top="0",e.style.zIndex="1000",document.body.appendChild(e)}}};export{L as FixedOverlay,F as FlexibleOverlay,$ as default};
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ import { defineComponent, createVNode, Teleport, Transition, renderSlot, isVNode, computed, onMounted, watch, onUnmounted, withDirectives, vShow, ref, reactive, toRef, isRef } from "vue";
21
+ var overlay = "";
22
+ function _isSlot(s) {
23
+ return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
24
+ }
25
+ const CommonOverlay = defineComponent({
26
+ setup(props, ctx) {
27
+ return () => {
28
+ let _slot;
29
+ return createVNode(Teleport, {
30
+ "to": "#d-overlay-anchor"
31
+ }, {
32
+ default: () => [createVNode(Transition, {
33
+ "name": "devui-overlay-fade"
34
+ }, _isSlot(_slot = renderSlot(ctx.slots, "default")) ? _slot : {
35
+ default: () => [_slot]
36
+ })]
37
+ });
38
+ };
39
+ }
40
+ });
41
+ const overlayProps = {
42
+ visible: {
43
+ type: Boolean
44
+ },
45
+ backgroundBlock: {
46
+ type: Boolean,
47
+ default: false
48
+ },
49
+ backgroundClass: {
50
+ type: String,
51
+ default: ""
52
+ },
53
+ backgroundStyle: {
54
+ type: [String, Object]
55
+ },
56
+ onBackdropClick: {
57
+ type: Function
58
+ },
59
+ backdropClose: {
60
+ type: Boolean,
61
+ default: true
62
+ },
63
+ hasBackdrop: {
64
+ type: Boolean,
65
+ default: true
66
+ }
67
+ };
68
+ const overlayEmits = ["update:visible", "backdropClick"];
69
+ const fixedOverlayProps = __spreadProps(__spreadValues({}, overlayProps), {
70
+ overlayStyle: {
71
+ type: [String, Object],
72
+ default: void 0
73
+ }
74
+ });
75
+ const flexibleOverlayProps = __spreadValues({
76
+ origin: {
77
+ type: Object,
78
+ require: true
79
+ },
80
+ position: {
81
+ type: Object,
82
+ default: () => ({
83
+ originX: "left",
84
+ originY: "top",
85
+ overlayX: "left",
86
+ overlayY: "top"
87
+ })
88
+ }
89
+ }, overlayProps);
90
+ function useOverlayLogic(props, ctx) {
91
+ const backgroundClass = computed(() => {
92
+ return [
93
+ "devui-overlay-background",
94
+ props.backgroundClass,
95
+ !props.hasBackdrop ? "devui-overlay-background__disabled" : "devui-overlay-background__color"
96
+ ];
97
+ });
98
+ const overlayClass = computed(() => {
99
+ return "devui-overlay";
100
+ });
101
+ const handleBackdropClick = (event) => {
102
+ var _a;
103
+ event.preventDefault();
104
+ (_a = props.onBackdropClick) == null ? void 0 : _a.call(props);
105
+ if (props.backdropClose) {
106
+ ctx.emit("update:visible", false);
107
+ }
108
+ };
109
+ const handleOverlayBubbleCancel = (event) => event.cancelBubble = true;
110
+ onMounted(() => {
111
+ const body = document.body;
112
+ const originOverflow = body.style.overflow;
113
+ const originPosition = body.style.position;
114
+ watch([() => props.visible, () => props.backgroundBlock], ([visible, backgroundBlock]) => {
115
+ if (backgroundBlock) {
116
+ const top = body.getBoundingClientRect().y;
117
+ if (visible) {
118
+ body.style.overflowY = "scroll";
119
+ body.style.position = visible ? "fixed" : "";
120
+ body.style.top = `${top}px`;
121
+ } else {
122
+ body.style.overflowY = originOverflow;
123
+ body.style.position = originPosition;
124
+ body.style.top = "";
125
+ window.scrollTo(0, -top);
126
+ }
127
+ }
128
+ });
129
+ onUnmounted(() => {
130
+ document.body.style.overflow = originOverflow;
131
+ });
132
+ });
133
+ return {
134
+ backgroundClass,
135
+ overlayClass,
136
+ handleBackdropClick,
137
+ handleOverlayBubbleCancel
138
+ };
139
+ }
140
+ const FixedOverlay = defineComponent({
141
+ name: "DFixedOverlay",
142
+ props: fixedOverlayProps,
143
+ emits: overlayEmits,
144
+ setup(props, ctx) {
145
+ const {
146
+ backgroundClass,
147
+ overlayClass,
148
+ handleBackdropClick,
149
+ handleOverlayBubbleCancel
150
+ } = useOverlayLogic(props, ctx);
151
+ return () => createVNode(CommonOverlay, null, {
152
+ default: () => [withDirectives(createVNode("div", {
153
+ "class": backgroundClass.value,
154
+ "style": props.backgroundStyle,
155
+ "onClick": handleBackdropClick
156
+ }, [createVNode("div", {
157
+ "class": overlayClass.value,
158
+ "style": props.overlayStyle,
159
+ "onClick": handleOverlayBubbleCancel
160
+ }, [renderSlot(ctx.slots, "default")])]), [[vShow, props.visible]])]
161
+ });
162
+ }
163
+ });
164
+ function isComponent(target) {
165
+ return !!(target == null ? void 0 : target.$el);
166
+ }
167
+ function getElement(element) {
168
+ if (element instanceof Element) {
169
+ return element;
170
+ }
171
+ if (element && typeof element === "object" && element.$el instanceof Element) {
172
+ return element.$el;
173
+ }
174
+ return null;
175
+ }
176
+ const FlexibleOverlay = defineComponent({
177
+ name: "DFlexibleOverlay",
178
+ props: flexibleOverlayProps,
179
+ emits: overlayEmits,
180
+ setup(props, ctx) {
181
+ const overlayRef = ref(null);
182
+ const positionedStyle = reactive({
183
+ position: "absolute"
184
+ });
185
+ onMounted(async () => {
186
+ const handleRectChange = (position, rect, origin) => {
187
+ const point = calculatePosition(position, rect, origin);
188
+ positionedStyle.left = `${point.x}px`;
189
+ positionedStyle.top = `${point.y}px`;
190
+ };
191
+ const locationElements = computed(() => {
192
+ const overlay2 = overlayRef.value;
193
+ const origin = getOrigin(props.origin);
194
+ if (!overlay2 || !origin) {
195
+ return;
196
+ }
197
+ return {
198
+ origin,
199
+ overlay: overlay2
200
+ };
201
+ });
202
+ const visibleRef = toRef(props, "visible");
203
+ const positionRef = toRef(props, "position");
204
+ watch([locationElements, visibleRef, positionRef], async ([locationElements2, visible, position], ov, onInvalidate) => {
205
+ if (!visible || !locationElements2) {
206
+ return;
207
+ }
208
+ const {
209
+ origin,
210
+ overlay: overlay2
211
+ } = locationElements2;
212
+ handleRectChange(position, overlay2.getBoundingClientRect(), origin);
213
+ const unsubscriptions = [subscribeLayoutEvent(() => handleRectChange(position, overlay2.getBoundingClientRect(), origin)), subscribeOverlayResize(overlay2, (entries) => handleRectChange(position, entries[0].contentRect, origin)), subscribeOriginResize(origin, () => handleRectChange(position, overlay2.getBoundingClientRect(), origin))];
214
+ onInvalidate(() => {
215
+ unsubscriptions.forEach((fn) => fn());
216
+ });
217
+ });
218
+ });
219
+ const {
220
+ backgroundClass,
221
+ overlayClass,
222
+ handleBackdropClick,
223
+ handleOverlayBubbleCancel
224
+ } = useOverlayLogic(props);
225
+ return () => createVNode(CommonOverlay, null, {
226
+ default: () => [withDirectives(createVNode("div", {
227
+ "style": props.backgroundStyle,
228
+ "class": backgroundClass.value,
229
+ "onClick": handleBackdropClick
230
+ }, [createVNode("div", {
231
+ "ref": overlayRef,
232
+ "class": overlayClass.value,
233
+ "style": positionedStyle,
234
+ "onClick": handleOverlayBubbleCancel
235
+ }, [renderSlot(ctx.slots, "default")])]), [[vShow, props.visible]])]
236
+ });
237
+ }
238
+ });
239
+ function getOrigin(origin) {
240
+ if (origin instanceof Element) {
241
+ return origin;
242
+ }
243
+ if (isRef(origin)) {
244
+ return getElement(origin.value);
245
+ }
246
+ if (isComponent(origin)) {
247
+ return getElement(origin);
248
+ }
249
+ return origin;
250
+ }
251
+ function calculatePosition(position, rect, origin) {
252
+ const originRect = getOriginRect(origin);
253
+ const originPoint = getOriginRelativePoint(originRect, position);
254
+ return getOverlayPoint(originPoint, rect, position);
255
+ }
256
+ function getOriginRect(origin) {
257
+ if (origin instanceof Element) {
258
+ return origin.getBoundingClientRect();
259
+ }
260
+ const width = origin.width || 0;
261
+ const height = origin.height || 0;
262
+ return {
263
+ top: origin.y,
264
+ bottom: origin.y + height,
265
+ left: origin.x,
266
+ right: origin.x + width,
267
+ height,
268
+ width
269
+ };
270
+ }
271
+ function getOverlayPoint(originPoint, rect, position) {
272
+ let x;
273
+ const {
274
+ width,
275
+ height
276
+ } = rect;
277
+ if (position.overlayX == "center") {
278
+ x = originPoint.x - width / 2;
279
+ } else {
280
+ x = position.overlayX == "left" ? originPoint.x : originPoint.x - width;
281
+ }
282
+ let y;
283
+ if (position.overlayY == "center") {
284
+ y = originPoint.y - height / 2;
285
+ } else {
286
+ y = position.overlayY == "top" ? originPoint.y : originPoint.y - height;
287
+ }
288
+ return {
289
+ x,
290
+ y
291
+ };
292
+ }
293
+ function getOriginRelativePoint(originRect, position) {
294
+ let x;
295
+ if (position.originX == "center") {
296
+ x = originRect.left + originRect.width / 2;
297
+ } else {
298
+ const startX = originRect.left;
299
+ const endX = originRect.right;
300
+ x = position.originX == "left" ? startX : endX;
301
+ }
302
+ let y;
303
+ if (position.originY == "center") {
304
+ y = originRect.top + originRect.height / 2;
305
+ } else {
306
+ y = position.originY == "top" ? originRect.top : originRect.bottom;
307
+ }
308
+ return {
309
+ x,
310
+ y
311
+ };
312
+ }
313
+ function subscribeLayoutEvent(event) {
314
+ window.addEventListener("scroll", event, true);
315
+ window.addEventListener("resize", event);
316
+ window.addEventListener("orientationchange", event);
317
+ return () => {
318
+ window.removeEventListener("scroll", event, true);
319
+ window.removeEventListener("resize", event);
320
+ window.removeEventListener("orientationchange", event);
321
+ };
322
+ }
323
+ function subscribeOverlayResize(overlay2, callback) {
324
+ if (overlay2 instanceof Element) {
325
+ const resizeObserver = new ResizeObserver(callback);
326
+ resizeObserver.observe(overlay2);
327
+ return () => resizeObserver.disconnect();
328
+ }
329
+ return () => {
330
+ };
331
+ }
332
+ function subscribeOriginResize(origin, callback) {
333
+ if (origin instanceof Element) {
334
+ const observer = new MutationObserver(callback);
335
+ observer.observe(origin, {
336
+ attributeFilter: ["style"]
337
+ });
338
+ return () => observer.disconnect();
339
+ }
340
+ return () => {
341
+ };
342
+ }
343
+ const inBrowser = typeof window !== "undefined";
344
+ FlexibleOverlay.install = function(app) {
345
+ app.component(FlexibleOverlay.name, FlexibleOverlay);
346
+ };
347
+ FixedOverlay.install = function(app) {
348
+ app.component(FixedOverlay.name, FixedOverlay);
349
+ };
350
+ var index = {
351
+ title: "Overlay \u906E\u7F69\u5C42",
352
+ category: "\u901A\u7528",
353
+ status: "100%",
354
+ install(app) {
355
+ app.use(FixedOverlay);
356
+ app.use(FlexibleOverlay);
357
+ if (inBrowser && !document.getElementById("d-overlay-anchor")) {
358
+ const overlayAnchor = document.createElement("div");
359
+ overlayAnchor.setAttribute("id", "d-overlay-anchor");
360
+ overlayAnchor.style.position = "fixed";
361
+ overlayAnchor.style.left = "0";
362
+ overlayAnchor.style.top = "0";
363
+ overlayAnchor.style.zIndex = "1000";
364
+ document.body.appendChild(overlayAnchor);
365
+ }
366
+ }
367
+ };
368
+ export { FixedOverlay, FlexibleOverlay, index as default };
@@ -1 +1 @@
1
- var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,o)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,__spreadValues=(e,t)=>{for(var o in t||(t={}))__hasOwnProp.call(t,o)&&__defNormalProp(e,o,t[o]);if(__getOwnPropSymbols)for(var o of __getOwnPropSymbols(t))__propIsEnum.call(t,o)&&__defNormalProp(e,o,t[o]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__require="undefined"!=typeof require?require:e=>{throw new Error('Dynamic require of "'+e+'" is not supported')};!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).index={},e.Vue)}(this,(function(e,t){"use strict";const o=t.defineComponent({setup:(e,o)=>()=>{let e;return t.createVNode(t.Teleport,{to:"#d-overlay-anchor"},{default:()=>{return[t.createVNode(t.Transition,{name:"devui-overlay-fade"},(n=e=t.renderSlot(o.slots,"default"),"function"==typeof n||"[object Object]"===Object.prototype.toString.call(n)&&!t.isVNode(n)?e:{default:()=>[e]}))];var n}})}}),n={visible:{type:Boolean},"onUpdate:visible":{type:Function},backgroundBlock:{type:Boolean,default:!1},backgroundClass:{type:String,default:""},backgroundStyle:{type:[String,Object]},backdropClick:{type:Function},backdropClose:{type:Boolean,default:!0}};function r(e){const o=t.computed((()=>["devui-overlay-background","devui-overlay-background__color",e.backgroundClass])),n=t.computed((()=>"devui-overlay")),r=document.body,l=r.style.overflow,i=r.style.position;return t.watch([()=>e.visible,()=>e.backgroundBlock],(([e,t])=>{if(t){const t=r.getBoundingClientRect().y;e?(r.style.overflowY="scroll",r.style.position=e?"fixed":"",r.style.top=`${t}px`):(r.style.overflowY=l,r.style.position=i,r.style.top="",window.scrollTo(0,-t))}})),t.onUnmounted((()=>{r.style.overflow=l})),{backgroundClass:o,overlayClass:n,handleBackdropClick:t=>{var o,n;t.preventDefault(),null==(o=e.backdropClick)||o.call(e),e.backdropClose&&(null==(n=e["onUpdate:visible"])||n.call(e,!1))},handleOverlayBubbleCancel:e=>e.cancelBubble=!0}}const l=t.defineComponent({name:"DFixedOverlay",props:__spreadProps(__spreadValues({},n),{overlayStyle:{type:Object,default:void 0}}),setup(e,n){const{backgroundClass:l,overlayClass:i,handleBackdropClick:a,handleOverlayBubbleCancel:s}=r(e);return()=>t.createVNode(o,null,{default:()=>[t.withDirectives(t.createVNode("div",{class:l.value,style:e.backgroundStyle,onClick:a},[t.createVNode("div",{class:i.value,style:e.overlayStyle,onClick:s},[t.renderSlot(n.slots,"default")])]),[[t.vShow,e.visible]])]})}}),i=t.defineComponent({name:"DFlexibleOverlay",props:__spreadValues({origin:{type:Object,require:!0},position:{type:Object,default:()=>({originX:"left",originY:"top",overlayX:"left",overlayY:"top"})}},n),emits:["onUpdate:visible"],setup(e,n){const l=t.ref(null),i=t.reactive({position:"absolute"}),s=t.getCurrentInstance();t.onMounted((async()=>{await t.nextTick();const o=l.value;if(!o)return;const n=function(e){if(e instanceof Element)return e;if(t.isRef(e))return function(e){if(e instanceof Element)return e;if(e&&"object"==typeof e&&e.$el instanceof Element)return e.$el;return null}(e.value);return e}(e.origin);if(!n)return;const r=t=>{const o=function(e,t,o){const n=function(e,t){let o,n;if("center"==t.originX)o=e.left+e.width/2;else{const n=e.left,r=e.right;o="left"==t.originX?n:r}n="center"==t.originY?e.top+e.height/2:"top"==t.originY?e.top:e.bottom;return{x:o,y:n}}(function(e){if(e instanceof Element)return e.getBoundingClientRect();const t=e.width||0,o=e.height||0;return{top:e.y,bottom:e.y+o,left:e.x,right:e.x+t,height:o,width:t}}(o),e);let r;r=t instanceof HTMLElement?t.getBoundingClientRect():t;return function(e,t,o){let n;const{width:r,height:l}=t;n="center"==o.overlayX?e.x-r/2:"left"==o.overlayX?e.x:e.x-r;let i;i="center"==o.overlayY?e.y-l/2:"top"==o.overlayY?e.y:e.y-l;return{x:n,y:i}}(n,r,e)}(e.position,t,n);i.left=`${o.x}px`,i.top=`${o.y}px`},c=()=>r(o.getBoundingClientRect());t.watch(t.toRef(e,"visible"),((e,t,o)=>{var n;e?(n=c,window.addEventListener("scroll",n,!0),window.addEventListener("resize",n),window.addEventListener("orientationchange",n)):a(c),o((()=>{a(c)}))})),t.watch(t.toRef(e,"position"),(()=>{c()}));const d=new ResizeObserver((e=>{r(e[0].contentRect)}));if(d.observe(o),t.onBeforeUnmount((()=>{d.disconnect()}),s),n instanceof Element){const e=new MutationObserver(c);e.observe(n,{attributeFilter:["style"]}),t.onBeforeUnmount((()=>{e.disconnect()}),s)}}),s);const{backgroundClass:c,overlayClass:d,handleBackdropClick:u,handleOverlayBubbleCancel:p}=r(e);return()=>t.createVNode(o,null,{default:()=>[t.withDirectives(t.createVNode("div",{class:c.value,onClick:u},[t.createVNode("div",{ref:l,class:d.value,style:i,onClick:p},[t.renderSlot(n.slots,"default")])]),[[t.vShow,e.visible]])]})}});function a(e){window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e),window.removeEventListener("orientationchange",e)}i.install=function(e){e.component(i.name,i)},l.install=function(e){e.component(l.name,l)};var s={title:"Overlay 遮罩层",category:"通用",install(e){if(e.use(l),e.use(i),!document.getElementById("d-overlay-anchor")){const e=document.createElement("div");e.setAttribute("id","d-overlay-anchor"),e.style.position="fixed",e.style.left="0",e.style.top="0",e.style.zIndex="1000",document.body.appendChild(e)}}};e.FixedOverlay=l,e.FlexibleOverlay=i,e.default=s,Object.defineProperty(e,"__esModule",{value:!0}),e[Symbol.toStringTag]="Module"}));
1
+ var J=Object.defineProperty,K=Object.defineProperties;var Q=Object.getOwnPropertyDescriptors;var V=Object.getOwnPropertySymbols;var W=Object.prototype.hasOwnProperty,Z=Object.prototype.propertyIsEnumerable;var F=(l,t,a)=>t in l?J(l,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):l[t]=a,B=(l,t)=>{for(var a in t||(t={}))W.call(t,a)&&F(l,a,t[a]);if(V)for(var a of V(t))Z.call(t,a)&&F(l,a,t[a]);return l},N=(l,t)=>K(l,Q(t));(function(l,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(l=typeof globalThis!="undefined"?globalThis:l||self,t(l.index={},l.Vue))})(this,function(l,t){"use strict";var a="";function L(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const x=t.defineComponent({setup(e,n){return()=>{let o;return t.createVNode(t.Teleport,{to:"#d-overlay-anchor"},{default:()=>[t.createVNode(t.Transition,{name:"devui-overlay-fade"},L(o=t.renderSlot(n.slots,"default"))?o:{default:()=>[o]})]})}}}),E={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}},S=["update:visible","backdropClick"],X=N(B({},E),{overlayStyle:{type:[String,Object],default:void 0}}),Y=B({origin:{type:Object,require:!0},position:{type:Object,default:()=>({originX:"left",originY:"top",overlayX:"left",overlayY:"top"})}},E);function R(e,n){const o=t.computed(()=>["devui-overlay-background",e.backgroundClass,e.hasBackdrop?"devui-overlay-background__color":"devui-overlay-background__disabled"]),i=t.computed(()=>"devui-overlay"),c=r=>{var d;r.preventDefault(),(d=e.onBackdropClick)==null||d.call(e),e.backdropClose&&n.emit("update:visible",!1)},s=r=>r.cancelBubble=!0;return t.onMounted(()=>{const r=document.body,d=r.style.overflow,f=r.style.position;t.watch([()=>e.visible,()=>e.backgroundBlock],([p,w])=>{if(w){const C=r.getBoundingClientRect().y;p?(r.style.overflowY="scroll",r.style.position=p?"fixed":"",r.style.top=`${C}px`):(r.style.overflowY=d,r.style.position=f,r.style.top="",window.scrollTo(0,-C))}}),t.onUnmounted(()=>{document.body.style.overflow=d})}),{backgroundClass:o,overlayClass:i,handleBackdropClick:c,handleOverlayBubbleCancel:s}}const v=t.defineComponent({name:"DFixedOverlay",props:X,emits:S,setup(e,n){const{backgroundClass:o,overlayClass:i,handleBackdropClick:c,handleOverlayBubbleCancel:s}=R(e,n);return()=>t.createVNode(x,null,{default:()=>[t.withDirectives(t.createVNode("div",{class:o.value,style:e.backgroundStyle,onClick:c},[t.createVNode("div",{class:i.value,style:e.overlayStyle,onClick:s},[t.renderSlot(n.slots,"default")])]),[[t.vShow,e.visible]])]})}});function _(e){return!!(e==null?void 0:e.$el)}function j(e){return e instanceof Element?e:e&&typeof e=="object"&&e.$el instanceof Element?e.$el:null}const h=t.defineComponent({name:"DFlexibleOverlay",props:Y,emits:S,setup(e,n){const o=t.ref(null),i=t.reactive({position:"absolute"});t.onMounted(async()=>{const f=(u,y,b)=>{const g=T(u,y,b);i.left=`${g.x}px`,i.top=`${g.y}px`},p=t.computed(()=>{const u=o.value,y=z(e.origin);if(!(!u||!y))return{origin:y,overlay:u}}),w=t.toRef(e,"visible"),C=t.toRef(e,"position");t.watch([p,w,C],async([u,y,b],g,G)=>{if(!y||!u)return;const{origin:m,overlay:k}=u;f(b,k.getBoundingClientRect(),m);const H=[P(()=>f(b,k.getBoundingClientRect(),m)),A(k,O=>f(b,O[0].contentRect,m)),q(m,()=>f(b,k.getBoundingClientRect(),m))];G(()=>{H.forEach(O=>O())})})});const{backgroundClass:c,overlayClass:s,handleBackdropClick:r,handleOverlayBubbleCancel:d}=R(e);return()=>t.createVNode(x,null,{default:()=>[t.withDirectives(t.createVNode("div",{style:e.backgroundStyle,class:c.value,onClick:r},[t.createVNode("div",{ref:o,class:s.value,style:i,onClick:d},[t.renderSlot(n.slots,"default")])]),[[t.vShow,e.visible]])]})}});function z(e){return e instanceof Element?e:t.isRef(e)?j(e.value):_(e)?j(e):e}function T(e,n,o){const i=$(o),c=M(i,e);return D(c,n,e)}function $(e){if(e instanceof Element)return e.getBoundingClientRect();const n=e.width||0,o=e.height||0;return{top:e.y,bottom:e.y+o,left:e.x,right:e.x+n,height:o,width:n}}function D(e,n,o){let i;const{width:c,height:s}=n;o.overlayX=="center"?i=e.x-c/2:i=o.overlayX=="left"?e.x:e.x-c;let r;return o.overlayY=="center"?r=e.y-s/2:r=o.overlayY=="top"?e.y:e.y-s,{x:i,y:r}}function M(e,n){let o;if(n.originX=="center")o=e.left+e.width/2;else{const c=e.left,s=e.right;o=n.originX=="left"?c:s}let i;return n.originY=="center"?i=e.top+e.height/2:i=n.originY=="top"?e.top:e.bottom,{x:o,y:i}}function P(e){return window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),window.addEventListener("orientationchange",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e),window.removeEventListener("orientationchange",e)}}function A(e,n){if(e instanceof Element){const o=new ResizeObserver(n);return o.observe(e),()=>o.disconnect()}return()=>{}}function q(e,n){if(e instanceof Element){const o=new MutationObserver(n);return o.observe(e,{attributeFilter:["style"]}),()=>o.disconnect()}return()=>{}}const I=typeof window!="undefined";h.install=function(e){e.component(h.name,h)},v.install=function(e){e.component(v.name,v)};var U={title:"Overlay \u906E\u7F69\u5C42",category:"\u901A\u7528",status:"100%",install(e){if(e.use(v),e.use(h),I&&!document.getElementById("d-overlay-anchor")){const n=document.createElement("div");n.setAttribute("id","d-overlay-anchor"),n.style.position="fixed",n.style.left="0",n.style.top="0",n.style.zIndex="1000",document.body.appendChild(n)}}};l.FixedOverlay=v,l.FlexibleOverlay=h,l.default=U,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}@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}
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}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-devui",
3
- "version": "1.0.0-alpha.4",
3
+ "version": "1.0.0-beta.10",
4
4
  "license": "MIT",
5
5
  "description": "DevUI components based on Vite and Vue3",
6
6
  "keywords": [
@@ -18,33 +18,12 @@
18
18
  "main": "vue-devui.umd.js",
19
19
  "module": "vue-devui.es.js",
20
20
  "style": "style.css",
21
- "bin": {
22
- "devui-cli": "./devui-cli/index.js"
23
- },
24
- "scripts": {
25
- "dev": "vitepress dev docs",
26
- "build": "vitepress build docs",
27
- "serve": "vitepress serve docs",
28
- "app:dev": "vite",
29
- "app:build": "vite build",
30
- "build:lib": "yarn predev && yarn build:components && yarn generate:theme && yarn copy",
31
- "test": "jest --config jest.config.js",
32
- "ls-lint": "ls-lint",
33
- "lint": "eslint \"{src,devui}/**/*.{vue,js,ts,jsx,tsx}\"",
34
- "lint:fix": "eslint --fix \"{src,devui}/**/*.{vue,js,ts,jsx,tsx}\"",
35
- "stylelint": "stylelint --fix \"{devui,src}/**/*.{scss,css}\"",
36
- "build:components": "node ./devui-cli/index.js build",
37
- "generate:theme": "node ./devui-cli/index.js generate:theme",
38
- "copy": "cp package.json build && cp README.md build && cp devui/theme/theme.scss build/theme",
39
- "clean:cli": "npm uninstall -g devui-cli & npm uninstall -g vue-devui",
40
- "cli:create": "node ./devui-cli/index.js create -t component",
41
- "predev": "node ./devui-cli/index.js create -t vue-devui --ignore-parse-error",
42
- "prebuild": "node ./devui-cli/index.js create -t vue-devui --ignore-parse-error"
43
- },
44
21
  "dependencies": {
45
22
  "@devui-design/icons": "^1.3.0",
46
23
  "@types/lodash-es": "^4.17.4",
24
+ "async-validator": "^4.0.2",
47
25
  "lodash-es": "^4.17.20",
26
+ "mitt": "^3.0.0",
48
27
  "vue": "^3.1.1",
49
28
  "vue-router": "^4.0.3"
50
29
  },
@@ -74,12 +53,14 @@
74
53
  "commander": "^8.1.0",
75
54
  "esbuild-register": "^2.6.0",
76
55
  "eslint": "^7.28.0",
56
+ "eslint-plugin-import": "^2.24.2",
77
57
  "eslint-plugin-vue": "^7.11.1",
78
- "husky": "^4.3.7",
58
+ "husky": "^7.0.4",
79
59
  "inquirer": "^8.1.2",
80
60
  "jest": "^27.0.4",
81
61
  "lint-staged": "^11.0.0",
82
62
  "ora": "^5.4.1",
63
+ "patch-vue-directive-ssr": "^0.0.1",
83
64
  "sass": "^1.32.2",
84
65
  "shelljs": "^0.8.4",
85
66
  "stylelint": "^13.13.1",
@@ -90,17 +71,11 @@
90
71
  "vite": "^2.4.4",
91
72
  "vite-plugin-md": "^0.6.0",
92
73
  "vite-svg-loader": "^2.2.0",
93
- "vitepress": "^0.15.6",
94
- "vitepress-theme-demoblock": "1.0.7",
74
+ "vitepress": "0.20.1",
75
+ "vitepress-theme-demoblock": "1.3.2",
95
76
  "vue-tsc": "^0.2.2",
96
77
  "yarn": "^1.22.11"
97
78
  },
98
- "husky": {
99
- "hooks": {
100
- "pre-commit": "ls-lint && lint-staged",
101
- "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
102
- }
103
- },
104
79
  "lint-staged": {
105
80
  "{src,devui}/**/*.{js,ts,jsx,tsx,vue}": "eslint --fix",
106
81
  "{src,devui}/**/*.{scss,css}": "stylelint --fix"
@@ -0,0 +1,7 @@
1
+ import { App } from 'vue';
2
+ declare function install(app: App): void
3
+ declare const _default: {
4
+ install: typeof install;
5
+ version: string;
6
+ };
7
+ export default _default;