bromcom-ui 2.3.54 → 2.3.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (212) hide show
  1. package/dist/bromcom-ui/bromcom-ui.css +0 -0
  2. package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
  3. package/dist/bromcom-ui/index.esm.js +0 -0
  4. package/dist/bromcom-ui/p-12493dbc.entry.js +1 -0
  5. package/dist/bromcom-ui/{p-a18a0cc4.entry.js → p-13d038f5.entry.js} +1 -1
  6. package/dist/bromcom-ui/p-1429a2b4.js +1 -0
  7. package/dist/bromcom-ui/{p-4b7f14ed.entry.js → p-20d03fa1.entry.js} +1 -1
  8. package/dist/bromcom-ui/{p-774ff4d9.entry.js → p-30c1cd7f.entry.js} +1 -1
  9. package/dist/bromcom-ui/p-37750343.entry.js +1 -0
  10. package/dist/bromcom-ui/p-3f797656.entry.js +1 -0
  11. package/dist/bromcom-ui/{p-4396ee3b.entry.js → p-4092f5f1.entry.js} +1 -1
  12. package/dist/bromcom-ui/p-4a41ef80.entry.js +1 -0
  13. package/dist/bromcom-ui/p-4cb268d2.js +1 -0
  14. package/dist/bromcom-ui/p-53e9b679.entry.js +1 -0
  15. package/dist/bromcom-ui/{p-09753e05.js → p-554d326a.js} +1 -1
  16. package/dist/bromcom-ui/p-68ff64de.js +1 -0
  17. package/dist/bromcom-ui/p-7238d22f.entry.js +1 -0
  18. package/dist/bromcom-ui/p-7f1cd976.entry.js +1 -0
  19. package/dist/bromcom-ui/p-811c24d7.entry.js +1 -0
  20. package/dist/bromcom-ui/p-8851e01e.entry.js +1 -0
  21. package/dist/bromcom-ui/{p-1a2724a0.entry.js → p-92e3e240.entry.js} +1 -1
  22. package/dist/bromcom-ui/p-9ffff762.entry.js +1 -0
  23. package/dist/bromcom-ui/p-a6ef098a.entry.js +1 -0
  24. package/dist/bromcom-ui/p-af7e4741.entry.js +1 -0
  25. package/dist/bromcom-ui/{p-0d336381.entry.js → p-afb68492.entry.js} +1 -1
  26. package/dist/bromcom-ui/p-bbf99620.entry.js +1 -0
  27. package/dist/bromcom-ui/p-bc50aa86.entry.js +1 -0
  28. package/dist/bromcom-ui/p-e21a8f2d.entry.js +1 -0
  29. package/dist/bromcom-ui/p-e450ebda.entry.js +1 -0
  30. package/dist/bromcom-ui/p-e8307da9.entry.js +1 -0
  31. package/dist/bromcom-ui/{p-26b3d5d0.entry.js → p-e8771d32.entry.js} +1 -1
  32. package/dist/bromcom-ui/p-f067821e.entry.js +1 -0
  33. package/dist/bromcom-ui/p-f12743d8.entry.js +1 -0
  34. package/dist/bromcom-ui/p-ff5e57d3.entry.js +1 -0
  35. package/dist/cjs/bcm-alert.cjs.entry.js +7 -26
  36. package/dist/cjs/bcm-badge.cjs.entry.js +50 -0
  37. package/dist/cjs/{bcm-badge_20.cjs.entry.js → bcm-button_11.cjs.entry.js} +1209 -2835
  38. package/dist/cjs/bcm-checkbox-lite_4.cjs.entry.js +291 -0
  39. package/dist/cjs/bcm-colorpicker.cjs.entry.js +3 -3
  40. package/dist/cjs/{bcm-datetime-picker_2.cjs.entry.js → bcm-datetime-picker.cjs.entry.js} +3 -137
  41. package/dist/cjs/bcm-dropdown.cjs.entry.js +1 -1
  42. package/dist/cjs/bcm-list-item_2.cjs.entry.js +197 -0
  43. package/dist/cjs/bcm-list-select.cjs.entry.js +658 -0
  44. package/dist/cjs/bcm-list.cjs.entry.js +1204 -0
  45. package/dist/cjs/{bcm-empty_6.cjs.entry.js → bcm-listbox_5.cjs.entry.js} +10 -77
  46. package/dist/cjs/bcm-modal.cjs.entry.js +197 -0
  47. package/dist/cjs/bcm-popconfirm-box.cjs.entry.js +1 -1
  48. package/dist/cjs/bcm-popconfirm.cjs.entry.js +2 -2
  49. package/dist/cjs/bcm-popover-box.cjs.entry.js +1 -1
  50. package/dist/cjs/bcm-popover.cjs.entry.js +2 -2
  51. package/dist/cjs/bcm-pulldown-group_2.cjs.entry.js +1 -1
  52. package/dist/cjs/bcm-pulldown.cjs.entry.js +1 -1
  53. package/dist/cjs/bcm-radio-group.cjs.entry.js +124 -0
  54. package/dist/cjs/bcm-radio.cjs.entry.js +104 -0
  55. package/dist/cjs/bcm-select.cjs.entry.js +68 -8
  56. package/dist/cjs/bcm-tab-pane.cjs.entry.js +51 -0
  57. package/dist/cjs/bcm-tab.cjs.entry.js +72 -0
  58. package/dist/cjs/bcm-tabs-content.cjs.entry.js +43 -0
  59. package/dist/cjs/bcm-tabs.cjs.entry.js +361 -0
  60. package/dist/cjs/bcm-text.cjs.entry.js +28 -0
  61. package/dist/cjs/bcm-upload.cjs.entry.js +1 -1
  62. package/dist/cjs/bromcom-ui.cjs.js +1 -1
  63. package/dist/cjs/{element-dragger-36fcb296.js → element-dragger-4a91c708.js} +1 -1
  64. package/dist/cjs/loader.cjs.js +1 -1
  65. package/dist/cjs/types-37c8ced6.js +16 -0
  66. package/dist/cjs/types-f53bc841.js +19 -0
  67. package/dist/cjs/{utils-43fda566.js → utils-60414768.js} +25 -0
  68. package/dist/collection/collection-manifest.json +1 -0
  69. package/dist/collection/components/atoms/label/label.css +70 -0
  70. package/dist/collection/components/atoms/label/label.js +203 -0
  71. package/dist/collection/components/molecules/checkbox/group.js +19 -6
  72. package/dist/collection/components/molecules/input/input.js +39 -7
  73. package/dist/collection/components/molecules/list/list-item.css +1 -0
  74. package/dist/collection/components/molecules/list/list-select.css +10 -5
  75. package/dist/collection/components/molecules/list/list-select.js +232 -34
  76. package/dist/collection/components/molecules/list/list.css +24 -2
  77. package/dist/collection/components/molecules/list/list.js +391 -119
  78. package/dist/collection/components/molecules/popconfirm/popconfirm-box.css +1 -0
  79. package/dist/collection/components/molecules/popconfirm/popconfirm.css +1 -0
  80. package/dist/collection/components/molecules/popover/popover-box.css +1 -0
  81. package/dist/collection/components/molecules/popover/popover.css +1 -0
  82. package/dist/collection/components/molecules/radio/group.js +19 -6
  83. package/dist/collection/components/molecules/search/search.js +2 -2
  84. package/dist/collection/components/molecules/select/select.js +85 -12
  85. package/dist/collection/components/molecules/switch/switch.css +0 -1
  86. package/dist/collection/components/molecules/switch/switch.js +20 -7
  87. package/dist/collection/components/molecules/textarea/textarea.css +4 -1
  88. package/dist/collection/components/molecules/textarea/textarea.js +33 -17
  89. package/dist/collection/components/molecules/tooltip/tooltip-box.css +1 -0
  90. package/dist/collection/components/molecules/tooltip/tooltip.css +1 -0
  91. package/dist/collection/components/organism/colorpicker/colorpicker.js +19 -6
  92. package/dist/collection/components/organism/datetime-picker/datetime-picker.js +1 -1
  93. package/dist/collection/components/organism/form/form.js +5 -4
  94. package/dist/collection/components/organism/listbox/listbox.js +27 -17
  95. package/dist/collection/helper/color-helper.js +33 -0
  96. package/dist/collection/helper/generate.js +47 -0
  97. package/dist/collection/helper/number-helper.js +10 -0
  98. package/dist/collection/helper/string-helper.js +21 -0
  99. package/dist/collection/helper/validators.js +21 -0
  100. package/dist/collection/models/bcm-types.js +1 -0
  101. package/dist/collection/models/bcm.js +451 -0
  102. package/dist/collection/templates/caption-template.js +22 -0
  103. package/dist/collection/templates/label-template.js +16 -0
  104. package/dist/collection/templates/slot-template.js +6 -0
  105. package/dist/collection/utils/utils.js +24 -0
  106. package/dist/esm/bcm-alert.entry.js +1 -20
  107. package/dist/esm/bcm-badge.entry.js +46 -0
  108. package/dist/esm/{bcm-badge_20.entry.js → bcm-button_11.entry.js} +1204 -2821
  109. package/dist/esm/bcm-checkbox-lite_4.entry.js +284 -0
  110. package/dist/esm/bcm-colorpicker.entry.js +3 -3
  111. package/dist/esm/{bcm-datetime-picker_2.entry.js → bcm-datetime-picker.entry.js} +4 -137
  112. package/dist/esm/bcm-dropdown.entry.js +1 -1
  113. package/dist/esm/bcm-list-item_2.entry.js +192 -0
  114. package/dist/esm/bcm-list-select.entry.js +654 -0
  115. package/dist/esm/bcm-list.entry.js +1200 -0
  116. package/dist/esm/{bcm-empty_6.entry.js → bcm-listbox_5.entry.js} +12 -78
  117. package/dist/esm/bcm-modal.entry.js +193 -0
  118. package/dist/esm/bcm-popconfirm-box.entry.js +1 -1
  119. package/dist/esm/bcm-popconfirm.entry.js +2 -2
  120. package/dist/esm/bcm-popover-box.entry.js +1 -1
  121. package/dist/esm/bcm-popover.entry.js +2 -2
  122. package/dist/esm/bcm-pulldown-group_2.entry.js +1 -1
  123. package/dist/esm/bcm-pulldown.entry.js +1 -1
  124. package/dist/esm/bcm-radio-group.entry.js +120 -0
  125. package/dist/esm/bcm-radio.entry.js +100 -0
  126. package/dist/esm/bcm-select.entry.js +68 -8
  127. package/dist/esm/bcm-tab-pane.entry.js +47 -0
  128. package/dist/esm/bcm-tab.entry.js +68 -0
  129. package/dist/esm/bcm-tabs-content.entry.js +39 -0
  130. package/dist/esm/bcm-tabs.entry.js +357 -0
  131. package/dist/esm/bcm-text.entry.js +24 -0
  132. package/dist/esm/bcm-upload.entry.js +1 -1
  133. package/dist/esm/bromcom-ui.js +1 -1
  134. package/dist/esm/{element-dragger-03ac2a5e.js → element-dragger-97a8f373.js} +1 -1
  135. package/dist/esm/loader.js +1 -1
  136. package/dist/esm/polyfills/css-shim.js +0 -0
  137. package/dist/esm/types-4b11eac9.js +28 -0
  138. package/dist/esm/types-911a8837.js +21 -0
  139. package/dist/esm/{utils-b7fba7c4.js → utils-de9aee67.js} +25 -1
  140. package/dist/types/assets/icons/index.d.ts +0 -0
  141. package/dist/types/assets/icons/index.example.d.ts +0 -0
  142. package/dist/types/components/atoms/avatar/avatar.d.ts +0 -0
  143. package/dist/types/components/atoms/badge/badge.d.ts +0 -0
  144. package/dist/types/components/atoms/button/button.d.ts +0 -0
  145. package/dist/types/components/atoms/divider/divider.d.ts +0 -0
  146. package/dist/types/components/atoms/icon/icon.d.ts +0 -0
  147. package/dist/types/components/atoms/icon/types.d.ts +0 -0
  148. package/dist/types/components/atoms/label/label.d.ts +16 -0
  149. package/dist/types/components/atoms/tag/tag.d.ts +0 -0
  150. package/dist/types/components/atoms/text/text.d.ts +0 -0
  151. package/dist/types/components/molecules/card/card-footer.d.ts +0 -0
  152. package/dist/types/components/molecules/card/card-header.d.ts +0 -0
  153. package/dist/types/components/molecules/card/card.d.ts +0 -0
  154. package/dist/types/components/molecules/checkbox/checkbox.d.ts +0 -0
  155. package/dist/types/components/molecules/checkbox/group.d.ts +1 -0
  156. package/dist/types/components/molecules/input/input.d.ts +2 -0
  157. package/dist/types/components/molecules/list/list-select.d.ts +24 -4
  158. package/dist/types/components/molecules/list/list.d.ts +13 -3
  159. package/dist/types/components/molecules/radio/group.d.ts +1 -0
  160. package/dist/types/components/molecules/radio/radio.d.ts +0 -0
  161. package/dist/types/components/molecules/select/group.d.ts +0 -0
  162. package/dist/types/components/molecules/select/option.d.ts +0 -0
  163. package/dist/types/components/molecules/select/select.d.ts +1 -0
  164. package/dist/types/components/molecules/switch/switch.d.ts +1 -0
  165. package/dist/types/components/molecules/textarea/textarea.d.ts +3 -2
  166. package/dist/types/components/organism/colorpicker/colorpicker.d.ts +1 -0
  167. package/dist/types/components/organism/listbox/listbox.d.ts +1 -0
  168. package/dist/types/components.d.ts +95 -12
  169. package/dist/types/global/variables/colors.d.ts +0 -0
  170. package/dist/types/helper/color-helper.d.ts +9 -0
  171. package/dist/types/helper/generate.d.ts +10 -0
  172. package/dist/types/helper/number-helper.d.ts +9 -0
  173. package/dist/types/helper/string-helper.d.ts +20 -0
  174. package/dist/types/helper/validators.d.ts +8 -0
  175. package/dist/types/index.d.ts +0 -0
  176. package/dist/types/models/bcm-types.d.ts +19 -0
  177. package/dist/types/models/bcm.d.ts +447 -0
  178. package/dist/types/stencil-public-runtime.d.ts +0 -0
  179. package/dist/types/templates/caption-template.d.ts +12 -0
  180. package/dist/types/templates/label-template.d.ts +12 -0
  181. package/dist/types/templates/slot-template.d.ts +8 -0
  182. package/dist/types/utils/utils.d.ts +1 -0
  183. package/loader/cdn.js +0 -0
  184. package/loader/index.cjs.js +0 -0
  185. package/loader/index.d.ts +0 -0
  186. package/loader/index.es2017.js +0 -0
  187. package/loader/index.js +0 -0
  188. package/loader/package.json +0 -0
  189. package/package.json +1 -1
  190. package/dist/bromcom-ui/p-013b6f5d.entry.js +0 -1
  191. package/dist/bromcom-ui/p-0532e299.entry.js +0 -1
  192. package/dist/bromcom-ui/p-0aa53bdb.entry.js +0 -1
  193. package/dist/bromcom-ui/p-2c1ee381.entry.js +0 -1
  194. package/dist/bromcom-ui/p-607bc9b3.entry.js +0 -1
  195. package/dist/bromcom-ui/p-6355c903.entry.js +0 -1
  196. package/dist/bromcom-ui/p-6bd805f1.entry.js +0 -1
  197. package/dist/bromcom-ui/p-77a480ff.entry.js +0 -1
  198. package/dist/bromcom-ui/p-a88256f2.entry.js +0 -1
  199. package/dist/bromcom-ui/p-b92324e7.js +0 -1
  200. package/dist/bromcom-ui/p-ba219861.entry.js +0 -1
  201. package/dist/bromcom-ui/p-cdfd9ba0.entry.js +0 -1
  202. package/dist/bromcom-ui/p-cf6b0656.entry.js +0 -1
  203. package/dist/cjs/bcm-checkbox-group.cjs.entry.js +0 -273
  204. package/dist/cjs/bcm-checkbox.cjs.entry.js +0 -143
  205. package/dist/cjs/bcm-switch.cjs.entry.js +0 -86
  206. package/dist/cjs/bcm-textarea.cjs.entry.js +0 -136
  207. package/dist/cjs/bcm-tooltip-box.cjs.entry.js +0 -36
  208. package/dist/esm/bcm-checkbox-group.entry.js +0 -269
  209. package/dist/esm/bcm-checkbox.entry.js +0 -139
  210. package/dist/esm/bcm-switch.entry.js +0 -82
  211. package/dist/esm/bcm-textarea.entry.js +0 -132
  212. package/dist/esm/bcm-tooltip-box.entry.js +0 -32
@@ -1,36 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-ce8878ec.js');
6
- const index$1 = require('./index-2f62bdaf.js');
7
-
8
- const tooltipBoxCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}:host{display:inline-flex}:host(.hidden){display:none}:host(:focus){outline:none}.tooltip-box{position:relative;}.tooltip-box .box{position:absolute;display:none;box-sizing:border-box;background-color:#262626;border:1px solid #262626;border-radius:2px;z-index:10700;width:max-content;padding:4px 8px;color:var(--bcm-color-grey-1)}.tooltip-box::after{content:\"\";position:absolute;display:none;border:6px solid;z-index:10700}.tooltip-box.open .box,.tooltip-box.open::after{display:block}.tooltip-box.top .box{bottom:100%;margin-bottom:8px}.tooltip-box.top::after{bottom:100%;margin-bottom:-4px;border-color:#262626 transparent transparent transparent}.tooltip-box.bottom .box{top:100%;margin-top:8px}.tooltip-box.bottom::after{top:100%;margin-top:-4px;border-color:transparent transparent #262626 transparent}.tooltip-box.left .box{right:100%;margin-right:8px}.tooltip-box.left::after{right:100%;margin-right:-4px;border-color:transparent transparent transparent #262626}.tooltip-box.right .box{left:100%;margin-left:8px}.tooltip-box.right::after{left:100%;margin-left:-4px;border-color:transparent #262626 transparent transparent}.tooltip-box.top.center .box,.tooltip-box.bottom.center .box{left:50%;transform:translateX(-50%)}.tooltip-box.top.center::after,.tooltip-box.bottom.center::after{left:50%;transform:translateX(-50%)}.tooltip-box.top.start .box,.tooltip-box.bottom.start .box{left:0}.tooltip-box.top.start::after,.tooltip-box.bottom.start::after{left:8px}.tooltip-box.top.end .box,.tooltip-box.bottom.end .box{right:0}.tooltip-box.top.end::after,.tooltip-box.bottom.end::after{right:8px}.tooltip-box.left.center .box,.tooltip-box.right.center .box{top:50%;transform:translateY(-50%)}.tooltip-box.left.center::after,.tooltip-box.right.center::after{top:50%;transform:translateY(-50%)}.tooltip-box.left.start .box,.tooltip-box.right.start .box{top:0}.tooltip-box.left.start::after,.tooltip-box.right.start::after{top:4px}.tooltip-box.left.end .box,.tooltip-box.right.end .box{bottom:0}.tooltip-box.left.end::after,.tooltip-box.right.end::after{bottom:4px}.tooltip-box a{color:var(--bcm-color-grey-1)}";
9
-
10
- const BcmTooltipBox = class {
11
- constructor(hostRef) {
12
- index.registerInstance(this, hostRef);
13
- this.hidden = false;
14
- }
15
- connectedCallback() { }
16
- disconnectedCallback() { }
17
- componentWillLoad() { }
18
- componentDidLoad() { }
19
- componentWillRender() { }
20
- componentDidRender() { }
21
- componentWillUpdate() { }
22
- componentDidUpdate() { }
23
- async openBox(open) {
24
- this.open = open;
25
- }
26
- render() {
27
- const classes = index$1.classnames('tooltip-box', this.open, this.placement);
28
- const boxClasses = index$1.classnames('box');
29
- const hostClasses = index$1.classnames(this.hidden ? 'hidden' : null);
30
- return (index.h(index.Host, { class: hostClasses }, index.h("div", { class: classes }, index.h("div", { class: boxClasses, innerHTML: this.message }))));
31
- }
32
- get el() { return index.getElement(this); }
33
- };
34
- BcmTooltipBox.style = tooltipBoxCss;
35
-
36
- exports.bcm_tooltip_box = BcmTooltipBox;
@@ -1,269 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-8fe7aea4.js';
2
- import { c as classnames } from './index-e58a2d48.js';
3
-
4
- const groupCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}:host{display:block;width:100%}:host(.hidden){display:none}:host(.error) .label{color:var(--bcm-color-red-6) !important}.group-container{display:flex;gap:24px}.group-container.vertical{gap:unset;flex-direction:column}.group-container.button{gap:unset}.group-container.full-width{max-width:100%}.indeterminate{padding:0 0 16px 0;margin-bottom:16px;border-bottom:1px solid #efefef;}.indeterminate input{display:none}.indeterminate label{display:flex;align-items:center;font-size:14px;color:var(--bcm-color-grey-8);cursor:pointer}.indeterminate label .icon-checked{display:none}.indeterminate span{position:relative;display:flex;align-items:center;justify-content:center;width:16px;height:16px;border:1px solid #D9D9D9;margin-right:8px;border-radius:2px}.indeterminate span:after{content:\"\";position:absolute;top:50%;left:50%;width:10px;height:10px;background-color:var(--bcm-color-prime-blue-6);transform:translate(-50%, -50%);opacity:0}.indeterminate bcm-icon{filter:brightness(0) invert(1)}.indeterminate input[disabled]+label{cursor:not-allowed}.indeterminate input[disabled]+label span{background-color:var(--bcm-color-grey-3);border-color:var(--bcm-color-grey-5)}.indeterminate input[disabled]+label span:after{background-color:var(--bcm-color-grey-6)}.indeterminate input[disabled]+label bcm-icon{filter:brightness(0);opacity:0.3}.indeterminate input:not([disabled])+label:hover span{border-color:var(--bcm-color-prime-blue-6);box-shadow:0px 2px 4px rgba(54, 121, 171, 0.5)}.indeterminate.bcm-uncheck label span{background-color:#ffffff}.indeterminate.bcm-determinate bcm-icon{display:block}.indeterminate.bcm-determinate label span{background-color:var(--bcm-color-prime-blue-6);border-color:transparent}.indeterminate.bcm-determinate label span:after{opacity:0}.indeterminate.bcm-indeterminate bcm-icon{display:none !important}.indeterminate.bcm-indeterminate label span{background-color:#ffffff}.indeterminate.bcm-indeterminate label span:after{opacity:1}.label{display:flex;flex-direction:column;color:var(--bcm-color-grey-9);margin-bottom:8px}";
5
-
6
- const BcmCheckboxGroup = class {
7
- constructor(hostRef) {
8
- registerInstance(this, hostRef);
9
- this.groupChange = createEvent(this, "bcm-group-change", 7);
10
- this.groupCheckedList = createEvent(this, "bcm-group-checked-list", 7);
11
- /**
12
- * Private variables
13
- */
14
- this.checkboxes = [];
15
- /**
16
- * Component Properties
17
- */
18
- this.direction = 'horizontal';
19
- this.items = [];
20
- this.indeterminate = false;
21
- this.disabled = false;
22
- this.hidden = false;
23
- this.required = false;
24
- this.label = null;
25
- this.gap = null;
26
- this.fullWidth = "false";
27
- this.optionType = 'default';
28
- this.buttonStyle = 'solid';
29
- this.size = 'medium';
30
- this.noCaption = false;
31
- this.captionType = 'default';
32
- /**
33
- * Component State Variables
34
- */
35
- this.indeterminateState = 'uncheck';
36
- this.checkboxesProp = [];
37
- }
38
- /**
39
- * @ComponentMethod
40
- */
41
- componentWillLoad() {
42
- this.parseItems(this.items);
43
- this.parseOptions();
44
- }
45
- /**
46
- * @ComponentMethod
47
- */
48
- connectedCallback() { }
49
- componentDidLoad() {
50
- let checkboxesInit = [];
51
- checkboxesInit = this.getAllInputs();
52
- checkboxesInit.map(checkbox => {
53
- if (this.fullWidth != "false") {
54
- if (this.fullWidth === "flex") {
55
- checkbox.style.flex = "auto";
56
- }
57
- else {
58
- checkbox.style.width = "100%";
59
- }
60
- }
61
- this.optionType && (checkbox.optionType = this.optionType);
62
- this.buttonStyle && (checkbox.buttonStyle = this.buttonStyle);
63
- this.size && (checkbox.size = this.size);
64
- // this.required == true && checkbox.required == true && (
65
- // checkbox.required = true
66
- // )
67
- this.disabled == true && (checkbox.disabled = true);
68
- });
69
- this.groupChecked().then(values => this.value = values);
70
- }
71
- async setClear() {
72
- const checkboxesInit = this.getAllInputs();
73
- checkboxesInit.map(checkbox => {
74
- checkbox.setClear();
75
- checkbox.noCaption = this.noCaption;
76
- });
77
- }
78
- async resetCaption() {
79
- const checkboxesInit = this.getAllInputs();
80
- checkboxesInit.map(checkbox => {
81
- checkbox.resetCaption();
82
- checkbox.noCaption = this.noCaption;
83
- });
84
- }
85
- /**
86
- * @ComponentMethod
87
- */
88
- componentDidRender() {
89
- let slotElements;
90
- slotElements = this.el.shadowRoot.querySelector('slot').assignedElements();
91
- this.checkboxes = [];
92
- // Get only bcm-checkbox elements from
93
- // slot childs
94
- slotElements.map(element => {
95
- String(element.tagName).toLowerCase() == 'bcm-checkbox'
96
- && this.checkboxes.push(element);
97
- });
98
- this.setIndeterminateState();
99
- if (this.items.length > 0) {
100
- let checkboxesInit = [];
101
- checkboxesInit = this.getAllInputs();
102
- checkboxesInit.map(checkbox => {
103
- this.defaultValueState && (this.defaultValueState.find(e => e === checkbox.name) && checkbox.check(checkbox.name));
104
- });
105
- }
106
- }
107
- componentDidUpdate() {
108
- this.handleChange();
109
- }
110
- /**
111
- * @desc
112
- */
113
- inputChange() {
114
- this.groupChecked().then(values => this.value = values);
115
- this.setIndeterminateState();
116
- }
117
- /**
118
- * @desc Returns merged slot and prop
119
- * checkbox items
120
- * @returns {Array<BcmCheckbox>}
121
- */
122
- getAllInputs() {
123
- return [
124
- ...this.checkboxes,
125
- ...this.el.shadowRoot.querySelectorAll('bcm-checkbox')
126
- ];
127
- }
128
- /**
129
- * @desc
130
- * @returns {void}
131
- */
132
- setIndeterminateState() {
133
- let state = 'uncheck';
134
- let allChecked = true;
135
- let allUnchecked = true;
136
- this.getAllInputs().map((checkbox) => {
137
- checkbox.checked && (allUnchecked = false);
138
- !checkbox.checked && (allChecked = false);
139
- });
140
- !allChecked && !allUnchecked
141
- ? state = 'indeterminate'
142
- : allChecked
143
- ? state = 'determinate'
144
- : state = 'uncheck';
145
- this.indeterminateState = state;
146
- }
147
- /**
148
- * @desc
149
- * @param event
150
- */
151
- indeterminateClick() {
152
- if (this.disabled == false) {
153
- let checkAll = true;
154
- if (this.indeterminateState == 'determinate') {
155
- checkAll = false;
156
- }
157
- this.getAllInputs().map((checkbox) => {
158
- checkbox.check(checkAll);
159
- });
160
- }
161
- }
162
- parseOptions() {
163
- if (this.defaultValue) {
164
- this.defaultValueState = JSON.parse(this.defaultValue);
165
- }
166
- }
167
- /**
168
- * @desc
169
- * @param newValue
170
- * @returns {void}
171
- */
172
- parseItems(newValue) {
173
- if (newValue) {
174
- typeof newValue == 'string'
175
- ? this.checkboxesProp = JSON.parse(newValue)
176
- : this.checkboxesProp = newValue;
177
- }
178
- }
179
- /**
180
- * @desc
181
- * @param name -
182
- * @returns {boolean | Array<any>}
183
- */
184
- async check(options) {
185
- if (options) {
186
- typeof options == 'string'
187
- ? options = JSON.parse(options)
188
- : options = options;
189
- }
190
- let checkboxes = [];
191
- checkboxes = this.getAllInputs();
192
- const inBoth = (list1, list2) => list1.filter(a => true === list2.some(b => a.name === b.name));
193
- let optionsArray = options;
194
- inBoth(checkboxes, options).map(item => {
195
- item.check(optionsArray.find(x => x.name === item.name).checked);
196
- });
197
- }
198
- /**
199
- * @desc
200
- * @param name -
201
- * @returns {boolean | Array<any>}
202
- */
203
- async groupChecked(name) {
204
- let retVal = null;
205
- let checkeds = {};
206
- let checkboxes = [];
207
- if (typeof retVal != 'boolean' && !retVal) {
208
- retVal = checkeds;
209
- }
210
- // Merge slotted items with prop items
211
- // #
212
- checkboxes = this.getAllInputs();
213
- checkboxes.map(checkbox => {
214
- checkbox.checked && (checkeds[checkbox.name] = {
215
- value: true,
216
- name: checkbox.name
217
- });
218
- !checkbox.checked && (checkeds[checkbox.name] = {
219
- value: false,
220
- name: checkbox.name
221
- });
222
- if (checkbox.name === name) {
223
- retVal = checkbox.checked;
224
- }
225
- });
226
- return retVal;
227
- }
228
- handleChange() {
229
- let checkeds = {};
230
- let changes = {};
231
- let checkboxes = [];
232
- checkboxes = this.getAllInputs();
233
- checkboxes.map(checkbox => {
234
- checkbox.checked && (checkeds[checkbox.name] = {
235
- value: true,
236
- name: checkbox.name
237
- });
238
- changes[checkbox.name] = {
239
- value: checkbox.checked ? true : false,
240
- name: checkbox.name
241
- };
242
- });
243
- this.groupChange.emit(changes);
244
- this.groupCheckedList.emit(checkeds);
245
- }
246
- render() {
247
- const { checkboxesProp, indeterminate, disabled, label, required, captionType } = this;
248
- const groupContainerClasses = classnames('group-container', this.direction, this.optionType, this.fullWidth, {
249
- 'full-width': this.fullWidth
250
- });
251
- const indeterminateClasses = classnames('indeterminate', 'bcm-' + this.indeterminateState, {
252
- 'disabled': disabled
253
- });
254
- const hostClasses = classnames(this.hidden ? 'hidden' : null, {
255
- 'error': captionType == 'error' ? true : false
256
- });
257
- var customStyle = {};
258
- this.gap && (customStyle = { 'gap': this.gap });
259
- return (h(Host, { class: hostClasses, "on-bcm-change": () => this.inputChange() }, label && h("label", { class: "label size-1" }, " ", label, " ", required && ('*'), " "), indeterminate && (h("div", { class: indeterminateClasses }, h("input", { id: "bcm-indeterminate-element", type: "checkbox", disabled: disabled }), h("label", { htmlFor: "bcm-indeterminate-element", "on-click": () => this.indeterminateClick() }, h("span", null, h("bcm-icon", { class: "icon-checked", icon: "component-check", size: "small", type: "default" })), "Check All"))), h("div", { class: groupContainerClasses, style: customStyle }, checkboxesProp && this.checkboxesProp.map((checkbox) => h("bcm-checkbox", { name: checkbox.name, checked: checkbox.checked, disabled: checkbox.disabled, required: this.required === true && checkbox.required === true && (true), noCaption: this.noCaption, optionType: this.optionType, buttonStyle: this.buttonStyle, size: this.size, "full-width": this.fullWidth }, checkbox.label)), h("slot", null))));
260
- }
261
- get el() { return getElement(this); }
262
- static get watchers() { return {
263
- "defaultValue": ["parseOptions"],
264
- "items": ["parseItems"]
265
- }; }
266
- };
267
- BcmCheckboxGroup.style = groupCss;
268
-
269
- export { BcmCheckboxGroup as bcm_checkbox_group };
@@ -1,139 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-8fe7aea4.js';
2
- import { c as classnames } from './index-e58a2d48.js';
3
- import { C as ColorPalette } from './colors-7c7b35e9.js';
4
- import { e as extractColor } from './utils-b7fba7c4.js';
5
-
6
- /**
7
- * 'color' prop predefined values
8
- */
9
- var ColorProps;
10
- (function (ColorProps) {
11
- ColorProps["black"] = "black";
12
- ColorProps["white"] = "white";
13
- ColorProps["prime-blue"] = "prime-blue";
14
- ColorProps["grey"] = "grey";
15
- ColorProps["blue"] = "blue";
16
- ColorProps["warmyellow"] = "warmyellow";
17
- ColorProps["yellow"] = "yellow";
18
- ColorProps["limegreen"] = "limegreen";
19
- ColorProps["red"] = "red";
20
- ColorProps["darkorange"] = "darkorange";
21
- ColorProps["orange"] = "orange";
22
- ColorProps["green"] = "green";
23
- ColorProps["turquosie"] = "turquosie";
24
- ColorProps["cobaltblue"] = "cobaltblue";
25
- ColorProps["magenta"] = "magenta";
26
- ColorProps["purple"] = "purple";
27
- ColorProps["bc-red"] = "bc-red";
28
- ColorProps["bc-blue"] = "bc-blue";
29
- ColorProps["bc-green"] = "bc-green";
30
- ColorProps["bc-orange"] = "bc-orange";
31
- })(ColorProps || (ColorProps = {}));
32
-
33
- const checkboxCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}:host{display:inline-block}:host(.hidden){display:none}input{display:none}.svg-icon{filter:brightness(0) invert(1);width:12px;height:12px}label{display:flex;align-items:flex-start;font-size:14px;color:var(--bcm-color-grey-8);cursor:pointer}label span.icon{display:flex;align-items:center;justify-content:center;min-width:16px;min-height:16px;border:1px solid #D9D9D9;margin-right:8px;border-radius:2px;margin-top:2px;background-color:var(--bcm-color-grey-1)}:host(.indeterminate) label span.icon{position:relative}:host(.indeterminate) label span.icon::after{content:\"\";position:absolute;top:50%;left:8px;width:10px;height:10px;background-color:var(--bcm-color-prime-blue-6);transform:translate(-50%, -50%);opacity:1;z-index:1}:host(.indeterminate) label span.icon::before{content:\"\";position:absolute;top:-1px;left:-1px;width:16px;height:100%;border-radius:2px;background-color:var(--bcm-color-grey-1);border:1px solid var(--bcm-color-grey-5);opacity:1;z-index:1}:host(.indeterminate) label span.icon:hover:not(.disabled):before{border-color:var(--bcm-color-prime-blue-6);box-shadow:0px 2px 4px rgba(54, 121, 171, 0.5)}input:checked+label span.icon{background-color:var(--bcm-color-prime-blue-6);border-color:transparent}input:checked+label .icon-checked{display:block}bcm-icon{filter:brightness(0) invert(1)}input[disabled]+label{cursor:not-allowed}input[disabled]+label span.icon{background-color:var(--bcm-color-grey-3);border-color:var(--bcm-color-grey-5)}input[disabled]+label bcm-icon{filter:brightness(0);opacity:0.3}input:not([disabled])+label:hover span.icon{border-color:var(--bcm-color-prime-blue-6);box-shadow:0px 2px 4px rgba(54, 121, 171, 0.5)}:host(.error) input:not([disabled])+label span.icon{border-color:var(--bcm-color-red-6)}.caption-area{margin-bottom:8px;min-height:20px;display:block}.input-caption{display:block}.caption-default{color:#8C8C8C}.caption-primary{color:#4293CF}.caption-success{color:#52C41A}.caption-warning{color:#FA8C16}.caption-error{color:#F5222D}.radio-button{background-color:var(--bcm-color-grey-1);color:var(--bcm-color-grey-8);border:1px solid var(--bcm-color-grey-5);padding:0 16px;box-sizing:border-box;display:flex;align-items:center;justify-content:center}.radio-button>span.icon{display:none}.radio-button>span.slot{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;user-select:none}.radio-button:hover:not(.disabled){color:var(--bcm-color-prime-blue-5)}.radio-button:active:not(.disabled){color:var(--bcm-color-prime-blue-7)}.radio-button.disabled{background-color:var(--bcm-color-grey-3);color:var(--bcm-color-grey-6);cursor:not-allowed}.radio-button.checked.disabled{background-color:var(--bcm-color-grey-4);color:var(--bcm-color-grey-1);border-color:var(--bcm-color-grey-5)}.radio-button.checked.solid{color:var(--bcm-color-grey-1);background-color:var(--bcm-color-prime-blue-6);border-color:var(--bcm-color-prime-blue-6)}.radio-button.checked.solid:hover{background-color:var(--bcm-color-prime-blue-5);border-color:var(--bcm-color-prime-blue-5)}.radio-button.checked.solid:active{background-color:var(--bcm-color-prime-blue-7);border-color:var(--bcm-color-prime-blue-7)}.radio-button.checked.outline{background-color:var(--bcm-color-grey-1);color:var(--bcm-color-prime-blue-6);border-color:var(--bcm-color-prime-blue-6)}.radio-button.checked.outline:hover{color:var(--bcm-color-prime-blue-5);border-color:var(--bcm-color-prime-blue-5)}.radio-button.checked.outline:active{color:var(--bcm-color-prime-blue-7);border-color:var(--bcm-color-prime-blue-7)}.radio-button.large{height:40px}.radio-button.medium{height:32px}.radio-button.small{height:24px}";
34
-
35
- const BcmCheckbox = class {
36
- constructor(hostRef) {
37
- registerInstance(this, hostRef);
38
- this.blur = createEvent(this, "bcm-blur", 7);
39
- this.focus = createEvent(this, "bcm-focus", 7);
40
- this.change = createEvent(this, "bcm-change", 7);
41
- /**
42
- * Component Properties
43
- */
44
- this.value = '';
45
- this.name = 'checkbox';
46
- this.checked = false;
47
- this.disabled = false;
48
- this.readOnly = false;
49
- this.hidden = false;
50
- this.required = false;
51
- this.optionType = 'default';
52
- this.buttonStyle = 'solid';
53
- this.size = 'medium';
54
- this.noCaption = false;
55
- this.captionType = 'default';
56
- }
57
- /**
58
- * @ComponentMethod
59
- */
60
- connectedCallback() {
61
- this.handleChange = this.handleChange.bind(this);
62
- this.captionCache = this.caption;
63
- this.captionTypeCache = this.captionType;
64
- }
65
- async setClear() {
66
- if (this.inputElement.checked == true) {
67
- this.inputElement.checked = false;
68
- this.handleChange();
69
- }
70
- }
71
- async resetCaption() {
72
- this.caption = this.captionCache;
73
- this.captionType = this.captionTypeCache;
74
- this.captionError = null;
75
- }
76
- componentDidLoad() {
77
- this.value = this.inputElement.checked;
78
- this.checked = this.value;
79
- }
80
- /**
81
- * @desc
82
- * @param event
83
- * @returns
84
- */
85
- handleChange() {
86
- this.value = this.inputElement.checked;
87
- this.checked = this.value;
88
- this.change.emit({
89
- name: this.name,
90
- value: this.value
91
- });
92
- }
93
- handleFocus() {
94
- this.focus.emit();
95
- }
96
- handleBlur() {
97
- this.blur.emit();
98
- }
99
- /**
100
- * @desc
101
- * @param name -
102
- * @returns {void}
103
- */
104
- async check(uncheck) {
105
- this.inputElement.checked = uncheck;
106
- this.handleChange();
107
- }
108
- getColor(color) {
109
- if (this.color !== 'default' && this.optionType == 'button' && this.checked)
110
- return {
111
- // color: extractColor(ColorPalette, ColorProps[color] + '-6'),
112
- borderColor: extractColor(ColorPalette, ColorProps[color] + '-5'),
113
- backgroundColor: extractColor(ColorPalette, ColorProps[color] + '-5')
114
- };
115
- }
116
- render() {
117
- const { disabled, checked, readOnly, name, handleChange, required, caption, captionError, captionType, noCaption, buttonStyle, size, optionType } = this;
118
- const hostClasses = classnames(this.hidden ? 'hidden' : null, {
119
- 'error': captionType == 'error' ? true : false
120
- });
121
- const captionClasses = classnames('size-1', 'input-caption', 'caption-' + captionType);
122
- const defaultClasses = classnames();
123
- const buttonClasses = classnames('radio-button', buttonStyle, size, {
124
- 'size-2': size === 'small' || size === 'medium',
125
- 'size-3': size === 'large',
126
- 'checked': checked,
127
- 'disabled': disabled,
128
- });
129
- var fontColor = extractColor(ColorPalette, ColorProps[this.color] + '-6');
130
- var style = "<style>.radio-button:not(.checked):hover{color: " + fontColor + "} </style>";
131
- return (h(Host, { class: hostClasses, onFocus: () => this.handleFocus(), onBlur: () => this.handleBlur() }, h("input", { id: name, type: "checkbox", checked: checked, disabled: disabled, required: required, readOnly: readOnly, onChange: handleChange, ref: el => (this.inputElement = el) }), optionType == 'button' && (h("span", { innerHTML: style })), h("label", { title: optionType == 'button' ? this.el.innerHTML : null, htmlFor: name, class: optionType == 'default' ? defaultClasses : buttonClasses, style: this.getColor(this.color) }, h("span", { class: "icon" }, h("bcm-icon", { class: "icon-checked", icon: "component-check", size: "small", type: "default" })), h("span", { class: "slot" }, h("slot", null))), !noCaption && (h("div", { class: "caption-area" }, captionType == "error"
132
- ? h("span", { class: captionClasses }, " ", captionError, " ")
133
- : caption && h("span", { class: captionClasses }, " ", caption, " ")))));
134
- }
135
- get el() { return getElement(this); }
136
- };
137
- BcmCheckbox.style = checkboxCss;
138
-
139
- export { BcmCheckbox as bcm_checkbox };
@@ -1,82 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host } from './index-8fe7aea4.js';
2
- import { c as classnames } from './index-e58a2d48.js';
3
-
4
- const switchCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}:host{display:inline-block;width:100%;margin:0 0 8px 0}:host(.hidden){display:none}*{box-sizing:border-box}.wrapper{display:inline-flex;padding-top:0px;padding-bottom:5px}.wrapper .active-text{color:var(--bcm-color-prime-blue-6);margin-left:4px}.wrapper .inactive-text{color:var(--bcm-color-grey-6);margin-right:4px}.container{display:flex;justify-content:space-between;align-items:center;border-radius:16px;background-color:var(--bcm-color-grey-6);position:relative}.container .handle{padding:1px;position:absolute;background-color:var(--bcm-color-grey-1);display:inline-flex;align-items:center;justify-content:center;border-radius:16px;transition:all 0.2s ease-in-out;box-shadow:0px 2px 2px rgba(0, 0, 0, 0.1), 0px 3px 1px rgba(0, 0, 0, 0.05), 0px 1px 5px rgba(0, 0, 0, 0.1)}.container .icon-active{opacity:0}.container .icon-inactive{opacity:1}.container.small{width:28px;min-width:28px;height:16px;padding:4px}.container.small .handle{width:12px;height:12px;left:4px}.container.small.switch-checked .handle{left:12px}.container.small:active:not(.disabled) .handle{width:16px}.container.small:active.switch-checked:not(.disabled) .handle{left:8px}.container.small .spinner{box-sizing:border-box;display:inline-flex;width:9px;height:9px;border-radius:50%;border:1px solid var(--bcm-color-grey-1);border-top-color:var(--bcm-color-grey-6);animation:spinner 1.5s linear infinite}.container.medium{width:44px;min-width:44px;height:22px;padding:4px}.container.medium .handle{width:16px;height:16px;left:4px}.container.medium.switch-checked .handle{left:24px}.container.medium:active:not(.disabled) .handle{width:22px}.container.medium:active.switch-checked:not(.disabled) .handle{left:18px}.container.medium .spinner{box-sizing:border-box;display:inline-flex;width:13px;height:13px;border-radius:50%;border:1px solid var(--bcm-color-grey-1);border-top-color:var(--bcm-color-grey-6);animation:spinner 1.5s linear infinite}.container.switch-checked{background-color:var(--bcm-color-prime-blue-6)}.container.switch-checked .icon-active{color:var(--bcm-color-grey-1);opacity:1}.container.switch-checked .icon-inactive{opacity:0}.container.switch-checked .spinner{border-top-color:var(--bcm-color-prime-blue-6)}.wrapper.disabled{opacity:40%;cursor:not-allowed}@keyframes spinner{to{transform:rotate(360deg)}}input[type=checkbox]{position:absolute;width:0;height:0;opacity:0}.label{display:flex;flex-direction:column;color:var(--bcm-color-grey-9);padding-right:4px;margin-right:8px;margin-bottom:8px}.caption-area{min-height:20px}.input-caption{display:block}:host(.error) .label{color:var(--bcm-color-red-6) !important}.caption-default{color:#8C8C8C}.caption-primary{color:#4293CF}.caption-success{color:#52C41A}.caption-warning{color:#FA8C16}.caption-error{color:#F5222D}";
5
-
6
- const BcmSwitch = class {
7
- constructor(hostRef) {
8
- registerInstance(this, hostRef);
9
- this.change = createEvent(this, "bcm-change", 7);
10
- this.focus = createEvent(this, "bcm-focus", 7);
11
- this.blur = createEvent(this, "bcm-blur", 7);
12
- this.checked = false;
13
- this.size = 'medium';
14
- this.pending = false;
15
- this.disabled = false;
16
- this.hidden = false;
17
- this.value = '';
18
- this.label = null;
19
- this.required = false;
20
- this.noCaption = false;
21
- this.captionType = 'default';
22
- }
23
- connectedCallback() {
24
- this.captionCache = this.caption;
25
- this.captionTypeCache = this.captionType;
26
- }
27
- handleClick() {
28
- this.checked = this.input.checked;
29
- this.value = this.checked;
30
- this.change.emit(this.checked);
31
- }
32
- componentDidLoad() {
33
- this.value = this.checked;
34
- }
35
- handleFocus() {
36
- this.focus.emit();
37
- }
38
- handleBlur() {
39
- this.blur.emit();
40
- }
41
- componentWillRender() {
42
- if (this.pending) {
43
- this.disabled = true;
44
- }
45
- }
46
- async setClear() {
47
- if (this.input.checked == true) {
48
- this.input.checked = false;
49
- this.checked = this.input.checked;
50
- this.value = this.checked;
51
- this.change.emit(this.checked);
52
- }
53
- }
54
- async resetCaption() {
55
- this.caption = this.captionCache;
56
- this.captionType = this.captionTypeCache;
57
- this.captionError = null;
58
- }
59
- render() {
60
- const { checked, size, activeIcon, inactiveIcon, activeText, inactiveText, pending, disabled, label, required, noCaption, captionType, captionError, caption } = this;
61
- const classes = classnames('container', size, {
62
- 'switch-checked': checked,
63
- 'disabled': disabled
64
- });
65
- const wrapperClass = classnames('wrapper', {
66
- 'checked': checked,
67
- 'disabled': disabled
68
- });
69
- const captionClasses = classnames('size-1', 'input-caption', 'caption-' + captionType);
70
- const isPermitted = (condition) => {
71
- return (condition && size === 'medium');
72
- };
73
- const isMedium = size === 'medium';
74
- const hostClasses = classnames('switch', this.hidden ? 'hidden' : null);
75
- return (h(Host, { class: hostClasses }, label && h("label", { class: "label size-1" }, " ", label, " ", required && ('*'), " "), h("label", { class: wrapperClass }, isPermitted(inactiveText) && h("span", { class: "inactive-text size-1" }, inactiveText), h("div", { class: classes }, isMedium && h("bcm-icon", { icon: activeIcon, size: 14, class: "icon-active" }), h("span", { class: "handle" }, pending && h("span", { class: "spinner" })), isMedium && h("bcm-icon", { icon: inactiveIcon, size: 14, class: "icon-inactive" })), h("input", { onClick: () => this.handleClick(), onFocus: () => this.handleFocus(), onBlur: () => this.handleBlur(), ref: el => (this.input = el), checked: checked, type: "checkbox", class: "switch", disabled: disabled }), isPermitted(activeText) && h("span", { class: "active-text size-1" }, activeText)), !noCaption && (h("div", { class: "caption-area" }, captionType == "error"
76
- ? h("span", { class: captionClasses }, " ", captionError, " ")
77
- : caption && h("span", { class: captionClasses }, " ", caption, " ")))));
78
- }
79
- };
80
- BcmSwitch.style = switchCss;
81
-
82
- export { BcmSwitch as bcm_switch };