@ni/nimble-components 29.1.8 → 29.2.1

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.
Files changed (32) hide show
  1. package/dist/all-components-bundle.js +470 -132
  2. package/dist/all-components-bundle.js.map +1 -1
  3. package/dist/all-components-bundle.min.js +2818 -2703
  4. package/dist/all-components-bundle.min.js.map +1 -1
  5. package/dist/esm/all-components.d.ts +1 -0
  6. package/dist/esm/all-components.js +1 -0
  7. package/dist/esm/all-components.js.map +1 -1
  8. package/dist/esm/combobox/template.js +1 -1
  9. package/dist/esm/combobox/template.js.map +1 -1
  10. package/dist/esm/list-option/template.js +1 -0
  11. package/dist/esm/list-option/template.js.map +1 -1
  12. package/dist/esm/list-option-group/index.d.ts +65 -0
  13. package/dist/esm/list-option-group/index.js +130 -0
  14. package/dist/esm/list-option-group/index.js.map +1 -0
  15. package/dist/esm/list-option-group/styles.d.ts +1 -0
  16. package/dist/esm/list-option-group/styles.js +62 -0
  17. package/dist/esm/list-option-group/styles.js.map +1 -0
  18. package/dist/esm/list-option-group/template.d.ts +2 -0
  19. package/dist/esm/list-option-group/template.js +37 -0
  20. package/dist/esm/list-option-group/template.js.map +1 -0
  21. package/dist/esm/rich-text/mention-listbox/template.js +3 -3
  22. package/dist/esm/rich-text/mention-listbox/template.js.map +1 -1
  23. package/dist/esm/select/index.d.ts +11 -2
  24. package/dist/esm/select/index.js +149 -36
  25. package/dist/esm/select/index.js.map +1 -1
  26. package/dist/esm/select/template.d.ts +4 -0
  27. package/dist/esm/select/template.js +11 -2
  28. package/dist/esm/select/template.js.map +1 -1
  29. package/dist/esm/select/testing/select.pageobject.d.ts +4 -1
  30. package/dist/esm/select/testing/select.pageobject.js +15 -0
  31. package/dist/esm/select/testing/select.pageobject.js.map +1 -1
  32. package/package.json +2 -2
@@ -16278,7 +16278,7 @@
16278
16278
 
16279
16279
  /**
16280
16280
  * Do not edit directly
16281
- * Generated on Mon, 03 Jun 2024 22:13:03 GMT
16281
+ * Generated on Tue, 04 Jun 2024 16:23:30 GMT
16282
16282
  */
16283
16283
 
16284
16284
  const Information100DarkUi = "#a46eff";
@@ -16347,7 +16347,7 @@
16347
16347
  const BodySize = "14px";
16348
16348
  const Body2Size = "16px";
16349
16349
  const GroupLabel1Size = "11px";
16350
- const ButtonLabel1Size = "12.800000190734863px";
16350
+ const ButtonLabel1Size = "14px";
16351
16351
  const Title1Size = "19px";
16352
16352
  const Headline2Size = "29.100000381469727px";
16353
16353
  const PlaceholderSize = "14px";
@@ -16709,9 +16709,9 @@
16709
16709
  return `${prefix}${uniqueIdCounter++}`;
16710
16710
  }
16711
16711
 
16712
- const template$H = html `<slot></slot>`;
16712
+ const template$I = html `<slot></slot>`;
16713
16713
 
16714
- const styles$_ = css `
16714
+ const styles$$ = css `
16715
16715
  ${display('contents')}
16716
16716
  `;
16717
16717
 
@@ -16826,8 +16826,8 @@
16826
16826
  ], ThemeProvider.prototype, "theme", void 0);
16827
16827
  const nimbleDesignSystemProvider = ThemeProvider.compose({
16828
16828
  baseName: 'theme-provider',
16829
- styles: styles$_,
16830
- template: template$H
16829
+ styles: styles$$,
16830
+ template: template$I
16831
16831
  });
16832
16832
  DesignSystem.getOrCreate()
16833
16833
  .withPrefix('nimble')
@@ -17012,7 +17012,7 @@
17012
17012
  }
17013
17013
  }
17014
17014
 
17015
- const styles$Z = css `
17015
+ const styles$_ = css `
17016
17016
  @layer base, hover, focusVisible, active, disabled;
17017
17017
 
17018
17018
  @layer base {
@@ -17092,7 +17092,7 @@
17092
17092
  `;
17093
17093
 
17094
17094
  // prettier-ignore
17095
- const template$G = (_context, definition) => html `${
17095
+ const template$H = (_context, definition) => html `${
17096
17096
  /* top-container div is necessary because setting contenteditable directly on the native anchor instead
17097
17097
  leaves it focusable, unlike the behavior you get when the anchor is _within_ a contenteditable element.
17098
17098
  */ ''}<div
@@ -17195,8 +17195,8 @@
17195
17195
  const nimbleAnchor = Anchor.compose({
17196
17196
  baseName: 'anchor',
17197
17197
  baseClass: Anchor$1,
17198
- template: template$G,
17199
- styles: styles$Z,
17198
+ template: template$H,
17199
+ styles: styles$_,
17200
17200
  shadowOptions: {
17201
17201
  delegatesFocus: true
17202
17202
  }
@@ -17308,7 +17308,7 @@
17308
17308
  padding: 0;
17309
17309
  `;
17310
17310
 
17311
- const styles$Y = css `
17311
+ const styles$Z = css `
17312
17312
  @layer base, checked, hover, focusVisible, active, disabled, top;
17313
17313
 
17314
17314
  @layer base {
@@ -17586,8 +17586,8 @@
17586
17586
  }
17587
17587
  `));
17588
17588
 
17589
- const styles$X = css `
17590
- ${styles$Y}
17589
+ const styles$Y = css `
17590
+ ${styles$Z}
17591
17591
  ${buttonAppearanceVariantStyles}
17592
17592
 
17593
17593
  .control {
@@ -17607,7 +17607,7 @@
17607
17607
  }
17608
17608
  `;
17609
17609
 
17610
- const template$F = (context, definition) => html `
17610
+ const template$G = (context, definition) => html `
17611
17611
  <a
17612
17612
  class="control"
17613
17613
  part="control"
@@ -17689,8 +17689,8 @@
17689
17689
  ], AnchorButton.prototype, "disabled", void 0);
17690
17690
  const nimbleAnchorButton = AnchorButton.compose({
17691
17691
  baseName: 'anchor-button',
17692
- template: template$F,
17693
- styles: styles$X,
17692
+ template: template$G,
17693
+ styles: styles$Y,
17694
17694
  shadowOptions: {
17695
17695
  delegatesFocus: true
17696
17696
  }
@@ -17698,7 +17698,7 @@
17698
17698
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleAnchorButton());
17699
17699
  const anchorButtonTag = 'nimble-anchor-button';
17700
17700
 
17701
- const styles$W = css `
17701
+ const styles$X = css `
17702
17702
  ${display('grid')}
17703
17703
 
17704
17704
  :host {
@@ -17782,7 +17782,7 @@
17782
17782
  }
17783
17783
  `;
17784
17784
 
17785
- const template$E = (context, definition) => html `
17785
+ const template$F = (context, definition) => html `
17786
17786
  <template
17787
17787
  role="menuitem"
17788
17788
  class="${x => (typeof x.startColumnCount === 'number'
@@ -17883,8 +17883,8 @@
17883
17883
  // FoundationAnchor already applies the StartEnd mixin, so we don't need to do it here.
17884
17884
  const nimbleAnchorMenuItem = AnchorMenuItem.compose({
17885
17885
  baseName: 'anchor-menu-item',
17886
- template: template$E,
17887
- styles: styles$W,
17886
+ template: template$F,
17887
+ styles: styles$X,
17888
17888
  shadowOptions: {
17889
17889
  delegatesFocus: true
17890
17890
  }
@@ -17894,7 +17894,7 @@
17894
17894
  .register(nimbleAnchorMenuItem());
17895
17895
  const anchorMenuItemTag = 'nimble-anchor-menu-item';
17896
17896
 
17897
- const styles$V = css `
17897
+ const styles$W = css `
17898
17898
  ${display('inline-flex')}
17899
17899
 
17900
17900
  :host {
@@ -18011,7 +18011,7 @@
18011
18011
  }
18012
18012
  `;
18013
18013
 
18014
- const template$D = (context, definition) => html `
18014
+ const template$E = (context, definition) => html `
18015
18015
  <template slot="anchortab" role="tab" aria-disabled="${x => x.disabled}">
18016
18016
  <a
18017
18017
  download="${x => x.download}"
@@ -18063,15 +18063,15 @@
18063
18063
  // FoundationAnchor already applies the StartEnd mixin, so we don't need to do it here.
18064
18064
  const nimbleAnchorTab = AnchorTab.compose({
18065
18065
  baseName: 'anchor-tab',
18066
- template: template$D,
18067
- styles: styles$V,
18066
+ template: template$E,
18067
+ styles: styles$W,
18068
18068
  shadowOptions: {
18069
18069
  delegatesFocus: true
18070
18070
  }
18071
18071
  });
18072
18072
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleAnchorTab());
18073
18073
 
18074
- const styles$U = css `
18074
+ const styles$V = css `
18075
18075
  ${display('grid')}
18076
18076
 
18077
18077
  :host {
@@ -18093,7 +18093,7 @@
18093
18093
  }
18094
18094
  `;
18095
18095
 
18096
- const template$C = (context, definition) => html `
18096
+ const template$D = (context, definition) => html `
18097
18097
  ${startSlotTemplate(context, definition)}
18098
18098
  <div ${ref('tablist')} class="tablist" part="tablist" role="tablist">
18099
18099
  <slot name="anchortab" ${slotted('tabs')}></slot>
@@ -18299,8 +18299,8 @@
18299
18299
  applyMixins(AnchorTabs, StartEnd);
18300
18300
  const nimbleAnchorTabs = AnchorTabs.compose({
18301
18301
  baseName: 'anchor-tabs',
18302
- template: template$C,
18303
- styles: styles$U,
18302
+ template: template$D,
18303
+ styles: styles$V,
18304
18304
  shadowOptions: {
18305
18305
  delegatesFocus: false
18306
18306
  }
@@ -18316,7 +18316,7 @@
18316
18316
  -webkit-user-select: none;
18317
18317
  `;
18318
18318
 
18319
- const styles$T = css `
18319
+ const styles$U = css `
18320
18320
  ${display('block')}
18321
18321
 
18322
18322
  :host {
@@ -18422,7 +18422,7 @@
18422
18422
  }
18423
18423
  `;
18424
18424
 
18425
- const template$B = (context, definition) => html `
18425
+ const template$C = (context, definition) => html `
18426
18426
  <template
18427
18427
  role="treeitem"
18428
18428
  slot="${x => (x.isNestedItem() ? 'item' : null)}"
@@ -18559,8 +18559,8 @@
18559
18559
  // FoundationAnchor already applies the StartEnd mixin, so we don't need to do it here.
18560
18560
  const nimbleAnchorTreeItem = AnchorTreeItem.compose({
18561
18561
  baseName: 'anchor-tree-item',
18562
- template: template$B,
18563
- styles: styles$T,
18562
+ template: template$C,
18563
+ styles: styles$U,
18564
18564
  shadowOptions: {
18565
18565
  delegatesFocus: true
18566
18566
  }
@@ -18576,7 +18576,7 @@
18576
18576
  zIndex1000: '1000'
18577
18577
  };
18578
18578
 
18579
- const styles$S = css `
18579
+ const styles$T = css `
18580
18580
  ${display('block')}
18581
18581
 
18582
18582
  :host {
@@ -18607,7 +18607,7 @@
18607
18607
  baseName: 'anchored-region',
18608
18608
  baseClass: AnchoredRegion$1,
18609
18609
  template: anchoredRegionTemplate,
18610
- styles: styles$S
18610
+ styles: styles$T
18611
18611
  });
18612
18612
  DesignSystem.getOrCreate()
18613
18613
  .withPrefix('nimble')
@@ -18687,7 +18687,7 @@
18687
18687
  */
18688
18688
  const themeBehavior = (theme, styles) => new ThemeStyleSheetBehavior(theme, styles);
18689
18689
 
18690
- const styles$R = css `
18690
+ const styles$S = css `
18691
18691
  ${display('flex')}
18692
18692
 
18693
18693
  :host {
@@ -18802,12 +18802,12 @@
18802
18802
  }
18803
18803
  `));
18804
18804
 
18805
- const styles$Q = css `
18806
- ${styles$Y}
18805
+ const styles$R = css `
18806
+ ${styles$Z}
18807
18807
  ${buttonAppearanceVariantStyles}
18808
18808
  `;
18809
18809
 
18810
- const template$A = (context, definition) => html `
18810
+ const template$B = (context, definition) => html `
18811
18811
  <button
18812
18812
  class="control"
18813
18813
  part="control"
@@ -18898,8 +18898,8 @@
18898
18898
  const nimbleButton = Button.compose({
18899
18899
  baseName: 'button',
18900
18900
  baseClass: Button$1,
18901
- template: template$A,
18902
- styles: styles$Q,
18901
+ template: template$B,
18902
+ styles: styles$R,
18903
18903
  shadowOptions: {
18904
18904
  delegatesFocus: true
18905
18905
  }
@@ -19650,13 +19650,13 @@
19650
19650
  };
19651
19651
 
19652
19652
  // Avoiding any whitespace in the template because this is an inline element
19653
- const template$z = html `<div
19653
+ const template$A = html `<div
19654
19654
  class="icon"
19655
19655
  aria-hidden="true"
19656
19656
  :innerHTML=${x => x.icon.data}
19657
19657
  ></div>`;
19658
19658
 
19659
- const styles$P = css `
19659
+ const styles$Q = css `
19660
19660
  ${display('inline-flex')}
19661
19661
 
19662
19662
  :host {
@@ -19709,8 +19709,8 @@
19709
19709
  const registerIcon = (baseName, iconClass) => {
19710
19710
  const composedIcon = iconClass.compose({
19711
19711
  baseName,
19712
- template: template$z,
19713
- styles: styles$P
19712
+ template: template$A,
19713
+ styles: styles$Q
19714
19714
  });
19715
19715
  DesignSystem.getOrCreate().withPrefix('nimble').register(composedIcon());
19716
19716
  };
@@ -19823,7 +19823,7 @@
19823
19823
  }).withDefault(coreLabelDefaults.filterNoResultsLabel);
19824
19824
 
19825
19825
  // prettier-ignore
19826
- const template$y = html `
19826
+ const template$z = html `
19827
19827
  <${themeProviderTag} theme="${Theme.color}">
19828
19828
  <div class="container"
19829
19829
  role="status"
@@ -19941,12 +19941,12 @@
19941
19941
  applyMixins(Banner, ARIAGlobalStatesAndProperties);
19942
19942
  const nimbleBanner = Banner.compose({
19943
19943
  baseName: 'banner',
19944
- template: template$y,
19945
- styles: styles$R
19944
+ template: template$z,
19945
+ styles: styles$S
19946
19946
  });
19947
19947
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleBanner());
19948
19948
 
19949
- const styles$O = css `
19949
+ const styles$P = css `
19950
19950
  ${display('inline-block')}
19951
19951
 
19952
19952
  :host {
@@ -19987,11 +19987,11 @@
19987
19987
  baseName: 'breadcrumb',
19988
19988
  baseClass: Breadcrumb$1,
19989
19989
  template: breadcrumbTemplate,
19990
- styles: styles$O
19990
+ styles: styles$P
19991
19991
  });
19992
19992
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleBreadcrumb());
19993
19993
 
19994
- const styles$N = css `
19994
+ const styles$O = css `
19995
19995
  ${display('inline-flex')}
19996
19996
 
19997
19997
  :host {
@@ -20069,14 +20069,14 @@
20069
20069
  baseName: 'breadcrumb-item',
20070
20070
  baseClass: BreadcrumbItem$1,
20071
20071
  template: breadcrumbItemTemplate,
20072
- styles: styles$N,
20072
+ styles: styles$O,
20073
20073
  separator: forwardSlash16X16.data
20074
20074
  });
20075
20075
  DesignSystem.getOrCreate()
20076
20076
  .withPrefix('nimble')
20077
20077
  .register(nimbleBreadcrumbItem());
20078
20078
 
20079
- const styles$M = css `
20079
+ const styles$N = css `
20080
20080
  ${display('flex')}
20081
20081
 
20082
20082
  :host {
@@ -20100,7 +20100,7 @@
20100
20100
  }
20101
20101
  `;
20102
20102
 
20103
- const template$x = html `
20103
+ const template$y = html `
20104
20104
  <section aria-labelledby="title-slot">
20105
20105
  <span id="title-slot"><slot name="title"></slot></span>
20106
20106
  <slot></slot>
@@ -20115,12 +20115,12 @@
20115
20115
  const nimbleCard = Card.compose({
20116
20116
  baseName: 'card',
20117
20117
  baseClass: Card$1,
20118
- template: template$x,
20119
- styles: styles$M
20118
+ template: template$y,
20119
+ styles: styles$N
20120
20120
  });
20121
20121
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleCard());
20122
20122
 
20123
- const styles$L = css `
20123
+ const styles$M = css `
20124
20124
  ${display('inline-flex')}
20125
20125
 
20126
20126
  :host {
@@ -20279,14 +20279,14 @@
20279
20279
  const nimbleCardButton = CardButton.compose({
20280
20280
  baseName: 'card-button',
20281
20281
  template: buttonTemplate,
20282
- styles: styles$L,
20282
+ styles: styles$M,
20283
20283
  shadowOptions: {
20284
20284
  delegatesFocus: true
20285
20285
  }
20286
20286
  });
20287
20287
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleCardButton());
20288
20288
 
20289
- const styles$K = css `
20289
+ const styles$L = css `
20290
20290
  ${display('inline-flex')}
20291
20291
 
20292
20292
  :host {
@@ -20395,7 +20395,7 @@
20395
20395
  }
20396
20396
  `;
20397
20397
 
20398
- const template$w = (_context, definition) => html `
20398
+ const template$x = (_context, definition) => html `
20399
20399
  <template
20400
20400
  role="checkbox"
20401
20401
  aria-checked="${x => x.checked}"
@@ -20444,16 +20444,16 @@
20444
20444
  const nimbleCheckbox = Checkbox.compose({
20445
20445
  baseName: 'checkbox',
20446
20446
  baseClass: Checkbox$1,
20447
- template: template$w,
20448
- styles: styles$K,
20447
+ template: template$x,
20448
+ styles: styles$L,
20449
20449
  checkedIndicator: check16X16.data,
20450
20450
  indeterminateIndicator: minus16X16.data
20451
20451
  });
20452
20452
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleCheckbox());
20453
20453
  const checkboxTag = 'nimble-checkbox';
20454
20454
 
20455
- const styles$J = css `
20456
- ${styles$Y}
20455
+ const styles$K = css `
20456
+ ${styles$Z}
20457
20457
  ${buttonAppearanceVariantStyles}
20458
20458
 
20459
20459
  @layer checked {
@@ -20502,7 +20502,7 @@
20502
20502
 
20503
20503
  /* eslint-disable @typescript-eslint/indent */
20504
20504
  // prettier-ignore
20505
- const template$v = (context, definition) => html `
20505
+ const template$w = (context, definition) => html `
20506
20506
  <div
20507
20507
  role="button"
20508
20508
  part="control"
@@ -20598,8 +20598,8 @@
20598
20598
  applyMixins(ToggleButton, StartEnd, DelegatesARIAButton);
20599
20599
  const nimbleToggleButton = ToggleButton.compose({
20600
20600
  baseName: 'toggle-button',
20601
- template: template$v,
20602
- styles: styles$J,
20601
+ template: template$w,
20602
+ styles: styles$K,
20603
20603
  shadowOptions: {
20604
20604
  delegatesFocus: true
20605
20605
  }
@@ -20636,7 +20636,7 @@
20636
20636
  block: 'block'
20637
20637
  };
20638
20638
 
20639
- const styles$I = css `
20639
+ const styles$J = css `
20640
20640
  ${display('inline-flex')}
20641
20641
 
20642
20642
  :host {
@@ -20856,7 +20856,7 @@
20856
20856
  }
20857
20857
  `));
20858
20858
 
20859
- const styles$H = css `
20859
+ const styles$I = css `
20860
20860
  .error-icon {
20861
20861
  display: none;
20862
20862
  }
@@ -20903,9 +20903,9 @@
20903
20903
  standard: 'standard'
20904
20904
  };
20905
20905
 
20906
- const styles$G = css `
20906
+ const styles$H = css `
20907
+ ${styles$J}
20907
20908
  ${styles$I}
20908
- ${styles$H}
20909
20909
 
20910
20910
  :host {
20911
20911
  --ni-private-hover-bottom-border-width: 2px;
@@ -21041,7 +21041,7 @@
21041
21041
  }
21042
21042
 
21043
21043
  // prettier-ignore
21044
- const template$u = (context, definition) => html `
21044
+ const template$v = (context, definition) => html `
21045
21045
  <template
21046
21046
  aria-disabled="${x => x.ariaDisabled}"
21047
21047
  autocomplete="${x => x.autocomplete}"
@@ -21102,7 +21102,7 @@
21102
21102
  ?disabled="${x => x.disabled}"
21103
21103
  ${ref('listbox')}
21104
21104
  >
21105
- <slot
21105
+ <slot name="option"
21106
21106
  ${slotted({
21107
21107
  filter: (n) => n instanceof HTMLElement && Listbox.slottedOptionFilter(n),
21108
21108
  flatten: true,
@@ -21746,8 +21746,8 @@
21746
21746
  const nimbleCombobox = Combobox.compose({
21747
21747
  baseName: 'combobox',
21748
21748
  baseClass: FormAssociatedCombobox,
21749
- template: template$u,
21750
- styles: styles$G,
21749
+ template: template$v,
21750
+ styles: styles$H,
21751
21751
  shadowOptions: {
21752
21752
  delegatesFocus: true
21753
21753
  },
@@ -21792,7 +21792,7 @@
21792
21792
  */
21793
21793
  const UserDismissed = Symbol('user dismissed');
21794
21794
 
21795
- const styles$F = css `
21795
+ const styles$G = css `
21796
21796
  ${display('grid')}
21797
21797
 
21798
21798
  dialog {
@@ -21898,7 +21898,7 @@
21898
21898
  }
21899
21899
  `));
21900
21900
 
21901
- const template$t = html `
21901
+ const template$u = html `
21902
21902
  <template>
21903
21903
  <dialog
21904
21904
  ${ref('dialogElement')}
@@ -22046,13 +22046,13 @@
22046
22046
  applyMixins(Dialog, ARIAGlobalStatesAndProperties);
22047
22047
  const nimbleDialog = Dialog.compose({
22048
22048
  baseName: 'dialog',
22049
- template: template$t,
22050
- styles: styles$F,
22049
+ template: template$u,
22050
+ styles: styles$G,
22051
22051
  baseClass: Dialog
22052
22052
  });
22053
22053
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleDialog());
22054
22054
 
22055
- const styles$E = css `
22055
+ const styles$F = css `
22056
22056
  ${display('block')}
22057
22057
 
22058
22058
  :host {
@@ -22205,7 +22205,7 @@
22205
22205
  }
22206
22206
  `));
22207
22207
 
22208
- const template$s = html `
22208
+ const template$t = html `
22209
22209
  <dialog
22210
22210
  ${ref('dialog')}
22211
22211
  aria-label="${x => x.ariaLabel}"
@@ -22348,8 +22348,8 @@
22348
22348
  applyMixins(Drawer, ARIAGlobalStatesAndProperties);
22349
22349
  const nimbleDrawer = Drawer.compose({
22350
22350
  baseName: 'drawer',
22351
- template: template$s,
22352
- styles: styles$E
22351
+ template: template$t,
22352
+ styles: styles$F
22353
22353
  });
22354
22354
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleDrawer());
22355
22355
 
@@ -24579,7 +24579,7 @@
24579
24579
  }
24580
24580
  }
24581
24581
 
24582
- const styles$D = css `
24582
+ const styles$E = css `
24583
24583
  ${display('none')}
24584
24584
  `;
24585
24585
 
@@ -24628,7 +24628,7 @@
24628
24628
  ], LabelProviderCore.prototype, "filterNoResults", void 0);
24629
24629
  const nimbleLabelProviderCore = LabelProviderCore.compose({
24630
24630
  baseName: 'label-provider-core',
24631
- styles: styles$D
24631
+ styles: styles$E
24632
24632
  });
24633
24633
  DesignSystem.getOrCreate()
24634
24634
  .withPrefix('nimble')
@@ -24795,13 +24795,13 @@
24795
24795
  ], LabelProviderTable.prototype, "groupRowPlaceholderEmpty", void 0);
24796
24796
  const nimbleLabelProviderTable = LabelProviderTable.compose({
24797
24797
  baseName: 'label-provider-table',
24798
- styles: styles$D
24798
+ styles: styles$E
24799
24799
  });
24800
24800
  DesignSystem.getOrCreate()
24801
24801
  .withPrefix('nimble')
24802
24802
  .register(nimbleLabelProviderTable());
24803
24803
 
24804
- const styles$C = css `
24804
+ const styles$D = css `
24805
24805
  ${display('flex')}
24806
24806
 
24807
24807
  :host {
@@ -24878,7 +24878,7 @@
24878
24878
  * @public
24879
24879
  */
24880
24880
  // prettier-ignore
24881
- const template$r = (context, definition) => html `
24881
+ const template$s = (context, definition) => html `
24882
24882
  <template
24883
24883
  aria-checked="${x => x.ariaChecked}"
24884
24884
  aria-disabled="${x => x.ariaDisabled}"
@@ -24889,6 +24889,7 @@
24889
24889
  .filter(Boolean)
24890
24890
  .join(' ')}"
24891
24891
  role="option"
24892
+ slot="option"
24892
24893
  >
24893
24894
  ${startSlotTemplate(context, definition)}
24894
24895
  <span
@@ -24973,12 +24974,228 @@
24973
24974
  const nimbleListOption = ListOption.compose({
24974
24975
  baseName: 'list-option',
24975
24976
  baseClass: ListboxOption,
24976
- template: template$r,
24977
- styles: styles$C
24977
+ template: template$s,
24978
+ styles: styles$D
24978
24979
  });
24979
24980
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleListOption());
24980
24981
  const listOptionTag = 'nimble-list-option';
24981
24982
 
24983
+ const styles$C = css `
24984
+ ${display('flex')}
24985
+
24986
+ :host {
24987
+ cursor: default;
24988
+ flex-direction: column;
24989
+ }
24990
+
24991
+ :host([visually-hidden]) {
24992
+ display: none;
24993
+ }
24994
+
24995
+ :host::after,
24996
+ :host::before {
24997
+ content: ' ';
24998
+ margin-top: ${smallPadding};
24999
+ margin-bottom: ${smallPadding};
25000
+ border-bottom: ${borderColor} 2px solid;
25001
+ opacity: 0.1;
25002
+ display: none;
25003
+ }
25004
+
25005
+ :host([top-separator-visible])::before,
25006
+ :host([bottom-separator-visible])::after {
25007
+ display: block;
25008
+ }
25009
+
25010
+ slot[name='option']::slotted([role='option']) {
25011
+ background-color: transparent;
25012
+ }
25013
+
25014
+ slot[name='option']::slotted([role='option']:hover) {
25015
+ background-color: ${fillHoverColor};
25016
+ }
25017
+
25018
+ slot[name='option']::slotted([role='option'][active-option]) {
25019
+ background-color: ${fillSelectedColor};
25020
+ }
25021
+
25022
+ slot[name='option']::slotted([role='option'][active-option]:hover) {
25023
+ background-color: ${fillHoverSelectedColor};
25024
+ }
25025
+
25026
+ .label-display {
25027
+ font: ${groupHeaderFont};
25028
+ text-transform: ${groupHeaderTextTransform};
25029
+ color: ${groupHeaderFontColor};
25030
+ white-space: nowrap;
25031
+ overflow: hidden;
25032
+ text-overflow: ellipsis;
25033
+ margin-left: ${smallPadding};
25034
+ margin-bottom: ${smallPadding};
25035
+ }
25036
+
25037
+ .label-slot.hidden {
25038
+ display: none;
25039
+ }
25040
+ `;
25041
+
25042
+ const isListOption$1 = (n) => {
25043
+ return n instanceof ListOption;
25044
+ };
25045
+ // prettier-ignore
25046
+ const template$r = html `
25047
+ <template
25048
+ role="group"
25049
+ aria-label="${x => x.labelContent}"
25050
+ slot="option"
25051
+ >
25052
+ <span ${overflow('hasOverflow')}
25053
+ class="label-display"
25054
+ aria-hidden="true"
25055
+ title=${x => (x.hasOverflow && x.labelContent ? x.labelContent : null)}
25056
+ @click="${(x, c) => x.clickHandler(c.event)}"
25057
+ >
25058
+ ${when(x => (typeof x.label === 'string'), html `${x => x.label}`)}
25059
+ <slot ${ref('labelSlot')}
25060
+ class="label-slot ${x => (typeof x.label === 'string' ? 'hidden' : '')}"
25061
+ >
25062
+ </slot>
25063
+ </span>
25064
+ <span class="content" part="content" role="none">
25065
+ <slot name="option"
25066
+ ${slotted({
25067
+ flatten: true,
25068
+ filter: (n) => isListOption$1(n),
25069
+ property: 'listOptions'
25070
+ })}
25071
+ ></slot>
25072
+ </span>
25073
+ </template>
25074
+ `;
25075
+
25076
+ /**
25077
+ * A nimble-styled HTML listbox option group
25078
+ */
25079
+ class ListOptionGroup extends FoundationElement {
25080
+ constructor() {
25081
+ super(...arguments);
25082
+ /**
25083
+ * The hidden state of the element.
25084
+ *
25085
+ * @public
25086
+ * @defaultValue - false
25087
+ * @remarks
25088
+ * HTML Attribute: hidden
25089
+ */
25090
+ this.hidden = false;
25091
+ /**
25092
+ * @internal
25093
+ * This attribute is required to allow use-cases that offer dynamic filtering
25094
+ * (like the Select) to visually hide groups that are filtered out, but still
25095
+ * allow users to use the native 'hidden' attribute without it being affected
25096
+ * by the filtering process.
25097
+ */
25098
+ this.visuallyHidden = false;
25099
+ /**
25100
+ * @internal
25101
+ */
25102
+ this.topSeparatorVisible = false;
25103
+ /**
25104
+ * @internal
25105
+ */
25106
+ this.bottomSeparatorVisible = false;
25107
+ /** @internal */
25108
+ this.hasOverflow = false;
25109
+ this.hiddenOptions = new Set();
25110
+ }
25111
+ /** @internal */
25112
+ get labelContent() {
25113
+ if (this.label) {
25114
+ return this.label;
25115
+ }
25116
+ if (!this.$fastController.isConnected) {
25117
+ return '';
25118
+ }
25119
+ const nodes = this.labelSlot.assignedNodes();
25120
+ return nodes
25121
+ .filter(node => node.textContent?.trim() !== '')
25122
+ .map(node => node.textContent?.trim())
25123
+ .join(' ');
25124
+ }
25125
+ /**
25126
+ * @internal
25127
+ */
25128
+ clickHandler(e) {
25129
+ e.preventDefault();
25130
+ e.stopImmediatePropagation();
25131
+ }
25132
+ /**
25133
+ * @internal
25134
+ */
25135
+ handleChange(source, propertyName) {
25136
+ if (source instanceof ListOption
25137
+ && (propertyName === 'hidden' || propertyName === 'visuallyHidden')) {
25138
+ if (source.hidden || source.visuallyHidden) {
25139
+ this.hiddenOptions.add(source);
25140
+ }
25141
+ else {
25142
+ this.hiddenOptions.delete(source);
25143
+ }
25144
+ this.visuallyHidden = this.hiddenOptions.size === this.listOptions.length;
25145
+ }
25146
+ }
25147
+ listOptionsChanged(prev, next) {
25148
+ this.hiddenOptions.clear();
25149
+ next.filter(o => o.hidden || o.visuallyHidden).forEach(o => this.hiddenOptions.add(o));
25150
+ prev?.forEach(o => {
25151
+ const notifier = Observable.getNotifier(o);
25152
+ notifier.unsubscribe(this, 'hidden');
25153
+ notifier.unsubscribe(this, 'visuallyHidden');
25154
+ });
25155
+ let allOptionsHidden = true;
25156
+ next?.forEach(o => {
25157
+ const notifier = Observable.getNotifier(o);
25158
+ notifier.subscribe(this, 'hidden');
25159
+ notifier.subscribe(this, 'visuallyHidden');
25160
+ allOptionsHidden = allOptionsHidden && (o.hidden || o.visuallyHidden);
25161
+ });
25162
+ this.visuallyHidden = next.length === 0 || allOptionsHidden;
25163
+ }
25164
+ }
25165
+ __decorate$1([
25166
+ attr
25167
+ ], ListOptionGroup.prototype, "label", void 0);
25168
+ __decorate$1([
25169
+ attr({ mode: 'boolean' })
25170
+ ], ListOptionGroup.prototype, "hidden", void 0);
25171
+ __decorate$1([
25172
+ attr({ attribute: 'visually-hidden', mode: 'boolean' })
25173
+ ], ListOptionGroup.prototype, "visuallyHidden", void 0);
25174
+ __decorate$1([
25175
+ attr({ attribute: 'top-separator-visible', mode: 'boolean' })
25176
+ ], ListOptionGroup.prototype, "topSeparatorVisible", void 0);
25177
+ __decorate$1([
25178
+ attr({ attribute: 'bottom-separator-visible', mode: 'boolean' })
25179
+ ], ListOptionGroup.prototype, "bottomSeparatorVisible", void 0);
25180
+ __decorate$1([
25181
+ observable
25182
+ ], ListOptionGroup.prototype, "hasOverflow", void 0);
25183
+ __decorate$1([
25184
+ observable
25185
+ ], ListOptionGroup.prototype, "listOptions", void 0);
25186
+ __decorate$1([
25187
+ volatile
25188
+ ], ListOptionGroup.prototype, "labelContent", null);
25189
+ const nimbleListOptionGroup = ListOptionGroup.compose({
25190
+ baseName: 'list-option-group',
25191
+ baseClass: FoundationElement,
25192
+ template: template$r,
25193
+ styles: styles$C
25194
+ });
25195
+ DesignSystem.getOrCreate()
25196
+ .withPrefix('nimble')
25197
+ .register(nimbleListOptionGroup());
25198
+
24982
25199
  /**
24983
25200
  * Base class for mapping configuration elements
24984
25201
  */
@@ -25604,7 +25821,7 @@
25604
25821
 
25605
25822
  const styles$x = css `
25606
25823
  ${display('inline-block')}
25607
- ${styles$H}
25824
+ ${styles$I}
25608
25825
 
25609
25826
  :host {
25610
25827
  font: ${bodyFont};
@@ -43737,7 +43954,7 @@ img.ProseMirror-separator {
43737
43954
  }).withDefault(richTextLabelDefaults.richTextToggleNumberedListLabel);
43738
43955
 
43739
43956
  const styles$t = css `
43740
- ${styles$I}
43957
+ ${styles$J}
43741
43958
 
43742
43959
  :host {
43743
43960
  height: auto;
@@ -43775,8 +43992,8 @@ img.ProseMirror-separator {
43775
43992
  @click="${(x, c) => x.clickHandler(c.event)}"
43776
43993
  ?disabled="${x => x.disabled}"
43777
43994
  >
43778
- <slot
43779
- ${slotted({ filter: (n) => n instanceof HTMLElement && ListboxElement.slottedOptionFilter(n), flatten: true, property: 'slottedOptions' })}
43995
+ <slot name="option"
43996
+ ${slotted({ filter: (n) => n instanceof HTMLElement && Listbox.slottedOptionFilter(n), flatten: true, property: 'slottedOptions' })}
43780
43997
  >
43781
43998
  </slot>
43782
43999
  </div>
@@ -44129,7 +44346,7 @@ img.ProseMirror-separator {
44129
44346
 
44130
44347
  const styles$s = css `
44131
44348
  ${display('inline-flex')}
44132
- ${styles$H}
44349
+ ${styles$I}
44133
44350
 
44134
44351
  :host {
44135
44352
  font: ${bodyFont};
@@ -59032,8 +59249,8 @@ img.ProseMirror-separator {
59032
59249
  .register(nimbleRichTextViewer());
59033
59250
 
59034
59251
  const styles$q = css `
59252
+ ${styles$J}
59035
59253
  ${styles$I}
59036
- ${styles$H}
59037
59254
 
59038
59255
  ${
59039
59256
  /* We are using flex `order` to define the visual ordering of the selected value,
@@ -59171,6 +59388,12 @@ img.ProseMirror-separator {
59171
59388
  }
59172
59389
  `));
59173
59390
 
59391
+ const isListOption = (el) => {
59392
+ return el instanceof ListOption;
59393
+ };
59394
+ const isListOptionGroup = (n) => {
59395
+ return n instanceof ListOptionGroup;
59396
+ };
59174
59397
  /* eslint-disable @typescript-eslint/indent */
59175
59398
  // prettier-ignore
59176
59399
  const template$l = (context, definition) => html `
@@ -59272,8 +59495,9 @@ img.ProseMirror-separator {
59272
59495
  <div ${ref('scrollableRegion')}
59273
59496
  class="scrollable-region">
59274
59497
  <slot
59498
+ name="option"
59275
59499
  ${slotted({
59276
- filter: (n) => n instanceof HTMLElement && isListboxOption(n),
59500
+ filter: (n) => n instanceof HTMLElement && (isListOption(n) || isListOptionGroup(n)),
59277
59501
  flatten: true,
59278
59502
  property: 'slottedOptions',
59279
59503
  })}
@@ -59308,15 +59532,15 @@ img.ProseMirror-separator {
59308
59532
  }
59309
59533
  }
59310
59534
 
59311
- const isNimbleListOption = (el) => {
59312
- return el instanceof ListOption;
59313
- };
59314
59535
  const isOptionSelectable = (el) => {
59315
59536
  return !el.visuallyHidden && !el.disabled && !el.hidden;
59316
59537
  };
59317
59538
  const isOptionPlaceholder = (el) => {
59318
59539
  return el.disabled && el.hidden;
59319
59540
  };
59541
+ const isOptionOrGroupVisible = (el) => {
59542
+ return !el.visuallyHidden && !el.hidden;
59543
+ };
59320
59544
  /**
59321
59545
  * A nimble-styled HTML select.
59322
59546
  */
@@ -59437,13 +59661,25 @@ img.ProseMirror-separator {
59437
59661
  notifier.unsubscribe(this, 'hidden');
59438
59662
  notifier.unsubscribe(this, 'disabled');
59439
59663
  });
59440
- super.slottedOptionsChanged(prev, next);
59441
- this.options.forEach(o => {
59664
+ prev?.filter(isListOptionGroup).forEach(el => {
59665
+ const notifier = Observable.getNotifier(el);
59666
+ notifier.unsubscribe(this, 'hidden');
59667
+ notifier.unsubscribe(this, 'visuallyHidden');
59668
+ });
59669
+ const options = this.getSlottedOptions(next);
59670
+ super.slottedOptionsChanged(prev, options);
59671
+ options.forEach(o => {
59442
59672
  const notifier = Observable.getNotifier(o);
59443
59673
  notifier.subscribe(this, 'value');
59444
59674
  notifier.subscribe(this, 'hidden');
59445
59675
  notifier.subscribe(this, 'disabled');
59446
59676
  });
59677
+ next?.filter(isListOptionGroup).forEach(el => {
59678
+ this.updateAdjacentSeparatorState(el);
59679
+ const notifier = Observable.getNotifier(el);
59680
+ notifier.subscribe(this, 'hidden');
59681
+ notifier.subscribe(this, 'visuallyHidden');
59682
+ });
59447
59683
  this.setProxyOptions();
59448
59684
  this.updateValue();
59449
59685
  // We need to force an update to the filteredOptions observable
@@ -59496,8 +59732,7 @@ img.ProseMirror-separator {
59496
59732
  break;
59497
59733
  }
59498
59734
  case 'selected': {
59499
- if (isNimbleListOption(sourceElement)
59500
- && sourceElement.selected) {
59735
+ if (isListOption(sourceElement) && sourceElement.selected) {
59501
59736
  this.selectedIndex = this.options.indexOf(sourceElement);
59502
59737
  }
59503
59738
  else {
@@ -59506,12 +59741,27 @@ img.ProseMirror-separator {
59506
59741
  break;
59507
59742
  }
59508
59743
  case 'hidden': {
59509
- if (isNimbleListOption(sourceElement)) {
59744
+ if (isListOption(sourceElement)) {
59510
59745
  sourceElement.visuallyHidden = sourceElement.hidden;
59746
+ this.updateAdjacentSeparatorState(sourceElement);
59511
59747
  }
59748
+ else if (isListOptionGroup(sourceElement)) {
59749
+ sourceElement.listOptions.forEach(e => {
59750
+ e.visuallyHidden = sourceElement.hidden;
59751
+ });
59752
+ this.updateAdjacentSeparatorState(sourceElement);
59753
+ }
59754
+ this.filterOptions();
59512
59755
  this.updateDisplayValue();
59513
59756
  break;
59514
59757
  }
59758
+ case 'visuallyHidden': {
59759
+ if (isListOptionGroup(sourceElement)
59760
+ || isListOption(sourceElement)) {
59761
+ this.updateAdjacentSeparatorState(sourceElement);
59762
+ }
59763
+ break;
59764
+ }
59515
59765
  case 'disabled': {
59516
59766
  this.updateDisplayValue();
59517
59767
  break;
@@ -59764,8 +60014,7 @@ img.ProseMirror-separator {
59764
60014
  const startIndex = this.openActiveIndex ?? this.selectedIndex;
59765
60015
  for (let i = startIndex + 1; i < this.options.length; i++) {
59766
60016
  const listOption = this.options[i];
59767
- if (isNimbleListOption(listOption)
59768
- && isOptionSelectable(listOption)) {
60017
+ if (isListOption(listOption) && isOptionSelectable(listOption)) {
59769
60018
  this.setActiveOption(i);
59770
60019
  break;
59771
60020
  }
@@ -59780,8 +60029,7 @@ img.ProseMirror-separator {
59780
60029
  const startIndex = this.openActiveIndex ?? this.selectedIndex;
59781
60030
  for (let i = startIndex - 1; i >= 0; i--) {
59782
60031
  const listOption = this.options[i];
59783
- if (isNimbleListOption(listOption)
59784
- && isOptionSelectable(listOption)) {
60032
+ if (isListOption(listOption) && isOptionSelectable(listOption)) {
59785
60033
  this.setActiveOption(i);
59786
60034
  break;
59787
60035
  }
@@ -59791,14 +60039,14 @@ img.ProseMirror-separator {
59791
60039
  * @internal
59792
60040
  */
59793
60041
  selectFirstOption() {
59794
- const newActiveOptionIndex = this.options.findIndex(o => isNimbleListOption(o) && isOptionSelectable(o));
60042
+ const newActiveOptionIndex = this.options.findIndex(o => isListOption(o) && isOptionSelectable(o));
59795
60043
  this.setActiveOption(newActiveOptionIndex);
59796
60044
  }
59797
60045
  /**
59798
60046
  * @internal
59799
60047
  */
59800
60048
  selectLastOption() {
59801
- const newActiveOptionIndex = findLastIndex(this.options, o => isNimbleListOption(o) && isOptionSelectable(o));
60049
+ const newActiveOptionIndex = findLastIndex(this.options, o => isListOption(o) && isOptionSelectable(o));
59802
60050
  this.setActiveOption(newActiveOptionIndex);
59803
60051
  }
59804
60052
  /**
@@ -59866,7 +60114,7 @@ img.ProseMirror-separator {
59866
60114
  return;
59867
60115
  }
59868
60116
  const activeOption = this.options[this.openActiveIndex ?? this.selectedIndex];
59869
- if (isNimbleListOption(activeOption)) {
60117
+ if (isListOption(activeOption)) {
59870
60118
  activeOption.activeOption = false;
59871
60119
  }
59872
60120
  this.openActiveIndex = undefined;
@@ -59909,7 +60157,7 @@ img.ProseMirror-separator {
59909
60157
  */
59910
60158
  setDefaultSelectedOption() {
59911
60159
  const options = this.options
59912
- ?? Array.from(this.children).filter(o => isNimbleListOption(o));
60160
+ ?? Array.from(this.children).filter(o => isListOption(o));
59913
60161
  const optionIsSelected = (option) => {
59914
60162
  return option.hasAttribute('selected') || option.selected;
59915
60163
  };
@@ -59943,16 +60191,28 @@ img.ProseMirror-separator {
59943
60191
  this.selectedIndex = 0;
59944
60192
  }
59945
60193
  }
60194
+ getSlottedOptions(slottedElements) {
60195
+ const options = [];
60196
+ slottedElements?.forEach(el => {
60197
+ if (isListOption(el)) {
60198
+ options.push(el);
60199
+ }
60200
+ else if (isListOptionGroup(el)) {
60201
+ options.push(...this.getGroupOptions(el));
60202
+ }
60203
+ });
60204
+ return options;
60205
+ }
59946
60206
  setActiveOption(newActiveIndex) {
59947
60207
  const activeOption = this.options[newActiveIndex];
59948
60208
  if (this.open) {
59949
- if (isNimbleListOption(activeOption)) {
60209
+ if (isListOption(activeOption)) {
59950
60210
  activeOption.activeOption = true;
59951
60211
  }
59952
60212
  const previousActiveIndex = this.openActiveIndex ?? this.selectedIndex;
59953
60213
  const previousActiveOption = this.options[previousActiveIndex];
59954
60214
  if (previousActiveIndex !== newActiveIndex
59955
- && isNimbleListOption(previousActiveOption)) {
60215
+ && isListOption(previousActiveOption)) {
59956
60216
  previousActiveOption.activeOption = false;
59957
60217
  }
59958
60218
  this.openActiveIndex = newActiveIndex;
@@ -60006,32 +60266,110 @@ img.ProseMirror-separator {
60006
60266
  : Math.trunc(availableBottom);
60007
60267
  this.updateListboxMaxHeightCssVariable();
60008
60268
  }
60269
+ updateAdjacentSeparatorState(element) {
60270
+ const previousElement = this.getPreviousVisibleOptionOrGroup(element);
60271
+ const nextElement = this.getNextVisibleOptionOrGroup(element);
60272
+ if (isOptionOrGroupVisible(element)) {
60273
+ const topSeparatorVisible = isListOption(previousElement);
60274
+ this.setTopSeparatorState(element, topSeparatorVisible);
60275
+ const bottomSeparatorVisible = nextElement !== null;
60276
+ this.setBottomSeparatorState(element, bottomSeparatorVisible);
60277
+ this.setBottomSeparatorState(previousElement, true);
60278
+ }
60279
+ else {
60280
+ const nextTopSeparatorVisible = isListOption(previousElement);
60281
+ this.setTopSeparatorState(nextElement, nextTopSeparatorVisible);
60282
+ const previousBottomSeparatorVisible = nextElement !== null;
60283
+ this.setBottomSeparatorState(previousElement, previousBottomSeparatorVisible);
60284
+ }
60285
+ }
60286
+ setTopSeparatorState(element, visible) {
60287
+ if (isListOptionGroup(element)) {
60288
+ element.topSeparatorVisible = visible;
60289
+ }
60290
+ }
60291
+ setBottomSeparatorState(element, visible) {
60292
+ if (isListOptionGroup(element)) {
60293
+ element.bottomSeparatorVisible = visible;
60294
+ }
60295
+ }
60296
+ getPreviousVisibleOptionOrGroup(element) {
60297
+ let previousElement = element.previousElementSibling;
60298
+ while (previousElement) {
60299
+ if ((isListOption(previousElement)
60300
+ || isListOptionGroup(previousElement))
60301
+ && isOptionOrGroupVisible(previousElement)) {
60302
+ return previousElement;
60303
+ }
60304
+ previousElement = previousElement.previousElementSibling;
60305
+ }
60306
+ return null;
60307
+ }
60308
+ getNextVisibleOptionOrGroup(element) {
60309
+ let nextElement = element.nextElementSibling;
60310
+ while (nextElement) {
60311
+ if ((isListOption(nextElement) || isListOptionGroup(nextElement))
60312
+ && isOptionOrGroupVisible(nextElement)) {
60313
+ return nextElement;
60314
+ }
60315
+ nextElement = nextElement.nextElementSibling;
60316
+ }
60317
+ return null;
60318
+ }
60319
+ isOptionHiddenOrFilteredOut(option) {
60320
+ if (option.hidden) {
60321
+ return true;
60322
+ }
60323
+ return !this.filterMatchesText(option.text);
60324
+ }
60325
+ filterMatchesText(text) {
60326
+ const filter = this.filter.toLowerCase();
60327
+ const normalizedFilter = diacriticInsensitiveStringNormalizer(filter);
60328
+ return diacriticInsensitiveStringNormalizer(text).includes(normalizedFilter);
60329
+ }
60009
60330
  /**
60010
60331
  * Filter available options by text value.
60011
60332
  *
60012
60333
  * @public
60013
60334
  */
60014
60335
  filterOptions() {
60015
- const filter = this.filter.toLowerCase();
60016
- if (filter) {
60017
- this.filteredOptions = this.options.filter(option => {
60018
- const normalizedFilter = diacriticInsensitiveStringNormalizer(filter);
60019
- return (!option.hidden
60020
- && diacriticInsensitiveStringNormalizer(option.text).includes(normalizedFilter));
60021
- });
60022
- }
60023
- else {
60024
- this.filteredOptions = this.options.filter(option => !option.hidden);
60336
+ if (!this.$fastController.isConnected) {
60337
+ return;
60025
60338
  }
60026
- this.options.forEach(o => {
60027
- if (isNimbleListOption(o)) {
60028
- if (!this.filteredOptions.includes(o)) {
60029
- o.visuallyHidden = true;
60339
+ const filteredOptions = [];
60340
+ for (const element of this.slottedOptions) {
60341
+ if (isListOptionGroup(element)) {
60342
+ if (element.hidden) {
60343
+ continue; // no need to process hidden groups
60030
60344
  }
60031
- else {
60032
- o.visuallyHidden = false;
60345
+ const groupOptions = this.getGroupOptions(element);
60346
+ const groupMatchesFilter = this.filterMatchesText(element.labelContent);
60347
+ groupOptions.forEach(option => {
60348
+ option.visuallyHidden = groupMatchesFilter
60349
+ ? false
60350
+ : this.isOptionHiddenOrFilteredOut(option);
60351
+ if (!option.visuallyHidden) {
60352
+ filteredOptions.push(option);
60353
+ }
60354
+ });
60355
+ }
60356
+ else if (isListOption(element)) {
60357
+ element.visuallyHidden = this.isOptionHiddenOrFilteredOut(element);
60358
+ if (!element.visuallyHidden) {
60359
+ filteredOptions.push(element);
60033
60360
  }
60034
60361
  }
60362
+ }
60363
+ this.filteredOptions = filteredOptions;
60364
+ }
60365
+ getGroupOptions(group) {
60366
+ return Array.from(group.children)
60367
+ .filter(el => isListOption(el))
60368
+ .map(el => {
60369
+ if (group.hidden && isListOption(el)) {
60370
+ el.visuallyHidden = true;
60371
+ }
60372
+ return el;
60035
60373
  });
60036
60374
  }
60037
60375
  /**
@@ -70736,7 +71074,7 @@ img.ProseMirror-separator {
70736
71074
 
70737
71075
  const styles$6 = css `
70738
71076
  ${display('inline-flex')}
70739
- ${styles$H}
71077
+ ${styles$I}
70740
71078
 
70741
71079
  :host {
70742
71080
  font: ${bodyFont};
@@ -71082,7 +71420,7 @@ img.ProseMirror-separator {
71082
71420
 
71083
71421
  const styles$5 = css `
71084
71422
  ${display('inline-block')}
71085
- ${styles$H}
71423
+ ${styles$I}
71086
71424
 
71087
71425
  :host {
71088
71426
  font: ${bodyFont};