@ni/nimble-components 18.12.2 → 18.12.4

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.
@@ -14949,24 +14949,6 @@
14949
14949
  ], TreeItem$1.prototype, "renderCollapsedChildren", void 0);
14950
14950
  applyMixins(TreeItem$1, StartEnd);
14951
14951
 
14952
- /**
14953
- * The template for the {@link @microsoft/fast-foundation#TreeView} component.
14954
- * @public
14955
- */
14956
- const treeViewTemplate = (context, definition) => html `
14957
- <template
14958
- role="tree"
14959
- ${ref("treeView")}
14960
- @keydown="${(x, c) => x.handleKeyDown(c.event)}"
14961
- @focusin="${(x, c) => x.handleFocus(c.event)}"
14962
- @focusout="${(x, c) => x.handleBlur(c.event)}"
14963
- @click="${(x, c) => x.handleClick(c.event)}"
14964
- @selected-change="${(x, c) => x.handleSelectedChange(c.event)}"
14965
- >
14966
- <slot ${slotted("slottedTreeItems")}></slot>
14967
- </template>
14968
- `;
14969
-
14970
14952
  /**
14971
14953
  * A Tree view Custom HTML Element.
14972
14954
  * Implements the {@link https://w3c.github.io/aria-practices/#TreeView | ARIA TreeView }.
@@ -16374,7 +16356,7 @@
16374
16356
 
16375
16357
  /**
16376
16358
  * Do not edit directly
16377
- * Generated on Wed, 19 Apr 2023 17:42:08 GMT
16359
+ * Generated on Tue, 25 Apr 2023 17:52:52 GMT
16378
16360
  */
16379
16361
  const Information100DarkUi = "#a46eff";
16380
16362
  const Information100LightUi = "#804ad9";
@@ -16744,7 +16726,7 @@
16744
16726
  return `${prefix}${uniqueIdCounter++}`;
16745
16727
  }
16746
16728
 
16747
- const template$q = html `<slot></slot>`;
16729
+ const template$r = html `<slot></slot>`;
16748
16730
 
16749
16731
  const styles$O = css `
16750
16732
  :host {
@@ -16803,7 +16785,7 @@
16803
16785
  const nimbleDesignSystemProvider = ThemeProvider.compose({
16804
16786
  baseName: 'theme-provider',
16805
16787
  styles: styles$O,
16806
- template: template$q
16788
+ template: template$r
16807
16789
  });
16808
16790
  DesignSystem.getOrCreate()
16809
16791
  .withPrefix('nimble')
@@ -16852,7 +16834,7 @@
16852
16834
  DesignToken.create(styleNameFromTokenName(tokenNames.modalBackdropColor)).withDefault((element) => getModalBackdropForTheme(element));
16853
16835
  const popupBorderColor = DesignToken.create(styleNameFromTokenName(tokenNames.popupBorderColor)).withDefault((element) => hexToRgbaCssColor(getColorForTheme(element, Black91, Black15, White), 0.3));
16854
16836
  DesignToken.create(styleNameFromTokenName(tokenNames.tooltipBackgroundColor)).withDefault((element) => getColorForTheme(element, Black15, Black85, ForestGreen));
16855
- const tableRowBorderColor = DesignToken.create(styleNameFromTokenName(tokenNames.tableRowBorderColor)).withDefault((element) => getColorForTheme(element, Black15, Black88, ForestGreen));
16837
+ const tableRowBorderColor = DesignToken.create(styleNameFromTokenName(tokenNames.tableRowBorderColor)).withDefault((element) => getColorForTheme(element, Black15, Black80, ForestGreen));
16856
16838
  // Component Sizing Tokens
16857
16839
  const controlHeight = DesignToken.create(styleNameFromTokenName(tokenNames.controlHeight)).withDefault('32px');
16858
16840
  const controlSlimHeight = DesignToken.create(styleNameFromTokenName(tokenNames.controlSlimHeight)).withDefault('24px');
@@ -17070,7 +17052,7 @@
17070
17052
  `;
17071
17053
 
17072
17054
  // prettier-ignore
17073
- const template$p = (context, definition) => html `
17055
+ const template$q = (context, definition) => html `
17074
17056
  <a
17075
17057
  class="control"
17076
17058
  part="control"
@@ -17144,7 +17126,7 @@
17144
17126
  const nimbleAnchor = Anchor.compose({
17145
17127
  baseName: 'anchor',
17146
17128
  baseClass: Anchor$1,
17147
- template: template$p,
17129
+ template: template$q,
17148
17130
  styles: styles$N,
17149
17131
  shadowOptions: {
17150
17132
  delegatesFocus: true
@@ -17521,7 +17503,7 @@
17521
17503
  }
17522
17504
  `;
17523
17505
 
17524
- const template$o = (context, definition) => html `
17506
+ const template$p = (context, definition) => html `
17525
17507
  <a
17526
17508
  class="control"
17527
17509
  part="control"
@@ -17603,7 +17585,7 @@
17603
17585
  ], AnchorButton.prototype, "disabled", void 0);
17604
17586
  const nimbleAnchorButton = AnchorButton.compose({
17605
17587
  baseName: 'anchor-button',
17606
- template: template$o,
17588
+ template: template$p,
17607
17589
  styles: styles$L,
17608
17590
  shadowOptions: {
17609
17591
  delegatesFocus: true
@@ -17689,7 +17671,7 @@
17689
17671
  }
17690
17672
  `;
17691
17673
 
17692
- const template$n = (context, definition) => html `
17674
+ const template$o = (context, definition) => html `
17693
17675
  <template
17694
17676
  role="menuitem"
17695
17677
  class="${x => (typeof x.startColumnCount === 'number'
@@ -17795,7 +17777,7 @@
17795
17777
  // FoundationAnchor already applies the StartEnd mixin, so we don't need to do it here.
17796
17778
  const nimbleAnchorMenuItem = AnchorMenuItem.compose({
17797
17779
  baseName: 'anchor-menu-item',
17798
- template: template$n,
17780
+ template: template$o,
17799
17781
  styles: styles$K,
17800
17782
  shadowOptions: {
17801
17783
  delegatesFocus: true
@@ -17945,7 +17927,7 @@
17945
17927
  }
17946
17928
  `;
17947
17929
 
17948
- const template$m = (context, definition) => html `
17930
+ const template$n = (context, definition) => html `
17949
17931
  <template slot="anchortab" role="tab" aria-disabled="${x => x.disabled}">
17950
17932
  <a
17951
17933
  download="${x => x.download}"
@@ -17998,7 +17980,7 @@
17998
17980
  // FoundationAnchor already applies the StartEnd mixin, so we don't need to do it here.
17999
17981
  const nimbleAnchorTab = AnchorTab.compose({
18000
17982
  baseName: 'anchor-tab',
18001
- template: template$m,
17983
+ template: template$n,
18002
17984
  styles: styles$I
18003
17985
  });
18004
17986
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleAnchorTab());
@@ -18022,7 +18004,7 @@
18022
18004
  }
18023
18005
  `;
18024
18006
 
18025
- const template$l = (context, definition) => html `
18007
+ const template$m = (context, definition) => html `
18026
18008
  ${startSlotTemplate(context, definition)}
18027
18009
  <div ${ref('tablist')} class="tablist" part="tablist" role="tablist">
18028
18010
  <slot name="anchortab" ${slotted('tabs')}></slot>
@@ -18219,7 +18201,7 @@
18219
18201
  applyMixins(AnchorTabs, StartEnd);
18220
18202
  const nimbleAnchorTabs = AnchorTabs.compose({
18221
18203
  baseName: 'anchor-tabs',
18222
- template: template$l,
18204
+ template: template$m,
18223
18205
  styles: styles$H,
18224
18206
  shadowOptions: {
18225
18207
  delegatesFocus: false
@@ -18332,7 +18314,7 @@
18332
18314
  }
18333
18315
  `;
18334
18316
 
18335
- const template$k = (context, definition) => html `
18317
+ const template$l = (context, definition) => html `
18336
18318
  <template
18337
18319
  role="treeitem"
18338
18320
  slot="${x => (x.isNestedItem() ? 'item' : null)}"
@@ -18469,7 +18451,7 @@
18469
18451
  // FoundationAnchor already applies the StartEnd mixin, so we don't need to do it here.
18470
18452
  const nimbleAnchorTreeItem = AnchorTreeItem.compose({
18471
18453
  baseName: 'anchor-tree-item',
18472
- template: template$k,
18454
+ template: template$l,
18473
18455
  styles: styles$G,
18474
18456
  shadowOptions: {
18475
18457
  delegatesFocus: true
@@ -19427,7 +19409,7 @@
19427
19409
  data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path class="cls-1" d="M8.033 14.026 4.9 10.866 6.277 9.53l1.744 1.81 4.562-4.507 1.307 1.363Zm1.155-10.68-1.321-1.32-2.312 2.311-2.311-2.311-1.321 1.32 2.311 2.312L1.923 7.97l1.32 1.32 2.312-2.31 2.312 2.31 1.32-1.32-2.31-2.312Z"/></svg>`
19428
19410
  };
19429
19411
 
19430
- const template$j = html `
19412
+ const template$k = html `
19431
19413
  <template>
19432
19414
  <div class="icon" :innerHTML=${x => x.icon.data}></div>
19433
19415
  </template
@@ -19486,7 +19468,7 @@
19486
19468
  const registerIcon = (baseName, iconClass) => {
19487
19469
  const composedIcon = iconClass.compose({
19488
19470
  baseName,
19489
- template: template$j,
19471
+ template: template$k,
19490
19472
  styles: styles$C,
19491
19473
  baseClass: iconClass
19492
19474
  });
@@ -19553,7 +19535,7 @@
19553
19535
  };
19554
19536
 
19555
19537
  // prettier-ignore
19556
- const template$i = html `
19538
+ const template$j = html `
19557
19539
  <div class="container"
19558
19540
  role="status"
19559
19541
  aria-atomic="${x => x.ariaAtomic}"
@@ -19672,7 +19654,7 @@
19672
19654
  applyMixins(Banner, ARIAGlobalStatesAndProperties);
19673
19655
  const nimbleBanner = Banner.compose({
19674
19656
  baseName: 'banner',
19675
- template: template$i,
19657
+ template: template$j,
19676
19658
  styles: styles$E
19677
19659
  });
19678
19660
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleBanner());
@@ -20127,7 +20109,7 @@
20127
20109
  }
20128
20110
  `;
20129
20111
 
20130
- const template$h = (context, definition) => html `
20112
+ const template$i = (context, definition) => html `
20131
20113
  <div
20132
20114
  role="button"
20133
20115
  part="control"
@@ -20202,7 +20184,7 @@
20202
20184
  applyMixins(ToggleButton, StartEnd, DelegatesARIAButton);
20203
20185
  const nimbleToggleButton = ToggleButton.compose({
20204
20186
  baseName: 'toggle-button',
20205
- template: template$h,
20187
+ template: template$i,
20206
20188
  styles: styles$x,
20207
20189
  shadowOptions: {
20208
20190
  delegatesFocus: true
@@ -20904,7 +20886,7 @@
20904
20886
  }
20905
20887
  `));
20906
20888
 
20907
- const template$g = html `
20889
+ const template$h = html `
20908
20890
  <template>
20909
20891
  <dialog
20910
20892
  ${ref('dialogElement')}
@@ -21030,7 +21012,7 @@
21030
21012
  applyMixins(Dialog, ARIAGlobalStatesAndProperties);
21031
21013
  const nimbleDialog = Dialog.compose({
21032
21014
  baseName: 'dialog',
21033
- template: template$g,
21015
+ template: template$h,
21034
21016
  styles: styles$t,
21035
21017
  baseClass: Dialog
21036
21018
  });
@@ -21190,7 +21172,7 @@
21190
21172
  }
21191
21173
  `));
21192
21174
 
21193
- const template$f = html `
21175
+ const template$g = html `
21194
21176
  <dialog
21195
21177
  ${ref('dialog')}
21196
21178
  aria-label="${x => x.ariaLabel}"
@@ -21304,7 +21286,7 @@
21304
21286
  applyMixins(Drawer, ARIAGlobalStatesAndProperties);
21305
21287
  const nimbleDrawer = Drawer.compose({
21306
21288
  baseName: 'drawer',
21307
- template: template$f,
21289
+ template: template$g,
21308
21290
  styles: styles$s
21309
21291
  });
21310
21292
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleDrawer());
@@ -23310,7 +23292,7 @@
23310
23292
  `;
23311
23293
 
23312
23294
  // prettier-ignore
23313
- const template$e = html `
23295
+ const template$f = html `
23314
23296
  <template
23315
23297
  ?open="${x => x.open}"
23316
23298
  @focusout="${(x, c) => x.focusoutHandler(c.event)}"
@@ -23565,7 +23547,7 @@
23565
23547
  ], MenuButton.prototype, "slottedMenus", void 0);
23566
23548
  const nimbleMenuButton = MenuButton.compose({
23567
23549
  baseName: 'menu-button',
23568
- template: template$e,
23550
+ template: template$f,
23569
23551
  styles: styles$p,
23570
23552
  shadowOptions: {
23571
23553
  delegatesFocus: true
@@ -24330,7 +24312,7 @@
24330
24312
  }
24331
24313
  `));
24332
24314
 
24333
- const template$d = html `
24315
+ const template$e = html `
24334
24316
  <template role="progressbar">
24335
24317
  <div class="container">
24336
24318
  <div class="bit1"></div>
@@ -24347,7 +24329,7 @@
24347
24329
  }
24348
24330
  const nimbleSpinner = Spinner.compose({
24349
24331
  baseName: 'spinner',
24350
- template: template$d,
24332
+ template: template$e,
24351
24333
  styles: styles$j
24352
24334
  });
24353
24335
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleSpinner());
@@ -24516,7 +24498,7 @@
24516
24498
  `));
24517
24499
 
24518
24500
  // prettier-ignore
24519
- const template$c = html `
24501
+ const template$d = html `
24520
24502
  <template
24521
24503
  role="switch"
24522
24504
  aria-checked="${x => x.checked}"
@@ -24560,7 +24542,7 @@
24560
24542
  const nimbleSwitch = Switch.compose({
24561
24543
  baseClass: Switch$1,
24562
24544
  baseName: 'switch',
24563
- template: template$c,
24545
+ template: template$d,
24564
24546
  styles: styles$i
24565
24547
  });
24566
24548
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleSwitch());
@@ -28197,6 +28179,7 @@
28197
28179
  width: 100%;
28198
28180
  position: relative;
28199
28181
  top: var(--ni-private-table-row-container-top);
28182
+ background-color: ${tableRowBorderColor};
28200
28183
  }
28201
28184
 
28202
28185
  .header-container {
@@ -28239,61 +28222,20 @@
28239
28222
  padding-left: 0px;
28240
28223
  }
28241
28224
 
28242
- .row {
28243
- background: ${applicationBackgroundColor};
28225
+ .group-row {
28244
28226
  position: relative;
28245
- box-sizing: border-box;
28246
- }
28247
-
28248
- .row::before {
28249
- content: '';
28250
- width: 100%;
28251
- height: 100%;
28252
- position: absolute;
28253
- pointer-events: none;
28254
- }
28255
-
28256
- :host([selection-mode='single']) .row:hover::before,
28257
- :host([selection-mode='multiple']) .row:hover::before {
28258
- background: ${fillHoverColor};
28259
28227
  }
28260
28228
 
28261
- :host([selection-mode='single']) .row[selected]::before,
28262
- :host([selection-mode='multiple']) .row[selected]::before {
28263
- background: ${fillSelectedColor};
28264
- }
28265
-
28266
- :host([selection-mode='single']) .row[selected]:hover::before,
28267
- :host([selection-mode='multiple']) .row[selected]:hover::before {
28268
- background: ${fillHoverSelectedColor};
28229
+ .row {
28230
+ position: relative;
28269
28231
  }
28270
28232
  `.withBehaviors(themeBehavior(Theme.color, css `
28271
- .header-row::before {
28233
+ .table-row-container::before {
28272
28234
  content: '';
28273
28235
  width: 100%;
28274
28236
  height: 100%;
28237
+ background-color: ${hexToRgbaCssColor(White, 0.1)};
28275
28238
  position: absolute;
28276
- background: ${fillHoverColor};
28277
- pointer-events: none;
28278
- }
28279
-
28280
- .row::before {
28281
- background: ${fillHoverColor};
28282
- }
28283
-
28284
- :host([selection-mode='single']) .row:hover::before,
28285
- :host([selection-mode='multiple']) .row:hover::before {
28286
- background: ${hexToRgbaCssColor(White, 0.15)};
28287
- }
28288
-
28289
- :host([selection-mode='single']) .row[selected]::before,
28290
- :host([selection-mode='multiple']) .row[selected]::before {
28291
- background: ${hexToRgbaCssColor(White, 0.25)};
28292
- }
28293
-
28294
- :host([selection-mode='single']) .row[selected]:hover::before,
28295
- :host([selection-mode='multiple']) .row[selected]:hover::before {
28296
- background: ${hexToRgbaCssColor(White, 0.2)};
28297
28239
  }
28298
28240
  `));
28299
28241
 
@@ -28316,7 +28258,7 @@
28316
28258
  `;
28317
28259
 
28318
28260
  // prettier-ignore
28319
- const template$b = html `
28261
+ const template$c = html `
28320
28262
  <template role="columnheader" aria-sort="${x => x.ariaSort}">
28321
28263
  <slot></slot>
28322
28264
 
@@ -28366,7 +28308,7 @@
28366
28308
  ], TableHeader.prototype, "firstSortedColumn", void 0);
28367
28309
  const nimbleTableHeader = TableHeader.compose({
28368
28310
  baseName: 'table-header',
28369
- template: template$b,
28311
+ template: template$c,
28370
28312
  styles: styles$f
28371
28313
  });
28372
28314
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTableHeader());
@@ -28376,10 +28318,35 @@
28376
28318
  ${display('flex')}
28377
28319
 
28378
28320
  :host {
28379
- height: calc(${controlHeight} + 2 * ${borderWidth});
28380
- border-top: calc(2 * ${borderWidth}) solid ${tableRowBorderColor};
28381
28321
  width: fit-content;
28382
28322
  min-width: 100%;
28323
+ background-color: ${applicationBackgroundColor};
28324
+ height: calc(${controlHeight} + 2 * ${borderWidth});
28325
+ border-top: calc(2 * ${borderWidth}) solid transparent;
28326
+ box-sizing: border-box;
28327
+ background-clip: padding-box;
28328
+ }
28329
+
28330
+ :host::before {
28331
+ content: '';
28332
+ width: 100%;
28333
+ height: ${controlHeight};
28334
+ pointer-events: none;
28335
+ box-sizing: border-box;
28336
+ bottom: 0px;
28337
+ position: absolute;
28338
+ }
28339
+
28340
+ :host([selectable]:not([selected]):hover)::before {
28341
+ background-color: ${fillHoverColor};
28342
+ }
28343
+
28344
+ :host([selected])::before {
28345
+ background-color: ${fillSelectedColor};
28346
+ }
28347
+
28348
+ :host([selected]:hover)::before {
28349
+ background-color: ${fillHoverSelectedColor};
28383
28350
  }
28384
28351
 
28385
28352
  .checkbox-container {
@@ -28417,7 +28384,19 @@
28417
28384
  :host([selected]) nimble-table-cell {
28418
28385
  --ni-private-table-cell-action-menu-display: block;
28419
28386
  }
28420
- `;
28387
+ `.withBehaviors(themeBehavior(Theme.color, css `
28388
+ :host([selectable]:not([selected]):hover)::before {
28389
+ background-color: ${hexToRgbaCssColor(White, 0.05)};
28390
+ }
28391
+
28392
+ :host([selected])::before {
28393
+ background-color: ${hexToRgbaCssColor(White, 0.25)};
28394
+ }
28395
+
28396
+ :host([selected]:hover)::before {
28397
+ background-color: ${hexToRgbaCssColor(White, 0.2)};
28398
+ }
28399
+ `));
28421
28400
 
28422
28401
  const styles$d = css `
28423
28402
  ${display('grid')}
@@ -28451,7 +28430,7 @@
28451
28430
  `;
28452
28431
 
28453
28432
  // prettier-ignore
28454
- const template$a = html `
28433
+ const template$b = html `
28455
28434
  <template role="cell" style="--ni-private-table-cell-nesting-level: ${x => x.nestingLevel}">
28456
28435
  ${x => x.cellViewTemplate}
28457
28436
  ${when(x => x.hasActionMenu, html `
@@ -28510,14 +28489,14 @@
28510
28489
  ], TableCell.prototype, "nestingLevel", void 0);
28511
28490
  const nimbleTableCell = TableCell.compose({
28512
28491
  baseName: 'table-cell',
28513
- template: template$a,
28492
+ template: template$b,
28514
28493
  styles: styles$d
28515
28494
  });
28516
28495
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTableCell());
28517
28496
  const tableCellTag = DesignSystem.tagFor(TableCell);
28518
28497
 
28519
28498
  // prettier-ignore
28520
- const template$9 = html `
28499
+ const template$a = html `
28521
28500
  <template role="row" aria-selected=${x => x.ariaSelected}>
28522
28501
  ${when(x => x.selectable && !x.hideSelection, html `
28523
28502
  <span role="gridcell" class="checkbox-container">
@@ -28701,7 +28680,7 @@
28701
28680
  ], TableRow.prototype, "ariaSelected", null);
28702
28681
  const nimbleTableRow = TableRow.compose({
28703
28682
  baseName: 'table-row',
28704
- template: template$9,
28683
+ template: template$a,
28705
28684
  styles: styles$e
28706
28685
  });
28707
28686
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTableRow());
@@ -28713,11 +28692,8 @@
28713
28692
  :host {
28714
28693
  align-items: center;
28715
28694
  height: calc(${controlHeight} + 2 * ${borderWidth});
28716
- border-top: calc(2 * ${borderWidth}) solid ${tableRowBorderColor};
28717
- }
28718
-
28719
- :host(:hover) {
28720
- background: ${fillHoverColor};
28695
+ border-top: calc(2 * ${borderWidth}) solid ${applicationBackgroundColor};
28696
+ box-sizing: border-box;
28721
28697
  }
28722
28698
 
28723
28699
  :host([expanded]) .animating,
@@ -28725,6 +28701,19 @@
28725
28701
  transition: ${mediumDelay} ease-in-out;
28726
28702
  }
28727
28703
 
28704
+ :host::before {
28705
+ content: '';
28706
+ width: 100%;
28707
+ height: ${controlHeight};
28708
+ pointer-events: none;
28709
+ bottom: 0px;
28710
+ position: absolute;
28711
+ }
28712
+
28713
+ :host(:hover)::before {
28714
+ background-color: ${fillHoverColor};
28715
+ }
28716
+
28728
28717
  .expand-collapse-button {
28729
28718
  margin-left: calc(
28730
28719
  ${smallPadding} * 2 + ${standardPadding} * 2 *
@@ -28778,11 +28767,19 @@
28778
28767
  .selection-checkbox::part(label) {
28779
28768
  padding-left: 0px;
28780
28769
  }
28781
- `;
28770
+ `.withBehaviors(themeBehavior(Theme.color, css `
28771
+ :host(:hover)::before {
28772
+ background-color: ${hexToRgbaCssColor(White, 0.05)};
28773
+ }
28774
+ `), themeBehavior(Theme.dark, css `
28775
+ :host(:hover)::before {
28776
+ background-color: ${hexToRgbaCssColor(White, 0.1)};
28777
+ }
28778
+ `));
28782
28779
 
28783
28780
  /* eslint-disable @typescript-eslint/indent */
28784
28781
  // prettier-ignore
28785
- const template$8 = html `
28782
+ const template$9 = html `
28786
28783
  <template
28787
28784
  role="row"
28788
28785
  @click=${x => x.onGroupExpandToggle()}
@@ -28911,14 +28908,14 @@
28911
28908
  ], TableGroupRow.prototype, "animationClass", void 0);
28912
28909
  const nimbleTableGroupRow = TableGroupRow.compose({
28913
28910
  baseName: 'table-group-row',
28914
- template: template$8,
28911
+ template: template$9,
28915
28912
  styles: styles$c
28916
28913
  });
28917
28914
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTableGroupRow());
28918
28915
  const tableGroupRowTag = DesignSystem.tagFor(TableGroupRow);
28919
28916
 
28920
28917
  // prettier-ignore
28921
- const template$7 = html `
28918
+ const template$8 = html `
28922
28919
  <template
28923
28920
  role="grid"
28924
28921
  aria-multiselectable="${x => x.ariaMultiSelectable}"
@@ -30603,7 +30600,7 @@
30603
30600
  ], Table.prototype, "firstSortedColumn", void 0);
30604
30601
  const nimbleTable = Table.compose({
30605
30602
  baseName: 'table',
30606
- template: template$7,
30603
+ template: template$8,
30607
30604
  styles: styles$g
30608
30605
  });
30609
30606
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTable());
@@ -30621,7 +30618,7 @@
30621
30618
  }
30622
30619
  `;
30623
30620
 
30624
- const template$6 = html `
30621
+ const template$7 = html `
30625
30622
  <template slot="${x => x.columnInternals.uniqueId}">
30626
30623
  <span class="header-content">
30627
30624
  <slot></slot>
@@ -30697,7 +30694,7 @@
30697
30694
  return GroupableColumn;
30698
30695
  }
30699
30696
 
30700
- const template$5 = html `
30697
+ const template$6 = html `
30701
30698
  <span
30702
30699
  ${ref('textSpan')}
30703
30700
  class="${x => (typeof x.groupHeaderValue === 'string' ? '' : 'placeholder')}"
@@ -30755,7 +30752,7 @@
30755
30752
  ], TableColumnTextGroupHeaderView.prototype, "content", null);
30756
30753
  const tableColumnTextGroupHeaderView = TableColumnTextGroupHeaderView.compose({
30757
30754
  baseName: 'table-column-text-group-header',
30758
- template: template$5,
30755
+ template: template$6,
30759
30756
  styles: styles$a
30760
30757
  });
30761
30758
  DesignSystem.getOrCreate()
@@ -30777,7 +30774,7 @@
30777
30774
  }
30778
30775
  `;
30779
30776
 
30780
- const template$4 = html `
30777
+ const template$5 = html `
30781
30778
  <span
30782
30779
  ${ref('textSpan')}
30783
30780
  class="${x => (typeof x.cellRecord.value === 'string' ? '' : 'placeholder')}"
@@ -30816,7 +30813,7 @@
30816
30813
  ], TableColumnTextCellView.prototype, "content", null);
30817
30814
  const textCellView = TableColumnTextCellView.compose({
30818
30815
  baseName: 'table-column-text-cell-view',
30819
- template: template$4,
30816
+ template: template$5,
30820
30817
  styles: styles$9
30821
30818
  });
30822
30819
  DesignSystem.getOrCreate().withPrefix('nimble').register(textCellView());
@@ -30852,7 +30849,7 @@
30852
30849
  ], TableColumnText.prototype, "placeholder", void 0);
30853
30850
  const nimbleTableColumnText = TableColumnText.compose({
30854
30851
  baseName: 'table-column-text',
30855
- template: template$6,
30852
+ template: template$7,
30856
30853
  styles: styles$b
30857
30854
  });
30858
30855
  DesignSystem.getOrCreate()
@@ -30924,7 +30921,7 @@
30924
30921
  }
30925
30922
  `;
30926
30923
 
30927
- const template$3 = html `
30924
+ const template$4 = html `
30928
30925
  <template slot="end">
30929
30926
  <div class="separator"></div>
30930
30927
  <slot></slot>
@@ -30938,7 +30935,7 @@
30938
30935
  }
30939
30936
  const nimbleTabsToolbar = TabsToolbar.compose({
30940
30937
  baseName: 'tabs-toolbar',
30941
- template: template$3,
30938
+ template: template$4,
30942
30939
  styles: styles$7
30943
30940
  });
30944
30941
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTabsToolbar());
@@ -31114,7 +31111,7 @@
31114
31111
  }
31115
31112
  `));
31116
31113
 
31117
- const template$2 = () => html `
31114
+ const template$3 = () => html `
31118
31115
  <label
31119
31116
  part="label"
31120
31117
  for="control"
@@ -31276,7 +31273,7 @@
31276
31273
  const nimbleTextArea = TextArea.compose({
31277
31274
  baseName: 'text-area',
31278
31275
  baseClass: TextArea$1,
31279
- template: template$2,
31276
+ template: template$3,
31280
31277
  styles: styles$6,
31281
31278
  shadowOptions: {
31282
31279
  delegatesFocus: true
@@ -31710,7 +31707,7 @@
31710
31707
  `));
31711
31708
 
31712
31709
  // prettier-ignore
31713
- const template$1 = html `
31710
+ const template$2 = html `
31714
31711
  ${when(x => x.tooltipVisible, html `
31715
31712
  <${anchoredRegionTag}
31716
31713
  class="anchored-region"
@@ -31762,7 +31759,7 @@
31762
31759
  const nimbleTooltip = Tooltip.compose({
31763
31760
  baseName: 'tooltip',
31764
31761
  baseClass: Tooltip$1,
31765
- template: template$1,
31762
+ template: template$2,
31766
31763
  styles: styles$3
31767
31764
  });
31768
31765
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTooltip());
@@ -32055,52 +32052,15 @@
32055
32052
  class TreeItem extends TreeItem$1 {
32056
32053
  constructor() {
32057
32054
  super(...arguments);
32058
- this.treeView = null;
32059
- // This prevents the toggling of selected state when a TreeItem is clicked multiple times,
32060
- // which is what the FAST TreeItem allows
32061
- this.handleSelectedChange = (event) => {
32062
- // only process selection
32063
- if (event.target === this && this.selected) {
32064
- this.setGroupSelectionOnRootParentTreeItem(this);
32065
- }
32066
- };
32067
- }
32068
- connectedCallback() {
32069
- super.connectedCallback();
32070
- this.addEventListener('selected-change', this.handleSelectedChange);
32071
- this.treeView = this.getParentTreeView();
32072
- if (this.treeView && this.selected) {
32073
- this.setGroupSelectionOnRootParentTreeItem(this);
32074
- }
32075
- }
32076
- disconnectedCallback() {
32077
- super.disconnectedCallback();
32078
- this.removeEventListener('selected-change', this.handleSelectedChange);
32079
- this.treeView = null;
32080
- }
32081
- clearTreeGroupSelection() {
32082
- const currentGroupSelection = this.treeView?.querySelectorAll(`[${groupSelectedAttribute}]`);
32083
- currentGroupSelection?.forEach(treeItem => treeItem.removeAttribute(groupSelectedAttribute));
32084
- }
32085
- setGroupSelectionOnRootParentTreeItem(treeItem) {
32086
- this.clearTreeGroupSelection();
32087
- let currentItem = treeItem;
32088
- while (currentItem?.parentElement !== this.treeView) {
32089
- currentItem = currentItem?.parentElement;
32090
- }
32091
- if (currentItem) {
32092
- currentItem.setAttribute(groupSelectedAttribute, 'true');
32093
- }
32094
- }
32095
- /**
32096
- * This was copied directly from the FAST TreeItem implementation
32097
- * @returns the root tree view
32098
- */
32099
- getParentTreeView() {
32100
- const parentNode = this.parentElement.closest("[role='tree']");
32101
- return parentNode;
32055
+ /**
32056
+ * @internal
32057
+ */
32058
+ this.groupSelected = false;
32102
32059
  }
32103
32060
  }
32061
+ __decorate$1([
32062
+ attr({ attribute: 'group-selected', mode: 'boolean' })
32063
+ ], TreeItem.prototype, "groupSelected", void 0);
32104
32064
  const nimbleTreeItem = TreeItem.compose({
32105
32065
  baseName: 'tree-item',
32106
32066
  baseClass: TreeItem$1,
@@ -32125,6 +32085,22 @@
32125
32085
  }
32126
32086
  `;
32127
32087
 
32088
+ // prettier-ignore
32089
+ const template$1 = html `
32090
+ <template
32091
+ role="tree"
32092
+ ${ref('treeView')}
32093
+ ${children$1({ property: 'selectedItems', subtree: true, selector: '[role="treeitem"][selected]', attributeFilter: ['role', 'selected'] })}
32094
+ @keydown="${(x, c) => x.handleKeyDown(c.event)}"
32095
+ @focusin="${(x, c) => x.handleFocus(c.event)}"
32096
+ @focusout="${(x, c) => x.handleBlur(c.event)}"
32097
+ @click="${(x, c) => x.handleClick(c.event)}"
32098
+ @selected-change="${(x, c) => x.handleSelectedChange(c.event)}"
32099
+ >
32100
+ <slot ${slotted('slottedTreeItems')}></slot>
32101
+ </template>
32102
+ `;
32103
+
32128
32104
  /**
32129
32105
  * A function that returns a nimble-tree-view registration for configuring the component with a DesignSystem.
32130
32106
  * Implements {@link @microsoft/fast-foundation#treeViewTemplate}
@@ -32139,6 +32115,10 @@
32139
32115
  constructor() {
32140
32116
  super(...arguments);
32141
32117
  this.selectionMode = TreeViewSelectionMode.all;
32118
+ /**
32119
+ * @internal
32120
+ */
32121
+ this.selectedItems = [];
32142
32122
  }
32143
32123
  handleClick(e) {
32144
32124
  if (e.defaultPrevented) {
@@ -32177,14 +32157,32 @@
32177
32157
  const treeItemChild = item.querySelector('[role="treeitem"]');
32178
32158
  return treeItemChild !== null;
32179
32159
  }
32160
+ selectedItemsChanged() {
32161
+ for (const item of Array.from(this.children)) {
32162
+ if (item instanceof TreeItem) {
32163
+ item.groupSelected = false;
32164
+ }
32165
+ }
32166
+ for (let item of this.selectedItems) {
32167
+ while (item.parentElement !== null && item.parentElement !== this) {
32168
+ item = item.parentElement;
32169
+ }
32170
+ if (item instanceof TreeItem) {
32171
+ item.groupSelected = true;
32172
+ }
32173
+ }
32174
+ }
32180
32175
  }
32181
32176
  __decorate$1([
32182
32177
  attr({ attribute: 'selection-mode' })
32183
32178
  ], TreeView.prototype, "selectionMode", void 0);
32179
+ __decorate$1([
32180
+ observable
32181
+ ], TreeView.prototype, "selectedItems", void 0);
32184
32182
  const nimbleTreeView = TreeView.compose({
32185
32183
  baseName: 'tree-view',
32186
32184
  baseClass: TreeView$1,
32187
- template: treeViewTemplate,
32185
+ template: template$1,
32188
32186
  styles: styles$1
32189
32187
  });
32190
32188
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTreeView());