bromcom-ui 2.9.0-rc.5 → 2.9.0-rc.6
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-fb22bc06.entry.js → p-0641597e.entry.js} +1 -1
- package/dist/bromcom-ui/{p-7bff7371.entry.js → p-16dd7db9.entry.js} +1 -1
- package/dist/bromcom-ui/p-17264523.js +5 -0
- package/dist/bromcom-ui/{p-947c78e3.js → p-17af6738.js} +1 -1
- package/dist/bromcom-ui/p-184b7d3b.js +5 -0
- package/dist/bromcom-ui/{p-65318f25.entry.js → p-1fbd8af5.entry.js} +1 -1
- package/dist/bromcom-ui/{p-29a12785.entry.js → p-24b8154c.entry.js} +1 -1
- package/dist/bromcom-ui/{p-1a405289.entry.js → p-24d8e9d6.entry.js} +1 -1
- package/dist/bromcom-ui/{p-f532862e.entry.js → p-2afdec61.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a8aaa382.js → p-2b13dd48.js} +1 -1
- package/dist/bromcom-ui/{p-f0350c0c.entry.js → p-2b88c7bb.entry.js} +1 -1
- package/dist/bromcom-ui/{p-2a02b473.entry.js → p-31eabaf3.entry.js} +1 -1
- package/dist/bromcom-ui/{p-38972c46.js → p-3215d598.js} +1 -1
- package/dist/bromcom-ui/{p-ca32c1b9.entry.js → p-3baf677c.entry.js} +1 -1
- package/dist/bromcom-ui/{p-1a04159f.entry.js → p-459212eb.entry.js} +1 -1
- package/dist/bromcom-ui/p-57f8802e.entry.js +5 -0
- package/dist/bromcom-ui/{p-9d98d32d.entry.js → p-5c468c5b.entry.js} +1 -1
- package/dist/bromcom-ui/{p-5855b125.entry.js → p-6272ecb4.entry.js} +1 -1
- package/dist/bromcom-ui/{p-24cffc16.entry.js → p-6a5ac874.entry.js} +1 -1
- package/dist/bromcom-ui/{p-721e0cb5.entry.js → p-6b861832.entry.js} +1 -1
- package/dist/bromcom-ui/{p-ef8bbaf3.entry.js → p-7a394115.entry.js} +1 -1
- package/dist/bromcom-ui/{p-96614f57.entry.js → p-81b2dffb.entry.js} +1 -1
- package/dist/bromcom-ui/{p-285722ad.entry.js → p-891de348.entry.js} +1 -1
- package/dist/bromcom-ui/{p-365eec45.entry.js → p-8d7bbe30.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a02c333f.entry.js → p-8de9d6b6.entry.js} +1 -1
- package/dist/bromcom-ui/p-8fc8b4ff.entry.js +5 -0
- package/dist/bromcom-ui/{p-25f9928a.entry.js → p-9099a1bf.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d37379d4.entry.js → p-9773e744.entry.js} +1 -1
- package/dist/bromcom-ui/{p-0d4372c9.entry.js → p-a512ca45.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a4731c71.entry.js → p-b10265d7.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d58107e2.entry.js → p-b26ded9b.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e9c963b3.entry.js → p-b45b54b5.entry.js} +1 -1
- package/dist/bromcom-ui/{p-f8cbdade.entry.js → p-b47e4417.entry.js} +1 -1
- package/dist/bromcom-ui/{p-f889d1b6.entry.js → p-c2cbb810.entry.js} +1 -1
- package/dist/bromcom-ui/{p-9e05f845.entry.js → p-c387f0fb.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a1335bd5.entry.js → p-c3a91954.entry.js} +1 -1
- package/dist/bromcom-ui/{p-0c549bd0.entry.js → p-ca6cd989.entry.js} +1 -1
- package/dist/bromcom-ui/{p-f302cbdf.entry.js → p-ccaabc2e.entry.js} +1 -1
- package/dist/bromcom-ui/{p-546f5f82.entry.js → p-d37502f9.entry.js} +1 -1
- package/dist/bromcom-ui/{p-53448351.js → p-dbdb10d5.js} +1 -1
- package/dist/bromcom-ui/{p-ba89e3c7.entry.js → p-dd43bcd9.entry.js} +1 -1
- package/dist/bromcom-ui/{p-8260eda6.entry.js → p-de850d57.entry.js} +1 -1
- package/dist/bromcom-ui/{p-f3b546c6.entry.js → p-e0c60c5d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-8e2e77ca.entry.js → p-e520d2a2.entry.js} +1 -1
- package/dist/bromcom-ui/{p-c1de1367.entry.js → p-e86e4968.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a5953ecd.entry.js → p-eaad2239.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a3b54a22.entry.js → p-ee4b8753.entry.js} +1 -1
- package/dist/bromcom-ui/{p-f8bf531f.entry.js → p-ee50f5e2.entry.js} +1 -1
- package/dist/bromcom-ui/{p-61172e12.entry.js → p-ee5da693.entry.js} +1 -1
- package/dist/bromcom-ui/{p-179af180.entry.js → p-f0fa1c29.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e92d9879.entry.js → p-fe37e88f.entry.js} +1 -1
- package/dist/cjs/bcm-accordion.cjs.entry.js +1 -1
- package/dist/cjs/bcm-alert.cjs.entry.js +1 -1
- package/dist/cjs/bcm-attendance.cjs.entry.js +1 -1
- package/dist/cjs/bcm-avatar.cjs.entry.js +3 -3
- package/dist/cjs/bcm-badge_15.cjs.entry.js +4 -4
- package/dist/cjs/bcm-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/bcm-button-group.cjs.entry.js +1 -1
- package/dist/cjs/bcm-card.cjs.entry.js +1 -1
- package/dist/cjs/bcm-checkbox-group.cjs.entry.js +1 -1
- package/dist/cjs/bcm-checkbox-lite_9.cjs.entry.js +1 -1
- package/dist/cjs/bcm-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/bcm-chip-group.cjs.entry.js +3 -3
- package/dist/cjs/bcm-chip.cjs.entry.js +1 -1
- package/dist/cjs/bcm-collapse.cjs.entry.js +1 -1
- package/dist/cjs/bcm-color-input.cjs.entry.js +3 -3
- package/dist/cjs/bcm-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/bcm-datetime-picker.cjs.entry.js +1 -1
- package/dist/cjs/bcm-default.cjs.entry.js +1 -1
- package/dist/cjs/bcm-drawer.cjs.entry.js +3 -3
- package/dist/cjs/bcm-expansion-panel.cjs.entry.js +1 -1
- package/dist/cjs/bcm-form-2.cjs.entry.js +1 -1
- package/dist/cjs/bcm-input-custom.cjs.entry.js +1 -1
- package/dist/cjs/bcm-input.cjs.entry.js +8 -8
- package/dist/cjs/bcm-label.cjs.entry.js +1 -1
- package/dist/cjs/bcm-list_3.cjs.entry.js +5 -5
- package/dist/cjs/bcm-modal-2-footer.cjs.entry.js +3 -3
- package/dist/cjs/bcm-modal-2-header.cjs.entry.js +3 -3
- package/dist/cjs/bcm-modal-2.cjs.entry.js +3 -3
- package/dist/cjs/bcm-modal.cjs.entry.js +1 -1
- package/dist/cjs/bcm-popconfirm-box.cjs.entry.js +1 -1
- package/dist/cjs/bcm-popconfirm.cjs.entry.js +1 -1
- package/dist/cjs/bcm-progress.cjs.entry.js +1 -1
- package/dist/cjs/bcm-radio-group.cjs.entry.js +3 -3
- package/dist/cjs/bcm-radio.cjs.entry.js +3 -3
- package/dist/cjs/bcm-range.cjs.entry.js +1 -1
- package/dist/cjs/bcm-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/bcm-step.cjs.entry.js +2 -2
- package/dist/cjs/bcm-stepper.cjs.entry.js +4 -4
- package/dist/cjs/bcm-switch.cjs.entry.js +1 -1
- package/dist/cjs/bcm-tag.cjs.entry.js +2 -2
- package/dist/cjs/bcm-textarea.cjs.entry.js +2 -2
- package/dist/cjs/bcm-time-picker.cjs.entry.js +1 -1
- package/dist/cjs/bcm-toast.cjs.entry.js +1 -1
- package/dist/cjs/{generate-d0470117.js → generate-d3f8c970.js} +1 -1
- package/dist/cjs/{input-template-e1d297ed.js → input-template-22725c68.js} +1 -1
- package/dist/cjs/{json-parse-decarator-026354f1.js → json-parse-decarator-22c236ad.js} +1 -1
- package/dist/cjs/{number-helper-b3d57233.js → number-helper-66fe9479.js} +1 -1
- package/dist/cjs/old-bcm-popover-box.cjs.entry.js +2 -2
- package/dist/cjs/old-bcm-popover.cjs.entry.js +1 -1
- package/dist/cjs/{stepper-states-09cd4bed.js → stepper-states-43daae37.js} +1 -1
- package/dist/cjs/{validators-39ca1c93.js → validators-aa39e3ec.js} +1 -1
- package/dist/collection/components/molecules/input/input.js +4 -4
- package/dist/components/generate.js +1 -1
- package/dist/components/input.js +4 -4
- package/dist/esm/bcm-accordion.entry.js +1 -1
- package/dist/esm/bcm-alert.entry.js +1 -1
- package/dist/esm/bcm-attendance.entry.js +1 -1
- package/dist/esm/bcm-avatar.entry.js +3 -3
- package/dist/esm/bcm-badge_15.entry.js +4 -4
- package/dist/esm/bcm-breadcrumb.entry.js +1 -1
- package/dist/esm/bcm-button-group.entry.js +1 -1
- package/dist/esm/bcm-card.entry.js +1 -1
- package/dist/esm/bcm-checkbox-group.entry.js +1 -1
- package/dist/esm/bcm-checkbox-lite_9.entry.js +1 -1
- package/dist/esm/bcm-checkbox.entry.js +1 -1
- package/dist/esm/bcm-chip-group.entry.js +3 -3
- package/dist/esm/bcm-chip.entry.js +1 -1
- package/dist/esm/bcm-collapse.entry.js +1 -1
- package/dist/esm/bcm-color-input.entry.js +3 -3
- package/dist/esm/bcm-date-picker.entry.js +1 -1
- package/dist/esm/bcm-datetime-picker.entry.js +1 -1
- package/dist/esm/bcm-default.entry.js +1 -1
- package/dist/esm/bcm-drawer.entry.js +3 -3
- package/dist/esm/bcm-expansion-panel.entry.js +1 -1
- package/dist/esm/bcm-form-2.entry.js +1 -1
- package/dist/esm/bcm-input-custom.entry.js +1 -1
- package/dist/esm/bcm-input.entry.js +8 -8
- package/dist/esm/bcm-label.entry.js +1 -1
- package/dist/esm/bcm-list_3.entry.js +5 -5
- package/dist/esm/bcm-modal-2-footer.entry.js +3 -3
- package/dist/esm/bcm-modal-2-header.entry.js +3 -3
- package/dist/esm/bcm-modal-2.entry.js +3 -3
- package/dist/esm/bcm-modal.entry.js +1 -1
- package/dist/esm/bcm-popconfirm-box.entry.js +1 -1
- package/dist/esm/bcm-popconfirm.entry.js +1 -1
- package/dist/esm/bcm-progress.entry.js +1 -1
- package/dist/esm/bcm-radio-group.entry.js +3 -3
- package/dist/esm/bcm-radio.entry.js +3 -3
- package/dist/esm/bcm-range.entry.js +1 -1
- package/dist/esm/bcm-skeleton.entry.js +1 -1
- package/dist/esm/bcm-step.entry.js +2 -2
- package/dist/esm/bcm-stepper.entry.js +4 -4
- package/dist/esm/bcm-switch.entry.js +1 -1
- package/dist/esm/bcm-tag.entry.js +2 -2
- package/dist/esm/bcm-textarea.entry.js +2 -2
- package/dist/esm/bcm-time-picker.entry.js +1 -1
- package/dist/esm/bcm-toast.entry.js +1 -1
- package/dist/esm/{generate-abec36e5.js → generate-786bd626.js} +1 -1
- package/dist/esm/{input-template-a02d00ff.js → input-template-88fba8d7.js} +1 -1
- package/dist/esm/{json-parse-decarator-268fe3de.js → json-parse-decarator-e85e0fea.js} +1 -1
- package/dist/esm/{number-helper-cf26accd.js → number-helper-d9b73e76.js} +1 -1
- package/dist/esm/old-bcm-popover-box.entry.js +2 -2
- package/dist/esm/old-bcm-popover.entry.js +1 -1
- package/dist/esm/{stepper-states-cf443480.js → stepper-states-026cdd66.js} +1 -1
- package/dist/esm/{validators-63753298.js → validators-0b019b63.js} +1 -1
- package/package.json +1 -1
- package/dist/bromcom-ui/p-0543a86f.js +0 -5
- package/dist/bromcom-ui/p-0a528362.entry.js +0 -5
- package/dist/bromcom-ui/p-90e5c655.js +0 -5
- package/dist/bromcom-ui/p-fceaf172.entry.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{r as t,h as s,g as
|
|
5
|
+
import{r as t,h as s,g as a}from"./p-6d7fe687.js";import{G as w}from"./p-17af6738.js";import"./p-4aa0e6b1.js";import"./p-6f56f8ca.js";const d=class{constructor(s){t(this,s),this._id=w.UID(),this.loading=!0}componentDidLoad(){var t;const s=null===(t=this.el)||void 0===t?void 0:t.parentElement;if(s){const t=document.createElement("span");t.setAttribute("id",`${this._id}-span`),t.classList.add("tw-hidden"),t.innerHTML="<slot />",s.appendChild(t),s.isConnected&&(this.loading=!1,s.querySelector(`#${this._id}-span`).remove())}}render(){return s(this.loading?()=>s("div",{class:"tw-mx-auto tw-w-full tw-max-w-sm tw-rounded-md tw-border tw-border-blue-300 tw-p-4 tw-shadow"},s("span",{class:"tw-hidden"},s("slot",null)),s("div",{class:"tw-flex tw-animate-pulse tw-space-x-4"},s("div",{class:"tw-h-10 tw-w-10 tw-rounded-full tw-bg-slate-200"}),s("div",{class:"tw-flex-1 tw-space-y-6 tw-py-1"},s("div",{class:"tw-h-2 tw-rounded tw-bg-slate-200"}),s("div",{class:"tw-space-y-3"},s("div",{class:"tw-grid tw-grid-cols-3 tw-gap-4"},s("div",{class:"tw-col-span-2 tw-h-2 tw-rounded tw-bg-slate-200"}),s("div",{class:"tw-col-span-1 tw-h-2 tw-rounded tw-bg-slate-200"})),s("div",{class:"tw-h-2 tw-rounded tw-bg-slate-200"}))))):"slot",null)}get el(){return a(this)}};export{d as bcm_skeleton}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{r as e,h as i,H as t,g as p}from"./p-6d7fe687.js";import{c as s}from"./p-d65a1e21.js";import{G as a}from"./p-
|
|
5
|
+
import{r as e,h as i,H as t,g as p}from"./p-6d7fe687.js";import{c as s}from"./p-d65a1e21.js";import{G as a}from"./p-17af6738.js";import{a as l}from"./p-a429e85b.js";import{L as n}from"./p-c49d038e.js";import"./p-6f56f8ca.js";import"./p-4aa0e6b1.js";import"./p-74b2d896.js";import"./p-8d0ca8c2.js";const x=class{constructor(i){e(this,i),this._id=a.UID(),this.required=!1,this.value=void 0,this.size="medium",this.form=void 0,this.htmlFor=void 0,this.hidden=!1,this.type=l.Status.default,this.tooltip=void 0}render(){const{required:e,value:p,size:a,form:l,htmlFor:x,hidden:o,type:r,tooltip:h}=this,m=s("bcm-label",{hidden:o}),c=i(n,{form:l,htmlFor:x,value:p,size:a,type:r,required:e});return i(t,{class:m},c,h&&i("bcm-tooltip",{message:h,placement:"top",trigger:"hover"},i("bcm-icon",{icon:"far fa-question-circle"})))}get el(){return p(this)}};x.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}*{box-sizing:border-box}.bcm-label{display:inline-flex;align-items:flex-start;grid-gap:2px}.bcm-label__text{margin-bottom:2px;font-family:"Inter", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;display:inline-block;color:var(--bcm-new-ds-color-slate-600)}.bcm-label__size-small{font-size:10px;line-height:calc(10px + 8px);min-height:calc(10px + 8px)}.bcm-label__size-medium{font-size:12px;line-height:calc(12px + 8px);min-height:calc(12px + 8px)}.bcm-label__size-large{font-size:14px;line-height:calc(14px + 8px);min-height:calc(14px + 8px)}';export{x as bcm_label}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built with Stencil
|
|
3
|
+
* Copyright (c) Bromcom.
|
|
4
|
+
*/
|
|
5
|
+
import{r as t,c as i,h as e,H as n}from"./p-6d7fe687.js";import{G as o}from"./p-17af6738.js";import{N as r}from"./p-17264523.js";import{S as s}from"./p-8d0ca8c2.js";import{V as a}from"./p-dbdb10d5.js";import{a as c}from"./p-a429e85b.js";import{C as p}from"./p-a56e8c98.js";import{I as l}from"./p-2b13dd48.js";import{c as h}from"./p-d65a1e21.js";import{d as m}from"./p-3c7a0345.js";import{I as u}from"./p-54c0916c.js";import"./p-4aa0e6b1.js";import"./p-6f56f8ca.js";import"./p-3fac58f7.js";const b=class{constructor(e){t(this,e),this.focus=i(this,"bcm-focus",7),this.blur=i(this,"bcm-blur",7),this.clear=i(this,"bcm-clear",7),this.change=i(this,"bcm-change",7),this.input=i(this,"bcm-input",7),this.isBlur=!1,this._id=o.UID(),this._internal_id=o.UID(),this.value="",this.size=c.Size.medium,this.label=void 0,this.pattern=void 0,this.tooltip=void 0,this.placeholder=void 0,this.disabled=!1,this.readonly=!1,this.clearable=!1,this.autocomplete=!1,this.name=void 0,this.type=c.InputType.text,this.hidden=!1,this.required=!1,this.fullWidth=!1,this.noDefaultIcon=void 0,this.disableWatchValue=!1,this.passwordToggle=!1,this.maxLength=null,this.unitPrefix=null,this.unit=void 0,this.decimal=!0,this.min=void 0,this.max=void 0,this.step=void 0,this.caption=void 0,this.noCaption=!1,this.captionType=c.Status.default,this.captionError=void 0,this.customErrorMessage=void 0,this._prefix=void 0,this._suffix=void 0,this.captionCache=void 0,this.captionTypeCache=void 0,this.inValid=!1,this.valueCache="",this.focused=!1,this.isPasswordVisible=!1}connectedCallback(){this.valueCache=this.value,this.captionCache=this.caption,this.captionTypeCache=this.captionType}componentWillRender(){const{type:t,isBlur:i,value:e}=this;if(e)switch(this.value.length>0&&this.checkPattern(),t){case"number":!this.checkValid("number")&&this.validationRange();break;case"email":i&&this.checkValid("email");break;case"tel":i&&this.checkValid("phone")}else!this.required&&this.resetCaption()}async onBcmFocus(){this.inputElement.focus()}async onBcmBlur(){this.inputElement.blur()}async onBcmSelect(){this.inputElement.select()}async set(t){await this.setValue(t)}async get(){return this.value||null}async setValue(t){return this.inputElement.value=t,this.handleChange(),t}async setClear(){return this.inputElement.value="",this.value="",await m(10),Promise.resolve()}async resetCaption(){return await m(10),this.caption=this.captionCache,this.captionType=this.captionTypeCache,this.captionError=null,this.inValid=!1,await m(10),Promise.resolve()}async getValue(){return this.value}watchValue(t){this.inputElement.value=t,this.disableWatchValue||"number"==this.type||this.handleChange()}listenKeyDown(t){if(!this.disabled&&!this.readonly&&(this.onBcmFocus(),"number"==this.type)){var i=t.which||0,e=t.key;38==i&&(t.preventDefault(),this.stepUpOrDown("up")),40==i&&(t.preventDefault(),this.stepUpOrDown("down")),(190==i||110==i||"."==e)&&this.value.indexOf(".")>-1&&t.preventDefault(),189!=i&&109!=i&&"-"!=e||("-"==this.value.charAt(0)||this.value.indexOf("-")>-1)&&t.preventDefault()}}handleFocus(){this.focused=!0,this.focus.emit(),this.whatchHasFocus()}handleBlur(){this.focused=!1,this.isBlur=!0,this.whatchHasFocus(),this.blur.emit()}handleChange(){this.valueSync()}handleInput(){if("number"==this.type&&this.maxLength){const t=this.inputElement.value;t&&t.length>0&&t.length>this.maxLength&&(this.inputElement.value=t.substring(0,this.maxLength))}this.valueSync()}valueSync(){return this.value!=this.inputElement.value?(this.value=this.inputElement.value,this.change.emit(this.value),!0):(this.input.emit(this.value),!1)}handleClear(t){this.inputElement.value="",this.value="",this.inputElement.focus(),this.clear.emit(t),this.change.emit(this.value),t.stopPropagation()}changePasswordVisibility(){this.isPasswordVisible=!this.isPasswordVisible}setCaption(t=null,i=null){this.caption=t||this.captionCache,this.captionType=i||this.captionTypeCache,this.captionError="error"==i?t:null}stepUpOrDown(t){if(!this.inValid&&!this.disabled&&!this.readonly){let i=+this.step||1,e=+this.value;e="up"==t?+(e+i):+(e-i),this.value=e.toString(),this.change.emit(this.value)}}validationRange(){const{min:t,max:i,value:e}=this;if(void 0!==e)if(void 0!==t&&void 0!==i){if(e<t||e>i)return this.setCaption(s.getMessage("between",[t,i]),"error"),!1}else if(void 0!==t){if(e<t)return this.setCaption(s.getMessage("min",[t]),"error"),!1}else if(void 0!==i&&e>i)return this.setCaption(s.getMessage("max",[i]),"error"),!1;return this.setCaption(),!0}checkPattern(){const{pattern:t,value:i}=this;t&&(a.pattern(i,t)?(this.setCaption(),this.inValid=!1):(this.setCaption(s.getMessage("pattern"),"error"),this.inValid=!0))}checkValid(t){const{value:i}=this;return a.isValidate(i,t)?(this.setCaption(),this.inValid=!1):(this.setCaption(s.getMessage(t),"error"),this.inValid=!0),this.inValid}whatchHasFocus(){const{type:t,focused:i,valueCache:e,inValid:n}=this;t==c.InputType.number&&n&&(console.log("whatchHasFocus"),this.value=i?"":s.isNullOrEmpty(this.value)?e:this.value?this.fixToNumber(this.value):"")}fixToNumber(t){if(t){const i=r.getDecimalLength(this.step);return i>0?r.parseFloatFixed(t,i):t}return t}eyeDropper(){(new window.EyeDropper).open().then((t=>{console.log("color: ",t.sRGBHex),this.setValue(t.sRGBHex)})).catch((t=>{"NotAllowedError"===t.name?console.log("Permission to access sensor was denied."):"NotSupportedError"===t.name&&console.log("Sensor not supported.")}))}isEyeDropperSupported(){return"undefined"!=typeof window&&"EyeDropper"in window}toggleLinked(){const t=document.getElementById(`${this._id}-linked`);t&&t.toggle()}render(){const{value:t,size:i,label:o,type:r,captionType:s,caption:a,captionError:m,placeholder:u,fullWidth:b,disabled:d,readonly:x,clearable:g,passwordToggle:f,isPasswordVisible:_,noDefaultIcon:w,unit:y,inValid:v,focused:z,unitPrefix:k,noCaption:j,required:I,hidden:C,_id:D,autocomplete:V}=this,P=(null==t?void 0:t.length)>0&&g,E=h("bcm-input",`bcm-input__container--${i}`,{hidden:C,"full-width":b});return e(n,{onfocus:()=>this.onBcmFocus(),class:E,onClick:()=>this.onBcmFocus()},o&&e("bcm-label",{onClick:()=>this.toggleLinked(),tooltip:this.tooltip,type:s,value:o,required:I,htmlFor:D}),e(l,{id:D,type:r,value:t,pattern:this.pattern,placeholder:u,disabled:d,readonly:x,clearable:P,passwordToggle:f,isPasswordVisible:_,noDefaultIcon:w,focused:z,inValid:v,unitPrefix:k,maxLength:this.maxLength,internalId:this._internal_id,captionType:s,unit:y,size:i,handleFocus:()=>this.handleFocus(),handleBlur:()=>this.handleBlur(),handleChange:()=>this.handleChange(),handleInput:()=>this.handleInput(),steps:t=>this.stepUpOrDown(t),changePasswordVisibility:()=>this.changePasswordVisibility(),handleClear:t=>this.handleClear(t),eyeDropper:()=>this.eyeDropper(),isEyeDropperSupported:()=>this.isEyeDropperSupported(),ref:t=>this.inputElement=t,_suffix:this._suffix,_prefix:this._prefix,autocomplete:V}),e(p,{noCaption:j,captionType:s,captionError:m,caption:a,customErrorMessage:this.customErrorMessage}),r==c.InputType.color&&e("bcm-linked",{targetId:this._id+"-container",id:this._id+"-linked"},e("bcm-colorful",{id:this._id+"-picker",color:this.value,onBcmChange:t=>this.setValue(t.detail)})))}static get watchers(){return{value:["watchValue"]}}};(function(t,i,e,n){var o,r=arguments.length,s=r<3?i:null===n?n=Object.getOwnPropertyDescriptor(i,e):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,e,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(r<3?o(s):r>3?o(i,e,s):o(i,e))||s);r>3&&s&&Object.defineProperty(i,e,s)})([u()],b.prototype,"inputElement",void 0),b.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"); @import url("https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap"); @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}*{box-sizing:border-box}.bcm-caption-area{font-family:"Inter", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;font-size:12px;line-height:calc(12px + 8px);color:var(--bcm-new-ds-color-slate-400);display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between;flex-wrap:nowrap;margin-top:2px}.bcm-caption-area__text{color:var(--bcm-new-ds-color-slate-400)}.bcm-caption-area__text.default{color:var(--bcm-new-ds-color-slate-400)}.bcm-caption-area__text.info{color:var(--bcm-new-ds-color-blue-500)}.bcm-caption-area__text.success{color:var(--bcm-new-ds-color-emerald-500)}.bcm-caption-area__text.warning{color:var(--bcm-new-ds-color-amber-500)}.bcm-caption-area__text.error{color:var(--bcm-new-ds-color-red-500)}.bcm-caption-area__size-small{font-size:10px;line-height:calc(10px + 8px);min-height:calc(10px + 8px)}.bcm-caption-area__size-medium{font-size:12px;line-height:calc(12px + 8px);min-height:calc(12px + 8px)}.bcm-caption-area__size-large{font-size:14px;line-height:calc(14px + 8px);min-height:calc(14px + 8px)}*{box-sizing:border-box}.bcm-label{display:inline-flex;align-items:flex-start;grid-gap:2px}.bcm-label__text{margin-bottom:2px;font-family:"Inter", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;display:inline-block;color:var(--bcm-new-ds-color-slate-600)}.bcm-label__size-small{font-size:10px;line-height:calc(10px + 8px);min-height:calc(10px + 8px)}.bcm-label__size-medium{font-size:12px;line-height:calc(12px + 8px);min-height:calc(12px + 8px)}.bcm-label__size-large{font-size:14px;line-height:calc(14px + 8px);min-height:calc(14px + 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-input{display:inline-flex;flex-direction:column;width:100%;max-width:256px;margin-bottom:8px}.bcm-input.full-width{max-width:100%}.bcm-input.hidden{display:none}.bcm-input__container{font-family:"Inter", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;display:flex;align-items:stretch;flex-direction:row;background-color:var(--bcm-new-ds-color-white);border:1px solid var(--bcm-new-ds-color-slate-300);border-radius:4px;box-sizing:border-box;cursor:text;padding:0 0 0 4px;position:relative;width:100%}.bcm-input__container.disabled{background-color:var(--bcm-new-ds-color-slate-50);cursor:not-allowed}.bcm-input__container.disabled .bcm-input-element{color:var(--bcm-new-ds-color-slate-500)}.bcm-input__container.readonly{background-color:var(--bcm-new-ds-color-slate-50);cursor:default}.bcm-input__container.readonly .bcm-input-element{color:var(--bcm-new-ds-color-slate-600)}.bcm-input__container:not(.disabled):hover .caret-container,.bcm-input__container:not(.disabled).focused .caret-container{opacity:1}.bcm-input__container:not(.disabled):hover .input-clear-button,.bcm-input__container:not(.disabled).focused .input-clear-button{opacity:1}.bcm-input__container:not(.disabled).focused{background-color:var(--bcm-new-ds-color-slate-50)}.bcm-input__container:not(.disabled):hover{border-color:var(--bcm-color-prime-blue-6)}.bcm-input__container.empty .input-clear-button{display:none}.bcm-input__container.invalid,.bcm-input__container.error{border-color:var(--bcm-new-ds-color-red-500)}.bcm-input__container .bcm-input-element{width:100%;color:var(--bcm-new-ds-color-slate-600);flex:1;border:none;background:transparent;box-shadow:unset;padding:0 4px;font-family:"Inter", sans-serif;cursor:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;overflow:hidden;text-overflow:ellipsis}.bcm-input__container .bcm-input-element::placeholder{font-family:"Inter", sans-serif;color:var(--bcm-new-ds-color-slate-300);user-select:none}.bcm-input__container .bcm-input-element::-webkit-search-decoration,.bcm-input__container .bcm-input-element::-webkit-search-cancel-button,.bcm-input__container .bcm-input-element::-webkit-search-results-button,.bcm-input__container .bcm-input-element::-webkit-search-results-decoration,.bcm-input__container .bcm-input-element::-webkit-calendar-picker-indicator,.bcm-input__container .bcm-input-element::-webkit-inner-spin-button,.bcm-input__container .bcm-input-element::-webkit-outer-spin-button{-webkit-appearance:none}.bcm-input__container .caret-container{width:30px;display:flex;flex-direction:column;justify-content:center;align-items:stretch;border-left:1px solid #D9D9D9;transition:0.2s opacity;user-select:none;box-sizing:border-box}.bcm-input__container .caret-container .bcm-input-caret{display:flex;align-items:center;justify-content:center;color:var(--bcm-color-grey-7);cursor:pointer;flex:1}.bcm-input__container .caret-container .bcm-input-caret bcm-icon{line-height:1}.bcm-input__container .caret-container .bcm-input-caret:hover{color:var(--bcm-color-prime-blue-6)}.bcm-input__container .caret-container .bcm-input-caret:active{background-color:var(--bcm-color-grey-3)}.bcm-input__container .caret-container .bcm-input-caret:last-child{border-top:1px solid #D9D9D9}.bcm-input__container .caret-container.disabled{background-color:var(--bcm-color-grey-3)}.bcm-input__container .caret-container.disabled .bcm-input-caret{cursor:not-allowed}.bcm-input__container .input-suffix-content{display:flex;align-items:center;justify-content:center}.bcm-input__container .input-prefix:not(:empty){padding-left:4px}.bcm-input__container .input-suffix:not(:empty){min-width:24px;padding-right:4px}.bcm-input__container .input-prefix:not(:empty),.bcm-input__container .input-suffix:not(:empty){display:flex;align-items:center;justify-content:center;cursor:default;color:#64748a}.bcm-input__container .input-prefix:not(:empty) .unit-prefix,.bcm-input__container .input-suffix:not(:empty) .unit-prefix{color:#64748a}.bcm-input__container .input-prefix-button:not(:empty),.bcm-input__container .input-suffix-button:not(:empty){cursor:pointer}.bcm-input__container .caret-container,.bcm-input__container .input-clear-button{opacity:0}.bcm-input__container--small{font-size:12px}.bcm-input__container--medium{font-size:14px}.bcm-input__container--large{font-size:16px}.bcm-input__textarea.clearable .bcm-input-element{padding-right:24px}.bcm-input__textarea .input-clear-button{position:absolute;top:4px;right:0}';export{b as bcm_input}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{r as t,c as e,h as i,H as o,g as r}from"./p-6d7fe687.js";import{G as n,s}from"./p-
|
|
5
|
+
import{r as t,c as e,h as i,H as o,g as r}from"./p-6d7fe687.js";import{G as n,s}from"./p-17af6738.js";import{a}from"./p-a429e85b.js";import{c as p}from"./p-d65a1e21.js";import{S as c}from"./p-8d0ca8c2.js";import"./p-4aa0e6b1.js";import"./p-6f56f8ca.js";const l=class{constructor(i){t(this,i),this.bcmChange=e(this,"bcm-change",7),this._id=n.UID(),this.size=a.Size.medium,this.type="button",this.color=void 0,this.disabled=void 0,this.direction=a.Direction.horizontal}componentWillLoad(){const{size:t,color:e}=this,i=this.getButtons();(null==i?void 0:i.length)&&i.forEach((i=>{let o=c.elementBooleanCheck(this.el.getAttribute("disabled"))||i.getAttribute("disabled");e&&i.setAttribute("color",e),t&&i.setAttribute("size",t),o&&(i.disabled=!0)}))}getButtons(){return s((()=>Array.from(this.el.querySelectorAll("bcm-button"))),[])}radioControl(t){const e=this.getButtons();(null==e?void 0:e.length)&&e.forEach((e=>{e.checked=e.id==t}))}checkboxControl(t){const e=this.getButtons();(null==e?void 0:e.length)&&e.forEach((e=>{e.checked=e.id==t?e.checked=!e.checked:e.checked}))}listenButton({target:t}){if(t.id){switch(this.type){case"radio":this.radioControl(t.id);break;case"checkbox":this.checkboxControl(t.id)}this.handleChange()}}handleChange(){const t=this.getButtons().filter(Boolean).map((t=>({id:t.id,checked:t.checked})));this.bcmChange.emit(t)}render(){const t=p("bcm-button-group",{"bcm-button-group__vertical":this.direction===a.Direction.vertical});return i(o,{class:t},i("slot",null))}get el(){return r(this)}};l.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}*{box-sizing:border-box}.bcm-button-group{font-family:"Inter", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;display:flex;flex-direction:row;align-items:center;justify-content:flex-start;flex-wrap:nowrap;width:fit-content;background-color:var(--bcm-new-ds-color-slate-300);border:1px solid var(--bcm-new-ds-color-slate-300);gap:1px;border-radius:4px}.bcm-button-group .bcm-button__container{border-radius:0;border:none}.bcm-button-group .bcm-button:first-child .bcm-button__container{border-top-left-radius:4px;border-bottom-left-radius:4px}.bcm-button-group .bcm-button:last-child .bcm-button__container{border-top-right-radius:4px;border-bottom-right-radius:4px}.bcm-button-group__vertical{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;flex-wrap:nowrap}.bcm-button-group__vertical .bcm-button{width:100%}.bcm-button-group__vertical .bcm-button__container{width:100%;border-radius:0}.bcm-button-group__vertical .bcm-button:first-child .bcm-button__container{border-radius:4px 4px 0 0}.bcm-button-group__vertical .bcm-button:last-child .bcm-button__container{border-radius:0 0 4px 4px}';export{l as bcm_button_group}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{r as t,h as i,H as e,g as s}from"./p-6d7fe687.js";import{c as a}from"./p-d65a1e21.js";import{I as n}from"./p-54c0916c.js";import{G as h}from"./p-
|
|
5
|
+
import{r as t,h as i,H as e,g as s}from"./p-6d7fe687.js";import{c as a}from"./p-d65a1e21.js";import{I as n}from"./p-54c0916c.js";import{G as h}from"./p-17af6738.js";import{a as p}from"./p-a429e85b.js";import{d as r}from"./p-3c7a0345.js";import"./p-6f56f8ca.js";import"./p-4aa0e6b1.js";const o=class{constructor(i){t(this,i),this._id=h.UID(),this.time=new Date,this.value=void 0,this.hidden=!1,this.name=void 0,this.fullWidth=!1,this.required=!1,this.label=void 0,this.placeholder=void 0,this.disabled=!1,this.noCaption=!1,this.caption="",this.captionError=void 0,this.captionType="default",this.alignment=void 0,this.placement=p.Placement["bottom-start"],this.linkedComponent=void 0,this.clearable=!1}componentWillLoad(){if("string"==typeof this.time){const t=!!/\b([01][0-9]|2[0-3]):([0-5][0-9])\b/.test(this.time)&&this.time.split(":");this.time=t?new Date((new Date).setHours(Number(t[0]),Number(t[1]))):new Date}}handlePickerLoad(){this.value=this.picker.value}handlePickerChange(t){this.value=t.detail}async set(t){return this.picker.set(t)}async get(){var t;return(null===(t=this.value)||void 0===t?void 0:t.timestamp)||null}async setDisabled(t){this.disabled=t}async getInput(){return await this.picker.getInput()}async getValue(){return this.value}async isValid(){return await this.picker.isValid()}async setClear(){return await this.picker.setClear(),await r(10),Promise.resolve()}async resetCaption(){return await r(10),await this.picker.resetCaption(),this.captionType="default",this.captionError=null,await r(10),Promise.resolve()}async open(){return await this.picker.open()}render(){const t=a(this.hidden?"hidden":null,{"full-width":this.fullWidth});return i(e,{class:t},i("bcm-datetime-picker",{"linked-component":this.linkedComponent,id:this._id,fullWidth:this.fullWidth,required:this.required,label:this.label,name:this.name,placeholder:this.placeholder,type:"time",clearable:this.clearable,date:this.time,ref:t=>this.picker=t,disabled:this.disabled,"on-bcm-load":()=>this.handlePickerLoad(),"on-bcm-change":t=>this.handlePickerChange(t),noCaption:this.noCaption,captionError:this.captionError,caption:this.caption,captionType:this.captionType,alignment:this.alignment,placement:this.placement}))}get el(){return s(this)}};(function(t,i,e,s){var a,n=arguments.length,h=n<3?i:null===s?s=Object.getOwnPropertyDescriptor(i,e):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,i,e,s);else for(var p=t.length-1;p>=0;p--)(a=t[p])&&(h=(n<3?a(h):n>3?a(i,e,h):a(i,e))||h);n>3&&h&&Object.defineProperty(i,e,h)})([n()],o.prototype,"el",void 0),o.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}:host{display:inline-block;width:100%;max-width:256px}:host(.full-width){max-width:100%}:host(.hidden){display:none}:host(.linked-component){display:none}';export{o as bcm_time_picker}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{h as t,r as e,c as i,H as n,g as c}from"./p-6d7fe687.js";import{I as o}from"./p-54c0916c.js";import{J as r}from"./p-0543a86f.js";import"./p-2fc584c4.js";import"./p-626a65e9.js";import{s,G as l}from"./p-947c78e3.js";import{N as a}from"./p-90e5c655.js";import{S as h}from"./p-8d0ca8c2.js";import{V as m}from"./p-53448351.js";import"./p-5ae0a59b.js";import{g as b,s as d}from"./p-dbc4c30c.js";import{p as u,d as p}from"./p-3c7a0345.js";import{a as f,B as x}from"./p-a429e85b.js";import{C as _}from"./p-a56e8c98.js";import{c as v}from"./p-d65a1e21.js";import"./p-3fac58f7.js";import{L as g}from"./p-c49d038e.js";import"./p-2e73d572.js";import{c as y}from"./p-3cde7f38.js";import{r as w,a as k}from"./p-1eabd5dc.js";import{c as z}from"./p-6f56f8ca.js";import{I as j}from"./p-a8aaa382.js";import"./p-436364c8.js";import"./p-4aa0e6b1.js";import"./p-74b2d896.js";const O=({disabled:e,checked:i,readonly:n,required:c,indeterminate:o,hidden:r,captionType:s,_id:l})=>{const a=v("bcm-checkbox","bcm-checkbox__type-default","bcm-checkbox-size-medium",{error:s==f.Status.error,hidden:r,checked:i,disabled:e,required:c,readonly:n}),h=v("bcm-checkbox__label-icon","bcm-checkbox__label-icon-lite","bcm-checkbox__label-icon-"+o,{"bcm-checkbox__label-icon-checked":i}),m=v("bcm-checkbox__label");return t("div",{class:a},t("input",{tabindex:"-1",id:l,type:"checkbox",checked:i,disabled:e,required:c,readonly:n}),t("label",{class:m,htmlFor:l},t("span",{class:h},t("bcm-icon",{icon:"far fa-check"}))))},I=({selected:e,total:i,found:n,multiple:c,variableText:o})=>(i=i||0,o=o?u(o,i):"items",t("footer",{class:"bcm-info-footer"},t("bcm-text",{scale:"size-1",color:"grey-8"},c&&e>0&&` ( ${e} selected ) `,` Total ${i} `,null!=n&&` / ${n} `,` ${o} found. `))),S=({item:e,treeview:i,highlight:n,checkboxes:c,size:o,selectedItem:r,openGroup:s,checkedItem:l,focusItem:a,searchIsOnlyChilds:m})=>{const b=e.items&&e.items.length>0;var d=h.htmlEntities(e.text);let u=[];if(n&&h.slugify(d).includes(h.slugify(n))&&(m&&(!m||b&&(i||"group"==e.type))||(d=h.highlight(d,n))),"group"!=e.type&&e.template){const t=e.template.replace(/\s/g,"").match(/\{{[^}}]+\}/g).map((t=>t.replace(/[{}]/g,""))),i=Object.keys(e.itemObject);u=t.filter((t=>i.includes(t)))}d=e.isHtmlContent?e.isHtmlContent:e.template&&u.length>0?h.templateParser(e.template,Object.assign(Object.assign({},e.itemObject),{text:d})):d;const p=!i&&"group"==e.type&&!e.clickable,f=e.disabled,x=e.readonly,_=()=>{e.open=e.isSearching,s(e.id)};return t("div",{id:e.id,hidden:e.hidden,"on-focus":t=>!p&&!f&&a(t),class:v("bcm-list__item","bcm-list__item-"+o,{"bcm-list__item--group":!i&&"group"==e.type,"bcm-list__item--readonly":x})},t("div",{class:v("bcm-list__item-content",!c&&e.selected&&"selected",{disabled:f})},i&&t("div",{class:"bcm-list__item-content-collapse-icon",onClick:()=>_()},b&&t("bcm-icon",{icon:v("fas fa-caret-"+(e.isSearching||e.open?"down":"right"))})),t("div",{class:v("bcm-list__item-content-text",{treeview:i}),onClick:t=>{var i;((i=t).path||i.composedPath()).filter((t=>t.attributes&&t.attributes.getNamedItem("unlinked")))[0]||(x&&_(),!p&&!f&&!x&&(c?l(e.id):r(e.id)))}},c&&(i||!i&&"group"!=e.type)&&t("div",{class:"bcm-list__item-content-text-checkbox"},t(O,{indeterminate:e.indeterminate,checked:e.checked,disabled:e.disabled})),t("span",Object.assign({class:"bcm-list__item-content-text-inner"},e.title&&{title:e.title},{innerHTML:d})))),(i||!i&&"group"==e.type)&&b&&t("div",{class:"bcm-list__item-childs"},(e.isSearching||e.open||!i&&"group"==e.type)&&e.items.map((e=>t(S,{highlight:n,item:e,searchIsOnlyChilds:m,treeview:i,checkboxes:c,size:o,selectedItem:r,checkedItem:l,openGroup:t=>s(t),focusItem:t=>a(t)})))))},C=({highlight:e,selectAllItem:i,bcmListContainer:n,treeview:c,checkboxes:o,checkAll:r,infoFooter:s,value:l,totalData:a,searchFound:h,variableText:m,_id:b,data:d,width:u,height:p,size:f,searchPlaceholder:x,minSearchLength:_,selectedItem:v,openGroup:g,checkedItem:y,onScrollEvent:w,focusItem:k,items:z,searchable:j,searchIsOnlyChilds:O,emptyText:C,emptyIcon:E})=>{const M=!(c&&h>0||h>0);return t("div",{id:`bcm-list-${b}`,class:n,style:{"--height":p,"--width":u}},d&&j&&t("section",{class:"bcm-list__container-search"},t("bcm-search",{size:f,id:`bcm-list-${b}-search`,data:d,clearable:!0,placeholder:x,"min-search-length":_,searchIsOnlyChilds:O})),t("main",{onScroll:t=>w(t),class:"scrolling",style:{"overscroll-behavior":"none"}},t("div",{style:{"min-height":`${(null==h?c?z.length:a:h)*("small"===f?28:"medium"===f?36:48)||0}px`,"overscroll-behavior":"none",height:"100%",display:"flex","flex-direction":"column"}},r&&0!=h&&z&&z.length>0&&o&&M&&t("section",{class:"bcm-list__container-select-all"},t(S,{size:f,item:i,treeview:!1,checkboxes:!0,selectedItem:t=>v(t),checkedItem:t=>y(t),openGroup:t=>g(t),focusItem:t=>k(t)})),z.map((i=>t(S,{highlight:e,size:f,item:i,searchIsOnlyChilds:O,treeview:c,checkboxes:o,selectedItem:t=>v(t),checkedItem:t=>y(t),openGroup:t=>g(t),focusItem:t=>k(t)}))),(!z||0===z.length)&&0!=h&&t("section",{class:"bcm-list__container-no-data"},t("bcm-empty",{style:{height:"auto"},icon:E},t("span",{innerHTML:C||"No data"}))),0==h&&t("section",{class:"bcm-list__container-no-data"},t("bcm-empty",{style:{height:"auto"},icon:E},t("span",{innerHTML:C||"No Data Found"}))))),s&&d&&d.length>0&&t(I,{selected:null==l?void 0:l.length,total:a,found:h,multiple:o,variableText:m}))},{state:E}=y({value:new Map}),M=(t,e,i,n="0.")=>{let c=[];return t&&t.length>0&&(c=t.map(((t,c)=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({itemObject:t},t),e),{parentId:s((()=>i),null),open:e.allOpen||t.open||!1}),(e.treeview||!e.treeview&&"group"==t.type)&&t.items&&t.items.length>0?{items:s((()=>M(t.items,e,t.id,`${n}${c}`)),[])}:{items:[]}),{ct:`${n}${c}`})))),c},T=t=>s((()=>E.value.get(t)),{}),R=(t,e)=>{let i=0;return t.forEach((t=>{(e||!e&&"group"!=t.type)&&(i+=1),(e||!e&&"group"==t.type)&&t.items&&(i+=R(t.items,e))})),i},$=(t,e,i,n)=>{let c;c=i||T(t).dataSource,c&&c.forEach((i=>{null!=n?i.open=n:i.id==e?(i.open=!i.open,i.isSearching=i.open,!i.open&&i.items&&$(t,e,i.items,!1)):i.items&&$(t,e,i.items)}))},D=(t,e,i)=>{i&&i.forEach((i=>{i.id==e?(i.checked=!1,i.itemObject.checked=!1,A(t,i.parentId)):i.items&&D(t,e,i.items)}))},F=(t,e)=>{P(t,e)},P=(t,e,i)=>{let n;e=Array.isArray(e)?e:[e],n=i||T(t).dataSource,n&&n.forEach((i=>{e.includes(i.id)?(N(t,i),i.parentId&&A(t,i.parentId)):i.items&&P(t,e,i.items)}))},N=(t,e,i)=>{const n=T(t);if(n){const c=n.options.treeview;e&&((c||!c&&"group"!=e.type)&&(e.disabled||(e.checked=null!=i?i:!e.checked,e.itemObject.checked=e.checked,e.indeterminate=e.checked?"determinate":"uncheck")),e.items&&e.items.forEach((n=>{N(t,n,null==i?e.checked:i)})))}},A=(t,e,i)=>{let n;n=i||T(t).dataSource,n&&n.forEach((i=>{if(i.id==e){let e=!0,n=!0;i.items&&i.items.map((t=>{(t.checked||"indeterminate"===t.indeterminate)&&(n=!1),!t.checked&&(e=!1)}));const c=e||n?e?"determinate":"uncheck":"indeterminate";i.indeterminate=c,i.checked="determinate"==c,i.itemObject.checked=i.checked,i.parentId&&A(t,i.parentId)}else i.items&&A(t,e,i.items)}))},L=(t,e,i,n)=>{let c,o=[],r=[];return T(t).isSearchOtherTag=n,c=i||T(t).dataSource,c&&c.forEach((i=>{if(e){var c;i.hidden=!0;for(let t=0;t<e.length;t++)if(e[t].id===i.id){c=e[t];break}if(c&&(i.hidden=!1,T(t).isSearchOtherTag||(i.isSearching=!0),r.push(i),i.checked&&o.push(i),c.items)){const{checkedItems:e,visibledItems:s}=L(t,c.items,i.items,n);e&&(o=[...new Set([...o,...e])]),s&&(r=[...new Set([...r,...s])])}}else i.hidden=!1,i.items&&L(t,null,i.items),r.push(i),i.isSearching=!1})),{checkedItems:null!=o?o:[],visibledItems:null!=r?r:[]}},V=(t,e)=>{let i,n=null;return i=e||T(t).dataSource,i&&i.forEach((e=>{if(e.selected)n=e.itemObject;else if(e.items){const i=V(t,e.items);i&&(n=i)}})),n},q=(t,e)=>{let i,n=[],c=[];return i=e||T(t).dataSource,i&&i.forEach((e=>{var i;const o=Object.assign(Object.assign({},e.itemObject),{ct:e.ct});let r=[],s=[];if(e.checked&&(n.push(o),s.push(Object.assign(Object.assign({},o),{items:[]}))),e.items){const c=q(t,e.items);(null===(i=null==c?void 0:c.checkedList)||void 0===i?void 0:i.length)>0&&(n=[...n,...c.checkedList]),c.nestedResult.length>0&&(r=c.nestedResult)}r.length>0?(0==s.length&&s.push(Object.assign(Object.assign({},o),{items:[]})),s[0].items=r,c.push(s[0])):s.length>0&&(s[0].items=r,c.push(s[0]))})),{checkedList:(null==n?void 0:n.length)>0?n:null,nestedResult:c}},W=(t,e,i)=>{let n,c=[];return n=i||T(t).dataSource,n&&n.forEach((i=>{if(e&&(i.id==e?(i.selected=!0,i.itemObject.selected=i.selected):i.selected&&(i.selected=!1,i.itemObject.selected=i.selected)),i.items){const n=W(t,e,i.items);(null==n?void 0:n.length)>0&&(c=[...c,...n])}i.selected&&c.push(i.itemObject)})),c&&c.length>0?c:null},G=(t,e)=>{let i;i=e||T(t).dataSource,i&&i.forEach((e=>{var i,n,c;e.checked&&(e.checked=!1),e.selected&&(e.selected=!1),e.indeterminate&&(e.indeterminate="uncheck"),(null===(i=e.itemObject)||void 0===i?void 0:i.checked)&&(e.itemObject.checked=!1),(null===(n=e.itemObject)||void 0===n?void 0:n.selected)&&(e.itemObject.selected=!1),(null===(c=e.itemObject)||void 0===c?void 0:c.indeterminate)&&(e.itemObject.indeterminate="uncheck"),e.items&&G(t,e.items)}))},H={setValue:t=>{const{id:e,dataSource:i,options:n}=t,{type:c,treeview:o,checkboxes:r,searchable:a,value:h,name:m,label:b,size:d,disabled:u,readonly:p,highlight:f,required:x,hidden:_,fullWidth:v,height:g,maxHeight:y,minHeight:w,width:k,infoFooter:z,variableText:j,template:O,allOpen:I,keyControl:S,checkAll:C,linkedComponent:T,placeholder:$,searchPlaceholder:D,searchIsOnlyChilds:F,clearable:P,caption:N,noCaption:A,captionType:L,captionError:V,placement:q}=n,W={size:d,checkboxes:r,template:O,allOpen:I,highlight:f,treeview:o},G={id:s((()=>e),l.UID),dataSource:i&&i.length>0&&M(i,W),options:{type:c,treeview:o,checkboxes:r,searchable:a,value:h,name:m,label:b,size:d,disabled:u,readonly:p,highlight:f,required:x,hidden:_,fullWidth:v,height:g,maxHeight:y,minHeight:w,width:k,infoFooter:z,variableText:j,template:O,allOpen:I,keyControl:S,checkAll:C,linkedComponent:T,placeholder:$,searchPlaceholder:D,searchIsOnlyChilds:F,clearable:P,caption:N,noCaption:A,captionType:L,captionError:V,placement:q},totalItems:(null==i?void 0:i.length)>0&&R(i,n.treeview),totalRoots:null==i?void 0:i.length};E.value.set(G.id,G)},removeValue:t=>{E.value.delete(t)},getValue:T,getData:t=>{let e=[];const i=T(t);if(i){const{dataSource:t}=i;e=t}return e},getDataPagination:(t,e=3,i)=>{let n=[];const c=T(t);if(c){const{dataSource:t}=c;n=i?t.filter((t=>i.indexOf(t.id)>-1)).slice(0,e):t.slice(0,e)}return n},openGroup:$,checkedItem:F,filterData:L,getSelected:V,getCheckedList:q,selectedItem:W,addChecked:(t,e)=>{T(t)&&e.forEach((e=>{F(t,e)}))},setClear:G,selectAll:(t,e)=>{const i=T(t).dataSource;i&&i.forEach((i=>{N(t,i,e)}))},removeOtherTags:(t,e,i)=>{let n;if(e=Array.isArray(e)?e:[e],i)n=i;else{const e=T(t);n=e.dataSource}n&&e.forEach((e=>{n.forEach((i=>{i.id==e?(i.checked=!1,i.itemObject.checked=!1):i.items&&D(t,e,i.items)}))}))},onRemoveItems:D,updateOptions:(t,e)=>{Object.keys(T(t).options).forEach((i=>{T(t).options[i]=e[i]}))},removeState:t=>Promise.resolve(E.value.delete(t))};class B{constructor(t,e,i,n){this.elementName="",this.childElementName="",this.keyCode=t,this.element=e,this.elementName=i,this.childElementName=n}getKeyCode(){return this.keyCode}getElementName(){return this.elementName}getChildElementName(){return this.childElementName}getFocusedElementName(){return this.getElementName()+".focused"}getFocusedElement(){return this.element.querySelectorAll(this.getFocusedElementName())[0]||null}getFirstElement(){return this.element.querySelectorAll(this.getElementName())[0]||null}getNextElement(){var t;return(null===(t=this.getFocusedElement())||void 0===t?void 0:t.nextElementSibling)||this.getFirstElement()}getPreviousElement(){var t;return(null===(t=this.getFocusedElement())||void 0===t?void 0:t.previousElementSibling)||this.getFirstElement()}getChildElement(){var t;return(null===(t=this.getFocusedElement())||void 0===t?void 0:t.querySelectorAll(this.getChildElementName())[0])||null}getParentElement(t){if(t&&t)return t&&t.attributes["data-isroot"]?t:this.getParentElement(t.parentNode)}focusElementIsOpen(){var t;return(null===(t=this.getFocusedElement())||void 0===t?void 0:t.classList.contains("bcm-list__item--open"))||!1}isRootElement(){var t;return(null===(t=this.getFocusedElement())||void 0===t?void 0:t.querySelectorAll(this.getChildElementName()).length)>0}isRootElementIsOpen(){return this.getFocusedElement().classList.contains("bcm-list__item--open")}getFocusedChildElement(){var t;return(null===(t=this.getChildElement())||void 0===t?void 0:t.querySelectorAll(".focused")[0])||null}isLastElement(){var t;return null===(null===(t=this.getFocusedElement())||void 0===t?void 0:t.nextElementSibling)}focusParentElementFirstChild(){var t,e;return this.setFocus(null===(e=null===(t=this.getFocusedElement())||void 0===t?void 0:t.parentElement)||void 0===e?void 0:e.firstChild)}isFirstElement(){var t;return null===(null===(t=this.getFocusedElement())||void 0===t?void 0:t.previousElementSibling)}focusRootElement(){var t,e,i;return this.setFocus(null===(i=null===(e=null===(t=this.getFocusedElement())||void 0===t?void 0:t.parentElement)||void 0===e?void 0:e.parentElement)||void 0===i?void 0:i.firstChild)}nextRootElement(){var t,e,i;return this.setFocus(null===(i=null===(e=null===(t=this.getFocusedElement())||void 0===t?void 0:t.parentElement)||void 0===e?void 0:e.parentElement)||void 0===i?void 0:i.nextElementSibling)}findFocusElementParent(){return this.getFocusedElement().parentNode.querySelectorAll(".bcm-list__item--open")}getLastElement(){return this.element.querySelectorAll(this.getElementName())[this.element.querySelectorAll(this.getElementName()).length-1]||null}setFocus(t){t.focus()}}class K extends B{constructor(t,e,i,n){super(t,e,".bcm-list__item",".bcm-list__item-childs"),this.isTreeview=!1,this.isCheckBoxes=!1,this.isTreeview=i,this.isCheckBoxes=n}keyUpControl(){this.isTreeview?this.keyUpTreeview():this.isFirstElement()?this.setFocus(this.getLastElement()):this.setFocus(this.getPreviousElement())}keyDownTreeView(){var t;if(this.isTreeview)if(this.isRootElement()&&this.isRootElementIsOpen()){const t=this.getChildElement();t&&this.setFocus(t.firstChild)}else this.isLastElement()&&this.getParentElement(this.getFocusedElement())?this.setFocus(null===(t=this.getParentElement(this.getFocusedElement()))||void 0===t?void 0:t.nextElementSibling):this.setFocus(this.getNextElement())}keyUpTreeview(){if(this.isFirstElement()){const t=this.getParentElement(this.getFocusedElement());this.setFocus(t)}else{const t=this.getPreviousElement();if(t)if(t.classList.contains("bcm-list__item--open")){const e=t.querySelectorAll(this.getChildElementName())[0];console.log({getChildElement:e}),this.setFocus(e.lastChild)}else this.setFocus(t)}}keyDownControl(){this.isTreeview?this.keyDownTreeView():this.isLastElement()?this.setFocus(this.getFirstElement()):this.setFocus(this.getNextElement())}keyRightControl(){if(this.isTreeview&&!this.isRootElementIsOpen()&&this.isRootElement()){const{id:t}=this.getFocusedElement();this.openGroup(t)}}keyLeftControl(){if(this.isTreeview&&this.isRootElementIsOpen()&&this.isRootElement()){const{id:t}=this.getFocusedElement();this.openGroup(t)}}keyEnterControl(){}keySpaceControl(){if(this.isCheckBoxes){const{id:t}=this.getFocusedElement();this.checkedItem(t)}}keyDown(){switch(this.getKeyCode()){case f.KeyCode.up:this.keyUpControl();break;case f.KeyCode.down:this.keyDownControl();break;case f.KeyCode.left:this.keyLeftControl();break;case f.KeyCode.right:this.keyRightControl();break;case f.KeyCode.enter:this.keyEnterControl();break;case f.KeyCode.space:this.keySpaceControl()}}keyUp(){}}var U=function(t,e,i,n){var c,o=arguments.length,r=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,n);else for(var s=t.length-1;s>=0;s--)(c=t[s])&&(r=(o<3?c(r):o>3?c(e,i,r):c(e,i))||r);return o>3&&r&&Object.defineProperty(e,i,r),r};const Y=class{constructor(t){e(this,t),this.bcmChecklist=i(this,"bcm-checklist",7),this.bcmSelected=i(this,"bcm-selected",7),this.change=i(this,"bcm-change",7),this.open=i(this,"bcm-open",7),this.close=i(this,"bcm-close",7),this.debounce=null,this.debounceHandler=l.debounceInput((()=>this.listenResize()),300,!1),this._id=l.UID(),this.type=x.ListType.listbox,this.treeview=!1,this.checkboxes=!1,this.searchable=!1,this.value=null,this.inputText=void 0,this.name=void 0,this.label=void 0,this.size=x.Size.medium,this.disabled=!1,this.readonly=!1,this.highlight=!1,this.highlightText=void 0,this.required=!1,this.hidden=!1,this.fullWidth=!1,this.height="256px",this.maxHeight="500px",this.minHeight="150px",this.width="256px",this.infoFooter=!1,this.variableText="item",this.template=void 0,this.allOpen=!1,this.keyControl=!1,this.checkAll=!0,this.stopDeepClean=!1,this.linkedComponent=void 0,this.isOpen=!1,this.calculatedViewport=!1,this.isSelectedOther=!1,this.isHaveOtherTag=!1,this.placeholder="Choose an option",this.searchPlaceholder="Search",this.searchIsOnlyChilds=!1,this.minSearchLength=2,this.clearable=!1,this.caption=void 0,this.noCaption=!1,this.captionType=x.Status.default,this.captionError=void 0,this.emptyText=void 0,this.emptyIcon="fad fa-folder-open",this.captionCache=void 0,this.captionTypeCache=void 0,this.tick={},this.totalData=0,this.totalRootData=0,this.limit=20,this.searchGetParents=void 0,this.searchResultLimit=20,this.searchFound=null,this.returnFilterData={},this.returnOtherData={},this.options={rootMargin:"30px"},this.tagContainerWidth=0,this.selectAllItem={id:"select-all",text:"Select All",value:"select-all",checked:!1,disabled:!1,icon:"",status:x.Status.default,indeterminate:"uncheck"},this.placement=x.Placement["bottom-start"],this.data=[]}connectedCallback(){"256px"!=this.height&&(this.limit=this.height.indexOf("px")>-1?Math.floor(+this.height.replace("px","")/10):Math.floor(+window.innerHeight/10),this.searchResultLimit=this.limit,this.markForCheck());const t=document.querySelectorAll(`#bcm-list-${this._id}`);(null==t?void 0:t.length)>1&&t.forEach(((t,e)=>e>0&&t.remove()))}componentWillRender(){this.calculateLocation()}componentShouldUpdate(t,e,i){Object.keys(this.getOptions()).indexOf(i)>-1&&t!==e&&this.updateOptions()}get containerWidth(){var t,e;return null===(e=null===(t=this.el)||void 0===t?void 0:t.getBoundingClientRect())||void 0===e?void 0:e.width}get tagCount(){return this.containerWidth>0?Math.floor(+(this.containerWidth-100)/85):0}get tagData(){return s((()=>{var t;return null===(t=this.value)||void 0===t?void 0:t.map((t=>({value:t.id,label:h.textLimitter(t.text,7),text:t.tooltipMessage||t.tagTitle||t.text})))}),[])}async componentDidLoad(){if(await this.initState(),"select"==this.type||"autocomplete"==this.type||this.linkedComponent){const t=this.el.querySelector(`#bcm-list-${this._id}`);t&&document.body.appendChild(t)}}disconnectedCallback(){if(this.isOpen=!1,!this.stopDeepClean&&(H.removeState(this._id),this.el.innerHTML="","select"==this.type||"autocomplete"==this.type||this.linkedComponent)){const t=document.querySelectorAll(`#bcm-list-${this._id}`);(null==t?void 0:t.length)&&(t.forEach((t=>t.remove())),this.el.remove())}}watchId(t,e){H.removeState(e),this.initState()}handleValueChange(t,e){var i;l.objectIsEmpty(this.returnFilterData)&&this.handleIndeterminate((null===(i=this.value)||void 0===i?void 0:i.length)||0,this.totalData),this.checkboxes?m.compareTwoArrayIsSame(t,e)||(this.bcmChecklist.emit(this.value),this.change.emit(this.value)):(null==t?void 0:t.id)!=(null==e?void 0:e.id)&&this.change.emit(this.value)}watchReturnFilterData(t){var e;const{checkedItems:i,visibledItems:n}=t;i&&n?this.handleIndeterminate(i.length,n.length):this.handleIndeterminate((null===(e=this.value)||void 0===e?void 0:e.length)||0,this.totalData)}async handleOpen(){this.isOpen?(this.open.emit(),this.calculateLocation(),this.onSelectSearch()):(this.listScrollToTop(),this.close.emit(),await p(100),this.unSelectOther())}listScrollToTop(){const t=document.querySelector(`#bcm-list-${this._id}`);t&&(t.querySelector(".scrolling").scrollTop=0)}async dataChanged(t,e){m.compareTwoArrayIsSame(t,e)||await this.initState()}isIntersecting(t){const e=null==t?void 0:t.target;e&&e.id===this._id&&this.listenResize()}handleSlotItems(t){var e;(null===(e=null==t?void 0:t.detail)||void 0===e?void 0:e.length)>0&&(this.data=t.detail)}handleChange(t){t.target.id==`bcm-list-input-tag-container-${this._id}-autocomplete-input`&&t.stopImmediatePropagation()}handleResize(){this.calculateLocation(),this.debounceHandler()}handleWheel(t){if(this.isOpen){const e=document.querySelector(`#bcm-list-${this._id}`);e&&l.findEventPath(t,e)?("select"==this.type||"autocomplete"==this.type||this.linkedComponent)&&this.calculateLocation():this.hide()}}clearAutocomplete(){if("autocomplete"==this.type){const t=this.getAutoCompleteInput();t&&t.handleClear(!1)}}async handleSelectOtherTag(t){if(this.disabled)return;const{id:e,checked:i}=t.detail;this.isSelectedOther=i,e&&(i?this.filterOtherList(e):this.unSelectOther(),this.isOpen=!0)}async handleDeleteTag(t){var e;if(this.disabled)return;const{id:i}=t.detail;this.isSelectedOther&&this.unSelectOther(),Array.isArray(i)?H.removeOtherTags(this._id,i):H.checkedItem(this._id,i),this.value=(await this.getCheckedList()).checkedList,this.handleIndeterminate((null===(e=this.value)||void 0===e?void 0:e.length)||0,this.totalData)}async handleSelectTag(t){this.disabled||(this.clearAutocomplete(),this.onSelectSearch(),this.unSelectOther())}handleClick(t){var e;if(this.disabled)return;const i=document.querySelector(`#bcm-list-${this._id}`),n=l.findEventPath(t,this.el)||i&&l.findEventPath(t,i);if(n&&(null!==this.debounce&&(t.preventDefault(),t.stopPropagation(),clearTimeout(this.debounce),this.debounce=null),this.debounce=setTimeout((()=>{this.debounce=null}),300)),!n&&"autocomplete"==this.type){const t=this.getAutoCompleteInput();t&&t.setValue(this.checkboxes?"":(null===(e=this.value)||void 0===e?void 0:e.text)||"")}const c=l.findEventPathWithKey(t,"className",["bcm-tag"]),o=l.findEventPathWithKey(t,"className",["bcm-tag bcm-tag--other"]),r=l.findEventPathWithKey(t,"id",[`bcm-list-input-${this._id}`,`bcm-list-label-${this._id}`]),s=l.findEventPathWithKey(t,"className",["right close-button"]);r&&!s&&"autocomplete"!=this.type&&(this.isOpen=!(!c&&!o&&this.isOpen)),i&&this.isOpen&&(i.contains(t.target)||this.el.contains(t.target)||(this.isOpen=!1))}bcmOnSearchClear(t){var e,i;"autocomplete"==this.type&&((null===(e=null==t?void 0:t.target)||void 0===e?void 0:e.id)!==`bcm-list-${this._id}-search`&&(null===(i=null==t?void 0:t.target)||void 0===i?void 0:i.id)!==`bcm-list-input-tag-container-${this._id}-autocomplete-input`||t.detail&&this.setClear())}bcmOnSearch(t){var e,i,n,c,o,r;(null===(e=null==t?void 0:t.target)||void 0===e?void 0:e.id)!==`bcm-list-${this._id}-search`&&(null===(i=null==t?void 0:t.target)||void 0===i?void 0:i.id)!==`bcm-list-input-tag-container-${this._id}-autocomplete-input`||(this.searchGetParents=s((()=>{var e;return null===(e=t.detail)||void 0===e?void 0:e.parentIndex}),null),this.searchResultLimit=10,this.searchFound=null!=(null===(n=t.detail)||void 0===n?void 0:n.matching)?null===(c=t.detail)||void 0===c?void 0:c.matching.length:null,this.returnFilterData=H.filterData(this._id,null===(o=t.detail)||void 0===o?void 0:o.nestedResult),this.searchFound>0&&this.highlight&&(this.highlightText=null===(r=t.detail)||void 0===r?void 0:r.value),"autocomplete"==this.type&&(this.isOpen=!0),t.detail.result||("autocomplete"==this.type?this.isOpen=!1:(this.returnFilterData={},H.filterData(this._id,null)),this.searchResultLimit=null,this.highlightText=null),this.markForCheck())}handleKeyDown(t){const e=t.keyCode||t.which;if(e===x.KeyCode.escape&&this.isOpen&&(this.isOpen=!1,t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()),this.keyControl){const t=new K(e,this.el,this.treeview,this.checkboxes);t.openGroup=t=>{this.openGroup(t)},t.checkedItem=t=>{this.checkedItem(t)},t.keyDown()}}handleKeyUp(t){if(this.keyControl&&l.findEventPath(t,this.el)){const t=document.getElementById(`bcm-list-${this._id}`);if(t){const e=t.querySelectorAll(".bcm-list__item.focused");if(e.length>0){const i=t.querySelector("main"),n=e[0].offsetHeight,c=i.offsetHeight,o=e[0].offsetTop;o>c&&(i.scrollTop=o-c/2+n/2),o<c&&(i.scrollTop=o-c/2-n/2)}}}}async set(t){t?(Array.isArray(t)&&this.addChecked(t),"string"!=typeof t&&"number"!=typeof t||this.selectedItem(t)):this.setClear()}async get(){var t,e;return this.value?this.checkboxes?null===(e=null===(t=await this.getCheckedList())||void 0===t?void 0:t.checkedList)||void 0===e?void 0:e.map((t=>t.id)):this.value.id:null}async getCheckedList(){return Promise.resolve(H.getCheckedList(this._id))}async getSelected(){return Promise.resolve(H.getSelected(this._id))}async getValue(){return Promise.resolve(this.value)}async addChecked(t=[],e=!1,i=!0){return t&&t.length>0&&(e||(H.setClear(this._id),await p(10)),await H.addChecked(this._id,t),await p(10),i&&(this.value=(await this.getCheckedList()).checkedList),this.markForCheck()),Promise.resolve(this.value)}async selected(t){return!!t&&Promise.resolve(await this.selectedItem(t))}async setClear(t){return H.setClear(this._id),this.value=null,this.inputText="",this.isOpen=!1,this.selectAllItem.indeterminate="uncheck",this.markForCheck(),t&&(t.stopPropagation(),t.preventDefault()),await p(10),Promise.resolve()}async resetCaption(){return await p(10),this.caption=this.captionCache,this.captionType=this.captionTypeCache,this.captionError=null,await p(10),Promise.resolve()}async show(){return this.isOpen=!0,Promise.resolve()}async hide(){return this.isOpen=!1,Promise.resolve()}updateOptions(){H.updateOptions(this._id,this)}handleIndeterminate(t,e){this.selectAllItem=Object.assign(Object.assign({},this.selectAllItem),{indeterminate:this.checkboxes&&t>0?t===e?"check":"indeterminate":"uncheck",checked:!!(this.checkboxes&&t>0)&&t===e})}listenResize(){this.calculateLocation(),this.markForCheck()}async unSelectOther(){return await this.onClearSearch(),this.isSelectedOther=!1,this.searchFound=null,this.returnFilterData={},H.filterData(this._id,null),await p(10),Promise.resolve()}async onClearSearch(){const t=document.getElementById(`bcm-list-${this._id}-search`);return t&&await t.handleClear(),Promise.resolve()}async onSelectSearch(){const t=document.getElementById(`bcm-list-${this._id}-search`);t&&(await p(100),t.onBcmFocus(),t.onBcmSelect())}async filterOtherList(t){const e=(await this.getCheckedList()).nestedResult,i=l.convertIdsToNestedData(t,e);this.returnFilterData=await H.filterData(this._id,i,null,!0),this.searchFound=(null==t?void 0:t.length)||0,this.limit=500,this.searchGetParents=null,await p(1e3),this.markForCheck()}async initState(){var t,e,i;this.onClearSearch(),await H.setValue({id:this._id,dataSource:this.data&&s((()=>"string"==typeof this.data?JSON.parse(this.data):this.data),[]),options:this});const{totalRoots:n,totalItems:c}=H.getValue(this._id);if(this.totalData=c,this.totalRootData=n,this.value=this.checkboxes?(await this.getCheckedList()).checkedList:H.selectedItem(this._id)?H.selectedItem(this._id)[0]:null,this.checkboxes||(this.inputText=(null===(t=this.value)||void 0===t?void 0:t.text)||null),this.checkboxes&&(null===(e=this.value)||void 0===e?void 0:e.length)>0){const t=[];this.value.forEach((e=>{e.items&&0!==e.items.length||t.push(e.id)})),await this.addChecked(t,!1,!1)}await this.handleIndeterminate(null===(i=this.value)||void 0===i?void 0:i.length,this.totalData),await this.markForCheck()}async markForCheck(){await p(10),this.tick=l.UID()}getOptions(){return s((()=>H.getValue(this._id).options),{})}getItems(){return this.isSelectedOther?this.returnFilterData.checkedItems:s((()=>H.getData(this._id)),[])}getLimitedItems(t){return s((()=>H.getDataPagination(this._id,this.searchResultLimit||this.limit,t)),[])}openGroup(t){H.openGroup(this._id,t),this.markForCheck()}focusItem(t){if(t.target.classList.contains("bcm-list__item")){const e=t.target,i=document.getElementById(`bcm-list-${this._id}`);if(i&&i.querySelectorAll(".bcm-list__item").length>0){const t=i.querySelector(".bcm-list__item.focused");t&&t.classList.remove("focused"),e.classList.add("focused")}}}async selectedItem(t){var e;if(!this.checkboxes&&(this.value=H.selectedItem(this._id,t)?H.selectedItem(this._id,t)[0]:null,this.inputText=(null===(e=this.value)||void 0===e?void 0:e.text)||null,this.isOpen=!1,this.markForCheck(),"autocomplete"==this.type&&this.value)){const t=this.getAutoCompleteInput();t&&setTimeout((()=>{var e;t.setValue((null===(e=this.value)||void 0===e?void 0:e.text)||""),this.isOpen=!1}),100)}return Promise.resolve(this.value)}async checkedItem(t){"select-all"===t?H.selectAll(this._id,!this.selectAllItem.checked):H.checkedItem(this._id,t),this.value=(await this.getCheckedList()).checkedList,this.changeVisibleCheckeds(),this.markForCheck()}changeVisibleCheckeds(){const{visibledItems:t}=this.returnFilterData;this.returnFilterData={visibledItems:t,checkedItems:t&&t.filter((t=>t.checked))||[]}}getAutoCompleteInput(){return document.getElementById(`bcm-list-input-tag-container-${this._id}-autocomplete-input`)}dataScrollEvent(t){let e=0,i=new IntersectionObserver((t=>{0===e&&(e++,t[0].isIntersecting&&(this.limit+=15,this.searchResultLimit+=15,i.disconnect(),i=null))}),this.options);i.observe(t.target.lastElementChild)}async calculateLocation(){var t,e;if("select"==this.type||"autocomplete"==this.type||this.linkedComponent){const n=document.getElementById(`bcm-list-${this._id}`);var i=this.placement;const c=document.getElementById(this.linkedComponent?this.linkedComponent:`bcm-list-input-${this._id}`);if(n&&c){b(n,c,i,(t=>i=t)),await p(10);let o=d(i,c),r=0,s=0;if(this.linkedComponent){const i=document.getElementById(this.linkedComponent);if(i){if(!i.noCaption){const e=(null===(t=i.shadowRoot)||void 0===t?void 0:t.querySelector(".bcm-caption-area"))||i.querySelector(".bcm-caption-area");e&&(r=e.offsetHeight||e.clientHeight)}const n=(null===(e=i.shadowRoot)||void 0===e?void 0:e.querySelector(".bcm-label"))||i.querySelector(".bcm-label");n&&(s=n.offsetHeight||n.clientHeight)}}n.style.width=this.fullWidth?c.offsetWidth+"px":this.width||"auto",n.style.height=this.height.indexOf("%")>-1?.01*a.toNumber(this.height)*window.innerHeight-o[0]-50+"px":this.height,n.style.minHeight=this.minHeight;const l="top"==i.split("-")[0]?window.innerHeight-(window.innerHeight-o[0])-50:window.innerHeight-o[0]-50;n.style.maxHeight=this.maxHeight.indexOf("%")>-1?.01*a.toNumber(this.maxHeight)*l+"px":a.toNumber(this.maxHeight)<l?this.maxHeight:l+"px",b(n,c,i,(t=>i=t)),await p(10),o=d(i,c),n.style.top=("top"==i.split("-")[0]?o[0]-n.offsetHeight+s:o[0]-r)+"px",n.style.left="end"==i.split("-")[1]?o[1]-n.offsetWidth+"px":o[1]+"px",n.classList.toggle("bcm-list--top","top"==i.split("-")[0]),this.calculatedViewport=!0}}}render(){const{checkboxes:e,treeview:i,label:c,size:o,disabled:r,readonly:s,required:l,hidden:a,fullWidth:h,searchable:m}=this.getOptions(),b=v("bcm-list",`bcm-list__size-${o}`,`bcm-list__${this.type}`,"large"===o?"size-3":"size-2",{error:this.captionType==x.Status.error,"full-width":h,"bcm-list__linked":this.linkedComponent,hidden:a,readonly:s,disabled:r}),d=v("bcm-list__container",this.linkedComponent?"bcm-list__type-linked-component":`bcm-list__type-${this.type}`,{"is-open":this.isOpen&&this.calculatedViewport,error:this.captionType==x.Status.error,"full-width":h,hidden:a,readonly:s,disabled:r}),u=v("bcm-list__input"),p="select"==this.type||"autocomplete"==this.type||this.linkedComponent;return t(n,{class:b,tabindex:"0",style:{"--width":h?"100%":this.width,"--height":p?"100%":this.height,"--max-height":p?"inherit":this.maxHeight,"--min-height":p?"inherit":this.minHeight}},t("div",{id:`bcm-list-label-${this._id}`,class:"bcm-list__label"},c&&t("div",null,t(g,{size:this.size,type:this.captionType,value:c,required:l,htmlFor:this._id}))),"select"==this.type&&t("div",{id:`bcm-list-input-${this._id}`,class:u},t("span",{class:v("bcm-list__input-container",{"type-single":!e,"value-empty":!this.value})},this.checkboxes?this.value&&this.value.length>0?t("bcm-rc-overflow",{data:this.tagData,maxCount:this.tagCount}):t("span",{class:"bcm-list__input-placeholder"},this.placeholder):this.value?this.inputText:t("span",{class:"bcm-list__input-placeholder"},this.placeholder)),t("span",{class:v("bcm-list__input-buttons",{disabled:r})},this.clearable&&this.value&&t("div",{class:"bcm-list__input-buttons-button"},t("bcm-icon",{icon:"fal fa-times",onClick:t=>!r&&this.setClear(t)})),t("div",{class:`bcm-list__input-buttons-button caret-is ${this.isOpen&&this.calculatedViewport&&"caret-is-open"}`},t("bcm-icon",{icon:"far fa-angle-down"})))),"autocomplete"===this.type&&t("div",{id:`bcm-list-input-${this._id}`,class:v(u,{"bcm-list__input-autocomplete":"autocomplete"==this.type})},t("span",{class:"bcm-list__input-container",id:`bcm-list-input-tag-container-${this._id}`},this.checkboxes&&t("span",{class:"bcm-list__input-tag-container",id:`bcm-list-input-tag-container-${this._id}-autocomplete`}),t("bcm-search",{id:`bcm-list-input-tag-container-${this._id}-autocomplete-input`,class:"bcm-list__autocomplete",data:this.data,clearable:!0,"full-width":!0,"no-caption":!0,placeholder:this.placeholder}))),t(C,{highlight:this.highlightText,searchable:"autocomplete"!=this.type&&m,bcmListContainer:d,checkboxes:e,treeview:i,infoFooter:this.infoFooter,value:this.value,totalData:this.totalData,searchFound:this.searchFound,variableText:this.variableText,searchPlaceholder:this.searchPlaceholder,minSearchLength:this.minSearchLength,searchIsOnlyChilds:this.searchIsOnlyChilds,_id:this._id,checkAll:this.checkAll,data:this.getItems(),width:this.width,height:this.height,size:this.size,selectAllItem:this.selectAllItem,onScrollEvent:t=>this.dataScrollEvent(t),items:this.getLimitedItems(this.searchGetParents),selectedItem:t=>this.selectedItem(t),checkedItem:t=>this.checkedItem(t),openGroup:t=>this.openGroup(t),focusItem:t=>this.focusItem(t),emptyText:this.emptyText,emptyIcon:this.emptyIcon}),t(_,{noCaption:this.noCaption,captionType:this.captionType,captionError:this.captionError,caption:this.caption}))}get el(){return c(this)}static get watchers(){return{_id:["watchId"],value:["handleValueChange"],returnFilterData:["watchReturnFilterData"],isOpen:["handleOpen"],data:["dataChanged"]}}};function J(){return J=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},J.apply(this,arguments)}function Q(t){return Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Q(t)}function X(t,e,i){return(e=function(t){var e=function(t){if("object"!==Q(t)||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!==Q(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===Q(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Z(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function tt(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Z(Object(i),!0).forEach((function(e){X(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Z(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function et(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function it(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var n,c,o,r,s=[],l=!0,a=!1;try{if(o=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=o.call(i)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){a=!0,c=t}finally{try{if(!l&&null!=i.return&&(r=i.return(),Object(r)!==r))return}finally{if(a)throw c}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return et(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?et(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nt(t,e){if(null==t)return{};var i,n,c=function(t,e){if(null==t)return{};var i,n,c={},o=Object.keys(t);for(n=0;n<o.length;n++)e.indexOf(i=o[n])>=0||(c[i]=t[i]);return c}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(n=0;n<o.length;n++)e.indexOf(i=o[n])>=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(c[i]=t[i])}return c}function ct(){return ct=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},ct.apply(this,arguments)}
|
|
5
|
+
import{h as t,r as e,c as i,H as n,g as c}from"./p-6d7fe687.js";import{I as o}from"./p-54c0916c.js";import{J as r}from"./p-184b7d3b.js";import"./p-2fc584c4.js";import"./p-626a65e9.js";import{s,G as l}from"./p-17af6738.js";import{N as a}from"./p-17264523.js";import{S as h}from"./p-8d0ca8c2.js";import{V as m}from"./p-dbdb10d5.js";import"./p-5ae0a59b.js";import{g as b,s as d}from"./p-dbc4c30c.js";import{p as u,d as p}from"./p-3c7a0345.js";import{a as f,B as x}from"./p-a429e85b.js";import{C as _}from"./p-a56e8c98.js";import{c as v}from"./p-d65a1e21.js";import"./p-3fac58f7.js";import{L as g}from"./p-c49d038e.js";import"./p-2e73d572.js";import{c as y}from"./p-3cde7f38.js";import{r as w,a as k}from"./p-1eabd5dc.js";import{c as z}from"./p-6f56f8ca.js";import{I as j}from"./p-2b13dd48.js";import"./p-436364c8.js";import"./p-4aa0e6b1.js";import"./p-74b2d896.js";const O=({disabled:e,checked:i,readonly:n,required:c,indeterminate:o,hidden:r,captionType:s,_id:l})=>{const a=v("bcm-checkbox","bcm-checkbox__type-default","bcm-checkbox-size-medium",{error:s==f.Status.error,hidden:r,checked:i,disabled:e,required:c,readonly:n}),h=v("bcm-checkbox__label-icon","bcm-checkbox__label-icon-lite","bcm-checkbox__label-icon-"+o,{"bcm-checkbox__label-icon-checked":i}),m=v("bcm-checkbox__label");return t("div",{class:a},t("input",{tabindex:"-1",id:l,type:"checkbox",checked:i,disabled:e,required:c,readonly:n}),t("label",{class:m,htmlFor:l},t("span",{class:h},t("bcm-icon",{icon:"far fa-check"}))))},I=({selected:e,total:i,found:n,multiple:c,variableText:o})=>(i=i||0,o=o?u(o,i):"items",t("footer",{class:"bcm-info-footer"},t("bcm-text",{scale:"size-1",color:"grey-8"},c&&e>0&&` ( ${e} selected ) `,` Total ${i} `,null!=n&&` / ${n} `,` ${o} found. `))),S=({item:e,treeview:i,highlight:n,checkboxes:c,size:o,selectedItem:r,openGroup:s,checkedItem:l,focusItem:a,searchIsOnlyChilds:m})=>{const b=e.items&&e.items.length>0;var d=h.htmlEntities(e.text);let u=[];if(n&&h.slugify(d).includes(h.slugify(n))&&(m&&(!m||b&&(i||"group"==e.type))||(d=h.highlight(d,n))),"group"!=e.type&&e.template){const t=e.template.replace(/\s/g,"").match(/\{{[^}}]+\}/g).map((t=>t.replace(/[{}]/g,""))),i=Object.keys(e.itemObject);u=t.filter((t=>i.includes(t)))}d=e.isHtmlContent?e.isHtmlContent:e.template&&u.length>0?h.templateParser(e.template,Object.assign(Object.assign({},e.itemObject),{text:d})):d;const p=!i&&"group"==e.type&&!e.clickable,f=e.disabled,x=e.readonly,_=()=>{e.open=e.isSearching,s(e.id)};return t("div",{id:e.id,hidden:e.hidden,"on-focus":t=>!p&&!f&&a(t),class:v("bcm-list__item","bcm-list__item-"+o,{"bcm-list__item--group":!i&&"group"==e.type,"bcm-list__item--readonly":x})},t("div",{class:v("bcm-list__item-content",!c&&e.selected&&"selected",{disabled:f})},i&&t("div",{class:"bcm-list__item-content-collapse-icon",onClick:()=>_()},b&&t("bcm-icon",{icon:v("fas fa-caret-"+(e.isSearching||e.open?"down":"right"))})),t("div",{class:v("bcm-list__item-content-text",{treeview:i}),onClick:t=>{var i;((i=t).path||i.composedPath()).filter((t=>t.attributes&&t.attributes.getNamedItem("unlinked")))[0]||(x&&_(),!p&&!f&&!x&&(c?l(e.id):r(e.id)))}},c&&(i||!i&&"group"!=e.type)&&t("div",{class:"bcm-list__item-content-text-checkbox"},t(O,{indeterminate:e.indeterminate,checked:e.checked,disabled:e.disabled})),t("span",Object.assign({class:"bcm-list__item-content-text-inner"},e.title&&{title:e.title},{innerHTML:d})))),(i||!i&&"group"==e.type)&&b&&t("div",{class:"bcm-list__item-childs"},(e.isSearching||e.open||!i&&"group"==e.type)&&e.items.map((e=>t(S,{highlight:n,item:e,searchIsOnlyChilds:m,treeview:i,checkboxes:c,size:o,selectedItem:r,checkedItem:l,openGroup:t=>s(t),focusItem:t=>a(t)})))))},C=({highlight:e,selectAllItem:i,bcmListContainer:n,treeview:c,checkboxes:o,checkAll:r,infoFooter:s,value:l,totalData:a,searchFound:h,variableText:m,_id:b,data:d,width:u,height:p,size:f,searchPlaceholder:x,minSearchLength:_,selectedItem:v,openGroup:g,checkedItem:y,onScrollEvent:w,focusItem:k,items:z,searchable:j,searchIsOnlyChilds:O,emptyText:C,emptyIcon:E})=>{const M=!(c&&h>0||h>0);return t("div",{id:`bcm-list-${b}`,class:n,style:{"--height":p,"--width":u}},d&&j&&t("section",{class:"bcm-list__container-search"},t("bcm-search",{size:f,id:`bcm-list-${b}-search`,data:d,clearable:!0,placeholder:x,"min-search-length":_,searchIsOnlyChilds:O})),t("main",{onScroll:t=>w(t),class:"scrolling",style:{"overscroll-behavior":"none"}},t("div",{style:{"min-height":`${(null==h?c?z.length:a:h)*("small"===f?28:"medium"===f?36:48)||0}px`,"overscroll-behavior":"none",height:"100%",display:"flex","flex-direction":"column"}},r&&0!=h&&z&&z.length>0&&o&&M&&t("section",{class:"bcm-list__container-select-all"},t(S,{size:f,item:i,treeview:!1,checkboxes:!0,selectedItem:t=>v(t),checkedItem:t=>y(t),openGroup:t=>g(t),focusItem:t=>k(t)})),z.map((i=>t(S,{highlight:e,size:f,item:i,searchIsOnlyChilds:O,treeview:c,checkboxes:o,selectedItem:t=>v(t),checkedItem:t=>y(t),openGroup:t=>g(t),focusItem:t=>k(t)}))),(!z||0===z.length)&&0!=h&&t("section",{class:"bcm-list__container-no-data"},t("bcm-empty",{style:{height:"auto"},icon:E},t("span",{innerHTML:C||"No data"}))),0==h&&t("section",{class:"bcm-list__container-no-data"},t("bcm-empty",{style:{height:"auto"},icon:E},t("span",{innerHTML:C||"No Data Found"}))))),s&&d&&d.length>0&&t(I,{selected:null==l?void 0:l.length,total:a,found:h,multiple:o,variableText:m}))},{state:E}=y({value:new Map}),M=(t,e,i,n="0.")=>{let c=[];return t&&t.length>0&&(c=t.map(((t,c)=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({itemObject:t},t),e),{parentId:s((()=>i),null),open:e.allOpen||t.open||!1}),(e.treeview||!e.treeview&&"group"==t.type)&&t.items&&t.items.length>0?{items:s((()=>M(t.items,e,t.id,`${n}${c}`)),[])}:{items:[]}),{ct:`${n}${c}`})))),c},T=t=>s((()=>E.value.get(t)),{}),R=(t,e)=>{let i=0;return t.forEach((t=>{(e||!e&&"group"!=t.type)&&(i+=1),(e||!e&&"group"==t.type)&&t.items&&(i+=R(t.items,e))})),i},$=(t,e,i,n)=>{let c;c=i||T(t).dataSource,c&&c.forEach((i=>{null!=n?i.open=n:i.id==e?(i.open=!i.open,i.isSearching=i.open,!i.open&&i.items&&$(t,e,i.items,!1)):i.items&&$(t,e,i.items)}))},D=(t,e,i)=>{i&&i.forEach((i=>{i.id==e?(i.checked=!1,i.itemObject.checked=!1,A(t,i.parentId)):i.items&&D(t,e,i.items)}))},F=(t,e)=>{P(t,e)},P=(t,e,i)=>{let n;e=Array.isArray(e)?e:[e],n=i||T(t).dataSource,n&&n.forEach((i=>{e.includes(i.id)?(N(t,i),i.parentId&&A(t,i.parentId)):i.items&&P(t,e,i.items)}))},N=(t,e,i)=>{const n=T(t);if(n){const c=n.options.treeview;e&&((c||!c&&"group"!=e.type)&&(e.disabled||(e.checked=null!=i?i:!e.checked,e.itemObject.checked=e.checked,e.indeterminate=e.checked?"determinate":"uncheck")),e.items&&e.items.forEach((n=>{N(t,n,null==i?e.checked:i)})))}},A=(t,e,i)=>{let n;n=i||T(t).dataSource,n&&n.forEach((i=>{if(i.id==e){let e=!0,n=!0;i.items&&i.items.map((t=>{(t.checked||"indeterminate"===t.indeterminate)&&(n=!1),!t.checked&&(e=!1)}));const c=e||n?e?"determinate":"uncheck":"indeterminate";i.indeterminate=c,i.checked="determinate"==c,i.itemObject.checked=i.checked,i.parentId&&A(t,i.parentId)}else i.items&&A(t,e,i.items)}))},L=(t,e,i,n)=>{let c,o=[],r=[];return T(t).isSearchOtherTag=n,c=i||T(t).dataSource,c&&c.forEach((i=>{if(e){var c;i.hidden=!0;for(let t=0;t<e.length;t++)if(e[t].id===i.id){c=e[t];break}if(c&&(i.hidden=!1,T(t).isSearchOtherTag||(i.isSearching=!0),r.push(i),i.checked&&o.push(i),c.items)){const{checkedItems:e,visibledItems:s}=L(t,c.items,i.items,n);e&&(o=[...new Set([...o,...e])]),s&&(r=[...new Set([...r,...s])])}}else i.hidden=!1,i.items&&L(t,null,i.items),r.push(i),i.isSearching=!1})),{checkedItems:null!=o?o:[],visibledItems:null!=r?r:[]}},V=(t,e)=>{let i,n=null;return i=e||T(t).dataSource,i&&i.forEach((e=>{if(e.selected)n=e.itemObject;else if(e.items){const i=V(t,e.items);i&&(n=i)}})),n},q=(t,e)=>{let i,n=[],c=[];return i=e||T(t).dataSource,i&&i.forEach((e=>{var i;const o=Object.assign(Object.assign({},e.itemObject),{ct:e.ct});let r=[],s=[];if(e.checked&&(n.push(o),s.push(Object.assign(Object.assign({},o),{items:[]}))),e.items){const c=q(t,e.items);(null===(i=null==c?void 0:c.checkedList)||void 0===i?void 0:i.length)>0&&(n=[...n,...c.checkedList]),c.nestedResult.length>0&&(r=c.nestedResult)}r.length>0?(0==s.length&&s.push(Object.assign(Object.assign({},o),{items:[]})),s[0].items=r,c.push(s[0])):s.length>0&&(s[0].items=r,c.push(s[0]))})),{checkedList:(null==n?void 0:n.length)>0?n:null,nestedResult:c}},W=(t,e,i)=>{let n,c=[];return n=i||T(t).dataSource,n&&n.forEach((i=>{if(e&&(i.id==e?(i.selected=!0,i.itemObject.selected=i.selected):i.selected&&(i.selected=!1,i.itemObject.selected=i.selected)),i.items){const n=W(t,e,i.items);(null==n?void 0:n.length)>0&&(c=[...c,...n])}i.selected&&c.push(i.itemObject)})),c&&c.length>0?c:null},G=(t,e)=>{let i;i=e||T(t).dataSource,i&&i.forEach((e=>{var i,n,c;e.checked&&(e.checked=!1),e.selected&&(e.selected=!1),e.indeterminate&&(e.indeterminate="uncheck"),(null===(i=e.itemObject)||void 0===i?void 0:i.checked)&&(e.itemObject.checked=!1),(null===(n=e.itemObject)||void 0===n?void 0:n.selected)&&(e.itemObject.selected=!1),(null===(c=e.itemObject)||void 0===c?void 0:c.indeterminate)&&(e.itemObject.indeterminate="uncheck"),e.items&&G(t,e.items)}))},H={setValue:t=>{const{id:e,dataSource:i,options:n}=t,{type:c,treeview:o,checkboxes:r,searchable:a,value:h,name:m,label:b,size:d,disabled:u,readonly:p,highlight:f,required:x,hidden:_,fullWidth:v,height:g,maxHeight:y,minHeight:w,width:k,infoFooter:z,variableText:j,template:O,allOpen:I,keyControl:S,checkAll:C,linkedComponent:T,placeholder:$,searchPlaceholder:D,searchIsOnlyChilds:F,clearable:P,caption:N,noCaption:A,captionType:L,captionError:V,placement:q}=n,W={size:d,checkboxes:r,template:O,allOpen:I,highlight:f,treeview:o},G={id:s((()=>e),l.UID),dataSource:i&&i.length>0&&M(i,W),options:{type:c,treeview:o,checkboxes:r,searchable:a,value:h,name:m,label:b,size:d,disabled:u,readonly:p,highlight:f,required:x,hidden:_,fullWidth:v,height:g,maxHeight:y,minHeight:w,width:k,infoFooter:z,variableText:j,template:O,allOpen:I,keyControl:S,checkAll:C,linkedComponent:T,placeholder:$,searchPlaceholder:D,searchIsOnlyChilds:F,clearable:P,caption:N,noCaption:A,captionType:L,captionError:V,placement:q},totalItems:(null==i?void 0:i.length)>0&&R(i,n.treeview),totalRoots:null==i?void 0:i.length};E.value.set(G.id,G)},removeValue:t=>{E.value.delete(t)},getValue:T,getData:t=>{let e=[];const i=T(t);if(i){const{dataSource:t}=i;e=t}return e},getDataPagination:(t,e=3,i)=>{let n=[];const c=T(t);if(c){const{dataSource:t}=c;n=i?t.filter((t=>i.indexOf(t.id)>-1)).slice(0,e):t.slice(0,e)}return n},openGroup:$,checkedItem:F,filterData:L,getSelected:V,getCheckedList:q,selectedItem:W,addChecked:(t,e)=>{T(t)&&e.forEach((e=>{F(t,e)}))},setClear:G,selectAll:(t,e)=>{const i=T(t).dataSource;i&&i.forEach((i=>{N(t,i,e)}))},removeOtherTags:(t,e,i)=>{let n;if(e=Array.isArray(e)?e:[e],i)n=i;else{const e=T(t);n=e.dataSource}n&&e.forEach((e=>{n.forEach((i=>{i.id==e?(i.checked=!1,i.itemObject.checked=!1):i.items&&D(t,e,i.items)}))}))},onRemoveItems:D,updateOptions:(t,e)=>{Object.keys(T(t).options).forEach((i=>{T(t).options[i]=e[i]}))},removeState:t=>Promise.resolve(E.value.delete(t))};class B{constructor(t,e,i,n){this.elementName="",this.childElementName="",this.keyCode=t,this.element=e,this.elementName=i,this.childElementName=n}getKeyCode(){return this.keyCode}getElementName(){return this.elementName}getChildElementName(){return this.childElementName}getFocusedElementName(){return this.getElementName()+".focused"}getFocusedElement(){return this.element.querySelectorAll(this.getFocusedElementName())[0]||null}getFirstElement(){return this.element.querySelectorAll(this.getElementName())[0]||null}getNextElement(){var t;return(null===(t=this.getFocusedElement())||void 0===t?void 0:t.nextElementSibling)||this.getFirstElement()}getPreviousElement(){var t;return(null===(t=this.getFocusedElement())||void 0===t?void 0:t.previousElementSibling)||this.getFirstElement()}getChildElement(){var t;return(null===(t=this.getFocusedElement())||void 0===t?void 0:t.querySelectorAll(this.getChildElementName())[0])||null}getParentElement(t){if(t&&t)return t&&t.attributes["data-isroot"]?t:this.getParentElement(t.parentNode)}focusElementIsOpen(){var t;return(null===(t=this.getFocusedElement())||void 0===t?void 0:t.classList.contains("bcm-list__item--open"))||!1}isRootElement(){var t;return(null===(t=this.getFocusedElement())||void 0===t?void 0:t.querySelectorAll(this.getChildElementName()).length)>0}isRootElementIsOpen(){return this.getFocusedElement().classList.contains("bcm-list__item--open")}getFocusedChildElement(){var t;return(null===(t=this.getChildElement())||void 0===t?void 0:t.querySelectorAll(".focused")[0])||null}isLastElement(){var t;return null===(null===(t=this.getFocusedElement())||void 0===t?void 0:t.nextElementSibling)}focusParentElementFirstChild(){var t,e;return this.setFocus(null===(e=null===(t=this.getFocusedElement())||void 0===t?void 0:t.parentElement)||void 0===e?void 0:e.firstChild)}isFirstElement(){var t;return null===(null===(t=this.getFocusedElement())||void 0===t?void 0:t.previousElementSibling)}focusRootElement(){var t,e,i;return this.setFocus(null===(i=null===(e=null===(t=this.getFocusedElement())||void 0===t?void 0:t.parentElement)||void 0===e?void 0:e.parentElement)||void 0===i?void 0:i.firstChild)}nextRootElement(){var t,e,i;return this.setFocus(null===(i=null===(e=null===(t=this.getFocusedElement())||void 0===t?void 0:t.parentElement)||void 0===e?void 0:e.parentElement)||void 0===i?void 0:i.nextElementSibling)}findFocusElementParent(){return this.getFocusedElement().parentNode.querySelectorAll(".bcm-list__item--open")}getLastElement(){return this.element.querySelectorAll(this.getElementName())[this.element.querySelectorAll(this.getElementName()).length-1]||null}setFocus(t){t.focus()}}class K extends B{constructor(t,e,i,n){super(t,e,".bcm-list__item",".bcm-list__item-childs"),this.isTreeview=!1,this.isCheckBoxes=!1,this.isTreeview=i,this.isCheckBoxes=n}keyUpControl(){this.isTreeview?this.keyUpTreeview():this.isFirstElement()?this.setFocus(this.getLastElement()):this.setFocus(this.getPreviousElement())}keyDownTreeView(){var t;if(this.isTreeview)if(this.isRootElement()&&this.isRootElementIsOpen()){const t=this.getChildElement();t&&this.setFocus(t.firstChild)}else this.isLastElement()&&this.getParentElement(this.getFocusedElement())?this.setFocus(null===(t=this.getParentElement(this.getFocusedElement()))||void 0===t?void 0:t.nextElementSibling):this.setFocus(this.getNextElement())}keyUpTreeview(){if(this.isFirstElement()){const t=this.getParentElement(this.getFocusedElement());this.setFocus(t)}else{const t=this.getPreviousElement();if(t)if(t.classList.contains("bcm-list__item--open")){const e=t.querySelectorAll(this.getChildElementName())[0];console.log({getChildElement:e}),this.setFocus(e.lastChild)}else this.setFocus(t)}}keyDownControl(){this.isTreeview?this.keyDownTreeView():this.isLastElement()?this.setFocus(this.getFirstElement()):this.setFocus(this.getNextElement())}keyRightControl(){if(this.isTreeview&&!this.isRootElementIsOpen()&&this.isRootElement()){const{id:t}=this.getFocusedElement();this.openGroup(t)}}keyLeftControl(){if(this.isTreeview&&this.isRootElementIsOpen()&&this.isRootElement()){const{id:t}=this.getFocusedElement();this.openGroup(t)}}keyEnterControl(){}keySpaceControl(){if(this.isCheckBoxes){const{id:t}=this.getFocusedElement();this.checkedItem(t)}}keyDown(){switch(this.getKeyCode()){case f.KeyCode.up:this.keyUpControl();break;case f.KeyCode.down:this.keyDownControl();break;case f.KeyCode.left:this.keyLeftControl();break;case f.KeyCode.right:this.keyRightControl();break;case f.KeyCode.enter:this.keyEnterControl();break;case f.KeyCode.space:this.keySpaceControl()}}keyUp(){}}var U=function(t,e,i,n){var c,o=arguments.length,r=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,n);else for(var s=t.length-1;s>=0;s--)(c=t[s])&&(r=(o<3?c(r):o>3?c(e,i,r):c(e,i))||r);return o>3&&r&&Object.defineProperty(e,i,r),r};const Y=class{constructor(t){e(this,t),this.bcmChecklist=i(this,"bcm-checklist",7),this.bcmSelected=i(this,"bcm-selected",7),this.change=i(this,"bcm-change",7),this.open=i(this,"bcm-open",7),this.close=i(this,"bcm-close",7),this.debounce=null,this.debounceHandler=l.debounceInput((()=>this.listenResize()),300,!1),this._id=l.UID(),this.type=x.ListType.listbox,this.treeview=!1,this.checkboxes=!1,this.searchable=!1,this.value=null,this.inputText=void 0,this.name=void 0,this.label=void 0,this.size=x.Size.medium,this.disabled=!1,this.readonly=!1,this.highlight=!1,this.highlightText=void 0,this.required=!1,this.hidden=!1,this.fullWidth=!1,this.height="256px",this.maxHeight="500px",this.minHeight="150px",this.width="256px",this.infoFooter=!1,this.variableText="item",this.template=void 0,this.allOpen=!1,this.keyControl=!1,this.checkAll=!0,this.stopDeepClean=!1,this.linkedComponent=void 0,this.isOpen=!1,this.calculatedViewport=!1,this.isSelectedOther=!1,this.isHaveOtherTag=!1,this.placeholder="Choose an option",this.searchPlaceholder="Search",this.searchIsOnlyChilds=!1,this.minSearchLength=2,this.clearable=!1,this.caption=void 0,this.noCaption=!1,this.captionType=x.Status.default,this.captionError=void 0,this.emptyText=void 0,this.emptyIcon="fad fa-folder-open",this.captionCache=void 0,this.captionTypeCache=void 0,this.tick={},this.totalData=0,this.totalRootData=0,this.limit=20,this.searchGetParents=void 0,this.searchResultLimit=20,this.searchFound=null,this.returnFilterData={},this.returnOtherData={},this.options={rootMargin:"30px"},this.tagContainerWidth=0,this.selectAllItem={id:"select-all",text:"Select All",value:"select-all",checked:!1,disabled:!1,icon:"",status:x.Status.default,indeterminate:"uncheck"},this.placement=x.Placement["bottom-start"],this.data=[]}connectedCallback(){"256px"!=this.height&&(this.limit=this.height.indexOf("px")>-1?Math.floor(+this.height.replace("px","")/10):Math.floor(+window.innerHeight/10),this.searchResultLimit=this.limit,this.markForCheck());const t=document.querySelectorAll(`#bcm-list-${this._id}`);(null==t?void 0:t.length)>1&&t.forEach(((t,e)=>e>0&&t.remove()))}componentWillRender(){this.calculateLocation()}componentShouldUpdate(t,e,i){Object.keys(this.getOptions()).indexOf(i)>-1&&t!==e&&this.updateOptions()}get containerWidth(){var t,e;return null===(e=null===(t=this.el)||void 0===t?void 0:t.getBoundingClientRect())||void 0===e?void 0:e.width}get tagCount(){return this.containerWidth>0?Math.floor(+(this.containerWidth-100)/85):0}get tagData(){return s((()=>{var t;return null===(t=this.value)||void 0===t?void 0:t.map((t=>({value:t.id,label:h.textLimitter(t.text,7),text:t.tooltipMessage||t.tagTitle||t.text})))}),[])}async componentDidLoad(){if(await this.initState(),"select"==this.type||"autocomplete"==this.type||this.linkedComponent){const t=this.el.querySelector(`#bcm-list-${this._id}`);t&&document.body.appendChild(t)}}disconnectedCallback(){if(this.isOpen=!1,!this.stopDeepClean&&(H.removeState(this._id),this.el.innerHTML="","select"==this.type||"autocomplete"==this.type||this.linkedComponent)){const t=document.querySelectorAll(`#bcm-list-${this._id}`);(null==t?void 0:t.length)&&(t.forEach((t=>t.remove())),this.el.remove())}}watchId(t,e){H.removeState(e),this.initState()}handleValueChange(t,e){var i;l.objectIsEmpty(this.returnFilterData)&&this.handleIndeterminate((null===(i=this.value)||void 0===i?void 0:i.length)||0,this.totalData),this.checkboxes?m.compareTwoArrayIsSame(t,e)||(this.bcmChecklist.emit(this.value),this.change.emit(this.value)):(null==t?void 0:t.id)!=(null==e?void 0:e.id)&&this.change.emit(this.value)}watchReturnFilterData(t){var e;const{checkedItems:i,visibledItems:n}=t;i&&n?this.handleIndeterminate(i.length,n.length):this.handleIndeterminate((null===(e=this.value)||void 0===e?void 0:e.length)||0,this.totalData)}async handleOpen(){this.isOpen?(this.open.emit(),this.calculateLocation(),this.onSelectSearch()):(this.listScrollToTop(),this.close.emit(),await p(100),this.unSelectOther())}listScrollToTop(){const t=document.querySelector(`#bcm-list-${this._id}`);t&&(t.querySelector(".scrolling").scrollTop=0)}async dataChanged(t,e){m.compareTwoArrayIsSame(t,e)||await this.initState()}isIntersecting(t){const e=null==t?void 0:t.target;e&&e.id===this._id&&this.listenResize()}handleSlotItems(t){var e;(null===(e=null==t?void 0:t.detail)||void 0===e?void 0:e.length)>0&&(this.data=t.detail)}handleChange(t){t.target.id==`bcm-list-input-tag-container-${this._id}-autocomplete-input`&&t.stopImmediatePropagation()}handleResize(){this.calculateLocation(),this.debounceHandler()}handleWheel(t){if(this.isOpen){const e=document.querySelector(`#bcm-list-${this._id}`);e&&l.findEventPath(t,e)?("select"==this.type||"autocomplete"==this.type||this.linkedComponent)&&this.calculateLocation():this.hide()}}clearAutocomplete(){if("autocomplete"==this.type){const t=this.getAutoCompleteInput();t&&t.handleClear(!1)}}async handleSelectOtherTag(t){if(this.disabled)return;const{id:e,checked:i}=t.detail;this.isSelectedOther=i,e&&(i?this.filterOtherList(e):this.unSelectOther(),this.isOpen=!0)}async handleDeleteTag(t){var e;if(this.disabled)return;const{id:i}=t.detail;this.isSelectedOther&&this.unSelectOther(),Array.isArray(i)?H.removeOtherTags(this._id,i):H.checkedItem(this._id,i),this.value=(await this.getCheckedList()).checkedList,this.handleIndeterminate((null===(e=this.value)||void 0===e?void 0:e.length)||0,this.totalData)}async handleSelectTag(t){this.disabled||(this.clearAutocomplete(),this.onSelectSearch(),this.unSelectOther())}handleClick(t){var e;if(this.disabled)return;const i=document.querySelector(`#bcm-list-${this._id}`),n=l.findEventPath(t,this.el)||i&&l.findEventPath(t,i);if(n&&(null!==this.debounce&&(t.preventDefault(),t.stopPropagation(),clearTimeout(this.debounce),this.debounce=null),this.debounce=setTimeout((()=>{this.debounce=null}),300)),!n&&"autocomplete"==this.type){const t=this.getAutoCompleteInput();t&&t.setValue(this.checkboxes?"":(null===(e=this.value)||void 0===e?void 0:e.text)||"")}const c=l.findEventPathWithKey(t,"className",["bcm-tag"]),o=l.findEventPathWithKey(t,"className",["bcm-tag bcm-tag--other"]),r=l.findEventPathWithKey(t,"id",[`bcm-list-input-${this._id}`,`bcm-list-label-${this._id}`]),s=l.findEventPathWithKey(t,"className",["right close-button"]);r&&!s&&"autocomplete"!=this.type&&(this.isOpen=!(!c&&!o&&this.isOpen)),i&&this.isOpen&&(i.contains(t.target)||this.el.contains(t.target)||(this.isOpen=!1))}bcmOnSearchClear(t){var e,i;"autocomplete"==this.type&&((null===(e=null==t?void 0:t.target)||void 0===e?void 0:e.id)!==`bcm-list-${this._id}-search`&&(null===(i=null==t?void 0:t.target)||void 0===i?void 0:i.id)!==`bcm-list-input-tag-container-${this._id}-autocomplete-input`||t.detail&&this.setClear())}bcmOnSearch(t){var e,i,n,c,o,r;(null===(e=null==t?void 0:t.target)||void 0===e?void 0:e.id)!==`bcm-list-${this._id}-search`&&(null===(i=null==t?void 0:t.target)||void 0===i?void 0:i.id)!==`bcm-list-input-tag-container-${this._id}-autocomplete-input`||(this.searchGetParents=s((()=>{var e;return null===(e=t.detail)||void 0===e?void 0:e.parentIndex}),null),this.searchResultLimit=10,this.searchFound=null!=(null===(n=t.detail)||void 0===n?void 0:n.matching)?null===(c=t.detail)||void 0===c?void 0:c.matching.length:null,this.returnFilterData=H.filterData(this._id,null===(o=t.detail)||void 0===o?void 0:o.nestedResult),this.searchFound>0&&this.highlight&&(this.highlightText=null===(r=t.detail)||void 0===r?void 0:r.value),"autocomplete"==this.type&&(this.isOpen=!0),t.detail.result||("autocomplete"==this.type?this.isOpen=!1:(this.returnFilterData={},H.filterData(this._id,null)),this.searchResultLimit=null,this.highlightText=null),this.markForCheck())}handleKeyDown(t){const e=t.keyCode||t.which;if(e===x.KeyCode.escape&&this.isOpen&&(this.isOpen=!1,t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()),this.keyControl){const t=new K(e,this.el,this.treeview,this.checkboxes);t.openGroup=t=>{this.openGroup(t)},t.checkedItem=t=>{this.checkedItem(t)},t.keyDown()}}handleKeyUp(t){if(this.keyControl&&l.findEventPath(t,this.el)){const t=document.getElementById(`bcm-list-${this._id}`);if(t){const e=t.querySelectorAll(".bcm-list__item.focused");if(e.length>0){const i=t.querySelector("main"),n=e[0].offsetHeight,c=i.offsetHeight,o=e[0].offsetTop;o>c&&(i.scrollTop=o-c/2+n/2),o<c&&(i.scrollTop=o-c/2-n/2)}}}}async set(t){t?(Array.isArray(t)&&this.addChecked(t),"string"!=typeof t&&"number"!=typeof t||this.selectedItem(t)):this.setClear()}async get(){var t,e;return this.value?this.checkboxes?null===(e=null===(t=await this.getCheckedList())||void 0===t?void 0:t.checkedList)||void 0===e?void 0:e.map((t=>t.id)):this.value.id:null}async getCheckedList(){return Promise.resolve(H.getCheckedList(this._id))}async getSelected(){return Promise.resolve(H.getSelected(this._id))}async getValue(){return Promise.resolve(this.value)}async addChecked(t=[],e=!1,i=!0){return t&&t.length>0&&(e||(H.setClear(this._id),await p(10)),await H.addChecked(this._id,t),await p(10),i&&(this.value=(await this.getCheckedList()).checkedList),this.markForCheck()),Promise.resolve(this.value)}async selected(t){return!!t&&Promise.resolve(await this.selectedItem(t))}async setClear(t){return H.setClear(this._id),this.value=null,this.inputText="",this.isOpen=!1,this.selectAllItem.indeterminate="uncheck",this.markForCheck(),t&&(t.stopPropagation(),t.preventDefault()),await p(10),Promise.resolve()}async resetCaption(){return await p(10),this.caption=this.captionCache,this.captionType=this.captionTypeCache,this.captionError=null,await p(10),Promise.resolve()}async show(){return this.isOpen=!0,Promise.resolve()}async hide(){return this.isOpen=!1,Promise.resolve()}updateOptions(){H.updateOptions(this._id,this)}handleIndeterminate(t,e){this.selectAllItem=Object.assign(Object.assign({},this.selectAllItem),{indeterminate:this.checkboxes&&t>0?t===e?"check":"indeterminate":"uncheck",checked:!!(this.checkboxes&&t>0)&&t===e})}listenResize(){this.calculateLocation(),this.markForCheck()}async unSelectOther(){return await this.onClearSearch(),this.isSelectedOther=!1,this.searchFound=null,this.returnFilterData={},H.filterData(this._id,null),await p(10),Promise.resolve()}async onClearSearch(){const t=document.getElementById(`bcm-list-${this._id}-search`);return t&&await t.handleClear(),Promise.resolve()}async onSelectSearch(){const t=document.getElementById(`bcm-list-${this._id}-search`);t&&(await p(100),t.onBcmFocus(),t.onBcmSelect())}async filterOtherList(t){const e=(await this.getCheckedList()).nestedResult,i=l.convertIdsToNestedData(t,e);this.returnFilterData=await H.filterData(this._id,i,null,!0),this.searchFound=(null==t?void 0:t.length)||0,this.limit=500,this.searchGetParents=null,await p(1e3),this.markForCheck()}async initState(){var t,e,i;this.onClearSearch(),await H.setValue({id:this._id,dataSource:this.data&&s((()=>"string"==typeof this.data?JSON.parse(this.data):this.data),[]),options:this});const{totalRoots:n,totalItems:c}=H.getValue(this._id);if(this.totalData=c,this.totalRootData=n,this.value=this.checkboxes?(await this.getCheckedList()).checkedList:H.selectedItem(this._id)?H.selectedItem(this._id)[0]:null,this.checkboxes||(this.inputText=(null===(t=this.value)||void 0===t?void 0:t.text)||null),this.checkboxes&&(null===(e=this.value)||void 0===e?void 0:e.length)>0){const t=[];this.value.forEach((e=>{e.items&&0!==e.items.length||t.push(e.id)})),await this.addChecked(t,!1,!1)}await this.handleIndeterminate(null===(i=this.value)||void 0===i?void 0:i.length,this.totalData),await this.markForCheck()}async markForCheck(){await p(10),this.tick=l.UID()}getOptions(){return s((()=>H.getValue(this._id).options),{})}getItems(){return this.isSelectedOther?this.returnFilterData.checkedItems:s((()=>H.getData(this._id)),[])}getLimitedItems(t){return s((()=>H.getDataPagination(this._id,this.searchResultLimit||this.limit,t)),[])}openGroup(t){H.openGroup(this._id,t),this.markForCheck()}focusItem(t){if(t.target.classList.contains("bcm-list__item")){const e=t.target,i=document.getElementById(`bcm-list-${this._id}`);if(i&&i.querySelectorAll(".bcm-list__item").length>0){const t=i.querySelector(".bcm-list__item.focused");t&&t.classList.remove("focused"),e.classList.add("focused")}}}async selectedItem(t){var e;if(!this.checkboxes&&(this.value=H.selectedItem(this._id,t)?H.selectedItem(this._id,t)[0]:null,this.inputText=(null===(e=this.value)||void 0===e?void 0:e.text)||null,this.isOpen=!1,this.markForCheck(),"autocomplete"==this.type&&this.value)){const t=this.getAutoCompleteInput();t&&setTimeout((()=>{var e;t.setValue((null===(e=this.value)||void 0===e?void 0:e.text)||""),this.isOpen=!1}),100)}return Promise.resolve(this.value)}async checkedItem(t){"select-all"===t?H.selectAll(this._id,!this.selectAllItem.checked):H.checkedItem(this._id,t),this.value=(await this.getCheckedList()).checkedList,this.changeVisibleCheckeds(),this.markForCheck()}changeVisibleCheckeds(){const{visibledItems:t}=this.returnFilterData;this.returnFilterData={visibledItems:t,checkedItems:t&&t.filter((t=>t.checked))||[]}}getAutoCompleteInput(){return document.getElementById(`bcm-list-input-tag-container-${this._id}-autocomplete-input`)}dataScrollEvent(t){let e=0,i=new IntersectionObserver((t=>{0===e&&(e++,t[0].isIntersecting&&(this.limit+=15,this.searchResultLimit+=15,i.disconnect(),i=null))}),this.options);i.observe(t.target.lastElementChild)}async calculateLocation(){var t,e;if("select"==this.type||"autocomplete"==this.type||this.linkedComponent){const n=document.getElementById(`bcm-list-${this._id}`);var i=this.placement;const c=document.getElementById(this.linkedComponent?this.linkedComponent:`bcm-list-input-${this._id}`);if(n&&c){b(n,c,i,(t=>i=t)),await p(10);let o=d(i,c),r=0,s=0;if(this.linkedComponent){const i=document.getElementById(this.linkedComponent);if(i){if(!i.noCaption){const e=(null===(t=i.shadowRoot)||void 0===t?void 0:t.querySelector(".bcm-caption-area"))||i.querySelector(".bcm-caption-area");e&&(r=e.offsetHeight||e.clientHeight)}const n=(null===(e=i.shadowRoot)||void 0===e?void 0:e.querySelector(".bcm-label"))||i.querySelector(".bcm-label");n&&(s=n.offsetHeight||n.clientHeight)}}n.style.width=this.fullWidth?c.offsetWidth+"px":this.width||"auto",n.style.height=this.height.indexOf("%")>-1?.01*a.toNumber(this.height)*window.innerHeight-o[0]-50+"px":this.height,n.style.minHeight=this.minHeight;const l="top"==i.split("-")[0]?window.innerHeight-(window.innerHeight-o[0])-50:window.innerHeight-o[0]-50;n.style.maxHeight=this.maxHeight.indexOf("%")>-1?.01*a.toNumber(this.maxHeight)*l+"px":a.toNumber(this.maxHeight)<l?this.maxHeight:l+"px",b(n,c,i,(t=>i=t)),await p(10),o=d(i,c),n.style.top=("top"==i.split("-")[0]?o[0]-n.offsetHeight+s:o[0]-r)+"px",n.style.left="end"==i.split("-")[1]?o[1]-n.offsetWidth+"px":o[1]+"px",n.classList.toggle("bcm-list--top","top"==i.split("-")[0]),this.calculatedViewport=!0}}}render(){const{checkboxes:e,treeview:i,label:c,size:o,disabled:r,readonly:s,required:l,hidden:a,fullWidth:h,searchable:m}=this.getOptions(),b=v("bcm-list",`bcm-list__size-${o}`,`bcm-list__${this.type}`,"large"===o?"size-3":"size-2",{error:this.captionType==x.Status.error,"full-width":h,"bcm-list__linked":this.linkedComponent,hidden:a,readonly:s,disabled:r}),d=v("bcm-list__container",this.linkedComponent?"bcm-list__type-linked-component":`bcm-list__type-${this.type}`,{"is-open":this.isOpen&&this.calculatedViewport,error:this.captionType==x.Status.error,"full-width":h,hidden:a,readonly:s,disabled:r}),u=v("bcm-list__input"),p="select"==this.type||"autocomplete"==this.type||this.linkedComponent;return t(n,{class:b,tabindex:"0",style:{"--width":h?"100%":this.width,"--height":p?"100%":this.height,"--max-height":p?"inherit":this.maxHeight,"--min-height":p?"inherit":this.minHeight}},t("div",{id:`bcm-list-label-${this._id}`,class:"bcm-list__label"},c&&t("div",null,t(g,{size:this.size,type:this.captionType,value:c,required:l,htmlFor:this._id}))),"select"==this.type&&t("div",{id:`bcm-list-input-${this._id}`,class:u},t("span",{class:v("bcm-list__input-container",{"type-single":!e,"value-empty":!this.value})},this.checkboxes?this.value&&this.value.length>0?t("bcm-rc-overflow",{data:this.tagData,maxCount:this.tagCount}):t("span",{class:"bcm-list__input-placeholder"},this.placeholder):this.value?this.inputText:t("span",{class:"bcm-list__input-placeholder"},this.placeholder)),t("span",{class:v("bcm-list__input-buttons",{disabled:r})},this.clearable&&this.value&&t("div",{class:"bcm-list__input-buttons-button"},t("bcm-icon",{icon:"fal fa-times",onClick:t=>!r&&this.setClear(t)})),t("div",{class:`bcm-list__input-buttons-button caret-is ${this.isOpen&&this.calculatedViewport&&"caret-is-open"}`},t("bcm-icon",{icon:"far fa-angle-down"})))),"autocomplete"===this.type&&t("div",{id:`bcm-list-input-${this._id}`,class:v(u,{"bcm-list__input-autocomplete":"autocomplete"==this.type})},t("span",{class:"bcm-list__input-container",id:`bcm-list-input-tag-container-${this._id}`},this.checkboxes&&t("span",{class:"bcm-list__input-tag-container",id:`bcm-list-input-tag-container-${this._id}-autocomplete`}),t("bcm-search",{id:`bcm-list-input-tag-container-${this._id}-autocomplete-input`,class:"bcm-list__autocomplete",data:this.data,clearable:!0,"full-width":!0,"no-caption":!0,placeholder:this.placeholder}))),t(C,{highlight:this.highlightText,searchable:"autocomplete"!=this.type&&m,bcmListContainer:d,checkboxes:e,treeview:i,infoFooter:this.infoFooter,value:this.value,totalData:this.totalData,searchFound:this.searchFound,variableText:this.variableText,searchPlaceholder:this.searchPlaceholder,minSearchLength:this.minSearchLength,searchIsOnlyChilds:this.searchIsOnlyChilds,_id:this._id,checkAll:this.checkAll,data:this.getItems(),width:this.width,height:this.height,size:this.size,selectAllItem:this.selectAllItem,onScrollEvent:t=>this.dataScrollEvent(t),items:this.getLimitedItems(this.searchGetParents),selectedItem:t=>this.selectedItem(t),checkedItem:t=>this.checkedItem(t),openGroup:t=>this.openGroup(t),focusItem:t=>this.focusItem(t),emptyText:this.emptyText,emptyIcon:this.emptyIcon}),t(_,{noCaption:this.noCaption,captionType:this.captionType,captionError:this.captionError,caption:this.caption}))}get el(){return c(this)}static get watchers(){return{_id:["watchId"],value:["handleValueChange"],returnFilterData:["watchReturnFilterData"],isOpen:["handleOpen"],data:["dataChanged"]}}};function J(){return J=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},J.apply(this,arguments)}function Q(t){return Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Q(t)}function X(t,e,i){return(e=function(t){var e=function(t){if("object"!==Q(t)||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!==Q(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===Q(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Z(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function tt(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Z(Object(i),!0).forEach((function(e){X(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Z(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function et(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function it(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var n,c,o,r,s=[],l=!0,a=!1;try{if(o=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=o.call(i)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){a=!0,c=t}finally{try{if(!l&&null!=i.return&&(r=i.return(),Object(r)!==r))return}finally{if(a)throw c}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return et(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?et(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nt(t,e){if(null==t)return{};var i,n,c=function(t,e){if(null==t)return{};var i,n,c={},o=Object.keys(t);for(n=0;n<o.length;n++)e.indexOf(i=o[n])>=0||(c[i]=t[i]);return c}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(n=0;n<o.length;n++)e.indexOf(i=o[n])>=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(c[i]=t[i])}return c}function ct(){return ct=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},ct.apply(this,arguments)}
|
|
6
6
|
/** @license React v16.13.1
|
|
7
7
|
* react-is.production.min.js
|
|
8
8
|
*
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{r as t,h as e,H as i,g as s}from"./p-6d7fe687.js";import{c as a}from"./p-d65a1e21.js";import{I as h}from"./p-54c0916c.js";import{D as n}from"./p-626a65e9.js";import{G as p}from"./p-
|
|
5
|
+
import{r as t,h as e,H as i,g as s}from"./p-6d7fe687.js";import{c as a}from"./p-d65a1e21.js";import{I as h}from"./p-54c0916c.js";import{D as n}from"./p-626a65e9.js";import{G as p}from"./p-17af6738.js";import{a as r}from"./p-a429e85b.js";import{d as l}from"./p-3c7a0345.js";import"./p-6f56f8ca.js";import"./p-4aa0e6b1.js";const o=class{constructor(e){t(this,e),this._id=p.UID(),this.date=new Date,this.value=void 0,this.endDate=null,this.range=!1,this.hidden=!1,this.name=void 0,this.fullWidth=!1,this.required=!1,this.label=void 0,this.placeholder=void 0,this.disabledDates="",this.disabled=!1,this.noCaption=!1,this.caption="",this.captionError=void 0,this.captionType="default",this.alignment=void 0,this._internal_id=(4*Math.random()).toString(16).replace(".",""),this.placement=r.Placement["bottom-start"],this.linkedComponent=void 0,this.clearable=!1,this.stateStartDate=null,this.stateEndDate=null}handleStartDateChange(){this.handleDate()}handleEndDateChange(){this.handleDate()}handlePickerLoad(){this.value=this.picker.value}handlePickerChange(t){this.value=t.detail}async set(t){return this.picker.set(t)}async get(){var t;return(null===(t=this.value)||void 0===t?void 0:t.timestamp)||null}async setDisabled(t){this.disabled=t}async setClear(){return await this.picker.setClear(),await l(10),Promise.resolve()}async setStartDate(t){t?(t=n.convertTimeStampToDate(new Date(t).getTime()),this.stateStartDate=t):this.setClear()}async setEndDate(t){t?(t=n.convertTimeStampToDate(new Date(t).getTime()),this.stateEndDate=t):this.setClear()}handleDate(){this.range?this.stateStartDate&&this.stateEndDate&&this.set(this.stateStartDate+"-"+this.stateEndDate):this.set(this.stateStartDate)}async getInput(){return await this.picker.getInput()}async open(){return await this.picker.open()}async getValue(){return this.value}async isValid(){return await this.picker.isValid()}async resetCaption(){return await l(10),await this.picker.resetCaption(),this.captionType="default",this.captionError=null,await l(10),Promise.resolve()}render(){const t=a(this.hidden?"hidden":null,{"full-width":this.fullWidth,"linked-component":this.linkedComponent});return e(i,{class:t},e("bcm-datetime-picker",{"linked-component":this.linkedComponent,id:this._id,name:this.name,type:this.range?"range":"date",date:this.date,placeholder:this.placeholder,fullWidth:this.fullWidth,ref:t=>this.picker=t,required:this.required,clearable:this.clearable,label:this.label,"end-date":this.endDate,disabled:this.disabled,disabledDates:this.disabledDates,"on-bcm-load":()=>this.handlePickerLoad(),"on-bcm-change":t=>this.handlePickerChange(t),noCaption:this.noCaption,caption:this.caption,captionError:this.captionError,captionType:this.captionType,alignment:this.alignment,placement:this.placement}))}get el(){return s(this)}static get watchers(){return{stateStartDate:["handleStartDateChange"],stateEndDate:["handleEndDateChange"]}}};(function(t,e,i,s){var a,h=arguments.length,n=h<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var p=t.length-1;p>=0;p--)(a=t[p])&&(n=(h<3?a(n):h>3?a(e,i,n):a(e,i))||n);h>3&&n&&Object.defineProperty(e,i,n)})([h()],o.prototype,"el",void 0),o.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}:host{display:inline-block;width:100%;max-width:256px}:host(.full-width){max-width:100%}:host(.hidden){display:none}:host(.linked-component){display:none}';export{o as bcm_date_picker}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{r as o,c as t,h as p,H as i,g as e}from"./p-6d7fe687.js";import{c as r}from"./p-d65a1e21.js";import{C as n}from"./p-2fc584c4.js";import{G as c}from"./p-
|
|
5
|
+
import{r as o,c as t,h as p,H as i,g as e}from"./p-6d7fe687.js";import{c as r}from"./p-d65a1e21.js";import{C as n}from"./p-2fc584c4.js";import{G as c}from"./p-17af6738.js";import{S as m}from"./p-8d0ca8c2.js";import{s}from"./p-dbc4c30c.js";import"./p-6f56f8ca.js";import"./p-436364c8.js";import"./p-3c7a0345.js";import"./p-4aa0e6b1.js";import"./p-a429e85b.js";const b={error:["fal fa-times-circle","red-6"],warning:["fal fa-exclamation-circle","warmyellow-6"]},a=class{constructor(p){o(this,p),this.onConfirm=t(this,"bcm-popconfirm-confirm",7),this.onCancel=t(this,"bcm-popconfirm-cancel",7),this.onShow=t(this,"bcm-popconfirm-show",7),this._id=c.UID(),this._target_id=void 0,this.message=void 0,this.status="warning",this.cancelText="No",this.okeyText="Yes",this.placement=void 0,this.open=!1,this.hidden=!1,this._internal_id=void 0,this.placement_string=void 0}getPopconfirm(){return document.querySelector(`bcm-popconfirm[id="${this._target_id}"]`)}handleClickOutside(o){this.el.contains(o.target)||this.getPopconfirm().contains(o.target)||(this.getPopconfirm().hide(),this.hide())}showHandler(o){o.detail!=this._target_id&&(this.getPopconfirm().hide(),this.hide())}async show(){this.open=!0,this.onShow.emit(this._target_id)}async hide(){this.open=!1}componentWillRender(){this.calculateLocation()}calculateLocation(){if(this.open){var o=this.placement;const t=this.el.querySelector(".bcm-pop-box"),p=document.getElementById(this._target_id).children[0];if(t&&p){let t=s(o,p,{top:p.offsetTop,left:p.offsetLeft});this.setPlacementString(o),this.el.style.top=t[0]+"px",this.el.style.left=t[1]+"px"}}}setPlacementString(o){const t=m.textContains(o,"-")?o.split("-"):o.split(" ");1===t.length&&t.push("center"),this.placement_string=t.join(" ")}handleConfirm(){this.getPopconfirm().hide(),this.hide(),this.onConfirm.emit(this._target_id)}handleCancel(){this.getPopconfirm().hide(),this.hide(),this.onCancel.emit(this._target_id)}render(){const{message:o,cancelText:t,okeyText:e,open:c,placement_string:m,status:s}=this,a=b[s],x=r("bcm-pop-box"),f=r("bcm-popconfirm-box",m,{"bcm-pop-open":c});return p(i,{class:f},p("div",{class:x},p("div",{class:"bcm-pop-content"},p("div",{class:"bcm-pop-content-icon size-3",style:{color:n.convertColorToHex(a[1])}},p("bcm-icon",{icon:a[0]})),p("div",{class:"bcm-pop-content-text"},p("bcm-text",{scale:"size-2",innerHTML:o}))),p("div",{class:"bcm-pop-buttons"},p("bcm-button",{size:"small",onClick:()=>this.handleCancel(),outline:!0},t),p("bcm-button",{size:"small",onClick:()=>this.handleConfirm()},e))))}get el(){return e(this)}};a.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}*{box-sizing:border-box}.bcm-popconfirm-box{position:absolute;transition:transform 0.2s ease-in-out;}.bcm-popconfirm-box .bcm-pop-box{font-family:"Inter", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;font-size:10px;line-height:calc(10px + 8px);box-shadow:0 4px 12px 2px rgba(17, 24, 38, 0.1);border-radius:4px;position:absolute;box-sizing:border-box;background-color:#FFFFFF;border:1px solid #FFFFFF;z-index:-99999;overflow:hidden;visibility:hidden;width:230px;filter:drop-shadow(0px 1px 6px rgba(0, 0, 0, 0.25));padding:8px 16px}.bcm-popconfirm-box .bcm-pop-box .bcm-pop-content{display:flex;flex-direction:row;align-items:flex-start}.bcm-popconfirm-box .bcm-pop-box .bcm-pop-content-icon{margin-right:8px;min-width:16px}.bcm-popconfirm-box .bcm-pop-box .bcm-pop-content-text{display:flex;flex-direction:row;align-items:center;text-align:left;padding-top:1px}.bcm-popconfirm-box .bcm-pop-box .bcm-pop-buttons{display:flex;justify-content:flex-end;margin-top:8px}.bcm-popconfirm-box .bcm-pop-box .bcm-pop-buttons bcm-button:first-child{margin-right:8px}.bcm-popconfirm-box::after{content:"";position:absolute;display:none;border:6px solid;z-index:10900;pointer-events:none}.bcm-popconfirm-box.bcm-pop-open{display:block;z-index:10900}.bcm-popconfirm-box.bcm-pop-open .bcm-pop-box{z-index:10900;overflow:unset;visibility:unset}.bcm-popconfirm-box.bcm-pop-open::after{display:block}.bcm-popconfirm-box.top .bcm-pop-box{bottom:100%;margin-bottom:16px}.bcm-popconfirm-box.top::after{bottom:100%;margin-bottom:4px;border-color:#FFFFFF transparent transparent transparent}.bcm-popconfirm-box.bottom .bcm-pop-box{top:100%;margin-top:16px}.bcm-popconfirm-box.bottom::after{top:100%;margin-top:4px;border-color:transparent transparent #FFFFFF transparent}.bcm-popconfirm-box.left .bcm-pop-box{right:100%;margin-right:16px}.bcm-popconfirm-box.left::after{right:100%;margin-right:4px;border-color:transparent transparent transparent #FFFFFF}.bcm-popconfirm-box.right .bcm-pop-box{left:100%;margin-left:16px}.bcm-popconfirm-box.right::after{left:100%;margin-left:4px;border-color:transparent #FFFFFF transparent transparent}.bcm-popconfirm-box.top.center .bcm-pop-box,.bcm-popconfirm-box.bottom.center .bcm-pop-box{left:50%;transform:translateX(-50%)}.bcm-popconfirm-box.top.center::after,.bcm-popconfirm-box.bottom.center::after{left:50%;transform:translateX(-50%)}.bcm-popconfirm-box.top.start .bcm-pop-box,.bcm-popconfirm-box.bottom.start .bcm-pop-box{left:0}.bcm-popconfirm-box.top.start::after,.bcm-popconfirm-box.bottom.start::after{left:16px}.bcm-popconfirm-box.top.end .bcm-pop-box,.bcm-popconfirm-box.bottom.end .bcm-pop-box{right:0}.bcm-popconfirm-box.top.end::after,.bcm-popconfirm-box.bottom.end::after{right:16px}.bcm-popconfirm-box.left.center .bcm-pop-box,.bcm-popconfirm-box.right.center .bcm-pop-box{top:50%;transform:translateY(-50%)}.bcm-popconfirm-box.left.center::after,.bcm-popconfirm-box.right.center::after{top:50%;transform:translateY(-50%)}.bcm-popconfirm-box.left.start .bcm-pop-box,.bcm-popconfirm-box.right.start .bcm-pop-box{top:0}.bcm-popconfirm-box.left.start::after,.bcm-popconfirm-box.right.start::after{top:12px}.bcm-popconfirm-box.left.end .bcm-pop-box,.bcm-popconfirm-box.right.end .bcm-pop-box{bottom:0}.bcm-popconfirm-box.left.end::after,.bcm-popconfirm-box.right.end::after{bottom:12px}.bcm-popconfirm-box.top{transform:translateY(1px)}.bcm-popconfirm-box.bottom{transform:translateY(-1px)}.bcm-popconfirm-box.left{transform:translateX(1px)}.bcm-popconfirm-box.right{transform:translateX(-1px)}.bcm-popconfirm-box.top.bcm-pop-open,.bcm-popconfirm-box.bottom.bcm-pop-open{transform:translateY(0)}.bcm-popconfirm-box.left.bcm-pop-open,.bcm-popconfirm-box.right.bcm-pop-open{transform:translateX(0)}';export{a as bcm_popconfirm_box}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{r as e,c as t,h as i,H as s,g as a}from"./p-6d7fe687.js";import{G as r,s as o,S as l,T as p}from"./p-
|
|
5
|
+
import{r as e,c as t,h as i,H as s,g as a}from"./p-6d7fe687.js";import{G as r,s as o,S as l,T as p}from"./p-17af6738.js";import{c as n}from"./p-d65a1e21.js";import{c}from"./p-3cde7f38.js";import{S as h}from"./p-8d0ca8c2.js";import"./p-4aa0e6b1.js";import"./p-6f56f8ca.js";import"./p-a429e85b.js";const{state:m}=c({value:new Map,setData:{},removeData:{}}),d=class{constructor(i){e(this,i),this.alertdismissible=t(this,"bcm-alert-dismissible",7),this.hidden=!1,this._id=r.UID(),this._title=void 0,this.description=void 0,this.status=l.info,this.type=p.basic,this.dismissible=void 0,this.icon=!1,this.bigIcon=!1,this.fullWidth=!1}componentWillRender(){if(null!=this.dismissible)if(""==this.dismissible)this.dismissible=!0;else{if(("string"!=typeof this.dismissible||"false"!=this.dismissible)&&"true"!=this.dismissible)return;this.dismissible=h.elementBooleanCheck(this.dismissible)}this.setData()}dismiss(e){this.alertdismissible.emit(e),this.el.remove()}getStateData(){return e=this._id,o((()=>m.value.get(e)),{});var e}setData(){const{status:e,type:t,bigIcon:i}=this;(e=>{const t=Object.assign(Object.assign(Object.assign({},e),{size:e.bigIcon?"medium":14,iconType:e.bigIcon?"outlined":"fill"}),r.getIconAttrWithStatusType(e.status));m.value.set(t.id,t)})({id:this._id,status:e,type:t,bigIcon:i})}render(){const{fullWidth:e,status:t,type:a,icon:r,bigIcon:o,_title:l,hidden:p,dismissible:c,description:h}=this,m=n("bcm-alert","bcm-alert__type-"+a,"bcm-alert__status-"+t,{"full-width":e,hidden:p}),d=n("bcm-alert__header-message",h?"size-3":"size-2"),x=this.getStateData();return i(s,{class:m},i("span",{hidden:!0},i("slot",null)),i("header",{class:"bcm-alert__header"},i("span",{class:d},(o||r)&&i("bcm-icon",{icon:x.icon}),l),c&&i("span",{class:"bcm-alert__header-dismiss",onClick:e=>this.dismiss(e)},"string"==typeof c?c:i("bcm-icon",{icon:"fal fa-times"}))),i("main",{class:"bcm-alert__content size-2"},h&&i("p",null,h),i("slot",null)))}get el(){return a(this)}};d.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-alert{display:block;width:100%;max-width:400px;box-sizing:border-box;padding:8px 16px;box-shadow:0px 2px 4px rgba(0, 0, 0, 0.15);border-radius:2px;position:relative;grid-gap:8px}.bcm-alert.hidden{display:none}.bcm-alert.full-width{max-width:100%}.bcm-alert__status-info{border:1px solid var(--bcm-color-blue-3);background-color:var(--bcm-color-blue-1)}.bcm-alert__status-error{border:1px solid var(--bcm-color-red-3);background-color:var(--bcm-color-red-1)}.bcm-alert__status-warning{border:1px solid var(--bcm-color-warmyellow-3);background-color:var(--bcm-color-warmyellow-1)}.bcm-alert__status-success{border:1px solid var(--bcm-color-green-3);background-color:var(--bcm-color-green-1)}.bcm-alert__type-banner{border:none}.bcm-alert__header{display:flex;align-items:center;justify-content:space-between;padding:4px 0}.bcm-alert__header-message{display:flex;align-items:center;grid-gap:8px;color:var(--bcm-color-grey-8)}.bcm-alert__header-dismiss{display:flex;position:absolute;top:-1px;right:0;padding:16px;color:var(--bcm-color-grey-8)}.bcm-alert__header-dismiss:hover{cursor:pointer;color:var(--bcm-color-grey-9)}.bcm-alert__content{color:var(--bcm-color-grey-8)}.bcm-alert__content p{margin:0;padding:0}';export{d as bcm_alert}
|