@descope/web-components-ui 1.43.0 → 1.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs.js +124 -55
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +530 -256
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/3620.js +1 -1
- package/dist/umd/3620.js.map +1 -1
- package/dist/umd/5348.js +2 -0
- package/dist/umd/5348.js.map +1 -0
- package/dist/umd/6477.js +149 -0
- package/dist/umd/6477.js.map +1 -0
- package/dist/umd/9365.js +1 -1
- package/dist/umd/9365.js.map +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/DescopeDev.js.map +1 -1
- package/dist/umd/descope-hybrid-field-index-js.js +3 -3
- package/dist/umd/descope-hybrid-field-index-js.js.map +1 -1
- package/dist/umd/descope-passcode-index-js.js +1 -1
- package/dist/umd/descope-passcode-index-js.js.map +1 -1
- package/dist/umd/descope-timer-button.js +1 -1
- package/dist/umd/descope-timer-button.js.map +1 -1
- package/dist/umd/descope-timer.js +1 -1
- package/dist/umd/descope-timer.js.map +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js +1 -1
- package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js.map +1 -1
- package/dist/umd/phone-fields-descope-phone-field-index-js.js +1 -1
- package/dist/umd/phone-fields-descope-phone-field-index-js.js.map +1 -1
- package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js +2 -2
- package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js.map +1 -1
- package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js +2 -113
- package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js.LICENSE.txt +0 -6
- package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js.map +1 -1
- package/package.json +7 -6
- package/src/components/descope-hybrid-field/HybridFieldClass.js +6 -0
- package/src/components/descope-passcode/PasscodeClass.js +2 -0
- package/src/components/phone-fields/descope-phone-field/PhoneFieldClass.js +10 -2
- package/src/components/phone-fields/descope-phone-field/descope-phone-field-internal/PhoneFieldInternal.js +229 -125
- package/src/components/phone-fields/descope-phone-input-box-field/PhoneFieldInputBoxClass.js +42 -24
- package/src/components/phone-fields/descope-phone-input-box-field/descope-phone-input-box-internal/PhoneFieldInternalInputBox.js +176 -79
- package/src/components/phone-fields/descope-phone-input-box-field/index.js +0 -1
- package/src/components/phone-fields/helpers.js +7 -0
- package/src/mixins/index.js +1 -0
- package/src/mixins/inputOverrideValidConstraints.js +12 -0
- package/dist/umd/6424.js +0 -149
- package/dist/umd/6424.js.map +0 -1
- /package/dist/umd/{6424.js.LICENSE.txt → 6477.js.LICENSE.txt} +0 -0
package/dist/umd/9365.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"9365.js","mappings":"oNAMO,MAAMA,EAAkB,EAAGC,gBAAeC,eAAe,OAC9D,MAAMC,UAAyBC,YAC7B,wBAAWH,GACT,OAAOA,CACT,CAEA,GAEA,IAAU,EAKV,gBAAIC,GACF,OAAOA,CACT,CAGA,eAAIG,GASF,OARAC,MAAK,IAAiBA,KAAKJ,aACvBI,KAAKC,YAAYC,cAAcF,KAAKJ,cACpCI,KAECA,MAAK,GAERG,QAAQC,KAAK,qCAAsCJ,KAAKK,WAEnDL,MAAK,CACd,CAIA,eAAIC,GACF,OAAOD,KAAKM,YAAcN,IAC5B,CAEA,QAAIO,GACF,OAAOP,KAAKQ,aAAa,OAC3B,CAEA,iBAAAC,GACEC,MAAMD,sBAEFT,KAAKC,YAAYU,aAEfX,MAAK,IACPA,MAAK,GAAU,EACfA,KAAKY,SAGX,EAGF,OAAO,QACL,IACA,IACA,IACA,IAJK,CAKLf,EAAiB,C,kBC5Dd,SAASgB,EAAoBC,EAAWC,EAAU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C7DxP,IAAK,CAACwE,EAAQuK,IACgB,mBAAjBvK,EAAOuK,IAAiC,gBAATA,EACjC,IAAIY,KAGT,GAAoB,IAAhBA,EAAKrO,OAAc,CACrB,MAAMsO,EAAUD,EAAKE,MAAM,EAAGF,EAAKrO,OAAS,GAC5CsO,EAAQ1H,KAAKuH,EAAWnH,cACxBmH,EAAW7F,UAAUmF,MAASa,EAChC,MACEH,EAAW7F,UAAUmF,MAASY,GAEhC,OAAOnL,EAAOuK,MAASY,EAAK,EAIJ,mBAAjBnL,EAAOuK,GACT,IAAIY,KACTF,EAAW7F,UAAUmF,MAASY,GACvBnL,EAAOuK,MAASY,IAIpBnL,EAAOuK,IAGpB,CACF,GAGAe,EAA2BC,IAC/B,QACE9B,EAAgB8B,IAIhB,OAAiB,CAAEtN,uBAAuB,QAAiB,mB","sources":["webpack://@descope/web-components-ui/./src/baseClasses/createBaseClass.js","webpack://@descope/web-components-ui/./src/helpers/mixinsHelpers.js","webpack://@descope/web-components-ui/./src/mixins/changeMixin.js","webpack://@descope/web-components-ui/./src/mixins/componentNameValidationMixin.js","webpack://@descope/web-components-ui/./src/mixins/componentsContextMixin.js","webpack://@descope/web-components-ui/./src/mixins/createProxy.js","webpack://@descope/web-components-ui/./src/mixins/createStyleMixin/helpers.js","webpack://@descope/web-components-ui/./src/mixins/createStyleMixin/index.js","webpack://@descope/web-components-ui/./src/mixins/draggableMixin.js","webpack://@descope/web-components-ui/./src/mixins/externalInputHelpers.js","webpack://@descope/web-components-ui/./src/mixins/externalInputMixin.js","webpack://@descope/web-components-ui/./src/mixins/hoverableMixin.js","webpack://@descope/web-components-ui/./src/mixins/inputEventsDispatchingMixin.js","webpack://@descope/web-components-ui/./src/mixins/inputValidationMixin.js","webpack://@descope/web-components-ui/./src/mixins/normalizeBooleanAttributesMixin.js","webpack://@descope/web-components-ui/./src/mixins/portalMixin.js","webpack://@descope/web-components-ui/./src/mixins/proxyInputMixin.js"],"sourcesContent":["import { compose } from '../helpers';\nimport { componentNameValidationMixin } from '../mixins/componentNameValidationMixin';\nimport { componentsContextMixin } from '../mixins/componentsContextMixin';\nimport { hoverableMixin } from '../mixins/hoverableMixin';\nimport { normalizeBooleanAttributesMixin } from '../mixins/normalizeBooleanAttributesMixin';\n\nexport const createBaseClass = ({ componentName, baseSelector = '' }) => {\n class DescopeBaseClass extends HTMLElement {\n static get componentName() {\n return componentName;\n }\n\n #baseElement;\n\n #isInit = true;\n\n // base selector is the selector for the component wrapper,\n // it's the highest element that is relevant for the layout\n // eslint-disable-next-line class-methods-use-this\n get baseSelector() {\n return baseSelector;\n }\n\n // this is the base element, which returned by querying the base selector\n get baseElement() {\n this.#baseElement ??= this.baseSelector\n ? this.rootElement.querySelector(this.baseSelector)\n : this;\n\n if (!this.#baseElement) {\n // eslint-disable-next-line no-console\n console.warn('missing base element for component', this.localName);\n }\n return this.#baseElement;\n }\n\n // this is the component root level element,\n // it can be either a shadow root or the component's node from the light DOM\n get rootElement() {\n return this.shadowRoot || this;\n }\n\n get name() {\n return this.getAttribute('name');\n }\n\n connectedCallback() {\n super.connectedCallback?.();\n\n if (this.rootElement.isConnected) {\n // the init function is running once, on the first time the component is connected\n if (this.#isInit) {\n this.#isInit = false;\n this.init?.();\n }\n }\n }\n }\n\n return compose(\n componentNameValidationMixin,\n hoverableMixin,\n normalizeBooleanAttributesMixin,\n componentsContextMixin\n )(DescopeBaseClass);\n};\n","// create a dispatch event function that also calls to the onevent function in case it's set\n// usage example:\n// #dispatchSomething = createDispatchEvent.bind(this, 'something' { ...options })\n// this will dispatch a new event when called, but also call to \"onsomething\"\nexport function createDispatchEvent(eventName, options = {}) {\n const event = new Event(eventName, options);\n\n this[`on${eventName}`]?.(event); // in case we got an event callback as property\n this.dispatchEvent(event);\n}\n","import { createDispatchEvent } from '../helpers/mixinsHelpers';\n\nexport const changeMixin = (superclass) =>\n class ChangeMixinClass extends superclass {\n #dispatchChange = createDispatchEvent.bind(this, 'change');\n\n init() {\n super.init?.();\n this.prevValue = this.value;\n\n this.addEventListener('change', (e) => {\n e.stopPropagation();\n });\n\n this.addEventListener('blur', () => {\n if (this.value !== this.prevValue) {\n this.#dispatchChange();\n this.prevValue = this.value;\n }\n });\n }\n };\n","export const componentNameValidationMixin = (superclass) =>\n class ComponentNameValidationMixinClass extends superclass {\n #checkComponentName() {\n const currentComponentName = this.localName;\n\n if (!superclass.componentName) {\n throw Error(\n `component name is not defined on super class, make sure you have a static get for \"componentName\"`\n );\n }\n\n if (currentComponentName !== superclass.componentName) {\n throw Error(\n `component name mismatch, expected \"${superclass.componentName}\", current \"${currentComponentName}\"`\n );\n }\n }\n\n init() {\n super.init?.();\n this.#checkComponentName();\n }\n };\n","export const componentsContextMixin = (superclass) =>\n class ComponentsContextMixinClass extends superclass {\n updateComponentsContext(componentsContext) {\n this.dispatchEvent(\n new CustomEvent('components-context', {\n bubbles: true,\n composed: true,\n detail: componentsContext,\n })\n );\n }\n };\n","import { injectStyle } from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '../baseClasses/createBaseClass';\nimport { isFunction } from '../helpers';\nimport { forwardProps, syncAttrs } from '../helpers/componentHelpers';\nimport { createDispatchEvent } from '../helpers/mixinsHelpers';\n\nexport const createProxy = ({\n componentName,\n wrappedEleName,\n slots = [],\n style,\n excludeAttrsSync = [],\n includeAttrsSync = [],\n includeForwardProps = [],\n delegatesFocus = true,\n}) => {\n class ProxyClass extends createBaseClass({ componentName, baseSelector: wrappedEleName }) {\n #dispatchBlur = createDispatchEvent.bind(this, 'blur');\n\n #dispatchFocus = createDispatchEvent.bind(this, 'focus');\n\n constructor() {\n super().attachShadow({ mode: 'open', delegatesFocus }).innerHTML = `\n\t\t\t<${wrappedEleName}>\n\t\t\t${slots\n .map(\n (\n slot // when slot is an empty string, we will create the default slot (without a name)\n ) => `<slot ${slot ? `name=\"${slot}\" slot=\"${slot}\"` : ''}></slot>`\n )\n .join('')}\n\t\t\t</${wrappedEleName}>\n\t\t`;\n\n injectStyle((isFunction(style) ? style() : style) || '', this);\n }\n\n init() {\n super.init?.();\n\n this.baseElement.addEventListener('blur', (_) => {\n this.#dispatchBlur();\n });\n\n this.baseElement.addEventListener('focus', (_) => {\n this.#dispatchFocus();\n });\n\n // this is needed for components that uses props, such as combo box\n forwardProps(this.baseElement, this, includeForwardProps);\n\n syncAttrs(this.baseElement, this, {\n excludeAttrs: excludeAttrsSync,\n includeAttrs: includeAttrsSync,\n });\n }\n }\n\n return ProxyClass;\n};\n","import { camelCaseJoin, isFunction, kebabCase, kebabCaseJoin } from '../../helpers';\nimport { getCssVarName } from '../../helpers/componentHelpers';\n\nconst createCssVar = (varName, fallback) => `var(${varName}${fallback ? `, ${fallback}` : ''})`;\n\nconst createCssSelector = (baseSelector = '', relativeSelectorOrSelectorFn = '') =>\n isFunction(relativeSelectorOrSelectorFn)\n ? relativeSelectorOrSelectorFn(baseSelector)\n : `${baseSelector}${\n /^[A-Za-z]/.test(relativeSelectorOrSelectorFn)\n ? ` ${relativeSelectorOrSelectorFn}`\n : relativeSelectorOrSelectorFn\n }`;\n\nclass StyleBuilder {\n constructor() {\n this.styleMap = new Map();\n }\n\n add(selector, property, value) {\n if (!this.styleMap.has(selector)) {\n this.styleMap.set(selector, []);\n }\n\n this.styleMap.set(selector, [...this.styleMap.get(selector), { property, value }]);\n }\n\n toString() {\n return Array.from(this.styleMap.entries()).reduce((acc, [selector, propValArr]) => {\n const properties = propValArr\n .map(({ property, value }) => `${property}: ${value}`)\n .join(';\\n');\n\n return `${acc}${selector} { \\n${properties} \\n}\\n\\n`;\n }, '');\n }\n}\n\nconst normalizeConfig = (attr, config) => {\n const defaultMapping = { selector: '', property: kebabCase(attr) };\n\n if (!config || !Object.keys(config).length) return [defaultMapping];\n\n if (Array.isArray(config)) return config.map((entry) => ({ ...defaultMapping, ...entry }));\n\n return [{ ...defaultMapping, ...config }];\n};\n\nconst getFallbackVarName = (origVarName, suffix = 'fallback') => kebabCaseJoin(origVarName, suffix);\n\nexport const createStyle = (componentName, baseSelector, mappings) => {\n const style = new StyleBuilder();\n const createFallbackVar = (fallback, origVarName) => {\n if (!fallback) return '';\n if (typeof fallback === 'string') return fallback;\n\n const fallbackVarName = getFallbackVarName(origVarName, fallback?.suffix);\n return createCssVar(fallbackVarName, createFallbackVar(fallback.fallback, fallbackVarName));\n };\n\n Object.keys(mappings).forEach((attr) => {\n const attrConfig = normalizeConfig(attr, mappings[attr]);\n\n const cssVarName = getCssVarName(componentName, attr);\n\n attrConfig.forEach(\n ({ selector: relativeSelectorOrSelectorFn, property, important, fallback }) => {\n const fallbackValue = createFallbackVar(fallback, cssVarName);\n style.add(\n createCssSelector(baseSelector, relativeSelectorOrSelectorFn),\n isFunction(property) ? property() : property,\n createCssVar(cssVarName, fallbackValue) + (important ? '!important' : '')\n );\n }\n );\n });\n\n return style.toString();\n};\n\nconst getFallbackVarsNames = (attr, origVarName, { fallback }) => {\n if (!fallback) return {};\n\n const fallbackVarName = getFallbackVarName(origVarName, fallback.suffix);\n const fallbackAttrName = camelCaseJoin(attr, fallback.suffix || 'fallback');\n return {\n [fallbackAttrName]: fallbackVarName,\n ...getFallbackVarsNames(fallbackAttrName, fallbackVarName, fallback),\n };\n};\n\nexport const createCssVarsList = (componentName, mappings) =>\n Object.keys(mappings).reduce((acc, attr) => {\n const varName = getCssVarName(componentName, attr);\n\n return Object.assign(\n acc,\n { [attr]: varName },\n getFallbackVarsNames(attr, varName, mappings[attr])\n );\n }, {});\n\n// on some cases we need a selector to be more specific than another\n// for this we have this fn that generate a class selector multiple times\nexport const createClassSelectorSpecifier = (className, numOfRepeats) =>\n Array(numOfRepeats).fill(`.${className}`).join('');\n","import { injectStyle } from '@descope-ui/common/components-helpers';\nimport { BASE_THEME_SECTION, CSS_SELECTOR_SPECIFIER_MULTIPLY } from '../../constants';\nimport { kebabCaseJoin } from '../../helpers';\nimport { getCssVarName, observeAttributes } from '../../helpers/componentHelpers';\nimport { componentsThemeManager } from '../../helpers/themeHelpers';\nimport { createStyle, createCssVarsList, createClassSelectorSpecifier } from './helpers';\n\nconst STYLE_OVERRIDE_ATTR_PREFIX = 'st';\n\nexport const createStyleMixin =\n ({ mappings = {}, componentNameOverride = '' }) =>\n (superclass) => {\n const componentName = componentNameOverride || superclass.componentName;\n\n return class CustomStyleMixinClass extends superclass {\n static get cssVarList() {\n return {\n ...superclass.cssVarList,\n ...createCssVarsList(componentName, {\n ...mappings,\n }),\n };\n }\n\n #overrideStyleEle;\n\n #themeStyleEle;\n\n #disconnectThemeManager;\n\n #componentNameSuffix;\n\n #themeSection;\n\n #rootElement;\n\n #baseSelector;\n\n #styleAttributes;\n\n #getRootElement;\n\n // we are using this mixin also for portalMixin\n // so we should be able to inject styles to other DOM elements\n // this is why we need to support these overrides\n constructor({\n getRootElement,\n componentNameSuffix = '',\n themeSection = BASE_THEME_SECTION,\n baseSelector,\n } = {}) {\n super();\n this.#componentNameSuffix = componentNameSuffix;\n this.#themeSection = themeSection;\n this.#baseSelector = baseSelector ?? this.baseSelector;\n this.#getRootElement = getRootElement;\n\n this.#styleAttributes = Object.keys(CustomStyleMixinClass.cssVarList).map((key) =>\n kebabCaseJoin(STYLE_OVERRIDE_ATTR_PREFIX, componentNameSuffix, key)\n );\n }\n\n // eslint-disable-next-line class-methods-use-this\n get #componentTheme() {\n return componentsThemeManager.currentTheme?.[componentName] || '';\n }\n\n #onComponentThemeChange() {\n this.#themeStyleEle.replaceSync(this.#componentTheme[this.#themeSection]);\n }\n\n #createComponentTheme() {\n this.#themeStyleEle = injectStyle('', this.#rootElement, { prepend: true });\n this.#disconnectThemeManager = componentsThemeManager.onCurrentThemeChange(\n this.#onComponentThemeChange.bind(this)\n );\n this.#onComponentThemeChange();\n }\n\n #createOverridesStyle() {\n if (this.#styleAttributes.length) {\n const classSpecifier = createClassSelectorSpecifier(\n componentName,\n CSS_SELECTOR_SPECIFIER_MULTIPLY\n );\n\n this.#overrideStyleEle = injectStyle(`:host(${classSpecifier}) {}`, this.#rootElement);\n }\n }\n\n #setAttrOverride(attrName, value) {\n const style = this.#overrideStyleEle?.cssRules[0].style;\n\n if (!style) return;\n\n const varName = getCssVarName(\n componentName,\n attrName.replace(new RegExp(`^${STYLE_OVERRIDE_ATTR_PREFIX}-`), '')\n );\n\n if (value) style?.setProperty(varName, value);\n else {\n style?.removeProperty(varName);\n this.removeAttribute(attrName);\n }\n }\n\n #updateOverridesStyle(attrs = []) {\n attrs.forEach((attr) => {\n if (this.#styleAttributes.includes(attr)) {\n this.#setAttrOverride(attr, this.getAttribute(attr));\n }\n });\n }\n\n #createMappingStyle() {\n if (Object.keys(mappings).length) {\n const style = createStyle(\n kebabCaseJoin(componentName, this.#componentNameSuffix),\n this.#baseSelector,\n mappings\n );\n\n injectStyle(style, this.#rootElement, { prepend: true });\n }\n }\n\n #addClassName(className) {\n (this.#rootElement.classList || this.#rootElement.host.classList).add(className);\n }\n\n async init() {\n super.init?.();\n if (this.shadowRoot.isConnected) {\n this.#rootElement = (await this.#getRootElement?.(this)) || this.shadowRoot;\n\n this.#addClassName(componentName);\n\n this.#createMappingStyle();\n this.#createComponentTheme();\n this.#createOverridesStyle();\n\n // this is instead attributeChangedCallback because we cannot use static methods in this case\n observeAttributes(this, this.#updateOverridesStyle.bind(this), {});\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback?.();\n\n this.#disconnectThemeManager?.();\n }\n };\n };\n","import { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const draggableMixin = (superclass) =>\n class DraggableMixinClass extends superclass {\n constructor() {\n super();\n\n injectStyle(`:host([draggable=\"true\"]) * { cursor: inherit!important }`, this);\n }\n\n get isDraggable() {\n return this.hasAttribute('draggable') && this.getAttribute('draggable') !== 'false';\n }\n\n init() {\n // because we are delegating the focus from the outer component,\n // the D&D is not working well in the page editor\n // in order to solve it we are making the inner component focusable on mouse down\n // and removing it on complete\n this.addEventListener('mousedown', (e) => {\n if (this.isDraggable) {\n const prevTabIndex = this.baseElement.getAttribute('tabindex');\n this.baseElement.setAttribute('tabindex', '-1');\n\n const onComplete = () => {\n prevTabIndex\n ? this.baseElement.setAttribute('tabindex', prevTabIndex)\n : this.baseElement.removeAttribute('tabindex');\n\n e.target.removeEventListener('mouseup', onComplete);\n e.target.removeEventListener('dragend', onComplete);\n };\n\n e.target.addEventListener('mouseup', onComplete, { once: true });\n e.target.addEventListener('dragend', onComplete, { once: true });\n }\n });\n\n super.init?.();\n }\n };\n","// since on load we can only sample the color of the placeholder,\n// we need to temporarily populate the input in order to sample the value color\nconst getValueColor = (ele, computedStyle) => {\n // to support setting dynamic values, we have to store the existing value\n // and re-set it if we are returning from this hack\n const origVal = ele.value;\n\n // eslint-disable-next-line no-param-reassign\n ele.value = '_';\n\n const valueColor = computedStyle.getPropertyValue('color');\n\n if (ele.value === '_') {\n // eslint-disable-next-line no-param-reassign\n ele.value = origVal;\n }\n\n return valueColor;\n};\n\nexport const createExternalInputSlot = (slotName, targetSlotName) => {\n const slotEle = document.createElement('slot');\n\n slotEle.setAttribute('name', slotName);\n slotEle.setAttribute('slot', targetSlotName);\n\n return slotEle;\n};\n\nexport const createExternalInputEle = (targetSlotName, type, autocompleteType, inputName) => {\n const inputEle = document.createElement('input');\n\n inputEle.setAttribute('slot', targetSlotName);\n inputEle.setAttribute('type', type);\n inputEle.setAttribute('name', inputName);\n inputEle.setAttribute('data-hidden-input', 'true');\n inputEle.setAttribute('autocomplete', autocompleteType);\n\n return inputEle;\n};\n\n// We apply the original input's style to the external-input.\n// Eventually, the user should interact directly with the external input.\n// We keep the original input\nexport const applyExternalInputStyles = (sourceInputEle, targetInputEle, labelType) => {\n // We set a timeout here to avoid \"Double Print\" cases,\n // caused by sampling the computed style before it's ready.\n setTimeout(() => {\n const computedStyle = getComputedStyle(sourceInputEle);\n // Get minimal set of computed theme properties to set on external input\n const height = computedStyle.getPropertyValue('height');\n const paddingLeft = computedStyle.getPropertyValue('padding-left');\n const paddingRight = computedStyle.getPropertyValue('padding-right');\n const fontSize = computedStyle.getPropertyValue('font-size');\n const fontFamily = computedStyle.getPropertyValue('font-family');\n const letterSpacing = computedStyle.getPropertyValue('letter-spacing');\n const caretColor = computedStyle.getPropertyValue('caret-color');\n\n const valueColor = getValueColor(sourceInputEle, computedStyle);\n\n const commonThemeStyles = [\n ['all', 'unset'],\n ['position', 'absolute'],\n ['background-color', 'transparent'],\n ['height', height],\n ['left', paddingLeft],\n ['right', paddingRight],\n ['font-size', fontSize],\n ['font-family', fontFamily],\n ['letter-spacing', letterSpacing],\n ['caret-color', caretColor], // this is for seeing caret when focusing on external input\n ['color', valueColor],\n ];\n\n commonThemeStyles.forEach(([key, val]) =>\n targetInputEle.style.setProperty(key, val, 'important')\n );\n\n // Handle floating label theme properties\n if (labelType === 'floating') {\n const marginBottom = computedStyle.getPropertyValue('margin-bottom');\n targetInputEle.style.setProperty('margin-bottom', marginBottom, 'important');\n }\n\n // sample and apply width only after original input is ready and fully rendered\n const width = computedStyle.getPropertyValue('width');\n targetInputEle.style.setProperty(\n 'width',\n `calc(${width} - ${paddingLeft} - ${paddingRight}`,\n 'important'\n );\n }, 0);\n};\n","import { syncAttrs } from '../helpers/componentHelpers';\nimport {\n applyExternalInputStyles,\n createExternalInputEle,\n createExternalInputSlot,\n} from './externalInputHelpers';\n\nexport const externalInputMixin =\n ({ inputType, inputName, autocompleteType, includeAttrs = [], noBlurDispatch = false }) =>\n (superclass) =>\n class ExternalInputMixinClass extends superclass {\n #timers = [];\n\n get isExternalInput() {\n return this.getAttribute('external-input') === 'true';\n }\n\n createExternalInput() {\n if (!this.isExternalInput || this.isReadOnly || this.isDisabled) {\n return null;\n }\n\n // use original input element as reference\n const origInput = this.baseElement.querySelector('input');\n\n if (!origInput) {\n return null;\n }\n\n // to avoid focus loop between external-input and origInput\n // we set origInput's tabindex to -1\n // otherwise, shift-tab will never leave the component focus\n origInput.setAttribute('tabindex', '-1');\n\n // create external slot\n const externalInputSlot = createExternalInputSlot('external-input', 'suffix');\n\n // append external slot to base element\n this.baseElement.appendChild(externalInputSlot);\n\n this.externalInput = createExternalInputEle(\n 'external-input',\n inputType,\n this.getAutocompleteType(),\n inputName\n );\n\n // apply original input's styles to external input\n setTimeout(() => {\n applyExternalInputStyles(origInput, this.externalInput, this.getAttribute('label-type'));\n });\n\n // 1Password catches the internal input, so we forward the value to the external input\n this.forwardInputValue(origInput, this.externalInput);\n\n syncAttrs(origInput, this.externalInput, {\n includeAttrs,\n });\n\n // We disable Vaadin's original `_setFocused` function, and use handleFocusEvents\n // and handleBlurEvents functions\n this.baseElement\n .querySelector('input')\n .addEventListener('focusout', (e) => e.stopImmediatePropagation(), true);\n\n // In order to manage focus/blur events when moving between parts of the component\n // we're managing the event dispatching by ourselves, with the following strategy:\n // - If one of the component parts is focused - it means that the component is still focused - so we stop the blur events.\n // - When none of the component parts is focused, we dispatch blur event.\n this.handleFocusEvents();\n this.handleBlurEvents();\n\n // sync input value\n this.handlelInputEvents(this.externalInput);\n\n // append external input to component's DOM\n this.appendChild(this.externalInput);\n\n return this.externalInput;\n }\n\n clearBlurTimers() {\n this.#timers.forEach((timer) => clearTimeout(timer));\n this.#timers.length = 0;\n }\n\n dispatchBlur() {\n return setTimeout(() => {\n this.dispatchEvent(new Event('blur', { bubbles: true, composed: true }));\n this.removeAttribute('focused');\n });\n }\n\n handleFocusEvents() {\n // on baseElement `focus` we forward the focus to the external input.\n // also, in order to avoid any blur within the component, we clear the blur timers.\n this.baseElement.addEventListener('focus', () => {\n this.externalInput.focus();\n this.clearBlurTimers();\n });\n\n // on `focus` of the external input, we manually set the `focused` attribute\n this.externalInput.addEventListener('focus', () => {\n this.clearBlurTimers();\n setTimeout(() => this.baseElement.setAttribute('focused', 'true'));\n });\n }\n\n handleBlurEvents() {\n this.baseElement.addEventListener(\n 'blur',\n (e) => {\n e.stopImmediatePropagation();\n // some components do not require this synthetic blur dispatch (e.g. Password)\n // so we allow them to override this dispatch\n if (noBlurDispatch) return;\n this.#timers.push(this.dispatchBlur());\n },\n true\n );\n\n this.externalInput.addEventListener(\n 'blur',\n (e) => {\n e.stopImmediatePropagation();\n this.#timers.push(this.dispatchBlur());\n },\n true\n );\n }\n\n handlelInputEvents(externalInput) {\n // sync value of insible input back to original input\n externalInput.addEventListener('input', (e) => {\n this.value = e.target.value;\n });\n\n // handle has-value attr\n externalInput.addEventListener('input', (e) => {\n if (!e.target.value) {\n this.removeAttribute('has-value');\n } else {\n this.setAttribute('has-value', 'true');\n }\n });\n }\n\n getAutocompleteType() {\n return this.getAttribute('autocomplete') || autocompleteType;\n }\n\n forwardInputValue(source, target) {\n // set internal sync events\n const valueDescriptor = Object.getOwnPropertyDescriptor(\n this.inputElement.constructor.prototype,\n 'value'\n );\n\n Object.defineProperty(source, 'value', {\n ...valueDescriptor,\n\n set(v) {\n valueDescriptor.set.call(this, v);\n // eslint-disable-next-line no-param-reassign\n target.value = v;\n },\n configurable: true,\n });\n }\n };\n","export const hoverableMixin = (superclass) =>\n class HoverableMixinClass extends superclass {\n init() {\n super.init?.();\n\n this.baseElement.addEventListener('mouseover', (e) => {\n this.setAttribute('hover', 'true');\n e.target.addEventListener('mouseleave', () => this.removeAttribute('hover'), {\n once: true,\n });\n });\n }\n };\n","import { createDispatchEvent } from '../helpers/mixinsHelpers';\n\nexport const inputEventsDispatchingMixin = (superclass) =>\n class InputEventsDispatchingMixinClass extends superclass {\n init() {\n this.#blockNativeEvents();\n\n super.init?.();\n }\n\n // we want to block the native (trusted) events and control when these events are being dispatched\n #blockNativeEvents() {\n ['blur', 'focus', 'focusin', 'focusout'].forEach((event) => {\n this.addEventListener(event, (e) => {\n e.isTrusted && e.target === this && e.stopImmediatePropagation();\n });\n });\n }\n\n handleFocusEventsDispatching(inputs) {\n let timerId;\n\n // in order to simulate blur & focusout on root input element\n // we are checking if focus on one of the inner elements happened immediately after blur\n // if not, the component is no longer focused and we should dispatch blur & focusout\n inputs?.forEach((input) => {\n input?.addEventListener('focusout', (e) => {\n e.stopImmediatePropagation();\n timerId = setTimeout(() => {\n timerId = null;\n\n createDispatchEvent.call(this, 'blur');\n createDispatchEvent.call(this, 'focusout', { bubbles: true });\n });\n });\n\n // in order to simulate focus & focusin on the root input element\n // we are holding a timer id and clearing it on focusin\n // if there is a timer id, it means that the root input is still focused\n // otherwise, it was not focused before, and we should dispatch focus & focusin\n const onFocus = (e) => {\n e.stopImmediatePropagation();\n clearTimeout(timerId);\n if (!timerId) {\n createDispatchEvent.call(this, 'focus');\n createDispatchEvent.call(this, 'focusin', { bubbles: true });\n }\n };\n\n // some components are not dispatching focusin but only focus\n input?.addEventListener('focusin', onFocus);\n input?.addEventListener('focus', onFocus);\n });\n }\n\n // we want to block the input events from propagating in case the value of the root input wasn't change\n // this can happen if we are sanitizing characters on the internal inputs and do not want it to affect the root input element value\n // in this case, on each input event, we are comparing the root input value to the previous one, and only if it does not match, we are allowing the input event to propagate\n handleInputEventDispatching() {\n let previousRootComponentValue = this.value;\n\n // we are comparing the previous value to the new one,\n // and if they have the same value, we are blocking the input event\n this.addEventListener('input', (e) => {\n // We don't want to block our own event that we fire from handleInputEventDispatching\n if (this !== e.target) {\n e.stopImmediatePropagation();\n\n if (previousRootComponentValue !== this.value) {\n previousRootComponentValue = this.value;\n createDispatchEvent.call(this, 'input', { bubbles: true, composed: true });\n }\n }\n });\n }\n };\n","import 'element-internals-polyfill'; // this is needed in order to support older browsers\n\nconst observedAttributes = ['required', 'pattern'];\n\nconst errorAttributes = {\n valueMissing: 'data-errormessage-value-missing',\n patternMismatch: 'data-errormessage-pattern-mismatch',\n tooShort: 'data-errormessage-pattern-mismatch-too-short',\n tooLong: 'data-errormessage-pattern-mismatch-too-long',\n rangeUnderflow: 'data-errormessage-pattern-range-underflow',\n rangeOverflow: 'data-errormessage-pattern-range-overflow',\n typeMismatch: 'data-errormessage-type-mismatch',\n};\n\nconst validationTargetSymbol = Symbol('validationTarget');\n\nexport const inputValidationMixin = (superclass) =>\n class InputValidationMixinClass extends superclass {\n #validationTarget = validationTargetSymbol;\n\n static get observedAttributes() {\n return [...(superclass.observedAttributes || []), ...observedAttributes];\n }\n\n static get formAssociated() {\n return true;\n }\n\n #internals;\n\n get internals() {\n return this.#internals;\n }\n\n set internals(value) {\n this.#internals = value;\n }\n\n constructor() {\n super();\n\n this.#internals = this.attachInternals();\n }\n\n // eslint-disable-next-line class-methods-use-this\n get defaultErrorMsgValueMissing() {\n return 'Please fill out this field.';\n }\n\n // eslint-disable-next-line class-methods-use-this\n get defaultErrorMsgPatternMismatch() {\n return 'Please match the requested format.';\n }\n\n get defaultErrorMsgTooShort() {\n return `Minimum length is ${this.getAttribute('minlength')}.`;\n }\n\n get defaultErrorMsgTooLong() {\n return `Maximum length is ${this.getAttribute('maxlength')}. `;\n }\n\n get defaultErrorMsgRangeUnderflow() {\n return `At least ${this.getAttribute('min-items-selection')} items are required.`;\n }\n\n get defaultErrorMsgRangeOverflow() {\n return `At most ${this.getAttribute('max-items-selection')} items are allowed.`;\n }\n\n // eslint-disable-next-line class-methods-use-this\n get defaultErrorMsgTypeMismatch() {\n return `Please match the requested type.`;\n }\n\n getErrorMessage(flags) {\n const {\n valueMissing,\n patternMismatch,\n typeMismatch,\n stepMismatch,\n tooShort,\n tooLong,\n rangeOverflow,\n rangeUnderflow,\n badInput,\n customError,\n } = flags;\n\n switch (true) {\n case valueMissing:\n return (\n this.getAttribute(errorAttributes.valueMissing) || this.defaultErrorMsgValueMissing\n );\n case patternMismatch || stepMismatch || badInput:\n return (\n this.getAttribute(errorAttributes.patternMismatch) ||\n this.defaultErrorMsgPatternMismatch\n );\n case typeMismatch:\n return (\n this.getAttribute(errorAttributes.typeMismatch) ||\n this.getAttribute(errorAttributes.patternMismatch) ||\n this.defaultErrorMsgTypeMismatch\n );\n case tooShort:\n return this.getAttribute(errorAttributes.tooShort) || this.defaultErrorMsgTooShort;\n case tooLong:\n return this.getAttribute(errorAttributes.tooLong) || this.defaultErrorMsgTooLong;\n case rangeUnderflow:\n return (\n this.getAttribute(errorAttributes.rangeUnderflow) || this.defaultErrorMsgRangeUnderflow\n );\n case rangeOverflow:\n return (\n this.getAttribute(errorAttributes.rangeOverflow) || this.defaultErrorMsgRangeOverflow\n );\n case customError:\n return this.validationMessage;\n default:\n return '';\n }\n }\n\n #setValidity() {\n const validity = this.isReadOnly ? {} : this.getValidity();\n this.#internals.setValidity(validity, this.getErrorMessage(validity), this.validationTarget);\n }\n\n get validationMessage() {\n return this.#internals.validationMessage;\n }\n\n // eslint-disable-next-line class-methods-use-this\n getValidity() {\n // eslint-disable-next-line no-console\n console.warn('getValidity', 'is not implemented');\n }\n\n checkValidity() {\n return this.#internals.validity.valid;\n }\n\n reportValidity() {\n return this.#internals.reportValidity();\n }\n\n get validity() {\n return this.#internals.validity;\n }\n\n get validationTarget() {\n return this.#validationTarget === validationTargetSymbol\n ? this.inputElement\n : this.#validationTarget;\n }\n\n set validationTarget(val) {\n this.#validationTarget = val;\n }\n\n setCustomValidity(errorMessage) {\n if (errorMessage) {\n this.#internals.setValidity({ customError: true }, errorMessage, this.validationTarget);\n } else {\n this.#internals.setValidity({});\n this.#setValidity();\n }\n }\n\n get isRequired() {\n return this.hasAttribute('required') && this.getAttribute('required') !== 'false';\n }\n\n get isReadOnly() {\n return this.hasAttribute('readonly') && this.getAttribute('readonly') !== 'false';\n }\n\n get isDisabled() {\n return this.hasAttribute('disabled') && this.getAttribute('disabled') !== 'false';\n }\n\n get pattern() {\n return this.getAttribute('pattern');\n }\n\n get form() {\n return this.#internals.form;\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (observedAttributes.includes(attrName)) {\n this.#setValidity();\n }\n }\n\n init() {\n super.init?.();\n this.addEventListener('change', this.#setValidity);\n this.addEventListener('invalid', (e) => e.stopPropagation());\n this.addEventListener('input', this.#setValidity);\n\n // The attribute sync takes time, so getValidity returns valid,\n // even when it shouldn't. This way allows all attributes to sync\n // after render, before checking the validity.\n setTimeout(() => this.#setValidity());\n }\n };\n","import { observeAttributes } from '../helpers/componentHelpers';\n\nconst booleanAttributesList = [\n 'readonly',\n 'focused',\n 'invalid',\n 'has-label',\n 'required',\n 'disabled',\n 'checked',\n 'has-helper',\n 'has-value',\n 'step-buttons-visible',\n 'hover',\n 'has-error-message',\n 'focus-ring',\n 'opened',\n 'active',\n 'password-visible',\n 'opening',\n 'closing',\n 'has-no-options',\n 'loading',\n 'allow-custom-value',\n 'loading',\n];\n\nconst isBooleanAttribute = (attr) => {\n return booleanAttributesList.includes(attr);\n};\n// we want all the valueless attributes to have \"true\" value\n// and all the falsy attribute to be removed\nexport const normalizeBooleanAttributesMixin = (superclass) =>\n class NormalizeBooleanAttributesMixinClass extends superclass {\n init() {\n super.init?.();\n\n observeAttributes(\n this,\n (attrs) =>\n attrs.forEach((attr) => {\n const attrVal = this.getAttribute(attr);\n\n if (isBooleanAttribute(attr)) {\n if (attrVal === '') {\n this.setAttribute(attr, 'true');\n } else if (attrVal === 'false') {\n this.removeAttribute(attr);\n }\n } else if (!attrVal) {\n // eslint-disable-next-line no-console\n console.debug(\n `attribute \"${attr}\" has no value, should it be added to the boolean attributes list?`\n );\n }\n }),\n {}\n );\n }\n };\n","import { PORTAL_THEME_PREFIX } from '../constants';\nimport { kebabCaseJoin } from '../helpers';\nimport { forwardAttrs } from '../helpers/componentHelpers';\nimport { createStyleMixin } from './createStyleMixin';\nimport { createCssVarsList } from './createStyleMixin/helpers';\n\n// this is needed because we might generate the same css vars names\n// e.g. \"overlayColor\" attribute in style mixin's mapping,\n// will generate the same var as \"color\" attribute in portals's mapping\n// when the portal name is \"overlay\".\n// because of that, we are adding this separator that is also used as a differentiator\nconst DISPLAY_NAME_SEPARATOR = '_';\n\nconst sanitizeSelector = (selector) => selector.replace(/[^\\w\\s]/gi, '');\n\nconst withWaitForShadowRoot = (getRootElementFn) => async (that) => {\n const ele = await getRootElementFn(that);\n\n return new Promise((res) => {\n const MAX_RETRIES = 20;\n let counter = 0;\n\n const check = () => {\n if (counter > MAX_RETRIES) {\n // eslint-disable-next-line no-console\n console.error('could not get shadow root for element', ele);\n res(ele);\n return;\n }\n\n counter++;\n\n if (!ele?.shadowRoot) {\n setTimeout(check);\n } else {\n res(ele.shadowRoot);\n }\n };\n check();\n });\n};\n\nexport const portalMixin =\n ({ name, selector, mappings = {}, forward: { attributes = [], include = true } = {} }) =>\n (superclass) => {\n const eleDisplayName = name || sanitizeSelector(selector);\n\n const BaseClass = createStyleMixin({\n mappings,\n })(superclass);\n\n return class PortalMixinClass extends BaseClass {\n static get cssVarList() {\n return {\n ...BaseClass.cssVarList,\n [eleDisplayName]: createCssVarsList(\n kebabCaseJoin(superclass.componentName, DISPLAY_NAME_SEPARATOR + eleDisplayName),\n mappings\n ),\n };\n }\n\n #portalEle;\n\n constructor() {\n // we cannot use \"this\" before calling \"super\"\n const getRootElement = async (that) => {\n const baseEle = (that.shadowRoot || that).querySelector(that.baseSelector);\n if (!selector) {\n return baseEle;\n }\n\n // in case we have a selector, we should first wait for the base element shadow root\n // and then look for the internal element\n const baseEleShadowRoot = await withWaitForShadowRoot(() => baseEle)(that);\n return baseEleShadowRoot.querySelector(selector);\n };\n\n const getPortalElement = withWaitForShadowRoot(getRootElement);\n\n super({\n getRootElement: getPortalElement,\n componentNameSuffix: DISPLAY_NAME_SEPARATOR + eleDisplayName,\n themeSection: PORTAL_THEME_PREFIX + eleDisplayName,\n baseSelector: ':host',\n });\n\n this.#portalEle = getPortalElement(this).then((ele) => ele.host);\n }\n\n async #handleHoverAttribute() {\n const portalEle = await this.#portalEle;\n portalEle.onmouseenter = (e) => {\n e.target.setAttribute('hover', 'true');\n };\n portalEle.onmouseleave = (e) => {\n e.target.removeAttribute('hover');\n };\n }\n\n async init() {\n super.init?.();\n const portalEle = await this.#portalEle;\n forwardAttrs(this, portalEle, {\n [include ? 'includeAttrs' : 'excludeAttrs']: attributes,\n });\n\n this.#handleHoverAttribute();\n }\n };\n };\n","/* eslint-disable no-param-reassign */\nimport { compose } from '../helpers';\nimport { forwardAttrs, getComponentName } from '../helpers/componentHelpers';\nimport { createDispatchEvent } from '../helpers/mixinsHelpers';\nimport { createStyleMixin } from './createStyleMixin';\nimport { inputValidationMixin } from './inputValidationMixin';\n\nconst errorAttrs = ['invalid', 'required'];\n\nconst forwardProps = (src, targets, property) => {\n const targetArr = Array.isArray(targets) ? targets : [targets];\n\n Object.defineProperty(src, property, {\n set(v) {\n targetArr.forEach((target) => {\n target[property] = v;\n });\n },\n get() {\n return targets[0][property];\n },\n configurable: true,\n });\n};\n\n// recursively take the first slot child until it finds an element which is not a slot\n// stops after \"nestingLevel\" times\nconst getNestedInput = (ele) => {\n if (!ele) return undefined;\n\n const nestingLevel = 10;\n\n let nonSlotEle = ele;\n for (let i = 0; i < nestingLevel; i++) {\n [nonSlotEle] = nonSlotEle.assignedElements();\n if (nonSlotEle?.localName !== 'slot') return nonSlotEle;\n }\n return undefined;\n};\n\nconst proxyInputMixin =\n ({\n proxyProps = [],\n // useProxyTargets flag allows to forwardProps to other targets, other than\n // `this.inputElement`. It's to be used within `external-input` components,\n // if needed\n useProxyTargets = false,\n // allows us to set the event that should trigger validation\n // it can be either a string or an array of strings (for multiple events)\n inputEvent = 'input',\n triggerValidationEvents = [],\n // Proxies all validations from the parent component to the input element\n proxyParentValidation = false,\n }) =>\n (superclass) =>\n class ProxyInputMixinClass extends inputValidationMixin(superclass) {\n static get observedAttributes() {\n return [...(superclass.observedAttributes || []), ...errorAttrs];\n }\n\n #inputElement;\n\n #dispatchChange = createDispatchEvent.bind(this, 'change');\n\n constructor() {\n super();\n\n this.#inputElement = super.inputElement;\n }\n\n // the web-component does not loaded immediately, so we want to defer the warning\n // and show it only if the input element was not found after the component is loaded\n warnIfInputElementIsMissing() {\n clearTimeout(this.inputElementTimerId);\n\n this.inputElementTimerId = setTimeout(() => {\n // eslint-disable-next-line no-console\n !this.#inputElement && console.warn(this.localName, 'no input was found');\n }, 0);\n }\n\n get inputElement() {\n if (this.#inputElement) return this.#inputElement;\n\n this.warnIfInputElementIsMissing();\n\n const inputSlot = this.baseElement.shadowRoot?.querySelector('slot[name=\"input\"]');\n const textAreaSlot = this.baseElement.shadowRoot?.querySelector('slot[name=\"textarea\"]');\n\n this.#inputElement = getNestedInput(inputSlot) || getNestedInput(textAreaSlot);\n\n return this.#inputElement;\n }\n\n set inputElement(ele) {\n this.#inputElement = ele;\n }\n\n getValidity() {\n return this.inputElement?.validity || {};\n }\n\n #handleErrorMessage() {\n this.setAttribute('error-message', this.validationMessage);\n }\n\n // We do not want to show the default validity report tooltip\n // So we are overriding the reportValidity fn to show the input's error message\n reportValidity = () => {\n // we want to update validity so in case the value was set programmatically, we won't get an error\n this.inputElement.setCustomValidity('');\n this.setCustomValidity('');\n if (!this.checkValidity()) {\n this.setAttribute('invalid', 'true');\n this.#handleErrorMessage();\n this.focus();\n }\n };\n\n // we are keeping also the default reportValidity because there are some components that still using it\n defaultReportValidity() {\n return super.reportValidity();\n }\n\n init() {\n super.init?.();\n\n // vaadin sets invalid indication on blur\n // we want invalid indication to appear only when calling reportValidity\n // this is why we are overriding vaadin's setInvalid behavior\n // to update only when the element is valid (so invalid indication will only be removed)\n // and we are adding it in reportValidity\n // eslint-disable-next-line func-names\n this.baseElement._setInvalid = function (invalid) {\n if (!invalid && this._shouldSetInvalid(invalid)) {\n this.invalid = invalid;\n }\n };\n\n // We want to ensure that `input` events properly cross ShadowDOM boundries\n // e.g. When we autofill a component's input with 1Password, for instance,\n // the event is fired without `composed: true` and doesn't our component's\n // ShadowDOM.\n this.baseElement.addEventListener('input', (e) => {\n if (!e.composed) {\n this.dispatchEvent(new Event('input', { bubbles: true, composed: true }));\n }\n });\n\n triggerValidationEvents.forEach((e) => {\n this.baseElement?.addEventListener(e, () => {\n this.inputElement?.setCustomValidity('');\n });\n });\n\n // on some cases the base element is not ready so the inputElement is empty\n // we are deferring this section to make sure the base element is ready\n setTimeout(() => {\n const validationEvents = Array.isArray(inputEvent) ? inputEvent : [inputEvent];\n\n validationEvents.forEach((e) => {\n this.baseElement?.addEventListener(e, () => {\n if (!this.baseElement.checkValidity()) {\n this.#handleErrorMessage();\n } else {\n this.removeAttribute('invalid');\n }\n });\n });\n\n this.baseElement.addEventListener('change', () => {\n this.#dispatchChange();\n });\n\n this.addEventListener('invalid', () => {\n if (!this.checkValidity()) {\n this.setAttribute('invalid', 'true');\n }\n this.#handleErrorMessage();\n });\n\n // sync properties\n proxyProps.forEach((prop) => {\n const externalInput = this.querySelector('input[slot=\"external-input\"]') || null;\n const proxyTargets = useProxyTargets\n ? [this.baseElement, externalInput].filter(Boolean)\n : [];\n forwardProps(this, [this.inputElement, ...proxyTargets], prop);\n });\n\n this.setSelectionRange = this.inputElement?.setSelectionRange?.bind(this.inputElement);\n\n forwardAttrs(this, this.inputElement, { includeAttrs: ['inputmode'] });\n });\n\n if (proxyParentValidation) {\n // All functions called on the inputElement internals will be applied to the parent\n // component internals as well. As a result, there's no need to add outer mechanisms\n // to update the parent component's validity state based on the input elements validity.\n const inputElementInternals = this.inputElement.internals;\n const parentThis = this;\n this.inputElement.internals = new Proxy(inputElementInternals, {\n get: (target, prop) => {\n if (typeof target[prop] === 'function' && prop === 'setValidity') {\n return (...args) => {\n // If we're calling setValidity with 3 args, then the validationTarget\n // needs to be swapped to be the inputElement\n if (args.length === 3) {\n const newArgs = args.slice(0, args.length - 1);\n newArgs.push(parentThis.inputElement);\n parentThis.internals[prop](...newArgs);\n } else {\n parentThis.internals[prop](...args);\n }\n return target[prop](...args);\n };\n }\n\n if (typeof target[prop] === 'function') {\n return (...args) => {\n parentThis.internals[prop](...args);\n return target[prop](...args);\n };\n }\n\n return target[prop];\n },\n });\n }\n }\n };\n\nconst composedProxyInputMixin = (proxyInputMixinConfig) =>\n compose(\n proxyInputMixin(proxyInputMixinConfig),\n // in order to use input-wrapper across all our input components, we need to inject its theme\n // to every proxy input mixin, to allow its css vars to be scoped properly and accessible\n // in the proxy input component\n createStyleMixin({ componentNameOverride: getComponentName('input-wrapper') })\n );\n\nexport { composedProxyInputMixin as proxyInputMixin };\n"],"names":["createBaseClass","componentName","baseSelector","DescopeBaseClass","HTMLElement","baseElement","this","rootElement","querySelector","console","warn","localName","shadowRoot","name","getAttribute","connectedCallback","super","isConnected","init","createDispatchEvent","eventName","options","event","Event","dispatchEvent","changeMixin","superclass","bind","prevValue","value","addEventListener","e","stopPropagation","componentNameValidationMixin","currentComponentName","Error","componentsContextMixin","updateComponentsContext","componentsContext","CustomEvent","bubbles","composed","detail","createProxy","wrappedEleName","slots","style","excludeAttrsSync","includeAttrsSync","includeForwardProps","delegatesFocus","ProxyClass","constructor","attachShadow","mode","innerHTML","map","slot","join","_","excludeAttrs","includeAttrs","createCssVar","varName","fallback","StyleBuilder","styleMap","Map","add","selector","property","has","set","get","toString","Array","from","entries","reduce","acc","propValArr","getFallbackVarName","origVarName","suffix","createStyle","mappings","createFallbackVar","fallbackVarName","Object","keys","forEach","attr","attrConfig","config","defaultMapping","length","isArray","entry","normalizeConfig","cssVarName","relativeSelectorOrSelectorFn","important","fallbackValue","test","createCssSelector","getFallbackVarsNames","fallbackAttrName","createCssVarsList","assign","createClassSelectorSpecifier","className","numOfRepeats","fill","createStyleMixin","componentNameOverride","CustomStyleMixinClass","cssVarList","getRootElement","componentNameSuffix","themeSection","key","componentsThemeManager","currentTheme","replaceSync","prepend","onCurrentThemeChange","classSpecifier","attrName","cssRules","replace","RegExp","setProperty","removeProperty","removeAttribute","attrs","includes","classList","host","disconnectedCallback","draggableMixin","isDraggable","hasAttribute","prevTabIndex","setAttribute","onComplete","target","removeEventListener","once","createExternalInputSlot","slotName","targetSlotName","slotEle","document","createElement","createExternalInputEle","type","autocompleteType","inputName","inputEle","applyExternalInputStyles","sourceInputEle","targetInputEle","labelType","setTimeout","computedStyle","getComputedStyle","height","getPropertyValue","paddingLeft","paddingRight","fontSize","fontFamily","letterSpacing","caretColor","valueColor","ele","origVal","getValueColor","val","marginBottom","width","externalInputMixin","inputType","noBlurDispatch","isExternalInput","createExternalInput","isReadOnly","isDisabled","origInput","externalInputSlot","appendChild","externalInput","getAutocompleteType","forwardInputValue","stopImmediatePropagation","handleFocusEvents","handleBlurEvents","handlelInputEvents","clearBlurTimers","timer","clearTimeout","dispatchBlur","focus","push","source","valueDescriptor","getOwnPropertyDescriptor","inputElement","prototype","defineProperty","v","call","configurable","hoverableMixin","inputEventsDispatchingMixin","isTrusted","handleFocusEventsDispatching","inputs","timerId","input","onFocus","handleInputEventDispatching","previousRootComponentValue","observedAttributes","errorAttributes","validationTargetSymbol","Symbol","inputValidationMixin","formAssociated","internals","attachInternals","defaultErrorMsgValueMissing","defaultErrorMsgPatternMismatch","defaultErrorMsgTooShort","defaultErrorMsgTooLong","defaultErrorMsgRangeUnderflow","defaultErrorMsgRangeOverflow","defaultErrorMsgTypeMismatch","getErrorMessage","flags","valueMissing","patternMismatch","typeMismatch","stepMismatch","tooShort","tooLong","rangeOverflow","rangeUnderflow","badInput","customError","validationMessage","validity","getValidity","setValidity","validationTarget","checkValidity","valid","reportValidity","setCustomValidity","errorMessage","isRequired","pattern","form","attributeChangedCallback","oldValue","newValue","booleanAttributesList","normalizeBooleanAttributesMixin","attrVal","isBooleanAttribute","debug","withWaitForShadowRoot","getRootElementFn","async","that","Promise","res","counter","check","error","portalMixin","forward","attributes","include","eleDisplayName","sanitizeSelector","BaseClass","getPortalElement","baseEle","then","portalEle","onmouseenter","onmouseleave","errorAttrs","getNestedInput","nonSlotEle","i","assignedElements","proxyInputMixin","proxyProps","useProxyTargets","inputEvent","triggerValidationEvents","proxyParentValidation","warnIfInputElementIsMissing","inputElementTimerId","inputSlot","textAreaSlot","defaultReportValidity","_setInvalid","invalid","_shouldSetInvalid","prop","proxyTargets","filter","Boolean","src","targets","targetArr","forwardProps","setSelectionRange","inputElementInternals","parentThis","Proxy","args","newArgs","slice","composedProxyInputMixin","proxyInputMixinConfig"],"sourceRoot":""}
|
1
|
+
{"version":3,"file":"9365.js","mappings":"oNAMO,MAAMA,EAAkB,EAAGC,gBAAeC,eAAe,OAC9D,MAAMC,UAAyBC,YAC7B,wBAAWH,GACT,O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AAeb,EACjB,CAACxS,KAAKD,YAAa0L,GAAe6H,OAAOC,SACzC,GAjLK,EAACC,EAAKC,EAASzP,KAClC,MAAM0P,EAAYrP,MAAMqB,QAAQ+N,GAAWA,EAAU,CAACA,GAEtDvO,OAAOyH,eAAe6G,EAAKxP,EAAU,CACnC,GAAAE,CAAI0I,GACF8G,EAAUtO,SAASuD,IACjBA,EAAO3E,GAAY4I,CAAC,GAExB,EACAzI,IAAG,IACMsP,EAAQ,GAAGzP,GAEpB8I,cAAc,GACd,EAqKQ6G,CAAa3T,KAAM,CAACA,KAAKyM,gBAAiB4G,GAAeD,EAAK,IAGhEpT,KAAK4T,kBAAoB5T,KAAKyM,cAAcmH,mBAAmBvS,KAAKrB,KAAKyM,eAEzE,QAAazM,KAAMA,KAAKyM,aAAc,CAAElJ,aAAc,CAAC,cAAe,IAGpEoP,EAAuB,CAIzB,MAAMkB,EAAwB7T,KAAKyM,aAAawB,UAC1C6F,EAAa9T,KACnBA,KAAKyM,aAAawB,UAAY,IAAI8F,MAAMF,EAAuB,CAC7D1P,IAAK,CAACwE,EAAQyK,IACgB,mBAAjBzK,EAAOyK,IAAiC,gBAATA,EACjC,IAAIY,KAGT,GAAoB,IAAhBA,EAAKvO,OAAc,CACrB,MAAMwO,EAAUD,EAAKE,MAAM,EAAGF,EAAKvO,OAAS,GAC5CwO,EAAQ5H,KAAKyH,EAAWrH,cACxBqH,EAAW7F,UAAUmF,MAASa,EAChC,MACEH,EAAW7F,UAAUmF,MAASY,GAEhC,OAAOrL,EAAOyK,MAASY,EAAK,EAIJ,mBAAjBrL,EAAOyK,GACT,IAAIY,KACTF,EAAW7F,UAAUmF,MAASY,GACvBrL,EAAOyK,MAASY,IAIpBrL,EAAOyK,IAGpB,CACF,GAGAe,EAA2BC,IAC/B,QACE9B,EAAgB8B,IAIhB,OAAiB,CAAExN,uBAAuB,QAAiB,mB","sources":["webpack://@descope/web-components-ui/./src/baseClasses/createBaseClass.js","webpack://@descope/web-components-ui/./src/helpers/mixinsHelpers.js","webpack://@descope/web-components-ui/./src/mixins/changeMixin.js","webpack://@descope/web-components-ui/./src/mixins/componentNameValidationMixin.js","webpack://@descope/web-components-ui/./src/mixins/componentsContextMixin.js","webpack://@descope/web-components-ui/./src/mixins/createProxy.js","webpack://@descope/web-components-ui/./src/mixins/createStyleMixin/helpers.js","webpack://@descope/web-components-ui/./src/mixins/createStyleMixin/index.js","webpack://@descope/web-components-ui/./src/mixins/draggableMixin.js","webpack://@descope/web-components-ui/./src/mixins/externalInputHelpers.js","webpack://@descope/web-components-ui/./src/mixins/externalInputMixin.js","webpack://@descope/web-components-ui/./src/mixins/hoverableMixin.js","webpack://@descope/web-components-ui/./src/mixins/inputEventsDispatchingMixin.js","webpack://@descope/web-components-ui/./src/mixins/inputOverrideValidConstraints.js","webpack://@descope/web-components-ui/./src/mixins/inputValidationMixin.js","webpack://@descope/web-components-ui/./src/mixins/normalizeBooleanAttributesMixin.js","webpack://@descope/web-components-ui/./src/mixins/portalMixin.js","webpack://@descope/web-components-ui/./src/mixins/proxyInputMixin.js"],"sourcesContent":["import { compose } from '../helpers';\nimport { componentNameValidationMixin } from '../mixins/componentNameValidationMixin';\nimport { componentsContextMixin } from '../mixins/componentsContextMixin';\nimport { hoverableMixin } from '../mixins/hoverableMixin';\nimport { normalizeBooleanAttributesMixin } from '../mixins/normalizeBooleanAttributesMixin';\n\nexport const createBaseClass = ({ componentName, baseSelector = '' }) => {\n class DescopeBaseClass extends HTMLElement {\n static get componentName() {\n return componentName;\n }\n\n #baseElement;\n\n #isInit = true;\n\n // base selector is the selector for the component wrapper,\n // it's the highest element that is relevant for the layout\n // eslint-disable-next-line class-methods-use-this\n get baseSelector() {\n return baseSelector;\n }\n\n // this is the base element, which returned by querying the base selector\n get baseElement() {\n this.#baseElement ??= this.baseSelector\n ? this.rootElement.querySelector(this.baseSelector)\n : this;\n\n if (!this.#baseElement) {\n // eslint-disable-next-line no-console\n console.warn('missing base element for component', this.localName);\n }\n return this.#baseElement;\n }\n\n // this is the component root level element,\n // it can be either a shadow root or the component's node from the light DOM\n get rootElement() {\n return this.shadowRoot || this;\n }\n\n get name() {\n return this.getAttribute('name');\n }\n\n connectedCallback() {\n super.connectedCallback?.();\n\n if (this.rootElement.isConnected) {\n // the init function is running once, on the first time the component is connected\n if (this.#isInit) {\n this.#isInit = false;\n this.init?.();\n }\n }\n }\n }\n\n return compose(\n componentNameValidationMixin,\n hoverableMixin,\n normalizeBooleanAttributesMixin,\n componentsContextMixin\n )(DescopeBaseClass);\n};\n","// create a dispatch event function that also calls to the onevent function in case it's set\n// usage example:\n// #dispatchSomething = createDispatchEvent.bind(this, 'something' { ...options })\n// this will dispatch a new event when called, but also call to \"onsomething\"\nexport function createDispatchEvent(eventName, options = {}) {\n const event = new Event(eventName, options);\n\n this[`on${eventName}`]?.(event); // in case we got an event callback as property\n this.dispatchEvent(event);\n}\n","import { createDispatchEvent } from '../helpers/mixinsHelpers';\n\nexport const changeMixin = (superclass) =>\n class ChangeMixinClass extends superclass {\n #dispatchChange = createDispatchEvent.bind(this, 'change');\n\n init() {\n super.init?.();\n this.prevValue = this.value;\n\n this.addEventListener('change', (e) => {\n e.stopPropagation();\n });\n\n this.addEventListener('blur', () => {\n if (this.value !== this.prevValue) {\n this.#dispatchChange();\n this.prevValue = this.value;\n }\n });\n }\n };\n","export const componentNameValidationMixin = (superclass) =>\n class ComponentNameValidationMixinClass extends superclass {\n #checkComponentName() {\n const currentComponentName = this.localName;\n\n if (!superclass.componentName) {\n throw Error(\n `component name is not defined on super class, make sure you have a static get for \"componentName\"`\n );\n }\n\n if (currentComponentName !== superclass.componentName) {\n throw Error(\n `component name mismatch, expected \"${superclass.componentName}\", current \"${currentComponentName}\"`\n );\n }\n }\n\n init() {\n super.init?.();\n this.#checkComponentName();\n }\n };\n","export const componentsContextMixin = (superclass) =>\n class ComponentsContextMixinClass extends superclass {\n updateComponentsContext(componentsContext) {\n this.dispatchEvent(\n new CustomEvent('components-context', {\n bubbles: true,\n composed: true,\n detail: componentsContext,\n })\n );\n }\n };\n","import { injectStyle } from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '../baseClasses/createBaseClass';\nimport { isFunction } from '../helpers';\nimport { forwardProps, syncAttrs } from '../helpers/componentHelpers';\nimport { createDispatchEvent } from '../helpers/mixinsHelpers';\n\nexport const createProxy = ({\n componentName,\n wrappedEleName,\n slots = [],\n style,\n excludeAttrsSync = [],\n includeAttrsSync = [],\n includeForwardProps = [],\n delegatesFocus = true,\n}) => {\n class ProxyClass extends createBaseClass({ componentName, baseSelector: wrappedEleName }) {\n #dispatchBlur = createDispatchEvent.bind(this, 'blur');\n\n #dispatchFocus = createDispatchEvent.bind(this, 'focus');\n\n constructor() {\n super().attachShadow({ mode: 'open', delegatesFocus }).innerHTML = `\n\t\t\t<${wrappedEleName}>\n\t\t\t${slots\n .map(\n (\n slot // when slot is an empty string, we will create the default slot (without a name)\n ) => `<slot ${slot ? `name=\"${slot}\" slot=\"${slot}\"` : ''}></slot>`\n )\n .join('')}\n\t\t\t</${wrappedEleName}>\n\t\t`;\n\n injectStyle((isFunction(style) ? style() : style) || '', this);\n }\n\n init() {\n super.init?.();\n\n this.baseElement.addEventListener('blur', (_) => {\n this.#dispatchBlur();\n });\n\n this.baseElement.addEventListener('focus', (_) => {\n this.#dispatchFocus();\n });\n\n // this is needed for components that uses props, such as combo box\n forwardProps(this.baseElement, this, includeForwardProps);\n\n syncAttrs(this.baseElement, this, {\n excludeAttrs: excludeAttrsSync,\n includeAttrs: includeAttrsSync,\n });\n }\n }\n\n return ProxyClass;\n};\n","import { camelCaseJoin, isFunction, kebabCase, kebabCaseJoin } from '../../helpers';\nimport { getCssVarName } from '../../helpers/componentHelpers';\n\nconst createCssVar = (varName, fallback) => `var(${varName}${fallback ? `, ${fallback}` : ''})`;\n\nconst createCssSelector = (baseSelector = '', relativeSelectorOrSelectorFn = '') =>\n isFunction(relativeSelectorOrSelectorFn)\n ? relativeSelectorOrSelectorFn(baseSelector)\n : `${baseSelector}${\n /^[A-Za-z]/.test(relativeSelectorOrSelectorFn)\n ? ` ${relativeSelectorOrSelectorFn}`\n : relativeSelectorOrSelectorFn\n }`;\n\nclass StyleBuilder {\n constructor() {\n this.styleMap = new Map();\n }\n\n add(selector, property, value) {\n if (!this.styleMap.has(selector)) {\n this.styleMap.set(selector, []);\n }\n\n this.styleMap.set(selector, [...this.styleMap.get(selector), { property, value }]);\n }\n\n toString() {\n return Array.from(this.styleMap.entries()).reduce((acc, [selector, propValArr]) => {\n const properties = propValArr\n .map(({ property, value }) => `${property}: ${value}`)\n .join(';\\n');\n\n return `${acc}${selector} { \\n${properties} \\n}\\n\\n`;\n }, '');\n }\n}\n\nconst normalizeConfig = (attr, config) => {\n const defaultMapping = { selector: '', property: kebabCase(attr) };\n\n if (!config || !Object.keys(config).length) return [defaultMapping];\n\n if (Array.isArray(config)) return config.map((entry) => ({ ...defaultMapping, ...entry }));\n\n return [{ ...defaultMapping, ...config }];\n};\n\nconst getFallbackVarName = (origVarName, suffix = 'fallback') => kebabCaseJoin(origVarName, suffix);\n\nexport const createStyle = (componentName, baseSelector, mappings) => {\n const style = new StyleBuilder();\n const createFallbackVar = (fallback, origVarName) => {\n if (!fallback) return '';\n if (typeof fallback === 'string') return fallback;\n\n const fallbackVarName = getFallbackVarName(origVarName, fallback?.suffix);\n return createCssVar(fallbackVarName, createFallbackVar(fallback.fallback, fallbackVarName));\n };\n\n Object.keys(mappings).forEach((attr) => {\n const attrConfig = normalizeConfig(attr, mappings[attr]);\n\n const cssVarName = getCssVarName(componentName, attr);\n\n attrConfig.forEach(\n ({ selector: relativeSelectorOrSelectorFn, property, important, fallback }) => {\n const fallbackValue = createFallbackVar(fallback, cssVarName);\n style.add(\n createCssSelector(baseSelector, relativeSelectorOrSelectorFn),\n isFunction(property) ? property() : property,\n createCssVar(cssVarName, fallbackValue) + (important ? '!important' : '')\n );\n }\n );\n });\n\n return style.toString();\n};\n\nconst getFallbackVarsNames = (attr, origVarName, { fallback }) => {\n if (!fallback) return {};\n\n const fallbackVarName = getFallbackVarName(origVarName, fallback.suffix);\n const fallbackAttrName = camelCaseJoin(attr, fallback.suffix || 'fallback');\n return {\n [fallbackAttrName]: fallbackVarName,\n ...getFallbackVarsNames(fallbackAttrName, fallbackVarName, fallback),\n };\n};\n\nexport const createCssVarsList = (componentName, mappings) =>\n Object.keys(mappings).reduce((acc, attr) => {\n const varName = getCssVarName(componentName, attr);\n\n return Object.assign(\n acc,\n { [attr]: varName },\n getFallbackVarsNames(attr, varName, mappings[attr])\n );\n }, {});\n\n// on some cases we need a selector to be more specific than another\n// for this we have this fn that generate a class selector multiple times\nexport const createClassSelectorSpecifier = (className, numOfRepeats) =>\n Array(numOfRepeats).fill(`.${className}`).join('');\n","import { injectStyle } from '@descope-ui/common/components-helpers';\nimport { BASE_THEME_SECTION, CSS_SELECTOR_SPECIFIER_MULTIPLY } from '../../constants';\nimport { kebabCaseJoin } from '../../helpers';\nimport { getCssVarName, observeAttributes } from '../../helpers/componentHelpers';\nimport { componentsThemeManager } from '../../helpers/themeHelpers';\nimport { createStyle, createCssVarsList, createClassSelectorSpecifier } from './helpers';\n\nconst STYLE_OVERRIDE_ATTR_PREFIX = 'st';\n\nexport const createStyleMixin =\n ({ mappings = {}, componentNameOverride = '' }) =>\n (superclass) => {\n const componentName = componentNameOverride || superclass.componentName;\n\n return class CustomStyleMixinClass extends superclass {\n static get cssVarList() {\n return {\n ...superclass.cssVarList,\n ...createCssVarsList(componentName, {\n ...mappings,\n }),\n };\n }\n\n #overrideStyleEle;\n\n #themeStyleEle;\n\n #disconnectThemeManager;\n\n #componentNameSuffix;\n\n #themeSection;\n\n #rootElement;\n\n #baseSelector;\n\n #styleAttributes;\n\n #getRootElement;\n\n // we are using this mixin also for portalMixin\n // so we should be able to inject styles to other DOM elements\n // this is why we need to support these overrides\n constructor({\n getRootElement,\n componentNameSuffix = '',\n themeSection = BASE_THEME_SECTION,\n baseSelector,\n } = {}) {\n super();\n this.#componentNameSuffix = componentNameSuffix;\n this.#themeSection = themeSection;\n this.#baseSelector = baseSelector ?? this.baseSelector;\n this.#getRootElement = getRootElement;\n\n this.#styleAttributes = Object.keys(CustomStyleMixinClass.cssVarList).map((key) =>\n kebabCaseJoin(STYLE_OVERRIDE_ATTR_PREFIX, componentNameSuffix, key)\n );\n }\n\n // eslint-disable-next-line class-methods-use-this\n get #componentTheme() {\n return componentsThemeManager.currentTheme?.[componentName] || '';\n }\n\n #onComponentThemeChange() {\n this.#themeStyleEle.replaceSync(this.#componentTheme[this.#themeSection]);\n }\n\n #createComponentTheme() {\n this.#themeStyleEle = injectStyle('', this.#rootElement, { prepend: true });\n this.#disconnectThemeManager = componentsThemeManager.onCurrentThemeChange(\n this.#onComponentThemeChange.bind(this)\n );\n this.#onComponentThemeChange();\n }\n\n #createOverridesStyle() {\n if (this.#styleAttributes.length) {\n const classSpecifier = createClassSelectorSpecifier(\n componentName,\n CSS_SELECTOR_SPECIFIER_MULTIPLY\n );\n\n this.#overrideStyleEle = injectStyle(`:host(${classSpecifier}) {}`, this.#rootElement);\n }\n }\n\n #setAttrOverride(attrName, value) {\n const style = this.#overrideStyleEle?.cssRules[0].style;\n\n if (!style) return;\n\n const varName = getCssVarName(\n componentName,\n attrName.replace(new RegExp(`^${STYLE_OVERRIDE_ATTR_PREFIX}-`), '')\n );\n\n if (value) style?.setProperty(varName, value);\n else {\n style?.removeProperty(varName);\n this.removeAttribute(attrName);\n }\n }\n\n #updateOverridesStyle(attrs = []) {\n attrs.forEach((attr) => {\n if (this.#styleAttributes.includes(attr)) {\n this.#setAttrOverride(attr, this.getAttribute(attr));\n }\n });\n }\n\n #createMappingStyle() {\n if (Object.keys(mappings).length) {\n const style = createStyle(\n kebabCaseJoin(componentName, this.#componentNameSuffix),\n this.#baseSelector,\n mappings\n );\n\n injectStyle(style, this.#rootElement, { prepend: true });\n }\n }\n\n #addClassName(className) {\n (this.#rootElement.classList || this.#rootElement.host.classList).add(className);\n }\n\n async init() {\n super.init?.();\n if (this.shadowRoot.isConnected) {\n this.#rootElement = (await this.#getRootElement?.(this)) || this.shadowRoot;\n\n this.#addClassName(componentName);\n\n this.#createMappingStyle();\n this.#createComponentTheme();\n this.#createOverridesStyle();\n\n // this is instead attributeChangedCallback because we cannot use static methods in this case\n observeAttributes(this, this.#updateOverridesStyle.bind(this), {});\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback?.();\n\n this.#disconnectThemeManager?.();\n }\n };\n };\n","import { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const draggableMixin = (superclass) =>\n class DraggableMixinClass extends superclass {\n constructor() {\n super();\n\n injectStyle(`:host([draggable=\"true\"]) * { cursor: inherit!important }`, this);\n }\n\n get isDraggable() {\n return this.hasAttribute('draggable') && this.getAttribute('draggable') !== 'false';\n }\n\n init() {\n // because we are delegating the focus from the outer component,\n // the D&D is not working well in the page editor\n // in order to solve it we are making the inner component focusable on mouse down\n // and removing it on complete\n this.addEventListener('mousedown', (e) => {\n if (this.isDraggable) {\n const prevTabIndex = this.baseElement.getAttribute('tabindex');\n this.baseElement.setAttribute('tabindex', '-1');\n\n const onComplete = () => {\n prevTabIndex\n ? this.baseElement.setAttribute('tabindex', prevTabIndex)\n : this.baseElement.removeAttribute('tabindex');\n\n e.target.removeEventListener('mouseup', onComplete);\n e.target.removeEventListener('dragend', onComplete);\n };\n\n e.target.addEventListener('mouseup', onComplete, { once: true });\n e.target.addEventListener('dragend', onComplete, { once: true });\n }\n });\n\n super.init?.();\n }\n };\n","// since on load we can only sample the color of the placeholder,\n// we need to temporarily populate the input in order to sample the value color\nconst getValueColor = (ele, computedStyle) => {\n // to support setting dynamic values, we have to store the existing value\n // and re-set it if we are returning from this hack\n const origVal = ele.value;\n\n // eslint-disable-next-line no-param-reassign\n ele.value = '_';\n\n const valueColor = computedStyle.getPropertyValue('color');\n\n if (ele.value === '_') {\n // eslint-disable-next-line no-param-reassign\n ele.value = origVal;\n }\n\n return valueColor;\n};\n\nexport const createExternalInputSlot = (slotName, targetSlotName) => {\n const slotEle = document.createElement('slot');\n\n slotEle.setAttribute('name', slotName);\n slotEle.setAttribute('slot', targetSlotName);\n\n return slotEle;\n};\n\nexport const createExternalInputEle = (targetSlotName, type, autocompleteType, inputName) => {\n const inputEle = document.createElement('input');\n\n inputEle.setAttribute('slot', targetSlotName);\n inputEle.setAttribute('type', type);\n inputEle.setAttribute('name', inputName);\n inputEle.setAttribute('data-hidden-input', 'true');\n inputEle.setAttribute('autocomplete', autocompleteType);\n\n return inputEle;\n};\n\n// We apply the original input's style to the external-input.\n// Eventually, the user should interact directly with the external input.\n// We keep the original input\nexport const applyExternalInputStyles = (sourceInputEle, targetInputEle, labelType) => {\n // We set a timeout here to avoid \"Double Print\" cases,\n // caused by sampling the computed style before it's ready.\n setTimeout(() => {\n const computedStyle = getComputedStyle(sourceInputEle);\n // Get minimal set of computed theme properties to set on external input\n const height = computedStyle.getPropertyValue('height');\n const paddingLeft = computedStyle.getPropertyValue('padding-left');\n const paddingRight = computedStyle.getPropertyValue('padding-right');\n const fontSize = computedStyle.getPropertyValue('font-size');\n const fontFamily = computedStyle.getPropertyValue('font-family');\n const letterSpacing = computedStyle.getPropertyValue('letter-spacing');\n const caretColor = computedStyle.getPropertyValue('caret-color');\n\n const valueColor = getValueColor(sourceInputEle, computedStyle);\n\n const commonThemeStyles = [\n ['all', 'unset'],\n ['position', 'absolute'],\n ['background-color', 'transparent'],\n ['height', height],\n ['left', paddingLeft],\n ['right', paddingRight],\n ['font-size', fontSize],\n ['font-family', fontFamily],\n ['letter-spacing', letterSpacing],\n ['caret-color', caretColor], // this is for seeing caret when focusing on external input\n ['color', valueColor],\n ];\n\n commonThemeStyles.forEach(([key, val]) =>\n targetInputEle.style.setProperty(key, val, 'important')\n );\n\n // Handle floating label theme properties\n if (labelType === 'floating') {\n const marginBottom = computedStyle.getPropertyValue('margin-bottom');\n targetInputEle.style.setProperty('margin-bottom', marginBottom, 'important');\n }\n\n // sample and apply width only after original input is ready and fully rendered\n const width = computedStyle.getPropertyValue('width');\n targetInputEle.style.setProperty(\n 'width',\n `calc(${width} - ${paddingLeft} - ${paddingRight}`,\n 'important'\n );\n }, 0);\n};\n","import { syncAttrs } from '../helpers/componentHelpers';\nimport {\n applyExternalInputStyles,\n createExternalInputEle,\n createExternalInputSlot,\n} from './externalInputHelpers';\n\nexport const externalInputMixin =\n ({ inputType, inputName, autocompleteType, includeAttrs = [], noBlurDispatch = false }) =>\n (superclass) =>\n class ExternalInputMixinClass extends superclass {\n #timers = [];\n\n get isExternalInput() {\n return this.getAttribute('external-input') === 'true';\n }\n\n createExternalInput() {\n if (!this.isExternalInput || this.isReadOnly || this.isDisabled) {\n return null;\n }\n\n // use original input element as reference\n const origInput = this.baseElement.querySelector('input');\n\n if (!origInput) {\n return null;\n }\n\n // to avoid focus loop between external-input and origInput\n // we set origInput's tabindex to -1\n // otherwise, shift-tab will never leave the component focus\n origInput.setAttribute('tabindex', '-1');\n\n // create external slot\n const externalInputSlot = createExternalInputSlot('external-input', 'suffix');\n\n // append external slot to base element\n this.baseElement.appendChild(externalInputSlot);\n\n this.externalInput = createExternalInputEle(\n 'external-input',\n inputType,\n this.getAutocompleteType(),\n inputName\n );\n\n // apply original input's styles to external input\n setTimeout(() => {\n applyExternalInputStyles(origInput, this.externalInput, this.getAttribute('label-type'));\n });\n\n // 1Password catches the internal input, so we forward the value to the external input\n this.forwardInputValue(origInput, this.externalInput);\n\n syncAttrs(origInput, this.externalInput, {\n includeAttrs,\n });\n\n // We disable Vaadin's original `_setFocused` function, and use handleFocusEvents\n // and handleBlurEvents functions\n this.baseElement\n .querySelector('input')\n .addEventListener('focusout', (e) => e.stopImmediatePropagation(), true);\n\n // In order to manage focus/blur events when moving between parts of the component\n // we're managing the event dispatching by ourselves, with the following strategy:\n // - If one of the component parts is focused - it means that the component is still focused - so we stop the blur events.\n // - When none of the component parts is focused, we dispatch blur event.\n this.handleFocusEvents();\n this.handleBlurEvents();\n\n // sync input value\n this.handlelInputEvents(this.externalInput);\n\n // append external input to component's DOM\n this.appendChild(this.externalInput);\n\n return this.externalInput;\n }\n\n clearBlurTimers() {\n this.#timers.forEach((timer) => clearTimeout(timer));\n this.#timers.length = 0;\n }\n\n dispatchBlur() {\n return setTimeout(() => {\n this.dispatchEvent(new Event('blur', { bubbles: true, composed: true }));\n this.removeAttribute('focused');\n });\n }\n\n handleFocusEvents() {\n // on baseElement `focus` we forward the focus to the external input.\n // also, in order to avoid any blur within the component, we clear the blur timers.\n this.baseElement.addEventListener('focus', () => {\n this.externalInput.focus();\n this.clearBlurTimers();\n });\n\n // on `focus` of the external input, we manually set the `focused` attribute\n this.externalInput.addEventListener('focus', () => {\n this.clearBlurTimers();\n setTimeout(() => this.baseElement.setAttribute('focused', 'true'));\n });\n }\n\n handleBlurEvents() {\n this.baseElement.addEventListener(\n 'blur',\n (e) => {\n e.stopImmediatePropagation();\n // some components do not require this synthetic blur dispatch (e.g. Password)\n // so we allow them to override this dispatch\n if (noBlurDispatch) return;\n this.#timers.push(this.dispatchBlur());\n },\n true\n );\n\n this.externalInput.addEventListener(\n 'blur',\n (e) => {\n e.stopImmediatePropagation();\n this.#timers.push(this.dispatchBlur());\n },\n true\n );\n }\n\n handlelInputEvents(externalInput) {\n // sync value of insible input back to original input\n externalInput.addEventListener('input', (e) => {\n this.value = e.target.value;\n });\n\n // handle has-value attr\n externalInput.addEventListener('input', (e) => {\n if (!e.target.value) {\n this.removeAttribute('has-value');\n } else {\n this.setAttribute('has-value', 'true');\n }\n });\n }\n\n getAutocompleteType() {\n return this.getAttribute('autocomplete') || autocompleteType;\n }\n\n forwardInputValue(source, target) {\n // set internal sync events\n const valueDescriptor = Object.getOwnPropertyDescriptor(\n this.inputElement.constructor.prototype,\n 'value'\n );\n\n Object.defineProperty(source, 'value', {\n ...valueDescriptor,\n\n set(v) {\n valueDescriptor.set.call(this, v);\n // eslint-disable-next-line no-param-reassign\n target.value = v;\n },\n configurable: true,\n });\n }\n };\n","export const hoverableMixin = (superclass) =>\n class HoverableMixinClass extends superclass {\n init() {\n super.init?.();\n\n this.baseElement.addEventListener('mouseover', (e) => {\n this.setAttribute('hover', 'true');\n e.target.addEventListener('mouseleave', () => this.removeAttribute('hover'), {\n once: true,\n });\n });\n }\n };\n","import { createDispatchEvent } from '../helpers/mixinsHelpers';\n\nexport const inputEventsDispatchingMixin = (superclass) =>\n class InputEventsDispatchingMixinClass extends superclass {\n init() {\n this.#blockNativeEvents();\n\n super.init?.();\n }\n\n // we want to block the native (trusted) events and control when these events are being dispatched\n #blockNativeEvents() {\n ['blur', 'focus', 'focusin', 'focusout'].forEach((event) => {\n this.addEventListener(event, (e) => {\n e.isTrusted && e.target === this && e.stopImmediatePropagation();\n });\n });\n }\n\n handleFocusEventsDispatching(inputs) {\n let timerId;\n\n // in order to simulate blur & focusout on root input element\n // we are checking if focus on one of the inner elements happened immediately after blur\n // if not, the component is no longer focused and we should dispatch blur & focusout\n inputs?.forEach((input) => {\n input?.addEventListener('focusout', (e) => {\n e.stopImmediatePropagation();\n timerId = setTimeout(() => {\n timerId = null;\n\n createDispatchEvent.call(this, 'blur');\n createDispatchEvent.call(this, 'focusout', { bubbles: true });\n });\n });\n\n // in order to simulate focus & focusin on the root input element\n // we are holding a timer id and clearing it on focusin\n // if there is a timer id, it means that the root input is still focused\n // otherwise, it was not focused before, and we should dispatch focus & focusin\n const onFocus = (e) => {\n e.stopImmediatePropagation();\n clearTimeout(timerId);\n if (!timerId) {\n createDispatchEvent.call(this, 'focus');\n createDispatchEvent.call(this, 'focusin', { bubbles: true });\n }\n };\n\n // some components are not dispatching focusin but only focus\n input?.addEventListener('focusin', onFocus);\n input?.addEventListener('focus', onFocus);\n });\n }\n\n // we want to block the input events from propagating in case the value of the root input wasn't change\n // this can happen if we are sanitizing characters on the internal inputs and do not want it to affect the root input element value\n // in this case, on each input event, we are comparing the root input value to the previous one, and only if it does not match, we are allowing the input event to propagate\n handleInputEventDispatching() {\n let previousRootComponentValue = this.value;\n\n // we are comparing the previous value to the new one,\n // and if they have the same value, we are blocking the input event\n this.addEventListener('input', (e) => {\n // We don't want to block our own event that we fire from handleInputEventDispatching\n if (this !== e.target) {\n e.stopImmediatePropagation();\n\n if (previousRootComponentValue !== this.value) {\n previousRootComponentValue = this.value;\n createDispatchEvent.call(this, 'input', { bubbles: true, composed: true });\n }\n }\n });\n }\n };\n","export const inputOverrideValidConstraintsMixin = (superclass) =>\n class InputOverrideValidConstraintsMixinClass extends superclass {\n init() {\n super.init?.();\n\n // vaadin uses `validConstraints` (required, pattern, minlength, maxlength) to determine if it should validate\n // the input or not. We want to override this behavior, so we can enforce validation even if these attributes are not present.\n if (this.baseElement._hasValidConstraints) {\n this.baseElement._hasValidConstraints = () => true;\n }\n }\n };\n","import 'element-internals-polyfill'; // this is needed in order to support older browsers\n\nconst observedAttributes = ['required', 'pattern'];\n\nconst errorAttributes = {\n valueMissing: 'data-errormessage-value-missing',\n patternMismatch: 'data-errormessage-pattern-mismatch',\n tooShort: 'data-errormessage-pattern-mismatch-too-short',\n tooLong: 'data-errormessage-pattern-mismatch-too-long',\n rangeUnderflow: 'data-errormessage-pattern-range-underflow',\n rangeOverflow: 'data-errormessage-pattern-range-overflow',\n typeMismatch: 'data-errormessage-type-mismatch',\n};\n\nconst validationTargetSymbol = Symbol('validationTarget');\n\nexport const inputValidationMixin = (superclass) =>\n class InputValidationMixinClass extends superclass {\n #validationTarget = validationTargetSymbol;\n\n static get observedAttributes() {\n return [...(superclass.observedAttributes || []), ...observedAttributes];\n }\n\n static get formAssociated() {\n return true;\n }\n\n #internals;\n\n get internals() {\n return this.#internals;\n }\n\n set internals(value) {\n this.#internals = value;\n }\n\n constructor() {\n super();\n\n this.#internals = this.attachInternals();\n }\n\n // eslint-disable-next-line class-methods-use-this\n get defaultErrorMsgValueMissing() {\n return 'Please fill out this field.';\n }\n\n // eslint-disable-next-line class-methods-use-this\n get defaultErrorMsgPatternMismatch() {\n return 'Please match the requested format.';\n }\n\n get defaultErrorMsgTooShort() {\n return `Minimum length is ${this.getAttribute('minlength')}.`;\n }\n\n get defaultErrorMsgTooLong() {\n return `Maximum length is ${this.getAttribute('maxlength')}. `;\n }\n\n get defaultErrorMsgRangeUnderflow() {\n return `At least ${this.getAttribute('min-items-selection')} items are required.`;\n }\n\n get defaultErrorMsgRangeOverflow() {\n return `At most ${this.getAttribute('max-items-selection')} items are allowed.`;\n }\n\n // eslint-disable-next-line class-methods-use-this\n get defaultErrorMsgTypeMismatch() {\n return `Please match the requested type.`;\n }\n\n getErrorMessage(flags) {\n const {\n valueMissing,\n patternMismatch,\n typeMismatch,\n stepMismatch,\n tooShort,\n tooLong,\n rangeOverflow,\n rangeUnderflow,\n badInput,\n customError,\n } = flags;\n\n switch (true) {\n case valueMissing:\n return (\n this.getAttribute(errorAttributes.valueMissing) || this.defaultErrorMsgValueMissing\n );\n case patternMismatch || stepMismatch || badInput:\n return (\n this.getAttribute(errorAttributes.patternMismatch) ||\n this.defaultErrorMsgPatternMismatch\n );\n case typeMismatch:\n return (\n this.getAttribute(errorAttributes.typeMismatch) ||\n this.getAttribute(errorAttributes.patternMismatch) ||\n this.defaultErrorMsgTypeMismatch\n );\n case tooShort:\n return this.getAttribute(errorAttributes.tooShort) || this.defaultErrorMsgTooShort;\n case tooLong:\n return this.getAttribute(errorAttributes.tooLong) || this.defaultErrorMsgTooLong;\n case rangeUnderflow:\n return (\n this.getAttribute(errorAttributes.rangeUnderflow) || this.defaultErrorMsgRangeUnderflow\n );\n case rangeOverflow:\n return (\n this.getAttribute(errorAttributes.rangeOverflow) || this.defaultErrorMsgRangeOverflow\n );\n case customError:\n return this.validationMessage;\n default:\n return '';\n }\n }\n\n #setValidity() {\n const validity = this.isReadOnly ? {} : this.getValidity();\n this.#internals.setValidity(validity, this.getErrorMessage(validity), this.validationTarget);\n }\n\n get validationMessage() {\n return this.#internals.validationMessage;\n }\n\n // eslint-disable-next-line class-methods-use-this\n getValidity() {\n // eslint-disable-next-line no-console\n console.warn('getValidity', 'is not implemented');\n }\n\n checkValidity() {\n return this.#internals.validity.valid;\n }\n\n reportValidity() {\n return this.#internals.reportValidity();\n }\n\n get validity() {\n return this.#internals.validity;\n }\n\n get validationTarget() {\n return this.#validationTarget === validationTargetSymbol\n ? this.inputElement\n : this.#validationTarget;\n }\n\n set validationTarget(val) {\n this.#validationTarget = val;\n }\n\n setCustomValidity(errorMessage) {\n if (errorMessage) {\n this.#internals.setValidity({ customError: true }, errorMessage, this.validationTarget);\n } else {\n this.#internals.setValidity({});\n this.#setValidity();\n }\n }\n\n get isRequired() {\n return this.hasAttribute('required') && this.getAttribute('required') !== 'false';\n }\n\n get isReadOnly() {\n return this.hasAttribute('readonly') && this.getAttribute('readonly') !== 'false';\n }\n\n get isDisabled() {\n return this.hasAttribute('disabled') && this.getAttribute('disabled') !== 'false';\n }\n\n get pattern() {\n return this.getAttribute('pattern');\n }\n\n get form() {\n return this.#internals.form;\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (observedAttributes.includes(attrName)) {\n this.#setValidity();\n }\n }\n\n init() {\n super.init?.();\n this.addEventListener('change', this.#setValidity);\n this.addEventListener('invalid', (e) => e.stopPropagation());\n this.addEventListener('input', this.#setValidity);\n\n // The attribute sync takes time, so getValidity returns valid,\n // even when it shouldn't. This way allows all attributes to sync\n // after render, before checking the validity.\n setTimeout(() => this.#setValidity());\n }\n };\n","import { observeAttributes } from '../helpers/componentHelpers';\n\nconst booleanAttributesList = [\n 'readonly',\n 'focused',\n 'invalid',\n 'has-label',\n 'required',\n 'disabled',\n 'checked',\n 'has-helper',\n 'has-value',\n 'step-buttons-visible',\n 'hover',\n 'has-error-message',\n 'focus-ring',\n 'opened',\n 'active',\n 'password-visible',\n 'opening',\n 'closing',\n 'has-no-options',\n 'loading',\n 'allow-custom-value',\n 'loading',\n];\n\nconst isBooleanAttribute = (attr) => {\n return booleanAttributesList.includes(attr);\n};\n// we want all the valueless attributes to have \"true\" value\n// and all the falsy attribute to be removed\nexport const normalizeBooleanAttributesMixin = (superclass) =>\n class NormalizeBooleanAttributesMixinClass extends superclass {\n init() {\n super.init?.();\n\n observeAttributes(\n this,\n (attrs) =>\n attrs.forEach((attr) => {\n const attrVal = this.getAttribute(attr);\n\n if (isBooleanAttribute(attr)) {\n if (attrVal === '') {\n this.setAttribute(attr, 'true');\n } else if (attrVal === 'false') {\n this.removeAttribute(attr);\n }\n } else if (!attrVal) {\n // eslint-disable-next-line no-console\n console.debug(\n `attribute \"${attr}\" has no value, should it be added to the boolean attributes list?`\n );\n }\n }),\n {}\n );\n }\n };\n","import { PORTAL_THEME_PREFIX } from '../constants';\nimport { kebabCaseJoin } from '../helpers';\nimport { forwardAttrs } from '../helpers/componentHelpers';\nimport { createStyleMixin } from './createStyleMixin';\nimport { createCssVarsList } from './createStyleMixin/helpers';\n\n// this is needed because we might generate the same css vars names\n// e.g. \"overlayColor\" attribute in style mixin's mapping,\n// will generate the same var as \"color\" attribute in portals's mapping\n// when the portal name is \"overlay\".\n// because of that, we are adding this separator that is also used as a differentiator\nconst DISPLAY_NAME_SEPARATOR = '_';\n\nconst sanitizeSelector = (selector) => selector.replace(/[^\\w\\s]/gi, '');\n\nconst withWaitForShadowRoot = (getRootElementFn) => async (that) => {\n const ele = await getRootElementFn(that);\n\n return new Promise((res) => {\n const MAX_RETRIES = 20;\n let counter = 0;\n\n const check = () => {\n if (counter > MAX_RETRIES) {\n // eslint-disable-next-line no-console\n console.error('could not get shadow root for element', ele);\n res(ele);\n return;\n }\n\n counter++;\n\n if (!ele?.shadowRoot) {\n setTimeout(check);\n } else {\n res(ele.shadowRoot);\n }\n };\n check();\n });\n};\n\nexport const portalMixin =\n ({ name, selector, mappings = {}, forward: { attributes = [], include = true } = {} }) =>\n (superclass) => {\n const eleDisplayName = name || sanitizeSelector(selector);\n\n const BaseClass = createStyleMixin({\n mappings,\n })(superclass);\n\n return class PortalMixinClass extends BaseClass {\n static get cssVarList() {\n return {\n ...BaseClass.cssVarList,\n [eleDisplayName]: createCssVarsList(\n kebabCaseJoin(superclass.componentName, DISPLAY_NAME_SEPARATOR + eleDisplayName),\n mappings\n ),\n };\n }\n\n #portalEle;\n\n constructor() {\n // we cannot use \"this\" before calling \"super\"\n const getRootElement = async (that) => {\n const baseEle = (that.shadowRoot || that).querySelector(that.baseSelector);\n if (!selector) {\n return baseEle;\n }\n\n // in case we have a selector, we should first wait for the base element shadow root\n // and then look for the internal element\n const baseEleShadowRoot = await withWaitForShadowRoot(() => baseEle)(that);\n return baseEleShadowRoot.querySelector(selector);\n };\n\n const getPortalElement = withWaitForShadowRoot(getRootElement);\n\n super({\n getRootElement: getPortalElement,\n componentNameSuffix: DISPLAY_NAME_SEPARATOR + eleDisplayName,\n themeSection: PORTAL_THEME_PREFIX + eleDisplayName,\n baseSelector: ':host',\n });\n\n this.#portalEle = getPortalElement(this).then((ele) => ele.host);\n }\n\n async #handleHoverAttribute() {\n const portalEle = await this.#portalEle;\n portalEle.onmouseenter = (e) => {\n e.target.setAttribute('hover', 'true');\n };\n portalEle.onmouseleave = (e) => {\n e.target.removeAttribute('hover');\n };\n }\n\n async init() {\n super.init?.();\n const portalEle = await this.#portalEle;\n forwardAttrs(this, portalEle, {\n [include ? 'includeAttrs' : 'excludeAttrs']: attributes,\n });\n\n this.#handleHoverAttribute();\n }\n };\n };\n","/* eslint-disable no-param-reassign */\nimport { compose } from '../helpers';\nimport { forwardAttrs, getComponentName } from '../helpers/componentHelpers';\nimport { createDispatchEvent } from '../helpers/mixinsHelpers';\nimport { createStyleMixin } from './createStyleMixin';\nimport { inputValidationMixin } from './inputValidationMixin';\n\nconst errorAttrs = ['invalid', 'required'];\n\nconst forwardProps = (src, targets, property) => {\n const targetArr = Array.isArray(targets) ? targets : [targets];\n\n Object.defineProperty(src, property, {\n set(v) {\n targetArr.forEach((target) => {\n target[property] = v;\n });\n },\n get() {\n return targets[0][property];\n },\n configurable: true,\n });\n};\n\n// recursively take the first slot child until it finds an element which is not a slot\n// stops after \"nestingLevel\" times\nconst getNestedInput = (ele) => {\n if (!ele) return undefined;\n\n const nestingLevel = 10;\n\n let nonSlotEle = ele;\n for (let i = 0; i < nestingLevel; i++) {\n [nonSlotEle] = nonSlotEle.assignedElements();\n if (nonSlotEle?.localName !== 'slot') return nonSlotEle;\n }\n return undefined;\n};\n\nconst proxyInputMixin =\n ({\n proxyProps = [],\n // useProxyTargets flag allows to forwardProps to other targets, other than\n // `this.inputElement`. It's to be used within `external-input` components,\n // if needed\n useProxyTargets = false,\n // allows us to set the event that should trigger validation\n // it can be either a string or an array of strings (for multiple events)\n inputEvent = 'input',\n triggerValidationEvents = [],\n // Proxies all validations from the parent component to the input element\n proxyParentValidation = false,\n }) =>\n (superclass) =>\n class ProxyInputMixinClass extends inputValidationMixin(superclass) {\n static get observedAttributes() {\n return [...(superclass.observedAttributes || []), ...errorAttrs];\n }\n\n #inputElement;\n\n #dispatchChange = createDispatchEvent.bind(this, 'change');\n\n constructor() {\n super();\n\n this.#inputElement = super.inputElement;\n }\n\n // the web-component does not loaded immediately, so we want to defer the warning\n // and show it only if the input element was not found after the component is loaded\n warnIfInputElementIsMissing() {\n clearTimeout(this.inputElementTimerId);\n\n this.inputElementTimerId = setTimeout(() => {\n // eslint-disable-next-line no-console\n !this.#inputElement && console.warn(this.localName, 'no input was found');\n }, 0);\n }\n\n get inputElement() {\n if (this.#inputElement) return this.#inputElement;\n\n this.warnIfInputElementIsMissing();\n\n const inputSlot = this.baseElement.shadowRoot?.querySelector('slot[name=\"input\"]');\n const textAreaSlot = this.baseElement.shadowRoot?.querySelector('slot[name=\"textarea\"]');\n\n this.#inputElement = getNestedInput(inputSlot) || getNestedInput(textAreaSlot);\n\n return this.#inputElement;\n }\n\n set inputElement(ele) {\n this.#inputElement = ele;\n }\n\n getValidity() {\n return this.inputElement?.validity || {};\n }\n\n #handleErrorMessage() {\n this.setAttribute('error-message', this.validationMessage);\n }\n\n // We do not want to show the default validity report tooltip\n // So we are overriding the reportValidity fn to show the input's error message\n reportValidity = () => {\n // we want to update validity so in case the value was set programmatically, we won't get an error\n this.inputElement.setCustomValidity('');\n this.setCustomValidity('');\n if (!this.checkValidity()) {\n this.setAttribute('invalid', 'true');\n this.#handleErrorMessage();\n this.focus();\n }\n };\n\n // we are keeping also the default reportValidity because there are some components that still using it\n defaultReportValidity() {\n return super.reportValidity();\n }\n\n init() {\n super.init?.();\n\n // vaadin sets invalid indication on blur\n // we want invalid indication to appear only when calling reportValidity\n // this is why we are overriding vaadin's setInvalid behavior\n // to update only when the element is valid (so invalid indication will only be removed)\n // and we are adding it in reportValidity\n // eslint-disable-next-line func-names\n this.baseElement._setInvalid = function (invalid) {\n if (!invalid && this._shouldSetInvalid(invalid)) {\n this.invalid = invalid;\n }\n };\n\n // We want to ensure that `input` events properly cross ShadowDOM boundries\n // e.g. When we autofill a component's input with 1Password, for instance,\n // the event is fired without `composed: true` and doesn't our component's\n // ShadowDOM.\n this.baseElement.addEventListener('input', (e) => {\n if (!e.composed) {\n this.dispatchEvent(new Event('input', { bubbles: true, composed: true }));\n }\n });\n\n triggerValidationEvents.forEach((e) => {\n this.baseElement?.addEventListener(e, () => {\n this.inputElement?.setCustomValidity('');\n });\n });\n\n // on some cases the base element is not ready so the inputElement is empty\n // we are deferring this section to make sure the base element is ready\n setTimeout(() => {\n const validationEvents = Array.isArray(inputEvent) ? inputEvent : [inputEvent];\n\n validationEvents.forEach((e) => {\n this.baseElement?.addEventListener(e, () => {\n if (!this.baseElement.checkValidity()) {\n this.#handleErrorMessage();\n } else {\n this.removeAttribute('invalid');\n }\n });\n });\n\n this.baseElement.addEventListener('change', () => {\n this.#dispatchChange();\n });\n\n this.addEventListener('invalid', () => {\n if (!this.checkValidity()) {\n this.setAttribute('invalid', 'true');\n }\n this.#handleErrorMessage();\n });\n\n // sync properties\n proxyProps.forEach((prop) => {\n const externalInput = this.querySelector('input[slot=\"external-input\"]') || null;\n const proxyTargets = useProxyTargets\n ? [this.baseElement, externalInput].filter(Boolean)\n : [];\n forwardProps(this, [this.inputElement, ...proxyTargets], prop);\n });\n\n this.setSelectionRange = this.inputElement?.setSelectionRange?.bind(this.inputElement);\n\n forwardAttrs(this, this.inputElement, { includeAttrs: ['inputmode'] });\n });\n\n if (proxyParentValidation) {\n // All functions called on the inputElement internals will be applied to the parent\n // component internals as well. As a result, there's no need to add outer mechanisms\n // to update the parent component's validity state based on the input elements validity.\n const inputElementInternals = this.inputElement.internals;\n const parentThis = this;\n this.inputElement.internals = new Proxy(inputElementInternals, {\n get: (target, prop) => {\n if (typeof target[prop] === 'function' && prop === 'setValidity') {\n return (...args) => {\n // If we're calling setValidity with 3 args, then the validationTarget\n // needs to be swapped to be the inputElement\n if (args.length === 3) {\n const newArgs = args.slice(0, args.length - 1);\n newArgs.push(parentThis.inputElement);\n parentThis.internals[prop](...newArgs);\n } else {\n parentThis.internals[prop](...args);\n }\n return target[prop](...args);\n };\n }\n\n if (typeof target[prop] === 'function') {\n return (...args) => {\n parentThis.internals[prop](...args);\n return target[prop](...args);\n };\n }\n\n return target[prop];\n },\n });\n }\n }\n };\n\nconst composedProxyInputMixin = (proxyInputMixinConfig) =>\n compose(\n proxyInputMixin(proxyInputMixinConfig),\n // in order to use input-wrapper across all our input components, we need to inject its theme\n // to every proxy input mixin, to allow its css vars to be scoped properly and accessible\n // in the proxy input component\n createStyleMixin({ componentNameOverride: getComponentName('input-wrapper') })\n );\n\nexport { composedProxyInputMixin as proxyInputMixin };\n"],"names":["createBaseClass","componentName","baseSelector","DescopeBaseClass","HTMLElement","baseElement","this","rootElement","querySelector","console","warn","localName","shadowRoot","name","getAttribute","connectedCallback","super","isConnected","init","createDispatchEvent","eventName","options","event","Event","dispatchEvent","changeMixin","superclass","bind","prevValue","value","addEventListener","e","stopPropagation","componentNameValidationMixin","currentComponentName","Error","componentsContextMixin","updateComponentsContext","componentsContext","CustomEvent","bubbles","composed","detail","createProxy","wrappedEleName","slots","style","excludeAttrsSync","includeAttrsSync","includeForwardProps","delegatesFocus","ProxyClass","constructor","attachShadow","mode","innerHTML","map","slot","join","_","excludeAttrs","includeAttrs","createCssVar","varName","fallback","StyleBuilder","styleMap","Map","add","selector","property","has","set","get","toString","Array","from","entries","reduce","acc","propValArr","getFallbackVarName","origVarName","suffix","createStyle","mappings","createFallbackVar","fallbackVarName","Object","keys","forEach","attr","attrConfig","config","defaultMapping","length","isArray","entry","normalizeConfig","cssVarName","relativeSelectorOrSelectorFn","important","fallbackValue","test","createCssSelector","getFallbackVarsNames","fallbackAttrName","createCssVarsList","assign","createClassSelectorSpecifier","className","numOfRepeats","fill","createStyleMixin","componentNameOverride","CustomStyleMixinClass","cssVarList","getRootElement","componentNameSuffix","themeSection","key","componentsThemeManager","currentTheme","replaceSync","prepend","onCurrentThemeChange","classSpecifier","attrName","cssRules","replace","RegExp","setProperty","removeProperty","removeAttribute","attrs","includes","classList","host","disconnectedCallback","draggableMixin","isDraggable","hasAttribute","prevTabIndex","setAttribute","onComplete","target","removeEventListener","once","createExternalInputSlot","slotName","targetSlotName","slotEle","document","createElement","createExternalInputEle","type","autocompleteType","inputName","inputEle","applyExternalInputStyles","sourceInputEle","targetInputEle","labelType","setTimeout","computedStyle","getComputedStyle","height","getPropertyValue","paddingLeft","paddingRight","fontSize","fontFamily","letterSpacing","caretColor","valueColor","ele","origVal","getValueColor","val","marginBottom","width","externalInputMixin","inputType","noBlurDispatch","isExternalInput","createExternalInput","isReadOnly","isDisabled","origInput","externalInputSlot","appendChild","externalInput","getAutocompleteType","forwardInputValue","stopImmediatePropagation","handleFocusEvents","handleBlurEvents","handlelInputEvents","clearBlurTimers","timer","clearTimeout","dispatchBlur","focus","push","source","valueDescriptor","getOwnPropertyDescriptor","inputElement","prototype","defineProperty","v","call","configurable","hoverableMixin","inputEventsDispatchingMixin","isTrusted","handleFocusEventsDispatching","inputs","timerId","input","onFocus","handleInputEventDispatching","previousRootComponentValue","inputOverrideValidConstraintsMixin","_hasValidConstraints","observedAttributes","errorAttributes","validationTargetSymbol","Symbol","inputValidationMixin","formAssociated","internals","attachInternals","defaultErrorMsgValueMissing","defaultErrorMsgPatternMismatch","defaultErrorMsgTooShort","defaultErrorMsgTooLong","defaultErrorMsgRangeUnderflow","defaultErrorMsgRangeOverflow","defaultErrorMsgTypeMismatch","getErrorMessage","flags","valueMissing","patternMismatch","typeMismatch","stepMismatch","tooShort","tooLong","rangeOverflow","rangeUnderflow","badInput","customError","validationMessage","validity","getValidity","setValidity","validationTarget","checkValidity","valid","reportValidity","setCustomValidity","errorMessage","isRequired","pattern","form","attributeChangedCallback","oldValue","newValue","booleanAttributesList","normalizeBooleanAttributesMixin","attrVal","isBooleanAttribute","debug","withWaitForShadowRoot","getRootElementFn","async","that","Promise","res","counter","check","error","portalMixin","forward","attributes","include","eleDisplayName","sanitizeSelector","BaseClass","getPortalElement","baseEle","then","portalEle","onmouseenter","onmouseleave","errorAttrs","getNestedInput","nonSlotEle","i","assignedElements","proxyInputMixin","proxyProps","useProxyTargets","inputEvent","triggerValidationEvents","proxyParentValidation","warnIfInputElementIsMissing","inputElementTimerId","inputSlot","textAreaSlot","defaultReportValidity","_setInvalid","invalid","_shouldSetInvalid","prop","proxyTargets","filter","Boolean","src","targets","targetArr","forwardProps","setSelectionRange","inputElementInternals","parentThis","Proxy","args","newArgs","slice","composedProxyInputMixin","proxyInputMixinConfig"],"sourceRoot":""}
|