bromcom-ui 2.9.0-rc.12 → 2.9.0-rc.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bromcom-ui/bromcom-ui.css +1 -1
- package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
- package/dist/bromcom-ui/p-055a6833.entry.js +5 -0
- package/dist/bromcom-ui/{p-6b60a4d3.js → p-06d549b0.js} +1 -1
- package/dist/bromcom-ui/{p-ac385400.entry.js → p-0829f2b8.entry.js} +1 -1
- package/dist/bromcom-ui/{p-ab53fd56.entry.js → p-113960b6.entry.js} +1 -1
- package/dist/bromcom-ui/{p-f394a316.js → p-1456cfcb.js} +1 -1
- package/dist/bromcom-ui/{p-20422d81.entry.js → p-1f03b8aa.entry.js} +1 -1
- package/dist/bromcom-ui/{p-509cfa99.js → p-1f9ff376.js} +1 -1
- package/dist/bromcom-ui/{p-b9cfa2c6.entry.js → p-2e1e73a2.entry.js} +1 -1
- package/dist/bromcom-ui/{p-55931686.entry.js → p-34ee0df2.entry.js} +1 -1
- package/dist/bromcom-ui/{p-8abe303b.entry.js → p-3bd899cc.entry.js} +1 -1
- package/dist/bromcom-ui/{p-eb279a80.entry.js → p-3e7facaa.entry.js} +1 -1
- package/dist/bromcom-ui/{p-aedc59f3.entry.js → p-43ef6b1c.entry.js} +1 -1
- package/dist/bromcom-ui/{p-3c2db0c1.entry.js → p-4d34a30c.entry.js} +1 -1
- package/dist/bromcom-ui/{p-02fc6c76.entry.js → p-4d6407a3.entry.js} +1 -1
- package/dist/bromcom-ui/{p-eefcd035.entry.js → p-578c6af9.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a31e475a.entry.js → p-58012cb7.entry.js} +1 -1
- package/dist/bromcom-ui/{p-bcef2201.entry.js → p-6430d123.entry.js} +1 -1
- package/dist/bromcom-ui/{p-4772e438.entry.js → p-6802f81b.entry.js} +1 -1
- package/dist/bromcom-ui/{p-13070661.entry.js → p-6937c867.entry.js} +1 -1
- package/dist/bromcom-ui/{p-94a9bd14.entry.js → p-695a9db8.entry.js} +1 -1
- package/dist/bromcom-ui/{p-9d911ba3.entry.js → p-70126b4c.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d61af652.entry.js → p-7508498f.entry.js} +1 -1
- package/dist/bromcom-ui/{p-8507df31.js → p-7665baa1.js} +1 -1
- package/dist/bromcom-ui/{p-965703ec.entry.js → p-79c91f16.entry.js} +1 -1
- package/dist/bromcom-ui/{p-f4634124.entry.js → p-7a54258a.entry.js} +1 -1
- package/dist/bromcom-ui/p-7c511f8d.entry.js +5 -0
- package/dist/bromcom-ui/{p-98afbb62.entry.js → p-7ee5abfd.entry.js} +1 -1
- package/dist/bromcom-ui/{p-0bc35a82.entry.js → p-80785946.entry.js} +1 -1
- package/dist/bromcom-ui/p-83571dfd.js +5 -0
- package/dist/bromcom-ui/{p-23a805b2.entry.js → p-83f55410.entry.js} +1 -1
- package/dist/bromcom-ui/{p-0d0fc47b.entry.js → p-8b8400e5.entry.js} +1 -1
- package/dist/bromcom-ui/p-92726393.entry.js +5 -0
- package/dist/bromcom-ui/{p-a799b910.entry.js → p-92fa8670.entry.js} +1 -1
- package/dist/bromcom-ui/p-97d84d54.entry.js +5 -0
- package/dist/bromcom-ui/{p-fa9e6264.entry.js → p-98ff534a.entry.js} +1 -1
- package/dist/bromcom-ui/{p-ab7bd6e1.js → p-9bfb2dcc.js} +1 -1
- package/dist/bromcom-ui/{p-6abc4fdf.entry.js → p-a14e70a5.entry.js} +1 -1
- package/dist/bromcom-ui/{p-78e70a44.entry.js → p-a9654609.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a7a5da82.entry.js → p-aacfa5bb.entry.js} +1 -1
- package/dist/bromcom-ui/{p-f533a1b5.entry.js → p-ae0bd7c0.entry.js} +1 -1
- package/dist/bromcom-ui/{p-c9212343.entry.js → p-b0583ca8.entry.js} +1 -1
- package/dist/bromcom-ui/{p-70994ba0.entry.js → p-b0fb9ee3.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d57f3587.entry.js → p-b9945590.entry.js} +1 -1
- package/dist/bromcom-ui/{p-c0a62a71.entry.js → p-bb624967.entry.js} +1 -1
- package/dist/bromcom-ui/{p-5f11b62c.entry.js → p-bc8e5ac3.entry.js} +1 -1
- package/dist/bromcom-ui/{p-faad6962.entry.js → p-cd8880a4.entry.js} +1 -1
- package/dist/bromcom-ui/{p-9a21398e.entry.js → p-d06ebea4.entry.js} +1 -1
- package/dist/bromcom-ui/{p-29722bff.entry.js → p-d09aa96b.entry.js} +1 -1
- package/dist/bromcom-ui/{p-1ad5b7dd.entry.js → p-d1f32bbd.entry.js} +1 -1
- package/dist/bromcom-ui/{p-3a83e2ed.entry.js → p-d9f92297.entry.js} +1 -1
- package/dist/bromcom-ui/{p-fb36ab9c.entry.js → p-da7a34c6.entry.js} +1 -1
- package/dist/bromcom-ui/{p-1fc491fc.entry.js → p-dd714afe.entry.js} +1 -1
- package/dist/bromcom-ui/{p-44407faa.js → p-e2f92d0b.js} +1 -1
- package/dist/bromcom-ui/{p-a89cff9b.js → p-e59b12e2.js} +1 -1
- package/dist/bromcom-ui/p-e6938871.js +5 -0
- package/dist/bromcom-ui/{p-6c878da5.entry.js → p-ed46db87.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e6f888b3.entry.js → p-eebbf79a.entry.js} +1 -1
- package/dist/bromcom-ui/{p-5c27d09b.entry.js → p-eec6999c.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a81644d6.entry.js → p-f6a4bf6e.entry.js} +1 -1
- package/dist/bromcom-ui/{p-26da70f2.entry.js → p-f84247f5.entry.js} +1 -1
- package/dist/bromcom-ui/{p-cb3bc0f4.entry.js → p-f93356af.entry.js} +1 -1
- package/dist/cjs/bcm-accordion.cjs.entry.js +2 -2
- package/dist/cjs/bcm-alert.cjs.entry.js +2 -2
- package/dist/cjs/bcm-attendance.cjs.entry.js +2 -2
- package/dist/cjs/bcm-avatar_2.cjs.entry.js +4 -4
- package/dist/cjs/bcm-breadcrumb.cjs.entry.js +2 -2
- package/dist/cjs/bcm-button-group.cjs.entry.js +2 -2
- package/dist/cjs/bcm-button_9.cjs.entry.js +6 -6
- package/dist/cjs/bcm-card.cjs.entry.js +2 -2
- package/dist/cjs/bcm-checkbox-group.cjs.entry.js +2 -2
- package/dist/cjs/bcm-checkbox-lite_9.cjs.entry.js +2 -2
- package/dist/cjs/bcm-checkbox_2.cjs.entry.js +2 -2
- package/dist/cjs/bcm-chip-group.cjs.entry.js +4 -4
- package/dist/cjs/bcm-chip.cjs.entry.js +2 -2
- package/dist/cjs/bcm-collapse.cjs.entry.js +2 -2
- package/dist/cjs/bcm-color-input.cjs.entry.js +4 -4
- package/dist/cjs/bcm-date-picker.cjs.entry.js +2 -2
- package/dist/cjs/bcm-date.cjs.entry.js +4 -4
- package/dist/cjs/bcm-datetime-picker.cjs.entry.js +2 -2
- package/dist/cjs/bcm-default.cjs.entry.js +2 -2
- package/dist/cjs/bcm-drawer.cjs.entry.js +4 -4
- package/dist/cjs/bcm-dropdown.cjs.entry.js +3 -3
- package/dist/cjs/bcm-expansion-panel.cjs.entry.js +2 -2
- package/dist/cjs/bcm-form-2.cjs.entry.js +2 -2
- package/dist/cjs/bcm-input-custom.cjs.entry.js +2 -2
- package/dist/cjs/bcm-item.cjs.entry.js +2 -2
- package/dist/cjs/bcm-items.cjs.entry.js +2 -2
- package/dist/cjs/bcm-list_3.cjs.entry.js +6 -6
- package/dist/cjs/bcm-menu.cjs.entry.js +5 -5
- package/dist/cjs/bcm-modal-2-footer.cjs.entry.js +4 -4
- package/dist/cjs/bcm-modal-2-header.cjs.entry.js +4 -4
- package/dist/cjs/bcm-modal-2.cjs.entry.js +4 -4
- package/dist/cjs/bcm-modal.cjs.entry.js +2 -2
- package/dist/cjs/bcm-popconfirm-box.cjs.entry.js +2 -2
- package/dist/cjs/bcm-popconfirm.cjs.entry.js +2 -2
- package/dist/cjs/bcm-popover.cjs.entry.js +4 -4
- package/dist/cjs/bcm-progress.cjs.entry.js +2 -2
- package/dist/cjs/bcm-radio-group.cjs.entry.js +4 -4
- package/dist/cjs/bcm-radio.cjs.entry.js +4 -4
- package/dist/cjs/bcm-range.cjs.entry.js +2 -2
- package/dist/cjs/bcm-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/bcm-step.cjs.entry.js +3 -3
- package/dist/cjs/bcm-stepper.cjs.entry.js +5 -5
- package/dist/cjs/bcm-switch.cjs.entry.js +2 -2
- package/dist/cjs/bcm-tab-group.cjs.entry.js +4 -4
- package/dist/cjs/bcm-tab-item-header.cjs.entry.js +4 -4
- package/dist/cjs/bcm-tab-item.cjs.entry.js +4 -4
- package/dist/cjs/bcm-table.cjs.entry.js +4 -4
- package/dist/cjs/bcm-tag.cjs.entry.js +3 -3
- package/dist/cjs/bcm-time-picker.cjs.entry.js +2 -2
- package/dist/cjs/bcm-toast.cjs.entry.js +26 -12
- package/dist/cjs/bromcom-ui.cjs.js +2 -2
- package/dist/cjs/{generate-4911eaae.js → generate-d1447176.js} +1 -1
- package/dist/cjs/{global-efef2bd1.js → global-cb2f8825.js} +1 -1
- package/dist/cjs/{input-template-11d547bd.js → input-template-096e89a6.js} +1 -1
- package/dist/cjs/{json-parse-decarator-fdcd20df.js → json-parse-decarator-5b03f2c1.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{number-helper-72d5f146.js → number-helper-963bdfd3.js} +1 -1
- package/dist/cjs/old-bcm-popover-box.cjs.entry.js +3 -3
- package/dist/cjs/old-bcm-popover.cjs.entry.js +2 -2
- package/dist/cjs/{package-70273fae.js → package-8e8fd90e.js} +1 -1
- package/dist/cjs/{stepper-states-56e660a4.js → stepper-states-35ea924b.js} +1 -1
- package/dist/cjs/{tooltip-helper-3b8b977f.js → tooltip-helper-e51cfadd.js} +3 -3
- package/dist/cjs/{validators-c43fa1d0.js → validators-b3ac8a39.js} +1 -1
- package/dist/collection/components/other/toast/toast.js +25 -11
- package/dist/components/bcm-toast.js +24 -10
- package/dist/components/generate.js +1 -1
- package/dist/esm/bcm-accordion.entry.js +2 -2
- package/dist/esm/bcm-alert.entry.js +2 -2
- package/dist/esm/bcm-attendance.entry.js +2 -2
- package/dist/esm/bcm-avatar_2.entry.js +4 -4
- package/dist/esm/bcm-breadcrumb.entry.js +2 -2
- package/dist/esm/bcm-button-group.entry.js +2 -2
- package/dist/esm/bcm-button_9.entry.js +6 -6
- package/dist/esm/bcm-card.entry.js +2 -2
- package/dist/esm/bcm-checkbox-group.entry.js +2 -2
- package/dist/esm/bcm-checkbox-lite_9.entry.js +2 -2
- package/dist/esm/bcm-checkbox_2.entry.js +2 -2
- package/dist/esm/bcm-chip-group.entry.js +4 -4
- package/dist/esm/bcm-chip.entry.js +2 -2
- package/dist/esm/bcm-collapse.entry.js +2 -2
- package/dist/esm/bcm-color-input.entry.js +4 -4
- package/dist/esm/bcm-date-picker.entry.js +2 -2
- package/dist/esm/bcm-date.entry.js +4 -4
- package/dist/esm/bcm-datetime-picker.entry.js +2 -2
- package/dist/esm/bcm-default.entry.js +2 -2
- package/dist/esm/bcm-drawer.entry.js +4 -4
- package/dist/esm/bcm-dropdown.entry.js +3 -3
- package/dist/esm/bcm-expansion-panel.entry.js +2 -2
- package/dist/esm/bcm-form-2.entry.js +2 -2
- package/dist/esm/bcm-input-custom.entry.js +2 -2
- package/dist/esm/bcm-item.entry.js +2 -2
- package/dist/esm/bcm-items.entry.js +2 -2
- package/dist/esm/bcm-list_3.entry.js +6 -6
- package/dist/esm/bcm-menu.entry.js +5 -5
- package/dist/esm/bcm-modal-2-footer.entry.js +4 -4
- package/dist/esm/bcm-modal-2-header.entry.js +4 -4
- package/dist/esm/bcm-modal-2.entry.js +4 -4
- package/dist/esm/bcm-modal.entry.js +2 -2
- package/dist/esm/bcm-popconfirm-box.entry.js +2 -2
- package/dist/esm/bcm-popconfirm.entry.js +2 -2
- package/dist/esm/bcm-popover.entry.js +4 -4
- package/dist/esm/bcm-progress.entry.js +2 -2
- package/dist/esm/bcm-radio-group.entry.js +4 -4
- package/dist/esm/bcm-radio.entry.js +4 -4
- package/dist/esm/bcm-range.entry.js +2 -2
- package/dist/esm/bcm-skeleton.entry.js +2 -2
- package/dist/esm/bcm-step.entry.js +3 -3
- package/dist/esm/bcm-stepper.entry.js +5 -5
- package/dist/esm/bcm-switch.entry.js +2 -2
- package/dist/esm/bcm-tab-group.entry.js +4 -4
- package/dist/esm/bcm-tab-item-header.entry.js +4 -4
- package/dist/esm/bcm-tab-item.entry.js +4 -4
- package/dist/esm/bcm-table.entry.js +4 -4
- package/dist/esm/bcm-tag.entry.js +3 -3
- package/dist/esm/bcm-time-picker.entry.js +2 -2
- package/dist/esm/bcm-toast.entry.js +26 -12
- package/dist/esm/bromcom-ui.js +2 -2
- package/dist/esm/{generate-c890c880.js → generate-8591a0f0.js} +1 -1
- package/dist/esm/{global-80f07324.js → global-e7818ee3.js} +1 -1
- package/dist/esm/{input-template-7f96e7e6.js → input-template-6519906b.js} +1 -1
- package/dist/esm/{json-parse-decarator-2c6f525f.js → json-parse-decarator-58846417.js} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/{number-helper-1ae23de5.js → number-helper-6ef9165b.js} +1 -1
- package/dist/esm/old-bcm-popover-box.entry.js +3 -3
- package/dist/esm/old-bcm-popover.entry.js +2 -2
- package/dist/esm/{package-22f4a05f.js → package-569c91f0.js} +1 -1
- package/dist/esm/{stepper-states-46d8bf00.js → stepper-states-14adccae.js} +1 -1
- package/dist/esm/{tooltip-helper-a72d4674.js → tooltip-helper-3c146a26.js} +3 -3
- package/dist/esm/{validators-0601fa22.js → validators-358cf956.js} +1 -1
- package/dist/types/components/other/toast/toast.d.ts +1 -0
- package/package.json +1 -1
- package/dist/bromcom-ui/p-203c8e37.entry.js +0 -5
- package/dist/bromcom-ui/p-3d983699.entry.js +0 -5
- package/dist/bromcom-ui/p-416f6233.entry.js +0 -5
- package/dist/bromcom-ui/p-64096fe2.js +0 -5
- package/dist/bromcom-ui/p-7e10f626.entry.js +0 -5
- package/dist/bromcom-ui/p-e7cbc79a.js +0 -5
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built with Stencil
|
|
3
|
+
* Copyright (c) Bromcom.
|
|
4
|
+
*/
|
|
5
|
+
import{r as t,c as i,h as s,H as e,g as o}from"./p-170cf07d.js";import"./p-4798d827.js";import"./p-626a65e9.js";import{G as a}from"./p-83571dfd.js";import"./p-e6938871.js";import"./p-91246af3.js";import"./p-06d549b0.js";import"./p-5ae0a59b.js";import{d as r}from"./p-3c7a0345.js";import{a as l}from"./p-23c35e1b.js";import{C as h}from"./p-e1877ee9.js";import{c as d}from"./p-bed627ab.js";import"./p-3fac58f7.js";import"./p-2e73d572.js";import{I as c}from"./p-3ade1099.js";import"./p-436364c8.js";import"./p-034bbcdd.js";import"./p-e45c1546.js";import"./p-e59b12e2.js";const p=class{constructor(s){t(this,s),this.change=i(this,"bcm-change",7),this._id=a.UID(),this.label=void 0,this.name=void 0,this.value=null,this.defaultValue=void 0,this.size=l.Size.medium,this.disabled=void 0,this.hidden=!1,this.required=!1,this.gap=void 0,this.direction=l.Direction.horizontal,this.fullWidth=!1,this.items=[],this.caption=void 0,this.noCaption=!1,this.captionError=void 0,this.captionType=l.Status.default,this.captionCache=void 0,this.captionTypeCache=void 0}get radios(){return Array.from(this.el.querySelectorAll("bcm-radio"))}get Items(){return this.items}connectedCallback(){this.captionCache=this.caption,this.captionTypeCache=this.captionType}updateValue(){var t,i,s;this.value=null!==(s=null===(i=null===(t=this.radios)||void 0===t?void 0:t.find((t=>t.checked)))||void 0===i?void 0:i.value)&&void 0!==s?s:null}setRadioUpdate(){var t;null===(t=this.radios)||void 0===t||t.forEach((t=>{t.disabled=this.disabled||t.disabled,t.size=this.size,this.defaultValue&&(t.checked=t.value==this.defaultValue)}))}watchDisabled(t,i){var s;null===(s=this.radios)||void 0===s||s.forEach((i=>i.disabled=t))}watchDefaultValue(t,i){var s;null===(s=this.radios)||void 0===s||s.forEach((i=>i.checked=i.value==t)),this.updateValue(),this.change.emit(this.value)}componentWillLoad(){this.setRadioUpdate(),this.updateValue()}handleChange(t){var i,s;t.stopPropagation(),t.preventDefault();const e=null!==(i=t.target.checked)&&void 0!==i&&i;null===(s=this.radios)||void 0===s||s.forEach((i=>{i.checked=i.id==t.target.id&&!e})),this.updateValue(),this.change.emit(this.value)}async setClear(){var t;this.value=null,null===(t=this.radios)||void 0===t||t.forEach((t=>{t.checked=!1}))}async resetCaption(){return await r(10),this.caption=this.captionCache,this.captionType=this.captionTypeCache,this.captionError=null,await r(10),Promise.resolve()}async check(t,i=!0){var s;null===(s=this.radios)||void 0===s||s.forEach((s=>{s.checked=(s.id==t||s.value==t)&&i})),this.updateValue(),this.change.emit(this.value)}async get(){return this.value}async set(t){await this.check(t)}async getValue(){return this.value}render(){var t,i;const{direction:o,fullWidth:a,gap:r,label:c,size:p,required:n,disabled:u,caption:v,captionError:m,captionType:f,noCaption:b}=this;return s(e,{role:"radio-group",class:"tw-mb-2 tw-flex tw-flex-col"},c&&s("bcm-label",{type:f,value:c,required:n}),s("div",{class:d("tw-flex tw-flex-wrap",o==l.Direction.horizontal?"tw-flex-row":"tw-flex-col",a&&"tw-w-full"),style:{gap:r}},s("slot",null),(null===(t=this.Items)||void 0===t?void 0:t.length)>0&&(null===(i=this.Items)||void 0===i?void 0:i.map((t=>s("bcm-radio",{id:t.id,value:t.value,disabled:u||t.disabled,checked:t.checked,color:t.color,size:p},t.label))))),s(h,{noCaption:b,captionType:f,captionError:m,caption:v}))}get el(){return o(this)}static get watchers(){return{disabled:["watchDisabled"],defaultValue:["watchDefaultValue"]}}};!function(t,i,s,e){var o,a=arguments.length,r=a<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,s):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,i,s,e);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(r=(a<3?o(r):a>3?o(i,s,r):o(i,s))||r);a>3&&r&&Object.defineProperty(i,s,r)}([c()],p.prototype,"el",void 0);export{p as bcm_radio_group}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{r as t,c as e,f as i,h as s,H as a,g as n}from"./p-170cf07d.js";import{D as r,E as h}from"./p-5ae0a59b.js";import{c as o}from"./p-bed627ab.js";import{D as c}from"./p-626a65e9.js";import{d as l}from"./p-3c7a0345.js";import{G as d}from"./p-e7cbc79a.js";import{B as p}from"./p-23c35e1b.js";import{g as m,s as u}from"./p-43a16ce4.js";import{L as b}from"./p-49f37d54.js";import{I as g}from"./p-3ade1099.js";import"./p-e45c1546.js";import"./p-a89cff9b.js";import"./p-034bbcdd.js";import"./p-91246af3.js";import"./p-d3d07c8c.js";var x,f,y;!function(t){t.january="january",t.february="february",t.march="march",t.april="april",t.may="may",t.june="june",t.july="july",t.august="august",t.september="september",t.october="october",t.november="november",t.december="december"}(x||(x={})),function(t){t.sunday="sunday",t.monday="monday",t.tuesday="tuesday",t.wednesday="wednesday",t.thursday="thursday",t.friday="friday",t.saturday="saturday"}(f||(f={})),function(t){t.datetime="datetime",t.range="range",t.date="date",t.time="time"}(y||(y={}));const v=JSON.stringify,w=class{constructor(i){t(this,i),this.load=e(this,"bcm-load",7),this.change=e(this,"bcm-change",7),this.bcmOpen=e(this,"bcm-open",7),this.inputId=null,this.emptyState=!1,this.initialized=!1,this.disabledDatesList={min:null,max:null,dates:[]},this.dayNumbers=[],this.valueText=null,this.dataIsValid=!1,this._id=d.UID(),this.date=new Date,this.endDate=null,this.type=y.datetime,this.disabled=!1,this.disabledDates="",this.value=null,this._open=!1,this.hidden=!1,this.name=void 0,this.fullWidth=!1,this.required=!1,this.label=void 0,this.placeholder=void 0,this.minYear=1900,this.maxYear=2200,this.noCaption=!1,this.noMargin=!1,this.captionError=void 0,this.caption="",this.captionType="default",this.alignment=void 0,this.placement=p.Placement["bottom-start"],this.linkedComponent=void 0,this.clearable=!1,this.years=[],this.hours=[],this.minutes=[],this.hasDateModule=!1,this.hasTimeModule=!1,this.renderDate=void 0,this.selectedDate=void 0,this.selectedEndDate=void 0,this.error=!1,this.errorText="",this.tick={}}markForCheck(){this.tick=d.UID()}openChanged(){this.bcmOpen.emit(this._open)}componentWillLoad(){if(this.inputId="picker-input-"+this._id,this.hasDateModule=this.type===y.datetime||this.type===y.date||this.type===y.range,this.hasTimeModule=this.type===y.datetime||this.type===y.time,this.prepareDisabledDates(),this.setData(),!this.initialized){for(let t=this.minYear;t<=this.maxYear;t++)this.years.push(t);for(let t=0;t<=23;t++)this.hours.push(t);for(let t=0;t<=59;t++)this.minutes.push(t);this.load.emit()}this.initialized=!0}componentDidRender(){this.hasDateModule&&!this.yearsDragger&&(this.createDragSelection("years",this.yearsElement,this.yearsWrapperElement,this.yearsStripElement,r.y),this.createWheelChange("years",this.yearsWrapperElement,this.yearsStripElement),this.setDragSelection("years",this.currentDate.year)),this.hasTimeModule&&!this.hoursDragger&&(this.createDragSelection("hours",this.hoursElement,this.hoursWrapperElement,this.timeStripElement,r.y),this.createWheelChange("hours",this.hoursWrapperElement,this.timeStripElement),this.setDragSelection("hours",this.currentDate.hour)),this.hasTimeModule&&!this.minutesDragger&&(this.createDragSelection("minutes",this.minutesElement,this.minutesWrapperElement,this.timeStripElement,r.y),this.createWheelChange("minutes",this.minutesWrapperElement,this.timeStripElement),this.setDragSelection("minutes",this.currentDate.minute))}renderDateChange(){this.initialized&&(this.setData(),this.hasDateModule&&this.setDragSelection("years",this.currentDate.year))}openChange(t){t&&(this.calculateLocation(),this.hasDateModule&&(this.createDragSelection("years",this.yearsElement,this.yearsWrapperElement,this.yearsStripElement,r.y),this.createWheelChange("years",this.yearsWrapperElement,this.yearsStripElement),this.setDragSelection("years",this.currentDate.year)),this.hasTimeModule&&(this.createDragSelection("hours",this.hoursElement,this.hoursWrapperElement,this.timeStripElement,r.y),this.createWheelChange("hours",this.hoursWrapperElement,this.timeStripElement),this.setDragSelection("hours",this.currentDate.hour,!0)),this.hasTimeModule&&(this.createDragSelection("minutes",this.minutesElement,this.minutesWrapperElement,this.timeStripElement,r.y),this.createWheelChange("minutes",this.minutesWrapperElement,this.timeStripElement),this.setDragSelection("minutes",this.currentDate.minute,!0)),this.markForCheck(),i(this.el))}valueChange(t,e){const i={isValid:!1,value:this.valueText};if(t)if(this.type!==y.range&&this.error)this.change.emit({isValid:!1,value:this.inputElement.value});else try{if((e&&v(t.dateObject)!==v(e.dateObject)||!e&&t)&&(this.type!==y.date&&this.type!==y.datetime||this.change.emit(t),this.type===y.time&&this.change.emit(t),this.type===y.range)){const e=t.dateObject;e.start.date&&e.end.date?t.isValid&&this.change.emit({isValid:t.isValid,value:t.value,start:e.start,end:e.end}):this.change.emit(i)}}catch(t){}else this.change.emit()}disabledDatesChange(t){t&&this.prepareDisabledDates()}stringToDate(t){return t.getMonth?t:new Date(Date.parse(this.switchDDMM(t)))}dateToString(t){if(!(t instanceof Date))return!1}switchDDMM(t){if(!t)return;const e=t.split("/");return-1===t.indexOf("/")||3!==e.length?t:`${e[1]}/${e[0]}/${e[2]}`}setData(){this.date=this.stringToDate(this.date),this.initialized||this.renderDate||(this.renderDate=this.date&&this.date||new Date),!this.initialized&&this.endDate&&(this.selectedEndDate=this.stringToDate(this.endDate));const t=this.renderDate;if(this.currentDate=this.createDateObject(t),this.dayNumbers=this.getMonthDayNumbers(t).map((e=>({day:e,thisMonth:!0,isWeekend:this.getDayIsWeekend(t,e),today:this.getIsCurrentDate(t,e),date:this.getTargetDayDate(t,e)}))),this.currentDate.year>this.minYear){let e=new Date(new Date(t).setMonth(this.currentDate.month-1,1)),i=this.getMonthDayNumbers(e).reverse(),s=this.currentDate.monthFirstDay;for(let t=1;t<(0===s?7:s);t++){const s=i[t-1];this.dayNumbers.unshift({day:s,prevMonth:!0,isWeekend:this.getDayIsWeekend(e,s),date:this.getTargetDayDate(e,s)})}}if(this.currentDate.year<this.maxYear){let e=new Date(new Date(t).setMonth(this.currentDate.month+1)),i=this.getMonthDayNumbers(e),s=42-this.dayNumbers.length;for(let t=0;t<s;t++){const s=i[t];this.dayNumbers.push({day:s,nextMonth:!0,isWeekend:this.getDayIsWeekend(e,s),date:this.getTargetDayDate(e,s)})}}this.emptyState||(this.valueText=this.getValueText()),i(this.el)}prepareDisabledDates(){if(!this.disabledDates)return;let t=null;if("string"==typeof this.disabledDates)try{t=JSON.parse(this.disabledDates)}catch(t){return}else t=this.disabledDates;if(t.dates&&t.dates.length&&t.dates.length){const e=t.dates.map((t=>{const e=new Date(t);return"invalid date"===e.toString().toLowerCase()?null:e})).filter((t=>t));this.disabledDatesList.dates=e}if(t.min&&t.max&&(t.min.getTime()>t.max.getTime()||t.max.getTime()<t.min.getTime()))return;t.min&&t.min instanceof Date?this.disabledDatesList.min=new Date(t.min.toDateString()):delete this.disabledDatesList.min,t.max&&t.max instanceof Date?this.disabledDatesList.max=new Date(t.max.toDateString()):delete this.disabledDatesList.max;const e=this.inputElement&&this.inputElement.value;e&&this.setDataFromText(e)}createWheelChange(t,e,i){e.addEventListener("wheel",(e=>{const s=e.deltaY>0,a=this[t+"Dragger"].getOffset().top,n=this.getTargetChildByDragPosition({y:a},i);let r=s?n+1:n-1;r<0?r=0:void 0===this[t][r]&&(r=this[t].length-1),"time"!=this.type||this.selectedDate||this.setTime(),this.setDragSelection(t,this[t][r],!0,!0)}))}createDragSelection(t,e,i,s,a){const n=t+"Dragger";this[n]=new h({target:e,trigger:i,direction:a,useTransform:!0,limit:{y:{max:s.offsetTop-s.offsetHeight/2,min:-1*(e.offsetHeight-(s.offsetTop+s.offsetHeight/2))}}}),this[n].on("end",(e=>{const i=this.getTargetChildByDragPosition(e,s);this.selectTargetChildByDragIdx(i,s,this[n]),this.setDragSelection(t,this[t][i],!1)}))}getTargetChildByDragPosition({y:t},e){const i=e.offsetHeight,s=i/2;return Math.floor(-(t-(e.offsetTop-s)-s)/i)}selectTargetChildByDragIdx(t,e,i,s=!0){i.setPosition({y:e.offsetHeight/2+e.offsetTop-(t+1)*e.offsetHeight,anim:s})}setDragSelection(t,e,i=!0,s=!1){const a=this[t].findIndex((t=>t===e));switch(i&&this.selectTargetChildByDragIdx(a,this["years"===t?t+"StripElement":"timeStripElement"],this[t+"Dragger"],s),t){case"years":this.date.setFullYear(e);break;case"hours":this.date.setHours(e);break;case"minutes":this.date.setMinutes(e)}this.renderDate=this.date,this.setData(),this.selectedDate&&this.setValue()}getHours12(){const t=(this.date.getHours()+24)%12||12;return t>12?t-12:t}createDateObject(t,{excludeTime:e=!1,exactMonthNumber:i=!1}={}){const s=t.getFullYear();return Object.assign(Object.assign({year:s>=this.maxYear?this.maxYear:s<=this.minYear?this.minYear:s,day:t.getDate(),month:t.getMonth()+(i?1:0),dayOfWeek:t.getDay(),monthFirstDay:new Date(new Date(t).setDate(1)).getDay()},!e&&{hour:t.getHours()}),!e&&{minute:t.getMinutes()})}generateDaysArrayFromMax(t){return Array.from(Array(t+1).keys()).slice(1)}getMonthDayNumbers(t){const e=this.getDaysInMonth(t.getMonth(),t.getFullYear());return this.generateDaysArrayFromMax(e)}getTargetDayDate(t,e){return new Date(new Date(t).setDate(e))}getDayIsWeekend(t,e){const i=new Date(new Date(t).setDate(e)).getDay();return 6===i||0===i}getClock(t){return{hours:(t=t||new Date).getHours(),minutes:t.getMinutes(),seconds:t.getSeconds(),milis:t.getMilliseconds()}}setValue(t){var e,i,s;const a=new Date(this.date.setHours(Number(this.currentDate.hour),Number(this.currentDate.minute)));if(t)this.value=null;else{if(this.dataIsValid=!0,this.type===y.datetime){const t=Object.assign({},this.currentDate);t.month+=1,(null===(e=this.value)||void 0===e?void 0:e.value)!=this.valueText&&(this.value={isValid:this.dataIsValid,date:a,timestamp:a.getTime(),dateObject:t,value:this.valueText})}if(this.type===y.date){const t=Object.assign({},this.currentDate);delete t.hour,delete t.minute,t.month+=1,(null===(i=this.value)||void 0===i?void 0:i.value)!=this.valueText&&(this.value={isValid:this.dataIsValid,date:a,timestamp:a.getTime(),dateObject:t,value:this.valueText})}if(this.type===y.time){const t=this.getTimeText(),e=Object.assign({},this.currentDate);e.month+=1,this.value={isValid:this.dataIsValid,date:a,timestamp:a.getTime(),time:t,dateObject:e,timeObject:{hours:this.currentDate.hour,minutes:this.currentDate.minute},value:t},this.inputElement.value=t}this.type===y.range&&(null===(s=this.value)||void 0===s?void 0:s.value)!=this.valueText&&(this.value={isValid:this.dataIsValid,dateObject:{start:Object.assign({},this.selectedDate&&{date:this.selectedDate,timestamp:this.selectedDate.getTime(),detail:this.createDateObject(this.selectedDate,{excludeTime:!0,exactMonthNumber:!0})}),end:Object.assign({},this.selectedEndDate&&{date:this.selectedEndDate,timestamp:this.selectedEndDate.getTime(),detail:this.createDateObject(this.selectedEndDate,{excludeTime:!0,exactMonthNumber:!0})})},value:this.valueText})}}setMonth(t){this.renderDate.setDate(1),this.renderDate=new Date(this.renderDate.setMonth(t)),this.setDragSelection("years",this.currentDate.year)}checkRangeValidation({popupClosing:t=!1}={}){return this.type!==y.range||(t&&(!this.selectedDate||this.selectedDate&&!this.selectedEndDate)?(this.setError(!0,"date range invalid"),!1):(t||this.setError(!1),!0))}pad(t,e){return t<e?"0":""}isInputClearable(){return!(!this.inputElement||!this.inputElement.value)}isDisabledDate(t){if(this.disabledDatesList.dates.map((e=>this.isSameDate(e,t))).filter((t=>t)).length)return!0;if(this.disabledDatesList.min){const e=new Date(this.disabledDatesList.min);if(e&&e.getTime()>t.getTime())return!0}if(this.disabledDatesList.max){const e=new Date(this.disabledDatesList.max);if(e&&new Date(e.setDate(e.getDate()+1)).getTime()<t.getTime())return!0}}setDate(t,e,i=!1){const s=this.type===y.range,a=!!this.selectedEndDate;if((this.type!==y.date&&this.type!==y.datetime||!this.isDisabledDate(t))&&(this.emptyState=!1,(!s||s&&!a)&&(this.date=new Date(t.setHours(this.currentDate.hour,this.currentDate.minute))),s&&this.checkRangeValidation(),s&&this.selectedDate&&this.selectedEndDate&&(this.selectedDate=null,this.selectedEndDate=null),e)){const e=new Date(t);s&&this.selectedDate?this.selectedDate.getTime()>e.getTime()?(this.selectedEndDate=this.selectedDate)&&(this.selectedDate=e):this.selectedEndDate=e:this.selectedDate=e,!s&&(this._open=i),this.renderDate=this.date,this.valueText=this.getValueText(),this.setValue();const a=this.valueText.split("/"),n=this.valueText?this.changeFormat(new Date(a[1]+"/"+a[0]+"/"+a[2])):"";this.inputElement.value=n}}setDataFromText(t,e=!1,i=!0){let s=!1,a="";const n=this.parse(t);if(this.type!==y.date&&this.type!==y.datetime||!this.isDisabledDate(n.date)||(n.dateIsValid=!1,a="disabled-date"),this.type===y.datetime&&n.dateIsValid&&n.timeIsValid&&(e&&this.setDate(n.date,!0,i),e&&this.setTime(n.timeSections[0],n.timeSections[1]),s=!0),this.type===y.date&&n.dateIsValid&&(e&&this.setDate(n.date,!0,i),s=!0),this.type===y.time&&n.timeIsValid&&(e&&this.setTime(n.timeSections[0],n.timeSections[1]),s=!0),this.type===y.range&&(n.dateIsValid&&!this.selectedDate&&(e&&this.setDate(n.date,!0,i),s=!0),n.date2IsValid&&!this.selectedEndDate&&(e&&this.setDate(n.date2,!0,i),s=!0),this.selectedDate&&this.selectedEndDate&&n.rangeIsValid&&(this.isSameDate(n.date2,this.selectedEndDate)&&!this.isSameDate(n.date,this.selectedDate)&&(this.selectedDate=null,e&&this.setDate(n.date,!0,i),s=!0),this.isSameDate(n.date,this.selectedDate)&&!this.isSameDate(n.date2,this.selectedEndDate)&&(this.selectedEndDate=null,e&&this.setDate(n.date2,!0,i),s=!0)),this.selectedDate&&this.selectedEndDate&&!n.rangeIsValid&&e&&(this.selectedDate=null,this.selectedEndDate=null)),s)e&&(this.renderDate=this.date),this.setError(!1);else{this.type===y.range&&this.selectedDate&&this.selectedEndDate&&n.rangeIsValid?this.setError(!1):a?this.setError(!0,"disabled-date"===a&&"selected date is not allowed"):(t&&this.setError(!0,(this.type===y.datetime?"invalid date or time":this.type===y.range&&"invalid date range")||this.type===y.date&&"The selected date is not allowed."||this.type===y.time&&"invalid time"),this.setValue(!0));const e=t.split("/"),i=t&&!this.error?this.changeFormat(new Date(e[1]+"/"+e[0]+"/"+e[2])):"";this.inputElement.value=i}}setDateToday(){const t=new Date;this.type===y.range&&(this.selectedDate=null,this.selectedEndDate=null),this.setDate(t,!0,!1)}HourContentDblClick(t){const e=d.findEventPathWithNodeName(t,"SPAN");e&&e.classList.contains("selected")&&(this.setValue(),this._open=!1)}setTime(t,e){this.renderDate=new Date(this.date.setHours(Number(t||this.getClock().hours),Number(e||this.getClock().minutes))),this.type===y.time&&(this.selectedDate=this.date);const i=this.currentDate.hour||(new Date).getHours(),s=this.currentDate.minute||(new Date).getMinutes();this.setDragSelection("hours",i,!0,!0),this.setDragSelection("minutes",s,!0,!0)}setError(t=!1,e=""){this.error=t,this.errorText=t?e:""}getError(){const{error:t,errorText:e}=this;return{valid:!t,error:t,errorText:e}}getDaysInMonth(t,e){return new Date(e,t+1,0).getDate()}getIsCurrentDate(t,e){const i=new Date;return i.getDate()===e&&i.getMonth()===t.getMonth()&&i.getFullYear()===t.getFullYear()}isSameDate(t,e){return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}getSelected(t,e=!1){const i=new Date(this["selected"+(e?"EndDate":"Date")]),s=i.getFullYear(),a=i.getMonth(),n=i.getDate();return t.getDate()===n&&t.getMonth()===a&&t.getFullYear()===s}getDateIsInRange(t){if(this.type!==y.range||!this.selectedDate||!this.selectedEndDate)return;const e=t.getTime(),i=this.selectedDate.getTime(),s=this.selectedEndDate.getTime();return e>i&&e<s}getMonthText(){return Object.values(x)[this.renderDate.getMonth()]}getCurrentDateText(){const t=Object.values(f)[this.currentDate.dayOfWeek],e=Object.values(x)[this.currentDate.month];return`${t}, ${this.currentDate.day}th ${e} ${this.currentDate.year}`}getTimeText(){const{hour:t,minute:e}=this.currentDate;return`${t<10?"0"+t:t}:${e<10?"0"+e:e}`}getValueText(){if(!this.selectedDate)return"";const t=this.selectedDate,e=t.getFullYear(),i=t.getDate(),s=t.getMonth()+1;let a="";if(this.type!==y.date&&this.type!==y.datetime||(a=`${i<10?"0"+i:i}/${s<10?"0"+s:s}/${e}`),this.type===y.time&&(a=this.getTimeText()),this.type===y.datetime&&(a=`${a} ${this.getTimeText()}`),this.type===y.range&&(a=`${i<10?"0"+i:i}/${s<10?"0"+s:s}/${e}`),this.type===y.range&&this.selectedEndDate){const t=this.selectedEndDate,e=t.getFullYear(),i=t.getDate(),s=t.getMonth()+1;a+=`-${i<10?"0"+i:i}/${s<10?"0"+s:s}/${e}`}return this.setDataFromText(a),a}parseDate(t){var e=t.split("/"),i=parseInt(e[0],10),s=parseInt(e[1],10)-1,a=parseInt(e[2],10);if(isNaN(i)||isNaN(s)||isNaN(a))return"invalid date";var n=new Date(a,s,i);return n.getDate()!==i||n.getMonth()!==s||n.getFullYear()!==a?"invalid date":n}parse(t){const e=t.split(this.type===y.range?"-":" "),i=this.switchDDMM(e[0]),s=this.switchDDMM(e[1]),a=this.type===y.datetime?e[1]:e[0],n=new Date(i),r=new Date(s),h="invalid date"!==n.toString().toLowerCase()&&"invalid date"!==this.parseDate(t),o="invalid date"!==r.toString().toLowerCase(),c=/^((0?[1-9]|1[0-2])(-|\/)(0?[1-9]|[12]\d|3[01])(-|\/)[12]\d{3})$/,l=c.test(i),d=c.test(s),p=/\b([01][0-9]|2[0-3]):([0-5][0-9])\b/.test(a),m=h&&l,u=o&&d;return{date:n,date2:r,timeSections:p?a.split(":"):"",dateIsValid:m,date2IsValid:u,rangeIsValid:m&&u,timeIsValid:p}}getPrevMonth(){this.setMonth(this.renderDate.getMonth()-1)}getNextMonth(){this.setMonth(this.renderDate.getMonth()+1)}yearClick(t){this.yearsDragger.busy||this.setDragSelection("years",this.years[t],!0,!0)}hourClick(t){this.hoursDragger.busy||(this.selectedDate||this.setTime(),this.setDragSelection("hours",this.hours[t],!0,!0))}minuteClick(t){this.minutesDragger.busy||(this.selectedDate||this.setTime(),this.setDragSelection("minutes",this.minutes[t],!0,!0))}openPicker(){this.disabled||!this._open&&(this._open=!0)}handleDayNumber(t){this.type===y.range&&this.selectedDate&&!this.selectedEndDate&&this.isSameDate(this.selectedDate,t)||this.setDate(t,!0)}handleInputInput(t){this.setDataFromText(t,!0)}handleInputChange(t){this.setDataFromText(this.inputElement.value,!0,!1),t.stopPropagation()}async handleInputClear(){return this.selectedDate=null,this.selectedEndDate=null,this.emptyState=!0,this.renderDate=new Date,this._open=!1,this.setValue(!0),this.setError(),this.getValueText(),await this.inputElement.setClear(),await l(10),Promise.resolve()}handleWheel(t){t.preventDefault()}handleWindowClick(t){if(this._open){const e=document.getElementById(`picker-vp-${this._id}`),i=d.findEventPath(t,this.el),s=!!e&&d.findEventPath(t,e);i||s||(this._open=!1)}}openToggle(){this.disabled||(this._open=!this._open)}async open(){await l(50),this.openToggle()}async close(){this._open=!1}async getValue(){return this.value}async setDisabled(t){this.disabled=t}changeFormat(t,e=!1){if(!t)return;const i=t=>t<10?`0${t}`:t,s=i(new Date(t).getDate()),a=i(new Date(t).getMonth()+1),n=new Date(t).getFullYear(),r=i(new Date(t).getHours()),h=i(new Date(t).getMinutes());return"range"==this.type||"date"==this.type?e?`${a}/${s}/${n}`:`${s}/${a}/${n}`:e?`${a}/${s}/${n} ${r}:${h}`:`${s}/${a}/${n} ${r}:${h}`}isTime(t){return/^([0-1]?[0-9]|2[0-4]):([0-5][0-9])(:[0-5][0-9])?$/.test(t)}getHHMM(t){if(!t)return;const e=t=>t<10?`0${t}`:t;return`${e(new Date(t).getHours())}:${e(new Date(t).getMinutes())}`}async set(t){if(t)if("number"==typeof t&&(t=new Date(t)),"time"==this.type){let e=t;this.isTime(t)||(e=this.getHHMM(t)),this.setDataFromText(e,!0,!1)}else{const i=t.toString().split("-"),s=Date.parse(i[0]);if(i[0]&&!isNaN(s)){var e=this.changeFormat(c.convertTimeStampToDate(new Date(i[0]).getTime()));i[1]&&!isNaN(Date.parse(i[1]))&&(e=e+"-"+this.changeFormat(c.convertTimeStampToDate(new Date(i[1]).getTime()))),this.setDataFromText(e,!0,!1)}else this.setDataFromText("",!0,!1)}else this.setClear()}async get(){var t;return(null===(t=this.value)||void 0===t?void 0:t.timestamp)||null}async setClear(){return await this.handleInputClear(),Promise.resolve()}async getInput(){return this.inputElement}async isValid(){return this.getError()}async resetCaption(){return await l(10),await this.inputElement.resetCaption(),this.captionType="default",this.captionError=null,await l(10),Promise.resolve()}addZeroBefore(t){return(t<10?"0":"")+t}formatDate(t,e){const i={mm:this.addZeroBefore(t.getMonth()+1),dd:this.addZeroBefore(t.getDate()),yyyy:this.addZeroBefore(t.getFullYear()),hh:this.addZeroBefore(t.getHours()),mi:this.addZeroBefore(t.getMinutes())};return e.replace(/mm|dd|yyyy|hh|mi/gi,(t=>i[t]))}handleResize(){this.calculateLocation()}handleWheels(t){if(this._open){const e=document.querySelector(`#picker-vp-${this._id}`);e&&d.findEventPath(t,e)?this.calculateLocation():this._open=!1}}componentDidLoad(){const t=this.el.shadowRoot.querySelector(`#picker-vp-${this._id}`);t&&(document.body.appendChild(t),this.calculateLocation())}disconnectedCallback(){this.el.innerHTML="";const t=document.getElementById(`picker-vp-${this._id}`);t&&t.remove()}async calculateLocation(){const t=document.getElementById(`picker-vp-${this._id}`),e=this.placement.split("-");this.alignment&&(this.placement=e[0]+("right"==this.alignment?"-end":"-start"));var i=this.placement;const s=document.getElementById(this.linkedComponent?this.linkedComponent:this._id);if(s){const e=this.linkedComponent?s:s.shadowRoot.querySelector(`#picker-input-${this._id}`)||s.shadowRoot.querySelector("bcm-datetime-picker").shadowRoot.querySelector(`#picker-input-${this._id}`);if(t&&e){m(t,e,i,(t=>i=t)),await l(10);let s=u(i,e),a=this.noCaption?0:20,n=0;switch(m(t,e,i,(t=>i=t)),await l(10),s=u(i,e),t.style.top=this.linkedComponent?("top"==i.split("-")[0]?s[0]-t.offsetHeight:s[0])+"px":("top"==i.split("-")[0]?s[0]-t.offsetHeight+n:s[0]-a)+"px",i.split("-")[1]){case"start":t.style.left=s[1]+"px";break;case"center":t.style.left=s[1]-t.offsetWidth/2+"px";break;case"end":t.style.left=s[1]-t.offsetWidth+"px"}t.classList.toggle("bcm-list--top","top"==i.split("-")[0])}}}handleKeyDown(t){(t.keyCode||t.which)===p.KeyCode.escape&&this._open&&(this._open=!1,t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),this.markForCheck())}render(){const t=o("day-numbers"),e=o("datetime-picker","datetime-picker-wrapper",{open:this._open,"no-caption":this.noCaption}),i=o(this.hidden?"hidden":null,{"full-width":this.fullWidth,"linked-component":this.linkedComponent,"no-margin":this.noMargin}),n=o("toggle",{disabled:this.disabled}),r="time"==this.type?'<svg style="fill: #595959; width: 14px; height: 14px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm61.8-104.4l-84.9-61.7c-3.1-2.3-4.9-5.9-4.9-9.7V116c0-6.6 5.4-12 12-12h32c6.6 0 12 5.4 12 12v141.7l66.8 48.6c5.4 3.9 6.5 11.4 2.6 16.8L334.6 349c-3.9 5.3-11.4 6.5-16.8 2.6z"/></svg>':'<svg style="fill: #595959; width: 14px; height: 14px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M148 288h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12zm108-12v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm96 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm-96 96v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm-96 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm192 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm96-260v352c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V112c0-26.5 21.5-48 48-48h48V12c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v52h128V12c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v52h48c26.5 0 48 21.5 48 48zm-48 346V160H48v298c0 3.3 2.7 6 6 6h340c3.3 0 6-2.7 6-6z"/></svg>';return s(a,{class:i,"bcm-internal-id":this.inputId},this.label&&s("div",{class:"picker-label",onClick:()=>this.openToggle()},s(b,{size:"medium",type:this.captionType,value:this.label,required:this.required,htmlFor:this._id})),s("bcm-old-input",{ref:t=>this.inputElement=t,placeholder:this.placeholder||"Select "+(this.type===y.datetime?"date and time":"")+(this.type===y.date?"date":"")+(this.type===y.time?"time":"")+(this.type===y.range?"date range":""),value:this.valueText,required:this.required,fullWidth:this.fullWidth,disabled:this.disabled,name:this.name,id:this.inputId,clearable:this.clearable,onClick:()=>this.openPicker(),noMargin:this.noMargin,disableWatchValue:!0,"on-bcm-clear":()=>this.handleInputClear(),"on-bcm-change":t=>this.handleInputChange(t),noCaption:this.noCaption,captionError:this.captionError,caption:this.caption,captionType:this.captionType},this.error&&s("span",{slot:"suffix"},s("span",{id:"error-icon",class:n,innerHTML:'<svg style="fill: #ef4444; width: 14px; height: 14px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm42-104c0 23.2-18.8 42-42 42s-42-18.8-42-42 18.8-42 42-42 42 18.8 42 42zm-81.4-211.4l6.8 136c.3 6.4 5.6 11.4 12 11.4h41.2c6.4 0 11.7-5.1 12-11.4l6.8-136c.3-6.9-5.1-12.6-12-12.6h-54.8c-6.9 0-12.4 5.7-12 12.6z"/></svg>',title:this.errorText})),s("span",{slot:"suffix",onClick:()=>this.openPicker()},s("span",{id:"calender-icon",class:n,innerHTML:r}))),s("div",{id:"picker-vp-"+this._id,class:e,onWheel:t=>this.handleWheel(t)},s("div",{class:"modules"},this.hasDateModule&&s("div",{class:"date-container"},s("div",{class:"bcm-datetime-picker__header"},s("span",null),s("div",{class:"month-year"},s("button",{onClick:()=>this.getPrevMonth()},s("bcm-icon",{icon:"far fa-chevron-left"})),s("div",{class:"month-year-wrapper"},s("span",{class:"month"},this.getMonthText()),",",s("span",{class:"year"},this.date.getFullYear())),s("button",{onClick:()=>this.getNextMonth()},s("bcm-icon",{icon:"far fa-chevron-right"}))),s("span",{class:"today",onClick:()=>this.setDateToday()},"Today")),s("div",{class:"bcm-datetime-picker__content"},s("div",{class:"years",ref:t=>this.yearsWrapperElement=t},s("div",{class:"items",ref:t=>this.yearsElement=t},this.years.map(((t,e)=>s("span",{onClick:()=>this.yearClick(e)},t)))),s("div",{class:"select-strip",ref:t=>this.yearsStripElement=t})),s("div",{class:"days"},s("div",{class:"day-labels"},s("span",null,"Mo"),s("span",null,"Tu"),s("span",null,"We"),s("span",null,"Th"),s("span",null,"Fr"),s("span",null,"Sa"),s("span",null,"Su")),s("div",{class:t},this.dayNumbers.map((t=>s("span",{class:{"is-disabled-date":(this.type===y.date||this.type===y.datetime)&&this.isDisabledDate(t.date),"not-this-month":!t.thisMonth,"is-weekend":t.isWeekend,today:t.today,selected:this.getSelected(t.date),"selected-start":this.getSelected(t.date)&&this.selectedEndDate&&this.type===y.range,"selected-end":this.getSelected(t.date,!0)&&this.type===y.range,range:this.getDateIsInRange(t.date)&&this.type===y.range},onClick:()=>this.handleDayNumber(t.date)},s("span",{class:"number"},t.day)))))))),this.hasTimeModule&&s("div",{class:"time-container"},s("div",{class:"bcm-datetime-picker__header"},s("div",{class:"month-year"},s("span",{class:"month"},this.getTimeText())),s("span",{class:"now",onClick:()=>{this.setTime(),"time"==this.type&&(this._open=!1)}},"Now")),s("div",{class:"bcm-datetime-picker__content",onDblClick:t=>{this.HourContentDblClick(t)}},s("div",{class:"hours",ref:t=>this.hoursWrapperElement=t},s("div",{class:"items",ref:t=>this.hoursElement=t},this.hours.map(((t,e)=>s("span",{class:this.currentDate.hour===t?"selected":"",onClick:()=>this.hourClick(e)},(t<10&&"0")+t))))),s("div",{class:"minutes",ref:t=>this.minutesWrapperElement=t},s("div",{class:"items",ref:t=>this.minutesElement=t},this.minutes.map(((t,e)=>s("span",{class:this.currentDate.minute===t?"selected":"",onClick:()=>this.minuteClick(e)},(t<10&&"0")+t))))),s("div",{class:"select-strip",ref:t=>this.timeStripElement=t}))))))}get el(){return n(this)}static get watchers(){return{_open:["openChanged","openChange"],renderDate:["renderDateChange"],value:["valueChange"],disabledDates:["disabledDatesChange"]}}};(function(t,e,i,s){var a,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var h=t.length-1;h>=0;h--)(a=t[h])&&(r=(n<3?a(r):n>3?a(e,i,r):a(e,i))||r);n>3&&r&&Object.defineProperty(e,i,r)})([g()],w.prototype,"el",void 0),w.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}:host{display:inline-flex;flex-direction:column;position:relative;width:100%;max-width:256px;margin:0;margin-bottom:8px}:host(.full-width){max-width:100%}:host(.no-margin){margin:0}:host(.hidden){display:none}:host(.linked-component){display:none}.toggle{cursor:pointer}.toggle.disabled{cursor:not-allowed}.modules{display:flex}.picker-label{user-select:none;line-height:1}.datetime-picker{position:absolute;top:-1000px;display:inline-flex;flex-direction:column;box-shadow:0px 4px 4px rgba(0, 0, 0, 0.25);opacity:0;visibility:hidden;transition:transform 0.2s ease, opacity 0.3s ease;transform:scale(0.8) translateY(-100px);background-color:#ffffff;min-height:356px;max-height:356px;box-sizing:border-box;z-index:-1000}.datetime-picker.alignment-left{left:0}.datetime-picker.alignment-right{right:0}.datetime-picker.open{top:calc(100% - 28px);z-index:10000;opacity:1;visibility:visible;transform:scale(1) translateY(0)}.datetime-picker.open.no-caption{top:100%}.actions{display:flex;align-items:center;justify-content:space-between;padding:8px;margin-top:auto;border-top:1px solid var(--bcm-color-grey-6)}.actions .current-date{font-size:14px;line-height:22px;color:var(--bcm-color-prime-blue-6);text-transform:capitalize}.date-container+.time-container{border-left:1px solid #cecece}.time-container{width:185px}.time-container .bcm-datetime-picker__header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;max-height:60px;border-bottom:1px solid var(--bcm-color-grey-4)}.time-container .bcm-datetime-picker__header .now{font-size:14px;line-height:22px;cursor:pointer;color:var(--bcm-color-prime-blue-6);user-select:none}.time-container .bcm-datetime-picker__content{position:relative;display:flex}.time-container .hours,.time-container .minutes,.time-container .time-period{position:relative;flex:1 1 100%;max-width:100%;height:280px;overflow:hidden}.time-container .hours .items>span,.time-container .minutes .items>span,.time-container .time-period .items>span{font-size:14px;color:var(--bcm-color-grey-8)}.time-container .hours .items>span.selected,.time-container .minutes .items>span.selected,.time-container .time-period .items>span.selected{color:var(--bcm-color-prime-blue-6)}.date-container{width:364px;}.date-container .bcm-datetime-picker__header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;max-height:60px;border-bottom:1px solid var(--bcm-color-grey-4)}.date-container .bcm-datetime-picker__header .month-year-wrapper{display:flex;align-items:center;justify-content:center;margin:0 4px;min-width:125px}.date-container .bcm-datetime-picker__header .month-year{font-size:16px;line-height:24px}.date-container .bcm-datetime-picker__header .month-year{display:flex;align-items:center}.date-container .bcm-datetime-picker__header .month-year button{display:flex;align-items:center;box-shadow:none;background:transparent;outline:none;appearance:none;border:none;color:var(--bcm-color-prime-blue-6);cursor:pointer}.date-container .bcm-datetime-picker__header .month{text-transform:capitalize}.date-container .bcm-datetime-picker__header .year{padding-left:4px}.date-container .bcm-datetime-picker__header .today{font-size:14px;line-height:22px;cursor:pointer;color:var(--bcm-color-prime-blue-6);user-select:none}.date-container .bcm-datetime-picker__content{display:flex}.date-container .years{position:relative;flex:0 0 70px;max-width:70px;height:280px;overflow:hidden;background-color:var(--bcm-color-grey-2)}.date-container .days{width:100%}.date-container .day-numbers,.date-container .day-labels{display:grid;grid-template-columns:repeat(7, 1fr)}.date-container .day-numbers{padding:24px 24px}.date-container .day-numbers>span,.date-container .day-labels span{text-align:center}.date-container .day-numbers>span{position:relative;padding-bottom:100%;cursor:pointer}.date-container .day-numbers>span.not-this-month{color:var(--bcm-color-grey-4)}.date-container .day-numbers>span.is-weekend{color:var(--bcm-color-prime-blue-3)}.date-container .day-numbers>span.is-disabled-date:not(.today){color:var(--bcm-color-grey-4);cursor:not-allowed}.date-container .day-numbers>span.is-disabled-date:not(.today):before{opacity:0 !important}.date-container .day-numbers>span.today{color:var(--bcm-color-prime-blue-6)}.date-container .day-numbers>span.today:before{opacity:1;background-color:var(--bcm-color-prime-blue-2);border:1px solid var(--bcm-color-prime-blue-6)}.date-container .day-numbers>span.selected-start{background:linear-gradient(90deg, white 50%, #8abde2 50%) !important}.date-container .day-numbers>span.selected-end{background:linear-gradient(90deg, #8abde2 50%, white 50%) !important}.date-container .day-numbers>span.range{background:#8abde2}.date-container .day-numbers>span.range:not(.today){color:#ffffff}.date-container .day-numbers>span.range:not(.today):before{background-color:var(--bcm-color-prime-blue-6)}.date-container .day-numbers>span.range.is-weekend:not(.today){color:var(--bcm-color-prime-blue-2)}.date-container .day-numbers>span.selected,.date-container .day-numbers>span.selected-end{color:#ffffff}.date-container .day-numbers>span.selected:before,.date-container .day-numbers>span.selected-end:before{opacity:1;background-color:var(--bcm-color-prime-blue-6)}.date-container .day-numbers.start-1>span:first-child{grid-column:1}.date-container .day-numbers.start-2>span:first-child{grid-column:2}.date-container .day-numbers.start-3>span:first-child{grid-column:3}.date-container .day-numbers.start-4>span:first-child{grid-column:4}.date-container .day-numbers.start-5>span:first-child{grid-column:5}.date-container .day-numbers.start-6>span:first-child{grid-column:6}.date-container .day-numbers.start-7>span:first-child{grid-column:7}.date-container .day-numbers>span:before{content:"";position:absolute;top:0;left:0;width:100%;height:100%;border-radius:50%;background-color:var(--bcm-color-grey-4);opacity:0;box-sizing:border-box}.date-container .day-numbers>span:hover.not-this-month:not(.is-weekend){color:var(--bcm-color-grey-6)}.date-container .day-numbers>span:hover:before{opacity:1}.date-container .day-numbers .number{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}.date-container .day-labels{padding:24px 40px 0 40px}.date-container .day-labels span{font-size:12px;color:var(--bcm-color-grey-6)}.date-container .day-labels span:nth-child(7n+6),.date-container .day-labels span:nth-child(7n+7){color:var(--bcm-color-prime-blue-3)}.years .items,.hours .items,.minutes .items,.time-period .items{position:relative;display:flex;flex-direction:column;z-index:0;transform:translateY(0);scroll-behavior:smooth}.years .items>span,.hours .items>span,.minutes .items>span,.time-period .items>span{text-align:center;font-size:12px;min-height:26px;max-height:26px;line-height:26px;color:var(--bcm-color-grey-8);user-select:none}.years:before,.years:after,.hours:before,.hours:after,.minutes:before,.minutes:after,.time-period:before,.time-period:after{content:"";position:absolute;left:0;width:100%;height:40px}.years:before,.hours:before,.minutes:before,.time-period:before{top:-40px;box-shadow:0 10px 100px 70px #ffffff;z-index:1}.years:after,.hours:after,.minutes:after,.time-period:after{bottom:-40px;box-shadow:0 -10px 100px 70px #ffffff;z-index:2}.select-strip{position:absolute;width:100%;top:50%;left:0;transform:translateY(-50%);min-height:26px;max-height:26px;border:1px solid var(--bcm-color-grey-5);border-left:0;border-right:0;pointer-events:none;box-sizing:border-box}.picker-input-container{display:flex;flex-direction:column;align-items:flex-start;justify-content:stretch}';export{w as bcm_datetime_picker}
|
|
5
|
+
import{r as t,c as e,f as i,h as s,H as a,g as n}from"./p-170cf07d.js";import{D as r,E as h}from"./p-5ae0a59b.js";import{c as o}from"./p-bed627ab.js";import{D as c}from"./p-626a65e9.js";import{d as l}from"./p-3c7a0345.js";import{G as d}from"./p-83571dfd.js";import{B as p}from"./p-23c35e1b.js";import{g as m,s as u}from"./p-43a16ce4.js";import{L as b}from"./p-49f37d54.js";import{I as g}from"./p-3ade1099.js";import"./p-e45c1546.js";import"./p-e59b12e2.js";import"./p-034bbcdd.js";import"./p-91246af3.js";import"./p-d3d07c8c.js";var x,f,y;!function(t){t.january="january",t.february="february",t.march="march",t.april="april",t.may="may",t.june="june",t.july="july",t.august="august",t.september="september",t.october="october",t.november="november",t.december="december"}(x||(x={})),function(t){t.sunday="sunday",t.monday="monday",t.tuesday="tuesday",t.wednesday="wednesday",t.thursday="thursday",t.friday="friday",t.saturday="saturday"}(f||(f={})),function(t){t.datetime="datetime",t.range="range",t.date="date",t.time="time"}(y||(y={}));const v=JSON.stringify,w=class{constructor(i){t(this,i),this.load=e(this,"bcm-load",7),this.change=e(this,"bcm-change",7),this.bcmOpen=e(this,"bcm-open",7),this.inputId=null,this.emptyState=!1,this.initialized=!1,this.disabledDatesList={min:null,max:null,dates:[]},this.dayNumbers=[],this.valueText=null,this.dataIsValid=!1,this._id=d.UID(),this.date=new Date,this.endDate=null,this.type=y.datetime,this.disabled=!1,this.disabledDates="",this.value=null,this._open=!1,this.hidden=!1,this.name=void 0,this.fullWidth=!1,this.required=!1,this.label=void 0,this.placeholder=void 0,this.minYear=1900,this.maxYear=2200,this.noCaption=!1,this.noMargin=!1,this.captionError=void 0,this.caption="",this.captionType="default",this.alignment=void 0,this.placement=p.Placement["bottom-start"],this.linkedComponent=void 0,this.clearable=!1,this.years=[],this.hours=[],this.minutes=[],this.hasDateModule=!1,this.hasTimeModule=!1,this.renderDate=void 0,this.selectedDate=void 0,this.selectedEndDate=void 0,this.error=!1,this.errorText="",this.tick={}}markForCheck(){this.tick=d.UID()}openChanged(){this.bcmOpen.emit(this._open)}componentWillLoad(){if(this.inputId="picker-input-"+this._id,this.hasDateModule=this.type===y.datetime||this.type===y.date||this.type===y.range,this.hasTimeModule=this.type===y.datetime||this.type===y.time,this.prepareDisabledDates(),this.setData(),!this.initialized){for(let t=this.minYear;t<=this.maxYear;t++)this.years.push(t);for(let t=0;t<=23;t++)this.hours.push(t);for(let t=0;t<=59;t++)this.minutes.push(t);this.load.emit()}this.initialized=!0}componentDidRender(){this.hasDateModule&&!this.yearsDragger&&(this.createDragSelection("years",this.yearsElement,this.yearsWrapperElement,this.yearsStripElement,r.y),this.createWheelChange("years",this.yearsWrapperElement,this.yearsStripElement),this.setDragSelection("years",this.currentDate.year)),this.hasTimeModule&&!this.hoursDragger&&(this.createDragSelection("hours",this.hoursElement,this.hoursWrapperElement,this.timeStripElement,r.y),this.createWheelChange("hours",this.hoursWrapperElement,this.timeStripElement),this.setDragSelection("hours",this.currentDate.hour)),this.hasTimeModule&&!this.minutesDragger&&(this.createDragSelection("minutes",this.minutesElement,this.minutesWrapperElement,this.timeStripElement,r.y),this.createWheelChange("minutes",this.minutesWrapperElement,this.timeStripElement),this.setDragSelection("minutes",this.currentDate.minute))}renderDateChange(){this.initialized&&(this.setData(),this.hasDateModule&&this.setDragSelection("years",this.currentDate.year))}openChange(t){t&&(this.calculateLocation(),this.hasDateModule&&(this.createDragSelection("years",this.yearsElement,this.yearsWrapperElement,this.yearsStripElement,r.y),this.createWheelChange("years",this.yearsWrapperElement,this.yearsStripElement),this.setDragSelection("years",this.currentDate.year)),this.hasTimeModule&&(this.createDragSelection("hours",this.hoursElement,this.hoursWrapperElement,this.timeStripElement,r.y),this.createWheelChange("hours",this.hoursWrapperElement,this.timeStripElement),this.setDragSelection("hours",this.currentDate.hour,!0)),this.hasTimeModule&&(this.createDragSelection("minutes",this.minutesElement,this.minutesWrapperElement,this.timeStripElement,r.y),this.createWheelChange("minutes",this.minutesWrapperElement,this.timeStripElement),this.setDragSelection("minutes",this.currentDate.minute,!0)),this.markForCheck(),i(this.el))}valueChange(t,e){const i={isValid:!1,value:this.valueText};if(t)if(this.type!==y.range&&this.error)this.change.emit({isValid:!1,value:this.inputElement.value});else try{if((e&&v(t.dateObject)!==v(e.dateObject)||!e&&t)&&(this.type!==y.date&&this.type!==y.datetime||this.change.emit(t),this.type===y.time&&this.change.emit(t),this.type===y.range)){const e=t.dateObject;e.start.date&&e.end.date?t.isValid&&this.change.emit({isValid:t.isValid,value:t.value,start:e.start,end:e.end}):this.change.emit(i)}}catch(t){}else this.change.emit()}disabledDatesChange(t){t&&this.prepareDisabledDates()}stringToDate(t){return t.getMonth?t:new Date(Date.parse(this.switchDDMM(t)))}dateToString(t){if(!(t instanceof Date))return!1}switchDDMM(t){if(!t)return;const e=t.split("/");return-1===t.indexOf("/")||3!==e.length?t:`${e[1]}/${e[0]}/${e[2]}`}setData(){this.date=this.stringToDate(this.date),this.initialized||this.renderDate||(this.renderDate=this.date&&this.date||new Date),!this.initialized&&this.endDate&&(this.selectedEndDate=this.stringToDate(this.endDate));const t=this.renderDate;if(this.currentDate=this.createDateObject(t),this.dayNumbers=this.getMonthDayNumbers(t).map((e=>({day:e,thisMonth:!0,isWeekend:this.getDayIsWeekend(t,e),today:this.getIsCurrentDate(t,e),date:this.getTargetDayDate(t,e)}))),this.currentDate.year>this.minYear){let e=new Date(new Date(t).setMonth(this.currentDate.month-1,1)),i=this.getMonthDayNumbers(e).reverse(),s=this.currentDate.monthFirstDay;for(let t=1;t<(0===s?7:s);t++){const s=i[t-1];this.dayNumbers.unshift({day:s,prevMonth:!0,isWeekend:this.getDayIsWeekend(e,s),date:this.getTargetDayDate(e,s)})}}if(this.currentDate.year<this.maxYear){let e=new Date(new Date(t).setMonth(this.currentDate.month+1)),i=this.getMonthDayNumbers(e),s=42-this.dayNumbers.length;for(let t=0;t<s;t++){const s=i[t];this.dayNumbers.push({day:s,nextMonth:!0,isWeekend:this.getDayIsWeekend(e,s),date:this.getTargetDayDate(e,s)})}}this.emptyState||(this.valueText=this.getValueText()),i(this.el)}prepareDisabledDates(){if(!this.disabledDates)return;let t=null;if("string"==typeof this.disabledDates)try{t=JSON.parse(this.disabledDates)}catch(t){return}else t=this.disabledDates;if(t.dates&&t.dates.length&&t.dates.length){const e=t.dates.map((t=>{const e=new Date(t);return"invalid date"===e.toString().toLowerCase()?null:e})).filter((t=>t));this.disabledDatesList.dates=e}if(t.min&&t.max&&(t.min.getTime()>t.max.getTime()||t.max.getTime()<t.min.getTime()))return;t.min&&t.min instanceof Date?this.disabledDatesList.min=new Date(t.min.toDateString()):delete this.disabledDatesList.min,t.max&&t.max instanceof Date?this.disabledDatesList.max=new Date(t.max.toDateString()):delete this.disabledDatesList.max;const e=this.inputElement&&this.inputElement.value;e&&this.setDataFromText(e)}createWheelChange(t,e,i){e.addEventListener("wheel",(e=>{const s=e.deltaY>0,a=this[t+"Dragger"].getOffset().top,n=this.getTargetChildByDragPosition({y:a},i);let r=s?n+1:n-1;r<0?r=0:void 0===this[t][r]&&(r=this[t].length-1),"time"!=this.type||this.selectedDate||this.setTime(),this.setDragSelection(t,this[t][r],!0,!0)}))}createDragSelection(t,e,i,s,a){const n=t+"Dragger";this[n]=new h({target:e,trigger:i,direction:a,useTransform:!0,limit:{y:{max:s.offsetTop-s.offsetHeight/2,min:-1*(e.offsetHeight-(s.offsetTop+s.offsetHeight/2))}}}),this[n].on("end",(e=>{const i=this.getTargetChildByDragPosition(e,s);this.selectTargetChildByDragIdx(i,s,this[n]),this.setDragSelection(t,this[t][i],!1)}))}getTargetChildByDragPosition({y:t},e){const i=e.offsetHeight,s=i/2;return Math.floor(-(t-(e.offsetTop-s)-s)/i)}selectTargetChildByDragIdx(t,e,i,s=!0){i.setPosition({y:e.offsetHeight/2+e.offsetTop-(t+1)*e.offsetHeight,anim:s})}setDragSelection(t,e,i=!0,s=!1){const a=this[t].findIndex((t=>t===e));switch(i&&this.selectTargetChildByDragIdx(a,this["years"===t?t+"StripElement":"timeStripElement"],this[t+"Dragger"],s),t){case"years":this.date.setFullYear(e);break;case"hours":this.date.setHours(e);break;case"minutes":this.date.setMinutes(e)}this.renderDate=this.date,this.setData(),this.selectedDate&&this.setValue()}getHours12(){const t=(this.date.getHours()+24)%12||12;return t>12?t-12:t}createDateObject(t,{excludeTime:e=!1,exactMonthNumber:i=!1}={}){const s=t.getFullYear();return Object.assign(Object.assign({year:s>=this.maxYear?this.maxYear:s<=this.minYear?this.minYear:s,day:t.getDate(),month:t.getMonth()+(i?1:0),dayOfWeek:t.getDay(),monthFirstDay:new Date(new Date(t).setDate(1)).getDay()},!e&&{hour:t.getHours()}),!e&&{minute:t.getMinutes()})}generateDaysArrayFromMax(t){return Array.from(Array(t+1).keys()).slice(1)}getMonthDayNumbers(t){const e=this.getDaysInMonth(t.getMonth(),t.getFullYear());return this.generateDaysArrayFromMax(e)}getTargetDayDate(t,e){return new Date(new Date(t).setDate(e))}getDayIsWeekend(t,e){const i=new Date(new Date(t).setDate(e)).getDay();return 6===i||0===i}getClock(t){return{hours:(t=t||new Date).getHours(),minutes:t.getMinutes(),seconds:t.getSeconds(),milis:t.getMilliseconds()}}setValue(t){var e,i,s;const a=new Date(this.date.setHours(Number(this.currentDate.hour),Number(this.currentDate.minute)));if(t)this.value=null;else{if(this.dataIsValid=!0,this.type===y.datetime){const t=Object.assign({},this.currentDate);t.month+=1,(null===(e=this.value)||void 0===e?void 0:e.value)!=this.valueText&&(this.value={isValid:this.dataIsValid,date:a,timestamp:a.getTime(),dateObject:t,value:this.valueText})}if(this.type===y.date){const t=Object.assign({},this.currentDate);delete t.hour,delete t.minute,t.month+=1,(null===(i=this.value)||void 0===i?void 0:i.value)!=this.valueText&&(this.value={isValid:this.dataIsValid,date:a,timestamp:a.getTime(),dateObject:t,value:this.valueText})}if(this.type===y.time){const t=this.getTimeText(),e=Object.assign({},this.currentDate);e.month+=1,this.value={isValid:this.dataIsValid,date:a,timestamp:a.getTime(),time:t,dateObject:e,timeObject:{hours:this.currentDate.hour,minutes:this.currentDate.minute},value:t},this.inputElement.value=t}this.type===y.range&&(null===(s=this.value)||void 0===s?void 0:s.value)!=this.valueText&&(this.value={isValid:this.dataIsValid,dateObject:{start:Object.assign({},this.selectedDate&&{date:this.selectedDate,timestamp:this.selectedDate.getTime(),detail:this.createDateObject(this.selectedDate,{excludeTime:!0,exactMonthNumber:!0})}),end:Object.assign({},this.selectedEndDate&&{date:this.selectedEndDate,timestamp:this.selectedEndDate.getTime(),detail:this.createDateObject(this.selectedEndDate,{excludeTime:!0,exactMonthNumber:!0})})},value:this.valueText})}}setMonth(t){this.renderDate.setDate(1),this.renderDate=new Date(this.renderDate.setMonth(t)),this.setDragSelection("years",this.currentDate.year)}checkRangeValidation({popupClosing:t=!1}={}){return this.type!==y.range||(t&&(!this.selectedDate||this.selectedDate&&!this.selectedEndDate)?(this.setError(!0,"date range invalid"),!1):(t||this.setError(!1),!0))}pad(t,e){return t<e?"0":""}isInputClearable(){return!(!this.inputElement||!this.inputElement.value)}isDisabledDate(t){if(this.disabledDatesList.dates.map((e=>this.isSameDate(e,t))).filter((t=>t)).length)return!0;if(this.disabledDatesList.min){const e=new Date(this.disabledDatesList.min);if(e&&e.getTime()>t.getTime())return!0}if(this.disabledDatesList.max){const e=new Date(this.disabledDatesList.max);if(e&&new Date(e.setDate(e.getDate()+1)).getTime()<t.getTime())return!0}}setDate(t,e,i=!1){const s=this.type===y.range,a=!!this.selectedEndDate;if((this.type!==y.date&&this.type!==y.datetime||!this.isDisabledDate(t))&&(this.emptyState=!1,(!s||s&&!a)&&(this.date=new Date(t.setHours(this.currentDate.hour,this.currentDate.minute))),s&&this.checkRangeValidation(),s&&this.selectedDate&&this.selectedEndDate&&(this.selectedDate=null,this.selectedEndDate=null),e)){const e=new Date(t);s&&this.selectedDate?this.selectedDate.getTime()>e.getTime()?(this.selectedEndDate=this.selectedDate)&&(this.selectedDate=e):this.selectedEndDate=e:this.selectedDate=e,!s&&(this._open=i),this.renderDate=this.date,this.valueText=this.getValueText(),this.setValue();const a=this.valueText.split("/"),n=this.valueText?this.changeFormat(new Date(a[1]+"/"+a[0]+"/"+a[2])):"";this.inputElement.value=n}}setDataFromText(t,e=!1,i=!0){let s=!1,a="";const n=this.parse(t);if(this.type!==y.date&&this.type!==y.datetime||!this.isDisabledDate(n.date)||(n.dateIsValid=!1,a="disabled-date"),this.type===y.datetime&&n.dateIsValid&&n.timeIsValid&&(e&&this.setDate(n.date,!0,i),e&&this.setTime(n.timeSections[0],n.timeSections[1]),s=!0),this.type===y.date&&n.dateIsValid&&(e&&this.setDate(n.date,!0,i),s=!0),this.type===y.time&&n.timeIsValid&&(e&&this.setTime(n.timeSections[0],n.timeSections[1]),s=!0),this.type===y.range&&(n.dateIsValid&&!this.selectedDate&&(e&&this.setDate(n.date,!0,i),s=!0),n.date2IsValid&&!this.selectedEndDate&&(e&&this.setDate(n.date2,!0,i),s=!0),this.selectedDate&&this.selectedEndDate&&n.rangeIsValid&&(this.isSameDate(n.date2,this.selectedEndDate)&&!this.isSameDate(n.date,this.selectedDate)&&(this.selectedDate=null,e&&this.setDate(n.date,!0,i),s=!0),this.isSameDate(n.date,this.selectedDate)&&!this.isSameDate(n.date2,this.selectedEndDate)&&(this.selectedEndDate=null,e&&this.setDate(n.date2,!0,i),s=!0)),this.selectedDate&&this.selectedEndDate&&!n.rangeIsValid&&e&&(this.selectedDate=null,this.selectedEndDate=null)),s)e&&(this.renderDate=this.date),this.setError(!1);else{this.type===y.range&&this.selectedDate&&this.selectedEndDate&&n.rangeIsValid?this.setError(!1):a?this.setError(!0,"disabled-date"===a&&"selected date is not allowed"):(t&&this.setError(!0,(this.type===y.datetime?"invalid date or time":this.type===y.range&&"invalid date range")||this.type===y.date&&"The selected date is not allowed."||this.type===y.time&&"invalid time"),this.setValue(!0));const e=t.split("/"),i=t&&!this.error?this.changeFormat(new Date(e[1]+"/"+e[0]+"/"+e[2])):"";this.inputElement.value=i}}setDateToday(){const t=new Date;this.type===y.range&&(this.selectedDate=null,this.selectedEndDate=null),this.setDate(t,!0,!1)}HourContentDblClick(t){const e=d.findEventPathWithNodeName(t,"SPAN");e&&e.classList.contains("selected")&&(this.setValue(),this._open=!1)}setTime(t,e){this.renderDate=new Date(this.date.setHours(Number(t||this.getClock().hours),Number(e||this.getClock().minutes))),this.type===y.time&&(this.selectedDate=this.date);const i=this.currentDate.hour||(new Date).getHours(),s=this.currentDate.minute||(new Date).getMinutes();this.setDragSelection("hours",i,!0,!0),this.setDragSelection("minutes",s,!0,!0)}setError(t=!1,e=""){this.error=t,this.errorText=t?e:""}getError(){const{error:t,errorText:e}=this;return{valid:!t,error:t,errorText:e}}getDaysInMonth(t,e){return new Date(e,t+1,0).getDate()}getIsCurrentDate(t,e){const i=new Date;return i.getDate()===e&&i.getMonth()===t.getMonth()&&i.getFullYear()===t.getFullYear()}isSameDate(t,e){return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}getSelected(t,e=!1){const i=new Date(this["selected"+(e?"EndDate":"Date")]),s=i.getFullYear(),a=i.getMonth(),n=i.getDate();return t.getDate()===n&&t.getMonth()===a&&t.getFullYear()===s}getDateIsInRange(t){if(this.type!==y.range||!this.selectedDate||!this.selectedEndDate)return;const e=t.getTime(),i=this.selectedDate.getTime(),s=this.selectedEndDate.getTime();return e>i&&e<s}getMonthText(){return Object.values(x)[this.renderDate.getMonth()]}getCurrentDateText(){const t=Object.values(f)[this.currentDate.dayOfWeek],e=Object.values(x)[this.currentDate.month];return`${t}, ${this.currentDate.day}th ${e} ${this.currentDate.year}`}getTimeText(){const{hour:t,minute:e}=this.currentDate;return`${t<10?"0"+t:t}:${e<10?"0"+e:e}`}getValueText(){if(!this.selectedDate)return"";const t=this.selectedDate,e=t.getFullYear(),i=t.getDate(),s=t.getMonth()+1;let a="";if(this.type!==y.date&&this.type!==y.datetime||(a=`${i<10?"0"+i:i}/${s<10?"0"+s:s}/${e}`),this.type===y.time&&(a=this.getTimeText()),this.type===y.datetime&&(a=`${a} ${this.getTimeText()}`),this.type===y.range&&(a=`${i<10?"0"+i:i}/${s<10?"0"+s:s}/${e}`),this.type===y.range&&this.selectedEndDate){const t=this.selectedEndDate,e=t.getFullYear(),i=t.getDate(),s=t.getMonth()+1;a+=`-${i<10?"0"+i:i}/${s<10?"0"+s:s}/${e}`}return this.setDataFromText(a),a}parseDate(t){var e=t.split("/"),i=parseInt(e[0],10),s=parseInt(e[1],10)-1,a=parseInt(e[2],10);if(isNaN(i)||isNaN(s)||isNaN(a))return"invalid date";var n=new Date(a,s,i);return n.getDate()!==i||n.getMonth()!==s||n.getFullYear()!==a?"invalid date":n}parse(t){const e=t.split(this.type===y.range?"-":" "),i=this.switchDDMM(e[0]),s=this.switchDDMM(e[1]),a=this.type===y.datetime?e[1]:e[0],n=new Date(i),r=new Date(s),h="invalid date"!==n.toString().toLowerCase()&&"invalid date"!==this.parseDate(t),o="invalid date"!==r.toString().toLowerCase(),c=/^((0?[1-9]|1[0-2])(-|\/)(0?[1-9]|[12]\d|3[01])(-|\/)[12]\d{3})$/,l=c.test(i),d=c.test(s),p=/\b([01][0-9]|2[0-3]):([0-5][0-9])\b/.test(a),m=h&&l,u=o&&d;return{date:n,date2:r,timeSections:p?a.split(":"):"",dateIsValid:m,date2IsValid:u,rangeIsValid:m&&u,timeIsValid:p}}getPrevMonth(){this.setMonth(this.renderDate.getMonth()-1)}getNextMonth(){this.setMonth(this.renderDate.getMonth()+1)}yearClick(t){this.yearsDragger.busy||this.setDragSelection("years",this.years[t],!0,!0)}hourClick(t){this.hoursDragger.busy||(this.selectedDate||this.setTime(),this.setDragSelection("hours",this.hours[t],!0,!0))}minuteClick(t){this.minutesDragger.busy||(this.selectedDate||this.setTime(),this.setDragSelection("minutes",this.minutes[t],!0,!0))}openPicker(){this.disabled||!this._open&&(this._open=!0)}handleDayNumber(t){this.type===y.range&&this.selectedDate&&!this.selectedEndDate&&this.isSameDate(this.selectedDate,t)||this.setDate(t,!0)}handleInputInput(t){this.setDataFromText(t,!0)}handleInputChange(t){this.setDataFromText(this.inputElement.value,!0,!1),t.stopPropagation()}async handleInputClear(){return this.selectedDate=null,this.selectedEndDate=null,this.emptyState=!0,this.renderDate=new Date,this._open=!1,this.setValue(!0),this.setError(),this.getValueText(),await this.inputElement.setClear(),await l(10),Promise.resolve()}handleWheel(t){t.preventDefault()}handleWindowClick(t){if(this._open){const e=document.getElementById(`picker-vp-${this._id}`),i=d.findEventPath(t,this.el),s=!!e&&d.findEventPath(t,e);i||s||(this._open=!1)}}openToggle(){this.disabled||(this._open=!this._open)}async open(){await l(50),this.openToggle()}async close(){this._open=!1}async getValue(){return this.value}async setDisabled(t){this.disabled=t}changeFormat(t,e=!1){if(!t)return;const i=t=>t<10?`0${t}`:t,s=i(new Date(t).getDate()),a=i(new Date(t).getMonth()+1),n=new Date(t).getFullYear(),r=i(new Date(t).getHours()),h=i(new Date(t).getMinutes());return"range"==this.type||"date"==this.type?e?`${a}/${s}/${n}`:`${s}/${a}/${n}`:e?`${a}/${s}/${n} ${r}:${h}`:`${s}/${a}/${n} ${r}:${h}`}isTime(t){return/^([0-1]?[0-9]|2[0-4]):([0-5][0-9])(:[0-5][0-9])?$/.test(t)}getHHMM(t){if(!t)return;const e=t=>t<10?`0${t}`:t;return`${e(new Date(t).getHours())}:${e(new Date(t).getMinutes())}`}async set(t){if(t)if("number"==typeof t&&(t=new Date(t)),"time"==this.type){let e=t;this.isTime(t)||(e=this.getHHMM(t)),this.setDataFromText(e,!0,!1)}else{const i=t.toString().split("-"),s=Date.parse(i[0]);if(i[0]&&!isNaN(s)){var e=this.changeFormat(c.convertTimeStampToDate(new Date(i[0]).getTime()));i[1]&&!isNaN(Date.parse(i[1]))&&(e=e+"-"+this.changeFormat(c.convertTimeStampToDate(new Date(i[1]).getTime()))),this.setDataFromText(e,!0,!1)}else this.setDataFromText("",!0,!1)}else this.setClear()}async get(){var t;return(null===(t=this.value)||void 0===t?void 0:t.timestamp)||null}async setClear(){return await this.handleInputClear(),Promise.resolve()}async getInput(){return this.inputElement}async isValid(){return this.getError()}async resetCaption(){return await l(10),await this.inputElement.resetCaption(),this.captionType="default",this.captionError=null,await l(10),Promise.resolve()}addZeroBefore(t){return(t<10?"0":"")+t}formatDate(t,e){const i={mm:this.addZeroBefore(t.getMonth()+1),dd:this.addZeroBefore(t.getDate()),yyyy:this.addZeroBefore(t.getFullYear()),hh:this.addZeroBefore(t.getHours()),mi:this.addZeroBefore(t.getMinutes())};return e.replace(/mm|dd|yyyy|hh|mi/gi,(t=>i[t]))}handleResize(){this.calculateLocation()}handleWheels(t){if(this._open){const e=document.querySelector(`#picker-vp-${this._id}`);e&&d.findEventPath(t,e)?this.calculateLocation():this._open=!1}}componentDidLoad(){const t=this.el.shadowRoot.querySelector(`#picker-vp-${this._id}`);t&&(document.body.appendChild(t),this.calculateLocation())}disconnectedCallback(){this.el.innerHTML="";const t=document.getElementById(`picker-vp-${this._id}`);t&&t.remove()}async calculateLocation(){const t=document.getElementById(`picker-vp-${this._id}`),e=this.placement.split("-");this.alignment&&(this.placement=e[0]+("right"==this.alignment?"-end":"-start"));var i=this.placement;const s=document.getElementById(this.linkedComponent?this.linkedComponent:this._id);if(s){const e=this.linkedComponent?s:s.shadowRoot.querySelector(`#picker-input-${this._id}`)||s.shadowRoot.querySelector("bcm-datetime-picker").shadowRoot.querySelector(`#picker-input-${this._id}`);if(t&&e){m(t,e,i,(t=>i=t)),await l(10);let s=u(i,e),a=this.noCaption?0:20,n=0;switch(m(t,e,i,(t=>i=t)),await l(10),s=u(i,e),t.style.top=this.linkedComponent?("top"==i.split("-")[0]?s[0]-t.offsetHeight:s[0])+"px":("top"==i.split("-")[0]?s[0]-t.offsetHeight+n:s[0]-a)+"px",i.split("-")[1]){case"start":t.style.left=s[1]+"px";break;case"center":t.style.left=s[1]-t.offsetWidth/2+"px";break;case"end":t.style.left=s[1]-t.offsetWidth+"px"}t.classList.toggle("bcm-list--top","top"==i.split("-")[0])}}}handleKeyDown(t){(t.keyCode||t.which)===p.KeyCode.escape&&this._open&&(this._open=!1,t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),this.markForCheck())}render(){const t=o("day-numbers"),e=o("datetime-picker","datetime-picker-wrapper",{open:this._open,"no-caption":this.noCaption}),i=o(this.hidden?"hidden":null,{"full-width":this.fullWidth,"linked-component":this.linkedComponent,"no-margin":this.noMargin}),n=o("toggle",{disabled:this.disabled}),r="time"==this.type?'<svg style="fill: #595959; width: 14px; height: 14px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm61.8-104.4l-84.9-61.7c-3.1-2.3-4.9-5.9-4.9-9.7V116c0-6.6 5.4-12 12-12h32c6.6 0 12 5.4 12 12v141.7l66.8 48.6c5.4 3.9 6.5 11.4 2.6 16.8L334.6 349c-3.9 5.3-11.4 6.5-16.8 2.6z"/></svg>':'<svg style="fill: #595959; width: 14px; height: 14px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M148 288h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12zm108-12v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm96 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm-96 96v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm-96 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm192 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm96-260v352c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V112c0-26.5 21.5-48 48-48h48V12c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v52h128V12c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v52h48c26.5 0 48 21.5 48 48zm-48 346V160H48v298c0 3.3 2.7 6 6 6h340c3.3 0 6-2.7 6-6z"/></svg>';return s(a,{class:i,"bcm-internal-id":this.inputId},this.label&&s("div",{class:"picker-label",onClick:()=>this.openToggle()},s(b,{size:"medium",type:this.captionType,value:this.label,required:this.required,htmlFor:this._id})),s("bcm-old-input",{ref:t=>this.inputElement=t,placeholder:this.placeholder||"Select "+(this.type===y.datetime?"date and time":"")+(this.type===y.date?"date":"")+(this.type===y.time?"time":"")+(this.type===y.range?"date range":""),value:this.valueText,required:this.required,fullWidth:this.fullWidth,disabled:this.disabled,name:this.name,id:this.inputId,clearable:this.clearable,onClick:()=>this.openPicker(),noMargin:this.noMargin,disableWatchValue:!0,"on-bcm-clear":()=>this.handleInputClear(),"on-bcm-change":t=>this.handleInputChange(t),noCaption:this.noCaption,captionError:this.captionError,caption:this.caption,captionType:this.captionType},this.error&&s("span",{slot:"suffix"},s("span",{id:"error-icon",class:n,innerHTML:'<svg style="fill: #ef4444; width: 14px; height: 14px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm42-104c0 23.2-18.8 42-42 42s-42-18.8-42-42 18.8-42 42-42 42 18.8 42 42zm-81.4-211.4l6.8 136c.3 6.4 5.6 11.4 12 11.4h41.2c6.4 0 11.7-5.1 12-11.4l6.8-136c.3-6.9-5.1-12.6-12-12.6h-54.8c-6.9 0-12.4 5.7-12 12.6z"/></svg>',title:this.errorText})),s("span",{slot:"suffix",onClick:()=>this.openPicker()},s("span",{id:"calender-icon",class:n,innerHTML:r}))),s("div",{id:"picker-vp-"+this._id,class:e,onWheel:t=>this.handleWheel(t)},s("div",{class:"modules"},this.hasDateModule&&s("div",{class:"date-container"},s("div",{class:"bcm-datetime-picker__header"},s("span",null),s("div",{class:"month-year"},s("button",{onClick:()=>this.getPrevMonth()},s("bcm-icon",{icon:"far fa-chevron-left"})),s("div",{class:"month-year-wrapper"},s("span",{class:"month"},this.getMonthText()),",",s("span",{class:"year"},this.date.getFullYear())),s("button",{onClick:()=>this.getNextMonth()},s("bcm-icon",{icon:"far fa-chevron-right"}))),s("span",{class:"today",onClick:()=>this.setDateToday()},"Today")),s("div",{class:"bcm-datetime-picker__content"},s("div",{class:"years",ref:t=>this.yearsWrapperElement=t},s("div",{class:"items",ref:t=>this.yearsElement=t},this.years.map(((t,e)=>s("span",{onClick:()=>this.yearClick(e)},t)))),s("div",{class:"select-strip",ref:t=>this.yearsStripElement=t})),s("div",{class:"days"},s("div",{class:"day-labels"},s("span",null,"Mo"),s("span",null,"Tu"),s("span",null,"We"),s("span",null,"Th"),s("span",null,"Fr"),s("span",null,"Sa"),s("span",null,"Su")),s("div",{class:t},this.dayNumbers.map((t=>s("span",{class:{"is-disabled-date":(this.type===y.date||this.type===y.datetime)&&this.isDisabledDate(t.date),"not-this-month":!t.thisMonth,"is-weekend":t.isWeekend,today:t.today,selected:this.getSelected(t.date),"selected-start":this.getSelected(t.date)&&this.selectedEndDate&&this.type===y.range,"selected-end":this.getSelected(t.date,!0)&&this.type===y.range,range:this.getDateIsInRange(t.date)&&this.type===y.range},onClick:()=>this.handleDayNumber(t.date)},s("span",{class:"number"},t.day)))))))),this.hasTimeModule&&s("div",{class:"time-container"},s("div",{class:"bcm-datetime-picker__header"},s("div",{class:"month-year"},s("span",{class:"month"},this.getTimeText())),s("span",{class:"now",onClick:()=>{this.setTime(),"time"==this.type&&(this._open=!1)}},"Now")),s("div",{class:"bcm-datetime-picker__content",onDblClick:t=>{this.HourContentDblClick(t)}},s("div",{class:"hours",ref:t=>this.hoursWrapperElement=t},s("div",{class:"items",ref:t=>this.hoursElement=t},this.hours.map(((t,e)=>s("span",{class:this.currentDate.hour===t?"selected":"",onClick:()=>this.hourClick(e)},(t<10&&"0")+t))))),s("div",{class:"minutes",ref:t=>this.minutesWrapperElement=t},s("div",{class:"items",ref:t=>this.minutesElement=t},this.minutes.map(((t,e)=>s("span",{class:this.currentDate.minute===t?"selected":"",onClick:()=>this.minuteClick(e)},(t<10&&"0")+t))))),s("div",{class:"select-strip",ref:t=>this.timeStripElement=t}))))))}get el(){return n(this)}static get watchers(){return{_open:["openChanged","openChange"],renderDate:["renderDateChange"],value:["valueChange"],disabledDates:["disabledDatesChange"]}}};(function(t,e,i,s){var a,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var h=t.length-1;h>=0;h--)(a=t[h])&&(r=(n<3?a(r):n>3?a(e,i,r):a(e,i))||r);n>3&&r&&Object.defineProperty(e,i,r)})([g()],w.prototype,"el",void 0),w.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}:host{display:inline-flex;flex-direction:column;position:relative;width:100%;max-width:256px;margin:0;margin-bottom:8px}:host(.full-width){max-width:100%}:host(.no-margin){margin:0}:host(.hidden){display:none}:host(.linked-component){display:none}.toggle{cursor:pointer}.toggle.disabled{cursor:not-allowed}.modules{display:flex}.picker-label{user-select:none;line-height:1}.datetime-picker{position:absolute;top:-1000px;display:inline-flex;flex-direction:column;box-shadow:0px 4px 4px rgba(0, 0, 0, 0.25);opacity:0;visibility:hidden;transition:transform 0.2s ease, opacity 0.3s ease;transform:scale(0.8) translateY(-100px);background-color:#ffffff;min-height:356px;max-height:356px;box-sizing:border-box;z-index:-1000}.datetime-picker.alignment-left{left:0}.datetime-picker.alignment-right{right:0}.datetime-picker.open{top:calc(100% - 28px);z-index:10000;opacity:1;visibility:visible;transform:scale(1) translateY(0)}.datetime-picker.open.no-caption{top:100%}.actions{display:flex;align-items:center;justify-content:space-between;padding:8px;margin-top:auto;border-top:1px solid var(--bcm-color-grey-6)}.actions .current-date{font-size:14px;line-height:22px;color:var(--bcm-color-prime-blue-6);text-transform:capitalize}.date-container+.time-container{border-left:1px solid #cecece}.time-container{width:185px}.time-container .bcm-datetime-picker__header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;max-height:60px;border-bottom:1px solid var(--bcm-color-grey-4)}.time-container .bcm-datetime-picker__header .now{font-size:14px;line-height:22px;cursor:pointer;color:var(--bcm-color-prime-blue-6);user-select:none}.time-container .bcm-datetime-picker__content{position:relative;display:flex}.time-container .hours,.time-container .minutes,.time-container .time-period{position:relative;flex:1 1 100%;max-width:100%;height:280px;overflow:hidden}.time-container .hours .items>span,.time-container .minutes .items>span,.time-container .time-period .items>span{font-size:14px;color:var(--bcm-color-grey-8)}.time-container .hours .items>span.selected,.time-container .minutes .items>span.selected,.time-container .time-period .items>span.selected{color:var(--bcm-color-prime-blue-6)}.date-container{width:364px;}.date-container .bcm-datetime-picker__header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;max-height:60px;border-bottom:1px solid var(--bcm-color-grey-4)}.date-container .bcm-datetime-picker__header .month-year-wrapper{display:flex;align-items:center;justify-content:center;margin:0 4px;min-width:125px}.date-container .bcm-datetime-picker__header .month-year{font-size:16px;line-height:24px}.date-container .bcm-datetime-picker__header .month-year{display:flex;align-items:center}.date-container .bcm-datetime-picker__header .month-year button{display:flex;align-items:center;box-shadow:none;background:transparent;outline:none;appearance:none;border:none;color:var(--bcm-color-prime-blue-6);cursor:pointer}.date-container .bcm-datetime-picker__header .month{text-transform:capitalize}.date-container .bcm-datetime-picker__header .year{padding-left:4px}.date-container .bcm-datetime-picker__header .today{font-size:14px;line-height:22px;cursor:pointer;color:var(--bcm-color-prime-blue-6);user-select:none}.date-container .bcm-datetime-picker__content{display:flex}.date-container .years{position:relative;flex:0 0 70px;max-width:70px;height:280px;overflow:hidden;background-color:var(--bcm-color-grey-2)}.date-container .days{width:100%}.date-container .day-numbers,.date-container .day-labels{display:grid;grid-template-columns:repeat(7, 1fr)}.date-container .day-numbers{padding:24px 24px}.date-container .day-numbers>span,.date-container .day-labels span{text-align:center}.date-container .day-numbers>span{position:relative;padding-bottom:100%;cursor:pointer}.date-container .day-numbers>span.not-this-month{color:var(--bcm-color-grey-4)}.date-container .day-numbers>span.is-weekend{color:var(--bcm-color-prime-blue-3)}.date-container .day-numbers>span.is-disabled-date:not(.today){color:var(--bcm-color-grey-4);cursor:not-allowed}.date-container .day-numbers>span.is-disabled-date:not(.today):before{opacity:0 !important}.date-container .day-numbers>span.today{color:var(--bcm-color-prime-blue-6)}.date-container .day-numbers>span.today:before{opacity:1;background-color:var(--bcm-color-prime-blue-2);border:1px solid var(--bcm-color-prime-blue-6)}.date-container .day-numbers>span.selected-start{background:linear-gradient(90deg, white 50%, #8abde2 50%) !important}.date-container .day-numbers>span.selected-end{background:linear-gradient(90deg, #8abde2 50%, white 50%) !important}.date-container .day-numbers>span.range{background:#8abde2}.date-container .day-numbers>span.range:not(.today){color:#ffffff}.date-container .day-numbers>span.range:not(.today):before{background-color:var(--bcm-color-prime-blue-6)}.date-container .day-numbers>span.range.is-weekend:not(.today){color:var(--bcm-color-prime-blue-2)}.date-container .day-numbers>span.selected,.date-container .day-numbers>span.selected-end{color:#ffffff}.date-container .day-numbers>span.selected:before,.date-container .day-numbers>span.selected-end:before{opacity:1;background-color:var(--bcm-color-prime-blue-6)}.date-container .day-numbers.start-1>span:first-child{grid-column:1}.date-container .day-numbers.start-2>span:first-child{grid-column:2}.date-container .day-numbers.start-3>span:first-child{grid-column:3}.date-container .day-numbers.start-4>span:first-child{grid-column:4}.date-container .day-numbers.start-5>span:first-child{grid-column:5}.date-container .day-numbers.start-6>span:first-child{grid-column:6}.date-container .day-numbers.start-7>span:first-child{grid-column:7}.date-container .day-numbers>span:before{content:"";position:absolute;top:0;left:0;width:100%;height:100%;border-radius:50%;background-color:var(--bcm-color-grey-4);opacity:0;box-sizing:border-box}.date-container .day-numbers>span:hover.not-this-month:not(.is-weekend){color:var(--bcm-color-grey-6)}.date-container .day-numbers>span:hover:before{opacity:1}.date-container .day-numbers .number{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}.date-container .day-labels{padding:24px 40px 0 40px}.date-container .day-labels span{font-size:12px;color:var(--bcm-color-grey-6)}.date-container .day-labels span:nth-child(7n+6),.date-container .day-labels span:nth-child(7n+7){color:var(--bcm-color-prime-blue-3)}.years .items,.hours .items,.minutes .items,.time-period .items{position:relative;display:flex;flex-direction:column;z-index:0;transform:translateY(0);scroll-behavior:smooth}.years .items>span,.hours .items>span,.minutes .items>span,.time-period .items>span{text-align:center;font-size:12px;min-height:26px;max-height:26px;line-height:26px;color:var(--bcm-color-grey-8);user-select:none}.years:before,.years:after,.hours:before,.hours:after,.minutes:before,.minutes:after,.time-period:before,.time-period:after{content:"";position:absolute;left:0;width:100%;height:40px}.years:before,.hours:before,.minutes:before,.time-period:before{top:-40px;box-shadow:0 10px 100px 70px #ffffff;z-index:1}.years:after,.hours:after,.minutes:after,.time-period:after{bottom:-40px;box-shadow:0 -10px 100px 70px #ffffff;z-index:2}.select-strip{position:absolute;width:100%;top:50%;left:0;transform:translateY(-50%);min-height:26px;max-height:26px;border:1px solid var(--bcm-color-grey-5);border-left:0;border-right:0;pointer-events:none;box-sizing:border-box}.picker-input-container{display:flex;flex-direction:column;align-items:flex-start;justify-content:stretch}';export{w as bcm_datetime_picker}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{h as n}from"./p-170cf07d.js";import{d as e}from"./p-3fac58f7.js";import{B as s}from"./p-23c35e1b.js";import{c as
|
|
5
|
+
import{h as n}from"./p-170cf07d.js";import{d as e}from"./p-3fac58f7.js";import{B as s}from"./p-23c35e1b.js";import{c as t}from"./p-bed627ab.js";import{s as a}from"./p-83571dfd.js";const i=({elementType:i,rows:o,id:c,internalId:r,type:l,placeholder:p,value:u,size:f,pattern:d,unit:b,unitPrefix:m,maxLength:x,disabled:w,clearable:h,focused:y,readonly:v,isPasswordVisible:C,passwordToggle:g,noDefaultIcon:j,inValid:_,captionType:k,resize:z,autocomplete:I,_suffix:T,_prefix:L,changePasswordVisibility:B,handleClear:D,steps:O,ref:P,handleBlur:V,handleFocus:F,handleInput:H,handleChange:M,isEyeDropperSupported:E,eyeDropper:S})=>{const q=s.HtmlElementType[i]||s.HtmlElementType.input;l="password"===l&&C?"text":l,u=a((()=>u),""),u=y?u:u+(u&&(null==b?void 0:b.length)>0?" "+b:"");const A="color"===(l=(null==b?void 0:b.length)>0&&!y?"text":l);l="color"===l?"text":l;var G=t("bcm-input__container",q===s.HtmlElementType.textarea&&t("bcm-input__textarea","textarea-size-"+s.Size[f],"resize-"+z,"textarea-"+f),q===s.HtmlElementType.input&&t("input-size-"+s.Size[f]),{focused:y,clearable:h,disabled:w,readonly:v,invalid:_,unit:(null==b?void 0:b.length)>0,error:"error"===k});const J=t("caret-container",{unit:(null==b?void 0:b.length)>0,disabled:w||v||_}),K="bcm-input__container--"+f,N=t(K,"unit-prefix");return n("div",{class:G,id:c+"-container"},n("span",{hidden:!0},n("slot",null)),n("span",{class:"input-prefix"},n("slot",{name:"prefix"}),L&&L.length>0&&n("span",{innerHTML:L}),m&&n("span",{class:N},m),A&&n("i",{class:"tw-flex tw-h-4 tw-w-4 tw-items-center tw-justify-center tw-rounded-full tw-border tw-border-slate-300",style:{backgroundColor:u}})),n(q,Object.assign({tabindex:"0",id:c+"-input","bcm-internal-id":r,class:"bcm-input-element "+K},q===s.HtmlElementType.input&&{type:l,autocomplete:I?"on":"off",pattern:d},q===s.HtmlElementType.textarea&&{rows:o,resize:z},{value:u,maxLength:x,placeholder:p,disabled:w,readOnly:v,ref:n=>P(n),onBlur:n=>(n=>{n.target.parentElement.classList.remove("focused"),V(n)})(n),onFocus:n=>(n=>{n.target.parentElement.classList.add("focused"),F(n)})(n),onInput:n=>H(n),onChange:n=>M(n)})),n("span",{class:"input-suffix-content"},h&&!w&&!v&&n("span",{class:"input-suffix input-suffix-button input-clear-button",onClick:n=>D(n)},n("bcm-icon",{icon:"far fa-times"}))),n("span",{class:"input-suffix-content"},("password"===l||"text"===l)&&g&&n("span",{class:"input-suffix input-suffix-button",onClick:()=>B()},n("bcm-icon",{icon:C?"far fa-eye-slash":"far fa-eye"}))),n("span",{class:"input-suffix-content"},Object.keys(e).includes(l)&&!j&&n("span",{class:"input-suffix"},n("bcm-icon",{icon:e[l]}))),n("span",{class:"input-suffix-content"},"number"===l&&n("div",{class:J},n("span",{class:"bcm-input-caret",onClick:()=>O("up")},n("bcm-icon",{icon:"fas fa-caret-up"})),n("span",{class:"bcm-input-caret",onClick:()=>O("down")},n("bcm-icon",{icon:"fas fa-caret-down"})))),n("span",{class:"input-suffix-content"},"number"!==l&&n("span",{class:"input-suffix"},n("slot",{name:"suffix"}),T&&T.length>0&&n("span",{innerHTML:T})),A&&E()&&n("span",{class:"input-suffix"},n("span",null,n("i",{class:"far fa-eye-dropper",onClick:()=>S()})))))};export{i as I}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{r as t,c as s,h as i,H as e,g as h}from"./p-170cf07d.js";import{c as
|
|
5
|
+
import{r as t,c as s,h as i,H as e,g as h}from"./p-170cf07d.js";import{c as d}from"./p-bed627ab.js";import{G as a}from"./p-83571dfd.js";import{s as p}from"./p-e2f92d0b.js";import"./p-e45c1546.js";import"./p-e59b12e2.js";import"./p-034bbcdd.js";import"./p-74e6d2b6.js";const r=class{constructor(i){t(this,i),this.dataIsLoaded=s(this,"data-is-loaded",7),this.bcmChangeHidden=s(this,"bcm-change-hidden",7),this.hidden=!1,this._id=a.UID(),this._title=void 0,this.description=void 0,this.status="default",this.icon=void 0,this.loading=!1,this.valid=!0,this.index=void 0,this.active=!1,this.htmlTemplate=void 0,this.isLast=!1,this.disabled=!1}componentDidLoad(){this.isLast&&this.dataIsLoaded.emit(!0)}getStepper(){return this.el.closest("bcm-stepper")||null}activeChanged(){if(this.active){const t=this.getStepper();t&&p.changeStepDisabled(t.stepperId,this._id,!1)}}statusChange(){const t=this.getStepper();t&&p.changeStepStatus(t.stepperId,this._id,this.status)}hiddenChange(t,s){const i=this.getStepper();t!==s&&i&&!this.active&&this.bcmChangeHidden.emit(t)}disabledChange(t,s){const i=this.getStepper();i&&p.changeStepDisabled(i.stepperId,this._id,t)}render(){const{hidden:t,valid:s,active:h}=this,a=d("bcm-stepper__step",s?"bcm-stepper__step-valid":"bcm-stepper__step-invalid",{"bcm-stepper__step-active":h,hidden:t});return i(e,{class:a},i("slot",null))}get el(){return h(this)}static get watchers(){return{active:["activeChanged"],status:["statusChange"],hidden:["hiddenChange"],disabled:["disabledChange"]}}};export{r as bcm_step}
|
|
@@ -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,g as
|
|
5
|
+
import{r as e,c as t,h as i,g as s}from"./p-170cf07d.js";import{G as c,s as d}from"./p-83571dfd.js";import{S as l}from"./p-91246af3.js";import"./p-e59b12e2.js";import"./p-034bbcdd.js";import"./p-e45c1546.js";import"./p-23c35e1b.js";const n=class{constructor(i){e(this,i),this.bcmItems=t(this,"bcm-items",7),this._id=c.UID()}connectedCallback(){if(this.el.children&&this.el.children.length>0){let e=this.nestedItems(this.el);this.bcmItems.emit(e),this.el.remove()}}mapItems(e){var t;const i=null===(t=null==e?void 0:e.innerHTML)||void 0===t?void 0:t.replace(/<bcm-item>.*<\/bcm-item>/g,"").replace(/<bcm-item .*>.*<\/bcm-item>/g,"").replace(/<!--(.|\s)*?-->/g,"").trim(),s=t=>l.elementBooleanCheck(e.getAttribute(t));return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({id:e.getAttribute("id")||c.UID(),text:e.getAttribute("text")||i},e.innerHTML.trim()&&{isHtmlContent:e.textContent.length>0?e.innerHTML.trim():null}),s("disabled")&&{disabled:s("disabled")}),s("selected")&&{selected:s("selected")}),s("hidden")&&{hidden:s("hidden")}),s("checked")&&{checked:s("checked")}),s("readonly")&&{readonly:s("readonly")}),s("active")&&{active:s("active")}),s("icon")&&{icon:e.getAttribute("icon")}),s("link")&&{link:e.getAttribute("link")})}nestedItems(e){return d((()=>Array.from(null==e?void 0:e.children).map((e=>{var t;return Object.assign(Object.assign({},"bcm-item"===(null===(t=null==e?void 0:e.tagName)||void 0===t?void 0:t.toLowerCase())&&this.mapItems(e)),{items:this.nestedItems(e)})}))),[])}render(){return i("slot",null)}get el(){return s(this)}};export{n as bcm_items}
|
|
@@ -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 s,g as e}from"./p-170cf07d.js";import"./p-4798d827.js";import"./p-626a65e9.js";import{G as r}from"./p-
|
|
5
|
+
import{r as t,h as i,H as s,g as e}from"./p-170cf07d.js";import"./p-4798d827.js";import"./p-626a65e9.js";import{G as r}from"./p-83571dfd.js";import"./p-e6938871.js";import"./p-91246af3.js";import"./p-06d549b0.js";import"./p-5ae0a59b.js";import"./p-23c35e1b.js";import"./p-436364c8.js";import"./p-3c7a0345.js";import"./p-034bbcdd.js";import"./p-e45c1546.js";import"./p-e59b12e2.js";const o=class{constructor(i){t(this,i),this._id=r.UID(),this.active=!1,this.disabled=!1,this.index=void 0}componentWillLoad(){this.indexControl()}componentDidRender(){this.headerMove()}getHeaderItem(){const t=this.el.querySelector("bcm-tab-item-header");return t&&(t.setAttribute("index",`${this.index}`),t.setAttribute("active",`${this.active}`),t.setAttribute("disabled",`${this.disabled}`),t.setAttribute("tab-id",`${this._id}`),t.style.order=`${this.index}`),t}getParentTabGroup(){return r.findParentElement(this.el,"bcm-tab-group")}getFindHeaderItem(){var t,i;return null===(i=null===(t=this.getParentTabGroup())||void 0===t?void 0:t.querySelector("#tab-header"))||void 0===i?void 0:i.querySelector(`bcm-tab-item-header[tab-id="${this._id}"]`)}headerMove(){var t,i,s,e;this.getHeaderItem()&&(null===(t=this.getFindHeaderItem())||void 0===t||t.remove(),null===(s=null===(i=this.getParentTabGroup())||void 0===i?void 0:i.querySelector("#tab-header"))||void 0===s||s.appendChild(this.getHeaderItem()),null===(e=this.el.parentElement)||void 0===e||e.refresh())}indexControl(){var t;this.index||null===(t=r.findParentElement(this.el,"bcm-tab-group"))||void 0===t||t.querySelectorAll("bcm-tab-item").forEach(((t,i)=>{t===this.el&&t.setAttribute("index",`${i+1}`)}))}componentDidLoad(){new MutationObserver((()=>{this.headerMove()})).observe(this.el,{childList:!0,subtree:!0})}render(){return i(s,{id:this._id,role:"tabpanel","aria-labelledby":`tab-${this._id}`,"aria-hidden":`${!this.active}`,class:{"tw-block":this.active,"tw-hidden":!this.active,"tw-opacity-50":this.disabled,"tw-w-full":!0}},i("slot",null))}get el(){return e(this)}};export{o as bcm_tab_item}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{r as e,c as i,h as o,H as t,g as s}from"./p-170cf07d.js";import{c as l}from"./p-bed627ab.js";import{G as p}from"./p-
|
|
5
|
+
import{r as e,c as i,h as o,H as t,g as s}from"./p-170cf07d.js";import{c as l}from"./p-bed627ab.js";import{G as p}from"./p-83571dfd.js";import"./p-e45c1546.js";import"./p-e59b12e2.js";import"./p-034bbcdd.js";const r=class{constructor(o){e(this,o),this.bcmCollapseOpen=i(this,"bcm-collapse-open",7),this._id=p.UID(),this.borderless=!1,this.open=!1,this.noBorder=!1,this.hidden=!1}componentDidRender(){this.open&&this.bcmCollapseOpen.emit(this._id)}render(){const{hidden:e,borderless:i,open:s,noBorder:p,_id:r}=this,a=l("bcm-collapse",{"bcm-collapse--borderless":i,"bcm-collapse--open":s,"bcm-collapse--no-border":p});return o(t,{class:{hidden:e},id:r},o("details",{class:a,open:s},o("summary",{class:"bcm-collapse__header size-2",onClick:()=>this.open=!s},o("span",{class:"collapse-icon",innerHTML:s?'<svg style="fill: #595959; width: 14px; height: 14px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"/></svg>':'<svg style="fill: #595959; width: 14px; height: 14px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 192 512"><path d="M0 384.662V127.338c0-17.818 21.543-26.741 34.142-14.142l128.662 128.662c7.81 7.81 7.81 20.474 0 28.284L34.142 398.804C21.543 411.404 0 402.48 0 384.662z"/></svg>'}),o("slot",{name:"title"})),o("div",{class:"bcm-collapse__body"},o("slot",{name:"body"}))))}get el(){return s(this)}};r.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-collapse{display:block;border:1px solid var(--bcm-color-grey-5)}.bcm-collapse ::-webkit-details-marker{display:none}.bcm-collapse__header{display:flex;align-items:center;color:var(--bcm-color-grey-9);padding:16px;background-color:var(--bcm-color-grey-2);border-bottom:1px solid var(--bcm-color-grey-5);cursor:default;user-select:none}.bcm-collapse__header:focus{outline:none}.bcm-collapse__header .collapse-icon{margin-right:8px;display:flex;align-items:center;justify-content:center}.bcm-collapse__body{padding:16px;background-color:var(--bcm-color-grey-1);color:var(--bcm-color-grey-8)}.bcm-collapse--borderless{border:none}.bcm-collapse--borderless:not(.bcm-collapse--no-border){border-bottom:1px solid var(--bcm-color-grey-5)}.bcm-collapse--borderless .bcm-collapse__header{border-bottom:none}.bcm-collapse--borderless .bcm-collapse__body{background-color:var(--bcm-color-grey-2);padding:0 40px 16px}.bcm-collapse:not(.bcm-collapse--open) .bcm-collapse__header{border-bottom:none}.bcm-collapse:not(:first-child) .collapse{border-top:none}.bcm-collapse.hidden{display:none}';export{r as bcm_collapse}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{r as t,f as e,h as s,H as r,g as i}from"./p-170cf07d.js";import"./p-4798d827.js";import"./p-626a65e9.js";import{G as o}from"./p-
|
|
5
|
+
import{r as t,f as e,h as s,H as r,g as i}from"./p-170cf07d.js";import"./p-4798d827.js";import"./p-626a65e9.js";import{G as o}from"./p-83571dfd.js";import"./p-e6938871.js";import"./p-91246af3.js";import"./p-06d549b0.js";import"./p-5ae0a59b.js";import"./p-23c35e1b.js";import"./p-436364c8.js";import"./p-3c7a0345.js";import"./p-034bbcdd.js";import"./p-e45c1546.js";import"./p-e59b12e2.js";const p=class{constructor(e){t(this,e),this._id=o.UID(),this.label="",this.placeholder="",this.value="",this.required=!1,this.disabled=!1,this.readonly=!1,this.fullWidth=!1}handleChange(t){this.value=t,this.getInputElement().setValue(t),e(this.el)}getInputElement(){return this.el.querySelector("bcm-input")}getPickerElement(){return document.querySelector("#"+this._id+"-picker")}handleInputChanged(t){this.getPickerElement().color=t.detail}eyeDropper(){(new window.EyeDropper).open().then((t=>{this.handleChange(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}render(){return s(r,{class:"tw-block"},s("bcm-input",{id:this._id+"-color",fullWidth:this.fullWidth,label:this.label,placeholder:this.placeholder,type:"text","onBcm-change":t=>this.handleInputChanged(t)},s("i",{slot:"prefix",class:"tw-flex tw-h-4 tw-w-4 tw-items-center tw-justify-center tw-rounded-full tw-border tw-border-gray-100",style:{backgroundColor:this.value}}),this.isEyeDropperSupported()&&s("i",{slot:"suffix",class:"far fa-eye-dropper",onClick:()=>this.eyeDropper()})),s("bcm-linked",{targetId:this._id+"-color-container"},s("bcm-colorful",{id:this._id+"-picker",color:this.value,onBcmChange:t=>this.handleChange(t.detail)})))}get el(){return i(this)}};export{p as bcm_color_input}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{r as t,c as s,h as i,H as e,g as a}from"./p-170cf07d.js";import"./p-4798d827.js";import"./p-626a65e9.js";import{G as o}from"./p-
|
|
5
|
+
import{r as t,c as s,h as i,H as e,g as a}from"./p-170cf07d.js";import"./p-4798d827.js";import"./p-626a65e9.js";import{G as o}from"./p-83571dfd.js";import"./p-e6938871.js";import"./p-91246af3.js";import"./p-06d549b0.js";import"./p-5ae0a59b.js";import{d as h}from"./p-3c7a0345.js";import{a as r}from"./p-23c35e1b.js";import{c as l}from"./p-bed627ab.js";import"./p-436364c8.js";import"./p-034bbcdd.js";import"./p-e45c1546.js";import"./p-e59b12e2.js";const c=class{constructor(i){t(this,i),this.modalClose=s(this,"bcm-modal-close",7),this.modalOpen=s(this,"bcm-modal-open",7),this.modalBeforeClose=s(this,"bcm-modal-before-close",7),this.modalBeforeOpen=s(this,"bcm-modal-before-open",7),this._id=o.UID(),this.isShow=!1,this.center=!1,this.zIndex="10400",this.size=r.Size.medium,this.backdrop=!0,this.fullWidth=!1,this.fullScreen=!1,this.overflow=!0,this.isShowModal=!1,this.shake=!1}handleClick(t){const s=o.findEventPathHasAttribute(t,"data-dismiss"),i=t.target.attributes.getNamedItem("is-click-overlay");i&&"static"===this.backdrop?this.shakeModal():(s||i)&&(this.hide(),t.preventDefault(),t.stopPropagation())}handleKeyDown(t){Array.from(document.querySelectorAll("bcm-modal-2[is-show]")).pop()===this.el&&"Escape"===t.key&&("static"===this.backdrop?this.shakeModal():this.hide(),t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation())}shakeModal(){this.shake=!0,setTimeout((()=>this.shake=!1),300)}async hide(){this.modalBeforeClose.emit()}async hideModal(t){t.defaultPrevented||t.target===this.el&&(this.isShowModal=!1,await h(150),this.isShow=!1,this.modalClose.emit())}async show(){this.modalBeforeOpen.emit()}async showModal(t){t.defaultPrevented||t.target===this.el&&(this.isShow=!0,await h(50),this.isShowModal=!0,document.body.appendChild(this.el),this.modalOpen.emit())}getWidth(t){return{small:"576px",medium:"768px",large:"992px",xlarge:"1024px",xxlarge:"1200px",xxxlarge:"1700px"}[t]||t}setSize(){const{fullScreen:t,fullWidth:s,size:i,overflow:e}=this;let a="auto",o="auto",h=s?"100%":this.getWidth(i);return t&&(o=e?"100vh":"auto",h="100vw",a="100vh"),{width:h,minHeight:a,height:o}}render(){return i(e,{class:{"tw-hidden":!this.isShow}},i("bcm-overlay",{"z-index":+this.zIndex-1,opacity:this.isShowModal?"0.5":"0"}),i("div",{class:l("tw-fixed tw-inset-0","tw-flex tw-h-full tw-w-full tw-items-start tw-justify-center","tw-overflow-y-scroll tw-overscroll-contain tw-font-sans",this.center?"tw-items-center":""),style:{zIndex:this.zIndex},"is-click-overlay":!0},i("div",{class:l("tw-flex tw-w-full tw-flex-col","tw-relative tw-z-modal tw-bg-white","tw--translate-y-[20px] tw-transform tw-opacity-0 tw-transition tw-duration-300 tw-ease-in-out",this.fullScreen?"":`tw-m-4 tw-rounded-lg ${this.overflow?"tw-max-h-[90vh]":""} `,this.shake?"tw-animate-shake":""),style:Object.assign(Object.assign({},this.setSize()),this.isShowModal?{transform:"translateY(0)",opacity:"1"}:{})},i("slot",{name:"header"}),i("bcm-scroll-area",{"is-disabled":!this.overflow},i("slot",null)),i("slot",{name:"footer"}))))}get el(){return a(this)}};export{c as bcm_modal_2}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{r as t,c as s,h as i,H as h,g as e}from"./p-170cf07d.js";import{C as o}from"./p-4798d827.js";import"./p-626a65e9.js";import{G as r}from"./p-
|
|
5
|
+
import{r as t,c as s,h as i,H as h,g as e}from"./p-170cf07d.js";import{C as o}from"./p-4798d827.js";import"./p-626a65e9.js";import{G as r}from"./p-83571dfd.js";import"./p-e6938871.js";import{S as c}from"./p-91246af3.js";import"./p-06d549b0.js";import"./p-5ae0a59b.js";import{a}from"./p-23c35e1b.js";import{d as n}from"./p-3c7a0345.js";import{F as p}from"./p-dc8305dc.js";import"./p-436364c8.js";import"./p-034bbcdd.js";import"./p-e45c1546.js";import"./p-e59b12e2.js";class l{constructor({content:t,message:s,targetId:i,placement:h="top",color:e="slate-700",trigger:a="none",openDelay:l=0,closeDelay:w=0,autoHide:m=!1,emitShow:d=(()=>{}),emitHide:b=(()=>{})}){this.destroy=()=>{this.el=document.getElementById(this.id),this.el&&(this.el.remove(),this.emitHide()),this.removeListener()},this.target=()=>document.getElementById(this.targetId),this.init=()=>{const{tone:t,colorName:s}=o.parseColor(this.color,700),i=r.getTwColor({color:s,tones:{[t]:["bg"]},variable:"--bcm-popover"}),h=Object.assign(Object.assign({},i),i["--bcm-popover-bg"]&&{"--bcm-popover-text":o.reverseColor(i["--bcm-popover-bg"])}),e=`<div class="tw-z-[1] tw-rounded tw-py-2">\n ${this.message?`<div class="tw-font-medium tw-w-full tw-pb-1 tw-px-4">${c.trim(this.message)}</div>`:""}\n ${this.content?`<div class="tw-font-normal tw-px-4">${c.trim(this.content)}</div>`:""}\n </div>`;this.el=r.createElement("div",{id:`${this.targetId}-popover-box`,class:"\n tw-whitespace-normal tw-break-words tw-block tw-font-sans tw-pointer-events-none tw-max-w-[256px] tw-rounded tw-bg-[--bcm-popover-bg] tw-text-[--bcm-popover-text] tw-text-3 tw-absolute tw-top-0 tw-left-0 tw-z-tooltip tw-opacity-0 tw-transition-opacity tw-duration-300\n tw-shadow",role:"popover","aria-hidden":"true",style:o.generateStyleString(h),innerHTML:e})},this.update=()=>{this.el=document.getElementById(this.id),this.el&&(this.hide(),this.show())},this.listener=()=>{if(window.addEventListener("resize",this.calculatePosition.bind(this)),window.addEventListener("scroll",this.calculatePosition.bind(this),!0),window.addEventListener("wheel",this.calculatePosition.bind(this)),this.trigger&&this.target())switch(this.trigger){case"click":this.target().addEventListener("click",this.toggle.bind(this)),this.autoHide&&this.target().addEventListener("mouseleave",this.hide.bind(this));break;case"hover":this.target().addEventListener("mouseenter",this.show.bind(this)),this.target().addEventListener("mouseleave",this.hide.bind(this));break;case"focus":this.target().addEventListener("focus",this.show.bind(this),!0),this.target().addEventListener("blur",this.hide.bind(this),!0)}this.calculatePosition()},this.removeListener=()=>{window.removeEventListener("resize",this.calculatePosition.bind(this)),window.removeEventListener("scroll",this.calculatePosition.bind(this),!0),window.removeEventListener("wheel",this.calculatePosition.bind(this)),this.target()&&(this.target().removeEventListener("click",this.toggle.bind(this)),this.target().removeEventListener("mouseenter",this.show.bind(this)),this.target().removeEventListener("mouseleave",this.hide.bind(this)),this.target().removeEventListener("focus",this.show.bind(this),!0),this.target().removeEventListener("blur",this.hide.bind(this),!0))},this.calculatePosition=()=>{this.el=document.getElementById(this.id),this.el&&p({ref:this.target(),floating:this.el,placement:this.placement,offset:8,arrow:!0,arrowColor:"tw-bg-[--bcm-popover-bg]"})},this.show=async()=>{this.message?(this.init(),await n(this.openDelay),this.calculatePosition(),this.emitShow()):this.hide()},this.hide=async()=>{this.el=document.getElementById(this.id),this.el&&(await n(this.closeDelay),this.el.remove(),this.emitHide())},this.toggle=()=>{this.el=document.getElementById(this.id),this.el?this.hide():this.show()},this.content=t,this.message=s,this.targetId=i,this.placement=h,this.color=e,this.trigger=a,this.id=i+"-popover-box",this.openDelay=l,this.closeDelay=w,this.autoHide=m,this.emitShow=d,this.emitHide=b}}const w=class{constructor(i){t(this,i),this.bcmPopoverShow=s(this,"bcmPopoverShow",7),this.bcmPopoverHide=s(this,"bcmPopoverHide",7),this._id=r.UID(),this.message="",this.content="",this.placement=a.Placement.top,this.trigger=a.TriggerType.click,this.open=!1,this.color="white",this.openDelay=0,this.closeDelay=0,this.autoHide=!1,this.targetId=void 0,this.popover=void 0}emitShow(){this.bcmPopoverShow.emit()}emitHide(){this.bcmPopoverHide.emit()}connectedCallback(){this.popover=new l({targetId:this.targetId||this._id,content:this.content,message:this.message,placement:this.placement,color:this.color,trigger:this.trigger,openDelay:this.openDelay,closeDelay:this.closeDelay,autoHide:this.autoHide,emitShow:()=>this.emitShow(),emitHide:()=>this.emitHide()})}componentDidLoad(){this.popover.listener()}componentDidRender(){const{content:t,message:s,placement:i,color:h,trigger:e}=this;this.popover.content=t,this.popover.message=s,this.popover.placement=i,this.popover.color=h,this.popover.trigger=e,this.popover.openDelay=this.openDelay,this.popover.closeDelay=this.closeDelay,this.popover.autoHide=this.autoHide,this.popover.update()}disconnectedCallback(){this.popover.destroy()}async show(){this.popover.show()}async hide(){this.popover.hide()}async toggle(){this.popover.toggle()}render(){return i(h,{class:"tw-inline-flex tw-h-fit tw-w-fit",role:"tooltip","aria-hidden":"true"},i("slot",null))}get el(){return e(this)}};export{w as bcm_popover}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{r as i,c,h as e,H as t,g as o}from"./p-170cf07d.js";import{c as s}from"./p-bed627ab.js";import{C as a}from"./p-4798d827.js";import{G as h}from"./p-
|
|
5
|
+
import{r as i,c,h as e,H as t,g as o}from"./p-170cf07d.js";import{c as s}from"./p-bed627ab.js";import{C as a}from"./p-4798d827.js";import{G as h}from"./p-83571dfd.js";import"./p-e45c1546.js";import"./p-436364c8.js";import"./p-3c7a0345.js";import"./p-034bbcdd.js";import"./p-e59b12e2.js";const p=class{constructor(e){i(this,e),this.bcmChipDismiss=c(this,"bcm-chip-dismiss",7),this.bcmChipSelect=c(this,"bcm-chip-select",7),this.bcmChipAddable=c(this,"bcm-chip-addable",7),this.bcmChipSelectItem=c(this,"bcm-chip-select-item",7),this._id=h.UID(),this.type="default",this.size="medium",this.avatar=void 0,this.icon=void 0,this.disabled=void 0,this.color=void 0,this.selected=!1,this.value=void 0,this.data=[]}setColor(){if(!this.color&&!this.selected)return;const i=this.selected?"indigo":this.color;return{"--bcm-chip-color":a.dsColor(i+"-500"),"--bcm-chip-color-hover":a.dsColor(i+"-500"),"--bcm-chip-color-focus":a.dsColor(i+"-600"),"--bcm-chip-color-active":a.dsColor(i+"-700"),"--bcm-chip-color-disabled":a.dsColor("slate-300"),"--bcm-chip-background-color":a.dsColor(i+"-100"),"--bcm-chip-background-color-hover":a.dsColor(i+"-200"),"--bcm-chip-background-color-focus":a.dsColor(i+"-300"),"--bcm-chip-background-color-active":a.dsColor(i+"-200"),"--bcm-chip-background-color-disabled":a.dsColor("slate-100")}}handleDismiss(i){i.stopPropagation(),i.preventDefault(),this.bcmChipDismiss.emit(this.el)}handleAddable(i){i.stopPropagation(),i.preventDefault(),this.bcmChipAddable.emit(this.el)}listSelectedItems(i){i.stopPropagation(),i.preventDefault(),i.detail&&(this.bcmChipSelectItem.emit(i.detail),i.target.setClear(),this.data=this.data.filter((c=>c.id!==i.detail.id)))}render(){const{type:i,size:c,avatar:o,disabled:a,color:h}=this,p=s("bcm-chip",`bcm-chip__type-${i}`,`bcm-chip__size-${c}`,{"bcm-chip--disabled":a,"bcm-chip--avatar":o});return e(t,{class:p,tabindex:"0",disabled:a,style:this.setColor(),onClick:i=>this.bcmChipSelect.emit(i)},e("div",{class:s(this.selected?"bcm-chip--selected-icon":"tw-hidden tw-w-0")},e("bcm-icon",{icon:"fal fa-check"})),o&&e("bcm-avatar",Object.assign({size:c},h&&{color:h},o&&{image:o})),"addable"===i&&e("span",{class:"bcm-chip__left"},e("bcm-icon",{onClick:i=>this.handleAddable(i),icon:"far fa-plus"})),e("slot",null),"dismissable"===i&&e("span",{class:"bcm-chip__type-dismissable-icon"},e("bcm-icon",{onClick:i=>this.handleDismiss(i),icon:"fal fa-times"})),this.data&&this.data.length>0&&e("bcm-list",{"onBcm-change":i=>this.listSelectedItems(i),id:this._id+"-list",data:this.data,linkedComponent:this._id,searchable:!0,highlight:!0}))}get el(){return o(this)}};p.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-chip{--bcm-chip-color:var(--bcm-new-ds-color-slate-500);--bcm-chip-color-hover:var(--bcm-new-ds-color-slate-500);--bcm-chip-color-focus:var(--bcm-new-ds-color-slate-700);--bcm-chip-color-active:var(--bcm-new-ds-color-slate-700);--bcm-chip-color-disabled:var(--bcm-new-ds-color-slate-300);--bcm-chip-background-color:var(--bcm-new-ds-color-slate-200);--bcm-chip-background-color-hover:var(--bcm-new-ds-color-slate-300);--bcm-chip-background-color-focus:var(--bcm-new-ds-color-slate-300);--bcm-chip-background-color-active:var(--bcm-new-ds-color-slate-400);--bcm-chip-background-color-disabled:var(--bcm-new-ds-color-slate-100);display:inline-flex;justify-content:center;align-items:center;width:fit-content;height:fit-content;font-family:"Inter", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;padding:0 8px;gap:4px;color:var(--bcm-chip-color);background-color:var(--bcm-chip-background-color);border-radius:100px;transition:background-color 0.1s ease-in-out;outline:none}.bcm-chip:not(.bcm-chip--disabled):hover{background-color:var(--bcm-chip-background-color-hover)}.bcm-chip:not(.bcm-chip--disabled):focus{background-color:var(--bcm-chip-background-color-focus);color:var(--bcm-chip-color-focus)}.bcm-chip:not(.bcm-chip--disabled):active{background-color:var(--bcm-chip-background-color-active);color:var(--bcm-chip-color-active)}.bcm-chip--disabled{color:var(--bcm-chip-color-disabled);background-color:var(--bcm-chip-background-color-disabled)}.bcm-chip--avatar{padding-left:2px}.bcm-chip__type-dismissable-icon:hover{cursor:pointer;color:var(--bcm-chip-color-active)}.bcm-chip__size-small{font-size:10px;line-height:calc(10px + 8px)}.bcm-chip__size-small .bcm-avatar{width:14px;height:14px}.bcm-chip__size-small .bcm-chip--selected-icon{width:8px}.bcm-chip__size-medium{font-size:12px;line-height:calc(12px + 8px)}.bcm-chip__size-medium .bcm-avatar{width:16px;height:16px}.bcm-chip__size-medium .bcm-chip--selected-icon{width:10px}.bcm-chip__size-large{font-size:14px;line-height:calc(14px + 8px)}.bcm-chip__size-large .bcm-avatar{width:18px;height:18px}.bcm-chip__size-large .bcm-chip--selected-icon{width:12px}';export{p as bcm_chip}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{r as i,c as e,h as t,H as c,g as s}from"./p-170cf07d.js";import{c as n}from"./p-bed627ab.js";import{I as a}from"./p-3ade1099.js";import{G as o}from"./p-e7cbc79a.js";import{B as l}from"./p-23c35e1b.js";import{C as r}from"./p-e1877ee9.js";import{d as h}from"./p-3c7a0345.js";import"./p-e45c1546.js";import"./p-a89cff9b.js";import"./p-034bbcdd.js";const m=class{constructor(t){i(this,t),this.change=e(this,"bcm-change",7),this.focus=e(this,"bcm-focus",7),this.blur=e(this,"bcm-blur",7),this._id=o.UID(),this._internal_id=o.UID(),this.checked=!1,this.hidden=!1,this.value=!1,this.name=void 0,this.disabled=!1,this.required=!1,this.size=l.Size.medium,this.readonly=!1,this.activeIcon=void 0,this.activeText=void 0,this.inactiveIcon=void 0,this.inactiveText=void 0,this.pending=!1,this.label=void 0,this.labelPosition="top",this.tooltip=void 0,this.caption=void 0,this.noCaption=!1,this.captionError=void 0,this.captionType=l.Status.default,this.captionCache=void 0,this.captionTypeCache=void 0}connectedCallback(){this.captionCache=this.caption,this.captionTypeCache=this.captionType,this.value=this.checked}handleChange(){this.checked=this.inputElement.checked,this.value=this.checked,this.change.emit(this.checked)}componentWillRender(){this.pending&&(this.disabled=!0)}async onBcmFocus(){this.el.focus()}async onBcmBlur(){this.el.blur()}async set(i){"boolean"==typeof i&&await this.check(i)}async check(i=!0){this.inputElement.checked=i,this.handleChange()}async get(){return this.checked||!1}async setClear(){return 1==this.inputElement.checked&&(this.inputElement.checked=!1,this.checked=this.inputElement.checked,this.value=this.checked,this.change.emit(this.checked)),await h(10),Promise.resolve()}async resetCaption(){return await h(10),this.caption=this.captionCache,this.captionType=this.captionTypeCache,this.captionError=null,await h(10),Promise.resolve()}handleKeyUp(i){if(i.keyCode==l.KeyCode.space||i.keyCode==l.KeyCode.enter)return this.disabled||this.readonly||(this.inputElement.checked=!this.inputElement.checked,this.handleChange()),i.stopPropagation(),i.preventDefault(),!1}render(){const{hidden:i,_internal_id:e,checked:s,size:a,activeIcon:o,inactiveIcon:h,activeText:m,inactiveText:p,pending:b,disabled:g,readonly:d,label:x,required:_,noCaption:w,captionType:f,captionError:u,caption:z}=this,v=n("bcm-switch__toggle","bcm-switch__size-"+a,{"switch-checked":s,disabled:g,readonly:d}),y=n("bcm-switch","bcm-switch__size-"+a,{hidden:i,checked:s,disabled:g,readonly:d}),k=n("bcm-switch__label","input-size-"+l.Size[a]),j=n("bcm-switch__container",`bcm-switch__container--${this.labelPosition}`),I=i=>a!=l.Size.small&&(m||p)&&t("span",{class:i+"-text"},"active"==i?m:p),C=i=>a!=l.Size.small&&(o||h)&&t("bcm-icon",{icon:"active"==i?o:h,class:" icon-"+i});return t(c,{tabindex:"0",onFocus:()=>this.focus.emit(this.el),onBlur:()=>this.blur.emit(this.el),class:y},t("span",{hidden:!0},t("slot",null)),t("div",{class:j},x&&t("bcm-label",{htmlFor:e,tooltip:this.tooltip,type:f,value:x,required:_}),t("input",{id:e,onChange:()=>this.handleChange(),ref:i=>this.inputElement=i,checked:s,type:"checkbox",class:"switch",disabled:g||d}),t("label",{htmlFor:e,class:k},I("inactive"),t("div",{class:v},C("active"),t("span",{class:"handle"},b&&t("span",{class:"switch-spinner"})),C("inactive")),I("active"))),t(r,{noCaption:w,captionType:f,captionError:u,caption:z}))}get el(){return s(this)}};(function(i,e,t,c){var s,n=arguments.length,a=n<3?e:null===c?c=Object.getOwnPropertyDescriptor(e,t):c;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(i,e,t,c);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);n>3&&a&&Object.defineProperty(e,t,a)})([a()],m.prototype,"el",void 0),m.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-switch{display:inline-flex;user-select:none;flex-direction:column;margin-bottom:8px}.bcm-switch__container{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start}.bcm-switch__container--left,.bcm-switch__container--right{align-items:center}.bcm-switch__container--left .bcm-label__text,.bcm-switch__container--right .bcm-label__text{margin:0}.bcm-switch__container--left{flex-direction:row}.bcm-switch__container--left .bcm-label__text{margin-right:4px}.bcm-switch__container--right{flex-direction:row-reverse}.bcm-switch__container--right .bcm-label__text{margin-left:4px}.bcm-switch:focus-visible{outline:none}.bcm-switch:focus-visible .bcm-switch__toggle{background-color:var(--bcm-new-ds-color-slate-400)}.bcm-switch:focus-visible .bcm-switch__toggle.switch-checked{background-color:var(--bcm-new-ds-color-blue-600)}.bcm-switch:hover{outline:none}.bcm-switch:hover .bcm-switch__toggle .handle{background-color:var(--bcm-new-ds-color-slate-100)}.bcm-switch:hover .bcm-switch__toggle.switch-checked .handle{background-color:var(--bcm-new-ds-color-slate-100)}.bcm-switch *{box-sizing:border-box}.bcm-switch.hidden{display:none}.bcm-switch input{display:none}.bcm-switch.disabled .bcm-switch__toggle{cursor:not-allowed;opacity:40%}.bcm-switch.readonly .bcm-switch__toggle{cursor:default;opacity:80%}.bcm-switch__label{font-family:"Inter", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;display:inline-flex;align-items:center;margin:0}.bcm-switch__label .active-text{color:var(--bcm-new-ds-color-blue-500);margin:0 0 0 4px}.bcm-switch__label .inactive-text{color:var(--bcm-new-ds-color-slate-500);margin:0 4px 0 0}.bcm-switch__toggle{display:flex;justify-content:space-between;align-items:center;border-radius:16px;background-color:var(--bcm-new-ds-color-slate-300);position:relative;cursor:pointer}.bcm-switch__toggle .handle{padding:1px;position:absolute;background-color:var(--bcm-new-ds-color-slate-50);display:inline-flex;align-items:center;justify-content:center;border-radius:16px;transition:left 0.2s ease-in-out, width 0.2s ease-in-out;box-shadow:0 1px 3px 0 rgba(17, 24, 38, 0.1)}.bcm-switch__toggle .icon-active{opacity:0;margin-left:2px}.bcm-switch__toggle .icon-inactive{opacity:1;margin-right:2px}.bcm-switch__toggle.bcm-switch__size-small{width:32px;min-width:32px;height:16px;padding:4px}.bcm-switch__toggle.bcm-switch__size-small .handle{width:12px;height:12px;left:2px}.bcm-switch__toggle.bcm-switch__size-small.switch-checked .handle{left:18px}.bcm-switch__toggle.bcm-switch__size-small:active:not(.disabled):not(.readonly) .handle{width:16px}.bcm-switch__toggle.bcm-switch__size-small:active.switch-checked:not(.disabled):not(.readonly) .handle{left:12px}.bcm-switch__toggle.bcm-switch__size-small .switch-spinner{box-sizing:border-box;display:inline-flex;width:9px;height:9px;border-radius:50%;border:1px solid var(--bcm-new-ds-color-white);border-top-color:var(--bcm-new-ds-color-slate-900);animation:switch-spinner 1.5s linear infinite}.bcm-switch__toggle.bcm-switch__size-medium{width:36px;min-width:36px;height:18px;padding:4px}.bcm-switch__toggle.bcm-switch__size-medium .handle{width:14px;height:14px;left:2px}.bcm-switch__toggle.bcm-switch__size-medium.switch-checked .handle{left:20px}.bcm-switch__toggle.bcm-switch__size-medium:active:not(.disabled):not(.readonly) .handle{width:18px}.bcm-switch__toggle.bcm-switch__size-medium:active.switch-checked:not(.disabled):not(.readonly) .handle{left:14px}.bcm-switch__toggle.bcm-switch__size-medium .switch-spinner{box-sizing:border-box;display:inline-flex;width:11px;height:11px;border-radius:50%;border:1px solid var(--bcm-new-ds-color-white);border-top-color:var(--bcm-new-ds-color-slate-900);animation:switch-spinner 1.5s linear infinite}.bcm-switch__toggle.bcm-switch__size-large{width:40px;min-width:40px;height:20px;padding:4px}.bcm-switch__toggle.bcm-switch__size-large .handle{width:16px;height:16px;left:2px}.bcm-switch__toggle.bcm-switch__size-large.switch-checked .handle{left:22px}.bcm-switch__toggle.bcm-switch__size-large:active:not(.disabled):not(.readonly) .handle{width:20px}.bcm-switch__toggle.bcm-switch__size-large:active.switch-checked:not(.disabled):not(.readonly) .handle{left:16px}.bcm-switch__toggle.bcm-switch__size-large .switch-spinner{box-sizing:border-box;display:inline-flex;width:13px;height:13px;border-radius:50%;border:1px solid var(--bcm-new-ds-color-white);border-top-color:var(--bcm-new-ds-color-slate-900);animation:switch-spinner 1.5s linear infinite}.bcm-switch__toggle.switch-checked{background-color:var(--bcm-new-ds-color-blue-500)}.bcm-switch__toggle.switch-checked .icon-active{color:var(--bcm-new-ds-color-slate-100);opacity:1}.bcm-switch__toggle.switch-checked .icon-inactive{opacity:0}.bcm-switch__toggle.switch-checked .switch-spinner{border-top-color:var(--bcm-new-ds-color-blue-600)}.bcm-switch__size-small .bcm-switch__label,.bcm-switch__size-small .bcm-label__text{font-size:12px}.bcm-switch__size-small .bcm-switch__toggle{font-size:8px}.bcm-switch__size-medium .bcm-switch__label,.bcm-switch__size-medium .bcm-label__text{font-size:13px}.bcm-switch__size-medium .bcm-switch__toggle{font-size:9px}.bcm-switch__size-large .bcm-switch__label,.bcm-switch__size-large .bcm-label__text{font-size:16px}.bcm-switch__size-large .bcm-switch__toggle{font-size:12px}@keyframes switch-spinner{to{transform:rotate(360deg)}}';export{m as bcm_switch}
|
|
5
|
+
import{r as i,c as e,h as t,H as c,g as s}from"./p-170cf07d.js";import{c as n}from"./p-bed627ab.js";import{I as a}from"./p-3ade1099.js";import{G as o}from"./p-83571dfd.js";import{B as l}from"./p-23c35e1b.js";import{C as r}from"./p-e1877ee9.js";import{d as h}from"./p-3c7a0345.js";import"./p-e45c1546.js";import"./p-e59b12e2.js";import"./p-034bbcdd.js";const m=class{constructor(t){i(this,t),this.change=e(this,"bcm-change",7),this.focus=e(this,"bcm-focus",7),this.blur=e(this,"bcm-blur",7),this._id=o.UID(),this._internal_id=o.UID(),this.checked=!1,this.hidden=!1,this.value=!1,this.name=void 0,this.disabled=!1,this.required=!1,this.size=l.Size.medium,this.readonly=!1,this.activeIcon=void 0,this.activeText=void 0,this.inactiveIcon=void 0,this.inactiveText=void 0,this.pending=!1,this.label=void 0,this.labelPosition="top",this.tooltip=void 0,this.caption=void 0,this.noCaption=!1,this.captionError=void 0,this.captionType=l.Status.default,this.captionCache=void 0,this.captionTypeCache=void 0}connectedCallback(){this.captionCache=this.caption,this.captionTypeCache=this.captionType,this.value=this.checked}handleChange(){this.checked=this.inputElement.checked,this.value=this.checked,this.change.emit(this.checked)}componentWillRender(){this.pending&&(this.disabled=!0)}async onBcmFocus(){this.el.focus()}async onBcmBlur(){this.el.blur()}async set(i){"boolean"==typeof i&&await this.check(i)}async check(i=!0){this.inputElement.checked=i,this.handleChange()}async get(){return this.checked||!1}async setClear(){return 1==this.inputElement.checked&&(this.inputElement.checked=!1,this.checked=this.inputElement.checked,this.value=this.checked,this.change.emit(this.checked)),await h(10),Promise.resolve()}async resetCaption(){return await h(10),this.caption=this.captionCache,this.captionType=this.captionTypeCache,this.captionError=null,await h(10),Promise.resolve()}handleKeyUp(i){if(i.keyCode==l.KeyCode.space||i.keyCode==l.KeyCode.enter)return this.disabled||this.readonly||(this.inputElement.checked=!this.inputElement.checked,this.handleChange()),i.stopPropagation(),i.preventDefault(),!1}render(){const{hidden:i,_internal_id:e,checked:s,size:a,activeIcon:o,inactiveIcon:h,activeText:m,inactiveText:p,pending:b,disabled:g,readonly:d,label:x,required:_,noCaption:w,captionType:f,captionError:u,caption:z}=this,v=n("bcm-switch__toggle","bcm-switch__size-"+a,{"switch-checked":s,disabled:g,readonly:d}),y=n("bcm-switch","bcm-switch__size-"+a,{hidden:i,checked:s,disabled:g,readonly:d}),k=n("bcm-switch__label","input-size-"+l.Size[a]),j=n("bcm-switch__container",`bcm-switch__container--${this.labelPosition}`),I=i=>a!=l.Size.small&&(m||p)&&t("span",{class:i+"-text"},"active"==i?m:p),C=i=>a!=l.Size.small&&(o||h)&&t("bcm-icon",{icon:"active"==i?o:h,class:" icon-"+i});return t(c,{tabindex:"0",onFocus:()=>this.focus.emit(this.el),onBlur:()=>this.blur.emit(this.el),class:y},t("span",{hidden:!0},t("slot",null)),t("div",{class:j},x&&t("bcm-label",{htmlFor:e,tooltip:this.tooltip,type:f,value:x,required:_}),t("input",{id:e,onChange:()=>this.handleChange(),ref:i=>this.inputElement=i,checked:s,type:"checkbox",class:"switch",disabled:g||d}),t("label",{htmlFor:e,class:k},I("inactive"),t("div",{class:v},C("active"),t("span",{class:"handle"},b&&t("span",{class:"switch-spinner"})),C("inactive")),I("active"))),t(r,{noCaption:w,captionType:f,captionError:u,caption:z}))}get el(){return s(this)}};(function(i,e,t,c){var s,n=arguments.length,a=n<3?e:null===c?c=Object.getOwnPropertyDescriptor(e,t):c;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(i,e,t,c);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);n>3&&a&&Object.defineProperty(e,t,a)})([a()],m.prototype,"el",void 0),m.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-switch{display:inline-flex;user-select:none;flex-direction:column;margin-bottom:8px}.bcm-switch__container{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start}.bcm-switch__container--left,.bcm-switch__container--right{align-items:center}.bcm-switch__container--left .bcm-label__text,.bcm-switch__container--right .bcm-label__text{margin:0}.bcm-switch__container--left{flex-direction:row}.bcm-switch__container--left .bcm-label__text{margin-right:4px}.bcm-switch__container--right{flex-direction:row-reverse}.bcm-switch__container--right .bcm-label__text{margin-left:4px}.bcm-switch:focus-visible{outline:none}.bcm-switch:focus-visible .bcm-switch__toggle{background-color:var(--bcm-new-ds-color-slate-400)}.bcm-switch:focus-visible .bcm-switch__toggle.switch-checked{background-color:var(--bcm-new-ds-color-blue-600)}.bcm-switch:hover{outline:none}.bcm-switch:hover .bcm-switch__toggle .handle{background-color:var(--bcm-new-ds-color-slate-100)}.bcm-switch:hover .bcm-switch__toggle.switch-checked .handle{background-color:var(--bcm-new-ds-color-slate-100)}.bcm-switch *{box-sizing:border-box}.bcm-switch.hidden{display:none}.bcm-switch input{display:none}.bcm-switch.disabled .bcm-switch__toggle{cursor:not-allowed;opacity:40%}.bcm-switch.readonly .bcm-switch__toggle{cursor:default;opacity:80%}.bcm-switch__label{font-family:"Inter", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;display:inline-flex;align-items:center;margin:0}.bcm-switch__label .active-text{color:var(--bcm-new-ds-color-blue-500);margin:0 0 0 4px}.bcm-switch__label .inactive-text{color:var(--bcm-new-ds-color-slate-500);margin:0 4px 0 0}.bcm-switch__toggle{display:flex;justify-content:space-between;align-items:center;border-radius:16px;background-color:var(--bcm-new-ds-color-slate-300);position:relative;cursor:pointer}.bcm-switch__toggle .handle{padding:1px;position:absolute;background-color:var(--bcm-new-ds-color-slate-50);display:inline-flex;align-items:center;justify-content:center;border-radius:16px;transition:left 0.2s ease-in-out, width 0.2s ease-in-out;box-shadow:0 1px 3px 0 rgba(17, 24, 38, 0.1)}.bcm-switch__toggle .icon-active{opacity:0;margin-left:2px}.bcm-switch__toggle .icon-inactive{opacity:1;margin-right:2px}.bcm-switch__toggle.bcm-switch__size-small{width:32px;min-width:32px;height:16px;padding:4px}.bcm-switch__toggle.bcm-switch__size-small .handle{width:12px;height:12px;left:2px}.bcm-switch__toggle.bcm-switch__size-small.switch-checked .handle{left:18px}.bcm-switch__toggle.bcm-switch__size-small:active:not(.disabled):not(.readonly) .handle{width:16px}.bcm-switch__toggle.bcm-switch__size-small:active.switch-checked:not(.disabled):not(.readonly) .handle{left:12px}.bcm-switch__toggle.bcm-switch__size-small .switch-spinner{box-sizing:border-box;display:inline-flex;width:9px;height:9px;border-radius:50%;border:1px solid var(--bcm-new-ds-color-white);border-top-color:var(--bcm-new-ds-color-slate-900);animation:switch-spinner 1.5s linear infinite}.bcm-switch__toggle.bcm-switch__size-medium{width:36px;min-width:36px;height:18px;padding:4px}.bcm-switch__toggle.bcm-switch__size-medium .handle{width:14px;height:14px;left:2px}.bcm-switch__toggle.bcm-switch__size-medium.switch-checked .handle{left:20px}.bcm-switch__toggle.bcm-switch__size-medium:active:not(.disabled):not(.readonly) .handle{width:18px}.bcm-switch__toggle.bcm-switch__size-medium:active.switch-checked:not(.disabled):not(.readonly) .handle{left:14px}.bcm-switch__toggle.bcm-switch__size-medium .switch-spinner{box-sizing:border-box;display:inline-flex;width:11px;height:11px;border-radius:50%;border:1px solid var(--bcm-new-ds-color-white);border-top-color:var(--bcm-new-ds-color-slate-900);animation:switch-spinner 1.5s linear infinite}.bcm-switch__toggle.bcm-switch__size-large{width:40px;min-width:40px;height:20px;padding:4px}.bcm-switch__toggle.bcm-switch__size-large .handle{width:16px;height:16px;left:2px}.bcm-switch__toggle.bcm-switch__size-large.switch-checked .handle{left:22px}.bcm-switch__toggle.bcm-switch__size-large:active:not(.disabled):not(.readonly) .handle{width:20px}.bcm-switch__toggle.bcm-switch__size-large:active.switch-checked:not(.disabled):not(.readonly) .handle{left:16px}.bcm-switch__toggle.bcm-switch__size-large .switch-spinner{box-sizing:border-box;display:inline-flex;width:13px;height:13px;border-radius:50%;border:1px solid var(--bcm-new-ds-color-white);border-top-color:var(--bcm-new-ds-color-slate-900);animation:switch-spinner 1.5s linear infinite}.bcm-switch__toggle.switch-checked{background-color:var(--bcm-new-ds-color-blue-500)}.bcm-switch__toggle.switch-checked .icon-active{color:var(--bcm-new-ds-color-slate-100);opacity:1}.bcm-switch__toggle.switch-checked .icon-inactive{opacity:0}.bcm-switch__toggle.switch-checked .switch-spinner{border-top-color:var(--bcm-new-ds-color-blue-600)}.bcm-switch__size-small .bcm-switch__label,.bcm-switch__size-small .bcm-label__text{font-size:12px}.bcm-switch__size-small .bcm-switch__toggle{font-size:8px}.bcm-switch__size-medium .bcm-switch__label,.bcm-switch__size-medium .bcm-label__text{font-size:13px}.bcm-switch__size-medium .bcm-switch__toggle{font-size:9px}.bcm-switch__size-large .bcm-switch__label,.bcm-switch__size-large .bcm-label__text{font-size:16px}.bcm-switch__size-large .bcm-switch__toggle{font-size:12px}@keyframes switch-spinner{to{transform:rotate(360deg)}}';export{m as bcm_switch}
|
|
@@ -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 s,g as r}from"./p-170cf07d.js";import"./p-4798d827.js";import"./p-626a65e9.js";import{G as o}from"./p-
|
|
5
|
+
import{r as t,h as e,H as s,g as r}from"./p-170cf07d.js";import"./p-4798d827.js";import"./p-626a65e9.js";import{G as o}from"./p-83571dfd.js";import"./p-e6938871.js";import"./p-91246af3.js";import"./p-06d549b0.js";import"./p-5ae0a59b.js";import"./p-23c35e1b.js";import"./p-436364c8.js";import"./p-3c7a0345.js";import"./p-034bbcdd.js";import"./p-e45c1546.js";import"./p-e59b12e2.js";const p=class{constructor(e){t(this,e),this._id=o.UID(),this.el.slot="header"}render(){return e(s,{class:"tw-w-full tw-flex-none tw-overflow-hidden tw-rounded-t-lg tw-bg-primary-400 tw-pt-1"},e("div",{class:"tw-flex tw-w-full tw-items-center tw-justify-between tw-bg-primary-50 tw-px-4 tw-py-3 tw-text-4 tw-font-medium tw-text-slate-600"},e("span",null,e("slot",null)),e("button",{type:"button",class:"tw-focus:tw-outline-none tw-flex tw-h-8 tw-w-8 tw-cursor-pointer tw-items-center tw-justify-center tw-bg-transparent tw-text-5 tw-text-slate-700 tw-transition tw-duration-150 tw-ease-in-out hover:tw-text-slate-900","data-dismiss":!0},e("i",{class:"far fa-times"}))))}get el(){return r(this)}};export{p as bcm_modal_2_header}
|
|
@@ -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
|
|
5
|
+
import{r as e,c as t,h as i,H as s,g as r}from"./p-170cf07d.js";import{G as a,s as o,S as l,T as p}from"./p-83571dfd.js";import{c as n}from"./p-bed627ab.js";import{c}from"./p-74e6d2b6.js";import{S as h}from"./p-91246af3.js";import"./p-e59b12e2.js";import"./p-034bbcdd.js";import"./p-e45c1546.js";import"./p-23c35e1b.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=a.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"}),a.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:r,icon:a,bigIcon:o,_title:l,hidden:p,dismissible:c,description:h}=this,m=n("bcm-alert","bcm-alert__type-"+r,"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||a)&&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 r(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}
|
|
@@ -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-170cf07d.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-170cf07d.js";import{G as n,s}from"./p-83571dfd.js";import{B as a}from"./p-23c35e1b.js";import{c as p}from"./p-bed627ab.js";import{S as c}from"./p-91246af3.js";import"./p-e59b12e2.js";import"./p-034bbcdd.js";import"./p-e45c1546.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}
|