@descope/web-components-ui 1.0.348 → 1.0.349

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. package/dist/cjs/index.cjs.js +191 -3
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +376 -149
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/umd/1000.js +1 -0
  6. package/dist/umd/1612.js +116 -4
  7. package/dist/umd/1765.js +1 -0
  8. package/dist/umd/3227.js +17 -0
  9. package/dist/umd/4024.js +116 -4
  10. package/dist/umd/4028.js +121 -9
  11. package/dist/umd/4052.js +116 -4
  12. package/dist/umd/4392.js +1 -1
  13. package/dist/umd/5135.js +2 -2
  14. package/dist/umd/602.js +114 -2
  15. package/dist/umd/9562.js +116 -4
  16. package/dist/umd/DescopeDev.js +1 -1
  17. package/dist/umd/boolean-fields-descope-boolean-field-internal-index-js.js +1 -1
  18. package/dist/umd/boolean-fields-descope-checkbox-index-js.js +1 -1
  19. package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js +1 -1
  20. package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-index-js.js +1 -1
  21. package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-internal-index-js.js +1 -1
  22. package/dist/umd/button-selection-group-fields-descope-button-selection-group-index-js.js +1 -1
  23. package/dist/umd/button-selection-group-fields-descope-button-selection-group-internal-index-js.js +1 -1
  24. package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js +1 -1
  25. package/dist/umd/descope-avatar-index-js.js +1 -1
  26. package/dist/umd/descope-badge-index-js.js +1 -1
  27. package/dist/umd/descope-button-index-js.js +116 -4
  28. package/dist/umd/descope-code-snippet-index-js.js +1 -1
  29. package/dist/umd/descope-combo-box-index-js.js +1 -1
  30. package/dist/umd/descope-container-index-js.js +1 -1
  31. package/dist/umd/descope-date-picker-index-js.js +1 -1
  32. package/dist/umd/descope-divider-index-js.js +1 -1
  33. package/dist/umd/descope-email-field-index-js.js +1 -1
  34. package/dist/umd/descope-enriched-text-index-js.js +1 -1
  35. package/dist/umd/descope-grid-descope-grid-custom-column-index-js.js +3 -3
  36. package/dist/umd/descope-grid-descope-grid-item-details-column-index-js.js +90 -0
  37. package/dist/umd/descope-grid-descope-grid-item-details-column-index-js.js.LICENSE.txt +17 -0
  38. package/dist/umd/descope-grid-descope-grid-selection-column-index-js.js +1 -1
  39. package/dist/umd/descope-grid-descope-grid-text-column-index-js.js +1 -1
  40. package/dist/umd/descope-grid-index-js.js +1 -1
  41. package/dist/umd/descope-icon-index-js.js +1 -1
  42. package/dist/umd/descope-image-index-js.js +1 -1
  43. package/dist/umd/descope-link-index-js.js +1 -1
  44. package/dist/umd/descope-loader-linear-index-js.js +1 -1
  45. package/dist/umd/descope-loader-radial-index-js.js +1 -1
  46. package/dist/umd/descope-logo-index-js.js +1 -1
  47. package/dist/umd/descope-modal-index-js.js +1 -1
  48. package/dist/umd/descope-multi-select-combo-box-index-js.js +1 -1
  49. package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js +1 -1
  50. package/dist/umd/descope-new-password-index-js.js +1 -1
  51. package/dist/umd/descope-notification-descope-notification-card-index-js.js +1 -1
  52. package/dist/umd/descope-notification-index-js.js +1 -1
  53. package/dist/umd/descope-notp-image-index-js.js +1 -1
  54. package/dist/umd/descope-number-field-index-js.js +1 -1
  55. package/dist/umd/descope-passcode-descope-passcode-internal-index-js.js +1 -1
  56. package/dist/umd/descope-passcode-index-js.js +1 -1
  57. package/dist/umd/descope-password-index-js.js +1 -1
  58. package/dist/umd/descope-policy-validation-index-js.js +1 -1
  59. package/dist/umd/descope-radio-group-index-js.js +1 -1
  60. package/dist/umd/descope-recaptcha-index-js.js +1 -1
  61. package/dist/umd/descope-text-area-index-js.js +1 -1
  62. package/dist/umd/descope-text-field-index-js.js +1 -1
  63. package/dist/umd/descope-text-index-js.js +1 -1
  64. package/dist/umd/descope-totp-image-index-js.js +1 -1
  65. package/dist/umd/descope-upload-file-index-js.js +1 -1
  66. package/dist/umd/descope-user-attribute-index-js.js +1 -1
  67. package/dist/umd/descope-user-auth-method-index-js.js +1 -1
  68. package/dist/umd/index.js +1 -1
  69. package/dist/umd/mapping-fields-descope-mappings-field-descope-mapping-item-index-js.js +1 -1
  70. package/dist/umd/mapping-fields-descope-mappings-field-descope-mappings-field-internal-index-js.js +1 -1
  71. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -1
  72. package/dist/umd/mapping-fields-descope-saml-group-mappings-descope-saml-group-mappings-internal-index-js.js +1 -1
  73. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js +1 -1
  74. package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js +1 -1
  75. package/dist/umd/phone-fields-descope-phone-field-index-js.js +1 -1
  76. package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js +1 -1
  77. package/package.json +1 -1
  78. package/src/components/descope-grid/GridClass.js +116 -6
  79. package/src/components/descope-grid/descope-grid-item-details-column/GridItemDetailsColumnClass.js +37 -0
  80. package/src/components/descope-grid/descope-grid-item-details-column/index.js +8 -0
  81. package/src/components/descope-grid/helpers.js +54 -0
  82. package/src/components/descope-grid/index.js +1 -0
  83. package/src/helpers/index.js +8 -0
  84. package/src/theme/components/grid.js +11 -0
  85. package/dist/umd/2362.js +0 -129
  86. package/dist/umd/4978.js +0 -1
  87. /package/dist/umd/{2362.js.LICENSE.txt → 3227.js.LICENSE.txt} +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[5119],{84049:(e,t,r)=>{r.d(t,{H:()=>f,f:()=>l});var o=r(2061),n=r(54567),i=r(54201),a=r(94978);const l=(0,n.iY)("combo-box"),{host:s,inputField:p,inputElement:d,placeholder:u,toggle:c,clearButton:h,label:b,requiredIndicator:m,helperText:y,errorMessage:g}={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)"}},f=(0,o.qC)((0,a.yk)({mappings:{hostWidth:{...s,property:"width"},hostDirection:{...s,property:"direction"},fontSize:[{},s],fontFamily:[b,u,p,y,g],labelFontSize:{...b,property:"font-size"},labelFontWeight:{...b,property:"font-weight"},labelTextColor:[{...b,property:"color"},{...m,property:"color"}],errorMessageTextColor:{...g,property:"color"},inputHeight:{...p,property:"height"},inputBackgroundColor:{...p,property:"background-color"},inputBorderColor:{...p,property:"border-color"},inputBorderWidth:{...p,property:"border-width"},inputBorderStyle:{...p,property:"border-style"},inputBorderRadius:{...p,property:"border-radius"},labelRequiredIndicator:{...m,property:"content"},inputValueTextColor:{...p,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:{...p,property:"outline-color"},inputOutlineWidth:{...p,property:"outline-width"},inputOutlineStyle:{...p,property:"outline-style"},inputOutlineOffset:{...p,property:"outline-offset"},inputHorizontalPadding:[{...d,property:"padding-left"},{...d,property:"padding-right"}],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:{...p,property:"align-items"},valueInputHeight:{...d,property:"height"},valueInputMarginBottom:{...d,property:"margin-bottom"},overlayBackground:{property:()=>f.cssVarList.overlay.backgroundColor},overlayTextColor:{property:()=>f.cssVarList.overlay.textColor},overlayBorder:{property:()=>f.cssVarList.overlay.border},overlayFontSize:{property:()=>f.cssVarList.overlay.fontSize},overlayFontFamily:{property:()=>f.cssVarList.overlay.fontFamily},overlayCursor:{property:()=>f.cssVarList.overlay.cursor},overlayItemBoxShadow:{property:()=>f.cssVarList.overlay.itemBoxShadow},overlayItemPaddingInlineStart:{property:()=>f.cssVarList.overlay.itemPaddingInlineStart},overlayItemPaddingInlineEnd:{property:()=>f.cssVarList.overlay.itemPaddingInlineEnd}}}),a.e4,(0,a.Iw)({name:"overlay",selector:"",mappings:{backgroundColor:{selector:"vaadin-combo-box-scroller"},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"}},forward:{include:!1,attributes:["size"]}}),(0,a.dj)({proxyProps:["selectionStart"],inputEvent:"selected-item-changed"}),a.Ae,(e=>class extends e{static get observedAttributes(){return["label-type"]}#e=({displayName:e,value:t,label:r})=>`<span data-name="${r}" data-id="${t}">${e||r}</span>`;#t;get defaultValue(){return this.getAttribute("default-value")}get renderItem(){return this.#e}set renderItem(e){this.#e=e,this.renderItems()}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(){const e=this.getItemsTemplate();e&&(this.innerHTML=e)}handleSelectedItem(){const e=this.baseElement.selectedItem?.["data-id"];this.baseElement.selectedItem=void 0,e&&(this.value=e),this.value||this.setDefaultValue()}customValueTransformFn(e){return e}setComboBoxDescriptor(){const e=Object.getOwnPropertyDescriptor(this.inputElement.constructor.prototype,"value"),t=this;Object.defineProperties(this.inputElement,{value:{...e,set(r){if(!t.baseElement.items?.length)return;const o=t.customValueTransformFn(r)||"";o!==this.value&&e.set.call(this,o)}}})}#r(){const e=this.shadowRoot.querySelector(this.baseSelector),t=Array.from(this.children);t.length&&(t.forEach((e=>{Object.defineProperty(e,"data-name",{value:e.getAttribute("data-name"),configurable:!0,writable:!0}),Object.defineProperty(e,"data-id",{value:e.getAttribute("data-id"),configurable:!0,writable:!0})})),e.items=t,setTimeout((()=>{this.handleSelectedItem()}),0)),e.renderer=(e,t,r)=>{e.innerHTML=r.item.outerHTML}}#o(){const e=this.baseElement.shadowRoot.querySelector("vaadin-combo-box-overlay");e._attachOverlay=()=>{e.bringToFront()},e._detachOverlay=()=>{},e._enterModalState=()=>{}}init(){super.init?.(),this.getValidity=function(){return!this.value&&this.isRequired?{valueMissing:!0}:{}},this.setComboBoxDescriptor(),this.#o(),this.renderItems(),(0,n.FX)(this,this.renderItems.bind(this),{includeAttrs:["data"]}),(0,n.P$)(this,this.#r.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,r){super.attributeChangedCallback?.(e,t,r),t!==r&&"label-type"===e&&("floating"===r?this.addEventListener("click",this.onLabelClick):this.removeEventListener("click",this.onLabelClick))}setDefaultValue(){this.value=this.defaultValue}set value(e){if(e){const t=this.baseElement.items?.find((t=>t["data-id"]===e));t&&(this.baseElement.selectedItem=t)}else this.baseElement.selectedItem=void 0}get value(){return this.baseElement.selectedItem?.["data-id"]||""}}))((0,a.DM)({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.bi)(f.cssVarList)}\n\t\t${(0,i.PH)("vaadin-combo-box")}\n\t\t${(0,i.jI)("vaadin-combo-box")}\n\t\t${(0,i.Pd)("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[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.Wf)("vaadin-combo-box")}\n ${(0,i.bz)()}\n\t\t`,excludeAttrsSync:["tabindex","size","data"],componentName:l,includeForwardProps:["items","renderer","selectedItem"]}))},21294:(e,t,r)=>{r.r(t),r.d(t,{ComboBoxClass:()=>o.H}),r(47583);var o=r(84049);customElements.define(o.f,o.H)},41377:(e,t,r)=>{r.d(t,{Z:()=>d,f:()=>a});var o=r(73878),n=r(54567),i=r(16418);const a=(0,n.iY)("phone-field-internal-input-box"),l=["disabled","size","bordered","invalid","readonly","phone-input-placeholder","name","autocomplete","label-type"],s={"phone-input-placeholder":"placeholder"},p=(0,o.P)({componentName:a,baseSelector:"div"}),d=class extends p{static get observedAttributes(){return[].concat(p.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.g)(this.getAttribute("default-code"))}get hasDefaultCode(){return!!this.getAttribute("default-code")}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 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("+-","+");const t=/^[+\d-]+$/,r=e.target.value.split("").filter((e=>t.test(e))).join("");e.target.value=r})),this.handleFocusEventsDispatching([this.phoneNumberInput]),this.handleInputEventDispatching()}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),t!==r&&l.includes(e)){const t=s[e]||e;this.phoneNumberInput.setAttribute(t,r)}}}},83067:(e,t,r)=>{r.r(t),r(19357);var o=r(41377);customElements.define(o.f,o.Z)},69423:(e,t,r)=>{r.r(t),r.d(t,{PhoneFieldInputBoxClass:()=>x}),r(83067),r(21294),r(19357);var o=r(41377),n=r(54567),i=r(2061),a=r(94978),l=r(56417),s=r(87262),p=r(54201);const d=l.z.cssVarList,u=(0,n.iY)("phone-input-box-field"),{host:c,label:h,inputElement:b,requiredIndicator:m,inputField:y,phoneInput:g,errorMessage:f,helperText:v}={host:{selector:()=>":host"},label:{selector:"::part(label)"},placeholder:{selector:"> input:placeholder-shown"},inputElement:{selector:"input"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},inputField:{selector:"::part(input-field)"},phoneInput:{selector:()=>"descope-text-field"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},x=(0,i.qC)((0,a.yk)({mappings:{fontSize:[c,y,{selector:l.z.componentName,property:l.z.cssVarList.fontSize}],fontFamily:[h,f,v],hostWidth:{...c,property:"width"},hostMinWidth:{...c,property:"min-width"},hostDirection:{...c,property:"direction"},inputBorderStyle:{...y,property:"border-style"},inputBorderWidth:{...y,property:"border-width"},inputBorderColor:{...y,property:"border-color"},inputBorderRadius:{...y,property:"border-radius"},inputHorizontalPadding:[{...g,property:"padding-left"},{...g,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"},inputValueTextColor:{...g,property:d.inputValueTextColor},inputPlaceholderTextColor:{...g,property:d.inputPlaceholderColor},inputOutlineStyle:{...y,property:"outline-style"},inputOutlineColor:{...y,property:"outline-color"},inputOutlineWidth:{...y,property:"outline-width"},inputOutlineOffset:{...y,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.z.componentName,property:d.valueInputMarginBottom}}}),a.e4,(0,a.dj)({proxyProps:["value","selectionStart"]}),(e=>class extends e{static get CountryCodes(){return s.Z}init(){super.init?.();const e=document.createElement("template");e.innerHTML=`\n\t\t\t\t<${o.f}\n\t\t\t\t\ttabindex="-1"\n\t\t\t\t\tslot="input"\n\t\t\t\t></${o.f}>\n `,this.baseElement.appendChild(e.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(o.f),(0,n.oP)(this.shadowRoot.host,this.inputElement,{includeAttrs:["size","bordered","invalid","minlength","maxlength","default-code","disabled","phone-input-placeholder","label","label-type"]})}}))((0,a.DM)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n :host {\n display: inline-flex;\n max-width: 100%;\n box-sizing: border-box;\n }\n ${(0,p.bi)(x.cssVarList)}\n ${(0,p.Pd)("vaadin-text-field")}\n ${(0,p.B)("vaadin-text-field")}\n ${(0,p.DY)()}\n\n vaadin-text-field {\n width: 100%;\n height: 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 height: 100%;\n }\n descope-phone-field-internal-input-box > div {\n width: 100%;\n height: 100%;\n }\n descope-phone-field-internal-input-box .separator {\n flex: 0;\n border: none;\n }\n descope-text-field {\n flex-grow: 1;\n width: 100%;\n ${d.inputOutlineWidth}: 0;\n ${d.inputOutlineOffset}: 0;\n ${d.inputBorderWidth}: 0;\n ${d.inputBorderRadius}: 0;\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,p.Wf)("vaadin-text-field")}\n ${(0,p.bz)()}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:u}));customElements.define(u,x)},16418:(e,t,r)=>{r.d(t,{g:()=>n});var o=r(87262);const n=e=>o.Z.find((t=>t.code===e))?.dialCode}}]);
1
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[5119],{84049:(e,t,r)=>{r.d(t,{H:()=>f,f:()=>l});var o=r(2061),n=r(54567),i=r(54201),a=r(21e3);const l=(0,n.iY)("combo-box"),{host:s,inputField:p,inputElement:d,placeholder:u,toggle:c,clearButton:h,label:b,requiredIndicator:m,helperText:y,errorMessage:g}={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)"}},f=(0,o.qC)((0,a.yk)({mappings:{hostWidth:{...s,property:"width"},hostDirection:{...s,property:"direction"},fontSize:[{},s],fontFamily:[b,u,p,y,g],labelFontSize:{...b,property:"font-size"},labelFontWeight:{...b,property:"font-weight"},labelTextColor:[{...b,property:"color"},{...m,property:"color"}],errorMessageTextColor:{...g,property:"color"},inputHeight:{...p,property:"height"},inputBackgroundColor:{...p,property:"background-color"},inputBorderColor:{...p,property:"border-color"},inputBorderWidth:{...p,property:"border-width"},inputBorderStyle:{...p,property:"border-style"},inputBorderRadius:{...p,property:"border-radius"},labelRequiredIndicator:{...m,property:"content"},inputValueTextColor:{...p,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:{...p,property:"outline-color"},inputOutlineWidth:{...p,property:"outline-width"},inputOutlineStyle:{...p,property:"outline-style"},inputOutlineOffset:{...p,property:"outline-offset"},inputHorizontalPadding:[{...d,property:"padding-left"},{...d,property:"padding-right"}],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:{...p,property:"align-items"},valueInputHeight:{...d,property:"height"},valueInputMarginBottom:{...d,property:"margin-bottom"},overlayBackground:{property:()=>f.cssVarList.overlay.backgroundColor},overlayTextColor:{property:()=>f.cssVarList.overlay.textColor},overlayBorder:{property:()=>f.cssVarList.overlay.border},overlayFontSize:{property:()=>f.cssVarList.overlay.fontSize},overlayFontFamily:{property:()=>f.cssVarList.overlay.fontFamily},overlayCursor:{property:()=>f.cssVarList.overlay.cursor},overlayItemBoxShadow:{property:()=>f.cssVarList.overlay.itemBoxShadow},overlayItemPaddingInlineStart:{property:()=>f.cssVarList.overlay.itemPaddingInlineStart},overlayItemPaddingInlineEnd:{property:()=>f.cssVarList.overlay.itemPaddingInlineEnd}}}),a.e4,(0,a.Iw)({name:"overlay",selector:"",mappings:{backgroundColor:{selector:"vaadin-combo-box-scroller"},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"}},forward:{include:!1,attributes:["size"]}}),(0,a.dj)({proxyProps:["selectionStart"],inputEvent:"selected-item-changed"}),a.Ae,(e=>class extends e{static get observedAttributes(){return["label-type"]}#e=({displayName:e,value:t,label:r})=>`<span data-name="${r}" data-id="${t}">${e||r}</span>`;#t;get defaultValue(){return this.getAttribute("default-value")}get renderItem(){return this.#e}set renderItem(e){this.#e=e,this.renderItems()}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(){const e=this.getItemsTemplate();e&&(this.innerHTML=e)}handleSelectedItem(){const e=this.baseElement.selectedItem?.["data-id"];this.baseElement.selectedItem=void 0,e&&(this.value=e),this.value||this.setDefaultValue()}customValueTransformFn(e){return e}setComboBoxDescriptor(){const e=Object.getOwnPropertyDescriptor(this.inputElement.constructor.prototype,"value"),t=this;Object.defineProperties(this.inputElement,{value:{...e,set(r){if(!t.baseElement.items?.length)return;const o=t.customValueTransformFn(r)||"";o!==this.value&&e.set.call(this,o)}}})}#r(){const e=this.shadowRoot.querySelector(this.baseSelector),t=Array.from(this.children);t.length&&(t.forEach((e=>{Object.defineProperty(e,"data-name",{value:e.getAttribute("data-name"),configurable:!0,writable:!0}),Object.defineProperty(e,"data-id",{value:e.getAttribute("data-id"),configurable:!0,writable:!0})})),e.items=t,setTimeout((()=>{this.handleSelectedItem()}),0)),e.renderer=(e,t,r)=>{e.innerHTML=r.item.outerHTML}}#o(){const e=this.baseElement.shadowRoot.querySelector("vaadin-combo-box-overlay");e._attachOverlay=()=>{e.bringToFront()},e._detachOverlay=()=>{},e._enterModalState=()=>{}}init(){super.init?.(),this.getValidity=function(){return!this.value&&this.isRequired?{valueMissing:!0}:{}},this.setComboBoxDescriptor(),this.#o(),this.renderItems(),(0,n.FX)(this,this.renderItems.bind(this),{includeAttrs:["data"]}),(0,n.P$)(this,this.#r.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,r){super.attributeChangedCallback?.(e,t,r),t!==r&&"label-type"===e&&("floating"===r?this.addEventListener("click",this.onLabelClick):this.removeEventListener("click",this.onLabelClick))}setDefaultValue(){this.value=this.defaultValue}set value(e){if(e){const t=this.baseElement.items?.find((t=>t["data-id"]===e));t&&(this.baseElement.selectedItem=t)}else this.baseElement.selectedItem=void 0}get value(){return this.baseElement.selectedItem?.["data-id"]||""}}))((0,a.DM)({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.bi)(f.cssVarList)}\n\t\t${(0,i.PH)("vaadin-combo-box")}\n\t\t${(0,i.jI)("vaadin-combo-box")}\n\t\t${(0,i.Pd)("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[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.Wf)("vaadin-combo-box")}\n ${(0,i.bz)()}\n\t\t`,excludeAttrsSync:["tabindex","size","data"],componentName:l,includeForwardProps:["items","renderer","selectedItem"]}))},21294:(e,t,r)=>{r.r(t),r.d(t,{ComboBoxClass:()=>o.H}),r(47583);var o=r(84049);customElements.define(o.f,o.H)},41377:(e,t,r)=>{r.d(t,{Z:()=>d,f:()=>a});var o=r(73878),n=r(54567),i=r(16418);const a=(0,n.iY)("phone-field-internal-input-box"),l=["disabled","size","bordered","invalid","readonly","phone-input-placeholder","name","autocomplete","label-type"],s={"phone-input-placeholder":"placeholder"},p=(0,o.P)({componentName:a,baseSelector:"div"}),d=class extends p{static get observedAttributes(){return[].concat(p.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.g)(this.getAttribute("default-code"))}get hasDefaultCode(){return!!this.getAttribute("default-code")}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 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("+-","+");const t=/^[+\d-]+$/,r=e.target.value.split("").filter((e=>t.test(e))).join("");e.target.value=r})),this.handleFocusEventsDispatching([this.phoneNumberInput]),this.handleInputEventDispatching()}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),t!==r&&l.includes(e)){const t=s[e]||e;this.phoneNumberInput.setAttribute(t,r)}}}},83067:(e,t,r)=>{r.r(t),r(19357);var o=r(41377);customElements.define(o.f,o.Z)},69423:(e,t,r)=>{r.r(t),r.d(t,{PhoneFieldInputBoxClass:()=>x}),r(83067),r(21294),r(19357);var o=r(41377),n=r(54567),i=r(2061),a=r(21e3),l=r(56417),s=r(87262),p=r(54201);const d=l.z.cssVarList,u=(0,n.iY)("phone-input-box-field"),{host:c,label:h,inputElement:b,requiredIndicator:m,inputField:y,phoneInput:g,errorMessage:f,helperText:v}={host:{selector:()=>":host"},label:{selector:"::part(label)"},placeholder:{selector:"> input:placeholder-shown"},inputElement:{selector:"input"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},inputField:{selector:"::part(input-field)"},phoneInput:{selector:()=>"descope-text-field"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},x=(0,i.qC)((0,a.yk)({mappings:{fontSize:[c,y,{selector:l.z.componentName,property:l.z.cssVarList.fontSize}],fontFamily:[h,f,v],hostWidth:{...c,property:"width"},hostMinWidth:{...c,property:"min-width"},hostDirection:{...c,property:"direction"},inputBorderStyle:{...y,property:"border-style"},inputBorderWidth:{...y,property:"border-width"},inputBorderColor:{...y,property:"border-color"},inputBorderRadius:{...y,property:"border-radius"},inputHorizontalPadding:[{...g,property:"padding-left"},{...g,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"},inputValueTextColor:{...g,property:d.inputValueTextColor},inputPlaceholderTextColor:{...g,property:d.inputPlaceholderColor},inputOutlineStyle:{...y,property:"outline-style"},inputOutlineColor:{...y,property:"outline-color"},inputOutlineWidth:{...y,property:"outline-width"},inputOutlineOffset:{...y,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.z.componentName,property:d.valueInputMarginBottom}}}),a.e4,(0,a.dj)({proxyProps:["value","selectionStart"]}),(e=>class extends e{static get CountryCodes(){return s.Z}init(){super.init?.();const e=document.createElement("template");e.innerHTML=`\n\t\t\t\t<${o.f}\n\t\t\t\t\ttabindex="-1"\n\t\t\t\t\tslot="input"\n\t\t\t\t></${o.f}>\n `,this.baseElement.appendChild(e.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(o.f),(0,n.oP)(this.shadowRoot.host,this.inputElement,{includeAttrs:["size","bordered","invalid","minlength","maxlength","default-code","disabled","phone-input-placeholder","label","label-type"]})}}))((0,a.DM)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n :host {\n display: inline-flex;\n max-width: 100%;\n box-sizing: border-box;\n }\n ${(0,p.bi)(x.cssVarList)}\n ${(0,p.Pd)("vaadin-text-field")}\n ${(0,p.B)("vaadin-text-field")}\n ${(0,p.DY)()}\n\n vaadin-text-field {\n width: 100%;\n height: 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 height: 100%;\n }\n descope-phone-field-internal-input-box > div {\n width: 100%;\n height: 100%;\n }\n descope-phone-field-internal-input-box .separator {\n flex: 0;\n border: none;\n }\n descope-text-field {\n flex-grow: 1;\n width: 100%;\n ${d.inputOutlineWidth}: 0;\n ${d.inputOutlineOffset}: 0;\n ${d.inputBorderWidth}: 0;\n ${d.inputBorderRadius}: 0;\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,p.Wf)("vaadin-text-field")}\n ${(0,p.bz)()}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:u}));customElements.define(u,x)},16418:(e,t,r)=>{r.d(t,{g:()=>n});var o=r(87262);const n=e=>o.Z.find((t=>t.code===e))?.dialCode}}]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@descope/web-components-ui",
3
- "version": "1.0.348",
3
+ "version": "1.0.349",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -1,13 +1,13 @@
1
1
  import { compose } from '../../helpers';
2
2
  import { getComponentName } from '../../helpers/componentHelpers';
3
3
  import {
4
+ componentNameValidationMixin,
5
+ createProxy,
4
6
  createStyleMixin,
5
7
  draggableMixin,
6
- createProxy,
7
- componentNameValidationMixin,
8
8
  } from '../../mixins';
9
9
 
10
- import { isValidDataType } from './helpers';
10
+ import { defaultRowDetailsRenderer, isValidDataType } from './helpers';
11
11
 
12
12
  export const componentName = getComponentName('grid');
13
13
 
@@ -22,6 +22,41 @@ const GridMixin = (superclass) =>
22
22
 
23
23
  // disable the grid sort
24
24
  this.baseElement._mapSorters = () => {};
25
+
26
+ this.baseElement.rowDetailsRenderer = this.#rowDetailsRenderer.bind(this);
27
+ }
28
+
29
+ // this renders the details panel content
30
+ // in order to open it, the descope-grid-item-details-column should be used
31
+ #rowDetailsRenderer = async (cell, _col, model) => {
32
+ await import('../descope-code-snippet');
33
+ // prevent details panel from being scrolled into view when clicked
34
+ cell.addEventListener('mousedown', (e) => e.stopImmediatePropagation(), true);
35
+
36
+ const template = this.getRowDetailsTemplate(model.item);
37
+
38
+ // eslint-disable-next-line no-param-reassign
39
+ cell.innerHTML = '';
40
+ cell.append(template.content.cloneNode(true));
41
+ };
42
+
43
+ getRowDetailsTemplate(item) {
44
+ const itemLabelsMapping = this.#columns.reduce(
45
+ (acc, { path, header }) => (!path || !header ? acc : { ...acc, [path]: header }),
46
+ {}
47
+ );
48
+ const template =
49
+ this.rowDetailsRenderer?.(item, itemLabelsMapping) ??
50
+ defaultRowDetailsRenderer(item, itemLabelsMapping);
51
+
52
+ switch (true) {
53
+ case template instanceof HTMLTemplateElement:
54
+ return template;
55
+ case typeof template === 'string':
56
+ return Object.assign(document.createElement('template'), { innerHTML: template });
57
+ default:
58
+ throw new Error('rowDetailsRenderer should return a string or a template');
59
+ }
25
60
  }
26
61
 
27
62
  forwardSelectedItemsChange() {
@@ -115,9 +150,20 @@ const GridMixin = (superclass) =>
115
150
  );
116
151
  }
117
152
 
153
+ // there is an issue in vaadin-grid, when rowDetailsRenderer is set, it renders an empty details panel
154
+ reassignRowDetailsRenderer() {
155
+ this.baseElement.rowDetailsRenderer = null;
156
+ setTimeout(() => {
157
+ this.baseElement.rowDetailsRenderer = this.#rowDetailsRenderer.bind(this);
158
+ }, 0);
159
+ }
160
+
118
161
  renderColumns() {
119
162
  const template = this.getColumnsTemplate();
120
- if (template) this.innerHTML = template;
163
+ if (template) {
164
+ this.reassignRowDetailsRenderer();
165
+ this.innerHTML = template;
166
+ }
121
167
  }
122
168
 
123
169
  get grid() {
@@ -179,17 +225,35 @@ const {
179
225
  selectedRow,
180
226
  rowSeparator,
181
227
  resizeHandle,
228
+ toggleDetailsPanelButton,
229
+ toggleDetailsPanelButtonOpened,
230
+ toggleDetailsPanelButtonClosed,
231
+ detailsPanel,
232
+ detailsPanelLabels,
233
+ selectedRowCell,
234
+ detailsPanelContent,
182
235
  } = {
183
236
  host: { selector: () => 'vaadin-grid' },
184
237
  headerRow: { selector: () => '::part(header-cell)' },
185
238
  headerRowCell: { selector: () => 'vaadin-grid::part(header-cell)' },
186
239
  contentRow: { selector: () => '::part(cell)' },
187
240
  firstRow: { selector: () => '::part(first-header-row-cell)' },
188
- selectedRow: { selector: () => '::part(selected-row-cell)' },
241
+ selectedRow: { selector: () => '::part(selected-row)' },
242
+ selectedRowCell: { selector: () => '::part(selected-row-cell)' },
189
243
  sortIndicators: { selector: () => 'vaadin-grid-sorter::part(indicators)' },
190
244
  activeSortIndicator: { selector: () => 'vaadin-grid-sorter[direction]' },
191
245
  rowSeparator: { selector: () => 'vaadin-grid::part(body-cell)' },
192
246
  resizeHandle: { selector: () => '::part(resize-handle)' },
247
+ toggleDetailsPanelButton: { selector: () => 'vaadin-grid vaadin-icon.toggle-details-button' },
248
+ toggleDetailsPanelButtonOpened: {
249
+ selector: () => 'vaadin-grid vaadin-icon.toggle-details-button.opened',
250
+ },
251
+ toggleDetailsPanelButtonClosed: {
252
+ selector: () => 'vaadin-grid vaadin-icon.toggle-details-button.closed',
253
+ },
254
+ detailsPanel: { selector: () => 'vaadin-grid::part(details-cell)' },
255
+ detailsPanelLabels: { selector: () => 'vaadin-grid .row-details__label' },
256
+ detailsPanelContent: { selector: () => 'vaadin-grid .row-details' },
193
257
  };
194
258
 
195
259
  export const GridClass = compose(
@@ -213,7 +277,10 @@ export const GridClass = compose(
213
277
  borderWidth: { ...host, property: 'border-width' },
214
278
  borderStyle: { ...host, property: 'border-style' },
215
279
  borderRadius: { ...host, property: 'border-radius' },
216
- selectedBackgroundColor: { ...selectedRow, property: 'background-color' },
280
+ selectedBackgroundColor: [
281
+ { ...selectedRow, property: 'background-color' },
282
+ { ...selectedRowCell, property: 'background-color' },
283
+ ],
217
284
  headerRowTextColor: { ...headerRowCell, property: 'color' },
218
285
  separatorColor: [
219
286
  { ...firstRow, property: 'border-bottom-color' },
@@ -221,6 +288,19 @@ export const GridClass = compose(
221
288
  ],
222
289
  resizeHandleColor: { ...resizeHandle, property: 'background-color' },
223
290
  hostDirection: { ...host, property: 'direction', fallback: 'ltr' },
291
+ toggleDetailsPanelButtonSize: [
292
+ { ...toggleDetailsPanelButton, property: 'width' },
293
+ { ...toggleDetailsPanelButton, property: 'height' },
294
+ ],
295
+ toggleDetailsPanelButtonOpenedColor: { ...toggleDetailsPanelButtonOpened, property: 'color' },
296
+ toggleDetailsPanelButtonClosedColor: { ...toggleDetailsPanelButtonClosed, property: 'color' },
297
+ toggleDetailsPanelButtonCursor: { ...toggleDetailsPanelButton, property: 'cursor' },
298
+ detailsPanelBackgroundColor: { ...detailsPanel, property: 'background-color' },
299
+ detailsPanelBorderTopColor: { ...detailsPanel, property: 'border-top-color' },
300
+ detailsPanelLabelsColor: { ...detailsPanelLabels, property: 'color' },
301
+ detailsPanelLabelsFontSize: { ...detailsPanelLabels, property: 'font-size' },
302
+ detailsPanelItemsGap: { ...detailsPanelContent, property: 'grid-gap' },
303
+ detailsPanelPadding: { ...detailsPanelContent, property: 'padding' },
224
304
  },
225
305
  }),
226
306
  draggableMixin,
@@ -232,6 +312,7 @@ export const GridClass = compose(
232
312
  slots: [''],
233
313
  wrappedEleName: 'vaadin-grid',
234
314
  style: () => `
315
+ /*css*/
235
316
  vaadin-grid {
236
317
  overflow: hidden;
237
318
  height: 100%;
@@ -243,7 +324,36 @@ export const GridClass = compose(
243
324
  vaadin-grid::part(selected-row-cell) {
244
325
  background-image: none;
245
326
  box-shadow: none;
327
+ background-color: inherit;
328
+ }
329
+ vaadin-grid::part(details-cell) {
330
+ border-top-style: dashed;
331
+ border-top-width: 1px;
332
+ }
333
+ vaadin-grid .row-details {
334
+ display: grid;
335
+ grid-template-columns: repeat(auto-fit, minmax(max(200px, calc(100%/4 - var(${GridClass.cssVarList.detailsPanelItemsGap}))), 1fr));
336
+ width: 100%;
337
+ }
338
+ vaadin-grid .row-details__item:has(.row-details__value.json) {
339
+ grid-column: 1 / -1;
340
+ order: 2;
341
+ }
342
+ vaadin-grid .row-details__value.text {
343
+ overflow: hidden;
344
+ text-overflow: ellipsis;
345
+ white-space: pre;
346
+ }
347
+ vaadin-grid .row-details__value.json {
348
+ margin-top: 5px;
349
+ max-height: 120px;
350
+ overflow: scroll;
351
+ font-size: 0.85em;
352
+ }
353
+ vaadin-grid vaadin-icon.toggle-details-button {
354
+ margin: auto;
246
355
  }
356
+ /*!css*/
247
357
  `,
248
358
  excludeAttrsSync: ['columns', 'tabindex'],
249
359
  componentName,
@@ -0,0 +1,37 @@
1
+ /* eslint-disable no-param-reassign */
2
+ import { GridSortColumn } from '@vaadin/grid/vaadin-grid-sort-column';
3
+
4
+ export class GridItemDetailsColumnClass extends GridSortColumn {
5
+ get sortable() {
6
+ return this.getAttribute('sortable') === 'true';
7
+ }
8
+
9
+ // eslint-disable-next-line class-methods-use-this
10
+ _defaultRenderer(cell, _col, model) {
11
+ const grid = _col._gridValue;
12
+ const itemIdx = grid.detailsOpenedItems?.indexOf(model.item) ?? -1;
13
+ const isOpened = itemIdx !== -1;
14
+
15
+ const toggleIcon = document.createElement('vaadin-icon');
16
+ toggleIcon.icon = isOpened ? 'vaadin:angle-up' : 'vaadin:angle-down';
17
+ toggleIcon.classList.add('toggle-details-button', isOpened ? 'opened' : 'closed');
18
+ cell.innerHTML = '';
19
+ cell.append(toggleIcon);
20
+
21
+ toggleIcon.onclick = () => {
22
+ grid.detailsOpenedItems = isOpened
23
+ ? grid.detailsOpenedItems.toSpliced(itemIdx, 1)
24
+ : [...grid.detailsOpenedItems, model.item];
25
+ };
26
+ }
27
+
28
+ _defaultHeaderRenderer(root, _column) {
29
+ if (this.sortable) {
30
+ super._defaultHeaderRenderer(root, _column);
31
+
32
+ return;
33
+ }
34
+
35
+ this.__setTextContent(root, this.__getHeader(this.header, this.path));
36
+ }
37
+ }
@@ -0,0 +1,8 @@
1
+ import { getComponentName } from '../../../helpers/componentHelpers';
2
+ import { GridItemDetailsColumnClass } from './GridItemDetailsColumnClass';
3
+ import '@vaadin/icon';
4
+ import '@vaadin/icons';
5
+
6
+ export const componentName = getComponentName('grid-item-details-column');
7
+
8
+ customElements.define(componentName, GridItemDetailsColumnClass);
@@ -1,3 +1,5 @@
1
+ import { toTitle } from '../../helpers';
2
+
1
3
  export const isValidDataType = (data) => {
2
4
  const isValid = Array.isArray(data);
3
5
  if (!isValid) {
@@ -7,3 +9,55 @@ export const isValidDataType = (data) => {
7
9
 
8
10
  return isValid;
9
11
  };
12
+
13
+ export const isPlainObject = (value) => value?.constructor === Object;
14
+
15
+ export const getValueType = (value) => {
16
+ if (isPlainObject(value)) return 'object';
17
+ if (Array.isArray(value)) return 'array';
18
+
19
+ return 'text';
20
+ };
21
+
22
+ export const renderCodeSnippet = (value) =>
23
+ `<descope-code-snippet lang="json" class="row-details__value json">${JSON.stringify(
24
+ value,
25
+ null,
26
+ 2
27
+ )}</descope-code-snippet>`;
28
+
29
+ export const renderText = (text) =>
30
+ `<div class="row-details__value text" title="${text}">${text}</div>`;
31
+
32
+ const defaultRowDetailsValueRenderer = (value) => {
33
+ const valueType = getValueType(value);
34
+
35
+ if (valueType === 'object') {
36
+ return renderCodeSnippet(value);
37
+ }
38
+
39
+ if (valueType === 'array') {
40
+ if (value.some((v) => getValueType(v) === 'object')) {
41
+ return renderCodeSnippet(value);
42
+ }
43
+ return renderText(value.join(',\n'));
44
+ }
45
+
46
+ return renderText(value);
47
+ };
48
+
49
+ export const defaultRowDetailsRenderer = (item, itemLabelsMapping) => {
50
+ return `
51
+ <div class="row-details">
52
+ ${Object.entries(item)
53
+ .map(
54
+ ([key, value]) =>
55
+ `<div class="row-details__item" >
56
+ <div class="row-details__label">${itemLabelsMapping[key] || toTitle(key)}</div>
57
+ ${defaultRowDetailsValueRenderer(value)}
58
+ </div>`
59
+ )
60
+ .join('\n')}
61
+ </div>
62
+ `;
63
+ };
@@ -2,6 +2,7 @@ import '@vaadin/grid';
2
2
  import './descope-grid-text-column';
3
3
  import './descope-grid-custom-column';
4
4
  import './descope-grid-selection-column';
5
+ import './descope-grid-item-details-column';
5
6
 
6
7
  import { componentName, GridClass } from './GridClass';
7
8
 
@@ -52,3 +52,11 @@ export const compareArraysUnordered = (arr1, arr2) => {
52
52
 
53
53
  return true;
54
54
  };
55
+
56
+ export const toTitle = (str) =>
57
+ str
58
+ .replace(/([A-Z])/g, ' $1')
59
+ .trim()
60
+ .split(' ')
61
+ .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
62
+ .join(' ');
@@ -32,6 +32,17 @@ export const grid = {
32
32
  [vars.selectedBackgroundColor]: globalRefs.colors.surface.highlight,
33
33
  [vars.hostDirection]: globalRefs.direction,
34
34
 
35
+ [vars.toggleDetailsPanelButtonSize]: '1em',
36
+ [vars.toggleDetailsPanelButtonOpenedColor]: globalRefs.colors.surface.contrast,
37
+ [vars.toggleDetailsPanelButtonClosedColor]: globalRefs.colors.surface.light,
38
+ [vars.toggleDetailsPanelButtonCursor]: 'pointer',
39
+ [vars.detailsPanelBackgroundColor]: globalRefs.colors.surface.highlight,
40
+ [vars.detailsPanelBorderTopColor]: globalRefs.colors.surface.light,
41
+ [vars.detailsPanelLabelsColor]: globalRefs.colors.surface.dark,
42
+ [vars.detailsPanelLabelsFontSize]: '0.8em',
43
+ [vars.detailsPanelItemsGap]: '2em',
44
+ [vars.detailsPanelPadding]: '12px 0',
45
+
35
46
  _bordered: {
36
47
  [vars.borderColor]: refs.borderColor,
37
48
  },
package/dist/umd/2362.js DELETED
@@ -1,129 +0,0 @@
1
- /*! For license information please see 2362.js.LICENSE.txt */
2
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[2362],{21360:(t,e,o)=>{o.d(e,{W:()=>n});var s=o(91014),i=o(3550);const n=(0,s.o)((t=>class extends t{get _keyboardActive(){return(0,i.LQ)()}ready(){this.addEventListener("focusin",(t=>{this._shouldSetFocus(t)&&this._setFocused(!0)})),this.addEventListener("focusout",(t=>{this._shouldRemoveFocus(t)&&this._setFocused(!1)})),super.ready()}disconnectedCallback(){super.disconnectedCallback(),this.hasAttribute("focused")&&this._setFocused(!1)}_setFocused(t){this.toggleAttribute("focused",t),this.toggleAttribute("focus-ring",t&&this._keyboardActive)}_shouldSetFocus(t){return!0}_shouldRemoveFocus(t){return!0}}))},3550:(t,e,o)=>{o.d(e,{GF:()=>r,GO:()=>u,Gf:()=>i,LQ:()=>n,Qw:()=>a});let s=!1;function i(){let t=document.activeElement||document.body;for(;t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function n(){return s}function d(t){const e=t.style;if("hidden"===e.visibility||"none"===e.display)return!0;const o=window.getComputedStyle(t);return"hidden"===o.visibility||"none"===o.display}function l(t,e){const o=Math.max(t.tabIndex,0),s=Math.max(e.tabIndex,0);return 0===o||0===s?s>o:o>s}function h(t){const e=t.length;if(e<2)return t;const o=Math.ceil(e/2);return function(t,e){const o=[];for(;t.length>0&&e.length>0;)l(t[0],e[0])?o.push(e.shift()):o.push(t.shift());return o.concat(t,e)}(h(t.slice(0,o)),h(t.slice(o)))}function r(t){return null===t.offsetParent&&0===t.clientWidth&&0===t.clientHeight||d(t)}function a(t){return t.getRootNode().activeElement===t}function c(t,e){if(t.nodeType!==Node.ELEMENT_NODE||d(t))return!1;const o=t,s=function(t){if(!function(t){return!t.matches('[tabindex="-1"]')&&(t.matches("input, select, textarea, button, object")?t.matches(":not([disabled])"):t.matches("a[href], area[href], iframe, [tabindex], [contentEditable]"))}(t))return-1;const e=t.getAttribute("tabindex")||0;return Number(e)}(o);let i=s>0;s>=0&&e.push(o);let n=[];return n="slot"===o.localName?o.assignedNodes({flatten:!0}):(o.shadowRoot||o).children,[...n].forEach((t=>{i=c(t,e)||i})),i}function u(t){const e=[];return c(t,e)?h(e):e}window.addEventListener("keydown",(()=>{s=!0}),{capture:!0}),window.addEventListener("mousedown",(()=>{s=!1}),{capture:!0})},16155:(t,e,o)=>{o.d(e,{k:()=>s});const s=(0,o(91014).o)((t=>"function"==typeof t.prototype.addController?t:class extends t{constructor(){super(),this.__controllers=new Set}connectedCallback(){super.connectedCallback(),this.__controllers.forEach((t=>{t.hostConnected&&t.hostConnected()}))}disconnectedCallback(){super.disconnectedCallback(),this.__controllers.forEach((t=>{t.hostDisconnected&&t.hostDisconnected()}))}addController(t){this.__controllers.add(t),void 0!==this.$&&this.isConnected&&t.hostConnected&&t.hostConnected()}removeController(t){this.__controllers.delete(t)}}))},63726:(t,e,o)=>{function s(t){const e=[];for(;t;){if(t.nodeType===Node.DOCUMENT_NODE){e.push(t);break}t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?t=t.assignedSlot?t.assignedSlot:t.parentNode:(e.push(t),t=t.host)}return e}function i(t){const e=[];let o;return"slot"===t.localName?o=t.assignedElements():(e.push(t),o=[...t.children]),o.forEach((t=>e.push(...i(t)))),e}function n(t,e){return e?e.closest(t)||n(t,e.getRootNode().host):null}function d(t){return t?new Set(t.split(" ")):new Set}function l(t){return t?[...t].join(" "):""}function h(t,e,o){const s=d(t.getAttribute(e));s.add(o),t.setAttribute(e,l(s))}function r(t,e,o){const s=d(t.getAttribute(e));s.delete(o),0!==s.size?t.setAttribute(e,l(s)):t.removeAttribute(e)}function a(t){return t.nodeType===Node.TEXT_NODE&&""===t.textContent.trim()}o.d(e,{$2:()=>h,AD:()=>s,Q4:()=>n,dV:()=>l,eC:()=>a,hK:()=>d,xX:()=>i,x_:()=>r})},12521:(t,e,o)=>{o.d(e,{S:()=>r});var s=o(89387),i=o(87913),n=o(36139),d=o(51914);let l;(0,s.xj)(!1),window.Vaadin||(window.Vaadin={}),window.Vaadin.registrations||(window.Vaadin.registrations=[]),window.Vaadin.developmentModeCallback||(window.Vaadin.developmentModeCallback={}),window.Vaadin.developmentModeCallback["vaadin-usage-statistics"]=function(){};const h=new Set,r=t=>class extends((0,d.U)(t)){static finalize(){super.finalize();const{is:t}=this;t&&!h.has(t)&&(window.Vaadin.registrations.push(this),h.add(t),window.Vaadin.developmentModeCallback&&(l=n.dx.debounce(l,i.t$,(()=>{window.Vaadin.developmentModeCallback["vaadin-usage-statistics"]()})),(0,n.Ex)(l)))}constructor(){super(),null===document.doctype&&console.warn('Vaadin components require the "standards mode" declaration. Please add <!DOCTYPE html> to the HTML document.')}}},78591:(t,e,o)=>{o.d(e,{n:()=>d});var s=o(63726),i=o(44932),n=o(73971);class d extends EventTarget{static generateId(t,e){return`${e||"default"}-${t.localName}-${(0,n.l)()}`}constructor(t,e,o,s={}){super();const{initializer:i,multiple:n,observe:d,useUniqueId:l}=s;this.host=t,this.slotName=e,this.tagName=o,this.observe="boolean"!=typeof d||d,this.multiple="boolean"==typeof n&&n,this.slotInitializer=i,n&&(this.nodes=[]),l&&(this.defaultId=this.constructor.generateId(t,e))}hostConnected(){this.initialized||(this.multiple?this.initMultiple():this.initSingle(),this.observe&&this.observeSlot(),this.initialized=!0)}initSingle(){let t=this.getSlotChild();t?(this.node=t,this.initAddedNode(t)):(t=this.attachDefaultNode(),this.initNode(t))}initMultiple(){const t=this.getSlotChildren();if(0===t.length){const t=this.attachDefaultNode();t&&(this.nodes=[t],this.initNode(t))}else this.nodes=t,t.forEach((t=>{this.initAddedNode(t)}))}attachDefaultNode(){const{host:t,slotName:e,tagName:o}=this;let s=this.defaultNode;return!s&&o&&(s=document.createElement(o),s instanceof Element&&(""!==e&&s.setAttribute("slot",e),this.node=s,this.defaultNode=s)),s&&t.appendChild(s),s}getSlotChildren(){const{slotName:t}=this;return Array.from(this.host.childNodes).filter((e=>e.nodeType===Node.ELEMENT_NODE&&e.slot===t||e.nodeType===Node.TEXT_NODE&&e.textContent.trim()&&""===t))}getSlotChild(){return this.getSlotChildren()[0]}initNode(t){const{slotInitializer:e}=this;e&&e(t,this.host)}initCustomNode(t){}teardownNode(t){}initAddedNode(t){t!==this.defaultNode&&(this.initCustomNode(t),this.initNode(t))}observeSlot(){const{slotName:t}=this,e=""===t?"slot:not([name])":`slot[name=${t}]`,o=this.host.shadowRoot.querySelector(e);this.__slotObserver=new i.K(o,(({addedNodes:t,removedNodes:e})=>{const o=this.multiple?this.nodes:[this.node],i=t.filter((t=>!(0,s.eC)(t)&&!o.includes(t)));e.length&&(this.nodes=o.filter((t=>!e.includes(t))),e.forEach((t=>{this.teardownNode(t)}))),i&&i.length>0&&(this.multiple?(this.defaultNode&&this.defaultNode.remove(),this.nodes=[...o,...i].filter((t=>t!==this.defaultNode)),i.forEach((t=>{this.initAddedNode(t)}))):(this.node&&this.node.remove(),this.node=i[0],this.initAddedNode(this.node)))}))}}},44932:(t,e,o)=>{o.d(e,{K:()=>s});class s{constructor(t,e){this.slot=t,this.callback=e,this._storedNodes=[],this._connected=!1,this._scheduled=!1,this._boundSchedule=()=>{this._schedule()},this.connect(),this._schedule()}connect(){this.slot.addEventListener("slotchange",this._boundSchedule),this._connected=!0}disconnect(){this.slot.removeEventListener("slotchange",this._boundSchedule),this._connected=!1}_schedule(){this._scheduled||(this._scheduled=!0,queueMicrotask((()=>{this.flush()})))}flush(){this._connected&&(this._scheduled=!1,this._processNodes())}_processNodes(){const t=this.slot.assignedNodes({flatten:!0});let e=[];const o=[],s=[];t.length&&(e=t.filter((t=>!this._storedNodes.includes(t)))),this._storedNodes.length&&this._storedNodes.forEach(((e,i)=>{const n=t.indexOf(e);-1===n?o.push(e):n!==i&&s.push(e)})),(e.length||o.length||s.length)&&this.callback({addedNodes:e,movedNodes:s,removedNodes:o}),this._storedNodes=t}}},34463:(t,e,o)=>{o.d(e,{f:()=>i});var s=o(78591);class i extends s.n{constructor(t){super(t,"tooltip"),this.setTarget(t)}initCustomNode(t){t.target=this.target,void 0!==this.ariaTarget&&(t.ariaTarget=this.ariaTarget),void 0!==this.context&&(t.context=this.context),void 0!==this.manual&&(t.manual=this.manual),void 0!==this.opened&&(t.opened=this.opened),void 0!==this.position&&(t._position=this.position),void 0!==this.shouldShow&&(t.shouldShow=this.shouldShow),this.__notifyChange()}teardownNode(){this.__notifyChange()}setAriaTarget(t){this.ariaTarget=t;const e=this.node;e&&(e.ariaTarget=t)}setContext(t){this.context=t;const e=this.node;e&&(e.context=t)}setManual(t){this.manual=t;const e=this.node;e&&(e.manual=t)}setOpened(t){this.opened=t;const e=this.node;e&&(e.opened=t)}setPosition(t){this.position=t;const e=this.node;e&&(e._position=t)}setShouldShow(t){this.shouldShow=t;const e=this.node;e&&(e.shouldShow=t)}setTarget(t){this.target=t;const e=this.node;e&&(e.target=t)}__notifyChange(){this.dispatchEvent(new CustomEvent("tooltip-changed",{detail:{node:this.node}}))}}},73971:(t,e,o)=>{o.d(e,{l:()=>i});let s=0;function i(){return s++}},79098:(t,e,o)=>{o(24407);var s=o(46570),i=o(32463);const n=s.iv`
3
- :host {
4
- --lumo-size-xs: 1.625rem;
5
- --lumo-size-s: 1.875rem;
6
- --lumo-size-m: 2.25rem;
7
- --lumo-size-l: 2.75rem;
8
- --lumo-size-xl: 3.5rem;
9
-
10
- /* Icons */
11
- --lumo-icon-size-s: 1.25em;
12
- --lumo-icon-size-m: 1.5em;
13
- --lumo-icon-size-l: 2.25em;
14
- /* For backwards compatibility */
15
- --lumo-icon-size: var(--lumo-icon-size-m);
16
- }
17
- `;(0,i.K)("sizing-props",n)},34173:(t,e,o)=>{o(24407);var s=o(46570),i=o(32463);const n=s.iv`
18
- :host {
19
- /* prettier-ignore */
20
- --lumo-font-family: -apple-system, BlinkMacSystemFont, 'Roboto', 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
21
-
22
- /* Font sizes */
23
- --lumo-font-size-xxs: 0.75rem;
24
- --lumo-font-size-xs: 0.8125rem;
25
- --lumo-font-size-s: 0.875rem;
26
- --lumo-font-size-m: 1rem;
27
- --lumo-font-size-l: 1.125rem;
28
- --lumo-font-size-xl: 1.375rem;
29
- --lumo-font-size-xxl: 1.75rem;
30
- --lumo-font-size-xxxl: 2.5rem;
31
-
32
- /* Line heights */
33
- --lumo-line-height-xs: 1.25;
34
- --lumo-line-height-s: 1.375;
35
- --lumo-line-height-m: 1.625;
36
- }
37
- `,d=s.iv`
38
- body,
39
- :host {
40
- font-family: var(--lumo-font-family);
41
- font-size: var(--lumo-font-size-m);
42
- line-height: var(--lumo-line-height-m);
43
- -webkit-text-size-adjust: 100%;
44
- -webkit-font-smoothing: antialiased;
45
- -moz-osx-font-smoothing: grayscale;
46
- }
47
-
48
- small,
49
- [theme~='font-size-s'] {
50
- font-size: var(--lumo-font-size-s);
51
- line-height: var(--lumo-line-height-s);
52
- }
53
-
54
- [theme~='font-size-xs'] {
55
- font-size: var(--lumo-font-size-xs);
56
- line-height: var(--lumo-line-height-xs);
57
- }
58
-
59
- :where(h1, h2, h3, h4, h5, h6) {
60
- font-weight: 600;
61
- line-height: var(--lumo-line-height-xs);
62
- margin-block: 0;
63
- }
64
-
65
- :where(h1) {
66
- font-size: var(--lumo-font-size-xxxl);
67
- }
68
-
69
- :where(h2) {
70
- font-size: var(--lumo-font-size-xxl);
71
- }
72
-
73
- :where(h3) {
74
- font-size: var(--lumo-font-size-xl);
75
- }
76
-
77
- :where(h4) {
78
- font-size: var(--lumo-font-size-l);
79
- }
80
-
81
- :where(h5) {
82
- font-size: var(--lumo-font-size-m);
83
- }
84
-
85
- :where(h6) {
86
- font-size: var(--lumo-font-size-xs);
87
- text-transform: uppercase;
88
- letter-spacing: 0.03em;
89
- }
90
-
91
- p,
92
- blockquote {
93
- margin-top: 0.5em;
94
- margin-bottom: 0.75em;
95
- }
96
-
97
- a {
98
- text-decoration: none;
99
- }
100
-
101
- a:where(:any-link):hover {
102
- text-decoration: underline;
103
- }
104
-
105
- hr {
106
- display: block;
107
- align-self: stretch;
108
- height: 1px;
109
- border: 0;
110
- padding: 0;
111
- margin: var(--lumo-space-s) calc(var(--lumo-border-radius-m) / 2);
112
- background-color: var(--lumo-contrast-10pct);
113
- }
114
-
115
- blockquote {
116
- border-left: 2px solid var(--lumo-contrast-30pct);
117
- }
118
-
119
- b,
120
- strong {
121
- font-weight: 600;
122
- }
123
-
124
- /* RTL specific styles */
125
- blockquote[dir='rtl'] {
126
- border-left: none;
127
- border-right: 2px solid var(--lumo-contrast-30pct);
128
- }
129
- `;(0,s.hC)("",d,{moduleId:"lumo-typography"}),(0,i.K)("typography-props",n)}}]);
package/dist/umd/4978.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[4978],{33346:(t,e,s)=>{s.d(e,{s:()=>l});var i=s(2061),n=s(30357),r=s(33038),a=s(12666),o=s(28084);const l=({componentName:t,baseSelector:e=""})=>{class s extends HTMLElement{static get componentName(){return t}#t;#e=!0;get baseSelector(){return e}get baseElement(){return this.#t??=this.baseSelector?this.rootElement.querySelector(this.baseSelector):this,this.#t||console.warn("missing base element for component",this.localName),this.#t}get rootElement(){return this.shadowRoot||this}get name(){return this.getAttribute("name")}connectedCallback(){super.connectedCallback?.(),this.rootElement.isConnected&&this.#e&&(this.#e=!1,this.init?.())}}return(0,i.qC)(n.A,a._,o.Q,r.k)(s)}},65279:(t,e,s)=>{s.d(e,{gh:()=>i,k4:()=>n,qM:()=>a,qg:()=>r});const i="descope",n=3,r="host",a="@"},54567:(t,e,s)=>{s.d(e,{Db:()=>d,FX:()=>r,P$:()=>a,Tk:()=>c,iY:()=>h,oP:()=>u,tg:()=>l});var i=s(2061),n=s(65279);const r=(t,e,{excludeAttrs:s=[],includeAttrs:i=[]})=>{const n=Array.from(t.attributes).filter((t=>!s.includes(t.name)&&(!i.length||i.includes(t.name)))).map((t=>t.name));e(n),new MutationObserver((t=>{t.forEach((t=>{"attributes"!==t.type||s.includes(t.attributeName)||i.length&&!i.includes(t.attributeName)||e([t.attributeName])}))})).observe(t,{attributes:!0})},a=(t,e)=>{e({addedNodes:Array.from(t.children),removedNodes:[]}),new MutationObserver((t=>{t.forEach((t=>{"childList"!==t.type&&"characterData"!==t.type||e(t)}))})).observe(t,{childList:!0,characterData:!0,subtree:!0})},o=(t,e,s={})=>i=>{i.forEach((i=>{const n=s[i]||i,r=t.getAttribute(i);null!==r?e.getAttribute(n)!==r&&e.setAttribute(n,r):e.removeAttribute(n)}))},l=(t,e,s)=>{r(t,o(t,e),s),r(e,o(e,t),s)},h=t=>(0,i.E3)(n.gh,t),c=(...t)=>`--${(0,i.E3)(...t)}`,u=(t,e,s={})=>{r(t,o(t,e,s.mapAttrs),s)},d=(t,e,s=[])=>{if(!s.length)return;const i=s.reduce(((e,s)=>Object.assign(e,{[s]:{get:()=>t[s],set(e){t[s]=e}}})),{});Object.defineProperties(e,i)}},2061:(t,e,s)=>{s.d(e,{E3:()=>n,GL:()=>i,lo:()=>o,mf:()=>a,qC:()=>r});const i=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_.]+/g,"-").toLowerCase(),n=(...t)=>i(t.filter((t=>!!t)).join("-")),r=(...t)=>e=>t.reduceRight(((t,e)=>e(t)),e),a=t=>"function"==typeof t,o=(t,e)=>{if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;const s=t.slice().sort(),i=e.slice().sort();for(let t=0;t<s.length;t++)if(s[t]!==i[t])return!1;return!0}},37878:(t,e,s)=>{function i(t,e={}){const s=new Event(t,e);this[`on${t}`]?.(s),this.dispatchEvent(s)}s.d(e,{C:()=>i})},86557:(t,e,s)=>{s.d(e,{l:()=>n});var i=s(37878);const n=t=>class extends t{#s=i.C.bind(this,"change");init(){super.init?.(),this.prevValue=this.value,this.addEventListener("change",(t=>{t.stopPropagation()})),this.addEventListener("blur",(()=>{this.value!==this.prevValue&&(this.#s(),this.prevValue=this.value)}))}}},30357:(t,e,s)=>{s.d(e,{A:()=>i});const i=t=>class extends t{#i(){const e=this.localName;if(!t.componentName)throw Error('component name is not defined on super class, make sure you have a static get for "componentName"');if(e!==t.componentName)throw Error(`component name mismatch, expected "${t.componentName}", current "${e}"`)}init(){super.init?.(),this.#i()}}},33038:(t,e,s)=>{s.d(e,{k:()=>i});const i=t=>class extends t{updateComponentsContext(t){this.dispatchEvent(new CustomEvent("components-context",{bubbles:!0,composed:!0,detail:t}))}}},20370:(t,e,s)=>{s.d(e,{D:()=>o});var i=s(33346),n=s(2061),r=s(54567),a=s(37878);const o=({componentName:t,wrappedEleName:e,slots:s=[],style:o,excludeAttrsSync:l=[],includeAttrsSync:h=[],includeForwardProps:c=[],delegatesFocus:u=!0})=>{class d extends((0,i.s)({componentName:t,baseSelector:e})){#n=a.C.bind(this,"blur");#r=a.C.bind(this,"focus");constructor(){super().attachShadow({mode:"open",delegatesFocus:u}).innerHTML=`\n\t\t\t<style id="create-proxy">${((0,n.mf)(o)?o():o)||""}</style>\n\t\t\t<${e}>\n\t\t\t${s.map((t=>`<slot ${t?`name="${t}" slot="${t}"`:""} ></slot>`)).join("")}\n\t\t\t</${e}>\n\t\t`}init(){super.init?.(),this.baseElement.addEventListener("blur",(t=>{this.#n()})),this.baseElement.addEventListener("focus",(t=>{this.#r()})),(0,r.Db)(this.baseElement,this,c),(0,r.tg)(this.baseElement,this,{excludeAttrs:l,includeAttrs:h})}}return d}},74814:(t,e,s)=>{s.d(e,{SP:()=>o,i3:()=>l,wj:()=>a});var i=s(2061),n=s(54567);class r{constructor(){this.styleMap=new Map}add(t,e,s){this.styleMap.has(t)||this.styleMap.set(t,[]),this.styleMap.set(t,[...this.styleMap.get(t),{property:e,value:s}])}toString(){return Array.from(this.styleMap.entries()).reduce(((t,[e,s])=>`${t}${e} { \n${s.map((({property:t,value:e})=>`${t}: ${e}`)).join(";\n")} \n}\n\n`),"")}}const a=(t,e,s)=>{const a=new r;return Object.keys(s).forEach((r=>{const o=((t,e)=>{const s={selector:"",property:(0,i.GL)(t)};return e&&Object.keys(e).length?Array.isArray(e)?e.map((t=>({...s,...t}))):[{...s,...e}]:[s]})(r,s[r]),l=(0,n.Tk)(t,r);o.forEach((({selector:t,property:s,important:n,fallback:r})=>{a.add(((t="",e="")=>(0,i.mf)(e)?e(t):`${t}${/^[A-Za-z]/.test(e)?` ${e}`:e}`)(e,t),(0,i.mf)(s)?s():s,((t,e)=>`var(${t}${e?`, ${e}`:""})`)(l,r)+(n?"!important":""))}))})),a.toString()},o=(t,e)=>Object.keys(e).reduce(((e,s)=>Object.assign(e,{[s]:(0,n.Tk)(t,s)})),{}),l=(t,e)=>Array(e).fill(`.${t}`).join("")},9129:(t,e,s)=>{s.d(e,{y:()=>l});var i=s(65279),n=s(2061),r=s(54567),a=s(25561),o=s(74814);const l=({mappings:t={},componentNameOverride:e=""})=>s=>{const l=e||s.componentName;return class extends s{static get cssVarList(){return{...s.cssVarList,...(0,o.SP)(l,{...t})}}#a;#o;#l;#h;#c;#u;#d;#m;#p;constructor({getRootElement:e,componentNameSuffix:s="",themeSection:r=i.qg,baseSelector:a}={}){super(),this.#h=s,this.#c=r,this.#d=a??this.baseSelector,this.#p=e,this.#m=Object.keys(t).map((t=>(0,n.E3)("st",s,t)))}get#g(){return a.componentsThemeManager.currentTheme?.[l]||""}#b(){this.#o.innerHTML=this.#g[this.#c]}#E(){this.#o=document.createElement("style"),this.#o.id=`style-mixin-theme__${l}`,this.#u.prepend(this.#o),this.#l=a.componentsThemeManager.onCurrentThemeChange(this.#b.bind(this)),this.#b()}#v(){if(this.#m.length){this.#a=document.createElement("style"),this.#a.id=`style-mixin-overrides__${l}`;const t=(0,o.i3)(l,i.k4);this.#a.innerText=`:host(${t}) {}`,this.#u.append(this.#a)}}#y(t,e){const s=this.#a?.sheet?.cssRules[0].style;if(!s)return;const i=(0,r.Tk)(l,t.replace(new RegExp("^st-"),""));e?s?.setProperty(i,e):(s?.removeProperty(i),this.removeAttribute(t))}#f(t=[]){let e=!1;t.forEach((t=>{this.#m.includes(t)&&(this.#y(t,this.getAttribute(t)),e=!0)})),e&&(this.#a.innerHTML=this.#a?.sheet?.cssRules[0].cssText)}#A(){if(Object.keys(t).length){const e=document.createElement("style");e.id=`style-mixin-mappings__${l}`,e.innerHTML=(0,o.wj)((0,n.E3)(l,this.#h),this.#d,t),this.#u.prepend(e)}}#S(t){(this.#u.classList||this.#u.host.classList).add(t)}async init(){super.init?.(),this.shadowRoot.isConnected&&(this.#u=await(this.#p?.(this))||this.shadowRoot,this.#S(l),this.#A(),this.#E(),this.#v(),(0,r.FX)(this,this.#f.bind(this),{}))}disconnectedCallback(){super.disconnectedCallback?.(),this.#l?.()}}}},95579:(t,e,s)=>{s.d(e,{e:()=>i});const i=t=>class extends t{#w=null;static get observedAttributes(){return[...t.observedAttributes||[],"draggable"]}constructor(){super(),this.#w=document.createElement("style"),this.#w.innerText="* { cursor: inherit!important }"}#M(t){t?this.shadowRoot.appendChild(this.#w):this.#w.remove()}get isDraggable(){return this.hasAttribute("draggable")&&"false"!==this.getAttribute("draggable")}init(){this.addEventListener("mousedown",(t=>{if(this.isDraggable){const e=this.baseElement.getAttribute("tabindex");this.baseElement.setAttribute("tabindex","-1");const s=()=>{e?this.baseElement.setAttribute("tabindex",e):this.baseElement.removeAttribute("tabindex"),t.target.removeEventListener("mouseup",s),t.target.removeEventListener("dragend",s)};t.target.addEventListener("mouseup",s,{once:!0}),t.target.addEventListener("dragend",s,{once:!0})}})),super.init?.()}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),"draggable"===t&&this.#M("true"===s)}}},12666:(t,e,s)=>{s.d(e,{_:()=>i});const i=t=>class extends t{init(){super.init?.(),this.baseElement.addEventListener("mouseover",(t=>{this.setAttribute("hover","true"),t.target.addEventListener("mouseleave",(()=>this.removeAttribute("hover")),{once:!0})}))}}},94978:(t,e,s)=>{s.d(e,{Ae:()=>o.A,DM:()=>r.D,Iw:()=>c.I,QT:()=>d.Q,_A:()=>l._,dj:()=>a.d,e4:()=>n.e,li:()=>u.l,mE:()=>m.m,wX:()=>h.w,yk:()=>i.y});var i=s(9129),n=s(95579),r=s(20370),a=s(15584),o=s(30357),l=s(12666),h=s(89894),c=s(19772),u=s(86557),d=s(28084),m=s(61534)},61534:(t,e,s)=>{s.d(e,{m:()=>n});var i=s(37878);const n=t=>class extends t{init(){this.#C(),super.init?.()}#C(){["blur","focus","focusin","focusout"].forEach((t=>{this.addEventListener(t,(t=>{t.isTrusted&&t.target===this&&t.stopImmediatePropagation()}))}))}handleFocusEventsDispatching(t){let e;t?.forEach((t=>{t?.addEventListener("focusout",(t=>{t.stopImmediatePropagation(),e=setTimeout((()=>{e=null,i.C.call(this,"blur"),i.C.call(this,"focusout",{bubbles:!0})}))}));const s=t=>{t.stopImmediatePropagation(),clearTimeout(e),e||(i.C.call(this,"focus"),i.C.call(this,"focusin",{bubbles:!0}))};t?.addEventListener("focusin",s),t?.addEventListener("focus",s)}))}handleInputEventDispatching(){let t=this.value;this.addEventListener("input",(e=>{t===this.value?e.stopImmediatePropagation():t=this.value}))}}},89894:(t,e,s)=>{s.d(e,{w:()=>r}),s(95910);const i=["required","pattern"],n=Symbol("validationTarget"),r=t=>class extends t{#T=n;static get observedAttributes(){return[...t.observedAttributes||[],...i]}static get formAssociated(){return!0}#x;get internals(){return this.#x}set internals(t){this.#x=t}constructor(){super(),this.#x=this.attachInternals()}get defaultErrorMsgValueMissing(){return"Please fill out this field."}get defaultErrorMsgPatternMismatch(){return"Please match the requested format."}get defaultErrorMsgTooShort(){return`Minimum length is ${this.getAttribute("minlength")}.`}get defaultErrorMsgTooLong(){return`Maximum length is ${this.getAttribute("maxlength")}. `}get defaultErrorMsgRangeUnderflow(){return`At least ${this.getAttribute("min-items-selection")} items are required.`}get defaultErrorMsgRangeOverflow(){return`At most ${this.getAttribute("max-items-selection")} items are allowed.`}getErrorMessage(t){const{valueMissing:e,patternMismatch:s,typeMismatch:i,stepMismatch:n,tooShort:r,tooLong:a,rangeOverflow:o,rangeUnderflow:l,badInput:h,customError:c}=t;switch(!0){case e:return this.getAttribute("data-errormessage-value-missing")||this.defaultErrorMsgValueMissing;case s||i||n||h:return this.getAttribute("data-errormessage-pattern-mismatch")||this.defaultErrorMsgPatternMismatch;case r:return this.getAttribute("data-errormessage-pattern-mismatch-too-short")||this.defaultErrorMsgTooShort;case a:return this.getAttribute("data-errormessage-pattern-mismatch-too-long")||this.defaultErrorMsgTooLong;case l:return this.defaultErrorMsgRangeUnderflow;case o:return this.defaultErrorMsgRangeOverflow;case c:return this.validationMessage;default:return""}}#L(){const t=this.isReadOnly?{}:this.getValidity();this.#x.setValidity(t,this.getErrorMessage(t),this.validationTarget)}get validationMessage(){return this.#x.validationMessage}getValidity(){console.warn("getValidity","is not implemented")}checkValidity(){return this.#x.validity.valid}reportValidity(){return this.#x.reportValidity()}get validity(){return this.#x.validity}get validationTarget(){return this.#T===n?this.inputElement:this.#T}set validationTarget(t){this.#T=t}setCustomValidity(t){t?this.#x.setValidity({customError:!0},t,this.validationTarget):(this.#x.setValidity({}),this.#L())}get isRequired(){return this.hasAttribute("required")&&"false"!==this.getAttribute("required")}get isReadOnly(){return this.hasAttribute("readonly")&&"false"!==this.getAttribute("readonly")}get isDisabled(){return this.hasAttribute("disabled")&&"false"!==this.getAttribute("disabled")}get pattern(){return this.getAttribute("pattern")}get form(){return this.#x.form}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),i.includes(t)&&this.#L()}init(){super.init?.(),this.addEventListener("change",this.#L),this.addEventListener("invalid",(t=>t.stopPropagation())),this.addEventListener("input",this.#L),setTimeout((()=>this.#L()))}}},28084:(t,e,s)=>{s.d(e,{Q:()=>r});var i=s(54567);const n=["readonly","focused","invalid","has-label","required","disabled","checked","has-helper","has-value","step-buttons-visible","hover","has-error-message","focus-ring","opened","active","password-visible","opening","closing","has-no-options"],r=t=>class extends t{init(){super.init?.(),(0,i.FX)(this,(t=>t.forEach((t=>{const e=this.getAttribute(t);(t=>n.includes(t))(t)?""===e?this.setAttribute(t,"true"):"false"===e&&this.removeAttribute(t):e||console.debug(`attribute "${t}" has no value, should it be added to the boolean attributes list?`)}))),{})}}},19772:(t,e,s)=>{s.d(e,{I:()=>h});var i=s(65279),n=s(2061),r=s(54567),a=s(9129),o=s(74814);const l=t=>async e=>{const s=await t(e);return new Promise((t=>{let e=0;const i=()=>{if(e>20)return console.error("could not get shadow root for element",s),void t(s);e++,s?.shadowRoot?t(s.shadowRoot):setTimeout(i)};i()}))},h=({name:t,selector:e,mappings:s={},forward:{attributes:h=[],include:c=!0}={}})=>u=>{const d=t||(t=>t.replace(/[^\w\s]/gi,""))(e),m=(0,a.y)({mappings:s})(u);return class extends m{static get cssVarList(){return{...m.cssVarList,[d]:(0,o.SP)((0,n.E3)(u.componentName,"_"+d),s)}}#V;constructor(){const t=l((async t=>{const s=t.shadowRoot.querySelector(t.baseSelector);return e?(await l((()=>s))(t)).querySelector(e):s}));super({getRootElement:t,componentNameSuffix:"_"+d,themeSection:i.qM+d,baseSelector:":host"}),this.#V=t(this).then((t=>t.host))}async#k(){const t=await this.#V;t.onmouseenter=t=>{t.target.setAttribute("hover","true")},t.onmouseleave=t=>{t.target.removeAttribute("hover")}}async init(){super.init?.();const t=await this.#V;(0,r.oP)(this,t,{[c?"includeAttrs":"excludeAttrs"]:h}),this.#k()}}}},15584:(t,e,s)=>{s.d(e,{d:()=>u});var i=s(2061),n=s(54567),r=s(37878),a=s(9129),o=s(89894);const l=["invalid","required"],h=t=>{if(!t)return;let e=t;for(let t=0;t<10;t++)if([e]=e.assignedElements(),"slot"!==e?.localName)return e},c=({proxyProps:t=[],useProxyTargets:e=!1,inputEvent:s="input",triggerValidationEvents:i=[],proxyParentValidation:a=!1})=>c=>class extends((0,o.w)(c)){static get observedAttributes(){return[...c.observedAttributes||[],...l]}#$;#s=r.C.bind(this,"change");constructor(){super(),this.#$=super.inputElement}warnIfInputElementIsMissing(){clearTimeout(this.inputElementTimerId),this.inputElementTimerId=setTimeout((()=>{!this.#$&&console.warn(this.localName,"no input was found")}),0)}get inputElement(){if(this.#$)return this.#$;this.warnIfInputElementIsMissing();const t=this.baseElement.shadowRoot?.querySelector('slot[name="input"]'),e=this.baseElement.shadowRoot?.querySelector('slot[name="textarea"]');return this.#$=h(t)||h(e),this.#$}set inputElement(t){this.#$=t}getValidity(){return this.inputElement?.validity||{}}#N(){this.setAttribute("error-message",this.validationMessage)}reportValidity=()=>{this.inputElement.setCustomValidity(""),this.setCustomValidity(""),this.checkValidity()||(this.setAttribute("invalid","true"),this.#N(),this.focus())};defaultReportValidity(){return super.reportValidity()}init(){if(super.init?.(),this.baseElement._setInvalid=function(t){!t&&this._shouldSetInvalid(t)&&(this.invalid=t)},this.baseElement.addEventListener("input",(t=>{t.composed||this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))})),i.forEach((t=>{this.baseElement?.addEventListener(t,(()=>{this.inputElement?.setCustomValidity("")}))})),setTimeout((()=>{(Array.isArray(s)?s:[s]).forEach((t=>{this.baseElement?.addEventListener(t,(()=>{this.baseElement.checkValidity()?this.removeAttribute("invalid"):this.#N()}))})),this.baseElement.addEventListener("change",(()=>{this.#s()})),this.addEventListener("invalid",(()=>{this.checkValidity()||this.setAttribute("invalid","true"),this.#N()})),t.forEach((t=>{const s=e?[this.baseElement].filter(Boolean):[];((t,e,s)=>{const i=Array.isArray(e)?e:[e];Object.defineProperty(t,s,{set(t){i.forEach((e=>{e[s]=t}))},get:()=>e[0][s],configurable:!0})})(this,[this.inputElement,...s],t)})),this.setSelectionRange=this.inputElement.setSelectionRange?.bind(this.inputElement),(0,n.oP)(this,this.inputElement,{includeAttrs:["inputmode"]})})),a){const t=this.inputElement.internals,e=this;this.inputElement.internals=new Proxy(t,{get:(t,s)=>"function"==typeof t[s]&&"setValidity"===s?(...i)=>{if(3===i.length){const t=i.slice(0,i.length-1);t.push(e.inputElement),e.internals[s](...t)}else e.internals[s](...i);return t[s](...i)}:"function"==typeof t[s]?(...i)=>(e.internals[s](...i),t[s](...i)):t[s]})}}},u=t=>(0,i.qC)(c(t),(0,a.y)({componentNameOverride:(0,n.iY)("input-wrapper")}))}}]);