@descope/web-components-ui 3.12.1 → 3.13.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 (93) hide show
  1. package/dist/cjs/index.cjs.js +4121 -2426
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +3165 -1468
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/umd/6618.js +591 -0
  6. package/dist/umd/{7387.js.LICENSE.txt → 6618.js.LICENSE.txt} +6 -0
  7. package/dist/umd/6618.js.map +1 -0
  8. package/dist/umd/8350.js +2 -0
  9. package/dist/umd/8350.js.map +1 -0
  10. package/dist/umd/9265.js +2 -0
  11. package/dist/umd/9265.js.map +1 -0
  12. package/dist/umd/DescopeDev.js +1 -1
  13. package/dist/umd/DescopeDev.js.map +1 -1
  14. package/dist/umd/descope-date-field-descope-calendar-index-js.js +449 -1
  15. package/dist/umd/descope-date-field-descope-calendar-index-js.js.map +1 -1
  16. package/dist/umd/descope-date-field-index-js.js +1 -1
  17. package/dist/umd/descope-date-field-index-js.js.map +1 -1
  18. package/dist/umd/descope-email-field-index-js.js +2 -2
  19. package/dist/umd/descope-email-field-index-js.js.map +1 -1
  20. package/dist/umd/descope-hybrid-field-index-js.js +1 -1
  21. package/dist/umd/descope-hybrid-field-index-js.js.map +1 -1
  22. package/dist/umd/descope-month-day-field-picker.js +114 -0
  23. package/dist/umd/descope-month-day-field-picker.js.LICENSE.txt +11 -0
  24. package/dist/umd/descope-month-day-field-picker.js.map +1 -0
  25. package/dist/umd/descope-month-day-field.js +2 -0
  26. package/dist/umd/descope-month-day-field.js.map +1 -0
  27. package/dist/umd/descope-new-password-index-js.js +1 -1
  28. package/dist/umd/descope-new-password-index-js.js.map +1 -1
  29. package/dist/umd/descope-number-field-index-js.js +1 -1
  30. package/dist/umd/descope-number-field-index-js.js.map +1 -1
  31. package/dist/umd/descope-passcode-index-js.js +1 -1
  32. package/dist/umd/descope-passcode-index-js.js.map +1 -1
  33. package/dist/umd/descope-radio-group-index-js.js +1 -1
  34. package/dist/umd/descope-radio-group-index-js.js.map +1 -1
  35. package/dist/umd/descope-security-questions-setup-index-js.js +1 -1
  36. package/dist/umd/descope-security-questions-setup-index-js.js.map +1 -1
  37. package/dist/umd/descope-security-questions-verify-index-js.js +1 -1
  38. package/dist/umd/descope-security-questions-verify-index-js.js.map +1 -1
  39. package/dist/umd/descope-text-field.js +38 -0
  40. package/dist/umd/descope-text-field.js.map +1 -0
  41. package/dist/umd/index.js +1 -1
  42. package/dist/umd/index.js.map +1 -1
  43. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -1
  44. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js.map +1 -1
  45. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js +1 -1
  46. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js.map +1 -1
  47. package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js +1 -1
  48. package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js.map +1 -1
  49. package/dist/umd/phone-fields-descope-phone-field-index-js.js +1 -1
  50. package/dist/umd/phone-fields-descope-phone-field-index-js.js.map +1 -1
  51. package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js +1 -1
  52. package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js.map +1 -1
  53. package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js +1 -1
  54. package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js.map +1 -1
  55. package/package.json +39 -36
  56. package/src/components/descope-date-field/DateFieldClass.js +1 -1
  57. package/src/components/descope-date-field/index.js +1 -1
  58. package/src/components/descope-email-field/EmailFieldClass.js +1 -1
  59. package/src/components/descope-new-password/index.js +1 -1
  60. package/src/components/descope-number-field/NumberFieldClass.js +1 -1
  61. package/src/components/descope-passcode/PasscodeClass.js +1 -1
  62. package/src/components/descope-passcode/index.js +1 -1
  63. package/src/components/descope-radio-group/RadioGroupClass.js +1 -1
  64. package/src/components/descope-security-questions-setup/SecurityQuestionsSetupClass.js +1 -1
  65. package/src/components/descope-security-questions-setup/index.js +1 -1
  66. package/src/components/descope-security-questions-verify/SecurityQuestionsVerifyClass.js +1 -1
  67. package/src/components/descope-security-questions-verify/index.js +1 -1
  68. package/src/components/mapping-fields/descope-mappings-field/index.js +1 -1
  69. package/src/components/mapping-fields/descope-saml-group-mappings/index.js +1 -1
  70. package/src/components/phone-fields/descope-phone-field/PhoneFieldClass.js +1 -1
  71. package/src/components/phone-fields/descope-phone-field/descope-phone-field-internal/index.js +1 -1
  72. package/src/components/phone-fields/descope-phone-field/index.js +1 -1
  73. package/src/components/phone-fields/descope-phone-input-box-field/PhoneFieldInputBoxClass.js +1 -1
  74. package/src/components/phone-fields/descope-phone-input-box-field/descope-phone-input-box-internal/index.js +1 -1
  75. package/src/components/phone-fields/descope-phone-input-box-field/index.js +1 -1
  76. package/src/index.cjs.js +2 -2
  77. package/src/index.js +0 -1
  78. package/src/theme/components/index.js +5 -1
  79. package/stories/descope-text-field.stories.js +1 -1
  80. package/dist/umd/3685.js +0 -2
  81. package/dist/umd/3685.js.map +0 -1
  82. package/dist/umd/4518.js +0 -450
  83. package/dist/umd/4518.js.map +0 -1
  84. package/dist/umd/7387.js +0 -144
  85. package/dist/umd/7387.js.map +0 -1
  86. package/dist/umd/descope-text-field-index-js.js +0 -38
  87. package/dist/umd/descope-text-field-index-js.js.map +0 -1
  88. package/src/components/descope-text-field/TextFieldClass.js +0 -142
  89. package/src/components/descope-text-field/index.js +0 -9
  90. package/src/components/descope-text-field/textFieldMappings.js +0 -169
  91. package/src/theme/components/textField.js +0 -71
  92. /package/dist/umd/{4518.js.LICENSE.txt → descope-date-field-descope-calendar-index-js.js.LICENSE.txt} +0 -0
  93. /package/dist/umd/{descope-text-field-index-js.js.LICENSE.txt → descope-text-field.js.LICENSE.txt} +0 -0
@@ -1 +1 @@
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C,MAAMmC,EAAU3I,EAAIwE,SACpB,OAAKmE,EACE,IAAQnC,GAAQ1M,QAAQ6O,GADV,MAIVC,EAAc,CAACtP,EAAMuP,IAEZ,iBAATvP,EACFA,EAGLuP,EACKrP,KAAKG,IAAIL,EAAKM,cAAeN,EAAKO,WAAYP,EAAKQ,WAIrDR,EAAK2G,S,mDC3DP,MAAM6I,EAAe,yxHAMfC,EAAiB,ieAKjBC,EAAgB,8d","sources":["webpack://@descope/web-components-ui/../components/descope-button/src/component/ButtonClass.js","webpack://@descope/web-components-ui/../components/descope-button/src/component/clickableMixin.js","webpack://@descope/web-components-ui/../components/descope-button/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-icon/src/component/IconClass.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/ImageClass.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/helpers.js","webpack://@descope/web-components-ui/./src/baseClasses/createBaseInputClass.js","webpack://@descope/web-components-ui/./src/components/descope-date-field/consts.js","webpack://@descope/web-components-ui/./src/components/descope-date-field/date-utils.js","webpack://@descope/web-components-ui/./src/components/descope-date-field/descope-calendar/helpers.js","webpack://@descope/web-components-ui/./src/components/descope-date-field/descope-calendar/CalendarClass.js","webpack://@descope/web-components-ui/./src/components/descope-date-field/descope-calendar/index.js","webpack://@descope/web-components-ui/./src/components/descope-date-field/formats.js","webpack://@descope/web-components-ui/./src/components/descope-date-field/helpers.js","webpack://@descope/web-components-ui/./src/components/descope-date-field/icons.js"],"sourcesContent":["import { compose } from '@descope-ui/common/utils';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport {\n createStyleMixin,\n draggableMixin,\n createProxy,\n componentNameValidationMixin,\n stretchMixin,\n} from '@descope-ui/common/components-mixins';\nimport { IconClass } from '@descope-ui/descope-icon/class';\nimport { clickableMixin } from './clickableMixin';\n\nexport const componentName = getComponentName('button');\n\nconst resetStyles = `\n\t:host {\n\t\tdisplay: inline-block;\n\t\tbox-sizing: border-box;\n\t}\n\tvaadin-button::before,\n\tvaadin-button::after {\n\t\topacity: 0;\n\t}\n\tvaadin-button {\n\t\tmargin: 0;\n\t\tmin-width: 0;\n\t\twidth: 100%;\n\t\theight: auto;\n\t\tbox-shadow: none;\n\t}\n\tvaadin-button::part(label) {\n\t\tpadding: 0;\n width: 100%;\n\t}\n\tvaadin-button::part(prefix) {\n\t\tmargin-left: 0;\n\t\tmargin-right: 0;\n\t}\n`;\n\nconst iconStyles = `\n\tvaadin-button::part(prefix),\n\tvaadin-button::part(label) {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t}\n`;\n\nconst editorOverrides = `vaadin-button::part(label) { pointer-events: none; }`;\n\nconst { host, label, slottedIcon } = {\n host: { selector: () => ':host' },\n label: { selector: '::part(label)' },\n slottedIcon: { selector: () => '::slotted(descope-icon)' },\n};\n\nlet loadingIndicatorStyles;\n\nexport const ButtonClass = compose(\n stretchMixin({ triggers: [{ attr: 'full-width', value: 'true' }] }),\n createStyleMixin({\n mappings: {\n hostWidth: { property: 'width' },\n hostHeight: { property: 'height' },\n hostDirection: { ...host, property: 'direction' },\n fontSize: {},\n fontFamily: {},\n fontWeight: {},\n\n cursor: {},\n backgroundColor: {},\n\n outlineOffset: {},\n outlineColor: {},\n outlineStyle: {},\n outlineWidth: {},\n\n borderRadius: {},\n borderColor: {},\n borderStyle: {},\n borderWidth: {},\n\n verticalPadding: [\n { property: 'padding-top' },\n { property: 'padding-bottom' },\n ],\n horizontalPadding: [\n { property: 'padding-right', fallback: '0.875em' },\n { property: 'padding-left', fallback: '0.875em' },\n ],\n\n labelTextColor: { property: 'color' },\n iconColor: {\n selector: () => `::slotted(*)`,\n property: IconClass.cssVarList.fill,\n },\n labelTextDecoration: { ...label, property: 'text-decoration' },\n labelSpacing: { ...label, property: 'gap' },\n textAlign: { ...label, property: 'justify-content', fallback: 'center' },\n\n iconSize: [\n { ...slottedIcon, property: 'width' },\n { ...slottedIcon, property: 'height' },\n ],\n },\n }),\n clickableMixin,\n draggableMixin,\n componentNameValidationMixin,\n)(\n createProxy({\n slots: ['', 'prefix', 'label', 'suffix'],\n wrappedEleName: 'vaadin-button',\n style: () => `\n\t\t\t${resetStyles}\n\t\t\t${iconStyles}\n\t\t\t${loadingIndicatorStyles}\n\t\t\t${editorOverrides}\n\t\t\t:host {\n\t\t\t\tpadding: calc(var(${ButtonClass.cssVarList.outlineWidth}) + var(${ButtonClass.cssVarList.outlineOffset}));\n\t\t\t}\n :host([full-width=\"true\"]) {\n width: var(${ButtonClass.cssVarList.hostWidth});\n }\n\t\t\tvaadin-button {\n\t\t\t\theight: calc(var(${ButtonClass.cssVarList.hostHeight}) - var(${ButtonClass.cssVarList.outlineWidth}) - var(${ButtonClass.cssVarList.outlineOffset}));\n\t\t\t}\n\t\t\t[square=\"true\"]:not([full-width=\"true\"]) {\n\t\t\t\twidth: calc(var(${ButtonClass.cssVarList.hostWidth}) - var(${ButtonClass.cssVarList.outlineWidth}) - var(${ButtonClass.cssVarList.outlineOffset}));\n padding: 0;\n\t\t\t}\n\t\t`,\n excludeAttrsSync: ['tabindex', 'class', 'style'],\n componentName,\n }),\n);\n\nconst { color, fontSize } = ButtonClass.cssVarList;\nloadingIndicatorStyles = `\n\t@keyframes spin {\n\t\t0% { -webkit-transform: rotate(0deg); }\n\t\t100% { -webkit-transform: rotate(360deg); }\n\t}\n\t:host([loading=\"true\"]) ::before {\n\t\tanimation: spin 2s linear infinite;\n\t\tposition: absolute;\n\t\tcontent: '';\n\t\tz-index: 1;\n\t\tbox-sizing: border-box;\n\t\tborder-radius: 50%;\n\t\tborder-bottom-color: transparent;\n\t\tborder-left-color: transparent;\n\t\tborder-style: solid;\n\t\tcolor: var(${color});\n\t\ttop: calc(50% - (var(${fontSize}) / 2));\n\t\tleft: calc(50% - (var(${fontSize}) / 2));\n\t\tborder-width: calc(var(${fontSize}) / 10);\n\t\twidth: var(${fontSize});\n\t\theight: var(${fontSize});\n\t}\n\t:host([disabled=\"true\"]),\n\t:host([loading=\"true\"]) {\n\t\tpointer-events: none;\n\t}\n\t:host([loading=\"true\"]) ::part(prefix),\n\t:host([loading=\"true\"]) ::part(label) {\n\t\tvisibility: hidden;\n\t}\n`;\n","export const clickableMixin = (superclass) =>\n class ClickableMixinClass extends superclass {\n get isLoading() {\n return this.getAttribute('loading') === 'true';\n }\n\n click() {\n this.isLoading || super.click();\n }\n };\n","import { componentName, ButtonClass } from './ButtonClass';\nimport '@vaadin/button';\n\ncustomElements.define(componentName, ButtonClass);\n\nexport { ButtonClass, componentName };\n","import {\n componentNameValidationMixin,\n createProxy,\n createStyleMixin,\n draggableMixin,\n} from '@descope-ui/common/components-mixins';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport { ImageClass } from '@descope-ui/descope-image/class';\nimport { compose } from '@descope-ui/common/utils';\n\nexport const componentName = getComponentName('icon');\n\nexport const IconClass = compose(\n createStyleMixin({\n mappings: {\n fill: [{}, { property: ImageClass.cssVarList.fill }],\n height: { selector: () => ':host' },\n width: { selector: () => ':host' },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(\n createProxy({\n slots: [],\n wrappedEleName: 'descope-image',\n style: () => `\n :host {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n max-height: 100%;\n }\n `,\n excludeAttrsSync: ['tabindex', 'class', 'style', 'st-height', 'st-width'],\n componentName,\n }),\n);\n"," \nimport {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { compose } from '@descope-ui/common/utils';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport { createImage } from './helpers';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('image');\n\nconst srcAttrs = ['src', 'src-dark'];\n\nclass RawImage extends createBaseClass({\n componentName,\n baseSelector: 'slot',\n}) {\n static get observedAttributes() {\n return srcAttrs;\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<slot></slot>\n\t`;\n\n injectStyle(\n `\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n :host > slot {\n width: 100%;\n height: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tdisplay: flex;\n\t\t\t\toverflow: hidden;\n\t\t\t}\n\n ::slotted(*) {\n width: 100%;\n\t\t\t}\n\n .hidden {\n display: none;\n }\n `,\n this,\n );\n }\n\n init() {\n super.init?.();\n this.toggleVisibility(this.getSrc);\n }\n\n onThemeChange() {\n this.renderImage();\n }\n\n toggleVisibility(isVisible) {\n if (isVisible) {\n this.classList.remove('hidden');\n } else {\n this.classList.add('hidden');\n }\n }\n\n get altText() {\n return this.getAttribute('alt') || '';\n }\n\n get legacySrc() {\n return this.getAttribute('src');\n }\n\n get themeSrc() {\n return this.getAttribute(`src-${this.currentThemeName}`);\n }\n\n get getSrc() {\n return this.themeSrc || this.legacySrc;\n }\n\n // in order to fill an SVG with `currentColor` override all of its `fill` and `path` nodes\n // with the value from the `st-fill` attribute\n \n updateFillColor(node) {\n // set fill to root node and all its relevant selectors\n const elementsToReplace = [node, ...node.querySelectorAll('*[fill]')];\n\n elementsToReplace.forEach((ele) => {\n ele.setAttribute(\n 'fill',\n `var(${ImageClass.cssVarList.fill}, ${ele.getAttribute('fill') || \"''\"})`,\n );\n });\n }\n\n renderImage() {\n this.toggleVisibility(this.getSrc);\n\n createImage(this.getSrc, this.altText).then((res) => {\n this.innerHTML = '';\n if (res) {\n this.updateFillColor(res);\n this.appendChild(res);\n }\n });\n }\n\n // render only when src attribute matches current theme\n shouldRender(src) {\n const srcVal = this.getAttribute(src);\n return this.getSrc === srcVal;\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue === newValue) return;\n\n if (this.shouldRender(attrName)) {\n this.renderImage();\n }\n }\n}\n\nexport const ImageClass = compose(\n createStyleMixin({\n mappings: {\n fill: {},\n height: { selector: () => ':host' },\n width: { selector: () => ':host' },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawImage);\n","import DOMPurify from 'dompurify';\n\nconst getFileExtension = (path) => {\n const match = path.match(/\\.([0-9a-z]+)(?:[\\\\?#]|$)/i);\n return match ? match[1] : null;\n};\n\nconst base64Prefix = 'data:image/svg+xml;base64,';\n\nconst isBase64Svg = (src) => src.startsWith(base64Prefix);\n\nconst createImgEle = (src, altText) => {\n const ele = document.createElement('img');\n ele.setAttribute('src', src);\n ele.setAttribute('alt', altText);\n return ele;\n};\n\nconst createSvgEle = (text) => {\n // we want to purify the SVG to avoid XSS attacks\n const clean = DOMPurify.sanitize(text, {\n USE_PROFILES: { svg: true, svgFilters: true },\n // allow image to render\n ADD_TAGS: ['image'],\n // forbid interactiviy via `use` tags (which are sanitized by default)\n FORBID_TAGS: ['defs']\n });\n\n const parser = new DOMParser();\n const ele = parser\n .parseFromString(clean, 'image/svg+xml')\n .querySelector('svg');\n return ele;\n};\n\nexport const createImage = async (src, altText) => {\n try {\n let ele;\n if (isBase64Svg(src)) {\n // handle base64 source\n const svgXml = atob(src.slice(base64Prefix.length));\n ele = createSvgEle(svgXml);\n } else if (getFileExtension(src) === 'svg') {\n // handle urls\n const fetchedSrc = await fetch(src);\n const text = await fetchedSrc.text();\n ele = createSvgEle(text);\n } else {\n // handle binary\n ele = createImgEle(src, altText);\n }\n\n ele.style.setProperty('max-width', '100%');\n ele.style.setProperty('max-height', '100%');\n\n return ele;\n } catch {\n return null;\n }\n};\n","import { compose } from '../helpers';\nimport {\n changeMixin,\n inputEventsDispatchingMixin,\n inputValidationMixin,\n normalizeBooleanAttributesMixin,\n} from '../mixins';\nimport { createBaseClass } from './createBaseClass';\n\nexport const createBaseInputClass = (...args) =>\n compose(\n inputValidationMixin,\n changeMixin,\n normalizeBooleanAttributesMixin,\n inputEventsDispatchingMixin\n )(createBaseClass(...args));\n","export const SUPPORTED_FORMATS = ['MM/DD/YYYY', 'DD/MM/YYYY', 'YYYY/MM/DD'];\n\nexport const DEFAULT_FORMAT = SUPPORTED_FORMATS[0];\n\nexport const NATIVE_FORMAT = 'YYYY-MM-DD';\n\nexport const YEARS_RANGE = 100;\n\nexport const DIVIDER = '/';\n\nexport const months = [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n];\n\nexport const weekdays = [\n 'Sunday',\n 'Monday',\n 'Tuesday',\n 'Wednesday',\n 'Thursday',\n 'Friday',\n 'Saturday',\n];\n\nexport const counterConfig = {\n MONTH: { id: 'month', min: 1, max: 12, placeholder: 'MM' },\n DAY: { id: 'day', min: 1, max: 31, placeholder: 'DD' },\n YEAR: { id: 'year', min: 0, max: 9999, placeholder: 'YYYY' },\n};\n\nexport const valRange = {\n year: { min: 1900, max: 2099 },\n};\n\nexport const BUTTON_LABEL_DONE = 'Done';\nexport const BUTTON_LABEL_CANCEL = 'Cancel';\nexport const CALENDAR_LABEL_TODAY = 'Today';\n\nexport const MOBILE_DEVICE_INTERACTION_TIMEOUT_MS = 150;\n","// polyfill for safari Date API (which doesn't accept \"YYYY-MM-DD\" string as value)\nexport const newDate = (date, isUtcTime) => {\n if (typeof date === 'number') {\n return new Date(date);\n }\n if (typeof date === 'string') {\n const d = new Date(date.replace(/-/g, '/'));\n if (isUtcTime) {\n return new Date(\n Date.UTC(\n d.getFullYear(),\n d.getMonth(),\n d.getDate(),\n d.getHours(),\n d.getMinutes(),\n d.getSeconds(),\n d.getMilliseconds()\n )\n );\n }\n return new Date(d);\n }\n return new Date();\n};\n","import { months, weekdays } from '../consts';\nimport { getPartsFromEpoch } from '../helpers';\nimport { newDate } from '../date-utils';\n\nconst isValidAttrArr = (arr, count) =>\n Array.isArray(arr) && arr.length === count && arr.filter(Boolean).length === count;\n\nconst generateYearList = (range) => {\n const [start, end] = range;\n const years = [];\n\n for (let year = start; year <= end; year++) {\n years.push(year);\n }\n\n return years;\n};\n\nconst getMaxDaysInMonth = (year, month) => new Date(year, month, 0).getDate();\n\nconst comboBoxItemTpl = ({ label, dataId, dataName }) => `\n\t<div class=\"combo-box-item\"\n\t\tdata-id=\"${dataId}\"\n\t\tdata-name=\"${dataName}\"\n\t>\n\t\t\t${label}\n\t</div>\n`;\n\nexport const createMonthView = (year, month, shortWeekdays) => {\n const daysInMonth = getMaxDaysInMonth(year, month);\n\n // Get day of the week (0 = Sunday, 1 = Monday, etc.)\n const firstDayOfMonth = new Date(year, month - 1, 1).getDay();\n\n let monthView = '<table>';\n\n // Add the table headers (days of the week)\n monthView += `<thead><tr>${shortWeekdays.reduce(\n (acc, d) => `${acc}<th><span class=\"weekday\">${d}</span></th>`,\n ''\n )}</tr></thead>`;\n\n monthView += '<tbody>';\n\n // Add empty cells for the days before the start of the month\n monthView += '<tr>';\n for (let i = 0; i < firstDayOfMonth; i++) {\n monthView += '<td></td>';\n }\n\n // Add days of the month\n let dayOfWeek = firstDayOfMonth;\n for (let i = 1; i <= daysInMonth; i++) {\n if (dayOfWeek === 7) {\n dayOfWeek = 0;\n monthView += '</tr><tr>';\n }\n\n monthView += `\n <td\n data-date-day=\"${i}\"\n class=\"day-entry\">\n <span class=\"day\" data-date-day=${i}>\n ${i}\n </span>\n </td>\n `;\n dayOfWeek++;\n }\n\n // Add empty cells for the days after the end of the month\n while (dayOfWeek < 7) {\n monthView += '<td></td>';\n dayOfWeek++;\n }\n\n monthView += '</tr></tbody></table>';\n\n return monthView;\n};\n\nexport const getYearOptions = (range) =>\n generateYearList(range)\n .map((item) => comboBoxItemTpl({ label: item, dataId: item, dataName: item }))\n .join('');\n\nexport const getMonthsOptions = (customMonths = months) =>\n customMonths\n .map((item, index) => comboBoxItemTpl({ label: item, dataId: index + 1, dataName: item }))\n .join('');\n\nexport const isViewVisible = (selectionEpoch, previewEpoch) => {\n const [previewYear, previewMonth] = getPartsFromEpoch(previewEpoch);\n const [selectedYear, selectedMonth] = getPartsFromEpoch(selectionEpoch);\n return selectedYear === previewYear && selectedMonth === previewMonth;\n};\n\nexport const createInputs = () => {\n const ele = document.createElement('span');\n\n ele.innerHTML = `\n <descope-combo-box\n label-type=\"static\"\n bordered=\"true\"\n item-label-path=\"data-name\"\n item-value-path=\"data-id\"\n class=\"month-input\"\n >\n ${getMonthsOptions()}\n </descope-combo-box>\n <descope-combo-box\n allow-custom-value=\"true\"\n label-type=\"static\"\n bordered=\"true\"\n item-label-path=\"data-name\"\n item-value-path=\"data-id\"\n class=\"year-input\"\n no-empty-value=\"true\"\n >\n </descope-combo-box>\n `;\n\n return ele;\n};\n\nexport const initComboBox = (input, onChange, onBlur) => {\n input.addEventListener('input', onChange);\n input.addEventListener('focusout', onBlur);\n return input;\n};\n\nexport const ensureMonthNamesArr = (attrVal) => {\n const monthArr = attrVal?.split(',');\n return isValidAttrArr(monthArr, 12) ? monthArr : months;\n};\n\nexport const ensureWeekdayNamesArr = (attrVal) => {\n const customWeekdayArr = attrVal?.split?.(',');\n const isCustomValid = isValidAttrArr(customWeekdayArr, 7);\n return isCustomValid ? customWeekdayArr : weekdays;\n};\n\nexport const ensureShortWeekdayNamesArr = (attrVal) => {\n const customShortWeekdays = attrVal;\n\n if (!attrVal || !isValidAttrArr(customShortWeekdays, 7)) {\n return weekdays.map((d) => d.substring(0, 3));\n }\n\n return customShortWeekdays.map((d) => d.substring(0, 3));\n};\n\nexport const truncateWeekdays = (arr) => arr.map((d) => d.substring(0, 3));\n\nexport const prevMonth = (epoch) => {\n const date = newDate(epoch);\n const month = date.getMonth();\n\n if (month === 0) {\n const year = date.getFullYear();\n date.setFullYear(year - 1);\n date.setMonth(11);\n } else {\n date.setMonth(month - 1);\n }\n\n return date;\n};\n\nexport const nextMonth = (epoch) => {\n const date = newDate(epoch);\n const month = date.getMonth();\n\n if (month === 11) {\n const year = date.getFullYear();\n date.setFullYear(year + 1);\n date.setMonth(0);\n } else {\n date.setMonth(month + 1);\n }\n\n return date;\n};\n","import { ButtonClass } from '@descope-ui/descope-button/class';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\nimport { createBaseInputClass } from '../../../baseClasses/createBaseInputClass';\nimport { compose } from '../../../helpers';\nimport { forwardAttrs, getComponentName } from '../../../helpers/componentHelpers';\nimport { inputFloatingLabelStyle } from '../../../helpers/themeHelpers/resetHelpers';\nimport { componentNameValidationMixin, createStyleMixin, draggableMixin } from '../../../mixins';\nimport {\n getCurrentDay,\n getPartsFromEpoch,\n isValidEpoch,\n formatEpoch,\n getCurrentTime,\n getFullYear,\n getMonth,\n} from '../helpers';\nimport { arrowLeftIcon, arrowRightIcon } from '../icons';\nimport {\n BUTTON_LABEL_CANCEL,\n BUTTON_LABEL_DONE,\n CALENDAR_LABEL_TODAY,\n NATIVE_FORMAT,\n YEARS_RANGE,\n} from '../consts';\nimport {\n createMonthView,\n createInputs,\n getMonthsOptions,\n getYearOptions,\n initComboBox,\n ensureMonthNamesArr,\n isViewVisible,\n ensureWeekdayNamesArr,\n truncateWeekdays,\n prevMonth,\n nextMonth,\n} from './helpers';\nimport { newDate } from '../date-utils';\n\nexport const componentName = getComponentName('calendar');\n\nconst observedAttrs = [\n 'initial-value',\n 'initial-year',\n 'initial-month',\n 'years-range',\n 'calendar-months',\n 'calendar-weekdays',\n 'calendar-label-today',\n 'st-host-direction',\n 'disabled',\n 'full-width',\n];\n\nconst calendarUiAttrs = ['calendar-label-submit', 'calendar-label-cancel'];\n\nconst BaseInputClass = createBaseInputClass({ componentName, baseSelector: 'div' });\n\nclass RawCalendar extends BaseInputClass {\n static get observedAttributes() {\n return [].concat(BaseInputClass.observedAttributes || [], observedAttrs, calendarUiAttrs);\n }\n\n // preview state epoch\n preview;\n\n // value epoch\n epoch;\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div>\n <nav class=\"nav top-nav\">\n <div class=\"nav-prev\">\n </div>\n <div class=\"selectors\"></div>\n <div class=\"nav-next\">\n </div>\n </nav>\n <div class=\"calendar\"></div>\n <nav class=\"nav bottom-nav\">\n <descope-button class=\"cancel-button\" variant=\"link\" mode=\"primary\">Cancel</descope-button>\n <descope-button class=\"submit-button\" variant=\"link\" mode=\"primary\" disabled=\"true\">Done</descope-button>\n </nav>\n </div>\n `;\n\n injectStyle(\n `\n :host {\n display: inline-block;\n box-sizing: border-box;\n max-width: 100%;\n user-select: none;\n -webkit-user-select: none;\n }\n\n :host ::slotted {\n padding: 0;\n }\n\n [data-toggle-calendar] {\n cursor: pointer;\n display: flex;\n align-self: center;\n z-index: 1;\n }\n\n [data-disabled=\"true\"] {\n pointer-events: none;\n }\n\n .calendar .day {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .nav {\n display: flex;\n align-items: center;\n box-sizing: border-box;\n }\n\n .selectors,\n .selectors span {\n display: flex;\n justify-content: center;\n }\n\n descope-button {\n padding: 0;\n ${ButtonClass.cssVarList.horizontalPadding}: 0;\n ${ButtonClass.cssVarList.verticalPadding}: 0;\n ${ButtonClass.cssVarList.outlineWidth}: 0;\n }\n\n .combo-box-item {\n display:flex;\n flex-direction: column;\n }\n\n ${inputFloatingLabelStyle()}\n `,\n this\n );\n }\n\n set value(val) {\n if (!val) return;\n\n const epoch = newDate(val).getTime();\n\n if (!isValidEpoch(epoch) || epoch === this.epoch) {\n return;\n }\n\n this.epoch = epoch;\n\n this.renderCalendar();\n }\n\n get value() {\n return this.epoch ? formatEpoch(this.epoch, NATIVE_FORMAT) : '';\n }\n\n get isSelectedView() {\n return isViewVisible(this.preview, this.epoch);\n }\n\n get isTodayView() {\n return isViewVisible(getCurrentTime(), this.preview);\n }\n\n get monthNames() {\n return ensureMonthNamesArr(this.getAttribute('calendar-months'));\n }\n\n get weekdayNames() {\n return ensureWeekdayNamesArr(this.getAttribute('calendar-weekdays'));\n }\n\n get hasYearValue() {\n return !!this.yearInput.value;\n }\n\n get hasMonthValue() {\n return !!this.monthInput.value;\n }\n\n get yearsRange() {\n const range = this.getAttribute('years-range')?.split('-');\n\n if (range?.length === 2) {\n const [start, end] = range.map(Number);\n if (start <= end) return [start, end];\n }\n\n const currentYear = newDate().getFullYear();\n\n return [currentYear, currentYear + YEARS_RANGE];\n }\n\n init() {\n super.init?.();\n this.initCalendar();\n this.renderCalendar();\n }\n\n initCalendar() {\n this.calendar = this.shadowRoot.querySelector('.calendar');\n\n this.navPrevEle = this.shadowRoot.querySelector('.nav-prev');\n this.navNextEle = this.shadowRoot.querySelector('.nav-next');\n this.submitButton = this.shadowRoot.querySelector('.submit-button');\n this.cancelButton = this.shadowRoot.querySelector('.cancel-button');\n\n this.initInputs();\n this.initNav();\n\n this.addEventListener('day-changed', () => this.submitButton.removeAttribute('disabled'));\n // This is a workaround for descope-components inside Vaadin's Popover component.\n // When we sync attributes, the `disabled` attribute is being compared to the attribute\n // on Vaadin component; since the Vaadin component has no `disabled` attribute, we sync\n // that back to our component. This happens when using Popover, and for specific attributes,\n // namely `disabled`. This is pending a more generic fix in the way we sync attibutes.\n this.submitButton.shadowRoot.querySelector('vaadin-button').setAttribute('disabled', 'true');\n }\n\n initInputs() {\n const ele = createInputs(this.monthNames, this.yearsRange);\n this.shadowRoot.querySelector('.selectors').appendChild(ele);\n\n this.monthInput = initComboBox(\n this.shadowRoot.querySelector('.month-input'),\n this.onMonthChange.bind(this),\n this.onMonthInputBlur.bind(this)\n );\n\n this.yearInput = initComboBox(\n this.shadowRoot.querySelector('.year-input'),\n this.onYearChange.bind(this),\n this.onYearInputBlur.bind(this)\n );\n\n [this.monthInput, this.yearInput].forEach((selector) =>\n forwardAttrs(this, selector, {\n includeAttrs: ['disabled', 'size', 'st-host-direction'],\n })\n );\n }\n\n initNav() {\n this.navPrevEle.addEventListener('click', this.navPrevMonth.bind(this));\n this.navNextEle.addEventListener('click', this.navNextMonth.bind(this));\n this.cancelButton.addEventListener('click', this.onCancel.bind(this));\n this.submitButton.addEventListener('click', this.onSubmit.bind(this));\n\n [this.navPrevEle, this.navNextEle].forEach((btn) =>\n forwardAttrs(this, btn, {\n includeAttrs: ['size'],\n })\n );\n\n this.shadowRoot.querySelector('.nav-next').innerHTML = arrowRightIcon;\n this.shadowRoot.querySelector('.nav-prev').innerHTML = arrowLeftIcon;\n }\n\n onSubmit() {\n if (this.isDisabled) return;\n if (!this.value) return;\n this.dispatchEvent(new CustomEvent('date-submit', { detail: newDate(this.preview) }));\n }\n\n onCancel() {\n if (this.isDisabled) return;\n this.dispatchEvent(new CustomEvent('cancel'));\n this.dispatchEvent(new CustomEvent('date-cancel'));\n this.clearSelectedDay();\n }\n\n clearSelectedDay() {\n this.getSelectedDayEle()?.removeAttribute('data-selected');\n this.submitButton.setAttribute('disabled', 'true');\n this.epoch = '';\n }\n\n updateInputs() {\n if (this.yearInput && this.monthInput) {\n const epoch = this.preview || getCurrentTime();\n const year = getFullYear(epoch);\n const month = getMonth(epoch);\n this.monthInput.value = month;\n // For the yearInput we update the base element directly to properly trigger the change event\n // since this can be a custom value\n setTimeout(() => {\n this.yearInput.baseElement.value = year;\n });\n }\n }\n\n renderCalendar() {\n const date = newDate(this.preview || getCurrentTime());\n const epoch = date.getTime();\n\n const [year, month] = getPartsFromEpoch(epoch);\n\n if (this.calendar) {\n this.calendar.innerHTML = createMonthView(year, month, truncateWeekdays(this.weekdayNames));\n }\n\n Array.from(this.calendar?.querySelectorAll('.day-entry .day') || []).forEach((ele) =>\n ele.addEventListener('click', this.onDayChange.bind(this))\n );\n\n this.updateInputs();\n this.setSelectedDay();\n this.setCurrentDay();\n }\n\n onDayChange(e) {\n if (this.isDisabled) return;\n const date = newDate(this.preview);\n date.setDate(Number(e.target.getAttribute('data-date-day')));\n this.value = formatEpoch(date.getTime(), NATIVE_FORMAT);\n this.dispatchEvent(new CustomEvent('day-changed', { detail: date }));\n }\n\n onYearChange(e) {\n if (!e.target.value) return;\n const date = newDate(this.preview);\n date.setFullYear(Number(e.target.value.trim()));\n this.preview = date.getTime();\n this.renderCalendar();\n this.dispatchEvent(new CustomEvent('year-changed', { detail: date }));\n }\n\n onMonthChange(e) {\n if (!e.target.value) return;\n const date = newDate(this.preview);\n date.setMonth(Number(e.target.value) - 1);\n this.preview = date.getTime();\n this.renderCalendar();\n this.dispatchEvent(new CustomEvent('month-changed', { detail: date }));\n }\n\n onYearInputBlur(e) {\n this.yearInput.baseElement.value = e.target.value || getFullYear(this.preview);\n }\n\n onMonthInputBlur(e) {\n this.monthInput.baseElement.value = e.target.value || getMonth(this.preview);\n }\n\n getSelectedDayEle() {\n const day = newDate(this.epoch).getDate();\n return this.calendar?.querySelector(`[data-date-day=\"${day}\"]`);\n }\n\n getCurrentDayEle() {\n return this.calendar?.querySelector(`[data-date-day=\"${getCurrentDay()}\"]`);\n }\n\n clearSelectedDays() {\n const cells = this.calendar?.querySelectorAll(`[data-selected]`);\n if (!cells) return;\n cells.forEach((c) => c.removeAttribute('data-selected'));\n }\n\n setSelectedDay() {\n this.clearSelectedDays();\n if (this.value && this.isSelectedView) {\n this.getSelectedDayEle().setAttribute('data-selected', 'true');\n }\n }\n\n setCurrentDay() {\n if (this.isTodayView) {\n const ele = this.getCurrentDayEle();\n const title = this.getAttribute('calendar-label-today') || CALENDAR_LABEL_TODAY;\n ele?.setAttribute('data-current-day', 'true');\n ele?.setAttribute('title', title);\n }\n }\n\n navPrevMonth() {\n if (this.isDisabled) {\n return;\n }\n const date = prevMonth(this.preview);\n this.preview = date.getTime();\n this.renderCalendar();\n }\n\n navNextMonth() {\n if (this.isDisabled) {\n return;\n }\n const date = nextMonth(this.preview);\n this.preview = date.getTime();\n this.renderCalendar();\n }\n\n clearValue() {\n this.epoch = '';\n this.value = '';\n this.removeAttribute('preview');\n this.submitButton.setAttribute('disabled', 'true');\n }\n\n onInitialValueChange(newValue) {\n // if component already has a value don't re-set value\n if (this.value) {\n return;\n }\n\n const date = newDate(newValue);\n const epoch = date.getTime();\n\n if (isValidEpoch(epoch)) {\n this.epoch = epoch;\n this.preview = epoch;\n } else {\n this.clearValue();\n }\n }\n\n onYearsRangeChange() {\n setTimeout(() => {\n if (this.yearInput) {\n this.yearInput.innerHTML = getYearOptions(this.yearsRange);\n }\n });\n }\n\n onMonthNamesChange() {\n setTimeout(() => {\n if (this.monthInput) {\n this.monthInput.innerHTML = getMonthsOptions(this.monthNames);\n }\n });\n }\n\n onSubmitLabelChange(newValue) {\n if (this.submitButton) {\n this.submitButton.textContent = newValue || BUTTON_LABEL_DONE;\n }\n }\n\n onCancelLabelChange(newValue) {\n if (this.cancelButton) {\n this.cancelButton.textContent = newValue || BUTTON_LABEL_CANCEL;\n }\n }\n\n onInitialMonthChange(val) {\n const currYear = getFullYear(this.preview);\n this.preview = newDate(`${currYear}/${val}/1`).getTime();\n }\n\n onInitialYearChange(val) {\n const currMonth = getMonth(this.preview);\n this.preview = newDate(`${val}/${currMonth}/1`).getTime();\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback(attrName, oldValue, newValue);\n if (oldValue !== newValue) {\n // attrs for which affect static ui parts doesn't require calendar re-render\n if (calendarUiAttrs.includes(attrName)) {\n if (attrName === 'calendar-label-submit') {\n this.onSubmitLabelChange(newValue);\n }\n if (attrName === 'calendar-label-cancel') {\n this.onCancelLabelChange(newValue);\n }\n } else {\n // we want to render the calendar for each of these attr change\n\n if (newValue && attrName === 'initial-value') {\n this.onInitialValueChange(newValue);\n }\n if (newValue && attrName === 'initial-month') {\n this.onInitialMonthChange(newValue);\n }\n if (newValue && attrName === 'initial-year') {\n this.onInitialYearChange(newValue);\n }\n if (attrName === 'years-range') {\n this.onYearsRangeChange(Number(newValue));\n }\n if (attrName === 'calendar-months') {\n this.onMonthNamesChange();\n }\n if (attrName === 'calendar-label-today') {\n this.setCurrentDay(newValue);\n }\n if (attrName === 'disabled') {\n setTimeout(() => {\n this.cancelButton?.setAttribute('disabled', newValue === 'true');\n });\n }\n\n this.renderCalendar();\n }\n }\n }\n\n getValidity() {\n if (this.isRequired && !this.value) {\n return { valueMissing: true };\n }\n return {};\n }\n}\n\nconst {\n calendar,\n day,\n dayEntry,\n currentDay,\n selectedDay,\n disabledDay,\n weekday,\n topNav,\n topNavSelectors,\n bottomNav,\n navPrev,\n navNext,\n navPrevRTL,\n navNextRTL,\n yearInput,\n monthInput,\n} = {\n calendar: { selector: () => '.calendar' },\n topNav: { selector: () => '.nav.top-nav' },\n topNavSelectors: { selector: () => '.nav.top-nav .selectors > span' },\n bottomNav: { selector: () => '.nav.bottom-nav' },\n day: { selector: () => '.day' },\n dayEntry: { selector: () => '.day-entry' },\n currentDay: { selector: () => '.day-entry[data-current-day] .day' },\n selectedDay: { selector: () => '.day-entry[data-selected] .day' },\n disabledDay: { selector: () => '.day-entry[data-disabled=\"true\"] .day' },\n weekday: { selector: () => '.weekday' },\n navPrev: { selector: () => '.nav-prev' },\n navNext: { selector: () => '.nav-next' },\n navPrevRTL: { selector: () => ':host([st-host-direction=\"rtl\"]) .nav-prev' },\n navNextRTL: { selector: () => ':host([st-host-direction=\"rtl\"]) .nav-next' },\n yearInput: { selector: () => '.year-input' },\n monthInput: { selector: () => '.month-input' },\n};\n\nexport const CalendarClass = compose(\n createStyleMixin({ componentNameOverride: getComponentName('input-wrapper') }),\n createStyleMixin({\n mappings: {\n fontSize: {},\n fontFamily: {},\n hostWidth: [\n { selector: () => ':host', property: 'width' },\n { selector: 'table', property: 'width' },\n ],\n hostDirection: { property: 'direction' },\n\n topNavVerticalPadding: [\n { ...topNav, property: 'padding-top' },\n { ...topNav, property: 'padding-bottom' },\n ],\n topNavHorizointalPadding: [\n { ...topNav, property: 'padding-right' },\n { ...topNav, property: 'padding-left' },\n ],\n topNavAlignment: { ...topNav, property: 'justify-content' },\n topNavGap: { ...topNav, property: 'gap' },\n topNavSelectorsGap: { ...topNavSelectors, property: 'gap' },\n\n bottomNavVerticalPadding: [\n { ...bottomNav, property: 'padding-top' },\n { ...bottomNav, property: 'padding-bottom' },\n ],\n bottomNavHorizontalPadding: [\n { ...bottomNav, property: 'padding-right' },\n { ...bottomNav, property: 'padding-left' },\n ],\n bottomNavAlignment: { ...bottomNav, property: 'justify-content' },\n bottomNavGap: { ...bottomNav, property: 'gap' },\n\n navMarginBottom: { ...topNav, property: 'margin-bottom' },\n\n calendarPadding: [\n { ...calendar, property: 'padding-bottom' },\n { ...calendar, property: 'padding-right' },\n { ...calendar, property: 'padding-left' },\n ],\n\n navBorderBottomWidth: { ...topNav, property: 'border-bottom-width' },\n navBorderBottomColor: { ...topNav, property: 'border-bottom-color' },\n navBorderBottomStyle: { ...topNav, property: 'border-bottom-style' },\n\n weekdayFontSize: { ...weekday, property: 'font-size' },\n weekdayFontWeight: { ...weekday, property: 'font-weight' },\n\n currentDayBorderColor: {\n ...currentDay,\n property: 'border-color',\n },\n currentDayBorderWidth: {\n ...currentDay,\n property: 'border-width',\n },\n currentDayBorderStyle: {\n ...currentDay,\n property: 'border-style',\n },\n\n dayHeight: { ...dayEntry, property: 'height' },\n daySize: [\n { ...day, property: 'height' },\n { ...day, property: 'width' },\n ],\n dayPadding: { ...day, property: 'padding' },\n dayRadius: { ...day, property: 'border-radius' },\n dayTextAlign: { ...day, property: 'text-align' },\n dayBlockAlign: { ...day, property: 'margin' },\n dayTextColor: { ...day, property: 'color' },\n dayFontWeight: { ...day, property: 'font-weight' },\n dayBackgroundColor: { ...day, property: 'background-color' },\n dayCursor: { ...day, property: 'cursor' },\n dayFontSize: { ...day, property: 'font-size' },\n\n dayBackgroundColorHover: {\n selector: () => '.day:hover',\n property: 'background-color',\n },\n\n daySelectedTextdColor: {\n ...selectedDay,\n property: 'color',\n },\n daySelectedBackgroundColor: {\n ...selectedDay,\n property: 'background-color',\n },\n dayDisabledTextdColor: {\n ...disabledDay,\n property: 'color',\n },\n\n yearInputWidth: { ...yearInput, property: 'width' },\n monthInputWidth: { ...monthInput, property: 'width' },\n\n navButtonSize: [\n { ...navPrev, property: 'width' },\n { ...navPrev, property: 'height' },\n { ...navNext, property: 'width' },\n { ...navNext, property: 'height' },\n ],\n navButtonCursor: [\n { ...navPrev, property: 'cursor' },\n { ...navNext, property: 'cursor' },\n ],\n navButtonRotation: [\n { ...navPrevRTL, property: 'transform' },\n { ...navNextRTL, property: 'transform' },\n ],\n navButtonOpacity: [\n { ...navPrev, property: 'opacity' },\n { ...navNext, property: 'opacity' },\n ],\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(RawCalendar);\n","import '@descope-ui/descope-combo-box';\nimport '@descope-ui/descope-button';\n\nimport { componentName, CalendarClass } from './CalendarClass';\n\ncustomElements.define(componentName, CalendarClass);\n\nexport { CalendarClass, componentName };\n","import { DIVIDER, SUPPORTED_FORMATS } from './consts';\nimport { newDate } from './date-utils';\n\nconst patterns = {\n MM: '(0?[1-9]|1[0-2])',\n DD: '(0?[1-9]|[12][0-9]|3[01])',\n YYYY: '([0-9]{4})',\n};\n\nconst createPattern = (format) => {\n const pattern = format\n .split(DIVIDER)\n .map((part) => patterns[part])\n .join('\\\\D');\n\n return `^${pattern}$`;\n};\n\nconst createToValuesFn = (format) => {\n const order = format.split(DIVIDER);\n return (match) => {\n const values = {};\n order.forEach((part, index) => {\n values[part] = match[index + 1];\n });\n return [values.YYYY, values.MM, values.DD];\n };\n};\n\nconst createDate = (val, regexp, toValuesFn) => {\n const match = regexp.exec(val);\n if (!match) return null;\n const [year, month, day] = toValuesFn(match);\n return newDate([year, month, day].join(DIVIDER));\n};\n\nconst createFormat = (format) => {\n const pattern = createPattern(format);\n const toValuesFn = createToValuesFn(format);\n const regexp = new RegExp(pattern);\n\n return {\n pattern,\n validate: (val) => regexp.test(val),\n getDate: (val) => createDate(val, regexp, toValuesFn),\n };\n};\n\nexport const formats = Object.fromEntries(SUPPORTED_FORMATS.map((f) => [f, createFormat(f)]));\n","import { formats } from './formats';\nimport { newDate } from './date-utils';\n\nexport const isValidEpoch = (val) => !Number.isNaN(Number(val));\n\nexport const isNumber = (val) => !!String(val || '').trim() && !Number.isNaN(Number(val));\n\nexport const getPartsFromEpoch = (epoch) => {\n const date = newDate(epoch);\n const year = date.getFullYear();\n const month = date.getMonth() + 1;\n const day = date.getDate();\n return [year, month, day];\n};\n\nexport const formatEpoch = (epoch, format) => {\n const [year, month, day] = getPartsFromEpoch(epoch);\n\n const parts = {\n DD: String(day).padStart(2, '0'),\n MM: String(month).padStart(2, '0'),\n YYYY: String(year),\n };\n\n return format.replace(/DD|MM|YYYY/g, (match) => parts[match]);\n};\n\nexport const getCurrentTime = () => newDate().getTime();\nexport const getFullYear = (epoch) => newDate(epoch).getFullYear().toString();\nexport const getMonth = (epoch) => (newDate(epoch).getMonth() + 1).toString();\nexport const getCurrentDay = () => newDate().getDate();\nexport const getCurrentYear = () => newDate().getFullYear().toString();\n\n// Vaadin uses \"constructed stylesheet\" to hide the host in dialog components.\n// To override it, we need to push an overriding constructed stylesheet to the shadow DOM\n// opened issue in vaadin: https://github.com/vaadin/web-components/issues/7979\nexport const overrideConstructedStylesheet = (ele) => {\n const cs = new CSSStyleSheet();\n cs.insertRule(':host{display:block!important;}');\n ele?.shadowRoot?.adoptedStyleSheets?.push(cs);\n};\n\nexport const parseDateString = (val, format) => {\n const trimmed = val.trim?.();\n if (!trimmed) return null;\n return formats[format].getDate(trimmed);\n};\n\nexport const dateToEpoch = (date, isUtc) => {\n // If it's already a number (epoch), return it directly - no conversion needed\n if (typeof date === 'number') {\n return date;\n }\n\n if (isUtc) {\n return Date.UTC(date.getFullYear(), date.getMonth(), date.getDate());\n }\n\n // Default: return epoch in local timezone\n return date.getTime();\n};\n","export const calendarIcon = `\n<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M9 5H15V4.50468C15 4.21404 15.226 4 15.5047 4H16.4953C16.786 4 17 4.22595 17 4.50468V5H18.7568C19.3028 5 19.75 5.44725 19.75 5.99896V7.00104C19.75 7.55734 19.3053 8 18.7568 8H5.24317C4.69717 8 4.25 7.55275 4.25 7.00104V5.99896C4.25 5.44266 4.69466 5 5.24317 5H7V4.50468C7 4.21404 7.22596 4 7.50468 4H8.49532C8.78596 4 9 4.22595 9 4.50468V5ZM5.50468 9H6.49532C6.78596 9 7 9.22596 7 9.50468V10.4953C7 10.786 6.77404 11 6.49532 11H5.50468C5.21404 11 5 10.774 5 10.4953V9.50468C5 9.21404 5.22595 9 5.50468 9ZM8.50468 9H9.49532C9.78596 9 10 9.22596 10 9.50468V10.4953C10 10.786 9.77404 11 9.49532 11H8.50468C8.21404 11 8 10.774 8 10.4953V9.50468C8 9.21404 8.22596 9 8.50468 9ZM11.5047 9H12.4953C12.786 9 13 9.22596 13 9.50468V10.4953C13 10.786 12.774 11 12.4953 11H11.5047C11.214 11 11 10.774 11 10.4953V9.50468C11 9.21404 11.226 9 11.5047 9ZM5.50468 12H6.49532C6.78596 12 7 12.226 7 12.5047V13.4953C7 13.786 6.77404 14 6.49532 14H5.50468C5.21404 14 5 13.774 5 13.4953V12.5047C5 12.214 5.22595 12 5.50468 12ZM8.50468 12H9.49532C9.78596 12 10 12.226 10 12.5047V13.4953C10 13.786 9.77404 14 9.49532 14H8.50468C8.21404 14 8 13.774 8 13.4953V12.5047C8 12.214 8.22596 12 8.50468 12ZM11.5047 12H12.4953C12.786 12 13 12.226 13 12.5047V13.4953C13 13.786 12.774 14 12.4953 14H11.5047C11.214 14 11 13.774 11 13.4953V12.5047C11 12.214 11.226 12 11.5047 12ZM5.50468 15H6.49532C6.78596 15 7 15.226 7 15.5047V16.4953C7 16.786 6.77404 17 6.49532 17H5.50468C5.21404 17 5 16.774 5 16.4953V15.5047C5 15.214 5.22595 15 5.50468 15ZM8.50468 15H9.49532C9.78596 15 10 15.226 10 15.5047V16.4953C10 16.786 9.77404 17 9.49532 17H8.50468C8.21404 17 8 16.774 8 16.4953V15.5047C8 15.214 8.22596 15 8.50468 15ZM11.5047 15H12.4953C12.786 15 13 15.226 13 15.5047V16.4953C13 16.786 12.774 17 12.4953 17H11.5047C11.214 17 11 16.774 11 16.4953V15.5047C11 15.214 11.226 15 11.5047 15ZM14.5047 9H15.4953C15.786 9 16 9.22596 16 9.50468V10.4953C16 10.786 15.774 11 15.4953 11H14.5047C14.214 11 14 10.774 14 10.4953V9.50468C14 9.21404 14.226 9 14.5047 9ZM14.5047 12H15.4953C15.786 12 16 12.226 16 12.5047V13.4953C16 13.786 15.774 14 15.4953 14H14.5047C14.214 14 14 13.774 14 13.4953V12.5047C14 12.214 14.226 12 14.5047 12ZM14.5047 15H15.4953C15.786 15 16 15.226 16 15.5047V16.4953C16 16.786 15.774 17 15.4953 17H14.5047C14.214 17 14 16.774 14 16.4953V15.5047C14 15.214 14.226 15 14.5047 15ZM17.5047 15H18.4953C18.786 15 19 15.226 19 15.5047V16.4953C19 16.786 18.774 17 18.4953 17H17.5047C17.214 17 17 16.774 17 16.4953V15.5047C17 15.214 17.226 15 17.5047 15ZM5.50468 18H6.49532C6.78596 18 7 18.226 7 18.5047V19.4953C7 19.786 6.77404 20 6.49532 20H5.50468C5.21404 20 5 19.774 5 19.4953V18.5047C5 18.214 5.22595 18 5.50468 18ZM8.50468 18H9.49532C9.78596 18 10 18.226 10 18.5047V19.4953C10 19.786 9.77404 20 9.49532 20H8.50468C8.21404 20 8 19.774 8 19.4953V18.5047C8 18.214 8.22596 18 8.50468 18ZM11.5047 18H12.4953C12.786 18 13 18.226 13 18.5047V19.4953C13 19.786 12.774 20 12.4953 20H11.5047C11.214 20 11 19.774 11 19.4953V18.5047C11 18.214 11.226 18 11.5047 18ZM14.5047 18H15.4953C15.786 18 16 18.226 16 18.5047V19.4953C16 19.786 15.774 20 15.4953 20H14.5047C14.214 20 14 19.774 14 19.4953V18.5047C14 18.214 14.226 18 14.5047 18ZM17.5047 18H18.4953C18.786 18 19 18.226 19 18.5047V19.4953C19 19.786 18.774 20 18.4953 20H17.5047C17.214 20 17 19.774 17 19.4953V18.5047C17 18.214 17.226 18 17.5047 18ZM17.5047 12H18.4953C18.786 12 19 12.226 19 12.5047V13.4953C19 13.786 18.774 14 18.4953 14H17.5047C17.214 14 17 13.774 17 13.4953V12.5047C17 12.214 17.226 12 17.5047 12ZM17.5047 9H18.4953C18.786 9 19 9.22596 19 9.50468V10.4953C19 10.786 18.774 11 18.4953 11H17.5047C17.214 11 17 10.774 17 10.4953V9.50468C17 9.21404 17.226 9 17.5047 9Z\" fill=\"#808080\"/>\n</svg>\n`;\n\nexport const arrowRightIcon = `\n<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M9.27283 6.78069C8.87912 6.34164 8.91587 5.66655 9.35492 5.27283C9.79397 4.87912 10.4691 4.91587 10.8628 5.35492C10.8628 5.35492 16.0022 10.9543 16.366 11.36C16.7298 11.7657 16.7298 12.2392 16.366 12.6448L10.8628 18.6451C10.4691 19.0841 9.79397 19.1209 9.35492 18.7272C8.91587 18.3334 8.87912 17.6584 9.27283 17.2193L14.1368 12L9.27283 6.78069Z\" fill=\"#808080\"/>\n</svg>`;\n\nexport const arrowLeftIcon = `<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M14.7272 17.2193C15.1209 17.6584 15.0841 18.3334 14.6451 18.7272C14.206 19.1209 13.5309 19.0841 13.1372 18.6451C13.1372 18.6451 7.99776 13.0457 7.63399 12.64C7.27023 12.2343 7.27023 11.7608 7.63399 11.3552L13.1372 5.35492C13.5309 4.91587 14.206 4.87912 14.6451 5.27283C15.0841 5.66655 15.1209 6.34164 14.7272 6.78069L9.86322 12L14.7272 17.2193Z\" fill=\"#808080\"/>\n</svg>`;\n"],"names":["componentName","host","label","slottedIcon","selector","loadingIndicatorStyles","ButtonClass","triggers","attr","value","mappings","hostWidth","property","hostHeight","hostDirection","fontSize","fontFamily","fontWeight","cursor","backgroundColor","outlineOffset","outlineColor","outlineStyle","outlineWidth","borderRadius","borderColor","borderStyle","borderWidth","verticalPadding","horizontalPadding","fallback","labelTextColor","iconColor","cssVarList","fill","labelTextDecoration","labelSpacing","textAlign","iconSize","slots","wrappedEleName","style","excludeAttrsSync","color","clickableMixin","superclass","isLoading","this","getAttribute","click","super","customElements","define","IconClass","height","width","srcAttrs","RawImage","baseSelector","observedAttributes","constructor","attachShadow","mode","innerHTML","init","toggleVisibility","getSrc","onThemeChange","renderImage","isVisible","classList","remove","add","altText","legacySrc","themeSrc","currentThemeName","updateFillColor","node","querySelectorAll","forEach","ele","setAttribute","ImageClass","then","res","appendChild","shouldRender","src","srcVal","attributeChangedCallback","attrName","oldValue","newValue","createSvgEle","text","clean","sanitize","USE_PROFILES","svg","svgFilters","ADD_TAGS","FORBID_TAGS","DOMParser","parseFromString","querySelector","createImage","async","startsWith","isBase64Svg","svgXml","atob","slice","base64Prefix","path","match","getFileExtension","fetchedSrc","fetch","document","createElement","createImgEle","setProperty","createBaseInputClass","args","SUPPORTED_FORMATS","DEFAULT_FORMAT","NATIVE_FORMAT","YEARS_RANGE","DIVIDER","months","weekdays","counterConfig","MONTH","id","min","max","placeholder","DAY","YEAR","valRange","year","BUTTON_LABEL_DONE","BUTTON_LABEL_CANCEL","CALENDAR_LABEL_TODAY","MOBILE_DEVICE_INTERACTION_TIMEOUT_MS","newDate","date","isUtcTime","Date","d","replace","UTC","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","getMilliseconds","isValidAttrArr","arr","count","Array","isArray","length","filter","Boolean","comboBoxItemTpl","dataId","dataName","getMonthsOptions","customMonths","map","item","index","join","isViewVisible","selectionEpoch","previewEpoch","previewYear","previewMonth","selectedYear","selectedMonth","initComboBox","input","onChange","onBlur","addEventListener","observedAttrs","calendarUiAttrs","BaseInputClass","calendar","day","dayEntry","currentDay","selectedDay","disabledDay","weekday","topNav","topNavSelectors","bottomNav","navPrev","navNext","navPrevRTL","navNextRTL","yearInput","monthInput","CalendarClass","componentNameOverride","topNavVerticalPadding","topNavHorizointalPadding","topNavAlignment","topNavGap","topNavSelectorsGap","bottomNavVerticalPadding","bottomNavHorizontalPadding","bottomNavAlignment","bottomNavGap","navMarginBottom","calendarPadding","navBorderBottomWidth","navBorderBottomColor","navBorderBottomStyle","weekdayFontSize","weekdayFontWeight","currentDayBorderColor","currentDayBorderWidth","currentDayBorderStyle","dayHeight","daySize","dayPadding","dayRadius","dayTextAlign","dayBlockAlign","dayTextColor","dayFontWeight","dayBackgroundColor","dayCursor","dayFontSize","dayBackgroundColorHover","daySelectedTextdColor","daySelectedBackgroundColor","dayDisabledTextdColor","yearInputWidth","monthInputWidth","navButtonSize","navButtonCursor","navButtonRotation","navButtonOpacity","concat","preview","epoch","val","getTime","renderCalendar","isSelectedView","isTodayView","monthNames","attrVal","monthArr","split","ensureMonthNamesArr","weekdayNames","customWeekdayArr","ensureWeekdayNamesArr","hasYearValue","hasMonthValue","yearsRange","range","start","end","Number","currentYear","initCalendar","shadowRoot","navPrevEle","navNextEle","submitButton","cancelButton","initInputs","initNav","removeAttribute","createInputs","onMonthChange","bind","onMonthInputBlur","onYearChange","onYearInputBlur","includeAttrs","navPrevMonth","navNextMonth","onCancel","onSubmit","btn","isDisabled","dispatchEvent","CustomEvent","detail","clearSelectedDay","getSelectedDayEle","updateInputs","month","setTimeout","baseElement","shortWeekdays","daysInMonth","getMaxDaysInMonth","firstDayOfMonth","getDay","monthView","reduce","acc","i","dayOfWeek","createMonthView","substring","from","onDayChange","setSelectedDay","setCurrentDay","e","setDate","target","setFullYear","trim","setMonth","getCurrentDayEle","clearSelectedDays","cells","c","title","prevMonth","nextMonth","clearValue","onInitialValueChange","onYearsRangeChange","years","push","generateYearList","onMonthNamesChange","onSubmitLabelChange","textContent","onCancelLabelChange","onInitialMonthChange","currYear","onInitialYearChange","currMonth","includes","getValidity","isRequired","valueMissing","patterns","MM","DD","YYYY","createFormat","format","pattern","part","createPattern","toValuesFn","order","values","createToValuesFn","regexp","RegExp","validate","test","exec","createDate","formats","Object","fromEntries","f","isValidEpoch","isNaN","isNumber","String","getPartsFromEpoch","formatEpoch","parts","padStart","getCurrentTime","toString","getCurrentDay","overrideConstructedStylesheet","cs","CSSStyleSheet","insertRule","adoptedStyleSheets","parseDateString","trimmed","dateToEpoch","isUtc","calendarIcon","arrowRightIcon","arrowLeftIcon"],"sourceRoot":""}
1
+ {"version":3,"file":"descope-date-field-descope-calendar-index-js.js","mappings":";kOAOO,MAAMA,E,SAAe,EAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCCUxB,MAAMC,EAAeC,GAC1B,eAA+B,QAAY,QAAc,OAAWA,MAClE,qBAAWC,GACT,MAAO,CAOLC,SAAU,CACRC,KAAMC,OACNC,MAAO,EACPC,oBAAoB,GAG1B,CAUA,eAAIC,GACF,MAAO,CAAC,QAAS,IACnB,CAGA,KAAAC,GACEC,MAAMD,QAIDE,KAAKC,aAAa,SACrBD,KAAKE,aAAa,OAAQ,SAE9B,CAiBA,UAAAC,CAAWC,GACTL,MAAMI,WAAWC,GAEbA,EAAMC,QAAUD,EAAME,UAAYF,EAAMG,SAAWH,EAAMI,SAIzDR,KAAKH,YAAYY,SAASL,EAAMM,OAClCN,EAAMO,iBAINX,KAAKY,QAET,ICzEJ,QAAe,gBAAiBxB,EAAc,CAAEyB,SAAU,yBAqC1D,MAAMC,UAAezB,GAAY,QAAa,SAAc,OAAgB,UAC1E,aAAW0B,GACT,MAAO,eACT,CAEA,mBAAWC,GACT,OAAsB,IFYkB;;;;;;;;;;;;;CEX1C,CAGA,KAAAlB,GACEC,MAAMD,QAENE,KAAKiB,mBAAqB,IAAI,IAAkBjB,MAChDA,KAAKkB,cAAclB,KAAKiB,mBAC1B,GAGF,OAAoBH,E,0FC9DpB,MAAMK,EAAS,IAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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MAAO,CAILyC,gBAAiB,CACfvC,KAAMwC,QAGZ,CAOA,gBAAIC,GACF,OAAOlC,KAAKmC,EAAEC,WAChB,CAGA,KAAAtC,GACEC,MAAMD,QAENE,KAAKkB,cACH,IAAI,IAAgBlB,KAAOqC,IACzBrC,KAAKsC,iBAAiBD,GACtBrC,KAAKuC,iBAAiBF,GACtBrC,KAAKwC,YAAcH,EACnBrC,KAAKyC,WAAaJ,KAGtBrC,KAAKkB,cAAc,IAAI,IAAwBlB,KAAK0C,aAAc1C,KAAK2C,mBAEvE3C,KAAKiB,mBAAqB,IAAI,IAAkBjB,MAChDA,KAAKkB,cAAclB,KAAKiB,oBACxBjB,KAAKiB,mBAAmB2B,YAAY,OACpC5C,KAAKiB,mBAAmB4B,cAAc7C,KAAK0C,cAC3C1C,KAAKiB,mBAAmB6B,cAAeC,IAAYA,EAAOC,QAE1DhD,KAAKgC,gBAAkBhC,KAAKiD,WAAWC,cAAc,wBACrDlD,KAAKmD,eAAiBnD,KAAKmC,EAAEiB,YAC/B,CAWA,mBAAAC,CAAoBjD,GAClBA,EAAMkD,kBACNvD,MAAMsD,oBAAoBjD,EAC5B,CAMA,YAAAmD,CAAanD,GACX,MAAMoD,EAAOpD,EAAMqD,gBAGfD,EAAK/C,SAAST,KAAK0D,aAAeF,EAAK/C,SAAST,KAAKgC,mBACvDjC,MAAMwD,aAAanD,EAEvB,GAGF,OAAoB2B,E","sources":["webpack://@descope/web-components-ui/../../../node_modules/@vaadin/button/src/vaadin-button-base.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/button/src/vaadin-button-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/button/src/vaadin-button.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/button/theme/lumo/vaadin-button-styles.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/combo-box/theme/lumo/vaadin-combo-box-styles.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/combo-box/src/vaadin-combo-box-item.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/combo-box/src/vaadin-combo-box-overlay.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/combo-box/src/vaadin-combo-box-scroller.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/field-base/src/pattern-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/combo-box/src/vaadin-combo-box.js"],"sourcesContent":["/**\n * @license\n * Copyright (c) 2017 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { css } from 'lit';\n\nexport const buttonStyles = css`\n :host {\n display: inline-block;\n position: relative;\n outline: none;\n white-space: nowrap;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n }\n\n :host([hidden]) {\n display: none !important;\n }\n\n /* Aligns the button with form fields when placed on the same line.\n Note, to make it work, the form fields should have the same \"::before\" pseudo-element. */\n .vaadin-button-container::before {\n content: '\\\\2003';\n display: inline-block;\n width: 0;\n max-height: 100%;\n }\n\n .vaadin-button-container {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n width: 100%;\n height: 100%;\n min-height: inherit;\n text-shadow: inherit;\n }\n\n [part='prefix'],\n [part='suffix'] {\n flex: none;\n }\n\n [part='label'] {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n @media (forced-colors: active) {\n :host {\n outline: 1px solid;\n outline-offset: -1px;\n }\n\n :host([focused]) {\n outline-width: 2px;\n }\n\n :host([disabled]) {\n outline-color: GrayText;\n }\n }\n`;\n\nexport const buttonTemplate = (html) => html`\n <div class=\"vaadin-button-container\">\n <span part=\"prefix\" aria-hidden=\"true\">\n <slot name=\"prefix\"></slot>\n </span>\n <span part=\"label\">\n <slot></slot>\n </span>\n <span part=\"suffix\" aria-hidden=\"true\">\n <slot name=\"suffix\"></slot>\n </span>\n </div>\n <slot name=\"tooltip\"></slot>\n`;\n","/**\n * @license\n * Copyright (c) 2017 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { ActiveMixin } from '@vaadin/a11y-base/src/active-mixin.js';\nimport { FocusMixin } from '@vaadin/a11y-base/src/focus-mixin.js';\nimport { TabindexMixin } from '@vaadin/a11y-base/src/tabindex-mixin.js';\n\n/**\n * A mixin providing common button functionality.\n *\n * @polymerMixin\n * @mixes ActiveMixin\n * @mixes FocusMixin\n * @mixes TabindexMixin\n */\nexport const ButtonMixin = (superClass) =>\n class ButtonMixinClass extends ActiveMixin(TabindexMixin(FocusMixin(superClass))) {\n static get properties() {\n return {\n /**\n * Indicates whether the element can be focused and where it participates in sequential keyboard navigation.\n *\n * @override\n * @protected\n */\n tabindex: {\n type: Number,\n value: 0,\n reflectToAttribute: true,\n },\n };\n }\n\n /**\n * By default, `Space` is the only possible activation key for a focusable HTML element.\n * Nonetheless, the button is an exception as it can be also activated by pressing `Enter`.\n * See the \"Keyboard Support\" section in https://www.w3.org/TR/wai-aria-practices/examples/button/button.html.\n *\n * @protected\n * @override\n */\n get _activeKeys() {\n return ['Enter', ' '];\n }\n\n /** @protected */\n ready() {\n super.ready();\n\n // By default, if the user hasn't provided a custom role,\n // the role attribute is set to \"button\".\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'button');\n }\n }\n\n /**\n * Since the button component is designed on the base of the `[role=button]` attribute,\n * and doesn't have a native <button> inside, in order to be fully accessible from the keyboard,\n * it should manually fire the `click` event once an activation key is pressed,\n * as it follows from the WAI-ARIA specifications:\n * https://www.w3.org/TR/wai-aria-practices-1.1/#button\n *\n * According to the UI Events specifications,\n * the `click` event should be fired exactly on `keydown`:\n * https://www.w3.org/TR/uievents/#event-type-keydown\n *\n * @param {KeyboardEvent} event\n * @protected\n * @override\n */\n _onKeyDown(event) {\n super._onKeyDown(event);\n\n if (event.altKey || event.shiftKey || event.ctrlKey || event.metaKey) {\n return;\n }\n\n if (this._activeKeys.includes(event.key)) {\n event.preventDefault();\n\n // `DisabledMixin` overrides the standard `click()` method\n // so that it doesn't fire the `click` event when the element is disabled.\n this.click();\n }\n }\n };\n","/**\n * @license\n * Copyright (c) 2017 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { html, PolymerElement } from '@polymer/polymer/polymer-element.js';\nimport { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';\nimport { defineCustomElement } from '@vaadin/component-base/src/define.js';\nimport { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';\nimport { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';\nimport { registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';\nimport { buttonStyles, buttonTemplate } from './vaadin-button-base.js';\nimport { ButtonMixin } from './vaadin-button-mixin.js';\n\nregisterStyles('vaadin-button', buttonStyles, { moduleId: 'vaadin-button-styles' });\n\n/**\n * `<vaadin-button>` is an accessible and customizable button that allows users to perform actions.\n *\n * ```html\n * <vaadin-button>Press me</vaadin-button>\n * ```\n *\n * ### Styling\n *\n * The following shadow DOM parts are available for styling:\n *\n * Part name | Description\n * ----------|-------------\n * `label` | The label (text) inside the button.\n * `prefix` | A slot for content before the label (e.g. an icon).\n * `suffix` | A slot for content after the label (e.g. an icon).\n *\n * The following attributes are available for styling:\n *\n * Attribute | Description\n * -------------|-------------\n * `active` | Set when the button is pressed down, either with mouse, touch or the keyboard.\n * `disabled` | Set when the button is disabled.\n * `focus-ring` | Set when the button is focused using the keyboard.\n * `focused` | Set when the button is focused.\n *\n * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n *\n * @customElement\n * @extends HTMLElement\n * @mixes ButtonMixin\n * @mixes ControllerMixin\n * @mixes ElementMixin\n * @mixes ThemableMixin\n */\nclass Button extends ButtonMixin(ElementMixin(ThemableMixin(ControllerMixin(PolymerElement)))) {\n static get is() {\n return 'vaadin-button';\n }\n\n static get template() {\n return buttonTemplate(html);\n }\n\n /** @protected */\n ready() {\n super.ready();\n\n this._tooltipController = new TooltipController(this);\n this.addController(this._tooltipController);\n }\n}\n\ndefineCustomElement(Button);\n\nexport { Button };\n","import '@vaadin/vaadin-lumo-styles/color.js';\nimport '@vaadin/vaadin-lumo-styles/sizing.js';\nimport '@vaadin/vaadin-lumo-styles/spacing.js';\nimport '@vaadin/vaadin-lumo-styles/style.js';\nimport '@vaadin/vaadin-lumo-styles/typography.js';\nimport { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';\n\nconst button = css`\n :host {\n /* Sizing */\n --lumo-button-size: var(--lumo-size-m);\n min-width: var(--vaadin-button-min-width, calc(var(--_button-size) * 2));\n height: var(--_button-size);\n padding: var(--vaadin-button-padding, 0 calc(var(--_button-size) / 3 + var(--lumo-border-radius-m) / 2));\n margin: var(--vaadin-button-margin, var(--lumo-space-xs) 0);\n box-sizing: border-box;\n /* Style */\n font-family: var(--lumo-font-family);\n font-size: var(--vaadin-button-font-size, var(--lumo-font-size-m));\n font-weight: var(--vaadin-button-font-weight, 500);\n color: var(--_lumo-button-text-color);\n background: var(--_lumo-button-background);\n border: var(--vaadin-button-border, none);\n border-radius: var(--vaadin-button-border-radius, var(--lumo-border-radius-m));\n cursor: var(--lumo-clickable-cursor);\n -webkit-tap-highlight-color: transparent;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n flex-shrink: 0;\n --_button-size: var(--vaadin-button-height, var(--lumo-button-size));\n --_focus-ring-color: var(--vaadin-focus-ring-color, var(--lumo-primary-color-50pct));\n --_focus-ring-width: var(--vaadin-focus-ring-width, 2px);\n /* Used by notification */\n --_lumo-button-background: var(--vaadin-button-background, var(--lumo-contrast-5pct));\n --_lumo-button-text-color: var(--vaadin-button-text-color, var(--lumo-primary-text-color));\n --_lumo-button-primary-background: var(--vaadin-button-primary-background, var(--lumo-primary-color));\n --_lumo-button-primary-text-color: var(--vaadin-button-primary-text-color, var(--lumo-primary-contrast-color));\n }\n\n /* Set only for the internal parts so we don't affect the host vertical alignment */\n [part='label'],\n [part='prefix'],\n [part='suffix'] {\n line-height: var(--lumo-line-height-xs);\n }\n\n [part='label'] {\n padding: calc(var(--lumo-button-size) / 6) 0;\n }\n\n :host([theme~='small']) {\n font-size: var(--lumo-font-size-s);\n --lumo-button-size: var(--lumo-size-s);\n }\n\n :host([theme~='large']) {\n font-size: var(--lumo-font-size-l);\n --lumo-button-size: var(--lumo-size-l);\n }\n\n /* For interaction states */\n :host::before,\n :host::after {\n content: '';\n /* We rely on the host always being relative */\n position: absolute;\n z-index: 1;\n inset: 0;\n background-color: currentColor;\n border-radius: inherit;\n opacity: 0;\n pointer-events: none;\n }\n\n /* Hover */\n\n @media (any-hover: hover) {\n :host(:hover)::before {\n opacity: 0.02;\n }\n }\n\n /* Active */\n\n :host::after {\n transition: opacity 1.4s, transform 0.1s;\n filter: blur(8px);\n }\n\n :host([active])::before {\n opacity: 0.05;\n transition-duration: 0s;\n }\n\n :host([active])::after {\n opacity: 0.1;\n transition-duration: 0s, 0s;\n transform: scale(0);\n }\n\n /* Keyboard focus */\n\n :host([focus-ring]) {\n box-shadow: 0 0 0 var(--_focus-ring-width) var(--_focus-ring-color);\n }\n\n :host([theme~='primary'][focus-ring]) {\n box-shadow: 0 0 0 1px var(--lumo-base-color), 0 0 0 3px var(--lumo-primary-color-50pct);\n }\n\n /* Types (primary, tertiary, tertiary-inline */\n\n :host([theme~='tertiary']),\n :host([theme~='tertiary-inline']) {\n --_background: transparent !important;\n background: var(--vaadin-button-tertiary-background, var(--_background));\n min-width: 0;\n }\n\n :host([theme~='tertiary']) {\n border: var(--vaadin-button-tertiary-border, none);\n color: var(--vaadin-button-tertiary-text-color, var(--lumo-primary-text-color));\n font-weight: var(--vaadin-button-tertiary-font-weight, 500);\n padding: var(--vaadin-button-tertiary-padding, 0 calc(var(--_button-size) / 6));\n }\n\n :host([theme~='tertiary-inline'])::before {\n display: none;\n }\n\n :host([theme~='tertiary-inline']) {\n margin: 0;\n height: auto;\n padding: 0;\n line-height: inherit;\n font-size: inherit;\n }\n\n :host([theme~='tertiary-inline']) [part='label'] {\n padding: 0;\n overflow: visible;\n line-height: inherit;\n }\n\n :host([theme~='primary']) {\n background: var(--_lumo-button-primary-background);\n border: var(--vaadin-button-primary-border, none);\n color: var(--_lumo-button-primary-text-color);\n font-weight: var(--vaadin-button-primary-font-weight, 600);\n min-width: calc(var(--lumo-button-size) * 2.5);\n }\n\n :host([theme~='primary'])::before {\n background-color: black;\n }\n\n @media (any-hover: hover) {\n :host([theme~='primary']:hover)::before {\n opacity: 0.05;\n }\n }\n\n :host([theme~='primary'][active])::before {\n opacity: 0.1;\n }\n\n :host([theme~='primary'][active])::after {\n opacity: 0.2;\n }\n\n /* Colors (success, error, contrast) */\n\n :host([theme~='success']) {\n color: var(--lumo-success-text-color);\n }\n\n :host([theme~='success'][theme~='primary']) {\n background-color: var(--lumo-success-color);\n color: var(--lumo-success-contrast-color);\n }\n\n :host([theme~='error']) {\n color: var(--lumo-error-text-color);\n }\n\n :host([theme~='error'][theme~='primary']) {\n background-color: var(--lumo-error-color);\n color: var(--lumo-error-contrast-color);\n }\n\n :host([theme~='contrast']) {\n color: var(--lumo-contrast);\n }\n\n :host([theme~='contrast'][theme~='primary']) {\n background-color: var(--lumo-contrast);\n color: var(--lumo-base-color);\n }\n\n /* Disabled state. Keep selectors after other color variants. */\n\n :host([disabled]) {\n pointer-events: none;\n color: var(--lumo-disabled-text-color);\n }\n\n :host([theme~='primary'][disabled]) {\n background-color: var(--lumo-contrast-30pct);\n color: var(--lumo-base-color);\n }\n\n :host([theme~='primary'][disabled]) [part] {\n opacity: 0.7;\n }\n\n /* Icons */\n\n [part] ::slotted(vaadin-icon) {\n display: inline-block;\n width: var(--lumo-icon-size-m);\n height: var(--lumo-icon-size-m);\n }\n\n /* Vaadin icons are based on a 16x16 grid (unlike Lumo and Material icons with 24x24), so they look too big by default */\n [part] ::slotted(vaadin-icon[icon^='vaadin:']) {\n padding: 0.25em;\n box-sizing: border-box !important;\n }\n\n [part='prefix'] {\n margin-left: -0.25em;\n margin-right: 0.25em;\n }\n\n [part='suffix'] {\n margin-left: 0.25em;\n margin-right: -0.25em;\n }\n\n /* Icon-only */\n\n :host([theme~='icon']:not([theme~='tertiary-inline'])) {\n min-width: var(--lumo-button-size);\n padding-left: calc(var(--lumo-button-size) / 4);\n padding-right: calc(var(--lumo-button-size) / 4);\n }\n\n :host([theme~='icon']) [part='prefix'],\n :host([theme~='icon']) [part='suffix'] {\n margin-left: 0;\n margin-right: 0;\n }\n\n /* RTL specific styles */\n\n :host([dir='rtl']) [part='prefix'] {\n margin-left: 0.25em;\n margin-right: -0.25em;\n }\n\n :host([dir='rtl']) [part='suffix'] {\n margin-left: -0.25em;\n margin-right: 0.25em;\n }\n\n :host([dir='rtl'][theme~='icon']) [part='prefix'],\n :host([dir='rtl'][theme~='icon']) [part='suffix'] {\n margin-left: 0;\n margin-right: 0;\n }\n`;\n\nregisterStyles('vaadin-button', button, { moduleId: 'lumo-button' });\n\nexport { button };\n","import '@vaadin/input-container/theme/lumo/vaadin-input-container-styles.js';\nimport '@vaadin/vaadin-lumo-styles/font-icons.js';\nimport { inputFieldShared } from '@vaadin/vaadin-lumo-styles/mixins/input-field-shared.js';\nimport { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';\n\nconst comboBox = css`\n :host {\n outline: none;\n }\n\n [part='toggle-button']::before {\n content: var(--lumo-icons-dropdown);\n }\n`;\n\nregisterStyles('vaadin-combo-box', [inputFieldShared, comboBox], { moduleId: 'lumo-combo-box' });\n","/**\n * @license\n * Copyright (c) 2015 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { html, PolymerElement } from '@polymer/polymer/polymer-element.js';\nimport { defineCustomElement } from '@vaadin/component-base/src/define.js';\nimport { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';\nimport { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';\nimport { ComboBoxItemMixin } from './vaadin-combo-box-item-mixin.js';\n\n/**\n * An item element used by the `<vaadin-combo-box>` dropdown.\n *\n * ### Styling\n *\n * The following shadow DOM parts are available for styling:\n *\n * Part name | Description\n * ------------|--------------\n * `checkmark` | The graphical checkmark shown for a selected item\n * `content` | The element that wraps the item content\n *\n * The following state attributes are exposed for styling:\n *\n * Attribute | Description\n * -------------|-------------\n * `selected` | Set when the item is selected\n * `focused` | Set when the item is focused\n *\n * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n *\n * @customElement\n * @mixes ComboBoxItemMixin\n * @mixes ThemableMixin\n * @mixes DirMixin\n * @private\n */\nexport class ComboBoxItem extends ComboBoxItemMixin(ThemableMixin(DirMixin(PolymerElement))) {\n static get template() {\n return html`\n <style>\n :host {\n display: block;\n }\n\n :host([hidden]) {\n display: none;\n }\n </style>\n <span part=\"checkmark\" aria-hidden=\"true\"></span>\n <div part=\"content\">\n <slot></slot>\n </div>\n `;\n }\n\n static get is() {\n return 'vaadin-combo-box-item';\n }\n}\n\ndefineCustomElement(ComboBoxItem);\n","/**\n * @license\n * Copyright (c) 2015 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { html, PolymerElement } from '@polymer/polymer/polymer-element.js';\nimport { defineCustomElement } from '@vaadin/component-base/src/define.js';\nimport { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';\nimport { OverlayMixin } from '@vaadin/overlay/src/vaadin-overlay-mixin.js';\nimport { overlayStyles } from '@vaadin/overlay/src/vaadin-overlay-styles.js';\nimport { css, registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';\nimport { ComboBoxOverlayMixin } from './vaadin-combo-box-overlay-mixin.js';\n\nconst comboBoxOverlayStyles = css`\n #overlay {\n width: var(--vaadin-combo-box-overlay-width, var(--_vaadin-combo-box-overlay-default-width, auto));\n }\n\n [part='content'] {\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n`;\n\nregisterStyles('vaadin-combo-box-overlay', [overlayStyles, comboBoxOverlayStyles], {\n moduleId: 'vaadin-combo-box-overlay-styles',\n});\n\n/**\n * An element used internally by `<vaadin-combo-box>`. Not intended to be used separately.\n *\n * @customElement\n * @extends HTMLElement\n * @mixes ComboBoxOverlayMixin\n * @mixes DirMixin\n * @mixes OverlayMixin\n * @mixes ThemableMixin\n * @private\n */\nexport class ComboBoxOverlay extends ComboBoxOverlayMixin(OverlayMixin(DirMixin(ThemableMixin(PolymerElement)))) {\n static get is() {\n return 'vaadin-combo-box-overlay';\n }\n\n static get template() {\n return html`\n <div id=\"backdrop\" part=\"backdrop\" hidden></div>\n <div part=\"overlay\" id=\"overlay\">\n <div part=\"loader\"></div>\n <div part=\"content\" id=\"content\"><slot></slot></div>\n </div>\n `;\n }\n}\n\ndefineCustomElement(ComboBoxOverlay);\n","/**\n * @license\n * Copyright (c) 2015 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { html, PolymerElement } from '@polymer/polymer/polymer-element.js';\nimport { defineCustomElement } from '@vaadin/component-base/src/define.js';\nimport { ComboBoxScrollerMixin } from './vaadin-combo-box-scroller-mixin.js';\n\n/**\n * An element used internally by `<vaadin-combo-box>`. Not intended to be used separately.\n *\n * @customElement\n * @extends HTMLElement\n * @mixes ComboBoxScrollerMixin\n * @private\n */\nexport class ComboBoxScroller extends ComboBoxScrollerMixin(PolymerElement) {\n static get is() {\n return 'vaadin-combo-box-scroller';\n }\n\n static get template() {\n return html`\n <style>\n :host {\n display: block;\n min-height: 1px;\n overflow: auto;\n\n /* Fixes item background from getting on top of scrollbars on Safari */\n transform: translate3d(0, 0, 0);\n\n /* Enable momentum scrolling on iOS */\n -webkit-overflow-scrolling: touch;\n\n /* Fixes scrollbar disappearing when 'Show scroll bars: Always' enabled in Safari */\n box-shadow: 0 0 0 white;\n }\n\n #selector {\n border-width: var(--_vaadin-combo-box-items-container-border-width);\n border-style: var(--_vaadin-combo-box-items-container-border-style);\n border-color: var(--_vaadin-combo-box-items-container-border-color, transparent);\n position: relative;\n }\n </style>\n <div id=\"selector\">\n <slot></slot>\n </div>\n `;\n }\n}\n\ndefineCustomElement(ComboBoxScroller);\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { InputConstraintsMixin } from './input-constraints-mixin.js';\n\n/**\n * A mixin to provide `pattern` property.\n *\n * @polymerMixin\n * @mixes InputConstraintsMixin\n */\nexport const PatternMixin = (superclass) =>\n class PatternMixinClass extends InputConstraintsMixin(superclass) {\n static get properties() {\n return {\n /**\n * A regular expression that the value is checked against.\n * The pattern must match the entire value, not just some subset.\n */\n pattern: {\n type: String,\n },\n };\n }\n\n static get delegateAttrs() {\n return [...super.delegateAttrs, 'pattern'];\n }\n\n static get constraints() {\n return [...super.constraints, 'pattern'];\n }\n };\n","/**\n * @license\n * Copyright (c) 2015 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport '@vaadin/input-container/src/vaadin-input-container.js';\nimport './vaadin-combo-box-item.js';\nimport './vaadin-combo-box-overlay.js';\nimport './vaadin-combo-box-scroller.js';\nimport { html, PolymerElement } from '@polymer/polymer/polymer-element.js';\nimport { defineCustomElement } from '@vaadin/component-base/src/define.js';\nimport { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';\nimport { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';\nimport { InputControlMixin } from '@vaadin/field-base/src/input-control-mixin.js';\nimport { InputController } from '@vaadin/field-base/src/input-controller.js';\nimport { LabelledInputController } from '@vaadin/field-base/src/labelled-input-controller.js';\nimport { PatternMixin } from '@vaadin/field-base/src/pattern-mixin.js';\nimport { inputFieldShared } from '@vaadin/field-base/src/styles/input-field-shared-styles.js';\nimport { registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';\nimport { ComboBoxDataProviderMixin } from './vaadin-combo-box-data-provider-mixin.js';\nimport { ComboBoxMixin } from './vaadin-combo-box-mixin.js';\n\nregisterStyles('vaadin-combo-box', inputFieldShared, { moduleId: 'vaadin-combo-box-styles' });\n\n/**\n * `<vaadin-combo-box>` is a web component for choosing a value from a filterable list of options\n * presented in a dropdown overlay. The options can be provided as a list of strings or objects\n * by setting [`items`](#/elements/vaadin-combo-box#property-items) property on the element.\n *\n * ```html\n * <vaadin-combo-box id=\"combo-box\"></vaadin-combo-box>\n * ```\n *\n * ```js\n * document.querySelector('#combo-box').items = ['apple', 'orange', 'banana'];\n * ```\n *\n * When the selected `value` is changed, a `value-changed` event is triggered.\n *\n * ### Item rendering\n *\n * To customize the content of the `<vaadin-combo-box-item>` elements placed in the dropdown, use\n * [`renderer`](#/elements/vaadin-combo-box#property-renderer) property which accepts a function.\n * The renderer function is called with `root`, `comboBox`, and `model` as arguments.\n *\n * Generate DOM content by using `model` object properties if needed, and append it to the `root`\n * element. The `comboBox` reference is provided to access the combo-box element state. Do not\n * set combo-box properties in a `renderer` function.\n *\n * ```js\n * const comboBox = document.querySelector('#combo-box');\n * comboBox.items = [{'label': 'Hydrogen', 'value': 'H'}];\n * comboBox.renderer = (root, comboBox, model) => {\n * const item = model.item;\n * root.innerHTML = `${model.index}: ${item.label} <b>${item.value}</b>`;\n * };\n * ```\n *\n * Renderer is called on the opening of the combo-box and each time the related model is updated.\n * Before creating new content, it is recommended to check if there is already an existing DOM\n * element in `root` from a previous renderer call for reusing it. Even though combo-box uses\n * infinite scrolling, reducing DOM operations might improve performance.\n *\n * The following properties are available in the `model` argument:\n *\n * Property | Type | Description\n * -----------|------------------|-------------\n * `index` | Number | Index of the item in the `items` array\n * `item` | String or Object | The item reference\n * `selected` | Boolean | True when item is selected\n * `focused` | Boolean | True when item is focused\n *\n * ### Lazy Loading with Function Data Provider\n *\n * In addition to assigning an array to the items property, you can alternatively use the\n * [`dataProvider`](#/elements/vaadin-combo-box#property-dataProvider) function property.\n * The `<vaadin-combo-box>` calls this function lazily, only when it needs more data\n * to be displayed.\n *\n * __Note that when using function data providers, the total number of items\n * needs to be set manually. The total number of items can be returned\n * in the second argument of the data provider callback:__\n *\n * ```js\n * comboBox.dataProvider = async (params, callback) => {\n * const API = 'https://demo.vaadin.com/demo-data/1.0/filtered-countries';\n * const { filter, page, pageSize } = params;\n * const index = page * pageSize;\n *\n * const res = await fetch(`${API}?index=${index}&count=${pageSize}&filter=${filter}`);\n * if (res.ok) {\n * const { result, size } = await res.json();\n * callback(result, size);\n * }\n * };\n * ```\n *\n * ### Styling\n *\n * The following custom properties are available for styling:\n *\n * Custom property | Description | Default\n * ----------------------------------------|----------------------------|---------\n * `--vaadin-field-default-width` | Default width of the field | `12em`\n * `--vaadin-combo-box-overlay-width` | Width of the overlay | `auto`\n * `--vaadin-combo-box-overlay-max-height` | Max height of the overlay | `65vh`\n *\n * `<vaadin-combo-box>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\n * See [`<vaadin-text-field>`](#/elements/vaadin-text-field) for the styling documentation.\n *\n * In addition to `<vaadin-text-field>` parts, the following parts are available for theming:\n *\n * Part name | Description\n * ----------------|----------------\n * `toggle-button` | The toggle button\n *\n * In addition to `<vaadin-text-field>` state attributes, the following state attributes are available for theming:\n *\n * Attribute | Description | Part name\n * ----------|-------------|------------\n * `opened` | Set when the combo box dropdown is open | :host\n * `loading` | Set when new items are expected | :host\n *\n * If you want to replace the default `<input>` and its container with a custom implementation to get full control\n * over the input field, consider using the [`<vaadin-combo-box-light>`](#/elements/vaadin-combo-box-light) element.\n *\n * ### Internal components\n *\n * In addition to `<vaadin-combo-box>` itself, the following internal\n * components are themable:\n *\n * - `<vaadin-combo-box-overlay>` - has the same API as [`<vaadin-overlay>`](#/elements/vaadin-overlay).\n * - `<vaadin-combo-box-item>` - has the same API as [`<vaadin-item>`](#/elements/vaadin-item).\n * - [`<vaadin-input-container>`](#/elements/vaadin-input-container) - an internal element wrapping the input.\n *\n * Note: the `theme` attribute value set on `<vaadin-combo-box>` is\n * propagated to the internal components listed above.\n *\n * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n *\n * @fires {Event} change - Fired when the user commits a value change.\n * @fires {CustomEvent} custom-value-set - Fired when the user sets a custom value.\n * @fires {CustomEvent} filter-changed - Fired when the `filter` property changes.\n * @fires {CustomEvent} invalid-changed - Fired when the `invalid` property changes.\n * @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.\n * @fires {CustomEvent} selected-item-changed - Fired when the `selectedItem` property changes.\n * @fires {CustomEvent} value-changed - Fired when the `value` property changes.\n * @fires {CustomEvent} validated - Fired whenever the field is validated.\n *\n * @customElement\n * @extends HTMLElement\n * @mixes ElementMixin\n * @mixes ThemableMixin\n * @mixes InputControlMixin\n * @mixes PatternMixin\n * @mixes ComboBoxDataProviderMixin\n * @mixes ComboBoxMixin\n */\nclass ComboBox extends ComboBoxDataProviderMixin(\n ComboBoxMixin(PatternMixin(InputControlMixin(ThemableMixin(ElementMixin(PolymerElement))))),\n) {\n static get is() {\n return 'vaadin-combo-box';\n }\n\n static get template() {\n return html`\n <style>\n :host([opened]) {\n pointer-events: auto;\n }\n </style>\n\n <div class=\"vaadin-combo-box-container\">\n <div part=\"label\">\n <slot name=\"label\"></slot>\n <span part=\"required-indicator\" aria-hidden=\"true\" on-click=\"focus\"></span>\n </div>\n\n <vaadin-input-container\n part=\"input-field\"\n readonly=\"[[readonly]]\"\n disabled=\"[[disabled]]\"\n invalid=\"[[invalid]]\"\n theme$=\"[[_theme]]\"\n >\n <slot name=\"prefix\" slot=\"prefix\"></slot>\n <slot name=\"input\"></slot>\n <div id=\"clearButton\" part=\"clear-button\" slot=\"suffix\" aria-hidden=\"true\"></div>\n <div id=\"toggleButton\" part=\"toggle-button\" slot=\"suffix\" aria-hidden=\"true\"></div>\n </vaadin-input-container>\n\n <div part=\"helper-text\">\n <slot name=\"helper\"></slot>\n </div>\n\n <div part=\"error-message\">\n <slot name=\"error-message\"></slot>\n </div>\n </div>\n\n <vaadin-combo-box-overlay\n id=\"overlay\"\n opened=\"[[_overlayOpened]]\"\n loading$=\"[[loading]]\"\n theme$=\"[[_theme]]\"\n position-target=\"[[_positionTarget]]\"\n no-vertical-overlap\n restore-focus-node=\"[[inputElement]]\"\n ></vaadin-combo-box-overlay>\n\n <slot name=\"tooltip\"></slot>\n `;\n }\n\n static get properties() {\n return {\n /**\n * @protected\n */\n _positionTarget: {\n type: Object,\n },\n };\n }\n\n /**\n * Used by `InputControlMixin` as a reference to the clear button element.\n * @protected\n * @return {!HTMLElement}\n */\n get clearElement() {\n return this.$.clearButton;\n }\n\n /** @protected */\n ready() {\n super.ready();\n\n this.addController(\n new InputController(this, (input) => {\n this._setInputElement(input);\n this._setFocusElement(input);\n this.stateTarget = input;\n this.ariaTarget = input;\n }),\n );\n this.addController(new LabelledInputController(this.inputElement, this._labelController));\n\n this._tooltipController = new TooltipController(this);\n this.addController(this._tooltipController);\n this._tooltipController.setPosition('top');\n this._tooltipController.setAriaTarget(this.inputElement);\n this._tooltipController.setShouldShow((target) => !target.opened);\n\n this._positionTarget = this.shadowRoot.querySelector('[part=\"input-field\"]');\n this._toggleElement = this.$.toggleButton;\n }\n\n /**\n * Override the method from `InputControlMixin`\n * to stop event propagation to prevent `ComboBoxMixin`\n * from handling this click event also on its own.\n *\n * @param {Event} event\n * @protected\n * @override\n */\n _onClearButtonClick(event) {\n event.stopPropagation();\n super._onClearButtonClick(event);\n }\n\n /**\n * @param {Event} event\n * @protected\n */\n _onHostClick(event) {\n const path = event.composedPath();\n\n // Open dropdown only when clicking on the label or input field\n if (path.includes(this._labelNode) || path.includes(this._positionTarget)) {\n super._onHostClick(event);\n }\n }\n}\n\ndefineCustomElement(ComboBox);\n\nexport { ComboBox };\n"],"names":["buttonStyles","ButtonMixin","superClass","properties","tabindex","type","Number","value","reflectToAttribute","_activeKeys","ready","super","this","hasAttribute","setAttribute","_onKeyDown","event","altKey","shiftKey","ctrlKey","metaKey","includes","key","preventDefault","click","moduleId","Button","is","template","_tooltipController","addController","button","comboBox","ComboBoxItem","comboBoxOverlayStyles","ComboBoxOverlay","ComboBoxScroller","PatternMixin","superclass","pattern","String","delegateAttrs","constraints","ComboBox","_positionTarget","Object","clearElement","$","clearButton","input","_setInputElement","_setFocusElement","stateTarget","ariaTarget","inputElement","_labelController","setPosition","setAriaTarget","setShouldShow","target","opened","shadowRoot","querySelector","_toggleElement","toggleButton","_onClearButtonClick","stopPropagation","_onHostClick","path","composedPath","_labelNode"],"sourceRoot":""}
@@ -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:()=>k,componentName:()=>y}),i(20428),i(88350),i(21374);var r=i(25964),o=i(3393),n=i(79365),s=i(97810),a=i(9696),l=i(49224),p=i(77421),h=i(80071),d=i(64101);class c{#e=Object.freeze([]);constructor({id:e,min:t,max:i,placeholder:r},o){this.id=e,this.min=t,this.max=i,this.placeholder=r,this.onChange=o}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,o.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],f=u.w.cssVarList,{host:x,input:w,inputEleRTL:E,toggleButton:I,overlay:T,backdrop:S,errorMessage:V}={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)"}},k=(0,a.Zz)((0,n.RF)({componentNameOverride:(0,s.xE)("input-wrapper")}),(0,n.RF)({mappings:{iconMargin:{...I,property:"margin-inline-end"},hostWidth:{...x,property:"width"},hostDirection:{...x,property:"direction"},textAlign:{...w,property:"text-align"},rtlInputDirection:{...E,property:f.inputDirection},rtlInputAlignment:{...E,property:f.inputTextAlign},overlayGap:{property:()=>k.cssVarList.overlayGap},overlayBackgroundColor:{property:()=>k.cssVarList.overlayBackgroundColor},overlayPadding:{property:()=>k.cssVarList.overlayPadding},overlayBoxShadow:{property:()=>k.overlayBoxShadow},overlayOutlineWidth:{property:()=>k.cssVarList.overlayOutlineWidth},overlayOutlineColor:{property:()=>k.cssVarList.overlayOutlineColor},overlayOutlineStyle:{property:()=>k.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},labelFontWeight:{selector:u.w.componentName,property:u.w.cssVarList.labelFontWeight},inputValueFontWeight:{selector:u.w.componentName,property:u.w.cssVarList.inputValueFontWeight},inputPlaceholderFontWeight:{selector:u.w.componentName,property:u.w.cssVarList.inputPlaceholderFontWeight},helperTextFontWeight:{selector:u.w.componentName,property:u.w.cssVarList.helperTextFontWeight},errorMessageFontWeight:{selector:u.w.componentName,property:u.w.cssVarList.errorMessageFontWeight}}}),(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=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(d.rR.MONTH,this.onDateCounterChange.bind(this)),new c(d.rR.DAY,this.onDateCounterChange.bind(this)),new c(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 ${h.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(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){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.#o.bind(this),this.baseElement.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation()})}handleSelectAll(){this.isSelectAll&&this.selectFirstCounter()}#n;#o(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.#n?.replaceSync("vaadin-popover-overlay::part(overlay) { transform: none; }");const t=document.body.getBoundingClientRect(),i=this.getBoundingClientRect(),o=this.calendar.getBoundingClientRect(),n=this.isRTL?"right":"left",s=i[n]-o[n],a=o.left,l=t.width-o.right;let p;p=s>0?Math.min(s,l):-1*Math.min(Math.abs(s),a);const h=`\n vaadin-popover-overlay::part(overlay) {\n transform: translateX(${p}px);\n }\n `;this.#n?this.#n.replaceSync(h):this.#n=(0,r.fz)(h,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,d.wJ)):(this.calendar.clearValue(),this.calendar.setAttribute("preview",(0,l.jO)((0,l.Ln)(),d.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),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(p.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",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 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,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,k)},79275(e,t,i){i.d(t,{T:()=>l,w:()=>h});var r=i(79365),o=i(6424),n=i(9696),s=i(97810),a=i(73551);const l=(0,s.xE)("text-field"),p=["type","label-type","copy-to-clipboard"],h=(0,n.Zz)((0,r.RF)({mappings:o.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(${h.cssVarList.inputOutlineWidth}) + var(${h.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)(h.cssVarList)}\n\t\t\t${(0,a.LJ)("vaadin-text-field",h.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:o,placeholder:n,requiredIndicator:s,inputField:a,input:l,inputMask:p,helperText:h,errorMessage:d,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:[o,a,h,d],labelFontSize:{...o,property:"font-size"},labelFontWeight:{...o,property:"font-weight"},inputValueFontWeight:[{...l,property:"font-weight"},{...y,property:"font-weight"}],inputPlaceholderFontWeight:[{selector:()=>":host input:placeholder-shown",property:"font-weight"},{...b,property:"font-weight"}],helperTextFontWeight:{...h,property:"font-weight"},errorMessageFontWeight:{...d,property:"font-weight"},labelTextColor:[{...o,property:"color"},{...s,property:"color"},{...o,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:{...d,property:"color"},errorMessageIcon:{...d,property:"background-image"},errorMessageIconSize:{...d,property:"background-size"},errorMessageIconPadding:{...d,property:"padding-inline-start"},errorMessageIconRepeat:{...d,property:"background-repeat"},errorMessageIconPosition:{...d,property:"background-position"},errorMessageFontSize:{...d,property:"font-size"},helperTextColor:{...h,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"},{...n,property:"color"},{...c,property:"-webkit-text-fill-color"},{...v,property:"-webkit-text-fill-color"}],labelPosition:{...o,property:"position"},labelTopPosition:{...o,property:"top"},labelHorizontalPosition:[{...o,property:"left"},{...o,property:"right"}],inputTransformY:{...o,property:"transform"},inputTransition:{...o,property:"transition"},marginInlineStart:{...o,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],{28027(e,t,i){i.d(t,{T:()=>l,w:()=>h});var r=i(88961),o=i(63200),n=i(25964),s=i(79673),a=i(47656);const l=(0,n.xE)("text-field"),p=["type","label-type","copy-to-clipboard"],h=(0,o.Zz)((0,r.RF)({mappings:a.A}),r.VO,(0,r.OZ)({proxyProps:["value","selectionStart","selectionEnd"],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(${h.cssVarList.inputOutlineWidth}) + var(${h.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,s.$J)("vaadin-text-field")}\n\t\t\t${(0,s.cy)(h.cssVarList)}\n\t\t\t${(0,s.LJ)("vaadin-text-field",h.cssVarList)}\n ${(0,s.Kl)()}\n\n vaadin-text-field vaadin-icon {\n align-self: center;\n }\n\t\t`,excludeAttrsSync:["tabindex","style"],componentName:l}))},64014(e,t,i){i.r(t),i.d(t,{TextFieldClass:()=>r.w,componentName:()=>r.T}),i(11284),i(37182),i(95260);var r=i(28027);customElements.define(r.T,r.w)},47656(e,t,i){i.d(t,{A:()=>C});const{host:r,label:o,placeholder:n,requiredIndicator:s,inputField:a,input:l,inputMask:p,helperText:h,errorMessage:d,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:[o,a,h,d],labelFontSize:{...o,property:"font-size"},labelFontWeight:{...o,property:"font-weight"},inputValueFontWeight:[{...l,property:"font-weight"},{...y,property:"font-weight"}],inputPlaceholderFontWeight:[{selector:()=>":host input:placeholder-shown",property:"font-weight"},{...b,property:"font-weight"}],helperTextFontWeight:{...h,property:"font-weight"},errorMessageFontWeight:{...d,property:"font-weight"},labelTextColor:[{...o,property:"color"},{...s,property:"color"},{...o,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:{...d,property:"color"},errorMessageIcon:{...d,property:"background-image"},errorMessageIconSize:{...d,property:"background-size"},errorMessageIconPadding:{...d,property:"padding-inline-start"},errorMessageIconRepeat:{...d,property:"background-repeat"},errorMessageIconPosition:{...d,property:"background-position"},errorMessageFontSize:{...d,property:"font-size"},helperTextColor:{...h,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"},{...n,property:"color"},{...c,property:"-webkit-text-fill-color"},{...v,property:"-webkit-text-fill-color"}],labelPosition:{...o,property:"position"},labelTopPosition:{...o,property:"top"},labelHorizontalPosition:[{...o,property:"left"},{...o,property:"right"}],inputTransformY:{...o,property:"transform"},inputTransition:{...o,property:"transition"},marginInlineStart:{...o,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"}]}},79981(e,t,i){i.r(t),i.d(t,{DateFieldClass:()=>k,componentName:()=>y}),i(20428),i(88350),i(64014);var r=i(25964),o=i(28027),n=i(3393),s=i(79365),a=i(97810),l=i(9696),p=i(49224),h=i(77421),d=i(80071),c=i(64101);class u{#e=Object.freeze([]);constructor({id:e,min:t,max:i,placeholder:r},o){this.id=e,this.min=t,this.max=i,this.placeholder=r,this.onChange=o}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 g=i(15177);const y=(0,a.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],f=o.w.cssVarList,{host:x,input:w,inputEleRTL:E,toggleButton:I,overlay:T,backdrop:S,errorMessage:V}={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)"}},k=(0,l.Zz)((0,s.RF)({componentNameOverride:(0,a.xE)("input-wrapper")}),(0,s.RF)({mappings:{iconMargin:{...I,property:"margin-inline-end"},hostWidth:{...x,property:"width"},hostDirection:{...x,property:"direction"},textAlign:{...w,property:"text-align"},rtlInputDirection:{...E,property:f.inputDirection},rtlInputAlignment:{...E,property:f.inputTextAlign},overlayGap:{property:()=>k.cssVarList.overlayGap},overlayBackgroundColor:{property:()=>k.cssVarList.overlayBackgroundColor},overlayPadding:{property:()=>k.cssVarList.overlayPadding},overlayBoxShadow:{property:()=>k.overlayBoxShadow},overlayOutlineWidth:{property:()=>k.cssVarList.overlayOutlineWidth},overlayOutlineColor:{property:()=>k.cssVarList.overlayOutlineColor},overlayOutlineStyle:{property:()=>k.cssVarList.overlayOutlineStyle},errorMessageIcon:{selector:o.w.componentName,property:o.w.cssVarList.errorMessageIcon},errorMessageIconSize:{selector:o.w.componentName,property:o.w.cssVarList.errorMessageIconSize},errorMessageIconPadding:{selector:o.w.componentName,property:o.w.cssVarList.errorMessageIconPadding},errorMessageIconRepeat:{selector:o.w.componentName,property:o.w.cssVarList.errorMessageIconRepeat},errorMessageIconPosition:{selector:o.w.componentName,property:o.w.cssVarList.errorMessageIconPosition},errorMessageFontSize:{selector:o.w.componentName,property:o.w.cssVarList.errorMessageFontSize},labelFontWeight:{selector:o.w.componentName,property:o.w.cssVarList.labelFontWeight},inputValueFontWeight:{selector:o.w.componentName,property:o.w.cssVarList.inputValueFontWeight},inputPlaceholderFontWeight:{selector:o.w.componentName,property:o.w.cssVarList.inputPlaceholderFontWeight},helperTextFontWeight:{selector:o.w.componentName,property:o.w.cssVarList.helperTextFontWeight},errorMessageFontWeight:{selector:o.w.componentName,property:o.w.cssVarList.errorMessageFontWeight}}}),(0,s.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}}}),s.VO,s.tQ)(class extends m{epoch="";format=c.ui;selectedCounterIdx=0;updateCountersDisplay(){this.inputElement.value=this.countersValue}updateValue(){if(this.isCountersOutOfRange)this.resetEpoch();else{const e=h.F[this.format].getDate(this.inputElement.value);this.updateEpoch((0,p.xq)(e,this.isUtcTime))}}onDateCounterChange=()=>{this.updateCountersDisplay(),this.updateValue(),this.#i()};updateEpoch(e){this.epoch=(0,p.xq)(e,this.isUtcTime)}dateCounters=[new u(c.rR.MONTH,this.onDateCounterChange.bind(this)),new u(c.rR.DAY,this.onDateCounterChange.bind(this)),new u(c.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=h.F[this.format].getDate(this.inputElement.value);return(0,p.mZ)(e?.getTime())?e.getTime():null}get sortedCounters(){return this.format.split(c.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(c.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,p.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,a.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,p.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.#o.bind(this),this.baseElement.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation()})}handleSelectAll(){this.isSelectAll&&this.selectFirstCounter()}#n;#o(e){e.firstChild||(this.overlay.positionTarget=this.shadowRoot.querySelector(".toggle-calendar"),e.appendChild(this.#s()),(0,p.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.#n?.replaceSync("vaadin-popover-overlay::part(overlay) { transform: none; }");const t=document.body.getBoundingClientRect(),i=this.getBoundingClientRect(),o=this.calendar.getBoundingClientRect(),n=this.isRTL?"right":"left",s=i[n]-o[n],a=o.left,l=t.width-o.right;let p;p=s>0?Math.min(s,l):-1*Math.min(Math.abs(s),a);const h=`\n vaadin-popover-overlay::part(overlay) {\n transform: translateX(${p}px);\n }\n `;this.#n?this.#n.replaceSync(h):this.#n=(0,r.fz)(h,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,p.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,p.mZ)((0,g.N)(this.inputElement.value||"").getTime())&&h.F[this.format].validate(this.inputElement.value);this.displayValueEpoch||e?this.calendar.setAttribute("initial-value",(0,p.jO)(this.displayValueEpoch||this.epoch,c.wJ)):(this.calendar.clearValue(),this.calendar.setAttribute("preview",(0,p.jO)((0,p.Ln)(),c.wJ))),(0,a.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),c.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(h.F).includes(e)&&(this.format=e,this.updateFormatPattern())}updateFormatPattern(){const e=this.getAttribute("format")||this.format||c.ui;this.setAttribute("type","date"),this.setAttribute("pattern",h.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 c.rR.MONTH.id:t.set(this.isUtcTime?e.getUTCMonth()+1:e.getMonth()+1);break;case c.rR.YEAR.id:t.set(this.isUtcTime?e.getUTCFullYear():e.getFullYear());break;case c.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>c.nr.year.max||e.numberValue<c.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,p.Rm)(t,this.format);if(i)this.value=(0,p.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,k)}}]);
2
2
  //# sourceMappingURL=descope-date-field-index-js.js.map