@ni/nimble-components 7.7.0 → 7.8.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.
@@ -1298,14 +1298,14 @@ const td=Zh.compose({baseName:"toggle-button",template:(t,e)=>Y`<div role="butto
1298
1298
  Vs.getOrCreate().withPrefix("nimble").register(td())
1299
1299
  const ed="group-selected"
1300
1300
  var sd
1301
- !function(t){t.All="all",t.LeavesOnly="leaves-only"}(sd||(sd={}))
1301
+ !function(t){t.All="all",t.LeavesOnly="leaves-only",t.None="none"}(sd||(sd={}))
1302
1302
  class id{constructor(t,e){this.cache=new WeakMap,this.ltr=t,this.rtl=e}bind(t){this.attach(t)}unbind(t){const e=this.cache.get(t)
1303
1303
  e&&Ao.unsubscribe(e)}attach(t){const e=this.cache.get(t)||new od(this.ltr,this.rtl,t),s=Ao.getValueFor(t)
1304
1304
  Ao.subscribe(e),e.attach(s),this.cache.set(t,e)}}class od{constructor(t,e,s){this.ltr=t,this.rtl=e,this.source=s,this.attached=null}handleChange({target:t,token:e}){this.attach(e.getValueFor(t))}attach(t){this.attached!==this[t]&&(null!==this.attached&&this.source.$fastController.removeStyles(this.attached),this.attached=this[t],null!==this.attached&&this.source.$fastController.addStyles(this.attached))}}const nd=class extends mi{constructor(){super(),this.treeView=null,this.handleClickOverride=t=>{if(t.composedPath().includes(this.expandCollapseButton))return
1305
1305
  const e=this.getImmediateTreeItem(t.target)
1306
1306
  if(e?.disabled||e!==this)return void t.stopImmediatePropagation()
1307
- const s=this.treeView?.selectionMode===sd.LeavesOnly,i=this.hasChildTreeItems()
1308
- if(s&&!i||!s){const t=this.getImmediateTreeItem(this.treeView?.currentSelected)
1307
+ const s=this.treeView?.selectionMode===sd.LeavesOnly,i=this.treeView?.selectionMode===sd.All,o=this.hasChildTreeItems()
1308
+ if(s&&!o||i){const t=this.getImmediateTreeItem(this.treeView?.currentSelected)
1309
1309
  t&&this!==this.treeView?.currentSelected&&(t.selected=!1),this.selected=!0}else this.expanded=!this.expanded
1310
1310
  t.stopImmediatePropagation()},this.handleSelectedChange=t=>{t.target===this&&this.selected&&this.setGroupSelectionOnRootParentTreeItem(this)},this.addEventListener("click",this.handleClickOverride)}connectedCallback(){super.connectedCallback(),this.addEventListener("selected-change",this.handleSelectedChange),this.treeView=this.getParentTreeView(),this.treeView&&this.selected&&this.setGroupSelectionOnRootParentTreeItem(this)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleClickOverride),this.removeEventListener("selected-change",this.handleSelectedChange),this.treeView=null}hasChildTreeItems(){return null!==this.querySelector('[role="treeitem"]')}clearTreeGroupSelection(){const t=this.treeView?.querySelectorAll("[group-selected]")
1311
1311
  t?.forEach((t=>t.removeAttribute(ed)))}setGroupSelectionOnRootParentTreeItem(t){this.clearTreeGroupSelection()
@@ -1319,7 +1319,7 @@ var s},styles:(t,e)=>mt`
1319
1319
 
1320
1320
  :host{${""}
1321
1321
  font-family:${En};font-weight:${Hn};contain:content;position:relative;outline:none;color:${Vn};cursor:pointer;--ni-private-tree-item-nested-width:0}${""}
1322
- :host([${ed}])::after{background:${Yo};border-radius:0px;content:'';display:block;position:absolute;top:0px;width:calc(${sn} * 2);height:calc(${on} * 2)}.positioning-region{display:flex;position:relative;box-sizing:border-box;height:calc(${on} * 2)}.positioning-region:hover{background:${No}}:host(${uc}) .positioning-region{box-shadow:0px 0px 0px ${sn} ${Yo} inset;outline:${sn} solid ${Yo};outline-offset:-2px}:host([selected]) .positioning-region{background:${Bo}}:host([selected]) .positioning-region:hover{background:${Do}}.positioning-region::before{content:'';display:block;width:var(--ni-private-tree-item-nested-width);flex-shrink:0}.content-region{display:inline-flex;align-items:center;white-space:nowrap;width:100%;padding-left:10px;font:inherit;font-size:${Tn};user-select:none}:host(${uc}) .content-region{outline:none}:host(.nested) .content-region{position:relative;margin-inline-start:${on}}:host([disabled]) .content-region{opacity:0.5;cursor:not-allowed}.expand-collapse-button{background:none;border:none;outline:none;width:${on};height:${on};padding:0px;justify-content:center;align-items:center;cursor:pointer;margin-left:10px}:host(.nested) .expand-collapse-button{position:absolute}.expand-collapse-button svg{width:${on};height:${on};transition:transform 0.2s ease-in;pointer-events:none;fill:currentcolor}${""}
1322
+ :host([${ed}])::after{background:${Yo};border-radius:0px;content:'';display:block;position:absolute;top:0px;width:calc(${sn} * 2);height:calc(${on} * 2)}.positioning-region{display:flex;position:relative;box-sizing:border-box;height:calc(${on} * 2)}.positioning-region:hover{background:${No}}:host([${ed}]) .positioning-region:hover{background:${Do}}:host(${uc}) .positioning-region{box-shadow:0px 0px 0px ${sn} ${Yo} inset;outline:${sn} solid ${Yo};outline-offset:-2px}:host([selected]) .positioning-region{background:${Bo}}:host([selected]) .positioning-region:hover{background:${Do}}.positioning-region::before{content:'';display:block;width:var(--ni-private-tree-item-nested-width);flex-shrink:0}.content-region{display:inline-flex;align-items:center;white-space:nowrap;width:100%;padding-left:10px;font:inherit;font-size:${Tn};user-select:none;position:relative;margin-inline-start:${on}}:host(${uc}) .content-region{outline:none}:host([disabled]) .content-region{opacity:0.5;cursor:not-allowed}.expand-collapse-button{background:none;border:none;outline:none;width:${on};height:${on};padding:0px;justify-content:center;align-items:center;cursor:pointer;margin-left:10px;position:absolute}.expand-collapse-button svg{width:${on};height:${on};transition:transform 0.2s ease-in;pointer-events:none;fill:currentcolor}${""}
1323
1323
  span[part="start"]{width:${on}}${""}
1324
1324
  .start{display:flex;fill:currentcolor;margin-inline-start:${on};margin-inline-end:${on}}slot[name='start']::slotted(*){width:${on};height:${on}}::slotted(${t.tagFor(mi)}){--ni-private-tree-item-nested-width:1em;--ni-private-expand-collapse-button-nested-width:calc(
1325
1325
  ${on} * -1
@@ -1327,11 +1327,11 @@ var s},styles:(t,e)=>mt`
1327
1327
  .end{display:flex;fill:currentcolor;margin-inline-start:${on}}.items{display:none;${""}
1328
1328
  font-size:calc(1em + (${on} * 2))}:host([expanded]) .items{display:block}`.withBehaviors(new id(mt`
1329
1329
  ${""}
1330
- :host(.nested) .expand-collapse-button{left:var(
1330
+ .expand-collapse-button{left:var(
1331
1331
  --ni-private-expand-collapse-button-nested-width,calc(${on} * -1)
1332
1332
  )}.expand-collapse-button svg{transform:rotate(90deg)}:host([expanded]) .expand-collapse-button svg{transform:rotate(180deg)}`,mt`
1333
1333
  ${""}
1334
- :host(.nested) .expand-collapse-button{right:var(
1334
+ .expand-collapse-button{right:var(
1335
1335
  --ni-private-expand-collapse-button-nested-width,calc(${on} * -1)
1336
1336
  )}.expand-collapse-button svg{transform:rotate(180deg)}:host([expanded]) .expand-collapse-button svg{transform:rotate(135deg)}`)),expandCollapseGlyph:Rr.data})
1337
1337
  Vs.getOrCreate().withPrefix("nimble").register(nd())