bromcom-ui 2.8.1 → 2.9.0-rc.1

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 (240) 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-0d4a552d.entry.js → p-043beeb5.entry.js} +1 -1
  4. package/dist/bromcom-ui/{p-80a43b79.js → p-08fb3095.js} +1 -1
  5. package/dist/bromcom-ui/{p-d011a407.entry.js → p-0a28fd61.entry.js} +1 -1
  6. package/dist/bromcom-ui/{p-a49ded35.entry.js → p-0c07940d.entry.js} +1 -1
  7. package/dist/bromcom-ui/{p-02afc93f.entry.js → p-0d9741fc.entry.js} +1 -1
  8. package/dist/bromcom-ui/{p-a8a4460a.entry.js → p-11629904.entry.js} +1 -1
  9. package/dist/bromcom-ui/{p-274465b7.entry.js → p-11e7f04b.entry.js} +1 -1
  10. package/dist/bromcom-ui/{p-87df3ffb.js → p-12543c4f.js} +1 -1
  11. package/dist/bromcom-ui/{p-90894817.entry.js → p-139b0cfc.entry.js} +1 -1
  12. package/dist/bromcom-ui/{p-0d693b8b.entry.js → p-195c4c41.entry.js} +1 -1
  13. package/dist/bromcom-ui/{p-9c9babdd.entry.js → p-1b8982a8.entry.js} +1 -1
  14. package/dist/bromcom-ui/p-24aefda6.js +1 -1
  15. package/dist/bromcom-ui/{p-24a733ff.entry.js → p-25cfdc1c.entry.js} +1 -1
  16. package/dist/bromcom-ui/p-27a8f8cc.entry.js +5 -0
  17. package/dist/bromcom-ui/{p-160ef457.entry.js → p-3731f4fb.entry.js} +1 -1
  18. package/dist/bromcom-ui/{p-2ea24a6e.js → p-431b023c.js} +1 -1
  19. package/dist/bromcom-ui/{p-236def30.entry.js → p-43bb2a7c.entry.js} +1 -1
  20. package/dist/bromcom-ui/p-440afdfa.entry.js +5 -0
  21. package/dist/bromcom-ui/{p-e7028542.entry.js → p-465c6839.entry.js} +1 -1
  22. package/dist/bromcom-ui/{p-56896e3a.entry.js → p-49105365.entry.js} +1 -1
  23. package/dist/bromcom-ui/{p-e0618f5d.entry.js → p-4be5dbb6.entry.js} +1 -1
  24. package/dist/bromcom-ui/p-4fcc0d21.entry.js +5 -0
  25. package/dist/bromcom-ui/{p-b94fa326.js → p-54bcf02f.js} +1 -1
  26. package/dist/bromcom-ui/{p-0ee1ff83.entry.js → p-61f2613f.entry.js} +1 -1
  27. package/dist/bromcom-ui/{p-8864e6af.entry.js → p-62adb1ff.entry.js} +1 -1
  28. package/dist/bromcom-ui/{p-94293d46.entry.js → p-68e2ddc3.entry.js} +1 -1
  29. package/dist/bromcom-ui/{p-251bfa4c.entry.js → p-78bfd81b.entry.js} +1 -1
  30. package/dist/bromcom-ui/{p-f902b559.js → p-799af572.js} +1 -1
  31. package/dist/bromcom-ui/{p-cf7af1fc.entry.js → p-7b09e9b1.entry.js} +1 -1
  32. package/dist/bromcom-ui/{p-d1598dd5.entry.js → p-7ce49866.entry.js} +1 -1
  33. package/dist/bromcom-ui/p-8d0ca8c2.js +1 -1
  34. package/dist/bromcom-ui/{p-89f7a5c7.entry.js → p-908e7c36.entry.js} +1 -1
  35. package/dist/bromcom-ui/p-92bf3f86.js +5 -0
  36. package/dist/bromcom-ui/{p-7658ec26.entry.js → p-9bdcbb1a.entry.js} +1 -1
  37. package/dist/bromcom-ui/{p-f4f4e410.entry.js → p-9be7f6be.entry.js} +1 -1
  38. package/dist/bromcom-ui/{p-c15e0e77.entry.js → p-a104f436.entry.js} +1 -1
  39. package/dist/bromcom-ui/{p-be6d0712.entry.js → p-a1b02a4a.entry.js} +1 -1
  40. package/dist/bromcom-ui/p-a429e85b.js +1 -1
  41. package/dist/bromcom-ui/{p-dcb2ae7f.entry.js → p-abd0ebef.entry.js} +1 -1
  42. package/dist/bromcom-ui/p-b0353da0.entry.js +19 -0
  43. package/dist/bromcom-ui/p-b60bcecf.js +1 -1
  44. package/dist/bromcom-ui/{p-72b7fda0.entry.js → p-b640b81a.entry.js} +1 -1
  45. package/dist/bromcom-ui/{p-e6ce5ec8.entry.js → p-b7d6857f.entry.js} +1 -1
  46. package/dist/bromcom-ui/{p-e82340a2.entry.js → p-bad06cf8.entry.js} +1 -1
  47. package/dist/bromcom-ui/{p-625af6e2.entry.js → p-c41e87a2.entry.js} +1 -1
  48. package/dist/bromcom-ui/p-c6c6529b.entry.js +5 -0
  49. package/dist/bromcom-ui/p-cb0afdd3.entry.js +5 -0
  50. package/dist/bromcom-ui/{p-e0f440b4.js → p-cb6d3c4e.js} +1 -1
  51. package/dist/bromcom-ui/{p-a3aa9b2a.entry.js → p-cc470d2a.entry.js} +1 -1
  52. package/dist/bromcom-ui/{p-47b69111.entry.js → p-d0b8b715.entry.js} +1 -1
  53. package/dist/bromcom-ui/p-d18196f9.entry.js +5 -0
  54. package/dist/bromcom-ui/{p-4899fba4.entry.js → p-d5b645ba.entry.js} +1 -1
  55. package/dist/bromcom-ui/{p-dce2079e.entry.js → p-d78958e3.entry.js} +1 -1
  56. package/dist/bromcom-ui/p-ded0661d.entry.js +5 -0
  57. package/dist/bromcom-ui/{p-9eb2a75d.entry.js → p-e150d373.entry.js} +1 -1
  58. package/dist/bromcom-ui/{p-4dac52f8.entry.js → p-f053aa86.entry.js} +1 -1
  59. package/dist/bromcom-ui/{p-140b10d1.entry.js → p-f589ac2d.entry.js} +1 -1
  60. package/dist/bromcom-ui/{p-2fc1ab9a.entry.js → p-f606f90c.entry.js} +1 -1
  61. package/dist/bromcom-ui/{p-334e3147.entry.js → p-ff488369.entry.js} +1 -1
  62. package/dist/cjs/{bcm-634604e3.js → bcm-ab921827.js} +4 -4
  63. package/dist/cjs/bcm-accordion.cjs.entry.js +1 -1
  64. package/dist/cjs/bcm-alert.cjs.entry.js +3 -3
  65. package/dist/cjs/bcm-attendance.cjs.entry.js +1 -1
  66. package/dist/cjs/{bcm-colorful_2.cjs.entry.js → bcm-avatar_15.cjs.entry.js} +6180 -76
  67. package/dist/cjs/bcm-breadcrumb.cjs.entry.js +1 -1
  68. package/dist/cjs/bcm-button-group.cjs.entry.js +6 -6
  69. package/dist/cjs/bcm-card.cjs.entry.js +4 -4
  70. package/dist/cjs/bcm-checkbox-group.cjs.entry.js +416 -0
  71. package/dist/cjs/bcm-checkbox-lite_9.cjs.entry.js +5 -5
  72. package/dist/cjs/bcm-checkbox_2.cjs.entry.js +193 -0
  73. package/dist/cjs/bcm-collapse.cjs.entry.js +1 -1
  74. package/dist/cjs/bcm-color-input.cjs.entry.js +5 -5
  75. package/dist/cjs/bcm-date-picker.cjs.entry.js +3 -3
  76. package/dist/cjs/bcm-datetime-picker.cjs.entry.js +8 -8
  77. package/dist/cjs/bcm-default.cjs.entry.js +1 -1
  78. package/dist/cjs/bcm-drawer.cjs.entry.js +7 -7
  79. package/dist/cjs/bcm-dropdown.cjs.entry.js +6 -6
  80. package/dist/cjs/bcm-expansion-panel.cjs.entry.js +3 -3
  81. package/dist/cjs/bcm-form-2.cjs.entry.js +5 -4
  82. package/dist/cjs/bcm-input-custom.cjs.entry.js +1 -1
  83. package/dist/cjs/bcm-item.cjs.entry.js +3 -3
  84. package/dist/cjs/bcm-items.cjs.entry.js +3 -3
  85. package/dist/cjs/bcm-link.cjs.entry.js +3 -3
  86. package/dist/cjs/bcm-menu.cjs.entry.js +7 -7
  87. package/dist/cjs/bcm-modal-2-footer.cjs.entry.js +5 -5
  88. package/dist/cjs/bcm-modal-2-header.cjs.entry.js +5 -5
  89. package/dist/cjs/bcm-modal-2.cjs.entry.js +6 -6
  90. package/dist/cjs/bcm-modal.cjs.entry.js +6 -6
  91. package/dist/cjs/bcm-popconfirm-box.cjs.entry.js +4 -4
  92. package/dist/cjs/bcm-popconfirm.cjs.entry.js +4 -4
  93. package/dist/cjs/bcm-popover.cjs.entry.js +8 -8
  94. package/dist/cjs/bcm-progress.cjs.entry.js +3 -3
  95. package/dist/cjs/bcm-radio-group.cjs.entry.js +9 -9
  96. package/dist/cjs/bcm-radio.cjs.entry.js +12 -12
  97. package/dist/cjs/bcm-range.cjs.entry.js +5 -5
  98. package/dist/cjs/bcm-select.cjs.entry.js +2 -2
  99. package/dist/cjs/bcm-skeleton.cjs.entry.js +1 -1
  100. package/dist/cjs/bcm-step.cjs.entry.js +2 -2
  101. package/dist/cjs/bcm-stepper.cjs.entry.js +8 -8
  102. package/dist/cjs/bcm-switch.cjs.entry.js +8 -8
  103. package/dist/cjs/bcm-tab-group.cjs.entry.js +6 -6
  104. package/dist/cjs/bcm-tab-item-header.cjs.entry.js +9 -9
  105. package/dist/cjs/bcm-tab-item.cjs.entry.js +5 -5
  106. package/dist/cjs/bcm-tag.cjs.entry.js +14 -14
  107. package/dist/cjs/bcm-text.cjs.entry.js +3 -3
  108. package/dist/cjs/bcm-textarea.cjs.entry.js +6 -6
  109. package/dist/cjs/bcm-time-picker.cjs.entry.js +3 -3
  110. package/dist/cjs/bcm-toast.cjs.entry.js +10 -10
  111. package/dist/cjs/bromcom-ui.cjs.js +1 -1
  112. package/dist/cjs/{floating-ui-74eb26d6.js → floating-ui-c9fc2202.js} +2 -2
  113. package/dist/cjs/{generate-21143214.js → generate-de243a66.js} +1 -1
  114. package/dist/cjs/{input-template-4617f909.js → input-template-4c532c3a.js} +6 -6
  115. package/dist/cjs/{json-parse-decarator-8dbf0b0e.js → json-parse-decarator-f61061cf.js} +1 -1
  116. package/dist/cjs/{label-template-cc69bc21.js → label-template-4d5f99a5.js} +3 -3
  117. package/dist/cjs/loader.cjs.js +1 -1
  118. package/dist/cjs/{number-helper-08a7ff70.js → number-helper-dedd64eb.js} +1 -1
  119. package/dist/cjs/old-bcm-popover-box.cjs.entry.js +6 -6
  120. package/dist/cjs/old-bcm-popover.cjs.entry.js +4 -4
  121. package/dist/cjs/{popover-placement-3c8f3a72.js → popover-placement-ccb40073.js} +1 -1
  122. package/dist/cjs/{slot-template-3e59d7d8.js → slot-template-d70ea082.js} +1 -1
  123. package/dist/cjs/{stepper-states-9b6818aa.js → stepper-states-faff7944.js} +1 -1
  124. package/dist/cjs/{string-helper-45cffee0.js → string-helper-d681e5c7.js} +2 -2
  125. package/dist/cjs/{tooltip-helper-2e8b879b.js → tooltip-helper-edce6fd0.js} +9 -9
  126. package/dist/cjs/{validators-6a0077a8.js → validators-e5a6ef69.js} +1 -1
  127. package/dist/collection/collection-manifest.json +1 -0
  128. package/dist/collection/components/atoms/chip/chip-group.css +127 -0
  129. package/dist/collection/components/atoms/chip/chip-group.js +336 -0
  130. package/dist/collection/components/atoms/chip/chip.css +9 -0
  131. package/dist/collection/components/atoms/chip/chip.js +109 -26
  132. package/dist/collection/components/organism/form/form.js +1 -0
  133. package/dist/collection/components/organism/form-2/bcm-form-components.js +1 -0
  134. package/dist/collection/components/organism/list/list.css +3 -0
  135. package/dist/components/bcm-chip-group.d.ts +11 -0
  136. package/dist/components/bcm-chip-group.js +194 -0
  137. package/dist/components/bcm-chip.js +1 -100
  138. package/dist/components/bcm-form-2.js +1 -0
  139. package/dist/components/bcm-form.js +1 -0
  140. package/dist/components/bcm-list.js +1 -1702
  141. package/dist/components/chip.js +149 -0
  142. package/dist/components/generate.js +1 -1
  143. package/dist/components/index.d.ts +1 -0
  144. package/dist/components/index.js +1 -0
  145. package/dist/{esm/bcm-list.entry.js → components/list.js} +136 -31
  146. package/dist/esm/bcm-9f50af9c.js +1 -1
  147. package/dist/esm/bcm-accordion.entry.js +1 -1
  148. package/dist/esm/bcm-alert.entry.js +1 -1
  149. package/dist/esm/bcm-attendance.entry.js +1 -1
  150. package/dist/esm/{bcm-colorful_2.entry.js → bcm-avatar_15.entry.js} +6164 -73
  151. package/dist/esm/bcm-breadcrumb.entry.js +1 -1
  152. package/dist/esm/bcm-button-group.entry.js +2 -2
  153. package/dist/esm/bcm-card.entry.js +1 -1
  154. package/dist/esm/bcm-checkbox-group.entry.js +412 -0
  155. package/dist/esm/bcm-checkbox-lite_9.entry.js +2 -2
  156. package/dist/esm/bcm-checkbox_2.entry.js +188 -0
  157. package/dist/esm/bcm-collapse.entry.js +1 -1
  158. package/dist/esm/bcm-color-input.entry.js +3 -3
  159. package/dist/esm/bcm-date-picker.entry.js +2 -2
  160. package/dist/esm/bcm-datetime-picker.entry.js +2 -2
  161. package/dist/esm/bcm-default.entry.js +1 -1
  162. package/dist/esm/bcm-drawer.entry.js +4 -4
  163. package/dist/esm/bcm-dropdown.entry.js +3 -3
  164. package/dist/esm/bcm-expansion-panel.entry.js +1 -1
  165. package/dist/esm/bcm-form-2.entry.js +3 -2
  166. package/dist/esm/bcm-input-custom.entry.js +1 -1
  167. package/dist/esm/bcm-item.entry.js +2 -2
  168. package/dist/esm/bcm-items.entry.js +1 -1
  169. package/dist/esm/bcm-link.entry.js +1 -1
  170. package/dist/esm/bcm-menu.entry.js +4 -4
  171. package/dist/esm/bcm-modal-2-footer.entry.js +3 -3
  172. package/dist/esm/bcm-modal-2-header.entry.js +3 -3
  173. package/dist/esm/bcm-modal-2.entry.js +4 -4
  174. package/dist/esm/bcm-modal.entry.js +2 -2
  175. package/dist/esm/bcm-popconfirm-box.entry.js +1 -1
  176. package/dist/esm/bcm-popconfirm.entry.js +2 -2
  177. package/dist/esm/bcm-popover.entry.js +4 -4
  178. package/dist/esm/bcm-progress.entry.js +2 -2
  179. package/dist/esm/bcm-radio-group.entry.js +4 -4
  180. package/dist/esm/bcm-radio.entry.js +4 -4
  181. package/dist/esm/bcm-range.entry.js +2 -2
  182. package/dist/esm/bcm-skeleton.entry.js +1 -1
  183. package/dist/esm/bcm-step.entry.js +2 -2
  184. package/dist/esm/bcm-stepper.entry.js +5 -5
  185. package/dist/esm/bcm-switch.entry.js +2 -2
  186. package/dist/esm/bcm-tab-group.entry.js +4 -4
  187. package/dist/esm/bcm-tab-item-header.entry.js +4 -4
  188. package/dist/esm/bcm-tab-item.entry.js +3 -3
  189. package/dist/esm/bcm-tag.entry.js +3 -3
  190. package/dist/esm/bcm-textarea.entry.js +3 -3
  191. package/dist/esm/bcm-time-picker.entry.js +2 -2
  192. package/dist/esm/bcm-toast.entry.js +2 -2
  193. package/dist/esm/bromcom-ui.js +1 -1
  194. package/dist/esm/floating-ui-e7341329.js +1 -1
  195. package/dist/esm/{generate-a39b1045.js → generate-61676bf1.js} +1 -1
  196. package/dist/esm/{input-template-e1df6efd.js → input-template-606f7441.js} +2 -2
  197. package/dist/esm/{json-parse-decarator-b1ceb8c8.js → json-parse-decarator-2303670f.js} +1 -1
  198. package/dist/esm/label-template-d74fe788.js +1 -1
  199. package/dist/esm/loader.js +1 -1
  200. package/dist/esm/{number-helper-fa8e8000.js → number-helper-4ef4df19.js} +1 -1
  201. package/dist/esm/old-bcm-popover-box.entry.js +2 -2
  202. package/dist/esm/old-bcm-popover.entry.js +2 -2
  203. package/dist/esm/{stepper-states-44849ee8.js → stepper-states-9bb5528f.js} +1 -1
  204. package/dist/esm/string-helper-6bd24967.js +1 -1
  205. package/dist/esm/{tooltip-helper-10b64c23.js → tooltip-helper-79e225e7.js} +4 -4
  206. package/dist/esm/{validators-dd70be40.js → validators-c4a5912c.js} +1 -1
  207. package/dist/types/components/atoms/chip/chip-group.d.ts +26 -0
  208. package/dist/types/components/atoms/chip/chip.d.ts +18 -13
  209. package/dist/types/components.d.ts +49 -4
  210. package/package.json +1 -1
  211. package/dist/bromcom-ui/p-111c4b6a.entry.js +0 -5
  212. package/dist/bromcom-ui/p-121eca04.entry.js +0 -5
  213. package/dist/bromcom-ui/p-1eabd5dc.js +0 -10
  214. package/dist/bromcom-ui/p-55837df1.entry.js +0 -5
  215. package/dist/bromcom-ui/p-86b8672d.entry.js +0 -5
  216. package/dist/bromcom-ui/p-8c62e1ca.entry.js +0 -5
  217. package/dist/bromcom-ui/p-9d23288e.entry.js +0 -5
  218. package/dist/bromcom-ui/p-b4f40047.entry.js +0 -5
  219. package/dist/bromcom-ui/p-b5ba17a4.entry.js +0 -13
  220. package/dist/bromcom-ui/p-b85bdadc.entry.js +0 -5
  221. package/dist/bromcom-ui/p-cbb3c1f0.entry.js +0 -5
  222. package/dist/bromcom-ui/p-d155cf69.entry.js +0 -5
  223. package/dist/bromcom-ui/p-d3cb8d25.js +0 -5
  224. package/dist/bromcom-ui/p-f3d550ed.entry.js +0 -5
  225. package/dist/bromcom-ui/p-fdc8effc.entry.js +0 -5
  226. package/dist/cjs/bcm-avatar_2.cjs.entry.js +0 -139
  227. package/dist/cjs/bcm-button_7.cjs.entry.js +0 -1521
  228. package/dist/cjs/bcm-chip.cjs.entry.js +0 -74
  229. package/dist/cjs/bcm-input.cjs.entry.js +0 -370
  230. package/dist/cjs/bcm-list.cjs.entry.js +0 -1607
  231. package/dist/cjs/bcm-rc-overflow_2.cjs.entry.js +0 -2443
  232. package/dist/cjs/bcm-typography.cjs.entry.js +0 -21
  233. package/dist/cjs/index-906fb4e5.js +0 -540
  234. package/dist/esm/bcm-avatar_2.entry.js +0 -134
  235. package/dist/esm/bcm-button_7.entry.js +0 -1511
  236. package/dist/esm/bcm-chip.entry.js +0 -70
  237. package/dist/esm/bcm-input.entry.js +0 -366
  238. package/dist/esm/bcm-rc-overflow_2.entry.js +0 -2438
  239. package/dist/esm/bcm-typography.entry.js +0 -17
  240. package/dist/esm/index-6310a048.js +0 -537
@@ -1,1607 +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-ddfd6d8f.js');
10
- const isLoadDecorator = require('./is-load-decorator-137dded1.js');
11
- const jsonParseDecarator = require('./json-parse-decarator-8dbf0b0e.js');
12
- require('./color-helper-d6d2028b.js');
13
- require('./datetime-helper-eaf4fadb.js');
14
- const generate = require('./generate-21143214.js');
15
- const numberHelper = require('./number-helper-08a7ff70.js');
16
- const stringHelper = require('./string-helper-45cffee0.js');
17
- const validators = require('./validators-6a0077a8.js');
18
- require('./element-dragger-a8562f82.js');
19
- const popoverPlacement = require('./popover-placement-3c8f3a72.js');
20
- const utils = require('./utils-fc077139.js');
21
- const bcm = require('./bcm-634604e3.js');
22
- const captionTemplate = require('./caption-template-8d099fd6.js');
23
- const index = require('./index-fdbf5226.js');
24
- require('./types-cc4adee7.js');
25
- const labelTemplate = require('./label-template-cc69bc21.js');
26
- require('./types-7523fd99.js');
27
- const index$2 = require('./index-4506fcd7.js');
28
- require('./colors-56282b00.js');
29
- require('./colors-e1d142ad.js');
30
- require('./_commonjsHelpers-bd20f4c0.js');
31
- require('./slot-template-3e59d7d8.js');
32
-
33
- const CheckboxTemplate = ({ disabled, checked, readonly, required, indeterminate, hidden, captionType, _id }) => {
34
- // if ( indeterminate ) {
35
- // checked = indeterminate == 'determinate' ? true : false
36
- // }
37
- const hostClasses = index.classnames('bcm-checkbox', 'bcm-checkbox__type-default', `bcm-checkbox-size-medium`, {
38
- // 'size-2': size === Bcm.Size.small || size === Bcm.Size.medium,
39
- // 'size-3': optionType === 'button' && size === Bcm.Size.large,
40
- 'error': captionType == bcm.Bcm.Status.error,
41
- hidden,
42
- checked,
43
- disabled,
44
- required,
45
- readonly,
46
- });
47
- const bcmCheckboxIconClass = index.classnames('bcm-checkbox__label-icon', 'bcm-checkbox__label-icon-lite', 'bcm-checkbox__label-icon-' + indeterminate, {
48
- 'bcm-checkbox__label-icon-checked': checked,
49
- });
50
- const bcmCheckboxLabelClass = index.classnames('bcm-checkbox__label');
51
- return (index$1.h("div", { class: hostClasses },
52
- index$1.h("input", { tabindex: "-1", id: _id, type: "checkbox", checked: checked, disabled: disabled, required: required, readonly: readonly }),
53
- index$1.h("label", { class: bcmCheckboxLabelClass, htmlFor: _id },
54
- index$1.h("span", { class: bcmCheckboxIconClass },
55
- index$1.h("bcm-icon", { icon: "far fa-check" })))));
56
- };
57
-
58
- const InfoFooterTemplate = ({ selected, total, found, multiple, variableText }) => {
59
- total = total || 0;
60
- variableText = variableText ? utils.pluralize(variableText, total) : 'items';
61
- return (index$1.h("footer", { class: "bcm-info-footer" },
62
- index$1.h("bcm-text", { scale: "size-1", color: "grey-8" },
63
- (multiple && selected > 0) && ` ( ${selected} selected ) `,
64
- ` Total ${total} `,
65
- found != null && ` / ${found} `,
66
- ` ${variableText} found. `)));
67
- };
68
-
69
- const ListItemTemplate = ({ item, treeview, highlight, checkboxes, size, selectedItem, openGroup, checkedItem, focusItem, searchIsOnlyChilds }) => {
70
- const isHaveChildren = item.items && item.items.length > 0;
71
- var text = stringHelper.StringHelper.htmlEntities(item.text);
72
- let intersection = [];
73
- if (highlight && stringHelper.StringHelper.slugify(text).includes(stringHelper.StringHelper.slugify(highlight))) {
74
- if (!searchIsOnlyChilds || (searchIsOnlyChilds && (!isHaveChildren || (!treeview && item.type != "group")))) {
75
- text = stringHelper.StringHelper.highlight(text, highlight);
76
- }
77
- }
78
- if (item.type != 'group' && item.template) {
79
- const match = item.template
80
- .replace(/\s/g, '')
81
- .match(/\{{[^}}]+\}/g)
82
- .map(x => x.replace(/[{}]/g, ''));
83
- const keys = Object.keys(item.itemObject);
84
- intersection = match.filter(x => keys.includes(x));
85
- }
86
- text = item.isHtmlContent ? item.isHtmlContent : item.template && intersection.length > 0 ? stringHelper.StringHelper.templateParser(item.template, Object.assign(Object.assign({}, item.itemObject), { text })) : text;
87
- const unClickable = !treeview && item.type == "group" && !item.clickable;
88
- const disabled = item.disabled;
89
- const readonly = item.readonly;
90
- const itemClick = (event) => {
91
- let path = event.path || event.composedPath();
92
- if (path.filter(x => x.attributes && x.attributes.getNamedItem("unlinked"))[0]) {
93
- return;
94
- }
95
- if (readonly) {
96
- collapseClick();
97
- }
98
- !unClickable && !disabled && !readonly && (checkboxes ? checkedItem(item.id) : selectedItem(item.id));
99
- };
100
- const collapseClick = () => {
101
- item.open = item.isSearching;
102
- openGroup(item.id);
103
- };
104
- return (index$1.h("div", { id: item.id, hidden: item.hidden, "on-focus": e => !unClickable && !disabled && focusItem(e), class: index.classnames('bcm-list__item',
105
- // size === 'large' ? 'size-3' : 'size-2',
106
- 'bcm-list__item-' + size, {
107
- 'bcm-list__item--group': !treeview && item.type == 'group',
108
- 'bcm-list__item--readonly': readonly,
109
- }) },
110
- index$1.h("div", { class: index.classnames('bcm-list__item-content', !checkboxes && item.selected && 'selected', { disabled: disabled }) },
111
- 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')) }))),
112
- index$1.h("div", { class: index.classnames('bcm-list__item-content-text', { treeview }), onClick: (e) => itemClick(e) },
113
- checkboxes && (treeview || (!treeview && item.type != 'group')) && (index$1.h("div", { class: "bcm-list__item-content-text-checkbox" },
114
- index$1.h(CheckboxTemplate, { indeterminate: item.indeterminate, checked: item.checked, disabled: item.disabled }))),
115
- index$1.h("span", Object.assign({ class: "bcm-list__item-content-text-inner" }, (item.title && { "title": item.title }), { innerHTML: text })))),
116
- (treeview || !treeview && item.type == "group") && isHaveChildren && (index$1.h("div", { class: "bcm-list__item-childs" }, (item.isSearching || item.open || (!treeview && item.type == "group")) &&
117
- 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) })))))));
118
- };
119
-
120
- const ListTemplate = ({ highlight, selectAllItem, bcmListContainer, treeview, checkboxes, checkAll, infoFooter, value, totalData, searchFound, variableText, _id, data, width, height, size, searchPlaceholder, minSearchLength, selectedItem, openGroup, checkedItem, onScrollEvent, focusItem, items, searchable, searchIsOnlyChilds, emptyText, emptyIcon, }) => {
121
- const showSelectAll = !(treeview && searchFound > 0) && !(searchFound > 0);
122
- const setScrollHeight = () => {
123
- const itemHeight = size === 'small' ? 28 : size === 'medium' ? 36 : 48;
124
- const itemCount = searchFound == null ? (treeview ? items.length : totalData) : searchFound;
125
- const scrollHeight = itemCount * itemHeight || 0;
126
- return {
127
- 'min-height': `${scrollHeight}px`,
128
- 'overscroll-behavior': 'none',
129
- 'height': '100%',
130
- 'display': 'flex',
131
- 'flex-direction': 'column',
132
- };
133
- };
134
- return (index$1.h("div", { id: `bcm-list-${_id}`, class: bcmListContainer, style: { '--height': height, '--width': width } },
135
- data && searchable && (index$1.h("section", { class: "bcm-list__container-search" },
136
- index$1.h("bcm-search", { size: size, id: `bcm-list-${_id}-search`, data: data, clearable: true, placeholder: searchPlaceholder, "min-search-length": minSearchLength, searchIsOnlyChilds: searchIsOnlyChilds }))),
137
- index$1.h("main", { onScroll: e => onScrollEvent(e), class: "scrolling", style: { 'overscroll-behavior': 'none' } },
138
- index$1.h("div", { style: setScrollHeight() },
139
- checkAll && searchFound != 0 && items && items.length > 0 && checkboxes && showSelectAll && (index$1.h("section", { class: "bcm-list__container-select-all" },
140
- 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) }))),
141
- 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) }))),
142
- (!items || items.length === 0) && searchFound != 0 && (index$1.h("section", { class: "bcm-list__container-no-data" },
143
- index$1.h("bcm-empty", { style: { height: 'auto' }, icon: emptyIcon },
144
- index$1.h("span", { innerHTML: emptyText || 'No data' })))),
145
- searchFound == 0 && (index$1.h("section", { class: "bcm-list__container-no-data" },
146
- index$1.h("bcm-empty", { style: { height: 'auto' }, icon: emptyIcon },
147
- index$1.h("span", { innerHTML: emptyText || 'No Data Found' })))))),
148
- 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 }))));
149
- };
150
-
151
- const { state } = index$2.createStore({
152
- value: new Map(),
153
- });
154
- const setValue = val => {
155
- const { id, dataSource, options } = val;
156
- const { type, treeview, checkboxes, searchable, value, name, label, size, disabled, readonly, highlight, required, hidden, fullWidth, height, maxHeight, minHeight, width, infoFooter, variableText, template, allOpen, keyControl, checkAll, linkedComponent, placeholder, searchPlaceholder, searchIsOnlyChilds, clearable, caption, noCaption, captionType, captionError, placement, } = options;
157
- const itemOptions = { size, checkboxes, template, allOpen, highlight, treeview };
158
- const data = {
159
- id: generate.snq(() => id, generate.Generate.UID),
160
- dataSource: dataSource && dataSource.length > 0 && recursive(dataSource, itemOptions),
161
- options: {
162
- type,
163
- treeview,
164
- checkboxes,
165
- searchable,
166
- value,
167
- name,
168
- label,
169
- size,
170
- disabled,
171
- readonly,
172
- highlight,
173
- required,
174
- hidden,
175
- fullWidth,
176
- height,
177
- maxHeight,
178
- minHeight,
179
- width,
180
- infoFooter,
181
- variableText,
182
- template,
183
- allOpen,
184
- keyControl,
185
- checkAll,
186
- linkedComponent,
187
- placeholder,
188
- searchPlaceholder,
189
- searchIsOnlyChilds,
190
- clearable,
191
- caption,
192
- noCaption,
193
- captionType,
194
- captionError,
195
- placement,
196
- },
197
- totalItems: (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) > 0 && calculateTotalItems(dataSource, options.treeview),
198
- totalRoots: dataSource === null || dataSource === void 0 ? void 0 : dataSource.length,
199
- };
200
- state.value.set(data.id, data);
201
- };
202
- const recursive = (data, options, parentId, parentIndex = "0.") => {
203
- let recData = [];
204
- if (data && data.length > 0) {
205
- recData = data.map((item, index) => (Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ itemObject: item }, item), options), { parentId: generate.snq(() => parentId, null), open: options.allOpen || item.open || false }), ((options.treeview || (!options.treeview && item.type == 'group')) && item.items && item.items.length > 0
206
- ? { items: generate.snq(() => recursive(item.items, options, item.id, `${parentIndex}${index}`), []) }
207
- : { items: [] })), { ct: `${parentIndex}${index}` })));
208
- }
209
- return recData;
210
- };
211
- const removeValue = _id => {
212
- state.value.delete(_id);
213
- };
214
- const getValue = id => generate.snq(() => state.value.get(id), {});
215
- const calculateTotalItems = (dataSource, treeview) => {
216
- let total = 0;
217
- dataSource.forEach(item => {
218
- if (treeview || (!treeview && item.type != "group")) {
219
- total += 1;
220
- }
221
- if ((treeview || (!treeview && item.type == "group")) && item.items) {
222
- total += calculateTotalItems(item.items, treeview);
223
- }
224
- });
225
- return total;
226
- };
227
- const getData = id => {
228
- let data = [];
229
- const value = getValue(id);
230
- if (value) {
231
- const { dataSource } = value;
232
- data = dataSource;
233
- }
234
- return data;
235
- };
236
- const getDataPagination = (id, limit = 3, ids) => {
237
- let data = [];
238
- const value = getValue(id);
239
- if (value) {
240
- const { dataSource } = value;
241
- data = !ids ? dataSource.slice(0, limit) : dataSource.filter(item => ids.indexOf(item.id) > -1).slice(0, limit);
242
- }
243
- return data;
244
- };
245
- const openGroup = (id, groupId, items, status) => {
246
- let dataSource;
247
- if (items) {
248
- dataSource = items;
249
- }
250
- else {
251
- const value = getValue(id);
252
- dataSource = value.dataSource;
253
- }
254
- if (dataSource) {
255
- dataSource.forEach(item => {
256
- if (status != undefined) {
257
- item.open = status;
258
- }
259
- else if (item.id == groupId) {
260
- item.open = !item.open;
261
- item.isSearching = item.open;
262
- if (!item.open && item.items) {
263
- openGroup(id, groupId, item.items, false);
264
- }
265
- }
266
- else if (item.items) {
267
- openGroup(id, groupId, item.items);
268
- }
269
- });
270
- }
271
- };
272
- const removeOtherTags = (id, ids, items) => {
273
- ids = Array.isArray(ids) ? ids : [ids];
274
- let dataSource;
275
- if (items) {
276
- dataSource = items;
277
- }
278
- else {
279
- const value = getValue(id);
280
- dataSource = value.dataSource;
281
- }
282
- if (dataSource) {
283
- ids.forEach(otherTagIds => {
284
- dataSource.forEach(child => {
285
- if (child.id == otherTagIds) {
286
- child.checked = false;
287
- child.itemObject.checked = false;
288
- }
289
- else if (child.items) {
290
- onRemoveItems(id, otherTagIds, child.items);
291
- }
292
- });
293
- });
294
- }
295
- };
296
- const onRemoveItems = (id, itemId, items) => {
297
- if (items) {
298
- items.forEach(item => {
299
- if (item.id == itemId) {
300
- item.checked = false;
301
- item.itemObject.checked = false;
302
- indeterminateStatus(id, item.parentId);
303
- }
304
- else if (item.items) {
305
- onRemoveItems(id, itemId, item.items);
306
- }
307
- });
308
- }
309
- };
310
- const addChecked = (id, ids) => {
311
- const value = getValue(id);
312
- if (value) {
313
- ids.forEach(item => {
314
- checkedItem(id, item);
315
- });
316
- }
317
- };
318
- const checkedItem = (id, itemId) => {
319
- findItem(id, itemId);
320
- };
321
- const findItem = (id, itemId, items) => {
322
- itemId = Array.isArray(itemId) ? itemId : [itemId];
323
- let dataSource;
324
- if (items) {
325
- dataSource = items;
326
- }
327
- else {
328
- const value = getValue(id);
329
- dataSource = value.dataSource;
330
- }
331
- if (dataSource) {
332
- dataSource.forEach(item => {
333
- if (itemId.includes(item.id)) {
334
- checkedProcess(id, item);
335
- if (item.parentId) {
336
- indeterminateStatus(id, item.parentId);
337
- }
338
- }
339
- else if (item.items) {
340
- findItem(id, itemId, item.items);
341
- }
342
- });
343
- }
344
- };
345
- const checkedProcess = (id, item, status) => {
346
- const value = getValue(id);
347
- if (value) {
348
- const treeview = value.options.treeview;
349
- if (item) {
350
- // && !item.hidden => select all bastığımızda hidden olanları seçmemesi içindi
351
- if (treeview || (!treeview && item.type != "group")) {
352
- if (!item.disabled) {
353
- if (status != undefined) {
354
- item.checked = status;
355
- }
356
- else {
357
- item.checked = !item.checked;
358
- }
359
- item.itemObject.checked = item.checked;
360
- item.indeterminate = item.checked ? "determinate" : "uncheck";
361
- }
362
- }
363
- if (item.items) {
364
- item.items.forEach(child => {
365
- checkedProcess(id, child, status == undefined ? item.checked : status);
366
- });
367
- }
368
- }
369
- }
370
- };
371
- const indeterminateStatus = (id, itemId, items) => {
372
- let dataSource;
373
- if (items) {
374
- dataSource = items;
375
- }
376
- else {
377
- const value = getValue(id);
378
- dataSource = value.dataSource;
379
- }
380
- if (dataSource) {
381
- dataSource.forEach(item => {
382
- if (item.id == itemId) {
383
- let allChecked = true;
384
- let allUnchecked = true;
385
- if (item.items) {
386
- item.items.map(child => {
387
- (child.checked || child.indeterminate === "indeterminate") && (allUnchecked = false);
388
- !child.checked && (allChecked = false);
389
- });
390
- }
391
- const indeterminateState = !allChecked && !allUnchecked ? "indeterminate" : allChecked ? "determinate" : "uncheck";
392
- item.indeterminate = indeterminateState;
393
- item.checked = indeterminateState == "determinate" ? true : false;
394
- item.itemObject.checked = item.checked;
395
- if (item.parentId) {
396
- indeterminateStatus(id, item.parentId);
397
- }
398
- }
399
- else if (item.items) {
400
- indeterminateStatus(id, itemId, item.items);
401
- }
402
- });
403
- }
404
- };
405
- const filterData = (id, ids, items, searchOtherTag) => {
406
- let checkeds = [];
407
- let visibled = [];
408
- getValue(id).isSearchOtherTag = searchOtherTag;
409
- let dataSource;
410
- if (items) {
411
- dataSource = items;
412
- }
413
- else {
414
- const value = getValue(id);
415
- dataSource = value.dataSource;
416
- }
417
- if (dataSource) {
418
- dataSource.forEach(item => {
419
- if (ids) {
420
- item.hidden = true;
421
- // const filter = ids.find((find) => find.id === item.id)
422
- var filter;
423
- for (let index = 0; index < ids.length; index++) {
424
- if (ids[index].id === item.id) {
425
- filter = ids[index];
426
- break;
427
- }
428
- }
429
- if (filter) {
430
- item.hidden = false;
431
- if (!getValue(id).isSearchOtherTag) {
432
- item.isSearching = true;
433
- }
434
- visibled.push(item);
435
- if (item.checked) {
436
- checkeds.push(item);
437
- }
438
- if (filter.items) {
439
- const { checkedItems, visibledItems } = filterData(id, filter.items, item.items, searchOtherTag);
440
- if (checkedItems) {
441
- checkeds = [...new Set([...checkeds, ...checkedItems])];
442
- }
443
- if (visibledItems) {
444
- visibled = [...new Set([...visibled, ...visibledItems])];
445
- }
446
- }
447
- }
448
- }
449
- else {
450
- item.hidden = false;
451
- if (item.items) {
452
- filterData(id, null, item.items);
453
- }
454
- visibled.push(item);
455
- item.isSearching = false;
456
- }
457
- });
458
- }
459
- return { checkedItems: checkeds !== null && checkeds !== void 0 ? checkeds : [], visibledItems: visibled !== null && visibled !== void 0 ? visibled : [] };
460
- };
461
- const getSelected = (id, items) => {
462
- let dataSource;
463
- let selected = null;
464
- if (items) {
465
- dataSource = items;
466
- }
467
- else {
468
- const value = getValue(id);
469
- dataSource = value.dataSource;
470
- }
471
- if (dataSource) {
472
- dataSource.forEach(item => {
473
- if (item.selected) {
474
- selected = item.itemObject;
475
- }
476
- else if (item.items) {
477
- const found = getSelected(id, item.items);
478
- if (found) {
479
- selected = found;
480
- }
481
- }
482
- });
483
- }
484
- return selected;
485
- };
486
- const getCheckedList = (id, items) => {
487
- let dataSource;
488
- let checkedList = [];
489
- let nestedResult = [];
490
- if (items) {
491
- dataSource = items;
492
- }
493
- else {
494
- const value = getValue(id);
495
- dataSource = value.dataSource;
496
- }
497
- if (dataSource) {
498
- dataSource.forEach(item => {
499
- var _a;
500
- const newItem = Object.assign(Object.assign({}, item.itemObject), { ct: item.ct });
501
- let foundChild = [];
502
- let foundItem = [];
503
- if (item.checked) {
504
- checkedList.push(newItem);
505
- foundItem.push(Object.assign(Object.assign({}, newItem), { items: [] }));
506
- }
507
- if (item.items) {
508
- const found = getCheckedList(id, item.items);
509
- if (((_a = found === null || found === void 0 ? void 0 : found.checkedList) === null || _a === void 0 ? void 0 : _a.length) > 0) {
510
- checkedList = [...checkedList, ...found.checkedList];
511
- }
512
- if (found.nestedResult.length > 0) {
513
- foundChild = found.nestedResult;
514
- }
515
- }
516
- if (foundChild.length > 0) {
517
- if (foundItem.length == 0) {
518
- foundItem.push(Object.assign(Object.assign({}, newItem), { items: [] }));
519
- }
520
- foundItem[0].items = foundChild;
521
- nestedResult.push(foundItem[0]);
522
- }
523
- else {
524
- if (foundItem.length > 0) {
525
- foundItem[0].items = foundChild;
526
- nestedResult.push(foundItem[0]);
527
- }
528
- }
529
- });
530
- }
531
- return { checkedList: (checkedList === null || checkedList === void 0 ? void 0 : checkedList.length) > 0 ? checkedList : null, nestedResult: nestedResult };
532
- };
533
- const selectedItem = (id, itemId, items) => {
534
- let dataSource;
535
- let selected = [];
536
- if (items) {
537
- dataSource = items;
538
- }
539
- else {
540
- const value = getValue(id);
541
- dataSource = value.dataSource;
542
- }
543
- if (dataSource) {
544
- dataSource.forEach(item => {
545
- if (itemId) {
546
- if (item.id == itemId) {
547
- // if (!item.selected){
548
- item.selected = true;
549
- item.itemObject.selected = item.selected;
550
- // }
551
- }
552
- else {
553
- if (item.selected) {
554
- item.selected = false;
555
- item.itemObject.selected = item.selected;
556
- }
557
- }
558
- }
559
- if (item.items) {
560
- const found = selectedItem(id, itemId, item.items);
561
- if ((found === null || found === void 0 ? void 0 : found.length) > 0) {
562
- selected = [...selected, ...found];
563
- }
564
- }
565
- if (item.selected) {
566
- selected.push(item.itemObject);
567
- }
568
- });
569
- }
570
- return selected && selected.length > 0 ? selected : null;
571
- };
572
- const setClear = (id, items) => {
573
- let dataSource;
574
- if (items) {
575
- dataSource = items;
576
- }
577
- else {
578
- const value = getValue(id);
579
- dataSource = value.dataSource;
580
- }
581
- if (dataSource) {
582
- dataSource.forEach(item => {
583
- var _a, _b, _c;
584
- item.checked && (item.checked = false);
585
- item.selected && (item.selected = false);
586
- item.indeterminate && (item.indeterminate = "uncheck");
587
- ((_a = item.itemObject) === null || _a === void 0 ? void 0 : _a.checked) && (item.itemObject.checked = false);
588
- ((_b = item.itemObject) === null || _b === void 0 ? void 0 : _b.selected) && (item.itemObject.selected = false);
589
- ((_c = item.itemObject) === null || _c === void 0 ? void 0 : _c.indeterminate) && (item.itemObject.indeterminate = "uncheck");
590
- if (item.items) {
591
- setClear(id, item.items);
592
- }
593
- });
594
- }
595
- };
596
- const selectAll = (id, status) => {
597
- const dataSource = getValue(id).dataSource;
598
- if (dataSource) {
599
- dataSource.forEach(item => {
600
- checkedProcess(id, item, status);
601
- });
602
- }
603
- };
604
- const updateOptions = (id, options) => {
605
- Object.keys(getValue(id).options).forEach(key => {
606
- getValue(id).options[key] = options[key];
607
- });
608
- };
609
- const removeState = id => {
610
- return Promise.resolve(state.value.delete(id));
611
- };
612
- const listState = {
613
- setValue,
614
- removeValue,
615
- getValue,
616
- getData,
617
- getDataPagination,
618
- openGroup,
619
- checkedItem,
620
- filterData,
621
- getSelected,
622
- getCheckedList,
623
- selectedItem,
624
- addChecked,
625
- setClear,
626
- selectAll,
627
- removeOtherTags,
628
- onRemoveItems,
629
- updateOptions,
630
- removeState,
631
- };
632
-
633
- class KeyControl {
634
- constructor(keyCode, element, elementName, childElementName) {
635
- this.elementName = '';
636
- this.childElementName = '';
637
- this.keyCode = keyCode;
638
- this.element = element;
639
- this.elementName = elementName;
640
- this.childElementName = childElementName;
641
- }
642
- getKeyCode() {
643
- return this.keyCode;
644
- }
645
- getElementName() {
646
- return this.elementName;
647
- }
648
- getChildElementName() {
649
- return this.childElementName;
650
- }
651
- getFocusedElementName() {
652
- return this.getElementName() + '.focused';
653
- }
654
- getFocusedElement() {
655
- return this.element.querySelectorAll(this.getFocusedElementName())[0] || null;
656
- }
657
- getFirstElement() {
658
- return this.element.querySelectorAll(this.getElementName())[0] || null;
659
- }
660
- getNextElement() {
661
- var _a;
662
- return ((_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.nextElementSibling) || this.getFirstElement();
663
- }
664
- getPreviousElement() {
665
- var _a;
666
- return ((_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.previousElementSibling) || this.getFirstElement();
667
- }
668
- getChildElement() {
669
- var _a;
670
- return ((_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.querySelectorAll(this.getChildElementName())[0]) || null;
671
- }
672
- getParentElement(element) {
673
- if (element && element) {
674
- const isRootElement = element && element.attributes['data-isroot'];
675
- if (isRootElement) {
676
- return element;
677
- }
678
- return this.getParentElement(element.parentNode);
679
- }
680
- }
681
- focusElementIsOpen() {
682
- var _a;
683
- return ((_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.classList.contains('bcm-list__item--open')) || false;
684
- }
685
- isRootElement() {
686
- var _a;
687
- return ((_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.querySelectorAll(this.getChildElementName()).length) > 0;
688
- }
689
- isRootElementIsOpen() {
690
- return this.getFocusedElement().classList.contains('bcm-list__item--open');
691
- }
692
- getFocusedChildElement() {
693
- var _a;
694
- return ((_a = this.getChildElement()) === null || _a === void 0 ? void 0 : _a.querySelectorAll('.focused')[0]) || null;
695
- }
696
- isLastElement() {
697
- var _a;
698
- return ((_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.nextElementSibling) === null;
699
- }
700
- focusParentElementFirstChild() {
701
- var _a, _b;
702
- return this.setFocus((_b = (_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.firstChild);
703
- }
704
- isFirstElement() {
705
- var _a;
706
- return ((_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.previousElementSibling) === null;
707
- }
708
- focusRootElement() {
709
- var _a, _b, _c;
710
- return this.setFocus((_c = (_b = (_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.parentElement) === null || _c === void 0 ? void 0 : _c.firstChild);
711
- }
712
- nextRootElement() {
713
- var _a, _b, _c;
714
- return this.setFocus((_c = (_b = (_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.parentElement) === null || _c === void 0 ? void 0 : _c.nextElementSibling);
715
- }
716
- findFocusElementParent() {
717
- return this.getFocusedElement().parentNode.querySelectorAll('.bcm-list__item--open');
718
- }
719
- getLastElement() {
720
- return this.element.querySelectorAll(this.getElementName())[this.element.querySelectorAll(this.getElementName()).length - 1] || null;
721
- }
722
- setFocus(element) {
723
- element.focus();
724
- }
725
- }
726
-
727
- class ListKeyControl extends KeyControl {
728
- constructor(keyCode, element, treeview, checkBoxes) {
729
- super(keyCode, element, '.bcm-list__item', '.bcm-list__item-childs');
730
- this.isTreeview = false;
731
- this.isCheckBoxes = false;
732
- this.isTreeview = treeview;
733
- this.isCheckBoxes = checkBoxes;
734
- }
735
- keyUpControl() {
736
- if (this.isTreeview) {
737
- this.keyUpTreeview();
738
- }
739
- else {
740
- if (this.isFirstElement()) {
741
- this.setFocus(this.getLastElement());
742
- }
743
- else {
744
- this.setFocus(this.getPreviousElement());
745
- }
746
- }
747
- }
748
- keyDownTreeView() {
749
- var _a;
750
- if (this.isTreeview) {
751
- if (this.isRootElement() && this.isRootElementIsOpen()) {
752
- const childs = this.getChildElement();
753
- if (childs) {
754
- this.setFocus(childs.firstChild);
755
- }
756
- }
757
- else {
758
- if (this.isLastElement() && this.getParentElement(this.getFocusedElement())) {
759
- this.setFocus((_a = this.getParentElement(this.getFocusedElement())) === null || _a === void 0 ? void 0 : _a.nextElementSibling);
760
- }
761
- else {
762
- this.setFocus(this.getNextElement());
763
- }
764
- }
765
- }
766
- }
767
- keyUpTreeview() {
768
- if (this.isFirstElement()) {
769
- const parent = this.getParentElement(this.getFocusedElement());
770
- this.setFocus(parent);
771
- }
772
- else {
773
- const previousElement = this.getPreviousElement();
774
- if (previousElement) {
775
- if (previousElement.classList.contains('bcm-list__item--open')) {
776
- const getChildElement = previousElement.querySelectorAll(this.getChildElementName())[0];
777
- console.log({ getChildElement });
778
- this.setFocus(getChildElement.lastChild);
779
- }
780
- else {
781
- this.setFocus(previousElement);
782
- }
783
- }
784
- }
785
- }
786
- keyDownControl() {
787
- if (this.isTreeview) {
788
- this.keyDownTreeView();
789
- }
790
- else {
791
- if (this.isLastElement()) {
792
- this.setFocus(this.getFirstElement());
793
- }
794
- else {
795
- this.setFocus(this.getNextElement());
796
- }
797
- }
798
- }
799
- keyRightControl() {
800
- if (this.isTreeview) {
801
- if (!this.isRootElementIsOpen() && this.isRootElement()) {
802
- const { id } = this.getFocusedElement();
803
- this.openGroup(id);
804
- }
805
- }
806
- }
807
- keyLeftControl() {
808
- if (this.isTreeview) {
809
- if (this.isRootElementIsOpen() && this.isRootElement()) {
810
- const { id } = this.getFocusedElement();
811
- this.openGroup(id);
812
- }
813
- }
814
- }
815
- keyEnterControl() { }
816
- keySpaceControl() {
817
- if (this.isCheckBoxes) {
818
- const { id } = this.getFocusedElement();
819
- this.checkedItem(id);
820
- }
821
- }
822
- keyDown() {
823
- switch (this.getKeyCode()) {
824
- case bcm.Bcm.KeyCode.up:
825
- this.keyUpControl();
826
- break;
827
- case bcm.Bcm.KeyCode.down:
828
- this.keyDownControl();
829
- break;
830
- case bcm.Bcm.KeyCode.left:
831
- this.keyLeftControl();
832
- break;
833
- case bcm.Bcm.KeyCode.right:
834
- this.keyRightControl();
835
- break;
836
- case bcm.Bcm.KeyCode.enter:
837
- this.keyEnterControl();
838
- break;
839
- case bcm.Bcm.KeyCode.space:
840
- this.keySpaceControl();
841
- break;
842
- }
843
- }
844
- keyUp() { }
845
- }
846
-
847
- const listCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");@import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap\"); @import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap\"); @import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap\"); @import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap\"); .size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}*{box-sizing:border-box}.bcm-caption-area{font-family:\"Inter\", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;font-size:12px;line-height:calc(12px + 8px);color:var(--bcm-new-ds-color-slate-400);display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between;flex-wrap:nowrap;margin-top:2px}.bcm-caption-area__text{color:var(--bcm-new-ds-color-slate-400)}.bcm-caption-area__text.default{color:var(--bcm-new-ds-color-slate-400)}.bcm-caption-area__text.info{color:var(--bcm-new-ds-color-blue-500)}.bcm-caption-area__text.success{color:var(--bcm-new-ds-color-emerald-500)}.bcm-caption-area__text.warning{color:var(--bcm-new-ds-color-amber-500)}.bcm-caption-area__text.error{color:var(--bcm-new-ds-color-red-500)}.bcm-caption-area__size-small{font-size:10px;line-height:calc(10px + 8px);min-height:calc(10px + 8px)}.bcm-caption-area__size-medium{font-size:12px;line-height:calc(12px + 8px);min-height:calc(12px + 8px)}.bcm-caption-area__size-large{font-size:14px;line-height:calc(14px + 8px);min-height:calc(14px + 8px)}*{box-sizing:border-box}.bcm-label{display:inline-flex;align-items:flex-start;grid-gap:2px}.bcm-label__text{margin-bottom:2px;font-family:\"Inter\", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;display:inline-block;color:var(--bcm-new-ds-color-slate-600)}.bcm-label__size-small{font-size:10px;line-height:calc(10px + 8px);min-height:calc(10px + 8px)}.bcm-label__size-medium{font-size:12px;line-height:calc(12px + 8px);min-height:calc(12px + 8px)}.bcm-label__size-large{font-size:14px;line-height:calc(14px + 8px);min-height:calc(14px + 8px)}.bcm-input[no-margin]{margin:0}.bcm-textarea[no-margin]{margin:0}.bcm-switch[no-margin]{margin:0}.bcm-checkbox[no-margin]{margin:0}.bcm-radio-group[no-margin]{margin:0}.bcm-checkbox-group[no-margin]{margin:0}.bcm-range[no-margin]{margin:0}.bcm-form[no-margin]{margin:0}.bcm-form-group[no-margin]{margin:0}.bcm-list[no-margin]{margin:0}.bcm-colorpicker[no-margin]{margin:0}.bcm-date-picker[no-margin]{margin:0}.bcm-time-picker[no-margin]{margin:0}.bcm-datetime-picker[no-margin]{margin:0}.bcm-select[no-margin]{margin:0}.bcm-listbox[no-margin]{margin:0}*{box-sizing:border-box}*{box-sizing:border-box}.bcm-checkbox{outline:none;border:none;--bcm-checkbox-primary-color-default:var(--bcm-new-ds-color-blue-500);--bcm-checkbox-secondary-color-default:var(--bcm-new-ds-color-white);--bcm-checkbox-primary-color-hover:var(--bcm-new-ds-color-blue-600);--bcm-checkbox-secondary-color-hover:var(--bcm-new-ds-color-slate-50);--bcm-checkbox-primary-color-focus-visible:var(--bcm-new-ds-color-blue-800);--bcm-checkbox-secondary-color-focus-visible:var(--bcm-new-ds-color-slate-50);--bcm-checkbox-primary-color-active:var(--bcm-new-ds-color-blue-700);--bcm-checkbox-secondary-color-active:var(--bcm-new-ds-color-slate-50);--bcm-checkbox-primary-color-disabled:var(--bcm-new-ds-color-slate-300);--bcm-checkbox-secondary-color-disabled:var(--bcm-new-ds-color-slate-200);display:inline-flex;width:fit-content;flex-direction:column;margin-bottom:8px}.bcm-checkbox:focus,.bcm-checkbox:hover,.bcm-checkbox:active{outline:none;border:none}.bcm-checkbox *{box-sizing:border-box}.bcm-checkbox input[type=radio],.bcm-checkbox input[type=checkbox]{-webkit-appearance:none;appearance:none;background-color:#fff;margin:0;display:none}.bcm-checkbox__input{display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-start;flex-wrap:nowrap;padding-top:4px}.bcm-checkbox.hidden{display:none}.bcm-checkbox :hover{cursor:pointer}.bcm-checkbox[disabled] :hover,.bcm-checkbox.disabled :hover{cursor:not-allowed}.bcm-checkbox .slot{font-family:\"Inter\", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;font-weight:500;color:var(--bcm-new-ds-color-slate-600)}.bcm-checkbox .slot:not(:empty){margin-left:8px;margin-right:8px}.bcm-checkbox-size-small .slot{font-size:12px;line-height:calc(12px + 8px);margin-top:-2.5px}.bcm-checkbox-size-small .bcm-checkbox__input{min-height:calc(24px - 4px)}.bcm-checkbox-size-small .bcm-checkbox__label-icon{width:14px;height:14px;min-width:14px;font-size:calc(10px - 2px)}.bcm-checkbox-size-medium .slot{font-size:calc(12px + 1px);line-height:calc(12px + 8px);margin-top:-1.5px}.bcm-checkbox-size-medium .bcm-checkbox__input{min-height:calc(32px - 4px)}.bcm-checkbox-size-medium .bcm-checkbox__label-icon{width:16px;height:16px;min-width:16px;font-size:10px}.bcm-checkbox-size-large .slot{font-size:16px;line-height:calc(16px + 8px);margin-top:-1.5px}.bcm-checkbox-size-large .bcm-checkbox__input{min-height:calc(32px - 4px)}.bcm-checkbox-size-large .bcm-checkbox__label-icon{width:18px;height:18px;min-width:18px;font-size:12px}.bcm-checkbox__label{display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-start;flex-wrap:nowrap}.bcm-checkbox__label-icon{display:flex;flex-direction:column;align-items:center;justify-content:center;flex-wrap:nowrap;border-width:1px;border-style:solid;border-radius:2px}.bcm-checkbox__label-icon-indeterminate{position:relative}.bcm-checkbox__label-icon-indeterminate:after{content:\"\";display:block;position:absolute;width:70%;height:1.5px;background:var(--bcm-new-ds-color-white)}.bcm-checkbox__label-icon.bcm-radio__icon{width:16px;height:16px;box-sizing:border-box;border-radius:100px}.bcm-checkbox__label-icon.bcm-radio__icon .bcm-radio__icon-inner{width:10px;height:10px;border-radius:100px;background-color:var(--bcm-new-ds-color-white)}.bcm-checkbox .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-default);color:var(--bcm-checkbox-secondary-color-default);border-color:var(--bcm-new-ds-color-slate-300)}.bcm-checkbox .bcm-checkbox__label-icon-checked,.bcm-checkbox .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-default);border-color:var(--bcm-checkbox-primary-color-default)}.bcm-checkbox .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-default);background-color:var(--bcm-checkbox-secondary-color-default)}.bcm-checkbox .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-default)}.bcm-checkbox .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-default)}.bcm-checkbox:hover .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-hover);color:var(--bcm-checkbox-secondary-color-hover);border-color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-checked,.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-hover);border-color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-hover);background-color:var(--bcm-checkbox-secondary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-focus-visible);color:var(--bcm-checkbox-secondary-color-focus-visible);border-color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-checked,.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-focus-visible);border-color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-focus-visible);background-color:var(--bcm-checkbox-secondary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:active .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-active);color:var(--bcm-checkbox-secondary-color-active);border-color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-checked,.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-active);border-color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-active);background-color:var(--bcm-checkbox-secondary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon,.bcm-checkbox.disabled .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-disabled);color:var(--bcm-checkbox-secondary-color-disabled);border-color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-checked,.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate,.bcm-checkbox.disabled .bcm-checkbox__label-icon-checked,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-disabled);border-color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon,.bcm-checkbox.disabled .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-disabled);background-color:var(--bcm-checkbox-secondary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox.disabled .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[no-margin] .bcm-checkbox__input{margin:0;min-height:0;padding:0}.bcm-list{font-family:\"Inter\", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;--width:256px;--height:256px;--max-height:inherit;--min-height:inherit;min-width:90px;display:flex;flex-direction:column;margin:0 0 8px 0}.bcm-list__listbox .bcm-list__container{height:var(--height);max-height:var(--max-height);min-height:var(--min-height)}.bcm-list.full-width{width:100%}.bcm-list__size-small .bcm-list__input{height:24px;font-size:12px;line-height:calc(12px + 8px)}.bcm-list__size-small .bcm-list__input .bcm-tag__content.dismissable{font-size:10px;line-height:calc(10px + 8px)}.bcm-list__size-medium .bcm-list__input{height:32px;font-size:14px;line-height:calc(14px + 8px)}.bcm-list__size-medium .bcm-list__input .bcm-tag__content.dismissable{font-size:12px;line-height:calc(12px + 8px)}.bcm-list__size-large .bcm-list__input{height:40px;font-size:16px;line-height:calc(16px + 8px)}.bcm-list__size-large .bcm-list__input .bcm-tag__content.dismissable{font-size:14px;line-height:calc(14px + 8px)}.bcm-list:hover{outline:none}.bcm-list:hover .bcm-list__input{border-color:var(--bcm-new-ds-color-blue-500);background-color:var(--bcm-new-ds-color-slate-50)}.bcm-list:focus-visible{outline:none}.bcm-list:focus-visible .bcm-list__input{border-color:var(--bcm-new-ds-color-blue-600);background-color:var(--bcm-new-ds-color-white)}.bcm-list:active{outline:none}.bcm-list:active .bcm-list__input{border-color:var(--bcm-new-ds-color-blue-600);box-shadow:0 1px 3px 0 rgba(17, 24, 38, 0.1)}.bcm-list__container{--width:256px;--height:256px;width:var(--width);height:var(--height);background-color:var(--bcm-new-ds-color-white);border:1px solid var(--bcm-new-ds-color-slate-300);border-radius:4px;box-sizing:border-box;padding-top:8px;display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;flex-wrap:nowrap;gap:4px}.bcm-list__container main{scroll-behavior:smooth;padding:0 8px;flex:1;overflow:auto;display:flex;flex-direction:column}.bcm-list__container-search{margin:0 8px}.bcm-list__container-search:after{margin:4px 0}.bcm-list__container-no-data{flex:1;display:flex;justify-content:stretch;align-items:stretch;padding-bottom:4px}.bcm-list__container.error{border-color:var(--bcm-color-red-6)}.bcm-list__container.full-width{width:100%}.bcm-list__container.bcm-list__type-linked-component,.bcm-list__container.bcm-list__type-select,.bcm-list__container.bcm-list__type-autocomplete{opacity:0;visibility:hidden;position:absolute;top:0;left:0;height:0;width:0;transform:translateY(10%);z-index:10800;transition:visibility 0s linear 400ms, opacity 100ms, transform 200ms}.bcm-list__container.bcm-list__type-linked-component.bcm-list--top,.bcm-list__container.bcm-list__type-select.bcm-list--top,.bcm-list__container.bcm-list__type-autocomplete.bcm-list--top{transform:translateY(-10%)}.bcm-list__container.bcm-list__type-linked-component.is-open,.bcm-list__container.bcm-list__type-select.is-open,.bcm-list__container.bcm-list__type-autocomplete.is-open{opacity:1;transform:translateY(0);visibility:visible;transition:visibility 0s linear 0s, opacity 100ms, transform 100ms}.bcm-list__label{line-height:1}.bcm-list__input{display:flex;align-items:center;justify-content:space-between;box-sizing:border-box;border:1px solid var(--bcm-new-ds-color-slate-300);border-radius:4px;color:var(--bcm-new-ds-color-slate-600);background-color:var(--bcm-new-ds-color-white);user-select:none;cursor:pointer;padding:0 8px;height:32px;overflow:hidden;position:relative;transition:background-color 100ms, border-color 100ms}.bcm-list__input-spinner{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center;background-color:var(--bcm-color-grey-1);opacity:0;visibility:hidden;transition:opacity 0.2s ease-in-out;z-index:-1}.bcm-list__input-spinner.is-open{opacity:1;visibility:visible;z-index:1}.bcm-list__input-container{flex:1;display:block;overflow:hidden}.bcm-list__input-container.value-empty{color:var(--bcm-color-grey-6)}.bcm-list__input-container.type-single,.bcm-list__input-container.value-empty{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bcm-list__input-placeholder{color:var(--bcm-color-grey-6)}.bcm-list__input-tag-container{height:100%;width:100%;display:flex;align-items:center;justify-content:flex-start;flex-wrap:nowrap;grid-gap:2px;line-height:1}.bcm-list__input-buttons{display:flex;align-items:center;justify-content:flex-end;grid-gap:4px}.bcm-list__input-buttons-button{display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding:4px 4px 0 4px;font-size:16px;color:var(--bcm-new-ds-color-slate-500)}.bcm-list__input-buttons-button.caret-is{transform:rotate(360deg);transition:transform 0.2s ease-in-out}.bcm-list__input-buttons-button.caret-is-open{transform:rotate(180deg)}.bcm-list__input-buttons:not(.disabled) .bcm-list__input-buttons-button:hover{cursor:pointer;color:var(--bcm-new-ds-color-slate-600)}.bcm-list__input-autocomplete{position:relative;padding-right:0}.bcm-list__input-autocomplete .bcm-list-input-selected-text{background-color:#ffffff;display:flex;align-items:center;justify-content:flex-start;width:calc(100% - 24px);height:100%;padding:0 calc(8px + 4px);position:absolute;top:0;left:0}.bcm-list__input-autocomplete .bcm-list__input-container{height:100%;display:flex;flex-direction:row}.bcm-list__input-autocomplete .bcm-list__input-container .bcm-list__input-tag-container{width:auto}.bcm-list__input-autocomplete .bcm-input,.bcm-list__input-autocomplete .bcm-list__autocomplete{height:100%;min-width:70px;width:100%}.bcm-list__input-autocomplete .bcm-input__container,.bcm-list__input-autocomplete .bcm-list__autocomplete__container{height:100%;border:none;padding:0;width:100%}.bcm-list__input-autocomplete .bcm-input__container:not(.disabled).focused,.bcm-list__input-autocomplete .bcm-input__container:not(.disabled):hover,.bcm-list__input-autocomplete .bcm-list__autocomplete__container:not(.disabled).focused,.bcm-list__input-autocomplete .bcm-list__autocomplete__container:not(.disabled):hover{border:none;box-shadow:none}.bcm-list__autocomplete{width:100%;position:relative}.bcm-list.full-width .bcm-list__container,.bcm-list.full-width .bcm-list__input{width:100%}.bcm-list.error .bcm-list__input{border-color:var(--bcm-color-red-6)}.bcm-list.disabled .bcm-list__container,.bcm-list.disabled .bcm-list__input{color:var(--bcm-new-ds-color-slate-300);background-color:var(--bcm-new-ds-color-slate-50);cursor:not-allowed}.bcm-list.disabled .bcm-tag__content.dismissable .close-button{cursor:default}.bcm-list:not(.disabled) .bcm-list__input .bcm-tag__content.checked .close-button bcm-icon{color:var(--bcm-new-ds-color-slate-100)}.bcm-list:not(.disabled) .bcm-list__input .bcm-tag__content.checked .close-button:hover bcm-icon{color:var(--bcm-new-ds-color-slate-200)}.bcm-list:not(.disabled) .bcm-list__input:hover{border-color:var(--bcm-new-ds-color-blue-500)}.bcm-list:not(.disabled) .bcm-list__input:hover .bcm-tag__content.dismissable:not(.checked){background-color:var(--bcm-new-ds-color-slate-200);border-color:var(--bcm-new-ds-color-slate-200)}.bcm-list:not(.disabled) .bcm-list__input:focus-visible{border-color:var(--bcm-new-ds-color-blue-500);box-shadow:0 1px 3px 0 rgba(17, 24, 38, 0.1)}.bcm-list:not(.disabled) .bcm-list__input:active{border-color:var(--bcm-new-ds-color-blue-500)}.bcm-list__item{padding:2px 0}.bcm-list__item.disabled{user-select:none}.bcm-list__item:focus{outline:none}.bcm-list__item:focus-visible>.bcm-list__item-content{background-color:var(--bcm-new-ds-color-slate-300)}.bcm-list__item:focus-visible>.bcm-list__item-content:not(.disabled){color:var(--bcm-new-ds-color-slate-600)}.bcm-list__item-content{display:flex;flex-direction:row;align-items:stretch;justify-content:flex-start;flex-wrap:nowrap;cursor:pointer;border-radius:4px;padding:0;padding-left:4px;color:var(--bcm-new-ds-color-slate-600);background-color:var(--bcm-new-ds-color-slate-50);transition:background-color 0.2s ease}.bcm-list__item-content.disabled{color:var(--bcm-new-ds-color-slate-300);background-color:var(--bcm-new-ds-color-slate-50);user-select:none;cursor:not-allowed}.bcm-list__item-content.selected{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-new-ds-color-blue-500)}.bcm-list__item-content.selected:hover:not(.disabled){color:var(--bcm-new-ds-color-white);background-color:var(--bcm-new-ds-color-blue-600)}.bcm-list__item-content:hover:not(.disabled){color:var(--bcm-new-ds-color-slate-600);background-color:var(--bcm-new-ds-color-slate-100)}.bcm-list__item-content:active:not(.disabled){color:var(--bcm-new-ds-color-slate-600);background-color:var(--bcm-new-ds-color-slate-200)}.bcm-list__item-content-collapse-icon{width:16px;padding:0 8px;display:flex;align-items:center;justify-content:center;font-size:16px}.bcm-list__item-content-collapse-icon.child{cursor:pointer}.bcm-list__item-content-text{user-select:none;padding:8px;width:100%;display:flex;flex-direction:row;align-items:center;justify-content:flex-start}.bcm-list__item-content-text.treeview{padding:8px 0}.bcm-list__item-content-text-checkbox{display:flex;flex-direction:row;align-items:center;justify-content:center;flex-wrap:nowrap;margin-right:8px}.bcm-list__item-content-text-checkbox .bcm-checkbox{margin:0}.bcm-list__item-content-text-inner{width:100%}.bcm-list__item-content-text mark{padding:0;margin:0;font-size:inherit;color:var(--bcm-color-grey-8);background-color:var(--bcm-color-yellow-4)}.bcm-list__item-childs{padding-left:16px}.bcm-list__item-small{padding:2px 0 2px 8px;font-size:10px;line-height:calc(10px + 8px)}.bcm-list__item-small .bcm-list__item-content-text{padding:3px 4px}.bcm-list__item-medium{font-size:12px;line-height:calc(12px + 8px)}.bcm-list__item-medium .bcm-list__item-content-text{padding:6px 4px}.bcm-list__item-large{font-size:14px;line-height:calc(14px + 8px)}.bcm-list__item-large .bcm-list__item-content-text{padding:9px 4px}.bcm-list__item--readonly:focus>.bcm-list__item-content:not(.disabled),.bcm-list__item--readonly.focused>.bcm-list__item-content:not(.disabled){color:var(--bcm-color-grey-7)}.bcm-list__item--readonly>.bcm-list__item-content{color:var(--bcm-color-grey-7)}.bcm-list__item--readonly>.bcm-list__item-content:hover,.bcm-list__item--readonly>.bcm-list__item-content:focus{color:var(--bcm-color-grey-7)}.bcm-list__item--group{border-radius:4px}.bcm-list__item--group:focus>.bcm-list__item-content:not(.disabled){background-color:var(--bcm-new-ds-color-slate-50);color:var(--bcm-new-ds-color-slate-600)}.bcm-list__item--group>.bcm-list__item-content{background-color:var(--bcm-new-ds-color-slate-50);color:var(--bcm-new-ds-color-slate-600);border-radius:4px 4px 0 0;cursor:default;font-size:14px;line-height:calc(14px + 8px);font-weight:500;position:sticky;top:0}.bcm-list__item--group>.bcm-list__item-content>.bcm-list__item-content-text{padding:4px 8px 4px 16px}.bcm-list__item--group>.bcm-list__item-content:hover,.bcm-list__item--group>.bcm-list__item-content:focus{color:var(--bcm-new-ds-color-slate-800);background-color:var(--bcm-new-ds-color-slate-50)}.bcm-list__item--group>.bcm-list__item-content-unclickable:hover{color:var(--bcm-new-ds-color-slate-700);background-color:var(--bcm-new-ds-color-slate-50)}.bcm-list__item--group>.bcm-list__item-childs{background-color:var(--bcm-new-ds-color-slate-50);color:var(--bcm-new-ds-color-slate-600);padding-bottom:8px;border-radius:0 0 4px 4px;padding-left:8px}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content{background-color:var(--bcm-new-ds-color-white);color:var(--bcm-new-ds-color-slate-600)}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content:hover{background-color:var(--bcm-new-ds-color-slate-100)}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content:active{background-color:var(--bcm-new-ds-color-slate-200)}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content:focus-visible{background-color:var(--bcm-new-ds-color-slate-300)}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content.selected{background-color:var(--bcm-new-ds-color-blue-500);color:var(--bcm-new-ds-color-white)}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content.selected:hover{background-color:var(--bcm-new-ds-color-blue-600)}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content.selected:active{background-color:var(--bcm-new-ds-color-blue-700)}.bcm-list__linked{display:none}.bcm-list .bcm-tag--other .value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bcm-info-footer{text-align:right;padding:4px 8px;background-color:var(--bcm-new-ds-color-slate-100);color:var(--bcm-new-ds-color-slate-600);border-radius:0 0 4px 4px}";
848
-
849
- var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
850
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
851
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
852
- r = Reflect.decorate(decorators, target, key, desc);
853
- else
854
- for (var i = decorators.length - 1; i >= 0; i--)
855
- if (d = decorators[i])
856
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
857
- return c > 3 && r && Object.defineProperty(target, key, r), r;
858
- };
859
- const BcmList = class {
860
- constructor(hostRef) {
861
- index$1.registerInstance(this, hostRef);
862
- this.bcmChecklist = index$1.createEvent(this, "bcm-checklist", 7);
863
- this.bcmSelected = index$1.createEvent(this, "bcm-selected", 7);
864
- this.change = index$1.createEvent(this, "bcm-change", 7);
865
- this.open = index$1.createEvent(this, "bcm-open", 7);
866
- this.close = index$1.createEvent(this, "bcm-close", 7);
867
- this.debounce = null;
868
- this.debounceHandler = generate.Generate.debounceInput(() => this.listenResize(), 300, false);
869
- this._id = generate.Generate.UID();
870
- this.type = bcm.Bcm$1.ListType.listbox;
871
- this.treeview = false;
872
- this.checkboxes = false;
873
- this.searchable = false;
874
- this.value = null;
875
- this.inputText = undefined;
876
- this.name = undefined;
877
- this.label = undefined;
878
- this.size = bcm.Bcm$1.Size.medium;
879
- this.disabled = false;
880
- this.readonly = false;
881
- this.highlight = false;
882
- this.highlightText = undefined;
883
- this.required = false;
884
- this.hidden = false;
885
- this.fullWidth = false;
886
- this.height = "256px";
887
- this.maxHeight = "500px";
888
- this.minHeight = "150px";
889
- this.width = "256px";
890
- this.infoFooter = false;
891
- this.variableText = "item";
892
- this.template = undefined;
893
- this.allOpen = false;
894
- this.keyControl = false;
895
- this.checkAll = true;
896
- this.stopDeepClean = false;
897
- this.linkedComponent = undefined;
898
- this.isOpen = false;
899
- this.calculatedViewport = false;
900
- this.isSelectedOther = false;
901
- this.isHaveOtherTag = false;
902
- this.placeholder = "Choose an option";
903
- this.searchPlaceholder = "Search";
904
- this.searchIsOnlyChilds = false;
905
- this.minSearchLength = 2;
906
- this.clearable = false;
907
- this.caption = undefined;
908
- this.noCaption = false;
909
- this.captionType = bcm.Bcm$1.Status.default;
910
- this.captionError = undefined;
911
- this.emptyText = undefined;
912
- this.emptyIcon = "fad fa-folder-open";
913
- this.captionCache = undefined;
914
- this.captionTypeCache = undefined;
915
- this.tick = {};
916
- this.totalData = 0;
917
- this.totalRootData = 0;
918
- this.limit = 20;
919
- this.searchGetParents = undefined;
920
- this.searchResultLimit = 20;
921
- this.searchFound = null;
922
- this.returnFilterData = {};
923
- this.returnOtherData = {};
924
- this.options = {
925
- rootMargin: "30px",
926
- };
927
- this.tagContainerWidth = 0;
928
- this.selectAllItem = {
929
- id: "select-all",
930
- text: "Select All",
931
- value: "select-all",
932
- checked: false,
933
- disabled: false,
934
- icon: "",
935
- status: bcm.Bcm$1.Status.default,
936
- indeterminate: "uncheck",
937
- };
938
- this.placement = bcm.Bcm$1.Placement["bottom-start"];
939
- this.data = [];
940
- }
941
- connectedCallback() {
942
- if (this.height != "256px") {
943
- if (this.height.indexOf("px") > -1) {
944
- this.limit = Math.floor(+this.height.replace("px", "") / 10);
945
- }
946
- else {
947
- this.limit = Math.floor(+(window.innerHeight / 10));
948
- }
949
- this.searchResultLimit = this.limit;
950
- this.markForCheck();
951
- }
952
- const checkElementWithDom = document.querySelectorAll(`#bcm-list-${this._id}`);
953
- (checkElementWithDom === null || checkElementWithDom === void 0 ? void 0 : checkElementWithDom.length) > 1 && checkElementWithDom.forEach((item, index) => index > 0 && item.remove());
954
- }
955
- componentWillRender() {
956
- this.calculateLocation();
957
- }
958
- componentShouldUpdate(newVal, oldVal, propName) {
959
- if (Object.keys(this.getOptions()).indexOf(propName) > -1 && newVal !== oldVal) {
960
- this.updateOptions();
961
- }
962
- }
963
- get containerWidth() {
964
- var _a, _b;
965
- return (_b = (_a = this.el) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) === null || _b === void 0 ? void 0 : _b.width;
966
- }
967
- get tagCount() {
968
- return this.containerWidth > 0 ? Math.floor(+(this.containerWidth - 100) / 85) : 0;
969
- }
970
- get tagData() {
971
- return generate.snq(() => {
972
- var _a;
973
- return (_a = this.value) === null || _a === void 0 ? void 0 : _a.map(item => ({
974
- value: item.id,
975
- label: stringHelper.StringHelper.textLimitter(item.text, 7),
976
- text: item.tooltipMessage || item.tagTitle || item.text,
977
- }));
978
- }, []);
979
- }
980
- async componentDidLoad() {
981
- await this.initState();
982
- if (this.type == "select" || this.type == "autocomplete" || this.linkedComponent) {
983
- const list = this.el.querySelector(`#bcm-list-${this._id}`);
984
- if (list) {
985
- document.body.appendChild(list);
986
- }
987
- }
988
- }
989
- disconnectedCallback() {
990
- this.isOpen = false;
991
- if (this.stopDeepClean)
992
- return;
993
- listState.removeState(this._id);
994
- this.el.innerHTML = "";
995
- if (this.type == "select" || this.type == "autocomplete" || this.linkedComponent) {
996
- const list = document.querySelectorAll(`#bcm-list-${this._id}`);
997
- if (list === null || list === void 0 ? void 0 : list.length) {
998
- list.forEach(item => item.remove());
999
- this.el.remove();
1000
- }
1001
- }
1002
- }
1003
- watchId(_, oldVal) {
1004
- // console.info('Changed component id:', oldVal + ' -> ' + newVal);
1005
- listState.removeState(oldVal);
1006
- this.initState();
1007
- }
1008
- handleValueChange(newVal, oldVal) {
1009
- var _a;
1010
- if (generate.Generate.objectIsEmpty(this.returnFilterData)) {
1011
- this.handleIndeterminate(((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) || 0, this.totalData);
1012
- }
1013
- if (this.checkboxes) {
1014
- if (!validators.Validators.compareTwoArrayIsSame(newVal, oldVal)) {
1015
- this.bcmChecklist.emit(this.value);
1016
- this.change.emit(this.value);
1017
- }
1018
- }
1019
- else {
1020
- if ((newVal === null || newVal === void 0 ? void 0 : newVal.id) != (oldVal === null || oldVal === void 0 ? void 0 : oldVal.id)) {
1021
- this.change.emit(this.value);
1022
- }
1023
- }
1024
- }
1025
- watchReturnFilterData(newVal) {
1026
- var _a;
1027
- const { checkedItems, visibledItems } = newVal;
1028
- if (checkedItems && visibledItems) {
1029
- this.handleIndeterminate(checkedItems.length, visibledItems.length);
1030
- }
1031
- else {
1032
- this.handleIndeterminate(((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) || 0, this.totalData);
1033
- }
1034
- }
1035
- async handleOpen() {
1036
- if (this.isOpen) {
1037
- this.open.emit();
1038
- this.calculateLocation();
1039
- this.onSelectSearch();
1040
- }
1041
- else {
1042
- this.listScrollToTop();
1043
- this.close.emit();
1044
- await utils.delay(100);
1045
- this.unSelectOther();
1046
- }
1047
- }
1048
- listScrollToTop() {
1049
- const list = document.querySelector(`#bcm-list-${this._id}`);
1050
- if (list) {
1051
- list.querySelector(".scrolling").scrollTop = 0;
1052
- }
1053
- }
1054
- async dataChanged(newValue, oldValue) {
1055
- if (!validators.Validators.compareTwoArrayIsSame(newValue, oldValue)) {
1056
- await this.initState();
1057
- }
1058
- }
1059
- isIntersecting(e) {
1060
- const target = e === null || e === void 0 ? void 0 : e.target;
1061
- if (target && target.id === this._id) {
1062
- this.listenResize();
1063
- }
1064
- }
1065
- handleSlotItems(e) {
1066
- var _a;
1067
- if (((_a = e === null || e === void 0 ? void 0 : e.detail) === null || _a === void 0 ? void 0 : _a.length) > 0) {
1068
- this.data = e.detail;
1069
- }
1070
- }
1071
- handleChange(e) {
1072
- if (e.target.id == `bcm-list-input-tag-container-${this._id}-autocomplete-input`) {
1073
- e.stopImmediatePropagation();
1074
- }
1075
- }
1076
- handleResize() {
1077
- this.calculateLocation();
1078
- this.debounceHandler();
1079
- }
1080
- handleWheel(event) {
1081
- if (this.isOpen) {
1082
- const list = document.querySelector(`#bcm-list-${this._id}`);
1083
- const isClickInside = list && generate.Generate.findEventPath(event, list);
1084
- if (isClickInside) {
1085
- if (this.type == "select" || this.type == "autocomplete" || this.linkedComponent) {
1086
- this.calculateLocation();
1087
- }
1088
- }
1089
- else {
1090
- this.hide();
1091
- }
1092
- }
1093
- }
1094
- clearAutocomplete() {
1095
- if (this.type == "autocomplete") {
1096
- const autocompleteInput = this.getAutoCompleteInput();
1097
- if (autocompleteInput) {
1098
- autocompleteInput.handleClear(false);
1099
- }
1100
- }
1101
- }
1102
- async handleSelectOtherTag(e) {
1103
- if (this.disabled)
1104
- return;
1105
- const { id, checked } = e.detail;
1106
- this.isSelectedOther = checked;
1107
- if (id) {
1108
- checked ? this.filterOtherList(id) : this.unSelectOther();
1109
- this.isOpen = true;
1110
- }
1111
- }
1112
- async handleDeleteTag(e) {
1113
- var _a;
1114
- if (this.disabled)
1115
- return;
1116
- const { id } = e.detail;
1117
- this.isSelectedOther && this.unSelectOther();
1118
- Array.isArray(id) ? listState.removeOtherTags(this._id, id) : listState.checkedItem(this._id, id);
1119
- this.value = (await this.getCheckedList()).checkedList;
1120
- this.handleIndeterminate(((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) || 0, this.totalData);
1121
- }
1122
- async handleSelectTag(_) {
1123
- if (this.disabled)
1124
- return;
1125
- this.clearAutocomplete();
1126
- this.onSelectSearch();
1127
- this.unSelectOther();
1128
- }
1129
- handleClick(event) {
1130
- var _a;
1131
- if (this.disabled)
1132
- return;
1133
- const list = document.querySelector(`#bcm-list-${this._id}`);
1134
- const isClickInside = generate.Generate.findEventPath(event, this.el) || (list && generate.Generate.findEventPath(event, list));
1135
- if (isClickInside) {
1136
- if (this.debounce !== null) {
1137
- event.preventDefault();
1138
- event.stopPropagation();
1139
- clearTimeout(this.debounce);
1140
- this.debounce = null;
1141
- }
1142
- this.debounce = setTimeout(() => {
1143
- this.debounce = null;
1144
- }, 300);
1145
- }
1146
- if (!isClickInside) {
1147
- if (this.type == "autocomplete") {
1148
- const autocompleteInput = this.getAutoCompleteInput();
1149
- if (autocompleteInput) {
1150
- if (this.checkboxes) {
1151
- autocompleteInput.setValue("");
1152
- }
1153
- else {
1154
- autocompleteInput.setValue(((_a = this.value) === null || _a === void 0 ? void 0 : _a.text) || "");
1155
- }
1156
- }
1157
- }
1158
- }
1159
- const clickToTag = generate.Generate.findEventPathWithKey(event, "className", ["bcm-tag"]);
1160
- const clickToOtherTag = generate.Generate.findEventPathWithKey(event, "className", ["bcm-tag bcm-tag--other"]);
1161
- const clickToSelect = generate.Generate.findEventPathWithKey(event, "id", [`bcm-list-input-${this._id}`, `bcm-list-label-${this._id}`]);
1162
- const clickToTagDismiss = generate.Generate.findEventPathWithKey(event, "className", ["right close-button"]);
1163
- if (clickToSelect && !clickToTagDismiss && this.type != "autocomplete") {
1164
- this.isOpen = clickToTag || clickToOtherTag ? true : !this.isOpen;
1165
- }
1166
- if (list) {
1167
- if (this.isOpen) {
1168
- if (!list.contains(event.target) && !this.el.contains(event.target)) {
1169
- this.isOpen = false;
1170
- // this.unSelectOther()
1171
- }
1172
- }
1173
- }
1174
- }
1175
- bcmOnSearchClear(event) {
1176
- var _a, _b;
1177
- if (this.type == "autocomplete") {
1178
- 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`) {
1179
- if (event.detail) {
1180
- this.setClear();
1181
- }
1182
- }
1183
- }
1184
- }
1185
- bcmOnSearch(event) {
1186
- var _a, _b, _c, _d, _e, _f;
1187
- 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`) {
1188
- this.searchGetParents = generate.snq(() => { var _a; return (_a = event.detail) === null || _a === void 0 ? void 0 : _a.parentIndex; }, null);
1189
- this.searchResultLimit = 10;
1190
- 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;
1191
- this.returnFilterData = listState.filterData(this._id, (_e = event.detail) === null || _e === void 0 ? void 0 : _e.nestedResult);
1192
- if (this.searchFound > 0 && this.highlight) {
1193
- this.highlightText = (_f = event.detail) === null || _f === void 0 ? void 0 : _f.value;
1194
- }
1195
- if (this.type == "autocomplete") {
1196
- this.isOpen = true;
1197
- }
1198
- if (!event.detail.result) {
1199
- if (this.type == "autocomplete") {
1200
- this.isOpen = false;
1201
- }
1202
- else {
1203
- this.returnFilterData = {};
1204
- listState.filterData(this._id, null);
1205
- }
1206
- // this.isSelectedOther = false
1207
- this.searchResultLimit = null;
1208
- this.highlightText = null;
1209
- }
1210
- this.markForCheck();
1211
- }
1212
- }
1213
- //keyboard navigation
1214
- handleKeyDown(ev) {
1215
- const keycode = ev.keyCode || ev.which;
1216
- if (keycode === bcm.Bcm$1.KeyCode.escape) {
1217
- if (this.isOpen) {
1218
- this.isOpen = false;
1219
- ev.preventDefault();
1220
- ev.stopPropagation();
1221
- ev.stopImmediatePropagation();
1222
- }
1223
- }
1224
- if (this.keyControl) {
1225
- const keyboard = new ListKeyControl(keycode, this.el, this.treeview, this.checkboxes);
1226
- keyboard.openGroup = openGroupId => {
1227
- this.openGroup(openGroupId);
1228
- };
1229
- keyboard.checkedItem = checkedItemId => {
1230
- this.checkedItem(checkedItemId);
1231
- };
1232
- keyboard.keyDown();
1233
- }
1234
- }
1235
- handleKeyUp(ev) {
1236
- if (this.keyControl) {
1237
- const focusedList = generate.Generate.findEventPath(ev, this.el);
1238
- if (focusedList) {
1239
- const list = document.getElementById(`bcm-list-${this._id}`);
1240
- if (list) {
1241
- const items = list.querySelectorAll(".bcm-list__item.focused");
1242
- if (items.length > 0) {
1243
- const main = list.querySelector("main");
1244
- const itemHeight = items[0].offsetHeight;
1245
- const listHeight = main.offsetHeight;
1246
- const itemTop = items[0].offsetTop;
1247
- if (itemTop > listHeight) {
1248
- main.scrollTop = itemTop - listHeight / 2 + itemHeight / 2;
1249
- }
1250
- if (itemTop < listHeight) {
1251
- main.scrollTop = itemTop - listHeight / 2 - itemHeight / 2;
1252
- }
1253
- }
1254
- }
1255
- }
1256
- }
1257
- }
1258
- async set(data) {
1259
- if (data) {
1260
- if (Array.isArray(data)) {
1261
- this.addChecked(data);
1262
- }
1263
- if (typeof data === "string" || typeof data === "number") {
1264
- this.selectedItem(data);
1265
- }
1266
- }
1267
- else {
1268
- this.setClear();
1269
- }
1270
- }
1271
- async get() {
1272
- var _a, _b;
1273
- 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;
1274
- }
1275
- async getCheckedList() {
1276
- return Promise.resolve(listState.getCheckedList(this._id));
1277
- }
1278
- async getSelected() {
1279
- return Promise.resolve(listState.getSelected(this._id));
1280
- }
1281
- async getValue() {
1282
- return Promise.resolve(this.value);
1283
- }
1284
- async addChecked(ids = [], save = false, emit = true) {
1285
- if (ids && ids.length > 0) {
1286
- if (!save) {
1287
- listState.setClear(this._id);
1288
- await utils.delay(10);
1289
- }
1290
- await listState.addChecked(this._id, ids);
1291
- await utils.delay(10);
1292
- emit && (this.value = (await this.getCheckedList()).checkedList);
1293
- this.markForCheck();
1294
- }
1295
- return Promise.resolve(this.value);
1296
- }
1297
- async selected(id) {
1298
- if (id) {
1299
- return Promise.resolve(await this.selectedItem(id));
1300
- }
1301
- return false;
1302
- }
1303
- async setClear(e) {
1304
- listState.setClear(this._id);
1305
- this.value = null;
1306
- this.inputText = "";
1307
- this.isOpen = false;
1308
- this.selectAllItem.indeterminate = "uncheck";
1309
- this.markForCheck();
1310
- if (e) {
1311
- e.stopPropagation();
1312
- e.preventDefault();
1313
- }
1314
- await utils.delay(10);
1315
- return Promise.resolve();
1316
- }
1317
- async resetCaption() {
1318
- await utils.delay(10);
1319
- this.caption = this.captionCache;
1320
- this.captionType = this.captionTypeCache;
1321
- this.captionError = null;
1322
- await utils.delay(10);
1323
- return Promise.resolve();
1324
- }
1325
- async show() {
1326
- this.isOpen = true;
1327
- return Promise.resolve();
1328
- }
1329
- async hide() {
1330
- this.isOpen = false;
1331
- return Promise.resolve();
1332
- }
1333
- updateOptions() {
1334
- listState.updateOptions(this._id, this);
1335
- }
1336
- handleIndeterminate(checkeds, total) {
1337
- 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 });
1338
- }
1339
- listenResize() {
1340
- this.calculateLocation();
1341
- this.markForCheck();
1342
- }
1343
- async unSelectOther() {
1344
- await this.onClearSearch();
1345
- this.isSelectedOther = false;
1346
- this.searchFound = null;
1347
- this.returnFilterData = {};
1348
- listState.filterData(this._id, null);
1349
- await utils.delay(10);
1350
- return Promise.resolve();
1351
- }
1352
- async onClearSearch() {
1353
- const searchInput = document.getElementById(`bcm-list-${this._id}-search`);
1354
- if (searchInput) {
1355
- await searchInput.handleClear();
1356
- }
1357
- return Promise.resolve();
1358
- }
1359
- async onSelectSearch() {
1360
- const searchInput = document.getElementById(`bcm-list-${this._id}-search`);
1361
- if (searchInput) {
1362
- await utils.delay(100);
1363
- searchInput.onBcmFocus();
1364
- searchInput.onBcmSelect();
1365
- }
1366
- }
1367
- async filterOtherList(ids) {
1368
- const checklist = (await this.getCheckedList()).nestedResult;
1369
- const filter = generate.Generate.convertIdsToNestedData(ids, checklist);
1370
- this.returnFilterData = await listState.filterData(this._id, filter, null, true);
1371
- this.searchFound = (ids === null || ids === void 0 ? void 0 : ids.length) || 0;
1372
- this.limit = 500;
1373
- this.searchGetParents = null;
1374
- await utils.delay(1000);
1375
- this.markForCheck();
1376
- }
1377
- async initState() {
1378
- var _a, _b, _c;
1379
- this.onClearSearch();
1380
- await listState.setValue({
1381
- id: this._id,
1382
- dataSource: this.data && generate.snq(() => (typeof this.data == "string" ? JSON.parse(this.data) : this.data), []),
1383
- options: this,
1384
- });
1385
- const { totalRoots, totalItems } = listState.getValue(this._id);
1386
- this.totalData = totalItems;
1387
- this.totalRootData = totalRoots;
1388
- this.value = this.checkboxes ? (await this.getCheckedList()).checkedList : listState.selectedItem(this._id) ? listState.selectedItem(this._id)[0] : null;
1389
- if (!this.checkboxes) {
1390
- this.inputText = ((_a = this.value) === null || _a === void 0 ? void 0 : _a.text) || null;
1391
- }
1392
- // checkli olan subparentların indeterminate kontrolü için
1393
- if (this.checkboxes && ((_b = this.value) === null || _b === void 0 ? void 0 : _b.length) > 0) {
1394
- const checkedIDs = [];
1395
- this.value.forEach(item => {
1396
- if (!item.items || item.items.length === 0) {
1397
- checkedIDs.push(item.id);
1398
- }
1399
- });
1400
- await this.addChecked(checkedIDs, false, false);
1401
- }
1402
- await this.handleIndeterminate((_c = this.value) === null || _c === void 0 ? void 0 : _c.length, this.totalData);
1403
- await this.markForCheck();
1404
- }
1405
- async markForCheck() {
1406
- await utils.delay(10);
1407
- this.tick = generate.Generate.UID();
1408
- }
1409
- getOptions() {
1410
- return generate.snq(() => listState.getValue(this._id).options, {});
1411
- }
1412
- getItems() {
1413
- if (this.isSelectedOther) {
1414
- return this.returnFilterData["checkedItems"];
1415
- }
1416
- return generate.snq(() => listState.getData(this._id), []);
1417
- }
1418
- getLimitedItems(ids) {
1419
- return generate.snq(() => listState.getDataPagination(this._id, this.searchResultLimit || this.limit, ids), []);
1420
- }
1421
- openGroup(parentId) {
1422
- listState.openGroup(this._id, parentId);
1423
- this.markForCheck();
1424
- }
1425
- focusItem(e) {
1426
- if (e.target.classList.contains("bcm-list__item")) {
1427
- const item = e.target;
1428
- const list = document.getElementById(`bcm-list-${this._id}`);
1429
- if (list) {
1430
- const items = list.querySelectorAll(".bcm-list__item");
1431
- if (items.length > 0) {
1432
- const selectedItem = list.querySelector(".bcm-list__item.focused");
1433
- if (selectedItem) {
1434
- selectedItem.classList.remove("focused");
1435
- }
1436
- item.classList.add("focused");
1437
- }
1438
- }
1439
- }
1440
- }
1441
- async selectedItem(itemId) {
1442
- var _a;
1443
- if (!this.checkboxes) {
1444
- this.value = listState.selectedItem(this._id, itemId) ? listState.selectedItem(this._id, itemId)[0] : null;
1445
- this.inputText = ((_a = this.value) === null || _a === void 0 ? void 0 : _a.text) || null;
1446
- this.isOpen = false;
1447
- this.markForCheck();
1448
- if (this.type == "autocomplete" && this.value) {
1449
- // await delay(100)
1450
- // this.resetCaption()
1451
- const autocompleteInput = this.getAutoCompleteInput();
1452
- if (autocompleteInput) {
1453
- setTimeout(() => {
1454
- var _a;
1455
- autocompleteInput.setValue(((_a = this.value) === null || _a === void 0 ? void 0 : _a.text) || "");
1456
- this.isOpen = false;
1457
- }, 100);
1458
- }
1459
- }
1460
- }
1461
- return Promise.resolve(this.value);
1462
- }
1463
- async checkedItem(itemId) {
1464
- const isCheckSelectAll = itemId === "select-all";
1465
- if (!isCheckSelectAll) {
1466
- listState.checkedItem(this._id, itemId);
1467
- }
1468
- else {
1469
- listState.selectAll(this._id, !this.selectAllItem.checked);
1470
- }
1471
- this.value = (await this.getCheckedList()).checkedList;
1472
- this.changeVisibleCheckeds();
1473
- this.markForCheck();
1474
- }
1475
- changeVisibleCheckeds() {
1476
- const { visibledItems } = this.returnFilterData;
1477
- this.returnFilterData = {
1478
- visibledItems,
1479
- checkedItems: (visibledItems && visibledItems.filter(item => item.checked)) || [],
1480
- };
1481
- }
1482
- getAutoCompleteInput() {
1483
- return document.getElementById(`bcm-list-input-tag-container-${this._id}-autocomplete-input`);
1484
- }
1485
- dataScrollEvent(event) {
1486
- let count = 0;
1487
- let io = new IntersectionObserver((data) => {
1488
- if (count === 0) {
1489
- count++;
1490
- if (data[0].isIntersecting) {
1491
- this.limit += 15;
1492
- this.searchResultLimit += 15;
1493
- io.disconnect();
1494
- io = null;
1495
- }
1496
- }
1497
- }, this.options);
1498
- io.observe(event.target.lastElementChild);
1499
- }
1500
- async calculateLocation() {
1501
- var _a, _b;
1502
- if (this.type == "select" || this.type == "autocomplete" || this.linkedComponent) {
1503
- const list = document.getElementById(`bcm-list-${this._id}`);
1504
- // list && (list.style.height = '256px') //sebebi neydi ki!
1505
- var placement = this.placement;
1506
- const targetElementId = this.linkedComponent ? this.linkedComponent : `bcm-list-input-${this._id}`;
1507
- const targetElement = document.getElementById(targetElementId);
1508
- if (list && targetElement) {
1509
- popoverPlacement.getPlacement(list, targetElement, placement, (place) => (placement = place));
1510
- await utils.delay(10);
1511
- let pos = popoverPlacement.setPosition(placement, targetElement);
1512
- let captionAreaHeight = 0;
1513
- let labelAreaHeight = 0;
1514
- if (this.linkedComponent) {
1515
- const linked = document.getElementById(this.linkedComponent);
1516
- if (linked) {
1517
- if (!linked["noCaption"]) {
1518
- const captionArea = ((_a = linked.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".bcm-caption-area")) || linked.querySelector(".bcm-caption-area");
1519
- if (captionArea) {
1520
- captionAreaHeight = captionArea.offsetHeight || captionArea.clientHeight;
1521
- }
1522
- }
1523
- const labelArea = ((_b = linked.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector(".bcm-label")) || linked.querySelector(".bcm-label");
1524
- if (labelArea) {
1525
- labelAreaHeight = labelArea.offsetHeight || labelArea.clientHeight;
1526
- }
1527
- }
1528
- }
1529
- if (this.fullWidth) {
1530
- list.style.width = targetElement.offsetWidth + "px";
1531
- }
1532
- else {
1533
- list.style.width = this.width || "auto";
1534
- }
1535
- if (this.height.indexOf("%") > -1) {
1536
- list.style.height = numberHelper.NumberHelper.toNumber(this.height) * 0.01 * window.innerHeight - pos[0] - 50 + "px";
1537
- }
1538
- else {
1539
- list.style.height = this.height;
1540
- }
1541
- list.style.minHeight = this.minHeight;
1542
- // const calculatedMaxHeight = window.innerHeight - pos[0] - 50;
1543
- const calculatedMaxHeight = placement.split("-")[0] == "top" ? window.innerHeight - (window.innerHeight - pos[0]) - 50 : window.innerHeight - pos[0] - 50;
1544
- if (this.maxHeight.indexOf("%") > -1) {
1545
- list.style.maxHeight = numberHelper.NumberHelper.toNumber(this.maxHeight) * 0.01 * calculatedMaxHeight + "px";
1546
- }
1547
- else {
1548
- list.style.maxHeight = numberHelper.NumberHelper.toNumber(this.maxHeight) < calculatedMaxHeight ? this.maxHeight : calculatedMaxHeight + "px";
1549
- }
1550
- popoverPlacement.getPlacement(list, targetElement, placement, (place) => (placement = place));
1551
- await utils.delay(10);
1552
- pos = popoverPlacement.setPosition(placement, targetElement);
1553
- list.style.top = (placement.split("-")[0] == "top" ? pos[0] - list.offsetHeight + labelAreaHeight : pos[0] - captionAreaHeight) + "px";
1554
- // list.style.left = pos[1] + 'px';
1555
- list.style.left = placement.split("-")[1] == "end" ? pos[1] - list.offsetWidth + "px" : pos[1] + "px";
1556
- list.classList.toggle("bcm-list--top", placement.split("-")[0] == "top");
1557
- this.calculatedViewport = true;
1558
- }
1559
- }
1560
- }
1561
- render() {
1562
- const { checkboxes, treeview, label, size, disabled, readonly, required, hidden, fullWidth, searchable } = this.getOptions();
1563
- const hostClasses = index.classnames("bcm-list", `bcm-list__size-${size}`, `bcm-list__${this.type}`, size === "large" ? "size-3" : "size-2", {
1564
- "error": this.captionType == bcm.Bcm$1.Status.error,
1565
- "full-width": fullWidth,
1566
- "bcm-list__linked": this.linkedComponent,
1567
- hidden,
1568
- readonly,
1569
- disabled,
1570
- });
1571
- const bcmListContainer = index.classnames("bcm-list__container", this.linkedComponent ? "bcm-list__type-linked-component" : `bcm-list__type-${this.type}`, {
1572
- "is-open": this.isOpen && this.calculatedViewport,
1573
- "error": this.captionType == bcm.Bcm$1.Status.error,
1574
- "full-width": fullWidth,
1575
- hidden,
1576
- readonly,
1577
- disabled,
1578
- });
1579
- const bcmListInput = index.classnames("bcm-list__input");
1580
- const openedType = this.type == "select" || this.type == "autocomplete" || this.linkedComponent;
1581
- return (index$1.h(index$1.Host, { class: hostClasses, tabindex: "0", style: {
1582
- "--width": fullWidth ? "100%" : this.width,
1583
- "--height": openedType ? "100%" : this.height,
1584
- "--max-height": openedType ? "inherit" : this.maxHeight,
1585
- "--min-height": openedType ? "inherit" : this.minHeight,
1586
- } }, index$1.h("div", { id: `bcm-list-label-${this._id}`, class: "bcm-list__label" }, label && (index$1.h("div", null, index$1.h(labelTemplate.LabelTemplate, { 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", {
1587
- disabled: disabled,
1588
- }) }, 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, checkAll: this.checkAll, data: this.getItems(), width: this.width, height: this.height, size: this.size, selectAllItem: this.selectAllItem, onScrollEvent: e => this.dataScrollEvent(e), items: this.getLimitedItems(this.searchGetParents), selectedItem: itemId => this.selectedItem(itemId), checkedItem: itemId => this.checkedItem(itemId), openGroup: parentId => this.openGroup(parentId), focusItem: itemId => this.focusItem(itemId), emptyText: this.emptyText, emptyIcon: this.emptyIcon }), index$1.h(captionTemplate.CaptionTemplate, { noCaption: this.noCaption, captionType: this.captionType, captionError: this.captionError, caption: this.caption })));
1589
- }
1590
- get el() { return index$1.getElement(this); }
1591
- static get watchers() { return {
1592
- "_id": ["watchId"],
1593
- "value": ["handleValueChange"],
1594
- "returnFilterData": ["watchReturnFilterData"],
1595
- "isOpen": ["handleOpen"],
1596
- "data": ["dataChanged"]
1597
- }; }
1598
- };
1599
- __decorate([
1600
- isLoadDecorator.IsLoad()
1601
- ], BcmList.prototype, "el", void 0);
1602
- __decorate([
1603
- jsonParseDecarator.JsonParse("data", true)
1604
- ], BcmList.prototype, "dataChanged", null);
1605
- BcmList.style = listCss;
1606
-
1607
- exports.bcm_list = BcmList;