@descope/web-components-ui 1.0.424 → 1.0.426

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist/cjs/index.cjs.js +1858 -911
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +4444 -3495
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/umd/1402.js +1 -1
  6. package/dist/umd/1484.js +1 -1
  7. package/dist/umd/2159.js +2 -2
  8. package/dist/umd/3110.js +1 -1
  9. package/dist/umd/3191.js +9 -62
  10. package/dist/umd/404.js +1 -1
  11. package/dist/umd/4127.js +2 -2
  12. package/dist/umd/507.js +1 -1
  13. package/dist/umd/{2755.js → 5459.js} +1 -1
  14. package/dist/umd/5563.js +2 -2
  15. package/dist/umd/731.js +1 -1
  16. package/dist/umd/7979.js +1 -1
  17. package/dist/umd/8823.js +1 -1
  18. package/dist/umd/9030.js +1 -1
  19. package/dist/umd/9243.js +1 -1
  20. package/dist/umd/DescopeDev.js +1 -1
  21. package/dist/umd/bcdfe87ae253c2cf789c9a737f8d8c22.woff +0 -0
  22. package/dist/umd/descope-alert-index-js.js +1 -1
  23. package/dist/umd/descope-combo-box.js +113 -0
  24. package/dist/umd/descope-date-field-descope-calendar-index-js.js +1 -1
  25. package/dist/umd/descope-hybrid-field-index-js.js +3 -3
  26. package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js +1 -1
  27. package/dist/umd/descope-new-password-index-js.js +1 -1
  28. package/dist/umd/descope-security-questions-setup-index-js.js +1 -1
  29. package/dist/umd/index.js +1 -1
  30. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -1
  31. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js +1 -1
  32. package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js +1 -1
  33. package/dist/umd/phone-fields-descope-phone-field-index-js.js +1 -1
  34. package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js +2 -2
  35. package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js +8 -8
  36. package/node_modules/common/package.json +3 -0
  37. package/node_modules/common/src/componentsMixins/mixins/normalizeBooleanAttributesMixin.js +2 -0
  38. package/node_modules/common/src/sbHelpers.js +53 -0
  39. package/node_modules/common/src/themeHelpers/index.js +26 -11
  40. package/node_modules/common/src/themeHelpers/resetHelpers.js +144 -0
  41. package/node_modules/descope-combo-box/e2e/descope-combo-box.spec.ts +462 -0
  42. package/node_modules/descope-combo-box/package.json +34 -0
  43. package/node_modules/descope-combo-box/project.json +7 -0
  44. package/{src/components/descope-combo-box → node_modules/descope-combo-box/src/component}/ComboBoxClass.js +114 -38
  45. package/{src/theme/components/comboBox.js → node_modules/descope-combo-box/src/theme.js} +6 -6
  46. package/node_modules/descope-combo-box/stories/descope-combo-box.stories.js +180 -0
  47. package/node_modules/theme-input-wrapper/package.json +17 -0
  48. package/node_modules/theme-input-wrapper/project.json +7 -0
  49. package/node_modules/theme-input-wrapper/src/index.js +130 -0
  50. package/package.json +10 -6
  51. package/src/components/descope-alert/AlertClass.js +3 -1
  52. package/src/components/descope-date-field/descope-calendar/index.js +1 -1
  53. package/src/components/descope-new-password/descope-new-password-internal/NewPasswordInternal.js +1 -1
  54. package/src/components/descope-security-questions-setup/SecurityQuestionsSetupClass.js +1 -1
  55. package/src/components/descope-security-questions-setup/index.js +1 -1
  56. package/src/components/mapping-fields/descope-mappings-field/index.js +1 -1
  57. package/src/components/phone-fields/descope-phone-field/PhoneFieldClass.js +1 -1
  58. package/src/components/phone-fields/descope-phone-field/descope-phone-field-internal/PhoneFieldInternal.js +3 -0
  59. package/src/components/phone-fields/descope-phone-field/descope-phone-field-internal/index.js +1 -1
  60. package/src/components/phone-fields/descope-phone-field/index.js +1 -1
  61. package/src/components/phone-fields/descope-phone-input-box-field/index.js +1 -1
  62. package/src/index.js +0 -1
  63. package/src/theme/components/index.js +1 -1
  64. package/dist/umd/4480.js +0 -1
  65. package/dist/umd/descope-combo-box-index-js.js +0 -113
  66. /package/dist/umd/{descope-combo-box-index-js.js.LICENSE.txt → descope-combo-box.js.LICENSE.txt} +0 -0
  67. /package/{src/components/descope-combo-box → node_modules/descope-combo-box/src/component}/index.js +0 -0
@@ -1,5 +1,5 @@
1
1
  /*! For license information please see phone-fields-descope-phone-input-box-field-index-js.js.LICENSE.txt */
2
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[404,4043,7052],{69473:(t,e,n)=>{n.d(e,{T:()=>s,w:()=>p});var i=n(94619),o=n(93826),r=n(7138),a=n(14944),l=n(33177);const s=(0,a.xE)("text-field"),d=["type","label-type","copy-to-clipboard"],p=(0,r.Zz)((0,i.RF)({mappings:o.A}),i.VO,(0,i.OZ)({proxyProps:["value","selectionStart"],useProxyTargets:!0}),i.tQ,(t=>class extends t{static get observedAttributes(){return d.concat(t.observedAttributes||[])}icon;init(){super.init?.()}renderCopyToClipboard(t){if(!t)return void this.icon?.remove();const e={icon:"vaadin:copy-o",title:"Copy",style:"cursor: pointer"},n={icon:"vaadin:check-circle-o",title:"Copied",style:"cursor: initial"};this.icon=Object.assign(document.createElement("vaadin-icon"),{slot:"suffix",...e}),this.baseElement.appendChild(this.icon),this.icon.addEventListener("click",(()=>{navigator.clipboard.writeText(this.value),Object.assign(this.icon,n),setTimeout((()=>{Object.assign(this.icon,e)}),5e3)}))}onLabelClick(){this.focus()}attributeChangedCallback(t,e,n){super.attributeChangeCallback?.(t,e,n),"type"===t&&this.baseElement._setType(n),e!==n&&("label-type"===t?"floating"===n?this.addEventListener("click",this.onLabelClick):this.removeEventListener("click",this.onLabelClick):"copy-to-clipboard"===t&&this.renderCopyToClipboard("true"===n))}}))((0,i.tz)({slots:["prefix","suffix"],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tpadding: calc(var(${p.cssVarList.inputOutlineWidth}) + var(${p.cssVarList.inputOutlineOffset}));\n box-sizing: border-box;\n\t\t\t}\n :host(:is([readonly], [disabled])) ::slotted(:is(input, textarea):placeholder-shown) {\n opacity: 1;\n }\n\n vaadin-text-field[label-type="floating"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n vaadin-text-field[label-type="floating"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n ${(0,l.$J)("vaadin-text-field")}\n\t\t\t${(0,l.cy)(p.cssVarList)}\n\t\t\t${(0,l.LJ)("vaadin-text-field",p.cssVarList)}\n ${(0,l.Kl)()}\n\n vaadin-text-field vaadin-icon {\n align-self: center;\n }\n\t\t`,excludeAttrsSync:["tabindex"],componentName:s}))},89348:(t,e,n)=>{n.r(e),n.d(e,{TextFieldClass:()=>i.w}),n(63970),n(23638),n(80201);var i=n(69473);customElements.define(i.T,i.w)},96800:(t,e,n)=>{n.d(e,{TQ:()=>u,Ul:()=>C});var i=n(43945),o=n(14944),r=n(7138),a=n(94619),l=n(69473),s=n(44066),d=n(33177);const p=l.w.cssVarList,u=(0,o.xE)("phone-input-box-field"),{host:c,label:h,inputElement:b,requiredIndicator:v,inputField:g,inputFieldInternal:m,phoneInput:y,errorMessage:f,helperText:x}={host:{selector:()=>":host"},label:{selector:"::part(label)"},placeholder:{selector:"> input:placeholder-shown"},inputElement:{selector:"input"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},inputField:{selector:()=>"vaadin-text-field::part(input-field)"},inputFieldInternal:{selector:()=>"descope-phone-field-internal-input-box vaadin-text-field::part(input-field)"},phoneInput:{selector:()=>"descope-text-field"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},C=(0,r.Zz)((0,a.RF)({mappings:{fontSize:[c,g,{selector:l.w.componentName,property:l.w.cssVarList.fontSize}],fontFamily:[h,f,x],hostWidth:{...c,property:"width"},hostMinWidth:{...c,property:"min-width"},hostDirection:{...c,property:"direction"},inputBorderStyle:{...m,property:"border-style"},inputBorderWidth:{...m,property:"border-width"},inputBorderColor:{...m,property:"border-color"},inputBorderRadius:[{...g,property:"border-radius"},{...m,property:"border-radius"}],inputHorizontalPadding:[{...y,property:"padding-left"},{...y,property:"padding-right"}],labelFontSize:{...h,property:"font-size"},labelFontWeight:{...h,property:"font-weight"},labelTextColor:[{...h,property:"color"},{...v,property:"color"}],labelRequiredIndicator:{...v,property:"content"},errorMessageTextColor:{...f,property:"color"},errorMessageIcon:{...f,property:"background-image"},errorMessageIconSize:{...f,property:"background-size"},errorMessageIconPadding:{...f,property:"padding-inline-start"},errorMessageIconRepeat:{...f,property:"background-repeat"},errorMessageIconPosition:{...f,property:"background-position"},inputValueTextColor:{...y,property:p.inputValueTextColor},inputPlaceholderTextColor:{...y,property:p.inputPlaceholderColor},inputOutlineStyle:{...g,property:"outline-style"},inputOutlineColor:{...g,property:"outline-color"},inputOutlineWidth:{...g,property:"outline-width"},inputOutlineOffset:{...g,property:"outline-offset"},labelPosition:{...h,property:"position"},labelTopPosition:{...h,property:"top"},labelHorizontalPosition:[{...h,property:"left"},{...h,property:"right"}],inputTransformY:{...h,property:"transform"},inputTransition:{...h,property:"transition"},marginInlineStart:{...h,property:"margin-inline-start"},valueInputHeight:{...b,property:"height"},valueInputMarginBottom:{selector:l.w.componentName,property:p.valueInputMarginBottom}}}),a.VO,(0,a.OZ)({proxyProps:["value","selectionStart"]}),(t=>class extends t{static get CountryCodes(){return s.A}init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n\t\t\t\t<${i.T}\n\t\t\t\t\ttabindex="-1"\n\t\t\t\t\tslot="input"\n\t\t\t\t></${i.T}>\n `,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(i.T),(0,o.EA)(this.shadowRoot.host,this.inputElement,{includeAttrs:["size","bordered","invalid","minlength","maxlength","default-code","disabled","phone-input-placeholder","label","label-type","allow-alphanumeric-input"]})}get phoneNumberInputEle(){return this.inputElement?.phoneNumberInputEle}}))((0,a.tz)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n :host {\n display: inline-flex;\n max-width: 100%;\n box-sizing: border-box;\n }\n ${(0,d.cy)(C.cssVarList)}\n ${(0,d.I4)("vaadin-text-field")}\n ${(0,d.kG)("vaadin-text-field")}\n ${(0,d.X6)()}\n\n vaadin-text-field {\n width: 100%;\n box-sizing: border-box;\n padding: 0;\n }\n vaadin-text-field[focus-ring]::part(input-field) {\n box-shadow: none;\n }\n vaadin-text-field::before {\n height: 0;\n }\n vaadin-text-field::part(input-field) {\n padding: 0;\n background: transparent;\n overflow: hidden;\n -webkit-mask-image: none;\n }\n descope-phone-field-internal-input-box {\n -webkit-mask-image: none;\n padding: 0;\n width: 100%;\n }\n descope-phone-field-internal-input-box > div {\n width: 100%;\n }\n descope-phone-field-internal-input-box .separator {\n flex: 0;\n border: none;\n }\n descope-phone-field-internal-input-box descope-text-field {\n ${p.inputOutlineWidth}: 0;\n ${p.inputOutlineOffset}: 0;\n }\n descope-text-field {\n flex-grow: 1;\n width: 100%;\n direction: ltr;\n }\n vaadin-text-field[readonly] > input:placeholder-shown {\n opacity: 1;\n }\n vaadin-text-field::part(input-field)::after {\n border: none;\n }\n\n vaadin-text-field[label-type="floating"]:not([focused])[readonly] input:placeholder-shown {\n opacity: 0;\n }\n vaadin-text-field[label-type="floating"]:not([focused])[disabled] input:placeholder-shown {\n opacity: 0;\n }\n\n ${(0,d.$J)("vaadin-text-field")}\n ${(0,d.Kl)()}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:u}))},43945:(t,e,n)=>{n.d(e,{A:()=>p,T:()=>a});var i=n(25827),o=n(14944),r=n(63789);const a=(0,o.xE)("phone-field-internal-input-box"),l=["disabled","size","bordered","invalid","readonly","phone-input-placeholder","name","autocomplete","label-type","allow-alphanumeric-input"],s={"phone-input-placeholder":"placeholder"},d=(0,i.y)({componentName:a,baseSelector:"div"}),p=class extends d{static get observedAttributes(){return[].concat(d.observedAttributes||[],l)}constructor(){super(),this.innerHTML='\n <div>\n <descope-text-field tabindex="1"></descope-text-field>\n </div>\n ',this.phoneNumberInput=this.querySelector("descope-text-field")}get defaultCountryCode(){return(0,r.Q)(this.getAttribute("default-code"))}get hasDefaultCode(){return!!this.getAttribute("default-code")}get allowAlphanumericInput(){return"true"===this.getAttribute("allow-alphanumeric-input")}get value(){if(!this.phoneNumberValue)return"";if(this.hasDefaultCode){const t=new RegExp(`\\+?${parseInt(this.defaultCountryCode,10)}--?`);return`${this.defaultCountryCode}-${this.phoneNumberInput.value.replace(t,"")}`}return this.phoneNumberInput.value}set value(t){this.phoneNumberInput.value=t}get phoneNumberValue(){return this.phoneNumberInput.value}get phoneNumberInputEle(){return this.phoneNumberInput.shadowRoot.querySelector("input")}get minLength(){return parseInt(this.getAttribute("minlength"),10)||0}get maxLength(){return parseInt(this.getAttribute("maxlength"),10)||50}getValidity(){const t=this.value.replace(/\D/g,"");return this.isRequired&&!this.value?{valueMissing:!0}:t.length<this.minLength?{tooShort:!0}:t.length>this.maxLength?{tooLong:!0}:/^\+?\d{1,4}-?(?:\d-?){1,15}$/.test(this.value)?{}:{patternMismatch:!0}}init(){this.addEventListener("focus",(t=>{t.isTrusted&&this.phoneNumberInput.focus()})),super.init?.(),this.initInputs()}getCountryByDialCode(t){return this.countryCodeInput.items?.find((e=>e.getAttribute("data-country-code")===t))}initInputs(){this.phoneNumberInput.addEventListener("input",(t=>{1===t.target.value.length&&"-"===t.target.value&&(t.target.value=""),t.target.value=t.target.value.replace(/(?!^)\+/g,"").replace("--","-").replace("+-","+");let e=t.target.value;if(!this.allowAlphanumericInput){const n=/^[+\d-]+$/;e=t.target.value.split("").filter((t=>n.test(t))).join("")}t.target.value=e})),this.handleFocusEventsDispatching([this.phoneNumberInput])}attributeChangedCallback(t,e,n){if(super.attributeChangedCallback(t,e,n),e!==n&&l.includes(t)){const e=s[t]||t;this.phoneNumberInput.setAttribute(e,n)}}}},46633:(t,e,n)=>{n.r(e),n(89348);var i=n(43945);customElements.define(i.T,i.A)},87743:(t,e,n)=>{n.r(e),n.d(e,{PhoneFieldInputBoxClass:()=>i.Ul}),n(46633),n(4480),n(89348);var i=n(96800);customElements.define(i.TQ,i.Ul)},63789:(t,e,n)=>{n.d(e,{Q:()=>o});var i=n(44066);const o=t=>i.A.find((e=>e.code===t))?.dialCode},91011:(t,e,n)=>{n(73593),n(97612),n(67239),n(16670);var i=n(80704),o=n(57224);const r=o.AH`
2
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[404,4043,5691],{44976:(e,t,o)=>{o.d(t,{C:()=>y,T:()=>l});var r=o(18366),n=o(17166),i=o(49151),a=o(18823);const l=(0,n.xE)("combo-box"),{host:s,inputField:d,inputElement:p,placeholder:u,toggle:c,clearButton:h,label:b,requiredIndicator:m,helperText:g,errorMessage:v}={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)"}},y=(0,r.Zz)((0,a.RF)({mappings:{hostWidth:{...s,property:"width"},hostDirection:{...s,property:"direction"},fontSize:[{},s],fontFamily:[b,u,d,g,v],labelFontSize:{...b,property:"font-size"},labelFontWeight:{...b,property:"font-weight"},labelTextColor:[{...b,property:"color"},{...m,property:"color"}],errorMessageTextColor:{...v,property:"color"},errorMessageIcon:{...v,property:"background-image"},errorMessageIconSize:{...v,property:"background-size"},errorMessageIconPadding:{...v,property:"padding-inline-start"},errorMessageIconRepeat:{...v,property:"background-repeat"},errorMessageIconPosition:{...v,property:"background-position"},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:{...m,property:"content"},inputValueTextColor:{...d,property:"color"},inputPlaceholderTextColor:{...u,property:"color"},inputDropdownButtonCursor:[{...c,property:"cursor"},{...h,property:"cursor"}],inputDropdownButtonColor:[{...c,property:"color"},{...h,property:"color"}],inputDropdownButtonSize:[{...c,property:"font-size"},{...h,property:"font-size"}],inputDropdownButtonOffset:[{...c,property:"margin-right"},{...c,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:{...b,property:"position"},labelTopPosition:{...b,property:"top"},labelHorizontalPosition:[{...b,property:"left"},{...b,property:"right"}],inputTransformY:{...b,property:"transform"},inputTransition:{...b,property:"transition"},marginInlineStart:{...b,property:"margin-inline-start"},placeholderOpacity:{...u,property:"opacity"},inputVerticalAlignment:{...d,property:"align-items"},valueInputHeight:{...p,property:"height"},valueInputMarginBottom:{...p,property:"margin-bottom"},overlayBackground:{property:()=>y.cssVarList.overlay.backgroundColor},overlayTextColor:{property:()=>y.cssVarList.overlay.textColor},overlayBorder:{property:()=>y.cssVarList.overlay.border},overlayFontSize:{property:()=>y.cssVarList.overlay.fontSize},overlayFontFamily:{property:()=>y.cssVarList.overlay.fontFamily},overlayCursor:{property:()=>y.cssVarList.overlay.cursor},overlayItemBoxShadow:{property:()=>y.cssVarList.overlay.itemBoxShadow},overlayItemPaddingInlineStart:{property:()=>y.cssVarList.overlay.itemPaddingInlineStart},overlayItemPaddingInlineEnd:{property:()=>y.cssVarList.overlay.itemPaddingInlineEnd}}}),a.VO,(0,a.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"},loaderTop:{selector:"vaadin-combo-box-overlay::part(loader)",property:"top"},loaderLeft:{selector:"vaadin-combo-box-overlay::part(loader)",property:"left"},loaderRight:{selector:"vaadin-combo-box-overlay::part(loader)",property:"right"},loaderMargin:{selector:"vaadin-combo-box-overlay::part(loader)",property:"margin"},loaderWidth:{selector:"vaadin-combo-box-overlay::part(loader)",property:"width"},loaderHeight:{selector:"vaadin-combo-box-overlay::part(loader)",property:"height"},loaderBorder:{selector:"vaadin-combo-box-overlay::part(loader)",property:"border"},loaderBorderColor:{selector:"vaadin-combo-box-overlay::part(loader)",property:"border-color"},loaderBorderRadius:{selector:"vaadin-combo-box-overlay::part(loader)",property:"border-radius"},contentHeight:{selector:"vaadin-combo-box-overlay::part(content)",property:"height"},contentOpacity:{selector:"vaadin-combo-box-overlay::part(content)",property:"opacity"}},forward:{include:!1,attributes:["size"]}}),(0,a.OZ)({proxyProps:["selectionStart"],inputEvent:"selected-item-changed"}),a.tQ,(e=>class extends e{static get observedAttributes(){return["label-type"]}#e=({displayName:e,value:t,label:o})=>`<span data-name="${o}" data-id="${t}">${e||o}</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())}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}}handleSelectedItem(){const{selectedItem:e}=this.baseElement,t=e?.["data-id"];e&&Array.from(this.children).includes(e)||(t&&(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(o){if(!t.baseElement.items?.length&&!t.allowCustomValue)return;const r=t.customValueTransformFn(o)||"";r!==this.value&&e.set.call(this,r)}}})}#o(){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)}#r(){const e=this.baseElement.shadowRoot.querySelector("vaadin-combo-box-overlay");e._attachOverlay=()=>{e.bringToFront()},e._detachOverlay=()=>{},e._enterModalState=()=>{}}#n(){this.baseElement.renderer=(e,t,o)=>{e.innerHTML=o.item.outerHTML}}init(){super.init?.(),this.getValidity=function(){return!this.value&&this.isRequired?{valueMissing:!0}:{}},this.setComboBoxDescriptor(),this.#r(),this.#n(),(0,n.mx)(this,this.renderItems.bind(this),{includeAttrs:["data"]}),(0,n.Ge)(this,this.#o.bind(this)),this.setDefaultValue(),this.baseElement.addEventListener("selected-item-changed",(()=>{this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}))}onLabelClick(){this.isReadOnly||this.isDisabled||(this.focus(),this.setAttribute("opened","true"))}attributeChangedCallback(e,t,o){super.attributeChangedCallback?.(e,t,o),t!==o&&"label-type"===e&&("floating"===o?this.addEventListener("click",this.onLabelClick):this.removeEventListener("click",this.onLabelClick))}setDefaultValue(){this.defaultValue&&(this.value=this.defaultValue)}#i(e){return this.baseElement.items?.find((t=>t["data-id"]===e))}#a(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.#i(e);this.#a(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")}}))((0,a.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)(y.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"],componentName:l,includeForwardProps:["items","renderer","selectedItem"]}))},11738:(e,t,o)=>{o.r(t),o.d(t,{ComboBoxClass:()=>r.C}),o(91011);var r=o(44976);customElements.define(r.T,r.C)},69473:(e,t,o)=>{o.d(t,{T:()=>s,w:()=>p});var r=o(94619),n=o(93826),i=o(7138),a=o(14944),l=o(33177);const s=(0,a.xE)("text-field"),d=["type","label-type","copy-to-clipboard"],p=(0,i.Zz)((0,r.RF)({mappings:n.A}),r.VO,(0,r.OZ)({proxyProps:["value","selectionStart"],useProxyTargets:!0}),r.tQ,(e=>class extends e{static get observedAttributes(){return d.concat(e.observedAttributes||[])}icon;init(){super.init?.()}renderCopyToClipboard(e){if(!e)return void this.icon?.remove();const t={icon:"vaadin:copy-o",title:"Copy",style:"cursor: pointer"},o={icon:"vaadin:check-circle-o",title:"Copied",style:"cursor: initial"};this.icon=Object.assign(document.createElement("vaadin-icon"),{slot:"suffix",...t}),this.baseElement.appendChild(this.icon),this.icon.addEventListener("click",(()=>{navigator.clipboard.writeText(this.value),Object.assign(this.icon,o),setTimeout((()=>{Object.assign(this.icon,t)}),5e3)}))}onLabelClick(){this.focus()}attributeChangedCallback(e,t,o){super.attributeChangeCallback?.(e,t,o),"type"===e&&this.baseElement._setType(o),t!==o&&("label-type"===e?"floating"===o?this.addEventListener("click",this.onLabelClick):this.removeEventListener("click",this.onLabelClick):"copy-to-clipboard"===e&&this.renderCopyToClipboard("true"===o))}}))((0,r.tz)({slots:["prefix","suffix"],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tpadding: calc(var(${p.cssVarList.inputOutlineWidth}) + var(${p.cssVarList.inputOutlineOffset}));\n box-sizing: border-box;\n\t\t\t}\n :host(:is([readonly], [disabled])) ::slotted(:is(input, textarea):placeholder-shown) {\n opacity: 1;\n }\n\n vaadin-text-field[label-type="floating"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n vaadin-text-field[label-type="floating"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n ${(0,l.$J)("vaadin-text-field")}\n\t\t\t${(0,l.cy)(p.cssVarList)}\n\t\t\t${(0,l.LJ)("vaadin-text-field",p.cssVarList)}\n ${(0,l.Kl)()}\n\n vaadin-text-field vaadin-icon {\n align-self: center;\n }\n\t\t`,excludeAttrsSync:["tabindex"],componentName:s}))},89348:(e,t,o)=>{o.r(t),o.d(t,{TextFieldClass:()=>r.w}),o(63970),o(23638),o(80201);var r=o(69473);customElements.define(r.T,r.w)},96800:(e,t,o)=>{o.d(t,{TQ:()=>u,Ul:()=>C});var r=o(43945),n=o(14944),i=o(7138),a=o(94619),l=o(69473),s=o(44066),d=o(33177);const p=l.w.cssVarList,u=(0,n.xE)("phone-input-box-field"),{host:c,label:h,inputElement:b,requiredIndicator:m,inputField:g,inputFieldInternal:v,phoneInput:y,errorMessage:f,helperText:x}={host:{selector:()=>":host"},label:{selector:"::part(label)"},placeholder:{selector:"> input:placeholder-shown"},inputElement:{selector:"input"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},inputField:{selector:()=>"vaadin-text-field::part(input-field)"},inputFieldInternal:{selector:()=>"descope-phone-field-internal-input-box vaadin-text-field::part(input-field)"},phoneInput:{selector:()=>"descope-text-field"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},C=(0,i.Zz)((0,a.RF)({mappings:{fontSize:[c,g,{selector:l.w.componentName,property:l.w.cssVarList.fontSize}],fontFamily:[h,f,x],hostWidth:{...c,property:"width"},hostMinWidth:{...c,property:"min-width"},hostDirection:{...c,property:"direction"},inputBorderStyle:{...v,property:"border-style"},inputBorderWidth:{...v,property:"border-width"},inputBorderColor:{...v,property:"border-color"},inputBorderRadius:[{...g,property:"border-radius"},{...v,property:"border-radius"}],inputHorizontalPadding:[{...y,property:"padding-left"},{...y,property:"padding-right"}],labelFontSize:{...h,property:"font-size"},labelFontWeight:{...h,property:"font-weight"},labelTextColor:[{...h,property:"color"},{...m,property:"color"}],labelRequiredIndicator:{...m,property:"content"},errorMessageTextColor:{...f,property:"color"},errorMessageIcon:{...f,property:"background-image"},errorMessageIconSize:{...f,property:"background-size"},errorMessageIconPadding:{...f,property:"padding-inline-start"},errorMessageIconRepeat:{...f,property:"background-repeat"},errorMessageIconPosition:{...f,property:"background-position"},inputValueTextColor:{...y,property:p.inputValueTextColor},inputPlaceholderTextColor:{...y,property:p.inputPlaceholderColor},inputOutlineStyle:{...g,property:"outline-style"},inputOutlineColor:{...g,property:"outline-color"},inputOutlineWidth:{...g,property:"outline-width"},inputOutlineOffset:{...g,property:"outline-offset"},labelPosition:{...h,property:"position"},labelTopPosition:{...h,property:"top"},labelHorizontalPosition:[{...h,property:"left"},{...h,property:"right"}],inputTransformY:{...h,property:"transform"},inputTransition:{...h,property:"transition"},marginInlineStart:{...h,property:"margin-inline-start"},valueInputHeight:{...b,property:"height"},valueInputMarginBottom:{selector:l.w.componentName,property:p.valueInputMarginBottom}}}),a.VO,(0,a.OZ)({proxyProps:["value","selectionStart"]}),(e=>class extends e{static get CountryCodes(){return s.A}init(){super.init?.();const e=document.createElement("template");e.innerHTML=`\n\t\t\t\t<${r.T}\n\t\t\t\t\ttabindex="-1"\n\t\t\t\t\tslot="input"\n\t\t\t\t></${r.T}>\n `,this.baseElement.appendChild(e.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(r.T),(0,n.EA)(this.shadowRoot.host,this.inputElement,{includeAttrs:["size","bordered","invalid","minlength","maxlength","default-code","disabled","phone-input-placeholder","label","label-type","allow-alphanumeric-input"]})}get phoneNumberInputEle(){return this.inputElement?.phoneNumberInputEle}}))((0,a.tz)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n :host {\n display: inline-flex;\n max-width: 100%;\n box-sizing: border-box;\n }\n ${(0,d.cy)(C.cssVarList)}\n ${(0,d.I4)("vaadin-text-field")}\n ${(0,d.kG)("vaadin-text-field")}\n ${(0,d.X6)()}\n\n vaadin-text-field {\n width: 100%;\n box-sizing: border-box;\n padding: 0;\n }\n vaadin-text-field[focus-ring]::part(input-field) {\n box-shadow: none;\n }\n vaadin-text-field::before {\n height: 0;\n }\n vaadin-text-field::part(input-field) {\n padding: 0;\n background: transparent;\n overflow: hidden;\n -webkit-mask-image: none;\n }\n descope-phone-field-internal-input-box {\n -webkit-mask-image: none;\n padding: 0;\n width: 100%;\n }\n descope-phone-field-internal-input-box > div {\n width: 100%;\n }\n descope-phone-field-internal-input-box .separator {\n flex: 0;\n border: none;\n }\n descope-phone-field-internal-input-box descope-text-field {\n ${p.inputOutlineWidth}: 0;\n ${p.inputOutlineOffset}: 0;\n }\n descope-text-field {\n flex-grow: 1;\n width: 100%;\n direction: ltr;\n }\n vaadin-text-field[readonly] > input:placeholder-shown {\n opacity: 1;\n }\n vaadin-text-field::part(input-field)::after {\n border: none;\n }\n\n vaadin-text-field[label-type="floating"]:not([focused])[readonly] input:placeholder-shown {\n opacity: 0;\n }\n vaadin-text-field[label-type="floating"]:not([focused])[disabled] input:placeholder-shown {\n opacity: 0;\n }\n\n ${(0,d.$J)("vaadin-text-field")}\n ${(0,d.Kl)()}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:u}))},43945:(e,t,o)=>{o.d(t,{A:()=>p,T:()=>a});var r=o(25827),n=o(14944),i=o(63789);const a=(0,n.xE)("phone-field-internal-input-box"),l=["disabled","size","bordered","invalid","readonly","phone-input-placeholder","name","autocomplete","label-type","allow-alphanumeric-input"],s={"phone-input-placeholder":"placeholder"},d=(0,r.y)({componentName:a,baseSelector:"div"}),p=class extends d{static get observedAttributes(){return[].concat(d.observedAttributes||[],l)}constructor(){super(),this.innerHTML='\n <div>\n <descope-text-field tabindex="1"></descope-text-field>\n </div>\n ',this.phoneNumberInput=this.querySelector("descope-text-field")}get defaultCountryCode(){return(0,i.Q)(this.getAttribute("default-code"))}get hasDefaultCode(){return!!this.getAttribute("default-code")}get allowAlphanumericInput(){return"true"===this.getAttribute("allow-alphanumeric-input")}get value(){if(!this.phoneNumberValue)return"";if(this.hasDefaultCode){const e=new RegExp(`\\+?${parseInt(this.defaultCountryCode,10)}--?`);return`${this.defaultCountryCode}-${this.phoneNumberInput.value.replace(e,"")}`}return this.phoneNumberInput.value}set value(e){this.phoneNumberInput.value=e}get phoneNumberValue(){return this.phoneNumberInput.value}get phoneNumberInputEle(){return this.phoneNumberInput.shadowRoot.querySelector("input")}get minLength(){return parseInt(this.getAttribute("minlength"),10)||0}get maxLength(){return parseInt(this.getAttribute("maxlength"),10)||50}getValidity(){const e=this.value.replace(/\D/g,"");return this.isRequired&&!this.value?{valueMissing:!0}:e.length<this.minLength?{tooShort:!0}:e.length>this.maxLength?{tooLong:!0}:/^\+?\d{1,4}-?(?:\d-?){1,15}$/.test(this.value)?{}:{patternMismatch:!0}}init(){this.addEventListener("focus",(e=>{e.isTrusted&&this.phoneNumberInput.focus()})),super.init?.(),this.initInputs()}getCountryByDialCode(e){return this.countryCodeInput.items?.find((t=>t.getAttribute("data-country-code")===e))}initInputs(){this.phoneNumberInput.addEventListener("input",(e=>{1===e.target.value.length&&"-"===e.target.value&&(e.target.value=""),e.target.value=e.target.value.replace(/(?!^)\+/g,"").replace("--","-").replace("+-","+");let t=e.target.value;if(!this.allowAlphanumericInput){const o=/^[+\d-]+$/;t=e.target.value.split("").filter((e=>o.test(e))).join("")}e.target.value=t})),this.handleFocusEventsDispatching([this.phoneNumberInput])}attributeChangedCallback(e,t,o){if(super.attributeChangedCallback(e,t,o),t!==o&&l.includes(e)){const t=s[e]||e;this.phoneNumberInput.setAttribute(t,o)}}}},46633:(e,t,o)=>{o.r(t),o(89348);var r=o(43945);customElements.define(r.T,r.A)},87743:(e,t,o)=>{o.r(t),o.d(t,{PhoneFieldInputBoxClass:()=>r.Ul}),o(46633),o(11738),o(89348);var r=o(96800);customElements.define(r.TQ,r.Ul)},63789:(e,t,o)=>{o.d(t,{Q:()=>n});var r=o(44066);const n=e=>r.A.find((t=>t.code===e))?.dialCode},91011:(e,t,o)=>{o(73593),o(97612),o(67239),o(34123);var r=o(80704),n=o(57224);const i=n.AH`
3
3
  :host {
4
4
  outline: none;
5
5
  }
@@ -7,7 +7,7 @@
7
7
  [part='toggle-button']::before {
8
8
  content: var(--lumo-icons-dropdown);
9
9
  }
10
- `;(0,o.SF)("vaadin-combo-box",[i.k,r],{moduleId:"lumo-combo-box"}),n(94009);var a=n(98633),l=n(65211),s=n(38785),d=n(14495);class p extends((0,d.y)((0,o.cp)((0,s.v)(a.Pu)))){static get template(){return a.qy`
10
+ `;(0,n.SF)("vaadin-combo-box",[r.k,i],{moduleId:"lumo-combo-box"}),o(94009);var a=o(98633),l=o(65211),s=o(38785),d=o(14495);class p extends((0,d.y)((0,n.cp)((0,s.v)(a.Pu)))){static get template(){return a.qy`
11
11
  <style>
12
12
  :host {
13
13
  display: block;
@@ -21,7 +21,7 @@
21
21
  <div part="content">
22
22
  <slot></slot>
23
23
  </div>
24
- `}static get is(){return"vaadin-combo-box-item"}}(0,l.X)(p);var u=n(6019),c=n(31146),h=n(31278);const b=o.AH`
24
+ `}static get is(){return"vaadin-combo-box-item"}}(0,l.X)(p);var u=o(6019),c=o(31146),h=o(31278);const b=n.AH`
25
25
  #overlay {
26
26
  width: var(--vaadin-combo-box-overlay-width, var(--_vaadin-combo-box-overlay-default-width, auto));
27
27
  }
@@ -31,13 +31,13 @@
31
31
  flex-direction: column;
32
32
  height: 100%;
33
33
  }
34
- `;(0,o.SF)("vaadin-combo-box-overlay",[c.B,b],{moduleId:"vaadin-combo-box-overlay-styles"});class v extends((0,h.p)((0,u.c)((0,s.v)((0,o.cp)(a.Pu))))){static get is(){return"vaadin-combo-box-overlay"}static get template(){return a.qy`
34
+ `;(0,n.SF)("vaadin-combo-box-overlay",[c.B,b],{moduleId:"vaadin-combo-box-overlay-styles"});class m extends((0,h.p)((0,u.c)((0,s.v)((0,n.cp)(a.Pu))))){static get is(){return"vaadin-combo-box-overlay"}static get template(){return a.qy`
35
35
  <div id="backdrop" part="backdrop" hidden></div>
36
36
  <div part="overlay" id="overlay">
37
37
  <div part="loader"></div>
38
38
  <div part="content" id="content"><slot></slot></div>
39
39
  </div>
40
- `}}(0,l.X)(v);var g=n(82642);class m extends((0,g.N)(a.Pu)){static get is(){return"vaadin-combo-box-scroller"}static get template(){return a.qy`
40
+ `}}(0,l.X)(m);var g=o(82642);class v extends((0,g.N)(a.Pu)){static get is(){return"vaadin-combo-box-scroller"}static get template(){return a.qy`
41
41
  <style>
42
42
  :host {
43
43
  display: block;
@@ -64,7 +64,7 @@
64
64
  <div id="selector">
65
65
  <slot></slot>
66
66
  </div>
67
- `}}(0,l.X)(m);var y=n(27150),f=n(83798),x=n(60354),C=n(21860),w=n(19074),_=n(45446);const I=t=>class extends((0,_.U)(t)){static get properties(){return{pattern:{type:String}}}static get delegateAttrs(){return[...super.delegateAttrs,"pattern"]}static get constraints(){return[...super.constraints,"pattern"]}};var k=n(9685),E=n(79372),T=n(34060);(0,o.SF)("vaadin-combo-box",k.k,{moduleId:"vaadin-combo-box-styles"});class A extends((0,E.K)((0,T.x)(I((0,x.R)((0,o.cp)((0,y.q)(a.Pu))))))){static get is(){return"vaadin-combo-box"}static get template(){return a.qy`
67
+ `}}(0,l.X)(v);var y=o(27150),f=o(83798),x=o(60354),C=o(21860),w=o(19074),I=o(45446);const E=e=>class extends((0,I.U)(e)){static get properties(){return{pattern:{type:String}}}static get delegateAttrs(){return[...super.delegateAttrs,"pattern"]}static get constraints(){return[...super.constraints,"pattern"]}};var T=o(9685),k=o(79372),_=o(34060);(0,n.SF)("vaadin-combo-box",T.k,{moduleId:"vaadin-combo-box-styles"});class S extends((0,k.K)((0,_.x)(E((0,x.R)((0,n.cp)((0,y.q)(a.Pu))))))){static get is(){return"vaadin-combo-box"}static get template(){return a.qy`
68
68
  <style>
69
69
  :host([opened]) {
70
70
  pointer-events: auto;
@@ -110,7 +110,7 @@
110
110
  ></vaadin-combo-box-overlay>
111
111
 
112
112
  <slot name="tooltip"></slot>
113
- `}static get properties(){return{_positionTarget:{type:Object}}}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new C.f(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}))),this.addController(new w.q(this.inputElement,this._labelController)),this._tooltipController=new f.I(this),this.addController(this._tooltipController),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this._tooltipController.setShouldShow((t=>!t.opened)),this._positionTarget=this.shadowRoot.querySelector('[part="input-field"]'),this._toggleElement=this.$.toggleButton}_onClearButtonClick(t){t.stopPropagation(),super._onClearButtonClick(t)}_onHostClick(t){const e=t.composedPath();(e.includes(this._labelNode)||e.includes(this._positionTarget))&&super._onHostClick(t)}}(0,l.X)(A)},60978:(t,e,n)=>{n.d(e,{a:()=>o});var i=n(60354);const o=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()}}},10056:(t,e,n)=>{n.d(e,{A:()=>h}),n(94009);var i=n(98633),o=n(65211),r=n(27150),a=n(83798),l=n(9685),s=n(57224),d=n(21860),p=n(60978),u=n(19074);const c=t=>class extends((0,p.a)(t)){static get properties(){return{maxlength:{type:Number},minlength:{type:Number},pattern:{type:String}}}static get delegateAttrs(){return[...super.delegateAttrs,"maxlength","minlength","pattern"]}static get constraints(){return[...super.constraints,"maxlength","minlength","pattern"]}constructor(){super(),this._setType("text")}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new d.f(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}))),this.addController(new u.q(this.inputElement,this._labelController))}};(0,s.SF)("vaadin-text-field",l.k,{moduleId:"vaadin-text-field-styles"});class h extends(c((0,s.cp)((0,r.q)(i.Pu)))){static get is(){return"vaadin-text-field"}static get template(){return i.qy`
113
+ `}static get properties(){return{_positionTarget:{type:Object}}}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new C.f(this,(e=>{this._setInputElement(e),this._setFocusElement(e),this.stateTarget=e,this.ariaTarget=e}))),this.addController(new w.q(this.inputElement,this._labelController)),this._tooltipController=new f.I(this),this.addController(this._tooltipController),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this._tooltipController.setShouldShow((e=>!e.opened)),this._positionTarget=this.shadowRoot.querySelector('[part="input-field"]'),this._toggleElement=this.$.toggleButton}_onClearButtonClick(e){e.stopPropagation(),super._onClearButtonClick(e)}_onHostClick(e){const t=e.composedPath();(t.includes(this._labelNode)||t.includes(this._positionTarget))&&super._onHostClick(e)}}(0,l.X)(S)},60978:(e,t,o)=>{o.d(t,{a:()=>n});var r=o(60354);const n=e=>class extends((0,r.R)(e)){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(e){this.__dataValue=e}_inputElementChanged(e){super._inputElementChanged(e),e&&(e.value&&e.value!==this.value&&(console.warn(`Please define value on the <${this.localName}> component!`),e.value=""),this.value&&(e.value=this.value))}_setFocused(e){super._setFocused(e),!e&&document.hasFocus()&&this.validate()}_onInput(e){super._onInput(e),this.invalid&&this.validate()}_valueChanged(e,t){super._valueChanged(e,t),void 0!==t&&this.invalid&&this.validate()}}},10056:(e,t,o)=>{o.d(t,{A:()=>h}),o(94009);var r=o(98633),n=o(65211),i=o(27150),a=o(83798),l=o(9685),s=o(57224),d=o(21860),p=o(60978),u=o(19074);const c=e=>class extends((0,p.a)(e)){static get properties(){return{maxlength:{type:Number},minlength:{type:Number},pattern:{type:String}}}static get delegateAttrs(){return[...super.delegateAttrs,"maxlength","minlength","pattern"]}static get constraints(){return[...super.constraints,"maxlength","minlength","pattern"]}constructor(){super(),this._setType("text")}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new d.f(this,(e=>{this._setInputElement(e),this._setFocusElement(e),this.stateTarget=e,this.ariaTarget=e}))),this.addController(new u.q(this.inputElement,this._labelController))}};(0,s.SF)("vaadin-text-field",l.k,{moduleId:"vaadin-text-field-styles"});class h extends(c((0,s.cp)((0,i.q)(r.Pu)))){static get is(){return"vaadin-text-field"}static get template(){return r.qy`
114
114
  <style>
115
115
  [part='input-field'] {
116
116
  flex-grow: 0;
@@ -145,4 +145,4 @@
145
145
  </div>
146
146
  </div>
147
147
  <slot name="tooltip"></slot>
148
- `}static get properties(){return{maxlength:{type:Number},minlength:{type:Number}}}ready(){super.ready(),this._tooltipController=new a.I(this),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this.addController(this._tooltipController)}}(0,o.X)(h)},44085:(t,e,n)=>{n(67239);var i=n(80704);(0,n(57224).SF)("vaadin-text-field",i.k,{moduleId:"lumo-text-field-styles"}),n(10056)},63970:(t,e,n)=>{n(44085),n(10056)}}]);
148
+ `}static get properties(){return{maxlength:{type:Number},minlength:{type:Number}}}ready(){super.ready(),this._tooltipController=new a.I(this),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this.addController(this._tooltipController)}}(0,n.X)(h)},44085:(e,t,o)=>{o(67239);var r=o(80704);(0,o(57224).SF)("vaadin-text-field",r.k,{moduleId:"lumo-text-field-styles"}),o(10056)},63970:(e,t,o)=>{o(44085),o(10056)}}]);
@@ -29,6 +29,9 @@
29
29
  },
30
30
  "./sb-controls": {
31
31
  "import": "./src/sbControls.js"
32
+ },
33
+ "./sb-helpers": {
34
+ "import": "./src/sbHelpers.js"
32
35
  }
33
36
  }
34
37
  }
@@ -20,6 +20,8 @@ const booleanAttributesList = [
20
20
  'opening',
21
21
  'closing',
22
22
  'has-no-options',
23
+ 'loading',
24
+ 'allow-custom-value',
23
25
  ];
24
26
 
25
27
  const isBooleanAttribute = (attr) => {
@@ -0,0 +1,53 @@
1
+ export const withForm = (children) => {
2
+ return `
3
+ <form onsubmit="event.preventDefault()">
4
+ <div>${children}</div>
5
+ <div style="margin-top: 6em">
6
+ <button type="submit" data-testid="submit-button">Submit</button>
7
+ </div>
8
+ </form>
9
+ `;
10
+ };
11
+
12
+ export const appleIcon = `
13
+ <svg
14
+ width="1.5em"
15
+ height="1.5em"
16
+ viewBox="0 0 800 1000"
17
+ xmlns="http://www.w3.org/2000/svg"
18
+ fill="white"
19
+ data-icon="apple"
20
+ >
21
+ <path
22
+ d="M788.1 340.9c-5.8 4.5-108.2 62.2-108.2 190.5 0 148.4 130.3 200.9 134.2 202.2-.6 3.2-20.7 71.9-68.7 141.9-42.8 61.6-87.5 123.1-155.5 123.1s-85.5-39.5-164-39.5c-76.5 0-103.7 40.8-165.9 40.8s-105.6-57-155.5-127C46.7 790.7 0 663 0 541.8c0-194.4 126.4-297.5 250.8-297.5 66.1 0 121.2 43.4 162.7 43.4 39.5 0 101.1-46 176.3-46 28.5 0 130.9 2.6 198.3 99.2zm-234-181.5c31.1-36.9 53.1-88.1 53.1-139.3 0-7.1-.6-14.3-1.9-20.1-50.6 1.9-110.8 33.7-147.1 75.8-28.5 32.4-55.1 83.6-55.1 135.5 0 7.8 1.3 15.6 1.9 18.1 3.2.6 8.4 1.3 13.6 1.3 45.4 0 102.5-30.4 135.5-71.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TggMjQuMjkyIDE5LjM2MTEgMjQuMDgzNyAxOS40OTk4IDIzLjkxN0MxOS42Mzg0IDIzLjc1MDMgMTkuODMyOCAyMy42NjcgMjAuMDgyOCAyMy42NjdDMjAuMzMyOCAyMy42NjcgMjAuNTI3NCAyMy43NTAzIDIwLjY2NjggMjMuOTE3QzIwLjgwNTQgMjQuMDgzNyAyMC44NzQ4IDI0LjI5MiAyMC44NzQ4IDI0LjU0MkMyMC44NzQ4IDI2Ljg0NzMgMjEuNjU5NCAyOC42NTI3IDIzLjIyODggMjkuOTU4QzI0Ljc5ODEgMzEuMjY0IDI2LjY1MjQgMzEuOTE3IDI4Ljc5MTggMzEuOTE3QzI5LjA0MTggMzEuOTE3IDI5LjMzMzQgMzEuODk2IDI5LjY2NjggMzEuODU0QzMwLjAwMDEgMzEuODEyNyAzMC4zMzM0IDMxLjc3OCAzMC42NjY4IDMxLjc1QzMwLjg4ODggMzEuNzIyIDMxLjA3NjEgMzEuNzc3NyAzMS4yMjg4IDMxLjkxN0MzMS4zODE0IDMyLjA1NTcgMzEuNDU3OCAzMi4yMDgzIDMxLjQ1NzggMzIuMzc1QzMxLjQ4NTggMzIuNTk3IDMxLjQ0NDEgMzIuNzc3NyAzMS4zMzI4IDMyLjkxN0MzMS4yMjIxIDMzLjA1NTcgMzEuMDgzNCAzMy4xNTI3IDMwLjkxNjggMzMuMjA4QzMwLjQ3MjEgMzMuMzQ3MyAzMC4wNTU0IDMzLjQzMDcgMjkuNjY2OCAzMy40NThDMjkuMjc3NCAzMy40ODYgMjguOTg1OCAzMy41IDI4Ljc5MTggMzMuNVoiIGZpbGw9ImJsYWNrIi8+CjwvZz4KPC9zdmc+Cg==`;
27
+
28
+ export const googleIcon = `
29
+ <svg
30
+ width="1.5em"
31
+ height="1.5em"
32
+ viewBox="0 0 20 20"
33
+ xmlns="http://www.w3.org/2000/svg"
34
+ fill=""
35
+ data-icon="google"
36
+ >
37
+ <path
38
+ d="m19.6 10.2274c0-.70912-.0636-1.39092-.1818-2.04552h-9.4182v3.86822h5.3818c-.2318 1.25-.9363 2.3091-1.9954 3.0182v2.5091h3.2318c1.8909-1.7409 2.9818-4.3046 2.9818-7.35z"
39
+ fill="#4285f4"
40
+ />
41
+ <path
42
+ d="m10 19.9999c2.7 0 4.9636-.8955 6.6181-2.4227l-3.2318-2.5091c-.8954.6-2.0409.9545-3.3863.9545-2.6046 0-4.8091-1.7591-5.5955-4.1227h-3.3409v2.5909c1.6455 3.2682 5.0273 5.5091 8.9364 5.5091z"
43
+ fill="#34a853"
44
+ />
45
+ <path
46
+ d="m4.4045 11.8999c-.2-.6-.3136-1.2409-.3136-1.89997 0-.6591.1136-1.3.3136-1.9v-2.5909h-3.3409c-.6772 1.35-1.0636 2.8773-1.0636 4.4909 0 1.61357.3864 3.14087 1.0636 4.49087z"
47
+ fill="#fbbc04"
48
+ />
49
+ <path
50
+ d="m10 3.9773c1.4681 0 2.7863.5045 3.8227 1.4954l2.8682-2.8682c-1.7318-1.6136-3.9955-2.6045-6.6909-2.6045-3.9091 0-7.2909 2.2409-8.9364 5.5091l3.3409 2.5909c.7864-2.3636 2.9909-4.1227 5.5955-4.1227z"
51
+ fill="#e94235"
52
+ />
53
+ </svg>`;
@@ -1,5 +1,9 @@
1
1
  import merge from 'lodash.merge';
2
- import { BASE_THEME_SECTION, DESCOPE_PREFIX, PORTAL_THEME_PREFIX } from '../constants';
2
+ import {
3
+ BASE_THEME_SECTION,
4
+ DESCOPE_PREFIX,
5
+ PORTAL_THEME_PREFIX,
6
+ } from '../constants';
3
7
  import { isUrl, kebabCase } from '../utils';
4
8
  import { getComponentName, getCssVarName } from '../componentsHelpers';
5
9
 
@@ -48,16 +52,18 @@ export const themeToCSSVarsObj = (theme) =>
48
52
 
49
53
  export const getThemeRefs = (theme, prefix) =>
50
54
  transformTheme(theme, [], (path) =>
51
- set({}, path, `var(${getVarName(prefix ? [prefix, ...path] : path)})`)
55
+ set({}, path, `var(${getVarName(prefix ? [prefix, ...path] : path)})`),
52
56
  );
53
57
 
54
58
  export const getThemeVars = (theme, prefix) =>
55
- transformTheme(theme, [], (path) => set({}, path, getVarName(prefix ? [prefix, ...path] : path)));
59
+ transformTheme(theme, [], (path) =>
60
+ set({}, path, getVarName(prefix ? [prefix, ...path] : path)),
61
+ );
56
62
 
57
63
  export const globalsThemeToStyle = (theme, themeName = '') => {
58
64
  const style = Object.entries(themeToCSSVarsObj(theme)).reduce(
59
65
  (acc, entry) => `${acc}${entry.join(':')};\n`,
60
- ''
66
+ '',
61
67
  );
62
68
 
63
69
  if (!themeName) return style;
@@ -73,7 +79,10 @@ const componentsThemeToStyleObj = (componentsTheme) =>
73
79
 
74
80
  if (property === 'undefined') {
75
81
  // eslint-disable-next-line no-console
76
- console.warn(componentName, `theme value: "${val}" is mapped to an invalid property`);
82
+ console.warn(
83
+ componentName,
84
+ `theme value: "${val}" is mapped to an invalid property`,
85
+ );
77
86
  }
78
87
 
79
88
  // we need a support for portal components theme (e.g. overlay)
@@ -89,7 +98,8 @@ const componentsThemeToStyleObj = (componentsTheme) =>
89
98
  // do not start with underscore -> key:value, must have 2 no underscore attrs in a row
90
99
  // starts with underscore -> attribute selector
91
100
  const attrsSelector = restPath.reduce((acc, section, idx) => {
92
- if (section.startsWith('_')) return `${acc}[${kebabCase(section.replace(/^_/, ''))}="true"]`;
101
+ if (section.startsWith('_'))
102
+ return `${acc}[${kebabCase(section.replace(/^_/, ''))}="true"]`;
93
103
 
94
104
  const nextSection = restPath[idx + 1];
95
105
 
@@ -97,12 +107,14 @@ const componentsThemeToStyleObj = (componentsTheme) =>
97
107
  // eslint-disable-next-line no-console
98
108
  console.error(
99
109
  'theme generator',
100
- `your theme structure is invalid, attribute "${section}" is followed by "${nextSection}" which is not allowed`
110
+ `your theme structure is invalid, attribute "${section}" is followed by "${nextSection}" which is not allowed`,
101
111
  );
102
112
  return acc;
103
113
  }
104
114
 
105
- return `${acc}[${kebabCase(section)}="${restPath.splice(idx + 1, 1).join('')}"]`;
115
+ return `${acc}[${kebabCase(section)}="${restPath
116
+ .splice(idx + 1, 1)
117
+ .join('')}"]`;
106
118
  }, '');
107
119
 
108
120
  const selector = `:host${attrsSelector ? `(${attrsSelector})` : ''}`;
@@ -124,7 +136,7 @@ const componentsThemeToStyle = (componentsTheme) =>
124
136
  `${acc}${selector} { \n${Object.entries(vars)
125
137
  .map(([key, val]) => `${key}: ${val}`)
126
138
  .join(';\n')} \n}\n\n`,
127
- ''
139
+ '',
128
140
  );
129
141
 
130
142
  export const createComponentsTheme = (componentsTheme) => {
@@ -136,8 +148,10 @@ export const createComponentsTheme = (componentsTheme) => {
136
148
  return Object.assign(acc, {
137
149
  [componentName]: Object.keys(componentThemes).reduce(
138
150
  (res, theme) =>
139
- Object.assign(res, { [theme]: componentsThemeToStyle(componentThemes[theme]) }),
140
- {}
151
+ Object.assign(res, {
152
+ [theme]: componentsThemeToStyle(componentThemes[theme]),
153
+ }),
154
+ {},
141
155
  ),
142
156
  });
143
157
  }, {});
@@ -174,3 +188,4 @@ export const createHelperVars = (theme, prefix) => {
174
188
 
175
189
  export { componentsThemeManager } from './componentsThemeManager';
176
190
  export * from './colorsHelpers';
191
+ export * from './resetHelpers';
@@ -0,0 +1,144 @@
1
+ export const useHostExternalPadding = (cssVarList) => `
2
+ :host {
3
+ padding: calc(var(${cssVarList.inputOutlineWidth}) + var(${cssVarList.inputOutlineOffset}))
4
+ }
5
+ `;
6
+
7
+ export const resetInputFieldUnderlayingBorder = (name) => `
8
+ ${name}::part(input-field)::after {
9
+ border: none;
10
+ }
11
+ `;
12
+
13
+ export const resetInitialHeight = (name) => `
14
+ ${name}::before {
15
+ height: unset;
16
+ }
17
+ `;
18
+
19
+ export const resetInputElement = (name) => `
20
+ ${name} > input {
21
+ -webkit-mask-image: none;
22
+ min-height: 0;
23
+ box-sizing: border-box;
24
+ }
25
+ `;
26
+
27
+ export const resetInputContainer = (name) => `
28
+ ${name} {
29
+ margin: 0;
30
+ padding: 0;
31
+ width: 100%;
32
+ height: 100%;
33
+ box-sizing: border-box;
34
+ }
35
+ `;
36
+
37
+ export const resetInputField = (name) => `
38
+ ${name}::part(input-field) {
39
+ overflow: hidden;
40
+ padding: 0;
41
+ box-shadow: none;
42
+ }
43
+ `;
44
+
45
+ export const resetInputCursor = (name) => `
46
+ ${name} > label,
47
+ ${name}::part(label),
48
+ ${name}::part(required-indicator) {
49
+ cursor: pointer;
50
+ }
51
+ `;
52
+
53
+ export const resetInputPlaceholder = (name, ele = 'input') => `
54
+ ${name}[disabled] > ${ele}:placeholder-shown,
55
+ ${name}[readonly] > ${ele}:placeholder-shown {
56
+ opacity: 1;
57
+ }
58
+ `;
59
+
60
+ export const resetInputAutoFill = (name, cssVarList) => `
61
+ ${name} input:-webkit-autofill,
62
+ ${name} input:-webkit-autofill::first-line,
63
+ ${name} input:-webkit-autofill:hover,
64
+ ${name} input:-webkit-autofill:active,
65
+ ${name} input:-webkit-autofill:focus {
66
+ -webkit-text-fill-color: var(${cssVarList.inputValueTextColor});
67
+ box-shadow: 0 0 0 var(${cssVarList.inputHeight}) var(${cssVarList.inputBackgroundColor}) inset;
68
+ }
69
+ `;
70
+
71
+ export const resetInputFieldDefaultWidth = () => `
72
+ :host {
73
+ --vaadin-field-default-width: auto;
74
+ box-sizing: border-box;
75
+ }
76
+ `;
77
+
78
+ export const resetInputReadonlyStyle = (name) => `
79
+ ${name}::part(input-field)::after {
80
+ opacity: 0;
81
+ }
82
+ `;
83
+
84
+ export const resetInputFieldInvalidBackgroundColor = (name) => `
85
+ ${name}::part(input-field)::after {
86
+ background: none;
87
+ }
88
+ `;
89
+
90
+ export const resetInputOverrides = (name, cssVarList) => `
91
+ ${resetInputContainer(name)}
92
+ ${resetInputCursor(name)}
93
+ ${resetInputPlaceholder(name)}
94
+ ${resetInputField(name)}
95
+ ${resetInputAutoFill(name, cssVarList)}
96
+ ${resetInputFieldInvalidBackgroundColor(name)}
97
+ ${resetInitialHeight(name)}
98
+ ${resetInputElement(name)}
99
+ ${resetInputFieldUnderlayingBorder(name)}
100
+ `;
101
+
102
+ // This function is used to support RTL correctly for input components.
103
+ // It also fixes the error message to be displayed LTR since we currently
104
+ // don't support RTL for error messages.
105
+ export const resetInputLabelPosition = (name) => `
106
+ :host ::part(error-message) {
107
+ direction: ltr;
108
+ }
109
+ :host([required]) ::part(required-indicator) {
110
+ width: 1em;
111
+ display: inline-flex;
112
+ }
113
+ :host([required]) ::part(required-indicator)::after {
114
+ position: static;
115
+ }
116
+ :host([has-label]) ::part(label) {
117
+ padding-right: 0;
118
+ padding-bottom: 0;
119
+ display: flex;
120
+ width: 100%;
121
+ }
122
+ ${name} [slot="label"] {
123
+ max-width: calc(100% - 1em);
124
+ overflow: hidden;
125
+ text-overflow: ellipsis;
126
+ padding-bottom: 0.5em;
127
+ }
128
+ `;
129
+
130
+ export const inputFloatingLabelStyle = () => {
131
+ return `
132
+ :host([label-type="floating"]) {
133
+ position: relative;
134
+ }
135
+ :host([label-type="floating"][has-label]) [slot="label"] {
136
+ padding: 0;
137
+ }
138
+ :host([label-type="floating"][has-label]) > ::part(label) {
139
+ z-index: 1;
140
+ padding: 0;
141
+ width: auto;
142
+ }
143
+ `;
144
+ };