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
@@ -1,544 +1,991 @@
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, Fragment, Teleport, Transition, renderSlot, isVNode, computed, onMounted, watch, onUnmounted, withDirectives, vShow, ref, reactive, getCurrentInstance, nextTick, toRef, onBeforeUnmount, isRef, toRefs, provide, inject } from "vue";
21
- var editableSelect = "";
1
+ import { defineComponent, ref, createVNode, h, render, computed, nextTick, watch, onUnmounted, unref, mergeProps, reactive, getCurrentInstance, withDirectives, withModifiers, resolveComponent, Teleport, Transition, vShow, resolveDirective } from "vue";
2
+ import { offset, autoPlacement, arrow, shift, computePosition } from "@floating-ui/dom";
22
3
  const editableSelectProps = {
23
- width: {
24
- type: Number,
25
- default: 450
4
+ modelValue: {
5
+ type: String,
6
+ default: ""
26
7
  },
27
- appendToBody: {
28
- type: Boolean,
29
- default: true
8
+ options: {
9
+ type: Array,
10
+ default: () => []
30
11
  },
31
- maxHeight: {
32
- type: Number,
33
- default: 300
34
- },
35
- disabled: {
12
+ allowClear: {
36
13
  type: Boolean,
37
14
  default: false
38
15
  },
39
- modelValue: {
40
- type: [String, Number, Array]
16
+ disabled: {
17
+ type: Boolean
41
18
  },
42
- "onUpdate:modelValue": {
43
- type: Function
44
- }
45
- };
46
- const selectKey = "DSelect";
47
- var Icon = defineComponent({
48
- name: "DIcon",
49
- props: {
50
- name: {
51
- type: String,
52
- required: true
53
- },
54
- size: {
55
- type: String,
56
- default: "inherit"
57
- },
58
- color: {
59
- type: String,
60
- default: "inherit"
61
- },
62
- classPrefix: {
63
- type: String,
64
- default: "icon"
65
- }
19
+ disabledKey: {
20
+ type: String,
21
+ default: ""
66
22
  },
67
- setup(props) {
68
- return __spreadValues({}, props);
23
+ placeholder: {
24
+ type: String,
25
+ default: "Search"
69
26
  },
70
- render() {
71
- const {
72
- name,
73
- size,
74
- color,
75
- classPrefix
76
- } = this;
77
- return createVNode(Fragment, null, [/^((https?):)?\/\//.test(name) ? createVNode("img", {
78
- "src": name,
79
- "alt": name.split("/")[name.split("/").length - 1],
80
- "style": {
81
- width: size
82
- }
83
- }, null) : createVNode("i", {
84
- "class": `${classPrefix} ${classPrefix}-${name}`,
85
- "style": {
86
- fontSize: size,
87
- color
88
- }
89
- }, null)]);
90
- }
91
- });
92
- Icon.install = function(app) {
93
- app.component(Icon.name, Icon);
94
- };
95
- var overlay = "";
96
- function _isSlot(s) {
97
- return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
98
- }
99
- const CommonOverlay = defineComponent({
100
- setup(props, ctx) {
101
- return () => {
102
- let _slot;
103
- return createVNode(Teleport, {
104
- "to": "#d-overlay-anchor"
105
- }, {
106
- default: () => [createVNode(Transition, {
107
- "name": "devui-overlay-fade"
108
- }, _isSlot(_slot = renderSlot(ctx.slots, "default")) ? _slot : {
109
- default: () => [_slot]
110
- })]
111
- });
112
- };
113
- }
114
- });
115
- const overlayProps = {
116
- visible: {
117
- type: Boolean
27
+ width: {
28
+ type: Number
118
29
  },
119
- "onUpdate:visible": {
120
- type: Function
30
+ maxHeight: {
31
+ type: Number
121
32
  },
122
- backgroundBlock: {
33
+ loading: {
34
+ type: Boolean
35
+ },
36
+ enableLazyLoad: {
123
37
  type: Boolean,
124
38
  default: false
125
39
  },
126
- backgroundClass: {
127
- type: String,
128
- default: ""
129
- },
130
- backgroundStyle: {
131
- type: [String, Object]
132
- },
133
- backdropClick: {
40
+ searchFn: {
134
41
  type: Function
135
42
  },
136
- backdropClose: {
137
- type: Boolean,
138
- default: true
43
+ filterOption: {
44
+ type: [Function, Boolean]
139
45
  }
140
46
  };
141
- function useOverlayLogic(props) {
142
- const backgroundClass = computed(() => {
143
- return ["devui-overlay-background", "devui-overlay-background__color", props.backgroundClass];
144
- });
145
- const overlayClass = computed(() => {
146
- return "devui-overlay";
147
- });
148
- const handleBackdropClick = (event) => {
149
- var _a, _b;
150
- event.preventDefault();
151
- (_a = props.backdropClick) == null ? void 0 : _a.call(props);
152
- if (props.backdropClose) {
153
- (_b = props["onUpdate:visible"]) == null ? void 0 : _b.call(props, false);
47
+ const inBrowser = typeof window !== "undefined";
48
+ function on(element, eventName, handler) {
49
+ if (document.addEventListener) {
50
+ if (element && eventName && handler) {
51
+ element.addEventListener(eventName, handler, false);
154
52
  }
155
- };
156
- const handleOverlayBubbleCancel = (event) => event.cancelBubble = true;
157
- onMounted(() => {
158
- const body = document.body;
159
- const originOverflow = body.style.overflow;
160
- const originPosition = body.style.position;
161
- watch([() => props.visible, () => props.backgroundBlock], ([visible, backgroundBlock]) => {
162
- if (backgroundBlock) {
163
- const top = body.getBoundingClientRect().y;
164
- if (visible) {
165
- body.style.overflowY = "scroll";
166
- body.style.position = visible ? "fixed" : "";
167
- body.style.top = `${top}px`;
168
- } else {
169
- body.style.overflowY = originOverflow;
170
- body.style.position = originPosition;
171
- body.style.top = "";
172
- window.scrollTo(0, -top);
173
- }
174
- }
175
- });
176
- onUnmounted(() => {
177
- document.body.style.overflow = originOverflow;
178
- });
179
- });
180
- return {
181
- backgroundClass,
182
- overlayClass,
183
- handleBackdropClick,
184
- handleOverlayBubbleCancel
185
- };
186
- }
187
- const FixedOverlay = defineComponent({
188
- name: "DFixedOverlay",
189
- props: __spreadProps(__spreadValues({}, overlayProps), {
190
- overlayStyle: {
191
- type: Object,
192
- default: void 0
53
+ } else {
54
+ if (element && eventName && handler) {
55
+ element.attachEvent("on" + eventName, handler);
193
56
  }
194
- }),
195
- setup(props, ctx) {
196
- const {
197
- backgroundClass,
198
- overlayClass,
199
- handleBackdropClick,
200
- handleOverlayBubbleCancel
201
- } = useOverlayLogic(props);
202
- return () => createVNode(CommonOverlay, null, {
203
- default: () => [withDirectives(createVNode("div", {
204
- "class": backgroundClass.value,
205
- "style": props.backgroundStyle,
206
- "onClick": handleBackdropClick
207
- }, [createVNode("div", {
208
- "class": overlayClass.value,
209
- "style": props.overlayStyle,
210
- "onClick": handleOverlayBubbleCancel
211
- }, [renderSlot(ctx.slots, "default")])]), [[vShow, props.visible]])]
212
- });
213
57
  }
214
- });
215
- const FlexibleOverlay = defineComponent({
216
- name: "DFlexibleOverlay",
217
- props: __spreadValues({
218
- origin: {
219
- type: Object,
220
- require: true
221
- },
222
- position: {
223
- type: Object,
224
- default: () => ({
225
- originX: "left",
226
- originY: "top",
227
- overlayX: "left",
228
- overlayY: "top"
229
- })
230
- }
231
- }, overlayProps),
232
- emits: ["onUpdate:visible"],
233
- setup(props, ctx) {
234
- const overlayRef = ref(null);
235
- const positionedStyle = reactive({
236
- position: "absolute"
58
+ }
59
+ const ctx = Symbol("@@clickoutside");
60
+ const nodeList = /* @__PURE__ */ new Map();
61
+ let startClick;
62
+ let nid = 0;
63
+ let isFirst = true;
64
+ function createDocumentHandler(el, binding, vnode) {
65
+ if (inBrowser && isFirst) {
66
+ isFirst = false;
67
+ on(document, "mousedown", (e) => {
68
+ startClick = e;
237
69
  });
238
- const instance = getCurrentInstance();
239
- onMounted(async () => {
240
- await nextTick();
241
- const overlay2 = overlayRef.value;
242
- if (!overlay2) {
243
- return;
244
- }
245
- const origin = getOrigin(props.origin);
246
- if (!origin) {
247
- return;
248
- }
249
- const handleRectChange = (rect) => {
250
- const point = calculatePosition(props.position, rect, origin);
251
- positionedStyle.left = `${point.x}px`;
252
- positionedStyle.top = `${point.y}px`;
253
- };
254
- const handleChange = () => handleRectChange(overlay2.getBoundingClientRect());
255
- watch(toRef(props, "visible"), (visible, ov, onInvalidate) => {
256
- if (visible) {
257
- subscribeLayoutEvent(handleChange);
258
- } else {
259
- unsbscribeLayoutEvent(handleChange);
260
- }
261
- onInvalidate(() => {
262
- unsbscribeLayoutEvent(handleChange);
263
- });
264
- });
265
- watch(toRef(props, "position"), () => {
266
- handleChange();
267
- });
268
- const resizeObserver = new ResizeObserver((entries) => {
269
- handleRectChange(entries[0].contentRect);
270
- });
271
- resizeObserver.observe(overlay2);
272
- onBeforeUnmount(() => {
273
- resizeObserver.disconnect();
274
- }, instance);
275
- if (origin instanceof Element) {
276
- const observer = new MutationObserver(handleChange);
277
- observer.observe(origin, {
278
- attributeFilter: ["style"]
279
- });
280
- onBeforeUnmount(() => {
281
- observer.disconnect();
282
- }, instance);
70
+ on(document, "mouseup", (e) => {
71
+ for (const [id, node] of nodeList) {
72
+ node[ctx].documentHandler(e, startClick);
283
73
  }
284
- }, instance);
285
- const {
286
- backgroundClass,
287
- overlayClass,
288
- handleBackdropClick,
289
- handleOverlayBubbleCancel
290
- } = useOverlayLogic(props);
291
- return () => createVNode(CommonOverlay, null, {
292
- default: () => [withDirectives(createVNode("div", {
293
- "class": backgroundClass.value,
294
- "onClick": handleBackdropClick
295
- }, [createVNode("div", {
296
- "ref": overlayRef,
297
- "class": overlayClass.value,
298
- "style": positionedStyle,
299
- "onClick": handleOverlayBubbleCancel
300
- }, [renderSlot(ctx.slots, "default")])]), [[vShow, props.visible]])]
301
74
  });
302
75
  }
303
- });
304
- function getElement(element) {
305
- if (element instanceof Element) {
306
- return element;
76
+ return function(mouseup, mousedown) {
77
+ if (!vnode || !binding.instance || !mouseup.target || !mousedown.target || el.contains(mouseup.target) || el.contains(mousedown.target) || el === mouseup.target) {
78
+ return;
79
+ }
80
+ el[ctx].bindingFn && el[ctx].bindingFn();
81
+ };
82
+ }
83
+ const clickoutsideDirective = {
84
+ beforeMount: function(el, binding, vnode) {
85
+ nid++;
86
+ nodeList.set(nid, el);
87
+ el[ctx] = {
88
+ nid,
89
+ documentHandler: createDocumentHandler(el, binding, vnode),
90
+ bindingFn: binding.value
91
+ };
92
+ },
93
+ updated: function(el, binding, vnode) {
94
+ el[ctx].documentHandler = createDocumentHandler(el, binding, vnode);
95
+ el[ctx].bindingFn = binding.value;
96
+ },
97
+ unmounted: function(el) {
98
+ nodeList.delete(el[ctx].nid);
99
+ delete el[ctx];
307
100
  }
308
- if (element && typeof element === "object" && element.$el instanceof Element) {
309
- return element.$el;
101
+ };
102
+ class View {
103
+ constructor() {
104
+ this.top = "50%";
105
+ this.left = "50%";
310
106
  }
311
- return null;
312
107
  }
313
- function getOrigin(origin) {
314
- if (origin instanceof Element) {
315
- return origin;
108
+ const loadingProps = {
109
+ message: String,
110
+ backdrop: Boolean,
111
+ view: {
112
+ type: Object,
113
+ default: () => new View()
114
+ },
115
+ zIndex: Number,
116
+ isFull: {
117
+ type: Boolean,
118
+ default: false
316
119
  }
317
- if (isRef(origin)) {
318
- return getElement(origin.value);
120
+ };
121
+ class LoadingOptions {
122
+ constructor() {
123
+ this.backdrop = true;
124
+ this.positionType = "relative";
125
+ this.view = new View();
319
126
  }
320
- return origin;
321
127
  }
322
- function calculatePosition(position, panelOrRect, origin) {
323
- const originRect = getOriginRect(origin);
324
- const originPoint = getOriginRelativePoint(originRect, position);
325
- let rect;
326
- if (panelOrRect instanceof HTMLElement) {
327
- rect = panelOrRect.getBoundingClientRect();
328
- } else {
329
- rect = panelOrRect;
128
+ function createBem(namespace, element, modifier) {
129
+ let cls = namespace;
130
+ if (element) {
131
+ cls += `__${element}`;
330
132
  }
331
- return getOverlayPoint(originPoint, rect, position);
332
- }
333
- function getOriginRect(origin) {
334
- if (origin instanceof Element) {
335
- return origin.getBoundingClientRect();
133
+ if (modifier) {
134
+ cls += `--${modifier}`;
336
135
  }
337
- const width = origin.width || 0;
338
- const height = origin.height || 0;
136
+ return cls;
137
+ }
138
+ function useNamespace(block, needDot = false) {
139
+ const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
140
+ const b = () => createBem(namespace);
141
+ const e = (element) => element ? createBem(namespace, element) : "";
142
+ const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
143
+ const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
339
144
  return {
340
- top: origin.y,
341
- bottom: origin.y + height,
342
- left: origin.x,
343
- right: origin.x + width,
344
- height,
345
- width
145
+ b,
146
+ e,
147
+ m,
148
+ em
346
149
  };
347
150
  }
348
- function getOverlayPoint(originPoint, rect, position) {
349
- let x;
350
- const {
351
- width,
352
- height
353
- } = rect;
354
- if (position.overlayX == "center") {
355
- x = originPoint.x - width / 2;
356
- } else {
357
- x = position.overlayX == "left" ? originPoint.x : originPoint.x - width;
151
+ var loading = "";
152
+ var Loading = defineComponent({
153
+ name: "DLoading",
154
+ inheritAttrs: false,
155
+ props: loadingProps,
156
+ setup(props) {
157
+ const style = {
158
+ top: props.view.top,
159
+ left: props.view.left,
160
+ zIndex: props.zIndex
161
+ };
162
+ if (!props.message) {
163
+ style.background = "none";
164
+ }
165
+ const isShow = ref(false);
166
+ const open = () => {
167
+ isShow.value = true;
168
+ };
169
+ const close = () => {
170
+ isShow.value = false;
171
+ };
172
+ return {
173
+ style,
174
+ isShow,
175
+ open,
176
+ close
177
+ };
178
+ },
179
+ render() {
180
+ var _a;
181
+ const {
182
+ isShow,
183
+ isFull,
184
+ backdrop,
185
+ style,
186
+ message,
187
+ $slots
188
+ } = this;
189
+ const ns = useNamespace("loading");
190
+ return isShow && createVNode("div", {
191
+ "class": [ns.b(), isFull ? ns.m("full") : ""]
192
+ }, [((_a = $slots.default) == null ? void 0 : _a.call($slots)) || createVNode("div", {
193
+ "class": ns.e("wrapper")
194
+ }, [backdrop ? createVNode("div", {
195
+ "class": ns.e("mask")
196
+ }, null) : null, createVNode("div", {
197
+ "style": style,
198
+ "class": ns.e("area")
199
+ }, [createVNode("div", {
200
+ "class": ns.e("busy-default-spinner")
201
+ }, [createVNode("div", {
202
+ "class": ns.e("bar1")
203
+ }, null), createVNode("div", {
204
+ "class": ns.e("bar2")
205
+ }, null), createVNode("div", {
206
+ "class": ns.e("bar3")
207
+ }, null), createVNode("div", {
208
+ "class": ns.e("bar4")
209
+ }, null)]), message ? createVNode("span", {
210
+ "class": ns.e("text")
211
+ }, [message]) : null])])]);
358
212
  }
359
- let y;
360
- if (position.overlayY == "center") {
361
- y = originPoint.y - height / 2;
213
+ });
214
+ const COMPONENT_CONTAINER_SYMBOL = Symbol("dev_component_container");
215
+ function createComponent(component, props, children = null) {
216
+ const vnode = h(component, { ...props }, children);
217
+ const container = document.createElement("div");
218
+ vnode[COMPONENT_CONTAINER_SYMBOL] = container;
219
+ render(vnode, container);
220
+ return vnode.component;
221
+ }
222
+ function unmountComponent(ComponnetInstance) {
223
+ render(null, ComponnetInstance == null ? void 0 : ComponnetInstance.vnode[COMPONENT_CONTAINER_SYMBOL]);
224
+ }
225
+ const loadingConstructor = defineComponent(Loading);
226
+ const cacheInstance = /* @__PURE__ */ new WeakSet();
227
+ const isEmpty = (val) => {
228
+ if (!val) {
229
+ return true;
230
+ }
231
+ if (Array.isArray(val)) {
232
+ return val.length === 0;
233
+ }
234
+ if (val instanceof Set || val instanceof Map) {
235
+ return val.size === 0;
236
+ }
237
+ if (val instanceof Promise) {
238
+ return false;
239
+ }
240
+ if (typeof val === "object") {
241
+ try {
242
+ return Object.keys(val).length === 0;
243
+ } catch (e) {
244
+ return false;
245
+ }
246
+ }
247
+ return false;
248
+ };
249
+ const getType = (vari) => {
250
+ return Object.prototype.toString.call(vari).slice(8, -1).toLowerCase();
251
+ };
252
+ const isPromise = (value) => {
253
+ const type = getType(value);
254
+ switch (type) {
255
+ case "promise":
256
+ return [value];
257
+ case "array":
258
+ if (value.some((val) => getType(val) !== "promise")) {
259
+ console.error(new TypeError("Binding values should all be of type Promise"));
260
+ return "error";
261
+ }
262
+ return value;
263
+ default:
264
+ return false;
265
+ }
266
+ };
267
+ const unmount = (el) => {
268
+ cacheInstance.delete(el);
269
+ el.instance.proxy.close();
270
+ unmountComponent(el.instance);
271
+ };
272
+ const toggleLoading = (el, binding) => {
273
+ var _a, _b, _c;
274
+ if (binding.value) {
275
+ const vals = isPromise(binding.value);
276
+ if (vals === "error") {
277
+ return;
278
+ }
279
+ (_c = (_b = (_a = el == null ? void 0 : el.instance) == null ? void 0 : _a.proxy) == null ? void 0 : _b.open) == null ? void 0 : _c.call(_b);
280
+ el.appendChild(el.mask);
281
+ cacheInstance.add(el);
282
+ if (vals) {
283
+ Promise.all(vals).catch((err) => {
284
+ console.error(new Error("Promise handling errors"), err);
285
+ }).finally(() => {
286
+ unmount(el);
287
+ });
288
+ }
362
289
  } else {
363
- y = position.overlayY == "top" ? originPoint.y : originPoint.y - height;
290
+ unmount(el);
364
291
  }
365
- return {
366
- x,
367
- y
292
+ };
293
+ const removeAttribute = (el) => {
294
+ el.removeAttribute("zindex");
295
+ el.removeAttribute("positiontype");
296
+ el.removeAttribute("backdrop");
297
+ el.removeAttribute("message");
298
+ el.removeAttribute("view");
299
+ el.removeAttribute("loadingtemplateref");
300
+ };
301
+ const handleProps = (el, vprops) => {
302
+ var _a;
303
+ const props = {
304
+ ...new LoadingOptions(),
305
+ ...vprops
368
306
  };
369
- }
370
- function getOriginRelativePoint(originRect, position) {
371
- let x;
372
- if (position.originX == "center") {
373
- x = originRect.left + originRect.width / 2;
374
- } else {
375
- const startX = originRect.left;
376
- const endX = originRect.right;
377
- x = position.originX == "left" ? startX : endX;
307
+ const loadingTemplateRef = props.loadingTemplateRef;
308
+ const loadingInstance = createComponent(loadingConstructor, { ...props }, loadingTemplateRef ? () => loadingTemplateRef : null);
309
+ el.style.position = props.positionType;
310
+ el.options = props;
311
+ el.instance = loadingInstance;
312
+ el.mask = (_a = loadingInstance == null ? void 0 : loadingInstance.proxy) == null ? void 0 : _a.$el;
313
+ };
314
+ const loadingDirective = {
315
+ mounted: function(el, binding, vnode) {
316
+ handleProps(el, vnode.props);
317
+ removeAttribute(el);
318
+ !isEmpty(binding.value) && toggleLoading(el, binding);
319
+ },
320
+ updated: function(el, binding, vnode) {
321
+ if (!isEmpty(binding.value) && cacheInstance.has(el) || isEmpty(binding.value) && !cacheInstance.has(el)) {
322
+ return;
323
+ }
324
+ !cacheInstance.has(el) && handleProps(el, vnode.props);
325
+ removeAttribute(el);
326
+ toggleLoading(el, binding);
378
327
  }
379
- let y;
380
- if (position.originY == "center") {
381
- y = originRect.top + originRect.height / 2;
382
- } else {
383
- y = position.originY == "top" ? originRect.top : originRect.bottom;
328
+ };
329
+ function className(classStr, classOpt) {
330
+ let classname = classStr;
331
+ if (typeof classOpt === "object") {
332
+ Object.keys(classOpt).forEach((key) => {
333
+ classOpt[key] && (classname += ` ${key}`);
334
+ });
384
335
  }
336
+ return classname;
337
+ }
338
+ var editableSelect = "";
339
+ function useSelect(props) {
340
+ const normalizeOptions = computed(() => {
341
+ return props.options.map((option) => {
342
+ let res;
343
+ if (option !== "null" && typeof option === "object") {
344
+ res = {
345
+ ...option,
346
+ label: option.label || "",
347
+ value: option.value !== void 0 ? option.value : option.label || ""
348
+ };
349
+ } else {
350
+ res = {
351
+ label: String(option),
352
+ value: option
353
+ };
354
+ }
355
+ return res;
356
+ });
357
+ });
358
+ return { normalizeOptions };
359
+ }
360
+ function useFilterOptions(enableLazyLoad, normalizeOptions, inputValue, searchFn) {
361
+ const filteredOptions = computed(() => {
362
+ if (!inputValue.value || enableLazyLoad) {
363
+ return normalizeOptions.value;
364
+ }
365
+ return normalizeOptions.value.filter((option) => {
366
+ return searchFn(option, inputValue.value);
367
+ });
368
+ });
369
+ return { filteredOptions };
370
+ }
371
+ function useInput(inputValue, ctx2) {
372
+ const onInputChange = (value) => {
373
+ ctx2.emit("search", value);
374
+ };
375
+ const handleInput = (event) => {
376
+ const value = event.target.value;
377
+ inputValue.value = value;
378
+ onInputChange(value);
379
+ };
385
380
  return {
386
- x,
387
- y
381
+ handleInput
388
382
  };
389
383
  }
390
- function subscribeLayoutEvent(event) {
391
- window.addEventListener("scroll", event, true);
392
- window.addEventListener("resize", event);
393
- window.addEventListener("orientationchange", event);
384
+ function useLazyLoad(dropdownRef, enableLazyLoad, ctx2) {
385
+ const loadMore = () => {
386
+ const dropdownVal = dropdownRef.value;
387
+ if (!enableLazyLoad) {
388
+ return;
389
+ }
390
+ if (dropdownVal.clientHeight + dropdownVal.scrollTop >= dropdownVal.scrollHeight) {
391
+ ctx2.emit("loadMore");
392
+ }
393
+ };
394
+ return { loadMore };
394
395
  }
395
- function unsbscribeLayoutEvent(event) {
396
- window.removeEventListener("scroll", event, true);
397
- window.removeEventListener("resize", event);
398
- window.removeEventListener("orientationchange", event);
396
+ function useKeyboardSelect(dropdownRef, visible, inputValue, cacheInput, filteredOptions, optionDisabledKey, filterOption, loading2, handleClick, closeMenu, toggleMenu) {
397
+ const hoverIndex = ref(0);
398
+ const selectedIndex = ref(0);
399
+ const updateHoveringIndex = (index2) => {
400
+ hoverIndex.value = index2;
401
+ };
402
+ const scrollToItem = (index2) => {
403
+ const ul = dropdownRef.value;
404
+ const li = ul.children[index2];
405
+ nextTick(() => {
406
+ if (li.scrollIntoViewIfNeeded) {
407
+ li.scrollIntoViewIfNeeded(false);
408
+ } else {
409
+ const containerInfo = ul.getBoundingClientRect();
410
+ const elementInfo = li.getBoundingClientRect();
411
+ if (elementInfo.bottom > containerInfo.bottom || elementInfo.top < containerInfo.top) {
412
+ li.scrollIntoView(false);
413
+ }
414
+ }
415
+ });
416
+ };
417
+ const handleEscape = () => {
418
+ inputValue.value = cacheInput.value;
419
+ closeMenu();
420
+ };
421
+ const handleEnter = () => {
422
+ const len = filteredOptions.value.length;
423
+ if (!visible.value || !len) {
424
+ return toggleMenu();
425
+ }
426
+ len && len === 1 ? handleClick(filteredOptions.value[0], 1) : handleClick(filteredOptions.value[hoverIndex.value], hoverIndex.value);
427
+ return closeMenu();
428
+ };
429
+ const handleKeyboardNavigation = (direction) => {
430
+ const len = filteredOptions.value.length;
431
+ if (!len || len === 1) {
432
+ return;
433
+ }
434
+ if (!["ArrowDown", "ArrowUp"].includes(direction)) {
435
+ return;
436
+ }
437
+ if (filterOption === false && loading2.value) {
438
+ return;
439
+ }
440
+ let newIndex = 0;
441
+ newIndex = hoverIndex.value;
442
+ if (direction === "ArrowUp") {
443
+ newIndex -= 1;
444
+ if (newIndex === -1) {
445
+ newIndex = len - 1;
446
+ }
447
+ } else if (direction === "ArrowDown") {
448
+ newIndex += 1;
449
+ if (newIndex === len) {
450
+ newIndex = 0;
451
+ }
452
+ }
453
+ hoverIndex.value = newIndex;
454
+ const option = filteredOptions.value[newIndex];
455
+ if (option[optionDisabledKey]) {
456
+ return handleKeyboardNavigation(direction);
457
+ }
458
+ updateHoveringIndex(newIndex);
459
+ scrollToItem(newIndex);
460
+ };
461
+ const handleKeydown = (event) => {
462
+ const keyCode = event.key || event.code;
463
+ switch (keyCode) {
464
+ case "Escape":
465
+ handleEscape();
466
+ break;
467
+ case "Enter":
468
+ handleEnter();
469
+ break;
470
+ default:
471
+ handleKeyboardNavigation(keyCode);
472
+ }
473
+ };
474
+ return { handleKeydown, hoverIndex, selectedIndex };
399
475
  }
400
- FlexibleOverlay.install = function(app) {
401
- app.component(FlexibleOverlay.name, FlexibleOverlay);
402
- };
403
- FixedOverlay.install = function(app) {
404
- app.component(FixedOverlay.name, FixedOverlay);
476
+ const flexibleOverlayProps = {
477
+ modelValue: {
478
+ type: Boolean,
479
+ default: false
480
+ },
481
+ origin: {
482
+ type: Object,
483
+ require: true
484
+ },
485
+ position: {
486
+ type: Array,
487
+ default: ["bottom"]
488
+ },
489
+ offset: {
490
+ type: [Number, Object],
491
+ default: 8
492
+ },
493
+ shiftOffset: {
494
+ type: Number
495
+ },
496
+ align: {
497
+ type: String,
498
+ default: null
499
+ },
500
+ showArrow: {
501
+ type: Boolean,
502
+ default: false
503
+ },
504
+ isArrowCenter: {
505
+ type: Boolean,
506
+ default: true
507
+ }
405
508
  };
406
- function useSelectStates() {
407
- return reactive({
408
- visible: false,
409
- origin: ref(null),
410
- position: {
411
- originX: "left",
412
- originY: "bottom",
413
- overlayX: "left",
414
- overlayY: "top"
509
+ function getScrollParent(element) {
510
+ const overflowRegex = /(auto|scroll|hidden)/;
511
+ for (let parent = element; parent = parent.parentElement; parent.parentElement !== document.body) {
512
+ const style = window.getComputedStyle(parent);
513
+ if (overflowRegex.test(style.overflow + style.overflowX + style.overflowY)) {
514
+ return parent;
415
515
  }
416
- });
516
+ }
517
+ return window;
417
518
  }
418
- function useSelect(props, ctx, states) {
419
- const selectDisabled = computed(() => props.disabled);
420
- const toggleMenu = () => {
421
- if (!selectDisabled.value) {
422
- states.visible = !states.visible;
519
+ function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
520
+ let { x, y } = point;
521
+ if (!isArrowCenter) {
522
+ const { width, height } = originRect;
523
+ if (x && placement.includes("start")) {
524
+ x = 12;
525
+ }
526
+ if (x && placement.includes("end")) {
527
+ x = Math.round(width - 24);
528
+ }
529
+ if (y && placement.includes("start")) {
530
+ y = 10;
423
531
  }
532
+ if (y && placement.includes("end")) {
533
+ y = height - 14;
534
+ }
535
+ }
536
+ return { x, y };
537
+ }
538
+ function useOverlay(props, emit) {
539
+ const overlayRef = ref();
540
+ const arrowRef = ref();
541
+ let originParent = null;
542
+ const updateArrowPosition = (arrowEl, placement, point, overlayEl) => {
543
+ const { x, y } = adjustArrowPosition(props.isArrowCenter, point, placement, overlayEl.getBoundingClientRect());
544
+ const staticSide = {
545
+ top: "bottom",
546
+ right: "left",
547
+ bottom: "top",
548
+ left: "right"
549
+ }[placement.split("-")[0]];
550
+ Object.assign(arrowEl.style, {
551
+ left: x ? `${x}px` : "",
552
+ top: y ? `${y}px` : "",
553
+ right: "",
554
+ bottom: "",
555
+ [staticSide]: "-4px"
556
+ });
424
557
  };
425
- const handleOptionSelect = (optionInstance) => {
426
- ctx.emit("update:modelValue", optionInstance.proxy.label);
427
- states.visible = false;
558
+ const updatePosition = async () => {
559
+ const hostEl = props.origin;
560
+ const overlayEl = unref(overlayRef.value);
561
+ const arrowEl = unref(arrowRef.value);
562
+ const middleware = [
563
+ offset(props.offset),
564
+ autoPlacement({
565
+ alignment: props.align,
566
+ allowedPlacements: props.position
567
+ })
568
+ ];
569
+ props.showArrow && middleware.push(arrow({ element: arrowEl }));
570
+ props.shiftOffset !== void 0 && middleware.push(shift());
571
+ const { x, y, placement, middlewareData } = await computePosition(hostEl, overlayEl, {
572
+ strategy: "fixed",
573
+ middleware
574
+ });
575
+ let applyX = x;
576
+ let applyY = y;
577
+ if (props.shiftOffset !== void 0) {
578
+ const { x: shiftX, y: shiftY } = middlewareData.shift;
579
+ shiftX < 0 && (applyX -= props.shiftOffset);
580
+ shiftX > 0 && (applyX += props.shiftOffset);
581
+ shiftY < 0 && (applyY -= props.shiftOffset);
582
+ shiftY > 0 && (applyY += props.shiftOffset);
583
+ }
584
+ emit("positionChange", placement);
585
+ Object.assign(overlayEl.style, { top: `${applyY}px`, left: `${applyX}px` });
586
+ props.showArrow && updateArrowPosition(arrowEl, placement, middlewareData.arrow, overlayEl);
428
587
  };
588
+ watch(() => props.modelValue, () => {
589
+ if (props.modelValue && props.origin) {
590
+ originParent = getScrollParent(props.origin);
591
+ nextTick(updatePosition);
592
+ originParent == null ? void 0 : originParent.addEventListener("scroll", updatePosition);
593
+ originParent !== window && window.addEventListener("scroll", updatePosition);
594
+ window.addEventListener("resize", updatePosition);
595
+ } else {
596
+ originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
597
+ originParent !== window && window.removeEventListener("scroll", updatePosition);
598
+ window.removeEventListener("resize", updatePosition);
599
+ }
600
+ });
601
+ onUnmounted(() => {
602
+ originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
603
+ originParent !== window && window.removeEventListener("scroll", updatePosition);
604
+ window.removeEventListener("resize", updatePosition);
605
+ });
606
+ return { arrowRef, overlayRef, updatePosition };
607
+ }
608
+ var flexibleOverlay = "";
609
+ const FlexibleOverlay = defineComponent({
610
+ name: "DFlexibleOverlay",
611
+ inheritAttrs: false,
612
+ props: flexibleOverlayProps,
613
+ emits: ["update:modelValue", "positionChange"],
614
+ setup(props, {
615
+ slots,
616
+ attrs,
617
+ emit,
618
+ expose
619
+ }) {
620
+ const ns = useNamespace("flexible-overlay");
621
+ const {
622
+ arrowRef,
623
+ overlayRef,
624
+ updatePosition
625
+ } = useOverlay(props, emit);
626
+ expose({
627
+ updatePosition
628
+ });
629
+ return () => {
630
+ var _a;
631
+ return props.modelValue && createVNode("div", mergeProps({
632
+ "ref": overlayRef,
633
+ "class": ns.b()
634
+ }, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots), props.showArrow && createVNode("div", {
635
+ "ref": arrowRef,
636
+ "class": ns.e("arrow")
637
+ }, null)]);
638
+ };
639
+ }
640
+ });
641
+ function useCacheFilteredOptions(filteredOptions) {
642
+ const cacheFilteredOptions = computed(() => {
643
+ const map = /* @__PURE__ */ new Map();
644
+ filteredOptions.value.forEach((item) => {
645
+ map.set(item, item.value);
646
+ });
647
+ return map;
648
+ });
649
+ const getOptionValue = (option) => cacheFilteredOptions.value.get(option);
429
650
  return {
430
- toggleMenu,
431
- handleOptionSelect
651
+ getOptionValue
432
652
  };
433
653
  }
434
- function className(classStr, classOpt) {
435
- let classname = classStr;
436
- if (typeof classOpt === "object") {
437
- Object.keys(classOpt).forEach((key) => {
438
- classOpt[key] && (classname += ` ${key}`);
654
+ function deepAssign(...objects) {
655
+ const isObject = (obj) => obj && typeof obj === "object";
656
+ return objects.reduce((prev, from) => {
657
+ Object.keys(from).forEach((key) => {
658
+ const pVal = prev[key];
659
+ const oVal = from[key];
660
+ if (Array.isArray(pVal) && Array.isArray(oVal)) {
661
+ prev[key] = Array.from(/* @__PURE__ */ new Set([...oVal, ...pVal]));
662
+ } else if (isObject(pVal) && isObject(oVal)) {
663
+ prev[key] = deepAssign(pVal, oVal);
664
+ } else {
665
+ prev[key] = oVal;
666
+ }
439
667
  });
668
+ return prev;
669
+ }, {});
670
+ }
671
+ var zhCN = {
672
+ pagination: {
673
+ totalItemText: "\u6240\u6709\u6761\u76EE",
674
+ goToText: "\u8DF3\u81F3"
675
+ },
676
+ accordion: {
677
+ loading: "\u52A0\u8F7D\u4E2D",
678
+ noData: "\u6CA1\u6709\u6570\u636E"
679
+ },
680
+ autoCompleteDropdown: {
681
+ latestInput: "\u6700\u8FD1\u8F93\u5165"
682
+ },
683
+ cascaderList: {
684
+ noData: "\u6CA1\u6709\u6570\u636E"
685
+ },
686
+ colorPicker: {
687
+ foundationPanel: "\u57FA\u7840\u9762\u677F",
688
+ advancedPanel: "\u9AD8\u7EA7\u9762\u677F"
689
+ },
690
+ datePickerPro: {
691
+ ok: "\u786E\u5B9A",
692
+ placeholder: "\u8BF7\u9009\u62E9\u65E5\u671F",
693
+ month1: "1\u6708",
694
+ month2: "2\u6708",
695
+ month3: "3\u6708",
696
+ month4: "4\u6708",
697
+ month5: "5\u6708",
698
+ month6: "6\u6708",
699
+ month7: "7\u6708",
700
+ month8: "8\u6708",
701
+ month9: "9\u6708",
702
+ month10: "10\u6708",
703
+ month11: "11\u6708",
704
+ month12: "12\u6708",
705
+ year: "\u5E74",
706
+ startPlaceholder: "\u8BF7\u9009\u62E9\u5F00\u59CB\u65E5\u671F",
707
+ endPlaceholder: "\u8BF7\u9009\u62E9\u7ED3\u675F\u65E5\u671F",
708
+ getWeekDays() {
709
+ return ["\u65E5", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D"];
710
+ },
711
+ getTimeArr() {
712
+ return ["\u65F6", "\u5206", "\u79D2"];
713
+ },
714
+ getYearMonthStr(year, month) {
715
+ return `${year}\u5E74${month}\u6708`;
716
+ }
717
+ },
718
+ editableSelect: {
719
+ noRelatedRecords: "\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55",
720
+ noData: "\u6CA1\u6709\u6570\u636E"
721
+ },
722
+ input: {
723
+ placeholder: "\u8BF7\u8F93\u5165"
724
+ },
725
+ splitterBar: {
726
+ collapse: "\u6536\u8D77",
727
+ expand: "\u5C55\u5F00"
728
+ },
729
+ stepsGuide: {
730
+ previous: "\u4E0A\u4E00\u6B65",
731
+ continue: "\u6211\u77E5\u9053\u5566\uFF0C\u7EE7\u7EED",
732
+ ok: "\u6211\u77E5\u9053\u5566"
733
+ },
734
+ table: {
735
+ selectAll: "\u5168\u9009",
736
+ ok: "\u786E\u5B9A"
737
+ },
738
+ timePopup: {
739
+ ok: "\u786E\u5B9A"
740
+ },
741
+ transfer: {
742
+ unit: "\u9879",
743
+ panelUnit: "\u9879",
744
+ headerUnit: "\u9879",
745
+ noData: "\u6682\u65E0\u6570\u636E",
746
+ placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22"
747
+ },
748
+ tree: {
749
+ loading: "\u52A0\u8F7D\u4E2D",
750
+ newNode: "\u65B0\u8282\u70B9",
751
+ selectPlaceholder: "\u8BF7\u9009\u62E9"
752
+ },
753
+ upload: {
754
+ placeholder: "\u9009\u62E9\u6587\u4EF6",
755
+ getExistSameNameFilesMsg(sameNames) {
756
+ return `\u60A8\u4E0A\u4F20\u7684 "${sameNames}" \u5B58\u5728\u91CD\u540D\u6587\u4EF6, \u8BF7\u91CD\u65B0\u9009\u62E9\u6587\u4EF6`;
757
+ },
758
+ getAllFilesBeyondMaximalFileSizeMsg(maximalSize) {
759
+ return `\u6700\u5927\u652F\u6301\u4E0A\u4F20${maximalSize}MB\u7684\u6587\u4EF6, \u60A8\u672C\u6B21\u4E0A\u4F20\u7684\u6240\u6709\u6587\u4EF6\u8D85\u8FC7\u53EF\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F`;
760
+ },
761
+ getBeyondMaximalFileSizeMsg(filename, maximalSize) {
762
+ return `\u6700\u5927\u652F\u6301\u4E0A\u4F20${maximalSize}MB\u7684\u6587\u4EF6, \u60A8\u4E0A\u4F20\u7684\u6587\u4EF6"${filename}"\u8D85\u8FC7\u53EF\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F`;
763
+ },
764
+ getNotAllowedFileTypeMsg(filename, scope) {
765
+ return `\u652F\u6301\u7684\u6587\u4EF6\u7C7B\u578B: "${scope}", \u60A8\u4E0A\u4F20\u7684\u6587\u4EF6"${filename}"\u4E0D\u5728\u5141\u8BB8\u8303\u56F4\u5185\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u6587\u4EF6`;
766
+ }
767
+ },
768
+ search: {
769
+ placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u5B57"
770
+ },
771
+ select: {
772
+ placeholder: "\u8BF7\u9009\u62E9",
773
+ noDataText: "\u65E0\u6570\u636E",
774
+ noMatchText: "\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55",
775
+ loadingText: "\u52A0\u8F7D\u4E2D..."
776
+ },
777
+ tagInput: {
778
+ maxTagsText: "\u5DF2\u8FBE\u5230\u6700\u5927\u4E2A\u6570\uFF1A"
779
+ },
780
+ timeSelect: {
781
+ placeholder: "\u8BF7\u9009\u62E9\u65F6\u95F4"
440
782
  }
441
- return classname;
783
+ };
784
+ const lang = ref("zh-CN");
785
+ let langMessages = reactive({
786
+ [lang.value]: zhCN
787
+ });
788
+ const Locale = {
789
+ messages() {
790
+ return langMessages[lang.value];
791
+ },
792
+ lang() {
793
+ return lang.value;
794
+ },
795
+ use(newLang, newMessages) {
796
+ lang.value = newLang;
797
+ this.add({ [newLang]: newMessages });
798
+ },
799
+ add(newMessages = {}) {
800
+ langMessages = deepAssign(langMessages, newMessages);
801
+ }
802
+ };
803
+ const camelize = (name) => name.substring(1).replace(/^\S/, (s) => s.toLocaleLowerCase());
804
+ function get(object, path) {
805
+ const keys = path.split(".");
806
+ let result = object;
807
+ keys.forEach((key) => {
808
+ var _a;
809
+ result = (_a = result[key]) != null ? _a : "";
810
+ });
811
+ return result;
812
+ }
813
+ function createI18nTranslate(name, app, newPrefix) {
814
+ const prefix = newPrefix || camelize(name) + ".";
815
+ return (path) => {
816
+ var _a;
817
+ const messages = ((_a = app == null ? void 0 : app.appContext.config.globalProperties.langMessages) == null ? void 0 : _a.value) || Locale.messages();
818
+ const message = get(messages, prefix + path) || get(messages, path);
819
+ return message;
820
+ };
442
821
  }
443
822
  var EditableSelect = defineComponent({
444
823
  name: "DEditableSelect",
824
+ directives: {
825
+ clickOutside: clickoutsideDirective,
826
+ dLoading: loadingDirective
827
+ },
445
828
  props: editableSelectProps,
446
- emits: ["update:modelValue"],
447
- setup(props, ctx) {
448
- const states = useSelectStates();
829
+ emits: ["update:modelValue", "search", "loadMore"],
830
+ setup(props, ctx2) {
831
+ const app = getCurrentInstance();
832
+ const t = createI18nTranslate("DEditableSelect", app);
833
+ const ns = useNamespace("editable-select");
834
+ const dropdownRef = ref();
835
+ const origin = ref();
836
+ const position = ref(["bottom"]);
837
+ const visible = ref(false);
838
+ const inputValue = ref(props.modelValue);
839
+ const cacheInput = ref();
840
+ const loading2 = ref(props.loading);
841
+ const {
842
+ normalizeOptions
843
+ } = useSelect(props);
844
+ const searchFn = props.searchFn || ((option, term) => option.label.toLocaleLowerCase().includes(term.trim().toLocaleLowerCase()));
449
845
  const {
450
- origin,
451
- visible
452
- } = toRefs(states);
453
- const inputCls = className("devui-form-control devui-dropdown-origin", {
454
- disabled: props.disabled
846
+ filteredOptions
847
+ } = useFilterOptions(props.enableLazyLoad, normalizeOptions, inputValue, searchFn);
848
+ const {
849
+ getOptionValue
850
+ } = useCacheFilteredOptions(filteredOptions);
851
+ const emptyText = computed(() => {
852
+ let text;
853
+ if (props.enableLazyLoad) {
854
+ text = t("noData");
855
+ } else {
856
+ text = t("noRelatedRecords");
857
+ }
858
+ return text;
455
859
  });
860
+ watch(() => props.loading, (newVal) => {
861
+ loading2.value = newVal;
862
+ });
863
+ const toggleMenu = () => {
864
+ visible.value = !visible.value;
865
+ };
866
+ const closeMenu = () => {
867
+ visible.value = false;
868
+ };
869
+ const {
870
+ loadMore
871
+ } = useLazyLoad(dropdownRef, props.enableLazyLoad, ctx2);
872
+ const {
873
+ handleInput
874
+ } = useInput(inputValue, ctx2);
875
+ const handleClick = (option, index2, curSelectedIndex) => {
876
+ const {
877
+ disabledKey
878
+ } = props;
879
+ if (disabledKey && !!option[disabledKey]) {
880
+ return;
881
+ }
882
+ inputValue.value = option.label;
883
+ cacheInput.value = option.label;
884
+ curSelectedIndex.value = index2;
885
+ const value = getOptionValue(option);
886
+ ctx2.emit("update:modelValue", value + "");
887
+ closeMenu();
888
+ };
889
+ const handleClear = () => {
890
+ inputValue.value = "";
891
+ };
456
892
  const {
457
- toggleMenu,
458
- handleOptionSelect
459
- } = useSelect(props, ctx, states);
460
- provide(selectKey, reactive({
461
- handleOptionSelect
462
- }));
893
+ handleKeydown,
894
+ hoverIndex,
895
+ selectedIndex
896
+ } = useKeyboardSelect(dropdownRef, visible, inputValue, cacheInput, filteredOptions, props.disabledKey, props.filterOption, loading2, (option, index2) => handleClick(option, index2, selectedIndex), closeMenu, toggleMenu);
897
+ const getItemCls = (option, index2) => {
898
+ const {
899
+ disabledKey
900
+ } = props;
901
+ return className(`devui-dropdown-item`, {
902
+ disabled: disabledKey ? !!option[disabledKey] : false,
903
+ selected: index2 === selectedIndex.value,
904
+ [`${ns.em("dropdown", "bg")}`]: index2 === hoverIndex.value
905
+ });
906
+ };
463
907
  return () => {
464
- return createVNode(Fragment, null, [createVNode("div", {
465
- "class": "devui-form-group devui-has-feedback",
466
- "onClick": toggleMenu,
467
- "ref": origin
908
+ const selectCls = className(`${ns.b()} devui-form-group devui-has-feedback ${inputValue.value && props.allowClear && "allow-clear"}`, {
909
+ [`${ns.m("open")}`]: visible.value === true
910
+ });
911
+ const inputCls = className(`devui-form-control devui-dropdown-origin`, {
912
+ "devui-dropdown-origin-open": visible.value === true
913
+ });
914
+ return withDirectives(createVNode("div", {
915
+ "class": selectCls,
916
+ "ref": origin,
917
+ "style": {
918
+ width: props.width + "px"
919
+ }
468
920
  }, [createVNode("input", {
469
- "type": "text",
470
921
  "class": inputCls,
471
- "value": props.modelValue
922
+ "onClick": withModifiers(toggleMenu, ["self"]),
923
+ "onInput": handleInput,
924
+ "onKeydown": handleKeydown,
925
+ "value": inputValue.value,
926
+ "disabled": props.disabled,
927
+ "placeholder": props.placeholder,
928
+ "type": "text"
472
929
  }, null), createVNode("span", {
473
930
  "class": "devui-form-control-feedback"
474
931
  }, [createVNode("span", {
932
+ "class": "devui-select-clear-icon",
933
+ "onClick": handleClear
934
+ }, [createVNode(resolveComponent("d-icon"), {
935
+ "name": "icon-remove"
936
+ }, null)]), createVNode("span", {
475
937
  "class": "devui-select-chevron-icon"
476
- }, [createVNode(Icon, {
938
+ }, [createVNode(resolveComponent("d-icon"), {
477
939
  "name": "select-arrow"
478
- }, null)])])]), createVNode(FlexibleOverlay, {
479
- "backgroundClass": "devui-dropdown-bg",
480
- "origin": origin,
481
- "visible": visible.value,
482
- "onUpdate:visible": ($event) => visible.value = $event,
483
- "position": states.position
940
+ }, null)])]), createVNode(Teleport, {
941
+ "to": "body"
484
942
  }, {
485
- default: () => [createVNode("div", {
486
- "class": "devui-editable-select",
487
- "style": {
488
- width: props.width + "px"
489
- }
490
- }, [createVNode("div", {
491
- "class": "devui-dropdown-menu"
492
- }, [createVNode("ul", {
493
- "class": "devui-list-unstyled scroll-height",
494
- "style": {
495
- maxHeight: props.maxHeight + "px"
496
- }
497
- }, [renderSlot(ctx.slots, "default")])])])]
498
- })]);
499
- };
500
- }
501
- });
502
- var EditableSelectOption = defineComponent({
503
- name: "DEditableSelectOption",
504
- props: {
505
- label: {
506
- type: [String, Number]
507
- },
508
- disabled: {
509
- type: Boolean,
510
- default: false
511
- }
512
- },
513
- setup(props, ctx) {
514
- const optionsClassName = className("devui-dropdown-item", {
515
- disabled: props.disabled
516
- });
517
- const instance = getCurrentInstance();
518
- const select = inject(selectKey);
519
- const selectOptionClick = () => {
520
- if (!props.disabled) {
521
- select.handleOptionSelect(instance);
522
- }
523
- };
524
- return () => {
525
- return createVNode("li", {
526
- "class": optionsClassName,
527
- "onClick": selectOptionClick
528
- }, [props.label ? props.label : renderSlot(ctx.slots, "default")]);
943
+ default: () => [createVNode(Transition, {
944
+ "name": "fade"
945
+ }, {
946
+ default: () => [createVNode(FlexibleOverlay, {
947
+ "origin": origin.value,
948
+ "modelValue": visible.value,
949
+ "onUpdate:modelValue": ($event) => visible.value = $event,
950
+ "position": position.value
951
+ }, {
952
+ default: () => [createVNode("div", {
953
+ "style": {
954
+ width: props.width + "px"
955
+ },
956
+ "class": `${ns.e("menu")}`
957
+ }, [withDirectives(createVNode("div", {
958
+ "class": `devui-dropdown-menu`
959
+ }, [createVNode("ul", {
960
+ "ref": dropdownRef,
961
+ "class": `${ns.em("list", "unstyled")} devui-scrollbar scroll-height`,
962
+ "style": {
963
+ maxHeight: props.maxHeight + "px"
964
+ },
965
+ "onScroll": loadMore
966
+ }, [filteredOptions.value.map((option, index2) => {
967
+ return createVNode("li", {
968
+ "class": getItemCls(option, index2),
969
+ "onClick": (e) => {
970
+ e.stopPropagation();
971
+ handleClick(option, index2, selectedIndex);
972
+ }
973
+ }, [ctx2.slots.item ? ctx2.slots.item(option) : option.label]);
974
+ }), withDirectives(createVNode("div", {
975
+ "class": "devui-no-data-tip"
976
+ }, [ctx2.slots.noResultItem ? ctx2.slots.noResultItem(inputValue.value) : emptyText.value]), [[vShow, !filteredOptions.value.length]])])]), [[vShow, visible.value], [resolveDirective("d-loading"), props.loading]])])]
977
+ })]
978
+ })]
979
+ })]), [[resolveDirective("click-outside"), closeMenu]]);
529
980
  };
530
981
  }
531
982
  });
532
- EditableSelect.install = function(app) {
533
- app.component(EditableSelect.name, EditableSelect);
534
- app.component(EditableSelectOption.name, EditableSelectOption);
535
- };
536
983
  var index = {
537
984
  title: "EditableSelect \u53EF\u8F93\u5165\u4E0B\u62C9\u9009\u62E9\u6846",
538
985
  category: "\u6570\u636E\u5F55\u5165",
539
- status: "10%",
986
+ status: "100%",
540
987
  install(app) {
541
- app.use(EditableSelect);
988
+ app.component(EditableSelect.name, EditableSelect);
542
989
  }
543
990
  };
544
- export { EditableSelect, EditableSelectOption, index as default };
991
+ export { EditableSelect, index as default, editableSelectProps };