bromcom-ui 2.12.3-rc.2-test.1 → 2.12.3-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
- package/dist/bromcom-ui/{p-9ba753bf.js → p-1830cdf1.js} +1 -1
- package/dist/bromcom-ui/{p-eedcbbc4.entry.js → p-18dbbd45.entry.js} +1 -1
- package/dist/bromcom-ui/{p-c812208d.entry.js → p-214834d8.entry.js} +1 -1
- package/dist/bromcom-ui/{p-8c5ed9b1.entry.js → p-271c5e3c.entry.js} +1 -1
- package/dist/bromcom-ui/{p-37cd0612.js → p-27d9f02a.js} +1 -1
- package/dist/bromcom-ui/{p-e2cdea59.entry.js → p-2d10739e.entry.js} +1 -1
- package/dist/bromcom-ui/{p-cd1b099c.entry.js → p-2ed86248.entry.js} +1 -1
- package/dist/bromcom-ui/p-3971c237.entry.js +5 -0
- package/dist/bromcom-ui/{p-5dbe699b.entry.js → p-4e31f894.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a1e2fa92.entry.js → p-5b03442c.entry.js} +1 -1
- package/dist/bromcom-ui/{p-9b0ba7ad.entry.js → p-6b3a6d60.entry.js} +1 -1
- package/dist/bromcom-ui/{p-bddc9310.entry.js → p-6b9f10a7.entry.js} +1 -1
- package/dist/bromcom-ui/p-81d248d8.js +5 -0
- package/dist/bromcom-ui/{p-1b645ef9.entry.js → p-856cb58c.entry.js} +1 -1
- package/dist/bromcom-ui/{p-43c4d268.entry.js → p-8ea0e777.entry.js} +1 -1
- package/dist/bromcom-ui/{p-87558819.entry.js → p-9bfba564.entry.js} +1 -1
- package/dist/bromcom-ui/{p-1fcdb8ee.entry.js → p-9c94733a.entry.js} +1 -1
- package/dist/bromcom-ui/{p-f151ffce.entry.js → p-9d71cecb.entry.js} +1 -1
- package/dist/bromcom-ui/{p-3ba6c610.js → p-a5d58be8.js} +1 -1
- package/dist/bromcom-ui/{p-20a3d051.entry.js → p-a9388655.entry.js} +1 -1
- package/dist/bromcom-ui/{p-cbbc036b.js → p-af8674da.js} +1 -1
- package/dist/bromcom-ui/{p-9df8995e.entry.js → p-b43e06b4.entry.js} +1 -1
- package/dist/bromcom-ui/{p-510d5aa8.entry.js → p-b72ad073.entry.js} +1 -1
- package/dist/bromcom-ui/{p-4233e5f7.entry.js → p-b8678480.entry.js} +1 -1
- package/dist/bromcom-ui/{p-aabb32f3.entry.js → p-bf0abe3f.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a50a79c9.entry.js → p-c3387cb1.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e0223a0f.entry.js → p-d54ecc8a.entry.js} +1 -1
- package/dist/bromcom-ui/{p-7d2993dc.entry.js → p-d7194c4d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-daeda8d3.entry.js → p-df76af7c.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a400b4c4.entry.js → p-e0369655.entry.js} +1 -1
- package/dist/bromcom-ui/{p-06a548ce.entry.js → p-ebc7d5eb.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e94abd6c.entry.js → p-f210c256.entry.js} +1 -1
- package/dist/bromcom-ui/{p-2747bf2a.entry.js → p-fae6b16a.entry.js} +1 -1
- package/dist/cjs/bcm-accordion_63.cjs.entry.js +4 -4
- package/dist/cjs/bcm-alert.cjs.entry.js +2 -2
- package/dist/cjs/bcm-attendance-actions-comment.cjs.entry.js +4 -4
- package/dist/cjs/bcm-attendance-actions-dropdown.cjs.entry.js +4 -4
- package/dist/cjs/bcm-breadcrumb.cjs.entry.js +2 -2
- package/dist/cjs/bcm-caption.cjs.entry.js +4 -4
- package/dist/cjs/bcm-card.cjs.entry.js +2 -2
- package/dist/cjs/bcm-chip-group.cjs.entry.js +4 -4
- package/dist/cjs/bcm-date-picker.cjs.entry.js +2 -2
- package/dist/cjs/bcm-datetime-picker.cjs.entry.js +2 -2
- package/dist/cjs/bcm-default.cjs.entry.js +2 -2
- package/dist/cjs/bcm-form-2.cjs.entry.js +2 -2
- package/dist/cjs/bcm-input-2.cjs.entry.js +2 -2
- package/dist/cjs/bcm-input-custom.cjs.entry.js +2 -2
- package/dist/cjs/bcm-input-dropdown.cjs.entry.js +4 -4
- package/dist/cjs/bcm-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-number-input.cjs.entry.js +4 -4
- package/dist/cjs/bcm-popover.cjs.entry.js +4 -4
- package/dist/cjs/bcm-range.cjs.entry.js +2 -2
- package/dist/cjs/bcm-skeleton.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 +2 -2
- package/dist/cjs/bromcom-ui.cjs.js +2 -2
- package/dist/cjs/{generate-69d5c345.js → generate-beac9c8d.js} +1 -1
- package/dist/cjs/{global-7e2d5892.js → global-d4be0c46.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{number-helper-a60b43f9.js → number-helper-46c7892f.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-6a1205fc.js → package-e6628eb2.js} +1 -1
- package/dist/cjs/{validators-cd8eedf1.js → validators-27568118.js} +1 -1
- package/dist/components/generate.js +1 -1
- package/dist/esm/bcm-accordion_63.entry.js +4 -4
- package/dist/esm/bcm-alert.entry.js +2 -2
- package/dist/esm/bcm-attendance-actions-comment.entry.js +4 -4
- package/dist/esm/bcm-attendance-actions-dropdown.entry.js +4 -4
- package/dist/esm/bcm-breadcrumb.entry.js +2 -2
- package/dist/esm/bcm-caption.entry.js +4 -4
- package/dist/esm/bcm-card.entry.js +2 -2
- package/dist/esm/bcm-chip-group.entry.js +4 -4
- package/dist/esm/bcm-date-picker.entry.js +2 -2
- package/dist/esm/bcm-datetime-picker.entry.js +2 -2
- package/dist/esm/bcm-default.entry.js +2 -2
- package/dist/esm/bcm-form-2.entry.js +2 -2
- package/dist/esm/bcm-input-2.entry.js +2 -2
- package/dist/esm/bcm-input-custom.entry.js +2 -2
- package/dist/esm/bcm-input-dropdown.entry.js +4 -4
- package/dist/esm/bcm-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-number-input.entry.js +4 -4
- package/dist/esm/bcm-popover.entry.js +4 -4
- package/dist/esm/bcm-range.entry.js +2 -2
- package/dist/esm/bcm-skeleton.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 +2 -2
- package/dist/esm/bromcom-ui.js +2 -2
- package/dist/esm/{generate-172feaa1.js → generate-b30859e0.js} +1 -1
- package/dist/esm/{global-dd4e5618.js → global-7e00a8e5.js} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/{number-helper-75b39b91.js → number-helper-70d15d1b.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-4ae730ba.js → package-8f0a3af5.js} +1 -1
- package/dist/esm/{validators-c89525d2.js → validators-0ccb9921.js} +1 -1
- package/package.json +1 -1
- package/dist/bromcom-ui/p-8255b154.entry.js +0 -5
- package/dist/bromcom-ui/p-b93361f4.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{r as o,h as p,H as t,g as e}from"./p-170cf07d.js";import"./p-6f861fed.js";import{g as r,s as i}from"./p-2d0ff35e.js";import{F as b}from"./p-6e5f5f36.js";import{c as n}from"./p-64fad38b.js";import{G as s}from"./p-
|
|
5
|
+
import{r as o,h as p,H as t,g as e}from"./p-170cf07d.js";import"./p-6f861fed.js";import{g as r,s as i}from"./p-2d0ff35e.js";import{F as b}from"./p-6e5f5f36.js";import{c as n}from"./p-64fad38b.js";import{G as s}from"./p-1830cdf1.js";import{N as a}from"./p-81d248d8.js";import{S as m}from"./p-d65bc842.js";import"./p-6f2e4c9b.js";import"./p-a313fba6.js";import"./p-85eedabc.js";import"./p-a5d58be8.js";import"./p-a2df6c19.js";const x=class{constructor(p){o(this,p),this._id=s.UID(),this._target_id=void 0,this.message=void 0,this._title=void 0,this.placement="bottom",this.open=!1,this.hidden=!1,this.htmlContent=void 0,this.linkedComponent=void 0,this.height="256px",this.maxHeight="500px",this.minHeight="150px",this.placement_string=void 0}async show(){this.open=!0,this.calculateLocation()}async hide(){this.open=!1}getParentPopoverBox(o){if(o){const p=o.closest("old-bcm-popover-box");if(p)return p}return null}componentDidRender(){this.calculateLocation()}handleWheel(){this.calculateLocation()}handleScroll(){this.calculateLocation()}calculateLocation(){if(this.open){var o=this.placement;const p=this.el.querySelector(".bcm-pop-box"),t=document.getElementById(this.linkedComponent)||document.getElementById(this._target_id);if(p&&t){b({ref:t,floating:p,placement:this.placement,offset:2,arrow:!1,arrowColor:""}),r(p,t,o,(p=>o=p));let e=t.getBoundingClientRect().top,n=i(o,t,{rectTop:e});p.style.height=this.height.indexOf("%")>-1?.01*a.toNumber(this.height)*window.innerHeight-n[0]-50+"px":this.height,p.style.minHeight=this.minHeight;const s="top"==o.split("-")[0]?window.innerHeight-(window.innerHeight-e)-50:window.innerHeight-e-50;p.style.maxHeight=this.maxHeight.indexOf("%")>-1?.01*a.toNumber(this.maxHeight)*s+"px":"auto"!=this.maxHeight&&a.toNumber(this.maxHeight)<s?this.maxHeight:s+"px",p.style.overflowY="auto",p.style.minWidth=t.offsetWidth+"px";const m=this.getParentPopoverBox(t);if(m){const o=m.style.zIndex?a.toNumber(m.style.zIndex):10900;this.el.style.zIndex=(+o+1).toString()}(this.message||this._title)&&(p.style.minHeight="0px",p.style.height="auto",p.style.minWidth="230px")}}}setPlacementString(o){const p=m.textContains(o,"-")?o.split("-"):o.split(" ");1===p.length&&p.push("center"),this.placement_string=p.join(" ")}render(){const{message:o,_title:e,open:r,placement_string:i}=this,b=n("bcm-popover-box",i,{"bcm-pop-open":r,"bcm-pop-linked":this.linkedComponent}),s=n("bcm-pop-box");return p(t,{class:b},p("div",{class:s},e&&p("span",{class:"bcm-pop-heading size-2 weight-medium",innerHTML:e}),p("span",{class:"bcm-pop-content size-2",innerHTML:o}),p("slot",null)))}get el(){return e(this)}};x.style='@import url("https://fonts.googleapis.com/css?family=Roboto:400,500");@import url("https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap"); .size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}*{box-sizing:border-box}.bcm-popover-box{display:none;position:absolute;transition:transform 0.2s ease-in-out;}.bcm-popover-box .bcm-pop-box{font-family:"Inter", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;font-size:10px;line-height:calc(10px + 8px);box-shadow:0 4px 12px 2px rgba(17, 24, 38, 0.1);border-radius:4px;position:absolute;box-sizing:border-box;background-color:#FFFFFF;border:1px solid #FFFFFF;z-index:-99999;overflow:hidden;visibility:hidden;width:fit-content;position:absolute;display:block;overflow:hidden;visibility:hidden;z-index:-99999;filter:drop-shadow(0px 1px 6px rgba(0, 0, 0, 0.25))}.bcm-popover-box .bcm-pop-box.bcm-pop-open{overflow:unset;visibility:visible;height:unset}.bcm-popover-box .bcm-pop-box .bcm-pop-heading,.bcm-popover-box .bcm-pop-box .bcm-pop-content{display:block}.bcm-popover-box .bcm-pop-box .bcm-pop-heading:not(:empty){padding:4px 16px;border-bottom:1px solid #D9D9D9;color:var(--bcm-color-grey-9)}.bcm-popover-box .bcm-pop-box .bcm-pop-content:not(:empty){padding:8px 16px;color:var(--bcm-color-grey-8)}.bcm-popover-box::after{content:"";position:absolute;display:none;border:6px solid;z-index:10900;pointer-events:none}.bcm-popover-box.bcm-pop-open{display:block;z-index:10900}.bcm-popover-box.bcm-pop-open .bcm-pop-box{z-index:10900;overflow:unset;visibility:unset}.bcm-popover-box.bcm-pop-open::after{display:block}.bcm-popover-box.top .bcm-pop-box{bottom:100%;margin-bottom:16px}.bcm-popover-box.top::after{bottom:100%;margin-bottom:4px;border-color:#FFFFFF transparent transparent transparent}.bcm-popover-box.bottom .bcm-pop-box{top:100%;margin-top:16px}.bcm-popover-box.bottom::after{top:100%;margin-top:4px;border-color:transparent transparent #FFFFFF transparent}.bcm-popover-box.left .bcm-pop-box{right:100%;margin-right:16px}.bcm-popover-box.left::after{right:100%;margin-right:4px;border-color:transparent transparent transparent #FFFFFF}.bcm-popover-box.right .bcm-pop-box{left:100%;margin-left:16px}.bcm-popover-box.right::after{left:100%;margin-left:4px;border-color:transparent #FFFFFF transparent transparent}.bcm-popover-box.top.center .bcm-pop-box,.bcm-popover-box.bottom.center .bcm-pop-box{left:50%;transform:translateX(-50%)}.bcm-popover-box.top.center::after,.bcm-popover-box.bottom.center::after{left:50%;transform:translateX(-50%)}.bcm-popover-box.top.start .bcm-pop-box,.bcm-popover-box.bottom.start .bcm-pop-box{left:0}.bcm-popover-box.top.start::after,.bcm-popover-box.bottom.start::after{left:16px}.bcm-popover-box.top.end .bcm-pop-box,.bcm-popover-box.bottom.end .bcm-pop-box{right:0}.bcm-popover-box.top.end::after,.bcm-popover-box.bottom.end::after{right:16px}.bcm-popover-box.left.center .bcm-pop-box,.bcm-popover-box.right.center .bcm-pop-box{top:50%;transform:translateY(-50%)}.bcm-popover-box.left.center::after,.bcm-popover-box.right.center::after{top:50%;transform:translateY(-50%)}.bcm-popover-box.left.start .bcm-pop-box,.bcm-popover-box.right.start .bcm-pop-box{top:0}.bcm-popover-box.left.start::after,.bcm-popover-box.right.start::after{top:12px}.bcm-popover-box.left.end .bcm-pop-box,.bcm-popover-box.right.end .bcm-pop-box{bottom:0}.bcm-popover-box.left.end::after,.bcm-popover-box.right.end::after{bottom:12px}.bcm-popover-box.top{transform:translateY(1px)}.bcm-popover-box.bottom{transform:translateY(-1px)}.bcm-popover-box.left{transform:translateX(1px)}.bcm-popover-box.right{transform:translateX(-1px)}.bcm-popover-box.top.bcm-pop-open,.bcm-popover-box.bottom.bcm-pop-open{transform:translateY(0)}.bcm-popover-box.left.bcm-pop-open,.bcm-popover-box.right.bcm-pop-open{transform:translateX(0)}.bcm-popover-box.bcm-pop-linked.top .bcm-pop-box{margin:0 0 2px 0}.bcm-popover-box.bcm-pop-linked.bottom .bcm-pop-box{margin:2px 0 0 0}.bcm-popover-box.bcm-pop-linked.left .bcm-pop-box{margin:0 2px 0 0}.bcm-popover-box.bcm-pop-linked.right .bcm-pop-box{margin:0 0 0 2px}.bcm-popover-box.bcm-pop-linked .bcm-pop-box{filter:unset;border-radius:8px;box-shadow:0 2px 6px 1px rgba(17, 24, 38, 0.1)}.bcm-popover-box.bcm-pop-linked::after{display:none}';export{x as old_bcm_popover_box}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{E as o}from"./p-170cf07d.js";import{v as s}from"./p-
|
|
5
|
+
import{E as o}from"./p-170cf07d.js";import{v as s}from"./p-a5d58be8.js";import{L as t}from"./p-a9eb0321.js";window.bcm={version:s},function(o){const s=document.head,t=document.createElement("script");Object.keys(o).forEach((s=>{t[s]=o[s]})),s.appendChild(t)}({src:"https://kit.fontawesome.com/5e86bea963.js",crossOrigin:"anonymous"}),t.setLicenseKey(o.AG_GRID_LICENSE_KEY);
|
|
@@ -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 h,E as r}from"./p-6f861fed.js";import{c as o}from"./p-64fad38b.js";import{D as c}from"./p-626a65e9.js";import{d as l}from"./p-6f2e4c9b.js";import{G as d}from"./p-9ba753bf.js";import{a as m}from"./p-a313fba6.js";import{g as p,s as u}from"./p-2d0ff35e.js";import{L as b}from"./p-43c578cf.js";import{I as g}from"./p-9850cbce.js";import"./p-85eedabc.js";import"./p-3ba6c610.js";import"./p-a2df6c19.js";import"./p-d65bc842.js";var f,x,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"}(f||(f={})),function(t){t.sunday="sunday",t.monday="monday",t.tuesday="tuesday",t.wednesday="wednesday",t.thursday="thursday",t.friday="friday",t.saturday="saturday"}(x||(x={})),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=m.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,h.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,h.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,h.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,h.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,h.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,h.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 h=s?n+1:n-1;h<0?h=0:void 0===this[t][h]&&(h=this[t].length-1),"time"!=this.type||this.selectedDate||this.setTime(),this.setDragSelection(t,this[t][h],!0,!0)}))}createDragSelection(t,e,i,s,a){const n=t+"Dragger";this[n]=new r({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=0==this.currentDate.minute?0: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(f)[this.renderDate.getMonth()]}getCurrentDateText(){const t=Object.values(x)[this.currentDate.dayOfWeek],e=Object.values(f)[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),h=new Date(s),r="invalid date"!==n.toString().toLowerCase()&&"invalid date"!==this.parseDate(t),o="invalid date"!==h.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),m=/\b([01][0-9]|2[0-3]):([0-5][0-9])\b/.test(a),p=r&&l,u=o&&d;return{date:n,date2:h,timeSections:m?a.split(":"):"",dateIsValid:p,date2IsValid:u,rangeIsValid:p&&u,timeIsValid:m}}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(),h=i(new Date(t).getHours()),r=i(new Date(t).getMinutes());return"range"==this.type||"date"==this.type?e?`${a}/${s}/${n}`:`${s}/${a}/${n}`:e?`${a}/${s}/${n} ${h}:${r}`:`${s}/${a}/${n} ${h}:${r}`}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){p(t,e,i,(t=>i=t)),await l(10);let s=u(i,e),a=this.noCaption?0:20,n=0;switch(p(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)===m.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}),h="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(),"no-margin":!0,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:h}))),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,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(h=(n<3?a(h):n>3?a(e,i,h):a(e,i))||h);n>3&&h&&Object.defineProperty(e,i,h)})([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"); .size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}.bcm-input[no-margin]{margin:0}.bcm-textarea[no-margin]{margin:0}.bcm-switch[no-margin]{margin:0}.bcm-checkbox[no-margin]{margin:0}.bcm-radio-group[no-margin]{margin:0}.bcm-checkbox-group[no-margin]{margin:0}.bcm-range[no-margin]{margin:0}.bcm-form[no-margin]{margin:0}.bcm-form-group[no-margin]{margin:0}.bcm-list[no-margin]{margin:0}.bcm-colorpicker[no-margin]{margin:0}.bcm-date-picker[no-margin]{margin:0}.bcm-time-picker[no-margin]{margin:0}.bcm-datetime-picker[no-margin]{margin:0}.bcm-select[no-margin]{margin:0}.bcm-listbox[no-margin]{margin:0}*{box-sizing:border-box}: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}.bcm-label{font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin-bottom:4px;font-weight:500;color:#475569}.bcm-label.tw-text-1{font-size:10px;line-height:18px}.bcm-label.tw-text-2{font-size:12px;line-height:20px}.bcm-label.tw-text-3{font-size:14px;line-height:22px}.bcm-caption-area{color:#dc2626;font-weight:400;justify-content:space-between;align-items:flex-start;flex-direction:row;min-height:20px;display:flex;margin-top:4px;font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.bcm-caption-area.tw-text-1{font-size:10px;line-height:18px}.bcm-caption-area.tw-text-2{font-size:12px;line-height:20px}.bcm-caption-area.tw-text-3{font-size:14px;line-height:22px}.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 h,E as r}from"./p-6f861fed.js";import{c as o}from"./p-64fad38b.js";import{D as c}from"./p-626a65e9.js";import{d as l}from"./p-6f2e4c9b.js";import{G as d}from"./p-1830cdf1.js";import{a as m}from"./p-a313fba6.js";import{g as p,s as u}from"./p-2d0ff35e.js";import{L as b}from"./p-43c578cf.js";import{I as g}from"./p-9850cbce.js";import"./p-85eedabc.js";import"./p-a5d58be8.js";import"./p-a2df6c19.js";import"./p-d65bc842.js";var f,x,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"}(f||(f={})),function(t){t.sunday="sunday",t.monday="monday",t.tuesday="tuesday",t.wednesday="wednesday",t.thursday="thursday",t.friday="friday",t.saturday="saturday"}(x||(x={})),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=m.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,h.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,h.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,h.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,h.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,h.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,h.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 h=s?n+1:n-1;h<0?h=0:void 0===this[t][h]&&(h=this[t].length-1),"time"!=this.type||this.selectedDate||this.setTime(),this.setDragSelection(t,this[t][h],!0,!0)}))}createDragSelection(t,e,i,s,a){const n=t+"Dragger";this[n]=new r({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=0==this.currentDate.minute?0: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(f)[this.renderDate.getMonth()]}getCurrentDateText(){const t=Object.values(x)[this.currentDate.dayOfWeek],e=Object.values(f)[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),h=new Date(s),r="invalid date"!==n.toString().toLowerCase()&&"invalid date"!==this.parseDate(t),o="invalid date"!==h.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),m=/\b([01][0-9]|2[0-3]):([0-5][0-9])\b/.test(a),p=r&&l,u=o&&d;return{date:n,date2:h,timeSections:m?a.split(":"):"",dateIsValid:p,date2IsValid:u,rangeIsValid:p&&u,timeIsValid:m}}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(),h=i(new Date(t).getHours()),r=i(new Date(t).getMinutes());return"range"==this.type||"date"==this.type?e?`${a}/${s}/${n}`:`${s}/${a}/${n}`:e?`${a}/${s}/${n} ${h}:${r}`:`${s}/${a}/${n} ${h}:${r}`}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){p(t,e,i,(t=>i=t)),await l(10);let s=u(i,e),a=this.noCaption?0:20,n=0;switch(p(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)===m.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}),h="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(),"no-margin":!0,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:h}))),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,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(h=(n<3?a(h):n>3?a(e,i,h):a(e,i))||h);n>3&&h&&Object.defineProperty(e,i,h)})([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"); .size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}.bcm-input[no-margin]{margin:0}.bcm-textarea[no-margin]{margin:0}.bcm-switch[no-margin]{margin:0}.bcm-checkbox[no-margin]{margin:0}.bcm-radio-group[no-margin]{margin:0}.bcm-checkbox-group[no-margin]{margin:0}.bcm-range[no-margin]{margin:0}.bcm-form[no-margin]{margin:0}.bcm-form-group[no-margin]{margin:0}.bcm-list[no-margin]{margin:0}.bcm-colorpicker[no-margin]{margin:0}.bcm-date-picker[no-margin]{margin:0}.bcm-time-picker[no-margin]{margin:0}.bcm-datetime-picker[no-margin]{margin:0}.bcm-select[no-margin]{margin:0}.bcm-listbox[no-margin]{margin:0}*{box-sizing:border-box}: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}.bcm-label{font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin-bottom:4px;font-weight:500;color:#475569}.bcm-label.tw-text-1{font-size:10px;line-height:18px}.bcm-label.tw-text-2{font-size:12px;line-height:20px}.bcm-label.tw-text-3{font-size:14px;line-height:22px}.bcm-caption-area{color:#dc2626;font-weight:400;justify-content:space-between;align-items:flex-start;flex-direction:row;min-height:20px;display:flex;margin-top:4px;font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.bcm-caption-area.tw-text-1{font-size:10px;line-height:18px}.bcm-caption-area.tw-text-2{font-size:12px;line-height:20px}.bcm-caption-area.tw-text-3{font-size:14px;line-height:22px}.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{r as t,c as s,h as i,H as e,g as a}from"./p-170cf07d.js";import"./p-499d8454.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-499d8454.js";import"./p-626a65e9.js";import{G as o}from"./p-1830cdf1.js";import"./p-81d248d8.js";import"./p-d65bc842.js";import"./p-af8674da.js";import"./p-6f861fed.js";import{d as h}from"./p-6f2e4c9b.js";import{B as r}from"./p-a313fba6.js";import{c as l}from"./p-64fad38b.js";import"./p-436364c8.js";import"./p-a2df6c19.js";import"./p-85eedabc.js";import"./p-a5d58be8.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}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built with Stencil
|
|
3
|
+
* Copyright (c) Bromcom.
|
|
4
|
+
*/
|
|
5
|
+
import{r as t,h as e,H as s,g as r}from"./p-170cf07d.js";import"./p-499d8454.js";import"./p-626a65e9.js";import{G as o}from"./p-1830cdf1.js";import"./p-81d248d8.js";import"./p-d65bc842.js";import"./p-af8674da.js";import"./p-6f861fed.js";import"./p-a313fba6.js";import"./p-436364c8.js";import"./p-6f2e4c9b.js";import"./p-a2df6c19.js";import"./p-85eedabc.js";import"./p-a5d58be8.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 t,c as s,h as i,H as e,g as o}from"./p-170cf07d.js";import{c as
|
|
5
|
+
import{r as t,c as s,h as i,H as e,g as o}from"./p-170cf07d.js";import{c as w}from"./p-64fad38b.js";import{G as a}from"./p-1830cdf1.js";import{S as r}from"./p-d65bc842.js";import{a as h}from"./p-a313fba6.js";import{d as n}from"./p-6f2e4c9b.js";import"./p-85eedabc.js";import"./p-a5d58be8.js";import"./p-a2df6c19.js";const c=class{constructor(i){t(this,i),this.bcmToastClose=s(this,"bcm-toast-close",7),this.bcmToastOpen=s(this,"bcm-toast-open",7),this.bcmToastView=s(this,"bcm-toast-view",7),this._id=a.UID(),this.status=void 0,this.message="",this.description="",this.duration=3e3,this.position=h.Placement.bottom,this.messageIcon=void 0,this.viewButton=!1,this.closeButton=!0,this.removeAfterClose=!0,this.visible=!1,this.visibleContainer=!1}async show(){const t=document.getElementById(this._id+"-container");return t&&this.createContainer(this.position).appendChild(t),this.visible=!0,await n(50),this.visibleContainer=!0,this.bcmToastOpen.emit(),this.timer&&clearTimeout(this.timer),this.timer=setTimeout((()=>this.hide()),this.duration),this.el}async hide(){this.visibleContainer=!1,clearTimeout(this.timer),this.bcmToastClose.emit(),await n(100),this.visible=!1,this.removeAfterClose&&(await n(100),this.el.remove())}handleMouseEnter(){clearTimeout(this.timer)}handleMouseLeave(){this.visible&&(this.timer=setTimeout((()=>this.hide()),1e3))}createContainer(t){const s="bcm-toast-container-"+t;let i=document.getElementById(s);if(!i){i=document.createElement("div"),i.id=s;const t=w("tw-pointer-events-none tw-overflow-hidden tw-z-50","tw-fixed tw-flex","tw-p-4 tw-gap-4",{"tw-flex-col-reverse tw-inset-x-0 tw-top-4 tw-mx-auto":this.position===h.Placement.top,"tw-flex-col tw-inset-x-0 tw-bottom-4 tw-mx-auto":this.position===h.Placement.bottom,"tw-flex-col-reverse tw-top-4 tw-left-4":this.position===h.Placement["top-start"],"tw-flex-col-reverse tw-top-4 tw-right-4":this.position===h.Placement["top-end"],"tw-flex-col tw-bottom-4 tw-left-4":this.position===h.Placement["bottom-start"],"tw-flex-col tw-bottom-4 tw-right-4":this.position===h.Placement["bottom-end"]});i.classList.add(...t.split(" ")),document.body.appendChild(i)}return i}render(){return i(e,{class:"tw-hidden"},i("div",{class:w({"tw-hidden":!this.visible}),id:this._id+"-container",onMouseEnter:()=>this.handleMouseEnter(),onMouseLeave:()=>this.handleMouseLeave()},i("div",{class:w("tw-pointer-events-auto tw-transform tw-transition tw-duration-300 tw-ease-in-out","tw-flex tw-min-w-[256px] tw-max-w-[420px] tw-flex-col tw-gap-2 tw-rounded-lg tw-border tw-font-sans tw-font-normal tw-shadow-2","tw-border-gray-300 tw-bg-white tw-text-slate-600",{"tw-p-4":!this.description,"tw-p-6":this.description},"tw-transform tw-transition tw-duration-300 tw-ease-in-out ",{"tw-translate-y-0 tw-opacity-100 ":this.visibleContainer,"tw-opacity-0":!this.visibleContainer,"tw-translate-y-[-100%]":!this.visibleContainer&&"top"===this.position.split("-")[0],"tw-translate-y-[100%]":!this.visibleContainer&&"bottom"===this.position.split("-")[0]})},i("div",{class:"tw-flex tw-items-center tw-justify-between tw-gap-5"},i("div",{class:"tw-flex tw-items-center tw-gap-3 "},this.status&&i("i",{class:w("tw-text-6",this.messageIcon?this.messageIcon:"far",{"tw-text-emerald-500":"success"===this.status,"tw-text-red-500":"error"===this.status,"tw-text-amber-500":"warning"===this.status,"tw-text-blue-500":"info"===this.status},{"fa-check-circle":!this.messageIcon&&"success"===this.status,"fa-exclamation-circle":!this.messageIcon&&"error"===this.status,"fa-exclamation-triangle":!this.messageIcon&&"warning"===this.status,"fa-info-circle":!this.messageIcon&&"info"===this.status})}),i("span",{class:w({"tw-text-4":!this.description,"tw-text-6 tw-font-medium":this.description})},!this.description&&this.status&&i("span",null,r.capitalize(this.status),": "),this.message)),i("div",{class:"tw-flex tw-items-baseline tw-gap-2"},this.viewButton&&i("button",{onClick:()=>this.bcmToastView.emit(),title:"View details",class:w("tw-cursor-pointer tw-rounded tw-bg-transparent tw-p-0 tw-px-1 tw-text-4 tw-text-inherit","hover:tw-bg-gray-100 hover:tw-text-slate-800","active:tw-bg-gray-200","tw-transition tw-duration-300 tw-ease-in-out",{"tw-font-medium":this.description})},"View"),this.closeButton&&i("button",{title:"Close",onClick:()=>this.hide(),class:w("tw-rounded tw-bg-transparent tw-p-0","tw-flex tw-h-6 tw-w-6 tw-cursor-pointer tw-items-center tw-justify-center tw-text-3 tw-text-inherit","hover:tw-bg-gray-100 hover:tw-text-slate-800","active:tw-bg-gray-200")},i("i",{class:"fal fa-times"})))),this.description&&i("div",{class:"tw-text-3 "},this.description),i("slot",null))))}get el(){return o(this)}};export{c as bcm_toast}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{r as t,h as p,H as s,g as r}from"./p-170cf07d.js";import"./p-499d8454.js";import"./p-626a65e9.js";import{G as o}from"./p-
|
|
5
|
+
import{r as t,h as p,H as s,g as r}from"./p-170cf07d.js";import"./p-499d8454.js";import"./p-626a65e9.js";import{G as o}from"./p-1830cdf1.js";import"./p-81d248d8.js";import"./p-d65bc842.js";import"./p-af8674da.js";import"./p-6f861fed.js";import"./p-a313fba6.js";import{c as e}from"./p-64fad38b.js";import"./p-436364c8.js";import"./p-6f2e4c9b.js";import"./p-a2df6c19.js";import"./p-85eedabc.js";import"./p-a5d58be8.js";const i=class{constructor(p){t(this,p),this._id=o.UID(),this.el.slot="footer"}render(){return p(s,{class:e("tw-flex tw-flex-row tw-items-center tw-justify-end tw-gap-2 tw-px-6 tw-pb-6 tw-pt-2")},p("slot",null))}get el(){return r(this)}};export{i as bcm_modal_2_footer}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{r as t,c as i,h as s,H as e,g as o}from"./p-170cf07d.js";import"./p-499d8454.js";import"./p-626a65e9.js";import{G as a}from"./p-
|
|
5
|
+
import{r as t,c as i,h as s,H as e,g as o}from"./p-170cf07d.js";import"./p-499d8454.js";import"./p-626a65e9.js";import{G as a}from"./p-1830cdf1.js";import"./p-81d248d8.js";import"./p-d65bc842.js";import"./p-af8674da.js";import"./p-6f861fed.js";import{d as n}from"./p-6f2e4c9b.js";import{F as r}from"./p-6e5f5f36.js";import{B as c}from"./p-a313fba6.js";import{c as l}from"./p-08c75801.js";import"./p-436364c8.js";import"./p-a2df6c19.js";import"./p-85eedabc.js";import"./p-a5d58be8.js";const m=l({slots:{host:["tw-w-fit","tw-absolute tw-left-0 tw-right-0 tw-z-tooltip tw-opacity-100 tw-transition-opacity tw-duration-300","tw-rounded tw-bg-white tw-shadow","bcm-ui-element bcm-attendance-actions tw-flex tw-flex-col tw-items-start tw-justify-start tw-p-4 tw-font-medium tw-text-slate-700"],footer:["tw-flex tw-w-full tw-flex-row tw-items-center tw-justify-end tw-gap-2 "]},variants:{size:{small:{},medium:{},large:{}}},defaultVariants:{size:"medium"}}),h=class{constructor(s){t(this,s),this.change=i(this,"bcm-attendance-actions-comment-change",3),this.lateMinutes=null,this.comment=null,this._id=a.UID(),this.size=c.Size.medium,this.disabled=!1,this.selectedKey=null,this.targetId=null,this.isShow=!1,this.isLate=!1,this.selectedItem=null}handleSave(t,i){this.change.emit({lateMinutes:t,comment:i}),this.hide()}async show(){const t=document.getElementById(this.targetId);r({ref:t,floating:this.el,placement:"bottom-end",offset:8,arrow:!0,arrowColor:"tw-bg-white"}),this.isShow=!0,await n(100),this.isLate?this.focusInput():this.focusTextarea()}focusInput(){const t=this.el.querySelector("bcm-input");null==t||t.onBcmSelect()}focusTextarea(){const t=this.el.querySelector("bcm-textarea");null==t||t.onBcmSelect()}async hide(){this.isShow&&this.el.remove()}handleClickOutside(t){a.findEventPath(t,this.el)||this.hide()}async formSubmit(){var t,i,s;const{lateMinutes:e,comment:o,isLate:a}=this;if(a&&e&&!(e>=0&&e<=200))return;const{isValid:n}=await(null===(t=this.el.querySelector("bcm-form"))||void 0===t?void 0:t.submit());n&&this.handleSave(e||(null===(i=this.selectedItem)||void 0===i?void 0:i.lateMin),o||(null===(s=this.selectedItem)||void 0===s?void 0:s.comment))}render(){var t,i;const{size:o}=this,{host:a,footer:n}=m({size:o});return s(e,{class:a(),onKeyDown:t=>{"Escape"===t.key&&this.hide()}},s("bcm-form",{validation:!0,style:{width:"256px"}},this.isLate?s("bcm-input",{label:"Minus Late",required:!0,name:"lateMin",id:this._id+"-input-dropdown-late-content-input",type:"number",size:this.size,autocomplete:!1,"no-margin":!0,min:0,max:200,value:null===(t=this.selectedItem)||void 0===t?void 0:t.lateMin,placeholder:"Enter Minus Late","onBcm-change":({detail:t})=>this.lateMinutes=t,onKeyDown:t=>{"Enter"===t.key&&this.formSubmit()}},s("i",{slot:"prefix",class:"far fa-clock"})):null,s("bcm-textarea",{name:"comment",value:null===(i=this.selectedItem)||void 0===i?void 0:i.comment,size:this.size,"onBcm-change":({detail:t})=>this.comment=t,label:"Description","no-caption":!0,rows:4,onKeyDown:t=>{"Enter"===t.key&&this.formSubmit()}}),s("footer",{class:n()},s("bcm-button",{class:"tw-order-2",icon:"fas fa-save","icon-position":"prefix",size:this.size,onClick:()=>this.formSubmit()},"Save"),s("bcm-button",{class:"tw-order-1",icon:"fas fa-times",kind:"ghost",size:this.size,"icon-position":"prefix",onClick:()=>this.hide()},"Close"))))}get el(){return o(this)}};export{h as bcm_attendance_actions_comment}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{r as t,c as i,h as e,H as n}from"./p-170cf07d.js";import{c as o}from"./p-64fad38b.js";import{I as r}from"./p-9850cbce.js";import{G as a}from"./p-9ba753bf.js";import{a as c}from"./p-a313fba6.js";import{C as s}from"./p-8e683b32.js";import{i as p}from"./p-d1298c40.js";import"./p-85eedabc.js";import"./p-3ba6c610.js";import"./p-a2df6c19.js";import"./p-08c75801.js";const l=class{constructor(e){t(this,e),this.focus=i(this,"bcm-focus",7),this.blur=i(this,"bcm-blur",7),this.clear=i(this,"bcm-clear",7),this.change=i(this,"bcm-change",7),this.input=i(this,"bcm-input",7),this._id=a.UID(),this._internal_id=a.UID(),this.value="",this.size=c.Size.medium,this.label=void 0,this.pattern=void 0,this.tooltip=void 0,this.placeholder=void 0,this.disabled=!1,this.readonly=!1,this.clearable=!1,this.autocomplete=!1,this.name=void 0,this.type=c.InputType.text,this.hidden=!1,this.required=!1,this.fullWidth=!1,this.noDefaultIcon=void 0,this.disableWatchValue=!1,this.passwordToggle=!1,this.maxLength=null,this.minLength=null,this.unitPrefix=null,this.unit=void 0,this.decimal=!0,this.min=void 0,this.max=void 0,this.step=void 0,this.caption=void 0,this.noCaption=!1,this.captionType=c.Status.default,this.captionError=void 0,this.customErrorMessage=void 0,this._prefix=void 0,this._suffix=void 0,this.captionCache=void 0,this.captionTypeCache=void 0,this.inValid=!1,this.valueCache="",this.focused=!1,this.isPasswordVisible=!1}async onBcmFocus(){this.inputElement.focus()}async onBcmBlur(){this.inputElement.blur()}async onBcmSelect(){this.inputElement.select()}handleClear(t){this.inputElement.value="",this.value="",this.inputElement.focus(),this.clear.emit(t),this.change.emit(this.value),t.stopPropagation()}handleInput(t){this.value=this.inputElement.value,this.input.emit(this.value),this.change.emit(this.value)}handleChange(t){this.value=this.inputElement.value,this.change.emit(this.value)}handleFocus(t){this.focused=!0,this.focus.emit(t)}handleBlur(t){this.focused=!1,this.blur.emit(t)}handleKeyUp(t){"Enter"===t.key&&this.blur.emit(t)}render(){const{value:t,size:i,label:r,type:a,captionType:c,caption:l,captionError:m,placeholder:u,fullWidth:b,disabled:h,readonly:d,clearable:x,unit:g,inValid:f,focused:_,noCaption:v,required:y,hidden:z,_id:w,autocomplete:k,_prefix:j,_suffix:C}=this,B=(null==t?void 0:t.length)>0&&x,{host:D,inputContainer:I,input:E,slotClass:F,clearButton:R,controls:T,controlsBtn:q,controlsBtnDown:H,controlsBtnUp:M,controlsDivider:U}=p({size:i,fullWidth:b,focused:_,clearable:B,disabled:h,readonly:d,invalid:f,unit:(null==g?void 0:g.length)>0,error:"error"===c,hidden:z});return e(n,{class:D(),onClick:()=>this.onBcmFocus()},r&&e("bcm-label",{tooltip:this.tooltip,type:c,value:r,required:y,htmlFor:w}),e("div",{class:I()},e("div",{class:F()},e("slot",{name:"prefix"},j&&j.length>0&&e("span",{innerHTML:j}))),e("input",{class:E(),id:w,type:a,value:t,pattern:this.pattern,placeholder:u,disabled:h,readonly:d,ref:t=>this.inputElement=t,onInput:t=>this.handleInput(t),onChange:t=>this.handleChange(t),onFocus:t=>this.handleFocus(t),onBlur:t=>this.handleBlur(t),onKeyUp:t=>this.handleKeyUp(t),autoComplete:k?"on":"off",required:y}),e("div",{class:F()},B&&e("button",{type:"button",class:R(),onClick:t=>this.handleClear(t)},e("i",{class:"far fa-times"})),e("slot",{name:"suffix"},C&&C.length>0&&e("span",{innerHTML:C})),"number"===a&&e("div",{class:T()},e("button",{type:"button",onClick:()=>this.onBcmFocus(),class:o(q(),M())},e("i",{class:"fas fa-caret-up"})),e("div",{class:U()}),e("button",{type:"button",onClick:()=>this.onBcmFocus(),class:o(q(),H())},e("i",{class:"fas fa-caret-down"}))))),e(s,{noCaption:v,captionType:c,captionError:m,caption:l,customErrorMessage:this.customErrorMessage}))}};(function(t,i,e,n){var o,r=arguments.length,a=r<3?i:null===n?n=Object.getOwnPropertyDescriptor(i,e):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,i,e,n);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(a=(r<3?o(a):r>3?o(i,e,a):o(i,e))||a);r>3&&a&&Object.defineProperty(i,e,a)})([r()],l.prototype,"inputElement",void 0),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}.bcm-input[no-margin]{margin:0}.bcm-textarea[no-margin]{margin:0}.bcm-switch[no-margin]{margin:0}.bcm-checkbox[no-margin]{margin:0}.bcm-radio-group[no-margin]{margin:0}.bcm-checkbox-group[no-margin]{margin:0}.bcm-range[no-margin]{margin:0}.bcm-form[no-margin]{margin:0}.bcm-form-group[no-margin]{margin:0}.bcm-list[no-margin]{margin:0}.bcm-colorpicker[no-margin]{margin:0}.bcm-date-picker[no-margin]{margin:0}.bcm-time-picker[no-margin]{margin:0}.bcm-datetime-picker[no-margin]{margin:0}.bcm-select[no-margin]{margin:0}.bcm-listbox[no-margin]{margin:0}*{box-sizing:border-box}.bcm-input{display:inline-flex;flex-direction:column;width:100%;max-width:256px;margin-bottom:8px}.bcm-input.full-width{max-width:100%}.bcm-input.hidden{display:none}.bcm-input__container{font-family:"Inter", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;display:flex;align-items:stretch;flex-direction:row;background-color:var(--bcm-new-ds-color-white);border:1px solid var(--bcm-new-ds-color-slate-300);border-radius:4px;box-sizing:border-box;cursor:text;padding:0 0 0 4px;position:relative;width:100%}.bcm-input__container.disabled{background-color:var(--bcm-new-ds-color-slate-50);cursor:not-allowed}.bcm-input__container.disabled .bcm-input-element{color:var(--bcm-new-ds-color-slate-500)}.bcm-input__container.readonly{background-color:var(--bcm-new-ds-color-slate-50);cursor:default}.bcm-input__container.readonly .bcm-input-element{color:var(--bcm-new-ds-color-slate-600)}.bcm-input__container:not(.disabled):hover .caret-container,.bcm-input__container:not(.disabled).focused .caret-container{opacity:1}.bcm-input__container:not(.disabled):hover .input-clear-button,.bcm-input__container:not(.disabled).focused .input-clear-button{opacity:1}.bcm-input__container:not(.disabled).focused{background-color:var(--bcm-new-ds-color-slate-50)}.bcm-input__container:not(.disabled):hover{border-color:var(--bcm-color-prime-blue-6)}.bcm-input__container.empty .input-clear-button{display:none}.bcm-input__container.invalid,.bcm-input__container.error{border-color:var(--bcm-new-ds-color-red-500)}.bcm-input__container .bcm-input-element{width:100%;color:var(--bcm-new-ds-color-slate-600);flex:1;border:none;background:transparent;box-shadow:unset;padding:0 4px;font-family:"Inter", sans-serif;cursor:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;text-overflow:ellipsis}.bcm-input__container .bcm-input-element::placeholder{font-family:"Inter", sans-serif;color:var(--bcm-new-ds-color-slate-300);user-select:none}.bcm-input__container .bcm-input-element::-webkit-search-decoration,.bcm-input__container .bcm-input-element::-webkit-search-cancel-button,.bcm-input__container .bcm-input-element::-webkit-search-results-button,.bcm-input__container .bcm-input-element::-webkit-search-results-decoration,.bcm-input__container .bcm-input-element::-webkit-calendar-picker-indicator,.bcm-input__container .bcm-input-element::-webkit-inner-spin-button,.bcm-input__container .bcm-input-element::-webkit-outer-spin-button{-webkit-appearance:none}.bcm-input__container .caret-container{width:30px;display:flex;flex-direction:column;justify-content:center;align-items:stretch;border-left:1px solid #D9D9D9;transition:0.2s opacity;user-select:none;box-sizing:border-box}.bcm-input__container .caret-container .bcm-input-caret{display:flex;align-items:center;justify-content:center;color:var(--bcm-color-grey-7);cursor:pointer;flex:1}.bcm-input__container .caret-container .bcm-input-caret bcm-icon{line-height:1}.bcm-input__container .caret-container .bcm-input-caret:hover{color:var(--bcm-color-prime-blue-6)}.bcm-input__container .caret-container .bcm-input-caret:active{background-color:var(--bcm-color-grey-3)}.bcm-input__container .caret-container .bcm-input-caret:last-child{border-top:1px solid #D9D9D9}.bcm-input__container .caret-container.disabled{background-color:var(--bcm-color-grey-3)}.bcm-input__container .caret-container.disabled .bcm-input-caret{cursor:not-allowed}.bcm-input__container .input-suffix-content{display:flex;align-items:center;justify-content:center}.bcm-input__container .input-prefix:not(:empty){padding-left:4px}.bcm-input__container .input-suffix:not(:empty){min-width:24px;padding-right:4px}.bcm-input__container .input-prefix:not(:empty),.bcm-input__container .input-suffix:not(:empty){display:flex;align-items:center;justify-content:center;cursor:default;color:#64748a}.bcm-input__container .input-prefix:not(:empty) .unit-prefix,.bcm-input__container .input-suffix:not(:empty) .unit-prefix{color:#64748a}.bcm-input__container .input-prefix-button:not(:empty),.bcm-input__container .input-suffix-button:not(:empty){cursor:pointer}.bcm-input__container .caret-container,.bcm-input__container .input-clear-button{opacity:0}.bcm-input__container--small{font-size:12px}.bcm-input__container--medium{font-size:14px}.bcm-input__container--large{font-size:16px}.bcm-input__textarea.clearable .bcm-input-element{padding-right:24px}.bcm-input__textarea .input-clear-button{position:absolute;top:4px;right:0}';export{l as bcm_input_2}
|
|
5
|
+
import{r as t,c as i,h as e,H as n}from"./p-170cf07d.js";import{c as o}from"./p-64fad38b.js";import{I as r}from"./p-9850cbce.js";import{G as a}from"./p-1830cdf1.js";import{a as c}from"./p-a313fba6.js";import{C as s}from"./p-8e683b32.js";import{i as p}from"./p-d1298c40.js";import"./p-85eedabc.js";import"./p-a5d58be8.js";import"./p-a2df6c19.js";import"./p-08c75801.js";const l=class{constructor(e){t(this,e),this.focus=i(this,"bcm-focus",7),this.blur=i(this,"bcm-blur",7),this.clear=i(this,"bcm-clear",7),this.change=i(this,"bcm-change",7),this.input=i(this,"bcm-input",7),this._id=a.UID(),this._internal_id=a.UID(),this.value="",this.size=c.Size.medium,this.label=void 0,this.pattern=void 0,this.tooltip=void 0,this.placeholder=void 0,this.disabled=!1,this.readonly=!1,this.clearable=!1,this.autocomplete=!1,this.name=void 0,this.type=c.InputType.text,this.hidden=!1,this.required=!1,this.fullWidth=!1,this.noDefaultIcon=void 0,this.disableWatchValue=!1,this.passwordToggle=!1,this.maxLength=null,this.minLength=null,this.unitPrefix=null,this.unit=void 0,this.decimal=!0,this.min=void 0,this.max=void 0,this.step=void 0,this.caption=void 0,this.noCaption=!1,this.captionType=c.Status.default,this.captionError=void 0,this.customErrorMessage=void 0,this._prefix=void 0,this._suffix=void 0,this.captionCache=void 0,this.captionTypeCache=void 0,this.inValid=!1,this.valueCache="",this.focused=!1,this.isPasswordVisible=!1}async onBcmFocus(){this.inputElement.focus()}async onBcmBlur(){this.inputElement.blur()}async onBcmSelect(){this.inputElement.select()}handleClear(t){this.inputElement.value="",this.value="",this.inputElement.focus(),this.clear.emit(t),this.change.emit(this.value),t.stopPropagation()}handleInput(t){this.value=this.inputElement.value,this.input.emit(this.value),this.change.emit(this.value)}handleChange(t){this.value=this.inputElement.value,this.change.emit(this.value)}handleFocus(t){this.focused=!0,this.focus.emit(t)}handleBlur(t){this.focused=!1,this.blur.emit(t)}handleKeyUp(t){"Enter"===t.key&&this.blur.emit(t)}render(){const{value:t,size:i,label:r,type:a,captionType:c,caption:l,captionError:m,placeholder:u,fullWidth:b,disabled:h,readonly:d,clearable:x,unit:g,inValid:f,focused:_,noCaption:v,required:y,hidden:z,_id:w,autocomplete:k,_prefix:j,_suffix:C}=this,B=(null==t?void 0:t.length)>0&&x,{host:D,inputContainer:I,input:E,slotClass:F,clearButton:R,controls:T,controlsBtn:q,controlsBtnDown:H,controlsBtnUp:M,controlsDivider:U}=p({size:i,fullWidth:b,focused:_,clearable:B,disabled:h,readonly:d,invalid:f,unit:(null==g?void 0:g.length)>0,error:"error"===c,hidden:z});return e(n,{class:D(),onClick:()=>this.onBcmFocus()},r&&e("bcm-label",{tooltip:this.tooltip,type:c,value:r,required:y,htmlFor:w}),e("div",{class:I()},e("div",{class:F()},e("slot",{name:"prefix"},j&&j.length>0&&e("span",{innerHTML:j}))),e("input",{class:E(),id:w,type:a,value:t,pattern:this.pattern,placeholder:u,disabled:h,readonly:d,ref:t=>this.inputElement=t,onInput:t=>this.handleInput(t),onChange:t=>this.handleChange(t),onFocus:t=>this.handleFocus(t),onBlur:t=>this.handleBlur(t),onKeyUp:t=>this.handleKeyUp(t),autoComplete:k?"on":"off",required:y}),e("div",{class:F()},B&&e("button",{type:"button",class:R(),onClick:t=>this.handleClear(t)},e("i",{class:"far fa-times"})),e("slot",{name:"suffix"},C&&C.length>0&&e("span",{innerHTML:C})),"number"===a&&e("div",{class:T()},e("button",{type:"button",onClick:()=>this.onBcmFocus(),class:o(q(),M())},e("i",{class:"fas fa-caret-up"})),e("div",{class:U()}),e("button",{type:"button",onClick:()=>this.onBcmFocus(),class:o(q(),H())},e("i",{class:"fas fa-caret-down"}))))),e(s,{noCaption:v,captionType:c,captionError:m,caption:l,customErrorMessage:this.customErrorMessage}))}};(function(t,i,e,n){var o,r=arguments.length,a=r<3?i:null===n?n=Object.getOwnPropertyDescriptor(i,e):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,i,e,n);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(a=(r<3?o(a):r>3?o(i,e,a):o(i,e))||a);r>3&&a&&Object.defineProperty(i,e,a)})([r()],l.prototype,"inputElement",void 0),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}.bcm-input[no-margin]{margin:0}.bcm-textarea[no-margin]{margin:0}.bcm-switch[no-margin]{margin:0}.bcm-checkbox[no-margin]{margin:0}.bcm-radio-group[no-margin]{margin:0}.bcm-checkbox-group[no-margin]{margin:0}.bcm-range[no-margin]{margin:0}.bcm-form[no-margin]{margin:0}.bcm-form-group[no-margin]{margin:0}.bcm-list[no-margin]{margin:0}.bcm-colorpicker[no-margin]{margin:0}.bcm-date-picker[no-margin]{margin:0}.bcm-time-picker[no-margin]{margin:0}.bcm-datetime-picker[no-margin]{margin:0}.bcm-select[no-margin]{margin:0}.bcm-listbox[no-margin]{margin:0}*{box-sizing:border-box}.bcm-input{display:inline-flex;flex-direction:column;width:100%;max-width:256px;margin-bottom:8px}.bcm-input.full-width{max-width:100%}.bcm-input.hidden{display:none}.bcm-input__container{font-family:"Inter", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;display:flex;align-items:stretch;flex-direction:row;background-color:var(--bcm-new-ds-color-white);border:1px solid var(--bcm-new-ds-color-slate-300);border-radius:4px;box-sizing:border-box;cursor:text;padding:0 0 0 4px;position:relative;width:100%}.bcm-input__container.disabled{background-color:var(--bcm-new-ds-color-slate-50);cursor:not-allowed}.bcm-input__container.disabled .bcm-input-element{color:var(--bcm-new-ds-color-slate-500)}.bcm-input__container.readonly{background-color:var(--bcm-new-ds-color-slate-50);cursor:default}.bcm-input__container.readonly .bcm-input-element{color:var(--bcm-new-ds-color-slate-600)}.bcm-input__container:not(.disabled):hover .caret-container,.bcm-input__container:not(.disabled).focused .caret-container{opacity:1}.bcm-input__container:not(.disabled):hover .input-clear-button,.bcm-input__container:not(.disabled).focused .input-clear-button{opacity:1}.bcm-input__container:not(.disabled).focused{background-color:var(--bcm-new-ds-color-slate-50)}.bcm-input__container:not(.disabled):hover{border-color:var(--bcm-color-prime-blue-6)}.bcm-input__container.empty .input-clear-button{display:none}.bcm-input__container.invalid,.bcm-input__container.error{border-color:var(--bcm-new-ds-color-red-500)}.bcm-input__container .bcm-input-element{width:100%;color:var(--bcm-new-ds-color-slate-600);flex:1;border:none;background:transparent;box-shadow:unset;padding:0 4px;font-family:"Inter", sans-serif;cursor:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;text-overflow:ellipsis}.bcm-input__container .bcm-input-element::placeholder{font-family:"Inter", sans-serif;color:var(--bcm-new-ds-color-slate-300);user-select:none}.bcm-input__container .bcm-input-element::-webkit-search-decoration,.bcm-input__container .bcm-input-element::-webkit-search-cancel-button,.bcm-input__container .bcm-input-element::-webkit-search-results-button,.bcm-input__container .bcm-input-element::-webkit-search-results-decoration,.bcm-input__container .bcm-input-element::-webkit-calendar-picker-indicator,.bcm-input__container .bcm-input-element::-webkit-inner-spin-button,.bcm-input__container .bcm-input-element::-webkit-outer-spin-button{-webkit-appearance:none}.bcm-input__container .caret-container{width:30px;display:flex;flex-direction:column;justify-content:center;align-items:stretch;border-left:1px solid #D9D9D9;transition:0.2s opacity;user-select:none;box-sizing:border-box}.bcm-input__container .caret-container .bcm-input-caret{display:flex;align-items:center;justify-content:center;color:var(--bcm-color-grey-7);cursor:pointer;flex:1}.bcm-input__container .caret-container .bcm-input-caret bcm-icon{line-height:1}.bcm-input__container .caret-container .bcm-input-caret:hover{color:var(--bcm-color-prime-blue-6)}.bcm-input__container .caret-container .bcm-input-caret:active{background-color:var(--bcm-color-grey-3)}.bcm-input__container .caret-container .bcm-input-caret:last-child{border-top:1px solid #D9D9D9}.bcm-input__container .caret-container.disabled{background-color:var(--bcm-color-grey-3)}.bcm-input__container .caret-container.disabled .bcm-input-caret{cursor:not-allowed}.bcm-input__container .input-suffix-content{display:flex;align-items:center;justify-content:center}.bcm-input__container .input-prefix:not(:empty){padding-left:4px}.bcm-input__container .input-suffix:not(:empty){min-width:24px;padding-right:4px}.bcm-input__container .input-prefix:not(:empty),.bcm-input__container .input-suffix:not(:empty){display:flex;align-items:center;justify-content:center;cursor:default;color:#64748a}.bcm-input__container .input-prefix:not(:empty) .unit-prefix,.bcm-input__container .input-suffix:not(:empty) .unit-prefix{color:#64748a}.bcm-input__container .input-prefix-button:not(:empty),.bcm-input__container .input-suffix-button:not(:empty){cursor:pointer}.bcm-input__container .caret-container,.bcm-input__container .input-clear-button{opacity:0}.bcm-input__container--small{font-size:12px}.bcm-input__container--medium{font-size:14px}.bcm-input__container--large{font-size:16px}.bcm-input__textarea.clearable .bcm-input-element{padding-right:24px}.bcm-input__textarea .input-clear-button{position:absolute;top:4px;right:0}';export{l as bcm_input_2}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built with Stencil
|
|
3
|
+
* Copyright (c) Bromcom.
|
|
4
|
+
*/
|
|
5
|
+
import{s}from"./p-1830cdf1.js";class r{}r.isNumber=r=>s((()=>/^[0-9]+$/i.test(r))),r.convertToNumber=r=>s((()=>Number(r))),r.replaceNumber=r=>s((()=>r.replace(/[^0-9]/g,""))),r.replaceFloat=r=>s((()=>r.replace(/[^0-9.]/g,""))),r.toFixed=(r,a)=>s((()=>r.toFixed(a))),r.parseFloatFixed=(a,e)=>s((()=>parseFloat(r.replaceFloat(a)).toFixed(e))),r.getDecimalLength=r=>s((()=>r.split(".")[1]?r.split(".")[1].length:0)),r.toNumber=r=>s((()=>Number(r.replace(/[^0-9.]/g,""))));export{r as N}
|
|
@@ -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 r,H as t,g as a}from"./p-170cf07d.js";import{c as n}from"./p-64fad38b.js";import{G as c}from"./p-
|
|
5
|
+
import{r as e,c as i,h as r,H as t,g as a}from"./p-170cf07d.js";import{c as n}from"./p-64fad38b.js";import{G as c}from"./p-1830cdf1.js";import"./p-85eedabc.js";import"./p-a5d58be8.js";import"./p-a2df6c19.js";const s=class{constructor(r){e(this,r),this.bcmBreadcrumb=i(this,"bcm-breadcrumb-click",7),this.items=void 0,this.seperator="/",this.hidden=!1,this.isOpen=!1}handleClickOutside(e){this.el.contains(e.target)||this.isOpen&&(this.isOpen=!1)}handleOpen(e){this.isOpen=this.isOpen!=e&&e}parseItem(e,i){return e.index=i,e.id=e.id||c.UID(),e}render(){const{items:e,seperator:i,hidden:a}=this,s=n("bcm-breadcrumb","size-2",{hidden:a}),o=i=>r("bcm-link",Object.assign({id:i.id||c.UID(),onClick:()=>this.bcmBreadcrumb.emit(i),target:i.target&&i.index<e.length-1?i.target:"_self"},(1==i.child||i.index<e.length-1)&&i.href&&{href:i.href},{icon:i.icon?i.icon:null,class:n({active:i.index===e.length-1,"is-link":(1==i.child||i.index<e.length-1)&&i.href})}),i.label?i.label:null),m=i=>r("details",{class:n("bcm-breadcrumb__dropdown-item",{active:i.index===e.length-1,open:this.isOpen===i.id}),id:i.id,open:this.isOpen===i.id},r("summary",{onClick:()=>this.handleOpen(i.id),class:this.isOpen===i.id&&"open"},r("span",{class:"is-link"},r(o,Object.assign({},{icon:i.icon,label:i.label,href:"javascript:void(0)",index:i.index})),r("bcm-icon",{icon:"fas fa-caret-down"}))),r("div",{class:"bcm-breadcrumb__dropdown-submenu"},i.dropdown.map((e=>r("span",{class:"size-2 dropdown-item"},r(o,Object.assign({},e,{child:!0})))))));return r(t,{class:s},r("span",{hidden:!0},r("slot",null)),e.map(((t,a)=>r("span",{class:"bcm-breadcrumb__item"},t.dropdown&&t.dropdown.length>0?m(this.parseItem(t,a)):o(this.parseItem(t,a)),a<e.length-1?r("span",{class:"seperator"},i):null))))}get el(){return a(this)}};s.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-breadcrumb{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;flex-wrap:wrap;color:var(--bcm-color-grey-7)}.bcm-breadcrumb__item{display:flex;align-items:center}.bcm-breadcrumb .seperator{cursor:default;display:inline-flex;align-items:center;justify-content:center;margin-left:8px;margin-right:8px;color:var(--bcm-color-grey-7)}.bcm-breadcrumb bcm-link:hover{color:var(--bcm-color-grey-7)}.bcm-breadcrumb .active{color:var(--bcm-color-grey-8)}.bcm-breadcrumb .active:hover{color:var(--bcm-color-grey-8)}.bcm-breadcrumb .is-link:hover{color:var(--bcm-color-prime-blue-6)}.bcm-breadcrumb .is-link:hover bcm-link,.bcm-breadcrumb .is-link:hover bcm-icon{color:var(--bcm-color-prime-blue-6)}.bcm-breadcrumb__dropdown-item{position:relative;display:inline-flex}.bcm-breadcrumb__dropdown-item summary{display:inline-flex;align-items:center;cursor:pointer}.bcm-breadcrumb__dropdown-item summary>span{display:inline-flex;align-items:center}.bcm-breadcrumb__dropdown-item summary::-webkit-details-marker{display:none}.bcm-breadcrumb__dropdown-item summary:focus{outline:none}.bcm-breadcrumb__dropdown-item summary.open bcm-link,.bcm-breadcrumb__dropdown-item summary.open bcm-icon{color:var(--bcm-color-prime-blue-6)}.bcm-breadcrumb__dropdown-item summary .down-icon{margin-left:4px}.bcm-breadcrumb__dropdown-submenu{position:absolute;min-width:140px;background-color:var(--bcm-color-grey-1);box-shadow:0px 4px 4px rgba(0, 0, 0, 0.25);margin-top:4px}.bcm-breadcrumb__dropdown-submenu .dropdown-item{display:flex;padding:4px 8px}.bcm-breadcrumb__dropdown-submenu .dropdown-item bcm-link{width:100%}';export{s as bcm_breadcrumb}
|
|
@@ -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{G as o}from"./p-
|
|
5
|
+
import{r as t,h as e,H as s,g as r}from"./p-170cf07d.js";import{G as o}from"./p-1830cdf1.js";import{c as i}from"./p-64fad38b.js";import"./p-a5d58be8.js";import"./p-a2df6c19.js";import"./p-85eedabc.js";const l=class{constructor(e){t(this,e),this.handleFocus=()=>{this.hasFocus=!0},this.handleBlur=()=>{this.hasFocus=!1},this.handleChange=t=>{this.value=t.target.value,console.log(t)},this.handleInput=t=>{console.log(t)},this._id=o.UID(),this.name=void 0,this.value=void 0,this.type="text",this.label=void 0,this.required=!1,this.disabled=!1,this.readonly=!1,this.placeholder=void 0,this.fullwidth=!1,this.hasFocus=!1}render(){const{_id:t,type:r,name:o,value:l,label:a,required:w,fullwidth:d,placeholder:n,disabled:h,readonly:c}=this;return e(s,{class:i("tw-inline-flex tw-w-full tw-max-w-[256px] tw-flex-col",{"tw-max-w-full":d})},a&&e("bcm-label",{value:a,required:w,htmlFor:t}),e("div",{class:i("tw-relative tw-flex tw-w-full tw-flex-row tw-items-stretch tw-rounded tw-border tw-p-0 hover:tw-border-primary-600",{"tw-cursor-not-allowed tw-bg-secondary-50":this.disabled,"tw-cursor-text":!this.disabled,"tw-cursor-default tw-bg-secondary-50":this.readonly,"tw-border-primary-500 tw-bg-secondary-50":this.hasFocus,"tw-border-secondary-300 tw-bg-white":!this.hasFocus})},e("input",{id:t,name:o,type:r,value:l,"data-value":l,placeholder:n,required:w,disabled:h,readonly:c,class:i("tw-text-overflow-ellipsis","tw-rounded-none","tw-flex-1","tw-cursor-inherit","tw-w-full","tw-appearance-none","tw-overflow-hidden","tw-whitespace-nowrap","tw-border-none","tw-bg-transparent","tw-p-2","tw-text-secondary-600","tw-placeholder-secondary-300","tw-outline-none"),onFocus:this.handleFocus,onBlur:this.handleBlur,onChange:t=>this.handleChange(t),onInput:this.handleInput})))}get el(){return r(this)}};export{l as bcm_input_custom}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{r as t,c as i,f as e,h as o,H as n,g as l,F as s}from"./p-170cf07d.js";import"./p-499d8454.js";import"./p-626a65e9.js";import{G as r}from"./p-9ba753bf.js";import"./p-b93361f4.js";import"./p-d65bc842.js";import"./p-cbbc036b.js";import"./p-6f861fed.js";import{B as a}from"./p-a313fba6.js";import{C as d}from"./p-8e683b32.js";import{c as u}from"./p-64fad38b.js";import"./p-3fac58f7.js";import"./p-2e73d572.js";import{c as p}from"./p-08c75801.js";import"./p-436364c8.js";import"./p-6f2e4c9b.js";import"./p-a2df6c19.js";import"./p-85eedabc.js";import"./p-3ba6c610.js";const h=p({slots:{base:"tw-font-sans tw-flex tw-flex-col tw-items-start tw-justify-start tw-gap-2",content:"tw-flex tw-flex-row tw-items-center tw-justify-start tw-gap-3",inputArea:"tw-flex tw-flex-row tw-items-center tw-justify-start tw-gap-1 tw-box-content tw-border tw-border-solid tw-max-w-[100px] tw-uppercase tw-font-medium tw-text-center tw-border-gray-300 tw-rounded",input:"tw-flex-1 tw-text-inherit tw-uppercase tw-font-semibold tw-text-center tw-border-none tw-bg-transparent tw-outline-none tw-w-full",button:["input-dropdown-button tw-flex tw-flex-row tw-items-center tw-justify-center tw-gap-1 tw-rounded tw-outline-none tw-bg-slate-100","tw-border tw-border-solid tw-border-slate-300 tw-font-medium tw-text-slate-600","hover:tw-border-slate-400 hover:tw-bg-slate-200","tw-min-w-[32px]","tw-cursor-pointer","disabled:tw-cursor-not-allowed disabled:tw-text-slate-400 disabled:tw-pointer-events-none","readonly:tw-text-slate-700 readonly:tw-cursor-text"],menu:"tw-mt-1 tw-flex tw-flex-col tw-items-start tw-justify-center tw-gap-2 tw-overflow-auto tw-bg-white tw-p-3 tw-font-sans tw-text-3 tw-text-slate-700",menuItem:"tw-flex tw-w-full tw-cursor-pointer tw-flex-row tw-items-start tw-gap-1 tw-rounded tw-px-3 tw-py-1 tw-text-slate-700 hover:tw-bg-blue-100",selectedItem:"tw-flex tw-w-full tw-flex-row tw-items-start tw-gap-1 tw-rounded tw-px-3 tw-py-1 tw-text-slate-700 tw-bg-primary-200",disabledItem:"tw-flex tw-w-full tw-flex-row tw-items-start tw-gap-1 tw-rounded tw-px-3 tw-py-1 tw-cursor-not-allowed tw-text-slate-400 tw-bg-slate-100 hover:tw-bg-slate-100 tw-list-none",commentArea:"tw-flex tw-h-fit tw-w-full tw-min-w-[288px] tw-flex-col tw-items-start tw-rounded tw-p-4 tw-shadow-2"},variants:{size:{small:{button:"tw-h-[18px] tw-text-1 tw-leading-none"},medium:{button:"tw-h-[24px] tw-text-2",inputArea:"tw-p-0.5",input:"tw-text-4"},large:{button:"tw-h-[30px] tw-text-2",inputArea:"tw-p-1",input:"tw-text-6"}},invalid:{true:{inputArea:"tw-border-red-600 tw-bg-red-50",input:"tw-text-red-500"}},disabled:{true:{base:"tw-opacity-50 tw-cursor-not-allowed",input:"tw-cursor-not-allowed"}},hideComment:{true:{base:"tw-min-w-[98px]"},false:{base:"tw-min-w-[128px] "}},label:{true:""}},defaultVariants:{size:"medium",invalid:!1,hideComment:!1,disabled:!1}}),c=class{constructor(e){t(this,e),this.change=i(this,"bcm-change",7),this.onChangeDropdown=i(this,"bcm-input-dropdown-change",7),this.handleKeyPress=t=>{var i,e;(null===(e=null===(i=null==t?void 0:t.target)||void 0===i?void 0:i.value)||void 0===e?void 0:e.length)>=+this.maxCharacterLimit&&t.preventDefault()},this._id=r.UID(),this.value=void 0,this.defaultValue={},this.lateKeys="L",this.maxCharacterLimit=1,this.size=a.Size.medium,this.label=void 0,this.placeholder=void 0,this.name=void 0,this.fullWidth=!1,this.hideComment=!1,this.hideCaption=!0,this.disabled=!1,this.required=!1,this.readonly=!1,this.data=[{key:"/",value:"Present",color:"#00b050"},{key:"B",value:"Educated off site (NOT dual registration)",color:"#ffc000"},{key:"C",value:"Other authorised circumstance",color:"#ffc000"},{key:"D",value:"Dual registration",color:"#0070c0"},{key:"E",value:"Excluded",color:"#ff0000"},{key:"F",value:"Free Study",color:"#ffc000"},{key:"I",value:"Illness",color:"#ff0000"},{key:"J",value:"Interview",color:"#ffc000"},{key:"L",value:"Late before reg. closed",color:"#ffc000"}],this.caption=void 0,this.noCaption=!1,this.captionType=a.Status.default,this.captionError=void 0,this.customErrorMessage=void 0,this.captionCache=void 0,this.captionTypeCache=void 0,this.isOpenMenu=!1,this.invalid=!1}get overlayContainer(){return document.getElementById("bcm-overlay-container")}get menuContent(){var t,i;return null!==(i=null===(t=this.overlayContainer)||void 0===t?void 0:t.querySelector(`#i-dropdown-menu-${this._id}`))&&void 0!==i?i:this.el.querySelector(`#i-dropdown-menu-${this._id}`)}get keys(){return this.lateKeys.toLocaleLowerCase().split(",")}get isLate(){var t,i,e,o,n,l;return this.keys.includes(null===(i=null===(t=this.value)||void 0===t?void 0:t.key)||void 0===i?void 0:i.toLocaleLowerCase())||(null===(o=null===(e=this.data)||void 0===e?void 0:e.find((t=>{var i,e,o;return(null===(i=null==t?void 0:t.key)||void 0===i?void 0:i.toLowerCase())===(null===(o=null===(e=this.value)||void 0===e?void 0:e.key)||void 0===o?void 0:o.toLowerCase())})))||void 0===o?void 0:o.isLate)||(null===(l=null===(n=this.data)||void 0===n?void 0:n.find((t=>{var i,e,o;return(null===(i=null==t?void 0:t.key)||void 0===i?void 0:i.toLowerCase())===(null===(o=null===(e=this.value)||void 0===e?void 0:e.key)||void 0===o?void 0:o.toLowerCase())})))||void 0===l?void 0:l.lateMin)>0}componentWillLoad(){var t,i;this.captionCache=this.caption,this.captionTypeCache=this.captionType,(null===(t=Object.keys(this.defaultValue))||void 0===t?void 0:t.length)>0?this.watchDefaultValueHandler(this.defaultValue):this.value=null===(i=this.data)||void 0===i?void 0:i.find((t=>t.selected))}get commentContent(){var t,i;return null!==(i=null===(t=this.overlayContainer)||void 0===t?void 0:t.querySelector(`#i-dropdown-comment-${this._id}`))&&void 0!==i?i:this.el.querySelector(`#i-dropdown-comment-${this._id}`)}clickListener(t){var i,e;const o=r.findEventPath(t,this.el),n=r.findEventPathWithNodeName(t,"BCM-LINKED");o||n||this.keys.includes(null===(i=this.value)||void 0===i?void 0:i.key)||null===(e=this.commentContent)||void 0===e||e.hide()}watchDefaultValueHandler(t){var i,o;t&&(this.value=null===(i=this.data)||void 0===i?void 0:i.find((i=>{var e,o;return(null===(e=null==i?void 0:i.key)||void 0===e?void 0:e.toLowerCase())===(null===(o=t.key)||void 0===o?void 0:o.toLowerCase())})),this.data=this.data.map((i=>(i.key===(null==t?void 0:t.key)?(i=t).selected=!0:i.selected=!1,i))),this.value=null===(o=this.data)||void 0===o?void 0:o.find((t=>null==t?void 0:t.selected)),e(this.el))}async set(t){this.data="string"==typeof t?JSON.parse(t):t}async get(){return this.value}async setClear(){return this.value=null,Promise.resolve()}async resetCaption(){return this.caption=this.captionCache,this.captionType=this.captionTypeCache,this.captionError=null,this.invalid=!1,Promise.resolve()}onSelectItem(t){var i;this.invalid=!1,this.data=this.data.map((i=>Object.assign(Object.assign({},i),{selected:i.key===t.key}))),this.value=null===(i=this.data)||void 0===i?void 0:i.find((t=>null==t?void 0:t.selected)),this.onChangeDropdown.emit(this.value),this.change.emit()}async handleInput(t){var i,e,o,n,l,s,r;const a=null===(i=null==t?void 0:t.target)||void 0===i?void 0:i.value;if(this.isOpenMenu=!0,(null==a?void 0:a.length)>=+this.maxCharacterLimit){const i=null===(e=this.data)||void 0===e?void 0:e.find((t=>{var i;return(null===(i=null==t?void 0:t.key)||void 0===i?void 0:i.toLowerCase())===a.toLowerCase()}));i?(await(null===(o=this.menuContent)||void 0===o?void 0:o.hide()),(null==i?void 0:i.hideComment)||null===(n=this.commentContent)||void 0===n||n.show(),this.onSelectItem(i)):(this.invalid=!0,this.value=t.target.value,await(null===(l=this.menuContent)||void 0===l?void 0:l.show()),this._input.style.color="#ff0000")}else null===(s=this.commentContent)||void 0===s||s.hide(),null===(r=this.menuContent)||void 0===r||r.hide(),this.value=null,this._input.style.color="#000000",this.invalid=!1;this.change.emit()}onClickSave(){var t;null===(t=this.commentContent)||void 0===t||t.hide(),this.data=this.data.map((t=>Object.assign(Object.assign({},t),t.key===this.value.key&&{lateMin:this.value.lateMin,comment:this.value.comment}))),e(this.el),this.onChangeDropdown.emit(this.value),this.change.emit()}async onClick(t){var i,e;(null==t?void 0:t.hideComment)||null===(i=this.commentContent)||void 0===i||i.show(),await(null===(e=this.menuContent)||void 0===e?void 0:e.hide()),this.onSelectItem(t)}render(){var t,i,e,l,r;const{size:a,label:p,placeholder:c,required:m,disabled:w,readonly:v,_id:x,invalid:b,hideComment:g,noCaption:f,customErrorMessage:y,caption:z,captionType:j,captionError:k,hideCaption:C}=this,{base:I,inputArea:E,input:L,button:O,menu:M,menuItem:$,commentArea:A,disabledItem:B,content:D,selectedItem:S}=h({size:a,invalid:b,hideComment:g,disabled:w});return o(n,{class:I()},p&&o("bcm-label",{htmlFor:x+"-dropdown-input",size:a,value:p,required:m}),o("div",{class:D()},o("div",{class:E()},o("input",{id:x+"-dropdown-input",class:L(),style:{color:null===(t=this.value)||void 0===t?void 0:t.color},type:"text",tabIndex:-1,placeholder:c,value:null===(i=this.value)||void 0===i?void 0:i.key,disabled:w,required:m,autoComplete:"off",readOnly:v,onKeyPress:t=>this.handleKeyPress(t),onInput:t=>this.handleInput(t),ref:t=>this._input=t}),o("button",{disabled:w,id:`i-dropdown-button-${x}`,class:O(),onClick:()=>this.isOpenMenu=!0},o("i",{class:"fas fa-chevron-down"})),o("bcm-linked",{"onBcm-open":({detail:t})=>{var i;return t&&(null===(i=this.commentContent)||void 0===i?void 0:i.hide())},class:"tw-mt-1",id:`i-dropdown-menu-${x}`,"target-id":`i-dropdown-button-${x}`,placement:"bottom-start"},o((()=>{var t;return o(s,null,this.isOpenMenu?o("div",{class:M()},this.invalid&&o("li",{class:$()+" tw-bg-red-100 hover:tw-bg-red-100"},o("span",{class:"tw-text-red-900"},o("i",{class:"far fa-exclamation-circle"})),o("span",null,"There is not mark you entered, please use")),null===(t=this.data)||void 0===t?void 0:t.map((t=>o(s,null,o("li",(null==t?void 0:t.disabled)?{class:B()}:{class:(null==t?void 0:t.selected)?S():$(),onClick:()=>this.onClick(t)},o("span",null,t.key)," - ",o("span",null,t.value)))))):null)}),null)),o("bcm-linked",{id:`i-dropdown-comment-${x}`,"target-id":x,trigger:"custom",placement:"left"},o((()=>{var t,i,e;return o(s,null,this.isOpenMenu?o("div",{class:A()},this.isLate?o(s,null,o("bcm-input",{label:"Minus Late",required:!0,id:this._id+"-input-dropdown-late-content-input",type:"number","full-width":!0,autocomplete:!1,min:0,max:200,value:null===(t=this.value)||void 0===t?void 0:t.lateMin,placeholder:"Enter Minus Late",customErrorMessage:"Max limit 200 mins","onBcm-change":({detail:t})=>this.value.lateMin=+t},o("i",{slot:"prefix",class:"far fa-clock"}))):null,o("bcm-textarea",{"full-width":!0,value:null!==(e=null===(i=this.value)||void 0===i?void 0:i.comment)&&void 0!==e?e:"","onBcm-change":({detail:t})=>this.value.comment=t,label:"Description","no-caption":!0,rows:4}),o("footer",{class:"tw-flex tw-w-full tw-flex-row tw-items-center tw-justify-end tw-gap-2"},o("bcm-button",{role:"button","aria-labelledby":"button","aria-label":"button",icon:"fas fa-times",kind:"ghost","icon-position":"prefix",onClick:()=>{var t;return null===(t=this.commentContent)||void 0===t?void 0:t.hide()}},"Close"),o("bcm-button",{role:"button","aria-labelledby":"button","aria-label":"button",icon:"fas fa-save","icon-position":"prefix",onClick:()=>this.onClickSave()},"Save"))):null)}),null))),this.hideComment?null:o("span",{onClick:()=>{var t,i;(null===(t=this.value)||void 0===t?void 0:t.key)&&(this.isOpenMenu=!0,null===(i=this.commentContent)||void 0===i||i.show())},class:u((null===(e=this.value)||void 0===e?void 0:e.comment)||(null===(l=this.value)||void 0===l?void 0:l.lateMin)>0?"tw-text-slate-600":"tw-text-slate-400",{"tw-cursor-pointer":null===(r=this.value)||void 0===r?void 0:r.key})},o("i",{class:"fas fa-comment"}))),!C&&o(d,{noCaption:f,captionType:j,captionError:k,caption:z,customErrorMessage:y}))}get el(){return l(this)}static get watchers(){return{defaultValue:["watchDefaultValueHandler"]}}};c.style='@import url("https://fonts.googleapis.com/css?family=Roboto:400,500");.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}.bcm-input[no-margin]{margin:0}.bcm-textarea[no-margin]{margin:0}.bcm-switch[no-margin]{margin:0}.bcm-checkbox[no-margin]{margin:0}.bcm-radio-group[no-margin]{margin:0}.bcm-checkbox-group[no-margin]{margin:0}.bcm-range[no-margin]{margin:0}.bcm-form[no-margin]{margin:0}.bcm-form-group[no-margin]{margin:0}.bcm-list[no-margin]{margin:0}.bcm-colorpicker[no-margin]{margin:0}.bcm-date-picker[no-margin]{margin:0}.bcm-time-picker[no-margin]{margin:0}.bcm-datetime-picker[no-margin]{margin:0}.bcm-select[no-margin]{margin:0}.bcm-listbox[no-margin]{margin:0}:host{display:flex;flex-direction:column;width:100%;position:relative}.input-dropdown-button i{transition:transform 0.2s ease-in-out}.input-dropdown-button[linked-is-open]>i{transform:rotate(-180deg);transition:transform 0.2s ease-in-out}';export{c as bcm_input_dropdown}
|
|
5
|
+
import{r as t,c as i,f as e,h as o,H as n,g as l,F as s}from"./p-170cf07d.js";import"./p-499d8454.js";import"./p-626a65e9.js";import{G as r}from"./p-1830cdf1.js";import"./p-81d248d8.js";import"./p-d65bc842.js";import"./p-af8674da.js";import"./p-6f861fed.js";import{B as a}from"./p-a313fba6.js";import{C as d}from"./p-8e683b32.js";import{c as u}from"./p-64fad38b.js";import"./p-3fac58f7.js";import"./p-2e73d572.js";import{c as p}from"./p-08c75801.js";import"./p-436364c8.js";import"./p-6f2e4c9b.js";import"./p-a2df6c19.js";import"./p-85eedabc.js";import"./p-a5d58be8.js";const h=p({slots:{base:"tw-font-sans tw-flex tw-flex-col tw-items-start tw-justify-start tw-gap-2",content:"tw-flex tw-flex-row tw-items-center tw-justify-start tw-gap-3",inputArea:"tw-flex tw-flex-row tw-items-center tw-justify-start tw-gap-1 tw-box-content tw-border tw-border-solid tw-max-w-[100px] tw-uppercase tw-font-medium tw-text-center tw-border-gray-300 tw-rounded",input:"tw-flex-1 tw-text-inherit tw-uppercase tw-font-semibold tw-text-center tw-border-none tw-bg-transparent tw-outline-none tw-w-full",button:["input-dropdown-button tw-flex tw-flex-row tw-items-center tw-justify-center tw-gap-1 tw-rounded tw-outline-none tw-bg-slate-100","tw-border tw-border-solid tw-border-slate-300 tw-font-medium tw-text-slate-600","hover:tw-border-slate-400 hover:tw-bg-slate-200","tw-min-w-[32px]","tw-cursor-pointer","disabled:tw-cursor-not-allowed disabled:tw-text-slate-400 disabled:tw-pointer-events-none","readonly:tw-text-slate-700 readonly:tw-cursor-text"],menu:"tw-mt-1 tw-flex tw-flex-col tw-items-start tw-justify-center tw-gap-2 tw-overflow-auto tw-bg-white tw-p-3 tw-font-sans tw-text-3 tw-text-slate-700",menuItem:"tw-flex tw-w-full tw-cursor-pointer tw-flex-row tw-items-start tw-gap-1 tw-rounded tw-px-3 tw-py-1 tw-text-slate-700 hover:tw-bg-blue-100",selectedItem:"tw-flex tw-w-full tw-flex-row tw-items-start tw-gap-1 tw-rounded tw-px-3 tw-py-1 tw-text-slate-700 tw-bg-primary-200",disabledItem:"tw-flex tw-w-full tw-flex-row tw-items-start tw-gap-1 tw-rounded tw-px-3 tw-py-1 tw-cursor-not-allowed tw-text-slate-400 tw-bg-slate-100 hover:tw-bg-slate-100 tw-list-none",commentArea:"tw-flex tw-h-fit tw-w-full tw-min-w-[288px] tw-flex-col tw-items-start tw-rounded tw-p-4 tw-shadow-2"},variants:{size:{small:{button:"tw-h-[18px] tw-text-1 tw-leading-none"},medium:{button:"tw-h-[24px] tw-text-2",inputArea:"tw-p-0.5",input:"tw-text-4"},large:{button:"tw-h-[30px] tw-text-2",inputArea:"tw-p-1",input:"tw-text-6"}},invalid:{true:{inputArea:"tw-border-red-600 tw-bg-red-50",input:"tw-text-red-500"}},disabled:{true:{base:"tw-opacity-50 tw-cursor-not-allowed",input:"tw-cursor-not-allowed"}},hideComment:{true:{base:"tw-min-w-[98px]"},false:{base:"tw-min-w-[128px] "}},label:{true:""}},defaultVariants:{size:"medium",invalid:!1,hideComment:!1,disabled:!1}}),c=class{constructor(e){t(this,e),this.change=i(this,"bcm-change",7),this.onChangeDropdown=i(this,"bcm-input-dropdown-change",7),this.handleKeyPress=t=>{var i,e;(null===(e=null===(i=null==t?void 0:t.target)||void 0===i?void 0:i.value)||void 0===e?void 0:e.length)>=+this.maxCharacterLimit&&t.preventDefault()},this._id=r.UID(),this.value=void 0,this.defaultValue={},this.lateKeys="L",this.maxCharacterLimit=1,this.size=a.Size.medium,this.label=void 0,this.placeholder=void 0,this.name=void 0,this.fullWidth=!1,this.hideComment=!1,this.hideCaption=!0,this.disabled=!1,this.required=!1,this.readonly=!1,this.data=[{key:"/",value:"Present",color:"#00b050"},{key:"B",value:"Educated off site (NOT dual registration)",color:"#ffc000"},{key:"C",value:"Other authorised circumstance",color:"#ffc000"},{key:"D",value:"Dual registration",color:"#0070c0"},{key:"E",value:"Excluded",color:"#ff0000"},{key:"F",value:"Free Study",color:"#ffc000"},{key:"I",value:"Illness",color:"#ff0000"},{key:"J",value:"Interview",color:"#ffc000"},{key:"L",value:"Late before reg. closed",color:"#ffc000"}],this.caption=void 0,this.noCaption=!1,this.captionType=a.Status.default,this.captionError=void 0,this.customErrorMessage=void 0,this.captionCache=void 0,this.captionTypeCache=void 0,this.isOpenMenu=!1,this.invalid=!1}get overlayContainer(){return document.getElementById("bcm-overlay-container")}get menuContent(){var t,i;return null!==(i=null===(t=this.overlayContainer)||void 0===t?void 0:t.querySelector(`#i-dropdown-menu-${this._id}`))&&void 0!==i?i:this.el.querySelector(`#i-dropdown-menu-${this._id}`)}get keys(){return this.lateKeys.toLocaleLowerCase().split(",")}get isLate(){var t,i,e,o,n,l;return this.keys.includes(null===(i=null===(t=this.value)||void 0===t?void 0:t.key)||void 0===i?void 0:i.toLocaleLowerCase())||(null===(o=null===(e=this.data)||void 0===e?void 0:e.find((t=>{var i,e,o;return(null===(i=null==t?void 0:t.key)||void 0===i?void 0:i.toLowerCase())===(null===(o=null===(e=this.value)||void 0===e?void 0:e.key)||void 0===o?void 0:o.toLowerCase())})))||void 0===o?void 0:o.isLate)||(null===(l=null===(n=this.data)||void 0===n?void 0:n.find((t=>{var i,e,o;return(null===(i=null==t?void 0:t.key)||void 0===i?void 0:i.toLowerCase())===(null===(o=null===(e=this.value)||void 0===e?void 0:e.key)||void 0===o?void 0:o.toLowerCase())})))||void 0===l?void 0:l.lateMin)>0}componentWillLoad(){var t,i;this.captionCache=this.caption,this.captionTypeCache=this.captionType,(null===(t=Object.keys(this.defaultValue))||void 0===t?void 0:t.length)>0?this.watchDefaultValueHandler(this.defaultValue):this.value=null===(i=this.data)||void 0===i?void 0:i.find((t=>t.selected))}get commentContent(){var t,i;return null!==(i=null===(t=this.overlayContainer)||void 0===t?void 0:t.querySelector(`#i-dropdown-comment-${this._id}`))&&void 0!==i?i:this.el.querySelector(`#i-dropdown-comment-${this._id}`)}clickListener(t){var i,e;const o=r.findEventPath(t,this.el),n=r.findEventPathWithNodeName(t,"BCM-LINKED");o||n||this.keys.includes(null===(i=this.value)||void 0===i?void 0:i.key)||null===(e=this.commentContent)||void 0===e||e.hide()}watchDefaultValueHandler(t){var i,o;t&&(this.value=null===(i=this.data)||void 0===i?void 0:i.find((i=>{var e,o;return(null===(e=null==i?void 0:i.key)||void 0===e?void 0:e.toLowerCase())===(null===(o=t.key)||void 0===o?void 0:o.toLowerCase())})),this.data=this.data.map((i=>(i.key===(null==t?void 0:t.key)?(i=t).selected=!0:i.selected=!1,i))),this.value=null===(o=this.data)||void 0===o?void 0:o.find((t=>null==t?void 0:t.selected)),e(this.el))}async set(t){this.data="string"==typeof t?JSON.parse(t):t}async get(){return this.value}async setClear(){return this.value=null,Promise.resolve()}async resetCaption(){return this.caption=this.captionCache,this.captionType=this.captionTypeCache,this.captionError=null,this.invalid=!1,Promise.resolve()}onSelectItem(t){var i;this.invalid=!1,this.data=this.data.map((i=>Object.assign(Object.assign({},i),{selected:i.key===t.key}))),this.value=null===(i=this.data)||void 0===i?void 0:i.find((t=>null==t?void 0:t.selected)),this.onChangeDropdown.emit(this.value),this.change.emit()}async handleInput(t){var i,e,o,n,l,s,r;const a=null===(i=null==t?void 0:t.target)||void 0===i?void 0:i.value;if(this.isOpenMenu=!0,(null==a?void 0:a.length)>=+this.maxCharacterLimit){const i=null===(e=this.data)||void 0===e?void 0:e.find((t=>{var i;return(null===(i=null==t?void 0:t.key)||void 0===i?void 0:i.toLowerCase())===a.toLowerCase()}));i?(await(null===(o=this.menuContent)||void 0===o?void 0:o.hide()),(null==i?void 0:i.hideComment)||null===(n=this.commentContent)||void 0===n||n.show(),this.onSelectItem(i)):(this.invalid=!0,this.value=t.target.value,await(null===(l=this.menuContent)||void 0===l?void 0:l.show()),this._input.style.color="#ff0000")}else null===(s=this.commentContent)||void 0===s||s.hide(),null===(r=this.menuContent)||void 0===r||r.hide(),this.value=null,this._input.style.color="#000000",this.invalid=!1;this.change.emit()}onClickSave(){var t;null===(t=this.commentContent)||void 0===t||t.hide(),this.data=this.data.map((t=>Object.assign(Object.assign({},t),t.key===this.value.key&&{lateMin:this.value.lateMin,comment:this.value.comment}))),e(this.el),this.onChangeDropdown.emit(this.value),this.change.emit()}async onClick(t){var i,e;(null==t?void 0:t.hideComment)||null===(i=this.commentContent)||void 0===i||i.show(),await(null===(e=this.menuContent)||void 0===e?void 0:e.hide()),this.onSelectItem(t)}render(){var t,i,e,l,r;const{size:a,label:p,placeholder:c,required:m,disabled:w,readonly:v,_id:x,invalid:g,hideComment:f,noCaption:b,customErrorMessage:y,caption:z,captionType:j,captionError:k,hideCaption:C}=this,{base:I,inputArea:E,input:L,button:O,menu:M,menuItem:$,commentArea:A,disabledItem:B,content:D,selectedItem:S}=h({size:a,invalid:g,hideComment:f,disabled:w});return o(n,{class:I()},p&&o("bcm-label",{htmlFor:x+"-dropdown-input",size:a,value:p,required:m}),o("div",{class:D()},o("div",{class:E()},o("input",{id:x+"-dropdown-input",class:L(),style:{color:null===(t=this.value)||void 0===t?void 0:t.color},type:"text",tabIndex:-1,placeholder:c,value:null===(i=this.value)||void 0===i?void 0:i.key,disabled:w,required:m,autoComplete:"off",readOnly:v,onKeyPress:t=>this.handleKeyPress(t),onInput:t=>this.handleInput(t),ref:t=>this._input=t}),o("button",{disabled:w,id:`i-dropdown-button-${x}`,class:O(),onClick:()=>this.isOpenMenu=!0},o("i",{class:"fas fa-chevron-down"})),o("bcm-linked",{"onBcm-open":({detail:t})=>{var i;return t&&(null===(i=this.commentContent)||void 0===i?void 0:i.hide())},class:"tw-mt-1",id:`i-dropdown-menu-${x}`,"target-id":`i-dropdown-button-${x}`,placement:"bottom-start"},o((()=>{var t;return o(s,null,this.isOpenMenu?o("div",{class:M()},this.invalid&&o("li",{class:$()+" tw-bg-red-100 hover:tw-bg-red-100"},o("span",{class:"tw-text-red-900"},o("i",{class:"far fa-exclamation-circle"})),o("span",null,"There is not mark you entered, please use")),null===(t=this.data)||void 0===t?void 0:t.map((t=>o(s,null,o("li",(null==t?void 0:t.disabled)?{class:B()}:{class:(null==t?void 0:t.selected)?S():$(),onClick:()=>this.onClick(t)},o("span",null,t.key)," - ",o("span",null,t.value)))))):null)}),null)),o("bcm-linked",{id:`i-dropdown-comment-${x}`,"target-id":x,trigger:"custom",placement:"left"},o((()=>{var t,i,e;return o(s,null,this.isOpenMenu?o("div",{class:A()},this.isLate?o(s,null,o("bcm-input",{label:"Minus Late",required:!0,id:this._id+"-input-dropdown-late-content-input",type:"number","full-width":!0,autocomplete:!1,min:0,max:200,value:null===(t=this.value)||void 0===t?void 0:t.lateMin,placeholder:"Enter Minus Late",customErrorMessage:"Max limit 200 mins","onBcm-change":({detail:t})=>this.value.lateMin=+t},o("i",{slot:"prefix",class:"far fa-clock"}))):null,o("bcm-textarea",{"full-width":!0,value:null!==(e=null===(i=this.value)||void 0===i?void 0:i.comment)&&void 0!==e?e:"","onBcm-change":({detail:t})=>this.value.comment=t,label:"Description","no-caption":!0,rows:4}),o("footer",{class:"tw-flex tw-w-full tw-flex-row tw-items-center tw-justify-end tw-gap-2"},o("bcm-button",{role:"button","aria-labelledby":"button","aria-label":"button",icon:"fas fa-times",kind:"ghost","icon-position":"prefix",onClick:()=>{var t;return null===(t=this.commentContent)||void 0===t?void 0:t.hide()}},"Close"),o("bcm-button",{role:"button","aria-labelledby":"button","aria-label":"button",icon:"fas fa-save","icon-position":"prefix",onClick:()=>this.onClickSave()},"Save"))):null)}),null))),this.hideComment?null:o("span",{onClick:()=>{var t,i;(null===(t=this.value)||void 0===t?void 0:t.key)&&(this.isOpenMenu=!0,null===(i=this.commentContent)||void 0===i||i.show())},class:u((null===(e=this.value)||void 0===e?void 0:e.comment)||(null===(l=this.value)||void 0===l?void 0:l.lateMin)>0?"tw-text-slate-600":"tw-text-slate-400",{"tw-cursor-pointer":null===(r=this.value)||void 0===r?void 0:r.key})},o("i",{class:"fas fa-comment"}))),!C&&o(d,{noCaption:b,captionType:j,captionError:k,caption:z,customErrorMessage:y}))}get el(){return l(this)}static get watchers(){return{defaultValue:["watchDefaultValueHandler"]}}};c.style='@import url("https://fonts.googleapis.com/css?family=Roboto:400,500");.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}.bcm-input[no-margin]{margin:0}.bcm-textarea[no-margin]{margin:0}.bcm-switch[no-margin]{margin:0}.bcm-checkbox[no-margin]{margin:0}.bcm-radio-group[no-margin]{margin:0}.bcm-checkbox-group[no-margin]{margin:0}.bcm-range[no-margin]{margin:0}.bcm-form[no-margin]{margin:0}.bcm-form-group[no-margin]{margin:0}.bcm-list[no-margin]{margin:0}.bcm-colorpicker[no-margin]{margin:0}.bcm-date-picker[no-margin]{margin:0}.bcm-time-picker[no-margin]{margin:0}.bcm-datetime-picker[no-margin]{margin:0}.bcm-select[no-margin]{margin:0}.bcm-listbox[no-margin]{margin:0}:host{display:flex;flex-direction:column;width:100%;position:relative}.input-dropdown-button i{transition:transform 0.2s ease-in-out}.input-dropdown-button[linked-is-open]>i{transform:rotate(-180deg);transition:transform 0.2s ease-in-out}';export{c as bcm_input_dropdown}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{r as e,h as i,H as t,g as p}from"./p-170cf07d.js";import{G as a}from"./p-
|
|
5
|
+
import{r as e,h as i,H as t,g as p}from"./p-170cf07d.js";import{G as a}from"./p-1830cdf1.js";import"./p-a5d58be8.js";import"./p-a2df6c19.js";import"./p-85eedabc.js";const s=class{constructor(i){e(this,i),this._id=a.UID()}render(){return i(t,null,i("bcm-skeleton",null,i("slot",null)))}get el(){return p(this)}};s.style='@import url("https://fonts.googleapis.com/css?family=Roboto:400,500");.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}:host{display:block}';export{s as bcm_default}
|