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,1521 +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 generate = require('./generate-21143214.js');
11
- const bcm = require('./bcm-634604e3.js');
12
- const index$2 = require('./index-fdbf5226.js');
13
- const index = require('./index-4506fcd7.js');
14
- const slotTemplate = require('./slot-template-3e59d7d8.js');
15
- const colorHelper = require('./color-helper-d6d2028b.js');
16
- const captionTemplate = require('./caption-template-8d099fd6.js');
17
- const utils = require('./utils-fc077139.js');
18
- const isLoadDecorator = require('./is-load-decorator-137dded1.js');
19
- const labelTemplate = require('./label-template-cc69bc21.js');
20
- const stringHelper = require('./string-helper-45cffee0.js');
21
- require('./datetime-helper-eaf4fadb.js');
22
- require('./number-helper-08a7ff70.js');
23
- require('./validators-6a0077a8.js');
24
- const tooltipHelper = require('./tooltip-helper-2e8b879b.js');
25
- require('./element-dragger-a8562f82.js');
26
- require('./colors-e1d142ad.js');
27
- require('./_commonjsHelpers-bd20f4c0.js');
28
- require('./colors-56282b00.js');
29
- require('./floating-ui-74eb26d6.js');
30
-
31
- const variantOptions = {
32
- save: {
33
- text: 'Save',
34
- color: 'emerald',
35
- icon: 'far fa-save',
36
- iconPosition: 'prefix',
37
- },
38
- ok: {
39
- text: 'Ok',
40
- color: 'emerald',
41
- icon: 'far fa-check',
42
- iconPosition: 'prefix',
43
- },
44
- new: {
45
- text: 'New',
46
- color: 'emerald',
47
- icon: 'far fa-plus',
48
- iconPosition: 'prefix',
49
- },
50
- add: {
51
- text: 'Add',
52
- color: 'emerald',
53
- icon: 'far fa-plus',
54
- iconPosition: 'prefix',
55
- },
56
- create: {
57
- text: 'Create',
58
- color: 'emerald',
59
- icon: 'far fa-plus',
60
- iconPosition: 'prefix',
61
- },
62
- prev: {
63
- text: 'Prev',
64
- color: '',
65
- icon: 'far fa-arrow-left',
66
- iconPosition: 'prefix',
67
- },
68
- next: {
69
- text: 'Next',
70
- color: '',
71
- icon: 'far fa-arrow-right',
72
- iconPosition: 'suffix',
73
- },
74
- apply: {
75
- text: 'Apply',
76
- color: '',
77
- icon: 'far fa-check-circle',
78
- iconPosition: 'prefix',
79
- },
80
- submit: {
81
- text: 'Submit',
82
- color: '',
83
- icon: 'far fa-save',
84
- iconPosition: 'prefix',
85
- },
86
- send: {
87
- text: 'Send',
88
- color: 'emerald',
89
- icon: 'far fa-paper-plane',
90
- iconPosition: 'prefix',
91
- },
92
- delete: {
93
- text: 'Delete',
94
- color: 'red',
95
- icon: 'far fa-trash',
96
- iconPosition: 'prefix',
97
- },
98
- cancel: {
99
- text: 'Cancel',
100
- color: 'red',
101
- icon: 'far fa-times',
102
- iconPosition: 'prefix',
103
- },
104
- decline: {
105
- text: 'Decline',
106
- color: 'red',
107
- icon: 'far fa-ban',
108
- iconPosition: 'prefix',
109
- },
110
- close: {
111
- text: 'Close',
112
- color: 'red',
113
- icon: 'far fa-times-circle',
114
- iconPosition: 'prefix',
115
- },
116
- archive: {
117
- text: 'Archive',
118
- color: 'red',
119
- icon: 'far fa-folder-open',
120
- iconPosition: 'prefix',
121
- },
122
- remove: {
123
- text: 'Remove',
124
- color: 'red',
125
- icon: 'far fa-minus-circle',
126
- iconPosition: 'prefix',
127
- },
128
- edit: {
129
- text: 'Edit',
130
- color: '',
131
- icon: 'far fa-edit',
132
- iconPosition: 'prefix',
133
- },
134
- export: {
135
- text: 'Export',
136
- color: '',
137
- icon: 'far fa-sign-out',
138
- iconPosition: 'prefix',
139
- },
140
- import: {
141
- text: 'Import',
142
- color: '',
143
- icon: 'far fa-sign-in',
144
- iconPosition: 'prefix',
145
- },
146
- filter: {
147
- text: 'Filter',
148
- color: '',
149
- icon: 'far fa-filter',
150
- iconPosition: 'prefix',
151
- },
152
- update: {
153
- text: 'Update',
154
- color: '',
155
- icon: 'far fa-sync',
156
- iconPosition: 'prefix',
157
- },
158
- reset: {
159
- text: "Reset",
160
- color: "",
161
- icon: 'far fa-sync',
162
- iconPosition: "prefix",
163
- },
164
- download: {
165
- text: 'Download',
166
- color: '',
167
- icon: 'far fa-download',
168
- iconPosition: 'prefix',
169
- },
170
- };
171
- var VariantProps;
172
- (function (VariantProps) {
173
- VariantProps["save"] = "save";
174
- VariantProps["submit"] = "submit";
175
- VariantProps["ok"] = "ok";
176
- VariantProps["new"] = "new";
177
- VariantProps["add"] = "add";
178
- VariantProps["create"] = "create";
179
- VariantProps["apply"] = "apply";
180
- VariantProps["prev"] = "prev";
181
- VariantProps["next"] = "next";
182
- VariantProps["send"] = "send";
183
- VariantProps["delete"] = "delete";
184
- VariantProps["cancel"] = "cancel";
185
- VariantProps["decline"] = "decline";
186
- VariantProps["close"] = "close";
187
- VariantProps["archive"] = "archive";
188
- VariantProps["remove"] = "remove";
189
- VariantProps["edit"] = "edit";
190
- VariantProps["export"] = "export";
191
- VariantProps["import"] = "import";
192
- VariantProps["filter"] = "filter";
193
- VariantProps["update"] = "update";
194
- VariantProps["reset"] = "Reset";
195
- VariantProps["download"] = "download";
196
- })(VariantProps || (VariantProps = {}));
197
-
198
- const { state: state$1 } = index.createStore({
199
- value: new Map(),
200
- setData: {},
201
- removeData: {}
202
- });
203
- const setValue$1 = (val) => {
204
- const data = Object.assign(Object.assign({}, val), (variantOptions[val.variant] && {
205
- icon: variantOptions[val.variant].icon,
206
- value: variantOptions[val.variant].text,
207
- iconPosition: bcm.Bcm.IconPosition[variantOptions[val.variant].iconPosition],
208
- variantColor: variantOptions[val.variant].color
209
- }));
210
- state$1.value.set(data.id, data);
211
- };
212
- const removeValue = (_id) => {
213
- state$1.value.delete(_id);
214
- };
215
- const getValue$1 = (id) => generate.snq(() => state$1.value.get(id), {});
216
- const buttonState = {
217
- setValue: setValue$1,
218
- removeValue,
219
- getValue: getValue$1
220
- };
221
-
222
- const ButtonTemplate = ({ value, type, componentClass, disabled, href, target, loading, isIconOnly, icon, iconPosition, id }) => {
223
- const ButtonTagType = (href) ? bcm.Bcm.HtmlElementType.a : bcm.Bcm.HtmlElementType.button;
224
- return (index$1.h(ButtonTagType, Object.assign({ id: id }, (type == bcm.Bcm.HtmlElementType.button && { type }), { class: componentClass, disabled: disabled, href: href, target: target, tabindex: "0" }),
225
- index$1.h("span", { hidden: true },
226
- index$1.h("slot", null)),
227
- loading && index$1.h("span", { class: "bcm-button__container-loading" },
228
- " ",
229
- index$1.h("span", { class: "bcm-button__container-icon" },
230
- index$1.h("i", { class: "far fa-spinner-third fa-spin" }),
231
- " ")),
232
- icon && index$1.h("span", { class: `${iconPosition} bcm-button__container-icon` },
233
- index$1.h("i", { class: `${icon}` })),
234
- !isIconOnly && (index$1.h(slotTemplate.SlotTemplate, { className: "bcm-button__container-text", value: value })),
235
- index$1.h("slot", { name: "suffix" })));
236
- };
237
-
238
- const buttonCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");@import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap\"); .size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}*{box-sizing:border-box}.bcm-button{display:inline-flex;width:fit-content;height:fit-content;--bcm-button-solid-color-default:var(--bcm-new-ds-color-white);--bcm-button-solid-background-color-default:var(--bcm-new-ds-color-blue-500);--bcm-button-solid-border-default:var(--bcm-new-ds-color-blue-500);--bcm-button-solid-color-hover:var(--bcm-new-ds-color-white);--bcm-button-solid-background-color-hover:var(--bcm-new-ds-color-blue-600);--bcm-button-solid-border-hover:var(--bcm-new-ds-color-blue-600);--bcm-button-solid-color-focus-visible:var(--bcm-new-ds-color-white);--bcm-button-solid-background-color-focus-visible:var(--bcm-new-ds-color-blue-800);--bcm-button-solid-border-focus-visible:var(--bcm-new-ds-color-blue-800);--bcm-button-solid-color-active:var(--bcm-new-ds-color-white);--bcm-button-solid-background-color-active:var(--bcm-new-ds-color-blue-700);--bcm-button-solid-border-active:var(--bcm-new-ds-color-blue-700);--bcm-button-solid-color-disabled:var(--bcm-new-ds-color-white);--bcm-button-solid-background-color-disabled:var(--bcm-new-ds-color-slate-400);--bcm-button-solid-border-disabled:var(--bcm-new-ds-color-slate-400);--bcm-button-ghost-color-default:var(--bcm-new-ds-color-slate-600);--bcm-button-ghost-background-color-default:var(--bcm-new-ds-color-slate-100);--bcm-button-ghost-border-default:var(--bcm-new-ds-color-slate-300);--bcm-button-ghost-color-hover:var(--bcm-new-ds-color-slate-600);--bcm-button-ghost-background-color-hover:var(--bcm-new-ds-color-slate-200);--bcm-button-ghost-border-hover:var(--bcm-new-ds-color-slate-400);--bcm-button-ghost-color-focus-visible:var(--bcm-new-ds-color-slate-600);--bcm-button-ghost-background-color-focus-visible:var(--bcm-new-ds-color-slate-400);--bcm-button-ghost-border-focus-visible:var(--bcm-new-ds-color-slate-600);--bcm-button-ghost-color-active:var(--bcm-new-ds-color-slate-600);--bcm-button-ghost-background-color-active:var(--bcm-new-ds-color-slate-300);--bcm-button-ghost-border-active:var(--bcm-new-ds-color-slate-500);--bcm-button-ghost-color-disabled:var(--bcm-new-ds-color-slate-300);--bcm-button-ghost-background-color-disabled:var(--bcm-new-ds-color-slate-50);--bcm-button-ghost-border-disabled:var(--bcm-new-ds-color-slate-200);--bcm-button-link-color-default:var(--bcm-new-ds-color-blue-500);--bcm-button-link-background-color-default:var(--bcm-new-ds-color-transparent);--bcm-button-link-border-default:var(--bcm-new-ds-color-transparent);--bcm-button-link-color-hover:var(--bcm-new-ds-color-blue-600);--bcm-button-link-background-color-hover:var(--bcm-new-ds-color-transparent);--bcm-button-link-border-hover:var(--bcm-new-ds-color-transparent);--bcm-button-link-color-focus-visible:var(--bcm-new-ds-color-blue-800);--bcm-button-link-background-color-focus-visible:var(--bcm-new-ds-color-slate-50);--bcm-button-link-border-focus-visible:var(--bcm-new-ds-color-slate-50);--bcm-button-link-color-active:var(--bcm-new-ds-color-blue-700);--bcm-button-link-background-color-active:var(--bcm-new-ds-color-slate-50);--bcm-button-link-border-active:var(--bcm-new-ds-color-slate-50);--bcm-button-link-color-disabled:var(--bcm-new-ds-color-slate-400);--bcm-button-link-background-color-disabled:var(--bcm-new-ds-color-transparent);--bcm-button-link-border-disabled:var(--bcm-new-ds-color-transparent)}.bcm-button.full-width{width:100%}.bcm-button.full-width .bcm-button__container{width:100%}.bcm-button:after,.bcm-button:before{content:\"\";clear:both}.bcm-button__container{border:none;color:inherit;background-color:inherit;padding:0;margin:0;font:inherit;cursor:pointer;outline:none;text-decoration:none;font-family:\"Inter\", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;font-weight:500;display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:4px 12px;outline:none;border-radius:4px;transition:background-color 0.1s ease-in-out;position:relative;min-width:40px;border-width:1px;border-style:solid;border-color:initial}.bcm-button__container:hover,.bcm-button__container:focus,.bcm-button__container:active{outline:none;text-decoration:none}.bcm-button__container-loading{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:4px;display:flex;align-items:center;justify-content:center}.bcm-button__container-kind-solid{color:var(--bcm-button-solid-color-default);background-color:var(--bcm-button-solid-background-color-default);border-color:var(--bcm-button-solid-border-default)}.bcm-button__container-kind-solid:hover{color:var(--bcm-button-solid-color-hover);background-color:var(--bcm-button-solid-background-color-hover);border-color:var(--bcm-button-solid-border-hover)}.bcm-button__container-kind-solid:focus-visible{color:var(--bcm-button-solid-color-focus-visible);background-color:var(--bcm-button-solid-background-color-focus-visible);border-color:var(--bcm-button-solid-border-focus-visible)}.bcm-button__container-kind-solid:active{color:var(--bcm-button-solid-color-active);background-color:var(--bcm-button-solid-background-color-active);border-color:var(--bcm-button-solid-border-active)}.bcm-button__container-kind-solid:disabled{color:var(--bcm-button-solid-color-disabled);background-color:var(--bcm-button-solid-background-color-disabled);border-color:var(--bcm-button-solid-border-disabled)}.bcm-button__container-kind-solid.checked{color:var(--bcm-button-solid-color-active);background-color:var(--bcm-button-solid-background-color-active);border-color:var(--bcm-button-solid-border-active)}.bcm-button__container-kind-solid.disabled{color:var(--bcm-button-solid-color-disabled);background-color:var(--bcm-button-solid-background-color-disabled);border-color:var(--bcm-button-solid-border-disabled)}.bcm-button__container-kind-solid .bcm-button__container-loading{color:var(--bcm-button-solid-color-default);background-color:var(--bcm-button-solid-background-color-default);border-color:var(--bcm-button-solid-border-default)}.bcm-button__container-kind-ghost{color:var(--bcm-button-ghost-color-default);background-color:var(--bcm-button-ghost-background-color-default);border-color:var(--bcm-button-ghost-border-default)}.bcm-button__container-kind-ghost:not([disabled]) .bcm-icon{color:var(--bcm-new-ds-color-slate-500)}.bcm-button__container-kind-ghost:hover{color:var(--bcm-button-ghost-color-hover);background-color:var(--bcm-button-ghost-background-color-hover);border-color:var(--bcm-button-ghost-border-hover)}.bcm-button__container-kind-ghost:focus-visible{color:var(--bcm-button-ghost-color-focus-visible);background-color:var(--bcm-button-ghost-background-color-focus-visible);border-color:var(--bcm-button-ghost-border-focus-visible)}.bcm-button__container-kind-ghost:active{color:var(--bcm-button-ghost-color-active);background-color:var(--bcm-button-ghost-background-color-active);border-color:var(--bcm-button-ghost-border-active)}.bcm-button__container-kind-ghost:disabled{color:var(--bcm-button-ghost-color-disabled);background-color:var(--bcm-button-ghost-background-color-disabled);border-color:var(--bcm-button-ghost-border-disabled)}.bcm-button__container-kind-ghost.checked{color:var(--bcm-button-ghost-color-active);background-color:var(--bcm-button-ghost-background-color-active);border-color:var(--bcm-button-ghost-border-active)}.bcm-button__container-kind-ghost.disabled{color:var(--bcm-button-ghost-color-disabled);background-color:var(--bcm-button-ghost-background-color-disabled);border-color:var(--bcm-button-ghost-border-disabled)}.bcm-button__container-kind-ghost .bcm-button__container-loading{color:var(--bcm-button-ghost-color-default);background-color:var(--bcm-button-ghost-background-color-default);border-color:var(--bcm-button-ghost-border-default)}.bcm-button__container-kind-link{color:var(--bcm-button-link-color-default);background-color:var(--bcm-button-link-background-color-default);border-color:var(--bcm-button-link-border-default)}.bcm-button__container-kind-link:hover{color:var(--bcm-button-link-color-hover);background-color:var(--bcm-button-link-background-color-hover);border-color:var(--bcm-button-link-border-hover)}.bcm-button__container-kind-link:focus-visible{color:var(--bcm-button-link-color-focus-visible);background-color:var(--bcm-button-link-background-color-focus-visible);border-color:var(--bcm-button-link-border-focus-visible)}.bcm-button__container-kind-link:active{color:var(--bcm-button-link-color-active);background-color:var(--bcm-button-link-background-color-active);border-color:var(--bcm-button-link-border-active)}.bcm-button__container-kind-link:disabled{color:var(--bcm-button-link-color-disabled);background-color:var(--bcm-button-link-background-color-disabled);border-color:var(--bcm-button-link-border-disabled)}.bcm-button__container-kind-link.checked{color:var(--bcm-button-link-color-active);background-color:var(--bcm-button-link-background-color-active);border-color:var(--bcm-button-link-border-active)}.bcm-button__container-kind-link.disabled{color:var(--bcm-button-link-color-disabled);background-color:var(--bcm-button-link-background-color-disabled);border-color:var(--bcm-button-link-border-disabled)}.bcm-button__container-kind-link .bcm-button__container-loading{color:var(--bcm-button-link-color-default);background-color:var(--bcm-button-link-background-color-default);border-color:var(--bcm-button-link-border-default)}.bcm-button__container[disabled]{cursor:not-allowed}.bcm-button__container-text{order:3;display:flex;align-items:center;gap:8px;white-space:nowrap}.bcm-button__container-icon{min-height:calc(12px + 8px)}.bcm-button__container-icon.prefix{order:2}.bcm-button__container-icon.suffix{order:4}.bcm-button__container-size-small{font-size:12px;line-height:calc(12px + 8px);padding:calc(4px - 3px) 12px;min-height:calc(calc(12px + 8px) + calc(calc(4px - 2px)) * 2)}.bcm-button__container-size-small .bcm-button__container-icon{min-height:calc(12px + 8px)}.bcm-button__container-size-medium{font-size:calc(12px + 1px);line-height:calc(12px + 8px);padding:calc(4px + 1px) 12px;min-height:calc(calc(12px + 8px) + calc(calc(4px + 2px)) * 2)}.bcm-button__container-size-medium .bcm-button__container-icon{min-height:calc(12px + 8px)}.bcm-button__container-size-large{font-size:16px;line-height:calc(16px + 8px);padding:calc(8px - 1px) 12px;min-height:calc(calc(16px + 8px) + (calc(8px) * 2))}.bcm-button__container-size-large .bcm-button__container-icon{min-height:calc(16px + 8px)}";
239
-
240
- const BcmButton = class {
241
- constructor(hostRef) {
242
- index$1.registerInstance(this, hostRef);
243
- this.bcmClick = index$1.createEvent(this, "bcm-click", 7);
244
- this._id = generate.Generate.UID();
245
- this.hidden = false;
246
- this.type = bcm.Bcm.ButtonType.button;
247
- this.size = bcm.Bcm.Size.medium;
248
- this.disabled = false;
249
- this.kind = bcm.Bcm.Kind.solid;
250
- this.outline = false;
251
- this.icon = undefined;
252
- this.href = undefined;
253
- this.target = undefined;
254
- this.value = undefined;
255
- this.loading = false;
256
- this.variant = undefined;
257
- this.dataDismiss = false;
258
- this.fullWidth = false;
259
- this.iconPosition = bcm.Bcm.IconPosition.prefix;
260
- this.color = undefined;
261
- this.checked = false;
262
- }
263
- handleOnClick(e) {
264
- if (this.disabled) {
265
- e.preventDefault();
266
- e.stopPropagation();
267
- return false;
268
- }
269
- }
270
- componentWillRender() {
271
- const { size, kind, icon, iconPosition, disabled, outline, href, type, target, loading, variant, fullWidth, hidden, value } = this;
272
- buttonState.setValue({
273
- id: this._id,
274
- size,
275
- type,
276
- kind,
277
- icon,
278
- iconPosition,
279
- disabled,
280
- outline,
281
- href,
282
- target,
283
- loading,
284
- variant,
285
- fullWidth,
286
- hidden,
287
- value,
288
- isIconOnly: !!(this.isHaveChildNodes() && this.icon),
289
- });
290
- }
291
- getStateData() {
292
- return buttonState.getValue(this._id);
293
- }
294
- isHaveChildNodes() {
295
- const childNodes = Array.from(this.el.childNodes);
296
- return childNodes.find(node => node.nodeType === Node.TEXT_NODE) === undefined;
297
- }
298
- setColor(color = this.color) {
299
- if (!color)
300
- return;
301
- const { kind } = this;
302
- const prefix = `--bcm-button-${kind}`;
303
- if (kind === 'solid') {
304
- return {
305
- [`${prefix}-color-default`]: colorHelper.ColorHelper.dsColor('white'),
306
- [`${prefix}-color-hover`]: colorHelper.ColorHelper.dsColor('white'),
307
- [`${prefix}-color-focus-visible`]: colorHelper.ColorHelper.dsColor('white'),
308
- [`${prefix}-color-active`]: colorHelper.ColorHelper.dsColor('white'),
309
- [`${prefix}-color-disabled`]: colorHelper.ColorHelper.dsColor('white'),
310
- [`${prefix}-background-color-default`]: colorHelper.ColorHelper.dsColor(color + '-500'),
311
- [`${prefix}-background-color-hover`]: colorHelper.ColorHelper.dsColor(color + '-600'),
312
- [`${prefix}-background-color-focus-visible`]: colorHelper.ColorHelper.dsColor(color + '-700'),
313
- [`${prefix}-background-color-active`]: colorHelper.ColorHelper.dsColor(color + '-800'),
314
- [`${prefix}-background-color-disabled`]: colorHelper.ColorHelper.dsColor('slate-400'),
315
- [`${prefix}-border-default`]: colorHelper.ColorHelper.dsColor(color + '-500'),
316
- [`${prefix}-border-hover`]: colorHelper.ColorHelper.dsColor(color + '-600'),
317
- [`${prefix}-border-focus-visible`]: colorHelper.ColorHelper.dsColor(color + '-700'),
318
- [`${prefix}-border-active`]: colorHelper.ColorHelper.dsColor(color + '-800'),
319
- [`${prefix}-border-disabled`]: colorHelper.ColorHelper.dsColor('slate-400')
320
- };
321
- }
322
- else if (kind == 'link') {
323
- return {
324
- [`${prefix}-color-default`]: colorHelper.ColorHelper.dsColor(color + '-500'),
325
- [`${prefix}-color-hover`]: colorHelper.ColorHelper.dsColor(color + '-600'),
326
- [`${prefix}-color-focus-visible`]: colorHelper.ColorHelper.dsColor(color + '-800'),
327
- [`${prefix}-color-active`]: colorHelper.ColorHelper.dsColor(color + '-700'),
328
- [`${prefix}-color-disabled`]: colorHelper.ColorHelper.dsColor('slate-400'),
329
- [`${prefix}-background-color-default`]: colorHelper.ColorHelper.dsColor('transparent'),
330
- [`${prefix}-background-color-hover`]: colorHelper.ColorHelper.dsColor('transparent'),
331
- [`${prefix}-background-color-focus-visible`]: colorHelper.ColorHelper.dsColor('slate-50'),
332
- [`${prefix}-background-color-active`]: colorHelper.ColorHelper.dsColor('slate-50'),
333
- [`${prefix}-background-color-disabled`]: colorHelper.ColorHelper.dsColor('transparent'),
334
- [`${prefix}-border-default`]: colorHelper.ColorHelper.dsColor('transparent'),
335
- [`${prefix}-border-hover`]: colorHelper.ColorHelper.dsColor('transparent'),
336
- [`${prefix}-border-focus-visible`]: colorHelper.ColorHelper.dsColor('slate-50'),
337
- [`${prefix}-border-active`]: colorHelper.ColorHelper.dsColor('slate-50'),
338
- [`${prefix}-border-disabled`]: colorHelper.ColorHelper.dsColor('transparent')
339
- };
340
- }
341
- else if (kind == 'ghost') {
342
- return {
343
- [`${prefix}-color-default`]: colorHelper.ColorHelper.dsColor(color + '-600'),
344
- [`${prefix}-color-hover`]: colorHelper.ColorHelper.dsColor(color + '-600'),
345
- [`${prefix}-color-focus-visible`]: colorHelper.ColorHelper.dsColor(color + '-600'),
346
- [`${prefix}-color-active`]: colorHelper.ColorHelper.dsColor(color + '-600'),
347
- [`${prefix}-color-disabled`]: colorHelper.ColorHelper.dsColor(color + '-300'),
348
- [`${prefix}-background-color-default`]: colorHelper.ColorHelper.dsColor(color + '-100'),
349
- [`${prefix}-background-color-hover`]: colorHelper.ColorHelper.dsColor(color + '-200'),
350
- [`${prefix}-background-color-focus-visible`]: colorHelper.ColorHelper.dsColor(color + '-400'),
351
- [`${prefix}-background-color-active`]: colorHelper.ColorHelper.dsColor(color + '-300'),
352
- [`${prefix}-background-color-disabled`]: colorHelper.ColorHelper.dsColor(color + '-50'),
353
- [`${prefix}-border-default`]: colorHelper.ColorHelper.dsColor(color + '-300'),
354
- [`${prefix}-border-hover`]: colorHelper.ColorHelper.dsColor(color + '-400'),
355
- [`${prefix}-border-focus-visible`]: colorHelper.ColorHelper.dsColor(color + '-600'),
356
- [`${prefix}-border-active`]: colorHelper.ColorHelper.dsColor(color + '-500'),
357
- [`${prefix}-border-disabled`]: colorHelper.ColorHelper.dsColor(color + '-200'),
358
- };
359
- }
360
- return;
361
- }
362
- render() {
363
- const { size, kind, disabled, outline, type, href, target, loading, variantColor, fullWidth, hidden, icon, iconPosition, value, isIconOnly, iconSize } = this.getStateData();
364
- const classPrefix = 'bcm-button';
365
- let componentClass = index$2.classnames('bcm-button__container', `bcm-button__container-size-${size}`, `bcm-button__container-kind-${outline ? 'ghost' : kind}`, {
366
- 'full-width': fullWidth,
367
- 'checked': this.checked,
368
- 'disabled': disabled,
369
- });
370
- const hostClasses = index$2.classnames(`${classPrefix}`, {
371
- hidden,
372
- 'full-width': fullWidth,
373
- });
374
- return (index$1.h(index$1.Host, { class: hostClasses, style: this.setColor(variantColor), onClick: () => !disabled && this.bcmClick.emit(this.el) }, index$1.h(ButtonTemplate, { type: type, value: value, componentClass: componentClass, disabled: disabled, href: href, target: target, icon: icon, loading: loading, iconSize: iconSize, isIconOnly: isIconOnly, iconPosition: iconPosition })));
375
- }
376
- get el() { return index$1.getElement(this); }
377
- };
378
- BcmButton.style = buttonCss;
379
-
380
- const checkboxCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");@import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap\"); @import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap\"); @import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap\"); .size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}*{box-sizing:border-box}.bcm-caption-area{font-family:\"Inter\", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;font-size:12px;line-height:calc(12px + 8px);color:var(--bcm-new-ds-color-slate-400);display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between;flex-wrap:nowrap;margin-top:2px}.bcm-caption-area__text{color:var(--bcm-new-ds-color-slate-400)}.bcm-caption-area__text.default{color:var(--bcm-new-ds-color-slate-400)}.bcm-caption-area__text.info{color:var(--bcm-new-ds-color-blue-500)}.bcm-caption-area__text.success{color:var(--bcm-new-ds-color-emerald-500)}.bcm-caption-area__text.warning{color:var(--bcm-new-ds-color-amber-500)}.bcm-caption-area__text.error{color:var(--bcm-new-ds-color-red-500)}.bcm-caption-area__size-small{font-size:10px;line-height:calc(10px + 8px);min-height:calc(10px + 8px)}.bcm-caption-area__size-medium{font-size:12px;line-height:calc(12px + 8px);min-height:calc(12px + 8px)}.bcm-caption-area__size-large{font-size:14px;line-height:calc(14px + 8px);min-height:calc(14px + 8px)}*{box-sizing:border-box}.bcm-label{display:inline-flex;align-items:flex-start;grid-gap:2px}.bcm-label__text{margin-bottom:2px;font-family:\"Inter\", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;display:inline-block;color:var(--bcm-new-ds-color-slate-600)}.bcm-label__size-small{font-size:10px;line-height:calc(10px + 8px);min-height:calc(10px + 8px)}.bcm-label__size-medium{font-size:12px;line-height:calc(12px + 8px);min-height:calc(12px + 8px)}.bcm-label__size-large{font-size:14px;line-height:calc(14px + 8px);min-height:calc(14px + 8px)}.bcm-input[no-margin]{margin:0}.bcm-textarea[no-margin]{margin:0}.bcm-switch[no-margin]{margin:0}.bcm-checkbox[no-margin]{margin:0}.bcm-radio-group[no-margin]{margin:0}.bcm-checkbox-group[no-margin]{margin:0}.bcm-range[no-margin]{margin:0}.bcm-form[no-margin]{margin:0}.bcm-form-group[no-margin]{margin:0}.bcm-list[no-margin]{margin:0}.bcm-colorpicker[no-margin]{margin:0}.bcm-date-picker[no-margin]{margin:0}.bcm-time-picker[no-margin]{margin:0}.bcm-datetime-picker[no-margin]{margin:0}.bcm-select[no-margin]{margin:0}.bcm-listbox[no-margin]{margin:0}*{box-sizing:border-box}.bcm-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}";
381
-
382
- var __decorate$2 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
383
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
384
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
385
- r = Reflect.decorate(decorators, target, key, desc);
386
- else
387
- for (var i = decorators.length - 1; i >= 0; i--)
388
- if (d = decorators[i])
389
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
390
- return c > 3 && r && Object.defineProperty(target, key, r), r;
391
- };
392
- const BcmCheckbox = class {
393
- constructor(hostRef) {
394
- index$1.registerInstance(this, hostRef);
395
- this.blur = index$1.createEvent(this, "bcm-blur", 7);
396
- this.focus = index$1.createEvent(this, "bcm-focus", 7);
397
- this.change = index$1.createEvent(this, "bcm-change", 7);
398
- this.changeCheckbox = index$1.createEvent(this, "bcm-change-checkbox", 7);
399
- this._id = generate.Generate.UID();
400
- this.inGroup = false;
401
- this.value = false;
402
- this.checked = false;
403
- this.name = undefined;
404
- this.disabled = false;
405
- this.hidden = false;
406
- this.required = false;
407
- this.label = undefined;
408
- this.readonly = false;
409
- this.size = bcm.Bcm.Size.medium;
410
- this.indeterminate = null;
411
- this.color = "blue";
412
- this.caption = undefined;
413
- this.noCaption = false;
414
- this.captionError = undefined;
415
- this.captionType = bcm.Bcm.Status.default;
416
- this.captionCache = undefined;
417
- this.captionTypeCache = undefined;
418
- }
419
- connectedCallback() {
420
- this.captionCache = this.caption;
421
- this.captionTypeCache = this.captionType;
422
- this.value = this.checked;
423
- }
424
- componentDidRender() {
425
- this.inputElement.checked = this.checked;
426
- }
427
- async onBcmFocus() {
428
- this.el.focus();
429
- }
430
- async onBcmBlur() {
431
- this.el.blur();
432
- }
433
- async setClear() {
434
- this.check(false);
435
- this.handleChange();
436
- await utils.delay(10);
437
- return Promise.resolve();
438
- }
439
- async resetCaption() {
440
- await utils.delay(10);
441
- this.caption = this.captionCache;
442
- this.captionType = this.captionTypeCache;
443
- this.captionError = null;
444
- await utils.delay(10);
445
- return Promise.resolve();
446
- }
447
- handleChange() {
448
- this.checked = this.inputElement.checked;
449
- this.value = this.checked;
450
- if (!this.indeterminate) {
451
- this.changeCheckbox.emit();
452
- this.change.emit({
453
- name: this.name,
454
- value: this.checked
455
- });
456
- }
457
- }
458
- watchIndeterminate(newValue, oldValue) {
459
- if (newValue != oldValue) {
460
- this.inputElement.checked = this.indeterminate == bcm.Bcm.IndeterminateType.determinate ? true : false;
461
- this.handleChange();
462
- }
463
- }
464
- async set(data) {
465
- if (typeof data === 'boolean') {
466
- await this.check(data);
467
- }
468
- }
469
- async get() {
470
- return this.checked || false;
471
- }
472
- async check(uncheck = true) {
473
- this.inputElement.checked = uncheck;
474
- this.handleChange();
475
- }
476
- handleKeyUp(ev) {
477
- if (ev.keyCode == bcm.Bcm.KeyCode.space || ev.keyCode == bcm.Bcm.KeyCode.enter) {
478
- if (!this.disabled && !this.readonly) {
479
- this.inputElement.checked = !this.inputElement.checked;
480
- this.handleChange();
481
- }
482
- ev.stopPropagation();
483
- ev.preventDefault();
484
- return false;
485
- }
486
- }
487
- watchChecked() {
488
- if (this.checked) {
489
- this.resetCaption();
490
- }
491
- this.value = this.checked;
492
- }
493
- setColor(color = this.color) {
494
- if (!color)
495
- return;
496
- const prefix = `--bcm-checkbox`;
497
- return {
498
- [`${prefix}-primary-color-default`]: colorHelper.ColorHelper.dsColor(color + '-500'),
499
- [`${prefix}-primary-color-hover`]: colorHelper.ColorHelper.dsColor(color + '-600'),
500
- [`${prefix}-primary-color-focus-visible`]: colorHelper.ColorHelper.dsColor(color + '-800'),
501
- [`${prefix}-primary-color-active`]: colorHelper.ColorHelper.dsColor(color + '-700'),
502
- // [`${prefix}-primary-color-disabled`]: ColorHelper.dsColor(color + '-300'),
503
- [`${prefix}-secondary-color-default`]: colorHelper.ColorHelper.dsColor('white'),
504
- [`${prefix}-secondary-color-hover`]: colorHelper.ColorHelper.dsColor('slate-50'),
505
- [`${prefix}-secondary-color-focus-visible`]: colorHelper.ColorHelper.dsColor('slate-50'),
506
- [`${prefix}-secondary-color-active`]: colorHelper.ColorHelper.dsColor('slate-50'),
507
- // [`${prefix}-secondary-color-disabled`]: ColorHelper.dsColor('slate-200')
508
- };
509
- }
510
- render() {
511
- const { label, _id, indeterminate, hidden, disabled, checked, readonly, required, caption, captionError, captionType, noCaption, size } = this;
512
- //////
513
- const bcmCheckboxClass = index$2.classnames('bcm-checkbox', `bcm-checkbox-size-${size}`, {
514
- 'error': captionType == bcm.Bcm.Status.error,
515
- hidden,
516
- checked,
517
- disabled,
518
- required,
519
- readonly,
520
- });
521
- const bcmCheckboxIconClass = index$2.classnames('bcm-checkbox__label-icon', 'bcm-checkbox__label-icon-lite', 'bcm-checkbox__label-icon-' + indeterminate, {
522
- 'bcm-checkbox__label-icon-checked': checked,
523
- });
524
- const bcmCheckboxLabelClass = index$2.classnames('bcm-checkbox__label');
525
- const bcmCheckboxInputClass = index$2.classnames('bcm-checkbox__input');
526
- return (index$1.h(index$1.Host, { tabindex: "0", onFocus: () => this.focus.emit(this.el), onBlur: () => this.blur.emit(this.el), style: this.setColor(this.color), class: bcmCheckboxClass, disabled: disabled }, index$1.h("span", { hidden: true }, index$1.h("slot", null)), label && index$1.h("bcm-label", { htmlFor: `input-${_id}`, type: captionType, value: label, required: required }), index$1.h("div", { class: bcmCheckboxInputClass }, index$1.h("input", { id: `input-${_id}`, type: "checkbox", checked: checked, disabled: disabled, required: required, readonly: readonly, onChange: () => { !disabled && !readonly && (this.handleChange()); }, ref: el => (this.inputElement = el) }), index$1.h("label", { class: bcmCheckboxLabelClass, htmlFor: `input-${_id}` }, index$1.h("span", { class: bcmCheckboxIconClass }, index$1.h("bcm-icon", { icon: "far fa-check" })), index$1.h(slotTemplate.SlotTemplate, { className: "slot" }))), index$1.h(captionTemplate.CaptionTemplate, { noCaption: noCaption, captionType: captionType, captionError: captionError, caption: caption })));
527
- }
528
- get el() { return index$1.getElement(this); }
529
- static get watchers() { return {
530
- "indeterminate": ["watchIndeterminate"],
531
- "checked": ["watchChecked"]
532
- }; }
533
- };
534
- __decorate$2([
535
- isLoadDecorator.IsLoad()
536
- ], BcmCheckbox.prototype, "el", void 0);
537
- BcmCheckbox.style = checkboxCss;
538
-
539
- const { state } = index.createStore({
540
- group: new Map(),
541
- allChecked: true,
542
- allUnchecked: true,
543
- changeInderminate: {},
544
- });
545
- const setValue = async ({ fullWidth, optionType, buttonStyle, size, defaultCheckedItems, el, id, label, required, captionType, hidden, direction, childs, indeterminate, gap, noCaption, }) => {
546
- if (el) {
547
- state.group.set(id, {
548
- fullWidth,
549
- optionType,
550
- buttonStyle,
551
- size,
552
- defaultCheckedItems,
553
- label,
554
- required,
555
- captionType,
556
- hidden,
557
- direction,
558
- indeterminate,
559
- gap,
560
- noCaption,
561
- childs: childs === null || childs === void 0 ? void 0 : childs.map(child => {
562
- child.checked && (state.allUnchecked = false);
563
- !child.checked && (state.allChecked = false);
564
- // fullWidth && (fullWidth == 'flex' ? (child.style.flex = 'auto') : (child.style.width = '100%'));
565
- optionType && (child.optionType = optionType);
566
- buttonStyle && (child.buttonStyle = buttonStyle);
567
- size && (child.size = size);
568
- defaultCheckedItems && defaultCheckedItems.find(e => e === child.name) && (child.checked = true);
569
- child.noCaption = noCaption;
570
- return {
571
- id: child.id || generate.Generate.UID(),
572
- checked: child.checked || false,
573
- name: child.name,
574
- size: child.size,
575
- buttonStyle: child.buttonStyle,
576
- optionType: child.optionType,
577
- style: child.style,
578
- noCaption: child.noCaption,
579
- color: child.color,
580
- disabled: child.disabled,
581
- readonly: child.readonly,
582
- label: child.label || child.name,
583
- slot: child.slot || generate.snq(() => child.querySelector('.slot').textContent, child.textContent),
584
- required: child.required || required,
585
- el: child,
586
- captionType,
587
- hidden,
588
- };
589
- }),
590
- indeterminateState: !state.allChecked && !state.allUnchecked ? 'indeterminate' : state.allChecked ? 'determinate' : 'uncheck',
591
- });
592
- }
593
- };
594
- const getProperty = id => {
595
- return generate.snq(() => state.group.get(id), {});
596
- };
597
- const getValue = (id, name) => {
598
- var _a;
599
- const group = getProperty(id);
600
- let value = {};
601
- (_a = group.childs) === null || _a === void 0 ? void 0 : _a.map(child => {
602
- if (name) {
603
- if (child.name === name) {
604
- value[child.name] = {
605
- value: !!child.checked,
606
- name: child.name,
607
- };
608
- }
609
- }
610
- else {
611
- value[child.name] = {
612
- value: !!child.checked,
613
- name: child.name,
614
- };
615
- }
616
- });
617
- return value;
618
- };
619
- const getCheckedList = id => {
620
- var _a;
621
- const group = getProperty(id);
622
- let value = {};
623
- (_a = group.childs) === null || _a === void 0 ? void 0 : _a.map(child => {
624
- if (child.checked === true) {
625
- value[child.name] = {
626
- value: !!child.checked,
627
- name: child.name,
628
- };
629
- }
630
- });
631
- return value;
632
- };
633
- const setClear = id => {
634
- var _a;
635
- (_a = getProperty(id).childs) === null || _a === void 0 ? void 0 : _a.forEach(child => {
636
- child.checked = false;
637
- });
638
- checkInderminate(id);
639
- };
640
- const setCheckedItems = (id, items, checked, reset) => {
641
- var _a;
642
- const checkedItems = items && (typeof items == 'string' ? JSON.parse(items) : items);
643
- (_a = getProperty(id).childs) === null || _a === void 0 ? void 0 : _a.forEach(child => {
644
- if (checkedItems) {
645
- const checkedItem = checkedItems.find(e => e === child.name || e.name === child.name);
646
- if (checkedItem) {
647
- if (typeof checkedItem == 'object') {
648
- Object.keys(checkedItem).map(key => {
649
- if (key === 'checked') {
650
- child.checked = checkedItem[key];
651
- }
652
- else {
653
- child.checked = checked;
654
- }
655
- });
656
- }
657
- else {
658
- child.checked = checked;
659
- }
660
- }
661
- else {
662
- reset && (child.checked = false);
663
- }
664
- }
665
- else {
666
- child.checked = false;
667
- }
668
- });
669
- checkInderminate(id);
670
- };
671
- const resetCaption = id => {
672
- var _a;
673
- // const noCaption = getProperty(id).noCaption;
674
- (_a = getProperty(id).childs) === null || _a === void 0 ? void 0 : _a.forEach(child => {
675
- child.resetCaption();
676
- // child.noCaption = noCaption;
677
- });
678
- };
679
- const changeIndeterminate = id => {
680
- var _a;
681
- const group = getProperty(id);
682
- if (!group.disabled) {
683
- let checkAll = true;
684
- if (group.indeterminateState === 'determinate') {
685
- checkAll = false;
686
- }
687
- (_a = getProperty(id).childs) === null || _a === void 0 ? void 0 : _a.map(child => {
688
- child.checked = checkAll;
689
- });
690
- checkInderminate(id);
691
- }
692
- };
693
- const checkInderminate = id => {
694
- var _a;
695
- const group = getProperty(id);
696
- let allChecked = true;
697
- let allUnchecked = true;
698
- (_a = group.childs) === null || _a === void 0 ? void 0 : _a.map(child => {
699
- child.checked && (allUnchecked = false);
700
- !child.checked && (allChecked = false);
701
- });
702
- group.indeterminateState = !allChecked && !allUnchecked ? 'indeterminate' : allChecked ? 'determinate' : 'uncheck';
703
- };
704
- const onChange = (obj) => {
705
- var _a;
706
- (_a = getProperty(obj.id).childs) === null || _a === void 0 ? void 0 : _a.map(child => {
707
- child.checked = child.id === obj.childId ? !child.checked : child.checked;
708
- });
709
- checkInderminate(obj.id);
710
- };
711
- const removeState = id => {
712
- return Promise.resolve(state.group.delete(id));
713
- };
714
- const getStatesKeys = id => {
715
- return Object.keys(state.group.get(id));
716
- };
717
- const checkBoxGroupState = {
718
- setValue,
719
- getValue,
720
- setCheckedItems,
721
- getCheckedList,
722
- getProperty,
723
- setClear,
724
- resetCaption,
725
- onChange,
726
- getStatesKeys,
727
- state,
728
- removeState,
729
- changeIndeterminate,
730
- };
731
-
732
- const CheckboxGroupTemplate = ({ customStyle, groupContainerClasses, onBcmSelect, items }) => {
733
- return (index$1.h("div", { class: groupContainerClasses, style: customStyle }, items.childs && items.childs.map((checkbox) => {
734
- return (index$1.h("bcm-checkbox", { id: checkbox.id, name: checkbox.name, color: checkbox.color, checked: checkbox.checked, disabled: checkbox.disabled, readonly: checkbox.readonly, required: checkbox.required, noCaption: checkbox.noCaption, "no-margin": true, size: checkbox.size, "full-width": checkbox.fullWidth, onClick: (e) => { !checkbox.disabled && !checkbox.readonly && (onBcmSelect(checkbox.id), e.preventDefault()); } }, checkbox.slot || checkbox.label));
735
- })));
736
- };
737
-
738
- const groupCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}.bcm-checkbox-group{display:flex;flex-direction:column;align-items:flex-start;width:100%;margin-bottom:8px}.bcm-checkbox-group.hidden{display:none}.bcm-checkbox-group__container{display:flex;flex-wrap:wrap;justify-content:flex-start;align-items:flex-start;width:100%}.bcm-checkbox-group__container.full-width{max-width:100%}.bcm-checkbox-group__container.vertical{gap:8px;flex-direction:column}.bcm-checkbox-group__container.button{gap:unset}.bcm-checkbox-group__container.indeterminate{padding-top:16px;margin-top:16px;border-top:1px solid #efefef}";
739
-
740
- var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
741
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
742
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
743
- r = Reflect.decorate(decorators, target, key, desc);
744
- else
745
- for (var i = decorators.length - 1; i >= 0; i--)
746
- if (d = decorators[i])
747
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
748
- return c > 3 && r && Object.defineProperty(target, key, r), r;
749
- };
750
- const BcmCheckboxGroup = class {
751
- constructor(hostRef) {
752
- index$1.registerInstance(this, hostRef);
753
- this.change = index$1.createEvent(this, "bcm-change", 7);
754
- this.groupCheckedList = index$1.createEvent(this, "bcm-group-checked-list", 7);
755
- this._id = generate.Generate.UID();
756
- this.direction = bcm.Bcm.Direction.horizontal;
757
- this.items = [];
758
- this.indeterminate = false;
759
- this.name = undefined;
760
- this.value = undefined;
761
- this.disabled = false;
762
- this.readonly = false;
763
- this.hidden = false;
764
- this.required = false;
765
- this.label = undefined;
766
- this.gap = undefined;
767
- this.defaultValue = undefined;
768
- this.fullWidth = false;
769
- this.optionType = 'default';
770
- this.buttonStyle = 'solid';
771
- this.size = bcm.Bcm.Size.medium;
772
- this.caption = undefined;
773
- this.noCaption = false;
774
- this.captionType = bcm.Bcm.Status.default;
775
- this.tick = {};
776
- }
777
- componentDidLoad() {
778
- this.initState();
779
- }
780
- disconnectedCallback() {
781
- checkBoxGroupState.removeState(this._id);
782
- }
783
- componentShouldUpdate(newVal, oldVal, propName) {
784
- if (propName == 'tick' && newVal !== oldVal) {
785
- const isHaveChild = generate.snq(() => checkBoxGroupState.getProperty(this._id).childs.length > 0, false);
786
- if (isHaveChild) {
787
- this.getValue().then(values => this.value = values);
788
- }
789
- }
790
- if (this.getOptions().indexOf(propName) > -1 && newVal !== oldVal) {
791
- this.initState();
792
- }
793
- }
794
- getOptions() {
795
- return generate.snq(() => checkBoxGroupState.getStatesKeys(this._id), []);
796
- }
797
- async initState() {
798
- const { fullWidth, optionType, buttonStyle, size, noCaption, defaultValue, label, required, captionType, hidden, direction, indeterminate, gap, items } = this;
799
- const defaultCheckedItems = defaultValue && (typeof defaultValue == 'string' ? JSON.parse(defaultValue) : defaultValue);
800
- const childElements = items.length > 0 ? items : await this.getCheckboxes();
801
- await checkBoxGroupState.setValue({
802
- id: this._id,
803
- el: this.el,
804
- indeterminate,
805
- fullWidth,
806
- optionType,
807
- buttonStyle,
808
- size,
809
- defaultCheckedItems,
810
- label,
811
- noCaption,
812
- required,
813
- captionType,
814
- hidden,
815
- gap,
816
- direction,
817
- childs: childElements
818
- });
819
- const slotArea = this.el.querySelector(`#bcm-checkbox-group__items-${this._id}`);
820
- if (slotArea) {
821
- slotArea.innerHTML && (slotArea.innerHTML = '');
822
- }
823
- this.value = await this.getValue();
824
- }
825
- async markForCheck() {
826
- await utils.delay(10);
827
- this.tick = generate.Generate.UID();
828
- }
829
- async onBcmFocus() {
830
- //focus first item
831
- const childs = this.getCheckboxes();
832
- if (childs.length > 0) {
833
- childs[0].onBcmFocus();
834
- }
835
- }
836
- async onBcmBlur() {
837
- this.el.blur();
838
- }
839
- async setClear() {
840
- checkBoxGroupState.setClear(this._id);
841
- await utils.delay(10);
842
- this.getCheckboxes().forEach(item => {
843
- item.setClear();
844
- });
845
- this.markForCheck();
846
- await utils.delay(10);
847
- return Promise.resolve();
848
- }
849
- async resetCaption() {
850
- await utils.delay(10);
851
- this.getCheckboxes().forEach(item => {
852
- item.resetCaption();
853
- });
854
- await utils.delay(10);
855
- return Promise.resolve();
856
- }
857
- async set(data) {
858
- if (Array.isArray(data)) {
859
- await this.check(data, true, true);
860
- }
861
- }
862
- async get() {
863
- const checklist = await this.getCheckedList() && Object.keys(await this.getCheckedList());
864
- return checklist.length > 0 ? checklist : [];
865
- }
866
- async check(items, checked = true, reset = false) {
867
- checkBoxGroupState.setCheckedItems(this._id, items, checked, reset);
868
- this.markForCheck();
869
- }
870
- async getValue(name) {
871
- return Promise.resolve(checkBoxGroupState.getValue(this._id, name));
872
- }
873
- async getCheckedList() {
874
- return checkBoxGroupState.getCheckedList(this._id);
875
- }
876
- handleItemsChange() {
877
- this.initState();
878
- }
879
- getCheckboxes() {
880
- return utils.getChildElements(this.el, 'bcm-checkbox:not(#bcm-indeterminate-element)');
881
- }
882
- async getCheckbox(id) {
883
- const element = this.el.querySelector(`bcm-checkbox[id="${id}"]`);
884
- if (element) {
885
- const name = element["name"];
886
- const value = await this.getValue(name);
887
- return { element, event: generate.snq(() => value[name], null) };
888
- }
889
- return {};
890
- }
891
- async indeterminateClick() {
892
- checkBoxGroupState.changeIndeterminate(this._id);
893
- this.markForCheck();
894
- }
895
- async changeCheckBox(id) {
896
- checkBoxGroupState.onChange({ id: this._id, childId: id });
897
- this.markForCheck();
898
- await utils.delay(10);
899
- this.value = await this.getValue();
900
- this.change.emit({ value: this.value, changed: Object.assign({}, await this.getCheckbox(id)) });
901
- this.groupCheckedList.emit(await this.getCheckedList());
902
- }
903
- getItems() {
904
- return checkBoxGroupState.getProperty(this._id);
905
- }
906
- render() {
907
- const items = this.getItems();
908
- const { disabled, captionType, label, indeterminate, indeterminateState, required, direction, optionType, hidden, fullWidth, gap } = items;
909
- const bcmChechboxGroup = index$2.classnames('bcm-checkbox-group', direction, optionType, {
910
- hidden,
911
- 'full-width': fullWidth
912
- });
913
- const bcmChechboxGroupContainer = index$2.classnames('bcm-checkbox-group__container', optionType, {
914
- [direction]: optionType === 'default',
915
- indeterminate,
916
- hidden,
917
- 'full-width': fullWidth
918
- });
919
- return (index$1.h(index$1.Host, { class: bcmChechboxGroup }, index$1.h("span", { hidden: true, id: `bcm-checkbox-group__items-${this._id}` }, index$1.h("slot", null)), index$1.h("div", { class: "bcm-checkbox-group__label" }, label &&
920
- index$1.h("div", null, index$1.h(labelTemplate.LabelTemplate, { size: this.size, type: captionType, value: label, required: required }))), indeterminate &&
921
- index$1.h("bcm-checkbox", { onClick: (e) => { this.indeterminateClick(), e.preventDefault(); }, "no-caption": true, id: "bcm-indeterminate-element", indeterminate: indeterminateState, disabled: disabled }, "Check All"), index$1.h(CheckboxGroupTemplate, { items: items, groupContainerClasses: bcmChechboxGroupContainer, customStyle: gap && ({ 'gap': gap }), onBcmSelect: (id) => this.changeCheckBox(id) })));
922
- }
923
- get el() { return index$1.getElement(this); }
924
- static get watchers() { return {
925
- "items": ["handleItemsChange"]
926
- }; }
927
- };
928
- __decorate$1([
929
- isLoadDecorator.IsLoad()
930
- ], BcmCheckboxGroup.prototype, "el", void 0);
931
- BcmCheckboxGroup.style = groupCss;
932
-
933
- // /**
934
- // *
935
- // * @param type
936
- // */
937
- // export const required = (value:any) => {
938
- // if ( value || value != null ) {
939
- // return true
940
- // } else {
941
- // return true
942
- // }
943
- // }
944
- class rules {
945
- constructor() { }
946
- response(status, message) {
947
- return Object.assign(Object.assign({ valid: status }, (message && { message })), (!status && { type: 'error' }));
948
- }
949
- required(value, componentValidation) {
950
- let validation = this.response(true);
951
- if (value == '' || value == "" || value == undefined || value == null || value === false) {
952
- validation = this.response(false, 'This field is required.');
953
- }
954
- if (componentValidation) {
955
- if (!componentValidation.valid) {
956
- validation = this.response(false, componentValidation.errorText);
957
- }
958
- if (value instanceof Object) {
959
- if (value.isValid) {
960
- if (value.isValid == false)
961
- validation = this.response(false, 'This field is required.');
962
- }
963
- }
964
- }
965
- return validation;
966
- }
967
- selfValidation(input) {
968
- let validation = this.response(true);
969
- if (input.captionError != null || input.captionType == 'error') {
970
- validation = this.response(false, input.captionError);
971
- }
972
- return validation;
973
- }
974
- }
975
- const validate = new rules;
976
-
977
- const formCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}:host{display:block;margin-bottom:8px}:host(.hidden){display:none}";
978
-
979
- var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
980
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
981
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
982
- r = Reflect.decorate(decorators, target, key, desc);
983
- else
984
- for (var i = decorators.length - 1; i >= 0; i--)
985
- if (d = decorators[i])
986
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
987
- return c > 3 && r && Object.defineProperty(target, key, r), r;
988
- };
989
- const BcmForm = class {
990
- constructor(hostRef) {
991
- index$1.registerInstance(this, hostRef);
992
- this.bcmForm = index$1.createEvent(this, "bcm-form", 7);
993
- this.formData = {};
994
- this.inputs = [];
995
- this.duplicateInput = [];
996
- this.isValid = true;
997
- this.returnCaption = [];
998
- this.Bromcom = {
999
- errors: {
1000
- targetFormNotExist: 'target form is not exist --> ',
1001
- },
1002
- inputComponents: {
1003
- // Birbirinin aynısı
1004
- INPUT: 'input',
1005
- TEXTAREA: 'textarea',
1006
- //çok benzer
1007
- SWITCH: 'switch',
1008
- CHECKBOX: 'checkbox',
1009
- RADIO_GROUP: 'radio-group',
1010
- CHECKBOX_GROUP: 'checkbox-group',
1011
- RANGE: 'range',
1012
- // sadece value fırlatıyor
1013
- FORM: 'form',
1014
- FORM_GROUP: 'form-group',
1015
- // *En vakit alacak => içinde select, autocomplete, listbox, treeview özellikleri var
1016
- LIST: 'list',
1017
- //
1018
- COLORPICKER: 'colorpicker',
1019
- // picker aslında tek komponent hepsi datetimepicker
1020
- DATE_PICKER: 'date-picker',
1021
- TIME_PICKER: 'time-picker',
1022
- DATETIME_PICKER: 'datetime-picker',
1023
- // silinecek komponentler
1024
- SELECT: 'select',
1025
- LISTBOX: 'listbox'
1026
- },
1027
- helpers: {
1028
- randomId: function () {
1029
- return Math.random().toString(16).slice(2, -1);
1030
- },
1031
- },
1032
- };
1033
- this._id = (Math.random() * 4).toString(16).replace('.', '');
1034
- this.hidden = false;
1035
- this.validation = false;
1036
- this.name = "";
1037
- this.value = undefined;
1038
- this.autocomplete = false;
1039
- }
1040
- handleSubmit() {
1041
- // if (lowercase(e.target.nodeName) === 'bcm-button') {
1042
- // if (e.target.type === 'submit') {
1043
- // this.submitFunction()
1044
- // }
1045
- // }
1046
- }
1047
- async submitFunction() {
1048
- this.formData = {};
1049
- this.inputs = [];
1050
- this.selector = this.el;
1051
- await this.getInputs();
1052
- await utils.delay(10);
1053
- const usrFrmData = await this.userFormData();
1054
- var formData = { isValid: true, formData: usrFrmData };
1055
- if (this.name) {
1056
- formData = Object.assign(Object.assign({}, formData), { formName: this.name });
1057
- }
1058
- if (this.isValid) {
1059
- this.bcmForm.emit(formData);
1060
- return formData;
1061
- }
1062
- else {
1063
- this.returnCaption = { isValid: false, 'message': 'Please fill in all inputs', 'errorDetails': this.returnCaption, formData: usrFrmData };
1064
- if (this.name) {
1065
- this.returnCaption = Object.assign(Object.assign({}, this.returnCaption), { formName: this.name });
1066
- }
1067
- this.bcmForm.emit(this.returnCaption);
1068
- return this.returnCaption;
1069
- }
1070
- }
1071
- async submit() {
1072
- return Promise.resolve(this.submitFunction());
1073
- }
1074
- async set(data) {
1075
- var _a;
1076
- const validate = this.validation;
1077
- this.validation = false;
1078
- // debugger
1079
- this.selector = this.el;
1080
- await this.getInputs();
1081
- if (data && ((_a = this.inputs) === null || _a === void 0 ? void 0 : _a.length) > 0) {
1082
- for (const key of Object.keys(data)) {
1083
- const item = this.inputs.find(item => item.name === key);
1084
- if (item) {
1085
- try {
1086
- await item.set(data[key]);
1087
- }
1088
- catch (error) {
1089
- console.log(item.nodeName, "set", error);
1090
- }
1091
- }
1092
- }
1093
- }
1094
- this.validation = validate;
1095
- }
1096
- async get() {
1097
- var _a;
1098
- let formData = {};
1099
- this.selector = this.el;
1100
- const inputsCache = this.inputs;
1101
- await this.getInputs();
1102
- ((_a = this.inputs) === null || _a === void 0 ? void 0 : _a.length) > 0 && this.inputs.forEach(async (item) => {
1103
- try {
1104
- const value = await item.get();
1105
- formData = Object.assign(Object.assign({}, formData), { [item.name]: value });
1106
- }
1107
- catch (error) {
1108
- console.log(`${item.nodeName} get error`);
1109
- }
1110
- });
1111
- this.inputs = inputsCache;
1112
- await utils.delay(10);
1113
- return Promise.resolve(formData);
1114
- }
1115
- async setClear() {
1116
- this.formData = {};
1117
- this.inputs = [];
1118
- this.selector = this.el;
1119
- let clear = [];
1120
- await this.getInputs();
1121
- this.inputs.forEach(async (item) => {
1122
- try {
1123
- clear.push(await item.setClear());
1124
- }
1125
- catch (error) {
1126
- console.log(error);
1127
- }
1128
- });
1129
- await Promise.all(clear).then(() => {
1130
- this.formData = {};
1131
- this.inputs = [];
1132
- this.duplicateInput = [];
1133
- this.isValid = true;
1134
- this.returnCaption = [];
1135
- });
1136
- await utils.delay(10);
1137
- return Promise.resolve(true);
1138
- }
1139
- async resetCaption() {
1140
- await utils.delay(10);
1141
- this.formData = {};
1142
- this.inputs = [];
1143
- this.selector = this.el;
1144
- await this.getInputs();
1145
- for (const item of this.inputs) {
1146
- try {
1147
- await item.resetCaption();
1148
- }
1149
- catch (error) {
1150
- console.log(item.nodeName, "rc p");
1151
- }
1152
- }
1153
- await utils.delay(10);
1154
- return Promise.resolve();
1155
- }
1156
- async config(_config) {
1157
- if (_config['validation']) {
1158
- typeof _config['validation'] == 'boolean'
1159
- ? this.validation = _config['validation']
1160
- : this.validation = false;
1161
- }
1162
- return true;
1163
- }
1164
- async getInputs() {
1165
- var form = this.selector;
1166
- if (!form) {
1167
- console.warn(this.Bromcom.errors.targetFormNotExist + this.selector);
1168
- return;
1169
- }
1170
- const inputs = Array.from(form.querySelectorAll('bcm-' + Object.values(this.Bromcom.inputComponents).join(',bcm-')));
1171
- this.duplicateInput = [];
1172
- // s-hn: Stencil private flag that contains host web component
1173
- // https://github.com/ionic-team/stencil/blob/45388e95edb46ef357eb9ae37cd32bbb5bc1ed23/src/runtime/vdom/vdom-render.ts#L116
1174
- const rootInputs = inputs.filter((input) => { var _a; return !input['s-hn'] || ((_a = input['s-hn']) === null || _a === void 0 ? void 0 : _a.nodeName) !== 'BcmForm'; });
1175
- // debugger;
1176
- for (const item of rootInputs) {
1177
- if (stringHelper.StringHelper.lowercase(item.nodeName) == "bcm-checkbox-group") {
1178
- let checkboxs = item.querySelectorAll("bcm-checkbox");
1179
- if (checkboxs) {
1180
- for (const checkbox of checkboxs) {
1181
- this.duplicateInput.push(checkbox.name);
1182
- }
1183
- }
1184
- }
1185
- if (stringHelper.StringHelper.lowercase(item.nodeName) == "bcm-form") {
1186
- const groupInputs = Array.from(item.querySelectorAll('bcm-' + Object.values(this.Bromcom.inputComponents).join(',bcm-')));
1187
- let itemObject = {};
1188
- for (const element of groupInputs) {
1189
- var name = element.name;
1190
- var value = element.value;
1191
- itemObject = Object.assign(Object.assign({}, itemObject), { [name]: value });
1192
- this.duplicateInput.push(element.name);
1193
- }
1194
- item.value = itemObject;
1195
- let checkboxs = item.querySelectorAll("bcm-checkbox");
1196
- if (checkboxs) {
1197
- for (const checkbox of checkboxs) {
1198
- this.duplicateInput.push(checkbox.name);
1199
- }
1200
- }
1201
- }
1202
- }
1203
- await utils.delay(10);
1204
- this.inputs = rootInputs;
1205
- }
1206
- getItemValue(item) {
1207
- const tagName = item.tagName.toLowerCase().replace('bcm-', '');
1208
- switch (tagName) {
1209
- /* case 'date-picker':
1210
- case 'datetime-picker':
1211
- return item.value.timestamp
1212
- case 'time-picker':
1213
- return item.value.time */
1214
- default:
1215
- return item.value;
1216
- }
1217
- }
1218
- isWrapperComponent(item) {
1219
- return ['bcm-datetime-picker', 'bcm-date-picker', 'bcm-time-picker'].includes(item.toLowerCase());
1220
- }
1221
- isGroupComponent(item) {
1222
- return ['bcm-checkbox-group'].includes(item.toLowerCase());
1223
- }
1224
- isListComponent(item) {
1225
- return ['bcm-list'].includes(item.toLowerCase());
1226
- }
1227
- async userFormData() {
1228
- this.formData = {};
1229
- this.isValid = true;
1230
- this.returnCaption = [];
1231
- for (const item of this.inputs) {
1232
- // const isListComponent = this.isListComponent(item.tagName);
1233
- const isGroupComponent = this.isGroupComponent(item.tagName);
1234
- const isWrapperComponent = this.isWrapperComponent(item.tagName);
1235
- const wrapperComponent = isWrapperComponent && item;
1236
- const input = isWrapperComponent
1237
- ? await item.getInput() && item
1238
- : item;
1239
- // input.caption = ''
1240
- // input.captionType = ''
1241
- if (this.validation) {
1242
- let valid = null;
1243
- // if (isListComponent) {
1244
- // valid = !(input.value && input.value.length > 0) && validate.required(input.value)
1245
- // } else
1246
- if (isWrapperComponent) {
1247
- const isPickerValid = await wrapperComponent.isValid();
1248
- valid = validate.required(input.value, isPickerValid);
1249
- if (valid) {
1250
- if (input.value instanceof Object) {
1251
- if (input.value["isValid"] == false) {
1252
- valid = validate.required("", isPickerValid);
1253
- }
1254
- }
1255
- else {
1256
- valid = validate.required(input.value, isPickerValid);
1257
- }
1258
- }
1259
- }
1260
- else if (isGroupComponent) {
1261
- const childsCheckbox = utils.getChildElements(input, 'bcm-checkbox:not(#bcm-indeterminate-element)');
1262
- if (childsCheckbox && childsCheckbox.length > 0) {
1263
- for (const element of childsCheckbox) {
1264
- if (element && element.required === true) {
1265
- valid = validate.required(element.checked);
1266
- if (!valid['valid']) {
1267
- element.noCaption = false;
1268
- element.captionError = valid['message'];
1269
- element.captionType = valid['type'];
1270
- }
1271
- else {
1272
- element.noCaption = input.noCaption;
1273
- element.captionError = null;
1274
- element.captionType = "default";
1275
- }
1276
- }
1277
- }
1278
- }
1279
- }
1280
- else {
1281
- valid = validate.required(input.value);
1282
- }
1283
- if (input.required) {
1284
- if (!valid['valid']) {
1285
- input.captionError = valid['message'];
1286
- input.captionType = valid['type'];
1287
- }
1288
- else {
1289
- input.captionError = null;
1290
- input.captionType = "default";
1291
- }
1292
- await utils.delay(10);
1293
- const selfValidation = validate.selfValidation(input);
1294
- if (valid['valid']) {
1295
- if (!selfValidation['valid']) {
1296
- input.captionError = selfValidation['message'];
1297
- input.captionType = selfValidation['type'];
1298
- }
1299
- }
1300
- }
1301
- let name = input.name;
1302
- let value = input.captionError;
1303
- !input.hidden && input.captionType == 'error' && (this.returnCaption = [...Array.from(this.returnCaption), { [name]: value }],
1304
- this.isValid = false);
1305
- }
1306
- if (input.name && !this.duplicateInput.includes(input.name)) {
1307
- var itemValue = this.getItemValue(input);
1308
- if (!itemValue || itemValue == undefined || itemValue == null) {
1309
- itemValue = null;
1310
- }
1311
- this.formData[input.name] = itemValue;
1312
- }
1313
- }
1314
- return this.formData;
1315
- }
1316
- async handleChange(e) {
1317
- const isWrapperComponent = this.isWrapperComponent(e.target.tagName);
1318
- const isGroupComponent = this.isGroupComponent(e.target.tagName);
1319
- let target;
1320
- if (isWrapperComponent) {
1321
- target = e.target.getInput && await e.target.getInput() || e.target;
1322
- }
1323
- else if (isGroupComponent) {
1324
- let req = false;
1325
- const childsCheckbox = utils.getChildElements(e.target, 'bcm-checkbox:not(#bcm-indeterminate-element)');
1326
- childsCheckbox.length > 0 && (childsCheckbox.forEach((element) => {
1327
- if (element && element.required === true) {
1328
- req = true;
1329
- }
1330
- }));
1331
- target = Object.assign(Object.assign({}, e.target), { required: req });
1332
- }
1333
- else {
1334
- target = e.target;
1335
- }
1336
- const value = e.target.value;
1337
- const wrapperComponent = isWrapperComponent && e.target;
1338
- var isPickerValid;
1339
- if (isWrapperComponent) {
1340
- isPickerValid = await wrapperComponent.isValid();
1341
- }
1342
- const tick = setTimeout(() => {
1343
- if (target.required) {
1344
- let valid = null;
1345
- if (isWrapperComponent) {
1346
- valid = validate.required(value, isPickerValid);
1347
- if (valid) {
1348
- if (value instanceof Object) {
1349
- if (value["isValid"] == false) {
1350
- valid = validate.required("", isPickerValid);
1351
- }
1352
- }
1353
- else {
1354
- valid = validate.required(value, isPickerValid);
1355
- }
1356
- }
1357
- }
1358
- else if (isGroupComponent) {
1359
- const childsCheckbox = utils.getChildElements(e.target, 'bcm-checkbox:not(#bcm-indeterminate-element)');
1360
- childsCheckbox.length > 0 && (childsCheckbox.forEach((element) => {
1361
- if (element && element.required === true) {
1362
- valid = validate.required(element.checked);
1363
- if (!valid['valid']) {
1364
- element.noCaption = false;
1365
- element.captionError = valid['message'];
1366
- element.captionType = valid['type'];
1367
- }
1368
- else {
1369
- element.noCaption = e.target.noCaption;
1370
- element.captionError = null;
1371
- element.captionType = "default";
1372
- }
1373
- }
1374
- }));
1375
- }
1376
- else {
1377
- valid = validate.required(value);
1378
- }
1379
- if (valid['valid']) {
1380
- target.captionError = null;
1381
- target.captionType = null;
1382
- }
1383
- else {
1384
- target.captionError = valid['message'];
1385
- target.captionType = valid['type'];
1386
- }
1387
- }
1388
- clearTimeout(tick);
1389
- });
1390
- this.value = await this.userFormData();
1391
- }
1392
- render() {
1393
- const hostClasses = index$2.classnames(this.hidden ? 'hidden' : null);
1394
- return (index$1.h(index$1.Host, { class: hostClasses }, index$1.h("form", { class: "bcm-form", autocomplete: this.autocomplete ? "on" : "off" }, index$1.h("slot", null))));
1395
- }
1396
- get el() { return index$1.getElement(this); }
1397
- };
1398
- __decorate([
1399
- isLoadDecorator.IsLoad()
1400
- ], BcmForm.prototype, "el", void 0);
1401
- BcmForm.style = formCss;
1402
-
1403
- const iconCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}.bcm-icon.hidden{display:none}";
1404
-
1405
- const BcmIcon = class {
1406
- constructor(hostRef) {
1407
- index$1.registerInstance(this, hostRef);
1408
- this.hidden = false;
1409
- this.icon = undefined;
1410
- }
1411
- render() {
1412
- const { icon, hidden } = this;
1413
- return (index$1.h(index$1.Host, { class: `bcm-icon fa ${hidden ? 'hidden' : ''}` }, index$1.h("i", { class: `${icon}` })));
1414
- }
1415
- get el() { return index$1.getElement(this); }
1416
- };
1417
- BcmIcon.style = iconCss;
1418
-
1419
- const labelCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");@import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap\"); .size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}*{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)}";
1420
-
1421
- const BcmLabel = class {
1422
- constructor(hostRef) {
1423
- index$1.registerInstance(this, hostRef);
1424
- this._id = generate.Generate.UID();
1425
- this.required = false;
1426
- this.value = undefined;
1427
- this.size = "medium";
1428
- this.form = undefined;
1429
- this.htmlFor = undefined;
1430
- this.hidden = false;
1431
- this.type = bcm.Bcm.Status.default;
1432
- this.tooltip = undefined;
1433
- }
1434
- render() {
1435
- const { required, value, size, form, htmlFor, hidden, type, tooltip } = this;
1436
- const hostClasses = index$2.classnames('bcm-label', { hidden });
1437
- const Label = (index$1.h(labelTemplate.LabelTemplate, { form: form, htmlFor: htmlFor, value: value, size: size, type: type, required: required }));
1438
- return (index$1.h(index$1.Host, { class: hostClasses }, Label, tooltip && (index$1.h("bcm-tooltip", { message: tooltip, placement: 'top', trigger: 'hover' }, index$1.h("bcm-icon", { icon: "far fa-question-circle" })))));
1439
- }
1440
- get el() { return index$1.getElement(this); }
1441
- };
1442
- BcmLabel.style = labelCss;
1443
-
1444
- const BcmTooltip = class {
1445
- constructor(hostRef) {
1446
- index$1.registerInstance(this, hostRef);
1447
- this.bcmTooltipShow = index$1.createEvent(this, "bcmTooltipShow", 7);
1448
- this.bcmTooltipHide = index$1.createEvent(this, "bcmTooltipHide", 7);
1449
- this._id = generate.Generate.UID();
1450
- this.message = "";
1451
- this.placement = bcm.Bcm$1.Placement.top;
1452
- this.trigger = bcm.Bcm$1.TriggerType.click;
1453
- this.open = false;
1454
- this.color = "slate";
1455
- this.size = bcm.Bcm$1.Size.medium;
1456
- this.openDelay = 0;
1457
- this.closeDelay = 0;
1458
- this.autoHide = false;
1459
- this.targetId = undefined;
1460
- this.tooltip = undefined;
1461
- }
1462
- emitShow() {
1463
- this.bcmTooltipShow.emit();
1464
- }
1465
- emitHide() {
1466
- this.bcmTooltipHide.emit();
1467
- }
1468
- connectedCallback() {
1469
- this.tooltip = new tooltipHelper.Tooltip({
1470
- targetId: this.targetId || this._id,
1471
- message: this.message,
1472
- placement: this.placement,
1473
- color: this.color,
1474
- trigger: this.trigger,
1475
- size: this.size,
1476
- openDelay: this.openDelay,
1477
- closeDelay: this.closeDelay,
1478
- autoHide: this.autoHide,
1479
- emitShow: () => this.emitShow(),
1480
- emitHide: () => this.emitHide(),
1481
- });
1482
- }
1483
- componentDidLoad() {
1484
- this.tooltip.listener();
1485
- }
1486
- componentDidRender() {
1487
- this.tooltip.message = this.message;
1488
- this.tooltip.placement = this.placement;
1489
- this.tooltip.color = this.color;
1490
- this.tooltip.trigger = this.trigger;
1491
- this.tooltip.size = this.size;
1492
- this.tooltip.openDelay = this.openDelay;
1493
- this.tooltip.closeDelay = this.closeDelay;
1494
- this.tooltip.autoHide = this.autoHide;
1495
- this.tooltip.update();
1496
- }
1497
- disconnectedCallback() {
1498
- this.tooltip.destroy();
1499
- }
1500
- async show() {
1501
- this.tooltip.show();
1502
- }
1503
- async hide() {
1504
- this.tooltip.hide();
1505
- }
1506
- async toggle() {
1507
- this.tooltip.toggle();
1508
- }
1509
- render() {
1510
- return (index$1.h(index$1.Host, { "aria-describedby": "tooltip", class: "tw-inline-flex tw-h-fit tw-w-fit" }, index$1.h("slot", null)));
1511
- }
1512
- get el() { return index$1.getElement(this); }
1513
- };
1514
-
1515
- exports.bcm_button = BcmButton;
1516
- exports.bcm_checkbox = BcmCheckbox;
1517
- exports.bcm_checkbox_group = BcmCheckboxGroup;
1518
- exports.bcm_form = BcmForm;
1519
- exports.bcm_icon = BcmIcon;
1520
- exports.bcm_label = BcmLabel;
1521
- exports.bcm_tooltip = BcmTooltip;