bromcom-ui 2.10.1-rc.1 → 2.10.1-rc.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (245) 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-000670b6.js +5 -0
  4. package/dist/bromcom-ui/{p-5ca4aa84.entry.js → p-073d177e.entry.js} +1 -1
  5. package/dist/bromcom-ui/{p-39a40a6e.entry.js → p-07e9b5e7.entry.js} +1 -1
  6. package/dist/bromcom-ui/p-0fc73cca.entry.js +5 -0
  7. package/dist/bromcom-ui/{p-09699c4d.entry.js → p-16450a8b.entry.js} +1 -1
  8. package/dist/bromcom-ui/{p-be434461.entry.js → p-175eb1c7.entry.js} +1 -1
  9. package/dist/bromcom-ui/{p-0b820f78.entry.js → p-17c0a72a.entry.js} +1 -1
  10. package/dist/bromcom-ui/{p-0325e8a4.entry.js → p-17eb0140.entry.js} +1 -1
  11. package/dist/bromcom-ui/{p-3f39982f.entry.js → p-18d28737.entry.js} +1 -1
  12. package/dist/bromcom-ui/{p-a42cc789.entry.js → p-1f5ca41b.entry.js} +1 -1
  13. package/dist/bromcom-ui/{p-a839a0e5.entry.js → p-21cb3cfe.entry.js} +1 -1
  14. package/dist/bromcom-ui/{p-0b316c6f.entry.js → p-23eb79ac.entry.js} +1 -1
  15. package/dist/bromcom-ui/{p-b013cff9.entry.js → p-2d965b60.entry.js} +1 -1
  16. package/dist/bromcom-ui/p-32d93221.entry.js +21 -0
  17. package/dist/bromcom-ui/{p-fb597d84.entry.js → p-33513345.entry.js} +1 -1
  18. package/dist/bromcom-ui/{p-0fe106fc.entry.js → p-3b5c36e8.entry.js} +1 -1
  19. package/dist/bromcom-ui/{p-7f09901d.entry.js → p-3f127ea5.entry.js} +1 -1
  20. package/dist/bromcom-ui/{p-3756f541.entry.js → p-424b7562.entry.js} +1 -1
  21. package/dist/bromcom-ui/{p-483b4ba8.entry.js → p-43a1f84c.entry.js} +1 -1
  22. package/dist/bromcom-ui/{p-0973538a.entry.js → p-4e436468.entry.js} +1 -1
  23. package/dist/bromcom-ui/{p-ea2ce157.js → p-52b7fc24.js} +1 -1
  24. package/dist/bromcom-ui/{p-d89b7e22.entry.js → p-56187d14.entry.js} +1 -1
  25. package/dist/bromcom-ui/{p-bec8a936.entry.js → p-58d5775f.entry.js} +1 -1
  26. package/dist/bromcom-ui/{p-f1dbd96d.entry.js → p-594953e7.entry.js} +1 -1
  27. package/dist/bromcom-ui/{p-62d178e3.entry.js → p-5b96272e.entry.js} +1 -1
  28. package/dist/bromcom-ui/{p-14c32a34.entry.js → p-5bf620b2.entry.js} +1 -1
  29. package/dist/bromcom-ui/{p-e38c4c3a.entry.js → p-5fc49f6f.entry.js} +1 -1
  30. package/dist/bromcom-ui/{p-3b41df22.entry.js → p-60a12878.entry.js} +1 -1
  31. package/dist/bromcom-ui/{p-d06f5291.js → p-61314a43.js} +1 -1
  32. package/dist/bromcom-ui/{p-1708a5ec.entry.js → p-6153f889.entry.js} +1 -1
  33. package/dist/bromcom-ui/{p-551058cd.entry.js → p-643a09b4.entry.js} +1 -1
  34. package/dist/bromcom-ui/p-64999c43.entry.js +5 -0
  35. package/dist/bromcom-ui/{p-015d19dd.entry.js → p-79712823.entry.js} +1 -1
  36. package/dist/bromcom-ui/{p-646cf63c.entry.js → p-7e2da99e.entry.js} +1 -1
  37. package/dist/bromcom-ui/{p-a04aab3c.entry.js → p-841f2b60.entry.js} +1 -1
  38. package/dist/bromcom-ui/{p-8d43aa14.entry.js → p-8c3a6509.entry.js} +1 -1
  39. package/dist/bromcom-ui/p-8c610886.js +5 -0
  40. package/dist/bromcom-ui/{p-d7538ba4.entry.js → p-8e772077.entry.js} +1 -1
  41. package/dist/bromcom-ui/{p-795d2f76.entry.js → p-8fbdb72f.entry.js} +1 -1
  42. package/dist/bromcom-ui/{p-b3b59bc3.entry.js → p-910c935f.entry.js} +1 -1
  43. package/dist/bromcom-ui/{p-55291cc5.entry.js → p-9ac757e9.entry.js} +1 -1
  44. package/dist/bromcom-ui/{p-77eb2287.entry.js → p-9da1d897.entry.js} +1 -1
  45. package/dist/bromcom-ui/{p-c566b3a0.entry.js → p-9f1e6daa.entry.js} +1 -1
  46. package/dist/bromcom-ui/{p-c1b167a3.js → p-a1477028.js} +1 -1
  47. package/dist/bromcom-ui/{p-9a41b688.js → p-a58b2664.js} +1 -1
  48. package/dist/bromcom-ui/{p-56f7477e.entry.js → p-a835bff0.entry.js} +1 -1
  49. package/dist/bromcom-ui/{p-9889a4ed.entry.js → p-a889681e.entry.js} +1 -1
  50. package/dist/bromcom-ui/{p-dac3117a.entry.js → p-aab72ea1.entry.js} +1 -1
  51. package/dist/bromcom-ui/p-abc44b58.entry.js +5 -0
  52. package/dist/bromcom-ui/{p-16848643.entry.js → p-afde516e.entry.js} +1 -1
  53. package/dist/bromcom-ui/{p-571dca86.entry.js → p-c977ed98.entry.js} +1 -1
  54. package/dist/bromcom-ui/{p-a1f9e7d4.entry.js → p-cfd52d5f.entry.js} +1 -1
  55. package/dist/bromcom-ui/{p-e11ab4ed.entry.js → p-da5fdda2.entry.js} +1 -1
  56. package/dist/bromcom-ui/{p-3d142f76.entry.js → p-e19a8e73.entry.js} +1 -1
  57. package/dist/bromcom-ui/{p-e131b27f.js → p-e2aaaece.js} +1 -1
  58. package/dist/bromcom-ui/{p-29614b49.entry.js → p-e6faa2bb.entry.js} +1 -1
  59. package/dist/bromcom-ui/{p-673f7ee8.entry.js → p-ec36f5a0.entry.js} +1 -1
  60. package/dist/bromcom-ui/{p-cf0c0700.entry.js → p-ec992ac3.entry.js} +1 -1
  61. package/dist/bromcom-ui/{p-cd04678a.entry.js → p-ecd8d70f.entry.js} +1 -1
  62. package/dist/bromcom-ui/{p-cf171578.js → p-edbdd7dd.js} +1 -1
  63. package/dist/bromcom-ui/{p-24710a65.entry.js → p-f077a1d7.entry.js} +1 -1
  64. package/dist/bromcom-ui/{p-2da72d6a.entry.js → p-f2776268.entry.js} +1 -1
  65. package/dist/bromcom-ui/{p-813ec92d.js → p-f83b3048.js} +1 -1
  66. package/dist/bromcom-ui/{p-f3431dc8.js → p-fed84581.js} +1 -1
  67. package/dist/cjs/bcm-accordion.cjs.entry.js +2 -2
  68. package/dist/cjs/bcm-alert.cjs.entry.js +2 -2
  69. package/dist/cjs/bcm-attendance.cjs.entry.js +2 -2
  70. package/dist/cjs/bcm-avatar_2.cjs.entry.js +4 -4
  71. package/dist/cjs/bcm-breadcrumb.cjs.entry.js +2 -2
  72. package/dist/cjs/bcm-button-group.cjs.entry.js +2 -2
  73. package/dist/cjs/{bcm-button_10.cjs.entry.js → bcm-button_15.cjs.entry.js} +5751 -828
  74. package/dist/cjs/bcm-caption.cjs.entry.js +5 -5
  75. package/dist/cjs/bcm-card.cjs.entry.js +2 -2
  76. package/dist/cjs/bcm-checkbox-group.cjs.entry.js +3 -3
  77. package/dist/cjs/bcm-checkbox-lite_9.cjs.entry.js +2 -2
  78. package/dist/cjs/bcm-chip-group.cjs.entry.js +5 -5
  79. package/dist/cjs/bcm-chip.cjs.entry.js +2 -2
  80. package/dist/cjs/bcm-collapse.cjs.entry.js +2 -2
  81. package/dist/cjs/bcm-color-input.cjs.entry.js +4 -4
  82. package/dist/cjs/bcm-date-picker.cjs.entry.js +2 -2
  83. package/dist/cjs/bcm-datetime-picker.cjs.entry.js +3 -3
  84. package/dist/cjs/bcm-default.cjs.entry.js +2 -2
  85. package/dist/cjs/bcm-drawer.cjs.entry.js +4 -4
  86. package/dist/cjs/bcm-dropdown.cjs.entry.js +3 -3
  87. package/dist/cjs/bcm-expansion-panel.cjs.entry.js +2 -2
  88. package/dist/cjs/bcm-form-2.cjs.entry.js +2 -2
  89. package/dist/cjs/bcm-input-custom.cjs.entry.js +2 -2
  90. package/dist/cjs/bcm-input-dropdown.cjs.entry.js +6 -6
  91. package/dist/cjs/bcm-item.cjs.entry.js +2 -2
  92. package/dist/cjs/bcm-items.cjs.entry.js +2 -2
  93. package/dist/cjs/bcm-menu.cjs.entry.js +5 -5
  94. package/dist/cjs/bcm-modal-2-footer.cjs.entry.js +4 -4
  95. package/dist/cjs/bcm-modal-2-header.cjs.entry.js +4 -4
  96. package/dist/cjs/bcm-modal-2.cjs.entry.js +4 -4
  97. package/dist/cjs/bcm-modal.cjs.entry.js +2 -2
  98. package/dist/cjs/bcm-number-input.cjs.entry.js +109 -0
  99. package/dist/cjs/bcm-popconfirm-box.cjs.entry.js +2 -2
  100. package/dist/cjs/bcm-popconfirm.cjs.entry.js +2 -2
  101. package/dist/cjs/bcm-popover.cjs.entry.js +4 -4
  102. package/dist/cjs/bcm-progress.cjs.entry.js +2 -2
  103. package/dist/cjs/bcm-radio-group.cjs.entry.js +4 -4
  104. package/dist/cjs/bcm-radio.cjs.entry.js +4 -4
  105. package/dist/cjs/bcm-range.cjs.entry.js +2 -2
  106. package/dist/cjs/bcm-shortcut.cjs.entry.js +4 -4
  107. package/dist/cjs/bcm-skeleton.cjs.entry.js +4 -4
  108. package/dist/cjs/bcm-step.cjs.entry.js +3 -3
  109. package/dist/cjs/bcm-stepper.cjs.entry.js +5 -5
  110. package/dist/cjs/bcm-tab-group.cjs.entry.js +4 -4
  111. package/dist/cjs/bcm-tab-item-header.cjs.entry.js +4 -4
  112. package/dist/cjs/bcm-tab-item.cjs.entry.js +4 -4
  113. package/dist/cjs/bcm-table.cjs.entry.js +4 -4
  114. package/dist/cjs/bcm-tag.cjs.entry.js +3 -3
  115. package/dist/cjs/bcm-textarea.cjs.entry.js +3 -3
  116. package/dist/cjs/bcm-time-picker.cjs.entry.js +2 -2
  117. package/dist/cjs/bcm-toast.cjs.entry.js +2 -2
  118. package/dist/cjs/bcm-typography.cjs.entry.js +21 -0
  119. package/dist/cjs/bromcom-ui.cjs.js +3 -3
  120. package/dist/cjs/{generate-e79347af.js → generate-c3a6c8c7.js} +15 -1
  121. package/dist/cjs/{global-9bb1902a.js → global-9e8b5009.js} +1 -1
  122. package/dist/cjs/{input-template-3d21aacb.js → input-template-8eeb94e7.js} +1 -1
  123. package/dist/cjs/{json-parse-decarator-4d7afa63.js → json-parse-decarator-0932bec0.js} +1 -1
  124. package/dist/cjs/{label-template-8dc10d0a.js → label-template-a6f51ef2.js} +6 -3
  125. package/dist/cjs/loader.cjs.js +3 -3
  126. package/dist/cjs/{number-helper-2f971fd8.js → number-helper-4e902d31.js} +1 -1
  127. package/dist/cjs/old-bcm-popover-box.cjs.entry.js +3 -3
  128. package/dist/cjs/old-bcm-popover.cjs.entry.js +2 -2
  129. package/dist/cjs/{package-47b7b998.js → package-b23f7b7f.js} +1 -1
  130. package/dist/cjs/{stepper-states-a5699b31.js → stepper-states-cb2339c3.js} +1 -1
  131. package/dist/cjs/{tooltip-helper-7d5d1cb5.js → tooltip-helper-4ddec3b4.js} +3 -3
  132. package/dist/cjs/{validators-507307b9.js → validators-e2155072.js} +1 -1
  133. package/dist/collection/collection-manifest.json +1 -0
  134. package/dist/collection/components/atoms/label/label.js +1 -1
  135. package/dist/collection/components/molecules/input-dropdown/input-dropdown.js +1 -1
  136. package/dist/collection/components/molecules/input-dropdown/input-dropdown.style.js +1 -1
  137. package/dist/collection/components/molecules/number-input/number-input.css +137 -0
  138. package/dist/collection/components/molecules/number-input/number-input.js +425 -0
  139. package/dist/collection/components/molecules/number-input/number-input.style.js +45 -0
  140. package/dist/collection/components/molecules/switch/switch.css +1 -0
  141. package/dist/collection/components/organism/list/list.css +2 -0
  142. package/dist/collection/components/organism/list/list.js +38 -9
  143. package/dist/collection/helper/generate.js +14 -0
  144. package/dist/collection/templates/label-template.js +6 -6
  145. package/dist/collection/templates/list-item-template.js +3 -2
  146. package/dist/components/bcm-caption.js +2 -2
  147. package/dist/components/bcm-input-dropdown.js +2 -2
  148. package/dist/components/bcm-number-input.d.ts +11 -0
  149. package/dist/components/bcm-number-input.js +157 -0
  150. package/dist/components/bcm-switch.js +1 -1
  151. package/dist/components/generate.js +15 -1
  152. package/dist/components/index.d.ts +1 -0
  153. package/dist/components/index.js +1 -0
  154. package/dist/components/label.js +7 -4
  155. package/dist/components/list.js +19 -10
  156. package/dist/esm/bcm-accordion.entry.js +2 -2
  157. package/dist/esm/bcm-alert.entry.js +2 -2
  158. package/dist/esm/bcm-attendance.entry.js +2 -2
  159. package/dist/esm/bcm-avatar_2.entry.js +4 -4
  160. package/dist/esm/bcm-breadcrumb.entry.js +2 -2
  161. package/dist/esm/bcm-button-group.entry.js +2 -2
  162. package/dist/esm/{bcm-button_10.entry.js → bcm-button_15.entry.js} +5283 -365
  163. package/dist/esm/bcm-caption.entry.js +5 -5
  164. package/dist/esm/bcm-card.entry.js +2 -2
  165. package/dist/esm/bcm-checkbox-group.entry.js +3 -3
  166. package/dist/esm/bcm-checkbox-lite_9.entry.js +2 -2
  167. package/dist/esm/bcm-chip-group.entry.js +5 -5
  168. package/dist/esm/bcm-chip.entry.js +2 -2
  169. package/dist/esm/bcm-collapse.entry.js +2 -2
  170. package/dist/esm/bcm-color-input.entry.js +4 -4
  171. package/dist/esm/bcm-date-picker.entry.js +2 -2
  172. package/dist/esm/bcm-datetime-picker.entry.js +3 -3
  173. package/dist/esm/bcm-default.entry.js +2 -2
  174. package/dist/esm/bcm-drawer.entry.js +4 -4
  175. package/dist/esm/bcm-dropdown.entry.js +3 -3
  176. package/dist/esm/bcm-expansion-panel.entry.js +2 -2
  177. package/dist/esm/bcm-form-2.entry.js +2 -2
  178. package/dist/esm/bcm-input-custom.entry.js +2 -2
  179. package/dist/esm/bcm-input-dropdown.entry.js +6 -6
  180. package/dist/esm/bcm-item.entry.js +2 -2
  181. package/dist/esm/bcm-items.entry.js +2 -2
  182. package/dist/esm/bcm-menu.entry.js +5 -5
  183. package/dist/esm/bcm-modal-2-footer.entry.js +4 -4
  184. package/dist/esm/bcm-modal-2-header.entry.js +4 -4
  185. package/dist/esm/bcm-modal-2.entry.js +4 -4
  186. package/dist/esm/bcm-modal.entry.js +2 -2
  187. package/dist/esm/bcm-number-input.entry.js +105 -0
  188. package/dist/esm/bcm-popconfirm-box.entry.js +2 -2
  189. package/dist/esm/bcm-popconfirm.entry.js +2 -2
  190. package/dist/esm/bcm-popover.entry.js +4 -4
  191. package/dist/esm/bcm-progress.entry.js +2 -2
  192. package/dist/esm/bcm-radio-group.entry.js +4 -4
  193. package/dist/esm/bcm-radio.entry.js +4 -4
  194. package/dist/esm/bcm-range.entry.js +2 -2
  195. package/dist/esm/bcm-shortcut.entry.js +4 -4
  196. package/dist/esm/bcm-skeleton.entry.js +4 -4
  197. package/dist/esm/bcm-step.entry.js +3 -3
  198. package/dist/esm/bcm-stepper.entry.js +5 -5
  199. package/dist/esm/bcm-tab-group.entry.js +4 -4
  200. package/dist/esm/bcm-tab-item-header.entry.js +4 -4
  201. package/dist/esm/bcm-tab-item.entry.js +4 -4
  202. package/dist/esm/bcm-table.entry.js +4 -4
  203. package/dist/esm/bcm-tag.entry.js +3 -3
  204. package/dist/esm/bcm-textarea.entry.js +3 -3
  205. package/dist/esm/bcm-time-picker.entry.js +2 -2
  206. package/dist/esm/bcm-toast.entry.js +2 -2
  207. package/dist/esm/bcm-typography.entry.js +17 -0
  208. package/dist/esm/bromcom-ui.js +3 -3
  209. package/dist/esm/{generate-b9c6f412.js → generate-80f589b2.js} +15 -1
  210. package/dist/esm/{global-114427da.js → global-9afe304c.js} +1 -1
  211. package/dist/esm/{input-template-dc94e47f.js → input-template-a5d07ba6.js} +1 -1
  212. package/dist/esm/{json-parse-decarator-fca2dc09.js → json-parse-decarator-5195f510.js} +1 -1
  213. package/dist/esm/{label-template-989d1700.js → label-template-ad2e8119.js} +6 -3
  214. package/dist/esm/loader.js +3 -3
  215. package/dist/esm/{number-helper-70be3621.js → number-helper-aeb5881f.js} +1 -1
  216. package/dist/esm/old-bcm-popover-box.entry.js +3 -3
  217. package/dist/esm/old-bcm-popover.entry.js +2 -2
  218. package/dist/esm/{package-6f4c9f8c.js → package-5e39e390.js} +1 -1
  219. package/dist/esm/{stepper-states-291a682f.js → stepper-states-97a648ff.js} +1 -1
  220. package/dist/esm/{tooltip-helper-089735b1.js → tooltip-helper-d339c58a.js} +3 -3
  221. package/dist/esm/{validators-c1fe8b4b.js → validators-b5e106d5.js} +1 -1
  222. package/dist/types/components/molecules/number-input/number-input.d.ts +29 -0
  223. package/dist/types/components/molecules/number-input/number-input.style.d.ts +200 -0
  224. package/dist/types/components/organism/list/list.d.ts +3 -1
  225. package/dist/types/components.d.ts +55 -1
  226. package/dist/types/helper/generate.d.ts +3 -0
  227. package/dist/types/models/bcm.d.ts +3 -0
  228. package/dist/types/templates/label-template.d.ts +2 -1
  229. package/package.json +1 -1
  230. package/dist/bromcom-ui/p-140f3478.js +0 -5
  231. package/dist/bromcom-ui/p-3432a82d.js +0 -19
  232. package/dist/bromcom-ui/p-5ff3c68f.entry.js +0 -5
  233. package/dist/bromcom-ui/p-71b9ea64.entry.js +0 -7
  234. package/dist/bromcom-ui/p-8b202d9e.js +0 -5
  235. package/dist/bromcom-ui/p-93b8a3ff.entry.js +0 -5
  236. package/dist/bromcom-ui/p-a00170b7.entry.js +0 -5
  237. package/dist/bromcom-ui/p-f7549b1f.entry.js +0 -5
  238. package/dist/cjs/bcm-checkbox_2.cjs.entry.js +0 -194
  239. package/dist/cjs/bcm-list_3.cjs.entry.js +0 -2536
  240. package/dist/cjs/bcm-switch.cjs.entry.js +0 -151
  241. package/dist/cjs/index-7eed931f.js +0 -2146
  242. package/dist/esm/bcm-checkbox_2.entry.js +0 -189
  243. package/dist/esm/bcm-list_3.entry.js +0 -2530
  244. package/dist/esm/bcm-switch.entry.js +0 -147
  245. package/dist/esm/index-e4b6a4ce.js +0 -2127
@@ -1,2536 +0,0 @@
1
- /*!
2
- * Built with Stencil
3
- * Copyright (c) Bromcom.
4
- */
5
- 'use strict';
6
-
7
- Object.defineProperty(exports, '__esModule', { value: true });
8
-
9
- const index$1 = require('./index-c591ecec.js');
10
- const isLoadDecorator = require('./is-load-decorator-15036f37.js');
11
- const jsonParseDecarator = require('./json-parse-decarator-4d7afa63.js');
12
- require('./color-helper-c3a819ea.js');
13
- require('./datetime-helper-eaf4fadb.js');
14
- const generate = require('./generate-e79347af.js');
15
- const numberHelper = require('./number-helper-2f971fd8.js');
16
- const stringHelper = require('./string-helper-3212f4ea.js');
17
- const validators = require('./validators-507307b9.js');
18
- require('./element-dragger-a8562f82.js');
19
- const popoverPlacement = require('./popover-placement-9b4b4153.js');
20
- const utils = require('./utils-fc077139.js');
21
- const bcm = require('./bcm-3c58a6d5.js');
22
- const captionTemplate = require('./caption-template-6f535b93.js');
23
- const index = require('./index-95ae50d0.js');
24
- require('./types-cc4adee7.js');
25
- require('./types-7523fd99.js');
26
- const index$2 = require('./index-d321de96.js');
27
- const index$3 = require('./index-7eed931f.js');
28
- const inputTemplate = require('./input-template-3d21aacb.js');
29
- require('./colors-56282b00.js');
30
- require('./colors-078851ec.js');
31
- require('./_commonjsHelpers-ed84c3ca.js');
32
- require('./package-47b7b998.js');
33
-
34
- const CheckboxTemplate = ({ disabled, checked, readonly, required, indeterminate, hidden, captionType, _id }) => {
35
- // if ( indeterminate ) {
36
- // checked = indeterminate == 'determinate' ? true : false
37
- // }
38
- const hostClasses = index.classnames('bcm-checkbox', 'bcm-checkbox__type-default', `bcm-checkbox-size-medium`, {
39
- // 'size-2': size === Bcm.Size.small || size === Bcm.Size.medium,
40
- // 'size-3': optionType === 'button' && size === Bcm.Size.large,
41
- 'error': captionType == bcm.Bcm.Status.error,
42
- hidden,
43
- checked,
44
- disabled,
45
- required,
46
- readonly,
47
- });
48
- const bcmCheckboxIconClass = index.classnames('bcm-checkbox__label-icon', 'bcm-checkbox__label-icon-lite', 'bcm-checkbox__label-icon-' + indeterminate, {
49
- 'bcm-checkbox__label-icon-checked': checked,
50
- });
51
- const bcmCheckboxLabelClass = index.classnames('bcm-checkbox__label');
52
- return (index$1.h("div", { class: hostClasses },
53
- index$1.h("input", { tabindex: "-1", id: _id, type: "checkbox", checked: checked, disabled: disabled, required: required, readonly: readonly }),
54
- index$1.h("label", { class: bcmCheckboxLabelClass, htmlFor: _id },
55
- index$1.h("span", { class: bcmCheckboxIconClass },
56
- index$1.h("bcm-icon", { icon: "far fa-check" })))));
57
- };
58
-
59
- const InfoFooterTemplate = ({ selected, total, found, multiple, variableText }) => {
60
- total = total || 0;
61
- variableText = variableText ? utils.pluralize(variableText, total) : 'items';
62
- return (index$1.h("footer", { class: "bcm-info-footer" },
63
- index$1.h("bcm-text", { scale: "size-1", color: "grey-8" },
64
- (multiple && selected > 0) && ` ( ${selected} selected ) `,
65
- ` Total ${total} `,
66
- found != null && ` / ${found} `,
67
- ` ${variableText} found. `)));
68
- };
69
-
70
- const ListItemTemplate = ({ item, treeview, highlight, checkboxes, size, selectedItem, openGroup, checkedItem, focusItem, searchIsOnlyChilds }) => {
71
- const isHaveChildren = item.items && item.items.length > 0;
72
- var text = stringHelper.StringHelper.htmlEntities(item.text);
73
- let intersection = [];
74
- if (highlight && stringHelper.StringHelper.slugify(text).includes(stringHelper.StringHelper.slugify(highlight))) {
75
- if (!searchIsOnlyChilds || (searchIsOnlyChilds && (!isHaveChildren || (!treeview && item.type != "group")))) {
76
- text = stringHelper.StringHelper.highlight(text, highlight);
77
- }
78
- }
79
- if (item.type != 'group' && item.template) {
80
- const match = item.template
81
- .replace(/\s/g, '')
82
- .match(/\{{[^}}]+\}/g)
83
- .map(x => x.replace(/[{}]/g, ''));
84
- const keys = Object.keys(item.itemObject);
85
- intersection = match.filter(x => keys.includes(x));
86
- }
87
- text = item.isHtmlContent ? item.isHtmlContent : item.template && intersection.length > 0 ? stringHelper.StringHelper.templateParser(item.template, Object.assign(Object.assign({}, item.itemObject), { text })) : text;
88
- const unClickable = !treeview && item.type == "group" && !item.clickable;
89
- const disabled = item.disabled;
90
- const readonly = item.readonly;
91
- const itemClick = (event) => {
92
- let path = event.path || event.composedPath();
93
- if (path.filter(x => x.attributes && x.attributes.getNamedItem("unlinked"))[0]) {
94
- return;
95
- }
96
- if (readonly) {
97
- collapseClick();
98
- }
99
- !unClickable && !disabled && !readonly && (checkboxes ? checkedItem(item.id) : selectedItem(item.id));
100
- };
101
- const collapseClick = () => {
102
- item.open = item.isSearching;
103
- openGroup(item.id);
104
- };
105
- return (index$1.h("div", { id: item.id, hidden: item.hidden, "on-focus": e => !unClickable && !disabled && focusItem(e), class: index.classnames('bcm-list__item',
106
- // size === 'large' ? 'size-3' : 'size-2',
107
- 'bcm-list__item-' + size, {
108
- 'bcm-list__item--group': !treeview && item.type == 'group',
109
- 'bcm-list__item--readonly': readonly,
110
- }) },
111
- index$1.h("div", { class: index.classnames('bcm-list__item-content', !checkboxes && item.selected && 'selected', { disabled: disabled }) },
112
- treeview && (index$1.h("div", { class: "bcm-list__item-content-collapse-icon", onClick: () => collapseClick() }, isHaveChildren && index$1.h("bcm-icon", { icon: index.classnames('fas fa-caret-' + (item.isSearching || item.open ? 'down' : 'right')) }))),
113
- index$1.h("div", { class: index.classnames('bcm-list__item-content-text', { treeview }), onClick: (e) => itemClick(e) },
114
- checkboxes && (treeview || (!treeview && item.type != 'group')) && (index$1.h("div", { class: "bcm-list__item-content-text-checkbox" },
115
- index$1.h(CheckboxTemplate, { indeterminate: item.indeterminate, checked: item.checked, disabled: item.disabled }))),
116
- index$1.h("span", Object.assign({ class: "bcm-list__item-content-text-inner" }, (item.title && { "title": item.title }), { innerHTML: text })))),
117
- (treeview || !treeview && item.type == "group") && isHaveChildren && (index$1.h("div", { class: "bcm-list__item-childs" }, (item.isSearching || item.open || (!treeview && item.type == "group")) &&
118
- item.items.map((item) => (index$1.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) })))))));
119
- };
120
-
121
- 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, }) => {
122
- const showSelectAll = !(treeview && searchFound > 0) && !(searchFound > 0);
123
- const setScrollHeight = () => {
124
- const itemHeight = size === 'small' ? 28 : size === 'medium' ? 36 : 48;
125
- const itemCount = searchFound == null ? (treeview ? items.length : totalData) : searchFound;
126
- const scrollHeight = itemCount * itemHeight || 0;
127
- return {
128
- 'min-height': `${scrollHeight}px`,
129
- 'overscroll-behavior': 'none',
130
- 'height': '100%',
131
- 'display': 'flex',
132
- 'flex-direction': 'column',
133
- };
134
- };
135
- return (index$1.h("div", { id: `bcm-list-${_id}`, class: bcmListContainer, "temp-id": `bcm-list-${tempId}`, style: { '--height': height, '--width': width }, onTransitionEnd: e => handleTransitionEnd(e) },
136
- data && searchable && (index$1.h("section", { class: "bcm-list__container-search" },
137
- index$1.h("bcm-search", { size: size, id: `bcm-list-${_id}-search`, data: data, clearable: true, placeholder: searchPlaceholder, "min-search-length": minSearchLength, searchIsOnlyChilds: searchIsOnlyChilds }))),
138
- index$1.h("main", { onScroll: e => onScrollEvent(e), class: "scrolling", style: { 'overscroll-behavior': 'none' } },
139
- index$1.h("div", { style: setScrollHeight() },
140
- checkAll && searchFound != 0 && items && items.length > 0 && checkboxes && showSelectAll && (index$1.h("section", { class: "bcm-list__container-select-all" },
141
- index$1.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) }))),
142
- items.map((item) => (index$1.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) }))),
143
- (!items || items.length === 0) && searchFound != 0 && (index$1.h("section", { class: "bcm-list__container-no-data" },
144
- index$1.h("bcm-empty", { style: { height: 'auto' }, icon: emptyIcon },
145
- index$1.h("span", { innerHTML: emptyText || 'No data' })))),
146
- searchFound == 0 && (index$1.h("section", { class: "bcm-list__container-no-data" },
147
- index$1.h("bcm-empty", { style: { height: 'auto' }, icon: emptyIcon },
148
- index$1.h("span", { innerHTML: emptyText || 'No Data Found' })))))),
149
- infoFooter && data && data.length > 0 && (index$1.h(InfoFooterTemplate, { selected: value === null || value === void 0 ? void 0 : value.length, total: totalData, found: searchFound, multiple: checkboxes, variableText: variableText }))));
150
- };
151
-
152
- const { state: state$1 } = index$2.createStore({
153
- value: new Map(),
154
- });
155
- const setValue$1 = val => {
156
- const { id, dataSource, options } = val;
157
- 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;
158
- const itemOptions = { size, checkboxes, template, allOpen, highlight, treeview };
159
- const data = {
160
- id: generate.snq(() => id, generate.Generate.UID),
161
- dataSource: dataSource && dataSource.length > 0 && recursive$1(dataSource, itemOptions),
162
- options: {
163
- type,
164
- treeview,
165
- checkboxes,
166
- searchable,
167
- value,
168
- name,
169
- label,
170
- size,
171
- disabled,
172
- readonly,
173
- highlight,
174
- required,
175
- hidden,
176
- fullWidth,
177
- height,
178
- maxHeight,
179
- minHeight,
180
- width,
181
- infoFooter,
182
- variableText,
183
- template,
184
- allOpen,
185
- keyControl,
186
- checkAll,
187
- linkedComponent,
188
- placeholder,
189
- searchPlaceholder,
190
- searchIsOnlyChilds,
191
- clearable,
192
- caption,
193
- noCaption,
194
- captionType,
195
- captionError,
196
- placement,
197
- },
198
- totalItems: (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) > 0 && calculateTotalItems(dataSource, options.treeview),
199
- totalRoots: dataSource === null || dataSource === void 0 ? void 0 : dataSource.length,
200
- };
201
- state$1.value.set(data.id, data);
202
- };
203
- const recursive$1 = (data, options, parentId, parentIndex = "0.") => {
204
- let recData = [];
205
- if (data && data.length > 0) {
206
- recData = data.map((item, index) => (Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ itemObject: item }, item), options), { parentId: generate.snq(() => parentId, null), open: options.allOpen || item.open || false }), ((options.treeview || (!options.treeview && item.type == 'group')) && item.items && item.items.length > 0
207
- ? { items: generate.snq(() => recursive$1(item.items, options, item.id, `${parentIndex}${index}`), []) }
208
- : { items: [] })), { ct: `${parentIndex}${index}` })));
209
- }
210
- return recData;
211
- };
212
- const removeValue$1 = _id => {
213
- state$1.value.delete(_id);
214
- };
215
- const getValue$1 = id => generate.snq(() => state$1.value.get(id), {});
216
- const calculateTotalItems = (dataSource, treeview) => {
217
- let total = 0;
218
- dataSource.forEach(item => {
219
- if (treeview || (!treeview && item.type != "group")) {
220
- total += 1;
221
- }
222
- if ((treeview || (!treeview && item.type == "group")) && item.items) {
223
- total += calculateTotalItems(item.items, treeview);
224
- }
225
- });
226
- return total;
227
- };
228
- const getData = id => {
229
- let data = [];
230
- const value = getValue$1(id);
231
- if (value) {
232
- const { dataSource } = value;
233
- data = dataSource;
234
- }
235
- return data;
236
- };
237
- const getDataPagination$1 = (id, limit = 3, ids) => {
238
- let data = [];
239
- const value = getValue$1(id);
240
- if (value) {
241
- const { dataSource } = value;
242
- data = !ids ? dataSource.slice(0, limit) : dataSource.filter(item => ids.indexOf(item.id) > -1).slice(0, limit);
243
- }
244
- return data;
245
- };
246
- const openGroup = (id, groupId, items, status) => {
247
- let dataSource;
248
- if (items) {
249
- dataSource = items;
250
- }
251
- else {
252
- const value = getValue$1(id);
253
- dataSource = value.dataSource;
254
- }
255
- if (dataSource) {
256
- dataSource.forEach(item => {
257
- if (status != undefined) {
258
- item.open = status;
259
- }
260
- else if (item.id == groupId) {
261
- item.open = !item.open;
262
- item.isSearching = item.open;
263
- if (!item.open && item.items) {
264
- openGroup(id, groupId, item.items, false);
265
- }
266
- }
267
- else if (item.items) {
268
- openGroup(id, groupId, item.items);
269
- }
270
- });
271
- }
272
- };
273
- const removeOtherTags = (id, ids, items) => {
274
- ids = Array.isArray(ids) ? ids : [ids];
275
- let dataSource;
276
- if (items) {
277
- dataSource = items;
278
- }
279
- else {
280
- const value = getValue$1(id);
281
- dataSource = value.dataSource;
282
- }
283
- if (dataSource) {
284
- ids.forEach(otherTagIds => {
285
- dataSource.forEach(child => {
286
- if (child.id == otherTagIds) {
287
- child.checked = false;
288
- child.itemObject.checked = false;
289
- }
290
- else if (child.items) {
291
- onRemoveItems(id, otherTagIds, child.items);
292
- }
293
- });
294
- });
295
- }
296
- };
297
- const onRemoveItems = (id, itemId, items) => {
298
- if (items) {
299
- items.forEach(item => {
300
- if (item.id == itemId) {
301
- item.checked = false;
302
- item.itemObject.checked = false;
303
- indeterminateStatus(id, item.parentId);
304
- }
305
- else if (item.items) {
306
- onRemoveItems(id, itemId, item.items);
307
- }
308
- });
309
- }
310
- };
311
- const addChecked = (id, ids) => {
312
- const value = getValue$1(id);
313
- if (value) {
314
- ids.forEach(item => {
315
- checkedItem(id, item);
316
- });
317
- }
318
- };
319
- const checkedItem = (id, itemId) => {
320
- findItem(id, itemId);
321
- };
322
- const findItem = (id, itemId, items) => {
323
- itemId = Array.isArray(itemId) ? itemId : [itemId];
324
- let dataSource;
325
- if (items) {
326
- dataSource = items;
327
- }
328
- else {
329
- const value = getValue$1(id);
330
- dataSource = value.dataSource;
331
- }
332
- if (dataSource) {
333
- dataSource.forEach(item => {
334
- if (itemId.includes(item.id)) {
335
- checkedProcess(id, item);
336
- if (item.parentId) {
337
- indeterminateStatus(id, item.parentId);
338
- }
339
- }
340
- else if (item.items) {
341
- findItem(id, itemId, item.items);
342
- }
343
- });
344
- }
345
- };
346
- const checkedProcess = (id, item, status) => {
347
- const value = getValue$1(id);
348
- if (value) {
349
- const treeview = value.options.treeview;
350
- if (item) {
351
- // && !item.hidden => select all bastığımızda hidden olanları seçmemesi içindi
352
- if (treeview || (!treeview && item.type != "group")) {
353
- if (!item.disabled) {
354
- if (status != undefined) {
355
- item.checked = status;
356
- }
357
- else {
358
- item.checked = !item.checked;
359
- }
360
- item.itemObject.checked = item.checked;
361
- item.indeterminate = item.checked ? "determinate" : "uncheck";
362
- }
363
- }
364
- if (item.items) {
365
- item.items.forEach(child => {
366
- checkedProcess(id, child, status == undefined ? item.checked : status);
367
- });
368
- }
369
- }
370
- }
371
- };
372
- const indeterminateStatus = (id, itemId, items) => {
373
- let dataSource;
374
- if (items) {
375
- dataSource = items;
376
- }
377
- else {
378
- const value = getValue$1(id);
379
- dataSource = value.dataSource;
380
- }
381
- if (dataSource) {
382
- dataSource.forEach(item => {
383
- if (item.id == itemId) {
384
- let allChecked = true;
385
- let allUnchecked = true;
386
- if (item.items) {
387
- item.items.map(child => {
388
- (child.checked || child.indeterminate === "indeterminate") && (allUnchecked = false);
389
- !child.checked && (allChecked = false);
390
- });
391
- }
392
- const indeterminateState = !allChecked && !allUnchecked ? "indeterminate" : allChecked ? "determinate" : "uncheck";
393
- item.indeterminate = indeterminateState;
394
- item.checked = indeterminateState == "determinate" ? true : false;
395
- item.itemObject.checked = item.checked;
396
- if (item.parentId) {
397
- indeterminateStatus(id, item.parentId);
398
- }
399
- }
400
- else if (item.items) {
401
- indeterminateStatus(id, itemId, item.items);
402
- }
403
- });
404
- }
405
- };
406
- const filterData = (id, ids, items, searchOtherTag) => {
407
- let checkeds = [];
408
- let visibled = [];
409
- getValue$1(id).isSearchOtherTag = searchOtherTag;
410
- let dataSource;
411
- if (items) {
412
- dataSource = items;
413
- }
414
- else {
415
- const value = getValue$1(id);
416
- dataSource = value.dataSource;
417
- }
418
- if (dataSource) {
419
- dataSource.forEach(item => {
420
- if (ids) {
421
- item.hidden = true;
422
- // const filter = ids.find((find) => find.id === item.id)
423
- var filter;
424
- for (let index = 0; index < ids.length; index++) {
425
- if (ids[index].id === item.id) {
426
- filter = ids[index];
427
- break;
428
- }
429
- }
430
- if (filter) {
431
- item.hidden = false;
432
- if (!getValue$1(id).isSearchOtherTag) {
433
- item.isSearching = true;
434
- }
435
- visibled.push(item);
436
- if (item.checked) {
437
- checkeds.push(item);
438
- }
439
- if (filter.items) {
440
- const { checkedItems, visibledItems } = filterData(id, filter.items, item.items, searchOtherTag);
441
- if (checkedItems) {
442
- checkeds = [...new Set([...checkeds, ...checkedItems])];
443
- }
444
- if (visibledItems) {
445
- visibled = [...new Set([...visibled, ...visibledItems])];
446
- }
447
- }
448
- }
449
- }
450
- else {
451
- item.hidden = false;
452
- if (item.items) {
453
- filterData(id, null, item.items);
454
- }
455
- visibled.push(item);
456
- item.isSearching = false;
457
- }
458
- });
459
- }
460
- return { checkedItems: checkeds !== null && checkeds !== void 0 ? checkeds : [], visibledItems: visibled !== null && visibled !== void 0 ? visibled : [] };
461
- };
462
- const getSelected = (id, items) => {
463
- let dataSource;
464
- let selected = null;
465
- if (items) {
466
- dataSource = items;
467
- }
468
- else {
469
- const value = getValue$1(id);
470
- dataSource = value.dataSource;
471
- }
472
- if (dataSource) {
473
- dataSource.forEach(item => {
474
- if (item.selected) {
475
- selected = item.itemObject;
476
- }
477
- else if (item.items) {
478
- const found = getSelected(id, item.items);
479
- if (found) {
480
- selected = found;
481
- }
482
- }
483
- });
484
- }
485
- return selected;
486
- };
487
- const getCheckedList = (id, items) => {
488
- let dataSource;
489
- let checkedList = [];
490
- let nestedResult = [];
491
- if (items) {
492
- dataSource = items;
493
- }
494
- else {
495
- const value = getValue$1(id);
496
- dataSource = value.dataSource;
497
- }
498
- if (dataSource) {
499
- dataSource.forEach(item => {
500
- var _a;
501
- const newItem = Object.assign(Object.assign({}, item.itemObject), { ct: item.ct });
502
- let foundChild = [];
503
- let foundItem = [];
504
- if (item.checked) {
505
- checkedList.push(newItem);
506
- foundItem.push(Object.assign(Object.assign({}, newItem), { items: [] }));
507
- }
508
- if (item.items) {
509
- const found = getCheckedList(id, item.items);
510
- if (((_a = found === null || found === void 0 ? void 0 : found.checkedList) === null || _a === void 0 ? void 0 : _a.length) > 0) {
511
- checkedList = [...checkedList, ...found.checkedList];
512
- }
513
- if (found.nestedResult.length > 0) {
514
- foundChild = found.nestedResult;
515
- }
516
- }
517
- if (foundChild.length > 0) {
518
- if (foundItem.length == 0) {
519
- foundItem.push(Object.assign(Object.assign({}, newItem), { items: [] }));
520
- }
521
- foundItem[0].items = foundChild;
522
- nestedResult.push(foundItem[0]);
523
- }
524
- else {
525
- if (foundItem.length > 0) {
526
- foundItem[0].items = foundChild;
527
- nestedResult.push(foundItem[0]);
528
- }
529
- }
530
- });
531
- }
532
- return { checkedList: (checkedList === null || checkedList === void 0 ? void 0 : checkedList.length) > 0 ? checkedList : null, nestedResult: nestedResult };
533
- };
534
- const selectedItem = (id, itemId, items) => {
535
- let dataSource;
536
- let selected = [];
537
- if (items) {
538
- dataSource = items;
539
- }
540
- else {
541
- const value = getValue$1(id);
542
- dataSource = value.dataSource;
543
- }
544
- if (dataSource) {
545
- dataSource.forEach(item => {
546
- if (itemId) {
547
- if (item.id == itemId) {
548
- // if (!item.selected){
549
- item.selected = true;
550
- item.itemObject.selected = item.selected;
551
- // }
552
- }
553
- else {
554
- if (item.selected) {
555
- item.selected = false;
556
- item.itemObject.selected = item.selected;
557
- }
558
- }
559
- }
560
- if (item.items) {
561
- const found = selectedItem(id, itemId, item.items);
562
- if ((found === null || found === void 0 ? void 0 : found.length) > 0) {
563
- selected = [...selected, ...found];
564
- }
565
- }
566
- if (item.selected) {
567
- selected.push(item.itemObject);
568
- }
569
- });
570
- }
571
- return selected && selected.length > 0 ? selected : null;
572
- };
573
- const setClear = (id, items) => {
574
- let dataSource;
575
- if (items) {
576
- dataSource = items;
577
- }
578
- else {
579
- const value = getValue$1(id);
580
- dataSource = value.dataSource;
581
- }
582
- if (dataSource) {
583
- dataSource.forEach(item => {
584
- var _a, _b, _c;
585
- item.checked && (item.checked = false);
586
- item.selected && (item.selected = false);
587
- item.indeterminate && (item.indeterminate = "uncheck");
588
- ((_a = item.itemObject) === null || _a === void 0 ? void 0 : _a.checked) && (item.itemObject.checked = false);
589
- ((_b = item.itemObject) === null || _b === void 0 ? void 0 : _b.selected) && (item.itemObject.selected = false);
590
- ((_c = item.itemObject) === null || _c === void 0 ? void 0 : _c.indeterminate) && (item.itemObject.indeterminate = "uncheck");
591
- if (item.items) {
592
- setClear(id, item.items);
593
- }
594
- });
595
- }
596
- };
597
- const selectAll = (id, status) => {
598
- const dataSource = getValue$1(id).dataSource;
599
- if (dataSource) {
600
- dataSource.forEach(item => {
601
- checkedProcess(id, item, status);
602
- });
603
- }
604
- };
605
- const updateOptions = (id, options) => {
606
- Object.keys(getValue$1(id).options).forEach(key => {
607
- getValue$1(id).options[key] = options[key];
608
- });
609
- };
610
- const removeState = id => {
611
- return Promise.resolve(state$1.value.delete(id));
612
- };
613
- const listState = {
614
- setValue: setValue$1,
615
- removeValue: removeValue$1,
616
- getValue: getValue$1,
617
- getData,
618
- getDataPagination: getDataPagination$1,
619
- openGroup,
620
- checkedItem,
621
- filterData,
622
- getSelected,
623
- getCheckedList,
624
- selectedItem,
625
- addChecked,
626
- setClear,
627
- selectAll,
628
- removeOtherTags,
629
- onRemoveItems,
630
- updateOptions,
631
- removeState,
632
- };
633
-
634
- class KeyControl {
635
- constructor(keyCode, element, elementName, childElementName) {
636
- this.elementName = '';
637
- this.childElementName = '';
638
- this.keyCode = keyCode;
639
- this.element = element;
640
- this.elementName = elementName;
641
- this.childElementName = childElementName;
642
- }
643
- getKeyCode() {
644
- return this.keyCode;
645
- }
646
- getElementName() {
647
- return this.elementName;
648
- }
649
- getChildElementName() {
650
- return this.childElementName;
651
- }
652
- getFocusedElementName() {
653
- return this.getElementName() + '.focused';
654
- }
655
- getFocusedElement() {
656
- return this.element.querySelectorAll(this.getFocusedElementName())[0] || null;
657
- }
658
- getFirstElement() {
659
- return this.element.querySelectorAll(this.getElementName())[0] || null;
660
- }
661
- getNextElement() {
662
- var _a;
663
- return ((_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.nextElementSibling) || this.getFirstElement();
664
- }
665
- getPreviousElement() {
666
- var _a;
667
- return ((_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.previousElementSibling) || this.getFirstElement();
668
- }
669
- getChildElement() {
670
- var _a;
671
- return ((_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.querySelectorAll(this.getChildElementName())[0]) || null;
672
- }
673
- getParentElement(element) {
674
- if (element && element) {
675
- const isRootElement = element && element.attributes['data-isroot'];
676
- if (isRootElement) {
677
- return element;
678
- }
679
- return this.getParentElement(element.parentNode);
680
- }
681
- }
682
- focusElementIsOpen() {
683
- var _a;
684
- return ((_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.classList.contains('bcm-list__item--open')) || false;
685
- }
686
- isRootElement() {
687
- var _a;
688
- return ((_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.querySelectorAll(this.getChildElementName()).length) > 0;
689
- }
690
- isRootElementIsOpen() {
691
- return this.getFocusedElement().classList.contains('bcm-list__item--open');
692
- }
693
- getFocusedChildElement() {
694
- var _a;
695
- return ((_a = this.getChildElement()) === null || _a === void 0 ? void 0 : _a.querySelectorAll('.focused')[0]) || null;
696
- }
697
- isLastElement() {
698
- var _a;
699
- return ((_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.nextElementSibling) === null;
700
- }
701
- focusParentElementFirstChild() {
702
- var _a, _b;
703
- return this.setFocus((_b = (_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.firstChild);
704
- }
705
- isFirstElement() {
706
- var _a;
707
- return ((_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.previousElementSibling) === null;
708
- }
709
- focusRootElement() {
710
- var _a, _b, _c;
711
- 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);
712
- }
713
- nextRootElement() {
714
- var _a, _b, _c;
715
- 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);
716
- }
717
- findFocusElementParent() {
718
- return this.getFocusedElement().parentNode.querySelectorAll('.bcm-list__item--open');
719
- }
720
- getLastElement() {
721
- return this.element.querySelectorAll(this.getElementName())[this.element.querySelectorAll(this.getElementName()).length - 1] || null;
722
- }
723
- setFocus(element) {
724
- element.focus();
725
- }
726
- }
727
-
728
- class ListKeyControl extends KeyControl {
729
- constructor(keyCode, element, treeview, checkBoxes) {
730
- super(keyCode, element, '.bcm-list__item', '.bcm-list__item-childs');
731
- this.isTreeview = false;
732
- this.isCheckBoxes = false;
733
- this.isTreeview = treeview;
734
- this.isCheckBoxes = checkBoxes;
735
- }
736
- keyUpControl() {
737
- if (this.isTreeview) {
738
- this.keyUpTreeview();
739
- }
740
- else {
741
- if (this.isFirstElement()) {
742
- this.setFocus(this.getLastElement());
743
- }
744
- else {
745
- this.setFocus(this.getPreviousElement());
746
- }
747
- }
748
- }
749
- keyDownTreeView() {
750
- var _a;
751
- if (this.isTreeview) {
752
- if (this.isRootElement() && this.isRootElementIsOpen()) {
753
- const childs = this.getChildElement();
754
- if (childs) {
755
- this.setFocus(childs.firstChild);
756
- }
757
- }
758
- else {
759
- if (this.isLastElement() && this.getParentElement(this.getFocusedElement())) {
760
- this.setFocus((_a = this.getParentElement(this.getFocusedElement())) === null || _a === void 0 ? void 0 : _a.nextElementSibling);
761
- }
762
- else {
763
- this.setFocus(this.getNextElement());
764
- }
765
- }
766
- }
767
- }
768
- keyUpTreeview() {
769
- if (this.isFirstElement()) {
770
- const parent = this.getParentElement(this.getFocusedElement());
771
- this.setFocus(parent);
772
- }
773
- else {
774
- const previousElement = this.getPreviousElement();
775
- if (previousElement) {
776
- if (previousElement.classList.contains('bcm-list__item--open')) {
777
- const getChildElement = previousElement.querySelectorAll(this.getChildElementName())[0];
778
- console.log({ getChildElement });
779
- this.setFocus(getChildElement.lastChild);
780
- }
781
- else {
782
- this.setFocus(previousElement);
783
- }
784
- }
785
- }
786
- }
787
- keyDownControl() {
788
- if (this.isTreeview) {
789
- this.keyDownTreeView();
790
- }
791
- else {
792
- if (this.isLastElement()) {
793
- this.setFocus(this.getFirstElement());
794
- }
795
- else {
796
- this.setFocus(this.getNextElement());
797
- }
798
- }
799
- }
800
- keyRightControl() {
801
- if (this.isTreeview) {
802
- if (!this.isRootElementIsOpen() && this.isRootElement()) {
803
- const { id } = this.getFocusedElement();
804
- this.openGroup(id);
805
- }
806
- }
807
- }
808
- keyLeftControl() {
809
- if (this.isTreeview) {
810
- if (this.isRootElementIsOpen() && this.isRootElement()) {
811
- const { id } = this.getFocusedElement();
812
- this.openGroup(id);
813
- }
814
- }
815
- }
816
- keyEnterControl() { }
817
- keySpaceControl() {
818
- if (this.isCheckBoxes) {
819
- const { id } = this.getFocusedElement();
820
- this.checkedItem(id);
821
- }
822
- }
823
- keyDown() {
824
- switch (this.getKeyCode()) {
825
- case bcm.Bcm.KeyCode.up:
826
- this.keyUpControl();
827
- break;
828
- case bcm.Bcm.KeyCode.down:
829
- this.keyDownControl();
830
- break;
831
- case bcm.Bcm.KeyCode.left:
832
- this.keyLeftControl();
833
- break;
834
- case bcm.Bcm.KeyCode.right:
835
- this.keyRightControl();
836
- break;
837
- case bcm.Bcm.KeyCode.enter:
838
- this.keyEnterControl();
839
- break;
840
- case bcm.Bcm.KeyCode.space:
841
- this.keySpaceControl();
842
- break;
843
- }
844
- }
845
- keyUp() { }
846
- }
847
-
848
- 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{scroll-behavior:smooth;padding:0 8px;flex:1;overflow:auto;display:flex;flex-direction:column}.bcm-list__container-search{margin:0 8px}.bcm-list__container-search:after{margin:4px 0}.bcm-list__container-no-data{flex:1;display:flex;justify-content:stretch;align-items:stretch;padding-bottom:4px}.bcm-list__container.error{border-color:var(--bcm-color-red-6)}.bcm-list__container.full-width{width:100%}.bcm-list__container.bcm-list__type-linked-component,.bcm-list__container.bcm-list__type-select,.bcm-list__container.bcm-list__type-autocomplete{opacity:0;visibility:hidden;position:absolute;top:0;left:0;height:0;width:0;transform:translateY(10%);z-index:10800;transition:visibility 0s linear 400ms, opacity 100ms, transform 200ms}.bcm-list__container.bcm-list__type-linked-component.bcm-list--top,.bcm-list__container.bcm-list__type-select.bcm-list--top,.bcm-list__container.bcm-list__type-autocomplete.bcm-list--top{transform:translateY(-10%)}.bcm-list__container.bcm-list__type-linked-component.is-open,.bcm-list__container.bcm-list__type-select.is-open,.bcm-list__container.bcm-list__type-autocomplete.is-open{opacity:1;transform:translateY(0);visibility:visible;transition:visibility 0s linear 0s, opacity 100ms, transform 100ms}.bcm-list__container.bcm-list__type-linked-component{margin-top:2px}.bcm-list__label{line-height:1}.bcm-list__input{display:flex;align-items:center;justify-content:space-between;box-sizing:border-box;border:1px solid var(--bcm-new-ds-color-slate-300);border-radius:4px;color:var(--bcm-new-ds-color-slate-600);background-color:var(--bcm-new-ds-color-white);user-select:none;cursor:pointer;padding:0 8px;height:32px;overflow:hidden;position:relative;transition:background-color 100ms, border-color 100ms}.bcm-list__input-spinner{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center;background-color:var(--bcm-color-grey-1);opacity:0;visibility:hidden;transition:opacity 0.2s ease-in-out;z-index:-1}.bcm-list__input-spinner.is-open{opacity:1;visibility:visible;z-index:1}.bcm-list__input-container{flex:1;display:block;overflow:hidden}.bcm-list__input-container.value-empty{color:var(--bcm-color-grey-6)}.bcm-list__input-container.type-single,.bcm-list__input-container.value-empty{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bcm-list__input-placeholder{color:var(--bcm-color-grey-6)}.bcm-list__input-tag-container{height:100%;width:100%;display:flex;align-items:center;justify-content:flex-start;flex-wrap:nowrap;grid-gap:2px;line-height:1}.bcm-list__input-buttons{display:flex;align-items:center;justify-content:flex-end;grid-gap:4px}.bcm-list__input-buttons-button{display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding: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-600);background-color:var(--bcm-new-ds-color-slate-50);transition:background-color 0.2s ease}.bcm-list__item-content.disabled{color:var(--bcm-new-ds-color-slate-300);background-color:var(--bcm-new-ds-color-slate-50);user-select:none;cursor:not-allowed}.bcm-list__item-content.selected{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-new-ds-color-blue-500)}.bcm-list__item-content.selected:hover:not(.disabled){color:var(--bcm-new-ds-color-white);background-color:var(--bcm-new-ds-color-blue-600)}.bcm-list__item-content:hover:not(.disabled){color:var(--bcm-new-ds-color-slate-600);background-color:var(--bcm-new-ds-color-slate-100)}.bcm-list__item-content:active:not(.disabled){color:var(--bcm-new-ds-color-slate-600);background-color:var(--bcm-new-ds-color-slate-200)}.bcm-list__item-content-collapse-icon{width:16px;padding:0 8px;display:flex;align-items:center;justify-content:center;font-size:16px}.bcm-list__item-content-collapse-icon.child{cursor:pointer}.bcm-list__item-content-text{user-select:none;padding:8px;width:100%;display:flex;flex-direction:row;align-items:center;justify-content:flex-start}.bcm-list__item-content-text.treeview{padding:8px 0}.bcm-list__item-content-text-checkbox{display:flex;flex-direction:row;align-items:center;justify-content:center;flex-wrap:nowrap;margin-right:8px}.bcm-list__item-content-text-checkbox .bcm-checkbox{margin:0}.bcm-list__item-content-text-inner{width:100%}.bcm-list__item-content-text mark{padding:0;margin:0;font-size:inherit;color:var(--bcm-color-grey-8);background-color:var(--bcm-color-yellow-4)}.bcm-list__item-childs{padding-left:16px}.bcm-list__item-small{padding:2px 0 2px 8px;font-size:10px;line-height:calc(10px + 8px)}.bcm-list__item-small .bcm-list__item-content-text{padding:3px 4px}.bcm-list__item-medium{font-size:12px;line-height:calc(12px + 8px)}.bcm-list__item-medium .bcm-list__item-content-text{padding:6px 4px}.bcm-list__item-large{font-size:14px;line-height:calc(14px + 8px)}.bcm-list__item-large .bcm-list__item-content-text{padding:9px 4px}.bcm-list__item--readonly:focus>.bcm-list__item-content:not(.disabled),.bcm-list__item--readonly.focused>.bcm-list__item-content:not(.disabled){color:var(--bcm-color-grey-7)}.bcm-list__item--readonly>.bcm-list__item-content{color:var(--bcm-color-grey-7)}.bcm-list__item--readonly>.bcm-list__item-content:hover,.bcm-list__item--readonly>.bcm-list__item-content:focus{color:var(--bcm-color-grey-7)}.bcm-list__item--group{border-radius:4px}.bcm-list__item--group:focus>.bcm-list__item-content:not(.disabled){background-color:var(--bcm-new-ds-color-slate-50);color:var(--bcm-new-ds-color-slate-600)}.bcm-list__item--group>.bcm-list__item-content{background-color:var(--bcm-new-ds-color-slate-50);color:var(--bcm-new-ds-color-slate-600);border-radius:4px 4px 0 0;cursor:default;font-size:14px;line-height:calc(14px + 8px);font-weight:500;position:sticky;top:0}.bcm-list__item--group>.bcm-list__item-content>.bcm-list__item-content-text{padding:4px 8px 4px 16px}.bcm-list__item--group>.bcm-list__item-content:hover,.bcm-list__item--group>.bcm-list__item-content:focus{color:var(--bcm-new-ds-color-slate-800);background-color:var(--bcm-new-ds-color-slate-50)}.bcm-list__item--group>.bcm-list__item-content-unclickable:hover{color:var(--bcm-new-ds-color-slate-700);background-color:var(--bcm-new-ds-color-slate-50)}.bcm-list__item--group>.bcm-list__item-childs{background-color:var(--bcm-new-ds-color-slate-50);color:var(--bcm-new-ds-color-slate-600);padding-bottom:8px;border-radius:0 0 4px 4px;padding-left:8px}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content{background-color:var(--bcm-new-ds-color-white);color:var(--bcm-new-ds-color-slate-600)}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content:hover{background-color:var(--bcm-new-ds-color-slate-100)}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content:active{background-color:var(--bcm-new-ds-color-slate-200)}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content:focus-visible{background-color:var(--bcm-new-ds-color-slate-300)}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content.selected{background-color:var(--bcm-new-ds-color-blue-500);color:var(--bcm-new-ds-color-white)}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content.selected:hover{background-color:var(--bcm-new-ds-color-blue-600)}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content.selected:active{background-color:var(--bcm-new-ds-color-blue-700)}.bcm-list__linked{display:none}.bcm-list .bcm-tag--other .value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bcm-info-footer{text-align:right;padding:4px 8px;background-color:var(--bcm-new-ds-color-slate-100);color:var(--bcm-new-ds-color-slate-600);border-radius:0 0 4px 4px}";
849
-
850
- var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
851
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
852
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
853
- r = Reflect.decorate(decorators, target, key, desc);
854
- else
855
- for (var i = decorators.length - 1; i >= 0; i--)
856
- if (d = decorators[i])
857
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
858
- return c > 3 && r && Object.defineProperty(target, key, r), r;
859
- };
860
- const BcmList = class {
861
- constructor(hostRef) {
862
- index$1.registerInstance(this, hostRef);
863
- this.bcmChecklist = index$1.createEvent(this, "bcm-checklist", 7);
864
- this.bcmSelected = index$1.createEvent(this, "bcm-selected", 7);
865
- this.change = index$1.createEvent(this, "bcm-change", 7);
866
- this.open = index$1.createEvent(this, "bcm-open", 3);
867
- this.close = index$1.createEvent(this, "bcm-close", 3);
868
- this.listClose = index$1.createEvent(this, "bcm-list-close", 7);
869
- this.listOpen = index$1.createEvent(this, "bcm-list-open", 7);
870
- this.debounce = null;
871
- this.debounceHandler = generate.Generate.debounceInput(() => this.listenResize(), 300, false);
872
- this._id = generate.Generate.UID();
873
- this.tempId = generate.Generate.UID();
874
- this.type = bcm.Bcm$1.ListType.listbox;
875
- this.treeview = false;
876
- this.checkboxes = false;
877
- this.searchable = false;
878
- this.value = null;
879
- this.inputText = undefined;
880
- this.name = undefined;
881
- this.label = undefined;
882
- this.size = bcm.Bcm$1.Size.medium;
883
- this.disabled = false;
884
- this.readonly = false;
885
- this.highlight = false;
886
- this.highlightText = undefined;
887
- this.required = false;
888
- this.hidden = false;
889
- this.fullWidth = false;
890
- this.height = "256px";
891
- this.maxHeight = "500px";
892
- this.minHeight = "150px";
893
- this.width = "256px";
894
- this.tooltip = undefined;
895
- this.infoFooter = false;
896
- this.variableText = "item";
897
- this.template = undefined;
898
- this.allOpen = false;
899
- this.keyControl = false;
900
- this.checkAll = true;
901
- this.stopDeepClean = false;
902
- this.openIntersecting = false;
903
- this.linkedComponent = undefined;
904
- this.isOpen = 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.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.Bcm$1.Status.default,
942
- indeterminate: "uncheck",
943
- };
944
- this.placement = bcm.Bcm$1.Placement["bottom-start"];
945
- this.disableChangeEvent = false;
946
- this.data = [];
947
- window.addEventListener("scroll", this.handleWheel.bind(this), true);
948
- window.addEventListener("wheel", this.handleWheel.bind(this), true);
949
- window.addEventListener("resize", this.handleResize.bind(this), true);
950
- }
951
- connectedCallback() {
952
- if (this.height != "256px") {
953
- if (this.height.indexOf("px") > -1) {
954
- this.limit = Math.floor(+this.height.replace("px", "") / 10);
955
- }
956
- else {
957
- this.limit = Math.floor(+(window.innerHeight / 10));
958
- }
959
- this.searchResultLimit = this.limit;
960
- this.markForCheck();
961
- }
962
- const checkElementWithDom = document.querySelectorAll(`#bcm-list-${this._id}`);
963
- (checkElementWithDom === null || checkElementWithDom === void 0 ? void 0 : checkElementWithDom.length) > 1 && checkElementWithDom.forEach((item, index) => index > 0 && item.remove());
964
- }
965
- componentWillRender() {
966
- this.calculateLocation();
967
- }
968
- componentShouldUpdate(newVal, oldVal, propName) {
969
- if (Object.keys(this.getOptions()).indexOf(propName) > -1 && newVal !== oldVal) {
970
- this.updateOptions();
971
- }
972
- }
973
- get containerWidth() {
974
- var _a, _b;
975
- return (_b = (_a = this.el) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) === null || _b === void 0 ? void 0 : _b.width;
976
- }
977
- get tagCount() {
978
- return this.containerWidth > 0 ? Math.floor(+(this.containerWidth - 100) / 85) : 0;
979
- }
980
- get tagData() {
981
- return generate.snq(() => {
982
- var _a;
983
- return (_a = this.value) === null || _a === void 0 ? void 0 : _a.map(item => ({
984
- value: item.id,
985
- label: stringHelper.StringHelper.textLimitter(item.text, 7),
986
- text: item.tooltipMessage || item.tagTitle || item.text,
987
- }));
988
- }, []);
989
- }
990
- async componentDidLoad() {
991
- await this.initState();
992
- // if (this.type == "select" || this.type == "autocomplete" || this.linkedComponent) {
993
- // const list = this.el.querySelector(`#bcm-list-${this._id}`);
994
- // if (list) {
995
- // document.body.appendChild(list);
996
- // }
997
- // }
998
- }
999
- disconnectedCallback() {
1000
- this.isOpen = false;
1001
- if (this.stopDeepClean)
1002
- return;
1003
- listState.removeState(this._id);
1004
- this.el.innerHTML = "";
1005
- if (this.type == "select" || this.type == "autocomplete" || this.linkedComponent) {
1006
- const list = document.querySelectorAll(`#bcm-list-${this._id}`);
1007
- if (list === null || list === void 0 ? void 0 : list.length) {
1008
- list.forEach(item => item.remove());
1009
- this.el.remove();
1010
- }
1011
- }
1012
- }
1013
- watchId(_, oldVal) {
1014
- // console.info('Changed component id:', oldVal + ' -> ' + newVal);
1015
- listState.removeState(oldVal);
1016
- this.initState();
1017
- }
1018
- handleValueChange(newVal, oldVal) {
1019
- var _a;
1020
- if (generate.Generate.objectIsEmpty(this.returnFilterData)) {
1021
- this.handleIndeterminate(((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) || 0, this.totalData);
1022
- }
1023
- if (this.checkboxes) {
1024
- if (!validators.Validators.compareTwoArrayIsSame(newVal, oldVal)) {
1025
- this.bcmChecklist.emit(this.value);
1026
- !this.disableChangeEvent && this.change.emit(this.value);
1027
- }
1028
- }
1029
- else {
1030
- if ((newVal === null || newVal === void 0 ? void 0 : newVal.id) != (oldVal === null || oldVal === void 0 ? void 0 : oldVal.id)) {
1031
- !this.disableChangeEvent && this.change.emit(this.value);
1032
- }
1033
- }
1034
- }
1035
- watchReturnFilterData(newVal) {
1036
- var _a;
1037
- const { checkedItems, visibledItems } = newVal;
1038
- if (checkedItems && visibledItems) {
1039
- this.handleIndeterminate(checkedItems.length, visibledItems.length);
1040
- }
1041
- else {
1042
- this.handleIndeterminate(((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) || 0, this.totalData);
1043
- }
1044
- }
1045
- async handleOpen() {
1046
- if (this.isOpen) {
1047
- this.detectClone();
1048
- if (this.type == "select" || this.type == "autocomplete" || this.linkedComponent) {
1049
- const list = this.el.querySelector(`#bcm-list-${this._id}`);
1050
- if (list) {
1051
- const bcmOverlayContainer = document.querySelector("#bcm-overlay-container");
1052
- bcmOverlayContainer.appendChild(list);
1053
- }
1054
- }
1055
- this.open.emit();
1056
- this.calculateLocation();
1057
- this.onSelectSearch();
1058
- }
1059
- else {
1060
- this.listScrollToTop();
1061
- this.close.emit();
1062
- this.listClose.emit();
1063
- await utils.delay(100);
1064
- this.unSelectOther();
1065
- }
1066
- }
1067
- listScrollToTop() {
1068
- const list = document.querySelector(`#bcm-list-${this._id}`);
1069
- if (list) {
1070
- list.querySelector(".scrolling").scrollTop = 0;
1071
- }
1072
- }
1073
- async dataChanged(newValue, oldValue) {
1074
- if (!validators.Validators.compareTwoArrayIsSame(newValue, oldValue)) {
1075
- await this.initState();
1076
- }
1077
- }
1078
- isIntersecting(e) {
1079
- const target = e === null || e === void 0 ? void 0 : e.target;
1080
- if (target && target.id === this._id) {
1081
- this.listenResize();
1082
- }
1083
- }
1084
- handleSlotItems(e) {
1085
- var _a;
1086
- if (((_a = e === null || e === void 0 ? void 0 : e.detail) === null || _a === void 0 ? void 0 : _a.length) > 0) {
1087
- this.data = e.detail;
1088
- }
1089
- }
1090
- handleChange(e) {
1091
- if (e.target.id == `bcm-list-input-tag-container-${this._id}-autocomplete-input`) {
1092
- e.stopImmediatePropagation();
1093
- }
1094
- }
1095
- handleResize() {
1096
- this.calculateLocation();
1097
- this.debounceHandler();
1098
- }
1099
- handleWheel(event) {
1100
- if (this.isOpen) {
1101
- const list = document.querySelector(`#bcm-list-${this._id}`);
1102
- const isClickInside = list && generate.Generate.findEventPath(event, list);
1103
- if (isClickInside) {
1104
- if (this.type == "select" || this.type == "autocomplete" || this.linkedComponent) {
1105
- this.calculateLocation();
1106
- }
1107
- }
1108
- else {
1109
- this.hide();
1110
- }
1111
- }
1112
- }
1113
- clearAutocomplete() {
1114
- if (this.type == "autocomplete") {
1115
- const autocompleteInput = this.getAutoCompleteInput();
1116
- if (autocompleteInput) {
1117
- autocompleteInput.handleClear(false);
1118
- }
1119
- }
1120
- }
1121
- async handleSelectOtherTag(e) {
1122
- if (this.disabled)
1123
- return;
1124
- const { id, checked } = e.detail;
1125
- this.isSelectedOther = checked;
1126
- if (id) {
1127
- checked ? this.filterOtherList(id) : this.unSelectOther();
1128
- this.isOpen = true;
1129
- }
1130
- }
1131
- async handleDeleteTag(e) {
1132
- var _a;
1133
- if (this.disabled)
1134
- return;
1135
- const { id } = e.detail;
1136
- this.isSelectedOther && this.unSelectOther();
1137
- Array.isArray(id) ? listState.removeOtherTags(this._id, id) : listState.checkedItem(this._id, id);
1138
- this.value = (await this.getCheckedList()).checkedList;
1139
- this.handleIndeterminate(((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) || 0, this.totalData);
1140
- }
1141
- async handleSelectTag(_) {
1142
- if (this.disabled)
1143
- return;
1144
- this.clearAutocomplete();
1145
- this.onSelectSearch();
1146
- this.unSelectOther();
1147
- }
1148
- handleClick(event) {
1149
- var _a;
1150
- if (this.disabled)
1151
- return;
1152
- const list = document.querySelector(`#bcm-list-${this._id}`);
1153
- const isClickInside = generate.Generate.findEventPath(event, this.el) || (list && generate.Generate.findEventPath(event, list));
1154
- if (isClickInside) {
1155
- if (this.debounce !== null) {
1156
- event.preventDefault();
1157
- event.stopPropagation();
1158
- clearTimeout(this.debounce);
1159
- this.debounce = null;
1160
- }
1161
- this.debounce = setTimeout(() => {
1162
- this.debounce = null;
1163
- }, 300);
1164
- }
1165
- if (!isClickInside) {
1166
- if (this.type == "autocomplete") {
1167
- const autocompleteInput = this.getAutoCompleteInput();
1168
- if (autocompleteInput) {
1169
- if (this.checkboxes) {
1170
- autocompleteInput.setValue("");
1171
- }
1172
- else {
1173
- autocompleteInput.setValue(((_a = this.value) === null || _a === void 0 ? void 0 : _a.text) || "");
1174
- }
1175
- }
1176
- }
1177
- }
1178
- const clickToTag = generate.Generate.findEventPathWithKey(event, "className", ["bcm-tag"]);
1179
- const clickToOtherTag = generate.Generate.findEventPathWithKey(event, "className", ["bcm-tag bcm-tag--other"]);
1180
- const clickToSelect = generate.Generate.findEventPathWithKey(event, "id", [`bcm-list-input-${this._id}`, `bcm-list-label-${this._id}`]);
1181
- const clickToTagDismiss = generate.Generate.findEventPathWithKey(event, "className", ["right close-button"]);
1182
- if (clickToSelect && !clickToTagDismiss && this.type != "autocomplete") {
1183
- this.isOpen = clickToTag || clickToOtherTag ? true : !this.isOpen;
1184
- }
1185
- if (list) {
1186
- if (this.isOpen) {
1187
- if (!list.contains(event.target) && !this.el.contains(event.target)) {
1188
- this.isOpen = false;
1189
- // this.unSelectOther()
1190
- }
1191
- }
1192
- }
1193
- }
1194
- bcmOnSearchClear(event) {
1195
- var _a, _b;
1196
- if (this.type == "autocomplete") {
1197
- 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`) {
1198
- if (event.detail) {
1199
- this.setClear();
1200
- }
1201
- }
1202
- }
1203
- }
1204
- bcmOnSearch(event) {
1205
- var _a, _b, _c, _d, _e, _f;
1206
- 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`) {
1207
- this.searchGetParents = generate.snq(() => { var _a; return (_a = event.detail) === null || _a === void 0 ? void 0 : _a.parentIndex; }, null);
1208
- this.searchResultLimit = 10;
1209
- 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;
1210
- this.returnFilterData = listState.filterData(this._id, (_e = event.detail) === null || _e === void 0 ? void 0 : _e.nestedResult);
1211
- if (this.searchFound > 0 && this.highlight) {
1212
- this.highlightText = (_f = event.detail) === null || _f === void 0 ? void 0 : _f.value;
1213
- }
1214
- if (this.type == "autocomplete") {
1215
- this.isOpen = true;
1216
- }
1217
- if (!event.detail.result) {
1218
- if (this.type == "autocomplete") {
1219
- this.isOpen = false;
1220
- }
1221
- else {
1222
- this.returnFilterData = {};
1223
- listState.filterData(this._id, null);
1224
- }
1225
- // this.isSelectedOther = false
1226
- this.searchResultLimit = null;
1227
- this.highlightText = null;
1228
- }
1229
- this.markForCheck();
1230
- }
1231
- }
1232
- //keyboard navigation
1233
- handleKeyDown(ev) {
1234
- const keycode = ev.keyCode || ev.which;
1235
- if (keycode === bcm.Bcm$1.KeyCode.escape) {
1236
- if (this.isOpen) {
1237
- this.isOpen = false;
1238
- ev.preventDefault();
1239
- ev.stopPropagation();
1240
- ev.stopImmediatePropagation();
1241
- }
1242
- }
1243
- if (this.keyControl) {
1244
- const keyboard = new ListKeyControl(keycode, this.el, this.treeview, this.checkboxes);
1245
- keyboard.openGroup = openGroupId => {
1246
- this.openGroup(openGroupId);
1247
- };
1248
- keyboard.checkedItem = checkedItemId => {
1249
- this.checkedItem(checkedItemId);
1250
- };
1251
- keyboard.keyDown();
1252
- }
1253
- }
1254
- handleKeyUp(ev) {
1255
- if (this.keyControl) {
1256
- const focusedList = generate.Generate.findEventPath(ev, this.el);
1257
- if (focusedList) {
1258
- const list = document.getElementById(`bcm-list-${this._id}`);
1259
- if (list) {
1260
- const items = list.querySelectorAll(".bcm-list__item.focused");
1261
- if (items.length > 0) {
1262
- const main = list.querySelector("main");
1263
- const itemHeight = items[0].offsetHeight;
1264
- const listHeight = main.offsetHeight;
1265
- const itemTop = items[0].offsetTop;
1266
- if (itemTop > listHeight) {
1267
- main.scrollTop = itemTop - listHeight / 2 + itemHeight / 2;
1268
- }
1269
- if (itemTop < listHeight) {
1270
- main.scrollTop = itemTop - listHeight / 2 - itemHeight / 2;
1271
- }
1272
- }
1273
- }
1274
- }
1275
- }
1276
- }
1277
- async set(data) {
1278
- if (data) {
1279
- if (Array.isArray(data)) {
1280
- this.addChecked(data);
1281
- }
1282
- if (typeof data === "string" || typeof data === "number") {
1283
- this.selectedItem(data);
1284
- }
1285
- }
1286
- else {
1287
- this.setClear();
1288
- }
1289
- }
1290
- async get() {
1291
- var _a, _b;
1292
- 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;
1293
- }
1294
- async getCheckedList() {
1295
- return Promise.resolve(listState.getCheckedList(this._id));
1296
- }
1297
- async getSelected() {
1298
- return Promise.resolve(listState.getSelected(this._id));
1299
- }
1300
- async getValue() {
1301
- return Promise.resolve(this.value);
1302
- }
1303
- async addChecked(ids = [], save = false, emit = true) {
1304
- if (ids && ids.length > 0) {
1305
- if (!save) {
1306
- listState.setClear(this._id);
1307
- await utils.delay(10);
1308
- }
1309
- await listState.addChecked(this._id, ids);
1310
- await utils.delay(10);
1311
- emit && (this.value = (await this.getCheckedList()).checkedList);
1312
- this.markForCheck();
1313
- }
1314
- return Promise.resolve(this.value);
1315
- }
1316
- async selected(id) {
1317
- if (id) {
1318
- return Promise.resolve(await this.selectedItem(id));
1319
- }
1320
- return false;
1321
- }
1322
- async setClear(e) {
1323
- listState.setClear(this._id);
1324
- this.value = null;
1325
- this.inputText = "";
1326
- this.isOpen = false;
1327
- this.selectAllItem.indeterminate = "uncheck";
1328
- this.markForCheck();
1329
- if (e) {
1330
- e.stopPropagation();
1331
- e.preventDefault();
1332
- }
1333
- await utils.delay(10);
1334
- return Promise.resolve();
1335
- }
1336
- async resetCaption() {
1337
- await utils.delay(10);
1338
- this.caption = this.captionCache;
1339
- this.captionType = this.captionTypeCache;
1340
- this.captionError = null;
1341
- await utils.delay(10);
1342
- return Promise.resolve();
1343
- }
1344
- detectClone() {
1345
- const list = document.querySelectorAll(`#bcm-list-${this._id}`);
1346
- if (list.length > 0) {
1347
- list.forEach((item) => {
1348
- const tempid = item.getAttribute("temp-id");
1349
- if (tempid !== `bcm-list-${this.tempId}`) {
1350
- console.warn(`[bcm-list] - Detected duplicate temp-id="${tempid}"`);
1351
- item.remove();
1352
- }
1353
- });
1354
- }
1355
- }
1356
- async show() {
1357
- this.isOpen = true;
1358
- return Promise.resolve();
1359
- }
1360
- async hide() {
1361
- this.isOpen = false;
1362
- return Promise.resolve();
1363
- }
1364
- updateOptions() {
1365
- listState.updateOptions(this._id, this);
1366
- }
1367
- handleIndeterminate(checkeds, total) {
1368
- 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 });
1369
- }
1370
- listenResize() {
1371
- this.calculateLocation();
1372
- this.markForCheck();
1373
- }
1374
- async unSelectOther() {
1375
- await this.onClearSearch();
1376
- this.isSelectedOther = false;
1377
- this.searchFound = null;
1378
- this.returnFilterData = {};
1379
- listState.filterData(this._id, null);
1380
- await utils.delay(10);
1381
- return Promise.resolve();
1382
- }
1383
- async onClearSearch() {
1384
- const searchInput = document.getElementById(`bcm-list-${this._id}-search`);
1385
- if (searchInput) {
1386
- await searchInput.handleClear();
1387
- }
1388
- return Promise.resolve();
1389
- }
1390
- async onSelectSearch() {
1391
- const searchInput = document.getElementById(`bcm-list-${this._id}-search`);
1392
- if (searchInput) {
1393
- await utils.delay(100);
1394
- searchInput.onBcmFocus();
1395
- searchInput.onBcmSelect();
1396
- }
1397
- }
1398
- async filterOtherList(ids) {
1399
- const checklist = (await this.getCheckedList()).nestedResult;
1400
- const filter = generate.Generate.convertIdsToNestedData(ids, checklist);
1401
- this.returnFilterData = await listState.filterData(this._id, filter, null, true);
1402
- this.searchFound = (ids === null || ids === void 0 ? void 0 : ids.length) || 0;
1403
- this.limit = 500;
1404
- this.searchGetParents = null;
1405
- await utils.delay(1000);
1406
- this.markForCheck();
1407
- }
1408
- async initState() {
1409
- var _a, _b, _c;
1410
- this.onClearSearch();
1411
- await listState.setValue({
1412
- id: this._id,
1413
- dataSource: this.data && generate.snq(() => (typeof this.data == "string" ? JSON.parse(this.data) : this.data), []),
1414
- options: this,
1415
- });
1416
- const { totalRoots, totalItems } = listState.getValue(this._id);
1417
- this.totalData = totalItems;
1418
- this.totalRootData = totalRoots;
1419
- this.value = this.checkboxes ? (await this.getCheckedList()).checkedList : listState.selectedItem(this._id) ? listState.selectedItem(this._id)[0] : null;
1420
- if (!this.checkboxes) {
1421
- this.inputText = ((_a = this.value) === null || _a === void 0 ? void 0 : _a.text) || null;
1422
- }
1423
- // checkli olan subparentların indeterminate kontrolü için
1424
- if (this.checkboxes && ((_b = this.value) === null || _b === void 0 ? void 0 : _b.length) > 0) {
1425
- const checkedIDs = [];
1426
- this.value.forEach(item => {
1427
- if (!item.items || item.items.length === 0) {
1428
- checkedIDs.push(item.id);
1429
- }
1430
- });
1431
- await this.addChecked(checkedIDs, false, false);
1432
- }
1433
- await this.handleIndeterminate((_c = this.value) === null || _c === void 0 ? void 0 : _c.length, this.totalData);
1434
- await this.markForCheck();
1435
- }
1436
- async markForCheck() {
1437
- await utils.delay(10);
1438
- this.tick = generate.Generate.UID();
1439
- }
1440
- getOptions() {
1441
- return generate.snq(() => listState.getValue(this._id).options, {});
1442
- }
1443
- getItems() {
1444
- if (this.isSelectedOther) {
1445
- return this.returnFilterData["checkedItems"];
1446
- }
1447
- return generate.snq(() => listState.getData(this._id), []);
1448
- }
1449
- getLimitedItems(ids) {
1450
- return generate.snq(() => listState.getDataPagination(this._id, this.searchResultLimit || this.limit, ids), []);
1451
- }
1452
- openGroup(parentId) {
1453
- listState.openGroup(this._id, parentId);
1454
- this.markForCheck();
1455
- }
1456
- focusItem(e) {
1457
- if (e.target.classList.contains("bcm-list__item")) {
1458
- const item = e.target;
1459
- const list = document.getElementById(`bcm-list-${this._id}`);
1460
- if (list) {
1461
- const items = list.querySelectorAll(".bcm-list__item");
1462
- if (items.length > 0) {
1463
- const selectedItem = list.querySelector(".bcm-list__item.focused");
1464
- if (selectedItem) {
1465
- selectedItem.classList.remove("focused");
1466
- }
1467
- item.classList.add("focused");
1468
- }
1469
- }
1470
- }
1471
- }
1472
- async selectedItem(itemId) {
1473
- var _a;
1474
- if (!this.checkboxes) {
1475
- this.value = listState.selectedItem(this._id, itemId) ? listState.selectedItem(this._id, itemId)[0] : null;
1476
- this.inputText = ((_a = this.value) === null || _a === void 0 ? void 0 : _a.text) || null;
1477
- this.isOpen = false;
1478
- this.markForCheck();
1479
- if (this.type == "autocomplete" && this.value) {
1480
- // await delay(100)
1481
- // this.resetCaption()
1482
- const autocompleteInput = this.getAutoCompleteInput();
1483
- if (autocompleteInput) {
1484
- setTimeout(() => {
1485
- var _a;
1486
- autocompleteInput.setValue(((_a = this.value) === null || _a === void 0 ? void 0 : _a.text) || "");
1487
- this.isOpen = false;
1488
- }, 100);
1489
- }
1490
- }
1491
- }
1492
- return Promise.resolve(this.value);
1493
- }
1494
- async checkedItem(itemId) {
1495
- const isCheckSelectAll = itemId === "select-all";
1496
- if (!isCheckSelectAll) {
1497
- listState.checkedItem(this._id, itemId);
1498
- }
1499
- else {
1500
- listState.selectAll(this._id, !this.selectAllItem.checked);
1501
- }
1502
- this.value = (await this.getCheckedList()).checkedList;
1503
- this.changeVisibleCheckeds();
1504
- this.markForCheck();
1505
- }
1506
- changeVisibleCheckeds() {
1507
- const { visibledItems } = this.returnFilterData;
1508
- this.returnFilterData = {
1509
- visibledItems,
1510
- checkedItems: (visibledItems && visibledItems.filter(item => item.checked)) || [],
1511
- };
1512
- }
1513
- getAutoCompleteInput() {
1514
- return document.getElementById(`bcm-list-input-tag-container-${this._id}-autocomplete-input`);
1515
- }
1516
- dataScrollEvent(event) {
1517
- let count = 0;
1518
- let io = new IntersectionObserver((data) => {
1519
- if (count === 0) {
1520
- count++;
1521
- if (data[0].isIntersecting) {
1522
- this.limit += 15;
1523
- this.searchResultLimit += 15;
1524
- io.disconnect();
1525
- io = null;
1526
- }
1527
- }
1528
- }, this.options);
1529
- io.observe(event.target.lastElementChild);
1530
- }
1531
- async calculateLocation() {
1532
- var _a, _b;
1533
- if (this.type == "select" || this.type == "autocomplete" || this.linkedComponent) {
1534
- const list = document.getElementById(`bcm-list-${this._id}`);
1535
- // list && (list.style.height = '256px') //sebebi neydi ki!
1536
- var placement = this.placement;
1537
- const targetElementId = this.linkedComponent ? this.linkedComponent : `bcm-list-input-${this._id}`;
1538
- const targetElement = document.getElementById(targetElementId);
1539
- if (list && targetElement) {
1540
- popoverPlacement.getPlacement(list, targetElement, placement, (place) => (placement = place));
1541
- await utils.delay(10);
1542
- let pos = popoverPlacement.setPosition(placement, targetElement);
1543
- let captionAreaHeight = 0;
1544
- let labelAreaHeight = 0;
1545
- if (this.linkedComponent) {
1546
- const linked = document.getElementById(this.linkedComponent);
1547
- if (linked) {
1548
- if (!linked["noCaption"]) {
1549
- const captionArea = ((_a = linked.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".bcm-caption-area")) || linked.querySelector(".bcm-caption-area");
1550
- if (captionArea) {
1551
- captionAreaHeight = captionArea.offsetHeight || captionArea.clientHeight;
1552
- }
1553
- }
1554
- const labelArea = ((_b = linked.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector(".bcm-label")) || linked.querySelector(".bcm-label");
1555
- if (labelArea) {
1556
- labelAreaHeight = labelArea.offsetHeight || labelArea.clientHeight;
1557
- }
1558
- }
1559
- }
1560
- if (this.fullWidth) {
1561
- list.style.width = targetElement.offsetWidth + "px";
1562
- }
1563
- else {
1564
- list.style.width = this.width || "auto";
1565
- }
1566
- if (this.height.indexOf("%") > -1) {
1567
- list.style.height = numberHelper.NumberHelper.toNumber(this.height) * 0.01 * window.innerHeight - pos[0] - 50 + "px";
1568
- }
1569
- else {
1570
- list.style.height = this.height;
1571
- }
1572
- list.style.minHeight = this.minHeight;
1573
- // const calculatedMaxHeight = window.innerHeight - pos[0] - 50;
1574
- const calculatedMaxHeight = placement.split("-")[0] == "top" ? window.innerHeight - (window.innerHeight - pos[0]) - 50 : window.innerHeight - pos[0] - 50;
1575
- if (this.maxHeight.indexOf("%") > -1) {
1576
- list.style.maxHeight = numberHelper.NumberHelper.toNumber(this.maxHeight) * 0.01 * calculatedMaxHeight + "px";
1577
- }
1578
- else {
1579
- list.style.maxHeight = numberHelper.NumberHelper.toNumber(this.maxHeight) < calculatedMaxHeight ? this.maxHeight : calculatedMaxHeight + "px";
1580
- }
1581
- popoverPlacement.getPlacement(list, targetElement, placement, (place) => (placement = place));
1582
- await utils.delay(10);
1583
- pos = popoverPlacement.setPosition(placement, targetElement);
1584
- list.style.top = (placement.split("-")[0] == "top" ? pos[0] - list.offsetHeight + labelAreaHeight : pos[0] - captionAreaHeight) + "px";
1585
- // list.style.left = pos[1] + 'px';
1586
- list.style.left = placement.split("-")[1] == "end" ? pos[1] - list.offsetWidth + "px" : pos[1] + "px";
1587
- list.classList.toggle("bcm-list--top", placement.split("-")[0] == "top");
1588
- this.calculatedViewport = true;
1589
- }
1590
- }
1591
- }
1592
- handleTransitionEnd(e) {
1593
- const { isOpen, type } = this;
1594
- const propertName = e === null || e === void 0 ? void 0 : e.propertyName;
1595
- if (isOpen && type == "select" && propertName == "transform") {
1596
- this.listOpen.emit();
1597
- }
1598
- }
1599
- render() {
1600
- const { checkboxes, treeview, label, size, disabled, readonly, required, hidden, fullWidth, searchable } = this.getOptions();
1601
- const hostClasses = index.classnames("bcm-list", `bcm-list__size-${size}`, `bcm-list__${this.type}`, size === "large" ? "size-3" : "size-2", {
1602
- "error": this.captionType == bcm.Bcm$1.Status.error,
1603
- "full-width": fullWidth,
1604
- "bcm-list__linked": this.linkedComponent,
1605
- hidden,
1606
- readonly,
1607
- disabled,
1608
- });
1609
- const bcmListContainer = index.classnames("bcm-list__container", this.linkedComponent ? "bcm-list__type-linked-component" : `bcm-list__type-${this.type}`, {
1610
- "is-open": this.isOpen && this.calculatedViewport,
1611
- "error": this.captionType == bcm.Bcm$1.Status.error,
1612
- "full-width": fullWidth,
1613
- hidden,
1614
- readonly,
1615
- disabled,
1616
- });
1617
- const bcmListInput = index.classnames("bcm-list__input");
1618
- const openedType = this.type == "select" || this.type == "autocomplete" || this.linkedComponent;
1619
- return (index$1.h(index$1.Host, { class: hostClasses, tabindex: "0", style: {
1620
- "--width": fullWidth ? "100%" : this.width,
1621
- "--height": openedType ? "100%" : this.height,
1622
- "--max-height": openedType ? "inherit" : this.maxHeight,
1623
- "--min-height": openedType ? "inherit" : this.minHeight,
1624
- } }, index$1.h("div", { id: `bcm-list-label-${this._id}`, class: "bcm-list__label" }, label && (index$1.h("div", null, index$1.h("bcm-label", { tooltip: this.tooltip, size: this.size, type: this.captionType, value: label, required: required, htmlFor: this._id })))), this.type == "select" && (index$1.h("div", { id: `bcm-list-input-${this._id}`, class: bcmListInput }, index$1.h("span", { class: index.classnames("bcm-list__input-container", { "type-single": !checkboxes, "value-empty": !this.value }) }, this.checkboxes ? (this.value && this.value.length > 0 ? (index$1.h("bcm-rc-overflow", { data: this.tagData, maxCount: this.tagCount })) : (index$1.h("span", { class: "bcm-list__input-placeholder" }, this.placeholder))) : this.value ? (this.inputText) : (index$1.h("span", { class: "bcm-list__input-placeholder" }, this.placeholder))), index$1.h("span", { class: index.classnames("bcm-list__input-buttons", {
1625
- disabled: disabled,
1626
- }) }, this.clearable && this.value && (index$1.h("div", { class: "bcm-list__input-buttons-button" }, index$1.h("bcm-icon", { icon: "fal fa-times", onClick: e => !disabled && this.setClear(e) }))), index$1.h("div", { class: `bcm-list__input-buttons-button caret-is ${this.isOpen && this.calculatedViewport && "caret-is-open"}` }, index$1.h("bcm-icon", { icon: `far fa-angle-down` }))))), this.type === "autocomplete" && (index$1.h("div", { id: `bcm-list-input-${this._id}`, class: index.classnames(bcmListInput, { "bcm-list__input-autocomplete": this.type == "autocomplete" }) }, index$1.h("span", { class: "bcm-list__input-container", id: `bcm-list-input-tag-container-${this._id}` }, this.checkboxes && index$1.h("span", { class: "bcm-list__input-tag-container", id: `bcm-list-input-tag-container-${this._id}-autocomplete` }), index$1.h("bcm-search", { id: `bcm-list-input-tag-container-${this._id}-autocomplete-input`, class: "bcm-list__autocomplete", data: this.data, clearable: true, "full-width": true, "no-caption": true, placeholder: this.placeholder })))), index$1.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) }), index$1.h(captionTemplate.CaptionTemplate, { noCaption: this.noCaption, captionType: this.captionType, captionError: this.captionError, caption: this.caption })));
1627
- }
1628
- get el() { return index$1.getElement(this); }
1629
- static get watchers() { return {
1630
- "_id": ["watchId"],
1631
- "value": ["handleValueChange"],
1632
- "returnFilterData": ["watchReturnFilterData"],
1633
- "isOpen": ["handleOpen"],
1634
- "data": ["dataChanged"]
1635
- }; }
1636
- };
1637
- __decorate([
1638
- isLoadDecorator.IsLoad()
1639
- ], BcmList.prototype, "el", void 0);
1640
- __decorate([
1641
- jsonParseDecarator.JsonParse("data", true)
1642
- ], BcmList.prototype, "dataChanged", null);
1643
- BcmList.style = listCss;
1644
-
1645
- function _extends() {
1646
- _extends = Object.assign ? Object.assign.bind() : function (target) {
1647
- for (var i = 1; i < arguments.length; i++) {
1648
- var source = arguments[i];
1649
- for (var key in source) {
1650
- if (Object.prototype.hasOwnProperty.call(source, key)) {
1651
- target[key] = source[key];
1652
- }
1653
- }
1654
- }
1655
- return target;
1656
- };
1657
- return _extends.apply(this, arguments);
1658
- }
1659
-
1660
- function _typeof(obj) {
1661
- "@babel/helpers - typeof";
1662
-
1663
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
1664
- return typeof obj;
1665
- } : function (obj) {
1666
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
1667
- }, _typeof(obj);
1668
- }
1669
-
1670
- function _toPrimitive(input, hint) {
1671
- if (_typeof(input) !== "object" || input === null) return input;
1672
- var prim = input[Symbol.toPrimitive];
1673
- if (prim !== undefined) {
1674
- var res = prim.call(input, hint || "default");
1675
- if (_typeof(res) !== "object") return res;
1676
- throw new TypeError("@@toPrimitive must return a primitive value.");
1677
- }
1678
- return (hint === "string" ? String : Number)(input);
1679
- }
1680
-
1681
- function _toPropertyKey(arg) {
1682
- var key = _toPrimitive(arg, "string");
1683
- return _typeof(key) === "symbol" ? key : String(key);
1684
- }
1685
-
1686
- function _defineProperty(obj, key, value) {
1687
- key = _toPropertyKey(key);
1688
- if (key in obj) {
1689
- Object.defineProperty(obj, key, {
1690
- value: value,
1691
- enumerable: true,
1692
- configurable: true,
1693
- writable: true
1694
- });
1695
- } else {
1696
- obj[key] = value;
1697
- }
1698
- return obj;
1699
- }
1700
-
1701
- function ownKeys(object, enumerableOnly) {
1702
- var keys = Object.keys(object);
1703
- if (Object.getOwnPropertySymbols) {
1704
- var symbols = Object.getOwnPropertySymbols(object);
1705
- enumerableOnly && (symbols = symbols.filter(function (sym) {
1706
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
1707
- })), keys.push.apply(keys, symbols);
1708
- }
1709
- return keys;
1710
- }
1711
- function _objectSpread2(target) {
1712
- for (var i = 1; i < arguments.length; i++) {
1713
- var source = null != arguments[i] ? arguments[i] : {};
1714
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
1715
- _defineProperty(target, key, source[key]);
1716
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
1717
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
1718
- });
1719
- }
1720
- return target;
1721
- }
1722
-
1723
- function _arrayWithHoles(arr) {
1724
- if (Array.isArray(arr)) return arr;
1725
- }
1726
-
1727
- function _iterableToArrayLimit(arr, i) {
1728
- var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
1729
- if (null != _i) {
1730
- var _s,
1731
- _e,
1732
- _x,
1733
- _r,
1734
- _arr = [],
1735
- _n = !0,
1736
- _d = !1;
1737
- try {
1738
- if (_x = (_i = _i.call(arr)).next, 0 === i) {
1739
- if (Object(_i) !== _i) return;
1740
- _n = !1;
1741
- } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
1742
- } catch (err) {
1743
- _d = !0, _e = err;
1744
- } finally {
1745
- try {
1746
- if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
1747
- } finally {
1748
- if (_d) throw _e;
1749
- }
1750
- }
1751
- return _arr;
1752
- }
1753
- }
1754
-
1755
- function _arrayLikeToArray(arr, len) {
1756
- if (len == null || len > arr.length) len = arr.length;
1757
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
1758
- return arr2;
1759
- }
1760
-
1761
- function _unsupportedIterableToArray(o, minLen) {
1762
- if (!o) return;
1763
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
1764
- var n = Object.prototype.toString.call(o).slice(8, -1);
1765
- if (n === "Object" && o.constructor) n = o.constructor.name;
1766
- if (n === "Map" || n === "Set") return Array.from(o);
1767
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
1768
- }
1769
-
1770
- function _nonIterableRest() {
1771
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1772
- }
1773
-
1774
- function _slicedToArray(arr, i) {
1775
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
1776
- }
1777
-
1778
- function _objectWithoutPropertiesLoose(source, excluded) {
1779
- if (source == null) return {};
1780
- var target = {};
1781
- var sourceKeys = Object.keys(source);
1782
- var key, i;
1783
- for (i = 0; i < sourceKeys.length; i++) {
1784
- key = sourceKeys[i];
1785
- if (excluded.indexOf(key) >= 0) continue;
1786
- target[key] = source[key];
1787
- }
1788
- return target;
1789
- }
1790
-
1791
- function _objectWithoutProperties(source, excluded) {
1792
- if (source == null) return {};
1793
- var target = _objectWithoutPropertiesLoose(source, excluded);
1794
- var key, i;
1795
- if (Object.getOwnPropertySymbols) {
1796
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
1797
- for (i = 0; i < sourceSymbolKeys.length; i++) {
1798
- key = sourceSymbolKeys[i];
1799
- if (excluded.indexOf(key) >= 0) continue;
1800
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
1801
- target[key] = source[key];
1802
- }
1803
- }
1804
- return target;
1805
- }
1806
-
1807
- var _excluded$2 = ["prefixCls", "invalidate", "item", "renderItem", "responsive", "responsiveDisabled", "registerSize", "itemKey", "className", "style", "children", "display", "order", "component"];
1808
- // Use shared variable to save bundle size
1809
- var UNDEFINED = undefined;
1810
- function InternalItem(props, ref) {
1811
- var prefixCls = props.prefixCls,
1812
- invalidate = props.invalidate,
1813
- item = props.item,
1814
- renderItem = props.renderItem,
1815
- responsive = props.responsive,
1816
- responsiveDisabled = props.responsiveDisabled,
1817
- registerSize = props.registerSize,
1818
- itemKey = props.itemKey,
1819
- className = props.className,
1820
- style = props.style,
1821
- children = props.children,
1822
- display = props.display,
1823
- order = props.order,
1824
- _props$component = props.component,
1825
- Component = _props$component === void 0 ? 'div' : _props$component,
1826
- restProps = _objectWithoutProperties(props, _excluded$2);
1827
- var mergedHidden = responsive && !display;
1828
- // ================================ Effect ================================
1829
- function internalRegisterSize(width) {
1830
- registerSize(itemKey, width);
1831
- }
1832
- index$3.react.useEffect(function () {
1833
- return function () {
1834
- internalRegisterSize(null);
1835
- };
1836
- }, []);
1837
- // ================================ Render ================================
1838
- var childNode = renderItem && item !== UNDEFINED ? renderItem(item) : children;
1839
- var overflowStyle;
1840
- if (!invalidate) {
1841
- overflowStyle = {
1842
- opacity: mergedHidden ? 0 : 1,
1843
- height: mergedHidden ? 0 : UNDEFINED,
1844
- overflowY: mergedHidden ? 'hidden' : UNDEFINED,
1845
- order: responsive ? order : UNDEFINED,
1846
- pointerEvents: mergedHidden ? 'none' : UNDEFINED,
1847
- position: mergedHidden ? 'absolute' : UNDEFINED
1848
- };
1849
- }
1850
- var overflowProps = {};
1851
- if (mergedHidden) {
1852
- overflowProps['aria-hidden'] = true;
1853
- }
1854
- var itemNode = /*#__PURE__*/index$3.react.createElement(Component, _extends({
1855
- className: index.classnames(!invalidate && prefixCls, className),
1856
- style: _objectSpread2(_objectSpread2({}, overflowStyle), style)
1857
- }, overflowProps, restProps, {
1858
- ref: ref
1859
- }), childNode);
1860
- if (responsive) {
1861
- itemNode = /*#__PURE__*/index$3.react.createElement(index$3.RefResizeObserver, {
1862
- onResize: function onResize(_ref) {
1863
- var offsetWidth = _ref.offsetWidth;
1864
- internalRegisterSize(offsetWidth);
1865
- },
1866
- disabled: responsiveDisabled
1867
- }, itemNode);
1868
- }
1869
- return itemNode;
1870
- }
1871
- var Item = /*#__PURE__*/index$3.react.forwardRef(InternalItem);
1872
- Item.displayName = 'Item';
1873
-
1874
- function channelUpdate(callback) {
1875
- if (typeof MessageChannel === 'undefined') {
1876
- index$3.wrapperRaf(callback);
1877
- } else {
1878
- var channel = new MessageChannel();
1879
- channel.port1.onmessage = function () {
1880
- return callback();
1881
- };
1882
- channel.port2.postMessage(undefined);
1883
- }
1884
- }
1885
-
1886
- /**
1887
- * Batcher for record any `useEffectState` need update.
1888
- */
1889
- function useBatcher() {
1890
- // Updater Trigger
1891
- var updateFuncRef = index$3.react.useRef(null);
1892
- // Notify update
1893
- var notifyEffectUpdate = function notifyEffectUpdate(callback) {
1894
- if (!updateFuncRef.current) {
1895
- updateFuncRef.current = [];
1896
- channelUpdate(function () {
1897
- index$3.reactDom.unstable_batchedUpdates(function () {
1898
- updateFuncRef.current.forEach(function (fn) {
1899
- fn();
1900
- });
1901
- updateFuncRef.current = null;
1902
- });
1903
- });
1904
- }
1905
- updateFuncRef.current.push(callback);
1906
- };
1907
- return notifyEffectUpdate;
1908
- }
1909
- /**
1910
- * Trigger state update by `useLayoutEffect` to save perf.
1911
- */
1912
- function useEffectState(notifyEffectUpdate, defaultValue) {
1913
- // Value
1914
- var _React$useState = index$3.react.useState(defaultValue),
1915
- _React$useState2 = _slicedToArray(_React$useState, 2),
1916
- stateValue = _React$useState2[0],
1917
- setStateValue = _React$useState2[1];
1918
- // Set State
1919
- var setEffectVal = index$3.useEvent(function (nextValue) {
1920
- notifyEffectUpdate(function () {
1921
- setStateValue(nextValue);
1922
- });
1923
- });
1924
- return [stateValue, setEffectVal];
1925
- }
1926
-
1927
- var OverflowContext = /*#__PURE__*/index$3.react.createContext(null);
1928
-
1929
- var _excluded$1 = ["component"],
1930
- _excluded2 = ["className"],
1931
- _excluded3 = ["className"];
1932
- var InternalRawItem = function InternalRawItem(props, ref) {
1933
- var context = index$3.react.useContext(OverflowContext);
1934
- // Render directly when context not provided
1935
- if (!context) {
1936
- var _props$component = props.component,
1937
- Component = _props$component === void 0 ? 'div' : _props$component,
1938
- _restProps = _objectWithoutProperties(props, _excluded$1);
1939
- return /*#__PURE__*/index$3.react.createElement(Component, _extends({}, _restProps, {
1940
- ref: ref
1941
- }));
1942
- }
1943
- var contextClassName = context.className,
1944
- restContext = _objectWithoutProperties(context, _excluded2);
1945
- var className = props.className,
1946
- restProps = _objectWithoutProperties(props, _excluded3);
1947
- // Do not pass context to sub item to avoid multiple measure
1948
- return /*#__PURE__*/index$3.react.createElement(OverflowContext.Provider, {
1949
- value: null
1950
- }, /*#__PURE__*/index$3.react.createElement(Item, _extends({
1951
- ref: ref,
1952
- className: index.classnames(contextClassName, className)
1953
- }, restContext, restProps)));
1954
- };
1955
- var RawItem = /*#__PURE__*/index$3.react.forwardRef(InternalRawItem);
1956
- RawItem.displayName = 'RawItem';
1957
-
1958
- var _excluded = ["prefixCls", "data", "renderItem", "renderRawItem", "itemKey", "itemWidth", "ssr", "style", "className", "maxCount", "renderRest", "renderRawRest", "suffix", "component", "itemComponent", "onVisibleChange"];
1959
- var RESPONSIVE = 'responsive';
1960
- var INVALIDATE = 'invalidate';
1961
- function defaultRenderRest(omittedItems) {
1962
- return "+ ".concat(omittedItems.length, " ...");
1963
- }
1964
- function Overflow(props, ref) {
1965
- var _props$prefixCls = props.prefixCls,
1966
- prefixCls = _props$prefixCls === void 0 ? 'rc-overflow' : _props$prefixCls,
1967
- _props$data = props.data,
1968
- data = _props$data === void 0 ? [] : _props$data,
1969
- renderItem = props.renderItem,
1970
- renderRawItem = props.renderRawItem,
1971
- itemKey = props.itemKey,
1972
- _props$itemWidth = props.itemWidth,
1973
- itemWidth = _props$itemWidth === void 0 ? 10 : _props$itemWidth,
1974
- ssr = props.ssr,
1975
- style = props.style,
1976
- className = props.className,
1977
- maxCount = props.maxCount,
1978
- renderRest = props.renderRest,
1979
- renderRawRest = props.renderRawRest,
1980
- suffix = props.suffix,
1981
- _props$component = props.component,
1982
- Component = _props$component === void 0 ? 'div' : _props$component,
1983
- itemComponent = props.itemComponent,
1984
- onVisibleChange = props.onVisibleChange,
1985
- restProps = _objectWithoutProperties(props, _excluded);
1986
- var fullySSR = ssr === 'full';
1987
- var notifyEffectUpdate = useBatcher();
1988
- var _useEffectState = useEffectState(notifyEffectUpdate, null),
1989
- _useEffectState2 = _slicedToArray(_useEffectState, 2),
1990
- containerWidth = _useEffectState2[0],
1991
- setContainerWidth = _useEffectState2[1];
1992
- var mergedContainerWidth = containerWidth || 0;
1993
- var _useEffectState3 = useEffectState(notifyEffectUpdate, new Map()),
1994
- _useEffectState4 = _slicedToArray(_useEffectState3, 2),
1995
- itemWidths = _useEffectState4[0],
1996
- setItemWidths = _useEffectState4[1];
1997
- var _useEffectState5 = useEffectState(notifyEffectUpdate, 0),
1998
- _useEffectState6 = _slicedToArray(_useEffectState5, 2),
1999
- prevRestWidth = _useEffectState6[0],
2000
- setPrevRestWidth = _useEffectState6[1];
2001
- var _useEffectState7 = useEffectState(notifyEffectUpdate, 0),
2002
- _useEffectState8 = _slicedToArray(_useEffectState7, 2),
2003
- restWidth = _useEffectState8[0],
2004
- setRestWidth = _useEffectState8[1];
2005
- var _useEffectState9 = useEffectState(notifyEffectUpdate, 0),
2006
- _useEffectState10 = _slicedToArray(_useEffectState9, 2),
2007
- suffixWidth = _useEffectState10[0],
2008
- setSuffixWidth = _useEffectState10[1];
2009
- var _useState = index$3.react.useState(null),
2010
- _useState2 = _slicedToArray(_useState, 2),
2011
- suffixFixedStart = _useState2[0],
2012
- setSuffixFixedStart = _useState2[1];
2013
- var _useState3 = index$3.react.useState(null),
2014
- _useState4 = _slicedToArray(_useState3, 2),
2015
- displayCount = _useState4[0],
2016
- setDisplayCount = _useState4[1];
2017
- var mergedDisplayCount = index$3.react.useMemo(function () {
2018
- if (displayCount === null && fullySSR) {
2019
- return Number.MAX_SAFE_INTEGER;
2020
- }
2021
- return displayCount || 0;
2022
- }, [displayCount, containerWidth]);
2023
- var _useState5 = index$3.react.useState(false),
2024
- _useState6 = _slicedToArray(_useState5, 2),
2025
- restReady = _useState6[0],
2026
- setRestReady = _useState6[1];
2027
- var itemPrefixCls = "".concat(prefixCls, "-item");
2028
- // Always use the max width to avoid blink
2029
- var mergedRestWidth = Math.max(prevRestWidth, restWidth);
2030
- // ================================= Data =================================
2031
- var isResponsive = maxCount === RESPONSIVE;
2032
- var shouldResponsive = data.length && isResponsive;
2033
- var invalidate = maxCount === INVALIDATE;
2034
- /**
2035
- * When is `responsive`, we will always render rest node to get the real width of it for calculation
2036
- */
2037
- var showRest = shouldResponsive || typeof maxCount === 'number' && data.length > maxCount;
2038
- var mergedData = index$3.react.useMemo(function () {
2039
- var items = data;
2040
- if (shouldResponsive) {
2041
- if (containerWidth === null && fullySSR) {
2042
- items = data;
2043
- } else {
2044
- items = data.slice(0, Math.min(data.length, mergedContainerWidth / itemWidth));
2045
- }
2046
- } else if (typeof maxCount === 'number') {
2047
- items = data.slice(0, maxCount);
2048
- }
2049
- return items;
2050
- }, [data, itemWidth, containerWidth, maxCount, shouldResponsive]);
2051
- var omittedItems = index$3.react.useMemo(function () {
2052
- if (shouldResponsive) {
2053
- return data.slice(mergedDisplayCount + 1);
2054
- }
2055
- return data.slice(mergedData.length);
2056
- }, [data, mergedData, shouldResponsive, mergedDisplayCount]);
2057
- // ================================= Item =================================
2058
- var getKey = index$3.react.useCallback(function (item, index) {
2059
- var _ref;
2060
- if (typeof itemKey === 'function') {
2061
- return itemKey(item);
2062
- }
2063
- return (_ref = itemKey && (item === null || item === void 0 ? void 0 : item[itemKey])) !== null && _ref !== void 0 ? _ref : index;
2064
- }, [itemKey]);
2065
- var mergedRenderItem = index$3.react.useCallback(renderItem || function (item) {
2066
- return item;
2067
- }, [renderItem]);
2068
- function updateDisplayCount(count, suffixFixedStartVal, notReady) {
2069
- // React 18 will sync render even when the value is same in some case.
2070
- // We take `mergedData` as deps which may cause dead loop if it's dynamic generate.
2071
- // ref: https://github.com/ant-design/ant-design/issues/36559
2072
- if (displayCount === count && (suffixFixedStartVal === undefined || suffixFixedStartVal === suffixFixedStart)) {
2073
- return;
2074
- }
2075
- setDisplayCount(count);
2076
- if (!notReady) {
2077
- setRestReady(count < data.length - 1);
2078
- onVisibleChange === null || onVisibleChange === void 0 ? void 0 : onVisibleChange(count);
2079
- }
2080
- if (suffixFixedStartVal !== undefined) {
2081
- setSuffixFixedStart(suffixFixedStartVal);
2082
- }
2083
- }
2084
- // ================================= Size =================================
2085
- function onOverflowResize(_, element) {
2086
- setContainerWidth(element.clientWidth);
2087
- }
2088
- function registerSize(key, width) {
2089
- setItemWidths(function (origin) {
2090
- var clone = new Map(origin);
2091
- if (width === null) {
2092
- clone.delete(key);
2093
- } else {
2094
- clone.set(key, width);
2095
- }
2096
- return clone;
2097
- });
2098
- }
2099
- function registerOverflowSize(_, width) {
2100
- setRestWidth(width);
2101
- setPrevRestWidth(restWidth);
2102
- }
2103
- function registerSuffixSize(_, width) {
2104
- setSuffixWidth(width);
2105
- }
2106
- // ================================ Effect ================================
2107
- function getItemWidth(index) {
2108
- return itemWidths.get(getKey(mergedData[index], index));
2109
- }
2110
- index$3.useLayoutEffect(function () {
2111
- if (mergedContainerWidth && typeof mergedRestWidth === 'number' && mergedData) {
2112
- var totalWidth = suffixWidth;
2113
- var len = mergedData.length;
2114
- var lastIndex = len - 1;
2115
- // When data count change to 0, reset this since not loop will reach
2116
- if (!len) {
2117
- updateDisplayCount(0, null);
2118
- return;
2119
- }
2120
- for (var i = 0; i < len; i += 1) {
2121
- var currentItemWidth = getItemWidth(i);
2122
- // Fully will always render
2123
- if (fullySSR) {
2124
- currentItemWidth = currentItemWidth || 0;
2125
- }
2126
- // Break since data not ready
2127
- if (currentItemWidth === undefined) {
2128
- updateDisplayCount(i - 1, undefined, true);
2129
- break;
2130
- }
2131
- // Find best match
2132
- totalWidth += currentItemWidth;
2133
- if (
2134
- // Only one means `totalWidth` is the final width
2135
- lastIndex === 0 && totalWidth <= mergedContainerWidth ||
2136
- // Last two width will be the final width
2137
- i === lastIndex - 1 && totalWidth + getItemWidth(lastIndex) <= mergedContainerWidth) {
2138
- // Additional check if match the end
2139
- updateDisplayCount(lastIndex, null);
2140
- break;
2141
- } else if (totalWidth + mergedRestWidth > mergedContainerWidth) {
2142
- // Can not hold all the content to show rest
2143
- updateDisplayCount(i - 1, totalWidth - currentItemWidth - suffixWidth + restWidth);
2144
- break;
2145
- }
2146
- }
2147
- if (suffix && getItemWidth(0) + suffixWidth > mergedContainerWidth) {
2148
- setSuffixFixedStart(null);
2149
- }
2150
- }
2151
- }, [mergedContainerWidth, itemWidths, restWidth, suffixWidth, getKey, mergedData]);
2152
- // ================================ Render ================================
2153
- var displayRest = restReady && !!omittedItems.length;
2154
- var suffixStyle = {};
2155
- if (suffixFixedStart !== null && shouldResponsive) {
2156
- suffixStyle = {
2157
- position: 'absolute',
2158
- left: suffixFixedStart,
2159
- top: 0
2160
- };
2161
- }
2162
- var itemSharedProps = {
2163
- prefixCls: itemPrefixCls,
2164
- responsive: shouldResponsive,
2165
- component: itemComponent,
2166
- invalidate: invalidate
2167
- };
2168
- // >>>>> Choice render fun by `renderRawItem`
2169
- var internalRenderItemNode = renderRawItem ? function (item, index) {
2170
- var key = getKey(item, index);
2171
- return /*#__PURE__*/index$3.react.createElement(OverflowContext.Provider, {
2172
- key: key,
2173
- value: _objectSpread2(_objectSpread2({}, itemSharedProps), {}, {
2174
- order: index,
2175
- item: item,
2176
- itemKey: key,
2177
- registerSize: registerSize,
2178
- display: index <= mergedDisplayCount
2179
- })
2180
- }, renderRawItem(item, index));
2181
- } : function (item, index) {
2182
- var key = getKey(item, index);
2183
- return /*#__PURE__*/index$3.react.createElement(Item, _extends({}, itemSharedProps, {
2184
- order: index,
2185
- key: key,
2186
- item: item,
2187
- renderItem: mergedRenderItem,
2188
- itemKey: key,
2189
- registerSize: registerSize,
2190
- display: index <= mergedDisplayCount
2191
- }));
2192
- };
2193
- // >>>>> Rest node
2194
- var restNode;
2195
- var restContextProps = {
2196
- order: displayRest ? mergedDisplayCount : Number.MAX_SAFE_INTEGER,
2197
- className: "".concat(itemPrefixCls, "-rest"),
2198
- registerSize: registerOverflowSize,
2199
- display: displayRest
2200
- };
2201
- if (!renderRawRest) {
2202
- var mergedRenderRest = renderRest || defaultRenderRest;
2203
- restNode = /*#__PURE__*/index$3.react.createElement(Item, _extends({}, itemSharedProps, restContextProps), typeof mergedRenderRest === 'function' ? mergedRenderRest(omittedItems) : mergedRenderRest);
2204
- } else if (renderRawRest) {
2205
- restNode = /*#__PURE__*/index$3.react.createElement(OverflowContext.Provider, {
2206
- value: _objectSpread2(_objectSpread2({}, itemSharedProps), restContextProps)
2207
- }, renderRawRest(omittedItems));
2208
- }
2209
- var overflowNode = /*#__PURE__*/index$3.react.createElement(Component, _extends({
2210
- className: index.classnames(!invalidate && prefixCls, className),
2211
- style: style,
2212
- ref: ref
2213
- }, restProps), mergedData.map(internalRenderItemNode), showRest ? restNode : null, suffix && /*#__PURE__*/index$3.react.createElement(Item, _extends({}, itemSharedProps, {
2214
- responsive: isResponsive,
2215
- responsiveDisabled: !shouldResponsive,
2216
- order: mergedDisplayCount,
2217
- className: "".concat(itemPrefixCls, "-suffix"),
2218
- registerSize: registerSuffixSize,
2219
- display: true,
2220
- style: suffixStyle
2221
- }), suffix));
2222
- if (isResponsive) {
2223
- overflowNode = /*#__PURE__*/index$3.react.createElement(index$3.RefResizeObserver, {
2224
- onResize: onOverflowResize,
2225
- disabled: !shouldResponsive
2226
- }, overflowNode);
2227
- }
2228
- return overflowNode;
2229
- }
2230
- var ForwardOverflow = /*#__PURE__*/index$3.react.forwardRef(Overflow);
2231
- ForwardOverflow.displayName = 'Overflow';
2232
- ForwardOverflow.Item = RawItem;
2233
- ForwardOverflow.RESPONSIVE = RESPONSIVE;
2234
- ForwardOverflow.INVALIDATE = INVALIDATE;
2235
-
2236
- 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}";
2237
-
2238
- const BcmRcOverflow = class {
2239
- constructor(hostRef) {
2240
- index$1.registerInstance(this, hostRef);
2241
- this.selectOtherTag = index$1.createEvent(this, "bcm-select-other-tag", 7);
2242
- this.selectTag = index$1.createEvent(this, "bcm-select-tag", 7);
2243
- this.deleteTag = index$1.createEvent(this, "bcm-delete-tag", 7);
2244
- this.renderItem = item => {
2245
- return index$3.react.createElement("bcm-tooltip", {
2246
- placement: "bottom",
2247
- message: item.text,
2248
- trigger: "hover",
2249
- }, index$3.react.createElement("div", {
2250
- id: item.value + "-tag",
2251
- className: "bcm-tag",
2252
- onClick: ({ target }) => this.onClickControl(target, item, false),
2253
- }, index$3.react.createElement("span", { className: "bcm-tag__content dismissable" },
2254
- // .bcm-tag__content span {
2255
- // display: block;
2256
- // max-width: 38px;
2257
- // white-space: nowrap;
2258
- // overflow: hidden;
2259
- // text-overflow: ellipsis;
2260
- index$3.react.createElement("div", { className: "value tw-block tw-max-w-[38px] tw-overflow-hidden tw-overflow-ellipsis tw-whitespace-nowrap" }, item.text), index$3.react.createElement("span", {
2261
- className: "right close-button",
2262
- }, index$3.react.createElement("bcm-icon", {
2263
- icon: "fa fa-times",
2264
- })))));
2265
- };
2266
- this.renderRest = items => {
2267
- const titles = (items === null || items === void 0 ? void 0 : items.sort((a, b) => +a.ct - +b.ct).slice(0, 15).map(item => stringHelper.StringHelper.textLimitter(item.text, 40, true)).toString().split(",").join("\r\n")) + (items.length > 15 ? "\r\n..." : "");
2268
- return index$3.react.createElement("bcm-tooltip", {
2269
- placement: "bottom",
2270
- message: titles,
2271
- trigger: "hover",
2272
- }, index$3.react.createElement("div", {
2273
- className: "bcm-tag bcm-tag--other",
2274
- onClick: ({ target }) => this.onClickControl(target, items, true),
2275
- }, index$3.react.createElement("span", { className: `bcm-tag__content dismissable ${this.checked ? "checkable checked" : ""}` }, index$3.react.createElement("span", { className: "value" }, `+${items === null || items === void 0 ? void 0 : items.length}`), index$3.react.createElement("span", { className: "right close-button" }, index$3.react.createElement("bcm-icon", {
2276
- icon: "fa fa-times",
2277
- })))));
2278
- };
2279
- this._id = generate.Generate.UID();
2280
- this.maxCount = 1;
2281
- this.data = [];
2282
- this.checked = false;
2283
- }
2284
- isClickDismiss(e) {
2285
- return e["s-hn"] === "BCM-ICON";
2286
- }
2287
- onClickControl(e, item, isOtherTag = false) {
2288
- const isClickClose = this.isClickDismiss(e);
2289
- isClickClose && this.deleteTag.emit({ id: Array.isArray(item) ? item.map(i => i.value) : item.value }) && this.checked && (this.checked = false);
2290
- !isOtherTag && this.selectTag.emit({ id: item.value }) && this.checked && (this.checked = false);
2291
- if (isOtherTag && !isClickClose) {
2292
- this.checked = !this.checked;
2293
- this.selectOtherTag.emit({ id: item === null || item === void 0 ? void 0 : item.map(i => i.value), checked: this.checked });
2294
- }
2295
- }
2296
- componentWillRender() {
2297
- const { data, renderItem, renderRest, maxCount } = this;
2298
- this.overflowInstance = index$3.react.createElement(ForwardOverflow, {
2299
- data,
2300
- renderItem,
2301
- renderRest,
2302
- maxCount,
2303
- });
2304
- index$3.reactDom.render(this.overflowInstance, this.el);
2305
- }
2306
- get el() { return index$1.getElement(this); }
2307
- };
2308
- BcmRcOverflow.style = rcOverflowCss;
2309
-
2310
- const { state } = index$2.createStore({
2311
- value: new Map(),
2312
- });
2313
- const setValue = val => {
2314
- const { id, dataSource } = val;
2315
- const data = {
2316
- id: generate.snq(() => id, generate.Generate.UID),
2317
- dataSource: dataSource && dataSource.length > 0 && recursive(dataSource),
2318
- searchIsOnlyChilds: val.searchIsOnlyChilds,
2319
- };
2320
- state.value.set(data.id, data);
2321
- };
2322
- const recursive = (data, parentId) => {
2323
- let recData = [];
2324
- if (data) {
2325
- recData = data.map(item => (Object.assign(Object.assign(Object.assign({}, item), { parentId: generate.snq(() => parentId, null) }), (item.items && item.items.length > 0 && { items: generate.snq(() => recursive(item.items, item.id), []) }))));
2326
- }
2327
- return recData;
2328
- };
2329
- const removeValue = _id => {
2330
- state.value.delete(_id);
2331
- };
2332
- const getValue = id => generate.snq(() => state.value.get(id), {});
2333
- const getDataPagination = (id, limit = 3) => {
2334
- let data = [];
2335
- const value = getValue(id);
2336
- if (value) {
2337
- const { dataSource } = value;
2338
- data = dataSource.slice(0, limit);
2339
- }
2340
- return data;
2341
- };
2342
- // //search treeview data by text
2343
- // const searchData = (id, search, items?) => {
2344
- // let dataSource
2345
- // if (items && items.length > 0) {
2346
- // dataSource = items
2347
- // } else {
2348
- // const value = getValue(id);
2349
- // dataSource = value.dataSource;
2350
- // }
2351
- // let result = []
2352
- // if (dataSource) {
2353
- // dataSource.forEach(child => {
2354
- // if (child.text.toLowerCase().includes(search.toLowerCase())) {
2355
- // result.push(child)
2356
- // }
2357
- // result = result.concat(searchData(id, search, child.items))
2358
- // })
2359
- // };
2360
- // return result
2361
- // };
2362
- //nested search
2363
- const searchData = (id, searchText, items) => {
2364
- let dataSource;
2365
- if (items && items.length > 0) {
2366
- dataSource = items;
2367
- }
2368
- else {
2369
- const value = getValue(id);
2370
- dataSource = value.dataSource;
2371
- }
2372
- let results = [];
2373
- if (dataSource) {
2374
- results.push(nestedSearch(id, dataSource, searchText));
2375
- //return with their parents
2376
- // dataSource.forEach(child => {
2377
- // if (child.text.toLowerCase().includes(searchText.toLowerCase())) {
2378
- // results.push(child)
2379
- // } else if (child.items && child.items.length > 0) {
2380
- // child.items = nestedSearch(child.items, searchText)
2381
- // if (child.items.length > 0) {
2382
- // results.push(child)
2383
- // }
2384
- // }
2385
- // })
2386
- }
2387
- return {
2388
- result: generate.snq(() => generate.Generate.flatArray(results[0].result), []),
2389
- matching: generate.snq(() => results[0].matching, []),
2390
- parentIndex: generate.snq(() => results[0].parentIndex, []),
2391
- nestedResult: generate.snq(() => results[0].nestedResult, []),
2392
- };
2393
- };
2394
- const nestedSearch = (id, items, searchText) => {
2395
- let matching = [];
2396
- let parentIndex = [];
2397
- let result = [];
2398
- let nestedResult = [];
2399
- const { searchIsOnlyChilds } = getValue(id);
2400
- if (items && items.length > 0) {
2401
- items.forEach(child => {
2402
- let isChild = searchIsOnlyChilds && child.parentId !== null;
2403
- let isMatching = (child.text && stringHelper.StringHelper.slugify(child.text).includes(stringHelper.StringHelper.slugify(searchText))) ||
2404
- (child.keywords && stringHelper.StringHelper.slugify(child.keywords).includes(stringHelper.StringHelper.slugify(searchText)));
2405
- if (isMatching && (!searchIsOnlyChilds || (searchIsOnlyChilds && isChild))) {
2406
- result.push(child.id);
2407
- matching.push(child.id);
2408
- parentIndex.push(child.id);
2409
- nestedResult.push({ id: child.id, text: child.text, parentId: child.parentId });
2410
- if (child.items && child.items.length > 0) {
2411
- const found = nestedSearch(id, child.items, searchText);
2412
- if (found.matching.length > 0) {
2413
- found.matching.forEach(chi => {
2414
- matching.push(chi);
2415
- });
2416
- }
2417
- }
2418
- }
2419
- else if (child.items && child.items.length > 0) {
2420
- const found = nestedSearch(id, child.items, searchText);
2421
- if (found.result.length > 0) {
2422
- found.result.forEach(chi => {
2423
- result.push(chi);
2424
- });
2425
- result.push(child.id);
2426
- parentIndex.push(child.id);
2427
- nestedResult.push({ id: child.id, text: child.text, parentId: child.parentId, items: found.nestedResult });
2428
- }
2429
- if (found.matching.length > 0) {
2430
- matching.push(...found.matching);
2431
- }
2432
- }
2433
- });
2434
- }
2435
- return { result, matching, parentIndex, nestedResult };
2436
- };
2437
- const searchState = {
2438
- setValue,
2439
- removeValue,
2440
- getValue,
2441
- getDataPagination,
2442
- searchData,
2443
- };
2444
-
2445
- 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}";
2446
-
2447
- const BcmSearch = class {
2448
- constructor(hostRef) {
2449
- index$1.registerInstance(this, hostRef);
2450
- this.bcmOnSearch = index$1.createEvent(this, "bcm-on-search", 7);
2451
- this.bcmOnSearchClear = index$1.createEvent(this, "bcm-on-search-clear", 7);
2452
- this.debounceHandler = generate.Generate.debounceInput((event) => this.onSearchValue(event, this), 300, false, () => {
2453
- var _a, _b;
2454
- 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;
2455
- });
2456
- this._id = generate.Generate.UID();
2457
- this.placeholder = "Search";
2458
- this.disabled = false;
2459
- this.readonly = false;
2460
- this.clearable = true;
2461
- this.size = bcm.Bcm.Size.medium;
2462
- this.limit = 10;
2463
- this.searchIsOnlyChilds = false;
2464
- this.minSearchLength = 2;
2465
- this.data = [];
2466
- this.tick = {};
2467
- this.isActiveClearable = false;
2468
- }
2469
- async componentDidLoad() {
2470
- await this.initState();
2471
- }
2472
- async dataChanged(newValue, oldValue) {
2473
- // console.log('data changed', newValue, oldValue)
2474
- if (newValue !== oldValue) {
2475
- await this.initState();
2476
- }
2477
- }
2478
- async initState() {
2479
- await searchState.setValue({
2480
- id: this._id + "-input",
2481
- dataSource: this.data,
2482
- searchIsOnlyChilds: this.searchIsOnlyChilds,
2483
- });
2484
- await this.markForCheck();
2485
- }
2486
- markForCheck() {
2487
- this.tick = generate.Generate.UID();
2488
- }
2489
- handleInput() {
2490
- // console.log("aheyya")
2491
- }
2492
- async onBcmFocus() {
2493
- this.inputElement.focus();
2494
- }
2495
- async onBcmBlur() {
2496
- this.inputElement.blur();
2497
- }
2498
- async onBcmSelect() {
2499
- this.inputElement.select();
2500
- }
2501
- async setValue(newValue) {
2502
- this.inputElement.value = newValue;
2503
- }
2504
- handleFocus() { }
2505
- handleBlur() { }
2506
- handleChange() { }
2507
- async handleClear(eventEmit = true) {
2508
- this.inputElement.value = '';
2509
- const { value, id } = this.inputElement;
2510
- searchState.searchData(id, value);
2511
- this.isActiveClearable = false;
2512
- this.bcmOnSearch.emit({ result: null, value: null, matching: null, parentIndex: null });
2513
- this.bcmOnSearchClear.emit(eventEmit);
2514
- await utils.delay(10);
2515
- return Promise.resolve();
2516
- }
2517
- onSearchValue(event, instance) {
2518
- const { value, id } = event.target;
2519
- const searchResult = (value === null || value === void 0 ? void 0 : value.length) >= this.minSearchLength ? searchState.searchData(id, value, null) : null;
2520
- const { bcmOnSearch, inputElement } = instance;
2521
- 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 });
2522
- }
2523
- render() {
2524
- const { _id, placeholder, disabled, readonly } = this;
2525
- return index$1.h(index$1.Host, { onClick: () => { this.onBcmFocus(); this.onBcmSelect(); } }, index$1.h(inputTemplate.InputTemplate, { size: this.size, id: _id, type: "search", placeholder: placeholder, disabled: disabled, "full-width": true, readonly: readonly, clearable: this.isActiveClearable, handleFocus: () => this.handleFocus(), handleBlur: () => this.handleBlur(), handleChange: () => this.handleChange(), handleClear: () => this.handleClear(), handleInput: this.debounceHandler, ref: (el) => this.inputElement = el }));
2526
- }
2527
- get el() { return index$1.getElement(this); }
2528
- static get watchers() { return {
2529
- "data": ["dataChanged"]
2530
- }; }
2531
- };
2532
- BcmSearch.style = searchCss;
2533
-
2534
- exports.bcm_list = BcmList;
2535
- exports.bcm_rc_overflow = BcmRcOverflow;
2536
- exports.bcm_search = BcmSearch;