@luzmo/lucero 0.0.28 → 0.0.29
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.
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<div class="icon-container search-icon icon" id="search-icon">
|
|
28
28
|
${u.O2(u.z2)}
|
|
29
29
|
</div>
|
|
30
|
-
`,M="select-option-menu",j=20;class s extends R.SizedMixin(D.Focusable,{noDefaultSize:!0}){constructor(){super(),this.disabled=!1,this.focused=!1,this.variant="checkmarks",this.emphasized=!1,this.invalid=!1,this.search="auto",this.noWrap=!1,this.retrieving=!1,this.pending=!1,this.clearable=!1,this.pendingLabel="Pending",this.searchLabel="Search",this.noResultsLabel="No results",this.noDataLabel="No data",this.multipleLabelTemplate="Selected {count} items",this.open=!1,this.readonly=!1,this.placement="bottom-end",this.quiet=!1,this.value=[],this.options=[],this.selects="multiple",this.dependencyManager=new A.DependencyManagerController(this),this.isMobile=new m.MatchMediaController(this,m.IS_MOBILE),this.listRole="listbox",this.itemRole="option",this.hasRenderedOverlay=!1,this._selfManageFocusElement=!1,this.selectionPromise=Promise.resolve(),this.enterKeydownOn=null,this._selectedOptions=[],this.handleSlottableRequest=e=>{},this.renderAngleIcon=()=>W(),this.renderAlertIcon=()=>U(),this.handleEnterKeydown=e=>{if(e.code==="Enter"){if(this.enterKeydownOn){e.preventDefault();return}this.enterKeydownOn=e.target,this.addEventListener("keyup",r=>{r.code==="Enter"&&(this.enterKeydownOn=null)},{once:!0})}},this.clearValue=e=>{e.preventDefault(),e.stopPropagation(),this.value=[],this.strategy&&(this.strategy.preventNextToggle="no"),this.open=!1,this.strategy&&(this.strategy.open=!1),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!0,composed:!0,detail:{value:this.value??[]}}))},this.handleKeydown=e=>{var i,l;const{code:r}=e;if(["Delete","Backspace"].includes(r)){this.clearValue(e);return}if(this.focused=!0,!(!r.startsWith("Arrow")||this.readonly||this.pending)){if(r==="ArrowUp"||r==="ArrowDown"){this.toggle(!0),e.preventDefault();return}if(e.preventDefault(),this.selects==="single"){const t=r==="ArrowRight"?1:-1,c=this.options.findIndex(d=>{var v,p,b;return((v=d==null?void 0:d.value)==null?void 0:v.toString())===((b=(p=this.value)==null?void 0:p[0])==null?void 0:b.toString())});let n=(this.options.length+c+t)%this.options.length,h=this.options.length;for(;(l=(i=this.options)==null?void 0:i[n])!=null&&l.disabled&&h;)h-=1,n=(this.options.length+n+t)%this.options.length;this.value=[this.options[n].value]}}},this.pendingStateController=new V.PendingStateController(this)}static get styles(){return[o.r(K)]}get selfManageFocusElement(){return this._selfManageFocusElement}get focusElement(){var e;return this.open?this.search==="on"||this.search==="auto"&&((e=this.options)==null?void 0:e.length)>j?this.searchInput:this.optionsMenu:this.button}forceFocusVisible(){this.disabled||(this.focused=!0)}click(){this.disabled||this.toggle()}handleButtonBlur(){this.focused=!1}focus(e){super.focus(e),!this.disabled&&this.focusElement&&(this.focused=this.hasVisibleFocusInTree())}handleHelperFocus(){this.focused=!0,this.button.focus()}handleChange(e){var r;this.value=((r=e==null?void 0:e.detail)==null?void 0:r.value)??[],this.strategy&&(this.strategy.preventNextToggle="no"),e.stopPropagation(),(!e.cancelable||this.selects==="single")&&(this.open=!1,this.strategy&&(this.strategy.open=!1)),e.preventDefault(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!0,composed:!0,detail:{value:this.value??[]}}))}handleButtonFocus(e){var r;(r=this.strategy)==null||r.handleButtonFocus(e)}toggle(e){this.readonly||this.pending||(this.open=e===void 0?!this.open:e,this.strategy&&(this.strategy.open=this.open),this._selfManageFocusElement=this.open)}close(){this.readonly||this.strategy&&(this.open=!1,this.strategy.open=!1)}bindEvents(){var e;(e=this.strategy)==null||e.abort(),this.strategy=this.isMobile.matches?new m.strategies.mobile(this.button,this):new m.strategies.desktop(this.button,this)}connectedCallback(){super.connectedCallback()}disconnectedCallback(){var e;this.close(),(e=this.strategy)==null||e.releaseDescription(),super.disconnectedCallback()}handleTooltipSlotchange(e){this.tooltipEl=e.target.assignedElements()[0]}get labelTemplate(){var h,d,v,p,b,x,w,k,$,S,E,q,I,O,C;
|
|
30
|
+
`,M="select-option-menu",j=20;class s extends R.SizedMixin(D.Focusable,{noDefaultSize:!0}){constructor(){super(),this.disabled=!1,this.focused=!1,this.variant="checkmarks",this.emphasized=!1,this.invalid=!1,this.search="auto",this.noWrap=!1,this.retrieving=!1,this.pending=!1,this.clearable=!1,this.pendingLabel="Pending",this.searchLabel="Search",this.noResultsLabel="No results",this.noDataLabel="No data",this.multipleLabelTemplate="Selected {count} items",this.open=!1,this.readonly=!1,this.placement="bottom-end",this.quiet=!1,this.value=[],this.options=[],this.selects="multiple",this.dependencyManager=new A.DependencyManagerController(this),this.isMobile=new m.MatchMediaController(this,m.IS_MOBILE),this.listRole="listbox",this.itemRole="option",this.hasRenderedOverlay=!1,this._selfManageFocusElement=!1,this.selectionPromise=Promise.resolve(),this.enterKeydownOn=null,this._selectedOptions=[],this.handleSlottableRequest=e=>{},this.renderAngleIcon=()=>W(),this.renderAlertIcon=()=>U(),this.handleEnterKeydown=e=>{if(e.code==="Enter"){if(this.enterKeydownOn){e.preventDefault();return}this.enterKeydownOn=e.target,this.addEventListener("keyup",r=>{r.code==="Enter"&&(this.enterKeydownOn=null)},{once:!0})}},this.clearValue=e=>{e.preventDefault(),e.stopPropagation(),this.value=[],this.strategy&&(this.strategy.preventNextToggle="no"),this.open=!1,this.strategy&&(this.strategy.open=!1),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!0,composed:!0,detail:{value:this.value??[]}}))},this.handleKeydown=e=>{var i,l;const{code:r}=e;if(["Delete","Backspace"].includes(r)){this.clearValue(e);return}if(this.focused=!0,!(!r.startsWith("Arrow")||this.readonly||this.pending)){if(r==="ArrowUp"||r==="ArrowDown"){this.toggle(!0),e.preventDefault();return}if(e.preventDefault(),this.selects==="single"){const t=r==="ArrowRight"?1:-1,c=this.options.findIndex(d=>{var v,p,b;return((v=d==null?void 0:d.value)==null?void 0:v.toString())===((b=(p=this.value)==null?void 0:p[0])==null?void 0:b.toString())});let n=(this.options.length+c+t)%this.options.length,h=this.options.length;for(;(l=(i=this.options)==null?void 0:i[n])!=null&&l.disabled&&h;)h-=1,n=(this.options.length+n+t)%this.options.length;this.value=[this.options[n].value],this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!0,composed:!0,detail:{value:this.value??[]}}))}}},this.pendingStateController=new V.PendingStateController(this)}static get styles(){return[o.r(K)]}get selfManageFocusElement(){return this._selfManageFocusElement}get focusElement(){var e;return this.open?this.search==="on"||this.search==="auto"&&((e=this.options)==null?void 0:e.length)>j?this.searchInput:this.optionsMenu:this.button}forceFocusVisible(){this.disabled||(this.focused=!0)}click(){this.disabled||this.toggle()}handleButtonBlur(){this.focused=!1}focus(e){super.focus(e),!this.disabled&&this.focusElement&&(this.focused=this.hasVisibleFocusInTree())}handleHelperFocus(){this.focused=!0,this.button.focus()}handleChange(e){var r;this.value=((r=e==null?void 0:e.detail)==null?void 0:r.value)??[],this.strategy&&(this.strategy.preventNextToggle="no"),e.stopPropagation(),(!e.cancelable||this.selects==="single")&&(this.open=!1,this.strategy&&(this.strategy.open=!1)),e.preventDefault(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!0,composed:!0,detail:{value:this.value??[]}}))}handleButtonFocus(e){var r;(r=this.strategy)==null||r.handleButtonFocus(e)}toggle(e){this.readonly||this.pending||(this.open=e===void 0?!this.open:e,this.strategy&&(this.strategy.open=this.open),this._selfManageFocusElement=this.open)}close(){this.readonly||this.strategy&&(this.open=!1,this.strategy.open=!1)}bindEvents(){var e;(e=this.strategy)==null||e.abort(),this.strategy=this.isMobile.matches?new m.strategies.mobile(this.button,this):new m.strategies.desktop(this.button,this)}connectedCallback(){super.connectedCallback()}disconnectedCallback(){var e;this.close(),(e=this.strategy)==null||e.releaseDescription(),super.disconnectedCallback()}handleTooltipSlotchange(e){this.tooltipEl=e.target.assignedElements()[0]}get labelTemplate(){var h,d,v,p,b,x,w,k,$,S,E,q,I,O,C;const e=((h=this._selectedOptions)==null?void 0:h.length)===1&&((d=this._selectedOptions[0])==null?void 0:d.icon),r=o.x`<div
|
|
31
31
|
id="icon"
|
|
32
32
|
?hidden=${typeof this.icons=="string"||((v=this.value)==null?void 0:v.length)>1||!e}
|
|
33
33
|
>
|
|
@@ -114,7 +114,16 @@ class l extends X(Z, {
|
|
|
114
114
|
let u = (this.options.length + i + o) % this.options.length, h = this.options.length;
|
|
115
115
|
for (; (r = (a = this.options) == null ? void 0 : a[u]) != null && r.disabled && h; )
|
|
116
116
|
h -= 1, u = (this.options.length + u + o) % this.options.length;
|
|
117
|
-
this.value = [this.options[u].value]
|
|
117
|
+
this.value = [this.options[u].value], this.dispatchEvent(
|
|
118
|
+
new CustomEvent("change", {
|
|
119
|
+
bubbles: !0,
|
|
120
|
+
cancelable: !0,
|
|
121
|
+
composed: !0,
|
|
122
|
+
detail: {
|
|
123
|
+
value: this.value ?? []
|
|
124
|
+
}
|
|
125
|
+
})
|
|
126
|
+
);
|
|
118
127
|
}
|
|
119
128
|
}
|
|
120
129
|
}, this.pendingStateController = new Q(this);
|
|
@@ -183,7 +192,6 @@ class l extends X(Z, {
|
|
|
183
192
|
}
|
|
184
193
|
get labelTemplate() {
|
|
185
194
|
var h, d, b, m, g, w, k, $, S, E, I, C, O, _, q;
|
|
186
|
-
console.log(this.icons, "icons");
|
|
187
195
|
const e = ((h = this._selectedOptions) == null ? void 0 : h.length) === 1 && ((d = this._selectedOptions[0]) == null ? void 0 : d.icon), t = n`<div
|
|
188
196
|
id="icon"
|
|
189
197
|
?hidden=${typeof this.icons == "string" || ((b = this.value) == null ? void 0 : b.length) > 1 || !e}
|