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

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