@descope/web-components-ui 1.105.0 → 1.107.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 (38) hide show
  1. package/dist/cjs/index.cjs.js +224 -128
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +856 -760
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/umd/DescopeDev.js +1 -1
  6. package/dist/umd/DescopeDev.js.map +1 -1
  7. package/dist/umd/descope-alert-index-js.js +1 -1
  8. package/dist/umd/descope-alert-index-js.js.map +1 -1
  9. package/dist/umd/descope-date-field-descope-calendar-index-js.js +1 -1
  10. package/dist/umd/descope-date-field-descope-calendar-index-js.js.map +1 -1
  11. package/dist/umd/descope-date-field-index-js.js +1 -1
  12. package/dist/umd/descope-date-field-index-js.js.map +1 -1
  13. package/dist/umd/descope-enriched-text.js +2 -0
  14. package/dist/umd/descope-enriched-text.js.map +1 -0
  15. package/dist/umd/descope-link.js +2 -0
  16. package/dist/umd/descope-link.js.map +1 -0
  17. package/dist/umd/index.js +1 -1
  18. package/dist/umd/index.js.map +1 -1
  19. package/package.json +11 -10
  20. package/src/components/descope-alert/AlertClass.js +1 -1
  21. package/src/components/descope-alert/index.js +1 -1
  22. package/src/components/descope-date-field/DateFieldClass.js +94 -3
  23. package/src/components/descope-date-field/helpers.js +8 -0
  24. package/src/index.cjs.js +0 -2
  25. package/src/index.js +0 -2
  26. package/src/theme/components/index.js +2 -2
  27. package/dist/umd/descope-enriched-text-index-js.js +0 -2
  28. package/dist/umd/descope-enriched-text-index-js.js.map +0 -1
  29. package/dist/umd/descope-link-index-js.js +0 -2
  30. package/dist/umd/descope-link-index-js.js.map +0 -1
  31. package/src/components/descope-enriched-text/EnrichedTextClass.js +0 -209
  32. package/src/components/descope-enriched-text/consts.js +0 -14
  33. package/src/components/descope-enriched-text/helpers.js +0 -5
  34. package/src/components/descope-enriched-text/index.js +0 -5
  35. package/src/components/descope-link/LinkClass.js +0 -76
  36. package/src/components/descope-link/index.js +0 -6
  37. package/src/theme/components/enrichedText.js +0 -40
  38. package/src/theme/components/link.js +0 -36
@@ -1 +1 @@
1
- {"version":3,"file":"descope-date-field-index-js.js","mappings":"yJAAA,MAAM,KACJA,EAAI,MACJC,EAAK,YACLC,EAAW,kBACXC,EAAiB,WACjBC,EAAU,MACVC,EAAK,UACLC,EAAS,WACTC,EAAU,aACVC,EAAY,oBACZC,EAAmB,cACnBC,EAAa,UACbC,EAAS,cACTC,EAAa,sBACbC,EAAqB,oBACrBC,EAAmB,4BACnBC,GACE,CACFf,KAAM,CAAEgB,SAAU,IAAM,SACxBf,MAAO,CAAEe,SAAU,iBACnBb,kBAAmB,CAAEa,SAAU,+CAC/Bd,YAAa,CACX,CAAEc,SAAU,6BACZ,CAAEA,SAAU,IAAM,4CAEpBP,oBAAqB,CAAEO,SAAU,iCACjCZ,WAAY,CAAEY,SAAU,uBACxBX,MAAO,CAAEW,SAAU,SACnBV,UAAW,CAAEU,SAAU,+BACvBN,cAAe,CAAEM,SAAU,kBAC3BT,WAAY,CAAES,SAAU,uBACxBR,aAAc,CAAEQ,SAAU,yBAC1BL,UAAW,CAAEK,SAAU,eACvBJ,cAAe,CAAEI,SAAU,IAAM,oBACjCH,sBAAuB,CAAEG,SAAU,IAAM,6BACzCF,oBAAqB,CAAEE,SAAU,IAAM,sCACvCD,4BAA6B,CAAEC,SAAU,IAAM,2CAGjD,GAEEC,SAAU,CAAC,CAAC,EAAGjB,GACfkB,WAAY,CAACjB,EAAOG,EAAYG,EAAYC,GAE5CW,cAAe,IAAKlB,EAAOmB,SAAU,aACrCC,gBAAiB,IAAKpB,EAAOmB,SAAU,eAEvCE,eAAgB,CACd,IAAKrB,EAAOmB,SAAU,SACtB,IAAKjB,EAAmBiB,SAAU,SAClC,IAAKnB,EAAOmB,SAAU,2BACtB,IAAKjB,EAAmBiB,SAAU,4BAGpCG,UAAW,IAAKvB,EAAMoB,SAAU,SAChCI,aAA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G,+cAc5B,QAAwB,gCAC3B,QAAuB+F,EAAeC,uBACtC,QAAoB,oBAAqBD,EAAeC,uBACrD,iGAMJkN,iBAAkB,CAAC,WAAY,SAC/B3N,kB","sources":["webpack://@descope/web-components-ui/./src/components/descope-text-field/textFieldMappings.js","webpack://@descope/web-components-ui/./src/components/descope-text-field/index.js","webpack://@descope/web-components-ui/./src/components/descope-date-field/formats.js","webpack://@descope/web-components-ui/./src/components/descope-date-field/DateCounterClass.js","webpack://@descope/web-components-ui/./src/components/descope-date-field/DateFieldClass.js","webpack://@descope/web-components-ui/./src/components/descope-date-field/index.js","webpack://@descope/web-components-ui/./src/components/descope-text-field/TextFieldClass.js"],"sourcesContent":["const {\n host,\n label,\n placeholder,\n requiredIndicator,\n inputField,\n input,\n inputMask,\n helperText,\n errorMessage,\n disabledPlaceholder,\n inputDisabled,\n inputIcon,\n externalInput,\n externalInputDisabled,\n externalPlaceholder,\n externalDisabledPlaceholder,\n} = {\n host: { selector: () => ':host' },\n label: { selector: '::part(label)' },\n requiredIndicator: { selector: '[required]::part(required-indicator)::after' },\n placeholder: [\n { selector: '> input:placeholder-shown' },\n { selector: () => ':host::slotted(input:placeholder-shown)' },\n ],\n disabledPlaceholder: { selector: '> input:disabled::placeholder' },\n inputField: { selector: '::part(input-field)' },\n input: { selector: 'input' },\n inputMask: { selector: '::part(input-field)::before' },\n inputDisabled: { selector: 'input:disabled' },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n inputIcon: { selector: 'vaadin-icon' },\n externalInput: { selector: () => '::slotted(input)' },\n externalInputDisabled: { selector: () => '::slotted(input:disabled)' },\n externalPlaceholder: { selector: () => '::slotted(input:placeholder-shown)' },\n externalDisabledPlaceholder: { selector: () => '::slotted(input:disabled::placeholder)' },\n};\n\nexport default {\n // we apply font-size also on the host so we can set its width with em\n fontSize: [{}, host],\n fontFamily: [label, inputField, helperText, errorMessage],\n\n labelFontSize: { ...label, property: 'font-size' },\n labelFontWeight: { ...label, property: 'font-weight' },\n\n labelTextColor: [\n { ...label, property: 'color' },\n { ...requiredIndicator, property: 'color' },\n { ...label, property: '-webkit-text-fill-color' },\n { ...requiredIndicator, property: '-webkit-text-fill-color' },\n ],\n\n hostWidth: { ...host, property: 'width' },\n hostMinWidth: { ...host, property: 'min-width' },\n hostDirection: { ...host, property: 'direction' },\n inputDirection: { ...input, property: 'direction' },\n\n inputBackgroundColor: [\n { ...inputField, property: 'background-color' },\n { ...inputMask, property: 'background-color' },\n ],\n\n errorMessageTextColor: { ...errorMessage, property: 'color' },\n errorMessageIcon: { ...errorMessage, property: 'background-image' },\n errorMessageIconSize: { ...errorMessage, property: 'background-size' },\n errorMessageIconPadding: { ...errorMessage, property: 'padding-inline-start' },\n errorMessageIconRepeat: { ...errorMessage, property: 'background-repeat' },\n errorMessageIconPosition: { ...errorMessage, property: 'background-position' },\n errorMessageFontSize: { ...errorMessage, property: 'font-size' },\n\n helperTextColor: { ...helperText, property: '-webkit-text-fill-color' },\n\n inputValueTextColor: [\n { ...inputField, property: 'color' },\n { ...inputDisabled, property: '-webkit-text-fill-color' },\n { ...externalInputDisabled, property: '-webkit-text-fill-color' },\n ],\n inputCaretTextColor: [\n { ...input, property: 'caret-color' },\n { ...externalInput, property: 'caret-color' },\n ],\n\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\n\n inputBorderColor: { ...inputField, property: 'border-color' },\n inputBorderWidth: { ...inputField, property: 'border-width' },\n inputBorderStyle: { ...inputField, property: 'border-style' },\n inputBorderRadius: { ...inputField, property: 'border-radius' },\n\n inputHeight: { ...inputField, property: 'height' },\n inputHorizontalPadding: [\n { ...input, property: 'padding-left' },\n { ...input, property: 'padding-right' },\n { ...externalInput, property: 'padding-left' },\n { ...externalInput, property: 'padding-right' },\n ],\n\n inputOutlineColor: { ...inputField, property: 'outline-color' },\n inputOutlineStyle: { ...inputField, property: 'outline-style' },\n inputOutlineWidth: { ...inputField, property: 'outline-width' },\n inputOutlineOffset: { ...inputField, property: 'outline-offset' },\n\n textAlign: {},\n\n inputTextAlign: [\n { ...input, property: 'text-align' },\n { ...externalInput, property: 'text-align' },\n ],\n\n inputPlaceholderColor: [\n { selector: () => ':host input:placeholder-shown', property: 'color' },\n { ...externalPlaceholder, property: 'color' },\n { ...placeholder, property: 'color' },\n { ...disabledPlaceholder, property: '-webkit-text-fill-color' },\n { ...externalDisabledPlaceholder, property: '-webkit-text-fill-color' },\n ],\n\n labelPosition: { ...label, property: 'position' },\n labelTopPosition: { ...label, property: 'top' },\n labelHorizontalPosition: [\n { ...label, property: 'left' },\n { ...label, property: 'right' },\n ],\n inputTransformY: { ...label, property: 'transform' },\n inputTransition: { ...label, property: 'transition' },\n marginInlineStart: { ...label, property: 'margin-inline-start' },\n placeholderOpacity: [\n { selector: '> input:placeholder-shown', property: 'opacity' },\n { ...externalPlaceholder, property: 'opacity' },\n ],\n inputVerticalAlignment: [\n { ...inputField, property: 'align-items' },\n { ...externalInput, property: 'align-items' },\n ],\n valueInputHeight: [\n { ...input, property: 'height' },\n { ...externalInput, property: 'height' },\n ],\n valueInputMarginBottom: [\n { ...input, property: 'margin-bottom' },\n { ...externalInput, property: 'margin-bottom' },\n ],\n\n inputIconOffset: [\n { ...inputIcon, property: 'margin-right' },\n { ...inputIcon, property: 'margin-left' },\n ],\n inputIconSize: { ...inputIcon, property: 'font-size' },\n inputIconColor: { ...inputIcon, property: 'color' },\n};\n","import '@vaadin/text-field';\nimport '@vaadin/icons';\nimport '@vaadin/icon';\n\nimport { componentName, TextFieldClass } from './TextFieldClass';\n\ncustomElements.define(componentName, TextFieldClass);\n\nexport { TextFieldClass, componentName };\n","import { DIVIDER, SUPPORTED_FORMATS } from './consts';\nimport { newDate } from './helpers';\n\nconst patterns = {\n MM: '(0?[1-9]|1[0-2])',\n DD: '(0?[1-9]|[12][0-9]|3[01])',\n YYYY: '([0-9]{4})',\n};\n\nconst createPattern = (format) => {\n const pattern = format\n .split(DIVIDER)\n .map((part) => patterns[part])\n .join('\\\\D');\n\n return `^${pattern}$`;\n};\n\nconst createToValuesFn = (format) => {\n const order = format.split(DIVIDER);\n return (match) => {\n const values = {};\n order.forEach((part, index) => {\n values[part] = match[index + 1];\n });\n return [values.YYYY, values.MM, values.DD];\n };\n};\n\nconst createDate = (val, regexp, toValuesFn) => {\n const match = regexp.exec(val);\n if (!match) return null;\n const [year, month, day] = toValuesFn(match);\n return newDate([year, month, day].join(DIVIDER));\n};\n\nconst createFormat = (format) => {\n const pattern = createPattern(format);\n const toValuesFn = createToValuesFn(format);\n const regexp = new RegExp(pattern);\n\n return {\n pattern,\n validate: (val) => regexp.test(val),\n getDate: (val) => createDate(val, regexp, toValuesFn),\n };\n};\n\nexport const formats = Object.fromEntries(SUPPORTED_FORMATS.map((f) => [f, createFormat(f)]));\n","// DateCounterClass allows us to add several counters to the input, and use them seperately.\n// For examele, we have a DayCounter, MonthCounter and YearCounter, which can each separately navigate\n// between different ranges.\nexport class DateCounter {\n #data = Object.freeze([]);\n\n constructor({ id, min, max, placeholder }, onChange) {\n this.id = id;\n this.min = min;\n this.max = max;\n this.placeholder = placeholder;\n this.onChange = onChange;\n }\n\n get data() {\n return this.#data;\n }\n\n set data(val) {\n this.#data = Object.freeze(val);\n this.onChange?.();\n }\n\n get #initialNumValue() {\n return this.data.length ? this.numberValue : 0;\n }\n\n get numberValue() {\n return Number(this.stringValue);\n }\n\n get stringValue() {\n return (this.data.join('') || this.placeholder).padStart(this.length, '0');\n }\n\n get isFull() {\n return this.numberValue * 10 > this.max || this.data.length === this.length;\n }\n\n get isEmpty() {\n return this.stringValue === this.placeholder;\n }\n\n get length() {\n return this.max.toString().length;\n }\n\n set(val) {\n this.data = val.toString().split('');\n }\n\n add(num) {\n // use local var to avoid triggering onChange\n let data = this.data;\n\n data = [...data, num];\n\n // we need to re-evaluate the number value\n const numVal = Number(data.join(''));\n\n if (numVal > this.max) {\n data = [num];\n } else if (this.length < data.length) {\n data = data.slice(1, data.length);\n }\n\n this.data = data;\n\n return num;\n }\n\n del() {\n if (!this.data.filter((d) => d !== '0').filter(Boolean).length) {\n this.data = [];\n } else {\n this.data = this.data.slice(0, this.data.length - 1);\n }\n }\n\n clear() {\n this.data = [];\n }\n\n inc(gap) {\n this.replaceValue(\n this.#initialNumValue < this.max\n ? Math.max(this.#initialNumValue + (gap || 1), this.min)\n : this.min\n );\n }\n\n dec(gap) {\n this.replaceValue(\n this.#initialNumValue > this.min\n ? Math.min(this.#initialNumValue - (gap || 1), this.max)\n : this.max\n );\n }\n\n isInRange(val) {\n return val >= this.min && val <= this.max;\n }\n\n replaceValue(val) {\n if (this.isInRange(val)) {\n this.data = val.toString().padStart(this.length, 0).split('');\n }\n }\n\n setMin(val) {\n this.min = Number(val);\n }\n\n setMax(val) {\n this.max = Number(val);\n }\n}\n","import { createBaseInputClass } from '../../baseClasses/createBaseInputClass';\nimport {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n portalMixin,\n} from '../../mixins';\nimport { forwardAttrs, getComponentName } from '../../helpers/componentHelpers';\nimport { compose } from '../../helpers';\nimport {\n newDate,\n isValidTimestamp,\n formatTimestamp,\n isNumber,\n getCurrentTime,\n overrideConstructedStylesheet,\n} from './helpers';\nimport { formats } from './formats';\nimport { calendarIcon } from './icons';\nimport {\n counterConfig,\n DEFAULT_FORMAT,\n DIVIDER,\n MOBILE_DEVICE_INTERACTION_TIMEOUT_MS,\n NATIVE_FORMAT,\n valRange,\n} from './consts';\nimport { DateCounter } from './DateCounterClass';\nimport { TextFieldClass } from '../descope-text-field/TextFieldClass';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('date-field');\n\n// we set baseSelector to `vaadin-popover` as a temporary hack, so our portalMixin will\n// be able to process this component's overlay. The whole process needs refactoring as soon as possible.\nconst BASE_SELECTOR = 'vaadin-popover';\nconst BaseInputClass = createBaseInputClass({ componentName, baseSelector: BASE_SELECTOR });\n\nconst dateFieldAttrs = ['format', 'opened', 'initial-value', 'readonly', 'disable-calendar'];\nconst calendarAttrs = ['years-range', 'calendar-months', 'calendar-weekdays'];\nconst observedAttrs = [...dateFieldAttrs, ...calendarAttrs];\n\nclass RawDateFieldClass extends BaseInputClass {\n timestamp = '';\n\n format = DEFAULT_FORMAT;\n\n selectedCounterIdx = 0;\n\n updateCountersDisplay() {\n this.inputElement.value = this.countersValue;\n }\n\n updateValue() {\n if (this.isCountersOutOfRange) {\n this.updateTimestamp('');\n } else {\n const date = formats[this.format].getDate(this.inputElement.value);\n this.updateTimestamp(date.getTime());\n }\n }\n\n onDateCounterChange = () => {\n this.updateCountersDisplay();\n this.updateValue();\n // update validity\n this.#dispatchInput();\n };\n\n updateTimestamp(epochOrDate) {\n if (!epochOrDate) {\n this.timestamp = '';\n } else {\n this.timestamp = newDate(epochOrDate).getTime();\n }\n }\n\n dateCounters = [\n new DateCounter(counterConfig.MONTH, this.onDateCounterChange.bind(this)),\n new DateCounter(counterConfig.DAY, this.onDateCounterChange.bind(this)),\n new DateCounter(counterConfig.YEAR, this.onDateCounterChange.bind(this)),\n ];\n\n static get observedAttributes() {\n return [].concat(BaseInputClass.observedAttributes || [], observedAttrs);\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div>\n <descope-text-field inputmode=\"numeric\">\n <span slot=\"suffix\" class=\"toggle-calendar\">\n ${calendarIcon}\n </span>\n </descope-text-field>\n <vaadin-popover></vaadin-popover>\n </div>\n `;\n\n injectStyle(\n `\n :host {\n display: inline-block;\n box-sizing: border-box;\n user-select: none;\n max-width: 100%;\n }\n\n :host ::slotted {\n padding: 0;\n }\n\n .toggle-calendar {\n cursor: pointer;\n display: flex;\n align-self: center;\n z-index: 1;\n height: 100%;\n align-items: center;\n }\n\n :host([readonly=\"true\"]) .toggle-calendar {\n pointer-events: none;\n }\n\n .hidden {\n display: none;\n }\n `,\n this\n );\n\n this.inputElement = this.shadowRoot.querySelector('descope-text-field');\n this.popoverToggleButton = this.inputElement.querySelector('.toggle-calendar');\n }\n\n get validationTarget() {\n return this.inputElement;\n }\n\n get opened() {\n return this.getAttribute('opened') === 'true';\n }\n\n // returns the input's value as a timestamp\n get displayValueEpoch() {\n const date = formats[this.format].getDate(this.inputElement.value);\n\n if (!isValidTimestamp(date?.getTime())) {\n return null;\n }\n\n return date.getTime();\n }\n\n get sortedCounters() {\n return this.format\n .split(DIVIDER)\n .map((placeholder) => this.dateCounters.find((dc) => dc.placeholder === placeholder));\n }\n\n get activeCounter() {\n return this.sortedCounters[this.selectedCounterIdx];\n }\n\n get countersValue() {\n return this.sortedCounters.map((dc) => dc.stringValue).join(DIVIDER);\n }\n\n get overlay() {\n return this.baseElement.shadowRoot?.querySelector('vaadin-popover-overlay');\n }\n\n get backdrop() {\n return this.overlay.shadowRoot?.querySelector('#backdrop');\n }\n\n get calendar() {\n return this.overlay?.querySelector('descope-calendar');\n }\n\n get isRTL() {\n const computedStyleDirection = getComputedStyle(this.baseElement).getPropertyValue('direction');\n\n if (computedStyleDirection) {\n return computedStyleDirection === 'rtl';\n }\n\n // Fallback: If for some reason computed style was not calculated in time, fallback to check on attribute\n return this.getAttribute('st-host-direction') === 'rtl';\n }\n\n get value() {\n if (this.isInvalidDate()) {\n return '';\n }\n return this.timestamp;\n }\n\n set value(val) {\n if (val) {\n this.updateTimestamp(val);\n this.updateDateCounters(newDate(val));\n } else {\n this.updateTimestamp('');\n }\n }\n\n get isCountersEmpty() {\n return this.dateCounters.every((dc) => dc.isEmpty);\n }\n\n get isCountersOutOfRange() {\n return this.dateCounters.some((dc) => !dc.isInRange(dc.numberValue));\n }\n\n get disableCalendar() {\n return this.getAttribute('disable-calendar') === 'true';\n }\n\n reportValidity() {\n this.inputElement.reportValidity();\n }\n\n #dispatchInput() {\n this.inputElement.baseElement.dispatchEvent(new Event('input', { bubbles: true }));\n }\n\n updateInputDisplay() {\n this.inputElement.value = formatTimestamp(newDate(this.countersValue).getTime(), this.format);\n }\n\n init() {\n super.init?.();\n\n this.updateFormatPattern();\n this.initPopover();\n this.onDateCounterChange();\n this.initInputElement();\n\n setTimeout(() => {\n this.#overrideOverlaySettings();\n }, 0);\n }\n\n initInputElement() {\n this.inputElement.getValidity = this.getValidity.bind(this);\n this.inputElement.baseElement.checkValidity = this.checkValidity.bind(this);\n\n this.popoverToggleButton.addEventListener('click', this.onPopoverToggle.bind(this));\n\n this.inputElement.addEventListener('focus', this.onFocus.bind(this));\n this.inputElement.addEventListener('blur', this.onBlur.bind(this));\n this.inputElement.addEventListener('click', this.handleMouseCaretPositionChange.bind(this));\n this.inputElement.addEventListener('keydown', this.handleArrowKeys.bind(this));\n this.inputElement.addEventListener('beforeinput', this.handleInput.bind(this));\n this.inputElement.addEventListener('pointerdown', this.onPointerDown.bind(this));\n\n forwardAttrs(this, this.inputElement, {\n includeAttrs: [\n 'label',\n 'label-type',\n 'placeholder',\n 'disabled',\n 'readonly',\n 'bordered',\n 'required',\n 'full-width',\n 'st-host-direction',\n 'pattern',\n 'bordered',\n 'data-errormessage-value-missing',\n 'data-errormessage-pattern-mismatch',\n 'data-errormessage-range-underflow',\n 'data-errormessage-range-overflow',\n 'st-error-message-icon',\n 'st-error-message-icon-size',\n 'st-error-message-icon-padding',\n ],\n });\n }\n\n handleInput(e) {\n e.preventDefault();\n\n if (e.data && isNumber(e.data)) {\n this.parseDigits(e.data);\n this.updateCountersDisplay();\n } else if (e.inputType) {\n this.handleNavKeys(e);\n }\n }\n\n initPopover() {\n this.baseElement.trigger = ['click'];\n this.baseElement.withBackdrop = true;\n this.baseElement.renderer = this.#popoverRenderer.bind(this);\n\n // block popover events from focusing/blurring the text-field\n this.baseElement.addEventListener('click', (e) => {\n e.preventDefault();\n e.stopPropagation();\n });\n }\n\n #popoverPosStylesheet;\n\n #popoverRenderer(root) {\n // popoverRenderer should run only once, when the popover is first rendering.\n if (!root.firstChild) {\n this.overlay.positionTarget = this.shadowRoot.querySelector('.toggle-calendar');\n\n root.appendChild(this.#getPopoverContent());\n\n // override vaadin's constructed stylesheet which hides the host element\n overrideConstructedStylesheet(this.baseElement);\n\n this.backdrop.addEventListener('click', this.closePopover.bind(this));\n }\n\n // Hide overlay before adjusting position to prevent flickering\n root.style.setProperty('visibility', 'hidden');\n\n // Wait until overlay is ready\n setTimeout(() => {\n this.#adjustPopoverPosition(root);\n\n // Show adjusted overlay\n root.style.setProperty('visibility', 'visible');\n this.updateCalendarView(root);\n }, 100);\n }\n\n #adjustPopoverPosition() {\n const popover = this.shadowRoot.querySelector('vaadin-popover').shadowRoot;\n\n // Remove previously added stylesheets\n this.#popoverPosStylesheet?.remove();\n\n const windowRect = document.body.getBoundingClientRect();\n const inputRect = this.getBoundingClientRect();\n const calendarRect = this.calendar.getBoundingClientRect();\n\n const side = this.isRTL ? 'right' : 'left';\n const offset = inputRect[side] - calendarRect[side];\n const availableLeft = calendarRect.left;\n const availableRight = windowRect.width - calendarRect.right;\n\n let newOffset;\n if (offset > 0) {\n newOffset = Math.min(offset, availableRight);\n } else {\n newOffset = Math.min(Math.abs(offset), availableLeft) * -1;\n }\n\n injectStyle(\n `\n vaadin-popover-overlay::part(overlay) {\n transform: translateX(${newOffset}px);\n }\n `,\n popover\n );\n }\n\n #getPopoverContent() {\n const ele = document.createElement('span');\n\n ele.innerHTML = `<descope-calendar></descope-calendar>`;\n\n const calendar = ele.querySelector('descope-calendar');\n\n calendar.addEventListener('date-submit', this.onCalendarSubmit.bind(this));\n calendar.addEventListener('cancel', this.closePopover.bind(this));\n\n return ele;\n }\n\n // the default vaadin behavior is to attach the overlay to the body when opened\n // we do not want that because it's difficult to style the overlay in this way\n // so we override it to open inside the shadow DOM\n #overrideOverlaySettings() {\n this.overlay._attachOverlay = () => this.overlay.bringToFront();\n this.overlay._detachOverlay = () => {};\n this.overlay._enterModalState = () => {};\n }\n\n onPopoverToggle() {\n this.opened ? this.closePopover() : this.openPopover();\n }\n\n openPopover() {\n if (this.disableCalendar) return;\n this.setAttribute('opened', 'true');\n }\n\n closePopover() {\n this.removeAttribute('opened');\n this.inputElement.focus();\n }\n\n getCounterById(id) {\n return this.dateCounters.find((dc) => dc.id === id);\n }\n\n onCalendarSubmit() {\n if (!this.isReadOnly) {\n if (!this.calendar.value) return;\n\n const calendarDate = newDate(this.calendar.value);\n\n this.value = calendarDate.getTime();\n\n this.getCounterById('year').replaceValue(calendarDate.getFullYear());\n this.getCounterById('month').replaceValue(calendarDate.getMonth() + 1);\n this.getCounterById('day').replaceValue(calendarDate.getDate());\n\n this.#dispatchInput();\n }\n\n this.closePopover();\n }\n\n updateCalendarView() {\n const validInputVal =\n isValidTimestamp(newDate(this.inputElement.value || '').getTime()) &&\n formats[this.format].validate(this.inputElement.value);\n\n if (this.displayValueEpoch || validInputVal) {\n this.calendar.setAttribute(\n 'initial-value',\n formatTimestamp(this.displayValueEpoch || this.timestamp, NATIVE_FORMAT)\n );\n } else {\n this.calendar.clearValue();\n this.calendar.setAttribute('preview', formatTimestamp(getCurrentTime(), NATIVE_FORMAT));\n }\n\n forwardAttrs(this, this.calendar, {\n includeAttrs: [\n 'st-host-direction',\n 'readonly',\n 'initial-month',\n 'initial-year',\n 'years-range',\n 'calendar-label-submit',\n 'calendar-label-cancel',\n 'calendar-months',\n 'calendar-weekdays',\n 'calendar-weekdays-short',\n ],\n });\n }\n\n // In mobile devices, there are cases were `pointerdown` is triggered\n // instead of `click`.\n onPointerDown(e) {\n setTimeout(() => this.handleMouseCaretPositionChange(e), MOBILE_DEVICE_INTERACTION_TIMEOUT_MS);\n }\n\n onFocus() {\n if (this.isReadOnly) {\n return;\n }\n\n // We need to wait for focus to end before we set selection\n setTimeout(() => this.resetDisplay());\n }\n\n resetDisplay() {\n if (!this.inputElement.value) {\n this.inputElement.value = this.format;\n }\n\n // On focus select the first counter\n this.selectedCounterIdx = 0;\n this.inputElement.setSelectionRange(0, this.sortedCounters[0].length);\n }\n\n onBlur() {\n if (this.opened) {\n return;\n }\n\n if (this.inputElement.value === this.format) {\n this.inputElement.value = '';\n }\n }\n\n onFormatUpdate(format) {\n if (Object.keys(formats).includes(format)) {\n this.format = format;\n this.updateFormatPattern();\n }\n }\n\n updateFormatPattern() {\n const format = this.getAttribute('format') || this.format || DEFAULT_FORMAT;\n this.setAttribute('type', 'date');\n this.setAttribute('pattern', formats[format].pattern);\n }\n\n parseDigits(value) {\n this.activeCounter.add(value);\n\n if (this.activeCounter.isFull) {\n this.selectNextCounter();\n }\n\n // We wait for the digit to be parsed, and only then set the selection.\n // Failing to do so results in unexpected \"jump\" of the screen in mobile devices.\n this.setInputSelectionRange();\n }\n\n getCounterIdx(caretPos) {\n const [counter1ln, counter2ln] = this.sortedCounters.map((dc) => dc.length);\n\n const c1 = caretPos <= counter1ln;\n const c2 = caretPos >= counter1ln && caretPos <= counter1ln + counter2ln + 1;\n const c3 = caretPos >= counter1ln + counter2ln + 2;\n\n return [c1, c2, c3].indexOf(true);\n }\n\n setSelectedCounterByCaretPosition(e) {\n this.selectedCounterIdx = this.getCounterIdx(\n // if triggered by touch event, target might not include `selectionStart`\n // in that case we fall back to the inputElement's `selectionStart` value.\n // Therefore, it is recommended to run this function with setTimeout,\n // at least for mobile events.\n e.target?.selectionStart || this.inputElement.selectionStart\n );\n }\n\n selectNextCounter() {\n if (this.selectedCounterIdx < this.dateCounters.length) {\n this.selectedCounterIdx = Math.min(this.selectedCounterIdx + 1, 2);\n }\n }\n\n selectPrevCounter() {\n if (this.selectedCounterIdx > 0) {\n this.selectedCounterIdx = Math.min(this.selectedCounterIdx - 1, 1);\n }\n }\n\n // Sets the text selection range in the input element based on the selected counter.\n // The function calculates the starting position of the selection by summing the lengths\n // of all counters before the currently selected counter (`selectedCounterIdx`).\n // It then selects the entire length of the current counter in the input element.\n setInputSelectionRange() {\n // For preview/readonly state we don't have a caret or a caretIdx, so we skip setting input selection range\n if (this.selectedCounterIdx < 0) {\n return;\n }\n\n // We wait for before setting the selection, otherwise there's an\n // unexpected \"jump\" of the screen in mobile devices.\n setTimeout(() => {\n const caretStart = this.sortedCounters\n .slice(0, this.selectedCounterIdx)\n .reduce((acc, counter) => acc + counter.length, this.selectedCounterIdx);\n\n this.inputElement.setSelectionRange(\n caretStart,\n caretStart + this.sortedCounters[this.selectedCounterIdx].length\n );\n });\n }\n\n resetDateCounters() {\n this.dateCounters.forEach((dc) => dc.clear());\n }\n\n // in case value is set from external source we need to update date counters\n updateDateCounters(date) {\n this.dateCounters.forEach((dc) => {\n switch (dc.id) {\n case counterConfig.MONTH.id:\n dc.set(date.getMonth() + 1);\n break;\n case counterConfig.YEAR.id:\n dc.set(date.getFullYear());\n break;\n case counterConfig.DAY.id:\n dc.set(date.getDate());\n break;\n default:\n break;\n }\n });\n }\n\n handleArrowKeys(e) {\n if (e.key === 'ArrowUp') {\n this.activeCounter.inc();\n } else if (e.key === 'ArrowDown') {\n this.activeCounter.dec();\n } else if (e.key === 'ArrowRight') {\n this.selectNextCounter();\n } else if (e.key === 'ArrowLeft') {\n this.selectPrevCounter();\n }\n\n this.setInputSelectionRange();\n }\n\n handleNavKeys(e) {\n if (this.isReadOnly) {\n return;\n }\n\n if (this.opened) {\n this.closePopover();\n }\n\n if (!this.activeCounter) return;\n\n if (e.inputType === 'deleteContentBackward') {\n this.handleBackspace();\n }\n\n this.setInputSelectionRange();\n }\n\n handleBackspace() {\n const counter = this.activeCounter;\n\n if (counter.isEmpty) {\n this.selectPrevCounter();\n this.setInputSelectionRange();\n } else {\n counter.set('');\n }\n\n // To support keyboards like SwiftKey, we need to re-render the counters display and selection,\n // otherwise we get an unexpected behavior, where the format is deleted.\n setTimeout(() => {\n this.updateCountersDisplay();\n this.setInputSelectionRange();\n });\n }\n\n handleMouseCaretPositionChange(e) {\n if (this.opened) {\n return;\n }\n\n e.preventDefault();\n\n this.setSelectedCounterByCaretPosition(e);\n this.setInputSelectionRange();\n }\n\n onInitialValueChange(val) {\n // if component already has a value don't re-set value\n if (this.value) return;\n\n // we need to wait for the text-field to init\n setTimeout(() => {\n this.value = val;\n });\n }\n\n togglePopoverAccess(visibility) {\n if (visibility) {\n this.popoverToggleButton.classList.remove('hidden');\n } else {\n this.popoverToggleButton.classList.add('hidden');\n }\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue !== newValue) {\n if (attrName === 'disable-calendar') {\n this.togglePopoverAccess(newValue !== 'true');\n }\n if (dateFieldAttrs.includes(attrName)) {\n if (newValue && attrName === 'format') {\n this.onFormatUpdate(newValue);\n }\n if (attrName === 'initial-value') {\n this.onInitialValueChange(newValue);\n }\n } else if (calendarAttrs.includes(attrName)) {\n if (newValue) {\n this.calendar?.setAttribute(attrName, newValue);\n } else {\n this.calendar?.removeAttribute(attrName);\n }\n }\n }\n }\n\n // we want to validate the date supplied actually exists. For example: Feb 31 is not an actual date,\n // but in JS when create a `new Date('1999-02-31') we get March 2nd 1999.\n // To prevent this error from being submitted, we evaluate the\n // date parts against their generated Date value.\n isInvalidDate() {\n const yearCounter = this.getCounterById('year');\n const isYearOutOfRange =\n yearCounter.numberValue > valRange['year'].max ||\n yearCounter.numberValue < valRange['year'].min;\n\n const isDateDisplayMismatch = Object.entries(this.getDateVals()).some(([key, val]) => {\n const counter = this.getCounterById(key);\n return !val || counter.numberValue !== val;\n });\n\n return isYearOutOfRange || isDateDisplayMismatch;\n }\n\n getValidity() {\n if (this.isRequired && this.isCountersEmpty) {\n return { valueMissing: true };\n }\n\n if (this.isCountersOutOfRange || this.isInvalidDate()) {\n return { patternMismatch: true };\n }\n\n return {};\n }\n\n getDateVals() {\n const ret = {\n day: '',\n month: '',\n year: '',\n };\n\n try {\n const date = newDate(this.timestamp);\n\n ret.month = date.getMonth() + 1;\n ret.day = date.getDate();\n ret.year = date.getFullYear();\n } catch (e) {}\n\n return ret;\n }\n}\n\nconst textVars = TextFieldClass.cssVarList;\nconst { host, input, inputEleRTL, toggleButton, overlay, backdrop, errorMessage } = {\n host: { selector: () => ':host' },\n input: { selector: () => 'descope-text-field' },\n inputEleRTL: { selector: () => ':host([st-host-direction=\"rtl\"]) descope-text-field' },\n toggleButton: { selector: () => '.toggle-calendar' },\n overlay: { selector: 'vaadin-popover-overlay::part(overlay)' },\n backdrop: { selector: 'vaadin-popover-overlay::part(backdrop)' },\n};\n\nexport const DateFieldClass = compose(\n createStyleMixin({ componentNameOverride: getComponentName('input-wrapper') }),\n createStyleMixin({\n mappings: {\n iconMargin: { ...toggleButton, property: 'margin-inline-end' },\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n textAlign: { ...input, property: 'text-align' },\n rtlInputDirection: { ...inputEleRTL, property: textVars.inputDirection },\n rtlInputAlignment: { ...inputEleRTL, property: textVars.inputTextAlign },\n overlayGap: {\n property: () => DateFieldClass.cssVarList.overlayGap,\n },\n overlayBackgroundColor: {\n property: () => DateFieldClass.cssVarList.overlayBackgroundColor,\n },\n overlayPadding: {\n property: () => DateFieldClass.cssVarList.overlayPadding,\n },\n overlayBoxShadow: { property: () => DateFieldClass.overlayBoxShadow },\n overlayOutlineWidth: {\n property: () => DateFieldClass.cssVarList.overlayOutlineWidth,\n },\n overlayOutlineColor: {\n property: () => DateFieldClass.cssVarList.overlayOutlineColor,\n },\n overlayOutlineStyle: {\n property: () => DateFieldClass.cssVarList.overlayOutlineStyle,\n },\n errorMessageIcon: {\n selector: TextFieldClass.componentName,\n property: TextFieldClass.cssVarList.errorMessageIcon,\n },\n errorMessageIconSize: {\n selector: TextFieldClass.componentName,\n property: TextFieldClass.cssVarList.errorMessageIconSize,\n },\n errorMessageIconPadding: {\n selector: TextFieldClass.componentName,\n property: TextFieldClass.cssVarList.errorMessageIconPadding,\n },\n errorMessageIconRepeat: {\n selector: TextFieldClass.componentName,\n property: TextFieldClass.cssVarList.errorMessageIconRepeat,\n },\n errorMessageIconPosition: {\n selector: TextFieldClass.componentName,\n property: TextFieldClass.cssVarList.errorMessageIconPosition,\n },\n errorMessageFontSize: {\n selector: TextFieldClass.componentName,\n property: TextFieldClass.cssVarList.errorMessageFontSize,\n },\n },\n }),\n portalMixin({\n name: 'overlay',\n selector: '',\n mappings: {\n marginTop: { ...overlay, property: 'margin-top' },\n backgroundColor: { ...overlay },\n backdropBackgroundColor: { ...backdrop, property: 'background-color' },\n backdropPointerEvents: { ...backdrop, property: 'pointer-events' },\n padding: { ...overlay },\n boxShadow: { ...overlay },\n outlineWidth: { ...overlay },\n outlineColor: { ...overlay },\n outlineStyle: { ...overlay },\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(RawDateFieldClass);\n","import '@vaadin/popover/src/vaadin-popover';\nimport './descope-calendar';\nimport '../descope-text-field';\n\nimport { componentName, DateFieldClass } from './DateFieldClass';\n\ncustomElements.define(componentName, DateFieldClass);\n\nexport { DateFieldClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n createProxy,\n proxyInputMixin,\n componentNameValidationMixin,\n} from '../../mixins';\nimport textFieldMappings from './textFieldMappings';\nimport { compose } from '../../helpers';\nimport { getComponentName } from '../../helpers/componentHelpers';\nimport {\n inputFloatingLabelStyle,\n resetInputLabelPosition,\n resetInputOverrides,\n useHostExternalPadding,\n} from '../../helpers/themeHelpers/resetHelpers';\n\nexport const componentName = getComponentName('text-field');\n\nconst observedAttrs = ['type', 'label-type', 'copy-to-clipboard'];\n\nconst customMixin = (superclass) =>\n class TextFieldClass extends superclass {\n static get observedAttributes() {\n return observedAttrs.concat(superclass.observedAttributes || []);\n }\n\n icon;\n\n init() {\n super.init?.();\n }\n\n renderCopyToClipboard(shouldRender) {\n if (!shouldRender) {\n this.icon?.remove();\n return;\n }\n\n const iconInitConfig = {\n icon: 'vaadin:copy-o',\n title: 'Copy',\n style: 'cursor: pointer',\n };\n\n const iconCopiedConfig = {\n icon: 'vaadin:check-circle-o',\n title: 'Copied',\n style: 'cursor: initial',\n };\n\n this.icon = Object.assign(document.createElement('vaadin-icon'), {\n slot: 'suffix',\n ...iconInitConfig,\n });\n\n this.baseElement.appendChild(this.icon);\n this.icon.addEventListener('click', () => {\n navigator.clipboard.writeText(this.value);\n Object.assign(this.icon, iconCopiedConfig);\n\n // we want the icon to go back to the initial state after 5 seconds\n setTimeout(() => {\n Object.assign(this.icon, iconInitConfig);\n }, 5000);\n });\n }\n\n onLabelClick() {\n this.focus();\n }\n\n attributeChangedCallback(attrName, oldVal, newVal) {\n super.attributeChangeCallback?.(attrName, oldVal, newVal);\n\n // Vaadin doesn't allow to change the input type attribute.\n // We need the ability to do that, so we're overriding their\n // behavior with their private API.\n // When receiving a `type` attribute, we use their private API\n // to set it on the input.\n if (attrName === 'type') {\n this.baseElement._setType(newVal);\n }\n\n if (oldVal !== newVal) {\n if (attrName === 'label-type') {\n if (newVal === 'floating') {\n this.addEventListener('click', this.onLabelClick);\n } else {\n this.removeEventListener('click', this.onLabelClick);\n }\n } else if (attrName === 'copy-to-clipboard') {\n this.renderCopyToClipboard(newVal === 'true');\n }\n }\n }\n };\n\nexport const TextFieldClass = compose(\n createStyleMixin({\n mappings: textFieldMappings,\n }),\n draggableMixin,\n proxyInputMixin({ proxyProps: ['value', 'selectionStart'], useProxyTargets: true }),\n componentNameValidationMixin,\n customMixin\n)(\n createProxy({\n slots: ['prefix', 'suffix'],\n wrappedEleName: 'vaadin-text-field',\n style: () => `\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tpadding: calc(var(${TextFieldClass.cssVarList.inputOutlineWidth}) + var(${\n TextFieldClass.cssVarList.inputOutlineOffset\n }));\n box-sizing: border-box;\n\t\t\t}\n :host(:is([readonly], [disabled])) ::slotted(:is(input, textarea):placeholder-shown) {\n opacity: 1;\n }\n\n vaadin-text-field[label-type=\"floating\"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n vaadin-text-field[label-type=\"floating\"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n ${resetInputLabelPosition('vaadin-text-field')}\n\t\t\t${useHostExternalPadding(TextFieldClass.cssVarList)}\n\t\t\t${resetInputOverrides('vaadin-text-field', TextFieldClass.cssVarList)}\n ${inputFloatingLabelStyle()}\n\n vaadin-text-field vaadin-icon {\n align-self: center;\n }\n\t\t`,\n excludeAttrsSync: ['tabindex', 'style'],\n componentName,\n })\n);\n"],"names":["host","label","placeholder","requiredIndicator","inputField","input","inputMask","helperText","errorMessage","disabledPlaceholder","inputDisabled","inputIcon","externalInput","externalInputDisabled","externalPlaceholder","externalDisabledPlaceholder","selector","fontSize","fontFamily","labelFontSize","property","labelFontWeight","labelTextColor","hostWidth","hostMinWidth","hostDirection","inputDirection","inputBackgroundColor","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","helperTextColor","inputValueTextColor","inputCaretTextColor","labelRequiredIndicator","inputBorderColor","inputBorderWidth","inputBorderStyle","inputBorderRadius","inputHeight","inputHorizontalPadding","inputOutlineColor","inputOutlineStyle","inputOutlineWidth","inputOutlineOffset","textAlign","inputTextAlign","inputPlaceholderColor","labelPosition","labelTopPosition","labelHorizontalPosition","inputTransformY","inputTransition","marginInlineStart","placeholderOpacity","inputVerticalAlignment","valueInputHeight","valueInputMarginBottom","inputIconOffset","inputIconSize","inputIconColor","customElements","define","patterns","MM","DD","YYYY","createFormat","format","pattern","split","map","part","join","createPattern","toValuesFn","order","match","values","forEach","index","createToValuesFn","regexp","RegExp","validate","val","test","getDate","exec","year","month","day","createDate","formats","Object","fromEntries","f","DateCounter","freeze","constructor","id","min","max","onChange","this","data","length","numberValue","Number","stringValue","padStart","isFull","isEmpty","toString","set","add","num","slice","del","filter","d","Boolean","clear","inc","gap","replaceValue","Math","dec","isInRange","setMin","setMax","componentName","BaseInputClass","createBaseInputClass","baseSelector","dateFieldAttrs","calendarAttrs","observedAttrs","textVars","TextFieldClass","cssVarList","inputEleRTL","toggleButton","overlay","backdrop","DateFieldClass","componentNameOverride","mappings","iconMargin","rtlInputDirection","rtlInputAlignment","overlayGap","overlayBackgroundColor","overlayPadding","overlayBoxShadow","overlayOutlineWidth","overlayOutlineColor","overlayOutlineStyle","name","marginTop","backgroundColor","backdropBackgroundColor","backdropPointerEvents","padding","boxShadow","outlineWidth","outlineColor","outlineStyle","timestamp","selectedCounterIdx","updateCountersDisplay","inputElement","value","countersValue","updateValue","isCountersOutOfRange","updateTimestamp","date","getTime","onDateCounterChange","epochOrDate","dateCounters","MONTH","bind","DAY","YEAR","observedAttributes","concat","super","attachShadow","mode","innerHTML","shadowRoot","querySelector","popoverToggleButton","validationTarget","opened","getAttribute","displayValueEpoch","sortedCounters","find","dc","activeCounter","baseElement","calendar","isRTL","computedStyleDirection","getComputedStyle","getPropertyValue","isInvalidDate","updateDateCounters","isCountersEmpty","every","some","disableCalendar","reportValidity","dispatchEvent","Event","bubbles","updateInputDisplay","init","updateFormatPattern","initPopover","initInputElement","setTimeout","getValidity","checkValidity","addEventListener","onPopoverToggle","onFocus","onBlur","handleMouseCaretPositionChange","handleArrowKeys","handleInput","onPointerDown","includeAttrs","e","preventDefault","parseDigits","inputType","handleNavKeys","trigger","withBackdrop","renderer","stopPropagation","root","firstChild","positionTarget","appendChild","closePopover","style","setProperty","updateCalendarView","popover","remove","windowRect","document","body","getBoundingClientRect","inputRect","calendarRect","side","offset","availableLeft","left","availableRight","width","right","newOffset","abs","ele","createElement","onCalendarSubmit","_attachOverlay","bringToFront","_detachOverlay","_enterModalState","openPopover","setAttribute","removeAttribute","focus","getCounterById","isReadOnly","calendarDate","getFullYear","getMonth","validInputVal","clearValue","resetDisplay","setSelectionRange","onFormatUpdate","keys","includes","selectNextCounter","setInputSelectionRange","getCounterIdx","caretPos","counter1ln","counter2ln","indexOf","setSelectedCounterByCaretPosition","target","selectionStart","selectPrevCounter","caretStart","reduce","acc","counter","resetDateCounters","key","handleBackspace","onInitialValueChange","togglePopoverAccess","visibility","classList","attributeChangedCallback","attrName","oldValue","newValue","yearCounter","isYearOutOfRange","isDateDisplayMismatch","entries","getDateVals","isRequired","valueMissing","patternMismatch","ret","proxyProps","useProxyTargets","superclass","icon","renderCopyToClipboard","shouldRender","iconInitConfig","title","iconCopiedConfig","assign","slot","navigator","clipboard","writeText","onLabelClick","oldVal","newVal","attributeChangeCallback","_setType","removeEventListener","slots","wrappedEleName","excludeAttrsSync"],"sourceRoot":""}
1
+ {"version":3,"file":"descope-date-field-index-js.js","mappings":"yJAAA,MAAM,KACJA,EAAI,MACJC,EAAK,YACLC,EAAW,kBACXC,EAAiB,WACjBC,EAAU,MACVC,EAAK,UACLC,EAAS,WACTC,EAAU,aACVC,EAAY,oBACZC,EAAmB,cACnBC,EAAa,UACbC,EAAS,cACTC,EAAa,sBACbC,EAAqB,oBACrBC,EAAmB,4BACnBC,GACE,CACFf,KAAM,CAAEgB,SAAU,IAAM,SACxBf,MAAO,CAAEe,SAAU,iBACnBb,kBAAmB,CAAEa,SAAU,+CAC/Bd,YAAa,CACX,CAAEc,SAAU,6BACZ,CAAEA,SAAU,IAAM,4CAEpBP,oBAAqB,CAAEO,SAAU,iCACjCZ,WAAY,CAAEY,SAAU,uBACxBX,MAAO,CAAEW,SAAU,SACnBV,UAAW,CAAEU,SAAU,+BACvBN,cAAe,CAAEM,SAAU,kBAC3BT,WAAY,CAAES,SAAU,uBACxBR,aAAc,CAAEQ,SAAU,yBAC1BL,UAAW,CAAEK,SAAU,eACvBJ,cAAe,CAAEI,SAAU,IAAM,oBACjCH,sBAAuB,CAAEG,SAAU,IAAM,6BACzCF,oBAAqB,CAAEE,SAAU,IAAM,sCACvCD,4BAA6B,CAAEC,SAAU,IAAM,2CAGjD,GAEEC,SAAU,CAAC,CAAC,EAAGjB,GACfkB,WAAY,CAACjB,EAAOG,EAAYG,EAAYC,GAE5CW,cAAe,IAAKlB,EAAOmB,SAAU,aACrCC,gBAAiB,IAAKpB,EAAOmB,SAAU,eAEvCE,eAAgB,CACd,IAAKrB,EAAOmB,SAAU,SACtB,IAAKjB,EAAmBiB,SAAU,SAClC,IAAKnB,EAAOmB,SAAU,2BACtB,IAAKjB,EAAmBiB,SAAU,4BAGpC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AK,EAAiBA,KAAKsI,cAAc1F,aACzC5C,KAAKsI,cAAcpF,IAAI,KAGzBlD,KAAKiO,wBACP,CAEA,GAAiBhN,GACf,IACEH,UAAUC,UAAUC,UAAUC,EAChC,CAAE,MAAOwP,GACPC,QAAQC,MAAM,6BAA8BF,EAC9C,CACF,CAEA,OAAAlG,CAAQE,GACNA,EAAEC,iBAEF,MACMkG,GADgBnG,EAAEoG,eAAiBC,OAAOD,eACfE,QAAQ,QAGnCC,GAAY,QAAgBJ,EAAY5Q,KAAKqG,QAEnD,GAAI2K,EACFhR,KAAKiB,MAAQ+P,EAAUhK,UACvBhH,KAAKiH,sBAGL/F,YAAW,IAAMlB,KAAKwG,aAAamH,kBAAkB,EAAG3N,KAAKwG,aAAavF,MAAMwB,cAC3E,CACL,MAAMxB,EAAQ0B,OAAOiO,GAGjB3P,GAASjB,KAAKsI,cAAclG,KAAOnB,GAASjB,KAAKsI,cAAcjG,KAAOpB,IAExEjB,KAAKsI,cAAcpF,IAAI+N,OAAOhQ,IAE9BC,YAAW,IAAMlB,KAAKiO,2BAE1B,CACF,IC7zBFjP,eAAeC,OAAOC,EAAe4F,E","sources":["webpack://@descope/web-components-ui/./src/components/descope-text-field/textFieldMappings.js","webpack://@descope/web-components-ui/./src/components/descope-text-field/index.js","webpack://@descope/web-components-ui/./src/components/descope-text-field/TextFieldClass.js","webpack://@descope/web-components-ui/./src/components/descope-date-field/DateCounterClass.js","webpack://@descope/web-components-ui/./src/components/descope-date-field/DateFieldClass.js","webpack://@descope/web-components-ui/./src/components/descope-date-field/index.js"],"sourcesContent":["const {\n host,\n label,\n placeholder,\n requiredIndicator,\n inputField,\n input,\n inputMask,\n helperText,\n errorMessage,\n disabledPlaceholder,\n inputDisabled,\n inputIcon,\n externalInput,\n externalInputDisabled,\n externalPlaceholder,\n externalDisabledPlaceholder,\n} = {\n host: { selector: () => ':host' },\n label: { selector: '::part(label)' },\n requiredIndicator: { selector: '[required]::part(required-indicator)::after' },\n placeholder: [\n { selector: '> input:placeholder-shown' },\n { selector: () => ':host::slotted(input:placeholder-shown)' },\n ],\n disabledPlaceholder: { selector: '> input:disabled::placeholder' },\n inputField: { selector: '::part(input-field)' },\n input: { selector: 'input' },\n inputMask: { selector: '::part(input-field)::before' },\n inputDisabled: { selector: 'input:disabled' },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n inputIcon: { selector: 'vaadin-icon' },\n externalInput: { selector: () => '::slotted(input)' },\n externalInputDisabled: { selector: () => '::slotted(input:disabled)' },\n externalPlaceholder: { selector: () => '::slotted(input:placeholder-shown)' },\n externalDisabledPlaceholder: { selector: () => '::slotted(input:disabled::placeholder)' },\n};\n\nexport default {\n // we apply font-size also on the host so we can set its width with em\n fontSize: [{}, host],\n fontFamily: [label, inputField, helperText, errorMessage],\n\n labelFontSize: { ...label, property: 'font-size' },\n labelFontWeight: { ...label, property: 'font-weight' },\n\n labelTextColor: [\n { ...label, property: 'color' },\n { ...requiredIndicator, property: 'color' },\n { ...label, property: '-webkit-text-fill-color' },\n { ...requiredIndicator, property: '-webkit-text-fill-color' },\n ],\n\n hostWidth: { ...host, property: 'width' },\n hostMinWidth: { ...host, property: 'min-width' },\n hostDirection: { ...host, property: 'direction' },\n inputDirection: { ...input, property: 'direction' },\n\n inputBackgroundColor: [\n { ...inputField, property: 'background-color' },\n { ...inputMask, property: 'background-color' },\n ],\n\n errorMessageTextColor: { ...errorMessage, property: 'color' },\n errorMessageIcon: { ...errorMessage, property: 'background-image' },\n errorMessageIconSize: { ...errorMessage, property: 'background-size' },\n errorMessageIconPadding: { ...errorMessage, property: 'padding-inline-start' },\n errorMessageIconRepeat: { ...errorMessage, property: 'background-repeat' },\n errorMessageIconPosition: { ...errorMessage, property: 'background-position' },\n errorMessageFontSize: { ...errorMessage, property: 'font-size' },\n\n helperTextColor: { ...helperText, property: '-webkit-text-fill-color' },\n\n inputValueTextColor: [\n { ...inputField, property: 'color' },\n { ...inputDisabled, property: '-webkit-text-fill-color' },\n { ...externalInputDisabled, property: '-webkit-text-fill-color' },\n ],\n inputCaretTextColor: [\n { ...input, property: 'caret-color' },\n { ...externalInput, property: 'caret-color' },\n ],\n\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\n\n inputBorderColor: { ...inputField, property: 'border-color' },\n inputBorderWidth: { ...inputField, property: 'border-width' },\n inputBorderStyle: { ...inputField, property: 'border-style' },\n inputBorderRadius: { ...inputField, property: 'border-radius' },\n\n inputHeight: { ...inputField, property: 'height' },\n inputHorizontalPadding: [\n { ...input, property: 'padding-left' },\n { ...input, property: 'padding-right' },\n { ...externalInput, property: 'padding-left' },\n { ...externalInput, property: 'padding-right' },\n ],\n\n inputOutlineColor: { ...inputField, property: 'outline-color' },\n inputOutlineStyle: { ...inputField, property: 'outline-style' },\n inputOutlineWidth: { ...inputField, property: 'outline-width' },\n inputOutlineOffset: { ...inputField, property: 'outline-offset' },\n\n textAlign: {},\n\n inputTextAlign: [\n { ...input, property: 'text-align' },\n { ...externalInput, property: 'text-align' },\n ],\n\n inputPlaceholderColor: [\n { selector: () => ':host input:placeholder-shown', property: 'color' },\n { ...externalPlaceholder, property: 'color' },\n { ...placeholder, property: 'color' },\n { ...disabledPlaceholder, property: '-webkit-text-fill-color' },\n { ...externalDisabledPlaceholder, property: '-webkit-text-fill-color' },\n ],\n\n labelPosition: { ...label, property: 'position' },\n labelTopPosition: { ...label, property: 'top' },\n labelHorizontalPosition: [\n { ...label, property: 'left' },\n { ...label, property: 'right' },\n ],\n inputTransformY: { ...label, property: 'transform' },\n inputTransition: { ...label, property: 'transition' },\n marginInlineStart: { ...label, property: 'margin-inline-start' },\n placeholderOpacity: [\n { selector: '> input:placeholder-shown', property: 'opacity' },\n { ...externalPlaceholder, property: 'opacity' },\n ],\n inputVerticalAlignment: [\n { ...inputField, property: 'align-items' },\n { ...externalInput, property: 'align-items' },\n ],\n valueInputHeight: [\n { ...input, property: 'height' },\n { ...externalInput, property: 'height' },\n ],\n valueInputMarginBottom: [\n { ...input, property: 'margin-bottom' },\n { ...externalInput, property: 'margin-bottom' },\n ],\n\n inputIconOffset: [\n { ...inputIcon, property: 'margin-right' },\n { ...inputIcon, property: 'margin-left' },\n ],\n inputIconSize: { ...inputIcon, property: 'font-size' },\n inputIconColor: { ...inputIcon, property: 'color' },\n};\n","import '@vaadin/text-field';\nimport '@vaadin/icons';\nimport '@vaadin/icon';\n\nimport { componentName, TextFieldClass } from './TextFieldClass';\n\ncustomElements.define(componentName, TextFieldClass);\n\nexport { TextFieldClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n createProxy,\n proxyInputMixin,\n componentNameValidationMixin,\n} from '../../mixins';\nimport textFieldMappings from './textFieldMappings';\nimport { compose } from '../../helpers';\nimport { getComponentName } from '../../helpers/componentHelpers';\nimport {\n inputFloatingLabelStyle,\n resetInputLabelPosition,\n resetInputOverrides,\n useHostExternalPadding,\n} from '../../helpers/themeHelpers/resetHelpers';\n\nexport const componentName = getComponentName('text-field');\n\nconst observedAttrs = ['type', 'label-type', 'copy-to-clipboard'];\n\nconst customMixin = (superclass) =>\n class TextFieldClass extends superclass {\n static get observedAttributes() {\n return observedAttrs.concat(superclass.observedAttributes || []);\n }\n\n icon;\n\n init() {\n super.init?.();\n }\n\n renderCopyToClipboard(shouldRender) {\n if (!shouldRender) {\n this.icon?.remove();\n return;\n }\n\n const iconInitConfig = {\n icon: 'vaadin:copy-o',\n title: 'Copy',\n style: 'cursor: pointer',\n };\n\n const iconCopiedConfig = {\n icon: 'vaadin:check-circle-o',\n title: 'Copied',\n style: 'cursor: initial',\n };\n\n this.icon = Object.assign(document.createElement('vaadin-icon'), {\n slot: 'suffix',\n ...iconInitConfig,\n });\n\n this.baseElement.appendChild(this.icon);\n this.icon.addEventListener('click', () => {\n navigator.clipboard.writeText(this.value);\n Object.assign(this.icon, iconCopiedConfig);\n\n // we want the icon to go back to the initial state after 5 seconds\n setTimeout(() => {\n Object.assign(this.icon, iconInitConfig);\n }, 5000);\n });\n }\n\n onLabelClick() {\n this.focus();\n }\n\n attributeChangedCallback(attrName, oldVal, newVal) {\n super.attributeChangeCallback?.(attrName, oldVal, newVal);\n\n // Vaadin doesn't allow to change the input type attribute.\n // We need the ability to do that, so we're overriding their\n // behavior with their private API.\n // When receiving a `type` attribute, we use their private API\n // to set it on the input.\n if (attrName === 'type') {\n this.baseElement._setType(newVal);\n }\n\n if (oldVal !== newVal) {\n if (attrName === 'label-type') {\n if (newVal === 'floating') {\n this.addEventListener('click', this.onLabelClick);\n } else {\n this.removeEventListener('click', this.onLabelClick);\n }\n } else if (attrName === 'copy-to-clipboard') {\n this.renderCopyToClipboard(newVal === 'true');\n }\n }\n }\n };\n\nexport const TextFieldClass = compose(\n createStyleMixin({\n mappings: textFieldMappings,\n }),\n draggableMixin,\n proxyInputMixin({ proxyProps: ['value', 'selectionStart'], useProxyTargets: true }),\n componentNameValidationMixin,\n customMixin\n)(\n createProxy({\n slots: ['prefix', 'suffix'],\n wrappedEleName: 'vaadin-text-field',\n style: () => `\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tpadding: calc(var(${TextFieldClass.cssVarList.inputOutlineWidth}) + var(${\n TextFieldClass.cssVarList.inputOutlineOffset\n }));\n box-sizing: border-box;\n\t\t\t}\n :host(:is([readonly], [disabled])) ::slotted(:is(input, textarea):placeholder-shown) {\n opacity: 1;\n }\n\n vaadin-text-field[label-type=\"floating\"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n vaadin-text-field[label-type=\"floating\"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n ${resetInputLabelPosition('vaadin-text-field')}\n\t\t\t${useHostExternalPadding(TextFieldClass.cssVarList)}\n\t\t\t${resetInputOverrides('vaadin-text-field', TextFieldClass.cssVarList)}\n ${inputFloatingLabelStyle()}\n\n vaadin-text-field vaadin-icon {\n align-self: center;\n }\n\t\t`,\n excludeAttrsSync: ['tabindex', 'style'],\n componentName,\n })\n);\n","// DateCounterClass allows us to add several counters to the input, and use them seperately.\n// For examele, we have a DayCounter, MonthCounter and YearCounter, which can each separately navigate\n// between different ranges.\nexport class DateCounter {\n #data = Object.freeze([]);\n\n constructor({ id, min, max, placeholder }, onChange) {\n this.id = id;\n this.min = min;\n this.max = max;\n this.placeholder = placeholder;\n this.onChange = onChange;\n }\n\n get data() {\n return this.#data;\n }\n\n set data(val) {\n this.#data = Object.freeze(val);\n this.onChange?.();\n }\n\n get #initialNumValue() {\n return this.data.length ? this.numberValue : 0;\n }\n\n get numberValue() {\n return Number(this.stringValue);\n }\n\n get stringValue() {\n return (this.data.join('') || this.placeholder).padStart(this.length, '0');\n }\n\n get isFull() {\n return this.numberValue * 10 > this.max || this.data.length === this.length;\n }\n\n get isEmpty() {\n return this.stringValue === this.placeholder;\n }\n\n get length() {\n return this.max.toString().length;\n }\n\n set(val) {\n this.data = val.toString().split('');\n }\n\n add(num) {\n // use local var to avoid triggering onChange\n let data = this.data;\n\n data = [...data, num];\n\n // we need to re-evaluate the number value\n const numVal = Number(data.join(''));\n\n if (numVal > this.max) {\n data = [num];\n } else if (this.length < data.length) {\n data = data.slice(1, data.length);\n }\n\n this.data = data;\n\n return num;\n }\n\n del() {\n if (!this.data.filter((d) => d !== '0').filter(Boolean).length) {\n this.data = [];\n } else {\n this.data = this.data.slice(0, this.data.length - 1);\n }\n }\n\n clear() {\n this.data = [];\n }\n\n inc(gap) {\n this.replaceValue(\n this.#initialNumValue < this.max\n ? Math.max(this.#initialNumValue + (gap || 1), this.min)\n : this.min\n );\n }\n\n dec(gap) {\n this.replaceValue(\n this.#initialNumValue > this.min\n ? Math.min(this.#initialNumValue - (gap || 1), this.max)\n : this.max\n );\n }\n\n isInRange(val) {\n return val >= this.min && val <= this.max;\n }\n\n replaceValue(val) {\n if (this.isInRange(val)) {\n this.data = val.toString().padStart(this.length, 0).split('');\n }\n }\n\n setMin(val) {\n this.min = Number(val);\n }\n\n setMax(val) {\n this.max = Number(val);\n }\n}\n","import { createBaseInputClass } from '../../baseClasses/createBaseInputClass';\nimport {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n portalMixin,\n} from '../../mixins';\nimport { forwardAttrs, getComponentName } from '../../helpers/componentHelpers';\nimport { compose } from '../../helpers';\nimport {\n newDate,\n isValidTimestamp,\n formatTimestamp,\n isNumber,\n getCurrentTime,\n overrideConstructedStylesheet,\n} from './helpers';\nimport { formats } from './formats';\nimport { calendarIcon } from './icons';\nimport {\n counterConfig,\n DEFAULT_FORMAT,\n DIVIDER,\n MOBILE_DEVICE_INTERACTION_TIMEOUT_MS,\n NATIVE_FORMAT,\n valRange,\n} from './consts';\nimport { DateCounter } from './DateCounterClass';\nimport { TextFieldClass } from '../descope-text-field/TextFieldClass';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\nimport { parseDateString } from './helpers';\n\nexport const componentName = getComponentName('date-field');\n\n// we set baseSelector to `vaadin-popover` as a temporary hack, so our portalMixin will\n// be able to process this component's overlay. The whole process needs refactoring as soon as possible.\nconst BASE_SELECTOR = 'vaadin-popover';\nconst BaseInputClass = createBaseInputClass({ componentName, baseSelector: BASE_SELECTOR });\n\nconst dateFieldAttrs = ['format', 'opened', 'initial-value', 'readonly', 'disable-calendar'];\nconst calendarAttrs = ['years-range', 'calendar-months', 'calendar-weekdays'];\nconst observedAttrs = [...dateFieldAttrs, ...calendarAttrs];\n\nclass RawDateFieldClass extends BaseInputClass {\n timestamp = '';\n\n format = DEFAULT_FORMAT;\n\n selectedCounterIdx = 0;\n\n updateCountersDisplay() {\n this.inputElement.value = this.countersValue;\n }\n\n updateValue() {\n if (this.isCountersOutOfRange) {\n this.updateTimestamp('');\n } else {\n const date = formats[this.format].getDate(this.inputElement.value);\n this.updateTimestamp(date.getTime());\n }\n }\n\n onDateCounterChange = () => {\n this.updateCountersDisplay();\n this.updateValue();\n // update validity\n this.#dispatchInput();\n };\n\n updateTimestamp(epochOrDate) {\n if (!epochOrDate) {\n this.timestamp = '';\n } else {\n this.timestamp = newDate(epochOrDate).getTime();\n }\n }\n\n dateCounters = [\n new DateCounter(counterConfig.MONTH, this.onDateCounterChange.bind(this)),\n new DateCounter(counterConfig.DAY, this.onDateCounterChange.bind(this)),\n new DateCounter(counterConfig.YEAR, this.onDateCounterChange.bind(this)),\n ];\n\n static get observedAttributes() {\n return [].concat(BaseInputClass.observedAttributes || [], observedAttrs);\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div>\n <descope-text-field inputmode=\"numeric\">\n <span slot=\"suffix\" class=\"toggle-calendar\">\n ${calendarIcon}\n </span>\n </descope-text-field>\n <vaadin-popover></vaadin-popover>\n </div>\n `;\n\n injectStyle(\n `\n :host {\n display: inline-block;\n box-sizing: border-box;\n user-select: none;\n max-width: 100%;\n }\n\n :host ::slotted {\n padding: 0;\n }\n\n .toggle-calendar {\n cursor: pointer;\n display: flex;\n align-self: center;\n z-index: 1;\n height: 100%;\n align-items: center;\n }\n\n :host([readonly=\"true\"]) .toggle-calendar {\n pointer-events: none;\n }\n\n .hidden {\n display: none;\n }\n `,\n this\n );\n\n this.inputElement = this.shadowRoot.querySelector('descope-text-field');\n this.popoverToggleButton = this.inputElement.querySelector('.toggle-calendar');\n }\n\n get validationTarget() {\n return this.inputElement;\n }\n\n get opened() {\n return this.getAttribute('opened') === 'true';\n }\n\n // returns the input's value as a timestamp\n get displayValueEpoch() {\n const date = formats[this.format].getDate(this.inputElement.value);\n\n if (!isValidTimestamp(date?.getTime())) {\n return null;\n }\n\n return date.getTime();\n }\n\n get sortedCounters() {\n return this.format\n .split(DIVIDER)\n .map((placeholder) => this.dateCounters.find((dc) => dc.placeholder === placeholder));\n }\n\n get activeCounter() {\n return this.sortedCounters[this.selectedCounterIdx];\n }\n\n get countersValue() {\n return this.sortedCounters.map((dc) => dc.stringValue).join(DIVIDER);\n }\n\n get overlay() {\n return this.baseElement.shadowRoot?.querySelector('vaadin-popover-overlay');\n }\n\n get backdrop() {\n return this.overlay.shadowRoot?.querySelector('#backdrop');\n }\n\n get calendar() {\n return this.overlay?.querySelector('descope-calendar');\n }\n\n get isRTL() {\n const computedStyleDirection = getComputedStyle(this.baseElement).getPropertyValue('direction');\n\n if (computedStyleDirection) {\n return computedStyleDirection === 'rtl';\n }\n\n // Fallback: If for some reason computed style was not calculated in time, fallback to check on attribute\n return this.getAttribute('st-host-direction') === 'rtl';\n }\n\n get value() {\n if (this.isInvalidDate()) {\n return '';\n }\n return this.timestamp;\n }\n\n set value(val) {\n if (val) {\n this.updateTimestamp(val);\n this.updateDateCounters(newDate(val));\n } else {\n this.updateTimestamp('');\n }\n }\n\n get isCountersEmpty() {\n return this.dateCounters.every((dc) => dc.isEmpty);\n }\n\n get isCountersOutOfRange() {\n return this.dateCounters.some((dc) => !dc.isInRange(dc.numberValue));\n }\n\n get disableCalendar() {\n return this.getAttribute('disable-calendar') === 'true';\n }\n\n get isSelectAll() {\n const inputEle = this.inputElement.baseElement.inputElement;\n return inputEle.value.length === inputEle.selectionStart + inputEle.selectionEnd;\n }\n\n reportValidity() {\n this.inputElement.reportValidity();\n }\n\n #dispatchInput() {\n this.inputElement.baseElement.dispatchEvent(new Event('input', { bubbles: true }));\n }\n\n updateInputDisplay() {\n this.inputElement.value = formatTimestamp(newDate(this.countersValue).getTime(), this.format);\n }\n\n init() {\n super.init?.();\n\n this.updateFormatPattern();\n this.initPopover();\n this.onDateCounterChange();\n this.initInputElement();\n\n setTimeout(() => {\n this.#overrideOverlaySettings();\n }, 0);\n }\n\n initInputElement() {\n this.inputElement.getValidity = this.getValidity.bind(this);\n this.inputElement.baseElement.checkValidity = this.checkValidity.bind(this);\n\n this.popoverToggleButton.addEventListener('click', this.onPopoverToggle.bind(this));\n\n this.inputElement.addEventListener('focus', this.onFocus.bind(this));\n this.inputElement.addEventListener('blur', this.onBlur.bind(this));\n this.inputElement.addEventListener('click', this.handleMouseCaretPositionChange.bind(this));\n this.inputElement.addEventListener('keydown', this.handleKeyboard.bind(this));\n this.inputElement.addEventListener('beforeinput', this.handleInput.bind(this));\n this.inputElement.addEventListener('pointerdown', this.onPointerDown.bind(this));\n this.inputElement.addEventListener('paste', this.onPaste.bind(this));\n\n forwardAttrs(this, this.inputElement, {\n includeAttrs: [\n 'label',\n 'label-type',\n 'placeholder',\n 'disabled',\n 'readonly',\n 'bordered',\n 'required',\n 'full-width',\n 'st-host-direction',\n 'pattern',\n 'bordered',\n 'data-errormessage-value-missing',\n 'data-errormessage-pattern-mismatch',\n 'data-errormessage-range-underflow',\n 'data-errormessage-range-overflow',\n 'st-error-message-icon',\n 'st-error-message-icon-size',\n 'st-error-message-icon-padding',\n ],\n });\n }\n\n handleInput(e) {\n e.preventDefault();\n\n this.handleSelectAll();\n\n if (e.data && isNumber(e.data)) {\n this.parseDigits(e.data);\n this.updateCountersDisplay();\n } else if (e.inputType) {\n this.handleNavKeys(e);\n }\n }\n\n initPopover() {\n this.baseElement.trigger = ['click'];\n this.baseElement.withBackdrop = true;\n this.baseElement.renderer = this.#popoverRenderer.bind(this);\n\n // block popover events from focusing/blurring the text-field\n this.baseElement.addEventListener('click', (e) => {\n e.preventDefault();\n e.stopPropagation();\n });\n }\n\n handleSelectAll() {\n if (this.isSelectAll) {\n this.selectFirstCounter();\n }\n }\n\n #popoverPosStylesheet;\n\n #popoverRenderer(root) {\n // popoverRenderer should run only once, when the popover is first rendering.\n if (!root.firstChild) {\n this.overlay.positionTarget = this.shadowRoot.querySelector('.toggle-calendar');\n\n root.appendChild(this.#getPopoverContent());\n\n // override vaadin's constructed stylesheet which hides the host element\n overrideConstructedStylesheet(this.baseElement);\n\n this.backdrop.addEventListener('click', this.closePopover.bind(this));\n }\n\n // Hide overlay before adjusting position to prevent flickering\n root.style.setProperty('visibility', 'hidden');\n\n // Wait until overlay is ready\n setTimeout(() => {\n this.#adjustPopoverPosition(root);\n\n // Show adjusted overlay\n root.style.setProperty('visibility', 'visible');\n this.updateCalendarView(root);\n }, 100);\n }\n\n #adjustPopoverPosition() {\n const popover = this.shadowRoot.querySelector('vaadin-popover').shadowRoot;\n\n // Remove previously added stylesheets\n this.#popoverPosStylesheet?.remove();\n\n const windowRect = document.body.getBoundingClientRect();\n const inputRect = this.getBoundingClientRect();\n const calendarRect = this.calendar.getBoundingClientRect();\n\n const side = this.isRTL ? 'right' : 'left';\n const offset = inputRect[side] - calendarRect[side];\n const availableLeft = calendarRect.left;\n const availableRight = windowRect.width - calendarRect.right;\n\n let newOffset;\n if (offset > 0) {\n newOffset = Math.min(offset, availableRight);\n } else {\n newOffset = Math.min(Math.abs(offset), availableLeft) * -1;\n }\n\n injectStyle(\n `\n vaadin-popover-overlay::part(overlay) {\n transform: translateX(${newOffset}px);\n }\n `,\n popover\n );\n }\n\n #getPopoverContent() {\n const ele = document.createElement('span');\n\n ele.innerHTML = `<descope-calendar></descope-calendar>`;\n\n const calendar = ele.querySelector('descope-calendar');\n\n calendar.addEventListener('date-submit', this.onCalendarSubmit.bind(this));\n calendar.addEventListener('cancel', this.closePopover.bind(this));\n\n return ele;\n }\n\n // the default vaadin behavior is to attach the overlay to the body when opened\n // we do not want that because it's difficult to style the overlay in this way\n // so we override it to open inside the shadow DOM\n #overrideOverlaySettings() {\n this.overlay._attachOverlay = () => this.overlay.bringToFront();\n this.overlay._detachOverlay = () => {};\n this.overlay._enterModalState = () => {};\n }\n\n onPopoverToggle() {\n this.opened ? this.closePopover() : this.openPopover();\n }\n\n openPopover() {\n if (this.disableCalendar) return;\n this.setAttribute('opened', 'true');\n }\n\n closePopover() {\n this.removeAttribute('opened');\n this.inputElement.focus();\n }\n\n getCounterById(id) {\n return this.dateCounters.find((dc) => dc.id === id);\n }\n\n onCalendarSubmit() {\n if (!this.isReadOnly) {\n if (!this.calendar.value) return;\n\n const calendarDate = newDate(this.calendar.value);\n\n this.value = calendarDate.getTime();\n\n this.getCounterById('year').replaceValue(calendarDate.getFullYear());\n this.getCounterById('month').replaceValue(calendarDate.getMonth() + 1);\n this.getCounterById('day').replaceValue(calendarDate.getDate());\n\n this.#dispatchInput();\n }\n\n this.closePopover();\n }\n\n updateCalendarView() {\n const validInputVal =\n isValidTimestamp(newDate(this.inputElement.value || '').getTime()) &&\n formats[this.format].validate(this.inputElement.value);\n\n if (this.displayValueEpoch || validInputVal) {\n this.calendar.setAttribute(\n 'initial-value',\n formatTimestamp(this.displayValueEpoch || this.timestamp, NATIVE_FORMAT)\n );\n } else {\n this.calendar.clearValue();\n this.calendar.setAttribute('preview', formatTimestamp(getCurrentTime(), NATIVE_FORMAT));\n }\n\n forwardAttrs(this, this.calendar, {\n includeAttrs: [\n 'st-host-direction',\n 'readonly',\n 'initial-month',\n 'initial-year',\n 'years-range',\n 'calendar-label-submit',\n 'calendar-label-cancel',\n 'calendar-months',\n 'calendar-weekdays',\n 'calendar-weekdays-short',\n ],\n });\n }\n\n // In mobile devices, there are cases were `pointerdown` is triggered\n // instead of `click`.\n onPointerDown(e) {\n setTimeout(() => this.handleMouseCaretPositionChange(e), MOBILE_DEVICE_INTERACTION_TIMEOUT_MS);\n }\n\n onFocus() {\n if (this.isReadOnly) {\n return;\n }\n\n // We need to wait for focus to end before we set selection\n setTimeout(() => this.resetDisplay());\n }\n\n resetDisplay() {\n if (!this.inputElement.value) {\n this.inputElement.value = this.format;\n }\n\n // On focus select the first counter\n this.selectFirstCounter();\n // set selection on first counter\n this.inputElement.setSelectionRange(0, this.sortedCounters[0].length);\n }\n\n onBlur() {\n if (this.opened) {\n return;\n }\n\n if (this.inputElement.value === this.format) {\n this.inputElement.value = '';\n }\n }\n\n onFormatUpdate(format) {\n if (Object.keys(formats).includes(format)) {\n this.format = format;\n this.updateFormatPattern();\n }\n }\n\n updateFormatPattern() {\n const format = this.getAttribute('format') || this.format || DEFAULT_FORMAT;\n this.setAttribute('type', 'date');\n this.setAttribute('pattern', formats[format].pattern);\n }\n\n parseDigits(value) {\n this.activeCounter.add(value);\n\n if (this.activeCounter.isFull) {\n this.selectNextCounter();\n }\n\n // We wait for the digit to be parsed, and only then set the selection.\n // Failing to do so results in unexpected \"jump\" of the screen in mobile devices.\n this.setInputSelectionRange();\n }\n\n getCounterIdx(caretPos) {\n const [counter1ln, counter2ln] = this.sortedCounters.map((dc) => dc.length);\n\n const c1 = caretPos <= counter1ln;\n const c2 = caretPos >= counter1ln && caretPos <= counter1ln + counter2ln + 1;\n const c3 = caretPos >= counter1ln + counter2ln + 2;\n\n return [c1, c2, c3].indexOf(true);\n }\n\n setSelectedCounterByCaretPosition(e) {\n this.selectedCounterIdx = this.getCounterIdx(\n // if triggered by touch event, target might not include `selectionStart`\n // in that case we fall back to the inputElement's `selectionStart` value.\n // Therefore, it is recommended to run this function with setTimeout,\n // at least for mobile events.\n e.target?.selectionStart || this.inputElement.selectionStart\n );\n }\n\n selectFirstCounter() {\n this.selectedCounterIdx = 0;\n }\n\n selectNextCounter() {\n if (this.selectedCounterIdx < this.dateCounters.length) {\n this.selectedCounterIdx = Math.min(this.selectedCounterIdx + 1, 2);\n }\n }\n\n selectPrevCounter() {\n if (this.selectedCounterIdx > 0) {\n this.selectedCounterIdx = Math.min(this.selectedCounterIdx - 1, 1);\n }\n }\n\n // Sets the text selection range in the input element based on the selected counter.\n // The function calculates the starting position of the selection by summing the lengths\n // of all counters before the currently selected counter (`selectedCounterIdx`).\n // It then selects the entire length of the current counter in the input element.\n setInputSelectionRange() {\n // For preview/readonly state we don't have a caret or a caretIdx, so we skip setting input selection range\n if (this.selectedCounterIdx < 0) {\n return;\n }\n\n // We wait for before setting the selection, otherwise there's an\n // unexpected \"jump\" of the screen in mobile devices.\n setTimeout(() => {\n const caretStart = this.sortedCounters\n .slice(0, this.selectedCounterIdx)\n .reduce((acc, counter) => acc + counter.length, this.selectedCounterIdx);\n\n this.inputElement.setSelectionRange(\n caretStart,\n caretStart + this.sortedCounters[this.selectedCounterIdx].length\n );\n });\n }\n\n resetDateCounters() {\n this.dateCounters.forEach((dc) => dc.clear());\n }\n\n // in case value is set from external source we need to update date counters\n updateDateCounters(date) {\n this.dateCounters.forEach((dc) => {\n switch (dc.id) {\n case counterConfig.MONTH.id:\n dc.set(date.getMonth() + 1);\n break;\n case counterConfig.YEAR.id:\n dc.set(date.getFullYear());\n break;\n case counterConfig.DAY.id:\n dc.set(date.getDate());\n break;\n default:\n break;\n }\n });\n }\n\n handleKeyboard(e) {\n if (e.metaKey || e.ctrlKey) {\n if (e.key.toLowerCase() === 'x') {\n this.onCut(e);\n }\n\n return;\n }\n\n this.handleSelectAll();\n\n if (e.key === 'ArrowUp') {\n this.activeCounter.inc();\n } else if (e.key === 'ArrowDown') {\n this.activeCounter.dec();\n } else if (e.key === 'ArrowRight') {\n this.selectNextCounter();\n } else if (e.key === 'ArrowLeft') {\n this.selectPrevCounter();\n }\n\n this.setInputSelectionRange();\n }\n\n handleNavKeys(e) {\n if (this.isReadOnly) {\n return;\n }\n\n if (this.opened) {\n this.closePopover();\n }\n\n if (!this.activeCounter) return;\n\n if (e.inputType === 'deleteContentBackward') {\n this.handleBackspace();\n }\n\n this.setInputSelectionRange();\n }\n\n handleBackspace() {\n if (this.isSelectAll) {\n this.resetToInitialState();\n return;\n }\n\n const counter = this.activeCounter;\n\n if (counter.isEmpty) {\n this.selectPrevCounter();\n this.setInputSelectionRange();\n } else {\n counter.set('');\n }\n\n // To support keyboards like SwiftKey, we need to re-render the counters display and selection,\n // otherwise we get an unexpected behavior, where the format is deleted.\n setTimeout(() => {\n this.updateCountersDisplay();\n this.setInputSelectionRange();\n });\n }\n\n handleMouseCaretPositionChange(e) {\n if (this.opened) {\n return;\n }\n\n e.preventDefault();\n\n this.setSelectedCounterByCaretPosition(e);\n this.setInputSelectionRange();\n }\n\n onInitialValueChange(val) {\n // if component already has a value don't re-set value\n if (this.value) return;\n\n // we need to wait for the text-field to init\n setTimeout(() => {\n this.value = val;\n });\n }\n\n togglePopoverAccess(visibility) {\n if (visibility) {\n this.popoverToggleButton.classList.remove('hidden');\n } else {\n this.popoverToggleButton.classList.add('hidden');\n }\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue !== newValue) {\n if (attrName === 'disable-calendar') {\n this.togglePopoverAccess(newValue !== 'true');\n }\n if (dateFieldAttrs.includes(attrName)) {\n if (newValue && attrName === 'format') {\n this.onFormatUpdate(newValue);\n }\n if (attrName === 'initial-value') {\n this.onInitialValueChange(newValue);\n }\n } else if (calendarAttrs.includes(attrName)) {\n if (newValue) {\n this.calendar?.setAttribute(attrName, newValue);\n } else {\n this.calendar?.removeAttribute(attrName);\n }\n }\n }\n }\n\n // we want to validate the date supplied actually exists. For example: Feb 31 is not an actual date,\n // but in JS when create a `new Date('1999-02-31') we get March 2nd 1999.\n // To prevent this error from being submitted, we evaluate the\n // date parts against their generated Date value.\n isInvalidDate() {\n const yearCounter = this.getCounterById('year');\n const isYearOutOfRange =\n yearCounter.numberValue > valRange['year'].max ||\n yearCounter.numberValue < valRange['year'].min;\n\n const isDateDisplayMismatch = Object.entries(this.getDateVals()).some(([key, val]) => {\n const counter = this.getCounterById(key);\n return !val || counter.numberValue !== val;\n });\n\n return isYearOutOfRange || isDateDisplayMismatch;\n }\n\n getValidity() {\n if (this.isRequired && this.isCountersEmpty) {\n return { valueMissing: true };\n }\n\n if (this.isCountersOutOfRange || this.isInvalidDate()) {\n return { patternMismatch: true };\n }\n\n return {};\n }\n\n getDateVals() {\n const ret = {\n day: '',\n month: '',\n year: '',\n };\n\n try {\n const date = newDate(this.timestamp);\n\n ret.month = date.getMonth() + 1;\n ret.day = date.getDate();\n ret.year = date.getFullYear();\n } catch (e) {}\n\n return ret;\n }\n\n resetToInitialState() {\n this.resetDateCounters();\n this.selectFirstCounter();\n this.resetDisplay();\n }\n\n onCut(e) {\n e.preventDefault();\n\n if (this.isSelectAll) {\n this.#copyToClipboard(this.countersValue);\n this.resetToInitialState();\n } else {\n this.#copyToClipboard(this.activeCounter.stringValue);\n this.activeCounter.set('');\n }\n\n this.setInputSelectionRange();\n }\n\n #copyToClipboard(value) {\n try {\n navigator.clipboard.writeText(value);\n } catch (err) {\n console.error('Failed to copy date value:', err);\n }\n }\n\n onPaste(e) {\n e.preventDefault();\n\n const clipboardData = e.clipboardData || window.clipboardData;\n const pastedData = clipboardData.getData('Text');\n\n // try paste entire date if valid\n const validDate = parseDateString(pastedData, this.format);\n\n if (validDate) {\n this.value = validDate.getTime();\n this.onDateCounterChange();\n\n // select all\n setTimeout(() => this.inputElement.setSelectionRange(0, this.inputElement.value.length));\n } else {\n const value = Number(pastedData);\n\n // try paste in counter if possible\n if (value && this.activeCounter.min <= value && this.activeCounter.max >= value) {\n // use String to get rid of any zero padding\n this.activeCounter.set(String(value));\n\n setTimeout(() => this.setInputSelectionRange());\n }\n }\n }\n}\n\nconst textVars = TextFieldClass.cssVarList;\nconst { host, input, inputEleRTL, toggleButton, overlay, backdrop, errorMessage } = {\n host: { selector: () => ':host' },\n input: { selector: () => 'descope-text-field' },\n inputEleRTL: { selector: () => ':host([st-host-direction=\"rtl\"]) descope-text-field' },\n toggleButton: { selector: () => '.toggle-calendar' },\n overlay: { selector: 'vaadin-popover-overlay::part(overlay)' },\n backdrop: { selector: 'vaadin-popover-overlay::part(backdrop)' },\n};\n\nexport const DateFieldClass = compose(\n createStyleMixin({ componentNameOverride: getComponentName('input-wrapper') }),\n createStyleMixin({\n mappings: {\n iconMargin: { ...toggleButton, property: 'margin-inline-end' },\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n textAlign: { ...input, property: 'text-align' },\n rtlInputDirection: { ...inputEleRTL, property: textVars.inputDirection },\n rtlInputAlignment: { ...inputEleRTL, property: textVars.inputTextAlign },\n overlayGap: {\n property: () => DateFieldClass.cssVarList.overlayGap,\n },\n overlayBackgroundColor: {\n property: () => DateFieldClass.cssVarList.overlayBackgroundColor,\n },\n overlayPadding: {\n property: () => DateFieldClass.cssVarList.overlayPadding,\n },\n overlayBoxShadow: { property: () => DateFieldClass.overlayBoxShadow },\n overlayOutlineWidth: {\n property: () => DateFieldClass.cssVarList.overlayOutlineWidth,\n },\n overlayOutlineColor: {\n property: () => DateFieldClass.cssVarList.overlayOutlineColor,\n },\n overlayOutlineStyle: {\n property: () => DateFieldClass.cssVarList.overlayOutlineStyle,\n },\n errorMessageIcon: {\n selector: TextFieldClass.componentName,\n property: TextFieldClass.cssVarList.errorMessageIcon,\n },\n errorMessageIconSize: {\n selector: TextFieldClass.componentName,\n property: TextFieldClass.cssVarList.errorMessageIconSize,\n },\n errorMessageIconPadding: {\n selector: TextFieldClass.componentName,\n property: TextFieldClass.cssVarList.errorMessageIconPadding,\n },\n errorMessageIconRepeat: {\n selector: TextFieldClass.componentName,\n property: TextFieldClass.cssVarList.errorMessageIconRepeat,\n },\n errorMessageIconPosition: {\n selector: TextFieldClass.componentName,\n property: TextFieldClass.cssVarList.errorMessageIconPosition,\n },\n errorMessageFontSize: {\n selector: TextFieldClass.componentName,\n property: TextFieldClass.cssVarList.errorMessageFontSize,\n },\n },\n }),\n portalMixin({\n name: 'overlay',\n selector: '',\n mappings: {\n marginTop: { ...overlay, property: 'margin-top' },\n backgroundColor: { ...overlay },\n backdropBackgroundColor: { ...backdrop, property: 'background-color' },\n backdropPointerEvents: { ...backdrop, property: 'pointer-events' },\n padding: { ...overlay },\n boxShadow: { ...overlay },\n outlineWidth: { ...overlay },\n outlineColor: { ...overlay },\n outlineStyle: { ...overlay },\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(RawDateFieldClass);\n","import '@vaadin/popover/src/vaadin-popover';\nimport './descope-calendar';\nimport '../descope-text-field';\n\nimport { componentName, DateFieldClass } from './DateFieldClass';\n\ncustomElements.define(componentName, DateFieldClass);\n\nexport { DateFieldClass, componentName };\n"],"names":["host","label","placeholder","requiredIndicator","inputField","input","inputMask","helperText","errorMessage","disabledPlaceholder","inputDisabled","inputIcon","externalInput","externalInputDisabled","externalPlaceholder","externalDisabledPlaceholder","selector","fontSize","fontFamily","labelFontSize","property","labelFontWeight","labelTextColor","hostWidth","hostMinWidth","hostDirection","inputDirection","inputBackgroundColor","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","helperTextColor","inputValueTextColor","inputCaretTextColor","labelRequiredIndicator","inputBorderColor","inputBorderWidth","inputBorderStyle","inputBorderRadius","inputHeight","inputHorizontalPadding","inputOutlineColor","inputOutlineStyle","inputOutlineWidth","inputOutlineOffset","textAlign","inputTextAlign","inputPlaceholderColor","labelPosition","labelTopPosition","labelHorizontalPosition","inputTransformY","inputTransition","marginInlineStart","placeholderOpacity","inputVerticalAlignment","valueInputHeight","valueInputMarginBottom","inputIconOffset","inputIconSize","inputIconColor","customElements","define","componentName","observedAttrs","TextFieldClass","mappings","proxyProps","useProxyTargets","superclass","observedAttributes","concat","icon","init","super","renderCopyToClipboard","shouldRender","this","remove","iconInitConfig","title","style","iconCopiedConfig","Object","assign","document","createElement","slot","baseElement","appendChild","addEventListener","navigator","clipboard","writeText","value","setTimeout","onLabelClick","focus","attributeChangedCallback","attrName","oldVal","newVal","attributeChangeCallback","_setType","removeEventListener","slots","wrappedEleName","cssVarList","excludeAttrsSync","DateCounter","freeze","constructor","id","min","max","onChange","data","val","length","numberValue","Number","stringValue","join","padStart","isFull","isEmpty","toString","set","split","add","num","slice","del","filter","d","Boolean","clear","inc","gap","replaceValue","Math","dec","isInRange","setMin","setMax","BaseInputClass","createBaseInputClass","baseSelector","dateFieldAttrs","calendarAttrs","textVars","inputEleRTL","toggleButton","overlay","backdrop","DateFieldClass","componentNameOverride","iconMargin","rtlInputDirection","rtlInputAlignment","overlayGap","overlayBackgroundColor","overlayPadding","overlayBoxShadow","overlayOutlineWidth","overlayOutlineColor","overlayOutlineStyle","name","marginTop","backgroundColor","backdropBackgroundColor","backdropPointerEvents","padding","boxShadow","outlineWidth","outlineColor","outlineStyle","timestamp","format","selectedCounterIdx","updateCountersDisplay","inputElement","countersValue","updateValue","isCountersOutOfRange","updateTimestamp","date","formats","getDate","getTime","onDateCounterChange","epochOrDate","dateCounters","MONTH","bind","DAY","YEAR","attachShadow","mode","innerHTML","shadowRoot","querySelector","popoverToggleButton","validationTarget","opened","getAttribute","displayValueEpoch","sortedCounters","map","find","dc","activeCounter","calendar","isRTL","computedStyleDirection","getComputedStyle","getPropertyValue","isInvalidDate","updateDateCounters","isCountersEmpty","every","some","disableCalendar","isSelectAll","inputEle","selectionStart","selectionEnd","reportValidity","dispatchEvent","Event","bubbles","updateInputDisplay","updateFormatPattern","initPopover","initInputElement","getValidity","checkValidity","onPopoverToggle","onFocus","onBlur","handleMouseCaretPositionChange","handleKeyboard","handleInput","onPointerDown","onPaste","includeAttrs","e","preventDefault","handleSelectAll","parseDigits","inputType","handleNavKeys","trigger","withBackdrop","renderer","stopPropagation","selectFirstCounter","root","firstChild","positionTarget","closePopover","setProperty","updateCalendarView","popover","windowRect","body","getBoundingClientRect","inputRect","calendarRect","side","offset","availableLeft","left","availableRight","width","right","newOffset","abs","ele","onCalendarSubmit","_attachOverlay","bringToFront","_detachOverlay","_enterModalState","openPopover","setAttribute","removeAttribute","getCounterById","isReadOnly","calendarDate","getFullYear","getMonth","validInputVal","validate","clearValue","resetDisplay","setSelectionRange","onFormatUpdate","keys","includes","pattern","selectNextCounter","setInputSelectionRange","getCounterIdx","caretPos","counter1ln","counter2ln","indexOf","setSelectedCounterByCaretPosition","target","selectPrevCounter","caretStart","reduce","acc","counter","resetDateCounters","forEach","metaKey","ctrlKey","key","toLowerCase","onCut","handleBackspace","resetToInitialState","onInitialValueChange","togglePopoverAccess","visibility","classList","oldValue","newValue","yearCounter","isYearOutOfRange","isDateDisplayMismatch","entries","getDateVals","isRequired","valueMissing","patternMismatch","ret","day","month","year","err","console","error","pastedData","clipboardData","window","getData","validDate","String"],"sourceRoot":""}
@@ -0,0 +1,2 @@
1
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[2294,4159,9261],{36976:(e,t,r)=>{r.d(t,{M:()=>o});const o=["blockquote","list","image","table","code","hr","backticks","fence","reference","heading","lheading","html_block"]},54847:(e,t,r)=>{r.d(t,{G:()=>o});const o=e=>{const t=document.createElement("textarea");return t.innerHTML=e,t.value}},55838:(e,t,r)=>{r.r(t),r.d(t,{EnrichedTextClass:()=>o.m,componentName:()=>o.T}),r(74778);var o=r(76231);customElements.define(o.T,o.m)},63595:(e,t,r)=>{r.r(t),r.d(t,{TextClass:()=>o.s,componentName:()=>o.T});var o=r(66434);customElements.define(o.T,o.s)},66434:(e,t,r)=>{r.d(t,{T:()=>l,s:()=>a});var o=r(88961),n=r(63200),s=r(25964),i=r(72270);const l=(0,s.xE)("text");class h extends((0,i.qu)({componentName:l,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <slot part="text-wrapper"></slot>\n ',(0,s.fz)("\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n ",this)}get hideWhenEmpty(){return"true"===this.getAttribute("hide-when-empty")}init(){super.init(),(0,s.Ge)(this,(()=>{const e=!!this.childNodes.length;this.style.display=!e&&this.hideWhenEmpty?"none":""}))}}const{host:c}={host:{selector:()=>":host"}},a=(0,n.Zz)((0,o.RF)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostDirection:{selector:()=>":host",property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),o.VO,o.tQ)(h)},74778:(e,t,r)=>{r.r(t),r.d(t,{LinkClass:()=>k,componentName:()=>h});var o=r(88961),n=r(63200),s=r(25964),i=r(72270),l=r(66434);const h=(0,s.xE)("link");class c extends((0,i.qu)({componentName:h,baseSelector:":host a"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<div>\n\t\t\t<descope-text>\n\t\t\t\t<a>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</a>\n\t\t\t</descope-text>\n\t\t</div>\n\t\t",(0,s.fz)("\n :host {\n\t\t\tdisplay: inline-block;\n line-height: 1em;\n\t\t}\n\t\t:host a {\n\t\t\tdisplay: inline;\n\t\t}\n ",this),(0,s.EA)(this,this.shadowRoot.querySelector("a"),{includeAttrs:["href","target","tooltip"],mapAttrs:{tooltip:"title"}}),(0,s.EA)(this,this.shadowRoot.querySelector("descope-text"),{includeAttrs:["mode","variant"]})}}const a={host:{selector:()=>":host"},link:{selector:()=>":host a"},anchor:{},wrapper:{selector:()=>":host > div"},text:{selector:()=>l.s.componentName}},{anchor:d,text:p,host:m,wrapper:u,link:g}=a,k=(0,n.Zz)((0,o.RF)({mappings:{hostWidth:{...m,property:"width"},hostDirection:{...p,property:"direction"},textAlign:u,textDecoration:{...g,property:"text-decoration",fallback:"none"},textColor:[{...d,property:"color"},{...p,property:l.s.cssVarList.textColor}],cursor:d}}),o.VO,o.tQ)(c);r(63595),customElements.define(h,k)},76231:(e,t,r)=>{r.d(t,{T:()=>a,m:()=>p});var o=r(92540),n=r(88961),s=r(63200),i=r(36976),l=r(72270),h=r(54847),c=r(25964);const a=(0,c.xE)("enriched-text");class d extends((0,l.qu)({componentName:a,baseSelector:":host > div"})){#e;#t;constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="content"></div>\n ',(0,c.fz)("\n :host {\n line-height: 1em;\n word-break: break-word;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n *, *:last-child {\n margin: 0;\n }\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n p {\n margin-bottom: 1em;\n }\n a {\n cursor: pointer;\n }\n blockquote {\n padding: 0 2em;\n }\n u {\n text-decoration: underline\n }\n s {\n color: currentColor;\n }\n ",this),this.#r(),(0,c.Ge)(this,this.#o.bind(this))}static get observedAttributes(){return["readonly","link-target-blank"]}attributeChangedCallback(e,t,r){super.attributeChangedCallback?.(e,t,r),r!==t&&("readonly"===e&&this.onReadOnlyChange("true"===r),"link-target-blank"===e&&this.#r())}customUnderlineRenderer(){this.processor.renderer.rules.em_open=(e,t,r,o,n)=>("_"===e[t].markup&&(e[t].tag="u"),this.#t(e,t,r,o,n)),this.processor.renderer.rules.em_close=(e,t,r,o,n)=>("_"===e[t].markup&&(e[t].tag="u"),this.#t(e,t,r,o,n))}#n(){this.linkTargetBlank?this.processor.renderer.rules.link_open=(e,t,r,o,n)=>(e[t].attrSet("target","_blank"),this.#e(e,t,r,o,n)):this.processor.renderer.rules.link_open=this.#e}#s(){this.processor&&this.processor.disable(i.M)}#i(){this.#s()}#l(){this.#e=this.processor.renderer.rules.link_open||((e,t,r,o,n)=>n.renderToken(e,t,r)),this.#t=this.processor.renderer.rules.em_open||((e,t,r,o,n)=>n.renderToken(e,t,r))}#r(){this.processor=new o.A("commonmark",{html:!0}),this.#l(),this.#i(),this.#n(),this.customUnderlineRenderer()}get linkTargetBlank(){return"true"===this.getAttribute("link-target-blank")}get contentNode(){return this.shadowRoot.querySelector(".content")}#o(){if(!this.processor)return;let e=(0,h.G)(this.innerHTML);!e?.trim()&&this.isConnected?this.setAttribute("empty","true"):this.removeAttribute("empty");try{const t=this.processor.parse(e,{references:void 0});e=this.processor.renderer.render(t,{html:!0,breaks:!0})}catch(e){console.warn("Not parsing invalid markdown token")}this.contentNode.innerHTML=e}onReadOnlyChange(e){e?this.contentNode.setAttribute("inert",e):this.contentNode.removeAttribute("inert")}}const p=(0,s.Zz)((0,n.RF)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostDisplay:{selector:()=>":host",property:"display",fallback:"inline-block"},hostDirection:{selector:()=>":host",property:"direction"},fontSize:{},fontFamily:{},fontWeight:{},fontWeightBold:[{selector:()=>":host strong",property:"font-weight"},{selector:()=>":host b",property:"font-weight"}],textColor:{property:"color"},textLineHeight:{property:"line-height"},textAlign:{},linkColor:{selector:"a",property:"color"},linkTextDecoration:{selector:"a",property:"text-decoration"},linkHoverTextDecoration:{selector:"a:hover",property:"text-decoration"},minHeight:{},minWidth:{}}}),(0,n.RF)({componentNameOverride:(0,c.xE)("link")}),(0,n.RF)({componentNameOverride:(0,c.xE)("text")}),n.VO,n.tQ)(d)}}]);
2
+ //# sourceMappingURL=descope-enriched-text.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"descope-enriched-text.js","mappings":"oKAAO,MAAMA,EAAe,CAC1B,aACA,OACA,QACA,QACA,OACA,KACA,YACA,QACA,YACA,UACA,WACA,a,mCCZK,MAAMC,EAAcC,IACzB,MAAMC,EAAWC,SAASC,cAAc,YAExC,OADAF,EAASG,UAAYJ,EACdC,EAASI,KAAK,C,0GCCvBC,eAAeC,OAAO,IAAe,I,yFCFrCD,eAAeC,OAAO,IAAe,I,2FCW9B,MAAMC,GAAgB,QAAiB,QAE9C,MAAMC,WAAgB,QAAgB,CACpCD,gBACAE,aAAc,kBAEd,WAAAC,GACEC,QAEAC,KAAKC,aAAa,CAAEC,KAAM,SAAUX,UAAY,iDAIhD,QAAY,iLASTS,KACL,CAEA,iBAAIG,GACF,MAAgD,SAAzCH,KAAKI,aAAa,kBAC3B,CAEA,IAAAC,GACEN,MAAMM,QAEN,QAAgBL,MAAM,KACpB,MAAMM,IAAgBN,KAAKO,WAAWC,OACtCR,KAAKS,MAAMC,SAAWJ,GAAeN,KAAKG,cAAgB,OAAS,EAAE,GAEzE,EAGF,MAAM,KAAEQ,GAAS,CACfA,KAAM,CAAEC,SAAU,IAAM,UAGbC,GAAY,SACvB,QAAiB,CACfC,SAAU,CACRC,UAAW,CAAEH,SAAU,IAAM,QAASI,SAAU,SAChDC,cAAe,CAAEL,SAAU,IAAM,QAASI,SAAU,aACpDE,SAAU,CAAC,EACXC,UAAW,CACT,CAAEH,SAAU,UAEdI,eAAgB,CAAEJ,SAAU,eAC5BK,kBAAmB,CAAEL,SAAU,kBAC/BM,WAAY,CAAC,EACbC,UAAW,CAAC,EACZC,cAAe,CAAC,EAChBC,W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,UAAW,CAAC,EACZoE,UAAW,CAAE/E,SAAU,IAAKI,SAAU,SACtC4E,mBAAoB,CAAEhF,SAAU,IAAKI,SAAU,mBAC/C6E,wBAAyB,CAAEjF,SAAU,UAAWI,SAAU,mBAC1D8E,UAAW,CAAC,EACZC,SAAU,CAAC,MAGf,QAAiB,CAAEC,uBAAuB,QAAiB,WAC3D,QAAiB,CAAEA,uBAAuB,QAAiB,UAC3D,KACA,KA1B+B,CA2B/BjD,E","sources":["webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/consts.js","webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/helpers.js","webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/TextClass.js","webpack://@descope/web-components-ui/../components/descope-link/src/component/LinkClass.js","webpack://@descope/web-components-ui/../components/descope-link/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/EnrichedTextClass.js"],"sourcesContent":["export const disableRules = [\n 'blockquote',\n 'list',\n 'image',\n 'table',\n 'code',\n 'hr',\n 'backticks',\n 'fence',\n 'reference',\n 'heading',\n 'lheading',\n 'html_block',\n];\n","export const decodeHTML = (html) => {\n const textArea = document.createElement('textarea');\n textArea.innerHTML = html;\n return textArea.value;\n};\n","import '@descope-ui/descope-link';\n\nimport { componentName, EnrichedTextClass } from './EnrichedTextClass';\n\ncustomElements.define(componentName, EnrichedTextClass);\n\nexport { EnrichedTextClass, componentName };\n","import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n injectStyle,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('text');\n\nclass RawText extends createBaseClass({\n componentName,\n baseSelector: ':host > slot',\n}) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <slot part=\"text-wrapper\"></slot>\n `;\n\n injectStyle(`\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `, this);\n }\n\n get hideWhenEmpty() {\n return this.getAttribute('hide-when-empty') === 'true';\n }\n\n init() {\n super.init();\n\n observeChildren(this, () => {\n const hasChildren = !!this.childNodes.length;\n this.style.display = !hasChildren && this.hideWhenEmpty ? 'none' : '';\n });\n }\n}\n\nconst { host } = {\n host: { selector: () => ':host' }\n}\n\nexport const TextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: () => ':host', property: 'width' },\n hostDirection: { selector: () => ':host', property: 'direction' },\n fontSize: {},\n textColor: [\n { property: 'color' }\n ],\n textLineHeight: { property: 'line-height' },\n textLetterSpacing: { property: 'letter-spacing' },\n textShadow: {},\n textAlign: {},\n textTransform: {},\n fontFamily: {},\n fontStyle: {},\n fontWeight: {},\n borderWidth: {},\n borderStyle: {},\n borderColor: {},\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n forwardAttrs,\n injectStyle,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { TextClass } from '@descope-ui/descope-text/class';\n\nexport const componentName = getComponentName('link');\n\nclass RawLink extends createBaseClass({ componentName, baseSelector: ':host a' }) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<div>\n\t\t\t<descope-text>\n\t\t\t\t<a>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</a>\n\t\t\t</descope-text>\n\t\t</div>\n\t\t`;\n\n injectStyle(\n `\n :host {\n\t\t\tdisplay: inline-block;\n line-height: 1em;\n\t\t}\n\t\t:host a {\n\t\t\tdisplay: inline;\n\t\t}\n `,\n this\n );\n\n forwardAttrs(this, this.shadowRoot.querySelector('a'), {\n includeAttrs: ['href', 'target', 'tooltip'],\n mapAttrs: {\n tooltip: 'title',\n },\n });\n\n forwardAttrs(this, this.shadowRoot.querySelector('descope-text'), {\n includeAttrs: ['mode', 'variant'],\n });\n }\n}\n\nconst selectors = {\n host: { selector: () => ':host' },\n link: { selector: () => ':host a' },\n anchor: {},\n wrapper: { selector: () => ':host > div' },\n text: { selector: () => TextClass.componentName },\n};\n\nconst { anchor, text, host, wrapper, link } = selectors;\n\nexport const LinkClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...text, property: 'direction' },\n textAlign: wrapper,\n textDecoration: { ...link, property: 'text-decoration', fallback: 'none' },\n textColor: [\n { ...anchor, property: 'color' },\n { ...text, property: TextClass.cssVarList.textColor },\n ],\n cursor: anchor,\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(RawLink);\n","import { componentName, LinkClass } from './LinkClass';\nimport '@descope-ui/descope-text';\n\ncustomElements.define(componentName, LinkClass);\n\nexport { LinkClass, componentName };\n","/* eslint-disable no-param-reassign */\n\nimport MarkdownIt from 'markdown-it';\nimport { createStyleMixin, draggableMixin, componentNameValidationMixin } from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport { disableRules } from './consts';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { decodeHTML } from './helpers';\nimport { getComponentName, injectStyle, observeChildren } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('enriched-text');\n\nclass EnrichedText extends createBaseClass({ componentName, baseSelector: ':host > div' }) {\n #origLinkRenderer;\n\n #origEmRenderer;\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"content\"></div>\n `;\n\n injectStyle(\n `\n :host {\n line-height: 1em;\n word-break: break-word;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n *, *:last-child {\n margin: 0;\n }\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n p {\n margin-bottom: 1em;\n }\n a {\n cursor: pointer;\n }\n blockquote {\n padding: 0 2em;\n }\n u {\n text-decoration: underline\n }\n s {\n color: currentColor;\n }\n `,\n this\n );\n\n this.#initProcessor();\n\n observeChildren(this, this.#parseChildren.bind(this));\n }\n\n static get observedAttributes() {\n return ['readonly', 'link-target-blank'];\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (newValue !== oldValue) {\n if (attrName === 'readonly') {\n this.onReadOnlyChange(newValue === 'true');\n }\n\n if (attrName === 'link-target-blank') {\n this.#initProcessor();\n }\n }\n }\n\n // We're overriding the rule for em with single underscore to perform as underline. (_underline_)\n customUnderlineRenderer() {\n this.processor.renderer.rules.em_open = (tokens, idx, options, env, self) => {\n if (tokens[idx].markup === '_') tokens[idx].tag = 'u';\n return this.#origEmRenderer(tokens, idx, options, env, self);\n };\n this.processor.renderer.rules.em_close = (tokens, idx, options, env, self) => {\n if (tokens[idx].markup === '_') tokens[idx].tag = 'u';\n return this.#origEmRenderer(tokens, idx, options, env, self);\n };\n }\n\n #customizeLinkRenderer() {\n if (this.linkTargetBlank) {\n this.processor.renderer.rules.link_open = (tokens, idx, options, env, self) => {\n // Add a new `target` attribute, or replace the value of the existing one.\n tokens[idx].attrSet('target', '_blank');\n // Pass the token to the default renderer.\n return this.#origLinkRenderer(tokens, idx, options, env, self);\n };\n } else {\n this.processor.renderer.rules.link_open = this.#origLinkRenderer;\n }\n }\n\n #disableCustomRules() {\n if (!this.processor) {\n return;\n }\n this.processor.disable(disableRules);\n }\n\n #updateProcessorRules() {\n this.#disableCustomRules();\n }\n\n #storeOrigRenderers() {\n const defaultLinkRenderer = (tokens, idx, options, _, self) =>\n self.renderToken(tokens, idx, options);\n this.#origLinkRenderer = this.processor.renderer.rules.link_open || defaultLinkRenderer;\n\n const defaultStrongRenderer = (tokens, idx, options, _, self) =>\n self.renderToken(tokens, idx, options);\n this.#origEmRenderer = this.processor.renderer.rules.em_open || defaultStrongRenderer;\n }\n\n #initProcessor() {\n this.processor = new MarkdownIt('commonmark', { html: true });\n this.#storeOrigRenderers();\n this.#updateProcessorRules();\n this.#customizeLinkRenderer();\n this.customUnderlineRenderer();\n }\n\n get linkTargetBlank() {\n return this.getAttribute('link-target-blank') === 'true';\n }\n\n get contentNode() {\n return this.shadowRoot.querySelector('.content');\n }\n\n #parseChildren() {\n if (!this.processor) {\n return;\n }\n\n let html = decodeHTML(this.innerHTML);\n\n if (!html?.trim() && this.isConnected) {\n this.setAttribute('empty', 'true');\n } else {\n this.removeAttribute('empty');\n }\n\n try {\n const tokens = this.processor.parse(html, { references: undefined });\n html = this.processor.renderer.render(tokens, { html: true, breaks: true });\n } catch (e) {\n // eslint-disable-next-line no-console\n console.warn('Not parsing invalid markdown token');\n }\n\n this.contentNode.innerHTML = html;\n }\n\n onReadOnlyChange(isReadOnly) {\n if (isReadOnly) {\n this.contentNode.setAttribute('inert', isReadOnly);\n } else {\n this.contentNode.removeAttribute('inert');\n }\n }\n}\n\nexport const EnrichedTextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: () => ':host', property: 'width' },\n hostDisplay: { selector: () => ':host', property: 'display', fallback: 'inline-block' },\n hostDirection: { selector: () => ':host', property: 'direction' },\n fontSize: {},\n fontFamily: {},\n fontWeight: {},\n fontWeightBold: [\n { selector: () => ':host strong', property: 'font-weight' },\n { selector: () => ':host b', property: 'font-weight' },\n ],\n textColor: { property: 'color' },\n textLineHeight: { property: 'line-height' },\n textAlign: {},\n linkColor: { selector: 'a', property: 'color' },\n linkTextDecoration: { selector: 'a', property: 'text-decoration' },\n linkHoverTextDecoration: { selector: 'a:hover', property: 'text-decoration' },\n minHeight: {},\n minWidth: {},\n },\n }),\n createStyleMixin({ componentNameOverride: getComponentName('link') }),\n createStyleMixin({ componentNameOverride: getComponentName('text') }),\n draggableMixin,\n componentNameValidationMixin\n)(EnrichedText);\n"],"names":["disableRules","decodeHTML","html","textArea","document","createElement","innerHTML","value","customElements","define","componentName","RawText","baseSelector","constructor","super","this","attachShadow","mode","hideWhenEmpty","getAttribute","init","hasChildren","childNodes","length","style","display","host","selector","TextClass","mappings","hostWidth","property","hostDirection","fontSize","textColor","textLineHeight","textLetterSpacing","textShadow","textAlign","textTransform","fontFamily","fontStyle","fontWeight","borderWidth","borderStyle","borderColor","RawLink","shadowRoot","querySelector","includeAttrs","mapAttrs","tooltip","selectors","link","anchor","wrapper","text","LinkClass","textDecoration","fallback","cssVarList","cursor","EnrichedText","bind","observedAttributes","attributeChangedCallback","attrName","oldValue","newValue","onReadOnlyChange","customUnderlineRenderer","processor","renderer","rules","em_open","tokens","idx","options","env","self","markup","tag","em_close","linkTargetBlank","link_open","attrSet","disable","_","renderToken","contentNode","trim","isConnected","setAttribute","removeAttribute","parse","references","undefined","render","breaks","e","console","warn","isReadOnly","EnrichedTextClass","hostDisplay","fontWeightBold","linkColor","linkTextDecoration","linkHoverTextDecoration","minHeight","minWidth","componentNameOverride"],"sourceRoot":""}
@@ -0,0 +1,2 @@
1
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[2294,4159],{63595:(t,e,o)=>{o.r(e),o.d(e,{TextClass:()=>n.s,componentName:()=>n.T});var n=o(66434);customElements.define(n.T,n.s)},66434:(t,e,o)=>{o.d(e,{T:()=>h,s:()=>c});var n=o(88961),s=o(63200),r=o(25964),i=o(72270);const h=(0,r.xE)("text");class l extends((0,i.qu)({componentName:h,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <slot part="text-wrapper"></slot>\n ',(0,r.fz)("\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n ",this)}get hideWhenEmpty(){return"true"===this.getAttribute("hide-when-empty")}init(){super.init(),(0,r.Ge)(this,(()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""}))}}const{host:p}={host:{selector:()=>":host"}},c=(0,s.Zz)((0,n.RF)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostDirection:{selector:()=>":host",property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),n.VO,n.tQ)(l)},74778:(t,e,o)=>{o.r(e),o.d(e,{LinkClass:()=>x,componentName:()=>l});var n=o(88961),s=o(63200),r=o(25964),i=o(72270),h=o(66434);const l=(0,r.xE)("link");class p extends((0,i.qu)({componentName:l,baseSelector:":host a"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<div>\n\t\t\t<descope-text>\n\t\t\t\t<a>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</a>\n\t\t\t</descope-text>\n\t\t</div>\n\t\t",(0,r.fz)("\n :host {\n\t\t\tdisplay: inline-block;\n line-height: 1em;\n\t\t}\n\t\t:host a {\n\t\t\tdisplay: inline;\n\t\t}\n ",this),(0,r.EA)(this,this.shadowRoot.querySelector("a"),{includeAttrs:["href","target","tooltip"],mapAttrs:{tooltip:"title"}}),(0,r.EA)(this,this.shadowRoot.querySelector("descope-text"),{includeAttrs:["mode","variant"]})}}const c={host:{selector:()=>":host"},link:{selector:()=>":host a"},anchor:{},wrapper:{selector:()=>":host > div"},text:{selector:()=>h.s.componentName}},{anchor:a,text:d,host:m,wrapper:y,link:u}=c,x=(0,s.Zz)((0,n.RF)({mappings:{hostWidth:{...m,property:"width"},hostDirection:{...d,property:"direction"},textAlign:y,textDecoration:{...u,property:"text-decoration",fallback:"none"},textColor:[{...a,property:"color"},{...d,property:h.s.cssVarList.textColor}],cursor:a}}),n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c,KAAM,CACrDC,aAAc,CAAC,OAAQ,SAAU,WACjCC,SAAU,CACRC,QAAS,YAIb,QAAarC,KAAMA,KAAKiC,WAAWC,cAAc,gBAAiB,CAChEC,aAAc,CAAC,OAAQ,YAE3B,EAGF,MAAMG,EAAY,CAChB1B,KAAM,CAAEC,SAAU,IAAM,SACxB0B,KAAM,CAAE1B,SAAU,IAAM,WACxB2B,OAAQ,CAAC,EACTC,QAAS,CAAE5B,SAAU,IAAM,eAC3B6B,KAAM,CAAE7B,SAAU,IAAMC,EAAA,EAAUnB,iBAG5B6C,OAAM,OAAM,wBAAqB,GAAKF,EAEjCK,GAAY,SACvB,QAAiB,CACf5B,SAAU,CACRC,UAAW,IAAKJ,EAAMK,SAAU,SAChCC,cAAe,IAAK,EAAMD,SAAU,aACpCO,UAAWiB,EACXG,eAAgB,IAAK,EAAM3B,SAAU,kBAAmB4B,SAAU,QAClEzB,UAAW,CACT,IAAK,EAAQH,SAAU,SACvB,IAAK,EAAMA,SAAUH,EAAA,EAAUgC,WAAW1B,YAE5C2B,OAAQ,KAGZ,KACA,KAfuB,CAgBvBf,G,SC/EFvC,eAAeC,OAAOC,EAAegD,E","sources":["webpack://@descope/web-components-ui/../components/descope-text/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/TextClass.js","webpack://@descope/web-components-ui/../components/descope-link/src/component/LinkClass.js","webpack://@descope/web-components-ui/../components/descope-link/src/component/index.js"],"sourcesContent":["import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n injectStyle,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('text');\n\nclass RawText extends createBaseClass({\n componentName,\n baseSelector: ':host > slot',\n}) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <slot part=\"text-wrapper\"></slot>\n `;\n\n injectStyle(`\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `, this);\n }\n\n get hideWhenEmpty() {\n return this.getAttribute('hide-when-empty') === 'true';\n }\n\n init() {\n super.init();\n\n observeChildren(this, () => {\n const hasChildren = !!this.childNodes.length;\n this.style.display = !hasChildren && this.hideWhenEmpty ? 'none' : '';\n });\n }\n}\n\nconst { host } = {\n host: { selector: () => ':host' }\n}\n\nexport const TextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: () => ':host', property: 'width' },\n hostDirection: { selector: () => ':host', property: 'direction' },\n fontSize: {},\n textColor: [\n { property: 'color' }\n ],\n textLineHeight: { property: 'line-height' },\n textLetterSpacing: { property: 'letter-spacing' },\n textShadow: {},\n textAlign: {},\n textTransform: {},\n fontFamily: {},\n fontStyle: {},\n fontWeight: {},\n borderWidth: {},\n borderStyle: {},\n borderColor: {},\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n forwardAttrs,\n injectStyle,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { TextClass } from '@descope-ui/descope-text/class';\n\nexport const componentName = getComponentName('link');\n\nclass RawLink extends createBaseClass({ componentName, baseSelector: ':host a' }) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<div>\n\t\t\t<descope-text>\n\t\t\t\t<a>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</a>\n\t\t\t</descope-text>\n\t\t</div>\n\t\t`;\n\n injectStyle(\n `\n :host {\n\t\t\tdisplay: inline-block;\n line-height: 1em;\n\t\t}\n\t\t:host a {\n\t\t\tdisplay: inline;\n\t\t}\n `,\n this\n );\n\n forwardAttrs(this, this.shadowRoot.querySelector('a'), {\n includeAttrs: ['href', 'target', 'tooltip'],\n mapAttrs: {\n tooltip: 'title',\n },\n });\n\n forwardAttrs(this, this.shadowRoot.querySelector('descope-text'), {\n includeAttrs: ['mode', 'variant'],\n });\n }\n}\n\nconst selectors = {\n host: { selector: () => ':host' },\n link: { selector: () => ':host a' },\n anchor: {},\n wrapper: { selector: () => ':host > div' },\n text: { selector: () => TextClass.componentName },\n};\n\nconst { anchor, text, host, wrapper, link } = selectors;\n\nexport const LinkClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...text, property: 'direction' },\n textAlign: wrapper,\n textDecoration: { ...link, property: 'text-decoration', fallback: 'none' },\n textColor: [\n { ...anchor, property: 'color' },\n { ...text, property: TextClass.cssVarList.textColor },\n ],\n cursor: anchor,\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(RawLink);\n","import { componentName, LinkClass } from './LinkClass';\nimport '@descope-ui/descope-text';\n\ncustomElements.define(componentName, LinkClass);\n\nexport { LinkClass, componentName };\n"],"names":["customElements","define","componentName","RawText","baseSelector","constructor","super","this","attachShadow","mode","innerHTML","hideWhenEmpty","getAttribute","init","hasChildren","childNodes","length","style","display","host","selector","TextClass","mappings","hostWidth","property","hostDirection","fontSize","textColor","textLineHeight","textLetterSpacing","textShadow","textAlign","textTransform","fontFamily","fontStyle","fontWeight","borderWidth","borderStyle","borderColor","RawLink","shadowRoot","querySelector","includeAttrs","mapAttrs","tooltip","selectors","link","anchor","wrapper","text","LinkClass","textDecoration","fallback","cssVarList","cursor"],"sourceRoot":""}