@ni/nimble-components 34.8.2 → 34.8.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.
Files changed (76) hide show
  1. package/dist/all-components-bundle.js +92 -47
  2. package/dist/all-components-bundle.js.map +1 -1
  3. package/dist/all-components-bundle.min.js +2395 -2388
  4. package/dist/all-components-bundle.min.js.map +1 -1
  5. package/dist/esm/anchor/types.js.map +1 -1
  6. package/dist/esm/banner/index.js.map +1 -1
  7. package/dist/esm/banner/types.js.map +1 -1
  8. package/dist/esm/breadcrumb/breadcrumb.foundation.spec.js.map +1 -1
  9. package/dist/esm/breadcrumb/types.js.map +1 -1
  10. package/dist/esm/chip/index.js.map +1 -1
  11. package/dist/esm/chip/types.js.map +1 -1
  12. package/dist/esm/combobox/models/combobox-form-associated.js.map +1 -1
  13. package/dist/esm/dialog/index.js +0 -1
  14. package/dist/esm/dialog/index.js.map +1 -1
  15. package/dist/esm/drawer/index.js +0 -1
  16. package/dist/esm/drawer/index.js.map +1 -1
  17. package/dist/esm/drawer/types.js.map +1 -1
  18. package/dist/esm/mapping/icon/index.js +1 -1
  19. package/dist/esm/mapping/icon/index.js.map +1 -1
  20. package/dist/esm/menu-button/types.js.map +1 -1
  21. package/dist/esm/number-field/types.js.map +1 -1
  22. package/dist/esm/patterns/button/types.js.map +1 -1
  23. package/dist/esm/patterns/dropdown/types.js.map +1 -1
  24. package/dist/esm/rich-text/editor/index.js.map +1 -1
  25. package/dist/esm/rich-text/editor/testing/types.js.map +1 -1
  26. package/dist/esm/rich-text/editor/types.js.map +1 -1
  27. package/dist/esm/rich-text-mention/base/models/mention-validator.js +2 -2
  28. package/dist/esm/rich-text-mention/base/models/mention-validator.js.map +1 -1
  29. package/dist/esm/select/models/select-form-associated.js.map +1 -1
  30. package/dist/esm/spinner/types.js.map +1 -1
  31. package/dist/esm/table/components/row/index.js.map +1 -1
  32. package/dist/esm/table/index.js.map +1 -1
  33. package/dist/esm/table/models/expansion-manager.js +1 -1
  34. package/dist/esm/table/models/expansion-manager.js.map +1 -1
  35. package/dist/esm/table/types.js.map +1 -1
  36. package/dist/esm/table-column/base/cell-view/template.js +1 -1
  37. package/dist/esm/table-column/base/cell-view/template.js.map +1 -1
  38. package/dist/esm/table-column/base/group-header-view/template.js +1 -1
  39. package/dist/esm/table-column/base/group-header-view/template.js.map +1 -1
  40. package/dist/esm/table-column/base/types.js.map +1 -1
  41. package/dist/esm/table-column/date-text/index.js +1 -1
  42. package/dist/esm/table-column/date-text/index.js.map +1 -1
  43. package/dist/esm/table-column/date-text/models/format-helper.js +1 -1
  44. package/dist/esm/table-column/date-text/models/format-helper.js.map +1 -1
  45. package/dist/esm/table-column/date-text/types.js.map +1 -1
  46. package/dist/esm/table-column/enum-base/index.js.map +1 -1
  47. package/dist/esm/table-column/enum-base/types.js.map +1 -1
  48. package/dist/esm/table-column/mapping/types.js.map +1 -1
  49. package/dist/esm/table-column/mixins/custom-sort-order.js +1 -3
  50. package/dist/esm/table-column/mixins/custom-sort-order.js.map +1 -1
  51. package/dist/esm/table-column/mixins/fractional-width-column.js +2 -6
  52. package/dist/esm/table-column/mixins/fractional-width-column.js.map +1 -1
  53. package/dist/esm/table-column/mixins/groupable-column.js +2 -6
  54. package/dist/esm/table-column/mixins/groupable-column.js.map +1 -1
  55. package/dist/esm/table-column/mixins/placeholder.js +1 -3
  56. package/dist/esm/table-column/mixins/placeholder.js.map +1 -1
  57. package/dist/esm/table-column/mixins/sortable-column.js +3 -9
  58. package/dist/esm/table-column/mixins/sortable-column.js.map +1 -1
  59. package/dist/esm/table-column/number-text/models/number-text-unit-format.js.map +1 -1
  60. package/dist/esm/table-column/number-text/types.js.map +1 -1
  61. package/dist/esm/table-column/text/index.js.map +1 -1
  62. package/dist/esm/table-column/text-base/cell-view/index.js.map +1 -1
  63. package/dist/esm/table-column/text-base/group-header-view/index.js.map +1 -1
  64. package/dist/esm/table-column/text-base/index.js +1 -1
  65. package/dist/esm/table-column/text-base/index.js.map +1 -1
  66. package/dist/esm/text-area/types.js.map +1 -1
  67. package/dist/esm/text-field/types.js.map +1 -1
  68. package/dist/esm/theme-provider/design-token-values.js.map +1 -1
  69. package/dist/esm/theme-provider/design-tokens.js.map +1 -1
  70. package/dist/esm/theme-provider/index.js +1 -1
  71. package/dist/esm/theme-provider/index.js.map +1 -1
  72. package/dist/esm/tooltip/types.js.map +1 -1
  73. package/dist/esm/tree-view/types.js.map +1 -1
  74. package/dist/esm/utilities/unit-format/default-unit-format.js.map +1 -1
  75. package/dist/esm/wafer-map/types.js.map +1 -1
  76. package/package.json +5 -11
@@ -14992,7 +14992,7 @@
14992
14992
  new Intl.Locale(value);
14993
14993
  return true;
14994
14994
  }
14995
- catch (e) {
14995
+ catch (_e) {
14996
14996
  return false;
14997
14997
  }
14998
14998
  }
@@ -22273,7 +22273,6 @@ so this becomes the fallback color for the slot */ ''}
22273
22273
  /**
22274
22274
  * A nimble-styled dialog.
22275
22275
  */
22276
- // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
22277
22276
  class Dialog extends FoundationElement {
22278
22277
  constructor() {
22279
22278
  super(...arguments);
@@ -22558,7 +22557,6 @@ so this becomes the fallback color for the slot */ ''}
22558
22557
  * Drawer control. Shows content in a panel on the left / right side of the screen,
22559
22558
  * which animates to be visible with a slide-in / slide-out animation.
22560
22559
  */
22561
- // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
22562
22560
  class Drawer extends FoundationElement {
22563
22561
  constructor() {
22564
22562
  super(...arguments);
@@ -26145,7 +26143,7 @@ so this becomes the fallback color for the slot */ ''}
26145
26143
  this.resolvedIcon = undefined;
26146
26144
  await customElements.whenDefined(icon);
26147
26145
  }
26148
- catch (ex) {
26146
+ catch (_ex) {
26149
26147
  // If any error (i.e. invalid custom element name) don't continue
26150
26148
  // Don't update the resolvedIcon as it was already set to undefined before async resolution
26151
26149
  // (in case other async resolutions were started)
@@ -35563,17 +35561,20 @@ so this becomes the fallback color for the slot */ ''}
35563
35561
  }
35564
35562
  function findOffsetInText(node, coords) {
35565
35563
  let len = node.nodeValue.length;
35566
- let range = document.createRange();
35564
+ let range = document.createRange(), result;
35567
35565
  for (let i = 0; i < len; i++) {
35568
35566
  range.setEnd(node, i + 1);
35569
35567
  range.setStart(node, i);
35570
35568
  let rect = singleRect(range, 1);
35571
35569
  if (rect.top == rect.bottom)
35572
35570
  continue;
35573
- if (inRect(coords, rect))
35574
- return { node, offset: i + (coords.left >= (rect.left + rect.right) / 2 ? 1 : 0) };
35571
+ if (inRect(coords, rect)) {
35572
+ result = { node, offset: i + (coords.left >= (rect.left + rect.right) / 2 ? 1 : 0) };
35573
+ break;
35574
+ }
35575
35575
  }
35576
- return { node, offset: 0 };
35576
+ range.detach();
35577
+ return result || { node, offset: 0 };
35577
35578
  }
35578
35579
  function inRect(coords, rect) {
35579
35580
  return coords.left >= rect.left - 1 && coords.left <= rect.right + 1 &&
@@ -38666,7 +38667,8 @@ so this becomes the fallback color for the slot */ ''}
38666
38667
  let { state } = view, $pos = state.selection.$to;
38667
38668
  if (state.selection instanceof TextSelection &&
38668
38669
  (state.storedMarks ||
38669
- (!$pos.textOffset && $pos.parentOffset && $pos.nodeBefore.marks.some(m => m.type.spec.inclusive === false)))) {
38670
+ (!$pos.textOffset && $pos.parentOffset && $pos.nodeBefore.marks.some(m => m.type.spec.inclusive === false)) ||
38671
+ chrome && windows$1 && selectionBeforeUneditable(view))) { // Issue #1500
38670
38672
  // Need to wrap the cursor in mark nodes different from the ones in the DOM context
38671
38673
  view.markCursor = view.state.storedMarks || $pos.marks();
38672
38674
  endComposition(view, true);
@@ -38700,6 +38702,13 @@ so this becomes the fallback color for the slot */ ''}
38700
38702
  }
38701
38703
  scheduleComposeEnd(view, timeoutComposition);
38702
38704
  };
38705
+ function selectionBeforeUneditable(view) {
38706
+ let { focusNode, focusOffset } = view.domSelectionRange();
38707
+ if (!focusNode || focusNode.nodeType != 1 || focusOffset >= focusNode.childNodes.length)
38708
+ return false;
38709
+ let next = focusNode.childNodes[focusOffset];
38710
+ return next.nodeType == 1 && next.contentEditable == "false";
38711
+ }
38703
38712
  editHandlers.compositionend = (view, event) => {
38704
38713
  if (view.composing) {
38705
38714
  view.input.composing = false;
@@ -38927,10 +38936,15 @@ so this becomes the fallback color for the slot */ ''}
38927
38936
  }, 50);
38928
38937
  };
38929
38938
  editHandlers.dragover = editHandlers.dragenter = (_, e) => e.preventDefault();
38930
- editHandlers.drop = (view, _event) => {
38931
- let event = _event;
38932
- let dragging = view.dragging;
38933
- view.dragging = null;
38939
+ editHandlers.drop = (view, event) => {
38940
+ try {
38941
+ handleDrop(view, event, view.dragging);
38942
+ }
38943
+ finally {
38944
+ view.dragging = null;
38945
+ }
38946
+ };
38947
+ function handleDrop(view, event, dragging) {
38934
38948
  if (!event.dataTransfer)
38935
38949
  return;
38936
38950
  let eventPos = view.posAtCoords(eventCoords(event));
@@ -38984,7 +38998,7 @@ so this becomes the fallback color for the slot */ ''}
38984
38998
  }
38985
38999
  view.focus();
38986
39000
  view.dispatch(tr.setMeta("uiEvent", "drop"));
38987
- };
39001
+ }
38988
39002
  handlers.focus = view => {
38989
39003
  view.input.lastFocus = Date.now();
38990
39004
  if (!view.focused) {
@@ -39910,6 +39924,17 @@ so this becomes the fallback color for the slot */ ''}
39910
39924
  }
39911
39925
  }
39912
39926
  }
39927
+ else if ((chrome || safari) && added.some(n => n.nodeName == "BR") &&
39928
+ (view.input.lastKeyCode == 8 || view.input.lastKeyCode == 46)) {
39929
+ // Chrome/Safari sometimes insert a bogus break node if you
39930
+ // backspace out the last bit of text before an inline-flex node (#1552)
39931
+ for (let node of added)
39932
+ if (node.nodeName == "BR" && node.parentNode) {
39933
+ let after = node.nextSibling;
39934
+ if (after && after.nodeType == 1 && after.contentEditable == "false")
39935
+ node.parentNode.removeChild(node);
39936
+ }
39937
+ }
39913
39938
  let readSel = null;
39914
39939
  // If it looks like the browser has reset the selection to the
39915
39940
  // start of the document after focus, restore the selection from
@@ -43181,6 +43206,37 @@ so this becomes the fallback color for the slot */ ''}
43181
43206
  return value instanceof NodeSelection;
43182
43207
  }
43183
43208
 
43209
+ // src/helpers/MappablePosition.ts
43210
+ var MappablePosition = class _MappablePosition {
43211
+ constructor(position) {
43212
+ this.position = position;
43213
+ }
43214
+ /**
43215
+ * Creates a MappablePosition from a JSON object.
43216
+ */
43217
+ static fromJSON(json) {
43218
+ return new _MappablePosition(json.position);
43219
+ }
43220
+ /**
43221
+ * Converts the MappablePosition to a JSON object.
43222
+ */
43223
+ toJSON() {
43224
+ return {
43225
+ position: this.position
43226
+ };
43227
+ }
43228
+ };
43229
+ function getUpdatedPosition(position, transaction) {
43230
+ const mapResult = transaction.mapping.mapResult(position.position);
43231
+ return {
43232
+ position: new MappablePosition(mapResult.pos),
43233
+ mapResult
43234
+ };
43235
+ }
43236
+ function createMappablePosition(position) {
43237
+ return new MappablePosition(position);
43238
+ }
43239
+
43184
43240
  // src/commands/setMark.ts
43185
43241
  function canSetMark(state, tr, newMarkType) {
43186
43242
  var _a;
@@ -45369,6 +45425,13 @@ img.ProseMirror-separator {
45369
45425
  };
45370
45426
  this.isCapturingTransaction = false;
45371
45427
  this.capturedTransaction = null;
45428
+ /**
45429
+ * Returns a set of utilities for working with positions and ranges.
45430
+ */
45431
+ this.utils = {
45432
+ getUpdatedPosition,
45433
+ createMappablePosition
45434
+ };
45372
45435
  this.setOptions(options);
45373
45436
  this.createExtensionManager();
45374
45437
  this.createCommandManager();
@@ -68777,7 +68840,7 @@ ${nextLine.slice(indentLevel + 2)}`;
68777
68840
  try {
68778
68841
  instance = document.createElement(groupHeaderViewTag);
68779
68842
  }
68780
- catch (ex) {
68843
+ catch (_ex) {
68781
68844
  // Swallow construction error to report a better one
68782
68845
  }
68783
68846
  if (!(instance instanceof TableGroupHeaderView)) {
@@ -68863,7 +68926,7 @@ ${nextLine.slice(indentLevel + 2)}`;
68863
68926
  try {
68864
68927
  instance = document.createElement(cellViewTag);
68865
68928
  }
68866
- catch (ex) {
68929
+ catch (_ex) {
68867
68930
  // Swallow construction error to report a better one
68868
68931
  }
68869
68932
  if (!(instance instanceof TableCellView)) {
@@ -72673,7 +72736,7 @@ focus outline in that case.
72673
72736
  return false;
72674
72737
  }
72675
72738
  return (this.hierarchyOptions.get(id)?.delayedHierarchyState
72676
- === TableRecordDelayedHierarchyState.loadingChildren ?? false);
72739
+ === TableRecordDelayedHierarchyState.loadingChildren);
72677
72740
  }
72678
72741
  canLoadDelayedChildren(id) {
72679
72742
  if (!this.isHierarchyEnabled) {
@@ -74706,12 +74769,8 @@ focus outline in that case.
74706
74769
  this.columnInternals.minPixelWidth = this.minPixelWidth ?? defaultMinPixelWidth;
74707
74770
  }
74708
74771
  }
74709
- attr({ attribute: 'fractional-width', converter: nullableNumberConverter })(
74710
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
74711
- FractionalWidthColumn.prototype, 'fractionalWidth');
74712
- attr({ attribute: 'min-pixel-width', converter: nullableNumberConverter })(
74713
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
74714
- FractionalWidthColumn.prototype, 'minPixelWidth');
74772
+ attr({ attribute: 'fractional-width', converter: nullableNumberConverter })(FractionalWidthColumn.prototype, 'fractionalWidth');
74773
+ attr({ attribute: 'min-pixel-width', converter: nullableNumberConverter })(FractionalWidthColumn.prototype, 'minPixelWidth');
74715
74774
  return FractionalWidthColumn;
74716
74775
  }
74717
74776
 
@@ -74734,12 +74793,8 @@ focus outline in that case.
74734
74793
  this.columnInternals.groupIndex = this.groupIndex ?? undefined;
74735
74794
  }
74736
74795
  }
74737
- attr({ attribute: 'grouping-disabled', mode: 'boolean' })(
74738
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
74739
- GroupableColumn.prototype, 'groupingDisabled');
74740
- attr({ attribute: 'group-index', converter: nullableNumberConverter })(
74741
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
74742
- GroupableColumn.prototype, 'groupIndex');
74796
+ attr({ attribute: 'grouping-disabled', mode: 'boolean' })(GroupableColumn.prototype, 'groupingDisabled');
74797
+ attr({ attribute: 'group-index', converter: nullableNumberConverter })(GroupableColumn.prototype, 'groupIndex');
74743
74798
  return GroupableColumn;
74744
74799
  }
74745
74800
 
@@ -74752,9 +74807,7 @@ focus outline in that case.
74752
74807
  */
74753
74808
  class ColumnWithPlaceholder extends base {
74754
74809
  }
74755
- attr({ attribute: 'placeholder' })(
74756
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
74757
- ColumnWithPlaceholder.prototype, 'placeholder');
74810
+ attr({ attribute: 'placeholder' })(ColumnWithPlaceholder.prototype, 'placeholder');
74758
74811
  return ColumnWithPlaceholder;
74759
74812
  }
74760
74813
 
@@ -75038,15 +75091,9 @@ focus outline in that case.
75038
75091
  }
75039
75092
  }
75040
75093
  }
75041
- attr({ attribute: 'sorting-disabled', mode: 'boolean' })(
75042
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
75043
- SortableColumn.prototype, 'sortingDisabled');
75044
- attr({ attribute: 'sort-index', converter: nullableNumberConverter })(
75045
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
75046
- SortableColumn.prototype, 'sortIndex');
75047
- attr({ attribute: 'sort-direction' })(
75048
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
75049
- SortableColumn.prototype, 'sortDirection');
75094
+ attr({ attribute: 'sorting-disabled', mode: 'boolean' })(SortableColumn.prototype, 'sortingDisabled');
75095
+ attr({ attribute: 'sort-index', converter: nullableNumberConverter })(SortableColumn.prototype, 'sortIndex');
75096
+ attr({ attribute: 'sort-direction' })(SortableColumn.prototype, 'sortDirection');
75050
75097
  return SortableColumn;
75051
75098
  }
75052
75099
 
@@ -75108,9 +75155,7 @@ focus outline in that case.
75108
75155
  }
75109
75156
  }
75110
75157
  }
75111
- attr({ attribute: 'sort-by-field-name' })(
75112
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
75113
- CustomSortOrderColumn.prototype, 'sortByFieldName');
75158
+ attr({ attribute: 'sort-by-field-name' })(CustomSortOrderColumn.prototype, 'sortByFieldName');
75114
75159
  return CustomSortOrderColumn;
75115
75160
  }
75116
75161
 
@@ -75264,7 +75309,7 @@ focus outline in that case.
75264
75309
  __decorate([
75265
75310
  attr({ attribute: 'field-name' })
75266
75311
  ], TableColumnTextBase.prototype, "fieldName", void 0);
75267
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type, @typescript-eslint/no-explicit-any
75312
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type
75268
75313
  function mixinTextBase(base) {
75269
75314
  return mixinGroupableColumnAPI(mixinFractionalWidthColumnAPI(mixinColumnWithPlaceholderAPI(mixinSortableColumnAPI(base))));
75270
75315
  }
@@ -75274,7 +75319,7 @@ focus outline in that case.
75274
75319
  try {
75275
75320
  return formatter.format(date);
75276
75321
  }
75277
- catch (e) {
75322
+ catch (_e) {
75278
75323
  return '';
75279
75324
  }
75280
75325
  }
@@ -75589,7 +75634,7 @@ focus outline in that case.
75589
75634
  try {
75590
75635
  return new Intl.DateTimeFormat(lang.getValueFor(this), options);
75591
75636
  }
75592
- catch (e) {
75637
+ catch (_e) {
75593
75638
  return undefined;
75594
75639
  }
75595
75640
  }