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

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 (270) 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-00269ca7.entry.js +5 -0
  4. package/dist/bromcom-ui/p-0041bd28.entry.js +5 -0
  5. package/dist/bromcom-ui/p-007bec47.entry.js +5 -0
  6. package/dist/bromcom-ui/p-036f3880.entry.js +5 -0
  7. package/dist/bromcom-ui/p-0626d065.entry.js +5 -0
  8. package/dist/bromcom-ui/p-13082089.entry.js +5 -0
  9. package/dist/bromcom-ui/p-13337304.entry.js +5 -0
  10. package/dist/bromcom-ui/{p-e0ec1a36.js → p-19cba40f.js} +1 -1
  11. package/dist/bromcom-ui/p-1e328bbb.entry.js +5 -0
  12. package/dist/bromcom-ui/{p-3836eb77.entry.js → p-30070e50.entry.js} +1 -1
  13. package/dist/bromcom-ui/p-3407de8c.entry.js +5 -0
  14. package/dist/bromcom-ui/p-35e357fb.entry.js +5 -0
  15. package/dist/bromcom-ui/p-400f7245.entry.js +5 -0
  16. package/dist/bromcom-ui/p-445a227f.entry.js +5 -0
  17. package/dist/bromcom-ui/{p-7c9025cb.js → p-4bbba8b4.js} +1 -1
  18. package/dist/bromcom-ui/p-56bb19ef.js +5 -0
  19. package/dist/bromcom-ui/p-57185ca0.entry.js +5 -0
  20. package/dist/bromcom-ui/p-5948de7f.entry.js +5 -0
  21. package/dist/bromcom-ui/p-5a26b9b8.entry.js +5 -0
  22. package/dist/bromcom-ui/p-5bad0d7b.entry.js +5 -0
  23. package/dist/bromcom-ui/p-6530b216.entry.js +5 -0
  24. package/dist/bromcom-ui/p-67659c20.entry.js +5 -0
  25. package/dist/bromcom-ui/p-6bd60d81.entry.js +5 -0
  26. package/dist/bromcom-ui/p-6bfece08.entry.js +5 -0
  27. package/dist/bromcom-ui/p-6c288e79.entry.js +5 -0
  28. package/dist/bromcom-ui/p-6c7b218c.entry.js +5 -0
  29. package/dist/bromcom-ui/p-7124553b.js +5 -0
  30. package/dist/bromcom-ui/p-71930900.js +5 -0
  31. package/dist/bromcom-ui/{p-23cb7133.js → p-7b153da4.js} +1 -1
  32. package/dist/bromcom-ui/p-82031406.entry.js +5 -0
  33. package/dist/bromcom-ui/p-843c229b.entry.js +5 -0
  34. package/dist/bromcom-ui/p-8c9d67ad.entry.js +5 -0
  35. package/dist/bromcom-ui/p-8ced5b81.entry.js +5 -0
  36. package/dist/bromcom-ui/p-935fdf64.entry.js +5 -0
  37. package/dist/bromcom-ui/p-9490e993.entry.js +5 -0
  38. package/dist/bromcom-ui/{p-8fdcb5e7.js → p-a366b934.js} +1 -1
  39. package/dist/bromcom-ui/p-a3a346fc.entry.js +5 -0
  40. package/dist/bromcom-ui/{p-2a2466d0.js → p-a82bcbd4.js} +1 -1
  41. package/dist/bromcom-ui/p-aa59b8d1.entry.js +5 -0
  42. package/dist/bromcom-ui/p-b0d84958.entry.js +5 -0
  43. package/dist/bromcom-ui/p-b3003060.entry.js +5 -0
  44. package/dist/bromcom-ui/p-c012565a.entry.js +5 -0
  45. package/dist/bromcom-ui/p-c092fafd.entry.js +11 -0
  46. package/dist/bromcom-ui/{p-9d3a9f5b.entry.js → p-c9235a71.entry.js} +1 -1
  47. package/dist/bromcom-ui/p-cf24655f.entry.js +5 -0
  48. package/dist/bromcom-ui/p-d9bd56ef.entry.js +5 -0
  49. package/dist/bromcom-ui/p-dc3d9f76.entry.js +5 -0
  50. package/dist/bromcom-ui/p-e38344ed.entry.js +5 -0
  51. package/dist/bromcom-ui/p-e842eb54.entry.js +5 -0
  52. package/dist/bromcom-ui/p-ed04ae18.entry.js +5 -0
  53. package/dist/bromcom-ui/p-efd4bae1.entry.js +5 -0
  54. package/dist/bromcom-ui/p-f0877724.entry.js +5 -0
  55. package/dist/bromcom-ui/p-f4c08ca4.entry.js +5 -0
  56. package/dist/bromcom-ui/p-f4d15784.entry.js +5 -0
  57. package/dist/bromcom-ui/{p-6a473342.js → p-f4d6590d.js} +1 -1
  58. package/dist/bromcom-ui/p-ff78d3f1.entry.js +5 -0
  59. package/dist/cjs/bcm-accordion.cjs.entry.js +3 -1
  60. package/dist/cjs/bcm-alert.cjs.entry.js +2 -1
  61. package/dist/cjs/bcm-attendance.cjs.entry.js +3 -1
  62. package/dist/cjs/bcm-avatar_2.cjs.entry.js +5 -4
  63. package/dist/cjs/bcm-breadcrumb.cjs.entry.js +2 -1
  64. package/dist/cjs/bcm-button-group.cjs.entry.js +2 -1
  65. package/dist/cjs/{bcm-colorful_2.cjs.entry.js → bcm-button_10.cjs.entry.js} +1533 -18
  66. package/dist/cjs/bcm-card.cjs.entry.js +3 -2
  67. package/dist/cjs/bcm-checkbox-group.cjs.entry.js +18 -17
  68. package/dist/cjs/bcm-checkbox-lite_9.cjs.entry.js +2 -1
  69. package/dist/cjs/bcm-checkbox_2.cjs.entry.js +3 -2
  70. package/dist/cjs/bcm-chip.cjs.entry.js +3 -2
  71. package/dist/cjs/bcm-collapse.cjs.entry.js +2 -1
  72. package/dist/cjs/bcm-color-input.cjs.entry.js +5 -4
  73. package/dist/cjs/bcm-date-picker.cjs.entry.js +2 -1
  74. package/dist/cjs/bcm-datetime-picker.cjs.entry.js +2 -1
  75. package/dist/cjs/bcm-default.cjs.entry.js +3 -1
  76. package/dist/cjs/bcm-drawer.cjs.entry.js +5 -4
  77. package/dist/cjs/bcm-dropdown.cjs.entry.js +3 -2
  78. package/dist/cjs/bcm-expansion-panel.cjs.entry.js +3 -2
  79. package/dist/cjs/bcm-form-2.cjs.entry.js +2 -1
  80. package/dist/cjs/bcm-input-custom.cjs.entry.js +2 -1
  81. package/dist/cjs/bcm-item.cjs.entry.js +3 -2
  82. package/dist/cjs/bcm-items.cjs.entry.js +3 -2
  83. package/dist/cjs/bcm-list.cjs.entry.js +8 -7
  84. package/dist/cjs/bcm-menu.cjs.entry.js +6 -5
  85. package/dist/cjs/bcm-modal.cjs.entry.js +2 -1
  86. package/dist/cjs/bcm-popconfirm-box.cjs.entry.js +3 -2
  87. package/dist/cjs/bcm-popconfirm.cjs.entry.js +2 -1
  88. package/dist/cjs/bcm-popover.cjs.entry.js +5 -4
  89. package/dist/cjs/bcm-progress.cjs.entry.js +3 -2
  90. package/dist/cjs/bcm-range.cjs.entry.js +2 -1
  91. package/dist/cjs/bcm-search.cjs.entry.js +4 -3
  92. package/dist/cjs/bcm-skeleton.cjs.entry.js +3 -1
  93. package/dist/cjs/bcm-step.cjs.entry.js +3 -2
  94. package/dist/cjs/bcm-stepper.cjs.entry.js +6 -5
  95. package/dist/cjs/bcm-switch.cjs.entry.js +2 -1
  96. package/dist/cjs/bcm-tab-group.cjs.entry.js +5 -4
  97. package/dist/cjs/bcm-tab-item-header.cjs.entry.js +5 -4
  98. package/dist/cjs/bcm-tab-item.cjs.entry.js +5 -4
  99. package/dist/cjs/bcm-tag.cjs.entry.js +3 -2
  100. package/dist/cjs/bcm-text.cjs.entry.js +2 -1
  101. package/dist/cjs/bcm-textarea.cjs.entry.js +3 -2
  102. package/dist/cjs/bcm-time-picker.cjs.entry.js +2 -1
  103. package/dist/cjs/bcm-toast.cjs.entry.js +115 -0
  104. package/dist/cjs/bromcom-ui.cjs.js +1 -1
  105. package/dist/cjs/color-helper-09aa652d.js +86 -0
  106. package/dist/cjs/{color-helper-c9882bd8.js → colors-7cc2aee2.js} +1 -78
  107. package/dist/cjs/{generate-eef61d08.js → generate-e2397ffa.js} +14 -1
  108. package/dist/cjs/{input-template-517c3f53.js → input-template-2bdd0688.js} +1 -1
  109. package/dist/cjs/{json-parse-decarator-c0d7e570.js → json-parse-decarator-fe468734.js} +1 -1
  110. package/dist/cjs/loader.cjs.js +1 -1
  111. package/dist/cjs/{number-helper-652dc22d.js → number-helper-aac9b592.js} +1 -1
  112. package/dist/cjs/old-bcm-popover-box.cjs.entry.js +3 -2
  113. package/dist/cjs/old-bcm-popover.cjs.entry.js +2 -1
  114. package/dist/cjs/{stepper-states-d00a1313.js → stepper-states-5aa9bb64.js} +1 -1
  115. package/dist/cjs/{tooltip-helper-cd02e32b.js → tooltip-helper-18b3deae.js} +5 -5
  116. package/dist/cjs/{validators-7eed007b.js → validators-5c4ee18b.js} +1 -1
  117. package/dist/collection/collection-manifest.json +1 -1
  118. package/dist/collection/components/external-source/bcm-toast-helper.js +20 -0
  119. package/dist/collection/components/external-source/test.js/bcm-toast-helper.js +20 -0
  120. package/dist/collection/components/molecules/radio/{group.js → radio-group.js} +185 -247
  121. package/dist/collection/components/molecules/radio/radio.js +42 -132
  122. package/dist/collection/components/organism/states/bcm-list2.states.js +1 -1
  123. package/dist/collection/helper/generate.js +12 -0
  124. package/dist/collection/helper/tooltip-helper.js +1 -1
  125. package/dist/components/bcm-list.js +1 -1
  126. package/dist/components/bcm-radio-group.js +103 -228
  127. package/dist/components/color-helper.js +1 -405
  128. package/dist/components/colors2.js +411 -0
  129. package/dist/components/generate.js +13 -1
  130. package/dist/components/index.d.ts +1 -1
  131. package/dist/components/radio.js +38 -82
  132. package/dist/components/tooltip-helper.js +1 -1
  133. package/dist/esm/bcm-accordion.entry.js +3 -1
  134. package/dist/esm/bcm-alert.entry.js +2 -1
  135. package/dist/esm/bcm-attendance.entry.js +3 -1
  136. package/dist/esm/bcm-avatar_2.entry.js +5 -4
  137. package/dist/esm/bcm-breadcrumb.entry.js +2 -1
  138. package/dist/esm/bcm-button-group.entry.js +2 -1
  139. package/dist/esm/{bcm-colorful_2.entry.js → bcm-button_10.entry.js} +1521 -14
  140. package/dist/esm/bcm-card.entry.js +3 -2
  141. package/dist/esm/bcm-checkbox-group.entry.js +8 -7
  142. package/dist/esm/bcm-checkbox-lite_9.entry.js +2 -1
  143. package/dist/esm/bcm-checkbox_2.entry.js +3 -2
  144. package/dist/esm/bcm-chip.entry.js +3 -2
  145. package/dist/esm/bcm-collapse.entry.js +2 -1
  146. package/dist/esm/bcm-color-input.entry.js +5 -4
  147. package/dist/esm/bcm-date-picker.entry.js +2 -1
  148. package/dist/esm/bcm-datetime-picker.entry.js +2 -1
  149. package/dist/esm/bcm-default.entry.js +3 -1
  150. package/dist/esm/bcm-drawer.entry.js +5 -4
  151. package/dist/esm/bcm-dropdown.entry.js +3 -2
  152. package/dist/esm/bcm-expansion-panel.entry.js +3 -2
  153. package/dist/esm/bcm-form-2.entry.js +2 -1
  154. package/dist/esm/bcm-input-custom.entry.js +2 -1
  155. package/dist/esm/bcm-item.entry.js +3 -2
  156. package/dist/esm/bcm-items.entry.js +3 -2
  157. package/dist/esm/bcm-list.entry.js +8 -7
  158. package/dist/esm/bcm-menu.entry.js +6 -5
  159. package/dist/esm/bcm-modal.entry.js +2 -1
  160. package/dist/esm/bcm-popconfirm-box.entry.js +3 -2
  161. package/dist/esm/bcm-popconfirm.entry.js +2 -1
  162. package/dist/esm/bcm-popover.entry.js +5 -4
  163. package/dist/esm/bcm-progress.entry.js +3 -2
  164. package/dist/esm/bcm-range.entry.js +2 -1
  165. package/dist/esm/bcm-search.entry.js +4 -3
  166. package/dist/esm/bcm-skeleton.entry.js +3 -1
  167. package/dist/esm/bcm-step.entry.js +3 -2
  168. package/dist/esm/bcm-stepper.entry.js +6 -5
  169. package/dist/esm/bcm-switch.entry.js +2 -1
  170. package/dist/esm/bcm-tab-group.entry.js +5 -4
  171. package/dist/esm/bcm-tab-item-header.entry.js +5 -4
  172. package/dist/esm/bcm-tab-item.entry.js +5 -4
  173. package/dist/esm/bcm-tag.entry.js +3 -2
  174. package/dist/esm/bcm-text.entry.js +2 -1
  175. package/dist/esm/bcm-textarea.entry.js +3 -2
  176. package/dist/esm/bcm-time-picker.entry.js +2 -1
  177. package/dist/esm/bcm-toast.entry.js +111 -0
  178. package/dist/esm/bromcom-ui.js +1 -1
  179. package/dist/esm/color-helper-2b6697b6.js +84 -0
  180. package/dist/esm/{color-helper-7e202fd8.js → colors-39b87f63.js} +1 -78
  181. package/dist/esm/{generate-5f6567d0.js → generate-82c3ee1f.js} +14 -1
  182. package/dist/esm/{input-template-e03cafc5.js → input-template-9a5da65a.js} +1 -1
  183. package/dist/esm/{json-parse-decarator-d8836c67.js → json-parse-decarator-aba7d121.js} +1 -1
  184. package/dist/esm/loader.js +1 -1
  185. package/dist/esm/{number-helper-b8a2b813.js → number-helper-d4126c02.js} +1 -1
  186. package/dist/esm/old-bcm-popover-box.entry.js +3 -2
  187. package/dist/esm/old-bcm-popover.entry.js +2 -1
  188. package/dist/esm/{stepper-states-16e0b400.js → stepper-states-3b8d6edd.js} +1 -1
  189. package/dist/esm/{tooltip-helper-87acf426.js → tooltip-helper-e7eb577d.js} +5 -5
  190. package/dist/esm/{validators-07033707.js → validators-2a89d009.js} +1 -1
  191. package/dist/types/components/external-source/bcm-toast-helper.d.ts +12 -0
  192. package/dist/types/components/external-source/test.js/bcm-toast-helper.d.ts +12 -0
  193. package/dist/types/components/molecules/radio/{group.d.ts → radio-group.d.ts} +22 -27
  194. package/dist/types/components/molecules/radio/radio.d.ts +5 -11
  195. package/dist/types/components.d.ts +19 -33
  196. package/dist/types/helper/generate.d.ts +1 -0
  197. package/package.json +1 -1
  198. package/dist/bromcom-ui/p-0191554f.entry.js +0 -5
  199. package/dist/bromcom-ui/p-040f1cc5.entry.js +0 -5
  200. package/dist/bromcom-ui/p-05a32a81.entry.js +0 -5
  201. package/dist/bromcom-ui/p-13f0d66c.entry.js +0 -5
  202. package/dist/bromcom-ui/p-1d77cf0f.entry.js +0 -5
  203. package/dist/bromcom-ui/p-21bf2bb5.js +0 -5
  204. package/dist/bromcom-ui/p-2552592a.entry.js +0 -5
  205. package/dist/bromcom-ui/p-2b774123.entry.js +0 -5
  206. package/dist/bromcom-ui/p-2cac45d6.entry.js +0 -5
  207. package/dist/bromcom-ui/p-2f0e0ecf.entry.js +0 -5
  208. package/dist/bromcom-ui/p-4789cc74.entry.js +0 -5
  209. package/dist/bromcom-ui/p-4a123037.entry.js +0 -5
  210. package/dist/bromcom-ui/p-4d556100.entry.js +0 -5
  211. package/dist/bromcom-ui/p-4fa21c01.entry.js +0 -5
  212. package/dist/bromcom-ui/p-53beb481.entry.js +0 -5
  213. package/dist/bromcom-ui/p-583d6b09.entry.js +0 -5
  214. package/dist/bromcom-ui/p-5a5cc30f.entry.js +0 -5
  215. package/dist/bromcom-ui/p-5c2bf950.entry.js +0 -5
  216. package/dist/bromcom-ui/p-5fa48e18.entry.js +0 -5
  217. package/dist/bromcom-ui/p-61865ff2.entry.js +0 -5
  218. package/dist/bromcom-ui/p-695f6b01.entry.js +0 -5
  219. package/dist/bromcom-ui/p-7224e112.entry.js +0 -5
  220. package/dist/bromcom-ui/p-74e46eeb.entry.js +0 -5
  221. package/dist/bromcom-ui/p-7d9a38b0.entry.js +0 -5
  222. package/dist/bromcom-ui/p-7f1a79c5.entry.js +0 -5
  223. package/dist/bromcom-ui/p-816c4dc7.entry.js +0 -5
  224. package/dist/bromcom-ui/p-86356b26.entry.js +0 -5
  225. package/dist/bromcom-ui/p-870c903a.entry.js +0 -5
  226. package/dist/bromcom-ui/p-8b60d1db.entry.js +0 -5
  227. package/dist/bromcom-ui/p-8dbe72a1.entry.js +0 -5
  228. package/dist/bromcom-ui/p-91b1efad.entry.js +0 -5
  229. package/dist/bromcom-ui/p-994e484e.entry.js +0 -5
  230. package/dist/bromcom-ui/p-a3ffcb0d.js +0 -5
  231. package/dist/bromcom-ui/p-a427f0ee.entry.js +0 -5
  232. package/dist/bromcom-ui/p-a9ab4073.entry.js +0 -5
  233. package/dist/bromcom-ui/p-b1d6b529.entry.js +0 -5
  234. package/dist/bromcom-ui/p-b39f6cb3.entry.js +0 -5
  235. package/dist/bromcom-ui/p-b69abb6f.entry.js +0 -5
  236. package/dist/bromcom-ui/p-b8ffc86f.entry.js +0 -5
  237. package/dist/bromcom-ui/p-bb95aa62.entry.js +0 -5
  238. package/dist/bromcom-ui/p-bc332b5d.entry.js +0 -5
  239. package/dist/bromcom-ui/p-bc97d311.entry.js +0 -5
  240. package/dist/bromcom-ui/p-c0ac6d54.entry.js +0 -5
  241. package/dist/bromcom-ui/p-c68f44be.entry.js +0 -5
  242. package/dist/bromcom-ui/p-cf04e7a3.entry.js +0 -5
  243. package/dist/bromcom-ui/p-d4ff4de0.entry.js +0 -5
  244. package/dist/bromcom-ui/p-d777677c.entry.js +0 -10
  245. package/dist/bromcom-ui/p-da540844.entry.js +0 -5
  246. package/dist/bromcom-ui/p-e2e7d808.entry.js +0 -5
  247. package/dist/bromcom-ui/p-ec7f4a12.entry.js +0 -5
  248. package/dist/bromcom-ui/p-f21a7fc0.entry.js +0 -5
  249. package/dist/bromcom-ui/p-fe996e86.entry.js +0 -5
  250. package/dist/bromcom-ui/p-fea33175.entry.js +0 -5
  251. package/dist/cjs/bcm-button_2.cjs.entry.js +0 -481
  252. package/dist/cjs/bcm-form.cjs.entry.js +0 -487
  253. package/dist/cjs/bcm-icon.cjs.entry.js +0 -41
  254. package/dist/cjs/bcm-input.cjs.entry.js +0 -368
  255. package/dist/cjs/bcm-label_2.cjs.entry.js +0 -148
  256. package/dist/cjs/bcm-radio-group.cjs.entry.js +0 -277
  257. package/dist/cjs/bcm-radio.cjs.entry.js +0 -105
  258. package/dist/collection/components/molecules/radio/group.css +0 -802
  259. package/dist/collection/components/molecules/radio/radio.css +0 -1287
  260. package/dist/collection/components/molecules/radio/types.js +0 -30
  261. package/dist/collection/components/molecules/states/radio-group.states.js +0 -107
  262. package/dist/esm/bcm-button_2.entry.js +0 -476
  263. package/dist/esm/bcm-form.entry.js +0 -483
  264. package/dist/esm/bcm-icon.entry.js +0 -37
  265. package/dist/esm/bcm-input.entry.js +0 -364
  266. package/dist/esm/bcm-label_2.entry.js +0 -143
  267. package/dist/esm/bcm-radio-group.entry.js +0 -273
  268. package/dist/esm/bcm-radio.entry.js +0 -101
  269. package/dist/types/components/molecules/radio/types.d.ts +0 -29
  270. package/dist/types/components/molecules/states/radio-group.states.d.ts +0 -48
@@ -13,89 +13,90 @@ 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;
33
- this.disabled = false;
26
+ this.name = undefined;
27
+ this.value = null;
28
+ this.defaultValue = undefined;
29
+ this.size = Bcm.Size.medium;
30
+ this.disabled = undefined;
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;
53
+ }
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;
64
57
  }
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,
58
+ setRadioUpdate() {
59
+ var _a;
60
+ (_a = this.radios) === null || _a === void 0 ? void 0 : _a.forEach(radio => {
61
+ radio.disabled = this.disabled || radio.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));
89
67
  }
90
- async markForCheck() {
91
- await delay(10);
92
- this.tick = Generate.UID();
68
+ watchDisabled(newVal, _oldVal) {
69
+ var _a;
70
+ (_a = this.radios) === null || _a === void 0 ? void 0 : _a.forEach(radio => radio.disabled = newVal);
71
+ }
72
+ watchDefaultValue(newVal, _oldVal) {
73
+ var _a;
74
+ (_a = this.radios) === null || _a === void 0 ? void 0 : _a.forEach(radio => radio.checked = radio.value == newVal);
75
+ this.updateValue();
76
+ this.change.emit(this.value);
77
+ }
78
+ componentWillLoad() {
79
+ this.setRadioUpdate();
80
+ this.updateValue();
81
+ }
82
+ handleChange(e) {
83
+ var _a, _b;
84
+ e.stopPropagation();
85
+ e.preventDefault();
86
+ const checked = (_a = e.target.checked) !== null && _a !== void 0 ? _a : false;
87
+ (_b = this.radios) === null || _b === void 0 ? void 0 : _b.forEach(radio => {
88
+ radio.checked = radio.id == e.target.id ? !checked : false;
89
+ });
90
+ this.updateValue();
91
+ this.change.emit(this.value);
93
92
  }
93
+ ;
94
94
  async setClear() {
95
- radioGroupState.setClear(this._id);
96
- this.markForCheck();
97
- await delay(10);
98
- return Promise.resolve();
95
+ var _a;
96
+ this.value = null;
97
+ (_a = this.radios) === null || _a === void 0 ? void 0 : _a.forEach(radio => {
98
+ radio.checked = false;
99
+ });
99
100
  }
100
101
  async resetCaption() {
101
102
  await delay(10);
@@ -105,71 +106,35 @@ export class BcmRadioGroup {
105
106
  await delay(10);
106
107
  return Promise.resolve();
107
108
  }
108
- async set(data) {
109
- await this.check(data);
109
+ async check(itemId, checked = true) {
110
+ var _a;
111
+ (_a = this.radios) === null || _a === void 0 ? void 0 : _a.forEach(radio => {
112
+ radio.checked = radio.id == itemId || radio.value == itemId ? checked : false;
113
+ });
114
+ this.updateValue();
115
+ this.change.emit(this.value);
110
116
  }
111
117
  async get() {
112
- return await this.getValue();
118
+ return this.value;
113
119
  }
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);
120
+ async set(data) {
121
+ await this.check(data);
119
122
  }
120
123
  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;
124
+ return this.value;
140
125
  }
141
126
  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))));
127
+ var _a, _b;
128
+ const { direction, fullWidth, gap, label, size, required, disabled, caption, captionError, captionType, noCaption } = this;
129
+ 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 &&
130
+ ((_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
131
  }
157
132
  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
133
  static get properties() {
169
134
  return {
170
135
  "_id": {
171
136
  "type": "string",
172
- "mutable": true,
137
+ "mutable": false,
173
138
  "complexType": {
174
139
  "original": "string",
175
140
  "resolved": "string",
@@ -185,12 +150,12 @@ export class BcmRadioGroup {
185
150
  "reflect": true,
186
151
  "defaultValue": "Generate.UID()"
187
152
  },
188
- "value": {
189
- "type": "any",
190
- "mutable": true,
153
+ "label": {
154
+ "type": "string",
155
+ "mutable": false,
191
156
  "complexType": {
192
- "original": "string | number",
193
- "resolved": "number | string",
157
+ "original": "string",
158
+ "resolved": "string",
194
159
  "references": {}
195
160
  },
196
161
  "required": false,
@@ -199,46 +164,16 @@ export class BcmRadioGroup {
199
164
  "tags": [],
200
165
  "text": ""
201
166
  },
202
- "attribute": "value",
167
+ "attribute": "label",
203
168
  "reflect": false
204
169
  },
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": {
170
+ "name": {
229
171
  "type": "string",
230
- "mutable": true,
172
+ "mutable": false,
231
173
  "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
- }
174
+ "original": "string",
175
+ "resolved": "string",
176
+ "references": {}
242
177
  },
243
178
  "required": false,
244
179
  "optional": false,
@@ -246,22 +181,16 @@ export class BcmRadioGroup {
246
181
  "tags": [],
247
182
  "text": ""
248
183
  },
249
- "attribute": "items",
250
- "reflect": false,
251
- "defaultValue": "[]"
184
+ "attribute": "name",
185
+ "reflect": false
252
186
  },
253
- "size": {
254
- "type": "string",
187
+ "value": {
188
+ "type": "any",
255
189
  "mutable": true,
256
190
  "complexType": {
257
- "original": "SizeTypes",
258
- "resolved": "\"large\" | \"medium\" | \"small\"",
259
- "references": {
260
- "SizeTypes": {
261
- "location": "import",
262
- "path": "../../../models/bcm-types"
263
- }
264
- }
191
+ "original": "string | number",
192
+ "resolved": "number | string",
193
+ "references": {}
265
194
  },
266
195
  "required": false,
267
196
  "optional": false,
@@ -269,16 +198,16 @@ export class BcmRadioGroup {
269
198
  "tags": [],
270
199
  "text": ""
271
200
  },
272
- "attribute": "size",
201
+ "attribute": "value",
273
202
  "reflect": false,
274
- "defaultValue": "Bcm.Size.medium"
203
+ "defaultValue": "null"
275
204
  },
276
- "name": {
277
- "type": "string",
205
+ "defaultValue": {
206
+ "type": "any",
278
207
  "mutable": true,
279
208
  "complexType": {
280
- "original": "string",
281
- "resolved": "string",
209
+ "original": "string | number",
210
+ "resolved": "number | string",
282
211
  "references": {}
283
212
  },
284
213
  "required": false,
@@ -287,16 +216,21 @@ export class BcmRadioGroup {
287
216
  "tags": [],
288
217
  "text": ""
289
218
  },
290
- "attribute": "name",
219
+ "attribute": "default-value",
291
220
  "reflect": false
292
221
  },
293
- "label": {
222
+ "size": {
294
223
  "type": "string",
295
- "mutable": true,
224
+ "mutable": false,
296
225
  "complexType": {
297
- "original": "string",
298
- "resolved": "string",
299
- "references": {}
226
+ "original": "SizeTypes",
227
+ "resolved": "\"large\" | \"medium\" | \"small\"",
228
+ "references": {
229
+ "SizeTypes": {
230
+ "location": "import",
231
+ "path": "@bcm/model"
232
+ }
233
+ }
300
234
  },
301
235
  "required": false,
302
236
  "optional": false,
@@ -304,12 +238,13 @@ export class BcmRadioGroup {
304
238
  "tags": [],
305
239
  "text": ""
306
240
  },
307
- "attribute": "label",
308
- "reflect": false
241
+ "attribute": "size",
242
+ "reflect": false,
243
+ "defaultValue": "Bcm.Size.medium"
309
244
  },
310
245
  "disabled": {
311
246
  "type": "boolean",
312
- "mutable": true,
247
+ "mutable": false,
313
248
  "complexType": {
314
249
  "original": "boolean",
315
250
  "resolved": "boolean",
@@ -322,12 +257,11 @@ export class BcmRadioGroup {
322
257
  "text": ""
323
258
  },
324
259
  "attribute": "disabled",
325
- "reflect": false,
326
- "defaultValue": "false"
260
+ "reflect": false
327
261
  },
328
262
  "hidden": {
329
263
  "type": "boolean",
330
- "mutable": true,
264
+ "mutable": false,
331
265
  "complexType": {
332
266
  "original": "boolean",
333
267
  "resolved": "boolean",
@@ -345,7 +279,7 @@ export class BcmRadioGroup {
345
279
  },
346
280
  "required": {
347
281
  "type": "boolean",
348
- "mutable": true,
282
+ "mutable": false,
349
283
  "complexType": {
350
284
  "original": "boolean",
351
285
  "resolved": "boolean",
@@ -363,7 +297,7 @@ export class BcmRadioGroup {
363
297
  },
364
298
  "gap": {
365
299
  "type": "string",
366
- "mutable": true,
300
+ "mutable": false,
367
301
  "complexType": {
368
302
  "original": "string",
369
303
  "resolved": "string",
@@ -378,13 +312,18 @@ export class BcmRadioGroup {
378
312
  "attribute": "gap",
379
313
  "reflect": false
380
314
  },
381
- "defaultValue": {
315
+ "direction": {
382
316
  "type": "string",
383
- "mutable": true,
317
+ "mutable": false,
384
318
  "complexType": {
385
- "original": "string",
386
- "resolved": "string",
387
- "references": {}
319
+ "original": "DirectionTypes",
320
+ "resolved": "\"horizontal\" | \"vertical\"",
321
+ "references": {
322
+ "DirectionTypes": {
323
+ "location": "import",
324
+ "path": "@bcm/model"
325
+ }
326
+ }
388
327
  },
389
328
  "required": false,
390
329
  "optional": false,
@@ -392,15 +331,16 @@ export class BcmRadioGroup {
392
331
  "tags": [],
393
332
  "text": ""
394
333
  },
395
- "attribute": "default-value",
396
- "reflect": false
334
+ "attribute": "direction",
335
+ "reflect": false,
336
+ "defaultValue": "Bcm.Direction.horizontal"
397
337
  },
398
- "optionType": {
399
- "type": "string",
400
- "mutable": true,
338
+ "fullWidth": {
339
+ "type": "boolean",
340
+ "mutable": false,
401
341
  "complexType": {
402
- "original": "'default' | 'button'",
403
- "resolved": "\"button\" | \"default\"",
342
+ "original": "boolean",
343
+ "resolved": "boolean",
404
344
  "references": {}
405
345
  },
406
346
  "required": false,
@@ -409,17 +349,24 @@ export class BcmRadioGroup {
409
349
  "tags": [],
410
350
  "text": ""
411
351
  },
412
- "attribute": "option-type",
352
+ "attribute": "full-width",
413
353
  "reflect": false,
414
- "defaultValue": "'default'"
354
+ "defaultValue": "false"
415
355
  },
416
- "buttonStyle": {
356
+ "items": {
417
357
  "type": "string",
418
- "mutable": true,
358
+ "mutable": false,
419
359
  "complexType": {
420
- "original": "'solid' | 'outline'",
421
- "resolved": "\"outline\" | \"solid\"",
422
- "references": {}
360
+ "original": "Array<object> | OptionType[] | string",
361
+ "resolved": "OptionType[] | object[] | string",
362
+ "references": {
363
+ "Array": {
364
+ "location": "global"
365
+ },
366
+ "OptionType": {
367
+ "location": "local"
368
+ }
369
+ }
423
370
  },
424
371
  "required": false,
425
372
  "optional": false,
@@ -427,31 +374,13 @@ export class BcmRadioGroup {
427
374
  "tags": [],
428
375
  "text": ""
429
376
  },
430
- "attribute": "button-style",
377
+ "attribute": "items",
431
378
  "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"
379
+ "defaultValue": "[]"
451
380
  },
452
381
  "caption": {
453
382
  "type": "string",
454
- "mutable": true,
383
+ "mutable": false,
455
384
  "complexType": {
456
385
  "original": "string",
457
386
  "resolved": "string",
@@ -468,7 +397,7 @@ export class BcmRadioGroup {
468
397
  },
469
398
  "noCaption": {
470
399
  "type": "boolean",
471
- "mutable": true,
400
+ "mutable": false,
472
401
  "complexType": {
473
402
  "original": "boolean",
474
403
  "resolved": "boolean",
@@ -486,7 +415,7 @@ export class BcmRadioGroup {
486
415
  },
487
416
  "captionError": {
488
417
  "type": "string",
489
- "mutable": true,
418
+ "mutable": false,
490
419
  "complexType": {
491
420
  "original": "string",
492
421
  "resolved": "string",
@@ -503,14 +432,14 @@ export class BcmRadioGroup {
503
432
  },
504
433
  "captionType": {
505
434
  "type": "string",
506
- "mutable": true,
435
+ "mutable": false,
507
436
  "complexType": {
508
437
  "original": "StatusTypes",
509
438
  "resolved": "\"default\" | \"error\" | \"info\" | \"success\" | \"warning\"",
510
439
  "references": {
511
440
  "StatusTypes": {
512
441
  "location": "import",
513
- "path": "../../../models/bcm-types"
442
+ "path": "@bcm/model"
514
443
  }
515
444
  }
516
445
  },
@@ -529,10 +458,7 @@ export class BcmRadioGroup {
529
458
  static get states() {
530
459
  return {
531
460
  "captionCache": {},
532
- "captionTypeCache": {},
533
- "radioOptions": {},
534
- "usingSlots": {},
535
- "tick": {}
461
+ "captionTypeCache": {}
536
462
  };
537
463
  }
538
464
  static get events() {
@@ -587,12 +513,15 @@ export class BcmRadioGroup {
587
513
  "tags": []
588
514
  }
589
515
  },
590
- "set": {
516
+ "check": {
591
517
  "complexType": {
592
- "signature": "(data: any) => Promise<void>",
518
+ "signature": "(itemId: any, checked?: boolean) => Promise<void>",
593
519
  "parameters": [{
594
520
  "tags": [],
595
521
  "text": ""
522
+ }, {
523
+ "tags": [],
524
+ "text": ""
596
525
  }],
597
526
  "references": {
598
527
  "Promise": {
@@ -608,29 +537,26 @@ export class BcmRadioGroup {
608
537
  },
609
538
  "get": {
610
539
  "complexType": {
611
- "signature": "() => Promise<string>",
540
+ "signature": "() => Promise<string | number>",
612
541
  "parameters": [],
613
542
  "references": {
614
543
  "Promise": {
615
544
  "location": "global"
616
545
  }
617
546
  },
618
- "return": "Promise<string>"
547
+ "return": "Promise<string | number>"
619
548
  },
620
549
  "docs": {
621
550
  "text": "",
622
551
  "tags": []
623
552
  }
624
553
  },
625
- "check": {
554
+ "set": {
626
555
  "complexType": {
627
- "signature": "(item: any, checked?: boolean) => Promise<void>",
556
+ "signature": "(data: any) => Promise<void>",
628
557
  "parameters": [{
629
558
  "tags": [],
630
559
  "text": ""
631
- }, {
632
- "tags": [],
633
- "text": ""
634
560
  }],
635
561
  "references": {
636
562
  "Promise": {
@@ -646,14 +572,14 @@ export class BcmRadioGroup {
646
572
  },
647
573
  "getValue": {
648
574
  "complexType": {
649
- "signature": "() => Promise<string>",
575
+ "signature": "() => Promise<string | number>",
650
576
  "parameters": [],
651
577
  "references": {
652
578
  "Promise": {
653
579
  "location": "global"
654
580
  }
655
581
  },
656
- "return": "Promise<string>"
582
+ "return": "Promise<string | number>"
657
583
  },
658
584
  "docs": {
659
585
  "text": "",
@@ -665,8 +591,20 @@ export class BcmRadioGroup {
665
591
  static get elementRef() { return "el"; }
666
592
  static get watchers() {
667
593
  return [{
668
- "propName": "items",
669
- "methodName": "handleItemsChange"
594
+ "propName": "disabled",
595
+ "methodName": "watchDisabled"
596
+ }, {
597
+ "propName": "defaultValue",
598
+ "methodName": "watchDefaultValue"
599
+ }];
600
+ }
601
+ static get listeners() {
602
+ return [{
603
+ "name": "bcm-radio-change",
604
+ "method": "handleChange",
605
+ "target": undefined,
606
+ "capture": false,
607
+ "passive": false
670
608
  }];
671
609
  }
672
610
  }