bkui-vue 1.0.3-beta.9 → 2.0.1-beta.10

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 (407) hide show
  1. package/dist/index.cjs.js +162 -164
  2. package/dist/index.esm.js +31999 -29678
  3. package/dist/index.umd.js +162 -164
  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.variable.css +3 -0
  15. package/lib/affix/index.js +7 -7
  16. package/lib/alert/alert.d.ts +5 -5
  17. package/lib/alert/alert.variable.css +3 -0
  18. package/lib/alert/index.d.ts +11 -11
  19. package/lib/backtop/backtop.d.ts +1 -1
  20. package/lib/backtop/backtop.variable.css +3 -0
  21. package/lib/backtop/index.d.ts +3 -3
  22. package/lib/backtop/index.js +6 -6
  23. package/lib/badge/badge.variable.css +3 -0
  24. package/lib/badge/index.js +1 -1
  25. package/lib/breadcrumb/breadcrumb.variable.css +3 -0
  26. package/lib/button/button.d.ts +7 -7
  27. package/lib/button/button.variable.css +3 -0
  28. package/lib/button/index.d.ts +8 -8
  29. package/lib/button/index.js +6 -6
  30. package/lib/card/card.variable.css +3 -0
  31. package/lib/cascader/cascader-panel.d.ts +1 -1
  32. package/lib/cascader/cascader.css +3 -3
  33. package/lib/cascader/cascader.d.ts +1 -1
  34. package/lib/cascader/cascader.less +4 -4
  35. package/lib/cascader/cascader.variable.css +6 -3
  36. package/lib/cascader/index.js +35 -36
  37. package/lib/cascader/interface.d.ts +1 -1
  38. package/lib/checkbox/checkbox.variable.css +3 -0
  39. package/lib/checkbox/index.js +7 -7
  40. package/lib/checkbox/type.d.ts +1 -1
  41. package/lib/code-diff/code-diff.variable.css +3 -0
  42. package/lib/code-diff/index.js +8 -8
  43. package/lib/collapse/collapse.css +11 -0
  44. package/lib/collapse/collapse.d.ts +11 -0
  45. package/lib/collapse/collapse.less +15 -1
  46. package/lib/collapse/collapse.variable.css +14 -0
  47. package/lib/collapse/index.d.ts +23 -0
  48. package/lib/collapse/index.js +11 -3
  49. package/lib/collapse/props.d.ts +8 -0
  50. package/lib/collapse/utils.d.ts +2 -2
  51. package/lib/collapse-transition/collapse-transition.variable.css +3 -0
  52. package/lib/color-picker/color-picker.css +3 -3
  53. package/lib/color-picker/color-picker.less +3 -3
  54. package/lib/color-picker/color-picker.variable.css +6 -3
  55. package/lib/color-picker/index.js +45 -45
  56. package/lib/components.d.ts +32 -30
  57. package/lib/components.js +31 -29
  58. package/lib/config-provider/config-provider.d.ts +3 -0
  59. package/lib/config-provider/config-provider.variable.css +3 -0
  60. package/lib/config-provider/index.d.ts +5 -1
  61. package/lib/config-provider/token.d.ts +1 -0
  62. package/lib/container/container.variable.css +3 -0
  63. package/lib/container/index.js +6 -6
  64. package/lib/date-picker/base/date-table.d.ts +1 -1
  65. package/lib/date-picker/base/month-table.d.ts +3 -3
  66. package/lib/date-picker/base/picker-dropdown.d.ts +1 -1
  67. package/lib/date-picker/base/year-table.d.ts +3 -3
  68. package/lib/date-picker/date-picker.d.ts +1 -0
  69. package/lib/date-picker/date-picker.variable.css +3 -0
  70. package/lib/date-picker/index.d.ts +3 -0
  71. package/lib/date-picker/index.js +340 -224
  72. package/lib/date-picker/interface.d.ts +9 -9
  73. package/lib/date-picker/panel/date-range.d.ts +2 -64
  74. package/lib/date-picker/panel/date.d.ts +1 -1
  75. package/lib/date-picker/panel/time-range.d.ts +1 -1
  76. package/lib/date-picker/panel/time.d.ts +1 -1
  77. package/lib/date-picker/props.d.ts +1 -1
  78. package/lib/date-picker/time-picker.d.ts +1 -0
  79. package/lib/date-picker/utils.d.ts +9 -1
  80. package/lib/dialog/dialog.css +172 -150
  81. package/lib/dialog/dialog.d.ts +55 -124
  82. package/lib/dialog/dialog.less +51 -124
  83. package/lib/dialog/dialog.variable.css +175 -150
  84. package/lib/dialog/index.d.ts +132 -296
  85. package/lib/dialog/index.js +244 -246
  86. package/lib/dialog/props.d.ts +16 -41
  87. package/lib/directives/index.d.ts +3 -3
  88. package/lib/directives/index.js +166 -167
  89. package/lib/directives/tooltips.d.ts +1 -1
  90. package/lib/dist.index.js +2 -2
  91. package/lib/divider/divider.d.ts +5 -5
  92. package/lib/divider/divider.variable.css +3 -0
  93. package/lib/divider/index.d.ts +11 -11
  94. package/lib/divider/index.js +2 -2
  95. package/lib/divider/props.d.ts +2 -2
  96. package/lib/dropdown/dropdown.css +3 -1
  97. package/lib/dropdown/dropdown.d.ts +5 -5
  98. package/lib/dropdown/dropdown.variable.css +6 -1
  99. package/lib/dropdown/index.d.ts +11 -11
  100. package/lib/dropdown/index.js +7 -7
  101. package/lib/exception/exception.d.ts +9 -9
  102. package/lib/exception/exception.variable.css +3 -0
  103. package/lib/exception/index.d.ts +11 -11
  104. package/lib/exception/index.js +10 -10
  105. package/lib/exception/typings/index.d.ts +1 -1
  106. package/lib/fixed-navbar/fixed-navbar.variable.css +3 -0
  107. package/lib/fixed-navbar/index.js +2 -2
  108. package/lib/form/form.d.ts +2 -2
  109. package/lib/form/form.variable.css +3 -0
  110. package/lib/form/index.js +17 -15
  111. package/lib/form/type.d.ts +2 -2
  112. package/lib/icon/image-fill.js +82 -167
  113. package/lib/icon/img-error.js +82 -167
  114. package/lib/icon/img-placehoulder.js +82 -167
  115. package/lib/icon/index.d.ts +12 -11
  116. package/lib/icon/index.js +87 -2427
  117. package/lib/icon/info-line.js +82 -167
  118. package/lib/icon/info.js +82 -167
  119. package/lib/icon/left-shape.js +82 -167
  120. package/lib/icon/left-turn-line.js +82 -167
  121. package/lib/icon/loading.js +82 -167
  122. package/lib/icon/narrow-line.js +82 -167
  123. package/lib/icon/original.js +82 -167
  124. package/lib/icon/pdf-fill.js +82 -167
  125. package/lib/icon/play-shape.js +82 -167
  126. package/lib/icon/plus.js +82 -167
  127. package/lib/icon/ppt-fill.js +82 -167
  128. package/lib/icon/qq.js +82 -167
  129. package/lib/icon/right-shape.js +82 -167
  130. package/lib/icon/right-turn-line.js +82 -167
  131. package/lib/icon/search.js +82 -167
  132. package/lib/icon/share.js +82 -167
  133. package/lib/icon/spinner.js +82 -167
  134. package/lib/icon/success.js +82 -167
  135. package/lib/icon/switcher-loading.js +82 -167
  136. package/lib/icon/text-all.d.ts +4 -0
  137. package/lib/icon/text-all.js +191 -0
  138. package/lib/icon/text-file.js +82 -167
  139. package/lib/icon/text-fill.js +82 -167
  140. package/lib/icon/transfer.js +82 -167
  141. package/lib/icon/tree-application-shape.js +82 -167
  142. package/lib/icon/unfull-screen.js +82 -167
  143. package/lib/icon/unvisible.js +82 -167
  144. package/lib/icon/up-shape.js +82 -167
  145. package/lib/icon/upload.js +82 -167
  146. package/lib/icon/video-fill.js +82 -167
  147. package/lib/icon/warn.js +82 -167
  148. package/lib/icon/weixin-pro.js +82 -167
  149. package/lib/icon/weixin.js +82 -167
  150. package/lib/image/image-viewer.d.ts +1 -1
  151. package/lib/image/image-viewer.variable.css +3 -0
  152. package/lib/image/image.variable.css +3 -0
  153. package/lib/image/index.js +25 -22
  154. package/lib/index.d.ts +3 -3
  155. package/lib/index.js +3 -3
  156. package/lib/info-box/index.d.ts +2 -2
  157. package/lib/info-box/index.js +257 -516
  158. package/lib/info-box/info-box.css +58 -28
  159. package/lib/info-box/info-box.d.ts +25 -23
  160. package/lib/info-box/info-box.less +82 -51
  161. package/lib/info-box/info-box.variable.css +61 -28
  162. package/lib/info-box/render-component.d.ts +4 -0
  163. package/lib/input/index.d.ts +15 -15
  164. package/lib/input/index.js +23 -17
  165. package/lib/input/input.d.ts +15 -15
  166. package/lib/input/input.variable.css +3 -0
  167. package/lib/link/index.d.ts +11 -11
  168. package/lib/link/index.js +3 -3
  169. package/lib/link/link.d.ts +5 -5
  170. package/lib/link/link.variable.css +3 -0
  171. package/lib/loading/index.d.ts +4 -4
  172. package/lib/loading/index.js +6 -6
  173. package/lib/loading/loading.d.ts +6 -6
  174. package/lib/loading/loading.variable.css +3 -0
  175. package/lib/locale/index.d.ts +1 -1
  176. package/lib/locale/index.js +4 -2
  177. package/lib/locale/lang/en.d.ts +1 -0
  178. package/lib/menu/index.js +0 -1
  179. package/lib/menu/menu.variable.css +3 -0
  180. package/lib/menu/submenu.variable.css +3 -0
  181. package/lib/menu/utils.d.ts +3 -3
  182. package/lib/message/index.js +18 -18
  183. package/lib/message/message.variable.css +3 -0
  184. package/lib/message/messageConstructor.d.ts +11 -11
  185. package/lib/modal/hooks.d.ts +6 -0
  186. package/lib/modal/index.d.ts +44 -312
  187. package/lib/modal/index.js +286 -672
  188. package/lib/modal/mask.d.ts +6 -0
  189. package/lib/modal/modal.css +151 -76
  190. package/lib/modal/modal.d.ts +19 -117
  191. package/lib/modal/modal.less +103 -56
  192. package/lib/modal/modal.variable.css +154 -76
  193. package/lib/modal/props.mixin.d.ts +5 -41
  194. package/lib/navigation/index.js +20 -20
  195. package/lib/navigation/navigation.d.ts +1 -1
  196. package/lib/navigation/navigation.variable.css +3 -0
  197. package/lib/notify/index.js +4 -4
  198. package/lib/notify/notify.variable.css +3 -0
  199. package/lib/overflow-title/components/overflow-title.d.ts +9 -9
  200. package/lib/overflow-title/index.d.ts +19 -19
  201. package/lib/overflow-title/index.js +107 -63
  202. package/lib/overflow-title/props.d.ts +18 -18
  203. package/lib/pagination/index.js +16 -15
  204. package/lib/pagination/pagination.variable.css +3 -0
  205. package/lib/pagination/type.d.ts +1 -1
  206. package/lib/pagination/use-limit.d.ts +1 -1
  207. package/lib/pagination/use-total.d.ts +1 -1
  208. package/lib/plugin-popover/index.d.ts +1 -1
  209. package/lib/plugin-popover/index.js +62 -44
  210. package/lib/pop-confirm/index.js +17 -14
  211. package/lib/pop-confirm/pop-confirm.variable.css +3 -0
  212. package/lib/pop-confirm/props.d.ts +2 -2
  213. package/lib/popover/const.d.ts +3 -3
  214. package/lib/popover/content.d.ts +1 -1
  215. package/lib/popover/index.d.ts +19 -19
  216. package/lib/popover/index.js +62 -44
  217. package/lib/popover/plugin-popover.d.ts +4 -1
  218. package/lib/popover/popover.css +3 -1
  219. package/lib/popover/popover.d.ts +7 -7
  220. package/lib/popover/popover.less +4 -1
  221. package/lib/popover/popover.variable.css +6 -1
  222. package/lib/popover/props.d.ts +4 -4
  223. package/lib/preset.d.ts +2 -0
  224. package/lib/process/index.js +3 -3
  225. package/lib/process/process.variable.css +3 -0
  226. package/lib/progress/index.d.ts +11 -11
  227. package/lib/progress/index.js +10 -10
  228. package/lib/progress/progress.d.ts +7 -7
  229. package/lib/progress/progress.variable.css +3 -0
  230. package/lib/radio/index.d.ts +29 -0
  231. package/lib/radio/index.js +49 -31
  232. package/lib/radio/radio-button.d.ts +10 -0
  233. package/lib/radio/radio-group.d.ts +10 -0
  234. package/lib/radio/radio.d.ts +10 -0
  235. package/lib/radio/radio.variable.css +3 -0
  236. package/lib/radio/type.d.ts +1 -1
  237. package/lib/rate/index.js +8 -8
  238. package/lib/rate/rate.css +27 -0
  239. package/lib/rate/rate.less +33 -0
  240. package/lib/rate/rate.variable.css +30 -0
  241. package/lib/resize-layout/index.d.ts +11 -11
  242. package/lib/resize-layout/index.js +8 -9
  243. package/lib/resize-layout/resize-layout.d.ts +5 -5
  244. package/lib/resize-layout/resize-layout.variable.css +3 -0
  245. package/lib/scrollbar/index.d.ts +15 -0
  246. package/lib/scrollbar/index.js +18762 -0
  247. package/lib/scrollbar/scrollbar-core/can-use-dom.d.ts +2 -0
  248. package/lib/scrollbar/scrollbar-core/helpers.d.ts +5 -0
  249. package/lib/scrollbar/scrollbar-core/index.d.ts +241 -0
  250. package/lib/scrollbar/scrollbar-core/mouse-wheel.d.ts +5 -0
  251. package/lib/scrollbar/scrollbar-core/scrollbar-width.d.ts +1 -0
  252. package/lib/scrollbar/scrollbar.css +75 -0
  253. package/lib/scrollbar/scrollbar.less +94 -0
  254. package/lib/{rate/star.variable.css → scrollbar/scrollbar.variable.css} +70 -19
  255. package/lib/search-select/index.d.ts +375 -16
  256. package/lib/search-select/index.js +754 -419
  257. package/lib/search-select/input.d.ts +14 -5
  258. package/lib/search-select/menu.d.ts +1 -1
  259. package/lib/search-select/search-select.css +20 -6
  260. package/lib/search-select/search-select.d.ts +129 -7
  261. package/lib/search-select/search-select.less +16 -12
  262. package/lib/search-select/search-select.variable.css +23 -6
  263. package/lib/search-select/selected.d.ts +117 -7
  264. package/lib/search-select/utils.d.ts +22 -9
  265. package/lib/select/index.d.ts +185 -67
  266. package/lib/select/index.js +1396 -136
  267. package/lib/select/option.d.ts +3 -1
  268. package/lib/select/pinyin/core.d.ts +14 -0
  269. package/lib/select/pinyin/dict.d.ts +34 -0
  270. package/lib/select/pinyin/index.d.ts +2 -0
  271. package/lib/select/select.css +56 -14
  272. package/lib/select/select.d.ts +74 -26
  273. package/lib/select/select.less +70 -21
  274. package/lib/select/select.variable.css +59 -14
  275. package/lib/select/selectTagInput.d.ts +13 -6
  276. package/lib/select/type.d.ts +4 -5
  277. package/lib/shared/index.d.ts +1 -2
  278. package/lib/shared/index.js +108 -96
  279. package/lib/shared/popover.d.ts +3 -3
  280. package/lib/shared/token.d.ts +1 -1
  281. package/lib/shared/utils.d.ts +12 -0
  282. package/lib/shared/vue-types.d.ts +51 -46
  283. package/lib/shared/z-index-manager.d.ts +6 -6
  284. package/lib/sideslider/index.d.ts +58 -188
  285. package/lib/sideslider/index.js +83 -57
  286. package/lib/sideslider/sideslider.css +26 -90
  287. package/lib/sideslider/sideslider.d.ts +26 -88
  288. package/lib/sideslider/sideslider.less +56 -132
  289. package/lib/sideslider/sideslider.variable.css +29 -90
  290. package/lib/slider/index.d.ts +19 -0
  291. package/lib/slider/index.js +64 -26
  292. package/lib/slider/slider.css +14 -0
  293. package/lib/slider/slider.d.ts +9 -0
  294. package/lib/slider/slider.less +15 -0
  295. package/lib/slider/slider.variable.css +17 -0
  296. package/lib/steps/index.d.ts +11 -11
  297. package/lib/steps/index.js +3 -3
  298. package/lib/steps/steps.d.ts +7 -7
  299. package/lib/steps/steps.variable.css +3 -0
  300. package/lib/styles/index.d.ts +0 -1
  301. package/lib/styles/mixins/animate.variable.css +3 -0
  302. package/lib/styles/mixins/popper.variable.css +3 -0
  303. package/lib/styles/mixins/scroll.variable.css +3 -0
  304. package/lib/styles/reset.css +1 -3
  305. package/lib/styles/reset.less +3 -6
  306. package/lib/styles/reset.variable.css +4 -3
  307. package/lib/styles/themes/themes.less +5 -0
  308. package/lib/swiper/index.js +5 -5
  309. package/lib/swiper/swiper.variable.css +3 -0
  310. package/lib/switcher/index.js +2 -2
  311. package/lib/switcher/switcher.d.ts +2 -2
  312. package/lib/switcher/switcher.variable.css +3 -0
  313. package/lib/tab/index.d.ts +22 -22
  314. package/lib/tab/index.js +15 -15
  315. package/lib/tab/props.d.ts +15 -15
  316. package/lib/tab/tab-nav.d.ts +10 -10
  317. package/lib/tab/tab.d.ts +10 -10
  318. package/lib/tab/tab.variable.css +3 -0
  319. package/lib/table/cache.d.ts +11 -3
  320. package/lib/table/components/table-cell.d.ts +3 -2
  321. package/lib/table/components/table-column.d.ts +30 -100
  322. package/lib/table/const.d.ts +12 -12
  323. package/lib/table/events.d.ts +21 -21
  324. package/lib/table/index.d.ts +220 -305
  325. package/lib/table/index.js +18165 -688
  326. package/lib/table/plugins/head-filter.css +8 -4
  327. package/lib/table/plugins/head-filter.less +6 -3
  328. package/lib/table/plugins/head-filter.variable.css +11 -4
  329. package/lib/table/plugins/head-sort.variable.css +3 -0
  330. package/lib/table/plugins/settings.variable.css +3 -0
  331. package/lib/table/plugins/use-active-columns.d.ts +2 -2
  332. package/lib/table/plugins/use-column-template.d.ts +7 -0
  333. package/lib/table/plugins/use-draggable.d.ts +2 -2
  334. package/lib/table/plugins/use-fixed-column.d.ts +1 -1
  335. package/lib/table/plugins/use-observer-resize.d.ts +5 -0
  336. package/lib/table/plugins/use-pagination.d.ts +3 -1
  337. package/lib/table/plugins/use-shift-key.d.ts +13 -0
  338. package/lib/table/props.d.ts +49 -39
  339. package/lib/table/table.css +112 -58
  340. package/lib/table/table.d.ts +58 -47
  341. package/lib/table/table.less +46 -58
  342. package/lib/table/table.variable.css +115 -58
  343. package/lib/table/use-attributes.d.ts +9 -46
  344. package/lib/table/use-column.d.ts +18 -139
  345. package/lib/table/use-common.d.ts +5 -5
  346. package/lib/table/use-render.d.ts +1 -1
  347. package/lib/table/utils.d.ts +6 -6
  348. package/lib/table-column/index.d.ts +127 -431
  349. package/lib/table-column/index.js +43 -117
  350. package/lib/tag/index.d.ts +11 -11
  351. package/lib/tag/index.js +2 -2
  352. package/lib/tag/tag.d.ts +5 -5
  353. package/lib/tag/tag.variable.css +3 -0
  354. package/lib/tag-input/common.d.ts +1 -1
  355. package/lib/tag-input/index.d.ts +12 -12
  356. package/lib/tag-input/index.js +30 -30
  357. package/lib/tag-input/tag-input.d.ts +6 -6
  358. package/lib/tag-input/tag-input.variable.css +3 -0
  359. package/lib/tag-input/tag-props.d.ts +3 -3
  360. package/lib/tag-input/tag-render.d.ts +1 -1
  361. package/lib/time-picker/index.d.ts +38 -35
  362. package/lib/time-picker/time-picker.variable.css +3 -0
  363. package/lib/timeline/index.d.ts +80 -44
  364. package/lib/timeline/index.js +56 -67
  365. package/lib/timeline/timeline.d.ts +46 -29
  366. package/lib/timeline/timeline.variable.css +3 -0
  367. package/lib/transfer/const.d.ts +2 -2
  368. package/lib/transfer/index.js +19 -19
  369. package/lib/transfer/transfer.css +9 -9
  370. package/lib/transfer/transfer.less +3 -3
  371. package/lib/transfer/transfer.variable.css +12 -9
  372. package/lib/tree/constant.d.ts +22 -20
  373. package/lib/tree/index.d.ts +64 -20
  374. package/lib/tree/index.js +17595 -72
  375. package/lib/tree/props.d.ts +24 -6
  376. package/lib/tree/tree.css +76 -2
  377. package/lib/tree/tree.d.ts +34 -8
  378. package/lib/tree/tree.less +1 -1
  379. package/lib/tree/tree.variable.css +79 -2
  380. package/lib/tree/use-empty.d.ts +1 -1
  381. package/lib/tree/use-intersection-observer.d.ts +27 -0
  382. package/lib/tree/use-node-action.d.ts +2 -2
  383. package/lib/tree/use-node-attribute.d.ts +9 -0
  384. package/lib/tree/use-search.d.ts +1 -1
  385. package/lib/tree/util.d.ts +1 -1
  386. package/lib/upload/index.d.ts +12 -0
  387. package/lib/upload/index.js +62 -65
  388. package/lib/upload/props.d.ts +4 -1
  389. package/lib/upload/upload-trigger.d.ts +6 -0
  390. package/lib/upload/upload.d.ts +6 -0
  391. package/lib/upload/upload.type.d.ts +7 -7
  392. package/lib/upload/upload.variable.css +3 -0
  393. package/lib/upload/use-file-handler.d.ts +1 -1
  394. package/lib/virtual-render/index.d.ts +36 -9
  395. package/lib/virtual-render/index.js +295 -80
  396. package/lib/virtual-render/props.d.ts +16 -0
  397. package/lib/virtual-render/use-fix-top.d.ts +2 -7
  398. package/lib/virtual-render/use-scrollbar.d.ts +24 -0
  399. package/lib/virtual-render/v-virtual-render.d.ts +2 -1
  400. package/lib/virtual-render/virtual-render.css +76 -2
  401. package/lib/virtual-render/virtual-render.d.ts +16 -3
  402. package/lib/virtual-render/virtual-render.less +3 -3
  403. package/lib/virtual-render/virtual-render.variable.css +79 -2
  404. package/package.json +13 -49
  405. package/lib/rate/star.css +0 -27
  406. package/lib/rate/star.less +0 -34
  407. package/lib/shared/mask.d.ts +0 -11
@@ -480,7 +480,19 @@ function _defineProperty(obj, key, value) {
480
480
  ;// CONCATENATED MODULE: external "vue"
481
481
  var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
482
482
  var external_vue_y = x => () => x
483
- 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
+ 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, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["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, ["withDirectives"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives });
484
+ ;// CONCATENATED MODULE: external "../config-provider"
485
+ var config_provider_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
486
+ var config_provider_y = x => () => x
487
+ 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 });
488
+ ;// CONCATENATED MODULE: external "../directives"
489
+ var directives_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
490
+ var directives_y = x => () => x
491
+ const directives_namespaceObject = directives_x({ ["clickoutside"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_directives_45d4776f__.clickoutside });
492
+ ;// CONCATENATED MODULE: external "../icon"
493
+ var icon_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
494
+ var icon_y = x => () => x
495
+ 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 });
484
496
  ;// CONCATENATED MODULE: ../../node_modules/resize-detector/esm/index.js
485
497
  var raf = null;
486
498
  function requestAnimationFrame (callback) {
@@ -797,18 +809,66 @@ function resetTriggers (elem) {
797
809
 
798
810
 
799
811
 
800
- ;// CONCATENATED MODULE: external "../config-provider"
801
- var config_provider_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
802
- var config_provider_y = x => () => x
803
- 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 });
804
- ;// CONCATENATED MODULE: external "../directives"
805
- var directives_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
806
- var directives_y = x => () => x
807
- const directives_namespaceObject = directives_x({ ["clickoutside"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_directives_45d4776f__.clickoutside });
808
- ;// CONCATENATED MODULE: external "../icon"
809
- var icon_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
810
- var icon_y = x => () => x
811
- 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 });
812
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
813
+ function _arrayWithHoles(arr) {
814
+ if (Array.isArray(arr)) return arr;
815
+ }
816
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
817
+ function _iterableToArrayLimit(r, l) {
818
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
819
+ if (null != t) {
820
+ var e,
821
+ n,
822
+ i,
823
+ u,
824
+ a = [],
825
+ f = !0,
826
+ o = !1;
827
+ try {
828
+ if (i = (t = t.call(r)).next, 0 === l) {
829
+ if (Object(t) !== t) return;
830
+ f = !1;
831
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
832
+ } catch (r) {
833
+ o = !0, n = r;
834
+ } finally {
835
+ try {
836
+ if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
837
+ } finally {
838
+ if (o) throw n;
839
+ }
840
+ }
841
+ return a;
842
+ }
843
+ }
844
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
845
+ function _arrayLikeToArray(arr, len) {
846
+ if (len == null || len > arr.length) len = arr.length;
847
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
848
+ return arr2;
849
+ }
850
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
851
+
852
+ function _unsupportedIterableToArray(o, minLen) {
853
+ if (!o) return;
854
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
855
+ var n = Object.prototype.toString.call(o).slice(8, -1);
856
+ if (n === "Object" && o.constructor) n = o.constructor.name;
857
+ if (n === "Map" || n === "Set") return Array.from(o);
858
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
859
+ }
860
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
861
+ function _nonIterableRest() {
862
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
863
+ }
864
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js
865
+
866
+
867
+
868
+
869
+ function _slicedToArray(arr, i) {
870
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
871
+ }
812
872
  ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
813
873
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
814
874
  try {
@@ -867,6 +927,27 @@ const radio_namespaceObject = radio_x({ ["default"]: () => __WEBPACK_EXTERNAL_MO
867
927
  var radio_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
868
928
  var radio_less_y = x => () => x
869
929
  const radio_less_namespaceObject = radio_less_x({ });
930
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
931
+
932
+ function _arrayWithoutHoles(arr) {
933
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
934
+ }
935
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js
936
+ function _iterableToArray(iter) {
937
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
938
+ }
939
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
940
+ function _nonIterableSpread() {
941
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
942
+ }
943
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
944
+
945
+
946
+
947
+
948
+ function _toConsumableArray(arr) {
949
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
950
+ }
870
951
  ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js
871
952
  function _classCallCheck(instance, Constructor) {
872
953
  if (!(instance instanceof Constructor)) {
@@ -896,6 +977,7 @@ function _createClass(Constructor, protoProps, staticProps) {
896
977
 
897
978
 
898
979
 
980
+
899
981
  /*
900
982
  * Tencent is pleased to support the open source community by making
901
983
  * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
@@ -922,6 +1004,7 @@ function _createClass(Constructor, protoProps, staticProps) {
922
1004
  * IN THE SOFTWARE.
923
1005
  */
924
1006
 
1007
+
925
1008
  /**
926
1009
  * @description: 获取menu list方法
927
1010
  * @param {ISearchItem} item 已选择的key字段 为空则代表当前并未选择key字段
@@ -933,6 +1016,11 @@ var ValueBehavior;
933
1016
  ValueBehavior["ALL"] = "all";
934
1017
  ValueBehavior["NEEDKEY"] = "need-key";
935
1018
  })(ValueBehavior || (ValueBehavior = {}));
1019
+ var DeleteBehavior;
1020
+ (function (DeleteBehavior) {
1021
+ DeleteBehavior["CHAR"] = "delete-char";
1022
+ DeleteBehavior["VALUE"] = "delete-value";
1023
+ })(DeleteBehavior || (DeleteBehavior = {}));
936
1024
  var SEARCH_SLECT_PROVIDER_KEY = Symbol('SEARCH_SLECT_PROVIDER_KEY');
937
1025
  var useSearchSelectProvider = function useSearchSelectProvider(data) {
938
1026
  (0,external_vue_namespaceObject.provide)(SEARCH_SLECT_PROVIDER_KEY, data);
@@ -945,6 +1033,8 @@ var SearchInputMode;
945
1033
  SearchInputMode["DEFAULT"] = "default";
946
1034
  SearchInputMode["EDIT"] = "edit";
947
1035
  })(SearchInputMode || (SearchInputMode = {}));
1036
+ var ValueSplitRegex = /(\||,|、|\/|\r\n|\n)/gm;
1037
+ var ValueSplitTestRegex = /^(\||,|、|\/|\r\n|\n)$/;
948
1038
  var SearchLogical;
949
1039
  (function (SearchLogical) {
950
1040
  SearchLogical["AND"] = "&";
@@ -955,11 +1045,13 @@ var SelectedItem = /*#__PURE__*/function () {
955
1045
  var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
956
1046
  _classCallCheck(this, SelectedItem);
957
1047
  _defineProperty(this, "values", []);
1048
+ _defineProperty(this, "nameRenderkey", (0,shared_namespaceObject.random)(4));
958
1049
  this.searchItem = searchItem;
959
1050
  this.type = type;
960
1051
  this.id = searchItem.id;
961
1052
  this.name = searchItem.name;
962
1053
  this.logical = searchItem.logical || SearchLogical.OR;
1054
+ this.type = type;
963
1055
  }
964
1056
  _createClass(SelectedItem, [{
965
1057
  key: "multiple",
@@ -1016,6 +1108,11 @@ var SelectedItem = /*#__PURE__*/function () {
1016
1108
  get: function get() {
1017
1109
  return !!this.searchItem.showLogicalPanel;
1018
1110
  }
1111
+ }, {
1112
+ key: "isCustomMenu",
1113
+ get: function get() {
1114
+ return this.searchItem.isCustomMenu;
1115
+ }
1019
1116
  }, {
1020
1117
  key: "isSpecialType",
1021
1118
  value: function isSpecialType() {
@@ -1024,6 +1121,7 @@ var SelectedItem = /*#__PURE__*/function () {
1024
1121
  }, {
1025
1122
  key: "addValue",
1026
1123
  value: function addValue(item) {
1124
+ this.nameRenderkey = (0,shared_namespaceObject.random)(4);
1027
1125
  if (this.multiple) {
1028
1126
  var index = this.values.findIndex(function (val) {
1029
1127
  return val.id === item.id;
@@ -1037,6 +1135,69 @@ var SelectedItem = /*#__PURE__*/function () {
1037
1135
  }
1038
1136
  this.values = [item];
1039
1137
  }
1138
+ }, {
1139
+ key: "str2Values",
1140
+ value: function str2Values(str) {
1141
+ var _this = this;
1142
+ var list = str === null || str === void 0 ? void 0 : str.split(this.logical).map(function (v) {
1143
+ return v.trim();
1144
+ }).filter(function (v) {
1145
+ return v;
1146
+ });
1147
+ if (!(list !== null && list !== void 0 && list.length)) return [];
1148
+ var findChildByName = function findChildByName(name) {
1149
+ return _this.children.find(function (item) {
1150
+ return item.name === name;
1151
+ });
1152
+ };
1153
+ if (!this.multiple) {
1154
+ var val = list.join(" ".concat(this.logical, " ")).trim();
1155
+ var item = findChildByName(val);
1156
+ return [{
1157
+ id: item ? item.id : val,
1158
+ name: item ? item.name : val,
1159
+ disabled: !!(item !== null && item !== void 0 && item.disabled)
1160
+ }];
1161
+ }
1162
+ // 对于多选情况,处理整个列表
1163
+ return list.map(function (val) {
1164
+ var existing = _this.values.find(function (item) {
1165
+ return item.name === val;
1166
+ });
1167
+ if (existing) return existing;
1168
+ var item = findChildByName(val);
1169
+ return {
1170
+ id: item ? item.id : val,
1171
+ name: item ? item.name : val,
1172
+ disabled: !!(item !== null && item !== void 0 && item.disabled)
1173
+ };
1174
+ });
1175
+ }
1176
+ }, {
1177
+ key: "addValues",
1178
+ value: function addValues(str) {
1179
+ var mergeValues = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
1180
+ var valuesFromStr = str.split(ValueSplitRegex).filter(function (v) {
1181
+ return v.trim() && !ValueSplitTestRegex.test(v);
1182
+ });
1183
+ var currentValues = mergeValues ? this.values.map(function (item) {
1184
+ return item.name;
1185
+ }) : [];
1186
+ var combinedValues = [].concat(_toConsumableArray(valuesFromStr), _toConsumableArray(currentValues));
1187
+ var logicalString = combinedValues.filter(function (v) {
1188
+ return v.trim();
1189
+ }).join(this.logical);
1190
+ this.values = this.str2Values(logicalString);
1191
+ }
1192
+ }, {
1193
+ key: "getValue",
1194
+ value: function getValue(str) {
1195
+ return this.values.find(function (item) {
1196
+ return item.id === str;
1197
+ }) || this.values.find(function (item) {
1198
+ return item.name === str;
1199
+ });
1200
+ }
1040
1201
  }, {
1041
1202
  key: "toValue",
1042
1203
  value: function toValue() {
@@ -1248,26 +1409,20 @@ var SelectedItem = /*#__PURE__*/function () {
1248
1409
  "class": "menu-content"
1249
1410
  }, [(_this$list = this.list) === null || _this$list === void 0 ? void 0 : _this$list.map(function (item) {
1250
1411
  return (0,external_vue_namespaceObject.createVNode)("li", {
1251
- "class": "menu-item ".concat(item.disabled ? 'is-disabled' : '', " ").concat(_this.hoverId === item.id && !item.disabled ? 'is-hover' : ''),
1252
- "key": item.id,
1253
1412
  "id": item.id,
1413
+ "key": item.id,
1414
+ "class": "menu-item ".concat(item.disabled ? 'is-disabled' : '', " ").concat(_this.hoverId === item.id && !item.disabled ? 'is-hover' : ''),
1254
1415
  "tabindex": "-1",
1255
1416
  "onClick": function onClick() {
1256
1417
  return !item.disabled && _this.handleClick(item);
1257
1418
  }
1258
- }, [_this.$slots["default"] ? _this.$slots["default"]({
1259
- item: item,
1260
- list: _this.list,
1261
- multiple: !!_this.multiple,
1262
- hoverId: _this.hoverId,
1263
- getSearchNode: _this.getSearchNode
1264
- }) : (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [_this.multiple && (0,external_vue_namespaceObject.createVNode)("span", {
1419
+ }, [(0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [_this.multiple && (0,external_vue_namespaceObject.createVNode)("span", {
1265
1420
  "onClick": function onClick(e) {
1266
1421
  return _this.handleSelectedChange(e, item);
1267
1422
  }
1268
1423
  }, [(0,external_vue_namespaceObject.createVNode)(checkbox_namespaceObject["default"], {
1269
- "modelValue": _this.selected.includes(item.id),
1270
- "class": "is-selected"
1424
+ "class": "is-selected",
1425
+ "modelValue": _this.selected.includes(item.id)
1271
1426
  }, null)]), _this.getSearchNode(item)])]);
1272
1427
  })]);
1273
1428
  var getListMenu = function getListMenu() {
@@ -1279,17 +1434,17 @@ var SelectedItem = /*#__PURE__*/function () {
1279
1434
  }, [(0,external_vue_namespaceObject.createVNode)("div", {
1280
1435
  "class": "menu-condition-title"
1281
1436
  }, [_this.t.logical]), (0,external_vue_namespaceObject.createVNode)(radio_namespaceObject["default"], {
1437
+ "label": "|",
1282
1438
  "modelValue": _this.logical,
1283
- "onChange": _this.handleLogicalChange,
1284
- "label": "|"
1439
+ "onChange": _this.handleLogicalChange
1285
1440
  }, {
1286
1441
  "default": function _default() {
1287
1442
  return [_this.t.or, (0,external_vue_namespaceObject.createTextVNode)(" |")];
1288
1443
  }
1289
1444
  }), (0,external_vue_namespaceObject.createVNode)(radio_namespaceObject["default"], {
1445
+ "label": "&",
1290
1446
  "modelValue": _this.logical,
1291
- "onChange": _this.handleLogicalChange,
1292
- "label": "&"
1447
+ "onChange": _this.handleLogicalChange
1293
1448
  }, {
1294
1449
  "default": function _default() {
1295
1450
  return [_this.t.and, (0,external_vue_namespaceObject.createTextVNode)(" &")];
@@ -1315,9 +1470,10 @@ var SelectedItem = /*#__PURE__*/function () {
1315
1470
 
1316
1471
 
1317
1472
 
1473
+
1474
+
1318
1475
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1319
1476
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1320
-
1321
1477
  /*
1322
1478
  * Tencent is pleased to support the open source community by making
1323
1479
  * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
@@ -1380,7 +1536,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1380
1536
  validateValues: Function,
1381
1537
  valueBehavior: String
1382
1538
  },
1383
- emits: ['focus', 'add', 'delete'],
1539
+ emits: ['focus', 'add', 'delete', 'selectKey'],
1540
+ slots: Object,
1384
1541
  setup: function setup(props, _ref) {
1385
1542
  var emit = _ref.emit,
1386
1543
  expose = _ref.expose;
@@ -1403,7 +1560,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1403
1560
  var menuList = (0,external_vue_namespaceObject.ref)([]);
1404
1561
  var _useSearchSelectInjec = useSearchSelectInject(),
1405
1562
  editKey = _useSearchSelectInjec.editKey,
1406
- onValidate = _useSearchSelectInjec.onValidate;
1563
+ onValidate = _useSearchSelectInjec.onValidate,
1564
+ searchData = _useSearchSelectInjec.searchData;
1407
1565
  var valueLoagic = (0,external_vue_namespaceObject.computed)(function () {
1408
1566
  var _usingItem$value;
1409
1567
  return ((_usingItem$value = usingItem.value) === null || _usingItem$value === void 0 ? void 0 : _usingItem$value.logical) || SearchLogical.OR;
@@ -1414,26 +1572,25 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1414
1572
  }
1415
1573
  });
1416
1574
  // effects
1417
- (0,external_vue_namespaceObject.watchEffect)(function () {
1418
- if (!keyword.value) {
1419
- setInputText();
1420
- }
1421
- }, {
1422
- flush: 'pre'
1423
- });
1575
+ // watchEffect(
1576
+ // () => {
1577
+ // if (!keyword.value) {
1578
+ // setInputText();
1579
+ // }
1580
+ // },
1581
+ // { flush: 'pre' },
1582
+ // );
1424
1583
  (0,external_vue_namespaceObject.watch)([menuList, showPopover], function () {
1425
1584
  var _menuList$value;
1426
- if ((_menuList$value = menuList.value) !== null && _menuList$value !== void 0 && _menuList$value.some(function (item) {
1585
+ var shouldBindEvent = showPopover.value && ((_menuList$value = menuList.value) === null || _menuList$value === void 0 ? void 0 : _menuList$value.some(function (item) {
1427
1586
  return !item.disabled;
1428
- }) && showPopover.value) {
1587
+ }));
1588
+ if (shouldBindEvent) {
1429
1589
  if (!isBindEvent) {
1430
- if (props.valueBehavior === ValueBehavior.NEEDKEY) {
1431
- menuHoverId.value = menuList.value.find(function (item) {
1432
- return !item.disabled;
1433
- }).id;
1434
- } else {
1435
- menuHoverId.value = '';
1436
- }
1590
+ var _menuList$value$find;
1591
+ menuHoverId.value = props.valueBehavior === ValueBehavior.NEEDKEY ? ((_menuList$value$find = menuList.value.find(function (item) {
1592
+ return !item.disabled;
1593
+ })) === null || _menuList$value$find === void 0 ? void 0 : _menuList$value$find.id) || '' : '';
1437
1594
  isBindEvent = true;
1438
1595
  document.addEventListener('keydown', handleDocumentKeydown);
1439
1596
  }
@@ -1463,85 +1620,101 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1463
1620
  e.preventDefault();
1464
1621
  (_inputRef$value = inputRef.value) === null || _inputRef$value === void 0 || _inputRef$value.blur();
1465
1622
  var len = menuList.value.length;
1466
- var i = len;
1467
1623
  var index = menuList.value.findIndex(function (set) {
1468
1624
  return set.id === menuHoverId.value;
1469
1625
  });
1470
- while (i >= 0) {
1471
- index = e.code === 'ArrowDown' ? index + 1 : index - 1;
1472
- // eslint-disable-next-line no-nested-ternary
1473
- index = index > len - 1 ? 0 : index < 0 ? len - 1 : index;
1626
+ for (var tries = 0; tries < len; tries++) {
1627
+ index = (index + (e.code === 'ArrowDown' ? 1 : -1) + len) % len;
1474
1628
  var item = menuList.value[index];
1475
1629
  if (item && !item.disabled) {
1476
- i = -1;
1477
1630
  var dom = document.getElementById(item.id);
1478
1631
  dom === null || dom === void 0 || dom.focus();
1479
1632
  menuHoverId.value = item.id;
1480
- return;
1633
+ break;
1481
1634
  }
1482
- i -= 1;
1483
1635
  }
1484
1636
  }
1485
1637
  function documentEnterEvent(e) {
1486
- if (isBindEvent) {
1487
- e.preventDefault();
1488
- var item = menuList.value.find(function (item) {
1489
- return item.id === menuHoverId.value;
1490
- });
1491
- item && handleSelectItem(item);
1492
- }
1638
+ if (!isBindEvent) return;
1639
+ e.preventDefault();
1640
+ var item = menuList.value.find(function (item) {
1641
+ return item.id === menuHoverId.value;
1642
+ });
1643
+ item && handleSelectItem(item);
1493
1644
  }
1494
1645
  function handleClickOutside(e) {
1495
- var _popoverRef$value, _props$clickOutside;
1496
- 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)) {
1497
- var _usingItem$value2, _usingItem$value3;
1498
- 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) {
1499
- keyword.value = '';
1500
- handleKeyEnter();
1501
- return;
1646
+ var _popoverRef$value, _props$clickOutside, _usingItem$value2;
1647
+ 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))) {
1648
+ return;
1649
+ }
1650
+ if ((_usingItem$value2 = usingItem.value) !== null && _usingItem$value2 !== void 0 && _usingItem$value2.isCustomMenu) {
1651
+ if (props.mode === SearchInputMode.EDIT) {
1652
+ handleKeyEnter().then(function (v) {
1653
+ return v && clearInput();
1654
+ });
1655
+ showPopover.value = false;
1502
1656
  }
1503
- showPopover.value = false;
1504
- isFocus.value = false;
1505
- emit('focus', isFocus.value);
1657
+ return;
1506
1658
  }
1659
+ if (props.mode === SearchInputMode.EDIT || usingItem.value) {
1660
+ usingItem.value && handleKeyEnter().then(function (v) {
1661
+ return v && clearInput();
1662
+ });
1663
+ if (!usingItem.value) {
1664
+ emit('focus', false);
1665
+ }
1666
+ return;
1667
+ }
1668
+ isFocus.value = false;
1669
+ showPopover.value = false;
1670
+ emit('focus', isFocus.value);
1507
1671
  }
1508
- function handleInputFocus(e) {
1509
- setInputFocus();
1510
- e && setMenuList();
1511
- }
1512
- function handleInputChange(event) {
1513
- var _usingItem$value5, _usingItem$value8;
1514
- clearInput();
1515
- var text = event.target.innerText;
1516
- if (/(\r|\n)/gm.test(text) || /\s{2}/gm.test(text)) {
1517
- var _usingItem$value4;
1518
- event.preventDefault();
1519
- text = text.replace(/(\r|\n)/gm, " ".concat(valueLoagic.value, " ")).replace(/\s{2}/gm, '');
1520
- inputRef.value.innerText = text;
1521
- setInputFocus();
1522
- keyword.value = text.replace(((_usingItem$value4 = usingItem.value) === null || _usingItem$value4 === void 0 ? void 0 : _usingItem$value4.keyInnerText) || '', '').trim();
1523
- debounceSetMenuList();
1524
- } 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)) {
1525
- var _usingItem$value6, _usingItem$value7, _usingItem$value$valu, _text;
1526
- var outerText = text.replace("\xA0", " ").replace(((_usingItem$value6 = usingItem.value) === null || _usingItem$value6 === void 0 ? void 0 : _usingItem$value6.keyInnerText.replace("\xA0", " ").trim()) || '', '').trim();
1527
- 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());
1528
- if (hasKeyword && outerText && (_usingItem$value$valu = usingItem.value.values) !== null && _usingItem$value$valu !== void 0 && _usingItem$value$valu.length) {
1529
- keyword.value = outerText;
1530
- console.info('outerText', outerText);
1531
- debounceSetMenuList();
1672
+ function handleInputFocus() {
1673
+ showNoSelectValueError.value = false;
1674
+ if (props.mode === SearchInputMode.EDIT && usingItem.value && !isFocus.value) {
1675
+ var nodeList = Array.from(inputRef.value.querySelectorAll("[data-type=\"".concat(usingItem.value.values.length ? 'value' : usingItem.value.type, "\"]")));
1676
+ if (!nodeList.length) return;
1677
+ var range = document.createRange();
1678
+ var selection = window.getSelection();
1679
+ range.selectNodeContents(nodeList.at(-1));
1680
+ selection === null || selection === void 0 || selection.removeAllRanges();
1681
+ selection.addRange(range); // 注意这里会触发focu事件
1682
+ setInputFocus(true, false);
1683
+ return;
1684
+ }
1685
+ setMenuList();
1686
+ setInputFocus(false, !isFocus.value);
1687
+ }
1688
+ function handleInputPaste(event) {
1689
+ event.preventDefault();
1690
+ var formattedText = event.clipboardData.getData('text').trim();
1691
+ if (!usingItem.value) {
1692
+ var formateItem = str2SeletedItem(formattedText);
1693
+ if (formateItem) {
1694
+ usingItem.value = formateItem;
1695
+ setInputFocus(true, true);
1532
1696
  return;
1533
1697
  }
1534
- if (outerText || !((_text = text) !== null && _text !== void 0 && _text.length)) {
1535
- usingItem.value = null;
1536
- }
1537
- keyword.value = outerText ? text : '';
1538
- debounceSetMenuList();
1539
- } else if (!((_usingItem$value8 = usingItem.value) !== null && _usingItem$value8 !== void 0 && (_usingItem$value8 = _usingItem$value8.values) !== null && _usingItem$value8 !== void 0 && _usingItem$value8.length)) {
1540
- var _usingItem$value9;
1541
- keyword.value = text.replace("\xA0", " ").replace(((_usingItem$value9 = usingItem.value) === null || _usingItem$value9 === void 0 ? void 0 : _usingItem$value9.keyInnerText.replace("\xA0", " ")) || '', '').trim();
1698
+ keyword.value = formattedText.split(ValueSplitRegex).filter(function (v) {
1699
+ return v.trim() && !ValueSplitTestRegex.test(v);
1700
+ }).join(" ".concat(valueLoagic.value, " "));
1701
+ inputRef.value.innerText = keyword.value;
1542
1702
  setInputFocus();
1543
1703
  debounceSetMenuList();
1704
+ return;
1705
+ }
1706
+ usingItem.value.addValues(formattedText);
1707
+ debounceSetMenuList();
1708
+ }
1709
+ function handleInputChange(event) {
1710
+ var text = event.target.innerText.trim();
1711
+ if (!usingItem.value) {
1712
+ keyword.value = text;
1713
+ debounceSetMenuList();
1714
+ return;
1544
1715
  }
1716
+ keyword.value = usingItem.value.isSpecialType() ? text : text.replace(usingItem.value.name, '').replace(':', '').trim();
1717
+ debounceSetMenuList();
1545
1718
  }
1546
1719
  function handleInputKeyup(event) {
1547
1720
  switch (event.code) {
@@ -1550,10 +1723,12 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1550
1723
  if (props.valueBehavior === ValueBehavior.NEEDKEY && menuList.value.some(function (item) {
1551
1724
  return item.id === menuHoverId.value;
1552
1725
  })) return;
1553
- handleKeyEnter(event);
1726
+ handleKeyEnter(event).then(function (v) {
1727
+ return v && clearInput();
1728
+ });
1554
1729
  break;
1555
1730
  case 'Backspace':
1556
- handleKeyBackspace();
1731
+ handleKeyBackspace(event);
1557
1732
  default:
1558
1733
  showNoSelectValueError.value = false;
1559
1734
  break;
@@ -1564,19 +1739,20 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1564
1739
  }
1565
1740
  function _handleKeyEnter() {
1566
1741
  _handleKeyEnter = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee(event) {
1567
- var value, _res, values, _keyword$value, valueList, _res2, _value, _res3, _value2, _res4, res;
1742
+ var _usingItem$value6, _usingItem$value7, _usingItem$value8;
1743
+ var isValid;
1568
1744
  return regenerator_default().wrap(function _callee$(_context) {
1569
1745
  while (1) switch (_context.prev = _context.next) {
1570
1746
  case 0:
1571
1747
  event === null || event === void 0 || event.preventDefault();
1572
- // resolve 中文输入时直接按下enter的错误表现
1748
+ // 异步延迟解决确保响应时机问题
1573
1749
  _context.next = 3;
1574
- return new Promise(function (r) {
1575
- return setTimeout(r, 0);
1750
+ return new Promise(function (resolve) {
1751
+ return setTimeout(resolve, 0);
1576
1752
  });
1577
1753
  case 3:
1578
1754
  if (usingItem.value) {
1579
- _context.next = 16;
1755
+ _context.next = 9;
1580
1756
  break;
1581
1757
  }
1582
1758
  if (!(!keyword.value || props.valueBehavior === ValueBehavior.NEEDKEY)) {
@@ -1585,123 +1761,43 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1585
1761
  }
1586
1762
  return _context.abrupt("return");
1587
1763
  case 6:
1588
- value = {
1589
- id: keyword.value,
1590
- name: keyword.value
1591
- };
1592
- _context.next = 9;
1593
- return validateUsingItemValues(value);
1764
+ _context.next = 8;
1765
+ return enterNewItemSelected();
1766
+ case 8:
1767
+ return _context.abrupt("return", _context.sent);
1594
1768
  case 9:
1595
- _res = _context.sent;
1596
- if (_res) {
1597
- _context.next = 12;
1598
- break;
1599
- }
1600
- return _context.abrupt("return");
1601
- case 12:
1602
- emit('add', new SelectedItem(value, 'text'));
1603
- keyword.value = '';
1604
- setMenuList();
1605
- return _context.abrupt("return");
1606
- case 16:
1607
- values = usingItem.value.values;
1608
- if (values !== null && values !== void 0 && values.length) {
1609
- _context.next = 43;
1610
- break;
1611
- }
1612
- if (!((_keyword$value = keyword.value) !== null && _keyword$value !== void 0 && _keyword$value.length)) {
1613
- _context.next = 41;
1614
- break;
1615
- }
1616
- if (!keyword.value.includes(valueLoagic.value)) {
1617
- _context.next = 29;
1618
- break;
1619
- }
1620
- valueList = keyword.value.split(valueLoagic.value);
1621
- _context.next = 23;
1622
- return validateUsingItemValues({
1623
- id: keyword.value,
1624
- name: keyword.value
1625
- });
1626
- case 23:
1627
- _res2 = _context.sent;
1628
- if (_res2) {
1629
- _context.next = 26;
1630
- break;
1631
- }
1632
- return _context.abrupt("return");
1633
- case 26:
1634
- valueList.forEach(function (v) {
1635
- return usingItem.value.addValue({
1636
- id: v,
1637
- name: v
1638
- });
1639
- });
1640
- _context.next = 36;
1641
- break;
1642
- case 29:
1643
- _value = {
1644
- id: keyword.value,
1645
- name: keyword.value
1646
- };
1647
- _context.next = 32;
1648
- return validateUsingItemValues(_value);
1649
- case 32:
1650
- _res3 = _context.sent;
1651
- if (_res3) {
1652
- _context.next = 35;
1653
- break;
1654
- }
1655
- return _context.abrupt("return");
1656
- case 35:
1657
- usingItem.value.addValue(_value);
1658
- case 36:
1659
- emit('add', usingItem.value);
1660
- keyword.value = '';
1661
- usingItem.value = null;
1662
- setInputFocus(true);
1663
- return _context.abrupt("return");
1664
- case 41:
1665
- showNoSelectValueError.value = true;
1666
- return _context.abrupt("return");
1667
- case 43:
1668
1769
  if (!keyword.value) {
1669
- _context.next = 56;
1770
+ _context.next = 13;
1670
1771
  break;
1671
1772
  }
1672
- _value2 = {
1673
- id: keyword.value,
1674
- name: keyword.value
1675
- };
1676
- _context.next = 47;
1677
- return validateUsingItemValues(_value2);
1678
- case 47:
1679
- _res4 = _context.sent;
1680
- if (_res4) {
1681
- _context.next = 50;
1773
+ _context.next = 12;
1774
+ return enterExistingItemSelected();
1775
+ case 12:
1776
+ return _context.abrupt("return", _context.sent);
1777
+ case 13:
1778
+ if (!(!((_usingItem$value6 = usingItem.value) !== null && _usingItem$value6 !== void 0 && _usingItem$value6.isSpecialType()) && ((_usingItem$value7 = usingItem.value) === null || _usingItem$value7 === void 0 ? void 0 : _usingItem$value7.values.length) < 1)) {
1779
+ _context.next = 16;
1682
1780
  break;
1683
1781
  }
1684
- return _context.abrupt("return");
1685
- case 50:
1686
- usingItem.value.addValue(_value2);
1687
- emit('add', usingItem.value);
1688
- keyword.value = '';
1689
- usingItem.value = null;
1690
- setInputFocus(true);
1691
- return _context.abrupt("return");
1692
- case 56:
1693
- _context.next = 58;
1782
+ showNoSelectValueError.value = !showNoSelectValueError.value;
1783
+ return _context.abrupt("return", false);
1784
+ case 16:
1785
+ _context.next = 18;
1694
1786
  return validateUsingItemValues();
1695
- case 58:
1696
- res = _context.sent;
1697
- if (res) {
1698
- _context.next = 61;
1787
+ case 18:
1788
+ isValid = _context.sent;
1789
+ if (isValid) {
1790
+ _context.next = 21;
1699
1791
  break;
1700
1792
  }
1701
- return _context.abrupt("return");
1702
- case 61:
1793
+ return _context.abrupt("return", false);
1794
+ case 21:
1795
+ if ((_usingItem$value8 = usingItem.value) !== null && _usingItem$value8 !== void 0 && _usingItem$value8.isCustomMenu) {
1796
+ showPopover.value = false;
1797
+ }
1703
1798
  setSelectedItem();
1704
- case 62:
1799
+ return _context.abrupt("return", false);
1800
+ case 24:
1705
1801
  case "end":
1706
1802
  return _context.stop();
1707
1803
  }
@@ -1709,22 +1805,31 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1709
1805
  }));
1710
1806
  return _handleKeyEnter.apply(this, arguments);
1711
1807
  }
1712
- function handleKeyBackspace() {
1713
- var _usingItem$value10;
1808
+ function handleKeyBackspace(event) {
1809
+ var _usingItem$value3;
1714
1810
  // 删除已选择项
1715
1811
  if (!usingItem.value && !keyword.value) {
1716
1812
  emit('delete');
1717
- // eslint-disable-next-line @typescript-eslint/no-misused-promises
1718
1813
  setTimeout(setMenuList, 16);
1719
1814
  return;
1720
1815
  }
1721
- if ((_usingItem$value10 = usingItem.value) !== null && _usingItem$value10 !== void 0 && _usingItem$value10.values.length) {
1722
- var _usingItem$value11;
1723
- // 删除选项
1724
- 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) {
1725
- usingItem.value.values.splice(-1, 1);
1816
+ if ((_usingItem$value3 = usingItem.value) !== null && _usingItem$value3 !== void 0 && _usingItem$value3.values.length) {
1817
+ var _usingItem$value$chil;
1818
+ if (usingItem.value.type === 'text' || !((_usingItem$value$chil = usingItem.value.children) !== null && _usingItem$value$chil !== void 0 && _usingItem$value$chil.length)) return;
1819
+ event.preventDefault();
1820
+ var selection = window.getSelection();
1821
+ if ((selection === null || selection === void 0 ? void 0 : selection.rangeCount) > 0) {
1822
+ var _node;
1823
+ var range = selection.getRangeAt(0);
1824
+ var startPos = range.startContainer;
1825
+ var node = startPos;
1826
+ while (node && node.parentNode !== inputRef.value) {
1827
+ node = node.parentNode;
1828
+ }
1829
+ var editIndex = ((_node = node) === null || _node === void 0 || (_node = _node.dataset) === null || _node === void 0 ? void 0 : _node.index) || -1;
1830
+ usingItem.value.values.splice(+editIndex, 1);
1726
1831
  keyword.value = '';
1727
- setInputFocus();
1832
+ setInputFocus(false, false);
1728
1833
  return;
1729
1834
  }
1730
1835
  } else if (!keyword.value) {
@@ -1739,86 +1844,85 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1739
1844
  }
1740
1845
  function _handleSelectItem() {
1741
1846
  _handleSelectItem = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee2(item, type) {
1742
- var _item$value, _inputRef$value2, _usingItem$value14, _usingItem$value15;
1743
- var _item$realId2, _item$realId, seleted, _res5, isCondition, res;
1847
+ var _item$value, _usingItem$value9, _usingItem$value12;
1848
+ var _item$realId, selectedItem, _usingItem$value10, _usingItem$value11, isCondition;
1744
1849
  return regenerator_default().wrap(function _callee2$(_context2) {
1745
1850
  while (1) switch (_context2.prev = _context2.next) {
1746
1851
  case 0:
1747
1852
  if (!((_item$value = item.value) !== null && _item$value !== void 0 && _item$value.id)) {
1748
- _context2.next = 20;
1853
+ _context2.next = 18;
1749
1854
  break;
1750
1855
  }
1751
- if (!(props.valueBehavior === ValueBehavior.NEEDKEY && item.value || !props.validateValues)) {
1752
- _context2.next = 8;
1753
- break;
1754
- }
1755
- seleted = new SelectedItem(_objectSpread(_objectSpread({}, item), {}, {
1856
+ selectedItem = new SelectedItem(_objectSpread(_objectSpread({}, item), {}, {
1756
1857
  id: (_item$realId = item.realId) !== null && _item$realId !== void 0 ? _item$realId : item.id
1757
1858
  }), type);
1758
- seleted.addValue(item.value);
1759
- setSelectedItem(seleted);
1760
- if (props.valueBehavior === ValueBehavior.NEEDKEY && menuHoverId.value) {
1761
- setInputFocus(true);
1859
+ selectedItem.addValues(item.value.name, false);
1860
+ if (!(props.valueBehavior === ValueBehavior.NEEDKEY && menuHoverId.value)) {
1861
+ _context2.next = 8;
1862
+ break;
1762
1863
  }
1864
+ setSelectedItem(selectedItem);
1865
+ setInputFocus(true);
1763
1866
  menuHoverId.value = '';
1764
1867
  return _context2.abrupt("return");
1765
1868
  case 8:
1766
- usingItem.value = new SelectedItem(_objectSpread(_objectSpread({}, item), {}, {
1767
- id: (_item$realId2 = item.realId) !== null && _item$realId2 !== void 0 ? _item$realId2 : item.id
1768
- }), type);
1769
- usingItem.value.addValue(item.value);
1770
- _context2.next = 12;
1771
- return validateUsingItemValues(item.value);
1772
- case 12:
1773
- _res5 = _context2.sent;
1774
- if (_res5) {
1775
- _context2.next = 16;
1869
+ usingItem.value = selectedItem;
1870
+ _context2.next = 11;
1871
+ return validateUsingItemValues(usingItem.value.values);
1872
+ case 11:
1873
+ if (_context2.sent) {
1874
+ _context2.next = 14;
1776
1875
  break;
1777
1876
  }
1778
1877
  usingItem.value = null;
1779
1878
  return _context2.abrupt("return");
1780
- case 16:
1879
+ case 14:
1781
1880
  setSelectedItem(usingItem.value);
1782
- menuHoverId.value = '';
1783
1881
  setInputFocus(true);
1882
+ menuHoverId.value = '';
1784
1883
  return _context2.abrupt("return");
1785
- case 20:
1786
- if (!(!usingItem.value || !(inputRef !== null && inputRef !== void 0 && (_inputRef$value2 = inputRef.value) !== null && _inputRef$value2 !== void 0 && _inputRef$value2.innerText))) {
1787
- _context2.next = 28;
1884
+ case 18:
1885
+ if (!(!usingItem.value || ((_usingItem$value9 = usingItem.value) === null || _usingItem$value9 === void 0 ? void 0 : _usingItem$value9.type) === 'condition')) {
1886
+ _context2.next = 27;
1788
1887
  break;
1789
1888
  }
1790
- usingItem.value = new SelectedItem(item, type);
1889
+ usingItem.value = new SelectedItem(item, type !== null && type !== void 0 ? type : (_usingItem$value10 = usingItem.value) === null || _usingItem$value10 === void 0 ? void 0 : _usingItem$value10.type);
1791
1890
  keyword.value = '';
1792
- isCondition = type === 'condition';
1793
- isCondition && setSelectedItem();
1891
+ isCondition = ((_usingItem$value11 = usingItem.value) === null || _usingItem$value11 === void 0 ? void 0 : _usingItem$value11.type) === 'condition';
1892
+ if (!isCondition) {
1893
+ emit('selectKey', {
1894
+ id: item.id,
1895
+ name: item.name,
1896
+ values: []
1897
+ });
1898
+ }
1899
+ if (isCondition) {
1900
+ setSelectedItem();
1901
+ }
1794
1902
  showPopover.value = isCondition || !!usingItem.value.children.length;
1795
1903
  setInputFocus(props.valueBehavior === ValueBehavior.NEEDKEY && !!menuHoverId.value);
1796
1904
  return _context2.abrupt("return");
1797
- case 28:
1798
- if (!(((_usingItem$value14 = usingItem.value) === null || _usingItem$value14 === void 0 ? void 0 : _usingItem$value14.type) === 'condition')) {
1905
+ case 27:
1906
+ if (usingItem.value) {
1907
+ usingItem.value.addValue(item);
1908
+ (0,external_vue_namespaceObject.nextTick)(deleteInputTextNode);
1909
+ }
1910
+ _context2.next = 30;
1911
+ return validateUsingItemValues(usingItem.value.values);
1912
+ case 30:
1913
+ if (_context2.sent) {
1799
1914
  _context2.next = 32;
1800
1915
  break;
1801
1916
  }
1802
- usingItem.value = new SelectedItem(item, type);
1803
- setSelectedItem();
1804
1917
  return _context2.abrupt("return");
1805
1918
  case 32:
1806
- usingItem.value.addValue(item);
1807
- _context2.next = 35;
1808
- return validateUsingItemValues(item);
1809
- case 35:
1810
- res = _context2.sent;
1811
- if (res) {
1812
- _context2.next = 38;
1813
- break;
1919
+ if (!usingItem.value.multiple) {
1920
+ setSelectedItem();
1814
1921
  }
1815
- return _context2.abrupt("return");
1816
- case 38:
1817
- if (!usingItem.value.multiple) setSelectedItem();
1818
- if (props.valueBehavior === ValueBehavior.NEEDKEY && (_usingItem$value15 = usingItem.value) !== null && _usingItem$value15 !== void 0 && _usingItem$value15.multiple) {
1922
+ if (props.valueBehavior === ValueBehavior.NEEDKEY && (_usingItem$value12 = usingItem.value) !== null && _usingItem$value12 !== void 0 && _usingItem$value12.multiple) {
1819
1923
  setInputFocus();
1820
1924
  }
1821
- case 40:
1925
+ case 34:
1822
1926
  case "end":
1823
1927
  return _context2.stop();
1824
1928
  }
@@ -1830,10 +1934,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1830
1934
  handleSelectItem(item, 'condition');
1831
1935
  }
1832
1936
  function handleMenuFooterClick(item) {
1833
- var _usingItem$value12;
1937
+ var _usingItem$value4;
1834
1938
  switch (item.id) {
1835
1939
  case 'confirm':
1836
- if (!((_usingItem$value12 = usingItem.value) !== null && _usingItem$value12 !== void 0 && _usingItem$value12.values.length)) return;
1940
+ if (!((_usingItem$value4 = usingItem.value) !== null && _usingItem$value4 !== void 0 && _usingItem$value4.values.length)) return;
1837
1941
  keyword.value = '';
1838
1942
  handleKeyEnter();
1839
1943
  break;
@@ -1843,119 +1947,110 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1843
1947
  break;
1844
1948
  }
1845
1949
  }
1950
+ function handleLogicalChange(logical) {
1951
+ if (!usingItem.value) return;
1952
+ usingItem.value.logical = logical;
1953
+ }
1846
1954
  // functions
1847
- function validateUsingItemValues(_x4) {
1848
- return _validateUsingItemValues.apply(this, arguments);
1955
+ function validateValues(_x4, _x5) {
1956
+ return _validateValues.apply(this, arguments);
1849
1957
  }
1850
- function _validateUsingItemValues() {
1851
- _validateUsingItemValues = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee3(value) {
1852
- var _usingItem$value16, searchItem, validate, values;
1958
+ function _validateValues() {
1959
+ _validateValues = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee3(searchItem, value) {
1960
+ var validateStr;
1853
1961
  return regenerator_default().wrap(function _callee3$(_context3) {
1854
1962
  while (1) switch (_context3.prev = _context3.next) {
1855
1963
  case 0:
1856
- if (usingItem.value) {
1857
- _context3.next = 4;
1964
+ if (!(typeof props.validateValues === 'function')) {
1965
+ _context3.next = 14;
1858
1966
  break;
1859
1967
  }
1860
- _context3.next = 3;
1861
- return validateValues(null, [value]);
1862
- case 3:
1863
- return _context3.abrupt("return", _context3.sent);
1864
- case 4:
1865
- _usingItem$value16 = usingItem.value, searchItem = _usingItem$value16.searchItem, validate = _usingItem$value16.validate, values = _usingItem$value16.values;
1866
- if (!(validate && typeof props.validateValues === 'function')) {
1867
- _context3.next = 9;
1968
+ validateStr = '';
1969
+ _context3.prev = 2;
1970
+ _context3.next = 5;
1971
+ return props.validateValues(searchItem !== null && searchItem !== void 0 ? searchItem : null, value);
1972
+ case 5:
1973
+ validateStr = _context3.sent;
1974
+ _context3.next = 11;
1975
+ break;
1976
+ case 8:
1977
+ _context3.prev = 8;
1978
+ _context3.t0 = _context3["catch"](2);
1979
+ validateStr = false;
1980
+ case 11:
1981
+ if (!(typeof validateStr === 'string' || validateStr === false)) {
1982
+ _context3.next = 14;
1868
1983
  break;
1869
1984
  }
1870
- _context3.next = 8;
1871
- return validateValues(searchItem, value ? [value] : values);
1872
- case 8:
1873
- return _context3.abrupt("return", _context3.sent);
1874
- case 9:
1985
+ onValidate(validateStr || '校验错误');
1986
+ return _context3.abrupt("return", false);
1987
+ case 14:
1875
1988
  onValidate('');
1876
1989
  return _context3.abrupt("return", true);
1877
- case 11:
1990
+ case 16:
1878
1991
  case "end":
1879
1992
  return _context3.stop();
1880
1993
  }
1881
- }, _callee3);
1994
+ }, _callee3, null, [[2, 8]]);
1882
1995
  }));
1883
- return _validateUsingItemValues.apply(this, arguments);
1884
- }
1885
- function validateValues(_x5, _x6) {
1886
1996
  return _validateValues.apply(this, arguments);
1887
1997
  }
1888
- function _validateValues() {
1889
- _validateValues = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee4(searchItem, value) {
1890
- var _props$validateValues;
1891
- var validateStr;
1998
+ function validateUsingItemValues(_x6) {
1999
+ return _validateUsingItemValues.apply(this, arguments);
2000
+ }
2001
+ function _validateUsingItemValues() {
2002
+ _validateUsingItemValues = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee4(preValues) {
2003
+ var _usingItem$value13, searchItem, validate, values;
1892
2004
  return regenerator_default().wrap(function _callee4$(_context4) {
1893
2005
  while (1) switch (_context4.prev = _context4.next) {
1894
2006
  case 0:
1895
- _context4.next = 2;
1896
- 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 () {
1897
- return false;
1898
- });
1899
- case 2:
1900
- validateStr = _context4.sent;
1901
- if (!(typeof validateStr === 'string' || validateStr === false)) {
1902
- _context4.next = 6;
2007
+ if (usingItem.value) {
2008
+ _context4.next = 4;
1903
2009
  break;
1904
2010
  }
1905
- onValidate(validateStr || '校验错误');
1906
- return _context4.abrupt("return", false);
1907
- case 6:
2011
+ _context4.next = 3;
2012
+ return validateValues(null, preValues);
2013
+ case 3:
2014
+ return _context4.abrupt("return", _context4.sent);
2015
+ case 4:
2016
+ _usingItem$value13 = usingItem.value, searchItem = _usingItem$value13.searchItem, validate = _usingItem$value13.validate, values = _usingItem$value13.values;
2017
+ if (!(validate && typeof props.validateValues === 'function')) {
2018
+ _context4.next = 9;
2019
+ break;
2020
+ }
2021
+ _context4.next = 8;
2022
+ return validateValues(searchItem, preValues !== null && preValues !== void 0 ? preValues : values);
2023
+ case 8:
2024
+ return _context4.abrupt("return", _context4.sent);
2025
+ case 9:
1908
2026
  onValidate('');
1909
2027
  return _context4.abrupt("return", true);
1910
- case 8:
2028
+ case 11:
1911
2029
  case "end":
1912
2030
  return _context4.stop();
1913
2031
  }
1914
2032
  }, _callee4);
1915
2033
  }));
1916
- return _validateValues.apply(this, arguments);
1917
- }
1918
- function setInputFocus() {
1919
- var refleshMenuList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
1920
- if (refleshMenuList) {
1921
- setTimeout(function () {
1922
- setMenuList();
1923
- }, 16);
1924
- }
1925
- isFocus.value = true;
1926
- showPopover.value = true;
1927
- showNoSelectValueError.value = false;
1928
- var timer = setTimeout(function () {
1929
- if (inputRef.value) {
1930
- inputRef.value.focus(); // 光标移至最后
1931
- var selection = window.getSelection();
1932
- if (selection.focusOffset === 0) {
1933
- selection.selectAllChildren(inputRef.value);
1934
- selection.collapseToEnd();
1935
- }
1936
- }
1937
- window.clearTimeout(timer);
1938
- }, 0);
1939
- emit('focus', isFocus.value);
2034
+ return _validateUsingItemValues.apply(this, arguments);
1940
2035
  }
1941
2036
  function setMenuList() {
1942
2037
  return _setMenuList.apply(this, arguments);
1943
2038
  }
1944
2039
  function _setMenuList() {
1945
2040
  _setMenuList = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee5() {
1946
- var _usingItem$value17, _usingItem$value$valu2;
1947
- var list, _usingItem$value18, _keyword$value2, hoverItem;
2041
+ var _props$data, _usingItem$value$sear, _usingItem$value$valu;
2042
+ var list, _usingItem$value14, _keyword$value2, hoverItem;
1948
2043
  return regenerator_default().wrap(function _callee5$(_context5) {
1949
2044
  while (1) switch (_context5.prev = _context5.next) {
1950
2045
  case 0:
1951
2046
  list = [];
1952
- 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))) {
2047
+ if (!(typeof props.getMenuList === 'function' && (!((_props$data = props.data) !== null && _props$data !== void 0 && _props$data.length) && !usingItem.value || usingItem.value && usingItem.value.type !== 'condition' && (((_usingItem$value$sear = usingItem.value.searchItem) === null || _usingItem$value$sear === void 0 ? void 0 : _usingItem$value$sear.async) === undefined || usingItem.value.searchItem.async === true)))) {
1953
2048
  _context5.next = 9;
1954
2049
  break;
1955
2050
  }
1956
2051
  loading.value = true;
1957
2052
  _context5.next = 5;
1958
- return props.getMenuList((_usingItem$value18 = usingItem.value) === null || _usingItem$value18 === void 0 ? void 0 : _usingItem$value18.searchItem, keyword.value)["catch"](function () {
2053
+ return props.getMenuList((_usingItem$value14 = usingItem.value) === null || _usingItem$value14 === void 0 ? void 0 : _usingItem$value14.searchItem, keyword.value)["catch"](function () {
1959
2054
  return [];
1960
2055
  });
1961
2056
  case 5:
@@ -2016,7 +2111,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2016
2111
  });
2017
2112
  } else if (usingItem.value.type === 'condition') {
2018
2113
  list = props.conditions;
2019
- } 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) {
2114
+ } else if (!((_usingItem$value$valu = usingItem.value.values) !== null && _usingItem$value$valu !== void 0 && _usingItem$value$valu.length) || usingItem.value.multiple || props.mode === SearchInputMode.EDIT) {
2020
2115
  list = usingItem.value.children.filter(function (item) {
2021
2116
  return item.name.toLocaleLowerCase().includes(keyword.value.toLocaleLowerCase());
2022
2117
  });
@@ -2041,35 +2136,206 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2041
2136
  }));
2042
2137
  return _setMenuList.apply(this, arguments);
2043
2138
  }
2139
+ function enterNewItemSelected() {
2140
+ return _enterNewItemSelected.apply(this, arguments);
2141
+ }
2142
+ function _enterNewItemSelected() {
2143
+ _enterNewItemSelected = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee6() {
2144
+ var formatItem, valueList, res;
2145
+ return regenerator_default().wrap(function _callee6$(_context6) {
2146
+ while (1) switch (_context6.prev = _context6.next) {
2147
+ case 0:
2148
+ formatItem = str2SeletedItem(keyword.value);
2149
+ valueList = (formatItem === null || formatItem === void 0 ? void 0 : formatItem.values) || [{
2150
+ id: keyword.value,
2151
+ name: keyword.value
2152
+ }];
2153
+ _context6.next = 4;
2154
+ return validateUsingItemValues(valueList);
2155
+ case 4:
2156
+ res = _context6.sent;
2157
+ if (res) {
2158
+ _context6.next = 7;
2159
+ break;
2160
+ }
2161
+ return _context6.abrupt("return");
2162
+ case 7:
2163
+ emit('add', formatItem || new SelectedItem(_objectSpread({}, valueList[0]), 'text'));
2164
+ keyword.value = '';
2165
+ setMenuList();
2166
+ return _context6.abrupt("return", true);
2167
+ case 11:
2168
+ case "end":
2169
+ return _context6.stop();
2170
+ }
2171
+ }, _callee6);
2172
+ }));
2173
+ return _enterNewItemSelected.apply(this, arguments);
2174
+ }
2175
+ function enterExistingItemSelected() {
2176
+ return _enterExistingItemSelected.apply(this, arguments);
2177
+ }
2178
+ function _enterExistingItemSelected() {
2179
+ _enterExistingItemSelected = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee7() {
2180
+ var valueList, formatItem, isValid;
2181
+ return regenerator_default().wrap(function _callee7$(_context7) {
2182
+ while (1) switch (_context7.prev = _context7.next) {
2183
+ case 0:
2184
+ valueList = [];
2185
+ if (usingItem.value.isSpecialType()) {
2186
+ formatItem = str2SeletedItem(keyword.value);
2187
+ if (formatItem) {
2188
+ usingItem.value = formatItem;
2189
+ valueList = formatItem.values;
2190
+ }
2191
+ }
2192
+ valueList = valueList.length ? valueList : usingItem.value.str2Values(keyword.value);
2193
+ _context7.next = 5;
2194
+ return validateUsingItemValues(valueList);
2195
+ case 5:
2196
+ isValid = _context7.sent;
2197
+ if (isValid) {
2198
+ _context7.next = 8;
2199
+ break;
2200
+ }
2201
+ return _context7.abrupt("return");
2202
+ case 8:
2203
+ if (usingItem.value.type === 'text') {
2204
+ usingItem.value.name = keyword.value;
2205
+ usingItem.value.id = keyword.value;
2206
+ } else {
2207
+ usingItem.value.values = valueList;
2208
+ }
2209
+ emit('add', usingItem.value);
2210
+ keyword.value = '';
2211
+ usingItem.value = null;
2212
+ setInputFocus(true);
2213
+ return _context7.abrupt("return", true);
2214
+ case 14:
2215
+ case "end":
2216
+ return _context7.stop();
2217
+ }
2218
+ }, _callee7);
2219
+ }));
2220
+ return _enterExistingItemSelected.apply(this, arguments);
2221
+ }
2222
+ function setCursorToEnd() {
2223
+ if (!inputRef.value) return;
2224
+ var range = document.createRange();
2225
+ var selection = window.getSelection();
2226
+ range.selectNodeContents(inputRef.value);
2227
+ range.collapse(false);
2228
+ selection.removeAllRanges();
2229
+ selection.addRange(range);
2230
+ }
2231
+ function setInputFocus() {
2232
+ var refleshMenuList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
2233
+ var needCursorToEnd = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
2234
+ if (refleshMenuList) {
2235
+ setTimeout(setMenuList, 16);
2236
+ }
2237
+ isFocus.value = true;
2238
+ showPopover.value = true;
2239
+ showNoSelectValueError.value = false;
2240
+ needCursorToEnd && (0,external_vue_namespaceObject.nextTick)(setCursorToEnd);
2241
+ emit('focus', isFocus.value);
2242
+ }
2044
2243
  function setSelectedItem(item) {
2244
+ var _usingItem$value5;
2045
2245
  emit('add', item !== null && item !== void 0 ? item : usingItem.value);
2246
+ var needCursorToEnd = !((_usingItem$value5 = usingItem.value) !== null && _usingItem$value5 !== void 0 && _usingItem$value5.isCustomMenu);
2046
2247
  usingItem.value = null;
2047
2248
  keyword.value = '';
2048
- setInputFocus(props.valueBehavior === ValueBehavior.NEEDKEY);
2249
+ if (needCursorToEnd) {
2250
+ setInputFocus(true, needCursorToEnd);
2251
+ (0,external_vue_namespaceObject.nextTick)(clearInput);
2252
+ }
2049
2253
  }
2050
2254
  function clearInput() {
2051
- var text = inputRef.value.innerText;
2052
- if (text[text.length - 1] === '\n' || text[0] === '\r') {
2053
- setInputText(text.slice(0, -1));
2054
- clearInput();
2055
- } else if (text[0] === '\n' || text[0] === '\r') {
2056
- setInputText(text.slice(1));
2057
- clearInput();
2255
+ if (!inputRef.value) return;
2256
+ keyword.value = '';
2257
+ (0,external_vue_namespaceObject.nextTick)(function () {
2258
+ return inputRef.value.innerText = '';
2259
+ });
2260
+ }
2261
+ function str2SeletedItem(str) {
2262
+ var _str$split = str.split(':'),
2263
+ _str$split2 = _slicedToArray(_str$split, 2),
2264
+ key = _str$split2[0],
2265
+ value = _str$split2[1];
2266
+ if (key !== null && key !== void 0 && key.trim()) {
2267
+ var selectedItem = searchData.value.find(function (item) {
2268
+ return item.name === key.trim();
2269
+ });
2270
+ if (selectedItem) {
2271
+ var item = new SelectedItem(_objectSpread({}, selectedItem), 'default');
2272
+ item.addValues(value);
2273
+ return item;
2274
+ }
2058
2275
  }
2276
+ return undefined;
2059
2277
  }
2060
- function setInputText() {
2061
- var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
2062
- if (inputRef.value) {
2063
- var _usingItem$value13;
2064
- inputRef.value.innerHTML = text || ((_usingItem$value13 = usingItem.value) === null || _usingItem$value13 === void 0 ? void 0 : _usingItem$value13.inputInnerHtml) || '';
2278
+ function deleteInputTextNode() {
2279
+ var _keyword$value;
2280
+ if ((_keyword$value = keyword.value) !== null && _keyword$value !== void 0 && _keyword$value.length) {
2281
+ keyword.value = '';
2282
+ var nodes = Array.from(inputRef.value.childNodes);
2283
+ nodes.forEach(function (node) {
2284
+ var _node$textContent;
2285
+ if (node.nodeType === Node.TEXT_NODE && (_node$textContent = node.textContent) !== null && _node$textContent !== void 0 && _node$textContent.trim()) {
2286
+ inputRef.value.removeChild(node);
2287
+ }
2288
+ });
2065
2289
  }
2066
2290
  }
2067
- function handleLogicalChange(logical) {
2068
- if (!usingItem.value) return;
2069
- usingItem.value.logical = logical;
2291
+ function inputFocusForWrapper() {
2292
+ var _inputRef$value2;
2293
+ (_inputRef$value2 = inputRef.value) === null || _inputRef$value2 === void 0 || _inputRef$value2.focus();
2294
+ }
2295
+ function inputEnterForWrapper() {
2296
+ return _inputEnterForWrapper.apply(this, arguments);
2297
+ }
2298
+ function _inputEnterForWrapper() {
2299
+ _inputEnterForWrapper = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee8() {
2300
+ return regenerator_default().wrap(function _callee8$(_context8) {
2301
+ while (1) switch (_context8.prev = _context8.next) {
2302
+ case 0:
2303
+ _context8.next = 2;
2304
+ return handleKeyEnter().then(function (v) {
2305
+ return v && clearInput();
2306
+ });
2307
+ case 2:
2308
+ showPopover.value = false;
2309
+ inputRef.value.blur();
2310
+ case 4:
2311
+ case "end":
2312
+ return _context8.stop();
2313
+ }
2314
+ }, _callee8);
2315
+ }));
2316
+ return _inputEnterForWrapper.apply(this, arguments);
2317
+ }
2318
+ function inputClearForWrapper() {
2319
+ keyword.value = '';
2320
+ showNoSelectValueError.value = false;
2321
+ showPopover.value = false;
2322
+ usingItem.value = null;
2323
+ (0,external_vue_namespaceObject.nextTick)(clearInput);
2324
+ }
2325
+ function customPanelSubmit(value) {
2326
+ usingItem.value.values = [{
2327
+ id: value,
2328
+ name: value
2329
+ }];
2330
+ handleKeyEnter().then(function (v) {
2331
+ return v && clearInput();
2332
+ });
2070
2333
  }
2071
2334
  // expose
2072
2335
  expose({
2336
+ inputFocusForWrapper: inputFocusForWrapper,
2337
+ inputEnterForWrapper: inputEnterForWrapper,
2338
+ inputClearForWrapper: inputClearForWrapper,
2073
2339
  handleInputFocus: handleInputFocus,
2074
2340
  isFocus: isFocus
2075
2341
  });
@@ -2090,12 +2356,18 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2090
2356
  handleClickOutside: handleClickOutside,
2091
2357
  handleInputFocus: handleInputFocus,
2092
2358
  handleInputChange: handleInputChange,
2359
+ handleInputPaste: handleInputPaste,
2093
2360
  handleLogicalChange: handleLogicalChange,
2094
2361
  handleInputKeyup: handleInputKeyup,
2095
2362
  handleSelectItem: handleSelectItem,
2096
2363
  handleSelectCondtionItem: handleSelectCondtionItem,
2097
2364
  handleMenuFooterClick: handleMenuFooterClick,
2098
2365
  resolveClassName: resolveClassName,
2366
+ inputFocusForWrapper: inputFocusForWrapper,
2367
+ inputEnterForWrapper: inputEnterForWrapper,
2368
+ inputClearForWrapper: inputClearForWrapper,
2369
+ deleteInputTextNode: deleteInputTextNode,
2370
+ customPanelSubmit: customPanelSubmit,
2099
2371
  t: t
2100
2372
  };
2101
2373
  },
@@ -2107,18 +2379,13 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2107
2379
  multiple = _ref2.multiple,
2108
2380
  values = _ref2.values,
2109
2381
  placeholder = _ref2.placeholder,
2110
- inputInnerHtml = _ref2.inputInnerHtml;
2382
+ inputInnerHtml = _ref2.inputInnerHtml,
2383
+ isCustomMenu = _ref2.isCustomMenu;
2111
2384
  var showInputAfter = !((_this$keyword = this.keyword) !== null && _this$keyword !== void 0 && _this$keyword.length) && !(values !== null && values !== void 0 && values.length) && placeholder;
2112
- var showPopover = this.loading || this.showNoSelectValueError || this.showPopover && !!((_this$menuList = this.menuList) !== null && _this$menuList !== void 0 && _this$menuList.length);
2385
+ var showPopover = this.loading || this.showNoSelectValueError || this.showPopover && (!!isCustomMenu || !!((_this$menuList = this.menuList) !== null && _this$menuList !== void 0 && _this$menuList.length));
2113
2386
  var showCondition = !this.usingItem && this.showCondition;
2114
- var menuSlots = Object.assign({}, this.$slots.menu ? {
2115
- "default": function _default(data) {
2116
- var _this$$slots$menu, _this$$slots;
2117
- return (_this$$slots$menu = (_this$$slots = _this.$slots).menu) === null || _this$$slots$menu === void 0 ? void 0 : _this$$slots$menu.call(_this$$slots, data);
2118
- }
2119
- } : {});
2120
2387
  var inputContent = function inputContent() {
2121
- var _this$keyword2;
2388
+ var _this$keyword2, _this$usingItem, _this$usingItem2;
2122
2389
  return (0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("div", {
2123
2390
  "ref": "inputRef",
2124
2391
  "class": {
@@ -2132,44 +2399,80 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2132
2399
  "spellcheck": "false",
2133
2400
  "onFocus": _this.handleInputFocus,
2134
2401
  "onInput": _this.handleInputChange,
2135
- "onKeydown": _this.handleInputKeyup
2136
- }, null), [[(0,external_vue_namespaceObject.resolveDirective)("clickoutside"), _this.handleClickOutside]]);
2402
+ "onKeydown": _this.handleInputKeyup,
2403
+ "onPaste": _this.handleInputPaste
2404
+ }, [((_this$usingItem = _this.usingItem) === null || _this$usingItem === void 0 ? void 0 : _this$usingItem.name) && (!_this.usingItem.isSpecialType() ? (0,external_vue_namespaceObject.createVNode)("span", {
2405
+ "key": _this.usingItem.nameRenderkey,
2406
+ "style": {
2407
+ color: '#979BA5'
2408
+ },
2409
+ "contenteditable": false,
2410
+ "data-key": _this.usingItem.name,
2411
+ "data-type": _this.usingItem.type,
2412
+ "onMousedown": function onMousedown(e) {
2413
+ return e.preventDefault();
2414
+ }
2415
+ }, [_this.usingItem.name, (0,external_vue_namespaceObject.createTextVNode)(":\xA0")]) : (0,external_vue_namespaceObject.createVNode)("span", {
2416
+ "key": _this.usingItem.nameRenderkey,
2417
+ "data-key": _this.usingItem.name,
2418
+ "data-type": _this.usingItem.type
2419
+ }, [_this.usingItem.name])), (_this$usingItem2 = _this.usingItem) === null || _this$usingItem2 === void 0 || (_this$usingItem2 = _this$usingItem2.values) === null || _this$usingItem2 === void 0 ? void 0 : _this$usingItem2.map(function (item, index) {
2420
+ return (0,external_vue_namespaceObject.createVNode)("span", {
2421
+ "key": index,
2422
+ "data-id": item.id,
2423
+ "data-index": index,
2424
+ "data-key": item.name,
2425
+ "data-type": "value"
2426
+ }, [item.name, index < _this.usingItem.values.length - 1 ? " ".concat(_this.usingItem.logical, " ") : '']);
2427
+ })]), [[(0,external_vue_namespaceObject.resolveDirective)("clickoutside"), _this.handleClickOutside]]);
2137
2428
  };
2138
2429
  var popoverContent = function popoverContent() {
2139
- var _this$menuList2, _this$usingItem, _this$usingItem2;
2430
+ var _this$usingItem3, _this$menuList2, _this$usingItem4, _this$usingItem5;
2140
2431
  if (_this.loading) {
2141
2432
  return (0,external_vue_namespaceObject.createVNode)("div", null, [_this.t.loading]);
2142
2433
  }
2143
2434
  if (_this.showNoSelectValueError) {
2144
2435
  return (0,external_vue_namespaceObject.createVNode)("div", null, [_this.t.filterQueryMustHasValue]);
2145
2436
  }
2437
+ if ((_this$usingItem3 = _this.usingItem) !== null && _this$usingItem3 !== void 0 && _this$usingItem3.isCustomMenu && _this.$slots.menu) {
2438
+ var _this$usingItem$value;
2439
+ return (0,external_vue_namespaceObject.createVNode)("div", {
2440
+ "ref": "popoverRef",
2441
+ "class": _this.resolveClassName('search-select-popover')
2442
+ }, [_this.$slots.menu({
2443
+ value: (_this$usingItem$value = _this.usingItem.values) === null || _this$usingItem$value === void 0 ? void 0 : _this$usingItem$value[0],
2444
+ id: _this.usingItem.id,
2445
+ name: _this.usingItem.name,
2446
+ onSubmit: _this.customPanelSubmit
2447
+ })]);
2448
+ }
2146
2449
  return (_this$menuList2 = _this.menuList) !== null && _this$menuList2 !== void 0 && _this$menuList2.length ? (0,external_vue_namespaceObject.createVNode)("div", {
2147
2450
  "ref": "popoverRef",
2148
2451
  "class": _this.resolveClassName('search-select-popover')
2149
2452
  }, [(0,external_vue_namespaceObject.createVNode)(menu, {
2150
- "list": _this.menuList,
2453
+ "conditions": showCondition ? _this.conditions : [],
2454
+ "hoverId": _this.menuHoverId,
2151
2455
  "keyword": _this.keyword,
2456
+ "list": _this.menuList,
2457
+ "logical": (_this$usingItem4 = _this.usingItem) === null || _this$usingItem4 === void 0 ? void 0 : _this$usingItem4.logical,
2152
2458
  "multiple": !!multiple,
2153
- "hoverId": _this.menuHoverId,
2154
2459
  "selected": (values === null || values === void 0 ? void 0 : values.map(function (item) {
2155
2460
  return item.id;
2156
2461
  })) || [],
2157
- "conditions": showCondition ? _this.conditions : [],
2158
- "logical": (_this$usingItem = _this.usingItem) === null || _this$usingItem === void 0 ? void 0 : _this$usingItem.logical,
2159
- "showLogical": (_this$usingItem2 = _this.usingItem) === null || _this$usingItem2 === void 0 ? void 0 : _this$usingItem2.showLogical,
2160
- "onUpdate:logical": _this.handleLogicalChange,
2161
- "onSelectItem": _this.handleSelectItem,
2462
+ "showLogical": (_this$usingItem5 = _this.usingItem) === null || _this$usingItem5 === void 0 ? void 0 : _this$usingItem5.showLogical,
2463
+ "onFooterClick": _this.handleMenuFooterClick,
2162
2464
  "onSelectCondition": _this.handleSelectCondtionItem,
2163
- "onFooterClick": _this.handleMenuFooterClick
2164
- }, _objectSpread({}, menuSlots))]) : undefined;
2465
+ "onSelectItem": _this.handleSelectItem,
2466
+ "onUpdate:logical": _this.handleLogicalChange
2467
+ }, null)]) : undefined;
2165
2468
  };
2166
2469
  return (0,external_vue_namespaceObject.createVNode)(popover_namespaceObject["default"], {
2167
- "trigger": "manual",
2168
- "theme": "light",
2169
- "placement": "bottom-start",
2170
2470
  "arrow": false,
2171
2471
  "disableOutsideClick": true,
2172
- "isShow": showPopover
2472
+ "isShow": showPopover,
2473
+ "placement": "bottom-start",
2474
+ "theme": "light",
2475
+ "trigger": "manual"
2173
2476
  }, {
2174
2477
  "default": inputContent,
2175
2478
  content: popoverContent
@@ -2178,6 +2481,9 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2178
2481
  }));
2179
2482
  ;// CONCATENATED MODULE: ../../packages/search-select/src/selected.tsx
2180
2483
 
2484
+
2485
+ function selected_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2486
+ function selected_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? selected_ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : selected_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2181
2487
  /*
2182
2488
  * Tencent is pleased to support the open source community by making
2183
2489
  * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
@@ -2232,10 +2538,11 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2232
2538
  validateValues: Function,
2233
2539
  valueBehavior: String
2234
2540
  },
2235
- emits: ['delete'],
2541
+ emits: ['delete', 'selectKey'],
2236
2542
  setup: function setup(_props, _ref) {
2237
2543
  var emit = _ref.emit;
2238
2544
  var inputRef = (0,external_vue_namespaceObject.ref)(null);
2545
+ var selectedInputRef = (0,external_vue_namespaceObject.ref)(null);
2239
2546
  var _useSearchSelectInjec = useSearchSelectInject(),
2240
2547
  onEditClick = _useSearchSelectInjec.onEditClick,
2241
2548
  onEditEnter = _useSearchSelectInjec.onEditEnter,
@@ -2248,6 +2555,11 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2248
2555
  e.preventDefault();
2249
2556
  e.stopPropagation();
2250
2557
  onEditClick(item, index);
2558
+ emit('selectKey', {
2559
+ id: item.id,
2560
+ name: item.name,
2561
+ values: item.values.slice()
2562
+ });
2251
2563
  // magic code
2252
2564
  setTimeout(function () {
2253
2565
  return inputRef.value.handleInputFocus();
@@ -2260,8 +2572,9 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2260
2572
  if (isFocus) return;
2261
2573
  onEditBlur();
2262
2574
  }
2263
- function handleInputOutside() {
2264
- return true;
2575
+ function handleInputOutside(target) {
2576
+ var _selectedInputRef$val;
2577
+ return !((_selectedInputRef$val = selectedInputRef.value) !== null && _selectedInputRef$val !== void 0 && _selectedInputRef$val.contains(target));
2265
2578
  }
2266
2579
  function copySeletedItem(item) {
2267
2580
  var newItem = new SelectedItem(item.searchItem, item.type);
@@ -2271,6 +2584,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2271
2584
  }
2272
2585
  return {
2273
2586
  inputRef: inputRef,
2587
+ selectedInputRef: selectedInputRef,
2274
2588
  editKey: editKey,
2275
2589
  copySeletedItem: copySeletedItem,
2276
2590
  handleDeleteSelected: handleDeleteSelected,
@@ -2284,27 +2598,28 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2284
2598
  var _this = this;
2285
2599
  var contentComponent = function contentComponent(item, index) {
2286
2600
  return _this.editKey === "".concat(item.id, "_").concat(index) ? (0,external_vue_namespaceObject.createVNode)("div", {
2287
- "class": "selected-input",
2288
- "key": _this.editKey.toString()
2601
+ "key": _this.editKey.toString(),
2602
+ "ref": "selectedInputRef",
2603
+ "class": "selected-input"
2289
2604
  }, [(0,external_vue_namespaceObject.createVNode)(input, {
2290
- "ref": "inputRef",
2291
2605
  "key": _this.editKey.toString(),
2292
- "mode": SearchInputMode.EDIT,
2293
- "data": _this.data,
2294
- "showCondition": false,
2606
+ "ref": "inputRef",
2607
+ "clickOutside": _this.handleInputOutside,
2295
2608
  "conditions": _this.conditions,
2609
+ "data": _this.data,
2296
2610
  "defautUsingItem": _this.copySeletedItem(item),
2297
- "clickOutside": _this.handleInputOutside,
2298
2611
  "getMenuList": _this.getMenuList,
2612
+ "mode": SearchInputMode.EDIT,
2613
+ "showCondition": false,
2299
2614
  "validateValues": _this.validateValues,
2300
2615
  "valueBehavior": _this.valueBehavior,
2301
2616
  "onAdd": function onAdd(v) {
2302
2617
  return _this.handleAddSelected(v, index);
2303
2618
  },
2304
2619
  "onFocus": _this.handleInputFocus
2305
- }, null)]) : (0,external_vue_namespaceObject.createVNode)("li", {
2306
- "class": "search-container-selected ".concat(!(_this.overflowIndex >= 0 ? index < _this.overflowIndex : index >= 0) ? 'hidden-selected' : ''),
2307
- "key": "".concat(item.id, "_").concat(index)
2620
+ }, selected_objectSpread({}, _this.$slots))]) : (0,external_vue_namespaceObject.createVNode)("li", {
2621
+ "key": "".concat(item.id, "_").concat(index),
2622
+ "class": "search-container-selected ".concat(!(_this.overflowIndex >= 0 ? index < _this.overflowIndex : index >= 0) ? 'hidden-selected' : '')
2308
2623
  }, [(0,external_vue_namespaceObject.createVNode)("span", {
2309
2624
  "class": "selected-name",
2310
2625
  "onClick": function onClick(e) {
@@ -2414,6 +2729,13 @@ var SearchSelectProps = {
2414
2729
  return [ValueBehavior.ALL, ValueBehavior.NEEDKEY].includes(v);
2415
2730
  }
2416
2731
  }
2732
+ // deleteBehavior: {
2733
+ // type: String as PropType<`${DeleteBehavior}`>,
2734
+ // default: DeleteBehavior.CHAR,
2735
+ // validator(v: DeleteBehavior) {
2736
+ // return [DeleteBehavior.CHAR, DeleteBehavior.VALUE].includes(v);
2737
+ // },
2738
+ // },
2417
2739
  };
2418
2740
  /* harmony default export */ const search_select = ((0,external_vue_namespaceObject.defineComponent)({
2419
2741
  name: 'SearchSelect',
@@ -2421,7 +2743,8 @@ var SearchSelectProps = {
2421
2743
  clickoutside: directives_namespaceObject.clickoutside
2422
2744
  },
2423
2745
  props: SearchSelectProps,
2424
- emits: ['update:modelValue', 'search'],
2746
+ emits: ['update:modelValue', 'search', 'selectKey'],
2747
+ slots: Object,
2425
2748
  setup: function setup(props, _ref) {
2426
2749
  var emit = _ref.emit;
2427
2750
  var t = (0,config_provider_namespaceObject.useLocale)('searchSelect');
@@ -2529,7 +2852,11 @@ var SearchSelectProps = {
2529
2852
  onEditEnter: onEditEnter,
2530
2853
  onEditBlur: onEditBlur,
2531
2854
  onValidate: onValidate,
2532
- editKey: editKey
2855
+ editKey: editKey,
2856
+ searchData: (0,external_vue_namespaceObject.computed)(function () {
2857
+ return props.data;
2858
+ }),
2859
+ isClickOutside: handleInputOutside
2533
2860
  });
2534
2861
  function onEditClick(item, index) {
2535
2862
  editKey.value = "".concat(item.id, "_").concat(index);
@@ -2581,12 +2908,13 @@ var SearchSelectProps = {
2581
2908
  }
2582
2909
  function handleWrapClick() {
2583
2910
  if (!editKey.value) {
2584
- inputRef.value.handleInputFocus();
2911
+ inputRef.value.inputFocusForWrapper();
2585
2912
  }
2586
2913
  }
2587
2914
  function handleClearAll() {
2588
2915
  selectedList.value = [];
2589
2916
  overflowIndex.value = -1;
2917
+ inputRef.value.inputClearForWrapper();
2590
2918
  emit('update:modelValue', []);
2591
2919
  }
2592
2920
  function handleInputOutside(target) {
@@ -2618,8 +2946,12 @@ var SearchSelectProps = {
2618
2946
  isFocus.value = v;
2619
2947
  }
2620
2948
  function handleClickSearch(e) {
2949
+ inputRef.value.inputEnterForWrapper();
2621
2950
  emit('search', e);
2622
2951
  }
2952
+ function handleSelectedKey(a) {
2953
+ emit('selectKey', a);
2954
+ }
2623
2955
  return {
2624
2956
  inputRef: inputRef,
2625
2957
  wrapRef: wrapRef,
@@ -2640,6 +2972,7 @@ var SearchSelectProps = {
2640
2972
  handleClickSearch: handleClickSearch,
2641
2973
  localConditions: localConditions,
2642
2974
  resolveClassName: resolveClassName,
2975
+ handleSelectedKey: handleSelectedKey,
2643
2976
  t: t
2644
2977
  };
2645
2978
  },
@@ -2657,51 +2990,53 @@ var SearchSelectProps = {
2657
2990
  } : {});
2658
2991
  // render
2659
2992
  return (0,external_vue_namespaceObject.createVNode)("div", {
2660
- "class": this.resolveClassName('search-select'),
2661
- "ref": "wrapRef"
2993
+ "ref": "wrapRef",
2994
+ "class": this.resolveClassName('search-select')
2662
2995
  }, [(0,external_vue_namespaceObject.createVNode)("div", {
2663
2996
  "class": _defineProperty(_defineProperty({}, this.resolveClassName('search-select-container'), true), 'is-focus', this.isFocus),
2664
2997
  "onClick": this.handleWrapClick
2665
2998
  }, [(0,external_vue_namespaceObject.createVNode)("div", {
2666
2999
  "class": "search-prefix"
2667
3000
  }, [(_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
3001
  "style": {
2670
3002
  maxHeight: maxHeight
2671
- }
3003
+ },
3004
+ "class": "search-container"
2672
3005
  }, [(0,external_vue_namespaceObject.createVNode)(selected, {
2673
- "data": this.copyData,
2674
3006
  "conditions": this.localConditions,
2675
- "selectedList": this.selectedList,
2676
- "overflowIndex": this.overflowIndex,
3007
+ "data": this.copyData,
2677
3008
  "getMenuList": this.getMenuList,
3009
+ "overflowIndex": this.overflowIndex,
3010
+ "selectedList": this.selectedList,
2678
3011
  "validateValues": this.validateValues,
2679
3012
  "valueBehavior": this.valueBehavior,
2680
- "onDelete": this.handleDeleteSelected
3013
+ "onDelete": this.handleDeleteSelected,
3014
+ "onSelectKey": this.handleSelectedKey
2681
3015
  }, search_select_objectSpread({}, menuSlots)), (0,external_vue_namespaceObject.createVNode)("div", {
2682
3016
  "class": "search-container-input"
2683
3017
  }, [(0,external_vue_namespaceObject.createVNode)(input, {
2684
3018
  "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
3019
  "clickOutside": this.handleInputOutside,
3020
+ "conditions": this.localConditions,
3021
+ "data": this.copyData,
2691
3022
  "getMenuList": this.getMenuList,
3023
+ "placeholder": this.placeholder || this.t.pleaseSelect,
3024
+ "showCondition": showCondition,
3025
+ "showInputBefore": !this.selectedList.length,
2692
3026
  "validateValues": this.validateValues,
2693
3027
  "valueBehavior": this.valueBehavior,
2694
3028
  "onAdd": this.handleAddSelected,
2695
3029
  "onDelete": this.handleDeleteSelected,
2696
- "onFocus": this.handleInputFocus
3030
+ "onFocus": this.handleInputFocus,
3031
+ "onSelectKey": this.handleSelectedKey
2697
3032
  }, search_select_objectSpread({}, menuSlots))])]), (0,external_vue_namespaceObject.createVNode)("div", {
2698
3033
  "class": "search-nextfix"
2699
3034
  }, [this.clearable && !!this.selectedList.length && (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.Close, {
2700
3035
  "class": "search-clear",
2701
3036
  "onClick": this.handleClearAll
2702
3037
  }, 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' : '')
3038
+ "class": "search-nextfix-icon ".concat(this.isFocus ? 'is-focus' : ''),
3039
+ "onClick": this.handleClickSearch
2705
3040
  }, null)])]), !!this.validateStr.length && (0,external_vue_namespaceObject.createVNode)("div", {
2706
3041
  "class": this.resolveClassName('search-select-tips')
2707
3042
  }, [this.$slots.validate ? this.$slots.validate() : (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [(0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.ExclamationCircleShape, {