@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.
package/dist/docs/doc.mjs
CHANGED
|
@@ -1486,7 +1486,7 @@ function updateMandatory(combobox: ComboBox) {
|
|
|
1486
1486
|
</sd-field-validation-message>
|
|
1487
1487
|
`}
|
|
1488
1488
|
</div>
|
|
1489
|
-
`}updated(t){super.updated(t),this._needsAutocompletedCheck&&!this.autocompleted&&setTimeout(()=>{try{this.autocompleted=this.autocompleted||!!this.shadowRoot.querySelector(":-webkit-autofill")}catch{}},0),this.rows>1&&((t.has("min")||t.has("max")||t.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(t){if(super.update(t),t.has("validationMessage")&&(this.validationMessage?this._internals?.setValidity({customError:!0},this.validationMessage):this._internals?.setValidity(this.inputElement.validity,this.inputElement.validationMessage)),this._initialized&&t.has("rows"))throw Error("rows attribute cannot be changed after the input is attached to the DOM")}fireValueChange(t){this.dispatchEvent(new CustomEvent(`${t?"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);const t=this.shadowRoot.querySelector("sd-field-validation-message");this.requestUpdate("validationMessage",t==null?null:t.message)}}shouldFloat(){return this.alwaysFloatLabel||this.currentText||this.placeholder||this.autocompleted||this.type==="date"}setFormValue(t){this._internals?.setFormValue(t),this.updateFormValidity()}formResetCallback(){this.value=this._initialValue}formDisabledCallback(t){this.effectiveDisabled=t||this.hasAttribute("disabled")}formAssociatedCallback(t){this._needsAutocompletedCheck=!0}formStateRestoreCallback(t,e){typeof t=="string"&&(this.value=t)}},De.ID=wl,De.DEFAULT_MAX_LENGTH=524288,De.formAssociated=!0,De.shadowRootOptions={...We.shadowRootOptions,delegatesFocus:va},De);ie([B({type:String,reflect:!0})],ee.prototype,"label");ie([B({type:String,attribute:!0})],ee.prototype,"validationMessage");ie([B({type:String,attribute:!0})],ee.prototype,"validationIconSrc");ie([B({type:Ni,attribute:!0,reflect:!0})],ee.prototype,"validationLevel");ie([B({type:String,hasChanged(t,e){return e!=null&&e!=t}})],ee.prototype,"currentText");ie([B({type:Boolean,attribute:!0})],ee.prototype,"alwaysFloatLabel");ie([B({type:Boolean,attribute:!0})],ee.prototype,"autocompleted");ie([B({type:Number,attribute:!0})],ee.prototype,"rows");ie([B({type:Boolean,reflect:!0,attribute:"effective-disabled"})],ee.prototype,"effectiveDisabled");ie([B({type:Boolean,reflect:!0,attribute:"extended-prefix"})],ee.prototype,"extendedPrefix");ie([B({type:String,reflect:!0})],ee.prototype,"type");ie([B({type:String,reflect:!0})],ee.prototype,"placeholder");ie([B({type:String,reflect:!0})],ee.prototype,"sdAriaLabel");ie([B({type:Number,reflect:!0})],ee.prototype,"maxlength");ie([B({type:Boolean,reflect:!0})],ee.prototype,"readonly");ie([B({type:Boolean,reflect:!0})],ee.prototype,"required");ie([B({type:String,reflect:!0})],ee.prototype,"name");ie([B({type:Boolean,reflect:!0})],ee.prototype,"inactive");ie([B({type:String,attribute:!0})],ee.prototype,"autocomplete");ie([B({type:String,attribute:!0})],ee.prototype,"min");ie([B({type:String,attribute:!0})],ee.prototype,"max");ie([B({type:String,attribute:!0})],ee.prototype,"pattern");let hi=ee;customElements.get(hi.ID)||customElements.define(hi.ID,hi);const Ls={ATTRIBUTE:1,CHILD:2},ur=t=>(...e)=>({_$litDirective$:t,values:e});let hr=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,i,a){this._$Ct=e,this._$AM=i,this._$Ci=a}_$AS(e,i){return this.update(e,i)}update(e,i){return this.render(...i)}};class Ns extends hr{constructor(e){if(super(e),this.it=Y,e.type!==Ls.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===Y||e==null)return this._t=void 0,this.it=e;if(e===dt)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const i=[e];return i.raw=i,this._t={_$litType$:this.constructor.resultType,strings:i,values:[]}}}Ns.directiveName="unsafeHTML",Ns.resultType=1;const Sl=ur(Ns);const Cl=t=>t.strings===void 0;const Dt=(t,e)=>{const i=t._$AN;if(i===void 0)return!1;for(const a of i)a._$AO?.(e,!1),Dt(a,e);return!0},bi=t=>{let e,i;do{if((e=t._$AM)===void 0)break;i=e._$AN,i.delete(t),t=e}while(i?.size===0)},fr=t=>{for(let e;e=t._$AM;t=e){let i=e._$AN;if(i===void 0)e._$AN=i=new Set;else if(i.has(t))break;i.add(t),kl(e)}};function Al(t){this._$AN!==void 0?(bi(this),this._$AM=t,fr(this)):this._$AM=t}function El(t,e=!1,i=0){const a=this._$AH,s=this._$AN;if(s!==void 0&&s.size!==0)if(e)if(Array.isArray(a))for(let r=i;r<a.length;r++)Dt(a[r],!1),bi(a[r]);else a!=null&&(Dt(a,!1),bi(a));else Dt(this,t)}const kl=t=>{t.type==Ls.CHILD&&(t._$AP??=El,t._$AQ??=Al)};let Ml=class extends hr{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,i,a){super._$AT(e,i,a),fr(this),this.isConnected=e._$AU}_$AO(e,i=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),i&&(Dt(this,e),bi(this))}setValue(e){if(Cl(this._$Ct))this._$Ct._$AI(e,this);else{const i=[...this._$Ct._$AH];i[this._$Ci]=e,this._$Ct._$AI(i,this,0)}}disconnected(){}reconnected(){}};const bs=t=>t?t.startsWith("url")?t:`url("${t}")`:null,pr=(t,e)=>{if(t){const i=new Image;i.addEventListener("load",e),i.src=t,i.complete&&(i.removeEventListener("load",e),e())}};class Ol{static showImage(e,i,a,s){let r;s||!(e instanceof HTMLImageElement)?r=o=>e.style.backgroundImage=bs(o):r=o=>e.src=o,r(a),pr(i,()=>{r(i)})}}class Il extends Ml{constructor(e){if(super(e),e.type!==Ls.ATTRIBUTE||e.name!=="src"&&e.name!=="style")throw new Error("The `placeholder` directive must be used in the `src` or `style` attributes")}update(e,[i,a]){return this.useCssBackground=e.name=="style",this.render(i,a)}render(e,i){this.loadingToken!=null&&(this.loadingToken.cancelled=!0);const a={cancelled:!1};return this.loadingToken=a,typeof e=="string"?this.preload(e,a):e?.then(s=>{this.preload(s,a)}),this.useCssBackground?bs(i):i}preload(e,i){e!=null&&!i.cancelled&&pr(e,()=>{i.cancelled||this.setValue(this.useCssBackground?bs(e):e)})}}const Rl=ur(Il),$l=':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}';var Ll=Object.defineProperty,Ne=(t,e,i,a)=>{for(var s=void 0,r=t.length-1,o;r>=0;r--)(o=t[r])&&(s=o(e,i,s)||s);return s&&Ll(e,i,s),s},ot;const he=(ot=class extends We{constructor(){super(...arguments),this.contentMode="text",this.role="option"}static get styles(){return[Gt`
|
|
1489
|
+
`}updated(t){super.updated(t),this._needsAutocompletedCheck&&!this.autocompleted&&setTimeout(()=>{try{this.autocompleted=this.autocompleted||!!this.shadowRoot.querySelector(":-webkit-autofill")}catch{}},0),this.rows>1&&((t.has("min")||t.has("max")||t.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(t){if(super.update(t),t.has("validationMessage")&&(this.validationMessage?this._internals?.setValidity({customError:!0},this.validationMessage):this._internals?.setValidity(this.inputElement.validity,this.inputElement.validationMessage)),this._initialized&&t.has("rows"))throw Error("rows attribute cannot be changed after the input is attached to the DOM")}fireValueChange(t){this.dispatchEvent(new CustomEvent(`${t?"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);const t=this.shadowRoot.querySelector("sd-field-validation-message");this.requestUpdate("validationMessage",t==null?null:t.message)}}shouldFloat(){return this.alwaysFloatLabel||this.currentText||this.placeholder||this.autocompleted||this.type==="date"}setFormValue(t){this._internals?.setFormValue(t),this.updateFormValidity()}formResetCallback(){this.value=this._initialValue}formDisabledCallback(t){this.effectiveDisabled=t||this.hasAttribute("disabled")}formAssociatedCallback(t){this._needsAutocompletedCheck=!0}formStateRestoreCallback(t,e){typeof t=="string"&&(this.value=t)}},De.ID=wl,De.DEFAULT_MAX_LENGTH=524288,De.formAssociated=!0,De.shadowRootOptions={...We.shadowRootOptions,delegatesFocus:va},De);ie([B({type:String,reflect:!0})],ee.prototype,"label");ie([B({type:String,attribute:!0})],ee.prototype,"validationMessage");ie([B({type:String,attribute:!0})],ee.prototype,"validationIconSrc");ie([B({type:Ni,attribute:!0,reflect:!0})],ee.prototype,"validationLevel");ie([B({type:String,hasChanged(t,e){return e!=null&&e!=t}})],ee.prototype,"currentText");ie([B({type:Boolean,attribute:!0})],ee.prototype,"alwaysFloatLabel");ie([B({type:Boolean,attribute:!0})],ee.prototype,"autocompleted");ie([B({type:Number,attribute:!0})],ee.prototype,"rows");ie([B({type:Boolean,reflect:!0,attribute:"effective-disabled"})],ee.prototype,"effectiveDisabled");ie([B({type:Boolean,reflect:!0,attribute:"extended-prefix"})],ee.prototype,"extendedPrefix");ie([B({type:String,reflect:!0})],ee.prototype,"type");ie([B({type:String,reflect:!0})],ee.prototype,"placeholder");ie([B({type:String,reflect:!0})],ee.prototype,"sdAriaLabel");ie([B({type:Number,reflect:!0})],ee.prototype,"maxlength");ie([B({type:Boolean,reflect:!0})],ee.prototype,"readonly");ie([B({type:Boolean,reflect:!0})],ee.prototype,"required");ie([B({type:String,reflect:!0})],ee.prototype,"name");ie([B({type:Boolean,reflect:!0})],ee.prototype,"inactive");ie([B({type:String,attribute:!0})],ee.prototype,"autocomplete");ie([B({type:String,attribute:!0})],ee.prototype,"min");ie([B({type:String,attribute:!0})],ee.prototype,"max");ie([B({type:String,attribute:!0})],ee.prototype,"pattern");let hi=ee;customElements.get(hi.ID)||customElements.define(hi.ID,hi);const Ls={ATTRIBUTE:1,CHILD:2},ur=t=>(...e)=>({_$litDirective$:t,values:e});let hr=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,i,a){this._$Ct=e,this._$AM=i,this._$Ci=a}_$AS(e,i){return this.update(e,i)}update(e,i){return this.render(...i)}};class Ns extends hr{constructor(e){if(super(e),this.it=Y,e.type!==Ls.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===Y||e==null)return this._t=void 0,this.it=e;if(e===dt)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const i=[e];return i.raw=i,this._t={_$litType$:this.constructor.resultType,strings:i,values:[]}}}Ns.directiveName="unsafeHTML",Ns.resultType=1;const Sl=ur(Ns);const Cl=t=>t.strings===void 0;const Dt=(t,e)=>{const i=t._$AN;if(i===void 0)return!1;for(const a of i)a._$AO?.(e,!1),Dt(a,e);return!0},bi=t=>{let e,i;do{if((e=t._$AM)===void 0)break;i=e._$AN,i.delete(t),t=e}while(i?.size===0)},fr=t=>{for(let e;e=t._$AM;t=e){let i=e._$AN;if(i===void 0)e._$AN=i=new Set;else if(i.has(t))break;i.add(t),kl(e)}};function Al(t){this._$AN!==void 0?(bi(this),this._$AM=t,fr(this)):this._$AM=t}function El(t,e=!1,i=0){const a=this._$AH,s=this._$AN;if(s!==void 0&&s.size!==0)if(e)if(Array.isArray(a))for(let r=i;r<a.length;r++)Dt(a[r],!1),bi(a[r]);else a!=null&&(Dt(a,!1),bi(a));else Dt(this,t)}const kl=t=>{t.type==Ls.CHILD&&(t._$AP??=El,t._$AQ??=Al)};let Ml=class extends hr{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,i,a){super._$AT(e,i,a),fr(this),this.isConnected=e._$AU}_$AO(e,i=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),i&&(Dt(this,e),bi(this))}setValue(e){if(Cl(this._$Ct))this._$Ct._$AI(e,this);else{const i=[...this._$Ct._$AH];i[this._$Ci]=e,this._$Ct._$AI(i,this,0)}}disconnected(){}reconnected(){}};const bs=t=>t?t.startsWith("url")?t:`url("${t}")`:null,pr=(t,e)=>{if(t){const i=new Image;i.addEventListener("load",e),i.src=t,i.complete&&(i.removeEventListener("load",e),e())}};class Ol{static showImage(e,i,a,s){let r;s||!(e instanceof HTMLImageElement)?r=o=>e.style.backgroundImage=bs(o):r=o=>e.src=o,r(a),pr(i,()=>{r(i)})}}class Il extends Ml{constructor(e){if(super(e),e.type!==Ls.ATTRIBUTE||e.name!=="src"&&e.name!=="style")throw new Error("The `placeholder` directive must be used in the `src` or `style` attributes")}update(e,[i,a]){return this.useCssBackground=e.name=="style",this.render(i,a)}render(e,i){this.loadingToken!=null&&(this.loadingToken.cancelled=!0);const a={cancelled:!1};return this.loadingToken=a,typeof e=="string"?this.preload(e,a):e?.then(s=>{this.preload(s,a)}),this.useCssBackground?bs(i):i}preload(e,i){e!=null&&!i.cancelled&&pr(e,()=>{i.cancelled||this.setValue(this.useCssBackground?bs(e):e)})}}const Rl=ur(Il),$l=':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}';var Ll=Object.defineProperty,Ne=(t,e,i,a)=>{for(var s=void 0,r=t.length-1,o;r>=0;r--)(o=t[r])&&(s=o(e,i,s)||s);return s&&Ll(e,i,s),s},ot;const he=(ot=class extends We{constructor(){super(...arguments),this.contentMode="text",this.role="option"}static get styles(){return[Gt`
|
|
1490
1490
|
${At($l)}
|
|
1491
1491
|
`]}render(){return be`
|
|
1492
1492
|
<div class="container">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cas-smartdesign/combo-box",
|
|
3
|
-
"version": "7.5.
|
|
3
|
+
"version": "7.5.2",
|
|
4
4
|
"description": "A combo-box element with the look and feel of the SmartDesign inputs & list item layouts",
|
|
5
5
|
"main": "dist/combo-box-with-externals.js",
|
|
6
6
|
"module": "dist/combo-box.mjs",
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@popperjs/core": "^2.11.8",
|
|
11
11
|
"lit": "^3.3.1",
|
|
12
|
-
"@cas-smartdesign/image-tools": "^3.2.0",
|
|
13
|
-
"@cas-smartdesign/lit-input": "^7.4.1",
|
|
14
12
|
"@cas-smartdesign/list-item": "^7.4.0",
|
|
13
|
+
"@cas-smartdesign/lit-input": "^7.4.2",
|
|
14
|
+
"@cas-smartdesign/image-tools": "^3.2.0",
|
|
15
15
|
"@cas-smartdesign/virtual-list": "^6.3.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|