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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (404) hide show
  1. package/README.md +94 -118
  2. package/alert/index.es.js +74 -45
  3. package/alert/index.umd.js +1 -1
  4. package/alert/style.css +1 -1
  5. package/auto-complete/index.es.js +8395 -463
  6. package/auto-complete/index.umd.js +40 -1
  7. package/auto-complete/style.css +1 -1
  8. package/avatar/index.es.js +153 -146
  9. package/avatar/index.umd.js +1 -1
  10. package/avatar/style.css +1 -1
  11. package/badge/index.es.js +45 -20
  12. package/badge/index.umd.js +1 -1
  13. package/badge/style.css +1 -1
  14. package/button/index.es.js +5751 -156
  15. package/button/index.umd.js +27 -1
  16. package/button/style.css +1 -1
  17. package/card/index.es.js +63 -35
  18. package/card/index.umd.js +1 -1
  19. package/card/style.css +1 -1
  20. package/checkbox/index.es.js +8110 -278
  21. package/checkbox/index.umd.js +38 -1
  22. package/checkbox/style.css +1 -1
  23. package/{accordion → collapse}/index.d.ts +0 -0
  24. package/collapse/index.es.js +195 -0
  25. package/collapse/index.umd.js +1 -0
  26. package/{back-top → collapse}/package.json +1 -1
  27. package/collapse/style.css +1 -0
  28. package/countdown/index.es.js +60 -19
  29. package/countdown/index.umd.js +1 -1
  30. package/{anchor → date-picker-pro}/index.d.ts +0 -0
  31. package/date-picker-pro/index.es.js +12035 -0
  32. package/date-picker-pro/index.umd.js +38 -0
  33. package/date-picker-pro/package.json +7 -0
  34. package/date-picker-pro/style.css +1 -0
  35. package/drawer/index.es.js +191 -5756
  36. package/drawer/index.umd.js +1 -27
  37. package/drawer/style.css +1 -1
  38. package/dropdown/index.es.js +616 -415
  39. package/dropdown/index.umd.js +1 -1
  40. package/dropdown/style.css +1 -1
  41. package/editable-select/index.es.js +779 -211
  42. package/editable-select/index.umd.js +1 -1
  43. package/editable-select/style.css +1 -1
  44. package/form/index.es.js +2405 -2125
  45. package/form/index.umd.js +28 -17
  46. package/form/style.css +1 -1
  47. package/fullscreen/index.es.js +137 -134
  48. package/fullscreen/index.umd.js +1 -1
  49. package/fullscreen/style.css +1 -1
  50. package/grid/index.es.js +105 -103
  51. package/grid/index.umd.js +1 -1
  52. package/grid/style.css +1 -1
  53. package/icon/index.es.js +199 -56
  54. package/icon/index.umd.js +1 -1
  55. package/icon/style.css +1 -0
  56. package/image-preview/index.es.js +67 -54
  57. package/image-preview/index.umd.js +1 -1
  58. package/image-preview/style.css +1 -1
  59. package/input/index.es.js +8268 -144
  60. package/input/index.umd.js +38 -1
  61. package/input/style.css +1 -1
  62. package/input-number/index.es.js +260 -192
  63. package/input-number/index.umd.js +1 -1
  64. package/input-number/style.css +1 -1
  65. package/layout/index.es.js +40 -25
  66. package/layout/index.umd.js +1 -1
  67. package/layout/style.css +1 -1
  68. package/loading/index.es.js +86 -70
  69. package/loading/index.umd.js +1 -1
  70. package/loading/style.css +1 -1
  71. package/{back-top → mention}/index.d.ts +0 -0
  72. package/{color-picker → mention}/index.es.js +3036 -2898
  73. package/mention/index.umd.js +47 -0
  74. package/{anchor → mention}/package.json +1 -1
  75. package/mention/style.css +1 -0
  76. package/{breadcrumb → menu}/index.d.ts +0 -0
  77. package/menu/index.es.js +891 -0
  78. package/menu/index.umd.js +1 -0
  79. package/{toast → menu}/package.json +1 -1
  80. package/menu/style.css +1 -0
  81. package/{carousel → message}/index.d.ts +0 -0
  82. package/message/index.es.js +533 -0
  83. package/message/index.umd.js +1 -0
  84. package/{comment → message}/package.json +1 -1
  85. package/message/style.css +1 -0
  86. package/modal/index.es.js +602 -1061
  87. package/modal/index.umd.js +1 -1
  88. package/modal/style.css +1 -1
  89. package/{cascader → notification}/index.d.ts +0 -0
  90. package/notification/index.es.js +528 -0
  91. package/notification/index.umd.js +1 -0
  92. package/{accordion → notification}/package.json +1 -1
  93. package/notification/style.css +1 -0
  94. package/nuxt/components/ButtonGroup.js +3 -0
  95. package/nuxt/components/CheckboxButton.js +3 -0
  96. package/nuxt/components/CheckboxGroup.js +3 -0
  97. package/nuxt/components/Collapse.js +3 -0
  98. package/nuxt/components/CollapseItem.js +3 -0
  99. package/nuxt/components/DRangeDatePickerPro.js +3 -0
  100. package/nuxt/components/DatePickerPro.js +3 -0
  101. package/nuxt/components/DropdownMenu.js +3 -0
  102. package/nuxt/components/DropdownPropsKey.js +3 -0
  103. package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
  104. package/nuxt/components/FORM_TOKEN.js +3 -0
  105. package/nuxt/components/IFileOptions.js +3 -0
  106. package/nuxt/components/IUploadOptions.js +3 -0
  107. package/nuxt/components/Icon.js +1 -0
  108. package/nuxt/components/IconGroup.js +3 -0
  109. package/nuxt/components/LABEL_DATA.js +3 -0
  110. package/nuxt/components/LoadingOptions.js +3 -0
  111. package/nuxt/components/Mention.js +3 -0
  112. package/nuxt/components/Menu.js +3 -0
  113. package/nuxt/components/MenuItem.js +3 -0
  114. package/nuxt/components/Message.js +3 -0
  115. package/nuxt/components/Notification.js +3 -0
  116. package/nuxt/components/NotificationService.js +3 -0
  117. package/nuxt/components/Option.js +3 -0
  118. package/nuxt/components/OptionGroup.js +3 -0
  119. package/nuxt/components/PanelBody.js +3 -0
  120. package/nuxt/components/PanelFooter.js +3 -0
  121. package/nuxt/components/PanelHeader.js +3 -0
  122. package/nuxt/components/RadioButton.js +3 -0
  123. package/nuxt/components/Step.js +3 -0
  124. package/nuxt/components/Steps.js +3 -0
  125. package/nuxt/components/SubMenu.js +3 -0
  126. package/nuxt/components/TABLE_TOKEN.js +3 -0
  127. package/nuxt/components/Tab.js +3 -0
  128. package/nuxt/components/TimeSelect.js +3 -0
  129. package/nuxt/components/Timeline.js +3 -0
  130. package/nuxt/components/TimelineItem.js +3 -0
  131. package/nuxt/components/UploadStatus.js +3 -0
  132. package/nuxt/components/alertProps.js +3 -0
  133. package/nuxt/components/animationInjectionKey.js +3 -0
  134. package/nuxt/components/autoCompleteProps.js +3 -0
  135. package/nuxt/components/avatarProps.js +3 -0
  136. package/nuxt/components/badgeProps.js +3 -0
  137. package/nuxt/components/buttonGroupInjectionKey.js +3 -0
  138. package/nuxt/components/buttonGroupProps.js +3 -0
  139. package/nuxt/components/cardProps.js +3 -0
  140. package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
  141. package/nuxt/components/checkboxGroupProps.js +3 -0
  142. package/nuxt/components/checkboxProps.js +3 -0
  143. package/nuxt/components/colProps.js +3 -0
  144. package/nuxt/components/colPropsBaseClass.js +3 -0
  145. package/nuxt/components/colPropsBaseStyle.js +3 -0
  146. package/nuxt/components/collapseItemProps.js +3 -0
  147. package/nuxt/components/collapseProps.js +3 -0
  148. package/nuxt/components/countdownProps.js +3 -0
  149. package/nuxt/components/datePickerProCommonProps.js +3 -0
  150. package/nuxt/components/datePickerProPanelProps.js +3 -0
  151. package/nuxt/components/datePickerProProps.js +3 -0
  152. package/nuxt/components/dropdownMenuProps.js +3 -0
  153. package/nuxt/components/editableSelectProps.js +3 -0
  154. package/nuxt/components/fixedOverlayProps.js +3 -0
  155. package/nuxt/components/flexibleOverlayProps.js +3 -0
  156. package/nuxt/components/formItemProps.js +3 -0
  157. package/nuxt/components/formProps.js +3 -0
  158. package/nuxt/components/fullscreenProps.js +3 -0
  159. package/nuxt/components/iconProps.js +3 -0
  160. package/nuxt/components/imagePreviewProps.js +3 -0
  161. package/nuxt/components/inputProps.js +3 -0
  162. package/nuxt/components/loadingProps.js +3 -0
  163. package/nuxt/components/mentionProps.js +3 -0
  164. package/nuxt/components/messageProps.js +3 -0
  165. package/nuxt/components/modalProps.js +3 -0
  166. package/nuxt/components/notificationProps.js +3 -0
  167. package/nuxt/components/paginationProps.js +3 -0
  168. package/nuxt/components/panelProps.js +3 -0
  169. package/nuxt/components/popoverProps.js +3 -0
  170. package/nuxt/components/progressProps.js +3 -0
  171. package/nuxt/components/rateProps.js +3 -0
  172. package/nuxt/components/resultProps.js +3 -0
  173. package/nuxt/components/roundInjectionKey.js +3 -0
  174. package/nuxt/components/rowProps.js +3 -0
  175. package/nuxt/components/screenSizes.js +3 -0
  176. package/nuxt/components/searchProps.js +3 -0
  177. package/nuxt/components/skeletonItemProps.js +3 -0
  178. package/nuxt/components/skeletonProps.js +3 -0
  179. package/nuxt/components/sliderProps.js +3 -0
  180. package/nuxt/components/splitterProps.js +3 -0
  181. package/nuxt/components/statisticProps.js +3 -0
  182. package/nuxt/components/stepProps.js +3 -0
  183. package/nuxt/components/stepsProps.js +3 -0
  184. package/nuxt/components/svgIconProps.js +3 -0
  185. package/nuxt/components/switchProps.js +3 -0
  186. package/nuxt/components/tableProps.js +3 -0
  187. package/nuxt/components/tabsProps.js +3 -0
  188. package/nuxt/components/tagProps.js +3 -0
  189. package/nuxt/components/textareaProps.js +3 -0
  190. package/nuxt/components/timeAxisProps.js +3 -0
  191. package/nuxt/components/timerPickerPanelProps.js +3 -0
  192. package/nuxt/components/tooltipProps.js +3 -0
  193. package/nuxt/components/treeNodeProps.js +3 -0
  194. package/nuxt/components/treeProps.js +3 -0
  195. package/nuxt/components/uploadProps.js +3 -0
  196. package/overlay/index.es.js +239 -314
  197. package/overlay/index.umd.js +1 -1
  198. package/overlay/style.css +1 -1
  199. package/package.json +44 -87
  200. package/pagination/index.es.js +331 -153
  201. package/pagination/index.umd.js +1 -1
  202. package/pagination/style.css +1 -1
  203. package/panel/index.es.js +45 -32
  204. package/panel/index.umd.js +1 -1
  205. package/panel/style.css +1 -1
  206. package/popover/index.es.js +6034 -215
  207. package/popover/index.umd.js +27 -1
  208. package/popover/style.css +1 -1
  209. package/progress/index.es.js +110 -56
  210. package/progress/index.umd.js +3 -3
  211. package/progress/style.css +1 -1
  212. package/radio/index.es.js +8013 -180
  213. package/radio/index.umd.js +38 -1
  214. package/radio/style.css +1 -1
  215. package/rate/index.es.js +77 -55
  216. package/rate/index.umd.js +1 -1
  217. package/rate/style.css +1 -1
  218. package/result/index.es.js +186 -57
  219. package/result/index.umd.js +1 -1
  220. package/result/style.css +1 -1
  221. package/ripple/index.es.js +52 -60
  222. package/ripple/index.umd.js +1 -1
  223. package/search/index.es.js +3885 -1152
  224. package/search/index.umd.js +29 -18
  225. package/search/style.css +1 -1
  226. package/select/index.es.js +9235 -516
  227. package/select/index.umd.js +38 -1
  228. package/select/style.css +1 -1
  229. package/skeleton/index.es.js +113 -265
  230. package/skeleton/index.umd.js +1 -1
  231. package/skeleton/style.css +1 -1
  232. package/slider/index.es.js +144 -137
  233. package/slider/index.umd.js +1 -1
  234. package/slider/style.css +1 -1
  235. package/splitter/index.es.js +6219 -232
  236. package/splitter/index.umd.js +27 -1
  237. package/splitter/style.css +1 -1
  238. package/statistic/index.es.js +41 -55
  239. package/statistic/index.umd.js +1 -1
  240. package/statistic/style.css +1 -1
  241. package/status/index.es.js +27 -6
  242. package/status/index.umd.js +1 -1
  243. package/status/style.css +1 -1
  244. package/{color-picker → steps}/index.d.ts +0 -0
  245. package/steps/index.es.js +386 -0
  246. package/steps/index.umd.js +1 -0
  247. package/{gantt → steps}/package.json +1 -1
  248. package/steps/style.css +1 -0
  249. package/style.css +1 -1
  250. package/switch/index.es.js +7818 -64
  251. package/switch/index.umd.js +38 -1
  252. package/switch/style.css +1 -1
  253. package/table/index.es.js +11109 -1451
  254. package/table/index.umd.js +38 -1
  255. package/table/style.css +1 -1
  256. package/tabs/index.es.js +356 -144
  257. package/tabs/index.umd.js +1 -1
  258. package/tabs/style.css +1 -1
  259. package/tag/index.es.js +49 -24
  260. package/tag/index.umd.js +1 -1
  261. package/tag/style.css +1 -1
  262. package/textarea/index.es.js +7940 -83
  263. package/textarea/index.umd.js +46 -1
  264. package/textarea/style.css +1 -1
  265. package/time-picker/index.es.js +8953 -632
  266. package/time-picker/index.umd.js +38 -1
  267. package/time-picker/style.css +1 -1
  268. package/{comment → time-select}/index.d.ts +0 -0
  269. package/time-select/index.es.js +9606 -0
  270. package/time-select/index.umd.js +38 -0
  271. package/{breadcrumb → time-select}/package.json +1 -1
  272. package/time-select/style.css +1 -0
  273. package/{date-picker → timeline}/index.d.ts +0 -0
  274. package/timeline/index.es.js +427 -0
  275. package/timeline/index.umd.js +1 -0
  276. package/{carousel → timeline}/package.json +1 -1
  277. package/timeline/style.css +1 -0
  278. package/tooltip/index.es.js +5871 -96
  279. package/tooltip/index.umd.js +27 -1
  280. package/tooltip/style.css +1 -1
  281. package/tree/index.es.js +7601 -2508
  282. package/tree/index.umd.js +29 -18
  283. package/tree/style.css +1 -1
  284. package/upload/index.es.js +849 -6143
  285. package/upload/index.umd.js +1 -27
  286. package/upload/style.css +1 -1
  287. package/vue-devui.es.js +20537 -19051
  288. package/vue-devui.umd.js +41 -19
  289. package/accordion/index.es.js +0 -508
  290. package/accordion/index.umd.js +0 -1
  291. package/accordion/style.css +0 -1
  292. package/anchor/index.es.js +0 -263
  293. package/anchor/index.umd.js +0 -1
  294. package/anchor/style.css +0 -1
  295. package/back-top/index.es.js +0 -128
  296. package/back-top/index.umd.js +0 -1
  297. package/back-top/style.css +0 -1
  298. package/breadcrumb/index.es.js +0 -127
  299. package/breadcrumb/index.umd.js +0 -1
  300. package/breadcrumb/style.css +0 -1
  301. package/carousel/index.es.js +0 -329
  302. package/carousel/index.umd.js +0 -1
  303. package/carousel/style.css +0 -1
  304. package/cascader/index.es.js +0 -5963
  305. package/cascader/index.umd.js +0 -27
  306. package/cascader/package.json +0 -7
  307. package/cascader/style.css +0 -1
  308. package/color-picker/index.umd.js +0 -27
  309. package/color-picker/package.json +0 -7
  310. package/color-picker/style.css +0 -1
  311. package/comment/index.es.js +0 -86
  312. package/comment/index.umd.js +0 -1
  313. package/comment/style.css +0 -1
  314. package/date-picker/index.es.js +0 -1171
  315. package/date-picker/index.umd.js +0 -1
  316. package/date-picker/package.json +0 -7
  317. package/date-picker/style.css +0 -1
  318. package/dragdrop/index.d.ts +0 -7
  319. package/dragdrop/index.es.js +0 -157
  320. package/dragdrop/index.umd.js +0 -1
  321. package/dragdrop/package.json +0 -7
  322. package/gantt/index.d.ts +0 -7
  323. package/gantt/index.es.js +0 -523
  324. package/gantt/index.umd.js +0 -1
  325. package/gantt/style.css +0 -1
  326. package/input-icon/index.d.ts +0 -7
  327. package/input-icon/index.es.js +0 -331
  328. package/input-icon/index.umd.js +0 -1
  329. package/input-icon/package.json +0 -7
  330. package/input-icon/style.css +0 -1
  331. package/nav-sprite/index.d.ts +0 -7
  332. package/nav-sprite/index.es.js +0 -68
  333. package/nav-sprite/index.umd.js +0 -1
  334. package/nav-sprite/package.json +0 -7
  335. package/nuxt/components/Accordion.js +0 -3
  336. package/nuxt/components/Anchor.js +0 -3
  337. package/nuxt/components/BackTop.js +0 -3
  338. package/nuxt/components/Breadcrumb.js +0 -3
  339. package/nuxt/components/Carousel.js +0 -3
  340. package/nuxt/components/CarouselItem.js +0 -3
  341. package/nuxt/components/Cascader.js +0 -3
  342. package/nuxt/components/ColorPicker.js +0 -3
  343. package/nuxt/components/Comment.js +0 -3
  344. package/nuxt/components/DatePicker.js +0 -3
  345. package/nuxt/components/FormControl.js +0 -3
  346. package/nuxt/components/FormLabel.js +0 -3
  347. package/nuxt/components/Gantt.js +0 -3
  348. package/nuxt/components/InputIcon.js +0 -3
  349. package/nuxt/components/NavSprite.js +0 -2
  350. package/nuxt/components/QuadrantDiagram.js +0 -3
  351. package/nuxt/components/ReadTip.js +0 -3
  352. package/nuxt/components/StepsGuide.js +0 -3
  353. package/nuxt/components/StickSlider.js +0 -3
  354. package/nuxt/components/Sticky.js +0 -2
  355. package/nuxt/components/TagInput.js +0 -3
  356. package/nuxt/components/TimeAxis.js +0 -3
  357. package/nuxt/components/TimeAxisItem.js +0 -3
  358. package/nuxt/components/Toast.js +0 -3
  359. package/nuxt/components/ToastService.js +0 -3
  360. package/nuxt/components/Transfer.js +0 -3
  361. package/nuxt/components/TreeSelect.js +0 -3
  362. package/quadrant-diagram/index.d.ts +0 -7
  363. package/quadrant-diagram/index.es.js +0 -5728
  364. package/quadrant-diagram/index.umd.js +0 -27
  365. package/quadrant-diagram/package.json +0 -7
  366. package/quadrant-diagram/style.css +0 -1
  367. package/read-tip/index.d.ts +0 -7
  368. package/read-tip/index.es.js +0 -258
  369. package/read-tip/index.umd.js +0 -1
  370. package/read-tip/package.json +0 -7
  371. package/read-tip/style.css +0 -1
  372. package/steps-guide/index.d.ts +0 -7
  373. package/steps-guide/index.es.js +0 -239
  374. package/steps-guide/index.umd.js +0 -1
  375. package/steps-guide/package.json +0 -7
  376. package/steps-guide/style.css +0 -1
  377. package/sticky/index.d.ts +0 -7
  378. package/sticky/index.es.js +0 -197
  379. package/sticky/index.umd.js +0 -1
  380. package/sticky/package.json +0 -7
  381. package/tag-input/index.d.ts +0 -7
  382. package/tag-input/index.es.js +0 -329
  383. package/tag-input/index.umd.js +0 -1
  384. package/tag-input/package.json +0 -7
  385. package/tag-input/style.css +0 -1
  386. package/time-axis/index.d.ts +0 -7
  387. package/time-axis/index.es.js +0 -299
  388. package/time-axis/index.umd.js +0 -1
  389. package/time-axis/package.json +0 -7
  390. package/time-axis/style.css +0 -1
  391. package/toast/index.d.ts +0 -7
  392. package/toast/index.es.js +0 -5918
  393. package/toast/index.umd.js +0 -27
  394. package/toast/style.css +0 -1
  395. package/transfer/index.d.ts +0 -7
  396. package/transfer/index.es.js +0 -7340
  397. package/transfer/index.umd.js +0 -27
  398. package/transfer/package.json +0 -7
  399. package/transfer/style.css +0 -1
  400. package/tree-select/index.d.ts +0 -7
  401. package/tree-select/index.es.js +0 -623
  402. package/tree-select/index.umd.js +0 -1
  403. package/tree-select/package.json +0 -7
  404. package/tree-select/style.css +0 -1
@@ -1,35 +1,22 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
- var __hasOwnProp = Object.prototype.hasOwnProperty;
4
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
- var __spreadValues = (a, b) => {
7
- for (var prop in b || (b = {}))
8
- if (__hasOwnProp.call(b, prop))
9
- __defNormalProp(a, prop, b[prop]);
10
- if (__getOwnPropSymbols)
11
- for (var prop of __getOwnPropSymbols(b)) {
12
- if (__propIsEnum.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- }
15
- return a;
16
- };
17
- import { computed, nextTick, defineComponent, ref, reactive, watch, withDirectives, createVNode, withModifiers, resolveComponent, resolveDirective, vShow, Transition } from "vue";
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";
18
3
  const editableSelectProps = {
19
- appendToBody: {
20
- type: Boolean
4
+ modelValue: {
5
+ type: String,
6
+ default: ""
21
7
  },
22
8
  options: {
23
9
  type: Array,
24
10
  default: () => []
25
11
  },
26
- disabled: {
27
- type: Boolean
12
+ allowClear: {
13
+ type: Boolean,
14
+ default: false
28
15
  },
29
- loading: {
16
+ disabled: {
30
17
  type: Boolean
31
18
  },
32
- optionDisabledKey: {
19
+ disabledKey: {
33
20
  type: String,
34
21
  default: ""
35
22
  },
@@ -37,20 +24,24 @@ const editableSelectProps = {
37
24
  type: String,
38
25
  default: "Search"
39
26
  },
40
- modelValue: {
41
- type: String
42
- },
43
27
  width: {
44
28
  type: Number
45
29
  },
46
30
  maxHeight: {
47
31
  type: Number
48
32
  },
49
- filterOption: {
50
- type: [Function, Boolean]
33
+ loading: {
34
+ type: Boolean
35
+ },
36
+ enableLazyLoad: {
37
+ type: Boolean,
38
+ default: false
51
39
  },
52
- loadMore: {
40
+ searchFn: {
53
41
  type: Function
42
+ },
43
+ filterOption: {
44
+ type: [Function, Boolean]
54
45
  }
55
46
  };
56
47
  const inBrowser = typeof window !== "undefined";
@@ -108,6 +99,233 @@ const clickoutsideDirective = {
108
99
  delete el[ctx];
109
100
  }
110
101
  };
102
+ class View {
103
+ constructor() {
104
+ this.top = "50%";
105
+ this.left = "50%";
106
+ }
107
+ }
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
119
+ }
120
+ };
121
+ class LoadingOptions {
122
+ constructor() {
123
+ this.backdrop = true;
124
+ this.positionType = "relative";
125
+ this.view = new View();
126
+ }
127
+ }
128
+ function createBem(namespace, element, modifier) {
129
+ let cls = namespace;
130
+ if (element) {
131
+ cls += `__${element}`;
132
+ }
133
+ if (modifier) {
134
+ cls += `--${modifier}`;
135
+ }
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) : "";
144
+ return {
145
+ b,
146
+ e,
147
+ m,
148
+ em
149
+ };
150
+ }
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])])]);
212
+ }
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
+ }
289
+ } else {
290
+ unmount(el);
291
+ }
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
306
+ };
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);
327
+ }
328
+ };
111
329
  function className(classStr, classOpt) {
112
330
  let classname = classStr;
113
331
  if (typeof classOpt === "object") {
@@ -118,21 +336,39 @@ function className(classStr, classOpt) {
118
336
  return classname;
119
337
  }
120
338
  var editableSelect = "";
121
- const getFilterFunc = () => (val, option) => option.label.toLocaleLowerCase().indexOf(val.toLocaleLowerCase()) > -1;
122
- const userFilterOptions = (normalizeOptions, inputValue, filterOption) => computed(() => {
123
- const filteredOptions = [];
124
- if (!inputValue.value || filterOption === false) {
125
- return normalizeOptions.value;
126
- }
127
- const filterFunc = typeof filterOption === "function" ? filterOption : getFilterFunc();
128
- normalizeOptions.value.forEach((option) => {
129
- if (filterFunc(inputValue.value, option)) {
130
- filteredOptions.push(option);
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;
131
364
  }
365
+ return normalizeOptions.value.filter((option) => {
366
+ return searchFn(option, inputValue.value);
367
+ });
132
368
  });
133
- return filteredOptions;
134
- });
135
- const useInput = (inputValue, ctx2) => {
369
+ return { filteredOptions };
370
+ }
371
+ function useInput(inputValue, ctx2) {
136
372
  const onInputChange = (value) => {
137
373
  ctx2.emit("search", value);
138
374
  };
@@ -144,18 +380,22 @@ const useInput = (inputValue, ctx2) => {
144
380
  return {
145
381
  handleInput
146
382
  };
147
- };
148
- const useLazyLoad = (dropdownRef, inputValue, filterOtion, load) => {
383
+ }
384
+ function useLazyLoad(dropdownRef, enableLazyLoad, ctx2) {
149
385
  const loadMore = () => {
150
- if (filterOtion !== false)
386
+ const dropdownVal = dropdownRef.value;
387
+ if (!enableLazyLoad) {
151
388
  return;
152
- if (dropdownRef.value.clientHeight + dropdownRef.value.scrollTop >= dropdownRef.value.scrollHeight) {
153
- load(inputValue.value);
389
+ }
390
+ if (dropdownVal.clientHeight + dropdownVal.scrollTop >= dropdownVal.scrollHeight) {
391
+ ctx2.emit("loadMore");
154
392
  }
155
393
  };
156
394
  return { loadMore };
157
- };
158
- const useKeyboardSelect = (dropdownRef, disabled, visible, hoverIndex, selectedIndex, options, toggleMenu, closeMenu, handleClick) => {
395
+ }
396
+ function useKeyboardSelect(dropdownRef, visible, inputValue, cacheInput, filteredOptions, optionDisabledKey, filterOption, loading2, handleClick, closeMenu, toggleMenu) {
397
+ const hoverIndex = ref(0);
398
+ const selectedIndex = ref(0);
159
399
  const updateHoveringIndex = (index2) => {
160
400
  hoverIndex.value = index2;
161
401
  };
@@ -174,184 +414,451 @@ const useKeyboardSelect = (dropdownRef, disabled, visible, hoverIndex, selectedI
174
414
  }
175
415
  });
176
416
  };
177
- const onKeyboardNavigation = (direction, newIndex) => {
178
- if (!newIndex) {
179
- newIndex = hoverIndex.value;
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;
180
436
  }
181
- if (!["ArrowDown", "ArrowUp"].includes(direction))
437
+ if (filterOption === false && loading2.value) {
182
438
  return;
439
+ }
440
+ let newIndex = 0;
441
+ newIndex = hoverIndex.value;
183
442
  if (direction === "ArrowUp") {
184
- if (newIndex === 0) {
185
- newIndex = options.value.length - 1;
186
- scrollToItem(newIndex);
187
- updateHoveringIndex(newIndex);
188
- return;
443
+ newIndex -= 1;
444
+ if (newIndex === -1) {
445
+ newIndex = len - 1;
189
446
  }
190
- newIndex = newIndex - 1;
191
447
  } else if (direction === "ArrowDown") {
192
- if (newIndex === options.value.length - 1) {
448
+ newIndex += 1;
449
+ if (newIndex === len) {
193
450
  newIndex = 0;
194
- scrollToItem(newIndex);
195
- updateHoveringIndex(newIndex);
196
- return;
197
451
  }
198
- newIndex = newIndex + 1;
199
452
  }
200
- const option = options.value[newIndex];
201
- if (option[disabled]) {
202
- return onKeyboardNavigation(direction, newIndex);
453
+ hoverIndex.value = newIndex;
454
+ const option = filteredOptions.value[newIndex];
455
+ if (option[optionDisabledKey]) {
456
+ return handleKeyboardNavigation(direction);
203
457
  }
204
- scrollToItem(newIndex);
205
458
  updateHoveringIndex(newIndex);
459
+ scrollToItem(newIndex);
206
460
  };
207
461
  const handleKeydown = (event) => {
208
462
  const keyCode = event.key || event.code;
209
- if (options.value.length === 0)
210
- return;
211
- if (!visible.value) {
212
- return toggleMenu();
213
- }
214
- const onKeydownEnter = () => {
215
- handleClick(options.value[hoverIndex.value]);
216
- closeMenu();
217
- };
218
- const onKeydownEsc = () => {
219
- closeMenu();
220
- };
221
463
  switch (keyCode) {
222
- case "Enter":
223
- onKeydownEnter();
224
- break;
225
464
  case "Escape":
226
- onKeydownEsc();
465
+ handleEscape();
466
+ break;
467
+ case "Enter":
468
+ handleEnter();
227
469
  break;
228
470
  default:
229
- onKeyboardNavigation(keyCode);
471
+ handleKeyboardNavigation(keyCode);
230
472
  }
231
473
  };
474
+ return { handleKeydown, hoverIndex, selectedIndex };
475
+ }
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
+ }
508
+ };
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;
515
+ }
516
+ }
517
+ return window;
518
+ }
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;
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
+ });
557
+ };
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);
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);
232
650
  return {
233
- handleKeydown
651
+ getOptionValue
234
652
  };
653
+ }
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
+ }
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"
782
+ }
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
+ }
235
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
+ };
821
+ }
236
822
  var EditableSelect = defineComponent({
237
823
  name: "DEditableSelect",
238
824
  directives: {
239
- clickOutside: clickoutsideDirective
825
+ clickOutside: clickoutsideDirective,
826
+ dLoading: loadingDirective
240
827
  },
241
828
  props: editableSelectProps,
242
829
  emits: ["update:modelValue", "search", "loadMore"],
243
830
  setup(props, ctx2) {
244
- const getItemCls = (option, index2) => {
245
- const {
246
- optionDisabledKey: disabledKey
247
- } = props;
248
- return className("devui-dropdown-item", {
249
- disabled: disabledKey ? !!option[disabledKey] : false,
250
- selected: index2 === selectIndex.value,
251
- "devui-dropdown-bg": index2 === hoverIndex.value
252
- });
253
- };
254
- const renderDropdown = () => {
255
- if (props.appendToBody) {
256
- return createVNode(resolveComponent("d-flexible-overlay"), {
257
- "origin": origin,
258
- "visible": visible.value,
259
- "onUpdate:visible": ($event) => visible.value = $event,
260
- "position": position,
261
- "hasBackdrop": false
262
- }, {
263
- default: () => [createVNode("div", {
264
- "class": "devui-editable-select-dropdown",
265
- "style": {
266
- width: props.width + "px"
267
- }
268
- }, [withDirectives(createVNode("div", {
269
- "class": "devui-dropdown-menu"
270
- }, [createVNode("ul", {
271
- "ref": dopdownRef,
272
- "class": "devui-list-unstyled scroll-height",
273
- "style": {
274
- maxHeight: props.maxHeight + "px"
275
- },
276
- "onScroll": loadMore
277
- }, [filteredOptions.value.map((option, index2) => {
278
- return createVNode("li", {
279
- "class": getItemCls(option, index2),
280
- "onClick": (e) => {
281
- e.stopPropagation();
282
- handleClick(option);
283
- }
284
- }, [ctx2.slots.itemTemplate ? ctx2.slots.itemTemplate(option) : option.label]);
285
- }), withDirectives(createVNode("li", {
286
- "class": "devui-no-result-template"
287
- }, [createVNode("div", {
288
- "class": "devui-no-data-tip"
289
- }, [emptyText.value])]), [[vShow, !filteredOptions.value.length]])])]), [[resolveDirective("dLoading"), props.loading], [vShow, visible.value]])])]
290
- });
291
- } else {
292
- return createVNode(Transition, {
293
- "name": "fade"
294
- }, {
295
- default: () => [withDirectives(createVNode("div", {
296
- "class": "devui-dropdown-menu"
297
- }, [createVNode("ul", {
298
- "ref": dopdownRef,
299
- "class": "devui-list-unstyled scroll-height",
300
- "style": {
301
- maxHeight: props.maxHeight + "px"
302
- },
303
- "onScroll": loadMore
304
- }, [filteredOptions.value.map((option, index2) => {
305
- return createVNode("li", {
306
- "class": getItemCls(option, index2),
307
- "onClick": (e) => {
308
- e.stopPropagation();
309
- handleClick(option);
310
- }
311
- }, [ctx2.slots.itemTemplate ? ctx2.slots.itemTemplate(option) : option.label]);
312
- }), withDirectives(createVNode("li", {
313
- "class": "devui-no-result-template"
314
- }, [createVNode("div", {
315
- "class": "devui-no-data-tip"
316
- }, [emptyText.value])]), [[vShow, !filteredOptions.value.length]])])]), [[vShow, visible.value]])]
317
- });
318
- }
319
- };
320
- const dopdownRef = ref();
831
+ const app = getCurrentInstance();
832
+ const t = createI18nTranslate("DEditableSelect", app);
833
+ const ns = useNamespace("editable-select");
834
+ const dropdownRef = ref();
321
835
  const origin = ref();
322
- const position = reactive({
323
- originX: "left",
324
- originY: "bottom",
325
- overlayX: "left",
326
- overlayY: "top"
327
- });
836
+ const position = ref(["bottom"]);
328
837
  const visible = ref(false);
329
838
  const inputValue = ref(props.modelValue);
330
- const hoverIndex = ref(0);
331
- const selectIndex = ref(0);
332
- const normalizeOptions = computed(() => {
333
- return props.options.map((option) => {
334
- if (typeof option === "object") {
335
- return __spreadValues({
336
- label: option.label ? option.label : option.value,
337
- value: option.value
338
- }, option);
339
- }
340
- return {
341
- label: option + "",
342
- value: option
343
- };
344
- });
345
- });
346
- const filteredOptions = userFilterOptions(normalizeOptions, inputValue, props.filterOption);
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()));
845
+ const {
846
+ filteredOptions
847
+ } = useFilterOptions(props.enableLazyLoad, normalizeOptions, inputValue, searchFn);
848
+ const {
849
+ getOptionValue
850
+ } = useCacheFilteredOptions(filteredOptions);
347
851
  const emptyText = computed(() => {
348
852
  let text;
349
- if (props.filterOption !== false && !filteredOptions.value.length) {
350
- text = "\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55";
351
- } else if (props.filterOption === false && !filteredOptions.value.length) {
352
- text = "\u6CA1\u6709\u6570\u636E";
853
+ if (props.enableLazyLoad) {
854
+ text = t("noData");
855
+ } else {
856
+ text = t("noRelatedRecords");
353
857
  }
354
- return ctx2.slots.noResultItemTemplate ? ctx2.slots.noResultItemTemplate() : text;
858
+ return text;
859
+ });
860
+ watch(() => props.loading, (newVal) => {
861
+ loading2.value = newVal;
355
862
  });
356
863
  const toggleMenu = () => {
357
864
  visible.value = !visible.value;
@@ -361,28 +868,48 @@ var EditableSelect = defineComponent({
361
868
  };
362
869
  const {
363
870
  loadMore
364
- } = useLazyLoad(dopdownRef, inputValue, props.filterOption, props.loadMore);
871
+ } = useLazyLoad(dropdownRef, props.enableLazyLoad, ctx2);
365
872
  const {
366
873
  handleInput
367
874
  } = useInput(inputValue, ctx2);
368
- const handleClick = (option) => {
875
+ const handleClick = (option, index2, curSelectedIndex) => {
369
876
  const {
370
- optionDisabledKey: disabledKey
877
+ disabledKey
371
878
  } = props;
372
- if (disabledKey && !!option[disabledKey])
879
+ if (disabledKey && !!option[disabledKey]) {
373
880
  return;
374
- ctx2.emit("update:modelValue", option.label);
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 + "");
375
887
  closeMenu();
376
888
  };
889
+ const handleClear = () => {
890
+ inputValue.value = "";
891
+ };
377
892
  const {
378
- handleKeydown
379
- } = useKeyboardSelect(dopdownRef, props.optionDisabledKey, visible, hoverIndex, selectIndex, filteredOptions, toggleMenu, closeMenu, handleClick);
380
- watch(() => props.modelValue, (newVal) => {
381
- inputValue.value = newVal;
382
- });
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
+ };
383
907
  return () => {
384
- const selectCls = className("devui-editable-select devui-form-group devui-has-feedback", {
385
- "devui-select-open": visible.value === true
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
386
913
  });
387
914
  return withDirectives(createVNode("div", {
388
915
  "class": selectCls,
@@ -391,7 +918,7 @@ var EditableSelect = defineComponent({
391
918
  width: props.width + "px"
392
919
  }
393
920
  }, [createVNode("input", {
394
- "class": "devui-form-control devui-dropdown-origin devui-dropdown-origin-open",
921
+ "class": inputCls,
395
922
  "onClick": withModifiers(toggleMenu, ["self"]),
396
923
  "onInput": handleInput,
397
924
  "onKeydown": handleKeydown,
@@ -402,22 +929,63 @@ var EditableSelect = defineComponent({
402
929
  }, null), createVNode("span", {
403
930
  "class": "devui-form-control-feedback"
404
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", {
405
937
  "class": "devui-select-chevron-icon"
406
938
  }, [createVNode(resolveComponent("d-icon"), {
407
939
  "name": "select-arrow"
408
- }, null)])]), renderDropdown()]), [[resolveDirective("click-outside"), closeMenu]]);
940
+ }, null)])]), createVNode(Teleport, {
941
+ "to": "body"
942
+ }, {
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]]);
409
980
  };
410
981
  }
411
982
  });
412
- EditableSelect.install = function(app) {
413
- app.component(EditableSelect.name, EditableSelect);
414
- };
415
983
  var index = {
416
984
  title: "EditableSelect \u53EF\u8F93\u5165\u4E0B\u62C9\u9009\u62E9\u6846",
417
985
  category: "\u6570\u636E\u5F55\u5165",
418
986
  status: "100%",
419
987
  install(app) {
420
- app.use(EditableSelect);
988
+ app.component(EditableSelect.name, EditableSelect);
421
989
  }
422
990
  };
423
- export { EditableSelect, index as default };
991
+ export { EditableSelect, index as default, editableSelectProps };