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

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
@@ -0,0 +1,736 @@
1
+ import { toRefs, watch, onMounted, onUnmounted, ref, computed, defineComponent, createVNode, Transition, mergeProps, nextTick, unref, Comment, Text, Fragment, h, inject, withDirectives, cloneVNode, provide, Teleport, vShow } from "vue";
2
+ import { offset, autoPlacement, arrow, shift, computePosition } from "@floating-ui/dom";
3
+ import { onClickOutside } from "@vueuse/core";
4
+ const dropdownProps = {
5
+ visible: {
6
+ type: Boolean,
7
+ default: false
8
+ },
9
+ trigger: {
10
+ type: String,
11
+ default: "click"
12
+ },
13
+ closeScope: {
14
+ type: String,
15
+ default: "all"
16
+ },
17
+ position: {
18
+ type: Array,
19
+ default: ["bottom"]
20
+ },
21
+ align: {
22
+ type: String,
23
+ default: null
24
+ },
25
+ offset: {
26
+ type: [Number, Object],
27
+ default: 4
28
+ },
29
+ shiftOffset: {
30
+ type: Number
31
+ },
32
+ closeOnMouseLeaveMenu: {
33
+ type: Boolean,
34
+ default: false
35
+ },
36
+ showAnimation: {
37
+ type: Boolean,
38
+ default: true
39
+ },
40
+ overlayClass: {
41
+ type: String,
42
+ default: ""
43
+ },
44
+ destroyOnHide: {
45
+ type: Boolean,
46
+ default: true
47
+ }
48
+ };
49
+ const POPPER_TRIGGER_TOKEN = Symbol("popper-trigger");
50
+ function getElement(element) {
51
+ if (element instanceof Element) {
52
+ return element;
53
+ }
54
+ if (element && typeof element === "object" && element.$el instanceof Element) {
55
+ return element.$el;
56
+ }
57
+ return null;
58
+ }
59
+ const dropdownMap = /* @__PURE__ */ new Map();
60
+ function subscribeEvent(dom, type, callback) {
61
+ dom == null ? void 0 : dom.addEventListener(type, callback);
62
+ return () => {
63
+ dom == null ? void 0 : dom.removeEventListener(type, callback);
64
+ };
65
+ }
66
+ const useDropdownEvent = ({ id, isOpen, origin, dropdownRef, props, emit }) => {
67
+ let overlayEnter = false;
68
+ let originEnter = false;
69
+ const { trigger, closeScope, closeOnMouseLeaveMenu } = toRefs(props);
70
+ const toggle = (status) => {
71
+ isOpen.value = status;
72
+ emit("toggle", isOpen.value);
73
+ };
74
+ const handleLeave = async (elementType, closeAll) => {
75
+ await new Promise((resolve) => setTimeout(resolve, 50));
76
+ if (elementType === "origin" && overlayEnter || elementType === "dropdown" && originEnter) {
77
+ return;
78
+ }
79
+ if (closeAll) {
80
+ [...dropdownMap.values()].reverse().forEach((item) => {
81
+ setTimeout(() => {
82
+ var _a;
83
+ (_a = item.toggle) == null ? void 0 : _a.call(item);
84
+ }, 0);
85
+ });
86
+ }
87
+ toggle(false);
88
+ };
89
+ watch([trigger, origin, dropdownRef], ([triggerVal, originVal, dropdownEl], ov, onInvalidate) => {
90
+ const originEl = getElement(originVal);
91
+ const subscriptions = [];
92
+ setTimeout(() => {
93
+ subscriptions.push(subscribeEvent(document, "click", (e) => {
94
+ const dropdownValues = [...dropdownMap.values()];
95
+ if (!isOpen.value || closeScope.value === "none" || (dropdownEl == null ? void 0 : dropdownEl.contains(e.target)) && closeScope.value === "blank" || dropdownValues.some((item) => {
96
+ var _a;
97
+ return (_a = item.toggleEl) == null ? void 0 : _a.contains(e.target);
98
+ }) && dropdownValues.some((item) => {
99
+ var _a;
100
+ return (_a = item.menuEl) == null ? void 0 : _a.contains(e.target);
101
+ })) {
102
+ return;
103
+ }
104
+ [...dropdownMap.values()].reverse().forEach((item) => {
105
+ setTimeout(() => {
106
+ var _a, _b;
107
+ if (!((_a = item.toggleEl) == null ? void 0 : _a.contains(e.target))) {
108
+ (_b = item.toggle) == null ? void 0 : _b.call(item);
109
+ }
110
+ }, 0);
111
+ });
112
+ overlayEnter = false;
113
+ }));
114
+ }, 0);
115
+ if (triggerVal === "click") {
116
+ subscriptions.push(subscribeEvent(originEl, "click", () => toggle(!isOpen.value)), subscribeEvent(dropdownEl, "mouseleave", (e) => {
117
+ var _a;
118
+ if (closeOnMouseLeaveMenu.value && !((_a = dropdownMap.get(id).child) == null ? void 0 : _a.contains(e.relatedTarget))) {
119
+ handleLeave("dropdown", true);
120
+ }
121
+ }));
122
+ } else if (triggerVal === "hover") {
123
+ subscriptions.push(subscribeEvent(originEl, "mouseenter", () => {
124
+ originEnter = true;
125
+ toggle(true);
126
+ }), subscribeEvent(originEl, "mouseleave", () => {
127
+ originEnter = false;
128
+ handleLeave("origin");
129
+ }), subscribeEvent(dropdownEl, "mouseenter", () => {
130
+ overlayEnter = true;
131
+ isOpen.value = true;
132
+ }), subscribeEvent(dropdownEl, "mouseleave", (e) => {
133
+ var _a;
134
+ overlayEnter = false;
135
+ if (e.relatedTarget && ((originEl == null ? void 0 : originEl.contains(e.relatedTarget)) || ((_a = dropdownMap.get(id).child) == null ? void 0 : _a.contains(e.relatedTarget)))) {
136
+ return;
137
+ }
138
+ handleLeave("dropdown", true);
139
+ }));
140
+ }
141
+ onInvalidate(() => subscriptions.forEach((v) => v()));
142
+ });
143
+ };
144
+ function useDropdown(id, visible, isOpen, origin, dropdownRef, popDirection, emit) {
145
+ const calcPopDirection = (dropdownEl) => {
146
+ const elementHeight = dropdownEl.offsetHeight;
147
+ const bottomDistance = window.innerHeight - origin.value.getBoundingClientRect().bottom;
148
+ const isBottomEnough = bottomDistance >= elementHeight;
149
+ if (!isBottomEnough) {
150
+ popDirection.value = "top";
151
+ } else {
152
+ popDirection.value = "bottom";
153
+ }
154
+ };
155
+ watch(visible, (newVal, oldVal) => {
156
+ if (oldVal === void 0) {
157
+ return;
158
+ }
159
+ isOpen.value = newVal;
160
+ emit("toggle", isOpen.value);
161
+ }, { immediate: true });
162
+ watch([isOpen, dropdownRef], ([isOpenVal, dropdownEl]) => {
163
+ var _a;
164
+ if (isOpenVal) {
165
+ dropdownMap.set(id, {
166
+ ...dropdownMap.get(id),
167
+ menuEl: dropdownEl,
168
+ toggle: () => {
169
+ isOpen.value = false;
170
+ emit("toggle", isOpen.value);
171
+ }
172
+ });
173
+ for (const value of dropdownMap.values()) {
174
+ if ((_a = value.menuEl) == null ? void 0 : _a.contains(origin.value)) {
175
+ value.child = dropdownEl;
176
+ }
177
+ }
178
+ }
179
+ if (dropdownEl) {
180
+ calcPopDirection(dropdownEl);
181
+ }
182
+ });
183
+ onMounted(() => {
184
+ dropdownMap.set(id, { toggleEl: origin.value });
185
+ });
186
+ onUnmounted(() => {
187
+ dropdownMap.delete(id);
188
+ });
189
+ }
190
+ function useOverlayProps(props, currentPosition, isOpen) {
191
+ const { showAnimation, overlayClass, destroyOnHide } = toRefs(props);
192
+ const overlayModelValue = ref(false);
193
+ const overlayShowValue = ref(false);
194
+ const styles = computed(() => ({
195
+ transformOrigin: currentPosition.value === "top" ? "0% 100%" : "0% 0%"
196
+ }));
197
+ const classes = computed(() => ({
198
+ "fade-in-bottom": showAnimation.value && isOpen.value && currentPosition.value === "bottom",
199
+ "fade-in-top": showAnimation.value && isOpen.value && currentPosition.value === "top",
200
+ [`${overlayClass.value}`]: true
201
+ }));
202
+ const handlePositionChange = (pos) => {
203
+ currentPosition.value = pos.includes("top") || pos.includes("right-end") || pos.includes("left-end") ? "top" : "bottom";
204
+ };
205
+ watch(isOpen, (isOpenVal) => {
206
+ overlayModelValue.value = destroyOnHide.value ? isOpenVal : true;
207
+ overlayShowValue.value = isOpenVal;
208
+ });
209
+ return { overlayModelValue, overlayShowValue, styles, classes, handlePositionChange };
210
+ }
211
+ const fixedOverlayProps = {
212
+ modelValue: {
213
+ type: Boolean,
214
+ default: false
215
+ },
216
+ lockScroll: {
217
+ type: Boolean,
218
+ default: true
219
+ },
220
+ closeOnClickOverlay: {
221
+ type: Boolean,
222
+ default: true
223
+ }
224
+ };
225
+ function lockScroll() {
226
+ if (document.documentElement.scrollHeight > document.documentElement.clientHeight) {
227
+ const scrollTop = document.documentElement.scrollTop;
228
+ const style = document.documentElement.getAttribute("style");
229
+ document.documentElement.style.position = "fixed";
230
+ document.documentElement.style.top = `-${scrollTop}px`;
231
+ document.documentElement.style.width = document.documentElement.style.width || "100%";
232
+ document.documentElement.style.overflowY = "scroll";
233
+ return () => {
234
+ if (style) {
235
+ document.documentElement.setAttribute("style", style);
236
+ } else {
237
+ document.documentElement.removeAttribute("style");
238
+ }
239
+ document.documentElement.scrollTop = scrollTop;
240
+ };
241
+ }
242
+ return;
243
+ }
244
+ function useFixedOverlay(props, ctx) {
245
+ let lockScrollCb;
246
+ const onClick = (event) => {
247
+ event.preventDefault();
248
+ ctx.emit("click", event);
249
+ if (props.closeOnClickOverlay) {
250
+ ctx.emit("update:modelValue", false);
251
+ }
252
+ };
253
+ const removeBodyAdditions = () => {
254
+ lockScrollCb == null ? void 0 : lockScrollCb();
255
+ };
256
+ watch(() => props.modelValue, (val) => {
257
+ if (val) {
258
+ props.lockScroll && (lockScrollCb = lockScroll());
259
+ } else {
260
+ removeBodyAdditions();
261
+ }
262
+ });
263
+ onUnmounted(removeBodyAdditions);
264
+ return { onClick };
265
+ }
266
+ function createBem(namespace, element, modifier) {
267
+ let cls = namespace;
268
+ if (element) {
269
+ cls += `__${element}`;
270
+ }
271
+ if (modifier) {
272
+ cls += `--${modifier}`;
273
+ }
274
+ return cls;
275
+ }
276
+ function useNamespace(block, needDot = false) {
277
+ const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
278
+ const b = () => createBem(namespace);
279
+ const e = (element) => element ? createBem(namespace, element) : "";
280
+ const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
281
+ const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
282
+ return {
283
+ b,
284
+ e,
285
+ m,
286
+ em
287
+ };
288
+ }
289
+ var fixedOverlay = "";
290
+ defineComponent({
291
+ name: "DFixedOverlay",
292
+ inheritAttrs: false,
293
+ props: fixedOverlayProps,
294
+ emits: ["update:modelValue", "click"],
295
+ setup(props, ctx) {
296
+ const {
297
+ modelValue
298
+ } = toRefs(props);
299
+ const ns2 = useNamespace("fixed-overlay");
300
+ const {
301
+ onClick
302
+ } = useFixedOverlay(props, ctx);
303
+ return () => createVNode(Transition, {
304
+ "name": ns2.m("fade")
305
+ }, {
306
+ default: () => {
307
+ var _a, _b;
308
+ return [modelValue.value && createVNode("div", mergeProps({
309
+ "class": ns2.b()
310
+ }, ctx.attrs, {
311
+ "onClick": onClick
312
+ }), [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)])];
313
+ }
314
+ });
315
+ }
316
+ });
317
+ const flexibleOverlayProps = {
318
+ modelValue: {
319
+ type: Boolean,
320
+ default: false
321
+ },
322
+ origin: {
323
+ type: Object,
324
+ require: true
325
+ },
326
+ position: {
327
+ type: Array,
328
+ default: ["bottom"]
329
+ },
330
+ offset: {
331
+ type: [Number, Object],
332
+ default: 8
333
+ },
334
+ shiftOffset: {
335
+ type: Number
336
+ },
337
+ align: {
338
+ type: String,
339
+ default: null
340
+ },
341
+ showArrow: {
342
+ type: Boolean,
343
+ default: false
344
+ },
345
+ isArrowCenter: {
346
+ type: Boolean,
347
+ default: true
348
+ }
349
+ };
350
+ function getScrollParent(element) {
351
+ const overflowRegex = /(auto|scroll|hidden)/;
352
+ for (let parent = element; parent = parent.parentElement; parent.parentElement !== document.body) {
353
+ const style = window.getComputedStyle(parent);
354
+ if (overflowRegex.test(style.overflow + style.overflowX + style.overflowY)) {
355
+ return parent;
356
+ }
357
+ }
358
+ return window;
359
+ }
360
+ function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
361
+ let { x, y } = point;
362
+ if (!isArrowCenter) {
363
+ const { width, height } = originRect;
364
+ if (x && placement.includes("start")) {
365
+ x = 12;
366
+ }
367
+ if (x && placement.includes("end")) {
368
+ x = Math.round(width - 24);
369
+ }
370
+ if (y && placement.includes("start")) {
371
+ y = 10;
372
+ }
373
+ if (y && placement.includes("end")) {
374
+ y = height - 14;
375
+ }
376
+ }
377
+ return { x, y };
378
+ }
379
+ function useOverlay(props, emit) {
380
+ const overlayRef = ref();
381
+ const arrowRef = ref();
382
+ let originParent = null;
383
+ const updateArrowPosition = (arrowEl, placement, point, overlayEl) => {
384
+ const { x, y } = adjustArrowPosition(props.isArrowCenter, point, placement, overlayEl.getBoundingClientRect());
385
+ const staticSide = {
386
+ top: "bottom",
387
+ right: "left",
388
+ bottom: "top",
389
+ left: "right"
390
+ }[placement.split("-")[0]];
391
+ Object.assign(arrowEl.style, {
392
+ left: x ? `${x}px` : "",
393
+ top: y ? `${y}px` : "",
394
+ right: "",
395
+ bottom: "",
396
+ [staticSide]: "-4px"
397
+ });
398
+ };
399
+ const updatePosition = async () => {
400
+ const hostEl = props.origin;
401
+ const overlayEl = unref(overlayRef.value);
402
+ const arrowEl = unref(arrowRef.value);
403
+ const middleware = [
404
+ offset(props.offset),
405
+ autoPlacement({
406
+ alignment: props.align,
407
+ allowedPlacements: props.position
408
+ })
409
+ ];
410
+ props.showArrow && middleware.push(arrow({ element: arrowEl }));
411
+ props.shiftOffset !== void 0 && middleware.push(shift());
412
+ const { x, y, placement, middlewareData } = await computePosition(hostEl, overlayEl, {
413
+ strategy: "fixed",
414
+ middleware
415
+ });
416
+ let applyX = x;
417
+ let applyY = y;
418
+ if (props.shiftOffset !== void 0) {
419
+ const { x: shiftX, y: shiftY } = middlewareData.shift;
420
+ shiftX < 0 && (applyX -= props.shiftOffset);
421
+ shiftX > 0 && (applyX += props.shiftOffset);
422
+ shiftY < 0 && (applyY -= props.shiftOffset);
423
+ shiftY > 0 && (applyY += props.shiftOffset);
424
+ }
425
+ emit("positionChange", placement);
426
+ Object.assign(overlayEl.style, { top: `${applyY}px`, left: `${applyX}px` });
427
+ props.showArrow && updateArrowPosition(arrowEl, placement, middlewareData.arrow, overlayEl);
428
+ };
429
+ watch(() => props.modelValue, () => {
430
+ if (props.modelValue && props.origin) {
431
+ originParent = getScrollParent(props.origin);
432
+ nextTick(updatePosition);
433
+ originParent == null ? void 0 : originParent.addEventListener("scroll", updatePosition);
434
+ originParent !== window && window.addEventListener("scroll", updatePosition);
435
+ window.addEventListener("resize", updatePosition);
436
+ } else {
437
+ originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
438
+ originParent !== window && window.removeEventListener("scroll", updatePosition);
439
+ window.removeEventListener("resize", updatePosition);
440
+ }
441
+ });
442
+ onUnmounted(() => {
443
+ originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
444
+ originParent !== window && window.removeEventListener("scroll", updatePosition);
445
+ window.removeEventListener("resize", updatePosition);
446
+ });
447
+ return { arrowRef, overlayRef, updatePosition };
448
+ }
449
+ var flexibleOverlay = "";
450
+ const FlexibleOverlay = defineComponent({
451
+ name: "DFlexibleOverlay",
452
+ inheritAttrs: false,
453
+ props: flexibleOverlayProps,
454
+ emits: ["update:modelValue", "positionChange"],
455
+ setup(props, {
456
+ slots,
457
+ attrs,
458
+ emit,
459
+ expose
460
+ }) {
461
+ const ns2 = useNamespace("flexible-overlay");
462
+ const {
463
+ arrowRef,
464
+ overlayRef,
465
+ updatePosition
466
+ } = useOverlay(props, emit);
467
+ expose({
468
+ updatePosition
469
+ });
470
+ return () => {
471
+ var _a;
472
+ return props.modelValue && createVNode("div", mergeProps({
473
+ "ref": overlayRef,
474
+ "class": ns2.b()
475
+ }, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots), props.showArrow && createVNode("div", {
476
+ "ref": arrowRef,
477
+ "class": ns2.e("arrow")
478
+ }, null)]);
479
+ };
480
+ }
481
+ });
482
+ const isObject = (val) => val !== null && typeof val === "object";
483
+ const ns = useNamespace("popper-trigger");
484
+ function wrapContent(content) {
485
+ return h("span", { class: ns.b() }, content);
486
+ }
487
+ function getFirstValidChild(nodes) {
488
+ for (const child of nodes) {
489
+ if (isObject(child)) {
490
+ if (child.type === Comment) {
491
+ continue;
492
+ }
493
+ if (child.type === "svg" || child.type === Text) {
494
+ return wrapContent(child);
495
+ }
496
+ if (child.type === Fragment) {
497
+ return getFirstValidChild(child.children);
498
+ }
499
+ return child;
500
+ }
501
+ return wrapContent(child);
502
+ }
503
+ return null;
504
+ }
505
+ var PopperTrigger = defineComponent({
506
+ name: "DPopperTrigger",
507
+ setup(_, ctx) {
508
+ const {
509
+ slots,
510
+ attrs
511
+ } = ctx;
512
+ return () => {
513
+ var _a;
514
+ const defaultSlot = (_a = slots.default) == null ? void 0 : _a.call(slots, attrs);
515
+ const triggerRef = inject(POPPER_TRIGGER_TOKEN);
516
+ if (!defaultSlot) {
517
+ return null;
518
+ }
519
+ const firstValidChild = getFirstValidChild(defaultSlot);
520
+ if (!firstValidChild) {
521
+ return null;
522
+ }
523
+ return withDirectives(cloneVNode(firstValidChild, attrs), [[{
524
+ mounted(el) {
525
+ triggerRef.value = el;
526
+ },
527
+ updated(el) {
528
+ triggerRef.value = el;
529
+ },
530
+ unmounted() {
531
+ triggerRef.value = null;
532
+ }
533
+ }]]);
534
+ };
535
+ }
536
+ });
537
+ var dropdown = "";
538
+ let dropdownId = 1;
539
+ var Dropdown = defineComponent({
540
+ name: "DDropdown",
541
+ inheritAttrs: false,
542
+ props: dropdownProps,
543
+ emits: ["toggle"],
544
+ setup(props, {
545
+ slots,
546
+ attrs,
547
+ emit,
548
+ expose
549
+ }) {
550
+ const {
551
+ visible,
552
+ position,
553
+ align,
554
+ offset: offset2,
555
+ destroyOnHide,
556
+ shiftOffset,
557
+ showAnimation
558
+ } = toRefs(props);
559
+ const origin = ref();
560
+ const dropdownRef = ref();
561
+ const overlayRef = ref();
562
+ const id = `dropdown_${dropdownId++}`;
563
+ const isOpen = ref(false);
564
+ const currentPosition = ref("bottom");
565
+ const ns2 = useNamespace("dropdown");
566
+ provide(POPPER_TRIGGER_TOKEN, origin);
567
+ useDropdownEvent({
568
+ id,
569
+ isOpen,
570
+ origin,
571
+ dropdownRef,
572
+ props,
573
+ emit
574
+ });
575
+ useDropdown(id, visible, isOpen, origin, dropdownRef, currentPosition, emit);
576
+ const {
577
+ overlayModelValue,
578
+ overlayShowValue,
579
+ styles,
580
+ classes,
581
+ handlePositionChange
582
+ } = useOverlayProps(props, currentPosition, isOpen);
583
+ watch(overlayShowValue, (overlayShowValueVal) => {
584
+ nextTick(() => {
585
+ if (!destroyOnHide.value && overlayShowValueVal) {
586
+ overlayRef.value.updatePosition();
587
+ }
588
+ });
589
+ });
590
+ expose({
591
+ updatePosition: () => overlayRef.value.updatePosition()
592
+ });
593
+ return () => createVNode(Fragment, null, [createVNode(PopperTrigger, null, {
594
+ default: () => {
595
+ var _a;
596
+ return [(_a = slots.default) == null ? void 0 : _a.call(slots)];
597
+ }
598
+ }), createVNode(Teleport, {
599
+ "to": "body"
600
+ }, {
601
+ default: () => [createVNode(Transition, {
602
+ "name": showAnimation.value ? ns2.m(`fade-${currentPosition.value}`) : ""
603
+ }, {
604
+ default: () => [withDirectives(createVNode(FlexibleOverlay, {
605
+ "modelValue": overlayModelValue.value,
606
+ "onUpdate:modelValue": ($event) => overlayModelValue.value = $event,
607
+ "ref": overlayRef,
608
+ "origin": origin.value,
609
+ "position": position.value,
610
+ "align": align.value,
611
+ "offset": offset2.value,
612
+ "shiftOffset": shiftOffset == null ? void 0 : shiftOffset.value,
613
+ "onPositionChange": handlePositionChange,
614
+ "class": classes.value,
615
+ "style": styles.value
616
+ }, {
617
+ default: () => {
618
+ var _a;
619
+ return [createVNode("div", mergeProps({
620
+ "ref": dropdownRef,
621
+ "class": ns2.e("menu-wrap")
622
+ }, attrs), [(_a = slots.menu) == null ? void 0 : _a.call(slots)])];
623
+ }
624
+ }), [[vShow, overlayShowValue.value]])]
625
+ })]
626
+ })]);
627
+ }
628
+ });
629
+ const dropdownMenuProps = {
630
+ modelValue: {
631
+ type: Boolean,
632
+ default: false
633
+ },
634
+ origin: {
635
+ type: Object,
636
+ require: true
637
+ },
638
+ position: {
639
+ type: Array,
640
+ default: ["bottom"]
641
+ },
642
+ align: {
643
+ type: String,
644
+ default: null
645
+ },
646
+ offset: {
647
+ type: [Number, Object],
648
+ default: 4
649
+ },
650
+ clickOutside: {
651
+ type: Function,
652
+ default: () => true
653
+ },
654
+ showAnimation: {
655
+ type: Boolean,
656
+ default: true
657
+ },
658
+ overlayClass: {
659
+ type: String,
660
+ default: ""
661
+ }
662
+ };
663
+ var DropdownMenu = defineComponent({
664
+ name: "DDropdownMenu",
665
+ inheritAttrs: false,
666
+ props: dropdownMenuProps,
667
+ emits: ["update:modelValue"],
668
+ setup(props, {
669
+ slots,
670
+ attrs,
671
+ emit
672
+ }) {
673
+ const {
674
+ modelValue,
675
+ origin,
676
+ position,
677
+ align,
678
+ offset: offset2,
679
+ clickOutside,
680
+ showAnimation,
681
+ overlayClass
682
+ } = toRefs(props);
683
+ const dropdownMenuRef = ref(null);
684
+ const ns2 = useNamespace("dropdown");
685
+ onClickOutside(dropdownMenuRef, (value) => {
686
+ var _a, _b;
687
+ if (((_a = clickOutside.value) == null ? void 0 : _a.call(clickOutside)) && !((_b = origin == null ? void 0 : origin.value) == null ? void 0 : _b.contains(value.target))) {
688
+ emit("update:modelValue", false);
689
+ }
690
+ });
691
+ const currentPosition = ref("bottom");
692
+ const handlePositionChange = (pos) => {
693
+ currentPosition.value = pos.split("-")[0] === "top" ? "top" : "bottom";
694
+ };
695
+ const styles = computed(() => ({
696
+ transformOrigin: currentPosition.value === "top" ? "0% 100%" : "0% 0%"
697
+ }));
698
+ return () => createVNode(Teleport, {
699
+ "to": "body"
700
+ }, {
701
+ default: () => [createVNode(Transition, {
702
+ "name": showAnimation.value ? ns2.m(`fade-${currentPosition.value}`) : ""
703
+ }, {
704
+ default: () => [createVNode(FlexibleOverlay, {
705
+ "modelValue": modelValue.value,
706
+ "onUpdate:modelValue": ($event) => modelValue.value = $event,
707
+ "origin": origin == null ? void 0 : origin.value,
708
+ "position": position.value,
709
+ "align": align.value,
710
+ "offset": offset2.value,
711
+ "onPositionChange": handlePositionChange,
712
+ "class": overlayClass.value,
713
+ "style": styles.value
714
+ }, {
715
+ default: () => {
716
+ var _a;
717
+ return [createVNode("div", mergeProps({
718
+ "ref": dropdownMenuRef,
719
+ "class": ns2.e("menu-wrap")
720
+ }, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots)])];
721
+ }
722
+ })]
723
+ })]
724
+ });
725
+ }
726
+ });
727
+ var index = {
728
+ title: "Dropdown \u4E0B\u62C9\u83DC\u5355",
729
+ category: "\u5BFC\u822A",
730
+ status: "50%",
731
+ install(app) {
732
+ app.component(Dropdown.name, Dropdown);
733
+ app.component(DropdownMenu.name, DropdownMenu);
734
+ }
735
+ };
736
+ export { Dropdown, DropdownMenu, index as default, dropdownMenuProps };