@descope/web-components-ui 3.16.4 → 3.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs.js +2998 -1114
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +3294 -1405
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/1408.js +8 -8
- package/dist/umd/1408.js.map +1 -1
- package/dist/umd/5260.js +1 -1
- package/dist/umd/5260.js.map +1 -1
- package/dist/umd/6618.js +1 -1
- package/dist/umd/6618.js.map +1 -1
- package/dist/umd/67.js +2 -0
- package/dist/umd/67.js.map +1 -0
- package/dist/umd/7092.js +1 -1
- package/dist/umd/7092.js.map +1 -1
- package/dist/umd/7939.js +1 -1
- package/dist/umd/7939.js.map +1 -1
- package/dist/umd/8350.js +1 -1
- package/dist/umd/8350.js.map +1 -1
- package/dist/umd/9439.js +2 -0
- package/dist/umd/9439.js.map +1 -0
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/DescopeDev.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-badge.js +1 -1
- package/dist/umd/descope-badge.js.map +1 -1
- package/dist/umd/descope-date-field-descope-calendar-index-js.js +10 -10
- package/dist/umd/descope-date-field-descope-calendar-index-js.js.map +1 -1
- package/dist/umd/descope-date-field-index-js.js +1 -1
- package/dist/umd/descope-date-field-index-js.js.map +1 -1
- package/dist/umd/descope-filter.js +2 -0
- package/dist/umd/descope-filter.js.map +1 -0
- package/dist/umd/descope-month-day-field.js +1 -1
- package/dist/umd/descope-month-day-field.js.map +1 -1
- package/dist/umd/descope-multi-line-mappings.js +4 -4
- package/dist/umd/descope-multi-line-mappings.js.LICENSE.txt +6 -0
- package/dist/umd/descope-multi-line-mappings.js.map +1 -1
- package/dist/umd/descope-multi-select-combo-box.js +2 -1
- package/dist/umd/descope-multi-select-combo-box.js.LICENSE.txt +5 -0
- package/dist/umd/descope-multi-select-combo-box.js.map +1 -1
- package/dist/umd/descope-multi-sso.js +1 -1
- package/dist/umd/descope-multi-sso.js.map +1 -1
- package/dist/umd/descope-new-password-index-js.js +1 -1
- package/dist/umd/descope-new-password-index-js.js.map +1 -1
- package/dist/umd/descope-passcode-index-js.js +1 -1
- package/dist/umd/descope-passcode-index-js.js.map +1 -1
- package/dist/umd/descope-security-questions-setup-index-js.js +1 -1
- package/dist/umd/descope-security-questions-setup-index-js.js.map +1 -1
- package/dist/umd/descope-security-questions-verify-index-js.js +1 -1
- package/dist/umd/descope-security-questions-verify-index-js.js.map +1 -1
- package/dist/umd/descope-text-field.js +1 -1
- package/dist/umd/descope-text-field.js.map +1 -1
- package/dist/umd/descope-trusted-devices.js +1 -1
- package/dist/umd/descope-trusted-devices.js.map +1 -1
- package/dist/umd/descope-user-attribute-index-js.js +2 -2
- package/dist/umd/descope-user-attribute-index-js.js.map +1 -1
- package/dist/umd/descope-user-auth-method-index-js.js +1 -1
- package/dist/umd/descope-user-auth-method-index-js.js.map +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -1
- package/dist/umd/mapping-fields-descope-mappings-field-index-js.js.map +1 -1
- package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js +1 -1
- package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js.map +1 -1
- package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js +1 -1
- package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js.map +1 -1
- package/dist/umd/phone-fields-descope-phone-field-index-js.js +1 -1
- package/dist/umd/phone-fields-descope-phone-field-index-js.js.map +1 -1
- package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js +1 -1
- package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js.map +1 -1
- package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js +1 -1
- package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js.map +1 -1
- package/package.json +42 -41
- package/src/components/descope-user-attribute/UserAttributeClass.js +91 -6
- package/src/components/descope-user-attribute/check.svg +3 -0
- package/src/components/descope-user-attribute/copy.svg +3 -0
- package/src/theme/components/index.js +2 -0
- package/stories/descope-user-attribute.stories.js +12 -0
package/dist/umd/67.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[67],{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=67.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"67.js","mappings":"6MAyBO,MAAMA,GAAgB,QAAiB,2BA0XxC,KACJC,EAAI,WACJC,EAAU,aACVC,EAAY,YACZC,EAAW,OACXC,EAAM,YACNC,EAAW,MACXC,EAAK,kBACLC,EAAiB,WACjBC,EAAU,aACVC,EAAY,KACZC,EAAI,UACJC,EAAS,wBACTC,EAAuB,yBACvBC,GACE,CACFb,KAAM,CAAEc,SAAU,IAAM,SACxBb,WAAY,CAAEa,SAAU,uBACxBZ,aAAc,CAAEY,SAAU,SAC1BX,YAAa,CAAEW,SAAU,6BACzBV,OAAQ,CAAEU,SAAU,yBACpBT,YAAa,CAAES,SAAU,wBACzBR,MAAO,CAAEQ,SAAU,iBACnBP,kBAAmB,CACjBO,SAAU,+CAEZN,WAAY,CAAEM,SAAU,uBACxBL,aAAc,CAAEK,SAAU,yBAC1BJ,KAAM,CAAEI,SAAU,sCAClBH,UAAW,CAAEG,SAAU,mDACvBF,wBAAyB,CACvBE,SAAU,+DAEZD,yBAA0B,CACxBC,SAAU,+DAIDC,GAA2B,SACtC,QAAiB,CACfC,SAAU,CACRC,UAAW,IAAKjB,EAAMkB,SAAU,SAChCC,cAAe,IAAKnB,EAAMkB,SAAU,aACpCE,SAAU,CAAC,CAAC,EAAGpB,GACfqB,aAAc,IAAKV,E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AO,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":""}
|
package/dist/umd/7092.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[7092],{86365(e,t,r){r.d(t,{C:()=>x,T:()=>s});var o=r(63200),a=r(25964),i=r(79673),n=r(88961);const s=(0,a.xE)("combo-box"),{host:l,inputField:d,inputElement:p,placeholder:c,toggle:u,clearButton:h,label:m,requiredIndicator:b,helperText:y,errorMessage:g,loader:v,overlayContent:f}={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)"},loader:{selector:"vaadin-combo-box-overlay::part(loader)"},overlayContent:{selector:"vaadin-combo-box-overlay::part(content)"}},x=(0,o.Zz)((0,n.RF)({mappings:{hostWidth:{...l,property:"width"},hostDirection:{...l,property:"direction"},fontSize:[{},l],fontFamily:[m,c,d,y,g],labelFontSize:{...m,property:"font-size"},labelFontWeight:{...m,property:"font-weight"},inputValueFontWeight:{...d,property:"font-weight"},inputPlaceholderFontWeight:{...c,property:"font-weight"},helperTextFontWeight:{...y,property:"font-weight"},errorMessageFontWeight:{...g,property:"font-weight"},labelTextColor:[{...m,property:"color"},{...m,property:"-webkit-text-fill-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:{...d,property:"height"},inputBackgroundColor:{...d,property:"background-color"},inputBorderColor:{...d,property:"border-color"},inputBorderWidth:{...d,property:"border-width"},inputBorderStyle:{...d,property:"border-style"},inputBorderRadius:{...d,property:"border-radius"},labelRequiredIndicator:{...b,property:"content"},inputValueTextColor:{...d,property:"color"},inputPlaceholderTextColor:{...c,property:"color"},inputDropdownButtonCursor:[{...u,property:"cursor"},{...h,property:"cursor"}],inputDropdownButtonColor:[{...u,property:"color"},{...h,property:"color"}],inputDropdownButtonSize:[{...u,property:"font-size"},{...h,property:"font-size"}],inputDropdownButtonOffset:[{...u,property:"margin-right"},{...u,property:"margin-left"}],inputOutlineColor:{...d,property:"outline-color"},inputOutlineWidth:{...d,property:"outline-width"},inputOutlineStyle:{...d,property:"outline-style"},inputOutlineOffset:{...d,property:"outline-offset"},inputHorizontalPadding:[{...p,property:"padding-left"},{...p,property:"padding-right"}],labelPosition:{...m,property:"position"},labelTopPosition:{...m,property:"top"},labelHorizontalPosition:[{...m,property:"left"},{...m,property:"right"}],inputTransformY:{...m,property:"transform"},inputTransition:{...m,property:"transition"},marginInlineStart:{...m,property:"margin-inline-start"},placeholderOpacity:{...c,property:"opacity"},inputVerticalAlignment:{...d,property:"align-items"},valueInputHeight:{...p,property:"height"},valueInputMarginBottom:{...p,property:"margin-bottom"},overlayBackground:{property:()=>x.cssVarList.overlay.backgroundColor},overlayTextColor:{property:()=>x.cssVarList.overlay.textColor},overlayBorder:{property:()=>x.cssVarList.overlay.border},overlayFontSize:{property:()=>x.cssVarList.overlay.fontSize},overlayFontFamily:{property:()=>x.cssVarList.overlay.fontFamily},overlayCursor:{property:()=>x.cssVarList.overlay.cursor},overlayItemBoxShadow:{property:()=>x.cssVarList.overlay.itemBoxShadow},overlayItemPaddingInlineStart:{property:()=>x.cssVarList.overlay.itemPaddingInlineStart},overlayItemPaddingInlineEnd:{property:()=>x.cssVarList.overlay.itemPaddingInlineEnd},overlayCheckmarkDisplay:{property:()=>x.cssVarList.overlay.checkmarkDisplay},overlaySelectedItemBackground:{property:()=>x.cssVarList.overlay.selectedItemBackground},overlaySelectedItemHoverBackground:{property:()=>x.cssVarList.overlay.selectedItemHoverBackground},overlaySelectedItemFocusBackground:{property:()=>x.cssVarList.overlay.selectedItemFocusBackground},overlayItemHoverBackground:{property:()=>x.cssVarList.overlay.itemHoverBackground},overlayItemFocusBackground:{property:()=>x.cssVarList.overlay.itemFocusBackground}}}),n.VO,(0,n.mA)({name:"overlay",selector:"",mappings:{backgroundColor:[{selector:"vaadin-combo-box-scroller"},{selector:"vaadin-combo-box-overlay::part(overlay)"}],minHeight:{selector:"vaadin-combo-box-overlay"},margin:{selector:"vaadin-combo-box-overlay"},cursor:{selector:"vaadin-combo-box-item"},fontFamily:{selector:"vaadin-combo-box-item"},textColor:{selector:"vaadin-combo-box-item",property:"color"},fontSize:{selector:"vaadin-combo-box-item"},itemBoxShadow:{selector:"vaadin-combo-box-item",property:"box-shadow"},itemPaddingInlineStart:{selector:"vaadin-combo-box-item",property:"padding-inline-start"},itemPaddingInlineEnd:{selector:"vaadin-combo-box-item",property:"padding-inline-end"},checkmarkDisplay:{selector:"vaadin-combo-box-item::part(checkmark)",property:"display"},selectedItemBackground:{selector:"vaadin-combo-box-item[selected]",property:"background-color"},selectedItemHoverBackground:{selector:"vaadin-combo-box-item[selected]:hover:not([disabled])",property:"background-color"},selectedItemFocusBackground:{selector:"vaadin-combo-box-item[selected][focused]:not([disabled])",property:"background-color"},itemHoverBackground:{selector:"vaadin-combo-box-item:hover:not([selected]):not([disabled])",property:"background-color"},itemFocusBackground:{selector:"vaadin-combo-box-item[focused]:not([selected]):not([disabled])",property:"background-color"},loaderTop:{...v,property:"top"},loaderLeft:{...v,property:"left"},loaderRight:{...v,property:"right"},loaderMargin:{...v,property:"margin"},loaderWidth:{...v,property:"width"},loaderHeight:{...v,property:"height"},loaderBorder:{...v,property:"border"},loaderBorderColor:{...v,property:"border-color"},loaderBorderRadius:{...v,property:"border-radius"},contentHeight:{...f,property:"height"},contentOpacity:{...f,property:"opacity"},scrollerMinHeight:{selector:"vaadin-combo-box-scroller",property:"min-height"}},forward:{include:!1,attributes:["size"]}}),(0,n.OZ)({proxyProps:["selectionStart"],inputEvent:"value-changed"}),n.Yg,n.tQ,e=>class extends e{static get observedAttributes(){return["label-type","require-match"]}#e=({displayName:e,value:t,label:r})=>`<span data-name="${r}" data-id="${t}">${e||r}</span>`;#t;get defaultValue(){return this.getAttribute("default-value")}get renderItem(){return this.#e}set renderItem(e){this.#e=e,this.renderItems()}set renderer(e){this.baseElement.renderer=e}get loading(){return"true"===this.getAttribute("loading")}set loading(e){e?this.setAttribute("loading","true"):this.removeAttribute("loading")}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 requireMatch(){return"true"===this.getAttribute("require-match")&&!this.allowCustomValue}isValidDataType(e){const t=Array.isArray(e);return t||console.error("data must be an array, received:",e),t}getItemsTemplate(){return this.data?.reduce?.((e,t)=>e+(this.renderItem?.(t||{})||""),"")}renderItems(){if(this.#t||this.getAttribute("data")){const e=this.getItemsTemplate();this.innerHTML=e}}get hasDynamicData(){return"true"===this.getAttribute("has-dynamic-data")}get shouldSelectItemOnItemsChange(){return!this.hasDynamicData||this.allowCustomValue}handleSelectedItem(){const{selectedItem:e}=this.baseElement,t=e?.["data-id"];e&&Array.from(this.children).includes(e)||(t&&this.shouldSelectItemOnItemsChange&&(this.value=t),this.value||this.setDefaultValue())}customValueTransformFn(e){return e}setComboBoxDescriptor(){const e=Object.getOwnPropertyDescriptor(this.inputElement.constructor.prototype,"value"),t=this;Object.defineProperties(this.inputElement,{value:{...e,set(r){if(!t.baseElement.items?.length&&!t.allowCustomValue)return;const o=t.customValueTransformFn(r)||"";o!==this.value&&e.set.call(this,o)}}})}#r(){const e=Array.from(this.children);e.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=e,setTimeout(()=>{this.handleSelectedItem()},0)}#o(){const e=this.baseElement.shadowRoot.querySelector("vaadin-combo-box-overlay");e._attachOverlay=()=>{e.bringToFront()},e._detachOverlay=()=>{},e._enterModalState=()=>{}}#a(){this.baseElement.renderer=(e,t,r)=>{e.innerHTML=r.item.outerHTML}}#i(){this.hasDynamicData&&(this.baseElement._dataProviderFilterChanged=()=>{})}isValueMatch(){const e=this.baseElement.querySelector("input").value;return!e||this.baseElement.items.some(t=>t.dataset.name===e||t.dataset.id===e)}init(){super.init?.(),this.getValidity=function(){return this.requireMatch&&!this.isValueMatch()?{patternMismatch:!0}:!this.value&&this.isRequired?{valueMissing:!0}:{}},this.#a(),this.#i(),setTimeout(()=>{this.setComboBoxDescriptor(),this.#o()}),(0,a.mx)(this,this.renderItems.bind(this),{includeAttrs:["data"]}),(0,a.Ge)(this,this.#r.bind(this)),this.setDefaultValue(),this.baseElement.addEventListener("value-changed",()=>{this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}),this.baseElement.addEventListener("filter-changed",e=>{this.dispatchEvent(new CustomEvent("filter-changed",{bubbles:!0,composed:!0,detail:e.detail}))})}onLabelClick(){this.isReadOnly||this.isDisabled||(this.focus(),this.autoOpenDisabled||this.setAttribute("opened","true"))}handleRequireMatchChange(e){this.baseElement.allowCustomValue=e||this.allowCustomValue}attributeChangedCallback(e,t,r){super.attributeChangedCallback?.(e,t,r),t!==r&&("label-type"===e?"floating"===r?this.addEventListener("click",this.onLabelClick):this.removeEventListener("click",this.onLabelClick):"require-match"===e&&this.handleRequireMatchChange("true"===r))}setDefaultValue(){this.defaultValue&&(this.value=this.defaultValue)}#n(e){return this.baseElement.items?.find(t=>t["data-id"]===e)}#s(e,t){e===this.value&&t!==this.baseElement.selectedItem&&this.baseElement.addEventListener("selected-item-changed",e=>{e.stopImmediatePropagation()},{once:!0,capture:!0})}set value(e){const t=this.#n(e);this.#s(e,t),e&&t?this.baseElement.selectedItem=t:!t&&this.allowCustomValue?this.baseElement.value=e:this.baseElement.selectedItem=void 0}get value(){return(this.baseElement.selectedItem?.["data-id"]||this.allowCustomValue)&&this.baseElement.__data.value||""}get allowCustomValue(){return"true"===this.getAttribute("allow-custom-value")}get autoOpenDisabled(){return"true"===this.getAttribute("auto-open-disabled")}})((0,n.tz)({slots:["","prefix"],wrappedEleName:"vaadin-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,i.cy)(x.cssVarList)}\n\t\t${(0,i.fu)("vaadin-combo-box")}\n\t\t${(0,i.lS)("vaadin-combo-box")}\n\t\t${(0,i.I4)("vaadin-combo-box")}\n\n\t\tvaadin-combo-box {\n\t\t\tpadding: 0;\n\t\t\twidth: 100%;\n\t\t}\n\t\tvaadin-combo-box::before {\n\t\t\theight: initial;\n\t\t}\n\t\tvaadin-combo-box [slot="input"] {\n\t\t\t-webkit-mask-image: none;\n\t\t\tmin-height: 0;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\n\t\tvaadin-combo-box::part(input-field) {\n\t\t\tpadding: 0;\n\t\t\tbox-shadow: none;\n\t\t}\n\n vaadin-combo-box::part(toggle-button),\n vaadin-combo-box::part(clear-button) {\n align-self: center;\n }\n\n vaadin-combo-box[hide-toggle-button="true"]::part(toggle-button) {\n display: none;\n }\n\n vaadin-combo-box[label-type="floating"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n vaadin-combo-box[label-type="floating"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n\n ${(0,i.$J)("vaadin-combo-box")}\n ${(0,i.Kl)()}\n\t\t`,excludeAttrsSync:["tabindex","size","data","loading","style"],componentName:s,includeForwardProps:["items","renderer","selectedItem"]}))},27092(e,t,r){r.r(t),r.d(t,{ComboBoxClass:()=>o.C,componentName:()=>o.T}),r(1632);var o=r(86365);customElements.define(o.T,o.C)}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[7092],{86365(e,t,r){r.d(t,{C:()=>x,T:()=>s});var o=r(63200),a=r(25964),i=r(79673),n=r(88961);const s=(0,a.xE)("combo-box"),{host:l,inputField:d,inputElement:p,placeholder:c,toggle:u,clearButton:h,label:m,requiredIndicator:b,helperText:y,errorMessage:g,loader:v,overlayContent:f}={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)"},loader:{selector:"vaadin-combo-box-overlay::part(loader)"},overlayContent:{selector:"vaadin-combo-box-overlay::part(content)"}},x=(0,o.Zz)((0,n.RF)({mappings:{hostWidth:{...l,property:"width"},hostDirection:{...l,property:"direction"},fontSize:[{},l],fontFamily:[m,c,d,y,g],labelFontSize:{...m,property:"font-size"},labelFontWeight:{...m,property:"font-weight"},inputValueFontWeight:{...d,property:"font-weight"},inputPlaceholderFontWeight:{...c,property:"font-weight"},helperTextFontWeight:{...y,property:"font-weight"},errorMessageFontWeight:{...g,property:"font-weight"},labelTextColor:[{...m,property:"color"},{...m,property:"-webkit-text-fill-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:{...d,property:"height"},inputBackgroundColor:{...d,property:"background-color"},inputBorderColor:{...d,property:"border-color"},inputBorderWidth:{...d,property:"border-width"},inputBorderStyle:{...d,property:"border-style"},inputBorderRadius:{...d,property:"border-radius"},labelRequiredIndicator:{...b,property:"content"},inputValueTextColor:{...d,property:"color"},inputPlaceholderTextColor:{...c,property:"color"},inputDropdownButtonCursor:[{...u,property:"cursor"},{...h,property:"cursor"}],inputDropdownButtonColor:[{...u,property:"color"},{...h,property:"color"}],inputDropdownButtonSize:[{...u,property:"font-size"},{...h,property:"font-size"}],inputDropdownButtonOffset:[{...u,property:"margin-right"},{...u,property:"margin-left"}],inputOutlineColor:{...d,property:"outline-color"},inputOutlineWidth:{...d,property:"outline-width"},inputOutlineStyle:{...d,property:"outline-style"},inputOutlineOffset:{...d,property:"outline-offset"},inputHorizontalPadding:[{...p,property:"padding-left"},{...p,property:"padding-right"}],labelPosition:{...m,property:"position"},labelTopPosition:{...m,property:"top"},labelHorizontalPosition:[{...m,property:"left"},{...m,property:"right"}],inputTransformY:{...m,property:"transform"},inputTransition:{...m,property:"transition"},marginInlineStart:{...m,property:"margin-inline-start"},placeholderOpacity:{...c,property:"opacity"},inputVerticalAlignment:{...d,property:"align-items"},valueInputHeight:{...p,property:"height"},valueInputMarginBottom:{...p,property:"margin-bottom"},overlayBackground:{property:()=>x.cssVarList.overlay.backgroundColor},overlayTextColor:{property:()=>x.cssVarList.overlay.textColor},overlayBorder:{property:()=>x.cssVarList.overlay.border},overlayFontSize:{property:()=>x.cssVarList.overlay.fontSize},overlayFontFamily:{property:()=>x.cssVarList.overlay.fontFamily},overlayCursor:{property:()=>x.cssVarList.overlay.cursor},overlayItemBoxShadow:{property:()=>x.cssVarList.overlay.itemBoxShadow},overlayItemPaddingInlineStart:{property:()=>x.cssVarList.overlay.itemPaddingInlineStart},overlayItemPaddingInlineEnd:{property:()=>x.cssVarList.overlay.itemPaddingInlineEnd},overlayCheckmarkDisplay:{property:()=>x.cssVarList.overlay.checkmarkDisplay},overlaySelectedItemBackground:{property:()=>x.cssVarList.overlay.selectedItemBackground},overlaySelectedItemHoverBackground:{property:()=>x.cssVarList.overlay.selectedItemHoverBackground},overlaySelectedItemFocusBackground:{property:()=>x.cssVarList.overlay.selectedItemFocusBackground},overlayItemHoverBackground:{property:()=>x.cssVarList.overlay.itemHoverBackground},overlayItemFocusBackground:{property:()=>x.cssVarList.overlay.itemFocusBackground}}}),n.VO,(0,n.mA)({name:"overlay",selector:"",mappings:{backgroundColor:[{selector:"vaadin-combo-box-scroller"},{selector:"vaadin-combo-box-overlay::part(overlay)"}],minHeight:{selector:"vaadin-combo-box-overlay"},margin:{selector:"vaadin-combo-box-overlay"},cursor:{selector:"vaadin-combo-box-item"},fontFamily:{selector:"vaadin-combo-box-item"},textColor:{selector:"vaadin-combo-box-item",property:"color"},fontSize:{selector:"vaadin-combo-box-item"},itemBoxShadow:{selector:"vaadin-combo-box-item",property:"box-shadow"},itemPaddingInlineStart:{selector:"vaadin-combo-box-item",property:"padding-inline-start"},itemPaddingInlineEnd:{selector:"vaadin-combo-box-item",property:"padding-inline-end"},checkmarkDisplay:{selector:"vaadin-combo-box-item::part(checkmark)",property:"display"},selectedItemBackground:{selector:"vaadin-combo-box-item[selected]",property:"background-color"},selectedItemHoverBackground:{selector:"vaadin-combo-box-item[selected]:hover:not([disabled])",property:"background-color"},selectedItemFocusBackground:{selector:"vaadin-combo-box-item[selected][focused]:not([disabled])",property:"background-color"},itemHoverBackground:{selector:"vaadin-combo-box-item:hover:not([selected]):not([disabled])",property:"background-color"},itemFocusBackground:{selector:"vaadin-combo-box-item[focused]:not([selected]):not([disabled])",property:"background-color"},loaderTop:{...v,property:"top"},loaderLeft:{...v,property:"left"},loaderRight:{...v,property:"right"},loaderMargin:{...v,property:"margin"},loaderWidth:{...v,property:"width"},loaderHeight:{...v,property:"height"},loaderBorder:{...v,property:"border"},loaderBorderColor:{...v,property:"border-color"},loaderBorderRadius:{...v,property:"border-radius"},contentHeight:{...f,property:"height"},contentOpacity:{...f,property:"opacity"},scrollerMinHeight:{selector:"vaadin-combo-box-scroller",property:"min-height"}},forward:{include:!1,attributes:["size"]}}),(0,n.OZ)({proxyProps:["selectionStart"],inputEvent:"value-changed"}),n.Yg,n.tQ,e=>class extends e{static get observedAttributes(){return["label-type","require-match"]}#e=({displayName:e,value:t,label:r})=>`<span data-name="${r}" data-id="${t}">${e||r}</span>`;#t;get defaultValue(){return this.getAttribute("default-value")}get renderItem(){return this.#e}set renderItem(e){this.#e=e,this.renderItems()}set renderer(e){this.baseElement.renderer=e}get loading(){return"true"===this.getAttribute("loading")}set loading(e){e?this.setAttribute("loading","true"):this.removeAttribute("loading")}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 requireMatch(){return"true"===this.getAttribute("require-match")&&!this.allowCustomValue}isValidDataType(e){const t=Array.isArray(e);return t||console.error("data must be an array, received:",e),t}getItemsTemplate(){return this.data?.reduce?.((e,t)=>e+(this.renderItem?.(t||{})||""),"")}renderItems(){if(this.#t||this.getAttribute("data")){const e=this.getItemsTemplate();this.innerHTML=e}}get hasDynamicData(){return"true"===this.getAttribute("has-dynamic-data")}get shouldSelectItemOnItemsChange(){return!this.hasDynamicData||this.allowCustomValue}handleSelectedItem(){const{selectedItem:e}=this.baseElement,t=e?.["data-id"];e&&Array.from(this.children).includes(e)||(t&&this.shouldSelectItemOnItemsChange&&(this.value=t),this.value||this.setDefaultValue())}customValueTransformFn(e){return e}setComboBoxDescriptor(){const e=Object.getOwnPropertyDescriptor(this.inputElement.constructor.prototype,"value"),t=this;Object.defineProperties(this.inputElement,{value:{...e,set(r){if(!t.baseElement.items?.length&&!t.allowCustomValue)return;const o=t.customValueTransformFn(r)||"";o!==this.value&&e.set.call(this,o)}}})}#r(){const e=Array.from(this.children);e.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=e,setTimeout(()=>{this.handleSelectedItem()},0)}#o(){const e=this.baseElement.shadowRoot.querySelector("vaadin-combo-box-overlay");e._attachOverlay=()=>{e.bringToFront()},e._detachOverlay=()=>{},e._enterModalState=()=>{}}#a(){this.baseElement.renderer=(e,t,r)=>{e.innerHTML=r.item.outerHTML}}#i(){this.hasDynamicData&&(this.baseElement._dataProviderFilterChanged=()=>{})}isValueMatch(){const e=this.baseElement.querySelector("input").value;return!e||this.baseElement.items.some(t=>t.dataset.name===e||t.dataset.id===e)}init(){super.init?.(),(0,a.EA)(this,this.baseElement,{includeAttrs:["placeholder"]}),this.getValidity=function(){return this.requireMatch&&!this.isValueMatch()?{patternMismatch:!0}:!this.value&&this.isRequired?{valueMissing:!0}:{}},this.#a(),this.#i(),setTimeout(()=>{this.setComboBoxDescriptor(),this.#o()}),(0,a.mx)(this,this.renderItems.bind(this),{includeAttrs:["data"]}),(0,a.Ge)(this,this.#r.bind(this)),this.setDefaultValue(),this.baseElement.addEventListener("value-changed",()=>{this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}),this.baseElement.addEventListener("filter-changed",e=>{this.dispatchEvent(new CustomEvent("filter-changed",{bubbles:!0,composed:!0,detail:e.detail}))})}onLabelClick(){this.isReadOnly||this.isDisabled||(this.focus(),this.autoOpenDisabled||this.setAttribute("opened","true"))}handleRequireMatchChange(e){this.baseElement.allowCustomValue=e||this.allowCustomValue}attributeChangedCallback(e,t,r){super.attributeChangedCallback?.(e,t,r),t!==r&&("label-type"===e?"floating"===r?this.addEventListener("click",this.onLabelClick):this.removeEventListener("click",this.onLabelClick):"require-match"===e&&this.handleRequireMatchChange("true"===r))}setDefaultValue(){this.defaultValue&&(this.value=this.defaultValue)}#n(e){return this.baseElement.items?.find(t=>t["data-id"]===e)}#s(e,t){e===this.value&&t!==this.baseElement.selectedItem&&this.baseElement.addEventListener("selected-item-changed",e=>{e.stopImmediatePropagation()},{once:!0,capture:!0})}set value(e){const t=this.#n(e);this.#s(e,t),e&&t?this.baseElement.selectedItem=t:!t&&this.allowCustomValue?this.baseElement.value=e:this.baseElement.selectedItem=void 0}get value(){return(this.baseElement.selectedItem?.["data-id"]||this.allowCustomValue)&&this.baseElement.__data.value||""}get allowCustomValue(){return"true"===this.getAttribute("allow-custom-value")}get autoOpenDisabled(){return"true"===this.getAttribute("auto-open-disabled")}})((0,n.tz)({slots:["","prefix"],wrappedEleName:"vaadin-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,i.cy)(x.cssVarList)}\n\t\t${(0,i.fu)("vaadin-combo-box")}\n\t\t${(0,i.lS)("vaadin-combo-box")}\n\t\t${(0,i.I4)("vaadin-combo-box")}\n\n\t\tvaadin-combo-box {\n\t\t\tpadding: 0;\n\t\t\twidth: 100%;\n\t\t}\n\t\tvaadin-combo-box::before {\n\t\t\theight: initial;\n\t\t}\n\t\tvaadin-combo-box [slot="input"] {\n\t\t\t-webkit-mask-image: none;\n\t\t\tmin-height: 0;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\n\t\tvaadin-combo-box::part(input-field) {\n\t\t\tpadding: 0;\n\t\t\tbox-shadow: none;\n\t\t}\n\n vaadin-combo-box::part(toggle-button),\n vaadin-combo-box::part(clear-button) {\n align-self: center;\n }\n\n vaadin-combo-box[hide-toggle-button="true"]::part(toggle-button) {\n display: none;\n }\n\n vaadin-combo-box[label-type="floating"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n vaadin-combo-box[label-type="floating"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n\n ${(0,i.$J)("vaadin-combo-box")}\n ${(0,i.Kl)()}\n\t\t`,excludeAttrsSync:["tabindex","size","placeholder","data","loading","style"],componentName:s,includeForwardProps:["items","renderer","selectedItem"]}))},27092(e,t,r){r.r(t),r.d(t,{ComboBoxClass:()=>o.C,componentName:()=>o.T}),r(1632);var o=r(86365);customElements.define(o.T,o.C)}}]);
|
|
2
2
|
//# sourceMappingURL=7092.js.map
|
package/dist/umd/7092.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"7092.js","mappings":"+MAwBO,MAAMA,GAAgB,QAAiB,cAqYxC,KACJC,EAAI,WACJC,EAAU,aACVC,EAAY,YACZC,EAAW,OACXC,EAAM,YACNC,EAAW,MACXC,EAAK,kBACLC,EAAiB,WACjBC,EAAU,aACVC,EAAY,OACZC,EAAM,eACNC,GACE,CACFX,KAAM,CAAEY,SAAU,IAAM,SACxBX,WAAY,CAAEW,SAAU,uBACxBV,aAAc,CAAEU,SAAU,SAC1BT,YAAa,CAAES,SAAU,6BACzBR,OAAQ,CAAEQ,SAAU,yBACpBP,YAAa,CAAEO,SAAU,wBACzBN,MAAO,CAAEM,SAAU,iBACnBL,kBAAmB,CACjBK,SAAU,+CAEZJ,WAAY,CAAEI,SAAU,uBACxBH,aAAc,CAAEG,SAAU,yBAC1BF,OAAQ,CAAEE,SAAU,0CACpBD,eAAgB,CAAEC,SAAU,4CAGjBC,GAAgB,SAC3B,QAAiB,CACfC,SAAU,CACRC,UAAW,IAAKf,EAAMgB,SAAU,SAChCC,cAAe,IAAKjB,EAAMgB,SAAU,aAEpCE,SAAU,CAAC,CAAC,EAAGlB,GACfmB,WAAY,CAACb,EAAOH,EAAaF,EAAYO,EAAYC,GACzDW,cAAe,IAAKd,EAAOU,SAAU,aACrCK,gBAAiB,IAAKf,EAAOU,SAAU,eACvCM,qBAAsB,IAAKrB,EAAYe,SAAU,eACjDO,2BAA4B,IAAKpB,EAAaa,SAAU,eACxDQ,qBAAsB,IAAKhB,EAAYQ,SAAU,eACjDS,uBAAwB,IAAKhB,EAAcO,SAAU,eACrDU,eAAgB,CACd,IAAKpB,EAAOU,SAAU,SACtB,IAAKV,EAAOU,SAAU,2BACtB,IAAK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b,QAAuBxN,EAAckD,qBACrC,QAAwB,6BACxB,QAAsB,6BACtB,QAAiB,u2BAoCf,QAAwB,6BACxB,kBAMFuK,iBAAkB,CAAC,WAAY,OAAQ,OAAQ,UAAW,SAC1DvO,gBACAwO,oBAAqB,CAAC,QAAS,WAAY,kB,kGC3sB/CC,eAAeC,OAAO,IAAe,EAAAC,E","sources":["webpack://@descope/web-components-ui/../components/descope-combo-box/src/component/ComboBoxClass.js","webpack://@descope/web-components-ui/../components/descope-combo-box/src/component/index.js"],"sourcesContent":["import { compose } from '@descope-ui/common/utils';\nimport {\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 inputOverrideValidConstraintsMixin,\n portalMixin,\n proxyInputMixin,\n} from '@descope-ui/common/components-mixins';\n\nexport const componentName = getComponentName('combo-box');\n\nconst ComboBoxMixin = (superclass) =>\n class ComboBoxMixinClass extends superclass {\n static get observedAttributes() {\n return ['label-type', 'require-match'];\n }\n\n \n #renderItem = ({ displayName, value, label }) => {\n return `<span data-name=\"${label}\" data-id=\"${value}\">${\n displayName || label\n }</span>`;\n };\n\n #data;\n\n get defaultValue() {\n return this.getAttribute('default-value');\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 set renderer(fn) {\n // fn takes (root, comboBox, model) as arguments\n this.baseElement.renderer = fn;\n }\n\n get loading() {\n return this.getAttribute('loading') === 'true';\n }\n\n set loading(val) {\n if (val) {\n this.setAttribute('loading', 'true');\n } else {\n this.removeAttribute('loading');\n }\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 \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 requireMatch() {\n return (\n this.getAttribute('require-match') === 'true' && !this.allowCustomValue\n );\n }\n\n \n isValidDataType(data) {\n const isValid = Array.isArray(data);\n if (!isValid) {\n \n console.error('data must be an array, received:', data);\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 if (this.#data || this.getAttribute('data')) {\n const template = this.getItemsTemplate();\n this.innerHTML = template;\n }\n }\n\n get hasDynamicData() {\n return this.getAttribute('has-dynamic-data') === 'true';\n }\n\n get shouldSelectItemOnItemsChange() {\n return !this.hasDynamicData || this.allowCustomValue;\n }\n\n handleSelectedItem() {\n const { selectedItem } = this.baseElement;\n const currentSelected = selectedItem?.['data-id'];\n\n // If the selected item is still a child, there's no need to update the value\n if (selectedItem && Array.from(this.children).includes(selectedItem)) {\n return;\n }\n\n // if previously selected item ID exists in current children, set it as selected\n if (currentSelected && this.shouldSelectItemOnItemsChange) {\n this.value = currentSelected;\n }\n\n // otherwise, if default value is specified, set default value as selected item\n if (!this.value) {\n this.setDefaultValue();\n }\n }\n\n \n customValueTransformFn(val) {\n return val;\n }\n\n // We want to override Vaadin's Combo Box value setter. This is needed since Vaadin couples between the\n // field that it searches the value, and the finaly display value of the input.\n // We provide a custom transform function to override that behavior.\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 if (\n !comboBox.baseElement.items?.length &&\n !comboBox.allowCustomValue\n ) {\n return;\n }\n\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 // vaadin api is to set props on their combo box node,\n // in order to avoid it, we are passing the children of this component\n // to the items & renderer props, so it will be used as the combo box items\n #onChildrenChange() {\n const items = Array.from(this.children);\n\n // we want the data-name attribute to be accessible as an object attribute\n items.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 = items;\n setTimeout(() => {\n // set timeout to ensure this runs after customValueTransformFn had the chance to be overriden\n this.handleSelectedItem();\n }, 0);\n }\n\n // the default vaadin behavior is to attach the overlay to the body when opened\n // we do not want that because it's difficult to style the overlay in this way\n // so we override it to open inside the shadow DOM\n #overrideOverlaySettings() {\n const overlay = this.baseElement.shadowRoot.querySelector(\n 'vaadin-combo-box-overlay',\n );\n overlay._attachOverlay = () => {\n overlay.bringToFront();\n };\n overlay._detachOverlay = () => {};\n overlay._enterModalState = () => {};\n }\n\n #overrideRenderer() {\n // use vaadin combobox custom renderer to render options as HTML\n // and not via default renderer, which renders only the data-name's value\n // in its own HTML template\n this.baseElement.renderer = (root, combo, model) => {\n \n root.innerHTML = model.item.outerHTML;\n };\n }\n\n #disableDataProviderFilterEventIfNeeded() {\n if (this.hasDynamicData) {\n // For the autocomplete field, we don't want to trigger the data provider filter changed event\n // because it changes the loading state on every keystroke, making the overlay open and close\n // on every keystroke, causing a flickering effect in the loading state.\n this.baseElement._dataProviderFilterChanged = () => {};\n }\n }\n\n isValueMatch() {\n const val = this.baseElement.querySelector('input').value;\n\n if (val) {\n return this.baseElement.items.some(\n (item) => item.dataset.name === val || item.dataset.id === val,\n );\n }\n\n return true;\n }\n\n init() {\n super.init?.();\n\n \n this.getValidity = function () {\n if (this.requireMatch && !this.isValueMatch()) {\n return {\n patternMismatch: true,\n };\n }\n\n if (!this.value && this.isRequired) {\n return {\n valueMissing: true,\n };\n }\n\n return {};\n };\n\n this.#overrideRenderer();\n this.#disableDataProviderFilterEventIfNeeded();\n\n // This is a workaround for a problem we have in Console App, where in ScreenBuilder - the inputElement is not ready when trying to\n // set the component's descriptor and override the overlay settings.\n // THIS IS A PROBLEM WITH THE CONSOLE APP THAT NEEDS TO BE RESOLVED. Until then, we use this workaround.\n setTimeout(() => {\n this.setComboBoxDescriptor();\n this.#overrideOverlaySettings();\n });\n\n // Set up observers - order matters here since renderItems can clear innerHTML\n observeAttributes(this, this.renderItems.bind(this), {\n includeAttrs: ['data'],\n });\n observeChildren(this, this.#onChildrenChange.bind(this));\n\n this.setDefaultValue();\n\n // Using \"value-changed\" event instead of \"selected-item-changed\" event to avoid\n // the issue of the value not being updated in the input field when the user enter a custom value\n this.baseElement.addEventListener('value-changed', () => {\n this.dispatchEvent(\n new Event('input', { bubbles: true, composed: true }),\n );\n });\n\n this.baseElement.addEventListener('filter-changed', (e) => {\n this.dispatchEvent(\n new CustomEvent('filter-changed', {\n bubbles: true,\n composed: true,\n detail: e.detail,\n }),\n );\n });\n }\n\n onLabelClick() {\n if (this.isReadOnly || this.isDisabled) {\n return;\n }\n this.focus();\n if (!this.autoOpenDisabled) {\n this.setAttribute('opened', 'true');\n }\n }\n\n handleRequireMatchChange(shouldValidate) {\n this.baseElement.allowCustomValue =\n shouldValidate || this.allowCustomValue;\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue !== newValue) {\n if (attrName === 'label-type') {\n if (newValue === 'floating') {\n this.addEventListener('click', this.onLabelClick);\n } else {\n this.removeEventListener('click', this.onLabelClick);\n }\n } else if (attrName === 'require-match') {\n this.handleRequireMatchChange(newValue === 'true');\n }\n }\n }\n\n setDefaultValue() {\n if (this.defaultValue) {\n this.value = this.defaultValue;\n }\n }\n\n #getChildToSelect(val) {\n return this.baseElement.items?.find((item) => item['data-id'] === val);\n }\n\n #preventSelectedItemChangeEventIfNeeded(val, selectedChild) {\n // If the actual value didn't change, but the selected item did (the element changed),\n // we want to stop the event propagation since it's not a real change\n const shouldPreventItemChangeEvent =\n val === this.value && selectedChild !== this.baseElement.selectedItem;\n if (shouldPreventItemChangeEvent) {\n this.baseElement.addEventListener(\n 'selected-item-changed',\n (e) => {\n e.stopImmediatePropagation();\n },\n { once: true, capture: true },\n );\n }\n }\n\n set value(val) {\n const selectedChild = this.#getChildToSelect(val);\n this.#preventSelectedItemChangeEventIfNeeded(val, selectedChild);\n if (val && selectedChild) {\n this.baseElement.selectedItem = selectedChild;\n } else if (!selectedChild && this.allowCustomValue) {\n this.baseElement.value = val;\n } else {\n this.baseElement.selectedItem = undefined;\n }\n }\n\n get value() {\n return this.baseElement.selectedItem?.['data-id'] || this.allowCustomValue\n ? this.baseElement.__data.value || ''\n : '';\n }\n\n get allowCustomValue() {\n return this.getAttribute('allow-custom-value') === 'true';\n }\n\n get autoOpenDisabled() {\n return this.getAttribute('auto-open-disabled') === 'true';\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 loader,\n overlayContent,\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 loader: { selector: 'vaadin-combo-box-overlay::part(loader)' },\n overlayContent: { selector: 'vaadin-combo-box-overlay::part(content)' },\n};\n\nexport const ComboBoxClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n // we apply font-size also on the host so we can set its width with em\n fontSize: [{}, host],\n fontFamily: [label, placeholder, inputField, helperText, errorMessage],\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 { ...label, property: '-webkit-text-fill-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: '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 ],\n\n labelPosition: { ...label, property: 'position' },\n labelTopPosition: { ...label, property: 'top' },\n labelHorizontalPosition: [\n { ...label, property: 'left' },\n { ...label, property: 'right' },\n ],\n inputTransformY: { ...label, property: 'transform' },\n inputTransition: { ...label, property: 'transition' },\n marginInlineStart: { ...label, property: 'margin-inline-start' },\n placeholderOpacity: { ...placeholder, property: 'opacity' },\n inputVerticalAlignment: { ...inputField, property: 'align-items' },\n valueInputHeight: { ...inputElement, property: 'height' },\n valueInputMarginBottom: { ...inputElement, property: 'margin-bottom' },\n\n // we need to use the variables from the portal mixin\n // so we need to use an arrow function on the selector\n // for that to work, because ComboBox is not available\n // at this time.\n overlayBackground: {\n property: () => ComboBoxClass.cssVarList.overlay.backgroundColor,\n },\n overlayTextColor: {\n property: () => ComboBoxClass.cssVarList.overlay.textColor,\n },\n overlayBorder: {\n property: () => ComboBoxClass.cssVarList.overlay.border,\n },\n overlayFontSize: {\n property: () => ComboBoxClass.cssVarList.overlay.fontSize,\n },\n overlayFontFamily: {\n property: () => ComboBoxClass.cssVarList.overlay.fontFamily,\n },\n overlayCursor: {\n property: () => ComboBoxClass.cssVarList.overlay.cursor,\n },\n overlayItemBoxShadow: {\n property: () => ComboBoxClass.cssVarList.overlay.itemBoxShadow,\n },\n overlayItemPaddingInlineStart: {\n property: () => ComboBoxClass.cssVarList.overlay.itemPaddingInlineStart,\n },\n overlayItemPaddingInlineEnd: {\n property: () => ComboBoxClass.cssVarList.overlay.itemPaddingInlineEnd,\n },\n overlayCheckmarkDisplay: {\n property: () => ComboBoxClass.cssVarList.overlay.checkmarkDisplay,\n },\n overlaySelectedItemBackground: {\n property: () => ComboBoxClass.cssVarList.overlay.selectedItemBackground,\n },\n overlaySelectedItemHoverBackground: {\n property: () =>\n ComboBoxClass.cssVarList.overlay.selectedItemHoverBackground,\n },\n overlaySelectedItemFocusBackground: {\n property: () =>\n ComboBoxClass.cssVarList.overlay.selectedItemFocusBackground,\n },\n overlayItemHoverBackground: {\n property: () => ComboBoxClass.cssVarList.overlay.itemHoverBackground,\n },\n overlayItemFocusBackground: {\n property: () => ComboBoxClass.cssVarList.overlay.itemFocusBackground,\n },\n },\n }),\n draggableMixin,\n portalMixin({\n name: 'overlay',\n selector: '',\n mappings: {\n backgroundColor: [\n { selector: 'vaadin-combo-box-scroller' },\n { selector: 'vaadin-combo-box-overlay::part(overlay)' },\n ],\n minHeight: { selector: 'vaadin-combo-box-overlay' },\n margin: { selector: 'vaadin-combo-box-overlay' },\n cursor: { selector: 'vaadin-combo-box-item' },\n fontFamily: { selector: 'vaadin-combo-box-item' },\n textColor: { selector: 'vaadin-combo-box-item', property: 'color' },\n fontSize: { selector: 'vaadin-combo-box-item' },\n itemBoxShadow: {\n selector: 'vaadin-combo-box-item',\n property: 'box-shadow',\n },\n itemPaddingInlineStart: {\n selector: 'vaadin-combo-box-item',\n property: 'padding-inline-start',\n },\n itemPaddingInlineEnd: {\n selector: 'vaadin-combo-box-item',\n property: 'padding-inline-end',\n },\n checkmarkDisplay: {\n selector: 'vaadin-combo-box-item::part(checkmark)',\n property: 'display',\n },\n selectedItemBackground: {\n selector: 'vaadin-combo-box-item[selected]',\n property: 'background-color',\n },\n selectedItemHoverBackground: {\n selector: 'vaadin-combo-box-item[selected]:hover:not([disabled])',\n property: 'background-color',\n },\n selectedItemFocusBackground: {\n selector: 'vaadin-combo-box-item[selected][focused]:not([disabled])',\n property: 'background-color',\n },\n itemHoverBackground: {\n selector: 'vaadin-combo-box-item:hover:not([selected]):not([disabled])',\n property: 'background-color',\n },\n itemFocusBackground: {\n selector:\n 'vaadin-combo-box-item[focused]:not([selected]):not([disabled])',\n property: 'background-color',\n },\n\n loaderTop: { ...loader, property: 'top' },\n loaderLeft: { ...loader, property: 'left' },\n loaderRight: { ...loader, property: 'right' },\n loaderMargin: { ...loader, property: 'margin' },\n loaderWidth: { ...loader, property: 'width' },\n loaderHeight: { ...loader, property: 'height' },\n loaderBorder: { ...loader, property: 'border' },\n loaderBorderColor: { ...loader, property: 'border-color' },\n loaderBorderRadius: { ...loader, property: 'border-radius' },\n contentHeight: { ...overlayContent, property: 'height' },\n contentOpacity: { ...overlayContent, property: 'opacity' },\n scrollerMinHeight: {\n selector: 'vaadin-combo-box-scroller',\n property: 'min-height',\n },\n },\n forward: {\n include: false,\n attributes: ['size'],\n },\n }),\n proxyInputMixin({\n proxyProps: ['selectionStart'],\n inputEvent: 'value-changed',\n }),\n inputOverrideValidConstraintsMixin,\n componentNameValidationMixin,\n ComboBoxMixin,\n)(\n createProxy({\n slots: ['', 'prefix'],\n wrappedEleName: 'vaadin-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(ComboBoxClass.cssVarList)}\n\t\t${resetInputReadonlyStyle('vaadin-combo-box')}\n\t\t${resetInputPlaceholder('vaadin-combo-box')}\n\t\t${resetInputCursor('vaadin-combo-box')}\n\n\t\tvaadin-combo-box {\n\t\t\tpadding: 0;\n\t\t\twidth: 100%;\n\t\t}\n\t\tvaadin-combo-box::before {\n\t\t\theight: initial;\n\t\t}\n\t\tvaadin-combo-box [slot=\"input\"] {\n\t\t\t-webkit-mask-image: none;\n\t\t\tmin-height: 0;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\n\t\tvaadin-combo-box::part(input-field) {\n\t\t\tpadding: 0;\n\t\t\tbox-shadow: none;\n\t\t}\n\n vaadin-combo-box::part(toggle-button),\n vaadin-combo-box::part(clear-button) {\n align-self: center;\n }\n\n vaadin-combo-box[hide-toggle-button=\"true\"]::part(toggle-button) {\n display: none;\n }\n\n vaadin-combo-box[label-type=\"floating\"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n vaadin-combo-box[label-type=\"floating\"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n\n ${resetInputLabelPosition('vaadin-combo-box')}\n ${inputFloatingLabelStyle()}\n\t\t`,\n // Note: we exclude `size` to avoid overriding Vaadin's ComboBox property\n // with the same name. Including it will cause Vaadin to calculate NaN size,\n // and reset items to an empty array, and opening the list box with no items\n // to display.\n excludeAttrsSync: ['tabindex', 'size', 'data', 'loading', 'style'],\n componentName,\n includeForwardProps: ['items', 'renderer', 'selectedItem'],\n }),\n);\n","import '@vaadin/combo-box';\nimport { componentName, ComboBoxClass } from './ComboBoxClass';\n\ncustomElements.define(componentName, ComboBoxClass);\n\nexport { ComboBoxClass, componentName };\n"],"names":["componentName","host","inputField","inputElement","placeholder","toggle","clearButton","label","requiredIndicator","helperText","errorMessage","loader","overlayContent","selector","ComboBoxClass","mappings","hostWidth","property","hostDirection","fontSize","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","labelPosition","labelTopPosition","labelHorizontalPosition","inputTransformY","inputTransition","marginInlineStart","placeholderOpacity","inputVerticalAlignment","valueInputHeight","valueInputMarginBottom","overlayBackground","cssVarList","overlay","backgroundColor","overlayTextColor","textColor","overlayBorder","border","overlayFontSize","overlayFontFamily","overlayCursor","cursor","overlayItemBoxShadow","itemBoxShadow","overlayItemPaddingInlineStart","itemPaddingInlineStart","overlayItemPaddingInlineEnd","itemPaddingInlineEnd","overlayCheckmarkDisplay","checkmarkDisplay","overlaySelectedItemBackground","selectedItemBackground","overlaySelectedItemHoverBackground","selectedItemHoverBackground","overlaySelectedItemFocusBackground","selectedItemFocusBackground","overlayItemHoverBackground","itemHoverBackground","overlayItemFocusBackground","itemFocusBackground","name","minHeight","margin","loaderTop","loaderLeft","loaderRight","loaderMargin","loaderWidth","loaderHeight","loaderBorder","loaderBorderColor","loaderBorderRadius","contentHeight","contentOpacity","scrollerMinHeight","forward","include","attributes","proxyProps","inputEvent","superclass","observedAttributes","displayName","value","defaultValue","this","getAttribute","renderItem","renderFn","renderItems","renderer","fn","baseElement","loading","val","setAttribute","removeAttribute","data","dataAttr","JSON","parse","isValidDataType","e","console","error","message","requireMatch","allowCustomValue","isValid","Array","isArray","getItemsTemplate","reduce","acc","item","template","innerHTML","hasDynamicData","shouldSelectItemOnItemsChange","handleSelectedItem","selectedItem","currentSelected","from","children","includes","setDefaultValue","customValueTransformFn","setComboBoxDescriptor","valueDescriptor","Object","getOwnPropertyDescriptor","constructor","prototype","comboBox","defineProperties","set","items","length","transformedValue","call","forEach","node","defineProperty","configurable","writable","setTimeout","shadowRoot","querySelector","_attachOverlay","bringToFront","_detachOverlay","_enterModalState","root","combo","model","outerHTML","_dataProviderFilterChanged","isValueMatch","some","dataset","id","init","super","getValidity","patternMismatch","isRequired","valueMissing","bind","includeAttrs","addEventListener","dispatchEvent","Event","bubbles","composed","CustomEvent","detail","onLabelClick","isReadOnly","isDisabled","focus","autoOpenDisabled","handleRequireMatchChange","shouldValidate","attributeChangedCallback","attrName","oldValue","newValue","removeEventListener","find","selectedChild","stopImmediatePropagation","once","capture","undefined","__data","slots","wrappedEleName","style","excludeAttrsSync","includeForwardProps","customElements","define","C"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"7092.js","mappings":"+MAyBO,MAAMA,GAAgB,QAAiB,cAk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ChtB/CC,eAAeC,OAAO,IAAe,EAAAC,E","sources":["webpack://@descope/web-components-ui/../components/descope-combo-box/src/component/ComboBoxClass.js","webpack://@descope/web-components-ui/../components/descope-combo-box/src/component/index.js"],"sourcesContent":["import { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n observeAttributes,\n observeChildren,\n forwardAttrs,\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 inputOverrideValidConstraintsMixin,\n portalMixin,\n proxyInputMixin,\n} from '@descope-ui/common/components-mixins';\n\nexport const componentName = getComponentName('combo-box');\n\nconst ComboBoxMixin = (superclass) =>\n class ComboBoxMixinClass extends superclass {\n static get observedAttributes() {\n return ['label-type', 'require-match'];\n }\n\n #renderItem = ({ displayName, value, label }) => {\n return `<span data-name=\"${label}\" data-id=\"${value}\">${\n displayName || label\n }</span>`;\n };\n\n #data;\n\n get defaultValue() {\n return this.getAttribute('default-value');\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 set renderer(fn) {\n // fn takes (root, comboBox, model) as arguments\n this.baseElement.renderer = fn;\n }\n\n get loading() {\n return this.getAttribute('loading') === 'true';\n }\n\n set loading(val) {\n if (val) {\n this.setAttribute('loading', 'true');\n } else {\n this.removeAttribute('loading');\n }\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 requireMatch() {\n return (\n this.getAttribute('require-match') === 'true' && !this.allowCustomValue\n );\n }\n\n isValidDataType(data) {\n const isValid = Array.isArray(data);\n if (!isValid) {\n console.error('data must be an array, received:', data);\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 if (this.#data || this.getAttribute('data')) {\n const template = this.getItemsTemplate();\n this.innerHTML = template;\n }\n }\n\n get hasDynamicData() {\n return this.getAttribute('has-dynamic-data') === 'true';\n }\n\n get shouldSelectItemOnItemsChange() {\n return !this.hasDynamicData || this.allowCustomValue;\n }\n\n handleSelectedItem() {\n const { selectedItem } = this.baseElement;\n const currentSelected = selectedItem?.['data-id'];\n\n // If the selected item is still a child, there's no need to update the value\n if (selectedItem && Array.from(this.children).includes(selectedItem)) {\n return;\n }\n\n // if previously selected item ID exists in current children, set it as selected\n if (currentSelected && this.shouldSelectItemOnItemsChange) {\n this.value = currentSelected;\n }\n\n // otherwise, if default value is specified, set default value as selected item\n if (!this.value) {\n this.setDefaultValue();\n }\n }\n\n customValueTransformFn(val) {\n return val;\n }\n\n // We want to override Vaadin's Combo Box value setter. This is needed since Vaadin couples between the\n // field that it searches the value, and the finaly display value of the input.\n // We provide a custom transform function to override that behavior.\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 if (\n !comboBox.baseElement.items?.length &&\n !comboBox.allowCustomValue\n ) {\n return;\n }\n\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 // vaadin api is to set props on their combo box node,\n // in order to avoid it, we are passing the children of this component\n // to the items & renderer props, so it will be used as the combo box items\n #onChildrenChange() {\n const items = Array.from(this.children);\n\n // we want the data-name attribute to be accessible as an object attribute\n items.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 = items;\n setTimeout(() => {\n // set timeout to ensure this runs after customValueTransformFn had the chance to be overriden\n this.handleSelectedItem();\n }, 0);\n }\n\n // the default vaadin behavior is to attach the overlay to the body when opened\n // we do not want that because it's difficult to style the overlay in this way\n // so we override it to open inside the shadow DOM\n #overrideOverlaySettings() {\n const overlay = this.baseElement.shadowRoot.querySelector(\n 'vaadin-combo-box-overlay',\n );\n overlay._attachOverlay = () => {\n overlay.bringToFront();\n };\n overlay._detachOverlay = () => {};\n overlay._enterModalState = () => {};\n }\n\n #overrideRenderer() {\n // use vaadin combobox custom renderer to render options as HTML\n // and not via default renderer, which renders only the data-name's value\n // in its own HTML template\n this.baseElement.renderer = (root, combo, model) => {\n root.innerHTML = model.item.outerHTML;\n };\n }\n\n #disableDataProviderFilterEventIfNeeded() {\n if (this.hasDynamicData) {\n // For the autocomplete field, we don't want to trigger the data provider filter changed event\n // because it changes the loading state on every keystroke, making the overlay open and close\n // on every keystroke, causing a flickering effect in the loading state.\n this.baseElement._dataProviderFilterChanged = () => {};\n }\n }\n\n isValueMatch() {\n const val = this.baseElement.querySelector('input').value;\n\n if (val) {\n return this.baseElement.items.some(\n (item) => item.dataset.name === val || item.dataset.id === val,\n );\n }\n\n return true;\n }\n\n init() {\n super.init?.();\n\n // Excluded from syncAttrs (bidirectional would let vaadin revert host\n // values). Push host → vaadin one-way so authored placeholder applies.\n forwardAttrs(this, this.baseElement, { includeAttrs: ['placeholder'] });\n\n this.getValidity = function () {\n if (this.requireMatch && !this.isValueMatch()) {\n return {\n patternMismatch: true,\n };\n }\n\n if (!this.value && this.isRequired) {\n return {\n valueMissing: true,\n };\n }\n\n return {};\n };\n\n this.#overrideRenderer();\n this.#disableDataProviderFilterEventIfNeeded();\n\n // This is a workaround for a problem we have in Console App, where in ScreenBuilder - the inputElement is not ready when trying to\n // set the component's descriptor and override the overlay settings.\n // THIS IS A PROBLEM WITH THE CONSOLE APP THAT NEEDS TO BE RESOLVED. Until then, we use this workaround.\n setTimeout(() => {\n this.setComboBoxDescriptor();\n this.#overrideOverlaySettings();\n });\n\n // Set up observers - order matters here since renderItems can clear innerHTML\n observeAttributes(this, this.renderItems.bind(this), {\n includeAttrs: ['data'],\n });\n observeChildren(this, this.#onChildrenChange.bind(this));\n\n this.setDefaultValue();\n\n // Using \"value-changed\" event instead of \"selected-item-changed\" event to avoid\n // the issue of the value not being updated in the input field when the user enter a custom value\n this.baseElement.addEventListener('value-changed', () => {\n this.dispatchEvent(\n new Event('input', { bubbles: true, composed: true }),\n );\n });\n\n this.baseElement.addEventListener('filter-changed', (e) => {\n this.dispatchEvent(\n new CustomEvent('filter-changed', {\n bubbles: true,\n composed: true,\n detail: e.detail,\n }),\n );\n });\n }\n\n onLabelClick() {\n if (this.isReadOnly || this.isDisabled) {\n return;\n }\n this.focus();\n if (!this.autoOpenDisabled) {\n this.setAttribute('opened', 'true');\n }\n }\n\n handleRequireMatchChange(shouldValidate) {\n this.baseElement.allowCustomValue =\n shouldValidate || this.allowCustomValue;\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue !== newValue) {\n if (attrName === 'label-type') {\n if (newValue === 'floating') {\n this.addEventListener('click', this.onLabelClick);\n } else {\n this.removeEventListener('click', this.onLabelClick);\n }\n } else if (attrName === 'require-match') {\n this.handleRequireMatchChange(newValue === 'true');\n }\n }\n }\n\n setDefaultValue() {\n if (this.defaultValue) {\n this.value = this.defaultValue;\n }\n }\n\n #getChildToSelect(val) {\n return this.baseElement.items?.find((item) => item['data-id'] === val);\n }\n\n #preventSelectedItemChangeEventIfNeeded(val, selectedChild) {\n // If the actual value didn't change, but the selected item did (the element changed),\n // we want to stop the event propagation since it's not a real change\n const shouldPreventItemChangeEvent =\n val === this.value && selectedChild !== this.baseElement.selectedItem;\n if (shouldPreventItemChangeEvent) {\n this.baseElement.addEventListener(\n 'selected-item-changed',\n (e) => {\n e.stopImmediatePropagation();\n },\n { once: true, capture: true },\n );\n }\n }\n\n set value(val) {\n const selectedChild = this.#getChildToSelect(val);\n this.#preventSelectedItemChangeEventIfNeeded(val, selectedChild);\n if (val && selectedChild) {\n this.baseElement.selectedItem = selectedChild;\n } else if (!selectedChild && this.allowCustomValue) {\n this.baseElement.value = val;\n } else {\n this.baseElement.selectedItem = undefined;\n }\n }\n\n get value() {\n return this.baseElement.selectedItem?.['data-id'] || this.allowCustomValue\n ? this.baseElement.__data.value || ''\n : '';\n }\n\n get allowCustomValue() {\n return this.getAttribute('allow-custom-value') === 'true';\n }\n\n get autoOpenDisabled() {\n return this.getAttribute('auto-open-disabled') === 'true';\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 loader,\n overlayContent,\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 loader: { selector: 'vaadin-combo-box-overlay::part(loader)' },\n overlayContent: { selector: 'vaadin-combo-box-overlay::part(content)' },\n};\n\nexport const ComboBoxClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n // we apply font-size also on the host so we can set its width with em\n fontSize: [{}, host],\n fontFamily: [label, placeholder, inputField, helperText, errorMessage],\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 { ...label, property: '-webkit-text-fill-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: '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 ],\n\n labelPosition: { ...label, property: 'position' },\n labelTopPosition: { ...label, property: 'top' },\n labelHorizontalPosition: [\n { ...label, property: 'left' },\n { ...label, property: 'right' },\n ],\n inputTransformY: { ...label, property: 'transform' },\n inputTransition: { ...label, property: 'transition' },\n marginInlineStart: { ...label, property: 'margin-inline-start' },\n placeholderOpacity: { ...placeholder, property: 'opacity' },\n inputVerticalAlignment: { ...inputField, property: 'align-items' },\n valueInputHeight: { ...inputElement, property: 'height' },\n valueInputMarginBottom: { ...inputElement, property: 'margin-bottom' },\n\n // we need to use the variables from the portal mixin\n // so we need to use an arrow function on the selector\n // for that to work, because ComboBox is not available\n // at this time.\n overlayBackground: {\n property: () => ComboBoxClass.cssVarList.overlay.backgroundColor,\n },\n overlayTextColor: {\n property: () => ComboBoxClass.cssVarList.overlay.textColor,\n },\n overlayBorder: {\n property: () => ComboBoxClass.cssVarList.overlay.border,\n },\n overlayFontSize: {\n property: () => ComboBoxClass.cssVarList.overlay.fontSize,\n },\n overlayFontFamily: {\n property: () => ComboBoxClass.cssVarList.overlay.fontFamily,\n },\n overlayCursor: {\n property: () => ComboBoxClass.cssVarList.overlay.cursor,\n },\n overlayItemBoxShadow: {\n property: () => ComboBoxClass.cssVarList.overlay.itemBoxShadow,\n },\n overlayItemPaddingInlineStart: {\n property: () => ComboBoxClass.cssVarList.overlay.itemPaddingInlineStart,\n },\n overlayItemPaddingInlineEnd: {\n property: () => ComboBoxClass.cssVarList.overlay.itemPaddingInlineEnd,\n },\n overlayCheckmarkDisplay: {\n property: () => ComboBoxClass.cssVarList.overlay.checkmarkDisplay,\n },\n overlaySelectedItemBackground: {\n property: () => ComboBoxClass.cssVarList.overlay.selectedItemBackground,\n },\n overlaySelectedItemHoverBackground: {\n property: () =>\n ComboBoxClass.cssVarList.overlay.selectedItemHoverBackground,\n },\n overlaySelectedItemFocusBackground: {\n property: () =>\n ComboBoxClass.cssVarList.overlay.selectedItemFocusBackground,\n },\n overlayItemHoverBackground: {\n property: () => ComboBoxClass.cssVarList.overlay.itemHoverBackground,\n },\n overlayItemFocusBackground: {\n property: () => ComboBoxClass.cssVarList.overlay.itemFocusBackground,\n },\n },\n }),\n draggableMixin,\n portalMixin({\n name: 'overlay',\n selector: '',\n mappings: {\n backgroundColor: [\n { selector: 'vaadin-combo-box-scroller' },\n { selector: 'vaadin-combo-box-overlay::part(overlay)' },\n ],\n minHeight: { selector: 'vaadin-combo-box-overlay' },\n margin: { selector: 'vaadin-combo-box-overlay' },\n cursor: { selector: 'vaadin-combo-box-item' },\n fontFamily: { selector: 'vaadin-combo-box-item' },\n textColor: { selector: 'vaadin-combo-box-item', property: 'color' },\n fontSize: { selector: 'vaadin-combo-box-item' },\n itemBoxShadow: {\n selector: 'vaadin-combo-box-item',\n property: 'box-shadow',\n },\n itemPaddingInlineStart: {\n selector: 'vaadin-combo-box-item',\n property: 'padding-inline-start',\n },\n itemPaddingInlineEnd: {\n selector: 'vaadin-combo-box-item',\n property: 'padding-inline-end',\n },\n checkmarkDisplay: {\n selector: 'vaadin-combo-box-item::part(checkmark)',\n property: 'display',\n },\n selectedItemBackground: {\n selector: 'vaadin-combo-box-item[selected]',\n property: 'background-color',\n },\n selectedItemHoverBackground: {\n selector: 'vaadin-combo-box-item[selected]:hover:not([disabled])',\n property: 'background-color',\n },\n selectedItemFocusBackground: {\n selector: 'vaadin-combo-box-item[selected][focused]:not([disabled])',\n property: 'background-color',\n },\n itemHoverBackground: {\n selector: 'vaadin-combo-box-item:hover:not([selected]):not([disabled])',\n property: 'background-color',\n },\n itemFocusBackground: {\n selector:\n 'vaadin-combo-box-item[focused]:not([selected]):not([disabled])',\n property: 'background-color',\n },\n\n loaderTop: { ...loader, property: 'top' },\n loaderLeft: { ...loader, property: 'left' },\n loaderRight: { ...loader, property: 'right' },\n loaderMargin: { ...loader, property: 'margin' },\n loaderWidth: { ...loader, property: 'width' },\n loaderHeight: { ...loader, property: 'height' },\n loaderBorder: { ...loader, property: 'border' },\n loaderBorderColor: { ...loader, property: 'border-color' },\n loaderBorderRadius: { ...loader, property: 'border-radius' },\n contentHeight: { ...overlayContent, property: 'height' },\n contentOpacity: { ...overlayContent, property: 'opacity' },\n scrollerMinHeight: {\n selector: 'vaadin-combo-box-scroller',\n property: 'min-height',\n },\n },\n forward: {\n include: false,\n attributes: ['size'],\n },\n }),\n proxyInputMixin({\n proxyProps: ['selectionStart'],\n inputEvent: 'value-changed',\n }),\n inputOverrideValidConstraintsMixin,\n componentNameValidationMixin,\n ComboBoxMixin,\n)(\n createProxy({\n slots: ['', 'prefix'],\n wrappedEleName: 'vaadin-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(ComboBoxClass.cssVarList)}\n\t\t${resetInputReadonlyStyle('vaadin-combo-box')}\n\t\t${resetInputPlaceholder('vaadin-combo-box')}\n\t\t${resetInputCursor('vaadin-combo-box')}\n\n\t\tvaadin-combo-box {\n\t\t\tpadding: 0;\n\t\t\twidth: 100%;\n\t\t}\n\t\tvaadin-combo-box::before {\n\t\t\theight: initial;\n\t\t}\n\t\tvaadin-combo-box [slot=\"input\"] {\n\t\t\t-webkit-mask-image: none;\n\t\t\tmin-height: 0;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\n\t\tvaadin-combo-box::part(input-field) {\n\t\t\tpadding: 0;\n\t\t\tbox-shadow: none;\n\t\t}\n\n vaadin-combo-box::part(toggle-button),\n vaadin-combo-box::part(clear-button) {\n align-self: center;\n }\n\n vaadin-combo-box[hide-toggle-button=\"true\"]::part(toggle-button) {\n display: none;\n }\n\n vaadin-combo-box[label-type=\"floating\"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n vaadin-combo-box[label-type=\"floating\"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n\n ${resetInputLabelPosition('vaadin-combo-box')}\n ${inputFloatingLabelStyle()}\n\t\t`,\n // Note: we exclude `size` to avoid overriding Vaadin's ComboBox property\n // with the same name. Including it will cause Vaadin to calculate NaN size,\n // and reset items to an empty array, and opening the list box with no items\n // to display.\n excludeAttrsSync: [\n 'tabindex',\n 'size',\n 'placeholder',\n 'data',\n 'loading',\n 'style',\n ],\n componentName,\n includeForwardProps: ['items', 'renderer', 'selectedItem'],\n }),\n);\n","import '@vaadin/combo-box';\nimport { componentName, ComboBoxClass } from './ComboBoxClass';\n\ncustomElements.define(componentName, ComboBoxClass);\n\nexport { ComboBoxClass, componentName };\n"],"names":["componentName","host","inputField","inputElement","placeholder","toggle","clearButton","label","requiredIndicator","helperText","errorMessage","loader","overlayContent","selector","ComboBoxClass","mappings","hostWidth","property","hostDirection","fontSize","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","labelPosition","labelTopPosition","labelHorizontalPosition","inputTransformY","inputTransition","marginInlineStart","placeholderOpacity","inputVerticalAlignment","valueInputHeight","valueInputMarginBottom","overlayBackground","cssVarList","overlay","backgroundColor","overlayTextColor","textColor","overlayBorder","border","overlayFontSize","overlayFontFamily","overlayCursor","cursor","overlayItemBoxShadow","itemBoxShadow","overlayItemPaddingInlineStart","itemPaddingInlineStart","overlayItemPaddingInlineEnd","itemPaddingInlineEnd","overlayCheckmarkDisplay","checkmarkDisplay","overlaySelectedItemBackground","selectedItemBackground","overlaySelectedItemHoverBackground","selectedItemHoverBackground","overlaySelectedItemFocusBackground","selectedItemFocusBackground","overlayItemHoverBackground","itemHoverBackground","overlayItemFocusBackground","itemFocusBackground","name","minHeight","margin","loaderTop","loaderLeft","loaderRight","loaderMargin","loaderWidth","loaderHeight","loaderBorder","loaderBorderColor","loaderBorderRadius","contentHeight","contentOpacity","scrollerMinHeight","forward","include","attributes","proxyProps","inputEvent","superclass","observedAttributes","displayName","value","defaultValue","this","getAttribute","renderItem","renderFn","renderItems","renderer","fn","baseElement","loading","val","setAttribute","removeAttribute","data","dataAttr","JSON","parse","isValidDataType","e","console","error","message","requireMatch","allowCustomValue","isValid","Array","isArray","getItemsTemplate","reduce","acc","item","template","innerHTML","hasDynamicData","shouldSelectItemOnItemsChange","handleSelectedItem","selectedItem","currentSelected","from","children","includes","setDefaultValue","customValueTransformFn","setComboBoxDescriptor","valueDescriptor","Object","getOwnPropertyDescriptor","constructor","prototype","comboBox","defineProperties","set","items","length","transformedValue","call","forEach","node","defineProperty","configurable","writable","setTimeout","shadowRoot","querySelector","_attachOverlay","bringToFront","_detachOverlay","_enterModalState","root","combo","model","outerHTML","_dataProviderFilterChanged","isValueMatch","some","dataset","id","init","super","includeAttrs","getValidity","patternMismatch","isRequired","valueMissing","bind","addEventListener","dispatchEvent","Event","bubbles","composed","CustomEvent","detail","onLabelClick","isReadOnly","isDisabled","focus","autoOpenDisabled","handleRequireMatchChange","shouldValidate","attributeChangedCallback","attrName","oldValue","newValue","removeEventListener","find","selectedChild","stopImmediatePropagation","once","capture","undefined","__data","slots","wrappedEleName","style","excludeAttrsSync","includeForwardProps","customElements","define","C"],"sourceRoot":""}
|
package/dist/umd/7939.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! For license information please see 7939.js.LICENSE.txt */
|
|
2
|
-
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[7939],{10438(t,e,a){a.d(e,{U:()=>r});var i=a(98741);const n=new ResizeObserver(t=>{setTimeout(()=>{t.forEach(t=>{t.target.resizables?t.target.resizables.forEach(e=>{e._onResize(t.contentRect)}):t.target._onResize(t.contentRect)})})}),r=(0,i.y)(t=>class extends t{get _observeParent(){return!1}connectedCallback(){if(super.connectedCallback(),n.observe(this),this._observeParent){const t=this.parentNode instanceof ShadowRoot?this.parentNode.host:this.parentNode;t.resizables||(t.resizables=new Set,n.observe(t)),t.resizables.add(this),this.__parent=t}}disconnectedCallback(){super.disconnectedCallback(),n.unobserve(this);const t=this.__parent;if(this._observeParent&&t){const e=t.resizables;e&&(e.delete(this),0===e.size&&n.unobserve(t)),this.__parent=null}}_onResize(t){}})},37436(t,e,a){a.d(e,{a:()=>n});var i=a(44218);const n=t=>class extends((0,i.R)(t)){static get properties(){return{autocomplete:{type:String},autocorrect:{type:String},autocapitalize:{type:String,reflectToAttribute:!0}}}static get delegateAttrs(){return[...super.delegateAttrs,"autocapitalize","autocomplete","autocorrect"]}get __data(){return this.__dataValue||{}}set __data(t){this.__dataValue=t}_inputElementChanged(t){super._inputElementChanged(t),t&&(t.value&&t.value!==this.value&&(console.warn(`Please define value on the <${this.localName}> component!`),t.value=""),this.value&&(t.value=this.value))}_setFocused(t){super._setFocused(t),!t&&document.hasFocus()&&this.validate()}_onInput(t){super._onInput(t),this.invalid&&this.validate()}_valueChanged(t,e){super._valueChanged(t,e),void 0!==e&&this.invalid&&this.validate()}}},27939(t,e,a){a(27397),a(64511),a(42068),a(83315);var i=a(47642),n=a(87550);const r=n.AH`
|
|
2
|
+
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[7939,9054],{10438(t,e,a){a.d(e,{U:()=>r});var i=a(98741);const n=new ResizeObserver(t=>{setTimeout(()=>{t.forEach(t=>{t.target.resizables?t.target.resizables.forEach(e=>{e._onResize(t.contentRect)}):t.target._onResize(t.contentRect)})})}),r=(0,i.y)(t=>class extends t{get _observeParent(){return!1}connectedCallback(){if(super.connectedCallback(),n.observe(this),this._observeParent){const t=this.parentNode instanceof ShadowRoot?this.parentNode.host:this.parentNode;t.resizables||(t.resizables=new Set,n.observe(t)),t.resizables.add(this),this.__parent=t}}disconnectedCallback(){super.disconnectedCallback(),n.unobserve(this);const t=this.__parent;if(this._observeParent&&t){const e=t.resizables;e&&(e.delete(this),0===e.size&&n.unobserve(t)),this.__parent=null}}_onResize(t){}})},37436(t,e,a){a.d(e,{a:()=>n});var i=a(44218);const n=t=>class extends((0,i.R)(t)){static get properties(){return{autocomplete:{type:String},autocorrect:{type:String},autocapitalize:{type:String,reflectToAttribute:!0}}}static get delegateAttrs(){return[...super.delegateAttrs,"autocapitalize","autocomplete","autocorrect"]}get __data(){return this.__dataValue||{}}set __data(t){this.__dataValue=t}_inputElementChanged(t){super._inputElementChanged(t),t&&(t.value&&t.value!==this.value&&(console.warn(`Please define value on the <${this.localName}> component!`),t.value=""),this.value&&(t.value=this.value))}_setFocused(t){super._setFocused(t),!t&&document.hasFocus()&&this.validate()}_onInput(t){super._onInput(t),this.invalid&&this.validate()}_valueChanged(t,e){super._valueChanged(t,e),void 0!==e&&this.invalid&&this.validate()}}},27939(t,e,a){a(27397),a(64511),a(42068),a(83315);var i=a(47642),n=a(87550);const r=n.AH`
|
|
3
3
|
[part='input-field'],
|
|
4
4
|
[part='input-field'] ::slotted(textarea) {
|
|
5
5
|
height: auto;
|
package/dist/umd/7939.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"7939.js","mappings":";sKAOA,MAAMA,EAAW,IAAIC,eAAgBC,IACnCC,WAAW,KACTD,EAAQE,QAASC,IAEXA,EAAMC,OAAOC,WACfF,EAAMC,OAAOC,WAAWH,QAASI,IAC/BA,EAAUC,UAAUJ,EAAMK,eAG5BL,EAAMC,OAAOG,UAAUJ,EAAMK,mBAWxBC,GAAc,OACxBC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kBF,EAEvB,MAAMU,EAAc7E,EAAM8E,aACtBD,EAAc7E,EAAM+E,eACtB/E,EAAM4D,MAAMY,OAAS,GAAGK,OAI1B7E,EAAM4D,MAAMoB,eAAe,aAC3Bd,EAAWN,MAAMoB,eAAe,WAChCd,EAAWN,MAAMoB,eAAe,UAChCd,EAAWT,UAAYA,CACzB,CAOA,aAAAwB,GACE,IAAK7G,MAAM6G,gBACT,OAAO,EAOT,IAAK3G,KAAK4D,UAAY5D,KAAK0E,aAAalD,MAEtC,OAAO,EAGT,IACE,MAAMoF,EAAQ5G,KAAK0E,aAAalD,MAAMoF,MAAM5G,KAAK4D,SACjD,QAAOgD,GAAQA,EAAM,KAAOA,EAAMlF,KACpC,CAAE,MAAOmF,GAEP,OAAO,CACT,CACF,GCvMSC,E,SAAiB,EAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GCQjC,QAAe,mBAAoB,CAAC,IAAkBA,GAAiB,CAAEnE,SAAU,4BAgD5E,MAAMoE,UAAiBxD,GAAc,SAAc,OAAa,SACrE,aAAWyD,GACT,MAAO,kBACT,CAEA,mBAAWC,GACT,OAAO,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgCb,CAGA,KAAA7C,GACEtE,MAAMsE,QAENpE,KAAKkH,mBAAqB,IAAI,IAAkBlH,MAChDA,KAAKkH,mBAAmBC,YAAY,OACpCnH,KAAKkH,mBAAmBE,cAAcpH,KAAK0E,cAC3C1E,KAAKqE,cAAcrE,KAAKkH,mBAC1B,GAGF,OAAoBH,E","sources":["webpack://@descope/web-components-ui/../../../node_modules/@vaadin/component-base/src/resize-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/field-base/src/input-field-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/text-area/theme/lumo/vaadin-text-area-styles.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/field-base/src/text-area-controller.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/text-area/src/vaadin-text-area-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/text-area/src/vaadin-text-area-styles.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/text-area/src/vaadin-text-area.js"],"sourcesContent":["/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { dedupingMixin } from '@polymer/polymer/lib/utils/mixin.js';\n\nconst observer = new ResizeObserver((entries) => {\n setTimeout(() => {\n entries.forEach((entry) => {\n // Notify child resizables, if any\n if (entry.target.resizables) {\n entry.target.resizables.forEach((resizable) => {\n resizable._onResize(entry.contentRect);\n });\n } else {\n entry.target._onResize(entry.contentRect);\n }\n });\n });\n});\n\n/**\n * A mixin that uses a ResizeObserver to listen to host size changes.\n *\n * @polymerMixin\n */\nexport const ResizeMixin = dedupingMixin(\n (superclass) =>\n class ResizeMixinClass extends superclass {\n /**\n * When true, the parent element resize will be also observed.\n * Override this getter and return `true` to enable this.\n *\n * @protected\n */\n get _observeParent() {\n return false;\n }\n\n /** @protected */\n connectedCallback() {\n super.connectedCallback();\n observer.observe(this);\n\n if (this._observeParent) {\n const parent = this.parentNode instanceof ShadowRoot ? this.parentNode.host : this.parentNode;\n\n if (!parent.resizables) {\n parent.resizables = new Set();\n observer.observe(parent);\n }\n\n parent.resizables.add(this);\n this.__parent = parent;\n }\n }\n\n /** @protected */\n disconnectedCallback() {\n super.disconnectedCallback();\n observer.unobserve(this);\n\n const parent = this.__parent;\n if (this._observeParent && parent) {\n const resizables = parent.resizables;\n\n if (resizables) {\n resizables.delete(this);\n\n if (resizables.size === 0) {\n observer.unobserve(parent);\n }\n }\n\n this.__parent = null;\n }\n }\n\n /**\n * A handler invoked on host resize. By default, it does nothing.\n * Override the method to implement your own behavior.\n *\n * @protected\n */\n _onResize(_contentRect) {\n // To be implemented.\n }\n },\n);\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { InputControlMixin } from './input-control-mixin.js';\n\n/**\n * A mixin to provide logic for vaadin-text-field and related components.\n *\n * @polymerMixin\n * @mixes InputControlMixin\n */\nexport const InputFieldMixin = (superclass) =>\n class InputFieldMixinClass extends InputControlMixin(superclass) {\n static get properties() {\n return {\n /**\n * Whether the value of the control can be automatically completed by the browser.\n * List of available options at:\n * https://developer.mozilla.org/en/docs/Web/HTML/Element/input#attr-autocomplete\n */\n autocomplete: {\n type: String,\n },\n\n /**\n * This is a property supported by Safari that is used to control whether\n * autocorrection should be enabled when the user is entering/editing the text.\n * Possible values are:\n * on: Enable autocorrection.\n * off: Disable autocorrection.\n */\n autocorrect: {\n type: String,\n },\n\n /**\n * This is a property supported by Safari and Chrome that is used to control whether\n * autocapitalization should be enabled when the user is entering/editing the text.\n * Possible values are:\n * characters: Characters capitalization.\n * words: Words capitalization.\n * sentences: Sentences capitalization.\n * none: No capitalization.\n */\n autocapitalize: {\n type: String,\n reflectToAttribute: true,\n },\n };\n }\n\n static get delegateAttrs() {\n return [...super.delegateAttrs, 'autocapitalize', 'autocomplete', 'autocorrect'];\n }\n\n // Workaround for https://github.com/Polymer/polymer/issues/5259\n get __data() {\n return this.__dataValue || {};\n }\n\n set __data(value) {\n this.__dataValue = value;\n }\n\n /**\n * @param {HTMLElement} input\n * @protected\n * @override\n */\n _inputElementChanged(input) {\n super._inputElementChanged(input);\n\n if (input) {\n // Discard value set on the custom slotted input.\n if (input.value && input.value !== this.value) {\n console.warn(`Please define value on the <${this.localName}> component!`);\n input.value = '';\n }\n\n if (this.value) {\n input.value = this.value;\n }\n }\n }\n\n /**\n * Override an event listener from `FocusMixin`.\n * @param {boolean} focused\n * @protected\n * @override\n */\n _setFocused(focused) {\n super._setFocused(focused);\n\n // Do not validate when focusout is caused by document\n // losing focus, which happens on browser tab switch.\n if (!focused && document.hasFocus()) {\n this.validate();\n }\n }\n\n /**\n * Override an event listener from `InputMixin`\n * to mark as valid after user started typing.\n * @param {Event} event\n * @protected\n * @override\n */\n _onInput(event) {\n super._onInput(event);\n\n if (this.invalid) {\n this.validate();\n }\n }\n\n /**\n * Override an observer from `InputMixin` to validate the field\n * when a new value is set programmatically.\n *\n * @param {string | undefined} newValue\n * @param {string | undefined} oldValue\n * @protected\n * @override\n */\n _valueChanged(newValue, oldValue) {\n super._valueChanged(newValue, oldValue);\n\n if (oldValue === undefined) {\n return;\n }\n\n if (this.invalid) {\n this.validate();\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 '@vaadin/input-container/theme/lumo/vaadin-input-container-styles.js';\nimport '@vaadin/vaadin-lumo-styles/color.js';\nimport '@vaadin/vaadin-lumo-styles/sizing.js';\nimport '@vaadin/vaadin-lumo-styles/typography.js';\nimport { inputFieldShared } from '@vaadin/vaadin-lumo-styles/mixins/input-field-shared.js';\nimport { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';\n\nconst textArea = css`\n [part='input-field'],\n [part='input-field'] ::slotted(textarea) {\n height: auto;\n box-sizing: border-box;\n }\n\n [part='input-field'] {\n /* Equal to the implicit padding in vaadin-text-field */\n padding-top: calc((var(--lumo-text-field-size) - 1em * var(--lumo-line-height-s)) / 2);\n padding-bottom: calc((var(--lumo-text-field-size) - 1em * var(--lumo-line-height-s)) / 2);\n transition: background-color 0.1s;\n line-height: var(--lumo-line-height-s);\n }\n\n :host(:not([readonly])) [part='input-field']::after {\n display: none;\n }\n\n :host([readonly]) [part='input-field'] {\n border: 1px dashed var(--lumo-contrast-30pct);\n }\n\n :host([readonly]) [part='input-field']::after {\n border: none;\n }\n\n :host(:hover:not([readonly]):not([focused]):not([invalid])) [part='input-field'] {\n background-color: var(--lumo-contrast-20pct);\n }\n\n @media (pointer: coarse) {\n :host(:hover:not([readonly]):not([focused]):not([invalid])) [part='input-field'] {\n background-color: var(--lumo-contrast-10pct);\n }\n\n :host(:active:not([readonly]):not([focused])) [part='input-field'] {\n background-color: var(--lumo-contrast-20pct);\n }\n }\n\n [part='input-field'] ::slotted(textarea) {\n line-height: inherit;\n --_lumo-text-field-overflow-mask-image: none;\n }\n\n /* Vertically align icon prefix/suffix with the first line of text */\n [part='input-field'] ::slotted(vaadin-icon) {\n margin-top: calc((var(--lumo-icon-size-m) - 1em * var(--lumo-line-height-s)) / -2);\n }\n`;\n\nregisterStyles('vaadin-text-area', [inputFieldShared, textArea], {\n moduleId: 'lumo-text-area',\n});\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { SlotController } from '@vaadin/component-base/src/slot-controller.js';\n\n/**\n * A controller to create and initialize slotted `<textarea>` element.\n */\nexport class TextAreaController extends SlotController {\n constructor(host, callback) {\n super(host, 'textarea', 'textarea', {\n initializer: (node, host) => {\n const value = host.getAttribute('value');\n if (value) {\n node.value = value;\n }\n\n const name = host.getAttribute('name');\n if (name) {\n node.setAttribute('name', name);\n }\n\n node.id = this.defaultId;\n\n if (typeof callback === 'function') {\n callback(node);\n }\n },\n useUniqueId: true,\n });\n }\n}\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { ResizeMixin } from '@vaadin/component-base/src/resize-mixin.js';\nimport { InputFieldMixin } from '@vaadin/field-base/src/input-field-mixin.js';\nimport { LabelledInputController } from '@vaadin/field-base/src/labelled-input-controller.js';\nimport { TextAreaController } from '@vaadin/field-base/src/text-area-controller.js';\n\n/**\n * A mixin providing common text area functionality.\n *\n * @polymerMixin\n * @mixes InputFieldMixin\n * @mixes ResizeMixin\n */\nexport const TextAreaMixin = (superClass) =>\n class TextAreaMixinClass extends ResizeMixin(InputFieldMixin(superClass)) {\n static get properties() {\n return {\n /**\n * Maximum number of characters (in Unicode code points) that the user can enter.\n */\n maxlength: {\n type: Number,\n },\n\n /**\n * Minimum number of characters (in Unicode code points) that the user can enter.\n */\n minlength: {\n type: Number,\n },\n\n /**\n * A regular expression that the value is checked against.\n * The pattern must match the entire value, not just some subset.\n */\n pattern: {\n type: String,\n },\n };\n }\n\n static get delegateAttrs() {\n return [...super.delegateAttrs, 'maxlength', 'minlength', 'pattern'];\n }\n\n static get constraints() {\n return [...super.constraints, 'maxlength', 'minlength', 'pattern'];\n }\n\n /**\n * Used by `InputControlMixin` as a reference to the clear button element.\n * @protected\n */\n get clearElement() {\n return this.$.clearButton;\n }\n\n /**\n * @protected\n * @override\n */\n _onResize() {\n this._updateHeight();\n this.__scrollPositionUpdated();\n }\n\n /** @protected */\n _onScroll() {\n this.__scrollPositionUpdated();\n }\n\n /** @protected */\n ready() {\n super.ready();\n\n this.addController(\n new TextAreaController(this, (input) => {\n this._setInputElement(input);\n this._setFocusElement(input);\n this.stateTarget = input;\n this.ariaTarget = input;\n }),\n );\n this.addController(new LabelledInputController(this.inputElement, this._labelController));\n\n this.addEventListener('animationend', this._onAnimationEnd);\n\n this._inputField = this.shadowRoot.querySelector('[part=input-field]');\n\n // Wheel scrolling results in async scroll events. Preventing the wheel\n // event, scrolling manually and then synchronously updating the scroll position CSS variable\n // allows us to avoid some jumpy behavior that would occur on wheel otherwise.\n this._inputField.addEventListener('wheel', (e) => {\n const scrollTopBefore = this._inputField.scrollTop;\n this._inputField.scrollTop += e.deltaY;\n\n if (scrollTopBefore !== this._inputField.scrollTop) {\n e.preventDefault();\n this.__scrollPositionUpdated();\n }\n });\n\n this._updateHeight();\n this.__scrollPositionUpdated();\n }\n\n /** @private */\n __scrollPositionUpdated() {\n this._inputField.style.setProperty('--_text-area-vertical-scroll-position', '0px');\n this._inputField.style.setProperty('--_text-area-vertical-scroll-position', `${this._inputField.scrollTop}px`);\n }\n\n /** @private */\n _onAnimationEnd(e) {\n if (e.animationName.indexOf('vaadin-text-area-appear') === 0) {\n this._updateHeight();\n }\n }\n\n /**\n * @param {unknown} newVal\n * @param {unknown} oldVal\n * @protected\n * @override\n */\n _valueChanged(newVal, oldVal) {\n super._valueChanged(newVal, oldVal);\n\n this._updateHeight();\n }\n\n /** @private */\n _updateHeight() {\n const input = this.inputElement;\n const inputField = this._inputField;\n\n if (!input || !inputField) {\n return;\n }\n\n const scrollTop = inputField.scrollTop;\n\n // Only clear the height when the content shortens to minimize scrollbar flickering.\n const valueLength = this.value ? this.value.length : 0;\n\n if (this._oldValueLength >= valueLength) {\n const inputFieldHeight = getComputedStyle(inputField).height;\n const inputWidth = getComputedStyle(input).width;\n\n // Temporarily fix the height of the wrapping input field container to prevent changing the browsers scroll\n // position while resetting the textareas height. If the textarea had a large height, then removing its height\n // will reset its height to the default of two rows. That might reduce the height of the page, and the\n // browser might adjust the scroll position before we can restore the measured height of the textarea.\n inputField.style.display = 'block';\n inputField.style.height = inputFieldHeight;\n\n // Fix the input element width so its scroll height isn't affected by host's disappearing scrollbars\n input.style.maxWidth = inputWidth;\n\n // Clear the height of the textarea to allow measuring a reduced scroll height\n input.style.height = 'auto';\n }\n this._oldValueLength = valueLength;\n\n const inputHeight = input.scrollHeight;\n if (inputHeight > input.clientHeight) {\n input.style.height = `${inputHeight}px`;\n }\n\n // Restore\n input.style.removeProperty('max-width');\n inputField.style.removeProperty('display');\n inputField.style.removeProperty('height');\n inputField.scrollTop = scrollTop;\n }\n\n /**\n * Returns true if the current textarea value satisfies all constraints (if any).\n * @return {boolean}\n * @override\n */\n checkValidity() {\n if (!super.checkValidity()) {\n return false;\n }\n\n // Native <textarea> does not support pattern attribute, so we have a custom logic\n // according to WHATWG spec for <input>, with tests inspired by web-platform-tests\n // https://html.spec.whatwg.org/multipage/input.html#the-pattern-attribute\n\n if (!this.pattern || !this.inputElement.value) {\n // Mark as valid if there is no pattern, or the value is empty\n return true;\n }\n\n try {\n const match = this.inputElement.value.match(this.pattern);\n return match ? match[0] === match.input : false;\n } catch (_) {\n // If the pattern can not be compiled, then report as valid\n return true;\n }\n }\n };\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { css } from 'lit';\n\nexport const textAreaStyles = css`\n :host {\n animation: 1ms vaadin-text-area-appear;\n }\n\n .vaadin-text-area-container {\n flex: auto;\n }\n\n /* The label, helper text and the error message should neither grow nor shrink. */\n [part='label'],\n [part='helper-text'],\n [part='error-message'] {\n flex: none;\n }\n\n [part='input-field'] {\n flex: auto;\n overflow: auto;\n -webkit-overflow-scrolling: touch;\n }\n\n ::slotted(textarea) {\n -webkit-appearance: none;\n -moz-appearance: none;\n flex: auto;\n overflow: hidden;\n width: 100%;\n height: 100%;\n outline: none;\n resize: none;\n margin: 0;\n padding: 0 0.25em;\n border: 0;\n border-radius: 0;\n min-width: 0;\n font: inherit;\n font-size: 1em;\n line-height: normal;\n color: inherit;\n background-color: transparent;\n /* Disable default invalid style in Firefox */\n box-shadow: none;\n }\n\n /* Override styles from <vaadin-input-container> */\n [part='input-field'] ::slotted(textarea) {\n align-self: stretch;\n white-space: pre-wrap;\n }\n\n [part='input-field'] ::slotted(:not(textarea)) {\n align-self: flex-start;\n }\n\n /* Workaround https://bugzilla.mozilla.org/show_bug.cgi?id=1739079 */\n :host([disabled]) ::slotted(textarea) {\n user-select: none;\n }\n\n @keyframes vaadin-text-area-appear {\n to {\n opacity: 1;\n }\n }\n`;\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport '@vaadin/input-container/src/vaadin-input-container.js';\nimport { html, PolymerElement } from '@polymer/polymer';\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 { inputFieldShared } from '@vaadin/field-base/src/styles/input-field-shared-styles.js';\nimport { registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';\nimport { TextAreaMixin } from './vaadin-text-area-mixin.js';\nimport { textAreaStyles } from './vaadin-text-area-styles.js';\n\nregisterStyles('vaadin-text-area', [inputFieldShared, textAreaStyles], { moduleId: 'vaadin-text-area-styles' });\n\n/**\n * `<vaadin-text-area>` is a web component for multi-line text input.\n *\n * ```html\n * <vaadin-text-area label=\"Comment\"></vaadin-text-area>\n * ```\n *\n * ### Prefixes and suffixes\n *\n * These are child elements of a `<vaadin-text-area>` that are displayed\n * inline with the input, before or after.\n * In order for an element to be considered as a prefix, it must have the slot\n * attribute set to `prefix` (and similarly for `suffix`).\n *\n * ```html\n * <vaadin-text-area label=\"Description\">\n * <div slot=\"prefix\">Details:</div>\n * <div slot=\"suffix\">The end!</div>\n * </vaadin-text-area>\n * ```\n *\n * ### Styling\n *\n * The following custom properties are available for styling:\n *\n * Custom property | Description | Default\n * -------------------------------|----------------------------|---------\n * `--vaadin-field-default-width` | Default width of the field | `12em`\n *\n * `<vaadin-text-area>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\n * See [`<vaadin-text-field>`](#/elements/vaadin-text-field) for the styling documentation.\n *\n * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n *\n * @fires {Event} input - Fired when the value is changed by the user: on every typing keystroke, and the value is cleared using the clear button.\n * @fires {Event} change - Fired when the user commits a value change.\n * @fires {CustomEvent} invalid-changed - Fired when the `invalid` property changes.\n * @fires {CustomEvent} value-changed - Fired when the `value` property changes.\n * @fires {CustomEvent} validated - Fired whenever the field is validated.\n *\n * @customElement\n * @extends HTMLElement\n * @mixes ElementMixin\n * @mixes TextAreaMixin\n * @mixes ThemableMixin\n */\nexport class TextArea extends TextAreaMixin(ThemableMixin(ElementMixin(PolymerElement))) {\n static get is() {\n return 'vaadin-text-area';\n }\n\n static get template() {\n return html`\n <div class=\"vaadin-text-area-container\">\n <div part=\"label\">\n <slot name=\"label\"></slot>\n <span part=\"required-indicator\" aria-hidden=\"true\"></span>\n </div>\n\n <vaadin-input-container\n part=\"input-field\"\n readonly=\"[[readonly]]\"\n disabled=\"[[disabled]]\"\n invalid=\"[[invalid]]\"\n theme$=\"[[_theme]]\"\n on-scroll=\"_onScroll\"\n >\n <slot name=\"prefix\" slot=\"prefix\"></slot>\n <slot name=\"textarea\"></slot>\n <slot name=\"suffix\" slot=\"suffix\"></slot>\n <div id=\"clearButton\" part=\"clear-button\" slot=\"suffix\" aria-hidden=\"true\"></div>\n </vaadin-input-container>\n\n <div part=\"helper-text\">\n <slot name=\"helper\"></slot>\n </div>\n\n <div part=\"error-message\">\n <slot name=\"error-message\"></slot>\n </div>\n </div>\n\n <slot name=\"tooltip\"></slot>\n `;\n }\n\n /** @protected */\n ready() {\n super.ready();\n\n this._tooltipController = new TooltipController(this);\n this._tooltipController.setPosition('top');\n this._tooltipController.setAriaTarget(this.inputElement);\n this.addController(this._tooltipController);\n }\n}\n\ndefineCustomElement(TextArea);\n"],"names":["observer","ResizeObserver","entries","setTimeout","forEach","entry","target","resizables","resizable","_onResize","contentRect","ResizeMixin","superclass","_observeParent","connectedCallback","super","observe","this","parent","parentNode","ShadowRoot","host","Set","add","__parent","disconnectedCallback","unobserve","delete","size","_contentRect","InputFieldMixin","properties","autocomplete","type","String","autocorrect","autocapitalize","reflectToAttribute","delegateAttrs","__data","__dataValue","value","_inputElementChanged","input","console","warn","localName","_setFocused","focused","document","hasFocus","validate","_onInput","event","invalid","_valueChanged","newValue","oldValue","undefined","textArea","moduleId","TextAreaController","constructor","callback","initializer","node","getAttribute","name","setAttribute","id","defaultId","useUniqueId","TextAreaMixin","superClass","maxlength","Number","minlength","pattern","constraints","clearElement","$","clearButton","_updateHeight","__scrollPositionUpdated","_onScroll","ready","addController","_setInputElement","_setFocusElement","stateTarget","ariaTarget","inputElement","_labelController","addEventListener","_onAnimationEnd","_inputField","shadowRoot","querySelector","e","scrollTopBefore","scrollTop","deltaY","preventDefault","style","setProperty","animationName","indexOf","newVal","oldVal","inputField","valueLength","length","_oldValueLength","inputFieldHeight","getComputedStyle","height","inputWidth","width","display","maxWidth","inputHeight","scrollHeight","clientHeight","removeProperty","checkValidity","match","_","textAreaStyles","TextArea","is","template","_tooltipController","setPosition","setAriaTarget"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"7939.js","mappings":";2KAOA,MAAMA,EAAW,IAAIC,eAAgBC,IACnCC,WAAW,KACTD,EAAQE,QAASC,IAEXA,EAAMC,OAAOC,WACfF,EAAMC,OAAOC,WAAWH,QAASI,IAC/BA,EAAUC,UAAUJ,EAAMK,eAG5BL,EAAMC,OAAOG,UAAUJ,EAAMK,mBAWxBC,GAAc,OACxBC,GACC,cAA+BA,EAO7B,kBAAIC,GACF,OAAO,CACT,CAGA,iBAAAC,GAIE,GAHAC,MAAMD,oBACNd,EAASgB,QAAQC,MAEbA,KAAKJ,eAAgB,CACvB,MAAMK,EAASD,KAAKE,sBAAsBC,WAAaH,KAAKE,WAAWE,KAAOJ,KAAKE,WAE9ED,EAAOX,aACVW,EAAOX,WAAa,IAAIe,IACxBtB,EAASgB,QAAQE,IAGnBA,EAAOX,WAAWgB,IAAIN,MACtBA,KAAKO,SAAWN,CAClB,CACF,CAGA,oBAAAO,GACEV,MAAMU,uBACNzB,EAAS0B,UAAUT,MAEnB,MAAMC,EAASD,KAAKO,SACpB,GAAIP,KAAKJ,gBAAkBK,EAAQ,CACjC,MAAMX,EAAaW,EAAOX,WAEtBA,IACFA,EAAWoB,OAAOV,MAEM,IAApBV,EAAWqB,MACb5B,EAAS0B,UAAUR,IAIvBD,KAAKO,SAAW,IAClB,CACF,CAQA,SAAAf,CAAUoB,GAEV,G,+CC1EC,MAAMC,EAAmBlB,GAC9B,eAAmC,OAAkBA,IACnD,qBAAWmB,GACT,MAAO,CAMLC,aAAc,CACZC,KAAMC,QAURC,YAAa,CACXF,KAAMC,QAYRE,eAAgB,CACdH,KAAMC,OACNG,oBAAoB,GAG1B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KAgCb,CAGA,KAAA7C,GACEtE,MAAMsE,QAENpE,KAAKkH,mBAAqB,IAAI,IAAkBlH,MAChDA,KAAKkH,mBAAmBC,YAAY,OACpCnH,KAAKkH,mBAAmBE,cAAcpH,KAAK0E,cAC3C1E,KAAKqE,cAAcrE,KAAKkH,mBAC1B,GAGF,OAAoBH,E","sources":["webpack://@descope/web-components-ui/../../../node_modules/@vaadin/component-base/src/resize-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/field-base/src/input-field-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/text-area/theme/lumo/vaadin-text-area-styles.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/field-base/src/text-area-controller.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/text-area/src/vaadin-text-area-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/text-area/src/vaadin-text-area-styles.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/text-area/src/vaadin-text-area.js"],"sourcesContent":["/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { dedupingMixin } from '@polymer/polymer/lib/utils/mixin.js';\n\nconst observer = new ResizeObserver((entries) => {\n setTimeout(() => {\n entries.forEach((entry) => {\n // Notify child resizables, if any\n if (entry.target.resizables) {\n entry.target.resizables.forEach((resizable) => {\n resizable._onResize(entry.contentRect);\n });\n } else {\n entry.target._onResize(entry.contentRect);\n }\n });\n });\n});\n\n/**\n * A mixin that uses a ResizeObserver to listen to host size changes.\n *\n * @polymerMixin\n */\nexport const ResizeMixin = dedupingMixin(\n (superclass) =>\n class ResizeMixinClass extends superclass {\n /**\n * When true, the parent element resize will be also observed.\n * Override this getter and return `true` to enable this.\n *\n * @protected\n */\n get _observeParent() {\n return false;\n }\n\n /** @protected */\n connectedCallback() {\n super.connectedCallback();\n observer.observe(this);\n\n if (this._observeParent) {\n const parent = this.parentNode instanceof ShadowRoot ? this.parentNode.host : this.parentNode;\n\n if (!parent.resizables) {\n parent.resizables = new Set();\n observer.observe(parent);\n }\n\n parent.resizables.add(this);\n this.__parent = parent;\n }\n }\n\n /** @protected */\n disconnectedCallback() {\n super.disconnectedCallback();\n observer.unobserve(this);\n\n const parent = this.__parent;\n if (this._observeParent && parent) {\n const resizables = parent.resizables;\n\n if (resizables) {\n resizables.delete(this);\n\n if (resizables.size === 0) {\n observer.unobserve(parent);\n }\n }\n\n this.__parent = null;\n }\n }\n\n /**\n * A handler invoked on host resize. By default, it does nothing.\n * Override the method to implement your own behavior.\n *\n * @protected\n */\n _onResize(_contentRect) {\n // To be implemented.\n }\n },\n);\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { InputControlMixin } from './input-control-mixin.js';\n\n/**\n * A mixin to provide logic for vaadin-text-field and related components.\n *\n * @polymerMixin\n * @mixes InputControlMixin\n */\nexport const InputFieldMixin = (superclass) =>\n class InputFieldMixinClass extends InputControlMixin(superclass) {\n static get properties() {\n return {\n /**\n * Whether the value of the control can be automatically completed by the browser.\n * List of available options at:\n * https://developer.mozilla.org/en/docs/Web/HTML/Element/input#attr-autocomplete\n */\n autocomplete: {\n type: String,\n },\n\n /**\n * This is a property supported by Safari that is used to control whether\n * autocorrection should be enabled when the user is entering/editing the text.\n * Possible values are:\n * on: Enable autocorrection.\n * off: Disable autocorrection.\n */\n autocorrect: {\n type: String,\n },\n\n /**\n * This is a property supported by Safari and Chrome that is used to control whether\n * autocapitalization should be enabled when the user is entering/editing the text.\n * Possible values are:\n * characters: Characters capitalization.\n * words: Words capitalization.\n * sentences: Sentences capitalization.\n * none: No capitalization.\n */\n autocapitalize: {\n type: String,\n reflectToAttribute: true,\n },\n };\n }\n\n static get delegateAttrs() {\n return [...super.delegateAttrs, 'autocapitalize', 'autocomplete', 'autocorrect'];\n }\n\n // Workaround for https://github.com/Polymer/polymer/issues/5259\n get __data() {\n return this.__dataValue || {};\n }\n\n set __data(value) {\n this.__dataValue = value;\n }\n\n /**\n * @param {HTMLElement} input\n * @protected\n * @override\n */\n _inputElementChanged(input) {\n super._inputElementChanged(input);\n\n if (input) {\n // Discard value set on the custom slotted input.\n if (input.value && input.value !== this.value) {\n console.warn(`Please define value on the <${this.localName}> component!`);\n input.value = '';\n }\n\n if (this.value) {\n input.value = this.value;\n }\n }\n }\n\n /**\n * Override an event listener from `FocusMixin`.\n * @param {boolean} focused\n * @protected\n * @override\n */\n _setFocused(focused) {\n super._setFocused(focused);\n\n // Do not validate when focusout is caused by document\n // losing focus, which happens on browser tab switch.\n if (!focused && document.hasFocus()) {\n this.validate();\n }\n }\n\n /**\n * Override an event listener from `InputMixin`\n * to mark as valid after user started typing.\n * @param {Event} event\n * @protected\n * @override\n */\n _onInput(event) {\n super._onInput(event);\n\n if (this.invalid) {\n this.validate();\n }\n }\n\n /**\n * Override an observer from `InputMixin` to validate the field\n * when a new value is set programmatically.\n *\n * @param {string | undefined} newValue\n * @param {string | undefined} oldValue\n * @protected\n * @override\n */\n _valueChanged(newValue, oldValue) {\n super._valueChanged(newValue, oldValue);\n\n if (oldValue === undefined) {\n return;\n }\n\n if (this.invalid) {\n this.validate();\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 '@vaadin/input-container/theme/lumo/vaadin-input-container-styles.js';\nimport '@vaadin/vaadin-lumo-styles/color.js';\nimport '@vaadin/vaadin-lumo-styles/sizing.js';\nimport '@vaadin/vaadin-lumo-styles/typography.js';\nimport { inputFieldShared } from '@vaadin/vaadin-lumo-styles/mixins/input-field-shared.js';\nimport { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';\n\nconst textArea = css`\n [part='input-field'],\n [part='input-field'] ::slotted(textarea) {\n height: auto;\n box-sizing: border-box;\n }\n\n [part='input-field'] {\n /* Equal to the implicit padding in vaadin-text-field */\n padding-top: calc((var(--lumo-text-field-size) - 1em * var(--lumo-line-height-s)) / 2);\n padding-bottom: calc((var(--lumo-text-field-size) - 1em * var(--lumo-line-height-s)) / 2);\n transition: background-color 0.1s;\n line-height: var(--lumo-line-height-s);\n }\n\n :host(:not([readonly])) [part='input-field']::after {\n display: none;\n }\n\n :host([readonly]) [part='input-field'] {\n border: 1px dashed var(--lumo-contrast-30pct);\n }\n\n :host([readonly]) [part='input-field']::after {\n border: none;\n }\n\n :host(:hover:not([readonly]):not([focused]):not([invalid])) [part='input-field'] {\n background-color: var(--lumo-contrast-20pct);\n }\n\n @media (pointer: coarse) {\n :host(:hover:not([readonly]):not([focused]):not([invalid])) [part='input-field'] {\n background-color: var(--lumo-contrast-10pct);\n }\n\n :host(:active:not([readonly]):not([focused])) [part='input-field'] {\n background-color: var(--lumo-contrast-20pct);\n }\n }\n\n [part='input-field'] ::slotted(textarea) {\n line-height: inherit;\n --_lumo-text-field-overflow-mask-image: none;\n }\n\n /* Vertically align icon prefix/suffix with the first line of text */\n [part='input-field'] ::slotted(vaadin-icon) {\n margin-top: calc((var(--lumo-icon-size-m) - 1em * var(--lumo-line-height-s)) / -2);\n }\n`;\n\nregisterStyles('vaadin-text-area', [inputFieldShared, textArea], {\n moduleId: 'lumo-text-area',\n});\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { SlotController } from '@vaadin/component-base/src/slot-controller.js';\n\n/**\n * A controller to create and initialize slotted `<textarea>` element.\n */\nexport class TextAreaController extends SlotController {\n constructor(host, callback) {\n super(host, 'textarea', 'textarea', {\n initializer: (node, host) => {\n const value = host.getAttribute('value');\n if (value) {\n node.value = value;\n }\n\n const name = host.getAttribute('name');\n if (name) {\n node.setAttribute('name', name);\n }\n\n node.id = this.defaultId;\n\n if (typeof callback === 'function') {\n callback(node);\n }\n },\n useUniqueId: true,\n });\n }\n}\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { ResizeMixin } from '@vaadin/component-base/src/resize-mixin.js';\nimport { InputFieldMixin } from '@vaadin/field-base/src/input-field-mixin.js';\nimport { LabelledInputController } from '@vaadin/field-base/src/labelled-input-controller.js';\nimport { TextAreaController } from '@vaadin/field-base/src/text-area-controller.js';\n\n/**\n * A mixin providing common text area functionality.\n *\n * @polymerMixin\n * @mixes InputFieldMixin\n * @mixes ResizeMixin\n */\nexport const TextAreaMixin = (superClass) =>\n class TextAreaMixinClass extends ResizeMixin(InputFieldMixin(superClass)) {\n static get properties() {\n return {\n /**\n * Maximum number of characters (in Unicode code points) that the user can enter.\n */\n maxlength: {\n type: Number,\n },\n\n /**\n * Minimum number of characters (in Unicode code points) that the user can enter.\n */\n minlength: {\n type: Number,\n },\n\n /**\n * A regular expression that the value is checked against.\n * The pattern must match the entire value, not just some subset.\n */\n pattern: {\n type: String,\n },\n };\n }\n\n static get delegateAttrs() {\n return [...super.delegateAttrs, 'maxlength', 'minlength', 'pattern'];\n }\n\n static get constraints() {\n return [...super.constraints, 'maxlength', 'minlength', 'pattern'];\n }\n\n /**\n * Used by `InputControlMixin` as a reference to the clear button element.\n * @protected\n */\n get clearElement() {\n return this.$.clearButton;\n }\n\n /**\n * @protected\n * @override\n */\n _onResize() {\n this._updateHeight();\n this.__scrollPositionUpdated();\n }\n\n /** @protected */\n _onScroll() {\n this.__scrollPositionUpdated();\n }\n\n /** @protected */\n ready() {\n super.ready();\n\n this.addController(\n new TextAreaController(this, (input) => {\n this._setInputElement(input);\n this._setFocusElement(input);\n this.stateTarget = input;\n this.ariaTarget = input;\n }),\n );\n this.addController(new LabelledInputController(this.inputElement, this._labelController));\n\n this.addEventListener('animationend', this._onAnimationEnd);\n\n this._inputField = this.shadowRoot.querySelector('[part=input-field]');\n\n // Wheel scrolling results in async scroll events. Preventing the wheel\n // event, scrolling manually and then synchronously updating the scroll position CSS variable\n // allows us to avoid some jumpy behavior that would occur on wheel otherwise.\n this._inputField.addEventListener('wheel', (e) => {\n const scrollTopBefore = this._inputField.scrollTop;\n this._inputField.scrollTop += e.deltaY;\n\n if (scrollTopBefore !== this._inputField.scrollTop) {\n e.preventDefault();\n this.__scrollPositionUpdated();\n }\n });\n\n this._updateHeight();\n this.__scrollPositionUpdated();\n }\n\n /** @private */\n __scrollPositionUpdated() {\n this._inputField.style.setProperty('--_text-area-vertical-scroll-position', '0px');\n this._inputField.style.setProperty('--_text-area-vertical-scroll-position', `${this._inputField.scrollTop}px`);\n }\n\n /** @private */\n _onAnimationEnd(e) {\n if (e.animationName.indexOf('vaadin-text-area-appear') === 0) {\n this._updateHeight();\n }\n }\n\n /**\n * @param {unknown} newVal\n * @param {unknown} oldVal\n * @protected\n * @override\n */\n _valueChanged(newVal, oldVal) {\n super._valueChanged(newVal, oldVal);\n\n this._updateHeight();\n }\n\n /** @private */\n _updateHeight() {\n const input = this.inputElement;\n const inputField = this._inputField;\n\n if (!input || !inputField) {\n return;\n }\n\n const scrollTop = inputField.scrollTop;\n\n // Only clear the height when the content shortens to minimize scrollbar flickering.\n const valueLength = this.value ? this.value.length : 0;\n\n if (this._oldValueLength >= valueLength) {\n const inputFieldHeight = getComputedStyle(inputField).height;\n const inputWidth = getComputedStyle(input).width;\n\n // Temporarily fix the height of the wrapping input field container to prevent changing the browsers scroll\n // position while resetting the textareas height. If the textarea had a large height, then removing its height\n // will reset its height to the default of two rows. That might reduce the height of the page, and the\n // browser might adjust the scroll position before we can restore the measured height of the textarea.\n inputField.style.display = 'block';\n inputField.style.height = inputFieldHeight;\n\n // Fix the input element width so its scroll height isn't affected by host's disappearing scrollbars\n input.style.maxWidth = inputWidth;\n\n // Clear the height of the textarea to allow measuring a reduced scroll height\n input.style.height = 'auto';\n }\n this._oldValueLength = valueLength;\n\n const inputHeight = input.scrollHeight;\n if (inputHeight > input.clientHeight) {\n input.style.height = `${inputHeight}px`;\n }\n\n // Restore\n input.style.removeProperty('max-width');\n inputField.style.removeProperty('display');\n inputField.style.removeProperty('height');\n inputField.scrollTop = scrollTop;\n }\n\n /**\n * Returns true if the current textarea value satisfies all constraints (if any).\n * @return {boolean}\n * @override\n */\n checkValidity() {\n if (!super.checkValidity()) {\n return false;\n }\n\n // Native <textarea> does not support pattern attribute, so we have a custom logic\n // according to WHATWG spec for <input>, with tests inspired by web-platform-tests\n // https://html.spec.whatwg.org/multipage/input.html#the-pattern-attribute\n\n if (!this.pattern || !this.inputElement.value) {\n // Mark as valid if there is no pattern, or the value is empty\n return true;\n }\n\n try {\n const match = this.inputElement.value.match(this.pattern);\n return match ? match[0] === match.input : false;\n } catch (_) {\n // If the pattern can not be compiled, then report as valid\n return true;\n }\n }\n };\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { css } from 'lit';\n\nexport const textAreaStyles = css`\n :host {\n animation: 1ms vaadin-text-area-appear;\n }\n\n .vaadin-text-area-container {\n flex: auto;\n }\n\n /* The label, helper text and the error message should neither grow nor shrink. */\n [part='label'],\n [part='helper-text'],\n [part='error-message'] {\n flex: none;\n }\n\n [part='input-field'] {\n flex: auto;\n overflow: auto;\n -webkit-overflow-scrolling: touch;\n }\n\n ::slotted(textarea) {\n -webkit-appearance: none;\n -moz-appearance: none;\n flex: auto;\n overflow: hidden;\n width: 100%;\n height: 100%;\n outline: none;\n resize: none;\n margin: 0;\n padding: 0 0.25em;\n border: 0;\n border-radius: 0;\n min-width: 0;\n font: inherit;\n font-size: 1em;\n line-height: normal;\n color: inherit;\n background-color: transparent;\n /* Disable default invalid style in Firefox */\n box-shadow: none;\n }\n\n /* Override styles from <vaadin-input-container> */\n [part='input-field'] ::slotted(textarea) {\n align-self: stretch;\n white-space: pre-wrap;\n }\n\n [part='input-field'] ::slotted(:not(textarea)) {\n align-self: flex-start;\n }\n\n /* Workaround https://bugzilla.mozilla.org/show_bug.cgi?id=1739079 */\n :host([disabled]) ::slotted(textarea) {\n user-select: none;\n }\n\n @keyframes vaadin-text-area-appear {\n to {\n opacity: 1;\n }\n }\n`;\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport '@vaadin/input-container/src/vaadin-input-container.js';\nimport { html, PolymerElement } from '@polymer/polymer';\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 { inputFieldShared } from '@vaadin/field-base/src/styles/input-field-shared-styles.js';\nimport { registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';\nimport { TextAreaMixin } from './vaadin-text-area-mixin.js';\nimport { textAreaStyles } from './vaadin-text-area-styles.js';\n\nregisterStyles('vaadin-text-area', [inputFieldShared, textAreaStyles], { moduleId: 'vaadin-text-area-styles' });\n\n/**\n * `<vaadin-text-area>` is a web component for multi-line text input.\n *\n * ```html\n * <vaadin-text-area label=\"Comment\"></vaadin-text-area>\n * ```\n *\n * ### Prefixes and suffixes\n *\n * These are child elements of a `<vaadin-text-area>` that are displayed\n * inline with the input, before or after.\n * In order for an element to be considered as a prefix, it must have the slot\n * attribute set to `prefix` (and similarly for `suffix`).\n *\n * ```html\n * <vaadin-text-area label=\"Description\">\n * <div slot=\"prefix\">Details:</div>\n * <div slot=\"suffix\">The end!</div>\n * </vaadin-text-area>\n * ```\n *\n * ### Styling\n *\n * The following custom properties are available for styling:\n *\n * Custom property | Description | Default\n * -------------------------------|----------------------------|---------\n * `--vaadin-field-default-width` | Default width of the field | `12em`\n *\n * `<vaadin-text-area>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\n * See [`<vaadin-text-field>`](#/elements/vaadin-text-field) for the styling documentation.\n *\n * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n *\n * @fires {Event} input - Fired when the value is changed by the user: on every typing keystroke, and the value is cleared using the clear button.\n * @fires {Event} change - Fired when the user commits a value change.\n * @fires {CustomEvent} invalid-changed - Fired when the `invalid` property changes.\n * @fires {CustomEvent} value-changed - Fired when the `value` property changes.\n * @fires {CustomEvent} validated - Fired whenever the field is validated.\n *\n * @customElement\n * @extends HTMLElement\n * @mixes ElementMixin\n * @mixes TextAreaMixin\n * @mixes ThemableMixin\n */\nexport class TextArea extends TextAreaMixin(ThemableMixin(ElementMixin(PolymerElement))) {\n static get is() {\n return 'vaadin-text-area';\n }\n\n static get template() {\n return html`\n <div class=\"vaadin-text-area-container\">\n <div part=\"label\">\n <slot name=\"label\"></slot>\n <span part=\"required-indicator\" aria-hidden=\"true\"></span>\n </div>\n\n <vaadin-input-container\n part=\"input-field\"\n readonly=\"[[readonly]]\"\n disabled=\"[[disabled]]\"\n invalid=\"[[invalid]]\"\n theme$=\"[[_theme]]\"\n on-scroll=\"_onScroll\"\n >\n <slot name=\"prefix\" slot=\"prefix\"></slot>\n <slot name=\"textarea\"></slot>\n <slot name=\"suffix\" slot=\"suffix\"></slot>\n <div id=\"clearButton\" part=\"clear-button\" slot=\"suffix\" aria-hidden=\"true\"></div>\n </vaadin-input-container>\n\n <div part=\"helper-text\">\n <slot name=\"helper\"></slot>\n </div>\n\n <div part=\"error-message\">\n <slot name=\"error-message\"></slot>\n </div>\n </div>\n\n <slot name=\"tooltip\"></slot>\n `;\n }\n\n /** @protected */\n ready() {\n super.ready();\n\n this._tooltipController = new TooltipController(this);\n this._tooltipController.setPosition('top');\n this._tooltipController.setAriaTarget(this.inputElement);\n this.addController(this._tooltipController);\n }\n}\n\ndefineCustomElement(TextArea);\n"],"names":["observer","ResizeObserver","entries","setTimeout","forEach","entry","target","resizables","resizable","_onResize","contentRect","ResizeMixin","superclass","_observeParent","connectedCallback","super","observe","this","parent","parentNode","ShadowRoot","host","Set","add","__parent","disconnectedCallback","unobserve","delete","size","_contentRect","InputFieldMixin","properties","autocomplete","type","String","autocorrect","autocapitalize","reflectToAttribute","delegateAttrs","__data","__dataValue","value","_inputElementChanged","input","console","warn","localName","_setFocused","focused","document","hasFocus","validate","_onInput","event","invalid","_valueChanged","newValue","oldValue","undefined","textArea","moduleId","TextAreaController","constructor","callback","initializer","node","getAttribute","name","setAttribute","id","defaultId","useUniqueId","TextAreaMixin","superClass","maxlength","Number","minlength","pattern","constraints","clearElement","$","clearButton","_updateHeight","__scrollPositionUpdated","_onScroll","ready","addController","_setInputElement","_setFocusElement","stateTarget","ariaTarget","inputElement","_labelController","addEventListener","_onAnimationEnd","_inputField","shadowRoot","querySelector","e","scrollTopBefore","scrollTop","deltaY","preventDefault","style","setProperty","animationName","indexOf","newVal","oldVal","inputField","valueLength","length","_oldValueLength","inputFieldHeight","getComputedStyle","height","inputWidth","width","display","maxWidth","inputHeight","scrollHeight","clientHeight","removeProperty","checkValidity","match","_","textAreaStyles","TextArea","is","template","_tooltipController","setPosition","setAriaTarget"],"sourceRoot":""}
|