@cas-smartdesign/combo-box 7.5.1 → 7.5.2
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.
|
@@ -71,7 +71,7 @@ var window;(window||={})["@cas-smartdesign/combo-box"]=(()=>{var Ye=Object.defin
|
|
|
71
71
|
</sd-field-validation-message>
|
|
72
72
|
`}
|
|
73
73
|
</div>
|
|
74
|
-
`}updated(e){super.updated(e),this._needsAutocompletedCheck&&!this.autocompleted&&setTimeout(()=>{try{this.autocompleted=this.autocompleted||!!this.shadowRoot.querySelector(":-webkit-autofill")}catch{}},0),this.rows>1&&((e.has("min")||e.has("max")||e.has("pattern"))&&console.warn("min, max & pattern attributes are not supported with multiple rows configuration."),this.type!="text"&&console.warn(`type: ${this.type} is not supported with multiple rows configuration.`))}update(e){if(super.update(e),e.has("validationMessage")&&(this.validationMessage?this._internals?.setValidity({customError:!0},this.validationMessage):this._internals?.setValidity(this.inputElement.validity,this.inputElement.validationMessage)),this._initialized&&e.has("rows"))throw Error("rows attribute cannot be changed after the input is attached to the DOM")}fireValueChange(e){this.dispatchEvent(new CustomEvent(`${e?"immediate-":""}value-change`,{detail:{value:this.value}})),this.setFormValue(this.value)}updateFormValidity(){if(this.validationMessage==null){this._internals.setValidity(this.inputElement.validity,this.inputElement.validationMessage);let e=this.shadowRoot.querySelector("sd-field-validation-message");this.requestUpdate("validationMessage",e==null?null:e.message)}}shouldFloat(){return this.alwaysFloatLabel||this.currentText||this.placeholder||this.autocompleted||this.type==="date"}setFormValue(e){this._internals?.setFormValue(e),this.updateFormValidity()}formResetCallback(){this.value=this._initialValue}formDisabledCallback(e){this.effectiveDisabled=e||this.hasAttribute("disabled")}formAssociatedCallback(e){this._needsAutocompletedCheck=!0}formStateRestoreCallback(e,t){typeof e=="string"&&(this.value=e)}},nt.ID=Ms,nt.DEFAULT_MAX_LENGTH=524288,nt.formAssociated=!0,nt.shadowRootOptions={...W.shadowRootOptions,delegatesFocus:bo},nt);I([h({type:String,reflect:!0})],$.prototype,"label");I([h({type:String,attribute:!0})],$.prototype,"validationMessage");I([h({type:String,attribute:!0})],$.prototype,"validationIconSrc");I([h({type:fe,attribute:!0,reflect:!0})],$.prototype,"validationLevel");I([h({type:String,hasChanged(e,t){return t!=null&&t!=e}})],$.prototype,"currentText");I([h({type:Boolean,attribute:!0})],$.prototype,"alwaysFloatLabel");I([h({type:Boolean,attribute:!0})],$.prototype,"autocompleted");I([h({type:Number,attribute:!0})],$.prototype,"rows");I([h({type:Boolean,reflect:!0,attribute:"effective-disabled"})],$.prototype,"effectiveDisabled");I([h({type:Boolean,reflect:!0,attribute:"extended-prefix"})],$.prototype,"extendedPrefix");I([h({type:String,reflect:!0})],$.prototype,"type");I([h({type:String,reflect:!0})],$.prototype,"placeholder");I([h({type:String,reflect:!0})],$.prototype,"sdAriaLabel");I([h({type:Number,reflect:!0})],$.prototype,"maxlength");I([h({type:Boolean,reflect:!0})],$.prototype,"readonly");I([h({type:Boolean,reflect:!0})],$.prototype,"required");I([h({type:String,reflect:!0})],$.prototype,"name");I([h({type:Boolean,reflect:!0})],$.prototype,"inactive");I([h({type:String,attribute:!0})],$.prototype,"autocomplete");I([h({type:String,attribute:!0})],$.prototype,"min");I([h({type:String,attribute:!0})],$.prototype,"max");I([h({type:String,attribute:!0})],$.prototype,"pattern");var me=$;customElements.get(me.ID)||customElements.define(me.ID,me);var Yt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ve=e=>(...t)=>({_$litDirective$:e,values:t}),Xt=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,i,o){this._$Ct=t,this._$AM=i,this._$Ci=o}_$AS(t,i){return this.update(t,i)}update(t,i){return this.render(...i)}};var ge=class extends Xt{constructor(t){if(super(t),this.it=_,t.type!==Yt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===_||t==null)return this._t=void 0,this.it=t;if(t===ct)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;let i=[t];return i.raw=i,this._t={_$litType$:this.constructor.resultType,strings:i,values:[]}}};ge.directiveName="unsafeHTML",ge.resultType=1;var xo=ve(ge);var{I:Hd}=Gi;var yo=e=>e.strings===void 0;var be=(e,t)=>{let i=e._$AN;if(i===void 0)return!1;for(let o of i)o._$AO?.(t,!1),be(o,t);return!0},He=e=>{let t,i;do{if((t=e._$AM)===void 0)break;i=t._$AN,i.delete(e),e=t}while(i?.size===0)},_o=e=>{for(let t;t=e._$AM;e=t){let i=t._$AN;if(i===void 0)t._$AN=i=new Set;else if(i.has(e))break;i.add(e),zs(t)}};function Ns(e){this._$AN!==void 0?(He(this),this._$AM=e,_o(this)):this._$AM=e}function Hs(e,t=!1,i=0){let o=this._$AH,s=this._$AN;if(s!==void 0&&s.size!==0)if(t)if(Array.isArray(o))for(let r=i;r<o.length;r++)be(o[r],!1),He(o[r]);else o!=null&&(be(o,!1),He(o));else be(this,e)}var zs=e=>{e.type==Yt.CHILD&&(e._$AP??=Hs,e._$AQ??=Ns)},ze=class extends Xt{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,i,o){super._$AT(t,i,o),_o(this),this.isConnected=t._$AU}_$AO(t,i=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),i&&(be(this,t),He(this))}setValue(t){if(yo(this._$Ct))this._$Ct._$AI(t,this);else{let i=[...this._$Ct._$AH];i[this._$Ci]=t,this._$Ct._$AI(i,this,0)}}disconnected(){}reconnected(){}};var wi=e=>e?e.startsWith("url")?e:`url("${e}")`:null,wo=(e,t)=>{if(e){let i=new Image;i.addEventListener("load",t),i.src=e,i.complete&&(i.removeEventListener("load",t),t())}},Fe=class{static showImage(t,i,o,s){let r;s||!(t instanceof HTMLImageElement)?r=n=>t.style.backgroundImage=wi(n):r=n=>t.src=n,r(o),wo(i,()=>{r(i)})}},Ai=class extends ze{constructor(t){if(super(t),t.type!==Yt.ATTRIBUTE||t.name!=="src"&&t.name!=="style")throw new Error("The `placeholder` directive must be used in the `src` or `style` attributes")}update(t,[i,o]){return this.useCssBackground=t.name=="style",this.render(i,o)}render(t,i){this.loadingToken!=null&&(this.loadingToken.cancelled=!0);let o={cancelled:!1};return this.loadingToken=o,typeof t=="string"?this.preload(t,o):t?.then(s=>{this.preload(s,o)}),this.useCssBackground?wi(i):i}preload(t,i){t!=null&&!i.cancelled&&wo(t,()=>{i.cancelled||this.setValue(this.useCssBackground?wi(t):t)})}},Ao=ve(Ai);var Fs=':host{display:block;contain:strict;height:50px}:host([selected]){background-color:#d3e6fa}:host(:not([selected]):hover),:host(:not([selected])[focused]){background-color:#e7f1fa}@media (forced-colors: active){:host([selected]){outline:4px solid}:host(:not([selected]):hover){outline:4px dotted}:host(:not([selected])[focused]){outline:4px dashed}}:host([enable-line-clamp]) .labels>:only-child{display:-webkit-box;overflow:hidden;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:normal;overflow-wrap:break-word}.container{display:flex;height:100%;box-sizing:border-box}.container .level-indicator{width:7px;height:100%}.container .level-indicator.level-0{background-color:#a0c3ef}.container .level-indicator.level-1{background-color:#e7c374}.container .level-indicator.level-2{background-color:#bfd596}.container .level-indicator.level-3{background-color:#fd998d}.container .level-indicator.level-4{background-color:#c6e8f5}.container .level-indicator.level-5{background-color:#fde3a4}.container .level-indicator.level-6{background-color:#dcbfe0}.side-content{display:flex;align-items:center;flex-grow:0}.labels{display:flex;flex-direction:column;justify-content:center;flex:1 1 0px;height:100%;line-height:normal;overflow:hidden;padding:var(--sd-list-item-label-content-padding, 0 8px)}.caption,.description{width:100%;font-family:var(--sd-list-item-font-family, "Segoe UI", "Lucida Sans", Arial, sans-serif);font-style:normal;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;-webkit-user-select:none;user-select:none;text-decoration:var(--sd-list-item-text-decoration, inherit)}.caption em,.description em{font-weight:bolder}.caption{font-size:var(--sd-list-item-caption-font-size, 16px);color:var(--sd-list-item-caption-text-color, #111);font-weight:var(--sd-list-item-caption-font-weight, normal)}.description{font-size:var(--sd-list-item-description-font-size, 13px);color:var(--sd-list-item-description-text-color, #767676);font-weight:var(--sd-list-item-description-font-weight, normal)}.icon-wrapper{width:var(--sd-list-item-icon-wrapper-width, 45px);height:100%;display:flex;align-items:center;justify-content:center}.icon-wrapper .icon{min-height:var(--sd-list-item-icon-size, 24px);min-width:var(--sd-list-item-icon-size, 24px);background-repeat:no-repeat;background-position:center;background-size:cover}',qs=Object.defineProperty,K=(e,t,i,o)=>{for(var s=void 0,r=e.length-1,n;r>=0;r--)(n=e[r])&&(s=n(t,i,s)||s);return s&&qs(t,i,s),s},Nt,q=(Nt=class extends W{constructor(){super(...arguments),this.contentMode="text",this.role="option"}static get styles(){return[it`
|
|
74
|
+
`}updated(e){super.updated(e),this._needsAutocompletedCheck&&!this.autocompleted&&setTimeout(()=>{try{this.autocompleted=this.autocompleted||!!this.shadowRoot.querySelector(":-webkit-autofill")}catch{}},0),this.rows>1&&((e.has("min")||e.has("max")||e.has("pattern"))&&console.warn("min, max & pattern attributes are not supported with multiple rows configuration."),this.type!="text"&&console.warn(`type: ${this.type} is not supported with multiple rows configuration.`))}update(e){if(super.update(e),e.has("validationMessage")&&(this.validationMessage?this._internals?.setValidity({customError:!0},this.validationMessage):this._internals?.setValidity(this.inputElement.validity,this.inputElement.validationMessage)),this._initialized&&e.has("rows"))throw Error("rows attribute cannot be changed after the input is attached to the DOM")}fireValueChange(e){this.dispatchEvent(new CustomEvent(`${e?"immediate-":""}value-change`,{detail:{value:this.value}})),this.setFormValue(this.value)}updateFormValidity(){if(this.validationMessage==null&&this.inputElement!=null){this._internals.setValidity(this.inputElement.validity,this.inputElement.validationMessage);let e=this.shadowRoot.querySelector("sd-field-validation-message");this.requestUpdate("validationMessage",e==null?null:e.message)}}shouldFloat(){return this.alwaysFloatLabel||this.currentText||this.placeholder||this.autocompleted||this.type==="date"}setFormValue(e){this._internals?.setFormValue(e),this.updateFormValidity()}formResetCallback(){this.value=this._initialValue}formDisabledCallback(e){this.effectiveDisabled=e||this.hasAttribute("disabled")}formAssociatedCallback(e){this._needsAutocompletedCheck=!0}formStateRestoreCallback(e,t){typeof e=="string"&&(this.value=e)}},nt.ID=Ms,nt.DEFAULT_MAX_LENGTH=524288,nt.formAssociated=!0,nt.shadowRootOptions={...W.shadowRootOptions,delegatesFocus:bo},nt);I([h({type:String,reflect:!0})],$.prototype,"label");I([h({type:String,attribute:!0})],$.prototype,"validationMessage");I([h({type:String,attribute:!0})],$.prototype,"validationIconSrc");I([h({type:fe,attribute:!0,reflect:!0})],$.prototype,"validationLevel");I([h({type:String,hasChanged(e,t){return t!=null&&t!=e}})],$.prototype,"currentText");I([h({type:Boolean,attribute:!0})],$.prototype,"alwaysFloatLabel");I([h({type:Boolean,attribute:!0})],$.prototype,"autocompleted");I([h({type:Number,attribute:!0})],$.prototype,"rows");I([h({type:Boolean,reflect:!0,attribute:"effective-disabled"})],$.prototype,"effectiveDisabled");I([h({type:Boolean,reflect:!0,attribute:"extended-prefix"})],$.prototype,"extendedPrefix");I([h({type:String,reflect:!0})],$.prototype,"type");I([h({type:String,reflect:!0})],$.prototype,"placeholder");I([h({type:String,reflect:!0})],$.prototype,"sdAriaLabel");I([h({type:Number,reflect:!0})],$.prototype,"maxlength");I([h({type:Boolean,reflect:!0})],$.prototype,"readonly");I([h({type:Boolean,reflect:!0})],$.prototype,"required");I([h({type:String,reflect:!0})],$.prototype,"name");I([h({type:Boolean,reflect:!0})],$.prototype,"inactive");I([h({type:String,attribute:!0})],$.prototype,"autocomplete");I([h({type:String,attribute:!0})],$.prototype,"min");I([h({type:String,attribute:!0})],$.prototype,"max");I([h({type:String,attribute:!0})],$.prototype,"pattern");var me=$;customElements.get(me.ID)||customElements.define(me.ID,me);var Yt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ve=e=>(...t)=>({_$litDirective$:e,values:t}),Xt=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,i,o){this._$Ct=t,this._$AM=i,this._$Ci=o}_$AS(t,i){return this.update(t,i)}update(t,i){return this.render(...i)}};var ge=class extends Xt{constructor(t){if(super(t),this.it=_,t.type!==Yt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===_||t==null)return this._t=void 0,this.it=t;if(t===ct)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;let i=[t];return i.raw=i,this._t={_$litType$:this.constructor.resultType,strings:i,values:[]}}};ge.directiveName="unsafeHTML",ge.resultType=1;var xo=ve(ge);var{I:Hd}=Gi;var yo=e=>e.strings===void 0;var be=(e,t)=>{let i=e._$AN;if(i===void 0)return!1;for(let o of i)o._$AO?.(t,!1),be(o,t);return!0},He=e=>{let t,i;do{if((t=e._$AM)===void 0)break;i=t._$AN,i.delete(e),e=t}while(i?.size===0)},_o=e=>{for(let t;t=e._$AM;e=t){let i=t._$AN;if(i===void 0)t._$AN=i=new Set;else if(i.has(e))break;i.add(e),zs(t)}};function Ns(e){this._$AN!==void 0?(He(this),this._$AM=e,_o(this)):this._$AM=e}function Hs(e,t=!1,i=0){let o=this._$AH,s=this._$AN;if(s!==void 0&&s.size!==0)if(t)if(Array.isArray(o))for(let r=i;r<o.length;r++)be(o[r],!1),He(o[r]);else o!=null&&(be(o,!1),He(o));else be(this,e)}var zs=e=>{e.type==Yt.CHILD&&(e._$AP??=Hs,e._$AQ??=Ns)},ze=class extends Xt{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,i,o){super._$AT(t,i,o),_o(this),this.isConnected=t._$AU}_$AO(t,i=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),i&&(be(this,t),He(this))}setValue(t){if(yo(this._$Ct))this._$Ct._$AI(t,this);else{let i=[...this._$Ct._$AH];i[this._$Ci]=t,this._$Ct._$AI(i,this,0)}}disconnected(){}reconnected(){}};var wi=e=>e?e.startsWith("url")?e:`url("${e}")`:null,wo=(e,t)=>{if(e){let i=new Image;i.addEventListener("load",t),i.src=e,i.complete&&(i.removeEventListener("load",t),t())}},Fe=class{static showImage(t,i,o,s){let r;s||!(t instanceof HTMLImageElement)?r=n=>t.style.backgroundImage=wi(n):r=n=>t.src=n,r(o),wo(i,()=>{r(i)})}},Ai=class extends ze{constructor(t){if(super(t),t.type!==Yt.ATTRIBUTE||t.name!=="src"&&t.name!=="style")throw new Error("The `placeholder` directive must be used in the `src` or `style` attributes")}update(t,[i,o]){return this.useCssBackground=t.name=="style",this.render(i,o)}render(t,i){this.loadingToken!=null&&(this.loadingToken.cancelled=!0);let o={cancelled:!1};return this.loadingToken=o,typeof t=="string"?this.preload(t,o):t?.then(s=>{this.preload(s,o)}),this.useCssBackground?wi(i):i}preload(t,i){t!=null&&!i.cancelled&&wo(t,()=>{i.cancelled||this.setValue(this.useCssBackground?wi(t):t)})}},Ao=ve(Ai);var Fs=':host{display:block;contain:strict;height:50px}:host([selected]){background-color:#d3e6fa}:host(:not([selected]):hover),:host(:not([selected])[focused]){background-color:#e7f1fa}@media (forced-colors: active){:host([selected]){outline:4px solid}:host(:not([selected]):hover){outline:4px dotted}:host(:not([selected])[focused]){outline:4px dashed}}:host([enable-line-clamp]) .labels>:only-child{display:-webkit-box;overflow:hidden;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:normal;overflow-wrap:break-word}.container{display:flex;height:100%;box-sizing:border-box}.container .level-indicator{width:7px;height:100%}.container .level-indicator.level-0{background-color:#a0c3ef}.container .level-indicator.level-1{background-color:#e7c374}.container .level-indicator.level-2{background-color:#bfd596}.container .level-indicator.level-3{background-color:#fd998d}.container .level-indicator.level-4{background-color:#c6e8f5}.container .level-indicator.level-5{background-color:#fde3a4}.container .level-indicator.level-6{background-color:#dcbfe0}.side-content{display:flex;align-items:center;flex-grow:0}.labels{display:flex;flex-direction:column;justify-content:center;flex:1 1 0px;height:100%;line-height:normal;overflow:hidden;padding:var(--sd-list-item-label-content-padding, 0 8px)}.caption,.description{width:100%;font-family:var(--sd-list-item-font-family, "Segoe UI", "Lucida Sans", Arial, sans-serif);font-style:normal;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;-webkit-user-select:none;user-select:none;text-decoration:var(--sd-list-item-text-decoration, inherit)}.caption em,.description em{font-weight:bolder}.caption{font-size:var(--sd-list-item-caption-font-size, 16px);color:var(--sd-list-item-caption-text-color, #111);font-weight:var(--sd-list-item-caption-font-weight, normal)}.description{font-size:var(--sd-list-item-description-font-size, 13px);color:var(--sd-list-item-description-text-color, #767676);font-weight:var(--sd-list-item-description-font-weight, normal)}.icon-wrapper{width:var(--sd-list-item-icon-wrapper-width, 45px);height:100%;display:flex;align-items:center;justify-content:center}.icon-wrapper .icon{min-height:var(--sd-list-item-icon-size, 24px);min-width:var(--sd-list-item-icon-size, 24px);background-repeat:no-repeat;background-position:center;background-size:cover}',qs=Object.defineProperty,K=(e,t,i,o)=>{for(var s=void 0,r=e.length-1,n;r>=0;r--)(n=e[r])&&(s=n(t,i,s)||s);return s&&qs(t,i,s),s},Nt,q=(Nt=class extends W{constructor(){super(...arguments),this.contentMode="text",this.role="option"}static get styles(){return[it`
|
|
75
75
|
${X(Fs)}
|
|
76
76
|
`]}render(){return L`
|
|
77
77
|
<div class="container">
|