bromcom-ui 2.3.54 → 2.3.58

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 (212) hide show
  1. package/dist/bromcom-ui/bromcom-ui.css +0 -0
  2. package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
  3. package/dist/bromcom-ui/index.esm.js +0 -0
  4. package/dist/bromcom-ui/p-12493dbc.entry.js +1 -0
  5. package/dist/bromcom-ui/{p-a18a0cc4.entry.js → p-13d038f5.entry.js} +1 -1
  6. package/dist/bromcom-ui/p-1429a2b4.js +1 -0
  7. package/dist/bromcom-ui/{p-4b7f14ed.entry.js → p-20d03fa1.entry.js} +1 -1
  8. package/dist/bromcom-ui/{p-774ff4d9.entry.js → p-30c1cd7f.entry.js} +1 -1
  9. package/dist/bromcom-ui/p-37750343.entry.js +1 -0
  10. package/dist/bromcom-ui/p-3f797656.entry.js +1 -0
  11. package/dist/bromcom-ui/{p-4396ee3b.entry.js → p-4092f5f1.entry.js} +1 -1
  12. package/dist/bromcom-ui/p-4a41ef80.entry.js +1 -0
  13. package/dist/bromcom-ui/p-4cb268d2.js +1 -0
  14. package/dist/bromcom-ui/p-53e9b679.entry.js +1 -0
  15. package/dist/bromcom-ui/{p-09753e05.js → p-554d326a.js} +1 -1
  16. package/dist/bromcom-ui/p-68ff64de.js +1 -0
  17. package/dist/bromcom-ui/p-7238d22f.entry.js +1 -0
  18. package/dist/bromcom-ui/p-7f1cd976.entry.js +1 -0
  19. package/dist/bromcom-ui/p-811c24d7.entry.js +1 -0
  20. package/dist/bromcom-ui/p-8851e01e.entry.js +1 -0
  21. package/dist/bromcom-ui/{p-1a2724a0.entry.js → p-92e3e240.entry.js} +1 -1
  22. package/dist/bromcom-ui/p-9ffff762.entry.js +1 -0
  23. package/dist/bromcom-ui/p-a6ef098a.entry.js +1 -0
  24. package/dist/bromcom-ui/p-af7e4741.entry.js +1 -0
  25. package/dist/bromcom-ui/{p-0d336381.entry.js → p-afb68492.entry.js} +1 -1
  26. package/dist/bromcom-ui/p-bbf99620.entry.js +1 -0
  27. package/dist/bromcom-ui/p-bc50aa86.entry.js +1 -0
  28. package/dist/bromcom-ui/p-e21a8f2d.entry.js +1 -0
  29. package/dist/bromcom-ui/p-e450ebda.entry.js +1 -0
  30. package/dist/bromcom-ui/p-e8307da9.entry.js +1 -0
  31. package/dist/bromcom-ui/{p-26b3d5d0.entry.js → p-e8771d32.entry.js} +1 -1
  32. package/dist/bromcom-ui/p-f067821e.entry.js +1 -0
  33. package/dist/bromcom-ui/p-f12743d8.entry.js +1 -0
  34. package/dist/bromcom-ui/p-ff5e57d3.entry.js +1 -0
  35. package/dist/cjs/bcm-alert.cjs.entry.js +7 -26
  36. package/dist/cjs/bcm-badge.cjs.entry.js +50 -0
  37. package/dist/cjs/{bcm-badge_20.cjs.entry.js → bcm-button_11.cjs.entry.js} +1209 -2835
  38. package/dist/cjs/bcm-checkbox-lite_4.cjs.entry.js +291 -0
  39. package/dist/cjs/bcm-colorpicker.cjs.entry.js +3 -3
  40. package/dist/cjs/{bcm-datetime-picker_2.cjs.entry.js → bcm-datetime-picker.cjs.entry.js} +3 -137
  41. package/dist/cjs/bcm-dropdown.cjs.entry.js +1 -1
  42. package/dist/cjs/bcm-list-item_2.cjs.entry.js +197 -0
  43. package/dist/cjs/bcm-list-select.cjs.entry.js +658 -0
  44. package/dist/cjs/bcm-list.cjs.entry.js +1204 -0
  45. package/dist/cjs/{bcm-empty_6.cjs.entry.js → bcm-listbox_5.cjs.entry.js} +10 -77
  46. package/dist/cjs/bcm-modal.cjs.entry.js +197 -0
  47. package/dist/cjs/bcm-popconfirm-box.cjs.entry.js +1 -1
  48. package/dist/cjs/bcm-popconfirm.cjs.entry.js +2 -2
  49. package/dist/cjs/bcm-popover-box.cjs.entry.js +1 -1
  50. package/dist/cjs/bcm-popover.cjs.entry.js +2 -2
  51. package/dist/cjs/bcm-pulldown-group_2.cjs.entry.js +1 -1
  52. package/dist/cjs/bcm-pulldown.cjs.entry.js +1 -1
  53. package/dist/cjs/bcm-radio-group.cjs.entry.js +124 -0
  54. package/dist/cjs/bcm-radio.cjs.entry.js +104 -0
  55. package/dist/cjs/bcm-select.cjs.entry.js +68 -8
  56. package/dist/cjs/bcm-tab-pane.cjs.entry.js +51 -0
  57. package/dist/cjs/bcm-tab.cjs.entry.js +72 -0
  58. package/dist/cjs/bcm-tabs-content.cjs.entry.js +43 -0
  59. package/dist/cjs/bcm-tabs.cjs.entry.js +361 -0
  60. package/dist/cjs/bcm-text.cjs.entry.js +28 -0
  61. package/dist/cjs/bcm-upload.cjs.entry.js +1 -1
  62. package/dist/cjs/bromcom-ui.cjs.js +1 -1
  63. package/dist/cjs/{element-dragger-36fcb296.js → element-dragger-4a91c708.js} +1 -1
  64. package/dist/cjs/loader.cjs.js +1 -1
  65. package/dist/cjs/types-37c8ced6.js +16 -0
  66. package/dist/cjs/types-f53bc841.js +19 -0
  67. package/dist/cjs/{utils-43fda566.js → utils-60414768.js} +25 -0
  68. package/dist/collection/collection-manifest.json +1 -0
  69. package/dist/collection/components/atoms/label/label.css +70 -0
  70. package/dist/collection/components/atoms/label/label.js +203 -0
  71. package/dist/collection/components/molecules/checkbox/group.js +19 -6
  72. package/dist/collection/components/molecules/input/input.js +39 -7
  73. package/dist/collection/components/molecules/list/list-item.css +1 -0
  74. package/dist/collection/components/molecules/list/list-select.css +10 -5
  75. package/dist/collection/components/molecules/list/list-select.js +232 -34
  76. package/dist/collection/components/molecules/list/list.css +24 -2
  77. package/dist/collection/components/molecules/list/list.js +391 -119
  78. package/dist/collection/components/molecules/popconfirm/popconfirm-box.css +1 -0
  79. package/dist/collection/components/molecules/popconfirm/popconfirm.css +1 -0
  80. package/dist/collection/components/molecules/popover/popover-box.css +1 -0
  81. package/dist/collection/components/molecules/popover/popover.css +1 -0
  82. package/dist/collection/components/molecules/radio/group.js +19 -6
  83. package/dist/collection/components/molecules/search/search.js +2 -2
  84. package/dist/collection/components/molecules/select/select.js +85 -12
  85. package/dist/collection/components/molecules/switch/switch.css +0 -1
  86. package/dist/collection/components/molecules/switch/switch.js +20 -7
  87. package/dist/collection/components/molecules/textarea/textarea.css +4 -1
  88. package/dist/collection/components/molecules/textarea/textarea.js +33 -17
  89. package/dist/collection/components/molecules/tooltip/tooltip-box.css +1 -0
  90. package/dist/collection/components/molecules/tooltip/tooltip.css +1 -0
  91. package/dist/collection/components/organism/colorpicker/colorpicker.js +19 -6
  92. package/dist/collection/components/organism/datetime-picker/datetime-picker.js +1 -1
  93. package/dist/collection/components/organism/form/form.js +5 -4
  94. package/dist/collection/components/organism/listbox/listbox.js +27 -17
  95. package/dist/collection/helper/color-helper.js +33 -0
  96. package/dist/collection/helper/generate.js +47 -0
  97. package/dist/collection/helper/number-helper.js +10 -0
  98. package/dist/collection/helper/string-helper.js +21 -0
  99. package/dist/collection/helper/validators.js +21 -0
  100. package/dist/collection/models/bcm-types.js +1 -0
  101. package/dist/collection/models/bcm.js +451 -0
  102. package/dist/collection/templates/caption-template.js +22 -0
  103. package/dist/collection/templates/label-template.js +16 -0
  104. package/dist/collection/templates/slot-template.js +6 -0
  105. package/dist/collection/utils/utils.js +24 -0
  106. package/dist/esm/bcm-alert.entry.js +1 -20
  107. package/dist/esm/bcm-badge.entry.js +46 -0
  108. package/dist/esm/{bcm-badge_20.entry.js → bcm-button_11.entry.js} +1204 -2821
  109. package/dist/esm/bcm-checkbox-lite_4.entry.js +284 -0
  110. package/dist/esm/bcm-colorpicker.entry.js +3 -3
  111. package/dist/esm/{bcm-datetime-picker_2.entry.js → bcm-datetime-picker.entry.js} +4 -137
  112. package/dist/esm/bcm-dropdown.entry.js +1 -1
  113. package/dist/esm/bcm-list-item_2.entry.js +192 -0
  114. package/dist/esm/bcm-list-select.entry.js +654 -0
  115. package/dist/esm/bcm-list.entry.js +1200 -0
  116. package/dist/esm/{bcm-empty_6.entry.js → bcm-listbox_5.entry.js} +12 -78
  117. package/dist/esm/bcm-modal.entry.js +193 -0
  118. package/dist/esm/bcm-popconfirm-box.entry.js +1 -1
  119. package/dist/esm/bcm-popconfirm.entry.js +2 -2
  120. package/dist/esm/bcm-popover-box.entry.js +1 -1
  121. package/dist/esm/bcm-popover.entry.js +2 -2
  122. package/dist/esm/bcm-pulldown-group_2.entry.js +1 -1
  123. package/dist/esm/bcm-pulldown.entry.js +1 -1
  124. package/dist/esm/bcm-radio-group.entry.js +120 -0
  125. package/dist/esm/bcm-radio.entry.js +100 -0
  126. package/dist/esm/bcm-select.entry.js +68 -8
  127. package/dist/esm/bcm-tab-pane.entry.js +47 -0
  128. package/dist/esm/bcm-tab.entry.js +68 -0
  129. package/dist/esm/bcm-tabs-content.entry.js +39 -0
  130. package/dist/esm/bcm-tabs.entry.js +357 -0
  131. package/dist/esm/bcm-text.entry.js +24 -0
  132. package/dist/esm/bcm-upload.entry.js +1 -1
  133. package/dist/esm/bromcom-ui.js +1 -1
  134. package/dist/esm/{element-dragger-03ac2a5e.js → element-dragger-97a8f373.js} +1 -1
  135. package/dist/esm/loader.js +1 -1
  136. package/dist/esm/polyfills/css-shim.js +0 -0
  137. package/dist/esm/types-4b11eac9.js +28 -0
  138. package/dist/esm/types-911a8837.js +21 -0
  139. package/dist/esm/{utils-b7fba7c4.js → utils-de9aee67.js} +25 -1
  140. package/dist/types/assets/icons/index.d.ts +0 -0
  141. package/dist/types/assets/icons/index.example.d.ts +0 -0
  142. package/dist/types/components/atoms/avatar/avatar.d.ts +0 -0
  143. package/dist/types/components/atoms/badge/badge.d.ts +0 -0
  144. package/dist/types/components/atoms/button/button.d.ts +0 -0
  145. package/dist/types/components/atoms/divider/divider.d.ts +0 -0
  146. package/dist/types/components/atoms/icon/icon.d.ts +0 -0
  147. package/dist/types/components/atoms/icon/types.d.ts +0 -0
  148. package/dist/types/components/atoms/label/label.d.ts +16 -0
  149. package/dist/types/components/atoms/tag/tag.d.ts +0 -0
  150. package/dist/types/components/atoms/text/text.d.ts +0 -0
  151. package/dist/types/components/molecules/card/card-footer.d.ts +0 -0
  152. package/dist/types/components/molecules/card/card-header.d.ts +0 -0
  153. package/dist/types/components/molecules/card/card.d.ts +0 -0
  154. package/dist/types/components/molecules/checkbox/checkbox.d.ts +0 -0
  155. package/dist/types/components/molecules/checkbox/group.d.ts +1 -0
  156. package/dist/types/components/molecules/input/input.d.ts +2 -0
  157. package/dist/types/components/molecules/list/list-select.d.ts +24 -4
  158. package/dist/types/components/molecules/list/list.d.ts +13 -3
  159. package/dist/types/components/molecules/radio/group.d.ts +1 -0
  160. package/dist/types/components/molecules/radio/radio.d.ts +0 -0
  161. package/dist/types/components/molecules/select/group.d.ts +0 -0
  162. package/dist/types/components/molecules/select/option.d.ts +0 -0
  163. package/dist/types/components/molecules/select/select.d.ts +1 -0
  164. package/dist/types/components/molecules/switch/switch.d.ts +1 -0
  165. package/dist/types/components/molecules/textarea/textarea.d.ts +3 -2
  166. package/dist/types/components/organism/colorpicker/colorpicker.d.ts +1 -0
  167. package/dist/types/components/organism/listbox/listbox.d.ts +1 -0
  168. package/dist/types/components.d.ts +95 -12
  169. package/dist/types/global/variables/colors.d.ts +0 -0
  170. package/dist/types/helper/color-helper.d.ts +9 -0
  171. package/dist/types/helper/generate.d.ts +10 -0
  172. package/dist/types/helper/number-helper.d.ts +9 -0
  173. package/dist/types/helper/string-helper.d.ts +20 -0
  174. package/dist/types/helper/validators.d.ts +8 -0
  175. package/dist/types/index.d.ts +0 -0
  176. package/dist/types/models/bcm-types.d.ts +19 -0
  177. package/dist/types/models/bcm.d.ts +447 -0
  178. package/dist/types/stencil-public-runtime.d.ts +0 -0
  179. package/dist/types/templates/caption-template.d.ts +12 -0
  180. package/dist/types/templates/label-template.d.ts +12 -0
  181. package/dist/types/templates/slot-template.d.ts +8 -0
  182. package/dist/types/utils/utils.d.ts +1 -0
  183. package/loader/cdn.js +0 -0
  184. package/loader/index.cjs.js +0 -0
  185. package/loader/index.d.ts +0 -0
  186. package/loader/index.es2017.js +0 -0
  187. package/loader/index.js +0 -0
  188. package/loader/package.json +0 -0
  189. package/package.json +1 -1
  190. package/dist/bromcom-ui/p-013b6f5d.entry.js +0 -1
  191. package/dist/bromcom-ui/p-0532e299.entry.js +0 -1
  192. package/dist/bromcom-ui/p-0aa53bdb.entry.js +0 -1
  193. package/dist/bromcom-ui/p-2c1ee381.entry.js +0 -1
  194. package/dist/bromcom-ui/p-607bc9b3.entry.js +0 -1
  195. package/dist/bromcom-ui/p-6355c903.entry.js +0 -1
  196. package/dist/bromcom-ui/p-6bd805f1.entry.js +0 -1
  197. package/dist/bromcom-ui/p-77a480ff.entry.js +0 -1
  198. package/dist/bromcom-ui/p-a88256f2.entry.js +0 -1
  199. package/dist/bromcom-ui/p-b92324e7.js +0 -1
  200. package/dist/bromcom-ui/p-ba219861.entry.js +0 -1
  201. package/dist/bromcom-ui/p-cdfd9ba0.entry.js +0 -1
  202. package/dist/bromcom-ui/p-cf6b0656.entry.js +0 -1
  203. package/dist/cjs/bcm-checkbox-group.cjs.entry.js +0 -273
  204. package/dist/cjs/bcm-checkbox.cjs.entry.js +0 -143
  205. package/dist/cjs/bcm-switch.cjs.entry.js +0 -86
  206. package/dist/cjs/bcm-textarea.cjs.entry.js +0 -136
  207. package/dist/cjs/bcm-tooltip-box.cjs.entry.js +0 -36
  208. package/dist/esm/bcm-checkbox-group.entry.js +0 -269
  209. package/dist/esm/bcm-checkbox.entry.js +0 -139
  210. package/dist/esm/bcm-switch.entry.js +0 -82
  211. package/dist/esm/bcm-textarea.entry.js +0 -132
  212. package/dist/esm/bcm-tooltip-box.entry.js +0 -32
@@ -5,47 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-ce8878ec.js');
6
6
  const index$1 = require('./index-2f62bdaf.js');
7
7
  const colors = require('./colors-7fb8d76f.js');
8
- const utils = require('./utils-43fda566.js');
9
-
10
- const badgeCss = "@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}:host{display:inline-block}:host(.hidden){display:none}.success{background-color:#52C41A}.error{background-color:#F5222D}.default{background-color:#D9D9D9}.processing{background-color:#4293CF}.warning{background-color:#FA8C16}.badge-basic{padding:0 8px;border:1px solid #FFFFFF;color:var(--bcm-color-grey-1);border-radius:16px;font-size:14px;height:22px;display:inline-flex;align-items:center;justify-content:center}.badge-info{display:inline-flex;align-items:center}.badge-text{color:var(--bcm-color-grey-7);font-size:14px}.badge-dot{display:inline-block;width:8px;height:8px;border:1px solid #FFFFFF;margin-right:8px;border-radius:100%;box-sizing:border-box;margin-bottom:1px}.badge-dot.basic.medium{width:12px;height:12px;margin-bottom:-1px;line-height:1}.badge-dot.basic.large{width:16px;height:16px;margin-bottom:-1px;line-height:1}";
11
-
12
- /**
13
- * @desc
14
- * @param str
15
- */
16
- const lowercase = (str) => str.toLowerCase();
17
- const BcmBadge = class {
18
- constructor(hostRef) {
19
- index.registerInstance(this, hostRef);
20
- this.type = 'basic';
21
- this.status = this.type === 'basic' ? 'error' : 'default';
22
- this.hidden = false;
23
- this.color = null;
24
- this.size = 'small';
25
- }
26
- handleColor(color) {
27
- var returnColor;
28
- if (color) {
29
- if (color.match(/^#[a-f0-9]{6}$/i) !== null || lowercase(color.substring(0, 3)) === "rgb") {
30
- returnColor = color;
31
- }
32
- else {
33
- returnColor = utils.extractColor(colors.ColorPalette, color);
34
- }
35
- return { backgroundColor: returnColor };
36
- }
37
- }
38
- render() {
39
- const dotClass = index$1.classnames('badge-dot', this.status, this.type, this.size);
40
- if (this.type === 'info') {
41
- return (index.h("div", { class: "badge-info" }, index.h("span", { class: dotClass, style: this.handleColor(this.color) }), index.h("span", { class: "badge-text" }, index.h("slot", null))));
42
- }
43
- const hostClasses = index$1.classnames(this.hidden ? 'hidden' : null);
44
- return (index.h(index.Host, { class: hostClasses }, !this.value ? index.h("span", { class: dotClass, style: this.handleColor(this.color) })
45
- : (index.h("span", { class: `badge-basic ${this.status}` }, " ", this.value, " "))));
46
- }
47
- };
48
- BcmBadge.style = badgeCss;
8
+ const utils = require('./utils-60414768.js');
9
+ const types = require('./types-37c8ced6.js');
10
+ const popoverPlacement = require('./popover-placement-ac023521.js');
49
11
 
50
12
  /**
51
13
  * 'type' prop variantOption
@@ -285,64 +247,403 @@ const BcmButton = class {
285
247
  };
286
248
  BcmButton.style = buttonsCss;
287
249
 
250
+ /**
251
+ * 'color' prop predefined values
252
+ */
253
+ var ColorProps;
254
+ (function (ColorProps) {
255
+ ColorProps["black"] = "black";
256
+ ColorProps["white"] = "white";
257
+ ColorProps["prime-blue"] = "prime-blue";
258
+ ColorProps["grey"] = "grey";
259
+ ColorProps["blue"] = "blue";
260
+ ColorProps["warmyellow"] = "warmyellow";
261
+ ColorProps["yellow"] = "yellow";
262
+ ColorProps["limegreen"] = "limegreen";
263
+ ColorProps["red"] = "red";
264
+ ColorProps["darkorange"] = "darkorange";
265
+ ColorProps["orange"] = "orange";
266
+ ColorProps["green"] = "green";
267
+ ColorProps["turquosie"] = "turquosie";
268
+ ColorProps["cobaltblue"] = "cobaltblue";
269
+ ColorProps["magenta"] = "magenta";
270
+ ColorProps["purple"] = "purple";
271
+ ColorProps["bc-red"] = "bc-red";
272
+ ColorProps["bc-blue"] = "bc-blue";
273
+ ColorProps["bc-green"] = "bc-green";
274
+ ColorProps["bc-orange"] = "bc-orange";
275
+ })(ColorProps || (ColorProps = {}));
276
+
288
277
  const checkboxCss = "@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}.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}:host{display:inline-block}:host(.hidden){display:none}input{display:none}.svg-icon{filter:brightness(0) invert(1);width:12px;height:12px}label{display:flex;align-items:flex-start;font-size:14px;color:var(--bcm-color-grey-8);cursor:pointer}label span.icon{display:flex;align-items:center;justify-content:center;min-width:16px;min-height:16px;border:1px solid #D9D9D9;margin-right:8px;border-radius:2px;margin-top:2px;background-color:var(--bcm-color-grey-1)}:host(.indeterminate) label span.icon{position:relative}:host(.indeterminate) label span.icon::after{content:\"\";position:absolute;top:50%;left:8px;width:10px;height:10px;background-color:var(--bcm-color-prime-blue-6);transform:translate(-50%, -50%);opacity:1;z-index:1}:host(.indeterminate) label span.icon::before{content:\"\";position:absolute;top:-1px;left:-1px;width:16px;height:100%;border-radius:2px;background-color:var(--bcm-color-grey-1);border:1px solid var(--bcm-color-grey-5);opacity:1;z-index:1}:host(.indeterminate) label span.icon:hover:not(.disabled):before{border-color:var(--bcm-color-prime-blue-6);box-shadow:0px 2px 4px rgba(54, 121, 171, 0.5)}input:checked+label span.icon{background-color:var(--bcm-color-prime-blue-6);border-color:transparent}input:checked+label .icon-checked{display:block}bcm-icon{filter:brightness(0) invert(1)}input[disabled]+label{cursor:not-allowed}input[disabled]+label span.icon{background-color:var(--bcm-color-grey-3);border-color:var(--bcm-color-grey-5)}input[disabled]+label bcm-icon{filter:brightness(0);opacity:0.3}input:not([disabled])+label:hover span.icon{border-color:var(--bcm-color-prime-blue-6);box-shadow:0px 2px 4px rgba(54, 121, 171, 0.5)}:host(.error) input:not([disabled])+label span.icon{border-color:var(--bcm-color-red-6)}.caption-area{margin-bottom:8px;min-height:20px;display:block}.input-caption{display:block}.caption-default{color:#8C8C8C}.caption-primary{color:#4293CF}.caption-success{color:#52C41A}.caption-warning{color:#FA8C16}.caption-error{color:#F5222D}.radio-button{background-color:var(--bcm-color-grey-1);color:var(--bcm-color-grey-8);border:1px solid var(--bcm-color-grey-5);padding:0 16px;box-sizing:border-box;display:flex;align-items:center;justify-content:center}.radio-button>span.icon{display:none}.radio-button>span.slot{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;user-select:none}.radio-button:hover:not(.disabled){color:var(--bcm-color-prime-blue-5)}.radio-button:active:not(.disabled){color:var(--bcm-color-prime-blue-7)}.radio-button.disabled{background-color:var(--bcm-color-grey-3);color:var(--bcm-color-grey-6);cursor:not-allowed}.radio-button.checked.disabled{background-color:var(--bcm-color-grey-4);color:var(--bcm-color-grey-1);border-color:var(--bcm-color-grey-5)}.radio-button.checked.solid{color:var(--bcm-color-grey-1);background-color:var(--bcm-color-prime-blue-6);border-color:var(--bcm-color-prime-blue-6)}.radio-button.checked.solid:hover{background-color:var(--bcm-color-prime-blue-5);border-color:var(--bcm-color-prime-blue-5)}.radio-button.checked.solid:active{background-color:var(--bcm-color-prime-blue-7);border-color:var(--bcm-color-prime-blue-7)}.radio-button.checked.outline{background-color:var(--bcm-color-grey-1);color:var(--bcm-color-prime-blue-6);border-color:var(--bcm-color-prime-blue-6)}.radio-button.checked.outline:hover{color:var(--bcm-color-prime-blue-5);border-color:var(--bcm-color-prime-blue-5)}.radio-button.checked.outline:active{color:var(--bcm-color-prime-blue-7);border-color:var(--bcm-color-prime-blue-7)}.radio-button.large{height:40px}.radio-button.medium{height:32px}.radio-button.small{height:24px}";
289
278
 
290
- const BcmCheckboxLite = class {
279
+ const BcmCheckbox = class {
291
280
  constructor(hostRef) {
292
281
  index.registerInstance(this, hostRef);
282
+ this.blur = index.createEvent(this, "bcm-blur", 7);
283
+ this.focus = index.createEvent(this, "bcm-focus", 7);
284
+ this.change = index.createEvent(this, "bcm-change", 7);
293
285
  /**
294
286
  * Component Properties
295
287
  */
296
288
  this.value = '';
297
289
  this.name = 'checkbox';
298
290
  this.checked = false;
299
- this.indeterminate = false;
300
291
  this.disabled = false;
301
292
  this.readOnly = false;
302
293
  this.hidden = false;
303
294
  this.required = false;
295
+ this.optionType = 'default';
296
+ this.buttonStyle = 'solid';
297
+ this.size = 'medium';
304
298
  this.noCaption = false;
305
299
  this.captionType = 'default';
306
300
  }
307
- connectedCallback() { }
308
- disconnectedCallback() { }
309
- componentWillLoad() { }
310
- componentDidLoad() { }
311
- componentWillRender() { }
312
- componentDidRender() { }
313
- componentWillUpdate() { }
314
- componentDidUpdate() { }
301
+ /**
302
+ * @ComponentMethod
303
+ */
304
+ connectedCallback() {
305
+ this.handleChange = this.handleChange.bind(this);
306
+ this.captionCache = this.caption;
307
+ this.captionTypeCache = this.captionType;
308
+ }
309
+ async setClear() {
310
+ if (this.inputElement.checked == true) {
311
+ this.inputElement.checked = false;
312
+ this.handleChange();
313
+ }
314
+ }
315
+ async resetCaption() {
316
+ this.caption = this.captionCache;
317
+ this.captionType = this.captionTypeCache;
318
+ this.captionError = null;
319
+ }
320
+ componentDidLoad() {
321
+ this.value = this.inputElement.checked;
322
+ this.checked = this.value;
323
+ }
324
+ /**
325
+ * @desc
326
+ * @param event
327
+ * @returns
328
+ */
329
+ handleChange() {
330
+ this.value = this.inputElement.checked;
331
+ this.checked = this.value;
332
+ this.change.emit({
333
+ name: this.name,
334
+ value: this.value
335
+ });
336
+ }
337
+ handleFocus() {
338
+ this.focus.emit();
339
+ }
340
+ handleBlur() {
341
+ this.blur.emit();
342
+ }
343
+ /**
344
+ * @desc
345
+ * @param name -
346
+ * @returns {void}
347
+ */
348
+ async check(uncheck) {
349
+ this.inputElement.checked = uncheck;
350
+ this.handleChange();
351
+ }
352
+ getColor(color) {
353
+ if (this.color !== 'default' && this.optionType == 'button' && this.checked)
354
+ return {
355
+ // color: extractColor(ColorPalette, ColorProps[color] + '-6'),
356
+ borderColor: utils.extractColor(colors.ColorPalette, ColorProps[color] + '-5'),
357
+ backgroundColor: utils.extractColor(colors.ColorPalette, ColorProps[color] + '-5')
358
+ };
359
+ }
315
360
  render() {
316
- const { disabled, checked, readOnly, name, required } = this;
361
+ const { disabled, checked, readOnly, name, handleChange, required, caption, captionError, captionType, noCaption, buttonStyle, size, optionType } = this;
317
362
  const hostClasses = index$1.classnames(this.hidden ? 'hidden' : null, {
318
- 'indeterminate': this.indeterminate
363
+ 'error': captionType == 'error' ? true : false
364
+ });
365
+ const captionClasses = index$1.classnames('size-1', 'input-caption', 'caption-' + captionType);
366
+ const defaultClasses = index$1.classnames();
367
+ const buttonClasses = index$1.classnames('radio-button', buttonStyle, size, {
368
+ 'size-2': size === 'small' || size === 'medium',
369
+ 'size-3': size === 'large',
370
+ 'checked': checked,
371
+ 'disabled': disabled,
319
372
  });
320
- const iconClasses = index$1.classnames('icon');
321
- return (index.h(index.Host, { class: hostClasses }, index.h("input", { id: name, type: "checkbox", checked: checked, disabled: disabled, required: required, readOnly: readOnly }), index.h("label", { htmlFor: name }, index.h("span", { class: iconClasses }, index.h("svg", { class: "svg-icon icon-checked", width: "11", height: "9", viewBox: "0 0 11 9", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { d: "M1.91308 4.03516H1.91326C1.99256 4.03525 2.07081 4.05331 2.14213 4.08798C2.21341 4.12262 2.27591 4.17295 2.32497 4.2352L1.91308 4.03516ZM1.91308 4.03516H1.09394C0.890308 4.03516 0.776602 4.26975 0.902321 4.4292L0.902371 4.42927L4.11214 8.49567L4.11218 8.49573C4.32247 8.76188 4.72568 8.76114 4.93667 8.49617L4.93708 8.49566L10.6597 1.24398C10.6598 1.24378 10.66 1.24358 10.6602 1.24338C10.7884 1.08295 10.6699 0.85 10.4689 0.85H9.6498C9.48941 0.85 9.33668 0.9235 9.2376 1.05044C9.23751 1.05055 9.23742 1.05066 9.23734 1.05077L4.52403 7.02157M1.91308 4.03516L4.52403 7.02157M4.52403 7.02157L2.32506 4.23531L4.52403 7.02157Z", fill: "#BFBFBF", stroke: "#BFBFBF", "stroke-width": "0.3" }))))));
373
+ var fontColor = utils.extractColor(colors.ColorPalette, ColorProps[this.color] + '-6');
374
+ var style = "<style>.radio-button:not(.checked):hover{color: " + fontColor + "} </style>";
375
+ return (index.h(index.Host, { class: hostClasses, onFocus: () => this.handleFocus(), onBlur: () => this.handleBlur() }, index.h("input", { id: name, type: "checkbox", checked: checked, disabled: disabled, required: required, readOnly: readOnly, onChange: handleChange, ref: el => (this.inputElement = el) }), optionType == 'button' && (index.h("span", { innerHTML: style })), index.h("label", { title: optionType == 'button' ? this.el.innerHTML : null, htmlFor: name, class: optionType == 'default' ? defaultClasses : buttonClasses, style: this.getColor(this.color) }, index.h("span", { class: "icon" }, index.h("bcm-icon", { class: "icon-checked", icon: "component-check", size: "small", type: "default" })), index.h("span", { class: "slot" }, index.h("slot", null))), !noCaption && (index.h("div", { class: "caption-area" }, captionType == "error"
376
+ ? index.h("span", { class: captionClasses }, " ", captionError, " ")
377
+ : caption && index.h("span", { class: captionClasses }, " ", caption, " ")))));
322
378
  }
323
379
  get el() { return index.getElement(this); }
324
380
  };
325
- BcmCheckboxLite.style = checkboxCss;
381
+ BcmCheckbox.style = checkboxCss;
326
382
 
327
- const dividerCss = "@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}:host{display:flex;justify-content:center}:host(.hidden){display:none}.divider{background-color:var(--bcm-color-grey-5)}.divider.horizontal{height:1px;margin:4px 0}.divider.vertical{height:100%;width:1px;margin:0 4px}";
383
+ 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}:host{display:block;width:100%}:host(.hidden){display:none}:host(.error) .label{color:var(--bcm-color-red-6) !important}.group-container{display:flex;gap:24px}.group-container.vertical{gap:unset;flex-direction:column}.group-container.button{gap:unset}.group-container.full-width{max-width:100%}.indeterminate{padding:0 0 16px 0;margin-bottom:16px;border-bottom:1px solid #efefef;}.indeterminate input{display:none}.indeterminate label{display:flex;align-items:center;font-size:14px;color:var(--bcm-color-grey-8);cursor:pointer}.indeterminate label .icon-checked{display:none}.indeterminate span{position:relative;display:flex;align-items:center;justify-content:center;width:16px;height:16px;border:1px solid #D9D9D9;margin-right:8px;border-radius:2px}.indeterminate span:after{content:\"\";position:absolute;top:50%;left:50%;width:10px;height:10px;background-color:var(--bcm-color-prime-blue-6);transform:translate(-50%, -50%);opacity:0}.indeterminate bcm-icon{filter:brightness(0) invert(1)}.indeterminate input[disabled]+label{cursor:not-allowed}.indeterminate input[disabled]+label span{background-color:var(--bcm-color-grey-3);border-color:var(--bcm-color-grey-5)}.indeterminate input[disabled]+label span:after{background-color:var(--bcm-color-grey-6)}.indeterminate input[disabled]+label bcm-icon{filter:brightness(0);opacity:0.3}.indeterminate input:not([disabled])+label:hover span{border-color:var(--bcm-color-prime-blue-6);box-shadow:0px 2px 4px rgba(54, 121, 171, 0.5)}.indeterminate.bcm-uncheck label span{background-color:#ffffff}.indeterminate.bcm-determinate bcm-icon{display:block}.indeterminate.bcm-determinate label span{background-color:var(--bcm-color-prime-blue-6);border-color:transparent}.indeterminate.bcm-determinate label span:after{opacity:0}.indeterminate.bcm-indeterminate bcm-icon{display:none !important}.indeterminate.bcm-indeterminate label span{background-color:#ffffff}.indeterminate.bcm-indeterminate label span:after{opacity:1}.label{display:flex;flex-direction:column;color:var(--bcm-color-grey-9);margin-bottom:8px}";
328
384
 
329
- const BcmBadge$1 = class {
385
+ const BcmCheckboxGroup = class {
330
386
  constructor(hostRef) {
331
387
  index.registerInstance(this, hostRef);
388
+ this.groupChange = index.createEvent(this, "bcm-group-change", 7);
389
+ this.groupCheckedList = index.createEvent(this, "bcm-group-checked-list", 7);
390
+ /**
391
+ * Private variables
392
+ */
393
+ this.checkboxes = [];
394
+ /**
395
+ * Component Properties
396
+ */
332
397
  this.direction = 'horizontal';
333
- this.width = '100';
398
+ this.items = [];
399
+ this.indeterminate = false;
400
+ this.disabled = false;
334
401
  this.hidden = false;
402
+ this.required = false;
403
+ this.label = null;
404
+ this.gap = null;
405
+ this.fullWidth = "false";
406
+ this.optionType = 'default';
407
+ this.buttonStyle = 'solid';
408
+ this.size = 'medium';
409
+ this.noCaption = false;
410
+ this.captionType = 'default';
411
+ /**
412
+ * Component State Variables
413
+ */
414
+ this.indeterminateState = 'uncheck';
415
+ this.checkboxesProp = [];
416
+ }
417
+ /**
418
+ * @ComponentMethod
419
+ */
420
+ componentWillLoad() {
421
+ this.parseItems(this.items);
422
+ this.parseOptions();
423
+ }
424
+ /**
425
+ * @ComponentMethod
426
+ */
427
+ connectedCallback() { }
428
+ componentDidLoad() {
429
+ let checkboxesInit = [];
430
+ checkboxesInit = this.getAllInputs();
431
+ checkboxesInit.map(checkbox => {
432
+ if (this.fullWidth != "false") {
433
+ if (this.fullWidth === "flex") {
434
+ checkbox.style.flex = "auto";
435
+ }
436
+ else {
437
+ checkbox.style.width = "100%";
438
+ }
439
+ }
440
+ this.optionType && (checkbox.optionType = this.optionType);
441
+ this.buttonStyle && (checkbox.buttonStyle = this.buttonStyle);
442
+ this.size && (checkbox.size = this.size);
443
+ // this.required == true && checkbox.required == true && (
444
+ // checkbox.required = true
445
+ // )
446
+ this.disabled == true && (checkbox.disabled = true);
447
+ });
448
+ this.groupChecked().then(values => this.value = values);
449
+ }
450
+ async setClear() {
451
+ const checkboxesInit = this.getAllInputs();
452
+ checkboxesInit.map(checkbox => {
453
+ checkbox.setClear();
454
+ checkbox.noCaption = this.noCaption;
455
+ });
456
+ }
457
+ async resetCaption() {
458
+ const checkboxesInit = this.getAllInputs();
459
+ checkboxesInit.map(checkbox => {
460
+ checkbox.resetCaption();
461
+ checkbox.noCaption = this.noCaption;
462
+ });
463
+ }
464
+ /**
465
+ * @ComponentMethod
466
+ */
467
+ componentDidRender() {
468
+ let slotElements;
469
+ slotElements = this.el.shadowRoot.querySelector('slot').assignedElements();
470
+ this.checkboxes = [];
471
+ // Get only bcm-checkbox elements from
472
+ // slot childs
473
+ slotElements.map(element => {
474
+ String(element.tagName).toLowerCase() == 'bcm-checkbox'
475
+ && this.checkboxes.push(element);
476
+ });
477
+ this.setIndeterminateState();
478
+ if (this.items.length > 0) {
479
+ let checkboxesInit = [];
480
+ checkboxesInit = this.getAllInputs();
481
+ checkboxesInit.map(checkbox => {
482
+ this.defaultValueState && (this.defaultValueState.find(e => e === checkbox.name) && checkbox.check(checkbox.name));
483
+ });
484
+ }
485
+ }
486
+ componentDidUpdate() {
487
+ this.handleChange();
488
+ }
489
+ /**
490
+ * @desc
491
+ */
492
+ inputChange() {
493
+ this.groupChecked().then(values => this.value = values);
494
+ this.setIndeterminateState();
495
+ }
496
+ /**
497
+ * @desc Returns merged slot and prop
498
+ * checkbox items
499
+ * @returns {Array<BcmCheckbox>}
500
+ */
501
+ getAllInputs() {
502
+ return [
503
+ ...this.checkboxes,
504
+ ...this.el.shadowRoot.querySelectorAll('bcm-checkbox')
505
+ ];
506
+ }
507
+ /**
508
+ * @desc
509
+ * @returns {void}
510
+ */
511
+ setIndeterminateState() {
512
+ let state = 'uncheck';
513
+ let allChecked = true;
514
+ let allUnchecked = true;
515
+ this.getAllInputs().map((checkbox) => {
516
+ checkbox.checked && (allUnchecked = false);
517
+ !checkbox.checked && (allChecked = false);
518
+ });
519
+ !allChecked && !allUnchecked
520
+ ? state = 'indeterminate'
521
+ : allChecked
522
+ ? state = 'determinate'
523
+ : state = 'uncheck';
524
+ this.indeterminateState = state;
525
+ }
526
+ /**
527
+ * @desc
528
+ * @param event
529
+ */
530
+ indeterminateClick() {
531
+ if (this.disabled == false) {
532
+ let checkAll = true;
533
+ if (this.indeterminateState == 'determinate') {
534
+ checkAll = false;
535
+ }
536
+ this.getAllInputs().map((checkbox) => {
537
+ checkbox.check(checkAll);
538
+ });
539
+ }
540
+ }
541
+ parseOptions() {
542
+ if (this.defaultValue) {
543
+ this.defaultValueState = JSON.parse(this.defaultValue);
544
+ }
545
+ }
546
+ /**
547
+ * @desc
548
+ * @param newValue
549
+ * @returns {void}
550
+ */
551
+ parseItems(newValue) {
552
+ if (newValue) {
553
+ typeof newValue == 'string'
554
+ ? this.checkboxesProp = JSON.parse(newValue)
555
+ : this.checkboxesProp = newValue;
556
+ }
557
+ }
558
+ /**
559
+ * @desc
560
+ * @param name -
561
+ * @returns {boolean | Array<any>}
562
+ */
563
+ async check(options) {
564
+ if (options) {
565
+ typeof options == 'string'
566
+ ? options = JSON.parse(options)
567
+ : options = options;
568
+ }
569
+ let checkboxes = [];
570
+ checkboxes = this.getAllInputs();
571
+ const inBoth = (list1, list2) => list1.filter(a => true === list2.some(b => a.name === b.name));
572
+ let optionsArray = options;
573
+ inBoth(checkboxes, options).map(item => {
574
+ item.check(optionsArray.find(x => x.name === item.name).checked);
575
+ });
576
+ }
577
+ /**
578
+ * @desc
579
+ * @param name -
580
+ * @returns {boolean | Array<any>}
581
+ */
582
+ async groupChecked(name) {
583
+ let retVal = null;
584
+ let checkeds = {};
585
+ let checkboxes = [];
586
+ if (typeof retVal != 'boolean' && !retVal) {
587
+ retVal = checkeds;
588
+ }
589
+ // Merge slotted items with prop items
590
+ // #
591
+ checkboxes = this.getAllInputs();
592
+ checkboxes.map(checkbox => {
593
+ checkbox.checked && (checkeds[checkbox.name] = {
594
+ value: true,
595
+ name: checkbox.name
596
+ });
597
+ !checkbox.checked && (checkeds[checkbox.name] = {
598
+ value: false,
599
+ name: checkbox.name
600
+ });
601
+ if (checkbox.name === name) {
602
+ retVal = checkbox.checked;
603
+ }
604
+ });
605
+ return retVal;
606
+ }
607
+ handleChange() {
608
+ let checkeds = {};
609
+ let changes = {};
610
+ let checkboxes = [];
611
+ checkboxes = this.getAllInputs();
612
+ checkboxes.map(checkbox => {
613
+ checkbox.checked && (checkeds[checkbox.name] = {
614
+ value: true,
615
+ name: checkbox.name
616
+ });
617
+ changes[checkbox.name] = {
618
+ value: checkbox.checked ? true : false,
619
+ name: checkbox.name
620
+ };
621
+ });
622
+ this.groupChange.emit(changes);
623
+ this.groupCheckedList.emit(checkeds);
335
624
  }
336
625
  render() {
337
- const classes = index$1.classnames('divider', this.direction);
338
- const styles = {
339
- width: this.width + '%'
340
- };
341
- const hostClasses = index$1.classnames(this.hidden ? 'hidden' : null);
342
- return (index.h(index.Host, { class: hostClasses }, index.h("div", { class: classes, style: this.direction === 'horizontal' && styles })));
626
+ const { checkboxesProp, indeterminate, disabled, label, required, captionType } = this;
627
+ const groupContainerClasses = index$1.classnames('group-container', this.direction, this.optionType, this.fullWidth, {
628
+ 'full-width': this.fullWidth
629
+ });
630
+ const indeterminateClasses = index$1.classnames('indeterminate', 'bcm-' + this.indeterminateState, {
631
+ 'disabled': disabled
632
+ });
633
+ const hostClasses = index$1.classnames(this.hidden ? 'hidden' : null, {
634
+ 'error': captionType == 'error' ? true : false
635
+ });
636
+ var customStyle = {};
637
+ this.gap && (customStyle = { 'gap': this.gap });
638
+ return (index.h(index.Host, { class: hostClasses, "on-bcm-change": () => this.inputChange() }, label && index.h("div", null, index.h("bcm-label", { tooltip: this.tooltip, type: captionType, value: label, required: required })), indeterminate && (index.h("div", { class: indeterminateClasses }, index.h("input", { id: "bcm-indeterminate-element", type: "checkbox", disabled: disabled }), index.h("label", { htmlFor: "bcm-indeterminate-element", "on-click": () => this.indeterminateClick() }, index.h("span", null, index.h("bcm-icon", { class: "icon-checked", icon: "component-check", size: "small", type: "default" })), "Check All"))), index.h("div", { class: groupContainerClasses, style: customStyle }, checkboxesProp && this.checkboxesProp.map((checkbox) => index.h("bcm-checkbox", { name: checkbox.name, checked: checkbox.checked, disabled: checkbox.disabled, required: this.required === true && checkbox.required === true && (true), noCaption: this.noCaption, optionType: this.optionType, buttonStyle: this.buttonStyle, size: this.size, "full-width": this.fullWidth }, checkbox.label)), index.h("slot", null))));
343
639
  }
640
+ get el() { return index.getElement(this); }
641
+ static get watchers() { return {
642
+ "defaultValue": ["parseOptions"],
643
+ "items": ["parseItems"]
644
+ }; }
344
645
  };
345
- BcmBadge$1.style = dividerCss;
646
+ BcmCheckboxGroup.style = groupCss;
346
647
 
347
648
  // /**
348
649
  // *
@@ -387,7 +688,7 @@ const formCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:40
387
688
  * @desc
388
689
  * @param str
389
690
  */
390
- const lowercase$1 = (str) => str.toLowerCase();
691
+ const lowercase = (str) => str.toLowerCase();
391
692
  const BcmForm = class {
392
693
  constructor(hostRef) {
393
694
  index.registerInstance(this, hostRef);
@@ -430,7 +731,7 @@ const BcmForm = class {
430
731
  this.name = "";
431
732
  }
432
733
  handleSubmit(e) {
433
- if (lowercase$1(e.target.nodeName) === 'bcm-button') {
734
+ if (lowercase(e.target.nodeName) === 'bcm-button') {
434
735
  if (e.target.type === 'submit') {
435
736
  this.submitFunction();
436
737
  }
@@ -511,12 +812,12 @@ const BcmForm = class {
511
812
  const rootInputs = inputs.filter((input) => !input['s-hn']);
512
813
  rootInputs.forEach(element => {
513
814
  var item = element;
514
- if (lowercase$1(item.nodeName) == "bcm-checkbox-group") {
815
+ if (lowercase(item.nodeName) == "bcm-checkbox-group") {
515
816
  item.querySelectorAll("bcm-checkbox").forEach(element => {
516
817
  this.duplicateInput.push(element.name);
517
818
  });
518
819
  }
519
- if (lowercase$1(item.nodeName) == "bcm-form") {
820
+ if (lowercase(item.nodeName) == "bcm-form") {
520
821
  // console.log(item)
521
822
  const groupInputs = Array.from(item.querySelectorAll('bcm-' + Object.values(this.Bromcom.inputComponents).join(',bcm-')));
522
823
  var itemObject;
@@ -550,7 +851,7 @@ const BcmForm = class {
550
851
  return ['bcm-datetime-picker', 'bcm-date-picker', 'bcm-time-picker'].includes(item.toLowerCase());
551
852
  }
552
853
  isGroupComponent(item) {
553
- return ['bcm-checkbox-group', 'bcm-radio-group'].includes(item.toLowerCase());
854
+ return ['bcm-checkbox-group'].includes(item.toLowerCase());
554
855
  }
555
856
  async userFormData() {
556
857
  this.formData = {};
@@ -582,8 +883,9 @@ const BcmForm = class {
582
883
  }
583
884
  }
584
885
  else if (isGroupComponent) {
585
- utils.getChilds(input, "bcm-checkbox").forEach(element => {
586
- if (element.required == true) {
886
+ const childsCheckbox = utils.getChilds(input, "bcm-checkbox");
887
+ childsCheckbox.length > 0 && (childsCheckbox.forEach((element) => {
888
+ if (element && element.required === true) {
587
889
  valid = validate.required(element.value);
588
890
  if (!valid['valid']) {
589
891
  element.noCaption = false;
@@ -596,7 +898,7 @@ const BcmForm = class {
596
898
  element.captionType = "default";
597
899
  }
598
900
  }
599
- });
901
+ }));
600
902
  }
601
903
  else {
602
904
  valid = validate.required(input.value);
@@ -6103,6 +6405,7 @@ const BcmInput = class {
6103
6405
  this.disabled = false;
6104
6406
  this.readonly = false;
6105
6407
  this.clearable = false;
6408
+ this._internal_id = (Math.random() * 4).toString(16).replace('.', '');
6106
6409
  this.unit = null;
6107
6410
  this.unitPrefix = null;
6108
6411
  this.min = null;
@@ -6181,7 +6484,7 @@ const BcmInput = class {
6181
6484
  this.value = '';
6182
6485
  this.inputElement.focus();
6183
6486
  this.change.emit(this.value);
6184
- this.clear.emit();
6487
+ this.clear.emit(e);
6185
6488
  e.stopPropagation();
6186
6489
  }
6187
6490
  changePasswordVisibility() {
@@ -6426,7 +6729,7 @@ const BcmInput = class {
6426
6729
  const inputClass = size === 'large' ? 'size-3' : 'size-2';
6427
6730
  const captionClasses = index$1.classnames('size-1', 'input-caption', 'caption-' + captionType);
6428
6731
  const hostClasses = index$1.classnames(this.hidden ? 'hidden' : null, this.noMargin ? 'no-margin' : null);
6429
- return (index.h(index.Host, { class: hostClasses }, index.h("div", { class: containerClasses }, label && index.h("label", { htmlFor: this.inputId, class: "label size-1" }, " ", label, " ", required && ('*'), " "), index.h("div", { class: baseClasses }, index.h("span", { class: "input-prefix" }, index.h("slot", { name: "prefix" }), unitPrefix && index.h("span", { class: index$1.classnames(inputClass, 'unit-prefix') }, unitPrefix)), index.h("input", { "bcm-internal-id": this._id, id: this.inputId, class: inputClass, ref: el => (this.inputElement = el), onFocus: this.handleFocus, onBlur: this.handleBlur, onChange: this.handleChange, onInput: this.handleInput, maxLength: this.maxLength, type: type === 'password' && isPasswordVisible ? 'text' :
6732
+ return (index.h(index.Host, { class: hostClasses }, index.h("div", { class: containerClasses }, label && index.h("div", null, index.h("bcm-label", { tooltip: this.tooltip, type: captionType, value: label, required: required, htmlFor: this.inputId })), index.h("div", { class: baseClasses }, index.h("span", { class: "input-prefix" }, index.h("slot", { name: "prefix" }), unitPrefix && index.h("span", { class: index$1.classnames(inputClass, 'unit-prefix') }, unitPrefix)), index.h("input", { "bcm-internal-id": this._id, id: this.inputId, class: inputClass, ref: el => (this.inputElement = el), onFocus: this.handleFocus, onBlur: this.handleBlur, onChange: this.handleChange, onInput: this.handleInput, maxLength: this.maxLength, type: type === 'password' && isPasswordVisible ? 'text' :
6430
6733
  type === 'number' ? 'text' : type, placeholder: placeholder, value: type === 'number' && !this.hasFocus
6431
6734
  ? value + (value && (unit === null || unit === void 0 ? void 0 : unit.length) > 0 ? ' ' + unit : '')
6432
6735
  : value, disabled: this.disabled, readonly: this.readonly }), clearable && !this.disabled && (index.h("button", { class: "input-clear-button", onClick: this.handleClear }, index.h("bcm-icon", { icon: "close-circle", type: "fill", size: iconSizes$1[size], color: "grey-7" }))), type === 'password' && passwordToggle && (index.h("button", { class: "input-password-toggle", onClick: this.changePasswordVisibility }, index.h("bcm-icon", { icon: isPasswordVisible ? "eye-invisible" : "eye", type: "outlined", size: iconSizes$1[size], color: "grey-7" }))), Object.keys(defaultIcons).includes(type) && !noDefaultIcon && (index.h("span", { class: "input-suffix default-icon" }, index.h("bcm-icon", { icon: defaultIcons[type], type: "outlined", size: iconSizes$1[size], color: "grey-7" }))), type === 'number' && (index.h("div", { class: index$1.classnames('caret-container', { 'unit': (unit === null || unit === void 0 ? void 0 : unit.length) > 0 }, { 'disabled': inValid }, { 'disabled': readonly }) }, index.h("span", { class: "caret", onClick: inValid == false && this.incrementNumber }, index.h("bcm-icon", { icon: "caret-up", type: "outlined", color: "grey-7", size: 8 })), index.h("span", { class: "caret", onClick: inValid == false && this.decrementNumber }, index.h("bcm-icon", { icon: "caret-down", type: "outlined", color: "grey-7", size: 8 })))), type !== 'number' && (index.h("span", { class: "input-suffix" }, index.h("slot", { name: "suffix" })))), !noCaption && (index.h("div", { class: "caption-area" }, captionType == "error"
@@ -6440,2871 +6743,942 @@ const BcmInput = class {
6440
6743
  };
6441
6744
  BcmInput.style = inputCss;
6442
6745
 
6443
- const listCss = "@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}:host{display:block;position:relative;user-select:none;width:256px}:host main{width:256px;height:256px;background-color:#ffffff;border:1px solid #d9d9d9;box-sizing:border-box;transition:height 1s ease 1s;display:flex;flex-direction:column;position:relative;padding:8px}:host(.full-width){width:100%}:host(.full-width) main{width:100%}:host(.linked){z-index:-999;position:absolute;opacity:0;top:-10000;left:-10000;box-shadow:0px 2px 8px rgba(0, 0, 0, 0.15)}:host(.linked.show){opacity:1;z-index:100000}:host(.flex){width:100%;height:100%}:host(.flex) main{width:100%}:host(.type-autocomplete) .search-container{height:0;margin:0;padding:0;overflow:hidden}.label{display:block;color:var(--bcm-color-grey-9);margin-bottom:4px}.caption-area{min-height:20px}.caption-default{color:#8C8C8C}.caption-primary{color:#4293CF}.caption-success{color:#52C41A}.caption-warning{color:#FA8C16}.caption-error{color:#F5222D}:host(.error) .label{color:var(--bcm-color-red-6) !important}:host(.error) main{border:1px solid var(--bcm-color-red-6) !important}.search-container{margin:0 8px;padding-top:8px;background-color:#ffffff}.search-container+.list-container{padding-top:0}.footer{text-align:right;padding:4px 8px;background-color:var(--bcm-color-grey-3)}.list-container{flex:1;overflow-y:auto;display:flex;flex-direction:column;grid-gap:4px;position:relative}.list-container .list{display:flex;flex-direction:column;grid-gap:4px}.spinner{position:absolute;z-index:1;top:0;opacity:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;background-color:#ffffff;visibility:hidden;transition:opacity 0.3s, visibility 0.5s}.spinner.show{visibility:visible;opacity:0.8}.spinner.first-run{visibility:visible;opacity:0.9}.list-item{padding:8px;color:var(--bcm-color-grey-8);background-color:var(--bcm-color-grey-1);cursor:pointer;display:flex;justify-content:flex-start;align-items:center;flex-direction:row}.list-item:hover:not(.disabled),.list-item:active:not(.disabled){color:var(--bcm-color-prime-blue-6);background-color:var(--bcm-color-prime-blue-1)}.divider{margin:0 8px}";
6746
+ class Generate {
6747
+ }
6748
+ Generate.UID = () => Math.random().toString(36).substr(2, 9);
6749
+ Generate.getIconAttrWithStatusType = (status, loading = false) => {
6750
+ if (loading)
6751
+ return { icon: 'loading', color: 'blue-6' };
6752
+ switch (status) {
6753
+ case types.StatusProps.info:
6754
+ return { color: 'blue-6', icon: 'info-circle' };
6755
+ case types.StatusProps.error:
6756
+ return { color: 'red-6', icon: 'close-circle' };
6757
+ case types.StatusProps.warning:
6758
+ return { color: 'warmyellow-6', icon: 'exclamation-circle' };
6759
+ case types.StatusProps.success:
6760
+ return { color: 'green-6', icon: 'check-circle' };
6761
+ }
6762
+ };
6763
+ Generate.createComponent = (element, props) => {
6764
+ let box = document.createElement(element);
6765
+ Object.keys(props).forEach(key => {
6766
+ box[key] = props[key];
6767
+ });
6768
+ document.body.appendChild(box);
6769
+ return box;
6770
+ };
6771
+ Generate.debounceInput = (func, wait, immediate) => {
6772
+ let timeout;
6773
+ return function () {
6774
+ let context = this, args = arguments;
6775
+ let later = function () {
6776
+ timeout = null;
6777
+ if (!immediate)
6778
+ func.apply(context, args);
6779
+ };
6780
+ let callNow = immediate && !timeout;
6781
+ clearTimeout(timeout);
6782
+ timeout = setTimeout(later, wait);
6783
+ if (callNow)
6784
+ func.apply(context, args);
6785
+ };
6786
+ };
6787
+ Generate.flatArray = (arr) => {
6788
+ return arr.reduce((acc, val) => {
6789
+ return acc.concat(Array.isArray(val) ? Generate.flatArray(val) : val);
6790
+ }, []);
6791
+ };
6792
+
6793
+ var Bcm;
6794
+ (function (Bcm) {
6795
+ let HtmlElementType;
6796
+ (function (HtmlElementType) {
6797
+ HtmlElementType["div"] = "div";
6798
+ HtmlElementType["span"] = "span";
6799
+ HtmlElementType["button"] = "button";
6800
+ HtmlElementType["a"] = "a";
6801
+ HtmlElementType["input"] = "input";
6802
+ HtmlElementType["textarea"] = "textarea";
6803
+ HtmlElementType["select"] = "select";
6804
+ HtmlElementType["option"] = "option";
6805
+ HtmlElementType["img"] = "img";
6806
+ HtmlElementType["table"] = "table";
6807
+ HtmlElementType["tr"] = "tr";
6808
+ HtmlElementType["td"] = "td";
6809
+ HtmlElementType["th"] = "th";
6810
+ HtmlElementType["tbody"] = "tbody";
6811
+ HtmlElementType["thead"] = "thead";
6812
+ HtmlElementType["tfoot"] = "tfoot";
6813
+ HtmlElementType["ul"] = "ul";
6814
+ HtmlElementType["li"] = "li";
6815
+ HtmlElementType["form"] = "form";
6816
+ HtmlElementType["label"] = "label";
6817
+ HtmlElementType["main"] = "main";
6818
+ HtmlElementType["header"] = "header";
6819
+ HtmlElementType["footer"] = "footer";
6820
+ HtmlElementType["section"] = "section";
6821
+ HtmlElementType["article"] = "article";
6822
+ HtmlElementType["nav"] = "nav";
6823
+ HtmlElementType["aside"] = "aside";
6824
+ })(HtmlElementType = Bcm.HtmlElementType || (Bcm.HtmlElementType = {}));
6825
+ let Status;
6826
+ (function (Status) {
6827
+ Status["info"] = "info";
6828
+ Status["error"] = "error";
6829
+ Status["warning"] = "warning";
6830
+ Status["success"] = "success";
6831
+ Status["default"] = "default";
6832
+ })(Status = Bcm.Status || (Bcm.Status = {}));
6833
+ let Shape;
6834
+ (function (Shape) {
6835
+ Shape["ellipse"] = "ellipse";
6836
+ Shape["square"] = "square";
6837
+ })(Shape = Bcm.Shape || (Bcm.Shape = {}));
6838
+ let Direction;
6839
+ (function (Direction) {
6840
+ Direction["horizontal"] = "horizontal";
6841
+ Direction["vertical"] = "vertical";
6842
+ })(Direction = Bcm.Direction || (Bcm.Direction = {}));
6843
+ let PreDefinedIconSize;
6844
+ (function (PreDefinedIconSize) {
6845
+ PreDefinedIconSize[PreDefinedIconSize["large"] = 48] = "large";
6846
+ PreDefinedIconSize[PreDefinedIconSize["medium"] = 24] = "medium";
6847
+ PreDefinedIconSize[PreDefinedIconSize["default"] = 16] = "default";
6848
+ PreDefinedIconSize[PreDefinedIconSize["small"] = 12] = "small";
6849
+ PreDefinedIconSize[PreDefinedIconSize["xsmall"] = 8] = "xsmall";
6850
+ })(PreDefinedIconSize = Bcm.PreDefinedIconSize || (Bcm.PreDefinedIconSize = {}));
6851
+ let IconSize;
6852
+ (function (IconSize) {
6853
+ IconSize["small"] = "16";
6854
+ IconSize["medium"] = "20";
6855
+ IconSize["large"] = "24";
6856
+ })(IconSize = Bcm.IconSize || (Bcm.IconSize = {}));
6857
+ let Size;
6858
+ (function (Size) {
6859
+ Size["small"] = "small";
6860
+ Size["medium"] = "medium";
6861
+ Size["large"] = "large";
6862
+ Size["xsmall"] = "xsmall";
6863
+ Size["xlarge"] = "xlarge";
6864
+ Size["xxlarge"] = "xxlarge";
6865
+ Size["xxxlarge"] = "xxxlarge";
6866
+ })(Size = Bcm.Size || (Bcm.Size = {}));
6867
+ let Kind;
6868
+ (function (Kind) {
6869
+ Kind["solid"] = "solid";
6870
+ Kind["ghost"] = "ghost";
6871
+ Kind["link"] = "link";
6872
+ Kind["solid-link"] = "solid-link";
6873
+ Kind["ghost-link"] = "ghost-link";
6874
+ })(Kind = Bcm.Kind || (Bcm.Kind = {}));
6875
+ let ButtonType;
6876
+ (function (ButtonType) {
6877
+ ButtonType["button"] = "button";
6878
+ ButtonType["reset"] = "reset";
6879
+ ButtonType["submit"] = "submit";
6880
+ })(ButtonType = Bcm.ButtonType || (Bcm.ButtonType = {}));
6881
+ let IconPosition;
6882
+ (function (IconPosition) {
6883
+ IconPosition["prefix"] = "prefix";
6884
+ IconPosition["suffix"] = "suffix";
6885
+ })(IconPosition = Bcm.IconPosition || (Bcm.IconPosition = {}));
6886
+ let TagType;
6887
+ (function (TagType) {
6888
+ TagType["basic"] = "basic";
6889
+ TagType["add"] = "add";
6890
+ TagType["checkable"] = "checkable";
6891
+ TagType["dissmisable"] = "dissmisable";
6892
+ })(TagType = Bcm.TagType || (Bcm.TagType = {}));
6893
+ let FontSize;
6894
+ (function (FontSize) {
6895
+ FontSize["size-1"] = "size-1";
6896
+ FontSize["size-2"] = "size-2";
6897
+ FontSize["size-3"] = "size-3";
6898
+ FontSize["size-4"] = "size-4";
6899
+ FontSize["size-5"] = "size-5";
6900
+ FontSize["size-6"] = "size-6";
6901
+ FontSize["size-7"] = "size-7";
6902
+ FontSize["size-8"] = "size-8";
6903
+ FontSize["size-9"] = "size-9";
6904
+ })(FontSize = Bcm.FontSize || (Bcm.FontSize = {}));
6905
+ let FontSizeValue;
6906
+ (function (FontSizeValue) {
6907
+ FontSizeValue[FontSizeValue["size-1"] = 12] = "size-1";
6908
+ FontSizeValue[FontSizeValue["size-2"] = 14] = "size-2";
6909
+ FontSizeValue[FontSizeValue["size-3"] = 16] = "size-3";
6910
+ FontSizeValue[FontSizeValue["size-4"] = 20] = "size-4";
6911
+ FontSizeValue[FontSizeValue["size-5"] = 24] = "size-5";
6912
+ FontSizeValue[FontSizeValue["size-6"] = 30] = "size-6";
6913
+ FontSizeValue[FontSizeValue["size-7"] = 38] = "size-7";
6914
+ FontSizeValue[FontSizeValue["size-8"] = 46] = "size-8";
6915
+ FontSizeValue[FontSizeValue["size-9"] = 56] = "size-9";
6916
+ })(FontSizeValue = Bcm.FontSizeValue || (Bcm.FontSizeValue = {}));
6917
+ let FontWeight;
6918
+ (function (FontWeight) {
6919
+ FontWeight["thin"] = "thin";
6920
+ FontWeight["light"] = "light";
6921
+ FontWeight["regular"] = "regular";
6922
+ FontWeight["medium"] = "medium";
6923
+ FontWeight["bold"] = "bold";
6924
+ FontWeight["black"] = "black";
6925
+ })(FontWeight = Bcm.FontWeight || (Bcm.FontWeight = {}));
6926
+ let ColorPalette;
6927
+ (function (ColorPalette) {
6928
+ ColorPalette["default"] = "default";
6929
+ ColorPalette["black"] = "black";
6930
+ ColorPalette["white"] = "white";
6931
+ ColorPalette["prime-blue"] = "prime-blue";
6932
+ ColorPalette["prime-blue-1"] = "prime-blue-1";
6933
+ ColorPalette["prime-blue-2"] = "prime-blue-2";
6934
+ ColorPalette["prime-blue-3"] = "prime-blue-3";
6935
+ ColorPalette["prime-blue-4"] = "prime-blue-4";
6936
+ ColorPalette["prime-blue-5"] = "prime-blue-5";
6937
+ ColorPalette["prime-blue-6"] = "prime-blue-6";
6938
+ ColorPalette["prime-blue-7"] = "prime-blue-7";
6939
+ ColorPalette["prime-blue-8"] = "prime-blue-8";
6940
+ ColorPalette["prime-blue-9"] = "prime-blue-9";
6941
+ ColorPalette["prime-blue-10"] = "prime-blue-10";
6942
+ ColorPalette["grey"] = "grey";
6943
+ ColorPalette["grey-1"] = "grey-1";
6944
+ ColorPalette["grey-2"] = "grey-2";
6945
+ ColorPalette["grey-3"] = "grey-3";
6946
+ ColorPalette["grey-4"] = "grey-4";
6947
+ ColorPalette["grey-5"] = "grey-5";
6948
+ ColorPalette["grey-6"] = "grey-6";
6949
+ ColorPalette["grey-7"] = "grey-7";
6950
+ ColorPalette["grey-8"] = "grey-8";
6951
+ ColorPalette["grey-9"] = "grey-9";
6952
+ ColorPalette["grey-10"] = "grey-10";
6953
+ ColorPalette["blue"] = "blue";
6954
+ ColorPalette["blue-1"] = "blue-1";
6955
+ ColorPalette["blue-2"] = "blue-2";
6956
+ ColorPalette["blue-3"] = "blue-3";
6957
+ ColorPalette["blue-4"] = "blue-4";
6958
+ ColorPalette["blue-5"] = "blue-5";
6959
+ ColorPalette["blue-6"] = "blue-6";
6960
+ ColorPalette["blue-7"] = "blue-7";
6961
+ ColorPalette["blue-8"] = "blue-8";
6962
+ ColorPalette["blue-9"] = "blue-9";
6963
+ ColorPalette["blue-10"] = "blue-10";
6964
+ ColorPalette["warmyellow"] = "warmyellow";
6965
+ ColorPalette["warmyellow-1"] = "warmyellow-1";
6966
+ ColorPalette["warmyellow-2"] = "warmyellow-2";
6967
+ ColorPalette["warmyellow-3"] = "warmyellow-3";
6968
+ ColorPalette["warmyellow-4"] = "warmyellow-4";
6969
+ ColorPalette["warmyellow-5"] = "warmyellow-5";
6970
+ ColorPalette["warmyellow-6"] = "warmyellow-6";
6971
+ ColorPalette["warmyellow-7"] = "warmyellow-7";
6972
+ ColorPalette["warmyellow-8"] = "warmyellow-8";
6973
+ ColorPalette["warmyellow-9"] = "warmyellow-9";
6974
+ ColorPalette["warmyellow-10"] = "warmyellow-10";
6975
+ ColorPalette["yellow"] = "yellow";
6976
+ ColorPalette["yellow-1"] = "yellow-1";
6977
+ ColorPalette["yellow-2"] = "yellow-2";
6978
+ ColorPalette["yellow-3"] = "yellow-3";
6979
+ ColorPalette["yellow-4"] = "yellow-4";
6980
+ ColorPalette["yellow-5"] = "yellow-5";
6981
+ ColorPalette["yellow-6"] = "yellow-6";
6982
+ ColorPalette["yellow-7"] = "yellow-7";
6983
+ ColorPalette["yellow-8"] = "yellow-8";
6984
+ ColorPalette["yellow-9"] = "yellow-9";
6985
+ ColorPalette["yellow-10"] = "yellow-10";
6986
+ ColorPalette["limegreen"] = "limegreen";
6987
+ ColorPalette["limegreen-1"] = "limegreen-1";
6988
+ ColorPalette["limegreen-2"] = "limegreen-2";
6989
+ ColorPalette["limegreen-3"] = "limegreen-3";
6990
+ ColorPalette["limegreen-4"] = "limegreen-4";
6991
+ ColorPalette["limegreen-5"] = "limegreen-5";
6992
+ ColorPalette["limegreen-6"] = "limegreen-6";
6993
+ ColorPalette["limegreen-7"] = "limegreen-7";
6994
+ ColorPalette["limegreen-8"] = "limegreen-8";
6995
+ ColorPalette["limegreen-9"] = "limegreen-9";
6996
+ ColorPalette["limegreen-10"] = "limegreen-10";
6997
+ ColorPalette["red"] = "red";
6998
+ ColorPalette["red-1"] = "red-1";
6999
+ ColorPalette["red-2"] = "red-2";
7000
+ ColorPalette["red-3"] = "red-3";
7001
+ ColorPalette["red-4"] = "red-4";
7002
+ ColorPalette["red-5"] = "red-5";
7003
+ ColorPalette["red-6"] = "red-6";
7004
+ ColorPalette["red-7"] = "red-7";
7005
+ ColorPalette["red-8"] = "red-8";
7006
+ ColorPalette["red-9"] = "red-9";
7007
+ ColorPalette["red-10"] = "red-10";
7008
+ ColorPalette["darkorange"] = "darkorange";
7009
+ ColorPalette["darkorange-1"] = "darkorange-1";
7010
+ ColorPalette["darkorange-2"] = "darkorange-2";
7011
+ ColorPalette["darkorange-3"] = "darkorange-3";
7012
+ ColorPalette["darkorange-4"] = "darkorange-4";
7013
+ ColorPalette["darkorange-5"] = "darkorange-5";
7014
+ ColorPalette["darkorange-6"] = "darkorange-6";
7015
+ ColorPalette["darkorange-7"] = "darkorange-7";
7016
+ ColorPalette["darkorange-8"] = "darkorange-8";
7017
+ ColorPalette["darkorange-9"] = "darkorange-9";
7018
+ ColorPalette["darkorange-10"] = "darkorange-10";
7019
+ ColorPalette["orange"] = "orange";
7020
+ ColorPalette["orange-1"] = "orange-1";
7021
+ ColorPalette["orange-2"] = "orange-2";
7022
+ ColorPalette["orange-3"] = "orange-3";
7023
+ ColorPalette["orange-4"] = "orange-4";
7024
+ ColorPalette["orange-5"] = "orange-5";
7025
+ ColorPalette["orange-6"] = "orange-6";
7026
+ ColorPalette["orange-7"] = "orange-7";
7027
+ ColorPalette["orange-8"] = "orange-8";
7028
+ ColorPalette["orange-9"] = "orange-9";
7029
+ ColorPalette["orange-10"] = "orange-10";
7030
+ ColorPalette["green"] = "green";
7031
+ ColorPalette["green-1"] = "green-1";
7032
+ ColorPalette["green-2"] = "green-2";
7033
+ ColorPalette["green-3"] = "green-3";
7034
+ ColorPalette["green-4"] = "green-4";
7035
+ ColorPalette["green-5"] = "green-5";
7036
+ ColorPalette["green-6"] = "green-6";
7037
+ ColorPalette["green-7"] = "green-7";
7038
+ ColorPalette["green-8"] = "green-8";
7039
+ ColorPalette["green-9"] = "green-9";
7040
+ ColorPalette["green-10"] = "green-10";
7041
+ ColorPalette["turquosie"] = "turquosie";
7042
+ ColorPalette["turquosie-1"] = "turquosie-1";
7043
+ ColorPalette["turquosie-2"] = "turquosie-2";
7044
+ ColorPalette["turquosie-3"] = "turquosie-3";
7045
+ ColorPalette["turquosie-4"] = "turquosie-4";
7046
+ ColorPalette["turquosie-5"] = "turquosie-5";
7047
+ ColorPalette["turquosie-6"] = "turquosie-6";
7048
+ ColorPalette["turquosie-7"] = "turquosie-7";
7049
+ ColorPalette["turquosie-8"] = "turquosie-8";
7050
+ ColorPalette["turquosie-9"] = "turquosie-9";
7051
+ ColorPalette["turquosie-10"] = "turquosie-10";
7052
+ ColorPalette["cobaltblue"] = "cobaltblue";
7053
+ ColorPalette["cobaltblue-1"] = "cobaltblue-1";
7054
+ ColorPalette["cobaltblue-2"] = "cobaltblue-2";
7055
+ ColorPalette["cobaltblue-3"] = "cobaltblue-3";
7056
+ ColorPalette["cobaltblue-4"] = "cobaltblue-4";
7057
+ ColorPalette["cobaltblue-5"] = "cobaltblue-5";
7058
+ ColorPalette["cobaltblue-6"] = "cobaltblue-6";
7059
+ ColorPalette["cobaltblue-7"] = "cobaltblue-7";
7060
+ ColorPalette["cobaltblue-8"] = "cobaltblue-8";
7061
+ ColorPalette["cobaltblue-9"] = "cobaltblue-9";
7062
+ ColorPalette["cobaltblue-10"] = "cobaltblue-10";
7063
+ ColorPalette["magenta"] = "magenta";
7064
+ ColorPalette["magenta-1"] = "magenta-1";
7065
+ ColorPalette["magenta-2"] = "magenta-2";
7066
+ ColorPalette["magenta-3"] = "magenta-3";
7067
+ ColorPalette["magenta-4"] = "magenta-4";
7068
+ ColorPalette["magenta-5"] = "magenta-5";
7069
+ ColorPalette["magenta-6"] = "magenta-6";
7070
+ ColorPalette["magenta-7"] = "magenta-7";
7071
+ ColorPalette["magenta-8"] = "magenta-8";
7072
+ ColorPalette["magenta-9"] = "magenta-9";
7073
+ ColorPalette["magenta-10"] = "magenta-10";
7074
+ ColorPalette["purple"] = "purple";
7075
+ ColorPalette["purple-1"] = "purple-1";
7076
+ ColorPalette["purple-2"] = "purple-2";
7077
+ ColorPalette["purple-3"] = "purple-3";
7078
+ ColorPalette["purple-4"] = "purple-4";
7079
+ ColorPalette["purple-5"] = "purple-5";
7080
+ ColorPalette["purple-6"] = "purple-6";
7081
+ ColorPalette["purple-7"] = "purple-7";
7082
+ ColorPalette["purple-8"] = "purple-8";
7083
+ ColorPalette["purple-9"] = "purple-9";
7084
+ ColorPalette["purple-10"] = "purple-10";
7085
+ ColorPalette["bc-red"] = "bc-red";
7086
+ ColorPalette["bc-red-1"] = "bc-red-1";
7087
+ ColorPalette["bc-red-2"] = "bc-red-2";
7088
+ ColorPalette["bc-red-3"] = "bc-red-3";
7089
+ ColorPalette["bc-red-4"] = "bc-red-4";
7090
+ ColorPalette["bc-red-5"] = "bc-red-5";
7091
+ ColorPalette["bc-red-6"] = "bc-red-6";
7092
+ ColorPalette["bc-red-7"] = "bc-red-7";
7093
+ ColorPalette["bc-red-8"] = "bc-red-8";
7094
+ ColorPalette["bc-red-9"] = "bc-red-9";
7095
+ ColorPalette["bc-blue"] = "bc-blue";
7096
+ ColorPalette["bc-blue-1"] = "bc-blue-1";
7097
+ ColorPalette["bc-blue-2"] = "bc-blue-2";
7098
+ ColorPalette["bc-blue-3"] = "bc-blue-3";
7099
+ ColorPalette["bc-blue-4"] = "bc-blue-4";
7100
+ ColorPalette["bc-blue-5"] = "bc-blue-5";
7101
+ ColorPalette["bc-blue-6"] = "bc-blue-6";
7102
+ ColorPalette["bc-blue-7"] = "bc-blue-7";
7103
+ ColorPalette["bc-blue-8"] = "bc-blue-8";
7104
+ ColorPalette["bc-blue-9"] = "bc-blue-9";
7105
+ ColorPalette["bc-green"] = "bc-green";
7106
+ ColorPalette["bc-green-1"] = "bc-green-1";
7107
+ ColorPalette["bc-green-2"] = "bc-green-2";
7108
+ ColorPalette["bc-green-3"] = "bc-green-3";
7109
+ ColorPalette["bc-green-4"] = "bc-green-4";
7110
+ ColorPalette["bc-green-5"] = "bc-green-5";
7111
+ ColorPalette["bc-green-6"] = "bc-green-6";
7112
+ ColorPalette["bc-green-7"] = "bc-green-7";
7113
+ ColorPalette["bc-green-8"] = "bc-green-8";
7114
+ ColorPalette["bc-green-9"] = "bc-green-9";
7115
+ ColorPalette["bc-orange"] = "bc-orange";
7116
+ ColorPalette["bc-orange-1"] = "bc-orange-1";
7117
+ ColorPalette["bc-orange-2"] = "bc-orange-2";
7118
+ ColorPalette["bc-orange-3"] = "bc-orange-3";
7119
+ ColorPalette["bc-orange-4"] = "bc-orange-4";
7120
+ ColorPalette["bc-orange-5"] = "bc-orange-5";
7121
+ ColorPalette["bc-orange-6"] = "bc-orange-6";
7122
+ ColorPalette["bc-orange-7"] = "bc-orange-7";
7123
+ ColorPalette["bc-orange-8"] = "bc-orange-8";
7124
+ ColorPalette["bc-orange-9"] = "bc-orange-9";
7125
+ })(ColorPalette = Bcm.ColorPalette || (Bcm.ColorPalette = {}));
7126
+ let InputType;
7127
+ (function (InputType) {
7128
+ InputType["text"] = "text";
7129
+ InputType["number"] = "number";
7130
+ InputType["email"] = "email";
7131
+ InputType["password"] = "password";
7132
+ InputType["url"] = "url";
7133
+ InputType["search"] = "search";
7134
+ InputType["tel"] = "tel";
7135
+ InputType["hidden"] = "hidden";
7136
+ })(InputType = Bcm.InputType || (Bcm.InputType = {}));
7137
+ let KeyCode;
7138
+ (function (KeyCode) {
7139
+ KeyCode[KeyCode["backspace"] = 8] = "backspace";
7140
+ KeyCode[KeyCode["tab"] = 9] = "tab";
7141
+ KeyCode[KeyCode["enter"] = 13] = "enter";
7142
+ KeyCode[KeyCode["shift"] = 16] = "shift";
7143
+ KeyCode[KeyCode["ctrl"] = 17] = "ctrl";
7144
+ KeyCode[KeyCode["alt"] = 18] = "alt";
7145
+ KeyCode[KeyCode["pause"] = 19] = "pause";
7146
+ KeyCode[KeyCode["capslock"] = 20] = "capslock";
7147
+ KeyCode[KeyCode["escape"] = 27] = "escape";
7148
+ KeyCode[KeyCode["space"] = 32] = "space";
7149
+ KeyCode[KeyCode["pageup"] = 33] = "pageup";
7150
+ KeyCode[KeyCode["pagedown"] = 34] = "pagedown";
7151
+ KeyCode[KeyCode["end"] = 35] = "end";
7152
+ KeyCode[KeyCode["home"] = 36] = "home";
7153
+ KeyCode[KeyCode["left"] = 37] = "left";
7154
+ KeyCode[KeyCode["up"] = 38] = "up";
7155
+ KeyCode[KeyCode["right"] = 39] = "right";
7156
+ KeyCode[KeyCode["down"] = 40] = "down";
7157
+ KeyCode[KeyCode["insert"] = 45] = "insert";
7158
+ KeyCode[KeyCode["delete"] = 46] = "delete";
7159
+ KeyCode[KeyCode["f1"] = 112] = "f1";
7160
+ KeyCode[KeyCode["f2"] = 113] = "f2";
7161
+ KeyCode[KeyCode["f3"] = 114] = "f3";
7162
+ KeyCode[KeyCode["f4"] = 115] = "f4";
7163
+ KeyCode[KeyCode["f5"] = 116] = "f5";
7164
+ KeyCode[KeyCode["f6"] = 117] = "f6";
7165
+ KeyCode[KeyCode["f7"] = 118] = "f7";
7166
+ KeyCode[KeyCode["f8"] = 119] = "f8";
7167
+ KeyCode[KeyCode["f9"] = 120] = "f9";
7168
+ KeyCode[KeyCode["f10"] = 121] = "f10";
7169
+ KeyCode[KeyCode["f11"] = 122] = "f11";
7170
+ KeyCode[KeyCode["f12"] = 123] = "f12";
7171
+ KeyCode[KeyCode["numlock"] = 144] = "numlock";
7172
+ KeyCode[KeyCode["scrolllock"] = 145] = "scrolllock";
7173
+ KeyCode[KeyCode["semicolon"] = 186] = "semicolon";
7174
+ KeyCode[KeyCode["equal"] = 187] = "equal";
7175
+ KeyCode[KeyCode["comma"] = 188] = "comma";
7176
+ KeyCode[KeyCode["dash"] = 189] = "dash";
7177
+ KeyCode[KeyCode["period"] = 190] = "period";
7178
+ KeyCode[KeyCode["slash"] = 191] = "slash";
7179
+ KeyCode[KeyCode["backslash"] = 220] = "backslash";
7180
+ KeyCode[KeyCode["bracketleft"] = 219] = "bracketleft";
7181
+ KeyCode[KeyCode["bracketright"] = 221] = "bracketright";
7182
+ KeyCode[KeyCode["quote"] = 222] = "quote";
7183
+ KeyCode[KeyCode["backtick"] = 192] = "backtick";
7184
+ KeyCode[KeyCode["a"] = 65] = "a";
7185
+ })(KeyCode = Bcm.KeyCode || (Bcm.KeyCode = {}));
7186
+ Bcm.FormErrorMessages = {
7187
+ 'email': 'Please enter a valid email address',
7188
+ 'password': 'Please enter a valid password',
7189
+ 'url': 'Please enter a valid URL',
7190
+ 'phone': 'Please enter a valid phone number',
7191
+ 'search': 'Please enter a valid search term',
7192
+ 'number': 'Please enter a valid number',
7193
+ 'text': 'Please enter a valid text',
7194
+ 'required': 'This field is required',
7195
+ 'minlength': 'This field must be at least {0} characters long',
7196
+ 'maxlength': 'This field must be at most {0} characters long',
7197
+ 'min': 'This field must be at least {0}',
7198
+ 'max': 'This field must be at most {0}',
7199
+ 'between': 'This field must be between {0} and {1}',
7200
+ 'pattern': 'This field is invalid',
7201
+ 'date': 'Please enter a valid date',
7202
+ 'time': 'Please enter a valid time',
7203
+ 'datetime': 'Please enter a valid date and time',
7204
+ 'datetime-local': 'Please enter a valid date and time',
7205
+ 'month': 'Please enter a valid month',
7206
+ 'week': 'Please enter a valid week',
7207
+ 'color': 'Please enter a valid color',
7208
+ 'file': 'Please enter a valid file',
7209
+ 'range': 'Please enter a valid range',
7210
+ 'radio': 'Please select a valid option',
7211
+ 'checkbox': 'Please select a valid option',
7212
+ 'select': 'Please select a valid option',
7213
+ 'multiple': 'Please select a valid option',
7214
+ };
7215
+ let IndeterminateType;
7216
+ (function (IndeterminateType) {
7217
+ IndeterminateType["uncheck"] = "uncheck";
7218
+ IndeterminateType["indeterminate"] = "indeterminate";
7219
+ IndeterminateType["determinate"] = "determinate"; // true
7220
+ })(IndeterminateType = Bcm.IndeterminateType || (Bcm.IndeterminateType = {}));
7221
+ let Placement;
7222
+ (function (Placement) {
7223
+ Placement["top"] = "top";
7224
+ Placement["top-start"] = "top-start";
7225
+ Placement["top-end"] = "top-end";
7226
+ Placement["bottom"] = "bottom";
7227
+ Placement["bottom-start"] = "bottom-start";
7228
+ Placement["bottom-end"] = "bottom-end";
7229
+ Placement["left"] = "left";
7230
+ Placement["left-start"] = "left-start";
7231
+ Placement["left-end"] = "left-end";
7232
+ Placement["right"] = "right";
7233
+ Placement["right-start"] = "right-start";
7234
+ Placement["right-end"] = "right-end";
7235
+ })(Placement = Bcm.Placement || (Bcm.Placement = {}));
7236
+ let TriggerType;
7237
+ (function (TriggerType) {
7238
+ TriggerType["hover"] = "hover";
7239
+ TriggerType["click"] = "click";
7240
+ TriggerType["focus"] = "focus";
7241
+ })(TriggerType = Bcm.TriggerType || (Bcm.TriggerType = {}));
7242
+ })(Bcm || (Bcm = {}));
7243
+ const Bcm$1 = Bcm;
7244
+
7245
+ class StringHelper {
7246
+ }
7247
+ StringHelper.lowercase = (str) => str.toLowerCase();
7248
+ StringHelper.uppercase = (str) => str.toUpperCase();
7249
+ StringHelper.capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);
7250
+ StringHelper.camelCase = (str) => str.replace(/\s(.)/g, function ($1) { return $1.toUpperCase(); }).replace(/\s/g, '');
7251
+ StringHelper.kebabCase = (str) => str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
7252
+ StringHelper.snakeCase = (str) => str.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase();
7253
+ StringHelper.titleCase = (str) => str.replace(/\w\S*/g, function (txt) { return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); });
7254
+ StringHelper.trim = (str) => str.trim();
7255
+ StringHelper.trimLeft = (str) => str.trimLeft();
7256
+ StringHelper.trimRight = (str) => str.trimRight();
7257
+ StringHelper.trimAll = (str) => str.trim().replace(/\s+/g, ' ');
7258
+ StringHelper.replace = (str, search, replace) => str.replace(search, replace);
7259
+ StringHelper.remove = (str, search) => str.replace(search, '');
7260
+ StringHelper.isNullOrEmpty = (str) => str === null || str === undefined || str === '';
7261
+ StringHelper.localizationMessage = (str, args) => str.replace(/{(\d+)}/g, (match, number) => typeof args[number] != 'undefined' ? args[number] : match);
7262
+ StringHelper.getMessage = (type, args) => StringHelper.localizationMessage(Bcm$1.FormErrorMessages[type], args);
7263
+ StringHelper.split = (str, separator) => str.split(separator);
7264
+ StringHelper.textContains = (str, search) => str.indexOf(search) !== -1;
7265
+
7266
+ const SlotTemplate = ({ value, className, name }) => {
7267
+ return StringHelper.isNullOrEmpty(value) ? index.h("span", { class: className },
7268
+ index.h("slot", Object.assign({}, (name && { name: name })))) : index.h("span", { class: className }, value);
7269
+ };
7270
+
7271
+ const LabelTemplate = ({ required, value, size, form, htmlFor, type }) => {
7272
+ size = size || Bcm$1.FontSize['size-1'];
7273
+ type = type || Bcm$1.Status.default;
7274
+ const labelClasses = index$1.classnames('bcm-label__text', size, {
7275
+ 'bcm-label__text-error': type === Bcm$1.Status.error,
7276
+ });
7277
+ return (index.h("label", { form: form, htmlFor: htmlFor, class: labelClasses },
7278
+ " ",
7279
+ index.h(SlotTemplate, { value: value }),
7280
+ " ",
7281
+ required && ('*')));
7282
+ };
7283
+
7284
+ const labelCss = "@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}.bcm-label{display:flex;align-items:center;grid-gap:2px}.bcm-label__text{display:inline-block;color:var(--bcm-color-grey-9);margin-bottom:4px}.bcm-label__text-error{color:var(--bcm-color-red-6)}";
6444
7285
 
6445
- const lowercase$2 = (str) => str.toLowerCase();
6446
- const BcmList = class {
7286
+ const BcmLabel = class {
6447
7287
  constructor(hostRef) {
6448
7288
  index.registerInstance(this, hostRef);
6449
- this.listSelected = index.createEvent(this, "bcm-list-selected", 7);
6450
- this.listChecked = index.createEvent(this, "bcm-list-checklist", 7);
6451
- this.change = index.createEvent(this, "bcm-change", 7);
6452
- this.configObject = [];
6453
- this.isRendered = false;
6454
- this.firstRender = true;
6455
- this.linkedElementWidth = "100%";
6456
- this.bodyStyleOverflow = '';
6457
- this.dataLength = 0;
6458
- this.checklist = [];
6459
- this.otherList = [];
6460
- this.configured = false;
6461
- this.checkStatus = false;
6462
- this.resetSelected = false;
6463
- this.indeterminateStatus = false;
6464
- this.totalSearch = 0;
6465
- this.empty = false;
6466
- this.objectMapping = {
6467
- 'id': "id",
6468
- 'text': "text",
6469
- 'selected': "selected",
6470
- };
6471
- this._id = (Math.random() * 4).toString(16).replace('.', '');
6472
- this._internal_id = (Math.random() * 4).toString(16).replace('.', '');
6473
- this._list_select_id = null;
6474
- this._list_id = null;
6475
- this.type = 'default';
6476
- this.processType = 'default';
7289
+ /** Props **/
7290
+ this._id = Generate.UID();
7291
+ this.required = false;
7292
+ this.size = Bcm$1.FontSize['size-1'];
6477
7293
  this.hidden = false;
6478
- this.items = [];
6479
- this.isShow = true;
6480
- this.linkedComponent = null;
6481
- this.selectedId = null;
6482
- this.flex = false;
6483
- this.height = "256px";
6484
- this.minHeight = null;
6485
- this.maxHeight = null;
6486
- this.width = "100%";
6487
- this.minWidth = null;
6488
- this.maxWidth = null;
6489
- this.fullWidth = false;
6490
- this.size = 'medium';
6491
- this.infoFooter = false;
6492
- this.searchable = false;
6493
- this.highlight = false;
6494
- this.searchPlaceholder = "Search";
6495
- this.searchFields = ['text'];
6496
- this.returnField = "id";
6497
- this.searchData = null;
6498
- this.searchSub = "items";
6499
- this.searchText = "";
6500
- this.value = null;
6501
- this.multiSelect = false;
6502
- /******/
6503
- this.clearable = false;
6504
- this.label = null;
6505
- this.placeholder = "Choose an option";
6506
- this.noCaption = false;
6507
- this.caption = null;
6508
- this.captionError = null;
6509
- this.captionType = 'default';
6510
- this.disabled = false;
6511
- this.name = null;
6512
- this.required = false;
6513
- }
6514
- connectedCallback() {
6515
- this.captionCache = this.caption;
6516
- this.captionTypeCache = this.captionType;
6517
- this.bodyStyleOverflow = document.querySelector("body").style.overflow;
6518
- const elementId = "bcm-list-select-" + this._id;
6519
- if (this.type === 'select' || this.type === 'autocomplete') {
6520
- this.selectIsInitialize();
6521
- this.linkedComponent = elementId;
6522
- }
6523
- if (this.type !== 'default' || this.linkedComponent !== null) {
6524
- this.isShow = false;
6525
- this.el.classList.add("linked");
6526
- this.handleLinkedComponent();
6527
- }
6528
- const slot = this.el.shadowRoot.querySelectorAll('bcm-list-item');
6529
- if (slot) {
6530
- slot.forEach(el => {
6531
- if (lowercase$2(el.tagName) === 'bcm-list-item') {
6532
- el.setAttribute("_internal_id", this._internal_id);
6533
- }
6534
- });
6535
- }
6536
- }
6537
- disconnectedCallback() { }
6538
- componentWillLoad() { }
6539
- componentDidLoad() { }
6540
- componentWillRender() { }
6541
- componentDidRender() {
6542
- const elementId = "bcm-list-select-" + this._id;
6543
- if (this.type === 'select' || this.type === 'autocomplete') {
6544
- this.selectIsInitialize();
6545
- this.linkedComponent = elementId;
6546
- }
6547
- if (sessionStorage.getItem(this._internal_id + "-config")) {
6548
- this.config(JSON.parse(sessionStorage.getItem(this._internal_id + "-config")));
6549
- }
6550
- setTimeout(() => {
6551
- const spinner = this.el.shadowRoot.querySelector('.spinner');
6552
- if (spinner) {
6553
- spinner.classList.remove("first-run");
6554
- }
6555
- }, 500);
6556
- }
6557
- componentWillUpdate() { }
6558
- componentDidUpdate() { }
6559
- /**
6560
- * @desc
6561
- */
6562
- async hide() {
6563
- this.isShow = false;
6564
- document.querySelector("body").style.overflow = this.bodyStyleOverflow;
6565
- }
6566
- async setSearch(text) {
6567
- const searchInput = this.el.shadowRoot.querySelector("bcm-search");
6568
- if (searchInput) {
6569
- searchInput.setValue(text);
6570
- // searchInput.select()
6571
- }
6572
- }
6573
- async clearAndSelectSearch(select = true) {
6574
- if (this.searchable == true) {
6575
- // var searchInput = null
6576
- const searchInput = this.el.shadowRoot.querySelector("bcm-search");
6577
- if (searchInput) {
6578
- searchInput.setClear();
6579
- if (select == true) {
6580
- searchInput.select();
6581
- }
6582
- }
6583
- }
6584
- }
6585
- /**
6586
- * @desc
6587
- */
6588
- async show() {
6589
- if (this.processType == 'deselect') {
6590
- this.firstRender = true;
6591
- this.isRendered = false;
6592
- this.setData(this.otherList);
6593
- }
6594
- this.isShow = true;
6595
- if (this.items && this.isRendered === false) {
6596
- this.isRendered = true;
6597
- this.processData(this.items);
6598
- }
6599
- if (this.linkedComponent !== null) {
6600
- this.handleLinkedComponent();
6601
- }
6602
- }
6603
- /**
6604
- * @desc
6605
- */
6606
- async toggle() {
6607
- this.isShow = !this.isShow;
6608
- }
6609
- /**
6610
- * @desc
6611
- */
6612
- async openStatus() {
6613
- return this.isShow;
6614
- }
6615
- /**
6616
- * @desc
6617
- */
6618
- handleOpen(value) {
6619
- if (this.processType === "deselect") {
6620
- const listSelect = document.getElementById(this._list_select_id);
6621
- if (listSelect) {
6622
- const otherTag = listSelect.shadowRoot.querySelector("#other-tag");
6623
- if (otherTag) {
6624
- if (value === true) {
6625
- otherTag.setAttribute("color", "prime-blue");
6626
- }
6627
- else {
6628
- otherTag.removeAttribute("color");
6629
- }
6630
- }
6631
- }
6632
- }
6633
- }
6634
- /**
6635
- * @desc
6636
- */
6637
- handleChange(newValue) {
6638
- this.change.emit(newValue);
6639
- }
6640
- /**
6641
- * @desc
6642
- */
6643
- async config(_config) {
6644
- if (_config['type']) {
6645
- this.type = _config['type'];
6646
- }
6647
- if (_config['searchPlaceholder']) {
6648
- this.searchPlaceholder = _config['searchPlaceholder'];
6649
- }
6650
- if (_config['searchFields']) {
6651
- this.searchFields = _config['searchFields'];
6652
- }
6653
- if (_config['returnField']) {
6654
- this.returnField = _config['returnField'];
6655
- }
6656
- if (_config['highlight']) {
6657
- this.highlight = _config['highlight'];
6658
- }
6659
- if (_config['linkedComponent'] && typeof _config['linkedComponent'] == 'string') {
6660
- this.linkedComponent = _config['linkedComponent'];
6661
- }
6662
- if (_config['searchable'] && typeof _config['searchable'] == 'boolean') {
6663
- this.searchable = _config['searchable'];
6664
- }
6665
- if (_config['infoFooter'] && typeof _config['infoFooter'] == 'boolean') {
6666
- this.infoFooter = _config['infoFooter'];
6667
- }
6668
- if (_config['mapping']) {
6669
- if (_config['mapping']['id']) {
6670
- this.objectMapping['id'] = _config['mapping']['id'];
6671
- }
6672
- if (_config['mapping']['text']) {
6673
- this.objectMapping['text'] = _config['mapping']['text'];
6674
- }
6675
- if (_config['mapping']['selected']) {
6676
- this.objectMapping['selected'] = _config['mapping']['selected'];
6677
- }
6678
- }
6679
- sessionStorage.setItem(this._internal_id + "-config", JSON.stringify(_config));
6680
- this.configured = true;
6681
- this.configObject = _config;
6682
- return _config;
6683
- }
6684
- /**
6685
- * @desc
6686
- */
6687
- async setDataOther(_data = []) {
6688
- this.otherList = _data;
6689
- }
6690
- /**
6691
- * @desc
6692
- */
6693
- async setData(_data = []) {
6694
- if (this.value) {
6695
- this.setClear();
6696
- }
6697
- if (_data) {
6698
- typeof _data == 'string'
6699
- ? this.items = JSON.parse(_data)
6700
- : this.items = _data;
6701
- if (this.items) {
6702
- switch (this.processType) {
6703
- case 'default':
6704
- if (this.items.find(e => e[this.objectMapping['selected']])) {
6705
- var selectedIDs = [];
6706
- this.items.filter(e => String(e[this.objectMapping['selected']]) === "true").forEach(element => {
6707
- selectedIDs.push(element[this.objectMapping['id']]);
6708
- });
6709
- this.checked(selectedIDs);
6710
- }
6711
- break;
6712
- case 'deselect':
6713
- var selectedIDs = [];
6714
- this.items.forEach(element => {
6715
- // element[ this.objectMapping['selected'] ] = true;
6716
- selectedIDs.push(element[this.objectMapping['id']]);
6717
- });
6718
- this.checked(selectedIDs);
6719
- break;
6720
- }
6721
- }
6722
- this.calculatedTotals({ "total": this.items.length });
6723
- if (this.multiSelect === true) {
6724
- this.calculatedTotals({ "selected": selectedIDs ? selectedIDs.length : 0 });
6725
- }
6726
- this.isRendered = false;
6727
- if (this.linkedComponent === null) {
6728
- this.show();
6729
- }
6730
- }
6731
- return _data;
6732
- }
6733
- /**
6734
- * @desc
6735
- */
6736
- async getValue() {
6737
- return this.value;
6738
- }
6739
- /**
6740
- * @desc
6741
- */
6742
- async getChecklist() {
6743
- return this.checklist;
6744
- }
6745
- /**
6746
- * @desc
6747
- */
6748
- async resetCaption() {
6749
- this.caption = this.captionCache;
6750
- this.captionType = this.captionTypeCache;
6751
- this.captionError = null;
6752
- }
6753
- /**
6754
- * @desc
6755
- */
6756
- async toggleChecked(checkedItems = null) {
6757
- if (checkedItems !== null) {
6758
- var checkStatus = false;
6759
- if (typeof checkedItems == 'string') {
6760
- checkStatus = this.items.find(e => e[this.objectMapping['id']] == checkedItems)[this.objectMapping['selected']];
6761
- }
6762
- else {
6763
- let state = 'uncheck';
6764
- let allChecked = true;
6765
- let allUnchecked = true;
6766
- checkedItems.forEach((item) => {
6767
- if (String(this.items.find(e => e[this.objectMapping['id']] == item)[this.objectMapping['selected']]) === 'true') {
6768
- allUnchecked = false;
6769
- }
6770
- else {
6771
- allChecked = false;
6772
- }
6773
- });
6774
- !allChecked && !allUnchecked
6775
- ? state = 'determinate'
6776
- : allChecked
6777
- ? state = 'determinate'
6778
- : state = 'uncheck';
6779
- checkStatus = state == 'determinate' ? false : true;
6780
- }
6781
- // let state: string = 'uncheck'
6782
- // let allChecked: boolean = true
6783
- // let allUnchecked: boolean = true
6784
- // checkedItems.map((item) => {
6785
- // item[ this.objectMapping['selected'] ] === true && (allUnchecked = false)
6786
- // !item[ this.objectMapping['selected'] ] === true && (allChecked = false)
6787
- // });
6788
- // !allChecked && !allUnchecked
6789
- // ? state = 'determinate'
6790
- // : allChecked
6791
- // ? state = 'determinate'
6792
- // : state = 'uncheck'
6793
- // const checkStatus = state == 'determinate' ? true : false
6794
- // const checkStatus = this.items.find( e => e[ this.objectMapping['id'] ] == checkedItems )[ this.objectMapping['selected'] ]
6795
- if (checkStatus === true) {
6796
- this.unChecked(checkedItems);
6797
- }
6798
- else {
6799
- // this.checked(checkedItems, false)
6800
- var selectedIDs = [];
6801
- // var checkItem = null
6802
- if (typeof checkedItems == 'string') {
6803
- // checkItem = this.sendSelectId( String(checkedItems), true)
6804
- selectedIDs.push(checkedItems);
6805
- }
6806
- else {
6807
- checkedItems.forEach((item) => {
6808
- selectedIDs.push(item);
6809
- // String(item[ this.objectMapping['selected'] ]) === 'true' && (allUnchecked = false),
6810
- // String(item[ this.objectMapping['selected'] ]) !== 'true' && (allChecked = false)
6811
- });
6812
- // this.sendSelectId( String(checkedItems), true)
6813
- // var selectedIDs = []
6814
- // if( this.items && this.items.find( e => e[ this.objectMapping['selected'] ] ) ){
6815
- // this.items.filter( e => String( e[ this.objectMapping['selected'] ] ) === "true" ).forEach(element => {
6816
- // selectedIDs.push( element )
6817
- // });
6818
- // }
6819
- // this.value = selectedIDs
6820
- // this.listChecked.emit( this.value )
6821
- // this.handleIndeterminateStatus()
6822
- // this.sendSelectValue()
6823
- }
6824
- this.checked(selectedIDs, false);
6825
- }
6826
- }
6827
- }
6828
- /**
6829
- * @desc
6830
- */
6831
- async unChecked(checkedItems = null) {
6832
- if (checkedItems !== null) {
6833
- var selectedIDs = [];
6834
- this.selectedId = null;
6835
- if (typeof checkedItems == 'string') {
6836
- this.sendSelectId(String(checkedItems), false);
6837
- }
6838
- else {
6839
- checkedItems.forEach(item => {
6840
- this.sendSelectId(String(item), false);
6841
- });
6842
- }
6843
- if (this.items && this.items.find(e => e[this.objectMapping['selected']])) {
6844
- this.items.filter(e => String(e[this.objectMapping['selected']]) === "true").forEach(element => {
6845
- selectedIDs.push(element);
6846
- });
6847
- }
6848
- this.value = selectedIDs;
6849
- this.listChecked.emit(this.value);
6850
- this.handleIndeterminateStatus();
6851
- this.sendSelectValue();
6852
- }
6853
- }
6854
- /**
6855
- * @desc
6856
- */
6857
- async checked(checkedItems = null, reset = true) {
6858
- if (checkedItems !== null) {
6859
- var selectedIDs = [];
6860
- if (reset === true) {
6861
- if (this.items && this.items.find(e => e[this.objectMapping['selected']])) {
6862
- this.items.filter(e => String(e[this.objectMapping['selected']]) === "true").forEach(element => {
6863
- element[this.objectMapping['selected']] = false;
6864
- });
6865
- }
6866
- this.setClear(false);
6867
- }
6868
- if (typeof checkedItems == 'string') {
6869
- this.sendSelectId(String(checkedItems));
6870
- if (this.multiSelect === false) {
6871
- this.selectedId = this.items.find(e => String(e[this.objectMapping['id']]) === String(checkedItems));
6872
- }
6873
- }
6874
- else {
6875
- if (this.multiSelect === true) {
6876
- checkedItems.forEach(item => {
6877
- this.sendSelectId(String(item));
6878
- });
6879
- }
6880
- }
6881
- // if ( this.multiSelect === false ){
6882
- // this.selectedId = this.items.find( e => String(e[ this.objectMapping['id'] ]) === String(checkedItems) )
6883
- // }
6884
- if (this.items && this.items.find(e => e[this.objectMapping['selected']])) {
6885
- this.items.filter(e => String(e[this.objectMapping['selected']]) === "true").forEach(element => {
6886
- selectedIDs.push(element);
6887
- });
6888
- }
6889
- this.value = selectedIDs;
6890
- this.listChecked.emit(this.value);
6891
- this.handleIndeterminateStatus();
6892
- this.sendSelectValue();
6893
- }
6894
- }
6895
- /**
6896
- * @desc
6897
- */
6898
- async setClear(eventEmit = true) {
6899
- if (this.items != undefined && this.items.length > 0) {
6900
- this.unChecked(this.items.map(item => { return item[this.objectMapping["id"]]; }));
6901
- }
6902
- this.selectedId = null;
6903
- this.checklist = [];
6904
- if (eventEmit === true) {
6905
- this.listChecked.emit(this.checklist);
6906
- }
6907
- this.value = null;
6908
- this.handleIndeterminateStatus();
6909
- this.calculatedTotals({ "selected": this.checklist.length });
6910
- }
6911
- /**
6912
- * @desc
6913
- */
6914
- async processData(_data) {
6915
- this.handleLoading(true);
6916
- await utils.delay(100);
6917
- const list = this.el.shadowRoot.querySelector('.list');
6918
- list.innerHTML = "";
6919
- this.selectedId = null;
6920
- this.value = null;
6921
- const elementStatuses = [];
6922
- var checkedItems = [];
6923
- if (_data.length > 0) {
6924
- this.dataLength = _data.length;
6925
- this.searchData = _data;
6926
- await utils.delay(100);
6927
- _data.map(item => {
6928
- const element = document.createElement("bcm-list-item");
6929
- element.setAttribute("_internal_id", this._internal_id);
6930
- element.setAttribute("text", item[this.objectMapping['text']]);
6931
- element.setAttribute("id", String(item[this.objectMapping['id']]));
6932
- if (item[this.objectMapping['selected']]) {
6933
- // element.select()
6934
- checkedItems.push(String(item[this.objectMapping['id']]));
6935
- }
6936
- // element.setAttribute("item-object", JSON.stringify(item))
6937
- var object = item;
6938
- element.itemObject = object;
6939
- element.multiSelect = this.multiSelect;
6940
- list.appendChild(element);
6941
- elementStatuses.push(element.componentOnReady());
6942
- });
6943
- const allStatuses = await Promise.all(elementStatuses);
6944
- if (allStatuses) {
6945
- if (checkedItems != []) {
6946
- checkedItems.forEach(item => {
6947
- // if ( this.sendSelectId( String(item) ) !== false ){
6948
- this.sendSelectId(String(item));
6949
- // }
6950
- });
6951
- }
6952
- this.handleLoading(false);
6953
- this.firstRender = false;
6954
- }
6955
- }
6956
- else {
6957
- this.handleLoading(false);
6958
- // console.log("no data")
6959
- }
6960
- }
6961
- /**
6962
- * @desc
6963
- */
6964
- handleLoading(show = false) {
6965
- const spinner = this.el.shadowRoot.querySelector('.spinner');
6966
- // const searchInput = this.el.shadowRoot.querySelector('#search');
6967
- if (show == true) {
6968
- spinner.classList.add("show");
6969
- // searchInput.setAttribute('readonly', 'true')
6970
- }
6971
- else {
6972
- spinner.classList.remove("show");
6973
- // searchInput.setAttribute('readonly', 'false')
6974
- }
6975
- if (this.linkedComponent !== null) {
6976
- this.handleLinkedComponent();
6977
- }
6978
- }
6979
- /**
6980
- * @desc
6981
- */
6982
- handleClick(event) {
6983
- var path = event.path || (event.composedPath && event.composedPath());
6984
- if (!this.el.contains(event.target)
6985
- || (path
6986
- && path.filter((input) => input['_internal_id'] == this._internal_id)[0]
6987
- && path.filter((input) => input['nodeName'] == "BCM-LIST-ITEM")[0]
6988
- && this.multiSelect === false)) {
6989
- if (this.isShow === true) {
6990
- this.hide();
6991
- }
6992
- }
6993
- }
6994
- /**
6995
- * @desc
6996
- */
6997
- wheelEvent(event) {
6998
- if (!this.el.contains(event.target)) {
6999
- if (this.isShow === true) {
7000
- this.hide();
7001
- }
7002
- }
7003
- }
7004
- /**
7005
- * @desc
7006
- */
7007
- scrollEvent(event) {
7008
- if (!this.el.contains(event.target)) {
7009
- if (this.isShow === true) {
7010
- this.hide();
7011
- }
7012
- }
7013
- }
7014
- /**
7015
- * @desc
7016
- */
7017
- resizeEvent() {
7018
- utils.dropInComponent(this.el, "#" + this.linkedComponent);
7019
- }
7020
- /**
7021
- * @descc
7022
- */
7023
- onmousemove(e) {
7024
- if (this.el.contains(e.target)) {
7025
- if (document.querySelector("body").style.overflow != "hidden") {
7026
- document.querySelector("body").style.overflow = "hidden";
7027
- }
7028
- }
7029
- else {
7030
- if (document.querySelector("body").style.overflow != this.bodyStyleOverflow) {
7031
- document.querySelector("body").style.overflow = this.bodyStyleOverflow;
7032
- }
7033
- }
7034
- }
7035
- /**
7036
- * @descc
7037
-
7038
- */
7039
- listenSearchResult(event) {
7040
- var path = event.path || (event.composedPath && event.composedPath());
7041
- if (event.isEvent == undefined) {
7042
- if (path && path.filter((input) => input['_internal_id'] == this._internal_id)[0] != undefined) {
7043
- // var childs: any[] = getChilds(this.el, 'bcm-list-item')
7044
- var childs = this.el.shadowRoot.querySelectorAll("bcm-list-item");
7045
- childs.forEach(element => {
7046
- element.classList.add("hidden");
7047
- });
7048
- if (event.detail.length > 0) {
7049
- if (event.detail[0] == -1) {
7050
- this.totalSearch = 0;
7051
- this.empty = true;
7052
- }
7053
- else {
7054
- this.totalSearch = event.detail.length;
7055
- this.empty = false;
7056
- if (this.dataLength > 0) {
7057
- childs.forEach(element => {
7058
- // if ( this.highlight ){
7059
- // event.target.addEventListener('bcm-on-search-value', async(event: CustomEvent) => {
7060
- // var searchValue = await event.detail
7061
- // var inputText = element.shadowRoot.getElementById("text")
7062
- // inputText = inputText.textContent || inputText.innerText || ""
7063
- // if (searchValue) {
7064
- // var cacheInputText = lowercase(inputText)
7065
- // var cacheSearchValue = lowercase(searchValue)
7066
- // var index = cacheInputText.indexOf(cacheSearchValue);
7067
- // if (index >= 0) {
7068
- // inputText = inputText.substring(0,index) + "<span class='highlight'>" + inputText.substring(index,index+searchValue.length) + "</span>" + inputText.substring(index + searchValue.length);
7069
- // }
7070
- // }
7071
- // element.shadowRoot.getElementById("text").innerHTML = inputText;
7072
- // })
7073
- // }
7074
- if (event.detail.indexOf(element._id) >= 0) {
7075
- element.classList.remove("hidden");
7076
- }
7077
- });
7078
- }
7079
- }
7080
- }
7081
- else if (event.detail === true) {
7082
- this.totalSearch = this.dataLength;
7083
- this.empty = false;
7084
- childs.forEach(element => {
7085
- element.classList.remove("hidden");
7086
- });
7087
- }
7088
- this.calculatedTotals({ "total": this.totalSearch });
7089
- }
7090
- }
7091
- }
7092
- /**
7093
- * @descc
7094
-
7095
- */
7096
- sendSelectId(id, status = true) {
7097
- if (this.items && this.items.find(e => e[this.objectMapping['id']] == id)) {
7098
- if (this.isRendered === false) {
7099
- this.items.find(e => e[this.objectMapping['id']] == id)[this.objectMapping['selected']] = status;
7100
- this.handleChecklist(this.items.find(e => e[this.objectMapping['id']] == id), status);
7101
- return this.items.find(e => e[this.objectMapping['id']] == id);
7102
- }
7103
- else {
7104
- var selectedItem = null;
7105
- if (selectedItem = this.el.shadowRoot.getElementById(id)) {
7106
- if (status === true) {
7107
- selectedItem.classList.add("selected");
7108
- }
7109
- else {
7110
- selectedItem.classList.remove("selected");
7111
- }
7112
- if (this.multiSelect === true) {
7113
- this.handleChecklist(selectedItem["itemObject"], status);
7114
- // selectedItem.classList.toggle("selected")
7115
- if (selectedItem.shadowRoot.querySelector(".checkbox")) {
7116
- selectedItem.shadowRoot.querySelector(".checkbox").querySelector("input").checked = status;
7117
- }
7118
- }
7119
- this.items.find(e => e[this.objectMapping['id']] == id)[this.objectMapping['selected']] = status;
7120
- return this.items.find(e => e[this.objectMapping['id']] == id);
7121
- }
7122
- }
7123
- }
7124
- return false;
7125
- }
7126
- /**
7127
- * @descc
7128
- */
7129
- jsonDataProcess(id, status) {
7130
- // console.log(id)
7131
- var item = this.items.find(e => String(e[this.objectMapping['id']]) == String(id));
7132
- if (item) {
7133
- item[this.objectMapping['selected']] = status;
7134
- }
7135
- }
7136
- /**
7137
- * @descc
7138
- */
7139
- handleListSelected(event) {
7140
- var path = event.path || (event.composedPath && event.composedPath());
7141
- // console.log(path);
7142
- if (this.isInternal(event) || (!this.isInternal(event) && this.isInternalSlot(event))) {
7143
- var status = false;
7144
- var selectedItem = null;
7145
- const itemId = this.getItemId(event);
7146
- if (this.multiSelect === false) {
7147
- if (selectedItem = utils.getChilds(this.el, "bcm-list-item").find(x => x._id === this.selectedId)) {
7148
- selectedItem.classList.remove("selected");
7149
- status = false;
7150
- // selectedItem.selected = false
7151
- }
7152
- }
7153
- selectedItem = this.el.shadowRoot.getElementById(itemId);
7154
- if (selectedItem) {
7155
- this.selectedId = selectedItem["id"];
7156
- // selectedItem.selected = true
7157
- if (this.multiSelect === true) {
7158
- selectedItem.classList.toggle("selected");
7159
- if (selectedItem.classList.contains("selected") === true) {
7160
- status = false;
7161
- }
7162
- else {
7163
- status = true;
7164
- }
7165
- }
7166
- else {
7167
- selectedItem.classList.add("selected");
7168
- status = true;
7169
- }
7170
- }
7171
- if (this.isInternalSlot(event)) {
7172
- if (selectedItem = path[0]) {
7173
- this.selectedId = path[0].id;
7174
- this.value = event.detail;
7175
- return true;
7176
- }
7177
- }
7178
- if (this.multiSelect === true) {
7179
- this.handleChecklist(selectedItem["itemObject"], selectedItem.classList.contains("selected"));
7180
- this.listChecked.emit(this.checklist);
7181
- if (selectedItem.shadowRoot.querySelector(".checkbox")) {
7182
- selectedItem.shadowRoot.querySelector(".checkbox").querySelector("input").checked = selectedItem.classList.contains("selected");
7183
- }
7184
- this.value = this.checklist;
7185
- }
7186
- else {
7187
- this.value = event.detail;
7188
- }
7189
- if (this.processType === 'default') {
7190
- this.jsonDataProcess(this.selectedId, status);
7191
- }
7192
- this.handleIndeterminateStatus();
7193
- this.sendSelectValue();
7194
- if (this.processType === 'deselect') {
7195
- var element = document.querySelector("#" + this._list_id);
7196
- if (element) {
7197
- if (this.firstRender === false) {
7198
- element.toggleChecked(this.selectedId);
7199
- }
7200
- // element.unChecked(this.selectedId)
7201
- }
7202
- }
7203
- }
7204
- }
7205
- /**
7206
- * @desc
7207
- */
7208
- handleChecklist(checkItem, process = true) {
7209
- if (this.items && this.items.find(e => e[this.objectMapping['id']] == checkItem[this.objectMapping['id']])) {
7210
- switch (process) {
7211
- case true:
7212
- if (this.checklist.length > 0) {
7213
- if (!this.checklist.includes(checkItem)) {
7214
- this.checklist = [...this.checklist, checkItem];
7215
- }
7216
- }
7217
- else {
7218
- this.checklist = [checkItem];
7219
- }
7220
- break;
7221
- case false:
7222
- this.checklist = this.checklist.filter(item => item[this.objectMapping['id']] !== checkItem[this.objectMapping['id']]);
7223
- break;
7224
- }
7225
- let sorted = this.checklist.sort(function (a, b) { return a - b; });
7226
- this.checklist = sorted;
7227
- // if ( this.firstRender === false ){
7228
- this.calculatedTotals({ "selected": this.checklist.length });
7229
- // }
7230
- }
7231
- }
7232
- /**
7233
- * @desc
7234
- */
7235
- handleIndeterminateStatus() {
7236
- if (this.multiSelect === true) {
7237
- this.checkStatus = false;
7238
- this.indeterminateStatus = false;
7239
- if (this.items != undefined && this.checklist != undefined) {
7240
- if (this.checklist.length == 0) {
7241
- this.checkStatus = false;
7242
- this.indeterminateStatus = false;
7243
- }
7244
- else if (this.checklist.length == this.items.length) {
7245
- this.checkStatus = true;
7246
- this.indeterminateStatus = false;
7247
- }
7248
- else if (this.checklist.length < this.items.length) {
7249
- this.checkStatus = false;
7250
- this.indeterminateStatus = true;
7251
- }
7252
- else {
7253
- this.checkStatus = false;
7254
- this.indeterminateStatus = false;
7255
- }
7256
- if (this.multiSelect === true) {
7257
- var indeterminateCheckbox;
7258
- if (indeterminateCheckbox = this.el.shadowRoot.querySelector('#check-lite-' + this._id)) {
7259
- indeterminateCheckbox["checked"] = this.checkStatus;
7260
- indeterminateCheckbox["indeterminate"] = this.indeterminateStatus;
7261
- }
7262
- }
7263
- }
7264
- }
7265
- }
7266
- /**
7267
- * @desc
7268
- */
7269
- calculatedTotals(calcObject) {
7270
- if (calcObject["selected"] != undefined) {
7271
- if (this.infoFooter == true && this.el.shadowRoot.querySelector("#selected-item")) {
7272
- if (calcObject["selected"] > 0) {
7273
- this.el.shadowRoot.querySelector("#selected-item").innerHTML = "( " + calcObject["selected"] + " selected )";
7274
- }
7275
- else {
7276
- this.el.shadowRoot.querySelector("#selected-item").innerHTML = " ";
7277
- }
7278
- }
7279
- }
7280
- if (calcObject["total"] != undefined) {
7281
- if (this.infoFooter == true && this.el.shadowRoot.querySelector("#in-total")) {
7282
- this.el.shadowRoot.querySelector("#in-total").innerHTML = calcObject["total"];
7283
- }
7284
- }
7285
- }
7286
- /**
7287
- * @desc
7288
- */
7289
- getItemId(event) {
7290
- var path = event.path || (event.composedPath && event.composedPath());
7291
- const detect = path
7292
- && path[0]
7293
- && path[0].attributes
7294
- && path[0].attributes['id']
7295
- && path[0].attributes['id'].value;
7296
- return detect;
7297
- }
7298
- /**
7299
- * @desc
7300
- */
7301
- isInternalSlot(event) {
7302
- var path = event.path || (event.composedPath && event.composedPath());
7303
- const detect = path
7304
- && path[0]
7305
- && lowercase$2(path[0].tagName) === 'bcm-list-item'
7306
- && this.el.contains(path[0]);
7307
- return detect;
7308
- }
7309
- /**
7310
- * @desc
7311
- */
7312
- isInternal(event) {
7313
- var path = event.path || (event.composedPath && event.composedPath());
7314
- const detect = path
7315
- && path[0]
7316
- && path[0].attributes
7317
- && path[0].attributes['_internal_id']
7318
- && path[0].attributes['_internal_id'].value;
7319
- return detect == this._internal_id;
7320
- }
7321
- /**
7322
- * @desc
7323
- */
7324
- handleLinkedComponent() {
7325
- utils.dropInComponent(this.el, "#" + this.linkedComponent);
7326
- var element = null;
7327
- if (this.width == "100%" && (element = document.querySelector("#" + this.linkedComponent))) {
7328
- this.linkedElementWidth = element.clientWidth + "px";
7329
- }
7330
- }
7331
- /**
7332
- * @desc
7333
- */
7334
- async selectIsInitialize() {
7335
- const elementId = "bcm-list-select-" + this._id;
7336
- var element;
7337
- if (!document.getElementById(elementId)) {
7338
- element = document.createElement("bcm-list-select");
7339
- }
7340
- else {
7341
- element = document.getElementById(elementId);
7342
- }
7343
- element.setAttribute("id", elementId);
7344
- element.setAttribute("_list_id", this._id);
7345
- element.setAttribute("_internal_id", this._internal_id);
7346
- if (this.type) {
7347
- element.setAttribute("type", this.type);
7348
- }
7349
- if (this.clearable) {
7350
- element.setAttribute("clearable", this.clearable);
7351
- }
7352
- if (this.label) {
7353
- element.setAttribute("label", this.label);
7354
- }
7355
- if (this.placeholder) {
7356
- element.setAttribute("placeholder", this.placeholder);
7357
- }
7358
- if (this.noCaption) {
7359
- element.setAttribute("no-naption", this.noCaption);
7360
- }
7361
- if (this.caption) {
7362
- element.setAttribute("caption", this.caption);
7363
- }
7364
- if (this.captionError) {
7365
- element.setAttribute("caption-error", this.captionError);
7366
- }
7367
- if (this.captionType) {
7368
- element.setAttribute("caption-type", this.captionType);
7369
- }
7370
- if (this.disabled) {
7371
- element.setAttribute("disabled", this.disabled);
7372
- }
7373
- if (this.name) {
7374
- element.setAttribute("name", this.name);
7375
- }
7376
- if (this.required) {
7377
- element.setAttribute("required", this.required);
7378
- }
7379
- if (this.fullWidth) {
7380
- element.setAttribute("full-width", this.fullWidth);
7381
- }
7382
- if (this.multiSelect) {
7383
- element.setAttribute("multiselect", this.multiSelect);
7384
- }
7385
- const parentNode = this.el.parentNode;
7386
- parentNode.insertBefore(element, this.el);
7387
- return elementId;
7388
- }
7389
- /**
7390
- * @desc
7391
- */
7392
- handleCheckboxClick(e) {
7393
- e.preventDefault();
7394
- }
7395
- /**
7396
- * @desc
7397
- */
7398
- async handleIndeterminateClick(e) {
7399
- e.preventDefault();
7400
- this.indeterminateStatus = false;
7401
- if (this.checkStatus === false) {
7402
- this.checkStatus = true;
7403
- }
7404
- else {
7405
- this.checkStatus = false;
7406
- }
7407
- if (this.items != undefined && this.items.length > 0) {
7408
- // const subItems = this.el.shadowRoot.querySelectorAll("bcm-list-item")
7409
- var selectedIDs = [];
7410
- this.items.forEach(item => {
7411
- selectedIDs.push(item[this.objectMapping['id']]);
7412
- // this.jsonDataProcess( item[ this.objectMapping['id'] ], this.checkStatus === true ? true : false)
7413
- // this.handleChecklist( item, this.checkStatus === true ? true : false)
7414
- // var element:any = this.el.shadowRoot.getElementById( item[ this.objectMapping['id'] ] )
7415
- // if ( element ) {
7416
- // if ( element.shadowRoot.querySelector(".checkbox") ){
7417
- // element.shadowRoot.querySelector(".checkbox").querySelector("input").checked = this.checkStatus
7418
- // }
7419
- // if ( this.checkStatus === true ){
7420
- // element.classList.add("selected")
7421
- // } else {
7422
- // element.classList.remove("selected")
7423
- // }
7424
- // }
7425
- });
7426
- if (this.checkStatus === true) {
7427
- this.checked(selectedIDs, false);
7428
- }
7429
- else {
7430
- this.unChecked(selectedIDs);
7431
- }
7432
- if (this.processType === 'deselect') {
7433
- var element = document.querySelector("#" + this._list_id);
7434
- if (element) {
7435
- // if ( this.firstRender === false ){
7436
- element.toggleChecked(selectedIDs);
7437
- // }
7438
- // element.unChecked(this.selectedId)
7439
- }
7440
- }
7441
- // this.listChecked.emit( this.checklist )
7442
- // this.value = this.checklist
7443
- // this.sendSelectValue()
7444
- }
7445
- this.handleIndeterminateStatus();
7446
- }
7447
- /**
7448
- * @desc
7449
- */
7450
- sendSelectValue() {
7451
- if (this.type === 'select' || this.type === 'autocomplete') {
7452
- const select = document.getElementById("bcm-list-select-" + this._id);
7453
- if (select) {
7454
- if (this.multiSelect === true) {
7455
- select.setValue(this.value, this.objectMapping["id"], this.objectMapping["text"]);
7456
- }
7457
- else {
7458
- select.setValue(this.value[this.objectMapping["text"]]);
7459
- }
7460
- }
7461
- }
7462
- }
7463
- render() {
7464
- const classes = index$1.classnames('list-container', this.size);
7465
- const listItem = index$1.classnames('list-item', this.size, {
7466
- 'size-2': this.size === 'small' || this.size === 'medium',
7467
- 'size-3': this.size === 'large',
7468
- });
7469
- const hostClasses = index$1.classnames(this.hidden ? 'hidden' : null, 'type-' + this.type, {
7470
- 'error': this.captionType == 'error' ? true : false,
7471
- 'show': this.isShow,
7472
- 'flex': this.minHeight != null || this.maxHeight != null,
7473
- 'full-width': this.fullWidth
7474
- });
7475
- const searchContainer = index$1.classnames('search-container', {
7476
- 'show': this.searchable,
7477
- });
7478
- const footer = index$1.classnames('footer');
7479
- const captionClasses = index$1.classnames('size-1', 'input-caption', 'caption-' + this.captionType);
7480
- var customStyle = {
7481
- 'height': this.minHeight != null || this.maxHeight != null ? 'auto' : this.height,
7482
- 'min-height': this.minHeight != null ? this.minHeight : null,
7483
- 'max-height': this.maxHeight != null ? this.maxHeight : null,
7484
- 'width': this.minWidth != null || this.maxWidth != null ? 'max-content' :
7485
- this.width != "100%" ? this.width : this.linkedElementWidth,
7486
- 'min-width': this.minWidth != null ? this.minWidth == "100%" || this.minWidth == "auto" ? this.linkedElementWidth : this.minWidth : null,
7487
- 'max-width': this.maxWidth != null ? this.maxWidth == "100%" || this.maxWidth == "auto" ? this.linkedElementWidth : this.maxWidth : null,
7488
- };
7489
- return (index.h(index.Host, { class: hostClasses, style: customStyle }, (this.type === 'default' && this.processType === 'default' && this.label) && (index.h("label", { class: "label size-1" }, " ", this.label, " ", this.required && ('*'), " ")), index.h("main", { style: customStyle }, this.searchable === true && (index.h("div", { class: searchContainer }, index.h("bcm-search", { id: "search", _internal_id: this._internal_id, searchPlaceholder: this.searchPlaceholder, data: this.searchData, returnField: this.returnField, searchFields: this.searchFields, searchValue: this.searchText, clearable: true }), index.h("bcm-divider", null))), index.h("div", { class: classes }, this.multiSelect === true && (index.h("div", { class: "check-container" }, index.h("div", { class: listItem, id: "text", onClick: (e) => this.handleIndeterminateClick(e) }, index.h("div", { class: "check-content" }, index.h("bcm-checkbox-lite", { id: 'check-lite-' + this._id, name: 'check-lite-' + this._id, checked: false, indeterminate: false, onClick: (e) => this.handleCheckboxClick(e) })), "Select All"), index.h("div", { class: "divider" }, index.h("bcm-divider", null)))), index.h("slot", null), index.h("div", { class: "list" }), index.h("div", { class: "spinner first-run" }, index.h("bcm-icon", { type: "animated", color: "prime-blue", class: "prefix", icon: "loading" }))), this.infoFooter == true && (index.h("div", { class: footer }, index.h("bcm-text", { scale: "size-1", color: "grey-8" }, index.h("span", { id: "selected-item" }), " Total ", index.h("span", { id: "in-total" }, "0"), " items found.")))), (this.type === 'default' && this.processType === 'default' && !this.noCaption) && (index.h("div", { class: "caption-area" }, this.captionType == "error"
7490
- ? index.h("span", { class: captionClasses }, " ", this.captionError, " ")
7491
- : this.caption && index.h("span", { class: captionClasses }, " ", this.caption, " ")))));
7492
- }
7493
- get el() { return index.getElement(this); }
7494
- static get watchers() { return {
7495
- "isShow": ["handleOpen"],
7496
- "value": ["handleChange"]
7497
- }; }
7498
- };
7499
- BcmList.style = listCss;
7500
-
7501
- const listItemCss = "@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}:host(.hidden){display:none}:host(.selected) .list-item{color:var(--bcm-color-prime-blue-6);background-color:var(--bcm-color-prime-blue-1)}:host(.selected) .list-item:hover:not(.disabled){color:var(--bcm-color-prime-blue-7);background-color:var(--bcm-color-prime-blue-1)}:host(.selected) .list-item.disabled{color:var(--bcm-color-grey-6);cursor:not-allowed}:host(.selected) .list-item .check{background-color:#333333}:host(.checkable) .list-item .check{display:inline-block}.list-item{padding:8px;color:var(--bcm-color-grey-8);background-color:var(--bcm-color-grey-1);cursor:pointer;display:flex;justify-content:flex-start;align-items:center;flex-direction:row;white-space:break-spaces}.list-item .check{display:none;background-color:#ededed;width:15px;height:15px}.list-item .highlight{background-color:var(--bcm-color-yellow-5)}.list-item:hover:not(.disabled),.list-item:active:not(.disabled){color:var(--bcm-color-grey-8);background-color:var(--bcm-color-prime-blue-1)}.list-item .check-content{display:flex;align-items:center;justify-content:flex-start;width:16px;min-width:16px;margin-right:8px;margin-bottom:2px}.checkbox{}.checkbox input{display:none}.checkbox .svg-icon{filter:brightness(0) invert(1);width:12px;height:12px}.checkbox label{display:flex;align-items:flex-start;font-size:14px;color:var(--bcm-color-grey-8);cursor:pointer}.checkbox label span.icon{display:flex;align-items:center;justify-content:center;min-width:16px;min-height:16px;border:1px solid #D9D9D9;margin-right:8px;border-radius:2px;margin-top:2px;background-color:var(--bcm-color-grey-1)}.checkbox.indeterminate label span.icon{position:relative}.checkbox.indeterminate label span.icon::after{content:\"\";position:absolute;top:50%;left:8px;width:10px;height:10px;background-color:var(--bcm-color-prime-blue-6);transform:translate(-50%, -50%);opacity:1;z-index:1}.checkbox.indeterminate label span.icon::before{content:\"\";position:absolute;top:-1px;left:-1px;width:16px;height:100%;border-radius:2px;background-color:var(--bcm-color-grey-1);border:1px solid var(--bcm-color-grey-5);opacity:1;z-index:1}.checkbox.indeterminate label span.icon:hover:not(.disabled):before{border-color:var(--bcm-color-prime-blue-6);box-shadow:0px 2px 4px rgba(54, 121, 171, 0.5)}.checkbox input:checked+label span.icon{background-color:var(--bcm-color-prime-blue-6);border-color:transparent}.checkbox input:checked+label .icon-checked{display:block}.checkbox bcm-icon{filter:brightness(0) invert(1)}.checkbox input[disabled]+label{cursor:not-allowed}.checkbox input[disabled]+label span.icon{background-color:var(--bcm-color-grey-3);border-color:var(--bcm-color-grey-5)}.checkbox input[disabled]+label bcm-icon{filter:brightness(0);opacity:0.3}.checkbox input:not([disabled])+label:hover span.icon{border-color:var(--bcm-color-prime-blue-6);box-shadow:0px 2px 4px rgba(54, 121, 171, 0.5)}.checkbox .caption-area{margin-bottom:8px;min-height:20px;display:block}.checkbox .input-caption{display:block}.checkbox .caption-default{color:#8C8C8C}.checkbox .caption-primary{color:#4293CF}.checkbox .caption-success{color:#52C41A}.checkbox .caption-warning{color:#FA8C16}.checkbox .caption-error{color:#F5222D}.checkbox .radio-button{background-color:var(--bcm-color-grey-1);color:var(--bcm-color-grey-8);border:1px solid var(--bcm-color-grey-5);padding:0 16px;box-sizing:border-box;display:flex;align-items:center;justify-content:center}.checkbox .radio-button>span.icon{display:none}.checkbox .radio-button>span.slot{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;user-select:none}.checkbox .radio-button:hover:not(.disabled){color:var(--bcm-color-prime-blue-5)}.checkbox .radio-button:active:not(.disabled){color:var(--bcm-color-prime-blue-7)}.checkbox .radio-button.disabled{background-color:var(--bcm-color-grey-3);color:var(--bcm-color-grey-6);cursor:not-allowed}.checkbox .radio-button.checked.disabled{background-color:var(--bcm-color-grey-4);color:var(--bcm-color-grey-1);border-color:var(--bcm-color-grey-5)}.checkbox .radio-button.checked.solid{color:var(--bcm-color-grey-1);background-color:var(--bcm-color-prime-blue-6);border-color:var(--bcm-color-prime-blue-6)}.checkbox .radio-button.checked.solid:hover{background-color:var(--bcm-color-prime-blue-5);border-color:var(--bcm-color-prime-blue-5)}.checkbox .radio-button.checked.solid:active{background-color:var(--bcm-color-prime-blue-7);border-color:var(--bcm-color-prime-blue-7)}.checkbox .radio-button.checked.outline{background-color:var(--bcm-color-grey-1);color:var(--bcm-color-prime-blue-6);border-color:var(--bcm-color-prime-blue-6)}.checkbox .radio-button.checked.outline:hover{color:var(--bcm-color-prime-blue-5);border-color:var(--bcm-color-prime-blue-5)}.checkbox .radio-button.checked.outline:active{color:var(--bcm-color-prime-blue-7);border-color:var(--bcm-color-prime-blue-7)}.checkbox .radio-button.large{height:40px}.checkbox .radio-button.medium{height:32px}.checkbox .radio-button.small{height:24px}";
7502
-
7503
- const BcmListItem = class {
7504
- constructor(hostRef) {
7505
- index.registerInstance(this, hostRef);
7506
- this.listSelected = index.createEvent(this, "bcm-list-selected", 7);
7507
- this.listChecked = index.createEvent(this, "bcm-list-checked", 7);
7508
- this.size = 'medium';
7509
- this.hidden = false;
7510
- this.disabled = false;
7511
- this._internal_id = (Math.random() * 4).toString(16).replace('.', '');
7512
- this.template = null;
7513
- this._uniq_id = (Math.random() * 4).toString(16).replace('.', '');
7514
- // @Prop({ attribute: 'id', reflect: true }) id: string = (Math.random() * 4).toString(16).replace('.', '')
7515
- this._id = (Math.random() * 4).toString(16).replace('.', '');
7516
- this.itemObject = null;
7517
- this.selected = false;
7518
- this.multiSelect = false;
7519
- }
7520
- // @Event({ bubbles: true, composed: true }) loaded: EventEmitter<boolean>;
7521
- connectedCallback() { }
7522
- disconnectedCallback() { }
7523
- componentWillLoad() { }
7524
- componentDidLoad() {
7525
- this.itemObject = this.itemObject;
7526
- // setTimeout(() => {
7527
- // this.loaded.emit(true);
7528
- // }, 1000);
7529
- }
7530
- componentWillRender() { }
7531
- componentDidRender() { }
7532
- componentWillUpdate() { }
7533
- componentDidUpdate() { }
7534
- /**
7535
- * @desc
7536
- */
7537
- async select() {
7538
- this.sendSelect();
7539
- }
7540
- /**
7541
- * @desc
7542
- */
7543
- handleClick() {
7544
- this.sendSelect();
7545
- }
7546
- /**
7547
- * @desc
7548
- */
7549
- sendSelect() {
7550
- if (!this.disabled) {
7551
- var returnValue = null;
7552
- if (this.itemObject) {
7553
- typeof this.itemObject == 'string'
7554
- ? returnValue = JSON.parse(this.itemObject)
7555
- : returnValue = this.itemObject;
7556
- // returnValue = this.itemObject
7557
- }
7558
- else {
7559
- returnValue = this._id;
7560
- }
7561
- this.listSelected.emit(returnValue);
7562
- }
7563
- }
7564
- handleCheckboxClick(e) {
7565
- e.preventDefault();
7566
- }
7567
- render() {
7568
- const { size, disabled, selected, hidden, multiSelect } = this;
7569
- const classes = index$1.classnames('list-item', size, {
7570
- 'disabled': disabled,
7571
- 'selected': selected,
7572
- 'size-2': size === 'small' || size === 'medium',
7573
- 'size-3': size === 'large',
7574
- });
7575
- const hostClasses = index$1.classnames(hidden ? 'hidden' : null, {
7576
- 'disabled': disabled,
7577
- 'selected': selected,
7578
- 'checkable': multiSelect,
7579
- });
7580
- const checkboxClasses = index$1.classnames('checkbox', this.hidden ? 'hidden' : null, {
7581
- 'indeterminate': false
7582
- });
7583
- const checkboxIconClasses = index$1.classnames('icon');
7584
- return (index.h(index.Host, { class: hostClasses, onClick: () => this.handleClick() }, index.h("div", { class: classes }, multiSelect && (index.h("div", { class: "check-content" }, index.h("div", { class: checkboxClasses, onClick: (e) => this.handleCheckboxClick(e) }, index.h("input", { id: 'check-' + this._id, type: "checkbox", name: 'check-' + this._id, checked: this.selected, disabled: this.disabled }), index.h("label", { htmlFor: 'check-' + this._id }, index.h("span", { class: checkboxIconClasses }, index.h("svg", { class: "svg-icon icon-checked", width: "11", height: "9", viewBox: "0 0 11 9", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { d: "M1.91308 4.03516H1.91326C1.99256 4.03525 2.07081 4.05331 2.14213 4.08798C2.21341 4.12262 2.27591 4.17295 2.32497 4.2352L1.91308 4.03516ZM1.91308 4.03516H1.09394C0.890308 4.03516 0.776602 4.26975 0.902321 4.4292L0.902371 4.42927L4.11214 8.49567L4.11218 8.49573C4.32247 8.76188 4.72568 8.76114 4.93667 8.49617L4.93708 8.49566L10.6597 1.24398C10.6598 1.24378 10.66 1.24358 10.6602 1.24338C10.7884 1.08295 10.6699 0.85 10.4689 0.85H9.6498C9.48941 0.85 9.33668 0.9235 9.2376 1.05044C9.23751 1.05055 9.23742 1.05066 9.23734 1.05077L4.52403 7.02157M1.91308 4.03516L4.52403 7.02157M4.52403 7.02157L2.32506 4.23531L4.52403 7.02157Z", fill: "#BFBFBF", stroke: "#BFBFBF", "stroke-width": "0.3" }))))))), index.h("span", { id: "text" }, this.text ? this.text : index.h("slot", null)))));
7585
- }
7586
- get el() { return index.getElement(this); }
7587
- };
7588
- BcmListItem.style = listItemCss;
7589
-
7590
- const listSelectCss = "@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}.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}:host{display:inline-block;width:256px;margin:0 0 8px 0;overflow:hidden;max-width:100%}:host(.hidden){display:none}:host(.full-width){width:100%}:host(.type-autocomplete) #selected-container{border:none}:host(.type-autocomplete) #selected-container .selected-text{padding:0;border:none}:host(.type-autocomplete) #selected-container .selected-text bcm-input{display:contents}.container{display:block;max-width:256px;position:relative}.container.full-width{width:100%;max-width:100%}.selected{width:100%;box-sizing:border-box;color:var(--bcm-color-grey-8);background-color:var(--bcm-color-grey-1);display:flex;justify-content:space-between;align-items:center;border:1px solid var(--bcm-color-grey-5);user-select:none;cursor:pointer;border-radius:2px;position:relative}.selected:hover:not(.disabled){border-color:var(--bcm-color-prime-blue-5)}.selected:hover:not(.disabled) .select-clear-button{opacity:1}.selected:focus:not(.disabled){border-color:var(--bcm-color-prime-blue-5);box-shadow:0px 0px 4px var(--bcm-color-prime-blue-6)}.selected:focus:not(.disabled) .select-clear-button{opacity:1}.selected:focus{outline:none}.selected.disabled{background-color:var(--bcm-color-grey-3);color:var(--bcm-color-grey-8);cursor:not-allowed}.selected .buttons{padding:8px;height:100%;display:flex;align-items:center;justify-content:center}.selected .selected-text{padding:0 8px;width:100%;height:100%;flex:1;display:flex;align-items:center;overflow:hidden}.selected .selected-text .text-content{display:-webkit-box;overflow:hidden;-webkit-line-clamp:1;-webkit-box-orient:vertical}.selected .selected-tags{padding:0 4px;height:100%}.selected .tag-container{height:100%;display:flex;align-items:center;justify-content:flex-start;grid-gap:2px}.selected .tag-container>span{height:100%;align-items:center;justify-content:flex-start;display:flex;grid-gap:2px}.selected .tag-container .tag{max-width:200px}.selected .tag-container #other-tag{cursor:pointer}.selected .open,.selected .close{display:inline-flex}.selected .close{transform:rotate(180deg)}.selected .placeholder{color:var(--bcm-color-grey-6);user-select:none;font-size:14px;display:flex;align-items:center;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}.options-viewport{display:inline-block}.option-container{display:block;position:absolute;background-color:var(--bcm-color-grey-1);box-shadow:0px 2px 8px rgba(0, 0, 0, 0.15);box-sizing:border-box;width:100%;z-index:10000}.option-container.alignment-left{left:0}.option-container.alignment-right{right:0}.option-container.hidden{display:none}.option-container .search{position:sticky;padding:8px;margin-bottom:4px}.option-container .search:after{content:\"\";position:absolute;bottom:0;height:1px;width:calc(100% - 16px);background-color:var(--bcm-color-grey-5)}.items{display:flex;flex-direction:column}.buttons{display:flex}.select-clear-button{display:inline-flex;align-items:center;outline:none;border:none;background:none;padding:0;cursor:pointer;margin-right:4px;opacity:0}.label{display:block;color:var(--bcm-color-grey-9);margin-bottom:4px}.caption-area{min-height:20px}.input-caption{display:block}.selected-large{height:40px}.selected-medium{height:32px}.selected-small{height:24px}.caption-default{color:#8C8C8C}.caption-primary{color:#4293CF}.caption-success{color:#52C41A}.caption-warning{color:#FA8C16}.caption-error{color:#F5222D}.error .label{color:var(--bcm-color-red-6) !important}.error .selected{border:1px solid var(--bcm-color-red-6) !important}.spinner{position:absolute;z-index:1;top:0;opacity:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;background-color:#ffffff;visibility:hidden;transition:opacity 0.3s, visibility 0.5s}.spinner.show{visibility:visible;opacity:0.9}.spinner.first-run{visibility:visible;opacity:1}.tag{display:flex;align-items:center;justify-content:center;padding:0 8px;cursor:default;border-radius:48px;border:1px solid var(--bcm-color-grey-5);user-select:none;min-width:10px;min-height:20px;height:20px}.tag[hidden]{opacity:0 !important;position:absolute !important;z-index:-1}.tag .value{cursor:pointer;max-width:164px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:block}.tag.size-large{padding:calc(40px - 8px) 40px}.tag.size-medium{padding:calc(32px - 8px) 32px}.tag.size-small{padding:calc(24px - 8px) 24px}.tag.dissmisable{background-color:var(--bcm-color-grey-3);color:var(--bcm-color-grey-8)}.tag.dissmisable:hover{opacity:0.85}.tag.dissmisable{color:var(--bcm-color-grey-10)}.tag.dissmisable .close-button{width:14px;cursor:pointer}.tag.dissmisable .close-button bcm-icon,.tag.dissmisable .close-button .icon *{color:var(--bcm-color-grey-7)}.tag.dissmisable .close-button:hover bcm-icon,.tag.dissmisable .close-button:hover .icon *{color:var(--bcm-color-grey-10)}.tag span{display:inline-flex}.tag span.left{margin-right:4px}.tag span.right{margin-left:4px}.tag:before,.tag:after{content:\"\"}";
7591
-
7592
- const BcmListSelect = class {
7593
- constructor(hostRef) {
7594
- index.registerInstance(this, hostRef);
7595
- this.change = index.createEvent(this, "bcm-change", 7);
7596
- this.clear = index.createEvent(this, "bcm-clear", 7);
7597
- this.focus = index.createEvent(this, "bcm-focus", 7);
7598
- this.blur = index.createEvent(this, "bcm-blur", 7);
7599
- this.objectMapping = {
7600
- 'id': "id",
7601
- 'text': "text",
7602
- 'selected': "selected",
7603
- };
7604
- this.hidden = false;
7605
- this._id = (Math.random() * 4).toString(16).replace('.', '');
7606
- this._list_id = null;
7607
- this.value = null;
7608
- this._internal_id = (Math.random() * 4).toString(16).replace('.', '');
7609
- this.type = 'default';
7610
- this.size = 'medium';
7611
- this.placeholder = "Choose an option";
7612
- this.noCaption = false;
7613
- this.captionType = 'default';
7614
- this.fullWidth = false;
7615
- this.required = false;
7616
- this.multiSelect = false;
7617
- this.searchData = null;
7618
- this.searchPlaceholder = "Search";
7619
- this.searchFields = ['text'];
7620
- this.returnField = "id";
7621
- this.searchSub = "items";
7622
- this.searchText = "";
7623
- this.captionCache = null;
7624
- this.captionTypeCache = null;
7625
- this.isOpen = false;
7626
- this.selectArea = null;
7627
- this.selectAreaWidth = 0;
7628
- this.selectHiddenData = [];
7629
- this.otherList = [];
7630
- this.selectText = null;
7631
- this.selectData = [];
7632
- }
7633
- connectedCallback() { }
7634
- disconnectedCallback() { }
7635
- componentWillLoad() { }
7636
- componentDidLoad() {
7637
- this.selectArea = this.el.shadowRoot.querySelector(".selected-text");
7638
- this.selectAreaWidth = this.selectArea.clientWidth;
7639
- setTimeout(() => {
7640
- const spinner = this.el.shadowRoot.querySelector('.spinner');
7641
- spinner.classList.remove("first-run");
7642
- }, 100);
7643
- }
7644
- componentWillRender() { }
7645
- componentDidRender() {
7646
- if (this.selectAreaWidth === 0) {
7647
- this.selectArea = this.el.shadowRoot.querySelector(".selected-text");
7648
- this.selectAreaWidth = this.selectArea.clientWidth;
7649
- }
7650
- this.selectArea.style.width = "100%";
7651
- this.handleTagControl();
7652
- if (sessionStorage.getItem(this._internal_id + "-config")) {
7653
- this.config(JSON.parse(sessionStorage.getItem(this._internal_id + "-config")));
7654
- }
7655
- }
7656
- componentWillUpdate() { }
7657
- componentDidUpdate() { }
7658
- /**
7659
- * @descc
7660
- */
7661
- handleFocus() {
7662
- this.focus.emit();
7663
- }
7664
- /**
7665
- * @descc
7666
- */
7667
- handleBlur() {
7668
- this.blur.emit();
7669
- }
7670
- /**
7671
- * @desc
7672
- */
7673
- async resetCaption() {
7674
- this.caption = this.captionCache;
7675
- this.captionType = this.captionTypeCache;
7676
- this.captionError = null;
7677
- }
7678
- /**
7679
- * @descc
7680
- */
7681
- async handleOpen(list = "default") {
7682
- var element = null;
7683
- var list_id = null;
7684
- switch (list) {
7685
- case "default":
7686
- list_id = this._list_id;
7687
- break;
7688
- case "other":
7689
- list_id = "bcm-clone-list-" + this._internal_id;
7690
- break;
7691
- }
7692
- element = document.getElementById(list_id);
7693
- if (element != null) {
7694
- if (element.classList.contains("show") === true) {
7695
- element.hide();
7696
- }
7697
- else {
7698
- element.show();
7699
- }
7700
- }
7701
- }
7702
- /**
7703
- * @desc
7704
- */
7705
- async hide(list = "default") {
7706
- var element = null;
7707
- var list_id = null;
7708
- switch (list) {
7709
- case "default":
7710
- list_id = this._list_id;
7711
- break;
7712
- case "other":
7713
- list_id = "bcm-clone-list-" + this._internal_id;
7714
- break;
7715
- }
7716
- element = document.getElementById(list_id);
7717
- if (element != null) {
7718
- element.hide();
7719
- }
7720
- }
7721
- /**
7722
- * @desc
7723
- */
7724
- async show(list = "default") {
7725
- var element = null;
7726
- var list_id = null;
7727
- switch (list) {
7728
- case "default":
7729
- list_id = this._list_id;
7730
- break;
7731
- case "other":
7732
- list_id = "bcm-clone-list-" + this._internal_id;
7733
- break;
7734
- }
7735
- element = document.getElementById(list_id);
7736
- if (element != null) {
7737
- element.show();
7738
- }
7739
- }
7740
- /**
7741
- * @desc
7742
- */
7743
- async toggle(list = "default") {
7744
- this.handleOpen(list);
7745
- }
7746
- /**
7747
- * @descc
7748
- */
7749
- clickClear(e) {
7750
- e.stopPropagation();
7751
- }
7752
- /**
7753
- * @desc
7754
- */
7755
- async config(_config) {
7756
- this.selectArea = this.el.shadowRoot.querySelector(".selected-text");
7757
- this.selectArea.style.width = "100%";
7758
- this.selectAreaWidth = this.selectArea.clientWidth;
7759
- this.handleTagControl();
7760
- this.selectArea.style.width = this.selectAreaWidth - 16 + "px";
7761
- if (_config['searchPlaceholder']) {
7762
- this.searchPlaceholder = _config['searchPlaceholder'];
7763
- }
7764
- if (_config['searchFields']) {
7765
- this.searchFields = _config['searchFields'];
7766
- }
7767
- if (_config['returnField']) {
7768
- this.returnField = _config['returnField'];
7769
- }
7770
- if (_config['searchSub']) {
7771
- this.searchSub = _config['searchSub'];
7772
- }
7773
- if (_config['searchText']) {
7774
- this.searchText = _config['searchText'];
7775
- }
7776
- if (_config['mapping']) {
7777
- if (_config['mapping']['id']) {
7778
- this.objectMapping['id'] = _config['mapping']['id'];
7779
- }
7780
- if (_config['mapping']['text']) {
7781
- this.objectMapping['text'] = _config['mapping']['text'];
7782
- }
7783
- if (_config['mapping']['selected']) {
7784
- this.objectMapping['selected'] = _config['mapping']['selected'];
7785
- }
7786
- }
7787
- return _config;
7788
- }
7789
- /**
7790
- * @descc
7791
- */
7792
- async setValue(value, _id = "id", _text = "text") {
7793
- var newValue = value;
7794
- // this.searchData = JSON.parse(value as string)
7795
- this.handleLoading(true);
7796
- this.selectData = [];
7797
- this.otherList = [];
7798
- if (typeof value == 'string') {
7799
- if (this.value !== value) {
7800
- this.selectText = String(value);
7801
- this.value = this.selectText;
7802
- }
7803
- this.handleLoading(false);
7804
- }
7805
- else {
7806
- if (value) {
7807
- value.forEach(item => {
7808
- // console.log(item[id] + " " + item[text])
7809
- this.selectData.push({ id: item[_id], text: item[_text], selected: true });
7810
- });
7811
- }
7812
- if (this.value !== this.selectData) {
7813
- this.value = this.selectData;
7814
- if (value) {
7815
- newValue.forEach(element => {
7816
- // element[this.objectMapping['id']] = element[this.objectMapping['id']]
7817
- element[this.objectMapping['selected']] = true;
7818
- });
7819
- }
7820
- this.otherList = newValue;
7821
- var visibleTags = this.el.shadowRoot.getElementById("visible-tags");
7822
- if (visibleTags) {
7823
- visibleTags.innerHTML = " ";
7824
- const maxTags = Math.ceil((this.selectAreaWidth - 16) / 40);
7825
- const visibleSelectData = this.selectData.slice(0, maxTags);
7826
- visibleSelectData.map((item) => {
7827
- const newTag = document.createElement("span");
7828
- newTag.setAttribute("id", String(item["id"]));
7829
- newTag.setAttribute("value", item["text"]);
7830
- newTag.setAttribute("title", item["text"]);
7831
- newTag.setAttribute("_internal_id", this._internal_id);
7832
- // newTag.customStyle = customStyleTag
7833
- newTag.style.opacity = "0";
7834
- newTag.style.position = "absolute";
7835
- newTag.classList.add("tag");
7836
- newTag.classList.add("dissmisable");
7837
- newTag.classList.add("size-1");
7838
- newTag.setAttribute("_internal_id", this._internal_id);
7839
- newTag.innerHTML = '<span class="value"> ' + item["text"] + ' </span>'
7840
- + '<span id="close-button" ' + '_internal_id="' + this._internal_id + '" class="right close-button"> '
7841
- + '<svg class="icon" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> '
7842
- + '<g id="icon/outlined/suggested/close">'
7843
- + '<path id="Vector" d="M18.9275 4.07814L19.9219 5.07251C20.0103 5.1609 20.0103 5.24928 19.9219 5.33767L5.3378 19.9218C5.24941 20.0101 5.16102 20.0101 5.07263 19.9218L4.07826 18.9274C3.98987 18.839 3.98987 18.7506 4.07826 18.6622L18.6623 4.07814C18.7507 3.98975 18.8391 3.98975 18.9275 4.07814Z" fill="black"/>'
7844
- + '<path id="Vector_2" d="M5.33766 4.07814L19.9217 18.6622C20.0101 18.7506 20.0101 18.839 19.9217 18.9274L18.9274 19.9218C18.839 20.0101 18.7506 20.0101 18.6622 19.9218L4.07813 5.33767C3.98974 5.24928 3.98974 5.1609 4.07813 5.07251L5.0725 4.07814C5.16088 3.98975 5.24927 3.98975 5.33766 4.07814Z" fill="black"/>'
7845
- + '</g>'
7846
- + '</svg>'
7847
- + '</span>';
7848
- visibleTags.appendChild(newTag);
7849
- });
7850
- }
7851
- }
7852
- // this.selectHiddenData = this.value
7853
- }
7854
- // console.log('this.otherList: ', this.otherList)
7855
- // this.resetCaption()
7856
- return this.value;
7857
- }
7858
- /**
7859
- * @descc
7860
- * @param event
7861
- */
7862
- handleLoading(show = false) {
7863
- const spinner = this.el.shadowRoot.querySelector('.spinner');
7864
- if (show == true) {
7865
- spinner.classList.add("show");
7866
- }
7867
- else {
7868
- spinner.classList.remove("show");
7869
- }
7870
- }
7871
- /**
7872
- * @descc
7873
- */
7874
- resizeEvent() {
7875
- this.selectArea = this.el.shadowRoot.querySelector(".selected-text");
7876
- this.selectArea.style.width = "100%";
7877
- this.selectAreaWidth = this.selectArea.clientWidth;
7878
- this.handleTagControl();
7879
- this.selectArea.style.width = this.selectAreaWidth - 16 + "px";
7880
- }
7881
- /**
7882
- * @descc
7883
- */
7884
- async handleTagControl() {
7885
- this.selectHiddenData = [];
7886
- const tagcontainer = this.el.shadowRoot.getElementById("tagcontainer");
7887
- if (tagcontainer) {
7888
- var tags = tagcontainer.querySelectorAll(".tag");
7889
- var tagsWidth = 0;
7890
- // var otherStatus = false
7891
- var otherTagWidth = 135 + 2;
7892
- var padding = 16;
7893
- var visibleTags = [];
7894
- tags.forEach(element => {
7895
- element["hidden"] = false;
7896
- element["style"]["opacity"] = "0";
7897
- element["style"]["position"] = "absolute";
7898
- });
7899
- tags.forEach(element => {
7900
- var clientWidth = element.clientWidth <= 200 ? element.clientWidth : 200;
7901
- if ((this.selectAreaWidth - padding) > (clientWidth + 2 + tagsWidth)) {
7902
- tagsWidth += clientWidth + 2;
7903
- element["style"]["opacity"] = "1";
7904
- element["style"]["position"] = "relative";
7905
- }
7906
- else {
7907
- element["hidden"] = true;
7908
- // otherStatus = true
7909
- }
7910
- });
7911
- const removeTag = (calcOther = false) => {
7912
- if ((this.selectAreaWidth - padding) < (calcOther === true ? tagsWidth + otherTagWidth : tagsWidth)) {
7913
- visibleTags = Array.from(tags).filter(e => e["hidden"] === false);
7914
- if (visibleTags[visibleTags.length - 1]) {
7915
- var clientWidth = visibleTags[visibleTags.length - 1].clientWidth <= 200 ? visibleTags[visibleTags.length - 1].clientWidth : 200;
7916
- tagsWidth -= clientWidth + 2;
7917
- visibleTags[visibleTags.length - 1]["hidden"] = true;
7918
- removeTag(calcOther);
7919
- }
7920
- }
7921
- };
7922
- removeTag();
7923
- await utils.delay(100);
7924
- tags = tagcontainer.querySelectorAll(".tag");
7925
- var hiddenData = Array.from(tags).filter(e => e["hidden"] === true);
7926
- const otherTagcontainer = this.el.shadowRoot.getElementById("other-container");
7927
- if (Number(hiddenData.length) > 0) {
7928
- removeTag(true);
7929
- if (otherTagcontainer) {
7930
- otherTagcontainer.style.display = "flex";
7931
- const otherTag = otherTagcontainer.querySelector("bcm-tag");
7932
- if (otherTag) {
7933
- this.selectHiddenData = this.otherList;
7934
- Array.from(tags).filter(e => e["hidden"] === false).forEach(element => {
7935
- this.selectHiddenData = this.selectHiddenData.filter(e => String(e[this.objectMapping['id']]) !== String(element.id));
7936
- });
7937
- otherTag.setAttribute("value", this.selectHiddenData.length + " item" + (this.selectHiddenData.length > 1 ? 's' : '') + " selected");
7938
- var result = Object.keys(this.selectHiddenData).map((key) => (this.selectHiddenData[key][this.objectMapping['text']]).substring(0, 15) + "...").slice(0, 10) + "\r\n...";
7939
- const hiddenTagsString = result.toString().split(',').join("\r\n");
7940
- otherTag.setAttribute("title", hiddenTagsString);
7941
- }
7942
- }
7943
- }
7944
- else {
7945
- if (otherTagcontainer) {
7946
- otherTagcontainer.style.display = "none";
7947
- }
7948
- }
7949
- }
7950
- const cloneList = this.listIsInitialize();
7951
- if (cloneList) {
7952
- if (sessionStorage.getItem(this._internal_id + "-config")) {
7953
- cloneList.config(JSON.parse(sessionStorage.getItem(this._internal_id + "-config")));
7954
- }
7955
- // console.log('selectHiddenData: ', this.selectHiddenData )
7956
- cloneList.setDataOther(this.selectHiddenData);
7957
- // cloneList.show()
7958
- }
7959
- // await delay(100)
7960
- this.handleLoading(false);
7961
- }
7962
- /**
7963
- * @desc
7964
- */
7965
- listIsInitialize() {
7966
- // console.log("olusturuldu")
7967
- var element;
7968
- const elementId = "bcm-clone-list-" + this._internal_id;
7969
- const otherListInternalId = (Math.random() * 4).toString(16).replace('.', '');
7970
- if (!document.getElementById(elementId)) {
7971
- element = document.createElement("bcm-list");
7972
- var el = document.getElementById(this._list_id);
7973
- for (var i = 0, atts = el.attributes, n = atts.length; i < n; i++) {
7974
- element.setAttribute(atts[i].nodeName, atts[i].nodeValue);
7975
- }
7976
- element.setAttribute("id", elementId);
7977
- element.setAttribute("_list_id", this._list_id);
7978
- element.setAttribute("_list_select_id", this._id);
7979
- element.setAttribute("_internal_id", otherListInternalId);
7980
- element.searchable = true;
7981
- element.infoFooter = false;
7982
- element.type = "default";
7983
- element.processType = "deselect";
7984
- element.setAttribute("linked-component", this._id);
7985
- element.linkedComponent = this._id;
7986
- element.multiSelect = true;
7987
- const parentNode = this.el.parentNode;
7988
- parentNode.insertBefore(element, this.el);
7989
- }
7990
- else {
7991
- element = document.getElementById(elementId);
7992
- }
7993
- //
7994
- return element;
7995
- }
7996
- /**
7997
- * @descc
7998
- */
7999
- inputChange(e) {
8000
- this.search(e);
8001
- }
8002
- search(value) {
8003
- const element = document.getElementById(this._list_id);
8004
- if (element != null) {
8005
- element.setSearch(value);
8006
- }
8007
- }
8008
- /**
8009
- * @desc
8010
- */
8011
- async handleClick(event) {
8012
- var path = event.path || (event.composedPath && event.composedPath());
8013
- if (path && path.filter((input) => input['_internal_id'] == this._internal_id)[0]) {
8014
- const cloneElementId = "bcm-clone-list-" + this._internal_id;
8015
- const cloneElement = document.querySelector("#" + cloneElementId);
8016
- const element = document.querySelector("#" + this._list_id);
8017
- if (path.filter((input) => input['id'] == "close-button")[0]
8018
- && path.filter((input) => input['className'] == "tag dissmisable size-1")[0]
8019
- && path.filter((input) => input['className'] == "tag dissmisable size-1")[0]["id"]) {
8020
- event.preventDefault();
8021
- event.stopPropagation();
8022
- const selectedID = path.filter((input) => input['className'] == "tag dissmisable size-1")[0]["id"];
8023
- if (element) {
8024
- element.unChecked(selectedID);
8025
- }
8026
- }
8027
- if (path.filter((input) => input['id'] == "other-tag")[0]) {
8028
- event.preventDefault();
8029
- event.stopPropagation();
8030
- if (path.filter((input) => input['id'] == "close")[0]) {
8031
- if (cloneElement) {
8032
- if (await cloneElement.openStatus() === true) {
8033
- if (element) {
8034
- element.show();
8035
- }
8036
- }
8037
- }
8038
- var selectedIDs = [];
8039
- this.selectHiddenData.forEach(item => {
8040
- selectedIDs.push(item[this.objectMapping['id']]);
8041
- });
8042
- if (element) {
8043
- element.unChecked(selectedIDs);
8044
- }
8045
- }
8046
- else {
8047
- if (cloneElement) {
8048
- setTimeout(() => {
8049
- cloneElement.show();
8050
- }, 100);
8051
- }
8052
- }
8053
- }
8054
- }
8055
- }
8056
- render() {
8057
- const { label, fullWidth, required, selectText, selectData, placeholder, clearable, value, isOpen, noCaption, captionType, captionError, caption, size, disabled } = this;
8058
- // const classes = cs(
8059
- // 'card',
8060
- // this.size
8061
- // )
8062
- const hostClasses = index$1.classnames(this.hidden ? 'hidden' : null, 'type-' + this.type, {
8063
- 'full-width': fullWidth
8064
- });
8065
- const captionClasses = index$1.classnames('size-1', 'input-caption', 'caption-' + captionType);
8066
- const container = index$1.classnames('container', {
8067
- 'error': captionType == 'error' ? true : false,
8068
- 'full-width': fullWidth
8069
- });
8070
- const selectedText = index$1.classnames('selected-text');
8071
- const selected = index$1.classnames('selected', 'selected-' + size, {
8072
- 'size-3': size === 'large',
8073
- 'size-2': size === 'small' || size === 'medium',
8074
- 'disabled': disabled
8075
- });
8076
- // const customStyleTag = {
8077
- // 'cursor': 'pointer',
8078
- // 'max-width': '164px',
8079
- // 'text-overflow': 'ellipsis',
8080
- // 'white-space': 'nowrap',
8081
- // 'overflow': 'hidden',
8082
- // 'display': 'block'
8083
- // }
8084
- const customStyleOtherTag = {
8085
- 'cursor': 'pointer',
8086
- 'white-space': 'nowrap'
8087
- };
8088
- return (
8089
- // <Host class={hostClasses}>
8090
- // <div class={classes}>
8091
- // <slot />
8092
- // </div>
8093
- // </Host>
8094
- index.h(index.Host, { class: hostClasses, onFocus: () => this.handleFocus(), onBlur: () => this.handleBlur() }, index.h("div", { class: container }, label && index.h("label", { class: "label size-1", onClick: () => this.handleOpen() }, " ", label, " ", required === true && ('*'), " "), index.h("div", { id: "selected-container", class: selected, onClick: () => this.handleOpen(), tabIndex: -1 }, index.h("span", { class: selectedText, title: selectText !== null && (selectText) }, index.h("div", { class: "spinner first-run" }), this.type === 'select' && (selectText !== null && (index.h("div", { class: "text-content" }, selectText))), (this.type === 'select' || this.type === 'autocomplete' && this.multiSelect === true) && (selectText === null && (index.h("span", { id: "tagcontainer", class: "tag-container" }, index.h("span", { id: "visible-tags" }), index.h("span", { id: "other-container" }, index.h("bcm-tag", { _internal_id: this._internal_id, customStyle: customStyleOtherTag, type: "dissmisable", id: "other-tag" }))))), this.type === 'select' && (selectText === null && selectData.length === 0 && placeholder !== null && (index.h("span", { class: "placeholder" }, " ", placeholder, " "))), this.type === 'autocomplete' && (index.h("bcm-input", { "on-bcm-change": e => this.inputChange(e.detail), "full-width": true, placeholder: this.searchPlaceholder, id: "autocomplete", value: this.searchText, "no-caption": true, "no-margin": true, type: "search", clearable: true }))), this.type === 'select' && (index.h("div", { class: "buttons" }, clearable && value && (index.h("button", { class: "select-clear-button", onClick: (e) => this.clickClear(e) }, index.h("bcm-icon", { icon: "close-circle", type: "fill", size: 18, color: "grey-7" }))), index.h("span", { class: isOpen ? 'open' : 'close' }, index.h("bcm-icon", { icon: "caret-up", type: "outlined", size: 18, color: "grey-6" }))))), noCaption === false && (index.h("div", { class: "caption-area" }, captionType == "error"
8095
- ? index.h("span", { class: captionClasses }, " ", captionError, " ")
8096
- : caption && index.h("span", { class: captionClasses }, " ", caption, " "))))));
8097
- }
8098
- get el() { return index.getElement(this); }
8099
- };
8100
- BcmListSelect.style = listSelectCss;
8101
-
8102
- /**
8103
- * 'status' prop predefined values
8104
- */
8105
- var StatusProps;
8106
- (function (StatusProps) {
8107
- StatusProps["info"] = "info";
8108
- StatusProps["error"] = "error";
8109
- StatusProps["warning"] = "warning";
8110
- StatusProps["success"] = "success";
8111
- StatusProps["none"] = "none";
8112
- })(StatusProps || (StatusProps = {}));
8113
- /**
8114
- * 'type' prop predefined values
8115
- */
8116
- var TypeProps;
8117
- (function (TypeProps) {
8118
- TypeProps["modal"] = "modal";
8119
- TypeProps["information"] = "information";
8120
- TypeProps["confirmation"] = "confirmation";
8121
- })(TypeProps || (TypeProps = {}));
8122
- /**
8123
- * 'type' prop predefined values
8124
- */
8125
- var OrientationProps;
8126
- (function (OrientationProps) {
8127
- OrientationProps["portrait"] = "portrait";
8128
- OrientationProps["landscape"] = "landscape";
8129
- })(OrientationProps || (OrientationProps = {}));
8130
-
8131
- const modalCss = "@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}:host{display:block}:host(.hidden){display:none}.modal{display:flex;position:fixed;justify-content:center;align-items:flex-start;top:0;left:0;opacity:0;margin:0;padding:80px 40px 40px;overflow:hidden;overflow-y:auto;background-color:rgba(0, 0, 0, 0.5);box-sizing:border-box;z-index:-1000;width:100vw;height:100vh;visibility:hidden}.modal.show{visibility:visible;top:0;opacity:1;z-index:10500}.overlay{position:fixed;width:100vw;height:100vh;z-index:1;top:0;left:0}.card{display:flex;flex-direction:column;width:100%;box-shadow:0px 4px 12px rgba(0, 0, 0, 0.15);border-radius:2px;background-color:#fff;z-index:2}.card.portrait{max-width:312px}.card.landscape{max-width:475px}.card.small{width:576px}.card.medium{width:768px}.card.large{width:992px}.card.x-large{width:1024px}.card.xx-large{width:1200px}.card.xxx-large{width:1700px}.card.full-width{width:100%}.text-content{font-size:14px;line-height:22px;color:var(--bcm-color-grey-8);padding:0}.title{position:relative;display:flex;align-items:center;justify-content:flex-start;padding-right:24px;font-size:16px;line-height:24px;font-weight:500;color:var(--bcm-color-grey-9)}.title bcm-icon{margin-right:8px}p:not(.with-status){margin:0}p.with-status{padding-left:32px}header{position:relative;display:flex;align-items:center;justify-content:space-between;padding:16px 24px;font-size:16px;line-height:24px;font-weight:500;color:var(--bcm-color-grey-9);background-color:var(--bcm-color-grey-2);border-bottom:1px solid var(--bcm-color-grey-5)}header bcm-icon{cursor:pointer}footer{position:relative;display:flex;align-items:flex-start;justify-content:flex-end;padding:10px 16px;border-top:1px solid var(--bcm-color-grey-5);background-color:var(--bcm-color-grey-2)}footer bcm-button+bcm-button{margin-left:8px}.footer{display:flex;align-items:flex-start;justify-content:flex-end}.footer bcm-button+bcm-button{margin-left:8px}";
8132
-
8133
- /**
8134
- * @desc
8135
- * @param str
8136
- */
8137
- const lowercase$3 = (str) => str.toLowerCase();
8138
- const BcmModal = class {
8139
- constructor(hostRef) {
8140
- index.registerInstance(this, hostRef);
8141
- this.ok = index.createEvent(this, "bcm-ok", 7);
8142
- this.cancel = index.createEvent(this, "bcm-cancel", 7);
8143
- this.slotHeader = false;
8144
- this.slotContent = false;
8145
- this.slotFooter = false;
8146
- this.slotHeaderHtml = '';
8147
- this.slotContentHtml = '';
8148
- this.slotFooterHtml = '';
8149
- this.bodyStyleOverflow = '';
8150
- this.type = TypeProps.modal;
8151
- this.status = StatusProps.none;
8152
- this.okText = 'OK';
8153
- this.cancelText = 'Cancel';
8154
- this.isShow = false;
8155
- this.hidden = false;
8156
- this.size = 'medium';
8157
- this.fullWidth = false;
8158
- this.backdrop = true;
8159
- }
8160
- /**
8161
- * @StencilMethod
8162
- */
8163
- componentWillLoad() {
8164
- if (this.type !== TypeProps.modal && this.status === StatusProps.none)
8165
- this.status = StatusProps.info;
8166
- // if ( this.el.querySelector('bcm-modal-header') ) {
8167
- // this.slotHeaderHtml = this.el.querySelector('bcm-modal-header').innerHTML
8168
- // this.slotHeader = true
8169
- // }
8170
- // if ( this.el.querySelector('bcm-modal-content') ) {
8171
- // this.slotContentHtml = this.el.querySelector('bcm-modal-content').outerHTML
8172
- // this.slotContent = true
8173
- // }
8174
- // if ( this.el.querySelector('bcm-modal-footer') ) {
8175
- // this.slotFooter = true
8176
- // }
8177
- }
8178
- componentDidRender() {
8179
- const slot = this.el.shadowRoot.querySelector('slot').assignedElements();
8180
- slot.map(el => {
8181
- if (String(el.tagName).toLowerCase() === 'bcm-modal-header') {
8182
- el.slot = 'header';
8183
- this.headerArea = true;
8184
- }
8185
- if (String(el.tagName).toLowerCase() === 'bcm-modal-footer') {
8186
- el.slot = 'footer';
8187
- this.footerArea = true;
8188
- }
8189
- });
8190
- }
8191
- /**
8192
- * @desc
8193
- * @returns {BcmIcon}
8194
- */
8195
- getIcon() {
8196
- switch (this.status) {
8197
- case StatusProps.info:
8198
- return index.h("bcm-icon", { type: "outlined", icon: "info-circle", size: "medium", color: "prime-blue-6" });
8199
- case StatusProps.error:
8200
- return index.h("bcm-icon", { type: "outlined", icon: "close-circle", size: "medium", color: "red-6" });
8201
- case StatusProps.warning:
8202
- return index.h("bcm-icon", { type: "outlined", icon: "exclamation-circle", size: "medium", color: "warmyellow-6" });
8203
- case StatusProps.success:
8204
- return index.h("bcm-icon", { type: "outlined", icon: "check-circle", size: "medium", color: "green-6" });
8205
- }
8206
- }
8207
- /**
8208
- * @desc
8209
- */
8210
- handleOk() {
8211
- this.ok.emit();
8212
- this.isShow = false;
8213
- }
8214
- /**
8215
- * @desc
8216
- */
8217
- handleCancel() {
8218
- this.cancel.emit();
8219
- this.isShow = false;
8220
- }
8221
- /**
8222
- * @desc
8223
- * @returns {BcmIcon}
8224
- */
8225
- getFooterActions() {
8226
- return ((this.footerArea && (index.h("footer", null, " ", index.h("slot", { name: "footer" }), " "))));
8227
- }
8228
- handleSubmit(e) {
8229
- if (lowercase$3(e.target.nodeName) === 'bcm-button') {
8230
- if (e.target.dataDismiss) {
8231
- this.dismiss();
8232
- }
8233
- }
8234
- }
8235
- /**
8236
- * @desc Removes component itself
8237
- */
8238
- dismiss() {
8239
- this.isShow = false;
8240
- document.querySelector("body").style.overflow = this.bodyStyleOverflow;
8241
- // this.el.remove()
8242
- }
8243
- handleBackdrop() {
8244
- if (this.backdrop == true) {
8245
- this.dismiss();
8246
- }
8247
- }
8248
- /**
8249
- * @desc
8250
- */
8251
- async hide() {
8252
- this.dismiss();
8253
- }
8254
- /**
8255
- * @desc
8256
- */
8257
- async show() {
8258
- this.isShow = true;
8259
- if (document.querySelector("body").style.overflow != "hidden") {
8260
- this.bodyStyleOverflow = document.querySelector("body").style.overflow;
8261
- }
8262
- document.querySelector("body").style.overflow = "hidden";
8263
- // const bcmTabs = this.el.querySelector('bcm-tabs')
8264
- // if ( bcmTabs ) {
8265
- // var getActiveTab = await bcmTabs.getActiveTab()
8266
- // bcmTabs.active( getActiveTab )
8267
- // }
8268
- }
8269
- keyboardNavigation(e) {
8270
- if (this.backdrop == true) {
8271
- const which = e.which || 0;
8272
- if (which == 27) {
8273
- e.preventDefault();
8274
- this.dismiss();
8275
- }
8276
- }
7294
+ this.type = Bcm$1.Status.default;
8277
7295
  }
8278
7296
  render() {
8279
- const { type, status, headerTitle, isShow, headerArea, size, fullWidth } = this;
8280
- const cardClasses = index$1.classnames('card', status, size, fullWidth ? 'full-width' : null);
8281
- const modal = index$1.classnames('modal', {
8282
- 'show': isShow
8283
- });
8284
- const hostClasses = index$1.classnames(this.hidden ? 'hidden' : null);
8285
- return (index.h(index.Host, { class: hostClasses }, index.h("div", { class: modal }, index.h("div", { class: "overlay", onClick: () => this.handleBackdrop() }), index.h("div", { class: cardClasses }, type === TypeProps.modal && (headerArea && (index.h("header", null, index.h("slot", { name: "header" }), " ", index.h("bcm-icon", { icon: "close", color: "grey-10", onClick: () => this.dismiss() })))), index.h("div", { class: "text-content" }, type !== TypeProps.modal && (index.h("span", { class: "title" }, this.getIcon(), headerArea && (index.h("slot", { name: "header" })), !headerArea && (headerTitle))), index.h("p", { class: type !== TypeProps.modal ? 'with-status' : '' }, index.h("slot", null)), type !== TypeProps.modal && this.getFooterActions()), type === TypeProps.modal && (this.getFooterActions())))));
7297
+ const { required, value, size, form, htmlFor, hidden, type, tooltip } = this;
7298
+ const hostClasses = index$1.classnames('bcm-label', { hidden });
7299
+ const Label = (index.h(LabelTemplate, { form: form, htmlFor: htmlFor, value: value, size: size, type: type, required: required }));
7300
+ return (index.h(index.Host, null, index.h("div", { class: hostClasses }, Label, tooltip && (index.h("bcm-tooltip", { message: tooltip, placement: 'top', trigger: 'hover' }, index.h("bcm-icon", { color: "grey-8", icon: "question-circle", type: "fill" }))))));
8286
7301
  }
8287
7302
  get el() { return index.getElement(this); }
8288
7303
  };
8289
- BcmModal.style = modalCss;
8290
-
8291
- /**
8292
- * 'color' prop predefined values
8293
- */
8294
- var ColorProps;
8295
- (function (ColorProps) {
8296
- ColorProps["black"] = "black";
8297
- ColorProps["white"] = "white";
8298
- ColorProps["prime-blue"] = "prime-blue";
8299
- ColorProps["grey"] = "grey";
8300
- ColorProps["blue"] = "blue";
8301
- ColorProps["warmyellow"] = "warmyellow";
8302
- ColorProps["yellow"] = "yellow";
8303
- ColorProps["limegreen"] = "limegreen";
8304
- ColorProps["red"] = "red";
8305
- ColorProps["darkorange"] = "darkorange";
8306
- ColorProps["orange"] = "orange";
8307
- ColorProps["green"] = "green";
8308
- ColorProps["turquosie"] = "turquosie";
8309
- ColorProps["cobaltblue"] = "cobaltblue";
8310
- ColorProps["magenta"] = "magenta";
8311
- ColorProps["purple"] = "purple";
8312
- ColorProps["bc-red"] = "bc-red";
8313
- ColorProps["bc-blue"] = "bc-blue";
8314
- ColorProps["bc-green"] = "bc-green";
8315
- ColorProps["bc-orange"] = "bc-orange";
8316
- })(ColorProps || (ColorProps = {}));
8317
-
8318
- const radioCss = "@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}:host{display:inline-block}:host(.hidden){display:none}input[type=radio]{position:absolute;width:0;height:0;opacity:0}label{user-select:none;display:inline-flex;align-items:center;color:var(--bcm-color-grey-8);cursor:pointer}.radio-container .radio{width:16px;height:16px;min-width:16px;min-height:16px;border:1px solid var(--bcm-color-grey-5);border-radius:100%;background-color:var(--bcm-color-grey-1);box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;transition-duration:0.3s;margin-right:8px}.radio-container .radio .inner{width:8px;height:8px;border-radius:100%;background-color:var(--bcm-color-grey-1)}.radio-container:hover:not(.disabled) .radio{border-color:var(--bcm-color-prime-blue-6);filter:drop-shadow(0px 2px 4px rgba(54, 121, 171, 0.5))}.radio-container.disabled{color:var(--bcm-color-grey-6);cursor:not-allowed}.radio-container.disabled .radio{border-color:var(--bcm-color-grey-5)}.radio-container.checked .radio{border-color:var(--bcm-color-prime-blue-6)}.radio-container.checked .inner{background-color:var(--bcm-color-prime-blue-6)}.radio-container.checked.disabled .radio{background-color:var(--bcm-color-grey-3);border-color:var(--bcm-color-grey-5)}.radio-container.checked.disabled .inner{background-color:var(--bcm-color-grey-6)}.radio-button{background-color:var(--bcm-color-grey-1);color:var(--bcm-color-grey-8);border:1px solid var(--bcm-color-grey-5);padding:0 16px;box-sizing:border-box}.radio-button:hover:not(.disabled){color:var(--bcm-color-prime-blue-5)}.radio-button:active:not(.disabled){color:var(--bcm-color-prime-blue-7)}.radio-button.disabled{background-color:var(--bcm-color-grey-3);color:var(--bcm-color-grey-6);cursor:not-allowed}.radio-button.checked.disabled{background-color:var(--bcm-color-grey-4);color:var(--bcm-color-grey-1);border-color:var(--bcm-color-grey-5)}.radio-button.checked.solid{color:var(--bcm-color-grey-1);background-color:var(--bcm-color-prime-blue-6);border-color:var(--bcm-color-prime-blue-6)}.radio-button.checked.solid:hover{background-color:var(--bcm-color-prime-blue-5);border-color:var(--bcm-color-prime-blue-5)}.radio-button.checked.solid:active{background-color:var(--bcm-color-prime-blue-7);border-color:var(--bcm-color-prime-blue-7)}.radio-button.checked.outline{background-color:var(--bcm-color-grey-1);color:var(--bcm-color-prime-blue-6);border-color:var(--bcm-color-prime-blue-6)}.radio-button.checked.outline:hover{color:var(--bcm-color-prime-blue-5);border-color:var(--bcm-color-prime-blue-5)}.radio-button.checked.outline:active{color:var(--bcm-color-prime-blue-7);border-color:var(--bcm-color-prime-blue-7)}.radio-button.large{height:40px}.radio-button.medium{height:32px}.radio-button.small{height:24px}";
8319
-
8320
- const BcmRadio = class {
8321
- constructor(hostRef) {
8322
- index.registerInstance(this, hostRef);
8323
- this.change = index.createEvent(this, "bcm-change", 3);
8324
- this.focus = index.createEvent(this, "bcm-focus", 3);
8325
- this.blur = index.createEvent(this, "bcm-blur", 3);
8326
- this.optionType = 'default';
8327
- this.buttonStyle = 'solid';
8328
- this.size = 'medium';
8329
- this.hidden = false;
8330
- this.required = false;
8331
- }
8332
- handleFocus() {
8333
- this.focus.emit();
8334
- }
8335
- handleBlur() {
8336
- this.blur.emit();
8337
- }
8338
- /**
8339
- * @desc
8340
- * @param name -
8341
- * @returns {void}
8342
- */
8343
- async check(uncheck) {
8344
- this.radio.checked = uncheck;
8345
- this.handleChange();
8346
- }
8347
- handleChange() {
8348
- this.checked = this.radio.checked;
8349
- this.change.emit({
8350
- value: this.radio.value,
8351
- checked: this.radio.checked
8352
- });
8353
- }
8354
- connectedCallback() {
8355
- this.handleChange = this.handleChange.bind(this);
8356
- this.handleFocus = this.handleFocus.bind(this);
8357
- this.handleBlur = this.handleBlur.bind(this);
8358
- }
8359
- getColor(color) {
8360
- if (this.color !== 'default' && this.optionType == 'button' && this.checked)
8361
- return {
8362
- // color: extractColor(ColorPalette, ColorProps[color] + '-6'),
8363
- borderColor: utils.extractColor(colors.ColorPalette, ColorProps[color] + '-5'),
8364
- backgroundColor: utils.extractColor(colors.ColorPalette, ColorProps[color] + '-5')
8365
- };
8366
- }
8367
- render() {
8368
- const { checked, value, disabled, optionType, buttonStyle, size } = this;
8369
- const defaultClasses = index$1.classnames('radio-container', 'size-2', {
8370
- 'checked': checked,
8371
- 'disabled': disabled
8372
- });
8373
- const buttonClasses = index$1.classnames('radio-button', buttonStyle, size, {
8374
- 'size-2': size === 'small' || size === 'medium',
8375
- 'size-3': size === 'large',
8376
- 'checked': checked,
8377
- 'disabled': disabled,
8378
- });
8379
- const hostClasses = index$1.classnames(this.hidden ? 'hidden' : null);
8380
- return (index.h(index.Host, { class: hostClasses, onFocus: this.handleFocus, onBlur: this.handleBlur }, index.h("label", { class: optionType == 'default' ? defaultClasses : buttonClasses, style: this.getColor(this.color) }, index.h("input", { type: "radio", value: value, checked: checked, ref: el => (this.radio = el), onChange: this.handleChange, disabled: disabled }), optionType === 'default' && (index.h("span", { class: "radio" }, index.h("span", { class: "inner" }))), index.h("slot", null))));
8381
- }
8382
- };
8383
- BcmRadio.style = radioCss;
7304
+ BcmLabel.style = labelCss;
8384
7305
 
8385
- 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}:host{display:block;margin:0 0 8px 0}:host(.hidden){display:none}:host(.error) label{color:var(--bcm-color-red-6) !important}.caption-default{color:#8C8C8C}.caption-primary{color:#4293CF}.caption-success{color:#52C41A}.caption-warning{color:#FA8C16}.caption-error{color:#F5222D}.radio-group{display:flex}.radio-group.horizontal{flex-direction:row;margin-bottom:5px}.radio-group.horizontal ::slotted(bcm-radio:not(:last-of-type)){margin-right:16px}.radio-group.horizontal bcm-radio:not(:last-of-type){margin-right:16px}.radio-group.vertical{flex-direction:column}.radio-group.vertical label{margin-bottom:4px}.radio-group.vertical ::slotted(bcm-radio:not(:last-of-type)){margin-bottom:8px}.radio-group.vertical bcm-radio:not(:last-of-type){margin-bottom:8px}.label{display:flex;flex-direction:column;color:var(--bcm-color-grey-9);padding-right:4px;margin-right:8px;margin-bottom:8px}.caption-area{min-height:20px}.input-caption{display:block}";
7306
+ const switchCss = "@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}:host{display:inline-block;margin:0 0 8px 0}:host(.hidden){display:none}*{box-sizing:border-box}.wrapper{display:inline-flex;padding-top:0px;padding-bottom:5px}.wrapper .active-text{color:var(--bcm-color-prime-blue-6);margin-left:4px}.wrapper .inactive-text{color:var(--bcm-color-grey-6);margin-right:4px}.container{display:flex;justify-content:space-between;align-items:center;border-radius:16px;background-color:var(--bcm-color-grey-6);position:relative}.container .handle{padding:1px;position:absolute;background-color:var(--bcm-color-grey-1);display:inline-flex;align-items:center;justify-content:center;border-radius:16px;transition:all 0.2s ease-in-out;box-shadow:0px 2px 2px rgba(0, 0, 0, 0.1), 0px 3px 1px rgba(0, 0, 0, 0.05), 0px 1px 5px rgba(0, 0, 0, 0.1)}.container .icon-active{opacity:0}.container .icon-inactive{opacity:1}.container.small{width:28px;min-width:28px;height:16px;padding:4px}.container.small .handle{width:12px;height:12px;left:4px}.container.small.switch-checked .handle{left:12px}.container.small:active:not(.disabled) .handle{width:16px}.container.small:active.switch-checked:not(.disabled) .handle{left:8px}.container.small .spinner{box-sizing:border-box;display:inline-flex;width:9px;height:9px;border-radius:50%;border:1px solid var(--bcm-color-grey-1);border-top-color:var(--bcm-color-grey-6);animation:spinner 1.5s linear infinite}.container.medium{width:44px;min-width:44px;height:22px;padding:4px}.container.medium .handle{width:16px;height:16px;left:4px}.container.medium.switch-checked .handle{left:24px}.container.medium:active:not(.disabled) .handle{width:22px}.container.medium:active.switch-checked:not(.disabled) .handle{left:18px}.container.medium .spinner{box-sizing:border-box;display:inline-flex;width:13px;height:13px;border-radius:50%;border:1px solid var(--bcm-color-grey-1);border-top-color:var(--bcm-color-grey-6);animation:spinner 1.5s linear infinite}.container.switch-checked{background-color:var(--bcm-color-prime-blue-6)}.container.switch-checked .icon-active{color:var(--bcm-color-grey-1);opacity:1}.container.switch-checked .icon-inactive{opacity:0}.container.switch-checked .spinner{border-top-color:var(--bcm-color-prime-blue-6)}.wrapper.disabled{opacity:40%;cursor:not-allowed}@keyframes spinner{to{transform:rotate(360deg)}}input[type=checkbox]{position:absolute;width:0;height:0;opacity:0}.label{display:flex;flex-direction:column;color:var(--bcm-color-grey-9);padding-right:4px;margin-right:8px;margin-bottom:8px}.caption-area{min-height:20px}.input-caption{display:block}:host(.error) .label{color:var(--bcm-color-red-6) !important}.caption-default{color:#8C8C8C}.caption-primary{color:#4293CF}.caption-success{color:#52C41A}.caption-warning{color:#FA8C16}.caption-error{color:#F5222D}";
8386
7307
 
8387
- const BcmRadioGroup = class {
7308
+ const BcmSwitch = class {
8388
7309
  constructor(hostRef) {
8389
7310
  index.registerInstance(this, hostRef);
8390
7311
  this.change = index.createEvent(this, "bcm-change", 7);
8391
- this.childRadios = [];
8392
- this.direction = 'horizontal';
8393
- this.optionType = 'default';
8394
- this.buttonStyle = 'solid';
7312
+ this.focus = index.createEvent(this, "bcm-focus", 7);
7313
+ this.blur = index.createEvent(this, "bcm-blur", 7);
7314
+ this.checked = false;
8395
7315
  this.size = 'medium';
7316
+ this.pending = false;
8396
7317
  this.disabled = false;
8397
7318
  this.hidden = false;
7319
+ this.value = '';
8398
7320
  this.label = null;
8399
7321
  this.required = false;
8400
7322
  this.noCaption = false;
8401
7323
  this.captionType = 'default';
8402
- this.radioOptions = [];
8403
- this.usingSlots = true;
8404
- }
8405
- async setData(_data) {
8406
- setTimeout(() => {
8407
- this.options = _data;
8408
- }, 100);
8409
- return Promise.resolve(true);
8410
- }
8411
- async getValue() {
8412
- return this.value;
8413
- }
8414
- async check(value) {
8415
- this.defaultValue = value;
8416
- this.value = value;
8417
- }
8418
- async setClear() {
8419
- this.value = '';
8420
- }
8421
- async resetCaption() {
8422
- this.caption = this.captionCache;
8423
- this.captionType = this.captionTypeCache;
8424
- this.captionError = null;
8425
- }
8426
- parseOptions(newValue) {
8427
- if (newValue) {
8428
- typeof newValue === 'string'
8429
- ? this.radioOptions = JSON.parse(newValue)
8430
- : this.radioOptions = newValue;
8431
- if (this.radioOptions.length > 0)
8432
- this.usingSlots = false;
8433
- }
8434
- }
8435
- // If checked radio changes, emits change event
8436
- handleChange(newValue) {
8437
- this.change.emit(newValue);
8438
- }
8439
- // Controls radios styles and states
8440
- controlRadio(elements) {
8441
- elements.forEach((radio) => {
8442
- radio.checked = this.value ? radio.value === this.value : this.defaultValue ? radio.value === this.defaultValue : null;
8443
- radio.disabled = this.disabled;
8444
- radio.optionType = this.optionType;
8445
- radio.buttonStyle = this.buttonStyle;
8446
- radio.size = this.size;
8447
- radio.addEventListener('bcm-change', (e) => {
8448
- e.stopPropagation();
8449
- if (e.detail.checked) {
8450
- this.value = radio.value;
8451
- }
8452
- }, { once: true });
8453
- });
8454
7324
  }
8455
7325
  connectedCallback() {
8456
7326
  this.captionCache = this.caption;
8457
7327
  this.captionTypeCache = this.captionType;
8458
7328
  }
8459
- componentWillLoad() {
8460
- this.parseOptions(this.options);
8461
- }
8462
- componentDidRender() {
8463
- let elements = [];
8464
- if (this.usingSlots) {
8465
- elements = this.host.shadowRoot.querySelector('slot').assignedElements();
8466
- this.childRadios = [];
8467
- elements.map(el => {
8468
- String(el.tagName).toLowerCase() == 'bcm-radio' && this.childRadios.push(el);
8469
- });
8470
- this.controlRadio(this.childRadios);
8471
- }
8472
- else {
8473
- elements = Array.from(this.host.shadowRoot.querySelectorAll('bcm-radio'));
8474
- this.controlRadio(elements);
8475
- }
8476
- }
8477
- render() {
8478
- const { label, required, noCaption, caption, captionError, captionType } = this;
8479
- const classes = index$1.classnames('radio-group', {
8480
- [this.direction]: this.optionType === 'default'
8481
- });
8482
- const hostClasses = index$1.classnames(this.hidden ? 'hidden' : null, {
8483
- 'error': captionType == 'error' ? true : false
8484
- });
8485
- const captionClasses = index$1.classnames('size-1', 'input-caption', 'caption-' + captionType);
8486
- if (this.radioOptions) {
8487
- return (index.h(index.Host, { class: hostClasses }, label && index.h("label", { class: "label size-1" }, " ", label, " ", required && ('*'), " "), index.h("div", { class: classes }, this.radioOptions && this.radioOptions.map(radio => (index.h("bcm-radio", { value: radio.value, disabled: radio.disabled, checked: radio.checked }, " ", radio.label, " "))), index.h("slot", null)), !noCaption && (index.h("div", { class: "caption-area" }, captionType == "error"
8488
- ? index.h("span", { class: captionClasses }, " ", captionError, " ")
8489
- : caption && index.h("span", { class: captionClasses }, " ", caption, " ")))));
8490
- }
8491
- return (index.h(index.Host, { class: hostClasses }, index.h("div", { class: classes }, index.h("slot", null))));
8492
- }
8493
- get host() { return index.getElement(this); }
8494
- static get watchers() { return {
8495
- "options": ["parseOptions"],
8496
- "value": ["handleChange"]
8497
- }; }
8498
- };
8499
- BcmRadioGroup.style = groupCss;
8500
-
8501
- const searchCss = "@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}:host{display:block}:host(.hidden){display:none}";
8502
-
8503
- const lowercase$4 = (str) => str.toLowerCase();
8504
- const BcmSearch = class {
8505
- constructor(hostRef) {
8506
- index.registerInstance(this, hostRef);
8507
- this.bcmOnSearch = index.createEvent(this, "bcm-on-search", 7);
8508
- this.bcmOnSearchValue = index.createEvent(this, "bcm-on-search-value", 7);
8509
- this.data = [];
8510
- this.searchFields = ['text', 'value' /*, ...*/];
8511
- this.returnField = 'idx';
8512
- this.searchSub = null;
8513
- this.hidden = false;
8514
- this.onlyChild = false;
8515
- this.clearable = false;
8516
- this.searchValue = '';
8517
- this.searchPlaceholder = 'Search';
8518
- this.disabled = false;
8519
- this._internal_id = (Math.random() * 4).toString(16).replace('.', '');
8520
- this.results = [];
7329
+ handleClick() {
7330
+ this.checked = this.input.checked;
7331
+ this.value = this.checked;
7332
+ this.change.emit(this.checked);
8521
7333
  }
8522
7334
  componentDidLoad() {
8523
- this.el.shadowRoot.querySelector('bcm-input').clearable = this.clearable;
7335
+ this.value = this.checked;
8524
7336
  }
8525
- listenBcmChange(e) {
8526
- e.stopPropagation();
7337
+ handleFocus() {
7338
+ this.focus.emit();
8527
7339
  }
8528
- async setValue(value) {
8529
- const input = this.el.shadowRoot.querySelector('bcm-input');
8530
- await input.setValue(value);
8531
- return value;
7340
+ handleBlur() {
7341
+ this.blur.emit();
8532
7342
  }
8533
- async select() {
8534
- const input = this.el.shadowRoot.querySelector('bcm-input');
8535
- await input.select();
8536
- this.bcmOnSearch.emit(true);
8537
- return true;
7343
+ componentWillRender() {
7344
+ if (this.pending) {
7345
+ this.disabled = true;
7346
+ }
8538
7347
  }
8539
7348
  async setClear() {
8540
- const input = this.el.shadowRoot.querySelector('bcm-input');
8541
- await input.setClear();
8542
- this.bcmOnSearch.emit(true);
8543
- return true;
8544
- }
8545
- async searchArray(value, idFields = null) {
8546
- // console.log(this.data)
8547
- let cacheSearchFields = this.searchFields;
8548
- let arrayResult = [];
8549
- if (idFields) {
8550
- this.searchFields = [idFields];
8551
- }
8552
- value.forEach(item => {
8553
- // item = {[idFields]:item}
8554
- this.results = [];
8555
- // console.log(this.data)
8556
- this.nestedSearch(this.data, item, true);
8557
- arrayResult.push(...this.results);
8558
- });
8559
- this.searchFields = cacheSearchFields;
8560
- return arrayResult;
8561
- // const input = this.el.shadowRoot.querySelector("bcm-input");
8562
- // await input.setValue( value )
8563
- // return value
8564
- }
8565
- nestedSearch(items, value, equal = false) {
8566
- var result;
8567
- items.map((item) => {
8568
- this.searchFields.map(searchField => {
8569
- if (searchField in item) {
8570
- // debugger;
8571
- item[searchField] = lowercase$4(String(item[searchField]));
8572
- if (this.onlyChild) {
8573
- if (item[this.searchSub]) {
8574
- var temp = this.nestedSearch(item[this.searchSub], value, equal);
8575
- if (temp) {
8576
- this.results.push((result = String(item[this.returnField])));
8577
- this.results.push(temp);
8578
- }
8579
- }
8580
- else {
8581
- if (equal) {
8582
- // console.log(value)
8583
- if (item[searchField] == lowercase$4(String(value))) {
8584
- // if (item == lowercase(value)) {
8585
- this.results.push((result = String(item[this.returnField])));
8586
- // this.results.push (result = String(item))
8587
- }
8588
- }
8589
- else {
8590
- if (item[searchField].indexOf(lowercase$4(value)) !== -1) {
8591
- this.results.push((result = String(item[this.returnField])));
8592
- }
8593
- }
8594
- }
8595
- }
8596
- else {
8597
- if (item[this.searchSub]) {
8598
- var temp = this.nestedSearch(item[this.searchSub], value, equal);
8599
- if (temp) {
8600
- this.results.push((result = String(item[this.returnField])));
8601
- this.results.push(temp);
8602
- }
8603
- }
8604
- if (equal) {
8605
- // console.log(value)
8606
- if (item[searchField] == lowercase$4(String(value))) {
8607
- // if (item == lowercase(value)) {
8608
- this.results.push((result = String(item[this.returnField])));
8609
- // this.results.push (result = String(item))
8610
- }
8611
- }
8612
- else {
8613
- if (item[searchField].indexOf(lowercase$4(value)) !== -1) {
8614
- this.results.push((result = String(item[this.returnField])));
8615
- }
8616
- }
8617
- }
8618
- }
8619
- });
8620
- });
8621
- return result;
8622
- }
8623
- /**
8624
- * @desc
8625
- * @param value
8626
- */
8627
- inputChange(value) {
8628
- this.results = [];
8629
- // data prop'unda arama yapılacak (searchFields prop'u içerisindeki alanlar ile)
8630
- // arama sonucunda eşleyen itemların 'idx', index
8631
- // değerleri, array şeklinde root component'e
8632
- // event ile gönderilecek
8633
- // Örneğin value == 'to' olduğunda aşağıdaki
8634
- // sonuçlar filtrelenmeli
8635
- // -->
8636
- //{ text: 'Mateusz Eaton', idx: 2 },
8637
- //{ text: 'Tony Vickers', idx: 3 },
8638
- // result array'i eşleşen itemların
8639
- // index numaralarını tutacak
8640
- // results = [2, 3]
8641
- // Örnek arama
8642
- // #
8643
- this.nestedSearch(this.data, value);
8644
- this.results = Array.from(new Set(this.results));
8645
- (value && ((this.results.length > 0 && this.bcmOnSearch.emit(this.results)) || this.bcmOnSearch.emit([-1]))) || this.bcmOnSearch.emit(true);
8646
- this.bcmOnSearchValue.emit(value);
8647
- }
8648
- render() {
8649
- const hostClasses = index$1.classnames(this.hidden ? 'hidden' : null);
8650
- return (index.h(index.Host, { class: hostClasses }, index.h("bcm-input", { placeholder: this.searchPlaceholder, "no-caption": true, "no-margin": true, "full-width": true, disabled: this.disabled, type: "search", "on-bcm-change": e => this.inputChange(e.detail), value: this.searchValue })));
8651
- }
8652
- get el() { return index.getElement(this); }
8653
- static get watchers() { return {
8654
- "searchValue": ["inputChange"]
8655
- }; }
8656
- };
8657
- BcmSearch.style = searchCss;
8658
-
8659
- /**
8660
- * 'size' prop predefined values
8661
- */
8662
- var SizeProps;
8663
- (function (SizeProps) {
8664
- SizeProps["large"] = "large";
8665
- SizeProps["medium"] = "medium";
8666
- SizeProps["small"] = "small";
8667
- })(SizeProps || (SizeProps = {}));
8668
- /**
8669
- * 'type' prop predefined values
8670
- */
8671
- var TypeProps$1;
8672
- (function (TypeProps) {
8673
- TypeProps["normal"] = "normal";
8674
- TypeProps["pane"] = "pane";
8675
- TypeProps["stepper"] = "stepper";
8676
- })(TypeProps$1 || (TypeProps$1 = {}));
8677
- /**
8678
- * 'direction' prop predefined values
8679
- */
8680
- var DirectionProps;
8681
- (function (DirectionProps) {
8682
- DirectionProps["horizontal"] = "horizontal";
8683
- DirectionProps["vertical"] = "vertical";
8684
- })(DirectionProps || (DirectionProps = {}));
8685
-
8686
- const tabCss = "@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}:host{display:block}:host(.hidden){display:none}slot[name=icon-suffix]::slotted(bcm-icon){margin-left:10px}slot[name=icon-prefix]::slotted(bcm-icon){margin-right:10px}.tab{position:relative;display:flex;justify-content:center;align-items:center;padding:var(--bcm-tab-vertical-space) 14px var(--bcm-tab-vertical-space) 14px;color:var(--bcm-color-grey-8);font-size:var(--bcm-tab-font-size);line-height:var(--bcm-tab-line-height);cursor:pointer;user-select:none}.tab.active{color:var(--bcm-color-prime-blue-6)}.tab.active::before{content:\"\";bottom:-2px;left:0;width:100%;height:2px;background-color:var(--bcm-color-prime-blue-6);position:absolute;z-index:1}.tab:hover{color:var(--bcm-color-prime-blue-5)}.tab:active,.tab:focus{color:var(--bcm-color-prime-blue-7)}.tab[disabled],.tab.disabled{color:var(--bcm-color-grey-6);cursor:not-allowed}.tab.closable:not(.pane){padding-left:0;padding-right:0}.tab.closable .close{margin-left:34px}.tab.pane{border:1px solid transparent;border-bottom:none;border-color:var(--bcm-color-grey-5);background-color:var(--bcm-color-grey-3);border-radius:2px 2px 0 0}.tab.pane.active{background-color:#ffffff}.badge{padding-left:8px;position:relative}.badge.blink:after{content:\"\";position:absolute;top:8px;left:9px;background:black;border-radius:50%;height:7px;width:7px;box-shadow:0 0 0 0 rgba(0, 0, 0, 0);transform:scale(1)}.badge.success:after{animation:pulsesuccess 2s infinite;background-color:#52C41A}.badge.error:after{animation:pulseerror 2s infinite;background-color:#F5222D}.badge.default:after{animation:pulsedefault 2s infinite;background-color:#D9D9D9}.badge.processing:after{animation:pulseprocessing 2s infinite;background-color:#4293CF}.badge.warning:after{animation:pulsewarning 2s infinite;background-color:#FA8C16}@keyframes pulsesuccess{0%{transform:scale(0.95);box-shadow:0 0 0 0 rgba(82, 196, 26, 0.7)}70%{transform:scale(1);box-shadow:0 0 0 10px rgba(0, 0, 0, 0)}100%{transform:scale(0.95);box-shadow:0 0 0 0 rgba(0, 0, 0, 0)}}@keyframes pulseerror{0%{transform:scale(0.95);box-shadow:0 0 0 0 rgba(245, 34, 45, 0.7)}70%{transform:scale(1);box-shadow:0 0 0 10px rgba(0, 0, 0, 0)}100%{transform:scale(0.95);box-shadow:0 0 0 0 rgba(0, 0, 0, 0)}}@keyframes pulsedefault{0%{transform:scale(0.95);box-shadow:0 0 0 0 rgba(217, 217, 217, 0.7)}70%{transform:scale(1);box-shadow:0 0 0 10px rgba(0, 0, 0, 0)}100%{transform:scale(0.95);box-shadow:0 0 0 0 rgba(0, 0, 0, 0)}}@keyframes pulseprocessing{0%{transform:scale(0.95);box-shadow:0 0 0 0 rgba(66, 147, 207, 0.7)}70%{transform:scale(1);box-shadow:0 0 0 10px rgba(0, 0, 0, 0)}100%{transform:scale(0.95);box-shadow:0 0 0 0 rgba(0, 0, 0, 0)}}@keyframes pulsewarning{0%{transform:scale(0.95);box-shadow:0 0 0 0 rgba(250, 140, 22, 0.7)}70%{transform:scale(1);box-shadow:0 0 0 10px rgba(0, 0, 0, 0)}100%{transform:scale(0.95);box-shadow:0 0 0 0 rgba(0, 0, 0, 0)}}";
8687
-
8688
- const BcmTab = class {
8689
- constructor(hostRef) {
8690
- index.registerInstance(this, hostRef);
8691
- this.click = index.createEvent(this, "bcm-click", 7);
8692
- this.close = index.createEvent(this, "bcm-close", 7);
8693
- /**
8694
- * Component Properties
8695
- */
8696
- this.type = TypeProps$1.normal;
8697
- this.active = false;
8698
- this.disabled = false;
8699
- this.closable = false;
8700
- this.tabId = (Math.random() * 4).toString(16).replace('.', '');
8701
- this.formControl = null;
8702
- this.hidden = false;
8703
- this.status = 'default';
8704
- this.badge = false;
8705
- this.blink = false;
8706
- }
8707
- /**
8708
- * @desc
8709
- */
8710
- handleClose() {
8711
- if (this.disabled)
8712
- return;
8713
- this.close.emit();
8714
- }
8715
- /**
8716
- * @desc
8717
- * @param event
8718
- */
8719
- handleClick(event) {
8720
- if (this.disabled)
8721
- return;
8722
- const targetElement = event.target;
8723
- // Detect close icon clicked
8724
- // #
8725
- if (String(targetElement.tagName).toLowerCase() == 'bcm-icon' && targetElement.classList.contains('close')) {
8726
- this.close.emit(event);
7349
+ if (this.input.checked == true) {
7350
+ this.input.checked = false;
7351
+ this.checked = this.input.checked;
7352
+ this.value = this.checked;
7353
+ this.change.emit(this.checked);
8727
7354
  }
8728
- else {
8729
- this.click.emit(event);
8730
- }
8731
- }
8732
- render() {
8733
- const { active, disabled, closable } = this;
8734
- const classes = index$1.classnames('tab', [this.type], {
8735
- 'active': active,
8736
- 'disabled': disabled,
8737
- 'closable': closable
8738
- });
8739
- const hostClasses = index$1.classnames(this.hidden ? 'hidden' : null);
8740
- const badgeClasses = index$1.classnames('badge', this.status, {
8741
- 'blink': this.blink
8742
- });
8743
- return (index.h(index.Host, { class: hostClasses }, index.h("div", { class: classes, onClick: (event) => this.handleClick(event) }, index.h("slot", { name: "icon-prefix" }), index.h("slot", null), index.h("slot", { name: "icon-suffix" }), this.closable && (index.h("bcm-icon", { class: "close", icon: "close", color: "grey-10" })), this.badge && (index.h("bcm-badge", { class: badgeClasses, size: "small", status: this.status })))));
8744
7355
  }
8745
- get el() { return index.getElement(this); }
8746
- };
8747
- BcmTab.style = tabCss;
8748
-
8749
- const tabPaneCss = "@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}:host{width:100%;display:block}:host(.hidden){display:none}:host(:not(.active)){height:0 !important;overflow:hidden;padding:0 !important}:host(.active){display:block}";
8750
-
8751
- /**
8752
- * @desc
8753
- * @param str
8754
- */
8755
- const lowercase$5 = (str) => str.toLowerCase();
8756
- const BcmTabPane = class {
8757
- constructor(hostRef) {
8758
- index.registerInstance(this, hostRef);
8759
- this.size = 'medium';
8760
- this.hidden = false;
8761
- this.fullWidth = false;
8762
- this.tab = (Math.random() * 4).toString(16).replace('.', '');
8763
- this.active = false;
8764
- }
8765
- connectedCallback() { }
8766
- disconnectedCallback() { }
8767
- componentWillLoad() { }
8768
- componentDidLoad() { }
8769
- componentWillRender() { }
8770
- componentDidRender() { }
8771
- componentWillUpdate() { }
8772
- componentDidUpdate() { }
8773
- handleActiveTabPane(e) {
8774
- if (lowercase$5(e.target.nodeName) === 'bcm-tab') {
8775
- if (e.target.tabId === this.tab) {
8776
- this.active = true;
8777
- }
8778
- else {
8779
- this.active = false;
8780
- }
8781
- }
7356
+ async resetCaption() {
7357
+ this.caption = this.captionCache;
7358
+ this.captionType = this.captionTypeCache;
7359
+ this.captionError = null;
8782
7360
  }
8783
7361
  render() {
8784
- const classes = index$1.classnames('tab-pane', this.size);
8785
- const hostClasses = index$1.classnames(this.hidden ? 'hidden' : null, this.active ? 'active' : null);
8786
- return (index.h(index.Host, { class: hostClasses }, index.h("div", { class: classes }, index.h("slot", null))));
7362
+ const { checked, size, activeIcon, inactiveIcon, activeText, inactiveText, pending, disabled, label, required, noCaption, captionType, captionError, caption } = this;
7363
+ const classes = index$1.classnames('container', size, {
7364
+ 'switch-checked': checked,
7365
+ 'disabled': disabled
7366
+ });
7367
+ const wrapperClass = index$1.classnames('wrapper', {
7368
+ 'checked': checked,
7369
+ 'disabled': disabled
7370
+ });
7371
+ const captionClasses = index$1.classnames('size-1', 'input-caption', 'caption-' + captionType);
7372
+ const isPermitted = (condition) => {
7373
+ return (condition && size === 'medium');
7374
+ };
7375
+ const isMedium = size === 'medium';
7376
+ const hostClasses = index$1.classnames('bcm-switch', this.hidden ? 'hidden' : null);
7377
+ return (index.h(index.Host, { class: hostClasses }, label && index.h("div", null, index.h("bcm-label", { tooltip: this.tooltip, type: captionType, value: label, required: required })), index.h("label", { class: wrapperClass }, isPermitted(inactiveText) && index.h("span", { class: "inactive-text size-1" }, inactiveText), index.h("div", { class: classes }, isMedium && index.h("bcm-icon", { icon: activeIcon, size: 14, class: "icon-active" }), index.h("span", { class: "handle" }, pending && index.h("span", { class: "spinner" })), isMedium && index.h("bcm-icon", { icon: inactiveIcon, size: 14, class: "icon-inactive" })), index.h("input", { onClick: () => this.handleClick(), onFocus: () => this.handleFocus(), onBlur: () => this.handleBlur(), ref: el => (this.input = el), checked: checked, type: "checkbox", class: "switch", disabled: disabled }), isPermitted(activeText) && index.h("span", { class: "active-text size-1" }, activeText)), !noCaption && (index.h("div", { class: "caption-area" }, captionType == "error"
7378
+ ? index.h("span", { class: captionClasses }, " ", captionError, " ")
7379
+ : caption && index.h("span", { class: captionClasses }, " ", caption, " ")))));
8787
7380
  }
8788
- get el() { return index.getElement(this); }
8789
7381
  };
8790
- BcmTabPane.style = tabPaneCss;
7382
+ BcmSwitch.style = switchCss;
8791
7383
 
8792
- const tabsCss = "@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}:host{display:block}:host(.hidden){display:none}::slotted(bcm-tab:not(:last-child)){margin-right:32px}.tabs{position:relative;display:flex;flex-wrap:wrap}.tabs.large{--bcm-tab-vertical-space:16px;--bcm-tab-font-size:16px;--bcm-tab-line-height:24px}.tabs.medium{--bcm-tab-vertical-space:11px;--bcm-tab-font-size:14px;--bcm-tab-line-height:22px}.tabs.small{--bcm-tab-vertical-space:7px;--bcm-tab-font-size:14px;--bcm-tab-line-height:22px}.tabs.pane{--bcm-tab-vertical-space:9px;--bcm-tab-font-size:14px;--bcm-tab-line-height:22px}.tabs.full-width{width:100%;display:flex;align-items:center;justify-content:center}.tabs.full-width ::slotted(bcm-tab){flex:1}.tabs.underline:after{content:\"\";margin-top:0;z-index:0;left:0;width:100%;height:2px;background-color:var(--bcm-color-grey-4)}.tabs.animatable:before{transition:all 0.4s ease}.tabs.pane ::slotted(bcm-tab:not(:last-child)){margin-right:2px}.tabs.pane:before{display:none}.tabs.vertical{flex-direction:column;width:fit-content}.tabs.vertical:before{content:\"\";position:absolute;top:var(--bcm-tabs-line-top);left:var(--bcm-tabs-line-left);right:var(--bcm-tabs-line-right);width:var(--bcm-tabs-line-width);height:var(--bcm-tabs-line-height);background-color:var(--bcm-color-prime-blue-6)}.tabs.vertical ::slotted(bcm-tab){margin-right:0}";
7384
+ const textareaCss = "@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}.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}:host{display:inline-block;width:100%;margin:0 0 8px 0}:host(.hidden){display:none}.textarea-wrapper{width:256px}.textarea-wrapper.full-width{width:100%}.textarea-wrapper:hover .clear-button{opacity:1}.textarea-container{position:relative;width:100%;border:1px solid var(--bcm-color-grey-5);border-radius:2px}.textarea-container.empty .clear-button{display:none}.textarea-container.focused:not(.disabled){outline:none;border-color:var(--bcm-color-prime-blue-5);box-shadow:0px 0px 4px var(--bcm-color-prime-blue-6)}.textarea-container:hover:not(:disabled){border-color:var(--bcm-color-prime-blue-6)}.textarea-container textarea{resize:vertical;display:flex;flex:1 1 auto;align-items:center;color:var(--bcm-color-grey-8);width:100%;background-color:var(--bcm-color-grey-1);border:none;border-radius:2px;box-shadow:none;font-family:\"Roboto\", sans-serif;-webkit-appearance:none;box-sizing:border-box}.textarea-container textarea::-webkit-search-decoration,.textarea-container textarea::-webkit-search-cancel-button,.textarea-container textarea::-webkit-search-results-button,.textarea-container textarea::-webkit-search-results-decoration{-webkit-appearance:none}.textarea-container textarea::placeholder{color:var(--bcm-color-grey-6);user-select:none}.textarea-container textarea:focus:not(:disabled){outline:none;border-color:none;box-shadow:none}.textarea-container textarea:hover:not(:disabled){border-color:none}.textarea-container textarea:disabled{background-color:var(--bcm-color-grey-3);cursor:not-allowed}.textarea-container textarea.clearable{padding-right:32px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.label{display:flex;flex-direction:column;color:var(--bcm-color-grey-9);margin-bottom:4px}.caption-area{min-height:20px;display:flex;flex-direction:row;justify-content:space-between}.input-caption{display:block}.clear-button{position:absolute;opacity:0;right:10px;top:7px;display:inline-flex;align-items:center;border:none;background:none;padding:0;cursor:pointer}.clear-button:focus{outline:none}.textarea-footer{display:flex;justify-content:space-between;margin-bottom:8px;min-height:20px}.textarea-footer .count{color:var(--bcm-color-grey-7);margin-left:4px}.textarea-footer .count:only-child{margin-left:auto}.size-large{padding:7px 12px;min-height:38px}.size-large~.clear-button{top:12px}.size-medium{padding:4px 12px;min-height:30px}.size-medium~.clear-button{top:7px}.size-small{padding:0px 12px;min-height:20px}.size-small~.clear-button{top:2px}.caption-default{color:#8C8C8C}.caption-primary{color:#4293CF}.caption-success{color:#52C41A}.caption-warning{color:#FA8C16}.caption-error{color:#F5222D}.error .label{color:var(--bcm-color-red-6) !important}.error .textarea-container{border:1px solid var(--bcm-color-red-6) !important}";
8793
7385
 
8794
- const BcmTabs = class {
7386
+ let id$1 = 0;
7387
+ const BcmTextarea = class {
8795
7388
  constructor(hostRef) {
8796
7389
  index.registerInstance(this, hostRef);
8797
- this.click = index.createEvent(this, "bcm-click", 7);
7390
+ this.focus = index.createEvent(this, "bcm-focus", 7);
7391
+ this.blur = index.createEvent(this, "bcm-blur", 7);
7392
+ this.clear = index.createEvent(this, "bcm-clear", 7);
8798
7393
  this.change = index.createEvent(this, "bcm-change", 7);
8799
- this.bcmTabsActiveItem = index.createEvent(this, "bcm-tabs-active-item", 7);
8800
- /**
8801
- * Component Private variables
8802
- */
8803
- this.tabs = [];
8804
- this.firstInit = true;
8805
- this.count = 0;
8806
- /**
8807
- * Component Properties
8808
- */
8809
- this.size = SizeProps.large;
8810
- this.type = TypeProps$1.normal;
8811
- this.direction = DirectionProps.horizontal;
7394
+ this.input = index.createEvent(this, "bcm-input", 7);
7395
+ this.textareaId = `textarea-${++id$1}`;
7396
+ this.valueLength = 0;
7397
+ this.noCaption = false;
7398
+ this.captionType = 'default';
7399
+ this.rows = 1;
7400
+ this.size = 'medium';
7401
+ this.resize = 'vertical';
8812
7402
  this.hidden = false;
8813
- this.fullWidth = false;
8814
- this.underline = true;
8815
- /**
8816
- * Component States
8817
- */
8818
- this.activeChild = 1;
8819
- this.lineOpts = { top: '0px', left: '0px', right: '0px', width: '0px', height: '0px' };
8820
- this.prevButton = null;
8821
- this.nextButton = null;
8822
- this.completeButton = null;
8823
- this.prevButtonState = 'disabled';
8824
- this.nextButtonState = 'disabled';
8825
- this.completeButtonState = 'disabled';
8826
- }
8827
- async config(_config) {
8828
- if (_config['prevButton']) {
8829
- if (_config['prevButton']['id']) {
8830
- var prevButtonId = "#" + _config['prevButton']['id'];
8831
- this.prevButton = document.querySelector(prevButtonId);
8832
- }
8833
- if (_config['prevButton']['state']) {
8834
- this.prevButtonState = _config['prevButton']['state'];
8835
- }
8836
- }
8837
- if (_config['nextButton']) {
8838
- if (_config['nextButton']['id']) {
8839
- var nextButtonId = "#" + _config['nextButton']['id'];
8840
- this.nextButton = document.querySelector(nextButtonId);
8841
- }
8842
- if (_config['nextButton']['state']) {
8843
- this.nextButtonState = _config['nextButton']['state'];
8844
- }
8845
- }
8846
- if (_config['completeButton']) {
8847
- if (_config['completeButton']['id']) {
8848
- var completeButtonId = "#" + _config['completeButton']['id'];
8849
- this.completeButton = document.querySelector(completeButtonId);
8850
- }
8851
- if (_config['completeButton']['state']) {
8852
- this.completeButtonState = _config['completeButton']['state'];
8853
- }
8854
- }
8855
- this.buttonControl();
8856
- return true;
8857
- }
8858
- async next() {
8859
- var getFormId = "#" + this.tabs[this.getActive() - 1]["formControl"];
8860
- var getForm = document.querySelector(getFormId);
8861
- var formData = null;
8862
- if (getForm) {
8863
- formData = await getForm.submit();
8864
- }
8865
- if ((getForm && formData.isValid) || !getForm) {
8866
- this.activeChild = this.getActive() + 1;
8867
- this.active(this.tabs[this.getActive() - 1]["tabId"]);
8868
- }
8869
- return formData;
8870
- }
8871
- async prev() {
8872
- this.activeChild = this.getActive() - 1;
8873
- this.active(this.tabs[this.getActive() - 1]["tabId"]);
8874
- return this.activeChild;
8875
- }
8876
- async complete() {
8877
- const tabStatuses = [];
8878
- var isValid = true;
8879
- this.tabs.forEach(element => {
8880
- if (element['formControl']) {
8881
- const getFormId = "#" + element["formControl"];
8882
- const getForm = document.querySelector(getFormId);
8883
- if (getForm) {
8884
- tabStatuses.push(getForm.submit());
8885
- }
8886
- }
8887
- });
8888
- const allStatuses = await Promise.all(tabStatuses);
8889
- allStatuses.forEach(item => {
8890
- if (item.isValid === false) {
8891
- isValid = false;
8892
- if (item.formName) {
8893
- const formId = this.tabs.filter((input) => input['formControl'] == item.formName)[0]['tabId'];
8894
- this.active(formId);
8895
- }
8896
- }
8897
- });
8898
- return { isValid: isValid, Forms: allStatuses };
8899
- }
8900
- async active(id) {
8901
- var i = 0;
8902
- this.activeChild = -1,
8903
- await utils.delay(100);
8904
- utils.getChilds(this.el, 'bcm-tab').forEach(items => {
8905
- i++,
8906
- items.tabId == id && (items.disabled = false,
8907
- items.active = true,
8908
- this.bcmTabsActiveItem.emit(items.tabId),
8909
- this.activeChild = i);
8910
- items.tabId != id && (items.active = false);
8911
- });
7403
+ this.required = false;
7404
+ this.hasFocus = false;
8912
7405
  }
8913
- async getActiveTab() {
8914
- return this.tabs[this.getActive() - 1]["tabId"];
7406
+ async setFocus() {
7407
+ this.textarea.focus();
8915
7408
  }
8916
- async getActiveIndex() {
8917
- return this.getActive();
7409
+ async removeFocus() {
7410
+ this.textarea.blur();
8918
7411
  }
8919
- async error(id, blink = false) {
8920
- utils.getChilds(this.el, 'bcm-tab').forEach(items => {
8921
- items.tabId == id && (items.badge = true,
8922
- items.blink = blink,
8923
- items.status = "error");
8924
- });
7412
+ async select() {
7413
+ return this.textarea.select();
8925
7414
  }
8926
- async info(id, blink = false) {
8927
- utils.getChilds(this.el, 'bcm-tab').forEach(items => {
8928
- items.tabId == id && (items.badge = true,
8929
- items.blink = blink,
8930
- items.status = "processing");
8931
- });
7415
+ async setValue(value) {
7416
+ this.textarea.value = value;
7417
+ this.value = value;
7418
+ this.handleChange();
7419
+ return value;
8932
7420
  }
8933
- async warning(id, blink = false) {
8934
- utils.getChilds(this.el, 'bcm-tab').forEach(items => {
8935
- items.tabId == id && (items.badge = true,
8936
- items.blink = blink,
8937
- items.status = "warning");
8938
- });
7421
+ async setClear() {
7422
+ this.textarea.value = '';
7423
+ this.value = '';
8939
7424
  }
8940
- async success(id, blink = false) {
8941
- utils.getChilds(this.el, 'bcm-tab').forEach(items => {
8942
- items.tabId == id && (items.badge = true,
8943
- items.blink = blink,
8944
- items.status = "success");
8945
- });
7425
+ async resetCaption() {
7426
+ this.caption = this.captionCache;
7427
+ this.captionType = this.captionTypeCache;
7428
+ this.captionError = null;
8946
7429
  }
8947
- async statusReset(id) {
8948
- utils.getChilds(this.el, 'bcm-tab').forEach(items => {
8949
- items.tabId == id && (items.badge = false,
8950
- items.blink = false,
8951
- items.status = "default");
8952
- });
7430
+ async getValue() {
7431
+ return this.value;
8953
7432
  }
8954
- buttonControl() {
8955
- if (this.prevButton) {
8956
- if (this.activeChild == 1) {
8957
- this.prevButton.setAttribute(this.prevButtonState, "true");
8958
- }
8959
- else {
8960
- this.prevButton.removeAttribute(this.prevButtonState);
8961
- }
8962
- }
8963
- if (this.nextButton) {
8964
- if (this.getActive() == this.count) {
8965
- this.nextButton.setAttribute(this.nextButtonState, "true");
8966
- }
8967
- else {
8968
- this.nextButton.removeAttribute(this.nextButtonState);
8969
- }
8970
- }
8971
- if (this.completeButton) {
8972
- if (this.getActive() == this.count) {
8973
- this.completeButton.removeAttribute(this.completeButtonState);
8974
- }
8975
- else {
8976
- this.completeButton.setAttribute(this.completeButtonState, "true");
8977
- }
8978
- }
7433
+ handleFocus() {
7434
+ this.hasFocus = true;
7435
+ this.focus.emit();
8979
7436
  }
8980
- /**
8981
- * @ComponentMethod
8982
- */
8983
- componentDidRender() {
8984
- if (!this.firstInit)
8985
- return;
8986
- let slotElements;
8987
- slotElements = this.el.shadowRoot.querySelector('slot').assignedElements();
8988
- this.tabs = [];
8989
- this.activeChild = this.getActive();
8990
- var isActive = false;
8991
- var firstId = null;
8992
- var i = 0;
8993
- // Get only bcm-tab elements from
8994
- // slot childs
8995
- slotElements.map((element) => {
8996
- i++;
8997
- this.type == "stepper" && (element.disabled = true);
8998
- if (!firstId) {
8999
- firstId = element.tabId;
9000
- }
9001
- if (String(element.tagName).toLowerCase() == 'bcm-tab') {
9002
- element.type = this.type;
9003
- // Activate default tab
9004
- // #
9005
- if (this.tabs.push(element) - 1 == this.activeChild) {
9006
- this.activateChild(this.activeChild);
9007
- isActive = true;
9008
- }
9009
- }
9010
- this.count = i;
9011
- });
9012
- if (!isActive) {
9013
- this.active(firstId);
9014
- }
9015
- setTimeout(() => {
9016
- this.el.shadowRoot.querySelector('.tabs').classList.add('animatable');
9017
- }, 500);
7437
+ handleBlur() {
7438
+ this.hasFocus = false;
7439
+ this.blur.emit();
9018
7440
  }
9019
- componentDidLoad() {
9020
- utils.getChilds(this.el, 'bcm-tab').forEach(items => {
9021
- items.active && (this.bcmTabsActiveItem.emit(items.tabId), items.disabled = false);
9022
- });
7441
+ handleChange() {
7442
+ this.value = this.textarea.value;
7443
+ this.change.emit(this.value);
9023
7444
  }
9024
- getActive() {
9025
- const childs = utils.getChilds(this.el, 'bcm-tab');
9026
- const childIndex = childs.findIndex(child => child.active);
9027
- return childIndex >= 0 ? childIndex + 1 : 1;
7445
+ watchValue() {
7446
+ this.handleChange();
9028
7447
  }
9029
- /**
9030
- * @desc
9031
- */
9032
- getChildIdx(child) {
9033
- let i = 1;
9034
- while (child.previousElementSibling) {
9035
- child = child.previousElementSibling;
9036
- i++;
9037
- }
9038
- return i;
7448
+ handleInput() {
7449
+ this.value = this.textarea.value;
7450
+ this.setTextareaHeight();
7451
+ this.input.emit(this.value);
9039
7452
  }
9040
- /**
9041
- * @desc
9042
- * @param idx
9043
- */
9044
- activateChild(idx) {
9045
- idx = idx - 1;
9046
- const child = this.tabs[idx];
9047
- if (child) {
9048
- this.tabs.forEach((tab) => tab.active = false);
9049
- child.active = true;
9050
- child.disabled = false;
9051
- this.transformLine(idx);
9052
- this.firstInit && index.forceUpdate(this.el);
9053
- this.firstInit = false;
9054
- }
7453
+ handleClear(e) {
7454
+ this.value = '';
7455
+ this.clear.emit();
7456
+ this.textarea.focus();
7457
+ e.stopPropagation();
9055
7458
  }
9056
- /**
9057
- * @desc
9058
- * @param idx
9059
- */
9060
- transformLine(idx) {
9061
- const tab = this.tabs[idx];
9062
- if (this.direction == 'horizontal') {
9063
- this.lineOpts.top = (tab.offsetTop + tab.offsetHeight) + 'px';
9064
- this.lineOpts.left = tab.offsetLeft + 'px';
9065
- this.lineOpts.width = tab.offsetWidth + 'px';
9066
- this.lineOpts.right = 'unset';
9067
- this.lineOpts.height = '2px';
7459
+ setTextareaHeight() {
7460
+ if (this.resize === 'auto') {
7461
+ this.textarea.style.height = 'auto';
7462
+ this.textarea.style.height = (this.textarea.scrollHeight + 2) + 'px';
9068
7463
  }
9069
7464
  else {
9070
- this.lineOpts.top = tab.offsetTop + 'px';
9071
- this.lineOpts.left = 'unset';
9072
- this.lineOpts.right = '0';
9073
- this.lineOpts.width = '2px';
9074
- this.lineOpts.height = tab.offsetHeight + 'px';
9075
- }
9076
- }
9077
- /**
9078
- * @desc
9079
- */
9080
- getLineTransform() {
9081
- return {
9082
- '--bcm-tabs-line-top': this.lineOpts.top,
9083
- '--bcm-tabs-line-left': this.lineOpts.left,
9084
- '--bcm-tabs-line-width': this.lineOpts.width,
9085
- '--bcm-tabs-line-right': this.lineOpts.right,
9086
- '--bcm-tabs-line-height': this.lineOpts.height
9087
- };
9088
- }
9089
- /**
9090
- * @desc
9091
- * @param event
9092
- */
9093
- handleTabClick(event) {
9094
- const targetElement = event.target;
9095
- const childIdx = this.getChildIdx(targetElement);
9096
- this.activeChild = null;
9097
- this.activeChild = childIdx;
9098
- }
9099
- /**
9100
- * @desc
9101
- * @param event
9102
- */
9103
- handleTabClose(event) {
9104
- const targetElement = event.target;
9105
- const childIdx = this.getChildIdx(targetElement);
9106
- // Remove element
9107
- // #
9108
- targetElement.remove();
9109
- this.tabs.splice(childIdx - 1, 1);
9110
- if (childIdx === this.activeChild) {
9111
- this.activeChild = 1;
9112
- this.activateChild(1);
7465
+ this.textarea.style.height = undefined;
9113
7466
  }
9114
7467
  }
9115
- /**
9116
- * @desc
9117
- * @param newValue
9118
- */
9119
- activeChildChange(newValue) {
9120
- this.activateChild(newValue);
9121
- this.change.emit(newValue);
9122
- this.buttonControl();
7468
+ connectedCallback() {
7469
+ this.handleChange = this.handleChange.bind(this);
7470
+ this.handleBlur = this.handleBlur.bind(this);
7471
+ this.handleFocus = this.handleFocus.bind(this);
7472
+ this.handleInput = this.handleInput.bind(this);
7473
+ this.handleClear = this.handleClear.bind(this);
7474
+ this.setTextareaHeight = this.setTextareaHeight.bind(this);
7475
+ this.captionCache = this.caption;
7476
+ this.captionTypeCache = this.captionType;
9123
7477
  }
9124
- /**
9125
- * @desc
9126
- */
9127
- windowResize() {
9128
- this.transformLine(this.activeChild - 1);
9129
- index.forceUpdate(this.el);
7478
+ componentWillRender() {
7479
+ this.valueLength = this.value ? this.value.length : 0;
7480
+ // this.fullWidth
7481
+ // ? this.el.style.width = '100%'
7482
+ // : this.el.style.width = 'initial'
9130
7483
  }
9131
7484
  render() {
9132
- const classes = index$1.classnames('tabs', [this.direction], [this.size], [this.type], this.fullWidth ? 'full-width' : null, this.underline ? 'underline' : null);
7485
+ const { fullWidth, size, rows, disabled, clearable, label, hasFocus, noCaption, caption, captionError, captionType, value, resize, maxLength, placeholder, valueLength, required } = this;
7486
+ const wrapperClasses = index$1.classnames('textarea-wrapper', {
7487
+ 'full-width': fullWidth,
7488
+ 'error': captionType == 'error' ? true : false
7489
+ });
7490
+ const contanerClasses = index$1.classnames('textarea-container', 'resize-' + resize, 'textarea-' + size, {
7491
+ 'empty': (value === null || value === void 0 ? void 0 : value.length) < 1,
7492
+ 'focused': hasFocus,
7493
+ 'disabled': disabled,
7494
+ });
7495
+ const captionClasses = index$1.classnames('size-1', 'input-caption', 'caption-' + captionType);
7496
+ const countClasses = index$1.classnames('size-1', 'input-caption', 'caption-default');
7497
+ const textareaClasses = index$1.classnames('size-' + size, {
7498
+ 'size-3': size === 'large',
7499
+ 'size-2': size === 'small' || size === 'medium',
7500
+ 'clearable': clearable
7501
+ });
9133
7502
  const hostClasses = index$1.classnames(this.hidden ? 'hidden' : null);
9134
- return (index.h(index.Host, { class: hostClasses }, index.h("div", { class: classes, style: this.getLineTransform(), "on-bcm-click": (event) => this.handleTabClick(event), "on-bcm-close": (event) => this.handleTabClose(event) }, index.h("slot", null))));
7503
+ return (index.h(index.Host, { class: hostClasses }, index.h("div", { class: wrapperClasses }, label && index.h("div", null, index.h("bcm-label", { tooltip: this.tooltip, type: captionType, value: label, required: required, htmlFor: this.textareaId })), index.h("div", { class: contanerClasses }, index.h("textarea", { ref: el => (this.textarea = el), onInput: this.handleInput, onFocus: this.handleFocus, onChange: this.handleChange, onBlur: this.handleBlur, class: textareaClasses, id: this.textareaId, value: value, rows: rows, disabled: disabled, maxlength: maxLength, placeholder: placeholder }), clearable && (index.h("button", { class: "clear-button", onClick: this.handleClear }, index.h("bcm-icon", { icon: "close-circle", type: "fill", size: 18, color: "grey-7" })))), !noCaption || maxLength ? (index.h("div", { class: "caption-area" }, index.h("span", null, captionType == "error"
7504
+ ? index.h("span", { class: captionClasses }, " ", captionError, " ")
7505
+ : caption && index.h("span", { class: captionClasses }, " ", caption, " ")), maxLength && index.h("span", { class: countClasses }, " ", `${valueLength}/${maxLength}`, " "))) : null)));
9135
7506
  }
9136
7507
  get el() { return index.getElement(this); }
9137
7508
  static get watchers() { return {
9138
- "activeChild": ["activeChildChange"]
7509
+ "value": ["watchValue"]
9139
7510
  }; }
9140
7511
  };
9141
- BcmTabs.style = tabsCss;
9142
-
9143
- const tabsContentCss = "@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}:host{width:100%;display:block;padding:8px}:host(.pane){border:1px solid transparent;border-top:none;border-color:var(--bcm-color-grey-5);border-radius:0 0 2px 2px}";
9144
-
9145
- const BcmTabsContent = class {
9146
- constructor(hostRef) {
9147
- index.registerInstance(this, hostRef);
9148
- this.size = 'medium';
9149
- this.hidden = false;
9150
- this.fullWidth = false;
9151
- this.type = TypeProps$1.normal;
9152
- }
9153
- connectedCallback() { }
9154
- disconnectedCallback() { }
9155
- componentWillLoad() { }
9156
- componentDidLoad() { }
9157
- componentWillRender() { }
9158
- componentDidRender() { }
9159
- componentWillUpdate() { }
9160
- componentDidUpdate() { }
9161
- handleActivePane(e) {
9162
- utils.getChilds(this.el, 'bcm-tab-pane').forEach(items => {
9163
- items.tab == e.detail && (items.active = true);
9164
- items.tab != e.detail && (items.active = false);
9165
- });
9166
- }
9167
- render() {
9168
- const classes = index$1.classnames('tabs-content', this.size);
9169
- const hostClasses = index$1.classnames(this.hidden ? 'hidden' : null, this.type);
9170
- return (index.h(index.Host, { class: hostClasses }, index.h("div", { class: classes }, index.h("slot", null))));
9171
- }
9172
- get el() { return index.getElement(this); }
9173
- };
9174
- BcmTabsContent.style = tabsContentCss;
9175
-
9176
- /**
9177
- * 'color' prop predefined values
9178
- */
9179
- var ColorProps$1;
9180
- (function (ColorProps) {
9181
- ColorProps["black"] = "black";
9182
- ColorProps["white"] = "white";
9183
- ColorProps["prime-blue"] = "prime-blue";
9184
- ColorProps["grey"] = "grey";
9185
- ColorProps["blue"] = "blue";
9186
- ColorProps["warmyellow"] = "warmyellow";
9187
- ColorProps["yellow"] = "yellow";
9188
- ColorProps["limegreen"] = "limegreen";
9189
- ColorProps["red"] = "red";
9190
- ColorProps["darkorange"] = "darkorange";
9191
- ColorProps["orange"] = "orange";
9192
- ColorProps["green"] = "green";
9193
- ColorProps["turquosie"] = "turquosie";
9194
- ColorProps["cobaltblue"] = "cobaltblue";
9195
- ColorProps["magenta"] = "magenta";
9196
- ColorProps["purple"] = "purple";
9197
- ColorProps["bc-red"] = "bc-red";
9198
- ColorProps["bc-blue"] = "bc-blue";
9199
- ColorProps["bc-green"] = "bc-green";
9200
- ColorProps["bc-orange"] = "bc-orange";
9201
- })(ColorProps$1 || (ColorProps$1 = {}));
7512
+ BcmTextarea.style = textareaCss;
9202
7513
 
9203
- const tagCss = "@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}.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}:host{display:inline-block;width:fit-content}:host(.hidden){display:none}:host(.maxwidth){max-width:100px}.tag{display:flex;align-items:center;justify-content:center;padding:0 8px;cursor:default;border-radius:48px;border:1px solid var(--bcm-color-grey-5);user-select:none;min-width:10px;min-height:20px}.tag.size-1{padding:calc(8px - 8px) 8px}.tag.size-2{padding:calc(9px - 8px) 9px}.tag.size-3{padding:calc(10px - 8px) 10px}.tag.size-4{padding:calc(11px - 8px) 11px}.tag.size-5{padding:calc(12px - 8px) 12px}.tag.size-6{padding:calc(13px - 8px) 13px}.tag.size-7{padding:calc(14px - 8px) 14px}.tag.size-8{padding:calc(15px - 8px) 15px}.tag.size-9{padding:calc(16px - 8px) 16px}.tag.basic,.tag.closeable,.tag.add,.tag.dissmisable{background-color:var(--bcm-color-grey-3);color:var(--bcm-color-grey-8)}.tag.basic:hover,.tag.closeable:hover,.tag.add:hover,.tag.dissmisable:hover{opacity:0.85}.tag.dissmisable{color:var(--bcm-color-grey-10)}.tag.dissmisable .close-button{width:14px;cursor:pointer}.tag.dissmisable .close-button bcm-icon{color:var(--bcm-color-grey-7)}.tag.dissmisable .close-button:hover bcm-icon{color:var(--bcm-color-grey-10)}.tag.add{border-style:dashed;background-color:var(--bcm-color-grey-1)}.tag.checkable{background-color:var(--bcm-color-grey-1);color:var(--bcm-color-grey-8);border-color:var(--bcm-color-grey-1)}.tag.checkable:hover{color:var(--bcm-color-prime-blue-5);cursor:pointer}.tag span{display:inline-flex}.tag span.left{margin-right:4px}.tag span.right{margin-left:4px}.tag:before,.tag:after{content:\"\"}button{border:none;outline:0;cursor:pointer !important;margin:0}input[type=checkbox]{margin:0;width:0;height:0;visibility:hidden;position:absolute}input[type=checkbox]:checked+label{background-color:var(--bcm-color-prime-blue-6);color:var(--bcm-color-grey-1);border-color:var(--bcm-color-prime-blue-6)}input[type=checkbox]:checked+label:hover{background-color:var(--bcm-color-prime-blue-5);border-color:var(--bcm-color-prime-blue-5)}input[type=checkbox]:checked+label:active{background-color:var(--bcm-color-prime-blue-7);border-color:var(--bcm-color-prime-blue-7)}";
7514
+ const tooltipCss = "@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}:host{display:inline-flex}:host(.hidden){display:none}:host(:focus){outline:none}.tooltip{position:relative;}.tooltip .box{position:absolute;display:none;box-sizing:border-box;background-color:#262626;border:1px solid #262626;border-radius:2px;z-index:10700;width:max-content;padding:4px 8px;color:var(--bcm-color-grey-1)}.tooltip::after{content:\"\";position:absolute;display:none;border:6px solid;z-index:10700;pointer-events:none}.tooltip.open .box,.tooltip.open::after{display:block}.tooltip.top .box{bottom:100%;margin-bottom:8px}.tooltip.top::after{bottom:100%;margin-bottom:-4px;border-color:#262626 transparent transparent transparent}.tooltip.bottom .box{top:100%;margin-top:8px}.tooltip.bottom::after{top:100%;margin-top:-4px;border-color:transparent transparent #262626 transparent}.tooltip.left .box{right:100%;margin-right:8px}.tooltip.left::after{right:100%;margin-right:-4px;border-color:transparent transparent transparent #262626}.tooltip.right .box{left:100%;margin-left:8px}.tooltip.right::after{left:100%;margin-left:-4px;border-color:transparent #262626 transparent transparent}.tooltip.top.center .box,.tooltip.bottom.center .box{left:50%;transform:translateX(-50%)}.tooltip.top.center::after,.tooltip.bottom.center::after{left:50%;transform:translateX(-50%)}.tooltip.top.start .box,.tooltip.bottom.start .box{left:0}.tooltip.top.start::after,.tooltip.bottom.start::after{left:8px}.tooltip.top.end .box,.tooltip.bottom.end .box{right:0}.tooltip.top.end::after,.tooltip.bottom.end::after{right:8px}.tooltip.left.center .box,.tooltip.right.center .box{top:50%;transform:translateY(-50%)}.tooltip.left.center::after,.tooltip.right.center::after{top:50%;transform:translateY(-50%)}.tooltip.left.start .box,.tooltip.right.start .box{top:0}.tooltip.left.start::after,.tooltip.right.start::after{top:4px}.tooltip.left.end .box,.tooltip.right.end .box{bottom:0}.tooltip.left.end::after,.tooltip.right.end::after{bottom:4px}";
9204
7515
 
9205
- const BcmTag = class {
7516
+ const BcmTooltip = class {
9206
7517
  constructor(hostRef) {
9207
7518
  index.registerInstance(this, hostRef);
9208
- this.checkedChange = index.createEvent(this, "bcm-tag-checked-change", 7);
9209
- this.tagDissmisable = index.createEvent(this, "bcm-tag-dissmisable", 7);
9210
- this.type = 'basic';
9211
- this.size = 'size-1';
9212
- this.checked = false;
9213
- this.value = '';
7519
+ this.onShow = index.createEvent(this, "bcm-show", 7);
7520
+ this.onHide = index.createEvent(this, "bcm-hide", 7);
7521
+ this.placement = 'top';
7522
+ this.trigger = 'hover';
9214
7523
  this.hidden = false;
9215
- this._id = (Math.random() * 4).toString(16).replace('.', '');
9216
- this.maxWidth = false;
9217
7524
  this._internal_id = (Math.random() * 4).toString(16).replace('.', '');
9218
7525
  }
9219
- handleClick() {
9220
- if (this.type === 'checkable') {
9221
- this.checked = !this.checked;
7526
+ async show() {
7527
+ // Prevent subsequent calls
7528
+ if (this.open) {
7529
+ return;
9222
7530
  }
7531
+ this.open = true;
7532
+ this.onShow.emit();
9223
7533
  }
9224
- onCheckedChange(newValue, oldValue) {
9225
- this.checkedChange.emit({ newValue, oldValue });
7534
+ async hide() {
7535
+ // Prevent subsequent calls
7536
+ if (!this.open) {
7537
+ return;
7538
+ }
7539
+ this.open = false;
7540
+ this.onHide.emit();
9226
7541
  }
9227
- getColor(color) {
9228
- if ((this.type == 'basic' || this.type == 'dissmisable') && ColorProps$1[color])
9229
- return {
9230
- color: utils.extractColor(colors.ColorPalette, ColorProps$1[color] + '-6'),
9231
- borderColor: utils.extractColor(colors.ColorPalette, ColorProps$1[color] + '-3'),
9232
- backgroundColor: utils.extractColor(colors.ColorPalette, ColorProps$1[color] + '-1')
9233
- };
7542
+ handleClickOutside(e) {
7543
+ if (!this.host.contains(e.target)) {
7544
+ if (this.open) {
7545
+ this.open = false;
7546
+ }
7547
+ }
9234
7548
  }
9235
- getSize(size, returnNumber = false) {
9236
- if (Number(size) == size) {
9237
- size = "size-" + size;
7549
+ async handleOpen() {
7550
+ await this.createElement();
7551
+ var tooltipBox = document.getElementById("box" + this._internal_id).shadowRoot.querySelector(".tooltip-box");
7552
+ if (tooltipBox && tooltipBox.querySelector(".box")) {
7553
+ var tooltipBoxIn = tooltipBox.querySelector(".box");
7554
+ popoverPlacement.popoverPlacement(tooltipBoxIn, this.host, this.placement, (place) => this.placement = place);
7555
+ tooltipBox.classList.toggle("open");
9238
7556
  }
9239
- if (returnNumber) {
9240
- size = size.split("-");
9241
- size = size[size.length - 1];
9242
- var sizeList = { "1": "12", "2": "14", "3": "16", "4": "20", "5": "24", "6": "30", "7": "38", "8": "46", "9": "56" };
9243
- size = sizeList[size];
7557
+ }
7558
+ async createElement() {
7559
+ var target = this.host.getBoundingClientRect();
7560
+ var placementString = String([...this.getPlacement()]).replace(',', ' ');
7561
+ var element;
7562
+ if (!document.getElementById("box" + this._internal_id)) {
7563
+ element = document.createElement("bcm-tooltip-box");
7564
+ element.setAttribute("id", "box" + this._internal_id);
7565
+ }
7566
+ else {
7567
+ element = document.getElementById("box" + this._internal_id);
7568
+ }
7569
+ element.setAttribute("message", this.message);
7570
+ // element.setAttribute("placement", placementString)
7571
+ element.style.position = "absolute";
7572
+ // element.style.top = target.top + "px"
7573
+ // element.style.left = (target.left + (target.width / 2)) + "px"
7574
+ element.setAttribute("placement", placementString);
7575
+ // element.style.zIndex = "999999999"
7576
+ document.body.appendChild(element);
7577
+ await utils.delay(50);
7578
+ var tooltipBox = document.getElementById("box" + this._internal_id).shadowRoot.querySelector(".tooltip-box");
7579
+ if (tooltipBox && tooltipBox.querySelector(".box")) {
7580
+ var tooltipBoxIn = tooltipBox.querySelector(".box");
7581
+ popoverPlacement.popoverPlacement(tooltipBoxIn, this.host, this.placement, (place) => this.placement = place);
7582
+ }
7583
+ element.style.top = popoverPlacement.popoverBoxPlacement(this.placement, target)[0] + "px";
7584
+ element.style.left = popoverPlacement.popoverBoxPlacement(this.placement, target)[1] + "px";
7585
+ }
7586
+ hasTrigger(trigger) {
7587
+ return this.trigger === trigger;
7588
+ }
7589
+ getPlacement() {
7590
+ const placements = this.placement.split('-');
7591
+ if (placements.length === 1) {
7592
+ placements.push('center');
7593
+ }
7594
+ return placements;
7595
+ }
7596
+ /*
7597
+ Trigger Functions
7598
+ */
7599
+ handleMouseOver() {
7600
+ if (this.hasTrigger('hover')) {
7601
+ this.show();
9244
7602
  }
9245
- return size;
9246
7603
  }
9247
- handleClose() {
9248
- this.tagDissmisable.emit(this.el);
9249
- // this.el.remove()
7604
+ handleMouseOut() {
7605
+ if (this.hasTrigger('hover')) {
7606
+ this.hide();
7607
+ }
9250
7608
  }
9251
- render() {
9252
- const { type, color, value, customStyle, size } = this;
9253
- const classes = index$1.classnames('tag', this.getSize(size), type);
9254
- const hostClasses = index$1.classnames(this.hidden ? 'hidden' : null, this.maxWidth ? 'maxwidth' : null);
9255
- if (type === 'add') {
9256
- return (index.h(index.Host, { class: hostClasses }, index.h("button", { class: classes }, index.h("span", { class: "left" }, index.h("bcm-icon", { icon: "plus", type: "outlined", color: "grey-8", size: (Number(this.getSize(size, true)) + 2) })), value)));
7609
+ handleClick() {
7610
+ if (this.hasTrigger('click')) {
7611
+ this.open ? this.hide() : this.show();
9257
7612
  }
9258
- else if (type === 'dissmisable') {
9259
- return (index.h(index.Host, { class: hostClasses }, index.h("span", { class: classes, style: this.getColor(color) }, index.h("span", { class: "value", style: customStyle }, value), index.h("span", { class: "right close-button", onClick: () => this.handleClose(), style: { 'width': (Number(this.getSize(size, true)) + 2) + "px" } }, index.h("bcm-icon", { id: "close", icon: "close", type: "outlined", size: (Number(this.getSize(size, true)) + 2) })))));
7613
+ }
7614
+ handleFocus() {
7615
+ if (this.hasTrigger('focus')) {
7616
+ this.show();
9260
7617
  }
9261
- else if (type === 'checkable') {
9262
- return (index.h(index.Host, { class: hostClasses }, index.h("input", { type: "checkbox", checked: this.checked }), index.h("label", { class: classes }, value)));
7618
+ }
7619
+ handleBlur() {
7620
+ if (this.hasTrigger('focus')) {
7621
+ this.hide();
9263
7622
  }
9264
- return (index.h(index.Host, { class: hostClasses }, index.h("span", { class: classes, style: this.getColor(color) }, value)));
9265
7623
  }
9266
- get el() { return index.getElement(this); }
7624
+ async componentDidRender() {
7625
+ await this.createElement();
7626
+ var tooltipBox = document.getElementById("box" + this._internal_id).shadowRoot.querySelector(".tooltip-box");
7627
+ if (tooltipBox && tooltipBox.querySelector(".box")) {
7628
+ var tooltipBoxIn = tooltipBox.querySelector(".box");
7629
+ popoverPlacement.popoverPlacement(tooltipBoxIn, this.host, this.placement, (place) => this.placement = place);
7630
+ }
7631
+ }
7632
+ render() {
7633
+ const classes = index$1.classnames('tooltip', ...this.getPlacement(), {
7634
+ // 'open': this.open
7635
+ });
7636
+ const hostClasses = index$1.classnames(this.hidden ? 'hidden' : null);
7637
+ return (index.h(index.Host, { class: hostClasses, onClick: () => this.handleClick(), onMouseOver: () => this.handleMouseOver(), onMouseOut: () => this.handleMouseOut(), onFocus: () => this.handleFocus(), onBlur: () => this.handleBlur(), tabindex: 0 }, index.h("span", { class: classes }, index.h("span", { class: "box size-2" }, this.message), index.h("slot", null))));
7638
+ }
7639
+ get host() { return index.getElement(this); }
9267
7640
  static get watchers() { return {
9268
- "checked": ["onCheckedChange"]
7641
+ "open": ["handleOpen"]
9269
7642
  }; }
9270
7643
  };
9271
- BcmTag.style = tagCss;
7644
+ BcmTooltip.style = tooltipCss;
9272
7645
 
9273
- const textCss = "@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}.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}:host{display:block}:host(.hidden){display:none}p{margin:0;padding:0}";
7646
+ const tooltipBoxCss = "@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}:host{display:inline-flex}:host(.hidden){display:none}:host(:focus){outline:none}.tooltip-box{position:relative;}.tooltip-box .box{position:absolute;display:none;box-sizing:border-box;background-color:#262626;border:1px solid #262626;border-radius:2px;z-index:10700;width:max-content;padding:4px 8px;color:var(--bcm-color-grey-1)}.tooltip-box::after{content:\"\";position:absolute;display:none;border:6px solid;z-index:10700;pointer-events:none}.tooltip-box.open .box,.tooltip-box.open::after{display:block}.tooltip-box.top .box{bottom:100%;margin-bottom:8px}.tooltip-box.top::after{bottom:100%;margin-bottom:-4px;border-color:#262626 transparent transparent transparent}.tooltip-box.bottom .box{top:100%;margin-top:8px}.tooltip-box.bottom::after{top:100%;margin-top:-4px;border-color:transparent transparent #262626 transparent}.tooltip-box.left .box{right:100%;margin-right:8px}.tooltip-box.left::after{right:100%;margin-right:-4px;border-color:transparent transparent transparent #262626}.tooltip-box.right .box{left:100%;margin-left:8px}.tooltip-box.right::after{left:100%;margin-left:-4px;border-color:transparent #262626 transparent transparent}.tooltip-box.top.center .box,.tooltip-box.bottom.center .box{left:50%;transform:translateX(-50%)}.tooltip-box.top.center::after,.tooltip-box.bottom.center::after{left:50%;transform:translateX(-50%)}.tooltip-box.top.start .box,.tooltip-box.bottom.start .box{left:0}.tooltip-box.top.start::after,.tooltip-box.bottom.start::after{left:8px}.tooltip-box.top.end .box,.tooltip-box.bottom.end .box{right:0}.tooltip-box.top.end::after,.tooltip-box.bottom.end::after{right:8px}.tooltip-box.left.center .box,.tooltip-box.right.center .box{top:50%;transform:translateY(-50%)}.tooltip-box.left.center::after,.tooltip-box.right.center::after{top:50%;transform:translateY(-50%)}.tooltip-box.left.start .box,.tooltip-box.right.start .box{top:0}.tooltip-box.left.start::after,.tooltip-box.right.start::after{top:4px}.tooltip-box.left.end .box,.tooltip-box.right.end .box{bottom:0}.tooltip-box.left.end::after,.tooltip-box.right.end::after{bottom:4px}.tooltip-box a{color:var(--bcm-color-grey-1)}";
9274
7647
 
9275
- const BcmText = class {
7648
+ const BcmTooltipBox = class {
9276
7649
  constructor(hostRef) {
9277
7650
  index.registerInstance(this, hostRef);
9278
- this.scale = 'size-4';
9279
- this.weight = 'regular';
9280
- this.color = 'grey-10';
9281
7651
  this.hidden = false;
9282
7652
  }
7653
+ connectedCallback() { }
7654
+ disconnectedCallback() { }
7655
+ componentWillLoad() { }
7656
+ componentDidLoad() { }
7657
+ componentWillRender() { }
7658
+ componentDidRender() { }
7659
+ componentWillUpdate() { }
7660
+ componentDidUpdate() { }
7661
+ async openBox(open) {
7662
+ this.open = open;
7663
+ }
9283
7664
  render() {
9284
- const classes = index$1.classnames(`weight-${this.weight}`, this.scale);
7665
+ const classes = index$1.classnames('tooltip-box', this.open, this.placement);
7666
+ const boxClasses = index$1.classnames('box');
9285
7667
  const hostClasses = index$1.classnames(this.hidden ? 'hidden' : null);
9286
- return (index.h(index.Host, { class: hostClasses }, index.h("p", { class: classes, style: { color: utils.extractColor(colors.ColorPalette, this.color) } }, index.h("slot", null))));
7668
+ return (index.h(index.Host, { class: hostClasses }, index.h("div", { class: classes }, index.h("div", { class: boxClasses, innerHTML: this.message }))));
9287
7669
  }
7670
+ get el() { return index.getElement(this); }
9288
7671
  };
9289
- BcmText.style = textCss;
7672
+ BcmTooltipBox.style = tooltipBoxCss;
9290
7673
 
9291
- exports.bcm_badge = BcmBadge;
9292
7674
  exports.bcm_button = BcmButton;
9293
- exports.bcm_checkbox_lite = BcmCheckboxLite;
9294
- exports.bcm_divider = BcmBadge$1;
7675
+ exports.bcm_checkbox = BcmCheckbox;
7676
+ exports.bcm_checkbox_group = BcmCheckboxGroup;
9295
7677
  exports.bcm_form = BcmForm;
9296
7678
  exports.bcm_icon = BcmIcon;
9297
7679
  exports.bcm_input = BcmInput;
9298
- exports.bcm_list = BcmList;
9299
- exports.bcm_list_item = BcmListItem;
9300
- exports.bcm_list_select = BcmListSelect;
9301
- exports.bcm_modal = BcmModal;
9302
- exports.bcm_radio = BcmRadio;
9303
- exports.bcm_radio_group = BcmRadioGroup;
9304
- exports.bcm_search = BcmSearch;
9305
- exports.bcm_tab = BcmTab;
9306
- exports.bcm_tab_pane = BcmTabPane;
9307
- exports.bcm_tabs = BcmTabs;
9308
- exports.bcm_tabs_content = BcmTabsContent;
9309
- exports.bcm_tag = BcmTag;
9310
- exports.bcm_text = BcmText;
7680
+ exports.bcm_label = BcmLabel;
7681
+ exports.bcm_switch = BcmSwitch;
7682
+ exports.bcm_textarea = BcmTextarea;
7683
+ exports.bcm_tooltip = BcmTooltip;
7684
+ exports.bcm_tooltip_box = BcmTooltipBox;