bromcom-ui 2.7.38-rc.9 → 2.8.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 (389) 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/global/helper/index.ts +1 -0
  4. package/dist/bromcom-ui/global/helper/toast.ts +136 -0
  5. package/dist/bromcom-ui/{p-3f4192c8.entry.js → p-0191554f.entry.js} +1 -1
  6. package/dist/bromcom-ui/p-040f1cc5.entry.js +5 -0
  7. package/dist/bromcom-ui/{p-2dc55ebd.entry.js → p-05a32a81.entry.js} +1 -1
  8. package/dist/bromcom-ui/{p-72f741db.entry.js → p-0b77585e.entry.js} +1 -1
  9. package/dist/bromcom-ui/{p-64b20f43.entry.js → p-0f685aa9.entry.js} +1 -1
  10. package/dist/bromcom-ui/{p-fa5118d5.entry.js → p-13f0d66c.entry.js} +1 -1
  11. package/dist/bromcom-ui/{p-c58f338d.entry.js → p-14938158.entry.js} +1 -1
  12. package/dist/bromcom-ui/{p-2de23a54.entry.js → p-1d77cf0f.entry.js} +1 -1
  13. package/dist/bromcom-ui/p-21bf2bb5.js +5 -0
  14. package/dist/bromcom-ui/p-22e08221.entry.js +5 -0
  15. package/dist/bromcom-ui/p-23cb7133.js +5 -0
  16. package/dist/bromcom-ui/{p-1eaffb4d.entry.js → p-2552592a.entry.js} +1 -1
  17. package/dist/bromcom-ui/{p-5001042f.js → p-2a2466d0.js} +1 -1
  18. package/dist/bromcom-ui/{p-c421b369.entry.js → p-2b774123.entry.js} +1 -1
  19. package/dist/bromcom-ui/{p-dddbb790.entry.js → p-2cac45d6.entry.js} +1 -1
  20. package/dist/bromcom-ui/{p-444cb95f.entry.js → p-2cdc4578.entry.js} +1 -1
  21. package/dist/bromcom-ui/{p-9d349123.entry.js → p-2f0e0ecf.entry.js} +1 -1
  22. package/dist/bromcom-ui/{p-4721d58a.entry.js → p-369d6e4f.entry.js} +1 -1
  23. package/dist/bromcom-ui/{p-969f623c.entry.js → p-3836eb77.entry.js} +1 -1
  24. package/dist/bromcom-ui/{p-69ef565b.entry.js → p-3d4897d8.entry.js} +1 -1
  25. package/dist/bromcom-ui/p-4487e8c2.js +5 -0
  26. package/dist/bromcom-ui/p-4789cc74.entry.js +5 -0
  27. package/dist/bromcom-ui/{p-5775dcea.js → p-48e9166c.js} +1 -1
  28. package/dist/bromcom-ui/{p-1d44dbea.entry.js → p-4a123037.entry.js} +1 -1
  29. package/dist/bromcom-ui/p-4a51c718.entry.js +5 -0
  30. package/dist/bromcom-ui/{p-cf5ad8a8.entry.js → p-4d556100.entry.js} +1 -1
  31. package/dist/bromcom-ui/{p-ea9667ba.entry.js → p-4fa21c01.entry.js} +1 -1
  32. package/dist/bromcom-ui/{p-15dcafdc.entry.js → p-53beb481.entry.js} +1 -1
  33. package/dist/bromcom-ui/p-583d6b09.entry.js +5 -0
  34. package/dist/bromcom-ui/{p-b00d3d27.entry.js → p-5a5cc30f.entry.js} +1 -1
  35. package/dist/bromcom-ui/{p-612f6cbc.entry.js → p-5c2bf950.entry.js} +1 -1
  36. package/dist/bromcom-ui/{p-fc55a7e3.entry.js → p-5d014153.entry.js} +1 -1
  37. package/dist/bromcom-ui/p-5de651cc.entry.js +5 -0
  38. package/dist/bromcom-ui/{p-adf96c3b.entry.js → p-5fa48e18.entry.js} +1 -1
  39. package/dist/bromcom-ui/{p-3126f440.entry.js → p-61709094.entry.js} +1 -1
  40. package/dist/bromcom-ui/{p-751ee360.entry.js → p-61865ff2.entry.js} +1 -1
  41. package/dist/bromcom-ui/p-695f6b01.entry.js +5 -0
  42. package/dist/bromcom-ui/{p-930558cd.js → p-6a473342.js} +1 -1
  43. package/dist/bromcom-ui/p-7224e112.entry.js +5 -0
  44. package/dist/bromcom-ui/{p-16ff1ff3.js → p-74595a06.js} +1 -1
  45. package/dist/bromcom-ui/{p-0a6cf248.entry.js → p-74e46eeb.entry.js} +1 -1
  46. package/dist/bromcom-ui/p-7c9025cb.js +5 -0
  47. package/dist/bromcom-ui/{p-2d75fb9d.entry.js → p-7d9a38b0.entry.js} +1 -1
  48. package/dist/bromcom-ui/{p-5ae0a59b.js → p-7e44e6b5.js} +1 -1
  49. package/dist/bromcom-ui/p-7f1a79c5.entry.js +5 -0
  50. package/dist/bromcom-ui/{p-7b7ae0f3.entry.js → p-816c4dc7.entry.js} +1 -1
  51. package/dist/bromcom-ui/p-86356b26.entry.js +5 -0
  52. package/dist/bromcom-ui/{p-f7e85c95.entry.js → p-870c903a.entry.js} +1 -1
  53. package/dist/bromcom-ui/{p-ba062b3c.js → p-88f7d869.js} +1 -1
  54. package/dist/bromcom-ui/p-8b60d1db.entry.js +5 -0
  55. package/dist/bromcom-ui/{p-3c7a0345.js → p-8c018ae0.js} +1 -1
  56. package/dist/bromcom-ui/{p-219b3300.entry.js → p-8d1cd79f.entry.js} +1 -1
  57. package/dist/bromcom-ui/p-8dbe72a1.entry.js +5 -0
  58. package/dist/bromcom-ui/{p-620afa4f.js → p-8fdcb5e7.js} +1 -1
  59. package/dist/bromcom-ui/p-91b1efad.entry.js +5 -0
  60. package/dist/bromcom-ui/{p-57d0c6e7.entry.js → p-97df9122.entry.js} +1 -1
  61. package/dist/bromcom-ui/p-994e484e.entry.js +5 -0
  62. package/dist/bromcom-ui/{p-ee9ba6ba.entry.js → p-9a1dc17c.entry.js} +1 -1
  63. package/dist/bromcom-ui/{p-1d77b8a6.js → p-9bef5a59.js} +1 -1
  64. package/dist/bromcom-ui/{p-2b73f6b1.entry.js → p-9d3a9f5b.entry.js} +1 -1
  65. package/dist/bromcom-ui/{p-4f86851c.entry.js → p-a173ed35.entry.js} +1 -1
  66. package/dist/bromcom-ui/{p-a8d1397d.js → p-a3ffcb0d.js} +1 -1
  67. package/dist/bromcom-ui/p-a427f0ee.entry.js +5 -0
  68. package/dist/bromcom-ui/{p-918acf86.entry.js → p-a9ab4073.entry.js} +1 -1
  69. package/dist/bromcom-ui/{p-962d32ef.entry.js → p-b1d6b529.entry.js} +1 -1
  70. package/dist/bromcom-ui/{p-de332baa.entry.js → p-b39f6cb3.entry.js} +1 -1
  71. package/dist/bromcom-ui/{p-d1bd9b8d.entry.js → p-b69abb6f.entry.js} +1 -1
  72. package/dist/bromcom-ui/p-b8ffc86f.entry.js +5 -0
  73. package/dist/bromcom-ui/{p-faee01b2.entry.js → p-bb95aa62.entry.js} +1 -1
  74. package/dist/bromcom-ui/{p-6c77955c.entry.js → p-bc332b5d.entry.js} +1 -1
  75. package/dist/bromcom-ui/{p-44843df2.entry.js → p-bc97d311.entry.js} +1 -1
  76. package/dist/bromcom-ui/{p-5a9b78f6.entry.js → p-bdb012c3.entry.js} +1 -1
  77. package/dist/bromcom-ui/p-c0ac6d54.entry.js +5 -0
  78. package/dist/bromcom-ui/p-c68f44be.entry.js +5 -0
  79. package/dist/bromcom-ui/{p-69bffd70.entry.js → p-cf04e7a3.entry.js} +1 -1
  80. package/dist/bromcom-ui/{p-e9cea37d.entry.js → p-d4ff4de0.entry.js} +1 -1
  81. package/dist/bromcom-ui/p-d777677c.entry.js +10 -0
  82. package/dist/bromcom-ui/p-da540844.entry.js +5 -0
  83. package/dist/bromcom-ui/{p-a368c325.entry.js → p-dae1cc7b.entry.js} +1 -1
  84. package/dist/bromcom-ui/{p-b9352123.entry.js → p-dc306bd8.entry.js} +1 -1
  85. package/dist/bromcom-ui/{p-764ae0c1.js → p-de954bc9.js} +1 -1
  86. package/dist/bromcom-ui/{p-c3ef369d.entry.js → p-dfe8e354.entry.js} +1 -1
  87. package/dist/bromcom-ui/{p-568f4f45.entry.js → p-e02491ce.entry.js} +1 -1
  88. package/dist/bromcom-ui/p-e0ec1a36.js +5 -0
  89. package/dist/bromcom-ui/{p-0b6afb97.entry.js → p-e2b3cb98.entry.js} +1 -1
  90. package/dist/bromcom-ui/p-e2e7d808.entry.js +5 -0
  91. package/dist/bromcom-ui/{p-cd8998bd.entry.js → p-ec7f4a12.entry.js} +1 -1
  92. package/dist/bromcom-ui/{p-4b1ed966.entry.js → p-f089027d.entry.js} +1 -1
  93. package/dist/bromcom-ui/{p-9979bd82.entry.js → p-f16ce14a.entry.js} +1 -1
  94. package/dist/bromcom-ui/{p-08c22a43.entry.js → p-f21a7fc0.entry.js} +1 -1
  95. package/dist/bromcom-ui/{p-87de49b4.entry.js → p-fe996e86.entry.js} +1 -1
  96. package/dist/bromcom-ui/{p-f9608226.entry.js → p-fea33175.entry.js} +1 -1
  97. package/dist/cjs/bcm-accordion.cjs.entry.js +1 -1
  98. package/dist/cjs/bcm-alert.cjs.entry.js +1 -1
  99. package/dist/cjs/bcm-attendance.cjs.entry.js +2 -2
  100. package/dist/cjs/bcm-avatar_2.cjs.entry.js +3 -3
  101. package/dist/cjs/bcm-breadcrumb.cjs.entry.js +1 -1
  102. package/dist/cjs/bcm-button-group.cjs.entry.js +1 -1
  103. package/dist/cjs/{bcm-button.cjs.entry.js → bcm-button_2.cjs.entry.js} +125 -28
  104. package/dist/cjs/bcm-card.cjs.entry.js +1 -1
  105. package/dist/cjs/bcm-checkbox-group.cjs.entry.js +1 -1
  106. package/dist/cjs/bcm-checkbox-lite_9.cjs.entry.js +2 -2
  107. package/dist/cjs/bcm-checkbox_2.cjs.entry.js +3 -3
  108. package/dist/cjs/bcm-chip.cjs.entry.js +2 -2
  109. package/dist/cjs/bcm-collapse.cjs.entry.js +1 -1
  110. package/dist/cjs/bcm-color-input.cjs.entry.js +3 -3
  111. package/dist/cjs/{bcm-colorful_7.cjs.entry.js → bcm-colorful_2.cjs.entry.js} +8 -903
  112. package/dist/cjs/bcm-colorpicker.cjs.entry.js +432 -0
  113. package/dist/cjs/bcm-date-picker.cjs.entry.js +1 -1
  114. package/dist/cjs/bcm-datetime-picker.cjs.entry.js +2 -2
  115. package/dist/cjs/bcm-default.cjs.entry.js +1 -1
  116. package/dist/cjs/bcm-drawer.cjs.entry.js +3 -3
  117. package/dist/cjs/bcm-dropdown.cjs.entry.js +2 -2
  118. package/dist/cjs/bcm-expansion-panel.cjs.entry.js +1 -1
  119. package/dist/cjs/bcm-form-2.cjs.entry.js +1 -1
  120. package/dist/cjs/bcm-form.cjs.entry.js +1 -1
  121. package/dist/cjs/bcm-icon.cjs.entry.js +41 -0
  122. package/dist/cjs/bcm-input-custom.cjs.entry.js +72 -0
  123. package/dist/cjs/bcm-input.cjs.entry.js +368 -0
  124. package/dist/cjs/bcm-item.cjs.entry.js +1 -1
  125. package/dist/cjs/bcm-items.cjs.entry.js +1 -1
  126. package/dist/cjs/bcm-label_2.cjs.entry.js +148 -0
  127. package/dist/cjs/bcm-link.cjs.entry.js +1 -1
  128. package/dist/cjs/bcm-list.cjs.entry.js +13 -12
  129. package/dist/cjs/bcm-menu.cjs.entry.js +5 -5
  130. package/dist/cjs/bcm-modal.cjs.entry.js +1 -1
  131. package/dist/cjs/bcm-popconfirm-box.cjs.entry.js +1 -1
  132. package/dist/cjs/bcm-popconfirm.cjs.entry.js +2 -2
  133. package/dist/cjs/bcm-popover.cjs.entry.js +82 -33
  134. package/dist/cjs/bcm-progress.cjs.entry.js +1 -1
  135. package/dist/cjs/bcm-radio-group.cjs.entry.js +1 -1
  136. package/dist/cjs/bcm-radio.cjs.entry.js +2 -2
  137. package/dist/cjs/bcm-range.cjs.entry.js +1 -1
  138. package/dist/cjs/bcm-search.cjs.entry.js +4 -3
  139. package/dist/cjs/bcm-select.cjs.entry.js +1 -1
  140. package/dist/cjs/bcm-skeleton.cjs.entry.js +1 -1
  141. package/dist/cjs/bcm-step.cjs.entry.js +2 -2
  142. package/dist/cjs/bcm-stepper.cjs.entry.js +55 -29
  143. package/dist/cjs/bcm-switch.cjs.entry.js +2 -2
  144. package/dist/cjs/bcm-tab-group.cjs.entry.js +85 -98
  145. package/dist/cjs/bcm-tab-item-header.cjs.entry.js +86 -0
  146. package/dist/cjs/bcm-tab-item.cjs.entry.js +103 -0
  147. package/dist/cjs/bcm-tag.cjs.entry.js +2 -2
  148. package/dist/cjs/bcm-textarea.cjs.entry.js +2 -2
  149. package/dist/cjs/bcm-time-picker.cjs.entry.js +1 -1
  150. package/dist/cjs/bromcom-ui.cjs.js +1 -1
  151. package/dist/cjs/{generate-dbed3a63.js → generate-eef61d08.js} +105 -16
  152. package/dist/cjs/{input-template-79002b88.js → input-template-517c3f53.js} +2 -2
  153. package/dist/cjs/{json-parse-decarator-65760934.js → json-parse-decarator-c0d7e570.js} +1 -1
  154. package/dist/cjs/loader.cjs.js +1 -1
  155. package/dist/cjs/{number-helper-d77c9113.js → number-helper-652dc22d.js} +1 -1
  156. package/dist/cjs/old-bcm-popover-box.cjs.entry.js +2 -2
  157. package/dist/cjs/old-bcm-popover.cjs.entry.js +1 -1
  158. package/dist/cjs/{stepper-states-fae35b0d.js → stepper-states-d00a1313.js} +1 -1
  159. package/dist/cjs/{tooltip-helper-7beca613.js → tooltip-helper-cd02e32b.js} +36 -6
  160. package/dist/cjs/{validators-95afb38d.js → validators-7eed007b.js} +1 -1
  161. package/dist/collection/collection-manifest.json +4 -0
  162. package/dist/collection/components/atoms/button/button.js +1 -1
  163. package/dist/collection/components/atoms/chip/chip.js +1 -1
  164. package/dist/collection/components/atoms/link/link.js +1 -1
  165. package/dist/collection/components/molecules/checkbox/checkbox.css +1 -0
  166. package/dist/collection/components/molecules/checkbox/checkbox.js +1 -1
  167. package/dist/collection/components/molecules/input/input.js +5 -2
  168. package/dist/collection/components/molecules/menu/menu.js +1 -1
  169. package/dist/collection/components/molecules/popconfirm/popconfirm.js +1 -1
  170. package/dist/collection/components/molecules/popover/popover.js +107 -2
  171. package/dist/collection/components/molecules/radio/radio.css +1 -0
  172. package/dist/collection/components/molecules/search/search.js +20 -1
  173. package/dist/collection/components/molecules/stepper/stepper.js +55 -35
  174. package/dist/collection/components/molecules/switch/switch.js +1 -1
  175. package/dist/collection/components/molecules/tab-group/tab-group.js +98 -100
  176. package/dist/collection/components/molecules/tab-group/tab-item-header.js +186 -0
  177. package/dist/collection/components/molecules/tab-group/tab-item.js +161 -0
  178. package/dist/collection/components/molecules/tooltip/tooltip.js +109 -2
  179. package/dist/collection/components/organism/datetime-picker/datetime-picker.js +1 -1
  180. package/dist/collection/components/organism/form/form.js +1 -1
  181. package/dist/collection/components/organism/list/list.css +1 -0
  182. package/dist/collection/components/organism/list/list.js +21 -2
  183. package/dist/collection/components/organism/states/bcm-list2.states.js +1 -1
  184. package/dist/collection/components/other/attendance/attendance.js +1 -1
  185. package/dist/collection/components/other/input-custom/input-custom.js +249 -0
  186. package/dist/collection/components/other/toast/toast.js +365 -0
  187. package/dist/collection/components/other_deprecated/select/select.js +1 -1
  188. package/dist/collection/global/components/_checkbox.css +1 -0
  189. package/dist/collection/global/helper/index.js +5 -0
  190. package/dist/collection/global/helper/index.ts +1 -0
  191. package/dist/collection/global/helper/toast.js +114 -0
  192. package/dist/collection/global/helper/toast.ts +136 -0
  193. package/dist/collection/helper/generate.js +108 -19
  194. package/dist/collection/helper/popover-helper.js +57 -29
  195. package/dist/collection/helper/tooltip-helper.js +33 -4
  196. package/dist/collection/stories/assets/button/1.svg +35 -0
  197. package/dist/collection/stories/assets/button/10.svg +24 -0
  198. package/dist/collection/stories/assets/button/11.svg +24 -0
  199. package/dist/collection/stories/assets/button/12.svg +24 -0
  200. package/dist/collection/stories/assets/button/2.svg +28 -0
  201. package/dist/collection/stories/assets/button/3.svg +41 -0
  202. package/dist/collection/stories/assets/button/4.svg +9 -0
  203. package/dist/collection/stories/assets/button/5.svg +65 -0
  204. package/dist/collection/stories/assets/button/6.svg +68 -0
  205. package/dist/collection/stories/assets/button/7.svg +203 -0
  206. package/dist/collection/stories/assets/button/8.svg +316 -0
  207. package/dist/collection/stories/assets/button/9.svg +9 -0
  208. package/dist/collection/templates/button-template.js +1 -1
  209. package/dist/collection/templates/input-template.js +1 -1
  210. package/dist/collection/templates/list-item-template.js +1 -1
  211. package/dist/collection/templates/list-template.js +2 -2
  212. package/dist/components/bcm-attendance.js +1 -1
  213. package/dist/components/bcm-chip.js +1 -1
  214. package/dist/components/bcm-form.js +1 -1
  215. package/dist/components/bcm-input-custom.d.ts +11 -0
  216. package/dist/components/bcm-input-custom.js +114 -0
  217. package/dist/components/bcm-list.js +11 -9
  218. package/dist/components/bcm-popconfirm.js +1 -1
  219. package/dist/components/bcm-popover.js +83 -30
  220. package/dist/components/bcm-select.js +1 -1
  221. package/dist/components/bcm-stepper.js +51 -33
  222. package/dist/components/bcm-switch.js +1 -1
  223. package/dist/components/bcm-tab-group.js +84 -98
  224. package/dist/components/bcm-tab-item-header.d.ts +11 -0
  225. package/dist/components/bcm-tab-item-header.js +102 -0
  226. package/dist/components/bcm-tab-item.d.ts +11 -0
  227. package/dist/components/bcm-tab-item.js +117 -0
  228. package/dist/components/bcm-tab.js +1 -1
  229. package/dist/components/bcm-tabs-content.js +1 -1
  230. package/dist/components/bcm-tabs.js +1 -1
  231. package/dist/components/bcm-tag.js +1 -1
  232. package/dist/components/bcm-toast.d.ts +11 -0
  233. package/dist/components/bcm-toast.js +140 -0
  234. package/dist/components/button.js +2 -2
  235. package/dist/components/checkbox-lite.js +1 -1
  236. package/dist/components/checkbox.js +2 -2
  237. package/dist/components/datetime-picker.js +1 -1
  238. package/dist/components/generate.js +105 -16
  239. package/dist/components/index.d.ts +4 -0
  240. package/dist/components/index.js +4 -0
  241. package/dist/components/input-template.js +2 -15
  242. package/dist/components/input.js +5 -2
  243. package/dist/components/link.js +1 -1
  244. package/dist/components/menu.js +1 -1
  245. package/dist/components/radio.js +1 -1
  246. package/dist/components/search.js +3 -1
  247. package/dist/components/tooltip-helper.js +33 -3
  248. package/dist/components/tooltip.js +29 -3
  249. package/dist/components/types.js +14 -27
  250. package/dist/components/types2.js +25 -25
  251. package/dist/components/types3.js +32 -0
  252. package/dist/esm/bcm-accordion.entry.js +3 -3
  253. package/dist/esm/bcm-alert.entry.js +4 -4
  254. package/dist/esm/bcm-attendance.entry.js +4 -4
  255. package/dist/esm/bcm-autocomplete.entry.js +2 -2
  256. package/dist/esm/bcm-avatar_2.entry.js +9 -9
  257. package/dist/esm/bcm-box.entry.js +2 -2
  258. package/dist/esm/bcm-breadcrumb.entry.js +3 -3
  259. package/dist/esm/bcm-button-group.entry.js +3 -3
  260. package/dist/esm/{bcm-button.entry.js → bcm-button_2.entry.js} +124 -28
  261. package/dist/esm/bcm-card.entry.js +6 -6
  262. package/dist/esm/bcm-checkbox-group.entry.js +7 -7
  263. package/dist/esm/bcm-checkbox-lite_9.entry.js +5 -5
  264. package/dist/esm/bcm-checkbox_2.entry.js +9 -9
  265. package/dist/esm/bcm-chip.entry.js +6 -6
  266. package/dist/esm/bcm-collapse-group.entry.js +3 -3
  267. package/dist/esm/bcm-collapse.entry.js +3 -3
  268. package/dist/esm/bcm-color-input.entry.js +7 -7
  269. package/dist/esm/{bcm-colorful_7.entry.js → bcm-colorful_2.entry.js} +15 -905
  270. package/dist/esm/bcm-colorpicker.entry.js +428 -0
  271. package/dist/esm/bcm-date-picker.entry.js +4 -4
  272. package/dist/esm/bcm-datetime-picker.entry.js +8 -8
  273. package/dist/esm/bcm-default.entry.js +3 -3
  274. package/dist/esm/bcm-drawer.entry.js +8 -8
  275. package/dist/esm/bcm-dropdown.entry.js +4 -4
  276. package/dist/esm/bcm-error-layout.entry.js +2 -2
  277. package/dist/esm/bcm-expansion-panel.entry.js +5 -5
  278. package/dist/esm/bcm-form-2.entry.js +3 -3
  279. package/dist/esm/bcm-form-group.entry.js +2 -2
  280. package/dist/esm/bcm-form.entry.js +4 -4
  281. package/dist/esm/bcm-icon.entry.js +37 -0
  282. package/dist/esm/bcm-input-custom.entry.js +68 -0
  283. package/dist/esm/bcm-input.entry.js +364 -0
  284. package/dist/esm/bcm-item.entry.js +5 -5
  285. package/dist/esm/bcm-items.entry.js +3 -3
  286. package/dist/esm/bcm-label_2.entry.js +143 -0
  287. package/dist/esm/bcm-link.entry.js +3 -3
  288. package/dist/esm/bcm-list.entry.js +22 -21
  289. package/dist/esm/bcm-menu.entry.js +10 -10
  290. package/dist/esm/bcm-message.entry.js +2 -2
  291. package/dist/esm/bcm-modal.entry.js +4 -4
  292. package/dist/esm/bcm-notification.entry.js +2 -2
  293. package/dist/esm/bcm-old-input.entry.js +4 -4
  294. package/dist/esm/bcm-old-tag_2.entry.js +3 -3
  295. package/dist/esm/bcm-popconfirm-box.entry.js +5 -5
  296. package/dist/esm/bcm-popconfirm.entry.js +4 -4
  297. package/dist/esm/bcm-popover.entry.js +86 -37
  298. package/dist/esm/bcm-progress.entry.js +5 -5
  299. package/dist/esm/bcm-radio-group.entry.js +6 -6
  300. package/dist/esm/bcm-radio.entry.js +7 -7
  301. package/dist/esm/bcm-range.entry.js +4 -4
  302. package/dist/esm/bcm-result.entry.js +2 -2
  303. package/dist/esm/bcm-search.entry.js +8 -7
  304. package/dist/esm/bcm-select-group.entry.js +1 -1
  305. package/dist/esm/bcm-select-option.entry.js +1 -1
  306. package/dist/esm/bcm-select.entry.js +4 -4
  307. package/dist/esm/bcm-skeleton.entry.js +3 -3
  308. package/dist/esm/bcm-step.entry.js +5 -5
  309. package/dist/esm/bcm-stepper.entry.js +56 -30
  310. package/dist/esm/bcm-switch.entry.js +6 -6
  311. package/dist/esm/bcm-tab-group.entry.js +86 -99
  312. package/dist/esm/bcm-tab-item-header.entry.js +82 -0
  313. package/dist/esm/bcm-tab-item.entry.js +99 -0
  314. package/dist/esm/bcm-tab-pane.entry.js +2 -2
  315. package/dist/esm/bcm-tab.entry.js +2 -2
  316. package/dist/esm/bcm-table.entry.js +3 -3
  317. package/dist/esm/bcm-tabs-content.entry.js +3 -3
  318. package/dist/esm/bcm-tabs.entry.js +3 -3
  319. package/dist/esm/bcm-tag.entry.js +5 -5
  320. package/dist/esm/bcm-text.entry.js +5 -5
  321. package/dist/esm/bcm-textarea.entry.js +6 -6
  322. package/dist/esm/bcm-time-picker.entry.js +4 -4
  323. package/dist/esm/bcm-timeline-item.entry.js +2 -2
  324. package/dist/esm/bcm-timeline.entry.js +2 -2
  325. package/dist/esm/bcm-treeview-group.entry.js +1 -1
  326. package/dist/esm/bromcom-ui.js +2 -2
  327. package/dist/esm/{caption-template-2ef181f9.js → caption-template-389f5bd6.js} +1 -1
  328. package/dist/esm/{color-helper-b5e9aa56.js → color-helper-7e202fd8.js} +1 -1
  329. package/dist/esm/{element-dragger-7ea06c76.js → element-dragger-89bb52fd.js} +1 -1
  330. package/dist/esm/{generate-1e46485f.js → generate-5f6567d0.js} +105 -16
  331. package/dist/esm/{index-662f4cf5.js → index-6e2d80d7.js} +1 -1
  332. package/dist/esm/{index-cb0cdd87.js → index-8b349654.js} +1 -1
  333. package/dist/esm/{input-template-844dc974.js → input-template-e03cafc5.js} +3 -3
  334. package/dist/esm/{is-load-decorator-0a59085d.js → is-load-decorator-66e19e04.js} +1 -1
  335. package/dist/esm/{json-parse-decarator-00aa321e.js → json-parse-decarator-d8836c67.js} +2 -2
  336. package/dist/esm/{label-template-d8687efd.js → label-template-eed2dd69.js} +2 -2
  337. package/dist/esm/loader.js +2 -2
  338. package/dist/esm/{number-helper-f2cdb65b.js → number-helper-b8a2b813.js} +1 -1
  339. package/dist/esm/old-bcm-popover-box.entry.js +6 -6
  340. package/dist/esm/old-bcm-popover.entry.js +3 -3
  341. package/dist/esm/{slot-template-5b2da1d3.js → slot-template-64b41ee5.js} +1 -1
  342. package/dist/esm/{stepper-states-822ebfe9.js → stepper-states-16e0b400.js} +3 -3
  343. package/dist/esm/{tooltip-helper-aecc821b.js → tooltip-helper-87acf426.js} +38 -8
  344. package/dist/esm/{utils-b3338faf.js → utils-57652744.js} +1 -1
  345. package/dist/esm/{validators-1b3c085a.js → validators-07033707.js} +1 -1
  346. package/dist/types/components/molecules/popover/popover.d.ts +10 -1
  347. package/dist/types/components/molecules/search/search.d.ts +1 -0
  348. package/dist/types/components/molecules/stepper/stepper.d.ts +3 -3
  349. package/dist/types/components/molecules/tab-group/tab-group.d.ts +7 -4
  350. package/dist/types/components/molecules/tab-group/tab-item-header.d.ts +13 -0
  351. package/dist/types/components/molecules/tab-group/tab-item.d.ts +17 -0
  352. package/dist/types/components/molecules/tooltip/tooltip.d.ts +10 -1
  353. package/dist/types/components/organism/list/list.d.ts +1 -0
  354. package/dist/types/components/other/input-custom/input-custom.d.ts +20 -0
  355. package/dist/types/components/other/toast/toast.d.ts +25 -0
  356. package/dist/types/components.d.ts +157 -9
  357. package/dist/types/global/helper/index.d.ts +1 -0
  358. package/dist/types/global/helper/toast.d.ts +96 -0
  359. package/dist/types/helper/generate.d.ts +2 -0
  360. package/dist/types/helper/popover-helper.d.ts +13 -3
  361. package/dist/types/helper/tooltip-helper.d.ts +13 -3
  362. package/dist/types/index.d.ts +1 -1
  363. package/dist/types/templates/list-template.d.ts +1 -0
  364. package/helper/index.d.ts +2 -0
  365. package/helper/index.d.ts.map +1 -0
  366. package/helper/index.js +17 -0
  367. package/helper/toast.d.ts +97 -0
  368. package/helper/toast.d.ts.map +1 -0
  369. package/helper/toast.js +115 -0
  370. package/package.json +8 -5
  371. package/dist/bromcom-ui/p-053e9893.js +0 -5
  372. package/dist/bromcom-ui/p-07ebe62b.entry.js +0 -10
  373. package/dist/bromcom-ui/p-1683b3c0.entry.js +0 -5
  374. package/dist/bromcom-ui/p-3118bba1.entry.js +0 -5
  375. package/dist/bromcom-ui/p-3f3bb4b0.entry.js +0 -5
  376. package/dist/bromcom-ui/p-40736ee7.entry.js +0 -5
  377. package/dist/bromcom-ui/p-6f98089c.entry.js +0 -5
  378. package/dist/bromcom-ui/p-6fcb72c6.entry.js +0 -5
  379. package/dist/bromcom-ui/p-73076cdb.entry.js +0 -5
  380. package/dist/bromcom-ui/p-7c318b12.js +0 -5
  381. package/dist/bromcom-ui/p-7dfb39a6.js +0 -5
  382. package/dist/bromcom-ui/p-7ea09be3.js +0 -5
  383. package/dist/bromcom-ui/p-8914af05.entry.js +0 -5
  384. package/dist/bromcom-ui/p-968e2d79.js +0 -5
  385. package/dist/bromcom-ui/p-a3864e85.entry.js +0 -5
  386. package/dist/bromcom-ui/p-a5077dec.entry.js +0 -5
  387. package/dist/bromcom-ui/p-ac156ba4.entry.js +0 -5
  388. package/dist/bromcom-ui/p-c9e1f317.entry.js +0 -5
  389. package/dist/bromcom-ui/p-e258c81c.entry.js +0 -5
@@ -0,0 +1,114 @@
1
+ /*!
2
+ * Built with Stencil
3
+ * Copyright (c) Bromcom.
4
+ */
5
+ export class Toast {
6
+ /**
7
+ * Creates an instance of Toast.
8
+ * @param {ToastOptions & ToastEvents} [options={}]
9
+ * @example
10
+ * const toast = new Toast();
11
+ * @example
12
+ * const toast = new Toast({
13
+ * id: "my-toast",
14
+ * message: "Hello World",
15
+ * status: "success",
16
+ * description: "This is a description",
17
+ * duration: 5000,
18
+ * position: "top",
19
+ * "message-icon": "check",
20
+ * "view-button": true,
21
+ * "close-button": true,
22
+ * bcmToastView: (event) => {
23
+ * // This Event fires when the view button is clicked
24
+ * // do something
25
+ * },
26
+ * bcmToastClose: (event) => {
27
+ * // This Event fires when the toast is closed
28
+ * // do something
29
+ * },
30
+ * bcmToastOpen: (event) => {
31
+ * // This Event fires when the toast is opened
32
+ * // do something
33
+ * }
34
+ * });
35
+ * toast.show();
36
+ */
37
+ constructor(options) {
38
+ this.options = options;
39
+ this.createElement();
40
+ this.listeners();
41
+ this.setAttributes();
42
+ return this.element;
43
+ }
44
+ createElement() {
45
+ var _a;
46
+ let el;
47
+ ((_a = this.options) === null || _a === void 0 ? void 0 : _a.id) && (el = document.getElementById(this.options.id));
48
+ if (el) {
49
+ this.element = el;
50
+ }
51
+ else {
52
+ const tag = "bcm-toast";
53
+ this.element = document.createElement(tag);
54
+ }
55
+ document.body.appendChild(this.element);
56
+ return this.element;
57
+ }
58
+ listeners() {
59
+ this.options.bcmToastView && this.element.addEventListener("bcm-toast-view", this.options.bcmToastView);
60
+ this.options.bcmToastClose && this.element.addEventListener("bcm-toast-close", this.options.bcmToastClose);
61
+ this.options.bcmToastOpen && this.element.addEventListener("bcm-toast-open", this.options.bcmToastOpen);
62
+ }
63
+ setAttributes() {
64
+ for (let key in this.options) {
65
+ this.element.setAttribute(key, this.options[key]);
66
+ }
67
+ }
68
+ /**
69
+ * Shows the toast
70
+ * @returns {HTMLElement} The element that was shown
71
+ * @example
72
+ * const toast = new Toast();
73
+ * toast.show();
74
+ * @example
75
+ * const toast = new Toast();
76
+ * toast.show().then(() => {
77
+ * // do something
78
+ * });
79
+ * @example
80
+ * const toast = new Toast();
81
+ * toast.show().then(() => {
82
+ * // do something
83
+ * }).catch(() => {
84
+ * // do something else
85
+ * });
86
+ */
87
+ show() {
88
+ this.element.show();
89
+ return this.element;
90
+ }
91
+ /**
92
+ * Hides the toast
93
+ * @returns {HTMLElement} The element that was hidden
94
+ * @example
95
+ * const toast = new Toast();
96
+ * toast.hide();
97
+ * @example
98
+ * const toast = new Toast();
99
+ * toast.hide().then(() => {
100
+ * // do something
101
+ * });
102
+ * @example
103
+ * const toast = new Toast();
104
+ * toast.hide().then(() => {
105
+ * // do something
106
+ * }).catch(() => {
107
+ * // do something else
108
+ * });
109
+ */
110
+ hide() {
111
+ this.element.hide();
112
+ return this.element;
113
+ }
114
+ }
@@ -0,0 +1,136 @@
1
+ interface ToastOptions {
2
+ "id"?: string;
3
+ "message"?: string;
4
+ "status"?: "success" | "error" | "warning" | "info";
5
+ "description"?: string;
6
+ "duration"?: number;
7
+ "position"?: "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end";
8
+ "message-icon"?: string;
9
+ "view-button"?: boolean;
10
+ "close-button"?: boolean;
11
+ }
12
+
13
+ interface ToastEvents {
14
+ bcmToastView?: (event: any) => void;
15
+ bcmToastClose?: (event: any) => void;
16
+ bcmToastOpen?: (event: any) => void;
17
+ }
18
+
19
+ export class Toast {
20
+ element: any;
21
+ options: ToastOptions & ToastEvents;
22
+
23
+ /**
24
+ * Creates an instance of Toast.
25
+ * @param {ToastOptions & ToastEvents} [options={}]
26
+ * @example
27
+ * const toast = new Toast();
28
+ * @example
29
+ * const toast = new Toast({
30
+ * id: "my-toast",
31
+ * message: "Hello World",
32
+ * status: "success",
33
+ * description: "This is a description",
34
+ * duration: 5000,
35
+ * position: "top",
36
+ * "message-icon": "check",
37
+ * "view-button": true,
38
+ * "close-button": true,
39
+ * bcmToastView: (event) => {
40
+ * // This Event fires when the view button is clicked
41
+ * // do something
42
+ * },
43
+ * bcmToastClose: (event) => {
44
+ * // This Event fires when the toast is closed
45
+ * // do something
46
+ * },
47
+ * bcmToastOpen: (event) => {
48
+ * // This Event fires when the toast is opened
49
+ * // do something
50
+ * }
51
+ * });
52
+ * toast.show();
53
+ */
54
+ constructor(options: ToastOptions & ToastEvents) {
55
+ this.options = options;
56
+
57
+ this.createElement();
58
+ this.listeners();
59
+ this.setAttributes();
60
+ return this.element;
61
+ }
62
+
63
+ private createElement() {
64
+ let el: any;
65
+ this.options?.id && (el = document.getElementById(this.options.id));
66
+ if (el) {
67
+ this.element = el;
68
+ } else {
69
+ const tag = "bcm-toast";
70
+ this.element = document.createElement(tag);
71
+ }
72
+
73
+ document.body.appendChild(this.element);
74
+ return this.element;
75
+ }
76
+
77
+ private listeners() {
78
+ this.options.bcmToastView && this.element.addEventListener("bcm-toast-view", this.options.bcmToastView);
79
+ this.options.bcmToastClose && this.element.addEventListener("bcm-toast-close", this.options.bcmToastClose);
80
+ this.options.bcmToastOpen && this.element.addEventListener("bcm-toast-open", this.options.bcmToastOpen);
81
+ }
82
+
83
+ private setAttributes() {
84
+ for (let key in this.options) {
85
+ this.element.setAttribute(key, this.options[key]);
86
+ }
87
+ }
88
+
89
+ /**
90
+ * Shows the toast
91
+ * @returns {HTMLElement} The element that was shown
92
+ * @example
93
+ * const toast = new Toast();
94
+ * toast.show();
95
+ * @example
96
+ * const toast = new Toast();
97
+ * toast.show().then(() => {
98
+ * // do something
99
+ * });
100
+ * @example
101
+ * const toast = new Toast();
102
+ * toast.show().then(() => {
103
+ * // do something
104
+ * }).catch(() => {
105
+ * // do something else
106
+ * });
107
+ */
108
+ show() {
109
+ this.element.show();
110
+ return this.element;
111
+ }
112
+
113
+ /**
114
+ * Hides the toast
115
+ * @returns {HTMLElement} The element that was hidden
116
+ * @example
117
+ * const toast = new Toast();
118
+ * toast.hide();
119
+ * @example
120
+ * const toast = new Toast();
121
+ * toast.hide().then(() => {
122
+ * // do something
123
+ * });
124
+ * @example
125
+ * const toast = new Toast();
126
+ * toast.hide().then(() => {
127
+ * // do something
128
+ * }).catch(() => {
129
+ * // do something else
130
+ * });
131
+ */
132
+ hide() {
133
+ this.element.hide();
134
+ return this.element;
135
+ }
136
+ }
@@ -2,44 +2,68 @@
2
2
  * Built with Stencil
3
3
  * Copyright (c) Bromcom.
4
4
  */
5
- import { StatusProps } from '../components/molecules/alert/types';
5
+ import { StatusProps } from "../components/molecules/alert/types";
6
6
  // @ts-ignore
7
- import { version } from '../../package.json';
8
- import { Build } from '@stencil/core';
9
- import snq from 'snq';
10
- const allowedDomains = ['localhost', 'beta-regression.bromcomcloud.com', 'beta-scrum.bromcomcloud.com', 'beta-kanban.bromcomcloud.com'];
7
+ import { version } from "../../package.json";
8
+ import { Build } from "@stencil/core";
9
+ import snq from "snq";
10
+ const allowedDomains = ["localhost", "beta-regression.bromcomcloud.com", "beta-scrum.bromcomcloud.com", "beta-kanban.bromcomcloud.com"];
11
11
  const isAllowedDomain = () => {
12
12
  const hostname = window.location.hostname;
13
13
  return allowedDomains.includes(hostname);
14
14
  };
15
15
  if (isAllowedDomain()) {
16
- console.log(`%cbromcom ui%c version: ${version}-${Build.isDev ? 'd' : 'p'} `, `color: white; background:#1890FF; font-weight: 300; font-size:10px; padding:2px 6px; border-radius: 5px`, `font-size:10px;`);
16
+ console.log(`%cbromcom ui%c version: ${version}-${Build.isDev ? "d" : "p"} `, `color: white; background:#1890FF; font-weight: 300; font-size:10px; padding:2px 6px; border-radius: 5px`, `font-size:10px;`);
17
17
  }
18
+ (function checkTheme() {
19
+ const body = document.querySelector("body");
20
+ let theme = localStorage.getItem("bcm-theme");
21
+ if (!body.classList.contains("bcm-theme-*") && theme) {
22
+ body.classList.add(`bcm-theme-${theme}`);
23
+ }
24
+ })();
18
25
  export class Generate {
26
+ static observeElementRemoval(element, callback) {
27
+ const observer = new MutationObserver((mutationsList, observer) => {
28
+ for (const mutation of mutationsList) {
29
+ if (mutation.type === "childList") {
30
+ const removedNodes = Array.from(mutation.removedNodes);
31
+ for (const removedNode of removedNodes) {
32
+ if (removedNode === element) {
33
+ callback();
34
+ observer.disconnect();
35
+ return;
36
+ }
37
+ }
38
+ }
39
+ }
40
+ });
41
+ observer.observe(document.documentElement, { childList: true, subtree: true });
42
+ }
19
43
  }
20
- Generate.UID = (prefix = 'bcm') => `${prefix}${Math.random().toString(36).substr(2, 9)}`;
44
+ Generate.UID = (prefix = "bcm") => `${prefix}${Math.random().toString(36).substr(2, 9)}`;
21
45
  Generate.getIconAttrWithStatusType = (status, loading = false) => {
22
46
  if (loading)
23
- return { icon: 'far fa-spinner-third fa-spin' };
47
+ return { icon: "far fa-spinner-third fa-spin" };
24
48
  switch (status) {
25
49
  case StatusProps.info:
26
- return { icon: 'far fa-info-circle' };
50
+ return { icon: "far fa-info-circle" };
27
51
  case StatusProps.error:
28
- return { icon: 'far fa-times-circle' };
52
+ return { icon: "far fa-times-circle" };
29
53
  case StatusProps.warning:
30
- return { icon: 'far fa-exclamation-circle' };
54
+ return { icon: "far fa-exclamation-circle" };
31
55
  case StatusProps.success:
32
- return { icon: 'far fa-check-circle' };
56
+ return { icon: "far fa-check-circle" };
33
57
  }
34
58
  };
35
- Generate.createComponent = (el, props, area = 'append-area') => {
59
+ Generate.createComponent = (el, props, area = "append-area") => {
36
60
  let container = area ? document.querySelector(area) : document.body;
37
61
  if (area && !container) {
38
- container = document.createElement('div');
39
- container.id = 'append-area';
62
+ container = document.createElement("div");
63
+ container.id = "append-area";
40
64
  document.body.appendChild(container);
41
- container.style.visibility = 'hidden';
42
- container.style.opacity = '0';
65
+ container.style.visibility = "hidden";
66
+ container.style.opacity = "0";
43
67
  }
44
68
  let element = document.getElementById(props.id);
45
69
  if (!element) {
@@ -52,13 +76,13 @@ Generate.createComponent = (el, props, area = 'append-area') => {
52
76
  container.appendChild(element);
53
77
  return element;
54
78
  };
55
- Generate.createElement = (tag = 'div', props) => {
79
+ Generate.createElement = (tag = "div", props) => {
56
80
  let element = document.getElementById(props.id);
57
81
  if (!element) {
58
82
  element = document.createElement(tag);
59
83
  }
60
84
  Object.keys(props).forEach(key => {
61
- if (key == 'innerHTML') {
85
+ if (key == "innerHTML") {
62
86
  element[key] = props[key];
63
87
  }
64
88
  else {
@@ -166,3 +190,68 @@ Generate.getAncestor = (el, selector) => {
166
190
  ;
167
191
  return el;
168
192
  };
193
+ Generate.findParentElement = (element, selector) => {
194
+ const firstChar = selector.charAt(0);
195
+ function getElementByClass(currentElement, className) {
196
+ while (currentElement !== null) {
197
+ if (currentElement.classList.contains(className)) {
198
+ return currentElement;
199
+ }
200
+ currentElement = currentElement.parentElement;
201
+ }
202
+ return null;
203
+ }
204
+ function getElementById(currentElement, id) {
205
+ while (currentElement !== null) {
206
+ if (currentElement.id === id) {
207
+ return currentElement;
208
+ }
209
+ currentElement = currentElement.parentElement;
210
+ }
211
+ return null;
212
+ }
213
+ function getElementByAttribute(currentElement, attr, value) {
214
+ while (currentElement !== null) {
215
+ if (currentElement.hasAttribute(attr) && (value === undefined || currentElement.getAttribute(attr) === value)) {
216
+ return currentElement;
217
+ }
218
+ currentElement = currentElement.parentElement;
219
+ }
220
+ return null;
221
+ }
222
+ function getElementByTag(currentElement, tag) {
223
+ while (currentElement !== null) {
224
+ if (currentElement.tagName.toLowerCase() === tag.toLowerCase()) {
225
+ return currentElement;
226
+ }
227
+ currentElement = currentElement.parentElement;
228
+ }
229
+ return null;
230
+ }
231
+ if (selector === "*") {
232
+ // Tüm elementleri seç
233
+ return element.parentElement;
234
+ }
235
+ else if (firstChar === ".") {
236
+ // Sınıf adı seçicisi
237
+ const className = selector.slice(1);
238
+ return getElementByClass(element.parentElement, className);
239
+ }
240
+ else if (firstChar === "#") {
241
+ // ID seçicisi
242
+ const id = selector.slice(1);
243
+ return getElementById(element.parentElement, id);
244
+ }
245
+ else if (firstChar === "[") {
246
+ // Öznitelik seçicisi
247
+ const end = selector.indexOf("]");
248
+ const attr = selector.slice(1, end);
249
+ const value = selector.slice(end + 2, -1);
250
+ return getElementByAttribute(element.parentElement, attr, value);
251
+ }
252
+ else {
253
+ // Etiket adı seçicisi
254
+ const tag = selector.toLowerCase();
255
+ return getElementByTag(element.parentElement, tag);
256
+ }
257
+ };
@@ -2,31 +2,38 @@
2
2
  * Built with Stencil
3
3
  * Copyright (c) Bromcom.
4
4
  */
5
- import { FloatingUI } from '@bcm/utils';
6
- import { ColorHelper, Generate, StringHelper } from '@bcm/helpers';
5
+ import { delay, FloatingUI } from "@bcm/utils";
6
+ import { ColorHelper, Generate, StringHelper } from "@bcm/helpers";
7
7
  export class Popover {
8
- constructor({ content, message, targetId, placement = 'top', color = 'slate-700', trigger = 'none' }) {
8
+ constructor({ content, message, targetId, placement = "top", color = "slate-700", trigger = "none", openDelay = 0, closeDelay = 0, emitShow = () => { }, emitHide = () => { } }) {
9
+ this.destroy = () => {
10
+ this.el = document.getElementById(this.id);
11
+ if (this.el) {
12
+ this.el.remove();
13
+ this.emitHide();
14
+ }
15
+ this.removeListener();
16
+ };
9
17
  this.bgColor = () => ColorHelper.twColor(this.color, 700);
10
18
  this.exepcitonColors = {
11
- white: 'slate-300',
12
- black: 'slate-700',
19
+ white: "slate-300",
20
+ black: "slate-700",
13
21
  };
14
22
  this.target = () => document.getElementById(this.targetId);
15
23
  this.init = () => {
16
- console.log(this.content, this.message);
17
24
  const inner = `<div class="tw-z-[1] tw-rounded tw-py-2 tw-bg-${this.bgColor()}">
18
- ${this.message ? `<div class="tw-font-medium tw-w-full tw-pb-1 tw-px-4">${StringHelper.trim(this.message)}</div>` : ''}
19
- ${this.content ? `<div class="tw-font-normal tw-px-4">${StringHelper.trim(this.content)}</div>` : ''}
25
+ ${this.message ? `<div class="tw-font-medium tw-w-full tw-pb-1 tw-px-4">${StringHelper.trim(this.message)}</div>` : ""}
26
+ ${this.content ? `<div class="tw-font-normal tw-px-4">${StringHelper.trim(this.content)}</div>` : ""}
20
27
  </div>`;
21
- this.el = Generate.createElement('div', {
22
- 'id': `${this.targetId}-popover-box`,
23
- 'class': `
28
+ this.el = Generate.createElement("div", {
29
+ "id": `${this.targetId}-popover-box`,
30
+ "class": `
24
31
  tw-whitespace-normal tw-break-words tw-block tw-font-sans tw-pointer-events-none tw-max-w-[256px] tw-rounded tw-bg-${this.bgColor()} tw-text-white tw-text-3 tw-absolute tw-top-0 tw-left-0 tw-z-tooltip tw-opacity-0 tw-transition-opacity tw-duration-300
25
32
  tw-shadow`,
26
- 'role': 'popover',
27
- 'aria-hidden': 'true',
28
- 'style': `color: ${ColorHelper.twColorReverse(this.bgColor())}`,
29
- 'innerHTML': inner,
33
+ "role": "popover",
34
+ "aria-hidden": "true",
35
+ "style": `color: ${ColorHelper.twColorReverse(this.bgColor())}`,
36
+ "innerHTML": inner,
30
37
  });
31
38
  };
32
39
  this.update = () => {
@@ -37,21 +44,21 @@ export class Popover {
37
44
  }
38
45
  };
39
46
  this.listener = () => {
40
- window.addEventListener('resize', this.calculatePosition.bind(this));
41
- window.addEventListener('scroll', this.calculatePosition.bind(this), true);
42
- window.addEventListener('wheel', this.calculatePosition.bind(this));
47
+ window.addEventListener("resize", this.calculatePosition.bind(this));
48
+ window.addEventListener("scroll", this.calculatePosition.bind(this), true);
49
+ window.addEventListener("wheel", this.calculatePosition.bind(this));
43
50
  if (this.trigger && this.target()) {
44
51
  switch (this.trigger) {
45
- case 'click':
46
- this.target().addEventListener('click', this.toggle.bind(this));
52
+ case "click":
53
+ this.target().addEventListener("click", this.toggle.bind(this));
47
54
  break;
48
- case 'hover':
49
- this.target().addEventListener('mouseenter', this.show.bind(this));
50
- this.target().addEventListener('mouseleave', this.hide.bind(this));
55
+ case "hover":
56
+ this.target().addEventListener("mouseenter", this.show.bind(this));
57
+ this.target().addEventListener("mouseleave", this.hide.bind(this));
51
58
  break;
52
- case 'focus':
53
- this.target().addEventListener('focus', this.show.bind(this), true);
54
- this.target().addEventListener('blur', this.hide.bind(this), true);
59
+ case "focus":
60
+ this.target().addEventListener("focus", this.show.bind(this), true);
61
+ this.target().addEventListener("blur", this.hide.bind(this), true);
55
62
  break;
56
63
  default:
57
64
  break;
@@ -59,6 +66,18 @@ export class Popover {
59
66
  }
60
67
  this.calculatePosition();
61
68
  };
69
+ this.removeListener = () => {
70
+ window.removeEventListener("resize", this.calculatePosition.bind(this));
71
+ window.removeEventListener("scroll", this.calculatePosition.bind(this), true);
72
+ window.removeEventListener("wheel", this.calculatePosition.bind(this));
73
+ if (this.target()) {
74
+ this.target().removeEventListener("click", this.toggle.bind(this));
75
+ this.target().removeEventListener("mouseenter", this.show.bind(this));
76
+ this.target().removeEventListener("mouseleave", this.hide.bind(this));
77
+ this.target().removeEventListener("focus", this.show.bind(this), true);
78
+ this.target().removeEventListener("blur", this.hide.bind(this), true);
79
+ }
80
+ };
62
81
  this.calculatePosition = () => {
63
82
  this.el = document.getElementById(this.id);
64
83
  if (this.el) {
@@ -72,19 +91,23 @@ export class Popover {
72
91
  });
73
92
  }
74
93
  };
75
- this.show = () => {
94
+ this.show = async () => {
76
95
  if (this.message) {
77
96
  this.init();
97
+ await delay(this.openDelay);
78
98
  this.calculatePosition();
99
+ this.emitShow();
79
100
  }
80
101
  else {
81
102
  this.hide();
82
103
  }
83
104
  };
84
- this.hide = () => {
105
+ this.hide = async () => {
85
106
  this.el = document.getElementById(this.id);
86
107
  if (this.el) {
108
+ await delay(this.closeDelay);
87
109
  this.el.remove();
110
+ this.emitHide();
88
111
  }
89
112
  };
90
113
  this.toggle = () => {
@@ -102,6 +125,11 @@ export class Popover {
102
125
  this.placement = placement;
103
126
  this.color = color;
104
127
  this.trigger = trigger;
105
- this.id = targetId + '-popover-box';
128
+ this.id = targetId + "-popover-box";
129
+ this.openDelay = openDelay;
130
+ this.closeDelay = closeDelay;
131
+ this.emitShow = emitShow;
132
+ this.emitHide = emitHide;
133
+ Generate.observeElementRemoval(document.getElementById(this.targetId), this.destroy.bind(this));
106
134
  }
107
135
  }
@@ -2,11 +2,19 @@
2
2
  * Built with Stencil
3
3
  * Copyright (c) Bromcom.
4
4
  */
5
- import { FloatingUI } from "@bcm/utils";
5
+ import { delay, FloatingUI } from "@bcm/utils";
6
6
  import { ColorHelper, Generate, StringHelper } from "@bcm/helpers";
7
7
  import { Bcm } from "@bcm/model";
8
8
  export class Tooltip {
9
- constructor({ message, targetId, placement = "top", color = "slate-700", trigger = "none", size = "medium" }) {
9
+ constructor({ message, targetId, placement = "top", color = "slate-700", trigger = "none", size = "medium", openDelay = 0, closeDelay = 0, emitShow = () => { }, emitHide = () => { }, }) {
10
+ this.destroy = () => {
11
+ this.el = document.getElementById(this.id);
12
+ if (this.el) {
13
+ this.el.remove();
14
+ this.emitHide();
15
+ }
16
+ this.removeListener();
17
+ };
10
18
  this.bgColor = () => ColorHelper.twColor(this.color, 700);
11
19
  this.target = () => document.getElementById(this.targetId);
12
20
  this.sizeClass = () => {
@@ -62,6 +70,18 @@ export class Tooltip {
62
70
  }
63
71
  this.calculatePosition();
64
72
  };
73
+ this.removeListener = () => {
74
+ window.removeEventListener("resize", this.calculatePosition.bind(this));
75
+ window.removeEventListener("scroll", this.calculatePosition.bind(this), true);
76
+ window.removeEventListener("wheel", this.calculatePosition.bind(this));
77
+ if (this.target()) {
78
+ this.target().removeEventListener("click", this.toggle.bind(this));
79
+ this.target().removeEventListener("mouseenter", this.show.bind(this));
80
+ this.target().removeEventListener("mouseleave", this.hide.bind(this));
81
+ this.target().removeEventListener("focus", this.show.bind(this), true);
82
+ this.target().removeEventListener("blur", this.hide.bind(this), true);
83
+ }
84
+ };
65
85
  this.calculatePosition = () => {
66
86
  this.el = document.getElementById(this.id);
67
87
  if (this.el) {
@@ -75,19 +95,23 @@ export class Tooltip {
75
95
  });
76
96
  }
77
97
  };
78
- this.show = () => {
98
+ this.show = async () => {
79
99
  if (this.message) {
80
100
  this.init();
101
+ await delay(this.openDelay);
81
102
  this.calculatePosition();
103
+ this.emitShow();
82
104
  }
83
105
  else {
84
106
  this.hide();
85
107
  }
86
108
  };
87
- this.hide = () => {
109
+ this.hide = async () => {
88
110
  this.el = document.getElementById(this.id);
89
111
  if (this.el) {
112
+ await delay(this.closeDelay);
90
113
  this.el.remove();
114
+ this.emitHide();
91
115
  }
92
116
  };
93
117
  this.toggle = () => {
@@ -106,5 +130,10 @@ export class Tooltip {
106
130
  this.id = targetId + "-tooltip-box";
107
131
  this.trigger = trigger;
108
132
  this.size = size;
133
+ this.openDelay = openDelay;
134
+ this.closeDelay = closeDelay;
135
+ this.emitShow = emitShow;
136
+ this.emitHide = emitHide;
137
+ Generate.observeElementRemoval(document.getElementById(this.targetId), this.destroy.bind(this));
109
138
  }
110
139
  }