bromcom-ui 2.11.1-rc.9-3 → 2.11.2-test.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (337) 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-00c28e19.entry.js +5 -0
  4. package/dist/bromcom-ui/p-0533a1b0.entry.js +5 -0
  5. package/dist/bromcom-ui/{p-2cd6cdee.js → p-09318a64.js} +1 -1
  6. package/dist/bromcom-ui/p-0a44db90.entry.js +5 -0
  7. package/dist/bromcom-ui/p-0cd4e8a1.entry.js +5 -0
  8. package/dist/bromcom-ui/p-195c1819.entry.js +5 -0
  9. package/dist/bromcom-ui/p-19783732.entry.js +5 -0
  10. package/dist/bromcom-ui/p-1e5df686.entry.js +5 -0
  11. package/dist/bromcom-ui/p-207c20c6.entry.js +5 -0
  12. package/dist/bromcom-ui/p-2270e612.entry.js +5 -0
  13. package/dist/bromcom-ui/p-34740cfd.entry.js +5 -0
  14. package/dist/bromcom-ui/p-350719ca.entry.js +5 -0
  15. package/dist/bromcom-ui/p-385a50b0.entry.js +5 -0
  16. package/dist/bromcom-ui/p-3b38d001.js +5 -0
  17. package/dist/bromcom-ui/p-3c04d0f7.entry.js +5 -0
  18. package/dist/bromcom-ui/p-3e2fb868.entry.js +5 -0
  19. package/dist/bromcom-ui/p-44faabe9.entry.js +5 -0
  20. package/dist/bromcom-ui/{p-5a391fcd.js → p-4757735e.js} +1 -1
  21. package/dist/bromcom-ui/p-4d5eb722.entry.js +5 -0
  22. package/dist/bromcom-ui/p-50926f4c.entry.js +5 -0
  23. package/dist/bromcom-ui/p-5196912d.js +5 -0
  24. package/dist/bromcom-ui/p-543457d1.entry.js +5 -0
  25. package/dist/bromcom-ui/p-58ca54dc.js +5 -0
  26. package/dist/bromcom-ui/p-60dd2172.entry.js +5 -0
  27. package/dist/bromcom-ui/p-6146d180.entry.js +5 -0
  28. package/dist/bromcom-ui/p-62804f2c.entry.js +5 -0
  29. package/dist/bromcom-ui/p-666d9883.entry.js +5 -0
  30. package/dist/bromcom-ui/{p-0eacfbb2.entry.js → p-695d8d34.entry.js} +1 -1
  31. package/dist/bromcom-ui/{p-14ed8029.entry.js → p-69c64256.entry.js} +1 -1
  32. package/dist/bromcom-ui/p-6c6beb41.entry.js +5 -0
  33. package/dist/bromcom-ui/p-6e5f5f36.js +1 -1
  34. package/dist/bromcom-ui/p-6e961eb9.entry.js +7 -0
  35. package/dist/bromcom-ui/p-70c2412a.entry.js +5 -0
  36. package/dist/bromcom-ui/p-7175c984.entry.js +5 -0
  37. package/dist/bromcom-ui/p-7222a8db.entry.js +5 -0
  38. package/dist/bromcom-ui/p-75e4f799.entry.js +5 -0
  39. package/dist/bromcom-ui/p-76f6db61.entry.js +5 -0
  40. package/dist/bromcom-ui/p-79153d4a.entry.js +5 -0
  41. package/dist/bromcom-ui/p-7b9e8f58.entry.js +5 -0
  42. package/dist/bromcom-ui/p-80a43d63.js +5 -0
  43. package/dist/bromcom-ui/p-86384d20.entry.js +5 -0
  44. package/dist/bromcom-ui/p-894c02ef.entry.js +5 -0
  45. package/dist/bromcom-ui/p-8b00d553.entry.js +5 -0
  46. package/dist/bromcom-ui/p-8b3eafe7.entry.js +5 -0
  47. package/dist/bromcom-ui/p-9098db35.entry.js +5 -0
  48. package/dist/bromcom-ui/p-a0d6d680.js +1 -1
  49. package/dist/bromcom-ui/p-a313fba6.js +1 -1
  50. package/dist/bromcom-ui/p-a42fbe84.entry.js +5 -0
  51. package/dist/bromcom-ui/p-a516049b.entry.js +5 -0
  52. package/dist/bromcom-ui/p-a62adacd.js +5 -0
  53. package/dist/bromcom-ui/p-aaf36d5c.entry.js +5 -0
  54. package/dist/bromcom-ui/p-ab2dcd70.entry.js +5 -0
  55. package/dist/bromcom-ui/{p-db15dca3.entry.js → p-ad8d9e10.entry.js} +1 -1
  56. package/dist/bromcom-ui/{p-ede82918.js → p-b12c8235.js} +1 -1
  57. package/dist/bromcom-ui/p-b2c6659a.entry.js +5 -0
  58. package/dist/bromcom-ui/p-b381e7f1.js +19 -0
  59. package/dist/bromcom-ui/{p-90223f9f.entry.js → p-b3f7b64d.entry.js} +1 -1
  60. package/dist/bromcom-ui/p-b4755ed0.entry.js +5 -0
  61. package/dist/bromcom-ui/{p-a018f340.entry.js → p-b66e0388.entry.js} +1 -1
  62. package/dist/bromcom-ui/{p-adcb30bc.entry.js → p-b6e6027b.entry.js} +1 -1
  63. package/dist/bromcom-ui/{p-35c215f2.entry.js → p-b85fd5f4.entry.js} +1 -1
  64. package/dist/bromcom-ui/p-c6b86846.entry.js +5 -0
  65. package/dist/bromcom-ui/p-cc449a87.entry.js +5 -0
  66. package/dist/bromcom-ui/{p-8b31581f.js → p-ccbb5a6b.js} +1 -1
  67. package/dist/bromcom-ui/p-d01426b6.entry.js +5 -0
  68. package/dist/bromcom-ui/p-d43d75d2.entry.js +5 -0
  69. package/dist/bromcom-ui/p-d51f76b2.js +5 -0
  70. package/dist/bromcom-ui/p-ef4baf81.entry.js +5 -0
  71. package/dist/bromcom-ui/p-f2b520a4.entry.js +5 -0
  72. package/dist/bromcom-ui/{p-5bf1657b.entry.js → p-f2e06aca.entry.js} +1 -1
  73. package/dist/bromcom-ui/{p-930f3618.js → p-f6169b46.js} +1 -1
  74. package/dist/bromcom-ui/p-f7e70814.entry.js +5 -0
  75. package/dist/bromcom-ui/{p-6f37a4d7.entry.js → p-fc27c9ca.entry.js} +1 -1
  76. package/dist/cjs/Overflow-a821abd0.js +2769 -0
  77. package/dist/cjs/{bcm-1d1fcf21.js → bcm-489c9b1a.js} +4 -4
  78. package/dist/cjs/bcm-accordion.cjs.entry.js +74 -0
  79. package/dist/cjs/bcm-alert.cjs.entry.js +4 -4
  80. package/dist/cjs/bcm-attendance-actions-comment.cjs.entry.js +8 -9
  81. package/dist/cjs/bcm-attendance-actions-dropdown.cjs.entry.js +8 -9
  82. package/dist/cjs/bcm-attendance-actions.cjs.entry.js +329 -0
  83. package/dist/cjs/bcm-attendance.cjs.entry.js +35 -0
  84. package/dist/cjs/bcm-avatar_2.cjs.entry.js +209 -0
  85. package/dist/cjs/bcm-breadcrumb.cjs.entry.js +2 -2
  86. package/dist/cjs/bcm-button-group.cjs.entry.js +92 -0
  87. package/dist/cjs/bcm-button_15.cjs.entry.js +18623 -0
  88. package/dist/cjs/bcm-caption.cjs.entry.js +9 -10
  89. package/dist/cjs/bcm-card.cjs.entry.js +5 -5
  90. package/dist/cjs/bcm-checkbox-group.cjs.entry.js +415 -0
  91. package/dist/cjs/{bcm-checkbox-lite_8.cjs.entry.js → bcm-checkbox-lite_9.cjs.entry.js} +26 -6
  92. package/dist/cjs/bcm-checkbox_2.cjs.entry.js +194 -0
  93. package/dist/cjs/bcm-chip-group.cjs.entry.js +9 -10
  94. package/dist/cjs/bcm-chip.cjs.entry.js +91 -0
  95. package/dist/cjs/bcm-collapse.cjs.entry.js +2 -2
  96. package/dist/cjs/bcm-color-input.cjs.entry.js +76 -0
  97. package/dist/cjs/bcm-default.cjs.entry.js +2 -2
  98. package/dist/cjs/bcm-drawer.cjs.entry.js +95 -0
  99. package/dist/cjs/bcm-dropdown.cjs.entry.js +119 -0
  100. package/dist/cjs/bcm-error-layout.cjs.entry.js +1 -1
  101. package/dist/cjs/bcm-expansion-panel.cjs.entry.js +116 -0
  102. package/dist/cjs/bcm-input-custom.cjs.entry.js +2 -2
  103. package/dist/cjs/bcm-input-dropdown.cjs.entry.js +10 -11
  104. package/dist/cjs/bcm-item.cjs.entry.js +72 -0
  105. package/dist/cjs/bcm-items.cjs.entry.js +49 -0
  106. package/dist/cjs/bcm-link.cjs.entry.js +3 -3
  107. package/dist/cjs/bcm-list_3.cjs.entry.js +1970 -0
  108. package/dist/cjs/bcm-menu.cjs.entry.js +150 -0
  109. package/dist/cjs/bcm-modal-2-footer.cjs.entry.js +6 -7
  110. package/dist/cjs/bcm-modal-2-header.cjs.entry.js +6 -7
  111. package/dist/cjs/bcm-modal-2.cjs.entry.js +7 -8
  112. package/dist/cjs/bcm-modal.cjs.entry.js +157 -0
  113. package/dist/cjs/bcm-number-input.cjs.entry.js +9 -10
  114. package/dist/cjs/bcm-popconfirm-box.cjs.entry.js +115 -0
  115. package/dist/cjs/bcm-popconfirm.cjs.entry.js +101 -0
  116. package/dist/cjs/bcm-popover.cjs.entry.js +9 -10
  117. package/dist/cjs/bcm-progress.cjs.entry.js +162 -0
  118. package/dist/cjs/bcm-radio-group.cjs.entry.js +160 -0
  119. package/dist/cjs/bcm-radio.cjs.entry.js +64 -0
  120. package/dist/cjs/bcm-range.cjs.entry.js +6 -6
  121. package/dist/cjs/bcm-select.cjs.entry.js +2 -2
  122. package/dist/cjs/bcm-shortcut.cjs.entry.js +64 -0
  123. package/dist/cjs/bcm-skeleton.cjs.entry.js +6 -7
  124. package/dist/cjs/bcm-step.cjs.entry.js +89 -0
  125. package/dist/cjs/bcm-stepper.cjs.entry.js +239 -0
  126. package/dist/cjs/bcm-switch.cjs.entry.js +151 -0
  127. package/dist/cjs/bcm-tab-group.cjs.entry.js +209 -0
  128. package/dist/cjs/bcm-tab-item-header.cjs.entry.js +58 -0
  129. package/dist/cjs/bcm-tab-item.cjs.entry.js +90 -0
  130. package/dist/cjs/bcm-table.cjs.entry.js +6 -7
  131. package/dist/cjs/bcm-tag.cjs.entry.js +15 -15
  132. package/dist/cjs/bcm-text.cjs.entry.js +49 -0
  133. package/dist/cjs/bcm-textarea.cjs.entry.js +163 -0
  134. package/dist/cjs/bcm-toast.cjs.entry.js +11 -11
  135. package/dist/cjs/bromcom-ui.cjs.js +3 -3
  136. package/dist/cjs/{caption-template-85a18b6d.js → caption-template-086e9cac.js} +2 -2
  137. package/dist/cjs/{floating-ui-5b396838.js → floating-ui-21890d11.js} +2 -2
  138. package/dist/cjs/{generate-f73a098d.js → generate-64f84d95.js} +1 -1
  139. package/dist/cjs/{global-baf04c81.js → global-895f2946.js} +1 -1
  140. package/dist/cjs/input-template-9c106337.js +92 -0
  141. package/dist/cjs/json-parse-decarator-9db107be.js +40 -0
  142. package/dist/cjs/{label-template-e83447b5.js → label-template-94b3d775.js} +3 -3
  143. package/dist/cjs/loader.cjs.js +3 -3
  144. package/dist/cjs/{number-helper-0543a62e.js → number-helper-f9323233.js} +1 -1
  145. package/dist/cjs/old-bcm-popover-box.cjs.entry.js +7 -7
  146. package/dist/cjs/old-bcm-popover.cjs.entry.js +5 -5
  147. package/dist/cjs/{package-e717a31f.js → package-992c024f.js} +1 -1
  148. package/dist/cjs/{popover-placement-02e6101b.js → popover-placement-e7d6eabd.js} +1 -1
  149. package/dist/cjs/{slot-template-df7b5b59.js → slot-template-c8e2816c.js} +1 -1
  150. package/dist/cjs/stepper-states-b3496b3f.js +85 -0
  151. package/dist/cjs/{string-helper-9cdfb273.js → string-helper-f9184277.js} +2 -2
  152. package/dist/cjs/tooltip-helper-cb99c02e.js +157 -0
  153. package/dist/cjs/{validators-77768582.js → validators-abb0434a.js} +6 -1
  154. package/dist/collection/components/atoms/avatar/avatar.js +1 -1
  155. package/dist/collection/components/atoms/badge/badge.js +1 -1
  156. package/dist/collection/components/atoms/badge/badge.style.js +1 -1
  157. package/dist/collection/components/atoms/button/button.css +13 -13
  158. package/dist/collection/components/atoms/button/button.js +14 -14
  159. package/dist/collection/components/atoms/chip/chip.css +4 -4
  160. package/dist/collection/components/atoms/chip/chip.js +3 -3
  161. package/dist/collection/components/molecules/checkbox/group.css +2 -2
  162. package/dist/collection/components/molecules/checkbox/group.js +1 -1
  163. package/dist/collection/components/molecules/color-input/color-input.js +1 -1
  164. package/dist/collection/components/molecules/empty/empty.js +1 -1
  165. package/dist/collection/components/molecules/error-layout/error-layout.js +1 -1
  166. package/dist/collection/components/molecules/expansion-panel/expansion-panel.js +1 -1
  167. package/dist/collection/components/molecules/input/input.js +1 -1
  168. package/dist/collection/components/molecules/input-dropdown/input-dropdown.js +1 -1
  169. package/dist/collection/components/molecules/menu/menu.css +4 -4
  170. package/dist/collection/components/molecules/modal/modal.css +1 -1
  171. package/dist/collection/components/molecules/radio/radio-group.js +1 -1
  172. package/dist/collection/components/molecules/radio/radio.js +1 -1
  173. package/dist/collection/components/molecules/range/range.js +1 -1
  174. package/dist/collection/components/molecules/switch/switch.css +2 -2
  175. package/dist/collection/components/molecules/tab-group/tab-group.js +2 -2
  176. package/dist/collection/components/molecules/tab-group/tab-item-header.js +5 -5
  177. package/dist/collection/components/molecules/tooltip/tooltip.js +1 -1
  178. package/dist/collection/components/organism/list/list.css +2 -3
  179. package/dist/collection/components/organism/list/list.js +2 -2
  180. package/dist/collection/components/other/attendance/attendance.js +1 -1
  181. package/dist/collection/components/third-parts/rc-picker/date.js +1 -1
  182. package/dist/collection/components/third-parts/rc-picker/rc-picker.css +40 -5
  183. package/dist/collection/components/third-parts/rc-picker/rc-picker.js +11 -2
  184. package/dist/collection/stories/ui-library/components/date/argTypes_common.js +0 -1
  185. package/dist/collection/templates/button-template.js +1 -1
  186. package/dist/collection/templates/caption-template.js +2 -2
  187. package/dist/collection/templates/input-template.js +1 -1
  188. package/dist/collection/templates/label-template.js +1 -1
  189. package/dist/collection/templates/list-item-template.js +1 -1
  190. package/dist/collection/templates/list-template.js +9 -3
  191. package/dist/components/{raf.js → Overflow.js} +692 -69
  192. package/dist/components/avatar.js +1 -1
  193. package/dist/components/badge.js +2 -2
  194. package/dist/components/bcm-attendance.js +1 -1
  195. package/dist/components/bcm-checkbox-group.js +2 -2
  196. package/dist/components/bcm-color-input.js +1 -1
  197. package/dist/components/bcm-date.js +1 -1
  198. package/dist/components/bcm-error-layout.js +1 -1
  199. package/dist/components/bcm-expansion-panel.js +1 -1
  200. package/dist/components/bcm-input-dropdown.js +1 -1
  201. package/dist/components/bcm-modal.js +1 -1
  202. package/dist/components/bcm-radio-group.js +1 -1
  203. package/dist/components/bcm-range.js +1 -1
  204. package/dist/components/bcm-switch.js +1 -1
  205. package/dist/components/bcm-tab-group.js +2 -2
  206. package/dist/components/bcm-tab-item-header.js +5 -5
  207. package/dist/components/button.js +16 -16
  208. package/dist/components/caption-template.js +2 -2
  209. package/dist/components/chip.js +4 -4
  210. package/dist/components/empty.js +1 -1
  211. package/dist/components/generate.js +1 -1
  212. package/dist/components/input-template.js +1 -1
  213. package/dist/components/input.js +1 -1
  214. package/dist/components/label.js +1 -1
  215. package/dist/components/list.js +13 -7
  216. package/dist/components/menu.js +1 -1
  217. package/dist/components/radio.js +1 -1
  218. package/dist/components/rc-overflow.js +1 -593
  219. package/dist/components/rc-picker.js +8620 -8025
  220. package/dist/components/tooltip.js +1 -1
  221. package/dist/esm/Overflow-2cffcda0.js +2750 -0
  222. package/dist/esm/bcm-a50d55ba.js +1 -1
  223. package/dist/esm/bcm-accordion.entry.js +70 -0
  224. package/dist/esm/bcm-alert.entry.js +2 -2
  225. package/dist/esm/bcm-attendance-actions-comment.entry.js +5 -6
  226. package/dist/esm/bcm-attendance-actions-dropdown.entry.js +5 -6
  227. package/dist/esm/bcm-attendance-actions.entry.js +325 -0
  228. package/dist/esm/bcm-attendance.entry.js +31 -0
  229. package/dist/esm/bcm-avatar_2.entry.js +204 -0
  230. package/dist/esm/bcm-breadcrumb.entry.js +2 -2
  231. package/dist/esm/bcm-button-group.entry.js +88 -0
  232. package/dist/esm/bcm-button_15.entry.js +18605 -0
  233. package/dist/esm/bcm-caption.entry.js +6 -7
  234. package/dist/esm/bcm-card.entry.js +2 -2
  235. package/dist/esm/bcm-checkbox-group.entry.js +411 -0
  236. package/dist/esm/{bcm-checkbox-lite_8.entry.js → bcm-checkbox-lite_9.entry.js} +24 -5
  237. package/dist/esm/bcm-checkbox_2.entry.js +189 -0
  238. package/dist/esm/bcm-chip-group.entry.js +7 -8
  239. package/dist/esm/bcm-chip.entry.js +87 -0
  240. package/dist/esm/bcm-collapse.entry.js +2 -2
  241. package/dist/esm/bcm-color-input.entry.js +72 -0
  242. package/dist/esm/bcm-default.entry.js +2 -2
  243. package/dist/esm/bcm-drawer.entry.js +91 -0
  244. package/dist/esm/bcm-dropdown.entry.js +115 -0
  245. package/dist/esm/bcm-error-layout.entry.js +1 -1
  246. package/dist/esm/bcm-expansion-panel.entry.js +112 -0
  247. package/dist/esm/bcm-input-custom.entry.js +2 -2
  248. package/dist/esm/bcm-input-dropdown.entry.js +7 -8
  249. package/dist/esm/bcm-item.entry.js +68 -0
  250. package/dist/esm/bcm-items.entry.js +45 -0
  251. package/dist/esm/bcm-link.entry.js +1 -1
  252. package/dist/esm/bcm-list_3.entry.js +1964 -0
  253. package/dist/esm/bcm-menu.entry.js +146 -0
  254. package/dist/esm/bcm-modal-2-footer.entry.js +4 -5
  255. package/dist/esm/bcm-modal-2-header.entry.js +4 -5
  256. package/dist/esm/bcm-modal-2.entry.js +5 -6
  257. package/dist/esm/bcm-modal.entry.js +153 -0
  258. package/dist/esm/bcm-number-input.entry.js +6 -7
  259. package/dist/esm/bcm-popconfirm-box.entry.js +111 -0
  260. package/dist/esm/bcm-popconfirm.entry.js +97 -0
  261. package/dist/esm/bcm-popover.entry.js +5 -6
  262. package/dist/esm/bcm-progress.entry.js +158 -0
  263. package/dist/esm/bcm-radio-group.entry.js +156 -0
  264. package/dist/esm/bcm-radio.entry.js +60 -0
  265. package/dist/esm/bcm-range.entry.js +4 -4
  266. package/dist/esm/bcm-shortcut.entry.js +60 -0
  267. package/dist/esm/bcm-skeleton.entry.js +4 -5
  268. package/dist/esm/bcm-step.entry.js +85 -0
  269. package/dist/esm/bcm-stepper.entry.js +235 -0
  270. package/dist/esm/bcm-switch.entry.js +147 -0
  271. package/dist/esm/bcm-tab-group.entry.js +205 -0
  272. package/dist/esm/bcm-tab-item-header.entry.js +54 -0
  273. package/dist/esm/bcm-tab-item.entry.js +86 -0
  274. package/dist/esm/bcm-table.entry.js +4 -5
  275. package/dist/esm/bcm-tag.entry.js +4 -4
  276. package/dist/esm/bcm-text.entry.js +45 -0
  277. package/dist/esm/bcm-textarea.entry.js +159 -0
  278. package/dist/esm/bcm-toast.entry.js +3 -3
  279. package/dist/esm/bromcom-ui.js +3 -3
  280. package/dist/esm/{caption-template-d7953d13.js → caption-template-fd7738eb.js} +2 -2
  281. package/dist/esm/floating-ui-3f4394da.js +1 -1
  282. package/dist/esm/{generate-c2c0b02e.js → generate-56856b63.js} +1 -1
  283. package/dist/esm/{global-2473677b.js → global-c0272f2f.js} +1 -1
  284. package/dist/esm/input-template-19a34625.js +90 -0
  285. package/dist/esm/json-parse-decarator-c9a132f1.js +38 -0
  286. package/dist/esm/{label-template-a26f76c0.js → label-template-374fbdcd.js} +2 -2
  287. package/dist/esm/loader.js +3 -3
  288. package/dist/esm/{number-helper-75447fa6.js → number-helper-0501b786.js} +1 -1
  289. package/dist/esm/old-bcm-popover-box.entry.js +3 -3
  290. package/dist/esm/old-bcm-popover.entry.js +3 -3
  291. package/dist/esm/{package-28dc6847.js → package-a9b6e2c6.js} +1 -1
  292. package/dist/esm/stepper-states-a4b1efb3.js +83 -0
  293. package/dist/esm/string-helper-3592bdc2.js +1 -1
  294. package/dist/esm/tooltip-helper-de7eb9a3.js +155 -0
  295. package/dist/esm/{validators-5a383988.js → validators-be951131.js} +6 -2
  296. package/dist/types/templates/list-template.d.ts +0 -1
  297. package/package.json +2 -2
  298. package/dist/bromcom-ui/p-1345d51b.entry.js +0 -5
  299. package/dist/bromcom-ui/p-178fa936.entry.js +0 -5
  300. package/dist/bromcom-ui/p-3361f6c9.entry.js +0 -5
  301. package/dist/bromcom-ui/p-350dbff0.entry.js +0 -5
  302. package/dist/bromcom-ui/p-3cdfd8eb.entry.js +0 -5
  303. package/dist/bromcom-ui/p-5a22b74b.entry.js +0 -5
  304. package/dist/bromcom-ui/p-626a65e9.js +0 -5
  305. package/dist/bromcom-ui/p-627c7769.entry.js +0 -5
  306. package/dist/bromcom-ui/p-64f21481.entry.js +0 -20
  307. package/dist/bromcom-ui/p-70253803.entry.js +0 -5
  308. package/dist/bromcom-ui/p-7fd22a35.entry.js +0 -5
  309. package/dist/bromcom-ui/p-a0f44b56.entry.js +0 -5
  310. package/dist/bromcom-ui/p-a4b675ef.entry.js +0 -5
  311. package/dist/bromcom-ui/p-abd2f9ff.entry.js +0 -5
  312. package/dist/bromcom-ui/p-bb46d881.entry.js +0 -5
  313. package/dist/bromcom-ui/p-bca0ff0a.entry.js +0 -5
  314. package/dist/bromcom-ui/p-c10b07cc.entry.js +0 -5
  315. package/dist/bromcom-ui/p-c7030364.entry.js +0 -5
  316. package/dist/bromcom-ui/p-dc607ae4.entry.js +0 -5
  317. package/dist/bromcom-ui/p-de0b0192.entry.js +0 -5
  318. package/dist/bromcom-ui/p-e10780ed.entry.js +0 -5
  319. package/dist/bromcom-ui/p-e497cf5d.entry.js +0 -5
  320. package/dist/bromcom-ui/p-e93d6619.js +0 -5
  321. package/dist/bromcom-ui/p-ebeb9689.entry.js +0 -5
  322. package/dist/bromcom-ui/p-eca0acda.js +0 -5
  323. package/dist/bromcom-ui/p-fba1682e.entry.js +0 -5
  324. package/dist/cjs/bcm-accordion_46.cjs.entry.js +0 -24086
  325. package/dist/cjs/bcm-date-picker.cjs.entry.js +0 -182
  326. package/dist/cjs/bcm-datetime-picker.cjs.entry.js +0 -1450
  327. package/dist/cjs/bcm-form-2.cjs.entry.js +0 -212
  328. package/dist/cjs/bcm-old-input.cjs.entry.js +0 -397
  329. package/dist/cjs/bcm-time-picker.cjs.entry.js +0 -150
  330. package/dist/cjs/datetime-helper-eaf4fadb.js +0 -11
  331. package/dist/esm/bcm-accordion_46.entry.js +0 -24037
  332. package/dist/esm/bcm-date-picker.entry.js +0 -178
  333. package/dist/esm/bcm-datetime-picker.entry.js +0 -1446
  334. package/dist/esm/bcm-form-2.entry.js +0 -208
  335. package/dist/esm/bcm-old-input.entry.js +0 -393
  336. package/dist/esm/bcm-time-picker.entry.js +0 -146
  337. package/dist/esm/datetime-helper-df25808a.js +0 -9
@@ -0,0 +1,1964 @@
1
+ /*!
2
+ * Built with Stencil
3
+ * Copyright (c) Bromcom.
4
+ */
5
+ import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-0615c2b8.js';
6
+ import { I as IsLoad } from './is-load-decorator-8277e3b8.js';
7
+ import { J as JsonParse } from './json-parse-decarator-c9a132f1.js';
8
+ import './color-helper-3b528349.js';
9
+ import { V as Validators } from './validators-be951131.js';
10
+ import { G as Generate, s as snq } from './generate-56856b63.js';
11
+ import { N as NumberHelper } from './number-helper-0501b786.js';
12
+ import { S as StringHelper } from './string-helper-3592bdc2.js';
13
+ import './element-dragger-89bb52fd.js';
14
+ import { g as getPlacement, s as setPosition } from './popover-placement-d12fec40.js';
15
+ import { p as pluralize, d as delay } from './utils-57652744.js';
16
+ import { B as Bcm, a as Bcm$1 } from './bcm-a50d55ba.js';
17
+ import { C as CaptionTemplate } from './caption-template-fd7738eb.js';
18
+ import { c as classnames } from './index-f549811f.js';
19
+ import './types-6f06fa1a.js';
20
+ import './types-9493a7ed.js';
21
+ import { c as createStore } from './index-7e71bbc8.js';
22
+ import { r as react, F as ForwardOverflow, a as reactDom } from './Overflow-2cffcda0.js';
23
+ import { I as InputTemplate } from './input-template-19a34625.js';
24
+ import './colors-1d7854ea.js';
25
+ import './colors-c530a5b8.js';
26
+ import './_commonjsHelpers-82aa9212.js';
27
+ import './package-a9b6e2c6.js';
28
+
29
+ const CheckboxTemplate = ({ disabled, checked, readonly, required, indeterminate, hidden, captionType, _id }) => {
30
+ // if ( indeterminate ) {
31
+ // checked = indeterminate == 'determinate' ? true : false
32
+ // }
33
+ const hostClasses = classnames('bcm-checkbox', 'bcm-checkbox__type-default', `bcm-checkbox-size-medium`, {
34
+ // 'size-2': size === Bcm.Size.small || size === Bcm.Size.medium,
35
+ // 'size-3': optionType === 'button' && size === Bcm.Size.large,
36
+ 'error': captionType == Bcm.Status.error,
37
+ hidden,
38
+ checked,
39
+ disabled,
40
+ required,
41
+ readonly,
42
+ });
43
+ const bcmCheckboxIconClass = classnames('bcm-checkbox__label-icon', 'bcm-checkbox__label-icon-lite', 'bcm-checkbox__label-icon-' + indeterminate, {
44
+ 'bcm-checkbox__label-icon-checked': checked,
45
+ });
46
+ const bcmCheckboxLabelClass = classnames('bcm-checkbox__label');
47
+ return (h("div", { class: hostClasses },
48
+ h("input", { tabindex: "-1", id: _id, type: "checkbox", checked: checked, disabled: disabled, required: required, readonly: readonly }),
49
+ h("label", { class: bcmCheckboxLabelClass, htmlFor: _id },
50
+ h("span", { class: bcmCheckboxIconClass },
51
+ h("bcm-icon", { icon: "far fa-check" })))));
52
+ };
53
+
54
+ const InfoFooterTemplate = ({ selected, total, found, multiple, variableText }) => {
55
+ total = total || 0;
56
+ variableText = variableText ? pluralize(variableText, total) : 'items';
57
+ return (h("footer", { class: "bcm-info-footer" },
58
+ h("bcm-text", { scale: "size-1", color: "grey-8" },
59
+ (multiple && selected > 0) && ` ( ${selected} selected ) `,
60
+ ` Total ${total} `,
61
+ found != null && ` / ${found} `,
62
+ ` ${variableText} found. `)));
63
+ };
64
+
65
+ const ListItemTemplate = ({ item, treeview, highlight, checkboxes, size, selectedItem, openGroup, checkedItem, focusItem, searchIsOnlyChilds }) => {
66
+ const isHaveChildren = item.items && item.items.length > 0;
67
+ var text = StringHelper.htmlEntities(item.text);
68
+ let intersection = [];
69
+ if (highlight && StringHelper.slugify(text).includes(StringHelper.slugify(highlight))) {
70
+ if (!searchIsOnlyChilds || (searchIsOnlyChilds && (!isHaveChildren || (!treeview && item.type != "group")))) {
71
+ text = StringHelper.highlight(text, highlight);
72
+ }
73
+ }
74
+ if (item.type != 'group' && item.template) {
75
+ const match = item.template
76
+ .replace(/\s/g, '')
77
+ .match(/\{{[^}}]+\}/g)
78
+ .map(x => x.replace(/[{}]/g, ''));
79
+ const keys = Object.keys(item.itemObject);
80
+ intersection = match.filter(x => keys.includes(x));
81
+ }
82
+ text = item.isHtmlContent ? item.isHtmlContent : item.template && intersection.length > 0 ? StringHelper.templateParser(item.template, Object.assign(Object.assign({}, item.itemObject), { text })) : text;
83
+ const domText = item.template ? text : Generate.domParser(text);
84
+ const unClickable = !treeview && item.type == "group" && !item.clickable;
85
+ const disabled = item.disabled;
86
+ const readonly = item.readonly;
87
+ const itemClick = (event) => {
88
+ let path = event.path || event.composedPath();
89
+ if (path.filter(x => x.attributes && x.attributes.getNamedItem("unlinked"))[0]) {
90
+ return;
91
+ }
92
+ // if (readonly) {
93
+ // collapseClick();
94
+ // }
95
+ !unClickable && !disabled && !readonly && (checkboxes ? checkedItem(item.id) : selectedItem(item.id));
96
+ };
97
+ const collapseClick = () => {
98
+ // if (disabled) {
99
+ // return;
100
+ // }
101
+ item.open = item.isSearching;
102
+ openGroup(item.id);
103
+ };
104
+ return (h("div", { id: item.id, hidden: item.hidden, "on-focus": e => !unClickable && !disabled && focusItem(e), class: classnames('bcm-list__item',
105
+ // size === 'large' ? 'size-3' : 'size-2',
106
+ 'bcm-list__item-' + size, {
107
+ 'bcm-list__item--group': !treeview && item.type == 'group',
108
+ 'bcm-list__item--readonly': readonly,
109
+ }) },
110
+ h("div", { class: classnames('bcm-list__item-content', !checkboxes && item.selected && 'selected', { disabled, readonly }) },
111
+ treeview && (h("div", { class: "bcm-list__item-content-collapse-icon", onClick: () => collapseClick() }, isHaveChildren && h("bcm-icon", { icon: classnames('fas fa-caret-' + (item.isSearching || item.open ? 'down' : 'right')) }))),
112
+ h("div", { class: classnames('bcm-list__item-content-text', { treeview }), onClick: (e) => itemClick(e) },
113
+ checkboxes && (treeview || (!treeview && item.type != 'group')) && (h("div", { class: "bcm-list__item-content-text-checkbox" },
114
+ h(CheckboxTemplate, { indeterminate: item.indeterminate, checked: item.checked, disabled: item.disabled }))),
115
+ h("span", Object.assign({ class: "bcm-list__item-content-text-inner" }, (item.title && { "title": item.title }), { innerHTML: domText })))),
116
+ (treeview || !treeview && item.type == "group") && isHaveChildren && (h("div", { class: "bcm-list__item-childs" }, (item.isSearching || item.open || (!treeview && item.type == "group")) &&
117
+ item.items.map((item) => (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) })))))));
118
+ };
119
+
120
+ const ListTemplate = ({ highlight, selectAllItem, bcmListContainer, treeview, checkboxes, checkAll, infoFooter, value, totalData, searchFound, variableText, _id, tempId, data, width, height, size, searchPlaceholder, minSearchLength, selectedItem, openGroup, checkedItem, onScrollEvent, focusItem, items, searchable, searchIsOnlyChilds, emptyText, emptyIcon, handleTransitionEnd, }) => {
121
+ const showSelectAll = !(treeview && searchFound > 0) && !(searchFound > 0);
122
+ const setScrollHeight = () => {
123
+ const itemHeight = size === 'small' ? 28 : size === 'medium' ? 36 : 48;
124
+ const itemCount = searchFound == null ? (treeview ? items.length : totalData) : searchFound;
125
+ const scrollHeight = itemCount * itemHeight || 0;
126
+ return {
127
+ 'min-height': `${scrollHeight}px`,
128
+ 'overscroll-behavior': 'none',
129
+ 'height': '100%',
130
+ 'display': 'flex',
131
+ 'flex-direction': 'column',
132
+ };
133
+ };
134
+ return (h("div", { id: `bcm-list-${_id}`, class: bcmListContainer, "temp-id": `bcm-list-${tempId}`, style: { '--height': height, '--width': width }, onTransitionEnd: e => handleTransitionEnd(e) },
135
+ data && searchable && (h("section", { class: "bcm-list__container-search" },
136
+ h("bcm-search", { size: size, id: `bcm-list-${_id}-search`, data: data, clearable: true, placeholder: searchPlaceholder, "min-search-length": minSearchLength, searchIsOnlyChilds: searchIsOnlyChilds }))),
137
+ h("main", { onScroll: e => onScrollEvent(e), class: "scrolling", style: { 'overscroll-behavior': 'none' } },
138
+ h("div", { style: setScrollHeight() },
139
+ checkAll && searchFound != 0 && items && items.length > 0 && checkboxes && showSelectAll && (h("section", { class: "bcm-list__container-select-all" },
140
+ 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) }))),
141
+ items.map((item) => (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) }))),
142
+ (!items || items.length === 0) && searchFound != 0 && (h("section", { class: "bcm-list__container-no-data" },
143
+ h("bcm-empty", { style: { height: 'auto' }, icon: emptyIcon },
144
+ h("span", { innerHTML: emptyText || 'No data' })))),
145
+ searchFound == 0 && (h("section", { class: "bcm-list__container-no-data" },
146
+ h("bcm-empty", { style: { height: 'auto' }, icon: emptyIcon },
147
+ h("span", { innerHTML: emptyText || 'No Data Found' })))))),
148
+ infoFooter && data && data.length > 0 && (h(InfoFooterTemplate, { selected: value === null || value === void 0 ? void 0 : value.length, total: totalData, found: searchFound, multiple: checkboxes, variableText: variableText }))));
149
+ };
150
+
151
+ const { state: state$1 } = createStore({
152
+ value: new Map(),
153
+ });
154
+ const setValue$1 = val => {
155
+ const { id, dataSource, options } = val;
156
+ 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;
157
+ const itemOptions = { size, checkboxes, template, allOpen, highlight, treeview };
158
+ const data = {
159
+ id: snq(() => id, Generate.UID),
160
+ dataSource: dataSource && dataSource.length > 0 && recursive$1(dataSource, itemOptions),
161
+ options: {
162
+ type,
163
+ treeview,
164
+ checkboxes,
165
+ searchable,
166
+ value,
167
+ name,
168
+ label,
169
+ size,
170
+ disabled,
171
+ readonly,
172
+ highlight,
173
+ required,
174
+ hidden,
175
+ fullWidth,
176
+ height,
177
+ maxHeight,
178
+ minHeight,
179
+ width,
180
+ infoFooter,
181
+ variableText,
182
+ template,
183
+ allOpen,
184
+ keyControl,
185
+ checkAll,
186
+ linkedComponent,
187
+ placeholder,
188
+ searchPlaceholder,
189
+ searchIsOnlyChilds,
190
+ clearable,
191
+ caption,
192
+ noCaption,
193
+ captionType,
194
+ captionError,
195
+ placement,
196
+ },
197
+ totalItems: (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) > 0 && calculateTotalItems(dataSource, options.treeview),
198
+ totalRoots: dataSource === null || dataSource === void 0 ? void 0 : dataSource.length,
199
+ };
200
+ state$1.value.set(data.id, data);
201
+ };
202
+ const recursive$1 = (data, options, parentId, parentIndex = "0.") => {
203
+ let recData = [];
204
+ if (data && data.length > 0) {
205
+ recData = data.map((item, index) => (Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ itemObject: item }, item), options), { parentId: snq(() => parentId, null), open: options.allOpen || item.open || false }), ((options.treeview || (!options.treeview && item.type == 'group')) && item.items && item.items.length > 0
206
+ ? { items: snq(() => recursive$1(item.items, options, item.id, `${parentIndex}${index}`), []) }
207
+ : { items: [] })), { ct: `${parentIndex}${index}` })));
208
+ }
209
+ return recData;
210
+ };
211
+ const removeValue$1 = _id => {
212
+ state$1.value.delete(_id);
213
+ };
214
+ const getValue$1 = id => snq(() => state$1.value.get(id), {});
215
+ const calculateTotalItems = (dataSource, treeview) => {
216
+ let total = 0;
217
+ dataSource.forEach(item => {
218
+ if (treeview || (!treeview && item.type != "group")) {
219
+ total += 1;
220
+ }
221
+ if ((treeview || (!treeview && item.type == "group")) && item.items) {
222
+ total += calculateTotalItems(item.items, treeview);
223
+ }
224
+ });
225
+ return total;
226
+ };
227
+ const getData = id => {
228
+ let data = [];
229
+ const value = getValue$1(id);
230
+ if (value) {
231
+ const { dataSource } = value;
232
+ data = dataSource;
233
+ }
234
+ return data;
235
+ };
236
+ const getDataPagination$1 = (id, limit = 3, ids) => {
237
+ let data = [];
238
+ const value = getValue$1(id);
239
+ if (value) {
240
+ const { dataSource } = value;
241
+ data = !ids ? dataSource.slice(0, limit) : dataSource.filter(item => ids.indexOf(item.id) > -1).slice(0, limit);
242
+ }
243
+ return data;
244
+ };
245
+ const openGroup = (id, groupId, items, status) => {
246
+ let dataSource;
247
+ if (items) {
248
+ dataSource = items;
249
+ }
250
+ else {
251
+ const value = getValue$1(id);
252
+ dataSource = value.dataSource;
253
+ }
254
+ if (dataSource) {
255
+ dataSource.forEach(item => {
256
+ if (status != undefined) {
257
+ item.open = status;
258
+ }
259
+ else if (item.id == groupId) {
260
+ item.open = !item.open;
261
+ item.isSearching = item.open;
262
+ if (!item.open && item.items) {
263
+ openGroup(id, groupId, item.items, false);
264
+ }
265
+ }
266
+ else if (item.items) {
267
+ openGroup(id, groupId, item.items);
268
+ }
269
+ });
270
+ }
271
+ };
272
+ const removeOtherTags = (id, ids, items) => {
273
+ ids = Array.isArray(ids) ? ids : [ids];
274
+ let dataSource;
275
+ if (items) {
276
+ dataSource = items;
277
+ }
278
+ else {
279
+ const value = getValue$1(id);
280
+ dataSource = value.dataSource;
281
+ }
282
+ if (dataSource) {
283
+ ids.forEach(otherTagIds => {
284
+ dataSource.forEach(child => {
285
+ if (child.id == otherTagIds) {
286
+ child.checked = false;
287
+ child.itemObject.checked = false;
288
+ }
289
+ else if (child.items) {
290
+ onRemoveItems(id, otherTagIds, child.items);
291
+ }
292
+ });
293
+ });
294
+ }
295
+ };
296
+ const onRemoveItems = (id, itemId, items) => {
297
+ if (items) {
298
+ items.forEach(item => {
299
+ if (item.id == itemId) {
300
+ item.checked = false;
301
+ item.itemObject.checked = false;
302
+ indeterminateStatus(id, item.parentId);
303
+ }
304
+ else if (item.items) {
305
+ onRemoveItems(id, itemId, item.items);
306
+ }
307
+ });
308
+ }
309
+ };
310
+ const addChecked = (id, ids) => {
311
+ const value = getValue$1(id);
312
+ if (value) {
313
+ ids.forEach(item => {
314
+ checkedItem(id, item);
315
+ });
316
+ }
317
+ };
318
+ const checkedItem = (id, itemId) => {
319
+ findItem(id, itemId);
320
+ };
321
+ const findItem = (id, itemId, items) => {
322
+ itemId = Array.isArray(itemId) ? itemId : [itemId];
323
+ let dataSource;
324
+ if (items) {
325
+ dataSource = items;
326
+ }
327
+ else {
328
+ const value = getValue$1(id);
329
+ dataSource = value.dataSource;
330
+ }
331
+ if (dataSource) {
332
+ dataSource.forEach(item => {
333
+ if (itemId.includes(item.id)) {
334
+ checkedProcess(id, item);
335
+ if (item.parentId) {
336
+ indeterminateStatus(id, item.parentId);
337
+ }
338
+ }
339
+ else if (item.items) {
340
+ findItem(id, itemId, item.items);
341
+ }
342
+ });
343
+ }
344
+ };
345
+ const checkedProcess = (id, item, status) => {
346
+ const value = getValue$1(id);
347
+ if (value) {
348
+ const treeview = value.options.treeview;
349
+ if (item) {
350
+ // && !item.hidden => select all bastığımızda hidden olanları seçmemesi içindi
351
+ if (treeview || (!treeview && item.type != "group")) {
352
+ if (!item.disabled) {
353
+ if (status != undefined) {
354
+ item.checked = status;
355
+ }
356
+ else {
357
+ item.checked = !item.checked;
358
+ }
359
+ item.itemObject.checked = item.checked;
360
+ item.indeterminate = item.checked ? "determinate" : "uncheck";
361
+ }
362
+ }
363
+ if (item.items) {
364
+ item.items.forEach(child => {
365
+ checkedProcess(id, child, status == undefined ? item.checked : status);
366
+ });
367
+ }
368
+ }
369
+ }
370
+ };
371
+ const indeterminateStatus = (id, itemId, items) => {
372
+ let dataSource;
373
+ if (items) {
374
+ dataSource = items;
375
+ }
376
+ else {
377
+ const value = getValue$1(id);
378
+ dataSource = value.dataSource;
379
+ }
380
+ if (dataSource) {
381
+ dataSource.forEach(item => {
382
+ if (item.id == itemId) {
383
+ let allChecked = true;
384
+ let allUnchecked = true;
385
+ if (item.items) {
386
+ item.items.map(child => {
387
+ (child.checked || child.indeterminate === "indeterminate") && (allUnchecked = false);
388
+ !child.checked && (allChecked = false);
389
+ });
390
+ }
391
+ const indeterminateState = !allChecked && !allUnchecked ? "indeterminate" : allChecked ? "determinate" : "uncheck";
392
+ item.indeterminate = indeterminateState;
393
+ item.checked = indeterminateState == "determinate" ? true : false;
394
+ item.itemObject.checked = item.checked;
395
+ if (item.parentId) {
396
+ indeterminateStatus(id, item.parentId);
397
+ }
398
+ }
399
+ else if (item.items) {
400
+ indeterminateStatus(id, itemId, item.items);
401
+ }
402
+ });
403
+ }
404
+ };
405
+ const filterData = (id, ids, items, searchOtherTag) => {
406
+ let checkeds = [];
407
+ let visibled = [];
408
+ getValue$1(id).isSearchOtherTag = searchOtherTag;
409
+ let dataSource;
410
+ if (items) {
411
+ dataSource = items;
412
+ }
413
+ else {
414
+ const value = getValue$1(id);
415
+ dataSource = value.dataSource;
416
+ }
417
+ if (dataSource) {
418
+ dataSource.forEach(item => {
419
+ if (ids) {
420
+ item.hidden = true;
421
+ // const filter = ids.find((find) => find.id === item.id)
422
+ var filter;
423
+ for (let index = 0; index < ids.length; index++) {
424
+ if (ids[index].id === item.id) {
425
+ filter = ids[index];
426
+ break;
427
+ }
428
+ }
429
+ if (filter) {
430
+ item.hidden = false;
431
+ if (!getValue$1(id).isSearchOtherTag) {
432
+ item.isSearching = true;
433
+ }
434
+ visibled.push(item);
435
+ if (item.checked) {
436
+ checkeds.push(item);
437
+ }
438
+ if (filter.items) {
439
+ const { checkedItems, visibledItems } = filterData(id, filter.items, item.items, searchOtherTag);
440
+ if (checkedItems) {
441
+ checkeds = [...new Set([...checkeds, ...checkedItems])];
442
+ }
443
+ if (visibledItems) {
444
+ visibled = [...new Set([...visibled, ...visibledItems])];
445
+ }
446
+ }
447
+ }
448
+ }
449
+ else {
450
+ item.hidden = false;
451
+ if (item.items) {
452
+ filterData(id, null, item.items);
453
+ }
454
+ visibled.push(item);
455
+ item.isSearching = false;
456
+ }
457
+ });
458
+ }
459
+ return { checkedItems: checkeds !== null && checkeds !== void 0 ? checkeds : [], visibledItems: visibled !== null && visibled !== void 0 ? visibled : [] };
460
+ };
461
+ const getSelected = (id, items) => {
462
+ let dataSource;
463
+ let selected = null;
464
+ if (items) {
465
+ dataSource = items;
466
+ }
467
+ else {
468
+ const value = getValue$1(id);
469
+ dataSource = value.dataSource;
470
+ }
471
+ if (dataSource) {
472
+ dataSource.forEach(item => {
473
+ if (item.selected) {
474
+ selected = item.itemObject;
475
+ }
476
+ else if (item.items) {
477
+ const found = getSelected(id, item.items);
478
+ if (found) {
479
+ selected = found;
480
+ }
481
+ }
482
+ });
483
+ }
484
+ return selected;
485
+ };
486
+ const getCheckedList = (id, items) => {
487
+ let dataSource;
488
+ let checkedList = [];
489
+ let nestedResult = [];
490
+ if (items) {
491
+ dataSource = items;
492
+ }
493
+ else {
494
+ const value = getValue$1(id);
495
+ dataSource = value.dataSource;
496
+ }
497
+ if (dataSource) {
498
+ dataSource.forEach(item => {
499
+ var _a;
500
+ const newItem = Object.assign(Object.assign({}, item.itemObject), { ct: item.ct });
501
+ let foundChild = [];
502
+ let foundItem = [];
503
+ if (item.checked) {
504
+ checkedList.push(newItem);
505
+ foundItem.push(Object.assign(Object.assign({}, newItem), { items: [] }));
506
+ }
507
+ if (item.items) {
508
+ const found = getCheckedList(id, item.items);
509
+ if (((_a = found === null || found === void 0 ? void 0 : found.checkedList) === null || _a === void 0 ? void 0 : _a.length) > 0) {
510
+ checkedList = [...checkedList, ...found.checkedList];
511
+ }
512
+ if (found.nestedResult.length > 0) {
513
+ foundChild = found.nestedResult;
514
+ }
515
+ }
516
+ if (foundChild.length > 0) {
517
+ if (foundItem.length == 0) {
518
+ foundItem.push(Object.assign(Object.assign({}, newItem), { items: [] }));
519
+ }
520
+ foundItem[0].items = foundChild;
521
+ nestedResult.push(foundItem[0]);
522
+ }
523
+ else {
524
+ if (foundItem.length > 0) {
525
+ foundItem[0].items = foundChild;
526
+ nestedResult.push(foundItem[0]);
527
+ }
528
+ }
529
+ });
530
+ }
531
+ return { checkedList: (checkedList === null || checkedList === void 0 ? void 0 : checkedList.length) > 0 ? checkedList : null, nestedResult: nestedResult };
532
+ };
533
+ const selectedItem = (id, itemId, items) => {
534
+ let dataSource;
535
+ let selected = [];
536
+ if (items) {
537
+ dataSource = items;
538
+ }
539
+ else {
540
+ const value = getValue$1(id);
541
+ dataSource = value.dataSource;
542
+ }
543
+ if (dataSource) {
544
+ dataSource.forEach(item => {
545
+ if (itemId) {
546
+ if (item.id == itemId) {
547
+ // if (!item.selected){
548
+ item.selected = true;
549
+ item.itemObject.selected = item.selected;
550
+ // }
551
+ }
552
+ else {
553
+ if (item.selected) {
554
+ item.selected = false;
555
+ item.itemObject.selected = item.selected;
556
+ }
557
+ }
558
+ }
559
+ if (item.items) {
560
+ const found = selectedItem(id, itemId, item.items);
561
+ if ((found === null || found === void 0 ? void 0 : found.length) > 0) {
562
+ selected = [...selected, ...found];
563
+ }
564
+ }
565
+ if (item.selected) {
566
+ selected.push(item.itemObject);
567
+ }
568
+ });
569
+ }
570
+ return selected && selected.length > 0 ? selected : null;
571
+ };
572
+ const setClear = (id, items) => {
573
+ let dataSource;
574
+ if (items) {
575
+ dataSource = items;
576
+ }
577
+ else {
578
+ const value = getValue$1(id);
579
+ dataSource = value.dataSource;
580
+ }
581
+ if (dataSource) {
582
+ dataSource.forEach(item => {
583
+ var _a, _b, _c;
584
+ item.checked && (item.checked = false);
585
+ item.selected && (item.selected = false);
586
+ item.indeterminate && (item.indeterminate = "uncheck");
587
+ ((_a = item.itemObject) === null || _a === void 0 ? void 0 : _a.checked) && (item.itemObject.checked = false);
588
+ ((_b = item.itemObject) === null || _b === void 0 ? void 0 : _b.selected) && (item.itemObject.selected = false);
589
+ ((_c = item.itemObject) === null || _c === void 0 ? void 0 : _c.indeterminate) && (item.itemObject.indeterminate = "uncheck");
590
+ if (item.items) {
591
+ setClear(id, item.items);
592
+ }
593
+ });
594
+ }
595
+ };
596
+ const selectAll = (id, status) => {
597
+ const dataSource = getValue$1(id).dataSource;
598
+ if (dataSource) {
599
+ dataSource.forEach(item => {
600
+ checkedProcess(id, item, status);
601
+ });
602
+ }
603
+ };
604
+ const updateOptions = (id, options) => {
605
+ Object.keys(getValue$1(id).options).forEach(key => {
606
+ getValue$1(id).options[key] = options[key];
607
+ });
608
+ };
609
+ const removeState = id => {
610
+ return Promise.resolve(state$1.value.delete(id));
611
+ };
612
+ const listState = {
613
+ setValue: setValue$1,
614
+ removeValue: removeValue$1,
615
+ getValue: getValue$1,
616
+ getData,
617
+ getDataPagination: getDataPagination$1,
618
+ openGroup,
619
+ checkedItem,
620
+ filterData,
621
+ getSelected,
622
+ getCheckedList,
623
+ selectedItem,
624
+ addChecked,
625
+ setClear,
626
+ selectAll,
627
+ removeOtherTags,
628
+ onRemoveItems,
629
+ updateOptions,
630
+ removeState,
631
+ };
632
+
633
+ class KeyControl {
634
+ constructor(keyCode, element, elementName, childElementName) {
635
+ this.elementName = '';
636
+ this.childElementName = '';
637
+ this.keyCode = keyCode;
638
+ this.element = element;
639
+ this.elementName = elementName;
640
+ this.childElementName = childElementName;
641
+ }
642
+ getKeyCode() {
643
+ return this.keyCode;
644
+ }
645
+ getElementName() {
646
+ return this.elementName;
647
+ }
648
+ getChildElementName() {
649
+ return this.childElementName;
650
+ }
651
+ getFocusedElementName() {
652
+ return this.getElementName() + '.focused';
653
+ }
654
+ getFocusedElement() {
655
+ return this.element.querySelectorAll(this.getFocusedElementName())[0] || null;
656
+ }
657
+ getFirstElement() {
658
+ return this.element.querySelectorAll(this.getElementName())[0] || null;
659
+ }
660
+ getNextElement() {
661
+ var _a;
662
+ return ((_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.nextElementSibling) || this.getFirstElement();
663
+ }
664
+ getPreviousElement() {
665
+ var _a;
666
+ return ((_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.previousElementSibling) || this.getFirstElement();
667
+ }
668
+ getChildElement() {
669
+ var _a;
670
+ return ((_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.querySelectorAll(this.getChildElementName())[0]) || null;
671
+ }
672
+ getParentElement(element) {
673
+ if (element && element) {
674
+ const isRootElement = element && element.attributes['data-isroot'];
675
+ if (isRootElement) {
676
+ return element;
677
+ }
678
+ return this.getParentElement(element.parentNode);
679
+ }
680
+ }
681
+ focusElementIsOpen() {
682
+ var _a;
683
+ return ((_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.classList.contains('bcm-list__item--open')) || false;
684
+ }
685
+ isRootElement() {
686
+ var _a;
687
+ return ((_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.querySelectorAll(this.getChildElementName()).length) > 0;
688
+ }
689
+ isRootElementIsOpen() {
690
+ return this.getFocusedElement().classList.contains('bcm-list__item--open');
691
+ }
692
+ getFocusedChildElement() {
693
+ var _a;
694
+ return ((_a = this.getChildElement()) === null || _a === void 0 ? void 0 : _a.querySelectorAll('.focused')[0]) || null;
695
+ }
696
+ isLastElement() {
697
+ var _a;
698
+ return ((_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.nextElementSibling) === null;
699
+ }
700
+ focusParentElementFirstChild() {
701
+ var _a, _b;
702
+ return this.setFocus((_b = (_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.firstChild);
703
+ }
704
+ isFirstElement() {
705
+ var _a;
706
+ return ((_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.previousElementSibling) === null;
707
+ }
708
+ focusRootElement() {
709
+ var _a, _b, _c;
710
+ 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);
711
+ }
712
+ nextRootElement() {
713
+ var _a, _b, _c;
714
+ 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);
715
+ }
716
+ findFocusElementParent() {
717
+ return this.getFocusedElement().parentNode.querySelectorAll('.bcm-list__item--open');
718
+ }
719
+ getLastElement() {
720
+ return this.element.querySelectorAll(this.getElementName())[this.element.querySelectorAll(this.getElementName()).length - 1] || null;
721
+ }
722
+ setFocus(element) {
723
+ element.focus();
724
+ }
725
+ }
726
+
727
+ class ListKeyControl extends KeyControl {
728
+ constructor(keyCode, element, treeview, checkBoxes) {
729
+ super(keyCode, element, '.bcm-list__item', '.bcm-list__item-childs');
730
+ this.isTreeview = false;
731
+ this.isCheckBoxes = false;
732
+ this.isTreeview = treeview;
733
+ this.isCheckBoxes = checkBoxes;
734
+ }
735
+ keyUpControl() {
736
+ if (this.isTreeview) {
737
+ this.keyUpTreeview();
738
+ }
739
+ else {
740
+ if (this.isFirstElement()) {
741
+ this.setFocus(this.getLastElement());
742
+ }
743
+ else {
744
+ this.setFocus(this.getPreviousElement());
745
+ }
746
+ }
747
+ }
748
+ keyDownTreeView() {
749
+ var _a;
750
+ if (this.isTreeview) {
751
+ if (this.isRootElement() && this.isRootElementIsOpen()) {
752
+ const childs = this.getChildElement();
753
+ if (childs) {
754
+ this.setFocus(childs.firstChild);
755
+ }
756
+ }
757
+ else {
758
+ if (this.isLastElement() && this.getParentElement(this.getFocusedElement())) {
759
+ this.setFocus((_a = this.getParentElement(this.getFocusedElement())) === null || _a === void 0 ? void 0 : _a.nextElementSibling);
760
+ }
761
+ else {
762
+ this.setFocus(this.getNextElement());
763
+ }
764
+ }
765
+ }
766
+ }
767
+ keyUpTreeview() {
768
+ if (this.isFirstElement()) {
769
+ const parent = this.getParentElement(this.getFocusedElement());
770
+ this.setFocus(parent);
771
+ }
772
+ else {
773
+ const previousElement = this.getPreviousElement();
774
+ if (previousElement) {
775
+ if (previousElement.classList.contains('bcm-list__item--open')) {
776
+ const getChildElement = previousElement.querySelectorAll(this.getChildElementName())[0];
777
+ console.log({ getChildElement });
778
+ this.setFocus(getChildElement.lastChild);
779
+ }
780
+ else {
781
+ this.setFocus(previousElement);
782
+ }
783
+ }
784
+ }
785
+ }
786
+ keyDownControl() {
787
+ if (this.isTreeview) {
788
+ this.keyDownTreeView();
789
+ }
790
+ else {
791
+ if (this.isLastElement()) {
792
+ this.setFocus(this.getFirstElement());
793
+ }
794
+ else {
795
+ this.setFocus(this.getNextElement());
796
+ }
797
+ }
798
+ }
799
+ keyRightControl() {
800
+ if (this.isTreeview) {
801
+ if (!this.isRootElementIsOpen() && this.isRootElement()) {
802
+ const { id } = this.getFocusedElement();
803
+ this.openGroup(id);
804
+ }
805
+ }
806
+ }
807
+ keyLeftControl() {
808
+ if (this.isTreeview) {
809
+ if (this.isRootElementIsOpen() && this.isRootElement()) {
810
+ const { id } = this.getFocusedElement();
811
+ this.openGroup(id);
812
+ }
813
+ }
814
+ }
815
+ keyEnterControl() { }
816
+ keySpaceControl() {
817
+ if (this.isCheckBoxes) {
818
+ const { id } = this.getFocusedElement();
819
+ this.checkedItem(id);
820
+ }
821
+ }
822
+ keyDown() {
823
+ switch (this.getKeyCode()) {
824
+ case Bcm.KeyCode.up:
825
+ this.keyUpControl();
826
+ break;
827
+ case Bcm.KeyCode.down:
828
+ this.keyDownControl();
829
+ break;
830
+ case Bcm.KeyCode.left:
831
+ this.keyLeftControl();
832
+ break;
833
+ case Bcm.KeyCode.right:
834
+ this.keyRightControl();
835
+ break;
836
+ case Bcm.KeyCode.enter:
837
+ this.keyEnterControl();
838
+ break;
839
+ case Bcm.KeyCode.space:
840
+ this.keySpaceControl();
841
+ break;
842
+ }
843
+ }
844
+ keyUp() { }
845
+ }
846
+
847
+ 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\"); .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}.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{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{display:none;opacity:0;visibility:hidden;position:absolute;top:0;left:0;height:0;width:0;transform:translateY(10%);z-index:10800}.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{transition:transform 50ms;display:flex}.bcm-list__container.bcm-list__type-linked-component.is-open-animation,.bcm-list__container.bcm-list__type-select.is-open-animation,.bcm-list__container.bcm-list__type-autocomplete.is-open-animation{opacity:1;transform:translateY(0);visibility:visible}.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:0 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-700);transition:background-color 0.2s ease}.bcm-list__item-content.disabled{color:var(--bcm-new-ds-color-slate-400);background-color:var(--bcm-new-ds-color-slate-200);user-select:none;cursor:not-allowed}.bcm-list__item-content.readonly{color:var(--bcm-new-ds-color-slate-500);background-color:var(--bcm-new-ds-color-slate-100);cursor:default}.bcm-list__item-content.readonly .bcm-list__item-content-collapse-icon{color:var(--bcm-new-ds-color-slate-700);cursor:pointer}.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):not(.readonly){color:var(--bcm-new-ds-color-white);background-color:var(--bcm-new-ds-color-blue-600)}.bcm-list__item-content:hover:not(.disabled):not(.readonly){background-color:var(--bcm-new-ds-color-slate-100)}.bcm-list__item-content:active:not(.disabled):not(.readonly){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--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}";
848
+
849
+ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
850
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
851
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
852
+ r = Reflect.decorate(decorators, target, key, desc);
853
+ else
854
+ for (var i = decorators.length - 1; i >= 0; i--)
855
+ if (d = decorators[i])
856
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
857
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
858
+ };
859
+ const BcmList = class {
860
+ constructor(hostRef) {
861
+ registerInstance(this, hostRef);
862
+ this.bcmChecklist = createEvent(this, "bcm-checklist", 7);
863
+ this.bcmSelected = createEvent(this, "bcm-selected", 7);
864
+ this.change = createEvent(this, "bcm-change", 7);
865
+ this.open = createEvent(this, "bcm-open", 3);
866
+ this.close = createEvent(this, "bcm-close", 3);
867
+ this.listClose = createEvent(this, "bcm-list-close", 7);
868
+ this.listOpen = createEvent(this, "bcm-list-open", 7);
869
+ this.debounce = null;
870
+ this.debounceHandler = Generate.debounceInput(() => this.listenResize(), 300, false);
871
+ this._id = Generate.UID();
872
+ this.tempId = Generate.UID();
873
+ this.type = Bcm$1.ListType.listbox;
874
+ this.treeview = false;
875
+ this.checkboxes = false;
876
+ this.searchable = false;
877
+ this.value = null;
878
+ this.inputText = undefined;
879
+ this.name = undefined;
880
+ this.label = undefined;
881
+ this.size = Bcm$1.Size.medium;
882
+ this.disabled = false;
883
+ this.readonly = false;
884
+ this.highlight = false;
885
+ this.highlightText = undefined;
886
+ this.required = false;
887
+ this.hidden = false;
888
+ this.fullWidth = false;
889
+ this.height = "256px";
890
+ this.maxHeight = "500px";
891
+ this.minHeight = "150px";
892
+ this.width = "256px";
893
+ this.tooltip = undefined;
894
+ this.infoFooter = false;
895
+ this.variableText = "item";
896
+ this.template = undefined;
897
+ this.allOpen = false;
898
+ this.keyControl = false;
899
+ this.checkAll = true;
900
+ this.stopDeepClean = false;
901
+ this.openIntersecting = false;
902
+ this.linkedComponent = undefined;
903
+ this.isOpen = false;
904
+ this.isOpenAnimation = false;
905
+ this.calculatedViewport = false;
906
+ this.isSelectedOther = false;
907
+ this.isHaveOtherTag = false;
908
+ this.placeholder = "Choose an option";
909
+ this.searchPlaceholder = "Search";
910
+ this.searchIsOnlyChilds = false;
911
+ this.minSearchLength = 2;
912
+ this.clearable = false;
913
+ this.caption = undefined;
914
+ this.noCaption = false;
915
+ this.captionType = Bcm$1.Status.default;
916
+ this.captionError = undefined;
917
+ this.emptyText = undefined;
918
+ this.emptyIcon = "fad fa-folder-open";
919
+ this.captionCache = undefined;
920
+ this.captionTypeCache = undefined;
921
+ this.tick = {};
922
+ this.totalData = 0;
923
+ this.totalRootData = 0;
924
+ this.limit = 20;
925
+ this.searchGetParents = undefined;
926
+ this.searchResultLimit = 20;
927
+ this.searchFound = null;
928
+ this.returnFilterData = {};
929
+ this.returnOtherData = {};
930
+ this.options = {
931
+ rootMargin: "30px",
932
+ };
933
+ this.tagContainerWidth = 0;
934
+ this.selectAllItem = {
935
+ id: "select-all",
936
+ text: "Select All",
937
+ value: "select-all",
938
+ checked: false,
939
+ disabled: false,
940
+ icon: "",
941
+ status: Bcm$1.Status.default,
942
+ indeterminate: "uncheck",
943
+ };
944
+ this.shouldTriggerChange = undefined;
945
+ this.placement = Bcm$1.Placement["bottom-start"];
946
+ this.disableChangeEvent = false;
947
+ this.data = [];
948
+ window.addEventListener("scroll", this.handleWheel.bind(this), true);
949
+ window.addEventListener("wheel", this.handleWheel.bind(this), true);
950
+ window.addEventListener("resize", this.handleResize.bind(this), true);
951
+ }
952
+ connectedCallback() {
953
+ if (this.height != "256px") {
954
+ if (this.height.indexOf("px") > -1) {
955
+ this.limit = Math.floor(+this.height.replace("px", "") / 10);
956
+ }
957
+ else {
958
+ this.limit = Math.floor(+(window.innerHeight / 10));
959
+ }
960
+ this.searchResultLimit = this.limit;
961
+ this.markForCheck();
962
+ }
963
+ const checkElementWithDom = document.querySelectorAll(`#bcm-list-${this._id}`);
964
+ (checkElementWithDom === null || checkElementWithDom === void 0 ? void 0 : checkElementWithDom.length) > 1 && checkElementWithDom.forEach((item, index) => index > 0 && item.remove());
965
+ }
966
+ componentWillRender() {
967
+ this.calculateLocation();
968
+ }
969
+ componentShouldUpdate(newVal, oldVal, propName) {
970
+ if (Object.keys(this.getOptions()).indexOf(propName) > -1 && newVal !== oldVal) {
971
+ this.updateOptions();
972
+ }
973
+ }
974
+ get containerWidth() {
975
+ var _a, _b;
976
+ return (_b = (_a = this.el) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) === null || _b === void 0 ? void 0 : _b.width;
977
+ }
978
+ get tagCount() {
979
+ return this.containerWidth > 0 ? Math.floor(+(this.containerWidth - 100) / 85) : 0;
980
+ }
981
+ get tagData() {
982
+ return snq(() => {
983
+ var _a;
984
+ return (_a = this.value) === null || _a === void 0 ? void 0 : _a.map(item => ({
985
+ value: item.id,
986
+ label: StringHelper.textLimitter(item.text, 7),
987
+ text: item.tooltipMessage || item.tagTitle || Generate.domParser(item.text),
988
+ }));
989
+ }, []);
990
+ }
991
+ async componentDidLoad() {
992
+ await this.initState();
993
+ // if (this.type == "select" || this.type == "autocomplete" || this.linkedComponent) {
994
+ // const list = this.el.querySelector(`#bcm-list-${this._id}`);
995
+ // if (list) {
996
+ // document.body.appendChild(list);
997
+ // }
998
+ // }
999
+ }
1000
+ disconnectedCallback() {
1001
+ this.isOpen = false;
1002
+ if (this.stopDeepClean)
1003
+ return;
1004
+ listState.removeState(this._id);
1005
+ this.el.innerHTML = "";
1006
+ if (this.type == "select" || this.type == "autocomplete" || this.linkedComponent) {
1007
+ const list = document.querySelectorAll(`#bcm-list-${this._id}`);
1008
+ if (list === null || list === void 0 ? void 0 : list.length) {
1009
+ list.forEach(item => item.remove());
1010
+ this.el.remove();
1011
+ }
1012
+ }
1013
+ }
1014
+ watchId(_, oldVal) {
1015
+ // console.info('Changed component id:', oldVal + ' -> ' + newVal);
1016
+ listState.removeState(oldVal);
1017
+ this.initState();
1018
+ }
1019
+ handleValueChange(newVal, oldVal) {
1020
+ var _a, _b;
1021
+ if (Generate.objectIsEmpty(this.returnFilterData)) {
1022
+ this.handleIndeterminate(((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) || 0, this.totalData);
1023
+ }
1024
+ if (this.checkboxes) {
1025
+ if (!Validators.compareTwoArrayIsSame(newVal, oldVal)) {
1026
+ this.bcmChecklist.emit(this.value);
1027
+ if (!this.disableChangeEvent) {
1028
+ if (this.shouldTriggerChange) {
1029
+ const val = ((_b = this.value) === null || _b === void 0 ? void 0 : _b.length)
1030
+ ? [...this.value].map(item => (Object.assign(Object.assign({}, item), (this.shouldTriggerChange && { shouldTriggerChange: this.shouldTriggerChange }))))
1031
+ : null;
1032
+ this.change.emit(val);
1033
+ }
1034
+ else {
1035
+ this.change.emit(this.value);
1036
+ }
1037
+ }
1038
+ }
1039
+ }
1040
+ else {
1041
+ if ((newVal === null || newVal === void 0 ? void 0 : newVal.id) != (oldVal === null || oldVal === void 0 ? void 0 : oldVal.id)) {
1042
+ !this.disableChangeEvent &&
1043
+ this.change.emit(this.value
1044
+ ? Object.assign(Object.assign({}, this.value), (this.shouldTriggerChange && { shouldTriggerChange: this.shouldTriggerChange })) : null);
1045
+ }
1046
+ }
1047
+ }
1048
+ watchReturnFilterData(newVal) {
1049
+ var _a;
1050
+ const { checkedItems, visibledItems } = newVal;
1051
+ if (checkedItems && visibledItems) {
1052
+ this.handleIndeterminate(checkedItems.length, visibledItems.length);
1053
+ }
1054
+ else {
1055
+ this.handleIndeterminate(((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) || 0, this.totalData);
1056
+ }
1057
+ }
1058
+ async handleOpen() {
1059
+ if (this.isOpen) {
1060
+ this.detectClone();
1061
+ if (this.type == "select" || this.type == "autocomplete" || this.linkedComponent) {
1062
+ const list = this.el.querySelector(`#bcm-list-${this._id}`);
1063
+ if (list) {
1064
+ const bcmOverlayContainer = document.querySelector("#bcm-overlay-container");
1065
+ bcmOverlayContainer.appendChild(list);
1066
+ }
1067
+ }
1068
+ this.open.emit();
1069
+ this.calculateLocation();
1070
+ this.onSelectSearch();
1071
+ await delay(50);
1072
+ this.isOpenAnimation = true;
1073
+ }
1074
+ else {
1075
+ this.isOpenAnimation = false;
1076
+ this.listScrollToTop();
1077
+ this.close.emit();
1078
+ this.listClose.emit();
1079
+ await delay(100);
1080
+ this.unSelectOther();
1081
+ }
1082
+ }
1083
+ listScrollToTop() {
1084
+ const list = document.querySelector(`#bcm-list-${this._id}`);
1085
+ if (list) {
1086
+ list.querySelector(".scrolling").scrollTop = 0;
1087
+ }
1088
+ }
1089
+ async dataChanged(newValue, oldValue) {
1090
+ if (!Validators.compareTwoArrayIsSame(newValue, oldValue)) {
1091
+ await this.initState();
1092
+ }
1093
+ }
1094
+ isIntersecting(e) {
1095
+ const target = e === null || e === void 0 ? void 0 : e.target;
1096
+ if (target && target.id === this._id) {
1097
+ this.listenResize();
1098
+ }
1099
+ }
1100
+ handleSlotItems(e) {
1101
+ var _a;
1102
+ if (((_a = e === null || e === void 0 ? void 0 : e.detail) === null || _a === void 0 ? void 0 : _a.length) > 0) {
1103
+ this.data = e.detail;
1104
+ }
1105
+ }
1106
+ handleChange(e) {
1107
+ if (e.target.id == `bcm-list-input-tag-container-${this._id}-autocomplete-input`) {
1108
+ e.stopImmediatePropagation();
1109
+ }
1110
+ }
1111
+ handleResize() {
1112
+ this.calculateLocation();
1113
+ this.debounceHandler();
1114
+ }
1115
+ handleWheel(event) {
1116
+ if (this.isOpen) {
1117
+ const list = document.querySelector(`#bcm-list-${this._id}`);
1118
+ const isClickInside = list && Generate.findEventPath(event, list);
1119
+ if (isClickInside) {
1120
+ if (this.type == "select" || this.type == "autocomplete" || this.linkedComponent) {
1121
+ this.calculateLocation();
1122
+ }
1123
+ }
1124
+ else {
1125
+ this.hide();
1126
+ }
1127
+ }
1128
+ }
1129
+ clearAutocomplete() {
1130
+ if (this.type == "autocomplete") {
1131
+ const autocompleteInput = this.getAutoCompleteInput();
1132
+ if (autocompleteInput) {
1133
+ autocompleteInput.handleClear(false);
1134
+ }
1135
+ }
1136
+ }
1137
+ async handleSelectOtherTag(e) {
1138
+ if (this.disabled)
1139
+ return;
1140
+ const { id, checked } = e.detail;
1141
+ this.isSelectedOther = checked;
1142
+ if (id) {
1143
+ checked ? this.filterOtherList(id) : this.unSelectOther();
1144
+ this.isOpen = true;
1145
+ }
1146
+ }
1147
+ async handleDeleteTag(e) {
1148
+ var _a;
1149
+ if (this.disabled)
1150
+ return;
1151
+ const { id } = e.detail;
1152
+ this.isSelectedOther && this.unSelectOther();
1153
+ Array.isArray(id) ? listState.removeOtherTags(this._id, id) : listState.checkedItem(this._id, id);
1154
+ this.value = (await this.getCheckedList()).checkedList;
1155
+ this.handleIndeterminate(((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) || 0, this.totalData);
1156
+ }
1157
+ async handleSelectTag(_) {
1158
+ if (this.disabled)
1159
+ return;
1160
+ this.clearAutocomplete();
1161
+ this.onSelectSearch();
1162
+ this.unSelectOther();
1163
+ }
1164
+ handleClick(event) {
1165
+ var _a;
1166
+ if (this.disabled)
1167
+ return;
1168
+ const list = document.querySelector(`#bcm-list-${this._id}`);
1169
+ const isClickInside = Generate.findEventPath(event, this.el) || (list && Generate.findEventPath(event, list));
1170
+ if (isClickInside) {
1171
+ if (this.debounce !== null) {
1172
+ event.preventDefault();
1173
+ event.stopPropagation();
1174
+ clearTimeout(this.debounce);
1175
+ this.debounce = null;
1176
+ }
1177
+ this.debounce = setTimeout(() => {
1178
+ this.debounce = null;
1179
+ }, 300);
1180
+ }
1181
+ if (!isClickInside) {
1182
+ if (this.type == "autocomplete") {
1183
+ const autocompleteInput = this.getAutoCompleteInput();
1184
+ if (autocompleteInput) {
1185
+ if (this.checkboxes) {
1186
+ autocompleteInput.setValue("");
1187
+ }
1188
+ else {
1189
+ autocompleteInput.setValue(((_a = this.value) === null || _a === void 0 ? void 0 : _a.text) || "");
1190
+ }
1191
+ }
1192
+ }
1193
+ }
1194
+ const clickToTag = Generate.findEventPathWithKey(event, "className", ["bcm-tag"]);
1195
+ const clickToOtherTag = Generate.findEventPathWithKey(event, "className", ["bcm-tag bcm-tag--other"]);
1196
+ const clickToSelect = Generate.findEventPathWithKey(event, "id", [`bcm-list-input-${this._id}`, `bcm-list-label-${this._id}`]);
1197
+ const clickToTagDismiss = Generate.findEventPathWithKey(event, "className", ["right close-button"]);
1198
+ if (clickToSelect && !clickToTagDismiss && this.type != "autocomplete") {
1199
+ this.isOpen = clickToTag || clickToOtherTag ? true : !this.isOpen;
1200
+ }
1201
+ if (list) {
1202
+ if (this.isOpen) {
1203
+ if (!list.contains(event.target) && !this.el.contains(event.target)) {
1204
+ this.isOpen = false;
1205
+ // this.unSelectOther()
1206
+ }
1207
+ }
1208
+ }
1209
+ }
1210
+ bcmOnSearchClear(event) {
1211
+ var _a, _b;
1212
+ if (this.type == "autocomplete") {
1213
+ 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`) {
1214
+ if (event.detail) {
1215
+ this.setClear();
1216
+ }
1217
+ }
1218
+ }
1219
+ }
1220
+ bcmOnSearch(event) {
1221
+ var _a, _b, _c, _d, _e, _f;
1222
+ 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`) {
1223
+ this.searchGetParents = snq(() => { var _a; return (_a = event.detail) === null || _a === void 0 ? void 0 : _a.parentIndex; }, null);
1224
+ this.searchResultLimit = 10;
1225
+ 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;
1226
+ this.returnFilterData = listState.filterData(this._id, (_e = event.detail) === null || _e === void 0 ? void 0 : _e.nestedResult);
1227
+ if (this.searchFound > 0 && this.highlight) {
1228
+ this.highlightText = (_f = event.detail) === null || _f === void 0 ? void 0 : _f.value;
1229
+ }
1230
+ if (this.type == "autocomplete") {
1231
+ this.isOpen = true;
1232
+ }
1233
+ if (!event.detail.result) {
1234
+ if (this.type == "autocomplete") {
1235
+ this.isOpen = false;
1236
+ }
1237
+ else {
1238
+ this.returnFilterData = {};
1239
+ listState.filterData(this._id, null);
1240
+ }
1241
+ // this.isSelectedOther = false
1242
+ this.searchResultLimit = null;
1243
+ this.highlightText = null;
1244
+ }
1245
+ this.markForCheck();
1246
+ }
1247
+ }
1248
+ //keyboard navigation
1249
+ handleKeyDown(ev) {
1250
+ const keycode = ev.keyCode || ev.which;
1251
+ if (keycode === Bcm$1.KeyCode.escape) {
1252
+ if (this.isOpen) {
1253
+ this.isOpen = false;
1254
+ ev.preventDefault();
1255
+ ev.stopPropagation();
1256
+ ev.stopImmediatePropagation();
1257
+ }
1258
+ }
1259
+ if (this.keyControl) {
1260
+ const keyboard = new ListKeyControl(keycode, this.el, this.treeview, this.checkboxes);
1261
+ keyboard.openGroup = openGroupId => {
1262
+ this.openGroup(openGroupId);
1263
+ };
1264
+ keyboard.checkedItem = checkedItemId => {
1265
+ this.checkedItem(checkedItemId);
1266
+ };
1267
+ keyboard.keyDown();
1268
+ }
1269
+ }
1270
+ handleKeyUp(ev) {
1271
+ if (this.keyControl) {
1272
+ const focusedList = Generate.findEventPath(ev, this.el);
1273
+ if (focusedList) {
1274
+ const list = document.getElementById(`bcm-list-${this._id}`);
1275
+ if (list) {
1276
+ const items = list.querySelectorAll(".bcm-list__item.focused");
1277
+ if (items.length > 0) {
1278
+ const main = list.querySelector("main");
1279
+ const itemHeight = items[0].offsetHeight;
1280
+ const listHeight = main.offsetHeight;
1281
+ const itemTop = items[0].offsetTop;
1282
+ if (itemTop > listHeight) {
1283
+ main.scrollTop = itemTop - listHeight / 2 + itemHeight / 2;
1284
+ }
1285
+ if (itemTop < listHeight) {
1286
+ main.scrollTop = itemTop - listHeight / 2 - itemHeight / 2;
1287
+ }
1288
+ }
1289
+ }
1290
+ }
1291
+ }
1292
+ }
1293
+ async set(data, trigger = true) {
1294
+ if (data) {
1295
+ this.shouldTriggerChange = trigger;
1296
+ if (Array.isArray(data)) {
1297
+ this.addChecked(data);
1298
+ }
1299
+ if (typeof data === "string" || typeof data === "number") {
1300
+ this.selectedItem(data);
1301
+ }
1302
+ }
1303
+ else {
1304
+ this.setClear();
1305
+ }
1306
+ }
1307
+ async get() {
1308
+ var _a, _b;
1309
+ 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;
1310
+ }
1311
+ async getCheckedList() {
1312
+ return Promise.resolve(listState.getCheckedList(this._id));
1313
+ }
1314
+ async getSelected() {
1315
+ return Promise.resolve(listState.getSelected(this._id));
1316
+ }
1317
+ async getValue() {
1318
+ return Promise.resolve(this.value);
1319
+ }
1320
+ async triggerChange(action) {
1321
+ this.shouldTriggerChange = action;
1322
+ }
1323
+ async addChecked(ids = [], save = false, emit = true) {
1324
+ if (ids && ids.length > 0) {
1325
+ if (!save) {
1326
+ listState.setClear(this._id);
1327
+ await delay(10);
1328
+ }
1329
+ await listState.addChecked(this._id, ids);
1330
+ await delay(10);
1331
+ emit && (this.value = (await this.getCheckedList()).checkedList);
1332
+ this.markForCheck();
1333
+ }
1334
+ return Promise.resolve(this.value);
1335
+ }
1336
+ async selected(id) {
1337
+ if (id) {
1338
+ return Promise.resolve(await this.selectedItem(id));
1339
+ }
1340
+ return false;
1341
+ }
1342
+ async setClear(e) {
1343
+ listState.setClear(this._id);
1344
+ this.value = null;
1345
+ this.inputText = "";
1346
+ this.isOpen = false;
1347
+ this.selectAllItem.indeterminate = "uncheck";
1348
+ this.markForCheck();
1349
+ if (e) {
1350
+ e.stopPropagation();
1351
+ e.preventDefault();
1352
+ }
1353
+ await delay(10);
1354
+ return Promise.resolve();
1355
+ }
1356
+ async resetCaption() {
1357
+ await delay(10);
1358
+ this.caption = this.captionCache;
1359
+ this.captionType = this.captionTypeCache;
1360
+ this.captionError = null;
1361
+ await delay(10);
1362
+ return Promise.resolve();
1363
+ }
1364
+ detectClone() {
1365
+ const list = document.querySelectorAll(`#bcm-list-${this._id}`);
1366
+ if (list.length > 0) {
1367
+ list.forEach((item) => {
1368
+ const tempid = item.getAttribute("temp-id");
1369
+ if (tempid !== `bcm-list-${this.tempId}`) {
1370
+ console.warn(`[bcm-list] - Detected duplicate temp-id="${tempid}"`);
1371
+ item.remove();
1372
+ }
1373
+ });
1374
+ }
1375
+ }
1376
+ async show() {
1377
+ this.isOpen = true;
1378
+ return Promise.resolve();
1379
+ }
1380
+ async hide() {
1381
+ this.isOpen = false;
1382
+ return Promise.resolve();
1383
+ }
1384
+ updateOptions() {
1385
+ listState.updateOptions(this._id, this);
1386
+ }
1387
+ handleIndeterminate(checkeds, total) {
1388
+ 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 });
1389
+ }
1390
+ listenResize() {
1391
+ this.calculateLocation();
1392
+ this.markForCheck();
1393
+ }
1394
+ async unSelectOther() {
1395
+ await this.onClearSearch();
1396
+ this.isSelectedOther = false;
1397
+ this.searchFound = null;
1398
+ this.returnFilterData = {};
1399
+ listState.filterData(this._id, null);
1400
+ await delay(10);
1401
+ return Promise.resolve();
1402
+ }
1403
+ async onClearSearch() {
1404
+ const searchInput = document.getElementById(`bcm-list-${this._id}-search`);
1405
+ if (searchInput) {
1406
+ await searchInput.handleClear();
1407
+ }
1408
+ return Promise.resolve();
1409
+ }
1410
+ async onSelectSearch() {
1411
+ const searchInput = document.getElementById(`bcm-list-${this._id}-search`);
1412
+ if (searchInput) {
1413
+ await delay(100);
1414
+ searchInput.onBcmFocus();
1415
+ searchInput.onBcmSelect();
1416
+ }
1417
+ }
1418
+ async filterOtherList(ids) {
1419
+ const checklist = (await this.getCheckedList()).nestedResult;
1420
+ const filter = Generate.convertIdsToNestedData(ids, checklist);
1421
+ this.returnFilterData = await listState.filterData(this._id, filter, null, true);
1422
+ this.searchFound = (ids === null || ids === void 0 ? void 0 : ids.length) || 0;
1423
+ this.limit = 500;
1424
+ this.searchGetParents = null;
1425
+ await delay(1000);
1426
+ this.markForCheck();
1427
+ }
1428
+ async initState() {
1429
+ var _a, _b, _c;
1430
+ this.onClearSearch();
1431
+ await listState.setValue({
1432
+ id: this._id,
1433
+ dataSource: this.data && snq(() => (typeof this.data == "string" ? JSON.parse(this.data) : this.data), []),
1434
+ options: this,
1435
+ });
1436
+ const { totalRoots, totalItems } = listState.getValue(this._id);
1437
+ this.totalData = totalItems;
1438
+ this.totalRootData = totalRoots;
1439
+ this.value = this.checkboxes ? (await this.getCheckedList()).checkedList : listState.selectedItem(this._id) ? listState.selectedItem(this._id)[0] : null;
1440
+ if (!this.checkboxes) {
1441
+ this.inputText = Generate.domParser((_a = this.value) === null || _a === void 0 ? void 0 : _a.text) || null;
1442
+ }
1443
+ // checkli olan subparentların indeterminate kontrolü için
1444
+ if (this.checkboxes && ((_b = this.value) === null || _b === void 0 ? void 0 : _b.length) > 0) {
1445
+ const checkedIDs = [];
1446
+ this.value.forEach(item => {
1447
+ if (!item.items || item.items.length === 0) {
1448
+ checkedIDs.push(item.id);
1449
+ }
1450
+ });
1451
+ await this.addChecked(checkedIDs, false, false);
1452
+ }
1453
+ await this.handleIndeterminate((_c = this.value) === null || _c === void 0 ? void 0 : _c.length, this.totalData);
1454
+ await this.markForCheck();
1455
+ }
1456
+ async markForCheck() {
1457
+ await delay(10);
1458
+ this.tick = Generate.UID();
1459
+ }
1460
+ getOptions() {
1461
+ return snq(() => listState.getValue(this._id).options, {});
1462
+ }
1463
+ getItems() {
1464
+ if (this.isSelectedOther) {
1465
+ return this.returnFilterData["checkedItems"];
1466
+ }
1467
+ return snq(() => listState.getData(this._id), []);
1468
+ }
1469
+ getLimitedItems(ids) {
1470
+ return snq(() => listState.getDataPagination(this._id, this.searchResultLimit || this.limit, ids), []);
1471
+ }
1472
+ openGroup(parentId) {
1473
+ listState.openGroup(this._id, parentId);
1474
+ this.markForCheck();
1475
+ }
1476
+ focusItem(e) {
1477
+ if (e.target.classList.contains("bcm-list__item")) {
1478
+ const item = e.target;
1479
+ const list = document.getElementById(`bcm-list-${this._id}`);
1480
+ if (list) {
1481
+ const items = list.querySelectorAll(".bcm-list__item");
1482
+ if (items.length > 0) {
1483
+ const selectedItem = list.querySelector(".bcm-list__item.focused");
1484
+ if (selectedItem) {
1485
+ selectedItem.classList.remove("focused");
1486
+ }
1487
+ item.classList.add("focused");
1488
+ }
1489
+ }
1490
+ }
1491
+ }
1492
+ async selectedItem(itemId) {
1493
+ var _a;
1494
+ if (!this.checkboxes) {
1495
+ this.value = listState.selectedItem(this._id, itemId) ? listState.selectedItem(this._id, itemId)[0] : null;
1496
+ this.inputText = Generate.domParser((_a = this.value) === null || _a === void 0 ? void 0 : _a.text) || null;
1497
+ this.isOpen = false;
1498
+ this.markForCheck();
1499
+ if (this.type == "autocomplete" && this.value) {
1500
+ // await delay(100)
1501
+ // this.resetCaption()
1502
+ const autocompleteInput = this.getAutoCompleteInput();
1503
+ if (autocompleteInput) {
1504
+ setTimeout(() => {
1505
+ var _a;
1506
+ autocompleteInput.setValue(((_a = this.value) === null || _a === void 0 ? void 0 : _a.text) || "");
1507
+ this.isOpen = false;
1508
+ }, 100);
1509
+ }
1510
+ }
1511
+ }
1512
+ return Promise.resolve(this.value);
1513
+ }
1514
+ async checkedItem(itemId) {
1515
+ const isCheckSelectAll = itemId === "select-all";
1516
+ if (!isCheckSelectAll) {
1517
+ listState.checkedItem(this._id, itemId);
1518
+ }
1519
+ else {
1520
+ listState.selectAll(this._id, !this.selectAllItem.checked);
1521
+ }
1522
+ this.value = (await this.getCheckedList()).checkedList;
1523
+ this.changeVisibleCheckeds();
1524
+ this.markForCheck();
1525
+ }
1526
+ changeVisibleCheckeds() {
1527
+ const { visibledItems } = this.returnFilterData;
1528
+ this.returnFilterData = {
1529
+ visibledItems,
1530
+ checkedItems: (visibledItems && visibledItems.filter(item => item.checked)) || [],
1531
+ };
1532
+ }
1533
+ getAutoCompleteInput() {
1534
+ return document.getElementById(`bcm-list-input-tag-container-${this._id}-autocomplete-input`);
1535
+ }
1536
+ dataScrollEvent(event) {
1537
+ let count = 0;
1538
+ let io = new IntersectionObserver((data) => {
1539
+ if (count === 0) {
1540
+ count++;
1541
+ if (data[0].isIntersecting) {
1542
+ this.limit += 15;
1543
+ this.searchResultLimit += 15;
1544
+ io.disconnect();
1545
+ io = null;
1546
+ }
1547
+ }
1548
+ }, this.options);
1549
+ io.observe(event.target.lastElementChild);
1550
+ }
1551
+ async calculateLocation() {
1552
+ var _a, _b;
1553
+ if (this.type == "select" || this.type == "autocomplete" || this.linkedComponent) {
1554
+ const list = document.getElementById(`bcm-list-${this._id}`);
1555
+ // list && (list.style.height = '256px') //sebebi neydi ki!
1556
+ var placement = this.placement;
1557
+ const targetElementId = this.linkedComponent ? this.linkedComponent : `bcm-list-input-${this._id}`;
1558
+ const targetElement = document.getElementById(targetElementId);
1559
+ if (list && targetElement) {
1560
+ getPlacement(list, targetElement, placement, (place) => (placement = place));
1561
+ await delay(10);
1562
+ let pos = setPosition(placement, targetElement);
1563
+ let captionAreaHeight = 0;
1564
+ let labelAreaHeight = 0;
1565
+ if (this.linkedComponent) {
1566
+ const linked = document.getElementById(this.linkedComponent);
1567
+ if (linked) {
1568
+ if (!linked["noCaption"]) {
1569
+ const captionArea = ((_a = linked.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".bcm-caption-area")) || linked.querySelector(".bcm-caption-area");
1570
+ if (captionArea) {
1571
+ captionAreaHeight = captionArea.offsetHeight || captionArea.clientHeight;
1572
+ }
1573
+ }
1574
+ const labelArea = ((_b = linked.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector(".bcm-label")) || linked.querySelector(".bcm-label");
1575
+ if (labelArea) {
1576
+ labelAreaHeight = labelArea.offsetHeight || labelArea.clientHeight;
1577
+ }
1578
+ }
1579
+ }
1580
+ if (this.fullWidth) {
1581
+ list.style.width = targetElement.offsetWidth + "px";
1582
+ }
1583
+ else {
1584
+ list.style.width = this.width || "auto";
1585
+ }
1586
+ if (this.height.indexOf("%") > -1) {
1587
+ list.style.height = NumberHelper.toNumber(this.height) * 0.01 * window.innerHeight - pos[0] - 50 + "px";
1588
+ }
1589
+ else {
1590
+ list.style.height = this.height;
1591
+ }
1592
+ list.style.minHeight = this.minHeight;
1593
+ // const calculatedMaxHeight = window.innerHeight - pos[0] - 50;
1594
+ const calculatedMaxHeight = placement.split("-")[0] == "top" ? window.innerHeight - (window.innerHeight - pos[0]) - 50 : window.innerHeight - pos[0] - 50;
1595
+ if (this.maxHeight.indexOf("%") > -1) {
1596
+ list.style.maxHeight = NumberHelper.toNumber(this.maxHeight) * 0.01 * calculatedMaxHeight + "px";
1597
+ }
1598
+ else {
1599
+ list.style.maxHeight = NumberHelper.toNumber(this.maxHeight) < calculatedMaxHeight ? this.maxHeight : calculatedMaxHeight + "px";
1600
+ }
1601
+ getPlacement(list, targetElement, placement, (place) => (placement = place));
1602
+ await delay(10);
1603
+ pos = setPosition(placement, targetElement);
1604
+ list.style.top = (placement.split("-")[0] == "top" ? pos[0] - list.offsetHeight + labelAreaHeight : pos[0] - captionAreaHeight) + "px";
1605
+ // list.style.left = pos[1] + 'px';
1606
+ list.style.left = placement.split("-")[1] == "end" ? pos[1] - list.offsetWidth + "px" : pos[1] + "px";
1607
+ list.classList.toggle("bcm-list--top", placement.split("-")[0] == "top");
1608
+ this.calculatedViewport = true;
1609
+ }
1610
+ }
1611
+ }
1612
+ handleTransitionEnd(e) {
1613
+ const { isOpen, type } = this;
1614
+ const propertName = e === null || e === void 0 ? void 0 : e.propertyName;
1615
+ if (isOpen && type == "select" && propertName == "transform") {
1616
+ this.listOpen.emit();
1617
+ }
1618
+ }
1619
+ render() {
1620
+ const { checkboxes, treeview, label, size, disabled, readonly, required, hidden, fullWidth, searchable } = this.getOptions();
1621
+ const hostClasses = classnames("bcm-list", `bcm-list__size-${size}`, `bcm-list__${this.type}`, size === "large" ? "size-3" : "size-2", {
1622
+ "error": this.captionType == Bcm$1.Status.error,
1623
+ "full-width": fullWidth,
1624
+ "bcm-list__linked": this.linkedComponent,
1625
+ hidden,
1626
+ readonly,
1627
+ disabled,
1628
+ });
1629
+ const bcmListContainer = classnames("bcm-list__container", this.linkedComponent ? "bcm-list__type-linked-component" : `bcm-list__type-${this.type}`, {
1630
+ "is-open": this.isOpen && this.calculatedViewport,
1631
+ "is-open-animation": this.isOpenAnimation,
1632
+ "error": this.captionType == Bcm$1.Status.error,
1633
+ "full-width": fullWidth,
1634
+ hidden,
1635
+ readonly,
1636
+ disabled,
1637
+ });
1638
+ const bcmListInput = classnames("bcm-list__input");
1639
+ const openedType = this.type == "select" || this.type == "autocomplete" || this.linkedComponent;
1640
+ return (h(Host, { class: hostClasses, tabindex: "0", style: {
1641
+ "--width": fullWidth ? "100%" : this.width,
1642
+ "--height": openedType ? "100%" : this.height,
1643
+ "--max-height": openedType ? "inherit" : this.maxHeight,
1644
+ "--min-height": openedType ? "inherit" : this.minHeight,
1645
+ } }, h("div", { id: `bcm-list-label-${this._id}`, class: "bcm-list__label" }, label && (h("div", null, h("bcm-label", { tooltip: this.tooltip, size: this.size, type: this.captionType, value: label, required: required, htmlFor: this._id })))), this.type == "select" && (h("div", { id: `bcm-list-input-${this._id}`, class: bcmListInput }, h("span", { class: classnames("bcm-list__input-container", { "type-single": !checkboxes, "value-empty": !this.value }) }, this.checkboxes ? (this.value && this.value.length > 0 ? (h("bcm-rc-overflow", { data: this.tagData, maxCount: this.tagCount })) : (h("span", { class: "bcm-list__input-placeholder" }, this.placeholder))) : this.value ? (this.inputText) : (h("span", { class: "bcm-list__input-placeholder" }, this.placeholder))), h("span", { class: classnames("bcm-list__input-buttons", {
1646
+ disabled: disabled,
1647
+ }) }, this.clearable && this.value && (h("div", { class: "bcm-list__input-buttons-button" }, h("bcm-icon", { icon: "fal fa-times", onClick: e => !disabled && this.setClear(e) }))), h("div", { class: `bcm-list__input-buttons-button caret-is ${this.isOpen && this.calculatedViewport && "caret-is-open"}` }, h("bcm-icon", { icon: `far fa-angle-down` }))))), this.type === "autocomplete" && (h("div", { id: `bcm-list-input-${this._id}`, class: classnames(bcmListInput, { "bcm-list__input-autocomplete": this.type == "autocomplete" }) }, h("span", { class: "bcm-list__input-container", id: `bcm-list-input-tag-container-${this._id}` }, this.checkboxes && h("span", { class: "bcm-list__input-tag-container", id: `bcm-list-input-tag-container-${this._id}-autocomplete` }), 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 })))), 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, tempId: this.tempId, 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, handleTransitionEnd: e => this.handleTransitionEnd(e) }), h(CaptionTemplate, { noCaption: this.noCaption, captionType: this.captionType, captionError: this.captionError, caption: this.caption })));
1648
+ }
1649
+ get el() { return getElement(this); }
1650
+ static get watchers() { return {
1651
+ "_id": ["watchId"],
1652
+ "value": ["handleValueChange"],
1653
+ "returnFilterData": ["watchReturnFilterData"],
1654
+ "isOpen": ["handleOpen"],
1655
+ "data": ["dataChanged"]
1656
+ }; }
1657
+ };
1658
+ __decorate([
1659
+ IsLoad()
1660
+ ], BcmList.prototype, "el", void 0);
1661
+ __decorate([
1662
+ JsonParse("data", true)
1663
+ ], BcmList.prototype, "dataChanged", null);
1664
+ BcmList.style = listCss;
1665
+
1666
+ 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}";
1667
+
1668
+ const BcmRcOverflow = class {
1669
+ constructor(hostRef) {
1670
+ registerInstance(this, hostRef);
1671
+ this.selectOtherTag = createEvent(this, "bcm-select-other-tag", 7);
1672
+ this.selectTag = createEvent(this, "bcm-select-tag", 7);
1673
+ this.deleteTag = createEvent(this, "bcm-delete-tag", 7);
1674
+ this.renderItem = item => {
1675
+ return react.createElement("bcm-tooltip", {
1676
+ placement: "bottom",
1677
+ message: item.text,
1678
+ trigger: "hover",
1679
+ }, react.createElement("div", {
1680
+ id: item.value + "-tag",
1681
+ className: "bcm-tag",
1682
+ onClick: ({ target }) => this.onClickControl(target, item, false),
1683
+ }, react.createElement("span", { className: "bcm-tag__content dismissable" },
1684
+ // .bcm-tag__content span {
1685
+ // display: block;
1686
+ // max-width: 38px;
1687
+ // white-space: nowrap;
1688
+ // overflow: hidden;
1689
+ // text-overflow: ellipsis;
1690
+ react.createElement("div", { className: "value tw-block tw-max-w-[38px] tw-overflow-hidden tw-overflow-ellipsis tw-whitespace-nowrap" }, item.text), react.createElement("span", {
1691
+ className: "right close-button",
1692
+ }, react.createElement("bcm-icon", {
1693
+ icon: "fa fa-times",
1694
+ })))));
1695
+ };
1696
+ this.renderRest = items => {
1697
+ const titles = (items === null || items === void 0 ? void 0 : items.sort((a, b) => +a.ct - +b.ct).slice(0, 15).map(item => StringHelper.textLimitter(item.text, 40, true)).toString().split(",").join("\r\n")) + (items.length > 15 ? "\r\n..." : "");
1698
+ return react.createElement("bcm-tooltip", {
1699
+ placement: "bottom",
1700
+ message: titles,
1701
+ trigger: "hover",
1702
+ }, react.createElement("div", {
1703
+ className: "bcm-tag bcm-tag--other",
1704
+ onClick: ({ target }) => this.onClickControl(target, items, true),
1705
+ }, react.createElement("span", { className: `bcm-tag__content dismissable ${this.checked ? "checkable checked" : ""}` }, react.createElement("span", { className: "value" }, `+${items === null || items === void 0 ? void 0 : items.length}`), react.createElement("span", { className: "right close-button" }, react.createElement("bcm-icon", {
1706
+ icon: "fa fa-times",
1707
+ })))));
1708
+ };
1709
+ this._id = Generate.UID();
1710
+ this.maxCount = 1;
1711
+ this.data = [];
1712
+ this.checked = false;
1713
+ }
1714
+ isClickDismiss(e) {
1715
+ return e["s-hn"] === "BCM-ICON";
1716
+ }
1717
+ onClickControl(e, item, isOtherTag = false) {
1718
+ const isClickClose = this.isClickDismiss(e);
1719
+ isClickClose && this.deleteTag.emit({ id: Array.isArray(item) ? item.map(i => i.value) : item.value }) && this.checked && (this.checked = false);
1720
+ !isOtherTag && this.selectTag.emit({ id: item.value }) && this.checked && (this.checked = false);
1721
+ if (isOtherTag && !isClickClose) {
1722
+ this.checked = !this.checked;
1723
+ this.selectOtherTag.emit({ id: item === null || item === void 0 ? void 0 : item.map(i => i.value), checked: this.checked });
1724
+ }
1725
+ }
1726
+ componentWillRender() {
1727
+ const { data, renderItem, renderRest, maxCount } = this;
1728
+ this.overflowInstance = react.createElement(ForwardOverflow, {
1729
+ data,
1730
+ renderItem,
1731
+ renderRest,
1732
+ maxCount,
1733
+ });
1734
+ reactDom.render(this.overflowInstance, this.el);
1735
+ }
1736
+ get el() { return getElement(this); }
1737
+ };
1738
+ BcmRcOverflow.style = rcOverflowCss;
1739
+
1740
+ const { state } = createStore({
1741
+ value: new Map(),
1742
+ });
1743
+ const setValue = val => {
1744
+ const { id, dataSource } = val;
1745
+ const data = {
1746
+ id: snq(() => id, Generate.UID),
1747
+ dataSource: dataSource && dataSource.length > 0 && recursive(dataSource),
1748
+ searchIsOnlyChilds: val.searchIsOnlyChilds,
1749
+ };
1750
+ state.value.set(data.id, data);
1751
+ };
1752
+ const recursive = (data, parentId) => {
1753
+ let recData = [];
1754
+ if (data) {
1755
+ recData = data.map(item => (Object.assign(Object.assign(Object.assign({}, item), { parentId: snq(() => parentId, null) }), (item.items && item.items.length > 0 && { items: snq(() => recursive(item.items, item.id), []) }))));
1756
+ }
1757
+ return recData;
1758
+ };
1759
+ const removeValue = _id => {
1760
+ state.value.delete(_id);
1761
+ };
1762
+ const getValue = id => snq(() => state.value.get(id), {});
1763
+ const getDataPagination = (id, limit = 3) => {
1764
+ let data = [];
1765
+ const value = getValue(id);
1766
+ if (value) {
1767
+ const { dataSource } = value;
1768
+ data = dataSource.slice(0, limit);
1769
+ }
1770
+ return data;
1771
+ };
1772
+ // //search treeview data by text
1773
+ // const searchData = (id, search, items?) => {
1774
+ // let dataSource
1775
+ // if (items && items.length > 0) {
1776
+ // dataSource = items
1777
+ // } else {
1778
+ // const value = getValue(id);
1779
+ // dataSource = value.dataSource;
1780
+ // }
1781
+ // let result = []
1782
+ // if (dataSource) {
1783
+ // dataSource.forEach(child => {
1784
+ // if (child.text.toLowerCase().includes(search.toLowerCase())) {
1785
+ // result.push(child)
1786
+ // }
1787
+ // result = result.concat(searchData(id, search, child.items))
1788
+ // })
1789
+ // };
1790
+ // return result
1791
+ // };
1792
+ //nested search
1793
+ const searchData = (id, searchText, items) => {
1794
+ let dataSource;
1795
+ if (items && items.length > 0) {
1796
+ dataSource = items;
1797
+ }
1798
+ else {
1799
+ const value = getValue(id);
1800
+ dataSource = value.dataSource;
1801
+ }
1802
+ let results = [];
1803
+ if (dataSource) {
1804
+ results.push(nestedSearch(id, dataSource, searchText));
1805
+ //return with their parents
1806
+ // dataSource.forEach(child => {
1807
+ // if (child.text.toLowerCase().includes(searchText.toLowerCase())) {
1808
+ // results.push(child)
1809
+ // } else if (child.items && child.items.length > 0) {
1810
+ // child.items = nestedSearch(child.items, searchText)
1811
+ // if (child.items.length > 0) {
1812
+ // results.push(child)
1813
+ // }
1814
+ // }
1815
+ // })
1816
+ }
1817
+ return {
1818
+ result: snq(() => Generate.flatArray(results[0].result), []),
1819
+ matching: snq(() => results[0].matching, []),
1820
+ parentIndex: snq(() => results[0].parentIndex, []),
1821
+ nestedResult: snq(() => results[0].nestedResult, []),
1822
+ };
1823
+ };
1824
+ const nestedSearch = (id, items, searchText) => {
1825
+ let matching = [];
1826
+ let parentIndex = [];
1827
+ let result = [];
1828
+ let nestedResult = [];
1829
+ const { searchIsOnlyChilds } = getValue(id);
1830
+ if (items && items.length > 0) {
1831
+ items.forEach(child => {
1832
+ let isChild = searchIsOnlyChilds && child.parentId !== null;
1833
+ let isMatching = (child.text && StringHelper.slugify(child.text).includes(StringHelper.slugify(searchText))) ||
1834
+ (child.keywords && StringHelper.slugify(child.keywords).includes(StringHelper.slugify(searchText)));
1835
+ if (isMatching && (!searchIsOnlyChilds || (searchIsOnlyChilds && isChild))) {
1836
+ result.push(child.id);
1837
+ matching.push(child.id);
1838
+ parentIndex.push(child.id);
1839
+ nestedResult.push({ id: child.id, text: child.text, parentId: child.parentId });
1840
+ if (child.items && child.items.length > 0) {
1841
+ const found = nestedSearch(id, child.items, searchText);
1842
+ if (found.matching.length > 0) {
1843
+ found.matching.forEach(chi => {
1844
+ matching.push(chi);
1845
+ });
1846
+ }
1847
+ }
1848
+ }
1849
+ else if (child.items && child.items.length > 0) {
1850
+ const found = nestedSearch(id, child.items, searchText);
1851
+ if (found.result.length > 0) {
1852
+ found.result.forEach(chi => {
1853
+ result.push(chi);
1854
+ });
1855
+ result.push(child.id);
1856
+ parentIndex.push(child.id);
1857
+ nestedResult.push({ id: child.id, text: child.text, parentId: child.parentId, items: found.nestedResult });
1858
+ }
1859
+ if (found.matching.length > 0) {
1860
+ matching.push(...found.matching);
1861
+ }
1862
+ }
1863
+ });
1864
+ }
1865
+ return { result, matching, parentIndex, nestedResult };
1866
+ };
1867
+ const searchState = {
1868
+ setValue,
1869
+ removeValue,
1870
+ getValue,
1871
+ getDataPagination,
1872
+ searchData,
1873
+ };
1874
+
1875
+ 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\"); .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}.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;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}";
1876
+
1877
+ const BcmSearch = class {
1878
+ constructor(hostRef) {
1879
+ registerInstance(this, hostRef);
1880
+ this.bcmOnSearch = createEvent(this, "bcm-on-search", 7);
1881
+ this.bcmOnSearchClear = createEvent(this, "bcm-on-search-clear", 7);
1882
+ this.debounceHandler = Generate.debounceInput((event) => this.onSearchValue(event, this), 300, false, () => {
1883
+ var _a, _b;
1884
+ 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;
1885
+ });
1886
+ this._id = Generate.UID();
1887
+ this.placeholder = "Search";
1888
+ this.disabled = false;
1889
+ this.readonly = false;
1890
+ this.clearable = true;
1891
+ this.size = Bcm.Size.medium;
1892
+ this.limit = 10;
1893
+ this.searchIsOnlyChilds = false;
1894
+ this.minSearchLength = 2;
1895
+ this.data = [];
1896
+ this.tick = {};
1897
+ this.isActiveClearable = false;
1898
+ }
1899
+ async componentDidLoad() {
1900
+ await this.initState();
1901
+ }
1902
+ async dataChanged(newValue, oldValue) {
1903
+ // console.log('data changed', newValue, oldValue)
1904
+ if (newValue !== oldValue) {
1905
+ await this.initState();
1906
+ }
1907
+ }
1908
+ async initState() {
1909
+ await searchState.setValue({
1910
+ id: this._id + "-input",
1911
+ dataSource: this.data,
1912
+ searchIsOnlyChilds: this.searchIsOnlyChilds,
1913
+ });
1914
+ await this.markForCheck();
1915
+ }
1916
+ markForCheck() {
1917
+ this.tick = Generate.UID();
1918
+ }
1919
+ handleInput() {
1920
+ // console.log("aheyya")
1921
+ }
1922
+ async onBcmFocus() {
1923
+ this.inputElement.focus();
1924
+ }
1925
+ async onBcmBlur() {
1926
+ this.inputElement.blur();
1927
+ }
1928
+ async onBcmSelect() {
1929
+ this.inputElement.select();
1930
+ }
1931
+ async setValue(newValue) {
1932
+ this.inputElement.value = newValue;
1933
+ }
1934
+ handleFocus() { }
1935
+ handleBlur() { }
1936
+ handleChange() { }
1937
+ async handleClear(eventEmit = true) {
1938
+ this.inputElement.value = '';
1939
+ const { value, id } = this.inputElement;
1940
+ searchState.searchData(id, value);
1941
+ this.isActiveClearable = false;
1942
+ this.bcmOnSearch.emit({ result: null, value: null, matching: null, parentIndex: null });
1943
+ this.bcmOnSearchClear.emit(eventEmit);
1944
+ await delay(10);
1945
+ return Promise.resolve();
1946
+ }
1947
+ onSearchValue(event, instance) {
1948
+ const { value, id } = event.target;
1949
+ const searchResult = (value === null || value === void 0 ? void 0 : value.length) >= this.minSearchLength ? searchState.searchData(id, value, null) : null;
1950
+ const { bcmOnSearch, inputElement } = instance;
1951
+ 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 });
1952
+ }
1953
+ render() {
1954
+ const { _id, placeholder, disabled, readonly } = this;
1955
+ return h(Host, { onClick: () => { this.onBcmFocus(); this.onBcmSelect(); } }, h(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 }));
1956
+ }
1957
+ get el() { return getElement(this); }
1958
+ static get watchers() { return {
1959
+ "data": ["dataChanged"]
1960
+ }; }
1961
+ };
1962
+ BcmSearch.style = searchCss;
1963
+
1964
+ export { BcmList as bcm_list, BcmRcOverflow as bcm_rc_overflow, BcmSearch as bcm_search };