@descope/web-components-ui 1.0.418 → 1.0.420
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 +1439 -1355
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.esm.js +1983 -1091
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/1172.js +240 -0
- package/dist/umd/{8162.js → 1396.js} +3 -3
- package/dist/umd/1402.js +1 -0
- package/dist/umd/1484.js +148 -0
- package/dist/umd/{5026.js → 189.js} +5 -117
- package/dist/umd/{6637.js → 201.js} +5 -5
- package/dist/umd/{1053.js → 2159.js} +13 -13
- package/dist/umd/2540.js +1 -0
- package/dist/umd/2570.js +338 -0
- package/dist/umd/2666.js +148 -0
- package/dist/umd/3110.js +275 -0
- package/dist/umd/{9167.js → 3191.js} +66 -12
- package/dist/umd/3437.js +2 -0
- package/dist/umd/{6418.js → 3638.js} +2 -2
- package/dist/umd/{7212.js → 404.js} +8 -8
- package/dist/umd/4114.js +124 -0
- package/dist/umd/{7607.js → 4127.js} +9 -9
- package/dist/umd/4187.js +2 -0
- package/dist/umd/4218.js +129 -0
- package/dist/umd/4455.js +422 -0
- package/dist/umd/4480.js +1 -1
- package/dist/umd/{5086.js → 4554.js} +5 -5
- package/dist/umd/{4834.js → 4574.js} +5 -5
- package/dist/umd/4619.js +1 -1
- package/dist/umd/4902.js +170 -0
- package/dist/umd/{5273.js → 507.js} +5 -5
- package/dist/umd/5096.js +109 -0
- package/dist/umd/5318.js +1 -0
- package/dist/umd/5414.js +2 -0
- package/dist/umd/5414.js.LICENSE.txt +1 -0
- package/dist/umd/{8164.js → 5563.js} +5 -5
- package/dist/umd/{7824.js → 7097.js} +5 -117
- package/dist/umd/7150.js +2 -0
- package/dist/umd/7150.js.LICENSE.txt +485 -0
- package/dist/umd/731.js +832 -0
- package/dist/umd/742.js +2 -0
- package/dist/umd/{351.js → 7979.js} +10 -10
- package/dist/umd/8823.js +1 -0
- package/dist/umd/{6474.js → 9030.js} +12 -12
- package/dist/umd/9243.js +202 -0
- package/dist/umd/9243.js.LICENSE.txt +51 -0
- package/dist/umd/{5443.js → 9478.js} +5 -117
- package/dist/umd/DescopeDev.js +1 -2
- package/dist/umd/boolean-fields-descope-checkbox-index-js.js +1 -1
- package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js +1 -1
- package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-index-js.js +1 -1
- package/dist/umd/button-selection-group-fields-descope-button-selection-group-index-js.js +1 -1
- package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js +1 -1
- package/dist/umd/descope-alert-index-js.js +1 -1
- package/dist/umd/descope-apps-list-index-js.js +1 -1
- package/dist/umd/descope-avatar.js +1 -0
- package/dist/umd/descope-button-index-js.js +4 -116
- package/dist/umd/descope-code-snippet-index-js.js +1 -1
- package/dist/umd/descope-combo-box-index-js.js +5 -5
- package/dist/umd/descope-date-field-descope-calendar-index-js.js +1 -1
- package/dist/umd/descope-date-field-index-js.js +1 -1
- package/dist/umd/descope-divider-index-js.js +1 -1
- package/dist/umd/descope-email-field-index-js.js +4 -4
- package/dist/umd/descope-enriched-text-index-js.js +1 -1
- package/dist/umd/descope-grid-descope-grid-custom-column-index-js.js +4 -4
- package/dist/umd/descope-grid-descope-grid-item-details-column-index-js.js +19 -4
- package/dist/umd/descope-grid-descope-grid-item-details-column-index-js.js.LICENSE.txt +12 -0
- package/dist/umd/descope-grid-descope-grid-selection-column-index-js.js +1 -1
- package/dist/umd/descope-grid-descope-grid-text-column-index-js.js +4 -4
- package/dist/umd/descope-grid-index-js.js +1 -1
- package/dist/umd/descope-hybrid-field-index-js.js +3 -3
- package/dist/umd/descope-icon-index-js.js +1 -1
- package/dist/umd/descope-link-index-js.js +1 -1
- package/dist/umd/descope-modal-index-js.js +1 -1
- package/dist/umd/descope-multi-select-combo-box-index-js.js +1 -1
- package/dist/umd/descope-new-password-index-js.js +1 -1
- package/dist/umd/descope-notification-descope-notification-card-index-js.js +1 -1
- package/dist/umd/descope-notification-index-js.js +1 -1
- package/dist/umd/descope-number-field-index-js.js +1 -1
- package/dist/umd/descope-passcode-descope-passcode-internal-index-js.js +1 -1
- package/dist/umd/descope-passcode-index-js.js +1 -1
- package/dist/umd/descope-password-index-js.js +1 -1
- package/dist/umd/descope-radio-group-index-js.js +1 -1
- package/dist/umd/descope-scopes-list-index-js.js +1 -1
- package/dist/umd/descope-security-questions-setup-index-js.js +1 -1
- package/dist/umd/descope-security-questions-verify-index-js.js +2 -2
- package/dist/umd/descope-text-area-index-js.js +1 -1
- package/dist/umd/descope-text-field-index-js.js +2 -2
- package/dist/umd/descope-text.js +1 -0
- package/dist/umd/descope-third-party-app-logo-index-js.js +1 -1
- package/dist/umd/descope-upload-file-index-js.js +1 -1
- package/dist/umd/descope-user-attribute-index-js.js +1 -1
- package/dist/umd/descope-user-auth-method-index-js.js +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -1
- package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js +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-index-js.js +1 -1
- package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js +2 -2
- package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js +7 -7
- package/node_modules/common/.eslintrc.json +18 -0
- package/node_modules/common/README.md +7 -0
- package/node_modules/common/package.json +34 -0
- package/node_modules/common/project.json +7 -0
- package/node_modules/common/src/baseClasses/baseClasses/createBaseClass.js +66 -0
- package/node_modules/common/src/baseClasses/baseClasses/createBaseInputClass.js +14 -0
- package/node_modules/common/src/baseClasses/baseClasses/createCssVarImageClass.js +55 -0
- package/node_modules/common/src/baseClasses/index.js +3 -0
- package/node_modules/common/src/componentsHelpers/index.js +95 -0
- package/node_modules/common/src/componentsMixins/helpers/mixinsHelpers.js +10 -0
- package/node_modules/common/src/componentsMixins/index.js +1 -0
- package/node_modules/common/src/componentsMixins/mixins/activableMixin.js +14 -0
- package/node_modules/common/src/componentsMixins/mixins/changeMixin.js +22 -0
- package/node_modules/common/src/componentsMixins/mixins/componentNameValidationMixin.js +23 -0
- package/node_modules/common/src/componentsMixins/mixins/componentsContextMixin.js +12 -0
- package/node_modules/common/src/componentsMixins/mixins/createDynamicDataMixin.js +100 -0
- package/node_modules/common/src/componentsMixins/mixins/createProxy.js +58 -0
- package/node_modules/common/src/componentsMixins/mixins/createStyleMixin/helpers.js +106 -0
- package/node_modules/common/src/componentsMixins/mixins/createStyleMixin/index.js +167 -0
- package/node_modules/common/src/componentsMixins/mixins/draggableMixin.js +62 -0
- package/node_modules/common/src/componentsMixins/mixins/externalInputHelpers.js +93 -0
- package/node_modules/common/src/componentsMixins/mixins/externalInputMixin.js +170 -0
- package/node_modules/common/src/componentsMixins/mixins/hoverableMixin.js +13 -0
- package/node_modules/common/src/componentsMixins/mixins/index.js +14 -0
- package/node_modules/common/src/componentsMixins/mixins/inputEventsDispatchingMixin.js +76 -0
- package/node_modules/common/src/componentsMixins/mixins/inputValidationMixin.js +210 -0
- package/node_modules/common/src/componentsMixins/mixins/lifecycleEventsMixin.js +23 -0
- package/node_modules/common/src/componentsMixins/mixins/normalizeBooleanAttributesMixin.js +57 -0
- package/node_modules/common/src/componentsMixins/mixins/portalMixin.js +112 -0
- package/node_modules/common/src/componentsMixins/mixins/proxyInputMixin.js +242 -0
- package/node_modules/common/src/constants.js +4 -0
- package/node_modules/common/src/icons/errorMessageIconBase64.js +1 -0
- package/node_modules/common/src/sbControls.js +302 -0
- package/node_modules/common/src/themeHelpers/colorsHelpers.js +94 -0
- package/node_modules/common/src/themeHelpers/index.js +176 -0
- package/node_modules/common/src/utils/index.js +68 -0
- package/node_modules/descope-avatar/e2e/descope-avatar.spec.ts +54 -0
- package/node_modules/descope-avatar/package.json +34 -0
- package/node_modules/descope-avatar/project.json +7 -0
- package/{src/components/descope-avatar → node_modules/descope-avatar/src/component}/AvatarClass.js +4 -4
- package/{src/theme/components/avatar.js → node_modules/descope-avatar/src/theme.js} +3 -3
- package/node_modules/descope-avatar/stories/avatar.jpeg +0 -0
- package/node_modules/descope-avatar/stories/descope-avatar.stories.js +32 -0
- package/node_modules/descope-text/e2e/descope-text.spec.ts +35 -0
- package/node_modules/descope-text/package.json +31 -0
- package/node_modules/descope-text/project.json +7 -0
- package/{src/components/descope-text → node_modules/descope-text/src/component}/TextClass.js +4 -4
- package/{src/theme/components/text.js → node_modules/descope-text/src/theme.js} +3 -3
- package/node_modules/descope-text/stories/descope-text.stories.js +55 -0
- package/package.json +52 -43
- package/src/components/descope-alert/AlertClass.js +1 -1
- package/src/components/descope-apps-list/AppsListClass.js +1 -1
- package/src/components/descope-apps-list/index.js +2 -2
- package/src/components/descope-divider/DividerClass.js +1 -1
- package/src/components/descope-divider/index.js +1 -1
- package/src/components/descope-link/LinkClass.js +1 -1
- package/src/components/descope-link/index.js +1 -1
- package/src/components/descope-security-questions-verify/SecurityQuestionsVerifyClass.js +1 -1
- package/src/components/descope-security-questions-verify/index.js +1 -1
- package/src/components/descope-user-attribute/UserAttributeClass.js +1 -1
- package/src/components/descope-user-attribute/index.js +1 -1
- package/src/components/descope-user-auth-method/UserAuthMethodClass.js +1 -1
- package/src/components/descope-user-auth-method/index.js +1 -1
- package/src/components/mapping-fields/descope-mappings-field/MappingsFieldClass.js +1 -1
- package/src/components/mapping-fields/descope-mappings-field/index.js +1 -1
- package/src/helpers/themeHelpers/index.js +1 -1
- package/src/index.cjs.js +2 -2
- package/src/index.d.ts +0 -2
- package/src/index.js +2 -2
- package/src/index.umd.js +3 -1
- package/src/mixins/createStyleMixin/index.js +1 -1
- package/src/theme/components/alert.js +1 -1
- package/src/theme/components/comboBox.js +2 -2
- package/src/theme/components/enrichedText.js +1 -1
- package/src/theme/components/index.js +2 -2
- package/dist/umd/1033.js +0 -2
- package/dist/umd/1414.js +0 -352
- package/dist/umd/1437.js +0 -422
- package/dist/umd/1672.js +0 -1
- package/dist/umd/2566.js +0 -2
- package/dist/umd/2838.js +0 -2
- package/dist/umd/2838.js.LICENSE.txt +0 -1
- package/dist/umd/286.js +0 -148
- package/dist/umd/2919.js +0 -832
- package/dist/umd/3222.js +0 -282
- package/dist/umd/3607.js +0 -2
- package/dist/umd/3711.js +0 -123
- package/dist/umd/5412.js +0 -109
- package/dist/umd/650.js +0 -1
- package/dist/umd/6726.js +0 -148
- package/dist/umd/7407.js +0 -450
- package/dist/umd/8980.js +0 -143
- package/dist/umd/8980.js.LICENSE.txt +0 -29
- package/dist/umd/9632.js +0 -275
- package/dist/umd/9878.js +0 -1
- package/dist/umd/9895.js +0 -17
- package/dist/umd/DescopeDev.js.LICENSE.txt +0 -1
- package/dist/umd/bcdfe87ae253c2cf789c9a737f8d8c22.woff +0 -0
- package/dist/umd/descope-avatar-index-js.js +0 -1
- package/dist/umd/descope-text-index-js.js +0 -1
- /package/dist/umd/{1414.js.LICENSE.txt → 1172.js.LICENSE.txt} +0 -0
- /package/dist/umd/{1437.js.LICENSE.txt → 1396.js.LICENSE.txt} +0 -0
- /package/dist/umd/{6726.js.LICENSE.txt → 1484.js.LICENSE.txt} +0 -0
- /package/dist/umd/{286.js.LICENSE.txt → 189.js.LICENSE.txt} +0 -0
- /package/dist/umd/{6637.js.LICENSE.txt → 201.js.LICENSE.txt} +0 -0
- /package/dist/umd/{1053.js.LICENSE.txt → 2159.js.LICENSE.txt} +0 -0
- /package/dist/umd/{351.js.LICENSE.txt → 2570.js.LICENSE.txt} +0 -0
- /package/dist/umd/{5026.js.LICENSE.txt → 2666.js.LICENSE.txt} +0 -0
- /package/dist/umd/{9632.js.LICENSE.txt → 3110.js.LICENSE.txt} +0 -0
- /package/dist/umd/{9167.js.LICENSE.txt → 3191.js.LICENSE.txt} +0 -0
- /package/dist/umd/{1033.js.LICENSE.txt → 3437.js.LICENSE.txt} +0 -0
- /package/dist/umd/{6418.js.LICENSE.txt → 3638.js.LICENSE.txt} +0 -0
- /package/dist/umd/{7212.js.LICENSE.txt → 404.js.LICENSE.txt} +0 -0
- /package/dist/umd/{3711.js.LICENSE.txt → 4114.js.LICENSE.txt} +0 -0
- /package/dist/umd/{7607.js.LICENSE.txt → 4127.js.LICENSE.txt} +0 -0
- /package/dist/umd/{3607.js.LICENSE.txt → 4187.js.LICENSE.txt} +0 -0
- /package/dist/umd/{3222.js.LICENSE.txt → 4218.js.LICENSE.txt} +0 -0
- /package/dist/umd/{5086.js.LICENSE.txt → 4455.js.LICENSE.txt} +0 -0
- /package/dist/umd/{5273.js.LICENSE.txt → 4554.js.LICENSE.txt} +0 -0
- /package/dist/umd/{4834.js.LICENSE.txt → 4574.js.LICENSE.txt} +0 -0
- /package/dist/umd/{9895.js.LICENSE.txt → 4902.js.LICENSE.txt} +0 -0
- /package/dist/umd/{5443.js.LICENSE.txt → 507.js.LICENSE.txt} +0 -0
- /package/dist/umd/{5412.js.LICENSE.txt → 5096.js.LICENSE.txt} +0 -0
- /package/dist/umd/{8164.js.LICENSE.txt → 5563.js.LICENSE.txt} +0 -0
- /package/dist/umd/{7407.js.LICENSE.txt → 7097.js.LICENSE.txt} +0 -0
- /package/dist/umd/{2919.js.LICENSE.txt → 731.js.LICENSE.txt} +0 -0
- /package/dist/umd/{2566.js.LICENSE.txt → 742.js.LICENSE.txt} +0 -0
- /package/dist/umd/{7824.js.LICENSE.txt → 7979.js.LICENSE.txt} +0 -0
- /package/dist/umd/{6474.js.LICENSE.txt → 9030.js.LICENSE.txt} +0 -0
- /package/dist/umd/{8162.js.LICENSE.txt → 9478.js.LICENSE.txt} +0 -0
- /package/{src/helpers → node_modules/common/src}/themeHelpers/componentsThemeManager.js +0 -0
- /package/{src/components/descope-avatar → node_modules/descope-avatar/src/component}/index.js +0 -0
- /package/{src/components/descope-text → node_modules/descope-text/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([[4043,7052,7212],{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(39542),n(66418),n(56637);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},31111:(t,e,n)=>{n(46165),n(14968),n(37451),n(72815);var i=n(90500),o=n(6052);const r=o.AH`
|
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`
|
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(
|
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`
|
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(
|
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`
|
25
25
|
#overlay {
|
26
26
|
width: var(--vaadin-combo-box-overlay-width, var(--_vaadin-combo-box-overlay-default-width, auto));
|
27
27
|
}
|
@@ -37,7 +37,7 @@
|
|
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(
|
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`
|
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(
|
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`
|
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)},
|
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`
|
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)},
|
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)}}]);
|
@@ -0,0 +1,18 @@
|
|
1
|
+
{
|
2
|
+
"extends": ["../../../.eslintrc.json"],
|
3
|
+
"ignorePatterns": ["!**/*"],
|
4
|
+
"overrides": [
|
5
|
+
{
|
6
|
+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
7
|
+
"rules": {}
|
8
|
+
},
|
9
|
+
{
|
10
|
+
"files": ["*.ts", "*.tsx"],
|
11
|
+
"rules": {}
|
12
|
+
},
|
13
|
+
{
|
14
|
+
"files": ["*.js", "*.jsx"],
|
15
|
+
"rules": {}
|
16
|
+
}
|
17
|
+
]
|
18
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
{
|
2
|
+
"name": "common",
|
3
|
+
"version": "0.0.1",
|
4
|
+
"dependencies": {
|
5
|
+
"element-internals-polyfill": "^1.3.9",
|
6
|
+
"color": "^4.2.3",
|
7
|
+
"lodash.merge": "4.6.2"
|
8
|
+
},
|
9
|
+
"private": true,
|
10
|
+
"exports": {
|
11
|
+
"./constants": {
|
12
|
+
"import": "./src/constants.js"
|
13
|
+
},
|
14
|
+
"./utils": {
|
15
|
+
"import": "./src/utils/index.js"
|
16
|
+
},
|
17
|
+
"./theme-helpers": {
|
18
|
+
"import": "./src/themeHelpers/index.js",
|
19
|
+
"require": "./src/themeHelpers/index.js"
|
20
|
+
},
|
21
|
+
"./components-mixins": {
|
22
|
+
"import": "./src/componentsMixins/index.js"
|
23
|
+
},
|
24
|
+
"./base-classes": {
|
25
|
+
"import": "./src/baseClasses/index.js"
|
26
|
+
},
|
27
|
+
"./components-helpers": {
|
28
|
+
"import": "./src/componentsHelpers/index.js"
|
29
|
+
},
|
30
|
+
"./sb-controls": {
|
31
|
+
"import": "./src/sbControls.js"
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
@@ -0,0 +1,66 @@
|
|
1
|
+
import { compose } from '../../utils';
|
2
|
+
import { componentNameValidationMixin } from '../../componentsMixins/mixins/componentNameValidationMixin';
|
3
|
+
import { componentsContextMixin } from '../../componentsMixins/mixins/componentsContextMixin';
|
4
|
+
import { hoverableMixin } from '../../componentsMixins/mixins/hoverableMixin';
|
5
|
+
import { normalizeBooleanAttributesMixin } from '../../componentsMixins/mixins/normalizeBooleanAttributesMixin';
|
6
|
+
|
7
|
+
export const createBaseClass = ({ componentName, baseSelector = '' }) => {
|
8
|
+
class DescopeBaseClass extends HTMLElement {
|
9
|
+
static get componentName() {
|
10
|
+
return componentName;
|
11
|
+
}
|
12
|
+
|
13
|
+
#baseElement;
|
14
|
+
|
15
|
+
#isInit = true;
|
16
|
+
|
17
|
+
// base selector is the selector for the component wrapper,
|
18
|
+
// it's the highest element that is relevant for the layout
|
19
|
+
// eslint-disable-next-line class-methods-use-this
|
20
|
+
get baseSelector() {
|
21
|
+
return baseSelector;
|
22
|
+
}
|
23
|
+
|
24
|
+
// this is the base element, which returned by querying the base selector
|
25
|
+
get baseElement() {
|
26
|
+
this.#baseElement ??= this.baseSelector
|
27
|
+
? this.rootElement.querySelector(this.baseSelector)
|
28
|
+
: this;
|
29
|
+
|
30
|
+
if (!this.#baseElement) {
|
31
|
+
// eslint-disable-next-line no-console
|
32
|
+
console.warn('missing base element for component', this.localName);
|
33
|
+
}
|
34
|
+
return this.#baseElement;
|
35
|
+
}
|
36
|
+
|
37
|
+
// this is the component root level element,
|
38
|
+
// it can be either a shadow root or the component's node from the light DOM
|
39
|
+
get rootElement() {
|
40
|
+
return this.shadowRoot || this;
|
41
|
+
}
|
42
|
+
|
43
|
+
get name() {
|
44
|
+
return this.getAttribute('name');
|
45
|
+
}
|
46
|
+
|
47
|
+
connectedCallback() {
|
48
|
+
super.connectedCallback?.();
|
49
|
+
|
50
|
+
if (this.rootElement.isConnected) {
|
51
|
+
// the init function is running once, on the first time the component is connected
|
52
|
+
if (this.#isInit) {
|
53
|
+
this.#isInit = false;
|
54
|
+
this.init?.();
|
55
|
+
}
|
56
|
+
}
|
57
|
+
}
|
58
|
+
}
|
59
|
+
|
60
|
+
return compose(
|
61
|
+
componentNameValidationMixin,
|
62
|
+
hoverableMixin,
|
63
|
+
normalizeBooleanAttributesMixin,
|
64
|
+
componentsContextMixin
|
65
|
+
)(DescopeBaseClass);
|
66
|
+
};
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { compose } from '../../utils';
|
2
|
+
import { changeMixin } from '../../componentsMixins/mixins/changeMixin';
|
3
|
+
import { inputEventsDispatchingMixin } from '../../componentsMixins/mixins/inputEventsDispatchingMixin';
|
4
|
+
import { inputValidationMixin } from '../../componentsMixins/mixins/inputValidationMixin';
|
5
|
+
import { normalizeBooleanAttributesMixin } from '../../componentsMixins/mixins/normalizeBooleanAttributesMixin';
|
6
|
+
import { createBaseClass } from './createBaseClass';
|
7
|
+
|
8
|
+
export const createBaseInputClass = (...args) =>
|
9
|
+
compose(
|
10
|
+
inputValidationMixin,
|
11
|
+
changeMixin,
|
12
|
+
normalizeBooleanAttributesMixin,
|
13
|
+
inputEventsDispatchingMixin
|
14
|
+
)(createBaseClass(...args));
|
@@ -0,0 +1,55 @@
|
|
1
|
+
import { compose } from '../../utils';
|
2
|
+
import { componentNameValidationMixin } from '../../componentsMixins/mixins/componentNameValidationMixin';
|
3
|
+
import { createStyleMixin } from '../../componentsMixins/mixins/createStyleMixin';
|
4
|
+
import { draggableMixin } from '../../componentsMixins/mixins/draggableMixin';
|
5
|
+
import { createBaseClass } from './createBaseClass';
|
6
|
+
|
7
|
+
export const createCssVarImageClass = ({ componentName, varName, fallbackVarName }) => {
|
8
|
+
let style;
|
9
|
+
const getContent = () => style;
|
10
|
+
|
11
|
+
class RawCssVarImageClass extends createBaseClass({
|
12
|
+
componentName,
|
13
|
+
baseSelector: ':host > div',
|
14
|
+
}) {
|
15
|
+
constructor() {
|
16
|
+
super();
|
17
|
+
this.attachShadow({ mode: 'open' }).innerHTML = `
|
18
|
+
<style>
|
19
|
+
:host {
|
20
|
+
display: inline-flex;
|
21
|
+
}
|
22
|
+
:host([draggable="true"]) > div {
|
23
|
+
pointer-events: none
|
24
|
+
}
|
25
|
+
:host > div {
|
26
|
+
display: inline-block;
|
27
|
+
max-width: 100%;
|
28
|
+
max-height: 100%;
|
29
|
+
object-fit: contain;
|
30
|
+
margin: auto;
|
31
|
+
${getContent()}
|
32
|
+
}
|
33
|
+
</style>
|
34
|
+
<div></div>
|
35
|
+
`;
|
36
|
+
}
|
37
|
+
}
|
38
|
+
|
39
|
+
const CssVarImageClass = compose(
|
40
|
+
createStyleMixin({
|
41
|
+
mappings: {
|
42
|
+
height: { selector: () => ':host > div' },
|
43
|
+
width: { selector: () => ':host > div' },
|
44
|
+
[varName]: { property: 'content' },
|
45
|
+
[fallbackVarName]: { property: 'content' },
|
46
|
+
},
|
47
|
+
}),
|
48
|
+
draggableMixin,
|
49
|
+
componentNameValidationMixin
|
50
|
+
)(RawCssVarImageClass);
|
51
|
+
|
52
|
+
style = `content: var(${CssVarImageClass.cssVarList[varName]}, var(${CssVarImageClass.cssVarList[fallbackVarName]}));`;
|
53
|
+
|
54
|
+
return CssVarImageClass;
|
55
|
+
};
|
@@ -0,0 +1,95 @@
|
|
1
|
+
import { kebabCaseJoin } from '../utils';
|
2
|
+
import { DESCOPE_PREFIX } from '../constants';
|
3
|
+
|
4
|
+
export const observeAttributes = (ele, callback, { excludeAttrs = [], includeAttrs = [] }) => {
|
5
|
+
// sync all attrs on init
|
6
|
+
const filteredAttrs = Array.from(ele.attributes)
|
7
|
+
.filter(
|
8
|
+
(attr) =>
|
9
|
+
!excludeAttrs.includes(attr.name) &&
|
10
|
+
(!includeAttrs.length || includeAttrs.includes(attr.name))
|
11
|
+
)
|
12
|
+
.map((attr) => attr.name);
|
13
|
+
|
14
|
+
callback(filteredAttrs);
|
15
|
+
|
16
|
+
const observer = new MutationObserver((mutationsList) => {
|
17
|
+
mutationsList.forEach((mutation) => {
|
18
|
+
if (
|
19
|
+
mutation.type === 'attributes' &&
|
20
|
+
!excludeAttrs.includes(mutation.attributeName) &&
|
21
|
+
(!includeAttrs.length || includeAttrs.includes(mutation.attributeName))
|
22
|
+
) {
|
23
|
+
callback([mutation.attributeName]);
|
24
|
+
}
|
25
|
+
});
|
26
|
+
});
|
27
|
+
|
28
|
+
observer.observe(ele, { attributes: true });
|
29
|
+
};
|
30
|
+
|
31
|
+
// calling the callback with this object: { addedNodes, removedNodes }
|
32
|
+
export const observeChildren = (ele, callback) => {
|
33
|
+
callback({ addedNodes: Array.from(ele.children), removedNodes: [] });
|
34
|
+
|
35
|
+
const observer = new MutationObserver((mutationsList) => {
|
36
|
+
mutationsList.forEach((mutation) => {
|
37
|
+
if (mutation.type === 'childList' || mutation.type === 'characterData') {
|
38
|
+
callback(mutation);
|
39
|
+
}
|
40
|
+
});
|
41
|
+
});
|
42
|
+
|
43
|
+
observer.observe(ele, { childList: true, characterData: true, subtree: true });
|
44
|
+
};
|
45
|
+
|
46
|
+
const createSyncAttrsCb =
|
47
|
+
(srcEle, targetEle, mapAttrs = {}) =>
|
48
|
+
(attrNames) => {
|
49
|
+
attrNames.forEach((attrName) => {
|
50
|
+
const targetAttrName = mapAttrs[attrName] || attrName;
|
51
|
+
const srcAttrVal = srcEle.getAttribute(attrName);
|
52
|
+
if (srcAttrVal !== null) {
|
53
|
+
if (targetEle.getAttribute(targetAttrName) !== srcAttrVal) {
|
54
|
+
targetEle.setAttribute(targetAttrName, srcAttrVal);
|
55
|
+
}
|
56
|
+
} else {
|
57
|
+
targetEle.removeAttribute(targetAttrName);
|
58
|
+
}
|
59
|
+
});
|
60
|
+
};
|
61
|
+
|
62
|
+
export const syncAttrs = (ele1, ele2, options) => {
|
63
|
+
observeAttributes(ele1, createSyncAttrsCb(ele1, ele2), options);
|
64
|
+
observeAttributes(ele2, createSyncAttrsCb(ele2, ele1), options);
|
65
|
+
};
|
66
|
+
|
67
|
+
export const getComponentName = (name) => kebabCaseJoin(DESCOPE_PREFIX, name);
|
68
|
+
|
69
|
+
export const getCssVarName = (...args) => `--${kebabCaseJoin(...args)}`;
|
70
|
+
|
71
|
+
export const forwardAttrs = (source, dest, options = {}) => {
|
72
|
+
observeAttributes(source, createSyncAttrsCb(source, dest, options.mapAttrs), options);
|
73
|
+
};
|
74
|
+
|
75
|
+
export const forwardProps = (src, target, props = []) => {
|
76
|
+
if (!props.length) return;
|
77
|
+
|
78
|
+
const config = props.reduce(
|
79
|
+
(acc, prop) =>
|
80
|
+
Object.assign(acc, {
|
81
|
+
[prop]: {
|
82
|
+
get() {
|
83
|
+
return src[prop];
|
84
|
+
},
|
85
|
+
set(v) {
|
86
|
+
// eslint-disable-next-line no-param-reassign
|
87
|
+
src[prop] = v;
|
88
|
+
},
|
89
|
+
},
|
90
|
+
}),
|
91
|
+
{}
|
92
|
+
);
|
93
|
+
|
94
|
+
Object.defineProperties(target, config);
|
95
|
+
};
|
@@ -0,0 +1,10 @@
|
|
1
|
+
// create a dispatch event function that also calls to the onevent function in case it's set
|
2
|
+
// usage example:
|
3
|
+
// #dispatchSomething = createDispatchEvent.bind(this, 'something' { ...options })
|
4
|
+
// this will dispatch a new event when called, but also call to "onsomething"
|
5
|
+
export function createDispatchEvent(eventName, options = {}) {
|
6
|
+
const event = new Event(eventName, options);
|
7
|
+
|
8
|
+
this[`on${eventName}`]?.(event); // in case we got an event callback as property
|
9
|
+
this.dispatchEvent(event);
|
10
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './mixins'
|
@@ -0,0 +1,14 @@
|
|
1
|
+
export const activeableMixin = (superclass) =>
|
2
|
+
class ActiveableMixinClass extends superclass {
|
3
|
+
init() {
|
4
|
+
super.init?.();
|
5
|
+
|
6
|
+
this.baseElement.addEventListener('mousedown', (e) => {
|
7
|
+
e.preventDefault();
|
8
|
+
this.setAttribute('active', 'true');
|
9
|
+
window.addEventListener('mouseup', () => this.removeAttribute('active'), {
|
10
|
+
once: true,
|
11
|
+
});
|
12
|
+
});
|
13
|
+
}
|
14
|
+
};
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { createDispatchEvent } from '../../componentsMixins/helpers/mixinsHelpers';
|
2
|
+
|
3
|
+
export const changeMixin = (superclass) =>
|
4
|
+
class ChangeMixinClass extends superclass {
|
5
|
+
#dispatchChange = createDispatchEvent.bind(this, 'change');
|
6
|
+
|
7
|
+
init() {
|
8
|
+
super.init?.();
|
9
|
+
this.prevValue = this.value;
|
10
|
+
|
11
|
+
this.addEventListener('change', (e) => {
|
12
|
+
e.stopPropagation();
|
13
|
+
});
|
14
|
+
|
15
|
+
this.addEventListener('blur', () => {
|
16
|
+
if (this.value !== this.prevValue) {
|
17
|
+
this.#dispatchChange();
|
18
|
+
this.prevValue = this.value;
|
19
|
+
}
|
20
|
+
});
|
21
|
+
}
|
22
|
+
};
|
@@ -0,0 +1,23 @@
|
|
1
|
+
export const componentNameValidationMixin = (superclass) =>
|
2
|
+
class ComponentNameValidationMixinClass extends superclass {
|
3
|
+
#checkComponentName() {
|
4
|
+
const currentComponentName = this.localName;
|
5
|
+
|
6
|
+
if (!superclass.componentName) {
|
7
|
+
throw Error(
|
8
|
+
`component name is not defined on super class, make sure you have a static get for "componentName"`
|
9
|
+
);
|
10
|
+
}
|
11
|
+
|
12
|
+
if (currentComponentName !== superclass.componentName) {
|
13
|
+
throw Error(
|
14
|
+
`component name mismatch, expected "${superclass.componentName}", current "${currentComponentName}"`
|
15
|
+
);
|
16
|
+
}
|
17
|
+
}
|
18
|
+
|
19
|
+
init() {
|
20
|
+
super.init?.();
|
21
|
+
this.#checkComponentName();
|
22
|
+
}
|
23
|
+
};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
export const componentsContextMixin = (superclass) =>
|
2
|
+
class ComponentsContextMixinClass extends superclass {
|
3
|
+
updateComponentsContext(componentsContext) {
|
4
|
+
this.dispatchEvent(
|
5
|
+
new CustomEvent('components-context', {
|
6
|
+
bubbles: true,
|
7
|
+
composed: true,
|
8
|
+
detail: componentsContext,
|
9
|
+
})
|
10
|
+
);
|
11
|
+
}
|
12
|
+
};
|
@@ -0,0 +1,100 @@
|
|
1
|
+
import { observeAttributes } from '../helpers/componentHelpers';
|
2
|
+
|
3
|
+
const defaultValidateSchema = () => true;
|
4
|
+
const defaultItemRenderer = (item) => `<pre>${JSON.stringify(item, null, 4)}</pre>`;
|
5
|
+
|
6
|
+
const createTemplate = (templateString) => {
|
7
|
+
const template = document.createElement('template');
|
8
|
+
template.innerHTML = templateString;
|
9
|
+
|
10
|
+
return template;
|
11
|
+
};
|
12
|
+
|
13
|
+
const getTemplateContent = (templateOrString) => {
|
14
|
+
if (typeof templateOrString === 'string') {
|
15
|
+
return createTemplate(templateOrString).content;
|
16
|
+
}
|
17
|
+
|
18
|
+
if (templateOrString instanceof HTMLTemplateElement) {
|
19
|
+
return templateOrString.content;
|
20
|
+
}
|
21
|
+
|
22
|
+
// eslint-disable-next-line no-console
|
23
|
+
console.error('Invalid template', templateOrString);
|
24
|
+
return null;
|
25
|
+
};
|
26
|
+
|
27
|
+
export const createDynamicDataMixin =
|
28
|
+
({
|
29
|
+
itemRenderer = defaultItemRenderer,
|
30
|
+
validateSchema = defaultValidateSchema,
|
31
|
+
slotName,
|
32
|
+
rerenderAttrsList = [],
|
33
|
+
}) =>
|
34
|
+
(superclass) =>
|
35
|
+
class DynamicDataMixinClass extends superclass {
|
36
|
+
#data = [];
|
37
|
+
|
38
|
+
// eslint-disable-next-line class-methods-use-this
|
39
|
+
#validateSchema(data) {
|
40
|
+
if (!validateSchema) return true;
|
41
|
+
|
42
|
+
const validation = validateSchema(data);
|
43
|
+
if (validation === true) return true;
|
44
|
+
|
45
|
+
// eslint-disable-next-line no-console
|
46
|
+
console.error('Data schema validation failed', validation || '');
|
47
|
+
|
48
|
+
return false;
|
49
|
+
}
|
50
|
+
|
51
|
+
#removeOldItems() {
|
52
|
+
const selector = slotName ? `*[slot="${slotName}"]` : ':not([slot])';
|
53
|
+
this.baseElement.querySelectorAll(selector).forEach((item) => item.remove());
|
54
|
+
}
|
55
|
+
|
56
|
+
#renderItems() {
|
57
|
+
this.#removeOldItems();
|
58
|
+
this.data.forEach((item, index) => {
|
59
|
+
const content = getTemplateContent(itemRenderer(item, index, this));
|
60
|
+
this.baseElement.appendChild(content?.cloneNode(true));
|
61
|
+
});
|
62
|
+
}
|
63
|
+
|
64
|
+
set data(value) {
|
65
|
+
if (this.#validateSchema(value)) {
|
66
|
+
this.#data = value;
|
67
|
+
this.#renderItems();
|
68
|
+
}
|
69
|
+
}
|
70
|
+
|
71
|
+
get data() {
|
72
|
+
return this.#data;
|
73
|
+
}
|
74
|
+
|
75
|
+
init() {
|
76
|
+
super.init?.();
|
77
|
+
|
78
|
+
observeAttributes(
|
79
|
+
this,
|
80
|
+
(attrs) => {
|
81
|
+
if (attrs.includes('data')) this.#handleDataAttr();
|
82
|
+
else this.#renderItems();
|
83
|
+
},
|
84
|
+
{ includeAttrs: [...rerenderAttrsList, 'data'] }
|
85
|
+
);
|
86
|
+
}
|
87
|
+
|
88
|
+
#handleDataAttr() {
|
89
|
+
const dataAttr = this.getAttribute('data');
|
90
|
+
|
91
|
+
if (!dataAttr) return;
|
92
|
+
|
93
|
+
try {
|
94
|
+
this.data = JSON.parse(dataAttr);
|
95
|
+
} catch (e) {
|
96
|
+
// eslint-disable-next-line no-console
|
97
|
+
console.warn('Invalid JSON data', dataAttr);
|
98
|
+
}
|
99
|
+
}
|
100
|
+
};
|