bromcom-ui 2.9.0-rc.3 → 2.9.0-rc.5

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 (274) hide show
  1. package/dist/bromcom-ui/bromcom-ui.css +1 -1
  2. package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
  3. package/dist/bromcom-ui/p-0543a86f.js +5 -0
  4. package/dist/bromcom-ui/p-0a528362.entry.js +5 -0
  5. package/dist/bromcom-ui/{p-04410e89.entry.js → p-0c549bd0.entry.js} +1 -1
  6. package/dist/bromcom-ui/{p-161864f8.entry.js → p-0d4372c9.entry.js} +1 -1
  7. package/dist/bromcom-ui/{p-8c9d109c.entry.js → p-15758356.entry.js} +1 -1
  8. package/dist/bromcom-ui/{p-259ede50.entry.js → p-179af180.entry.js} +1 -1
  9. package/dist/bromcom-ui/p-1a04159f.entry.js +5 -0
  10. package/dist/bromcom-ui/{p-9e64286c.entry.js → p-1a405289.entry.js} +1 -1
  11. package/dist/bromcom-ui/{p-5648b456.entry.js → p-1b1f4b44.entry.js} +1 -1
  12. package/dist/bromcom-ui/p-1eabd5dc.js +10 -0
  13. package/dist/bromcom-ui/p-24cffc16.entry.js +13 -0
  14. package/dist/bromcom-ui/{p-2db9415f.entry.js → p-25f9928a.entry.js} +1 -1
  15. package/dist/bromcom-ui/p-285722ad.entry.js +5 -0
  16. package/dist/bromcom-ui/{p-d9dfbdae.entry.js → p-29a12785.entry.js} +1 -1
  17. package/dist/bromcom-ui/{p-cfddaef7.entry.js → p-2a02b473.entry.js} +1 -1
  18. package/dist/bromcom-ui/p-2fc584c4.js +5 -0
  19. package/dist/bromcom-ui/{p-dfb4b928.entry.js → p-365eec45.entry.js} +1 -1
  20. package/dist/bromcom-ui/{p-73dc124b.js → p-38972c46.js} +1 -1
  21. package/dist/bromcom-ui/{p-8c018ae0.js → p-3c7a0345.js} +1 -1
  22. package/dist/bromcom-ui/{p-159e5357.js → p-53448351.js} +1 -1
  23. package/dist/bromcom-ui/{p-276638cd.entry.js → p-546f5f82.entry.js} +1 -1
  24. package/dist/bromcom-ui/{p-13d9bcdb.entry.js → p-5855b125.entry.js} +1 -1
  25. package/dist/bromcom-ui/{p-7e44e6b5.js → p-5ae0a59b.js} +1 -1
  26. package/dist/bromcom-ui/{p-4cd8a7c8.entry.js → p-5c3e9ac9.entry.js} +1 -1
  27. package/dist/bromcom-ui/{p-c0a97e15.entry.js → p-61172e12.entry.js} +1 -1
  28. package/dist/bromcom-ui/{p-e74a2576.entry.js → p-65318f25.entry.js} +1 -1
  29. package/dist/bromcom-ui/p-663766cf.entry.js +5 -0
  30. package/dist/bromcom-ui/{p-30788121.entry.js → p-6c3e9e10.entry.js} +1 -1
  31. package/dist/bromcom-ui/{p-a471cdb2.entry.js → p-721e0cb5.entry.js} +1 -1
  32. package/dist/bromcom-ui/{p-02ee5833.entry.js → p-7bff7371.entry.js} +1 -1
  33. package/dist/bromcom-ui/{p-b198b3d5.entry.js → p-8260eda6.entry.js} +1 -1
  34. package/dist/bromcom-ui/{p-1647559e.entry.js → p-8bcfe3b3.entry.js} +1 -1
  35. package/dist/bromcom-ui/{p-4a8c583d.entry.js → p-8e2e77ca.entry.js} +1 -1
  36. package/dist/bromcom-ui/p-90e5c655.js +5 -0
  37. package/dist/bromcom-ui/p-947c78e3.js +5 -0
  38. package/dist/bromcom-ui/{p-4876c706.entry.js → p-96614f57.entry.js} +1 -1
  39. package/dist/bromcom-ui/{p-2989694b.entry.js → p-9d98d32d.entry.js} +1 -1
  40. package/dist/bromcom-ui/{p-b45a0db2.entry.js → p-9e05f845.entry.js} +1 -1
  41. package/dist/bromcom-ui/{p-baa25b34.entry.js → p-a02c333f.entry.js} +1 -1
  42. package/dist/bromcom-ui/{p-9e1fa716.entry.js → p-a1335bd5.entry.js} +1 -1
  43. package/dist/bromcom-ui/{p-400dcae2.entry.js → p-a3b54a22.entry.js} +1 -1
  44. package/dist/bromcom-ui/{p-454b49ef.entry.js → p-a4731c71.entry.js} +1 -1
  45. package/dist/bromcom-ui/p-a5953ecd.entry.js +5 -0
  46. package/dist/bromcom-ui/{p-3d5631ec.js → p-a8aaa382.js} +1 -1
  47. package/dist/bromcom-ui/{p-30a3320f.entry.js → p-b1c83bb8.entry.js} +1 -1
  48. package/dist/bromcom-ui/{p-dea8dd34.entry.js → p-ba89e3c7.entry.js} +1 -1
  49. package/dist/bromcom-ui/{p-ee3c724a.entry.js → p-c1de1367.entry.js} +1 -1
  50. package/dist/bromcom-ui/{p-feb06aca.entry.js → p-ca32c1b9.entry.js} +1 -1
  51. package/dist/bromcom-ui/p-cf0ab7f0.entry.js +5 -0
  52. package/dist/bromcom-ui/p-d37379d4.entry.js +5 -0
  53. package/dist/bromcom-ui/{p-61092688.entry.js → p-d58107e2.entry.js} +1 -1
  54. package/dist/bromcom-ui/p-dd422dd1.js +5 -0
  55. package/dist/bromcom-ui/{p-750ae53a.entry.js → p-e92d9879.entry.js} +1 -1
  56. package/dist/bromcom-ui/{p-7a1e7141.entry.js → p-e9c963b3.entry.js} +1 -1
  57. package/dist/bromcom-ui/{p-dc9466d6.entry.js → p-ebee9f45.entry.js} +1 -1
  58. package/dist/bromcom-ui/{p-178b60e4.entry.js → p-ef8bbaf3.entry.js} +1 -1
  59. package/dist/bromcom-ui/p-f0350c0c.entry.js +5 -0
  60. package/dist/bromcom-ui/p-f302cbdf.entry.js +5 -0
  61. package/dist/bromcom-ui/{p-68abefd2.entry.js → p-f331e009.entry.js} +1 -1
  62. package/dist/bromcom-ui/{p-290645b8.entry.js → p-f3b546c6.entry.js} +1 -1
  63. package/dist/bromcom-ui/{p-ef14e4b5.entry.js → p-f532862e.entry.js} +1 -1
  64. package/dist/bromcom-ui/{p-342bc96d.entry.js → p-f889d1b6.entry.js} +1 -1
  65. package/dist/bromcom-ui/p-f8bf531f.entry.js +5 -0
  66. package/dist/bromcom-ui/{p-d18f5ae5.entry.js → p-f8cbdade.entry.js} +1 -1
  67. package/dist/bromcom-ui/{p-139ee01e.entry.js → p-fb22bc06.entry.js} +1 -1
  68. package/dist/bromcom-ui/p-fceaf172.entry.js +5 -0
  69. package/dist/cjs/bcm-accordion.cjs.entry.js +1 -1
  70. package/dist/cjs/bcm-alert.cjs.entry.js +1 -1
  71. package/dist/cjs/bcm-attendance.cjs.entry.js +1 -1
  72. package/dist/cjs/bcm-avatar.cjs.entry.js +126 -0
  73. package/dist/cjs/bcm-badge_15.cjs.entry.js +1738 -0
  74. package/dist/cjs/bcm-breadcrumb.cjs.entry.js +1 -1
  75. package/dist/cjs/bcm-button-group.cjs.entry.js +1 -1
  76. package/dist/cjs/bcm-card.cjs.entry.js +2 -2
  77. package/dist/cjs/bcm-checkbox-group.cjs.entry.js +17 -17
  78. package/dist/cjs/bcm-checkbox-lite_9.cjs.entry.js +1 -1
  79. package/dist/cjs/{bcm-checkbox_2.cjs.entry.js → bcm-checkbox.cjs.entry.js} +2 -13
  80. package/dist/cjs/bcm-chip-group.cjs.entry.js +128 -0
  81. package/dist/cjs/bcm-chip.cjs.entry.js +90 -0
  82. package/dist/cjs/bcm-collapse.cjs.entry.js +1 -1
  83. package/dist/cjs/bcm-color-input.cjs.entry.js +4 -4
  84. package/dist/cjs/{bcm-avatar_15.cjs.entry.js → bcm-colorful.cjs.entry.js} +3 -6320
  85. package/dist/cjs/bcm-date-picker.cjs.entry.js +1 -1
  86. package/dist/cjs/bcm-datetime-picker.cjs.entry.js +1 -1
  87. package/dist/cjs/bcm-default.cjs.entry.js +1 -1
  88. package/dist/cjs/bcm-drawer.cjs.entry.js +4 -4
  89. package/dist/cjs/bcm-expansion-panel.cjs.entry.js +2 -2
  90. package/dist/cjs/bcm-form-2.cjs.entry.js +1 -1
  91. package/dist/cjs/bcm-form.cjs.entry.js +488 -0
  92. package/dist/cjs/bcm-input-custom.cjs.entry.js +1 -1
  93. package/dist/cjs/bcm-input.cjs.entry.js +370 -0
  94. package/dist/cjs/bcm-label.cjs.entry.js +44 -0
  95. package/dist/cjs/bcm-list_3.cjs.entry.js +4025 -0
  96. package/dist/cjs/bcm-modal-2-footer.cjs.entry.js +4 -4
  97. package/dist/cjs/bcm-modal-2-header.cjs.entry.js +4 -4
  98. package/dist/cjs/bcm-modal-2.cjs.entry.js +4 -4
  99. package/dist/cjs/bcm-modal.cjs.entry.js +1 -1
  100. package/dist/cjs/bcm-popconfirm-box.cjs.entry.js +2 -2
  101. package/dist/cjs/bcm-popconfirm.cjs.entry.js +1 -1
  102. package/dist/cjs/bcm-progress.cjs.entry.js +2 -2
  103. package/dist/cjs/bcm-radio-group.cjs.entry.js +4 -4
  104. package/dist/cjs/bcm-radio.cjs.entry.js +4 -4
  105. package/dist/cjs/bcm-range.cjs.entry.js +1 -1
  106. package/dist/cjs/bcm-skeleton.cjs.entry.js +1 -1
  107. package/dist/cjs/bcm-step.cjs.entry.js +2 -2
  108. package/dist/cjs/bcm-stepper.cjs.entry.js +5 -5
  109. package/dist/cjs/bcm-switch.cjs.entry.js +1 -1
  110. package/dist/cjs/bcm-tag.cjs.entry.js +2 -2
  111. package/dist/cjs/bcm-textarea.cjs.entry.js +2 -2
  112. package/dist/cjs/bcm-time-picker.cjs.entry.js +1 -1
  113. package/dist/cjs/bcm-toast.cjs.entry.js +1 -1
  114. package/dist/cjs/bromcom-ui.cjs.js +1 -1
  115. package/dist/cjs/{color-helper-d6d2028b.js → color-helper-7ab15732.js} +27 -1
  116. package/dist/cjs/{generate-28ac852f.js → generate-d0470117.js} +55 -5
  117. package/dist/cjs/index-906fb4e5.js +540 -0
  118. package/dist/cjs/index-b08b037a.js +52 -0
  119. package/dist/cjs/{input-template-bcaa86c5.js → input-template-e1d297ed.js} +1 -1
  120. package/dist/cjs/{json-parse-decarator-0b5727ab.js → json-parse-decarator-026354f1.js} +1 -1
  121. package/dist/cjs/loader.cjs.js +1 -1
  122. package/dist/cjs/{number-helper-2fafa94f.js → number-helper-b3d57233.js} +1 -1
  123. package/dist/cjs/old-bcm-popover-box.cjs.entry.js +2 -2
  124. package/dist/cjs/old-bcm-popover.cjs.entry.js +1 -1
  125. package/dist/cjs/{stepper-states-66d5d6c4.js → stepper-states-09cd4bed.js} +1 -1
  126. package/dist/cjs/{validators-b22310ad.js → validators-39ca1c93.js} +1 -1
  127. package/dist/collection/components/atoms/avatar/avatar.js +95 -80
  128. package/dist/collection/components/atoms/avatar/avatar.style.js +39 -0
  129. package/dist/collection/components/atoms/badge/badge.js +29 -90
  130. package/dist/collection/components/atoms/badge/badge.style.js +39 -0
  131. package/dist/collection/components/molecules/items/items.js +1 -1
  132. package/dist/collection/components/molecules/linked/linked.js +12 -0
  133. package/dist/collection/components/molecules/menu/menu.js +1 -0
  134. package/dist/collection/components/molecules/popover/popover.js +1 -1
  135. package/dist/collection/components/molecules/tab-group/tab-group.js +5 -1
  136. package/dist/collection/components/molecules/tab-group/tab-item-header.js +11 -26
  137. package/dist/collection/components/molecules/tooltip/tooltip.js +1 -1
  138. package/dist/collection/components/other/typography/typography.js +1 -1
  139. package/dist/collection/helper/color-helper.js +27 -1
  140. package/dist/collection/helper/generate.js +54 -4
  141. package/dist/collection/helper/popover-helper.js +13 -9
  142. package/dist/collection/helper/tooltip-helper.js +12 -4
  143. package/dist/components/avatar.js +91 -52
  144. package/dist/components/badge.js +109 -46
  145. package/dist/components/bcm-items.js +1 -1
  146. package/dist/components/bcm-popover.js +14 -10
  147. package/dist/components/bcm-tab-group.js +5 -1
  148. package/dist/components/bcm-tab-item-header.js +11 -26
  149. package/dist/components/color-helper.js +27 -1
  150. package/dist/components/generate.js +55 -5
  151. package/dist/components/linked.js +12 -0
  152. package/dist/components/menu.js +1 -0
  153. package/dist/components/tooltip-helper.js +12 -4
  154. package/dist/components/tooltip.js +1 -1
  155. package/dist/components/typography.js +1 -1
  156. package/dist/esm/bcm-accordion.entry.js +1 -1
  157. package/dist/esm/bcm-alert.entry.js +1 -1
  158. package/dist/esm/bcm-attendance.entry.js +1 -1
  159. package/dist/esm/bcm-avatar.entry.js +122 -0
  160. package/dist/esm/bcm-badge_15.entry.js +1720 -0
  161. package/dist/esm/bcm-breadcrumb.entry.js +1 -1
  162. package/dist/esm/bcm-button-group.entry.js +1 -1
  163. package/dist/esm/bcm-card.entry.js +3 -3
  164. package/dist/esm/bcm-checkbox-group.entry.js +8 -8
  165. package/dist/esm/bcm-checkbox-lite_9.entry.js +2 -2
  166. package/dist/esm/{bcm-checkbox_2.entry.js → bcm-checkbox.entry.js} +4 -14
  167. package/dist/esm/bcm-chip-group.entry.js +124 -0
  168. package/dist/esm/bcm-chip.entry.js +86 -0
  169. package/dist/esm/bcm-collapse-group.entry.js +1 -1
  170. package/dist/esm/bcm-collapse.entry.js +1 -1
  171. package/dist/esm/bcm-color-input.entry.js +6 -6
  172. package/dist/esm/{bcm-avatar_15.entry.js → bcm-colorful.entry.js} +4 -6307
  173. package/dist/esm/bcm-colorpicker.entry.js +2 -2
  174. package/dist/esm/bcm-date-picker.entry.js +2 -2
  175. package/dist/esm/bcm-datetime-picker.entry.js +3 -3
  176. package/dist/esm/bcm-default.entry.js +1 -1
  177. package/dist/esm/bcm-drawer.entry.js +6 -6
  178. package/dist/esm/bcm-expansion-panel.entry.js +3 -3
  179. package/dist/esm/bcm-form-2.entry.js +1 -1
  180. package/dist/esm/bcm-form.entry.js +484 -0
  181. package/dist/esm/bcm-input-custom.entry.js +1 -1
  182. package/dist/esm/bcm-input.entry.js +366 -0
  183. package/dist/esm/bcm-label.entry.js +40 -0
  184. package/dist/esm/bcm-list_3.entry.js +4019 -0
  185. package/dist/esm/bcm-modal-2-footer.entry.js +6 -6
  186. package/dist/esm/bcm-modal-2-header.entry.js +6 -6
  187. package/dist/esm/bcm-modal-2.entry.js +6 -6
  188. package/dist/esm/bcm-modal.entry.js +1 -1
  189. package/dist/esm/bcm-old-input.entry.js +1 -1
  190. package/dist/esm/bcm-old-tag_2.entry.js +1 -1
  191. package/dist/esm/bcm-popconfirm-box.entry.js +3 -3
  192. package/dist/esm/bcm-popconfirm.entry.js +1 -1
  193. package/dist/esm/bcm-progress.entry.js +3 -3
  194. package/dist/esm/bcm-radio-group.entry.js +6 -6
  195. package/dist/esm/bcm-radio.entry.js +6 -6
  196. package/dist/esm/bcm-range.entry.js +2 -2
  197. package/dist/esm/bcm-select.entry.js +1 -1
  198. package/dist/esm/bcm-skeleton.entry.js +1 -1
  199. package/dist/esm/bcm-step.entry.js +2 -2
  200. package/dist/esm/bcm-stepper.entry.js +7 -7
  201. package/dist/esm/bcm-switch.entry.js +2 -2
  202. package/dist/esm/bcm-table.entry.js +1 -1
  203. package/dist/esm/bcm-tabs-content.entry.js +1 -1
  204. package/dist/esm/bcm-tabs.entry.js +1 -1
  205. package/dist/esm/bcm-tag.entry.js +3 -3
  206. package/dist/esm/bcm-textarea.entry.js +3 -3
  207. package/dist/esm/bcm-time-picker.entry.js +2 -2
  208. package/dist/esm/bcm-toast.entry.js +2 -2
  209. package/dist/esm/bromcom-ui.js +1 -1
  210. package/dist/esm/{color-helper-e8ce23d7.js → color-helper-116755ed.js} +28 -2
  211. package/dist/esm/{element-dragger-89bb52fd.js → element-dragger-7ea06c76.js} +1 -1
  212. package/dist/esm/{generate-ce54344e.js → generate-abec36e5.js} +55 -5
  213. package/dist/esm/index-6310a048.js +537 -0
  214. package/dist/esm/index-962dec74.js +50 -0
  215. package/dist/esm/{input-template-c94b6b1f.js → input-template-a02d00ff.js} +1 -1
  216. package/dist/esm/{json-parse-decarator-1ef87c07.js → json-parse-decarator-268fe3de.js} +1 -1
  217. package/dist/esm/loader.js +1 -1
  218. package/dist/esm/{number-helper-ec5c12ef.js → number-helper-cf26accd.js} +1 -1
  219. package/dist/esm/old-bcm-popover-box.entry.js +4 -4
  220. package/dist/esm/old-bcm-popover.entry.js +1 -1
  221. package/dist/esm/{stepper-states-cbe1d076.js → stepper-states-cf443480.js} +1 -1
  222. package/dist/esm/{utils-57652744.js → utils-b3338faf.js} +1 -1
  223. package/dist/esm/{validators-c4976054.js → validators-63753298.js} +1 -1
  224. package/dist/types/components/atoms/avatar/avatar.d.ts +8 -10
  225. package/dist/types/components/atoms/avatar/avatar.style.d.ts +5 -0
  226. package/dist/types/components/atoms/badge/badge.d.ts +3 -7
  227. package/dist/types/components/atoms/badge/badge.style.d.ts +4 -0
  228. package/dist/types/components/molecules/linked/linked.d.ts +1 -0
  229. package/dist/types/components.d.ts +11 -13
  230. package/dist/types/helper/color-helper.d.ts +22 -2
  231. package/dist/types/helper/generate.d.ts +21 -1
  232. package/dist/types/helper/popover-helper.d.ts +0 -5
  233. package/dist/types/helper/tooltip-helper.d.ts +0 -1
  234. package/package.json +7 -4
  235. package/dist/bromcom-ui/p-294186b9.js +0 -5
  236. package/dist/bromcom-ui/p-327138ea.entry.js +0 -5
  237. package/dist/bromcom-ui/p-36a1427f.entry.js +0 -5
  238. package/dist/bromcom-ui/p-4a3ce7f3.entry.js +0 -5
  239. package/dist/bromcom-ui/p-5f63beda.js +0 -5
  240. package/dist/bromcom-ui/p-62e84379.js +0 -5
  241. package/dist/bromcom-ui/p-843905c8.js +0 -5
  242. package/dist/bromcom-ui/p-8a162271.entry.js +0 -5
  243. package/dist/bromcom-ui/p-8e66297f.entry.js +0 -5
  244. package/dist/bromcom-ui/p-96eeadc0.entry.js +0 -5
  245. package/dist/bromcom-ui/p-9c90a235.entry.js +0 -19
  246. package/dist/bromcom-ui/p-c165837c.entry.js +0 -5
  247. package/dist/bromcom-ui/p-c30f52d8.entry.js +0 -5
  248. package/dist/bromcom-ui/p-c7f37d7a.entry.js +0 -5
  249. package/dist/bromcom-ui/p-ccc60ce1.js +0 -5
  250. package/dist/bromcom-ui/p-d230907f.entry.js +0 -5
  251. package/dist/bromcom-ui/p-d832cf50.entry.js +0 -5
  252. package/dist/bromcom-ui/p-e9aaa98b.entry.js +0 -5
  253. package/dist/cjs/bcm-dropdown.cjs.entry.js +0 -118
  254. package/dist/cjs/bcm-item.cjs.entry.js +0 -71
  255. package/dist/cjs/bcm-items.cjs.entry.js +0 -48
  256. package/dist/cjs/bcm-menu.cjs.entry.js +0 -149
  257. package/dist/cjs/bcm-popover.cjs.entry.js +0 -225
  258. package/dist/cjs/bcm-tab-group.cjs.entry.js +0 -205
  259. package/dist/cjs/bcm-tab-item-header.cjs.entry.js +0 -73
  260. package/dist/cjs/bcm-tab-item.cjs.entry.js +0 -90
  261. package/dist/cjs/bcm-text.cjs.entry.js +0 -49
  262. package/dist/cjs/tooltip-helper-9fc8df71.js +0 -150
  263. package/dist/collection/components/atoms/avatar/avatar.css +0 -198
  264. package/dist/collection/components/atoms/badge/badge.css +0 -231
  265. package/dist/esm/bcm-dropdown.entry.js +0 -114
  266. package/dist/esm/bcm-item.entry.js +0 -67
  267. package/dist/esm/bcm-items.entry.js +0 -44
  268. package/dist/esm/bcm-menu.entry.js +0 -145
  269. package/dist/esm/bcm-popover.entry.js +0 -221
  270. package/dist/esm/bcm-tab-group.entry.js +0 -201
  271. package/dist/esm/bcm-tab-item-header.entry.js +0 -69
  272. package/dist/esm/bcm-tab-item.entry.js +0 -86
  273. package/dist/esm/bcm-text.entry.js +0 -45
  274. package/dist/esm/tooltip-helper-92eb0102.js +0 -148
@@ -0,0 +1,4025 @@
1
+ /*!
2
+ * Built with Stencil
3
+ * Copyright (c) Bromcom.
4
+ */
5
+ 'use strict';
6
+
7
+ Object.defineProperty(exports, '__esModule', { value: true });
8
+
9
+ const index$2 = require('./index-ddfd6d8f.js');
10
+ const isLoadDecorator = require('./is-load-decorator-137dded1.js');
11
+ const jsonParseDecarator = require('./json-parse-decarator-026354f1.js');
12
+ require('./color-helper-7ab15732.js');
13
+ require('./datetime-helper-eaf4fadb.js');
14
+ const generate = require('./generate-d0470117.js');
15
+ const numberHelper = require('./number-helper-b3d57233.js');
16
+ const stringHelper = require('./string-helper-d681e5c7.js');
17
+ const validators = require('./validators-39ca1c93.js');
18
+ require('./element-dragger-a8562f82.js');
19
+ const popoverPlacement = require('./popover-placement-ccb40073.js');
20
+ const utils = require('./utils-fc077139.js');
21
+ const bcm = require('./bcm-ab921827.js');
22
+ const captionTemplate = require('./caption-template-8d099fd6.js');
23
+ const index$1 = require('./index-fdbf5226.js');
24
+ require('./types-cc4adee7.js');
25
+ const labelTemplate = require('./label-template-4d5f99a5.js');
26
+ require('./types-7523fd99.js');
27
+ const index$3 = require('./index-4506fcd7.js');
28
+ const index$4 = require('./index-906fb4e5.js');
29
+ const _commonjsHelpers = require('./_commonjsHelpers-bd20f4c0.js');
30
+ const inputTemplate = require('./input-template-e1d297ed.js');
31
+ require('./colors-56282b00.js');
32
+ require('./colors-e1d142ad.js');
33
+ require('./slot-template-d70ea082.js');
34
+
35
+ const CheckboxTemplate = ({ disabled, checked, readonly, required, indeterminate, hidden, captionType, _id }) => {
36
+ // if ( indeterminate ) {
37
+ // checked = indeterminate == 'determinate' ? true : false
38
+ // }
39
+ const hostClasses = index$1.classnames('bcm-checkbox', 'bcm-checkbox__type-default', `bcm-checkbox-size-medium`, {
40
+ // 'size-2': size === Bcm.Size.small || size === Bcm.Size.medium,
41
+ // 'size-3': optionType === 'button' && size === Bcm.Size.large,
42
+ 'error': captionType == bcm.Bcm$1.Status.error,
43
+ hidden,
44
+ checked,
45
+ disabled,
46
+ required,
47
+ readonly,
48
+ });
49
+ const bcmCheckboxIconClass = index$1.classnames('bcm-checkbox__label-icon', 'bcm-checkbox__label-icon-lite', 'bcm-checkbox__label-icon-' + indeterminate, {
50
+ 'bcm-checkbox__label-icon-checked': checked,
51
+ });
52
+ const bcmCheckboxLabelClass = index$1.classnames('bcm-checkbox__label');
53
+ return (index$2.h("div", { class: hostClasses },
54
+ index$2.h("input", { tabindex: "-1", id: _id, type: "checkbox", checked: checked, disabled: disabled, required: required, readonly: readonly }),
55
+ index$2.h("label", { class: bcmCheckboxLabelClass, htmlFor: _id },
56
+ index$2.h("span", { class: bcmCheckboxIconClass },
57
+ index$2.h("bcm-icon", { icon: "far fa-check" })))));
58
+ };
59
+
60
+ const InfoFooterTemplate = ({ selected, total, found, multiple, variableText }) => {
61
+ total = total || 0;
62
+ variableText = variableText ? utils.pluralize(variableText, total) : 'items';
63
+ return (index$2.h("footer", { class: "bcm-info-footer" },
64
+ index$2.h("bcm-text", { scale: "size-1", color: "grey-8" },
65
+ (multiple && selected > 0) && ` ( ${selected} selected ) `,
66
+ ` Total ${total} `,
67
+ found != null && ` / ${found} `,
68
+ ` ${variableText} found. `)));
69
+ };
70
+
71
+ const ListItemTemplate = ({ item, treeview, highlight, checkboxes, size, selectedItem, openGroup, checkedItem, focusItem, searchIsOnlyChilds }) => {
72
+ const isHaveChildren = item.items && item.items.length > 0;
73
+ var text = stringHelper.StringHelper.htmlEntities(item.text);
74
+ let intersection = [];
75
+ if (highlight && stringHelper.StringHelper.slugify(text).includes(stringHelper.StringHelper.slugify(highlight))) {
76
+ if (!searchIsOnlyChilds || (searchIsOnlyChilds && (!isHaveChildren || (!treeview && item.type != "group")))) {
77
+ text = stringHelper.StringHelper.highlight(text, highlight);
78
+ }
79
+ }
80
+ if (item.type != 'group' && item.template) {
81
+ const match = item.template
82
+ .replace(/\s/g, '')
83
+ .match(/\{{[^}}]+\}/g)
84
+ .map(x => x.replace(/[{}]/g, ''));
85
+ const keys = Object.keys(item.itemObject);
86
+ intersection = match.filter(x => keys.includes(x));
87
+ }
88
+ text = item.isHtmlContent ? item.isHtmlContent : item.template && intersection.length > 0 ? stringHelper.StringHelper.templateParser(item.template, Object.assign(Object.assign({}, item.itemObject), { text })) : text;
89
+ const unClickable = !treeview && item.type == "group" && !item.clickable;
90
+ const disabled = item.disabled;
91
+ const readonly = item.readonly;
92
+ const itemClick = (event) => {
93
+ let path = event.path || event.composedPath();
94
+ if (path.filter(x => x.attributes && x.attributes.getNamedItem("unlinked"))[0]) {
95
+ return;
96
+ }
97
+ if (readonly) {
98
+ collapseClick();
99
+ }
100
+ !unClickable && !disabled && !readonly && (checkboxes ? checkedItem(item.id) : selectedItem(item.id));
101
+ };
102
+ const collapseClick = () => {
103
+ item.open = item.isSearching;
104
+ openGroup(item.id);
105
+ };
106
+ return (index$2.h("div", { id: item.id, hidden: item.hidden, "on-focus": e => !unClickable && !disabled && focusItem(e), class: index$1.classnames('bcm-list__item',
107
+ // size === 'large' ? 'size-3' : 'size-2',
108
+ 'bcm-list__item-' + size, {
109
+ 'bcm-list__item--group': !treeview && item.type == 'group',
110
+ 'bcm-list__item--readonly': readonly,
111
+ }) },
112
+ index$2.h("div", { class: index$1.classnames('bcm-list__item-content', !checkboxes && item.selected && 'selected', { disabled: disabled }) },
113
+ treeview && (index$2.h("div", { class: "bcm-list__item-content-collapse-icon", onClick: () => collapseClick() }, isHaveChildren && index$2.h("bcm-icon", { icon: index$1.classnames('fas fa-caret-' + (item.isSearching || item.open ? 'down' : 'right')) }))),
114
+ index$2.h("div", { class: index$1.classnames('bcm-list__item-content-text', { treeview }), onClick: (e) => itemClick(e) },
115
+ checkboxes && (treeview || (!treeview && item.type != 'group')) && (index$2.h("div", { class: "bcm-list__item-content-text-checkbox" },
116
+ index$2.h(CheckboxTemplate, { indeterminate: item.indeterminate, checked: item.checked, disabled: item.disabled }))),
117
+ index$2.h("span", Object.assign({ class: "bcm-list__item-content-text-inner" }, (item.title && { "title": item.title }), { innerHTML: text })))),
118
+ (treeview || !treeview && item.type == "group") && isHaveChildren && (index$2.h("div", { class: "bcm-list__item-childs" }, (item.isSearching || item.open || (!treeview && item.type == "group")) &&
119
+ item.items.map((item) => (index$2.h(ListItemTemplate, { highlight: highlight, item: item, searchIsOnlyChilds: searchIsOnlyChilds, treeview: treeview, checkboxes: checkboxes, size: size, selectedItem: selectedItem, checkedItem: checkedItem, openGroup: parentId => openGroup(parentId), focusItem: itemId => focusItem(itemId) })))))));
120
+ };
121
+
122
+ const ListTemplate = ({ highlight, selectAllItem, bcmListContainer, treeview, checkboxes, checkAll, infoFooter, value, totalData, searchFound, variableText, _id, data, width, height, size, searchPlaceholder, minSearchLength, selectedItem, openGroup, checkedItem, onScrollEvent, focusItem, items, searchable, searchIsOnlyChilds, emptyText, emptyIcon, }) => {
123
+ const showSelectAll = !(treeview && searchFound > 0) && !(searchFound > 0);
124
+ const setScrollHeight = () => {
125
+ const itemHeight = size === 'small' ? 28 : size === 'medium' ? 36 : 48;
126
+ const itemCount = searchFound == null ? (treeview ? items.length : totalData) : searchFound;
127
+ const scrollHeight = itemCount * itemHeight || 0;
128
+ return {
129
+ 'min-height': `${scrollHeight}px`,
130
+ 'overscroll-behavior': 'none',
131
+ 'height': '100%',
132
+ 'display': 'flex',
133
+ 'flex-direction': 'column',
134
+ };
135
+ };
136
+ return (index$2.h("div", { id: `bcm-list-${_id}`, class: bcmListContainer, style: { '--height': height, '--width': width } },
137
+ data && searchable && (index$2.h("section", { class: "bcm-list__container-search" },
138
+ index$2.h("bcm-search", { size: size, id: `bcm-list-${_id}-search`, data: data, clearable: true, placeholder: searchPlaceholder, "min-search-length": minSearchLength, searchIsOnlyChilds: searchIsOnlyChilds }))),
139
+ index$2.h("main", { onScroll: e => onScrollEvent(e), class: "scrolling", style: { 'overscroll-behavior': 'none' } },
140
+ index$2.h("div", { style: setScrollHeight() },
141
+ checkAll && searchFound != 0 && items && items.length > 0 && checkboxes && showSelectAll && (index$2.h("section", { class: "bcm-list__container-select-all" },
142
+ index$2.h(ListItemTemplate, { size: size, item: selectAllItem, treeview: false, checkboxes: true, selectedItem: itemId => selectedItem(itemId), checkedItem: itemId => checkedItem(itemId), openGroup: parentId => openGroup(parentId), focusItem: itemId => focusItem(itemId) }))),
143
+ items.map((item) => (index$2.h(ListItemTemplate, { highlight: highlight, size: size, item: item, searchIsOnlyChilds: searchIsOnlyChilds, treeview: treeview, checkboxes: checkboxes, selectedItem: itemId => selectedItem(itemId), checkedItem: itemId => checkedItem(itemId), openGroup: parentId => openGroup(parentId), focusItem: itemId => focusItem(itemId) }))),
144
+ (!items || items.length === 0) && searchFound != 0 && (index$2.h("section", { class: "bcm-list__container-no-data" },
145
+ index$2.h("bcm-empty", { style: { height: 'auto' }, icon: emptyIcon },
146
+ index$2.h("span", { innerHTML: emptyText || 'No data' })))),
147
+ searchFound == 0 && (index$2.h("section", { class: "bcm-list__container-no-data" },
148
+ index$2.h("bcm-empty", { style: { height: 'auto' }, icon: emptyIcon },
149
+ index$2.h("span", { innerHTML: emptyText || 'No Data Found' })))))),
150
+ infoFooter && data && data.length > 0 && (index$2.h(InfoFooterTemplate, { selected: value === null || value === void 0 ? void 0 : value.length, total: totalData, found: searchFound, multiple: checkboxes, variableText: variableText }))));
151
+ };
152
+
153
+ const { state: state$1 } = index$3.createStore({
154
+ value: new Map(),
155
+ });
156
+ const setValue$1 = val => {
157
+ const { id, dataSource, options } = val;
158
+ const { type, treeview, checkboxes, searchable, value, name, label, size, disabled, readonly, highlight, required, hidden, fullWidth, height, maxHeight, minHeight, width, infoFooter, variableText, template, allOpen, keyControl, checkAll, linkedComponent, placeholder, searchPlaceholder, searchIsOnlyChilds, clearable, caption, noCaption, captionType, captionError, placement, } = options;
159
+ const itemOptions = { size, checkboxes, template, allOpen, highlight, treeview };
160
+ const data = {
161
+ id: generate.snq(() => id, generate.Generate.UID),
162
+ dataSource: dataSource && dataSource.length > 0 && recursive$1(dataSource, itemOptions),
163
+ options: {
164
+ type,
165
+ treeview,
166
+ checkboxes,
167
+ searchable,
168
+ value,
169
+ name,
170
+ label,
171
+ size,
172
+ disabled,
173
+ readonly,
174
+ highlight,
175
+ required,
176
+ hidden,
177
+ fullWidth,
178
+ height,
179
+ maxHeight,
180
+ minHeight,
181
+ width,
182
+ infoFooter,
183
+ variableText,
184
+ template,
185
+ allOpen,
186
+ keyControl,
187
+ checkAll,
188
+ linkedComponent,
189
+ placeholder,
190
+ searchPlaceholder,
191
+ searchIsOnlyChilds,
192
+ clearable,
193
+ caption,
194
+ noCaption,
195
+ captionType,
196
+ captionError,
197
+ placement,
198
+ },
199
+ totalItems: (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) > 0 && calculateTotalItems(dataSource, options.treeview),
200
+ totalRoots: dataSource === null || dataSource === void 0 ? void 0 : dataSource.length,
201
+ };
202
+ state$1.value.set(data.id, data);
203
+ };
204
+ const recursive$1 = (data, options, parentId, parentIndex = "0.") => {
205
+ let recData = [];
206
+ if (data && data.length > 0) {
207
+ recData = data.map((item, index) => (Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ itemObject: item }, item), options), { parentId: generate.snq(() => parentId, null), open: options.allOpen || item.open || false }), ((options.treeview || (!options.treeview && item.type == 'group')) && item.items && item.items.length > 0
208
+ ? { items: generate.snq(() => recursive$1(item.items, options, item.id, `${parentIndex}${index}`), []) }
209
+ : { items: [] })), { ct: `${parentIndex}${index}` })));
210
+ }
211
+ return recData;
212
+ };
213
+ const removeValue$1 = _id => {
214
+ state$1.value.delete(_id);
215
+ };
216
+ const getValue$1 = id => generate.snq(() => state$1.value.get(id), {});
217
+ const calculateTotalItems = (dataSource, treeview) => {
218
+ let total = 0;
219
+ dataSource.forEach(item => {
220
+ if (treeview || (!treeview && item.type != "group")) {
221
+ total += 1;
222
+ }
223
+ if ((treeview || (!treeview && item.type == "group")) && item.items) {
224
+ total += calculateTotalItems(item.items, treeview);
225
+ }
226
+ });
227
+ return total;
228
+ };
229
+ const getData = id => {
230
+ let data = [];
231
+ const value = getValue$1(id);
232
+ if (value) {
233
+ const { dataSource } = value;
234
+ data = dataSource;
235
+ }
236
+ return data;
237
+ };
238
+ const getDataPagination$1 = (id, limit = 3, ids) => {
239
+ let data = [];
240
+ const value = getValue$1(id);
241
+ if (value) {
242
+ const { dataSource } = value;
243
+ data = !ids ? dataSource.slice(0, limit) : dataSource.filter(item => ids.indexOf(item.id) > -1).slice(0, limit);
244
+ }
245
+ return data;
246
+ };
247
+ const openGroup = (id, groupId, items, status) => {
248
+ let dataSource;
249
+ if (items) {
250
+ dataSource = items;
251
+ }
252
+ else {
253
+ const value = getValue$1(id);
254
+ dataSource = value.dataSource;
255
+ }
256
+ if (dataSource) {
257
+ dataSource.forEach(item => {
258
+ if (status != undefined) {
259
+ item.open = status;
260
+ }
261
+ else if (item.id == groupId) {
262
+ item.open = !item.open;
263
+ item.isSearching = item.open;
264
+ if (!item.open && item.items) {
265
+ openGroup(id, groupId, item.items, false);
266
+ }
267
+ }
268
+ else if (item.items) {
269
+ openGroup(id, groupId, item.items);
270
+ }
271
+ });
272
+ }
273
+ };
274
+ const removeOtherTags = (id, ids, items) => {
275
+ ids = Array.isArray(ids) ? ids : [ids];
276
+ let dataSource;
277
+ if (items) {
278
+ dataSource = items;
279
+ }
280
+ else {
281
+ const value = getValue$1(id);
282
+ dataSource = value.dataSource;
283
+ }
284
+ if (dataSource) {
285
+ ids.forEach(otherTagIds => {
286
+ dataSource.forEach(child => {
287
+ if (child.id == otherTagIds) {
288
+ child.checked = false;
289
+ child.itemObject.checked = false;
290
+ }
291
+ else if (child.items) {
292
+ onRemoveItems(id, otherTagIds, child.items);
293
+ }
294
+ });
295
+ });
296
+ }
297
+ };
298
+ const onRemoveItems = (id, itemId, items) => {
299
+ if (items) {
300
+ items.forEach(item => {
301
+ if (item.id == itemId) {
302
+ item.checked = false;
303
+ item.itemObject.checked = false;
304
+ indeterminateStatus(id, item.parentId);
305
+ }
306
+ else if (item.items) {
307
+ onRemoveItems(id, itemId, item.items);
308
+ }
309
+ });
310
+ }
311
+ };
312
+ const addChecked = (id, ids) => {
313
+ const value = getValue$1(id);
314
+ if (value) {
315
+ ids.forEach(item => {
316
+ checkedItem(id, item);
317
+ });
318
+ }
319
+ };
320
+ const checkedItem = (id, itemId) => {
321
+ findItem(id, itemId);
322
+ };
323
+ const findItem = (id, itemId, items) => {
324
+ itemId = Array.isArray(itemId) ? itemId : [itemId];
325
+ let dataSource;
326
+ if (items) {
327
+ dataSource = items;
328
+ }
329
+ else {
330
+ const value = getValue$1(id);
331
+ dataSource = value.dataSource;
332
+ }
333
+ if (dataSource) {
334
+ dataSource.forEach(item => {
335
+ if (itemId.includes(item.id)) {
336
+ checkedProcess(id, item);
337
+ if (item.parentId) {
338
+ indeterminateStatus(id, item.parentId);
339
+ }
340
+ }
341
+ else if (item.items) {
342
+ findItem(id, itemId, item.items);
343
+ }
344
+ });
345
+ }
346
+ };
347
+ const checkedProcess = (id, item, status) => {
348
+ const value = getValue$1(id);
349
+ if (value) {
350
+ const treeview = value.options.treeview;
351
+ if (item) {
352
+ // && !item.hidden => select all bastığımızda hidden olanları seçmemesi içindi
353
+ if (treeview || (!treeview && item.type != "group")) {
354
+ if (!item.disabled) {
355
+ if (status != undefined) {
356
+ item.checked = status;
357
+ }
358
+ else {
359
+ item.checked = !item.checked;
360
+ }
361
+ item.itemObject.checked = item.checked;
362
+ item.indeterminate = item.checked ? "determinate" : "uncheck";
363
+ }
364
+ }
365
+ if (item.items) {
366
+ item.items.forEach(child => {
367
+ checkedProcess(id, child, status == undefined ? item.checked : status);
368
+ });
369
+ }
370
+ }
371
+ }
372
+ };
373
+ const indeterminateStatus = (id, itemId, items) => {
374
+ let dataSource;
375
+ if (items) {
376
+ dataSource = items;
377
+ }
378
+ else {
379
+ const value = getValue$1(id);
380
+ dataSource = value.dataSource;
381
+ }
382
+ if (dataSource) {
383
+ dataSource.forEach(item => {
384
+ if (item.id == itemId) {
385
+ let allChecked = true;
386
+ let allUnchecked = true;
387
+ if (item.items) {
388
+ item.items.map(child => {
389
+ (child.checked || child.indeterminate === "indeterminate") && (allUnchecked = false);
390
+ !child.checked && (allChecked = false);
391
+ });
392
+ }
393
+ const indeterminateState = !allChecked && !allUnchecked ? "indeterminate" : allChecked ? "determinate" : "uncheck";
394
+ item.indeterminate = indeterminateState;
395
+ item.checked = indeterminateState == "determinate" ? true : false;
396
+ item.itemObject.checked = item.checked;
397
+ if (item.parentId) {
398
+ indeterminateStatus(id, item.parentId);
399
+ }
400
+ }
401
+ else if (item.items) {
402
+ indeterminateStatus(id, itemId, item.items);
403
+ }
404
+ });
405
+ }
406
+ };
407
+ const filterData = (id, ids, items, searchOtherTag) => {
408
+ let checkeds = [];
409
+ let visibled = [];
410
+ getValue$1(id).isSearchOtherTag = searchOtherTag;
411
+ let dataSource;
412
+ if (items) {
413
+ dataSource = items;
414
+ }
415
+ else {
416
+ const value = getValue$1(id);
417
+ dataSource = value.dataSource;
418
+ }
419
+ if (dataSource) {
420
+ dataSource.forEach(item => {
421
+ if (ids) {
422
+ item.hidden = true;
423
+ // const filter = ids.find((find) => find.id === item.id)
424
+ var filter;
425
+ for (let index = 0; index < ids.length; index++) {
426
+ if (ids[index].id === item.id) {
427
+ filter = ids[index];
428
+ break;
429
+ }
430
+ }
431
+ if (filter) {
432
+ item.hidden = false;
433
+ if (!getValue$1(id).isSearchOtherTag) {
434
+ item.isSearching = true;
435
+ }
436
+ visibled.push(item);
437
+ if (item.checked) {
438
+ checkeds.push(item);
439
+ }
440
+ if (filter.items) {
441
+ const { checkedItems, visibledItems } = filterData(id, filter.items, item.items, searchOtherTag);
442
+ if (checkedItems) {
443
+ checkeds = [...new Set([...checkeds, ...checkedItems])];
444
+ }
445
+ if (visibledItems) {
446
+ visibled = [...new Set([...visibled, ...visibledItems])];
447
+ }
448
+ }
449
+ }
450
+ }
451
+ else {
452
+ item.hidden = false;
453
+ if (item.items) {
454
+ filterData(id, null, item.items);
455
+ }
456
+ visibled.push(item);
457
+ item.isSearching = false;
458
+ }
459
+ });
460
+ }
461
+ return { checkedItems: checkeds !== null && checkeds !== void 0 ? checkeds : [], visibledItems: visibled !== null && visibled !== void 0 ? visibled : [] };
462
+ };
463
+ const getSelected = (id, items) => {
464
+ let dataSource;
465
+ let selected = null;
466
+ if (items) {
467
+ dataSource = items;
468
+ }
469
+ else {
470
+ const value = getValue$1(id);
471
+ dataSource = value.dataSource;
472
+ }
473
+ if (dataSource) {
474
+ dataSource.forEach(item => {
475
+ if (item.selected) {
476
+ selected = item.itemObject;
477
+ }
478
+ else if (item.items) {
479
+ const found = getSelected(id, item.items);
480
+ if (found) {
481
+ selected = found;
482
+ }
483
+ }
484
+ });
485
+ }
486
+ return selected;
487
+ };
488
+ const getCheckedList = (id, items) => {
489
+ let dataSource;
490
+ let checkedList = [];
491
+ let nestedResult = [];
492
+ if (items) {
493
+ dataSource = items;
494
+ }
495
+ else {
496
+ const value = getValue$1(id);
497
+ dataSource = value.dataSource;
498
+ }
499
+ if (dataSource) {
500
+ dataSource.forEach(item => {
501
+ var _a;
502
+ const newItem = Object.assign(Object.assign({}, item.itemObject), { ct: item.ct });
503
+ let foundChild = [];
504
+ let foundItem = [];
505
+ if (item.checked) {
506
+ checkedList.push(newItem);
507
+ foundItem.push(Object.assign(Object.assign({}, newItem), { items: [] }));
508
+ }
509
+ if (item.items) {
510
+ const found = getCheckedList(id, item.items);
511
+ if (((_a = found === null || found === void 0 ? void 0 : found.checkedList) === null || _a === void 0 ? void 0 : _a.length) > 0) {
512
+ checkedList = [...checkedList, ...found.checkedList];
513
+ }
514
+ if (found.nestedResult.length > 0) {
515
+ foundChild = found.nestedResult;
516
+ }
517
+ }
518
+ if (foundChild.length > 0) {
519
+ if (foundItem.length == 0) {
520
+ foundItem.push(Object.assign(Object.assign({}, newItem), { items: [] }));
521
+ }
522
+ foundItem[0].items = foundChild;
523
+ nestedResult.push(foundItem[0]);
524
+ }
525
+ else {
526
+ if (foundItem.length > 0) {
527
+ foundItem[0].items = foundChild;
528
+ nestedResult.push(foundItem[0]);
529
+ }
530
+ }
531
+ });
532
+ }
533
+ return { checkedList: (checkedList === null || checkedList === void 0 ? void 0 : checkedList.length) > 0 ? checkedList : null, nestedResult: nestedResult };
534
+ };
535
+ const selectedItem = (id, itemId, items) => {
536
+ let dataSource;
537
+ let selected = [];
538
+ if (items) {
539
+ dataSource = items;
540
+ }
541
+ else {
542
+ const value = getValue$1(id);
543
+ dataSource = value.dataSource;
544
+ }
545
+ if (dataSource) {
546
+ dataSource.forEach(item => {
547
+ if (itemId) {
548
+ if (item.id == itemId) {
549
+ // if (!item.selected){
550
+ item.selected = true;
551
+ item.itemObject.selected = item.selected;
552
+ // }
553
+ }
554
+ else {
555
+ if (item.selected) {
556
+ item.selected = false;
557
+ item.itemObject.selected = item.selected;
558
+ }
559
+ }
560
+ }
561
+ if (item.items) {
562
+ const found = selectedItem(id, itemId, item.items);
563
+ if ((found === null || found === void 0 ? void 0 : found.length) > 0) {
564
+ selected = [...selected, ...found];
565
+ }
566
+ }
567
+ if (item.selected) {
568
+ selected.push(item.itemObject);
569
+ }
570
+ });
571
+ }
572
+ return selected && selected.length > 0 ? selected : null;
573
+ };
574
+ const setClear = (id, items) => {
575
+ let dataSource;
576
+ if (items) {
577
+ dataSource = items;
578
+ }
579
+ else {
580
+ const value = getValue$1(id);
581
+ dataSource = value.dataSource;
582
+ }
583
+ if (dataSource) {
584
+ dataSource.forEach(item => {
585
+ var _a, _b, _c;
586
+ item.checked && (item.checked = false);
587
+ item.selected && (item.selected = false);
588
+ item.indeterminate && (item.indeterminate = "uncheck");
589
+ ((_a = item.itemObject) === null || _a === void 0 ? void 0 : _a.checked) && (item.itemObject.checked = false);
590
+ ((_b = item.itemObject) === null || _b === void 0 ? void 0 : _b.selected) && (item.itemObject.selected = false);
591
+ ((_c = item.itemObject) === null || _c === void 0 ? void 0 : _c.indeterminate) && (item.itemObject.indeterminate = "uncheck");
592
+ if (item.items) {
593
+ setClear(id, item.items);
594
+ }
595
+ });
596
+ }
597
+ };
598
+ const selectAll = (id, status) => {
599
+ const dataSource = getValue$1(id).dataSource;
600
+ if (dataSource) {
601
+ dataSource.forEach(item => {
602
+ checkedProcess(id, item, status);
603
+ });
604
+ }
605
+ };
606
+ const updateOptions = (id, options) => {
607
+ Object.keys(getValue$1(id).options).forEach(key => {
608
+ getValue$1(id).options[key] = options[key];
609
+ });
610
+ };
611
+ const removeState = id => {
612
+ return Promise.resolve(state$1.value.delete(id));
613
+ };
614
+ const listState = {
615
+ setValue: setValue$1,
616
+ removeValue: removeValue$1,
617
+ getValue: getValue$1,
618
+ getData,
619
+ getDataPagination: getDataPagination$1,
620
+ openGroup,
621
+ checkedItem,
622
+ filterData,
623
+ getSelected,
624
+ getCheckedList,
625
+ selectedItem,
626
+ addChecked,
627
+ setClear,
628
+ selectAll,
629
+ removeOtherTags,
630
+ onRemoveItems,
631
+ updateOptions,
632
+ removeState,
633
+ };
634
+
635
+ class KeyControl {
636
+ constructor(keyCode, element, elementName, childElementName) {
637
+ this.elementName = '';
638
+ this.childElementName = '';
639
+ this.keyCode = keyCode;
640
+ this.element = element;
641
+ this.elementName = elementName;
642
+ this.childElementName = childElementName;
643
+ }
644
+ getKeyCode() {
645
+ return this.keyCode;
646
+ }
647
+ getElementName() {
648
+ return this.elementName;
649
+ }
650
+ getChildElementName() {
651
+ return this.childElementName;
652
+ }
653
+ getFocusedElementName() {
654
+ return this.getElementName() + '.focused';
655
+ }
656
+ getFocusedElement() {
657
+ return this.element.querySelectorAll(this.getFocusedElementName())[0] || null;
658
+ }
659
+ getFirstElement() {
660
+ return this.element.querySelectorAll(this.getElementName())[0] || null;
661
+ }
662
+ getNextElement() {
663
+ var _a;
664
+ return ((_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.nextElementSibling) || this.getFirstElement();
665
+ }
666
+ getPreviousElement() {
667
+ var _a;
668
+ return ((_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.previousElementSibling) || this.getFirstElement();
669
+ }
670
+ getChildElement() {
671
+ var _a;
672
+ return ((_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.querySelectorAll(this.getChildElementName())[0]) || null;
673
+ }
674
+ getParentElement(element) {
675
+ if (element && element) {
676
+ const isRootElement = element && element.attributes['data-isroot'];
677
+ if (isRootElement) {
678
+ return element;
679
+ }
680
+ return this.getParentElement(element.parentNode);
681
+ }
682
+ }
683
+ focusElementIsOpen() {
684
+ var _a;
685
+ return ((_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.classList.contains('bcm-list__item--open')) || false;
686
+ }
687
+ isRootElement() {
688
+ var _a;
689
+ return ((_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.querySelectorAll(this.getChildElementName()).length) > 0;
690
+ }
691
+ isRootElementIsOpen() {
692
+ return this.getFocusedElement().classList.contains('bcm-list__item--open');
693
+ }
694
+ getFocusedChildElement() {
695
+ var _a;
696
+ return ((_a = this.getChildElement()) === null || _a === void 0 ? void 0 : _a.querySelectorAll('.focused')[0]) || null;
697
+ }
698
+ isLastElement() {
699
+ var _a;
700
+ return ((_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.nextElementSibling) === null;
701
+ }
702
+ focusParentElementFirstChild() {
703
+ var _a, _b;
704
+ return this.setFocus((_b = (_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.firstChild);
705
+ }
706
+ isFirstElement() {
707
+ var _a;
708
+ return ((_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.previousElementSibling) === null;
709
+ }
710
+ focusRootElement() {
711
+ var _a, _b, _c;
712
+ return this.setFocus((_c = (_b = (_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.parentElement) === null || _c === void 0 ? void 0 : _c.firstChild);
713
+ }
714
+ nextRootElement() {
715
+ var _a, _b, _c;
716
+ return this.setFocus((_c = (_b = (_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.parentElement) === null || _c === void 0 ? void 0 : _c.nextElementSibling);
717
+ }
718
+ findFocusElementParent() {
719
+ return this.getFocusedElement().parentNode.querySelectorAll('.bcm-list__item--open');
720
+ }
721
+ getLastElement() {
722
+ return this.element.querySelectorAll(this.getElementName())[this.element.querySelectorAll(this.getElementName()).length - 1] || null;
723
+ }
724
+ setFocus(element) {
725
+ element.focus();
726
+ }
727
+ }
728
+
729
+ class ListKeyControl extends KeyControl {
730
+ constructor(keyCode, element, treeview, checkBoxes) {
731
+ super(keyCode, element, '.bcm-list__item', '.bcm-list__item-childs');
732
+ this.isTreeview = false;
733
+ this.isCheckBoxes = false;
734
+ this.isTreeview = treeview;
735
+ this.isCheckBoxes = checkBoxes;
736
+ }
737
+ keyUpControl() {
738
+ if (this.isTreeview) {
739
+ this.keyUpTreeview();
740
+ }
741
+ else {
742
+ if (this.isFirstElement()) {
743
+ this.setFocus(this.getLastElement());
744
+ }
745
+ else {
746
+ this.setFocus(this.getPreviousElement());
747
+ }
748
+ }
749
+ }
750
+ keyDownTreeView() {
751
+ var _a;
752
+ if (this.isTreeview) {
753
+ if (this.isRootElement() && this.isRootElementIsOpen()) {
754
+ const childs = this.getChildElement();
755
+ if (childs) {
756
+ this.setFocus(childs.firstChild);
757
+ }
758
+ }
759
+ else {
760
+ if (this.isLastElement() && this.getParentElement(this.getFocusedElement())) {
761
+ this.setFocus((_a = this.getParentElement(this.getFocusedElement())) === null || _a === void 0 ? void 0 : _a.nextElementSibling);
762
+ }
763
+ else {
764
+ this.setFocus(this.getNextElement());
765
+ }
766
+ }
767
+ }
768
+ }
769
+ keyUpTreeview() {
770
+ if (this.isFirstElement()) {
771
+ const parent = this.getParentElement(this.getFocusedElement());
772
+ this.setFocus(parent);
773
+ }
774
+ else {
775
+ const previousElement = this.getPreviousElement();
776
+ if (previousElement) {
777
+ if (previousElement.classList.contains('bcm-list__item--open')) {
778
+ const getChildElement = previousElement.querySelectorAll(this.getChildElementName())[0];
779
+ console.log({ getChildElement });
780
+ this.setFocus(getChildElement.lastChild);
781
+ }
782
+ else {
783
+ this.setFocus(previousElement);
784
+ }
785
+ }
786
+ }
787
+ }
788
+ keyDownControl() {
789
+ if (this.isTreeview) {
790
+ this.keyDownTreeView();
791
+ }
792
+ else {
793
+ if (this.isLastElement()) {
794
+ this.setFocus(this.getFirstElement());
795
+ }
796
+ else {
797
+ this.setFocus(this.getNextElement());
798
+ }
799
+ }
800
+ }
801
+ keyRightControl() {
802
+ if (this.isTreeview) {
803
+ if (!this.isRootElementIsOpen() && this.isRootElement()) {
804
+ const { id } = this.getFocusedElement();
805
+ this.openGroup(id);
806
+ }
807
+ }
808
+ }
809
+ keyLeftControl() {
810
+ if (this.isTreeview) {
811
+ if (this.isRootElementIsOpen() && this.isRootElement()) {
812
+ const { id } = this.getFocusedElement();
813
+ this.openGroup(id);
814
+ }
815
+ }
816
+ }
817
+ keyEnterControl() { }
818
+ keySpaceControl() {
819
+ if (this.isCheckBoxes) {
820
+ const { id } = this.getFocusedElement();
821
+ this.checkedItem(id);
822
+ }
823
+ }
824
+ keyDown() {
825
+ switch (this.getKeyCode()) {
826
+ case bcm.Bcm$1.KeyCode.up:
827
+ this.keyUpControl();
828
+ break;
829
+ case bcm.Bcm$1.KeyCode.down:
830
+ this.keyDownControl();
831
+ break;
832
+ case bcm.Bcm$1.KeyCode.left:
833
+ this.keyLeftControl();
834
+ break;
835
+ case bcm.Bcm$1.KeyCode.right:
836
+ this.keyRightControl();
837
+ break;
838
+ case bcm.Bcm$1.KeyCode.enter:
839
+ this.keyEnterControl();
840
+ break;
841
+ case bcm.Bcm$1.KeyCode.space:
842
+ this.keySpaceControl();
843
+ break;
844
+ }
845
+ }
846
+ keyUp() { }
847
+ }
848
+
849
+ const listCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");@import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap\"); @import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap\"); @import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap\"); @import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap\"); .size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}*{box-sizing:border-box}.bcm-caption-area{font-family:\"Inter\", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;font-size:12px;line-height:calc(12px + 8px);color:var(--bcm-new-ds-color-slate-400);display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between;flex-wrap:nowrap;margin-top:2px}.bcm-caption-area__text{color:var(--bcm-new-ds-color-slate-400)}.bcm-caption-area__text.default{color:var(--bcm-new-ds-color-slate-400)}.bcm-caption-area__text.info{color:var(--bcm-new-ds-color-blue-500)}.bcm-caption-area__text.success{color:var(--bcm-new-ds-color-emerald-500)}.bcm-caption-area__text.warning{color:var(--bcm-new-ds-color-amber-500)}.bcm-caption-area__text.error{color:var(--bcm-new-ds-color-red-500)}.bcm-caption-area__size-small{font-size:10px;line-height:calc(10px + 8px);min-height:calc(10px + 8px)}.bcm-caption-area__size-medium{font-size:12px;line-height:calc(12px + 8px);min-height:calc(12px + 8px)}.bcm-caption-area__size-large{font-size:14px;line-height:calc(14px + 8px);min-height:calc(14px + 8px)}*{box-sizing:border-box}.bcm-label{display:inline-flex;align-items:flex-start;grid-gap:2px}.bcm-label__text{margin-bottom:2px;font-family:\"Inter\", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;display:inline-block;color:var(--bcm-new-ds-color-slate-600)}.bcm-label__size-small{font-size:10px;line-height:calc(10px + 8px);min-height:calc(10px + 8px)}.bcm-label__size-medium{font-size:12px;line-height:calc(12px + 8px);min-height:calc(12px + 8px)}.bcm-label__size-large{font-size:14px;line-height:calc(14px + 8px);min-height:calc(14px + 8px)}.bcm-input[no-margin]{margin:0}.bcm-textarea[no-margin]{margin:0}.bcm-switch[no-margin]{margin:0}.bcm-checkbox[no-margin]{margin:0}.bcm-radio-group[no-margin]{margin:0}.bcm-checkbox-group[no-margin]{margin:0}.bcm-range[no-margin]{margin:0}.bcm-form[no-margin]{margin:0}.bcm-form-group[no-margin]{margin:0}.bcm-list[no-margin]{margin:0}.bcm-colorpicker[no-margin]{margin:0}.bcm-date-picker[no-margin]{margin:0}.bcm-time-picker[no-margin]{margin:0}.bcm-datetime-picker[no-margin]{margin:0}.bcm-select[no-margin]{margin:0}.bcm-listbox[no-margin]{margin:0}*{box-sizing:border-box}*{box-sizing:border-box}.bcm-checkbox{outline:none;border:none;--bcm-checkbox-primary-color-default:var(--bcm-new-ds-color-blue-500);--bcm-checkbox-secondary-color-default:var(--bcm-new-ds-color-white);--bcm-checkbox-primary-color-hover:var(--bcm-new-ds-color-blue-600);--bcm-checkbox-secondary-color-hover:var(--bcm-new-ds-color-slate-50);--bcm-checkbox-primary-color-focus-visible:var(--bcm-new-ds-color-blue-800);--bcm-checkbox-secondary-color-focus-visible:var(--bcm-new-ds-color-slate-50);--bcm-checkbox-primary-color-active:var(--bcm-new-ds-color-blue-700);--bcm-checkbox-secondary-color-active:var(--bcm-new-ds-color-slate-50);--bcm-checkbox-primary-color-disabled:var(--bcm-new-ds-color-slate-300);--bcm-checkbox-secondary-color-disabled:var(--bcm-new-ds-color-slate-200);display:inline-flex;width:fit-content;flex-direction:column;margin-bottom:8px}.bcm-checkbox:focus,.bcm-checkbox:hover,.bcm-checkbox:active{outline:none;border:none}.bcm-checkbox *{box-sizing:border-box}.bcm-checkbox input[type=radio],.bcm-checkbox input[type=checkbox]{-webkit-appearance:none;appearance:none;background-color:#fff;margin:0;display:none}.bcm-checkbox__input{display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-start;flex-wrap:nowrap;padding-top:4px}.bcm-checkbox.hidden{display:none}.bcm-checkbox :hover{cursor:pointer}.bcm-checkbox[disabled] :hover,.bcm-checkbox.disabled :hover{cursor:not-allowed}.bcm-checkbox .slot{font-family:\"Inter\", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;font-weight:500;color:var(--bcm-new-ds-color-slate-600)}.bcm-checkbox .slot:not(:empty){margin-left:8px;margin-right:8px}.bcm-checkbox-size-small .slot{font-size:12px;line-height:calc(12px + 8px);margin-top:-2.5px}.bcm-checkbox-size-small .bcm-checkbox__input{min-height:calc(24px - 4px)}.bcm-checkbox-size-small .bcm-checkbox__label-icon{width:14px;height:14px;min-width:14px;font-size:calc(10px - 2px)}.bcm-checkbox-size-medium .slot{font-size:calc(12px + 1px);line-height:calc(12px + 8px);margin-top:-1.5px}.bcm-checkbox-size-medium .bcm-checkbox__input{min-height:calc(32px - 4px)}.bcm-checkbox-size-medium .bcm-checkbox__label-icon{width:16px;height:16px;min-width:16px;font-size:10px}.bcm-checkbox-size-large .slot{font-size:16px;line-height:calc(16px + 8px);margin-top:-1.5px}.bcm-checkbox-size-large .bcm-checkbox__input{min-height:calc(32px - 4px)}.bcm-checkbox-size-large .bcm-checkbox__label-icon{width:18px;height:18px;min-width:18px;font-size:12px}.bcm-checkbox__label{display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-start;flex-wrap:nowrap}.bcm-checkbox__label-icon{display:flex;flex-direction:column;align-items:center;justify-content:center;flex-wrap:nowrap;border-width:1px;border-style:solid;border-radius:2px}.bcm-checkbox__label-icon-indeterminate{position:relative}.bcm-checkbox__label-icon-indeterminate:after{content:\"\";display:block;position:absolute;width:70%;height:1.5px;background:var(--bcm-new-ds-color-white)}.bcm-checkbox__label-icon.bcm-radio__icon{width:16px;height:16px;box-sizing:border-box;border-radius:100px}.bcm-checkbox__label-icon.bcm-radio__icon .bcm-radio__icon-inner{width:10px;height:10px;border-radius:100px;background-color:var(--bcm-new-ds-color-white)}.bcm-checkbox .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-default);color:var(--bcm-checkbox-secondary-color-default);border-color:var(--bcm-new-ds-color-slate-300)}.bcm-checkbox .bcm-checkbox__label-icon-checked,.bcm-checkbox .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-default);border-color:var(--bcm-checkbox-primary-color-default)}.bcm-checkbox .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-default);background-color:var(--bcm-checkbox-secondary-color-default)}.bcm-checkbox .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-default)}.bcm-checkbox .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-default)}.bcm-checkbox:hover .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-hover);color:var(--bcm-checkbox-secondary-color-hover);border-color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-checked,.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-hover);border-color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-hover);background-color:var(--bcm-checkbox-secondary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-focus-visible);color:var(--bcm-checkbox-secondary-color-focus-visible);border-color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-checked,.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-focus-visible);border-color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-focus-visible);background-color:var(--bcm-checkbox-secondary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:active .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-active);color:var(--bcm-checkbox-secondary-color-active);border-color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-checked,.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-active);border-color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-active);background-color:var(--bcm-checkbox-secondary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon,.bcm-checkbox.disabled .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-disabled);color:var(--bcm-checkbox-secondary-color-disabled);border-color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-checked,.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate,.bcm-checkbox.disabled .bcm-checkbox__label-icon-checked,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-disabled);border-color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon,.bcm-checkbox.disabled .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-disabled);background-color:var(--bcm-checkbox-secondary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox.disabled .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[no-margin] .bcm-checkbox__input{margin:0;min-height:0;padding:0}.bcm-list{font-family:\"Inter\", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;--width:256px;--height:256px;--max-height:inherit;--min-height:inherit;min-width:90px;display:flex;flex-direction:column;margin:0 0 8px 0}.bcm-list__listbox .bcm-list__container{height:var(--height);max-height:var(--max-height);min-height:var(--min-height)}.bcm-list.full-width{width:100%}.bcm-list__size-small .bcm-list__input{height:24px;font-size:12px;line-height:calc(12px + 8px)}.bcm-list__size-small .bcm-list__input .bcm-tag__content.dismissable{font-size:10px;line-height:calc(10px + 8px)}.bcm-list__size-medium .bcm-list__input{height:32px;font-size:14px;line-height:calc(14px + 8px)}.bcm-list__size-medium .bcm-list__input .bcm-tag__content.dismissable{font-size:12px;line-height:calc(12px + 8px)}.bcm-list__size-large .bcm-list__input{height:40px;font-size:16px;line-height:calc(16px + 8px)}.bcm-list__size-large .bcm-list__input .bcm-tag__content.dismissable{font-size:14px;line-height:calc(14px + 8px)}.bcm-list:hover{outline:none}.bcm-list:hover .bcm-list__input{border-color:var(--bcm-new-ds-color-blue-500);background-color:var(--bcm-new-ds-color-slate-50)}.bcm-list:focus-visible{outline:none}.bcm-list:focus-visible .bcm-list__input{border-color:var(--bcm-new-ds-color-blue-600);background-color:var(--bcm-new-ds-color-white)}.bcm-list:active{outline:none}.bcm-list:active .bcm-list__input{border-color:var(--bcm-new-ds-color-blue-600);box-shadow:0 1px 3px 0 rgba(17, 24, 38, 0.1)}.bcm-list__container{--width:256px;--height:256px;width:var(--width);height:var(--height);background-color:var(--bcm-new-ds-color-white);border:1px solid var(--bcm-new-ds-color-slate-300);border-radius:4px;box-sizing:border-box;padding-top:8px;display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;flex-wrap:nowrap;gap:4px}.bcm-list__container main{scroll-behavior:smooth;padding:0 8px;flex:1;overflow:auto;display:flex;flex-direction:column}.bcm-list__container-search{margin:0 8px}.bcm-list__container-search:after{margin:4px 0}.bcm-list__container-no-data{flex:1;display:flex;justify-content:stretch;align-items:stretch;padding-bottom:4px}.bcm-list__container.error{border-color:var(--bcm-color-red-6)}.bcm-list__container.full-width{width:100%}.bcm-list__container.bcm-list__type-linked-component,.bcm-list__container.bcm-list__type-select,.bcm-list__container.bcm-list__type-autocomplete{opacity:0;visibility:hidden;position:absolute;top:0;left:0;height:0;width:0;transform:translateY(10%);z-index:10800;transition:visibility 0s linear 400ms, opacity 100ms, transform 200ms}.bcm-list__container.bcm-list__type-linked-component.bcm-list--top,.bcm-list__container.bcm-list__type-select.bcm-list--top,.bcm-list__container.bcm-list__type-autocomplete.bcm-list--top{transform:translateY(-10%)}.bcm-list__container.bcm-list__type-linked-component.is-open,.bcm-list__container.bcm-list__type-select.is-open,.bcm-list__container.bcm-list__type-autocomplete.is-open{opacity:1;transform:translateY(0);visibility:visible;transition:visibility 0s linear 0s, opacity 100ms, transform 100ms}.bcm-list__container.bcm-list__type-linked-component{margin-top:2px}.bcm-list__label{line-height:1}.bcm-list__input{display:flex;align-items:center;justify-content:space-between;box-sizing:border-box;border:1px solid var(--bcm-new-ds-color-slate-300);border-radius:4px;color:var(--bcm-new-ds-color-slate-600);background-color:var(--bcm-new-ds-color-white);user-select:none;cursor:pointer;padding:0 8px;height:32px;overflow:hidden;position:relative;transition:background-color 100ms, border-color 100ms}.bcm-list__input-spinner{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center;background-color:var(--bcm-color-grey-1);opacity:0;visibility:hidden;transition:opacity 0.2s ease-in-out;z-index:-1}.bcm-list__input-spinner.is-open{opacity:1;visibility:visible;z-index:1}.bcm-list__input-container{flex:1;display:block;overflow:hidden}.bcm-list__input-container.value-empty{color:var(--bcm-color-grey-6)}.bcm-list__input-container.type-single,.bcm-list__input-container.value-empty{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bcm-list__input-placeholder{color:var(--bcm-color-grey-6)}.bcm-list__input-tag-container{height:100%;width:100%;display:flex;align-items:center;justify-content:flex-start;flex-wrap:nowrap;grid-gap:2px;line-height:1}.bcm-list__input-buttons{display:flex;align-items:center;justify-content:flex-end;grid-gap:4px}.bcm-list__input-buttons-button{display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding:4px 4px 0 4px;font-size:16px;color:var(--bcm-new-ds-color-slate-500)}.bcm-list__input-buttons-button.caret-is{transform:rotate(360deg);transition:transform 0.2s ease-in-out}.bcm-list__input-buttons-button.caret-is-open{transform:rotate(180deg)}.bcm-list__input-buttons:not(.disabled) .bcm-list__input-buttons-button:hover{cursor:pointer;color:var(--bcm-new-ds-color-slate-600)}.bcm-list__input-autocomplete{position:relative;padding-right:0}.bcm-list__input-autocomplete .bcm-list-input-selected-text{background-color:#ffffff;display:flex;align-items:center;justify-content:flex-start;width:calc(100% - 24px);height:100%;padding:0 calc(8px + 4px);position:absolute;top:0;left:0}.bcm-list__input-autocomplete .bcm-list__input-container{height:100%;display:flex;flex-direction:row}.bcm-list__input-autocomplete .bcm-list__input-container .bcm-list__input-tag-container{width:auto}.bcm-list__input-autocomplete .bcm-input,.bcm-list__input-autocomplete .bcm-list__autocomplete{height:100%;min-width:70px;width:100%}.bcm-list__input-autocomplete .bcm-input__container,.bcm-list__input-autocomplete .bcm-list__autocomplete__container{height:100%;border:none;padding:0;width:100%}.bcm-list__input-autocomplete .bcm-input__container:not(.disabled).focused,.bcm-list__input-autocomplete .bcm-input__container:not(.disabled):hover,.bcm-list__input-autocomplete .bcm-list__autocomplete__container:not(.disabled).focused,.bcm-list__input-autocomplete .bcm-list__autocomplete__container:not(.disabled):hover{border:none;box-shadow:none}.bcm-list__autocomplete{width:100%;position:relative}.bcm-list.full-width .bcm-list__container,.bcm-list.full-width .bcm-list__input{width:100%}.bcm-list.error .bcm-list__input{border-color:var(--bcm-color-red-6)}.bcm-list.disabled .bcm-list__container,.bcm-list.disabled .bcm-list__input{color:var(--bcm-new-ds-color-slate-300);background-color:var(--bcm-new-ds-color-slate-50);cursor:not-allowed}.bcm-list.disabled .bcm-tag__content.dismissable .close-button{cursor:default}.bcm-list:not(.disabled) .bcm-list__input .bcm-tag__content.checked .close-button bcm-icon{color:var(--bcm-new-ds-color-slate-100)}.bcm-list:not(.disabled) .bcm-list__input .bcm-tag__content.checked .close-button:hover bcm-icon{color:var(--bcm-new-ds-color-slate-200)}.bcm-list:not(.disabled) .bcm-list__input:hover{border-color:var(--bcm-new-ds-color-blue-500)}.bcm-list:not(.disabled) .bcm-list__input:hover .bcm-tag__content.dismissable:not(.checked){background-color:var(--bcm-new-ds-color-slate-200);border-color:var(--bcm-new-ds-color-slate-200)}.bcm-list:not(.disabled) .bcm-list__input:focus-visible{border-color:var(--bcm-new-ds-color-blue-500);box-shadow:0 1px 3px 0 rgba(17, 24, 38, 0.1)}.bcm-list:not(.disabled) .bcm-list__input:active{border-color:var(--bcm-new-ds-color-blue-500)}.bcm-list__item{padding:2px 0}.bcm-list__item.disabled{user-select:none}.bcm-list__item:focus{outline:none}.bcm-list__item:focus-visible>.bcm-list__item-content{background-color:var(--bcm-new-ds-color-slate-300)}.bcm-list__item:focus-visible>.bcm-list__item-content:not(.disabled){color:var(--bcm-new-ds-color-slate-600)}.bcm-list__item-content{display:flex;flex-direction:row;align-items:stretch;justify-content:flex-start;flex-wrap:nowrap;cursor:pointer;border-radius:4px;padding:0;padding-left:4px;color:var(--bcm-new-ds-color-slate-600);background-color:var(--bcm-new-ds-color-slate-50);transition:background-color 0.2s ease}.bcm-list__item-content.disabled{color:var(--bcm-new-ds-color-slate-300);background-color:var(--bcm-new-ds-color-slate-50);user-select:none;cursor:not-allowed}.bcm-list__item-content.selected{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-new-ds-color-blue-500)}.bcm-list__item-content.selected:hover:not(.disabled){color:var(--bcm-new-ds-color-white);background-color:var(--bcm-new-ds-color-blue-600)}.bcm-list__item-content:hover:not(.disabled){color:var(--bcm-new-ds-color-slate-600);background-color:var(--bcm-new-ds-color-slate-100)}.bcm-list__item-content:active:not(.disabled){color:var(--bcm-new-ds-color-slate-600);background-color:var(--bcm-new-ds-color-slate-200)}.bcm-list__item-content-collapse-icon{width:16px;padding:0 8px;display:flex;align-items:center;justify-content:center;font-size:16px}.bcm-list__item-content-collapse-icon.child{cursor:pointer}.bcm-list__item-content-text{user-select:none;padding:8px;width:100%;display:flex;flex-direction:row;align-items:center;justify-content:flex-start}.bcm-list__item-content-text.treeview{padding:8px 0}.bcm-list__item-content-text-checkbox{display:flex;flex-direction:row;align-items:center;justify-content:center;flex-wrap:nowrap;margin-right:8px}.bcm-list__item-content-text-checkbox .bcm-checkbox{margin:0}.bcm-list__item-content-text-inner{width:100%}.bcm-list__item-content-text mark{padding:0;margin:0;font-size:inherit;color:var(--bcm-color-grey-8);background-color:var(--bcm-color-yellow-4)}.bcm-list__item-childs{padding-left:16px}.bcm-list__item-small{padding:2px 0 2px 8px;font-size:10px;line-height:calc(10px + 8px)}.bcm-list__item-small .bcm-list__item-content-text{padding:3px 4px}.bcm-list__item-medium{font-size:12px;line-height:calc(12px + 8px)}.bcm-list__item-medium .bcm-list__item-content-text{padding:6px 4px}.bcm-list__item-large{font-size:14px;line-height:calc(14px + 8px)}.bcm-list__item-large .bcm-list__item-content-text{padding:9px 4px}.bcm-list__item--readonly:focus>.bcm-list__item-content:not(.disabled),.bcm-list__item--readonly.focused>.bcm-list__item-content:not(.disabled){color:var(--bcm-color-grey-7)}.bcm-list__item--readonly>.bcm-list__item-content{color:var(--bcm-color-grey-7)}.bcm-list__item--readonly>.bcm-list__item-content:hover,.bcm-list__item--readonly>.bcm-list__item-content:focus{color:var(--bcm-color-grey-7)}.bcm-list__item--group{border-radius:4px}.bcm-list__item--group:focus>.bcm-list__item-content:not(.disabled){background-color:var(--bcm-new-ds-color-slate-50);color:var(--bcm-new-ds-color-slate-600)}.bcm-list__item--group>.bcm-list__item-content{background-color:var(--bcm-new-ds-color-slate-50);color:var(--bcm-new-ds-color-slate-600);border-radius:4px 4px 0 0;cursor:default;font-size:14px;line-height:calc(14px + 8px);font-weight:500;position:sticky;top:0}.bcm-list__item--group>.bcm-list__item-content>.bcm-list__item-content-text{padding:4px 8px 4px 16px}.bcm-list__item--group>.bcm-list__item-content:hover,.bcm-list__item--group>.bcm-list__item-content:focus{color:var(--bcm-new-ds-color-slate-800);background-color:var(--bcm-new-ds-color-slate-50)}.bcm-list__item--group>.bcm-list__item-content-unclickable:hover{color:var(--bcm-new-ds-color-slate-700);background-color:var(--bcm-new-ds-color-slate-50)}.bcm-list__item--group>.bcm-list__item-childs{background-color:var(--bcm-new-ds-color-slate-50);color:var(--bcm-new-ds-color-slate-600);padding-bottom:8px;border-radius:0 0 4px 4px;padding-left:8px}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content{background-color:var(--bcm-new-ds-color-white);color:var(--bcm-new-ds-color-slate-600)}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content:hover{background-color:var(--bcm-new-ds-color-slate-100)}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content:active{background-color:var(--bcm-new-ds-color-slate-200)}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content:focus-visible{background-color:var(--bcm-new-ds-color-slate-300)}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content.selected{background-color:var(--bcm-new-ds-color-blue-500);color:var(--bcm-new-ds-color-white)}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content.selected:hover{background-color:var(--bcm-new-ds-color-blue-600)}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content.selected:active{background-color:var(--bcm-new-ds-color-blue-700)}.bcm-list__linked{display:none}.bcm-list .bcm-tag--other .value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bcm-info-footer{text-align:right;padding:4px 8px;background-color:var(--bcm-new-ds-color-slate-100);color:var(--bcm-new-ds-color-slate-600);border-radius:0 0 4px 4px}";
850
+
851
+ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
852
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
853
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
854
+ r = Reflect.decorate(decorators, target, key, desc);
855
+ else
856
+ for (var i = decorators.length - 1; i >= 0; i--)
857
+ if (d = decorators[i])
858
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
859
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
860
+ };
861
+ const BcmList = class {
862
+ constructor(hostRef) {
863
+ index$2.registerInstance(this, hostRef);
864
+ this.bcmChecklist = index$2.createEvent(this, "bcm-checklist", 7);
865
+ this.bcmSelected = index$2.createEvent(this, "bcm-selected", 7);
866
+ this.change = index$2.createEvent(this, "bcm-change", 7);
867
+ this.open = index$2.createEvent(this, "bcm-open", 7);
868
+ this.close = index$2.createEvent(this, "bcm-close", 7);
869
+ this.debounce = null;
870
+ this.debounceHandler = generate.Generate.debounceInput(() => this.listenResize(), 300, false);
871
+ this._id = generate.Generate.UID();
872
+ this.type = bcm.Bcm.ListType.listbox;
873
+ this.treeview = false;
874
+ this.checkboxes = false;
875
+ this.searchable = false;
876
+ this.value = null;
877
+ this.inputText = undefined;
878
+ this.name = undefined;
879
+ this.label = undefined;
880
+ this.size = bcm.Bcm.Size.medium;
881
+ this.disabled = false;
882
+ this.readonly = false;
883
+ this.highlight = false;
884
+ this.highlightText = undefined;
885
+ this.required = false;
886
+ this.hidden = false;
887
+ this.fullWidth = false;
888
+ this.height = "256px";
889
+ this.maxHeight = "500px";
890
+ this.minHeight = "150px";
891
+ this.width = "256px";
892
+ this.infoFooter = false;
893
+ this.variableText = "item";
894
+ this.template = undefined;
895
+ this.allOpen = false;
896
+ this.keyControl = false;
897
+ this.checkAll = true;
898
+ this.stopDeepClean = false;
899
+ this.linkedComponent = undefined;
900
+ this.isOpen = false;
901
+ this.calculatedViewport = false;
902
+ this.isSelectedOther = false;
903
+ this.isHaveOtherTag = false;
904
+ this.placeholder = "Choose an option";
905
+ this.searchPlaceholder = "Search";
906
+ this.searchIsOnlyChilds = false;
907
+ this.minSearchLength = 2;
908
+ this.clearable = false;
909
+ this.caption = undefined;
910
+ this.noCaption = false;
911
+ this.captionType = bcm.Bcm.Status.default;
912
+ this.captionError = undefined;
913
+ this.emptyText = undefined;
914
+ this.emptyIcon = "fad fa-folder-open";
915
+ this.captionCache = undefined;
916
+ this.captionTypeCache = undefined;
917
+ this.tick = {};
918
+ this.totalData = 0;
919
+ this.totalRootData = 0;
920
+ this.limit = 20;
921
+ this.searchGetParents = undefined;
922
+ this.searchResultLimit = 20;
923
+ this.searchFound = null;
924
+ this.returnFilterData = {};
925
+ this.returnOtherData = {};
926
+ this.options = {
927
+ rootMargin: "30px",
928
+ };
929
+ this.tagContainerWidth = 0;
930
+ this.selectAllItem = {
931
+ id: "select-all",
932
+ text: "Select All",
933
+ value: "select-all",
934
+ checked: false,
935
+ disabled: false,
936
+ icon: "",
937
+ status: bcm.Bcm.Status.default,
938
+ indeterminate: "uncheck",
939
+ };
940
+ this.placement = bcm.Bcm.Placement["bottom-start"];
941
+ this.data = [];
942
+ }
943
+ connectedCallback() {
944
+ if (this.height != "256px") {
945
+ if (this.height.indexOf("px") > -1) {
946
+ this.limit = Math.floor(+this.height.replace("px", "") / 10);
947
+ }
948
+ else {
949
+ this.limit = Math.floor(+(window.innerHeight / 10));
950
+ }
951
+ this.searchResultLimit = this.limit;
952
+ this.markForCheck();
953
+ }
954
+ const checkElementWithDom = document.querySelectorAll(`#bcm-list-${this._id}`);
955
+ (checkElementWithDom === null || checkElementWithDom === void 0 ? void 0 : checkElementWithDom.length) > 1 && checkElementWithDom.forEach((item, index) => index > 0 && item.remove());
956
+ }
957
+ componentWillRender() {
958
+ this.calculateLocation();
959
+ }
960
+ componentShouldUpdate(newVal, oldVal, propName) {
961
+ if (Object.keys(this.getOptions()).indexOf(propName) > -1 && newVal !== oldVal) {
962
+ this.updateOptions();
963
+ }
964
+ }
965
+ get containerWidth() {
966
+ var _a, _b;
967
+ return (_b = (_a = this.el) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) === null || _b === void 0 ? void 0 : _b.width;
968
+ }
969
+ get tagCount() {
970
+ return this.containerWidth > 0 ? Math.floor(+(this.containerWidth - 100) / 85) : 0;
971
+ }
972
+ get tagData() {
973
+ return generate.snq(() => {
974
+ var _a;
975
+ return (_a = this.value) === null || _a === void 0 ? void 0 : _a.map(item => ({
976
+ value: item.id,
977
+ label: stringHelper.StringHelper.textLimitter(item.text, 7),
978
+ text: item.tooltipMessage || item.tagTitle || item.text,
979
+ }));
980
+ }, []);
981
+ }
982
+ async componentDidLoad() {
983
+ await this.initState();
984
+ if (this.type == "select" || this.type == "autocomplete" || this.linkedComponent) {
985
+ const list = this.el.querySelector(`#bcm-list-${this._id}`);
986
+ if (list) {
987
+ document.body.appendChild(list);
988
+ }
989
+ }
990
+ }
991
+ disconnectedCallback() {
992
+ this.isOpen = false;
993
+ if (this.stopDeepClean)
994
+ return;
995
+ listState.removeState(this._id);
996
+ this.el.innerHTML = "";
997
+ if (this.type == "select" || this.type == "autocomplete" || this.linkedComponent) {
998
+ const list = document.querySelectorAll(`#bcm-list-${this._id}`);
999
+ if (list === null || list === void 0 ? void 0 : list.length) {
1000
+ list.forEach(item => item.remove());
1001
+ this.el.remove();
1002
+ }
1003
+ }
1004
+ }
1005
+ watchId(_, oldVal) {
1006
+ // console.info('Changed component id:', oldVal + ' -> ' + newVal);
1007
+ listState.removeState(oldVal);
1008
+ this.initState();
1009
+ }
1010
+ handleValueChange(newVal, oldVal) {
1011
+ var _a;
1012
+ if (generate.Generate.objectIsEmpty(this.returnFilterData)) {
1013
+ this.handleIndeterminate(((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) || 0, this.totalData);
1014
+ }
1015
+ if (this.checkboxes) {
1016
+ if (!validators.Validators.compareTwoArrayIsSame(newVal, oldVal)) {
1017
+ this.bcmChecklist.emit(this.value);
1018
+ this.change.emit(this.value);
1019
+ }
1020
+ }
1021
+ else {
1022
+ if ((newVal === null || newVal === void 0 ? void 0 : newVal.id) != (oldVal === null || oldVal === void 0 ? void 0 : oldVal.id)) {
1023
+ this.change.emit(this.value);
1024
+ }
1025
+ }
1026
+ }
1027
+ watchReturnFilterData(newVal) {
1028
+ var _a;
1029
+ const { checkedItems, visibledItems } = newVal;
1030
+ if (checkedItems && visibledItems) {
1031
+ this.handleIndeterminate(checkedItems.length, visibledItems.length);
1032
+ }
1033
+ else {
1034
+ this.handleIndeterminate(((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) || 0, this.totalData);
1035
+ }
1036
+ }
1037
+ async handleOpen() {
1038
+ if (this.isOpen) {
1039
+ this.open.emit();
1040
+ this.calculateLocation();
1041
+ this.onSelectSearch();
1042
+ }
1043
+ else {
1044
+ this.listScrollToTop();
1045
+ this.close.emit();
1046
+ await utils.delay(100);
1047
+ this.unSelectOther();
1048
+ }
1049
+ }
1050
+ listScrollToTop() {
1051
+ const list = document.querySelector(`#bcm-list-${this._id}`);
1052
+ if (list) {
1053
+ list.querySelector(".scrolling").scrollTop = 0;
1054
+ }
1055
+ }
1056
+ async dataChanged(newValue, oldValue) {
1057
+ if (!validators.Validators.compareTwoArrayIsSame(newValue, oldValue)) {
1058
+ await this.initState();
1059
+ }
1060
+ }
1061
+ isIntersecting(e) {
1062
+ const target = e === null || e === void 0 ? void 0 : e.target;
1063
+ if (target && target.id === this._id) {
1064
+ this.listenResize();
1065
+ }
1066
+ }
1067
+ handleSlotItems(e) {
1068
+ var _a;
1069
+ if (((_a = e === null || e === void 0 ? void 0 : e.detail) === null || _a === void 0 ? void 0 : _a.length) > 0) {
1070
+ this.data = e.detail;
1071
+ }
1072
+ }
1073
+ handleChange(e) {
1074
+ if (e.target.id == `bcm-list-input-tag-container-${this._id}-autocomplete-input`) {
1075
+ e.stopImmediatePropagation();
1076
+ }
1077
+ }
1078
+ handleResize() {
1079
+ this.calculateLocation();
1080
+ this.debounceHandler();
1081
+ }
1082
+ handleWheel(event) {
1083
+ if (this.isOpen) {
1084
+ const list = document.querySelector(`#bcm-list-${this._id}`);
1085
+ const isClickInside = list && generate.Generate.findEventPath(event, list);
1086
+ if (isClickInside) {
1087
+ if (this.type == "select" || this.type == "autocomplete" || this.linkedComponent) {
1088
+ this.calculateLocation();
1089
+ }
1090
+ }
1091
+ else {
1092
+ this.hide();
1093
+ }
1094
+ }
1095
+ }
1096
+ clearAutocomplete() {
1097
+ if (this.type == "autocomplete") {
1098
+ const autocompleteInput = this.getAutoCompleteInput();
1099
+ if (autocompleteInput) {
1100
+ autocompleteInput.handleClear(false);
1101
+ }
1102
+ }
1103
+ }
1104
+ async handleSelectOtherTag(e) {
1105
+ if (this.disabled)
1106
+ return;
1107
+ const { id, checked } = e.detail;
1108
+ this.isSelectedOther = checked;
1109
+ if (id) {
1110
+ checked ? this.filterOtherList(id) : this.unSelectOther();
1111
+ this.isOpen = true;
1112
+ }
1113
+ }
1114
+ async handleDeleteTag(e) {
1115
+ var _a;
1116
+ if (this.disabled)
1117
+ return;
1118
+ const { id } = e.detail;
1119
+ this.isSelectedOther && this.unSelectOther();
1120
+ Array.isArray(id) ? listState.removeOtherTags(this._id, id) : listState.checkedItem(this._id, id);
1121
+ this.value = (await this.getCheckedList()).checkedList;
1122
+ this.handleIndeterminate(((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) || 0, this.totalData);
1123
+ }
1124
+ async handleSelectTag(_) {
1125
+ if (this.disabled)
1126
+ return;
1127
+ this.clearAutocomplete();
1128
+ this.onSelectSearch();
1129
+ this.unSelectOther();
1130
+ }
1131
+ handleClick(event) {
1132
+ var _a;
1133
+ if (this.disabled)
1134
+ return;
1135
+ const list = document.querySelector(`#bcm-list-${this._id}`);
1136
+ const isClickInside = generate.Generate.findEventPath(event, this.el) || (list && generate.Generate.findEventPath(event, list));
1137
+ if (isClickInside) {
1138
+ if (this.debounce !== null) {
1139
+ event.preventDefault();
1140
+ event.stopPropagation();
1141
+ clearTimeout(this.debounce);
1142
+ this.debounce = null;
1143
+ }
1144
+ this.debounce = setTimeout(() => {
1145
+ this.debounce = null;
1146
+ }, 300);
1147
+ }
1148
+ if (!isClickInside) {
1149
+ if (this.type == "autocomplete") {
1150
+ const autocompleteInput = this.getAutoCompleteInput();
1151
+ if (autocompleteInput) {
1152
+ if (this.checkboxes) {
1153
+ autocompleteInput.setValue("");
1154
+ }
1155
+ else {
1156
+ autocompleteInput.setValue(((_a = this.value) === null || _a === void 0 ? void 0 : _a.text) || "");
1157
+ }
1158
+ }
1159
+ }
1160
+ }
1161
+ const clickToTag = generate.Generate.findEventPathWithKey(event, "className", ["bcm-tag"]);
1162
+ const clickToOtherTag = generate.Generate.findEventPathWithKey(event, "className", ["bcm-tag bcm-tag--other"]);
1163
+ const clickToSelect = generate.Generate.findEventPathWithKey(event, "id", [`bcm-list-input-${this._id}`, `bcm-list-label-${this._id}`]);
1164
+ const clickToTagDismiss = generate.Generate.findEventPathWithKey(event, "className", ["right close-button"]);
1165
+ if (clickToSelect && !clickToTagDismiss && this.type != "autocomplete") {
1166
+ this.isOpen = clickToTag || clickToOtherTag ? true : !this.isOpen;
1167
+ }
1168
+ if (list) {
1169
+ if (this.isOpen) {
1170
+ if (!list.contains(event.target) && !this.el.contains(event.target)) {
1171
+ this.isOpen = false;
1172
+ // this.unSelectOther()
1173
+ }
1174
+ }
1175
+ }
1176
+ }
1177
+ bcmOnSearchClear(event) {
1178
+ var _a, _b;
1179
+ if (this.type == "autocomplete") {
1180
+ if (((_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.id) === `bcm-list-${this._id}-search` || ((_b = event === null || event === void 0 ? void 0 : event.target) === null || _b === void 0 ? void 0 : _b.id) === `bcm-list-input-tag-container-${this._id}-autocomplete-input`) {
1181
+ if (event.detail) {
1182
+ this.setClear();
1183
+ }
1184
+ }
1185
+ }
1186
+ }
1187
+ bcmOnSearch(event) {
1188
+ var _a, _b, _c, _d, _e, _f;
1189
+ if (((_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.id) === `bcm-list-${this._id}-search` || ((_b = event === null || event === void 0 ? void 0 : event.target) === null || _b === void 0 ? void 0 : _b.id) === `bcm-list-input-tag-container-${this._id}-autocomplete-input`) {
1190
+ this.searchGetParents = generate.snq(() => { var _a; return (_a = event.detail) === null || _a === void 0 ? void 0 : _a.parentIndex; }, null);
1191
+ this.searchResultLimit = 10;
1192
+ this.searchFound = ((_c = event.detail) === null || _c === void 0 ? void 0 : _c.matching) != null ? (_d = event.detail) === null || _d === void 0 ? void 0 : _d.matching.length : null;
1193
+ this.returnFilterData = listState.filterData(this._id, (_e = event.detail) === null || _e === void 0 ? void 0 : _e.nestedResult);
1194
+ if (this.searchFound > 0 && this.highlight) {
1195
+ this.highlightText = (_f = event.detail) === null || _f === void 0 ? void 0 : _f.value;
1196
+ }
1197
+ if (this.type == "autocomplete") {
1198
+ this.isOpen = true;
1199
+ }
1200
+ if (!event.detail.result) {
1201
+ if (this.type == "autocomplete") {
1202
+ this.isOpen = false;
1203
+ }
1204
+ else {
1205
+ this.returnFilterData = {};
1206
+ listState.filterData(this._id, null);
1207
+ }
1208
+ // this.isSelectedOther = false
1209
+ this.searchResultLimit = null;
1210
+ this.highlightText = null;
1211
+ }
1212
+ this.markForCheck();
1213
+ }
1214
+ }
1215
+ //keyboard navigation
1216
+ handleKeyDown(ev) {
1217
+ const keycode = ev.keyCode || ev.which;
1218
+ if (keycode === bcm.Bcm.KeyCode.escape) {
1219
+ if (this.isOpen) {
1220
+ this.isOpen = false;
1221
+ ev.preventDefault();
1222
+ ev.stopPropagation();
1223
+ ev.stopImmediatePropagation();
1224
+ }
1225
+ }
1226
+ if (this.keyControl) {
1227
+ const keyboard = new ListKeyControl(keycode, this.el, this.treeview, this.checkboxes);
1228
+ keyboard.openGroup = openGroupId => {
1229
+ this.openGroup(openGroupId);
1230
+ };
1231
+ keyboard.checkedItem = checkedItemId => {
1232
+ this.checkedItem(checkedItemId);
1233
+ };
1234
+ keyboard.keyDown();
1235
+ }
1236
+ }
1237
+ handleKeyUp(ev) {
1238
+ if (this.keyControl) {
1239
+ const focusedList = generate.Generate.findEventPath(ev, this.el);
1240
+ if (focusedList) {
1241
+ const list = document.getElementById(`bcm-list-${this._id}`);
1242
+ if (list) {
1243
+ const items = list.querySelectorAll(".bcm-list__item.focused");
1244
+ if (items.length > 0) {
1245
+ const main = list.querySelector("main");
1246
+ const itemHeight = items[0].offsetHeight;
1247
+ const listHeight = main.offsetHeight;
1248
+ const itemTop = items[0].offsetTop;
1249
+ if (itemTop > listHeight) {
1250
+ main.scrollTop = itemTop - listHeight / 2 + itemHeight / 2;
1251
+ }
1252
+ if (itemTop < listHeight) {
1253
+ main.scrollTop = itemTop - listHeight / 2 - itemHeight / 2;
1254
+ }
1255
+ }
1256
+ }
1257
+ }
1258
+ }
1259
+ }
1260
+ async set(data) {
1261
+ if (data) {
1262
+ if (Array.isArray(data)) {
1263
+ this.addChecked(data);
1264
+ }
1265
+ if (typeof data === "string" || typeof data === "number") {
1266
+ this.selectedItem(data);
1267
+ }
1268
+ }
1269
+ else {
1270
+ this.setClear();
1271
+ }
1272
+ }
1273
+ async get() {
1274
+ var _a, _b;
1275
+ return this.value ? (this.checkboxes ? (_b = (_a = ((await this.getCheckedList()))) === null || _a === void 0 ? void 0 : _a.checkedList) === null || _b === void 0 ? void 0 : _b.map(item => item.id) : this.value.id) : null;
1276
+ }
1277
+ async getCheckedList() {
1278
+ return Promise.resolve(listState.getCheckedList(this._id));
1279
+ }
1280
+ async getSelected() {
1281
+ return Promise.resolve(listState.getSelected(this._id));
1282
+ }
1283
+ async getValue() {
1284
+ return Promise.resolve(this.value);
1285
+ }
1286
+ async addChecked(ids = [], save = false, emit = true) {
1287
+ if (ids && ids.length > 0) {
1288
+ if (!save) {
1289
+ listState.setClear(this._id);
1290
+ await utils.delay(10);
1291
+ }
1292
+ await listState.addChecked(this._id, ids);
1293
+ await utils.delay(10);
1294
+ emit && (this.value = (await this.getCheckedList()).checkedList);
1295
+ this.markForCheck();
1296
+ }
1297
+ return Promise.resolve(this.value);
1298
+ }
1299
+ async selected(id) {
1300
+ if (id) {
1301
+ return Promise.resolve(await this.selectedItem(id));
1302
+ }
1303
+ return false;
1304
+ }
1305
+ async setClear(e) {
1306
+ listState.setClear(this._id);
1307
+ this.value = null;
1308
+ this.inputText = "";
1309
+ this.isOpen = false;
1310
+ this.selectAllItem.indeterminate = "uncheck";
1311
+ this.markForCheck();
1312
+ if (e) {
1313
+ e.stopPropagation();
1314
+ e.preventDefault();
1315
+ }
1316
+ await utils.delay(10);
1317
+ return Promise.resolve();
1318
+ }
1319
+ async resetCaption() {
1320
+ await utils.delay(10);
1321
+ this.caption = this.captionCache;
1322
+ this.captionType = this.captionTypeCache;
1323
+ this.captionError = null;
1324
+ await utils.delay(10);
1325
+ return Promise.resolve();
1326
+ }
1327
+ async show() {
1328
+ this.isOpen = true;
1329
+ return Promise.resolve();
1330
+ }
1331
+ async hide() {
1332
+ this.isOpen = false;
1333
+ return Promise.resolve();
1334
+ }
1335
+ updateOptions() {
1336
+ listState.updateOptions(this._id, this);
1337
+ }
1338
+ handleIndeterminate(checkeds, total) {
1339
+ this.selectAllItem = Object.assign(Object.assign({}, this.selectAllItem), { indeterminate: this.checkboxes && checkeds > 0 ? (checkeds === total ? "check" : "indeterminate") : "uncheck", checked: this.checkboxes && checkeds > 0 ? (checkeds === total ? true : false) : false });
1340
+ }
1341
+ listenResize() {
1342
+ this.calculateLocation();
1343
+ this.markForCheck();
1344
+ }
1345
+ async unSelectOther() {
1346
+ await this.onClearSearch();
1347
+ this.isSelectedOther = false;
1348
+ this.searchFound = null;
1349
+ this.returnFilterData = {};
1350
+ listState.filterData(this._id, null);
1351
+ await utils.delay(10);
1352
+ return Promise.resolve();
1353
+ }
1354
+ async onClearSearch() {
1355
+ const searchInput = document.getElementById(`bcm-list-${this._id}-search`);
1356
+ if (searchInput) {
1357
+ await searchInput.handleClear();
1358
+ }
1359
+ return Promise.resolve();
1360
+ }
1361
+ async onSelectSearch() {
1362
+ const searchInput = document.getElementById(`bcm-list-${this._id}-search`);
1363
+ if (searchInput) {
1364
+ await utils.delay(100);
1365
+ searchInput.onBcmFocus();
1366
+ searchInput.onBcmSelect();
1367
+ }
1368
+ }
1369
+ async filterOtherList(ids) {
1370
+ const checklist = (await this.getCheckedList()).nestedResult;
1371
+ const filter = generate.Generate.convertIdsToNestedData(ids, checklist);
1372
+ this.returnFilterData = await listState.filterData(this._id, filter, null, true);
1373
+ this.searchFound = (ids === null || ids === void 0 ? void 0 : ids.length) || 0;
1374
+ this.limit = 500;
1375
+ this.searchGetParents = null;
1376
+ await utils.delay(1000);
1377
+ this.markForCheck();
1378
+ }
1379
+ async initState() {
1380
+ var _a, _b, _c;
1381
+ this.onClearSearch();
1382
+ await listState.setValue({
1383
+ id: this._id,
1384
+ dataSource: this.data && generate.snq(() => (typeof this.data == "string" ? JSON.parse(this.data) : this.data), []),
1385
+ options: this,
1386
+ });
1387
+ const { totalRoots, totalItems } = listState.getValue(this._id);
1388
+ this.totalData = totalItems;
1389
+ this.totalRootData = totalRoots;
1390
+ this.value = this.checkboxes ? (await this.getCheckedList()).checkedList : listState.selectedItem(this._id) ? listState.selectedItem(this._id)[0] : null;
1391
+ if (!this.checkboxes) {
1392
+ this.inputText = ((_a = this.value) === null || _a === void 0 ? void 0 : _a.text) || null;
1393
+ }
1394
+ // checkli olan subparentların indeterminate kontrolü için
1395
+ if (this.checkboxes && ((_b = this.value) === null || _b === void 0 ? void 0 : _b.length) > 0) {
1396
+ const checkedIDs = [];
1397
+ this.value.forEach(item => {
1398
+ if (!item.items || item.items.length === 0) {
1399
+ checkedIDs.push(item.id);
1400
+ }
1401
+ });
1402
+ await this.addChecked(checkedIDs, false, false);
1403
+ }
1404
+ await this.handleIndeterminate((_c = this.value) === null || _c === void 0 ? void 0 : _c.length, this.totalData);
1405
+ await this.markForCheck();
1406
+ }
1407
+ async markForCheck() {
1408
+ await utils.delay(10);
1409
+ this.tick = generate.Generate.UID();
1410
+ }
1411
+ getOptions() {
1412
+ return generate.snq(() => listState.getValue(this._id).options, {});
1413
+ }
1414
+ getItems() {
1415
+ if (this.isSelectedOther) {
1416
+ return this.returnFilterData["checkedItems"];
1417
+ }
1418
+ return generate.snq(() => listState.getData(this._id), []);
1419
+ }
1420
+ getLimitedItems(ids) {
1421
+ return generate.snq(() => listState.getDataPagination(this._id, this.searchResultLimit || this.limit, ids), []);
1422
+ }
1423
+ openGroup(parentId) {
1424
+ listState.openGroup(this._id, parentId);
1425
+ this.markForCheck();
1426
+ }
1427
+ focusItem(e) {
1428
+ if (e.target.classList.contains("bcm-list__item")) {
1429
+ const item = e.target;
1430
+ const list = document.getElementById(`bcm-list-${this._id}`);
1431
+ if (list) {
1432
+ const items = list.querySelectorAll(".bcm-list__item");
1433
+ if (items.length > 0) {
1434
+ const selectedItem = list.querySelector(".bcm-list__item.focused");
1435
+ if (selectedItem) {
1436
+ selectedItem.classList.remove("focused");
1437
+ }
1438
+ item.classList.add("focused");
1439
+ }
1440
+ }
1441
+ }
1442
+ }
1443
+ async selectedItem(itemId) {
1444
+ var _a;
1445
+ if (!this.checkboxes) {
1446
+ this.value = listState.selectedItem(this._id, itemId) ? listState.selectedItem(this._id, itemId)[0] : null;
1447
+ this.inputText = ((_a = this.value) === null || _a === void 0 ? void 0 : _a.text) || null;
1448
+ this.isOpen = false;
1449
+ this.markForCheck();
1450
+ if (this.type == "autocomplete" && this.value) {
1451
+ // await delay(100)
1452
+ // this.resetCaption()
1453
+ const autocompleteInput = this.getAutoCompleteInput();
1454
+ if (autocompleteInput) {
1455
+ setTimeout(() => {
1456
+ var _a;
1457
+ autocompleteInput.setValue(((_a = this.value) === null || _a === void 0 ? void 0 : _a.text) || "");
1458
+ this.isOpen = false;
1459
+ }, 100);
1460
+ }
1461
+ }
1462
+ }
1463
+ return Promise.resolve(this.value);
1464
+ }
1465
+ async checkedItem(itemId) {
1466
+ const isCheckSelectAll = itemId === "select-all";
1467
+ if (!isCheckSelectAll) {
1468
+ listState.checkedItem(this._id, itemId);
1469
+ }
1470
+ else {
1471
+ listState.selectAll(this._id, !this.selectAllItem.checked);
1472
+ }
1473
+ this.value = (await this.getCheckedList()).checkedList;
1474
+ this.changeVisibleCheckeds();
1475
+ this.markForCheck();
1476
+ }
1477
+ changeVisibleCheckeds() {
1478
+ const { visibledItems } = this.returnFilterData;
1479
+ this.returnFilterData = {
1480
+ visibledItems,
1481
+ checkedItems: (visibledItems && visibledItems.filter(item => item.checked)) || [],
1482
+ };
1483
+ }
1484
+ getAutoCompleteInput() {
1485
+ return document.getElementById(`bcm-list-input-tag-container-${this._id}-autocomplete-input`);
1486
+ }
1487
+ dataScrollEvent(event) {
1488
+ let count = 0;
1489
+ let io = new IntersectionObserver((data) => {
1490
+ if (count === 0) {
1491
+ count++;
1492
+ if (data[0].isIntersecting) {
1493
+ this.limit += 15;
1494
+ this.searchResultLimit += 15;
1495
+ io.disconnect();
1496
+ io = null;
1497
+ }
1498
+ }
1499
+ }, this.options);
1500
+ io.observe(event.target.lastElementChild);
1501
+ }
1502
+ async calculateLocation() {
1503
+ var _a, _b;
1504
+ if (this.type == "select" || this.type == "autocomplete" || this.linkedComponent) {
1505
+ const list = document.getElementById(`bcm-list-${this._id}`);
1506
+ // list && (list.style.height = '256px') //sebebi neydi ki!
1507
+ var placement = this.placement;
1508
+ const targetElementId = this.linkedComponent ? this.linkedComponent : `bcm-list-input-${this._id}`;
1509
+ const targetElement = document.getElementById(targetElementId);
1510
+ if (list && targetElement) {
1511
+ popoverPlacement.getPlacement(list, targetElement, placement, (place) => (placement = place));
1512
+ await utils.delay(10);
1513
+ let pos = popoverPlacement.setPosition(placement, targetElement);
1514
+ let captionAreaHeight = 0;
1515
+ let labelAreaHeight = 0;
1516
+ if (this.linkedComponent) {
1517
+ const linked = document.getElementById(this.linkedComponent);
1518
+ if (linked) {
1519
+ if (!linked["noCaption"]) {
1520
+ const captionArea = ((_a = linked.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".bcm-caption-area")) || linked.querySelector(".bcm-caption-area");
1521
+ if (captionArea) {
1522
+ captionAreaHeight = captionArea.offsetHeight || captionArea.clientHeight;
1523
+ }
1524
+ }
1525
+ const labelArea = ((_b = linked.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector(".bcm-label")) || linked.querySelector(".bcm-label");
1526
+ if (labelArea) {
1527
+ labelAreaHeight = labelArea.offsetHeight || labelArea.clientHeight;
1528
+ }
1529
+ }
1530
+ }
1531
+ if (this.fullWidth) {
1532
+ list.style.width = targetElement.offsetWidth + "px";
1533
+ }
1534
+ else {
1535
+ list.style.width = this.width || "auto";
1536
+ }
1537
+ if (this.height.indexOf("%") > -1) {
1538
+ list.style.height = numberHelper.NumberHelper.toNumber(this.height) * 0.01 * window.innerHeight - pos[0] - 50 + "px";
1539
+ }
1540
+ else {
1541
+ list.style.height = this.height;
1542
+ }
1543
+ list.style.minHeight = this.minHeight;
1544
+ // const calculatedMaxHeight = window.innerHeight - pos[0] - 50;
1545
+ const calculatedMaxHeight = placement.split("-")[0] == "top" ? window.innerHeight - (window.innerHeight - pos[0]) - 50 : window.innerHeight - pos[0] - 50;
1546
+ if (this.maxHeight.indexOf("%") > -1) {
1547
+ list.style.maxHeight = numberHelper.NumberHelper.toNumber(this.maxHeight) * 0.01 * calculatedMaxHeight + "px";
1548
+ }
1549
+ else {
1550
+ list.style.maxHeight = numberHelper.NumberHelper.toNumber(this.maxHeight) < calculatedMaxHeight ? this.maxHeight : calculatedMaxHeight + "px";
1551
+ }
1552
+ popoverPlacement.getPlacement(list, targetElement, placement, (place) => (placement = place));
1553
+ await utils.delay(10);
1554
+ pos = popoverPlacement.setPosition(placement, targetElement);
1555
+ list.style.top = (placement.split("-")[0] == "top" ? pos[0] - list.offsetHeight + labelAreaHeight : pos[0] - captionAreaHeight) + "px";
1556
+ // list.style.left = pos[1] + 'px';
1557
+ list.style.left = placement.split("-")[1] == "end" ? pos[1] - list.offsetWidth + "px" : pos[1] + "px";
1558
+ list.classList.toggle("bcm-list--top", placement.split("-")[0] == "top");
1559
+ this.calculatedViewport = true;
1560
+ }
1561
+ }
1562
+ }
1563
+ render() {
1564
+ const { checkboxes, treeview, label, size, disabled, readonly, required, hidden, fullWidth, searchable } = this.getOptions();
1565
+ const hostClasses = index$1.classnames("bcm-list", `bcm-list__size-${size}`, `bcm-list__${this.type}`, size === "large" ? "size-3" : "size-2", {
1566
+ "error": this.captionType == bcm.Bcm.Status.error,
1567
+ "full-width": fullWidth,
1568
+ "bcm-list__linked": this.linkedComponent,
1569
+ hidden,
1570
+ readonly,
1571
+ disabled,
1572
+ });
1573
+ const bcmListContainer = index$1.classnames("bcm-list__container", this.linkedComponent ? "bcm-list__type-linked-component" : `bcm-list__type-${this.type}`, {
1574
+ "is-open": this.isOpen && this.calculatedViewport,
1575
+ "error": this.captionType == bcm.Bcm.Status.error,
1576
+ "full-width": fullWidth,
1577
+ hidden,
1578
+ readonly,
1579
+ disabled,
1580
+ });
1581
+ const bcmListInput = index$1.classnames("bcm-list__input");
1582
+ const openedType = this.type == "select" || this.type == "autocomplete" || this.linkedComponent;
1583
+ return (index$2.h(index$2.Host, { class: hostClasses, tabindex: "0", style: {
1584
+ "--width": fullWidth ? "100%" : this.width,
1585
+ "--height": openedType ? "100%" : this.height,
1586
+ "--max-height": openedType ? "inherit" : this.maxHeight,
1587
+ "--min-height": openedType ? "inherit" : this.minHeight,
1588
+ } }, index$2.h("div", { id: `bcm-list-label-${this._id}`, class: "bcm-list__label" }, label && (index$2.h("div", null, index$2.h(labelTemplate.LabelTemplate, { size: this.size, type: this.captionType, value: label, required: required, htmlFor: this._id })))), this.type == "select" && (index$2.h("div", { id: `bcm-list-input-${this._id}`, class: bcmListInput }, index$2.h("span", { class: index$1.classnames("bcm-list__input-container", { "type-single": !checkboxes, "value-empty": !this.value }) }, this.checkboxes ? (this.value && this.value.length > 0 ? (index$2.h("bcm-rc-overflow", { data: this.tagData, maxCount: this.tagCount })) : (index$2.h("span", { class: "bcm-list__input-placeholder" }, this.placeholder))) : this.value ? (this.inputText) : (index$2.h("span", { class: "bcm-list__input-placeholder" }, this.placeholder))), index$2.h("span", { class: index$1.classnames("bcm-list__input-buttons", {
1589
+ disabled: disabled,
1590
+ }) }, this.clearable && this.value && (index$2.h("div", { class: "bcm-list__input-buttons-button" }, index$2.h("bcm-icon", { icon: "fal fa-times", onClick: e => !disabled && this.setClear(e) }))), index$2.h("div", { class: `bcm-list__input-buttons-button caret-is ${this.isOpen && this.calculatedViewport && "caret-is-open"}` }, index$2.h("bcm-icon", { icon: `far fa-angle-down` }))))), this.type === "autocomplete" && (index$2.h("div", { id: `bcm-list-input-${this._id}`, class: index$1.classnames(bcmListInput, { "bcm-list__input-autocomplete": this.type == "autocomplete" }) }, index$2.h("span", { class: "bcm-list__input-container", id: `bcm-list-input-tag-container-${this._id}` }, this.checkboxes && index$2.h("span", { class: "bcm-list__input-tag-container", id: `bcm-list-input-tag-container-${this._id}-autocomplete` }), index$2.h("bcm-search", { id: `bcm-list-input-tag-container-${this._id}-autocomplete-input`, class: "bcm-list__autocomplete", data: this.data, clearable: true, "full-width": true, "no-caption": true, placeholder: this.placeholder })))), index$2.h(ListTemplate, { highlight: this.highlightText, searchable: this.type == "autocomplete" ? false : searchable, bcmListContainer: bcmListContainer, checkboxes: checkboxes, treeview: treeview, infoFooter: this.infoFooter, value: this.value, totalData: this.totalData, searchFound: this.searchFound, variableText: this.variableText, searchPlaceholder: this.searchPlaceholder, minSearchLength: this.minSearchLength, searchIsOnlyChilds: this.searchIsOnlyChilds, _id: this._id, checkAll: this.checkAll, data: this.getItems(), width: this.width, height: this.height, size: this.size, selectAllItem: this.selectAllItem, onScrollEvent: e => this.dataScrollEvent(e), items: this.getLimitedItems(this.searchGetParents), selectedItem: itemId => this.selectedItem(itemId), checkedItem: itemId => this.checkedItem(itemId), openGroup: parentId => this.openGroup(parentId), focusItem: itemId => this.focusItem(itemId), emptyText: this.emptyText, emptyIcon: this.emptyIcon }), index$2.h(captionTemplate.CaptionTemplate, { noCaption: this.noCaption, captionType: this.captionType, captionError: this.captionError, caption: this.caption })));
1591
+ }
1592
+ get el() { return index$2.getElement(this); }
1593
+ static get watchers() { return {
1594
+ "_id": ["watchId"],
1595
+ "value": ["handleValueChange"],
1596
+ "returnFilterData": ["watchReturnFilterData"],
1597
+ "isOpen": ["handleOpen"],
1598
+ "data": ["dataChanged"]
1599
+ }; }
1600
+ };
1601
+ __decorate([
1602
+ isLoadDecorator.IsLoad()
1603
+ ], BcmList.prototype, "el", void 0);
1604
+ __decorate([
1605
+ jsonParseDecarator.JsonParse("data", true)
1606
+ ], BcmList.prototype, "dataChanged", null);
1607
+ BcmList.style = listCss;
1608
+
1609
+ function _extends$1() {
1610
+ _extends$1 = Object.assign ? Object.assign.bind() : function (target) {
1611
+ for (var i = 1; i < arguments.length; i++) {
1612
+ var source = arguments[i];
1613
+ for (var key in source) {
1614
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
1615
+ target[key] = source[key];
1616
+ }
1617
+ }
1618
+ }
1619
+ return target;
1620
+ };
1621
+ return _extends$1.apply(this, arguments);
1622
+ }
1623
+
1624
+ function _typeof$2(obj) {
1625
+ "@babel/helpers - typeof";
1626
+
1627
+ return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
1628
+ return typeof obj;
1629
+ } : function (obj) {
1630
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
1631
+ }, _typeof$2(obj);
1632
+ }
1633
+
1634
+ function _toPrimitive$1(input, hint) {
1635
+ if (_typeof$2(input) !== "object" || input === null) return input;
1636
+ var prim = input[Symbol.toPrimitive];
1637
+ if (prim !== undefined) {
1638
+ var res = prim.call(input, hint || "default");
1639
+ if (_typeof$2(res) !== "object") return res;
1640
+ throw new TypeError("@@toPrimitive must return a primitive value.");
1641
+ }
1642
+ return (hint === "string" ? String : Number)(input);
1643
+ }
1644
+
1645
+ function _toPropertyKey$1(arg) {
1646
+ var key = _toPrimitive$1(arg, "string");
1647
+ return _typeof$2(key) === "symbol" ? key : String(key);
1648
+ }
1649
+
1650
+ function _defineProperty$1(obj, key, value) {
1651
+ key = _toPropertyKey$1(key);
1652
+ if (key in obj) {
1653
+ Object.defineProperty(obj, key, {
1654
+ value: value,
1655
+ enumerable: true,
1656
+ configurable: true,
1657
+ writable: true
1658
+ });
1659
+ } else {
1660
+ obj[key] = value;
1661
+ }
1662
+ return obj;
1663
+ }
1664
+
1665
+ function ownKeys$1(object, enumerableOnly) {
1666
+ var keys = Object.keys(object);
1667
+ if (Object.getOwnPropertySymbols) {
1668
+ var symbols = Object.getOwnPropertySymbols(object);
1669
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
1670
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
1671
+ })), keys.push.apply(keys, symbols);
1672
+ }
1673
+ return keys;
1674
+ }
1675
+ function _objectSpread2$1(target) {
1676
+ for (var i = 1; i < arguments.length; i++) {
1677
+ var source = null != arguments[i] ? arguments[i] : {};
1678
+ i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) {
1679
+ _defineProperty$1(target, key, source[key]);
1680
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) {
1681
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
1682
+ });
1683
+ }
1684
+ return target;
1685
+ }
1686
+
1687
+ function _arrayWithHoles(arr) {
1688
+ if (Array.isArray(arr)) return arr;
1689
+ }
1690
+
1691
+ function _iterableToArrayLimit(arr, i) {
1692
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
1693
+ if (null != _i) {
1694
+ var _s,
1695
+ _e,
1696
+ _x,
1697
+ _r,
1698
+ _arr = [],
1699
+ _n = !0,
1700
+ _d = !1;
1701
+ try {
1702
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
1703
+ if (Object(_i) !== _i) return;
1704
+ _n = !1;
1705
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
1706
+ } catch (err) {
1707
+ _d = !0, _e = err;
1708
+ } finally {
1709
+ try {
1710
+ if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
1711
+ } finally {
1712
+ if (_d) throw _e;
1713
+ }
1714
+ }
1715
+ return _arr;
1716
+ }
1717
+ }
1718
+
1719
+ function _arrayLikeToArray(arr, len) {
1720
+ if (len == null || len > arr.length) len = arr.length;
1721
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
1722
+ return arr2;
1723
+ }
1724
+
1725
+ function _unsupportedIterableToArray(o, minLen) {
1726
+ if (!o) return;
1727
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
1728
+ var n = Object.prototype.toString.call(o).slice(8, -1);
1729
+ if (n === "Object" && o.constructor) n = o.constructor.name;
1730
+ if (n === "Map" || n === "Set") return Array.from(o);
1731
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
1732
+ }
1733
+
1734
+ function _nonIterableRest() {
1735
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1736
+ }
1737
+
1738
+ function _slicedToArray(arr, i) {
1739
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
1740
+ }
1741
+
1742
+ function _objectWithoutPropertiesLoose(source, excluded) {
1743
+ if (source == null) return {};
1744
+ var target = {};
1745
+ var sourceKeys = Object.keys(source);
1746
+ var key, i;
1747
+ for (i = 0; i < sourceKeys.length; i++) {
1748
+ key = sourceKeys[i];
1749
+ if (excluded.indexOf(key) >= 0) continue;
1750
+ target[key] = source[key];
1751
+ }
1752
+ return target;
1753
+ }
1754
+
1755
+ function _objectWithoutProperties(source, excluded) {
1756
+ if (source == null) return {};
1757
+ var target = _objectWithoutPropertiesLoose(source, excluded);
1758
+ var key, i;
1759
+ if (Object.getOwnPropertySymbols) {
1760
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
1761
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
1762
+ key = sourceSymbolKeys[i];
1763
+ if (excluded.indexOf(key) >= 0) continue;
1764
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
1765
+ target[key] = source[key];
1766
+ }
1767
+ }
1768
+ return target;
1769
+ }
1770
+
1771
+ function _extends() {
1772
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
1773
+ for (var i = 1; i < arguments.length; i++) {
1774
+ var source = arguments[i];
1775
+ for (var key in source) {
1776
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
1777
+ target[key] = source[key];
1778
+ }
1779
+ }
1780
+ }
1781
+ return target;
1782
+ };
1783
+ return _extends.apply(this, arguments);
1784
+ }
1785
+
1786
+ /** @license React v16.13.1
1787
+ * react-is.production.min.js
1788
+ *
1789
+ * Copyright (c) Facebook, Inc. and its affiliates.
1790
+ *
1791
+ * This source code is licensed under the MIT license found in the
1792
+ * LICENSE file in the root directory of this source tree.
1793
+ */
1794
+ var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
1795
+ Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
1796
+ function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}var AsyncMode=l;var ConcurrentMode=m;var ContextConsumer=k;var ContextProvider=h;var Element$1=c;var ForwardRef=n;var Fragment=e;var Lazy=t;var Memo=r;var Portal=d;
1797
+ var Profiler=g;var StrictMode=f;var Suspense=p;var isAsyncMode=function(a){return A(a)||z(a)===l};var isConcurrentMode=A;var isContextConsumer=function(a){return z(a)===k};var isContextProvider=function(a){return z(a)===h};var isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};var isForwardRef=function(a){return z(a)===n};var isFragment=function(a){return z(a)===e};var isLazy=function(a){return z(a)===t};
1798
+ var isMemo=function(a){return z(a)===r};var isPortal=function(a){return z(a)===d};var isProfiler=function(a){return z(a)===g};var isStrictMode=function(a){return z(a)===f};var isSuspense=function(a){return z(a)===p};
1799
+ var isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};var typeOf=z;
1800
+
1801
+ var reactIs_production_min = {
1802
+ AsyncMode: AsyncMode,
1803
+ ConcurrentMode: ConcurrentMode,
1804
+ ContextConsumer: ContextConsumer,
1805
+ ContextProvider: ContextProvider,
1806
+ Element: Element$1,
1807
+ ForwardRef: ForwardRef,
1808
+ Fragment: Fragment,
1809
+ Lazy: Lazy,
1810
+ Memo: Memo,
1811
+ Portal: Portal,
1812
+ Profiler: Profiler,
1813
+ StrictMode: StrictMode,
1814
+ Suspense: Suspense,
1815
+ isAsyncMode: isAsyncMode,
1816
+ isConcurrentMode: isConcurrentMode,
1817
+ isContextConsumer: isContextConsumer,
1818
+ isContextProvider: isContextProvider,
1819
+ isElement: isElement,
1820
+ isForwardRef: isForwardRef,
1821
+ isFragment: isFragment,
1822
+ isLazy: isLazy,
1823
+ isMemo: isMemo,
1824
+ isPortal: isPortal,
1825
+ isProfiler: isProfiler,
1826
+ isStrictMode: isStrictMode,
1827
+ isSuspense: isSuspense,
1828
+ isValidElementType: isValidElementType,
1829
+ typeOf: typeOf
1830
+ };
1831
+
1832
+ _commonjsHelpers.createCommonjsModule(function (module, exports) {
1833
+ });
1834
+
1835
+ var reactIs = _commonjsHelpers.createCommonjsModule(function (module) {
1836
+
1837
+ {
1838
+ module.exports = reactIs_production_min;
1839
+ }
1840
+ });
1841
+
1842
+ function toArray(children) {
1843
+ var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1844
+ var ret = [];
1845
+ index$4.react.Children.forEach(children, function (child) {
1846
+ if ((child === undefined || child === null) && !option.keepEmpty) {
1847
+ return;
1848
+ }
1849
+ if (Array.isArray(child)) {
1850
+ ret = ret.concat(toArray(child));
1851
+ } else if (reactIs.isFragment(child) && child.props) {
1852
+ ret = ret.concat(toArray(child.props.children, option));
1853
+ } else {
1854
+ ret.push(child);
1855
+ }
1856
+ });
1857
+ return ret;
1858
+ }
1859
+
1860
+ function _typeof$1(obj) {
1861
+ "@babel/helpers - typeof";
1862
+
1863
+ return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
1864
+ return typeof obj;
1865
+ } : function (obj) {
1866
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
1867
+ }, _typeof$1(obj);
1868
+ }
1869
+
1870
+ function _toPrimitive(input, hint) {
1871
+ if (_typeof$1(input) !== "object" || input === null) return input;
1872
+ var prim = input[Symbol.toPrimitive];
1873
+ if (prim !== undefined) {
1874
+ var res = prim.call(input, hint || "default");
1875
+ if (_typeof$1(res) !== "object") return res;
1876
+ throw new TypeError("@@toPrimitive must return a primitive value.");
1877
+ }
1878
+ return (hint === "string" ? String : Number)(input);
1879
+ }
1880
+
1881
+ function _toPropertyKey(arg) {
1882
+ var key = _toPrimitive(arg, "string");
1883
+ return _typeof$1(key) === "symbol" ? key : String(key);
1884
+ }
1885
+
1886
+ function _defineProperty(obj, key, value) {
1887
+ key = _toPropertyKey(key);
1888
+ if (key in obj) {
1889
+ Object.defineProperty(obj, key, {
1890
+ value: value,
1891
+ enumerable: true,
1892
+ configurable: true,
1893
+ writable: true
1894
+ });
1895
+ } else {
1896
+ obj[key] = value;
1897
+ }
1898
+ return obj;
1899
+ }
1900
+
1901
+ function ownKeys(object, enumerableOnly) {
1902
+ var keys = Object.keys(object);
1903
+ if (Object.getOwnPropertySymbols) {
1904
+ var symbols = Object.getOwnPropertySymbols(object);
1905
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
1906
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
1907
+ })), keys.push.apply(keys, symbols);
1908
+ }
1909
+ return keys;
1910
+ }
1911
+ function _objectSpread2(target) {
1912
+ for (var i = 1; i < arguments.length; i++) {
1913
+ var source = null != arguments[i] ? arguments[i] : {};
1914
+ i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
1915
+ _defineProperty(target, key, source[key]);
1916
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
1917
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
1918
+ });
1919
+ }
1920
+ return target;
1921
+ }
1922
+
1923
+ function _typeof(obj) {
1924
+ "@babel/helpers - typeof";
1925
+
1926
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
1927
+ return typeof obj;
1928
+ } : function (obj) {
1929
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
1930
+ }, _typeof(obj);
1931
+ }
1932
+
1933
+ function fillRef(ref, node) {
1934
+ if (typeof ref === 'function') {
1935
+ ref(node);
1936
+ } else if (_typeof(ref) === 'object' && ref && 'current' in ref) {
1937
+ ref.current = node;
1938
+ }
1939
+ }
1940
+
1941
+ /**
1942
+ * Merge refs into one ref function to support ref passing.
1943
+ */
1944
+ function composeRef() {
1945
+ for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
1946
+ refs[_key] = arguments[_key];
1947
+ }
1948
+ var refList = refs.filter(function (ref) {
1949
+ return ref;
1950
+ });
1951
+ if (refList.length <= 1) {
1952
+ return refList[0];
1953
+ }
1954
+ return function (node) {
1955
+ refs.forEach(function (ref) {
1956
+ fillRef(ref, node);
1957
+ });
1958
+ };
1959
+ }
1960
+ function supportRef(nodeOrComponent) {
1961
+ var _type$prototype, _nodeOrComponent$prot;
1962
+ var type = reactIs.isMemo(nodeOrComponent) ? nodeOrComponent.type.type : nodeOrComponent.type;
1963
+
1964
+ // Function component node
1965
+ if (typeof type === 'function' && !((_type$prototype = type.prototype) !== null && _type$prototype !== void 0 && _type$prototype.render)) {
1966
+ return false;
1967
+ }
1968
+
1969
+ // Class component
1970
+ if (typeof nodeOrComponent === 'function' && !((_nodeOrComponent$prot = nodeOrComponent.prototype) !== null && _nodeOrComponent$prot !== void 0 && _nodeOrComponent$prot.render)) {
1971
+ return false;
1972
+ }
1973
+ return true;
1974
+ }
1975
+ /* eslint-enable */
1976
+
1977
+ function isDOM(node) {
1978
+ // https://developer.mozilla.org/en-US/docs/Web/API/Element
1979
+ // Since XULElement is also subclass of Element, we only need HTMLElement and SVGElement
1980
+ return node instanceof HTMLElement || node instanceof SVGElement;
1981
+ }
1982
+
1983
+ /**
1984
+ * Return if a node is a DOM node. Else will return by `findDOMNode`
1985
+ */
1986
+ function findDOMNode(node) {
1987
+ if (isDOM(node)) {
1988
+ return node;
1989
+ }
1990
+ if (node instanceof index$4.react.Component) {
1991
+ return index$4.reactDom.findDOMNode(node);
1992
+ }
1993
+ return null;
1994
+ }
1995
+
1996
+ /**
1997
+ * A collection of shims that provide minimal functionality of the ES6 collections.
1998
+ *
1999
+ * These implementations are not meant to be used outside of the ResizeObserver
2000
+ * modules as they cover only a limited range of use cases.
2001
+ */
2002
+ /* eslint-disable require-jsdoc, valid-jsdoc */
2003
+ var MapShim = (function () {
2004
+ if (typeof Map !== 'undefined') {
2005
+ return Map;
2006
+ }
2007
+ /**
2008
+ * Returns index in provided array that matches the specified key.
2009
+ *
2010
+ * @param {Array<Array>} arr
2011
+ * @param {*} key
2012
+ * @returns {number}
2013
+ */
2014
+ function getIndex(arr, key) {
2015
+ var result = -1;
2016
+ arr.some(function (entry, index) {
2017
+ if (entry[0] === key) {
2018
+ result = index;
2019
+ return true;
2020
+ }
2021
+ return false;
2022
+ });
2023
+ return result;
2024
+ }
2025
+ return /** @class */ (function () {
2026
+ function class_1() {
2027
+ this.__entries__ = [];
2028
+ }
2029
+ Object.defineProperty(class_1.prototype, "size", {
2030
+ /**
2031
+ * @returns {boolean}
2032
+ */
2033
+ get: function () {
2034
+ return this.__entries__.length;
2035
+ },
2036
+ enumerable: true,
2037
+ configurable: true
2038
+ });
2039
+ /**
2040
+ * @param {*} key
2041
+ * @returns {*}
2042
+ */
2043
+ class_1.prototype.get = function (key) {
2044
+ var index = getIndex(this.__entries__, key);
2045
+ var entry = this.__entries__[index];
2046
+ return entry && entry[1];
2047
+ };
2048
+ /**
2049
+ * @param {*} key
2050
+ * @param {*} value
2051
+ * @returns {void}
2052
+ */
2053
+ class_1.prototype.set = function (key, value) {
2054
+ var index = getIndex(this.__entries__, key);
2055
+ if (~index) {
2056
+ this.__entries__[index][1] = value;
2057
+ }
2058
+ else {
2059
+ this.__entries__.push([key, value]);
2060
+ }
2061
+ };
2062
+ /**
2063
+ * @param {*} key
2064
+ * @returns {void}
2065
+ */
2066
+ class_1.prototype.delete = function (key) {
2067
+ var entries = this.__entries__;
2068
+ var index = getIndex(entries, key);
2069
+ if (~index) {
2070
+ entries.splice(index, 1);
2071
+ }
2072
+ };
2073
+ /**
2074
+ * @param {*} key
2075
+ * @returns {void}
2076
+ */
2077
+ class_1.prototype.has = function (key) {
2078
+ return !!~getIndex(this.__entries__, key);
2079
+ };
2080
+ /**
2081
+ * @returns {void}
2082
+ */
2083
+ class_1.prototype.clear = function () {
2084
+ this.__entries__.splice(0);
2085
+ };
2086
+ /**
2087
+ * @param {Function} callback
2088
+ * @param {*} [ctx=null]
2089
+ * @returns {void}
2090
+ */
2091
+ class_1.prototype.forEach = function (callback, ctx) {
2092
+ if (ctx === void 0) { ctx = null; }
2093
+ for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {
2094
+ var entry = _a[_i];
2095
+ callback.call(ctx, entry[1], entry[0]);
2096
+ }
2097
+ };
2098
+ return class_1;
2099
+ }());
2100
+ })();
2101
+
2102
+ /**
2103
+ * Detects whether window and document objects are available in current environment.
2104
+ */
2105
+ var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document;
2106
+
2107
+ // Returns global object of a current environment.
2108
+ var global$1 = (function () {
2109
+ if (typeof global !== 'undefined' && global.Math === Math) {
2110
+ return global;
2111
+ }
2112
+ if (typeof self !== 'undefined' && self.Math === Math) {
2113
+ return self;
2114
+ }
2115
+ if (typeof window !== 'undefined' && window.Math === Math) {
2116
+ return window;
2117
+ }
2118
+ // eslint-disable-next-line no-new-func
2119
+ return Function('return this')();
2120
+ })();
2121
+
2122
+ /**
2123
+ * A shim for the requestAnimationFrame which falls back to the setTimeout if
2124
+ * first one is not supported.
2125
+ *
2126
+ * @returns {number} Requests' identifier.
2127
+ */
2128
+ var requestAnimationFrame$1 = (function () {
2129
+ if (typeof requestAnimationFrame === 'function') {
2130
+ // It's required to use a bounded function because IE sometimes throws
2131
+ // an "Invalid calling object" error if rAF is invoked without the global
2132
+ // object on the left hand side.
2133
+ return requestAnimationFrame.bind(global$1);
2134
+ }
2135
+ return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); };
2136
+ })();
2137
+
2138
+ // Defines minimum timeout before adding a trailing call.
2139
+ var trailingTimeout = 2;
2140
+ /**
2141
+ * Creates a wrapper function which ensures that provided callback will be
2142
+ * invoked only once during the specified delay period.
2143
+ *
2144
+ * @param {Function} callback - Function to be invoked after the delay period.
2145
+ * @param {number} delay - Delay after which to invoke callback.
2146
+ * @returns {Function}
2147
+ */
2148
+ function throttle (callback, delay) {
2149
+ var leadingCall = false, trailingCall = false, lastCallTime = 0;
2150
+ /**
2151
+ * Invokes the original callback function and schedules new invocation if
2152
+ * the "proxy" was called during current request.
2153
+ *
2154
+ * @returns {void}
2155
+ */
2156
+ function resolvePending() {
2157
+ if (leadingCall) {
2158
+ leadingCall = false;
2159
+ callback();
2160
+ }
2161
+ if (trailingCall) {
2162
+ proxy();
2163
+ }
2164
+ }
2165
+ /**
2166
+ * Callback invoked after the specified delay. It will further postpone
2167
+ * invocation of the original function delegating it to the
2168
+ * requestAnimationFrame.
2169
+ *
2170
+ * @returns {void}
2171
+ */
2172
+ function timeoutCallback() {
2173
+ requestAnimationFrame$1(resolvePending);
2174
+ }
2175
+ /**
2176
+ * Schedules invocation of the original function.
2177
+ *
2178
+ * @returns {void}
2179
+ */
2180
+ function proxy() {
2181
+ var timeStamp = Date.now();
2182
+ if (leadingCall) {
2183
+ // Reject immediately following calls.
2184
+ if (timeStamp - lastCallTime < trailingTimeout) {
2185
+ return;
2186
+ }
2187
+ // Schedule new call to be in invoked when the pending one is resolved.
2188
+ // This is important for "transitions" which never actually start
2189
+ // immediately so there is a chance that we might miss one if change
2190
+ // happens amids the pending invocation.
2191
+ trailingCall = true;
2192
+ }
2193
+ else {
2194
+ leadingCall = true;
2195
+ trailingCall = false;
2196
+ setTimeout(timeoutCallback, delay);
2197
+ }
2198
+ lastCallTime = timeStamp;
2199
+ }
2200
+ return proxy;
2201
+ }
2202
+
2203
+ // Minimum delay before invoking the update of observers.
2204
+ var REFRESH_DELAY = 20;
2205
+ // A list of substrings of CSS properties used to find transition events that
2206
+ // might affect dimensions of observed elements.
2207
+ var transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight'];
2208
+ // Check if MutationObserver is available.
2209
+ var mutationObserverSupported = typeof MutationObserver !== 'undefined';
2210
+ /**
2211
+ * Singleton controller class which handles updates of ResizeObserver instances.
2212
+ */
2213
+ var ResizeObserverController = /** @class */ (function () {
2214
+ /**
2215
+ * Creates a new instance of ResizeObserverController.
2216
+ *
2217
+ * @private
2218
+ */
2219
+ function ResizeObserverController() {
2220
+ /**
2221
+ * Indicates whether DOM listeners have been added.
2222
+ *
2223
+ * @private {boolean}
2224
+ */
2225
+ this.connected_ = false;
2226
+ /**
2227
+ * Tells that controller has subscribed for Mutation Events.
2228
+ *
2229
+ * @private {boolean}
2230
+ */
2231
+ this.mutationEventsAdded_ = false;
2232
+ /**
2233
+ * Keeps reference to the instance of MutationObserver.
2234
+ *
2235
+ * @private {MutationObserver}
2236
+ */
2237
+ this.mutationsObserver_ = null;
2238
+ /**
2239
+ * A list of connected observers.
2240
+ *
2241
+ * @private {Array<ResizeObserverSPI>}
2242
+ */
2243
+ this.observers_ = [];
2244
+ this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);
2245
+ this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);
2246
+ }
2247
+ /**
2248
+ * Adds observer to observers list.
2249
+ *
2250
+ * @param {ResizeObserverSPI} observer - Observer to be added.
2251
+ * @returns {void}
2252
+ */
2253
+ ResizeObserverController.prototype.addObserver = function (observer) {
2254
+ if (!~this.observers_.indexOf(observer)) {
2255
+ this.observers_.push(observer);
2256
+ }
2257
+ // Add listeners if they haven't been added yet.
2258
+ if (!this.connected_) {
2259
+ this.connect_();
2260
+ }
2261
+ };
2262
+ /**
2263
+ * Removes observer from observers list.
2264
+ *
2265
+ * @param {ResizeObserverSPI} observer - Observer to be removed.
2266
+ * @returns {void}
2267
+ */
2268
+ ResizeObserverController.prototype.removeObserver = function (observer) {
2269
+ var observers = this.observers_;
2270
+ var index = observers.indexOf(observer);
2271
+ // Remove observer if it's present in registry.
2272
+ if (~index) {
2273
+ observers.splice(index, 1);
2274
+ }
2275
+ // Remove listeners if controller has no connected observers.
2276
+ if (!observers.length && this.connected_) {
2277
+ this.disconnect_();
2278
+ }
2279
+ };
2280
+ /**
2281
+ * Invokes the update of observers. It will continue running updates insofar
2282
+ * it detects changes.
2283
+ *
2284
+ * @returns {void}
2285
+ */
2286
+ ResizeObserverController.prototype.refresh = function () {
2287
+ var changesDetected = this.updateObservers_();
2288
+ // Continue running updates if changes have been detected as there might
2289
+ // be future ones caused by CSS transitions.
2290
+ if (changesDetected) {
2291
+ this.refresh();
2292
+ }
2293
+ };
2294
+ /**
2295
+ * Updates every observer from observers list and notifies them of queued
2296
+ * entries.
2297
+ *
2298
+ * @private
2299
+ * @returns {boolean} Returns "true" if any observer has detected changes in
2300
+ * dimensions of it's elements.
2301
+ */
2302
+ ResizeObserverController.prototype.updateObservers_ = function () {
2303
+ // Collect observers that have active observations.
2304
+ var activeObservers = this.observers_.filter(function (observer) {
2305
+ return observer.gatherActive(), observer.hasActive();
2306
+ });
2307
+ // Deliver notifications in a separate cycle in order to avoid any
2308
+ // collisions between observers, e.g. when multiple instances of
2309
+ // ResizeObserver are tracking the same element and the callback of one
2310
+ // of them changes content dimensions of the observed target. Sometimes
2311
+ // this may result in notifications being blocked for the rest of observers.
2312
+ activeObservers.forEach(function (observer) { return observer.broadcastActive(); });
2313
+ return activeObservers.length > 0;
2314
+ };
2315
+ /**
2316
+ * Initializes DOM listeners.
2317
+ *
2318
+ * @private
2319
+ * @returns {void}
2320
+ */
2321
+ ResizeObserverController.prototype.connect_ = function () {
2322
+ // Do nothing if running in a non-browser environment or if listeners
2323
+ // have been already added.
2324
+ if (!isBrowser || this.connected_) {
2325
+ return;
2326
+ }
2327
+ // Subscription to the "Transitionend" event is used as a workaround for
2328
+ // delayed transitions. This way it's possible to capture at least the
2329
+ // final state of an element.
2330
+ document.addEventListener('transitionend', this.onTransitionEnd_);
2331
+ window.addEventListener('resize', this.refresh);
2332
+ if (mutationObserverSupported) {
2333
+ this.mutationsObserver_ = new MutationObserver(this.refresh);
2334
+ this.mutationsObserver_.observe(document, {
2335
+ attributes: true,
2336
+ childList: true,
2337
+ characterData: true,
2338
+ subtree: true
2339
+ });
2340
+ }
2341
+ else {
2342
+ document.addEventListener('DOMSubtreeModified', this.refresh);
2343
+ this.mutationEventsAdded_ = true;
2344
+ }
2345
+ this.connected_ = true;
2346
+ };
2347
+ /**
2348
+ * Removes DOM listeners.
2349
+ *
2350
+ * @private
2351
+ * @returns {void}
2352
+ */
2353
+ ResizeObserverController.prototype.disconnect_ = function () {
2354
+ // Do nothing if running in a non-browser environment or if listeners
2355
+ // have been already removed.
2356
+ if (!isBrowser || !this.connected_) {
2357
+ return;
2358
+ }
2359
+ document.removeEventListener('transitionend', this.onTransitionEnd_);
2360
+ window.removeEventListener('resize', this.refresh);
2361
+ if (this.mutationsObserver_) {
2362
+ this.mutationsObserver_.disconnect();
2363
+ }
2364
+ if (this.mutationEventsAdded_) {
2365
+ document.removeEventListener('DOMSubtreeModified', this.refresh);
2366
+ }
2367
+ this.mutationsObserver_ = null;
2368
+ this.mutationEventsAdded_ = false;
2369
+ this.connected_ = false;
2370
+ };
2371
+ /**
2372
+ * "Transitionend" event handler.
2373
+ *
2374
+ * @private
2375
+ * @param {TransitionEvent} event
2376
+ * @returns {void}
2377
+ */
2378
+ ResizeObserverController.prototype.onTransitionEnd_ = function (_a) {
2379
+ var _b = _a.propertyName, propertyName = _b === void 0 ? '' : _b;
2380
+ // Detect whether transition may affect dimensions of an element.
2381
+ var isReflowProperty = transitionKeys.some(function (key) {
2382
+ return !!~propertyName.indexOf(key);
2383
+ });
2384
+ if (isReflowProperty) {
2385
+ this.refresh();
2386
+ }
2387
+ };
2388
+ /**
2389
+ * Returns instance of the ResizeObserverController.
2390
+ *
2391
+ * @returns {ResizeObserverController}
2392
+ */
2393
+ ResizeObserverController.getInstance = function () {
2394
+ if (!this.instance_) {
2395
+ this.instance_ = new ResizeObserverController();
2396
+ }
2397
+ return this.instance_;
2398
+ };
2399
+ /**
2400
+ * Holds reference to the controller's instance.
2401
+ *
2402
+ * @private {ResizeObserverController}
2403
+ */
2404
+ ResizeObserverController.instance_ = null;
2405
+ return ResizeObserverController;
2406
+ }());
2407
+
2408
+ /**
2409
+ * Defines non-writable/enumerable properties of the provided target object.
2410
+ *
2411
+ * @param {Object} target - Object for which to define properties.
2412
+ * @param {Object} props - Properties to be defined.
2413
+ * @returns {Object} Target object.
2414
+ */
2415
+ var defineConfigurable = (function (target, props) {
2416
+ for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {
2417
+ var key = _a[_i];
2418
+ Object.defineProperty(target, key, {
2419
+ value: props[key],
2420
+ enumerable: false,
2421
+ writable: false,
2422
+ configurable: true
2423
+ });
2424
+ }
2425
+ return target;
2426
+ });
2427
+
2428
+ /**
2429
+ * Returns the global object associated with provided element.
2430
+ *
2431
+ * @param {Object} target
2432
+ * @returns {Object}
2433
+ */
2434
+ var getWindowOf = (function (target) {
2435
+ // Assume that the element is an instance of Node, which means that it
2436
+ // has the "ownerDocument" property from which we can retrieve a
2437
+ // corresponding global object.
2438
+ var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;
2439
+ // Return the local global object if it's not possible extract one from
2440
+ // provided element.
2441
+ return ownerGlobal || global$1;
2442
+ });
2443
+
2444
+ // Placeholder of an empty content rectangle.
2445
+ var emptyRect = createRectInit(0, 0, 0, 0);
2446
+ /**
2447
+ * Converts provided string to a number.
2448
+ *
2449
+ * @param {number|string} value
2450
+ * @returns {number}
2451
+ */
2452
+ function toFloat(value) {
2453
+ return parseFloat(value) || 0;
2454
+ }
2455
+ /**
2456
+ * Extracts borders size from provided styles.
2457
+ *
2458
+ * @param {CSSStyleDeclaration} styles
2459
+ * @param {...string} positions - Borders positions (top, right, ...)
2460
+ * @returns {number}
2461
+ */
2462
+ function getBordersSize(styles) {
2463
+ var positions = [];
2464
+ for (var _i = 1; _i < arguments.length; _i++) {
2465
+ positions[_i - 1] = arguments[_i];
2466
+ }
2467
+ return positions.reduce(function (size, position) {
2468
+ var value = styles['border-' + position + '-width'];
2469
+ return size + toFloat(value);
2470
+ }, 0);
2471
+ }
2472
+ /**
2473
+ * Extracts paddings sizes from provided styles.
2474
+ *
2475
+ * @param {CSSStyleDeclaration} styles
2476
+ * @returns {Object} Paddings box.
2477
+ */
2478
+ function getPaddings(styles) {
2479
+ var positions = ['top', 'right', 'bottom', 'left'];
2480
+ var paddings = {};
2481
+ for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
2482
+ var position = positions_1[_i];
2483
+ var value = styles['padding-' + position];
2484
+ paddings[position] = toFloat(value);
2485
+ }
2486
+ return paddings;
2487
+ }
2488
+ /**
2489
+ * Calculates content rectangle of provided SVG element.
2490
+ *
2491
+ * @param {SVGGraphicsElement} target - Element content rectangle of which needs
2492
+ * to be calculated.
2493
+ * @returns {DOMRectInit}
2494
+ */
2495
+ function getSVGContentRect(target) {
2496
+ var bbox = target.getBBox();
2497
+ return createRectInit(0, 0, bbox.width, bbox.height);
2498
+ }
2499
+ /**
2500
+ * Calculates content rectangle of provided HTMLElement.
2501
+ *
2502
+ * @param {HTMLElement} target - Element for which to calculate the content rectangle.
2503
+ * @returns {DOMRectInit}
2504
+ */
2505
+ function getHTMLElementContentRect(target) {
2506
+ // Client width & height properties can't be
2507
+ // used exclusively as they provide rounded values.
2508
+ var clientWidth = target.clientWidth, clientHeight = target.clientHeight;
2509
+ // By this condition we can catch all non-replaced inline, hidden and
2510
+ // detached elements. Though elements with width & height properties less
2511
+ // than 0.5 will be discarded as well.
2512
+ //
2513
+ // Without it we would need to implement separate methods for each of
2514
+ // those cases and it's not possible to perform a precise and performance
2515
+ // effective test for hidden elements. E.g. even jQuery's ':visible' filter
2516
+ // gives wrong results for elements with width & height less than 0.5.
2517
+ if (!clientWidth && !clientHeight) {
2518
+ return emptyRect;
2519
+ }
2520
+ var styles = getWindowOf(target).getComputedStyle(target);
2521
+ var paddings = getPaddings(styles);
2522
+ var horizPad = paddings.left + paddings.right;
2523
+ var vertPad = paddings.top + paddings.bottom;
2524
+ // Computed styles of width & height are being used because they are the
2525
+ // only dimensions available to JS that contain non-rounded values. It could
2526
+ // be possible to utilize the getBoundingClientRect if only it's data wasn't
2527
+ // affected by CSS transformations let alone paddings, borders and scroll bars.
2528
+ var width = toFloat(styles.width), height = toFloat(styles.height);
2529
+ // Width & height include paddings and borders when the 'border-box' box
2530
+ // model is applied (except for IE).
2531
+ if (styles.boxSizing === 'border-box') {
2532
+ // Following conditions are required to handle Internet Explorer which
2533
+ // doesn't include paddings and borders to computed CSS dimensions.
2534
+ //
2535
+ // We can say that if CSS dimensions + paddings are equal to the "client"
2536
+ // properties then it's either IE, and thus we don't need to subtract
2537
+ // anything, or an element merely doesn't have paddings/borders styles.
2538
+ if (Math.round(width + horizPad) !== clientWidth) {
2539
+ width -= getBordersSize(styles, 'left', 'right') + horizPad;
2540
+ }
2541
+ if (Math.round(height + vertPad) !== clientHeight) {
2542
+ height -= getBordersSize(styles, 'top', 'bottom') + vertPad;
2543
+ }
2544
+ }
2545
+ // Following steps can't be applied to the document's root element as its
2546
+ // client[Width/Height] properties represent viewport area of the window.
2547
+ // Besides, it's as well not necessary as the <html> itself neither has
2548
+ // rendered scroll bars nor it can be clipped.
2549
+ if (!isDocumentElement(target)) {
2550
+ // In some browsers (only in Firefox, actually) CSS width & height
2551
+ // include scroll bars size which can be removed at this step as scroll
2552
+ // bars are the only difference between rounded dimensions + paddings
2553
+ // and "client" properties, though that is not always true in Chrome.
2554
+ var vertScrollbar = Math.round(width + horizPad) - clientWidth;
2555
+ var horizScrollbar = Math.round(height + vertPad) - clientHeight;
2556
+ // Chrome has a rather weird rounding of "client" properties.
2557
+ // E.g. for an element with content width of 314.2px it sometimes gives
2558
+ // the client width of 315px and for the width of 314.7px it may give
2559
+ // 314px. And it doesn't happen all the time. So just ignore this delta
2560
+ // as a non-relevant.
2561
+ if (Math.abs(vertScrollbar) !== 1) {
2562
+ width -= vertScrollbar;
2563
+ }
2564
+ if (Math.abs(horizScrollbar) !== 1) {
2565
+ height -= horizScrollbar;
2566
+ }
2567
+ }
2568
+ return createRectInit(paddings.left, paddings.top, width, height);
2569
+ }
2570
+ /**
2571
+ * Checks whether provided element is an instance of the SVGGraphicsElement.
2572
+ *
2573
+ * @param {Element} target - Element to be checked.
2574
+ * @returns {boolean}
2575
+ */
2576
+ var isSVGGraphicsElement = (function () {
2577
+ // Some browsers, namely IE and Edge, don't have the SVGGraphicsElement
2578
+ // interface.
2579
+ if (typeof SVGGraphicsElement !== 'undefined') {
2580
+ return function (target) { return target instanceof getWindowOf(target).SVGGraphicsElement; };
2581
+ }
2582
+ // If it's so, then check that element is at least an instance of the
2583
+ // SVGElement and that it has the "getBBox" method.
2584
+ // eslint-disable-next-line no-extra-parens
2585
+ return function (target) { return (target instanceof getWindowOf(target).SVGElement &&
2586
+ typeof target.getBBox === 'function'); };
2587
+ })();
2588
+ /**
2589
+ * Checks whether provided element is a document element (<html>).
2590
+ *
2591
+ * @param {Element} target - Element to be checked.
2592
+ * @returns {boolean}
2593
+ */
2594
+ function isDocumentElement(target) {
2595
+ return target === getWindowOf(target).document.documentElement;
2596
+ }
2597
+ /**
2598
+ * Calculates an appropriate content rectangle for provided html or svg element.
2599
+ *
2600
+ * @param {Element} target - Element content rectangle of which needs to be calculated.
2601
+ * @returns {DOMRectInit}
2602
+ */
2603
+ function getContentRect(target) {
2604
+ if (!isBrowser) {
2605
+ return emptyRect;
2606
+ }
2607
+ if (isSVGGraphicsElement(target)) {
2608
+ return getSVGContentRect(target);
2609
+ }
2610
+ return getHTMLElementContentRect(target);
2611
+ }
2612
+ /**
2613
+ * Creates rectangle with an interface of the DOMRectReadOnly.
2614
+ * Spec: https://drafts.fxtf.org/geometry/#domrectreadonly
2615
+ *
2616
+ * @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions.
2617
+ * @returns {DOMRectReadOnly}
2618
+ */
2619
+ function createReadOnlyRect(_a) {
2620
+ var x = _a.x, y = _a.y, width = _a.width, height = _a.height;
2621
+ // If DOMRectReadOnly is available use it as a prototype for the rectangle.
2622
+ var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object;
2623
+ var rect = Object.create(Constr.prototype);
2624
+ // Rectangle's properties are not writable and non-enumerable.
2625
+ defineConfigurable(rect, {
2626
+ x: x, y: y, width: width, height: height,
2627
+ top: y,
2628
+ right: x + width,
2629
+ bottom: height + y,
2630
+ left: x
2631
+ });
2632
+ return rect;
2633
+ }
2634
+ /**
2635
+ * Creates DOMRectInit object based on the provided dimensions and the x/y coordinates.
2636
+ * Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit
2637
+ *
2638
+ * @param {number} x - X coordinate.
2639
+ * @param {number} y - Y coordinate.
2640
+ * @param {number} width - Rectangle's width.
2641
+ * @param {number} height - Rectangle's height.
2642
+ * @returns {DOMRectInit}
2643
+ */
2644
+ function createRectInit(x, y, width, height) {
2645
+ return { x: x, y: y, width: width, height: height };
2646
+ }
2647
+
2648
+ /**
2649
+ * Class that is responsible for computations of the content rectangle of
2650
+ * provided DOM element and for keeping track of it's changes.
2651
+ */
2652
+ var ResizeObservation = /** @class */ (function () {
2653
+ /**
2654
+ * Creates an instance of ResizeObservation.
2655
+ *
2656
+ * @param {Element} target - Element to be observed.
2657
+ */
2658
+ function ResizeObservation(target) {
2659
+ /**
2660
+ * Broadcasted width of content rectangle.
2661
+ *
2662
+ * @type {number}
2663
+ */
2664
+ this.broadcastWidth = 0;
2665
+ /**
2666
+ * Broadcasted height of content rectangle.
2667
+ *
2668
+ * @type {number}
2669
+ */
2670
+ this.broadcastHeight = 0;
2671
+ /**
2672
+ * Reference to the last observed content rectangle.
2673
+ *
2674
+ * @private {DOMRectInit}
2675
+ */
2676
+ this.contentRect_ = createRectInit(0, 0, 0, 0);
2677
+ this.target = target;
2678
+ }
2679
+ /**
2680
+ * Updates content rectangle and tells whether it's width or height properties
2681
+ * have changed since the last broadcast.
2682
+ *
2683
+ * @returns {boolean}
2684
+ */
2685
+ ResizeObservation.prototype.isActive = function () {
2686
+ var rect = getContentRect(this.target);
2687
+ this.contentRect_ = rect;
2688
+ return (rect.width !== this.broadcastWidth ||
2689
+ rect.height !== this.broadcastHeight);
2690
+ };
2691
+ /**
2692
+ * Updates 'broadcastWidth' and 'broadcastHeight' properties with a data
2693
+ * from the corresponding properties of the last observed content rectangle.
2694
+ *
2695
+ * @returns {DOMRectInit} Last observed content rectangle.
2696
+ */
2697
+ ResizeObservation.prototype.broadcastRect = function () {
2698
+ var rect = this.contentRect_;
2699
+ this.broadcastWidth = rect.width;
2700
+ this.broadcastHeight = rect.height;
2701
+ return rect;
2702
+ };
2703
+ return ResizeObservation;
2704
+ }());
2705
+
2706
+ var ResizeObserverEntry = /** @class */ (function () {
2707
+ /**
2708
+ * Creates an instance of ResizeObserverEntry.
2709
+ *
2710
+ * @param {Element} target - Element that is being observed.
2711
+ * @param {DOMRectInit} rectInit - Data of the element's content rectangle.
2712
+ */
2713
+ function ResizeObserverEntry(target, rectInit) {
2714
+ var contentRect = createReadOnlyRect(rectInit);
2715
+ // According to the specification following properties are not writable
2716
+ // and are also not enumerable in the native implementation.
2717
+ //
2718
+ // Property accessors are not being used as they'd require to define a
2719
+ // private WeakMap storage which may cause memory leaks in browsers that
2720
+ // don't support this type of collections.
2721
+ defineConfigurable(this, { target: target, contentRect: contentRect });
2722
+ }
2723
+ return ResizeObserverEntry;
2724
+ }());
2725
+
2726
+ var ResizeObserverSPI = /** @class */ (function () {
2727
+ /**
2728
+ * Creates a new instance of ResizeObserver.
2729
+ *
2730
+ * @param {ResizeObserverCallback} callback - Callback function that is invoked
2731
+ * when one of the observed elements changes it's content dimensions.
2732
+ * @param {ResizeObserverController} controller - Controller instance which
2733
+ * is responsible for the updates of observer.
2734
+ * @param {ResizeObserver} callbackCtx - Reference to the public
2735
+ * ResizeObserver instance which will be passed to callback function.
2736
+ */
2737
+ function ResizeObserverSPI(callback, controller, callbackCtx) {
2738
+ /**
2739
+ * Collection of resize observations that have detected changes in dimensions
2740
+ * of elements.
2741
+ *
2742
+ * @private {Array<ResizeObservation>}
2743
+ */
2744
+ this.activeObservations_ = [];
2745
+ /**
2746
+ * Registry of the ResizeObservation instances.
2747
+ *
2748
+ * @private {Map<Element, ResizeObservation>}
2749
+ */
2750
+ this.observations_ = new MapShim();
2751
+ if (typeof callback !== 'function') {
2752
+ throw new TypeError('The callback provided as parameter 1 is not a function.');
2753
+ }
2754
+ this.callback_ = callback;
2755
+ this.controller_ = controller;
2756
+ this.callbackCtx_ = callbackCtx;
2757
+ }
2758
+ /**
2759
+ * Starts observing provided element.
2760
+ *
2761
+ * @param {Element} target - Element to be observed.
2762
+ * @returns {void}
2763
+ */
2764
+ ResizeObserverSPI.prototype.observe = function (target) {
2765
+ if (!arguments.length) {
2766
+ throw new TypeError('1 argument required, but only 0 present.');
2767
+ }
2768
+ // Do nothing if current environment doesn't have the Element interface.
2769
+ if (typeof Element === 'undefined' || !(Element instanceof Object)) {
2770
+ return;
2771
+ }
2772
+ if (!(target instanceof getWindowOf(target).Element)) {
2773
+ throw new TypeError('parameter 1 is not of type "Element".');
2774
+ }
2775
+ var observations = this.observations_;
2776
+ // Do nothing if element is already being observed.
2777
+ if (observations.has(target)) {
2778
+ return;
2779
+ }
2780
+ observations.set(target, new ResizeObservation(target));
2781
+ this.controller_.addObserver(this);
2782
+ // Force the update of observations.
2783
+ this.controller_.refresh();
2784
+ };
2785
+ /**
2786
+ * Stops observing provided element.
2787
+ *
2788
+ * @param {Element} target - Element to stop observing.
2789
+ * @returns {void}
2790
+ */
2791
+ ResizeObserverSPI.prototype.unobserve = function (target) {
2792
+ if (!arguments.length) {
2793
+ throw new TypeError('1 argument required, but only 0 present.');
2794
+ }
2795
+ // Do nothing if current environment doesn't have the Element interface.
2796
+ if (typeof Element === 'undefined' || !(Element instanceof Object)) {
2797
+ return;
2798
+ }
2799
+ if (!(target instanceof getWindowOf(target).Element)) {
2800
+ throw new TypeError('parameter 1 is not of type "Element".');
2801
+ }
2802
+ var observations = this.observations_;
2803
+ // Do nothing if element is not being observed.
2804
+ if (!observations.has(target)) {
2805
+ return;
2806
+ }
2807
+ observations.delete(target);
2808
+ if (!observations.size) {
2809
+ this.controller_.removeObserver(this);
2810
+ }
2811
+ };
2812
+ /**
2813
+ * Stops observing all elements.
2814
+ *
2815
+ * @returns {void}
2816
+ */
2817
+ ResizeObserverSPI.prototype.disconnect = function () {
2818
+ this.clearActive();
2819
+ this.observations_.clear();
2820
+ this.controller_.removeObserver(this);
2821
+ };
2822
+ /**
2823
+ * Collects observation instances the associated element of which has changed
2824
+ * it's content rectangle.
2825
+ *
2826
+ * @returns {void}
2827
+ */
2828
+ ResizeObserverSPI.prototype.gatherActive = function () {
2829
+ var _this = this;
2830
+ this.clearActive();
2831
+ this.observations_.forEach(function (observation) {
2832
+ if (observation.isActive()) {
2833
+ _this.activeObservations_.push(observation);
2834
+ }
2835
+ });
2836
+ };
2837
+ /**
2838
+ * Invokes initial callback function with a list of ResizeObserverEntry
2839
+ * instances collected from active resize observations.
2840
+ *
2841
+ * @returns {void}
2842
+ */
2843
+ ResizeObserverSPI.prototype.broadcastActive = function () {
2844
+ // Do nothing if observer doesn't have active observations.
2845
+ if (!this.hasActive()) {
2846
+ return;
2847
+ }
2848
+ var ctx = this.callbackCtx_;
2849
+ // Create ResizeObserverEntry instance for every active observation.
2850
+ var entries = this.activeObservations_.map(function (observation) {
2851
+ return new ResizeObserverEntry(observation.target, observation.broadcastRect());
2852
+ });
2853
+ this.callback_.call(ctx, entries, ctx);
2854
+ this.clearActive();
2855
+ };
2856
+ /**
2857
+ * Clears the collection of active observations.
2858
+ *
2859
+ * @returns {void}
2860
+ */
2861
+ ResizeObserverSPI.prototype.clearActive = function () {
2862
+ this.activeObservations_.splice(0);
2863
+ };
2864
+ /**
2865
+ * Tells whether observer has active observations.
2866
+ *
2867
+ * @returns {boolean}
2868
+ */
2869
+ ResizeObserverSPI.prototype.hasActive = function () {
2870
+ return this.activeObservations_.length > 0;
2871
+ };
2872
+ return ResizeObserverSPI;
2873
+ }());
2874
+
2875
+ // Registry of internal observers. If WeakMap is not available use current shim
2876
+ // for the Map collection as it has all required methods and because WeakMap
2877
+ // can't be fully polyfilled anyway.
2878
+ var observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim();
2879
+ /**
2880
+ * ResizeObserver API. Encapsulates the ResizeObserver SPI implementation
2881
+ * exposing only those methods and properties that are defined in the spec.
2882
+ */
2883
+ var ResizeObserver$1 = /** @class */ (function () {
2884
+ /**
2885
+ * Creates a new instance of ResizeObserver.
2886
+ *
2887
+ * @param {ResizeObserverCallback} callback - Callback that is invoked when
2888
+ * dimensions of the observed elements change.
2889
+ */
2890
+ function ResizeObserver(callback) {
2891
+ if (!(this instanceof ResizeObserver)) {
2892
+ throw new TypeError('Cannot call a class as a function.');
2893
+ }
2894
+ if (!arguments.length) {
2895
+ throw new TypeError('1 argument required, but only 0 present.');
2896
+ }
2897
+ var controller = ResizeObserverController.getInstance();
2898
+ var observer = new ResizeObserverSPI(callback, controller, this);
2899
+ observers.set(this, observer);
2900
+ }
2901
+ return ResizeObserver;
2902
+ }());
2903
+ // Expose public methods of ResizeObserver.
2904
+ [
2905
+ 'observe',
2906
+ 'unobserve',
2907
+ 'disconnect'
2908
+ ].forEach(function (method) {
2909
+ ResizeObserver$1.prototype[method] = function () {
2910
+ var _a;
2911
+ return (_a = observers.get(this))[method].apply(_a, arguments);
2912
+ };
2913
+ });
2914
+
2915
+ var index = (function () {
2916
+ // Export existing implementation if available.
2917
+ if (typeof global$1.ResizeObserver !== 'undefined') {
2918
+ return global$1.ResizeObserver;
2919
+ }
2920
+ return ResizeObserver$1;
2921
+ })();
2922
+
2923
+ // =============================== Const ===============================
2924
+ var elementListeners = new Map();
2925
+ function onResize(entities) {
2926
+ entities.forEach(function (entity) {
2927
+ var _elementListeners$get;
2928
+ var target = entity.target;
2929
+ (_elementListeners$get = elementListeners.get(target)) === null || _elementListeners$get === void 0 ? void 0 : _elementListeners$get.forEach(function (listener) {
2930
+ return listener(target);
2931
+ });
2932
+ });
2933
+ }
2934
+ // Note: ResizeObserver polyfill not support option to measure border-box resize
2935
+ var resizeObserver = new index(onResize);
2936
+ // ============================== Observe ==============================
2937
+ function observe(element, callback) {
2938
+ if (!elementListeners.has(element)) {
2939
+ elementListeners.set(element, new Set());
2940
+ resizeObserver.observe(element);
2941
+ }
2942
+ elementListeners.get(element).add(callback);
2943
+ }
2944
+ function unobserve(element, callback) {
2945
+ if (elementListeners.has(element)) {
2946
+ elementListeners.get(element).delete(callback);
2947
+ if (!elementListeners.get(element).size) {
2948
+ resizeObserver.unobserve(element);
2949
+ elementListeners.delete(element);
2950
+ }
2951
+ }
2952
+ }
2953
+
2954
+ function _classCallCheck(instance, Constructor) {
2955
+ if (!(instance instanceof Constructor)) {
2956
+ throw new TypeError("Cannot call a class as a function");
2957
+ }
2958
+ }
2959
+
2960
+ function _defineProperties(target, props) {
2961
+ for (var i = 0; i < props.length; i++) {
2962
+ var descriptor = props[i];
2963
+ descriptor.enumerable = descriptor.enumerable || false;
2964
+ descriptor.configurable = true;
2965
+ if ("value" in descriptor) descriptor.writable = true;
2966
+ Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
2967
+ }
2968
+ }
2969
+ function _createClass(Constructor, protoProps, staticProps) {
2970
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
2971
+ if (staticProps) _defineProperties(Constructor, staticProps);
2972
+ Object.defineProperty(Constructor, "prototype", {
2973
+ writable: false
2974
+ });
2975
+ return Constructor;
2976
+ }
2977
+
2978
+ function _setPrototypeOf(o, p) {
2979
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
2980
+ o.__proto__ = p;
2981
+ return o;
2982
+ };
2983
+ return _setPrototypeOf(o, p);
2984
+ }
2985
+
2986
+ function _inherits(subClass, superClass) {
2987
+ if (typeof superClass !== "function" && superClass !== null) {
2988
+ throw new TypeError("Super expression must either be null or a function");
2989
+ }
2990
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
2991
+ constructor: {
2992
+ value: subClass,
2993
+ writable: true,
2994
+ configurable: true
2995
+ }
2996
+ });
2997
+ Object.defineProperty(subClass, "prototype", {
2998
+ writable: false
2999
+ });
3000
+ if (superClass) _setPrototypeOf(subClass, superClass);
3001
+ }
3002
+
3003
+ function _getPrototypeOf(o) {
3004
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
3005
+ return o.__proto__ || Object.getPrototypeOf(o);
3006
+ };
3007
+ return _getPrototypeOf(o);
3008
+ }
3009
+
3010
+ function _isNativeReflectConstruct() {
3011
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
3012
+ if (Reflect.construct.sham) return false;
3013
+ if (typeof Proxy === "function") return true;
3014
+ try {
3015
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
3016
+ return true;
3017
+ } catch (e) {
3018
+ return false;
3019
+ }
3020
+ }
3021
+
3022
+ function _assertThisInitialized(self) {
3023
+ if (self === void 0) {
3024
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
3025
+ }
3026
+ return self;
3027
+ }
3028
+
3029
+ function _possibleConstructorReturn(self, call) {
3030
+ if (call && (_typeof$1(call) === "object" || typeof call === "function")) {
3031
+ return call;
3032
+ } else if (call !== void 0) {
3033
+ throw new TypeError("Derived constructors may only return object or undefined");
3034
+ }
3035
+ return _assertThisInitialized(self);
3036
+ }
3037
+
3038
+ function _createSuper(Derived) {
3039
+ var hasNativeReflectConstruct = _isNativeReflectConstruct();
3040
+ return function _createSuperInternal() {
3041
+ var Super = _getPrototypeOf(Derived),
3042
+ result;
3043
+ if (hasNativeReflectConstruct) {
3044
+ var NewTarget = _getPrototypeOf(this).constructor;
3045
+ result = Reflect.construct(Super, arguments, NewTarget);
3046
+ } else {
3047
+ result = Super.apply(this, arguments);
3048
+ }
3049
+ return _possibleConstructorReturn(this, result);
3050
+ };
3051
+ }
3052
+
3053
+ /**
3054
+ * Fallback to findDOMNode if origin ref do not provide any dom element
3055
+ */
3056
+ var DomWrapper = /*#__PURE__*/function (_React$Component) {
3057
+ _inherits(DomWrapper, _React$Component);
3058
+ var _super = _createSuper(DomWrapper);
3059
+ function DomWrapper() {
3060
+ _classCallCheck(this, DomWrapper);
3061
+ return _super.apply(this, arguments);
3062
+ }
3063
+ _createClass(DomWrapper, [{
3064
+ key: "render",
3065
+ value: function render() {
3066
+ return this.props.children;
3067
+ }
3068
+ }]);
3069
+ return DomWrapper;
3070
+ }(index$4.react.Component);
3071
+
3072
+ var CollectionContext = /*#__PURE__*/index$4.react.createContext(null);
3073
+ /**
3074
+ * Collect all the resize event from children ResizeObserver
3075
+ */
3076
+ function Collection(_ref) {
3077
+ var children = _ref.children,
3078
+ onBatchResize = _ref.onBatchResize;
3079
+ var resizeIdRef = index$4.react.useRef(0);
3080
+ var resizeInfosRef = index$4.react.useRef([]);
3081
+ var onCollectionResize = index$4.react.useContext(CollectionContext);
3082
+ var onResize = index$4.react.useCallback(function (size, element, data) {
3083
+ resizeIdRef.current += 1;
3084
+ var currentId = resizeIdRef.current;
3085
+ resizeInfosRef.current.push({
3086
+ size: size,
3087
+ element: element,
3088
+ data: data
3089
+ });
3090
+ Promise.resolve().then(function () {
3091
+ if (currentId === resizeIdRef.current) {
3092
+ onBatchResize === null || onBatchResize === void 0 ? void 0 : onBatchResize(resizeInfosRef.current);
3093
+ resizeInfosRef.current = [];
3094
+ }
3095
+ });
3096
+ // Continue bubbling if parent exist
3097
+ onCollectionResize === null || onCollectionResize === void 0 ? void 0 : onCollectionResize(size, element, data);
3098
+ }, [onBatchResize, onCollectionResize]);
3099
+ return /*#__PURE__*/index$4.react.createElement(CollectionContext.Provider, {
3100
+ value: onResize
3101
+ }, children);
3102
+ }
3103
+
3104
+ function SingleObserver(props, ref) {
3105
+ var children = props.children,
3106
+ disabled = props.disabled;
3107
+ var elementRef = index$4.react.useRef(null);
3108
+ var wrapperRef = index$4.react.useRef(null);
3109
+ var onCollectionResize = index$4.react.useContext(CollectionContext);
3110
+ // =========================== Children ===========================
3111
+ var isRenderProps = typeof children === 'function';
3112
+ var mergedChildren = isRenderProps ? children(elementRef) : children;
3113
+ // ============================= Size =============================
3114
+ var sizeRef = index$4.react.useRef({
3115
+ width: -1,
3116
+ height: -1,
3117
+ offsetWidth: -1,
3118
+ offsetHeight: -1
3119
+ });
3120
+ // ============================= Ref ==============================
3121
+ var canRef = !isRenderProps && /*#__PURE__*/index$4.react.isValidElement(mergedChildren) && supportRef(mergedChildren);
3122
+ var originRef = canRef ? mergedChildren.ref : null;
3123
+ var mergedRef = index$4.react.useMemo(function () {
3124
+ return composeRef(originRef, elementRef);
3125
+ }, [originRef, elementRef]);
3126
+ var getDom = function getDom() {
3127
+ return findDOMNode(elementRef.current) || findDOMNode(wrapperRef.current);
3128
+ };
3129
+ index$4.react.useImperativeHandle(ref, function () {
3130
+ return getDom();
3131
+ });
3132
+ // =========================== Observe ============================
3133
+ var propsRef = index$4.react.useRef(props);
3134
+ propsRef.current = props;
3135
+ // Handler
3136
+ var onInternalResize = index$4.react.useCallback(function (target) {
3137
+ var _propsRef$current = propsRef.current,
3138
+ onResize = _propsRef$current.onResize,
3139
+ data = _propsRef$current.data;
3140
+ var _target$getBoundingCl = target.getBoundingClientRect(),
3141
+ width = _target$getBoundingCl.width,
3142
+ height = _target$getBoundingCl.height;
3143
+ var offsetWidth = target.offsetWidth,
3144
+ offsetHeight = target.offsetHeight;
3145
+ /**
3146
+ * Resize observer trigger when content size changed.
3147
+ * In most case we just care about element size,
3148
+ * let's use `boundary` instead of `contentRect` here to avoid shaking.
3149
+ */
3150
+ var fixedWidth = Math.floor(width);
3151
+ var fixedHeight = Math.floor(height);
3152
+ if (sizeRef.current.width !== fixedWidth || sizeRef.current.height !== fixedHeight || sizeRef.current.offsetWidth !== offsetWidth || sizeRef.current.offsetHeight !== offsetHeight) {
3153
+ var size = {
3154
+ width: fixedWidth,
3155
+ height: fixedHeight,
3156
+ offsetWidth: offsetWidth,
3157
+ offsetHeight: offsetHeight
3158
+ };
3159
+ sizeRef.current = size;
3160
+ // IE is strange, right?
3161
+ var mergedOffsetWidth = offsetWidth === Math.round(width) ? width : offsetWidth;
3162
+ var mergedOffsetHeight = offsetHeight === Math.round(height) ? height : offsetHeight;
3163
+ var sizeInfo = _objectSpread2(_objectSpread2({}, size), {}, {
3164
+ offsetWidth: mergedOffsetWidth,
3165
+ offsetHeight: mergedOffsetHeight
3166
+ });
3167
+ // Let collection know what happened
3168
+ onCollectionResize === null || onCollectionResize === void 0 ? void 0 : onCollectionResize(sizeInfo, target, data);
3169
+ if (onResize) {
3170
+ // defer the callback but not defer to next frame
3171
+ Promise.resolve().then(function () {
3172
+ onResize(sizeInfo, target);
3173
+ });
3174
+ }
3175
+ }
3176
+ }, []);
3177
+ // Dynamic observe
3178
+ index$4.react.useEffect(function () {
3179
+ var currentElement = getDom();
3180
+ if (currentElement && !disabled) {
3181
+ observe(currentElement, onInternalResize);
3182
+ }
3183
+ return function () {
3184
+ return unobserve(currentElement, onInternalResize);
3185
+ };
3186
+ }, [elementRef.current, disabled]);
3187
+ // ============================ Render ============================
3188
+ return /*#__PURE__*/index$4.react.createElement(DomWrapper, {
3189
+ ref: wrapperRef
3190
+ }, canRef ? /*#__PURE__*/index$4.react.cloneElement(mergedChildren, {
3191
+ ref: mergedRef
3192
+ }) : mergedChildren);
3193
+ }
3194
+ var RefSingleObserver = /*#__PURE__*/index$4.react.forwardRef(SingleObserver);
3195
+
3196
+ var INTERNAL_PREFIX_KEY = 'rc-observer-key';
3197
+ function ResizeObserver(props, ref) {
3198
+ var children = props.children;
3199
+ var childNodes = typeof children === 'function' ? [children] : toArray(children);
3200
+ return childNodes.map(function (child, index) {
3201
+ var key = (child === null || child === void 0 ? void 0 : child.key) || "".concat(INTERNAL_PREFIX_KEY, "-").concat(index);
3202
+ return /*#__PURE__*/index$4.react.createElement(RefSingleObserver, _extends({}, props, {
3203
+ key: key,
3204
+ ref: index === 0 ? ref : undefined
3205
+ }), child);
3206
+ });
3207
+ }
3208
+ var RefResizeObserver = /*#__PURE__*/index$4.react.forwardRef(ResizeObserver);
3209
+ RefResizeObserver.Collection = Collection;
3210
+
3211
+ function canUseDom() {
3212
+ return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
3213
+ }
3214
+
3215
+ /**
3216
+ * Wrap `React.useLayoutEffect` which will not throw warning message in test env
3217
+ */
3218
+ var useInternalLayoutEffect = canUseDom() ? index$4.react.useLayoutEffect : index$4.react.useEffect;
3219
+ var useLayoutEffect = function useLayoutEffect(callback, deps) {
3220
+ var firstMountRef = index$4.react.useRef(true);
3221
+ useInternalLayoutEffect(function () {
3222
+ return callback(firstMountRef.current);
3223
+ }, deps);
3224
+
3225
+ // We tell react that first mount has passed
3226
+ useInternalLayoutEffect(function () {
3227
+ firstMountRef.current = false;
3228
+ return function () {
3229
+ firstMountRef.current = true;
3230
+ };
3231
+ }, []);
3232
+ };
3233
+
3234
+ var _excluded$2 = ["prefixCls", "invalidate", "item", "renderItem", "responsive", "responsiveDisabled", "registerSize", "itemKey", "className", "style", "children", "display", "order", "component"];
3235
+ // Use shared variable to save bundle size
3236
+ var UNDEFINED = undefined;
3237
+ function InternalItem(props, ref) {
3238
+ var prefixCls = props.prefixCls,
3239
+ invalidate = props.invalidate,
3240
+ item = props.item,
3241
+ renderItem = props.renderItem,
3242
+ responsive = props.responsive,
3243
+ responsiveDisabled = props.responsiveDisabled,
3244
+ registerSize = props.registerSize,
3245
+ itemKey = props.itemKey,
3246
+ className = props.className,
3247
+ style = props.style,
3248
+ children = props.children,
3249
+ display = props.display,
3250
+ order = props.order,
3251
+ _props$component = props.component,
3252
+ Component = _props$component === void 0 ? 'div' : _props$component,
3253
+ restProps = _objectWithoutProperties(props, _excluded$2);
3254
+ var mergedHidden = responsive && !display;
3255
+ // ================================ Effect ================================
3256
+ function internalRegisterSize(width) {
3257
+ registerSize(itemKey, width);
3258
+ }
3259
+ index$4.react.useEffect(function () {
3260
+ return function () {
3261
+ internalRegisterSize(null);
3262
+ };
3263
+ }, []);
3264
+ // ================================ Render ================================
3265
+ var childNode = renderItem && item !== UNDEFINED ? renderItem(item) : children;
3266
+ var overflowStyle;
3267
+ if (!invalidate) {
3268
+ overflowStyle = {
3269
+ opacity: mergedHidden ? 0 : 1,
3270
+ height: mergedHidden ? 0 : UNDEFINED,
3271
+ overflowY: mergedHidden ? 'hidden' : UNDEFINED,
3272
+ order: responsive ? order : UNDEFINED,
3273
+ pointerEvents: mergedHidden ? 'none' : UNDEFINED,
3274
+ position: mergedHidden ? 'absolute' : UNDEFINED
3275
+ };
3276
+ }
3277
+ var overflowProps = {};
3278
+ if (mergedHidden) {
3279
+ overflowProps['aria-hidden'] = true;
3280
+ }
3281
+ var itemNode = /*#__PURE__*/index$4.react.createElement(Component, _extends$1({
3282
+ className: index$1.classnames(!invalidate && prefixCls, className),
3283
+ style: _objectSpread2$1(_objectSpread2$1({}, overflowStyle), style)
3284
+ }, overflowProps, restProps, {
3285
+ ref: ref
3286
+ }), childNode);
3287
+ if (responsive) {
3288
+ itemNode = /*#__PURE__*/index$4.react.createElement(RefResizeObserver, {
3289
+ onResize: function onResize(_ref) {
3290
+ var offsetWidth = _ref.offsetWidth;
3291
+ internalRegisterSize(offsetWidth);
3292
+ },
3293
+ disabled: responsiveDisabled
3294
+ }, itemNode);
3295
+ }
3296
+ return itemNode;
3297
+ }
3298
+ var Item = /*#__PURE__*/index$4.react.forwardRef(InternalItem);
3299
+ Item.displayName = 'Item';
3300
+
3301
+ function useEvent(callback) {
3302
+ var fnRef = index$4.react.useRef();
3303
+ fnRef.current = callback;
3304
+ var memoFn = index$4.react.useCallback(function () {
3305
+ var _fnRef$current;
3306
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3307
+ args[_key] = arguments[_key];
3308
+ }
3309
+ return (_fnRef$current = fnRef.current) === null || _fnRef$current === void 0 ? void 0 : _fnRef$current.call.apply(_fnRef$current, [fnRef].concat(args));
3310
+ }, []);
3311
+ return memoFn;
3312
+ }
3313
+
3314
+ var raf = function raf(callback) {
3315
+ return +setTimeout(callback, 16);
3316
+ };
3317
+ var caf = function caf(num) {
3318
+ return clearTimeout(num);
3319
+ };
3320
+ if (typeof window !== 'undefined' && 'requestAnimationFrame' in window) {
3321
+ raf = function raf(callback) {
3322
+ return window.requestAnimationFrame(callback);
3323
+ };
3324
+ caf = function caf(handle) {
3325
+ return window.cancelAnimationFrame(handle);
3326
+ };
3327
+ }
3328
+ var rafUUID = 0;
3329
+ var rafIds = new Map();
3330
+ function cleanup(id) {
3331
+ rafIds.delete(id);
3332
+ }
3333
+ var wrapperRaf = function wrapperRaf(callback) {
3334
+ var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
3335
+ rafUUID += 1;
3336
+ var id = rafUUID;
3337
+ function callRef(leftTimes) {
3338
+ if (leftTimes === 0) {
3339
+ // Clean up
3340
+ cleanup(id);
3341
+
3342
+ // Trigger
3343
+ callback();
3344
+ } else {
3345
+ // Next raf
3346
+ var realId = raf(function () {
3347
+ callRef(leftTimes - 1);
3348
+ });
3349
+
3350
+ // Bind real raf id
3351
+ rafIds.set(id, realId);
3352
+ }
3353
+ }
3354
+ callRef(times);
3355
+ return id;
3356
+ };
3357
+ wrapperRaf.cancel = function (id) {
3358
+ var realId = rafIds.get(id);
3359
+ cleanup(realId);
3360
+ return caf(realId);
3361
+ };
3362
+
3363
+ function channelUpdate(callback) {
3364
+ if (typeof MessageChannel === 'undefined') {
3365
+ wrapperRaf(callback);
3366
+ } else {
3367
+ var channel = new MessageChannel();
3368
+ channel.port1.onmessage = function () {
3369
+ return callback();
3370
+ };
3371
+ channel.port2.postMessage(undefined);
3372
+ }
3373
+ }
3374
+
3375
+ /**
3376
+ * Batcher for record any `useEffectState` need update.
3377
+ */
3378
+ function useBatcher() {
3379
+ // Updater Trigger
3380
+ var updateFuncRef = index$4.react.useRef(null);
3381
+ // Notify update
3382
+ var notifyEffectUpdate = function notifyEffectUpdate(callback) {
3383
+ if (!updateFuncRef.current) {
3384
+ updateFuncRef.current = [];
3385
+ channelUpdate(function () {
3386
+ index$4.reactDom.unstable_batchedUpdates(function () {
3387
+ updateFuncRef.current.forEach(function (fn) {
3388
+ fn();
3389
+ });
3390
+ updateFuncRef.current = null;
3391
+ });
3392
+ });
3393
+ }
3394
+ updateFuncRef.current.push(callback);
3395
+ };
3396
+ return notifyEffectUpdate;
3397
+ }
3398
+ /**
3399
+ * Trigger state update by `useLayoutEffect` to save perf.
3400
+ */
3401
+ function useEffectState(notifyEffectUpdate, defaultValue) {
3402
+ // Value
3403
+ var _React$useState = index$4.react.useState(defaultValue),
3404
+ _React$useState2 = _slicedToArray(_React$useState, 2),
3405
+ stateValue = _React$useState2[0],
3406
+ setStateValue = _React$useState2[1];
3407
+ // Set State
3408
+ var setEffectVal = useEvent(function (nextValue) {
3409
+ notifyEffectUpdate(function () {
3410
+ setStateValue(nextValue);
3411
+ });
3412
+ });
3413
+ return [stateValue, setEffectVal];
3414
+ }
3415
+
3416
+ var OverflowContext = /*#__PURE__*/index$4.react.createContext(null);
3417
+
3418
+ var _excluded$1 = ["component"],
3419
+ _excluded2 = ["className"],
3420
+ _excluded3 = ["className"];
3421
+ var InternalRawItem = function InternalRawItem(props, ref) {
3422
+ var context = index$4.react.useContext(OverflowContext);
3423
+ // Render directly when context not provided
3424
+ if (!context) {
3425
+ var _props$component = props.component,
3426
+ Component = _props$component === void 0 ? 'div' : _props$component,
3427
+ _restProps = _objectWithoutProperties(props, _excluded$1);
3428
+ return /*#__PURE__*/index$4.react.createElement(Component, _extends$1({}, _restProps, {
3429
+ ref: ref
3430
+ }));
3431
+ }
3432
+ var contextClassName = context.className,
3433
+ restContext = _objectWithoutProperties(context, _excluded2);
3434
+ var className = props.className,
3435
+ restProps = _objectWithoutProperties(props, _excluded3);
3436
+ // Do not pass context to sub item to avoid multiple measure
3437
+ return /*#__PURE__*/index$4.react.createElement(OverflowContext.Provider, {
3438
+ value: null
3439
+ }, /*#__PURE__*/index$4.react.createElement(Item, _extends$1({
3440
+ ref: ref,
3441
+ className: index$1.classnames(contextClassName, className)
3442
+ }, restContext, restProps)));
3443
+ };
3444
+ var RawItem = /*#__PURE__*/index$4.react.forwardRef(InternalRawItem);
3445
+ RawItem.displayName = 'RawItem';
3446
+
3447
+ var _excluded = ["prefixCls", "data", "renderItem", "renderRawItem", "itemKey", "itemWidth", "ssr", "style", "className", "maxCount", "renderRest", "renderRawRest", "suffix", "component", "itemComponent", "onVisibleChange"];
3448
+ var RESPONSIVE = 'responsive';
3449
+ var INVALIDATE = 'invalidate';
3450
+ function defaultRenderRest(omittedItems) {
3451
+ return "+ ".concat(omittedItems.length, " ...");
3452
+ }
3453
+ function Overflow(props, ref) {
3454
+ var _props$prefixCls = props.prefixCls,
3455
+ prefixCls = _props$prefixCls === void 0 ? 'rc-overflow' : _props$prefixCls,
3456
+ _props$data = props.data,
3457
+ data = _props$data === void 0 ? [] : _props$data,
3458
+ renderItem = props.renderItem,
3459
+ renderRawItem = props.renderRawItem,
3460
+ itemKey = props.itemKey,
3461
+ _props$itemWidth = props.itemWidth,
3462
+ itemWidth = _props$itemWidth === void 0 ? 10 : _props$itemWidth,
3463
+ ssr = props.ssr,
3464
+ style = props.style,
3465
+ className = props.className,
3466
+ maxCount = props.maxCount,
3467
+ renderRest = props.renderRest,
3468
+ renderRawRest = props.renderRawRest,
3469
+ suffix = props.suffix,
3470
+ _props$component = props.component,
3471
+ Component = _props$component === void 0 ? 'div' : _props$component,
3472
+ itemComponent = props.itemComponent,
3473
+ onVisibleChange = props.onVisibleChange,
3474
+ restProps = _objectWithoutProperties(props, _excluded);
3475
+ var fullySSR = ssr === 'full';
3476
+ var notifyEffectUpdate = useBatcher();
3477
+ var _useEffectState = useEffectState(notifyEffectUpdate, null),
3478
+ _useEffectState2 = _slicedToArray(_useEffectState, 2),
3479
+ containerWidth = _useEffectState2[0],
3480
+ setContainerWidth = _useEffectState2[1];
3481
+ var mergedContainerWidth = containerWidth || 0;
3482
+ var _useEffectState3 = useEffectState(notifyEffectUpdate, new Map()),
3483
+ _useEffectState4 = _slicedToArray(_useEffectState3, 2),
3484
+ itemWidths = _useEffectState4[0],
3485
+ setItemWidths = _useEffectState4[1];
3486
+ var _useEffectState5 = useEffectState(notifyEffectUpdate, 0),
3487
+ _useEffectState6 = _slicedToArray(_useEffectState5, 2),
3488
+ prevRestWidth = _useEffectState6[0],
3489
+ setPrevRestWidth = _useEffectState6[1];
3490
+ var _useEffectState7 = useEffectState(notifyEffectUpdate, 0),
3491
+ _useEffectState8 = _slicedToArray(_useEffectState7, 2),
3492
+ restWidth = _useEffectState8[0],
3493
+ setRestWidth = _useEffectState8[1];
3494
+ var _useEffectState9 = useEffectState(notifyEffectUpdate, 0),
3495
+ _useEffectState10 = _slicedToArray(_useEffectState9, 2),
3496
+ suffixWidth = _useEffectState10[0],
3497
+ setSuffixWidth = _useEffectState10[1];
3498
+ var _useState = index$4.react.useState(null),
3499
+ _useState2 = _slicedToArray(_useState, 2),
3500
+ suffixFixedStart = _useState2[0],
3501
+ setSuffixFixedStart = _useState2[1];
3502
+ var _useState3 = index$4.react.useState(null),
3503
+ _useState4 = _slicedToArray(_useState3, 2),
3504
+ displayCount = _useState4[0],
3505
+ setDisplayCount = _useState4[1];
3506
+ var mergedDisplayCount = index$4.react.useMemo(function () {
3507
+ if (displayCount === null && fullySSR) {
3508
+ return Number.MAX_SAFE_INTEGER;
3509
+ }
3510
+ return displayCount || 0;
3511
+ }, [displayCount, containerWidth]);
3512
+ var _useState5 = index$4.react.useState(false),
3513
+ _useState6 = _slicedToArray(_useState5, 2),
3514
+ restReady = _useState6[0],
3515
+ setRestReady = _useState6[1];
3516
+ var itemPrefixCls = "".concat(prefixCls, "-item");
3517
+ // Always use the max width to avoid blink
3518
+ var mergedRestWidth = Math.max(prevRestWidth, restWidth);
3519
+ // ================================= Data =================================
3520
+ var isResponsive = maxCount === RESPONSIVE;
3521
+ var shouldResponsive = data.length && isResponsive;
3522
+ var invalidate = maxCount === INVALIDATE;
3523
+ /**
3524
+ * When is `responsive`, we will always render rest node to get the real width of it for calculation
3525
+ */
3526
+ var showRest = shouldResponsive || typeof maxCount === 'number' && data.length > maxCount;
3527
+ var mergedData = index$4.react.useMemo(function () {
3528
+ var items = data;
3529
+ if (shouldResponsive) {
3530
+ if (containerWidth === null && fullySSR) {
3531
+ items = data;
3532
+ } else {
3533
+ items = data.slice(0, Math.min(data.length, mergedContainerWidth / itemWidth));
3534
+ }
3535
+ } else if (typeof maxCount === 'number') {
3536
+ items = data.slice(0, maxCount);
3537
+ }
3538
+ return items;
3539
+ }, [data, itemWidth, containerWidth, maxCount, shouldResponsive]);
3540
+ var omittedItems = index$4.react.useMemo(function () {
3541
+ if (shouldResponsive) {
3542
+ return data.slice(mergedDisplayCount + 1);
3543
+ }
3544
+ return data.slice(mergedData.length);
3545
+ }, [data, mergedData, shouldResponsive, mergedDisplayCount]);
3546
+ // ================================= Item =================================
3547
+ var getKey = index$4.react.useCallback(function (item, index) {
3548
+ var _ref;
3549
+ if (typeof itemKey === 'function') {
3550
+ return itemKey(item);
3551
+ }
3552
+ return (_ref = itemKey && (item === null || item === void 0 ? void 0 : item[itemKey])) !== null && _ref !== void 0 ? _ref : index;
3553
+ }, [itemKey]);
3554
+ var mergedRenderItem = index$4.react.useCallback(renderItem || function (item) {
3555
+ return item;
3556
+ }, [renderItem]);
3557
+ function updateDisplayCount(count, suffixFixedStartVal, notReady) {
3558
+ // React 18 will sync render even when the value is same in some case.
3559
+ // We take `mergedData` as deps which may cause dead loop if it's dynamic generate.
3560
+ // ref: https://github.com/ant-design/ant-design/issues/36559
3561
+ if (displayCount === count && (suffixFixedStartVal === undefined || suffixFixedStartVal === suffixFixedStart)) {
3562
+ return;
3563
+ }
3564
+ setDisplayCount(count);
3565
+ if (!notReady) {
3566
+ setRestReady(count < data.length - 1);
3567
+ onVisibleChange === null || onVisibleChange === void 0 ? void 0 : onVisibleChange(count);
3568
+ }
3569
+ if (suffixFixedStartVal !== undefined) {
3570
+ setSuffixFixedStart(suffixFixedStartVal);
3571
+ }
3572
+ }
3573
+ // ================================= Size =================================
3574
+ function onOverflowResize(_, element) {
3575
+ setContainerWidth(element.clientWidth);
3576
+ }
3577
+ function registerSize(key, width) {
3578
+ setItemWidths(function (origin) {
3579
+ var clone = new Map(origin);
3580
+ if (width === null) {
3581
+ clone.delete(key);
3582
+ } else {
3583
+ clone.set(key, width);
3584
+ }
3585
+ return clone;
3586
+ });
3587
+ }
3588
+ function registerOverflowSize(_, width) {
3589
+ setRestWidth(width);
3590
+ setPrevRestWidth(restWidth);
3591
+ }
3592
+ function registerSuffixSize(_, width) {
3593
+ setSuffixWidth(width);
3594
+ }
3595
+ // ================================ Effect ================================
3596
+ function getItemWidth(index) {
3597
+ return itemWidths.get(getKey(mergedData[index], index));
3598
+ }
3599
+ useLayoutEffect(function () {
3600
+ if (mergedContainerWidth && typeof mergedRestWidth === 'number' && mergedData) {
3601
+ var totalWidth = suffixWidth;
3602
+ var len = mergedData.length;
3603
+ var lastIndex = len - 1;
3604
+ // When data count change to 0, reset this since not loop will reach
3605
+ if (!len) {
3606
+ updateDisplayCount(0, null);
3607
+ return;
3608
+ }
3609
+ for (var i = 0; i < len; i += 1) {
3610
+ var currentItemWidth = getItemWidth(i);
3611
+ // Fully will always render
3612
+ if (fullySSR) {
3613
+ currentItemWidth = currentItemWidth || 0;
3614
+ }
3615
+ // Break since data not ready
3616
+ if (currentItemWidth === undefined) {
3617
+ updateDisplayCount(i - 1, undefined, true);
3618
+ break;
3619
+ }
3620
+ // Find best match
3621
+ totalWidth += currentItemWidth;
3622
+ if (
3623
+ // Only one means `totalWidth` is the final width
3624
+ lastIndex === 0 && totalWidth <= mergedContainerWidth ||
3625
+ // Last two width will be the final width
3626
+ i === lastIndex - 1 && totalWidth + getItemWidth(lastIndex) <= mergedContainerWidth) {
3627
+ // Additional check if match the end
3628
+ updateDisplayCount(lastIndex, null);
3629
+ break;
3630
+ } else if (totalWidth + mergedRestWidth > mergedContainerWidth) {
3631
+ // Can not hold all the content to show rest
3632
+ updateDisplayCount(i - 1, totalWidth - currentItemWidth - suffixWidth + restWidth);
3633
+ break;
3634
+ }
3635
+ }
3636
+ if (suffix && getItemWidth(0) + suffixWidth > mergedContainerWidth) {
3637
+ setSuffixFixedStart(null);
3638
+ }
3639
+ }
3640
+ }, [mergedContainerWidth, itemWidths, restWidth, suffixWidth, getKey, mergedData]);
3641
+ // ================================ Render ================================
3642
+ var displayRest = restReady && !!omittedItems.length;
3643
+ var suffixStyle = {};
3644
+ if (suffixFixedStart !== null && shouldResponsive) {
3645
+ suffixStyle = {
3646
+ position: 'absolute',
3647
+ left: suffixFixedStart,
3648
+ top: 0
3649
+ };
3650
+ }
3651
+ var itemSharedProps = {
3652
+ prefixCls: itemPrefixCls,
3653
+ responsive: shouldResponsive,
3654
+ component: itemComponent,
3655
+ invalidate: invalidate
3656
+ };
3657
+ // >>>>> Choice render fun by `renderRawItem`
3658
+ var internalRenderItemNode = renderRawItem ? function (item, index) {
3659
+ var key = getKey(item, index);
3660
+ return /*#__PURE__*/index$4.react.createElement(OverflowContext.Provider, {
3661
+ key: key,
3662
+ value: _objectSpread2$1(_objectSpread2$1({}, itemSharedProps), {}, {
3663
+ order: index,
3664
+ item: item,
3665
+ itemKey: key,
3666
+ registerSize: registerSize,
3667
+ display: index <= mergedDisplayCount
3668
+ })
3669
+ }, renderRawItem(item, index));
3670
+ } : function (item, index) {
3671
+ var key = getKey(item, index);
3672
+ return /*#__PURE__*/index$4.react.createElement(Item, _extends$1({}, itemSharedProps, {
3673
+ order: index,
3674
+ key: key,
3675
+ item: item,
3676
+ renderItem: mergedRenderItem,
3677
+ itemKey: key,
3678
+ registerSize: registerSize,
3679
+ display: index <= mergedDisplayCount
3680
+ }));
3681
+ };
3682
+ // >>>>> Rest node
3683
+ var restNode;
3684
+ var restContextProps = {
3685
+ order: displayRest ? mergedDisplayCount : Number.MAX_SAFE_INTEGER,
3686
+ className: "".concat(itemPrefixCls, "-rest"),
3687
+ registerSize: registerOverflowSize,
3688
+ display: displayRest
3689
+ };
3690
+ if (!renderRawRest) {
3691
+ var mergedRenderRest = renderRest || defaultRenderRest;
3692
+ restNode = /*#__PURE__*/index$4.react.createElement(Item, _extends$1({}, itemSharedProps, restContextProps), typeof mergedRenderRest === 'function' ? mergedRenderRest(omittedItems) : mergedRenderRest);
3693
+ } else if (renderRawRest) {
3694
+ restNode = /*#__PURE__*/index$4.react.createElement(OverflowContext.Provider, {
3695
+ value: _objectSpread2$1(_objectSpread2$1({}, itemSharedProps), restContextProps)
3696
+ }, renderRawRest(omittedItems));
3697
+ }
3698
+ var overflowNode = /*#__PURE__*/index$4.react.createElement(Component, _extends$1({
3699
+ className: index$1.classnames(!invalidate && prefixCls, className),
3700
+ style: style,
3701
+ ref: ref
3702
+ }, restProps), mergedData.map(internalRenderItemNode), showRest ? restNode : null, suffix && /*#__PURE__*/index$4.react.createElement(Item, _extends$1({}, itemSharedProps, {
3703
+ responsive: isResponsive,
3704
+ responsiveDisabled: !shouldResponsive,
3705
+ order: mergedDisplayCount,
3706
+ className: "".concat(itemPrefixCls, "-suffix"),
3707
+ registerSize: registerSuffixSize,
3708
+ display: true,
3709
+ style: suffixStyle
3710
+ }), suffix));
3711
+ if (isResponsive) {
3712
+ overflowNode = /*#__PURE__*/index$4.react.createElement(RefResizeObserver, {
3713
+ onResize: onOverflowResize,
3714
+ disabled: !shouldResponsive
3715
+ }, overflowNode);
3716
+ }
3717
+ return overflowNode;
3718
+ }
3719
+ var ForwardOverflow = /*#__PURE__*/index$4.react.forwardRef(Overflow);
3720
+ ForwardOverflow.displayName = 'Overflow';
3721
+ ForwardOverflow.Item = RawItem;
3722
+ ForwardOverflow.RESPONSIVE = RESPONSIVE;
3723
+ ForwardOverflow.INVALIDATE = INVALIDATE;
3724
+
3725
+ const rcOverflowCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}.rc-overflow{display:flex;flex-direction:row;flex-wrap:nowrap;width:100%}.rc-overflow-item{transition:all 0.3s ease;padding:0 2px;display:flex;align-items:center;justify-content:center}";
3726
+
3727
+ const BcmRcOverflow = class {
3728
+ constructor(hostRef) {
3729
+ index$2.registerInstance(this, hostRef);
3730
+ this.selectOtherTag = index$2.createEvent(this, "bcm-select-other-tag", 7);
3731
+ this.selectTag = index$2.createEvent(this, "bcm-select-tag", 7);
3732
+ this.deleteTag = index$2.createEvent(this, "bcm-delete-tag", 7);
3733
+ this.renderItem = item => {
3734
+ return index$4.react.createElement("bcm-tooltip", {
3735
+ placement: "bottom",
3736
+ message: item.text,
3737
+ trigger: "hover",
3738
+ }, index$4.react.createElement("div", {
3739
+ id: item.value + "-tag",
3740
+ className: "bcm-tag",
3741
+ onClick: ({ target }) => this.onClickControl(target, item, false),
3742
+ }, index$4.react.createElement("span", { className: "bcm-tag__content dismissable" },
3743
+ // .bcm-tag__content span {
3744
+ // display: block;
3745
+ // max-width: 38px;
3746
+ // white-space: nowrap;
3747
+ // overflow: hidden;
3748
+ // text-overflow: ellipsis;
3749
+ index$4.react.createElement("div", { className: "value tw-block tw-max-w-[38px] tw-overflow-hidden tw-overflow-ellipsis tw-whitespace-nowrap" }, item.text), index$4.react.createElement("span", {
3750
+ className: "right close-button",
3751
+ }, index$4.react.createElement("bcm-icon", {
3752
+ icon: "fa fa-times",
3753
+ })))));
3754
+ };
3755
+ this.renderRest = items => {
3756
+ const titles = (items === null || items === void 0 ? void 0 : items.sort((a, b) => +a.ct - +b.ct).slice(0, 15).map(item => stringHelper.StringHelper.textLimitter(item.text, 40, true)).toString().split(",").join("\r\n")) + (items.length > 15 ? "\r\n..." : "");
3757
+ return index$4.react.createElement("bcm-tooltip", {
3758
+ placement: "bottom",
3759
+ message: titles,
3760
+ trigger: "hover",
3761
+ }, index$4.react.createElement("div", {
3762
+ className: "bcm-tag bcm-tag--other",
3763
+ onClick: ({ target }) => this.onClickControl(target, items, true),
3764
+ }, index$4.react.createElement("span", { className: `bcm-tag__content dismissable ${this.checked ? "checkable checked" : ""}` }, index$4.react.createElement("span", { className: "value" }, `+${items === null || items === void 0 ? void 0 : items.length}`), index$4.react.createElement("span", { className: "right close-button" }, index$4.react.createElement("bcm-icon", {
3765
+ icon: "fa fa-times",
3766
+ })))));
3767
+ };
3768
+ this._id = generate.Generate.UID();
3769
+ this.maxCount = 1;
3770
+ this.data = [];
3771
+ this.checked = false;
3772
+ }
3773
+ isClickDismiss(e) {
3774
+ return e["s-hn"] === "BCM-ICON";
3775
+ }
3776
+ onClickControl(e, item, isOtherTag = false) {
3777
+ const isClickClose = this.isClickDismiss(e);
3778
+ isClickClose && this.deleteTag.emit({ id: Array.isArray(item) ? item.map(i => i.value) : item.value }) && this.checked && (this.checked = false);
3779
+ !isOtherTag && this.selectTag.emit({ id: item.value }) && this.checked && (this.checked = false);
3780
+ if (isOtherTag && !isClickClose) {
3781
+ this.checked = !this.checked;
3782
+ this.selectOtherTag.emit({ id: item === null || item === void 0 ? void 0 : item.map(i => i.value), checked: this.checked });
3783
+ }
3784
+ }
3785
+ componentWillRender() {
3786
+ const { data, renderItem, renderRest, maxCount } = this;
3787
+ this.overflowInstance = index$4.react.createElement(ForwardOverflow, {
3788
+ data,
3789
+ renderItem,
3790
+ renderRest,
3791
+ maxCount,
3792
+ });
3793
+ index$4.reactDom.render(this.overflowInstance, this.el);
3794
+ }
3795
+ get el() { return index$2.getElement(this); }
3796
+ };
3797
+ BcmRcOverflow.style = rcOverflowCss;
3798
+
3799
+ const { state } = index$3.createStore({
3800
+ value: new Map(),
3801
+ });
3802
+ const setValue = val => {
3803
+ const { id, dataSource } = val;
3804
+ const data = {
3805
+ id: generate.snq(() => id, generate.Generate.UID),
3806
+ dataSource: dataSource && dataSource.length > 0 && recursive(dataSource),
3807
+ searchIsOnlyChilds: val.searchIsOnlyChilds,
3808
+ };
3809
+ state.value.set(data.id, data);
3810
+ };
3811
+ const recursive = (data, parentId) => {
3812
+ let recData = [];
3813
+ if (data) {
3814
+ recData = data.map(item => (Object.assign(Object.assign(Object.assign({}, item), { parentId: generate.snq(() => parentId, null) }), (item.items && item.items.length > 0 && { items: generate.snq(() => recursive(item.items, item.id), []) }))));
3815
+ }
3816
+ return recData;
3817
+ };
3818
+ const removeValue = _id => {
3819
+ state.value.delete(_id);
3820
+ };
3821
+ const getValue = id => generate.snq(() => state.value.get(id), {});
3822
+ const getDataPagination = (id, limit = 3) => {
3823
+ let data = [];
3824
+ const value = getValue(id);
3825
+ if (value) {
3826
+ const { dataSource } = value;
3827
+ data = dataSource.slice(0, limit);
3828
+ }
3829
+ return data;
3830
+ };
3831
+ // //search treeview data by text
3832
+ // const searchData = (id, search, items?) => {
3833
+ // let dataSource
3834
+ // if (items && items.length > 0) {
3835
+ // dataSource = items
3836
+ // } else {
3837
+ // const value = getValue(id);
3838
+ // dataSource = value.dataSource;
3839
+ // }
3840
+ // let result = []
3841
+ // if (dataSource) {
3842
+ // dataSource.forEach(child => {
3843
+ // if (child.text.toLowerCase().includes(search.toLowerCase())) {
3844
+ // result.push(child)
3845
+ // }
3846
+ // result = result.concat(searchData(id, search, child.items))
3847
+ // })
3848
+ // };
3849
+ // return result
3850
+ // };
3851
+ //nested search
3852
+ const searchData = (id, searchText, items) => {
3853
+ let dataSource;
3854
+ if (items && items.length > 0) {
3855
+ dataSource = items;
3856
+ }
3857
+ else {
3858
+ const value = getValue(id);
3859
+ dataSource = value.dataSource;
3860
+ }
3861
+ let results = [];
3862
+ if (dataSource) {
3863
+ results.push(nestedSearch(id, dataSource, searchText));
3864
+ //return with their parents
3865
+ // dataSource.forEach(child => {
3866
+ // if (child.text.toLowerCase().includes(searchText.toLowerCase())) {
3867
+ // results.push(child)
3868
+ // } else if (child.items && child.items.length > 0) {
3869
+ // child.items = nestedSearch(child.items, searchText)
3870
+ // if (child.items.length > 0) {
3871
+ // results.push(child)
3872
+ // }
3873
+ // }
3874
+ // })
3875
+ }
3876
+ return {
3877
+ result: generate.snq(() => generate.Generate.flatArray(results[0].result), []),
3878
+ matching: generate.snq(() => results[0].matching, []),
3879
+ parentIndex: generate.snq(() => results[0].parentIndex, []),
3880
+ nestedResult: generate.snq(() => results[0].nestedResult, []),
3881
+ };
3882
+ };
3883
+ const nestedSearch = (id, items, searchText) => {
3884
+ let matching = [];
3885
+ let parentIndex = [];
3886
+ let result = [];
3887
+ let nestedResult = [];
3888
+ const { searchIsOnlyChilds } = getValue(id);
3889
+ if (items && items.length > 0) {
3890
+ items.forEach(child => {
3891
+ let isChild = searchIsOnlyChilds && child.parentId !== null;
3892
+ let isMatching = stringHelper.StringHelper.slugify(child.text).indexOf(stringHelper.StringHelper.slugify(searchText)) > -1 ||
3893
+ (child.keywords && stringHelper.StringHelper.slugify(child.keywords).indexOf(stringHelper.StringHelper.slugify(searchText)) > -1);
3894
+ if (isMatching && (!searchIsOnlyChilds || (searchIsOnlyChilds && isChild))) {
3895
+ result.push(child.id);
3896
+ matching.push(child.id);
3897
+ parentIndex.push(child.id);
3898
+ nestedResult.push({ id: child.id, text: child.text, parentId: child.parentId });
3899
+ if (child.items && child.items.length > 0) {
3900
+ const found = nestedSearch(id, child.items, searchText);
3901
+ if (found.matching.length > 0) {
3902
+ found.matching.forEach(chi => {
3903
+ matching.push(chi);
3904
+ });
3905
+ }
3906
+ }
3907
+ }
3908
+ else if (child.items && child.items.length > 0) {
3909
+ const found = nestedSearch(id, child.items, searchText);
3910
+ if (found.result.length > 0) {
3911
+ found.result.forEach(chi => {
3912
+ result.push(chi);
3913
+ });
3914
+ result.push(child.id);
3915
+ parentIndex.push(child.id);
3916
+ nestedResult.push({ id: child.id, text: child.text, parentId: child.parentId, items: found.nestedResult });
3917
+ }
3918
+ if (found.matching.length > 0) {
3919
+ matching.push(...found.matching);
3920
+ }
3921
+ }
3922
+ });
3923
+ }
3924
+ return { result, matching, parentIndex, nestedResult };
3925
+ };
3926
+ const searchState = {
3927
+ setValue,
3928
+ removeValue,
3929
+ getValue,
3930
+ getDataPagination,
3931
+ searchData,
3932
+ };
3933
+
3934
+ const searchCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");@import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap\"); @import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap\"); @import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap\"); .size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}*{box-sizing:border-box}.bcm-caption-area{font-family:\"Inter\", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;font-size:12px;line-height:calc(12px + 8px);color:var(--bcm-new-ds-color-slate-400);display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between;flex-wrap:nowrap;margin-top:2px}.bcm-caption-area__text{color:var(--bcm-new-ds-color-slate-400)}.bcm-caption-area__text.default{color:var(--bcm-new-ds-color-slate-400)}.bcm-caption-area__text.info{color:var(--bcm-new-ds-color-blue-500)}.bcm-caption-area__text.success{color:var(--bcm-new-ds-color-emerald-500)}.bcm-caption-area__text.warning{color:var(--bcm-new-ds-color-amber-500)}.bcm-caption-area__text.error{color:var(--bcm-new-ds-color-red-500)}.bcm-caption-area__size-small{font-size:10px;line-height:calc(10px + 8px);min-height:calc(10px + 8px)}.bcm-caption-area__size-medium{font-size:12px;line-height:calc(12px + 8px);min-height:calc(12px + 8px)}.bcm-caption-area__size-large{font-size:14px;line-height:calc(14px + 8px);min-height:calc(14px + 8px)}*{box-sizing:border-box}.bcm-label{display:inline-flex;align-items:flex-start;grid-gap:2px}.bcm-label__text{margin-bottom:2px;font-family:\"Inter\", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;display:inline-block;color:var(--bcm-new-ds-color-slate-600)}.bcm-label__size-small{font-size:10px;line-height:calc(10px + 8px);min-height:calc(10px + 8px)}.bcm-label__size-medium{font-size:12px;line-height:calc(12px + 8px);min-height:calc(12px + 8px)}.bcm-label__size-large{font-size:14px;line-height:calc(14px + 8px);min-height:calc(14px + 8px)}.bcm-input[no-margin]{margin:0}.bcm-textarea[no-margin]{margin:0}.bcm-switch[no-margin]{margin:0}.bcm-checkbox[no-margin]{margin:0}.bcm-radio-group[no-margin]{margin:0}.bcm-checkbox-group[no-margin]{margin:0}.bcm-range[no-margin]{margin:0}.bcm-form[no-margin]{margin:0}.bcm-form-group[no-margin]{margin:0}.bcm-list[no-margin]{margin:0}.bcm-colorpicker[no-margin]{margin:0}.bcm-date-picker[no-margin]{margin:0}.bcm-time-picker[no-margin]{margin:0}.bcm-datetime-picker[no-margin]{margin:0}.bcm-select[no-margin]{margin:0}.bcm-listbox[no-margin]{margin:0}*{box-sizing:border-box}.bcm-input{display:inline-flex;flex-direction:column;width:100%;max-width:256px;margin-bottom:8px}.bcm-input.full-width{max-width:100%}.bcm-input.hidden{display:none}.bcm-input__container{font-family:\"Inter\", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;display:flex;align-items:stretch;flex-direction:row;background-color:var(--bcm-new-ds-color-white);border:1px solid var(--bcm-new-ds-color-slate-300);border-radius:4px;box-sizing:border-box;cursor:text;padding:0 0 0 4px;position:relative;width:100%}.bcm-input__container.disabled{background-color:var(--bcm-new-ds-color-slate-50);cursor:not-allowed}.bcm-input__container.disabled .bcm-input-element{color:var(--bcm-new-ds-color-slate-500)}.bcm-input__container.readonly{background-color:var(--bcm-new-ds-color-slate-50);cursor:default}.bcm-input__container.readonly .bcm-input-element{color:var(--bcm-new-ds-color-slate-600)}.bcm-input__container:not(.disabled):hover .caret-container,.bcm-input__container:not(.disabled).focused .caret-container{opacity:1}.bcm-input__container:not(.disabled):hover .input-clear-button,.bcm-input__container:not(.disabled).focused .input-clear-button{opacity:1}.bcm-input__container:not(.disabled).focused{background-color:var(--bcm-new-ds-color-slate-50)}.bcm-input__container:not(.disabled):hover{border-color:var(--bcm-color-prime-blue-6)}.bcm-input__container.empty .input-clear-button{display:none}.bcm-input__container.invalid,.bcm-input__container.error{border-color:var(--bcm-new-ds-color-red-500)}.bcm-input__container .bcm-input-element{width:100%;color:var(--bcm-new-ds-color-slate-600);flex:1;border:none;background:transparent;box-shadow:unset;padding:0 4px;font-family:\"Inter\", sans-serif;cursor:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;overflow:hidden;text-overflow:ellipsis}.bcm-input__container .bcm-input-element::placeholder{font-family:\"Inter\", sans-serif;color:var(--bcm-new-ds-color-slate-300);user-select:none}.bcm-input__container .bcm-input-element::-webkit-search-decoration,.bcm-input__container .bcm-input-element::-webkit-search-cancel-button,.bcm-input__container .bcm-input-element::-webkit-search-results-button,.bcm-input__container .bcm-input-element::-webkit-search-results-decoration,.bcm-input__container .bcm-input-element::-webkit-calendar-picker-indicator,.bcm-input__container .bcm-input-element::-webkit-inner-spin-button,.bcm-input__container .bcm-input-element::-webkit-outer-spin-button{-webkit-appearance:none}.bcm-input__container .caret-container{width:30px;display:flex;flex-direction:column;justify-content:center;align-items:stretch;border-left:1px solid #D9D9D9;transition:0.2s opacity;user-select:none;box-sizing:border-box}.bcm-input__container .caret-container .bcm-input-caret{display:flex;align-items:center;justify-content:center;color:var(--bcm-color-grey-7);cursor:pointer;flex:1}.bcm-input__container .caret-container .bcm-input-caret bcm-icon{line-height:1}.bcm-input__container .caret-container .bcm-input-caret:hover{color:var(--bcm-color-prime-blue-6)}.bcm-input__container .caret-container .bcm-input-caret:active{background-color:var(--bcm-color-grey-3)}.bcm-input__container .caret-container .bcm-input-caret:last-child{border-top:1px solid #D9D9D9}.bcm-input__container .caret-container.disabled{background-color:var(--bcm-color-grey-3)}.bcm-input__container .caret-container.disabled .bcm-input-caret{cursor:not-allowed}.bcm-input__container .input-suffix-content{display:flex;align-items:center;justify-content:center}.bcm-input__container .input-prefix:not(:empty){padding-left:4px}.bcm-input__container .input-suffix:not(:empty){min-width:24px;padding-right:4px}.bcm-input__container .input-prefix:not(:empty),.bcm-input__container .input-suffix:not(:empty){display:flex;align-items:center;justify-content:center;cursor:default;color:#64748a}.bcm-input__container .input-prefix:not(:empty) .unit-prefix,.bcm-input__container .input-suffix:not(:empty) .unit-prefix{color:#64748a}.bcm-input__container .input-prefix-button:not(:empty),.bcm-input__container .input-suffix-button:not(:empty){cursor:pointer}.bcm-input__container .caret-container,.bcm-input__container .input-clear-button{opacity:0}.bcm-input__container--small{font-size:12px}.bcm-input__container--medium{font-size:14px}.bcm-input__container--large{font-size:16px}.bcm-input__textarea.clearable .bcm-input-element{padding-right:24px}.bcm-input__textarea .input-clear-button{position:absolute;top:4px;right:0}";
3935
+
3936
+ const BcmSearch = class {
3937
+ constructor(hostRef) {
3938
+ index$2.registerInstance(this, hostRef);
3939
+ this.bcmOnSearch = index$2.createEvent(this, "bcm-on-search", 7);
3940
+ this.bcmOnSearchClear = index$2.createEvent(this, "bcm-on-search-clear", 7);
3941
+ this.debounceHandler = generate.Generate.debounceInput((event) => this.onSearchValue(event, this), 300, false, () => {
3942
+ var _a, _b;
3943
+ this.isActiveClearable = ((_b = (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.length) > 0 && this.clearable;
3944
+ });
3945
+ this._id = generate.Generate.UID();
3946
+ this.placeholder = "Search";
3947
+ this.disabled = false;
3948
+ this.readonly = false;
3949
+ this.clearable = true;
3950
+ this.size = bcm.Bcm$1.Size.medium;
3951
+ this.limit = 10;
3952
+ this.searchIsOnlyChilds = false;
3953
+ this.minSearchLength = 2;
3954
+ this.data = [];
3955
+ this.tick = {};
3956
+ this.isActiveClearable = false;
3957
+ }
3958
+ async componentDidLoad() {
3959
+ await this.initState();
3960
+ }
3961
+ async dataChanged(newValue, oldValue) {
3962
+ // console.log('data changed', newValue, oldValue)
3963
+ if (newValue !== oldValue) {
3964
+ await this.initState();
3965
+ }
3966
+ }
3967
+ async initState() {
3968
+ await searchState.setValue({
3969
+ id: this._id + "-input",
3970
+ dataSource: this.data,
3971
+ searchIsOnlyChilds: this.searchIsOnlyChilds,
3972
+ });
3973
+ await this.markForCheck();
3974
+ }
3975
+ markForCheck() {
3976
+ this.tick = generate.Generate.UID();
3977
+ }
3978
+ handleInput() {
3979
+ // console.log("aheyya")
3980
+ }
3981
+ async onBcmFocus() {
3982
+ this.inputElement.focus();
3983
+ }
3984
+ async onBcmBlur() {
3985
+ this.inputElement.blur();
3986
+ }
3987
+ async onBcmSelect() {
3988
+ this.inputElement.select();
3989
+ }
3990
+ async setValue(newValue) {
3991
+ this.inputElement.value = newValue;
3992
+ }
3993
+ handleFocus() { }
3994
+ handleBlur() { }
3995
+ handleChange() { }
3996
+ async handleClear(eventEmit = true) {
3997
+ this.inputElement.value = '';
3998
+ const { value, id } = this.inputElement;
3999
+ searchState.searchData(id, value);
4000
+ this.isActiveClearable = false;
4001
+ this.bcmOnSearch.emit({ result: null, value: null, matching: null, parentIndex: null });
4002
+ this.bcmOnSearchClear.emit(eventEmit);
4003
+ await utils.delay(10);
4004
+ return Promise.resolve();
4005
+ }
4006
+ onSearchValue(event, instance) {
4007
+ const { value, id } = event.target;
4008
+ const searchResult = (value === null || value === void 0 ? void 0 : value.length) >= this.minSearchLength ? searchState.searchData(id, value, null) : null;
4009
+ const { bcmOnSearch, inputElement } = instance;
4010
+ bcmOnSearch.emit({ result: searchResult === null || searchResult === void 0 ? void 0 : searchResult.result, value: inputElement === null || inputElement === void 0 ? void 0 : inputElement.value, matching: searchResult === null || searchResult === void 0 ? void 0 : searchResult.matching, parentIndex: searchResult === null || searchResult === void 0 ? void 0 : searchResult.parentIndex, nestedResult: searchResult === null || searchResult === void 0 ? void 0 : searchResult.nestedResult });
4011
+ }
4012
+ render() {
4013
+ const { _id, placeholder, disabled, readonly } = this;
4014
+ return index$2.h(index$2.Host, { onClick: () => { this.onBcmFocus(); this.onBcmSelect(); } }, index$2.h(inputTemplate.InputTemplate, { size: this.size, id: _id, type: "search", placeholder: placeholder, disabled: disabled, "full-width": true, readonly: readonly, clearable: this.isActiveClearable, handleFocus: () => this.handleFocus(), handleBlur: () => this.handleBlur(), handleChange: () => this.handleChange(), handleClear: () => this.handleClear(), handleInput: this.debounceHandler, ref: (el) => this.inputElement = el }));
4015
+ }
4016
+ get el() { return index$2.getElement(this); }
4017
+ static get watchers() { return {
4018
+ "data": ["dataChanged"]
4019
+ }; }
4020
+ };
4021
+ BcmSearch.style = searchCss;
4022
+
4023
+ exports.bcm_list = BcmList;
4024
+ exports.bcm_rc_overflow = BcmRcOverflow;
4025
+ exports.bcm_search = BcmSearch;