@web-utils/component 2.0.14 → 2.2.0

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 (384) hide show
  1. package/{dist/components/address-input/index.js → address-input/index.mjs} +9 -9
  2. package/affix/index.mjs +102 -0
  3. package/affix/style.css +1 -0
  4. package/aside-menu/index.mjs +58 -0
  5. package/avatar/index.mjs +106 -0
  6. package/avatar/style.css +1 -0
  7. package/awesome-button/index.mjs +112 -0
  8. package/base.css +1 -0
  9. package/{dist/components/capsule-tab/index.js → capsule-tab/index.mjs} +10 -10
  10. package/{dist/components/capsule-tab → capsule-tab}/style.css +1 -1
  11. package/card/index.mjs +126 -0
  12. package/card/style.css +1 -0
  13. package/carousel/index.mjs +70 -0
  14. package/carousel/style.css +1 -0
  15. package/chat/index.mjs +576 -0
  16. package/chat/style.css +1 -0
  17. package/{dist/components/chunk-file-uploader/index.js → chunk-file-uploader/index.mjs} +8 -6
  18. package/chunks/FormTemp.FX8xmbVB.mjs +165 -0
  19. package/chunks/confirmable-mixin.rTUMhoRH.mjs +106 -0
  20. package/chunks/dataformat.X_61lMA7.mjs +158 -0
  21. package/chunks/dic.6tk91Dmq.mjs +130 -0
  22. package/chunks/event.NHA7rYFE.mjs +236 -0
  23. package/{dist/chunks/76680a03.js → chunks/form-input-mixin.IKogWBfn.mjs} +2 -2
  24. package/{dist/chunks/b4acd3a6.js → chunks/form-item-mixin.BilKDUlK.mjs} +28 -14
  25. package/{dist/chunks/f71045fc.js → chunks/index.LGsb2aDq.mjs} +7 -6
  26. package/chunks/init.Ac4dKUJB.mjs +122 -0
  27. package/chunks/json-beautifier.fUZFSW5j.mjs +126 -0
  28. package/chunks/packages.v6r2Hr7E.mjs +58 -0
  29. package/chunks/permission.E9kZbW48.mjs +16 -0
  30. package/chunks/slot.j1uMmBnG.mjs +27 -0
  31. package/{dist/chunks/8c0142e0.js → chunks/tab-mixin.tM9jcRT8.mjs} +1 -1
  32. package/chunks/util.C2Bhx22L.mjs +259 -0
  33. package/{dist/chunks/5d4282fb.js → chunks/vueComponentNormalizer.JwmUNtgn.mjs} +3 -1
  34. package/{dist/components/code-mirror-editor/index.js → code-mirror-editor/index.mjs} +41 -38
  35. package/code-mirror-editor/style.css +1 -0
  36. package/{dist/components/color-picker/index.js → color-picker/index.mjs} +41 -23
  37. package/comment/index.mjs +90 -0
  38. package/comment/style.css +1 -0
  39. package/{dist/components/confirm-button/index.js → confirm-button/index.mjs} +2 -2
  40. package/{dist/components/confirmable/index.js → confirmable/index.mjs} +2 -2
  41. package/{dist/components/context-menu/index.js → context-menu/index.mjs} +27 -15
  42. package/context-menu/style.css +1 -0
  43. package/count-up/index.mjs +131 -0
  44. package/custom-scrollbar/index.mjs +116 -0
  45. package/data-box/index.mjs +97 -0
  46. package/data-box/style.css +1 -0
  47. package/data-card/index.mjs +98 -0
  48. package/data-card/style.css +1 -0
  49. package/data-cardtext/index.mjs +82 -0
  50. package/data-cardtext/style.css +1 -0
  51. package/data-display/index.mjs +97 -0
  52. package/data-display/style.css +1 -0
  53. package/data-icons/index.mjs +104 -0
  54. package/data-icons/style.css +1 -0
  55. package/data-imgtext/index.mjs +106 -0
  56. package/data-imgtext/style.css +1 -0
  57. package/data-operatext/index.mjs +99 -0
  58. package/data-operatext/style.css +1 -0
  59. package/data-panel/index.mjs +93 -0
  60. package/data-panel/style.css +1 -0
  61. package/data-pay/index.mjs +152 -0
  62. package/data-pay/style.css +1 -0
  63. package/data-price/index.mjs +84 -0
  64. package/data-price/style.css +1 -0
  65. package/data-progress/index.mjs +97 -0
  66. package/data-progress/style.css +1 -0
  67. package/data-rotate/index.mjs +96 -0
  68. package/data-rotate/style.css +1 -0
  69. package/{dist/components/data-table-picker/index.js → data-table-picker/index.mjs} +22 -22
  70. package/data-tabs/index.mjs +94 -0
  71. package/data-tabs/style.css +1 -0
  72. package/dialog-form/index.mjs +148 -0
  73. package/dialog-form/style.css +1 -0
  74. package/{dist/components/dynamic-table/index.js → dynamic-table/index.mjs} +11 -11
  75. package/dynamic-table/style.css +1 -0
  76. package/{dist/components/e-charts/index.js → e-charts/index.mjs} +33 -46
  77. package/easy-popup/index.mjs +136 -0
  78. package/easy-popup/style.css +1 -0
  79. package/{dist/components/editable-progress/index.js → editable-progress/index.mjs} +1 -1
  80. package/editable-progress/style.css +1 -0
  81. package/editable-tree/index.mjs +844 -0
  82. package/editable-tree/style.css +1 -0
  83. package/{dist/components/egd-collapse/index.js → egd-collapse/index.mjs} +1 -1
  84. package/{dist/components/egd-collapse-item/index.js → egd-collapse-item/index.mjs} +14 -12
  85. package/{dist/components/element-dialog/index.js → element-dialog/index.mjs} +88 -35
  86. package/element-dialog/style.css +1 -0
  87. package/{dist/components/empty-view/index.js → empty-view/index.mjs} +9 -9
  88. package/empty-view/style.css +1 -0
  89. package/{dist/components/error-view/index.js → error-view/index.mjs} +13 -13
  90. package/error-view/style.css +1 -0
  91. package/flex-column/index.mjs +62 -0
  92. package/flex-item/index.mjs +81 -0
  93. package/flex-row/index.mjs +62 -0
  94. package/{dist/components/flex-scroller/index.js → flex-scroller/index.mjs} +5 -5
  95. package/flex-scroller/style.css +1 -0
  96. package/flow/index.mjs +277 -0
  97. package/flow/style.css +1 -0
  98. package/flow-designer/index.mjs +10184 -0
  99. package/flow-designer/style.css +1 -0
  100. package/flow-node/index.mjs +102 -0
  101. package/flow-viewer/index.mjs +209 -0
  102. package/flow-viewer/style.css +1 -0
  103. package/form-block/index.mjs +156 -0
  104. package/form-block/style.css +1 -0
  105. package/form-button/index.mjs +58 -0
  106. package/{dist/components/form-cascader/index.js → form-cascader/index.mjs} +41 -29
  107. package/{dist/components/form-checkbox-group/index.js → form-checkbox-group/index.mjs} +47 -36
  108. package/form-checkbox-group/style.css +1 -0
  109. package/{dist/components/form-date-picker/index.js → form-date-picker/index.mjs} +45 -36
  110. package/form-holder/index.mjs +129 -0
  111. package/{dist/components/form-input/index.js → form-input/index.mjs} +34 -23
  112. package/{dist/components/form-input-email/index.js → form-input-email/index.mjs} +36 -25
  113. package/{dist/components/form-input-id-card/index.js → form-input-id-card/index.mjs} +35 -24
  114. package/{dist/components/form-input-number/index.js → form-input-number/index.mjs} +40 -29
  115. package/{dist/components/form-input-phone-number/index.js → form-input-phone-number/index.mjs} +37 -26
  116. package/form-input-tag/index.mjs +108 -0
  117. package/{dist/components/form-input-time/index.js → form-input-time/index.mjs} +40 -29
  118. package/form-item/index.mjs +147 -0
  119. package/{dist/components/form-item → form-item}/style.css +1 -1
  120. package/{dist/components/form-item-config-provider/index.js → form-item-config-provider/index.mjs} +1 -1
  121. package/{dist/components/form-item-group/index.js → form-item-group/index.mjs} +4 -4
  122. package/form-item-group/style.css +1 -0
  123. package/{dist/components/form-radio-group/index.js → form-radio-group/index.mjs} +51 -40
  124. package/form-radio-group/style.css +1 -0
  125. package/{dist/components/form-select/index.js → form-select/index.mjs} +40 -29
  126. package/{dist/components/form-switch/index.js → form-switch/index.mjs} +35 -24
  127. package/form-textarea/index.mjs +113 -0
  128. package/{dist/components/form-view/index.js → form-view/index.mjs} +72 -44
  129. package/form-view/style.css +1 -0
  130. package/fy-array/index.mjs +158 -0
  131. package/fy-array/style.css +1 -0
  132. package/fy-article/index.mjs +93 -0
  133. package/fy-article/style.css +1 -0
  134. package/fy-cascader/index.mjs +132 -0
  135. package/fy-checkbox/index.mjs +117 -0
  136. package/fy-checkbox/style.css +1 -0
  137. package/fy-code/index.mjs +66 -0
  138. package/fy-curd/index.mjs +3119 -0
  139. package/fy-curd/style.css +1 -0
  140. package/fy-date/index.mjs +84 -0
  141. package/fy-date/style.css +1 -0
  142. package/fy-draggable/index.mjs +382 -0
  143. package/fy-draggable/style.css +1 -0
  144. package/fy-dynamic/index.mjs +337 -0
  145. package/fy-dynamic/style.css +1 -0
  146. package/fy-empty/index.mjs +59 -0
  147. package/fy-empty/style.css +1 -0
  148. package/fy-form/index.mjs +993 -0
  149. package/fy-form/style.css +1 -0
  150. package/fy-form-design/index.mjs +7483 -0
  151. package/fy-form-design/style.css +1 -0
  152. package/fy-input/index.mjs +171 -0
  153. package/fy-input-color/index.mjs +101 -0
  154. package/fy-input-icon/index.mjs +169 -0
  155. package/fy-input-icon/style.css +1 -0
  156. package/fy-input-map/index.mjs +279 -0
  157. package/fy-input-map/style.css +1 -0
  158. package/fy-input-number/index.mjs +87 -0
  159. package/fy-input-table/index.mjs +172 -0
  160. package/fy-input-table/style.css +1 -0
  161. package/fy-input-tree/index.mjs +267 -0
  162. package/fy-input-tree/style.css +1 -0
  163. package/fy-progress/index.mjs +60 -0
  164. package/fy-radio/index.mjs +70 -0
  165. package/fy-radio/style.css +1 -0
  166. package/fy-rate/index.mjs +106 -0
  167. package/fy-rate/style.css +1 -0
  168. package/fy-select/index.mjs +225 -0
  169. package/fy-select/style.css +1 -0
  170. package/fy-slider/index.mjs +79 -0
  171. package/fy-switch/index.mjs +74 -0
  172. package/fy-tabs/index.mjs +92 -0
  173. package/fy-time/index.mjs +95 -0
  174. package/fy-title/index.mjs +40 -0
  175. package/fy-title/style.css +1 -0
  176. package/fy-tree/index.mjs +433 -0
  177. package/fy-tree/style.css +1 -0
  178. package/fy-u-editor/index.mjs +398 -0
  179. package/fy-u-editor/style.css +1 -0
  180. package/fy-upload/index.mjs +592 -0
  181. package/fy-upload/style.css +1 -0
  182. package/{dist/components/guide-steps/index.js → guide-steps/index.mjs} +12 -12
  183. package/{dist/components/guide-steps → guide-steps}/style.css +1 -1
  184. package/highlight-j-s/index.mjs +76 -0
  185. package/highlight-j-s/style.css +1 -0
  186. package/{dist/components/icon-card/index.js → icon-card/index.mjs} +9 -9
  187. package/{dist/components/icon-card → icon-card}/style.css +1 -1
  188. package/icon-temp/index.mjs +50 -0
  189. package/icon-temp/style.css +1 -0
  190. package/{dist/components/iframe-window/index.js → iframe-window/index.mjs} +5 -5
  191. package/iframe-window/style.css +1 -0
  192. package/image-cropper/index.mjs +249 -0
  193. package/image-cropper/style.css +1 -0
  194. package/image-preview/index.mjs +260 -0
  195. package/image-preview/style.css +1 -0
  196. package/{dist/components/image-viewer/index.js → image-viewer/index.mjs} +5 -5
  197. package/image-viewer/style.css +1 -0
  198. package/index.mjs +627 -0
  199. package/{dist/components/input-number/index.js → input-number/index.mjs} +2 -2
  200. package/{dist/components/input-number-range/index.js → input-number-range/index.mjs} +7 -7
  201. package/input-number-range/style.css +1 -0
  202. package/{dist/components/keep-view-alive/index.js → keep-view-alive/index.mjs} +6 -2
  203. package/keyboard/index.mjs +384 -0
  204. package/keyboard/style.css +1 -0
  205. package/license/index.mjs +134 -0
  206. package/{dist/components/loading-view/index.js → loading-view/index.mjs} +5 -5
  207. package/loading-view/style.css +1 -0
  208. package/login/index.mjs +250 -0
  209. package/login/style.css +1 -0
  210. package/monaco-editor/index.mjs +197 -0
  211. package/name-avatar/index.mjs +66 -0
  212. package/name-avatar/style.css +1 -0
  213. package/{dist/components/nav-bar/index.js → nav-bar/index.mjs} +8 -8
  214. package/nav-bar/style.css +1 -0
  215. package/not-implement/index.mjs +35 -0
  216. package/not-implement/style.css +1 -0
  217. package/notice/index.mjs +143 -0
  218. package/notice/style.css +1 -0
  219. package/package.json +41 -148
  220. package/{dist/components/page/index.js → page/index.mjs} +8 -8
  221. package/{dist/components/page-header/index.js → page-header/index.mjs} +6 -6
  222. package/{dist/components/page-index/index.js → page-index/index.mjs} +58 -34
  223. package/page-index/style.css +1 -0
  224. package/page-index-top/index.mjs +141 -0
  225. package/page-skeleton/index.mjs +67 -0
  226. package/page-skeleton/style.css +1 -0
  227. package/{dist/components/page-skeleton-new/index.js → page-skeleton-new/index.mjs} +3 -3
  228. package/page-skeleton-new/style.css +1 -0
  229. package/{dist/components/pageable-table/index.js → pageable-table/index.mjs} +149 -100
  230. package/pageable-table/style.css +1 -0
  231. package/{dist/components/pageable-view/index.js → pageable-view/index.mjs} +118 -68
  232. package/pageable-view/style.css +1 -0
  233. package/photo-swipe/index.mjs +129 -0
  234. package/present-view/index.mjs +365 -0
  235. package/present-view/style.css +1 -0
  236. package/queue/index.mjs +71 -0
  237. package/queue/style.css +1 -0
  238. package/record-video/index.mjs +173 -0
  239. package/record-video/style.css +1 -0
  240. package/{dist/components/resize-observer/index.js → resize-observer/index.mjs} +6 -6
  241. package/resize-observer/style.css +1 -0
  242. package/search/index.mjs +143 -0
  243. package/search/style.css +1 -0
  244. package/{dist/components/search-popover/index.js → search-popover/index.mjs} +64 -43
  245. package/search-popover/style.css +1 -0
  246. package/sign/index.mjs +132 -0
  247. package/sign/style.css +1 -0
  248. package/{dist/components/sign-panel/index.js → sign-panel/index.mjs} +18 -5
  249. package/sign-panel/style.css +1 -0
  250. package/skeleton/index.mjs +82 -0
  251. package/skeleton/style.css +1 -0
  252. package/{dist/components/split-pane/index.js → split-pane/index.mjs} +125 -28
  253. package/split-pane/style.css +1 -0
  254. package/{dist/components/stateful/index.js → stateful/index.mjs} +12 -12
  255. package/{dist/components/stateful → stateful}/style.css +1 -1
  256. package/{dist/components/static-pageable-table/index.js → static-pageable-table/index.mjs} +10 -10
  257. package/static-pageable-table/style.css +1 -0
  258. package/{dist/components/swiper/index.js → swiper/index.mjs} +49 -24
  259. package/swiper/style.css +1 -0
  260. package/{dist/components/tab/index.js → tab/index.mjs} +4 -2
  261. package/tab/style.css +1 -0
  262. package/{dist/components/tab-item/index.js → tab-item/index.mjs} +3 -3
  263. package/{dist/components/table-column/index.js → table-column/index.mjs} +35 -22
  264. package/{dist/components/table-view/index.js → table-view/index.mjs} +91 -64
  265. package/table-view/style.css +1 -0
  266. package/{dist/components/tag-render/index.js → tag-render/index.mjs} +45 -26
  267. package/tag-render/style.css +1 -0
  268. package/text-ellipsis/index.mjs +108 -0
  269. package/text-ellipsis/style.css +1 -0
  270. package/{dist/components/tinymce-wrapper/index.js → tinymce-editor/index.mjs} +446 -71
  271. package/tinymce-editor/style.css +1 -0
  272. package/{dist/components/toolbar/index.js → toolbar/index.mjs} +21 -21
  273. package/toolbar/style.css +1 -0
  274. package/toolbar-button/index.mjs +108 -0
  275. package/toolbar-button/style.css +1 -0
  276. package/verify/index.mjs +80 -0
  277. package/verify/style.css +1 -0
  278. package/vue-cron/index.mjs +1410 -0
  279. package/vue-cron/style.css +1 -0
  280. package/vue-qr-code/index.mjs +83 -0
  281. package/vue-quill-editor/index.mjs +117 -0
  282. package/vue-quill-editor/style.css +1 -0
  283. package/{dist/components/vue-tags-input/index.js → vue-tags-input/index.mjs} +115 -1
  284. package/vue-tags-input/style.css +1 -0
  285. package/vue-tree-select/index.mjs +2881 -0
  286. package/vue-tree-select/style.css +1 -0
  287. package/vue-video-player/index.mjs +192 -0
  288. package/vue-video-player/style.css +1 -0
  289. package/watermark/index.mjs +95 -0
  290. package/watermark/style.css +1 -0
  291. package/web-types.json +14033 -2752
  292. package/x-input-tag/index.mjs +203 -0
  293. package/x-input-tag/style.css +1 -0
  294. package/README.md +0 -27
  295. package/dist/chunks/3a79781b.js +0 -75
  296. package/dist/chunks/5a78e0db.js +0 -16
  297. package/dist/chunks/97652d86.js +0 -26
  298. package/dist/components/aside-menu/index.js +0 -58
  299. package/dist/components/awesome-button/index.js +0 -82
  300. package/dist/components/base.css +0 -1
  301. package/dist/components/chunk-file-uploader-button/index.js +0 -60
  302. package/dist/components/chunk-file-uploader-button/style.css +0 -1
  303. package/dist/components/chunk-file-uploader-drop/index.js +0 -65
  304. package/dist/components/chunk-file-uploader-drop/style.css +0 -1
  305. package/dist/components/chunk-file-uploader-file/index.js +0 -311
  306. package/dist/components/chunk-file-uploader-file/style.css +0 -1
  307. package/dist/components/chunk-file-uploader-files/index.js +0 -49
  308. package/dist/components/chunk-file-uploader-files/style.css +0 -1
  309. package/dist/components/chunk-file-uploader-list/index.js +0 -50
  310. package/dist/components/chunk-file-uploader-list/style.css +0 -1
  311. package/dist/components/chunk-file-uploader-un-support/index.js +0 -51
  312. package/dist/components/chunk-file-uploader-un-support/style.css +0 -1
  313. package/dist/components/code-mirror-editor/style.css +0 -1
  314. package/dist/components/context-menu/style.css +0 -1
  315. package/dist/components/custom-scrollbar/index.js +0 -149
  316. package/dist/components/dynamic-table/style.css +0 -1
  317. package/dist/components/editable-progress/style.css +0 -1
  318. package/dist/components/editable-tree/index.js +0 -789
  319. package/dist/components/editable-tree/style.css +0 -1
  320. package/dist/components/element-dialog/style.css +0 -1
  321. package/dist/components/empty-view/style.css +0 -1
  322. package/dist/components/error-view/style.css +0 -1
  323. package/dist/components/flex-column/index.js +0 -50
  324. package/dist/components/flex-item/index.js +0 -66
  325. package/dist/components/flex-row/index.js +0 -50
  326. package/dist/components/flex-scroller/style.css +0 -1
  327. package/dist/components/form-button/index.js +0 -80
  328. package/dist/components/form-checkbox-group/style.css +0 -1
  329. package/dist/components/form-holder/index.js +0 -90
  330. package/dist/components/form-item/index.js +0 -119
  331. package/dist/components/form-item-group/style.css +0 -1
  332. package/dist/components/form-radio-group/style.css +0 -1
  333. package/dist/components/form-textarea/index.js +0 -102
  334. package/dist/components/form-view/style.css +0 -1
  335. package/dist/components/iframe-window/style.css +0 -1
  336. package/dist/components/image-viewer/style.css +0 -1
  337. package/dist/components/input-number-range/style.css +0 -1
  338. package/dist/components/loading-view/style.css +0 -1
  339. package/dist/components/nav-bar/style.css +0 -1
  340. package/dist/components/not-implement/index.js +0 -35
  341. package/dist/components/not-implement/style.css +0 -1
  342. package/dist/components/page-index/style.css +0 -1
  343. package/dist/components/page-index-top/index.js +0 -119
  344. package/dist/components/page-skeleton/index.js +0 -56
  345. package/dist/components/page-skeleton/style.css +0 -1
  346. package/dist/components/page-skeleton-new/style.css +0 -1
  347. package/dist/components/pageable-table/style.css +0 -1
  348. package/dist/components/pageable-view/style.css +0 -1
  349. package/dist/components/photo-swipe/index.js +0 -187
  350. package/dist/components/photo-swipe/style.css +0 -1
  351. package/dist/components/resize-observer/style.css +0 -1
  352. package/dist/components/search-popover/style.css +0 -1
  353. package/dist/components/sign-panel/style.css +0 -1
  354. package/dist/components/split-pane/style.css +0 -1
  355. package/dist/components/static-pageable-table/style.css +0 -1
  356. package/dist/components/swiper/style.css +0 -1
  357. package/dist/components/tab/style.css +0 -1
  358. package/dist/components/table-view/style.css +0 -1
  359. package/dist/components/tag-render/style.css +0 -1
  360. package/dist/components/tinymce-editor/index.js +0 -173
  361. package/dist/components/tinymce-editor/style.css +0 -1
  362. package/dist/components/tinymce-wrapper/style.css +0 -1
  363. package/dist/components/toolbar/style.css +0 -1
  364. package/dist/components/toolbar-button/index.js +0 -90
  365. package/dist/components/toolbar-button/style.css +0 -1
  366. package/dist/components/trigger/index.js +0 -71
  367. package/dist/components/vue-tags-input/style.css +0 -1
  368. package/dist/components/watermark/index.js +0 -63
  369. package/dist/components/watermark/style.css +0 -1
  370. package/dist/components/x-dialog/index.js +0 -173
  371. package/dist/components/x-dialog/style.css +0 -1
  372. package/dist/index.css +0 -2060
  373. package/dist/index.es.js +0 -13236
  374. /package/{dist/components/address-input → address-input}/style.css +0 -0
  375. /package/{dist/components/aside-menu → aside-menu}/style.css +0 -0
  376. /package/{dist/components/chunk-file-uploader → chunk-file-uploader}/style.css +0 -0
  377. /package/{dist/chunks/61ad06b2.js → chunks/form-pick-mixin.y-qhZJi6.mjs} +0 -0
  378. /package/{dist/chunks/41a066be.js → chunks/input-number-mixin.GE2zr_3s.mjs} +0 -0
  379. /package/{dist/components/e-charts → e-charts}/style.css +0 -0
  380. /package/{dist/components/form-input-number → form-input-number}/style.css +0 -0
  381. /package/{dist/components/input-number → input-number}/style.css +0 -0
  382. /package/{dist/components/j-s-x-component/index.js → j-s-x-component/index.mjs} +0 -0
  383. /package/{dist/components/page → page}/style.css +0 -0
  384. /package/{dist/components/page-header → page-header}/style.css +0 -0
@@ -0,0 +1,2881 @@
1
+ var Fe = Object.defineProperty, ke = Object.defineProperties;
2
+ var He = Object.getOwnPropertyDescriptors;
3
+ var G = Object.getOwnPropertySymbols;
4
+ var Pe = Object.prototype.hasOwnProperty, We = Object.prototype.propertyIsEnumerable;
5
+ var J = (e, t, s) => t in e ? Fe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, _ = (e, t) => {
6
+ for (var s in t || (t = {}))
7
+ Pe.call(t, s) && J(e, s, t[s]);
8
+ if (G)
9
+ for (var s of G(t))
10
+ We.call(t, s) && J(e, s, t[s]);
11
+ return e;
12
+ }, b = (e, t) => ke(e, He(t));
13
+ import { noop as je, identity as Qe, last as Z, once as Ke, debounce as qe } from "lodash-es";
14
+ import { isPromise as Oe } from "@web-utils/core";
15
+ import { n as f } from "../chunks/vueComponentNormalizer.JwmUNtgn.mjs";
16
+ import Ue from "vue";
17
+ const S = process.env.NODE_ENV === "production" ? (
18
+ /* istanbul ignore next */
19
+ je
20
+ ) : function(t, s) {
21
+ if (!t()) {
22
+ const n = ["[Vue-TreeSelect Warning]"].concat(s());
23
+ console.error(...n);
24
+ }
25
+ };
26
+ function N(e) {
27
+ return function(s, ...n) {
28
+ s.type === "mousedown" && s.button === 0 && e.call(this, s, ...n);
29
+ };
30
+ }
31
+ function Ye(e, t) {
32
+ const s = e.getBoundingClientRect(), n = t.getBoundingClientRect(), i = t.offsetHeight / 3;
33
+ n.bottom + i > s.bottom ? e.scrollTop = Math.min(
34
+ t.offsetTop + t.clientHeight - e.offsetHeight + i,
35
+ e.scrollHeight
36
+ ) : n.top - i < s.top && (e.scrollTop = Math.max(t.offsetTop - i, 0));
37
+ }
38
+ function ye(e, t) {
39
+ const s = e.indexOf(t);
40
+ s !== -1 && e.splice(s, 1);
41
+ }
42
+ let K;
43
+ const T = [], Xe = 100;
44
+ function Ge() {
45
+ K = setInterval(() => {
46
+ T.forEach(Ee);
47
+ }, Xe);
48
+ }
49
+ function Je() {
50
+ clearInterval(K), K = null;
51
+ }
52
+ function Ee(e) {
53
+ const { $el: t, listener: s, lastWidth: n, lastHeight: i } = e, o = t.offsetWidth, r = t.offsetHeight;
54
+ (n !== o || i !== r) && (e.lastWidth = o, e.lastHeight = r, s({ width: o, height: r }));
55
+ }
56
+ function Ze(e, t) {
57
+ const s = {
58
+ $el: e,
59
+ listener: t,
60
+ lastWidth: null,
61
+ lastHeight: null
62
+ }, n = () => {
63
+ ye(T, s), T.length || Je();
64
+ };
65
+ return T.push(s), Ee(s), Ge(), n;
66
+ }
67
+ function et(e, t) {
68
+ const s = document.createElement("_"), n = s.appendChild(document.createElement("_")), i = s.appendChild(document.createElement("_")), o = n.appendChild(document.createElement("_"));
69
+ let r, c;
70
+ return n.style.cssText = s.style.cssText = "height:100%;left:0;opacity:0;overflow:hidden;pointer-events:none;position:absolute;top:0;transition:0s;width:100%;z-index:-1", o.style.cssText = i.style.cssText = "display:block;height:100%;transition:0s;width:100%", o.style.width = o.style.height = "200%", e.appendChild(s), d(), m;
71
+ function d() {
72
+ a();
73
+ const p = e.offsetWidth, y = e.offsetHeight;
74
+ (p !== r || y !== c) && (r = p, c = y, i.style.width = `${p * 2}px`, i.style.height = `${y * 2}px`, s.scrollLeft = s.scrollWidth, s.scrollTop = s.scrollHeight, n.scrollLeft = n.scrollWidth, n.scrollTop = n.scrollHeight, t({ width: p, height: y })), n.addEventListener("scroll", d), s.addEventListener("scroll", d);
75
+ }
76
+ function a() {
77
+ n.removeEventListener("scroll", d), s.removeEventListener("scroll", d);
78
+ }
79
+ function m() {
80
+ a(), e.removeChild(s);
81
+ }
82
+ }
83
+ function Ne(e, t) {
84
+ const s = document.documentMode === 9;
85
+ let n = !0;
86
+ const r = (s ? Ze : et)(e, (...c) => n || t(...c));
87
+ return n = !1, r;
88
+ }
89
+ function tt(e) {
90
+ const t = [];
91
+ let s = e.parentNode;
92
+ for (; s && s.nodeName !== "BODY" && s.nodeType === document.ELEMENT_NODE; )
93
+ st(s) && t.push(s), s = s.parentNode;
94
+ return t.push(window), t;
95
+ }
96
+ function st(e) {
97
+ const { overflow: t, overflowX: s, overflowY: n } = getComputedStyle(e);
98
+ return /(auto|scroll|overlay)/.test(t + n + s);
99
+ }
100
+ function be(e, t) {
101
+ const s = tt(e);
102
+ return window.addEventListener("resize", t, { passive: !0 }), s.forEach((n) => {
103
+ n.addEventListener("scroll", t, { passive: !0 });
104
+ }), function() {
105
+ window.removeEventListener("resize", t, { passive: !0 }), s.forEach((i) => {
106
+ i.removeEventListener("scroll", t, { passive: !0 });
107
+ });
108
+ };
109
+ }
110
+ function $e(e) {
111
+ return Number.isNaN(e);
112
+ }
113
+ const g = () => /* @__PURE__ */ Object.create(null);
114
+ function we(e) {
115
+ return e == null || typeof e != "object" ? !1 : Object.getPrototypeOf(e) === Object.prototype;
116
+ }
117
+ function nt(e, t, s) {
118
+ we(s) ? (e[t] || (e[t] = {}), q(e[t], s)) : e[t] = s;
119
+ }
120
+ function q(e, t) {
121
+ if (we(t)) {
122
+ const s = Object.keys(t);
123
+ for (let n = 0, i = s.length; n < i; n++)
124
+ nt(e, s[n], t[s[n]]);
125
+ }
126
+ return e;
127
+ }
128
+ function O(e, t) {
129
+ return e.indexOf(t) !== -1;
130
+ }
131
+ function Ce(e, t, s) {
132
+ for (let n = 0, i = e.length; n < i; n++)
133
+ if (t.call(s, e[n], n, e))
134
+ return e[n];
135
+ }
136
+ function V(e, t) {
137
+ if (e.length !== t.length)
138
+ return !0;
139
+ for (let s = 0; s < e.length; s++)
140
+ if (e[s] !== t[s])
141
+ return !0;
142
+ return !1;
143
+ }
144
+ function it(e, t) {
145
+ const s = t.length, n = e.length;
146
+ if (n > s)
147
+ return !1;
148
+ if (n === s)
149
+ return e === t;
150
+ e:
151
+ for (let i = 0, o = 0; i < n; i++) {
152
+ const r = e.charCodeAt(i);
153
+ for (; o < s; )
154
+ if (t.charCodeAt(o++) === r)
155
+ continue e;
156
+ return !1;
157
+ }
158
+ return !0;
159
+ }
160
+ const E = null, U = 0, Le = 1, Me = 2, $ = "ALL_CHILDREN", w = "ALL_DESCENDANTS", C = "LEAF_CHILDREN", L = "LEAF_DESCENDANTS", rt = "LOAD_ROOT_OPTIONS", ot = "LOAD_CHILDREN_OPTIONS", lt = "ASYNC_SEARCH", B = "ALL", x = "BRANCH_PRIORITY", z = "LEAF_PRIORITY", F = "ALL_WITH_INDETERMINATE", ee = "ORDER_SELECTED", te = "LEVEL", se = "INDEX", h = {
161
+ BACKSPACE: 8,
162
+ ENTER: 13,
163
+ ESCAPE: 27,
164
+ END: 35,
165
+ HOME: 36,
166
+ ARROW_LEFT: 37,
167
+ ARROW_UP: 38,
168
+ ARROW_RIGHT: 39,
169
+ ARROW_DOWN: 40,
170
+ DELETE: 46
171
+ }, at = process.env.NODE_ENV === "testing" ? (
172
+ /* to speed up unit testing */
173
+ 10
174
+ ) : (
175
+ /* istanbul ignore next */
176
+ 200
177
+ ), ne = 5, ie = 40;
178
+ function xe(e, t) {
179
+ let s = 0;
180
+ do {
181
+ if (e.level < s)
182
+ return -1;
183
+ if (t.level < s)
184
+ return 1;
185
+ if (e.index[s] !== t.index[s])
186
+ return e.index[s] - t.index[s];
187
+ s++;
188
+ } while (!0);
189
+ }
190
+ function ct(e, t) {
191
+ return e.level === t.level ? xe(e, t) : e.level - t.level;
192
+ }
193
+ function k() {
194
+ return {
195
+ isLoaded: !1,
196
+ isLoading: !1,
197
+ loadingError: ""
198
+ };
199
+ }
200
+ function ut(e) {
201
+ return typeof e == "string" ? e : typeof e == "number" && !$e(e) ? `${e}` : "";
202
+ }
203
+ function re(e, t, s) {
204
+ return e ? it(t, s) : O(s, t);
205
+ }
206
+ function H(e) {
207
+ return e.message || /* istanbul ignore next */
208
+ String(e);
209
+ }
210
+ let ht = 0;
211
+ const dt = {
212
+ provide() {
213
+ return {
214
+ // Enable access to the instance of root component of vue-treeselect
215
+ // across hierarchy.
216
+ instance: this
217
+ };
218
+ },
219
+ props: {
220
+ /**
221
+ * Whether to allow resetting value even if there are disabled selected nodes.
222
+ */
223
+ allowClearingDisabled: {
224
+ type: Boolean,
225
+ default: !1
226
+ },
227
+ /**
228
+ * When an ancestor node is selected/deselected, whether its disabled descendants should be selected/deselected.
229
+ * You may want to use this in conjunction with `allowClearingDisabled` prop.
230
+ */
231
+ allowSelectingDisabledDescendants: {
232
+ type: Boolean,
233
+ default: !1
234
+ },
235
+ /**
236
+ * Whether the menu should be always open.
237
+ */
238
+ alwaysOpen: {
239
+ type: Boolean,
240
+ default: !1
241
+ },
242
+ /**
243
+ * Append the menu to <body />?
244
+ */
245
+ appendToBody: {
246
+ type: Boolean,
247
+ default: !1
248
+ },
249
+ /**
250
+ * Whether to enable async search mode.
251
+ */
252
+ async: {
253
+ type: Boolean,
254
+ default: !1
255
+ },
256
+ /**
257
+ * Automatically focus the component on mount?
258
+ */
259
+ autoFocus: {
260
+ type: Boolean,
261
+ default: !1
262
+ },
263
+ /**
264
+ * Automatically load root options on mount. When set to `false`, root options will be loaded when the menu is opened.
265
+ */
266
+ autoLoadRootOptions: {
267
+ type: Boolean,
268
+ default: !0
269
+ },
270
+ /**
271
+ * When user deselects a node, automatically deselect its ancestors. Applies to flat mode only.
272
+ */
273
+ autoDeselectAncestors: {
274
+ type: Boolean,
275
+ default: !1
276
+ },
277
+ /**
278
+ * When user deselects a node, automatically deselect its descendants. Applies to flat mode only.
279
+ */
280
+ autoDeselectDescendants: {
281
+ type: Boolean,
282
+ default: !1
283
+ },
284
+ /**
285
+ * When user selects a node, automatically select its ancestors. Applies to flat mode only.
286
+ */
287
+ autoSelectAncestors: {
288
+ type: Boolean,
289
+ default: !1
290
+ },
291
+ /**
292
+ * When user selects a node, automatically select its descendants. Applies to flat mode only.
293
+ */
294
+ autoSelectDescendants: {
295
+ type: Boolean,
296
+ default: !1
297
+ },
298
+ /**
299
+ * Whether pressing backspace key removes the last item if there is no text input.
300
+ */
301
+ backspaceRemoves: {
302
+ type: Boolean,
303
+ default: !0
304
+ },
305
+ /**
306
+ * Function that processes before clearing all input fields.
307
+ * Return `false` to prevent value from being cleared.
308
+ * @type {function(): (boolean|Promise<boolean>)}
309
+ */
310
+ beforeClearAll: {
311
+ type: Function,
312
+ default: () => !0
313
+ },
314
+ /**
315
+ * Show branch nodes before leaf nodes?
316
+ */
317
+ branchNodesFirst: {
318
+ type: Boolean,
319
+ default: !1
320
+ },
321
+ /**
322
+ * Should cache results of every search request?
323
+ */
324
+ cacheOptions: {
325
+ type: Boolean,
326
+ default: !0
327
+ },
328
+ /**
329
+ * Show an "×" button that resets value?
330
+ */
331
+ clearable: {
332
+ type: Boolean,
333
+ default: !0
334
+ },
335
+ /**
336
+ * Title for the "×" button when `multiple: true`.
337
+ */
338
+ clearAllText: {
339
+ type: String,
340
+ default: "Clear all"
341
+ },
342
+ /**
343
+ * Whether to clear the search input after selecting.
344
+ * Use only when `multiple` is `true`.
345
+ * For single-select mode, it **always** clears the input after selecting an option regardless of the prop value.
346
+ */
347
+ clearOnSelect: {
348
+ type: Boolean,
349
+ default: !1
350
+ },
351
+ /**
352
+ * Title for the "×" button.
353
+ */
354
+ clearValueText: {
355
+ type: String,
356
+ default: "Clear value"
357
+ },
358
+ /**
359
+ * Whether to close the menu after selecting an option?
360
+ * Use only when `multiple` is `true`.
361
+ */
362
+ closeOnSelect: {
363
+ type: Boolean,
364
+ default: !0
365
+ },
366
+ /**
367
+ * How many levels of branch nodes should be automatically expanded when loaded.
368
+ * Set `Infinity` to make all branch nodes expanded by default.
369
+ */
370
+ defaultExpandLevel: {
371
+ type: Number,
372
+ default: 0
373
+ },
374
+ /**
375
+ * The default set of options to show before the user starts searching. Used for async search mode.
376
+ * When set to `true`, the results for search query as a empty string will be autoloaded.
377
+ * @type {boolean|node[]}
378
+ */
379
+ defaultOptions: {
380
+ default: !1
381
+ },
382
+ /**
383
+ * Whether pressing delete key removes the last item if there is no text input.
384
+ */
385
+ deleteRemoves: {
386
+ type: Boolean,
387
+ default: !0
388
+ },
389
+ /**
390
+ * Delimiter to use to join multiple values for the hidden field value.
391
+ */
392
+ delimiter: {
393
+ type: String,
394
+ default: ","
395
+ },
396
+ /**
397
+ * Only show the nodes that match the search value directly, excluding its ancestors.
398
+ *
399
+ * @type {Object}
400
+ */
401
+ flattenSearchResults: {
402
+ type: Boolean,
403
+ default: !1
404
+ },
405
+ /**
406
+ * Prevent branch nodes from being selected?
407
+ */
408
+ disableBranchNodes: {
409
+ type: Boolean,
410
+ default: !1
411
+ },
412
+ /**
413
+ * Disable the control?
414
+ */
415
+ disabled: {
416
+ type: Boolean,
417
+ default: !1
418
+ },
419
+ /**
420
+ * Disable the fuzzy matching functionality?
421
+ */
422
+ disableFuzzyMatching: {
423
+ type: Boolean,
424
+ default: !1
425
+ },
426
+ /**
427
+ * Whether to enable flat mode or not. Non-flat mode (default) means:
428
+ * - Whenever a branch node gets checked, all its children will be checked too
429
+ * - Whenever a branch node has all children checked, the branch node itself will be checked too
430
+ * Set `true` to disable this mechanism
431
+ */
432
+ flat: {
433
+ type: Boolean,
434
+ default: !1
435
+ },
436
+ /**
437
+ * Will be passed with all events as the last param.
438
+ * Useful for identifying events origin.
439
+ */
440
+ instanceId: {
441
+ // Add two trailing "$" to distinguish from explictly specified ids.
442
+ default: () => `${ht++}$$`,
443
+ type: [String, Number]
444
+ },
445
+ /**
446
+ * Joins multiple values into a single form field with the `delimiter` (legacy mode).
447
+ */
448
+ joinValues: {
449
+ type: Boolean,
450
+ default: !1
451
+ },
452
+ /**
453
+ * Limit the display of selected options.
454
+ * The rest will be hidden within the limitText string.
455
+ */
456
+ limit: {
457
+ type: Number,
458
+ default: 1 / 0
459
+ },
460
+ /**
461
+ * Function that processes the message shown when selected elements pass the defined limit.
462
+ * @type {function(number): string}
463
+ */
464
+ limitText: {
465
+ type: Function,
466
+ default: function(t) {
467
+ return `and ${t} more`;
468
+ }
469
+ },
470
+ /**
471
+ * Text displayed when loading options.
472
+ */
473
+ loadingText: {
474
+ type: String,
475
+ default: "Loading..."
476
+ },
477
+ /**
478
+ * Used for dynamically loading options.
479
+ * @type {function({action: string, callback: (function((Error|string)=): void), parentNode: node=, instanceId}): void}
480
+ */
481
+ loadOptions: {
482
+ type: Function
483
+ },
484
+ /**
485
+ * Which node properties to filter on.
486
+ */
487
+ matchKeys: {
488
+ type: Array,
489
+ default: () => ["label"]
490
+ },
491
+ /**
492
+ * Sets `maxHeight` style value of the menu.
493
+ */
494
+ maxHeight: {
495
+ type: Number,
496
+ default: 300
497
+ },
498
+ /**
499
+ * Set `true` to allow selecting multiple options (a.k.a., multi-select mode).
500
+ */
501
+ multiple: {
502
+ type: Boolean,
503
+ default: !1
504
+ },
505
+ /**
506
+ * Generates a hidden <input /> tag with this field name for html forms.
507
+ */
508
+ name: {
509
+ type: String
510
+ },
511
+ /**
512
+ * Text displayed when a branch node has no children.
513
+ */
514
+ noChildrenText: {
515
+ type: String,
516
+ default: "No sub-options."
517
+ },
518
+ /**
519
+ * Text displayed when there are no available options.
520
+ */
521
+ noOptionsText: {
522
+ type: String,
523
+ default: "No options available."
524
+ },
525
+ /**
526
+ * Text displayed when there are no matching search results.
527
+ */
528
+ noResultsText: {
529
+ type: String,
530
+ default: "No results found..."
531
+ },
532
+ /**
533
+ * Used for normalizing source data.
534
+ * @type {function(node, instanceId): node}
535
+ */
536
+ normalizer: {
537
+ type: Function,
538
+ default: Qe
539
+ },
540
+ /**
541
+ * By default (`auto`), the menu will open below the control. If there is not
542
+ * enough space, vue-treeselect will automatically flip the menu.
543
+ * You can use one of other four options to force the menu to be always opened
544
+ * to specified direction.
545
+ * Acceptable values:
546
+ * - `"auto"`
547
+ * - `"below"`
548
+ * - `"bottom"`
549
+ * - `"above"`
550
+ * - `"top"`
551
+ */
552
+ openDirection: {
553
+ type: String,
554
+ default: "auto",
555
+ validator(e) {
556
+ return O(["auto", "top", "bottom", "above", "below"], e);
557
+ }
558
+ },
559
+ /**
560
+ * Whether to automatically open the menu when the control is clicked.
561
+ */
562
+ openOnClick: {
563
+ type: Boolean,
564
+ default: !0
565
+ },
566
+ /**
567
+ * Whether to automatically open the menu when the control is focused.
568
+ */
569
+ openOnFocus: {
570
+ type: Boolean,
571
+ default: !1
572
+ },
573
+ /**
574
+ * Array of available options.
575
+ * @type {node[]}
576
+ */
577
+ options: {
578
+ type: Array
579
+ },
580
+ /**
581
+ * Field placeholder, displayed when there's no value.
582
+ */
583
+ placeholder: {
584
+ type: String,
585
+ default: "Select..."
586
+ },
587
+ /**
588
+ * Applies HTML5 required attribute when needed.
589
+ */
590
+ required: {
591
+ type: Boolean,
592
+ default: !1
593
+ },
594
+ /**
595
+ * Text displayed asking user whether to retry loading children options.
596
+ */
597
+ retryText: {
598
+ type: String,
599
+ default: "Retry?"
600
+ },
601
+ /**
602
+ * Title for the retry button.
603
+ */
604
+ retryTitle: {
605
+ type: String,
606
+ default: "Click to retry"
607
+ },
608
+ /**
609
+ * Enable searching feature?
610
+ */
611
+ searchable: {
612
+ type: Boolean,
613
+ default: !0
614
+ },
615
+ /**
616
+ * Search in ancestor nodes too.
617
+ */
618
+ searchNested: {
619
+ type: Boolean,
620
+ default: !1
621
+ },
622
+ /**
623
+ * Text tip to prompt for async search.
624
+ */
625
+ searchPromptText: {
626
+ type: String,
627
+ default: "Type to search..."
628
+ },
629
+ /**
630
+ * Whether to show a children count next to the label of each branch node.
631
+ */
632
+ showCount: {
633
+ type: Boolean,
634
+ default: !1
635
+ },
636
+ /**
637
+ * Used in conjunction with `showCount` to specify which type of count number should be displayed.
638
+ * Acceptable values:
639
+ * - "ALL_CHILDREN"
640
+ * - "ALL_DESCENDANTS"
641
+ * - "LEAF_CHILDREN"
642
+ * - "LEAF_DESCENDANTS"
643
+ */
644
+ showCountOf: {
645
+ type: String,
646
+ default: $,
647
+ validator(e) {
648
+ return O([$, w, C, L], e);
649
+ }
650
+ },
651
+ /**
652
+ * Whether to show children count when searching.
653
+ * Fallbacks to the value of `showCount` when not specified.
654
+ * @type {boolean}
655
+ */
656
+ showCountOnSearch: null,
657
+ /**
658
+ * In which order the selected options should be displayed in trigger & sorted in `value` array.
659
+ * Used for multi-select mode only.
660
+ * Acceptable values:
661
+ * - "ORDER_SELECTED"
662
+ * - "LEVEL"
663
+ * - "INDEX"
664
+ */
665
+ sortValueBy: {
666
+ type: String,
667
+ default: ee,
668
+ validator(e) {
669
+ return O([ee, te, se], e);
670
+ }
671
+ },
672
+ /**
673
+ * Tab index of the control.
674
+ */
675
+ tabIndex: {
676
+ type: Number,
677
+ default: 0
678
+ },
679
+ /**
680
+ * The value of the control.
681
+ * Should be `id` or `node` object for single-select mode, or an array of `id` or `node` object for multi-select mode.
682
+ * Its format depends on the `valueFormat` prop.
683
+ * For most cases, just use `v-model` instead.
684
+ * @type {?Array}
685
+ */
686
+ value: null,
687
+ /**
688
+ * Which kind of nodes should be included in the `value` array in multi-select mode.
689
+ * Acceptable values:
690
+ * - "ALL" - Any node that is checked will be included in the `value` array
691
+ * - "BRANCH_PRIORITY" (default) - If a branch node is checked, all its descendants will be excluded in the `value` array
692
+ * - "LEAF_PRIORITY" - If a branch node is checked, this node itself and its branch descendants will be excluded from the `value` array but its leaf descendants will be included
693
+ * - "ALL_WITH_INDETERMINATE" - Any node that is checked will be included in the `value` array, plus indeterminate nodes
694
+ */
695
+ valueConsistsOf: {
696
+ type: String,
697
+ default: x,
698
+ validator(e) {
699
+ return O([B, x, z, F], e);
700
+ }
701
+ },
702
+ /**
703
+ * Format of `value` prop.
704
+ * Note that, when set to `"object"`, only `id` & `label` properties are required in each `node` object in `value` prop.
705
+ * Acceptable values:
706
+ * - "id"
707
+ * - "object"
708
+ */
709
+ valueFormat: {
710
+ type: String,
711
+ default: "id"
712
+ },
713
+ /**
714
+ * z-index of the menu.
715
+ */
716
+ zIndex: {
717
+ type: [Number, String],
718
+ default: 999
719
+ }
720
+ },
721
+ data() {
722
+ return {
723
+ trigger: {
724
+ // Is the control focused?
725
+ isFocused: !1,
726
+ // User entered search query - value of the input.
727
+ searchQuery: ""
728
+ },
729
+ menu: {
730
+ // Is the menu opened?
731
+ isOpen: !1,
732
+ // Id of current highlighted option.
733
+ current: null,
734
+ // The scroll position before last menu closing.
735
+ lastScrollPosition: 0,
736
+ // Which direction to open the menu.
737
+ placement: "bottom"
738
+ },
739
+ forest: {
740
+ // Normalized options.
741
+ normalizedOptions: [],
742
+ // <id, node> map for quick look-up.
743
+ nodeMap: g(),
744
+ // <id, checkedState> map, used for multi-select mode.
745
+ checkedStateMap: g(),
746
+ // Id list of all selected options.
747
+ selectedNodeIds: this.extractCheckedNodeIdsFromValue(),
748
+ // <id, true> map for fast checking:
749
+ // if (forest.selectedNodeIds.indexOf(id) !== -1) forest.selectedNodeMap[id] === true
750
+ selectedNodeMap: g()
751
+ },
752
+ // States of root options.
753
+ rootOptionsStates: k(),
754
+ localSearch: {
755
+ // Has user entered any query to search local options?
756
+ active: !1,
757
+ // Has any options matched the search query?
758
+ noResults: !0,
759
+ // <id, countObject> map for counting matched children/descendants.
760
+ countMap: g()
761
+ },
762
+ // <searchQuery, remoteSearchEntry> map.
763
+ remoteSearch: g()
764
+ };
765
+ },
766
+ computed: {
767
+ /* eslint-disable valid-jsdoc */
768
+ /**
769
+ * Normalized nodes that have been selected.
770
+ * @type {node[]}
771
+ */
772
+ selectedNodes() {
773
+ return this.forest.selectedNodeIds.map(this.getNode);
774
+ },
775
+ /**
776
+ * Id list of selected nodes with `sortValueBy` prop applied.
777
+ * @type {nodeId[]}
778
+ */
779
+ internalValue() {
780
+ let e;
781
+ if (this.single || this.flat || this.disableBranchNodes || this.valueConsistsOf === B)
782
+ e = this.forest.selectedNodeIds.slice();
783
+ else if (this.valueConsistsOf === x)
784
+ e = this.forest.selectedNodeIds.filter((t) => {
785
+ const s = this.getNode(t);
786
+ return s.isRootNode ? !0 : !this.isSelected(s.parentNode);
787
+ });
788
+ else if (this.valueConsistsOf === z)
789
+ e = this.forest.selectedNodeIds.filter((t) => {
790
+ const s = this.getNode(t);
791
+ return s.isLeaf ? !0 : s.children.length === 0;
792
+ });
793
+ else if (this.valueConsistsOf === F) {
794
+ const t = [];
795
+ e = this.forest.selectedNodeIds.slice(), this.selectedNodes.forEach((s) => {
796
+ s.ancestors.forEach((n) => {
797
+ O(t, n.id) || O(e, n.id) || t.push(n.id);
798
+ });
799
+ }), e.push(...t);
800
+ }
801
+ return this.sortValueBy === te ? e.sort((t, s) => ct(this.getNode(t), this.getNode(s))) : this.sortValueBy === se && e.sort((t, s) => xe(this.getNode(t), this.getNode(s))), e;
802
+ },
803
+ /**
804
+ * Has any option been selected?
805
+ * @type {boolean}
806
+ */
807
+ hasValue() {
808
+ return this.internalValue.length > 0;
809
+ },
810
+ /**
811
+ * Single-select mode?
812
+ * @type {boolean}
813
+ */
814
+ single() {
815
+ return !this.multiple;
816
+ },
817
+ /**
818
+ * Id list of nodes displayed in the menu. Nodes that are considered NOT visible:
819
+ * - descendants of a collapsed branch node
820
+ * - in local search mode, nodes that are not matched, unless
821
+ * - it's a branch node and has matched descendants
822
+ * - it's a leaf node and its parent node is explicitly set to show all children
823
+ * @type {id[]}
824
+ */
825
+ visibleOptionIds() {
826
+ const e = [];
827
+ return this.traverseAllNodesByIndex((t) => {
828
+ if ((!this.localSearch.active || this.shouldOptionBeIncludedInSearchResult(t)) && e.push(t.id), t.isBranch && !this.shouldExpand(t))
829
+ return !1;
830
+ }), e;
831
+ },
832
+ /**
833
+ * Has any option should be displayed in the menu?
834
+ * @type {boolean}
835
+ */
836
+ hasVisibleOptions() {
837
+ return this.visibleOptionIds.length !== 0;
838
+ },
839
+ /**
840
+ * Should show children count when searching?
841
+ * @type {boolean}
842
+ */
843
+ showCountOnSearchComputed() {
844
+ return typeof this.showCountOnSearch == "boolean" ? this.showCountOnSearch : this.showCount;
845
+ },
846
+ /**
847
+ * Is there any branch node?
848
+ * @type {boolean}
849
+ */
850
+ hasBranchNodes() {
851
+ return this.forest.normalizedOptions.some((e) => e.isBranch);
852
+ },
853
+ shouldFlattenOptions() {
854
+ return this.localSearch.active && this.flattenSearchResults;
855
+ }
856
+ /* eslint-enable valid-jsdoc */
857
+ },
858
+ watch: {
859
+ alwaysOpen(e) {
860
+ e ? this.openMenu() : this.closeMenu();
861
+ },
862
+ branchNodesFirst() {
863
+ this.initialize();
864
+ },
865
+ disabled(e) {
866
+ e && this.menu.isOpen ? this.closeMenu() : !e && !this.menu.isOpen && this.alwaysOpen && this.openMenu();
867
+ },
868
+ flat() {
869
+ this.initialize();
870
+ },
871
+ internalValue(e, t) {
872
+ V(e, t) && this.$emit("input", this.getValue(), this.getInstanceId());
873
+ },
874
+ matchKeys() {
875
+ this.initialize();
876
+ },
877
+ multiple(e) {
878
+ e && this.buildForestState();
879
+ },
880
+ options: {
881
+ handler() {
882
+ this.async || (this.initialize(), this.rootOptionsStates.isLoaded = Array.isArray(this.options));
883
+ },
884
+ deep: !0,
885
+ immediate: !0
886
+ },
887
+ "trigger.searchQuery"() {
888
+ this.async ? this.handleRemoteSearch() : this.handleLocalSearch(), this.$emit("search-change", this.trigger.searchQuery, this.getInstanceId());
889
+ },
890
+ value() {
891
+ const e = this.extractCheckedNodeIdsFromValue();
892
+ V(e, this.internalValue) && this.fixSelectedNodeIds(e);
893
+ }
894
+ },
895
+ methods: {
896
+ verifyProps() {
897
+ S(
898
+ () => this.async ? this.searchable : !0,
899
+ () => 'For async search mode, the value of "searchable" prop must be true.'
900
+ ), this.options == null && !this.loadOptions && S(
901
+ () => !1,
902
+ () => 'Are you meant to dynamically load options? You need to use "loadOptions" prop.'
903
+ ), this.flat && S(
904
+ () => this.multiple,
905
+ () => 'You are using flat mode. But you forgot to add "multiple=true"?'
906
+ ), this.flat || [
907
+ "autoSelectAncestors",
908
+ "autoSelectDescendants",
909
+ "autoDeselectAncestors",
910
+ "autoDeselectDescendants"
911
+ ].forEach((t) => {
912
+ S(
913
+ () => !this[t],
914
+ () => `"${t}" only applies to flat mode.`
915
+ );
916
+ });
917
+ },
918
+ resetFlags() {
919
+ this._blurOnSelect = !1;
920
+ },
921
+ initialize() {
922
+ const e = this.async ? this.getRemoteSearchEntry().options : this.options;
923
+ if (Array.isArray(e)) {
924
+ const t = this.forest.nodeMap;
925
+ this.forest.nodeMap = g(), this.keepDataOfSelectedNodes(t), this.forest.normalizedOptions = this.normalize(E, e, t), this.fixSelectedNodeIds(this.internalValue);
926
+ } else
927
+ this.forest.normalizedOptions = [];
928
+ },
929
+ getInstanceId() {
930
+ return this.instanceId == null ? this.id : this.instanceId;
931
+ },
932
+ getValue() {
933
+ if (this.valueFormat === "id")
934
+ return this.multiple ? this.internalValue.slice() : this.internalValue[0];
935
+ const e = this.internalValue.map((t) => this.getNode(t).raw);
936
+ return this.multiple ? e : e[0];
937
+ },
938
+ getNode(e) {
939
+ return S(
940
+ () => e != null,
941
+ () => `Invalid node id: ${e}`
942
+ ), e == null ? null : e in this.forest.nodeMap ? this.forest.nodeMap[e] : this.createFallbackNode(e);
943
+ },
944
+ createFallbackNode(e) {
945
+ const t = this.extractNodeFromValue(e), s = this.enhancedNormalizer(t).label || `${e} (unknown)`, n = {
946
+ id: e,
947
+ label: s,
948
+ ancestors: [],
949
+ parentNode: E,
950
+ isFallbackNode: !0,
951
+ isRootNode: !0,
952
+ isLeaf: !0,
953
+ isBranch: !1,
954
+ isDisabled: !1,
955
+ isNew: !1,
956
+ index: [-1],
957
+ level: 0,
958
+ raw: t
959
+ };
960
+ return this.$set(this.forest.nodeMap, e, n);
961
+ },
962
+ extractCheckedNodeIdsFromValue() {
963
+ return this.value == null ? [] : this.valueFormat === "id" ? this.multiple ? this.value.slice() : [this.value] : (this.multiple ? this.value : [this.value]).map((e) => this.enhancedNormalizer(e)).map((e) => e.id);
964
+ },
965
+ extractNodeFromValue(e) {
966
+ const t = { id: e };
967
+ if (this.valueFormat === "id")
968
+ return t;
969
+ const s = this.multiple ? Array.isArray(this.value) ? this.value : [] : this.value ? [this.value] : [];
970
+ return Ce(
971
+ s,
972
+ (i) => i && this.enhancedNormalizer(i).id === e
973
+ ) || t;
974
+ },
975
+ fixSelectedNodeIds(e) {
976
+ let t = [];
977
+ if (this.single || this.flat || this.disableBranchNodes || this.valueConsistsOf === B)
978
+ t = e;
979
+ else if (this.valueConsistsOf === x)
980
+ e.forEach((n) => {
981
+ t.push(n);
982
+ const i = this.getNode(n);
983
+ i.isBranch && this.traverseDescendantsBFS(i, (o) => {
984
+ t.push(o.id);
985
+ });
986
+ });
987
+ else if (this.valueConsistsOf === z) {
988
+ const n = g(), i = e.slice();
989
+ for (; i.length; ) {
990
+ const o = i.shift(), r = this.getNode(o);
991
+ t.push(o), !r.isRootNode && (r.parentNode.id in n || (n[r.parentNode.id] = r.parentNode.children.length), --n[r.parentNode.id] === 0 && i.push(r.parentNode.id));
992
+ }
993
+ } else if (this.valueConsistsOf === F) {
994
+ const n = g(), i = e.filter((o) => {
995
+ const r = this.getNode(o);
996
+ return r.isLeaf || r.children.length === 0;
997
+ });
998
+ for (; i.length; ) {
999
+ const o = i.shift(), r = this.getNode(o);
1000
+ t.push(o), !r.isRootNode && (r.parentNode.id in n || (n[r.parentNode.id] = r.parentNode.children.length), --n[r.parentNode.id] === 0 && i.push(r.parentNode.id));
1001
+ }
1002
+ }
1003
+ V(this.forest.selectedNodeIds, t) && (this.forest.selectedNodeIds = t), this.buildForestState();
1004
+ },
1005
+ keepDataOfSelectedNodes(e) {
1006
+ this.forest.selectedNodeIds.forEach((t) => {
1007
+ if (!e[t])
1008
+ return;
1009
+ const s = b(_({}, e[t]), {
1010
+ isFallbackNode: !0
1011
+ });
1012
+ this.$set(this.forest.nodeMap, t, s);
1013
+ });
1014
+ },
1015
+ isSelected(e) {
1016
+ return this.forest.selectedNodeMap[e.id] === !0;
1017
+ },
1018
+ traverseDescendantsBFS(e, t) {
1019
+ if (!e.isBranch)
1020
+ return;
1021
+ const s = e.children.slice();
1022
+ for (; s.length; ) {
1023
+ const n = s[0];
1024
+ n.isBranch && s.push(...n.children), t(n), s.shift();
1025
+ }
1026
+ },
1027
+ traverseDescendantsDFS(e, t) {
1028
+ e.isBranch && e.children.forEach((s) => {
1029
+ this.traverseDescendantsDFS(s, t), t(s);
1030
+ });
1031
+ },
1032
+ traverseAllNodesDFS(e) {
1033
+ this.forest.normalizedOptions.forEach((t) => {
1034
+ this.traverseDescendantsDFS(t, e), e(t);
1035
+ });
1036
+ },
1037
+ traverseAllNodesByIndex(e) {
1038
+ const t = (s) => {
1039
+ s.children.forEach((n) => {
1040
+ e(n) !== !1 && n.isBranch && t(n);
1041
+ });
1042
+ };
1043
+ t({ children: this.forest.normalizedOptions });
1044
+ },
1045
+ toggleClickOutsideEvent(e) {
1046
+ e ? document.addEventListener("mousedown", this.handleClickOutside, !1) : document.removeEventListener("mousedown", this.handleClickOutside, !1);
1047
+ },
1048
+ getValueContainer() {
1049
+ return this.$refs.control.$refs["value-container"];
1050
+ },
1051
+ getInput() {
1052
+ return this.getValueContainer().$refs.input;
1053
+ },
1054
+ focusInput() {
1055
+ this.getInput().focus();
1056
+ },
1057
+ blurInput() {
1058
+ this.getInput().blur();
1059
+ },
1060
+ handleMouseDown: N(function(t) {
1061
+ if (t.preventDefault(), t.stopPropagation(), this.disabled)
1062
+ return;
1063
+ this.getValueContainer().$el.contains(t.target) && !this.menu.isOpen && (this.openOnClick || this.trigger.isFocused) && this.openMenu(), this._blurOnSelect ? this.blurInput() : this.focusInput(), this.resetFlags();
1064
+ }),
1065
+ handleClickOutside(e) {
1066
+ this.$refs.wrapper && !this.$refs.wrapper.contains(e.target) && (this.blurInput(), this.closeMenu());
1067
+ },
1068
+ handleLocalSearch() {
1069
+ const { searchQuery: e } = this.trigger, t = () => this.resetHighlightedOptionWhenNecessary(!0);
1070
+ if (!e)
1071
+ return this.localSearch.active = !1, t();
1072
+ this.localSearch.active = !0, this.localSearch.noResults = !0, this.traverseAllNodesDFS((i) => {
1073
+ i.isBranch && (i.isExpandedOnSearch = !1, i.showAllChildrenOnSearch = !1, i.isMatched = !1, i.hasMatchedDescendants = !1, this.$set(this.localSearch.countMap, i.id, {
1074
+ [$]: 0,
1075
+ [w]: 0,
1076
+ [C]: 0,
1077
+ [L]: 0
1078
+ }));
1079
+ });
1080
+ const s = e.trim().toLocaleLowerCase(), n = s.replace(/\s+/g, " ").split(" ");
1081
+ this.traverseAllNodesDFS((i) => {
1082
+ this.searchNested && n.length > 1 ? i.isMatched = n.every(
1083
+ (o) => re(!1, o, i.nestedSearchLabel)
1084
+ ) : i.isMatched = this.matchKeys.some(
1085
+ (o) => re(!this.disableFuzzyMatching, s, i.lowerCased[o])
1086
+ ), i.isMatched && (this.localSearch.noResults = !1, i.ancestors.forEach((o) => this.localSearch.countMap[o.id][w]++), i.isLeaf && i.ancestors.forEach((o) => this.localSearch.countMap[o.id][L]++), i.parentNode !== E && (this.localSearch.countMap[i.parentNode.id][$] += 1, i.isLeaf && (this.localSearch.countMap[i.parentNode.id][C] += 1))), (i.isMatched || i.isBranch && i.isExpandedOnSearch) && i.parentNode !== E && (i.parentNode.isExpandedOnSearch = !0, i.parentNode.hasMatchedDescendants = !0);
1087
+ }), t();
1088
+ },
1089
+ handleRemoteSearch() {
1090
+ const { searchQuery: e } = this.trigger, t = this.getRemoteSearchEntry(), s = () => {
1091
+ this.initialize(), this.resetHighlightedOptionWhenNecessary(!0);
1092
+ };
1093
+ if ((e === "" || this.cacheOptions) && t.isLoaded)
1094
+ return s();
1095
+ this.callLoadOptionsProp({
1096
+ action: lt,
1097
+ args: { searchQuery: e },
1098
+ isPending() {
1099
+ return t.isLoading;
1100
+ },
1101
+ start: () => {
1102
+ t.isLoading = !0, t.isLoaded = !1, t.loadingError = "";
1103
+ },
1104
+ succeed: (n) => {
1105
+ t.isLoaded = !0, t.options = n, this.trigger.searchQuery === e && s();
1106
+ },
1107
+ fail: (n) => {
1108
+ t.loadingError = H(n);
1109
+ },
1110
+ end: () => {
1111
+ t.isLoading = !1;
1112
+ }
1113
+ });
1114
+ },
1115
+ getRemoteSearchEntry() {
1116
+ const { searchQuery: e } = this.trigger, t = this.remoteSearch[e] || b(_({}, k()), {
1117
+ options: []
1118
+ });
1119
+ if (this.$watch(
1120
+ () => t.options,
1121
+ () => {
1122
+ this.trigger.searchQuery === e && this.initialize();
1123
+ },
1124
+ { deep: !0 }
1125
+ ), e === "") {
1126
+ if (Array.isArray(this.defaultOptions))
1127
+ return t.options = this.defaultOptions, t.isLoaded = !0, t;
1128
+ if (this.defaultOptions !== !0)
1129
+ return t.isLoaded = !0, t;
1130
+ }
1131
+ return this.remoteSearch[e] || this.$set(this.remoteSearch, e, t), t;
1132
+ },
1133
+ shouldExpand(e) {
1134
+ return this.localSearch.active ? e.isExpandedOnSearch : e.isExpanded;
1135
+ },
1136
+ shouldOptionBeIncludedInSearchResult(e) {
1137
+ return !!(e.isMatched || e.isBranch && e.hasMatchedDescendants && !this.flattenSearchResults || !e.isRootNode && e.parentNode.showAllChildrenOnSearch);
1138
+ },
1139
+ shouldShowOptionInMenu(e) {
1140
+ return !(this.localSearch.active && !this.shouldOptionBeIncludedInSearchResult(e));
1141
+ },
1142
+ getControl() {
1143
+ return this.$refs.control.$el;
1144
+ },
1145
+ getMenu() {
1146
+ const t = (this.appendToBody ? this.$refs.portal.portalTarget : this).$refs.menu.$refs.menu;
1147
+ return t && t.nodeName !== "#comment" ? t : null;
1148
+ },
1149
+ setCurrentHighlightedOption(e, t = !0) {
1150
+ const s = this.menu.current;
1151
+ if (s != null && s in this.forest.nodeMap && (this.forest.nodeMap[s].isHighlighted = !1), this.menu.current = e.id, e.isHighlighted = !0, this.menu.isOpen && t) {
1152
+ const n = () => {
1153
+ const i = this.getMenu(), o = i.querySelector(`.vue-treeselect__option[data-id="${e.id}"]`);
1154
+ o && Ye(i, o);
1155
+ };
1156
+ this.getMenu() ? n() : this.$nextTick(n);
1157
+ }
1158
+ },
1159
+ resetHighlightedOptionWhenNecessary(e = !1) {
1160
+ const { current: t } = this.menu;
1161
+ (e || t == null || !(t in this.forest.nodeMap) || !this.shouldShowOptionInMenu(this.getNode(t))) && this.highlightFirstOption();
1162
+ },
1163
+ highlightFirstOption() {
1164
+ if (!this.hasVisibleOptions)
1165
+ return;
1166
+ const e = this.visibleOptionIds[0];
1167
+ this.setCurrentHighlightedOption(this.getNode(e));
1168
+ },
1169
+ highlightPrevOption() {
1170
+ if (!this.hasVisibleOptions)
1171
+ return;
1172
+ const e = this.visibleOptionIds.indexOf(this.menu.current) - 1;
1173
+ if (e === -1)
1174
+ return this.highlightLastOption();
1175
+ this.setCurrentHighlightedOption(this.getNode(this.visibleOptionIds[e]));
1176
+ },
1177
+ highlightNextOption() {
1178
+ if (!this.hasVisibleOptions)
1179
+ return;
1180
+ const e = this.visibleOptionIds.indexOf(this.menu.current) + 1;
1181
+ if (e === this.visibleOptionIds.length)
1182
+ return this.highlightFirstOption();
1183
+ this.setCurrentHighlightedOption(this.getNode(this.visibleOptionIds[e]));
1184
+ },
1185
+ highlightLastOption() {
1186
+ if (!this.hasVisibleOptions)
1187
+ return;
1188
+ const e = Z(this.visibleOptionIds);
1189
+ this.setCurrentHighlightedOption(this.getNode(e));
1190
+ },
1191
+ resetSearchQuery() {
1192
+ this.trigger.searchQuery = "";
1193
+ },
1194
+ closeMenu() {
1195
+ !this.menu.isOpen || !this.disabled && this.alwaysOpen || (this.saveMenuScrollPosition(), this.menu.isOpen = !1, this.toggleClickOutsideEvent(!1), this.resetSearchQuery(), this.$emit("close", this.getValue(), this.getInstanceId()));
1196
+ },
1197
+ openMenu() {
1198
+ this.disabled || this.menu.isOpen || (this.menu.isOpen = !0, this.$nextTick(this.resetHighlightedOptionWhenNecessary), this.$nextTick(this.restoreMenuScrollPosition), !this.options && !this.async && this.loadRootOptions(), this.toggleClickOutsideEvent(!0), this.$emit("open", this.getInstanceId()));
1199
+ },
1200
+ toggleMenu() {
1201
+ this.menu.isOpen ? this.closeMenu() : this.openMenu();
1202
+ },
1203
+ toggleExpanded(e) {
1204
+ let t;
1205
+ this.localSearch.active ? (t = e.isExpandedOnSearch = !e.isExpandedOnSearch, t && (e.showAllChildrenOnSearch = !0)) : t = e.isExpanded = !e.isExpanded, t && !e.childrenStates.isLoaded && this.loadChildrenOptions(e);
1206
+ },
1207
+ buildForestState() {
1208
+ const e = g();
1209
+ this.forest.selectedNodeIds.forEach((s) => {
1210
+ e[s] = !0;
1211
+ }), this.forest.selectedNodeMap = e;
1212
+ const t = g();
1213
+ this.multiple && (this.traverseAllNodesByIndex((s) => {
1214
+ t[s.id] = U;
1215
+ }), this.selectedNodes.forEach((s) => {
1216
+ t[s.id] = Me, !this.flat && !this.disableBranchNodes && s.ancestors.forEach((n) => {
1217
+ this.isSelected(n) || (t[n.id] = Le);
1218
+ });
1219
+ })), this.forest.checkedStateMap = t;
1220
+ },
1221
+ enhancedNormalizer(e) {
1222
+ return _(_({}, e), this.normalizer(e, this.getInstanceId()));
1223
+ },
1224
+ normalize(e, t, s) {
1225
+ let n = t.map((i) => [this.enhancedNormalizer(i), i]).map(([i, o], r) => {
1226
+ this.checkDuplication(i), this.verifyNodeShape(i);
1227
+ const { id: c, label: d, children: a, isDefaultExpanded: m } = i, p = e === E, y = p ? 0 : e.level + 1, R = Array.isArray(a) || a === null, I = !R, X = !!i.isDisabled || !this.flat && !p && e.isDisabled, Be = !!i.isNew, A = this.matchKeys.reduce((u, M) => b(_({}, u), {
1228
+ [M]: ut(i[M]).toLocaleLowerCase()
1229
+ }), {}), ze = p ? A.label : `${e.nestedSearchLabel} ${A.label}`, l = this.$set(this.forest.nodeMap, c, g());
1230
+ if (this.$set(l, "id", c), this.$set(l, "label", d), this.$set(l, "level", y), this.$set(l, "ancestors", p ? [] : [e].concat(e.ancestors)), this.$set(l, "index", (p ? [] : e.index).concat(r)), this.$set(l, "parentNode", e), this.$set(l, "lowerCased", A), this.$set(l, "nestedSearchLabel", ze), this.$set(l, "isDisabled", X), this.$set(l, "isNew", Be), this.$set(l, "isMatched", !1), this.$set(l, "isHighlighted", !1), this.$set(l, "isBranch", R), this.$set(l, "isLeaf", I), this.$set(l, "isRootNode", p), this.$set(l, "raw", o), R) {
1231
+ const u = Array.isArray(a);
1232
+ this.$set(l, "childrenStates", b(_({}, k()), {
1233
+ isLoaded: u
1234
+ })), this.$set(l, "isExpanded", typeof m == "boolean" ? m : y < this.defaultExpandLevel), this.$set(l, "hasMatchedDescendants", !1), this.$set(l, "hasDisabledDescendants", !1), this.$set(l, "isExpandedOnSearch", !1), this.$set(l, "showAllChildrenOnSearch", !1), this.$set(l, "count", {
1235
+ [$]: 0,
1236
+ [w]: 0,
1237
+ [C]: 0,
1238
+ [L]: 0
1239
+ }), this.$set(l, "children", u ? this.normalize(l, a, s) : []), m === !0 && l.ancestors.forEach((M) => {
1240
+ M.isExpanded = !0;
1241
+ }), !u && typeof this.loadOptions != "function" ? S(
1242
+ () => !1,
1243
+ () => 'Unloaded branch node detected. "loadOptions" prop is required to load its children.'
1244
+ ) : !u && l.isExpanded && this.loadChildrenOptions(l);
1245
+ }
1246
+ if (l.ancestors.forEach((u) => u.count[w]++), I && l.ancestors.forEach((u) => u.count[L]++), p || (e.count[$] += 1, I && (e.count[C] += 1), X && (e.hasDisabledDescendants = !0)), s && s[c]) {
1247
+ const u = s[c];
1248
+ l.isMatched = u.isMatched, l.showAllChildrenOnSearch = u.showAllChildrenOnSearch, l.isHighlighted = u.isHighlighted, u.isBranch && l.isBranch && (l.isExpanded = u.isExpanded, l.isExpandedOnSearch = u.isExpandedOnSearch, u.childrenStates.isLoaded && !l.childrenStates.isLoaded ? l.isExpanded = !1 : l.childrenStates = _({}, u.childrenStates));
1249
+ }
1250
+ return l;
1251
+ });
1252
+ if (this.branchNodesFirst) {
1253
+ const i = n.filter((r) => r.isBranch), o = n.filter((r) => r.isLeaf);
1254
+ n = i.concat(o);
1255
+ }
1256
+ return n;
1257
+ },
1258
+ loadRootOptions() {
1259
+ this.callLoadOptionsProp({
1260
+ action: rt,
1261
+ isPending: () => this.rootOptionsStates.isLoading,
1262
+ start: () => {
1263
+ this.rootOptionsStates.isLoading = !0, this.rootOptionsStates.loadingError = "";
1264
+ },
1265
+ succeed: () => {
1266
+ this.rootOptionsStates.isLoaded = !0, this.$nextTick(() => {
1267
+ this.resetHighlightedOptionWhenNecessary(!0);
1268
+ });
1269
+ },
1270
+ fail: (e) => {
1271
+ this.rootOptionsStates.loadingError = H(e);
1272
+ },
1273
+ end: () => {
1274
+ this.rootOptionsStates.isLoading = !1;
1275
+ }
1276
+ });
1277
+ },
1278
+ loadChildrenOptions(e) {
1279
+ const { id: t, raw: s } = e;
1280
+ this.callLoadOptionsProp({
1281
+ action: ot,
1282
+ args: {
1283
+ // We always pass the raw node instead of the normalized node to any
1284
+ // callback provided by the user of this component.
1285
+ // Because the shape of the raw node is more likely to be closing to
1286
+ // what the back-end API service of the application needs.
1287
+ parentNode: s
1288
+ },
1289
+ isPending: () => this.getNode(t).childrenStates.isLoading,
1290
+ start: () => {
1291
+ this.getNode(t).childrenStates.isLoading = !0, this.getNode(t).childrenStates.loadingError = "";
1292
+ },
1293
+ succeed: () => {
1294
+ this.getNode(t).childrenStates.isLoaded = !0;
1295
+ },
1296
+ fail: (n) => {
1297
+ this.getNode(t).childrenStates.loadingError = H(n);
1298
+ },
1299
+ end: () => {
1300
+ this.getNode(t).childrenStates.isLoading = !1;
1301
+ }
1302
+ });
1303
+ },
1304
+ callLoadOptionsProp({ action: e, args: t, isPending: s, start: n, succeed: i, fail: o, end: r }) {
1305
+ if (!this.loadOptions || s())
1306
+ return;
1307
+ n();
1308
+ const c = Ke((a, m) => {
1309
+ a ? o(a) : i(m), r();
1310
+ }), d = this.loadOptions(b(_({
1311
+ id: this.getInstanceId(),
1312
+ instanceId: this.getInstanceId(),
1313
+ action: e
1314
+ }, t), {
1315
+ callback: c
1316
+ }));
1317
+ Oe(d) && d.then(() => {
1318
+ c();
1319
+ }, (a) => {
1320
+ c(a);
1321
+ }).catch((a) => {
1322
+ console.error(a);
1323
+ });
1324
+ },
1325
+ checkDuplication(e) {
1326
+ S(
1327
+ () => !(e.id in this.forest.nodeMap && !this.forest.nodeMap[e.id].isFallbackNode),
1328
+ () => `Detected duplicate presence of node id ${JSON.stringify(e.id)}. Their labels are "${this.forest.nodeMap[e.id].label}" and "${e.label}" respectively.`
1329
+ );
1330
+ },
1331
+ verifyNodeShape(e) {
1332
+ S(
1333
+ () => !(e.children === void 0 && e.isBranch === !0),
1334
+ () => "Are you meant to declare an unloaded branch node? `isBranch: true` is no longer supported, please use `children: null` instead."
1335
+ );
1336
+ },
1337
+ select(e) {
1338
+ if (this.disabled || e.isDisabled)
1339
+ return;
1340
+ this.single && this.clear();
1341
+ const t = this.multiple && !this.flat ? this.forest.checkedStateMap[e.id] === U : !this.isSelected(e);
1342
+ t ? this._selectNode(e) : this._deselectNode(e), this.buildForestState(), t ? this.$emit("select", e.raw, this.getInstanceId()) : this.$emit("deselect", e.raw, this.getInstanceId()), this.localSearch.active && t && (this.single || this.clearOnSelect) && this.resetSearchQuery(), this.single && this.closeOnSelect && (this.closeMenu(), this.searchable && (this._blurOnSelect = !0));
1343
+ },
1344
+ clear() {
1345
+ this.hasValue && (this.single || this.allowClearingDisabled ? this.forest.selectedNodeIds = [] : this.forest.selectedNodeIds = this.forest.selectedNodeIds.filter(
1346
+ (e) => this.getNode(e).isDisabled
1347
+ ), this.buildForestState());
1348
+ },
1349
+ // This is meant to be called only by `select()`.
1350
+ _selectNode(e) {
1351
+ if (this.single || this.disableBranchNodes)
1352
+ return this.addValue(e);
1353
+ if (this.flat) {
1354
+ this.addValue(e), this.autoSelectAncestors ? e.ancestors.forEach((s) => {
1355
+ !this.isSelected(s) && !s.isDisabled && this.addValue(s);
1356
+ }) : this.autoSelectDescendants && this.traverseDescendantsBFS(e, (s) => {
1357
+ !this.isSelected(s) && !s.isDisabled && this.addValue(s);
1358
+ });
1359
+ return;
1360
+ }
1361
+ const t = e.isLeaf || /* node.isBranch && */
1362
+ !e.hasDisabledDescendants || /* node.isBranch && */
1363
+ this.allowSelectingDisabledDescendants;
1364
+ if (t && this.addValue(e), e.isBranch && this.traverseDescendantsBFS(e, (s) => {
1365
+ (!s.isDisabled || this.allowSelectingDisabledDescendants) && this.addValue(s);
1366
+ }), t) {
1367
+ let s = e;
1368
+ for (; (s = s.parentNode) !== E && s.children.every(this.isSelected); )
1369
+ this.addValue(s);
1370
+ }
1371
+ },
1372
+ // This is meant to be called only by `select()`.
1373
+ _deselectNode(e) {
1374
+ if (this.disableBranchNodes)
1375
+ return this.removeValue(e);
1376
+ if (this.flat) {
1377
+ this.removeValue(e), this.autoDeselectAncestors ? e.ancestors.forEach((s) => {
1378
+ this.isSelected(s) && !s.isDisabled && this.removeValue(s);
1379
+ }) : this.autoDeselectDescendants && this.traverseDescendantsBFS(e, (s) => {
1380
+ this.isSelected(s) && !s.isDisabled && this.removeValue(s);
1381
+ });
1382
+ return;
1383
+ }
1384
+ let t = !1;
1385
+ if (e.isBranch && this.traverseDescendantsDFS(e, (s) => {
1386
+ (!s.isDisabled || this.allowSelectingDisabledDescendants) && (this.removeValue(s), t = !0);
1387
+ }), e.isLeaf || /* node.isBranch && */
1388
+ t || /* node.isBranch && */
1389
+ e.children.length === 0) {
1390
+ this.removeValue(e);
1391
+ let s = e;
1392
+ for (; (s = s.parentNode) !== E && this.isSelected(s); )
1393
+ this.removeValue(s);
1394
+ }
1395
+ },
1396
+ addValue(e) {
1397
+ this.forest.selectedNodeIds.push(e.id), this.forest.selectedNodeMap[e.id] = !0;
1398
+ },
1399
+ removeValue(e) {
1400
+ ye(this.forest.selectedNodeIds, e.id), delete this.forest.selectedNodeMap[e.id];
1401
+ },
1402
+ removeLastValue() {
1403
+ if (!this.hasValue)
1404
+ return;
1405
+ if (this.single)
1406
+ return this.clear();
1407
+ const e = Z(this.internalValue), t = this.getNode(e);
1408
+ this.select(t);
1409
+ },
1410
+ saveMenuScrollPosition() {
1411
+ const e = this.getMenu();
1412
+ e && (this.menu.lastScrollPosition = e.scrollTop);
1413
+ },
1414
+ restoreMenuScrollPosition() {
1415
+ const e = this.getMenu();
1416
+ e && (e.scrollTop = this.menu.lastScrollPosition);
1417
+ }
1418
+ },
1419
+ created() {
1420
+ this.verifyProps(), this.resetFlags();
1421
+ },
1422
+ mounted() {
1423
+ this.autoFocus && this.focusInput(), !this.options && !this.async && this.autoLoadRootOptions && this.loadRootOptions(), this.alwaysOpen && this.openMenu(), this.async && this.defaultOptions && this.handleRemoteSearch();
1424
+ },
1425
+ destroyed() {
1426
+ this.toggleClickOutsideEvent(!1);
1427
+ }
1428
+ };
1429
+ function pt(e) {
1430
+ return typeof e == "string" ? e : e != null && !$e(e) ? JSON.stringify(e) : "";
1431
+ }
1432
+ const ft = {
1433
+ name: "VueTreeSelectHiddenFields",
1434
+ functional: !0,
1435
+ inject: ["instance"],
1436
+ render(e, t) {
1437
+ const s = arguments[0], {
1438
+ instance: n
1439
+ } = t.injections;
1440
+ if (!n.name || n.disabled || !n.hasValue)
1441
+ return null;
1442
+ let i = n.internalValue.map(pt);
1443
+ return n.multiple && n.joinValues && (i = [i.join(n.delimiter)]), i.map((o, r) => s("input", {
1444
+ attrs: {
1445
+ type: "hidden",
1446
+ name: n.name
1447
+ },
1448
+ domProps: {
1449
+ value: o
1450
+ },
1451
+ key: `hidden-field-${r}`
1452
+ }));
1453
+ }
1454
+ };
1455
+ let mt, gt;
1456
+ const oe = {};
1457
+ var _t = /* @__PURE__ */ f(
1458
+ ft,
1459
+ mt,
1460
+ gt,
1461
+ !1,
1462
+ vt,
1463
+ null,
1464
+ null,
1465
+ null
1466
+ );
1467
+ function vt(e) {
1468
+ for (let t in oe)
1469
+ this[t] = oe[t];
1470
+ }
1471
+ const St = /* @__PURE__ */ function() {
1472
+ return _t.exports;
1473
+ }();
1474
+ function Ot(e) {
1475
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
1476
+ }
1477
+ function Y() {
1478
+ return Y = Object.assign ? Object.assign.bind() : function(e) {
1479
+ for (var t, s = 1; s < arguments.length; s++)
1480
+ for (var n in t = arguments[s], t)
1481
+ Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
1482
+ return e;
1483
+ }, Y.apply(this, arguments);
1484
+ }
1485
+ var yt = ["attrs", "props", "domProps"], Et = ["class", "style", "directives"], Nt = ["on", "nativeOn"], bt = function(e) {
1486
+ return e.reduce(function(t, s) {
1487
+ for (var n in s)
1488
+ if (!t[n])
1489
+ t[n] = s[n];
1490
+ else if (yt.indexOf(n) !== -1)
1491
+ t[n] = Y({}, t[n], s[n]);
1492
+ else if (Et.indexOf(n) !== -1) {
1493
+ var i = t[n] instanceof Array ? t[n] : [t[n]], o = s[n] instanceof Array ? s[n] : [s[n]];
1494
+ t[n] = [].concat(i, o);
1495
+ } else if (Nt.indexOf(n) !== -1)
1496
+ for (var r in s[n])
1497
+ if (t[n][r]) {
1498
+ var c = t[n][r] instanceof Array ? t[n][r] : [t[n][r]], d = s[n][r] instanceof Array ? s[n][r] : [s[n][r]];
1499
+ t[n][r] = [].concat(c, d);
1500
+ } else
1501
+ t[n][r] = s[n][r];
1502
+ else if (n === "hook")
1503
+ for (var a in s[n])
1504
+ t[n][a] = t[n][a] ? $t(t[n][a], s[n][a]) : s[n][a];
1505
+ else
1506
+ t[n] = s[n];
1507
+ return t;
1508
+ }, {});
1509
+ }, $t = function(e, t) {
1510
+ return function() {
1511
+ e && e.apply(this, arguments), t && t.apply(this, arguments);
1512
+ };
1513
+ }, wt = bt;
1514
+ const D = /* @__PURE__ */ Ot(wt), Ct = [h.ENTER, h.END, h.HOME, h.ARROW_LEFT, h.ARROW_UP, h.ARROW_RIGHT, h.ARROW_DOWN], Lt = {
1515
+ name: "VueTreeSelectInput",
1516
+ inject: ["instance"],
1517
+ data: () => ({
1518
+ inputWidth: ne,
1519
+ value: ""
1520
+ }),
1521
+ computed: {
1522
+ needAutoSize() {
1523
+ const {
1524
+ instance: e
1525
+ } = this;
1526
+ return e.searchable && !e.disabled && e.multiple;
1527
+ },
1528
+ inputStyle() {
1529
+ return {
1530
+ width: this.needAutoSize ? `${this.inputWidth}px` : null
1531
+ };
1532
+ }
1533
+ },
1534
+ watch: {
1535
+ "instance.trigger.searchQuery"(e) {
1536
+ this.value = e;
1537
+ },
1538
+ value() {
1539
+ this.needAutoSize && this.$nextTick(this.updateInputWidth);
1540
+ }
1541
+ },
1542
+ created() {
1543
+ this.debouncedCallback = qe(this.updateSearchQuery, at, {
1544
+ leading: !0,
1545
+ trailing: !0
1546
+ });
1547
+ },
1548
+ methods: {
1549
+ clear() {
1550
+ this.onInput({
1551
+ target: {
1552
+ value: ""
1553
+ }
1554
+ });
1555
+ },
1556
+ focus() {
1557
+ const {
1558
+ instance: e
1559
+ } = this;
1560
+ e.disabled || this.$refs.input && this.$refs.input.focus();
1561
+ },
1562
+ blur() {
1563
+ this.$refs.input && this.$refs.input.blur();
1564
+ },
1565
+ onFocus() {
1566
+ const {
1567
+ instance: e
1568
+ } = this;
1569
+ e.trigger.isFocused = !0, e.openOnFocus && e.openMenu();
1570
+ },
1571
+ onBlur() {
1572
+ const {
1573
+ instance: e
1574
+ } = this, t = e.getMenu();
1575
+ if (t && document.activeElement === t)
1576
+ return this.focus();
1577
+ e.trigger.isFocused = !1, e.closeMenu();
1578
+ },
1579
+ onInput(e) {
1580
+ const {
1581
+ value: t
1582
+ } = e.target;
1583
+ this.value = t, t ? this.debouncedCallback() : (this.debouncedCallback.cancel(), this.updateSearchQuery());
1584
+ },
1585
+ // 用 keyUp 事件存在一个问题,删除输入框最后一个字符也会导致取消选中最后一项
1586
+ onKeyDown(e) {
1587
+ const {
1588
+ instance: t
1589
+ } = this, s = "which" in e ? e.which : (
1590
+ /* istanbul ignore next */
1591
+ e.keyCode
1592
+ );
1593
+ if (!(e.ctrlKey || e.shiftKey || e.altKey || e.metaKey)) {
1594
+ if (!t.menu.isOpen && O(Ct, s))
1595
+ return e.preventDefault(), t.openMenu();
1596
+ switch (s) {
1597
+ case h.BACKSPACE: {
1598
+ t.backspaceRemoves && !this.value.length && t.removeLastValue();
1599
+ break;
1600
+ }
1601
+ case h.ENTER: {
1602
+ if (e.preventDefault(), t.menu.current === null)
1603
+ return;
1604
+ const n = t.getNode(t.menu.current);
1605
+ if (n.isBranch && t.disableBranchNodes)
1606
+ return;
1607
+ t.select(n);
1608
+ break;
1609
+ }
1610
+ case h.ESCAPE: {
1611
+ this.value.length ? this.clear() : t.menu.isOpen && t.closeMenu();
1612
+ break;
1613
+ }
1614
+ case h.END: {
1615
+ e.preventDefault(), t.highlightLastOption();
1616
+ break;
1617
+ }
1618
+ case h.HOME: {
1619
+ e.preventDefault(), t.highlightFirstOption();
1620
+ break;
1621
+ }
1622
+ case h.ARROW_LEFT: {
1623
+ const n = t.getNode(t.menu.current);
1624
+ n.isBranch && t.shouldExpand(n) ? (e.preventDefault(), t.toggleExpanded(n)) : !n.isRootNode && (n.isLeaf || n.isBranch && !t.shouldExpand(n)) && (e.preventDefault(), t.setCurrentHighlightedOption(n.parentNode));
1625
+ break;
1626
+ }
1627
+ case h.ARROW_UP: {
1628
+ e.preventDefault(), t.highlightPrevOption();
1629
+ break;
1630
+ }
1631
+ case h.ARROW_RIGHT: {
1632
+ const n = t.getNode(t.menu.current);
1633
+ n.isBranch && !t.shouldExpand(n) && (e.preventDefault(), t.toggleExpanded(n));
1634
+ break;
1635
+ }
1636
+ case h.ARROW_DOWN: {
1637
+ e.preventDefault(), t.highlightNextOption();
1638
+ break;
1639
+ }
1640
+ case h.DELETE: {
1641
+ t.deleteRemoves && !this.value.length && t.removeLastValue();
1642
+ break;
1643
+ }
1644
+ default:
1645
+ t.openMenu();
1646
+ }
1647
+ }
1648
+ },
1649
+ onMouseDown(e) {
1650
+ this.value.length && e.stopPropagation();
1651
+ },
1652
+ renderInputContainer() {
1653
+ const e = this.$createElement, {
1654
+ instance: t
1655
+ } = this, s = {}, n = [];
1656
+ return t.searchable && !t.disabled && (n.push(this.renderInput()), this.needAutoSize && n.push(this.renderSizer())), t.searchable || q(s, {
1657
+ on: {
1658
+ focus: this.onFocus,
1659
+ blur: this.onBlur,
1660
+ keydown: this.onKeyDown
1661
+ },
1662
+ ref: "input"
1663
+ }), !t.searchable && !t.disabled && q(s, {
1664
+ attrs: {
1665
+ tabIndex: t.tabIndex
1666
+ }
1667
+ }), e("div", D([{
1668
+ class: "vue-treeselect__input-container"
1669
+ }, s]), [n]);
1670
+ },
1671
+ renderInput() {
1672
+ const e = this.$createElement, {
1673
+ instance: t
1674
+ } = this;
1675
+ return e("input", {
1676
+ ref: "input",
1677
+ class: "vue-treeselect__input",
1678
+ attrs: {
1679
+ type: "text",
1680
+ autocomplete: "off",
1681
+ tabIndex: t.tabIndex,
1682
+ required: t.required && !t.hasValue
1683
+ },
1684
+ domProps: {
1685
+ value: this.value
1686
+ },
1687
+ style: this.inputStyle,
1688
+ on: {
1689
+ focus: this.onFocus,
1690
+ input: this.onInput,
1691
+ blur: this.onBlur,
1692
+ keydown: this.onKeyDown,
1693
+ mousedown: this.onMouseDown
1694
+ }
1695
+ });
1696
+ },
1697
+ renderSizer() {
1698
+ const e = this.$createElement;
1699
+ return e("div", {
1700
+ ref: "sizer",
1701
+ class: "vue-treeselect__sizer"
1702
+ }, [this.value]);
1703
+ },
1704
+ updateInputWidth() {
1705
+ this.inputWidth = Math.max(ne, this.$refs.sizer.scrollWidth + 15);
1706
+ },
1707
+ updateSearchQuery() {
1708
+ const {
1709
+ instance: e
1710
+ } = this;
1711
+ e.trigger.searchQuery = this.value;
1712
+ }
1713
+ },
1714
+ render() {
1715
+ return this.renderInputContainer();
1716
+ }
1717
+ };
1718
+ let Mt, xt;
1719
+ const le = {};
1720
+ var Tt = /* @__PURE__ */ f(
1721
+ Lt,
1722
+ Mt,
1723
+ xt,
1724
+ !1,
1725
+ Dt,
1726
+ null,
1727
+ null,
1728
+ null
1729
+ );
1730
+ function Dt(e) {
1731
+ for (let t in le)
1732
+ this[t] = le[t];
1733
+ }
1734
+ const Te = /* @__PURE__ */ function() {
1735
+ return Tt.exports;
1736
+ }(), Rt = {
1737
+ name: "VueTreeSelectPlaceholder",
1738
+ inject: ["instance"],
1739
+ render() {
1740
+ const e = arguments[0], {
1741
+ instance: t
1742
+ } = this, s = {
1743
+ "vue-treeselect__placeholder": !0,
1744
+ "vue-treeselect-helper-zoom-effect-off": !0,
1745
+ "vue-treeselect-helper-hide": t.hasValue || t.trigger.searchQuery
1746
+ };
1747
+ return e("div", {
1748
+ class: s
1749
+ }, [t.placeholder]);
1750
+ }
1751
+ };
1752
+ let It, At;
1753
+ const ae = {};
1754
+ var Vt = /* @__PURE__ */ f(
1755
+ Rt,
1756
+ It,
1757
+ At,
1758
+ !1,
1759
+ Bt,
1760
+ null,
1761
+ null,
1762
+ null
1763
+ );
1764
+ function Bt(e) {
1765
+ for (let t in ae)
1766
+ this[t] = ae[t];
1767
+ }
1768
+ const De = /* @__PURE__ */ function() {
1769
+ return Vt.exports;
1770
+ }(), zt = {
1771
+ name: "VueTreeSelectSingleValue",
1772
+ inject: ["instance"],
1773
+ methods: {
1774
+ renderSingleValueLabel() {
1775
+ const {
1776
+ instance: e
1777
+ } = this, t = e.selectedNodes[0], s = e.$scopedSlots["value-label"];
1778
+ return s ? s({
1779
+ node: t
1780
+ }) : t.label;
1781
+ }
1782
+ },
1783
+ render() {
1784
+ const e = arguments[0], {
1785
+ instance: t,
1786
+ $parent: {
1787
+ renderValueContainer: s
1788
+ }
1789
+ } = this, n = t.hasValue && !t.trigger.searchQuery;
1790
+ return s([n && e("div", {
1791
+ class: "vue-treeselect__single-value"
1792
+ }, [this.renderSingleValueLabel()]), e(De), e(Te, {
1793
+ ref: "input"
1794
+ })]);
1795
+ }
1796
+ };
1797
+ let Ft, kt;
1798
+ const ce = {};
1799
+ var Ht = /* @__PURE__ */ f(
1800
+ zt,
1801
+ Ft,
1802
+ kt,
1803
+ !1,
1804
+ Pt,
1805
+ null,
1806
+ null,
1807
+ null
1808
+ );
1809
+ function Pt(e) {
1810
+ for (let t in ce)
1811
+ this[t] = ce[t];
1812
+ }
1813
+ const Wt = /* @__PURE__ */ function() {
1814
+ return Ht.exports;
1815
+ }();
1816
+ var jt = function() {
1817
+ var e = this, t = e.$createElement, s = e._self._c || t;
1818
+ return s("svg", {
1819
+ attrs: {
1820
+ xmlns: "http://www.w3.org/2000/svg",
1821
+ viewBox: "0 0 348.333 348.333"
1822
+ }
1823
+ }, [s("path", {
1824
+ attrs: {
1825
+ d: "M336.559 68.611L231.016 174.165l105.543 105.549c15.699 15.705 15.699 41.145 0 56.85-7.844 7.844-18.128 11.769-28.407 11.769-10.296 0-20.581-3.919-28.419-11.769L174.167 231.003 68.609 336.563c-7.843 7.844-18.128 11.769-28.416 11.769-10.285 0-20.563-3.919-28.413-11.769-15.699-15.698-15.699-41.139 0-56.85l105.54-105.549L11.774 68.611c-15.699-15.699-15.699-41.145 0-56.844 15.696-15.687 41.127-15.687 56.829 0l105.563 105.554L279.721 11.767c15.705-15.687 41.139-15.687 56.832 0 15.705 15.699 15.705 41.145.006 56.844z"
1826
+ }
1827
+ })]);
1828
+ }, Qt = [];
1829
+ const Kt = {
1830
+ name: "VueTreeSelectDelete"
1831
+ }, ue = {};
1832
+ var qt = /* @__PURE__ */ f(
1833
+ Kt,
1834
+ jt,
1835
+ Qt,
1836
+ !1,
1837
+ Ut,
1838
+ null,
1839
+ null,
1840
+ null
1841
+ );
1842
+ function Ut(e) {
1843
+ for (let t in ue)
1844
+ this[t] = ue[t];
1845
+ }
1846
+ const Re = /* @__PURE__ */ function() {
1847
+ return qt.exports;
1848
+ }(), Yt = {
1849
+ name: "VueTreeSelectMultiValueItem",
1850
+ inject: ["instance"],
1851
+ props: {
1852
+ node: {
1853
+ type: Object,
1854
+ required: !0
1855
+ }
1856
+ },
1857
+ methods: {
1858
+ handleMouseDown: N(function() {
1859
+ const {
1860
+ instance: t,
1861
+ node: s
1862
+ } = this;
1863
+ t.select(s);
1864
+ })
1865
+ },
1866
+ render() {
1867
+ const e = arguments[0], {
1868
+ instance: t,
1869
+ node: s
1870
+ } = this, n = {
1871
+ "vue-treeselect__multi-value-item": !0,
1872
+ "vue-treeselect__multi-value-item-disabled": s.isDisabled,
1873
+ "vue-treeselect__multi-value-item-new": s.isNew
1874
+ }, i = t.$scopedSlots["value-label"], o = i ? i({
1875
+ node: s
1876
+ }) : s.label;
1877
+ return e("div", {
1878
+ class: "vue-treeselect__multi-value-item-container"
1879
+ }, [e("div", {
1880
+ class: n,
1881
+ on: {
1882
+ mousedown: this.handleMouseDown
1883
+ }
1884
+ }, [e("span", {
1885
+ class: "vue-treeselect__multi-value-label"
1886
+ }, [o]), e("span", {
1887
+ class: "vue-treeselect__icon vue-treeselect__value-remove"
1888
+ }, [e(Re)])])]);
1889
+ }
1890
+ };
1891
+ let Xt, Gt;
1892
+ const he = {};
1893
+ var Jt = /* @__PURE__ */ f(
1894
+ Yt,
1895
+ Xt,
1896
+ Gt,
1897
+ !1,
1898
+ Zt,
1899
+ null,
1900
+ null,
1901
+ null
1902
+ );
1903
+ function Zt(e) {
1904
+ for (let t in he)
1905
+ this[t] = he[t];
1906
+ }
1907
+ const es = /* @__PURE__ */ function() {
1908
+ return Jt.exports;
1909
+ }(), ts = {
1910
+ name: "VueTreeSelectMultiValue",
1911
+ inject: ["instance"],
1912
+ methods: {
1913
+ renderMultiValueItems() {
1914
+ const e = this.$createElement, {
1915
+ instance: t
1916
+ } = this;
1917
+ return t.internalValue.slice(0, t.limit).map(t.getNode).map((s) => e(es, {
1918
+ key: `multi-value-item-${s.id}`,
1919
+ attrs: {
1920
+ node: s
1921
+ }
1922
+ }));
1923
+ },
1924
+ renderExceedLimitTip() {
1925
+ const e = this.$createElement, {
1926
+ instance: t
1927
+ } = this, s = t.internalValue.length - t.limit;
1928
+ return s <= 0 ? null : e("div", {
1929
+ class: "vue-treeselect__limit-tip vue-treeselect-helper-zoom-effect-off",
1930
+ key: "exceed-limit-tip"
1931
+ }, [e("span", {
1932
+ class: "vue-treeselect__limit-tip-text"
1933
+ }, [t.limitText(s)])]);
1934
+ }
1935
+ },
1936
+ render() {
1937
+ const e = arguments[0], {
1938
+ renderValueContainer: t
1939
+ } = this.$parent;
1940
+ return t(e("transition-group", D([{
1941
+ class: "vue-treeselect__multi-value"
1942
+ }, {
1943
+ props: {
1944
+ tag: "div",
1945
+ name: "vue-treeselect__multi-value-item--transition",
1946
+ appear: !0
1947
+ }
1948
+ }]), [this.renderMultiValueItems(), this.renderExceedLimitTip(), e(De, {
1949
+ key: "placeholder"
1950
+ }), e(Te, {
1951
+ ref: "input",
1952
+ key: "input"
1953
+ })]));
1954
+ }
1955
+ };
1956
+ let ss, ns;
1957
+ const de = {};
1958
+ var is = /* @__PURE__ */ f(
1959
+ ts,
1960
+ ss,
1961
+ ns,
1962
+ !1,
1963
+ rs,
1964
+ null,
1965
+ null,
1966
+ null
1967
+ );
1968
+ function rs(e) {
1969
+ for (let t in de)
1970
+ this[t] = de[t];
1971
+ }
1972
+ const os = /* @__PURE__ */ function() {
1973
+ return is.exports;
1974
+ }();
1975
+ var ls = function() {
1976
+ var e = this, t = e.$createElement, s = e._self._c || t;
1977
+ return s("svg", {
1978
+ attrs: {
1979
+ xmlns: "http://www.w3.org/2000/svg",
1980
+ viewBox: "0 0 292.362 292.362"
1981
+ }
1982
+ }, [s("path", {
1983
+ attrs: {
1984
+ d: "M286.935 69.377c-3.614-3.617-7.898-5.424-12.848-5.424H18.274c-4.952 0-9.233 1.807-12.85 5.424C1.807 72.998 0 77.279 0 82.228c0 4.948 1.807 9.229 5.424 12.847l127.907 127.907c3.621 3.617 7.902 5.428 12.85 5.428s9.233-1.811 12.847-5.428L286.935 95.074c3.613-3.617 5.427-7.898 5.427-12.847 0-4.948-1.814-9.229-5.427-12.85z"
1985
+ }
1986
+ })]);
1987
+ }, as = [];
1988
+ const cs = {
1989
+ name: "VueTreeSelectArrow"
1990
+ }, pe = {};
1991
+ var us = /* @__PURE__ */ f(
1992
+ cs,
1993
+ ls,
1994
+ as,
1995
+ !1,
1996
+ hs,
1997
+ null,
1998
+ null,
1999
+ null
2000
+ );
2001
+ function hs(e) {
2002
+ for (let t in pe)
2003
+ this[t] = pe[t];
2004
+ }
2005
+ const Ie = /* @__PURE__ */ function() {
2006
+ return us.exports;
2007
+ }(), ds = {
2008
+ name: "VueTreeSelectControl",
2009
+ inject: ["instance"],
2010
+ computed: {
2011
+ /* eslint-disable valid-jsdoc */
2012
+ /**
2013
+ * Should show the "×" button that resets value?
2014
+ * @return {boolean}
2015
+ */
2016
+ shouldShowX() {
2017
+ const {
2018
+ instance: e
2019
+ } = this;
2020
+ return e.clearable && !e.disabled && e.hasValue && (this.hasUndisabledValue || e.allowClearingDisabled);
2021
+ },
2022
+ /**
2023
+ * Should show the arrow button that toggles menu?
2024
+ * @return {boolean}
2025
+ */
2026
+ shouldShowArrow() {
2027
+ const {
2028
+ instance: e
2029
+ } = this;
2030
+ return e.alwaysOpen ? !e.menu.isOpen : !0;
2031
+ },
2032
+ /**
2033
+ * Has any undisabled option been selected?
2034
+ * @type {boolean}
2035
+ */
2036
+ hasUndisabledValue() {
2037
+ const {
2038
+ instance: e
2039
+ } = this;
2040
+ return e.hasValue && e.internalValue.some((t) => !e.getNode(t).isDisabled);
2041
+ }
2042
+ /* eslint-enable valid-jsdoc */
2043
+ },
2044
+ methods: {
2045
+ renderX() {
2046
+ const e = this.$createElement, {
2047
+ instance: t
2048
+ } = this, s = t.multiple ? t.clearAllText : t.clearValueText;
2049
+ return this.shouldShowX ? e("div", {
2050
+ class: "vue-treeselect__x-container",
2051
+ attrs: {
2052
+ title: s
2053
+ },
2054
+ on: {
2055
+ mousedown: this.handleMouseDownOnX
2056
+ }
2057
+ }, [e(Re, {
2058
+ class: "vue-treeselect__x"
2059
+ })]) : null;
2060
+ },
2061
+ renderArrow() {
2062
+ const e = this.$createElement, {
2063
+ instance: t
2064
+ } = this, s = {
2065
+ "vue-treeselect__control-arrow": !0,
2066
+ "vue-treeselect__control-arrow--rotated": t.menu.isOpen
2067
+ };
2068
+ return this.shouldShowArrow ? e("div", {
2069
+ class: "vue-treeselect__control-arrow-container",
2070
+ on: {
2071
+ mousedown: this.handleMouseDownOnArrow
2072
+ }
2073
+ }, [e(Ie, {
2074
+ class: s
2075
+ })]) : null;
2076
+ },
2077
+ handleMouseDownOnX: N(function(t) {
2078
+ t.stopPropagation(), t.preventDefault();
2079
+ const {
2080
+ instance: s
2081
+ } = this, n = s.beforeClearAll(), i = (o) => {
2082
+ o && s.clear();
2083
+ };
2084
+ Oe(n) ? n.then(i) : setTimeout(() => i(n), 0);
2085
+ }),
2086
+ handleMouseDownOnArrow: N(function(t) {
2087
+ t.preventDefault(), t.stopPropagation();
2088
+ const {
2089
+ instance: s
2090
+ } = this;
2091
+ s.focusInput(), s.toggleMenu();
2092
+ }),
2093
+ // This is meant to be called by child `<Value />` component.
2094
+ renderValueContainer(e) {
2095
+ const t = this.$createElement;
2096
+ return t("div", {
2097
+ class: "vue-treeselect__value-container"
2098
+ }, [e]);
2099
+ }
2100
+ },
2101
+ render() {
2102
+ const e = arguments[0], {
2103
+ instance: t
2104
+ } = this, s = t.single ? Wt : os;
2105
+ return e("div", {
2106
+ class: "vue-treeselect__control",
2107
+ on: {
2108
+ mousedown: t.handleMouseDown
2109
+ }
2110
+ }, [e(s, {
2111
+ ref: "value-container"
2112
+ }), this.renderX(), this.renderArrow()]);
2113
+ }
2114
+ };
2115
+ let ps, fs;
2116
+ const fe = {};
2117
+ var ms = /* @__PURE__ */ f(
2118
+ ds,
2119
+ ps,
2120
+ fs,
2121
+ !1,
2122
+ gs,
2123
+ null,
2124
+ null,
2125
+ null
2126
+ );
2127
+ function gs(e) {
2128
+ for (let t in fe)
2129
+ this[t] = fe[t];
2130
+ }
2131
+ const _s = /* @__PURE__ */ function() {
2132
+ return ms.exports;
2133
+ }(), vs = {
2134
+ name: "VueTreeSelectTip",
2135
+ functional: !0,
2136
+ props: {
2137
+ type: {
2138
+ type: String,
2139
+ required: !0
2140
+ },
2141
+ icon: {
2142
+ type: String,
2143
+ required: !0
2144
+ }
2145
+ },
2146
+ render(e, t) {
2147
+ const s = arguments[0], {
2148
+ props: n,
2149
+ children: i
2150
+ } = t;
2151
+ return s("div", {
2152
+ class: `vue-treeselect__tip vue-treeselect__${n.type}-tip`
2153
+ }, [s("div", {
2154
+ class: "vue-treeselect__icon-container"
2155
+ }, [s("span", {
2156
+ class: `vue-treeselect__icon-${n.icon}`
2157
+ })]), s("span", {
2158
+ class: `vue-treeselect__tip-text vue-treeselect__${n.type}-tip-text`
2159
+ }, [i])]);
2160
+ }
2161
+ };
2162
+ let Ss, Os;
2163
+ const me = {};
2164
+ var ys = /* @__PURE__ */ f(
2165
+ vs,
2166
+ Ss,
2167
+ Os,
2168
+ !1,
2169
+ Es,
2170
+ null,
2171
+ null,
2172
+ null
2173
+ );
2174
+ function Es(e) {
2175
+ for (let t in me)
2176
+ this[t] = me[t];
2177
+ }
2178
+ const v = /* @__PURE__ */ function() {
2179
+ return ys.exports;
2180
+ }();
2181
+ let P, W, j;
2182
+ const Ae = {
2183
+ name: "VueTreeSelectOption",
2184
+ inject: ["instance"],
2185
+ props: {
2186
+ node: {
2187
+ type: Object,
2188
+ required: !0
2189
+ }
2190
+ },
2191
+ computed: {
2192
+ shouldExpand() {
2193
+ const {
2194
+ instance: e,
2195
+ node: t
2196
+ } = this;
2197
+ return t.isBranch && e.shouldExpand(t);
2198
+ },
2199
+ shouldShow() {
2200
+ const {
2201
+ instance: e,
2202
+ node: t
2203
+ } = this;
2204
+ return e.shouldShowOptionInMenu(t);
2205
+ }
2206
+ },
2207
+ methods: {
2208
+ renderOption() {
2209
+ const e = this.$createElement, {
2210
+ instance: t,
2211
+ node: s
2212
+ } = this, n = {
2213
+ "vue-treeselect__option": !0,
2214
+ "vue-treeselect__option--disabled": s.isDisabled,
2215
+ "vue-treeselect__option--selected": t.isSelected(s),
2216
+ "vue-treeselect__option--highlight": s.isHighlighted,
2217
+ "vue-treeselect__option--matched": t.localSearch.active && s.isMatched,
2218
+ "vue-treeselect__option--hide": !this.shouldShow
2219
+ };
2220
+ return e("div", {
2221
+ class: n,
2222
+ on: {
2223
+ mouseenter: this.handleMouseEnterOption
2224
+ },
2225
+ attrs: {
2226
+ "data-id": s.id
2227
+ }
2228
+ }, [this.renderArrow(), this.renderLabelContainer([this.renderCheckboxContainer([this.renderCheckbox()]), this.renderLabel()])]);
2229
+ },
2230
+ renderSubOptionsList() {
2231
+ const e = this.$createElement;
2232
+ return this.shouldExpand ? e("div", {
2233
+ class: "vue-treeselect__list"
2234
+ }, [this.renderSubOptions(), this.renderNoChildrenTip(), this.renderLoadingChildrenTip(), this.renderLoadingChildrenErrorTip()]) : null;
2235
+ },
2236
+ renderArrow() {
2237
+ const e = this.$createElement, {
2238
+ instance: t,
2239
+ node: s
2240
+ } = this;
2241
+ if (t.shouldFlattenOptions && this.shouldShow)
2242
+ return null;
2243
+ if (s.isBranch) {
2244
+ const n = {
2245
+ props: {
2246
+ name: "vue-treeselect__option-arrow--prepare",
2247
+ appear: !0
2248
+ }
2249
+ }, i = {
2250
+ "vue-treeselect__option-arrow": !0,
2251
+ "vue-treeselect__option-arrow--rotated": this.shouldExpand
2252
+ };
2253
+ return e("div", {
2254
+ class: "vue-treeselect__option-arrow-container",
2255
+ on: {
2256
+ mousedown: this.handleMouseDownOnArrow
2257
+ }
2258
+ }, [e("transition", D([{}, n]), [e(Ie, {
2259
+ class: i
2260
+ })])]);
2261
+ }
2262
+ return (
2263
+ /* node.isLeaf && */
2264
+ t.hasBranchNodes ? (P || (P = e("div", {
2265
+ class: "vue-treeselect__option-arrow-placeholder"
2266
+ }, [" "])), P) : null
2267
+ );
2268
+ },
2269
+ renderLabelContainer(e) {
2270
+ const t = this.$createElement;
2271
+ return t("div", {
2272
+ class: "vue-treeselect__label-container",
2273
+ on: {
2274
+ mousedown: this.handleMouseDownOnLabelContainer
2275
+ }
2276
+ }, [e]);
2277
+ },
2278
+ renderCheckboxContainer(e) {
2279
+ const t = this.$createElement, {
2280
+ instance: s,
2281
+ node: n
2282
+ } = this;
2283
+ return s.single || s.disableBranchNodes && n.isBranch ? null : t("div", {
2284
+ class: "vue-treeselect__checkbox-container"
2285
+ }, [e]);
2286
+ },
2287
+ renderCheckbox() {
2288
+ const e = this.$createElement, {
2289
+ instance: t,
2290
+ node: s
2291
+ } = this, n = t.forest.checkedStateMap[s.id], i = {
2292
+ "vue-treeselect__checkbox": !0,
2293
+ "vue-treeselect__checkbox--checked": n === Me,
2294
+ "vue-treeselect__checkbox--indeterminate": n === Le,
2295
+ "vue-treeselect__checkbox--unchecked": n === U,
2296
+ "vue-treeselect__checkbox--disabled": s.isDisabled
2297
+ };
2298
+ return W || (W = e("span", {
2299
+ class: "vue-treeselect__check-mark"
2300
+ })), j || (j = e("span", {
2301
+ class: "vue-treeselect__minus-mark"
2302
+ })), e("span", {
2303
+ class: i
2304
+ }, [W, j]);
2305
+ },
2306
+ renderLabel() {
2307
+ const e = this.$createElement, {
2308
+ instance: t,
2309
+ node: s
2310
+ } = this, n = s.isBranch && (t.localSearch.active ? t.showCountOnSearchComputed : t.showCount), i = n ? t.localSearch.active ? t.localSearch.countMap[s.id][t.showCountOf] : s.count[t.showCountOf] : NaN, o = "vue-treeselect__label", r = "vue-treeselect__count", c = t.$scopedSlots["option-label"];
2311
+ return c ? c({
2312
+ node: s,
2313
+ shouldShowCount: n,
2314
+ count: i,
2315
+ labelClassName: o,
2316
+ countClassName: r
2317
+ }) : e("label", {
2318
+ class: o
2319
+ }, [s.label, n && e("span", {
2320
+ class: r
2321
+ }, ["(", i, ")"])]);
2322
+ },
2323
+ renderSubOptions() {
2324
+ const e = this.$createElement, {
2325
+ node: t
2326
+ } = this;
2327
+ return t.childrenStates.isLoaded ? t.children.map((s) => e(Ae, {
2328
+ attrs: {
2329
+ node: s
2330
+ },
2331
+ key: s.id
2332
+ })) : null;
2333
+ },
2334
+ renderNoChildrenTip() {
2335
+ const e = this.$createElement, {
2336
+ instance: t,
2337
+ node: s
2338
+ } = this;
2339
+ return !s.childrenStates.isLoaded || s.children.length ? null : e(v, {
2340
+ attrs: {
2341
+ type: "no-children",
2342
+ icon: "warning"
2343
+ }
2344
+ }, [t.noChildrenText]);
2345
+ },
2346
+ renderLoadingChildrenTip() {
2347
+ const e = this.$createElement, {
2348
+ instance: t,
2349
+ node: s
2350
+ } = this;
2351
+ return s.childrenStates.isLoading ? e(v, {
2352
+ attrs: {
2353
+ type: "loading",
2354
+ icon: "loader"
2355
+ }
2356
+ }, [t.loadingText]) : null;
2357
+ },
2358
+ renderLoadingChildrenErrorTip() {
2359
+ const e = this.$createElement, {
2360
+ instance: t,
2361
+ node: s
2362
+ } = this;
2363
+ return s.childrenStates.loadingError ? e(v, {
2364
+ attrs: {
2365
+ type: "error",
2366
+ icon: "error"
2367
+ }
2368
+ }, [s.childrenStates.loadingError, e("a", {
2369
+ class: "vue-treeselect__retry",
2370
+ attrs: {
2371
+ title: t.retryTitle
2372
+ },
2373
+ on: {
2374
+ mousedown: this.handleMouseDownOnRetry
2375
+ }
2376
+ }, [t.retryText])]) : null;
2377
+ },
2378
+ handleMouseEnterOption(e) {
2379
+ const {
2380
+ instance: t,
2381
+ node: s
2382
+ } = this;
2383
+ e.target === e.currentTarget && t.setCurrentHighlightedOption(s, !1);
2384
+ },
2385
+ handleMouseDownOnArrow: N(function() {
2386
+ const {
2387
+ instance: t,
2388
+ node: s
2389
+ } = this;
2390
+ t.toggleExpanded(s);
2391
+ }),
2392
+ handleMouseDownOnLabelContainer: N(function() {
2393
+ const {
2394
+ instance: t,
2395
+ node: s
2396
+ } = this;
2397
+ s.isBranch && t.disableBranchNodes ? t.toggleExpanded(s) : t.select(s);
2398
+ }),
2399
+ handleMouseDownOnRetry: N(function() {
2400
+ const {
2401
+ instance: t,
2402
+ node: s
2403
+ } = this;
2404
+ t.loadChildrenOptions(s);
2405
+ })
2406
+ },
2407
+ render() {
2408
+ const e = arguments[0], {
2409
+ node: t
2410
+ } = this, n = {
2411
+ "vue-treeselect__list-item": !0,
2412
+ [`vue-treeselect__indent-level-${this.instance.shouldFlattenOptions ? 0 : t.level}`]: !0
2413
+ }, i = {
2414
+ props: {
2415
+ name: "vue-treeselect__list--transition"
2416
+ }
2417
+ };
2418
+ return e("div", {
2419
+ class: n
2420
+ }, [this.renderOption(), t.isBranch && e("transition", D([{}, i]), [this.renderSubOptionsList()])]);
2421
+ }
2422
+ };
2423
+ let Ns, bs;
2424
+ const ge = {};
2425
+ var $s = /* @__PURE__ */ f(
2426
+ Ae,
2427
+ Ns,
2428
+ bs,
2429
+ !1,
2430
+ ws,
2431
+ null,
2432
+ null,
2433
+ null
2434
+ );
2435
+ function ws(e) {
2436
+ for (let t in ge)
2437
+ this[t] = ge[t];
2438
+ }
2439
+ const Cs = /* @__PURE__ */ function() {
2440
+ return $s.exports;
2441
+ }(), Ls = {
2442
+ top: "top",
2443
+ bottom: "bottom",
2444
+ above: "top",
2445
+ below: "bottom"
2446
+ }, Ms = {
2447
+ name: "VueTreeSelectMenu",
2448
+ inject: ["instance"],
2449
+ computed: {
2450
+ menuStyle() {
2451
+ const {
2452
+ instance: e
2453
+ } = this;
2454
+ return {
2455
+ maxHeight: `${e.maxHeight}px`
2456
+ };
2457
+ },
2458
+ menuContainerStyle() {
2459
+ const {
2460
+ instance: e
2461
+ } = this;
2462
+ return {
2463
+ zIndex: e.appendToBody ? null : e.zIndex
2464
+ };
2465
+ }
2466
+ },
2467
+ watch: {
2468
+ "instance.menu.isOpen"(e) {
2469
+ e ? this.$nextTick(this.onMenuOpen) : this.onMenuClose();
2470
+ }
2471
+ },
2472
+ created() {
2473
+ this.menuSizeWatcher = null, this.menuResizeAndScrollEventListeners = null;
2474
+ },
2475
+ mounted() {
2476
+ const {
2477
+ instance: e
2478
+ } = this;
2479
+ e.menu.isOpen && this.$nextTick(this.onMenuOpen);
2480
+ },
2481
+ destroyed() {
2482
+ this.onMenuClose();
2483
+ },
2484
+ methods: {
2485
+ renderMenu() {
2486
+ const e = this.$createElement, {
2487
+ instance: t
2488
+ } = this;
2489
+ return t.menu.isOpen ? e("div", {
2490
+ ref: "menu",
2491
+ class: "vue-treeselect__menu",
2492
+ on: {
2493
+ mousedown: t.handleMouseDown
2494
+ },
2495
+ style: this.menuStyle
2496
+ }, [this.renderBeforeList(), t.async ? this.renderAsyncSearchMenuInner() : t.localSearch.active ? this.renderLocalSearchMenuInner() : this.renderNormalMenuInner(), this.renderAfterList()]) : null;
2497
+ },
2498
+ renderBeforeList() {
2499
+ const {
2500
+ instance: e
2501
+ } = this, t = e.$scopedSlots["before-list"];
2502
+ return t ? t() : null;
2503
+ },
2504
+ renderAfterList() {
2505
+ const {
2506
+ instance: e
2507
+ } = this, t = e.$scopedSlots["after-list"];
2508
+ return t ? t() : null;
2509
+ },
2510
+ renderNormalMenuInner() {
2511
+ const {
2512
+ instance: e
2513
+ } = this;
2514
+ return e.rootOptionsStates.isLoading ? this.renderLoadingOptionsTip() : e.rootOptionsStates.loadingError ? this.renderLoadingRootOptionsErrorTip() : e.rootOptionsStates.isLoaded && e.forest.normalizedOptions.length === 0 ? this.renderNoAvailableOptionsTip() : this.renderOptionList();
2515
+ },
2516
+ renderLocalSearchMenuInner() {
2517
+ const {
2518
+ instance: e
2519
+ } = this;
2520
+ return e.rootOptionsStates.isLoading ? this.renderLoadingOptionsTip() : e.rootOptionsStates.loadingError ? this.renderLoadingRootOptionsErrorTip() : e.rootOptionsStates.isLoaded && e.forest.normalizedOptions.length === 0 ? this.renderNoAvailableOptionsTip() : e.localSearch.noResults ? this.renderNoResultsTip() : this.renderOptionList();
2521
+ },
2522
+ renderAsyncSearchMenuInner() {
2523
+ const {
2524
+ instance: e
2525
+ } = this, t = e.getRemoteSearchEntry(), s = e.trigger.searchQuery === "" && !e.defaultOptions, n = s ? !1 : t.isLoaded && t.options.length === 0;
2526
+ return s ? this.renderSearchPromptTip() : t.isLoading ? this.renderLoadingOptionsTip() : t.loadingError ? this.renderAsyncSearchLoadingErrorTip() : n ? this.renderNoResultsTip() : this.renderOptionList();
2527
+ },
2528
+ renderOptionList() {
2529
+ const e = this.$createElement, {
2530
+ instance: t
2531
+ } = this;
2532
+ return e("div", {
2533
+ class: "vue-treeselect__list"
2534
+ }, [t.forest.normalizedOptions.map((s) => e(Cs, {
2535
+ attrs: {
2536
+ node: s
2537
+ },
2538
+ key: s.id
2539
+ }))]);
2540
+ },
2541
+ renderSearchPromptTip() {
2542
+ const e = this.$createElement, {
2543
+ instance: t
2544
+ } = this;
2545
+ return e(v, {
2546
+ attrs: {
2547
+ type: "search-prompt",
2548
+ icon: "warning"
2549
+ }
2550
+ }, [t.searchPromptText]);
2551
+ },
2552
+ renderLoadingOptionsTip() {
2553
+ const e = this.$createElement, {
2554
+ instance: t
2555
+ } = this;
2556
+ return e(v, {
2557
+ attrs: {
2558
+ type: "loading",
2559
+ icon: "loader"
2560
+ }
2561
+ }, [t.loadingText]);
2562
+ },
2563
+ renderLoadingRootOptionsErrorTip() {
2564
+ const e = this.$createElement, {
2565
+ instance: t
2566
+ } = this;
2567
+ return e(v, {
2568
+ attrs: {
2569
+ type: "error",
2570
+ icon: "error"
2571
+ }
2572
+ }, [t.rootOptionsStates.loadingError, e("a", {
2573
+ class: "vue-treeselect__retry",
2574
+ on: {
2575
+ click: t.loadRootOptions
2576
+ },
2577
+ attrs: {
2578
+ title: t.retryTitle
2579
+ }
2580
+ }, [t.retryText])]);
2581
+ },
2582
+ renderAsyncSearchLoadingErrorTip() {
2583
+ const e = this.$createElement, {
2584
+ instance: t
2585
+ } = this, s = t.getRemoteSearchEntry();
2586
+ return e(v, {
2587
+ attrs: {
2588
+ type: "error",
2589
+ icon: "error"
2590
+ }
2591
+ }, [s.loadingError, e("a", {
2592
+ class: "vue-treeselect__retry",
2593
+ on: {
2594
+ click: t.handleRemoteSearch
2595
+ },
2596
+ attrs: {
2597
+ title: t.retryTitle
2598
+ }
2599
+ }, [t.retryText])]);
2600
+ },
2601
+ renderNoAvailableOptionsTip() {
2602
+ const e = this.$createElement, {
2603
+ instance: t
2604
+ } = this;
2605
+ return e(v, {
2606
+ attrs: {
2607
+ type: "no-options",
2608
+ icon: "warning"
2609
+ }
2610
+ }, [t.noOptionsText]);
2611
+ },
2612
+ renderNoResultsTip() {
2613
+ const e = this.$createElement, {
2614
+ instance: t
2615
+ } = this;
2616
+ return e(v, {
2617
+ attrs: {
2618
+ type: "no-results",
2619
+ icon: "warning"
2620
+ }
2621
+ }, [t.noResultsText]);
2622
+ },
2623
+ onMenuOpen() {
2624
+ this.adjustMenuOpenDirection(), this.setupMenuSizeWatcher(), this.setupMenuResizeAndScrollEventListeners();
2625
+ },
2626
+ onMenuClose() {
2627
+ this.removeMenuSizeWatcher(), this.removeMenuResizeAndScrollEventListeners();
2628
+ },
2629
+ adjustMenuOpenDirection() {
2630
+ const {
2631
+ instance: e
2632
+ } = this;
2633
+ if (!e.menu.isOpen)
2634
+ return;
2635
+ const t = e.getMenu(), s = e.getControl(), n = t.getBoundingClientRect(), i = s.getBoundingClientRect(), o = n.height, r = window.innerHeight, c = i.top, d = window.innerHeight - i.bottom, a = i.top >= 0 && i.top <= r || i.top < 0 && i.bottom > 0, m = d > o + ie, p = c > o + ie;
2636
+ a ? e.openDirection !== "auto" ? e.menu.placement = Ls[e.openDirection] : m || !p ? e.menu.placement = "bottom" : e.menu.placement = "top" : e.closeMenu();
2637
+ },
2638
+ setupMenuSizeWatcher() {
2639
+ const {
2640
+ instance: e
2641
+ } = this, t = e.getMenu();
2642
+ this.menuSizeWatcher || (this.menuSizeWatcher = {
2643
+ remove: Ne(t, this.adjustMenuOpenDirection)
2644
+ });
2645
+ },
2646
+ setupMenuResizeAndScrollEventListeners() {
2647
+ const {
2648
+ instance: e
2649
+ } = this, t = e.getControl();
2650
+ this.menuResizeAndScrollEventListeners || (this.menuResizeAndScrollEventListeners = {
2651
+ remove: be(t, this.adjustMenuOpenDirection)
2652
+ });
2653
+ },
2654
+ removeMenuSizeWatcher() {
2655
+ this.menuSizeWatcher && (this.menuSizeWatcher.remove(), this.menuSizeWatcher = null);
2656
+ },
2657
+ removeMenuResizeAndScrollEventListeners() {
2658
+ this.menuResizeAndScrollEventListeners && (this.menuResizeAndScrollEventListeners.remove(), this.menuResizeAndScrollEventListeners = null);
2659
+ }
2660
+ },
2661
+ render() {
2662
+ const e = arguments[0];
2663
+ return e("div", {
2664
+ ref: "menu-container",
2665
+ class: "vue-treeselect__menu-container",
2666
+ style: this.menuContainerStyle
2667
+ }, [e("transition", {
2668
+ attrs: {
2669
+ name: "vue-treeselect__menu--transition"
2670
+ }
2671
+ }, [this.renderMenu()])]);
2672
+ }
2673
+ };
2674
+ let xs, Ts;
2675
+ const _e = {};
2676
+ var Ds = /* @__PURE__ */ f(
2677
+ Ms,
2678
+ xs,
2679
+ Ts,
2680
+ !1,
2681
+ Rs,
2682
+ null,
2683
+ null,
2684
+ null
2685
+ );
2686
+ function Rs(e) {
2687
+ for (let t in _e)
2688
+ this[t] = _e[t];
2689
+ }
2690
+ const Ve = /* @__PURE__ */ function() {
2691
+ return Ds.exports;
2692
+ }(), Is = {
2693
+ name: "VueTreeSelectPortalTarget",
2694
+ inject: ["instance"],
2695
+ watch: {
2696
+ "instance.menu.isOpen"(e) {
2697
+ e ? this.setupHandlers() : this.removeHandlers();
2698
+ },
2699
+ "instance.menu.placement"() {
2700
+ this.updateMenuContainerOffset();
2701
+ }
2702
+ },
2703
+ created() {
2704
+ this.controlResizeAndScrollEventListeners = null, this.controlSizeWatcher = null;
2705
+ },
2706
+ mounted() {
2707
+ const {
2708
+ instance: e
2709
+ } = this;
2710
+ e.menu.isOpen && this.setupHandlers();
2711
+ },
2712
+ methods: {
2713
+ setupHandlers() {
2714
+ this.updateWidth(), this.updateMenuContainerOffset(), this.setupControlResizeAndScrollEventListeners(), this.setupControlSizeWatcher();
2715
+ },
2716
+ removeHandlers() {
2717
+ this.removeControlResizeAndScrollEventListeners(), this.removeControlSizeWatcher();
2718
+ },
2719
+ setupControlResizeAndScrollEventListeners() {
2720
+ const {
2721
+ instance: e
2722
+ } = this, t = e.getControl();
2723
+ this.controlResizeAndScrollEventListeners || (this.controlResizeAndScrollEventListeners = {
2724
+ remove: be(t, this.updateMenuContainerOffset)
2725
+ });
2726
+ },
2727
+ setupControlSizeWatcher() {
2728
+ const {
2729
+ instance: e
2730
+ } = this, t = e.getControl();
2731
+ this.controlSizeWatcher || (this.controlSizeWatcher = {
2732
+ remove: Ne(t, () => {
2733
+ this.updateWidth(), this.updateMenuContainerOffset();
2734
+ })
2735
+ });
2736
+ },
2737
+ removeControlResizeAndScrollEventListeners() {
2738
+ this.controlResizeAndScrollEventListeners && (this.controlResizeAndScrollEventListeners.remove(), this.controlResizeAndScrollEventListeners = null);
2739
+ },
2740
+ removeControlSizeWatcher() {
2741
+ this.controlSizeWatcher && (this.controlSizeWatcher.remove(), this.controlSizeWatcher = null);
2742
+ },
2743
+ updateWidth() {
2744
+ const {
2745
+ instance: e
2746
+ } = this, t = this.$el, n = e.getControl().getBoundingClientRect();
2747
+ t.style.width = `${n.width}px`;
2748
+ },
2749
+ updateMenuContainerOffset() {
2750
+ const {
2751
+ instance: e
2752
+ } = this, t = e.getControl(), s = this.$el, n = t.getBoundingClientRect(), i = s.getBoundingClientRect(), o = e.menu.placement === "bottom" ? n.height : 0, r = `${Math.round(n.left - i.left)}px`, c = `${Math.round(n.top - i.top + o)}px`, d = this.$refs.menu.$refs["menu-container"].style, m = Ce(["transform", "webkitTransform", "MozTransform", "msTransform"], (p) => p in document.body.style);
2753
+ d[m] = `translate(${r}, ${c})`;
2754
+ }
2755
+ },
2756
+ render() {
2757
+ const e = arguments[0], {
2758
+ instance: t
2759
+ } = this, s = ["vue-treeselect__portal-target", t.wrapperClass], n = {
2760
+ zIndex: t.zIndex
2761
+ };
2762
+ return e("div", {
2763
+ class: s,
2764
+ style: n,
2765
+ attrs: {
2766
+ "data-instance-id": t.getInstanceId()
2767
+ }
2768
+ }, [e(Ve, {
2769
+ ref: "menu"
2770
+ })]);
2771
+ },
2772
+ destroyed() {
2773
+ this.removeHandlers();
2774
+ }
2775
+ };
2776
+ let Q;
2777
+ const As = {
2778
+ name: "VueTreeSelectMenuPortal",
2779
+ created() {
2780
+ this.portalTarget = null;
2781
+ },
2782
+ mounted() {
2783
+ this.setup();
2784
+ },
2785
+ destroyed() {
2786
+ this.teardown();
2787
+ },
2788
+ methods: {
2789
+ setup() {
2790
+ const e = document.createElement("div");
2791
+ document.body.appendChild(e), this.portalTarget = new Ue(_({
2792
+ el: e,
2793
+ parent: this
2794
+ }, Is));
2795
+ },
2796
+ teardown() {
2797
+ document.body.removeChild(this.portalTarget.$el), this.portalTarget.$el.innerHTML = "", this.portalTarget.$destroy(), this.portalTarget = null;
2798
+ }
2799
+ },
2800
+ render() {
2801
+ const e = arguments[0];
2802
+ return Q || (Q = e("div", {
2803
+ class: "vue-treeselect__menu-placeholder"
2804
+ })), Q;
2805
+ }
2806
+ };
2807
+ let Vs, Bs;
2808
+ const ve = {};
2809
+ var zs = /* @__PURE__ */ f(
2810
+ As,
2811
+ Vs,
2812
+ Bs,
2813
+ !1,
2814
+ Fs,
2815
+ null,
2816
+ null,
2817
+ null
2818
+ );
2819
+ function Fs(e) {
2820
+ for (let t in ve)
2821
+ this[t] = ve[t];
2822
+ }
2823
+ const ks = /* @__PURE__ */ function() {
2824
+ return zs.exports;
2825
+ }(), Hs = {
2826
+ name: "VueTreeSelect",
2827
+ mixins: [dt],
2828
+ computed: {
2829
+ wrapperClass() {
2830
+ return {
2831
+ "vue-treeselect": !0,
2832
+ "vue-treeselect--single": this.single,
2833
+ "vue-treeselect--multi": this.multiple,
2834
+ "vue-treeselect--searchable": this.searchable,
2835
+ "vue-treeselect--disabled": this.disabled,
2836
+ "vue-treeselect--focused": this.trigger.isFocused,
2837
+ "vue-treeselect--has-value": this.hasValue,
2838
+ "vue-treeselect--open": this.menu.isOpen,
2839
+ "vue-treeselect--open-above": this.menu.placement === "top",
2840
+ "vue-treeselect--open-below": this.menu.placement === "bottom",
2841
+ "vue-treeselect--branch-nodes-disabled": this.disableBranchNodes,
2842
+ "vue-treeselect--append-to-body": this.appendToBody
2843
+ };
2844
+ }
2845
+ },
2846
+ render() {
2847
+ const e = arguments[0];
2848
+ return e("div", {
2849
+ ref: "wrapper",
2850
+ class: this.wrapperClass
2851
+ }, [e(St), e(_s, {
2852
+ ref: "control"
2853
+ }), this.appendToBody ? e(ks, {
2854
+ ref: "portal"
2855
+ }) : e(Ve, {
2856
+ ref: "menu"
2857
+ })]);
2858
+ }
2859
+ };
2860
+ let Ps, Ws;
2861
+ const Se = {};
2862
+ var js = /* @__PURE__ */ f(
2863
+ Hs,
2864
+ Ps,
2865
+ Ws,
2866
+ !1,
2867
+ Qs,
2868
+ null,
2869
+ null,
2870
+ null
2871
+ );
2872
+ function Qs(e) {
2873
+ for (let t in Se)
2874
+ this[t] = Se[t];
2875
+ }
2876
+ const Gs = /* @__PURE__ */ function() {
2877
+ return js.exports;
2878
+ }();
2879
+ export {
2880
+ Gs as default
2881
+ };