@descope/web-components-ui 1.90.0 → 1.91.0
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/cjs/index.cjs.js +21 -1
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +21 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/DescopeDev.js.map +1 -1
- package/dist/umd/descope-date-field-index-js.js +1 -1
- package/dist/umd/descope-date-field-index-js.js.map +1 -1
- package/package.json +1 -1
- package/src/components/descope-date-field/DateFieldClass.js +21 -1
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[9257],{6424:(e,t,r)=>{r.d(t,{A:()=>C});const{host:i,label:n,placeholder:o,requiredIndicator:s,inputField:a,input:l,inputMask:p,helperText:d,errorMessage:c,disabledPlaceholder:h,inputDisabled:u,inputIcon:g,externalInput:y,externalInputDisabled:m,externalPlaceholder:v,externalDisabledPlaceholder:b}={host:{selector:()=>":host"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},placeholder:[{selector:"> input:placeholder-shown"},{selector:()=>":host::slotted(input:placeholder-shown)"}],disabledPlaceholder:{selector:"> input:disabled::placeholder"},inputField:{selector:"::part(input-field)"},input:{selector:"input"},inputMask:{selector:"::part(input-field)::before"},inputDisabled:{selector:"input:disabled"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"},inputIcon:{selector:"vaadin-icon"},externalInput:{selector:()=>"::slotted(input)"},externalInputDisabled:{selector:()=>"::slotted(input:disabled)"},externalPlaceholder:{selector:()=>"::slotted(input:placeholder-shown)"},externalDisabledPlaceholder:{selector:()=>"::slotted(input:disabled::placeholder)"}},C={fontSize:[{},i],fontFamily:[n,a,d,c],labelFontSize:{...n,property:"font-size"},labelFontWeight:{...n,property:"font-weight"},labelTextColor:[{...n,property:"color"},{...s,property:"color"},{...n,property:"-webkit-text-fill-color"},{...s,property:"-webkit-text-fill-color"}],hostWidth:{...i,property:"width"},hostMinWidth:{...i,property:"min-width"},hostDirection:{...i,property:"direction"},inputDirection:{...l,property:"direction"},inputBackgroundColor:[{...a,property:"background-color"},{...p,property:"background-color"}],errorMessageTextColor:{...c,property:"color"},errorMessageIcon:{...c,property:"background-image"},errorMessageIconSize:{...c,property:"background-size"},errorMessageIconPadding:{...c,property:"padding-inline-start"},errorMessageIconRepeat:{...c,property:"background-repeat"},errorMessageIconPosition:{...c,property:"background-position"},errorMessageFontSize:{...c,property:"font-size"},helperTextColor:{...d,property:"-webkit-text-fill-color"},inputValueTextColor:[{...a,property:"color"},{...u,property:"-webkit-text-fill-color"},{...m,property:"-webkit-text-fill-color"}],inputCaretTextColor:[{...l,property:"caret-color"},{...y,property:"caret-color"}],labelRequiredIndicator:{...s,property:"content"},inputBorderColor:{...a,property:"border-color"},inputBorderWidth:{...a,property:"border-width"},inputBorderStyle:{...a,property:"border-style"},inputBorderRadius:{...a,property:"border-radius"},inputHeight:{...a,property:"height"},inputHorizontalPadding:[{...l,property:"padding-left"},{...l,property:"padding-right"},{...y,property:"padding-left"},{...y,property:"padding-right"}],inputOutlineColor:{...a,property:"outline-color"},inputOutlineStyle:{...a,property:"outline-style"},inputOutlineWidth:{...a,property:"outline-width"},inputOutlineOffset:{...a,property:"outline-offset"},textAlign:{},inputTextAlign:[{...l,property:"text-align"},{...y,property:"text-align"}],inputPlaceholderColor:[{selector:()=>":host input:placeholder-shown",property:"color"},{...v,property:"color"},{...o,property:"color"},{...h,property:"-webkit-text-fill-color"},{...b,property:"-webkit-text-fill-color"}],labelPosition:{...n,property:"position"},labelTopPosition:{...n,property:"top"},labelHorizontalPosition:[{...n,property:"left"},{...n,property:"right"}],inputTransformY:{...n,property:"transform"},inputTransition:{...n,property:"transition"},marginInlineStart:{...n,property:"margin-inline-start"},placeholderOpacity:[{selector:"> input:placeholder-shown",property:"opacity"},{...v,property:"opacity"}],inputVerticalAlignment:[{...a,property:"align-items"},{...y,property:"align-items"}],valueInputHeight:[{...l,property:"height"},{...y,property:"height"}],valueInputMarginBottom:[{...l,property:"margin-bottom"},{...y,property:"margin-bottom"}],inputIconOffset:[{...g,property:"margin-right"},{...g,property:"margin-left"}],inputIconSize:{...g,property:"font-size"},inputIconColor:{...g,property:"color"}}},21374:(e,t,r)=>{r.r(t),r.d(t,{TextFieldClass:()=>i.w,componentName:()=>i.T}),r(11284),r(37182),r(95260);var i=r(79275);customElements.define(i.T,i.w)},64609:(e,t,r)=>{r.r(t),r.d(t,{DateFieldClass:()=>S,componentName:()=>m}),r(45992),r(88350),r(21374);var i=r(3393),n=r(79365),o=r(97810),s=r(9696),a=r(49224),l=r(64101);const p={MM:"(0?[1-9]|1[0-2])",DD:"(0?[1-9]|[12][0-9]|3[01])",YYYY:"([0-9]{4})"},d=e=>{const t=(e=>`^${e.split(l.eT).map((e=>p[e])).join("\\D")}$`)(e),r=(e=>{const t=e.split(l.eT);return e=>{const r={};return t.forEach(((t,i)=>{r[t]=e[i+1]})),[r.YYYY,r.MM,r.DD]}})(e),i=new RegExp(t);return{pattern:t,validate:e=>i.test(e),getDate:e=>((e,t,r)=>{const i=t.exec(e);if(!i)return null;const[n,o,s]=r(i);return(0,a.Nq)([n,o,s].join(l.eT))})(e,i,r)}},c=Object.fromEntries(l.SP.map((e=>[e,d(e)])));var h=r(80071);class u{#e=Object.freeze([]);constructor({id:e,min:t,max:r,placeholder:i},n){this.id=e,this.min=t,this.max=r,this.placeholder=i,this.onChange=n}get data(){return this.#e}set data(e){this.#e=Object.freeze(e),this.onChange?.()}get#t(){return this.data.length?this.numberValue:0}get numberValue(){return Number(this.stringValue)}get stringValue(){return(this.data.join("")||this.placeholder).padStart(this.length,"0")}get isFull(){return 10*this.numberValue>this.max||this.data.length===this.length}get isEmpty(){return this.stringValue===this.placeholder}get length(){return this.max.toString().length}set(e){this.data=e.toString().split("")}add(e){let t=this.data;return t=[...t,e],this.numberValue>this.max?t=[e]:this.length<t.length&&(t=t.slice(1,t.length)),this.data=t,e}del(){this.data.filter((e=>"0"!==e)).filter(Boolean).length?this.data=this.data.slice(0,this.data.length-1):this.data=[]}clear(){this.data=[]}inc(e){this.replaceValue(this.#t<this.max?Math.max(this.#t+(e||1),this.min):this.min)}dec(e){this.replaceValue(this.#t>this.min?Math.min(this.#t-(e||1),this.max):this.max)}isInRange(e){return e>=this.min&&e<=this.max}replaceValue(e){this.isInRange(e)&&(this.data=e.toString().padStart(this.length,0).split(""))}setMin(e){this.min=Number(e)}setMax(e){this.max=Number(e)}}var g=r(79275),y=r(25964);const m=(0,o.xE)("date-field"),v=(0,i.y)({componentName:m,baseSelector:"vaadin-popover"}),b=["format","opened","initial-value","readonly"],C=["years-range","calendar-months","calendar-weekdays"],f=[...b,...C],x=g.w.cssVarList,{host:w,input:E,inputEleRTL:k,toggleButton:I,overlay:V,backdrop:P,errorMessage:T}={host:{selector:()=>":host"},input:{selector:()=>"descope-text-field"},inputEleRTL:{selector:()=>':host([st-host-direction="rtl"]) descope-text-field'},toggleButton:{selector:()=>".toggle-calendar"},overlay:{selector:"vaadin-popover-overlay::part(overlay)"},backdrop:{selector:"vaadin-popover-overlay::part(backdrop)"}},S=(0,s.Zz)((0,n.RF)({componentNameOverride:(0,o.xE)("input-wrapper")}),(0,n.RF)({mappings:{iconMargin:{...I,property:"margin-inline-end"},hostWidth:{...w,property:"width"},hostDirection:{...w,property:"direction"},textAlign:{...E,property:"text-align"},rtlInputDirection:{...k,property:x.inputDirection},rtlInputAlignment:{...k,property:x.inputTextAlign},overlayGap:{property:()=>S.cssVarList.overlayGap},overlayBackgroundColor:{property:()=>S.cssVarList.overlayBackgroundColor},overlayPadding:{property:()=>S.cssVarList.overlayPadding},overlayBoxShadow:{property:()=>S.overlayBoxShadow},overlayOutlineWidth:{property:()=>S.cssVarList.overlayOutlineWidth},overlayOutlineColor:{property:()=>S.cssVarList.overlayOutlineColor},overlayOutlineStyle:{property:()=>S.cssVarList.overlayOutlineStyle},errorMessageIcon:{selector:g.w.componentName,property:g.w.cssVarList.errorMessageIcon},errorMessageIconSize:{selector:g.w.componentName,property:g.w.cssVarList.errorMessageIconSize},errorMessageIconPadding:{selector:g.w.componentName,property:g.w.cssVarList.errorMessageIconPadding},errorMessageIconRepeat:{selector:g.w.componentName,property:g.w.cssVarList.errorMessageIconRepeat},errorMessageIconPosition:{selector:g.w.componentName,property:g.w.cssVarList.errorMessageIconPosition},errorMessageFontSize:{selector:g.w.componentName,property:g.w.cssVarList.errorMessageFontSize}}}),(0,n.mA)({name:"overlay",selector:"",mappings:{marginTop:{...V,property:"margin-top"},backgroundColor:{...V},backdropBackgroundColor:{...P,property:"background-color"},backdropPointerEvents:{...P,property:"pointer-events"},padding:{...V},boxShadow:{...V},outlineWidth:{...V},outlineColor:{...V},outlineStyle:{...V}}}),n.VO,n.tQ)(class extends v{timestamp="";format=l.ui;selectedCounterIdx=0;updateCountersDisplay(){this.inputElement.value=this.countersValue}updateValue(){if(this.isCountersOutOfRange)this.updateTimestamp("");else{const e=c[this.format].getDate(this.inputElement.value);this.updateTimestamp(e.getTime())}}onDateCounterChange=()=>{this.updateCountersDisplay(),this.updateValue(),this.#r()};updateTimestamp(e){this.timestamp=e?(0,a.Nq)(e).getTime():""}#i=new u(l.rR.YEAR,this.onDateCounterChange.bind(this));dateCounters=[new u(l.rR.MONTH,this.onDateCounterChange.bind(this)),new u(l.rR.DAY,this.onDateCounterChange.bind(this)),this.#i];static get observedAttributes(){return[].concat(v.observedAttributes||[],f)}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML=`\n <div>\n <descope-text-field>\n <span slot="suffix" class="toggle-calendar">\n ${h.ki}\n </span>\n </descope-text-field>\n <vaadin-popover></vaadin-popover>\n </div>\n `,(0,y.fz)('\n :host {\n display: inline-block;\n box-sizing: border-box;\n user-select: none;\n max-width: 100%;\n }\n\n :host ::slotted {\n padding: 0;\n }\n\n .toggle-calendar {\n cursor: pointer;\n display: flex;\n align-self: center;\n z-index: 1;\n height: 100%;\n align-items: center;\n }\n\n :host([readonly="true"]) .toggle-calendar {\n pointer-events: none;\n }\n ',this),this.inputElement=this.shadowRoot.querySelector("descope-text-field"),this.popoverToggleButton=this.inputElement.querySelector(".toggle-calendar")}get validationTarget(){return this.inputElement}get opened(){return"true"===this.getAttribute("opened")}get displayValueEpoch(){const e=c[this.format].getDate(this.inputElement.value);return(0,a.xP)(e?.getTime())?e.getTime():null}get sortedCounters(){return this.format.split(l.eT).map((e=>this.dateCounters.find((t=>t.placeholder===e))))}get activeCounter(){return this.sortedCounters[this.selectedCounterIdx]}get countersValue(){return this.sortedCounters.map((e=>e.stringValue)).join(l.eT)}get overlay(){return this.baseElement.shadowRoot?.querySelector("vaadin-popover-overlay")}get backdrop(){return this.overlay.shadowRoot?.querySelector("#backdrop")}get calendar(){return this.overlay?.querySelector("descope-calendar")}get isRTL(){const e=getComputedStyle(this.baseElement).getPropertyValue("direction");return e?"rtl"===e:"rtl"===this.getAttribute("st-host-direction")}get value(){return this.timestamp}set value(e){e?(this.updateTimestamp(e),this.updateDateCounters((0,a.Nq)(e))):this.updateTimestamp("")}get isCountersEmpty(){return this.dateCounters.every((e=>e.isEmpty))}get isCountersOutOfRange(){return this.dateCounters.some((e=>!e.isInRange(e.numberValue)))}reportValidity(){this.inputElement.reportValidity()}#r(){this.inputElement.baseElement.dispatchEvent(new Event("input",{bubbles:!0}))}updateInputDisplay(){this.inputElement.value=(0,a.Ey)((0,a.Nq)(this.countersValue).getTime(),this.format)}init(){super.init?.(),this.updateFormatPattern(),this.initPopover(),this.onDateCounterChange(),this.initInputElement(),setTimeout((()=>{this.#n()}),0)}initInputElement(){this.inputElement.getValidity=this.getValidity.bind(this),this.inputElement.baseElement.checkValidity=this.checkValidity.bind(this),this.popoverToggleButton.addEventListener("click",this.onPopoverToggle.bind(this)),this.inputElement.addEventListener("focus",this.onFocus.bind(this)),this.inputElement.addEventListener("blur",this.onBlur.bind(this)),this.inputElement.addEventListener("click",this.handleMouseCaretPositionChange.bind(this)),this.inputElement.addEventListener("keydown",this.handleNavKeys.bind(this)),this.inputElement.addEventListener("keydown",this.handleDigitKeys.bind(this)),(0,o.EA)(this,this.inputElement,{includeAttrs:["label","label-type","placeholder","disabled","readonly","bordered","required","full-width","st-host-direction","pattern","bordered","data-errormessage-value-missing","data-errormessage-pattern-mismatch","data-errormessage-range-underflow","data-errormessage-range-overflow","st-error-message-icon","st-error-message-icon-size","st-error-message-icon-padding"]})}initPopover(){this.baseElement.trigger=["click"],this.baseElement.withBackdrop=!0,this.baseElement.renderer=this.#o.bind(this),this.baseElement.addEventListener("click",(e=>{e.preventDefault(),e.stopPropagation()}))}#s;#o(e){e.firstChild||(this.overlay.positionTarget=this.shadowRoot.querySelector(".toggle-calendar"),e.appendChild(this.#a()),(0,a.Xs)(this.baseElement),this.backdrop.addEventListener("click",this.closePopover.bind(this))),e.style.setProperty("visibility","hidden"),setTimeout((()=>{this.#l(e),e.style.setProperty("visibility","visible"),this.updateCalendarView(e)}),100)}#l(){const e=this.shadowRoot.querySelector("vaadin-popover").shadowRoot;this.#s?.remove();const t=document.body.getBoundingClientRect(),r=this.getBoundingClientRect(),i=this.calendar.getBoundingClientRect(),n=this.isRTL?"right":"left",o=r[n]-i[n],s=i.left,a=t.width-i.right;let l;l=o>0?Math.min(o,a):-1*Math.min(Math.abs(o),s),(0,y.fz)(`\n vaadin-popover-overlay::part(overlay) {\n transform: translateX(${l}px);\n }\n `,e)}#a(){const e=document.createElement("span");e.innerHTML="<descope-calendar></descope-calendar>";const t=e.querySelector("descope-calendar");return t.addEventListener("date-submit",this.onCalendarSubmit.bind(this)),t.addEventListener("cancel",this.closePopover.bind(this)),e}#n(){this.overlay._attachOverlay=()=>this.overlay.bringToFront(),this.overlay._detachOverlay=()=>{},this.overlay._enterModalState=()=>{}}onPopoverToggle(){this.opened?this.closePopover():this.openPopover()}openPopover(){this.setAttribute("opened","true")}closePopover(){this.removeAttribute("opened"),this.inputElement.focus()}getCounterById(e){return this.dateCounters.find((t=>t.id===e))}onCalendarSubmit(){if(!this.isReadOnly){if(!this.calendar.value)return;const e=(0,a.Nq)(this.calendar.value);this.value=e.getTime(),this.getCounterById("year").replaceValue(e.getFullYear()),this.getCounterById("month").replaceValue(e.getMonth()+1),this.getCounterById("day").replaceValue(e.getDate()),this.#r()}this.closePopover()}updateCalendarView(){const e=(0,a.xP)((0,a.Nq)(this.inputElement.value||"").getTime())&&c[this.format].validate(this.inputElement.value);this.displayValueEpoch||e?this.calendar.setAttribute("initial-value",(0,a.Ey)(this.displayValueEpoch||this.timestamp,l.wJ)):(this.calendar.clearValue(),this.calendar.setAttribute("preview",(0,a.Ey)((0,a.Ln)(),l.wJ))),(0,o.EA)(this,this.calendar,{includeAttrs:["st-host-direction","readonly","initial-month","initial-year","years-range","calendar-label-submit","calendar-label-cancel","calendar-months","calendar-weekdays","calendar-weekdays-short"]})}onFocus(){this.isReadOnly||this.inputElement.value||(this.inputElement.value=this.format,this.setInputSelectionRange())}onBlur(){this.opened||this.inputElement.value===this.format&&(this.inputElement.value="")}onFormatUpdate(e){Object.keys(c).includes(e)&&(this.format=e,this.updateFormatPattern())}updateFormatPattern(){const e=this.getAttribute("format")||this.format||l.ui;this.setAttribute("type","date"),this.setAttribute("pattern",c[e].pattern)}handleDigitKeys(e){(0,a.Et)(e.key)&&(e.preventDefault(),this.activeCounter.add(e.key),this.activeCounter.isFull&&this.selectNextCounter(),this.setInputSelectionRange())}getCounterIdx(e){const[t,r]=this.sortedCounters.map((e=>e.length));return[e<=t,e>=t&&e<=t+r+1,e>=t+r+2].indexOf(!0)}setSelectedCounterByCaretPosition(e){this.selectedCounterIdx=this.getCounterIdx(e.target.selectionStart)}selectNextCounter(){this.selectedCounterIdx<this.dateCounters.length&&(this.selectedCounterIdx=Math.min(this.selectedCounterIdx+1,2))}selectPrevCounter(){this.selectedCounterIdx>0&&(this.selectedCounterIdx=Math.min(this.selectedCounterIdx-1,1))}setInputSelectionRange(){if(this.selectedCounterIdx<0)return;const e=this.sortedCounters.slice(0,this.selectedCounterIdx).reduce(((e,t)=>e+t.length),this.selectedCounterIdx);this.inputElement.setSelectionRange(e,e+this.sortedCounters[this.selectedCounterIdx].length)}resetDateCounters(){this.dateCounters.forEach((e=>e.clear()))}updateDateCounters(e){this.dateCounters.forEach((t=>{switch(t.id){case l.rR.MONTH.id:t.set(e.getMonth()+1);break;case l.rR.YEAR.id:t.set(e.getFullYear());break;case l.rR.DAY.id:t.set(e.getDate())}}))}handleNavKeys(e){if(this.isReadOnly)return;const{key:t,shiftKey:r,metaKey:i}=e,n=(0,a.y4)(t,r,i);if(this.opened&&this.closePopover(),e.preventDefault(),(0,a.KQ)(t)){const e=this.activeCounter;if(!e)return;const t=Object.values(l.rR).find((t=>t.id===e.id)),{count:r,shiftCount:i}=t;n.backspace?this.handleBackspace():n.arrowUp?e.inc():n.arrowDown?e.dec():n.shiftArrowUp?e.inc(r):n.shiftArrowDown?e.dec(r):n.pageUp?e.inc(r):n.pageDown?e.dec(r):n.shiftPageUp?e.inc(i):n.shiftPageDown?e.dec(i):n.arrowRight?this.selectNextCounter():n.arrowLeft&&this.selectPrevCounter(),this.setInputSelectionRange()}}handleBackspace(){const e=this.activeCounter;e.isEmpty?(this.selectPrevCounter(),this.setInputSelectionRange()):e.del()}handleMouseCaretPositionChange(e){this.opened||(e.preventDefault(),this.setSelectedCounterByCaretPosition(e),this.setInputSelectionRange())}onInitialValueChange(e){this.value||setTimeout((()=>{this.value=e}))}setYearRange(e){if(!e)return;const[t,r]=e.split?.("-");t&&r&&(this.#i.setMin(t),this.#i.setMax(r))}attributeChangedCallback(e,t,r){super.attributeChangedCallback?.(e,t,r),t!==r&&("years-range"===e&&this.setYearRange(r),b.includes(e)?(r&&"format"===e&&this.onFormatUpdate(r),"initial-value"===e&&this.onInitialValueChange(r)):C.includes(e)&&(r?this.calendar?.setAttribute(e,r):this.calendar?.removeAttribute(e)))}getValidity(){return this.isRequired&&this.isCountersEmpty?{valueMissing:!0}:this.isCountersOutOfRange?{patternMismatch:!0}:{}}});customElements.define(m,S)},79275:(e,t,r)=>{r.d(t,{T:()=>l,w:()=>d});var i=r(79365),n=r(6424),o=r(9696),s=r(97810),a=r(73551);const l=(0,s.xE)("text-field"),p=["type","label-type","copy-to-clipboard"],d=(0,o.Zz)((0,i.RF)({mappings:n.A}),i.VO,(0,i.OZ)({proxyProps:["value","selectionStart"],useProxyTargets:!0}),i.tQ,(e=>class extends e{static get observedAttributes(){return p.concat(e.observedAttributes||[])}icon;init(){super.init?.()}renderCopyToClipboard(e){if(!e)return void this.icon?.remove();const t={icon:"vaadin:copy-o",title:"Copy",style:"cursor: pointer"},r={icon:"vaadin:check-circle-o",title:"Copied",style:"cursor: initial"};this.icon=Object.assign(document.createElement("vaadin-icon"),{slot:"suffix",...t}),this.baseElement.appendChild(this.icon),this.icon.addEventListener("click",(()=>{navigator.clipboard.writeText(this.value),Object.assign(this.icon,r),setTimeout((()=>{Object.assign(this.icon,t)}),5e3)}))}onLabelClick(){this.focus()}attributeChangedCallback(e,t,r){super.attributeChangeCallback?.(e,t,r),"type"===e&&this.baseElement._setType(r),t!==r&&("label-type"===e?"floating"===r?this.addEventListener("click",this.onLabelClick):this.removeEventListener("click",this.onLabelClick):"copy-to-clipboard"===e&&this.renderCopyToClipboard("true"===r))}}))((0,i.tz)({slots:["prefix","suffix"],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tpadding: calc(var(${d.cssVarList.inputOutlineWidth}) + var(${d.cssVarList.inputOutlineOffset}));\n box-sizing: border-box;\n\t\t\t}\n :host(:is([readonly], [disabled])) ::slotted(:is(input, textarea):placeholder-shown) {\n opacity: 1;\n }\n\n vaadin-text-field[label-type="floating"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n vaadin-text-field[label-type="floating"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n ${(0,a.$J)("vaadin-text-field")}\n\t\t\t${(0,a.cy)(d.cssVarList)}\n\t\t\t${(0,a.LJ)("vaadin-text-field",d.cssVarList)}\n ${(0,a.Kl)()}\n\n vaadin-text-field vaadin-icon {\n align-self: center;\n }\n\t\t`,excludeAttrsSync:["tabindex","style"],componentName:l}))}}]);
|
1
|
+
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[9257],{6424:(e,t,r)=>{r.d(t,{A:()=>C});const{host:i,label:n,placeholder:o,requiredIndicator:s,inputField:a,input:l,inputMask:p,helperText:d,errorMessage:c,disabledPlaceholder:h,inputDisabled:u,inputIcon:g,externalInput:y,externalInputDisabled:m,externalPlaceholder:b,externalDisabledPlaceholder:v}={host:{selector:()=>":host"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},placeholder:[{selector:"> input:placeholder-shown"},{selector:()=>":host::slotted(input:placeholder-shown)"}],disabledPlaceholder:{selector:"> input:disabled::placeholder"},inputField:{selector:"::part(input-field)"},input:{selector:"input"},inputMask:{selector:"::part(input-field)::before"},inputDisabled:{selector:"input:disabled"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"},inputIcon:{selector:"vaadin-icon"},externalInput:{selector:()=>"::slotted(input)"},externalInputDisabled:{selector:()=>"::slotted(input:disabled)"},externalPlaceholder:{selector:()=>"::slotted(input:placeholder-shown)"},externalDisabledPlaceholder:{selector:()=>"::slotted(input:disabled::placeholder)"}},C={fontSize:[{},i],fontFamily:[n,a,d,c],labelFontSize:{...n,property:"font-size"},labelFontWeight:{...n,property:"font-weight"},labelTextColor:[{...n,property:"color"},{...s,property:"color"},{...n,property:"-webkit-text-fill-color"},{...s,property:"-webkit-text-fill-color"}],hostWidth:{...i,property:"width"},hostMinWidth:{...i,property:"min-width"},hostDirection:{...i,property:"direction"},inputDirection:{...l,property:"direction"},inputBackgroundColor:[{...a,property:"background-color"},{...p,property:"background-color"}],errorMessageTextColor:{...c,property:"color"},errorMessageIcon:{...c,property:"background-image"},errorMessageIconSize:{...c,property:"background-size"},errorMessageIconPadding:{...c,property:"padding-inline-start"},errorMessageIconRepeat:{...c,property:"background-repeat"},errorMessageIconPosition:{...c,property:"background-position"},errorMessageFontSize:{...c,property:"font-size"},helperTextColor:{...d,property:"-webkit-text-fill-color"},inputValueTextColor:[{...a,property:"color"},{...u,property:"-webkit-text-fill-color"},{...m,property:"-webkit-text-fill-color"}],inputCaretTextColor:[{...l,property:"caret-color"},{...y,property:"caret-color"}],labelRequiredIndicator:{...s,property:"content"},inputBorderColor:{...a,property:"border-color"},inputBorderWidth:{...a,property:"border-width"},inputBorderStyle:{...a,property:"border-style"},inputBorderRadius:{...a,property:"border-radius"},inputHeight:{...a,property:"height"},inputHorizontalPadding:[{...l,property:"padding-left"},{...l,property:"padding-right"},{...y,property:"padding-left"},{...y,property:"padding-right"}],inputOutlineColor:{...a,property:"outline-color"},inputOutlineStyle:{...a,property:"outline-style"},inputOutlineWidth:{...a,property:"outline-width"},inputOutlineOffset:{...a,property:"outline-offset"},textAlign:{},inputTextAlign:[{...l,property:"text-align"},{...y,property:"text-align"}],inputPlaceholderColor:[{selector:()=>":host input:placeholder-shown",property:"color"},{...b,property:"color"},{...o,property:"color"},{...h,property:"-webkit-text-fill-color"},{...v,property:"-webkit-text-fill-color"}],labelPosition:{...n,property:"position"},labelTopPosition:{...n,property:"top"},labelHorizontalPosition:[{...n,property:"left"},{...n,property:"right"}],inputTransformY:{...n,property:"transform"},inputTransition:{...n,property:"transition"},marginInlineStart:{...n,property:"margin-inline-start"},placeholderOpacity:[{selector:"> input:placeholder-shown",property:"opacity"},{...b,property:"opacity"}],inputVerticalAlignment:[{...a,property:"align-items"},{...y,property:"align-items"}],valueInputHeight:[{...l,property:"height"},{...y,property:"height"}],valueInputMarginBottom:[{...l,property:"margin-bottom"},{...y,property:"margin-bottom"}],inputIconOffset:[{...g,property:"margin-right"},{...g,property:"margin-left"}],inputIconSize:{...g,property:"font-size"},inputIconColor:{...g,property:"color"}}},21374:(e,t,r)=>{r.r(t),r.d(t,{TextFieldClass:()=>i.w,componentName:()=>i.T}),r(11284),r(37182),r(95260);var i=r(79275);customElements.define(i.T,i.w)},64609:(e,t,r)=>{r.r(t),r.d(t,{DateFieldClass:()=>S,componentName:()=>m}),r(45992),r(88350),r(21374);var i=r(3393),n=r(79365),o=r(97810),s=r(9696),a=r(49224),l=r(64101);const p={MM:"(0?[1-9]|1[0-2])",DD:"(0?[1-9]|[12][0-9]|3[01])",YYYY:"([0-9]{4})"},d=e=>{const t=(e=>`^${e.split(l.eT).map((e=>p[e])).join("\\D")}$`)(e),r=(e=>{const t=e.split(l.eT);return e=>{const r={};return t.forEach(((t,i)=>{r[t]=e[i+1]})),[r.YYYY,r.MM,r.DD]}})(e),i=new RegExp(t);return{pattern:t,validate:e=>i.test(e),getDate:e=>((e,t,r)=>{const i=t.exec(e);if(!i)return null;const[n,o,s]=r(i);return(0,a.Nq)([n,o,s].join(l.eT))})(e,i,r)}},c=Object.fromEntries(l.SP.map((e=>[e,d(e)])));var h=r(80071);class u{#e=Object.freeze([]);constructor({id:e,min:t,max:r,placeholder:i},n){this.id=e,this.min=t,this.max=r,this.placeholder=i,this.onChange=n}get data(){return this.#e}set data(e){this.#e=Object.freeze(e),this.onChange?.()}get#t(){return this.data.length?this.numberValue:0}get numberValue(){return Number(this.stringValue)}get stringValue(){return(this.data.join("")||this.placeholder).padStart(this.length,"0")}get isFull(){return 10*this.numberValue>this.max||this.data.length===this.length}get isEmpty(){return this.stringValue===this.placeholder}get length(){return this.max.toString().length}set(e){this.data=e.toString().split("")}add(e){let t=this.data;return t=[...t,e],this.numberValue>this.max?t=[e]:this.length<t.length&&(t=t.slice(1,t.length)),this.data=t,e}del(){this.data.filter((e=>"0"!==e)).filter(Boolean).length?this.data=this.data.slice(0,this.data.length-1):this.data=[]}clear(){this.data=[]}inc(e){this.replaceValue(this.#t<this.max?Math.max(this.#t+(e||1),this.min):this.min)}dec(e){this.replaceValue(this.#t>this.min?Math.min(this.#t-(e||1),this.max):this.max)}isInRange(e){return e>=this.min&&e<=this.max}replaceValue(e){this.isInRange(e)&&(this.data=e.toString().padStart(this.length,0).split(""))}setMin(e){this.min=Number(e)}setMax(e){this.max=Number(e)}}var g=r(79275),y=r(25964);const m=(0,o.xE)("date-field"),b=(0,i.y)({componentName:m,baseSelector:"vaadin-popover"}),v=["format","opened","initial-value","readonly","disable-calendar"],C=["years-range","calendar-months","calendar-weekdays"],f=[...v,...C],x=g.w.cssVarList,{host:w,input:E,inputEleRTL:k,toggleButton:I,overlay:P,backdrop:V,errorMessage:T}={host:{selector:()=>":host"},input:{selector:()=>"descope-text-field"},inputEleRTL:{selector:()=>':host([st-host-direction="rtl"]) descope-text-field'},toggleButton:{selector:()=>".toggle-calendar"},overlay:{selector:"vaadin-popover-overlay::part(overlay)"},backdrop:{selector:"vaadin-popover-overlay::part(backdrop)"}},S=(0,s.Zz)((0,n.RF)({componentNameOverride:(0,o.xE)("input-wrapper")}),(0,n.RF)({mappings:{iconMargin:{...I,property:"margin-inline-end"},hostWidth:{...w,property:"width"},hostDirection:{...w,property:"direction"},textAlign:{...E,property:"text-align"},rtlInputDirection:{...k,property:x.inputDirection},rtlInputAlignment:{...k,property:x.inputTextAlign},overlayGap:{property:()=>S.cssVarList.overlayGap},overlayBackgroundColor:{property:()=>S.cssVarList.overlayBackgroundColor},overlayPadding:{property:()=>S.cssVarList.overlayPadding},overlayBoxShadow:{property:()=>S.overlayBoxShadow},overlayOutlineWidth:{property:()=>S.cssVarList.overlayOutlineWidth},overlayOutlineColor:{property:()=>S.cssVarList.overlayOutlineColor},overlayOutlineStyle:{property:()=>S.cssVarList.overlayOutlineStyle},errorMessageIcon:{selector:g.w.componentName,property:g.w.cssVarList.errorMessageIcon},errorMessageIconSize:{selector:g.w.componentName,property:g.w.cssVarList.errorMessageIconSize},errorMessageIconPadding:{selector:g.w.componentName,property:g.w.cssVarList.errorMessageIconPadding},errorMessageIconRepeat:{selector:g.w.componentName,property:g.w.cssVarList.errorMessageIconRepeat},errorMessageIconPosition:{selector:g.w.componentName,property:g.w.cssVarList.errorMessageIconPosition},errorMessageFontSize:{selector:g.w.componentName,property:g.w.cssVarList.errorMessageFontSize}}}),(0,n.mA)({name:"overlay",selector:"",mappings:{marginTop:{...P,property:"margin-top"},backgroundColor:{...P},backdropBackgroundColor:{...V,property:"background-color"},backdropPointerEvents:{...V,property:"pointer-events"},padding:{...P},boxShadow:{...P},outlineWidth:{...P},outlineColor:{...P},outlineStyle:{...P}}}),n.VO,n.tQ)(class extends b{timestamp="";format=l.ui;selectedCounterIdx=0;updateCountersDisplay(){this.inputElement.value=this.countersValue}updateValue(){if(this.isCountersOutOfRange)this.updateTimestamp("");else{const e=c[this.format].getDate(this.inputElement.value);this.updateTimestamp(e.getTime())}}onDateCounterChange=()=>{this.updateCountersDisplay(),this.updateValue(),this.#r()};updateTimestamp(e){this.timestamp=e?(0,a.Nq)(e).getTime():""}#i=new u(l.rR.YEAR,this.onDateCounterChange.bind(this));dateCounters=[new u(l.rR.MONTH,this.onDateCounterChange.bind(this)),new u(l.rR.DAY,this.onDateCounterChange.bind(this)),this.#i];static get observedAttributes(){return[].concat(b.observedAttributes||[],f)}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML=`\n <div>\n <descope-text-field>\n <span slot="suffix" class="toggle-calendar">\n ${h.ki}\n </span>\n </descope-text-field>\n <vaadin-popover></vaadin-popover>\n </div>\n `,(0,y.fz)('\n :host {\n display: inline-block;\n box-sizing: border-box;\n user-select: none;\n max-width: 100%;\n }\n\n :host ::slotted {\n padding: 0;\n }\n\n .toggle-calendar {\n cursor: pointer;\n display: flex;\n align-self: center;\n z-index: 1;\n height: 100%;\n align-items: center;\n }\n\n :host([readonly="true"]) .toggle-calendar {\n pointer-events: none;\n }\n\n .hidden {\n display: none;\n }\n ',this),this.inputElement=this.shadowRoot.querySelector("descope-text-field"),this.popoverToggleButton=this.inputElement.querySelector(".toggle-calendar")}get validationTarget(){return this.inputElement}get opened(){return"true"===this.getAttribute("opened")}get displayValueEpoch(){const e=c[this.format].getDate(this.inputElement.value);return(0,a.xP)(e?.getTime())?e.getTime():null}get sortedCounters(){return this.format.split(l.eT).map((e=>this.dateCounters.find((t=>t.placeholder===e))))}get activeCounter(){return this.sortedCounters[this.selectedCounterIdx]}get countersValue(){return this.sortedCounters.map((e=>e.stringValue)).join(l.eT)}get overlay(){return this.baseElement.shadowRoot?.querySelector("vaadin-popover-overlay")}get backdrop(){return this.overlay.shadowRoot?.querySelector("#backdrop")}get calendar(){return this.overlay?.querySelector("descope-calendar")}get isRTL(){const e=getComputedStyle(this.baseElement).getPropertyValue("direction");return e?"rtl"===e:"rtl"===this.getAttribute("st-host-direction")}get value(){return this.timestamp}set value(e){e?(this.updateTimestamp(e),this.updateDateCounters((0,a.Nq)(e))):this.updateTimestamp("")}get isCountersEmpty(){return this.dateCounters.every((e=>e.isEmpty))}get isCountersOutOfRange(){return this.dateCounters.some((e=>!e.isInRange(e.numberValue)))}get disableCalendar(){return"true"===this.getAttribute("disable-calendar")}reportValidity(){this.inputElement.reportValidity()}#r(){this.inputElement.baseElement.dispatchEvent(new Event("input",{bubbles:!0}))}updateInputDisplay(){this.inputElement.value=(0,a.Ey)((0,a.Nq)(this.countersValue).getTime(),this.format)}init(){super.init?.(),this.updateFormatPattern(),this.initPopover(),this.onDateCounterChange(),this.initInputElement(),setTimeout((()=>{this.#n()}),0)}initInputElement(){this.inputElement.getValidity=this.getValidity.bind(this),this.inputElement.baseElement.checkValidity=this.checkValidity.bind(this),this.popoverToggleButton.addEventListener("click",this.onPopoverToggle.bind(this)),this.inputElement.addEventListener("focus",this.onFocus.bind(this)),this.inputElement.addEventListener("blur",this.onBlur.bind(this)),this.inputElement.addEventListener("click",this.handleMouseCaretPositionChange.bind(this)),this.inputElement.addEventListener("keydown",this.handleNavKeys.bind(this)),this.inputElement.addEventListener("keydown",this.handleDigitKeys.bind(this)),(0,o.EA)(this,this.inputElement,{includeAttrs:["label","label-type","placeholder","disabled","readonly","bordered","required","full-width","st-host-direction","pattern","bordered","data-errormessage-value-missing","data-errormessage-pattern-mismatch","data-errormessage-range-underflow","data-errormessage-range-overflow","st-error-message-icon","st-error-message-icon-size","st-error-message-icon-padding"]})}initPopover(){this.baseElement.trigger=["click"],this.baseElement.withBackdrop=!0,this.baseElement.renderer=this.#o.bind(this),this.baseElement.addEventListener("click",(e=>{e.preventDefault(),e.stopPropagation()}))}#s;#o(e){e.firstChild||(this.overlay.positionTarget=this.shadowRoot.querySelector(".toggle-calendar"),e.appendChild(this.#a()),(0,a.Xs)(this.baseElement),this.backdrop.addEventListener("click",this.closePopover.bind(this))),e.style.setProperty("visibility","hidden"),setTimeout((()=>{this.#l(e),e.style.setProperty("visibility","visible"),this.updateCalendarView(e)}),100)}#l(){const e=this.shadowRoot.querySelector("vaadin-popover").shadowRoot;this.#s?.remove();const t=document.body.getBoundingClientRect(),r=this.getBoundingClientRect(),i=this.calendar.getBoundingClientRect(),n=this.isRTL?"right":"left",o=r[n]-i[n],s=i.left,a=t.width-i.right;let l;l=o>0?Math.min(o,a):-1*Math.min(Math.abs(o),s),(0,y.fz)(`\n vaadin-popover-overlay::part(overlay) {\n transform: translateX(${l}px);\n }\n `,e)}#a(){const e=document.createElement("span");e.innerHTML="<descope-calendar></descope-calendar>";const t=e.querySelector("descope-calendar");return t.addEventListener("date-submit",this.onCalendarSubmit.bind(this)),t.addEventListener("cancel",this.closePopover.bind(this)),e}#n(){this.overlay._attachOverlay=()=>this.overlay.bringToFront(),this.overlay._detachOverlay=()=>{},this.overlay._enterModalState=()=>{}}onPopoverToggle(){this.opened?this.closePopover():this.openPopover()}openPopover(){this.disableCalendar||this.setAttribute("opened","true")}closePopover(){this.removeAttribute("opened"),this.inputElement.focus()}getCounterById(e){return this.dateCounters.find((t=>t.id===e))}onCalendarSubmit(){if(!this.isReadOnly){if(!this.calendar.value)return;const e=(0,a.Nq)(this.calendar.value);this.value=e.getTime(),this.getCounterById("year").replaceValue(e.getFullYear()),this.getCounterById("month").replaceValue(e.getMonth()+1),this.getCounterById("day").replaceValue(e.getDate()),this.#r()}this.closePopover()}updateCalendarView(){const e=(0,a.xP)((0,a.Nq)(this.inputElement.value||"").getTime())&&c[this.format].validate(this.inputElement.value);this.displayValueEpoch||e?this.calendar.setAttribute("initial-value",(0,a.Ey)(this.displayValueEpoch||this.timestamp,l.wJ)):(this.calendar.clearValue(),this.calendar.setAttribute("preview",(0,a.Ey)((0,a.Ln)(),l.wJ))),(0,o.EA)(this,this.calendar,{includeAttrs:["st-host-direction","readonly","initial-month","initial-year","years-range","calendar-label-submit","calendar-label-cancel","calendar-months","calendar-weekdays","calendar-weekdays-short"]})}onFocus(){this.isReadOnly||this.inputElement.value||(this.inputElement.value=this.format,this.setInputSelectionRange())}onBlur(){this.opened||this.inputElement.value===this.format&&(this.inputElement.value="")}onFormatUpdate(e){Object.keys(c).includes(e)&&(this.format=e,this.updateFormatPattern())}updateFormatPattern(){const e=this.getAttribute("format")||this.format||l.ui;this.setAttribute("type","date"),this.setAttribute("pattern",c[e].pattern)}handleDigitKeys(e){(0,a.Et)(e.key)&&(e.preventDefault(),this.activeCounter.add(e.key),this.activeCounter.isFull&&this.selectNextCounter(),this.setInputSelectionRange())}getCounterIdx(e){const[t,r]=this.sortedCounters.map((e=>e.length));return[e<=t,e>=t&&e<=t+r+1,e>=t+r+2].indexOf(!0)}setSelectedCounterByCaretPosition(e){this.selectedCounterIdx=this.getCounterIdx(e.target.selectionStart)}selectNextCounter(){this.selectedCounterIdx<this.dateCounters.length&&(this.selectedCounterIdx=Math.min(this.selectedCounterIdx+1,2))}selectPrevCounter(){this.selectedCounterIdx>0&&(this.selectedCounterIdx=Math.min(this.selectedCounterIdx-1,1))}setInputSelectionRange(){if(this.selectedCounterIdx<0)return;const e=this.sortedCounters.slice(0,this.selectedCounterIdx).reduce(((e,t)=>e+t.length),this.selectedCounterIdx);this.inputElement.setSelectionRange(e,e+this.sortedCounters[this.selectedCounterIdx].length)}resetDateCounters(){this.dateCounters.forEach((e=>e.clear()))}updateDateCounters(e){this.dateCounters.forEach((t=>{switch(t.id){case l.rR.MONTH.id:t.set(e.getMonth()+1);break;case l.rR.YEAR.id:t.set(e.getFullYear());break;case l.rR.DAY.id:t.set(e.getDate())}}))}handleNavKeys(e){if(this.isReadOnly)return;const{key:t,shiftKey:r,metaKey:i}=e,n=(0,a.y4)(t,r,i);if(this.opened&&this.closePopover(),e.preventDefault(),(0,a.KQ)(t)){const e=this.activeCounter;if(!e)return;const t=Object.values(l.rR).find((t=>t.id===e.id)),{count:r,shiftCount:i}=t;n.backspace?this.handleBackspace():n.arrowUp?e.inc():n.arrowDown?e.dec():n.shiftArrowUp?e.inc(r):n.shiftArrowDown?e.dec(r):n.pageUp?e.inc(r):n.pageDown?e.dec(r):n.shiftPageUp?e.inc(i):n.shiftPageDown?e.dec(i):n.arrowRight?this.selectNextCounter():n.arrowLeft&&this.selectPrevCounter(),this.setInputSelectionRange()}}handleBackspace(){const e=this.activeCounter;e.isEmpty?(this.selectPrevCounter(),this.setInputSelectionRange()):e.del()}handleMouseCaretPositionChange(e){this.opened||(e.preventDefault(),this.setSelectedCounterByCaretPosition(e),this.setInputSelectionRange())}onInitialValueChange(e){this.value||setTimeout((()=>{this.value=e}))}setYearRange(e){if(!e)return;const[t,r]=e.split?.("-");t&&r&&(this.#i.setMin(t),this.#i.setMax(r))}togglePopoverAccess(e){e?this.popoverToggleButton.classList.remove("hidden"):this.popoverToggleButton.classList.add("hidden")}attributeChangedCallback(e,t,r){super.attributeChangedCallback?.(e,t,r),t!==r&&("years-range"===e&&this.setYearRange(r),"disable-calendar"===e&&this.togglePopoverAccess("true"!==r),v.includes(e)?(r&&"format"===e&&this.onFormatUpdate(r),"initial-value"===e&&this.onInitialValueChange(r)):C.includes(e)&&(r?this.calendar?.setAttribute(e,r):this.calendar?.removeAttribute(e)))}getValidity(){return this.isRequired&&this.isCountersEmpty?{valueMissing:!0}:this.isCountersOutOfRange?{patternMismatch:!0}:{}}});customElements.define(m,S)},79275:(e,t,r)=>{r.d(t,{T:()=>l,w:()=>d});var i=r(79365),n=r(6424),o=r(9696),s=r(97810),a=r(73551);const l=(0,s.xE)("text-field"),p=["type","label-type","copy-to-clipboard"],d=(0,o.Zz)((0,i.RF)({mappings:n.A}),i.VO,(0,i.OZ)({proxyProps:["value","selectionStart"],useProxyTargets:!0}),i.tQ,(e=>class extends e{static get observedAttributes(){return p.concat(e.observedAttributes||[])}icon;init(){super.init?.()}renderCopyToClipboard(e){if(!e)return void this.icon?.remove();const t={icon:"vaadin:copy-o",title:"Copy",style:"cursor: pointer"},r={icon:"vaadin:check-circle-o",title:"Copied",style:"cursor: initial"};this.icon=Object.assign(document.createElement("vaadin-icon"),{slot:"suffix",...t}),this.baseElement.appendChild(this.icon),this.icon.addEventListener("click",(()=>{navigator.clipboard.writeText(this.value),Object.assign(this.icon,r),setTimeout((()=>{Object.assign(this.icon,t)}),5e3)}))}onLabelClick(){this.focus()}attributeChangedCallback(e,t,r){super.attributeChangeCallback?.(e,t,r),"type"===e&&this.baseElement._setType(r),t!==r&&("label-type"===e?"floating"===r?this.addEventListener("click",this.onLabelClick):this.removeEventListener("click",this.onLabelClick):"copy-to-clipboard"===e&&this.renderCopyToClipboard("true"===r))}}))((0,i.tz)({slots:["prefix","suffix"],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tpadding: calc(var(${d.cssVarList.inputOutlineWidth}) + var(${d.cssVarList.inputOutlineOffset}));\n box-sizing: border-box;\n\t\t\t}\n :host(:is([readonly], [disabled])) ::slotted(:is(input, textarea):placeholder-shown) {\n opacity: 1;\n }\n\n vaadin-text-field[label-type="floating"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n vaadin-text-field[label-type="floating"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n ${(0,a.$J)("vaadin-text-field")}\n\t\t\t${(0,a.cy)(d.cssVarList)}\n\t\t\t${(0,a.LJ)("vaadin-text-field",d.cssVarList)}\n ${(0,a.Kl)()}\n\n vaadin-text-field vaadin-icon {\n align-self: center;\n }\n\t\t`,excludeAttrsSync:["tabindex","style"],componentName:l}))}}]);
|
2
2
|
//# sourceMappingURL=descope-date-field-index-js.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"descope-date-field-index-js.js","mappings":"yJAAA,MAAM,KACJA,EAAI,MACJC,EAAK,YACLC,EAAW,kBACXC,EAAiB,WACjBC,EAAU,MACVC,EAAK,UACLC,EAAS,WACTC,EAAU,aACVC,EAAY,oBACZC,EAAmB,cACnBC,EAAa,UACbC,EAAS,cACTC,EAAa,sBACbC,EAAqB,oBACrBC,EAAmB,4BACnBC,GACE,CACFf,KAAM,CAAEgB,SAAU,IAAM,SACxBf,MAAO,CAAEe,SAAU,iBACnBb,kBAAmB,CAAEa,SAAU,+CAC/Bd,YAAa,CACX,CAAEc,SAAU,6BACZ,CAAEA,SAAU,IAAM,4CAEpBP,oBAAqB,CAAEO,SAAU,iCACjCZ,WAAY,CAAEY,SAAU,uBACxBX,MAAO,CAAEW,SAAU,SACnBV,UAAW,CAAEU,SAAU,+BACvBN,cAAe,CAAEM,SAAU,kBAC3BT,WAAY,CAAES,SAAU,uBACxBR,aAAc,CAAEQ,SAAU,yBAC1BL,UAAW,CAAEK,SAAU,eACvBJ,cAAe,CAAEI,SAAU,IAAM,oBACjCH,sBAAuB,CAAEG,SAAU,IAAM,6BACzCF,oBAAqB,CAAEE,SAAU,IAAM,sCACvCD,4BAA6B,CAAEC,SAAU,IAAM,2CAGjD,GAEEC,SAAU,CAAC,CAAC,EAAGjB,GACfkB,WAAY,CAACjB,EAAOG,EAAYG,EAAYC,GAE5CW,cAAe,IAAKlB,EAAOmB,SAAU,aACrCC,gBAAiB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zF,SAASe,cAAc,eAAgB,CAC/D2E,KAAM,YACHJ,IAGLxO,KAAKmG,YAAYuC,YAAY1I,KAAKqO,MAClCrO,KAAKqO,KAAK5G,iBAAiB,SAAS,KAClCoH,UAAUC,UAAUC,UAAU/O,KAAKoE,OACnC9E,OAAOqP,OAAO3O,KAAKqO,KAAMK,GAGzBpH,YAAW,KACThI,OAAOqP,OAAO3O,KAAKqO,KAAMG,EAAe,GACvC,IAAK,GAEZ,CAEA,YAAAQ,GACEhP,KAAK0K,OACP,CAEA,wBAAAiD,CAAyBC,EAAUqB,EAAQC,GACzC9J,MAAM+J,0BAA0BvB,EAAUqB,EAAQC,GAOjC,SAAbtB,GACF5N,KAAKmG,YAAYiJ,SAASF,GAGxBD,IAAWC,IACI,eAAbtB,EACa,aAAXsB,EACFlP,KAAKyH,iBAAiB,QAASzH,KAAKgP,cAEpChP,KAAKqP,oBAAoB,QAASrP,KAAKgP,cAEnB,sBAAbpB,GACT5N,KAAKsO,sBAAiC,SAAXY,GAGjC,IAG0B,EAS5B,QAAY,CACVI,MAAO,CAAC,SAAU,UAClBC,eAAgB,oBAChB3G,MAAO,IAAM,wGAIOzG,EAAeC,WAAWjG,4BACxCgG,EAAeC,WAAWhG,+cAc5B,QAAwB,gCAC3B,QAAuB+F,EAAeC,uBACtC,QAAoB,oBAAqBD,EAAeC,uBACrD,iGAMJoN,iBAAkB,CAAC,WAAY,SAC/B7N,kB","sources":["webpack://@descope/web-components-ui/./src/components/descope-text-field/textFieldMappings.js","webpack://@descope/web-components-ui/./src/components/descope-text-field/index.js","webpack://@descope/web-components-ui/./src/components/descope-date-field/formats.js","webpack://@descope/web-components-ui/./src/components/descope-date-field/DateCounterClass.js","webpack://@descope/web-components-ui/./src/components/descope-date-field/DateFieldClass.js","webpack://@descope/web-components-ui/./src/components/descope-date-field/index.js","webpack://@descope/web-components-ui/./src/components/descope-text-field/TextFieldClass.js"],"sourcesContent":["const {\n host,\n label,\n placeholder,\n requiredIndicator,\n inputField,\n input,\n inputMask,\n helperText,\n errorMessage,\n disabledPlaceholder,\n inputDisabled,\n inputIcon,\n externalInput,\n externalInputDisabled,\n externalPlaceholder,\n externalDisabledPlaceholder,\n} = {\n host: { selector: () => ':host' },\n label: { selector: '::part(label)' },\n requiredIndicator: { selector: '[required]::part(required-indicator)::after' },\n placeholder: [\n { selector: '> input:placeholder-shown' },\n { selector: () => ':host::slotted(input:placeholder-shown)' },\n ],\n disabledPlaceholder: { selector: '> input:disabled::placeholder' },\n inputField: { selector: '::part(input-field)' },\n input: { selector: 'input' },\n inputMask: { selector: '::part(input-field)::before' },\n inputDisabled: { selector: 'input:disabled' },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n inputIcon: { selector: 'vaadin-icon' },\n externalInput: { selector: () => '::slotted(input)' },\n externalInputDisabled: { selector: () => '::slotted(input:disabled)' },\n externalPlaceholder: { selector: () => '::slotted(input:placeholder-shown)' },\n externalDisabledPlaceholder: { selector: () => '::slotted(input:disabled::placeholder)' },\n};\n\nexport default {\n // we apply font-size also on the host so we can set its width with em\n fontSize: [{}, host],\n fontFamily: [label, inputField, helperText, errorMessage],\n\n labelFontSize: { ...label, property: 'font-size' },\n labelFontWeight: { ...label, property: 'font-weight' },\n\n labelTextColor: [\n { ...label, property: 'color' },\n { ...requiredIndicator, property: 'color' },\n { ...label, property: '-webkit-text-fill-color' },\n { ...requiredIndicator, property: '-webkit-text-fill-color' },\n ],\n\n hostWidth: { ...host, property: 'width' },\n hostMinWidth: { ...host, property: 'min-width' },\n hostDirection: { ...host, property: 'direction' },\n inputDirection: { ...input, property: 'direction' },\n\n inputBackgroundColor: [\n { ...inputField, property: 'background-color' },\n { ...inputMask, property: 'background-color' },\n ],\n\n errorMessageTextColor: { ...errorMessage, property: 'color' },\n errorMessageIcon: { ...errorMessage, property: 'background-image' },\n errorMessageIconSize: { ...errorMessage, property: 'background-size' },\n errorMessageIconPadding: { ...errorMessage, property: 'padding-inline-start' },\n errorMessageIconRepeat: { ...errorMessage, property: 'background-repeat' },\n errorMessageIconPosition: { ...errorMessage, property: 'background-position' },\n errorMessageFontSize: { ...errorMessage, property: 'font-size' },\n\n helperTextColor: { ...helperText, property: '-webkit-text-fill-color' },\n\n inputValueTextColor: [\n { ...inputField, property: 'color' },\n { ...inputDisabled, property: '-webkit-text-fill-color' },\n { ...externalInputDisabled, property: '-webkit-text-fill-color' },\n ],\n inputCaretTextColor: [\n { ...input, property: 'caret-color' },\n { ...externalInput, property: 'caret-color' },\n ],\n\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\n\n inputBorderColor: { ...inputField, property: 'border-color' },\n inputBorderWidth: { ...inputField, property: 'border-width' },\n inputBorderStyle: { ...inputField, property: 'border-style' },\n inputBorderRadius: { ...inputField, property: 'border-radius' },\n\n inputHeight: { ...inputField, property: 'height' },\n inputHorizontalPadding: [\n { ...input, property: 'padding-left' },\n { ...input, property: 'padding-right' },\n { ...externalInput, property: 'padding-left' },\n { ...externalInput, property: 'padding-right' },\n ],\n\n inputOutlineColor: { ...inputField, property: 'outline-color' },\n inputOutlineStyle: { ...inputField, property: 'outline-style' },\n inputOutlineWidth: { ...inputField, property: 'outline-width' },\n inputOutlineOffset: { ...inputField, property: 'outline-offset' },\n\n textAlign: {},\n\n inputTextAlign: [\n { ...input, property: 'text-align' },\n { ...externalInput, property: 'text-align' },\n ],\n\n inputPlaceholderColor: [\n { selector: () => ':host input:placeholder-shown', property: 'color' },\n { ...externalPlaceholder, property: 'color' },\n { ...placeholder, property: 'color' },\n { ...disabledPlaceholder, property: '-webkit-text-fill-color' },\n { ...externalDisabledPlaceholder, property: '-webkit-text-fill-color' },\n ],\n\n labelPosition: { ...label, property: 'position' },\n labelTopPosition: { ...label, property: 'top' },\n labelHorizontalPosition: [\n { ...label, property: 'left' },\n { ...label, property: 'right' },\n ],\n inputTransformY: { ...label, property: 'transform' },\n inputTransition: { ...label, property: 'transition' },\n marginInlineStart: { ...label, property: 'margin-inline-start' },\n placeholderOpacity: [\n { selector: '> input:placeholder-shown', property: 'opacity' },\n { ...externalPlaceholder, property: 'opacity' },\n ],\n inputVerticalAlignment: [\n { ...inputField, property: 'align-items' },\n { ...externalInput, property: 'align-items' },\n ],\n valueInputHeight: [\n { ...input, property: 'height' },\n { ...externalInput, property: 'height' },\n ],\n valueInputMarginBottom: [\n { ...input, property: 'margin-bottom' },\n { ...externalInput, property: 'margin-bottom' },\n ],\n\n inputIconOffset: [\n { ...inputIcon, property: 'margin-right' },\n { ...inputIcon, property: 'margin-left' },\n ],\n inputIconSize: { ...inputIcon, property: 'font-size' },\n inputIconColor: { ...inputIcon, property: 'color' },\n};\n","import '@vaadin/text-field';\nimport '@vaadin/icons';\nimport '@vaadin/icon';\n\nimport { componentName, TextFieldClass } from './TextFieldClass';\n\ncustomElements.define(componentName, TextFieldClass);\n\nexport { TextFieldClass, componentName };\n","import { DIVIDER, SUPPORTED_FORMATS } from './consts';\nimport { newDate } from './helpers';\n\nconst patterns = {\n MM: '(0?[1-9]|1[0-2])',\n DD: '(0?[1-9]|[12][0-9]|3[01])',\n YYYY: '([0-9]{4})',\n};\n\nconst createPattern = (format) => {\n const pattern = format\n .split(DIVIDER)\n .map((part) => patterns[part])\n .join('\\\\D');\n\n return `^${pattern}$`;\n};\n\nconst createToValuesFn = (format) => {\n const order = format.split(DIVIDER);\n return (match) => {\n const values = {};\n order.forEach((part, index) => {\n values[part] = match[index + 1];\n });\n return [values.YYYY, values.MM, values.DD];\n };\n};\n\nconst createDate = (val, regexp, toValuesFn) => {\n const match = regexp.exec(val);\n if (!match) return null;\n const [year, month, day] = toValuesFn(match);\n return newDate([year, month, day].join(DIVIDER));\n};\n\nconst createFormat = (format) => {\n const pattern = createPattern(format);\n const toValuesFn = createToValuesFn(format);\n const regexp = new RegExp(pattern);\n\n return {\n pattern,\n validate: (val) => regexp.test(val),\n getDate: (val) => createDate(val, regexp, toValuesFn),\n };\n};\n\nexport const formats = Object.fromEntries(SUPPORTED_FORMATS.map((f) => [f, createFormat(f)]));\n","// DateCounterClass allows us to add several counters to the input, and use them seperately.\n// For examele, we have a DayCounter, MonthCounter and YearCounter, which can each separately navigate\n// between different ranges.\nexport class DateCounter {\n #data = Object.freeze([]);\n\n constructor({ id, min, max, placeholder }, onChange) {\n this.id = id;\n this.min = min;\n this.max = max;\n this.placeholder = placeholder;\n this.onChange = onChange;\n }\n\n get data() {\n return this.#data;\n }\n\n set data(val) {\n this.#data = Object.freeze(val);\n this.onChange?.();\n }\n\n get #initialNumValue() {\n return this.data.length ? this.numberValue : 0;\n }\n\n get numberValue() {\n return Number(this.stringValue);\n }\n\n get stringValue() {\n return (this.data.join('') || this.placeholder).padStart(this.length, '0');\n }\n\n get isFull() {\n return this.numberValue * 10 > this.max || this.data.length === this.length;\n }\n\n get isEmpty() {\n return this.stringValue === this.placeholder;\n }\n\n get length() {\n return this.max.toString().length;\n }\n\n set(val) {\n this.data = val.toString().split('');\n }\n\n add(num) {\n // use local var to avoid triggering onChange\n let data = this.data;\n\n data = [...data, num];\n\n if (this.numberValue > this.max) {\n data = [num];\n } else if (this.length < data.length) {\n data = data.slice(1, data.length);\n }\n\n this.data = data;\n\n return num;\n }\n\n del() {\n if (!this.data.filter((d) => d !== '0').filter(Boolean).length) {\n this.data = [];\n } else {\n this.data = this.data.slice(0, this.data.length - 1);\n }\n }\n\n clear() {\n this.data = [];\n }\n\n inc(gap) {\n this.replaceValue(\n this.#initialNumValue < this.max\n ? Math.max(this.#initialNumValue + (gap || 1), this.min)\n : this.min\n );\n }\n\n dec(gap) {\n this.replaceValue(\n this.#initialNumValue > this.min\n ? Math.min(this.#initialNumValue - (gap || 1), this.max)\n : this.max\n );\n }\n\n isInRange(val) {\n return val >= this.min && val <= this.max;\n }\n\n replaceValue(val) {\n if (this.isInRange(val)) {\n this.data = val.toString().padStart(this.length, 0).split('');\n }\n }\n\n setMin(val) {\n this.min = Number(val);\n }\n\n setMax(val) {\n this.max = Number(val);\n }\n}\n","import { createBaseInputClass } from '../../baseClasses/createBaseInputClass';\nimport {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n portalMixin,\n} from '../../mixins';\nimport { forwardAttrs, getComponentName } from '../../helpers/componentHelpers';\nimport { compose } from '../../helpers';\nimport {\n newDate,\n isValidTimestamp,\n formatTimestamp,\n isSupportedKey,\n isNumber,\n getKeyMap,\n getCurrentTime,\n overrideConstructedStylesheet,\n} from './helpers';\nimport { formats } from './formats';\nimport { calendarIcon } from './icons';\nimport { counterConfig, DEFAULT_FORMAT, DIVIDER, NATIVE_FORMAT } from './consts';\nimport { DateCounter } from './DateCounterClass';\nimport { TextFieldClass } from '../descope-text-field/TextFieldClass';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('date-field');\n\n// we set baseSelector to `vaadin-popover` as a temporary hack, so our portalMixin will\n// be able to process this component's overlay. The whole process needs refactoring as soon as possible.\nconst BASE_SELECTOR = 'vaadin-popover';\nconst BaseInputClass = createBaseInputClass({ componentName, baseSelector: BASE_SELECTOR });\n\nconst dateFieldAttrs = ['format', 'opened', 'initial-value', 'readonly'];\nconst calendarAttrs = ['years-range', 'calendar-months', 'calendar-weekdays'];\nconst observedAttrs = [...dateFieldAttrs, ...calendarAttrs];\n\nclass RawDateFieldClass extends BaseInputClass {\n timestamp = '';\n\n format = DEFAULT_FORMAT;\n\n selectedCounterIdx = 0;\n\n updateCountersDisplay() {\n this.inputElement.value = this.countersValue;\n }\n\n updateValue() {\n if (this.isCountersOutOfRange) {\n this.updateTimestamp('');\n } else {\n const date = formats[this.format].getDate(this.inputElement.value);\n this.updateTimestamp(date.getTime());\n }\n }\n\n onDateCounterChange = () => {\n this.updateCountersDisplay();\n this.updateValue();\n // update validity\n this.#dispatchInput();\n };\n\n updateTimestamp(epochOrDate) {\n if (!epochOrDate) {\n this.timestamp = '';\n } else {\n this.timestamp = newDate(epochOrDate).getTime();\n }\n }\n\n #yearDateCounter = new DateCounter(counterConfig.YEAR, this.onDateCounterChange.bind(this));\n\n dateCounters = [\n new DateCounter(counterConfig.MONTH, this.onDateCounterChange.bind(this)),\n new DateCounter(counterConfig.DAY, this.onDateCounterChange.bind(this)),\n this.#yearDateCounter,\n ];\n\n static get observedAttributes() {\n return [].concat(BaseInputClass.observedAttributes || [], observedAttrs);\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div>\n <descope-text-field>\n <span slot=\"suffix\" class=\"toggle-calendar\">\n ${calendarIcon}\n </span>\n </descope-text-field>\n <vaadin-popover></vaadin-popover>\n </div>\n `;\n\n injectStyle(\n `\n :host {\n display: inline-block;\n box-sizing: border-box;\n user-select: none;\n max-width: 100%;\n }\n\n :host ::slotted {\n padding: 0;\n }\n\n .toggle-calendar {\n cursor: pointer;\n display: flex;\n align-self: center;\n z-index: 1;\n height: 100%;\n align-items: center;\n }\n\n :host([readonly=\"true\"]) .toggle-calendar {\n pointer-events: none;\n }\n `,\n this\n );\n\n this.inputElement = this.shadowRoot.querySelector('descope-text-field');\n this.popoverToggleButton = this.inputElement.querySelector('.toggle-calendar');\n }\n\n get validationTarget() {\n return this.inputElement;\n }\n\n get opened() {\n return this.getAttribute('opened') === 'true';\n }\n\n // returns the input's value as a timestamp\n get displayValueEpoch() {\n const date = formats[this.format].getDate(this.inputElement.value);\n\n if (!isValidTimestamp(date?.getTime())) {\n return null;\n }\n\n return date.getTime();\n }\n\n get sortedCounters() {\n return this.format\n .split(DIVIDER)\n .map((placeholder) => this.dateCounters.find((dc) => dc.placeholder === placeholder));\n }\n\n get activeCounter() {\n return this.sortedCounters[this.selectedCounterIdx];\n }\n\n get countersValue() {\n return this.sortedCounters.map((dc) => dc.stringValue).join(DIVIDER);\n }\n\n get overlay() {\n return this.baseElement.shadowRoot?.querySelector('vaadin-popover-overlay');\n }\n\n get backdrop() {\n return this.overlay.shadowRoot?.querySelector('#backdrop');\n }\n\n get calendar() {\n return this.overlay?.querySelector('descope-calendar');\n }\n\n get isRTL() {\n const computedStyleDirection = getComputedStyle(this.baseElement).getPropertyValue('direction');\n\n if (computedStyleDirection) {\n return computedStyleDirection === 'rtl';\n }\n\n // Fallback: If for some reason computed style was not calculated in time, fallback to check on attribute\n return this.getAttribute('st-host-direction') === 'rtl';\n }\n\n get value() {\n return this.timestamp;\n }\n\n set value(val) {\n if (val) {\n this.updateTimestamp(val);\n this.updateDateCounters(newDate(val));\n } else {\n this.updateTimestamp('');\n }\n }\n\n get isCountersEmpty() {\n return this.dateCounters.every((dc) => dc.isEmpty);\n }\n\n get isCountersOutOfRange() {\n return this.dateCounters.some((dc) => !dc.isInRange(dc.numberValue));\n }\n\n reportValidity() {\n this.inputElement.reportValidity();\n }\n\n #dispatchInput() {\n this.inputElement.baseElement.dispatchEvent(new Event('input', { bubbles: true }));\n }\n\n updateInputDisplay() {\n this.inputElement.value = formatTimestamp(newDate(this.countersValue).getTime(), this.format);\n }\n\n init() {\n super.init?.();\n\n this.updateFormatPattern();\n this.initPopover();\n this.onDateCounterChange();\n this.initInputElement();\n\n setTimeout(() => {\n this.#overrideOverlaySettings();\n }, 0);\n }\n\n initInputElement() {\n this.inputElement.getValidity = this.getValidity.bind(this);\n this.inputElement.baseElement.checkValidity = this.checkValidity.bind(this);\n\n this.popoverToggleButton.addEventListener('click', this.onPopoverToggle.bind(this));\n\n this.inputElement.addEventListener('focus', this.onFocus.bind(this));\n this.inputElement.addEventListener('blur', this.onBlur.bind(this));\n this.inputElement.addEventListener('click', this.handleMouseCaretPositionChange.bind(this));\n this.inputElement.addEventListener('keydown', this.handleNavKeys.bind(this));\n this.inputElement.addEventListener('keydown', this.handleDigitKeys.bind(this));\n\n forwardAttrs(this, this.inputElement, {\n includeAttrs: [\n 'label',\n 'label-type',\n 'placeholder',\n 'disabled',\n 'readonly',\n 'bordered',\n 'required',\n 'full-width',\n 'st-host-direction',\n 'pattern',\n 'bordered',\n 'data-errormessage-value-missing',\n 'data-errormessage-pattern-mismatch',\n 'data-errormessage-range-underflow',\n 'data-errormessage-range-overflow',\n 'st-error-message-icon',\n 'st-error-message-icon-size',\n 'st-error-message-icon-padding',\n ],\n });\n }\n\n initPopover() {\n this.baseElement.trigger = ['click'];\n this.baseElement.withBackdrop = true;\n this.baseElement.renderer = this.#popoverRenderer.bind(this);\n\n // block popover events from focusing/blurring the text-field\n this.baseElement.addEventListener('click', (e) => {\n e.preventDefault();\n e.stopPropagation();\n });\n }\n\n #popoverPosStylesheet;\n\n #popoverRenderer(root) {\n // popoverRenderer should run only once, when the popover is first rendering.\n if (!root.firstChild) {\n this.overlay.positionTarget = this.shadowRoot.querySelector('.toggle-calendar');\n\n root.appendChild(this.#getPopoverContent());\n\n // override vaadin's constructed stylesheet which hides the host element\n overrideConstructedStylesheet(this.baseElement);\n\n this.backdrop.addEventListener('click', this.closePopover.bind(this));\n }\n\n // Hide overlay before adjusting position to prevent flickering\n root.style.setProperty('visibility', 'hidden');\n\n // Wait until overlay is ready\n setTimeout(() => {\n this.#adjustPopoverPosition(root);\n\n // Show adjusted overlay\n root.style.setProperty('visibility', 'visible');\n this.updateCalendarView(root);\n }, 100);\n }\n\n #adjustPopoverPosition() {\n const popover = this.shadowRoot.querySelector('vaadin-popover').shadowRoot;\n\n // Remove previously added stylesheets\n this.#popoverPosStylesheet?.remove();\n\n const windowRect = document.body.getBoundingClientRect();\n const inputRect = this.getBoundingClientRect();\n const calendarRect = this.calendar.getBoundingClientRect();\n\n const side = this.isRTL ? 'right' : 'left';\n const offset = inputRect[side] - calendarRect[side];\n const availableLeft = calendarRect.left;\n const availableRight = windowRect.width - calendarRect.right;\n\n let newOffset;\n if (offset > 0) {\n newOffset = Math.min(offset, availableRight);\n } else {\n newOffset = Math.min(Math.abs(offset), availableLeft) * -1;\n }\n\n injectStyle(\n `\n vaadin-popover-overlay::part(overlay) {\n transform: translateX(${newOffset}px);\n }\n `,\n popover\n );\n }\n\n #getPopoverContent() {\n const ele = document.createElement('span');\n\n ele.innerHTML = `<descope-calendar></descope-calendar>`;\n\n const calendar = ele.querySelector('descope-calendar');\n\n calendar.addEventListener('date-submit', this.onCalendarSubmit.bind(this));\n calendar.addEventListener('cancel', this.closePopover.bind(this));\n\n return ele;\n }\n\n // the default vaadin behavior is to attach the overlay to the body when opened\n // we do not want that because it's difficult to style the overlay in this way\n // so we override it to open inside the shadow DOM\n #overrideOverlaySettings() {\n this.overlay._attachOverlay = () => this.overlay.bringToFront();\n this.overlay._detachOverlay = () => {};\n this.overlay._enterModalState = () => {};\n }\n\n onPopoverToggle() {\n this.opened ? this.closePopover() : this.openPopover();\n }\n\n openPopover() {\n this.setAttribute('opened', 'true');\n }\n\n closePopover() {\n this.removeAttribute('opened');\n this.inputElement.focus();\n }\n\n getCounterById(id) {\n return this.dateCounters.find((dc) => dc.id === id);\n }\n\n onCalendarSubmit() {\n if (!this.isReadOnly) {\n if (!this.calendar.value) return;\n\n const calendarDate = newDate(this.calendar.value);\n\n this.value = calendarDate.getTime();\n\n this.getCounterById('year').replaceValue(calendarDate.getFullYear());\n this.getCounterById('month').replaceValue(calendarDate.getMonth() + 1);\n this.getCounterById('day').replaceValue(calendarDate.getDate());\n\n this.#dispatchInput();\n }\n\n this.closePopover();\n }\n\n updateCalendarView() {\n const validInputVal =\n isValidTimestamp(newDate(this.inputElement.value || '').getTime()) &&\n formats[this.format].validate(this.inputElement.value);\n\n if (this.displayValueEpoch || validInputVal) {\n this.calendar.setAttribute(\n 'initial-value',\n formatTimestamp(this.displayValueEpoch || this.timestamp, NATIVE_FORMAT)\n );\n } else {\n this.calendar.clearValue();\n this.calendar.setAttribute('preview', formatTimestamp(getCurrentTime(), NATIVE_FORMAT));\n }\n\n forwardAttrs(this, this.calendar, {\n includeAttrs: [\n 'st-host-direction',\n 'readonly',\n 'initial-month',\n 'initial-year',\n 'years-range',\n 'calendar-label-submit',\n 'calendar-label-cancel',\n 'calendar-months',\n 'calendar-weekdays',\n 'calendar-weekdays-short',\n ],\n });\n }\n\n onFocus() {\n if (this.isReadOnly) {\n return;\n }\n\n if (!this.inputElement.value) {\n this.inputElement.value = this.format;\n this.setInputSelectionRange();\n }\n }\n\n onBlur() {\n if (this.opened) {\n return;\n }\n\n if (this.inputElement.value === this.format) {\n this.inputElement.value = '';\n }\n }\n\n onFormatUpdate(format) {\n if (Object.keys(formats).includes(format)) {\n this.format = format;\n this.updateFormatPattern();\n }\n }\n\n updateFormatPattern() {\n const format = this.getAttribute('format') || this.format || DEFAULT_FORMAT;\n this.setAttribute('type', 'date');\n this.setAttribute('pattern', formats[format].pattern);\n }\n\n handleDigitKeys(e) {\n if (isNumber(e.key)) {\n e.preventDefault();\n\n this.activeCounter.add(e.key);\n\n if (this.activeCounter.isFull) {\n this.selectNextCounter();\n }\n\n this.setInputSelectionRange();\n }\n }\n\n getCounterIdx(caretPos) {\n const [counter1ln, counter2ln] = this.sortedCounters.map((dc) => dc.length);\n\n const c1 = caretPos <= counter1ln;\n const c2 = caretPos >= counter1ln && caretPos <= counter1ln + counter2ln + 1;\n const c3 = caretPos >= counter1ln + counter2ln + 2;\n\n return [c1, c2, c3].indexOf(true);\n }\n\n setSelectedCounterByCaretPosition(e) {\n this.selectedCounterIdx = this.getCounterIdx(e.target.selectionStart);\n }\n\n selectNextCounter() {\n if (this.selectedCounterIdx < this.dateCounters.length) {\n this.selectedCounterIdx = Math.min(this.selectedCounterIdx + 1, 2);\n }\n }\n\n selectPrevCounter() {\n if (this.selectedCounterIdx > 0) {\n this.selectedCounterIdx = Math.min(this.selectedCounterIdx - 1, 1);\n }\n }\n\n // Sets the text selection range in the input element based on the selected counter.\n // The function calculates the starting position of the selection by summing the lengths\n // of all counters before the currently selected counter (`selectedCounterIdx`).\n // It then selects the entire length of the current counter in the input element.\n setInputSelectionRange() {\n // For preview/readonly state we don't have a caret or a caretIdx, so we skip setting input selection range\n if (this.selectedCounterIdx < 0) {\n return;\n }\n\n const caretStart = this.sortedCounters\n .slice(0, this.selectedCounterIdx)\n .reduce((acc, counter) => acc + counter.length, this.selectedCounterIdx);\n\n this.inputElement.setSelectionRange(\n caretStart,\n caretStart + this.sortedCounters[this.selectedCounterIdx].length\n );\n }\n\n resetDateCounters() {\n this.dateCounters.forEach((dc) => dc.clear());\n }\n\n // in case value is set from external source we need to update date counters\n updateDateCounters(date) {\n this.dateCounters.forEach((dc) => {\n switch (dc.id) {\n case counterConfig.MONTH.id:\n dc.set(date.getMonth() + 1);\n break;\n case counterConfig.YEAR.id:\n dc.set(date.getFullYear());\n break;\n case counterConfig.DAY.id:\n dc.set(date.getDate());\n break;\n default:\n break;\n }\n });\n }\n\n handleNavKeys(e) {\n if (this.isReadOnly) {\n return;\n }\n\n const { key, shiftKey, metaKey } = e;\n const keys = getKeyMap(key, shiftKey, metaKey);\n\n if (this.opened) {\n this.closePopover();\n }\n\n e.preventDefault();\n\n if (isSupportedKey(key)) {\n const counter = this.activeCounter;\n\n if (!counter) return;\n\n const counterData = Object.values(counterConfig).find((config) => config.id === counter.id);\n const { count, shiftCount } = counterData;\n\n if (keys.backspace) this.handleBackspace();\n else if (keys.arrowUp) counter.inc();\n else if (keys.arrowDown) counter.dec();\n else if (keys.shiftArrowUp) counter.inc(count);\n else if (keys.shiftArrowDown) counter.dec(count);\n else if (keys.pageUp) counter.inc(count);\n else if (keys.pageDown) counter.dec(count);\n else if (keys.shiftPageUp) counter.inc(shiftCount);\n else if (keys.shiftPageDown) counter.dec(shiftCount);\n else if (keys.arrowRight) this.selectNextCounter();\n else if (keys.arrowLeft) this.selectPrevCounter();\n\n this.setInputSelectionRange();\n }\n }\n\n handleBackspace() {\n const counter = this.activeCounter;\n\n if (counter.isEmpty) {\n this.selectPrevCounter();\n this.setInputSelectionRange();\n } else {\n counter.del();\n }\n }\n\n handleMouseCaretPositionChange(e) {\n if (this.opened) {\n return;\n }\n e.preventDefault();\n this.setSelectedCounterByCaretPosition(e);\n this.setInputSelectionRange();\n }\n\n onInitialValueChange(val) {\n // if component already has a value don't re-set value\n if (this.value) return;\n\n // we need to wait for the text-field to init\n setTimeout(() => {\n this.value = val;\n });\n }\n\n setYearRange(val) {\n if (!val) return;\n const [min, max] = val.split?.('-');\n if (min && max) {\n this.#yearDateCounter.setMin(min);\n this.#yearDateCounter.setMax(max);\n }\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue !== newValue) {\n if (attrName === 'years-range') {\n this.setYearRange(newValue);\n }\n if (dateFieldAttrs.includes(attrName)) {\n if (newValue && attrName === 'format') {\n this.onFormatUpdate(newValue);\n }\n if (attrName === 'initial-value') {\n this.onInitialValueChange(newValue);\n }\n } else if (calendarAttrs.includes(attrName)) {\n if (newValue) {\n this.calendar?.setAttribute(attrName, newValue);\n } else {\n this.calendar?.removeAttribute(attrName);\n }\n }\n }\n }\n\n getValidity() {\n if (this.isRequired && this.isCountersEmpty) {\n return { valueMissing: true };\n }\n\n if (this.isCountersOutOfRange) {\n return { patternMismatch: true };\n }\n\n return {};\n }\n}\n\nconst textVars = TextFieldClass.cssVarList;\nconst { host, input, inputEleRTL, toggleButton, overlay, backdrop, errorMessage } = {\n host: { selector: () => ':host' },\n input: { selector: () => 'descope-text-field' },\n inputEleRTL: { selector: () => ':host([st-host-direction=\"rtl\"]) descope-text-field' },\n toggleButton: { selector: () => '.toggle-calendar' },\n overlay: { selector: 'vaadin-popover-overlay::part(overlay)' },\n backdrop: { selector: 'vaadin-popover-overlay::part(backdrop)' },\n};\n\nexport const DateFieldClass = compose(\n createStyleMixin({ componentNameOverride: getComponentName('input-wrapper') }),\n createStyleMixin({\n mappings: {\n iconMargin: { ...toggleButton, property: 'margin-inline-end' },\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n textAlign: { ...input, property: 'text-align' },\n rtlInputDirection: { ...inputEleRTL, property: textVars.inputDirection },\n rtlInputAlignment: { ...inputEleRTL, property: textVars.inputTextAlign },\n overlayGap: {\n property: () => DateFieldClass.cssVarList.overlayGap,\n },\n overlayBackgroundColor: {\n property: () => DateFieldClass.cssVarList.overlayBackgroundColor,\n },\n overlayPadding: {\n property: () => DateFieldClass.cssVarList.overlayPadding,\n },\n overlayBoxShadow: { property: () => DateFieldClass.overlayBoxShadow },\n overlayOutlineWidth: {\n property: () => DateFieldClass.cssVarList.overlayOutlineWidth,\n },\n overlayOutlineColor: {\n property: () => DateFieldClass.cssVarList.overlayOutlineColor,\n },\n overlayOutlineStyle: {\n property: () => DateFieldClass.cssVarList.overlayOutlineStyle,\n },\n errorMessageIcon: {\n selector: TextFieldClass.componentName,\n property: TextFieldClass.cssVarList.errorMessageIcon,\n },\n errorMessageIconSize: {\n selector: TextFieldClass.componentName,\n property: TextFieldClass.cssVarList.errorMessageIconSize,\n },\n errorMessageIconPadding: {\n selector: TextFieldClass.componentName,\n property: TextFieldClass.cssVarList.errorMessageIconPadding,\n },\n errorMessageIconRepeat: {\n selector: TextFieldClass.componentName,\n property: TextFieldClass.cssVarList.errorMessageIconRepeat,\n },\n errorMessageIconPosition: {\n selector: TextFieldClass.componentName,\n property: TextFieldClass.cssVarList.errorMessageIconPosition,\n },\n errorMessageFontSize: {\n selector: TextFieldClass.componentName,\n property: TextFieldClass.cssVarList.errorMessageFontSize,\n },\n },\n }),\n portalMixin({\n name: 'overlay',\n selector: '',\n mappings: {\n marginTop: { ...overlay, property: 'margin-top' },\n backgroundColor: { ...overlay },\n backdropBackgroundColor: { ...backdrop, property: 'background-color' },\n backdropPointerEvents: { ...backdrop, property: 'pointer-events' },\n padding: { ...overlay },\n boxShadow: { ...overlay },\n outlineWidth: { ...overlay },\n outlineColor: { ...overlay },\n outlineStyle: { ...overlay },\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(RawDateFieldClass);\n","import '@vaadin/popover/src/vaadin-popover';\nimport './descope-calendar';\nimport '../descope-text-field';\n\nimport { componentName, DateFieldClass } from './DateFieldClass';\n\ncustomElements.define(componentName, DateFieldClass);\n\nexport { DateFieldClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n createProxy,\n proxyInputMixin,\n componentNameValidationMixin,\n} from '../../mixins';\nimport textFieldMappings from './textFieldMappings';\nimport { compose } from '../../helpers';\nimport { getComponentName } from '../../helpers/componentHelpers';\nimport {\n inputFloatingLabelStyle,\n resetInputLabelPosition,\n resetInputOverrides,\n useHostExternalPadding,\n} from '../../helpers/themeHelpers/resetHelpers';\n\nexport const componentName = getComponentName('text-field');\n\nconst observedAttrs = ['type', 'label-type', 'copy-to-clipboard'];\n\nconst customMixin = (superclass) =>\n class TextFieldClass extends superclass {\n static get observedAttributes() {\n return observedAttrs.concat(superclass.observedAttributes || []);\n }\n\n icon;\n\n init() {\n super.init?.();\n }\n\n renderCopyToClipboard(shouldRender) {\n if (!shouldRender) {\n this.icon?.remove();\n return;\n }\n\n const iconInitConfig = {\n icon: 'vaadin:copy-o',\n title: 'Copy',\n style: 'cursor: pointer',\n };\n\n const iconCopiedConfig = {\n icon: 'vaadin:check-circle-o',\n title: 'Copied',\n style: 'cursor: initial',\n };\n\n this.icon = Object.assign(document.createElement('vaadin-icon'), {\n slot: 'suffix',\n ...iconInitConfig,\n });\n\n this.baseElement.appendChild(this.icon);\n this.icon.addEventListener('click', () => {\n navigator.clipboard.writeText(this.value);\n Object.assign(this.icon, iconCopiedConfig);\n\n // we want the icon to go back to the initial state after 5 seconds\n setTimeout(() => {\n Object.assign(this.icon, iconInitConfig);\n }, 5000);\n });\n }\n\n onLabelClick() {\n this.focus();\n }\n\n attributeChangedCallback(attrName, oldVal, newVal) {\n super.attributeChangeCallback?.(attrName, oldVal, newVal);\n\n // Vaadin doesn't allow to change the input type attribute.\n // We need the ability to do that, so we're overriding their\n // behavior with their private API.\n // When receiving a `type` attribute, we use their private API\n // to set it on the input.\n if (attrName === 'type') {\n this.baseElement._setType(newVal);\n }\n\n if (oldVal !== newVal) {\n if (attrName === 'label-type') {\n if (newVal === 'floating') {\n this.addEventListener('click', this.onLabelClick);\n } else {\n this.removeEventListener('click', this.onLabelClick);\n }\n } else if (attrName === 'copy-to-clipboard') {\n this.renderCopyToClipboard(newVal === 'true');\n }\n }\n }\n };\n\nexport const TextFieldClass = compose(\n createStyleMixin({\n mappings: textFieldMappings,\n }),\n draggableMixin,\n proxyInputMixin({ proxyProps: ['value', 'selectionStart'], useProxyTargets: true }),\n componentNameValidationMixin,\n customMixin\n)(\n createProxy({\n slots: ['prefix', 'suffix'],\n wrappedEleName: 'vaadin-text-field',\n style: () => `\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tpadding: calc(var(${TextFieldClass.cssVarList.inputOutlineWidth}) + var(${\n TextFieldClass.cssVarList.inputOutlineOffset\n }));\n box-sizing: border-box;\n\t\t\t}\n :host(:is([readonly], [disabled])) ::slotted(:is(input, textarea):placeholder-shown) {\n opacity: 1;\n }\n\n vaadin-text-field[label-type=\"floating\"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n vaadin-text-field[label-type=\"floating\"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n ${resetInputLabelPosition('vaadin-text-field')}\n\t\t\t${useHostExternalPadding(TextFieldClass.cssVarList)}\n\t\t\t${resetInputOverrides('vaadin-text-field', TextFieldClass.cssVarList)}\n ${inputFloatingLabelStyle()}\n\n vaadin-text-field vaadin-icon {\n align-self: center;\n }\n\t\t`,\n excludeAttrsSync: ['tabindex', 'style'],\n componentName,\n })\n);\n"],"names":["host","label","placeholder","requiredIndicator","inputField","input","inputMask","helperText","errorMessage","disabledPlaceholder","inputDisabled","inputIcon","externalInput","externalInputDisabled","externalPlaceholder","externalDisabledPlaceholder","selector","fontSize","fontFamily","labelFontSize","property","labelFontWeight","labelTextColor","hostWidth","hostMinWidth","hostDirection","inputDirection","inputBackgroundColor","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","helperTextColor","inputValueTextColor","inputCaretTextColor","labelRequiredIndicator","inputBorderColor","inputBorderWidth","inputBorderStyle","inputBorderRadius","inputHeight","inputHorizontalPadding","inputOutlineColor","inputOutlineStyle","inputOutlineWidth","inputOutlineOffset","textAlign","inputTextAlign","inputPlaceholderColor","labelPosition","labelTopPosition","labelHorizontalPosition","inputTransformY","inputTransition","marginInlineStart","placeholderOpacity","inputVerticalAlignment","valueInputHeight","valueInputMarginBottom","inputIconOffset","inputIconSize","inputIconColor","customElements","define","patterns","MM","DD","YYYY","createFormat","format","pattern","split","map","part","join","createPattern","toValuesFn","order","match","values","forEach","index","createToValuesFn","regexp","RegExp","validate","val","test","getDate","exec","year","month","day","createDate","formats","Object","fromEntries","f","DateCounter","freeze","constructor","id","min","max","onChange","this","data","length","numberValue","Number","stringValue","padStart","isFull","isEmpty","toString","set","add","num","slice","del","filter","d","Boolean","clear","inc","gap","replaceValue","Math","dec","isInRange","setMin","setMax","componentName","BaseInputClass","createBaseInputClass","baseSelector","dateFieldAttrs","calendarAttrs","observedAttrs","textVars","TextFieldClass","cssVarList","inputEleRTL","toggleButton","overlay","backdrop","DateFieldClass","componentNameOverride","mappings","iconMargin","rtlInputDirection","rtlInputAlignment","overlayGap","overlayBackgroundColor","overlayPadding","overlayBoxShadow","overlayOutlineWidth","overlayOutlineColor","overlayOutlineStyle","name","marginTop","backgroundColor","backdropBackgroundColor","backdropPointerEvents","padding","boxShadow","outlineWidth","outlineColor","outlineStyle","timestamp","selectedCounterIdx","updateCountersDisplay","inputElement","value","countersValue","updateValue","isCountersOutOfRange","updateTimestamp","date","getTime","onDateCounterChange","epochOrDate","YEAR","bind","dateCounters","MONTH","DAY","observedAttributes","concat","super","attachShadow","mode","innerHTML","shadowRoot","querySelector","popoverToggleButton","validationTarget","opened","getAttribute","displayValueEpoch","sortedCounters","find","dc","activeCounter","baseElement","calendar","isRTL","computedStyleDirection","getComputedStyle","getPropertyValue","updateDateCounters","isCountersEmpty","every","some","reportValidity","dispatchEvent","Event","bubbles","updateInputDisplay","init","updateFormatPattern","initPopover","initInputElement","setTimeout","getValidity","checkValidity","addEventListener","onPopoverToggle","onFocus","onBlur","handleMouseCaretPositionChange","handleNavKeys","handleDigitKeys","includeAttrs","trigger","withBackdrop","renderer","e","preventDefault","stopPropagation","root","firstChild","positionTarget","appendChild","closePopover","style","setProperty","updateCalendarView","popover","remove","windowRect","document","body","getBoundingClientRect","inputRect","calendarRect","side","offset","availableLeft","left","availableRight","width","right","newOffset","abs","ele","createElement","onCalendarSubmit","_attachOverlay","bringToFront","_detachOverlay","_enterModalState","openPopover","setAttribute","removeAttribute","focus","getCounterById","isReadOnly","calendarDate","getFullYear","getMonth","validInputVal","clearValue","setInputSelectionRange","onFormatUpdate","keys","includes","key","selectNextCounter","getCounterIdx","caretPos","counter1ln","counter2ln","indexOf","setSelectedCounterByCaretPosition","target","selectionStart","selectPrevCounter","caretStart","reduce","acc","counter","setSelectionRange","resetDateCounters","shiftKey","metaKey","counterData","config","count","shiftCount","backspace","handleBackspace","arrowUp","arrowDown","shiftArrowUp","shiftArrowDown","pageUp","pageDown","shiftPageUp","shiftPageDown","arrowRight","arrowLeft","onInitialValueChange","setYearRange","attributeChangedCallback","attrName","oldValue","newValue","isRequired","valueMissing","patternMismatch","proxyProps","useProxyTargets","superclass","icon","renderCopyToClipboard","shouldRender","iconInitConfig","title","iconCopiedConfig","assign","slot","navigator","clipboard","writeText","onLabelClick","oldVal","newVal","attributeChangeCallback","_setType","removeEventListener","slots","wrappedEleName","excludeAttrsSync"],"sourceRoot":""}
|
1
|
+
{"version":3,"file":"descope-date-field-index-js.js","mappings":"yJAAA,MAAM,KACJA,EAAI,MACJC,EAAK,YACLC,EAAW,kBACXC,EAAiB,WACjBC,EAAU,MACVC,EAAK,UACLC,EAAS,WACTC,EAAU,aACVC,EAAY,oBACZC,EAAmB,cACnBC,EAAa,UACbC,EAAS,cACTC,EAAa,sBACbC,EAAqB,oBACrBC,EAAmB,4BACnBC,GACE,CACFf,KAAM,CAAEgB,SAAU,IAAM,SACxBf,MAAO,CAAEe,SAAU,iBACnBb,kBAA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0BAA0BvB,EAAUqB,EAAQC,GAOjC,SAAbtB,GACFhO,KAAKmG,YAAYqJ,SAASF,GAGxBD,IAAWC,IACI,eAAbtB,EACa,aAAXsB,EACFtP,KAAK0H,iBAAiB,QAAS1H,KAAKoP,cAEpCpP,KAAKyP,oBAAoB,QAASzP,KAAKoP,cAEnB,sBAAbpB,GACThO,KAAK0O,sBAAiC,SAAXY,GAGjC,IAG0B,EAS5B,QAAY,CACVI,MAAO,CAAC,SAAU,UAClBC,eAAgB,oBAChB9G,MAAO,IAAM,wGAIO1G,EAAeC,WAAWjG,4BACxCgG,EAAeC,WAAWhG,+cAc5B,QAAwB,gCAC3B,QAAuB+F,EAAeC,uBACtC,QAAoB,oBAAqBD,EAAeC,uBACrD,iGAMJwN,iBAAkB,CAAC,WAAY,SAC/BjO,kB","sources":["webpack://@descope/web-components-ui/./src/components/descope-text-field/textFieldMappings.js","webpack://@descope/web-components-ui/./src/components/descope-text-field/index.js","webpack://@descope/web-components-ui/./src/components/descope-date-field/formats.js","webpack://@descope/web-components-ui/./src/components/descope-date-field/DateCounterClass.js","webpack://@descope/web-components-ui/./src/components/descope-date-field/DateFieldClass.js","webpack://@descope/web-components-ui/./src/components/descope-date-field/index.js","webpack://@descope/web-components-ui/./src/components/descope-text-field/TextFieldClass.js"],"sourcesContent":["const {\n host,\n label,\n placeholder,\n requiredIndicator,\n inputField,\n input,\n inputMask,\n helperText,\n errorMessage,\n disabledPlaceholder,\n inputDisabled,\n inputIcon,\n externalInput,\n externalInputDisabled,\n externalPlaceholder,\n externalDisabledPlaceholder,\n} = {\n host: { selector: () => ':host' },\n label: { selector: '::part(label)' },\n requiredIndicator: { selector: '[required]::part(required-indicator)::after' },\n placeholder: [\n { selector: '> input:placeholder-shown' },\n { selector: () => ':host::slotted(input:placeholder-shown)' },\n ],\n disabledPlaceholder: { selector: '> input:disabled::placeholder' },\n inputField: { selector: '::part(input-field)' },\n input: { selector: 'input' },\n inputMask: { selector: '::part(input-field)::before' },\n inputDisabled: { selector: 'input:disabled' },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n inputIcon: { selector: 'vaadin-icon' },\n externalInput: { selector: () => '::slotted(input)' },\n externalInputDisabled: { selector: () => '::slotted(input:disabled)' },\n externalPlaceholder: { selector: () => '::slotted(input:placeholder-shown)' },\n externalDisabledPlaceholder: { selector: () => '::slotted(input:disabled::placeholder)' },\n};\n\nexport default {\n // we apply font-size also on the host so we can set its width with em\n fontSize: [{}, host],\n fontFamily: [label, inputField, helperText, errorMessage],\n\n labelFontSize: { ...label, property: 'font-size' },\n labelFontWeight: { ...label, property: 'font-weight' },\n\n labelTextColor: [\n { ...label, property: 'color' },\n { ...requiredIndicator, property: 'color' },\n { ...label, property: '-webkit-text-fill-color' },\n { ...requiredIndicator, property: '-webkit-text-fill-color' },\n ],\n\n hostWidth: { ...host, property: 'width' },\n hostMinWidth: { ...host, property: 'min-width' },\n hostDirection: { ...host, property: 'direction' },\n inputDirection: { ...input, property: 'direction' },\n\n inputBackgroundColor: [\n { ...inputField, property: 'background-color' },\n { ...inputMask, property: 'background-color' },\n ],\n\n errorMessageTextColor: { ...errorMessage, property: 'color' },\n errorMessageIcon: { ...errorMessage, property: 'background-image' },\n errorMessageIconSize: { ...errorMessage, property: 'background-size' },\n errorMessageIconPadding: { ...errorMessage, property: 'padding-inline-start' },\n errorMessageIconRepeat: { ...errorMessage, property: 'background-repeat' },\n errorMessageIconPosition: { ...errorMessage, property: 'background-position' },\n errorMessageFontSize: { ...errorMessage, property: 'font-size' },\n\n helperTextColor: { ...helperText, property: '-webkit-text-fill-color' },\n\n inputValueTextColor: [\n { ...inputField, property: 'color' },\n { ...inputDisabled, property: '-webkit-text-fill-color' },\n { ...externalInputDisabled, property: '-webkit-text-fill-color' },\n ],\n inputCaretTextColor: [\n { ...input, property: 'caret-color' },\n { ...externalInput, property: 'caret-color' },\n ],\n\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\n\n inputBorderColor: { ...inputField, property: 'border-color' },\n inputBorderWidth: { ...inputField, property: 'border-width' },\n inputBorderStyle: { ...inputField, property: 'border-style' },\n inputBorderRadius: { ...inputField, property: 'border-radius' },\n\n inputHeight: { ...inputField, property: 'height' },\n inputHorizontalPadding: [\n { ...input, property: 'padding-left' },\n { ...input, property: 'padding-right' },\n { ...externalInput, property: 'padding-left' },\n { ...externalInput, property: 'padding-right' },\n ],\n\n inputOutlineColor: { ...inputField, property: 'outline-color' },\n inputOutlineStyle: { ...inputField, property: 'outline-style' },\n inputOutlineWidth: { ...inputField, property: 'outline-width' },\n inputOutlineOffset: { ...inputField, property: 'outline-offset' },\n\n textAlign: {},\n\n inputTextAlign: [\n { ...input, property: 'text-align' },\n { ...externalInput, property: 'text-align' },\n ],\n\n inputPlaceholderColor: [\n { selector: () => ':host input:placeholder-shown', property: 'color' },\n { ...externalPlaceholder, property: 'color' },\n { ...placeholder, property: 'color' },\n { ...disabledPlaceholder, property: '-webkit-text-fill-color' },\n { ...externalDisabledPlaceholder, property: '-webkit-text-fill-color' },\n ],\n\n labelPosition: { ...label, property: 'position' },\n labelTopPosition: { ...label, property: 'top' },\n labelHorizontalPosition: [\n { ...label, property: 'left' },\n { ...label, property: 'right' },\n ],\n inputTransformY: { ...label, property: 'transform' },\n inputTransition: { ...label, property: 'transition' },\n marginInlineStart: { ...label, property: 'margin-inline-start' },\n placeholderOpacity: [\n { selector: '> input:placeholder-shown', property: 'opacity' },\n { ...externalPlaceholder, property: 'opacity' },\n ],\n inputVerticalAlignment: [\n { ...inputField, property: 'align-items' },\n { ...externalInput, property: 'align-items' },\n ],\n valueInputHeight: [\n { ...input, property: 'height' },\n { ...externalInput, property: 'height' },\n ],\n valueInputMarginBottom: [\n { ...input, property: 'margin-bottom' },\n { ...externalInput, property: 'margin-bottom' },\n ],\n\n inputIconOffset: [\n { ...inputIcon, property: 'margin-right' },\n { ...inputIcon, property: 'margin-left' },\n ],\n inputIconSize: { ...inputIcon, property: 'font-size' },\n inputIconColor: { ...inputIcon, property: 'color' },\n};\n","import '@vaadin/text-field';\nimport '@vaadin/icons';\nimport '@vaadin/icon';\n\nimport { componentName, TextFieldClass } from './TextFieldClass';\n\ncustomElements.define(componentName, TextFieldClass);\n\nexport { TextFieldClass, componentName };\n","import { DIVIDER, SUPPORTED_FORMATS } from './consts';\nimport { newDate } from './helpers';\n\nconst patterns = {\n MM: '(0?[1-9]|1[0-2])',\n DD: '(0?[1-9]|[12][0-9]|3[01])',\n YYYY: '([0-9]{4})',\n};\n\nconst createPattern = (format) => {\n const pattern = format\n .split(DIVIDER)\n .map((part) => patterns[part])\n .join('\\\\D');\n\n return `^${pattern}$`;\n};\n\nconst createToValuesFn = (format) => {\n const order = format.split(DIVIDER);\n return (match) => {\n const values = {};\n order.forEach((part, index) => {\n values[part] = match[index + 1];\n });\n return [values.YYYY, values.MM, values.DD];\n };\n};\n\nconst createDate = (val, regexp, toValuesFn) => {\n const match = regexp.exec(val);\n if (!match) return null;\n const [year, month, day] = toValuesFn(match);\n return newDate([year, month, day].join(DIVIDER));\n};\n\nconst createFormat = (format) => {\n const pattern = createPattern(format);\n const toValuesFn = createToValuesFn(format);\n const regexp = new RegExp(pattern);\n\n return {\n pattern,\n validate: (val) => regexp.test(val),\n getDate: (val) => createDate(val, regexp, toValuesFn),\n };\n};\n\nexport const formats = Object.fromEntries(SUPPORTED_FORMATS.map((f) => [f, createFormat(f)]));\n","// DateCounterClass allows us to add several counters to the input, and use them seperately.\n// For examele, we have a DayCounter, MonthCounter and YearCounter, which can each separately navigate\n// between different ranges.\nexport class DateCounter {\n #data = Object.freeze([]);\n\n constructor({ id, min, max, placeholder }, onChange) {\n this.id = id;\n this.min = min;\n this.max = max;\n this.placeholder = placeholder;\n this.onChange = onChange;\n }\n\n get data() {\n return this.#data;\n }\n\n set data(val) {\n this.#data = Object.freeze(val);\n this.onChange?.();\n }\n\n get #initialNumValue() {\n return this.data.length ? this.numberValue : 0;\n }\n\n get numberValue() {\n return Number(this.stringValue);\n }\n\n get stringValue() {\n return (this.data.join('') || this.placeholder).padStart(this.length, '0');\n }\n\n get isFull() {\n return this.numberValue * 10 > this.max || this.data.length === this.length;\n }\n\n get isEmpty() {\n return this.stringValue === this.placeholder;\n }\n\n get length() {\n return this.max.toString().length;\n }\n\n set(val) {\n this.data = val.toString().split('');\n }\n\n add(num) {\n // use local var to avoid triggering onChange\n let data = this.data;\n\n data = [...data, num];\n\n if (this.numberValue > this.max) {\n data = [num];\n } else if (this.length < data.length) {\n data = data.slice(1, data.length);\n }\n\n this.data = data;\n\n return num;\n }\n\n del() {\n if (!this.data.filter((d) => d !== '0').filter(Boolean).length) {\n this.data = [];\n } else {\n this.data = this.data.slice(0, this.data.length - 1);\n }\n }\n\n clear() {\n this.data = [];\n }\n\n inc(gap) {\n this.replaceValue(\n this.#initialNumValue < this.max\n ? Math.max(this.#initialNumValue + (gap || 1), this.min)\n : this.min\n );\n }\n\n dec(gap) {\n this.replaceValue(\n this.#initialNumValue > this.min\n ? Math.min(this.#initialNumValue - (gap || 1), this.max)\n : this.max\n );\n }\n\n isInRange(val) {\n return val >= this.min && val <= this.max;\n }\n\n replaceValue(val) {\n if (this.isInRange(val)) {\n this.data = val.toString().padStart(this.length, 0).split('');\n }\n }\n\n setMin(val) {\n this.min = Number(val);\n }\n\n setMax(val) {\n this.max = Number(val);\n }\n}\n","import { createBaseInputClass } from '../../baseClasses/createBaseInputClass';\nimport {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n portalMixin,\n} from '../../mixins';\nimport { forwardAttrs, getComponentName } from '../../helpers/componentHelpers';\nimport { compose } from '../../helpers';\nimport {\n newDate,\n isValidTimestamp,\n formatTimestamp,\n isSupportedKey,\n isNumber,\n getKeyMap,\n getCurrentTime,\n overrideConstructedStylesheet,\n} from './helpers';\nimport { formats } from './formats';\nimport { calendarIcon } from './icons';\nimport { counterConfig, DEFAULT_FORMAT, DIVIDER, NATIVE_FORMAT } from './consts';\nimport { DateCounter } from './DateCounterClass';\nimport { TextFieldClass } from '../descope-text-field/TextFieldClass';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('date-field');\n\n// we set baseSelector to `vaadin-popover` as a temporary hack, so our portalMixin will\n// be able to process this component's overlay. The whole process needs refactoring as soon as possible.\nconst BASE_SELECTOR = 'vaadin-popover';\nconst BaseInputClass = createBaseInputClass({ componentName, baseSelector: BASE_SELECTOR });\n\nconst dateFieldAttrs = ['format', 'opened', 'initial-value', 'readonly', 'disable-calendar'];\nconst calendarAttrs = ['years-range', 'calendar-months', 'calendar-weekdays'];\nconst observedAttrs = [...dateFieldAttrs, ...calendarAttrs];\n\nclass RawDateFieldClass extends BaseInputClass {\n timestamp = '';\n\n format = DEFAULT_FORMAT;\n\n selectedCounterIdx = 0;\n\n updateCountersDisplay() {\n this.inputElement.value = this.countersValue;\n }\n\n updateValue() {\n if (this.isCountersOutOfRange) {\n this.updateTimestamp('');\n } else {\n const date = formats[this.format].getDate(this.inputElement.value);\n this.updateTimestamp(date.getTime());\n }\n }\n\n onDateCounterChange = () => {\n this.updateCountersDisplay();\n this.updateValue();\n // update validity\n this.#dispatchInput();\n };\n\n updateTimestamp(epochOrDate) {\n if (!epochOrDate) {\n this.timestamp = '';\n } else {\n this.timestamp = newDate(epochOrDate).getTime();\n }\n }\n\n #yearDateCounter = new DateCounter(counterConfig.YEAR, this.onDateCounterChange.bind(this));\n\n dateCounters = [\n new DateCounter(counterConfig.MONTH, this.onDateCounterChange.bind(this)),\n new DateCounter(counterConfig.DAY, this.onDateCounterChange.bind(this)),\n this.#yearDateCounter,\n ];\n\n static get observedAttributes() {\n return [].concat(BaseInputClass.observedAttributes || [], observedAttrs);\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div>\n <descope-text-field>\n <span slot=\"suffix\" class=\"toggle-calendar\">\n ${calendarIcon}\n </span>\n </descope-text-field>\n <vaadin-popover></vaadin-popover>\n </div>\n `;\n\n injectStyle(\n `\n :host {\n display: inline-block;\n box-sizing: border-box;\n user-select: none;\n max-width: 100%;\n }\n\n :host ::slotted {\n padding: 0;\n }\n\n .toggle-calendar {\n cursor: pointer;\n display: flex;\n align-self: center;\n z-index: 1;\n height: 100%;\n align-items: center;\n }\n\n :host([readonly=\"true\"]) .toggle-calendar {\n pointer-events: none;\n }\n\n .hidden {\n display: none;\n }\n `,\n this\n );\n\n this.inputElement = this.shadowRoot.querySelector('descope-text-field');\n this.popoverToggleButton = this.inputElement.querySelector('.toggle-calendar');\n }\n\n get validationTarget() {\n return this.inputElement;\n }\n\n get opened() {\n return this.getAttribute('opened') === 'true';\n }\n\n // returns the input's value as a timestamp\n get displayValueEpoch() {\n const date = formats[this.format].getDate(this.inputElement.value);\n\n if (!isValidTimestamp(date?.getTime())) {\n return null;\n }\n\n return date.getTime();\n }\n\n get sortedCounters() {\n return this.format\n .split(DIVIDER)\n .map((placeholder) => this.dateCounters.find((dc) => dc.placeholder === placeholder));\n }\n\n get activeCounter() {\n return this.sortedCounters[this.selectedCounterIdx];\n }\n\n get countersValue() {\n return this.sortedCounters.map((dc) => dc.stringValue).join(DIVIDER);\n }\n\n get overlay() {\n return this.baseElement.shadowRoot?.querySelector('vaadin-popover-overlay');\n }\n\n get backdrop() {\n return this.overlay.shadowRoot?.querySelector('#backdrop');\n }\n\n get calendar() {\n return this.overlay?.querySelector('descope-calendar');\n }\n\n get isRTL() {\n const computedStyleDirection = getComputedStyle(this.baseElement).getPropertyValue('direction');\n\n if (computedStyleDirection) {\n return computedStyleDirection === 'rtl';\n }\n\n // Fallback: If for some reason computed style was not calculated in time, fallback to check on attribute\n return this.getAttribute('st-host-direction') === 'rtl';\n }\n\n get value() {\n return this.timestamp;\n }\n\n set value(val) {\n if (val) {\n this.updateTimestamp(val);\n this.updateDateCounters(newDate(val));\n } else {\n this.updateTimestamp('');\n }\n }\n\n get isCountersEmpty() {\n return this.dateCounters.every((dc) => dc.isEmpty);\n }\n\n get isCountersOutOfRange() {\n return this.dateCounters.some((dc) => !dc.isInRange(dc.numberValue));\n }\n\n get disableCalendar() {\n return this.getAttribute('disable-calendar') === 'true';\n }\n\n reportValidity() {\n this.inputElement.reportValidity();\n }\n\n #dispatchInput() {\n this.inputElement.baseElement.dispatchEvent(new Event('input', { bubbles: true }));\n }\n\n updateInputDisplay() {\n this.inputElement.value = formatTimestamp(newDate(this.countersValue).getTime(), this.format);\n }\n\n init() {\n super.init?.();\n\n this.updateFormatPattern();\n this.initPopover();\n this.onDateCounterChange();\n this.initInputElement();\n\n setTimeout(() => {\n this.#overrideOverlaySettings();\n }, 0);\n }\n\n initInputElement() {\n this.inputElement.getValidity = this.getValidity.bind(this);\n this.inputElement.baseElement.checkValidity = this.checkValidity.bind(this);\n\n this.popoverToggleButton.addEventListener('click', this.onPopoverToggle.bind(this));\n\n this.inputElement.addEventListener('focus', this.onFocus.bind(this));\n this.inputElement.addEventListener('blur', this.onBlur.bind(this));\n this.inputElement.addEventListener('click', this.handleMouseCaretPositionChange.bind(this));\n this.inputElement.addEventListener('keydown', this.handleNavKeys.bind(this));\n this.inputElement.addEventListener('keydown', this.handleDigitKeys.bind(this));\n\n forwardAttrs(this, this.inputElement, {\n includeAttrs: [\n 'label',\n 'label-type',\n 'placeholder',\n 'disabled',\n 'readonly',\n 'bordered',\n 'required',\n 'full-width',\n 'st-host-direction',\n 'pattern',\n 'bordered',\n 'data-errormessage-value-missing',\n 'data-errormessage-pattern-mismatch',\n 'data-errormessage-range-underflow',\n 'data-errormessage-range-overflow',\n 'st-error-message-icon',\n 'st-error-message-icon-size',\n 'st-error-message-icon-padding',\n ],\n });\n }\n\n initPopover() {\n this.baseElement.trigger = ['click'];\n this.baseElement.withBackdrop = true;\n this.baseElement.renderer = this.#popoverRenderer.bind(this);\n\n // block popover events from focusing/blurring the text-field\n this.baseElement.addEventListener('click', (e) => {\n e.preventDefault();\n e.stopPropagation();\n });\n }\n\n #popoverPosStylesheet;\n\n #popoverRenderer(root) {\n // popoverRenderer should run only once, when the popover is first rendering.\n if (!root.firstChild) {\n this.overlay.positionTarget = this.shadowRoot.querySelector('.toggle-calendar');\n\n root.appendChild(this.#getPopoverContent());\n\n // override vaadin's constructed stylesheet which hides the host element\n overrideConstructedStylesheet(this.baseElement);\n\n this.backdrop.addEventListener('click', this.closePopover.bind(this));\n }\n\n // Hide overlay before adjusting position to prevent flickering\n root.style.setProperty('visibility', 'hidden');\n\n // Wait until overlay is ready\n setTimeout(() => {\n this.#adjustPopoverPosition(root);\n\n // Show adjusted overlay\n root.style.setProperty('visibility', 'visible');\n this.updateCalendarView(root);\n }, 100);\n }\n\n #adjustPopoverPosition() {\n const popover = this.shadowRoot.querySelector('vaadin-popover').shadowRoot;\n\n // Remove previously added stylesheets\n this.#popoverPosStylesheet?.remove();\n\n const windowRect = document.body.getBoundingClientRect();\n const inputRect = this.getBoundingClientRect();\n const calendarRect = this.calendar.getBoundingClientRect();\n\n const side = this.isRTL ? 'right' : 'left';\n const offset = inputRect[side] - calendarRect[side];\n const availableLeft = calendarRect.left;\n const availableRight = windowRect.width - calendarRect.right;\n\n let newOffset;\n if (offset > 0) {\n newOffset = Math.min(offset, availableRight);\n } else {\n newOffset = Math.min(Math.abs(offset), availableLeft) * -1;\n }\n\n injectStyle(\n `\n vaadin-popover-overlay::part(overlay) {\n transform: translateX(${newOffset}px);\n }\n `,\n popover\n );\n }\n\n #getPopoverContent() {\n const ele = document.createElement('span');\n\n ele.innerHTML = `<descope-calendar></descope-calendar>`;\n\n const calendar = ele.querySelector('descope-calendar');\n\n calendar.addEventListener('date-submit', this.onCalendarSubmit.bind(this));\n calendar.addEventListener('cancel', this.closePopover.bind(this));\n\n return ele;\n }\n\n // the default vaadin behavior is to attach the overlay to the body when opened\n // we do not want that because it's difficult to style the overlay in this way\n // so we override it to open inside the shadow DOM\n #overrideOverlaySettings() {\n this.overlay._attachOverlay = () => this.overlay.bringToFront();\n this.overlay._detachOverlay = () => {};\n this.overlay._enterModalState = () => {};\n }\n\n onPopoverToggle() {\n this.opened ? this.closePopover() : this.openPopover();\n }\n\n openPopover() {\n if (this.disableCalendar) return;\n this.setAttribute('opened', 'true');\n }\n\n closePopover() {\n this.removeAttribute('opened');\n this.inputElement.focus();\n }\n\n getCounterById(id) {\n return this.dateCounters.find((dc) => dc.id === id);\n }\n\n onCalendarSubmit() {\n if (!this.isReadOnly) {\n if (!this.calendar.value) return;\n\n const calendarDate = newDate(this.calendar.value);\n\n this.value = calendarDate.getTime();\n\n this.getCounterById('year').replaceValue(calendarDate.getFullYear());\n this.getCounterById('month').replaceValue(calendarDate.getMonth() + 1);\n this.getCounterById('day').replaceValue(calendarDate.getDate());\n\n this.#dispatchInput();\n }\n\n this.closePopover();\n }\n\n updateCalendarView() {\n const validInputVal =\n isValidTimestamp(newDate(this.inputElement.value || '').getTime()) &&\n formats[this.format].validate(this.inputElement.value);\n\n if (this.displayValueEpoch || validInputVal) {\n this.calendar.setAttribute(\n 'initial-value',\n formatTimestamp(this.displayValueEpoch || this.timestamp, NATIVE_FORMAT)\n );\n } else {\n this.calendar.clearValue();\n this.calendar.setAttribute('preview', formatTimestamp(getCurrentTime(), NATIVE_FORMAT));\n }\n\n forwardAttrs(this, this.calendar, {\n includeAttrs: [\n 'st-host-direction',\n 'readonly',\n 'initial-month',\n 'initial-year',\n 'years-range',\n 'calendar-label-submit',\n 'calendar-label-cancel',\n 'calendar-months',\n 'calendar-weekdays',\n 'calendar-weekdays-short',\n ],\n });\n }\n\n onFocus() {\n if (this.isReadOnly) {\n return;\n }\n\n if (!this.inputElement.value) {\n this.inputElement.value = this.format;\n this.setInputSelectionRange();\n }\n }\n\n onBlur() {\n if (this.opened) {\n return;\n }\n\n if (this.inputElement.value === this.format) {\n this.inputElement.value = '';\n }\n }\n\n onFormatUpdate(format) {\n if (Object.keys(formats).includes(format)) {\n this.format = format;\n this.updateFormatPattern();\n }\n }\n\n updateFormatPattern() {\n const format = this.getAttribute('format') || this.format || DEFAULT_FORMAT;\n this.setAttribute('type', 'date');\n this.setAttribute('pattern', formats[format].pattern);\n }\n\n handleDigitKeys(e) {\n if (isNumber(e.key)) {\n e.preventDefault();\n\n this.activeCounter.add(e.key);\n\n if (this.activeCounter.isFull) {\n this.selectNextCounter();\n }\n\n this.setInputSelectionRange();\n }\n }\n\n getCounterIdx(caretPos) {\n const [counter1ln, counter2ln] = this.sortedCounters.map((dc) => dc.length);\n\n const c1 = caretPos <= counter1ln;\n const c2 = caretPos >= counter1ln && caretPos <= counter1ln + counter2ln + 1;\n const c3 = caretPos >= counter1ln + counter2ln + 2;\n\n return [c1, c2, c3].indexOf(true);\n }\n\n setSelectedCounterByCaretPosition(e) {\n this.selectedCounterIdx = this.getCounterIdx(e.target.selectionStart);\n }\n\n selectNextCounter() {\n if (this.selectedCounterIdx < this.dateCounters.length) {\n this.selectedCounterIdx = Math.min(this.selectedCounterIdx + 1, 2);\n }\n }\n\n selectPrevCounter() {\n if (this.selectedCounterIdx > 0) {\n this.selectedCounterIdx = Math.min(this.selectedCounterIdx - 1, 1);\n }\n }\n\n // Sets the text selection range in the input element based on the selected counter.\n // The function calculates the starting position of the selection by summing the lengths\n // of all counters before the currently selected counter (`selectedCounterIdx`).\n // It then selects the entire length of the current counter in the input element.\n setInputSelectionRange() {\n // For preview/readonly state we don't have a caret or a caretIdx, so we skip setting input selection range\n if (this.selectedCounterIdx < 0) {\n return;\n }\n\n const caretStart = this.sortedCounters\n .slice(0, this.selectedCounterIdx)\n .reduce((acc, counter) => acc + counter.length, this.selectedCounterIdx);\n\n this.inputElement.setSelectionRange(\n caretStart,\n caretStart + this.sortedCounters[this.selectedCounterIdx].length\n );\n }\n\n resetDateCounters() {\n this.dateCounters.forEach((dc) => dc.clear());\n }\n\n // in case value is set from external source we need to update date counters\n updateDateCounters(date) {\n this.dateCounters.forEach((dc) => {\n switch (dc.id) {\n case counterConfig.MONTH.id:\n dc.set(date.getMonth() + 1);\n break;\n case counterConfig.YEAR.id:\n dc.set(date.getFullYear());\n break;\n case counterConfig.DAY.id:\n dc.set(date.getDate());\n break;\n default:\n break;\n }\n });\n }\n\n handleNavKeys(e) {\n if (this.isReadOnly) {\n return;\n }\n\n const { key, shiftKey, metaKey } = e;\n const keys = getKeyMap(key, shiftKey, metaKey);\n\n if (this.opened) {\n this.closePopover();\n }\n\n e.preventDefault();\n\n if (isSupportedKey(key)) {\n const counter = this.activeCounter;\n\n if (!counter) return;\n\n const counterData = Object.values(counterConfig).find((config) => config.id === counter.id);\n const { count, shiftCount } = counterData;\n\n if (keys.backspace) this.handleBackspace();\n else if (keys.arrowUp) counter.inc();\n else if (keys.arrowDown) counter.dec();\n else if (keys.shiftArrowUp) counter.inc(count);\n else if (keys.shiftArrowDown) counter.dec(count);\n else if (keys.pageUp) counter.inc(count);\n else if (keys.pageDown) counter.dec(count);\n else if (keys.shiftPageUp) counter.inc(shiftCount);\n else if (keys.shiftPageDown) counter.dec(shiftCount);\n else if (keys.arrowRight) this.selectNextCounter();\n else if (keys.arrowLeft) this.selectPrevCounter();\n\n this.setInputSelectionRange();\n }\n }\n\n handleBackspace() {\n const counter = this.activeCounter;\n\n if (counter.isEmpty) {\n this.selectPrevCounter();\n this.setInputSelectionRange();\n } else {\n counter.del();\n }\n }\n\n handleMouseCaretPositionChange(e) {\n if (this.opened) {\n return;\n }\n e.preventDefault();\n this.setSelectedCounterByCaretPosition(e);\n this.setInputSelectionRange();\n }\n\n onInitialValueChange(val) {\n // if component already has a value don't re-set value\n if (this.value) return;\n\n // we need to wait for the text-field to init\n setTimeout(() => {\n this.value = val;\n });\n }\n\n setYearRange(val) {\n if (!val) return;\n const [min, max] = val.split?.('-');\n if (min && max) {\n this.#yearDateCounter.setMin(min);\n this.#yearDateCounter.setMax(max);\n }\n }\n\n togglePopoverAccess(visibility) {\n if (visibility) {\n this.popoverToggleButton.classList.remove('hidden');\n } else {\n this.popoverToggleButton.classList.add('hidden');\n }\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue !== newValue) {\n if (attrName === 'years-range') {\n this.setYearRange(newValue);\n }\n if (attrName === 'disable-calendar') {\n this.togglePopoverAccess(newValue !== 'true');\n }\n if (dateFieldAttrs.includes(attrName)) {\n if (newValue && attrName === 'format') {\n this.onFormatUpdate(newValue);\n }\n if (attrName === 'initial-value') {\n this.onInitialValueChange(newValue);\n }\n } else if (calendarAttrs.includes(attrName)) {\n if (newValue) {\n this.calendar?.setAttribute(attrName, newValue);\n } else {\n this.calendar?.removeAttribute(attrName);\n }\n }\n }\n }\n\n getValidity() {\n if (this.isRequired && this.isCountersEmpty) {\n return { valueMissing: true };\n }\n\n if (this.isCountersOutOfRange) {\n return { patternMismatch: true };\n }\n\n return {};\n }\n}\n\nconst textVars = TextFieldClass.cssVarList;\nconst { host, input, inputEleRTL, toggleButton, overlay, backdrop, errorMessage } = {\n host: { selector: () => ':host' },\n input: { selector: () => 'descope-text-field' },\n inputEleRTL: { selector: () => ':host([st-host-direction=\"rtl\"]) descope-text-field' },\n toggleButton: { selector: () => '.toggle-calendar' },\n overlay: { selector: 'vaadin-popover-overlay::part(overlay)' },\n backdrop: { selector: 'vaadin-popover-overlay::part(backdrop)' },\n};\n\nexport const DateFieldClass = compose(\n createStyleMixin({ componentNameOverride: getComponentName('input-wrapper') }),\n createStyleMixin({\n mappings: {\n iconMargin: { ...toggleButton, property: 'margin-inline-end' },\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n textAlign: { ...input, property: 'text-align' },\n rtlInputDirection: { ...inputEleRTL, property: textVars.inputDirection },\n rtlInputAlignment: { ...inputEleRTL, property: textVars.inputTextAlign },\n overlayGap: {\n property: () => DateFieldClass.cssVarList.overlayGap,\n },\n overlayBackgroundColor: {\n property: () => DateFieldClass.cssVarList.overlayBackgroundColor,\n },\n overlayPadding: {\n property: () => DateFieldClass.cssVarList.overlayPadding,\n },\n overlayBoxShadow: { property: () => DateFieldClass.overlayBoxShadow },\n overlayOutlineWidth: {\n property: () => DateFieldClass.cssVarList.overlayOutlineWidth,\n },\n overlayOutlineColor: {\n property: () => DateFieldClass.cssVarList.overlayOutlineColor,\n },\n overlayOutlineStyle: {\n property: () => DateFieldClass.cssVarList.overlayOutlineStyle,\n },\n errorMessageIcon: {\n selector: TextFieldClass.componentName,\n property: TextFieldClass.cssVarList.errorMessageIcon,\n },\n errorMessageIconSize: {\n selector: TextFieldClass.componentName,\n property: TextFieldClass.cssVarList.errorMessageIconSize,\n },\n errorMessageIconPadding: {\n selector: TextFieldClass.componentName,\n property: TextFieldClass.cssVarList.errorMessageIconPadding,\n },\n errorMessageIconRepeat: {\n selector: TextFieldClass.componentName,\n property: TextFieldClass.cssVarList.errorMessageIconRepeat,\n },\n errorMessageIconPosition: {\n selector: TextFieldClass.componentName,\n property: TextFieldClass.cssVarList.errorMessageIconPosition,\n },\n errorMessageFontSize: {\n selector: TextFieldClass.componentName,\n property: TextFieldClass.cssVarList.errorMessageFontSize,\n },\n },\n }),\n portalMixin({\n name: 'overlay',\n selector: '',\n mappings: {\n marginTop: { ...overlay, property: 'margin-top' },\n backgroundColor: { ...overlay },\n backdropBackgroundColor: { ...backdrop, property: 'background-color' },\n backdropPointerEvents: { ...backdrop, property: 'pointer-events' },\n padding: { ...overlay },\n boxShadow: { ...overlay },\n outlineWidth: { ...overlay },\n outlineColor: { ...overlay },\n outlineStyle: { ...overlay },\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(RawDateFieldClass);\n","import '@vaadin/popover/src/vaadin-popover';\nimport './descope-calendar';\nimport '../descope-text-field';\n\nimport { componentName, DateFieldClass } from './DateFieldClass';\n\ncustomElements.define(componentName, DateFieldClass);\n\nexport { DateFieldClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n createProxy,\n proxyInputMixin,\n componentNameValidationMixin,\n} from '../../mixins';\nimport textFieldMappings from './textFieldMappings';\nimport { compose } from '../../helpers';\nimport { getComponentName } from '../../helpers/componentHelpers';\nimport {\n inputFloatingLabelStyle,\n resetInputLabelPosition,\n resetInputOverrides,\n useHostExternalPadding,\n} from '../../helpers/themeHelpers/resetHelpers';\n\nexport const componentName = getComponentName('text-field');\n\nconst observedAttrs = ['type', 'label-type', 'copy-to-clipboard'];\n\nconst customMixin = (superclass) =>\n class TextFieldClass extends superclass {\n static get observedAttributes() {\n return observedAttrs.concat(superclass.observedAttributes || []);\n }\n\n icon;\n\n init() {\n super.init?.();\n }\n\n renderCopyToClipboard(shouldRender) {\n if (!shouldRender) {\n this.icon?.remove();\n return;\n }\n\n const iconInitConfig = {\n icon: 'vaadin:copy-o',\n title: 'Copy',\n style: 'cursor: pointer',\n };\n\n const iconCopiedConfig = {\n icon: 'vaadin:check-circle-o',\n title: 'Copied',\n style: 'cursor: initial',\n };\n\n this.icon = Object.assign(document.createElement('vaadin-icon'), {\n slot: 'suffix',\n ...iconInitConfig,\n });\n\n this.baseElement.appendChild(this.icon);\n this.icon.addEventListener('click', () => {\n navigator.clipboard.writeText(this.value);\n Object.assign(this.icon, iconCopiedConfig);\n\n // we want the icon to go back to the initial state after 5 seconds\n setTimeout(() => {\n Object.assign(this.icon, iconInitConfig);\n }, 5000);\n });\n }\n\n onLabelClick() {\n this.focus();\n }\n\n attributeChangedCallback(attrName, oldVal, newVal) {\n super.attributeChangeCallback?.(attrName, oldVal, newVal);\n\n // Vaadin doesn't allow to change the input type attribute.\n // We need the ability to do that, so we're overriding their\n // behavior with their private API.\n // When receiving a `type` attribute, we use their private API\n // to set it on the input.\n if (attrName === 'type') {\n this.baseElement._setType(newVal);\n }\n\n if (oldVal !== newVal) {\n if (attrName === 'label-type') {\n if (newVal === 'floating') {\n this.addEventListener('click', this.onLabelClick);\n } else {\n this.removeEventListener('click', this.onLabelClick);\n }\n } else if (attrName === 'copy-to-clipboard') {\n this.renderCopyToClipboard(newVal === 'true');\n }\n }\n }\n };\n\nexport const TextFieldClass = compose(\n createStyleMixin({\n mappings: textFieldMappings,\n }),\n draggableMixin,\n proxyInputMixin({ proxyProps: ['value', 'selectionStart'], useProxyTargets: true }),\n componentNameValidationMixin,\n customMixin\n)(\n createProxy({\n slots: ['prefix', 'suffix'],\n wrappedEleName: 'vaadin-text-field',\n style: () => `\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tpadding: calc(var(${TextFieldClass.cssVarList.inputOutlineWidth}) + var(${\n TextFieldClass.cssVarList.inputOutlineOffset\n }));\n box-sizing: border-box;\n\t\t\t}\n :host(:is([readonly], [disabled])) ::slotted(:is(input, textarea):placeholder-shown) {\n opacity: 1;\n }\n\n vaadin-text-field[label-type=\"floating\"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n vaadin-text-field[label-type=\"floating\"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n ${resetInputLabelPosition('vaadin-text-field')}\n\t\t\t${useHostExternalPadding(TextFieldClass.cssVarList)}\n\t\t\t${resetInputOverrides('vaadin-text-field', TextFieldClass.cssVarList)}\n ${inputFloatingLabelStyle()}\n\n vaadin-text-field vaadin-icon {\n align-self: center;\n }\n\t\t`,\n excludeAttrsSync: ['tabindex', 'style'],\n componentName,\n })\n);\n"],"names":["host","label","placeholder","requiredIndicator","inputField","input","inputMask","helperText","errorMessage","disabledPlaceholder","inputDisabled","inputIcon","externalInput","externalInputDisabled","externalPlaceholder","externalDisabledPlaceholder","selector","fontSize","fontFamily","labelFontSize","property","labelFontWeight","labelTextColor","hostWidth","hostMinWidth","hostDirection","inputDirection","inputBackgroundColor","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","helperTextColor","inputValueTextColor","inputCaretTextColor","labelRequiredIndicator","inputBorderColor","inputBorderWidth","inputBorderStyle","inputBorderRadius","inputHeight","inputHorizontalPadding","inputOutlineColor","inputOutlineStyle","inputOutlineWidth","inputOutlineOffset","textAlign","inputTextAlign","inputPlaceholderColor","labelPosition","labelTopPosition","labelHorizontalPosition","inputTransformY","inputTransition","marginInlineStart","placeholderOpacity","inputVerticalAlignment","valueInputHeight","valueInputMarginBottom","inputIconOffset","inputIconSize","inputIconColor","customElements","define","patterns","MM","DD","YYYY","createFormat","format","pattern","split","map","part","join","createPattern","toValuesFn","order","match","values","forEach","index","createToValuesFn","regexp","RegExp","validate","val","test","getDate","exec","year","month","day","createDate","formats","Object","fromEntries","f","DateCounter","freeze","constructor","id","min","max","onChange","this","data","length","numberValue","Number","stringValue","padStart","isFull","isEmpty","toString","set","add","num","slice","del","filter","d","Boolean","clear","inc","gap","replaceValue","Math","dec","isInRange","setMin","setMax","componentName","BaseInputClass","createBaseInputClass","baseSelector","dateFieldAttrs","calendarAttrs","observedAttrs","textVars","TextFieldClass","cssVarList","inputEleRTL","toggleButton","overlay","backdrop","DateFieldClass","componentNameOverride","mappings","iconMargin","rtlInputDirection","rtlInputAlignment","overlayGap","overlayBackgroundColor","overlayPadding","overlayBoxShadow","overlayOutlineWidth","overlayOutlineColor","overlayOutlineStyle","name","marginTop","backgroundColor","backdropBackgroundColor","backdropPointerEvents","padding","boxShadow","outlineWidth","outlineColor","outlineStyle","timestamp","selectedCounterIdx","updateCountersDisplay","inputElement","value","countersValue","updateValue","isCountersOutOfRange","updateTimestamp","date","getTime","onDateCounterChange","epochOrDate","YEAR","bind","dateCounters","MONTH","DAY","observedAttributes","concat","super","attachShadow","mode","innerHTML","shadowRoot","querySelector","popoverToggleButton","validationTarget","opened","getAttribute","displayValueEpoch","sortedCounters","find","dc","activeCounter","baseElement","calendar","isRTL","computedStyleDirection","getComputedStyle","getPropertyValue","updateDateCounters","isCountersEmpty","every","some","disableCalendar","reportValidity","dispatchEvent","Event","bubbles","updateInputDisplay","init","updateFormatPattern","initPopover","initInputElement","setTimeout","getValidity","checkValidity","addEventListener","onPopoverToggle","onFocus","onBlur","handleMouseCaretPositionChange","handleNavKeys","handleDigitKeys","includeAttrs","trigger","withBackdrop","renderer","e","preventDefault","stopPropagation","root","firstChild","positionTarget","appendChild","closePopover","style","setProperty","updateCalendarView","popover","remove","windowRect","document","body","getBoundingClientRect","inputRect","calendarRect","side","offset","availableLeft","left","availableRight","width","right","newOffset","abs","ele","createElement","onCalendarSubmit","_attachOverlay","bringToFront","_detachOverlay","_enterModalState","openPopover","setAttribute","removeAttribute","focus","getCounterById","isReadOnly","calendarDate","getFullYear","getMonth","validInputVal","clearValue","setInputSelectionRange","onFormatUpdate","keys","includes","key","selectNextCounter","getCounterIdx","caretPos","counter1ln","counter2ln","indexOf","setSelectedCounterByCaretPosition","target","selectionStart","selectPrevCounter","caretStart","reduce","acc","counter","setSelectionRange","resetDateCounters","shiftKey","metaKey","counterData","config","count","shiftCount","backspace","handleBackspace","arrowUp","arrowDown","shiftArrowUp","shiftArrowDown","pageUp","pageDown","shiftPageUp","shiftPageDown","arrowRight","arrowLeft","onInitialValueChange","setYearRange","togglePopoverAccess","visibility","classList","attributeChangedCallback","attrName","oldValue","newValue","isRequired","valueMissing","patternMismatch","proxyProps","useProxyTargets","superclass","icon","renderCopyToClipboard","shouldRender","iconInitConfig","title","iconCopiedConfig","assign","slot","navigator","clipboard","writeText","onLabelClick","oldVal","newVal","attributeChangeCallback","_setType","removeEventListener","slots","wrappedEleName","excludeAttrsSync"],"sourceRoot":""}
|
package/package.json
CHANGED
@@ -31,7 +31,7 @@ export const componentName = getComponentName('date-field');
|
|
31
31
|
const BASE_SELECTOR = 'vaadin-popover';
|
32
32
|
const BaseInputClass = createBaseInputClass({ componentName, baseSelector: BASE_SELECTOR });
|
33
33
|
|
34
|
-
const dateFieldAttrs = ['format', 'opened', 'initial-value', 'readonly'];
|
34
|
+
const dateFieldAttrs = ['format', 'opened', 'initial-value', 'readonly', 'disable-calendar'];
|
35
35
|
const calendarAttrs = ['years-range', 'calendar-months', 'calendar-weekdays'];
|
36
36
|
const observedAttrs = [...dateFieldAttrs, ...calendarAttrs];
|
37
37
|
|
@@ -121,6 +121,10 @@ class RawDateFieldClass extends BaseInputClass {
|
|
121
121
|
:host([readonly="true"]) .toggle-calendar {
|
122
122
|
pointer-events: none;
|
123
123
|
}
|
124
|
+
|
125
|
+
.hidden {
|
126
|
+
display: none;
|
127
|
+
}
|
124
128
|
`,
|
125
129
|
this
|
126
130
|
);
|
@@ -206,6 +210,10 @@ class RawDateFieldClass extends BaseInputClass {
|
|
206
210
|
return this.dateCounters.some((dc) => !dc.isInRange(dc.numberValue));
|
207
211
|
}
|
208
212
|
|
213
|
+
get disableCalendar() {
|
214
|
+
return this.getAttribute('disable-calendar') === 'true';
|
215
|
+
}
|
216
|
+
|
209
217
|
reportValidity() {
|
210
218
|
this.inputElement.reportValidity();
|
211
219
|
}
|
@@ -366,6 +374,7 @@ class RawDateFieldClass extends BaseInputClass {
|
|
366
374
|
}
|
367
375
|
|
368
376
|
openPopover() {
|
377
|
+
if (this.disableCalendar) return;
|
369
378
|
this.setAttribute('opened', 'true');
|
370
379
|
}
|
371
380
|
|
@@ -621,6 +630,14 @@ class RawDateFieldClass extends BaseInputClass {
|
|
621
630
|
}
|
622
631
|
}
|
623
632
|
|
633
|
+
togglePopoverAccess(visibility) {
|
634
|
+
if (visibility) {
|
635
|
+
this.popoverToggleButton.classList.remove('hidden');
|
636
|
+
} else {
|
637
|
+
this.popoverToggleButton.classList.add('hidden');
|
638
|
+
}
|
639
|
+
}
|
640
|
+
|
624
641
|
attributeChangedCallback(attrName, oldValue, newValue) {
|
625
642
|
super.attributeChangedCallback?.(attrName, oldValue, newValue);
|
626
643
|
|
@@ -628,6 +645,9 @@ class RawDateFieldClass extends BaseInputClass {
|
|
628
645
|
if (attrName === 'years-range') {
|
629
646
|
this.setYearRange(newValue);
|
630
647
|
}
|
648
|
+
if (attrName === 'disable-calendar') {
|
649
|
+
this.togglePopoverAccess(newValue !== 'true');
|
650
|
+
}
|
631
651
|
if (dateFieldAttrs.includes(attrName)) {
|
632
652
|
if (newValue && attrName === 'format') {
|
633
653
|
this.onFormatUpdate(newValue);
|