bromcom-ui 2.10.1-rc.2 → 2.10.1-rc.4
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.
- package/dist/bromcom-ui/bromcom-ui.css +1 -1
- package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
- package/dist/bromcom-ui/p-000670b6.js +5 -0
- package/dist/bromcom-ui/{p-7149c15e.entry.js → p-0c54af0a.entry.js} +1 -1
- package/dist/bromcom-ui/{p-b77e861c.entry.js → p-10661efa.entry.js} +1 -1
- package/dist/bromcom-ui/{p-893ecfd7.entry.js → p-135056db.entry.js} +1 -1
- package/dist/bromcom-ui/{p-7814999e.entry.js → p-1772657f.entry.js} +1 -1
- package/dist/bromcom-ui/{p-bc26bfcc.entry.js → p-182eccc7.entry.js} +1 -1
- package/dist/bromcom-ui/{p-9f67eec6.entry.js → p-1bd9d245.entry.js} +1 -1
- package/dist/bromcom-ui/{p-69eb7be7.entry.js → p-1d14255e.entry.js} +1 -1
- package/dist/bromcom-ui/{p-fcfc1a26.entry.js → p-2dd5f6ad.entry.js} +1 -1
- package/dist/bromcom-ui/{p-8c1834d9.entry.js → p-2dda9287.entry.js} +1 -1
- package/dist/bromcom-ui/{p-82caef35.entry.js → p-30618ac6.entry.js} +1 -1
- package/dist/bromcom-ui/{p-f4af4e66.entry.js → p-359d9ed7.entry.js} +1 -1
- package/dist/bromcom-ui/p-3b705d79.entry.js +5 -0
- package/dist/bromcom-ui/{p-f3133898.entry.js → p-412a472d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-9c31bd27.js → p-4246ca4f.js} +1 -1
- package/dist/bromcom-ui/{p-95e3e645.entry.js → p-4d0046a0.entry.js} +1 -1
- package/dist/bromcom-ui/{p-313f3908.entry.js → p-56212e24.entry.js} +1 -1
- package/dist/bromcom-ui/{p-5b5f9b00.entry.js → p-5b05c344.entry.js} +1 -1
- package/dist/bromcom-ui/{p-c8b1c1c6.entry.js → p-5f74a6c9.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d9ecc3d8.entry.js → p-5ff2ae19.entry.js} +1 -1
- package/dist/bromcom-ui/{p-027e818d.entry.js → p-60e4f239.entry.js} +1 -1
- package/dist/bromcom-ui/{p-bda74b16.entry.js → p-63963eca.entry.js} +1 -1
- package/dist/bromcom-ui/{p-b193eb3a.entry.js → p-686e614c.entry.js} +1 -1
- package/dist/bromcom-ui/{p-f84d2e42.entry.js → p-7471cbf5.entry.js} +1 -1
- package/dist/bromcom-ui/{p-cae90479.entry.js → p-76556edf.entry.js} +1 -1
- package/dist/bromcom-ui/{p-4e5006b1.entry.js → p-78d95876.entry.js} +1 -1
- package/dist/bromcom-ui/{p-9b9f36d5.entry.js → p-7908ee85.entry.js} +1 -1
- package/dist/bromcom-ui/{p-57c9904b.entry.js → p-7c6238b7.entry.js} +1 -1
- package/dist/bromcom-ui/p-7f7b3465.entry.js +7 -0
- package/dist/bromcom-ui/{p-1064895e.js → p-823a5d13.js} +1 -1
- package/dist/bromcom-ui/{p-3ec44b04.entry.js → p-89513231.entry.js} +1 -1
- package/dist/bromcom-ui/{p-dc6e9205.entry.js → p-8b383614.entry.js} +1 -1
- package/dist/bromcom-ui/{p-06071e98.entry.js → p-8fa7df49.entry.js} +1 -1
- package/dist/bromcom-ui/{p-f7dbd393.entry.js → p-96c18c4e.entry.js} +1 -1
- package/dist/bromcom-ui/{p-f909d419.entry.js → p-994bc0b5.entry.js} +1 -1
- package/dist/bromcom-ui/{p-b2687899.entry.js → p-99a9bebb.entry.js} +1 -1
- package/dist/bromcom-ui/p-9b7af3c4.js +5 -0
- package/dist/bromcom-ui/p-9c6676f2.entry.js +5 -0
- package/dist/bromcom-ui/{p-43a281a4.js → p-9d7ec4f0.js} +1 -1
- package/dist/bromcom-ui/{p-b27218ea.entry.js → p-9f6fd146.entry.js} +1 -1
- package/dist/bromcom-ui/p-a18f6d11.js +5 -0
- package/dist/bromcom-ui/{p-21d98283.entry.js → p-a2583501.entry.js} +1 -1
- package/dist/bromcom-ui/{p-7f1681e2.entry.js → p-aa2f32bb.entry.js} +1 -1
- package/dist/bromcom-ui/p-abc44b58.entry.js +5 -0
- package/dist/bromcom-ui/{p-8cbae172.entry.js → p-acf307e1.entry.js} +1 -1
- package/dist/bromcom-ui/{p-be778e45.entry.js → p-ad8af495.entry.js} +1 -1
- package/dist/bromcom-ui/{p-4b8f90ef.js → p-b1f4ebad.js} +1 -1
- package/dist/bromcom-ui/{p-752057b7.entry.js → p-b36fe678.entry.js} +1 -1
- package/dist/bromcom-ui/{p-2ee20f32.entry.js → p-b5c650c6.entry.js} +1 -1
- package/dist/bromcom-ui/{p-2565ccce.js → p-b82041d3.js} +1 -1
- package/dist/bromcom-ui/{p-d498d79b.entry.js → p-c761e694.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d685ffff.entry.js → p-ca106284.entry.js} +1 -1
- package/dist/bromcom-ui/p-cb66612c.entry.js +5 -0
- package/dist/bromcom-ui/{p-33f3295e.entry.js → p-ced26b93.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d2f9f353.entry.js → p-d0fba40e.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d9331f0f.entry.js → p-d4b23073.entry.js} +1 -1
- package/dist/bromcom-ui/{p-55547a6e.entry.js → p-d4fb5ac0.entry.js} +1 -1
- package/dist/bromcom-ui/{p-56ec6518.entry.js → p-d9bbea7b.entry.js} +1 -1
- package/dist/bromcom-ui/{p-ceafe408.entry.js → p-dad263b2.entry.js} +1 -1
- package/dist/bromcom-ui/{p-84089734.entry.js → p-ea888f01.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e02e88fb.js → p-f0c03fb4.js} +1 -1
- package/dist/bromcom-ui/{p-cd567621.entry.js → p-f56a74bd.entry.js} +1 -1
- package/dist/bromcom-ui/{p-8846b944.entry.js → p-f667ee85.entry.js} +1 -1
- package/dist/bromcom-ui/{p-5da0f9ef.entry.js → p-fda7b812.entry.js} +1 -1
- package/dist/bromcom-ui/{p-fc1942c6.js → p-fe953a0b.js} +1 -1
- package/dist/cjs/bcm-accordion.cjs.entry.js +2 -2
- package/dist/cjs/bcm-alert.cjs.entry.js +2 -2
- package/dist/cjs/bcm-attendance.cjs.entry.js +2 -2
- package/dist/cjs/bcm-avatar_2.cjs.entry.js +4 -4
- package/dist/cjs/bcm-breadcrumb.cjs.entry.js +2 -2
- package/dist/cjs/bcm-button-group.cjs.entry.js +2 -2
- package/dist/cjs/{bcm-button_11.cjs.entry.js → bcm-button_12.cjs.entry.js} +172 -12
- package/dist/cjs/bcm-caption.cjs.entry.js +4 -4
- package/dist/cjs/bcm-card.cjs.entry.js +2 -2
- package/dist/cjs/bcm-checkbox-group.cjs.entry.js +3 -3
- package/dist/cjs/bcm-checkbox-lite_9.cjs.entry.js +2 -2
- package/dist/cjs/bcm-chip-group.cjs.entry.js +5 -5
- package/dist/cjs/bcm-chip.cjs.entry.js +2 -2
- package/dist/cjs/bcm-collapse.cjs.entry.js +2 -2
- package/dist/cjs/bcm-color-input.cjs.entry.js +4 -4
- package/dist/cjs/bcm-date-picker.cjs.entry.js +2 -2
- package/dist/cjs/bcm-datetime-picker.cjs.entry.js +3 -3
- package/dist/cjs/bcm-default.cjs.entry.js +2 -2
- package/dist/cjs/bcm-drawer.cjs.entry.js +4 -4
- package/dist/cjs/bcm-dropdown.cjs.entry.js +3 -3
- package/dist/cjs/bcm-expansion-panel.cjs.entry.js +2 -2
- package/dist/cjs/bcm-form-2.cjs.entry.js +2 -2
- package/dist/cjs/bcm-input-custom.cjs.entry.js +2 -2
- package/dist/cjs/bcm-input-dropdown.cjs.entry.js +4 -4
- package/dist/cjs/bcm-item.cjs.entry.js +2 -2
- package/dist/cjs/bcm-items.cjs.entry.js +2 -2
- package/dist/cjs/bcm-list_3.cjs.entry.js +7 -7
- package/dist/cjs/bcm-menu.cjs.entry.js +5 -5
- package/dist/cjs/bcm-modal-2-footer.cjs.entry.js +4 -4
- package/dist/cjs/bcm-modal-2-header.cjs.entry.js +4 -4
- package/dist/cjs/bcm-modal-2.cjs.entry.js +4 -4
- package/dist/cjs/bcm-modal.cjs.entry.js +2 -2
- package/dist/cjs/bcm-number-input.cjs.entry.js +109 -0
- package/dist/cjs/bcm-popconfirm-box.cjs.entry.js +2 -2
- package/dist/cjs/bcm-popconfirm.cjs.entry.js +2 -2
- package/dist/cjs/bcm-popover.cjs.entry.js +4 -4
- package/dist/cjs/bcm-progress.cjs.entry.js +2 -2
- package/dist/cjs/bcm-radio-group.cjs.entry.js +4 -4
- package/dist/cjs/bcm-radio.cjs.entry.js +4 -4
- package/dist/cjs/bcm-range.cjs.entry.js +2 -2
- package/dist/cjs/bcm-shortcut.cjs.entry.js +4 -4
- package/dist/cjs/bcm-skeleton.cjs.entry.js +4 -4
- package/dist/cjs/bcm-step.cjs.entry.js +3 -3
- package/dist/cjs/bcm-stepper.cjs.entry.js +5 -5
- package/dist/cjs/bcm-tab-group.cjs.entry.js +4 -4
- package/dist/cjs/bcm-tab-item-header.cjs.entry.js +4 -4
- package/dist/cjs/bcm-tab-item.cjs.entry.js +4 -4
- package/dist/cjs/bcm-table.cjs.entry.js +4 -4
- package/dist/cjs/bcm-tag.cjs.entry.js +3 -3
- package/dist/cjs/bcm-textarea.cjs.entry.js +3 -3
- package/dist/cjs/bcm-time-picker.cjs.entry.js +2 -2
- package/dist/cjs/bcm-toast.cjs.entry.js +2 -2
- package/dist/cjs/bcm-typography.cjs.entry.js +21 -0
- package/dist/cjs/bromcom-ui.cjs.js +3 -3
- package/dist/cjs/{generate-f0d6805e.js → generate-eb7fd62b.js} +1 -1
- package/dist/cjs/{global-c61c9656.js → global-1210b4ea.js} +1 -1
- package/dist/cjs/{input-template-38924cda.js → input-template-69fc22ac.js} +1 -1
- package/dist/cjs/{json-parse-decarator-a2024131.js → json-parse-decarator-2d4f7d88.js} +1 -1
- package/dist/cjs/{label-template-8dc10d0a.js → label-template-a6f51ef2.js} +6 -3
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{number-helper-7c3fefa2.js → number-helper-952bd974.js} +1 -1
- package/dist/cjs/old-bcm-popover-box.cjs.entry.js +3 -3
- package/dist/cjs/old-bcm-popover.cjs.entry.js +2 -2
- package/dist/cjs/{package-a737bf36.js → package-c0fd1b3c.js} +1 -1
- package/dist/cjs/{stepper-states-3b876d4d.js → stepper-states-79ced0f7.js} +1 -1
- package/dist/cjs/{tooltip-helper-f98dd7a7.js → tooltip-helper-20502cd7.js} +3 -3
- package/dist/cjs/{validators-f2869ecb.js → validators-18074a6e.js} +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/atoms/label/label.js +1 -1
- package/dist/collection/components/molecules/number-input/number-input.css +137 -0
- package/dist/collection/components/molecules/number-input/number-input.js +425 -0
- package/dist/collection/components/molecules/number-input/number-input.style.js +45 -0
- package/dist/collection/components/molecules/switch/switch.css +1 -0
- package/dist/collection/components/organism/list/list.css +2 -0
- package/dist/collection/templates/label-template.js +6 -6
- package/dist/components/bcm-number-input.d.ts +11 -0
- package/dist/components/bcm-number-input.js +157 -0
- package/dist/components/bcm-switch.js +1 -1
- package/dist/components/generate.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/label.js +7 -4
- package/dist/components/list.js +1 -1
- package/dist/esm/bcm-accordion.entry.js +2 -2
- package/dist/esm/bcm-alert.entry.js +2 -2
- package/dist/esm/bcm-attendance.entry.js +2 -2
- package/dist/esm/bcm-avatar_2.entry.js +4 -4
- package/dist/esm/bcm-breadcrumb.entry.js +2 -2
- package/dist/esm/bcm-button-group.entry.js +2 -2
- package/dist/esm/{bcm-button_11.entry.js → bcm-button_12.entry.js} +172 -13
- package/dist/esm/bcm-caption.entry.js +4 -4
- package/dist/esm/bcm-card.entry.js +2 -2
- package/dist/esm/bcm-checkbox-group.entry.js +3 -3
- package/dist/esm/bcm-checkbox-lite_9.entry.js +2 -2
- package/dist/esm/bcm-chip-group.entry.js +5 -5
- package/dist/esm/bcm-chip.entry.js +2 -2
- package/dist/esm/bcm-collapse.entry.js +2 -2
- package/dist/esm/bcm-color-input.entry.js +4 -4
- package/dist/esm/bcm-date-picker.entry.js +2 -2
- package/dist/esm/bcm-datetime-picker.entry.js +3 -3
- package/dist/esm/bcm-default.entry.js +2 -2
- package/dist/esm/bcm-drawer.entry.js +4 -4
- package/dist/esm/bcm-dropdown.entry.js +3 -3
- package/dist/esm/bcm-expansion-panel.entry.js +2 -2
- package/dist/esm/bcm-form-2.entry.js +2 -2
- package/dist/esm/bcm-input-custom.entry.js +2 -2
- package/dist/esm/bcm-input-dropdown.entry.js +4 -4
- package/dist/esm/bcm-item.entry.js +2 -2
- package/dist/esm/bcm-items.entry.js +2 -2
- package/dist/esm/bcm-list_3.entry.js +7 -7
- package/dist/esm/bcm-menu.entry.js +5 -5
- package/dist/esm/bcm-modal-2-footer.entry.js +4 -4
- package/dist/esm/bcm-modal-2-header.entry.js +4 -4
- package/dist/esm/bcm-modal-2.entry.js +4 -4
- package/dist/esm/bcm-modal.entry.js +2 -2
- package/dist/esm/bcm-number-input.entry.js +105 -0
- package/dist/esm/bcm-popconfirm-box.entry.js +2 -2
- package/dist/esm/bcm-popconfirm.entry.js +2 -2
- package/dist/esm/bcm-popover.entry.js +4 -4
- package/dist/esm/bcm-progress.entry.js +2 -2
- package/dist/esm/bcm-radio-group.entry.js +4 -4
- package/dist/esm/bcm-radio.entry.js +4 -4
- package/dist/esm/bcm-range.entry.js +2 -2
- package/dist/esm/bcm-shortcut.entry.js +4 -4
- package/dist/esm/bcm-skeleton.entry.js +4 -4
- package/dist/esm/bcm-step.entry.js +3 -3
- package/dist/esm/bcm-stepper.entry.js +5 -5
- package/dist/esm/bcm-tab-group.entry.js +4 -4
- package/dist/esm/bcm-tab-item-header.entry.js +4 -4
- package/dist/esm/bcm-tab-item.entry.js +4 -4
- package/dist/esm/bcm-table.entry.js +4 -4
- package/dist/esm/bcm-tag.entry.js +3 -3
- package/dist/esm/bcm-textarea.entry.js +3 -3
- package/dist/esm/bcm-time-picker.entry.js +2 -2
- package/dist/esm/bcm-toast.entry.js +2 -2
- package/dist/esm/bcm-typography.entry.js +17 -0
- package/dist/esm/bromcom-ui.js +3 -3
- package/dist/esm/{generate-fff9c034.js → generate-aae94409.js} +1 -1
- package/dist/esm/{global-446a0022.js → global-8975e389.js} +1 -1
- package/dist/esm/{input-template-ff26f463.js → input-template-6b597dcd.js} +1 -1
- package/dist/esm/{json-parse-decarator-3e533274.js → json-parse-decarator-84d6e52c.js} +1 -1
- package/dist/esm/{label-template-989d1700.js → label-template-ad2e8119.js} +6 -3
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{number-helper-c1ee913b.js → number-helper-8dade9f3.js} +1 -1
- package/dist/esm/old-bcm-popover-box.entry.js +3 -3
- package/dist/esm/old-bcm-popover.entry.js +2 -2
- package/dist/esm/{package-7d8bb462.js → package-d5af5a81.js} +1 -1
- package/dist/esm/{stepper-states-500cb902.js → stepper-states-6923dc97.js} +1 -1
- package/dist/esm/{tooltip-helper-c22623e4.js → tooltip-helper-e0f7ed97.js} +3 -3
- package/dist/esm/{validators-93758ad4.js → validators-1e7b9d1d.js} +1 -1
- package/dist/types/components/molecules/number-input/number-input.d.ts +29 -0
- package/dist/types/components/molecules/number-input/number-input.style.d.ts +200 -0
- package/dist/types/components.d.ts +53 -0
- package/dist/types/templates/label-template.d.ts +2 -1
- package/package.json +1 -1
- package/dist/bromcom-ui/p-0208acef.entry.js +0 -7
- package/dist/bromcom-ui/p-0e2cff0d.js +0 -5
- package/dist/bromcom-ui/p-84307b0c.entry.js +0 -5
- package/dist/bromcom-ui/p-8b202d9e.js +0 -5
- package/dist/bromcom-ui/p-c35c11a7.js +0 -5
- package/dist/bromcom-ui/p-d2fe5024.entry.js +0 -5
- package/dist/bromcom-ui/p-f9739222.entry.js +0 -5
- package/dist/cjs/bcm-checkbox_2.cjs.entry.js +0 -194
- package/dist/esm/bcm-checkbox_2.entry.js +0 -189
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Stencil
|
|
3
|
-
* Copyright (c) Bromcom.
|
|
4
|
-
*/
|
|
5
|
-
import{s as a}from"./p-43a281a4.js";class f{}f.compareTwoArrayIsSame=(f,d)=>a((()=>f.length===d.length&&f.every(((a,f)=>a===d[f])))),f.isEmailValid=a=>/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(a),f.isUrlValid=a=>/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/\S*)?$/i.test(a),f.isNumberValid=a=>/^[+-]?\d+$/.test(a),f.isNumberFloatValid=a=>/^\d+(\.\d+)?$/.test(a),f.isPhoneValid=a=>/^(?=.*[0-9])[- +()0-9]+$/.test(a),f.pattern=(a,f)=>new RegExp(f).test(a),f.isValidate=(a,d)=>{switch(d){case"email":return f.isEmailValid(a);case"url":return f.isUrlValid(a);case"number":return f.isNumberValid(a)||f.isNumberFloatValid(a);case"phone":return f.isPhoneValid(a);default:return!0}};export{f as V}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Stencil
|
|
3
|
-
* Copyright (c) Bromcom.
|
|
4
|
-
*/
|
|
5
|
-
import{r as c,c as e,h as o,H as i,g as r}from"./p-170cf07d.js";import{c as b}from"./p-64fad38b.js";import{C as a}from"./p-a25c8a55.js";import{G as n}from"./p-43a281a4.js";import{S as t}from"./p-f800e665.js";import{B as l}from"./p-6369b73b.js";import{d as m}from"./p-8c018ae0.js";import{C as h}from"./p-61db1f1f.js";import{I as s}from"./p-9850cbce.js";import"./p-85eedabc.js";import"./p-1064895e.js";import"./p-6edf985f.js";import"./p-157359d6.js";import"./p-436364c8.js";const d=class{constructor(o){c(this,o),this.blur=e(this,"bcm-blur",7),this.focus=e(this,"bcm-focus",7),this.change=e(this,"bcm-change",7),this.changeCheckbox=e(this,"bcm-change-checkbox",7),this._id=n.UID(),this.inGroup=!1,this.value=!1,this.checked=!1,this.name=void 0,this.disabled=!1,this.hidden=!1,this.required=!1,this.label=void 0,this.readonly=!1,this.size=l.Size.medium,this.indeterminate=null,this.color="blue",this.caption=void 0,this.noCaption=!1,this.captionError=void 0,this.captionType=l.Status.default,this.captionCache=void 0,this.captionTypeCache=void 0}connectedCallback(){this.captionCache=this.caption,this.captionTypeCache=this.captionType,this.value=this.checked}componentDidRender(){this.inputElement.checked=this.checked}async onBcmFocus(){this.el.focus()}async onBcmBlur(){this.el.blur()}async setClear(){return this.check(!1),this.handleChange(),await m(10),Promise.resolve()}async resetCaption(){return await m(10),this.caption=this.captionCache,this.captionType=this.captionTypeCache,this.captionError=null,await m(10),Promise.resolve()}handleChange(){this.checked=this.inputElement.checked,this.value=this.checked,this.indeterminate||(this.changeCheckbox.emit(),this.change.emit({name:this.name,value:this.checked}))}watchIndeterminate(c,e){c!=e&&(this.inputElement.checked=this.indeterminate==l.IndeterminateType.determinate,this.handleChange())}async set(c){"boolean"==typeof c&&await this.check(c)}async get(){return this.checked||!1}async check(c=!0){this.inputElement.checked=c,this.handleChange()}handleKeyUp(c){if(c.keyCode==l.KeyCode.space||c.keyCode==l.KeyCode.enter)return this.disabled||this.readonly||(this.inputElement.checked=!this.inputElement.checked,this.handleChange()),c.stopPropagation(),c.preventDefault(),!1}watchChecked(){this.checked&&this.resetCaption(),this.value=this.checked}setColor(c=this.color){if(!c)return;const e="--bcm-checkbox";return{[`${e}-primary-color-default`]:h.dsColor(c+"-500"),[`${e}-primary-color-hover`]:h.dsColor(c+"-600"),[`${e}-primary-color-focus-visible`]:h.dsColor(c+"-800"),[`${e}-primary-color-active`]:h.dsColor(c+"-700"),[`${e}-secondary-color-default`]:h.dsColor("white"),[`${e}-secondary-color-hover`]:h.dsColor("slate-50"),[`${e}-secondary-color-focus-visible`]:h.dsColor("slate-50"),[`${e}-secondary-color-active`]:h.dsColor("slate-50")}}render(){const{label:c,_id:e,indeterminate:r,hidden:n,disabled:m,checked:h,readonly:s,required:d,caption:x,captionError:p,captionType:k,noCaption:_,size:g}=this,u=b("bcm-checkbox",`bcm-checkbox-size-${g}`,{error:k==l.Status.error,hidden:n,checked:h,disabled:m,required:d,readonly:s}),v=b("bcm-checkbox__label-icon","bcm-checkbox__label-icon-lite","bcm-checkbox__label-icon-"+r,{"bcm-checkbox__label-icon-checked":h}),f=b("bcm-checkbox__label"),y=b("bcm-checkbox__input");return o(i,{tabindex:"0",onFocus:()=>this.focus.emit(this.el),onBlur:()=>this.blur.emit(this.el),style:this.setColor(this.color),class:u,disabled:m},o("span",{hidden:!0},o("slot",null)),c&&o("bcm-label",{htmlFor:`input-${e}`,type:k,value:c,required:d}),o("div",{class:y},o("input",{id:`input-${e}`,type:"checkbox",checked:h,disabled:m,required:d,readonly:s,onChange:()=>{!m&&!s&&this.handleChange()},ref:c=>this.inputElement=c}),o("label",{class:f,htmlFor:`input-${e}`},o("span",{class:v},o("bcm-icon",{icon:"far fa-check"})),o(t,{className:"slot"}))),o(a,{noCaption:_,captionType:k,captionError:p,caption:x}))}get el(){return r(this)}static get watchers(){return{indeterminate:["watchIndeterminate"],checked:["watchChecked"]}}};(function(c,e,o,i){var r,b=arguments.length,a=b<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(c,e,o,i);else for(var n=c.length-1;n>=0;n--)(r=c[n])&&(a=(b<3?r(a):b>3?r(e,o,a):r(e,o))||a);b>3&&a&&Object.defineProperty(e,o,a)})([s()],d.prototype,"el",void 0),d.style='@import url("https://fonts.googleapis.com/css?family=Roboto:400,500");@import url("https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap"); .size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}.bcm-input[no-margin]{margin:0}.bcm-textarea[no-margin]{margin:0}.bcm-switch[no-margin]{margin:0}.bcm-checkbox[no-margin]{margin:0}.bcm-radio-group[no-margin]{margin:0}.bcm-checkbox-group[no-margin]{margin:0}.bcm-range[no-margin]{margin:0}.bcm-form[no-margin]{margin:0}.bcm-form-group[no-margin]{margin:0}.bcm-list[no-margin]{margin:0}.bcm-colorpicker[no-margin]{margin:0}.bcm-date-picker[no-margin]{margin:0}.bcm-time-picker[no-margin]{margin:0}.bcm-datetime-picker[no-margin]{margin:0}.bcm-select[no-margin]{margin:0}.bcm-listbox[no-margin]{margin:0}*{box-sizing:border-box}.bcm-checkbox{outline:none;border:none;--bcm-checkbox-primary-color-default:var(--bcm-new-ds-color-blue-500);--bcm-checkbox-secondary-color-default:var(--bcm-new-ds-color-white);--bcm-checkbox-primary-color-hover:var(--bcm-new-ds-color-blue-600);--bcm-checkbox-secondary-color-hover:var(--bcm-new-ds-color-slate-50);--bcm-checkbox-primary-color-focus-visible:var(--bcm-new-ds-color-blue-800);--bcm-checkbox-secondary-color-focus-visible:var(--bcm-new-ds-color-slate-50);--bcm-checkbox-primary-color-active:var(--bcm-new-ds-color-blue-700);--bcm-checkbox-secondary-color-active:var(--bcm-new-ds-color-slate-50);--bcm-checkbox-primary-color-disabled:var(--bcm-new-ds-color-slate-300);--bcm-checkbox-secondary-color-disabled:var(--bcm-new-ds-color-slate-200);display:inline-flex;width:fit-content;flex-direction:column;margin-bottom:8px}.bcm-checkbox:focus,.bcm-checkbox:hover,.bcm-checkbox:active{outline:none;border:none}.bcm-checkbox *{box-sizing:border-box}.bcm-checkbox input[type=radio],.bcm-checkbox input[type=checkbox]{-webkit-appearance:none;appearance:none;background-color:#fff;margin:0;display:none}.bcm-checkbox__input{display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-start;flex-wrap:nowrap;padding-top:4px}.bcm-checkbox.hidden{display:none}.bcm-checkbox :hover{cursor:pointer}.bcm-checkbox[disabled] :hover,.bcm-checkbox.disabled :hover{cursor:not-allowed}.bcm-checkbox .slot{font-family:"Inter", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;font-weight:500;color:var(--bcm-new-ds-color-slate-600)}.bcm-checkbox .slot:not(:empty){margin-left:8px;margin-right:8px}.bcm-checkbox-size-small .slot{font-size:12px;line-height:calc(12px + 8px);margin-top:-2.5px}.bcm-checkbox-size-small .bcm-checkbox__input{min-height:calc(24px - 4px)}.bcm-checkbox-size-small .bcm-checkbox__label-icon{width:14px;height:14px;min-width:14px;font-size:calc(10px - 2px)}.bcm-checkbox-size-medium .slot{font-size:calc(12px + 1px);line-height:calc(12px + 8px);margin-top:-1.5px}.bcm-checkbox-size-medium .bcm-checkbox__input{min-height:calc(32px - 4px)}.bcm-checkbox-size-medium .bcm-checkbox__label-icon{width:16px;height:16px;min-width:16px;font-size:10px}.bcm-checkbox-size-large .slot{font-size:16px;line-height:calc(16px + 8px);margin-top:-1.5px}.bcm-checkbox-size-large .bcm-checkbox__input{min-height:calc(32px - 4px)}.bcm-checkbox-size-large .bcm-checkbox__label-icon{width:18px;height:18px;min-width:18px;font-size:12px}.bcm-checkbox__label{display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-start;flex-wrap:nowrap}.bcm-checkbox__label-icon{display:flex;flex-direction:column;align-items:center;justify-content:center;flex-wrap:nowrap;border-width:1px;border-style:solid;border-radius:2px}.bcm-checkbox__label-icon-indeterminate{position:relative}.bcm-checkbox__label-icon-indeterminate:after{content:"";display:block;position:absolute;width:70%;height:1.5px;background:var(--bcm-new-ds-color-white)}.bcm-checkbox__label-icon.bcm-radio__icon{width:16px;height:16px;box-sizing:border-box;border-radius:100px}.bcm-checkbox__label-icon.bcm-radio__icon .bcm-radio__icon-inner{width:10px;height:10px;border-radius:100px;background-color:var(--bcm-new-ds-color-white)}.bcm-checkbox .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-default);color:var(--bcm-checkbox-secondary-color-default);border-color:var(--bcm-new-ds-color-slate-300)}.bcm-checkbox .bcm-checkbox__label-icon-checked,.bcm-checkbox .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-default);border-color:var(--bcm-checkbox-primary-color-default)}.bcm-checkbox .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-default);background-color:var(--bcm-checkbox-secondary-color-default)}.bcm-checkbox .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-default)}.bcm-checkbox .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-default)}.bcm-checkbox:hover .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-hover);color:var(--bcm-checkbox-secondary-color-hover);border-color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-checked,.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-hover);border-color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-hover);background-color:var(--bcm-checkbox-secondary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-focus-visible);color:var(--bcm-checkbox-secondary-color-focus-visible);border-color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-checked,.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-focus-visible);border-color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-focus-visible);background-color:var(--bcm-checkbox-secondary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:active .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-active);color:var(--bcm-checkbox-secondary-color-active);border-color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-checked,.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-active);border-color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-active);background-color:var(--bcm-checkbox-secondary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon,.bcm-checkbox.disabled .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-disabled);color:var(--bcm-checkbox-secondary-color-disabled);border-color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-checked,.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate,.bcm-checkbox.disabled .bcm-checkbox__label-icon-checked,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-disabled);border-color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon,.bcm-checkbox.disabled .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-disabled);background-color:var(--bcm-checkbox-secondary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox.disabled .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[no-margin] .bcm-checkbox__input{margin:0;min-height:0;padding:0}';const x=class{constructor(e){c(this,e)}render(){return o(i,{class:"bcm-ui-element bcm-ui-content-display"},o("slot",null))}get el(){return r(this)}};export{d as bcm_checkbox,x as bcm_typography}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Stencil
|
|
3
|
-
* Copyright (c) Bromcom.
|
|
4
|
-
*/
|
|
5
|
-
import{h as t}from"./p-170cf07d.js";import{c as e}from"./p-64fad38b.js";import{B as m}from"./p-6369b73b.js";const l=({required:l,value:r,size:a,form:o,htmlFor:b,type:s})=>(s=s||m.Status.default,t("label",{form:o,htmlFor:b,class:e("bcm-ui-element bcm-ui-feedback bcm-label bcm-label__text tw-mb-1 tw-text-slate-600 tw-font-medium ",{"tw-text-1":"small"==(a=a||"medium"),"tw-text-2":"medium"==a,"tw-text-3":"large"==a})},r," ",l&&"*"));export{l as L}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Stencil
|
|
3
|
-
* Copyright (c) Bromcom.
|
|
4
|
-
*/
|
|
5
|
-
import{s as a}from"./p-43a281a4.js";class s{}s.isNumber=s=>a((()=>/^[0-9]+$/i.test(s))),s.convertToNumber=s=>a((()=>Number(s))),s.replaceNumber=s=>a((()=>s.replace(/[^0-9]/g,""))),s.replaceFloat=s=>a((()=>s.replace(/[^0-9.]/g,""))),s.toFixed=(s,r)=>a((()=>s.toFixed(r))),s.parseFloatFixed=(r,e)=>a((()=>parseFloat(s.replaceFloat(r)).toFixed(e))),s.getDecimalLength=s=>a((()=>s.split(".")[1]?s.split(".")[1].length:0)),s.toNumber=s=>a((()=>Number(s.replace(/[^0-9.]/g,""))));export{s as N}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Stencil
|
|
3
|
-
* Copyright (c) Bromcom.
|
|
4
|
-
*/
|
|
5
|
-
import{r as t,c as i,h as s,H as a,g as e}from"./p-170cf07d.js";import"./p-61db1f1f.js";import"./p-626a65e9.js";import{G as o}from"./p-43a281a4.js";import"./p-c35c11a7.js";import"./p-157359d6.js";import"./p-0e2cff0d.js";import"./p-7e44e6b5.js";import{d as r}from"./p-8c018ae0.js";import{a as l}from"./p-6369b73b.js";import{C as h}from"./p-a25c8a55.js";import{c}from"./p-64fad38b.js";import"./p-3fac58f7.js";import"./p-2e73d572.js";import{I as d}from"./p-9850cbce.js";import"./p-436364c8.js";import"./p-6edf985f.js";import"./p-85eedabc.js";import"./p-1064895e.js";const p=class{constructor(s){t(this,s),this.change=i(this,"bcm-change",7),this._id=o.UID(),this.label=void 0,this.name=void 0,this.value=null,this.defaultValue=void 0,this.size=l.Size.medium,this.disabled=void 0,this.hidden=!1,this.required=!1,this.gap=void 0,this.direction=l.Direction.horizontal,this.fullWidth=!1,this.items=[],this.caption=void 0,this.noCaption=!1,this.captionError=void 0,this.captionType=l.Status.default,this.captionCache=void 0,this.captionTypeCache=void 0}get radios(){return Array.from(this.el.querySelectorAll("bcm-radio"))}get Items(){return this.items}connectedCallback(){this.captionCache=this.caption,this.captionTypeCache=this.captionType}updateValue(){var t,i,s;this.value=null!==(s=null===(i=null===(t=this.radios)||void 0===t?void 0:t.find((t=>t.checked)))||void 0===i?void 0:i.value)&&void 0!==s?s:null}setRadioUpdate(){var t;null===(t=this.radios)||void 0===t||t.forEach((t=>{t.disabled=this.disabled||t.disabled,t.size=this.size,this.defaultValue&&(t.checked=t.value==this.defaultValue)}))}watchDisabled(t,i){var s;null===(s=this.radios)||void 0===s||s.forEach((i=>i.disabled=t))}watchDefaultValue(t,i){var s;null===(s=this.radios)||void 0===s||s.forEach((i=>i.checked=i.value==t)),this.updateValue(),this.change.emit(this.value)}componentWillLoad(){this.setRadioUpdate(),this.updateValue()}handleChange(t){var i,s;t.stopPropagation(),t.preventDefault();const a=null!==(i=t.target.checked)&&void 0!==i&&i;null===(s=this.radios)||void 0===s||s.forEach((i=>{i.checked=i.id==t.target.id&&!a})),this.updateValue(),this.change.emit(this.value)}async setClear(){var t;this.value=null,null===(t=this.radios)||void 0===t||t.forEach((t=>{t.checked=!1}))}async resetCaption(){return await r(10),this.caption=this.captionCache,this.captionType=this.captionTypeCache,this.captionError=null,await r(10),Promise.resolve()}async check(t,i=!0){var s;null===(s=this.radios)||void 0===s||s.forEach((s=>{s.checked=(s.id==t||s.value==t)&&i})),this.updateValue(),this.change.emit(this.value)}async get(){return this.value}async set(t){await this.check(t)}async getValue(){return this.value}render(){var t,i;const{direction:e,fullWidth:o,gap:r,label:d,size:p,required:n,disabled:u,caption:v,captionError:f,captionType:m,noCaption:b}=this;return s(a,{role:"radio-group",class:"tw-mb-2 tw-flex tw-flex-col"},d&&s("bcm-label",{type:m,value:d,required:n}),s("div",{class:c("tw-flex tw-flex-wrap",e==l.Direction.horizontal?"tw-flex-row":"tw-flex-col",o&&"tw-w-full"),style:{gap:r}},s("slot",null),(null===(t=this.Items)||void 0===t?void 0:t.length)>0&&(null===(i=this.Items)||void 0===i?void 0:i.map((t=>s("bcm-radio",{id:t.id,value:t.value,disabled:u||t.disabled,checked:t.checked,color:t.color,size:p},t.label))))),s(h,{noCaption:b,captionType:m,captionError:f,caption:v}))}get el(){return e(this)}static get watchers(){return{disabled:["watchDisabled"],defaultValue:["watchDefaultValue"]}}};!function(t,i,s,a){var e,o=arguments.length,r=o<3?i:null===a?a=Object.getOwnPropertyDescriptor(i,s):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,i,s,a);else for(var l=t.length-1;l>=0;l--)(e=t[l])&&(r=(o<3?e(r):o>3?e(i,s,r):e(i,s))||r);o>3&&r&&Object.defineProperty(i,s,r)}([d()],p.prototype,"el",void 0);export{p as bcm_radio_group}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Stencil
|
|
3
|
-
* Copyright (c) Bromcom.
|
|
4
|
-
*/
|
|
5
|
-
import{h as s,r as t,c as i,g as e}from"./p-170cf07d.js";import{G as c}from"./p-43a281a4.js";import{B as o}from"./p-6369b73b.js";import{c as h}from"./p-64fad38b.js";import{N as a}from"./p-c35c11a7.js";import{e as r}from"./p-8c018ae0.js";import{C as l}from"./p-436364c8.js";import{C as n}from"./p-2e73d572.js";import"./p-1064895e.js";import"./p-6edf985f.js";import"./p-85eedabc.js";const d=({_id:t,color:i,customStyle:e,size:c,checked:d,hidden:m,value:p,type:f,onDismiss:b,onSelect:u})=>{!c&&(c=o.FontSize["size-1"]);const j=h(((s,t=!1)=>(a.isNumber(s)&&(s=o.FontSize["size-"+s]||o.FontSize["size-4"]),t?+(o.FontSizeValue[s]||o.FontSizeValue["size-4"])+2:s))(c),"bcm-tag__content",f),k=h("bcm-tag",{hidden:m});return s("div",{id:t,class:h(k,{checked:d})},s("span",{hidden:!0},s("slot",null)),s("span",{class:j,style:(s=>{if((f===o.TagType.basic||f==o.TagType.dismissable)&&n[s])return{color:r(l,n[s]+"-6"),borderColor:r(l,n[s]+"-3"),backgroundColor:r(l,n[s]+"-1")}})(i),onClick:s=>u(s)},f===o.TagType.add&&s("span",{class:"left"},s("bcm-icon",{icon:"far fa-plus"})),f===o.TagType.checkable&&s("input",{type:"checkbox",checked:d}),s("span",{class:"value",style:e},p),f===o.TagType.dismissable&&s("span",{class:"right close-button",onClick:s=>b(s)},s("bcm-icon",{icon:"fal fa-times"}))))},m=class{constructor(s){t(this,s),this.change=i(this,"bcm-change",7),this.tagDismissable=i(this,"bcm-tag-dismissable",7),this.bcmTagSelect=i(this,"bcm-tag-select",7),this._id=c.UID(),this._internal_id=c.UID(),this.hidden=!1,this.value="",this.type=o.TagType.basic,this.checked=!1,this.color=void 0,this.customStyle=void 0,this.itemObject=void 0,this.size=o.FontSize["size-1"],this.closeFunc=s=>s,this.selectFunc=s=>s}handleClick(){this.type===o.TagType.checkable&&this.handleChecked()}handleClose(){this.tagDismissable.emit(this.el)}handleChecked(){this.checked=!this.checked,this.change.emit(this.checked)}render(){const{type:t,color:i,value:e,customStyle:c,size:h,hidden:a,checked:r}=this;return s(d,{size:h,hidden:a,color:i,customStyle:c,checked:r,value:e,type:o.TagType[t],onSelect:s=>{this.bcmTagSelect.emit(s),this.selectFunc({event:s,id:this._id})},onDismiss:s=>{this.handleClose(),this.closeFunc(s)}})}get el(){return e(this)}};export{m as bcm_tag}
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Stencil
|
|
3
|
-
* Copyright (c) Bromcom.
|
|
4
|
-
*/
|
|
5
|
-
'use strict';
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
8
|
-
|
|
9
|
-
const index = require('./index-c591ecec.js');
|
|
10
|
-
const index$1 = require('./index-95ae50d0.js');
|
|
11
|
-
const captionTemplate = require('./caption-template-6f535b93.js');
|
|
12
|
-
const generate = require('./generate-f0d6805e.js');
|
|
13
|
-
const slotTemplate = require('./slot-template-80b019d5.js');
|
|
14
|
-
const bcm = require('./bcm-3c58a6d5.js');
|
|
15
|
-
const utils = require('./utils-fc077139.js');
|
|
16
|
-
const colorHelper = require('./color-helper-c3a819ea.js');
|
|
17
|
-
const isLoadDecorator = require('./is-load-decorator-15036f37.js');
|
|
18
|
-
require('./_commonjsHelpers-ed84c3ca.js');
|
|
19
|
-
require('./package-a737bf36.js');
|
|
20
|
-
require('./colors-078851ec.js');
|
|
21
|
-
require('./string-helper-3212f4ea.js');
|
|
22
|
-
require('./colors-56282b00.js');
|
|
23
|
-
|
|
24
|
-
const checkboxCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");@import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap\"); .size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}.bcm-input[no-margin]{margin:0}.bcm-textarea[no-margin]{margin:0}.bcm-switch[no-margin]{margin:0}.bcm-checkbox[no-margin]{margin:0}.bcm-radio-group[no-margin]{margin:0}.bcm-checkbox-group[no-margin]{margin:0}.bcm-range[no-margin]{margin:0}.bcm-form[no-margin]{margin:0}.bcm-form-group[no-margin]{margin:0}.bcm-list[no-margin]{margin:0}.bcm-colorpicker[no-margin]{margin:0}.bcm-date-picker[no-margin]{margin:0}.bcm-time-picker[no-margin]{margin:0}.bcm-datetime-picker[no-margin]{margin:0}.bcm-select[no-margin]{margin:0}.bcm-listbox[no-margin]{margin:0}*{box-sizing:border-box}.bcm-checkbox{outline:none;border:none;--bcm-checkbox-primary-color-default:var(--bcm-new-ds-color-blue-500);--bcm-checkbox-secondary-color-default:var(--bcm-new-ds-color-white);--bcm-checkbox-primary-color-hover:var(--bcm-new-ds-color-blue-600);--bcm-checkbox-secondary-color-hover:var(--bcm-new-ds-color-slate-50);--bcm-checkbox-primary-color-focus-visible:var(--bcm-new-ds-color-blue-800);--bcm-checkbox-secondary-color-focus-visible:var(--bcm-new-ds-color-slate-50);--bcm-checkbox-primary-color-active:var(--bcm-new-ds-color-blue-700);--bcm-checkbox-secondary-color-active:var(--bcm-new-ds-color-slate-50);--bcm-checkbox-primary-color-disabled:var(--bcm-new-ds-color-slate-300);--bcm-checkbox-secondary-color-disabled:var(--bcm-new-ds-color-slate-200);display:inline-flex;width:fit-content;flex-direction:column;margin-bottom:8px}.bcm-checkbox:focus,.bcm-checkbox:hover,.bcm-checkbox:active{outline:none;border:none}.bcm-checkbox *{box-sizing:border-box}.bcm-checkbox input[type=radio],.bcm-checkbox input[type=checkbox]{-webkit-appearance:none;appearance:none;background-color:#fff;margin:0;display:none}.bcm-checkbox__input{display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-start;flex-wrap:nowrap;padding-top:4px}.bcm-checkbox.hidden{display:none}.bcm-checkbox :hover{cursor:pointer}.bcm-checkbox[disabled] :hover,.bcm-checkbox.disabled :hover{cursor:not-allowed}.bcm-checkbox .slot{font-family:\"Inter\", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;font-weight:500;color:var(--bcm-new-ds-color-slate-600)}.bcm-checkbox .slot:not(:empty){margin-left:8px;margin-right:8px}.bcm-checkbox-size-small .slot{font-size:12px;line-height:calc(12px + 8px);margin-top:-2.5px}.bcm-checkbox-size-small .bcm-checkbox__input{min-height:calc(24px - 4px)}.bcm-checkbox-size-small .bcm-checkbox__label-icon{width:14px;height:14px;min-width:14px;font-size:calc(10px - 2px)}.bcm-checkbox-size-medium .slot{font-size:calc(12px + 1px);line-height:calc(12px + 8px);margin-top:-1.5px}.bcm-checkbox-size-medium .bcm-checkbox__input{min-height:calc(32px - 4px)}.bcm-checkbox-size-medium .bcm-checkbox__label-icon{width:16px;height:16px;min-width:16px;font-size:10px}.bcm-checkbox-size-large .slot{font-size:16px;line-height:calc(16px + 8px);margin-top:-1.5px}.bcm-checkbox-size-large .bcm-checkbox__input{min-height:calc(32px - 4px)}.bcm-checkbox-size-large .bcm-checkbox__label-icon{width:18px;height:18px;min-width:18px;font-size:12px}.bcm-checkbox__label{display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-start;flex-wrap:nowrap}.bcm-checkbox__label-icon{display:flex;flex-direction:column;align-items:center;justify-content:center;flex-wrap:nowrap;border-width:1px;border-style:solid;border-radius:2px}.bcm-checkbox__label-icon-indeterminate{position:relative}.bcm-checkbox__label-icon-indeterminate:after{content:\"\";display:block;position:absolute;width:70%;height:1.5px;background:var(--bcm-new-ds-color-white)}.bcm-checkbox__label-icon.bcm-radio__icon{width:16px;height:16px;box-sizing:border-box;border-radius:100px}.bcm-checkbox__label-icon.bcm-radio__icon .bcm-radio__icon-inner{width:10px;height:10px;border-radius:100px;background-color:var(--bcm-new-ds-color-white)}.bcm-checkbox .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-default);color:var(--bcm-checkbox-secondary-color-default);border-color:var(--bcm-new-ds-color-slate-300)}.bcm-checkbox .bcm-checkbox__label-icon-checked,.bcm-checkbox .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-default);border-color:var(--bcm-checkbox-primary-color-default)}.bcm-checkbox .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-default);background-color:var(--bcm-checkbox-secondary-color-default)}.bcm-checkbox .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-default)}.bcm-checkbox .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-default)}.bcm-checkbox:hover .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-hover);color:var(--bcm-checkbox-secondary-color-hover);border-color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-checked,.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-hover);border-color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-hover);background-color:var(--bcm-checkbox-secondary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-focus-visible);color:var(--bcm-checkbox-secondary-color-focus-visible);border-color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-checked,.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-focus-visible);border-color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-focus-visible);background-color:var(--bcm-checkbox-secondary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:active .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-active);color:var(--bcm-checkbox-secondary-color-active);border-color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-checked,.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-active);border-color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-active);background-color:var(--bcm-checkbox-secondary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon,.bcm-checkbox.disabled .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-disabled);color:var(--bcm-checkbox-secondary-color-disabled);border-color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-checked,.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate,.bcm-checkbox.disabled .bcm-checkbox__label-icon-checked,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-disabled);border-color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon,.bcm-checkbox.disabled .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-disabled);background-color:var(--bcm-checkbox-secondary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox.disabled .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[no-margin] .bcm-checkbox__input{margin:0;min-height:0;padding:0}";
|
|
25
|
-
|
|
26
|
-
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
27
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
28
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
29
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
30
|
-
else
|
|
31
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
32
|
-
if (d = decorators[i])
|
|
33
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
34
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
35
|
-
};
|
|
36
|
-
const BcmCheckbox = class {
|
|
37
|
-
constructor(hostRef) {
|
|
38
|
-
index.registerInstance(this, hostRef);
|
|
39
|
-
this.blur = index.createEvent(this, "bcm-blur", 7);
|
|
40
|
-
this.focus = index.createEvent(this, "bcm-focus", 7);
|
|
41
|
-
this.change = index.createEvent(this, "bcm-change", 7);
|
|
42
|
-
this.changeCheckbox = index.createEvent(this, "bcm-change-checkbox", 7);
|
|
43
|
-
this._id = generate.Generate.UID();
|
|
44
|
-
this.inGroup = false;
|
|
45
|
-
this.value = false;
|
|
46
|
-
this.checked = false;
|
|
47
|
-
this.name = undefined;
|
|
48
|
-
this.disabled = false;
|
|
49
|
-
this.hidden = false;
|
|
50
|
-
this.required = false;
|
|
51
|
-
this.label = undefined;
|
|
52
|
-
this.readonly = false;
|
|
53
|
-
this.size = bcm.Bcm.Size.medium;
|
|
54
|
-
this.indeterminate = null;
|
|
55
|
-
this.color = "blue";
|
|
56
|
-
this.caption = undefined;
|
|
57
|
-
this.noCaption = false;
|
|
58
|
-
this.captionError = undefined;
|
|
59
|
-
this.captionType = bcm.Bcm.Status.default;
|
|
60
|
-
this.captionCache = undefined;
|
|
61
|
-
this.captionTypeCache = undefined;
|
|
62
|
-
}
|
|
63
|
-
connectedCallback() {
|
|
64
|
-
this.captionCache = this.caption;
|
|
65
|
-
this.captionTypeCache = this.captionType;
|
|
66
|
-
this.value = this.checked;
|
|
67
|
-
}
|
|
68
|
-
componentDidRender() {
|
|
69
|
-
this.inputElement.checked = this.checked;
|
|
70
|
-
}
|
|
71
|
-
async onBcmFocus() {
|
|
72
|
-
this.el.focus();
|
|
73
|
-
}
|
|
74
|
-
async onBcmBlur() {
|
|
75
|
-
this.el.blur();
|
|
76
|
-
}
|
|
77
|
-
async setClear() {
|
|
78
|
-
this.check(false);
|
|
79
|
-
this.handleChange();
|
|
80
|
-
await utils.delay(10);
|
|
81
|
-
return Promise.resolve();
|
|
82
|
-
}
|
|
83
|
-
async resetCaption() {
|
|
84
|
-
await utils.delay(10);
|
|
85
|
-
this.caption = this.captionCache;
|
|
86
|
-
this.captionType = this.captionTypeCache;
|
|
87
|
-
this.captionError = null;
|
|
88
|
-
await utils.delay(10);
|
|
89
|
-
return Promise.resolve();
|
|
90
|
-
}
|
|
91
|
-
handleChange() {
|
|
92
|
-
this.checked = this.inputElement.checked;
|
|
93
|
-
this.value = this.checked;
|
|
94
|
-
if (!this.indeterminate) {
|
|
95
|
-
this.changeCheckbox.emit();
|
|
96
|
-
this.change.emit({
|
|
97
|
-
name: this.name,
|
|
98
|
-
value: this.checked
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
watchIndeterminate(newValue, oldValue) {
|
|
103
|
-
if (newValue != oldValue) {
|
|
104
|
-
this.inputElement.checked = this.indeterminate == bcm.Bcm.IndeterminateType.determinate ? true : false;
|
|
105
|
-
this.handleChange();
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
async set(data) {
|
|
109
|
-
if (typeof data === 'boolean') {
|
|
110
|
-
await this.check(data);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
async get() {
|
|
114
|
-
return this.checked || false;
|
|
115
|
-
}
|
|
116
|
-
async check(uncheck = true) {
|
|
117
|
-
this.inputElement.checked = uncheck;
|
|
118
|
-
this.handleChange();
|
|
119
|
-
}
|
|
120
|
-
handleKeyUp(ev) {
|
|
121
|
-
if (ev.keyCode == bcm.Bcm.KeyCode.space || ev.keyCode == bcm.Bcm.KeyCode.enter) {
|
|
122
|
-
if (!this.disabled && !this.readonly) {
|
|
123
|
-
this.inputElement.checked = !this.inputElement.checked;
|
|
124
|
-
this.handleChange();
|
|
125
|
-
}
|
|
126
|
-
ev.stopPropagation();
|
|
127
|
-
ev.preventDefault();
|
|
128
|
-
return false;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
watchChecked() {
|
|
132
|
-
if (this.checked) {
|
|
133
|
-
this.resetCaption();
|
|
134
|
-
}
|
|
135
|
-
this.value = this.checked;
|
|
136
|
-
}
|
|
137
|
-
setColor(color = this.color) {
|
|
138
|
-
if (!color)
|
|
139
|
-
return;
|
|
140
|
-
const prefix = `--bcm-checkbox`;
|
|
141
|
-
return {
|
|
142
|
-
[`${prefix}-primary-color-default`]: colorHelper.ColorHelper.dsColor(color + '-500'),
|
|
143
|
-
[`${prefix}-primary-color-hover`]: colorHelper.ColorHelper.dsColor(color + '-600'),
|
|
144
|
-
[`${prefix}-primary-color-focus-visible`]: colorHelper.ColorHelper.dsColor(color + '-800'),
|
|
145
|
-
[`${prefix}-primary-color-active`]: colorHelper.ColorHelper.dsColor(color + '-700'),
|
|
146
|
-
// [`${prefix}-primary-color-disabled`]: ColorHelper.dsColor(color + '-300'),
|
|
147
|
-
[`${prefix}-secondary-color-default`]: colorHelper.ColorHelper.dsColor('white'),
|
|
148
|
-
[`${prefix}-secondary-color-hover`]: colorHelper.ColorHelper.dsColor('slate-50'),
|
|
149
|
-
[`${prefix}-secondary-color-focus-visible`]: colorHelper.ColorHelper.dsColor('slate-50'),
|
|
150
|
-
[`${prefix}-secondary-color-active`]: colorHelper.ColorHelper.dsColor('slate-50'),
|
|
151
|
-
// [`${prefix}-secondary-color-disabled`]: ColorHelper.dsColor('slate-200')
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
render() {
|
|
155
|
-
const { label, _id, indeterminate, hidden, disabled, checked, readonly, required, caption, captionError, captionType, noCaption, size } = this;
|
|
156
|
-
//////
|
|
157
|
-
const bcmCheckboxClass = index$1.classnames('bcm-checkbox', `bcm-checkbox-size-${size}`, {
|
|
158
|
-
'error': captionType == bcm.Bcm.Status.error,
|
|
159
|
-
hidden,
|
|
160
|
-
checked,
|
|
161
|
-
disabled,
|
|
162
|
-
required,
|
|
163
|
-
readonly,
|
|
164
|
-
});
|
|
165
|
-
const bcmCheckboxIconClass = index$1.classnames('bcm-checkbox__label-icon', 'bcm-checkbox__label-icon-lite', 'bcm-checkbox__label-icon-' + indeterminate, {
|
|
166
|
-
'bcm-checkbox__label-icon-checked': checked,
|
|
167
|
-
});
|
|
168
|
-
const bcmCheckboxLabelClass = index$1.classnames('bcm-checkbox__label');
|
|
169
|
-
const bcmCheckboxInputClass = index$1.classnames('bcm-checkbox__input');
|
|
170
|
-
return (index.h(index.Host, { tabindex: "0", onFocus: () => this.focus.emit(this.el), onBlur: () => this.blur.emit(this.el), style: this.setColor(this.color), class: bcmCheckboxClass, disabled: disabled }, index.h("span", { hidden: true }, index.h("slot", null)), label && index.h("bcm-label", { htmlFor: `input-${_id}`, type: captionType, value: label, required: required }), index.h("div", { class: bcmCheckboxInputClass }, index.h("input", { id: `input-${_id}`, type: "checkbox", checked: checked, disabled: disabled, required: required, readonly: readonly, onChange: () => { !disabled && !readonly && (this.handleChange()); }, ref: el => (this.inputElement = el) }), index.h("label", { class: bcmCheckboxLabelClass, htmlFor: `input-${_id}` }, index.h("span", { class: bcmCheckboxIconClass }, index.h("bcm-icon", { icon: "far fa-check" })), index.h(slotTemplate.SlotTemplate, { className: "slot" }))), index.h(captionTemplate.CaptionTemplate, { noCaption: noCaption, captionType: captionType, captionError: captionError, caption: caption })));
|
|
171
|
-
}
|
|
172
|
-
get el() { return index.getElement(this); }
|
|
173
|
-
static get watchers() { return {
|
|
174
|
-
"indeterminate": ["watchIndeterminate"],
|
|
175
|
-
"checked": ["watchChecked"]
|
|
176
|
-
}; }
|
|
177
|
-
};
|
|
178
|
-
__decorate([
|
|
179
|
-
isLoadDecorator.IsLoad()
|
|
180
|
-
], BcmCheckbox.prototype, "el", void 0);
|
|
181
|
-
BcmCheckbox.style = checkboxCss;
|
|
182
|
-
|
|
183
|
-
const BcmTypography = class {
|
|
184
|
-
constructor(hostRef) {
|
|
185
|
-
index.registerInstance(this, hostRef);
|
|
186
|
-
}
|
|
187
|
-
render() {
|
|
188
|
-
return (index.h(index.Host, { class: "bcm-ui-element bcm-ui-content-display" }, index.h("slot", null)));
|
|
189
|
-
}
|
|
190
|
-
get el() { return index.getElement(this); }
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
exports.bcm_checkbox = BcmCheckbox;
|
|
194
|
-
exports.bcm_typography = BcmTypography;
|
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Stencil
|
|
3
|
-
* Copyright (c) Bromcom.
|
|
4
|
-
*/
|
|
5
|
-
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-0615c2b8.js';
|
|
6
|
-
import { c as classnames } from './index-00c8a8f7.js';
|
|
7
|
-
import { C as CaptionTemplate } from './caption-template-0c32ce16.js';
|
|
8
|
-
import { G as Generate } from './generate-fff9c034.js';
|
|
9
|
-
import { S as SlotTemplate } from './slot-template-9234df88.js';
|
|
10
|
-
import { B as Bcm } from './bcm-0f9cc27c.js';
|
|
11
|
-
import { d as delay } from './utils-57652744.js';
|
|
12
|
-
import { C as ColorHelper } from './color-helper-845ba523.js';
|
|
13
|
-
import { I as IsLoad } from './is-load-decorator-8277e3b8.js';
|
|
14
|
-
import './_commonjsHelpers-7002e5de.js';
|
|
15
|
-
import './package-7d8bb462.js';
|
|
16
|
-
import './colors-ebea297f.js';
|
|
17
|
-
import './string-helper-8f5da9ec.js';
|
|
18
|
-
import './colors-1d7854ea.js';
|
|
19
|
-
|
|
20
|
-
const checkboxCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");@import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap\"); .size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}.bcm-input[no-margin]{margin:0}.bcm-textarea[no-margin]{margin:0}.bcm-switch[no-margin]{margin:0}.bcm-checkbox[no-margin]{margin:0}.bcm-radio-group[no-margin]{margin:0}.bcm-checkbox-group[no-margin]{margin:0}.bcm-range[no-margin]{margin:0}.bcm-form[no-margin]{margin:0}.bcm-form-group[no-margin]{margin:0}.bcm-list[no-margin]{margin:0}.bcm-colorpicker[no-margin]{margin:0}.bcm-date-picker[no-margin]{margin:0}.bcm-time-picker[no-margin]{margin:0}.bcm-datetime-picker[no-margin]{margin:0}.bcm-select[no-margin]{margin:0}.bcm-listbox[no-margin]{margin:0}*{box-sizing:border-box}.bcm-checkbox{outline:none;border:none;--bcm-checkbox-primary-color-default:var(--bcm-new-ds-color-blue-500);--bcm-checkbox-secondary-color-default:var(--bcm-new-ds-color-white);--bcm-checkbox-primary-color-hover:var(--bcm-new-ds-color-blue-600);--bcm-checkbox-secondary-color-hover:var(--bcm-new-ds-color-slate-50);--bcm-checkbox-primary-color-focus-visible:var(--bcm-new-ds-color-blue-800);--bcm-checkbox-secondary-color-focus-visible:var(--bcm-new-ds-color-slate-50);--bcm-checkbox-primary-color-active:var(--bcm-new-ds-color-blue-700);--bcm-checkbox-secondary-color-active:var(--bcm-new-ds-color-slate-50);--bcm-checkbox-primary-color-disabled:var(--bcm-new-ds-color-slate-300);--bcm-checkbox-secondary-color-disabled:var(--bcm-new-ds-color-slate-200);display:inline-flex;width:fit-content;flex-direction:column;margin-bottom:8px}.bcm-checkbox:focus,.bcm-checkbox:hover,.bcm-checkbox:active{outline:none;border:none}.bcm-checkbox *{box-sizing:border-box}.bcm-checkbox input[type=radio],.bcm-checkbox input[type=checkbox]{-webkit-appearance:none;appearance:none;background-color:#fff;margin:0;display:none}.bcm-checkbox__input{display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-start;flex-wrap:nowrap;padding-top:4px}.bcm-checkbox.hidden{display:none}.bcm-checkbox :hover{cursor:pointer}.bcm-checkbox[disabled] :hover,.bcm-checkbox.disabled :hover{cursor:not-allowed}.bcm-checkbox .slot{font-family:\"Inter\", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;font-weight:500;color:var(--bcm-new-ds-color-slate-600)}.bcm-checkbox .slot:not(:empty){margin-left:8px;margin-right:8px}.bcm-checkbox-size-small .slot{font-size:12px;line-height:calc(12px + 8px);margin-top:-2.5px}.bcm-checkbox-size-small .bcm-checkbox__input{min-height:calc(24px - 4px)}.bcm-checkbox-size-small .bcm-checkbox__label-icon{width:14px;height:14px;min-width:14px;font-size:calc(10px - 2px)}.bcm-checkbox-size-medium .slot{font-size:calc(12px + 1px);line-height:calc(12px + 8px);margin-top:-1.5px}.bcm-checkbox-size-medium .bcm-checkbox__input{min-height:calc(32px - 4px)}.bcm-checkbox-size-medium .bcm-checkbox__label-icon{width:16px;height:16px;min-width:16px;font-size:10px}.bcm-checkbox-size-large .slot{font-size:16px;line-height:calc(16px + 8px);margin-top:-1.5px}.bcm-checkbox-size-large .bcm-checkbox__input{min-height:calc(32px - 4px)}.bcm-checkbox-size-large .bcm-checkbox__label-icon{width:18px;height:18px;min-width:18px;font-size:12px}.bcm-checkbox__label{display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-start;flex-wrap:nowrap}.bcm-checkbox__label-icon{display:flex;flex-direction:column;align-items:center;justify-content:center;flex-wrap:nowrap;border-width:1px;border-style:solid;border-radius:2px}.bcm-checkbox__label-icon-indeterminate{position:relative}.bcm-checkbox__label-icon-indeterminate:after{content:\"\";display:block;position:absolute;width:70%;height:1.5px;background:var(--bcm-new-ds-color-white)}.bcm-checkbox__label-icon.bcm-radio__icon{width:16px;height:16px;box-sizing:border-box;border-radius:100px}.bcm-checkbox__label-icon.bcm-radio__icon .bcm-radio__icon-inner{width:10px;height:10px;border-radius:100px;background-color:var(--bcm-new-ds-color-white)}.bcm-checkbox .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-default);color:var(--bcm-checkbox-secondary-color-default);border-color:var(--bcm-new-ds-color-slate-300)}.bcm-checkbox .bcm-checkbox__label-icon-checked,.bcm-checkbox .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-default);border-color:var(--bcm-checkbox-primary-color-default)}.bcm-checkbox .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-default);background-color:var(--bcm-checkbox-secondary-color-default)}.bcm-checkbox .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-default)}.bcm-checkbox .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-default)}.bcm-checkbox:hover .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-hover);color:var(--bcm-checkbox-secondary-color-hover);border-color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-checked,.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-hover);border-color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-hover);background-color:var(--bcm-checkbox-secondary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-focus-visible);color:var(--bcm-checkbox-secondary-color-focus-visible);border-color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-checked,.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-focus-visible);border-color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-focus-visible);background-color:var(--bcm-checkbox-secondary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:active .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-active);color:var(--bcm-checkbox-secondary-color-active);border-color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-checked,.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-active);border-color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-active);background-color:var(--bcm-checkbox-secondary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon,.bcm-checkbox.disabled .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-disabled);color:var(--bcm-checkbox-secondary-color-disabled);border-color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-checked,.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate,.bcm-checkbox.disabled .bcm-checkbox__label-icon-checked,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-disabled);border-color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon,.bcm-checkbox.disabled .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-disabled);background-color:var(--bcm-checkbox-secondary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox.disabled .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[no-margin] .bcm-checkbox__input{margin:0;min-height:0;padding:0}";
|
|
21
|
-
|
|
22
|
-
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
23
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
24
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
25
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
26
|
-
else
|
|
27
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
28
|
-
if (d = decorators[i])
|
|
29
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
30
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
31
|
-
};
|
|
32
|
-
const BcmCheckbox = class {
|
|
33
|
-
constructor(hostRef) {
|
|
34
|
-
registerInstance(this, hostRef);
|
|
35
|
-
this.blur = createEvent(this, "bcm-blur", 7);
|
|
36
|
-
this.focus = createEvent(this, "bcm-focus", 7);
|
|
37
|
-
this.change = createEvent(this, "bcm-change", 7);
|
|
38
|
-
this.changeCheckbox = createEvent(this, "bcm-change-checkbox", 7);
|
|
39
|
-
this._id = Generate.UID();
|
|
40
|
-
this.inGroup = false;
|
|
41
|
-
this.value = false;
|
|
42
|
-
this.checked = false;
|
|
43
|
-
this.name = undefined;
|
|
44
|
-
this.disabled = false;
|
|
45
|
-
this.hidden = false;
|
|
46
|
-
this.required = false;
|
|
47
|
-
this.label = undefined;
|
|
48
|
-
this.readonly = false;
|
|
49
|
-
this.size = Bcm.Size.medium;
|
|
50
|
-
this.indeterminate = null;
|
|
51
|
-
this.color = "blue";
|
|
52
|
-
this.caption = undefined;
|
|
53
|
-
this.noCaption = false;
|
|
54
|
-
this.captionError = undefined;
|
|
55
|
-
this.captionType = Bcm.Status.default;
|
|
56
|
-
this.captionCache = undefined;
|
|
57
|
-
this.captionTypeCache = undefined;
|
|
58
|
-
}
|
|
59
|
-
connectedCallback() {
|
|
60
|
-
this.captionCache = this.caption;
|
|
61
|
-
this.captionTypeCache = this.captionType;
|
|
62
|
-
this.value = this.checked;
|
|
63
|
-
}
|
|
64
|
-
componentDidRender() {
|
|
65
|
-
this.inputElement.checked = this.checked;
|
|
66
|
-
}
|
|
67
|
-
async onBcmFocus() {
|
|
68
|
-
this.el.focus();
|
|
69
|
-
}
|
|
70
|
-
async onBcmBlur() {
|
|
71
|
-
this.el.blur();
|
|
72
|
-
}
|
|
73
|
-
async setClear() {
|
|
74
|
-
this.check(false);
|
|
75
|
-
this.handleChange();
|
|
76
|
-
await delay(10);
|
|
77
|
-
return Promise.resolve();
|
|
78
|
-
}
|
|
79
|
-
async resetCaption() {
|
|
80
|
-
await delay(10);
|
|
81
|
-
this.caption = this.captionCache;
|
|
82
|
-
this.captionType = this.captionTypeCache;
|
|
83
|
-
this.captionError = null;
|
|
84
|
-
await delay(10);
|
|
85
|
-
return Promise.resolve();
|
|
86
|
-
}
|
|
87
|
-
handleChange() {
|
|
88
|
-
this.checked = this.inputElement.checked;
|
|
89
|
-
this.value = this.checked;
|
|
90
|
-
if (!this.indeterminate) {
|
|
91
|
-
this.changeCheckbox.emit();
|
|
92
|
-
this.change.emit({
|
|
93
|
-
name: this.name,
|
|
94
|
-
value: this.checked
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
watchIndeterminate(newValue, oldValue) {
|
|
99
|
-
if (newValue != oldValue) {
|
|
100
|
-
this.inputElement.checked = this.indeterminate == Bcm.IndeterminateType.determinate ? true : false;
|
|
101
|
-
this.handleChange();
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
async set(data) {
|
|
105
|
-
if (typeof data === 'boolean') {
|
|
106
|
-
await this.check(data);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
async get() {
|
|
110
|
-
return this.checked || false;
|
|
111
|
-
}
|
|
112
|
-
async check(uncheck = true) {
|
|
113
|
-
this.inputElement.checked = uncheck;
|
|
114
|
-
this.handleChange();
|
|
115
|
-
}
|
|
116
|
-
handleKeyUp(ev) {
|
|
117
|
-
if (ev.keyCode == Bcm.KeyCode.space || ev.keyCode == Bcm.KeyCode.enter) {
|
|
118
|
-
if (!this.disabled && !this.readonly) {
|
|
119
|
-
this.inputElement.checked = !this.inputElement.checked;
|
|
120
|
-
this.handleChange();
|
|
121
|
-
}
|
|
122
|
-
ev.stopPropagation();
|
|
123
|
-
ev.preventDefault();
|
|
124
|
-
return false;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
watchChecked() {
|
|
128
|
-
if (this.checked) {
|
|
129
|
-
this.resetCaption();
|
|
130
|
-
}
|
|
131
|
-
this.value = this.checked;
|
|
132
|
-
}
|
|
133
|
-
setColor(color = this.color) {
|
|
134
|
-
if (!color)
|
|
135
|
-
return;
|
|
136
|
-
const prefix = `--bcm-checkbox`;
|
|
137
|
-
return {
|
|
138
|
-
[`${prefix}-primary-color-default`]: ColorHelper.dsColor(color + '-500'),
|
|
139
|
-
[`${prefix}-primary-color-hover`]: ColorHelper.dsColor(color + '-600'),
|
|
140
|
-
[`${prefix}-primary-color-focus-visible`]: ColorHelper.dsColor(color + '-800'),
|
|
141
|
-
[`${prefix}-primary-color-active`]: ColorHelper.dsColor(color + '-700'),
|
|
142
|
-
// [`${prefix}-primary-color-disabled`]: ColorHelper.dsColor(color + '-300'),
|
|
143
|
-
[`${prefix}-secondary-color-default`]: ColorHelper.dsColor('white'),
|
|
144
|
-
[`${prefix}-secondary-color-hover`]: ColorHelper.dsColor('slate-50'),
|
|
145
|
-
[`${prefix}-secondary-color-focus-visible`]: ColorHelper.dsColor('slate-50'),
|
|
146
|
-
[`${prefix}-secondary-color-active`]: ColorHelper.dsColor('slate-50'),
|
|
147
|
-
// [`${prefix}-secondary-color-disabled`]: ColorHelper.dsColor('slate-200')
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
render() {
|
|
151
|
-
const { label, _id, indeterminate, hidden, disabled, checked, readonly, required, caption, captionError, captionType, noCaption, size } = this;
|
|
152
|
-
//////
|
|
153
|
-
const bcmCheckboxClass = classnames('bcm-checkbox', `bcm-checkbox-size-${size}`, {
|
|
154
|
-
'error': captionType == Bcm.Status.error,
|
|
155
|
-
hidden,
|
|
156
|
-
checked,
|
|
157
|
-
disabled,
|
|
158
|
-
required,
|
|
159
|
-
readonly,
|
|
160
|
-
});
|
|
161
|
-
const bcmCheckboxIconClass = classnames('bcm-checkbox__label-icon', 'bcm-checkbox__label-icon-lite', 'bcm-checkbox__label-icon-' + indeterminate, {
|
|
162
|
-
'bcm-checkbox__label-icon-checked': checked,
|
|
163
|
-
});
|
|
164
|
-
const bcmCheckboxLabelClass = classnames('bcm-checkbox__label');
|
|
165
|
-
const bcmCheckboxInputClass = classnames('bcm-checkbox__input');
|
|
166
|
-
return (h(Host, { tabindex: "0", onFocus: () => this.focus.emit(this.el), onBlur: () => this.blur.emit(this.el), style: this.setColor(this.color), class: bcmCheckboxClass, disabled: disabled }, h("span", { hidden: true }, h("slot", null)), label && h("bcm-label", { htmlFor: `input-${_id}`, type: captionType, value: label, required: required }), h("div", { class: bcmCheckboxInputClass }, h("input", { id: `input-${_id}`, type: "checkbox", checked: checked, disabled: disabled, required: required, readonly: readonly, onChange: () => { !disabled && !readonly && (this.handleChange()); }, ref: el => (this.inputElement = el) }), h("label", { class: bcmCheckboxLabelClass, htmlFor: `input-${_id}` }, h("span", { class: bcmCheckboxIconClass }, h("bcm-icon", { icon: "far fa-check" })), h(SlotTemplate, { className: "slot" }))), h(CaptionTemplate, { noCaption: noCaption, captionType: captionType, captionError: captionError, caption: caption })));
|
|
167
|
-
}
|
|
168
|
-
get el() { return getElement(this); }
|
|
169
|
-
static get watchers() { return {
|
|
170
|
-
"indeterminate": ["watchIndeterminate"],
|
|
171
|
-
"checked": ["watchChecked"]
|
|
172
|
-
}; }
|
|
173
|
-
};
|
|
174
|
-
__decorate([
|
|
175
|
-
IsLoad()
|
|
176
|
-
], BcmCheckbox.prototype, "el", void 0);
|
|
177
|
-
BcmCheckbox.style = checkboxCss;
|
|
178
|
-
|
|
179
|
-
const BcmTypography = class {
|
|
180
|
-
constructor(hostRef) {
|
|
181
|
-
registerInstance(this, hostRef);
|
|
182
|
-
}
|
|
183
|
-
render() {
|
|
184
|
-
return (h(Host, { class: "bcm-ui-element bcm-ui-content-display" }, h("slot", null)));
|
|
185
|
-
}
|
|
186
|
-
get el() { return getElement(this); }
|
|
187
|
-
};
|
|
188
|
-
|
|
189
|
-
export { BcmCheckbox as bcm_checkbox, BcmTypography as bcm_typography };
|