@descope/web-components-ui 2.3.2 → 3.0.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.
Files changed (148) hide show
  1. package/dist/cjs/index.cjs.js +16884 -16946
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +5291 -5373
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/umd/5414.js +1 -1
  6. package/dist/umd/5414.js.LICENSE.txt +1 -1
  7. package/dist/umd/5414.js.map +1 -1
  8. package/dist/umd/9365.js +1 -1
  9. package/dist/umd/9365.js.map +1 -1
  10. package/dist/umd/DescopeDev.js +1 -1
  11. package/dist/umd/DescopeDev.js.map +1 -1
  12. package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-index-js.js.map +1 -1
  13. package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-internal-index-js.js.map +1 -1
  14. package/dist/umd/button-selection-group-fields-descope-button-selection-group-index-js.js.map +1 -1
  15. package/dist/umd/button-selection-group-fields-descope-button-selection-group-internal-index-js.js.map +1 -1
  16. package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js +1 -1
  17. package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js.map +1 -1
  18. package/dist/umd/descope-alert-index-js.js +1 -1
  19. package/dist/umd/descope-alert-index-js.js.map +1 -1
  20. package/dist/umd/descope-code-snippet-index-js.js +1 -1
  21. package/dist/umd/descope-code-snippet-index-js.js.map +1 -1
  22. package/dist/umd/descope-container-index-js.js +1 -1
  23. package/dist/umd/descope-container-index-js.js.map +1 -1
  24. package/dist/umd/descope-date-field-descope-calendar-index-js.js +1 -1
  25. package/dist/umd/descope-date-field-descope-calendar-index-js.js.map +1 -1
  26. package/dist/umd/descope-date-field-index-js.js +1 -1
  27. package/dist/umd/descope-date-field-index-js.js.map +1 -1
  28. package/dist/umd/descope-divider-index-js.js +1 -1
  29. package/dist/umd/descope-divider-index-js.js.map +1 -1
  30. package/dist/umd/descope-grid-descope-grid-custom-column-index-js.js.map +1 -1
  31. package/dist/umd/descope-grid-descope-grid-item-details-column-index-js.js.map +1 -1
  32. package/dist/umd/descope-grid-descope-grid-selection-column-index-js.js.map +1 -1
  33. package/dist/umd/descope-grid-descope-grid-text-column-index-js.js.map +1 -1
  34. package/dist/umd/descope-grid-index-js.js +1 -1
  35. package/dist/umd/descope-grid-index-js.js.map +1 -1
  36. package/dist/umd/descope-hybrid-field-index-js.js +1 -1
  37. package/dist/umd/descope-hybrid-field-index-js.js.map +1 -1
  38. package/dist/umd/descope-loader-linear-index-js.js +1 -1
  39. package/dist/umd/descope-loader-linear-index-js.js.map +1 -1
  40. package/dist/umd/descope-loader-radial-index-js.js +1 -1
  41. package/dist/umd/descope-loader-radial-index-js.js.map +1 -1
  42. package/dist/umd/descope-multi-select-combo-box-index-js.js.map +1 -1
  43. package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js +1 -1
  44. package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js.map +1 -1
  45. package/dist/umd/descope-new-password-index-js.js +1 -1
  46. package/dist/umd/descope-new-password-index-js.js.map +1 -1
  47. package/dist/umd/descope-notification-index-js.js.map +1 -1
  48. package/dist/umd/descope-passcode-descope-passcode-internal-index-js.js +1 -1
  49. package/dist/umd/descope-passcode-descope-passcode-internal-index-js.js.map +1 -1
  50. package/dist/umd/descope-passcode-index-js.js +1 -1
  51. package/dist/umd/descope-passcode-index-js.js.map +1 -1
  52. package/dist/umd/descope-policy-validation-index-js.js +1 -1
  53. package/dist/umd/descope-policy-validation-index-js.js.map +1 -1
  54. package/dist/umd/descope-radio-group-index-js.js.map +1 -1
  55. package/dist/umd/descope-recaptcha-index-js.js +1 -1
  56. package/dist/umd/descope-recaptcha-index-js.js.map +1 -1
  57. package/dist/umd/descope-scopes-list-index-js.js.map +1 -1
  58. package/dist/umd/descope-security-questions-setup-index-js.js +1 -1
  59. package/dist/umd/descope-security-questions-setup-index-js.js.map +1 -1
  60. package/dist/umd/descope-security-questions-verify-index-js.js +1 -1
  61. package/dist/umd/descope-security-questions-verify-index-js.js.map +1 -1
  62. package/dist/umd/descope-third-party-app-logo-index-js.js +1 -1
  63. package/dist/umd/descope-third-party-app-logo-index-js.js.map +1 -1
  64. package/dist/umd/descope-upload-file-index-js.js +1 -1
  65. package/dist/umd/descope-upload-file-index-js.js.map +1 -1
  66. package/dist/umd/descope-user-attribute-index-js.js +1 -1
  67. package/dist/umd/descope-user-attribute-index-js.js.map +1 -1
  68. package/dist/umd/descope-user-auth-method-index-js.js +1 -1
  69. package/dist/umd/descope-user-auth-method-index-js.js.map +1 -1
  70. package/dist/umd/index.js.map +1 -1
  71. package/dist/umd/mapping-fields-descope-mappings-field-descope-mappings-field-internal-index-js.js.map +1 -1
  72. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -1
  73. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js.map +1 -1
  74. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js +1 -1
  75. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js.map +1 -1
  76. package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js +1 -1
  77. package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js.map +1 -1
  78. package/dist/umd/phone-fields-descope-phone-field-index-js.js +1 -1
  79. package/dist/umd/phone-fields-descope-phone-field-index-js.js.map +1 -1
  80. package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js +1 -1
  81. package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js.map +1 -1
  82. package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js +1 -1
  83. package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js.map +1 -1
  84. package/package.json +32 -32
  85. package/src/baseClasses/createBaseClass.js +1 -1
  86. package/src/components/button-selection-group-fields/baseButtonSelectionGroup.js +0 -2
  87. package/src/components/button-selection-group-fields/createBaseButtonSelectionGroupInternalClass.js +1 -3
  88. package/src/components/button-selection-group-fields/descope-button-multi-selection-group-internal/ButtonMultiSelectionGroupInternalClass.js +0 -1
  89. package/src/components/button-selection-group-fields/descope-button-selection-group-item/ButtonSelectionGroupItemClass.js +2 -2
  90. package/src/components/descope-alert/AlertClass.js +2 -2
  91. package/src/components/descope-code-snippet/CodeSnippetClass.js +1 -1
  92. package/src/components/descope-code-snippet/helpers.js +1 -3
  93. package/src/components/descope-container/ContainerClass.js +1 -1
  94. package/src/components/descope-date-field/DateCounterClass.js +1 -1
  95. package/src/components/descope-date-field/DateFieldClass.js +4 -5
  96. package/src/components/descope-date-field/descope-calendar/CalendarClass.js +2 -2
  97. package/src/components/descope-date-field/descope-calendar/helpers.js +1 -3
  98. package/src/components/descope-divider/DividerClass.js +2 -2
  99. package/src/components/descope-grid/GridClass.js +15 -19
  100. package/src/components/descope-grid/descope-grid-custom-column/GridCustomColumnClass.js +0 -1
  101. package/src/components/descope-grid/descope-grid-custom-column/index.js +0 -1
  102. package/src/components/descope-grid/descope-grid-item-details-column/GridItemDetailsColumnClass.js +0 -2
  103. package/src/components/descope-grid/descope-grid-selection-column/GridSelectionColumnClass.js +0 -3
  104. package/src/components/descope-grid/descope-grid-text-column/GridTextColumnClass.js +0 -1
  105. package/src/components/descope-grid/helpers.js +1 -3
  106. package/src/components/descope-hybrid-field/HybridFieldClass.js +1 -1
  107. package/src/components/descope-loader-linear/LoaderLinearClass.js +1 -1
  108. package/src/components/descope-loader-radial/LoaderRadialClass.js +1 -1
  109. package/src/components/descope-multi-select-combo-box/MultiSelectComboBoxClass.js +3 -9
  110. package/src/components/descope-new-password/descope-new-password-internal/NewPasswordInternal.js +3 -6
  111. package/src/components/descope-notification/NotificationClass.js +0 -2
  112. package/src/components/descope-passcode/PasscodeClass.js +1 -1
  113. package/src/components/descope-passcode/descope-passcode-internal/PasscodeInternal.js +1 -3
  114. package/src/components/descope-passcode/descope-passcode-internal/helpers.js +1 -3
  115. package/src/components/descope-policy-validation/PolicyValidationClass.js +1 -2
  116. package/src/components/descope-radio-group/RadioGroupClass.js +3 -8
  117. package/src/components/descope-recaptcha/RecaptchaClass.js +1 -1
  118. package/src/components/descope-scopes-list/ScopesListClass.js +0 -3
  119. package/src/components/descope-security-questions-setup/SecurityQuestionsSetupClass.js +5 -8
  120. package/src/components/descope-security-questions-verify/SecurityQuestionsVerifyClass.js +3 -4
  121. package/src/components/descope-third-party-app-logo/ThirdPartyAppLogoClass.js +1 -1
  122. package/src/components/descope-upload-file/UploadFileClass.js +2 -2
  123. package/src/components/descope-upload-file/helpers.js +3 -6
  124. package/src/components/descope-user-attribute/UserAttributeClass.js +4 -4
  125. package/src/components/descope-user-auth-method/UserAuthMethodClass.js +5 -5
  126. package/src/components/mapping-fields/descope-mappings-field/MappingsFieldClass.js +1 -1
  127. package/src/components/mapping-fields/descope-mappings-field/descope-mappings-field-internal/MappingsFieldInternal.js +0 -1
  128. package/src/components/phone-fields/descope-phone-field/PhoneFieldClass.js +1 -1
  129. package/src/components/phone-fields/descope-phone-field/descope-phone-field-internal/PhoneFieldInternal.js +1 -1
  130. package/src/components/phone-fields/descope-phone-input-box-field/PhoneFieldInputBoxClass.js +1 -1
  131. package/src/components/phone-fields/descope-phone-input-box-field/descope-phone-input-box-internal/PhoneFieldInternalInputBox.js +1 -1
  132. package/src/components/phone-fields/helpers.js +2 -3
  133. package/src/helpers/componentHelpers.js +0 -1
  134. package/src/helpers/themeHelpers/colorsHelpers.js +2 -3
  135. package/src/helpers/themeHelpers/index.js +4 -6
  136. package/src/helpers/themeHelpers/resetHelpers.js +1 -3
  137. package/src/index.umd.js +0 -1
  138. package/src/mixins/createDynamicDataMixin.js +0 -1
  139. package/src/mixins/createStyleMixin/helpers.js +1 -1
  140. package/src/mixins/createStyleMixin/index.js +1 -2
  141. package/src/mixins/externalInputHelpers.js +0 -2
  142. package/src/mixins/externalInputMixin.js +1 -1
  143. package/src/mixins/inputValidationMixin.js +0 -4
  144. package/src/mixins/normalizeBooleanAttributesMixin.js +1 -3
  145. package/src/mixins/portalMixin.js +0 -1
  146. package/src/mixins/proxyInputMixin.js +0 -1
  147. package/src/theme/components/alert.js +1 -1
  148. package/src/theme/components/index.js +22 -22
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[9257],{79981(e,t,i){i.r(t),i.d(t,{DateFieldClass:()=>V,componentName:()=>y}),i(20428),i(88350),i(21374);var r=i(3393),n=i(79365),o=i(97810),s=i(9696),a=i(49224),l=i(77421),p=i(80071),d=i(64101);class h{#e=Object.freeze([]);constructor({id:e,min:t,max:i,placeholder:r},n){this.id=e,this.min=t,this.max=i,this.placeholder=r,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],Number(t.join(""))>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 c=i(79275),u=i(25964),g=i(15177);const y=(0,o.xE)("date-field"),m=(0,r.y)({componentName:y,baseSelector:"vaadin-popover"}),b=["format","opened","initial-value","readonly","disable-calendar","utc-time"],v=["years-range","calendar-months","calendar-weekdays"],C=[...b,...v],x=c.w.cssVarList,{host:f,input:E,inputEleRTL:w,toggleButton:I,overlay:T,backdrop:S,errorMessage:k}={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)"}},V=(0,s.Zz)((0,n.RF)({componentNameOverride:(0,o.xE)("input-wrapper")}),(0,n.RF)({mappings:{iconMargin:{...I,property:"margin-inline-end"},hostWidth:{...f,property:"width"},hostDirection:{...f,property:"direction"},textAlign:{...E,property:"text-align"},rtlInputDirection:{...w,property:x.inputDirection},rtlInputAlignment:{...w,property:x.inputTextAlign},overlayGap:{property:()=>V.cssVarList.overlayGap},overlayBackgroundColor:{property:()=>V.cssVarList.overlayBackgroundColor},overlayPadding:{property:()=>V.cssVarList.overlayPadding},overlayBoxShadow:{property:()=>V.overlayBoxShadow},overlayOutlineWidth:{property:()=>V.cssVarList.overlayOutlineWidth},overlayOutlineColor:{property:()=>V.cssVarList.overlayOutlineColor},overlayOutlineStyle:{property:()=>V.cssVarList.overlayOutlineStyle},errorMessageIcon:{selector:c.w.componentName,property:c.w.cssVarList.errorMessageIcon},errorMessageIconSize:{selector:c.w.componentName,property:c.w.cssVarList.errorMessageIconSize},errorMessageIconPadding:{selector:c.w.componentName,property:c.w.cssVarList.errorMessageIconPadding},errorMessageIconRepeat:{selector:c.w.componentName,property:c.w.cssVarList.errorMessageIconRepeat},errorMessageIconPosition:{selector:c.w.componentName,property:c.w.cssVarList.errorMessageIconPosition},errorMessageFontSize:{selector:c.w.componentName,property:c.w.cssVarList.errorMessageFontSize}}}),(0,n.mA)({name:"overlay",selector:"",mappings:{marginTop:{...T,property:"margin-top"},backgroundColor:{...T},backdropBackgroundColor:{...S,property:"background-color"},backdropPointerEvents:{...S,property:"pointer-events"},padding:{...T},boxShadow:{...T},outlineWidth:{...T},outlineColor:{...T},outlineStyle:{...T}}}),n.VO,n.tQ)(class extends m{epoch="";format=d.ui;selectedCounterIdx=0;updateCountersDisplay(){this.inputElement.value=this.countersValue}updateValue(){if(this.isCountersOutOfRange)this.resetEpoch();else{const e=l.F[this.format].getDate(this.inputElement.value);this.updateEpoch((0,a.xq)(e,this.isUtcTime))}}onDateCounterChange=()=>{this.updateCountersDisplay(),this.updateValue(),this.#i()};updateEpoch(e){this.epoch=(0,a.xq)(e,this.isUtcTime)}dateCounters=[new h(d.rR.MONTH,this.onDateCounterChange.bind(this)),new h(d.rR.DAY,this.onDateCounterChange.bind(this)),new h(d.rR.YEAR,this.onDateCounterChange.bind(this))];static get observedAttributes(){return[].concat(m.observedAttributes||[],C)}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML=`\n <div>\n <descope-text-field inputmode="numeric">\n <span slot="suffix" class="toggle-calendar">\n ${p.ki}\n </span>\n </descope-text-field>\n <vaadin-popover></vaadin-popover>\n </div>\n `,(0,u.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=l.F[this.format].getDate(this.inputElement.value);return(0,a.mZ)(e?.getTime())?e.getTime():null}get sortedCounters(){return this.format.split(d.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(d.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.isInvalidDate()?"":this.epoch}set value(e){let t=parseInt(e,10);Number.isNaN(t)?(this.resetEpoch(),this.resetDateCounters(),this.clearInputEle()):(this.updateEpoch(t),this.updateDateCounters(new Date(t)))}resetEpoch(){this.epoch=""}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")}get isUtcTime(){return"true"===this.getAttribute("utc-time")}get isSelectAll(){const e=this.inputElement.baseElement.inputElement;return e.value.length===e.selectionStart+e.selectionEnd}reportValidity(){this.inputElement.reportValidity()}#i(){this.inputElement.baseElement.dispatchEvent(new Event("input",{bubbles:!0}))}updateInputDisplay(){this.inputElement.value=(0,a.jO)((0,g.N)(this.countersValue).getTime(),this.format)}init(){super.init?.(),this.updateFormatPattern(),this.initPopover(),this.onDateCounterChange(),this.initInputElement(),setTimeout(()=>{this.#r()},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.handleKeyboard.bind(this)),this.inputElement.addEventListener("beforeinput",this.handleInput.bind(this)),this.inputElement.addEventListener("pointerdown",this.onPointerDown.bind(this)),this.inputElement.addEventListener("paste",this.onPaste.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"]})}handleInput(e){e.preventDefault(),this.handleSelectAll(),e.data&&(0,a.Et)(e.data)?(this.parseDigits(e.data),this.updateCountersDisplay()):e.inputType&&this.handleNavKeys(e)}initPopover(){this.baseElement.trigger=["click"],this.baseElement.withBackdrop=!0,this.baseElement.renderer=this.#n.bind(this),this.baseElement.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation()})}handleSelectAll(){this.isSelectAll&&this.selectFirstCounter()}#o;#n(e){e.firstChild||(this.overlay.positionTarget=this.shadowRoot.querySelector(".toggle-calendar"),e.appendChild(this.#s()),(0,a.Xs)(this.baseElement),this.backdrop.addEventListener("click",this.closePopover.bind(this))),e.style.setProperty("visibility","hidden"),setTimeout(()=>{this.#a(e),e.style.setProperty("visibility","visible"),this.updateCalendarView(e)},100)}#a(){const e=this.shadowRoot.querySelector("vaadin-popover").shadowRoot;this.#o?.remove();const t=document.body.getBoundingClientRect(),i=this.getBoundingClientRect(),r=this.calendar.getBoundingClientRect(),n=this.isRTL?"right":"left",o=i[n]-r[n],s=r.left,a=t.width-r.right;let l;l=o>0?Math.min(o,a):-1*Math.min(Math.abs(o),s),(0,u.fz)(`\n vaadin-popover-overlay::part(overlay) {\n transform: translateX(${l}px);\n }\n `,e)}#s(){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}#r(){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,g.N)(this.calendar.value);this.value=(0,a.xq)(e,this.isUtcTime),this.getCounterById("year").replaceValue(e.getFullYear()),this.getCounterById("month").replaceValue(e.getMonth()+1),this.getCounterById("day").replaceValue(e.getDate()),this.#i()}this.closePopover()}updateCalendarView(){const e=(0,a.mZ)((0,g.N)(this.inputElement.value||"").getTime())&&l.F[this.format].validate(this.inputElement.value);this.displayValueEpoch||e?this.calendar.setAttribute("initial-value",(0,a.jO)(this.displayValueEpoch||this.epoch,d.wJ)):(this.calendar.clearValue(),this.calendar.setAttribute("preview",(0,a.jO)((0,a.Ln)(),d.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"]})}onPointerDown(e){setTimeout(()=>this.handleMouseCaretPositionChange(e),d.SZ)}onFocus(){this.isReadOnly||setTimeout(()=>this.resetDisplay())}resetDisplay(){this.inputElement.value||(this.inputElement.value=this.format),this.selectFirstCounter(),this.inputElement.setSelectionRange(0,this.sortedCounters[0].length)}onBlur(){this.opened||this.inputElement.value===this.format&&this.clearInputEle()}clearInputEle(){this.inputElement.value=""}onFormatUpdate(e){Object.keys(l.F).includes(e)&&(this.format=e,this.updateFormatPattern())}updateFormatPattern(){const e=this.getAttribute("format")||this.format||d.ui;this.setAttribute("type","date"),this.setAttribute("pattern",l.F[e].pattern)}parseDigits(e){this.activeCounter.add(e),this.activeCounter.isFull&&this.selectNextCounter(),this.setInputSelectionRange()}getCounterIdx(e){const[t,i]=this.sortedCounters.map(e=>e.length);return[e<=t,e>=t&&e<=t+i+1,e>=t+i+2].indexOf(!0)}setSelectedCounterByCaretPosition(e){this.selectedCounterIdx=this.getCounterIdx(e.target?.selectionStart||this.inputElement.selectionStart)}selectFirstCounter(){this.selectedCounterIdx=0}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(){this.selectedCounterIdx<0||setTimeout(()=>{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 d.rR.MONTH.id:t.set(this.isUtcTime?e.getUTCMonth()+1:e.getMonth()+1);break;case d.rR.YEAR.id:t.set(this.isUtcTime?e.getUTCFullYear():e.getFullYear());break;case d.rR.DAY.id:t.set(this.isUtcTime?e.getUTCDate():e.getDate())}})}handleKeyboard(e){e.metaKey||e.ctrlKey?"x"===e.key.toLowerCase()&&this.onCut(e):(this.handleSelectAll(),"ArrowUp"===e.key?this.activeCounter.inc():"ArrowDown"===e.key?this.activeCounter.dec():"ArrowRight"===e.key?this.selectNextCounter():"ArrowLeft"===e.key&&this.selectPrevCounter(),this.setInputSelectionRange())}handleNavKeys(e){this.isReadOnly||(this.opened&&this.closePopover(),this.activeCounter&&("deleteContentBackward"===e.inputType&&this.handleBackspace(),this.setInputSelectionRange()))}handleBackspace(){if(this.isSelectAll)return void this.resetToInitialState();const e=this.activeCounter;e.isEmpty?(this.selectPrevCounter(),this.setInputSelectionRange()):e.set(""),setTimeout(()=>{this.updateCountersDisplay(),this.setInputSelectionRange()})}handleMouseCaretPositionChange(e){this.opened||(e.preventDefault(),this.setSelectedCounterByCaretPosition(e),this.setInputSelectionRange())}onInitialValueChange(e){this.value||setTimeout(()=>{Number.isNaN(parseInt(e,10))||(this.value=Number(e))})}togglePopoverAccess(e){e?this.popoverToggleButton.classList.remove("hidden"):this.popoverToggleButton.classList.add("hidden")}attributeChangedCallback(e,t,i){super.attributeChangedCallback?.(e,t,i),t!==i&&("disable-calendar"===e&&this.togglePopoverAccess("true"!==i),b.includes(e)?(i&&"format"===e&&this.onFormatUpdate(i),"initial-value"===e&&this.onInitialValueChange(i)):v.includes(e)&&(i?this.calendar?.setAttribute(e,i):this.calendar?.removeAttribute(e)))}isInvalidDate(){const e=this.getCounterById("year"),t=e.numberValue>d.nr.year.max||e.numberValue<d.nr.year.min,i=Object.entries(this.getDateVals()).some(([e,t])=>{const i=this.getCounterById(e);return!t||i.numberValue!==t});return t||i}getValidity(){return this.isRequired&&this.isCountersEmpty?{valueMissing:!0}:this.isCountersOutOfRange||this.isInvalidDate()?{patternMismatch:!0}:{}}getDateVals(){const e={day:"",month:"",year:""};if(Number.isNaN(this.epoch))return e;try{const t=new Date(this.epoch);this.isUtcTime?(e.month=t.getUTCMonth()+1,e.day=t.getUTCDate(),e.year=t.getUTCFullYear()):(e.month=t.getMonth()+1,e.day=t.getDate(),e.year=t.getFullYear())}catch(e){}return e}resetToInitialState(){this.resetDateCounters(),this.selectFirstCounter(),this.resetDisplay()}onCut(e){e.preventDefault(),this.isSelectAll?(this.#l(this.countersValue),this.resetToInitialState()):(this.#l(this.activeCounter.stringValue),this.activeCounter.set("")),this.setInputSelectionRange()}#l(e){try{navigator.clipboard.writeText(e)}catch(e){console.error("Failed to copy date value:",e)}}onPaste(e){e.preventDefault();const t=(e.clipboardData||window.clipboardData).getData("Text"),i=(0,a.Rm)(t,this.format);if(i)this.value=(0,a.xq)(i,this.isUtcTime),this.onDateCounterChange(),setTimeout(()=>this.inputElement.setSelectionRange(0,this.inputElement.value.length));else{const e=Number(t);e&&this.activeCounter.min<=e&&this.activeCounter.max>=e&&(this.activeCounter.set(String(e)),setTimeout(()=>this.setInputSelectionRange()))}}});customElements.define(y,V)},79275(e,t,i){i.d(t,{T:()=>l,w:()=>d});var r=i(79365),n=i(6424),o=i(9696),s=i(97810),a=i(73551);const l=(0,s.xE)("text-field"),p=["type","label-type","copy-to-clipboard"],d=(0,o.Zz)((0,r.RF)({mappings:n.A}),r.VO,(0,r.OZ)({proxyProps:["value","selectionStart"],useProxyTargets:!0}),r.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"},i={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,i),setTimeout(()=>{Object.assign(this.icon,t)},5e3)})}onLabelClick(){this.focus()}attributeChangedCallback(e,t,i){super.attributeChangeCallback?.(e,t,i),"type"===e&&this.baseElement._setType(i),t!==i&&("label-type"===e?"floating"===i?this.addEventListener("click",this.onLabelClick):this.removeEventListener("click",this.onLabelClick):"copy-to-clipboard"===e&&this.renderCopyToClipboard("true"===i))}})((0,r.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}))},21374(e,t,i){i.r(t),i.d(t,{TextFieldClass:()=>r.w,componentName:()=>r.T}),i(11284),i(37182),i(95260);var r=i(79275);customElements.define(r.T,r.w)},6424(e,t,i){i.d(t,{A:()=>C});const{host:r,label:n,placeholder:o,requiredIndicator:s,inputField:a,input:l,inputMask:p,helperText:d,errorMessage:h,disabledPlaceholder:c,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:[{},r],fontFamily:[n,a,d,h],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:{...r,property:"width"},hostMinWidth:{...r,property:"min-width"},hostDirection:{...r,property:"direction"},inputDirection:{...l,property:"direction"},inputBackgroundColor:[{...a,property:"background-color"},{...p,property:"background-color"}],errorMessageTextColor:{...h,property:"color"},errorMessageIcon:{...h,property:"background-image"},errorMessageIconSize:{...h,property:"background-size"},errorMessageIconPadding:{...h,property:"padding-inline-start"},errorMessageIconRepeat:{...h,property:"background-repeat"},errorMessageIconPosition:{...h,property:"background-position"},errorMessageFontSize:{...h,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"},{...c,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"},inputTextSecurity:[{...l,property:"-webkit-text-security"},{...l,property:"text-security"},{...y,property:"-webkit-text-security"},{...y,property:"text-security"}]}}}]);
1
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[9257],{79981(e,t,i){i.r(t),i.d(t,{DateFieldClass:()=>V,componentName:()=>y}),i(20428),i(88350),i(21374);var r=i(25964),n=i(3393),o=i(79365),s=i(97810),a=i(9696),l=i(49224),p=i(77421),d=i(80071),h=i(64101);class c{#e=Object.freeze([]);constructor({id:e,min:t,max:i,placeholder:r},n){this.id=e,this.min=t,this.max=i,this.placeholder=r,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{data:t}=this;return t=[...t,e],Number(t.join(""))>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 u=i(79275),g=i(15177);const y=(0,s.xE)("date-field"),m=(0,n.y)({componentName:y,baseSelector:"vaadin-popover"}),b=["format","opened","initial-value","readonly","disable-calendar","utc-time"],v=["years-range","calendar-months","calendar-weekdays"],C=[...b,...v],x=u.w.cssVarList,{host:f,input:E,inputEleRTL:w,toggleButton:I,overlay:T,backdrop:S,errorMessage:k}={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)"}},V=(0,a.Zz)((0,o.RF)({componentNameOverride:(0,s.xE)("input-wrapper")}),(0,o.RF)({mappings:{iconMargin:{...I,property:"margin-inline-end"},hostWidth:{...f,property:"width"},hostDirection:{...f,property:"direction"},textAlign:{...E,property:"text-align"},rtlInputDirection:{...w,property:x.inputDirection},rtlInputAlignment:{...w,property:x.inputTextAlign},overlayGap:{property:()=>V.cssVarList.overlayGap},overlayBackgroundColor:{property:()=>V.cssVarList.overlayBackgroundColor},overlayPadding:{property:()=>V.cssVarList.overlayPadding},overlayBoxShadow:{property:()=>V.overlayBoxShadow},overlayOutlineWidth:{property:()=>V.cssVarList.overlayOutlineWidth},overlayOutlineColor:{property:()=>V.cssVarList.overlayOutlineColor},overlayOutlineStyle:{property:()=>V.cssVarList.overlayOutlineStyle},errorMessageIcon:{selector:u.w.componentName,property:u.w.cssVarList.errorMessageIcon},errorMessageIconSize:{selector:u.w.componentName,property:u.w.cssVarList.errorMessageIconSize},errorMessageIconPadding:{selector:u.w.componentName,property:u.w.cssVarList.errorMessageIconPadding},errorMessageIconRepeat:{selector:u.w.componentName,property:u.w.cssVarList.errorMessageIconRepeat},errorMessageIconPosition:{selector:u.w.componentName,property:u.w.cssVarList.errorMessageIconPosition},errorMessageFontSize:{selector:u.w.componentName,property:u.w.cssVarList.errorMessageFontSize}}}),(0,o.mA)({name:"overlay",selector:"",mappings:{marginTop:{...T,property:"margin-top"},backgroundColor:{...T},backdropBackgroundColor:{...S,property:"background-color"},backdropPointerEvents:{...S,property:"pointer-events"},padding:{...T},boxShadow:{...T},outlineWidth:{...T},outlineColor:{...T},outlineStyle:{...T}}}),o.VO,o.tQ)(class extends m{epoch="";format=h.ui;selectedCounterIdx=0;updateCountersDisplay(){this.inputElement.value=this.countersValue}updateValue(){if(this.isCountersOutOfRange)this.resetEpoch();else{const e=p.F[this.format].getDate(this.inputElement.value);this.updateEpoch((0,l.xq)(e,this.isUtcTime))}}onDateCounterChange=()=>{this.updateCountersDisplay(),this.updateValue(),this.#i()};updateEpoch(e){this.epoch=(0,l.xq)(e,this.isUtcTime)}dateCounters=[new c(h.rR.MONTH,this.onDateCounterChange.bind(this)),new c(h.rR.DAY,this.onDateCounterChange.bind(this)),new c(h.rR.YEAR,this.onDateCounterChange.bind(this))];static get observedAttributes(){return[].concat(m.observedAttributes||[],C)}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML=`\n <div>\n <descope-text-field inputmode="numeric">\n <span slot="suffix" class="toggle-calendar">\n ${d.ki}\n </span>\n </descope-text-field>\n <vaadin-popover></vaadin-popover>\n </div>\n `,(0,r.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=p.F[this.format].getDate(this.inputElement.value);return(0,l.mZ)(e?.getTime())?e.getTime():null}get sortedCounters(){return this.format.split(h.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(h.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.isInvalidDate()?"":this.epoch}set value(e){const t=parseInt(e,10);Number.isNaN(t)?(this.resetEpoch(),this.resetDateCounters(),this.clearInputEle()):(this.updateEpoch(t),this.updateDateCounters(new Date(t)))}resetEpoch(){this.epoch=""}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")}get isUtcTime(){return"true"===this.getAttribute("utc-time")}get isSelectAll(){const e=this.inputElement.baseElement.inputElement;return e.value.length===e.selectionStart+e.selectionEnd}reportValidity(){this.inputElement.reportValidity()}#i(){this.inputElement.baseElement.dispatchEvent(new Event("input",{bubbles:!0}))}updateInputDisplay(){this.inputElement.value=(0,l.jO)((0,g.N)(this.countersValue).getTime(),this.format)}init(){super.init?.(),this.updateFormatPattern(),this.initPopover(),this.onDateCounterChange(),this.initInputElement(),setTimeout(()=>{this.#r()},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.handleKeyboard.bind(this)),this.inputElement.addEventListener("beforeinput",this.handleInput.bind(this)),this.inputElement.addEventListener("pointerdown",this.onPointerDown.bind(this)),this.inputElement.addEventListener("paste",this.onPaste.bind(this)),(0,s.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"]})}handleInput(e){e.preventDefault(),this.handleSelectAll(),e.data&&(0,l.Et)(e.data)?(this.parseDigits(e.data),this.updateCountersDisplay()):e.inputType&&this.handleNavKeys(e)}initPopover(){this.baseElement.trigger=["click"],this.baseElement.withBackdrop=!0,this.baseElement.renderer=this.#n.bind(this),this.baseElement.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation()})}handleSelectAll(){this.isSelectAll&&this.selectFirstCounter()}#o;#n(e){e.firstChild||(this.overlay.positionTarget=this.shadowRoot.querySelector(".toggle-calendar"),e.appendChild(this.#s()),(0,l.Xs)(this.baseElement),this.backdrop.addEventListener("click",this.closePopover.bind(this))),e.style.setProperty("visibility","hidden"),setTimeout(()=>{this.#a(e),e.style.setProperty("visibility","visible"),this.updateCalendarView(e)},100)}#a(){const e=this.shadowRoot.querySelector("vaadin-popover").shadowRoot;this.#o?.remove();const t=document.body.getBoundingClientRect(),i=this.getBoundingClientRect(),n=this.calendar.getBoundingClientRect(),o=this.isRTL?"right":"left",s=i[o]-n[o],a=n.left,l=t.width-n.right;let p;p=s>0?Math.min(s,l):-1*Math.min(Math.abs(s),a),(0,r.fz)(`\n vaadin-popover-overlay::part(overlay) {\n transform: translateX(${p}px);\n }\n `,e)}#s(){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}#r(){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,g.N)(this.calendar.value);this.value=(0,l.xq)(e,this.isUtcTime),this.getCounterById("year").replaceValue(e.getFullYear()),this.getCounterById("month").replaceValue(e.getMonth()+1),this.getCounterById("day").replaceValue(e.getDate()),this.#i()}this.closePopover()}updateCalendarView(){const e=(0,l.mZ)((0,g.N)(this.inputElement.value||"").getTime())&&p.F[this.format].validate(this.inputElement.value);this.displayValueEpoch||e?this.calendar.setAttribute("initial-value",(0,l.jO)(this.displayValueEpoch||this.epoch,h.wJ)):(this.calendar.clearValue(),this.calendar.setAttribute("preview",(0,l.jO)((0,l.Ln)(),h.wJ))),(0,s.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"]})}onPointerDown(e){setTimeout(()=>this.handleMouseCaretPositionChange(e),h.SZ)}onFocus(){this.isReadOnly||setTimeout(()=>this.resetDisplay())}resetDisplay(){this.inputElement.value||(this.inputElement.value=this.format),this.selectFirstCounter(),this.inputElement.setSelectionRange(0,this.sortedCounters[0].length)}onBlur(){this.opened||this.inputElement.value===this.format&&this.clearInputEle()}clearInputEle(){this.inputElement.value=""}onFormatUpdate(e){Object.keys(p.F).includes(e)&&(this.format=e,this.updateFormatPattern())}updateFormatPattern(){const e=this.getAttribute("format")||this.format||h.ui;this.setAttribute("type","date"),this.setAttribute("pattern",p.F[e].pattern)}parseDigits(e){this.activeCounter.add(e),this.activeCounter.isFull&&this.selectNextCounter(),this.setInputSelectionRange()}getCounterIdx(e){const[t,i]=this.sortedCounters.map(e=>e.length);return[e<=t,e>=t&&e<=t+i+1,e>=t+i+2].indexOf(!0)}setSelectedCounterByCaretPosition(e){this.selectedCounterIdx=this.getCounterIdx(e.target?.selectionStart||this.inputElement.selectionStart)}selectFirstCounter(){this.selectedCounterIdx=0}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(){this.selectedCounterIdx<0||setTimeout(()=>{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 h.rR.MONTH.id:t.set(this.isUtcTime?e.getUTCMonth()+1:e.getMonth()+1);break;case h.rR.YEAR.id:t.set(this.isUtcTime?e.getUTCFullYear():e.getFullYear());break;case h.rR.DAY.id:t.set(this.isUtcTime?e.getUTCDate():e.getDate())}})}handleKeyboard(e){e.metaKey||e.ctrlKey?"x"===e.key.toLowerCase()&&this.onCut(e):(this.handleSelectAll(),"ArrowUp"===e.key?this.activeCounter.inc():"ArrowDown"===e.key?this.activeCounter.dec():"ArrowRight"===e.key?this.selectNextCounter():"ArrowLeft"===e.key&&this.selectPrevCounter(),this.setInputSelectionRange())}handleNavKeys(e){this.isReadOnly||(this.opened&&this.closePopover(),this.activeCounter&&("deleteContentBackward"===e.inputType&&this.handleBackspace(),this.setInputSelectionRange()))}handleBackspace(){if(this.isSelectAll)return void this.resetToInitialState();const e=this.activeCounter;e.isEmpty?(this.selectPrevCounter(),this.setInputSelectionRange()):e.set(""),setTimeout(()=>{this.updateCountersDisplay(),this.setInputSelectionRange()})}handleMouseCaretPositionChange(e){this.opened||(e.preventDefault(),this.setSelectedCounterByCaretPosition(e),this.setInputSelectionRange())}onInitialValueChange(e){this.value||setTimeout(()=>{Number.isNaN(parseInt(e,10))||(this.value=Number(e))})}togglePopoverAccess(e){e?this.popoverToggleButton.classList.remove("hidden"):this.popoverToggleButton.classList.add("hidden")}attributeChangedCallback(e,t,i){super.attributeChangedCallback?.(e,t,i),t!==i&&("disable-calendar"===e&&this.togglePopoverAccess("true"!==i),b.includes(e)?(i&&"format"===e&&this.onFormatUpdate(i),"initial-value"===e&&this.onInitialValueChange(i)):v.includes(e)&&(i?this.calendar?.setAttribute(e,i):this.calendar?.removeAttribute(e)))}isInvalidDate(){const e=this.getCounterById("year"),t=e.numberValue>h.nr.year.max||e.numberValue<h.nr.year.min,i=Object.entries(this.getDateVals()).some(([e,t])=>{const i=this.getCounterById(e);return!t||i.numberValue!==t});return t||i}getValidity(){return this.isRequired&&this.isCountersEmpty?{valueMissing:!0}:this.isCountersOutOfRange||this.isInvalidDate()?{patternMismatch:!0}:{}}getDateVals(){const e={day:"",month:"",year:""};if(Number.isNaN(this.epoch))return e;try{const t=new Date(this.epoch);this.isUtcTime?(e.month=t.getUTCMonth()+1,e.day=t.getUTCDate(),e.year=t.getUTCFullYear()):(e.month=t.getMonth()+1,e.day=t.getDate(),e.year=t.getFullYear())}catch(e){}return e}resetToInitialState(){this.resetDateCounters(),this.selectFirstCounter(),this.resetDisplay()}onCut(e){e.preventDefault(),this.isSelectAll?(this.#l(this.countersValue),this.resetToInitialState()):(this.#l(this.activeCounter.stringValue),this.activeCounter.set("")),this.setInputSelectionRange()}#l(e){try{navigator.clipboard.writeText(e)}catch(e){console.error("Failed to copy date value:",e)}}onPaste(e){e.preventDefault();const t=(e.clipboardData||window.clipboardData).getData("Text"),i=(0,l.Rm)(t,this.format);if(i)this.value=(0,l.xq)(i,this.isUtcTime),this.onDateCounterChange(),setTimeout(()=>this.inputElement.setSelectionRange(0,this.inputElement.value.length));else{const e=Number(t);e&&this.activeCounter.min<=e&&this.activeCounter.max>=e&&(this.activeCounter.set(String(e)),setTimeout(()=>this.setInputSelectionRange()))}}});customElements.define(y,V)},79275(e,t,i){i.d(t,{T:()=>l,w:()=>d});var r=i(79365),n=i(6424),o=i(9696),s=i(97810),a=i(73551);const l=(0,s.xE)("text-field"),p=["type","label-type","copy-to-clipboard"],d=(0,o.Zz)((0,r.RF)({mappings:n.A}),r.VO,(0,r.OZ)({proxyProps:["value","selectionStart"],useProxyTargets:!0}),r.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"},i={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,i),setTimeout(()=>{Object.assign(this.icon,t)},5e3)})}onLabelClick(){this.focus()}attributeChangedCallback(e,t,i){super.attributeChangeCallback?.(e,t,i),"type"===e&&this.baseElement._setType(i),t!==i&&("label-type"===e?"floating"===i?this.addEventListener("click",this.onLabelClick):this.removeEventListener("click",this.onLabelClick):"copy-to-clipboard"===e&&this.renderCopyToClipboard("true"===i))}})((0,r.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}))},21374(e,t,i){i.r(t),i.d(t,{TextFieldClass:()=>r.w,componentName:()=>r.T}),i(11284),i(37182),i(95260);var r=i(79275);customElements.define(r.T,r.w)},6424(e,t,i){i.d(t,{A:()=>C});const{host:r,label:n,placeholder:o,requiredIndicator:s,inputField:a,input:l,inputMask:p,helperText:d,errorMessage:h,disabledPlaceholder:c,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:[{},r],fontFamily:[n,a,d,h],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:{...r,property:"width"},hostMinWidth:{...r,property:"min-width"},hostDirection:{...r,property:"direction"},inputDirection:{...l,property:"direction"},inputBackgroundColor:[{...a,property:"background-color"},{...p,property:"background-color"}],errorMessageTextColor:{...h,property:"color"},errorMessageIcon:{...h,property:"background-image"},errorMessageIconSize:{...h,property:"background-size"},errorMessageIconPadding:{...h,property:"padding-inline-start"},errorMessageIconRepeat:{...h,property:"background-repeat"},errorMessageIconPosition:{...h,property:"background-position"},errorMessageFontSize:{...h,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"},{...c,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"},inputTextSecurity:[{...l,property:"-webkit-text-security"},{...l,property:"text-security"},{...y,property:"-webkit-text-security"},{...y,property:"text-security"}]}}}]);
2
2
  //# sourceMappingURL=descope-date-field-index-js.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"descope-date-field-index-js.js","mappings":"oTAGO,MAAMA,EACX,GAAQC,OAAOC,OAAO,IAEtB,WAAAC,EAAY,GAAEC,EAAE,IAAEC,EAAG,IAAEC,EAAG,YAAEC,GAAeC,GACzCC,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exQ,SAAU,eAGhCgS,sBAAuB,CACrB,CAAErS,SAAU,IAAM,gCAAiCK,SAAU,SAC7D,IAAK0Q,EAAqB1Q,SAAU,SACpC,IAAKtD,EAAasD,SAAU,SAC5B,IAAKqQ,EAAqBrQ,SAAU,2BACpC,IAAK2Q,EAA6B3Q,SAAU,4BAG9CiS,cAAe,IAAKjC,EAAOhQ,SAAU,YACrCkS,iBAAkB,IAAKlC,EAAOhQ,SAAU,OACxCmS,wBAAyB,CACvB,IAAKnC,EAAOhQ,SAAU,QACtB,IAAKgQ,EAAOhQ,SAAU,UAExBoS,gBAAiB,IAAKpC,EAAOhQ,SAAU,aACvCqS,gBAAiB,IAAKrC,EAAOhQ,SAAU,cACvCsS,kBAAmB,IAAKtC,EAAOhQ,SAAU,uBACzCuS,mBAAoB,CAClB,CAAE5S,SAAU,4BAA6BK,SAAU,WACnD,IAAK0Q,EAAqB1Q,SAAU,YAEtCwS,uBAAwB,CACtB,IAAKtC,EAAYlQ,SAAU,eAC3B,IAAKwQ,EAAexQ,SAAU,gBAEhCyS,iBAAkB,CAChB,IAAKpT,EAAOW,SAAU,UACtB,IAAKwQ,EAAexQ,SAAU,WAEhC0S,uBAAwB,CACtB,IAAKrT,EAAOW,SAAU,iBACtB,IAAKwQ,EAAexQ,SAAU,kBAGhC2S,gBAAiB,CACf,IAAKpC,EAAWvQ,SAAU,gBAC1B,IAAKuQ,EAAWvQ,SAAU,gBAE5B4S,cAAe,IAAKrC,EAAWvQ,SAAU,aACzC6S,eAAgB,IAAKtC,EAAWvQ,SAAU,SAC1C8S,kBAAmB,CACjB,IAAKzT,EAAOW,SAAU,yBACtB,IAAKX,EAAOW,SAAU,iBACtB,IAAKwQ,EAAexQ,SAAU,yBAC9B,IAAKwQ,EAAexQ,SAAU,kB","sources":["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","webpack://@descope/web-components-ui/./src/components/descope-text-field/index.js","webpack://@descope/web-components-ui/./src/components/descope-text-field/textFieldMappings.js"],"sourcesContent":["// 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 // we need to re-evaluate the number value\n const numVal = Number(data.join(''));\n\n if (numVal > 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 isValidEpoch,\n formatEpoch,\n isNumber,\n getCurrentTime,\n overrideConstructedStylesheet,\n dateToEpoch,\n} from './helpers';\nimport { formats } from './formats';\nimport { calendarIcon } from './icons';\nimport {\n counterConfig,\n DEFAULT_FORMAT,\n DIVIDER,\n MOBILE_DEVICE_INTERACTION_TIMEOUT_MS,\n NATIVE_FORMAT,\n valRange,\n} from './consts';\nimport { DateCounter } from './DateCounterClass';\nimport { TextFieldClass } from '../descope-text-field/TextFieldClass';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\nimport { parseDateString } from './helpers';\nimport { newDate } from './date-utils';\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 = [\n 'format',\n 'opened',\n 'initial-value',\n 'readonly',\n 'disable-calendar',\n 'utc-time',\n];\nconst calendarAttrs = ['years-range', 'calendar-months', 'calendar-weekdays'];\nconst observedAttrs = [...dateFieldAttrs, ...calendarAttrs];\n\nclass RawDateFieldClass extends BaseInputClass {\n epoch = '';\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.resetEpoch();\n } else {\n const date = formats[this.format].getDate(this.inputElement.value);\n this.updateEpoch(dateToEpoch(date, this.isUtcTime));\n }\n }\n\n onDateCounterChange = () => {\n this.updateCountersDisplay();\n this.updateValue();\n // update validity\n this.#dispatchInput();\n };\n\n updateEpoch(epoch) {\n this.epoch = dateToEpoch(epoch, this.isUtcTime);\n }\n\n dateCounters = [\n new DateCounter(counterConfig.MONTH, this.onDateCounterChange.bind(this)),\n new DateCounter(counterConfig.DAY, this.onDateCounterChange.bind(this)),\n new DateCounter(counterConfig.YEAR, this.onDateCounterChange.bind(this)),\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 inputmode=\"numeric\">\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 epoch\n get displayValueEpoch() {\n const date = formats[this.format].getDate(this.inputElement.value);\n\n if (!isValidEpoch(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 if (this.isInvalidDate()) {\n return '';\n }\n return this.epoch;\n }\n\n set value(val) {\n let value = parseInt(val, 10);\n if (!Number.isNaN(value)) {\n this.updateEpoch(value);\n this.updateDateCounters(new Date(value));\n } else {\n this.resetEpoch();\n this.resetDateCounters();\n this.clearInputEle();\n }\n }\n\n resetEpoch() {\n this.epoch = '';\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 get isUtcTime() {\n return this.getAttribute('utc-time') === 'true';\n }\n\n get isSelectAll() {\n const inputEle = this.inputElement.baseElement.inputElement;\n return inputEle.value.length === inputEle.selectionStart + inputEle.selectionEnd;\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 = formatEpoch(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.handleKeyboard.bind(this));\n this.inputElement.addEventListener('beforeinput', this.handleInput.bind(this));\n this.inputElement.addEventListener('pointerdown', this.onPointerDown.bind(this));\n this.inputElement.addEventListener('paste', this.onPaste.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 handleInput(e) {\n e.preventDefault();\n\n this.handleSelectAll();\n\n if (e.data && isNumber(e.data)) {\n this.parseDigits(e.data);\n this.updateCountersDisplay();\n } else if (e.inputType) {\n this.handleNavKeys(e);\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 handleSelectAll() {\n if (this.isSelectAll) {\n this.selectFirstCounter();\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 = dateToEpoch(calendarDate, this.isUtcTime);\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 isValidEpoch(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 formatEpoch(this.displayValueEpoch || this.epoch, NATIVE_FORMAT)\n );\n } else {\n this.calendar.clearValue();\n this.calendar.setAttribute('preview', formatEpoch(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 // In mobile devices, there are cases were `pointerdown` is triggered\n // instead of `click`.\n onPointerDown(e) {\n setTimeout(() => this.handleMouseCaretPositionChange(e), MOBILE_DEVICE_INTERACTION_TIMEOUT_MS);\n }\n\n onFocus() {\n if (this.isReadOnly) {\n return;\n }\n\n // We need to wait for focus to end before we set selection\n setTimeout(() => this.resetDisplay());\n }\n\n resetDisplay() {\n if (!this.inputElement.value) {\n this.inputElement.value = this.format;\n }\n\n // On focus select the first counter\n this.selectFirstCounter();\n // set selection on first counter\n this.inputElement.setSelectionRange(0, this.sortedCounters[0].length);\n }\n\n onBlur() {\n if (this.opened) {\n return;\n }\n\n if (this.inputElement.value === this.format) {\n this.clearInputEle();\n }\n }\n\n clearInputEle() {\n this.inputElement.value = '';\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 parseDigits(value) {\n this.activeCounter.add(value);\n\n if (this.activeCounter.isFull) {\n this.selectNextCounter();\n }\n\n // We wait for the digit to be parsed, and only then set the selection.\n // Failing to do so results in unexpected \"jump\" of the screen in mobile devices.\n this.setInputSelectionRange();\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(\n // if triggered by touch event, target might not include `selectionStart`\n // in that case we fall back to the inputElement's `selectionStart` value.\n // Therefore, it is recommended to run this function with setTimeout,\n // at least for mobile events.\n e.target?.selectionStart || this.inputElement.selectionStart\n );\n }\n\n selectFirstCounter() {\n this.selectedCounterIdx = 0;\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 // We wait for before setting the selection, otherwise there's an\n // unexpected \"jump\" of the screen in mobile devices.\n setTimeout(() => {\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\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(this.isUtcTime ? date.getUTCMonth() + 1 : date.getMonth() + 1);\n break;\n case counterConfig.YEAR.id:\n dc.set(this.isUtcTime ? date.getUTCFullYear() : date.getFullYear());\n break;\n case counterConfig.DAY.id:\n dc.set(this.isUtcTime ? date.getUTCDate() : date.getDate());\n break;\n default:\n break;\n }\n });\n }\n\n handleKeyboard(e) {\n if (e.metaKey || e.ctrlKey) {\n if (e.key.toLowerCase() === 'x') {\n this.onCut(e);\n }\n\n return;\n }\n\n this.handleSelectAll();\n\n if (e.key === 'ArrowUp') {\n this.activeCounter.inc();\n } else if (e.key === 'ArrowDown') {\n this.activeCounter.dec();\n } else if (e.key === 'ArrowRight') {\n this.selectNextCounter();\n } else if (e.key === 'ArrowLeft') {\n this.selectPrevCounter();\n }\n\n this.setInputSelectionRange();\n }\n\n handleNavKeys(e) {\n if (this.isReadOnly) {\n return;\n }\n\n if (this.opened) {\n this.closePopover();\n }\n\n if (!this.activeCounter) return;\n\n if (e.inputType === 'deleteContentBackward') {\n this.handleBackspace();\n }\n\n this.setInputSelectionRange();\n }\n\n handleBackspace() {\n if (this.isSelectAll) {\n this.resetToInitialState();\n return;\n }\n\n const counter = this.activeCounter;\n\n if (counter.isEmpty) {\n this.selectPrevCounter();\n this.setInputSelectionRange();\n } else {\n counter.set('');\n }\n\n // To support keyboards like SwiftKey, we need to re-render the counters display and selection,\n // otherwise we get an unexpected behavior, where the format is deleted.\n setTimeout(() => {\n this.updateCountersDisplay();\n this.setInputSelectionRange();\n });\n }\n\n handleMouseCaretPositionChange(e) {\n if (this.opened) {\n return;\n }\n\n e.preventDefault();\n\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 if (Number.isNaN(parseInt(val, 10))) {\n return;\n }\n this.value = Number(val);\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 === '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 // we want to validate the date supplied actually exists. For example: Feb 31 is not an actual date,\n // but in JS when create a `new Date('1999-02-31') we get March 2nd 1999.\n // To prevent this error from being submitted, we evaluate the\n // date parts against their generated Date value.\n isInvalidDate() {\n const yearCounter = this.getCounterById('year');\n const isYearOutOfRange =\n yearCounter.numberValue > valRange['year'].max ||\n yearCounter.numberValue < valRange['year'].min;\n\n const isDateDisplayMismatch = Object.entries(this.getDateVals()).some(([key, val]) => {\n const counter = this.getCounterById(key);\n return !val || counter.numberValue !== val;\n });\n\n return isYearOutOfRange || isDateDisplayMismatch;\n }\n\n getValidity() {\n if (this.isRequired && this.isCountersEmpty) {\n return { valueMissing: true };\n }\n\n if (this.isCountersOutOfRange || this.isInvalidDate()) {\n return { patternMismatch: true };\n }\n\n return {};\n }\n\n getDateVals() {\n const ret = {\n day: '',\n month: '',\n year: '',\n };\n\n if (Number.isNaN(this.epoch)) {\n return ret;\n }\n\n try {\n const date = new Date(this.epoch);\n\n if (this.isUtcTime) {\n ret.month = date.getUTCMonth() + 1;\n ret.day = date.getUTCDate();\n ret.year = date.getUTCFullYear();\n } else {\n ret.month = date.getMonth() + 1;\n ret.day = date.getDate();\n ret.year = date.getFullYear();\n }\n } catch (e) {}\n\n return ret;\n }\n\n resetToInitialState() {\n this.resetDateCounters();\n this.selectFirstCounter();\n this.resetDisplay();\n }\n\n onCut(e) {\n e.preventDefault();\n\n if (this.isSelectAll) {\n this.#copyToClipboard(this.countersValue);\n this.resetToInitialState();\n } else {\n this.#copyToClipboard(this.activeCounter.stringValue);\n this.activeCounter.set('');\n }\n\n this.setInputSelectionRange();\n }\n\n #copyToClipboard(value) {\n try {\n navigator.clipboard.writeText(value);\n } catch (err) {\n console.error('Failed to copy date value:', err);\n }\n }\n\n onPaste(e) {\n e.preventDefault();\n\n const clipboardData = e.clipboardData || window.clipboardData;\n const pastedData = clipboardData.getData('Text');\n\n // try paste entire date if valid\n const validDate = parseDateString(pastedData, this.format);\n\n if (validDate) {\n this.value = dateToEpoch(validDate, this.isUtcTime);\n this.onDateCounterChange();\n\n // select all\n setTimeout(() => this.inputElement.setSelectionRange(0, this.inputElement.value.length));\n } else {\n const value = Number(pastedData);\n\n // try paste in counter if possible\n if (value && this.activeCounter.min <= value && this.activeCounter.max >= value) {\n // use String to get rid of any zero padding\n this.activeCounter.set(String(value));\n\n setTimeout(() => this.setInputSelectionRange());\n }\n }\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","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","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 inputTextSecurity: [\n { ...input, property: '-webkit-text-security' },\n { ...input, property: 'text-security' },\n { ...externalInput, property: '-webkit-text-security' },\n { ...externalInput, property: 'text-security' },\n ],\n};\n"],"names":["DateCounter","Object","freeze","constructor","id","min","max","placeholder","onChange","this","data","val","length","numberValue","Number","stringValue","join","padStart","isFull","isEmpty","toString","set","split","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","host","input","inputEleRTL","toggleButton","overlay","backdrop","errorMessage","selector","DateFieldClass","componentNameOverride","mappings","iconMargin","property","hostWidth","hostDirection","textAlign","rtlInputDirection","inputDirection","rtlInputAlignment","inputTextAlign","overlayGap","overlayBackgroundColor","overlayPadding","overlayBoxShadow","overlayOutlineWidth","overlayOutlineColor","overlayOutlineStyle","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","name","marginTop","backgroundColor","backdropBackgroundColor","backdropPointerEvents","padding","boxShadow","outlineWidth","outlineColor","outlineStyle","epoch","format","selectedCounterIdx","updateCountersDisplay","inputElement","value","countersValue","updateValue","isCountersOutOfRange","resetEpoch","date","formats","getDate","updateEpoch","isUtcTime","onDateCounterChange","dateCounters","MONTH","bind","DAY","YEAR","observedAttributes","concat","super","attachShadow","mode","innerHTML","shadowRoot","querySelector","popoverToggleButton","validationTarget","opened","getAttribute","displayValueEpoch","getTime","sortedCounters","map","find","dc","activeCounter","baseElement","calendar","isRTL","computedStyleDirection","getComputedStyle","getPropertyValue","isInvalidDate","parseInt","isNaN","resetDateCounters","clearInputEle","updateDateCounters","Date","isCountersEmpty","every","some","disableCalendar","isSelectAll","inputEle","selectionStart","selectionEnd","reportValidity","dispatchEvent","Event","bubbles","updateInputDisplay","init","updateFormatPattern","initPopover","initInputElement","setTimeout","getValidity","checkValidity","addEventListener","onPopoverToggle","onFocus","onBlur","handleMouseCaretPositionChange","handleKeyboard","handleInput","onPointerDown","onPaste","includeAttrs","e","preventDefault","handleSelectAll","parseDigits","inputType","handleNavKeys","trigger","withBackdrop","renderer","stopPropagation","selectFirstCounter","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","validate","clearValue","resetDisplay","setSelectionRange","onFormatUpdate","keys","includes","pattern","selectNextCounter","setInputSelectionRange","getCounterIdx","caretPos","counter1ln","counter2ln","indexOf","setSelectedCounterByCaretPosition","target","selectPrevCounter","caretStart","reduce","acc","counter","forEach","getUTCMonth","getUTCFullYear","getUTCDate","metaKey","ctrlKey","key","toLowerCase","onCut","handleBackspace","resetToInitialState","onInitialValueChange","togglePopoverAccess","visibility","classList","attributeChangedCallback","attrName","oldValue","newValue","yearCounter","isYearOutOfRange","isDateDisplayMismatch","entries","getDateVals","isRequired","valueMissing","patternMismatch","ret","day","month","year","navigator","clipboard","writeText","err","console","error","pastedData","clipboardData","window","getData","validDate","String","customElements","define","proxyProps","useProxyTargets","superclass","icon","renderCopyToClipboard","shouldRender","iconInitConfig","title","iconCopiedConfig","assign","slot","onLabelClick","oldVal","newVal","attributeChangeCallback","_setType","removeEventListener","slots","wrappedEleName","inputOutlineWidth","inputOutlineOffset","excludeAttrsSync","label","requiredIndicator","inputField","inputMask","helperText","disabledPlaceholder","inputDisabled","inputIcon","externalInput","externalInputDisabled","externalPlaceholder","externalDisabledPlaceholder","fontSize","fontFamily","labelFontSize","labelFontWeight","labelTextColor","hostMinWidth","inputBackgroundColor","errorMessageTextColor","helperTextColor","inputValueTextColor","inputCaretTextColor","labelRequiredIndicator","inputBorderColor","inputBorderWidth","inputBorderStyle","inputBorderRadius","inputHeight","inputHorizontalPadding","inputOutlineColor","inputOutlineStyle","inputPlaceholderColor","labelPosition","labelTopPosition","labelHorizontalPosition","inputTransformY","inputTransition","marginInlineStart","placeholderOpacity","inputVerticalAlignment","valueInputHeight","valueInputMarginBottom","inputIconOffset","inputIconSize","inputIconColor","inputTextSecurity"],"sourceRoot":""}
1
+ {"version":3,"file":"descope-date-field-index-js.js","mappings":"+TAGO,MAAMA,EACX,GAAQC,OAAOC,OAAO,IAEtB,WAAAC,EAAY,GAAEC,EAAE,IAAEC,EAAG,IAAEC,EAAG,YAAEC,GAAeC,GACzCC,KAAKL,GAAKA,EACVK,KAAKJ,IAAMA,EACXI,KAAKH,IAAMA,EACXG,KAAKF,YAAcA,EACnBE,KAAKD,SAAWA,CAClB,CAEA,QAAIE,GACF,OAAOD,MAAK,CACd,CAEA,QAAIC,CAAK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qBrQ,SAAU,2BACpC,IAAK2Q,EAA6B3Q,SAAU,4BAG9CiS,cAAe,IAAKjC,EAAOhQ,SAAU,YACrCkS,iBAAkB,IAAKlC,EAAOhQ,SAAU,OACxCmS,wBAAyB,CACvB,IAAKnC,EAAOhQ,SAAU,QACtB,IAAKgQ,EAAOhQ,SAAU,UAExBoS,gBAAiB,IAAKpC,EAAOhQ,SAAU,aACvCqS,gBAAiB,IAAKrC,EAAOhQ,SAAU,cACvCsS,kBAAmB,IAAKtC,EAAOhQ,SAAU,uBACzCuS,mBAAoB,CAClB,CAAE5S,SAAU,4BAA6BK,SAAU,WACnD,IAAK0Q,EAAqB1Q,SAAU,YAEtCwS,uBAAwB,CACtB,IAAKtC,EAAYlQ,SAAU,eAC3B,IAAKwQ,EAAexQ,SAAU,gBAEhCyS,iBAAkB,CAChB,IAAKpT,EAAOW,SAAU,UACtB,IAAKwQ,EAAexQ,SAAU,WAEhC0S,uBAAwB,CACtB,IAAKrT,EAAOW,SAAU,iBACtB,IAAKwQ,EAAexQ,SAAU,kBAGhC2S,gBAAiB,CACf,IAAKpC,EAAWvQ,SAAU,gBAC1B,IAAKuQ,EAAWvQ,SAAU,gBAE5B4S,cAAe,IAAKrC,EAAWvQ,SAAU,aACzC6S,eAAgB,IAAKtC,EAAWvQ,SAAU,SAC1C8S,kBAAmB,CACjB,IAAKzT,EAAOW,SAAU,yBACtB,IAAKX,EAAOW,SAAU,iBACtB,IAAKwQ,EAAexQ,SAAU,yBAC9B,IAAKwQ,EAAexQ,SAAU,kB","sources":["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","webpack://@descope/web-components-ui/./src/components/descope-text-field/index.js","webpack://@descope/web-components-ui/./src/components/descope-text-field/textFieldMappings.js"],"sourcesContent":["// 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;\n\n data = [...data, num];\n\n // we need to re-evaluate the number value\n const numVal = Number(data.join(''));\n\n if (numVal > 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 { injectStyle } from '@descope-ui/common/components-helpers';\nimport { 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 isValidEpoch,\n formatEpoch,\n isNumber,\n getCurrentTime,\n overrideConstructedStylesheet,\n dateToEpoch,\n parseDateString,\n} from './helpers';\nimport { formats } from './formats';\nimport { calendarIcon } from './icons';\nimport {\n counterConfig,\n DEFAULT_FORMAT,\n DIVIDER,\n MOBILE_DEVICE_INTERACTION_TIMEOUT_MS,\n NATIVE_FORMAT,\n valRange,\n} from './consts';\nimport { DateCounter } from './DateCounterClass';\nimport { TextFieldClass } from '../descope-text-field/TextFieldClass';\nimport { newDate } from './date-utils';\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 = [\n 'format',\n 'opened',\n 'initial-value',\n 'readonly',\n 'disable-calendar',\n 'utc-time',\n];\nconst calendarAttrs = ['years-range', 'calendar-months', 'calendar-weekdays'];\nconst observedAttrs = [...dateFieldAttrs, ...calendarAttrs];\n\nclass RawDateFieldClass extends BaseInputClass {\n epoch = '';\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.resetEpoch();\n } else {\n const date = formats[this.format].getDate(this.inputElement.value);\n this.updateEpoch(dateToEpoch(date, this.isUtcTime));\n }\n }\n\n onDateCounterChange = () => {\n this.updateCountersDisplay();\n this.updateValue();\n // update validity\n this.#dispatchInput();\n };\n\n updateEpoch(epoch) {\n this.epoch = dateToEpoch(epoch, this.isUtcTime);\n }\n\n dateCounters = [\n new DateCounter(counterConfig.MONTH, this.onDateCounterChange.bind(this)),\n new DateCounter(counterConfig.DAY, this.onDateCounterChange.bind(this)),\n new DateCounter(counterConfig.YEAR, this.onDateCounterChange.bind(this)),\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 inputmode=\"numeric\">\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 epoch\n get displayValueEpoch() {\n const date = formats[this.format].getDate(this.inputElement.value);\n\n if (!isValidEpoch(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 if (this.isInvalidDate()) {\n return '';\n }\n return this.epoch;\n }\n\n set value(val) {\n const value = parseInt(val, 10);\n if (!Number.isNaN(value)) {\n this.updateEpoch(value);\n this.updateDateCounters(new Date(value));\n } else {\n this.resetEpoch();\n this.resetDateCounters();\n this.clearInputEle();\n }\n }\n\n resetEpoch() {\n this.epoch = '';\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 get isUtcTime() {\n return this.getAttribute('utc-time') === 'true';\n }\n\n get isSelectAll() {\n const inputEle = this.inputElement.baseElement.inputElement;\n return inputEle.value.length === inputEle.selectionStart + inputEle.selectionEnd;\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 = formatEpoch(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.handleKeyboard.bind(this));\n this.inputElement.addEventListener('beforeinput', this.handleInput.bind(this));\n this.inputElement.addEventListener('pointerdown', this.onPointerDown.bind(this));\n this.inputElement.addEventListener('paste', this.onPaste.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 handleInput(e) {\n e.preventDefault();\n\n this.handleSelectAll();\n\n if (e.data && isNumber(e.data)) {\n this.parseDigits(e.data);\n this.updateCountersDisplay();\n } else if (e.inputType) {\n this.handleNavKeys(e);\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 handleSelectAll() {\n if (this.isSelectAll) {\n this.selectFirstCounter();\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 = dateToEpoch(calendarDate, this.isUtcTime);\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 isValidEpoch(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 formatEpoch(this.displayValueEpoch || this.epoch, NATIVE_FORMAT)\n );\n } else {\n this.calendar.clearValue();\n this.calendar.setAttribute('preview', formatEpoch(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 // In mobile devices, there are cases were `pointerdown` is triggered\n // instead of `click`.\n onPointerDown(e) {\n setTimeout(() => this.handleMouseCaretPositionChange(e), MOBILE_DEVICE_INTERACTION_TIMEOUT_MS);\n }\n\n onFocus() {\n if (this.isReadOnly) {\n return;\n }\n\n // We need to wait for focus to end before we set selection\n setTimeout(() => this.resetDisplay());\n }\n\n resetDisplay() {\n if (!this.inputElement.value) {\n this.inputElement.value = this.format;\n }\n\n // On focus select the first counter\n this.selectFirstCounter();\n // set selection on first counter\n this.inputElement.setSelectionRange(0, this.sortedCounters[0].length);\n }\n\n onBlur() {\n if (this.opened) {\n return;\n }\n\n if (this.inputElement.value === this.format) {\n this.clearInputEle();\n }\n }\n\n clearInputEle() {\n this.inputElement.value = '';\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 parseDigits(value) {\n this.activeCounter.add(value);\n\n if (this.activeCounter.isFull) {\n this.selectNextCounter();\n }\n\n // We wait for the digit to be parsed, and only then set the selection.\n // Failing to do so results in unexpected \"jump\" of the screen in mobile devices.\n this.setInputSelectionRange();\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(\n // if triggered by touch event, target might not include `selectionStart`\n // in that case we fall back to the inputElement's `selectionStart` value.\n // Therefore, it is recommended to run this function with setTimeout,\n // at least for mobile events.\n e.target?.selectionStart || this.inputElement.selectionStart\n );\n }\n\n selectFirstCounter() {\n this.selectedCounterIdx = 0;\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 // We wait for before setting the selection, otherwise there's an\n // unexpected \"jump\" of the screen in mobile devices.\n setTimeout(() => {\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\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(this.isUtcTime ? date.getUTCMonth() + 1 : date.getMonth() + 1);\n break;\n case counterConfig.YEAR.id:\n dc.set(this.isUtcTime ? date.getUTCFullYear() : date.getFullYear());\n break;\n case counterConfig.DAY.id:\n dc.set(this.isUtcTime ? date.getUTCDate() : date.getDate());\n break;\n default:\n break;\n }\n });\n }\n\n handleKeyboard(e) {\n if (e.metaKey || e.ctrlKey) {\n if (e.key.toLowerCase() === 'x') {\n this.onCut(e);\n }\n\n return;\n }\n\n this.handleSelectAll();\n\n if (e.key === 'ArrowUp') {\n this.activeCounter.inc();\n } else if (e.key === 'ArrowDown') {\n this.activeCounter.dec();\n } else if (e.key === 'ArrowRight') {\n this.selectNextCounter();\n } else if (e.key === 'ArrowLeft') {\n this.selectPrevCounter();\n }\n\n this.setInputSelectionRange();\n }\n\n handleNavKeys(e) {\n if (this.isReadOnly) {\n return;\n }\n\n if (this.opened) {\n this.closePopover();\n }\n\n if (!this.activeCounter) return;\n\n if (e.inputType === 'deleteContentBackward') {\n this.handleBackspace();\n }\n\n this.setInputSelectionRange();\n }\n\n handleBackspace() {\n if (this.isSelectAll) {\n this.resetToInitialState();\n return;\n }\n\n const counter = this.activeCounter;\n\n if (counter.isEmpty) {\n this.selectPrevCounter();\n this.setInputSelectionRange();\n } else {\n counter.set('');\n }\n\n // To support keyboards like SwiftKey, we need to re-render the counters display and selection,\n // otherwise we get an unexpected behavior, where the format is deleted.\n setTimeout(() => {\n this.updateCountersDisplay();\n this.setInputSelectionRange();\n });\n }\n\n handleMouseCaretPositionChange(e) {\n if (this.opened) {\n return;\n }\n\n e.preventDefault();\n\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 if (Number.isNaN(parseInt(val, 10))) {\n return;\n }\n this.value = Number(val);\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 === '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 // we want to validate the date supplied actually exists. For example: Feb 31 is not an actual date,\n // but in JS when create a `new Date('1999-02-31') we get March 2nd 1999.\n // To prevent this error from being submitted, we evaluate the\n // date parts against their generated Date value.\n isInvalidDate() {\n const yearCounter = this.getCounterById('year');\n const isYearOutOfRange =\n yearCounter.numberValue > valRange.year.max || yearCounter.numberValue < valRange.year.min;\n\n const isDateDisplayMismatch = Object.entries(this.getDateVals()).some(([key, val]) => {\n const counter = this.getCounterById(key);\n return !val || counter.numberValue !== val;\n });\n\n return isYearOutOfRange || isDateDisplayMismatch;\n }\n\n getValidity() {\n if (this.isRequired && this.isCountersEmpty) {\n return { valueMissing: true };\n }\n\n if (this.isCountersOutOfRange || this.isInvalidDate()) {\n return { patternMismatch: true };\n }\n\n return {};\n }\n\n getDateVals() {\n const ret = {\n day: '',\n month: '',\n year: '',\n };\n\n if (Number.isNaN(this.epoch)) {\n return ret;\n }\n\n try {\n const date = new Date(this.epoch);\n\n if (this.isUtcTime) {\n ret.month = date.getUTCMonth() + 1;\n ret.day = date.getUTCDate();\n ret.year = date.getUTCFullYear();\n } else {\n ret.month = date.getMonth() + 1;\n ret.day = date.getDate();\n ret.year = date.getFullYear();\n }\n } catch (e) {}\n\n return ret;\n }\n\n resetToInitialState() {\n this.resetDateCounters();\n this.selectFirstCounter();\n this.resetDisplay();\n }\n\n onCut(e) {\n e.preventDefault();\n\n if (this.isSelectAll) {\n this.#copyToClipboard(this.countersValue);\n this.resetToInitialState();\n } else {\n this.#copyToClipboard(this.activeCounter.stringValue);\n this.activeCounter.set('');\n }\n\n this.setInputSelectionRange();\n }\n\n #copyToClipboard(value) {\n try {\n navigator.clipboard.writeText(value);\n } catch (err) {\n console.error('Failed to copy date value:', err);\n }\n }\n\n onPaste(e) {\n e.preventDefault();\n\n const clipboardData = e.clipboardData || window.clipboardData;\n const pastedData = clipboardData.getData('Text');\n\n // try paste entire date if valid\n const validDate = parseDateString(pastedData, this.format);\n\n if (validDate) {\n this.value = dateToEpoch(validDate, this.isUtcTime);\n this.onDateCounterChange();\n\n // select all\n setTimeout(() => this.inputElement.setSelectionRange(0, this.inputElement.value.length));\n } else {\n const value = Number(pastedData);\n\n // try paste in counter if possible\n if (value && this.activeCounter.min <= value && this.activeCounter.max >= value) {\n // use String to get rid of any zero padding\n this.activeCounter.set(String(value));\n\n setTimeout(() => this.setInputSelectionRange());\n }\n }\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","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","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 inputTextSecurity: [\n { ...input, property: '-webkit-text-security' },\n { ...input, property: 'text-security' },\n { ...externalInput, property: '-webkit-text-security' },\n { ...externalInput, property: 'text-security' },\n ],\n};\n"],"names":["DateCounter","Object","freeze","constructor","id","min","max","placeholder","onChange","this","data","val","length","numberValue","Number","stringValue","join","padStart","isFull","isEmpty","toString","set","split","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","host","input","inputEleRTL","toggleButton","overlay","backdrop","errorMessage","selector","DateFieldClass","componentNameOverride","mappings","iconMargin","property","hostWidth","hostDirection","textAlign","rtlInputDirection","inputDirection","rtlInputAlignment","inputTextAlign","overlayGap","overlayBackgroundColor","overlayPadding","overlayBoxShadow","overlayOutlineWidth","overlayOutlineColor","overlayOutlineStyle","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","name","marginTop","backgroundColor","backdropBackgroundColor","backdropPointerEvents","padding","boxShadow","outlineWidth","outlineColor","outlineStyle","epoch","format","selectedCounterIdx","updateCountersDisplay","inputElement","value","countersValue","updateValue","isCountersOutOfRange","resetEpoch","date","formats","getDate","updateEpoch","isUtcTime","onDateCounterChange","dateCounters","MONTH","bind","DAY","YEAR","observedAttributes","concat","super","attachShadow","mode","innerHTML","shadowRoot","querySelector","popoverToggleButton","validationTarget","opened","getAttribute","displayValueEpoch","getTime","sortedCounters","map","find","dc","activeCounter","baseElement","calendar","isRTL","computedStyleDirection","getComputedStyle","getPropertyValue","isInvalidDate","parseInt","isNaN","resetDateCounters","clearInputEle","updateDateCounters","Date","isCountersEmpty","every","some","disableCalendar","isSelectAll","inputEle","selectionStart","selectionEnd","reportValidity","dispatchEvent","Event","bubbles","updateInputDisplay","init","updateFormatPattern","initPopover","initInputElement","setTimeout","getValidity","checkValidity","addEventListener","onPopoverToggle","onFocus","onBlur","handleMouseCaretPositionChange","handleKeyboard","handleInput","onPointerDown","onPaste","includeAttrs","e","preventDefault","handleSelectAll","parseDigits","inputType","handleNavKeys","trigger","withBackdrop","renderer","stopPropagation","selectFirstCounter","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","validate","clearValue","resetDisplay","setSelectionRange","onFormatUpdate","keys","includes","pattern","selectNextCounter","setInputSelectionRange","getCounterIdx","caretPos","counter1ln","counter2ln","indexOf","setSelectedCounterByCaretPosition","target","selectPrevCounter","caretStart","reduce","acc","counter","forEach","getUTCMonth","getUTCFullYear","getUTCDate","metaKey","ctrlKey","key","toLowerCase","onCut","handleBackspace","resetToInitialState","onInitialValueChange","togglePopoverAccess","visibility","classList","attributeChangedCallback","attrName","oldValue","newValue","yearCounter","isYearOutOfRange","year","isDateDisplayMismatch","entries","getDateVals","isRequired","valueMissing","patternMismatch","ret","day","month","navigator","clipboard","writeText","err","console","error","pastedData","clipboardData","window","getData","validDate","String","customElements","define","proxyProps","useProxyTargets","superclass","icon","renderCopyToClipboard","shouldRender","iconInitConfig","title","iconCopiedConfig","assign","slot","onLabelClick","oldVal","newVal","attributeChangeCallback","_setType","removeEventListener","slots","wrappedEleName","inputOutlineWidth","inputOutlineOffset","excludeAttrsSync","label","requiredIndicator","inputField","inputMask","helperText","disabledPlaceholder","inputDisabled","inputIcon","externalInput","externalInputDisabled","externalPlaceholder","externalDisabledPlaceholder","fontSize","fontFamily","labelFontSize","labelFontWeight","labelTextColor","hostMinWidth","inputBackgroundColor","errorMessageTextColor","helperTextColor","inputValueTextColor","inputCaretTextColor","labelRequiredIndicator","inputBorderColor","inputBorderWidth","inputBorderStyle","inputBorderRadius","inputHeight","inputHorizontalPadding","inputOutlineColor","inputOutlineStyle","inputPlaceholderColor","labelPosition","labelTopPosition","labelHorizontalPosition","inputTransformY","inputTransition","marginInlineStart","placeholderOpacity","inputVerticalAlignment","valueInputHeight","valueInputMarginBottom","inputIconOffset","inputIconSize","inputIconColor","inputTextSecurity"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[2294,8819],{66434(t,e,o){o.d(e,{T:()=>p,s:()=>l});var n=o(88961),i=o(63200),r=o(25964),s=o(72270);const p=(0,r.xE)("text");class h extends((0,s.qu)({componentName:p,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <slot part="text-wrapper"></slot>\n ',(0,r.fz)("\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n ",this)}get hideWhenEmpty(){return"true"===this.getAttribute("hide-when-empty")}init(){super.init(),(0,r.Ge)(this,()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""})}}const{host:d}={host:{selector:()=>":host"}},l=(0,i.Zz)((0,n.RF)({mappings:{hostWidth:{...d,property:"width"},hostDirection:{...d,property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),n.VO,n.tQ)(h)},63595(t,e,o){o.r(e),o.d(e,{TextClass:()=>n.s,componentName:()=>n.T});var n=o(66434);customElements.define(n.T,n.s)},48995(t,e,o){o.r(e),o.d(e,{DividerClass:()=>m,componentName:()=>d});var n=o(79365),i=o(81365),r=o(9696),s=o(97810),p=o(66434),h=o(25964);const d=(0,s.xE)("divider");class l extends((0,i.q)({componentName:d,baseSelector:":host > div"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t\t<div>\n\t\t\t\t<descope-text>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</descope-text>\n\t\t\t</div>\n\t\t",(0,h.fz)("\n \t:host {\n\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t}\n\t\t\t\t:host > div {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\theight: 100%;\n\t\t\t\t\twidth: 100%;\n\t\t\t\t}\n\t\t\t\t:host > div::before,\n\t\t\t\t:host > div::after {\n\t\t\t\t\tcontent: '';\n\t\t\t\t\tflex-grow: 1;\n\t\t\t\t}\n\t\t\t\tdescope-text {\n\t\t\t\t\tflex-grow: 0;\n\t\t\t\t\tflex-shrink: 0;\n\t\t\t\t}\n\t\t\t\t:host(:empty) descope-text {\n\t\t\t\t\tdisplay: none;\n\t\t\t\t}\n\t\t\t\t:host([vertical=\"true\"]) div {\n\t\t\t\t\twidth: fit-content;\n\t\t\t\t}\n ",this),this.textComponent=this.shadowRoot.querySelector("descope-text"),(0,s.EA)(this,this.textComponent,{includeAttrs:["mode","variant","italic"]})}}const a=p.s.cssVarList,{host:c,before:y,after:x,text:g}={host:{selector:()=>":host"},before:{selector:"::before"},after:{selector:"::after"},text:{selector:"descope-text"}},m=(0,r.Zz)((0,n.RF)({mappings:{hostWidth:{...c,property:"width"},hostPadding:{...c,property:"padding"},hostDirection:{...g,property:"direction"},minHeight:{},alignItems:{},alignSelf:{},flexDirection:{},textAlign:{...g,property:a.textAlign},labelTextWidth:{...g,property:"width"},labelTextMaxWidth:{...g,property:"max-width"},labelTextVerticalSpacing:[{...g,property:"padding-top"},{...g,property:"padding-bottom"}],labelTextHorizontalSpacing:[{...g,property:"padding-right"},{...g,property:"padding-left"}],stripeColor:[{...y,property:"background-color"},{...x,property:"background-color"}],stripeHorizontalThickness:[{...y,property:"height"},{...x,property:"height"}],stripeVerticalThickness:[{...y,property:"width"},{...x,property:"width"}],stripeColorOpacity:[{...y,property:"opacity"},{...x,property:"opacity"}]}}),n.VO,n.tQ)(l);o(63595),customElements.define(d,m)}}]);
1
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[2294,8819],{66434(t,e,o){o.d(e,{T:()=>p,s:()=>l});var n=o(88961),i=o(63200),r=o(25964),s=o(72270);const p=(0,r.xE)("text");class h extends((0,s.qu)({componentName:p,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <slot part="text-wrapper"></slot>\n ',(0,r.fz)("\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n ",this)}get hideWhenEmpty(){return"true"===this.getAttribute("hide-when-empty")}init(){super.init(),(0,r.Ge)(this,()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""})}}const{host:d}={host:{selector:()=>":host"}},l=(0,i.Zz)((0,n.RF)({mappings:{hostWidth:{...d,property:"width"},hostDirection:{...d,property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),n.VO,n.tQ)(h)},63595(t,e,o){o.r(e),o.d(e,{TextClass:()=>n.s,componentName:()=>n.T});var n=o(66434);customElements.define(n.T,n.s)},48995(t,e,o){o.r(e),o.d(e,{DividerClass:()=>m,componentName:()=>d});var n=o(66434),i=o(25964),r=o(79365),s=o(81365),p=o(9696),h=o(97810);const d=(0,h.xE)("divider");class l extends((0,s.q)({componentName:d,baseSelector:":host > div"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t\t<div>\n\t\t\t\t<descope-text>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</descope-text>\n\t\t\t</div>\n\t\t",(0,i.fz)("\n \t:host {\n\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t}\n\t\t\t\t:host > div {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\theight: 100%;\n\t\t\t\t\twidth: 100%;\n\t\t\t\t}\n\t\t\t\t:host > div::before,\n\t\t\t\t:host > div::after {\n\t\t\t\t\tcontent: '';\n\t\t\t\t\tflex-grow: 1;\n\t\t\t\t}\n\t\t\t\tdescope-text {\n\t\t\t\t\tflex-grow: 0;\n\t\t\t\t\tflex-shrink: 0;\n\t\t\t\t}\n\t\t\t\t:host(:empty) descope-text {\n\t\t\t\t\tdisplay: none;\n\t\t\t\t}\n\t\t\t\t:host([vertical=\"true\"]) div {\n\t\t\t\t\twidth: fit-content;\n\t\t\t\t}\n ",this),this.textComponent=this.shadowRoot.querySelector("descope-text"),(0,h.EA)(this,this.textComponent,{includeAttrs:["mode","variant","italic"]})}}const a=n.s.cssVarList,{host:c,before:y,after:x,text:g}={host:{selector:()=>":host"},before:{selector:"::before"},after:{selector:"::after"},text:{selector:"descope-text"}},m=(0,p.Zz)((0,r.RF)({mappings:{hostWidth:{...c,property:"width"},hostPadding:{...c,property:"padding"},hostDirection:{...g,property:"direction"},minHeight:{},alignItems:{},alignSelf:{},flexDirection:{},textAlign:{...g,property:a.textAlign},labelTextWidth:{...g,property:"width"},labelTextMaxWidth:{...g,property:"max-width"},labelTextVerticalSpacing:[{...g,property:"padding-top"},{...g,property:"padding-bottom"}],labelTextHorizontalSpacing:[{...g,property:"padding-right"},{...g,property:"padding-left"}],stripeColor:[{...y,property:"background-color"},{...x,property:"background-color"}],stripeHorizontalThickness:[{...y,property:"height"},{...x,property:"height"}],stripeVerticalThickness:[{...y,property:"width"},{...x,property:"width"}],stripeColorOpacity:[{...y,property:"opacity"},{...x,property:"opacity"}]}}),r.VO,r.tQ)(l);o(63595),customElements.define(d,m)}}]);
2
2
  //# sourceMappingURL=descope-divider-index-js.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"descope-divider-index-js.js","mappings":"oNAaO,MAAMA,GAAgB,QAAiB,QAE9C,MAAMC,WAAgB,QAAgB,CACpCD,gBACAE,aAAc,kBAEd,WAAAC,GACEC,QAEAC,KAAKC,aAAa,CAAEC,KAAM,SAAUC,UAAY,iDAIhD,QAAY,iLASTH,KACL,CAEA,iBAAII,GACF,MAAgD,SAAzCJ,KAAKK,aAAa,kBAC3B,CAEA,IAAAC,GACEP,MAAMO,QAEN,QAAgBN,KAAM,KACpB,MAAMO,IAAgBP,KAAKQ,WAAWC,OACtCT,KAAKU,MAAMC,SAAWJ,GAAeP,KAAKI,cAAgB,OAAS,IAEvE,EAGF,MAAM,KAAEQ,GAAS,CACfA,KAAM,CAAEC,SAAU,IAAM,UAGbC,GAAY,SACvB,QAAiB,CACfC,SAAU,CACRC,UAAW,IAAKJ,EAAMK,SAAU,SAChCC,cAAe,IAAKN,EAAMK,SAAU,aACpCE,SAAU,CAAC,EACXC,UAAW,CACT,CAAEH,SAAU,UAEdI,eAAgB,CAAEJ,SAAU,eAC5BK,kBAAmB,CAAEL,SAAU,kBAC/BM,WAAY,CAAC,EACbC,UAAW,CAAC,EACZC,cAAe,CAAC,EAChBC,WAAY,CAAC,EACbC,UAAW,CAAC,EACZC,WAAY,CAA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AAKd,EAAQzB,SAAU,UACvB,IAAK0B,EAAO1B,SAAU,WAExBwC,wBAAyB,CACvB,IAAKf,EAAQzB,SAAU,SACvB,IAAK0B,EAAO1B,SAAU,UAExByC,mBAAoB,CAClB,IAAKhB,EAAQzB,SAAU,WACvB,IAAK0B,EAAO1B,SAAU,eAI5B,KACA,KA3C0B,CA4C1BiB,G,SC1GFF,eAAeC,OAAOtC,EAAekD,E","sources":["webpack://@descope/web-components-ui/../components/descope-text/src/component/TextClass.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/index.js","webpack://@descope/web-components-ui/./src/components/descope-divider/DividerClass.js","webpack://@descope/web-components-ui/./src/components/descope-divider/index.js"],"sourcesContent":["import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n injectStyle,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('text');\n\nclass RawText extends createBaseClass({\n componentName,\n baseSelector: ':host > slot',\n}) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <slot part=\"text-wrapper\"></slot>\n `;\n\n injectStyle(`\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `, this);\n }\n\n get hideWhenEmpty() {\n return this.getAttribute('hide-when-empty') === 'true';\n }\n\n init() {\n super.init();\n\n observeChildren(this, () => {\n const hasChildren = !!this.childNodes.length;\n this.style.display = !hasChildren && this.hideWhenEmpty ? 'none' : '';\n });\n }\n}\n\nconst { host } = {\n host: { selector: () => ':host' }\n}\n\nexport const TextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n fontSize: {},\n textColor: [\n { property: 'color' }\n ],\n textLineHeight: { property: 'line-height' },\n textLetterSpacing: { property: 'letter-spacing' },\n textShadow: {},\n textAlign: {},\n textTransform: {},\n fontFamily: {},\n fontStyle: {},\n fontWeight: {},\n borderWidth: {},\n borderStyle: {},\n borderColor: {},\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n","import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n","import { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';\nimport { createBaseClass } from '../../baseClasses/createBaseClass';\nimport { compose } from '../../helpers';\nimport { forwardAttrs, getComponentName } from '../../helpers/componentHelpers';\nimport { TextClass } from '@descope-ui/descope-text/class';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('divider');\nclass RawDivider extends createBaseClass({ componentName, baseSelector: ':host > div' }) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t\t<div>\n\t\t\t\t<descope-text>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</descope-text>\n\t\t\t</div>\n\t\t`;\n\n injectStyle(\n `\n \t:host {\n\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t}\n\t\t\t\t:host > div {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\theight: 100%;\n\t\t\t\t\twidth: 100%;\n\t\t\t\t}\n\t\t\t\t:host > div::before,\n\t\t\t\t:host > div::after {\n\t\t\t\t\tcontent: '';\n\t\t\t\t\tflex-grow: 1;\n\t\t\t\t}\n\t\t\t\tdescope-text {\n\t\t\t\t\tflex-grow: 0;\n\t\t\t\t\tflex-shrink: 0;\n\t\t\t\t}\n\t\t\t\t:host(:empty) descope-text {\n\t\t\t\t\tdisplay: none;\n\t\t\t\t}\n\t\t\t\t:host([vertical=\"true\"]) div {\n\t\t\t\t\twidth: fit-content;\n\t\t\t\t}\n `,\n this\n );\n\n this.textComponent = this.shadowRoot.querySelector('descope-text');\n\n forwardAttrs(this, this.textComponent, {\n includeAttrs: ['mode', 'variant', 'italic'],\n });\n }\n}\n\nconst textVars = TextClass.cssVarList;\nconst { host, before, after, text } = {\n host: { selector: () => ':host' },\n before: { selector: '::before' },\n after: { selector: '::after' },\n text: { selector: 'descope-text' },\n};\n\nexport const DividerClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostPadding: { ...host, property: 'padding' },\n hostDirection: { ...text, property: 'direction' },\n\n minHeight: {},\n alignItems: {},\n alignSelf: {},\n flexDirection: {},\n textAlign: { ...text, property: textVars.textAlign },\n\n labelTextWidth: { ...text, property: 'width' },\n labelTextMaxWidth: { ...text, property: 'max-width' },\n labelTextVerticalSpacing: [\n { ...text, property: 'padding-top' },\n { ...text, property: 'padding-bottom' },\n ],\n labelTextHorizontalSpacing: [\n { ...text, property: 'padding-right' },\n { ...text, property: 'padding-left' },\n ],\n\n stripeColor: [\n { ...before, property: 'background-color' },\n { ...after, property: 'background-color' },\n ],\n stripeHorizontalThickness: [\n { ...before, property: 'height' },\n { ...after, property: 'height' },\n ],\n stripeVerticalThickness: [\n { ...before, property: 'width' },\n { ...after, property: 'width' },\n ],\n stripeColorOpacity: [\n { ...before, property: 'opacity' },\n { ...after, property: 'opacity' },\n ],\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(RawDivider);\n","import { componentName, DividerClass } from './DividerClass';\nimport '@descope-ui/descope-text';\n\ncustomElements.define(componentName, DividerClass);\n\nexport { DividerClass, componentName };\n"],"names":["componentName","RawText","baseSelector","constructor","super","this","attachShadow","mode","innerHTML","hideWhenEmpty","getAttribute","init","hasChildren","childNodes","length","style","display","host","selector","TextClass","mappings","hostWidth","property","hostDirection","fontSize","textColor","textLineHeight","textLetterSpacing","textShadow","textAlign","textTransform","fontFamily","fontStyle","fontWeight","borderWidth","borderStyle","borderColor","customElements","define","RawDivider","createBaseClass","textComponent","shadowRoot","querySelector","includeAttrs","textVars","cssVarList","before","after","text","DividerClass","hostPadding","minHeight","alignItems","alignSelf","flexDirection","labelTextWidth","labelTextMaxWidth","labelTextVerticalSpacing","labelTextHorizontalSpacing","stripeColor","stripeHorizontalThickness","stripeVerticalThickness","stripeColorOpacity"],"sourceRoot":""}
1
+ {"version":3,"file":"descope-divider-index-js.js","mappings":"oNAaO,MAAMA,GAAgB,QAAiB,QAE9C,MAAMC,WAAgB,QAAgB,CACpCD,gBACAE,aAAc,kBAEd,WAAAC,GACEC,QAEAC,KAAKC,aAAa,CAAEC,KAAM,SAAUC,UAAY,iDAIhD,QAAY,iLASTH,KACL,CAEA,iBAAII,GACF,MAAgD,SAAzCJ,KAAKK,aAAa,kBAC3B,CAEA,IAAAC,GACEP,MAAMO,QAEN,QAAgBN,KAAM,KACpB,MAAMO,IAAgBP,KAAKQ,WAAWC,OACtCT,KAAKU,MAAMC,SAAWJ,GAAeP,KAAKI,cAAgB,OAAS,IAEvE,EAGF,MAAM,KAAEQ,GAAS,CACfA,KAAM,CAAEC,SAAU,IAAM,UAGbC,GAAY,SACvB,QAAiB,CACfC,SAAU,CACRC,UAAW,IAAKJ,EAAMK,SAAU,SAChCC,cAAe,IAAKN,EAAMK,SAAU,aACpCE,SAAU,CAAC,EACXC,UAAW,CACT,CAAEH,SAAU,UAEdI,eAAgB,CAAEJ,SAAU,eAC5BK,kBAAmB,CAAEL,SAAU,kBAC/BM,WAAY,CAAC,EACbC,UAAW,CAAC,EACZC,cAAe,CAAC,EAChBC,WAAY,CAAC,EACbC,UAAW,CAAC,EACZC,WAAY,CAAC,EACbC,YAAa,CAAC,EACdC,YAAa,CAAC,EACdC,YAAa,CAAC,KAGlB,KACA,KAvBuB,CAwBvBnC,E,sFC9EFoC,eAAeC,OAAO,IAAe,I,2ICK9B,MAAMtC,GAAgB,QAAiB,WAC9C,MAAMuC,WAAmB,EAAAC,EAAA,GAAgB,CAAExC,gBAAeE,aAAc,iBACtE,WAAAC,GACEC,QAEAC,KAAKC,aAAa,CAAEC,KAAM,SAAUC,UAAY,+GAQhD,QACE,wiBAyBAH,MAGFA,KAAKoC,cAAgBpC,KAAKqC,WAAWC,cAAc,iBAEnD,QAAatC,KAAMA,KAAKoC,cAAe,CACrCG,aAAc,CAAC,OAAQ,UAAW,WAEtC,EAGF,MAAMC,EAAW1B,EAAA,EAAU2B,YACrB,KAAE7B,EAAI,OAAE8B,EAAM,MAAEC,EAAOC,KAAI,GAAK,CACpChC,KAAM,CAAEC,SAAU,IAAM,SACxB6B,OAAQ,CAAE7B,SAAU,YACpB8B,MAAO,CAAE9B,SAAU,WACnB+B,KAAM,CAAE/B,SAAU,iBAGPgC,GAAe,SAC1B,QAAiB,CACf9B,SAAU,CACRC,UAAW,IAAKJ,EAAMK,SAAU,SAChC6B,YAAa,IAAKlC,EAAMK,SAAU,WAClCC,cAAe,IAAK,EAAMD,SAAU,aAEpC8B,UAAW,CAAC,EACZC,WAAY,CAAC,EACbC,UAAW,CAAC,EACZC,cAAe,CAAC,EAChB1B,UAAW,IAAK,EAAMP,SAAUuB,EAAShB,WAEzC2B,eAAgB,IAAK,EAAMlC,SAAU,SACrCmC,kBAAmB,IAAK,EAAMnC,SAAU,aACxCoC,yBAA0B,CACxB,IAAK,EAAMpC,SAAU,eACrB,IAAK,EAAMA,SAAU,mBAEvBqC,2BAA4B,CAC1B,IAAK,EAAMrC,SAAU,iBACrB,IAAK,EAAMA,SAAU,iBAGvBsC,YAAa,CACX,IAAKb,EAAQzB,SAAU,oBACvB,IAAK0B,EAAO1B,SAAU,qBAExBuC,0BAA2B,CACzB,IAAKd,EAAQzB,SAAU,UACvB,IAAK0B,EAAO1B,SAAU,WAExBwC,wBAAyB,CACvB,IAAKf,EAAQzB,SAAU,SACvB,IAAK0B,EAAO1B,SAAU,UAExByC,mBAAoB,CAClB,IAAKhB,EAAQzB,SAAU,WACvB,IAAK0B,EAAO1B,SAAU,eAI5B,KACA,KA3C0B,CA4C1BiB,G,SC1GFF,eAAeC,OAAOtC,EAAekD,E","sources":["webpack://@descope/web-components-ui/../components/descope-text/src/component/TextClass.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/index.js","webpack://@descope/web-components-ui/./src/components/descope-divider/DividerClass.js","webpack://@descope/web-components-ui/./src/components/descope-divider/index.js"],"sourcesContent":["import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n injectStyle,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('text');\n\nclass RawText extends createBaseClass({\n componentName,\n baseSelector: ':host > slot',\n}) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <slot part=\"text-wrapper\"></slot>\n `;\n\n injectStyle(`\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `, this);\n }\n\n get hideWhenEmpty() {\n return this.getAttribute('hide-when-empty') === 'true';\n }\n\n init() {\n super.init();\n\n observeChildren(this, () => {\n const hasChildren = !!this.childNodes.length;\n this.style.display = !hasChildren && this.hideWhenEmpty ? 'none' : '';\n });\n }\n}\n\nconst { host } = {\n host: { selector: () => ':host' }\n}\n\nexport const TextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n fontSize: {},\n textColor: [\n { property: 'color' }\n ],\n textLineHeight: { property: 'line-height' },\n textLetterSpacing: { property: 'letter-spacing' },\n textShadow: {},\n textAlign: {},\n textTransform: {},\n fontFamily: {},\n fontStyle: {},\n fontWeight: {},\n borderWidth: {},\n borderStyle: {},\n borderColor: {},\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n","import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n","import { TextClass } from '@descope-ui/descope-text/class';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\nimport { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';\nimport { createBaseClass } from '../../baseClasses/createBaseClass';\nimport { compose } from '../../helpers';\nimport { forwardAttrs, getComponentName } from '../../helpers/componentHelpers';\n\nexport const componentName = getComponentName('divider');\nclass RawDivider extends createBaseClass({ componentName, baseSelector: ':host > div' }) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t\t<div>\n\t\t\t\t<descope-text>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</descope-text>\n\t\t\t</div>\n\t\t`;\n\n injectStyle(\n `\n \t:host {\n\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t}\n\t\t\t\t:host > div {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\theight: 100%;\n\t\t\t\t\twidth: 100%;\n\t\t\t\t}\n\t\t\t\t:host > div::before,\n\t\t\t\t:host > div::after {\n\t\t\t\t\tcontent: '';\n\t\t\t\t\tflex-grow: 1;\n\t\t\t\t}\n\t\t\t\tdescope-text {\n\t\t\t\t\tflex-grow: 0;\n\t\t\t\t\tflex-shrink: 0;\n\t\t\t\t}\n\t\t\t\t:host(:empty) descope-text {\n\t\t\t\t\tdisplay: none;\n\t\t\t\t}\n\t\t\t\t:host([vertical=\"true\"]) div {\n\t\t\t\t\twidth: fit-content;\n\t\t\t\t}\n `,\n this\n );\n\n this.textComponent = this.shadowRoot.querySelector('descope-text');\n\n forwardAttrs(this, this.textComponent, {\n includeAttrs: ['mode', 'variant', 'italic'],\n });\n }\n}\n\nconst textVars = TextClass.cssVarList;\nconst { host, before, after, text } = {\n host: { selector: () => ':host' },\n before: { selector: '::before' },\n after: { selector: '::after' },\n text: { selector: 'descope-text' },\n};\n\nexport const DividerClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostPadding: { ...host, property: 'padding' },\n hostDirection: { ...text, property: 'direction' },\n\n minHeight: {},\n alignItems: {},\n alignSelf: {},\n flexDirection: {},\n textAlign: { ...text, property: textVars.textAlign },\n\n labelTextWidth: { ...text, property: 'width' },\n labelTextMaxWidth: { ...text, property: 'max-width' },\n labelTextVerticalSpacing: [\n { ...text, property: 'padding-top' },\n { ...text, property: 'padding-bottom' },\n ],\n labelTextHorizontalSpacing: [\n { ...text, property: 'padding-right' },\n { ...text, property: 'padding-left' },\n ],\n\n stripeColor: [\n { ...before, property: 'background-color' },\n { ...after, property: 'background-color' },\n ],\n stripeHorizontalThickness: [\n { ...before, property: 'height' },\n { ...after, property: 'height' },\n ],\n stripeVerticalThickness: [\n { ...before, property: 'width' },\n { ...after, property: 'width' },\n ],\n stripeColorOpacity: [\n { ...before, property: 'opacity' },\n { ...after, property: 'opacity' },\n ],\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(RawDivider);\n","import { componentName, DividerClass } from './DividerClass';\nimport '@descope-ui/descope-text';\n\ncustomElements.define(componentName, DividerClass);\n\nexport { DividerClass, componentName };\n"],"names":["componentName","RawText","baseSelector","constructor","super","this","attachShadow","mode","innerHTML","hideWhenEmpty","getAttribute","init","hasChildren","childNodes","length","style","display","host","selector","TextClass","mappings","hostWidth","property","hostDirection","fontSize","textColor","textLineHeight","textLetterSpacing","textShadow","textAlign","textTransform","fontFamily","fontStyle","fontWeight","borderWidth","borderStyle","borderColor","customElements","define","RawDivider","createBaseClass","textComponent","shadowRoot","querySelector","includeAttrs","textVars","cssVarList","before","after","text","DividerClass","hostPadding","minHeight","alignItems","alignSelf","flexDirection","labelTextWidth","labelTextMaxWidth","labelTextVerticalSpacing","labelTextHorizontalSpacing","stripeColor","stripeHorizontalThickness","stripeVerticalThickness","stripeColorOpacity"],"sourceRoot":""}