@deephaven/iris-grid 0.8.2-beta.0 → 0.9.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.
- package/dist/AdvancedFilterCreator.d.ts +2 -2
- package/dist/AdvancedFilterCreator.d.ts.map +1 -1
- package/dist/AdvancedFilterCreatorFilterItem.d.ts +30 -31
- package/dist/AdvancedFilterCreatorFilterItem.d.ts.map +1 -1
- package/dist/AdvancedFilterCreatorFilterItem.js +21 -28
- package/dist/AdvancedFilterCreatorFilterItem.js.map +1 -1
- package/dist/CrossColumnSearch.d.ts +1 -1
- package/dist/CrossColumnSearch.d.ts.map +1 -1
- package/dist/DateUtils.d.ts +46 -44
- package/dist/DateUtils.d.ts.map +1 -1
- package/dist/DateUtils.js +37 -32
- package/dist/DateUtils.js.map +1 -1
- package/dist/Formatter.d.ts +37 -42
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +58 -38
- package/dist/Formatter.js.map +1 -1
- package/dist/FormatterUtils.d.ts +12 -8
- package/dist/FormatterUtils.d.ts.map +1 -1
- package/dist/FormatterUtils.js.map +1 -1
- package/dist/IrisGrid.d.ts +12 -4
- package/dist/IrisGrid.d.ts.map +1 -1
- package/dist/IrisGrid.js +20 -4
- package/dist/IrisGrid.js.map +1 -1
- package/dist/IrisGridMetricCalculator.d.ts +16 -2
- package/dist/IrisGridMetricCalculator.d.ts.map +1 -1
- package/dist/IrisGridMetricCalculator.js +4 -3
- package/dist/IrisGridMetricCalculator.js.map +1 -1
- package/dist/IrisGridTheme.d.ts +5 -75
- package/dist/IrisGridTheme.d.ts.map +1 -1
- package/dist/IrisGridTheme.js +2 -1
- package/dist/IrisGridTheme.js.map +1 -1
- package/dist/IrisGridUtils.d.ts +4 -4
- package/dist/IrisGridUtils.d.ts.map +1 -1
- package/dist/PartitionSelectorSearch.d.ts +1 -1
- package/dist/TableUtils.d.ts +127 -114
- package/dist/TableUtils.d.ts.map +1 -1
- package/dist/TableUtils.js +76 -69
- package/dist/TableUtils.js.map +1 -1
- package/dist/declaration.d.js +2 -0
- package/dist/declaration.d.js.map +1 -0
- package/dist/filters/FilterOperator.d.ts +5 -5
- package/dist/filters/FilterOperator.d.ts.map +1 -1
- package/dist/filters/FilterOperator.js +1 -3
- package/dist/filters/FilterOperator.js.map +1 -1
- package/dist/filters/FilterType.d.ts +23 -23
- package/dist/filters/FilterType.d.ts.map +1 -1
- package/dist/filters/FilterType.js +1 -3
- package/dist/filters/FilterType.js.map +1 -1
- package/dist/filters/index.d.ts +2 -2
- package/dist/filters/index.d.ts.map +1 -1
- package/dist/filters/index.js +2 -2
- package/dist/filters/index.js.map +1 -1
- package/dist/format-context-menus/CustomFormatAction.d.ts +27 -39
- package/dist/format-context-menus/CustomFormatAction.d.ts.map +1 -1
- package/dist/format-context-menus/CustomFormatAction.js +24 -23
- package/dist/format-context-menus/CustomFormatAction.js.map +1 -1
- package/dist/format-context-menus/DateTimeFormatContextMenu.d.ts +8 -5
- package/dist/format-context-menus/DateTimeFormatContextMenu.d.ts.map +1 -1
- package/dist/format-context-menus/DateTimeFormatContextMenu.js +3 -3
- package/dist/format-context-menus/DateTimeFormatContextMenu.js.map +1 -1
- package/dist/format-context-menus/DecimalFormatContextMenu.d.ts +7 -5
- package/dist/format-context-menus/DecimalFormatContextMenu.d.ts.map +1 -1
- package/dist/format-context-menus/DecimalFormatContextMenu.js +3 -3
- package/dist/format-context-menus/DecimalFormatContextMenu.js.map +1 -1
- package/dist/format-context-menus/FormatContextMenuUtils.d.ts +28 -27
- package/dist/format-context-menus/FormatContextMenuUtils.d.ts.map +1 -1
- package/dist/format-context-menus/FormatContextMenuUtils.js +12 -10
- package/dist/format-context-menus/FormatContextMenuUtils.js.map +1 -1
- package/dist/format-context-menus/IntegerFormatContextMenu.d.ts +7 -5
- package/dist/format-context-menus/IntegerFormatContextMenu.d.ts.map +1 -1
- package/dist/format-context-menus/IntegerFormatContextMenu.js +3 -3
- package/dist/format-context-menus/IntegerFormatContextMenu.js.map +1 -1
- package/dist/format-context-menus/index.d.ts +3 -3
- package/dist/format-context-menus/index.d.ts.map +1 -1
- package/dist/format-context-menus/index.js.map +1 -1
- package/dist/formatters/BooleanColumnFormatter.d.ts +4 -4
- package/dist/formatters/BooleanColumnFormatter.d.ts.map +1 -1
- package/dist/formatters/BooleanColumnFormatter.js.map +1 -1
- package/dist/formatters/CharColumnFormatter.d.ts +4 -4
- package/dist/formatters/CharColumnFormatter.d.ts.map +1 -1
- package/dist/formatters/CharColumnFormatter.js.map +1 -1
- package/dist/formatters/DateTimeColumnFormatter.d.ts +13 -11
- package/dist/formatters/DateTimeColumnFormatter.d.ts.map +1 -1
- package/dist/formatters/DateTimeColumnFormatter.js +1 -2
- package/dist/formatters/DateTimeColumnFormatter.js.map +1 -1
- package/dist/formatters/DecimalColumnFormatter.d.ts +55 -59
- package/dist/formatters/DecimalColumnFormatter.d.ts.map +1 -1
- package/dist/formatters/DecimalColumnFormatter.js +66 -27
- package/dist/formatters/DecimalColumnFormatter.js.map +1 -1
- package/dist/formatters/DefaultColumnFormatter.d.ts +4 -4
- package/dist/formatters/DefaultColumnFormatter.d.ts.map +1 -1
- package/dist/formatters/DefaultColumnFormatter.js.map +1 -1
- package/dist/formatters/IntegerColumnFormatter.d.ts +50 -29
- package/dist/formatters/IntegerColumnFormatter.d.ts.map +1 -1
- package/dist/formatters/IntegerColumnFormatter.js +60 -19
- package/dist/formatters/IntegerColumnFormatter.js.map +1 -1
- package/dist/formatters/index.d.ts +8 -7
- package/dist/formatters/index.d.ts.map +1 -1
- package/dist/formatters/index.js +4 -3
- package/dist/formatters/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/mousehandlers/IrisGridContextMenuHandler.d.ts +14 -5
- package/dist/mousehandlers/IrisGridContextMenuHandler.d.ts.map +1 -1
- package/dist/sidebar/ChartBuilder.d.ts +1 -1
- package/dist/sidebar/ChartBuilder.d.ts.map +1 -1
- package/dist/sidebar/TableCsvExporter.d.ts +1 -1
- package/dist/sidebar/TableCsvExporter.d.ts.map +1 -1
- package/dist/sidebar/aggregations/AggregationEdit.d.ts +2 -4
- package/dist/sidebar/aggregations/AggregationEdit.d.ts.map +1 -1
- package/dist/sidebar/aggregations/AggregationEdit.js.map +1 -1
- package/dist/sidebar/aggregations/AggregationUtils.d.ts +1 -4
- package/dist/sidebar/aggregations/AggregationUtils.d.ts.map +1 -1
- package/dist/sidebar/aggregations/AggregationUtils.js.map +1 -1
- package/package.json +11 -11
- package/dist/tsconfig.tsbuildinfo +0 -1
package/dist/TableUtils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableUtils.d.ts","sourceRoot":"","sources":["../src/TableUtils.
|
|
1
|
+
{"version":3,"file":"TableUtils.d.ts","sourceRoot":"","sources":["../src/TableUtils.ts"],"names":[],"mappings":"AACA,OAAW,EACT,MAAM,EACN,eAAe,EACf,WAAW,EACX,WAAW,EAEX,IAAI,EACJ,KAAK,EACL,SAAS,EACV,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,iBAAiB,EAIlB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,UAAU,EAEV,eAAe,EACf,mBAAmB,EACpB,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,mCAAmC,CAAC;AAI9F,aAAK,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAC5B,oBAAY,QAAQ,GAAG,MAAM,CAAC,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC;AAC1D,oBAAY,aAAa,GAAG,MAAM,CAAC,OAAO,UAAU,CAAC,aAAa,CAAC,CAAC;AAEpE,sEAAsE;AACtE,cAAM,UAAU;IACd,MAAM,CAAC,QAAQ;;;;;;;MAOJ;IAEX,MAAM,CAAC,aAAa;;;;;MAKT;IAEX,MAAM,CAAC,YAAY;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AAG,MAAM;IAI1C;;;;OAIG;IACH,MAAM,CAAC,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,WAAW;IActE;;;;;;OAMG;IACH,MAAM,CAAC,kBAAkB,CACvB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,OAAO,GAChB,WAAW;IAYd;;;;;OAKG;IACH,MAAM,CAAC,SAAS,CACd,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GACf,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,WAAW,GAAG,IAAI;IA0BjD,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,UAAQ,GAAG,OAAO,GAAG,IAAI;IA+BzE,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAyBnD,MAAM,CAAC,uBAAuB,CAC5B,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,eAAe,EAC1B,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,GACf,eAAe;IAsFlB;;;;;;;;OAQG;IACH,MAAM,CAAC,qBAAqB,CAC1B,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,MAAM,EAAE,EACxB,eAAe,EAAE,OAAO,GACvB,eAAe,GAAG,IAAI;IAwEzB,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS;IAQtD;;;;OAIG;IACH,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,WAAW,UAAO,GAAG,MAAM,EAAE;CAOpE;AAED,eAAe,UAAU,CAAC"}
|
package/dist/TableUtils.js
CHANGED
|
@@ -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
|
|
28
|
-
* @param
|
|
29
|
-
* @return
|
|
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
|
|
127
|
-
* @param
|
|
128
|
-
* @param
|
|
129
|
-
* @param
|
|
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
|
|
155
|
-
* @param
|
|
156
|
-
* @param
|
|
157
|
-
* @param
|
|
158
|
-
* @returns
|
|
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
|
|
327
|
-
* @returns
|
|
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
|
|
337
|
-
* @param
|
|
338
|
-
* @returns
|
|
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
|
|
348
|
-
* @param
|
|
349
|
-
* @param
|
|
350
|
-
* @returns
|
|
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
|
|
393
|
-
* @param
|
|
394
|
-
* @param
|
|
395
|
-
* @returns
|
|
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
|
|
648
|
-
* @param
|
|
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
|
|
702
|
-
* @param
|
|
703
|
-
* @param
|
|
704
|
-
* @param
|
|
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
|
|
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
|
|
831
|
-
* @param
|
|
832
|
-
* @param
|
|
833
|
-
* @returns
|
|
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
|
|
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
|
|
879
|
-
* @param
|
|
880
|
-
* @param
|
|
881
|
-
* @param
|
|
882
|
-
* @returns
|
|
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
|
|
890
|
-
var timeoutId
|
|
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
|
|
992
|
-
* @param
|
|
993
|
-
* @returns
|
|
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
|
|
1014
|
-
* @param
|
|
1015
|
-
* @returns
|
|
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
|
|
1033
|
-
* @param
|
|
1034
|
-
* @param
|
|
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
|
|
1196
|
-
* @param
|
|
1197
|
-
* @
|
|
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
|
|
1275
|
-
* @param
|
|
1281
|
+
* @param columns The columns to sort
|
|
1282
|
+
* @param isAscending Whether to sort ascending
|
|
1276
1283
|
*/
|
|
1277
1284
|
|
|
1278
1285
|
|