@deephaven/iris-grid 0.8.2-beta.6 → 0.9.1-beta.5

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 (125) hide show
  1. package/dist/AdvancedFilterCreator.d.ts +2 -2
  2. package/dist/AdvancedFilterCreator.d.ts.map +1 -1
  3. package/dist/AdvancedFilterCreatorFilterItem.d.ts +30 -31
  4. package/dist/AdvancedFilterCreatorFilterItem.d.ts.map +1 -1
  5. package/dist/AdvancedFilterCreatorFilterItem.js +21 -28
  6. package/dist/AdvancedFilterCreatorFilterItem.js.map +1 -1
  7. package/dist/AdvancedFilterCreatorSelectValueList.d.ts +1 -1
  8. package/dist/CrossColumnSearch.d.ts +1 -1
  9. package/dist/CrossColumnSearch.d.ts.map +1 -1
  10. package/dist/DateUtils.d.ts +46 -44
  11. package/dist/DateUtils.d.ts.map +1 -1
  12. package/dist/DateUtils.js +37 -32
  13. package/dist/DateUtils.js.map +1 -1
  14. package/dist/Formatter.d.ts +37 -35
  15. package/dist/Formatter.d.ts.map +1 -1
  16. package/dist/Formatter.js +57 -37
  17. package/dist/Formatter.js.map +1 -1
  18. package/dist/FormatterUtils.d.ts +12 -8
  19. package/dist/FormatterUtils.d.ts.map +1 -1
  20. package/dist/FormatterUtils.js.map +1 -1
  21. package/dist/IrisGrid.d.ts +15 -12
  22. package/dist/IrisGrid.d.ts.map +1 -1
  23. package/dist/IrisGrid.js +24 -13
  24. package/dist/IrisGrid.js.map +1 -1
  25. package/dist/IrisGridMetricCalculator.d.ts +16 -2
  26. package/dist/IrisGridMetricCalculator.d.ts.map +1 -1
  27. package/dist/IrisGridMetricCalculator.js +4 -3
  28. package/dist/IrisGridMetricCalculator.js.map +1 -1
  29. package/dist/IrisGridModel.d.ts +23 -23
  30. package/dist/IrisGridModel.d.ts.map +1 -1
  31. package/dist/IrisGridModelFactory.d.ts +1 -1
  32. package/dist/IrisGridModelFactory.d.ts.map +1 -1
  33. package/dist/IrisGridProxyModel.d.ts +2 -2
  34. package/dist/IrisGridProxyModel.d.ts.map +1 -1
  35. package/dist/IrisGridTableModel.d.ts +5 -5
  36. package/dist/IrisGridTableModel.d.ts.map +1 -1
  37. package/dist/IrisGridTestUtils.d.ts +1 -1
  38. package/dist/IrisGridTestUtils.d.ts.map +1 -1
  39. package/dist/IrisGridTheme.d.ts +5 -75
  40. package/dist/IrisGridTheme.d.ts.map +1 -1
  41. package/dist/IrisGridTheme.js +2 -1
  42. package/dist/IrisGridTheme.js.map +1 -1
  43. package/dist/IrisGridUtils.d.ts +28 -28
  44. package/dist/IrisGridUtils.d.ts.map +1 -1
  45. package/dist/TableUtils.d.ts +127 -114
  46. package/dist/TableUtils.d.ts.map +1 -1
  47. package/dist/TableUtils.js +76 -69
  48. package/dist/TableUtils.js.map +1 -1
  49. package/dist/declaration.d.js +2 -0
  50. package/dist/declaration.d.js.map +1 -0
  51. package/dist/filters/FilterOperator.d.ts +5 -5
  52. package/dist/filters/FilterOperator.d.ts.map +1 -1
  53. package/dist/filters/FilterOperator.js +1 -3
  54. package/dist/filters/FilterOperator.js.map +1 -1
  55. package/dist/filters/FilterType.d.ts +23 -23
  56. package/dist/filters/FilterType.d.ts.map +1 -1
  57. package/dist/filters/FilterType.js +1 -3
  58. package/dist/filters/FilterType.js.map +1 -1
  59. package/dist/filters/index.d.ts +2 -2
  60. package/dist/filters/index.d.ts.map +1 -1
  61. package/dist/filters/index.js +2 -2
  62. package/dist/filters/index.js.map +1 -1
  63. package/dist/format-context-menus/CustomFormatAction.d.ts +27 -39
  64. package/dist/format-context-menus/CustomFormatAction.d.ts.map +1 -1
  65. package/dist/format-context-menus/CustomFormatAction.js +24 -23
  66. package/dist/format-context-menus/CustomFormatAction.js.map +1 -1
  67. package/dist/format-context-menus/DateTimeFormatContextMenu.d.ts +8 -5
  68. package/dist/format-context-menus/DateTimeFormatContextMenu.d.ts.map +1 -1
  69. package/dist/format-context-menus/DateTimeFormatContextMenu.js +3 -3
  70. package/dist/format-context-menus/DateTimeFormatContextMenu.js.map +1 -1
  71. package/dist/format-context-menus/DecimalFormatContextMenu.d.ts +7 -5
  72. package/dist/format-context-menus/DecimalFormatContextMenu.d.ts.map +1 -1
  73. package/dist/format-context-menus/DecimalFormatContextMenu.js +3 -3
  74. package/dist/format-context-menus/DecimalFormatContextMenu.js.map +1 -1
  75. package/dist/format-context-menus/FormatContextMenuUtils.d.ts +28 -27
  76. package/dist/format-context-menus/FormatContextMenuUtils.d.ts.map +1 -1
  77. package/dist/format-context-menus/FormatContextMenuUtils.js +12 -10
  78. package/dist/format-context-menus/FormatContextMenuUtils.js.map +1 -1
  79. package/dist/format-context-menus/IntegerFormatContextMenu.d.ts +7 -5
  80. package/dist/format-context-menus/IntegerFormatContextMenu.d.ts.map +1 -1
  81. package/dist/format-context-menus/IntegerFormatContextMenu.js +3 -3
  82. package/dist/format-context-menus/IntegerFormatContextMenu.js.map +1 -1
  83. package/dist/format-context-menus/index.d.ts +3 -3
  84. package/dist/format-context-menus/index.d.ts.map +1 -1
  85. package/dist/format-context-menus/index.js.map +1 -1
  86. package/dist/formatters/BooleanColumnFormatter.d.ts +4 -4
  87. package/dist/formatters/BooleanColumnFormatter.d.ts.map +1 -1
  88. package/dist/formatters/BooleanColumnFormatter.js.map +1 -1
  89. package/dist/formatters/CharColumnFormatter.d.ts +4 -4
  90. package/dist/formatters/CharColumnFormatter.d.ts.map +1 -1
  91. package/dist/formatters/CharColumnFormatter.js.map +1 -1
  92. package/dist/formatters/DateTimeColumnFormatter.d.ts +6 -5
  93. package/dist/formatters/DateTimeColumnFormatter.d.ts.map +1 -1
  94. package/dist/formatters/DateTimeColumnFormatter.js.map +1 -1
  95. package/dist/formatters/DecimalColumnFormatter.d.ts +2 -2
  96. package/dist/formatters/DecimalColumnFormatter.d.ts.map +1 -1
  97. package/dist/formatters/DecimalColumnFormatter.js.map +1 -1
  98. package/dist/formatters/DefaultColumnFormatter.d.ts +4 -4
  99. package/dist/formatters/DefaultColumnFormatter.d.ts.map +1 -1
  100. package/dist/formatters/DefaultColumnFormatter.js.map +1 -1
  101. package/dist/formatters/IntegerColumnFormatter.d.ts +2 -2
  102. package/dist/formatters/IntegerColumnFormatter.d.ts.map +1 -1
  103. package/dist/formatters/IntegerColumnFormatter.js.map +1 -1
  104. package/dist/formatters/index.d.ts +1 -0
  105. package/dist/formatters/index.d.ts.map +1 -1
  106. package/dist/formatters/index.js +1 -0
  107. package/dist/formatters/index.js.map +1 -1
  108. package/dist/index.d.ts +1 -0
  109. package/dist/index.js +1 -0
  110. package/dist/index.js.map +1 -1
  111. package/dist/mousehandlers/IrisGridContextMenuHandler.d.ts +17 -8
  112. package/dist/mousehandlers/IrisGridContextMenuHandler.d.ts.map +1 -1
  113. package/dist/sidebar/ChartBuilder.d.ts +1 -1
  114. package/dist/sidebar/ChartBuilder.d.ts.map +1 -1
  115. package/dist/sidebar/TableCsvExporter.d.ts +1 -1
  116. package/dist/sidebar/TableCsvExporter.d.ts.map +1 -1
  117. package/dist/sidebar/VisibilityOrderingBuilder.d.ts +1 -1
  118. package/dist/sidebar/VisibilityOrderingBuilder.d.ts.map +1 -1
  119. package/dist/sidebar/aggregations/AggregationEdit.d.ts +2 -4
  120. package/dist/sidebar/aggregations/AggregationEdit.d.ts.map +1 -1
  121. package/dist/sidebar/aggregations/AggregationEdit.js.map +1 -1
  122. package/dist/sidebar/aggregations/AggregationUtils.d.ts +1 -4
  123. package/dist/sidebar/aggregations/AggregationUtils.d.ts.map +1 -1
  124. package/dist/sidebar/aggregations/AggregationUtils.js.map +1 -1
  125. package/package.json +12 -13
@@ -6,8 +6,8 @@ import { PromiseUtils, TextUtils, TimeoutError } from '@deephaven/utils';
6
6
  import DateUtils from "./DateUtils.js";
7
7
  import { FilterType, FilterOperator } from "./filters/index.js";
8
8
  var log = Log.module('TableUtils');
9
- /** Utility class to provide some functions for working with tables */
10
9
 
10
+ /** Utility class to provide some functions for working with tables */
11
11
  class TableUtils {
12
12
  // Regex looking for a negative or positive integer or decimal number
13
13
  static getSortIndex(sort, columnIndex) {
@@ -24,9 +24,9 @@ class TableUtils {
24
24
  return null;
25
25
  }
26
26
  /**
27
- * @param {dh.Sort[]} tableSort The sorts from the table to get the sort from
28
- * @param {number} columnIndex The index of the column to get the sort for
29
- * @return {dh.Sort} The sort for the column, or null if it's not sorted
27
+ * @param tableSort The sorts from the table to get the sort from
28
+ * @param columnIndex The index of the column to get the sort for
29
+ * @return The sort for the column, or null if it's not sorted
30
30
  */
31
31
 
32
32
 
@@ -123,10 +123,10 @@ class TableUtils {
123
123
  }
124
124
  /**
125
125
  * Toggles the sort for the specified column
126
- * @param {array} sorts The current sorts from IrisGrid.state
127
- * @param {dh.Table} table The table to apply the sort to
128
- * @param {number} columnIndex The column index to apply the sort to
129
- * @param {boolean} addToExisting Add this sort to the existing sort
126
+ * @param sorts The current sorts from IrisGrid.state
127
+ * @param table The table to apply the sort to
128
+ * @param columnIndex The column index to apply the sort to
129
+ * @param addToExisting Add this sort to the existing sort
130
130
  */
131
131
 
132
132
 
@@ -151,11 +151,11 @@ class TableUtils {
151
151
  }
152
152
  /**
153
153
  * Sets the sort for the given column *and* removes any reverses
154
- * @param {dh.Sort[]} tableSort The current sorts from IrisGrid.state
155
- * @param {number} columnIndex The column index to apply the sort to
156
- * @param {dh.Sort} sort The sort object to add
157
- * @param {boolean} addToExisting Add this sort to the existing sort
158
- * @returns {array} Returns the modified array of sorts - removing reverses
154
+ * @param tableSort The current sorts from IrisGrid.state
155
+ * @param columnIndex The column index to apply the sort to
156
+ * @param sort The sort object to add
157
+ * @param addToExisting Add this sort to the existing sort
158
+ * @returns Returns the modified array of sorts - removing reverses
159
159
  */
160
160
 
161
161
 
@@ -323,8 +323,8 @@ class TableUtils {
323
323
  }
324
324
  /**
325
325
  * Get base column type
326
- * @param {string} columnType Column type
327
- * @returns {string} Element type for array columns, original type for non-array columns
326
+ * @param columnType Column type
327
+ * @returns Element type for array columns, original type for non-array columns
328
328
  */
329
329
 
330
330
 
@@ -333,9 +333,9 @@ class TableUtils {
333
333
  }
334
334
  /**
335
335
  * Check if the column types are compatible
336
- * @param {string} type1 Column type to check
337
- * @param {string} type2 Column type to check
338
- * @returns {boolean} True, if types are compatible
336
+ * @param type1 Column type to check
337
+ * @param type2 Column type to check
338
+ * @returns True, if types are compatible
339
339
  */
340
340
 
341
341
 
@@ -344,10 +344,10 @@ class TableUtils {
344
344
  }
345
345
  /**
346
346
  * Create filter with the provided column and text. Handles multiple filters joined with && or ||
347
- * @param {dh.Column} column The column to set the filter on
348
- * @param {string} text The text string to create the filter from
349
- * @param {string} timeZone The time zone to make this value in if it is a date type. E.g. America/New_York
350
- * @returns {dh.FilterCondition} Returns the created filter, null if text could not be parsed
347
+ * @param column The column to set the filter on
348
+ * @param text The text string to create the filter from
349
+ * @param timeZone The time zone to make this value in if it is a date type. E.g. America/New_York
350
+ * @returns Returns the created filter, null if text could not be parsed
351
351
  */
352
352
 
353
353
 
@@ -378,7 +378,7 @@ class TableUtils {
378
378
  }
379
379
  }
380
380
 
381
- if (orFilter) {
381
+ if (orFilter && andFilter) {
382
382
  orFilter = orFilter.or(andFilter);
383
383
  } else {
384
384
  orFilter = andFilter;
@@ -389,10 +389,10 @@ class TableUtils {
389
389
  }
390
390
  /**
391
391
  * Create filter with the provided column and text of one component (no multiple conditions)
392
- * @param {dh.Column} column The column to set the filter on
393
- * @param {string} text The text string to create the filter from
394
- * @param {string} timeZone The time zone to make this filter in if it is a date type. E.g. America/New_York
395
- * @returns {dh.FilterCondition} Returns the created filter, null if text could not be parsed
392
+ * @param column The column to set the filter on
393
+ * @param text The text string to create the filter from
394
+ * @param timeZone The time zone to make this filter in if it is a date type. E.g. America/New_York
395
+ * @returns Returns the created filter, null if text could not be parsed
396
396
  */
397
397
 
398
398
 
@@ -436,7 +436,7 @@ class TableUtils {
436
436
 
437
437
  var overflow = null;
438
438
 
439
- if (result.length > 3) {
439
+ if (result !== null && result.length > 3) {
440
440
  [, operation, negativeSign, value, abnormalValue, overflow] = result;
441
441
  }
442
442
 
@@ -449,10 +449,6 @@ class TableUtils {
449
449
  operation = '=';
450
450
  }
451
451
 
452
- if (value == null && abnormalValue == null) {
453
- return null;
454
- }
455
-
456
452
  if (abnormalValue != null) {
457
453
  if (!(operation === '=' || operation === '!' || operation === '!=')) {
458
454
  // only equal and not equal operations are supported for abnormal value filter
@@ -485,13 +481,17 @@ class TableUtils {
485
481
  break;
486
482
  }
487
483
 
488
- if (operation === '!' || operation === '!=') {
484
+ if (filter !== null && (operation === '!' || operation === '!=')) {
489
485
  filter = filter.not();
490
486
  }
491
487
 
492
488
  return filter;
493
489
  }
494
490
 
491
+ if (value == null) {
492
+ return null;
493
+ }
494
+
495
495
  value = TableUtils.removeCommas(value);
496
496
 
497
497
  if (TableUtils.isLongType(column.type)) {
@@ -526,7 +526,7 @@ class TableUtils {
526
526
  var operation = null;
527
527
  var value = null;
528
528
 
529
- if (result.length > 2) {
529
+ if (result !== null && result.length > 2) {
530
530
  [, operation, value] = result;
531
531
 
532
532
  if (value != null) {
@@ -621,6 +621,11 @@ class TableUtils {
621
621
 
622
622
  var regex = /^(!=|=|!)?(.*)/;
623
623
  var result = regex.exec("".concat(text).trim());
624
+
625
+ if (result === null) {
626
+ return null;
627
+ }
628
+
624
629
  var [, operation, value] = result;
625
630
  var notEqual = operation === '!' || operation === '!=';
626
631
  var cleanValue = value.trim().toLowerCase();
@@ -644,8 +649,9 @@ class TableUtils {
644
649
  }
645
650
  /**
646
651
  * Builds a date filter parsed from the text string which may or may not include an operator.
647
- * @param {Column} column The column to build the filter from, with or without a leading operator.
648
- * @param {string} text The date string text to parse.
652
+ * @param column The column to build the filter from, with or without a leading operator.
653
+ * @param text The date string text to parse.
654
+ * @param timeZone The time zone to make this filter in if it is a date type. E.g. America/New_York
649
655
  */
650
656
 
651
657
 
@@ -698,10 +704,10 @@ class TableUtils {
698
704
  }
699
705
  /**
700
706
  * Builds a date filter parsed from the text string with the provided filter.
701
- * @param {Column} column The column to build the filter from.
702
- * @param {string} text The date string text to parse, without an operator.
703
- * @param {FilterType} operation The filter operation to use.
704
- * @param {string} timeZone The time zone to make this filter with. E.g. America/New_York
707
+ * @param column The column to build the filter from.
708
+ * @param text The date string text to parse, without an operator.
709
+ * @param operation The filter operation to use.
710
+ * @param timeZone The time zone to make this filter with. E.g. America/New_York
705
711
  */
706
712
 
707
713
 
@@ -718,7 +724,7 @@ class TableUtils {
718
724
  var endValue = endDate != null ? dh.FilterValue.ofNumber(endDate) : null;
719
725
  var filter = column.filter();
720
726
 
721
- if (startValue == null && endValue == null) {
727
+ if (startValue == null) {
722
728
  return operation === FilterType.notEq ? filter.isNull().not() : filter.isNull();
723
729
  }
724
730
 
@@ -790,7 +796,7 @@ class TableUtils {
790
796
  var value = null;
791
797
  var overflow = null;
792
798
 
793
- if (result.length > 3) {
799
+ if (result !== null && result.length > 3) {
794
800
  [, operation, value, overflow] = result;
795
801
  }
796
802
 
@@ -827,10 +833,10 @@ class TableUtils {
827
833
  return TableUtils.makeRangeFilterWithOperation(filter, operation, dh.FilterValue.ofString(value));
828
834
  }
829
835
  /**
830
- * @param {dh.FilterValue} filter The column filter to apply the range operation to
831
- * @param {string} operation The range operation to run
832
- * @param {dh.FilterValue} value The value to use for the operation
833
- * @returns {dh.FilterCondition} The condition with the specified operation
836
+ * @param filter The column filter to apply the range operation to
837
+ * @param operation The range operation to run
838
+ * @param value The value to use for the operation
839
+ * @returns The condition with the specified operation
834
840
  */
835
841
 
836
842
 
@@ -864,7 +870,7 @@ class TableUtils {
864
870
  /**
865
871
  * Wraps a table promise in a cancelable promise that will close the table if the promise is cancelled.
866
872
  * Use in a component that loads a table, and call cancel when unmounting.
867
- * @param {Promise<dh.Table> | dh.Table} table The table promise to wrap
873
+ * @param table The table promise to wrap
868
874
  */
869
875
 
870
876
 
@@ -875,19 +881,19 @@ class TableUtils {
875
881
  }
876
882
  /**
877
883
  * Make a cancelable promise for a one-shot table event with a timeout.
878
- * @param {dh.Table|dh.TreeTable} table Table to listen for events on
879
- * @param {string} eventName Event to listen for
880
- * @param {number} timeout Event timeout in milliseconds, defaults to 0
881
- * @param {function} matcher Optional function to determine if the promise can be resolved or stays pending
882
- * @returns {Promise} Resolves with the event data
884
+ * @param table Table to listen for events on
885
+ * @param eventName Event to listen for
886
+ * @param timeout Event timeout in milliseconds, defaults to 0
887
+ * @param matcher Optional function to determine if the promise can be resolved or stays pending
888
+ * @returns Resolves with the event data
883
889
  */
884
890
 
885
891
 
886
892
  static makeCancelableTableEventPromise(table, eventName) {
887
893
  var timeout = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
888
894
  var matcher = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
889
- var eventCleanup = null;
890
- var timeoutId = null;
895
+ var eventCleanup;
896
+ var timeoutId;
891
897
  var isPending = true;
892
898
  var wrappedPromise = new Promise((resolve, reject) => {
893
899
  timeoutId = setTimeout(() => {
@@ -988,9 +994,9 @@ class TableUtils {
988
994
  return value.replace(/[\s|,]/g, '');
989
995
  }
990
996
  /**
991
- * @param {String} columnType The column type to make the filter value from.
992
- * @param {String} value The value to make the filter value from.
993
- * @returns {dh.FilterValue} The FilterValue item for this column/value combination
997
+ * @param columnType The column type to make the filter value from.
998
+ * @param value The value to make the filter value from.
999
+ * @returns The FilterValue item for this column/value combination
994
1000
  */
995
1001
 
996
1002
 
@@ -1010,9 +1016,9 @@ class TableUtils {
1010
1016
  /**
1011
1017
  * Takes a value and converts it to an `dh.FilterValue`
1012
1018
  *
1013
- * @param {String} columnType The column type to make the filter value from.
1014
- * @param {unknown} value The value to actually set
1015
- * @returns {dh.FilterValue} The FilterValue item for this column/value combination
1019
+ * @param columnType The column type to make the filter value from.
1020
+ * @param value The value to actually set
1021
+ * @returns The FilterValue item for this column/value combination
1016
1022
  */
1017
1023
 
1018
1024
 
@@ -1029,9 +1035,9 @@ class TableUtils {
1029
1035
  }
1030
1036
  /**
1031
1037
  * Converts a string value to a value appropriate for the column
1032
- * @param {string} columnType The column type to make the value for
1033
- * @param {string} text The string value to make a type for
1034
- * @param {string} timeZone The time zone to make this value in if it is a date type. E.g. America/New_York
1038
+ * @param columnType The column type to make the value for
1039
+ * @param text The string value to make a type for
1040
+ * @param timeZone The time zone to make this value in if it is a date type. E.g. America/New_York
1035
1041
  */
1036
1042
 
1037
1043
 
@@ -1192,9 +1198,10 @@ class TableUtils {
1192
1198
  * Create a filter using the selected items
1193
1199
  * Has a flag for invertSelection as we start from a "Select All" state and a user just deselects items.
1194
1200
  * Since there may be millions of distinct items, it's easier to build an inverse filter.
1195
- * @param {String[]} selectedValues The values that are selected
1196
- * @param {boolean} invertSelection Invert the selection (eg. All items are selected, then you deselect items)
1197
- * @returns dh.FilterCondition Returns a `in` or `notIn` FilterCondition as necessary, or null if no filtering should be applied (everything selected)
1201
+ * @param column The column to set the filter on
1202
+ * @param selectedValues The values that are selected
1203
+ * @param invertSelection Invert the selection (eg. All items are selected, then you deselect items)
1204
+ * @returns Returns a `in` or `notIn` FilterCondition as necessary, or null if no filtering should be applied (everything selected)
1198
1205
  */
1199
1206
 
1200
1207
 
@@ -1267,12 +1274,12 @@ class TableUtils {
1267
1274
  }
1268
1275
 
1269
1276
  static isTreeTable(table) {
1270
- return table && table.expand && table.collapse;
1277
+ return table != null && table.expand !== undefined && table.collapse !== undefined;
1271
1278
  }
1272
1279
  /**
1273
1280
  * Copies the provided array, sorts by column name case insensitive, and returns the sorted array.
1274
- * @param {Array<dh.Column>}} columns The columns to sort
1275
- * @param {boolean} isAscending Whether to sort ascending
1281
+ * @param columns The columns to sort
1282
+ * @param isAscending Whether to sort ascending
1276
1283
  */
1277
1284
 
1278
1285