bromcom-ui 2.10.1-rc.1 → 2.10.1-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
- package/dist/bromcom-ui/p-0208acef.entry.js +7 -0
- package/dist/bromcom-ui/{p-77eb2287.entry.js → p-027e818d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-795d2f76.entry.js → p-06071e98.entry.js} +1 -1
- package/dist/bromcom-ui/p-0e2cff0d.js +5 -0
- package/dist/bromcom-ui/{p-9a41b688.js → p-1064895e.js} +1 -1
- package/dist/bromcom-ui/{p-a04aab3c.entry.js → p-21d98283.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e131b27f.js → p-2565ccce.js} +1 -1
- package/dist/bromcom-ui/{p-3f39982f.entry.js → p-2ee20f32.entry.js} +1 -1
- package/dist/bromcom-ui/{p-3756f541.entry.js → p-313f3908.entry.js} +1 -1
- package/dist/bromcom-ui/{p-b013cff9.entry.js → p-33f3295e.entry.js} +1 -1
- package/dist/bromcom-ui/{p-7f09901d.entry.js → p-3ec44b04.entry.js} +1 -1
- package/dist/bromcom-ui/p-43a281a4.js +5 -0
- package/dist/bromcom-ui/{p-f3431dc8.js → p-4b8f90ef.js} +1 -1
- package/dist/bromcom-ui/{p-09699c4d.entry.js → p-4e5006b1.entry.js} +1 -1
- package/dist/bromcom-ui/{p-8d43aa14.entry.js → p-55547a6e.entry.js} +1 -1
- package/dist/bromcom-ui/{p-0973538a.entry.js → p-56ec6518.entry.js} +1 -1
- package/dist/bromcom-ui/{p-551058cd.entry.js → p-57c9904b.entry.js} +1 -1
- package/dist/bromcom-ui/{p-c566b3a0.entry.js → p-5b5f9b00.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d89b7e22.entry.js → p-5da0f9ef.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e38c4c3a.entry.js → p-69eb7be7.entry.js} +1 -1
- package/dist/bromcom-ui/{p-0b820f78.entry.js → p-7149c15e.entry.js} +1 -1
- package/dist/bromcom-ui/p-752057b7.entry.js +5 -0
- package/dist/bromcom-ui/{p-f1dbd96d.entry.js → p-7814999e.entry.js} +1 -1
- package/dist/bromcom-ui/{p-0325e8a4.entry.js → p-7f1681e2.entry.js} +1 -1
- package/dist/bromcom-ui/{p-56f7477e.entry.js → p-82caef35.entry.js} +1 -1
- package/dist/bromcom-ui/{p-cf0c0700.entry.js → p-84089734.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a00170b7.entry.js → p-84307b0c.entry.js} +1 -1
- package/dist/bromcom-ui/{p-0b316c6f.entry.js → p-8846b944.entry.js} +1 -1
- package/dist/bromcom-ui/{p-16848643.entry.js → p-893ecfd7.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a42cc789.entry.js → p-8c1834d9.entry.js} +1 -1
- package/dist/bromcom-ui/{p-2da72d6a.entry.js → p-8cbae172.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e11ab4ed.entry.js → p-95e3e645.entry.js} +1 -1
- package/dist/bromcom-ui/{p-483b4ba8.entry.js → p-9b9f36d5.entry.js} +1 -1
- package/dist/bromcom-ui/{p-813ec92d.js → p-9c31bd27.js} +1 -1
- package/dist/bromcom-ui/{p-be434461.entry.js → p-9f67eec6.entry.js} +1 -1
- package/dist/bromcom-ui/{p-015d19dd.entry.js → p-b193eb3a.entry.js} +1 -1
- package/dist/bromcom-ui/{p-29614b49.entry.js → p-b2687899.entry.js} +1 -1
- package/dist/bromcom-ui/{p-f7549b1f.entry.js → p-b27218ea.entry.js} +1 -1
- package/dist/bromcom-ui/{p-fb597d84.entry.js → p-b77e861c.entry.js} +1 -1
- package/dist/bromcom-ui/{p-646cf63c.entry.js → p-bc26bfcc.entry.js} +1 -1
- package/dist/bromcom-ui/{p-1708a5ec.entry.js → p-bda74b16.entry.js} +1 -1
- package/dist/bromcom-ui/{p-39a40a6e.entry.js → p-be778e45.entry.js} +1 -1
- package/dist/bromcom-ui/p-c35c11a7.js +5 -0
- package/dist/bromcom-ui/{p-b3b59bc3.entry.js → p-c8b1c1c6.entry.js} +1 -1
- package/dist/bromcom-ui/{p-bec8a936.entry.js → p-cae90479.entry.js} +1 -1
- package/dist/bromcom-ui/{p-14c32a34.entry.js → p-cd567621.entry.js} +1 -1
- package/dist/bromcom-ui/{p-62d178e3.entry.js → p-ceafe408.entry.js} +1 -1
- package/dist/bromcom-ui/{p-673f7ee8.entry.js → p-d2f9f353.entry.js} +1 -1
- package/dist/bromcom-ui/{p-9889a4ed.entry.js → p-d2fe5024.entry.js} +1 -1
- package/dist/bromcom-ui/{p-24710a65.entry.js → p-d498d79b.entry.js} +1 -1
- package/dist/bromcom-ui/{p-3b41df22.entry.js → p-d685ffff.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a839a0e5.entry.js → p-d9331f0f.entry.js} +1 -1
- package/dist/bromcom-ui/{p-dac3117a.entry.js → p-d9ecc3d8.entry.js} +1 -1
- package/dist/bromcom-ui/{p-571dca86.entry.js → p-dc6e9205.entry.js} +1 -1
- package/dist/bromcom-ui/{p-c1b167a3.js → p-e02e88fb.js} +1 -1
- package/dist/bromcom-ui/{p-55291cc5.entry.js → p-f3133898.entry.js} +1 -1
- package/dist/bromcom-ui/{p-cd04678a.entry.js → p-f4af4e66.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a1f9e7d4.entry.js → p-f7dbd393.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d7538ba4.entry.js → p-f84d2e42.entry.js} +1 -1
- package/dist/bromcom-ui/{p-0fe106fc.entry.js → p-f909d419.entry.js} +1 -1
- package/dist/bromcom-ui/p-f9739222.entry.js +5 -0
- package/dist/bromcom-ui/{p-cf171578.js → p-fc1942c6.js} +1 -1
- package/dist/bromcom-ui/{p-5ca4aa84.entry.js → p-fcfc1a26.entry.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_10.cjs.entry.js → bcm-button_11.cjs.entry.js} +147 -15
- 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 +2 -2
- package/dist/cjs/bcm-checkbox-lite_9.cjs.entry.js +2 -2
- package/dist/cjs/bcm-checkbox_2.cjs.entry.js +2 -2
- package/dist/cjs/bcm-chip-group.cjs.entry.js +4 -4
- 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 +2 -2
- 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 +6 -6
- 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 +6 -6
- 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-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/bromcom-ui.cjs.js +3 -3
- package/dist/cjs/{generate-e79347af.js → generate-f0d6805e.js} +10 -1
- package/dist/cjs/{global-9bb1902a.js → global-c61c9656.js} +1 -1
- package/dist/cjs/{input-template-3d21aacb.js → input-template-38924cda.js} +1 -1
- package/dist/cjs/{json-parse-decarator-4d7afa63.js → json-parse-decarator-a2024131.js} +1 -1
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{number-helper-2f971fd8.js → number-helper-7c3fefa2.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-47b7b998.js → package-a737bf36.js} +1 -1
- package/dist/cjs/{stepper-states-a5699b31.js → stepper-states-3b876d4d.js} +1 -1
- package/dist/cjs/{tooltip-helper-7d5d1cb5.js → tooltip-helper-f98dd7a7.js} +3 -3
- package/dist/cjs/{validators-507307b9.js → validators-f2869ecb.js} +1 -1
- package/dist/collection/components/atoms/label/label.js +1 -1
- package/dist/collection/components/molecules/input-dropdown/input-dropdown.js +1 -1
- package/dist/collection/components/molecules/input-dropdown/input-dropdown.style.js +1 -1
- package/dist/collection/helper/generate.js +9 -0
- package/dist/components/bcm-input-dropdown.js +2 -2
- package/dist/components/generate.js +10 -1
- package/dist/components/label.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_10.entry.js → bcm-button_11.entry.js} +147 -16
- 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 +2 -2
- package/dist/esm/bcm-checkbox-lite_9.entry.js +2 -2
- package/dist/esm/bcm-checkbox_2.entry.js +2 -2
- package/dist/esm/bcm-chip-group.entry.js +4 -4
- 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 +2 -2
- 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 +6 -6
- 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 +6 -6
- 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-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/bromcom-ui.js +3 -3
- package/dist/esm/{generate-b9c6f412.js → generate-fff9c034.js} +10 -1
- package/dist/esm/{global-114427da.js → global-446a0022.js} +1 -1
- package/dist/esm/{input-template-dc94e47f.js → input-template-ff26f463.js} +1 -1
- package/dist/esm/{json-parse-decarator-fca2dc09.js → json-parse-decarator-3e533274.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{number-helper-70be3621.js → number-helper-c1ee913b.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-6f4c9f8c.js → package-7d8bb462.js} +1 -1
- package/dist/esm/{stepper-states-291a682f.js → stepper-states-500cb902.js} +1 -1
- package/dist/esm/{tooltip-helper-089735b1.js → tooltip-helper-c22623e4.js} +3 -3
- package/dist/esm/{validators-c1fe8b4b.js → validators-93758ad4.js} +1 -1
- package/dist/types/helper/generate.d.ts +2 -0
- package/dist/types/models/bcm.d.ts +3 -0
- package/package.json +1 -1
- package/dist/bromcom-ui/p-140f3478.js +0 -5
- package/dist/bromcom-ui/p-3d142f76.entry.js +0 -5
- package/dist/bromcom-ui/p-5ff3c68f.entry.js +0 -5
- package/dist/bromcom-ui/p-71b9ea64.entry.js +0 -7
- package/dist/bromcom-ui/p-93b8a3ff.entry.js +0 -5
- package/dist/bromcom-ui/p-d06f5291.js +0 -5
- package/dist/bromcom-ui/p-ea2ce157.js +0 -5
- package/dist/cjs/bcm-switch.cjs.entry.js +0 -151
- package/dist/esm/bcm-switch.entry.js +0 -147
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Stencil
|
|
3
|
-
* Copyright (c) Bromcom.
|
|
4
|
-
*/
|
|
5
|
-
import{r as t,c as i,f as e,h as o,H as n,g as s,F as l}from"./p-170cf07d.js";import"./p-61db1f1f.js";import"./p-626a65e9.js";import{G as r}from"./p-140f3478.js";import"./p-d06f5291.js";import"./p-157359d6.js";import"./p-ea2ce157.js";import"./p-7e44e6b5.js";import{a}from"./p-6369b73b.js";import{C as d}from"./p-a25c8a55.js";import{c as u}from"./p-64fad38b.js";import"./p-3fac58f7.js";import"./p-2e73d572.js";import{c as p}from"./p-08c75801.js";import"./p-436364c8.js";import"./p-8c018ae0.js";import"./p-6edf985f.js";import"./p-85eedabc.js";import"./p-9a41b688.js";const h=p({slots:{base:"tw-font-sans tw-flex tw-flex-col tw-items-start tw-justify-start tw-gap-2",content:"tw-flex tw-flex-row tw-items-center tw-justify-start tw-gap-3",inputArea:"tw-flex tw-flex-row tw-items-center tw-justify-start tw-gap-1 tw-box-content tw-border tw-border-solid tw-max-w-[100px] tw-uppercase tw-font-medium tw-text-center tw-border-gray-300 tw-rounded",input:"tw-flex-1 tw-text-inherit tw-uppercase tw-font-semibold tw-text-center tw-border-none tw-bg-transparent tw-outline-none tw-w-full",button:["input-dropdown-button tw-flex tw-flex-row tw-items-center tw-justify-center tw-gap-1 tw-rounded tw-outline-none tw-bg-slate-100","tw-border tw-border-solid tw-border-slate-300 tw-font-medium tw-text-slate-600","hover:tw-border-slate-400 hover:tw-bg-slate-200","tw-min-w-[32px]","tw-cursor-pointer","disabled:tw-cursor-not-allowed disabled:tw-text-slate-400 disabled:tw-pointer-events-none","readonly:tw-text-slate-700 readonly:tw-cursor-text"],menu:"tw-mt-1 tw-flex tw-flex-col tw-items-start tw-justify-center tw-gap-2 tw-overflow-auto tw-bg-white tw-p-3 tw-font-sans tw-text-3 tw-text-slate-700",menuItem:"tw-flex tw-w-full tw-cursor-pointer tw-flex-row tw-items-start tw-gap-1 tw-rounded tw-px-3 tw-py-1 tw-text-slate-700 hover:tw-bg-blue-100",selectedItem:"tw-flex tw-w-full tw-flex-row tw-items-start tw-gap-1 tw-rounded tw-px-3 tw-py-1 tw-text-slate-700 tw-bg-primary-200",disabledItem:"tw-flex tw-w-full tw-flex-row tw-items-start tw-gap-1 tw-rounded tw-px-3 tw-py-1 tw-cursor-not-allowed tw-text-slate-400 tw-bg-slate-100 hover:tw-bg-slate-100 tw-list-none",commentArea:"tw-flex tw-h-fit tw-w-full tw-min-w-[288px] tw-flex-col tw-items-start tw-gap-3 tw-rounded tw-p-4 tw-shadow-2"},variants:{size:{small:{button:"tw-h-[18px] tw-text-1 tw-leading-none"},medium:{button:"tw-h-[24px] tw-text-2",inputArea:"tw-p-0.5",input:"tw-text-4"},large:{button:"tw-h-[30px] tw-text-2",inputArea:"tw-p-1",input:"tw-text-6"}},invalid:{true:{inputArea:"tw-border-red-600 tw-bg-red-50",input:"tw-text-red-500"}},disabled:{true:{base:"tw-opacity-50 tw-cursor-not-allowed",input:"tw-cursor-not-allowed"}},hideComment:{true:{base:"tw-min-w-[98px]"},false:{base:"tw-min-w-[128px] "}},label:{true:""}},defaultVariants:{size:"medium",invalid:!1,hideComment:!1,disabled:!1}}),c=class{constructor(e){t(this,e),this.change=i(this,"bcm-change",7),this.onChangeDropdown=i(this,"bcm-input-dropdown-change",7),this.handleKeyPress=t=>{var i,e;(null===(e=null===(i=null==t?void 0:t.target)||void 0===i?void 0:i.value)||void 0===e?void 0:e.length)>=+this.maxCharacterLimit&&t.preventDefault()},this._id=r.UID(),this.value=void 0,this.defaultValue={},this.lateKeys="L",this.maxCharacterLimit=1,this.size=a.Size.medium,this.label=void 0,this.placeholder=void 0,this.name=void 0,this.fullWidth=!1,this.hideComment=!1,this.hideCaption=!0,this.disabled=!1,this.required=!1,this.readonly=!1,this.data=[{key:"/",value:"Present",color:"#00b050"},{key:"B",value:"Educated off site (NOT dual registration)",color:"#ffc000"},{key:"C",value:"Other authorised circumstance",color:"#ffc000"},{key:"D",value:"Dual registration",color:"#0070c0"},{key:"E",value:"Excluded",color:"#ff0000"},{key:"F",value:"Free Study",color:"#ffc000"},{key:"I",value:"Illness",color:"#ff0000"},{key:"J",value:"Interview",color:"#ffc000"},{key:"L",value:"Late before reg. closed",color:"#ffc000"}],this.caption=void 0,this.noCaption=!1,this.captionType=a.Status.default,this.captionError=void 0,this.customErrorMessage=void 0,this.captionCache=void 0,this.captionTypeCache=void 0,this.isOpenMenu=!1,this.invalid=!1}get overlayContainer(){return document.getElementById("bcm-overlay-container")}get menuContent(){var t,i;return null!==(i=null===(t=this.overlayContainer)||void 0===t?void 0:t.querySelector(`#i-dropdown-menu-${this._id}`))&&void 0!==i?i:this.el.querySelector(`#i-dropdown-menu-${this._id}`)}get keys(){return this.lateKeys.toLocaleLowerCase().split(",")}get isLate(){var t,i,e,o,n,s;return this.keys.includes(null===(i=null===(t=this.value)||void 0===t?void 0:t.key)||void 0===i?void 0:i.toLocaleLowerCase())||(null===(o=null===(e=this.data)||void 0===e?void 0:e.find((t=>{var i,e,o;return(null===(i=null==t?void 0:t.key)||void 0===i?void 0:i.toLowerCase())===(null===(o=null===(e=this.value)||void 0===e?void 0:e.key)||void 0===o?void 0:o.toLowerCase())})))||void 0===o?void 0:o.isLate)||(null===(s=null===(n=this.data)||void 0===n?void 0:n.find((t=>{var i,e,o;return(null===(i=null==t?void 0:t.key)||void 0===i?void 0:i.toLowerCase())===(null===(o=null===(e=this.value)||void 0===e?void 0:e.key)||void 0===o?void 0:o.toLowerCase())})))||void 0===s?void 0:s.lateMin)>0}componentWillLoad(){var t,i;this.captionCache=this.caption,this.captionTypeCache=this.captionType,(null===(t=Object.keys(this.defaultValue))||void 0===t?void 0:t.length)>0?this.watchDefaultValueHandler(this.defaultValue):this.value=null===(i=this.data)||void 0===i?void 0:i.find((t=>t.selected))}get commentContent(){var t,i;return null!==(i=null===(t=this.overlayContainer)||void 0===t?void 0:t.querySelector(`#i-dropdown-comment-${this._id}`))&&void 0!==i?i:this.el.querySelector(`#i-dropdown-comment-${this._id}`)}clickListener(t){var i,e;const o=r.findEventPath(t,this.el),n=r.findEventPathWithNodeName(t,"BCM-LINKED");o||n||this.keys.includes(null===(i=this.value)||void 0===i?void 0:i.key)||null===(e=this.commentContent)||void 0===e||e.hide()}watchDefaultValueHandler(t){var i,o;t&&(this.value=null===(i=this.data)||void 0===i?void 0:i.find((i=>{var e,o;return(null===(e=null==i?void 0:i.key)||void 0===e?void 0:e.toLowerCase())===(null===(o=t.key)||void 0===o?void 0:o.toLowerCase())})),this.data=this.data.map((i=>(i.key===(null==t?void 0:t.key)?(i=t).selected=!0:i.selected=!1,i))),this.value=null===(o=this.data)||void 0===o?void 0:o.find((t=>null==t?void 0:t.selected)),e(this.el))}async set(t){this.data="string"==typeof t?JSON.parse(t):t}async get(){return this.value}async setClear(){return this.value=null,Promise.resolve()}async resetCaption(){return this.caption=this.captionCache,this.captionType=this.captionTypeCache,this.captionError=null,this.invalid=!1,Promise.resolve()}onSelectItem(t){var i;this.invalid=!1,this.data=this.data.map((i=>Object.assign(Object.assign({},i),{selected:i.key===t.key}))),this.value=null===(i=this.data)||void 0===i?void 0:i.find((t=>null==t?void 0:t.selected)),this.onChangeDropdown.emit(this.value),this.change.emit()}async handleInput(t){var i,e,o,n,s,l,r;const a=null===(i=null==t?void 0:t.target)||void 0===i?void 0:i.value;if(this.isOpenMenu=!0,(null==a?void 0:a.length)>=+this.maxCharacterLimit){const i=null===(e=this.data)||void 0===e?void 0:e.find((t=>{var i;return(null===(i=null==t?void 0:t.key)||void 0===i?void 0:i.toLowerCase())===a.toLowerCase()}));i?(await(null===(o=this.menuContent)||void 0===o?void 0:o.hide()),(null==i?void 0:i.hideComment)||null===(n=this.commentContent)||void 0===n||n.show(),this.onSelectItem(i)):(this.invalid=!0,this.value=t.target.value,await(null===(s=this.menuContent)||void 0===s?void 0:s.show()),this._input.style.color="#ff0000")}else null===(l=this.commentContent)||void 0===l||l.hide(),null===(r=this.menuContent)||void 0===r||r.hide(),this.value=null,this._input.style.color="#000000",this.invalid=!1;this.change.emit()}onClickSave(){var t;null===(t=this.commentContent)||void 0===t||t.hide(),this.data=this.data.map((t=>Object.assign(Object.assign({},t),t.key===this.value.key&&{lateMin:this.value.lateMin,comment:this.value.comment}))),e(this.el),this.onChangeDropdown.emit(this.value),this.change.emit()}async onClick(t){var i,e;(null==t?void 0:t.hideComment)||null===(i=this.commentContent)||void 0===i||i.show(),await(null===(e=this.menuContent)||void 0===e?void 0:e.hide()),this.onSelectItem(t)}render(){var t,i,e,s,r;const{size:a,label:p,placeholder:c,required:m,disabled:w,readonly:v,_id:x,invalid:g,hideComment:f,noCaption:b,customErrorMessage:y,caption:z,captionType:j,captionError:k,hideCaption:C}=this,{base:I,inputArea:E,input:L,button:O,menu:$,menuItem:A,commentArea:D,disabledItem:M,content:B,selectedItem:S}=h({size:a,invalid:g,hideComment:f,disabled:w});return o(n,{class:I()},p&&o("bcm-label",{htmlFor:x+"-dropdown-input",size:a,value:p,required:m}),o("div",{class:B()},o("div",{class:E()},o("input",{id:x+"-dropdown-input",class:L(),style:{color:null===(t=this.value)||void 0===t?void 0:t.color},type:"text",tabIndex:-1,placeholder:c,value:null===(i=this.value)||void 0===i?void 0:i.key,disabled:w,required:m,autoComplete:"off",readOnly:v,onKeyPress:t=>this.handleKeyPress(t),onInput:t=>this.handleInput(t),ref:t=>this._input=t}),o("button",{disabled:w,id:`i-dropdown-button-${x}`,class:O(),onClick:()=>this.isOpenMenu=!0},o("i",{class:"fas fa-chevron-down"})),o("bcm-linked",{"onBcm-open":({detail:t})=>{var i;return t&&(null===(i=this.commentContent)||void 0===i?void 0:i.hide())},class:"tw-mt-1",id:`i-dropdown-menu-${x}`,"target-id":`i-dropdown-button-${x}`,placement:"bottom-start"},o((()=>{var t;return o(l,null,this.isOpenMenu?o("div",{class:$()},this.invalid&&o("li",{class:A()+" tw-bg-red-100 hover:tw-bg-red-100"},o("span",{class:"tw-text-red-900"},o("i",{class:"far fa-exclamation-circle"})),o("span",null,"There is not mark you entered, please use")),null===(t=this.data)||void 0===t?void 0:t.map((t=>o(l,null,o("li",(null==t?void 0:t.disabled)?{class:M()}:{class:(null==t?void 0:t.selected)?S():A(),onClick:()=>this.onClick(t)},o("span",null,t.key)," - ",o("span",null,t.value)))))):null)}),null)),o("bcm-linked",{id:`i-dropdown-comment-${x}`,"target-id":x,trigger:"custom",placement:"left"},o((()=>{var t,i,e;return o(l,null,this.isOpenMenu?o("div",{class:D()},this.isLate?o(l,null,o("bcm-input",{label:"Minus Late",required:!0,id:this._id+"-input-dropdown-late-content-input",type:"number","full-width":!0,"no-caption":!0,autocomplete:!1,value:null===(t=this.value)||void 0===t?void 0:t.lateMin,placeholder:"Enter Minus Late","onBcm-change":({detail:t})=>this.value.lateMin=+t},o("i",{slot:"prefix",class:"far fa-clock"}))):null,o("bcm-textarea",{"full-width":!0,value:null!==(e=null===(i=this.value)||void 0===i?void 0:i.comment)&&void 0!==e?e:"","onBcm-change":({detail:t})=>this.value.comment=t,label:"Description","no-caption":!0,rows:4}),o("footer",{class:"tw-flex tw-w-full tw-flex-row tw-items-center tw-justify-end tw-gap-2"},o("bcm-button",{icon:"fas fa-times",kind:"ghost","icon-position":"prefix",onClick:()=>{var t;return null===(t=this.commentContent)||void 0===t?void 0:t.hide()}},"Close"),o("bcm-button",{icon:"fas fa-save","icon-position":"prefix",onClick:()=>this.onClickSave()},"Save"))):null)}),null))),this.hideComment?null:o("span",{onClick:()=>{var t,i;(null===(t=this.value)||void 0===t?void 0:t.key)&&(this.isOpenMenu=!0,null===(i=this.commentContent)||void 0===i||i.show())},class:u((null===(e=this.value)||void 0===e?void 0:e.comment)||(null===(s=this.value)||void 0===s?void 0:s.lateMin)>0?"tw-text-slate-600":"tw-text-slate-400",{"tw-cursor-pointer":null===(r=this.value)||void 0===r?void 0:r.key})},o("i",{class:"fas fa-comment"}))),!C&&o(d,{noCaption:b,captionType:j,captionError:k,caption:z,customErrorMessage:y}))}get el(){return s(this)}static get watchers(){return{defaultValue:["watchDefaultValueHandler"]}}};c.style='@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}.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}:host{display:flex;flex-direction:column;width:100%;position:relative}.input-dropdown-button i{transition:transform 0.2s ease-in-out}.input-dropdown-button[linked-is-open]>i{transform:rotate(-180deg);transition:transform 0.2s ease-in-out}';export{c as bcm_input_dropdown}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Stencil
|
|
3
|
-
* Copyright (c) Bromcom.
|
|
4
|
-
*/
|
|
5
|
-
import{s}from"./p-140f3478.js";class r{}r.isNumber=r=>s((()=>/^[0-9]+$/i.test(r))),r.convertToNumber=r=>s((()=>Number(r))),r.replaceNumber=r=>s((()=>r.replace(/[^0-9]/g,""))),r.replaceFloat=r=>s((()=>r.replace(/[^0-9.]/g,""))),r.toFixed=(r,a)=>s((()=>r.toFixed(a))),r.parseFloatFixed=(a,e)=>s((()=>parseFloat(r.replaceFloat(a)).toFixed(e))),r.getDecimalLength=r=>s((()=>r.split(".")[1]?r.split(".")[1].length:0)),r.toNumber=r=>s((()=>Number(r.replace(/[^0-9.]/g,""))));export{r as N}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Stencil
|
|
3
|
-
* Copyright (c) Bromcom.
|
|
4
|
-
*/
|
|
5
|
-
import{s as f}from"./p-140f3478.js";class a{}a.compareTwoArrayIsSame=(a,d)=>f((()=>a.length===d.length&&a.every(((f,a)=>f===d[a])))),a.isEmailValid=f=>/^(([^<>()\[\]\\.,;:\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(f),a.isUrlValid=f=>/^(?:(?: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(f),a.isNumberValid=f=>/^[+-]?\d+$/.test(f),a.isNumberFloatValid=f=>/^\d+(\.\d+)?$/.test(f),a.isPhoneValid=f=>/^(?=.*[0-9])[- +()0-9]+$/.test(f),a.pattern=(f,a)=>new RegExp(a).test(f),a.isValidate=(f,d)=>{switch(d){case"email":return a.isEmailValid(f);case"url":return a.isUrlValid(f);case"number":return a.isNumberValid(f)||a.isNumberFloatValid(f);case"phone":return a.isPhoneValid(f);default:return!0}};export{a as V}
|
|
@@ -1,151 +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 isLoadDecorator = require('./is-load-decorator-15036f37.js');
|
|
12
|
-
const generate = require('./generate-e79347af.js');
|
|
13
|
-
const bcm = require('./bcm-3c58a6d5.js');
|
|
14
|
-
const captionTemplate = require('./caption-template-6f535b93.js');
|
|
15
|
-
const utils = require('./utils-fc077139.js');
|
|
16
|
-
require('./_commonjsHelpers-ed84c3ca.js');
|
|
17
|
-
require('./package-47b7b998.js');
|
|
18
|
-
require('./colors-078851ec.js');
|
|
19
|
-
|
|
20
|
-
const switchCss = "@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-switch{display:inline-flex;user-select:none;flex-direction:column;margin-bottom:8px}.bcm-switch__container{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start}.bcm-switch__container--left,.bcm-switch__container--right{align-items:center}.bcm-switch__container--left .bcm-label__text,.bcm-switch__container--right .bcm-label__text{margin:0}.bcm-switch__container--left{flex-direction:row}.bcm-switch__container--left .bcm-label__text{margin-right:4px}.bcm-switch__container--right{flex-direction:row-reverse}.bcm-switch__container--right .bcm-label__text{margin-left:4px}.bcm-switch:focus-visible{outline:none}.bcm-switch:focus-visible .bcm-switch__toggle{background-color:var(--bcm-new-ds-color-slate-400)}.bcm-switch:focus-visible .bcm-switch__toggle.switch-checked{background-color:var(--bcm-new-ds-color-blue-600)}.bcm-switch:hover{outline:none}.bcm-switch:hover .bcm-switch__toggle .handle{background-color:var(--bcm-new-ds-color-slate-100)}.bcm-switch:hover .bcm-switch__toggle.switch-checked .handle{background-color:var(--bcm-new-ds-color-slate-100)}.bcm-switch *{box-sizing:border-box}.bcm-switch.hidden{display:none}.bcm-switch input{display:none}.bcm-switch.disabled .bcm-switch__toggle{cursor:not-allowed;opacity:40%}.bcm-switch.readonly .bcm-switch__toggle{cursor:default;opacity:80%}.bcm-switch__label{font-family:\"Inter\", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;display:inline-flex;align-items:center;margin:0}.bcm-switch__label .active-text{color:var(--bcm-new-ds-color-blue-500);margin:0 0 0 4px}.bcm-switch__label .inactive-text{color:var(--bcm-new-ds-color-slate-500);margin:0 4px 0 0}.bcm-switch__toggle{display:flex;justify-content:space-between;align-items:center;border-radius:16px;background-color:var(--bcm-new-ds-color-slate-300);position:relative;cursor:pointer}.bcm-switch__toggle .handle{padding:1px;position:absolute;background-color:var(--bcm-new-ds-color-slate-50);display:inline-flex;align-items:center;justify-content:center;border-radius:16px;transition:left 0.2s ease-in-out, width 0.2s ease-in-out;box-shadow:0 1px 3px 0 rgba(17, 24, 38, 0.1)}.bcm-switch__toggle .icon-active{opacity:0;margin-left:2px}.bcm-switch__toggle .icon-inactive{opacity:1;margin-right:2px}.bcm-switch__toggle.bcm-switch__size-small{width:32px;min-width:32px;height:16px;padding:4px}.bcm-switch__toggle.bcm-switch__size-small .handle{width:12px;height:12px;left:2px}.bcm-switch__toggle.bcm-switch__size-small.switch-checked .handle{left:18px}.bcm-switch__toggle.bcm-switch__size-small:active:not(.disabled):not(.readonly) .handle{width:16px}.bcm-switch__toggle.bcm-switch__size-small:active.switch-checked:not(.disabled):not(.readonly) .handle{left:12px}.bcm-switch__toggle.bcm-switch__size-small .switch-spinner{box-sizing:border-box;display:inline-flex;width:9px;height:9px;border-radius:50%;border:1px solid var(--bcm-new-ds-color-white);border-top-color:var(--bcm-new-ds-color-slate-900);animation:switch-spinner 1.5s linear infinite}.bcm-switch__toggle.bcm-switch__size-medium{width:36px;min-width:36px;height:18px;padding:4px}.bcm-switch__toggle.bcm-switch__size-medium .handle{width:14px;height:14px;left:2px}.bcm-switch__toggle.bcm-switch__size-medium.switch-checked .handle{left:20px}.bcm-switch__toggle.bcm-switch__size-medium:active:not(.disabled):not(.readonly) .handle{width:18px}.bcm-switch__toggle.bcm-switch__size-medium:active.switch-checked:not(.disabled):not(.readonly) .handle{left:14px}.bcm-switch__toggle.bcm-switch__size-medium .switch-spinner{box-sizing:border-box;display:inline-flex;width:11px;height:11px;border-radius:50%;border:1px solid var(--bcm-new-ds-color-white);border-top-color:var(--bcm-new-ds-color-slate-900);animation:switch-spinner 1.5s linear infinite}.bcm-switch__toggle.bcm-switch__size-large{width:40px;min-width:40px;height:20px;padding:4px}.bcm-switch__toggle.bcm-switch__size-large .handle{width:16px;height:16px;left:2px}.bcm-switch__toggle.bcm-switch__size-large.switch-checked .handle{left:22px}.bcm-switch__toggle.bcm-switch__size-large:active:not(.disabled):not(.readonly) .handle{width:20px}.bcm-switch__toggle.bcm-switch__size-large:active.switch-checked:not(.disabled):not(.readonly) .handle{left:16px}.bcm-switch__toggle.bcm-switch__size-large .switch-spinner{box-sizing:border-box;display:inline-flex;width:13px;height:13px;border-radius:50%;border:1px solid var(--bcm-new-ds-color-white);border-top-color:var(--bcm-new-ds-color-slate-900);animation:switch-spinner 1.5s linear infinite}.bcm-switch__toggle.switch-checked{background-color:var(--bcm-new-ds-color-blue-500)}.bcm-switch__toggle.switch-checked .icon-active{color:var(--bcm-new-ds-color-slate-100);opacity:1}.bcm-switch__toggle.switch-checked .icon-inactive{opacity:0}.bcm-switch__toggle.switch-checked .switch-spinner{border-top-color:var(--bcm-new-ds-color-blue-600)}.bcm-switch__size-small .bcm-switch__label,.bcm-switch__size-small .bcm-label__text{font-size:12px}.bcm-switch__size-small .bcm-switch__toggle{font-size:8px}.bcm-switch__size-medium .bcm-switch__label,.bcm-switch__size-medium .bcm-label__text{font-size:13px}.bcm-switch__size-medium .bcm-switch__toggle{font-size:9px}.bcm-switch__size-large .bcm-switch__label,.bcm-switch__size-large .bcm-label__text{font-size:16px}.bcm-switch__size-large .bcm-switch__toggle{font-size:12px}@keyframes switch-spinner{to{transform:rotate(360deg)}}";
|
|
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 BcmSwitch = class {
|
|
33
|
-
constructor(hostRef) {
|
|
34
|
-
index.registerInstance(this, hostRef);
|
|
35
|
-
this.change = index.createEvent(this, "bcm-change", 7);
|
|
36
|
-
this.focus = index.createEvent(this, "bcm-focus", 7);
|
|
37
|
-
this.blur = index.createEvent(this, "bcm-blur", 7);
|
|
38
|
-
this._id = generate.Generate.UID();
|
|
39
|
-
this._internal_id = generate.Generate.UID();
|
|
40
|
-
this.checked = false;
|
|
41
|
-
this.hidden = false;
|
|
42
|
-
this.value = false;
|
|
43
|
-
this.name = undefined;
|
|
44
|
-
this.disabled = false;
|
|
45
|
-
this.required = false;
|
|
46
|
-
this.size = bcm.Bcm.Size.medium;
|
|
47
|
-
this.readonly = false;
|
|
48
|
-
this.activeIcon = undefined;
|
|
49
|
-
this.activeText = undefined;
|
|
50
|
-
this.inactiveIcon = undefined;
|
|
51
|
-
this.inactiveText = undefined;
|
|
52
|
-
this.pending = false;
|
|
53
|
-
this.label = undefined;
|
|
54
|
-
this.labelPosition = 'top';
|
|
55
|
-
this.tooltip = undefined;
|
|
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
|
-
handleChange() {
|
|
69
|
-
this.checked = this.inputElement.checked;
|
|
70
|
-
this.value = this.checked;
|
|
71
|
-
this.change.emit(this.checked);
|
|
72
|
-
}
|
|
73
|
-
componentWillRender() {
|
|
74
|
-
if (this.pending) {
|
|
75
|
-
this.disabled = true;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
async onBcmFocus() {
|
|
79
|
-
this.el.focus();
|
|
80
|
-
}
|
|
81
|
-
async onBcmBlur() {
|
|
82
|
-
this.el.blur();
|
|
83
|
-
}
|
|
84
|
-
async set(data) {
|
|
85
|
-
if (typeof data === 'boolean') {
|
|
86
|
-
await this.check(data);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
async check(uncheck = true) {
|
|
90
|
-
this.inputElement.checked = uncheck;
|
|
91
|
-
this.handleChange();
|
|
92
|
-
}
|
|
93
|
-
async get() {
|
|
94
|
-
return this.checked || false;
|
|
95
|
-
}
|
|
96
|
-
async setClear() {
|
|
97
|
-
if (this.inputElement.checked == true) {
|
|
98
|
-
this.inputElement.checked = false;
|
|
99
|
-
this.checked = this.inputElement.checked;
|
|
100
|
-
this.value = this.checked;
|
|
101
|
-
this.change.emit(this.checked);
|
|
102
|
-
}
|
|
103
|
-
await utils.delay(10);
|
|
104
|
-
return Promise.resolve();
|
|
105
|
-
}
|
|
106
|
-
async resetCaption() {
|
|
107
|
-
await utils.delay(10);
|
|
108
|
-
this.caption = this.captionCache;
|
|
109
|
-
this.captionType = this.captionTypeCache;
|
|
110
|
-
this.captionError = null;
|
|
111
|
-
await utils.delay(10);
|
|
112
|
-
return Promise.resolve();
|
|
113
|
-
}
|
|
114
|
-
handleKeyUp(ev) {
|
|
115
|
-
if (ev.keyCode == bcm.Bcm.KeyCode.space || ev.keyCode == bcm.Bcm.KeyCode.enter) {
|
|
116
|
-
if (!this.disabled && !this.readonly) {
|
|
117
|
-
this.inputElement.checked = !this.inputElement.checked;
|
|
118
|
-
this.handleChange();
|
|
119
|
-
}
|
|
120
|
-
ev.stopPropagation();
|
|
121
|
-
ev.preventDefault();
|
|
122
|
-
return false;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
render() {
|
|
126
|
-
const { hidden, _internal_id, checked, size, activeIcon, inactiveIcon, activeText, inactiveText, pending, disabled, readonly, label, required, noCaption, captionType, captionError, caption } = this;
|
|
127
|
-
const classes = index$1.classnames('bcm-switch__toggle', 'bcm-switch__size-' + size, {
|
|
128
|
-
'switch-checked': checked,
|
|
129
|
-
'disabled': disabled,
|
|
130
|
-
'readonly': readonly
|
|
131
|
-
});
|
|
132
|
-
const bcmSwitchClasses = index$1.classnames('bcm-switch', 'bcm-switch__size-' + size, {
|
|
133
|
-
hidden,
|
|
134
|
-
checked,
|
|
135
|
-
disabled,
|
|
136
|
-
readonly
|
|
137
|
-
});
|
|
138
|
-
const bcmSwitchLabel = index$1.classnames('bcm-switch__label', 'input-size-' + bcm.Bcm.Size[size]);
|
|
139
|
-
const bcmSwitchContainer = index$1.classnames('bcm-switch__container', `bcm-switch__container--${this.labelPosition}`);
|
|
140
|
-
const switchText = (text) => (size != bcm.Bcm.Size.small && (activeText || inactiveText)) && (index.h("span", { class: text + '-text' }, text == 'active' ? activeText : inactiveText));
|
|
141
|
-
const switchIcon = (text) => (size != bcm.Bcm.Size.small && (activeIcon || inactiveIcon)) && index.h("bcm-icon", { icon: text == 'active' ? activeIcon : inactiveIcon, class: ' icon-' + text });
|
|
142
|
-
return (index.h(index.Host, { tabindex: "0", onFocus: () => this.focus.emit(this.el), onBlur: () => this.blur.emit(this.el), class: bcmSwitchClasses }, index.h("span", { hidden: true }, index.h("slot", null)), index.h("div", { class: bcmSwitchContainer }, label && index.h("bcm-label", { htmlFor: _internal_id, tooltip: this.tooltip, type: captionType, value: label, required: required }), index.h("input", { id: _internal_id, onChange: () => this.handleChange(), ref: el => (this.inputElement = el), checked: checked, type: "checkbox", class: "switch", disabled: disabled || readonly }), index.h("label", { htmlFor: _internal_id, class: bcmSwitchLabel }, switchText('inactive'), index.h("div", { class: classes }, switchIcon('active'), index.h("span", { class: "handle" }, pending && index.h("span", { class: "switch-spinner" })), switchIcon('inactive')), switchText('active'))), index.h(captionTemplate.CaptionTemplate, { noCaption: noCaption, captionType: captionType, captionError: captionError, caption: caption })));
|
|
143
|
-
}
|
|
144
|
-
get el() { return index.getElement(this); }
|
|
145
|
-
};
|
|
146
|
-
__decorate([
|
|
147
|
-
isLoadDecorator.IsLoad()
|
|
148
|
-
], BcmSwitch.prototype, "el", void 0);
|
|
149
|
-
BcmSwitch.style = switchCss;
|
|
150
|
-
|
|
151
|
-
exports.bcm_switch = BcmSwitch;
|
|
@@ -1,147 +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 { I as IsLoad } from './is-load-decorator-8277e3b8.js';
|
|
8
|
-
import { G as Generate } from './generate-b9c6f412.js';
|
|
9
|
-
import { B as Bcm } from './bcm-0f9cc27c.js';
|
|
10
|
-
import { C as CaptionTemplate } from './caption-template-0c32ce16.js';
|
|
11
|
-
import { d as delay } from './utils-57652744.js';
|
|
12
|
-
import './_commonjsHelpers-7002e5de.js';
|
|
13
|
-
import './package-6f4c9f8c.js';
|
|
14
|
-
import './colors-ebea297f.js';
|
|
15
|
-
|
|
16
|
-
const switchCss = "@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-switch{display:inline-flex;user-select:none;flex-direction:column;margin-bottom:8px}.bcm-switch__container{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start}.bcm-switch__container--left,.bcm-switch__container--right{align-items:center}.bcm-switch__container--left .bcm-label__text,.bcm-switch__container--right .bcm-label__text{margin:0}.bcm-switch__container--left{flex-direction:row}.bcm-switch__container--left .bcm-label__text{margin-right:4px}.bcm-switch__container--right{flex-direction:row-reverse}.bcm-switch__container--right .bcm-label__text{margin-left:4px}.bcm-switch:focus-visible{outline:none}.bcm-switch:focus-visible .bcm-switch__toggle{background-color:var(--bcm-new-ds-color-slate-400)}.bcm-switch:focus-visible .bcm-switch__toggle.switch-checked{background-color:var(--bcm-new-ds-color-blue-600)}.bcm-switch:hover{outline:none}.bcm-switch:hover .bcm-switch__toggle .handle{background-color:var(--bcm-new-ds-color-slate-100)}.bcm-switch:hover .bcm-switch__toggle.switch-checked .handle{background-color:var(--bcm-new-ds-color-slate-100)}.bcm-switch *{box-sizing:border-box}.bcm-switch.hidden{display:none}.bcm-switch input{display:none}.bcm-switch.disabled .bcm-switch__toggle{cursor:not-allowed;opacity:40%}.bcm-switch.readonly .bcm-switch__toggle{cursor:default;opacity:80%}.bcm-switch__label{font-family:\"Inter\", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;display:inline-flex;align-items:center;margin:0}.bcm-switch__label .active-text{color:var(--bcm-new-ds-color-blue-500);margin:0 0 0 4px}.bcm-switch__label .inactive-text{color:var(--bcm-new-ds-color-slate-500);margin:0 4px 0 0}.bcm-switch__toggle{display:flex;justify-content:space-between;align-items:center;border-radius:16px;background-color:var(--bcm-new-ds-color-slate-300);position:relative;cursor:pointer}.bcm-switch__toggle .handle{padding:1px;position:absolute;background-color:var(--bcm-new-ds-color-slate-50);display:inline-flex;align-items:center;justify-content:center;border-radius:16px;transition:left 0.2s ease-in-out, width 0.2s ease-in-out;box-shadow:0 1px 3px 0 rgba(17, 24, 38, 0.1)}.bcm-switch__toggle .icon-active{opacity:0;margin-left:2px}.bcm-switch__toggle .icon-inactive{opacity:1;margin-right:2px}.bcm-switch__toggle.bcm-switch__size-small{width:32px;min-width:32px;height:16px;padding:4px}.bcm-switch__toggle.bcm-switch__size-small .handle{width:12px;height:12px;left:2px}.bcm-switch__toggle.bcm-switch__size-small.switch-checked .handle{left:18px}.bcm-switch__toggle.bcm-switch__size-small:active:not(.disabled):not(.readonly) .handle{width:16px}.bcm-switch__toggle.bcm-switch__size-small:active.switch-checked:not(.disabled):not(.readonly) .handle{left:12px}.bcm-switch__toggle.bcm-switch__size-small .switch-spinner{box-sizing:border-box;display:inline-flex;width:9px;height:9px;border-radius:50%;border:1px solid var(--bcm-new-ds-color-white);border-top-color:var(--bcm-new-ds-color-slate-900);animation:switch-spinner 1.5s linear infinite}.bcm-switch__toggle.bcm-switch__size-medium{width:36px;min-width:36px;height:18px;padding:4px}.bcm-switch__toggle.bcm-switch__size-medium .handle{width:14px;height:14px;left:2px}.bcm-switch__toggle.bcm-switch__size-medium.switch-checked .handle{left:20px}.bcm-switch__toggle.bcm-switch__size-medium:active:not(.disabled):not(.readonly) .handle{width:18px}.bcm-switch__toggle.bcm-switch__size-medium:active.switch-checked:not(.disabled):not(.readonly) .handle{left:14px}.bcm-switch__toggle.bcm-switch__size-medium .switch-spinner{box-sizing:border-box;display:inline-flex;width:11px;height:11px;border-radius:50%;border:1px solid var(--bcm-new-ds-color-white);border-top-color:var(--bcm-new-ds-color-slate-900);animation:switch-spinner 1.5s linear infinite}.bcm-switch__toggle.bcm-switch__size-large{width:40px;min-width:40px;height:20px;padding:4px}.bcm-switch__toggle.bcm-switch__size-large .handle{width:16px;height:16px;left:2px}.bcm-switch__toggle.bcm-switch__size-large.switch-checked .handle{left:22px}.bcm-switch__toggle.bcm-switch__size-large:active:not(.disabled):not(.readonly) .handle{width:20px}.bcm-switch__toggle.bcm-switch__size-large:active.switch-checked:not(.disabled):not(.readonly) .handle{left:16px}.bcm-switch__toggle.bcm-switch__size-large .switch-spinner{box-sizing:border-box;display:inline-flex;width:13px;height:13px;border-radius:50%;border:1px solid var(--bcm-new-ds-color-white);border-top-color:var(--bcm-new-ds-color-slate-900);animation:switch-spinner 1.5s linear infinite}.bcm-switch__toggle.switch-checked{background-color:var(--bcm-new-ds-color-blue-500)}.bcm-switch__toggle.switch-checked .icon-active{color:var(--bcm-new-ds-color-slate-100);opacity:1}.bcm-switch__toggle.switch-checked .icon-inactive{opacity:0}.bcm-switch__toggle.switch-checked .switch-spinner{border-top-color:var(--bcm-new-ds-color-blue-600)}.bcm-switch__size-small .bcm-switch__label,.bcm-switch__size-small .bcm-label__text{font-size:12px}.bcm-switch__size-small .bcm-switch__toggle{font-size:8px}.bcm-switch__size-medium .bcm-switch__label,.bcm-switch__size-medium .bcm-label__text{font-size:13px}.bcm-switch__size-medium .bcm-switch__toggle{font-size:9px}.bcm-switch__size-large .bcm-switch__label,.bcm-switch__size-large .bcm-label__text{font-size:16px}.bcm-switch__size-large .bcm-switch__toggle{font-size:12px}@keyframes switch-spinner{to{transform:rotate(360deg)}}";
|
|
17
|
-
|
|
18
|
-
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
21
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
22
|
-
else
|
|
23
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
24
|
-
if (d = decorators[i])
|
|
25
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
26
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
27
|
-
};
|
|
28
|
-
const BcmSwitch = class {
|
|
29
|
-
constructor(hostRef) {
|
|
30
|
-
registerInstance(this, hostRef);
|
|
31
|
-
this.change = createEvent(this, "bcm-change", 7);
|
|
32
|
-
this.focus = createEvent(this, "bcm-focus", 7);
|
|
33
|
-
this.blur = createEvent(this, "bcm-blur", 7);
|
|
34
|
-
this._id = Generate.UID();
|
|
35
|
-
this._internal_id = Generate.UID();
|
|
36
|
-
this.checked = false;
|
|
37
|
-
this.hidden = false;
|
|
38
|
-
this.value = false;
|
|
39
|
-
this.name = undefined;
|
|
40
|
-
this.disabled = false;
|
|
41
|
-
this.required = false;
|
|
42
|
-
this.size = Bcm.Size.medium;
|
|
43
|
-
this.readonly = false;
|
|
44
|
-
this.activeIcon = undefined;
|
|
45
|
-
this.activeText = undefined;
|
|
46
|
-
this.inactiveIcon = undefined;
|
|
47
|
-
this.inactiveText = undefined;
|
|
48
|
-
this.pending = false;
|
|
49
|
-
this.label = undefined;
|
|
50
|
-
this.labelPosition = 'top';
|
|
51
|
-
this.tooltip = undefined;
|
|
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
|
-
handleChange() {
|
|
65
|
-
this.checked = this.inputElement.checked;
|
|
66
|
-
this.value = this.checked;
|
|
67
|
-
this.change.emit(this.checked);
|
|
68
|
-
}
|
|
69
|
-
componentWillRender() {
|
|
70
|
-
if (this.pending) {
|
|
71
|
-
this.disabled = true;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
async onBcmFocus() {
|
|
75
|
-
this.el.focus();
|
|
76
|
-
}
|
|
77
|
-
async onBcmBlur() {
|
|
78
|
-
this.el.blur();
|
|
79
|
-
}
|
|
80
|
-
async set(data) {
|
|
81
|
-
if (typeof data === 'boolean') {
|
|
82
|
-
await this.check(data);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
async check(uncheck = true) {
|
|
86
|
-
this.inputElement.checked = uncheck;
|
|
87
|
-
this.handleChange();
|
|
88
|
-
}
|
|
89
|
-
async get() {
|
|
90
|
-
return this.checked || false;
|
|
91
|
-
}
|
|
92
|
-
async setClear() {
|
|
93
|
-
if (this.inputElement.checked == true) {
|
|
94
|
-
this.inputElement.checked = false;
|
|
95
|
-
this.checked = this.inputElement.checked;
|
|
96
|
-
this.value = this.checked;
|
|
97
|
-
this.change.emit(this.checked);
|
|
98
|
-
}
|
|
99
|
-
await delay(10);
|
|
100
|
-
return Promise.resolve();
|
|
101
|
-
}
|
|
102
|
-
async resetCaption() {
|
|
103
|
-
await delay(10);
|
|
104
|
-
this.caption = this.captionCache;
|
|
105
|
-
this.captionType = this.captionTypeCache;
|
|
106
|
-
this.captionError = null;
|
|
107
|
-
await delay(10);
|
|
108
|
-
return Promise.resolve();
|
|
109
|
-
}
|
|
110
|
-
handleKeyUp(ev) {
|
|
111
|
-
if (ev.keyCode == Bcm.KeyCode.space || ev.keyCode == Bcm.KeyCode.enter) {
|
|
112
|
-
if (!this.disabled && !this.readonly) {
|
|
113
|
-
this.inputElement.checked = !this.inputElement.checked;
|
|
114
|
-
this.handleChange();
|
|
115
|
-
}
|
|
116
|
-
ev.stopPropagation();
|
|
117
|
-
ev.preventDefault();
|
|
118
|
-
return false;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
render() {
|
|
122
|
-
const { hidden, _internal_id, checked, size, activeIcon, inactiveIcon, activeText, inactiveText, pending, disabled, readonly, label, required, noCaption, captionType, captionError, caption } = this;
|
|
123
|
-
const classes = classnames('bcm-switch__toggle', 'bcm-switch__size-' + size, {
|
|
124
|
-
'switch-checked': checked,
|
|
125
|
-
'disabled': disabled,
|
|
126
|
-
'readonly': readonly
|
|
127
|
-
});
|
|
128
|
-
const bcmSwitchClasses = classnames('bcm-switch', 'bcm-switch__size-' + size, {
|
|
129
|
-
hidden,
|
|
130
|
-
checked,
|
|
131
|
-
disabled,
|
|
132
|
-
readonly
|
|
133
|
-
});
|
|
134
|
-
const bcmSwitchLabel = classnames('bcm-switch__label', 'input-size-' + Bcm.Size[size]);
|
|
135
|
-
const bcmSwitchContainer = classnames('bcm-switch__container', `bcm-switch__container--${this.labelPosition}`);
|
|
136
|
-
const switchText = (text) => (size != Bcm.Size.small && (activeText || inactiveText)) && (h("span", { class: text + '-text' }, text == 'active' ? activeText : inactiveText));
|
|
137
|
-
const switchIcon = (text) => (size != Bcm.Size.small && (activeIcon || inactiveIcon)) && h("bcm-icon", { icon: text == 'active' ? activeIcon : inactiveIcon, class: ' icon-' + text });
|
|
138
|
-
return (h(Host, { tabindex: "0", onFocus: () => this.focus.emit(this.el), onBlur: () => this.blur.emit(this.el), class: bcmSwitchClasses }, h("span", { hidden: true }, h("slot", null)), h("div", { class: bcmSwitchContainer }, label && h("bcm-label", { htmlFor: _internal_id, tooltip: this.tooltip, type: captionType, value: label, required: required }), h("input", { id: _internal_id, onChange: () => this.handleChange(), ref: el => (this.inputElement = el), checked: checked, type: "checkbox", class: "switch", disabled: disabled || readonly }), h("label", { htmlFor: _internal_id, class: bcmSwitchLabel }, switchText('inactive'), h("div", { class: classes }, switchIcon('active'), h("span", { class: "handle" }, pending && h("span", { class: "switch-spinner" })), switchIcon('inactive')), switchText('active'))), h(CaptionTemplate, { noCaption: noCaption, captionType: captionType, captionError: captionError, caption: caption })));
|
|
139
|
-
}
|
|
140
|
-
get el() { return getElement(this); }
|
|
141
|
-
};
|
|
142
|
-
__decorate([
|
|
143
|
-
IsLoad()
|
|
144
|
-
], BcmSwitch.prototype, "el", void 0);
|
|
145
|
-
BcmSwitch.style = switchCss;
|
|
146
|
-
|
|
147
|
-
export { BcmSwitch as bcm_switch };
|