@ni/nimble-components 7.4.2 → 7.6.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.
@@ -14932,6 +14932,7 @@
14932
14932
  this.propertiesToWatch = ['hidden', 'location', 'state'];
14933
14933
  this.animationDurationMilliseconds = animationDurationWhenDisabledMilliseconds;
14934
14934
  }
14935
+ /** @internal */
14935
14936
  connectedCallback() {
14936
14937
  // disable trapFocus before super.connectedCallback as FAST Dialog will immediately queue work to
14937
14938
  // change focus if it's true before connectedCallback
@@ -14949,6 +14950,7 @@
14949
14950
  this.propertyChangeSubscriber = subscriber;
14950
14951
  this.propertyChangeNotifier = notifier;
14951
14952
  }
14953
+ /** @internal */
14952
14954
  disconnectedCallback() {
14953
14955
  super.disconnectedCallback();
14954
14956
  this.cancelCurrentAnimation();
@@ -14970,8 +14972,16 @@
14970
14972
  // Not calling super.hide() as that will immediately hide the drawer, whereas 'Closing' state will animate
14971
14973
  this.state = DrawerState.Closing;
14972
14974
  }
14975
+ /**
14976
+ * Handler for overlay clicks (user-initiated dismiss requests) only.
14977
+ * @internal
14978
+ */
14973
14979
  dismiss() {
14974
- if (!this.preventDismiss) {
14980
+ const shouldDismiss = this.$emit('cancel', {},
14981
+ // Aligned with the configuration of HTMLDialogElement cancel event:
14982
+ // https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/cancel_event
14983
+ { bubbles: false, cancelable: true, composed: false });
14984
+ if (shouldDismiss && !this.preventDismiss) {
14975
14985
  super.dismiss();
14976
14986
  this.hide();
14977
14987
  }
@@ -17644,13 +17654,15 @@
17644
17654
  })(TextAreaAppearance || (TextAreaAppearance = {}));
17645
17655
 
17646
17656
  const styles$4 = css `
17647
- ${display('inline-block')}
17657
+ ${display('inline-flex')}
17648
17658
 
17649
17659
  :host {
17650
17660
  font: ${bodyFont};
17651
17661
  outline: none;
17652
17662
  user-select: none;
17653
17663
  color: ${bodyFontColor};
17664
+ flex-direction: column;
17665
+ vertical-align: top;
17654
17666
  }
17655
17667
 
17656
17668
  :host([disabled]) {
@@ -17658,7 +17670,7 @@
17658
17670
  }
17659
17671
 
17660
17672
  .label {
17661
- display: flex;
17673
+ display: block;
17662
17674
  color: ${controlLabelFontColor};
17663
17675
  font: ${controlLabelFont};
17664
17676
  }
@@ -17670,6 +17682,8 @@
17670
17682
  .control {
17671
17683
  -webkit-appearance: none;
17672
17684
  font: inherit;
17685
+ width: 100%;
17686
+ flex-grow: 1;
17673
17687
  outline: none;
17674
17688
  box-sizing: border-box;
17675
17689
  position: relative;
@@ -17719,6 +17733,14 @@
17719
17733
  color: ${controlLabelDisabledFontColor};
17720
17734
  }
17721
17735
 
17736
+ :host([cols]) .control {
17737
+ width: auto;
17738
+ }
17739
+
17740
+ :host([rows]) .control {
17741
+ flex: none;
17742
+ }
17743
+
17722
17744
  :host([resize='both']) .control {
17723
17745
  resize: both;
17724
17746
  }
@@ -17919,25 +17941,29 @@
17919
17941
  }
17920
17942
 
17921
17943
  [part='end'] {
17944
+ display: contents;
17945
+ }
17946
+
17947
+ .error-content {
17922
17948
  display: none;
17923
17949
  }
17924
17950
 
17925
- :host(.invalid) [part='end'] {
17951
+ :host(.invalid) .error-content {
17926
17952
  display: contents;
17927
17953
  }
17928
17954
 
17929
- :host(.invalid) [part='end'] svg {
17955
+ :host(.invalid) .error-content svg {
17930
17956
  height: ${iconSize};
17931
17957
  width: ${iconSize};
17932
17958
  padding-right: 8px;
17933
17959
  flex: none;
17934
17960
  }
17935
17961
 
17936
- :host(.invalid) [part='end'] path {
17962
+ :host(.invalid) .error-content path {
17937
17963
  fill: ${failColor};
17938
17964
  }
17939
17965
 
17940
- :host([disabled]) [part='end'] path {
17966
+ :host([disabled]) .error-content path {
17941
17967
  fill: ${bodyDisabledFontColor};
17942
17968
  }
17943
17969
 
@@ -17968,6 +17994,15 @@
17968
17994
  :host([disabled]) .errortext {
17969
17995
  color: ${bodyDisabledFontColor};
17970
17996
  }
17997
+
17998
+ [part='actions'] {
17999
+ display: contents;
18000
+ }
18001
+
18002
+ slot[name='actions']::slotted(*) {
18003
+ margin-right: 8px;
18004
+ ${controlHeight.cssCustomProperty}: 24px;
18005
+ }
17971
18006
  `.withBehaviors(appearanceBehavior(TextFieldAppearance.Underline, css `
17972
18007
  .root {
17973
18008
  --ni-private-bottom-border-width: 1px;
@@ -18074,10 +18109,13 @@
18074
18109
  delegatesFocus: true
18075
18110
  },
18076
18111
  end: html `
18077
- ${exclamationMark16X16.data}
18112
+ <span class="error-content">${exclamationMark16X16.data}</span>
18113
+ <span part="actions">
18114
+ <slot name="actions"></slot>
18115
+ </span>
18078
18116
  <div
18079
18117
  id="errortext"
18080
- class="errortext"
18118
+ class="errortext error-content"
18081
18119
  title="${x => x.errorText}"
18082
18120
  aria-live="polite"
18083
18121
  >