@descope/web-components-ui 3.22.2 → 3.23.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 +1035 -593
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1380 -937
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/67.js +1 -1
- package/dist/umd/67.js.map +1 -1
- package/dist/umd/8961.js +1 -1
- package/dist/umd/8961.js.map +1 -1
- package/dist/umd/9365.js +1 -1
- package/dist/umd/9365.js.map +1 -1
- package/dist/umd/9582.js +1 -1
- package/dist/umd/9582.js.map +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/DescopeDev.js.map +1 -1
- package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js +1 -1
- package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js.map +1 -1
- package/dist/umd/descope-active-sessions.js +3 -0
- package/dist/umd/descope-active-sessions.js.LICENSE.txt +5 -0
- package/dist/umd/descope-active-sessions.js.map +1 -0
- package/dist/umd/descope-alert-index-js.js +1 -1
- package/dist/umd/descope-alert-index-js.js.map +1 -1
- package/dist/umd/descope-enriched-text.js +1 -1
- package/dist/umd/descope-enriched-text.js.map +1 -1
- package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js +1 -1
- package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js.map +1 -1
- package/dist/umd/descope-new-password-index-js.js +1 -1
- package/dist/umd/descope-new-password-index-js.js.map +1 -1
- package/dist/umd/descope-password-index-js.js +1 -1
- package/dist/umd/descope-password-index-js.js.map +1 -1
- package/dist/umd/descope-tooltip.js +1 -1
- package/dist/umd/descope-tooltip.js.map +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/package.json +43 -42
- package/src/components/descope-password/PasswordClass.js +14 -3
- package/src/helpers/componentHelpers.js +34 -0
- package/src/mixins/createStyleMixin/index.js +11 -2
- package/src/mixins/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,QACA8D,EAAAxB,aAAA,eACAlB,WAAA,KACA0C,EAAAG,UAGA,MAAAC,EAAAC,IACAL,EAAAxB,aAAA,OAAA0B,GACAN,EAAAU,gBAAA,SACArE,KAAAkC,oBAAA,UAAAiC,GACAnE,KAAAkC,oBAAA,UAAAiC,IAGAnE,KAAA4D,iBAAA,UAAAO,EAAA,CAAyDG,MAAA,IACzDtE,KAAA4D,iBAAA,UAAAO,EAAA,CAAyDG,MAAA,GACzD,GAEA","sources":["webpack://@descope/web-components-ui/./src/components/descope-password/PasswordClass.js","webpack://@descope/web-components-ui/./src/components/descope-password/index.js","webpack://@descope/web-components-ui/./src/components/descope-password/passwordDraggableMixin.js"],"sourcesContent":["import {\n createStyleMixin,\n draggableMixin,\n createProxy,\n proxyInputMixin,\n componentNameValidationMixin,\n externalInputMixin,\n} from '../../mixins';\nimport { compose } from '../../helpers';\nimport { getComponentName } from '../../helpers/componentHelpers';\nimport passwordDraggableMixin from './passwordDraggableMixin';\nimport {\n resetInputLabelPosition,\n resetInputCursor,\n useHostExternalPadding,\n inputFloatingLabelStyle,\n} from '../../helpers/themeHelpers/resetHelpers';\n\nexport const componentName = getComponentName('password');\n\nconst customMixin = (superclass) =>\n class PasswordFieldMixinClass extends superclass {\n static get observedAttributes() {\n return ['manual-visibility-toggle'];\n }\n\n get manualToggleVisibility() {\n return this.getAttribute('manual-visibility-toggle') === 'true';\n }\n\n init() {\n super.init?.();\n this.handleCaretOnVisibilityChange();\n this.origSetPasswordVisible = this.baseElement._setPasswordVisible;\n this.origSetFocused = this.baseElement._setFocused;\n this.baseElement._setFocused = this.setFocus.bind(this);\n\n this.initExternalInput();\n }\n\n initExternalInput() {\n const externalInput = this.createExternalInput();\n if (externalInput) {\n this.handlePasswordVisibility(externalInput);\n }\n }\n\n get caretPosition() {\n return this.value?.length || 0;\n }\n\n handleCaretOnVisibilityChange() {\n const origTogglePasswordVisibility = this.baseElement._togglePasswordVisibility.bind(\n this.baseElement\n );\n this.baseElement._togglePasswordVisibility = () => {\n setTimeout(() => {\n origTogglePasswordVisibility();\n this.inputElement.setSelectionRange(this.caretPosition, this.caretPosition);\n return false;\n });\n };\n }\n\n // We use `manual-visibility-toggle` to to toggle the password's visibility\n // even if the input field is focused-out. However, on focusout - Vaadin resets\n // password visibility. Since we don't want to override Vaadin's native setFocus\n // function (which is part of their FocusMixin).\n // So, here we override the part of logic that runs within Vaadin's setFocus that reports\n // the password visibility state. This logic is part of our `manual-visibility-toggle` only.\n setFocus(focused) {\n if (this.manualToggleVisibility) {\n this.baseElement._setPasswordVisible = () => {};\n }\n this.origSetFocused.call(this.baseElement, focused);\n this.baseElement._setPasswordVisible = this.origSetPasswordVisible.bind(this.baseElement);\n }\n\n resetPasswordVisibilityToggle() {\n this.baseElement._setPasswordVisible = this.origSetPasswordVisible;\n this.baseElement._setFocused = this.origSetFocus;\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n }\n\n // override vaadin's password visibility toggle.\n // we need this override in order to to resolve the external input `focus` race condition,\n // which is caused due to the focus sync between the two inputs.\n handlePasswordVisibility(externalInput) {\n // disable vaadin's `__boundRevealButtonMouseDown` mouse-down event lisetener\n const origBoundRevealButtonMouseDown = this.baseElement.__boundRevealButtonMouseDown;\n this.baseElement\n .querySelector('vaadin-password-field-button')\n .removeEventListener('mousedown', origBoundRevealButtonMouseDown);\n\n // disable vaadin's `_passwordVisibleChanged` observer\n this.baseElement._passwordVisibleChanged = () => {};\n\n // override vaadin's `_togglePasswordVisibility`\n this.baseElement._togglePasswordVisibility = () => {\n const currVisibility = externalInput.getAttribute('type');\n if (currVisibility === 'password') {\n this.showPasswordVisibility(externalInput);\n } else {\n this.hidePasswordVisibility(externalInput);\n }\n };\n }\n\n showPasswordVisibility(input) {\n // handle input element's type\n input.setAttribute('type', 'text');\n // handle vaadin's `password-visible` attribute\n this.setAttribute('password-visible', 'true');\n }\n\n hidePasswordVisibility(input) {\n // handle input element's type\n input.setAttribute('type', 'password');\n // handle vaadin's `password-visible` attribute\n this.setAttribute('password-visible', 'false');\n }\n };\n\nconst {\n host,\n inputField,\n inputElement,\n inputElementPlaceholder,\n revealButtonContainer,\n revealButtonIcon,\n label,\n requiredIndicator,\n errorMessage,\n helperText,\n} = {\n host: { selector: () => ':host' },\n inputField: { selector: '::part(input-field)' },\n inputElement: { selector: '> input' },\n inputElementPlaceholder: { selector: () => ':host input:placeholder-shown' },\n revealButtonContainer: { selector: '::part(reveal-button)' },\n revealButtonIcon: { selector: '::part(reveal-button)::before' },\n label: { selector: '::part(label)' },\n requiredIndicator: { selector: '[required]::part(required-indicator)::after' },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n};\n\nexport const PasswordClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostMinWidth: { ...host, property: 'min-width' },\n hostDirection: { ...host, property: 'direction' },\n fontSize: [{}, host],\n fontFamily: [label, inputField, errorMessage, helperText],\n inputHeight: { ...inputField, property: 'height' },\n inputHorizontalPadding: [\n { ...inputElement, property: 'padding-left' },\n { ...inputElement, property: 'padding-right' },\n ],\n inputBackgroundColor: { ...inputField, property: 'background-color' },\n\n inputBorderStyle: { ...inputField, property: 'border-style' },\n inputBorderWidth: { ...inputField, property: 'border-width' },\n inputBorderColor: { ...inputField, property: 'border-color' },\n inputBorderRadius: { ...inputField, property: 'border-radius' },\n\n inputOutlineColor: { ...inputField, property: 'outline-color' },\n inputOutlineStyle: { ...inputField, property: 'outline-style' },\n inputOutlineOffset: { ...inputField, property: 'outline-offset' },\n inputOutlineWidth: { ...inputField, property: 'outline-width' },\n\n labelFontSize: { ...label, property: 'font-size' },\n labelFontWeight: { ...label, property: 'font-weight' },\n inputValueFontWeight: [\n { ...inputElement, property: 'font-weight' },\n { selector: () => ':host ::slotted(input)', property: 'font-weight' },\n ],\n inputPlaceholderFontWeight: [\n { ...inputElementPlaceholder, property: 'font-weight' },\n { selector: () => ':host ::slotted(input:placeholder-shown)', property: 'font-weight' },\n ],\n helperTextFontWeight: { ...helperText, property: 'font-weight' },\n errorMessageFontWeight: { ...errorMessage, property: 'font-weight' },\n labelTextColor: [\n { ...label, property: 'color' },\n { ...label, property: '-webkit-text-fill-color' },\n { ...requiredIndicator, property: 'color' },\n { ...requiredIndicator, property: '-webkit-text-fill-color' },\n ],\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\n errorMessageTextColor: { ...errorMessage, property: 'color' },\n errorMessageIcon: { ...errorMessage, property: 'background-image' },\n errorMessageIconSize: { ...errorMessage, property: 'background-size' },\n errorMessageIconPadding: { ...errorMessage, property: 'padding-inline-start' },\n errorMessageIconRepeat: { ...errorMessage, property: 'background-repeat' },\n errorMessageIconPosition: { ...errorMessage, property: 'background-position' },\n errorMessageFontSize: { ...errorMessage, property: 'font-size' },\n\n inputPlaceholderTextColor: [\n { ...inputElementPlaceholder, property: 'color' },\n { selector: () => ':host ::slotted(input:placeholder-shown)', property: 'color' },\n ],\n inputValueTextColor: [\n { ...inputElement, property: 'color' },\n { selector: () => ':host ::slotted(input)', property: 'color' },\n ],\n\n revealButtonOffset: [\n { ...revealButtonContainer, property: 'margin-right' },\n { ...revealButtonContainer, property: 'margin-left' },\n ],\n revealButtonSize: { ...revealButtonContainer, property: 'font-size' },\n revealButtonColor: { ...revealButtonIcon, property: 'color' },\n\n labelPosition: { ...label, property: 'position' },\n labelTopPosition: { ...label, property: 'top' },\n labelHorizontalPosition: [\n { ...label, property: 'left' },\n { ...label, property: 'right' },\n ],\n inputTransformY: { ...label, property: 'transform' },\n inputTransition: { ...label, property: 'transition' },\n marginInlineStart: { ...label, property: 'margin-inline-start' },\n placeholderOpacity: [\n { selector: '> input:placeholder-shown', property: 'opacity' },\n { ...inputElement, property: 'opacity' },\n ],\n inputVerticalAlignment: { ...inputField, property: 'align-items' },\n valueInputHeight: { ...inputElement, property: 'height' },\n },\n }),\n draggableMixin,\n externalInputMixin({\n inputType: 'password',\n inputName: 'password',\n includeAttrs: ['disabled', 'readonly', 'pattern', 'type', 'autocomplete'],\n noBlurDispatch: true,\n }),\n proxyInputMixin({ proxyProps: ['value', 'selectionStart'], useProxyTargets: true }),\n componentNameValidationMixin,\n passwordDraggableMixin,\n customMixin\n)(\n createProxy({\n slots: ['', 'suffix'],\n wrappedEleName: 'vaadin-password-field',\n style: () => `\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tmin-width: 10em;\n box-sizing: border-box;\n position: relative;\n\t\t\t}\n\t\t\t${useHostExternalPadding(PasswordClass.cssVarList)}\n\t\t\t${resetInputCursor('vaadin-password-field')}\n ${resetInputLabelPosition('vaadin-password-field')}\n\n\t\t\tvaadin-password-field {\n\t\t\t\twidth: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\tvaadin-password-field > input {\n -webkit-mask-image: none;\n\t\t\t\tbox-sizing: border-box;\n opacity: 1;\n\t\t\t}\n\t\t\tvaadin-password-field::part(input-field) {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\tvaadin-password-field[focus-ring]::part(input-field) {\n\t\t\t\tbox-shadow: none;\n\t\t\t}\n :host ::slotted(input) {\n\t\t\t\tmin-height: 0;\n }\n :host([readonly]) ::slotted(input:placeholder-shown) {\n\t\t\t\topacity: 0;\n\t\t\t}\n\t\t\tvaadin-password-field::before {\n\t\t\t\theight: initial;\n\t\t\t}\n\t\t\tvaadin-password-field::part(input-field)::after {\n\t\t\t\topacity: 0;\n\t\t\t}\n\t\t\tvaadin-password-field-button {\n\t\t\t\tcursor: pointer;\n\t\t\t}\n\t\t\t:host([readonly]) vaadin-password-field-button {\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\t\t\tvaadin-password-field-button[focus-ring] {\n\t\t\t\tbox-shadow: 0 0 0 2px var(${PasswordClass.cssVarList.inputOutlineColor});\n\t\t\t}\n\n ${inputFloatingLabelStyle()}\n\n ::part(reveal-button) {\n align-self: center;\n }\n\n vaadin-password-field[external-input=\"true\"] > input:not(:placeholder-shown) {\n opacity: 0;\n }\n\t\t`,\n excludeAttrsSync: ['tabindex', 'style'],\n componentName,\n })\n);\n","import '@vaadin/password-field';\nimport { componentName, PasswordClass } from './PasswordClass';\n\ncustomElements.define(componentName, PasswordClass);\n\nexport { PasswordClass, componentName };\n","const passwordDraggableMixin = (superclass) =>\n class PasswordDraggableMixinClass extends superclass {\n get isReadOnly() {\n return this.hasAttribute('readonly') && this.getAttribute('readonly') !== 'false';\n }\n\n init() {\n // there is an issue in Chrome that input field with type password cannot be D&D\n // so in case the input is draggable & readonly, we are changing the input type to \"text\" before dragging\n // and return the original type when done\n super.init?.();\n\n const ele = this.querySelector('input');\n\n ele?.addEventListener('mousedown', (e) => {\n if (this.isDraggable && this.isReadOnly) {\n ele.setAttribute('inert', 'true');\n\n const inputEle = e.target;\n const prevType = inputEle.getAttribute('type');\n inputEle.setAttribute('type', 'text');\n setTimeout(() => {\n inputEle.focus();\n });\n\n const onComplete = (_) => {\n inputEle.setAttribute('type', prevType);\n ele.removeAttribute('inert');\n this.removeEventListener('mouseup', onComplete);\n this.removeEventListener('dragend', onComplete);\n };\n\n this.addEventListener('dragend', onComplete, { once: true });\n this.addEventListener('mouseup', onComplete, { once: true });\n }\n });\n }\n };\n\nexport default passwordDraggableMixin;\n"],"names":["componentName","_helpers_componentHelpers__WEBPACK_IMPORTED_MODULE_2__","xE","host","inputField","inputElement","inputElementPlaceholder","revealButtonContainer","revealButtonIcon","label","requiredIndicator","errorMessage","helperText","selector","PasswordClass","_helpers__WEBPACK_IMPORTED_MODULE_1__","Zz","_mixins__WEBPACK_IMPORTED_MODULE_0__","RF","mappings","hostWidth","property","hostMinWidth","hostDirection","fontSize","fontFamily","inputHeight","inputHorizontalPadding","inputBackgroundColor","inputBorderStyle","inputBorderWidth","inputBorderColor","inputBorderRadius","inputOutlineColor","inputOutlineStyle","inputOutlineOffset","inputOutlineWidth","labelFontSize","labelFontWeight","inputValueFontWeight","inputPlaceholderFontWeight","helperTextFontWeight","errorMessageFontWeight","labelTextColor","labelRequiredIndicator","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","inputPlaceholderTextColor","inputValueTextColor","revealButtonOffset","revealButtonSize","revealButtonColor","labelPosition","labelTopPosition","labelHorizontalPosition","inputTransformY","inputTransition","marginInlineStart","placeholderOpacity","inputVerticalAlignment","valueInputHeight","VO","RV","inputType","inputName","includeAttrs","noBlurDispatch","OZ","proxyProps","useProxyTargets","tQ","_passwordDraggableMixin__WEBPACK_IMPORTED_MODULE_3__","A","superclass","observedAttributes","manualToggleVisibility","this","getAttribute","init","super","handleCaretOnVisibilityChange","origSetPasswordVisible","baseElement","_setPasswordVisible","origSetFocused","_setFocused","setFocus","bind","initExternalInput","externalInput","createExternalInput","handlePasswordVisibility","caretPosition","value","length","origTogglePasswordVisibility","_togglePasswordVisibility","setTimeout","setSelectionRange","focused","call","resetPasswordVisibilityToggle","origSetFocus","attributeChangedCallback","attrName","oldValue","newValue","origBoundRevealButtonMouseDown","__boundRevealButtonMouseDown","querySelector","removeEventListener","_passwordVisibleChanged","showPasswordVisibility","hidePasswordVisibility","input","setAttribute","tz","slots","wrappedEleName","style","_helpers_themeHelpers_resetHelpers__WEBPACK_IMPORTED_MODULE_4__","cy","cssVarList","I4","$J","Kl","excludeAttrsSync","customElements","define","_PasswordClass__WEBPACK_IMPORTED_MODULE_1__","T","M","__WEBPACK_DEFAULT_EXPORT__","isReadOnly","hasAttribute","ele","addEventListener","e","isDraggable","inputEle","target","prevType","focus","onComplete","_","removeAttribute","once"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"descope-password-index-js.js","mappings":"wNAkBO,MAAAA,GAAsB,EAAAC,EAAAC,IAAgB,aAuH7CC,KACAA,EAAAC,WACAA,EAAAC,aACAA,EA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WAAA,KACAuC,EAAAG,UAGA,MAAAC,EAAAC,IACAL,EAAAtB,aAAA,OAAAwB,GACAJ,EAAAQ,gBAAA,SACAzE,KAAAwC,oBAAA,UAAA+B,GACAvE,KAAAwC,oBAAA,UAAA+B,IAGAvE,KAAAe,iBAAA,UAAAwD,EAAA,CAAyDG,MAAA,IACzD1E,KAAAe,iBAAA,UAAAwD,EAAA,CAAyDG,MAAA,GACzD,GAEA","sources":["webpack://@descope/web-components-ui/./src/components/descope-password/PasswordClass.js","webpack://@descope/web-components-ui/./src/components/descope-password/index.js","webpack://@descope/web-components-ui/./src/components/descope-password/passwordDraggableMixin.js"],"sourcesContent":["import {\n createStyleMixin,\n draggableMixin,\n createProxy,\n proxyInputMixin,\n componentNameValidationMixin,\n externalInputMixin,\n} from '../../mixins';\nimport { compose } from '../../helpers';\nimport { getComponentName } from '../../helpers/componentHelpers';\nimport passwordDraggableMixin from './passwordDraggableMixin';\nimport {\n resetInputLabelPosition,\n resetInputCursor,\n useHostExternalPadding,\n inputFloatingLabelStyle,\n} from '../../helpers/themeHelpers/resetHelpers';\n\nexport const componentName = getComponentName('password');\n\nconst customMixin = (superclass) =>\n class PasswordFieldMixinClass extends superclass {\n static get observedAttributes() {\n return ['manual-visibility-toggle'];\n }\n\n get manualToggleVisibility() {\n return this.getAttribute('manual-visibility-toggle') === 'true';\n }\n\n init() {\n super.init?.();\n this.handleCaretOnVisibilityChange();\n this.origSetPasswordVisible = this.baseElement._setPasswordVisible;\n this.origSetFocused = this.baseElement._setFocused;\n this.baseElement._setFocused = this.setFocus.bind(this);\n\n this.initExternalInput();\n this.stopRevealButtonEnterPropagation();\n }\n\n // Vaadin toggles visibility on Enter keydown but lets the event bubble,\n // and the SDK submits the form on any Enter that reaches the flow root.\n stopRevealButtonEnterPropagation() {\n this.revealButton.addEventListener('keydown', (e) => {\n if (e.key === 'Enter') e.stopPropagation();\n });\n }\n\n get revealButton() {\n return this.baseElement.querySelector('vaadin-password-field-button');\n }\n\n initExternalInput() {\n const externalInput = this.createExternalInput();\n if (externalInput) {\n this.handlePasswordVisibility(externalInput);\n }\n }\n\n get caretPosition() {\n return this.value?.length || 0;\n }\n\n handleCaretOnVisibilityChange() {\n const origTogglePasswordVisibility = this.baseElement._togglePasswordVisibility.bind(\n this.baseElement\n );\n this.baseElement._togglePasswordVisibility = () => {\n setTimeout(() => {\n origTogglePasswordVisibility();\n this.inputElement.setSelectionRange(this.caretPosition, this.caretPosition);\n return false;\n });\n };\n }\n\n // We use `manual-visibility-toggle` to to toggle the password's visibility\n // even if the input field is focused-out. However, on focusout - Vaadin resets\n // password visibility. Since we don't want to override Vaadin's native setFocus\n // function (which is part of their FocusMixin).\n // So, here we override the part of logic that runs within Vaadin's setFocus that reports\n // the password visibility state. This logic is part of our `manual-visibility-toggle` only.\n setFocus(focused) {\n if (this.manualToggleVisibility) {\n this.baseElement._setPasswordVisible = () => {};\n }\n this.origSetFocused.call(this.baseElement, focused);\n this.baseElement._setPasswordVisible = this.origSetPasswordVisible.bind(this.baseElement);\n }\n\n resetPasswordVisibilityToggle() {\n this.baseElement._setPasswordVisible = this.origSetPasswordVisible;\n this.baseElement._setFocused = this.origSetFocus;\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n }\n\n // override vaadin's password visibility toggle.\n // we need this override in order to to resolve the external input `focus` race condition,\n // which is caused due to the focus sync between the two inputs.\n handlePasswordVisibility(externalInput) {\n // disable vaadin's `__boundRevealButtonMouseDown` mouse-down event lisetener\n const origBoundRevealButtonMouseDown = this.baseElement.__boundRevealButtonMouseDown;\n this.revealButton.removeEventListener('mousedown', origBoundRevealButtonMouseDown);\n\n // disable vaadin's `_passwordVisibleChanged` observer\n this.baseElement._passwordVisibleChanged = () => {};\n\n // override vaadin's `_togglePasswordVisibility`\n this.baseElement._togglePasswordVisibility = () => {\n const currVisibility = externalInput.getAttribute('type');\n if (currVisibility === 'password') {\n this.showPasswordVisibility(externalInput);\n } else {\n this.hidePasswordVisibility(externalInput);\n }\n };\n }\n\n showPasswordVisibility(input) {\n // handle input element's type\n input.setAttribute('type', 'text');\n // handle vaadin's `password-visible` attribute\n this.setAttribute('password-visible', 'true');\n }\n\n hidePasswordVisibility(input) {\n // handle input element's type\n input.setAttribute('type', 'password');\n // handle vaadin's `password-visible` attribute\n this.setAttribute('password-visible', 'false');\n }\n };\n\nconst {\n host,\n inputField,\n inputElement,\n inputElementPlaceholder,\n revealButtonContainer,\n revealButtonIcon,\n label,\n requiredIndicator,\n errorMessage,\n helperText,\n} = {\n host: { selector: () => ':host' },\n inputField: { selector: '::part(input-field)' },\n inputElement: { selector: '> input' },\n inputElementPlaceholder: { selector: () => ':host input:placeholder-shown' },\n revealButtonContainer: { selector: '::part(reveal-button)' },\n revealButtonIcon: { selector: '::part(reveal-button)::before' },\n label: { selector: '::part(label)' },\n requiredIndicator: { selector: '[required]::part(required-indicator)::after' },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n};\n\nexport const PasswordClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostMinWidth: { ...host, property: 'min-width' },\n hostDirection: { ...host, property: 'direction' },\n fontSize: [{}, host],\n fontFamily: [label, inputField, errorMessage, helperText],\n inputHeight: { ...inputField, property: 'height' },\n inputHorizontalPadding: [\n { ...inputElement, property: 'padding-left' },\n { ...inputElement, property: 'padding-right' },\n ],\n inputBackgroundColor: { ...inputField, property: 'background-color' },\n\n inputBorderStyle: { ...inputField, property: 'border-style' },\n inputBorderWidth: { ...inputField, property: 'border-width' },\n inputBorderColor: { ...inputField, property: 'border-color' },\n inputBorderRadius: { ...inputField, property: 'border-radius' },\n\n inputOutlineColor: { ...inputField, property: 'outline-color' },\n inputOutlineStyle: { ...inputField, property: 'outline-style' },\n inputOutlineOffset: { ...inputField, property: 'outline-offset' },\n inputOutlineWidth: { ...inputField, property: 'outline-width' },\n\n labelFontSize: { ...label, property: 'font-size' },\n labelFontWeight: { ...label, property: 'font-weight' },\n inputValueFontWeight: [\n { ...inputElement, property: 'font-weight' },\n { selector: () => ':host ::slotted(input)', property: 'font-weight' },\n ],\n inputPlaceholderFontWeight: [\n { ...inputElementPlaceholder, property: 'font-weight' },\n { selector: () => ':host ::slotted(input:placeholder-shown)', property: 'font-weight' },\n ],\n helperTextFontWeight: { ...helperText, property: 'font-weight' },\n errorMessageFontWeight: { ...errorMessage, property: 'font-weight' },\n labelTextColor: [\n { ...label, property: 'color' },\n { ...label, property: '-webkit-text-fill-color' },\n { ...requiredIndicator, property: 'color' },\n { ...requiredIndicator, property: '-webkit-text-fill-color' },\n ],\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\n errorMessageTextColor: { ...errorMessage, property: 'color' },\n errorMessageIcon: { ...errorMessage, property: 'background-image' },\n errorMessageIconSize: { ...errorMessage, property: 'background-size' },\n errorMessageIconPadding: { ...errorMessage, property: 'padding-inline-start' },\n errorMessageIconRepeat: { ...errorMessage, property: 'background-repeat' },\n errorMessageIconPosition: { ...errorMessage, property: 'background-position' },\n errorMessageFontSize: { ...errorMessage, property: 'font-size' },\n\n inputPlaceholderTextColor: [\n { ...inputElementPlaceholder, property: 'color' },\n { selector: () => ':host ::slotted(input:placeholder-shown)', property: 'color' },\n ],\n inputValueTextColor: [\n { ...inputElement, property: 'color' },\n { selector: () => ':host ::slotted(input)', property: 'color' },\n ],\n\n revealButtonOffset: [\n { ...revealButtonContainer, property: 'margin-right' },\n { ...revealButtonContainer, property: 'margin-left' },\n ],\n revealButtonSize: { ...revealButtonContainer, property: 'font-size' },\n revealButtonColor: { ...revealButtonIcon, property: 'color' },\n\n labelPosition: { ...label, property: 'position' },\n labelTopPosition: { ...label, property: 'top' },\n labelHorizontalPosition: [\n { ...label, property: 'left' },\n { ...label, property: 'right' },\n ],\n inputTransformY: { ...label, property: 'transform' },\n inputTransition: { ...label, property: 'transition' },\n marginInlineStart: { ...label, property: 'margin-inline-start' },\n placeholderOpacity: [\n { selector: '> input:placeholder-shown', property: 'opacity' },\n { ...inputElement, property: 'opacity' },\n ],\n inputVerticalAlignment: { ...inputField, property: 'align-items' },\n valueInputHeight: { ...inputElement, property: 'height' },\n },\n }),\n draggableMixin,\n externalInputMixin({\n inputType: 'password',\n inputName: 'password',\n includeAttrs: ['disabled', 'readonly', 'pattern', 'type', 'autocomplete'],\n noBlurDispatch: true,\n }),\n proxyInputMixin({ proxyProps: ['value', 'selectionStart'], useProxyTargets: true }),\n componentNameValidationMixin,\n passwordDraggableMixin,\n customMixin\n)(\n createProxy({\n slots: ['', 'suffix'],\n wrappedEleName: 'vaadin-password-field',\n style: () => `\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tmin-width: 10em;\n box-sizing: border-box;\n position: relative;\n\t\t\t}\n\t\t\t${useHostExternalPadding(PasswordClass.cssVarList)}\n\t\t\t${resetInputCursor('vaadin-password-field')}\n ${resetInputLabelPosition('vaadin-password-field')}\n\n\t\t\tvaadin-password-field {\n\t\t\t\twidth: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\tvaadin-password-field > input {\n -webkit-mask-image: none;\n\t\t\t\tbox-sizing: border-box;\n opacity: 1;\n\t\t\t}\n\t\t\tvaadin-password-field::part(input-field) {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\tvaadin-password-field[focus-ring]::part(input-field) {\n\t\t\t\tbox-shadow: none;\n\t\t\t}\n :host ::slotted(input) {\n\t\t\t\tmin-height: 0;\n }\n :host([readonly]) ::slotted(input:placeholder-shown) {\n\t\t\t\topacity: 0;\n\t\t\t}\n\t\t\tvaadin-password-field::before {\n\t\t\t\theight: initial;\n\t\t\t}\n\t\t\tvaadin-password-field::part(input-field)::after {\n\t\t\t\topacity: 0;\n\t\t\t}\n\t\t\tvaadin-password-field-button {\n\t\t\t\tcursor: pointer;\n\t\t\t}\n\t\t\t:host([readonly]) vaadin-password-field-button {\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\t\t\tvaadin-password-field-button[focus-ring] {\n\t\t\t\tbox-shadow: 0 0 0 2px var(${PasswordClass.cssVarList.inputOutlineColor});\n\t\t\t}\n\n ${inputFloatingLabelStyle()}\n\n ::part(reveal-button) {\n align-self: center;\n }\n\n vaadin-password-field[external-input=\"true\"] > input:not(:placeholder-shown) {\n opacity: 0;\n }\n\t\t`,\n excludeAttrsSync: ['tabindex', 'style'],\n componentName,\n })\n);\n","import '@vaadin/password-field';\nimport { componentName, PasswordClass } from './PasswordClass';\n\ncustomElements.define(componentName, PasswordClass);\n\nexport { PasswordClass, componentName };\n","const passwordDraggableMixin = (superclass) =>\n class PasswordDraggableMixinClass extends superclass {\n get isReadOnly() {\n return this.hasAttribute('readonly') && this.getAttribute('readonly') !== 'false';\n }\n\n init() {\n // there is an issue in Chrome that input field with type password cannot be D&D\n // so in case the input is draggable & readonly, we are changing the input type to \"text\" before dragging\n // and return the original type when done\n super.init?.();\n\n const ele = this.querySelector('input');\n\n ele?.addEventListener('mousedown', (e) => {\n if (this.isDraggable && this.isReadOnly) {\n ele.setAttribute('inert', 'true');\n\n const inputEle = e.target;\n const prevType = inputEle.getAttribute('type');\n inputEle.setAttribute('type', 'text');\n setTimeout(() => {\n inputEle.focus();\n });\n\n const onComplete = (_) => {\n inputEle.setAttribute('type', prevType);\n ele.removeAttribute('inert');\n this.removeEventListener('mouseup', onComplete);\n this.removeEventListener('dragend', onComplete);\n };\n\n this.addEventListener('dragend', onComplete, { once: true });\n this.addEventListener('mouseup', onComplete, { once: true });\n }\n });\n }\n };\n\nexport default passwordDraggableMixin;\n"],"names":["componentName","_helpers_componentHelpers__WEBPACK_IMPORTED_MODULE_2__","xE","host","inputField","inputElement","inputElementPlaceholder","revealButtonContainer","revealButtonIcon","label","requiredIndicator","errorMessage","helperText","selector","PasswordClass","_helpers__WEBPACK_IMPORTED_MODULE_1__","Zz","_mixins__WEBPACK_IMPORTED_MODULE_0__","RF","mappings","hostWidth","property","hostMinWidth","hostDirection","fontSize","fontFamily","inputHeight","inputHorizontalPadding","inputBackgroundColor","inputBorderStyle","inputBorderWidth","inputBorderColor","inputBorderRadius","inputOutlineColor","inputOutlineStyle","inputOutlineOffset","inputOutlineWidth","labelFontSize","labelFontWeight","inputValueFontWeight","inputPlaceholderFontWeight","helperTextFontWeight","errorMessageFontWeight","labelTextColor","labelRequiredIndicator","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","inputPlaceholderTextColor","inputValueTextColor","revealButtonOffset","revealButtonSize","revealButtonColor","labelPosition","labelTopPosition","labelHorizontalPosition","inputTransformY","inputTransition","marginInlineStart","placeholderOpacity","inputVerticalAlignment","valueInputHeight","VO","RV","inputType","inputName","includeAttrs","noBlurDispatch","OZ","proxyProps","useProxyTargets","tQ","_passwordDraggableMixin__WEBPACK_IMPORTED_MODULE_3__","A","superclass","observedAttributes","manualToggleVisibility","this","getAttribute","init","super","handleCaretOnVisibilityChange","origSetPasswordVisible","baseElement","_setPasswordVisible","origSetFocused","_setFocused","setFocus","bind","initExternalInput","stopRevealButtonEnterPropagation","revealButton","addEventListener","e","key","stopPropagation","querySelector","externalInput","createExternalInput","handlePasswordVisibility","caretPosition","value","length","origTogglePasswordVisibility","_togglePasswordVisibility","setTimeout","setSelectionRange","focused","call","resetPasswordVisibilityToggle","origSetFocus","attributeChangedCallback","attrName","oldValue","newValue","origBoundRevealButtonMouseDown","__boundRevealButtonMouseDown","removeEventListener","_passwordVisibleChanged","showPasswordVisibility","hidePasswordVisibility","input","setAttribute","tz","slots","wrappedEleName","style","_helpers_themeHelpers_resetHelpers__WEBPACK_IMPORTED_MODULE_4__","cy","cssVarList","I4","$J","Kl","excludeAttrsSync","customElements","define","_PasswordClass__WEBPACK_IMPORTED_MODULE_1__","T","M","__WEBPACK_DEFAULT_EXPORT__","isReadOnly","hasAttribute","ele","isDraggable","inputEle","target","prevType","focus","onComplete","_","removeAttribute","once"],"sourceRoot":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[628,2294,3267,4159,9261],{13094(t,e,o){o.r(e),o.d(e,{AnchoredClass:()=>h,componentName:()=>a});var n=o(88961),r=o(72270),s=o(25964),i=o(63200);const a=(0,s.xE)("anchored");class l extends((0,r.qu)({componentName:a,baseSelector:".anchored-root"})){#t=null;#e=null;#o=null;#n=null;get#r(){return this.defaultSlot.assignedElements({flatten:!0})[0]}get#s(){return this.shadowRoot.querySelector('slot[name="anchored"]')?.assignedElements()[0]}get#i(){return this.getRootNode().host}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="anchored-root" part="root">\n <slot></slot>\n <div class="anchored-host" part="anchored">\n <slot name="anchored"></slot>\n </div>\n </div>\n ',this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])")}init(){super.init?.(),(0,s.fz)("\n :host {\n display: inline-flex;\n position: relative;\n box-sizing: border-box;\n }\n\n :host(:not([has-anchor])) {\n display: none;\n }\n\n .anchored-root {\n position: relative;\n display: flex;\n width: 100%;\n min-width: 0;\n }\n\n /* Make anchor fill the flex row and allow it to shrink. */\n ::slotted(*:not([slot])) {\n flex-grow: 1; /* fill the flex row */\n flex-shrink: 1; /* compress when constrained */\n flex-basis: auto; /* start from the anchor's natural size */\n min-width: 0; /* flex items won't shrink below content size without this */\n }\n\n /* Anchored container covers the anchor but is invisible to pointer events. */\n .anchored-host {\n position: absolute;\n inset: 0;\n pointer-events: none;\n }\n\n /* Restore interactivity for actual anchored content. */\n ::slotted([slot=\"anchored\"]) {\n pointer-events: auto;\n }\n ",this),this.#a(),this.defaultSlot.addEventListener("slotchange",()=>this.#l()),this.#l()}#h(){const t=this.#r?.classList?.contains("hidden");this.classList.toggle("hidden",t)}#l(){this.#c(),this.#t=this.#d(this.#t,this.#i,"stretch"),this.#e=this.#d(this.#e,this.#s,"st-host-direction"),this.#p()}#p(){this.#n?.disconnect(),this.#r&&(this.#n=(0,s.mx)(this.#r,()=>this.#h(),{includeAttrs:["class"]}))}connectedCallback(){super.connectedCallback?.(),this.#p(),this.#h()}#a(){const t="\n descope-anchored {\n width: 100%; /* fill the outer host so the anchored element spans the full anchor width */\n }\n :host([stretch]) {\n display: inline-flex; /* switch from inline-block so internal children are flex items */\n width: 100%; /* fill non-flex parents */\n flex-grow: 1; /* absorb extra space in flex parents */\n flex-shrink: 0; /* hold full width — shrink:1 would let siblings squeeze it below 100% */\n flex-basis: auto; /* defer to width:100% on the main axis; avoids forcing 100% height in column-flex parents */\n min-width: 0; /* prevent overflow when the outer host is itself inside a constrained flex row */\n }\n ";this.#o?this.#o.replaceSync(t):this.#i&&(this.#o=(0,s.fz)(t,this.#i))}#d(t,e,o){return t?.disconnect(),e?.removeAttribute(o),this.#r&&e?(0,s.EA)(this.#r,e,{includeAttrs:[o]}):null}disconnectedCallback(){super.disconnectedCallback?.(),this.#t?.disconnect(),this.#e?.disconnect(),this.#n?.disconnect()}#c(){this.toggleAttribute("has-anchor",!!this.#r),this.#h()}}const h=(0,i.Zz)(n.tQ)(l);customElements.define(a,h)},76231(t,e,o){o.d(e,{T:()=>c,m:()=>p});var n=o(92540),r=o(88961),s=o(63200),i=o(36976),a=o(72270),l=o(54847),h=o(25964);const c=(0,h.xE)("enriched-text");class d extends((0,a.qu)({componentName:c,baseSelector:":host > div"})){#u;#m;constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="content"></div>\n ',(0,h.fz)("\n :host {\n line-height: 1em;\n word-break: break-word;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n *, *:last-child {\n margin: 0;\n }\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n p {\n margin-bottom: 1em;\n }\n a {\n cursor: pointer;\n }\n blockquote {\n padding: 0 2em;\n }\n u {\n text-decoration: underline\n }\n s {\n color: currentColor;\n }\n ",this),this.#y(),(0,h.Ge)(this,this.#b.bind(this)),this.contentNode?.addEventListener("click",t=>{t.target instanceof HTMLAnchorElement&&t.stopPropagation()})}static get observedAttributes(){return["readonly","link-target-blank"]}attributeChangedCallback(t,e,o){super.attributeChangedCallback?.(t,e,o),o!==e&&("readonly"===t&&this.onReadOnlyChange("true"===o),"link-target-blank"===t&&this.#y())}customUnderlineRenderer(){this.processor.renderer.rules.em_open=(t,e,o,n,r)=>("_"===t[e].markup&&(t[e].tag="u"),this.#m(t,e,o,n,r)),this.processor.renderer.rules.em_close=(t,e,o,n,r)=>("_"===t[e].markup&&(t[e].tag="u"),this.#m(t,e,o,n,r))}#v(){this.linkTargetBlank?this.processor.renderer.rules.link_open=(t,e,o,n,r)=>(t[e].attrSet("target","_blank"),this.#u(t,e,o,n,r)):this.processor.renderer.rules.link_open=this.#u}#g(){this.processor&&this.processor.disable(i.M)}#f(){this.#g()}#x(){this.#u=this.processor.renderer.rules.link_open||((t,e,o,n,r)=>r.renderToken(t,e,o)),this.#m=this.processor.renderer.rules.em_open||((t,e,o,n,r)=>r.renderToken(t,e,o))}#y(){this.processor=new n.A("commonmark",{html:!0}),this.#x(),this.#f(),this.#v(),this.customUnderlineRenderer()}get linkTargetBlank(){return"true"===this.getAttribute("link-target-blank")}get contentNode(){return this.shadowRoot.querySelector(".content")}#b(){if(!this.processor)return;let t=(0,l.G)(this.innerHTML);!t?.trim()&&this.isConnected?this.setAttribute("empty","true"):this.removeAttribute("empty");try{const e=this.processor.parse(t,{references:void 0});t=this.processor.renderer.render(e,{html:!0,breaks:!0})}catch{console.warn("Not parsing invalid markdown token")}this.contentNode.innerHTML=t,this.contentNode.firstChild?.setAttribute("part","content")}onReadOnlyChange(t){t?this.contentNode.setAttribute("inert",t):this.contentNode.removeAttribute("inert")}}const p=(0,s.Zz)((0,r.RF)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostDisplay:{selector:()=>":host",property:"display",fallback:"inline-block"},hostDirection:{selector:()=>":host",property:"direction"},fontSize:{},fontFamily:{},fontWeight:{},fontWeightBold:[{selector:()=>":host strong",property:"font-weight"},{selector:()=>":host b",property:"font-weight"}],textColor:{property:"color"},textLineHeight:{property:"line-height"},textAlign:{},linkColor:{selector:"a",property:"color"},linkTextDecoration:{selector:"a",property:"text-decoration"},linkHoverTextDecoration:{selector:"a:hover",property:"text-decoration"},minHeight:{},minWidth:{}}}),(0,r.RF)({componentNameOverride:(0,h.xE)("link")}),(0,r.RF)({componentNameOverride:(0,h.xE)("text")}),(0,r.DM)({triggers:[{attr:"full-width",value:"true"}]}),r.VO,r.tQ)(d)},36976(t,e,o){o.d(e,{M:()=>n});const n=["blockquote","list","image","table","code","hr","backticks","fence","reference","heading","lheading","html_block"]},54847(t,e,o){o.d(e,{G:()=>n});const n=t=>{const e=document.createElement("textarea");return e.innerHTML=t,e.value}},55838(t,e,o){o.r(e),o.d(e,{EnrichedTextClass:()=>n.m,componentName:()=>n.T}),o(90512);var n=o(76231);customElements.define(n.T,n.m)},75464(t,e,o){o.d(e,{J:()=>v,T:()=>l});var n=o(88961),r=o(63200),s=o(25964),i=o(72270),a=o(66434);const l=(0,s.xE)("link"),h=["href","readonly"];class c extends((0,i.qu)({componentName:l,baseSelector:":host a"})){static get observedAttributes(){return h.concat(super.observedAttributes||[])}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n\t\t<div>\n\t\t\t<descope-text part="wrapper">\n\t\t\t\t<a>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</a>\n\t\t\t</descope-text>\n\t\t</div>\n\t\t',(0,s.fz)('\n :host {\n\t\t\tdisplay: inline-block;\n line-height: 1em;\n\t\t}\n\t\t:host a {\n\t\t\tdisplay: inline;\n\t\t}\n\n :host([ellipsis="true"]) descope-text {\n display: inline-flex;\n }\n :host([ellipsis="true"]) descope-text::part(text-wrapper) {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n ',this),this.anchor=this.shadowRoot.querySelector("a"),(0,s.EA)(this,this.anchor,{includeAttrs:["href","target","tooltip"],mapAttrs:{tooltip:"title"}}),(0,s.EA)(this,this.shadowRoot.querySelector("descope-text"),{includeAttrs:["mode","variant"]}),this.anchor.addEventListener("click",t=>{this.readOnly&&t.preventDefault()})}get readOnly(){return"true"===this.getAttribute("readonly")}}const d={host:{selector:()=>":host"},link:{selector:()=>":host a"},anchor:{},wrapper:{selector:()=>":host > div"},text:{selector:()=>a.s.componentName}},{anchor:p,text:u,host:m,wrapper:y,link:b}=d,v=(0,r.Zz)((0,n.RF)({mappings:{hostWidth:{...m,property:"width"},hostDirection:{...u,property:"direction"},textAlign:y,textDecoration:{...b,property:"text-decoration",fallback:"none"},textColor:[{...p,property:"color"},{...u,property:a.s.cssVarList.textColor}],cursor:p}}),(0,n.DM)({triggers:[{attr:"full-width",value:"true"}]}),n.VO,n.tQ)(c)},90512(t,e,o){o.r(e),o.d(e,{LinkClass:()=>n.J,componentName:()=>n.T});var n=o(75464);o(63595),customElements.define(n.T,n.J)},66434(t,e,o){o.d(e,{T:()=>a,s:()=>c});var n=o(88961),r=o(63200),s=o(25964),i=o(72270);const a=(0,s.xE)("text");class l extends((0,i.qu)({componentName:a,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <slot part="text-wrapper"></slot>\n ',(0,s.fz)("\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n ",this)}get hideWhenEmpty(){return"true"===this.getAttribute("hide-when-empty")}init(){super.init(),(0,s.Ge)(this,()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""})}}const{host:h}={host:{selector:()=>":host"}},c=(0,r.Zz)((0,n.RF)({mappings:{hostWidth:{...h,property:"width"},hostDirection:{...h,property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),(0,n.DM)({triggers:[{attr:"full-width",value:"true"}]}),n.VO,n.tQ)(l)},63595(t,e,o){o.r(e),o.d(e,{TextClass:()=>n.s,componentName:()=>n.T});var n=o(66434);customElements.define(n.T,n.s)},54240(t,e,o){o.r(e),o.d(e,{TooltipClass:()=>u,componentName:()=>l}),o(13094),o(55838),o(57760);var n=o(88961),r=o(63200),s=o(25964),i=o(72270),a=o(76231);const l=(0,s.xE)("tooltip"),h=["text","position","hide-delay","hover-delay","opened"];class c extends((0,i.qu)({componentName:l,baseSelector:"vaadin-tooltip"})){#C=null;constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <descope-anchored>\n <slot></slot>\n <vaadin-tooltip slot="anchored"></vaadin-tooltip>\n </descope-anchored>\n ',this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])"),this.tooltip=this.shadowRoot.querySelector("vaadin-tooltip"),this.anchored=this.shadowRoot.querySelector("descope-anchored")}#h(){const t=this.anchored?.classList?.contains("hidden");this.classList.toggle("hidden",t)}static get observedAttributes(){return h.concat(super.observedAttributes||[])}get isOpened(){return"true"===this.getAttribute("opened")}get overlay(){return this.tooltip?._overlayElement}get overlayContentNode(){return this.overlay?.shadowRoot.querySelector('[part="content"]')}get tooltipText(){return this.getAttribute("text")?.trim()||""}get isStaticDisplay(){return"true"===this.getAttribute("static-display")}get srLabel(){return this.tooltip?.querySelector('[slot="sr-label"]')}#k(){this.isStaticDisplay?(this.#w(),this.setAttribute("inert","true")):this.removeAttribute("inert")}#w(){this.overlay&&(this.overlay.style.display="block",this.overlay.style.position="static")}init(){super.init?.(),(0,s.fz)('\n :host {\n display: inline-block;\n }\n vaadin-tooltip {\n display: block;\n position: absolute;\n width: 0;\n height: 0;\n overflow: hidden;\n }\n /* Stack anchor above the anchored element so the tooltip flows below it inline. */\n :host([static-display="true"]) descope-anchored::part(root) {\n flex-direction: column;\n }\n :host([static-display="true"]) descope-anchored::part(anchored) {\n position: static;\n inset: unset;\n }\n :host([static-display="true"]) vaadin-tooltip {\n position: static;\n width: auto;\n height: auto;\n overflow: visible;\n }\n :host([static-display="true"]) vaadin-tooltip [slot="sr-label"] {\n display: none;\n }\n',this),this.defaultSlot.addEventListener("slotchange",()=>this.#S()),this.#S(),setTimeout(()=>this.#A())}#T(){this.#C?.disconnect(),this.anchored&&(this.#C=(0,s.mx)(this.anchored,()=>this.#h(),{includeAttrs:["class"]}))}connectedCallback(){super.connectedCallback?.(),this.#h(),this.#T()}disconnectedCallback(){super.disconnectedCallback?.(),this.#C?.disconnect()}#S(){const t=this.defaultSlot?.assignedElements()?.[0];t&&(this.tooltip.target=t)}#A(){this.#O(),this.#R(),(0,s.EA)(this,this.tooltip,{includeAttrs:["position","opened"]}),this.#L()}#E(){this.overlayContentNode.innerHTML=""}#N(){const t=document.createElement("descope-enriched-text");return t.setAttribute("link-target-blank","true"),t.textContent=this.tooltipText,t}#O(){this.overlayContentNode&&setTimeout(()=>{this.#E(),this.textComponent=this.#N(),this.overlayContentNode.appendChild(this.textComponent),this.srLabel&&!this.tooltipText&&this.srLabel.setAttribute("aria-hidden","true"),(0,s.EA)(this,this.textComponent,{includeAttrs:["readonly"]})})}#R(){if(!this.overlay)return;const t=this.overlay._attachOverlay?.bind(this.overlay);this.overlay._detachOverlay=()=>{},this.overlay._attachOverlay=()=>{t?.(),setTimeout(()=>{this.tooltip.shadowRoot.appendChild(this.overlay),this.overlay._updatePosition?.()})},this.isOpened&&setTimeout(()=>{this.tooltip.shadowRoot.appendChild(this.overlay),this.#k(),this.overlay._updatePosition?.()})}#L(){this.tooltip?.toggleAttribute("manual",this.isOpened)}#_(t){if(!this.textComponent)return;const e=(t??"").trim();this.textComponent.textContent=e,this.srLabel&&(e?this.srLabel.removeAttribute("aria-hidden"):this.srLabel.setAttribute("aria-hidden","true"))}attributeChangedCallback(t,e,o){super.attributeChangedCallback?.(t,e,o),e!==o&&("text"===t&&this.#_(o),"opened"===t&&this.#L())}}const{overlay:d,content:p}={overlay:{selector:()=>"vaadin-tooltip-overlay::part(overlay)"},content:{selector:()=>"vaadin-tooltip-overlay::part(content)"}},u=(0,r.Zz)(n.tQ,(0,n.mA)({selector:"",mappings:{fontFamily:{...p,property:a.m.cssVarList.fontFamilyOverride},fontSize:{...p,property:a.m.cssVarList.fontSizeOverride},fontWeight:{...p,property:a.m.cssVarList.fontWeightOverride},textColor:{...p,property:a.m.cssVarList.textColorOverride},hostDirection:{...p,property:a.m.cssVarList.hostDirectionOverride},backgroundColor:[{...d},{...p}],borderColor:{...d},borderStyle:{...d},borderWidth:{...d},borderRadius:{...d},boxShadow:{...d},horizontalPadding:[{...p,property:"padding-left"},{...p,property:"padding-right"}],verticalPadding:[{...p,property:"padding-top"},{...p,property:"padding-bottom"}]},forward:{attributes:["style"],include:!1}}))(c);customElements.define(l,u)}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[628,2294,3267,4159,9261],{13094(t,e,o){o.r(e),o.d(e,{AnchoredClass:()=>h,componentName:()=>a});var n=o(88961),r=o(72270),s=o(25964),i=o(63200);const a=(0,s.xE)("anchored");class l extends((0,r.qu)({componentName:a,baseSelector:".anchored-root"})){#t=null;#e=null;#o=null;#n=null;get#r(){return this.defaultSlot.assignedElements({flatten:!0})[0]}get#s(){return this.shadowRoot.querySelector('slot[name="anchored"]')?.assignedElements()[0]}get#i(){return this.getRootNode().host}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="anchored-root" part="root">\n <slot></slot>\n <div class="anchored-host" part="anchored">\n <slot name="anchored"></slot>\n </div>\n </div>\n ',this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])")}init(){super.init?.(),(0,s.fz)("\n :host {\n display: inline-flex;\n position: relative;\n box-sizing: border-box;\n }\n\n :host(:not([has-anchor])) {\n display: none;\n }\n\n .anchored-root {\n position: relative;\n display: flex;\n width: 100%;\n min-width: 0;\n }\n\n /* Make anchor fill the flex row and allow it to shrink. */\n ::slotted(*:not([slot])) {\n flex-grow: 1; /* fill the flex row */\n flex-shrink: 1; /* compress when constrained */\n flex-basis: auto; /* start from the anchor's natural size */\n min-width: 0; /* flex items won't shrink below content size without this */\n }\n\n /* Anchored container covers the anchor but is invisible to pointer events. */\n .anchored-host {\n position: absolute;\n inset: 0;\n pointer-events: none;\n }\n\n /* Restore interactivity for actual anchored content. */\n ::slotted([slot=\"anchored\"]) {\n pointer-events: auto;\n }\n ",this),this.#a(),this.defaultSlot.addEventListener("slotchange",()=>this.#l()),this.#l()}#h(){const t=this.#r?.classList?.contains("hidden");this.classList.toggle("hidden",t)}#l(){this.#c(),this.#t=this.#d(this.#t,this.#i,"stretch"),this.#e=this.#d(this.#e,this.#s,"st-host-direction"),this.#p()}#p(){this.#n?.disconnect(),this.#r&&(this.#n=(0,s.mx)(this.#r,()=>this.#h(),{includeAttrs:["class"]}))}connectedCallback(){super.connectedCallback?.(),this.#p(),this.#h()}#a(){const t="\n descope-anchored {\n width: 100%; /* fill the outer host so the anchored element spans the full anchor width */\n }\n :host([stretch]) {\n display: inline-flex; /* switch from inline-block so internal children are flex items */\n width: 100%; /* fill non-flex parents */\n flex-grow: 1; /* absorb extra space in flex parents */\n flex-shrink: 0; /* hold full width — shrink:1 would let siblings squeeze it below 100% */\n flex-basis: auto; /* defer to width:100% on the main axis; avoids forcing 100% height in column-flex parents */\n min-width: 0; /* prevent overflow when the outer host is itself inside a constrained flex row */\n }\n ";this.#o?this.#o.replaceSync(t):this.#i&&(this.#o=(0,s.fz)(t,this.#i))}#d(t,e,o){return t?.disconnect(),e?.removeAttribute(o),this.#r&&e?(0,s.EA)(this.#r,e,{includeAttrs:[o]}):null}disconnectedCallback(){super.disconnectedCallback?.(),this.#t?.disconnect(),this.#e?.disconnect(),this.#n?.disconnect()}#c(){this.toggleAttribute("has-anchor",!!this.#r),this.#h()}}const h=(0,i.Zz)(n.tQ)(l);customElements.define(a,h)},76231(t,e,o){o.d(e,{T:()=>c,m:()=>p});var n=o(92540),r=o(88961),s=o(63200),i=o(36976),a=o(72270),l=o(54847),h=o(25964);const c=(0,h.xE)("enriched-text");class d extends((0,a.qu)({componentName:c,baseSelector:":host > div"})){#u;#m;constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="content"></div>\n ',(0,h.fz)("\n :host {\n line-height: 1em;\n word-break: break-word;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n *, *:last-child {\n margin: 0;\n }\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n p {\n margin-bottom: 1em;\n }\n a {\n cursor: pointer;\n }\n blockquote {\n padding: 0 2em;\n }\n u {\n text-decoration: underline\n }\n s {\n color: currentColor;\n }\n ",this),this.#y(),(0,h.Ge)(this,this.#b.bind(this)),this.contentNode?.addEventListener("click",t=>{t.target instanceof HTMLAnchorElement&&t.stopPropagation()}),this.contentNode?.addEventListener("keydown",t=>{"Enter"===t.key&&t.target instanceof HTMLAnchorElement&&t.stopPropagation()})}static get observedAttributes(){return["readonly","link-target-blank"]}attributeChangedCallback(t,e,o){super.attributeChangedCallback?.(t,e,o),o!==e&&("readonly"===t&&this.onReadOnlyChange("true"===o),"link-target-blank"===t&&this.#y())}customUnderlineRenderer(){this.processor.renderer.rules.em_open=(t,e,o,n,r)=>("_"===t[e].markup&&(t[e].tag="u"),this.#m(t,e,o,n,r)),this.processor.renderer.rules.em_close=(t,e,o,n,r)=>("_"===t[e].markup&&(t[e].tag="u"),this.#m(t,e,o,n,r))}#v(){this.linkTargetBlank?this.processor.renderer.rules.link_open=(t,e,o,n,r)=>(t[e].attrSet("target","_blank"),this.#u(t,e,o,n,r)):this.processor.renderer.rules.link_open=this.#u}#g(){this.processor&&this.processor.disable(i.M)}#f(){this.#g()}#x(){this.#u=this.processor.renderer.rules.link_open||((t,e,o,n,r)=>r.renderToken(t,e,o)),this.#m=this.processor.renderer.rules.em_open||((t,e,o,n,r)=>r.renderToken(t,e,o))}#y(){this.processor=new n.A("commonmark",{html:!0}),this.#x(),this.#f(),this.#v(),this.customUnderlineRenderer()}get linkTargetBlank(){return"true"===this.getAttribute("link-target-blank")}get contentNode(){return this.shadowRoot.querySelector(".content")}#b(){if(!this.processor)return;let t=(0,l.G)(this.innerHTML);!t?.trim()&&this.isConnected?this.setAttribute("empty","true"):this.removeAttribute("empty");try{const e=this.processor.parse(t,{references:void 0});t=this.processor.renderer.render(e,{html:!0,breaks:!0})}catch{console.warn("Not parsing invalid markdown token")}this.contentNode.innerHTML=t,this.contentNode.firstChild?.setAttribute("part","content")}onReadOnlyChange(t){t?this.contentNode.setAttribute("inert",t):this.contentNode.removeAttribute("inert")}}const p=(0,s.Zz)((0,r.RF)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostDisplay:{selector:()=>":host",property:"display",fallback:"inline-block"},hostDirection:{selector:()=>":host",property:"direction"},fontSize:{},fontFamily:{},fontWeight:{},fontWeightBold:[{selector:()=>":host strong",property:"font-weight"},{selector:()=>":host b",property:"font-weight"}],textColor:{property:"color"},textLineHeight:{property:"line-height"},textAlign:{},linkColor:{selector:"a",property:"color"},linkTextDecoration:{selector:"a",property:"text-decoration"},linkHoverTextDecoration:{selector:"a:hover",property:"text-decoration"},minHeight:{},minWidth:{}}}),(0,r.RF)({componentNameOverride:(0,h.xE)("link")}),(0,r.RF)({componentNameOverride:(0,h.xE)("text")}),(0,r.DM)({triggers:[{attr:"full-width",value:"true"}]}),r.VO,r.tQ)(d)},36976(t,e,o){o.d(e,{M:()=>n});const n=["blockquote","list","image","table","code","hr","backticks","fence","reference","heading","lheading","html_block"]},54847(t,e,o){o.d(e,{G:()=>n});const n=t=>{const e=document.createElement("textarea");return e.innerHTML=t,e.value}},55838(t,e,o){o.r(e),o.d(e,{EnrichedTextClass:()=>n.m,componentName:()=>n.T}),o(90512);var n=o(76231);customElements.define(n.T,n.m)},75464(t,e,o){o.d(e,{J:()=>v,T:()=>l});var n=o(88961),r=o(63200),s=o(25964),i=o(72270),a=o(66434);const l=(0,s.xE)("link"),h=["href","readonly"];class c extends((0,i.qu)({componentName:l,baseSelector:":host a"})){static get observedAttributes(){return h.concat(super.observedAttributes||[])}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n\t\t<div>\n\t\t\t<descope-text part="wrapper">\n\t\t\t\t<a>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</a>\n\t\t\t</descope-text>\n\t\t</div>\n\t\t',(0,s.fz)('\n :host {\n\t\t\tdisplay: inline-block;\n line-height: 1em;\n\t\t}\n\t\t:host a {\n\t\t\tdisplay: inline;\n\t\t}\n\n :host([ellipsis="true"]) descope-text {\n display: inline-flex;\n }\n :host([ellipsis="true"]) descope-text::part(text-wrapper) {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n ',this),this.anchor=this.shadowRoot.querySelector("a"),(0,s.EA)(this,this.anchor,{includeAttrs:["href","target","tooltip"],mapAttrs:{tooltip:"title"}}),(0,s.EA)(this,this.shadowRoot.querySelector("descope-text"),{includeAttrs:["mode","variant"]}),this.anchor.addEventListener("click",t=>{this.readOnly&&t.preventDefault()})}get readOnly(){return"true"===this.getAttribute("readonly")}}const d={host:{selector:()=>":host"},link:{selector:()=>":host a"},anchor:{},wrapper:{selector:()=>":host > div"},text:{selector:()=>a.s.componentName}},{anchor:p,text:u,host:m,wrapper:y,link:b}=d,v=(0,r.Zz)((0,n.RF)({mappings:{hostWidth:{...m,property:"width"},hostDirection:{...u,property:"direction"},textAlign:y,textDecoration:{...b,property:"text-decoration",fallback:"none"},textColor:[{...p,property:"color"},{...u,property:a.s.cssVarList.textColor}],cursor:p}}),(0,n.DM)({triggers:[{attr:"full-width",value:"true"}]}),n.VO,n.tQ)(c)},90512(t,e,o){o.r(e),o.d(e,{LinkClass:()=>n.J,componentName:()=>n.T});var n=o(75464);o(63595),customElements.define(n.T,n.J)},66434(t,e,o){o.d(e,{T:()=>a,s:()=>c});var n=o(88961),r=o(63200),s=o(25964),i=o(72270);const a=(0,s.xE)("text");class l extends((0,i.qu)({componentName:a,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <slot part="text-wrapper"></slot>\n ',(0,s.fz)("\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n ",this)}get hideWhenEmpty(){return"true"===this.getAttribute("hide-when-empty")}init(){super.init(),(0,s.Ge)(this,()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""})}}const{host:h}={host:{selector:()=>":host"}},c=(0,r.Zz)((0,n.RF)({mappings:{hostWidth:{...h,property:"width"},hostDirection:{...h,property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),(0,n.DM)({triggers:[{attr:"full-width",value:"true"}]}),n.VO,n.tQ)(l)},63595(t,e,o){o.r(e),o.d(e,{TextClass:()=>n.s,componentName:()=>n.T});var n=o(66434);customElements.define(n.T,n.s)},54240(t,e,o){o.r(e),o.d(e,{TooltipClass:()=>u,componentName:()=>l}),o(13094),o(55838),o(57760);var n=o(88961),r=o(63200),s=o(25964),i=o(72270),a=o(76231);const l=(0,s.xE)("tooltip"),h=["text","position","hide-delay","hover-delay","opened"];class c extends((0,i.qu)({componentName:l,baseSelector:"vaadin-tooltip"})){#k=null;constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <descope-anchored>\n <slot></slot>\n <vaadin-tooltip slot="anchored"></vaadin-tooltip>\n </descope-anchored>\n ',this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])"),this.tooltip=this.shadowRoot.querySelector("vaadin-tooltip"),this.anchored=this.shadowRoot.querySelector("descope-anchored")}#h(){const t=this.anchored?.classList?.contains("hidden");this.classList.toggle("hidden",t)}static get observedAttributes(){return h.concat(super.observedAttributes||[])}get isOpened(){return"true"===this.getAttribute("opened")}get overlay(){return this.tooltip?._overlayElement}get overlayContentNode(){return this.overlay?.shadowRoot.querySelector('[part="content"]')}get tooltipText(){return this.getAttribute("text")?.trim()||""}get isStaticDisplay(){return"true"===this.getAttribute("static-display")}get srLabel(){return this.tooltip?.querySelector('[slot="sr-label"]')}#C(){this.isStaticDisplay?(this.#w(),this.setAttribute("inert","true")):this.removeAttribute("inert")}#w(){this.overlay&&(this.overlay.style.display="block",this.overlay.style.position="static")}init(){super.init?.(),(0,s.fz)('\n :host {\n display: inline-block;\n }\n vaadin-tooltip {\n display: block;\n position: absolute;\n width: 0;\n height: 0;\n overflow: hidden;\n }\n /* Stack anchor above the anchored element so the tooltip flows below it inline. */\n :host([static-display="true"]) descope-anchored::part(root) {\n flex-direction: column;\n }\n :host([static-display="true"]) descope-anchored::part(anchored) {\n position: static;\n inset: unset;\n }\n :host([static-display="true"]) vaadin-tooltip {\n position: static;\n width: auto;\n height: auto;\n overflow: visible;\n }\n :host([static-display="true"]) vaadin-tooltip [slot="sr-label"] {\n display: none;\n }\n',this),this.defaultSlot.addEventListener("slotchange",()=>this.#S()),this.#S(),setTimeout(()=>this.#A())}#T(){this.#k?.disconnect(),this.anchored&&(this.#k=(0,s.mx)(this.anchored,()=>this.#h(),{includeAttrs:["class"]}))}connectedCallback(){super.connectedCallback?.(),this.#h(),this.#T()}disconnectedCallback(){super.disconnectedCallback?.(),this.#k?.disconnect()}#S(){const t=this.defaultSlot?.assignedElements()?.[0];t&&(this.tooltip.target=t)}#A(){this.#O(),this.#L(),(0,s.EA)(this,this.tooltip,{includeAttrs:["position","opened"]}),this.#R()}#E(){this.overlayContentNode.innerHTML=""}#N(){const t=document.createElement("descope-enriched-text");return t.setAttribute("link-target-blank","true"),t.textContent=this.tooltipText,t}#O(){this.overlayContentNode&&setTimeout(()=>{this.#E(),this.textComponent=this.#N(),this.overlayContentNode.appendChild(this.textComponent),this.srLabel&&!this.tooltipText&&this.srLabel.setAttribute("aria-hidden","true"),(0,s.EA)(this,this.textComponent,{includeAttrs:["readonly"]})})}#L(){if(!this.overlay)return;const t=this.overlay._attachOverlay?.bind(this.overlay);this.overlay._detachOverlay=()=>{},this.overlay._attachOverlay=()=>{t?.(),setTimeout(()=>{this.tooltip.shadowRoot.appendChild(this.overlay),this.overlay._updatePosition?.()})},this.isOpened&&setTimeout(()=>{this.tooltip.shadowRoot.appendChild(this.overlay),this.#C(),this.overlay._updatePosition?.()})}#R(){this.tooltip?.toggleAttribute("manual",this.isOpened)}#_(t){if(!this.textComponent)return;const e=(t??"").trim();this.textComponent.textContent=e,this.srLabel&&(e?this.srLabel.removeAttribute("aria-hidden"):this.srLabel.setAttribute("aria-hidden","true"))}attributeChangedCallback(t,e,o){super.attributeChangedCallback?.(t,e,o),e!==o&&("text"===t&&this.#_(o),"opened"===t&&this.#R())}}const{overlay:d,content:p}={overlay:{selector:()=>"vaadin-tooltip-overlay::part(overlay)"},content:{selector:()=>"vaadin-tooltip-overlay::part(content)"}},u=(0,r.Zz)(n.tQ,(0,n.mA)({selector:"",mappings:{fontFamily:{...p,property:a.m.cssVarList.fontFamilyOverride},fontSize:{...p,property:a.m.cssVarList.fontSizeOverride},fontWeight:{...p,property:a.m.cssVarList.fontWeightOverride},textColor:{...p,property:a.m.cssVarList.textColorOverride},hostDirection:{...p,property:a.m.cssVarList.hostDirectionOverride},backgroundColor:[{...d},{...p}],borderColor:{...d},borderStyle:{...d},borderWidth:{...d},borderRadius:{...d},boxShadow:{...d},horizontalPadding:[{...p,property:"padding-left"},{...p,property:"padding-right"}],verticalPadding:[{...p,property:"padding-top"},{...p,property:"padding-bottom"}]},forward:{attributes:["style"],include:!1}}))(c);customElements.define(l,u)}}]);
|
|
2
2
|
//# sourceMappingURL=descope-tooltip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descope-tooltip.js","mappings":"iQAUO,MAAAA,GAAsB,EAAAC,EAAAC,IAAgB,YAE7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G,EACApG,SAAkBP,EAAAmC,EAAiBoB,WAAA2D,uBAEnCC,gBAAA,KAA0BpC,GAAY,IAAI4B,IAC1ClC,YAAA,IAAqBM,GACrBP,YAAA,IAAqBO,GACrBR,YAAA,IAAqBQ,GACrBqC,aAAA,IAAsBrC,GACtBsC,UAAA,IAAmBtC,GACnBuC,kBAAA,CACA,IAAUX,EAAApG,SAAA,gBACV,IAAUoG,EAAApG,SAAA,kBAEVgH,gBAAA,CACA,IAAUZ,EAAApG,SAAA,eACV,IAAUoG,EAAApG,SAAA,oBAGViH,QAAA,CACAC,WAAA,UACAC,SAAA,KA1C4B,CA6C5B9C,GCjVA5I,eAAAC,OAAsB3D,EAAesO","sources":["webpack://@descope/web-components-ui/../components/descope-anchored/src/component/AnchoredClass.js","webpack://@descope/web-components-ui/../components/descope-anchored/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/EnrichedTextClass.js","webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/consts.js","webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/helpers.js","webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-link/src/component/LinkClass.js","webpack://@descope/web-components-ui/../components/descope-link/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/TextClass.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-tooltip/src/component/TooltipClass.js","webpack://@descope/web-components-ui/../components/descope-tooltip/src/component/index.js"],"sourcesContent":["import { componentNameValidationMixin } from '@descope-ui/common/components-mixins';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport {\n forwardAttrs,\n getComponentName,\n injectStyle,\n observeAttributes,\n} from '@descope-ui/common/components-helpers';\nimport { compose } from '@descope-ui/common/utils';\n\nexport const componentName = getComponentName('anchored');\n\nclass RawAnchored extends createBaseClass({\n componentName,\n baseSelector: '.anchored-root',\n}) {\n #stretchObserver = null;\n\n #directionObserver = null;\n\n #hostStretchSheet = null;\n\n // Observes the anchor's `class` attribute so runtime updates by the SDK\n // (e.g. real-time conditional components toggling `.hidden`) propagate to\n // this element. Without this, only the initial slotchange would sync.\n #anchorClassObserver = null;\n\n get #anchor() {\n return this.defaultSlot.assignedElements({ flatten: true })[0];\n }\n\n get #anchored() {\n return this.shadowRoot\n .querySelector('slot[name=\"anchored\"]')\n ?.assignedElements()[0];\n }\n\n get #outerHost() {\n return this.getRootNode().host;\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"anchored-root\" part=\"root\">\n <slot></slot>\n <div class=\"anchored-host\" part=\"anchored\">\n <slot name=\"anchored\"></slot>\n </div>\n </div>\n `;\n\n this.defaultSlot = this.shadowRoot.querySelector('slot:not([name])');\n }\n\n init() {\n super.init?.();\n\n injectStyle(\n `\n :host {\n display: inline-flex;\n position: relative;\n box-sizing: border-box;\n }\n\n :host(:not([has-anchor])) {\n display: none;\n }\n\n .anchored-root {\n position: relative;\n display: flex;\n width: 100%;\n min-width: 0;\n }\n\n /* Make anchor fill the flex row and allow it to shrink. */\n ::slotted(*:not([slot])) {\n flex-grow: 1; /* fill the flex row */\n flex-shrink: 1; /* compress when constrained */\n flex-basis: auto; /* start from the anchor's natural size */\n min-width: 0; /* flex items won't shrink below content size without this */\n }\n\n /* Anchored container covers the anchor but is invisible to pointer events. */\n .anchored-host {\n position: absolute;\n inset: 0;\n pointer-events: none;\n }\n\n /* Restore interactivity for actual anchored content. */\n ::slotted([slot=\"anchored\"]) {\n pointer-events: auto;\n }\n `,\n this,\n );\n\n this.#syncStretchCSS();\n\n this.defaultSlot.addEventListener('slotchange', () => this.#syncAnchor());\n\n this.#syncAnchor();\n }\n\n // To support conditional components in flow, we need to sync the 'hidden' className to the root of the component.\n // Ideally, this would happen in the SDK, but we resolved to this patch to fix the issue without forcing users to update SDKs.\n #syncComponentState() {\n const hasHidden = this.#anchor?.classList?.contains('hidden');\n this.classList.toggle('hidden', hasHidden);\n }\n\n #syncAnchor() {\n this.#onAnchorChanged();\n\n this.#stretchObserver = this.#forwardAttr(\n this.#stretchObserver,\n this.#outerHost,\n 'stretch',\n );\n\n this.#directionObserver = this.#forwardAttr(\n this.#directionObserver,\n this.#anchored,\n 'st-host-direction',\n );\n\n this.#observeAnchorClass();\n }\n\n #observeAnchorClass() {\n this.#anchorClassObserver?.disconnect();\n if (this.#anchor) {\n this.#anchorClassObserver = observeAttributes(\n this.#anchor,\n () => this.#syncComponentState(),\n { includeAttrs: ['class'] },\n );\n }\n }\n\n // createBaseClass gates init() to first-connect (#isInit). Without\n // re-observing here, runtime `.hidden` toggles stop syncing after a\n // detach/reattach cycle.\n connectedCallback() {\n super.connectedCallback?.();\n this.#observeAnchorClass();\n this.#syncComponentState();\n }\n\n // Injects [stretch] layout rules into the containing component's shadow root (e.g. descope-attachment)\n // so it stretches when the anchor has [stretch]. Replaces the existing rules on subsequent calls.\n #syncStretchCSS() {\n const css = `\n descope-anchored {\n width: 100%; /* fill the outer host so the anchored element spans the full anchor width */\n }\n :host([stretch]) {\n display: inline-flex; /* switch from inline-block so internal children are flex items */\n width: 100%; /* fill non-flex parents */\n flex-grow: 1; /* absorb extra space in flex parents */\n flex-shrink: 0; /* hold full width — shrink:1 would let siblings squeeze it below 100% */\n flex-basis: auto; /* defer to width:100% on the main axis; avoids forcing 100% height in column-flex parents */\n min-width: 0; /* prevent overflow when the outer host is itself inside a constrained flex row */\n }\n `;\n\n if (this.#hostStretchSheet) {\n this.#hostStretchSheet.replaceSync(css);\n } else if (this.#outerHost) {\n this.#hostStretchSheet = injectStyle(css, this.#outerHost);\n }\n }\n\n // Reconnects forwarding to the current anchor. Disconnects the old observer and\n // removes the stale attr from target first — forwardAttrs only sets attrs present\n // on the source, so absent attrs won't be removed automatically.\n #forwardAttr(observer, target, attr) {\n observer?.disconnect();\n target?.removeAttribute(attr);\n if (!this.#anchor || !target) return null;\n return forwardAttrs(this.#anchor, target, { includeAttrs: [attr] });\n }\n\n // Prevent stale callbacks from firing on a detached anchor after removal.\n disconnectedCallback() {\n super.disconnectedCallback?.();\n this.#stretchObserver?.disconnect();\n this.#directionObserver?.disconnect();\n this.#anchorClassObserver?.disconnect();\n }\n\n // Track whether anything is slotted, so the host display rule can hide an\n // empty host rather than reserving its layout box.\n #onAnchorChanged() {\n this.toggleAttribute('has-anchor', !!this.#anchor);\n this.#syncComponentState();\n }\n}\n\nexport const AnchoredClass = compose(componentNameValidationMixin)(RawAnchored);\n","import { componentName, AnchoredClass } from './AnchoredClass';\n\ncustomElements.define(componentName, AnchoredClass);\n\nexport { AnchoredClass, componentName };\n","import MarkdownIt from 'markdown-it';\nimport {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n stretchMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport { disableRules } from './consts';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { decodeHTML } from './helpers';\nimport {\n getComponentName,\n injectStyle,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('enriched-text');\n\nclass EnrichedText extends createBaseClass({\n componentName,\n baseSelector: ':host > div',\n}) {\n #origLinkRenderer;\n\n #origEmRenderer;\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"content\"></div>\n `;\n\n injectStyle(\n `\n :host {\n line-height: 1em;\n word-break: break-word;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n *, *:last-child {\n margin: 0;\n }\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n p {\n margin-bottom: 1em;\n }\n a {\n cursor: pointer;\n }\n blockquote {\n padding: 0 2em;\n }\n u {\n text-decoration: underline\n }\n s {\n color: currentColor;\n }\n `,\n this,\n );\n\n this.#initProcessor();\n\n observeChildren(this, this.#parseChildren.bind(this));\n\n // Stop propagation on link clicks to prevent parent handlers from firing\n this.contentNode?.addEventListener('click', (e) => {\n if (e.target instanceof HTMLAnchorElement) {\n e.stopPropagation();\n }\n });\n }\n\n static get observedAttributes() {\n return ['readonly', 'link-target-blank'];\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (newValue !== oldValue) {\n if (attrName === 'readonly') {\n this.onReadOnlyChange(newValue === 'true');\n }\n\n if (attrName === 'link-target-blank') {\n this.#initProcessor();\n }\n }\n }\n\n // We're overriding the rule for em with single underscore to perform as underline. (_underline_)\n customUnderlineRenderer() {\n this.processor.renderer.rules.em_open = (\n tokens,\n idx,\n options,\n env,\n self,\n ) => {\n if (tokens[idx].markup === '_') tokens[idx].tag = 'u';\n return this.#origEmRenderer(tokens, idx, options, env, self);\n };\n this.processor.renderer.rules.em_close = (\n tokens,\n idx,\n options,\n env,\n self,\n ) => {\n if (tokens[idx].markup === '_') tokens[idx].tag = 'u';\n return this.#origEmRenderer(tokens, idx, options, env, self);\n };\n }\n\n #customizeLinkRenderer() {\n if (this.linkTargetBlank) {\n this.processor.renderer.rules.link_open = (\n tokens,\n idx,\n options,\n env,\n self,\n ) => {\n // Add a new `target` attribute, or replace the value of the existing one.\n tokens[idx].attrSet('target', '_blank');\n // Pass the token to the default renderer.\n return this.#origLinkRenderer(tokens, idx, options, env, self);\n };\n } else {\n this.processor.renderer.rules.link_open = this.#origLinkRenderer;\n }\n }\n\n #disableCustomRules() {\n if (!this.processor) {\n return;\n }\n this.processor.disable(disableRules);\n }\n\n #updateProcessorRules() {\n this.#disableCustomRules();\n }\n\n #storeOrigRenderers() {\n const defaultLinkRenderer = (tokens, idx, options, _, self) =>\n self.renderToken(tokens, idx, options);\n this.#origLinkRenderer =\n this.processor.renderer.rules.link_open || defaultLinkRenderer;\n\n const defaultStrongRenderer = (tokens, idx, options, _, self) =>\n self.renderToken(tokens, idx, options);\n this.#origEmRenderer =\n this.processor.renderer.rules.em_open || defaultStrongRenderer;\n }\n\n #initProcessor() {\n this.processor = new MarkdownIt('commonmark', { html: true });\n this.#storeOrigRenderers();\n this.#updateProcessorRules();\n this.#customizeLinkRenderer();\n this.customUnderlineRenderer();\n }\n\n get linkTargetBlank() {\n return this.getAttribute('link-target-blank') === 'true';\n }\n\n get contentNode() {\n return this.shadowRoot.querySelector('.content');\n }\n\n #parseChildren() {\n if (!this.processor) {\n return;\n }\n\n let html = decodeHTML(this.innerHTML);\n\n if (!html?.trim() && this.isConnected) {\n this.setAttribute('empty', 'true');\n } else {\n this.removeAttribute('empty');\n }\n\n try {\n const tokens = this.processor.parse(html, { references: undefined });\n html = this.processor.renderer.render(tokens, {\n html: true,\n breaks: true,\n });\n } catch {\n console.warn('Not parsing invalid markdown token');\n }\n\n this.contentNode.innerHTML = html;\n this.contentNode.firstChild?.setAttribute('part', 'content');\n }\n\n onReadOnlyChange(isReadOnly) {\n if (isReadOnly) {\n this.contentNode.setAttribute('inert', isReadOnly);\n } else {\n this.contentNode.removeAttribute('inert');\n }\n }\n}\n\nexport const EnrichedTextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: () => ':host', property: 'width' },\n hostDisplay: {\n selector: () => ':host',\n property: 'display',\n fallback: 'inline-block',\n },\n hostDirection: { selector: () => ':host', property: 'direction' },\n fontSize: {},\n fontFamily: {},\n fontWeight: {},\n fontWeightBold: [\n { selector: () => ':host strong', property: 'font-weight' },\n { selector: () => ':host b', property: 'font-weight' },\n ],\n textColor: { property: 'color' },\n textLineHeight: { property: 'line-height' },\n textAlign: {},\n linkColor: { selector: 'a', property: 'color' },\n linkTextDecoration: { selector: 'a', property: 'text-decoration' },\n linkHoverTextDecoration: {\n selector: 'a:hover',\n property: 'text-decoration',\n },\n minHeight: {},\n minWidth: {},\n },\n }),\n createStyleMixin({ componentNameOverride: getComponentName('link') }),\n createStyleMixin({ componentNameOverride: getComponentName('text') }),\n stretchMixin({ triggers: [{ attr: 'full-width', value: 'true' }] }),\n draggableMixin,\n componentNameValidationMixin,\n)(EnrichedText);\n","export const disableRules = [\n 'blockquote',\n 'list',\n 'image',\n 'table',\n 'code',\n 'hr',\n 'backticks',\n 'fence',\n 'reference',\n 'heading',\n 'lheading',\n 'html_block',\n];\n","export const decodeHTML = (html) => {\n const textArea = document.createElement('textarea');\n textArea.innerHTML = html;\n return textArea.value;\n};\n","import '@descope-ui/descope-link';\n\nimport { componentName, EnrichedTextClass } from './EnrichedTextClass';\n\ncustomElements.define(componentName, EnrichedTextClass);\n\nexport { EnrichedTextClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n stretchMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n forwardAttrs,\n injectStyle,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { TextClass } from '@descope-ui/descope-text/class';\n\nexport const componentName = getComponentName('link');\n\nconst observedAttrs = ['href', 'readonly'];\n\nclass RawLink extends createBaseClass({\n componentName,\n baseSelector: ':host a',\n}) {\n static get observedAttributes() {\n return observedAttrs.concat(super.observedAttributes || []);\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<div>\n\t\t\t<descope-text part=\"wrapper\">\n\t\t\t\t<a>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</a>\n\t\t\t</descope-text>\n\t\t</div>\n\t\t`;\n\n injectStyle(\n `\n :host {\n\t\t\tdisplay: inline-block;\n line-height: 1em;\n\t\t}\n\t\t:host a {\n\t\t\tdisplay: inline;\n\t\t}\n\n :host([ellipsis=\"true\"]) descope-text {\n display: inline-flex;\n }\n :host([ellipsis=\"true\"]) descope-text::part(text-wrapper) {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n `,\n this,\n );\n\n this.anchor = this.shadowRoot.querySelector('a');\n\n forwardAttrs(this, this.anchor, {\n includeAttrs: ['href', 'target', 'tooltip'],\n mapAttrs: {\n tooltip: 'title',\n },\n });\n\n forwardAttrs(this, this.shadowRoot.querySelector('descope-text'), {\n includeAttrs: ['mode', 'variant'],\n });\n\n this.anchor.addEventListener('click', (e) => {\n if (this.readOnly) {\n e.preventDefault();\n }\n });\n }\n\n get readOnly() {\n return this.getAttribute('readonly') === 'true';\n }\n}\n\nconst selectors = {\n host: { selector: () => ':host' },\n link: { selector: () => ':host a' },\n anchor: {},\n wrapper: { selector: () => ':host > div' },\n text: { selector: () => TextClass.componentName },\n};\n\nconst { anchor, text, host, wrapper, link } = selectors;\n\nexport const LinkClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...text, property: 'direction' },\n textAlign: wrapper,\n textDecoration: {\n ...link,\n property: 'text-decoration',\n fallback: 'none',\n },\n textColor: [\n { ...anchor, property: 'color' },\n { ...text, property: TextClass.cssVarList.textColor },\n ],\n cursor: anchor,\n },\n }),\n stretchMixin({ triggers: [{ attr: 'full-width', value: 'true' }] }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawLink);\n","import { componentName, LinkClass } from './LinkClass';\nimport '@descope-ui/descope-text';\n\ncustomElements.define(componentName, LinkClass);\n\nexport { LinkClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n stretchMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n injectStyle,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('text');\n\nclass RawText extends createBaseClass({\n componentName,\n baseSelector: ':host > slot',\n}) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <slot part=\"text-wrapper\"></slot>\n `;\n\n injectStyle(\n `\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `,\n this,\n );\n }\n\n get hideWhenEmpty() {\n return this.getAttribute('hide-when-empty') === 'true';\n }\n\n init() {\n super.init();\n\n observeChildren(this, () => {\n const hasChildren = !!this.childNodes.length;\n this.style.display = !hasChildren && this.hideWhenEmpty ? 'none' : '';\n });\n }\n}\n\nconst { host } = {\n host: { selector: () => ':host' },\n};\n\nexport const TextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n fontSize: {},\n textColor: [{ property: 'color' }],\n textLineHeight: { property: 'line-height' },\n textLetterSpacing: { property: 'letter-spacing' },\n textShadow: {},\n textAlign: {},\n textTransform: {},\n fontFamily: {},\n fontStyle: {},\n fontWeight: {},\n borderWidth: {},\n borderStyle: {},\n borderColor: {},\n },\n }),\n stretchMixin({ triggers: [{ attr: 'full-width', value: 'true' }] }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n","import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n","import {\n componentNameValidationMixin,\n portalMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n forwardAttrs,\n getComponentName,\n injectStyle,\n observeAttributes,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { EnrichedTextClass } from '@descope-ui/descope-enriched-text/class';\n\nexport const componentName = getComponentName('tooltip');\n\nconst tooltipAttrs = [\n 'text',\n 'position',\n 'hide-delay',\n 'hover-delay',\n 'opened',\n];\n\nclass RawTooltip extends createBaseClass({\n componentName,\n baseSelector: 'vaadin-tooltip',\n}) {\n // Observes the inner descope-anchored's `class` attribute so runtime updates\n // (e.g. real-time conditional components toggling `.hidden`) keep this\n // tooltip's class in sync. Set up in connectedCallback so reconnects work.\n #anchoredClassObserver = null;\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <descope-anchored>\n <slot></slot>\n <vaadin-tooltip slot=\"anchored\"></vaadin-tooltip>\n </descope-anchored>\n `;\n\n this.defaultSlot = this.shadowRoot.querySelector('slot:not([name])');\n this.tooltip = this.shadowRoot.querySelector('vaadin-tooltip');\n\n this.anchored = this.shadowRoot.querySelector('descope-anchored');\n }\n\n // To support conditional components in flow, we need to sync the 'hidden' className to the root of the component.\n // Ideally, this would happen in the SDK, but we resolved to this patch to fix the issue without forcing users to update SDKs.\n #syncComponentState() {\n const hasHidden = this.anchored?.classList?.contains('hidden');\n this.classList.toggle('hidden', hasHidden);\n }\n\n static get observedAttributes() {\n return tooltipAttrs.concat(super.observedAttributes || []);\n }\n\n get isOpened() {\n return this.getAttribute('opened') === 'true';\n }\n\n get overlay() {\n return this.tooltip?._overlayElement;\n }\n\n get overlayContentNode() {\n return this.overlay?.shadowRoot.querySelector('[part=\"content\"]');\n }\n\n get tooltipText() {\n return this.getAttribute('text')?.trim() || '';\n }\n\n get isStaticDisplay() {\n return this.getAttribute('static-display') === 'true';\n }\n\n get srLabel() {\n return this.tooltip?.querySelector('[slot=\"sr-label\"]');\n }\n\n // We use `static-display` for presentation purposes, to show the tooltip content.\n // This should be used only when `opened` is `true`. Once `static-display` is set,\n // the overlay flows in-line and has layout in the presenting page. Mainly aimed\n // to solve the presentation problem on our Styles Page in the Console.\n #handleStaticDisplay() {\n if (this.isStaticDisplay) {\n this.#revealOverlay();\n this.setAttribute('inert', 'true');\n } else {\n this.removeAttribute('inert');\n }\n }\n\n #revealOverlay() {\n if (!this.overlay) return;\n // Keep the overlay in vaadin-tooltip.shadowRoot so adopted stylesheets from\n // portalMixin continue to apply (they are scoped to that shadow root).\n // Layout is handled via CSS: anchored-root becomes a column, vaadin-tooltip\n // becomes a visible block below the anchor, and the sr-label is hidden.\n this.overlay.style.display = 'block';\n this.overlay.style.position = 'static';\n }\n\n init() {\n super.init?.();\n\n injectStyle(\n `\n :host {\n display: inline-block;\n }\n vaadin-tooltip {\n display: block;\n position: absolute;\n width: 0;\n height: 0;\n overflow: hidden;\n }\n /* Stack anchor above the anchored element so the tooltip flows below it inline. */\n :host([static-display=\"true\"]) descope-anchored::part(root) {\n flex-direction: column;\n }\n :host([static-display=\"true\"]) descope-anchored::part(anchored) {\n position: static;\n inset: unset;\n }\n :host([static-display=\"true\"]) vaadin-tooltip {\n position: static;\n width: auto;\n height: auto;\n overflow: visible;\n }\n :host([static-display=\"true\"]) vaadin-tooltip [slot=\"sr-label\"] {\n display: none;\n }\n`,\n this,\n );\n\n this.defaultSlot.addEventListener('slotchange', () =>\n this.#setTooltipTarget(),\n );\n this.#setTooltipTarget();\n\n setTimeout(() => this.#onOverlayReady());\n }\n\n #observeAnchored() {\n this.#anchoredClassObserver?.disconnect();\n if (this.anchored) {\n this.#anchoredClassObserver = observeAttributes(\n this.anchored,\n () => this.#syncComponentState(),\n { includeAttrs: ['class'] },\n );\n }\n }\n\n // createBaseClass gates init() to first-connect, so observing here is\n // required for the detach/reattach cycle to keep working.\n connectedCallback() {\n super.connectedCallback?.();\n this.#syncComponentState();\n this.#observeAnchored();\n }\n\n disconnectedCallback() {\n super.disconnectedCallback?.();\n this.#anchoredClassObserver?.disconnect();\n }\n\n #setTooltipTarget() {\n const target = this.defaultSlot?.assignedElements()?.[0];\n if (!target) return;\n this.tooltip.target = target;\n }\n\n #onOverlayReady() {\n this.#initTooltipTextComponent();\n this.#overrideAttachOverlay();\n\n forwardAttrs(this, this.tooltip, {\n includeAttrs: ['position', 'opened'],\n });\n\n this.#handleTooltipVisibility();\n }\n\n #clearOverlayContentNode() {\n this.overlayContentNode.innerHTML = '';\n }\n\n #createEnrichedTextComponent() {\n const enrichedText = document.createElement('descope-enriched-text');\n\n enrichedText.setAttribute('link-target-blank', 'true');\n enrichedText.textContent = this.tooltipText;\n\n return enrichedText;\n }\n\n #initTooltipTextComponent() {\n if (!this.overlayContentNode) return;\n\n setTimeout(() => {\n this.#clearOverlayContentNode();\n\n this.textComponent = this.#createEnrichedTextComponent();\n\n this.overlayContentNode.appendChild(this.textComponent);\n\n // An empty sr-label with role=\"tooltip\" fails accessibility checks.\n // Hide it when there's no tooltip text; vaadin handles populating it when text is present.\n if (this.srLabel && !this.tooltipText) {\n this.srLabel.setAttribute('aria-hidden', 'true');\n }\n\n forwardAttrs(this, this.textComponent, {\n includeAttrs: ['readonly'],\n });\n });\n }\n\n // The default vaadin behavior is to attach the overlay to the body when opened,\n // which makes it hard to style. We move the overlay into our shadow root instead.\n // Critical: vaadin computes position against the overlay's offsetParent — moving\n // it changes that context, so we must call `_updatePosition()` afterwards.\n // That's vaadin's own position-recompute method (the same one its resize/scroll\n // listeners use internally), so we get the right reposition without dispatching\n // global events.\n #overrideAttachOverlay() {\n if (!this.overlay) return;\n\n const originalAttach = this.overlay._attachOverlay?.bind(this.overlay);\n\n this.overlay._detachOverlay = () => {};\n this.overlay._attachOverlay = () => {\n originalAttach?.();\n setTimeout(() => {\n this.tooltip.shadowRoot.appendChild(this.overlay);\n this.overlay._updatePosition?.();\n });\n };\n\n if (this.isOpened) {\n // When `opened` attr is set at init, vaadin renders the overlay at the top\n // level without calling `_attachOverlay`. Move it back into our shadow root.\n setTimeout(() => {\n this.tooltip.shadowRoot.appendChild(this.overlay);\n this.#handleStaticDisplay();\n this.overlay._updatePosition?.();\n });\n }\n }\n\n #handleTooltipVisibility() {\n // This is Vaadin's API for manual control of tooltip visibility\n this.tooltip?.toggleAttribute('manual', this.isOpened);\n }\n\n #updateText(value) {\n if (!this.textComponent) return;\n const trimmedValue = (value ?? '').trim();\n this.textComponent.textContent = trimmedValue;\n if (this.srLabel) {\n if (trimmedValue) {\n this.srLabel.removeAttribute('aria-hidden');\n } else {\n this.srLabel.setAttribute('aria-hidden', 'true');\n }\n }\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue !== newValue) {\n if (attrName === 'text') {\n this.#updateText(newValue);\n }\n\n if (attrName === 'opened') {\n this.#handleTooltipVisibility();\n }\n }\n }\n}\n\nconst { overlay, content } = {\n overlay: { selector: () => 'vaadin-tooltip-overlay::part(overlay)' },\n content: { selector: () => 'vaadin-tooltip-overlay::part(content)' },\n};\n\nexport const TooltipClass = compose(\n componentNameValidationMixin,\n portalMixin({\n selector: '',\n mappings: {\n fontFamily: {\n ...content,\n property: EnrichedTextClass.cssVarList.fontFamilyOverride,\n },\n fontSize: {\n ...content,\n property: EnrichedTextClass.cssVarList.fontSizeOverride,\n },\n fontWeight: {\n ...content,\n property: EnrichedTextClass.cssVarList.fontWeightOverride,\n },\n textColor: {\n ...content,\n property: EnrichedTextClass.cssVarList.textColorOverride,\n },\n hostDirection: {\n ...content,\n property: EnrichedTextClass.cssVarList.hostDirectionOverride,\n },\n backgroundColor: [{ ...overlay }, { ...content }],\n borderColor: { ...overlay },\n borderStyle: { ...overlay },\n borderWidth: { ...overlay },\n borderRadius: { ...overlay },\n boxShadow: { ...overlay },\n horizontalPadding: [\n { ...content, property: 'padding-left' },\n { ...content, property: 'padding-right' },\n ],\n verticalPadding: [\n { ...content, property: 'padding-top' },\n { ...content, property: 'padding-bottom' },\n ],\n },\n forward: {\n attributes: ['style'],\n include: false,\n },\n }),\n)(RawTooltip);\n","import '@descope-ui/descope-anchored';\nimport '@descope-ui/descope-enriched-text';\nimport '@vaadin/tooltip';\nimport { componentName, TooltipClass } from './TooltipClass';\n\ncustomElements.define(componentName, TooltipClass);\n\nexport { TooltipClass, componentName };\n"],"names":["componentName","componentsHelpers","xE","RawAnchored","baseClasses","qu","baseSelector","stretchObserver","directionObserver","hostStretchSheet","anchorClassObserver","anchor","this","defaultSlot","assignedElements","flatten","anchored","shadowRoot","querySelector","outerHost","getRootNode","host","constructor","super","attachShadow","mode","innerHTML","init","fz","syncStretchCSS","addEventListener","syncAnchor","syncComponentState","hasHidden","classList","contains","toggle","onAnchorChanged","forwardAttr","observeAnchorClass","disconnect","mx","includeAttrs","connectedCallback","css","replaceSync","observer","target","attr","removeAttribute","EA","disconnectedCallback","toggleAttribute","AnchoredClass","utils","Zz","componentsMixins","tQ","customElements","define","_descope_ui_common_components_helpers__WEBPACK_IMPORTED_MODULE_6__","EnrichedText","_descope_ui_common_base_classes__WEBPACK_IMPORTED_MODULE_4__","origLinkRenderer","origEmRenderer","initProcessor","Ge","parseChildren","bind","contentNode","e","HTMLAnchorElement","stopPropagation","observedAttributes","attributeChangedCallback","attrName","oldValue","newValue","onReadOnlyChange","customUnderlineRenderer","processor","renderer","rules","em_open","tokens","idx","options","env","self","markup","tag","em_close","customizeLinkRenderer","linkTargetBlank","link_open","attrSet","disableCustomRules","disable","_consts__WEBPACK_IMPORTED_MODULE_3__","M","updateProcessorRules","storeOrigRenderers","_","renderToken","markdown_it__WEBPACK_IMPORTED_MODULE_0__","A","html","getAttribute","_helpers__WEBPACK_IMPORTED_MODULE_5__","G","trim","isConnected","setAttribute","parse","references","undefined","render","breaks","console","warn","firstChild","isReadOnly","EnrichedTextClass","_descope_ui_common_utils__WEBPACK_IMPORTED_MODULE_2__","_descope_ui_common_components_mixins__WEBPACK_IMPORTED_MODULE_1__","RF","mappings","hostWidth","selector","property","hostDisplay","fallback","hostDirection","fontSize","fontFamily","fontWeight","fontWeightBold","textColor","textLineHeight","textAlign","linkColor","linkTextDecoration","linkHoverTextDecoration","minHeight","minWidth","componentNameOverride","DM","triggers","value","VO","disableRules","decodeHTML","textArea","document","createElement","_EnrichedTextClass__WEBPACK_IMPORTED_MODULE_1__","T","m","_descope_ui_common_components_helpers__WEBPACK_IMPORTED_MODULE_2__","observedAttrs","RawLink","_descope_ui_common_base_classes__WEBPACK_IMPORTED_MODULE_3__","concat","mapAttrs","tooltip","readOnly","preventDefault","selectors","link","wrapper","text","_descope_ui_descope_text_class__WEBPACK_IMPORTED_MODULE_4__","s","LinkClass","_descope_ui_common_utils__WEBPACK_IMPORTED_MODULE_1__","_descope_ui_common_components_mixins__WEBPACK_IMPORTED_MODULE_0__","textDecoration","cssVarList","cursor","_LinkClass__WEBPACK_IMPORTED_MODULE_0__","J","RawText","hideWhenEmpty","hasChildren","childNodes","length","style","display","TextClass","textLetterSpacing","textShadow","textTransform","fontStyle","borderWidth","borderStyle","borderColor","_TextClass__WEBPACK_IMPORTED_MODULE_0__","tooltipAttrs","RawTooltip","anchoredClassObserver","isOpened","overlay","_overlayElement","overlayContentNode","tooltipText","isStaticDisplay","srLabel","handleStaticDisplay","revealOverlay","position","setTooltipTarget","setTimeout","onOverlayReady","observeAnchored","initTooltipTextComponent","overrideAttachOverlay","handleTooltipVisibility","clearOverlayContentNode","createEnrichedTextComponent","enrichedText","textContent","textComponent","appendChild","originalAttach","_attachOverlay","_detachOverlay","_updatePosition","updateText","trimmedValue","content","TooltipClass","mA","fontFamilyOverride","fontSizeOverride","fontWeightOverride","textColorOverride","hostDirectionOverride","backgroundColor","borderRadius","boxShadow","horizontalPadding","verticalPadding","forward","attributes","include"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"descope-tooltip.js","mappings":"iQAUO,MAAAA,GAAsB,EAAAC,EAAAC,IAAgB,YAE7C,MAAAC,WAA0B,EAAAC,EAAAC,IAAe,CACzCL,gBACAM,aAAA,oBAEAC,GAAA,KAEAC,GAAA,KAEAC,GAAA,KAKAC,GAAA,KAEA,KAAAC,GACA,OAAAC,KAAAC,YAAAC,iBAAA,CAA+CC,SAAA,IAAe,EAC9D,CAEA,KAAAC,GACA,OAAAJ,KAAAK,WACAC,cAAA,0BACAJ,mBAAA,EACA,CAEA,KAAAK,GACA,OAAAP,KAAAQ,cAAAC,IACA,CAEA,WAAAC,GACAC,QAEAX,KAAAY,aAAA,CAAwBC,KAAA,SAAcC,UAAA,2MAStCd,KAAAC,YAAAD,KAAAK,WAAAC,cAAA,mBACA,CAEA,IAAAS,GACAJ,MAAAI,UAEI,EAAA1B,EAAA2B,IACJ,0iCAsCAhB,MAGAA,MAAAiB,IAEAjB,KAAAC,YAAAiB,iBAAA,iBAAAlB,MAAAmB,KAEAnB,MAAAmB,GACA,CAIA,EAAAC,GACA,MAAAC,EAAArB,MAAAD,GAAAuB,WAAAC,SAAA,UACAvB,KAAAsB,UAAAE,OAAA,SAAAH,EACA,CA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AA,sBAGA,CAEA,wBAAAtC,CAAAC,EAAAC,EAAAC,GACAvD,MAAAoD,2BAAAC,EAAAC,EAAAC,GAEAD,IAAAC,IACA,SAAAF,GACAhE,MAAAwN,EAAAtJ,GAGA,WAAAF,GACAhE,MAAA6M,IAGA,EAGA,MAAAf,QAAQA,EAAA4B,QAAAA,GAAmB,CAC3B5B,QAAA,CAAazE,SAAA,6CACbqG,QAAA,CAAarG,SAAA,8CAGNsG,GAAqB,EAAAjL,EAAAC,IAC1BC,EAAAC,IACA,EAAAD,EAAAgL,IAAW,CACbvG,SAAA,GACAF,SAAA,CACAQ,WAAA,IACA+F,EACApG,SAAkBP,EAAAmC,EAAiBoB,WAAAuD,oBAEnCnG,SAAA,IACAgG,EACApG,SAAkBP,EAAAmC,EAAiBoB,WAAAwD,kBAEnClG,WAAA,IACA8F,EACApG,SAAkBP,EAAAmC,EAAiBoB,WAAAyD,oBAEnCjG,UAAA,IACA4F,EACApG,SAAkBP,EAAAmC,EAAiBoB,WAAA0D,mBAEnCvG,cAAA,IACAiG,EACApG,SAAkBP,EAAAmC,EAAiBoB,WAAA2D,uBAEnCC,gBAAA,KAA0BpC,GAAY,IAAI4B,IAC1ClC,YAAA,IAAqBM,GACrBP,YAAA,IAAqBO,GACrBR,YAAA,IAAqBQ,GACrBqC,aAAA,IAAsBrC,GACtBsC,UAAA,IAAmBtC,GACnBuC,kBAAA,CACA,IAAUX,EAAApG,SAAA,gBACV,IAAUoG,EAAApG,SAAA,kBAEVgH,gBAAA,CACA,IAAUZ,EAAApG,SAAA,eACV,IAAUoG,EAAApG,SAAA,oBAGViH,QAAA,CACAC,WAAA,UACAC,SAAA,KA1C4B,CA6C5B9C,GCjVA7I,eAAAC,OAAsB3D,EAAeuO","sources":["webpack://@descope/web-components-ui/../components/descope-anchored/src/component/AnchoredClass.js","webpack://@descope/web-components-ui/../components/descope-anchored/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/EnrichedTextClass.js","webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/consts.js","webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/helpers.js","webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-link/src/component/LinkClass.js","webpack://@descope/web-components-ui/../components/descope-link/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/TextClass.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-tooltip/src/component/TooltipClass.js","webpack://@descope/web-components-ui/../components/descope-tooltip/src/component/index.js"],"sourcesContent":["import { componentNameValidationMixin } from '@descope-ui/common/components-mixins';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport {\n forwardAttrs,\n getComponentName,\n injectStyle,\n observeAttributes,\n} from '@descope-ui/common/components-helpers';\nimport { compose } from '@descope-ui/common/utils';\n\nexport const componentName = getComponentName('anchored');\n\nclass RawAnchored extends createBaseClass({\n componentName,\n baseSelector: '.anchored-root',\n}) {\n #stretchObserver = null;\n\n #directionObserver = null;\n\n #hostStretchSheet = null;\n\n // Observes the anchor's `class` attribute so runtime updates by the SDK\n // (e.g. real-time conditional components toggling `.hidden`) propagate to\n // this element. Without this, only the initial slotchange would sync.\n #anchorClassObserver = null;\n\n get #anchor() {\n return this.defaultSlot.assignedElements({ flatten: true })[0];\n }\n\n get #anchored() {\n return this.shadowRoot\n .querySelector('slot[name=\"anchored\"]')\n ?.assignedElements()[0];\n }\n\n get #outerHost() {\n return this.getRootNode().host;\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"anchored-root\" part=\"root\">\n <slot></slot>\n <div class=\"anchored-host\" part=\"anchored\">\n <slot name=\"anchored\"></slot>\n </div>\n </div>\n `;\n\n this.defaultSlot = this.shadowRoot.querySelector('slot:not([name])');\n }\n\n init() {\n super.init?.();\n\n injectStyle(\n `\n :host {\n display: inline-flex;\n position: relative;\n box-sizing: border-box;\n }\n\n :host(:not([has-anchor])) {\n display: none;\n }\n\n .anchored-root {\n position: relative;\n display: flex;\n width: 100%;\n min-width: 0;\n }\n\n /* Make anchor fill the flex row and allow it to shrink. */\n ::slotted(*:not([slot])) {\n flex-grow: 1; /* fill the flex row */\n flex-shrink: 1; /* compress when constrained */\n flex-basis: auto; /* start from the anchor's natural size */\n min-width: 0; /* flex items won't shrink below content size without this */\n }\n\n /* Anchored container covers the anchor but is invisible to pointer events. */\n .anchored-host {\n position: absolute;\n inset: 0;\n pointer-events: none;\n }\n\n /* Restore interactivity for actual anchored content. */\n ::slotted([slot=\"anchored\"]) {\n pointer-events: auto;\n }\n `,\n this,\n );\n\n this.#syncStretchCSS();\n\n this.defaultSlot.addEventListener('slotchange', () => this.#syncAnchor());\n\n this.#syncAnchor();\n }\n\n // To support conditional components in flow, we need to sync the 'hidden' className to the root of the component.\n // Ideally, this would happen in the SDK, but we resolved to this patch to fix the issue without forcing users to update SDKs.\n #syncComponentState() {\n const hasHidden = this.#anchor?.classList?.contains('hidden');\n this.classList.toggle('hidden', hasHidden);\n }\n\n #syncAnchor() {\n this.#onAnchorChanged();\n\n this.#stretchObserver = this.#forwardAttr(\n this.#stretchObserver,\n this.#outerHost,\n 'stretch',\n );\n\n this.#directionObserver = this.#forwardAttr(\n this.#directionObserver,\n this.#anchored,\n 'st-host-direction',\n );\n\n this.#observeAnchorClass();\n }\n\n #observeAnchorClass() {\n this.#anchorClassObserver?.disconnect();\n if (this.#anchor) {\n this.#anchorClassObserver = observeAttributes(\n this.#anchor,\n () => this.#syncComponentState(),\n { includeAttrs: ['class'] },\n );\n }\n }\n\n // createBaseClass gates init() to first-connect (#isInit). Without\n // re-observing here, runtime `.hidden` toggles stop syncing after a\n // detach/reattach cycle.\n connectedCallback() {\n super.connectedCallback?.();\n this.#observeAnchorClass();\n this.#syncComponentState();\n }\n\n // Injects [stretch] layout rules into the containing component's shadow root (e.g. descope-attachment)\n // so it stretches when the anchor has [stretch]. Replaces the existing rules on subsequent calls.\n #syncStretchCSS() {\n const css = `\n descope-anchored {\n width: 100%; /* fill the outer host so the anchored element spans the full anchor width */\n }\n :host([stretch]) {\n display: inline-flex; /* switch from inline-block so internal children are flex items */\n width: 100%; /* fill non-flex parents */\n flex-grow: 1; /* absorb extra space in flex parents */\n flex-shrink: 0; /* hold full width — shrink:1 would let siblings squeeze it below 100% */\n flex-basis: auto; /* defer to width:100% on the main axis; avoids forcing 100% height in column-flex parents */\n min-width: 0; /* prevent overflow when the outer host is itself inside a constrained flex row */\n }\n `;\n\n if (this.#hostStretchSheet) {\n this.#hostStretchSheet.replaceSync(css);\n } else if (this.#outerHost) {\n this.#hostStretchSheet = injectStyle(css, this.#outerHost);\n }\n }\n\n // Reconnects forwarding to the current anchor. Disconnects the old observer and\n // removes the stale attr from target first — forwardAttrs only sets attrs present\n // on the source, so absent attrs won't be removed automatically.\n #forwardAttr(observer, target, attr) {\n observer?.disconnect();\n target?.removeAttribute(attr);\n if (!this.#anchor || !target) return null;\n return forwardAttrs(this.#anchor, target, { includeAttrs: [attr] });\n }\n\n // Prevent stale callbacks from firing on a detached anchor after removal.\n disconnectedCallback() {\n super.disconnectedCallback?.();\n this.#stretchObserver?.disconnect();\n this.#directionObserver?.disconnect();\n this.#anchorClassObserver?.disconnect();\n }\n\n // Track whether anything is slotted, so the host display rule can hide an\n // empty host rather than reserving its layout box.\n #onAnchorChanged() {\n this.toggleAttribute('has-anchor', !!this.#anchor);\n this.#syncComponentState();\n }\n}\n\nexport const AnchoredClass = compose(componentNameValidationMixin)(RawAnchored);\n","import { componentName, AnchoredClass } from './AnchoredClass';\n\ncustomElements.define(componentName, AnchoredClass);\n\nexport { AnchoredClass, componentName };\n","import MarkdownIt from 'markdown-it';\nimport {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n stretchMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport { disableRules } from './consts';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { decodeHTML } from './helpers';\nimport {\n getComponentName,\n injectStyle,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('enriched-text');\n\nclass EnrichedText extends createBaseClass({\n componentName,\n baseSelector: ':host > div',\n}) {\n #origLinkRenderer;\n\n #origEmRenderer;\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"content\"></div>\n `;\n\n injectStyle(\n `\n :host {\n line-height: 1em;\n word-break: break-word;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n *, *:last-child {\n margin: 0;\n }\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n p {\n margin-bottom: 1em;\n }\n a {\n cursor: pointer;\n }\n blockquote {\n padding: 0 2em;\n }\n u {\n text-decoration: underline\n }\n s {\n color: currentColor;\n }\n `,\n this,\n );\n\n this.#initProcessor();\n\n observeChildren(this, this.#parseChildren.bind(this));\n\n // Stop propagation on link clicks to prevent parent handlers from firing\n this.contentNode?.addEventListener('click', (e) => {\n if (e.target instanceof HTMLAnchorElement) {\n e.stopPropagation();\n }\n });\n\n // The SDK submits the form (and prevents link activation) on any Enter that reaches the flow root\n this.contentNode?.addEventListener('keydown', (e) => {\n if (e.key === 'Enter' && e.target instanceof HTMLAnchorElement) {\n e.stopPropagation();\n }\n });\n }\n\n static get observedAttributes() {\n return ['readonly', 'link-target-blank'];\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (newValue !== oldValue) {\n if (attrName === 'readonly') {\n this.onReadOnlyChange(newValue === 'true');\n }\n\n if (attrName === 'link-target-blank') {\n this.#initProcessor();\n }\n }\n }\n\n // We're overriding the rule for em with single underscore to perform as underline. (_underline_)\n customUnderlineRenderer() {\n this.processor.renderer.rules.em_open = (\n tokens,\n idx,\n options,\n env,\n self,\n ) => {\n if (tokens[idx].markup === '_') tokens[idx].tag = 'u';\n return this.#origEmRenderer(tokens, idx, options, env, self);\n };\n this.processor.renderer.rules.em_close = (\n tokens,\n idx,\n options,\n env,\n self,\n ) => {\n if (tokens[idx].markup === '_') tokens[idx].tag = 'u';\n return this.#origEmRenderer(tokens, idx, options, env, self);\n };\n }\n\n #customizeLinkRenderer() {\n if (this.linkTargetBlank) {\n this.processor.renderer.rules.link_open = (\n tokens,\n idx,\n options,\n env,\n self,\n ) => {\n // Add a new `target` attribute, or replace the value of the existing one.\n tokens[idx].attrSet('target', '_blank');\n // Pass the token to the default renderer.\n return this.#origLinkRenderer(tokens, idx, options, env, self);\n };\n } else {\n this.processor.renderer.rules.link_open = this.#origLinkRenderer;\n }\n }\n\n #disableCustomRules() {\n if (!this.processor) {\n return;\n }\n this.processor.disable(disableRules);\n }\n\n #updateProcessorRules() {\n this.#disableCustomRules();\n }\n\n #storeOrigRenderers() {\n const defaultLinkRenderer = (tokens, idx, options, _, self) =>\n self.renderToken(tokens, idx, options);\n this.#origLinkRenderer =\n this.processor.renderer.rules.link_open || defaultLinkRenderer;\n\n const defaultStrongRenderer = (tokens, idx, options, _, self) =>\n self.renderToken(tokens, idx, options);\n this.#origEmRenderer =\n this.processor.renderer.rules.em_open || defaultStrongRenderer;\n }\n\n #initProcessor() {\n this.processor = new MarkdownIt('commonmark', { html: true });\n this.#storeOrigRenderers();\n this.#updateProcessorRules();\n this.#customizeLinkRenderer();\n this.customUnderlineRenderer();\n }\n\n get linkTargetBlank() {\n return this.getAttribute('link-target-blank') === 'true';\n }\n\n get contentNode() {\n return this.shadowRoot.querySelector('.content');\n }\n\n #parseChildren() {\n if (!this.processor) {\n return;\n }\n\n let html = decodeHTML(this.innerHTML);\n\n if (!html?.trim() && this.isConnected) {\n this.setAttribute('empty', 'true');\n } else {\n this.removeAttribute('empty');\n }\n\n try {\n const tokens = this.processor.parse(html, { references: undefined });\n html = this.processor.renderer.render(tokens, {\n html: true,\n breaks: true,\n });\n } catch {\n console.warn('Not parsing invalid markdown token');\n }\n\n this.contentNode.innerHTML = html;\n this.contentNode.firstChild?.setAttribute('part', 'content');\n }\n\n onReadOnlyChange(isReadOnly) {\n if (isReadOnly) {\n this.contentNode.setAttribute('inert', isReadOnly);\n } else {\n this.contentNode.removeAttribute('inert');\n }\n }\n}\n\nexport const EnrichedTextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: () => ':host', property: 'width' },\n hostDisplay: {\n selector: () => ':host',\n property: 'display',\n fallback: 'inline-block',\n },\n hostDirection: { selector: () => ':host', property: 'direction' },\n fontSize: {},\n fontFamily: {},\n fontWeight: {},\n fontWeightBold: [\n { selector: () => ':host strong', property: 'font-weight' },\n { selector: () => ':host b', property: 'font-weight' },\n ],\n textColor: { property: 'color' },\n textLineHeight: { property: 'line-height' },\n textAlign: {},\n linkColor: { selector: 'a', property: 'color' },\n linkTextDecoration: { selector: 'a', property: 'text-decoration' },\n linkHoverTextDecoration: {\n selector: 'a:hover',\n property: 'text-decoration',\n },\n minHeight: {},\n minWidth: {},\n },\n }),\n createStyleMixin({ componentNameOverride: getComponentName('link') }),\n createStyleMixin({ componentNameOverride: getComponentName('text') }),\n stretchMixin({ triggers: [{ attr: 'full-width', value: 'true' }] }),\n draggableMixin,\n componentNameValidationMixin,\n)(EnrichedText);\n","export const disableRules = [\n 'blockquote',\n 'list',\n 'image',\n 'table',\n 'code',\n 'hr',\n 'backticks',\n 'fence',\n 'reference',\n 'heading',\n 'lheading',\n 'html_block',\n];\n","export const decodeHTML = (html) => {\n const textArea = document.createElement('textarea');\n textArea.innerHTML = html;\n return textArea.value;\n};\n","import '@descope-ui/descope-link';\n\nimport { componentName, EnrichedTextClass } from './EnrichedTextClass';\n\ncustomElements.define(componentName, EnrichedTextClass);\n\nexport { EnrichedTextClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n stretchMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n forwardAttrs,\n injectStyle,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { TextClass } from '@descope-ui/descope-text/class';\n\nexport const componentName = getComponentName('link');\n\nconst observedAttrs = ['href', 'readonly'];\n\nclass RawLink extends createBaseClass({\n componentName,\n baseSelector: ':host a',\n}) {\n static get observedAttributes() {\n return observedAttrs.concat(super.observedAttributes || []);\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<div>\n\t\t\t<descope-text part=\"wrapper\">\n\t\t\t\t<a>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</a>\n\t\t\t</descope-text>\n\t\t</div>\n\t\t`;\n\n injectStyle(\n `\n :host {\n\t\t\tdisplay: inline-block;\n line-height: 1em;\n\t\t}\n\t\t:host a {\n\t\t\tdisplay: inline;\n\t\t}\n\n :host([ellipsis=\"true\"]) descope-text {\n display: inline-flex;\n }\n :host([ellipsis=\"true\"]) descope-text::part(text-wrapper) {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n `,\n this,\n );\n\n this.anchor = this.shadowRoot.querySelector('a');\n\n forwardAttrs(this, this.anchor, {\n includeAttrs: ['href', 'target', 'tooltip'],\n mapAttrs: {\n tooltip: 'title',\n },\n });\n\n forwardAttrs(this, this.shadowRoot.querySelector('descope-text'), {\n includeAttrs: ['mode', 'variant'],\n });\n\n this.anchor.addEventListener('click', (e) => {\n if (this.readOnly) {\n e.preventDefault();\n }\n });\n }\n\n get readOnly() {\n return this.getAttribute('readonly') === 'true';\n }\n}\n\nconst selectors = {\n host: { selector: () => ':host' },\n link: { selector: () => ':host a' },\n anchor: {},\n wrapper: { selector: () => ':host > div' },\n text: { selector: () => TextClass.componentName },\n};\n\nconst { anchor, text, host, wrapper, link } = selectors;\n\nexport const LinkClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...text, property: 'direction' },\n textAlign: wrapper,\n textDecoration: {\n ...link,\n property: 'text-decoration',\n fallback: 'none',\n },\n textColor: [\n { ...anchor, property: 'color' },\n { ...text, property: TextClass.cssVarList.textColor },\n ],\n cursor: anchor,\n },\n }),\n stretchMixin({ triggers: [{ attr: 'full-width', value: 'true' }] }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawLink);\n","import { componentName, LinkClass } from './LinkClass';\nimport '@descope-ui/descope-text';\n\ncustomElements.define(componentName, LinkClass);\n\nexport { LinkClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n stretchMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n injectStyle,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('text');\n\nclass RawText extends createBaseClass({\n componentName,\n baseSelector: ':host > slot',\n}) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <slot part=\"text-wrapper\"></slot>\n `;\n\n injectStyle(\n `\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `,\n this,\n );\n }\n\n get hideWhenEmpty() {\n return this.getAttribute('hide-when-empty') === 'true';\n }\n\n init() {\n super.init();\n\n observeChildren(this, () => {\n const hasChildren = !!this.childNodes.length;\n this.style.display = !hasChildren && this.hideWhenEmpty ? 'none' : '';\n });\n }\n}\n\nconst { host } = {\n host: { selector: () => ':host' },\n};\n\nexport const TextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n fontSize: {},\n textColor: [{ property: 'color' }],\n textLineHeight: { property: 'line-height' },\n textLetterSpacing: { property: 'letter-spacing' },\n textShadow: {},\n textAlign: {},\n textTransform: {},\n fontFamily: {},\n fontStyle: {},\n fontWeight: {},\n borderWidth: {},\n borderStyle: {},\n borderColor: {},\n },\n }),\n stretchMixin({ triggers: [{ attr: 'full-width', value: 'true' }] }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n","import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n","import {\n componentNameValidationMixin,\n portalMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n forwardAttrs,\n getComponentName,\n injectStyle,\n observeAttributes,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { EnrichedTextClass } from '@descope-ui/descope-enriched-text/class';\n\nexport const componentName = getComponentName('tooltip');\n\nconst tooltipAttrs = [\n 'text',\n 'position',\n 'hide-delay',\n 'hover-delay',\n 'opened',\n];\n\nclass RawTooltip extends createBaseClass({\n componentName,\n baseSelector: 'vaadin-tooltip',\n}) {\n // Observes the inner descope-anchored's `class` attribute so runtime updates\n // (e.g. real-time conditional components toggling `.hidden`) keep this\n // tooltip's class in sync. Set up in connectedCallback so reconnects work.\n #anchoredClassObserver = null;\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <descope-anchored>\n <slot></slot>\n <vaadin-tooltip slot=\"anchored\"></vaadin-tooltip>\n </descope-anchored>\n `;\n\n this.defaultSlot = this.shadowRoot.querySelector('slot:not([name])');\n this.tooltip = this.shadowRoot.querySelector('vaadin-tooltip');\n\n this.anchored = this.shadowRoot.querySelector('descope-anchored');\n }\n\n // To support conditional components in flow, we need to sync the 'hidden' className to the root of the component.\n // Ideally, this would happen in the SDK, but we resolved to this patch to fix the issue without forcing users to update SDKs.\n #syncComponentState() {\n const hasHidden = this.anchored?.classList?.contains('hidden');\n this.classList.toggle('hidden', hasHidden);\n }\n\n static get observedAttributes() {\n return tooltipAttrs.concat(super.observedAttributes || []);\n }\n\n get isOpened() {\n return this.getAttribute('opened') === 'true';\n }\n\n get overlay() {\n return this.tooltip?._overlayElement;\n }\n\n get overlayContentNode() {\n return this.overlay?.shadowRoot.querySelector('[part=\"content\"]');\n }\n\n get tooltipText() {\n return this.getAttribute('text')?.trim() || '';\n }\n\n get isStaticDisplay() {\n return this.getAttribute('static-display') === 'true';\n }\n\n get srLabel() {\n return this.tooltip?.querySelector('[slot=\"sr-label\"]');\n }\n\n // We use `static-display` for presentation purposes, to show the tooltip content.\n // This should be used only when `opened` is `true`. Once `static-display` is set,\n // the overlay flows in-line and has layout in the presenting page. Mainly aimed\n // to solve the presentation problem on our Styles Page in the Console.\n #handleStaticDisplay() {\n if (this.isStaticDisplay) {\n this.#revealOverlay();\n this.setAttribute('inert', 'true');\n } else {\n this.removeAttribute('inert');\n }\n }\n\n #revealOverlay() {\n if (!this.overlay) return;\n // Keep the overlay in vaadin-tooltip.shadowRoot so adopted stylesheets from\n // portalMixin continue to apply (they are scoped to that shadow root).\n // Layout is handled via CSS: anchored-root becomes a column, vaadin-tooltip\n // becomes a visible block below the anchor, and the sr-label is hidden.\n this.overlay.style.display = 'block';\n this.overlay.style.position = 'static';\n }\n\n init() {\n super.init?.();\n\n injectStyle(\n `\n :host {\n display: inline-block;\n }\n vaadin-tooltip {\n display: block;\n position: absolute;\n width: 0;\n height: 0;\n overflow: hidden;\n }\n /* Stack anchor above the anchored element so the tooltip flows below it inline. */\n :host([static-display=\"true\"]) descope-anchored::part(root) {\n flex-direction: column;\n }\n :host([static-display=\"true\"]) descope-anchored::part(anchored) {\n position: static;\n inset: unset;\n }\n :host([static-display=\"true\"]) vaadin-tooltip {\n position: static;\n width: auto;\n height: auto;\n overflow: visible;\n }\n :host([static-display=\"true\"]) vaadin-tooltip [slot=\"sr-label\"] {\n display: none;\n }\n`,\n this,\n );\n\n this.defaultSlot.addEventListener('slotchange', () =>\n this.#setTooltipTarget(),\n );\n this.#setTooltipTarget();\n\n setTimeout(() => this.#onOverlayReady());\n }\n\n #observeAnchored() {\n this.#anchoredClassObserver?.disconnect();\n if (this.anchored) {\n this.#anchoredClassObserver = observeAttributes(\n this.anchored,\n () => this.#syncComponentState(),\n { includeAttrs: ['class'] },\n );\n }\n }\n\n // createBaseClass gates init() to first-connect, so observing here is\n // required for the detach/reattach cycle to keep working.\n connectedCallback() {\n super.connectedCallback?.();\n this.#syncComponentState();\n this.#observeAnchored();\n }\n\n disconnectedCallback() {\n super.disconnectedCallback?.();\n this.#anchoredClassObserver?.disconnect();\n }\n\n #setTooltipTarget() {\n const target = this.defaultSlot?.assignedElements()?.[0];\n if (!target) return;\n this.tooltip.target = target;\n }\n\n #onOverlayReady() {\n this.#initTooltipTextComponent();\n this.#overrideAttachOverlay();\n\n forwardAttrs(this, this.tooltip, {\n includeAttrs: ['position', 'opened'],\n });\n\n this.#handleTooltipVisibility();\n }\n\n #clearOverlayContentNode() {\n this.overlayContentNode.innerHTML = '';\n }\n\n #createEnrichedTextComponent() {\n const enrichedText = document.createElement('descope-enriched-text');\n\n enrichedText.setAttribute('link-target-blank', 'true');\n enrichedText.textContent = this.tooltipText;\n\n return enrichedText;\n }\n\n #initTooltipTextComponent() {\n if (!this.overlayContentNode) return;\n\n setTimeout(() => {\n this.#clearOverlayContentNode();\n\n this.textComponent = this.#createEnrichedTextComponent();\n\n this.overlayContentNode.appendChild(this.textComponent);\n\n // An empty sr-label with role=\"tooltip\" fails accessibility checks.\n // Hide it when there's no tooltip text; vaadin handles populating it when text is present.\n if (this.srLabel && !this.tooltipText) {\n this.srLabel.setAttribute('aria-hidden', 'true');\n }\n\n forwardAttrs(this, this.textComponent, {\n includeAttrs: ['readonly'],\n });\n });\n }\n\n // The default vaadin behavior is to attach the overlay to the body when opened,\n // which makes it hard to style. We move the overlay into our shadow root instead.\n // Critical: vaadin computes position against the overlay's offsetParent — moving\n // it changes that context, so we must call `_updatePosition()` afterwards.\n // That's vaadin's own position-recompute method (the same one its resize/scroll\n // listeners use internally), so we get the right reposition without dispatching\n // global events.\n #overrideAttachOverlay() {\n if (!this.overlay) return;\n\n const originalAttach = this.overlay._attachOverlay?.bind(this.overlay);\n\n this.overlay._detachOverlay = () => {};\n this.overlay._attachOverlay = () => {\n originalAttach?.();\n setTimeout(() => {\n this.tooltip.shadowRoot.appendChild(this.overlay);\n this.overlay._updatePosition?.();\n });\n };\n\n if (this.isOpened) {\n // When `opened` attr is set at init, vaadin renders the overlay at the top\n // level without calling `_attachOverlay`. Move it back into our shadow root.\n setTimeout(() => {\n this.tooltip.shadowRoot.appendChild(this.overlay);\n this.#handleStaticDisplay();\n this.overlay._updatePosition?.();\n });\n }\n }\n\n #handleTooltipVisibility() {\n // This is Vaadin's API for manual control of tooltip visibility\n this.tooltip?.toggleAttribute('manual', this.isOpened);\n }\n\n #updateText(value) {\n if (!this.textComponent) return;\n const trimmedValue = (value ?? '').trim();\n this.textComponent.textContent = trimmedValue;\n if (this.srLabel) {\n if (trimmedValue) {\n this.srLabel.removeAttribute('aria-hidden');\n } else {\n this.srLabel.setAttribute('aria-hidden', 'true');\n }\n }\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue !== newValue) {\n if (attrName === 'text') {\n this.#updateText(newValue);\n }\n\n if (attrName === 'opened') {\n this.#handleTooltipVisibility();\n }\n }\n }\n}\n\nconst { overlay, content } = {\n overlay: { selector: () => 'vaadin-tooltip-overlay::part(overlay)' },\n content: { selector: () => 'vaadin-tooltip-overlay::part(content)' },\n};\n\nexport const TooltipClass = compose(\n componentNameValidationMixin,\n portalMixin({\n selector: '',\n mappings: {\n fontFamily: {\n ...content,\n property: EnrichedTextClass.cssVarList.fontFamilyOverride,\n },\n fontSize: {\n ...content,\n property: EnrichedTextClass.cssVarList.fontSizeOverride,\n },\n fontWeight: {\n ...content,\n property: EnrichedTextClass.cssVarList.fontWeightOverride,\n },\n textColor: {\n ...content,\n property: EnrichedTextClass.cssVarList.textColorOverride,\n },\n hostDirection: {\n ...content,\n property: EnrichedTextClass.cssVarList.hostDirectionOverride,\n },\n backgroundColor: [{ ...overlay }, { ...content }],\n borderColor: { ...overlay },\n borderStyle: { ...overlay },\n borderWidth: { ...overlay },\n borderRadius: { ...overlay },\n boxShadow: { ...overlay },\n horizontalPadding: [\n { ...content, property: 'padding-left' },\n { ...content, property: 'padding-right' },\n ],\n verticalPadding: [\n { ...content, property: 'padding-top' },\n { ...content, property: 'padding-bottom' },\n ],\n },\n forward: {\n attributes: ['style'],\n include: false,\n },\n }),\n)(RawTooltip);\n","import '@descope-ui/descope-anchored';\nimport '@descope-ui/descope-enriched-text';\nimport '@vaadin/tooltip';\nimport { componentName, TooltipClass } from './TooltipClass';\n\ncustomElements.define(componentName, TooltipClass);\n\nexport { TooltipClass, componentName };\n"],"names":["componentName","componentsHelpers","xE","RawAnchored","baseClasses","qu","baseSelector","stretchObserver","directionObserver","hostStretchSheet","anchorClassObserver","anchor","this","defaultSlot","assignedElements","flatten","anchored","shadowRoot","querySelector","outerHost","getRootNode","host","constructor","super","attachShadow","mode","innerHTML","init","fz","syncStretchCSS","addEventListener","syncAnchor","syncComponentState","hasHidden","classList","contains","toggle","onAnchorChanged","forwardAttr","observeAnchorClass","disconnect","mx","includeAttrs","connectedCallback","css","replaceSync","observer","target","attr","removeAttribute","EA","disconnectedCallback","toggleAttribute","AnchoredClass","utils","Zz","componentsMixins","tQ","customElements","define","_descope_ui_common_components_helpers__WEBPACK_IMPORTED_MODULE_6__","EnrichedText","_descope_ui_common_base_classes__WEBPACK_IMPORTED_MODULE_4__","origLinkRenderer","origEmRenderer","initProcessor","Ge","parseChildren","bind","contentNode","e","HTMLAnchorElement","stopPropagation","key","observedAttributes","attributeChangedCallback","attrName","oldValue","newValue","onReadOnlyChange","customUnderlineRenderer","processor","renderer","rules","em_open","tokens","idx","options","env","self","markup","tag","em_close","customizeLinkRenderer","linkTargetBlank","link_open","attrSet","disableCustomRules","disable","_consts__WEBPACK_IMPORTED_MODULE_3__","M","updateProcessorRules","storeOrigRenderers","_","renderToken","markdown_it__WEBPACK_IMPORTED_MODULE_0__","A","html","getAttribute","_helpers__WEBPACK_IMPORTED_MODULE_5__","G","trim","isConnected","setAttribute","parse","references","undefined","render","breaks","console","warn","firstChild","isReadOnly","EnrichedTextClass","_descope_ui_common_utils__WEBPACK_IMPORTED_MODULE_2__","_descope_ui_common_components_mixins__WEBPACK_IMPORTED_MODULE_1__","RF","mappings","hostWidth","selector","property","hostDisplay","fallback","hostDirection","fontSize","fontFamily","fontWeight","fontWeightBold","textColor","textLineHeight","textAlign","linkColor","linkTextDecoration","linkHoverTextDecoration","minHeight","minWidth","componentNameOverride","DM","triggers","value","VO","disableRules","decodeHTML","textArea","document","createElement","_EnrichedTextClass__WEBPACK_IMPORTED_MODULE_1__","T","m","_descope_ui_common_components_helpers__WEBPACK_IMPORTED_MODULE_2__","observedAttrs","RawLink","_descope_ui_common_base_classes__WEBPACK_IMPORTED_MODULE_3__","concat","mapAttrs","tooltip","readOnly","preventDefault","selectors","link","wrapper","text","_descope_ui_descope_text_class__WEBPACK_IMPORTED_MODULE_4__","s","LinkClass","_descope_ui_common_utils__WEBPACK_IMPORTED_MODULE_1__","_descope_ui_common_components_mixins__WEBPACK_IMPORTED_MODULE_0__","textDecoration","cssVarList","cursor","_LinkClass__WEBPACK_IMPORTED_MODULE_0__","J","RawText","hideWhenEmpty","hasChildren","childNodes","length","style","display","TextClass","textLetterSpacing","textShadow","textTransform","fontStyle","borderWidth","borderStyle","borderColor","_TextClass__WEBPACK_IMPORTED_MODULE_0__","tooltipAttrs","RawTooltip","anchoredClassObserver","isOpened","overlay","_overlayElement","overlayContentNode","tooltipText","isStaticDisplay","srLabel","handleStaticDisplay","revealOverlay","position","setTooltipTarget","setTimeout","onOverlayReady","observeAnchored","initTooltipTextComponent","overrideAttachOverlay","handleTooltipVisibility","clearOverlayContentNode","createEnrichedTextComponent","enrichedText","textContent","textComponent","appendChild","originalAttach","_attachOverlay","_detachOverlay","_updatePosition","updateText","trimmedValue","content","TooltipClass","mA","fontFamilyOverride","fontSizeOverride","fontWeightOverride","textColorOverride","hostDirectionOverride","backgroundColor","borderRadius","boxShadow","horizontalPadding","verticalPadding","forward","attributes","include"],"sourceRoot":""}
|