bromcom-ui 2.8.0-rc.0 → 2.8.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. package/dist/bromcom-ui/bromcom-ui.css +1 -1
  2. package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
  3. package/dist/bromcom-ui/p-07b62dab.entry.js +5 -0
  4. package/dist/bromcom-ui/p-0ae31364.entry.js +5 -0
  5. package/dist/bromcom-ui/p-168d2632.entry.js +5 -0
  6. package/dist/bromcom-ui/p-178fb088.entry.js +5 -0
  7. package/dist/bromcom-ui/p-17bafd84.entry.js +5 -0
  8. package/dist/bromcom-ui/{p-d777677c.entry.js → p-1a0900cc.entry.js} +1 -1
  9. package/dist/bromcom-ui/p-1faaac85.entry.js +5 -0
  10. package/dist/bromcom-ui/p-2a57c8c7.entry.js +5 -0
  11. package/dist/bromcom-ui/p-2eaf7068.entry.js +5 -0
  12. package/dist/bromcom-ui/p-34a59d30.js +5 -0
  13. package/dist/bromcom-ui/p-3a093f9e.entry.js +5 -0
  14. package/dist/bromcom-ui/{p-3836eb77.entry.js → p-3ccc9177.entry.js} +1 -1
  15. package/dist/bromcom-ui/p-3d8802d9.entry.js +5 -0
  16. package/dist/bromcom-ui/p-3e45d00d.entry.js +5 -0
  17. package/dist/bromcom-ui/{p-23cb7133.js → p-410c74f6.js} +1 -1
  18. package/dist/bromcom-ui/p-4185987d.entry.js +5 -0
  19. package/dist/bromcom-ui/p-51deaab5.entry.js +5 -0
  20. package/dist/bromcom-ui/p-524ab0fc.entry.js +5 -0
  21. package/dist/bromcom-ui/{p-8fdcb5e7.js → p-56a5396d.js} +1 -1
  22. package/dist/bromcom-ui/p-56bb19ef.js +5 -0
  23. package/dist/bromcom-ui/p-58815bb1.entry.js +5 -0
  24. package/dist/bromcom-ui/p-5cd30376.entry.js +5 -0
  25. package/dist/bromcom-ui/p-65fbabc8.entry.js +5 -0
  26. package/dist/bromcom-ui/p-6baf6ea4.entry.js +5 -0
  27. package/dist/bromcom-ui/p-6ea775e8.entry.js +5 -0
  28. package/dist/bromcom-ui/p-701cf04e.entry.js +5 -0
  29. package/dist/bromcom-ui/p-70c794df.js +5 -0
  30. package/dist/bromcom-ui/p-71930900.js +5 -0
  31. package/dist/bromcom-ui/{p-7c9025cb.js → p-79a1c167.js} +1 -1
  32. package/dist/bromcom-ui/p-7eb09daf.entry.js +5 -0
  33. package/dist/bromcom-ui/{p-6a473342.js → p-7eb8c46e.js} +1 -1
  34. package/dist/bromcom-ui/p-80fdd63f.entry.js +5 -0
  35. package/dist/bromcom-ui/p-889553d3.entry.js +5 -0
  36. package/dist/bromcom-ui/p-89a9e8e3.entry.js +5 -0
  37. package/dist/bromcom-ui/p-8cc29a92.entry.js +5 -0
  38. package/dist/bromcom-ui/p-8fa7cdf0.entry.js +5 -0
  39. package/dist/bromcom-ui/p-94da7678.entry.js +5 -0
  40. package/dist/bromcom-ui/p-967df53d.entry.js +5 -0
  41. package/dist/bromcom-ui/p-970a4dd6.entry.js +5 -0
  42. package/dist/bromcom-ui/p-98c9ac37.entry.js +5 -0
  43. package/dist/bromcom-ui/p-a452bb5e.entry.js +5 -0
  44. package/dist/bromcom-ui/p-a5abe2d6.entry.js +5 -0
  45. package/dist/bromcom-ui/p-afa908e9.entry.js +5 -0
  46. package/dist/bromcom-ui/p-b175a1e1.entry.js +5 -0
  47. package/dist/bromcom-ui/p-b5531d54.entry.js +5 -0
  48. package/dist/bromcom-ui/p-ba8d8c03.entry.js +5 -0
  49. package/dist/bromcom-ui/p-bd2d9941.entry.js +5 -0
  50. package/dist/bromcom-ui/p-c3238361.entry.js +5 -0
  51. package/dist/bromcom-ui/{p-2a2466d0.js → p-c718f29a.js} +1 -1
  52. package/dist/bromcom-ui/{p-9d3a9f5b.entry.js → p-c9235a71.entry.js} +1 -1
  53. package/dist/bromcom-ui/p-ceace9c7.entry.js +5 -0
  54. package/dist/bromcom-ui/p-d236a84f.entry.js +5 -0
  55. package/dist/bromcom-ui/p-d39369ff.entry.js +5 -0
  56. package/dist/bromcom-ui/p-e30c5251.entry.js +5 -0
  57. package/dist/bromcom-ui/p-e3d32c37.entry.js +5 -0
  58. package/dist/bromcom-ui/p-e422fc70.entry.js +5 -0
  59. package/dist/bromcom-ui/p-e9295fec.entry.js +5 -0
  60. package/dist/bromcom-ui/p-ef6e4107.entry.js +5 -0
  61. package/dist/bromcom-ui/p-f881a6b8.entry.js +5 -0
  62. package/dist/bromcom-ui/p-ffb57c2c.entry.js +5 -0
  63. package/dist/cjs/bcm-accordion.cjs.entry.js +3 -1
  64. package/dist/cjs/bcm-alert.cjs.entry.js +2 -1
  65. package/dist/cjs/bcm-attendance.cjs.entry.js +3 -1
  66. package/dist/cjs/bcm-avatar_2.cjs.entry.js +5 -4
  67. package/dist/cjs/bcm-breadcrumb.cjs.entry.js +2 -1
  68. package/dist/cjs/bcm-button-group.cjs.entry.js +2 -1
  69. package/dist/cjs/bcm-button_2.cjs.entry.js +3 -2
  70. package/dist/cjs/bcm-card.cjs.entry.js +3 -2
  71. package/dist/cjs/bcm-checkbox-group.cjs.entry.js +2 -1
  72. package/dist/cjs/bcm-checkbox-lite_9.cjs.entry.js +2 -1
  73. package/dist/cjs/bcm-checkbox_2.cjs.entry.js +3 -2
  74. package/dist/cjs/bcm-chip.cjs.entry.js +3 -2
  75. package/dist/cjs/bcm-collapse.cjs.entry.js +2 -1
  76. package/dist/cjs/bcm-color-input.cjs.entry.js +5 -4
  77. package/dist/cjs/bcm-colorful_2.cjs.entry.js +5 -4
  78. package/dist/cjs/bcm-date-picker.cjs.entry.js +2 -1
  79. package/dist/cjs/bcm-datetime-picker.cjs.entry.js +2 -1
  80. package/dist/cjs/bcm-default.cjs.entry.js +3 -1
  81. package/dist/cjs/bcm-drawer.cjs.entry.js +5 -4
  82. package/dist/cjs/bcm-dropdown.cjs.entry.js +3 -2
  83. package/dist/cjs/bcm-expansion-panel.cjs.entry.js +3 -2
  84. package/dist/cjs/bcm-form-2.cjs.entry.js +2 -1
  85. package/dist/cjs/bcm-input-custom.cjs.entry.js +2 -1
  86. package/dist/cjs/bcm-input.cjs.entry.js +5 -4
  87. package/dist/cjs/bcm-item.cjs.entry.js +3 -2
  88. package/dist/cjs/bcm-items.cjs.entry.js +3 -2
  89. package/dist/cjs/bcm-label_2.cjs.entry.js +6 -5
  90. package/dist/cjs/bcm-list.cjs.entry.js +8 -7
  91. package/dist/cjs/bcm-menu.cjs.entry.js +6 -5
  92. package/dist/cjs/bcm-modal.cjs.entry.js +2 -1
  93. package/dist/cjs/bcm-popconfirm-box.cjs.entry.js +3 -2
  94. package/dist/cjs/bcm-popconfirm.cjs.entry.js +2 -1
  95. package/dist/cjs/bcm-popover.cjs.entry.js +5 -4
  96. package/dist/cjs/bcm-progress.cjs.entry.js +3 -2
  97. package/dist/cjs/bcm-radio-group.cjs.entry.js +77 -211
  98. package/dist/cjs/bcm-radio.cjs.entry.js +36 -77
  99. package/dist/cjs/bcm-range.cjs.entry.js +2 -1
  100. package/dist/cjs/bcm-search.cjs.entry.js +4 -3
  101. package/dist/cjs/bcm-skeleton.cjs.entry.js +3 -1
  102. package/dist/cjs/bcm-step.cjs.entry.js +3 -2
  103. package/dist/cjs/bcm-stepper.cjs.entry.js +6 -5
  104. package/dist/cjs/bcm-switch.cjs.entry.js +2 -1
  105. package/dist/cjs/bcm-tab-group.cjs.entry.js +5 -4
  106. package/dist/cjs/bcm-tab-item-header.cjs.entry.js +5 -4
  107. package/dist/cjs/bcm-tab-item.cjs.entry.js +5 -4
  108. package/dist/cjs/bcm-tag.cjs.entry.js +3 -2
  109. package/dist/cjs/bcm-text.cjs.entry.js +2 -1
  110. package/dist/cjs/bcm-textarea.cjs.entry.js +3 -2
  111. package/dist/cjs/bcm-time-picker.cjs.entry.js +2 -1
  112. package/dist/cjs/bromcom-ui.cjs.js +1 -1
  113. package/dist/cjs/color-helper-09aa652d.js +86 -0
  114. package/dist/cjs/{color-helper-c9882bd8.js → colors-7cc2aee2.js} +1 -78
  115. package/dist/cjs/{generate-eef61d08.js → generate-b2779357.js} +14 -1
  116. package/dist/cjs/{input-template-517c3f53.js → input-template-ef0dff49.js} +1 -1
  117. package/dist/cjs/{json-parse-decarator-c0d7e570.js → json-parse-decarator-6daa901d.js} +1 -1
  118. package/dist/cjs/loader.cjs.js +1 -1
  119. package/dist/cjs/{number-helper-652dc22d.js → number-helper-c0a3073d.js} +1 -1
  120. package/dist/cjs/old-bcm-popover-box.cjs.entry.js +3 -2
  121. package/dist/cjs/old-bcm-popover.cjs.entry.js +2 -1
  122. package/dist/cjs/{stepper-states-d00a1313.js → stepper-states-7458308e.js} +1 -1
  123. package/dist/cjs/{tooltip-helper-cd02e32b.js → tooltip-helper-d4c09d59.js} +5 -5
  124. package/dist/cjs/{validators-7eed007b.js → validators-9db90679.js} +1 -1
  125. package/dist/collection/collection-manifest.json +1 -1
  126. package/dist/collection/components/external-source/bcm-toast-helper.js +20 -0
  127. package/dist/collection/components/external-source/test.js/bcm-toast-helper.js +20 -0
  128. package/dist/collection/components/molecules/radio/{group.js → radio-group.js} +163 -246
  129. package/dist/collection/components/molecules/radio/radio.js +42 -132
  130. package/dist/collection/components/organism/states/bcm-list2.states.js +1 -1
  131. package/dist/collection/helper/generate.js +12 -0
  132. package/dist/collection/helper/tooltip-helper.js +1 -1
  133. package/dist/components/bcm-list.js +1 -1
  134. package/dist/components/bcm-radio-group.js +88 -230
  135. package/dist/components/color-helper.js +1 -405
  136. package/dist/components/colors2.js +411 -0
  137. package/dist/components/generate.js +13 -1
  138. package/dist/components/index.d.ts +1 -1
  139. package/dist/components/radio.js +38 -82
  140. package/dist/components/tooltip-helper.js +1 -1
  141. package/dist/esm/bcm-accordion.entry.js +3 -1
  142. package/dist/esm/bcm-alert.entry.js +2 -1
  143. package/dist/esm/bcm-attendance.entry.js +3 -1
  144. package/dist/esm/bcm-avatar_2.entry.js +5 -4
  145. package/dist/esm/bcm-breadcrumb.entry.js +2 -1
  146. package/dist/esm/bcm-button-group.entry.js +2 -1
  147. package/dist/esm/bcm-button_2.entry.js +3 -2
  148. package/dist/esm/bcm-card.entry.js +3 -2
  149. package/dist/esm/bcm-checkbox-group.entry.js +2 -1
  150. package/dist/esm/bcm-checkbox-lite_9.entry.js +2 -1
  151. package/dist/esm/bcm-checkbox_2.entry.js +3 -2
  152. package/dist/esm/bcm-chip.entry.js +3 -2
  153. package/dist/esm/bcm-collapse.entry.js +2 -1
  154. package/dist/esm/bcm-color-input.entry.js +5 -4
  155. package/dist/esm/bcm-colorful_2.entry.js +5 -4
  156. package/dist/esm/bcm-date-picker.entry.js +2 -1
  157. package/dist/esm/bcm-datetime-picker.entry.js +2 -1
  158. package/dist/esm/bcm-default.entry.js +3 -1
  159. package/dist/esm/bcm-drawer.entry.js +5 -4
  160. package/dist/esm/bcm-dropdown.entry.js +3 -2
  161. package/dist/esm/bcm-expansion-panel.entry.js +3 -2
  162. package/dist/esm/bcm-form-2.entry.js +2 -1
  163. package/dist/esm/bcm-input-custom.entry.js +2 -1
  164. package/dist/esm/bcm-input.entry.js +5 -4
  165. package/dist/esm/bcm-item.entry.js +3 -2
  166. package/dist/esm/bcm-items.entry.js +3 -2
  167. package/dist/esm/bcm-label_2.entry.js +6 -5
  168. package/dist/esm/bcm-list.entry.js +8 -7
  169. package/dist/esm/bcm-menu.entry.js +6 -5
  170. package/dist/esm/bcm-modal.entry.js +2 -1
  171. package/dist/esm/bcm-popconfirm-box.entry.js +3 -2
  172. package/dist/esm/bcm-popconfirm.entry.js +2 -1
  173. package/dist/esm/bcm-popover.entry.js +5 -4
  174. package/dist/esm/bcm-progress.entry.js +3 -2
  175. package/dist/esm/bcm-radio-group.entry.js +72 -206
  176. package/dist/esm/bcm-radio.entry.js +35 -76
  177. package/dist/esm/bcm-range.entry.js +2 -1
  178. package/dist/esm/bcm-search.entry.js +4 -3
  179. package/dist/esm/bcm-skeleton.entry.js +3 -1
  180. package/dist/esm/bcm-step.entry.js +3 -2
  181. package/dist/esm/bcm-stepper.entry.js +6 -5
  182. package/dist/esm/bcm-switch.entry.js +2 -1
  183. package/dist/esm/bcm-tab-group.entry.js +5 -4
  184. package/dist/esm/bcm-tab-item-header.entry.js +5 -4
  185. package/dist/esm/bcm-tab-item.entry.js +5 -4
  186. package/dist/esm/bcm-tag.entry.js +3 -2
  187. package/dist/esm/bcm-text.entry.js +2 -1
  188. package/dist/esm/bcm-textarea.entry.js +3 -2
  189. package/dist/esm/bcm-time-picker.entry.js +2 -1
  190. package/dist/esm/bromcom-ui.js +1 -1
  191. package/dist/esm/color-helper-2b6697b6.js +84 -0
  192. package/dist/esm/{color-helper-7e202fd8.js → colors-39b87f63.js} +1 -78
  193. package/dist/esm/{generate-5f6567d0.js → generate-fbf3c64b.js} +14 -1
  194. package/dist/esm/{input-template-e03cafc5.js → input-template-f5b003c0.js} +1 -1
  195. package/dist/esm/{json-parse-decarator-d8836c67.js → json-parse-decarator-f023562b.js} +1 -1
  196. package/dist/esm/loader.js +1 -1
  197. package/dist/esm/{number-helper-b8a2b813.js → number-helper-b69dc985.js} +1 -1
  198. package/dist/esm/old-bcm-popover-box.entry.js +3 -2
  199. package/dist/esm/old-bcm-popover.entry.js +2 -1
  200. package/dist/esm/{stepper-states-16e0b400.js → stepper-states-7087f0cb.js} +1 -1
  201. package/dist/esm/{tooltip-helper-87acf426.js → tooltip-helper-31ca799b.js} +5 -5
  202. package/dist/esm/{validators-07033707.js → validators-d3c37e80.js} +1 -1
  203. package/dist/types/components/external-source/bcm-toast-helper.d.ts +12 -0
  204. package/dist/types/components/external-source/test.js/bcm-toast-helper.d.ts +12 -0
  205. package/dist/types/components/molecules/radio/{group.d.ts → radio-group.d.ts} +19 -27
  206. package/dist/types/components/molecules/radio/radio.d.ts +5 -11
  207. package/dist/types/components.d.ts +19 -33
  208. package/dist/types/helper/generate.d.ts +1 -0
  209. package/package.json +1 -1
  210. package/dist/bromcom-ui/p-0191554f.entry.js +0 -5
  211. package/dist/bromcom-ui/p-040f1cc5.entry.js +0 -5
  212. package/dist/bromcom-ui/p-05a32a81.entry.js +0 -5
  213. package/dist/bromcom-ui/p-13f0d66c.entry.js +0 -5
  214. package/dist/bromcom-ui/p-1d77cf0f.entry.js +0 -5
  215. package/dist/bromcom-ui/p-21bf2bb5.js +0 -5
  216. package/dist/bromcom-ui/p-2552592a.entry.js +0 -5
  217. package/dist/bromcom-ui/p-2b774123.entry.js +0 -5
  218. package/dist/bromcom-ui/p-2cac45d6.entry.js +0 -5
  219. package/dist/bromcom-ui/p-2f0e0ecf.entry.js +0 -5
  220. package/dist/bromcom-ui/p-4789cc74.entry.js +0 -5
  221. package/dist/bromcom-ui/p-4d556100.entry.js +0 -5
  222. package/dist/bromcom-ui/p-4fa21c01.entry.js +0 -5
  223. package/dist/bromcom-ui/p-53beb481.entry.js +0 -5
  224. package/dist/bromcom-ui/p-583d6b09.entry.js +0 -5
  225. package/dist/bromcom-ui/p-5a5cc30f.entry.js +0 -5
  226. package/dist/bromcom-ui/p-5c2bf950.entry.js +0 -5
  227. package/dist/bromcom-ui/p-5fa48e18.entry.js +0 -5
  228. package/dist/bromcom-ui/p-61865ff2.entry.js +0 -5
  229. package/dist/bromcom-ui/p-695f6b01.entry.js +0 -5
  230. package/dist/bromcom-ui/p-7224e112.entry.js +0 -5
  231. package/dist/bromcom-ui/p-74e46eeb.entry.js +0 -5
  232. package/dist/bromcom-ui/p-7d9a38b0.entry.js +0 -5
  233. package/dist/bromcom-ui/p-7f1a79c5.entry.js +0 -5
  234. package/dist/bromcom-ui/p-816c4dc7.entry.js +0 -5
  235. package/dist/bromcom-ui/p-86356b26.entry.js +0 -5
  236. package/dist/bromcom-ui/p-870c903a.entry.js +0 -5
  237. package/dist/bromcom-ui/p-8b60d1db.entry.js +0 -5
  238. package/dist/bromcom-ui/p-8dbe72a1.entry.js +0 -5
  239. package/dist/bromcom-ui/p-91b1efad.entry.js +0 -5
  240. package/dist/bromcom-ui/p-994e484e.entry.js +0 -5
  241. package/dist/bromcom-ui/p-a3ffcb0d.js +0 -5
  242. package/dist/bromcom-ui/p-a427f0ee.entry.js +0 -5
  243. package/dist/bromcom-ui/p-a9ab4073.entry.js +0 -5
  244. package/dist/bromcom-ui/p-b1d6b529.entry.js +0 -5
  245. package/dist/bromcom-ui/p-b39f6cb3.entry.js +0 -5
  246. package/dist/bromcom-ui/p-b69abb6f.entry.js +0 -5
  247. package/dist/bromcom-ui/p-b8ffc86f.entry.js +0 -5
  248. package/dist/bromcom-ui/p-bb95aa62.entry.js +0 -5
  249. package/dist/bromcom-ui/p-bc332b5d.entry.js +0 -5
  250. package/dist/bromcom-ui/p-bc97d311.entry.js +0 -5
  251. package/dist/bromcom-ui/p-c0ac6d54.entry.js +0 -5
  252. package/dist/bromcom-ui/p-c68f44be.entry.js +0 -5
  253. package/dist/bromcom-ui/p-cf04e7a3.entry.js +0 -5
  254. package/dist/bromcom-ui/p-d4ff4de0.entry.js +0 -5
  255. package/dist/bromcom-ui/p-da540844.entry.js +0 -5
  256. package/dist/bromcom-ui/p-e0ec1a36.js +0 -5
  257. package/dist/bromcom-ui/p-ec7f4a12.entry.js +0 -5
  258. package/dist/bromcom-ui/p-f21a7fc0.entry.js +0 -5
  259. package/dist/bromcom-ui/p-fe996e86.entry.js +0 -5
  260. package/dist/bromcom-ui/p-fea33175.entry.js +0 -5
  261. package/dist/collection/components/molecules/radio/group.css +0 -802
  262. package/dist/collection/components/molecules/radio/radio.css +0 -1287
  263. package/dist/collection/components/molecules/radio/types.js +0 -30
  264. package/dist/collection/components/molecules/states/radio-group.states.js +0 -107
  265. package/dist/types/components/molecules/radio/types.d.ts +0 -29
  266. package/dist/types/components/molecules/states/radio-group.states.d.ts +0 -48
@@ -13,89 +13,77 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
13
13
  return c > 3 && r && Object.defineProperty(target, key, r), r;
14
14
  };
15
15
  import { h, Host } from "@stencil/core";
16
+ import { Generate } from "@bcm/helpers";
17
+ import { Bcm } from "@bcm/model";
18
+ import { CaptionTemplate } from "@bcm/template";
19
+ import { delay } from "@bcm/utils";
16
20
  import cs from 'classnames';
17
- import snq from "snq";
18
- import { IsLoad } from "../../../decorators/is-load-decorator";
19
- import { Generate } from "../../../helper/generate";
20
- import Bcm from "../../../models/bcm";
21
- import { CaptionTemplate } from "../../../templates/caption-template";
22
- import { delay, getChildElements } from "../../../utils/utils";
23
- import radioGroupState from "../states/radio-group.states";
21
+ import { IsLoad } from "@bcm/decorator";
24
22
  export class BcmRadioGroup {
25
23
  constructor() {
26
24
  this._id = Generate.UID();
27
- this.value = undefined;
28
- this.direction = Bcm.Direction.horizontal;
29
- this.items = [];
30
- this.size = Bcm.Size.medium;
31
- this.name = undefined;
32
25
  this.label = undefined;
26
+ this.name = undefined;
27
+ this.value = null;
28
+ this.defaultValue = undefined;
29
+ this.size = Bcm.Size.medium;
33
30
  this.disabled = false;
34
31
  this.hidden = false;
35
32
  this.required = false;
36
33
  this.gap = undefined;
37
- this.defaultValue = undefined;
38
- this.optionType = 'default';
39
- this.buttonStyle = 'solid';
34
+ this.direction = Bcm.Direction.horizontal;
40
35
  this.fullWidth = false;
36
+ this.items = [];
41
37
  this.caption = undefined;
42
38
  this.noCaption = false;
43
39
  this.captionError = undefined;
44
40
  this.captionType = Bcm.Status.default;
45
41
  this.captionCache = undefined;
46
42
  this.captionTypeCache = undefined;
47
- this.radioOptions = [];
48
- this.usingSlots = true;
49
- this.tick = {};
50
43
  }
51
- disconnectedCallback() {
52
- radioGroupState.removeState(this._id);
44
+ get radios() {
45
+ return Array.from(this.el.querySelectorAll("bcm-radio"));
53
46
  }
54
- componentDidLoad() {
55
- this.initState();
47
+ get Items() {
48
+ return this.items;
56
49
  }
57
- componentShouldUpdate(newVal, oldVal, propName) {
58
- if ((propName == 'defaultValue' || propName == 'tick') && newVal !== oldVal) {
59
- const isHaveChild = snq(() => radioGroupState.getProperty(this._id).childs.length > 0, false);
60
- if (isHaveChild) {
61
- this.getValue().then(values => (this.value = values));
62
- }
63
- }
50
+ connectedCallback() {
51
+ this.captionCache = this.caption;
52
+ this.captionTypeCache = this.captionType;
64
53
  }
65
- async initState() {
66
- const { fullWidth, optionType, buttonStyle, size, disabled, noCaption, defaultValue, label, required, captionType, hidden, direction, gap, items, name } = this;
67
- const defaultCheckedItems = defaultValue && defaultValue;
68
- const childElements = items.length > 0 ? snq(() => (typeof this.items == 'string' ? JSON.parse(this.items) : this.items)) : await this.getRadioItems();
69
- await radioGroupState.setValue({
70
- id: this._id,
71
- el: this.el,
72
- name,
73
- fullWidth,
74
- optionType,
75
- buttonStyle,
76
- size,
77
- disabled,
78
- defaultCheckedItems,
79
- label,
80
- noCaption,
81
- required,
82
- captionType,
83
- hidden,
84
- gap,
85
- direction,
86
- childs: childElements,
54
+ updateValue() {
55
+ var _a, _b, _c;
56
+ this.value = (_c = (_b = (_a = this.radios) === null || _a === void 0 ? void 0 : _a.find(radio => radio.checked)) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : null;
57
+ }
58
+ componentWillLoad() {
59
+ var _a;
60
+ (_a = this.radios) === null || _a === void 0 ? void 0 : _a.forEach(radio => {
61
+ radio.disabled = radio.disabled || this.disabled;
62
+ radio.size = this.size;
63
+ if (this.defaultValue) {
64
+ radio.checked = radio.value == this.defaultValue;
65
+ }
87
66
  });
88
- this.getValue().then(values => (this.value = values));
67
+ this.updateValue();
89
68
  }
90
- async markForCheck() {
91
- await delay(10);
92
- this.tick = Generate.UID();
69
+ handleChange(e) {
70
+ var _a, _b;
71
+ e.stopPropagation();
72
+ e.preventDefault();
73
+ const checked = (_a = e.target.checked) !== null && _a !== void 0 ? _a : false;
74
+ (_b = this.radios) === null || _b === void 0 ? void 0 : _b.forEach(radio => {
75
+ radio.checked = radio.id == e.target.id ? !checked : false;
76
+ });
77
+ this.updateValue();
78
+ this.change.emit(this.value);
93
79
  }
80
+ ;
94
81
  async setClear() {
95
- radioGroupState.setClear(this._id);
96
- this.markForCheck();
97
- await delay(10);
98
- return Promise.resolve();
82
+ var _a;
83
+ this.value = null;
84
+ (_a = this.radios) === null || _a === void 0 ? void 0 : _a.forEach(radio => {
85
+ radio.checked = false;
86
+ });
99
87
  }
100
88
  async resetCaption() {
101
89
  await delay(10);
@@ -105,71 +93,35 @@ export class BcmRadioGroup {
105
93
  await delay(10);
106
94
  return Promise.resolve();
107
95
  }
108
- async set(data) {
109
- await this.check(data);
96
+ async check(itemId, checked = true) {
97
+ var _a;
98
+ (_a = this.radios) === null || _a === void 0 ? void 0 : _a.forEach(radio => {
99
+ radio.checked = radio.id == itemId || radio.value == itemId ? checked : false;
100
+ });
101
+ this.updateValue();
102
+ this.change.emit(this.value);
110
103
  }
111
104
  async get() {
112
- return await this.getValue();
105
+ return this.value;
113
106
  }
114
- async check(item, checked = true) {
115
- radioGroupState.setCheckedItem(this._id, item, checked);
116
- this.defaultValue = item;
117
- await this.markForCheck();
118
- this.change.emit(this.value);
107
+ async set(data) {
108
+ await this.check(data);
119
109
  }
120
110
  async getValue() {
121
- return radioGroupState.getValue(this._id);
122
- }
123
- handleItemsChange() {
124
- this.initState();
125
- }
126
- getRadioItems() {
127
- return getChildElements(this.el, 'bcm-radio');
128
- }
129
- async changeRadio(event) {
130
- radioGroupState.state.onChange = { id: this._id, childId: event };
131
- await this.markForCheck();
132
- this.change.emit(this.value);
133
- }
134
- getItems() {
135
- return radioGroupState.getProperty(this._id);
136
- }
137
- connectedCallback() {
138
- this.captionCache = this.caption;
139
- this.captionTypeCache = this.captionType;
111
+ return this.value;
140
112
  }
141
113
  render() {
142
- const { label, required, hidden, childs, gap, direction, fullWidth, optionType } = this.getItems();
143
- const bcmRadioGroupHostClasses = cs('bcm-radio-group', {
144
- hidden,
145
- 'error': this.captionType == 'error',
146
- 'full-width': fullWidth,
147
- });
148
- const bcmRadioGroupContainerClasses = cs('bcm-radio-group__container', optionType, {
149
- [direction]: optionType === 'default',
150
- 'full-width': fullWidth,
151
- });
152
- return (h(Host, { class: bcmRadioGroupHostClasses }, label && h("bcm-label", { type: this.captionType, value: label, required: required }), h("div", { class: bcmRadioGroupContainerClasses, style: gap && { gap: gap } }, childs &&
153
- childs.map(radio => (h("bcm-radio", { id: radio.id, onClick: e => {
154
- !radio.disabled && this.changeRadio(radio.id), e.preventDefault();
155
- }, value: radio.value, disabled: radio.disabled, checked: radio.checked, size: radio.size, color: radio.color, required: radio.required, hidden: radio.hidden, "no-margin": true }, radio.slot || radio.label)))), h(CaptionTemplate, { noCaption: this.noCaption, captionType: this.captionType, captionError: this.captionError, caption: this.caption }), h("span", { hidden: true }, h("slot", null))));
114
+ var _a, _b;
115
+ const { direction, fullWidth, gap, label, size, required, disabled, caption, captionError, captionType, noCaption } = this;
116
+ return (h(Host, { role: "radio-group", class: "tw-mb-2 tw-flex tw-flex-col" }, label && h("bcm-label", { type: captionType, value: label, required: required }), h("div", { class: cs("tw-flex tw-flex-wrap", direction == Bcm.Direction.horizontal ? "tw-flex-row" : "tw-flex-col", fullWidth && "tw-w-full"), style: { "gap": gap } }, h("slot", null), ((_a = this.Items) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
117
+ ((_b = this.Items) === null || _b === void 0 ? void 0 : _b.map(item => (h("bcm-radio", { id: item.id, value: item.value, disabled: disabled || item.disabled, checked: item.checked, color: item.color, size: size }, item.label))))), h(CaptionTemplate, { noCaption: noCaption, captionType: captionType, captionError: captionError, caption: caption })));
156
118
  }
157
119
  static get is() { return "bcm-radio-group"; }
158
- static get originalStyleUrls() {
159
- return {
160
- "$": ["group.scss"]
161
- };
162
- }
163
- static get styleUrls() {
164
- return {
165
- "$": ["group.css"]
166
- };
167
- }
168
120
  static get properties() {
169
121
  return {
170
122
  "_id": {
171
123
  "type": "string",
172
- "mutable": true,
124
+ "mutable": false,
173
125
  "complexType": {
174
126
  "original": "string",
175
127
  "resolved": "string",
@@ -185,12 +137,12 @@ export class BcmRadioGroup {
185
137
  "reflect": true,
186
138
  "defaultValue": "Generate.UID()"
187
139
  },
188
- "value": {
189
- "type": "any",
190
- "mutable": true,
140
+ "label": {
141
+ "type": "string",
142
+ "mutable": false,
191
143
  "complexType": {
192
- "original": "string | number",
193
- "resolved": "number | string",
144
+ "original": "string",
145
+ "resolved": "string",
194
146
  "references": {}
195
147
  },
196
148
  "required": false,
@@ -199,46 +151,16 @@ export class BcmRadioGroup {
199
151
  "tags": [],
200
152
  "text": ""
201
153
  },
202
- "attribute": "value",
154
+ "attribute": "label",
203
155
  "reflect": false
204
156
  },
205
- "direction": {
206
- "type": "string",
207
- "mutable": true,
208
- "complexType": {
209
- "original": "DirectionTypes",
210
- "resolved": "\"horizontal\" | \"vertical\"",
211
- "references": {
212
- "DirectionTypes": {
213
- "location": "import",
214
- "path": "../../../models/bcm-types"
215
- }
216
- }
217
- },
218
- "required": false,
219
- "optional": false,
220
- "docs": {
221
- "tags": [],
222
- "text": ""
223
- },
224
- "attribute": "direction",
225
- "reflect": false,
226
- "defaultValue": "Bcm.Direction.horizontal"
227
- },
228
- "items": {
157
+ "name": {
229
158
  "type": "string",
230
- "mutable": true,
159
+ "mutable": false,
231
160
  "complexType": {
232
- "original": "Array<object> | OptionType[] | string",
233
- "resolved": "OptionType[] | object[] | string",
234
- "references": {
235
- "Array": {
236
- "location": "global"
237
- },
238
- "OptionType": {
239
- "location": "local"
240
- }
241
- }
161
+ "original": "string",
162
+ "resolved": "string",
163
+ "references": {}
242
164
  },
243
165
  "required": false,
244
166
  "optional": false,
@@ -246,22 +168,16 @@ export class BcmRadioGroup {
246
168
  "tags": [],
247
169
  "text": ""
248
170
  },
249
- "attribute": "items",
250
- "reflect": false,
251
- "defaultValue": "[]"
171
+ "attribute": "name",
172
+ "reflect": false
252
173
  },
253
- "size": {
254
- "type": "string",
174
+ "value": {
175
+ "type": "any",
255
176
  "mutable": true,
256
177
  "complexType": {
257
- "original": "SizeTypes",
258
- "resolved": "\"large\" | \"medium\" | \"small\"",
259
- "references": {
260
- "SizeTypes": {
261
- "location": "import",
262
- "path": "../../../models/bcm-types"
263
- }
264
- }
178
+ "original": "string | number",
179
+ "resolved": "number | string",
180
+ "references": {}
265
181
  },
266
182
  "required": false,
267
183
  "optional": false,
@@ -269,16 +185,16 @@ export class BcmRadioGroup {
269
185
  "tags": [],
270
186
  "text": ""
271
187
  },
272
- "attribute": "size",
188
+ "attribute": "value",
273
189
  "reflect": false,
274
- "defaultValue": "Bcm.Size.medium"
190
+ "defaultValue": "null"
275
191
  },
276
- "name": {
277
- "type": "string",
278
- "mutable": true,
192
+ "defaultValue": {
193
+ "type": "any",
194
+ "mutable": false,
279
195
  "complexType": {
280
- "original": "string",
281
- "resolved": "string",
196
+ "original": "string | number",
197
+ "resolved": "number | string",
282
198
  "references": {}
283
199
  },
284
200
  "required": false,
@@ -287,16 +203,21 @@ export class BcmRadioGroup {
287
203
  "tags": [],
288
204
  "text": ""
289
205
  },
290
- "attribute": "name",
206
+ "attribute": "default-value",
291
207
  "reflect": false
292
208
  },
293
- "label": {
209
+ "size": {
294
210
  "type": "string",
295
- "mutable": true,
211
+ "mutable": false,
296
212
  "complexType": {
297
- "original": "string",
298
- "resolved": "string",
299
- "references": {}
213
+ "original": "SizeTypes",
214
+ "resolved": "\"large\" | \"medium\" | \"small\"",
215
+ "references": {
216
+ "SizeTypes": {
217
+ "location": "import",
218
+ "path": "@bcm/model"
219
+ }
220
+ }
300
221
  },
301
222
  "required": false,
302
223
  "optional": false,
@@ -304,12 +225,13 @@ export class BcmRadioGroup {
304
225
  "tags": [],
305
226
  "text": ""
306
227
  },
307
- "attribute": "label",
308
- "reflect": false
228
+ "attribute": "size",
229
+ "reflect": false,
230
+ "defaultValue": "Bcm.Size.medium"
309
231
  },
310
232
  "disabled": {
311
233
  "type": "boolean",
312
- "mutable": true,
234
+ "mutable": false,
313
235
  "complexType": {
314
236
  "original": "boolean",
315
237
  "resolved": "boolean",
@@ -327,7 +249,7 @@ export class BcmRadioGroup {
327
249
  },
328
250
  "hidden": {
329
251
  "type": "boolean",
330
- "mutable": true,
252
+ "mutable": false,
331
253
  "complexType": {
332
254
  "original": "boolean",
333
255
  "resolved": "boolean",
@@ -345,7 +267,7 @@ export class BcmRadioGroup {
345
267
  },
346
268
  "required": {
347
269
  "type": "boolean",
348
- "mutable": true,
270
+ "mutable": false,
349
271
  "complexType": {
350
272
  "original": "boolean",
351
273
  "resolved": "boolean",
@@ -363,7 +285,7 @@ export class BcmRadioGroup {
363
285
  },
364
286
  "gap": {
365
287
  "type": "string",
366
- "mutable": true,
288
+ "mutable": false,
367
289
  "complexType": {
368
290
  "original": "string",
369
291
  "resolved": "string",
@@ -378,13 +300,18 @@ export class BcmRadioGroup {
378
300
  "attribute": "gap",
379
301
  "reflect": false
380
302
  },
381
- "defaultValue": {
303
+ "direction": {
382
304
  "type": "string",
383
- "mutable": true,
305
+ "mutable": false,
384
306
  "complexType": {
385
- "original": "string",
386
- "resolved": "string",
387
- "references": {}
307
+ "original": "DirectionTypes",
308
+ "resolved": "\"horizontal\" | \"vertical\"",
309
+ "references": {
310
+ "DirectionTypes": {
311
+ "location": "import",
312
+ "path": "@bcm/model"
313
+ }
314
+ }
388
315
  },
389
316
  "required": false,
390
317
  "optional": false,
@@ -392,15 +319,16 @@ export class BcmRadioGroup {
392
319
  "tags": [],
393
320
  "text": ""
394
321
  },
395
- "attribute": "default-value",
396
- "reflect": false
322
+ "attribute": "direction",
323
+ "reflect": false,
324
+ "defaultValue": "Bcm.Direction.horizontal"
397
325
  },
398
- "optionType": {
399
- "type": "string",
400
- "mutable": true,
326
+ "fullWidth": {
327
+ "type": "boolean",
328
+ "mutable": false,
401
329
  "complexType": {
402
- "original": "'default' | 'button'",
403
- "resolved": "\"button\" | \"default\"",
330
+ "original": "boolean",
331
+ "resolved": "boolean",
404
332
  "references": {}
405
333
  },
406
334
  "required": false,
@@ -409,17 +337,24 @@ export class BcmRadioGroup {
409
337
  "tags": [],
410
338
  "text": ""
411
339
  },
412
- "attribute": "option-type",
340
+ "attribute": "full-width",
413
341
  "reflect": false,
414
- "defaultValue": "'default'"
342
+ "defaultValue": "false"
415
343
  },
416
- "buttonStyle": {
344
+ "items": {
417
345
  "type": "string",
418
- "mutable": true,
346
+ "mutable": false,
419
347
  "complexType": {
420
- "original": "'solid' | 'outline'",
421
- "resolved": "\"outline\" | \"solid\"",
422
- "references": {}
348
+ "original": "Array<object> | OptionType[] | string",
349
+ "resolved": "OptionType[] | object[] | string",
350
+ "references": {
351
+ "Array": {
352
+ "location": "global"
353
+ },
354
+ "OptionType": {
355
+ "location": "local"
356
+ }
357
+ }
423
358
  },
424
359
  "required": false,
425
360
  "optional": false,
@@ -427,31 +362,13 @@ export class BcmRadioGroup {
427
362
  "tags": [],
428
363
  "text": ""
429
364
  },
430
- "attribute": "button-style",
365
+ "attribute": "items",
431
366
  "reflect": false,
432
- "defaultValue": "'solid'"
433
- },
434
- "fullWidth": {
435
- "type": "any",
436
- "mutable": true,
437
- "complexType": {
438
- "original": "boolean | 'flex'",
439
- "resolved": "\"flex\" | boolean",
440
- "references": {}
441
- },
442
- "required": false,
443
- "optional": false,
444
- "docs": {
445
- "tags": [],
446
- "text": ""
447
- },
448
- "attribute": "full-width",
449
- "reflect": true,
450
- "defaultValue": "false"
367
+ "defaultValue": "[]"
451
368
  },
452
369
  "caption": {
453
370
  "type": "string",
454
- "mutable": true,
371
+ "mutable": false,
455
372
  "complexType": {
456
373
  "original": "string",
457
374
  "resolved": "string",
@@ -468,7 +385,7 @@ export class BcmRadioGroup {
468
385
  },
469
386
  "noCaption": {
470
387
  "type": "boolean",
471
- "mutable": true,
388
+ "mutable": false,
472
389
  "complexType": {
473
390
  "original": "boolean",
474
391
  "resolved": "boolean",
@@ -486,7 +403,7 @@ export class BcmRadioGroup {
486
403
  },
487
404
  "captionError": {
488
405
  "type": "string",
489
- "mutable": true,
406
+ "mutable": false,
490
407
  "complexType": {
491
408
  "original": "string",
492
409
  "resolved": "string",
@@ -503,14 +420,14 @@ export class BcmRadioGroup {
503
420
  },
504
421
  "captionType": {
505
422
  "type": "string",
506
- "mutable": true,
423
+ "mutable": false,
507
424
  "complexType": {
508
425
  "original": "StatusTypes",
509
426
  "resolved": "\"default\" | \"error\" | \"info\" | \"success\" | \"warning\"",
510
427
  "references": {
511
428
  "StatusTypes": {
512
429
  "location": "import",
513
- "path": "../../../models/bcm-types"
430
+ "path": "@bcm/model"
514
431
  }
515
432
  }
516
433
  },
@@ -529,10 +446,7 @@ export class BcmRadioGroup {
529
446
  static get states() {
530
447
  return {
531
448
  "captionCache": {},
532
- "captionTypeCache": {},
533
- "radioOptions": {},
534
- "usingSlots": {},
535
- "tick": {}
449
+ "captionTypeCache": {}
536
450
  };
537
451
  }
538
452
  static get events() {
@@ -587,12 +501,15 @@ export class BcmRadioGroup {
587
501
  "tags": []
588
502
  }
589
503
  },
590
- "set": {
504
+ "check": {
591
505
  "complexType": {
592
- "signature": "(data: any) => Promise<void>",
506
+ "signature": "(itemId: any, checked?: boolean) => Promise<void>",
593
507
  "parameters": [{
594
508
  "tags": [],
595
509
  "text": ""
510
+ }, {
511
+ "tags": [],
512
+ "text": ""
596
513
  }],
597
514
  "references": {
598
515
  "Promise": {
@@ -608,29 +525,26 @@ export class BcmRadioGroup {
608
525
  },
609
526
  "get": {
610
527
  "complexType": {
611
- "signature": "() => Promise<string>",
528
+ "signature": "() => Promise<string | number>",
612
529
  "parameters": [],
613
530
  "references": {
614
531
  "Promise": {
615
532
  "location": "global"
616
533
  }
617
534
  },
618
- "return": "Promise<string>"
535
+ "return": "Promise<string | number>"
619
536
  },
620
537
  "docs": {
621
538
  "text": "",
622
539
  "tags": []
623
540
  }
624
541
  },
625
- "check": {
542
+ "set": {
626
543
  "complexType": {
627
- "signature": "(item: any, checked?: boolean) => Promise<void>",
544
+ "signature": "(data: any) => Promise<void>",
628
545
  "parameters": [{
629
546
  "tags": [],
630
547
  "text": ""
631
- }, {
632
- "tags": [],
633
- "text": ""
634
548
  }],
635
549
  "references": {
636
550
  "Promise": {
@@ -646,14 +560,14 @@ export class BcmRadioGroup {
646
560
  },
647
561
  "getValue": {
648
562
  "complexType": {
649
- "signature": "() => Promise<string>",
563
+ "signature": "() => Promise<string | number>",
650
564
  "parameters": [],
651
565
  "references": {
652
566
  "Promise": {
653
567
  "location": "global"
654
568
  }
655
569
  },
656
- "return": "Promise<string>"
570
+ "return": "Promise<string | number>"
657
571
  },
658
572
  "docs": {
659
573
  "text": "",
@@ -663,10 +577,13 @@ export class BcmRadioGroup {
663
577
  };
664
578
  }
665
579
  static get elementRef() { return "el"; }
666
- static get watchers() {
580
+ static get listeners() {
667
581
  return [{
668
- "propName": "items",
669
- "methodName": "handleItemsChange"
582
+ "name": "bcm-radio-change",
583
+ "method": "handleChange",
584
+ "target": undefined,
585
+ "capture": false,
586
+ "passive": false
670
587
  }];
671
588
  }
672
589
  }