@descope/web-components-ui 3.8.0 → 3.9.1
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 +11887 -11084
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +6863 -6065
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/8961.js +1 -1
- package/dist/umd/8961.js.map +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/DescopeDev.js.map +1 -1
- package/dist/umd/descope-anchored.js +1 -1
- package/dist/umd/descope-anchored.js.map +1 -1
- package/dist/umd/descope-attachment.js +1 -1
- package/dist/umd/descope-attachment.js.map +1 -1
- package/dist/umd/descope-multi-line-mappings.js +339 -0
- package/dist/umd/descope-multi-line-mappings.js.LICENSE.txt +5 -0
- package/dist/umd/descope-multi-line-mappings.js.map +1 -0
- package/dist/umd/descope-multi-select-combo-box.js +2 -0
- package/dist/umd/descope-multi-select-combo-box.js.map +1 -0
- 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 +36 -34
- package/src/index.cjs.js +1 -1
- package/src/index.js +0 -1
- package/src/theme/components/index.js +3 -1
- package/dist/umd/descope-multi-select-combo-box-index-js.js +0 -2
- package/dist/umd/descope-multi-select-combo-box-index-js.js.map +0 -1
- package/src/components/descope-multi-select-combo-box/MultiSelectComboBoxClass.js +0 -684
- package/src/components/descope-multi-select-combo-box/index.js +0 -6
- package/src/theme/components/multiSelectComboBox.js +0 -91
- package/stories/descope-multi-select-combo-box.stories.js +0 -183
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"descope-multi-line-mappings.js","mappings":";+NAYO,MAAMA,GAAgB,QAAiB,WAsCxC,KAAEC,EAAI,MAAEC,EAAK,YAAEC,GAAgB,CACnCF,KAAM,CAAEG,SAAU,IAAM,SACxBF,M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;;;;CEX1C,CAGA,KAAAZ,GACErN,MAAMqN,QAENxN,KAAKqO,mBAAqB,IAAI,IAAkBrO,MAChDA,KAAKsO,cAActO,KAAKqO,mBAC1B,GAGF,OAAoBH,E,0FC9DpB,MAAMK,EAAS,IAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyQlB,QAAe,gBAAiBA,EAAQ,CAAEN,SAAU,e","sources":["webpack://@descope/web-components-ui/../components/descope-button/src/component/ButtonClass.js","webpack://@descope/web-components-ui/../components/descope-button/src/component/clickableMixin.js","webpack://@descope/web-components-ui/../components/descope-button/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-icon/src/component/IconClass.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/ImageClass.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/helpers.js","webpack://@descope/web-components-ui/../components/descope-multi-line-mappings/src/component/MultiLineMappingsClass.js","webpack://@descope/web-components-ui/../components/descope-multi-line-mappings/src/component/index.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/button/src/vaadin-button-base.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/button/src/vaadin-button-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/button/src/vaadin-button.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/button/theme/lumo/vaadin-button-styles.js"],"sourcesContent":["import { compose } from '@descope-ui/common/utils';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport {\n createStyleMixin,\n draggableMixin,\n createProxy,\n componentNameValidationMixin,\n stretchMixin,\n} from '@descope-ui/common/components-mixins';\nimport { IconClass } from '@descope-ui/descope-icon/class';\nimport { clickableMixin } from './clickableMixin';\n\nexport const componentName = getComponentName('button');\n\nconst resetStyles = `\n\t:host {\n\t\tdisplay: inline-block;\n\t\tbox-sizing: border-box;\n\t}\n\tvaadin-button::before,\n\tvaadin-button::after {\n\t\topacity: 0;\n\t}\n\tvaadin-button {\n\t\tmargin: 0;\n\t\tmin-width: 0;\n\t\twidth: 100%;\n\t\theight: auto;\n\t\tbox-shadow: none;\n\t}\n\tvaadin-button::part(label) {\n\t\tpadding: 0;\n width: 100%;\n\t}\n\tvaadin-button::part(prefix) {\n\t\tmargin-left: 0;\n\t\tmargin-right: 0;\n\t}\n`;\n\nconst iconStyles = `\n\tvaadin-button::part(prefix),\n\tvaadin-button::part(label) {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t}\n`;\n\nconst editorOverrides = `vaadin-button::part(label) { pointer-events: none; }`;\n\nconst { host, label, slottedIcon } = {\n host: { selector: () => ':host' },\n label: { selector: '::part(label)' },\n slottedIcon: { selector: () => '::slotted(descope-icon)' },\n};\n\nlet loadingIndicatorStyles;\n\nexport const ButtonClass = compose(\n stretchMixin({ triggers: [{ attr: 'full-width', value: 'true' }] }),\n createStyleMixin({\n mappings: {\n hostWidth: { property: 'width' },\n hostHeight: { property: 'height' },\n hostDirection: { ...host, property: 'direction' },\n fontSize: {},\n fontFamily: {},\n fontWeight: {},\n\n cursor: {},\n backgroundColor: {},\n\n outlineOffset: {},\n outlineColor: {},\n outlineStyle: {},\n outlineWidth: {},\n\n borderRadius: {},\n borderColor: {},\n borderStyle: {},\n borderWidth: {},\n\n verticalPadding: [\n { property: 'padding-top' },\n { property: 'padding-bottom' },\n ],\n horizontalPadding: [\n { property: 'padding-right', fallback: '0.875em' },\n { property: 'padding-left', fallback: '0.875em' },\n ],\n\n labelTextColor: { property: 'color' },\n iconColor: {\n selector: () => `::slotted(*)`,\n property: IconClass.cssVarList.fill,\n },\n labelTextDecoration: { ...label, property: 'text-decoration' },\n labelSpacing: { ...label, property: 'gap' },\n textAlign: { ...label, property: 'justify-content', fallback: 'center' },\n\n iconSize: [\n { ...slottedIcon, property: 'width' },\n { ...slottedIcon, property: 'height' },\n ],\n },\n }),\n clickableMixin,\n draggableMixin,\n componentNameValidationMixin,\n)(\n createProxy({\n slots: ['', 'prefix', 'label', 'suffix'],\n wrappedEleName: 'vaadin-button',\n style: () => `\n\t\t\t${resetStyles}\n\t\t\t${iconStyles}\n\t\t\t${loadingIndicatorStyles}\n\t\t\t${editorOverrides}\n\t\t\t:host {\n\t\t\t\tpadding: calc(var(${ButtonClass.cssVarList.outlineWidth}) + var(${ButtonClass.cssVarList.outlineOffset}));\n\t\t\t}\n :host([full-width=\"true\"]) {\n width: var(${ButtonClass.cssVarList.hostWidth});\n }\n\t\t\tvaadin-button {\n\t\t\t\theight: calc(var(${ButtonClass.cssVarList.hostHeight}) - var(${ButtonClass.cssVarList.outlineWidth}) - var(${ButtonClass.cssVarList.outlineOffset}));\n\t\t\t}\n\t\t\t[square=\"true\"]:not([full-width=\"true\"]) {\n\t\t\t\twidth: calc(var(${ButtonClass.cssVarList.hostWidth}) - var(${ButtonClass.cssVarList.outlineWidth}) - var(${ButtonClass.cssVarList.outlineOffset}));\n padding: 0;\n\t\t\t}\n\t\t`,\n excludeAttrsSync: ['tabindex', 'class', 'style'],\n componentName,\n }),\n);\n\nconst { color, fontSize } = ButtonClass.cssVarList;\nloadingIndicatorStyles = `\n\t@keyframes spin {\n\t\t0% { -webkit-transform: rotate(0deg); }\n\t\t100% { -webkit-transform: rotate(360deg); }\n\t}\n\t:host([loading=\"true\"]) ::before {\n\t\tanimation: spin 2s linear infinite;\n\t\tposition: absolute;\n\t\tcontent: '';\n\t\tz-index: 1;\n\t\tbox-sizing: border-box;\n\t\tborder-radius: 50%;\n\t\tborder-bottom-color: transparent;\n\t\tborder-left-color: transparent;\n\t\tborder-style: solid;\n\t\tcolor: var(${color});\n\t\ttop: calc(50% - (var(${fontSize}) / 2));\n\t\tleft: calc(50% - (var(${fontSize}) / 2));\n\t\tborder-width: calc(var(${fontSize}) / 10);\n\t\twidth: var(${fontSize});\n\t\theight: var(${fontSize});\n\t}\n\t:host([disabled=\"true\"]),\n\t:host([loading=\"true\"]) {\n\t\tpointer-events: none;\n\t}\n\t:host([loading=\"true\"]) ::part(prefix),\n\t:host([loading=\"true\"]) ::part(label) {\n\t\tvisibility: hidden;\n\t}\n`;\n","export const clickableMixin = (superclass) =>\n class ClickableMixinClass extends superclass {\n get isLoading() {\n return this.getAttribute('loading') === 'true';\n }\n\n click() {\n this.isLoading || super.click();\n }\n };\n","import { componentName, ButtonClass } from './ButtonClass';\nimport '@vaadin/button';\n\ncustomElements.define(componentName, ButtonClass);\n\nexport { ButtonClass, componentName };\n","import {\n componentNameValidationMixin,\n createProxy,\n createStyleMixin,\n draggableMixin,\n} from '@descope-ui/common/components-mixins';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport { ImageClass } from '@descope-ui/descope-image/class';\nimport { compose } from '@descope-ui/common/utils';\n\nexport const componentName = getComponentName('icon');\n\nexport const IconClass = compose(\n createStyleMixin({\n mappings: {\n fill: [{}, { property: ImageClass.cssVarList.fill }],\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(\n createProxy({\n slots: [],\n wrappedEleName: 'descope-image',\n style: () => `\n :host {\n display: inline-flex;\n max-height: 100%;\n }\n `,\n excludeAttrsSync: ['tabindex', 'class', 'style'],\n componentName,\n }),\n);\n","/* eslint-disable no-use-before-define */\nimport {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { compose } from '@descope-ui/common/utils';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport { createImage } from './helpers';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('image');\n\nconst srcAttrs = ['src', 'src-dark'];\n\nclass RawImage extends createBaseClass({\n componentName,\n baseSelector: 'slot',\n}) {\n static get observedAttributes() {\n return srcAttrs;\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<slot></slot>\n\t`;\n\n injectStyle(\n `\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n :host > slot {\n width: 100%;\n height: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tdisplay: flex;\n\t\t\t\toverflow: hidden;\n\t\t\t}\n\n ::slotted(*) {\n width: 100%;\n\t\t\t}\n\n .hidden {\n display: none;\n }\n `,\n this,\n );\n }\n\n init() {\n super.init?.();\n this.toggleVisibility(this.getSrc);\n }\n\n onThemeChange() {\n this.renderImage();\n }\n\n toggleVisibility(isVisible) {\n if (isVisible) {\n this.classList.remove('hidden');\n } else {\n this.classList.add('hidden');\n }\n }\n\n get altText() {\n return this.getAttribute('alt') || '';\n }\n\n get legacySrc() {\n return this.getAttribute('src');\n }\n\n get themeSrc() {\n return this.getAttribute(`src-${this.currentThemeName}`);\n }\n\n get getSrc() {\n return this.themeSrc || this.legacySrc;\n }\n\n // in order to fill an SVG with `currentColor` override all of its `fill` and `path` nodes\n // with the value from the `st-fill` attribute\n // eslint-disable-next-line class-methods-use-this\n updateFillColor(node) {\n // set fill to root node and all its relevant selectors\n const elementsToReplace = [node, ...node.querySelectorAll('*[fill]')];\n\n elementsToReplace.forEach((ele) => {\n ele.setAttribute(\n 'fill',\n `var(${ImageClass.cssVarList.fill}, ${ele.getAttribute('fill') || \"''\"})`,\n );\n });\n }\n\n renderImage() {\n this.toggleVisibility(this.getSrc);\n\n createImage(this.getSrc, this.altText).then((res) => {\n this.innerHTML = '';\n if (res) {\n this.updateFillColor(res);\n this.appendChild(res);\n }\n });\n }\n\n // render only when src attribute matches current theme\n shouldRender(src) {\n const srcVal = this.getAttribute(src);\n return this.getSrc === srcVal;\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue === newValue) return;\n\n if (this.shouldRender(attrName)) {\n this.renderImage();\n }\n }\n}\n\nexport const ImageClass = compose(\n createStyleMixin({\n mappings: {\n fill: {},\n height: { selector: () => ':host' },\n width: { selector: () => ':host' },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawImage);\n","import DOMPurify from 'dompurify';\n\nconst getFileExtension = (path) => {\n const match = path.match(/\\.([0-9a-z]+)(?:[\\\\?#]|$)/i);\n return match ? match[1] : null;\n};\n\nconst base64Prefix = 'data:image/svg+xml;base64,';\n\nconst isBase64Svg = (src) => src.startsWith(base64Prefix);\n\nconst createImgEle = (src, altText) => {\n const ele = document.createElement('img');\n ele.setAttribute('src', src);\n ele.setAttribute('alt', altText);\n return ele;\n};\n\nconst createSvgEle = (text) => {\n // we want to purify the SVG to avoid XSS attacks\n const clean = DOMPurify.sanitize(text, {\n USE_PROFILES: { svg: true, svgFilters: true },\n // allow image to render\n ADD_TAGS: ['image'],\n // forbid interactiviy via `use` tags (which are sanitized by default)\n FORBID_TAGS: ['defs']\n });\n\n const parser = new DOMParser();\n const ele = parser\n .parseFromString(clean, 'image/svg+xml')\n .querySelector('svg');\n return ele;\n};\n\nexport const createImage = async (src, altText) => {\n try {\n let ele;\n if (isBase64Svg(src)) {\n // handle base64 source\n const svgXml = atob(src.slice(base64Prefix.length));\n ele = createSvgEle(svgXml);\n } else if (getFileExtension(src) === 'svg') {\n // handle urls\n const fetchedSrc = await fetch(src);\n const text = await fetchedSrc.text();\n ele = createSvgEle(text);\n } else {\n // handle binary\n ele = createImgEle(src, altText);\n }\n\n ele.style.setProperty('max-width', '100%');\n ele.style.setProperty('max-height', '100%');\n\n return ele;\n } catch {\n return null;\n }\n};\n","import { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n injectStyle,\n} from '@descope-ui/common/components-helpers';\nimport {\n createStyleMixin,\n draggableMixin,\n} from '@descope-ui/common/components-mixins';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { MultiSelectComboBoxClass } from '@descope-ui/descope-multi-select-combo-box/class';\nimport { ButtonClass } from '@descope-ui/descope-button/class';\n\nexport const componentName = getComponentName('multi-line-mappings');\nconst BaseClass = createBaseClass({ componentName });\n\nconst parseJSON = (value, fallback, source = 'unknown') => {\n if (typeof value !== 'string' || !value?.trim()) {\n return fallback;\n }\n\n try {\n return JSON.parse(value);\n } catch (error) {\n console.error(\n `[descope-multi-line-mappings] Failed to parse JSON from \"${source}\"`,\n error,\n );\n return fallback;\n }\n};\n\nconst toNormalizedValue = (item) => {\n if (item === undefined || item === null) {\n return '';\n }\n\n if (typeof item === 'object') {\n return String(item.value ?? item.id ?? item.label ?? '');\n }\n\n return String(item);\n};\n\nconst uniqueValues = (values) => [\n ...new Set(values.map(toNormalizedValue).filter(Boolean)),\n];\n\nconst normalizeOption = (item) => {\n const value = toNormalizedValue(item);\n\n if (typeof item === 'object' && item !== null) {\n return {\n ...item,\n value,\n label: String(item.label ?? item.displayName ?? value),\n };\n }\n\n return { value, label: value };\n};\n\nconst normalizeOptions = (options) => {\n if (!Array.isArray(options)) {\n return [];\n }\n\n const uniqueSet = new Set();\n\n return options.map(normalizeOption).filter((option) => {\n if (!option.value || uniqueSet.has(option.value)) {\n return false;\n }\n\n uniqueSet.add(option.value);\n return true;\n });\n};\n\nconst createEmptyRow = () => ({ firstValues: [], secondValues: [] });\n\nconst areSameValues = (first = [], second = []) =>\n first.length === second.length && first.every((v, i) => v === second[i]);\n\nclass RawMultiLineMappingsClass extends BaseClass {\n static get observedAttributes() {\n return [\n 'data',\n 'max-rows',\n 'size',\n 'disabled',\n 'readonly',\n 'first-value-key',\n 'second-value-key',\n 'first-label',\n 'second-label',\n 'first-placeholder',\n 'second-placeholder',\n 'full-width',\n 'merge-rows',\n ];\n }\n\n #rows = [createEmptyRow()];\n\n #rawValue = null;\n\n #firstOptions = [];\n\n #secondOptionsByFirstValue = {};\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"wrapper\">\n <div class=\"rows\"></div>\n <div class=\"add-action\">\n <descope-button\n class=\"add-button\"\n variant=\"link\"\n mode=\"primary\"\n >\n <slot name=\"add-button-content\">Add line</slot>\n </descope-button>\n </div>\n </div>\n `;\n\n injectStyle(\n `\n :host {\n display: inline-flex;\n box-sizing: border-box;\n max-width: 100%;\n }\n\n .wrapper {\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n\n .rows {\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n\n .rows > .row {\n display: flex;\n width: 100%;\n min-width: 0;\n box-sizing: border-box;\n align-items: flex-end;\n }\n\n .row descope-multi-select-combo-box {\n flex: 1 1 0;\n box-sizing: border-box;\n }\n\n .row .remove-button {\n flex: 0 0 auto;\n align-self: flex-end;\n }\n\n .row:only-child .remove-button {\n display: none;\n pointer-events: none;\n }\n\n .add-action {\n display: flex;\n }\n `,\n this,\n );\n\n this.rowsElement = this.shadowRoot.querySelector('.rows');\n this.addButtonElement = this.shadowRoot.querySelector('.add-button');\n }\n\n get size() {\n return this.getAttribute('size') || 'md';\n }\n\n get firstValueKey() {\n return this.getAttribute('first-value-key') || 'firstValues';\n }\n\n get secondValueKey() {\n return this.getAttribute('second-value-key') || 'secondValues';\n }\n\n get firstLabel() {\n return this.getAttribute('first-label') || '';\n }\n\n get secondLabel() {\n return this.getAttribute('second-label') || '';\n }\n\n get firstPlaceholder() {\n return this.getAttribute('first-placeholder') || '';\n }\n\n get secondPlaceholder() {\n return this.getAttribute('second-placeholder') || '';\n }\n\n get disabled() {\n return this.getAttribute('disabled') === 'true';\n }\n\n get readonly() {\n return this.getAttribute('readonly') === 'true';\n }\n\n get mergeRows() {\n return this.getAttribute('merge-rows') === 'true';\n }\n\n get maxRows() {\n const maxRows = Number(this.getAttribute('max-rows'));\n\n return Number.isFinite(maxRows) && maxRows > 0 ? maxRows : undefined;\n }\n\n get data() {\n return this.#secondOptionsByFirstValue;\n }\n\n get value() {\n return this.#rows\n .filter(\n (row) => row.firstValues.length > 0 || row.secondValues.length > 0,\n )\n .flatMap((rowValue) => {\n const firsts = rowValue.firstValues.length\n ? rowValue.firstValues\n : [''];\n return firsts.map((firstValue) => ({\n [this.firstValueKey]: firstValue,\n [this.secondValueKey]: [...rowValue.secondValues],\n }));\n });\n }\n\n set value(value) {\n this.#rawValue = value;\n this.#rows = this.#normalizeRows(value);\n this.#dropStaleSelections();\n this.#renderRows();\n }\n\n #setData(rawValue) {\n const parsed = parseJSON(rawValue, {}, 'data attribute');\n const optionsMap =\n parsed && typeof parsed === 'object' && !Array.isArray(parsed)\n ? parsed\n : {};\n\n this.#firstOptions = Object.entries(optionsMap).map(([key, value]) => {\n const strKey = String(key);\n const isEnriched =\n value != null && typeof value === 'object' && !Array.isArray(value);\n const options = isEnriched ? (value.options ?? []) : value;\n const label =\n isEnriched && value.label != null ? String(value.label) : strKey;\n return { value: strKey, label, options: normalizeOptions(options) };\n });\n this.#secondOptionsByFirstValue = Object.fromEntries(\n this.#firstOptions.map(({ value, options }) => [value, options]),\n );\n }\n\n init() {\n super.init?.();\n this.#updateAddButtonSize();\n this.addButtonElement.addEventListener('click', () => this.#addRow());\n this.#renderRows();\n }\n\n attributeChangedCallback(name, oldValue, newValue) {\n super.attributeChangedCallback?.(name, oldValue, newValue);\n if (oldValue === newValue) return;\n\n if (name === 'data') {\n this.#setData(newValue);\n this.#dropStaleSelections();\n this.#renderRows();\n return;\n }\n\n if (name === 'size') {\n [...this.#getAllCombos(), ...this.#getAllRemoveButtons()].forEach((el) =>\n el.setAttribute('size', this.size),\n );\n this.#updateAddButtonSize();\n this.#updateAddButtonState();\n return;\n }\n\n if (['disabled', 'readonly'].includes(name)) {\n this.#getAllCombos().forEach((combo) => {\n combo[this.disabled ? 'setAttribute' : 'removeAttribute'](\n 'disabled',\n 'true',\n );\n combo[this.readonly ? 'setAttribute' : 'removeAttribute'](\n 'readonly',\n 'true',\n );\n });\n this.#getAllRemoveButtons().forEach((el) =>\n el[this.disabled || this.readonly ? 'setAttribute' : 'removeAttribute'](\n 'disabled',\n 'true',\n ),\n );\n this.#updateAddButtonState();\n return;\n }\n\n if (['first-label', 'second-label'].includes(name)) {\n const type = name === 'first-label' ? 'first' : 'second';\n Array.from(this.rowsElement.children).forEach((rowElement) => {\n const combo = rowElement.querySelector(`.${type}-combo`);\n if (newValue) combo?.setAttribute('label', newValue);\n else combo?.removeAttribute('label');\n });\n return;\n }\n\n if (['first-placeholder', 'second-placeholder'].includes(name)) {\n const type = name === 'first-placeholder' ? 'first' : 'second';\n Array.from(this.rowsElement.children).forEach((rowElement) => {\n const combo = rowElement.querySelector(`.${type}-combo`);\n if (newValue) combo?.setAttribute('placeholder', newValue);\n else combo?.removeAttribute('placeholder');\n });\n return;\n }\n\n if (name === 'max-rows') {\n this.#updateAddButtonState();\n }\n\n if (name === 'merge-rows' && this.#rawValue !== null) {\n this.#rows = this.#normalizeRows(this.#rawValue);\n this.#dropStaleSelections();\n this.#renderRows();\n }\n }\n\n #getAllCombos() {\n return Array.from(\n this.rowsElement.querySelectorAll('descope-multi-select-combo-box'),\n );\n }\n\n #getAllRemoveButtons() {\n return Array.from(this.rowsElement.querySelectorAll('.remove-button'));\n }\n\n #addRow() {\n if (this.disabled || this.readonly || this.#isMaxRowsReached()) {\n return;\n }\n\n const newRow = createEmptyRow();\n this.#rows = [...this.#rows, newRow];\n this.rowsElement.append(this.#createRowElement(newRow));\n this.#updateAddButtonState();\n }\n\n #normalizeRows(value) {\n if (!Array.isArray(value) || !value.length) {\n return [createEmptyRow()];\n }\n\n const rows = value.map((rowValue) => {\n const firstRaw = rowValue?.[this.firstValueKey];\n const firstValues =\n firstRaw != null && String(firstRaw) !== '' ? [String(firstRaw)] : [];\n\n return {\n firstValues,\n secondValues: uniqueValues(rowValue?.[this.secondValueKey] ?? []),\n };\n });\n\n let result = rows;\n\n if (this.mergeRows) {\n const map = new Map();\n for (const row of result) {\n const key = [...row.secondValues].sort().join('\\0');\n if (map.has(key)) {\n map.get(key).firstValues.push(...row.firstValues);\n } else {\n map.set(key, {\n firstValues: [...row.firstValues],\n secondValues: row.secondValues,\n });\n }\n }\n result = [...map.values()];\n }\n\n return result;\n }\n\n #dropStaleSelections() {\n const firstValuesSet = new Set(this.#firstOptions.map((o) => o.value));\n\n this.#rows = this.#rows.map((rowValue) => {\n const firstValues = rowValue.firstValues.filter((value) =>\n firstValuesSet.has(value),\n );\n const availableSecondOptions =\n this.#getSecondOptionsForFirstValues(firstValues);\n const availableSecondValuesSet = new Set(\n availableSecondOptions.map((item) => item.value),\n );\n\n const secondValues = rowValue.secondValues.filter((value) =>\n availableSecondValuesSet.has(value),\n );\n\n return {\n firstValues,\n secondValues,\n };\n });\n }\n\n #getSecondOptionsForFirstValues(firstValues) {\n // Get lists to intersect\n const lists = !firstValues.length\n ? Object.values(this.#secondOptionsByFirstValue).filter(\n (options) => options.length,\n )\n : firstValues\n .map((value) => this.#secondOptionsByFirstValue[value] || [])\n .filter((options) => options.length);\n\n if (\n !lists.length ||\n (firstValues.length && lists.length !== firstValues.length)\n ) {\n return [];\n }\n\n if (lists.length === 1) {\n return lists[0];\n }\n\n // Compute intersection of all lists\n const [baseList, ...otherLists] = lists;\n const intersectionSet = new Set(baseList.map((item) => item.value));\n\n for (const options of otherLists) {\n const currentSet = new Set(options.map((item) => item.value));\n for (const value of intersectionSet) {\n if (!currentSet.has(value)) {\n intersectionSet.delete(value);\n }\n }\n }\n\n return baseList.filter((item) => intersectionSet.has(item.value));\n }\n\n #createCombo({\n getRowIndex,\n type,\n label,\n placeholder,\n options,\n selectedValues,\n }) {\n const comboElement = document.createElement(\n 'descope-multi-select-combo-box',\n );\n\n comboElement.className = `combo ${type}-combo`;\n comboElement.setAttribute('size', this.size);\n comboElement.setAttribute('bordered', 'true');\n comboElement.setAttribute('item-label-path', 'data-name');\n comboElement.setAttribute('item-value-path', 'data-id');\n\n if (label) {\n comboElement.setAttribute('label', label);\n }\n\n if (placeholder) {\n comboElement.setAttribute('placeholder', placeholder);\n }\n\n if (this.disabled) {\n comboElement.setAttribute('disabled', 'true');\n }\n\n if (this.readonly) {\n comboElement.setAttribute('readonly', 'true');\n }\n\n comboElement.data = options;\n this.#syncComboSelection(comboElement, selectedValues);\n\n comboElement.addEventListener('input', () => {\n if (comboElement.__descopeSyncingSelection) {\n return;\n }\n\n const rowIndex = getRowIndex();\n if (rowIndex === -1) return;\n\n this.#handleComboChange({\n rowIndex,\n type,\n selectedValues: uniqueValues(comboElement.value || []),\n });\n });\n\n return comboElement;\n }\n\n #syncComboSelection(comboElement, selectedValues) {\n comboElement.__descopeSyncingSelection = true;\n Promise.resolve().then(() => {\n const selectedValuesSet = new Set(selectedValues || []);\n comboElement.selectedItems = (comboElement.items || []).filter((item) =>\n selectedValuesSet.has(\n item['data-id'] || item.getAttribute?.('data-id'),\n ),\n );\n comboElement.__descopeSyncingSelection = false;\n });\n }\n\n #createRemoveButton(getRowIndex) {\n const buttonElement = document.createElement('descope-button');\n\n buttonElement.className = 'remove-button';\n buttonElement.setAttribute('variant', 'link');\n buttonElement.setAttribute('mode', 'primary');\n buttonElement.setAttribute('size', this.size);\n buttonElement.setAttribute('aria-label', 'Remove row');\n buttonElement.innerHTML = '<vaadin-icon icon=\"vaadin:minus\"></vaadin-icon>';\n\n if (this.disabled || this.readonly) {\n buttonElement.setAttribute('disabled', 'true');\n }\n\n buttonElement.addEventListener('click', () => {\n const rowIndex = getRowIndex();\n if (rowIndex !== -1) this.#removeRow(rowIndex);\n });\n\n return buttonElement;\n }\n\n #renderRows() {\n this.rowsElement.innerHTML = '';\n this.#rows.forEach((rowValue) => {\n this.rowsElement.append(this.#createRowElement(rowValue));\n });\n this.#updateAddButtonState();\n }\n\n #createRowElement(rowValue) {\n const rowElement = document.createElement('div');\n rowElement.className = 'row';\n\n const getRowIndex = () =>\n Array.from(this.rowsElement.children).indexOf(rowElement);\n\n const firstCombo = this.#createCombo({\n getRowIndex,\n type: 'first',\n label: this.firstLabel,\n placeholder: this.firstPlaceholder,\n options: this.#firstOptions.map(({ value, label }) => ({ value, label })),\n selectedValues: rowValue.firstValues,\n });\n\n const secondOptions = this.#getSecondOptionsForFirstValues(\n rowValue.firstValues,\n );\n const secondCombo = this.#createCombo({\n getRowIndex,\n type: 'second',\n label: this.secondLabel,\n placeholder: this.secondPlaceholder,\n options: secondOptions,\n selectedValues: rowValue.secondValues,\n });\n\n rowElement.append(\n firstCombo,\n secondCombo,\n this.#createRemoveButton(getRowIndex),\n );\n return rowElement;\n }\n\n #updateSecondComboForRow(rowIndex) {\n const currentRowValue = this.#rows[rowIndex];\n if (!currentRowValue) return;\n\n const rowElement = this.rowsElement.children[rowIndex];\n const secondCombo = rowElement?.querySelector('.second-combo');\n if (!secondCombo) {\n this.#renderRows();\n return;\n }\n\n const secondOptions = this.#getSecondOptionsForFirstValues(\n currentRowValue.firstValues,\n );\n secondCombo.data = secondOptions;\n this.#syncComboSelection(secondCombo, currentRowValue.secondValues);\n }\n\n #updateAddButtonSize() {\n this.addButtonElement.setAttribute('size', this.size);\n }\n\n #updateAddButtonState() {\n if (this.disabled || this.readonly || this.#isMaxRowsReached()) {\n this.addButtonElement.setAttribute('disabled', 'true');\n } else {\n this.addButtonElement.removeAttribute('disabled');\n }\n }\n\n #isMaxRowsReached() {\n return Number.isFinite(this.maxRows) && this.#rows.length >= this.maxRows;\n }\n\n #removeRowFromDOM(rowIndex) {\n this.rowsElement.children[rowIndex]?.remove();\n }\n\n #handleComboChange({ rowIndex, type, selectedValues }) {\n if (this.disabled || this.readonly) {\n return;\n }\n\n const currentRow = this.#rows[rowIndex];\n\n if (!currentRow) {\n return;\n }\n\n if (type === 'first') {\n const availableSecondOptions =\n this.#getSecondOptionsForFirstValues(selectedValues);\n const availableSecondValuesSet = new Set(\n availableSecondOptions.map((item) => item.value),\n );\n\n const nextSecondValues = currentRow.secondValues.filter((value) =>\n availableSecondValuesSet.has(value),\n );\n\n if (\n areSameValues(currentRow.firstValues, selectedValues) &&\n areSameValues(currentRow.secondValues, nextSecondValues)\n ) {\n return;\n }\n\n this.#rows[rowIndex] = {\n firstValues: selectedValues,\n secondValues: nextSecondValues,\n };\n\n this.#updateSecondComboForRow(rowIndex);\n this.#emitValueChange();\n return;\n }\n\n if (areSameValues(currentRow.secondValues, selectedValues)) {\n return;\n }\n\n this.#rows[rowIndex] = {\n ...currentRow,\n secondValues: selectedValues,\n };\n\n this.#emitValueChange();\n }\n\n #removeRow(rowIndex) {\n if (this.disabled || this.readonly || this.#rows.length <= 1) {\n return;\n }\n\n const removedRow = this.#rows[rowIndex];\n this.#rows = this.#rows.filter((_, index) => index !== rowIndex);\n\n this.#removeRowFromDOM(rowIndex);\n this.#updateAddButtonState();\n\n const rowHadValues =\n removedRow.firstValues.length > 0 || removedRow.secondValues.length > 0;\n if (rowHadValues) {\n this.#emitValueChange();\n }\n }\n\n #emitValueChange() {\n this.dispatchEvent(new Event('input', { bubbles: true, composed: true }));\n }\n}\n\nconst host = { selector: () => ':host' };\nconst rows = { selector: '.rows' };\nconst row = { selector: '.row' };\nconst addAction = { selector: '.add-action' };\n\nexport const MultiLineMappingsClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: [\n { ...host, property: 'direction' },\n {\n selector: MultiSelectComboBoxClass.componentName,\n property: MultiSelectComboBoxClass.cssVarList.hostDirection,\n },\n {\n selector: ButtonClass.componentName,\n property: ButtonClass.cssVarList.hostDirection,\n },\n ],\n rowsGap: { ...rows, property: 'gap' },\n rowGap: { ...row, property: 'gap' },\n rowAlignItems: { ...row, property: 'align-items' },\n rowWrap: { ...row, property: 'flex-wrap' },\n addActionJustifyContent: { ...addAction, property: 'justify-content' },\n addActionMarginTop: { ...addAction, property: 'margin-top' },\n },\n }),\n draggableMixin,\n)(RawMultiLineMappingsClass);\n","import '@descope-ui/descope-button';\nimport '@descope-ui/descope-multi-select-combo-box';\n\nimport {\n componentName,\n MultiLineMappingsClass,\n} from './MultiLineMappingsClass';\n\ncustomElements.define(componentName, MultiLineMappingsClass);\n\nexport { MultiLineMappingsClass, componentName };\n","/**\n * @license\n * Copyright (c) 2017 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { css } from 'lit';\n\nexport const buttonStyles = css`\n :host {\n display: inline-block;\n position: relative;\n outline: none;\n white-space: nowrap;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n }\n\n :host([hidden]) {\n display: none !important;\n }\n\n /* Aligns the button with form fields when placed on the same line.\n Note, to make it work, the form fields should have the same \"::before\" pseudo-element. */\n .vaadin-button-container::before {\n content: '\\\\2003';\n display: inline-block;\n width: 0;\n max-height: 100%;\n }\n\n .vaadin-button-container {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n width: 100%;\n height: 100%;\n min-height: inherit;\n text-shadow: inherit;\n }\n\n [part='prefix'],\n [part='suffix'] {\n flex: none;\n }\n\n [part='label'] {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n @media (forced-colors: active) {\n :host {\n outline: 1px solid;\n outline-offset: -1px;\n }\n\n :host([focused]) {\n outline-width: 2px;\n }\n\n :host([disabled]) {\n outline-color: GrayText;\n }\n }\n`;\n\nexport const buttonTemplate = (html) => html`\n <div class=\"vaadin-button-container\">\n <span part=\"prefix\" aria-hidden=\"true\">\n <slot name=\"prefix\"></slot>\n </span>\n <span part=\"label\">\n <slot></slot>\n </span>\n <span part=\"suffix\" aria-hidden=\"true\">\n <slot name=\"suffix\"></slot>\n </span>\n </div>\n <slot name=\"tooltip\"></slot>\n`;\n","/**\n * @license\n * Copyright (c) 2017 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { ActiveMixin } from '@vaadin/a11y-base/src/active-mixin.js';\nimport { FocusMixin } from '@vaadin/a11y-base/src/focus-mixin.js';\nimport { TabindexMixin } from '@vaadin/a11y-base/src/tabindex-mixin.js';\n\n/**\n * A mixin providing common button functionality.\n *\n * @polymerMixin\n * @mixes ActiveMixin\n * @mixes FocusMixin\n * @mixes TabindexMixin\n */\nexport const ButtonMixin = (superClass) =>\n class ButtonMixinClass extends ActiveMixin(TabindexMixin(FocusMixin(superClass))) {\n static get properties() {\n return {\n /**\n * Indicates whether the element can be focused and where it participates in sequential keyboard navigation.\n *\n * @override\n * @protected\n */\n tabindex: {\n type: Number,\n value: 0,\n reflectToAttribute: true,\n },\n };\n }\n\n /**\n * By default, `Space` is the only possible activation key for a focusable HTML element.\n * Nonetheless, the button is an exception as it can be also activated by pressing `Enter`.\n * See the \"Keyboard Support\" section in https://www.w3.org/TR/wai-aria-practices/examples/button/button.html.\n *\n * @protected\n * @override\n */\n get _activeKeys() {\n return ['Enter', ' '];\n }\n\n /** @protected */\n ready() {\n super.ready();\n\n // By default, if the user hasn't provided a custom role,\n // the role attribute is set to \"button\".\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'button');\n }\n }\n\n /**\n * Since the button component is designed on the base of the `[role=button]` attribute,\n * and doesn't have a native <button> inside, in order to be fully accessible from the keyboard,\n * it should manually fire the `click` event once an activation key is pressed,\n * as it follows from the WAI-ARIA specifications:\n * https://www.w3.org/TR/wai-aria-practices-1.1/#button\n *\n * According to the UI Events specifications,\n * the `click` event should be fired exactly on `keydown`:\n * https://www.w3.org/TR/uievents/#event-type-keydown\n *\n * @param {KeyboardEvent} event\n * @protected\n * @override\n */\n _onKeyDown(event) {\n super._onKeyDown(event);\n\n if (event.altKey || event.shiftKey || event.ctrlKey || event.metaKey) {\n return;\n }\n\n if (this._activeKeys.includes(event.key)) {\n event.preventDefault();\n\n // `DisabledMixin` overrides the standard `click()` method\n // so that it doesn't fire the `click` event when the element is disabled.\n this.click();\n }\n }\n };\n","/**\n * @license\n * Copyright (c) 2017 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { html, PolymerElement } from '@polymer/polymer/polymer-element.js';\nimport { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';\nimport { defineCustomElement } from '@vaadin/component-base/src/define.js';\nimport { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';\nimport { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';\nimport { registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';\nimport { buttonStyles, buttonTemplate } from './vaadin-button-base.js';\nimport { ButtonMixin } from './vaadin-button-mixin.js';\n\nregisterStyles('vaadin-button', buttonStyles, { moduleId: 'vaadin-button-styles' });\n\n/**\n * `<vaadin-button>` is an accessible and customizable button that allows users to perform actions.\n *\n * ```html\n * <vaadin-button>Press me</vaadin-button>\n * ```\n *\n * ### Styling\n *\n * The following shadow DOM parts are available for styling:\n *\n * Part name | Description\n * ----------|-------------\n * `label` | The label (text) inside the button.\n * `prefix` | A slot for content before the label (e.g. an icon).\n * `suffix` | A slot for content after the label (e.g. an icon).\n *\n * The following attributes are available for styling:\n *\n * Attribute | Description\n * -------------|-------------\n * `active` | Set when the button is pressed down, either with mouse, touch or the keyboard.\n * `disabled` | Set when the button is disabled.\n * `focus-ring` | Set when the button is focused using the keyboard.\n * `focused` | Set when the button is focused.\n *\n * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n *\n * @customElement\n * @extends HTMLElement\n * @mixes ButtonMixin\n * @mixes ControllerMixin\n * @mixes ElementMixin\n * @mixes ThemableMixin\n */\nclass Button extends ButtonMixin(ElementMixin(ThemableMixin(ControllerMixin(PolymerElement)))) {\n static get is() {\n return 'vaadin-button';\n }\n\n static get template() {\n return buttonTemplate(html);\n }\n\n /** @protected */\n ready() {\n super.ready();\n\n this._tooltipController = new TooltipController(this);\n this.addController(this._tooltipController);\n }\n}\n\ndefineCustomElement(Button);\n\nexport { Button };\n","import '@vaadin/vaadin-lumo-styles/color.js';\nimport '@vaadin/vaadin-lumo-styles/sizing.js';\nimport '@vaadin/vaadin-lumo-styles/spacing.js';\nimport '@vaadin/vaadin-lumo-styles/style.js';\nimport '@vaadin/vaadin-lumo-styles/typography.js';\nimport { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';\n\nconst button = css`\n :host {\n /* Sizing */\n --lumo-button-size: var(--lumo-size-m);\n min-width: var(--vaadin-button-min-width, calc(var(--_button-size) * 2));\n height: var(--_button-size);\n padding: var(--vaadin-button-padding, 0 calc(var(--_button-size) / 3 + var(--lumo-border-radius-m) / 2));\n margin: var(--vaadin-button-margin, var(--lumo-space-xs) 0);\n box-sizing: border-box;\n /* Style */\n font-family: var(--lumo-font-family);\n font-size: var(--vaadin-button-font-size, var(--lumo-font-size-m));\n font-weight: var(--vaadin-button-font-weight, 500);\n color: var(--_lumo-button-text-color);\n background: var(--_lumo-button-background);\n border: var(--vaadin-button-border, none);\n border-radius: var(--vaadin-button-border-radius, var(--lumo-border-radius-m));\n cursor: var(--lumo-clickable-cursor);\n -webkit-tap-highlight-color: transparent;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n flex-shrink: 0;\n --_button-size: var(--vaadin-button-height, var(--lumo-button-size));\n --_focus-ring-color: var(--vaadin-focus-ring-color, var(--lumo-primary-color-50pct));\n --_focus-ring-width: var(--vaadin-focus-ring-width, 2px);\n /* Used by notification */\n --_lumo-button-background: var(--vaadin-button-background, var(--lumo-contrast-5pct));\n --_lumo-button-text-color: var(--vaadin-button-text-color, var(--lumo-primary-text-color));\n --_lumo-button-primary-background: var(--vaadin-button-primary-background, var(--lumo-primary-color));\n --_lumo-button-primary-text-color: var(--vaadin-button-primary-text-color, var(--lumo-primary-contrast-color));\n }\n\n /* Set only for the internal parts so we don't affect the host vertical alignment */\n [part='label'],\n [part='prefix'],\n [part='suffix'] {\n line-height: var(--lumo-line-height-xs);\n }\n\n [part='label'] {\n padding: calc(var(--lumo-button-size) / 6) 0;\n }\n\n :host([theme~='small']) {\n font-size: var(--lumo-font-size-s);\n --lumo-button-size: var(--lumo-size-s);\n }\n\n :host([theme~='large']) {\n font-size: var(--lumo-font-size-l);\n --lumo-button-size: var(--lumo-size-l);\n }\n\n /* For interaction states */\n :host::before,\n :host::after {\n content: '';\n /* We rely on the host always being relative */\n position: absolute;\n z-index: 1;\n inset: 0;\n background-color: currentColor;\n border-radius: inherit;\n opacity: 0;\n pointer-events: none;\n }\n\n /* Hover */\n\n @media (any-hover: hover) {\n :host(:hover)::before {\n opacity: 0.02;\n }\n }\n\n /* Active */\n\n :host::after {\n transition: opacity 1.4s, transform 0.1s;\n filter: blur(8px);\n }\n\n :host([active])::before {\n opacity: 0.05;\n transition-duration: 0s;\n }\n\n :host([active])::after {\n opacity: 0.1;\n transition-duration: 0s, 0s;\n transform: scale(0);\n }\n\n /* Keyboard focus */\n\n :host([focus-ring]) {\n box-shadow: 0 0 0 var(--_focus-ring-width) var(--_focus-ring-color);\n }\n\n :host([theme~='primary'][focus-ring]) {\n box-shadow: 0 0 0 1px var(--lumo-base-color), 0 0 0 3px var(--lumo-primary-color-50pct);\n }\n\n /* Types (primary, tertiary, tertiary-inline */\n\n :host([theme~='tertiary']),\n :host([theme~='tertiary-inline']) {\n --_background: transparent !important;\n background: var(--vaadin-button-tertiary-background, var(--_background));\n min-width: 0;\n }\n\n :host([theme~='tertiary']) {\n border: var(--vaadin-button-tertiary-border, none);\n color: var(--vaadin-button-tertiary-text-color, var(--lumo-primary-text-color));\n font-weight: var(--vaadin-button-tertiary-font-weight, 500);\n padding: var(--vaadin-button-tertiary-padding, 0 calc(var(--_button-size) / 6));\n }\n\n :host([theme~='tertiary-inline'])::before {\n display: none;\n }\n\n :host([theme~='tertiary-inline']) {\n margin: 0;\n height: auto;\n padding: 0;\n line-height: inherit;\n font-size: inherit;\n }\n\n :host([theme~='tertiary-inline']) [part='label'] {\n padding: 0;\n overflow: visible;\n line-height: inherit;\n }\n\n :host([theme~='primary']) {\n background: var(--_lumo-button-primary-background);\n border: var(--vaadin-button-primary-border, none);\n color: var(--_lumo-button-primary-text-color);\n font-weight: var(--vaadin-button-primary-font-weight, 600);\n min-width: calc(var(--lumo-button-size) * 2.5);\n }\n\n :host([theme~='primary'])::before {\n background-color: black;\n }\n\n @media (any-hover: hover) {\n :host([theme~='primary']:hover)::before {\n opacity: 0.05;\n }\n }\n\n :host([theme~='primary'][active])::before {\n opacity: 0.1;\n }\n\n :host([theme~='primary'][active])::after {\n opacity: 0.2;\n }\n\n /* Colors (success, error, contrast) */\n\n :host([theme~='success']) {\n color: var(--lumo-success-text-color);\n }\n\n :host([theme~='success'][theme~='primary']) {\n background-color: var(--lumo-success-color);\n color: var(--lumo-success-contrast-color);\n }\n\n :host([theme~='error']) {\n color: var(--lumo-error-text-color);\n }\n\n :host([theme~='error'][theme~='primary']) {\n background-color: var(--lumo-error-color);\n color: var(--lumo-error-contrast-color);\n }\n\n :host([theme~='contrast']) {\n color: var(--lumo-contrast);\n }\n\n :host([theme~='contrast'][theme~='primary']) {\n background-color: var(--lumo-contrast);\n color: var(--lumo-base-color);\n }\n\n /* Disabled state. Keep selectors after other color variants. */\n\n :host([disabled]) {\n pointer-events: none;\n color: var(--lumo-disabled-text-color);\n }\n\n :host([theme~='primary'][disabled]) {\n background-color: var(--lumo-contrast-30pct);\n color: var(--lumo-base-color);\n }\n\n :host([theme~='primary'][disabled]) [part] {\n opacity: 0.7;\n }\n\n /* Icons */\n\n [part] ::slotted(vaadin-icon) {\n display: inline-block;\n width: var(--lumo-icon-size-m);\n height: var(--lumo-icon-size-m);\n }\n\n /* Vaadin icons are based on a 16x16 grid (unlike Lumo and Material icons with 24x24), so they look too big by default */\n [part] ::slotted(vaadin-icon[icon^='vaadin:']) {\n padding: 0.25em;\n box-sizing: border-box !important;\n }\n\n [part='prefix'] {\n margin-left: -0.25em;\n margin-right: 0.25em;\n }\n\n [part='suffix'] {\n margin-left: 0.25em;\n margin-right: -0.25em;\n }\n\n /* Icon-only */\n\n :host([theme~='icon']:not([theme~='tertiary-inline'])) {\n min-width: var(--lumo-button-size);\n padding-left: calc(var(--lumo-button-size) / 4);\n padding-right: calc(var(--lumo-button-size) / 4);\n }\n\n :host([theme~='icon']) [part='prefix'],\n :host([theme~='icon']) [part='suffix'] {\n margin-left: 0;\n margin-right: 0;\n }\n\n /* RTL specific styles */\n\n :host([dir='rtl']) [part='prefix'] {\n margin-left: 0.25em;\n margin-right: -0.25em;\n }\n\n :host([dir='rtl']) [part='suffix'] {\n margin-left: -0.25em;\n margin-right: 0.25em;\n }\n\n :host([dir='rtl'][theme~='icon']) [part='prefix'],\n :host([dir='rtl'][theme~='icon']) [part='suffix'] {\n margin-left: 0;\n margin-right: 0;\n }\n`;\n\nregisterStyles('vaadin-button', button, { moduleId: 'lumo-button' });\n\nexport { button };\n"],"names":["componentName","host","label","slottedIcon","selector","loadingIndicatorStyles","ButtonClass","triggers","attr","value","mappings","hostWidth","property","hostHeight","hostDirection","fontSize","fontFamily","fontWeight","cursor","backgroundColor","outlineOffset","outlineColor","outlineStyle","outlineWidth","borderRadius","borderColor","borderStyle","borderWidth","verticalPadding","horizontalPadding","fallback","labelTextColor","iconColor","cssVarList","fill","labelTextDecoration","labelSpacing","textAlign","iconSize","slots","wrappedEleName","style","excludeAttrsSync","color","clickableMixin","superclass","isLoading","this","getAttribute","click","super","customElements","define","IconClass","srcAttrs","RawImage","baseSelector","observedAttributes","constructor","attachShadow","mode","innerHTML","init","toggleVisibility","getSrc","onThemeChange","renderImage","isVisible","classList","remove","add","altText","legacySrc","themeSrc","currentThemeName","updateFillColor","node","querySelectorAll","forEach","ele","setAttribute","ImageClass","then","res","appendChild","shouldRender","src","srcVal","attributeChangedCallback","attrName","oldValue","newValue","height","width","createSvgEle","text","clean","sanitize","USE_PROFILES","svg","svgFilters","ADD_TAGS","FORBID_TAGS","DOMParser","parseFromString","querySelector","createImage","async","startsWith","isBase64Svg","svgXml","atob","slice","base64Prefix","path","match","getFileExtension","fetchedSrc","fetch","document","createElement","createImgEle","setProperty","BaseClass","toNormalizedValue","item","String","id","uniqueValues","values","Set","map","filter","Boolean","normalizeOption","displayName","normalizeOptions","options","Array","isArray","uniqueSet","option","has","areSameValues","first","second","length","every","v","i","row","addAction","MultiLineMappingsClass","MultiSelectComboBoxClass","rowsGap","rowGap","rowAlignItems","rowWrap","addActionJustifyContent","addActionMarginTop","firstValues","secondValues","rowsElement","shadowRoot","addButtonElement","size","firstValueKey","secondValueKey","firstLabel","secondLabel","firstPlaceholder","secondPlaceholder","disabled","readonly","mergeRows","maxRows","Number","isFinite","undefined","data","flatMap","rowValue","firstValue","rawValue","parsed","source","trim","JSON","parse","error","console","parseJSON","optionsMap","Object","entries","key","strKey","isEnriched","fromEntries","addEventListener","name","el","includes","combo","type","from","children","rowElement","removeAttribute","newRow","append","result","firstRaw","Map","sort","join","get","push","set","firstValuesSet","o","availableSecondOptions","availableSecondValuesSet","lists","baseList","otherLists","intersectionSet","currentSet","delete","getRowIndex","placeholder","selectedValues","comboElement","className","__descopeSyncingSelection","rowIndex","Promise","resolve","selectedValuesSet","selectedItems","items","buttonElement","indexOf","firstCombo","secondOptions","secondCombo","currentRowValue","currentRow","nextSecondValues","removedRow","_","index","dispatchEvent","Event","bubbles","composed","buttonStyles","ButtonMixin","superClass","properties","tabindex","reflectToAttribute","_activeKeys","ready","hasAttribute","_onKeyDown","event","altKey","shiftKey","ctrlKey","metaKey","preventDefault","moduleId","Button","is","template","_tooltipController","addController","button"],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[9054],{94681(e,t,o){o.d(t,{T:()=>l,t:()=>I});var r=o(63200),i=o(25964),n=o(79673),a=o(88961);const l=(0,i.xE)("multi-select-combo-box"),{host:s,inputField:p,inputElement:d,placeholder:c,toggle:u,clearButton:m,label:h,requiredIndicator:b,helperText:y,errorMessage:g,chip:v,chipLabel:f,overflowChipFirstBorder:x,overflowChipSecondBorder:w}={host:{selector:()=>":host"},inputField:{selector:"::part(input-field)"},inputElement:{selector:"input"},placeholder:{selector:"> input:placeholder-shown"},toggle:{selector:"::part(toggle-button)"},clearButton:{selector:"::part(clear-button)"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"},chip:{selector:"vaadin-multi-select-combo-box-chip"},chipLabel:{selector:"vaadin-multi-select-combo-box-chip::part(label)"},overflowChipFirstBorder:{selector:"vaadin-multi-select-combo-box-chip[slot='overflow']::before"},overflowChipSecondBorder:{selector:"vaadin-multi-select-combo-box-chip[slot='overflow']::after"}},I=(0,r.Zz)((0,a.RF)({mappings:{hostWidth:{...s,property:"width"},hostDirection:{...s,property:"direction"},fontSize:[{},s],chipFontSize:{...f,property:"font-size"},fontFamily:[h,c,p,y,g,f],labelFontSize:{...h,property:"font-size"},labelFontWeight:{...h,property:"font-weight"},inputValueFontWeight:{...p,property:"font-weight"},inputPlaceholderFontWeight:{...c,property:"font-weight"},helperTextFontWeight:{...y,property:"font-weight"},errorMessageFontWeight:{...g,property:"font-weight"},labelTextColor:[{...h,property:"color"},{...b,property:"color"}],errorMessageTextColor:{...g,property:"color"},errorMessageIcon:{...g,property:"background-image"},errorMessageIconSize:{...g,property:"background-size"},errorMessageIconPadding:{...g,property:"padding-inline-start"},errorMessageIconRepeat:{...g,property:"background-repeat"},errorMessageIconPosition:{...g,property:"background-position"},errorMessageFontSize:{...g,property:"font-size"},inputHeight:{...p,property:"min-height"},inputBackgroundColor:{...p,property:"background-color"},inputBorderColor:{...p,property:"border-color"},inputBorderWidth:{...p,property:"border-width"},inputBorderStyle:{...p,property:"border-style"},inputBorderRadius:{...p,property:"border-radius"},labelRequiredIndicator:{...b,property:"content"},inputValueTextColor:{...p,property:"color"},inputPlaceholderTextColor:{...c,property:"color"},inputDropdownButtonCursor:[{...u,property:"cursor"},{...m,property:"cursor"}],inputDropdownButtonColor:[{...u,property:"color"},{...m,property:"color"}],inputDropdownButtonSize:[{...u,property:"font-size"},{...m,property:"font-size"}],inputDropdownButtonOffset:[{...u,property:"margin-right"},{...u,property:"margin-left"}],inputOutlineColor:{...p,property:"outline-color"},inputOutlineWidth:{...p,property:"outline-width"},inputOutlineStyle:{...p,property:"outline-style"},inputOutlineOffset:{...p,property:"outline-offset"},inputHorizontalPadding:[{...d,property:"padding-left"},{...d,property:"padding-right"},{...p,property:"padding-inline-start"}],inputVerticalPadding:[{...p,property:"padding-top"},{...p,property:"padding-bottom"}],chipTextColor:{...f,property:"color"},chipBackgroundColor:[{...v,property:"background-color"},{...x,property:"border-color"},{...w,property:"border-color"}],labelPosition:{...h,property:"position"},labelTopPosition:{...h,property:"top"},labelLeftPosition:{...h,property:"left"},labelHorizontalPosition:[{...h,property:"left"},{...h,property:"right"}],inputTransformY:{...h,property:"transform"},inputTransition:{...h,property:"transition"},marginInlineStart:{...h,property:"margin-inline-start"},placeholderOpacity:{...c,property:"opacity"},inputVerticalAlignment:{...p,property:"align-items"},overlayBackground:{property:()=>I.cssVarList.overlay.backgroundColor},overlayTextColor:{property:()=>I.cssVarList.overlay.textColor},overlayBorder:{property:()=>I.cssVarList.overlay.border},overlayFontSize:{property:()=>I.cssVarList.overlay.fontSize},overlayFontFamily:{property:()=>I.cssVarList.overlay.fontFamily},overlayCursor:{property:()=>I.cssVarList.overlay.cursor},overlayItemBoxShadow:{property:()=>I.cssVarList.overlay.itemBoxShadow},overlayItemPaddingInlineStart:{property:()=>I.cssVarList.overlay.itemPaddingInlineStart},overlayItemPaddingInlineEnd:{property:()=>I.cssVarList.overlay.itemPaddingInlineEnd}}}),a.VO,(0,a.mA)({name:"overlay",selector:"vaadin-multi-select-combo-box-internal",mappings:{backgroundColor:{selector:"vaadin-multi-select-combo-box-scroller"},minHeight:{selector:"vaadin-multi-select-combo-box-overlay"},margin:{selector:"vaadin-multi-select-combo-box-overlay"},cursor:{selector:"vaadin-multi-select-combo-box-item"},fontFamily:{selector:"vaadin-multi-select-combo-box-item"},textColor:{selector:"vaadin-multi-select-combo-box-item",property:"color"},fontSize:{selector:"vaadin-multi-select-combo-box-item"},itemBoxShadow:{selector:"vaadin-multi-select-combo-box-item",property:"box-shadow"},itemPaddingInlineStart:{selector:"vaadin-multi-select-combo-box-item",property:"padding-inline-start"},itemPaddingInlineEnd:{selector:"vaadin-multi-select-combo-box-item",property:"padding-inline-end"}},forward:{include:!1,attributes:["size"]}}),(0,a.OZ)({proxyProps:["selectionStart"],inputEvent:"selected-items-changed"}),a._$,a.tQ,e=>class extends e{static get observedAttributes(){return["readonly"]}#e=({displayName:e,value:t,label:o})=>{const r=document.createElement("span");return r.setAttribute("data-name",o),r.setAttribute("data-id",t),r.textContent=e||o,r.outerHTML};#t;#o=[];get defaultValues(){const e=this.getAttribute("default-values");if(e)try{const t=JSON.parse(e);if(this.isValidDataType(t))return t}catch(e){console.error('could not parse data string from attribute "default-values" -',e.message)}return[]}get renderItem(){return this.#e}set renderItem(e){this.#e=e,this.renderItems()}get data(){if(this.#t)return this.#t;const e=this.getAttribute("data");if(e)try{const t=JSON.parse(e);if(this.isValidDataType(t))return t}catch(e){console.error('could not parse data string from attribute "data" -',e.message)}return[]}set data(e){this.isValidDataType(e)&&(this.#t=e,this.renderItems())}get allowCustomValues(){return"true"===this.getAttribute("allow-custom-value")}get minItemsSelection(){return parseInt(this.getAttribute("min-items-selection"),10)||0}get maxItemsSelection(){return parseInt(this.getAttribute("max-items-selection"),10)||0}isValidDataType(e){const t=Array.isArray(e);return t||console.error("data and default-values must be an array, received:",e),t}getItemsTemplate(){return this.data?.reduce?.((e,t)=>e+(this.renderItem?.(t||{})||""),"")}renderItems(){const e=this.getItemsTemplate();e&&(this.innerHTML=e)}updateSelectedItems(){const e=this.baseElement.selectedItems?.map(e=>e.getAttribute("data-id"))||[];e.length>0&&(this.value=e),0===this.value.length&&this.setDefaultValues()}customValueTransformFn(e){return e}setComboBoxDescriptor(){const e=Object.getOwnPropertyDescriptor(this.inputElement.constructor.prototype,"value"),t=this;Object.defineProperties(this.inputElement,{value:{...e,set(o){const r=t.customValueTransformFn(o)||"";r!==this.value&&e.set.call(this,r)}}})}#r(e){return Array.from(new Map(e.map(e=>[e.getAttribute("data-id"),e])).values())}#i(){const e=Array.from(this.children),t=this.#r(e);e.length?(this.removeAttribute("has-no-options"),t.forEach(e=>{Object.defineProperty(e,"data-name",{value:e.getAttribute("data-name"),configurable:!0,writable:!0}),Object.defineProperty(e,"data-id",{value:e.getAttribute("data-id"),configurable:!0,writable:!0})}),this.baseElement.items=t,setTimeout(()=>{this.updateSelectedItems()},0)):(this.baseElement.items=[],this.setAttribute("has-no-options","")),this.baseElement.renderer=(e,t,o)=>{e.innerHTML=o.item.outerHTML}}#n(){const e=this.baseElement.shadowRoot.querySelector("vaadin-multi-select-combo-box-internal").shadowRoot.querySelector("vaadin-multi-select-combo-box-overlay");e._attachOverlay=()=>{e.bringToFront()},e._detachOverlay=()=>{},e._enterModalState=()=>{}}#a(){this.allowCustomValues&&this.baseElement.addEventListener("custom-value-set",e=>{const t=this.#e({label:e.detail,displayName:e.detail,value:e.detail});this.innerHTML+=t,this.baseElement._lastFilter="",setTimeout(()=>{this.value=[...this.value,e.detail]},0)})}setGetValidity(){this.getValidity=function(){if(this.pattern){const e=new RegExp(this.pattern);if(this.value.some(t=>!e.test(t)))return{patternMismatch:!0}}return this.isRequired&&!this.value.length?{valueMissing:!0}:this.isRequired&&this.minItemsSelection&&this.value.length<this.minItemsSelection?{rangeUnderflow:!0}:this.maxItemsSelection&&this.value.length>this.maxItemsSelection?{rangeOverflow:!0}:{}};const e=this;this.baseElement.checkValidity=()=>e.validity.valid}init(){super.init?.(),this.setGetValidity(),this.#a(),this.renderItems(),(0,i.mx)(this,this.renderItems.bind(this),{includeAttrs:["data"]}),(0,i.Ge)(this,this.#i.bind(this)),(0,i.EA)(this,this.baseElement,{includeAttrs:["placeholder"]}),setTimeout(()=>{this.setComboBoxDescriptor(),this.#n()}),this.setDefaultValues(),this.baseElement.addEventListener("selected-items-changed",()=>{this.#l(),this.dispatchEvent(new CustomEvent("input",{bubbles:!0}))})}setDefaultValues(){this.defaultValues.length>0&&(this.value=this.defaultValues)}#l(){this.#o=this.baseElement.selectedItems?.map(e=>e.getAttribute("data-id"))||[]}set value(e){if(e&&e.length>0){const t=this.baseElement.items?.filter(t=>e.includes(t["data-id"]));if(this.allowCustomValues){const o=t?.map(e=>e.getAttribute("data-id"))||[],r=e.filter(e=>!o.includes(e));if(r.length){const t=r.reduce((e,t)=>e+this.#e({label:t,displayName:t,value:t}),"");return this.innerHTML+=t,void setTimeout(()=>{this.value=e},0)}}const o=t?.map(e=>e.getAttribute("data-id"))||[];(0,r.AG)(this.#o,o)||(this.baseElement.selectedItems=t)}else this.baseElement.selectedItems=[]}get value(){return this.#o}attributeChangedCallback(e,t,o){super.attributeChangedCallback?.(e,t,o),"readonly"===e&&this.onReadOnlyChange(null!==o&&"true"===o)}onReadOnlyChange(e){e?this.baseElement?.shadowRoot?.querySelector("vaadin-multi-select-combo-box-internal")?.setAttribute("inert",e):this.baseElement?.shadowRoot?.querySelector("vaadin-multi-select-combo-box-internal")?.removeAttribute("inert")}})((0,a.tz)({slots:["","prefix"],wrappedEleName:"vaadin-multi-select-combo-box",style:()=>`\n\t\t:host {\n\t\t\tdisplay: inline-flex;\n\t\t\tbox-sizing: border-box;\n\t\t\t-webkit-mask-image: none;\n\t\t}\n\t\t${(0,n.cy)(I.cssVarList)}\n\t\t${(0,n.fu)("vaadin-multi-select-combo-box")}\n\t\t${(0,n.lS)("vaadin-multi-select-combo-box")}\n\t\t${(0,n.I4)("vaadin-multi-select-combo-box")}\n\n\t\tvaadin-multi-select-combo-box {\n\t\t\tpadding: 0;\n\t\t\twidth: 100%;\n\t\t}\n\t\tvaadin-multi-select-combo-box::before {\n\t\t\theight: initial;\n\t\t}\n\t\tvaadin-multi-select-combo-box [slot="input"] {\n\t\t\t-webkit-mask-image: none;\n\t\t\tmin-height: 0;\n align-self: center;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\tvaadin-multi-select-combo-box[readonly] [slot="input"] {\n flex-grow: 1;\n flex-basis: 4em;\n\t\t}\n\n\t\t::part(input-field) {\n padding: 0;\n\t\t\tbox-shadow: none;\n\t\t}\n ${(0,n.$J)("vaadin-multi-select-combo-box")}\n :host([has-label]) vaadin-multi-select-combo-box-chip::part(label) {\n display: block;\n }\n\n vaadin-multi-select-combo-box vaadin-multi-select-combo-box-chip[slot='overflow']::before,\n vaadin-multi-select-combo-box vaadin-multi-select-combo-box-chip[slot='overflow']::after {\n left: -4px;\n right: -4px;\n border-left-width: 0;\n border-inline-start-style: solid;\n border-inline-start-width: 2px;\n }\n vaadin-multi-select-combo-box vaadin-multi-select-combo-box-chip[slot='overflow']::after {\n left: -8px;\n right: -8px;\n }\n\n :host([has-no-options][allow-custom-value='true']) ::part(toggle-button) {\n display: none;\n }\n\n ${(0,n.Kl)()}\n\n vaadin-multi-select-combo-box::part(toggle-button),\n vaadin-multi-select-combo-box::part(clear-button) {\n align-self: center;\n }\n\n vaadin-multi-select-combo-box[label-type="floating"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n vaadin-multi-select-combo-box[label-type="floating"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n\n\t\t`,excludeAttrsSync:["tabindex","size","data","placeholder","style"],componentName:l,includeForwardProps:["items","renderer","selectedItems"]}))},70067(e,t,o){o.r(t),o.d(t,{MultiSelectComboBoxClass:()=>r.t,componentName:()=>r.T}),o(51408);var r=o(94681);customElements.define(r.T,r.t)}}]);
|
|
2
|
+
//# sourceMappingURL=descope-multi-select-combo-box.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"descope-multi-select-combo-box.js","mappings":"+MAyBO,MAAMA,GAAgB,QAAiB,2BA0XxC,KACJC,EAAI,WACJC,EAAU,aACVC,EAAY,YACZC,EAAW,OACXC,EAAM,YACNC,EAAW,MACXC,EAAK,kBACLC,EAAiB,WACjBC,EAAU,aACVC,EAAY,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AW,KACT3D,KAAKT,MAAQ2G,GACZ,EAEL,CACF,CAEA,MAAMQ,EACJP,GAAkBpE,IAAKwE,GAAUA,EAAMtG,aAAa,aAAe,IAChE,QAAuBD,MAAK,EAAQ0G,KACvC1G,KAAK6B,YAAYC,cAAgBqE,EAErC,MACEnG,KAAK6B,YAAYC,cAAgB,EAErC,CAEA,SAAIvC,GACF,OAAOS,MAAK,CACd,CAEA,wBAAA2G,CAAyBC,EAAUC,EAAUC,GAC3CnB,MAAMgB,2BAA2BC,EAAUC,EAAUC,GAEpC,aAAbF,GACF5G,KAAK+G,iBAA8B,OAAbD,GAAkC,SAAbA,EAE/C,CAEA,gBAAAC,CAAiB5E,GACXA,EACFnC,KAAK6B,aAAamC,YACdC,cAAc,2CACdtE,aAAa,QAASwC,GAE1BnC,KAAK6B,aAAamC,YACdC,cAAc,2CACdZ,gBAAgB,QAExB,GAyCoC,EA6KtC,QAAY,CACV2D,MAAO,CAAC,GAAI,UACZC,eAAgB,gCAChBC,MAAO,IAAM,2HAMb,QAAuB5M,EAAyBqD,qBAChD,QAAwB,0CACxB,QAAsB,0CACtB,QAAiB,yjBAwBf,QAAwB,8uBAsBxB,8bAeFwJ,iBAAkB,CAAC,WAAY,OAAQ,OAAQ,cAAe,SAC9D7N,gBACA8N,oBAAqB,CAAC,QAAS,WAAY,mB,8GC3qB/CC,eAAeC,OAAO,IAAe,I","sources":["webpack://@descope/web-components-ui/../components/descope-multi-select-combo-box/src/component/MultiSelectComboBoxClass.js","webpack://@descope/web-components-ui/../components/descope-multi-select-combo-box/src/component/index.js"],"sourcesContent":["import { compose, compareArraysUnordered } from '@descope-ui/common/utils';\nimport {\n forwardAttrs,\n getComponentName,\n observeAttributes,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport {\n resetInputLabelPosition,\n resetInputCursor,\n resetInputPlaceholder,\n resetInputReadonlyStyle,\n useHostExternalPadding,\n inputFloatingLabelStyle,\n} from '@descope-ui/common/theme-helpers';\nimport {\n createStyleMixin,\n draggableMixin,\n createProxy,\n componentNameValidationMixin,\n portalMixin,\n proxyInputMixin,\n changeMixin,\n} from '@descope-ui/common/components-mixins';\n\nexport const componentName = getComponentName('multi-select-combo-box');\n\nconst multiSelectComboBoxMixin = (superclass) =>\n class MultiSelectComboBoxMixinClass extends superclass {\n static get observedAttributes() {\n return ['readonly'];\n }\n\n #renderItem = ({ displayName, value, label }) => {\n const ele = document.createElement('span');\n ele.setAttribute('data-name', label);\n ele.setAttribute('data-id', value);\n ele.textContent = displayName || label;\n\n return ele.outerHTML;\n };\n\n #data;\n\n #value = [];\n\n get defaultValues() {\n const defaultValuesAttr = this.getAttribute('default-values');\n if (defaultValuesAttr) {\n try {\n const defaultValues = JSON.parse(defaultValuesAttr);\n if (this.isValidDataType(defaultValues)) {\n return defaultValues;\n }\n } catch (e) {\n console.error(\n 'could not parse data string from attribute \"default-values\" -',\n e.message,\n );\n }\n }\n return [];\n }\n\n get renderItem() {\n return this.#renderItem;\n }\n\n set renderItem(renderFn) {\n this.#renderItem = renderFn;\n this.renderItems();\n }\n\n get data() {\n if (this.#data) return this.#data;\n\n const dataAttr = this.getAttribute('data');\n\n if (dataAttr) {\n try {\n const data = JSON.parse(dataAttr);\n if (this.isValidDataType(data)) {\n return data;\n }\n } catch (e) {\n console.error(\n 'could not parse data string from attribute \"data\" -',\n e.message,\n );\n }\n }\n\n return [];\n }\n\n set data(data) {\n if (this.isValidDataType(data)) {\n this.#data = data;\n this.renderItems();\n }\n }\n\n get allowCustomValues() {\n return this.getAttribute('allow-custom-value') === 'true';\n }\n\n get minItemsSelection() {\n return parseInt(this.getAttribute('min-items-selection'), 10) || 0;\n }\n\n get maxItemsSelection() {\n return parseInt(this.getAttribute('max-items-selection'), 10) || 0;\n }\n\n isValidDataType(data) {\n const isValid = Array.isArray(data);\n if (!isValid) {\n console.error(\n 'data and default-values must be an array, received:',\n data,\n );\n }\n\n return isValid;\n }\n\n getItemsTemplate() {\n return this.data?.reduce?.(\n (acc, item) => acc + (this.renderItem?.(item || {}) || ''),\n '',\n );\n }\n\n renderItems() {\n const template = this.getItemsTemplate();\n if (template) this.innerHTML = template;\n }\n\n updateSelectedItems() {\n const currentSelected =\n this.baseElement.selectedItems?.map((item) =>\n item.getAttribute('data-id'),\n ) || [];\n\n if (currentSelected.length > 0) {\n this.value = currentSelected;\n }\n\n if (this.value.length === 0) {\n this.setDefaultValues();\n }\n }\n\n customValueTransformFn(val) {\n return val;\n }\n\n setComboBoxDescriptor() {\n const valueDescriptor = Object.getOwnPropertyDescriptor(\n this.inputElement.constructor.prototype,\n 'value',\n );\n\n const comboBox = this;\n\n Object.defineProperties(this.inputElement, {\n value: {\n ...valueDescriptor,\n set(val) {\n const transformedValue = comboBox.customValueTransformFn(val) || '';\n\n if (transformedValue === this.value) {\n return;\n }\n\n valueDescriptor.set.call(this, transformedValue);\n },\n },\n });\n }\n\n #dedupItems(items) {\n return Array.from(\n new Map(\n items.map((item) => [item.getAttribute('data-id'), item]),\n ).values(),\n );\n }\n\n #onChildrenChange() {\n const items = Array.from(this.children);\n const dedupItems = this.#dedupItems(items);\n\n if (items.length) {\n this.removeAttribute('has-no-options');\n\n dedupItems.forEach((node) => {\n Object.defineProperty(node, 'data-name', {\n value: node.getAttribute('data-name'),\n configurable: true,\n writable: true,\n });\n Object.defineProperty(node, 'data-id', {\n value: node.getAttribute('data-id'),\n configurable: true,\n writable: true,\n });\n });\n\n this.baseElement.items = dedupItems;\n\n setTimeout(() => {\n this.updateSelectedItems();\n }, 0);\n } else {\n this.baseElement.items = [];\n this.setAttribute('has-no-options', '');\n }\n\n this.baseElement.renderer = (root, combo, model) => {\n root.innerHTML = model.item.outerHTML;\n };\n }\n\n #overrideOverlaySettings() {\n const overlay = this.baseElement.shadowRoot\n .querySelector('vaadin-multi-select-combo-box-internal')\n .shadowRoot.querySelector('vaadin-multi-select-combo-box-overlay');\n overlay._attachOverlay = () => {\n overlay.bringToFront();\n };\n overlay._detachOverlay = () => {};\n overlay._enterModalState = () => {};\n }\n\n #handleCustomValues() {\n if (this.allowCustomValues) {\n this.baseElement.addEventListener('custom-value-set', (e) => {\n const newItemHtml = this.#renderItem({\n label: e.detail,\n displayName: e.detail,\n value: e.detail,\n });\n this.innerHTML += newItemHtml;\n this.baseElement._lastFilter = '';\n setTimeout(() => {\n this.value = [...this.value, e.detail];\n }, 0);\n });\n }\n }\n\n setGetValidity() {\n this.getValidity = function () {\n if (this.pattern) {\n const patternRegex = new RegExp(this.pattern);\n if (this.value.some((val) => !patternRegex.test(val)))\n return {\n patternMismatch: true,\n };\n }\n\n if (this.isRequired && !this.value.length) {\n return {\n valueMissing: true,\n };\n }\n if (\n this.isRequired &&\n this.minItemsSelection &&\n this.value.length < this.minItemsSelection\n ) {\n return {\n rangeUnderflow: true,\n };\n }\n if (\n this.maxItemsSelection &&\n this.value.length > this.maxItemsSelection\n ) {\n return {\n rangeOverflow: true,\n };\n }\n return {};\n };\n\n const that = this;\n\n this.baseElement.checkValidity = () => that.validity.valid;\n }\n\n init() {\n super.init?.();\n\n this.setGetValidity();\n\n this.#handleCustomValues();\n\n this.renderItems();\n\n observeAttributes(this, this.renderItems.bind(this), {\n includeAttrs: ['data'],\n });\n\n observeChildren(this, this.#onChildrenChange.bind(this));\n\n forwardAttrs(this, this.baseElement, { includeAttrs: ['placeholder'] });\n\n setTimeout(() => {\n this.setComboBoxDescriptor();\n this.#overrideOverlaySettings();\n });\n\n this.setDefaultValues();\n\n this.baseElement.addEventListener('selected-items-changed', () => {\n this.#updateInternalValue();\n this.dispatchEvent(new CustomEvent('input', { bubbles: true }));\n });\n }\n\n setDefaultValues() {\n const initialDefaultValues = this.defaultValues;\n if (initialDefaultValues.length > 0) {\n this.value = this.defaultValues;\n }\n }\n\n #updateInternalValue() {\n this.#value =\n this.baseElement.selectedItems?.map((elem) =>\n elem.getAttribute('data-id'),\n ) || [];\n }\n\n set value(vals) {\n if (vals && vals.length > 0) {\n const selectedChildren = this.baseElement.items?.filter((item) =>\n vals.includes(item['data-id']),\n );\n\n if (this.allowCustomValues) {\n const existingValues =\n selectedChildren?.map((child) => child.getAttribute('data-id')) ||\n [];\n const missingValues = vals.filter(\n (val) => !existingValues.includes(val),\n );\n\n if (missingValues.length) {\n const newItemsHtml = missingValues.reduce((acc, val) => {\n const newItemHtml = this.#renderItem({\n label: val,\n displayName: val,\n value: val,\n });\n return acc + newItemHtml;\n }, '');\n this.innerHTML += newItemsHtml;\n\n setTimeout(() => {\n this.value = vals;\n }, 0);\n return;\n }\n }\n\n const newSelectedValues =\n selectedChildren?.map((child) => child.getAttribute('data-id')) || [];\n if (!compareArraysUnordered(this.#value, newSelectedValues)) {\n this.baseElement.selectedItems = selectedChildren;\n }\n } else {\n this.baseElement.selectedItems = [];\n }\n }\n\n get value() {\n return this.#value;\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (attrName === 'readonly') {\n this.onReadOnlyChange(newValue !== null && newValue === 'true');\n }\n }\n\n onReadOnlyChange(val) {\n if (val) {\n this.baseElement?.shadowRoot\n ?.querySelector('vaadin-multi-select-combo-box-internal')\n ?.setAttribute('inert', val);\n } else {\n this.baseElement?.shadowRoot\n ?.querySelector('vaadin-multi-select-combo-box-internal')\n ?.removeAttribute('inert');\n }\n }\n };\n\nconst {\n host,\n inputField,\n inputElement,\n placeholder,\n toggle,\n clearButton,\n label,\n requiredIndicator,\n helperText,\n errorMessage,\n chip,\n chipLabel,\n overflowChipFirstBorder,\n overflowChipSecondBorder,\n} = {\n host: { selector: () => ':host' },\n inputField: { selector: '::part(input-field)' },\n inputElement: { selector: 'input' },\n placeholder: { selector: '> input:placeholder-shown' },\n toggle: { selector: '::part(toggle-button)' },\n clearButton: { selector: '::part(clear-button)' },\n label: { selector: '::part(label)' },\n requiredIndicator: {\n selector: '[required]::part(required-indicator)::after',\n },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n chip: { selector: 'vaadin-multi-select-combo-box-chip' },\n chipLabel: { selector: 'vaadin-multi-select-combo-box-chip::part(label)' },\n overflowChipFirstBorder: {\n selector: \"vaadin-multi-select-combo-box-chip[slot='overflow']::before\",\n },\n overflowChipSecondBorder: {\n selector: \"vaadin-multi-select-combo-box-chip[slot='overflow']::after\",\n },\n};\n\nexport const MultiSelectComboBoxClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n fontSize: [{}, host],\n chipFontSize: { ...chipLabel, property: 'font-size' },\n fontFamily: [\n label,\n placeholder,\n inputField,\n helperText,\n errorMessage,\n chipLabel,\n ],\n labelFontSize: { ...label, property: 'font-size' },\n labelFontWeight: { ...label, property: 'font-weight' },\n inputValueFontWeight: { ...inputField, property: 'font-weight' },\n inputPlaceholderFontWeight: { ...placeholder, property: 'font-weight' },\n helperTextFontWeight: { ...helperText, property: 'font-weight' },\n errorMessageFontWeight: { ...errorMessage, property: 'font-weight' },\n labelTextColor: [\n { ...label, property: 'color' },\n { ...requiredIndicator, property: 'color' },\n ],\n errorMessageTextColor: { ...errorMessage, property: 'color' },\n errorMessageIcon: { ...errorMessage, property: 'background-image' },\n errorMessageIconSize: { ...errorMessage, property: 'background-size' },\n errorMessageIconPadding: {\n ...errorMessage,\n property: 'padding-inline-start',\n },\n errorMessageIconRepeat: {\n ...errorMessage,\n property: 'background-repeat',\n },\n errorMessageIconPosition: {\n ...errorMessage,\n property: 'background-position',\n },\n errorMessageFontSize: { ...errorMessage, property: 'font-size' },\n inputHeight: { ...inputField, property: 'min-height' },\n inputBackgroundColor: { ...inputField, property: 'background-color' },\n inputBorderColor: { ...inputField, property: 'border-color' },\n inputBorderWidth: { ...inputField, property: 'border-width' },\n inputBorderStyle: { ...inputField, property: 'border-style' },\n inputBorderRadius: { ...inputField, property: 'border-radius' },\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\n inputValueTextColor: { ...inputField, property: 'color' },\n inputPlaceholderTextColor: { ...placeholder, property: 'color' },\n inputDropdownButtonCursor: [\n { ...toggle, property: 'cursor' },\n { ...clearButton, property: 'cursor' },\n ],\n inputDropdownButtonColor: [\n { ...toggle, property: 'color' },\n { ...clearButton, property: 'color' },\n ],\n inputDropdownButtonSize: [\n { ...toggle, property: 'font-size' },\n { ...clearButton, property: 'font-size' },\n ],\n inputDropdownButtonOffset: [\n { ...toggle, property: 'margin-right' },\n { ...toggle, property: 'margin-left' },\n ],\n inputOutlineColor: { ...inputField, property: 'outline-color' },\n inputOutlineWidth: { ...inputField, property: 'outline-width' },\n inputOutlineStyle: { ...inputField, property: 'outline-style' },\n inputOutlineOffset: { ...inputField, property: 'outline-offset' },\n inputHorizontalPadding: [\n { ...inputElement, property: 'padding-left' },\n { ...inputElement, property: 'padding-right' },\n { ...inputField, property: 'padding-inline-start' },\n ],\n inputVerticalPadding: [\n { ...inputField, property: 'padding-top' },\n { ...inputField, property: 'padding-bottom' },\n ],\n chipTextColor: { ...chipLabel, property: 'color' },\n chipBackgroundColor: [\n { ...chip, property: 'background-color' },\n { ...overflowChipFirstBorder, property: 'border-color' },\n { ...overflowChipSecondBorder, property: 'border-color' },\n ],\n\n labelPosition: { ...label, property: 'position' },\n labelTopPosition: { ...label, property: 'top' },\n labelLeftPosition: { ...label, property: 'left' },\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: { ...placeholder, property: 'opacity' },\n inputVerticalAlignment: { ...inputField, property: 'align-items' },\n\n overlayBackground: {\n property: () =>\n MultiSelectComboBoxClass.cssVarList.overlay.backgroundColor,\n },\n overlayTextColor: {\n property: () => MultiSelectComboBoxClass.cssVarList.overlay.textColor,\n },\n overlayBorder: {\n property: () => MultiSelectComboBoxClass.cssVarList.overlay.border,\n },\n overlayFontSize: {\n property: () => MultiSelectComboBoxClass.cssVarList.overlay.fontSize,\n },\n overlayFontFamily: {\n property: () => MultiSelectComboBoxClass.cssVarList.overlay.fontFamily,\n },\n overlayCursor: {\n property: () => MultiSelectComboBoxClass.cssVarList.overlay.cursor,\n },\n overlayItemBoxShadow: {\n property: () =>\n MultiSelectComboBoxClass.cssVarList.overlay.itemBoxShadow,\n },\n overlayItemPaddingInlineStart: {\n property: () =>\n MultiSelectComboBoxClass.cssVarList.overlay.itemPaddingInlineStart,\n },\n overlayItemPaddingInlineEnd: {\n property: () =>\n MultiSelectComboBoxClass.cssVarList.overlay.itemPaddingInlineEnd,\n },\n },\n }),\n draggableMixin,\n portalMixin({\n name: 'overlay',\n selector: 'vaadin-multi-select-combo-box-internal',\n mappings: {\n backgroundColor: { selector: 'vaadin-multi-select-combo-box-scroller' },\n minHeight: { selector: 'vaadin-multi-select-combo-box-overlay' },\n margin: { selector: 'vaadin-multi-select-combo-box-overlay' },\n cursor: { selector: 'vaadin-multi-select-combo-box-item' },\n fontFamily: { selector: 'vaadin-multi-select-combo-box-item' },\n textColor: {\n selector: 'vaadin-multi-select-combo-box-item',\n property: 'color',\n },\n fontSize: { selector: 'vaadin-multi-select-combo-box-item' },\n itemBoxShadow: {\n selector: 'vaadin-multi-select-combo-box-item',\n property: 'box-shadow',\n },\n itemPaddingInlineStart: {\n selector: 'vaadin-multi-select-combo-box-item',\n property: 'padding-inline-start',\n },\n itemPaddingInlineEnd: {\n selector: 'vaadin-multi-select-combo-box-item',\n property: 'padding-inline-end',\n },\n },\n forward: {\n include: false,\n attributes: ['size'],\n },\n }),\n proxyInputMixin({\n proxyProps: ['selectionStart'],\n inputEvent: 'selected-items-changed',\n }),\n changeMixin,\n componentNameValidationMixin,\n multiSelectComboBoxMixin,\n)(\n createProxy({\n slots: ['', 'prefix'],\n wrappedEleName: 'vaadin-multi-select-combo-box',\n style: () => `\n\t\t:host {\n\t\t\tdisplay: inline-flex;\n\t\t\tbox-sizing: border-box;\n\t\t\t-webkit-mask-image: none;\n\t\t}\n\t\t${useHostExternalPadding(MultiSelectComboBoxClass.cssVarList)}\n\t\t${resetInputReadonlyStyle('vaadin-multi-select-combo-box')}\n\t\t${resetInputPlaceholder('vaadin-multi-select-combo-box')}\n\t\t${resetInputCursor('vaadin-multi-select-combo-box')}\n\n\t\tvaadin-multi-select-combo-box {\n\t\t\tpadding: 0;\n\t\t\twidth: 100%;\n\t\t}\n\t\tvaadin-multi-select-combo-box::before {\n\t\t\theight: initial;\n\t\t}\n\t\tvaadin-multi-select-combo-box [slot=\"input\"] {\n\t\t\t-webkit-mask-image: none;\n\t\t\tmin-height: 0;\n align-self: center;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\tvaadin-multi-select-combo-box[readonly] [slot=\"input\"] {\n flex-grow: 1;\n flex-basis: 4em;\n\t\t}\n\n\t\t::part(input-field) {\n padding: 0;\n\t\t\tbox-shadow: none;\n\t\t}\n ${resetInputLabelPosition('vaadin-multi-select-combo-box')}\n :host([has-label]) vaadin-multi-select-combo-box-chip::part(label) {\n display: block;\n }\n\n vaadin-multi-select-combo-box vaadin-multi-select-combo-box-chip[slot='overflow']::before,\n vaadin-multi-select-combo-box vaadin-multi-select-combo-box-chip[slot='overflow']::after {\n left: -4px;\n right: -4px;\n border-left-width: 0;\n border-inline-start-style: solid;\n border-inline-start-width: 2px;\n }\n vaadin-multi-select-combo-box vaadin-multi-select-combo-box-chip[slot='overflow']::after {\n left: -8px;\n right: -8px;\n }\n\n :host([has-no-options][allow-custom-value='true']) ::part(toggle-button) {\n display: none;\n }\n\n ${inputFloatingLabelStyle()}\n\n vaadin-multi-select-combo-box::part(toggle-button),\n vaadin-multi-select-combo-box::part(clear-button) {\n align-self: center;\n }\n\n vaadin-multi-select-combo-box[label-type=\"floating\"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n vaadin-multi-select-combo-box[label-type=\"floating\"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n\n\t\t`,\n excludeAttrsSync: ['tabindex', 'size', 'data', 'placeholder', 'style'],\n componentName,\n includeForwardProps: ['items', 'renderer', 'selectedItems'],\n }),\n);\n","import '@vaadin/multi-select-combo-box';\nimport {\n componentName,\n MultiSelectComboBoxClass,\n} from './MultiSelectComboBoxClass';\n\ncustomElements.define(componentName, MultiSelectComboBoxClass);\n\nexport { MultiSelectComboBoxClass, componentName };\n"],"names":["componentName","host","inputField","inputElement","placeholder","toggle","clearButton","label","requiredIndicator","helperText","errorMessage","chip","chipLabel","overflowChipFirstBorder","overflowChipSecondBorder","selector","MultiSelectComboBoxClass","mappings","hostWidth","property","hostDirection","fontSize","chipFontSize","fontFamily","labelFontSize","labelFontWeight","inputValueFontWeight","inputPlaceholderFontWeight","helperTextFontWeight","errorMessageFontWeight","labelTextColor","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","inputHeight","inputBackgroundColor","inputBorderColor","inputBorderWidth","inputBorderStyle","inputBorderRadius","labelRequiredIndicator","inputValueTextColor","inputPlaceholderTextColor","inputDropdownButtonCursor","inputDropdownButtonColor","inputDropdownButtonSize","inputDropdownButtonOffset","inputOutlineColor","inputOutlineWidth","inputOutlineStyle","inputOutlineOffset","inputHorizontalPadding","inputVerticalPadding","chipTextColor","chipBackgroundColor","labelPosition","labelTopPosition","labelLeftPosition","labelHorizontalPosition","inputTransformY","inputTransition","marginInlineStart","placeholderOpacity","inputVerticalAlignment","overlayBackground","cssVarList","overlay","backgroundColor","overlayTextColor","textColor","overlayBorder","border","overlayFontSize","overlayFontFamily","overlayCursor","cursor","overlayItemBoxShadow","itemBoxShadow","overlayItemPaddingInlineStart","itemPaddingInlineStart","overlayItemPaddingInlineEnd","itemPaddingInlineEnd","name","minHeight","margin","forward","include","attributes","proxyProps","inputEvent","superclass","observedAttributes","displayName","value","ele","document","createElement","setAttribute","textContent","outerHTML","defaultValues","defaultValuesAttr","this","getAttribute","JSON","parse","isValidDataType","e","console","error","message","renderItem","renderFn","renderItems","data","dataAttr","allowCustomValues","minItemsSelection","parseInt","maxItemsSelection","isValid","Array","isArray","getItemsTemplate","reduce","acc","item","template","innerHTML","updateSelectedItems","currentSelected","baseElement","selectedItems","map","length","setDefaultValues","customValueTransformFn","val","setComboBoxDescriptor","valueDescriptor","Object","getOwnPropertyDescriptor","constructor","prototype","comboBox","defineProperties","set","transformedValue","call","items","from","Map","values","children","dedupItems","removeAttribute","forEach","node","defineProperty","configurable","writable","setTimeout","renderer","root","combo","model","shadowRoot","querySelector","_attachOverlay","bringToFront","_detachOverlay","_enterModalState","addEventListener","newItemHtml","detail","_lastFilter","setGetValidity","getValidity","pattern","patternRegex","RegExp","some","test","patternMismatch","isRequired","valueMissing","rangeUnderflow","rangeOverflow","that","checkValidity","validity","valid","init","super","bind","includeAttrs","dispatchEvent","CustomEvent","bubbles","elem","vals","selectedChildren","filter","includes","existingValues","child","missingValues","newItemsHtml","newSelectedValues","attributeChangedCallback","attrName","oldValue","newValue","onReadOnlyChange","slots","wrappedEleName","style","excludeAttrsSync","includeForwardProps","customElements","define"],"sourceRoot":""}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see descope-tooltip.js.LICENSE.txt */
|
|
2
|
-
"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:()=>a,componentName:()=>l});var n=o(88961),s=o(72270),i=o(25964),r=o(63200);const l=(0,i.xE)("anchored");class h extends((0,s.qu)({componentName:l,baseSelector:".anchored-root"})){#t=null;#e=null;#o=null;get#n(){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,i.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.#r(),this.defaultSlot.addEventListener("slotchange",()=>this.#l()),this.#l()}#l(){this.#h(),this.#t=this.#a(this.#t,this.#i,"stretch"),this.#e=this.#a(this.#e,this.#s,"st-host-direction")}#r(){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,i.fz)(t,this.#i))}#a(t,e,o){return t?.disconnect(),e?.removeAttribute(o),this.#n&&e?(0,i.EA)(this.#n,e,{includeAttrs:[o]}):null}disconnectedCallback(){super.disconnectedCallback?.(),this.#t?.disconnect(),this.#e?.disconnect()}#h(){this.toggleAttribute("has-anchor",!!this.#n)}}const a=(0,r.Zz)(n.tQ)(h);customElements.define(l,a)},76231(t,e,o){o.d(e,{T:()=>d,m:()=>p});var n=o(92540),s=o(88961),i=o(63200),r=o(36976),l=o(72270),h=o(54847),a=o(25964);const d=(0,a.xE)("enriched-text");class c extends((0,l.qu)({componentName:d,baseSelector:":host > div"})){#d;#c;constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="content"></div>\n ',(0,a.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.#p(),(0,a.Ge)(this,this.#u.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.#p())}customUnderlineRenderer(){this.processor.renderer.rules.em_open=(t,e,o,n,s)=>("_"===t[e].markup&&(t[e].tag="u"),this.#c(t,e,o,n,s)),this.processor.renderer.rules.em_close=(t,e,o,n,s)=>("_"===t[e].markup&&(t[e].tag="u"),this.#c(t,e,o,n,s))}#m(){this.linkTargetBlank?this.processor.renderer.rules.link_open=(t,e,o,n,s)=>(t[e].attrSet("target","_blank"),this.#d(t,e,o,n,s)):this.processor.renderer.rules.link_open=this.#d}#y(){this.processor&&this.processor.disable(r.M)}#b(){this.#y()}#g(){this.#d=this.processor.renderer.rules.link_open||((t,e,o,n,s)=>s.renderToken(t,e,o)),this.#c=this.processor.renderer.rules.em_open||((t,e,o,n,s)=>s.renderToken(t,e,o))}#p(){this.processor=new n.A("commonmark",{html:!0}),this.#g(),this.#b(),this.#m(),this.customUnderlineRenderer()}get linkTargetBlank(){return"true"===this.getAttribute("link-target-blank")}get contentNode(){return this.shadowRoot.querySelector(".content")}#u(){if(!this.processor)return;let t=(0,h.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(t){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,i.Zz)((0,s.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,s.RF)({componentNameOverride:(0,a.xE)("link")}),(0,s.RF)({componentNameOverride:(0,a.xE)("text")}),s.VO,s.tQ)(c)},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(74778);var n=o(76231);customElements.define(n.T,n.m)},74778(t,e,o){o.r(e),o.d(e,{LinkClass:()=>g,componentName:()=>h});var n=o(88961),s=o(63200),i=o(25964),r=o(72270),l=o(66434);const h=(0,i.xE)("link"),a=["href","readonly"];class d extends((0,r.qu)({componentName:h,baseSelector:":host a"})){static get observedAttributes(){return a.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,i.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,i.EA)(this,this.anchor,{includeAttrs:["href","target","tooltip"],mapAttrs:{tooltip:"title"}}),(0,i.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 c={host:{selector:()=>":host"},link:{selector:()=>":host a"},anchor:{},wrapper:{selector:()=>":host > div"},text:{selector:()=>l.s.componentName}},{anchor:p,text:u,host:m,wrapper:y,link:b}=c,g=(0,s.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:l.s.cssVarList.textColor}],cursor:p}}),n.VO,n.tQ)(d);o(63595),customElements.define(h,g)},66434(t,e,o){o.d(e,{T:()=>l,s:()=>d});var n=o(88961),s=o(63200),i=o(25964),r=o(72270);const l=(0,i.xE)("text");class h extends((0,r.qu)({componentName:l,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <slot part="text-wrapper"></slot>\n ',(0,i.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,i.Ge)(this,()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""})}}const{host:a}={host:{selector:()=>":host"}},d=(0,s.Zz)((0,n.RF)({mappings:{hostWidth:{...a,property:"width"},hostDirection:{...a,property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),n.VO,n.tQ)(h)},63595(t,e,o){o.r(e),o.d(e,{TextClass:()=>n.s,componentName:()=>n.T});var n=o(66434);customElements.define(n.T,n.s)},38516(t,e,o){o.r(e),o.d(e,{TooltipClass:()=>u,componentName:()=>h}),o(13094),o(55838),o(17017),o(76720);var n=o(88961),s=o(63200),i=o(25964),r=o(72270),l=o(76231);const h=(0,i.xE)("tooltip"),a=["text","position","hide-delay","hover-delay","opened"];class d extends((0,r.qu)({componentName:h,baseSelector:"vaadin-tooltip"})){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")}static get observedAttributes(){return a.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"]')}#v(){this.isStaticDisplay?(this.#f(),this.setAttribute("inert","true")):this.removeAttribute("inert")}#f(){this.overlay&&(this.overlay.style.display="block",this.overlay.style.position="static")}init(){super.init?.(),(0,i.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.#x()),this.#x(),setTimeout(()=>this.#N())}#x(){const t=this.defaultSlot?.assignedElements()?.[0];t&&(this.tooltip.target=t)}#N(){this.#w(),this.#k(),(0,i.EA)(this,this.tooltip,{includeAttrs:["position","opened"]}),this.#C()}#S(){this.overlayContentNode.innerHTML=""}#A(){const t=document.createElement("descope-enriched-text");return t.setAttribute("link-target-blank","true"),t.textContent=this.tooltipText,t}#w(){this.overlayContentNode&&setTimeout(()=>{this.#S(),this.textComponent=this.#A(),this.overlayContentNode.appendChild(this.textComponent),this.srLabel&&!this.tooltipText&&this.srLabel.setAttribute("aria-hidden","true"),(0,i.EA)(this,this.textComponent,{includeAttrs:["readonly"]})})}#k(){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.#v(),this.overlay._updatePosition?.()})}#C(){this.tooltip?.toggleAttribute("manual",this.isOpened)}#T(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.#T(o),"opened"===t&&this.#C())}}const{overlay:c,content:p}={overlay:{selector:()=>"vaadin-tooltip-overlay::part(overlay)"},content:{selector:()=>"vaadin-tooltip-overlay::part(content)"}},u=(0,s.Zz)(n.tQ,(0,n.mA)({selector:"",mappings:{fontFamily:{...p,property:l.m.cssVarList.fontFamilyOverride},fontSize:{...p,property:l.m.cssVarList.fontSizeOverride},fontWeight:{...p,property:l.m.cssVarList.fontWeightOverride},textColor:{...p,property:l.m.cssVarList.textColorOverride},hostDirection:{...p,property:l.m.cssVarList.hostDirectionOverride},backgroundColor:[{...c},{...p}],borderColor:{...c},borderStyle:{...c},borderWidth:{...c},borderRadius:{...c},boxShadow:{...c},horizontalPadding:[{...p,property:"padding-left"},{...p,property:"padding-right"}],verticalPadding:[{...p,property:"padding-top"},{...p,property:"padding-bottom"}]},forward:{attributes:["style"],include:!1}}))(d);customElements.define(h,u)},1508(t,e,o){function n(t){const e=[];for(;t;){if(t.nodeType===Node.DOCUMENT_NODE){e.push(t);break}t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?t=t.assignedSlot?t.assignedSlot:t.parentNode:(e.push(t),t=t.host)}return e}function s(t){const e=[];let o;return"slot"===t.localName?o=t.assignedElements():(e.push(t),o=[...t.children]),o.forEach(t=>e.push(...s(t))),e}function i(t,e){return e?e.closest(t)||i(t,e.getRootNode().host):null}function r(t){return t?new Set(t.split(" ")):new Set}function l(t){return t?[...t].join(" "):""}function h(t,e,o){const n=r(t.getAttribute(e));n.add(o),t.setAttribute(e,l(n))}function a(t,e,o){const n=r(t.getAttribute(e));n.delete(o),0!==n.size?t.setAttribute(e,l(n)):t.removeAttribute(e)}function d(t){return t.nodeType===Node.TEXT_NODE&&""===t.textContent.trim()}o.d(e,{Dy:()=>n,J$:()=>s,Wr:()=>a,Z4:()=>r,ZA:()=>d,el:()=>i,iA:()=>h,sz:()=>l})},44099(t,e,o){o.d(e,{r:()=>r});var n=o(1508),s=o(65641),i=o(11707);class r extends EventTarget{static generateId(t,e){return`${e||"default"}-${t.localName}-${(0,i.I)()}`}constructor(t,e,o,n={}){super();const{initializer:s,multiple:i,observe:r,useUniqueId:l}=n;this.host=t,this.slotName=e,this.tagName=o,this.observe="boolean"!=typeof r||r,this.multiple="boolean"==typeof i&&i,this.slotInitializer=s,i&&(this.nodes=[]),l&&(this.defaultId=this.constructor.generateId(t,e))}hostConnected(){this.initialized||(this.multiple?this.initMultiple():this.initSingle(),this.observe&&this.observeSlot(),this.initialized=!0)}initSingle(){let t=this.getSlotChild();t?(this.node=t,this.initAddedNode(t)):(t=this.attachDefaultNode(),this.initNode(t))}initMultiple(){const t=this.getSlotChildren();if(0===t.length){const t=this.attachDefaultNode();t&&(this.nodes=[t],this.initNode(t))}else this.nodes=t,t.forEach(t=>{this.initAddedNode(t)})}attachDefaultNode(){const{host:t,slotName:e,tagName:o}=this;let n=this.defaultNode;return!n&&o&&(n=document.createElement(o),n instanceof Element&&(""!==e&&n.setAttribute("slot",e),this.defaultNode=n)),n&&(this.node=n,t.appendChild(n)),n}getSlotChildren(){const{slotName:t}=this;return Array.from(this.host.childNodes).filter(e=>e.nodeType===Node.ELEMENT_NODE&&e.slot===t||e.nodeType===Node.TEXT_NODE&&e.textContent.trim()&&""===t)}getSlotChild(){return this.getSlotChildren()[0]}initNode(t){const{slotInitializer:e}=this;e&&e(t,this.host)}initCustomNode(t){}teardownNode(t){}initAddedNode(t){t!==this.defaultNode&&(this.initCustomNode(t),this.initNode(t))}observeSlot(){const{slotName:t}=this,e=""===t?"slot:not([name])":`slot[name=${t}]`,o=this.host.shadowRoot.querySelector(e);this.__slotObserver=new s.P(o,({addedNodes:t,removedNodes:e})=>{const o=this.multiple?this.nodes:[this.node],s=t.filter(t=>!(0,n.ZA)(t)&&!o.includes(t));e.length&&(this.nodes=o.filter(t=>!e.includes(t)),e.forEach(t=>{this.teardownNode(t)})),s&&s.length>0&&(this.multiple?(this.defaultNode&&this.defaultNode.remove(),this.nodes=[...o,...s].filter(t=>t!==this.defaultNode),s.forEach(t=>{this.initAddedNode(t)})):(this.node&&this.node.remove(),this.node=s[0],this.initAddedNode(this.node)))})}}},65641(t,e,o){o.d(e,{P:()=>n});class n{constructor(t,e){this.slot=t,this.callback=e,this._storedNodes=[],this._connected=!1,this._scheduled=!1,this._boundSchedule=()=>{this._schedule()},this.connect(),this._schedule()}connect(){this.slot.addEventListener("slotchange",this._boundSchedule),this._connected=!0}disconnect(){this.slot.removeEventListener("slotchange",this._boundSchedule),this._connected=!1}_schedule(){this._scheduled||(this._scheduled=!0,queueMicrotask(()=>{this.flush()}))}flush(){this._connected&&(this._scheduled=!1,this._processNodes())}_processNodes(){const t=this.slot.assignedNodes({flatten:!0});let e=[];const o=[],n=[];t.length&&(e=t.filter(t=>!this._storedNodes.includes(t))),this._storedNodes.length&&this._storedNodes.forEach((e,s)=>{const i=t.indexOf(e);-1===i?o.push(e):i!==s&&n.push(e)}),(e.length||o.length||n.length)&&this.callback({addedNodes:e,movedNodes:n,removedNodes:o}),this._storedNodes=t}}},11707(t,e,o){o.d(e,{I:()=>s});let n=0;function s(){return n++}}}]);
|
|
2
|
+
"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:()=>a,componentName:()=>h});var n=o(88961),s=o(72270),i=o(25964),r=o(63200);const h=(0,i.xE)("anchored");class l extends((0,s.qu)({componentName:h,baseSelector:".anchored-root"})){#t=null;#e=null;#o=null;get#n(){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])"),this.#r()}init(){super.init?.(),(0,i.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.#h(),this.defaultSlot.addEventListener("slotchange",()=>this.#l()),this.#l()}#r(){const t=this.#n.classList.contains("hidden");this.classList.toggle("hidden",t)}#l(){this.#a(),this.#t=this.#d(this.#t,this.#i,"stretch"),this.#e=this.#d(this.#e,this.#s,"st-host-direction")}#h(){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,i.fz)(t,this.#i))}#d(t,e,o){return t?.disconnect(),e?.removeAttribute(o),this.#n&&e?(0,i.EA)(this.#n,e,{includeAttrs:[o]}):null}disconnectedCallback(){super.disconnectedCallback?.(),this.#t?.disconnect(),this.#e?.disconnect()}#a(){this.toggleAttribute("has-anchor",!!this.#n)}}const a=(0,r.Zz)(n.tQ)(l);customElements.define(h,a)},76231(t,e,o){o.d(e,{T:()=>d,m:()=>p});var n=o(92540),s=o(88961),i=o(63200),r=o(36976),h=o(72270),l=o(54847),a=o(25964);const d=(0,a.xE)("enriched-text");class c extends((0,h.qu)({componentName:d,baseSelector:":host > div"})){#c;#p;constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="content"></div>\n ',(0,a.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.#u(),(0,a.Ge)(this,this.#m.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.#u())}customUnderlineRenderer(){this.processor.renderer.rules.em_open=(t,e,o,n,s)=>("_"===t[e].markup&&(t[e].tag="u"),this.#p(t,e,o,n,s)),this.processor.renderer.rules.em_close=(t,e,o,n,s)=>("_"===t[e].markup&&(t[e].tag="u"),this.#p(t,e,o,n,s))}#y(){this.linkTargetBlank?this.processor.renderer.rules.link_open=(t,e,o,n,s)=>(t[e].attrSet("target","_blank"),this.#c(t,e,o,n,s)):this.processor.renderer.rules.link_open=this.#c}#g(){this.processor&&this.processor.disable(r.M)}#b(){this.#g()}#v(){this.#c=this.processor.renderer.rules.link_open||((t,e,o,n,s)=>s.renderToken(t,e,o)),this.#p=this.processor.renderer.rules.em_open||((t,e,o,n,s)=>s.renderToken(t,e,o))}#u(){this.processor=new n.A("commonmark",{html:!0}),this.#v(),this.#b(),this.#y(),this.customUnderlineRenderer()}get linkTargetBlank(){return"true"===this.getAttribute("link-target-blank")}get contentNode(){return this.shadowRoot.querySelector(".content")}#m(){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(t){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,i.Zz)((0,s.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,s.RF)({componentNameOverride:(0,a.xE)("link")}),(0,s.RF)({componentNameOverride:(0,a.xE)("text")}),s.VO,s.tQ)(c)},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(74778);var n=o(76231);customElements.define(n.T,n.m)},74778(t,e,o){o.r(e),o.d(e,{LinkClass:()=>b,componentName:()=>l});var n=o(88961),s=o(63200),i=o(25964),r=o(72270),h=o(66434);const l=(0,i.xE)("link"),a=["href","readonly"];class d extends((0,r.qu)({componentName:l,baseSelector:":host a"})){static get observedAttributes(){return a.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,i.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,i.EA)(this,this.anchor,{includeAttrs:["href","target","tooltip"],mapAttrs:{tooltip:"title"}}),(0,i.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 c={host:{selector:()=>":host"},link:{selector:()=>":host a"},anchor:{},wrapper:{selector:()=>":host > div"},text:{selector:()=>h.s.componentName}},{anchor:p,text:u,host:m,wrapper:y,link:g}=c,b=(0,s.Zz)((0,n.RF)({mappings:{hostWidth:{...m,property:"width"},hostDirection:{...u,property:"direction"},textAlign:y,textDecoration:{...g,property:"text-decoration",fallback:"none"},textColor:[{...p,property:"color"},{...u,property:h.s.cssVarList.textColor}],cursor:p}}),n.VO,n.tQ)(d);o(63595),customElements.define(l,b)},66434(t,e,o){o.d(e,{T:()=>h,s:()=>d});var n=o(88961),s=o(63200),i=o(25964),r=o(72270);const h=(0,i.xE)("text");class l extends((0,r.qu)({componentName:h,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <slot part="text-wrapper"></slot>\n ',(0,i.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,i.Ge)(this,()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""})}}const{host:a}={host:{selector:()=>":host"}},d=(0,s.Zz)((0,n.RF)({mappings:{hostWidth:{...a,property:"width"},hostDirection:{...a,property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),n.VO,n.tQ)(l)},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)},38516(t,e,o){o.r(e),o.d(e,{TooltipClass:()=>u,componentName:()=>l}),o(13094),o(55838),o(17017),o(76720);var n=o(88961),s=o(63200),i=o(25964),r=o(72270),h=o(76231);const l=(0,i.xE)("tooltip"),a=["text","position","hide-delay","hover-delay","opened"];class d extends((0,r.qu)({componentName:l,baseSelector:"vaadin-tooltip"})){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")}#r(){const t=this.anchored?.classList?.contains("hidden");this.classList.toggle("hidden",t)}static get observedAttributes(){return a.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"]')}#f(){this.isStaticDisplay?(this.#x(),this.setAttribute("inert","true")):this.removeAttribute("inert")}#x(){this.overlay&&(this.overlay.style.display="block",this.overlay.style.position="static")}init(){super.init?.(),(0,i.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.#N()),this.#N(),this.#r(),setTimeout(()=>this.#w())}#N(){const t=this.defaultSlot?.assignedElements()?.[0];t&&(this.tooltip.target=t)}#w(){this.#k(),this.#S(),(0,i.EA)(this,this.tooltip,{includeAttrs:["position","opened"]}),this.#C()}#A(){this.overlayContentNode.innerHTML=""}#T(){const t=document.createElement("descope-enriched-text");return t.setAttribute("link-target-blank","true"),t.textContent=this.tooltipText,t}#k(){this.overlayContentNode&&setTimeout(()=>{this.#A(),this.textComponent=this.#T(),this.overlayContentNode.appendChild(this.textComponent),this.srLabel&&!this.tooltipText&&this.srLabel.setAttribute("aria-hidden","true"),(0,i.EA)(this,this.textComponent,{includeAttrs:["readonly"]})})}#S(){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.#f(),this.overlay._updatePosition?.()})}#C(){this.tooltip?.toggleAttribute("manual",this.isOpened)}#E(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.#E(o),"opened"===t&&this.#C())}}const{overlay:c,content:p}={overlay:{selector:()=>"vaadin-tooltip-overlay::part(overlay)"},content:{selector:()=>"vaadin-tooltip-overlay::part(content)"}},u=(0,s.Zz)(n.tQ,(0,n.mA)({selector:"",mappings:{fontFamily:{...p,property:h.m.cssVarList.fontFamilyOverride},fontSize:{...p,property:h.m.cssVarList.fontSizeOverride},fontWeight:{...p,property:h.m.cssVarList.fontWeightOverride},textColor:{...p,property:h.m.cssVarList.textColorOverride},hostDirection:{...p,property:h.m.cssVarList.hostDirectionOverride},backgroundColor:[{...c},{...p}],borderColor:{...c},borderStyle:{...c},borderWidth:{...c},borderRadius:{...c},boxShadow:{...c},horizontalPadding:[{...p,property:"padding-left"},{...p,property:"padding-right"}],verticalPadding:[{...p,property:"padding-top"},{...p,property:"padding-bottom"}]},forward:{attributes:["style"],include:!1}}))(d);customElements.define(l,u)},1508(t,e,o){function n(t){const e=[];for(;t;){if(t.nodeType===Node.DOCUMENT_NODE){e.push(t);break}t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?t=t.assignedSlot?t.assignedSlot:t.parentNode:(e.push(t),t=t.host)}return e}function s(t){const e=[];let o;return"slot"===t.localName?o=t.assignedElements():(e.push(t),o=[...t.children]),o.forEach(t=>e.push(...s(t))),e}function i(t,e){return e?e.closest(t)||i(t,e.getRootNode().host):null}function r(t){return t?new Set(t.split(" ")):new Set}function h(t){return t?[...t].join(" "):""}function l(t,e,o){const n=r(t.getAttribute(e));n.add(o),t.setAttribute(e,h(n))}function a(t,e,o){const n=r(t.getAttribute(e));n.delete(o),0!==n.size?t.setAttribute(e,h(n)):t.removeAttribute(e)}function d(t){return t.nodeType===Node.TEXT_NODE&&""===t.textContent.trim()}o.d(e,{Dy:()=>n,J$:()=>s,Wr:()=>a,Z4:()=>r,ZA:()=>d,el:()=>i,iA:()=>l,sz:()=>h})},44099(t,e,o){o.d(e,{r:()=>r});var n=o(1508),s=o(65641),i=o(11707);class r extends EventTarget{static generateId(t,e){return`${e||"default"}-${t.localName}-${(0,i.I)()}`}constructor(t,e,o,n={}){super();const{initializer:s,multiple:i,observe:r,useUniqueId:h}=n;this.host=t,this.slotName=e,this.tagName=o,this.observe="boolean"!=typeof r||r,this.multiple="boolean"==typeof i&&i,this.slotInitializer=s,i&&(this.nodes=[]),h&&(this.defaultId=this.constructor.generateId(t,e))}hostConnected(){this.initialized||(this.multiple?this.initMultiple():this.initSingle(),this.observe&&this.observeSlot(),this.initialized=!0)}initSingle(){let t=this.getSlotChild();t?(this.node=t,this.initAddedNode(t)):(t=this.attachDefaultNode(),this.initNode(t))}initMultiple(){const t=this.getSlotChildren();if(0===t.length){const t=this.attachDefaultNode();t&&(this.nodes=[t],this.initNode(t))}else this.nodes=t,t.forEach(t=>{this.initAddedNode(t)})}attachDefaultNode(){const{host:t,slotName:e,tagName:o}=this;let n=this.defaultNode;return!n&&o&&(n=document.createElement(o),n instanceof Element&&(""!==e&&n.setAttribute("slot",e),this.defaultNode=n)),n&&(this.node=n,t.appendChild(n)),n}getSlotChildren(){const{slotName:t}=this;return Array.from(this.host.childNodes).filter(e=>e.nodeType===Node.ELEMENT_NODE&&e.slot===t||e.nodeType===Node.TEXT_NODE&&e.textContent.trim()&&""===t)}getSlotChild(){return this.getSlotChildren()[0]}initNode(t){const{slotInitializer:e}=this;e&&e(t,this.host)}initCustomNode(t){}teardownNode(t){}initAddedNode(t){t!==this.defaultNode&&(this.initCustomNode(t),this.initNode(t))}observeSlot(){const{slotName:t}=this,e=""===t?"slot:not([name])":`slot[name=${t}]`,o=this.host.shadowRoot.querySelector(e);this.__slotObserver=new s.P(o,({addedNodes:t,removedNodes:e})=>{const o=this.multiple?this.nodes:[this.node],s=t.filter(t=>!(0,n.ZA)(t)&&!o.includes(t));e.length&&(this.nodes=o.filter(t=>!e.includes(t)),e.forEach(t=>{this.teardownNode(t)})),s&&s.length>0&&(this.multiple?(this.defaultNode&&this.defaultNode.remove(),this.nodes=[...o,...s].filter(t=>t!==this.defaultNode),s.forEach(t=>{this.initAddedNode(t)})):(this.node&&this.node.remove(),this.node=s[0],this.initAddedNode(this.node)))})}}},65641(t,e,o){o.d(e,{P:()=>n});class n{constructor(t,e){this.slot=t,this.callback=e,this._storedNodes=[],this._connected=!1,this._scheduled=!1,this._boundSchedule=()=>{this._schedule()},this.connect(),this._schedule()}connect(){this.slot.addEventListener("slotchange",this._boundSchedule),this._connected=!0}disconnect(){this.slot.removeEventListener("slotchange",this._boundSchedule),this._connected=!1}_schedule(){this._scheduled||(this._scheduled=!0,queueMicrotask(()=>{this.flush()}))}flush(){this._connected&&(this._scheduled=!1,this._processNodes())}_processNodes(){const t=this.slot.assignedNodes({flatten:!0});let e=[];const o=[],n=[];t.length&&(e=t.filter(t=>!this._storedNodes.includes(t))),this._storedNodes.length&&this._storedNodes.forEach((e,s)=>{const i=t.indexOf(e);-1===i?o.push(e):i!==s&&n.push(e)}),(e.length||o.length||n.length)&&this.callback({addedNodes:e,movedNodes:n,removedNodes:o}),this._storedNodes=t}}},11707(t,e,o){o.d(e,{I:()=>s});let n=0;function s(){return n++}}}]);
|
|
3
3
|
//# sourceMappingURL=descope-tooltip.js.map
|