@cas-smartdesign/token-selector 1.0.1 → 1.0.3
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/token-selector"]=(()=>{var ii=Object.
|
|
|
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=vo,nt.DEFAULT_MAX_LENGTH=524288,nt.formAssociated=!0,nt.shadowRootOptions={...D.shadowRootOptions,delegatesFocus:rs},nt);$([h({type:String,reflect:!0})],k.prototype,"label");$([h({type:String,attribute:!0})],k.prototype,"validationMessage");$([h({type:String,attribute:!0})],k.prototype,"validationIconSrc");$([h({type:ue,attribute:!0,reflect:!0})],k.prototype,"validationLevel");$([h({type:String,hasChanged(e,t){return t!=null&&t!=e}})],k.prototype,"currentText");$([h({type:Boolean,attribute:!0})],k.prototype,"alwaysFloatLabel");$([h({type:Boolean,attribute:!0})],k.prototype,"autocompleted");$([h({type:Number,attribute:!0})],k.prototype,"rows");$([h({type:Boolean,reflect:!0,attribute:"effective-disabled"})],k.prototype,"effectiveDisabled");$([h({type:Boolean,reflect:!0,attribute:"extended-prefix"})],k.prototype,"extendedPrefix");$([h({type:String,reflect:!0})],k.prototype,"type");$([h({type:String,reflect:!0})],k.prototype,"placeholder");$([h({type:String,reflect:!0})],k.prototype,"sdAriaLabel");$([h({type:Number,reflect:!0})],k.prototype,"maxlength");$([h({type:Boolean,reflect:!0})],k.prototype,"readonly");$([h({type:Boolean,reflect:!0})],k.prototype,"required");$([h({type:String,reflect:!0})],k.prototype,"name");$([h({type:Boolean,reflect:!0})],k.prototype,"inactive");$([h({type:String,attribute:!0})],k.prototype,"autocomplete");$([h({type:String,attribute:!0})],k.prototype,"min");$([h({type:String,attribute:!0})],k.prototype,"max");$([h({type:String,attribute:!0})],k.prototype,"pattern");var ui=k;customElements.get(ui.ID)||customElements.define(ui.ID,ui);var Yt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Ot=e=>(...t)=>({_$litDirective$:e,values:t}),Xt=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,i,s){this._$Ct=t,this._$AM=i,this._$Ci=s}_$AS(t,i){return this.update(t,i)}update(t,i){return this.render(...i)}};var Dt=class extends Xt{constructor(t){if(super(t),this.it=g,t.type!==Yt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===g||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:[]}}};Dt.directiveName="unsafeHTML",Dt.resultType=1;var ns=Ot(Dt);var{I:hn}=ss;var as=e=>e.strings===void 0;var fe=(e,t)=>{let i=e._$AN;if(i===void 0)return!1;for(let s of i)s._$AO?.(t,!1),fe(s,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)},ls=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),xo(t)}};function bo(e){this._$AN!==void 0?(He(this),this._$AM=e,ls(this)):this._$AM=e}function yo(e,t=!1,i=0){let s=this._$AH,o=this._$AN;if(o!==void 0&&o.size!==0)if(t)if(Array.isArray(s))for(let r=i;r<s.length;r++)fe(s[r],!1),He(s[r]);else s!=null&&(fe(s,!1),He(s));else fe(this,e)}var xo=e=>{e.type==Yt.CHILD&&(e._$AP??=yo,e._$AQ??=bo)},Ue=class extends Xt{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,i,s){super._$AT(t,i,s),ls(this),this.isConnected=t._$AU}_$AO(t,i=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),i&&(fe(this,t),He(this))}setValue(t){if(as(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 ds=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())}};var fi=class extends Ue{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,s]){return this.useCssBackground=t.name=="style",this.render(i,s)}render(t,i){this.loadingToken!=null&&(this.loadingToken.cancelled=!0);let s={cancelled:!1};return this.loadingToken=s,typeof t=="string"?this.preload(t,s):t?.then(o=>{this.preload(o,s)}),this.useCssBackground?ds(i):i}preload(t,i){t!=null&&!i.cancelled&&wo(t,()=>{i.cancelled||this.setValue(this.useCssBackground?ds(t):t)})}},Be=Ot(fi);var _o=':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}',Ao=Object.defineProperty,j=(e,t,i,s)=>{for(var o=void 0,r=e.length-1,n;r>=0;r--)(n=e[r])&&(o=n(t,i,o)||o);return o&&Ao(t,i,o),o},Mt,F=(Mt=class extends D{constructor(){super(...arguments),this.contentMode="text",this.role="option"}static get styles(){return[at`
|
|
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=vo,nt.DEFAULT_MAX_LENGTH=524288,nt.formAssociated=!0,nt.shadowRootOptions={...D.shadowRootOptions,delegatesFocus:rs},nt);$([h({type:String,reflect:!0})],k.prototype,"label");$([h({type:String,attribute:!0})],k.prototype,"validationMessage");$([h({type:String,attribute:!0})],k.prototype,"validationIconSrc");$([h({type:ue,attribute:!0,reflect:!0})],k.prototype,"validationLevel");$([h({type:String,hasChanged(e,t){return t!=null&&t!=e}})],k.prototype,"currentText");$([h({type:Boolean,attribute:!0})],k.prototype,"alwaysFloatLabel");$([h({type:Boolean,attribute:!0})],k.prototype,"autocompleted");$([h({type:Number,attribute:!0})],k.prototype,"rows");$([h({type:Boolean,reflect:!0,attribute:"effective-disabled"})],k.prototype,"effectiveDisabled");$([h({type:Boolean,reflect:!0,attribute:"extended-prefix"})],k.prototype,"extendedPrefix");$([h({type:String,reflect:!0})],k.prototype,"type");$([h({type:String,reflect:!0})],k.prototype,"placeholder");$([h({type:String,reflect:!0})],k.prototype,"sdAriaLabel");$([h({type:Number,reflect:!0})],k.prototype,"maxlength");$([h({type:Boolean,reflect:!0})],k.prototype,"readonly");$([h({type:Boolean,reflect:!0})],k.prototype,"required");$([h({type:String,reflect:!0})],k.prototype,"name");$([h({type:Boolean,reflect:!0})],k.prototype,"inactive");$([h({type:String,attribute:!0})],k.prototype,"autocomplete");$([h({type:String,attribute:!0})],k.prototype,"min");$([h({type:String,attribute:!0})],k.prototype,"max");$([h({type:String,attribute:!0})],k.prototype,"pattern");var ui=k;customElements.get(ui.ID)||customElements.define(ui.ID,ui);var Yt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Ot=e=>(...t)=>({_$litDirective$:e,values:t}),Xt=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,i,s){this._$Ct=t,this._$AM=i,this._$Ci=s}_$AS(t,i){return this.update(t,i)}update(t,i){return this.render(...i)}};var Dt=class extends Xt{constructor(t){if(super(t),this.it=g,t.type!==Yt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===g||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:[]}}};Dt.directiveName="unsafeHTML",Dt.resultType=1;var ns=Ot(Dt);var{I:hn}=ss;var as=e=>e.strings===void 0;var fe=(e,t)=>{let i=e._$AN;if(i===void 0)return!1;for(let s of i)s._$AO?.(t,!1),fe(s,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)},ls=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),xo(t)}};function bo(e){this._$AN!==void 0?(He(this),this._$AM=e,ls(this)):this._$AM=e}function yo(e,t=!1,i=0){let s=this._$AH,o=this._$AN;if(o!==void 0&&o.size!==0)if(t)if(Array.isArray(s))for(let r=i;r<s.length;r++)fe(s[r],!1),He(s[r]);else s!=null&&(fe(s,!1),He(s));else fe(this,e)}var xo=e=>{e.type==Yt.CHILD&&(e._$AP??=yo,e._$AQ??=bo)},Ue=class extends Xt{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,i,s){super._$AT(t,i,s),ls(this),this.isConnected=t._$AU}_$AO(t,i=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),i&&(fe(this,t),He(this))}setValue(t){if(as(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 ds=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),window.queueMicrotask(()=>t()))}};var fi=class extends Ue{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,s]){return this.useCssBackground=t.name=="style",this.render(i,s)}render(t,i){this.loadingToken!=null&&(this.loadingToken.cancelled=!0);let s={cancelled:!1};return this.loadingToken=s,typeof t=="string"?this.preload(t,s):t?.then(o=>{this.preload(o,s)}),this.useCssBackground?ds(i):i}preload(t,i){t!=null&&!i.cancelled&&wo(t,()=>{i.cancelled||this.setValue(this.useCssBackground?ds(t):t)})}},Be=Ot(fi);var _o=':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}',Ao=Object.defineProperty,j=(e,t,i,s)=>{for(var o=void 0,r=e.length-1,n;r>=0;r--)(n=e[r])&&(o=n(t,i,o)||o);return o&&Ao(t,i,o),o},Mt,F=(Mt=class extends D{constructor(){super(...arguments),this.contentMode="text",this.role="option"}static get styles(){return[at`
|
|
75
75
|
${X(_o)}
|
|
76
76
|
`]}render(){return A`
|
|
77
77
|
<div class="container">
|