bromcom-ui 2.8.1 → 2.9.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
  2. package/dist/bromcom-ui/{p-4899fba4.entry.js → p-0906c9b4.entry.js} +1 -1
  3. package/dist/bromcom-ui/{p-e7028542.entry.js → p-0ee4e283.entry.js} +1 -1
  4. package/dist/bromcom-ui/{p-4dac52f8.entry.js → p-0fdbbbe8.entry.js} +1 -1
  5. package/dist/bromcom-ui/p-14378828.entry.js +5 -0
  6. package/dist/bromcom-ui/{p-251bfa4c.entry.js → p-15fa3329.entry.js} +1 -1
  7. package/dist/bromcom-ui/{p-9c9babdd.entry.js → p-1c5a2111.entry.js} +1 -1
  8. package/dist/bromcom-ui/{p-e0618f5d.entry.js → p-20ac20d4.entry.js} +1 -1
  9. package/dist/bromcom-ui/p-24aefda6.js +1 -1
  10. package/dist/bromcom-ui/p-2cb4a196.entry.js +5 -0
  11. package/dist/bromcom-ui/p-2ea24a6e.js +1 -1
  12. package/dist/bromcom-ui/{p-0ee1ff83.entry.js → p-344a4674.entry.js} +1 -1
  13. package/dist/bromcom-ui/p-3ad545f0.entry.js +5 -0
  14. package/dist/bromcom-ui/{p-90894817.entry.js → p-40a5e4fc.entry.js} +1 -1
  15. package/dist/bromcom-ui/p-440afdfa.entry.js +5 -0
  16. package/dist/bromcom-ui/{p-94293d46.entry.js → p-4b34b3f9.entry.js} +1 -1
  17. package/dist/bromcom-ui/{p-a3aa9b2a.entry.js → p-55001c80.entry.js} +1 -1
  18. package/dist/bromcom-ui/{p-625af6e2.entry.js → p-5f288af5.entry.js} +1 -1
  19. package/dist/bromcom-ui/{p-274465b7.entry.js → p-70b428e8.entry.js} +1 -1
  20. package/dist/bromcom-ui/p-89b21290.entry.js +5 -0
  21. package/dist/bromcom-ui/p-8d0ca8c2.js +1 -1
  22. package/dist/bromcom-ui/{p-e82340a2.entry.js → p-9b10d955.entry.js} +1 -1
  23. package/dist/bromcom-ui/{p-47b69111.entry.js → p-9c7e9b5d.entry.js} +1 -1
  24. package/dist/bromcom-ui/p-a0a3fd94.entry.js +5 -0
  25. package/dist/bromcom-ui/{p-f4f4e410.entry.js → p-a2046742.entry.js} +1 -1
  26. package/dist/bromcom-ui/p-a429e85b.js +1 -1
  27. package/dist/bromcom-ui/p-a97ee69d.entry.js +19 -0
  28. package/dist/bromcom-ui/{p-2fc1ab9a.entry.js → p-ab55def1.entry.js} +1 -1
  29. package/dist/bromcom-ui/p-b60bcecf.js +1 -1
  30. package/dist/bromcom-ui/{p-a8a4460a.entry.js → p-c9b10de5.entry.js} +1 -1
  31. package/dist/bromcom-ui/{p-160ef457.entry.js → p-cad8f786.entry.js} +1 -1
  32. package/dist/bromcom-ui/{p-140b10d1.entry.js → p-e008411a.entry.js} +1 -1
  33. package/dist/bromcom-ui/p-e0f440b4.js +1 -1
  34. package/dist/bromcom-ui/{p-c15e0e77.entry.js → p-e3cafc0d.entry.js} +1 -1
  35. package/dist/bromcom-ui/{p-0d693b8b.entry.js → p-e606c42b.entry.js} +1 -1
  36. package/dist/bromcom-ui/{p-86b8672d.entry.js → p-e66821e5.entry.js} +1 -1
  37. package/dist/cjs/{bcm-634604e3.js → bcm-ab921827.js} +4 -4
  38. package/dist/cjs/bcm-alert.cjs.entry.js +2 -2
  39. package/dist/cjs/{bcm-colorful_2.cjs.entry.js → bcm-avatar_15.cjs.entry.js} +6232 -149
  40. package/dist/cjs/bcm-button-group.cjs.entry.js +5 -5
  41. package/dist/cjs/bcm-card.cjs.entry.js +3 -3
  42. package/dist/cjs/bcm-checkbox-group.cjs.entry.js +416 -0
  43. package/dist/cjs/bcm-checkbox-lite_9.cjs.entry.js +4 -4
  44. package/dist/cjs/bcm-checkbox_2.cjs.entry.js +193 -0
  45. package/dist/cjs/bcm-color-input.cjs.entry.js +2 -2
  46. package/dist/cjs/bcm-date-picker.cjs.entry.js +2 -2
  47. package/dist/cjs/bcm-datetime-picker.cjs.entry.js +7 -7
  48. package/dist/cjs/bcm-drawer.cjs.entry.js +4 -4
  49. package/dist/cjs/bcm-dropdown.cjs.entry.js +4 -4
  50. package/dist/cjs/bcm-expansion-panel.cjs.entry.js +2 -2
  51. package/dist/cjs/bcm-form-2.cjs.entry.js +4 -3
  52. package/dist/cjs/bcm-item.cjs.entry.js +2 -2
  53. package/dist/cjs/bcm-items.cjs.entry.js +2 -2
  54. package/dist/cjs/bcm-link.cjs.entry.js +3 -3
  55. package/dist/cjs/bcm-menu.cjs.entry.js +4 -4
  56. package/dist/cjs/bcm-modal-2-footer.cjs.entry.js +2 -2
  57. package/dist/cjs/bcm-modal-2-header.cjs.entry.js +2 -2
  58. package/dist/cjs/bcm-modal-2.cjs.entry.js +3 -3
  59. package/dist/cjs/bcm-modal.cjs.entry.js +5 -5
  60. package/dist/cjs/bcm-popconfirm-box.cjs.entry.js +3 -3
  61. package/dist/cjs/bcm-popconfirm.cjs.entry.js +3 -3
  62. package/dist/cjs/bcm-popover.cjs.entry.js +5 -5
  63. package/dist/cjs/bcm-progress.cjs.entry.js +2 -2
  64. package/dist/cjs/bcm-radio-group.cjs.entry.js +6 -6
  65. package/dist/cjs/bcm-radio.cjs.entry.js +9 -9
  66. package/dist/cjs/bcm-range.cjs.entry.js +4 -4
  67. package/dist/cjs/bcm-select.cjs.entry.js +2 -2
  68. package/dist/cjs/bcm-stepper.cjs.entry.js +4 -4
  69. package/dist/cjs/bcm-switch.cjs.entry.js +7 -7
  70. package/dist/cjs/bcm-tab-group.cjs.entry.js +3 -3
  71. package/dist/cjs/bcm-tab-item-header.cjs.entry.js +6 -6
  72. package/dist/cjs/bcm-tab-item.cjs.entry.js +2 -2
  73. package/dist/cjs/bcm-tag.cjs.entry.js +12 -12
  74. package/dist/cjs/bcm-text.cjs.entry.js +3 -3
  75. package/dist/cjs/bcm-textarea.cjs.entry.js +5 -5
  76. package/dist/cjs/bcm-time-picker.cjs.entry.js +2 -2
  77. package/dist/cjs/bcm-toast.cjs.entry.js +9 -9
  78. package/dist/cjs/bromcom-ui.cjs.js +1 -1
  79. package/dist/cjs/{floating-ui-74eb26d6.js → floating-ui-c9fc2202.js} +2 -2
  80. package/dist/cjs/{input-template-4617f909.js → input-template-1441e468.js} +5 -5
  81. package/dist/cjs/{label-template-cc69bc21.js → label-template-4d5f99a5.js} +3 -3
  82. package/dist/cjs/loader.cjs.js +1 -1
  83. package/dist/cjs/old-bcm-popover-box.cjs.entry.js +4 -4
  84. package/dist/cjs/old-bcm-popover.cjs.entry.js +3 -3
  85. package/dist/cjs/{popover-placement-3c8f3a72.js → popover-placement-ccb40073.js} +1 -1
  86. package/dist/cjs/{slot-template-3e59d7d8.js → slot-template-d70ea082.js} +1 -1
  87. package/dist/cjs/{string-helper-45cffee0.js → string-helper-d681e5c7.js} +2 -2
  88. package/dist/cjs/{tooltip-helper-2e8b879b.js → tooltip-helper-235b26ea.js} +6 -6
  89. package/dist/collection/collection-manifest.json +1 -0
  90. package/dist/collection/components/atoms/chip/chip-group.js +292 -0
  91. package/dist/collection/components/atoms/chip/chip.js +107 -26
  92. package/dist/collection/components/organism/form/form.js +1 -0
  93. package/dist/collection/components/organism/form-2/bcm-form-components.js +1 -0
  94. package/dist/collection/components/organism/list/list.css +3 -0
  95. package/dist/components/bcm-chip-group.d.ts +11 -0
  96. package/dist/components/bcm-chip-group.js +174 -0
  97. package/dist/components/bcm-chip.js +1 -100
  98. package/dist/components/bcm-form-2.js +1 -0
  99. package/dist/components/bcm-form.js +1 -0
  100. package/dist/components/bcm-list.js +1 -1702
  101. package/dist/{esm/bcm-chip.entry.js → components/chip.js} +110 -33
  102. package/dist/components/index.d.ts +1 -0
  103. package/dist/components/index.js +1 -0
  104. package/dist/{esm/bcm-list.entry.js → components/list.js} +136 -31
  105. package/dist/esm/bcm-9f50af9c.js +1 -1
  106. package/dist/esm/{bcm-colorful_2.entry.js → bcm-avatar_15.entry.js} +6219 -149
  107. package/dist/esm/bcm-button-group.entry.js +1 -1
  108. package/dist/esm/bcm-checkbox-group.entry.js +412 -0
  109. package/dist/esm/bcm-checkbox-lite_9.entry.js +1 -1
  110. package/dist/esm/bcm-checkbox_2.entry.js +188 -0
  111. package/dist/esm/bcm-date-picker.entry.js +1 -1
  112. package/dist/esm/bcm-datetime-picker.entry.js +1 -1
  113. package/dist/esm/bcm-drawer.entry.js +1 -1
  114. package/dist/esm/bcm-dropdown.entry.js +1 -1
  115. package/dist/esm/bcm-form-2.entry.js +2 -1
  116. package/dist/esm/bcm-item.entry.js +1 -1
  117. package/dist/esm/bcm-link.entry.js +1 -1
  118. package/dist/esm/bcm-modal-2.entry.js +1 -1
  119. package/dist/esm/bcm-modal.entry.js +1 -1
  120. package/dist/esm/bcm-popconfirm.entry.js +1 -1
  121. package/dist/esm/bcm-popover.entry.js +1 -1
  122. package/dist/esm/bcm-progress.entry.js +1 -1
  123. package/dist/esm/bcm-radio-group.entry.js +1 -1
  124. package/dist/esm/bcm-radio.entry.js +1 -1
  125. package/dist/esm/bcm-range.entry.js +1 -1
  126. package/dist/esm/bcm-stepper.entry.js +1 -1
  127. package/dist/esm/bcm-switch.entry.js +1 -1
  128. package/dist/esm/bcm-tab-group.entry.js +1 -1
  129. package/dist/esm/bcm-tab-item-header.entry.js +1 -1
  130. package/dist/esm/bcm-tag.entry.js +1 -1
  131. package/dist/esm/bcm-textarea.entry.js +1 -1
  132. package/dist/esm/bcm-time-picker.entry.js +1 -1
  133. package/dist/esm/bcm-toast.entry.js +1 -1
  134. package/dist/esm/bromcom-ui.js +1 -1
  135. package/dist/esm/floating-ui-e7341329.js +1 -1
  136. package/dist/esm/input-template-e1df6efd.js +1 -1
  137. package/dist/esm/label-template-d74fe788.js +1 -1
  138. package/dist/esm/loader.js +1 -1
  139. package/dist/esm/old-bcm-popover.entry.js +1 -1
  140. package/dist/esm/string-helper-6bd24967.js +1 -1
  141. package/dist/esm/tooltip-helper-10b64c23.js +1 -1
  142. package/dist/types/components/atoms/chip/chip-group.d.ts +22 -0
  143. package/dist/types/components/atoms/chip/chip.d.ts +18 -13
  144. package/dist/types/components.d.ts +47 -4
  145. package/package.json +1 -1
  146. package/dist/bromcom-ui/p-111c4b6a.entry.js +0 -5
  147. package/dist/bromcom-ui/p-121eca04.entry.js +0 -5
  148. package/dist/bromcom-ui/p-1eabd5dc.js +0 -10
  149. package/dist/bromcom-ui/p-55837df1.entry.js +0 -5
  150. package/dist/bromcom-ui/p-8c62e1ca.entry.js +0 -5
  151. package/dist/bromcom-ui/p-9d23288e.entry.js +0 -5
  152. package/dist/bromcom-ui/p-b4f40047.entry.js +0 -5
  153. package/dist/bromcom-ui/p-b5ba17a4.entry.js +0 -13
  154. package/dist/bromcom-ui/p-b85bdadc.entry.js +0 -5
  155. package/dist/bromcom-ui/p-cbb3c1f0.entry.js +0 -5
  156. package/dist/bromcom-ui/p-d155cf69.entry.js +0 -5
  157. package/dist/bromcom-ui/p-f3d550ed.entry.js +0 -5
  158. package/dist/bromcom-ui/p-fdc8effc.entry.js +0 -5
  159. package/dist/cjs/bcm-avatar_2.cjs.entry.js +0 -139
  160. package/dist/cjs/bcm-button_7.cjs.entry.js +0 -1521
  161. package/dist/cjs/bcm-chip.cjs.entry.js +0 -74
  162. package/dist/cjs/bcm-input.cjs.entry.js +0 -370
  163. package/dist/cjs/bcm-list.cjs.entry.js +0 -1607
  164. package/dist/cjs/bcm-rc-overflow_2.cjs.entry.js +0 -2443
  165. package/dist/cjs/bcm-typography.cjs.entry.js +0 -21
  166. package/dist/cjs/index-906fb4e5.js +0 -540
  167. package/dist/esm/bcm-avatar_2.entry.js +0 -134
  168. package/dist/esm/bcm-button_7.entry.js +0 -1511
  169. package/dist/esm/bcm-input.entry.js +0 -366
  170. package/dist/esm/bcm-rc-overflow_2.entry.js +0 -2438
  171. package/dist/esm/bcm-typography.entry.js +0 -17
  172. package/dist/esm/index-6310a048.js +0 -537
@@ -8,9 +8,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
8
8
 
9
9
  const index = require('./index-ddfd6d8f.js');
10
10
  const generate = require('./generate-21143214.js');
11
- const bcm = require('./bcm-634604e3.js');
11
+ const bcm = require('./bcm-ab921827.js');
12
12
  const index$1 = require('./index-fdbf5226.js');
13
- const stringHelper = require('./string-helper-45cffee0.js');
13
+ const stringHelper = require('./string-helper-d681e5c7.js');
14
14
  require('./colors-e1d142ad.js');
15
15
  require('./_commonjsHelpers-bd20f4c0.js');
16
16
 
@@ -21,11 +21,11 @@ const BcmButtonGroup = class {
21
21
  index.registerInstance(this, hostRef);
22
22
  this.bcmChange = index.createEvent(this, "bcm-change", 7);
23
23
  this._id = generate.Generate.UID();
24
- this.size = bcm.Bcm.Size.medium;
24
+ this.size = bcm.Bcm$1.Size.medium;
25
25
  this.type = 'button';
26
26
  this.color = undefined;
27
27
  this.disabled = undefined;
28
- this.direction = bcm.Bcm.Direction.horizontal;
28
+ this.direction = bcm.Bcm$1.Direction.horizontal;
29
29
  }
30
30
  componentWillLoad() {
31
31
  const { size, color } = this;
@@ -80,7 +80,7 @@ const BcmButtonGroup = class {
80
80
  }
81
81
  render() {
82
82
  const hostClasses = index$1.classnames('bcm-button-group', {
83
- 'bcm-button-group__vertical': this.direction === bcm.Bcm.Direction.vertical,
83
+ 'bcm-button-group__vertical': this.direction === bcm.Bcm$1.Direction.vertical,
84
84
  });
85
85
  return (index.h(index.Host, { class: hostClasses }, index.h("slot", null)));
86
86
  }
@@ -10,13 +10,13 @@ const index = require('./index-ddfd6d8f.js');
10
10
  const index$1 = require('./index-fdbf5226.js');
11
11
  const colorHelper = require('./color-helper-d6d2028b.js');
12
12
  const generate = require('./generate-21143214.js');
13
- const stringHelper = require('./string-helper-45cffee0.js');
14
- const slotTemplate = require('./slot-template-3e59d7d8.js');
13
+ const stringHelper = require('./string-helper-d681e5c7.js');
14
+ const slotTemplate = require('./slot-template-d70ea082.js');
15
15
  require('./_commonjsHelpers-bd20f4c0.js');
16
16
  require('./colors-56282b00.js');
17
17
  require('./utils-fc077139.js');
18
18
  require('./colors-e1d142ad.js');
19
- require('./bcm-634604e3.js');
19
+ require('./bcm-ab921827.js');
20
20
 
21
21
  const cardCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");@import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap\"); .size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}*{box-sizing:border-box}.bcm-card{font-family:\"Inter\", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;display:block;width:100%;background-color:var(--bcm-new-ds-color-white);border-radius:8px;box-shadow:0 1px 3px 0 rgba(17, 24, 38, 0.1);box-sizing:border-box}.bcm-card__header,.bcm-card__body,.bcm-card__footer{display:block;width:100%}.bcm-card__header{border-radius:8px 8px 0 0;padding:12px 24px;color:var(--bcm-new-ds-color-slate-700);font-weight:600}.bcm-card__body{padding:12px 24px}.bcm-card__footer{padding:12px 24px;border-radius:0 0 8px 8px}";
22
22
 
@@ -0,0 +1,416 @@
1
+ /*!
2
+ * Built with Stencil
3
+ * Copyright (c) Bromcom.
4
+ */
5
+ 'use strict';
6
+
7
+ Object.defineProperty(exports, '__esModule', { value: true });
8
+
9
+ const index = require('./index-ddfd6d8f.js');
10
+ const index$2 = require('./index-fdbf5226.js');
11
+ const generate = require('./generate-21143214.js');
12
+ const bcm = require('./bcm-ab921827.js');
13
+ const utils = require('./utils-fc077139.js');
14
+ const index$1 = require('./index-4506fcd7.js');
15
+ const labelTemplate = require('./label-template-4d5f99a5.js');
16
+ const isLoadDecorator = require('./is-load-decorator-137dded1.js');
17
+ require('./_commonjsHelpers-bd20f4c0.js');
18
+ require('./colors-e1d142ad.js');
19
+ require('./slot-template-d70ea082.js');
20
+ require('./string-helper-d681e5c7.js');
21
+
22
+ const CheckboxGroupTemplate = ({ customStyle, groupContainerClasses, onBcmSelect, items }) => {
23
+ return (index.h("div", { class: groupContainerClasses, style: customStyle }, items.childs && items.childs.map((checkbox) => {
24
+ return (index.h("bcm-checkbox", { id: checkbox.id, name: checkbox.name, color: checkbox.color, checked: checkbox.checked, disabled: checkbox.disabled, readonly: checkbox.readonly, required: checkbox.required, noCaption: checkbox.noCaption, "no-margin": true, size: checkbox.size, "full-width": checkbox.fullWidth, onClick: (e) => { !checkbox.disabled && !checkbox.readonly && (onBcmSelect(checkbox.id), e.preventDefault()); } }, checkbox.slot || checkbox.label));
25
+ })));
26
+ };
27
+
28
+ const { state } = index$1.createStore({
29
+ group: new Map(),
30
+ allChecked: true,
31
+ allUnchecked: true,
32
+ changeInderminate: {},
33
+ });
34
+ const setValue = async ({ fullWidth, optionType, buttonStyle, size, defaultCheckedItems, el, id, label, required, captionType, hidden, direction, childs, indeterminate, gap, noCaption, }) => {
35
+ if (el) {
36
+ state.group.set(id, {
37
+ fullWidth,
38
+ optionType,
39
+ buttonStyle,
40
+ size,
41
+ defaultCheckedItems,
42
+ label,
43
+ required,
44
+ captionType,
45
+ hidden,
46
+ direction,
47
+ indeterminate,
48
+ gap,
49
+ noCaption,
50
+ childs: childs === null || childs === void 0 ? void 0 : childs.map(child => {
51
+ child.checked && (state.allUnchecked = false);
52
+ !child.checked && (state.allChecked = false);
53
+ // fullWidth && (fullWidth == 'flex' ? (child.style.flex = 'auto') : (child.style.width = '100%'));
54
+ optionType && (child.optionType = optionType);
55
+ buttonStyle && (child.buttonStyle = buttonStyle);
56
+ size && (child.size = size);
57
+ defaultCheckedItems && defaultCheckedItems.find(e => e === child.name) && (child.checked = true);
58
+ child.noCaption = noCaption;
59
+ return {
60
+ id: child.id || generate.Generate.UID(),
61
+ checked: child.checked || false,
62
+ name: child.name,
63
+ size: child.size,
64
+ buttonStyle: child.buttonStyle,
65
+ optionType: child.optionType,
66
+ style: child.style,
67
+ noCaption: child.noCaption,
68
+ color: child.color,
69
+ disabled: child.disabled,
70
+ readonly: child.readonly,
71
+ label: child.label || child.name,
72
+ slot: child.slot || generate.snq(() => child.querySelector('.slot').textContent, child.textContent),
73
+ required: child.required || required,
74
+ el: child,
75
+ captionType,
76
+ hidden,
77
+ };
78
+ }),
79
+ indeterminateState: !state.allChecked && !state.allUnchecked ? 'indeterminate' : state.allChecked ? 'determinate' : 'uncheck',
80
+ });
81
+ }
82
+ };
83
+ const getProperty = id => {
84
+ return generate.snq(() => state.group.get(id), {});
85
+ };
86
+ const getValue = (id, name) => {
87
+ var _a;
88
+ const group = getProperty(id);
89
+ let value = {};
90
+ (_a = group.childs) === null || _a === void 0 ? void 0 : _a.map(child => {
91
+ if (name) {
92
+ if (child.name === name) {
93
+ value[child.name] = {
94
+ value: !!child.checked,
95
+ name: child.name,
96
+ };
97
+ }
98
+ }
99
+ else {
100
+ value[child.name] = {
101
+ value: !!child.checked,
102
+ name: child.name,
103
+ };
104
+ }
105
+ });
106
+ return value;
107
+ };
108
+ const getCheckedList = id => {
109
+ var _a;
110
+ const group = getProperty(id);
111
+ let value = {};
112
+ (_a = group.childs) === null || _a === void 0 ? void 0 : _a.map(child => {
113
+ if (child.checked === true) {
114
+ value[child.name] = {
115
+ value: !!child.checked,
116
+ name: child.name,
117
+ };
118
+ }
119
+ });
120
+ return value;
121
+ };
122
+ const setClear = id => {
123
+ var _a;
124
+ (_a = getProperty(id).childs) === null || _a === void 0 ? void 0 : _a.forEach(child => {
125
+ child.checked = false;
126
+ });
127
+ checkInderminate(id);
128
+ };
129
+ const setCheckedItems = (id, items, checked, reset) => {
130
+ var _a;
131
+ const checkedItems = items && (typeof items == 'string' ? JSON.parse(items) : items);
132
+ (_a = getProperty(id).childs) === null || _a === void 0 ? void 0 : _a.forEach(child => {
133
+ if (checkedItems) {
134
+ const checkedItem = checkedItems.find(e => e === child.name || e.name === child.name);
135
+ if (checkedItem) {
136
+ if (typeof checkedItem == 'object') {
137
+ Object.keys(checkedItem).map(key => {
138
+ if (key === 'checked') {
139
+ child.checked = checkedItem[key];
140
+ }
141
+ else {
142
+ child.checked = checked;
143
+ }
144
+ });
145
+ }
146
+ else {
147
+ child.checked = checked;
148
+ }
149
+ }
150
+ else {
151
+ reset && (child.checked = false);
152
+ }
153
+ }
154
+ else {
155
+ child.checked = false;
156
+ }
157
+ });
158
+ checkInderminate(id);
159
+ };
160
+ const resetCaption = id => {
161
+ var _a;
162
+ // const noCaption = getProperty(id).noCaption;
163
+ (_a = getProperty(id).childs) === null || _a === void 0 ? void 0 : _a.forEach(child => {
164
+ child.resetCaption();
165
+ // child.noCaption = noCaption;
166
+ });
167
+ };
168
+ const changeIndeterminate = id => {
169
+ var _a;
170
+ const group = getProperty(id);
171
+ if (!group.disabled) {
172
+ let checkAll = true;
173
+ if (group.indeterminateState === 'determinate') {
174
+ checkAll = false;
175
+ }
176
+ (_a = getProperty(id).childs) === null || _a === void 0 ? void 0 : _a.map(child => {
177
+ child.checked = checkAll;
178
+ });
179
+ checkInderminate(id);
180
+ }
181
+ };
182
+ const checkInderminate = id => {
183
+ var _a;
184
+ const group = getProperty(id);
185
+ let allChecked = true;
186
+ let allUnchecked = true;
187
+ (_a = group.childs) === null || _a === void 0 ? void 0 : _a.map(child => {
188
+ child.checked && (allUnchecked = false);
189
+ !child.checked && (allChecked = false);
190
+ });
191
+ group.indeterminateState = !allChecked && !allUnchecked ? 'indeterminate' : allChecked ? 'determinate' : 'uncheck';
192
+ };
193
+ const onChange = (obj) => {
194
+ var _a;
195
+ (_a = getProperty(obj.id).childs) === null || _a === void 0 ? void 0 : _a.map(child => {
196
+ child.checked = child.id === obj.childId ? !child.checked : child.checked;
197
+ });
198
+ checkInderminate(obj.id);
199
+ };
200
+ const removeState = id => {
201
+ return Promise.resolve(state.group.delete(id));
202
+ };
203
+ const getStatesKeys = id => {
204
+ return Object.keys(state.group.get(id));
205
+ };
206
+ const checkBoxGroupState = {
207
+ setValue,
208
+ getValue,
209
+ setCheckedItems,
210
+ getCheckedList,
211
+ getProperty,
212
+ setClear,
213
+ resetCaption,
214
+ onChange,
215
+ getStatesKeys,
216
+ state,
217
+ removeState,
218
+ changeIndeterminate,
219
+ };
220
+
221
+ const groupCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}.bcm-checkbox-group{display:flex;flex-direction:column;align-items:flex-start;width:100%;margin-bottom:8px}.bcm-checkbox-group.hidden{display:none}.bcm-checkbox-group__container{display:flex;flex-wrap:wrap;justify-content:flex-start;align-items:flex-start;width:100%}.bcm-checkbox-group__container.full-width{max-width:100%}.bcm-checkbox-group__container.vertical{gap:8px;flex-direction:column}.bcm-checkbox-group__container.button{gap:unset}.bcm-checkbox-group__container.indeterminate{padding-top:16px;margin-top:16px;border-top:1px solid #efefef}";
222
+
223
+ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
224
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
225
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
226
+ r = Reflect.decorate(decorators, target, key, desc);
227
+ else
228
+ for (var i = decorators.length - 1; i >= 0; i--)
229
+ if (d = decorators[i])
230
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
231
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
232
+ };
233
+ const BcmCheckboxGroup = class {
234
+ constructor(hostRef) {
235
+ index.registerInstance(this, hostRef);
236
+ this.change = index.createEvent(this, "bcm-change", 7);
237
+ this.groupCheckedList = index.createEvent(this, "bcm-group-checked-list", 7);
238
+ this._id = generate.Generate.UID();
239
+ this.direction = bcm.Bcm$1.Direction.horizontal;
240
+ this.items = [];
241
+ this.indeterminate = false;
242
+ this.name = undefined;
243
+ this.value = undefined;
244
+ this.disabled = false;
245
+ this.readonly = false;
246
+ this.hidden = false;
247
+ this.required = false;
248
+ this.label = undefined;
249
+ this.gap = undefined;
250
+ this.defaultValue = undefined;
251
+ this.fullWidth = false;
252
+ this.optionType = 'default';
253
+ this.buttonStyle = 'solid';
254
+ this.size = bcm.Bcm$1.Size.medium;
255
+ this.caption = undefined;
256
+ this.noCaption = false;
257
+ this.captionType = bcm.Bcm$1.Status.default;
258
+ this.tick = {};
259
+ }
260
+ componentDidLoad() {
261
+ this.initState();
262
+ }
263
+ disconnectedCallback() {
264
+ checkBoxGroupState.removeState(this._id);
265
+ }
266
+ componentShouldUpdate(newVal, oldVal, propName) {
267
+ if (propName == 'tick' && newVal !== oldVal) {
268
+ const isHaveChild = generate.snq(() => checkBoxGroupState.getProperty(this._id).childs.length > 0, false);
269
+ if (isHaveChild) {
270
+ this.getValue().then(values => this.value = values);
271
+ }
272
+ }
273
+ if (this.getOptions().indexOf(propName) > -1 && newVal !== oldVal) {
274
+ this.initState();
275
+ }
276
+ }
277
+ getOptions() {
278
+ return generate.snq(() => checkBoxGroupState.getStatesKeys(this._id), []);
279
+ }
280
+ async initState() {
281
+ const { fullWidth, optionType, buttonStyle, size, noCaption, defaultValue, label, required, captionType, hidden, direction, indeterminate, gap, items } = this;
282
+ const defaultCheckedItems = defaultValue && (typeof defaultValue == 'string' ? JSON.parse(defaultValue) : defaultValue);
283
+ const childElements = items.length > 0 ? items : await this.getCheckboxes();
284
+ await checkBoxGroupState.setValue({
285
+ id: this._id,
286
+ el: this.el,
287
+ indeterminate,
288
+ fullWidth,
289
+ optionType,
290
+ buttonStyle,
291
+ size,
292
+ defaultCheckedItems,
293
+ label,
294
+ noCaption,
295
+ required,
296
+ captionType,
297
+ hidden,
298
+ gap,
299
+ direction,
300
+ childs: childElements
301
+ });
302
+ const slotArea = this.el.querySelector(`#bcm-checkbox-group__items-${this._id}`);
303
+ if (slotArea) {
304
+ slotArea.innerHTML && (slotArea.innerHTML = '');
305
+ }
306
+ this.value = await this.getValue();
307
+ }
308
+ async markForCheck() {
309
+ await utils.delay(10);
310
+ this.tick = generate.Generate.UID();
311
+ }
312
+ async onBcmFocus() {
313
+ //focus first item
314
+ const childs = this.getCheckboxes();
315
+ if (childs.length > 0) {
316
+ childs[0].onBcmFocus();
317
+ }
318
+ }
319
+ async onBcmBlur() {
320
+ this.el.blur();
321
+ }
322
+ async setClear() {
323
+ checkBoxGroupState.setClear(this._id);
324
+ await utils.delay(10);
325
+ this.getCheckboxes().forEach(item => {
326
+ item.setClear();
327
+ });
328
+ this.markForCheck();
329
+ await utils.delay(10);
330
+ return Promise.resolve();
331
+ }
332
+ async resetCaption() {
333
+ await utils.delay(10);
334
+ this.getCheckboxes().forEach(item => {
335
+ item.resetCaption();
336
+ });
337
+ await utils.delay(10);
338
+ return Promise.resolve();
339
+ }
340
+ async set(data) {
341
+ if (Array.isArray(data)) {
342
+ await this.check(data, true, true);
343
+ }
344
+ }
345
+ async get() {
346
+ const checklist = await this.getCheckedList() && Object.keys(await this.getCheckedList());
347
+ return checklist.length > 0 ? checklist : [];
348
+ }
349
+ async check(items, checked = true, reset = false) {
350
+ checkBoxGroupState.setCheckedItems(this._id, items, checked, reset);
351
+ this.markForCheck();
352
+ }
353
+ async getValue(name) {
354
+ return Promise.resolve(checkBoxGroupState.getValue(this._id, name));
355
+ }
356
+ async getCheckedList() {
357
+ return checkBoxGroupState.getCheckedList(this._id);
358
+ }
359
+ handleItemsChange() {
360
+ this.initState();
361
+ }
362
+ getCheckboxes() {
363
+ return utils.getChildElements(this.el, 'bcm-checkbox:not(#bcm-indeterminate-element)');
364
+ }
365
+ async getCheckbox(id) {
366
+ const element = this.el.querySelector(`bcm-checkbox[id="${id}"]`);
367
+ if (element) {
368
+ const name = element["name"];
369
+ const value = await this.getValue(name);
370
+ return { element, event: generate.snq(() => value[name], null) };
371
+ }
372
+ return {};
373
+ }
374
+ async indeterminateClick() {
375
+ checkBoxGroupState.changeIndeterminate(this._id);
376
+ this.markForCheck();
377
+ }
378
+ async changeCheckBox(id) {
379
+ checkBoxGroupState.onChange({ id: this._id, childId: id });
380
+ this.markForCheck();
381
+ await utils.delay(10);
382
+ this.value = await this.getValue();
383
+ this.change.emit({ value: this.value, changed: Object.assign({}, await this.getCheckbox(id)) });
384
+ this.groupCheckedList.emit(await this.getCheckedList());
385
+ }
386
+ getItems() {
387
+ return checkBoxGroupState.getProperty(this._id);
388
+ }
389
+ render() {
390
+ const items = this.getItems();
391
+ const { disabled, captionType, label, indeterminate, indeterminateState, required, direction, optionType, hidden, fullWidth, gap } = items;
392
+ const bcmChechboxGroup = index$2.classnames('bcm-checkbox-group', direction, optionType, {
393
+ hidden,
394
+ 'full-width': fullWidth
395
+ });
396
+ const bcmChechboxGroupContainer = index$2.classnames('bcm-checkbox-group__container', optionType, {
397
+ [direction]: optionType === 'default',
398
+ indeterminate,
399
+ hidden,
400
+ 'full-width': fullWidth
401
+ });
402
+ return (index.h(index.Host, { class: bcmChechboxGroup }, index.h("span", { hidden: true, id: `bcm-checkbox-group__items-${this._id}` }, index.h("slot", null)), index.h("div", { class: "bcm-checkbox-group__label" }, label &&
403
+ index.h("div", null, index.h(labelTemplate.LabelTemplate, { size: this.size, type: captionType, value: label, required: required }))), indeterminate &&
404
+ index.h("bcm-checkbox", { onClick: (e) => { this.indeterminateClick(), e.preventDefault(); }, "no-caption": true, id: "bcm-indeterminate-element", indeterminate: indeterminateState, disabled: disabled }, "Check All"), index.h(CheckboxGroupTemplate, { items: items, groupContainerClasses: bcmChechboxGroupContainer, customStyle: gap && ({ 'gap': gap }), onBcmSelect: (id) => this.changeCheckBox(id) })));
405
+ }
406
+ get el() { return index.getElement(this); }
407
+ static get watchers() { return {
408
+ "items": ["handleItemsChange"]
409
+ }; }
410
+ };
411
+ __decorate([
412
+ isLoadDecorator.IsLoad()
413
+ ], BcmCheckboxGroup.prototype, "el", void 0);
414
+ BcmCheckboxGroup.style = groupCss;
415
+
416
+ exports.bcm_checkbox_group = BcmCheckboxGroup;
@@ -9,7 +9,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
9
9
  const index = require('./index-ddfd6d8f.js');
10
10
  const index$1 = require('./index-fdbf5226.js');
11
11
  const generate = require('./generate-21143214.js');
12
- const bcm = require('./bcm-634604e3.js');
12
+ const bcm = require('./bcm-ab921827.js');
13
13
  const utils = require('./utils-fc077139.js');
14
14
  require('./_commonjsHelpers-bd20f4c0.js');
15
15
  require('./colors-e1d142ad.js');
@@ -26,7 +26,7 @@ const BcmCheckboxLite = class {
26
26
  this.hidden = false;
27
27
  this.required = false;
28
28
  this.readOnly = false;
29
- this.captionType = bcm.Bcm.Status.default;
29
+ this.captionType = bcm.Bcm$1.Status.default;
30
30
  }
31
31
  render() {
32
32
  const { disabled, checked, readOnly, required, indeterminate, hidden, captionType, _id } = this;
@@ -54,7 +54,7 @@ const BcmCheckboxLite = class {
54
54
  // 'bcm-checkbox__label'
55
55
  // )
56
56
  const bcmCheckboxClass = index$1.classnames('bcm-checkbox', `bcm-checkbox-size-medium`, {
57
- 'error': captionType == bcm.Bcm.Status.error,
57
+ 'error': captionType == bcm.Bcm$1.Status.error,
58
58
  hidden,
59
59
  checked,
60
60
  disabled,
@@ -84,7 +84,7 @@ const BcmDivider = class {
84
84
  constructor(hostRef) {
85
85
  index.registerInstance(this, hostRef);
86
86
  this.hidden = false;
87
- this.direction = bcm.Bcm.Direction.horizontal;
87
+ this.direction = bcm.Bcm$1.Direction.horizontal;
88
88
  }
89
89
  render() {
90
90
  const { hidden, direction } = this;