@openremote/or-tree-menu 1.8.0-snapshot.20250818141417 → 1.8.0-snapshot.20250818162953

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.
@@ -309,7 +309,7 @@
309
309
  ${s?s.map(([t,e],n)=>(this.value===t&&(this._selectedIndex=n),tJ`<li class="${eF({"mdc-list-item":!0,"mdc-list-item--selected":this.value===t})}" role="option" data-value="${t}"><or-translate value="${e}"></or-translate></li>`)):""}
310
310
  </ul>
311
311
  </div>
312
- `;case e8.SELECT:let m,p={"mdc-select--outlined":e,"mdc-select--filled":!e,"mdc-select--disabled":this.disabled||this.readonly,"mdc-select--required":this.required,"mdc-select--dense":!1,"dense-comfortable":this.comfortable,"mdc-select--no-label":!this.label,"mdc-select--with-leading-icon":!!this.icon,"or-mwc-input--rounded":this.rounded};m=void 0!=this.searchProvider?this.searchProvider(this.searchableValue):this.resolveOptions(this.options);let u=(t,e)=>{var n;let i=e.value;if(this.multiple){t.stopPropagation();let e=null!=(n=this._tempValue)?n:Array.isArray(this.value)?[...this.value]:void 0!==this.value?[this.value]:[],r=e.findIndex(t=>t===i);r>=0?e.splice(r,1):e.push(i);let o=t.composedPath()[0].closest("li"),a=o.getElementsByTagName("or-icon")[0];o&&(r>=0?o.classList.remove("mdc-list-item--selected"):o.classList.add("mdc-list-item--selected")),a&&(a.icon=r>=0?"checkbox-blank-outline":"checkbox-marked"),this._tempValue=e}else void 0==this.searchProvider&&Array.isArray(m)||this.onValueChange(void 0,e.value)},h=t=>void 0==this.searchProvider||t&&0!=t.length?rX(this.multiple?e6.MULTI_TICK:e6.SELECT,tJ`${null==t?void 0:t.map(([t,e],n)=>rj({text:e,value:t},n,Array.isArray(this.value)?this.value:this.value?[this.value]:[],this.multiple?e6.MULTI_TICK:e6.SELECT,!1,u))}`,!1,void 0):tJ`<span class="mdc-text-field-helper-line" style="margin: 8px 8px 8px 0;">${rH.i18next.t("noResults")}</span>`;return tJ`
312
+ `;case e8.SELECT:let m,p={"mdc-select--outlined":e,"mdc-select--filled":!e,"mdc-select--disabled":this.disabled||this.readonly,"mdc-select--required":this.required,"mdc-select--dense":!1,"dense-comfortable":this.comfortable,"mdc-select--no-label":!this.label,"mdc-select--with-leading-icon":!!this.icon,"or-mwc-input--rounded":this.rounded};m=void 0!=this.searchProvider?this.searchProvider(this.searchableValue):this.resolveOptions(this.options);let u=(t,e)=>{var n;let i=e.value;if(this.multiple){t.stopPropagation();let e=null!=(n=this._tempValue)?n:Array.isArray(this.value)?[...this.value]:void 0!==this.value?[this.value]:[],r=e.findIndex(t=>t===i);r>=0?e.splice(r,1):e.push(i);let o=t.composedPath()[0].closest("li"),a=o.getElementsByTagName("or-icon")[0];o&&(r>=0?o.classList.remove("mdc-list-item--selected"):o.classList.add("mdc-list-item--selected")),a&&(a.icon=r>=0?"checkbox-blank-outline":"checkbox-marked"),this._tempValue=e}else void 0==this.searchProvider&&Array.isArray(m)||this.onValueChange(void 0,e.value)},h=()=>{var t;let e=null!=(t=this._tempValue)?t:this.value;if(window.setTimeout(()=>{this._mdcComponent&&this._mdcComponent.foundation.adapter.floatLabel(e&&(!Array.isArray(e)||e.length>0))}),!this._tempValue)return;let n=[...this._tempValue];this._tempValue=void 0,this.onValueChange(void 0,n)},f=t=>void 0==this.searchProvider||t&&0!=t.length?rX(this.multiple?e6.MULTI_TICK:e6.SELECT,tJ`${null==t?void 0:t.map(([t,e],n)=>rj({text:e,value:t},n,Array.isArray(this.value)?this.value:this.value?[this.value]:[],this.multiple?e6.MULTI_TICK:e6.SELECT,!1,u))}`,!1,void 0):tJ`<span class="mdc-text-field-helper-line" style="margin: 8px 8px 8px 0;">${rH.i18next.t("noResults")}</span>`;return tJ`
313
313
  <div id="component"
314
314
  class="mdc-select ${eF(p)}"
315
315
  @MDCSelect:change="${t=>rW(this,void 0,void 0,function*(){let e=Array.isArray(m)?m:yield m;this.onValueChange(void 0,-1===t.detail.index?void 0:Array.isArray(e[t.detail.index])?e[t.detail.index][0]:e[t.detail.index])})}">
@@ -343,7 +343,7 @@
343
343
  </span>
344
344
  ${!e?tJ`<div class="mdc-line-ripple"></div>`:""}
345
345
  </div>
346
- <div id="mdc-select-menu" class="mdc-select__menu mdc-menu mdc-menu-surface mdc-menu-surface--fixed ${void 0!=this.searchProvider?"mdc-menu__searchable":void 0}" @MDCMenuSurface:closed="${()=>{var t;let e=null!=(t=this._tempValue)?t:this.value;if(window.setTimeout(()=>{this._mdcComponent&&this._mdcComponent.foundation.adapter.floatLabel(e&&(!Array.isArray(e)||e.length>0))}),!this._tempValue)return;let n=[...this._tempValue];this._tempValue=void 0,this.onValueChange(void 0,n)}}">
346
+ <div id="mdc-select-menu" class="mdc-select__menu mdc-menu mdc-menu-surface mdc-menu-surface--fixed ${void 0!=this.searchProvider?"mdc-menu__searchable":void 0}" @MDCMenuSurface:closed="${h}">
347
347
  ${eV(void 0!=this.searchProvider,()=>tJ`
348
348
  <label id="select-searchable" class="mdc-text-field mdc-text-field--filled">
349
349
  <span class="mdc-floating-label" style="color: rgba(0, 0, 0, 0.6); text-transform: capitalize; visibility: ${this.searchableValue?"hidden":"visible"}" id="my-label-id">
@@ -354,7 +354,7 @@
354
354
  />
355
355
  </label>
356
356
  `)}
357
- ${eV(Array.isArray(m),()=>h(m),()=>eG(new Promise(t=>rW(this,void 0,void 0,function*(){t(h((yield m)))})),tJ`<span class="mdc-text-field-helper-line" style="margin: 8px 8px 8px 0;">${rH.i18next.t("loading")}</span>`))}
357
+ ${eV(Array.isArray(m),()=>f(m),()=>eG(new Promise(t=>rW(this,void 0,void 0,function*(){t(f((yield m)))})),tJ`<span class="mdc-text-field-helper-line" style="margin: 8px 8px 8px 0;">${rH.i18next.t("loading")}</span>`))}
358
358
  </div>
359
359
  ${n||i?tJ`
360
360
  <p id="component-helper-text" class="mdc-select-helper-text ${eF(r)}" aria-hidden="true">
@@ -369,20 +369,20 @@
369
369
  ${this.icon?tJ`<or-icon class="mdc-icon-button__icon" aria-hidden="true" icon="${this.icon}"></or-icon>`:""}
370
370
  ${this.iconOn?tJ`<or-icon class="mdc-icon-button__icon mdc-icon-button__icon--on" aria-hidden="true" icon="${this.iconOn}"></or-icon>`:""}
371
371
  </button>
372
- `;case e8.BUTTON:case e8.BUTTON_MOMENTARY:{let t=this.type===e8.BUTTON_MOMENTARY,e=!this.action&&!this.label;!e||this.iconTrailing||this.icon||(this.icon="circle");let n={"mdc-icon-button":e,"mdc-fab":!e&&this.action,"mdc-fab--extended":!e&&this.action&&!!this.label,"mdc-fab--mini":!e&&this.action&&(this.compact||this.comfortable),"mdc-button":!e&&!this.action,"mdc-button--raised":!e&&!this.action&&this.raised,"mdc-button--unelevated":!e&&!this.action&&this.unElevated,"mdc-button--outlined":!e&&!this.action&&(this.outlined||t),"mdc-button--rounded":!e&&!this.action&&this.rounded,"mdc-button--fullwidth":this.fullWidth};return tJ`
373
- <button id="component" class="${eF(n)}"
372
+ `;case e8.BUTTON:case e8.BUTTON_MOMENTARY:{let t=t=>{this.disabled&&t.stopPropagation(),i&&this.dispatchEvent(new on(!0,null))},e=t=>{this.disabled&&t.stopPropagation(),i&&this.dispatchEvent(new on(!1,!0))},n=t=>{this.disabled&&t.stopPropagation(),i||this.dispatchEvent(new on(!0,null))},i=this.type===e8.BUTTON_MOMENTARY,r=!this.action&&!this.label;!r||this.iconTrailing||this.icon||(this.icon="circle");let o={"mdc-icon-button":r,"mdc-fab":!r&&this.action,"mdc-fab--extended":!r&&this.action&&!!this.label,"mdc-fab--mini":!r&&this.action&&(this.compact||this.comfortable),"mdc-button":!r&&!this.action,"mdc-button--raised":!r&&!this.action&&this.raised,"mdc-button--unelevated":!r&&!this.action&&this.unElevated,"mdc-button--outlined":!r&&!this.action&&(this.outlined||i),"mdc-button--rounded":!r&&!this.action&&this.rounded,"mdc-button--fullwidth":this.fullWidth};return tJ`
373
+ <button id="component" class="${eF(o)}"
374
374
  ?readonly="${this.readonly}"
375
375
  ?disabled="${this.disabled}"
376
- @click="${e=>{this.disabled&&e.stopPropagation(),t||this.dispatchEvent(new on(!0,null))}}"
377
- @mousedown="${e=>{this.disabled&&e.stopPropagation(),t&&this.dispatchEvent(new on(!0,null))}}" @mouseup="${e=>{this.disabled&&e.stopPropagation(),t&&this.dispatchEvent(new on(!1,!0))}}">
378
- ${!e?tJ`<div class="mdc-button__ripple"></div>`:""}
379
- ${this.icon?tJ`<or-icon class="${e?"":this.action?"mdc-fab__icon":"mdc-button__icon"}" aria-hidden="true" icon="${this.icon}"></or-icon>`:""}
376
+ @click="${t=>n(t)}"
377
+ @mousedown="${e=>t(e)}" @mouseup="${t=>e(t)}">
378
+ ${!r?tJ`<div class="mdc-button__ripple"></div>`:""}
379
+ ${this.icon?tJ`<or-icon class="${r?"":this.action?"mdc-fab__icon":"mdc-button__icon"}" aria-hidden="true" icon="${this.icon}"></or-icon>`:""}
380
380
  ${this.label?tJ`<span class="${this.action?"mdc-fab__label":"mdc-button__label"}"><or-translate .value="${this.label}"></or-translate></span>`:""}
381
- ${!e&&this.iconTrailing?tJ`<or-icon class="${this.action?"mdc-fab__icon":"mdc-button__icon"}" aria-hidden="true" icon="${this.iconTrailing}"></or-icon>`:""}
381
+ ${!r&&this.iconTrailing?tJ`<or-icon class="${this.action?"mdc-fab__icon":"mdc-button__icon"}" aria-hidden="true" icon="${this.iconTrailing}"></or-icon>`:""}
382
382
  </button>
383
- `}case e8.CHECKBOX_LIST:Array.isArray(this.value)||(null===this.value||void 0===this.value?this.value=[]:this.value=[this.value]);let f=this.resolveOptions(this.options);return this._selectedIndex=-1,tJ`
383
+ `}case e8.CHECKBOX_LIST:Array.isArray(this.value)||(null===this.value||void 0===this.value?this.value=[]:this.value=[this.value]);let g=this.resolveOptions(this.options);return this._selectedIndex=-1,tJ`
384
384
  <div class="mdc-checkbox-list">
385
- ${f?f.map(([t,e],n)=>(this.value===t&&(this._selectedIndex=n),tJ`
385
+ ${g?g.map(([t,e],n)=>(this.value===t&&(this._selectedIndex=n),tJ`
386
386
  <div id="field" class="mdc-form-field">
387
387
  <div id="component" class="mdc-checkbox">
388
388
  <input type="checkbox"
@@ -400,9 +400,9 @@
400
400
 
401
401
  `)):""}
402
402
  </div>
403
- `;case e8.CHECKBOX:let g={"mdc-checkbox":!0,"mdc-checkbox--disabled":this.disabled||this.readonly};return tJ`
403
+ `;case e8.CHECKBOX:let b={"mdc-checkbox":!0,"mdc-checkbox--disabled":this.disabled||this.readonly};return tJ`
404
404
  <div id="field" class="mdc-form-field">
405
- <div id="component" class="${eF(g)}">
405
+ <div id="component" class="${eF(b)}">
406
406
  <input type="checkbox"
407
407
  id="elem"
408
408
  data-indeterminate="${this.indeterminate}"