bkui-vue 0.0.2-beta.14 → 0.0.2-beta.141

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 (505) hide show
  1. package/dist/index.cjs.js +142 -160
  2. package/dist/index.esm.js +18004 -19937
  3. package/dist/index.umd.js +142 -160
  4. package/dist/locale/en.esm.js +1 -1
  5. package/dist/locale/en.esm.js.map +1 -1
  6. package/dist/locale/en.umd.js +1 -1
  7. package/dist/locale/en.umd.js.map +1 -1
  8. package/dist/locale/zh-cn.esm.js +1 -1
  9. package/dist/locale/zh-cn.esm.js.map +1 -1
  10. package/dist/locale/zh-cn.umd.js +1 -1
  11. package/dist/locale/zh-cn.umd.js.map +1 -1
  12. package/dist/style.css +1 -1
  13. package/dist/style.variable.css +1 -1
  14. package/lib/affix/affix.d.ts +1 -1
  15. package/lib/affix/affix.variable.css +6 -2
  16. package/lib/affix/index.d.ts +4 -4
  17. package/lib/affix/index.js +322 -1
  18. package/lib/alert/alert.css +7 -0
  19. package/lib/alert/alert.d.ts +5 -5
  20. package/lib/alert/alert.less +16 -6
  21. package/lib/alert/alert.variable.css +13 -2
  22. package/lib/alert/index.d.ts +10 -10
  23. package/lib/alert/index.js +215 -1
  24. package/lib/animate-number/index.d.ts +1 -1
  25. package/lib/animate-number/index.js +155 -1
  26. package/lib/backtop/backtop.css +8 -8
  27. package/lib/backtop/backtop.less +3 -1
  28. package/lib/backtop/backtop.variable.css +17 -13
  29. package/lib/backtop/index.d.ts +1 -1
  30. package/lib/backtop/index.js +189 -1
  31. package/lib/badge/badge.css +8 -2
  32. package/lib/badge/badge.d.ts +2 -2
  33. package/lib/badge/badge.less +8 -4
  34. package/lib/badge/badge.variable.css +14 -4
  35. package/lib/badge/index.d.ts +7 -7
  36. package/lib/badge/index.js +236 -1
  37. package/lib/breadcrumb/breadcrumb.css +4 -4
  38. package/lib/breadcrumb/breadcrumb.variable.css +10 -6
  39. package/lib/breadcrumb/index.d.ts +2 -2
  40. package/lib/breadcrumb/index.js +310 -1
  41. package/lib/button/button-group.d.ts +2 -2
  42. package/lib/button/button.css +30 -7
  43. package/lib/button/button.d.ts +1 -1
  44. package/lib/button/button.less +29 -13
  45. package/lib/button/button.variable.css +44 -17
  46. package/lib/button/index.d.ts +7 -7
  47. package/lib/button/index.js +329 -1
  48. package/lib/card/card.css +11 -11
  49. package/lib/card/card.d.ts +1 -1
  50. package/lib/card/card.less +7 -7
  51. package/lib/card/card.variable.css +17 -13
  52. package/lib/card/index.d.ts +4 -4
  53. package/lib/card/index.js +292 -1
  54. package/lib/cascader/cascader-panel.d.ts +1 -0
  55. package/lib/cascader/cascader.css +7 -7
  56. package/lib/cascader/cascader.d.ts +1 -0
  57. package/lib/cascader/cascader.less +4 -6
  58. package/lib/cascader/cascader.variable.css +13 -9
  59. package/lib/cascader/index.d.ts +6 -2
  60. package/lib/cascader/index.js +2072 -2
  61. package/lib/cascader/interface.d.ts +1 -1
  62. package/lib/checkbox/checkbox-group.d.ts +6 -3
  63. package/lib/checkbox/checkbox.css +13 -1
  64. package/lib/checkbox/checkbox.d.ts +15 -12
  65. package/lib/checkbox/checkbox.less +15 -1
  66. package/lib/checkbox/checkbox.variable.css +19 -3
  67. package/lib/checkbox/common.d.ts +1 -0
  68. package/lib/checkbox/index.d.ts +43 -31
  69. package/lib/checkbox/index.js +570 -1
  70. package/lib/code-diff/code-diff.variable.css +6 -2
  71. package/lib/code-diff/index.d.ts +1 -1
  72. package/lib/code-diff/index.js +5502 -1
  73. package/lib/collapse/collapse.variable.css +6 -2
  74. package/lib/collapse/index.d.ts +2 -2
  75. package/lib/collapse/index.js +571 -1
  76. package/lib/collapse-transition/collapse-transition.variable.css +6 -2
  77. package/lib/collapse-transition/index.d.ts +128 -2
  78. package/lib/collapse-transition/index.js +177 -1
  79. package/lib/color-picker/color-picker.d.ts +16 -0
  80. package/lib/color-picker/color-picker.variable.css +6 -2
  81. package/lib/color-picker/components/recommend-colors.d.ts +16 -0
  82. package/lib/color-picker/index.d.ts +19 -1
  83. package/lib/color-picker/index.js +2666 -1
  84. package/lib/components.js +530 -1
  85. package/lib/config-provider/config-provider.d.ts +21 -0
  86. package/lib/config-provider/config-provider.variable.css +6 -2
  87. package/lib/config-provider/index.d.ts +29 -1
  88. package/lib/config-provider/index.js +365 -1
  89. package/lib/config-provider/token.d.ts +7 -0
  90. package/lib/config-provider/use-global-config.d.ts +2 -0
  91. package/lib/config-provider/use-prefix.d.ts +2 -0
  92. package/lib/container/container.css +4 -4
  93. package/lib/container/container.variable.css +10 -6
  94. package/lib/container/index.d.ts +2 -2
  95. package/lib/container/index.js +392 -1
  96. package/lib/date-picker/common.d.ts +2 -0
  97. package/lib/date-picker/date-picker.d.ts +6 -2
  98. package/lib/date-picker/date-picker.variable.css +6 -2
  99. package/lib/date-picker/index.d.ts +21 -8
  100. package/lib/date-picker/index.js +5636 -1
  101. package/lib/date-picker/panel/date-range.d.ts +2 -1
  102. package/lib/date-picker/panel/date.d.ts +2 -2
  103. package/lib/date-picker/panel/time-range.d.ts +17 -0
  104. package/lib/date-picker/panel/time.d.ts +17 -1
  105. package/lib/date-picker/time-picker.d.ts +3 -1
  106. package/lib/dialog/dialog.css +9 -6
  107. package/lib/dialog/dialog.less +7 -6
  108. package/lib/dialog/dialog.variable.css +15 -8
  109. package/lib/dialog/index.d.ts +1 -1
  110. package/lib/dialog/index.js +984 -2
  111. package/lib/directives/index.js +1387 -2
  112. package/lib/directives/tooltips.d.ts +2 -2
  113. package/lib/dist.index.js +87 -1
  114. package/lib/divider/divider.variable.css +6 -2
  115. package/lib/divider/index.d.ts +1 -1
  116. package/lib/divider/index.js +170 -1
  117. package/lib/dropdown/dropdown.css +2 -1
  118. package/lib/dropdown/dropdown.variable.css +8 -3
  119. package/lib/dropdown/index.d.ts +2 -2
  120. package/lib/dropdown/index.js +376 -1
  121. package/lib/exception/exception.variable.css +6 -2
  122. package/lib/exception/index.d.ts +2 -2
  123. package/lib/exception/index.js +386 -1
  124. package/lib/fixed-navbar/fixed-navbar.variable.css +6 -2
  125. package/lib/fixed-navbar/index.d.ts +1 -1
  126. package/lib/fixed-navbar/index.js +155 -1
  127. package/lib/form/form.css +2 -1
  128. package/lib/form/form.less +3 -2
  129. package/lib/form/form.variable.css +8 -3
  130. package/lib/form/index.d.ts +3 -3
  131. package/lib/form/index.js +953 -1
  132. package/lib/hooks.d.ts +1 -1
  133. package/lib/hooks.js +73 -1
  134. package/lib/icon/angle-double-down-line.js +191 -1
  135. package/lib/icon/angle-double-left-line.js +191 -1
  136. package/lib/icon/angle-double-left.js +191 -1
  137. package/lib/icon/angle-double-right-line.js +191 -1
  138. package/lib/icon/angle-double-right.js +191 -1
  139. package/lib/icon/angle-double-up-line.js +191 -1
  140. package/lib/icon/angle-down-fill.js +191 -1
  141. package/lib/icon/angle-down-line.js +191 -1
  142. package/lib/icon/angle-down.js +191 -1
  143. package/lib/icon/angle-left.js +191 -1
  144. package/lib/icon/angle-right.js +191 -1
  145. package/lib/icon/angle-up-fill.js +191 -1
  146. package/lib/icon/angle-up.js +191 -1
  147. package/lib/icon/archive-fill.js +191 -1
  148. package/lib/icon/arrows-left.js +191 -1
  149. package/lib/icon/arrows-right.js +191 -1
  150. package/lib/icon/assistant.d.ts +4 -0
  151. package/lib/icon/assistant.js +191 -0
  152. package/lib/icon/audio-fill.js +191 -1
  153. package/lib/icon/bk.js +191 -1
  154. package/lib/icon/circle.js +191 -1
  155. package/lib/icon/close-line.js +191 -1
  156. package/lib/icon/close.js +191 -1
  157. package/lib/icon/code.js +191 -1
  158. package/lib/icon/cog-shape.js +191 -1
  159. package/lib/icon/collapse-left.js +191 -1
  160. package/lib/icon/copy-shape.js +191 -1
  161. package/lib/icon/copy.js +191 -1
  162. package/lib/icon/data-shape.js +191 -1
  163. package/lib/icon/del.js +191 -1
  164. package/lib/icon/doc-fill.js +191 -1
  165. package/lib/icon/done.js +191 -1
  166. package/lib/icon/down-shape.js +191 -1
  167. package/lib/icon/down-small.js +191 -1
  168. package/lib/icon/edit-line.js +191 -1
  169. package/lib/icon/ellipsis.js +191 -1
  170. package/lib/icon/enlarge-line.js +191 -1
  171. package/lib/icon/error.js +191 -1
  172. package/lib/icon/excel-fill.js +191 -1
  173. package/lib/icon/exclamation-circle-shape.js +191 -1
  174. package/lib/icon/eye.js +191 -1
  175. package/lib/icon/filliscreen-line.js +191 -1
  176. package/lib/icon/fix-line.js +191 -1
  177. package/lib/icon/fix-shape.js +191 -1
  178. package/lib/icon/folder-open.js +191 -1
  179. package/lib/icon/folder-shape-open.js +191 -1
  180. package/lib/icon/folder-shape.js +191 -1
  181. package/lib/icon/folder.js +191 -1
  182. package/lib/icon/funnel.js +191 -1
  183. package/lib/icon/help-document-fill.js +191 -1
  184. package/lib/icon/help-fill.js +191 -1
  185. package/lib/icon/help.js +191 -1
  186. package/lib/icon/image-fill.js +276 -1
  187. package/lib/icon/img-error.js +276 -1
  188. package/lib/icon/img-placehoulder.js +276 -1
  189. package/lib/icon/index.d.ts +2 -0
  190. package/lib/icon/index.js +2432 -1
  191. package/lib/icon/info-line.js +276 -1
  192. package/lib/icon/info.js +276 -1
  193. package/lib/icon/left-shape.js +276 -1
  194. package/lib/icon/left-turn-line.js +276 -1
  195. package/lib/icon/loading.d.ts +4 -0
  196. package/lib/icon/loading.js +276 -0
  197. package/lib/icon/narrow-line.js +276 -1
  198. package/lib/icon/original.js +276 -1
  199. package/lib/icon/pdf-fill.js +276 -1
  200. package/lib/icon/play-shape.js +276 -1
  201. package/lib/icon/plus.js +276 -1
  202. package/lib/icon/ppt-fill.js +276 -1
  203. package/lib/icon/qq.js +276 -1
  204. package/lib/icon/right-shape.js +276 -1
  205. package/lib/icon/right-turn-line.js +276 -1
  206. package/lib/icon/search.js +276 -1
  207. package/lib/icon/share.js +276 -1
  208. package/lib/icon/spinner.js +276 -1
  209. package/lib/icon/success.js +276 -1
  210. package/lib/icon/switcher-loading.js +276 -1
  211. package/lib/icon/text-file.js +276 -1
  212. package/lib/icon/text-fill.js +276 -1
  213. package/lib/icon/transfer.js +276 -1
  214. package/lib/icon/tree-application-shape.js +276 -1
  215. package/lib/icon/unfull-screen.js +276 -1
  216. package/lib/icon/unvisible.js +276 -1
  217. package/lib/icon/up-shape.js +276 -1
  218. package/lib/icon/upload.js +276 -1
  219. package/lib/icon/video-fill.js +276 -1
  220. package/lib/icon/warn.js +276 -1
  221. package/lib/icon/weixin-pro.js +276 -1
  222. package/lib/icon/weixin.js +276 -1
  223. package/lib/image/image-viewer.variable.css +6 -2
  224. package/lib/image/image.variable.css +6 -2
  225. package/lib/image/index.d.ts +1 -1
  226. package/lib/image/index.js +641 -1
  227. package/lib/index.js +97 -1
  228. package/lib/info-box/index.js +1174 -2
  229. package/lib/info-box/info-box.css +2 -0
  230. package/lib/info-box/info-box.d.ts +4 -0
  231. package/lib/info-box/info-box.less +2 -1
  232. package/lib/info-box/info-box.variable.css +8 -2
  233. package/lib/input/index.d.ts +90 -12
  234. package/lib/input/index.js +1234 -1
  235. package/lib/input/input.css +51 -19
  236. package/lib/input/input.d.ts +79 -6
  237. package/lib/input/input.less +50 -13
  238. package/lib/input/input.variable.css +57 -21
  239. package/lib/input/util.d.ts +6 -0
  240. package/lib/link/index.d.ts +4 -4
  241. package/lib/link/index.js +161 -1
  242. package/lib/link/link.d.ts +1 -1
  243. package/lib/link/link.variable.css +6 -2
  244. package/lib/loading/index.d.ts +5 -5
  245. package/lib/loading/index.js +382 -1
  246. package/lib/loading/loading.css +13 -13
  247. package/lib/loading/loading.d.ts +1 -1
  248. package/lib/loading/loading.less +14 -9
  249. package/lib/loading/loading.variable.css +19 -15
  250. package/lib/locale/index.js +477 -1
  251. package/lib/locale/lang/en.d.ts +7 -0
  252. package/lib/menu/index.d.ts +2 -2
  253. package/lib/menu/index.js +725 -1
  254. package/lib/menu/menu.css +4 -4
  255. package/lib/menu/menu.variable.css +10 -6
  256. package/lib/menu/submenu.variable.css +6 -2
  257. package/lib/message/index.js +1796 -2
  258. package/lib/message/message.css +18 -2
  259. package/lib/message/message.less +16 -2
  260. package/lib/message/message.variable.css +24 -4
  261. package/lib/message/messageConstructor.d.ts +23 -3
  262. package/lib/modal/index.d.ts +2 -2
  263. package/lib/modal/index.js +397 -1
  264. package/lib/modal/modal.css +2 -0
  265. package/lib/modal/modal.variable.css +8 -2
  266. package/lib/navigation/index.d.ts +4 -1
  267. package/lib/navigation/index.js +368 -1
  268. package/lib/navigation/navigation.d.ts +1 -0
  269. package/lib/navigation/navigation.variable.css +6 -2
  270. package/lib/notify/index.js +398 -1
  271. package/lib/notify/notify.css +6 -6
  272. package/lib/notify/notify.less +6 -6
  273. package/lib/notify/notify.variable.css +12 -8
  274. package/lib/notify/notifyConstructor.d.ts +1 -1
  275. package/lib/overflow-title/components/overflow-title.d.ts +257 -2
  276. package/lib/overflow-title/index.d.ts +387 -2
  277. package/lib/overflow-title/index.js +292 -1
  278. package/lib/overflow-title/props.d.ts +129 -0
  279. package/lib/pagination/index.d.ts +6 -6
  280. package/lib/pagination/index.js +894 -1
  281. package/lib/pagination/pagination.css +1 -0
  282. package/lib/pagination/pagination.d.ts +3 -3
  283. package/lib/pagination/pagination.less +1 -0
  284. package/lib/pagination/pagination.variable.css +7 -2
  285. package/lib/plugin-popover/index.js +3833 -1
  286. package/lib/plugins/index.js +63 -1
  287. package/lib/pop-confirm/index.d.ts +43 -4
  288. package/lib/pop-confirm/index.js +294 -1
  289. package/lib/pop-confirm/pop-confirm.css +4 -4
  290. package/lib/pop-confirm/pop-confirm.d.ts +14 -1
  291. package/lib/pop-confirm/pop-confirm.less +4 -4
  292. package/lib/pop-confirm/pop-confirm.variable.css +10 -6
  293. package/lib/popover/content.d.ts +33 -0
  294. package/lib/popover/index.d.ts +74 -16
  295. package/lib/popover/index.js +3842 -1
  296. package/lib/popover/popover.css +2 -1
  297. package/lib/popover/popover.d.ts +40 -7
  298. package/lib/popover/popover.less +4 -3
  299. package/lib/popover/popover.variable.css +8 -3
  300. package/lib/popover/props.d.ts +25 -2
  301. package/lib/popover/use-floating.d.ts +1 -1
  302. package/lib/popover/use-popover-init.d.ts +2 -1
  303. package/lib/popover2/index.d.ts +1 -1
  304. package/lib/popover2/index.js +107 -1
  305. package/lib/preset.d.ts +14 -0
  306. package/lib/preset.js +93 -1
  307. package/lib/process/index.d.ts +1 -1
  308. package/lib/process/index.js +759 -2
  309. package/lib/process/process.variable.css +6 -2
  310. package/lib/progress/index.d.ts +5 -5
  311. package/lib/progress/index.js +432 -1
  312. package/lib/progress/progress.css +11 -7
  313. package/lib/progress/progress.d.ts +3 -3
  314. package/lib/progress/progress.less +8 -3
  315. package/lib/progress/progress.variable.css +17 -9
  316. package/lib/radio/common.d.ts +1 -0
  317. package/lib/radio/index.d.ts +31 -25
  318. package/lib/radio/index.js +636 -1
  319. package/lib/radio/radio-button.d.ts +8 -7
  320. package/lib/radio/radio-group.d.ts +7 -4
  321. package/lib/radio/radio.css +26 -12
  322. package/lib/radio/radio.d.ts +5 -4
  323. package/lib/radio/radio.less +42 -8
  324. package/lib/radio/radio.variable.css +26 -8
  325. package/lib/rate/index.d.ts +12 -8
  326. package/lib/rate/index.js +355 -1
  327. package/lib/rate/rate.d.ts +4 -3
  328. package/lib/rate/rate.variable.css +6 -2
  329. package/lib/rate/star.css +3 -0
  330. package/lib/rate/star.less +3 -0
  331. package/lib/rate/star.variable.css +9 -2
  332. package/lib/resize-layout/index.d.ts +4 -4
  333. package/lib/resize-layout/index.js +430 -1
  334. package/lib/resize-layout/resize-layout.css +14 -2
  335. package/lib/resize-layout/resize-layout.d.ts +1 -1
  336. package/lib/resize-layout/resize-layout.less +14 -2
  337. package/lib/resize-layout/resize-layout.variable.css +20 -4
  338. package/lib/search-select/index.d.ts +62 -29
  339. package/lib/search-select/index.js +2747 -2
  340. package/lib/search-select/input.d.ts +5 -1
  341. package/lib/search-select/menu.d.ts +33 -2
  342. package/lib/search-select/search-select.css +39 -21
  343. package/lib/search-select/search-select.d.ts +23 -20
  344. package/lib/search-select/search-select.less +44 -23
  345. package/lib/search-select/search-select.variable.css +45 -23
  346. package/lib/search-select/selected.d.ts +5 -1
  347. package/lib/search-select/utils.d.ts +13 -5
  348. package/lib/select/common.d.ts +4 -1
  349. package/lib/select/index.d.ts +287 -90
  350. package/lib/select/index.js +2422 -2
  351. package/lib/select/option.d.ts +12 -0
  352. package/lib/select/select.css +16 -5
  353. package/lib/select/select.d.ts +120 -39
  354. package/lib/select/select.less +14 -1
  355. package/lib/select/select.variable.css +46 -31
  356. package/lib/select/selectTagInput.d.ts +10 -5
  357. package/lib/select/type.d.ts +3 -0
  358. package/lib/shared/helper.d.ts +1 -1
  359. package/lib/shared/index.js +2690 -1
  360. package/lib/shared/mask-manager.d.ts +3 -4
  361. package/lib/shared/pop-manager.d.ts +6 -2
  362. package/lib/shared/popover.d.ts +2 -2
  363. package/lib/shared/vue-types.d.ts +4 -3
  364. package/lib/sideslider/index.d.ts +1 -1
  365. package/lib/sideslider/index.js +711 -2
  366. package/lib/sideslider/sideslider.variable.css +6 -2
  367. package/lib/slider/index.d.ts +1 -1
  368. package/lib/slider/index.js +1310 -2
  369. package/lib/slider/slider.css +2 -0
  370. package/lib/slider/slider.less +2 -0
  371. package/lib/slider/slider.variable.css +8 -2
  372. package/lib/steps/index.d.ts +5 -5
  373. package/lib/steps/index.js +826 -2
  374. package/lib/steps/steps.css +18 -6
  375. package/lib/steps/steps.d.ts +3 -3
  376. package/lib/steps/steps.less +26 -5
  377. package/lib/steps/steps.variable.css +24 -8
  378. package/lib/styles/index.d.ts +1 -0
  379. package/lib/styles/mixins/animate.css +4 -4
  380. package/lib/styles/mixins/animate.less +10 -6
  381. package/lib/styles/mixins/animate.variable.css +130 -4
  382. package/lib/styles/mixins/mixins.css +4 -4
  383. package/lib/styles/mixins/mixins.variable.css +4 -4
  384. package/lib/styles/mixins/popper.variable.css +6 -2
  385. package/lib/styles/mixins/scroll.variable.css +6 -2
  386. package/lib/styles/reset.variable.css +6 -2
  387. package/lib/styles/themes/themes.less +7 -3
  388. package/lib/swiper/index.d.ts +1 -1
  389. package/lib/swiper/index.js +337 -1
  390. package/lib/swiper/swiper.css +0 -6
  391. package/lib/swiper/swiper.less +0 -8
  392. package/lib/swiper/swiper.variable.css +6 -8
  393. package/lib/switcher/index.d.ts +34 -20
  394. package/lib/switcher/index.js +278 -1
  395. package/lib/switcher/switcher.css +4 -4
  396. package/lib/switcher/switcher.d.ts +76 -7
  397. package/lib/switcher/switcher.variable.css +10 -6
  398. package/lib/tab/index.d.ts +3 -3
  399. package/lib/tab/index.js +915 -1
  400. package/lib/tab/tab-nav.d.ts +12 -2
  401. package/lib/tab/tab-panel.d.ts +1 -1
  402. package/lib/tab/tab.variable.css +6 -2
  403. package/lib/table/components/table-cell.d.ts +22 -24
  404. package/lib/table/components/table-column.d.ts +100 -71
  405. package/lib/table/const.d.ts +25 -3
  406. package/lib/table/events.d.ts +26 -26
  407. package/lib/table/index.d.ts +309 -191
  408. package/lib/table/index.js +6562 -1
  409. package/lib/table/plugins/body-empty.d.ts +1 -1
  410. package/lib/table/plugins/head-filter.css +4 -28
  411. package/lib/table/plugins/head-filter.d.ts +2 -7
  412. package/lib/table/plugins/head-filter.less +5 -34
  413. package/lib/table/plugins/head-filter.variable.css +10 -30
  414. package/lib/table/plugins/head-sort.d.ts +2 -7
  415. package/lib/table/plugins/head-sort.variable.css +6 -2
  416. package/lib/table/plugins/settings.d.ts +2 -19
  417. package/lib/table/plugins/settings.variable.css +6 -2
  418. package/lib/table/plugins/use-column-resize.d.ts +30 -10
  419. package/lib/table/plugins/use-fixed-column.d.ts +9 -9
  420. package/lib/table/plugins/use-head-cell.d.ts +7 -0
  421. package/lib/table/plugins/use-pagination.d.ts +8 -4
  422. package/lib/table/props.d.ts +84 -52
  423. package/lib/table/table.css +117 -53
  424. package/lib/table/table.d.ts +91 -68
  425. package/lib/table/table.less +70 -26
  426. package/lib/table/table.variable.css +123 -55
  427. package/lib/table/use-attributes.d.ts +59 -0
  428. package/lib/table/use-column.d.ts +264 -53
  429. package/lib/table/use-common.d.ts +1607 -88
  430. package/lib/table/use-render.d.ts +11 -0
  431. package/lib/table/utils.d.ts +34 -31
  432. package/lib/table-column/index.d.ts +356 -113
  433. package/lib/table-column/index.js +775 -1
  434. package/lib/tag/index.d.ts +10 -10
  435. package/lib/tag/index.js +234 -1
  436. package/lib/tag/tag.d.ts +5 -5
  437. package/lib/tag/tag.variable.css +6 -2
  438. package/lib/tag-input/index.d.ts +49 -7
  439. package/lib/tag-input/index.js +1678 -1
  440. package/lib/tag-input/list-tag-render.d.ts +11 -0
  441. package/lib/tag-input/tag-input.css +8 -0
  442. package/lib/tag-input/tag-input.d.ts +46 -6
  443. package/lib/tag-input/tag-input.less +9 -0
  444. package/lib/tag-input/tag-input.variable.css +14 -2
  445. package/lib/tag-input/tag-props.d.ts +16 -2
  446. package/lib/time-picker/index.d.ts +10 -4
  447. package/lib/time-picker/index.js +72 -1
  448. package/lib/time-picker/time-picker.css +4 -3
  449. package/lib/time-picker/time-picker.less +5 -9
  450. package/lib/time-picker/time-picker.variable.css +10 -5
  451. package/lib/timeline/index.d.ts +1 -1
  452. package/lib/timeline/index.js +241 -1
  453. package/lib/timeline/timeline.variable.css +6 -2
  454. package/lib/transfer/index.d.ts +1 -1
  455. package/lib/transfer/index.js +687 -1
  456. package/lib/transfer/transfer.css +2 -2
  457. package/lib/transfer/transfer.less +2 -2
  458. package/lib/transfer/transfer.variable.css +8 -4
  459. package/lib/tree/constant.d.ts +2 -2
  460. package/lib/tree/index.d.ts +70 -40
  461. package/lib/tree/index.js +2603 -1
  462. package/lib/tree/props.d.ts +20 -10
  463. package/lib/tree/tree.css +13 -1
  464. package/lib/tree/tree.d.ts +42 -21
  465. package/lib/tree/tree.variable.css +19 -3
  466. package/lib/tree/use-empty.d.ts +1 -3
  467. package/lib/tree/use-node-action.d.ts +5 -3
  468. package/lib/tree/use-node-attribute.d.ts +17 -8
  469. package/lib/tree/use-search.d.ts +2 -2
  470. package/lib/tree/use-tree-init.d.ts +1 -2
  471. package/lib/tree/util.d.ts +9 -3
  472. package/lib/upload/index.d.ts +1 -1
  473. package/lib/upload/index.js +2888 -2
  474. package/lib/upload/upload.css +4 -4
  475. package/lib/upload/upload.type.d.ts +1 -1
  476. package/lib/upload/upload.variable.css +10 -6
  477. package/lib/upload/use-file-handler.d.ts +2 -2
  478. package/lib/virtual-render/index.d.ts +43 -1
  479. package/lib/virtual-render/index.js +902 -1
  480. package/lib/virtual-render/props.d.ts +15 -0
  481. package/lib/virtual-render/use-fix-top.d.ts +18 -0
  482. package/lib/virtual-render/v-virtual-render.d.ts +24 -1
  483. package/lib/virtual-render/virtual-render.d.ts +25 -0
  484. package/lib/virtual-render/virtual-render.variable.css +6 -2
  485. package/lib/volar.components.d.ts +24 -24
  486. package/package.json +34 -19
  487. package/dist/index.cjs.source.js +0 -45605
  488. package/dist/index.esm.source.js +0 -45605
  489. package/dist/index.umd.source.js +0 -45608
  490. package/lib/cascader/index.js.LICENSE.txt +0 -1
  491. package/lib/dialog/index.js.LICENSE.txt +0 -1
  492. package/lib/directives/index.js.LICENSE.txt +0 -14
  493. package/lib/info-box/index.js.LICENSE.txt +0 -1
  494. package/lib/message/index.js.LICENSE.txt +0 -6
  495. package/lib/process/index.js.LICENSE.txt +0 -1
  496. package/lib/search-select/index.js.LICENSE.txt +0 -1
  497. package/lib/select/index.js.LICENSE.txt +0 -1
  498. package/lib/sideslider/index.js.LICENSE.txt +0 -1
  499. package/lib/slider/index.js.LICENSE.txt +0 -1
  500. package/lib/steps/index.js.LICENSE.txt +0 -1
  501. package/lib/table/render.d.ts +0 -140
  502. package/lib/upload/index.js.LICENSE.txt +0 -1
  503. /package/lib/overflow-title/{overflow.css → overflow-title.css} +0 -0
  504. /package/lib/overflow-title/{overflow.less → overflow-title.less} +0 -0
  505. /package/lib/overflow-title/{overflow.variable.css → overflow-title.variable.css} +0 -0
@@ -1,2 +1,2747 @@
1
- /*! For license information please see index.js.LICENSE.txt */
2
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("../config-provider"),require("../directives"),require("../icon"),require("../popover"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../config-provider","../directives","../icon","../popover"],t);else{var n="object"==typeof exports?t(require("../shared"),require("vue"),require("../config-provider"),require("../directives"),require("../icon"),require("../popover")):t(e["../shared"],e.vue,e["../config-provider"],e["../directives"],e["../icon"],e["../popover"]);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(self,((e,t,n,r,i,o)=>(()=>{var a={2717:e=>{"use strict";e.exports=n},4061:e=>{"use strict";e.exports=r},6870:e=>{"use strict";e.exports=i},5537:e=>{"use strict";e.exports=o},4212:t=>{"use strict";t.exports=e},748:e=>{"use strict";e.exports=t},7609:(e,t,n)=>{var r=n(7425).default;function i(){"use strict";e.exports=i=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},n=Object.prototype,o=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},l="function"==typeof Symbol?Symbol:{},u=l.iterator||"@@iterator",s=l.asyncIterator||"@@asyncIterator",c=l.toStringTag||"@@toStringTag";function d(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,n){return e[t]=n}}function v(e,t,n,r){var i=t&&t.prototype instanceof p?t:p,o=Object.create(i.prototype),l=new I(r||[]);return a(o,"_invoke",{value:E(e,n,l)}),o}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=v;var h={};function p(){}function m(){}function y(){}var g={};d(g,u,(function(){return this}));var _=Object.getPrototypeOf,b=_&&_(_(N([])));b&&b!==n&&o.call(b,u)&&(g=b);var w=y.prototype=p.prototype=Object.create(g);function x(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function n(i,a,l,u){var s=f(e[i],e,a);if("throw"!==s.type){var c=s.arg,d=c.value;return d&&"object"==r(d)&&o.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,l,u)}),(function(e){n("throw",e,l,u)})):t.resolve(d).then((function(e){c.value=e,l(c)}),(function(e){return n("throw",e,l,u)}))}u(s.arg)}var i;a(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}})}function E(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var l=S(a,n);if(l){if(l===h)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=f(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function S(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var i=f(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function N(e){if(e){var t=e[u];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(o.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:V}}function V(){return{value:void 0,done:!0}}return m.prototype=y,a(w,"constructor",{value:y,configurable:!0}),a(y,"constructor",{value:m,configurable:!0}),m.displayName=d(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,d(e,c,"GeneratorFunction")),e.prototype=Object.create(w),e},t.awrap=function(e){return{__await:e}},x(k.prototype),d(k.prototype,s,(function(){return this})),t.AsyncIterator=k,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new k(v(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},x(w),d(w,c,"Generator"),d(w,u,(function(){return this})),d(w,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=N,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var l=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(l&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:N(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},7425:e=>{function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},2841:(e,t,n)=>{var r=n(7609)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},l={};function u(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={exports:{}};return a[e](n,n.exports,u),n.exports}u.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return u.d(t,{a:t}),t},u.d=(e,t)=>{for(var n in t)u.o(t,n)&&!u.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},u.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),u.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};return(()=>{"use strict";u.r(s),u.d(s,{BkSearchSelect:()=>A,default:()=>M});var e=u(4212);function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function n(e){var n=function(e,n){if("object"!==t(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,"string");if("object"!==t(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===t(n)?n:String(n)}function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=u(748),o=null,a=null;function l(e,t){void 0===t&&(t={});var n=document.createElement(e);return Object.keys(t).forEach((function(e){n[e]=t[e]})),n}function c(e,t,n){return(window.getComputedStyle(e,n||null)||{display:"none"})[t]}function d(e){if(!document.documentElement.contains(e))return{detached:!0,rendered:!1};for(var t=e;t!==document;){if("none"===c(t,"display"))return{detached:!1,rendered:!1};t=t.parentNode}return{detached:!1,rendered:!0}}var v=0,f=null;function h(e,t){if(e.__resize_mutation_handler__||(e.__resize_mutation_handler__=p.bind(e)),!e.__resize_listeners__)if(e.__resize_listeners__=[],window.ResizeObserver){var n=e.offsetWidth,r=e.offsetHeight,i=new ResizeObserver((function(){(e.__resize_observer_triggered__||(e.__resize_observer_triggered__=!0,e.offsetWidth!==n||e.offsetHeight!==r))&&y(e)})),o=d(e),a=o.detached,u=o.rendered;e.__resize_observer_triggered__=!1===a&&!1===u,e.__resize_observer__=i,i.observe(e)}else if(e.attachEvent&&e.addEventListener)e.__resize_legacy_resize_handler__=function(){y(e)},e.attachEvent("onresize",e.__resize_legacy_resize_handler__),document.addEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);else if(v||(f=function(e){var t=document.createElement("style");return t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e)),(document.querySelector("head")||document.body).appendChild(t),t}('.resize-triggers{visibility:hidden;opacity:0;pointer-events:none}.resize-contract-trigger,.resize-contract-trigger:before,.resize-expand-trigger,.resize-triggers{content:"";position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden}.resize-contract-trigger,.resize-expand-trigger{background:#eee;overflow:auto}.resize-contract-trigger:before{width:200%;height:200%}')),function(e){var t=c(e,"position");t&&"static"!==t||(e.style.position="relative"),e.__resize_old_position__=t,e.__resize_last__={};var n=l("div",{className:"resize-triggers"}),r=l("div",{className:"resize-expand-trigger"}),i=l("div"),o=l("div",{className:"resize-contract-trigger"});r.appendChild(i),n.appendChild(r),n.appendChild(o),e.appendChild(n),e.__resize_triggers__={triggers:n,expand:r,expandChild:i,contract:o},g(e),e.addEventListener("scroll",m,!0),e.__resize_last__={width:e.offsetWidth,height:e.offsetHeight}}(e),e.__resize_rendered__=d(e).rendered,window.MutationObserver){var s=new MutationObserver(e.__resize_mutation_handler__);s.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),e.__resize_mutation_observer__=s}e.__resize_listeners__.push(t),v++}function p(){var e=d(this),t=e.rendered,n=e.detached;t!==this.__resize_rendered__&&(!n&&this.__resize_triggers__&&(g(this),this.addEventListener("scroll",m,!0)),this.__resize_rendered__=t,y(this))}function m(){var e,t,n=this;g(this),this.__resize_raf__&&(e=this.__resize_raf__,a||(a=(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(e){clearTimeout(e)}).bind(window)),a(e)),this.__resize_raf__=(t=function(){var e,t,r,i,o,a,l=(r=(t=(e=n).__resize_last__).width,i=t.height,o=e.offsetWidth,a=e.offsetHeight,o!==r||a!==i?{width:o,height:a}:null);l&&(n.__resize_last__=l,y(n))},o||(o=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){return setTimeout(e,16)}).bind(window)),o(t))}function y(e){e&&e.__resize_listeners__&&e.__resize_listeners__.forEach((function(t){t.call(e,e)}))}function g(e){var t=e.__resize_triggers__,n=t.expand,r=t.expandChild,i=t.contract,o=i.scrollWidth,a=i.scrollHeight,l=n.offsetWidth,u=n.offsetHeight,s=n.scrollWidth,c=n.scrollHeight;i.scrollLeft=o,i.scrollTop=a,r.style.width=l+1+"px",r.style.height=u+1+"px",n.scrollLeft=s,n.scrollTop=c}var _=u(2717),b=u(4061),w=u(6870),x=u(2841),k=u.n(x);function E(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((r=r.apply(e,t||[])).next())}))}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var S=u(5537),L=u.n(S);const C=(0,i.defineComponent)({name:"SearchSelectMenu",props:{list:{type:Array},hoverId:String,keyword:{type:String,default:""},multiple:{type:Boolean,default:!1},selected:{type:Array,default:function(){return[]}},conditions:{type:Array},footerBtns:{type:Array,default:function(){return[]}}},emits:["selectItem","selectCondition","footerClick"],setup:function(e,t){var n=t.emit,r=(0,_.useLocale)("searchSelect"),o=(0,_.usePrefix)().resolveClassName,a=(0,i.computed)((function(){return void 0===e.footerBtns||0===e.footerBtns.length?[{id:"confirm",name:r.value.ok},{id:"cancel",name:r.value.cancel,disabled:!1}]:e.footerBtns}));return{handleClick:function(e){n("selectItem",e)},handleClickCondition:function(e){n("selectCondition",e)},handleClickFooterBtn:function(e){n("footerClick",e)},filterList:(0,i.computed)((function(){var t,n;return(null===(t=e.list)||void 0===t?void 0:t.length)?(null===(n=e.keyword)||void 0===n?void 0:n.length)?e.list.filter((function(t){return t.name.toLocaleLowerCase().includes(e.keyword.toLocaleLowerCase())})):e.list:[]})),getSearchNode:function(t){var n;return(null===(n=t.value)||void 0===n?void 0:n.name)?[(0,i.createVNode)("span",{class:"menu-name"},[t.name,(0,i.createTextVNode)(":")]),t.value.name]:function(t){if(!t)return t;var n=e.keyword,r=n.length;if(!(null==n?void 0:n.trim().length)||!t.toLocaleLowerCase().includes(n.toLocaleLowerCase()))return t;var o=[],a=-1;return n=n.replace(/([.*/]{1})/gim,"\\$1"),t.replace(new RegExp("".concat(n),"igm"),(function(e,n){return 0===o.length&&0!==n?o.push(t.slice(0,n)):a>=0&&o.push(t.slice(a+e.length,n)),o.push((0,i.createVNode)("span",{class:"is-keyword"},[e])),a=n,e})),a>=0&&o.push(t.slice(a+r)),o.length?o:t}(t.name)},localFooterBtns:a,resolveClassName:o}},render:function(){var e,t,n,r=this;return(0,i.createVNode)("div",{class:this.resolveClassName("search-select-menu")},[!!(null===(e=this.conditions)||void 0===e?void 0:e.length)&&(0,i.createVNode)("ul",{class:"menu-header"},[this.conditions.map((function(e){return(0,i.createVNode)("li",{key:e.id,class:"menu-header-item ".concat(e.disabled?"is-disabled":""),onClick:function(){return!e.disabled&&r.handleClickCondition(e)}},[e.name])}))]),(0,i.createVNode)("ul",{class:"menu-content"},[null===(t=this.list)||void 0===t?void 0:t.map((function(e){return(0,i.createVNode)("li",{class:"menu-item ".concat(e.disabled?"is-disabled":""," ").concat(r.hoverId!==e.id||e.disabled?"":"is-hover"),key:e.id,id:e.id,tabindex:"-1",onClick:function(){return!e.disabled&&r.handleClick(e)}},[r.$slots.default?r.$slots.default({item:e,list:r.list,multiple:!!r.multiple,hoverId:r.hoverId,getSearchNode:r.getSearchNode}):(0,i.createVNode)(i.Fragment,null,[r.getSearchNode(e),r.multiple&&r.selected.includes(e.id)&&(0,i.createVNode)(w.Done,{class:"is-selected"},null)])])}))]),this.multiple&&(null===(n=this.localFooterBtns)||void 0===n?void 0:n.length)&&(0,i.createVNode)("div",{class:"menu-footer"},[this.localFooterBtns.map((function(e){return(0,i.createVNode)("span",{class:"menu-footer-btn ".concat(e.disabled?"is-disabled":""),key:e.id,onClick:function(){return!e.disabled&&r.handleClickFooterBtn(e)}},[e.name])}))])])}});function I(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,n(i.key),i)}}var N;!function(e){e.ALL="all",e.NEEDKEY="need-key"}(N||(N={}));var V,O=Symbol("SEARCH_SLECT_PROVIDER_KEY"),z=function(){return(0,i.inject)(O)};!function(e){e.DEFAULT="default",e.EDIT="edit"}(V||(V={}));var T=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"|";!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.searchItem=t,this.type=n,this.splitCode=r,this.values=[],this.id=t.id,this.name=t.name}var t,n;return t=e,(n=[{key:"multiple",get:function(){return!!this.searchItem.multiple}},{key:"placeholder",get:function(){return this.searchItem.placeholder||""}},{key:"children",get:function(){return this.searchItem.children||[]}},{key:"validate",get:function(){return!this.searchItem.noValidate}},{key:"inputInnerHtml",get:function(){var e;return this.isSpecialType()?this.name:"".concat(this.keyInnerHtml).concat((null===(e=this.values)||void 0===e?void 0:e.map((function(e){return e.name})).join(this.splitCode))||"")}},{key:"inputInnerText",get:function(){var e;return this.isSpecialType()?this.name:"".concat(this.keyInnerText).concat((null===(e=this.values)||void 0===e?void 0:e.map((function(e){return e.name})).join(this.splitCode))||"")}},{key:"keyInnerHtml",get:function(){return this.isSpecialType()?this.name:this.name?"".concat(this.name,": "):""}},{key:"keyInnerText",get:function(){return this.isSpecialType()?this.name:this.name?"".concat(this.name,": "):""}},{key:"isSpecialType",value:function(){return["text","condition"].includes(this.type)}},{key:"addValue",value:function(e){if(this.multiple){var t=this.values.findIndex((function(t){return t.id===e.id}));return t>-1?void this.values.splice(t,1):void this.values.push(e)}this.values=[e]}},{key:"toValue",value:function(){var e,t={id:this.id,name:this.name};return(null===(e=this.values)||void 0===e?void 0:e.length)&&(t.values=this.values.map((function(e){return{id:e.id,name:e.name}}))),this.type&&"default"!==this.type&&(t.type=this.type),t}},{key:"toValueKey",value:function(){return JSON.stringify(this.toValue())}},{key:"isInValueList",value:function(e){return this.children.some((function(t){return t.id===(null==e?void 0:e.id)}))}}])&&I(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();const j=(0,i.defineComponent)({name:"SearchSelectInput",directives:{clickoutside:b.clickoutside},props:{data:{type:Array,required:!0},showInputBefore:Boolean,showCondition:Boolean,clickOutside:Function,placeholder:String,conditions:{type:Array,default:function(){return[]}},defautUsingItem:Object,mode:{type:String,default:V.DEFAULT},getMenuList:Function,validateValues:Function,valueBehavior:String},emits:["focus","add","delete"],setup:function(t,n){var r=n.emit,o=n.expose,a=(0,_.useLocale)("searchSelect"),l=(0,_.usePrefix)().resolveClassName,u=(0,i.ref)(null),s=(0,i.ref)(null),c=(0,i.ref)(""),d=(0,i.ref)(!1),v=(0,i.ref)(!1),f=(0,i.ref)(!1),h=(0,i.ref)(t.defautUsingItem),p=(0,i.ref)(""),m=(0,i.ref)(!1),y=(0,e.debounce)(300,q),g=!1,b=(0,i.ref)([]),w=(0,i.ref)([]),x=z(),S=x.editKey,L=x.onValidate,C=x.valueSplitCode;function I(e){switch(e.code){case"ArrowDown":case"ArrowUp":O(e);break;case"Enter":case"NumpadEnter":!function(e){if(g){e.preventDefault();var t=w.value.find((function(e){return e.id===p.value}));t&&B(t)}}(e)}}function O(e){var t;e.preventDefault(),null===(t=u.value)||void 0===t||t.blur();for(var n=w.value.length,r=n,i=w.value.findIndex((function(e){return e.id===p.value}));r>=0;){i=(i="ArrowDown"===e.code?i+1:i-1)>n-1?0:i<0?n-1:i;var o=w.value[i];if(o&&!o.disabled){r=-1;var a=document.getElementById(o.id);return null==a||a.focus(),void(p.value=o.id)}r-=1}}function j(e){M(),e&&q()}function F(e){var n;return E(this,void 0,void 0,k().mark((function i(){var o,a,l,u,s;return k().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return null==e||e.preventDefault(),i.next=3,new Promise((function(e){return setTimeout(e,0)}));case 3:if(h.value){i.next=16;break}if(c.value&&t.valueBehavior!==N.NEEDKEY){i.next=6;break}return i.abrupt("return");case 6:return o={id:c.value,name:c.value},i.next=9,D(o);case 9:if(i.sent){i.next=12;break}return i.abrupt("return");case 12:return r("add",new T(o,"text",C.value)),c.value="",q(),i.abrupt("return");case 16:if(null==(a=h.value.values)?void 0:a.length){i.next=43;break}if(!(null===(n=c.value)||void 0===n?void 0:n.length)){i.next=41;break}if(!c.value.includes(C.value)){i.next=29;break}return l=c.value.split(C.value),i.next=23,D({id:c.value,name:c.value});case 23:if(i.sent){i.next=26;break}return i.abrupt("return");case 26:l.forEach((function(e){return h.value.addValue({id:e,name:e})})),i.next=36;break;case 29:return u={id:c.value,name:c.value},i.next=32,D(u);case 32:if(i.sent){i.next=35;break}return i.abrupt("return");case 35:h.value.addValue(u);case 36:return r("add",h.value),c.value="",h.value=null,M(!0),i.abrupt("return");case 41:return d.value=!0,i.abrupt("return");case 43:if(!c.value){i.next=56;break}return s={id:c.value,name:c.value},i.next=47,D(s);case 47:if(i.sent){i.next=50;break}return i.abrupt("return");case 50:return h.value.addValue(s),r("add",h.value),c.value="",h.value=null,M(!0),i.abrupt("return");case 56:return i.next=58,D();case 58:if(i.sent){i.next=61;break}return i.abrupt("return");case 61:K();case 62:case"end":return i.stop()}}),i)})))}function B(e,n){var r,i,o,a,l,s;return E(this,void 0,void 0,k().mark((function d(){var v,m;return k().wrap((function(d){for(;;)switch(d.prev=d.next){case 0:if(!(null===(r=e.value)||void 0===r?void 0:r.id)){d.next=21;break}if((t.valueBehavior!==N.NEEDKEY||!e.value)&&t.validateValues){d.next=8;break}return(v=new T(Object.assign(Object.assign({},e),{id:null!==(i=e.realId)&&void 0!==i?i:e.id}),n,C.value)).addValue(e.value),K(v),t.valueBehavior===N.NEEDKEY&&p.value&&M(!0),p.value="",d.abrupt("return");case 8:return h.value=new T(Object.assign(Object.assign({},e),{id:null!==(o=e.realId)&&void 0!==o?o:e.id}),n,C.value),h.value.addValue(e.value),d.next=12,D(e.value);case 12:if(d.sent){d.next=16;break}return h.value=null,d.abrupt("return");case 16:return K(h.value),p.value="",M(!0),d.abrupt("return");case 21:if(h.value&&(null===(a=null==u?void 0:u.value)||void 0===a?void 0:a.innerText)){d.next=29;break}return h.value=new T(e,n,C.value),c.value="",(m="condition"===n)&&K(),f.value=m||!!h.value.children.length,M(t.valueBehavior===N.NEEDKEY&&!!p.value),d.abrupt("return");case 29:if("condition"!==(null===(l=h.value)||void 0===l?void 0:l.type)){d.next=33;break}return h.value=new T(e,n,C.value),K(),d.abrupt("return");case 33:return h.value.addValue(e),d.next=36,D(e);case 36:if(d.sent){d.next=39;break}return d.abrupt("return");case 39:h.value.multiple||K(),t.valueBehavior===N.NEEDKEY&&(null===(s=h.value)||void 0===s?void 0:s.multiple)&&M();case 41:case"end":return d.stop()}}),d)})))}function D(e){return E(this,void 0,void 0,k().mark((function n(){var r,i,o,a;return k().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(h.value){n.next=4;break}return n.next=3,A(null,[e]);case 3:case 8:return n.abrupt("return",n.sent);case 4:if(r=h.value,i=r.searchItem,o=r.validate,a=r.values,!o||"function"!=typeof t.validateValues){n.next=9;break}return n.next=8,A(i,e?[e]:a);case 9:return L(""),n.abrupt("return",!0);case 11:case"end":return n.stop()}}),n)})))}function A(e,n){var r;return E(this,void 0,void 0,k().mark((function i(){var o;return k().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,null===(r=t.validateValues)||void 0===r?void 0:r.call(t,null!=e?e:null,n).catch((function(){return!1}));case 2:if("string"!=typeof(o=i.sent)&&!1!==o){i.next=6;break}return L(o||"校验错误"),i.abrupt("return",!1);case 6:return L(""),i.abrupt("return",!0);case 8:case"end":return i.stop()}}),i)})))}function M(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(0,i.nextTick)().then((function(){q()})),v.value=!0,f.value=!0,d.value=!1;var e=setTimeout((function(){if(u.value){u.value.focus();var t=window.getSelection();0===t.focusOffset&&(t.selectAllChildren(u.value),t.collapseToEnd())}window.clearTimeout(e)}),0);r("focus",v.value)}function q(){var n,r,i,o,a;return E(this,void 0,void 0,k().mark((function l(){var u,s;return k().wrap((function(l){for(;;)switch(l.prev=l.next){case 0:if(u=[],"function"!=typeof t.getMenuList||void 0!==(null===(r=null===(n=h.value)||void 0===n?void 0:n.searchItem)||void 0===r?void 0:r.async)&&!0!==h.value.searchItem.async){l.next=9;break}return m.value=!0,l.next=5,t.getMenuList(null===(i=h.value)||void 0===i?void 0:i.searchItem,c.value).catch((function(){return[]}));case 5:u=l.sent,m.value=!1,l.next=10;break;case 9:(null==h?void 0:h.value)?"condition"===h.value.type?u=t.conditions:(null===(a=h.value.values)||void 0===a?void 0:a.length)&&!h.value.multiple&&t.mode!==V.EDIT||(u=h.value.children.filter((function(e){return e.name.toLocaleLowerCase().includes(c.value.toLocaleLowerCase())}))):(null===(o=c.value)||void 0===o?void 0:o.length)?t.data.filter((function(e){return!e.isSelected})).forEach((function(t){var n,r;t.name.toLocaleLowerCase().includes(c.value.toLocaleLowerCase())?(u.push(t),null===(n=t.children)||void 0===n||n.forEach((function(n){u.push(Object.assign(Object.assign({},t),{realId:t.id,id:(0,e.random)(10),value:n}))})),u.push(Object.assign(Object.assign({},t),{realId:t.id,id:(0,e.random)(10),value:{id:c.value,name:c.value}}))):(null===(r=t.children)||void 0===r||r.forEach((function(n){n.name.toLocaleLowerCase().includes(c.value.toLocaleLowerCase())&&u.push(Object.assign(Object.assign({},t),{realId:t.id,id:(0,e.random)(10),value:n}))})),u.push(Object.assign(Object.assign({},t),{value:{id:c.value,name:c.value}})))})):u=t.data.filter((function(e){return!e.isSelected})).slice();case 10:w.value=u,t.valueBehavior===N.NEEDKEY&&(s=u.find((function(e){return!e.disabled})))&&(!p.value||p.value&&!u.some((function(e){return e.id===p.value})))&&(p.value=s.id);case 12:case"end":return l.stop()}}),l)})))}function K(e){r("add",null!=e?e:h.value),h.value=null,c.value="",M(t.valueBehavior===N.NEEDKEY)}function P(){var e=u.value.innerText;"\n"===e[e.length-1]||"\r"===e[0]?(H(e.slice(0,-1)),P()):"\n"!==e[0]&&"\r"!==e[0]||(H(e.slice(1)),P())}function H(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";u.value&&(u.value.innerHTML=t||(null===(e=h.value)||void 0===e?void 0:e.inputInnerHtml)||"")}return(0,i.watch)(S,(function(){t.mode===V.DEFAULT&&S.value&&(f.value=!1)})),(0,i.watchEffect)((function(){c.value||H()}),{flush:"pre"}),(0,i.watch)([w,f],(function(){var e;(null===(e=w.value)||void 0===e?void 0:e.some((function(e){return!e.disabled})))&&f.value?g||(t.valueBehavior===N.NEEDKEY?p.value=w.value.find((function(e){return!e.disabled})).id:p.value="",g=!0,document.addEventListener("keydown",I)):(document.removeEventListener("keydown",I),g=!1,t.valueBehavior!==N.NEEDKEY&&(p.value=""))})),o({handleInputFocus:j,isFocus:v}),{popoverRef:s,inputRef:u,keyword:c,loading:m,remoteMenuList:b,menuList:w,menuHoverId:p,isFocus:v,usingItem:h,showPopover:f,showNoSelectValueError:d,debounceSetMenuList:y,documentArrowEvent:O,handleClickOutside:function(e){var n,i;!(null===(n=s.value)||void 0===n?void 0:n.contains(e.target))&&(null===(i=t.clickOutside)||void 0===i?void 0:i.call(t,e.target,s.value))&&(f.value=!1,v.value=!1,r("focus",v.value))},handleInputFocus:j,handleInputChange:function(e){var t,n,r,i,o,a,l,s,d;P();var v=e.target.innerText;if(/(\r|\n)/gm.test(v)||/\s{2}/gm.test(v))e.preventDefault(),v=v.replace(/(\r|\n)/gm,C.value).replace(/\s{2}/gm,""),u.value.innerText=v,M(),c.value=v.replace((null===(t=h.value)||void 0===t?void 0:t.keyInnerText)||"","").trim(),y();else if(!c.value&&v.length<((null===(r=null===(n=h.value)||void 0===n?void 0:n.inputInnerText)||void 0===r?void 0:r.length)||1)){var f=v.replace(" "," ").replace((null===(i=h.value)||void 0===i?void 0:i.keyInnerText.replace(" "," ").trim())||"","").trim();if(v&&(null===(o=h.value)||void 0===o?void 0:o.keyInnerText)&&v.replace(" "," ").includes(h.value.keyInnerText.replace(" "," ").trim())&&f&&(null===(a=h.value.values)||void 0===a?void 0:a.length))return c.value=f,console.info("outerText",f),void y();!f&&(null==v?void 0:v.length)||(h.value=null),c.value=f?v:"",y()}else(null===(s=null===(l=h.value)||void 0===l?void 0:l.values)||void 0===s?void 0:s.length)||(c.value=v.replace(" "," ").replace((null===(d=h.value)||void 0===d?void 0:d.keyInnerText.replace(" "," "))||"","").trim(),M(),y())},handleInputKeyup:function(e){switch(e.code){case"Enter":case"NumpadEnter":if(t.valueBehavior===N.NEEDKEY&&w.value.some((function(e){return e.id===p.value})))return;F(e);break;case"Backspace":!function(){var e,n;if(!h.value&&!c.value)return r("delete"),void(0,i.nextTick)(q);if(null===(e=h.value)||void 0===e?void 0:e.values.length){if((null===(n=h.value)||void 0===n?void 0:n.multiple)||h.value.isInValueList(h.value.values[0])||t.mode===V.EDIT&&!c.value)return h.value.values.splice(-1,1),c.value="",void M()}else c.value||(h.value=null,c.value="",q());L("")}();default:d.value=!1}},handleSelectItem:B,handleSelectCondtionItem:function(e){B(e,"condition")},handleMenuFooterClick:function(e){var t;switch(e.id){case"confirm":if(!(null===(t=h.value)||void 0===t?void 0:t.values.length))return;c.value="",F();break;case"cancel":h.value.values=[],f.value=!1}},resolveClassName:l,t:a}},render:function(){var e,t,n=this,r=this.usingItem||{},o=r.multiple,a=r.values,l=r.placeholder,u=r.inputInnerHtml,s=!(null===(e=this.keyword)||void 0===e?void 0:e.length)&&!(null==a?void 0:a.length)&&l,c=this.loading||this.showNoSelectValueError||this.showPopover&&!!(null===(t=this.menuList)||void 0===t?void 0:t.length),d=!this.usingItem&&this.showCondition,v=Object.assign({},this.$slots.menu?{default:function(e){var t,r;return null===(r=(t=n.$slots).menu)||void 0===r?void 0:r.call(t,e)}}:{});return(0,i.createVNode)(L(),{trigger:"manual",theme:"light",placement:"bottom-start",arrow:!1,disableOutsideClick:!0,isShow:c},{default:function(){var e;return(0,i.withDirectives)((0,i.createVNode)("div",{ref:"inputRef",class:{"div-input":!0,"input-before":n.showInputBefore&&!(null===(e=n.keyword)||void 0===e?void 0:e.length),"input-after":s},contenteditable:!0,"data-placeholder":u||n.keyword?"":n.placeholder,"data-tips":l||"",spellcheck:"false",onFocus:n.handleInputFocus,onInput:n.handleInputChange,onKeydown:n.handleInputKeyup},null),[[(0,i.resolveDirective)("clickoutside"),n.handleClickOutside]])},content:function(){var e;return n.loading?(0,i.createVNode)("div",null,[n.t.loading]):n.showNoSelectValueError?(0,i.createVNode)("div",null,[n.t.filterQueryMustHasValue]):(null===(e=n.menuList)||void 0===e?void 0:e.length)?(0,i.createVNode)("div",{ref:"popoverRef",class:n.resolveClassName("search-select-popover")},[(0,i.createVNode)(C,{list:n.menuList,keyword:n.keyword,multiple:!!o,hoverId:n.menuHoverId,selected:(null==a?void 0:a.map((function(e){return e.id})))||[],conditions:d?n.conditions:[],onSelectItem:n.handleSelectItem,onSelectCondition:n.handleSelectCondtionItem,onFooterClick:n.handleMenuFooterClick},Object.assign({},v))]):void 0}})}}),F=(0,i.defineComponent)({name:"SearchSelected",props:{data:{type:Array,required:!0},selectedList:{type:Array,required:!0},overflowIndex:{type:Number,default:-1},conditions:{type:Array,default:function(){return[]}},getMenuList:Function,validateValues:Function,valueBehavior:String},emits:["delete"],setup:function(e,t){var n=t.emit,r=(0,i.ref)(null),o=z(),a=o.onEditClick,l=o.onEditEnter,u=o.onEditBlur,s=o.editKey,c=o.valueSplitCode;return{inputRef:r,editKey:s,copySeletedItem:function(e){var t=new T(e.searchItem,e.type,c.value);return t.values=e.values.slice(),t},handleDeleteSelected:function(e){n("delete",e)},handleEditSeleted:function(e,t,n){e.preventDefault(),e.stopPropagation(),a(t,n),setTimeout((function(){return r.value.handleInputFocus()}),200)},handleInputOutside:function(){return!0},handleAddSelected:function(e,t){l(e,t)},handleInputFocus:function(e){e||u()}}},render:function(){var e=this,t=function(t,n){return e.editKey==="".concat(t.id,"_").concat(n)?(0,i.createVNode)("div",{class:"selected-input",key:e.editKey.toString()},[(0,i.createVNode)(j,{ref:"inputRef",key:e.editKey.toString(),mode:V.EDIT,data:e.data,showCondition:!1,conditions:e.conditions,defautUsingItem:e.copySeletedItem(t),clickOutside:e.handleInputOutside,getMenuList:e.getMenuList,validateValues:e.validateValues,valueBehavior:e.valueBehavior,onAdd:function(t){return e.handleAddSelected(t,n)},onFocus:e.handleInputFocus},null)]):(0,i.createVNode)("li",{class:"search-container-selected ".concat((e.overflowIndex>=0?n<e.overflowIndex:n>=0)?"":"hidden-selected"),key:"".concat(t.id,"_").concat(n)},[(0,i.createVNode)("span",{class:"selected-name",onClick:function(r){return e.handleEditSeleted(r,t,n)}},[t.inputInnerText]),(0,i.createVNode)(w.Error,{class:"selected-clear",onClick:function(){return e.handleDeleteSelected(n)}},null)])};return(0,i.createVNode)(i.Fragment,null,[this.selectedList.map((function(n,r){return[e.overflowIndex>=0&&r===e.overflowIndex&&(0,i.createVNode)("div",{class:"search-container-selected overflow-selected"},[(0,i.createTextVNode)("+"),e.selectedList.length-e.overflowIndex]),t(n,r)]}))])}});var B={data:{type:Array,default:function(){return[]}},modelValue:{type:Array,default:function(){return[]}},shrink:{type:Boolean,default:!0},maxHeight:{type:Number,default:120},minHeight:{type:Number,default:26},conditions:{type:Array,default:function(){return[]}},clearable:{type:Boolean,default:!0},placeholder:String,getMenuList:Function,validateValues:Function,valueSplitCode:{type:String,default:"|"},uniqueSelect:{type:Boolean,default:!1},valueBehavior:{type:String,default:N.ALL,validator:function(e){return[N.ALL,N.NEEDKEY].includes(e)}}};const D=(0,i.defineComponent)({name:"SearchSelect",directives:{clickoutside:b.clickoutside},props:B,emits:["update:modelValue","search"],setup:function(t,n){var r,o=n.emit,a=(0,_.useLocale)("searchSelect"),l=(0,_.usePrefix)().resolveClassName,u=(0,i.computed)((function(){return void 0===t.conditions?[{id:"or",name:a.value.or},{id:"and",name:a.value.and}]:t.conditions})),s=(0,i.ref)(null),c=(0,i.ref)(null),d=(0,i.ref)(!1),p=(0,i.ref)([]),y=(0,i.ref)(-1),g=(0,e.debounce)(32,C),b=(0,i.ref)(""),w=(0,i.ref)(""),x=(0,i.computed)((function(){return t.valueSplitCode})),k=(0,i.shallowRef)([]);function E(e,t){b.value="".concat(e.id,"_").concat(t)}function S(e,t){var n=p.value.slice();n.splice(t,1,e),o("update:modelValue",n.map((function(e){return e.toValue()}))),b.value=""}function L(e){w.value=e||""}function C(){if(d.value||p.value.length<1)y.value=-1;else{for(var e=c.value.querySelector(".".concat(l("search-select-container"))),n=c.value.querySelector(".search-container").clientWidth-6-2,r=e.querySelectorAll(".search-container-selected:not(.overflow-selected)"),i=0,o=0,a=0;0===o&&i<=n-40&&a<=r.length-1;){var u=r[a];if(u.clientHeight>t.minHeight)return void(y.value=a);(i+=u?u.clientWidth+6:0)>=n-40&&(o=a),a+=1}o===r.length-1&&i<=n?y.value=-1:y.value=i>=n-40?o:o-1}}return(0,i.watch)((function(){return t.data}),(function(){var e;k.value=JSON.parse(JSON.stringify(t.data)),null===(e=k.value)||void 0===e||e.forEach((function(e){e.isSelected=t.uniqueSelect&&!!t.modelValue.some((function(t){return t.id===e.id}))}))}),{immediate:!0}),(0,i.watch)((function(){return t.modelValue}),(function(e){var n,r;if(!(null==e?void 0:e.length))return p.value=[],void(null===(n=k.value)||void 0===n||n.forEach((function(e){e.isSelected=!1})));var i=[];e.forEach((function(e){var n,r=p.value.find((function(t){return t.id===e.id&&t.name===e.name}));if((null==r?void 0:r.toValueKey())===JSON.stringify(e))r.values=e.values||[],i.push(r);else{var o=t.data.find((function(t){return t.id===e.id})),a="default";o||(o=t.conditions.find((function(t){return t.id===e.id})))&&(a="condition"),o||(null===(n=e.values)||void 0===n?void 0:n.length)||(a="text");var l=new T(o||e,a,x.value);l.values=e.values||[],i.push(l)}})),p.value=i,null===(r=k.value)||void 0===r||r.forEach((function(e){e.isSelected=t.uniqueSelect&&!!i.some((function(t){return t.id===e.id}))}))}),{immediate:!0,deep:!0}),(0,i.onMounted)((function(){h(c.value.querySelector(".".concat(l("search-select-container"))),g)})),(0,i.onBeforeUnmount)((function(){!function(e,t){var n=e.__resize_listeners__;if(n){if(t&&n.splice(n.indexOf(t),1),!n.length||!t){if(e.detachEvent&&e.removeEventListener)return e.detachEvent("onresize",e.__resize_legacy_resize_handler__),void document.removeEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);e.__resize_observer__?(e.__resize_observer__.unobserve(e),e.__resize_observer__.disconnect(),e.__resize_observer__=null):(e.__resize_mutation_observer__&&(e.__resize_mutation_observer__.disconnect(),e.__resize_mutation_observer__=null),e.removeEventListener("scroll",m),e.removeChild(e.__resize_triggers__.triggers),e.__resize_triggers__=null),e.__resize_listeners__=null}! --v&&f&&f.parentNode.removeChild(f)}}(c.value.querySelector(".".concat(l("search-select-container"))),g)})),r={onEditClick:E,onEditEnter:S,onEditBlur:function(){b.value="",L("")},onValidate:L,editKey:b,valueSplitCode:x},(0,i.provide)(O,r),{inputRef:s,wrapRef:c,isFocus:d,copyData:k,selectedList:p,overflowIndex:y,validateStr:w,splitCode:x,onEditClick:E,onEditEnter:S,handleWrapClick:function(){b.value||s.value.handleInputFocus()},handleInputFocus:function(e){var t;e&&(y.value=-1),!1===e&&(null===(t=c.value.querySelector(".".concat(l("search-select-container"))))||void 0===t||t.scrollTo(0,0)),d.value=e},handleResize:C,handleClearAll:function(){p.value=[],y.value=-1,o("update:modelValue",[])},handleInputOutside:function(e){var t;return!(null===(t=c.value)||void 0===t?void 0:t.contains(e))},handleAddSelected:function(e){var t=p.value.slice();t.push(e),L(""),o("update:modelValue",t.map((function(e){return e.toValue()})))},handleDeleteSelected:function(e){var t=p.value.slice();t.splice("number"==typeof e?e:p.value.length-1,1),L(""),o("update:modelValue",t.map((function(e){return e.toValue()})))},handleClickSearch:function(e){o("search",e)},localConditions:u,resolveClassName:l,t:a}},render:function(){var e,t,n,o=this,a="".concat(!this.shrink||this.isFocus?this.maxHeight:this.minHeight,"px"),l=!!this.selectedList.length&&"condition"!==this.selectedList.slice(-1)[0].type,u=Object.assign({},this.$slots.menu?{menu:function(e){var t,n;return null===(n=(t=o.$slots).menu)||void 0===n?void 0:n.call(t,e)}}:{});return(0,i.createVNode)("div",{class:this.resolveClassName("search-select"),ref:"wrapRef"},[(0,i.createVNode)("div",{class:(e={},r(e,this.resolveClassName("search-select-container"),!0),r(e,"is-focus",this.isFocus),e),onClick:this.handleWrapClick},[(0,i.createVNode)("div",{class:"search-prefix"},[null===(n=(t=this.$slots).prepend)||void 0===n?void 0:n.call(t)]),(0,i.createVNode)("div",{class:"search-container",style:{maxHeight:a}},[(0,i.createVNode)(F,{data:this.copyData,conditions:this.localConditions,selectedList:this.selectedList,overflowIndex:this.overflowIndex,getMenuList:this.getMenuList,validateValues:this.validateValues,valueBehavior:this.valueBehavior,onDelete:this.handleDeleteSelected},Object.assign({},u)),(0,i.createVNode)("div",{class:"search-container-input"},[(0,i.createVNode)(j,{ref:"inputRef",data:this.copyData,showInputBefore:!this.selectedList.length,showCondition:l,conditions:this.localConditions,placeholder:this.placeholder||this.t.pleaseSelect,clickOutside:this.handleInputOutside,getMenuList:this.getMenuList,validateValues:this.validateValues,valueBehavior:this.valueBehavior,onAdd:this.handleAddSelected,onDelete:this.handleDeleteSelected,onFocus:this.handleInputFocus},Object.assign({},u))])]),(0,i.createVNode)("div",{class:"search-nextfix"},[this.clearable&&!!this.selectedList.length&&(0,i.createVNode)(w.Close,{class:"search-clear",onClick:this.handleClearAll},null),this.$slots.append?this.$slots.append():(0,i.createVNode)(w.Search,{onClick:this.handleClickSearch,class:"search-nextfix-icon ".concat(this.isFocus?"is-focus":"")},null)])]),!!this.validateStr.length&&(0,i.createVNode)("div",{class:this.resolveClassName("search-select-tips")},[this.$slots.validate?this.$slots.validate():(0,i.createVNode)(i.Fragment,null,[(0,i.createVNode)(w.ExclamationCircleShape,{class:"select-tips"},null),this.validateStr||""])])])}});var A=(0,e.withInstall)(D);const M=A})(),s})()));
1
+ import "./search-select.less";
2
+ import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__ from "../shared";
3
+ import * as __WEBPACK_EXTERNAL_MODULE_vue__ from "vue";
4
+ import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3__ from "../config-provider";
5
+ import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_directives_45d4776f__ from "../directives";
6
+ import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__ from "../icon";
7
+ import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_popover_9b03f19d__ from "../popover";
8
+ import "../popover/popover.less";
9
+ import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_checkbox_13b1cb4a__ from "../checkbox";
10
+ import "../checkbox/checkbox.less";
11
+ import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_radio_d36f24cf__ from "../radio";
12
+ import "../radio/radio.less";
13
+ /******/ var __webpack_modules__ = ({
14
+
15
+ /***/ 7609:
16
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
17
+
18
+ var _typeof = (__webpack_require__(7425)["default"]);
19
+ function _regeneratorRuntime() {
20
+ "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
21
+ module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
22
+ return exports;
23
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports;
24
+ var exports = {},
25
+ Op = Object.prototype,
26
+ hasOwn = Op.hasOwnProperty,
27
+ defineProperty = Object.defineProperty || function (obj, key, desc) {
28
+ obj[key] = desc.value;
29
+ },
30
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
31
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
32
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
33
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
34
+ function define(obj, key, value) {
35
+ return Object.defineProperty(obj, key, {
36
+ value: value,
37
+ enumerable: !0,
38
+ configurable: !0,
39
+ writable: !0
40
+ }), obj[key];
41
+ }
42
+ try {
43
+ define({}, "");
44
+ } catch (err) {
45
+ define = function define(obj, key, value) {
46
+ return obj[key] = value;
47
+ };
48
+ }
49
+ function wrap(innerFn, outerFn, self, tryLocsList) {
50
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
51
+ generator = Object.create(protoGenerator.prototype),
52
+ context = new Context(tryLocsList || []);
53
+ return defineProperty(generator, "_invoke", {
54
+ value: makeInvokeMethod(innerFn, self, context)
55
+ }), generator;
56
+ }
57
+ function tryCatch(fn, obj, arg) {
58
+ try {
59
+ return {
60
+ type: "normal",
61
+ arg: fn.call(obj, arg)
62
+ };
63
+ } catch (err) {
64
+ return {
65
+ type: "throw",
66
+ arg: err
67
+ };
68
+ }
69
+ }
70
+ exports.wrap = wrap;
71
+ var ContinueSentinel = {};
72
+ function Generator() {}
73
+ function GeneratorFunction() {}
74
+ function GeneratorFunctionPrototype() {}
75
+ var IteratorPrototype = {};
76
+ define(IteratorPrototype, iteratorSymbol, function () {
77
+ return this;
78
+ });
79
+ var getProto = Object.getPrototypeOf,
80
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
81
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
82
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
83
+ function defineIteratorMethods(prototype) {
84
+ ["next", "throw", "return"].forEach(function (method) {
85
+ define(prototype, method, function (arg) {
86
+ return this._invoke(method, arg);
87
+ });
88
+ });
89
+ }
90
+ function AsyncIterator(generator, PromiseImpl) {
91
+ function invoke(method, arg, resolve, reject) {
92
+ var record = tryCatch(generator[method], generator, arg);
93
+ if ("throw" !== record.type) {
94
+ var result = record.arg,
95
+ value = result.value;
96
+ return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
97
+ invoke("next", value, resolve, reject);
98
+ }, function (err) {
99
+ invoke("throw", err, resolve, reject);
100
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
101
+ result.value = unwrapped, resolve(result);
102
+ }, function (error) {
103
+ return invoke("throw", error, resolve, reject);
104
+ });
105
+ }
106
+ reject(record.arg);
107
+ }
108
+ var previousPromise;
109
+ defineProperty(this, "_invoke", {
110
+ value: function value(method, arg) {
111
+ function callInvokeWithMethodAndArg() {
112
+ return new PromiseImpl(function (resolve, reject) {
113
+ invoke(method, arg, resolve, reject);
114
+ });
115
+ }
116
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
117
+ }
118
+ });
119
+ }
120
+ function makeInvokeMethod(innerFn, self, context) {
121
+ var state = "suspendedStart";
122
+ return function (method, arg) {
123
+ if ("executing" === state) throw new Error("Generator is already running");
124
+ if ("completed" === state) {
125
+ if ("throw" === method) throw arg;
126
+ return doneResult();
127
+ }
128
+ for (context.method = method, context.arg = arg;;) {
129
+ var delegate = context.delegate;
130
+ if (delegate) {
131
+ var delegateResult = maybeInvokeDelegate(delegate, context);
132
+ if (delegateResult) {
133
+ if (delegateResult === ContinueSentinel) continue;
134
+ return delegateResult;
135
+ }
136
+ }
137
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
138
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
139
+ context.dispatchException(context.arg);
140
+ } else "return" === context.method && context.abrupt("return", context.arg);
141
+ state = "executing";
142
+ var record = tryCatch(innerFn, self, context);
143
+ if ("normal" === record.type) {
144
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
145
+ return {
146
+ value: record.arg,
147
+ done: context.done
148
+ };
149
+ }
150
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
151
+ }
152
+ };
153
+ }
154
+ function maybeInvokeDelegate(delegate, context) {
155
+ var methodName = context.method,
156
+ method = delegate.iterator[methodName];
157
+ if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
158
+ var record = tryCatch(method, delegate.iterator, context.arg);
159
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
160
+ var info = record.arg;
161
+ return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
162
+ }
163
+ function pushTryEntry(locs) {
164
+ var entry = {
165
+ tryLoc: locs[0]
166
+ };
167
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
168
+ }
169
+ function resetTryEntry(entry) {
170
+ var record = entry.completion || {};
171
+ record.type = "normal", delete record.arg, entry.completion = record;
172
+ }
173
+ function Context(tryLocsList) {
174
+ this.tryEntries = [{
175
+ tryLoc: "root"
176
+ }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
177
+ }
178
+ function values(iterable) {
179
+ if (iterable) {
180
+ var iteratorMethod = iterable[iteratorSymbol];
181
+ if (iteratorMethod) return iteratorMethod.call(iterable);
182
+ if ("function" == typeof iterable.next) return iterable;
183
+ if (!isNaN(iterable.length)) {
184
+ var i = -1,
185
+ next = function next() {
186
+ for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
187
+ return next.value = undefined, next.done = !0, next;
188
+ };
189
+ return next.next = next;
190
+ }
191
+ }
192
+ return {
193
+ next: doneResult
194
+ };
195
+ }
196
+ function doneResult() {
197
+ return {
198
+ value: undefined,
199
+ done: !0
200
+ };
201
+ }
202
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
203
+ value: GeneratorFunctionPrototype,
204
+ configurable: !0
205
+ }), defineProperty(GeneratorFunctionPrototype, "constructor", {
206
+ value: GeneratorFunction,
207
+ configurable: !0
208
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
209
+ var ctor = "function" == typeof genFun && genFun.constructor;
210
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
211
+ }, exports.mark = function (genFun) {
212
+ return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
213
+ }, exports.awrap = function (arg) {
214
+ return {
215
+ __await: arg
216
+ };
217
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
218
+ return this;
219
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
220
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
221
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
222
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
223
+ return result.done ? result.value : iter.next();
224
+ });
225
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
226
+ return this;
227
+ }), define(Gp, "toString", function () {
228
+ return "[object Generator]";
229
+ }), exports.keys = function (val) {
230
+ var object = Object(val),
231
+ keys = [];
232
+ for (var key in object) keys.push(key);
233
+ return keys.reverse(), function next() {
234
+ for (; keys.length;) {
235
+ var key = keys.pop();
236
+ if (key in object) return next.value = key, next.done = !1, next;
237
+ }
238
+ return next.done = !0, next;
239
+ };
240
+ }, exports.values = values, Context.prototype = {
241
+ constructor: Context,
242
+ reset: function reset(skipTempReset) {
243
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
244
+ },
245
+ stop: function stop() {
246
+ this.done = !0;
247
+ var rootRecord = this.tryEntries[0].completion;
248
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
249
+ return this.rval;
250
+ },
251
+ dispatchException: function dispatchException(exception) {
252
+ if (this.done) throw exception;
253
+ var context = this;
254
+ function handle(loc, caught) {
255
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
256
+ }
257
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
258
+ var entry = this.tryEntries[i],
259
+ record = entry.completion;
260
+ if ("root" === entry.tryLoc) return handle("end");
261
+ if (entry.tryLoc <= this.prev) {
262
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
263
+ hasFinally = hasOwn.call(entry, "finallyLoc");
264
+ if (hasCatch && hasFinally) {
265
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
266
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
267
+ } else if (hasCatch) {
268
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
269
+ } else {
270
+ if (!hasFinally) throw new Error("try statement without catch or finally");
271
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
272
+ }
273
+ }
274
+ }
275
+ },
276
+ abrupt: function abrupt(type, arg) {
277
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
278
+ var entry = this.tryEntries[i];
279
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
280
+ var finallyEntry = entry;
281
+ break;
282
+ }
283
+ }
284
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
285
+ var record = finallyEntry ? finallyEntry.completion : {};
286
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
287
+ },
288
+ complete: function complete(record, afterLoc) {
289
+ if ("throw" === record.type) throw record.arg;
290
+ return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
291
+ },
292
+ finish: function finish(finallyLoc) {
293
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
294
+ var entry = this.tryEntries[i];
295
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
296
+ }
297
+ },
298
+ "catch": function _catch(tryLoc) {
299
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
300
+ var entry = this.tryEntries[i];
301
+ if (entry.tryLoc === tryLoc) {
302
+ var record = entry.completion;
303
+ if ("throw" === record.type) {
304
+ var thrown = record.arg;
305
+ resetTryEntry(entry);
306
+ }
307
+ return thrown;
308
+ }
309
+ }
310
+ throw new Error("illegal catch attempt");
311
+ },
312
+ delegateYield: function delegateYield(iterable, resultName, nextLoc) {
313
+ return this.delegate = {
314
+ iterator: values(iterable),
315
+ resultName: resultName,
316
+ nextLoc: nextLoc
317
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
318
+ }
319
+ }, exports;
320
+ }
321
+ module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
322
+
323
+ /***/ }),
324
+
325
+ /***/ 7425:
326
+ /***/ ((module) => {
327
+
328
+ function _typeof(obj) {
329
+ "@babel/helpers - typeof";
330
+
331
+ return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
332
+ return typeof obj;
333
+ } : function (obj) {
334
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
335
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
336
+ }
337
+ module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
338
+
339
+ /***/ }),
340
+
341
+ /***/ 2841:
342
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
343
+
344
+ // TODO(Babel 8): Remove this file.
345
+
346
+ var runtime = __webpack_require__(7609)();
347
+ module.exports = runtime;
348
+
349
+ // Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
350
+ try {
351
+ regeneratorRuntime = runtime;
352
+ } catch (accidentalStrictMode) {
353
+ if (typeof globalThis === "object") {
354
+ globalThis.regeneratorRuntime = runtime;
355
+ } else {
356
+ Function("r", "regeneratorRuntime = r")(runtime);
357
+ }
358
+ }
359
+
360
+
361
+ /***/ })
362
+
363
+ /******/ });
364
+ /************************************************************************/
365
+ /******/ // The module cache
366
+ /******/ var __webpack_module_cache__ = {};
367
+ /******/
368
+ /******/ // The require function
369
+ /******/ function __webpack_require__(moduleId) {
370
+ /******/ // Check if module is in cache
371
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
372
+ /******/ if (cachedModule !== undefined) {
373
+ /******/ return cachedModule.exports;
374
+ /******/ }
375
+ /******/ // Create a new module (and put it into the cache)
376
+ /******/ var module = __webpack_module_cache__[moduleId] = {
377
+ /******/ // no module.id needed
378
+ /******/ // no module.loaded needed
379
+ /******/ exports: {}
380
+ /******/ };
381
+ /******/
382
+ /******/ // Execute the module function
383
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
384
+ /******/
385
+ /******/ // Return the exports of the module
386
+ /******/ return module.exports;
387
+ /******/ }
388
+ /******/
389
+ /************************************************************************/
390
+ /******/ /* webpack/runtime/compat get default export */
391
+ /******/ (() => {
392
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
393
+ /******/ __webpack_require__.n = (module) => {
394
+ /******/ var getter = module && module.__esModule ?
395
+ /******/ () => (module['default']) :
396
+ /******/ () => (module);
397
+ /******/ __webpack_require__.d(getter, { a: getter });
398
+ /******/ return getter;
399
+ /******/ };
400
+ /******/ })();
401
+ /******/
402
+ /******/ /* webpack/runtime/define property getters */
403
+ /******/ (() => {
404
+ /******/ // define getter functions for harmony exports
405
+ /******/ __webpack_require__.d = (exports, definition) => {
406
+ /******/ for(var key in definition) {
407
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
408
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
409
+ /******/ }
410
+ /******/ }
411
+ /******/ };
412
+ /******/ })();
413
+ /******/
414
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
415
+ /******/ (() => {
416
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
417
+ /******/ })();
418
+ /******/
419
+ /************************************************************************/
420
+ var __webpack_exports__ = {};
421
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
422
+ (() => {
423
+
424
+ // EXPORTS
425
+ __webpack_require__.d(__webpack_exports__, {
426
+ r: () => (/* binding */ BkSearchSelect),
427
+ Z: () => (/* binding */ src)
428
+ });
429
+
430
+ ;// CONCATENATED MODULE: external "../shared"
431
+ var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
432
+ var y = x => () => x
433
+ const shared_namespaceObject = x({ ["debounce"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.debounce, ["random"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.random, ["withInstall"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.withInstall });
434
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
435
+ function _typeof(obj) {
436
+ "@babel/helpers - typeof";
437
+
438
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
439
+ return typeof obj;
440
+ } : function (obj) {
441
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
442
+ }, _typeof(obj);
443
+ }
444
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
445
+
446
+ function _toPrimitive(input, hint) {
447
+ if (_typeof(input) !== "object" || input === null) return input;
448
+ var prim = input[Symbol.toPrimitive];
449
+ if (prim !== undefined) {
450
+ var res = prim.call(input, hint || "default");
451
+ if (_typeof(res) !== "object") return res;
452
+ throw new TypeError("@@toPrimitive must return a primitive value.");
453
+ }
454
+ return (hint === "string" ? String : Number)(input);
455
+ }
456
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
457
+
458
+
459
+ function _toPropertyKey(arg) {
460
+ var key = _toPrimitive(arg, "string");
461
+ return _typeof(key) === "symbol" ? key : String(key);
462
+ }
463
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
464
+
465
+ function _defineProperty(obj, key, value) {
466
+ key = _toPropertyKey(key);
467
+ if (key in obj) {
468
+ Object.defineProperty(obj, key, {
469
+ value: value,
470
+ enumerable: true,
471
+ configurable: true,
472
+ writable: true
473
+ });
474
+ } else {
475
+ obj[key] = value;
476
+ }
477
+ return obj;
478
+ }
479
+ ;// CONCATENATED MODULE: external "vue"
480
+ var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
481
+ var external_vue_y = x => () => x
482
+ const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createTextVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["inject"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.inject, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["provide"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.provide, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["resolveDirective"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.resolveDirective, ["shallowRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.shallowRef, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["watchEffect"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watchEffect, ["withDirectives"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives });
483
+ ;// CONCATENATED MODULE: ../../node_modules/resize-detector/esm/index.js
484
+ var raf = null;
485
+ function requestAnimationFrame (callback) {
486
+ if (!raf) {
487
+ raf = (
488
+ window.requestAnimationFrame ||
489
+ window.webkitRequestAnimationFrame ||
490
+ window.mozRequestAnimationFrame ||
491
+ function (callback) {
492
+ return setTimeout(callback, 16)
493
+ }
494
+ ).bind(window);
495
+ }
496
+ return raf(callback)
497
+ }
498
+
499
+ var caf = null;
500
+ function cancelAnimationFrame (id) {
501
+ if (!caf) {
502
+ caf = (
503
+ window.cancelAnimationFrame ||
504
+ window.webkitCancelAnimationFrame ||
505
+ window.mozCancelAnimationFrame ||
506
+ function (id) {
507
+ clearTimeout(id);
508
+ }
509
+ ).bind(window);
510
+ }
511
+
512
+ caf(id);
513
+ }
514
+
515
+ function createStyles (styleText) {
516
+ var style = document.createElement('style');
517
+
518
+ if (style.styleSheet) {
519
+ style.styleSheet.cssText = styleText;
520
+ } else {
521
+ style.appendChild(document.createTextNode(styleText));
522
+ }
523
+ (document.querySelector('head') || document.body).appendChild(style);
524
+ return style
525
+ }
526
+
527
+ function createElement (tagName, props) {
528
+ if ( props === void 0 ) props = {};
529
+
530
+ var elem = document.createElement(tagName);
531
+ Object.keys(props).forEach(function (key) {
532
+ elem[key] = props[key];
533
+ });
534
+ return elem
535
+ }
536
+
537
+ function getComputedStyle (elem, prop, pseudo) {
538
+ // for older versions of Firefox, `getComputedStyle` required
539
+ // the second argument and may return `null` for some elements
540
+ // when `display: none`
541
+ var computedStyle = window.getComputedStyle(elem, pseudo || null) || {
542
+ display: 'none'
543
+ };
544
+
545
+ return computedStyle[prop]
546
+ }
547
+
548
+ function getRenderInfo (elem) {
549
+ if (!document.documentElement.contains(elem)) {
550
+ return {
551
+ detached: true,
552
+ rendered: false
553
+ }
554
+ }
555
+
556
+ var current = elem;
557
+ while (current !== document) {
558
+ if (getComputedStyle(current, 'display') === 'none') {
559
+ return {
560
+ detached: false,
561
+ rendered: false
562
+ }
563
+ }
564
+ current = current.parentNode;
565
+ }
566
+
567
+ return {
568
+ detached: false,
569
+ rendered: true
570
+ }
571
+ }
572
+
573
+ var css_248z = ".resize-triggers{visibility:hidden;opacity:0;pointer-events:none}.resize-contract-trigger,.resize-contract-trigger:before,.resize-expand-trigger,.resize-triggers{content:\"\";position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden}.resize-contract-trigger,.resize-expand-trigger{background:#eee;overflow:auto}.resize-contract-trigger:before{width:200%;height:200%}";
574
+
575
+ var total = 0;
576
+ var style = null;
577
+
578
+ function addListener (elem, callback) {
579
+ if (!elem.__resize_mutation_handler__) {
580
+ elem.__resize_mutation_handler__ = handleMutation.bind(elem);
581
+ }
582
+
583
+ var listeners = elem.__resize_listeners__;
584
+
585
+ if (!listeners) {
586
+ elem.__resize_listeners__ = [];
587
+ if (window.ResizeObserver) {
588
+ var offsetWidth = elem.offsetWidth;
589
+ var offsetHeight = elem.offsetHeight;
590
+ var ro = new ResizeObserver(function () {
591
+ if (!elem.__resize_observer_triggered__) {
592
+ elem.__resize_observer_triggered__ = true;
593
+ if (elem.offsetWidth === offsetWidth && elem.offsetHeight === offsetHeight) {
594
+ return
595
+ }
596
+ }
597
+ runCallbacks(elem);
598
+ });
599
+
600
+ // initially display none won't trigger ResizeObserver callback
601
+ var ref = getRenderInfo(elem);
602
+ var detached = ref.detached;
603
+ var rendered = ref.rendered;
604
+ elem.__resize_observer_triggered__ = detached === false && rendered === false;
605
+ elem.__resize_observer__ = ro;
606
+ ro.observe(elem);
607
+ } else if (elem.attachEvent && elem.addEventListener) {
608
+ // targeting IE9/10
609
+ elem.__resize_legacy_resize_handler__ = function handleLegacyResize () {
610
+ runCallbacks(elem);
611
+ };
612
+ elem.attachEvent('onresize', elem.__resize_legacy_resize_handler__);
613
+ document.addEventListener('DOMSubtreeModified', elem.__resize_mutation_handler__);
614
+ } else {
615
+ if (!total) {
616
+ style = createStyles(css_248z);
617
+ }
618
+ initTriggers(elem);
619
+
620
+ elem.__resize_rendered__ = getRenderInfo(elem).rendered;
621
+ if (window.MutationObserver) {
622
+ var mo = new MutationObserver(elem.__resize_mutation_handler__);
623
+ mo.observe(document, {
624
+ attributes: true,
625
+ childList: true,
626
+ characterData: true,
627
+ subtree: true
628
+ });
629
+ elem.__resize_mutation_observer__ = mo;
630
+ }
631
+ }
632
+ }
633
+
634
+ elem.__resize_listeners__.push(callback);
635
+ total++;
636
+ }
637
+
638
+ function removeListener (elem, callback) {
639
+ var listeners = elem.__resize_listeners__;
640
+ if (!listeners) {
641
+ return
642
+ }
643
+
644
+ if (callback) {
645
+ listeners.splice(listeners.indexOf(callback), 1);
646
+ }
647
+
648
+ // no listeners exist, or removing all listeners
649
+ if (!listeners.length || !callback) {
650
+ // targeting IE9/10
651
+ if (elem.detachEvent && elem.removeEventListener) {
652
+ elem.detachEvent('onresize', elem.__resize_legacy_resize_handler__);
653
+ document.removeEventListener('DOMSubtreeModified', elem.__resize_mutation_handler__);
654
+ return
655
+ }
656
+
657
+ if (elem.__resize_observer__) {
658
+ elem.__resize_observer__.unobserve(elem);
659
+ elem.__resize_observer__.disconnect();
660
+ elem.__resize_observer__ = null;
661
+ } else {
662
+ if (elem.__resize_mutation_observer__) {
663
+ elem.__resize_mutation_observer__.disconnect();
664
+ elem.__resize_mutation_observer__ = null;
665
+ }
666
+ elem.removeEventListener('scroll', handleScroll);
667
+ elem.removeChild(elem.__resize_triggers__.triggers);
668
+ elem.__resize_triggers__ = null;
669
+ }
670
+ elem.__resize_listeners__ = null;
671
+ }
672
+
673
+ if (!--total && style) {
674
+ style.parentNode.removeChild(style);
675
+ }
676
+ }
677
+
678
+ function getUpdatedSize (elem) {
679
+ var ref = elem.__resize_last__;
680
+ var width = ref.width;
681
+ var height = ref.height;
682
+ var offsetWidth = elem.offsetWidth;
683
+ var offsetHeight = elem.offsetHeight;
684
+ if (offsetWidth !== width || offsetHeight !== height) {
685
+ return {
686
+ width: offsetWidth,
687
+ height: offsetHeight
688
+ }
689
+ }
690
+ return null
691
+ }
692
+
693
+ function handleMutation () {
694
+ // `this` denotes the scrolling element
695
+ var ref = getRenderInfo(this);
696
+ var rendered = ref.rendered;
697
+ var detached = ref.detached;
698
+ if (rendered !== this.__resize_rendered__) {
699
+ if (!detached && this.__resize_triggers__) {
700
+ resetTriggers(this);
701
+ this.addEventListener('scroll', handleScroll, true);
702
+ }
703
+ this.__resize_rendered__ = rendered;
704
+ runCallbacks(this);
705
+ }
706
+ }
707
+
708
+ function handleScroll () {
709
+ var this$1 = this;
710
+
711
+ // `this` denotes the scrolling element
712
+ resetTriggers(this);
713
+ if (this.__resize_raf__) {
714
+ cancelAnimationFrame(this.__resize_raf__);
715
+ }
716
+ this.__resize_raf__ = requestAnimationFrame(function () {
717
+ var updated = getUpdatedSize(this$1);
718
+ if (updated) {
719
+ this$1.__resize_last__ = updated;
720
+ runCallbacks(this$1);
721
+ }
722
+ });
723
+ }
724
+
725
+ function runCallbacks (elem) {
726
+ if (!elem || !elem.__resize_listeners__) {
727
+ return
728
+ }
729
+ elem.__resize_listeners__.forEach(function (callback) {
730
+ callback.call(elem, elem);
731
+ });
732
+ }
733
+
734
+ function initTriggers (elem) {
735
+ var position = getComputedStyle(elem, 'position');
736
+ if (!position || position === 'static') {
737
+ elem.style.position = 'relative';
738
+ }
739
+
740
+ elem.__resize_old_position__ = position;
741
+ elem.__resize_last__ = {};
742
+
743
+ var triggers = createElement('div', {
744
+ className: 'resize-triggers'
745
+ });
746
+ var expand = createElement('div', {
747
+ className: 'resize-expand-trigger'
748
+ });
749
+ var expandChild = createElement('div');
750
+ var contract = createElement('div', {
751
+ className: 'resize-contract-trigger'
752
+ });
753
+ expand.appendChild(expandChild);
754
+ triggers.appendChild(expand);
755
+ triggers.appendChild(contract);
756
+ elem.appendChild(triggers);
757
+
758
+ elem.__resize_triggers__ = {
759
+ triggers: triggers,
760
+ expand: expand,
761
+ expandChild: expandChild,
762
+ contract: contract
763
+ };
764
+
765
+ resetTriggers(elem);
766
+ elem.addEventListener('scroll', handleScroll, true);
767
+
768
+ elem.__resize_last__ = {
769
+ width: elem.offsetWidth,
770
+ height: elem.offsetHeight
771
+ };
772
+ }
773
+
774
+ function resetTriggers (elem) {
775
+ var ref = elem.__resize_triggers__;
776
+ var expand = ref.expand;
777
+ var expandChild = ref.expandChild;
778
+ var contract = ref.contract;
779
+
780
+ // batch read
781
+ var csw = contract.scrollWidth;
782
+ var csh = contract.scrollHeight;
783
+ var eow = expand.offsetWidth;
784
+ var eoh = expand.offsetHeight;
785
+ var esw = expand.scrollWidth;
786
+ var esh = expand.scrollHeight;
787
+
788
+ // batch write
789
+ contract.scrollLeft = csw;
790
+ contract.scrollTop = csh;
791
+ expandChild.style.width = eow + 1 + 'px';
792
+ expandChild.style.height = eoh + 1 + 'px';
793
+ expand.scrollLeft = esw;
794
+ expand.scrollTop = esh;
795
+ }
796
+
797
+
798
+
799
+ ;// CONCATENATED MODULE: external "../config-provider"
800
+ var config_provider_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
801
+ var config_provider_y = x => () => x
802
+ const config_provider_namespaceObject = config_provider_x({ ["useLocale"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3__.useLocale, ["usePrefix"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3__.usePrefix });
803
+ ;// CONCATENATED MODULE: external "../directives"
804
+ var directives_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
805
+ var directives_y = x => () => x
806
+ const directives_namespaceObject = directives_x({ ["clickoutside"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_directives_45d4776f__.clickoutside });
807
+ ;// CONCATENATED MODULE: external "../icon"
808
+ var icon_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
809
+ var icon_y = x => () => x
810
+ const icon_namespaceObject = icon_x({ ["Close"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Close, ["Error"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Error, ["ExclamationCircleShape"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.ExclamationCircleShape, ["Search"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Search });
811
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
812
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
813
+ try {
814
+ var info = gen[key](arg);
815
+ var value = info.value;
816
+ } catch (error) {
817
+ reject(error);
818
+ return;
819
+ }
820
+ if (info.done) {
821
+ resolve(value);
822
+ } else {
823
+ Promise.resolve(value).then(_next, _throw);
824
+ }
825
+ }
826
+ function _asyncToGenerator(fn) {
827
+ return function () {
828
+ var self = this,
829
+ args = arguments;
830
+ return new Promise(function (resolve, reject) {
831
+ var gen = fn.apply(self, args);
832
+ function _next(value) {
833
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
834
+ }
835
+ function _throw(err) {
836
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
837
+ }
838
+ _next(undefined);
839
+ });
840
+ };
841
+ }
842
+ // EXTERNAL MODULE: ../../node_modules/@babel/runtime/regenerator/index.js
843
+ var regenerator = __webpack_require__(2841);
844
+ var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
845
+ ;// CONCATENATED MODULE: external "../popover"
846
+ var popover_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
847
+ var popover_y = x => () => x
848
+ const popover_namespaceObject = popover_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_popover_9b03f19d__["default"] });
849
+ ;// CONCATENATED MODULE: external "../popover/popover.less"
850
+ var popover_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
851
+ var popover_less_y = x => () => x
852
+ const popover_less_namespaceObject = popover_less_x({ });
853
+ ;// CONCATENATED MODULE: external "../checkbox"
854
+ var checkbox_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
855
+ var checkbox_y = x => () => x
856
+ const checkbox_namespaceObject = checkbox_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_checkbox_13b1cb4a__["default"] });
857
+ ;// CONCATENATED MODULE: external "../checkbox/checkbox.less"
858
+ var checkbox_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
859
+ var checkbox_less_y = x => () => x
860
+ const checkbox_less_namespaceObject = checkbox_less_x({ });
861
+ ;// CONCATENATED MODULE: external "../radio"
862
+ var radio_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
863
+ var radio_y = x => () => x
864
+ const radio_namespaceObject = radio_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_radio_d36f24cf__["default"] });
865
+ ;// CONCATENATED MODULE: external "../radio/radio.less"
866
+ var radio_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
867
+ var radio_less_y = x => () => x
868
+ const radio_less_namespaceObject = radio_less_x({ });
869
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js
870
+ function _classCallCheck(instance, Constructor) {
871
+ if (!(instance instanceof Constructor)) {
872
+ throw new TypeError("Cannot call a class as a function");
873
+ }
874
+ }
875
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/createClass.js
876
+
877
+ function _defineProperties(target, props) {
878
+ for (var i = 0; i < props.length; i++) {
879
+ var descriptor = props[i];
880
+ descriptor.enumerable = descriptor.enumerable || false;
881
+ descriptor.configurable = true;
882
+ if ("value" in descriptor) descriptor.writable = true;
883
+ Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
884
+ }
885
+ }
886
+ function _createClass(Constructor, protoProps, staticProps) {
887
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
888
+ if (staticProps) _defineProperties(Constructor, staticProps);
889
+ Object.defineProperty(Constructor, "prototype", {
890
+ writable: false
891
+ });
892
+ return Constructor;
893
+ }
894
+ ;// CONCATENATED MODULE: ../../packages/search-select/src/utils.ts
895
+
896
+
897
+
898
+ /*
899
+ * Tencent is pleased to support the open source community by making
900
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
901
+ *
902
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
903
+ *
904
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
905
+ *
906
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
907
+ *
908
+ * ---------------------------------------------------
909
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
910
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
911
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
912
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
913
+ *
914
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
915
+ * the Software.
916
+ *
917
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
918
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
919
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
920
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
921
+ * IN THE SOFTWARE.
922
+ */
923
+
924
+ /**
925
+ * @description: 获取menu list方法
926
+ * @param {ISearchItem} item 已选择的key字段 为空则代表当前并未选择key字段
927
+ * @param {string} keyword 已输入的文本
928
+ * @return {*} menu list用于渲染选择弹层列表
929
+ */
930
+ var ValueBehavior;
931
+ (function (ValueBehavior) {
932
+ ValueBehavior["ALL"] = "all";
933
+ ValueBehavior["NEEDKEY"] = "need-key";
934
+ })(ValueBehavior || (ValueBehavior = {}));
935
+ var SEARCH_SLECT_PROVIDER_KEY = Symbol('SEARCH_SLECT_PROVIDER_KEY');
936
+ var useSearchSelectProvider = function useSearchSelectProvider(data) {
937
+ (0,external_vue_namespaceObject.provide)(SEARCH_SLECT_PROVIDER_KEY, data);
938
+ };
939
+ var useSearchSelectInject = function useSearchSelectInject() {
940
+ return (0,external_vue_namespaceObject.inject)(SEARCH_SLECT_PROVIDER_KEY);
941
+ };
942
+ var SearchInputMode;
943
+ (function (SearchInputMode) {
944
+ SearchInputMode["DEFAULT"] = "default";
945
+ SearchInputMode["EDIT"] = "edit";
946
+ })(SearchInputMode || (SearchInputMode = {}));
947
+ var SearchLogical;
948
+ (function (SearchLogical) {
949
+ SearchLogical["AND"] = "&";
950
+ SearchLogical["OR"] = "|";
951
+ })(SearchLogical || (SearchLogical = {}));
952
+ var SelectedItem = /*#__PURE__*/function () {
953
+ function SelectedItem(searchItem) {
954
+ var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
955
+ _classCallCheck(this, SelectedItem);
956
+ _defineProperty(this, "values", []);
957
+ this.searchItem = searchItem;
958
+ this.type = type;
959
+ this.id = searchItem.id;
960
+ this.name = searchItem.name;
961
+ this.logical = searchItem.logical || SearchLogical.OR;
962
+ }
963
+ _createClass(SelectedItem, [{
964
+ key: "multiple",
965
+ get: function get() {
966
+ return !!this.searchItem.multiple;
967
+ }
968
+ }, {
969
+ key: "placeholder",
970
+ get: function get() {
971
+ return this.searchItem.placeholder || '';
972
+ }
973
+ }, {
974
+ key: "children",
975
+ get: function get() {
976
+ return this.searchItem.children || [];
977
+ }
978
+ }, {
979
+ key: "validate",
980
+ get: function get() {
981
+ return !this.searchItem.noValidate;
982
+ }
983
+ }, {
984
+ key: "inputInnerHtml",
985
+ get: function get() {
986
+ var _this$values;
987
+ if (this.isSpecialType()) return this.name;
988
+ return "".concat(this.keyInnerHtml).concat(((_this$values = this.values) === null || _this$values === void 0 ? void 0 : _this$values.map(function (item) {
989
+ return item.name;
990
+ }).join(" ".concat(this.logical, " "))) || '');
991
+ }
992
+ }, {
993
+ key: "inputInnerText",
994
+ get: function get() {
995
+ var _this$values2;
996
+ if (this.isSpecialType()) return this.name;
997
+ return "".concat(this.keyInnerText).concat(((_this$values2 = this.values) === null || _this$values2 === void 0 ? void 0 : _this$values2.map(function (item) {
998
+ return item.name;
999
+ }).join(" ".concat(this.logical, " "))) || '');
1000
+ }
1001
+ }, {
1002
+ key: "keyInnerHtml",
1003
+ get: function get() {
1004
+ if (this.isSpecialType()) return this.name;
1005
+ return this.name ? "".concat(this.name, ":\xA0") : '';
1006
+ }
1007
+ }, {
1008
+ key: "keyInnerText",
1009
+ get: function get() {
1010
+ if (this.isSpecialType()) return this.name;
1011
+ return this.name ? "".concat(this.name, ": ") : '';
1012
+ }
1013
+ }, {
1014
+ key: "showLogical",
1015
+ get: function get() {
1016
+ return !!this.searchItem.showLogicalPanel;
1017
+ }
1018
+ }, {
1019
+ key: "isSpecialType",
1020
+ value: function isSpecialType() {
1021
+ return ['text', 'condition'].includes(this.type);
1022
+ }
1023
+ }, {
1024
+ key: "addValue",
1025
+ value: function addValue(item) {
1026
+ if (this.multiple) {
1027
+ var index = this.values.findIndex(function (val) {
1028
+ return val.id === item.id;
1029
+ });
1030
+ if (index > -1) {
1031
+ this.values.splice(index, 1);
1032
+ return;
1033
+ }
1034
+ this.values.push(item);
1035
+ return;
1036
+ }
1037
+ this.values = [item];
1038
+ }
1039
+ }, {
1040
+ key: "toValue",
1041
+ value: function toValue() {
1042
+ var _this$values3;
1043
+ var value = {
1044
+ id: this.id,
1045
+ name: this.name
1046
+ };
1047
+ if ((_this$values3 = this.values) !== null && _this$values3 !== void 0 && _this$values3.length) {
1048
+ value.values = this.values.map(function (item) {
1049
+ return {
1050
+ id: item.id,
1051
+ name: item.name
1052
+ };
1053
+ });
1054
+ if (this.multiple && this.logical !== SearchLogical.OR) {
1055
+ value.logical = this.logical;
1056
+ }
1057
+ }
1058
+ if (this.type && this.type !== 'default') {
1059
+ value.type = this.type;
1060
+ }
1061
+ return value;
1062
+ }
1063
+ }, {
1064
+ key: "toValueKey",
1065
+ value: function toValueKey() {
1066
+ return JSON.stringify(this.toValue());
1067
+ }
1068
+ }, {
1069
+ key: "isInValueList",
1070
+ value: function isInValueList(item) {
1071
+ return this.children.some(function (v) {
1072
+ return v.id === (item === null || item === void 0 ? void 0 : item.id);
1073
+ });
1074
+ }
1075
+ }]);
1076
+ return SelectedItem;
1077
+ }();
1078
+ ;// CONCATENATED MODULE: ../../packages/search-select/src/menu.tsx
1079
+
1080
+ /*
1081
+ * Tencent is pleased to support the open source community by making
1082
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1083
+ *
1084
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1085
+ *
1086
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1087
+ *
1088
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1089
+ *
1090
+ * ---------------------------------------------------
1091
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1092
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1093
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1094
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1095
+ *
1096
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1097
+ * the Software.
1098
+ *
1099
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1100
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1101
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1102
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1103
+ * IN THE SOFTWARE.
1104
+ */
1105
+
1106
+
1107
+
1108
+
1109
+
1110
+ // import { Done } from '@bkui-vue/icon';
1111
+
1112
+ /* harmony default export */ const menu = ((0,external_vue_namespaceObject.defineComponent)({
1113
+ name: 'SearchSelectMenu',
1114
+ props: {
1115
+ list: {
1116
+ type: Array
1117
+ },
1118
+ hoverId: String,
1119
+ keyword: {
1120
+ type: String,
1121
+ "default": ''
1122
+ },
1123
+ multiple: {
1124
+ type: Boolean,
1125
+ "default": false
1126
+ },
1127
+ selected: {
1128
+ type: Array,
1129
+ "default": function _default() {
1130
+ return [];
1131
+ }
1132
+ },
1133
+ conditions: {
1134
+ type: Array
1135
+ },
1136
+ footerBtns: {
1137
+ type: Array,
1138
+ "default": function _default() {
1139
+ return [];
1140
+ }
1141
+ },
1142
+ showLogical: {
1143
+ type: Boolean,
1144
+ "default": true
1145
+ },
1146
+ logical: {
1147
+ type: String,
1148
+ "default": SearchLogical.OR
1149
+ }
1150
+ },
1151
+ emits: ['selectItem', 'selectCondition', 'footerClick', 'update:logical'],
1152
+ setup: function setup(props, _ref) {
1153
+ var emit = _ref.emit;
1154
+ var t = (0,config_provider_namespaceObject.useLocale)('searchSelect');
1155
+ var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
1156
+ resolveClassName = _usePrefix.resolveClassName;
1157
+ var localFooterBtns = (0,external_vue_namespaceObject.computed)(function () {
1158
+ if (props.footerBtns === undefined || props.footerBtns.length === 0) {
1159
+ return [{
1160
+ id: 'confirm',
1161
+ name: t.value.ok
1162
+ }, {
1163
+ id: 'cancel',
1164
+ name: t.value.cancel,
1165
+ disabled: false
1166
+ }];
1167
+ }
1168
+ return props.footerBtns;
1169
+ });
1170
+ // events
1171
+ function handleClick(item) {
1172
+ emit('selectItem', item);
1173
+ }
1174
+ function handleClickCondition(item) {
1175
+ emit('selectCondition', item);
1176
+ }
1177
+ function handleClickFooterBtn(item) {
1178
+ emit('footerClick', item);
1179
+ }
1180
+ var filterList = (0,external_vue_namespaceObject.computed)(function () {
1181
+ var _props$list, _props$keyword;
1182
+ if (!((_props$list = props.list) !== null && _props$list !== void 0 && _props$list.length)) return [];
1183
+ if (!((_props$keyword = props.keyword) !== null && _props$keyword !== void 0 && _props$keyword.length)) return props.list;
1184
+ return props.list.filter(function (item) {
1185
+ return item.name.toLocaleLowerCase().includes(props.keyword.toLocaleLowerCase());
1186
+ });
1187
+ });
1188
+ function transformNode(str) {
1189
+ var _keyword;
1190
+ if (!str) return str;
1191
+ var keyword = props.keyword;
1192
+ var len = keyword.length;
1193
+ if (!((_keyword = keyword) !== null && _keyword !== void 0 && _keyword.trim().length) || !str.toLocaleLowerCase().includes(keyword.toLocaleLowerCase())) return str;
1194
+ var list = [];
1195
+ var lastIndex = -1;
1196
+ keyword = keyword.replace(/([.*/]{1})/gim, '\\$1');
1197
+ str.replace(new RegExp("".concat(keyword), 'igm'), function (key, index) {
1198
+ if (list.length === 0 && index !== 0) {
1199
+ list.push(str.slice(0, index));
1200
+ } else if (lastIndex >= 0) {
1201
+ list.push(str.slice(lastIndex + key.length, index));
1202
+ }
1203
+ list.push((0,external_vue_namespaceObject.createVNode)("span", {
1204
+ "class": "is-keyword"
1205
+ }, [key]));
1206
+ lastIndex = index;
1207
+ return key;
1208
+ });
1209
+ if (lastIndex >= 0) {
1210
+ list.push(str.slice(lastIndex + len));
1211
+ }
1212
+ return list.length ? list : str;
1213
+ }
1214
+ function getSearchNode(item) {
1215
+ var _item$value;
1216
+ if (!((_item$value = item.value) !== null && _item$value !== void 0 && _item$value.name)) return transformNode(item.name);
1217
+ return [(0,external_vue_namespaceObject.createVNode)("span", {
1218
+ "class": "menu-name"
1219
+ }, [item.name, (0,external_vue_namespaceObject.createTextVNode)(":")]), item.value.name];
1220
+ }
1221
+ function handleSelectedChange(e, item) {
1222
+ e.stopPropagation();
1223
+ e.preventDefault();
1224
+ handleClick(item);
1225
+ }
1226
+ function handleLogicalChange(value) {
1227
+ emit('update:logical', value);
1228
+ }
1229
+ return {
1230
+ handleClick: handleClick,
1231
+ handleClickCondition: handleClickCondition,
1232
+ handleClickFooterBtn: handleClickFooterBtn,
1233
+ handleSelectedChange: handleSelectedChange,
1234
+ handleLogicalChange: handleLogicalChange,
1235
+ filterList: filterList,
1236
+ getSearchNode: getSearchNode,
1237
+ localFooterBtns: localFooterBtns,
1238
+ resolveClassName: resolveClassName,
1239
+ t: t
1240
+ };
1241
+ },
1242
+ render: function render() {
1243
+ var _this$list,
1244
+ _this = this,
1245
+ _this$conditions;
1246
+ var listMenu = (0,external_vue_namespaceObject.createVNode)("ul", {
1247
+ "class": "menu-content"
1248
+ }, [(_this$list = this.list) === null || _this$list === void 0 ? void 0 : _this$list.map(function (item) {
1249
+ return (0,external_vue_namespaceObject.createVNode)("li", {
1250
+ "class": "menu-item ".concat(item.disabled ? 'is-disabled' : '', " ").concat(_this.hoverId === item.id && !item.disabled ? 'is-hover' : ''),
1251
+ "key": item.id,
1252
+ "id": item.id,
1253
+ "tabindex": "-1",
1254
+ "onClick": function onClick() {
1255
+ return !item.disabled && _this.handleClick(item);
1256
+ }
1257
+ }, [_this.$slots["default"] ? _this.$slots["default"]({
1258
+ item: item,
1259
+ list: _this.list,
1260
+ multiple: !!_this.multiple,
1261
+ hoverId: _this.hoverId,
1262
+ getSearchNode: _this.getSearchNode
1263
+ }) : (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [_this.multiple && (0,external_vue_namespaceObject.createVNode)("span", {
1264
+ "onClick": function onClick(e) {
1265
+ return _this.handleSelectedChange(e, item);
1266
+ }
1267
+ }, [(0,external_vue_namespaceObject.createVNode)(checkbox_namespaceObject["default"], {
1268
+ "modelValue": _this.selected.includes(item.id),
1269
+ "class": "is-selected"
1270
+ }, null)]), _this.getSearchNode(item)])]);
1271
+ })]);
1272
+ var getListMenu = function getListMenu() {
1273
+ if (!_this.showLogical || !_this.multiple) return listMenu;
1274
+ return (0,external_vue_namespaceObject.createVNode)("div", {
1275
+ "class": "menu-content-wrapper"
1276
+ }, [listMenu, (0,external_vue_namespaceObject.createVNode)("div", {
1277
+ "class": "menu-condition"
1278
+ }, [(0,external_vue_namespaceObject.createVNode)("div", {
1279
+ "class": "menu-condition-title"
1280
+ }, [_this.t.logical]), (0,external_vue_namespaceObject.createVNode)(radio_namespaceObject["default"], {
1281
+ "modelValue": _this.logical,
1282
+ "onChange": _this.handleLogicalChange,
1283
+ "label": "|"
1284
+ }, {
1285
+ "default": function _default() {
1286
+ return [_this.t.or, (0,external_vue_namespaceObject.createTextVNode)(" |")];
1287
+ }
1288
+ }), (0,external_vue_namespaceObject.createVNode)(radio_namespaceObject["default"], {
1289
+ "modelValue": _this.logical,
1290
+ "onChange": _this.handleLogicalChange,
1291
+ "label": "&"
1292
+ }, {
1293
+ "default": function _default() {
1294
+ return [_this.t.and, (0,external_vue_namespaceObject.createTextVNode)(" &")];
1295
+ }
1296
+ })])]);
1297
+ };
1298
+ return (0,external_vue_namespaceObject.createVNode)("div", {
1299
+ "class": this.resolveClassName('search-select-menu')
1300
+ }, [!!((_this$conditions = this.conditions) !== null && _this$conditions !== void 0 && _this$conditions.length) && (0,external_vue_namespaceObject.createVNode)("ul", {
1301
+ "class": "menu-header"
1302
+ }, [this.conditions.map(function (item) {
1303
+ return (0,external_vue_namespaceObject.createVNode)("li", {
1304
+ "key": item.id,
1305
+ "class": "menu-header-item ".concat(item.disabled ? 'is-disabled' : ''),
1306
+ "onClick": function onClick() {
1307
+ return !item.disabled && _this.handleClickCondition(item);
1308
+ }
1309
+ }, [item.name]);
1310
+ })]), getListMenu()]);
1311
+ }
1312
+ }));
1313
+ ;// CONCATENATED MODULE: ../../packages/search-select/src/input.tsx
1314
+
1315
+
1316
+
1317
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1318
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1319
+
1320
+ /*
1321
+ * Tencent is pleased to support the open source community by making
1322
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1323
+ *
1324
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1325
+ *
1326
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1327
+ *
1328
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1329
+ *
1330
+ * ---------------------------------------------------
1331
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1332
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1333
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1334
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1335
+ *
1336
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1337
+ * the Software.
1338
+ *
1339
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1340
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1341
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1342
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1343
+ * IN THE SOFTWARE.
1344
+ */
1345
+
1346
+
1347
+
1348
+
1349
+
1350
+
1351
+
1352
+
1353
+ /* harmony default export */ const input = ((0,external_vue_namespaceObject.defineComponent)({
1354
+ name: 'SearchSelectInput',
1355
+ directives: {
1356
+ clickoutside: directives_namespaceObject.clickoutside
1357
+ },
1358
+ props: {
1359
+ data: {
1360
+ type: Array,
1361
+ required: true
1362
+ },
1363
+ showInputBefore: Boolean,
1364
+ showCondition: Boolean,
1365
+ clickOutside: Function,
1366
+ placeholder: String,
1367
+ conditions: {
1368
+ type: Array,
1369
+ "default": function _default() {
1370
+ return [];
1371
+ }
1372
+ },
1373
+ defautUsingItem: Object,
1374
+ mode: {
1375
+ type: String,
1376
+ "default": SearchInputMode.DEFAULT
1377
+ },
1378
+ getMenuList: Function,
1379
+ validateValues: Function,
1380
+ valueBehavior: String
1381
+ },
1382
+ emits: ['focus', 'add', 'delete'],
1383
+ setup: function setup(props, _ref) {
1384
+ var emit = _ref.emit,
1385
+ expose = _ref.expose;
1386
+ var t = (0,config_provider_namespaceObject.useLocale)('searchSelect');
1387
+ var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
1388
+ resolveClassName = _usePrefix.resolveClassName;
1389
+ var inputRef = (0,external_vue_namespaceObject.ref)(null);
1390
+ var popoverRef = (0,external_vue_namespaceObject.ref)(null);
1391
+ var keyword = (0,external_vue_namespaceObject.ref)('');
1392
+ var showNoSelectValueError = (0,external_vue_namespaceObject.ref)(false);
1393
+ var isFocus = (0,external_vue_namespaceObject.ref)(false);
1394
+ var showPopover = (0,external_vue_namespaceObject.ref)(false);
1395
+ var usingItem = (0,external_vue_namespaceObject.ref)(props.defautUsingItem);
1396
+ var menuHoverId = (0,external_vue_namespaceObject.ref)('');
1397
+ var loading = (0,external_vue_namespaceObject.ref)(false);
1398
+ var debounceSetMenuList = (0,shared_namespaceObject.debounce)(300, setMenuList);
1399
+ // const selectMenuList = ref<ICommonItem[]>([]);
1400
+ var isBindEvent = false;
1401
+ var remoteMenuList = (0,external_vue_namespaceObject.ref)([]);
1402
+ var menuList = (0,external_vue_namespaceObject.ref)([]);
1403
+ var _useSearchSelectInjec = useSearchSelectInject(),
1404
+ editKey = _useSearchSelectInjec.editKey,
1405
+ onValidate = _useSearchSelectInjec.onValidate;
1406
+ var valueLoagic = (0,external_vue_namespaceObject.computed)(function () {
1407
+ var _usingItem$value;
1408
+ return ((_usingItem$value = usingItem.value) === null || _usingItem$value === void 0 ? void 0 : _usingItem$value.logical) || SearchLogical.OR;
1409
+ });
1410
+ (0,external_vue_namespaceObject.watch)(editKey, function () {
1411
+ if (props.mode === SearchInputMode.DEFAULT && editKey.value) {
1412
+ showPopover.value = false;
1413
+ }
1414
+ });
1415
+ // effects
1416
+ (0,external_vue_namespaceObject.watchEffect)(function () {
1417
+ if (!keyword.value) {
1418
+ setInputText();
1419
+ }
1420
+ }, {
1421
+ flush: 'pre'
1422
+ });
1423
+ (0,external_vue_namespaceObject.watch)([menuList, showPopover], function () {
1424
+ var _menuList$value;
1425
+ if ((_menuList$value = menuList.value) !== null && _menuList$value !== void 0 && _menuList$value.some(function (item) {
1426
+ return !item.disabled;
1427
+ }) && showPopover.value) {
1428
+ if (!isBindEvent) {
1429
+ if (props.valueBehavior === ValueBehavior.NEEDKEY) {
1430
+ menuHoverId.value = menuList.value.find(function (item) {
1431
+ return !item.disabled;
1432
+ }).id;
1433
+ } else {
1434
+ menuHoverId.value = '';
1435
+ }
1436
+ isBindEvent = true;
1437
+ document.addEventListener('keydown', handleDocumentKeydown);
1438
+ }
1439
+ } else {
1440
+ document.removeEventListener('keydown', handleDocumentKeydown);
1441
+ isBindEvent = false;
1442
+ if (props.valueBehavior !== ValueBehavior.NEEDKEY) {
1443
+ menuHoverId.value = '';
1444
+ }
1445
+ }
1446
+ });
1447
+ // events
1448
+ function handleDocumentKeydown(e) {
1449
+ switch (e.code) {
1450
+ case 'ArrowDown':
1451
+ case 'ArrowUp':
1452
+ documentArrowEvent(e);
1453
+ break;
1454
+ case 'Enter':
1455
+ case 'NumpadEnter':
1456
+ documentEnterEvent(e);
1457
+ break;
1458
+ }
1459
+ }
1460
+ function documentArrowEvent(e) {
1461
+ var _inputRef$value;
1462
+ e.preventDefault();
1463
+ (_inputRef$value = inputRef.value) === null || _inputRef$value === void 0 ? void 0 : _inputRef$value.blur();
1464
+ var len = menuList.value.length;
1465
+ var i = len;
1466
+ var index = menuList.value.findIndex(function (set) {
1467
+ return set.id === menuHoverId.value;
1468
+ });
1469
+ while (i >= 0) {
1470
+ index = e.code === 'ArrowDown' ? index + 1 : index - 1;
1471
+ // eslint-disable-next-line no-nested-ternary
1472
+ index = index > len - 1 ? 0 : index < 0 ? len - 1 : index;
1473
+ var item = menuList.value[index];
1474
+ if (item && !item.disabled) {
1475
+ i = -1;
1476
+ var dom = document.getElementById(item.id);
1477
+ dom === null || dom === void 0 ? void 0 : dom.focus();
1478
+ menuHoverId.value = item.id;
1479
+ return;
1480
+ }
1481
+ i -= 1;
1482
+ }
1483
+ }
1484
+ function documentEnterEvent(e) {
1485
+ if (isBindEvent) {
1486
+ e.preventDefault();
1487
+ var item = menuList.value.find(function (item) {
1488
+ return item.id === menuHoverId.value;
1489
+ });
1490
+ item && handleSelectItem(item);
1491
+ }
1492
+ }
1493
+ function handleClickOutside(e) {
1494
+ var _popoverRef$value, _props$clickOutside;
1495
+ if (!((_popoverRef$value = popoverRef.value) !== null && _popoverRef$value !== void 0 && _popoverRef$value.contains(e.target)) && (_props$clickOutside = props.clickOutside) !== null && _props$clickOutside !== void 0 && _props$clickOutside.call(props, e.target, popoverRef.value)) {
1496
+ var _usingItem$value2, _usingItem$value3;
1497
+ if ((_usingItem$value2 = usingItem.value) !== null && _usingItem$value2 !== void 0 && (_usingItem$value2 = _usingItem$value2.values) !== null && _usingItem$value2 !== void 0 && _usingItem$value2.length && (_usingItem$value3 = usingItem.value) !== null && _usingItem$value3 !== void 0 && _usingItem$value3.multiple) {
1498
+ keyword.value = '';
1499
+ handleKeyEnter();
1500
+ return;
1501
+ }
1502
+ showPopover.value = false;
1503
+ isFocus.value = false;
1504
+ emit('focus', isFocus.value);
1505
+ }
1506
+ }
1507
+ function handleInputFocus(e) {
1508
+ setInputFocus();
1509
+ e && setMenuList();
1510
+ }
1511
+ function handleInputChange(event) {
1512
+ var _usingItem$value5, _usingItem$value8;
1513
+ clearInput();
1514
+ var text = event.target.innerText;
1515
+ if (/(\r|\n)/gm.test(text) || /\s{2}/gm.test(text)) {
1516
+ var _usingItem$value4;
1517
+ event.preventDefault();
1518
+ text = text.replace(/(\r|\n)/gm, " ".concat(valueLoagic.value, " ")).replace(/\s{2}/gm, '');
1519
+ inputRef.value.innerText = text;
1520
+ setInputFocus();
1521
+ keyword.value = text.replace(((_usingItem$value4 = usingItem.value) === null || _usingItem$value4 === void 0 ? void 0 : _usingItem$value4.keyInnerText) || '', '').trim();
1522
+ debounceSetMenuList();
1523
+ } else if (!keyword.value && text.length < (((_usingItem$value5 = usingItem.value) === null || _usingItem$value5 === void 0 || (_usingItem$value5 = _usingItem$value5.inputInnerText) === null || _usingItem$value5 === void 0 ? void 0 : _usingItem$value5.length) || 1)) {
1524
+ var _usingItem$value6, _usingItem$value7, _usingItem$value$valu, _text;
1525
+ var outerText = text.replace("\xA0", " ").replace(((_usingItem$value6 = usingItem.value) === null || _usingItem$value6 === void 0 ? void 0 : _usingItem$value6.keyInnerText.replace("\xA0", " ").trim()) || '', '').trim();
1526
+ var hasKeyword = text && ((_usingItem$value7 = usingItem.value) === null || _usingItem$value7 === void 0 ? void 0 : _usingItem$value7.keyInnerText) && text.replace("\xA0", " ").includes(usingItem.value.keyInnerText.replace("\xA0", " ").trim());
1527
+ if (hasKeyword && outerText && (_usingItem$value$valu = usingItem.value.values) !== null && _usingItem$value$valu !== void 0 && _usingItem$value$valu.length) {
1528
+ keyword.value = outerText;
1529
+ console.info('outerText', outerText);
1530
+ debounceSetMenuList();
1531
+ return;
1532
+ }
1533
+ if (outerText || !((_text = text) !== null && _text !== void 0 && _text.length)) {
1534
+ usingItem.value = null;
1535
+ }
1536
+ keyword.value = outerText ? text : '';
1537
+ debounceSetMenuList();
1538
+ } else if (!((_usingItem$value8 = usingItem.value) !== null && _usingItem$value8 !== void 0 && (_usingItem$value8 = _usingItem$value8.values) !== null && _usingItem$value8 !== void 0 && _usingItem$value8.length)) {
1539
+ var _usingItem$value9;
1540
+ keyword.value = text.replace("\xA0", " ").replace(((_usingItem$value9 = usingItem.value) === null || _usingItem$value9 === void 0 ? void 0 : _usingItem$value9.keyInnerText.replace("\xA0", " ")) || '', '').trim();
1541
+ setInputFocus();
1542
+ debounceSetMenuList();
1543
+ }
1544
+ }
1545
+ function handleInputKeyup(event) {
1546
+ switch (event.code) {
1547
+ case 'Enter':
1548
+ case 'NumpadEnter':
1549
+ if (props.valueBehavior === ValueBehavior.NEEDKEY && menuList.value.some(function (item) {
1550
+ return item.id === menuHoverId.value;
1551
+ })) return;
1552
+ handleKeyEnter(event);
1553
+ break;
1554
+ case 'Backspace':
1555
+ handleKeyBackspace();
1556
+ default:
1557
+ showNoSelectValueError.value = false;
1558
+ break;
1559
+ }
1560
+ }
1561
+ function handleKeyEnter(_x) {
1562
+ return _handleKeyEnter.apply(this, arguments);
1563
+ }
1564
+ function _handleKeyEnter() {
1565
+ _handleKeyEnter = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee(event) {
1566
+ var value, _res, values, _keyword$value, valueList, _res2, _value, _res3, _value2, _res4, res;
1567
+ return regenerator_default().wrap(function _callee$(_context) {
1568
+ while (1) switch (_context.prev = _context.next) {
1569
+ case 0:
1570
+ event === null || event === void 0 ? void 0 : event.preventDefault();
1571
+ // resolve 中文输入时直接按下enter的错误表现
1572
+ _context.next = 3;
1573
+ return new Promise(function (r) {
1574
+ return setTimeout(r, 0);
1575
+ });
1576
+ case 3:
1577
+ if (usingItem.value) {
1578
+ _context.next = 16;
1579
+ break;
1580
+ }
1581
+ if (!(!keyword.value || props.valueBehavior === ValueBehavior.NEEDKEY)) {
1582
+ _context.next = 6;
1583
+ break;
1584
+ }
1585
+ return _context.abrupt("return");
1586
+ case 6:
1587
+ value = {
1588
+ id: keyword.value,
1589
+ name: keyword.value
1590
+ };
1591
+ _context.next = 9;
1592
+ return validateUsingItemValues(value);
1593
+ case 9:
1594
+ _res = _context.sent;
1595
+ if (_res) {
1596
+ _context.next = 12;
1597
+ break;
1598
+ }
1599
+ return _context.abrupt("return");
1600
+ case 12:
1601
+ emit('add', new SelectedItem(value, 'text'));
1602
+ keyword.value = '';
1603
+ setMenuList();
1604
+ return _context.abrupt("return");
1605
+ case 16:
1606
+ values = usingItem.value.values;
1607
+ if (values !== null && values !== void 0 && values.length) {
1608
+ _context.next = 43;
1609
+ break;
1610
+ }
1611
+ if (!((_keyword$value = keyword.value) !== null && _keyword$value !== void 0 && _keyword$value.length)) {
1612
+ _context.next = 41;
1613
+ break;
1614
+ }
1615
+ if (!keyword.value.includes(valueLoagic.value)) {
1616
+ _context.next = 29;
1617
+ break;
1618
+ }
1619
+ valueList = keyword.value.split(valueLoagic.value);
1620
+ _context.next = 23;
1621
+ return validateUsingItemValues({
1622
+ id: keyword.value,
1623
+ name: keyword.value
1624
+ });
1625
+ case 23:
1626
+ _res2 = _context.sent;
1627
+ if (_res2) {
1628
+ _context.next = 26;
1629
+ break;
1630
+ }
1631
+ return _context.abrupt("return");
1632
+ case 26:
1633
+ valueList.forEach(function (v) {
1634
+ return usingItem.value.addValue({
1635
+ id: v,
1636
+ name: v
1637
+ });
1638
+ });
1639
+ _context.next = 36;
1640
+ break;
1641
+ case 29:
1642
+ _value = {
1643
+ id: keyword.value,
1644
+ name: keyword.value
1645
+ };
1646
+ _context.next = 32;
1647
+ return validateUsingItemValues(_value);
1648
+ case 32:
1649
+ _res3 = _context.sent;
1650
+ if (_res3) {
1651
+ _context.next = 35;
1652
+ break;
1653
+ }
1654
+ return _context.abrupt("return");
1655
+ case 35:
1656
+ usingItem.value.addValue(_value);
1657
+ case 36:
1658
+ emit('add', usingItem.value);
1659
+ keyword.value = '';
1660
+ usingItem.value = null;
1661
+ setInputFocus(true);
1662
+ return _context.abrupt("return");
1663
+ case 41:
1664
+ showNoSelectValueError.value = true;
1665
+ return _context.abrupt("return");
1666
+ case 43:
1667
+ if (!keyword.value) {
1668
+ _context.next = 56;
1669
+ break;
1670
+ }
1671
+ _value2 = {
1672
+ id: keyword.value,
1673
+ name: keyword.value
1674
+ };
1675
+ _context.next = 47;
1676
+ return validateUsingItemValues(_value2);
1677
+ case 47:
1678
+ _res4 = _context.sent;
1679
+ if (_res4) {
1680
+ _context.next = 50;
1681
+ break;
1682
+ }
1683
+ return _context.abrupt("return");
1684
+ case 50:
1685
+ usingItem.value.addValue(_value2);
1686
+ emit('add', usingItem.value);
1687
+ keyword.value = '';
1688
+ usingItem.value = null;
1689
+ setInputFocus(true);
1690
+ return _context.abrupt("return");
1691
+ case 56:
1692
+ _context.next = 58;
1693
+ return validateUsingItemValues();
1694
+ case 58:
1695
+ res = _context.sent;
1696
+ if (res) {
1697
+ _context.next = 61;
1698
+ break;
1699
+ }
1700
+ return _context.abrupt("return");
1701
+ case 61:
1702
+ setSelectedItem();
1703
+ case 62:
1704
+ case "end":
1705
+ return _context.stop();
1706
+ }
1707
+ }, _callee);
1708
+ }));
1709
+ return _handleKeyEnter.apply(this, arguments);
1710
+ }
1711
+ function handleKeyBackspace() {
1712
+ var _usingItem$value10;
1713
+ // 删除已选择项
1714
+ if (!usingItem.value && !keyword.value) {
1715
+ emit('delete');
1716
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
1717
+ setTimeout(setMenuList, 16);
1718
+ return;
1719
+ }
1720
+ if ((_usingItem$value10 = usingItem.value) !== null && _usingItem$value10 !== void 0 && _usingItem$value10.values.length) {
1721
+ var _usingItem$value11;
1722
+ // 删除选项
1723
+ if ((_usingItem$value11 = usingItem.value) !== null && _usingItem$value11 !== void 0 && _usingItem$value11.multiple || usingItem.value.isInValueList(usingItem.value.values[0]) || props.mode === SearchInputMode.EDIT && !keyword.value) {
1724
+ usingItem.value.values.splice(-1, 1);
1725
+ keyword.value = '';
1726
+ setInputFocus();
1727
+ return;
1728
+ }
1729
+ } else if (!keyword.value) {
1730
+ usingItem.value = null;
1731
+ keyword.value = '';
1732
+ setMenuList();
1733
+ }
1734
+ onValidate('');
1735
+ }
1736
+ function handleSelectItem(_x2, _x3) {
1737
+ return _handleSelectItem.apply(this, arguments);
1738
+ }
1739
+ function _handleSelectItem() {
1740
+ _handleSelectItem = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee2(item, type) {
1741
+ var _item$value, _inputRef$value2, _usingItem$value14, _usingItem$value15;
1742
+ var _item$realId2, _item$realId, seleted, _res5, isCondition, res;
1743
+ return regenerator_default().wrap(function _callee2$(_context2) {
1744
+ while (1) switch (_context2.prev = _context2.next) {
1745
+ case 0:
1746
+ if (!((_item$value = item.value) !== null && _item$value !== void 0 && _item$value.id)) {
1747
+ _context2.next = 20;
1748
+ break;
1749
+ }
1750
+ if (!(props.valueBehavior === ValueBehavior.NEEDKEY && item.value || !props.validateValues)) {
1751
+ _context2.next = 8;
1752
+ break;
1753
+ }
1754
+ seleted = new SelectedItem(_objectSpread(_objectSpread({}, item), {}, {
1755
+ id: (_item$realId = item.realId) !== null && _item$realId !== void 0 ? _item$realId : item.id
1756
+ }), type);
1757
+ seleted.addValue(item.value);
1758
+ setSelectedItem(seleted);
1759
+ if (props.valueBehavior === ValueBehavior.NEEDKEY && menuHoverId.value) {
1760
+ setInputFocus(true);
1761
+ }
1762
+ menuHoverId.value = '';
1763
+ return _context2.abrupt("return");
1764
+ case 8:
1765
+ usingItem.value = new SelectedItem(_objectSpread(_objectSpread({}, item), {}, {
1766
+ id: (_item$realId2 = item.realId) !== null && _item$realId2 !== void 0 ? _item$realId2 : item.id
1767
+ }), type);
1768
+ usingItem.value.addValue(item.value);
1769
+ _context2.next = 12;
1770
+ return validateUsingItemValues(item.value);
1771
+ case 12:
1772
+ _res5 = _context2.sent;
1773
+ if (_res5) {
1774
+ _context2.next = 16;
1775
+ break;
1776
+ }
1777
+ usingItem.value = null;
1778
+ return _context2.abrupt("return");
1779
+ case 16:
1780
+ setSelectedItem(usingItem.value);
1781
+ menuHoverId.value = '';
1782
+ setInputFocus(true);
1783
+ return _context2.abrupt("return");
1784
+ case 20:
1785
+ if (!(!usingItem.value || !(inputRef !== null && inputRef !== void 0 && (_inputRef$value2 = inputRef.value) !== null && _inputRef$value2 !== void 0 && _inputRef$value2.innerText))) {
1786
+ _context2.next = 28;
1787
+ break;
1788
+ }
1789
+ usingItem.value = new SelectedItem(item, type);
1790
+ keyword.value = '';
1791
+ isCondition = type === 'condition';
1792
+ isCondition && setSelectedItem();
1793
+ showPopover.value = isCondition || !!usingItem.value.children.length;
1794
+ setInputFocus(props.valueBehavior === ValueBehavior.NEEDKEY && !!menuHoverId.value);
1795
+ return _context2.abrupt("return");
1796
+ case 28:
1797
+ if (!(((_usingItem$value14 = usingItem.value) === null || _usingItem$value14 === void 0 ? void 0 : _usingItem$value14.type) === 'condition')) {
1798
+ _context2.next = 32;
1799
+ break;
1800
+ }
1801
+ usingItem.value = new SelectedItem(item, type);
1802
+ setSelectedItem();
1803
+ return _context2.abrupt("return");
1804
+ case 32:
1805
+ usingItem.value.addValue(item);
1806
+ _context2.next = 35;
1807
+ return validateUsingItemValues(item);
1808
+ case 35:
1809
+ res = _context2.sent;
1810
+ if (res) {
1811
+ _context2.next = 38;
1812
+ break;
1813
+ }
1814
+ return _context2.abrupt("return");
1815
+ case 38:
1816
+ if (!usingItem.value.multiple) setSelectedItem();
1817
+ if (props.valueBehavior === ValueBehavior.NEEDKEY && (_usingItem$value15 = usingItem.value) !== null && _usingItem$value15 !== void 0 && _usingItem$value15.multiple) {
1818
+ setInputFocus();
1819
+ }
1820
+ case 40:
1821
+ case "end":
1822
+ return _context2.stop();
1823
+ }
1824
+ }, _callee2);
1825
+ }));
1826
+ return _handleSelectItem.apply(this, arguments);
1827
+ }
1828
+ function handleSelectCondtionItem(item) {
1829
+ handleSelectItem(item, 'condition');
1830
+ }
1831
+ function handleMenuFooterClick(item) {
1832
+ var _usingItem$value12;
1833
+ switch (item.id) {
1834
+ case 'confirm':
1835
+ if (!((_usingItem$value12 = usingItem.value) !== null && _usingItem$value12 !== void 0 && _usingItem$value12.values.length)) return;
1836
+ keyword.value = '';
1837
+ handleKeyEnter();
1838
+ break;
1839
+ case 'cancel':
1840
+ usingItem.value.values = [];
1841
+ showPopover.value = false;
1842
+ break;
1843
+ }
1844
+ }
1845
+ // functions
1846
+ function validateUsingItemValues(_x4) {
1847
+ return _validateUsingItemValues.apply(this, arguments);
1848
+ }
1849
+ function _validateUsingItemValues() {
1850
+ _validateUsingItemValues = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee3(value) {
1851
+ var _usingItem$value16, searchItem, validate, values;
1852
+ return regenerator_default().wrap(function _callee3$(_context3) {
1853
+ while (1) switch (_context3.prev = _context3.next) {
1854
+ case 0:
1855
+ if (usingItem.value) {
1856
+ _context3.next = 4;
1857
+ break;
1858
+ }
1859
+ _context3.next = 3;
1860
+ return validateValues(null, [value]);
1861
+ case 3:
1862
+ return _context3.abrupt("return", _context3.sent);
1863
+ case 4:
1864
+ _usingItem$value16 = usingItem.value, searchItem = _usingItem$value16.searchItem, validate = _usingItem$value16.validate, values = _usingItem$value16.values;
1865
+ if (!(validate && typeof props.validateValues === 'function')) {
1866
+ _context3.next = 9;
1867
+ break;
1868
+ }
1869
+ _context3.next = 8;
1870
+ return validateValues(searchItem, value ? [value] : values);
1871
+ case 8:
1872
+ return _context3.abrupt("return", _context3.sent);
1873
+ case 9:
1874
+ onValidate('');
1875
+ return _context3.abrupt("return", true);
1876
+ case 11:
1877
+ case "end":
1878
+ return _context3.stop();
1879
+ }
1880
+ }, _callee3);
1881
+ }));
1882
+ return _validateUsingItemValues.apply(this, arguments);
1883
+ }
1884
+ function validateValues(_x5, _x6) {
1885
+ return _validateValues.apply(this, arguments);
1886
+ }
1887
+ function _validateValues() {
1888
+ _validateValues = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee4(searchItem, value) {
1889
+ var _props$validateValues;
1890
+ var validateStr;
1891
+ return regenerator_default().wrap(function _callee4$(_context4) {
1892
+ while (1) switch (_context4.prev = _context4.next) {
1893
+ case 0:
1894
+ _context4.next = 2;
1895
+ return (_props$validateValues = props.validateValues) === null || _props$validateValues === void 0 ? void 0 : _props$validateValues.call(props, searchItem !== null && searchItem !== void 0 ? searchItem : null, value)["catch"](function () {
1896
+ return false;
1897
+ });
1898
+ case 2:
1899
+ validateStr = _context4.sent;
1900
+ if (!(typeof validateStr === 'string' || validateStr === false)) {
1901
+ _context4.next = 6;
1902
+ break;
1903
+ }
1904
+ onValidate(validateStr || '校验错误');
1905
+ return _context4.abrupt("return", false);
1906
+ case 6:
1907
+ onValidate('');
1908
+ return _context4.abrupt("return", true);
1909
+ case 8:
1910
+ case "end":
1911
+ return _context4.stop();
1912
+ }
1913
+ }, _callee4);
1914
+ }));
1915
+ return _validateValues.apply(this, arguments);
1916
+ }
1917
+ function setInputFocus() {
1918
+ var refleshMenuList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
1919
+ if (refleshMenuList) {
1920
+ setTimeout(function () {
1921
+ setMenuList();
1922
+ }, 16);
1923
+ }
1924
+ isFocus.value = true;
1925
+ showPopover.value = true;
1926
+ showNoSelectValueError.value = false;
1927
+ var timer = setTimeout(function () {
1928
+ if (inputRef.value) {
1929
+ inputRef.value.focus(); // 光标移至最后
1930
+ var selection = window.getSelection();
1931
+ if (selection.focusOffset === 0) {
1932
+ selection.selectAllChildren(inputRef.value);
1933
+ selection.collapseToEnd();
1934
+ }
1935
+ }
1936
+ window.clearTimeout(timer);
1937
+ }, 0);
1938
+ emit('focus', isFocus.value);
1939
+ }
1940
+ function setMenuList() {
1941
+ return _setMenuList.apply(this, arguments);
1942
+ }
1943
+ function _setMenuList() {
1944
+ _setMenuList = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee5() {
1945
+ var _usingItem$value17, _usingItem$value$valu2;
1946
+ var list, _usingItem$value18, _keyword$value2, hoverItem;
1947
+ return regenerator_default().wrap(function _callee5$(_context5) {
1948
+ while (1) switch (_context5.prev = _context5.next) {
1949
+ case 0:
1950
+ list = [];
1951
+ if (!(typeof props.getMenuList === 'function' && (typeof ((_usingItem$value17 = usingItem.value) === null || _usingItem$value17 === void 0 || (_usingItem$value17 = _usingItem$value17.searchItem) === null || _usingItem$value17 === void 0 ? void 0 : _usingItem$value17.async) === 'undefined' || usingItem.value.searchItem.async === true))) {
1952
+ _context5.next = 9;
1953
+ break;
1954
+ }
1955
+ loading.value = true;
1956
+ _context5.next = 5;
1957
+ return props.getMenuList((_usingItem$value18 = usingItem.value) === null || _usingItem$value18 === void 0 ? void 0 : _usingItem$value18.searchItem, keyword.value)["catch"](function () {
1958
+ return [];
1959
+ });
1960
+ case 5:
1961
+ list = _context5.sent;
1962
+ loading.value = false;
1963
+ _context5.next = 10;
1964
+ break;
1965
+ case 9:
1966
+ if (!(usingItem !== null && usingItem !== void 0 && usingItem.value)) {
1967
+ if (!((_keyword$value2 = keyword.value) !== null && _keyword$value2 !== void 0 && _keyword$value2.length)) {
1968
+ list = props.data.filter(function (item) {
1969
+ return !item.isSelected;
1970
+ }).slice();
1971
+ } else props.data.filter(function (item) {
1972
+ return !item.isSelected;
1973
+ }).forEach(function (item) {
1974
+ var isMatched = item.name.toLocaleLowerCase().includes(keyword.value.toLocaleLowerCase());
1975
+ if (isMatched) {
1976
+ var _item$children, _list;
1977
+ list.push(item);
1978
+ var filterList = [];
1979
+ (_item$children = item.children) === null || _item$children === void 0 ? void 0 : _item$children.forEach(function (child) {
1980
+ filterList.push(_objectSpread(_objectSpread({}, item), {}, {
1981
+ realId: item.id,
1982
+ id: (0,shared_namespaceObject.random)(10),
1983
+ value: child
1984
+ }));
1985
+ });
1986
+ !filterList.length && !item.onlyRecommendChildren && filterList.push(_objectSpread(_objectSpread({}, item), {}, {
1987
+ realId: item.id,
1988
+ id: (0,shared_namespaceObject.random)(10),
1989
+ value: {
1990
+ id: keyword.value,
1991
+ name: keyword.value
1992
+ }
1993
+ }));
1994
+ (_list = list).push.apply(_list, filterList);
1995
+ } else {
1996
+ var _item$children2, _list2;
1997
+ var _filterList = [];
1998
+ (_item$children2 = item.children) === null || _item$children2 === void 0 ? void 0 : _item$children2.forEach(function (child) {
1999
+ if (child.name.toLocaleLowerCase().includes(keyword.value.toLocaleLowerCase())) {
2000
+ _filterList.push(_objectSpread(_objectSpread({}, item), {}, {
2001
+ realId: item.id,
2002
+ id: (0,shared_namespaceObject.random)(10),
2003
+ value: child
2004
+ }));
2005
+ }
2006
+ });
2007
+ !_filterList.length && !item.onlyRecommendChildren && _filterList.push(_objectSpread(_objectSpread({}, item), {}, {
2008
+ value: {
2009
+ id: keyword.value,
2010
+ name: keyword.value
2011
+ }
2012
+ }));
2013
+ (_list2 = list).push.apply(_list2, _filterList);
2014
+ }
2015
+ });
2016
+ } else if (usingItem.value.type === 'condition') {
2017
+ list = props.conditions;
2018
+ } else if (!((_usingItem$value$valu2 = usingItem.value.values) !== null && _usingItem$value$valu2 !== void 0 && _usingItem$value$valu2.length) || usingItem.value.multiple || props.mode === SearchInputMode.EDIT) {
2019
+ list = usingItem.value.children.filter(function (item) {
2020
+ return item.name.toLocaleLowerCase().includes(keyword.value.toLocaleLowerCase());
2021
+ });
2022
+ }
2023
+ case 10:
2024
+ menuList.value = list;
2025
+ if (props.valueBehavior === ValueBehavior.NEEDKEY) {
2026
+ hoverItem = list.find(function (item) {
2027
+ return !item.disabled;
2028
+ });
2029
+ if (hoverItem && (!menuHoverId.value || menuHoverId.value && !list.some(function (item) {
2030
+ return item.id === menuHoverId.value;
2031
+ }))) {
2032
+ menuHoverId.value = hoverItem.id;
2033
+ }
2034
+ }
2035
+ case 12:
2036
+ case "end":
2037
+ return _context5.stop();
2038
+ }
2039
+ }, _callee5);
2040
+ }));
2041
+ return _setMenuList.apply(this, arguments);
2042
+ }
2043
+ function setSelectedItem(item) {
2044
+ emit('add', item !== null && item !== void 0 ? item : usingItem.value);
2045
+ usingItem.value = null;
2046
+ keyword.value = '';
2047
+ setInputFocus(props.valueBehavior === ValueBehavior.NEEDKEY);
2048
+ }
2049
+ function clearInput() {
2050
+ var text = inputRef.value.innerText;
2051
+ if (text[text.length - 1] === '\n' || text[0] === '\r') {
2052
+ setInputText(text.slice(0, -1));
2053
+ clearInput();
2054
+ } else if (text[0] === '\n' || text[0] === '\r') {
2055
+ setInputText(text.slice(1));
2056
+ clearInput();
2057
+ }
2058
+ }
2059
+ function setInputText() {
2060
+ var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
2061
+ if (inputRef.value) {
2062
+ var _usingItem$value13;
2063
+ inputRef.value.innerHTML = text || ((_usingItem$value13 = usingItem.value) === null || _usingItem$value13 === void 0 ? void 0 : _usingItem$value13.inputInnerHtml) || '';
2064
+ }
2065
+ }
2066
+ function handleLogicalChange(logical) {
2067
+ if (!usingItem.value) return;
2068
+ usingItem.value.logical = logical;
2069
+ }
2070
+ // expose
2071
+ expose({
2072
+ handleInputFocus: handleInputFocus,
2073
+ isFocus: isFocus
2074
+ });
2075
+ return {
2076
+ popoverRef: popoverRef,
2077
+ inputRef: inputRef,
2078
+ keyword: keyword,
2079
+ loading: loading,
2080
+ remoteMenuList: remoteMenuList,
2081
+ menuList: menuList,
2082
+ menuHoverId: menuHoverId,
2083
+ isFocus: isFocus,
2084
+ usingItem: usingItem,
2085
+ showPopover: showPopover,
2086
+ showNoSelectValueError: showNoSelectValueError,
2087
+ debounceSetMenuList: debounceSetMenuList,
2088
+ documentArrowEvent: documentArrowEvent,
2089
+ handleClickOutside: handleClickOutside,
2090
+ handleInputFocus: handleInputFocus,
2091
+ handleInputChange: handleInputChange,
2092
+ handleLogicalChange: handleLogicalChange,
2093
+ handleInputKeyup: handleInputKeyup,
2094
+ handleSelectItem: handleSelectItem,
2095
+ handleSelectCondtionItem: handleSelectCondtionItem,
2096
+ handleMenuFooterClick: handleMenuFooterClick,
2097
+ resolveClassName: resolveClassName,
2098
+ t: t
2099
+ };
2100
+ },
2101
+ render: function render() {
2102
+ var _this$keyword,
2103
+ _this$menuList,
2104
+ _this = this;
2105
+ var _ref2 = this.usingItem || {},
2106
+ multiple = _ref2.multiple,
2107
+ values = _ref2.values,
2108
+ placeholder = _ref2.placeholder,
2109
+ inputInnerHtml = _ref2.inputInnerHtml;
2110
+ var showInputAfter = !((_this$keyword = this.keyword) !== null && _this$keyword !== void 0 && _this$keyword.length) && !(values !== null && values !== void 0 && values.length) && placeholder;
2111
+ var showPopover = this.loading || this.showNoSelectValueError || this.showPopover && !!((_this$menuList = this.menuList) !== null && _this$menuList !== void 0 && _this$menuList.length);
2112
+ var showCondition = !this.usingItem && this.showCondition;
2113
+ var menuSlots = Object.assign({}, this.$slots.menu ? {
2114
+ "default": function _default(data) {
2115
+ var _this$$slots$menu, _this$$slots;
2116
+ return (_this$$slots$menu = (_this$$slots = _this.$slots).menu) === null || _this$$slots$menu === void 0 ? void 0 : _this$$slots$menu.call(_this$$slots, data);
2117
+ }
2118
+ } : {});
2119
+ var inputContent = function inputContent() {
2120
+ var _this$keyword2;
2121
+ return (0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("div", {
2122
+ "ref": "inputRef",
2123
+ "class": {
2124
+ 'div-input': true,
2125
+ 'input-before': _this.showInputBefore && !((_this$keyword2 = _this.keyword) !== null && _this$keyword2 !== void 0 && _this$keyword2.length),
2126
+ 'input-after': showInputAfter
2127
+ },
2128
+ "contenteditable": true,
2129
+ "data-placeholder": !inputInnerHtml && !_this.keyword ? _this.placeholder : '',
2130
+ "data-tips": placeholder || '',
2131
+ "spellcheck": "false",
2132
+ "onFocus": _this.handleInputFocus,
2133
+ "onInput": _this.handleInputChange,
2134
+ "onKeydown": _this.handleInputKeyup
2135
+ }, null), [[(0,external_vue_namespaceObject.resolveDirective)("clickoutside"), _this.handleClickOutside]]);
2136
+ };
2137
+ var popoverContent = function popoverContent() {
2138
+ var _this$menuList2, _this$usingItem, _this$usingItem2;
2139
+ if (_this.loading) {
2140
+ return (0,external_vue_namespaceObject.createVNode)("div", null, [_this.t.loading]);
2141
+ }
2142
+ if (_this.showNoSelectValueError) {
2143
+ return (0,external_vue_namespaceObject.createVNode)("div", null, [_this.t.filterQueryMustHasValue]);
2144
+ }
2145
+ return (_this$menuList2 = _this.menuList) !== null && _this$menuList2 !== void 0 && _this$menuList2.length ? (0,external_vue_namespaceObject.createVNode)("div", {
2146
+ "ref": "popoverRef",
2147
+ "class": _this.resolveClassName('search-select-popover')
2148
+ }, [(0,external_vue_namespaceObject.createVNode)(menu, {
2149
+ "list": _this.menuList,
2150
+ "keyword": _this.keyword,
2151
+ "multiple": !!multiple,
2152
+ "hoverId": _this.menuHoverId,
2153
+ "selected": (values === null || values === void 0 ? void 0 : values.map(function (item) {
2154
+ return item.id;
2155
+ })) || [],
2156
+ "conditions": showCondition ? _this.conditions : [],
2157
+ "logical": (_this$usingItem = _this.usingItem) === null || _this$usingItem === void 0 ? void 0 : _this$usingItem.logical,
2158
+ "showLogical": (_this$usingItem2 = _this.usingItem) === null || _this$usingItem2 === void 0 ? void 0 : _this$usingItem2.showLogical,
2159
+ "onUpdate:logical": _this.handleLogicalChange,
2160
+ "onSelectItem": _this.handleSelectItem,
2161
+ "onSelectCondition": _this.handleSelectCondtionItem,
2162
+ "onFooterClick": _this.handleMenuFooterClick
2163
+ }, _objectSpread({}, menuSlots))]) : undefined;
2164
+ };
2165
+ return (0,external_vue_namespaceObject.createVNode)(popover_namespaceObject["default"], {
2166
+ "trigger": "manual",
2167
+ "theme": "light",
2168
+ "placement": "bottom-start",
2169
+ "arrow": false,
2170
+ "disableOutsideClick": true,
2171
+ "isShow": showPopover
2172
+ }, {
2173
+ "default": inputContent,
2174
+ content: popoverContent
2175
+ });
2176
+ }
2177
+ }));
2178
+ ;// CONCATENATED MODULE: ../../packages/search-select/src/selected.tsx
2179
+
2180
+ /*
2181
+ * Tencent is pleased to support the open source community by making
2182
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2183
+ *
2184
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2185
+ *
2186
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2187
+ *
2188
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2189
+ *
2190
+ * ---------------------------------------------------
2191
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2192
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2193
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2194
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2195
+ *
2196
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2197
+ * the Software.
2198
+ *
2199
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2200
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2201
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2202
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2203
+ * IN THE SOFTWARE.
2204
+ */
2205
+
2206
+
2207
+
2208
+
2209
+ /* harmony default export */ const selected = ((0,external_vue_namespaceObject.defineComponent)({
2210
+ name: 'SearchSelected',
2211
+ props: {
2212
+ data: {
2213
+ type: Array,
2214
+ required: true
2215
+ },
2216
+ selectedList: {
2217
+ type: Array,
2218
+ required: true
2219
+ },
2220
+ overflowIndex: {
2221
+ type: Number,
2222
+ "default": -1
2223
+ },
2224
+ conditions: {
2225
+ type: Array,
2226
+ "default": function _default() {
2227
+ return [];
2228
+ }
2229
+ },
2230
+ getMenuList: Function,
2231
+ validateValues: Function,
2232
+ valueBehavior: String
2233
+ },
2234
+ emits: ['delete'],
2235
+ setup: function setup(_props, _ref) {
2236
+ var emit = _ref.emit;
2237
+ var inputRef = (0,external_vue_namespaceObject.ref)(null);
2238
+ var _useSearchSelectInjec = useSearchSelectInject(),
2239
+ onEditClick = _useSearchSelectInjec.onEditClick,
2240
+ onEditEnter = _useSearchSelectInjec.onEditEnter,
2241
+ onEditBlur = _useSearchSelectInjec.onEditBlur,
2242
+ editKey = _useSearchSelectInjec.editKey;
2243
+ function handleDeleteSelected(index) {
2244
+ emit('delete', index);
2245
+ }
2246
+ function handleEditSeleted(e, item, index) {
2247
+ e.preventDefault();
2248
+ e.stopPropagation();
2249
+ onEditClick(item, index);
2250
+ // magic code
2251
+ setTimeout(function () {
2252
+ return inputRef.value.handleInputFocus();
2253
+ }, 200);
2254
+ }
2255
+ function handleAddSelected(item, index) {
2256
+ onEditEnter(item, index);
2257
+ }
2258
+ function handleInputFocus(isFocus) {
2259
+ if (isFocus) return;
2260
+ onEditBlur();
2261
+ }
2262
+ function handleInputOutside() {
2263
+ return true;
2264
+ }
2265
+ function copySeletedItem(item) {
2266
+ var newItem = new SelectedItem(item.searchItem, item.type);
2267
+ newItem.values = item.values.slice();
2268
+ newItem.logical = item.logical || SearchLogical.OR;
2269
+ return newItem;
2270
+ }
2271
+ return {
2272
+ inputRef: inputRef,
2273
+ editKey: editKey,
2274
+ copySeletedItem: copySeletedItem,
2275
+ handleDeleteSelected: handleDeleteSelected,
2276
+ handleEditSeleted: handleEditSeleted,
2277
+ handleInputOutside: handleInputOutside,
2278
+ handleAddSelected: handleAddSelected,
2279
+ handleInputFocus: handleInputFocus
2280
+ };
2281
+ },
2282
+ render: function render() {
2283
+ var _this = this;
2284
+ var contentComponent = function contentComponent(item, index) {
2285
+ return _this.editKey === "".concat(item.id, "_").concat(index) ? (0,external_vue_namespaceObject.createVNode)("div", {
2286
+ "class": "selected-input",
2287
+ "key": _this.editKey.toString()
2288
+ }, [(0,external_vue_namespaceObject.createVNode)(input, {
2289
+ "ref": "inputRef",
2290
+ "key": _this.editKey.toString(),
2291
+ "mode": SearchInputMode.EDIT,
2292
+ "data": _this.data,
2293
+ "showCondition": false,
2294
+ "conditions": _this.conditions,
2295
+ "defautUsingItem": _this.copySeletedItem(item),
2296
+ "clickOutside": _this.handleInputOutside,
2297
+ "getMenuList": _this.getMenuList,
2298
+ "validateValues": _this.validateValues,
2299
+ "valueBehavior": _this.valueBehavior,
2300
+ "onAdd": function onAdd(v) {
2301
+ return _this.handleAddSelected(v, index);
2302
+ },
2303
+ "onFocus": _this.handleInputFocus
2304
+ }, null)]) : (0,external_vue_namespaceObject.createVNode)("li", {
2305
+ "class": "search-container-selected ".concat(!(_this.overflowIndex >= 0 ? index < _this.overflowIndex : index >= 0) ? 'hidden-selected' : ''),
2306
+ "key": "".concat(item.id, "_").concat(index)
2307
+ }, [(0,external_vue_namespaceObject.createVNode)("span", {
2308
+ "class": "selected-name",
2309
+ "onClick": function onClick(e) {
2310
+ return _this.handleEditSeleted(e, item, index);
2311
+ }
2312
+ }, [item.inputInnerText]), (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.Error, {
2313
+ "class": "selected-clear",
2314
+ "onClick": function onClick() {
2315
+ return _this.handleDeleteSelected(index);
2316
+ }
2317
+ }, null)]);
2318
+ };
2319
+ return (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [this.selectedList.map(function (item, index) {
2320
+ return [_this.overflowIndex >= 0 && index === _this.overflowIndex && (0,external_vue_namespaceObject.createVNode)("div", {
2321
+ "class": "search-container-selected overflow-selected"
2322
+ }, [(0,external_vue_namespaceObject.createTextVNode)("+"), _this.selectedList.length - _this.overflowIndex]), contentComponent(item, index)];
2323
+ })]);
2324
+ }
2325
+ }));
2326
+ ;// CONCATENATED MODULE: ../../packages/search-select/src/search-select.tsx
2327
+
2328
+
2329
+ function search_select_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2330
+ function search_select_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? search_select_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : search_select_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2331
+ /*
2332
+ * Tencent is pleased to support the open source community by making
2333
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2334
+ *
2335
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2336
+ *
2337
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2338
+ *
2339
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2340
+ *
2341
+ * ---------------------------------------------------
2342
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2343
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2344
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2345
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2346
+ *
2347
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2348
+ * the Software.
2349
+ *
2350
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2351
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2352
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2353
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2354
+ * IN THE SOFTWARE.
2355
+ */
2356
+
2357
+
2358
+
2359
+
2360
+
2361
+
2362
+
2363
+
2364
+
2365
+ var INPUT_PADDING_WIDTH = 40;
2366
+ var SELETED_MARGING_RIGHT = 6;
2367
+ var SearchSelectProps = {
2368
+ data: {
2369
+ type: Array,
2370
+ "default": function _default() {
2371
+ return [];
2372
+ }
2373
+ },
2374
+ modelValue: {
2375
+ type: Array,
2376
+ "default": function _default() {
2377
+ return [];
2378
+ }
2379
+ },
2380
+ shrink: {
2381
+ type: Boolean,
2382
+ "default": true
2383
+ },
2384
+ maxHeight: {
2385
+ type: Number,
2386
+ "default": 120
2387
+ },
2388
+ minHeight: {
2389
+ type: Number,
2390
+ "default": 26
2391
+ },
2392
+ conditions: {
2393
+ type: Array,
2394
+ "default": function _default() {
2395
+ return [];
2396
+ }
2397
+ },
2398
+ clearable: {
2399
+ type: Boolean,
2400
+ "default": true
2401
+ },
2402
+ placeholder: String,
2403
+ getMenuList: Function,
2404
+ validateValues: Function,
2405
+ uniqueSelect: {
2406
+ type: Boolean,
2407
+ "default": false
2408
+ },
2409
+ valueBehavior: {
2410
+ type: String,
2411
+ "default": ValueBehavior.ALL,
2412
+ validator: function validator(v) {
2413
+ return [ValueBehavior.ALL, ValueBehavior.NEEDKEY].includes(v);
2414
+ }
2415
+ }
2416
+ };
2417
+ /* harmony default export */ const search_select = ((0,external_vue_namespaceObject.defineComponent)({
2418
+ name: 'SearchSelect',
2419
+ directives: {
2420
+ clickoutside: directives_namespaceObject.clickoutside
2421
+ },
2422
+ props: SearchSelectProps,
2423
+ emits: ['update:modelValue', 'search'],
2424
+ setup: function setup(props, _ref) {
2425
+ var emit = _ref.emit;
2426
+ var t = (0,config_provider_namespaceObject.useLocale)('searchSelect');
2427
+ var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
2428
+ resolveClassName = _usePrefix.resolveClassName;
2429
+ var localConditions = (0,external_vue_namespaceObject.computed)(function () {
2430
+ if (props.conditions === undefined) {
2431
+ return [{
2432
+ id: 'or',
2433
+ name: t.value.or
2434
+ }, {
2435
+ id: 'and',
2436
+ name: t.value.and
2437
+ }];
2438
+ }
2439
+ return props.conditions;
2440
+ });
2441
+ // refs
2442
+ var inputRef = (0,external_vue_namespaceObject.ref)(null);
2443
+ var wrapRef = (0,external_vue_namespaceObject.ref)(null);
2444
+ // vars
2445
+ var isFocus = (0,external_vue_namespaceObject.ref)(false);
2446
+ var selectedList = (0,external_vue_namespaceObject.ref)([]);
2447
+ var overflowIndex = (0,external_vue_namespaceObject.ref)(-1);
2448
+ var debounceResize = (0,shared_namespaceObject.debounce)(32, handleResize);
2449
+ var editKey = (0,external_vue_namespaceObject.ref)('');
2450
+ var validateStr = (0,external_vue_namespaceObject.ref)('');
2451
+ var copyData = (0,external_vue_namespaceObject.shallowRef)([]);
2452
+ (0,external_vue_namespaceObject.watch)(function () {
2453
+ return props.data;
2454
+ }, function () {
2455
+ var _copyData$value;
2456
+ copyData.value = JSON.parse(JSON.stringify(props.data));
2457
+ (_copyData$value = copyData.value) === null || _copyData$value === void 0 ? void 0 : _copyData$value.forEach(function (item) {
2458
+ item.isSelected = props.uniqueSelect && !!props.modelValue.some(function (set) {
2459
+ return set.id === item.id;
2460
+ });
2461
+ });
2462
+ }, {
2463
+ immediate: true
2464
+ });
2465
+ // effects
2466
+ (0,external_vue_namespaceObject.watch)(function () {
2467
+ return props.modelValue;
2468
+ }, function (v) {
2469
+ if (!(v !== null && v !== void 0 && v.length)) {
2470
+ var _copyData$value2;
2471
+ selectedList.value = [];
2472
+ (_copyData$value2 = copyData.value) === null || _copyData$value2 === void 0 ? void 0 : _copyData$value2.forEach(function (item) {
2473
+ item.isSelected = false;
2474
+ });
2475
+ return;
2476
+ }
2477
+ var list = [];
2478
+ v.forEach(function (item) {
2479
+ var seleted = selectedList.value.find(function (set) {
2480
+ return set.id === item.id && set.name === item.name;
2481
+ });
2482
+ if ((seleted === null || seleted === void 0 ? void 0 : seleted.toValueKey()) === JSON.stringify(item)) {
2483
+ seleted.values = item.values || [];
2484
+ seleted.logical = item.logical || SearchLogical.OR;
2485
+ list.push(seleted);
2486
+ } else {
2487
+ var _item$values;
2488
+ var searchItem = props.data.find(function (set) {
2489
+ return set.id === item.id;
2490
+ });
2491
+ var searchType = 'default';
2492
+ if (!searchItem) {
2493
+ searchItem = props.conditions.find(function (set) {
2494
+ return set.id === item.id;
2495
+ });
2496
+ searchItem && (searchType = 'condition');
2497
+ }
2498
+ if (!searchItem && !((_item$values = item.values) !== null && _item$values !== void 0 && _item$values.length)) {
2499
+ searchType = 'text';
2500
+ }
2501
+ var newSelected = new SelectedItem(searchItem || item, searchType);
2502
+ newSelected.values = item.values || [];
2503
+ newSelected.logical = item.logical || SearchLogical.OR;
2504
+ list.push(newSelected);
2505
+ }
2506
+ });
2507
+ selectedList.value = list;
2508
+ copyData.value = JSON.parse(JSON.stringify(props.data || []));
2509
+ copyData.value.forEach(function (item) {
2510
+ item.isSelected = props.uniqueSelect && !!list.some(function (set) {
2511
+ return set.id === item.id;
2512
+ });
2513
+ });
2514
+ }, {
2515
+ immediate: true,
2516
+ deep: true
2517
+ });
2518
+ // life hooks
2519
+ (0,external_vue_namespaceObject.onMounted)(function () {
2520
+ addListener(wrapRef.value.querySelector(".".concat(resolveClassName('search-select-container'))), debounceResize);
2521
+ });
2522
+ (0,external_vue_namespaceObject.onBeforeUnmount)(function () {
2523
+ removeListener(wrapRef.value.querySelector(".".concat(resolveClassName('search-select-container'))), debounceResize);
2524
+ });
2525
+ // edit item
2526
+ useSearchSelectProvider({
2527
+ onEditClick: onEditClick,
2528
+ onEditEnter: onEditEnter,
2529
+ onEditBlur: onEditBlur,
2530
+ onValidate: onValidate,
2531
+ editKey: editKey
2532
+ });
2533
+ function onEditClick(item, index) {
2534
+ editKey.value = "".concat(item.id, "_").concat(index);
2535
+ }
2536
+ function onEditEnter(item, index) {
2537
+ var list = selectedList.value.slice();
2538
+ list.splice(index, 1, item);
2539
+ emit('update:modelValue', list.map(function (item) {
2540
+ return item.toValue();
2541
+ }));
2542
+ editKey.value = '';
2543
+ }
2544
+ function onEditBlur() {
2545
+ editKey.value = '';
2546
+ onValidate('');
2547
+ }
2548
+ function onValidate(str) {
2549
+ validateStr.value = str || '';
2550
+ }
2551
+ // events
2552
+ function handleResize() {
2553
+ if (isFocus.value || selectedList.value.length < 1) {
2554
+ overflowIndex.value = -1;
2555
+ return;
2556
+ }
2557
+ var inputEl = wrapRef.value.querySelector(".".concat(resolveClassName('search-select-container')));
2558
+ var maxWidth = wrapRef.value.querySelector('.search-container').clientWidth - SELETED_MARGING_RIGHT - 2;
2559
+ var tagList = inputEl.querySelectorAll('.search-container-selected:not(.overflow-selected)');
2560
+ var width = 0;
2561
+ var index = 0;
2562
+ var i = 0;
2563
+ while (index === 0 && width <= maxWidth - INPUT_PADDING_WIDTH && i <= tagList.length - 1) {
2564
+ var el = tagList[i];
2565
+ if (el.clientHeight > props.minHeight) {
2566
+ overflowIndex.value = i;
2567
+ return;
2568
+ }
2569
+ width += el ? el.clientWidth + SELETED_MARGING_RIGHT : 0;
2570
+ if (width >= maxWidth - INPUT_PADDING_WIDTH) {
2571
+ index = i;
2572
+ }
2573
+ i += 1;
2574
+ }
2575
+ if (index === tagList.length - 1 && width <= maxWidth) {
2576
+ overflowIndex.value = -1;
2577
+ return;
2578
+ }
2579
+ overflowIndex.value = width >= maxWidth - INPUT_PADDING_WIDTH ? index : index - 1;
2580
+ }
2581
+ function handleWrapClick() {
2582
+ if (!editKey.value) {
2583
+ inputRef.value.handleInputFocus();
2584
+ }
2585
+ }
2586
+ function handleClearAll() {
2587
+ selectedList.value = [];
2588
+ overflowIndex.value = -1;
2589
+ emit('update:modelValue', []);
2590
+ }
2591
+ function handleInputOutside(target) {
2592
+ var _wrapRef$value;
2593
+ return !((_wrapRef$value = wrapRef.value) !== null && _wrapRef$value !== void 0 && _wrapRef$value.contains(target));
2594
+ }
2595
+ function handleAddSelected(item) {
2596
+ var list = selectedList.value.slice();
2597
+ list.push(item);
2598
+ onValidate('');
2599
+ emit('update:modelValue', list.map(function (item) {
2600
+ return item.toValue();
2601
+ }));
2602
+ }
2603
+ function handleDeleteSelected(index) {
2604
+ var list = selectedList.value.slice();
2605
+ list.splice(typeof index === 'number' ? index : selectedList.value.length - 1, 1);
2606
+ onValidate('');
2607
+ emit('update:modelValue', list.map(function (item) {
2608
+ return item.toValue();
2609
+ }));
2610
+ }
2611
+ function handleInputFocus(v) {
2612
+ v && (overflowIndex.value = -1);
2613
+ if (v === false) {
2614
+ var _wrapRef$value$queryS;
2615
+ (_wrapRef$value$queryS = wrapRef.value.querySelector(".".concat(resolveClassName('search-select-container')))) === null || _wrapRef$value$queryS === void 0 ? void 0 : _wrapRef$value$queryS.scrollTo(0, 0);
2616
+ }
2617
+ isFocus.value = v;
2618
+ }
2619
+ function handleClickSearch(e) {
2620
+ emit('search', e);
2621
+ }
2622
+ return {
2623
+ inputRef: inputRef,
2624
+ wrapRef: wrapRef,
2625
+ isFocus: isFocus,
2626
+ copyData: copyData,
2627
+ selectedList: selectedList,
2628
+ overflowIndex: overflowIndex,
2629
+ validateStr: validateStr,
2630
+ onEditClick: onEditClick,
2631
+ onEditEnter: onEditEnter,
2632
+ handleWrapClick: handleWrapClick,
2633
+ handleInputFocus: handleInputFocus,
2634
+ handleResize: handleResize,
2635
+ handleClearAll: handleClearAll,
2636
+ handleInputOutside: handleInputOutside,
2637
+ handleAddSelected: handleAddSelected,
2638
+ handleDeleteSelected: handleDeleteSelected,
2639
+ handleClickSearch: handleClickSearch,
2640
+ localConditions: localConditions,
2641
+ resolveClassName: resolveClassName,
2642
+ t: t
2643
+ };
2644
+ },
2645
+ render: function render() {
2646
+ var _this = this,
2647
+ _ref2,
2648
+ _this$$slots$prepend,
2649
+ _this$$slots2;
2650
+ var maxHeight = "".concat(!this.shrink || this.isFocus ? this.maxHeight : this.minHeight, "px");
2651
+ var showCondition = !!this.selectedList.length && this.selectedList.slice(-1)[0].type !== 'condition';
2652
+ var menuSlots = Object.assign({}, this.$slots.menu ? {
2653
+ menu: function menu(data) {
2654
+ var _this$$slots$menu, _this$$slots;
2655
+ return (_this$$slots$menu = (_this$$slots = _this.$slots).menu) === null || _this$$slots$menu === void 0 ? void 0 : _this$$slots$menu.call(_this$$slots, data);
2656
+ }
2657
+ } : {});
2658
+ // render
2659
+ return (0,external_vue_namespaceObject.createVNode)("div", {
2660
+ "class": this.resolveClassName('search-select'),
2661
+ "ref": "wrapRef"
2662
+ }, [(0,external_vue_namespaceObject.createVNode)("div", {
2663
+ "class": (_ref2 = {}, _defineProperty(_ref2, this.resolveClassName('search-select-container'), true), _defineProperty(_ref2, 'is-focus', this.isFocus), _ref2),
2664
+ "onClick": this.handleWrapClick
2665
+ }, [(0,external_vue_namespaceObject.createVNode)("div", {
2666
+ "class": "search-prefix"
2667
+ }, [(_this$$slots$prepend = (_this$$slots2 = this.$slots).prepend) === null || _this$$slots$prepend === void 0 ? void 0 : _this$$slots$prepend.call(_this$$slots2)]), (0,external_vue_namespaceObject.createVNode)("div", {
2668
+ "class": "search-container",
2669
+ "style": {
2670
+ maxHeight: maxHeight
2671
+ }
2672
+ }, [(0,external_vue_namespaceObject.createVNode)(selected, {
2673
+ "data": this.copyData,
2674
+ "conditions": this.localConditions,
2675
+ "selectedList": this.selectedList,
2676
+ "overflowIndex": this.overflowIndex,
2677
+ "getMenuList": this.getMenuList,
2678
+ "validateValues": this.validateValues,
2679
+ "valueBehavior": this.valueBehavior,
2680
+ "onDelete": this.handleDeleteSelected
2681
+ }, search_select_objectSpread({}, menuSlots)), (0,external_vue_namespaceObject.createVNode)("div", {
2682
+ "class": "search-container-input"
2683
+ }, [(0,external_vue_namespaceObject.createVNode)(input, {
2684
+ "ref": "inputRef",
2685
+ "data": this.copyData,
2686
+ "showInputBefore": !this.selectedList.length,
2687
+ "showCondition": showCondition,
2688
+ "conditions": this.localConditions,
2689
+ "placeholder": this.placeholder || this.t.pleaseSelect,
2690
+ "clickOutside": this.handleInputOutside,
2691
+ "getMenuList": this.getMenuList,
2692
+ "validateValues": this.validateValues,
2693
+ "valueBehavior": this.valueBehavior,
2694
+ "onAdd": this.handleAddSelected,
2695
+ "onDelete": this.handleDeleteSelected,
2696
+ "onFocus": this.handleInputFocus
2697
+ }, search_select_objectSpread({}, menuSlots))])]), (0,external_vue_namespaceObject.createVNode)("div", {
2698
+ "class": "search-nextfix"
2699
+ }, [this.clearable && !!this.selectedList.length && (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.Close, {
2700
+ "class": "search-clear",
2701
+ "onClick": this.handleClearAll
2702
+ }, null), this.$slots.append ? this.$slots.append() : (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.Search, {
2703
+ "onClick": this.handleClickSearch,
2704
+ "class": "search-nextfix-icon ".concat(this.isFocus ? 'is-focus' : '')
2705
+ }, null)])]), !!this.validateStr.length && (0,external_vue_namespaceObject.createVNode)("div", {
2706
+ "class": this.resolveClassName('search-select-tips')
2707
+ }, [this.$slots.validate ? this.$slots.validate() : (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [(0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.ExclamationCircleShape, {
2708
+ "class": "select-tips"
2709
+ }, null), this.validateStr || ''])])]);
2710
+ }
2711
+ }));
2712
+ ;// CONCATENATED MODULE: ../../packages/search-select/src/index.ts
2713
+ /*
2714
+ * Tencent is pleased to support the open source community by making
2715
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2716
+ *
2717
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2718
+ *
2719
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2720
+ *
2721
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2722
+ *
2723
+ * ---------------------------------------------------
2724
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2725
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2726
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2727
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2728
+ *
2729
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2730
+ * the Software.
2731
+ *
2732
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2733
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2734
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2735
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2736
+ * IN THE SOFTWARE.
2737
+ */
2738
+
2739
+
2740
+ var BkSearchSelect = (0,shared_namespaceObject.withInstall)(search_select);
2741
+ /* harmony default export */ const src = (BkSearchSelect);
2742
+
2743
+ })();
2744
+
2745
+ var __webpack_exports__BkSearchSelect = __webpack_exports__.r;
2746
+ var __webpack_exports__default = __webpack_exports__.Z;
2747
+ export { __webpack_exports__BkSearchSelect as BkSearchSelect, __webpack_exports__default as default };