vue-devui 1.0.0-beta.2 → 1.0.0-beta.20220808

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 (455) hide show
  1. package/README.md +163 -172
  2. package/alert/index.d.ts +7 -0
  3. package/alert/index.es.js +79 -51
  4. package/alert/index.umd.js +1 -1
  5. package/alert/style.css +1 -1
  6. package/auto-complete/index.d.ts +7 -0
  7. package/auto-complete/index.es.js +9053 -0
  8. package/auto-complete/index.umd.js +40 -0
  9. package/auto-complete/package.json +7 -0
  10. package/auto-complete/style.css +1 -0
  11. package/avatar/index.d.ts +7 -0
  12. package/avatar/index.es.js +154 -147
  13. package/avatar/index.umd.js +1 -1
  14. package/avatar/style.css +1 -1
  15. package/badge/index.d.ts +7 -0
  16. package/badge/index.es.js +46 -21
  17. package/badge/index.umd.js +1 -1
  18. package/badge/style.css +1 -1
  19. package/button/index.d.ts +7 -0
  20. package/button/index.es.js +5921 -146
  21. package/button/index.umd.js +27 -1
  22. package/button/style.css +1 -1
  23. package/card/index.d.ts +7 -0
  24. package/card/index.es.js +64 -36
  25. package/card/index.umd.js +1 -1
  26. package/card/style.css +1 -1
  27. package/checkbox/index.d.ts +7 -0
  28. package/checkbox/index.es.js +8122 -255
  29. package/checkbox/index.umd.js +38 -1
  30. package/checkbox/style.css +1 -1
  31. package/collapse/index.d.ts +7 -0
  32. package/collapse/index.es.js +195 -0
  33. package/collapse/index.umd.js +1 -0
  34. package/{cascader → collapse}/package.json +1 -1
  35. package/collapse/style.css +1 -0
  36. package/countdown/index.d.ts +7 -0
  37. package/countdown/index.es.js +217 -0
  38. package/countdown/index.umd.js +1 -0
  39. package/{accordion → countdown}/package.json +1 -1
  40. package/countdown/style.css +1 -0
  41. package/date-picker-pro/index.d.ts +7 -0
  42. package/date-picker-pro/index.es.js +12035 -0
  43. package/date-picker-pro/index.umd.js +38 -0
  44. package/date-picker-pro/package.json +7 -0
  45. package/date-picker-pro/style.css +1 -0
  46. package/drawer/index.d.ts +7 -0
  47. package/drawer/index.es.js +205 -154
  48. package/drawer/index.umd.js +1 -1
  49. package/drawer/style.css +1 -1
  50. package/dropdown/index.d.ts +7 -0
  51. package/dropdown/index.es.js +736 -0
  52. package/dropdown/index.umd.js +1 -0
  53. package/{carousel → dropdown}/package.json +1 -1
  54. package/dropdown/style.css +1 -0
  55. package/editable-select/index.d.ts +7 -0
  56. package/editable-select/index.es.js +908 -461
  57. package/editable-select/index.umd.js +1 -1
  58. package/editable-select/style.css +1 -1
  59. package/form/index.d.ts +7 -0
  60. package/form/index.es.js +2439 -1995
  61. package/form/index.umd.js +29 -18
  62. package/form/style.css +1 -1
  63. package/fullscreen/index.d.ts +7 -0
  64. package/fullscreen/index.es.js +138 -125
  65. package/fullscreen/index.umd.js +1 -1
  66. package/fullscreen/style.css +1 -1
  67. package/grid/index.d.ts +7 -0
  68. package/grid/index.es.js +271 -0
  69. package/grid/index.umd.js +1 -0
  70. package/{toast → grid}/package.json +1 -1
  71. package/grid/style.css +1 -0
  72. package/icon/index.d.ts +7 -0
  73. package/icon/index.es.js +200 -56
  74. package/icon/index.umd.js +1 -1
  75. package/icon/style.css +1 -0
  76. package/image-preview/index.d.ts +7 -0
  77. package/image-preview/index.es.js +154 -62
  78. package/image-preview/index.umd.js +1 -1
  79. package/image-preview/style.css +1 -1
  80. package/index.d.ts +7 -0
  81. package/input/index.d.ts +7 -0
  82. package/input/index.es.js +8269 -145
  83. package/input/index.umd.js +38 -1
  84. package/input/style.css +1 -1
  85. package/input-number/index.d.ts +7 -0
  86. package/input-number/index.es.js +260 -191
  87. package/input-number/index.umd.js +1 -1
  88. package/input-number/style.css +1 -1
  89. package/layout/index.d.ts +7 -0
  90. package/layout/index.es.js +41 -26
  91. package/layout/index.umd.js +1 -1
  92. package/layout/style.css +1 -1
  93. package/loading/index.d.ts +7 -0
  94. package/loading/index.es.js +89 -73
  95. package/loading/index.umd.js +1 -1
  96. package/loading/style.css +1 -1
  97. package/mention/index.d.ts +7 -0
  98. package/mention/index.es.js +8326 -0
  99. package/mention/index.umd.js +47 -0
  100. package/mention/package.json +7 -0
  101. package/mention/style.css +1 -0
  102. package/menu/index.d.ts +7 -0
  103. package/menu/index.es.js +891 -0
  104. package/menu/index.umd.js +1 -0
  105. package/{anchor → menu}/package.json +1 -1
  106. package/menu/style.css +1 -0
  107. package/message/index.d.ts +7 -0
  108. package/message/index.es.js +533 -0
  109. package/message/index.umd.js +1 -0
  110. package/message/package.json +7 -0
  111. package/message/style.css +1 -0
  112. package/modal/index.d.ts +7 -0
  113. package/modal/index.es.js +611 -877
  114. package/modal/index.umd.js +1 -1
  115. package/modal/style.css +1 -1
  116. package/notification/index.d.ts +7 -0
  117. package/notification/index.es.js +528 -0
  118. package/notification/index.umd.js +1 -0
  119. package/notification/package.json +7 -0
  120. package/notification/style.css +1 -0
  121. package/nuxt/components/Alert.js +3 -0
  122. package/nuxt/components/Aside.js +3 -0
  123. package/nuxt/components/AutoComplete.js +3 -0
  124. package/nuxt/components/Avatar.js +3 -0
  125. package/nuxt/components/Badge.js +3 -0
  126. package/nuxt/components/Button.js +3 -0
  127. package/nuxt/components/ButtonGroup.js +3 -0
  128. package/nuxt/components/Card.js +3 -0
  129. package/nuxt/components/Checkbox.js +3 -0
  130. package/nuxt/components/CheckboxButton.js +3 -0
  131. package/nuxt/components/CheckboxGroup.js +3 -0
  132. package/nuxt/components/Col.js +3 -0
  133. package/nuxt/components/Collapse.js +3 -0
  134. package/nuxt/components/CollapseItem.js +3 -0
  135. package/nuxt/components/Column.js +3 -0
  136. package/nuxt/components/Content.js +3 -0
  137. package/nuxt/components/Countdown.js +3 -0
  138. package/nuxt/components/DRangeDatePickerPro.js +3 -0
  139. package/nuxt/components/DatePickerPro.js +3 -0
  140. package/nuxt/components/Drawer.js +3 -0
  141. package/nuxt/components/DrawerService.js +3 -0
  142. package/nuxt/components/Dropdown.js +3 -0
  143. package/nuxt/components/DropdownMenu.js +3 -0
  144. package/nuxt/components/DropdownPropsKey.js +3 -0
  145. package/nuxt/components/EditableSelect.js +3 -0
  146. package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
  147. package/nuxt/components/FORM_TOKEN.js +3 -0
  148. package/nuxt/components/FixedOverlay.js +3 -0
  149. package/nuxt/components/FlexibleOverlay.js +3 -0
  150. package/nuxt/components/Footer.js +3 -0
  151. package/nuxt/components/Form.js +3 -0
  152. package/nuxt/components/FormItem.js +3 -0
  153. package/nuxt/components/FormOperation.js +3 -0
  154. package/nuxt/components/Fullscreen.js +3 -0
  155. package/nuxt/components/Header.js +3 -0
  156. package/nuxt/components/IFileOptions.js +3 -0
  157. package/nuxt/components/IUploadOptions.js +3 -0
  158. package/nuxt/components/Icon.js +3 -0
  159. package/nuxt/components/IconGroup.js +3 -0
  160. package/nuxt/components/ImagePreviewService.js +3 -0
  161. package/nuxt/components/Input.js +3 -0
  162. package/nuxt/components/InputNumber.js +3 -0
  163. package/nuxt/components/LABEL_DATA.js +3 -0
  164. package/nuxt/components/Layout.js +3 -0
  165. package/nuxt/components/Loading.js +3 -0
  166. package/nuxt/components/LoadingOptions.js +3 -0
  167. package/nuxt/components/LoadingService.js +3 -0
  168. package/nuxt/components/Mention.js +3 -0
  169. package/nuxt/components/Menu.js +3 -0
  170. package/nuxt/components/MenuItem.js +3 -0
  171. package/nuxt/components/Message.js +3 -0
  172. package/nuxt/components/Modal.js +3 -0
  173. package/nuxt/components/Notification.js +3 -0
  174. package/nuxt/components/NotificationService.js +3 -0
  175. package/nuxt/components/Option.js +3 -0
  176. package/nuxt/components/OptionGroup.js +3 -0
  177. package/nuxt/components/Pagination.js +3 -0
  178. package/nuxt/components/Panel.js +3 -0
  179. package/nuxt/components/PanelBody.js +3 -0
  180. package/nuxt/components/PanelFooter.js +3 -0
  181. package/nuxt/components/PanelHeader.js +3 -0
  182. package/nuxt/components/Popover.js +3 -0
  183. package/nuxt/components/Progress.js +3 -0
  184. package/nuxt/components/Radio.js +3 -0
  185. package/nuxt/components/RadioButton.js +3 -0
  186. package/nuxt/components/RadioGroup.js +3 -0
  187. package/nuxt/components/Rate.js +3 -0
  188. package/nuxt/components/Result.js +3 -0
  189. package/nuxt/components/Row.js +3 -0
  190. package/nuxt/components/Search.js +3 -0
  191. package/nuxt/components/Select.js +3 -0
  192. package/nuxt/components/Skeleton.js +3 -0
  193. package/nuxt/components/SkeletonItem.js +3 -0
  194. package/nuxt/components/Slider.js +3 -0
  195. package/nuxt/components/Splitter.js +3 -0
  196. package/nuxt/components/Statistic.js +3 -0
  197. package/nuxt/components/Status.js +3 -0
  198. package/nuxt/components/Step.js +3 -0
  199. package/nuxt/components/Steps.js +3 -0
  200. package/nuxt/components/SubMenu.js +3 -0
  201. package/nuxt/components/Switch.js +3 -0
  202. package/nuxt/components/TABLE_TOKEN.js +3 -0
  203. package/nuxt/components/Tab.js +3 -0
  204. package/nuxt/components/Table.js +3 -0
  205. package/nuxt/components/Tabs.js +3 -0
  206. package/nuxt/components/Tag.js +3 -0
  207. package/nuxt/components/Textarea.js +3 -0
  208. package/nuxt/components/TimePicker.js +3 -0
  209. package/nuxt/components/TimeSelect.js +3 -0
  210. package/nuxt/components/Timeline.js +3 -0
  211. package/nuxt/components/TimelineItem.js +3 -0
  212. package/nuxt/components/Tooltip.js +3 -0
  213. package/nuxt/components/Tree.js +3 -0
  214. package/nuxt/components/Upload.js +3 -0
  215. package/nuxt/components/UploadStatus.js +3 -0
  216. package/nuxt/components/alertProps.js +3 -0
  217. package/nuxt/components/animationInjectionKey.js +3 -0
  218. package/nuxt/components/autoCompleteProps.js +3 -0
  219. package/nuxt/components/avatarProps.js +3 -0
  220. package/nuxt/components/badgeProps.js +3 -0
  221. package/nuxt/components/buttonGroupInjectionKey.js +3 -0
  222. package/nuxt/components/buttonGroupProps.js +3 -0
  223. package/nuxt/components/buttonProps.js +3 -0
  224. package/nuxt/components/cardProps.js +3 -0
  225. package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
  226. package/nuxt/components/checkboxGroupProps.js +3 -0
  227. package/nuxt/components/checkboxProps.js +3 -0
  228. package/nuxt/components/colProps.js +3 -0
  229. package/nuxt/components/colPropsBaseClass.js +3 -0
  230. package/nuxt/components/colPropsBaseStyle.js +3 -0
  231. package/nuxt/components/collapseItemProps.js +3 -0
  232. package/nuxt/components/collapseProps.js +3 -0
  233. package/nuxt/components/countdownProps.js +3 -0
  234. package/nuxt/components/datePickerProCommonProps.js +3 -0
  235. package/nuxt/components/datePickerProPanelProps.js +3 -0
  236. package/nuxt/components/datePickerProProps.js +3 -0
  237. package/nuxt/components/dropdownMenuProps.js +3 -0
  238. package/nuxt/components/editableSelectProps.js +3 -0
  239. package/nuxt/components/fixedOverlayProps.js +3 -0
  240. package/nuxt/components/flexibleOverlayProps.js +3 -0
  241. package/nuxt/components/formItemProps.js +3 -0
  242. package/nuxt/components/formProps.js +3 -0
  243. package/nuxt/components/fullscreenProps.js +3 -0
  244. package/nuxt/components/iconProps.js +3 -0
  245. package/nuxt/components/imagePreviewProps.js +3 -0
  246. package/nuxt/components/inputProps.js +3 -0
  247. package/nuxt/components/loadingProps.js +3 -0
  248. package/nuxt/components/mentionProps.js +3 -0
  249. package/nuxt/components/messageProps.js +3 -0
  250. package/nuxt/components/modalProps.js +3 -0
  251. package/nuxt/components/notificationProps.js +3 -0
  252. package/nuxt/components/paginationProps.js +3 -0
  253. package/nuxt/components/panelProps.js +3 -0
  254. package/nuxt/components/popoverProps.js +3 -0
  255. package/nuxt/components/progressProps.js +3 -0
  256. package/nuxt/components/rateProps.js +3 -0
  257. package/nuxt/components/resultProps.js +3 -0
  258. package/nuxt/components/roundInjectionKey.js +3 -0
  259. package/nuxt/components/rowProps.js +3 -0
  260. package/nuxt/components/screenSizes.js +3 -0
  261. package/nuxt/components/searchProps.js +3 -0
  262. package/nuxt/components/skeletonItemProps.js +3 -0
  263. package/nuxt/components/skeletonProps.js +3 -0
  264. package/nuxt/components/sliderProps.js +3 -0
  265. package/nuxt/components/splitterProps.js +3 -0
  266. package/nuxt/components/statisticProps.js +3 -0
  267. package/nuxt/components/stepProps.js +3 -0
  268. package/nuxt/components/stepsProps.js +3 -0
  269. package/nuxt/components/svgIconProps.js +3 -0
  270. package/nuxt/components/switchProps.js +3 -0
  271. package/nuxt/components/tableProps.js +3 -0
  272. package/nuxt/components/tabsProps.js +3 -0
  273. package/nuxt/components/tagProps.js +3 -0
  274. package/nuxt/components/textareaProps.js +3 -0
  275. package/nuxt/components/timeAxisProps.js +3 -0
  276. package/nuxt/components/timerPickerPanelProps.js +3 -0
  277. package/nuxt/components/tooltipProps.js +3 -0
  278. package/nuxt/components/treeNodeProps.js +3 -0
  279. package/nuxt/components/treeProps.js +3 -0
  280. package/nuxt/components/uploadProps.js +3 -0
  281. package/nuxt/index.js +13 -0
  282. package/overlay/index.d.ts +7 -0
  283. package/overlay/index.es.js +245 -303
  284. package/overlay/index.umd.js +1 -1
  285. package/overlay/style.css +1 -1
  286. package/package.json +16 -84
  287. package/pagination/index.d.ts +7 -0
  288. package/pagination/index.es.js +333 -155
  289. package/pagination/index.umd.js +1 -1
  290. package/pagination/style.css +1 -1
  291. package/panel/index.d.ts +7 -0
  292. package/panel/index.es.js +48 -35
  293. package/panel/index.umd.js +1 -1
  294. package/panel/style.css +1 -1
  295. package/popover/index.d.ts +7 -0
  296. package/popover/index.es.js +6035 -204
  297. package/popover/index.umd.js +27 -1
  298. package/popover/style.css +1 -1
  299. package/progress/index.d.ts +7 -0
  300. package/progress/index.es.js +111 -57
  301. package/progress/index.umd.js +3 -3
  302. package/progress/style.css +1 -1
  303. package/radio/index.d.ts +7 -0
  304. package/radio/index.es.js +8015 -182
  305. package/radio/index.umd.js +38 -1
  306. package/radio/style.css +1 -1
  307. package/rate/index.d.ts +7 -0
  308. package/rate/index.es.js +78 -56
  309. package/rate/index.umd.js +1 -1
  310. package/rate/style.css +1 -1
  311. package/result/index.d.ts +7 -0
  312. package/result/index.es.js +248 -0
  313. package/result/index.umd.js +1 -0
  314. package/{sticky → result}/package.json +1 -1
  315. package/result/style.css +1 -0
  316. package/ripple/index.d.ts +7 -0
  317. package/ripple/index.es.js +56 -61
  318. package/ripple/index.umd.js +1 -1
  319. package/search/index.d.ts +7 -0
  320. package/search/index.es.js +8381 -406
  321. package/search/index.umd.js +38 -1
  322. package/search/style.css +1 -1
  323. package/select/index.d.ts +7 -0
  324. package/select/index.es.js +9331 -576
  325. package/select/index.umd.js +38 -1
  326. package/select/style.css +1 -1
  327. package/skeleton/index.d.ts +7 -0
  328. package/skeleton/index.es.js +115 -145
  329. package/skeleton/index.umd.js +1 -1
  330. package/skeleton/style.css +1 -1
  331. package/slider/index.d.ts +7 -0
  332. package/slider/index.es.js +148 -142
  333. package/slider/index.umd.js +1 -1
  334. package/slider/style.css +1 -1
  335. package/splitter/index.d.ts +7 -0
  336. package/splitter/index.es.js +6308 -181
  337. package/splitter/index.umd.js +27 -1
  338. package/splitter/style.css +1 -1
  339. package/statistic/index.d.ts +7 -0
  340. package/statistic/index.es.js +253 -0
  341. package/statistic/index.umd.js +1 -0
  342. package/statistic/package.json +7 -0
  343. package/statistic/style.css +1 -0
  344. package/status/index.d.ts +7 -0
  345. package/status/index.es.js +29 -8
  346. package/status/index.umd.js +1 -1
  347. package/status/style.css +1 -1
  348. package/steps/index.d.ts +7 -0
  349. package/steps/index.es.js +386 -0
  350. package/steps/index.umd.js +1 -0
  351. package/steps/package.json +7 -0
  352. package/steps/style.css +1 -0
  353. package/style.css +1 -1
  354. package/switch/index.d.ts +7 -0
  355. package/switch/index.es.js +7819 -65
  356. package/switch/index.umd.js +38 -1
  357. package/switch/style.css +1 -1
  358. package/table/index.d.ts +7 -0
  359. package/table/index.es.js +11435 -204
  360. package/table/index.umd.js +38 -1
  361. package/table/style.css +1 -1
  362. package/tabs/index.d.ts +7 -0
  363. package/tabs/index.es.js +356 -143
  364. package/tabs/index.umd.js +1 -1
  365. package/tabs/style.css +1 -1
  366. package/tag/index.d.ts +7 -0
  367. package/tag/index.es.js +156 -0
  368. package/tag/index.umd.js +1 -0
  369. package/tag/package.json +7 -0
  370. package/tag/style.css +1 -0
  371. package/textarea/index.d.ts +7 -0
  372. package/textarea/index.es.js +7989 -0
  373. package/textarea/index.umd.js +46 -0
  374. package/textarea/package.json +7 -0
  375. package/textarea/style.css +1 -0
  376. package/{theme → theme/theme.scss} +0 -0
  377. package/time-picker/index.d.ts +7 -0
  378. package/time-picker/index.es.js +9126 -597
  379. package/time-picker/index.umd.js +38 -1
  380. package/time-picker/style.css +1 -1
  381. package/time-select/index.d.ts +7 -0
  382. package/time-select/index.es.js +9606 -0
  383. package/time-select/index.umd.js +38 -0
  384. package/{breadcrumb → time-select}/package.json +1 -1
  385. package/time-select/style.css +1 -0
  386. package/timeline/index.d.ts +7 -0
  387. package/timeline/index.es.js +427 -0
  388. package/timeline/index.umd.js +1 -0
  389. package/timeline/package.json +7 -0
  390. package/timeline/style.css +1 -0
  391. package/tooltip/index.d.ts +7 -0
  392. package/tooltip/index.es.js +5870 -141
  393. package/tooltip/index.umd.js +27 -1
  394. package/tooltip/style.css +1 -1
  395. package/tree/index.d.ts +7 -0
  396. package/tree/index.es.js +11504 -692
  397. package/tree/index.umd.js +38 -1
  398. package/tree/style.css +1 -1
  399. package/upload/index.d.ts +7 -0
  400. package/upload/index.es.js +968 -2748
  401. package/upload/index.umd.js +1 -1
  402. package/upload/style.css +1 -1
  403. package/vue-devui.es.js +22816 -16568
  404. package/vue-devui.umd.js +42 -20
  405. package/accordion/index.es.js +0 -190
  406. package/accordion/index.umd.js +0 -1
  407. package/accordion/style.css +0 -1
  408. package/anchor/index.es.js +0 -263
  409. package/anchor/index.umd.js +0 -1
  410. package/anchor/style.css +0 -1
  411. package/breadcrumb/index.es.js +0 -127
  412. package/breadcrumb/index.umd.js +0 -1
  413. package/breadcrumb/style.css +0 -1
  414. package/carousel/index.es.js +0 -328
  415. package/carousel/index.umd.js +0 -1
  416. package/carousel/style.css +0 -1
  417. package/cascader/index.es.js +0 -187
  418. package/cascader/index.umd.js +0 -1
  419. package/cascader/style.css +0 -1
  420. package/date-picker/index.es.js +0 -1171
  421. package/date-picker/index.umd.js +0 -1
  422. package/date-picker/package.json +0 -7
  423. package/date-picker/style.css +0 -1
  424. package/nav-sprite/index.es.js +0 -742
  425. package/nav-sprite/index.umd.js +0 -1
  426. package/nav-sprite/package.json +0 -7
  427. package/quadrant-diagram/index.es.js +0 -489
  428. package/quadrant-diagram/index.umd.js +0 -1
  429. package/quadrant-diagram/package.json +0 -7
  430. package/quadrant-diagram/style.css +0 -1
  431. package/steps-guide/index.es.js +0 -211
  432. package/steps-guide/index.umd.js +0 -1
  433. package/steps-guide/package.json +0 -7
  434. package/steps-guide/style.css +0 -1
  435. package/sticky/index.es.js +0 -197
  436. package/sticky/index.umd.js +0 -1
  437. package/tag-input/index.es.js +0 -341
  438. package/tag-input/index.umd.js +0 -1
  439. package/tag-input/package.json +0 -7
  440. package/tag-input/style.css +0 -1
  441. package/time-axis/index.es.js +0 -79
  442. package/time-axis/index.umd.js +0 -1
  443. package/time-axis/package.json +0 -7
  444. package/time-axis/style.css +0 -1
  445. package/toast/index.es.js +0 -2059
  446. package/toast/index.umd.js +0 -1
  447. package/toast/style.css +0 -1
  448. package/transfer/index.es.js +0 -1446
  449. package/transfer/index.umd.js +0 -1
  450. package/transfer/package.json +0 -7
  451. package/transfer/style.css +0 -1
  452. package/tree-select/index.es.js +0 -203
  453. package/tree-select/index.umd.js +0 -1
  454. package/tree-select/package.json +0 -7
  455. package/tree-select/style.css +0 -1
@@ -1,342 +1,284 @@
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, getCurrentInstance, nextTick, toRef, onBeforeUnmount, 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
- "onUpdate:visible": {
46
- type: Function
47
- },
48
- backgroundBlock: {
1
+ import { watch, onUnmounted, defineComponent, toRefs, createVNode, Transition, mergeProps, ref, nextTick, unref } from "vue";
2
+ import { offset, autoPlacement, arrow, shift, computePosition } from "@floating-ui/dom";
3
+ const fixedOverlayProps = {
4
+ modelValue: {
49
5
  type: Boolean,
50
6
  default: false
51
7
  },
52
- backgroundClass: {
53
- type: String,
54
- default: ""
55
- },
56
- backgroundStyle: {
57
- type: [String, Object]
58
- },
59
- backdropClick: {
60
- type: Function
8
+ lockScroll: {
9
+ type: Boolean,
10
+ default: true
61
11
  },
62
- backdropClose: {
12
+ closeOnClickOverlay: {
63
13
  type: Boolean,
64
14
  default: true
65
15
  }
66
16
  };
67
- function useOverlayLogic(props) {
68
- const backgroundClass = computed(() => {
69
- return ["devui-overlay-background", "devui-overlay-background__color", props.backgroundClass];
70
- });
71
- const overlayClass = computed(() => {
72
- return "devui-overlay";
73
- });
74
- const handleBackdropClick = (event) => {
75
- var _a, _b;
17
+ function lockScroll() {
18
+ if (document.documentElement.scrollHeight > document.documentElement.clientHeight) {
19
+ const scrollTop = document.documentElement.scrollTop;
20
+ const style = document.documentElement.getAttribute("style");
21
+ document.documentElement.style.position = "fixed";
22
+ document.documentElement.style.top = `-${scrollTop}px`;
23
+ document.documentElement.style.width = document.documentElement.style.width || "100%";
24
+ document.documentElement.style.overflowY = "scroll";
25
+ return () => {
26
+ if (style) {
27
+ document.documentElement.setAttribute("style", style);
28
+ } else {
29
+ document.documentElement.removeAttribute("style");
30
+ }
31
+ document.documentElement.scrollTop = scrollTop;
32
+ };
33
+ }
34
+ return;
35
+ }
36
+ function useFixedOverlay(props, ctx) {
37
+ let lockScrollCb;
38
+ const onClick = (event) => {
76
39
  event.preventDefault();
77
- (_a = props.backdropClick) == null ? void 0 : _a.call(props);
78
- if (props.backdropClose) {
79
- (_b = props["onUpdate:visible"]) == null ? void 0 : _b.call(props, false);
40
+ ctx.emit("click", event);
41
+ if (props.closeOnClickOverlay) {
42
+ ctx.emit("update:modelValue", false);
80
43
  }
81
44
  };
82
- const handleOverlayBubbleCancel = (event) => event.cancelBubble = true;
83
- onMounted(() => {
84
- const body = document.body;
85
- const originOverflow = body.style.overflow;
86
- const originPosition = body.style.position;
87
- watch([() => props.visible, () => props.backgroundBlock], ([visible, backgroundBlock]) => {
88
- if (backgroundBlock) {
89
- const top = body.getBoundingClientRect().y;
90
- if (visible) {
91
- body.style.overflowY = "scroll";
92
- body.style.position = visible ? "fixed" : "";
93
- body.style.top = `${top}px`;
94
- } else {
95
- body.style.overflowY = originOverflow;
96
- body.style.position = originPosition;
97
- body.style.top = "";
98
- window.scrollTo(0, -top);
99
- }
100
- }
101
- });
102
- onUnmounted(() => {
103
- document.body.style.overflow = originOverflow;
104
- });
45
+ const removeBodyAdditions = () => {
46
+ lockScrollCb == null ? void 0 : lockScrollCb();
47
+ };
48
+ watch(() => props.modelValue, (val) => {
49
+ if (val) {
50
+ props.lockScroll && (lockScrollCb = lockScroll());
51
+ } else {
52
+ removeBodyAdditions();
53
+ }
105
54
  });
55
+ onUnmounted(removeBodyAdditions);
56
+ return { onClick };
57
+ }
58
+ function createBem(namespace, element, modifier) {
59
+ let cls = namespace;
60
+ if (element) {
61
+ cls += `__${element}`;
62
+ }
63
+ if (modifier) {
64
+ cls += `--${modifier}`;
65
+ }
66
+ return cls;
67
+ }
68
+ function useNamespace(block, needDot = false) {
69
+ const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
70
+ const b = () => createBem(namespace);
71
+ const e = (element) => element ? createBem(namespace, element) : "";
72
+ const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
73
+ const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
106
74
  return {
107
- backgroundClass,
108
- overlayClass,
109
- handleBackdropClick,
110
- handleOverlayBubbleCancel
75
+ b,
76
+ e,
77
+ m,
78
+ em
111
79
  };
112
80
  }
81
+ var fixedOverlay = "";
113
82
  const FixedOverlay = defineComponent({
114
83
  name: "DFixedOverlay",
115
- props: __spreadProps(__spreadValues({}, overlayProps), {
116
- overlayStyle: {
117
- type: Object,
118
- default: void 0
119
- }
120
- }),
84
+ inheritAttrs: false,
85
+ props: fixedOverlayProps,
86
+ emits: ["update:modelValue", "click"],
121
87
  setup(props, ctx) {
122
88
  const {
123
- backgroundClass,
124
- overlayClass,
125
- handleBackdropClick,
126
- handleOverlayBubbleCancel
127
- } = useOverlayLogic(props);
128
- return () => createVNode(CommonOverlay, null, {
129
- default: () => [withDirectives(createVNode("div", {
130
- "class": backgroundClass.value,
131
- "style": props.backgroundStyle,
132
- "onClick": handleBackdropClick
133
- }, [createVNode("div", {
134
- "class": overlayClass.value,
135
- "style": props.overlayStyle,
136
- "onClick": handleOverlayBubbleCancel
137
- }, [renderSlot(ctx.slots, "default")])]), [[vShow, props.visible]])]
138
- });
139
- }
140
- });
141
- const FlexibleOverlay = defineComponent({
142
- name: "DFlexibleOverlay",
143
- props: __spreadValues({
144
- origin: {
145
- type: Object,
146
- require: true
147
- },
148
- position: {
149
- type: Object,
150
- default: () => ({
151
- originX: "left",
152
- originY: "top",
153
- overlayX: "left",
154
- overlayY: "top"
155
- })
156
- }
157
- }, overlayProps),
158
- emits: ["onUpdate:visible"],
159
- setup(props, ctx) {
160
- const overlayRef = ref(null);
161
- const positionedStyle = reactive({
162
- position: "absolute"
163
- });
164
- const instance = getCurrentInstance();
165
- onMounted(async () => {
166
- await nextTick();
167
- const overlay2 = overlayRef.value;
168
- if (!overlay2) {
169
- return;
170
- }
171
- const origin = getOrigin(props.origin);
172
- if (!origin) {
173
- return;
174
- }
175
- const handleRectChange = (rect) => {
176
- const point = calculatePosition(props.position, rect, origin);
177
- positionedStyle.left = `${point.x}px`;
178
- positionedStyle.top = `${point.y}px`;
179
- };
180
- const handleChange = () => handleRectChange(overlay2.getBoundingClientRect());
181
- watch(toRef(props, "visible"), (visible, ov, onInvalidate) => {
182
- if (visible) {
183
- subscribeLayoutEvent(handleChange);
184
- } else {
185
- unsbscribeLayoutEvent(handleChange);
186
- }
187
- onInvalidate(() => {
188
- unsbscribeLayoutEvent(handleChange);
189
- });
190
- });
191
- watch(toRef(props, "position"), () => {
192
- handleChange();
193
- });
194
- const resizeObserver = new ResizeObserver((entries) => {
195
- handleRectChange(entries[0].contentRect);
196
- });
197
- resizeObserver.observe(overlay2);
198
- onBeforeUnmount(() => {
199
- resizeObserver.disconnect();
200
- }, instance);
201
- if (origin instanceof Element) {
202
- const observer = new MutationObserver(handleChange);
203
- observer.observe(origin, {
204
- attributeFilter: ["style"]
205
- });
206
- onBeforeUnmount(() => {
207
- observer.disconnect();
208
- }, instance);
209
- }
210
- }, instance);
89
+ modelValue
90
+ } = toRefs(props);
91
+ const ns = useNamespace("fixed-overlay");
211
92
  const {
212
- backgroundClass,
213
- overlayClass,
214
- handleBackdropClick,
215
- handleOverlayBubbleCancel
216
- } = useOverlayLogic(props);
217
- return () => createVNode(CommonOverlay, null, {
218
- default: () => [withDirectives(createVNode("div", {
219
- "class": backgroundClass.value,
220
- "onClick": handleBackdropClick
221
- }, [createVNode("div", {
222
- "ref": overlayRef,
223
- "class": overlayClass.value,
224
- "style": positionedStyle,
225
- "onClick": handleOverlayBubbleCancel
226
- }, [renderSlot(ctx.slots, "default")])]), [[vShow, props.visible]])]
93
+ onClick
94
+ } = useFixedOverlay(props, ctx);
95
+ return () => createVNode(Transition, {
96
+ "name": ns.m("fade")
97
+ }, {
98
+ default: () => {
99
+ var _a, _b;
100
+ return [modelValue.value && createVNode("div", mergeProps({
101
+ "class": ns.b()
102
+ }, ctx.attrs, {
103
+ "onClick": onClick
104
+ }), [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)])];
105
+ }
227
106
  });
228
107
  }
229
108
  });
230
- function getElement(element) {
231
- if (element instanceof Element) {
232
- return element;
233
- }
234
- if (element && typeof element === "object" && element.$el instanceof Element) {
235
- return element.$el;
236
- }
237
- return null;
238
- }
239
- function getOrigin(origin) {
240
- if (origin instanceof Element) {
241
- return origin;
109
+ const flexibleOverlayProps = {
110
+ modelValue: {
111
+ type: Boolean,
112
+ default: false
113
+ },
114
+ origin: {
115
+ type: Object,
116
+ require: true
117
+ },
118
+ position: {
119
+ type: Array,
120
+ default: ["bottom"]
121
+ },
122
+ offset: {
123
+ type: [Number, Object],
124
+ default: 8
125
+ },
126
+ shiftOffset: {
127
+ type: Number
128
+ },
129
+ align: {
130
+ type: String,
131
+ default: null
132
+ },
133
+ showArrow: {
134
+ type: Boolean,
135
+ default: false
136
+ },
137
+ isArrowCenter: {
138
+ type: Boolean,
139
+ default: true
242
140
  }
243
- if (isRef(origin)) {
244
- return getElement(origin.value);
141
+ };
142
+ function getScrollParent(element) {
143
+ const overflowRegex = /(auto|scroll|hidden)/;
144
+ for (let parent = element; parent = parent.parentElement; parent.parentElement !== document.body) {
145
+ const style = window.getComputedStyle(parent);
146
+ if (overflowRegex.test(style.overflow + style.overflowX + style.overflowY)) {
147
+ return parent;
148
+ }
245
149
  }
246
- return origin;
150
+ return window;
247
151
  }
248
- function calculatePosition(position, panelOrRect, origin) {
249
- const originRect = getOriginRect(origin);
250
- const originPoint = getOriginRelativePoint(originRect, position);
251
- let rect;
252
- if (panelOrRect instanceof HTMLElement) {
253
- rect = panelOrRect.getBoundingClientRect();
254
- } else {
255
- rect = panelOrRect;
152
+ function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
153
+ let { x, y } = point;
154
+ if (!isArrowCenter) {
155
+ const { width, height } = originRect;
156
+ if (x && placement.includes("start")) {
157
+ x = 12;
158
+ }
159
+ if (x && placement.includes("end")) {
160
+ x = Math.round(width - 24);
161
+ }
162
+ if (y && placement.includes("start")) {
163
+ y = 10;
164
+ }
165
+ if (y && placement.includes("end")) {
166
+ y = height - 14;
167
+ }
256
168
  }
257
- return getOverlayPoint(originPoint, rect, position);
169
+ return { x, y };
258
170
  }
259
- function getOriginRect(origin) {
260
- if (origin instanceof Element) {
261
- return origin.getBoundingClientRect();
262
- }
263
- const width = origin.width || 0;
264
- const height = origin.height || 0;
265
- return {
266
- top: origin.y,
267
- bottom: origin.y + height,
268
- left: origin.x,
269
- right: origin.x + width,
270
- height,
271
- width
171
+ function useOverlay(props, emit) {
172
+ const overlayRef = ref();
173
+ const arrowRef = ref();
174
+ let originParent = null;
175
+ const updateArrowPosition = (arrowEl, placement, point, overlayEl) => {
176
+ const { x, y } = adjustArrowPosition(props.isArrowCenter, point, placement, overlayEl.getBoundingClientRect());
177
+ const staticSide = {
178
+ top: "bottom",
179
+ right: "left",
180
+ bottom: "top",
181
+ left: "right"
182
+ }[placement.split("-")[0]];
183
+ Object.assign(arrowEl.style, {
184
+ left: x ? `${x}px` : "",
185
+ top: y ? `${y}px` : "",
186
+ right: "",
187
+ bottom: "",
188
+ [staticSide]: "-4px"
189
+ });
272
190
  };
273
- }
274
- function getOverlayPoint(originPoint, rect, position) {
275
- let x;
276
- const {
277
- width,
278
- height
279
- } = rect;
280
- if (position.overlayX == "center") {
281
- x = originPoint.x - width / 2;
282
- } else {
283
- x = position.overlayX == "left" ? originPoint.x : originPoint.x - width;
284
- }
285
- let y;
286
- if (position.overlayY == "center") {
287
- y = originPoint.y - height / 2;
288
- } else {
289
- y = position.overlayY == "top" ? originPoint.y : originPoint.y - height;
290
- }
291
- return {
292
- x,
293
- y
191
+ const updatePosition = async () => {
192
+ const hostEl = props.origin;
193
+ const overlayEl = unref(overlayRef.value);
194
+ const arrowEl = unref(arrowRef.value);
195
+ const middleware = [
196
+ offset(props.offset),
197
+ autoPlacement({
198
+ alignment: props.align,
199
+ allowedPlacements: props.position
200
+ })
201
+ ];
202
+ props.showArrow && middleware.push(arrow({ element: arrowEl }));
203
+ props.shiftOffset !== void 0 && middleware.push(shift());
204
+ const { x, y, placement, middlewareData } = await computePosition(hostEl, overlayEl, {
205
+ strategy: "fixed",
206
+ middleware
207
+ });
208
+ let applyX = x;
209
+ let applyY = y;
210
+ if (props.shiftOffset !== void 0) {
211
+ const { x: shiftX, y: shiftY } = middlewareData.shift;
212
+ shiftX < 0 && (applyX -= props.shiftOffset);
213
+ shiftX > 0 && (applyX += props.shiftOffset);
214
+ shiftY < 0 && (applyY -= props.shiftOffset);
215
+ shiftY > 0 && (applyY += props.shiftOffset);
216
+ }
217
+ emit("positionChange", placement);
218
+ Object.assign(overlayEl.style, { top: `${applyY}px`, left: `${applyX}px` });
219
+ props.showArrow && updateArrowPosition(arrowEl, placement, middlewareData.arrow, overlayEl);
294
220
  };
221
+ watch(() => props.modelValue, () => {
222
+ if (props.modelValue && props.origin) {
223
+ originParent = getScrollParent(props.origin);
224
+ nextTick(updatePosition);
225
+ originParent == null ? void 0 : originParent.addEventListener("scroll", updatePosition);
226
+ originParent !== window && window.addEventListener("scroll", updatePosition);
227
+ window.addEventListener("resize", updatePosition);
228
+ } else {
229
+ originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
230
+ originParent !== window && window.removeEventListener("scroll", updatePosition);
231
+ window.removeEventListener("resize", updatePosition);
232
+ }
233
+ });
234
+ onUnmounted(() => {
235
+ originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
236
+ originParent !== window && window.removeEventListener("scroll", updatePosition);
237
+ window.removeEventListener("resize", updatePosition);
238
+ });
239
+ return { arrowRef, overlayRef, updatePosition };
295
240
  }
296
- function getOriginRelativePoint(originRect, position) {
297
- let x;
298
- if (position.originX == "center") {
299
- x = originRect.left + originRect.width / 2;
300
- } else {
301
- const startX = originRect.left;
302
- const endX = originRect.right;
303
- x = position.originX == "left" ? startX : endX;
304
- }
305
- let y;
306
- if (position.originY == "center") {
307
- y = originRect.top + originRect.height / 2;
308
- } else {
309
- y = position.originY == "top" ? originRect.top : originRect.bottom;
241
+ var flexibleOverlay = "";
242
+ const FlexibleOverlay = defineComponent({
243
+ name: "DFlexibleOverlay",
244
+ inheritAttrs: false,
245
+ props: flexibleOverlayProps,
246
+ emits: ["update:modelValue", "positionChange"],
247
+ setup(props, {
248
+ slots,
249
+ attrs,
250
+ emit,
251
+ expose
252
+ }) {
253
+ const ns = useNamespace("flexible-overlay");
254
+ const {
255
+ arrowRef,
256
+ overlayRef,
257
+ updatePosition
258
+ } = useOverlay(props, emit);
259
+ expose({
260
+ updatePosition
261
+ });
262
+ return () => {
263
+ var _a;
264
+ return props.modelValue && createVNode("div", mergeProps({
265
+ "ref": overlayRef,
266
+ "class": ns.b()
267
+ }, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots), props.showArrow && createVNode("div", {
268
+ "ref": arrowRef,
269
+ "class": ns.e("arrow")
270
+ }, null)]);
271
+ };
310
272
  }
311
- return {
312
- x,
313
- y
314
- };
315
- }
316
- function subscribeLayoutEvent(event) {
317
- window.addEventListener("scroll", event, true);
318
- window.addEventListener("resize", event);
319
- window.addEventListener("orientationchange", event);
320
- }
321
- function unsbscribeLayoutEvent(event) {
322
- window.removeEventListener("scroll", event, true);
323
- window.removeEventListener("resize", event);
324
- window.removeEventListener("orientationchange", event);
325
- }
273
+ });
326
274
  const inBrowser = typeof window !== "undefined";
327
- FlexibleOverlay.install = function(app) {
328
- app.component(FlexibleOverlay.name, FlexibleOverlay);
329
- };
330
- FixedOverlay.install = function(app) {
331
- app.component(FixedOverlay.name, FixedOverlay);
332
- };
333
275
  var index = {
334
276
  title: "Overlay \u906E\u7F69\u5C42",
335
277
  category: "\u901A\u7528",
336
- status: "\u5DF2\u5B8C\u6210",
278
+ status: "100%",
337
279
  install(app) {
338
- app.use(FixedOverlay);
339
- app.use(FlexibleOverlay);
280
+ app.component(FixedOverlay.name, FixedOverlay);
281
+ app.component(FlexibleOverlay.name, FlexibleOverlay);
340
282
  if (inBrowser && !document.getElementById("d-overlay-anchor")) {
341
283
  const overlayAnchor = document.createElement("div");
342
284
  overlayAnchor.setAttribute("id", "d-overlay-anchor");
@@ -348,4 +290,4 @@ var index = {
348
290
  }
349
291
  }
350
292
  };
351
- export { FixedOverlay, FlexibleOverlay, index as default };
293
+ export { FixedOverlay, FlexibleOverlay, index as default, fixedOverlayProps, flexibleOverlayProps };
@@ -1 +1 @@
1
- var z=Object.defineProperty,R=Object.defineProperties;var $=Object.getOwnPropertyDescriptors;var E=Object.getOwnPropertySymbols;var A=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var S=(i,t,c)=>t in i?z(i,t,{enumerable:!0,configurable:!0,writable:!0,value:c}):i[t]=c,g=(i,t)=>{for(var c in t||(t={}))A.call(t,c)&&S(i,c,t[c]);if(E)for(var c of E(t))I.call(t,c)&&S(i,c,t[c]);return i},F=(i,t)=>R(i,$(t));(function(i,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(i=typeof globalThis!="undefined"?globalThis:i||self,t(i.index={},i.Vue))})(this,function(i,t){"use strict";var c="";function j(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const m=t.defineComponent({setup(e,n){return()=>{let l;return t.createVNode(t.Teleport,{to:"#d-overlay-anchor"},{default:()=>[t.createVNode(t.Transition,{name:"devui-overlay-fade"},j(l=t.renderSlot(n.slots,"default"))?l:{default:()=>[l]})]})}}}),k={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 O(e){const n=t.computed(()=>["devui-overlay-background","devui-overlay-background__color",e.backgroundClass]),l=t.computed(()=>"devui-overlay"),r=o=>{var s,f;o.preventDefault(),(s=e.backdropClick)==null||s.call(e),e.backdropClose&&((f=e["onUpdate:visible"])==null||f.call(e,!1))},a=o=>o.cancelBubble=!0;return t.onMounted(()=>{const o=document.body,s=o.style.overflow,f=o.style.position;t.watch([()=>e.visible,()=>e.backgroundBlock],([w,v])=>{if(v){const u=o.getBoundingClientRect().y;w?(o.style.overflowY="scroll",o.style.position=w?"fixed":"",o.style.top=`${u}px`):(o.style.overflowY=s,o.style.position=f,o.style.top="",window.scrollTo(0,-u))}}),t.onUnmounted(()=>{document.body.style.overflow=s})}),{backgroundClass:n,overlayClass:l,handleBackdropClick:r,handleOverlayBubbleCancel:a}}const y=t.defineComponent({name:"DFixedOverlay",props:F(g({},k),{overlayStyle:{type:Object,default:void 0}}),setup(e,n){const{backgroundClass:l,overlayClass:r,handleBackdropClick:a,handleOverlayBubbleCancel:o}=O(e);return()=>t.createVNode(m,null,{default:()=>[t.withDirectives(t.createVNode("div",{class:l.value,style:e.backgroundStyle,onClick:a},[t.createVNode("div",{class:r.value,style:e.overlayStyle,onClick:o},[t.renderSlot(n.slots,"default")])]),[[t.vShow,e.visible]])]})}}),b=t.defineComponent({name:"DFlexibleOverlay",props:g({origin:{type:Object,require:!0},position:{type:Object,default:()=>({originX:"left",originY:"top",overlayX:"left",overlayY:"top"})}},k),emits:["onUpdate:visible"],setup(e,n){const l=t.ref(null),r=t.reactive({position:"absolute"}),a=t.getCurrentInstance();t.onMounted(async()=>{await t.nextTick();const v=l.value;if(!v)return;const u=V(e.origin);if(!u)return;const x=d=>{const C=N(e.position,d,u);r.left=`${C.x}px`,r.top=`${C.y}px`},h=()=>x(v.getBoundingClientRect());t.watch(t.toRef(e,"visible"),(d,C,_)=>{d?D(h):p(h),_(()=>{p(h)})}),t.watch(t.toRef(e,"position"),()=>{h()});const B=new ResizeObserver(d=>{x(d[0].contentRect)});if(B.observe(v),t.onBeforeUnmount(()=>{B.disconnect()},a),u instanceof Element){const d=new MutationObserver(h);d.observe(u,{attributeFilter:["style"]}),t.onBeforeUnmount(()=>{d.disconnect()},a)}},a);const{backgroundClass:o,overlayClass:s,handleBackdropClick:f,handleOverlayBubbleCancel:w}=O(e);return()=>t.createVNode(m,null,{default:()=>[t.withDirectives(t.createVNode("div",{class:o.value,onClick:f},[t.createVNode("div",{ref:l,class:s.value,style:r,onClick:w},[t.renderSlot(n.slots,"default")])]),[[t.vShow,e.visible]])]})}});function L(e){return e instanceof Element?e:e&&typeof e=="object"&&e.$el instanceof Element?e.$el:null}function V(e){return e instanceof Element?e:t.isRef(e)?L(e.value):e}function N(e,n,l){const r=T(l),a=Y(r,e);let o;return n instanceof HTMLElement?o=n.getBoundingClientRect():o=n,X(a,o,e)}function T(e){if(e instanceof Element)return e.getBoundingClientRect();const n=e.width||0,l=e.height||0;return{top:e.y,bottom:e.y+l,left:e.x,right:e.x+n,height:l,width:n}}function X(e,n,l){let r;const{width:a,height:o}=n;l.overlayX=="center"?r=e.x-a/2:r=l.overlayX=="left"?e.x:e.x-a;let s;return l.overlayY=="center"?s=e.y-o/2:s=l.overlayY=="top"?e.y:e.y-o,{x:r,y:s}}function Y(e,n){let l;if(n.originX=="center")l=e.left+e.width/2;else{const a=e.left,o=e.right;l=n.originX=="left"?a:o}let r;return n.originY=="center"?r=e.top+e.height/2:r=n.originY=="top"?e.top:e.bottom,{x:l,y:r}}function D(e){window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),window.addEventListener("orientationchange",e)}function p(e){window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e),window.removeEventListener("orientationchange",e)}const M=typeof window!="undefined";b.install=function(e){e.component(b.name,b)},y.install=function(e){e.component(y.name,y)};var U={title:"Overlay \u906E\u7F69\u5C42",category:"\u901A\u7528",status:"\u5DF2\u5B8C\u6210",install(e){if(e.use(y),e.use(b),M&&!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)}}};i.FixedOverlay=y,i.FlexibleOverlay=b,i.default=U,Object.defineProperty(i,"__esModule",{value:!0}),i[Symbol.toStringTag]="Module"});
1
+ (function(a,l){typeof exports=="object"&&typeof module!="undefined"?l(exports,require("vue"),require("@floating-ui/dom")):typeof define=="function"&&define.amd?define(["exports","vue","@floating-ui/dom"],l):(a=typeof globalThis!="undefined"?globalThis:a||self,l(a.index={},a.Vue,a.dom))})(this,function(a,l,f){"use strict";const b={modelValue:{type:Boolean,default:!1},lockScroll:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0}};function P(){if(document.documentElement.scrollHeight>document.documentElement.clientHeight){const e=document.documentElement.scrollTop,t=document.documentElement.getAttribute("style");return document.documentElement.style.position="fixed",document.documentElement.style.top=`-${e}px`,document.documentElement.style.width=document.documentElement.style.width||"100%",document.documentElement.style.overflowY="scroll",()=>{t?document.documentElement.setAttribute("style",t):document.documentElement.removeAttribute("style"),document.documentElement.scrollTop=e}}}function k(e,t){let o;const i=s=>{s.preventDefault(),t.emit("click",s),e.closeOnClickOverlay&&t.emit("update:modelValue",!1)},n=()=>{o==null||o()};return l.watch(()=>e.modelValue,s=>{s?e.lockScroll&&(o=P()):n()}),l.onUnmounted(n),{onClick:i}}function y(e,t,o){let i=e;return t&&(i+=`__${t}`),o&&(i+=`--${o}`),i}function g(e,t=!1){const o=t?`.devui-${e}`:`devui-${e}`;return{b:()=>y(o),e:d=>d?y(o,d):"",m:d=>d?y(o,"",d):"",em:(d,c)=>d&&c?y(o,d,c):""}}var j="";const O=l.defineComponent({name:"DFixedOverlay",inheritAttrs:!1,props:b,emits:["update:modelValue","click"],setup(e,t){const{modelValue:o}=l.toRefs(e),i=g("fixed-overlay"),{onClick:n}=k(e,t);return()=>l.createVNode(l.Transition,{name:i.m("fade")},{default:()=>{var s,r;return[o.value&&l.createVNode("div",l.mergeProps({class:i.b()},t.attrs,{onClick:n}),[(r=(s=t.slots).default)==null?void 0:r.call(s)])]}})}}),A={modelValue:{type:Boolean,default:!1},origin:{type:Object,require:!0},position:{type:Array,default:["bottom"]},offset:{type:[Number,Object],default:8},shiftOffset:{type:Number},align:{type:String,default:null},showArrow:{type:Boolean,default:!1},isArrowCenter:{type:Boolean,default:!0}};function L(e){const t=/(auto|scroll|hidden)/;for(let o=e;o=o.parentElement;o.parentElement!==document.body){const i=window.getComputedStyle(o);if(t.test(i.overflow+i.overflowX+i.overflowY))return o}return window}function $(e,t,o,i){let{x:n,y:s}=t;if(!e){const{width:r,height:d}=i;n&&o.includes("start")&&(n=12),n&&o.includes("end")&&(n=Math.round(r-24)),s&&o.includes("start")&&(s=10),s&&o.includes("end")&&(s=d-14)}return{x:n,y:s}}function F(e,t){const o=l.ref(),i=l.ref();let n=null;const s=(d,c,u,m)=>{const{x:w,y:v}=$(e.isArrowCenter,u,c,m.getBoundingClientRect()),h={top:"bottom",right:"left",bottom:"top",left:"right"}[c.split("-")[0]];Object.assign(d.style,{left:w?`${w}px`:"",top:v?`${v}px`:"",right:"",bottom:"",[h]:"-4px"})},r=async()=>{const d=e.origin,c=l.unref(o.value),u=l.unref(i.value),m=[f.offset(e.offset),f.autoPlacement({alignment:e.align,allowedPlacements:e.position})];e.showArrow&&m.push(f.arrow({element:u})),e.shiftOffset!==void 0&&m.push(f.shift());const{x:w,y:v,placement:h,middlewareData:V}=await f.computePosition(d,c,{strategy:"fixed",middleware:m});let p=w,x=v;if(e.shiftOffset!==void 0){const{x:C,y:B}=V.shift;C<0&&(p-=e.shiftOffset),C>0&&(p+=e.shiftOffset),B<0&&(x-=e.shiftOffset),B>0&&(x+=e.shiftOffset)}t("positionChange",h),Object.assign(c.style,{top:`${x}px`,left:`${p}px`}),e.showArrow&&s(u,h,V.arrow,c)};return l.watch(()=>e.modelValue,()=>{e.modelValue&&e.origin?(n=L(e.origin),l.nextTick(r),n==null||n.addEventListener("scroll",r),n!==window&&window.addEventListener("scroll",r),window.addEventListener("resize",r)):(n==null||n.removeEventListener("scroll",r),n!==window&&window.removeEventListener("scroll",r),window.removeEventListener("resize",r))}),l.onUnmounted(()=>{n==null||n.removeEventListener("scroll",r),n!==window&&window.removeEventListener("scroll",r),window.removeEventListener("resize",r)}),{arrowRef:i,overlayRef:o,updatePosition:r}}var N="";const E=l.defineComponent({name:"DFlexibleOverlay",inheritAttrs:!1,props:A,emits:["update:modelValue","positionChange"],setup(e,{slots:t,attrs:o,emit:i,expose:n}){const s=g("flexible-overlay"),{arrowRef:r,overlayRef:d,updatePosition:c}=F(e,i);return n({updatePosition:c}),()=>{var u;return e.modelValue&&l.createVNode("div",l.mergeProps({ref:d,class:s.b()},o),[(u=t.default)==null?void 0:u.call(t),e.showArrow&&l.createVNode("div",{ref:r,class:s.e("arrow")},null)])}}}),S=typeof window!="undefined";var T={title:"Overlay \u906E\u7F69\u5C42",category:"\u901A\u7528",status:"100%",install(e){if(e.component(O.name,O),e.component(E.name,E),S&&!document.getElementById("d-overlay-anchor")){const t=document.createElement("div");t.setAttribute("id","d-overlay-anchor"),t.style.position="fixed",t.style.left="0",t.style.top="0",t.style.zIndex="1000",document.body.appendChild(t)}}};a.FixedOverlay=O,a.FlexibleOverlay=E,a.default=T,a.fixedOverlayProps=b,a.flexibleOverlayProps=A,Object.defineProperties(a,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"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-fixed-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background-color:var(--devui-shadow, rgba(37, 43, 58, .2));z-index:1050}.devui-fixed-overlay--fade-enter-active,.devui-fixed-overlay--fade-leave-active{transition:opacity .1s cubic-bezier(0,0,1,1)}.devui-fixed-overlay--fade-enter-from,.devui-fixed-overlay--fade-leave-to{opacity:0}.devui-flexible-overlay{position:fixed;border-radius:var(--devui-border-radius, 4px);background-color:var(--devui-connected-overlay-bg, #ffffff);box-shadow:var(--devui-shadow-length-connected-overlay, 0 4px 8px 0) var(--devui-shadow, rgba(37, 43, 58, .2));z-index:1000}.devui-flexible-overlay__arrow{position:absolute;width:8px;height:8px;transform:rotate(45deg);background-color:inherit}