@ni/nimble-components 7.5.0 → 7.8.0

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.
@@ -13675,22 +13675,44 @@
13675
13675
  color: ${bodyDisabledFontColor};
13676
13676
  }
13677
13677
 
13678
+ slot[name='checked-indicator'],
13679
+ slot[name='indeterminate-indicator'] {
13680
+ display: none;
13681
+ }
13682
+
13678
13683
  slot[name='checked-indicator'] svg {
13679
13684
  height: ${iconSize};
13680
13685
  width: ${iconSize};
13681
13686
  overflow: visible;
13682
13687
  }
13683
13688
 
13689
+ :host(.checked:not(.indeterminate)) slot[name='checked-indicator'] {
13690
+ display: contents;
13691
+ }
13692
+
13684
13693
  slot[name='checked-indicator'] path {
13685
13694
  fill: ${borderColor};
13686
- opacity: 0;
13687
13695
  }
13688
13696
 
13689
- :host([aria-checked='true']) slot[name='checked-indicator'] path {
13690
- opacity: 1;
13697
+ :host([disabled]) slot[name='checked-indicator'] path {
13698
+ fill: rgba(${borderRgbPartialColor}, 0.3);
13691
13699
  }
13692
13700
 
13693
- :host([disabled]) slot[name='checked-indicator'] path {
13701
+ slot[name='indeterminate-indicator'] svg {
13702
+ height: ${iconSize};
13703
+ width: ${iconSize};
13704
+ overflow: visible;
13705
+ }
13706
+
13707
+ :host(.indeterminate) slot[name='indeterminate-indicator'] {
13708
+ display: contents;
13709
+ }
13710
+
13711
+ slot[name='indeterminate-indicator'] path {
13712
+ fill: ${borderColor};
13713
+ }
13714
+
13715
+ :host([disabled]) slot[name='indeterminate-indicator'] path {
13694
13716
  fill: rgba(${borderRgbPartialColor}, 0.3);
13695
13717
  }
13696
13718
  `;
@@ -13705,7 +13727,8 @@
13705
13727
  baseClass: Checkbox$1,
13706
13728
  template: checkboxTemplate,
13707
13729
  styles: styles$h,
13708
- checkedIndicator: check16X16.data
13730
+ checkedIndicator: check16X16.data,
13731
+ indeterminateIndicator: minus16X16.data
13709
13732
  });
13710
13733
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleCheckbox());
13711
13734
 
@@ -14932,6 +14955,7 @@
14932
14955
  this.propertiesToWatch = ['hidden', 'location', 'state'];
14933
14956
  this.animationDurationMilliseconds = animationDurationWhenDisabledMilliseconds;
14934
14957
  }
14958
+ /** @internal */
14935
14959
  connectedCallback() {
14936
14960
  // disable trapFocus before super.connectedCallback as FAST Dialog will immediately queue work to
14937
14961
  // change focus if it's true before connectedCallback
@@ -14949,6 +14973,7 @@
14949
14973
  this.propertyChangeSubscriber = subscriber;
14950
14974
  this.propertyChangeNotifier = notifier;
14951
14975
  }
14976
+ /** @internal */
14952
14977
  disconnectedCallback() {
14953
14978
  super.disconnectedCallback();
14954
14979
  this.cancelCurrentAnimation();
@@ -14970,8 +14995,16 @@
14970
14995
  // Not calling super.hide() as that will immediately hide the drawer, whereas 'Closing' state will animate
14971
14996
  this.state = DrawerState.Closing;
14972
14997
  }
14998
+ /**
14999
+ * Handler for overlay clicks (user-initiated dismiss requests) only.
15000
+ * @internal
15001
+ */
14973
15002
  dismiss() {
14974
- if (!this.preventDismiss) {
15003
+ const shouldDismiss = this.$emit('cancel', {},
15004
+ // Aligned with the configuration of HTMLDialogElement cancel event:
15005
+ // https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/cancel_event
15006
+ { bubbles: false, cancelable: true, composed: false });
15007
+ if (shouldDismiss && !this.preventDismiss) {
14975
15008
  super.dismiss();
14976
15009
  this.hide();
14977
15010
  }
@@ -18212,6 +18245,7 @@
18212
18245
  (function (TreeViewSelectionMode) {
18213
18246
  TreeViewSelectionMode["All"] = "all";
18214
18247
  TreeViewSelectionMode["LeavesOnly"] = "leaves-only";
18248
+ TreeViewSelectionMode["None"] = "none";
18215
18249
  })(TreeViewSelectionMode || (TreeViewSelectionMode = {}));
18216
18250
 
18217
18251
  /* eslint-disable */
@@ -18510,8 +18544,9 @@
18510
18544
  return;
18511
18545
  }
18512
18546
  const leavesOnly = this.treeView?.selectionMode === TreeViewSelectionMode.LeavesOnly;
18547
+ const all = this.treeView?.selectionMode === TreeViewSelectionMode.All;
18513
18548
  const hasChildren = this.hasChildTreeItems();
18514
- if ((leavesOnly && !hasChildren) || !leavesOnly) {
18549
+ if ((leavesOnly && !hasChildren) || all) {
18515
18550
  const selectedTreeItem = this.getImmediateTreeItem(this.treeView?.currentSelected);
18516
18551
  // deselect currently selected item if different than this instance
18517
18552
  if (selectedTreeItem && this !== this.treeView?.currentSelected) {
@@ -18520,7 +18555,7 @@
18520
18555
  this.selected = true;
18521
18556
  }
18522
18557
  else {
18523
- // implicit hasChildren && leavesOnly, so only allow expand/collapse, not select
18558
+ // implicit (hasChildren && leavesOnly) || none, so only allow expand/collapse, not select
18524
18559
  this.expanded = !this.expanded;
18525
18560
  }
18526
18561
  // don't allow base class to process click event