@deephaven/iris-grid 0.6.3-alpha.5 → 0.6.3-bard.1
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/Formatter.d.ts +7 -14
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +6 -6
- package/dist/Formatter.js.map +1 -1
- package/dist/IrisGrid.d.ts +8 -0
- package/dist/IrisGrid.d.ts.map +1 -1
- package/dist/IrisGrid.js +33 -17
- package/dist/IrisGrid.js.map +1 -1
- package/dist/IrisGridBottomBar.js +1 -1
- package/dist/IrisGridModelUpdater.js +1 -1
- package/dist/IrisGridModelUpdater.js.map +1 -1
- package/dist/IrisGridTableModel.d.ts.map +1 -1
- package/dist/IrisGridTableModel.js +1 -2
- package/dist/IrisGridTableModel.js.map +1 -1
- package/dist/IrisGridTreeTableModel.js +1 -1
- package/dist/IrisGridUtils.js +32 -32
- package/dist/IrisGridUtils.js.map +1 -1
- package/dist/PendingDataBottomBar.js +1 -1
- package/dist/PendingDataBottomBar.js.map +1 -1
- package/dist/TableUtils.js +1 -1
- package/dist/ToastBottomBar.js +1 -1
- package/dist/ToastBottomBar.js.map +1 -1
- package/dist/formatters/DateTimeColumnFormatter.d.ts +8 -7
- 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/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 +7 -7
- package/dist/formatters/index.d.ts.map +1 -1
- package/dist/formatters/index.js +3 -3
- package/dist/formatters/index.js.map +1 -1
- package/dist/memoizeClear.js +1 -1
- package/dist/mousehandlers/IrisGridContextMenuHandler.js +1 -1
- package/dist/sidebar/AdvancedSettingsMenu.js +2 -2
- package/dist/sidebar/CustomColumnBuilder.js +2 -2
- package/dist/sidebar/CustomColumnBuilder.js.map +1 -1
- package/dist/sidebar/InputEditor.js +1 -1
- package/dist/sidebar/RollupRows.js +10 -10
- package/dist/sidebar/RollupRows.js.map +1 -1
- package/dist/sidebar/SelectDistinctBuilder.js +5 -5
- package/dist/sidebar/SelectDistinctBuilder.js.map +1 -1
- package/dist/sidebar/VisibilityOrderingBuilder.js +10 -10
- package/dist/sidebar/VisibilityOrderingBuilder.js.map +1 -1
- package/dist/sidebar/aggregations/AggregationEdit.js +3 -3
- package/dist/sidebar/aggregations/AggregationEdit.js.map +1 -1
- package/dist/sidebar/aggregations/AggregationUtils.js +1 -1
- package/dist/sidebar/aggregations/Aggregations.js +4 -4
- package/dist/sidebar/aggregations/Aggregations.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -12
package/dist/Formatter.d.ts
CHANGED
|
@@ -19,20 +19,13 @@ declare class Formatter {
|
|
|
19
19
|
};
|
|
20
20
|
/**
|
|
21
21
|
* @param {Array} columnFormattingRules Optional array of column formatting rules
|
|
22
|
-
* @param {
|
|
23
|
-
* @param {
|
|
24
|
-
* @param {
|
|
25
|
-
* @param {boolean} dateTimeOptions.showTSeparator Show 'T' separator in DateTime values
|
|
26
|
-
* @param {string} dateTimeOptions.defaultDateTimeFormatString DateTime format to use if columnFormats for DateTime isn't set
|
|
22
|
+
* @param {DateTimeColumnFormatterOptions} dateTimeOptions Optional object with DateTime configuration
|
|
23
|
+
* @param {DecimalColumnFormatterOptions} decimalFormatOptions Optional object with Decimal format configuration
|
|
24
|
+
* @param {IntegerColumnFormatterOptions} integerFormatOptions Optional object with Integer format configuration
|
|
27
25
|
*/
|
|
28
|
-
constructor(columnFormattingRules?: any[], dateTimeOptions?:
|
|
29
|
-
timeZone: string;
|
|
30
|
-
showTimeZone: boolean;
|
|
31
|
-
showTSeparator: boolean;
|
|
32
|
-
defaultDateTimeFormatString: string;
|
|
33
|
-
});
|
|
26
|
+
constructor(columnFormattingRules?: any[], dateTimeOptions?: any, decimalFormatOptions?: any, integerFormatOptions?: any);
|
|
34
27
|
defaultColumnFormatter: DefaultColumnFormatter;
|
|
35
|
-
typeFormatterMap: Map<string,
|
|
28
|
+
typeFormatterMap: Map<string, CharColumnFormatter>;
|
|
36
29
|
columnFormatMap: any;
|
|
37
30
|
/**
|
|
38
31
|
* Gets columnFormatMap indexed by name for a given column type, creates new Map entry if necessary
|
|
@@ -48,7 +41,7 @@ declare class Formatter {
|
|
|
48
41
|
* @returns format object or null for Default
|
|
49
42
|
*/
|
|
50
43
|
getColumnFormat(columnType: string, columnName: string): any;
|
|
51
|
-
getColumnTypeFormatter(columnType: any):
|
|
44
|
+
getColumnTypeFormatter(columnType: any): CharColumnFormatter | DefaultColumnFormatter | undefined;
|
|
52
45
|
/**
|
|
53
46
|
* Gets formatted string for a given value, column type and name
|
|
54
47
|
* @param {Any} value Value to format
|
|
@@ -64,5 +57,5 @@ declare class Formatter {
|
|
|
64
57
|
get timeZone(): string;
|
|
65
58
|
}
|
|
66
59
|
import { DefaultColumnFormatter } from "./formatters";
|
|
67
|
-
import {
|
|
60
|
+
import { CharColumnFormatter } from "./formatters";
|
|
68
61
|
//# sourceMappingURL=Formatter.d.ts.map
|
package/dist/Formatter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Formatter.d.ts","sourceRoot":"","sources":["../src/Formatter.js"],"names":[],"mappings":";AAUA;IACE;;;;OAIG;IACH,8DAaC;IAED;;;;;OAKG;IACH;;;;MAMC;IAED
|
|
1
|
+
{"version":3,"file":"Formatter.d.ts","sourceRoot":"","sources":["../src/Formatter.js"],"names":[],"mappings":";AAUA;IACE;;;;OAIG;IACH,8DAaC;IAED;;;;;OAKG;IACH;;;;MAMC;IAED;;;;;OAKG;IACH,0HAiCC;IAtBC,+CAA0D;IAG1D,mDAeE;IAGF,qBAA2E;IAG7E;;;;;OAKG;IACH,gFAMC;IAED;;;;;OAKG;IACH,6DAMC;IAED,kGAMC;IAED;;;;;;OAMG;IACH,yGAeC;IAED;;;OAGG;IACH,uBAGC;CACF"}
|
package/dist/Formatter.js
CHANGED
|
@@ -41,24 +41,24 @@ class Formatter {
|
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* @param {Array} columnFormattingRules Optional array of column formatting rules
|
|
44
|
-
* @param {
|
|
45
|
-
* @param {
|
|
46
|
-
* @param {
|
|
47
|
-
* @param {boolean} dateTimeOptions.showTSeparator Show 'T' separator in DateTime values
|
|
48
|
-
* @param {string} dateTimeOptions.defaultDateTimeFormatString DateTime format to use if columnFormats for DateTime isn't set
|
|
44
|
+
* @param {DateTimeColumnFormatterOptions} dateTimeOptions Optional object with DateTime configuration
|
|
45
|
+
* @param {DecimalColumnFormatterOptions} decimalFormatOptions Optional object with Decimal format configuration
|
|
46
|
+
* @param {IntegerColumnFormatterOptions} integerFormatOptions Optional object with Integer format configuration
|
|
49
47
|
*/
|
|
50
48
|
|
|
51
49
|
|
|
52
50
|
constructor() {
|
|
53
51
|
var columnFormattingRules = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
54
52
|
var dateTimeOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
53
|
+
var decimalFormatOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
54
|
+
var integerFormatOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
55
55
|
// Formatting order:
|
|
56
56
|
// - columnFormatMap[type][name]
|
|
57
57
|
// - typeFormatterMap[type]
|
|
58
58
|
// - defaultColumnFormatter
|
|
59
59
|
this.defaultColumnFormatter = new DefaultColumnFormatter(); // Default formatters by data type
|
|
60
60
|
|
|
61
|
-
this.typeFormatterMap = new Map([[TableUtils.dataType.BOOLEAN, new BooleanColumnFormatter()], [TableUtils.dataType.CHAR, new CharColumnFormatter()], [TableUtils.dataType.DATETIME, new DateTimeColumnFormatter(dateTimeOptions)], [TableUtils.dataType.DECIMAL, new DecimalColumnFormatter()], [TableUtils.dataType.INT, new IntegerColumnFormatter()]]); // Formats indexed by data type and column name
|
|
61
|
+
this.typeFormatterMap = new Map([[TableUtils.dataType.BOOLEAN, new BooleanColumnFormatter()], [TableUtils.dataType.CHAR, new CharColumnFormatter()], [TableUtils.dataType.DATETIME, new DateTimeColumnFormatter(dateTimeOptions)], [TableUtils.dataType.DECIMAL, new DecimalColumnFormatter(decimalFormatOptions)], [TableUtils.dataType.INT, new IntegerColumnFormatter(integerFormatOptions)]]); // Formats indexed by data type and column name
|
|
62
62
|
|
|
63
63
|
this.columnFormatMap = Formatter.makeColumnFormatMap(columnFormattingRules);
|
|
64
64
|
}
|
package/dist/Formatter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Formatter.js"],"names":["TableUtils","BooleanColumnFormatter","CharColumnFormatter","DateTimeColumnFormatter","DecimalColumnFormatter","DefaultColumnFormatter","IntegerColumnFormatter","Formatter","makeColumnFormatMap","columnFormattingRules","Map","reduce","map","next","dataType","getNormalizedType","columnType","has","set","formatMap","get","columnName","format","makeColumnFormattingRule","constructor","dateTimeOptions","defaultColumnFormatter","typeFormatterMap","BOOLEAN","CHAR","DATETIME","DECIMAL","INT","columnFormatMap","getColumnFormatMapForType","createIfNecessary","getColumnFormat","getColumnTypeFormatter","getFormattedString","value","formatOverride","formatter","timeZone","dhTimeZone","id"],"mappings":"OAAOA,U;SAELC,sB,EACAC,mB,EACAC,uB,EACAC,sB,EACAC,sB,EACAC,sB;;AAGF,MAAMC,SAAN,CAAgB;AACd;AACF;AACA;AACA;AACA;AAC4B,SAAnBC,mBAAmB,CAACC,qBAAD,EAAwB;AAChD,QAAIA,qBAAqB,IAAI,IAA7B,EAAmC;AACjC,aAAO,IAAIC,GAAJ,EAAP;AACD;;AACD,WAAOD,qBAAqB,CAACE,MAAtB,CAA6B,CAACC,GAAD,EAAMC,IAAN,KAAe;AACjD,UAAMC,QAAQ,GAAGd,UAAU,CAACe,iBAAX,CAA6BF,IAAI,CAACG,UAAlC,CAAjB;;AACA,UAAI,CAACJ,GAAG,CAACK,GAAJ,CAAQH,QAAR,CAAL,EAAwB;AACtBF,QAAAA,GAAG,CAACM,GAAJ,CAAQJ,QAAR,EAAkB,IAAIJ,GAAJ,EAAlB;AACD;;AACD,UAAMS,SAAS,GAAGP,GAAG,CAACQ,GAAJ,CAAQN,QAAR,CAAlB;AACAK,MAAAA,SAAS,CAACD,GAAV,CAAcL,IAAI,CAACQ,UAAnB,EAA+BR,IAAI,CAACS,MAApC;AACA,aAAOV,GAAP;AACD,KARM,EAQJ,IAAIF,GAAJ,EARI,CAAP;AASD;AAED;AACF;AACA;AACA;AACA;AACA;;;AACiC,SAAxBa,wBAAwB,CAACP,UAAD,EAAaK,UAAb,EAAyBC,MAAzB,EAAiC;AAC9D,WAAO;AACLN,MAAAA,UADK;AAELK,MAAAA,UAFK;AAGLC,MAAAA;AAHK,KAAP;AAKD;AAED;AACF;AACA;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"sources":["../src/Formatter.js"],"names":["TableUtils","BooleanColumnFormatter","CharColumnFormatter","DateTimeColumnFormatter","DecimalColumnFormatter","DefaultColumnFormatter","IntegerColumnFormatter","Formatter","makeColumnFormatMap","columnFormattingRules","Map","reduce","map","next","dataType","getNormalizedType","columnType","has","set","formatMap","get","columnName","format","makeColumnFormattingRule","constructor","dateTimeOptions","decimalFormatOptions","integerFormatOptions","defaultColumnFormatter","typeFormatterMap","BOOLEAN","CHAR","DATETIME","DECIMAL","INT","columnFormatMap","getColumnFormatMapForType","createIfNecessary","getColumnFormat","getColumnTypeFormatter","getFormattedString","value","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UAA/B,CAAxB;;AACA,QAAImB,eAAe,IAAIA,eAAe,CAAClB,GAAhB,CAAoBI,UAApB,CAAvB,EAAwD;AACtD,aAAOc,eAAe,CAACf,GAAhB,CAAoBC,UAApB,CAAP;AACD;;AACD,WAAO,IAAP;AACD;;AAEDkB,EAAAA,sBAAsB,CAACvB,UAAD,EAAa;AACjC,QAAMF,QAAQ,GAAGd,UAAU,CAACe,iBAAX,CAA6BC,UAA7B,CAAjB;;AACA,QAAIF,QAAQ,IAAI,KAAKe,gBAAL,CAAsBZ,GAAtB,CAA0BH,QAA1B,CAAhB,EAAqD;AACnD,aAAO,KAAKe,gBAAL,CAAsBT,GAAtB,CAA0BN,QAA1B,CAAP;AACD;;AACD,WAAO,KAAKc,sBAAZ;AACD;AAED;AACF;AACA;AACA;AACA;AACA;AACA;;;AACEY,EAAAA,kBAAkB,CAChBC,KADgB,EAEhBzB,UAFgB,EAKhB;AAAA,QAFAK,UAEA,uEAFa,EAEb;AAAA,QADAqB,cACA,uEADiB,IACjB;;AACA,QAAID,KAAK,IAAI,IAAb,EAAmB;AACjB,aAAO,EAAP;AACD;;AAED,QAAME,SAAS,GAAG,KAAKJ,sBAAL,CAA4BvB,UAA5B,CAAlB;AACA,QAAMM,MAAM,GACVoB,cAAc,IAAI,KAAKJ,eAAL,CAAqBtB,UAArB,EAAiCK,UAAjC,CADpB;AAGA,WAAOsB,SAAS,CAACrB,MAAV,CAAiBmB,KAAjB,EAAwBnB,MAAxB,CAAP;AACD;AAED;AACF;AACA;AACA;;;AACc,MAARsB,QAAQ,GAAG;AAAA;;AACb,oCAAO,KAAKf,gBAAL,CAAsBT,GAAtB,CAA0BpB,UAAU,CAACc,QAAX,CAAoBkB,QAA9C,CAAP,oFAAO,sBAAyDa,UAAhE,2DAAO,uBACHC,EADJ;AAED;;AA/Ia;;AAkJhB,eAAevC,SAAf","sourcesContent":["import TableUtils from './TableUtils';\nimport {\n BooleanColumnFormatter,\n CharColumnFormatter,\n DateTimeColumnFormatter,\n DecimalColumnFormatter,\n DefaultColumnFormatter,\n IntegerColumnFormatter,\n} from './formatters';\n\nclass Formatter {\n /**\n * Converts [{columnType, columnName, format}] to Map { dataType, Map { columnName, format }}\n * @param {Array} columnFormattingRules Array or column formatting rules\n * @returns Map of columnName-to-format Maps indexed by normalized dataType\n */\n static makeColumnFormatMap(columnFormattingRules) {\n if (columnFormattingRules == null) {\n return new Map();\n }\n return columnFormattingRules.reduce((map, next) => {\n const dataType = TableUtils.getNormalizedType(next.columnType);\n if (!map.has(dataType)) {\n map.set(dataType, new Map());\n }\n const formatMap = map.get(dataType);\n formatMap.set(next.columnName, next.format);\n return map;\n }, new Map());\n }\n\n /**\n * Creates a column formatting rule\n * @param {String} columnType Normalized data type\n * @param {String} columnName Column name\n * @param {String} format Format string\n */\n static makeColumnFormattingRule(columnType, columnName, format) {\n return {\n columnType,\n columnName,\n format,\n };\n }\n\n /**\n * @param {Array} columnFormattingRules Optional array of column formatting rules\n * @param {DateTimeColumnFormatterOptions} dateTimeOptions Optional object with DateTime configuration\n * @param {DecimalColumnFormatterOptions} decimalFormatOptions Optional object with Decimal format configuration\n * @param {IntegerColumnFormatterOptions} integerFormatOptions Optional object with Integer format configuration\n */\n constructor(\n columnFormattingRules = [],\n dateTimeOptions = {},\n decimalFormatOptions = {},\n integerFormatOptions = {}\n ) {\n // Formatting order:\n // - columnFormatMap[type][name]\n // - typeFormatterMap[type]\n // - defaultColumnFormatter\n\n this.defaultColumnFormatter = new DefaultColumnFormatter();\n\n // Default formatters by data type\n this.typeFormatterMap = new Map([\n [TableUtils.dataType.BOOLEAN, new BooleanColumnFormatter()],\n [TableUtils.dataType.CHAR, new CharColumnFormatter()],\n [\n TableUtils.dataType.DATETIME,\n new DateTimeColumnFormatter(dateTimeOptions),\n ],\n [\n TableUtils.dataType.DECIMAL,\n new DecimalColumnFormatter(decimalFormatOptions),\n ],\n [\n TableUtils.dataType.INT,\n new IntegerColumnFormatter(integerFormatOptions),\n ],\n ]);\n\n // Formats indexed by data type and column name\n this.columnFormatMap = Formatter.makeColumnFormatMap(columnFormattingRules);\n }\n\n /**\n * Gets columnFormatMap indexed by name for a given column type, creates new Map entry if necessary\n * @param {String} columnType column type\n * @param {Boolean} createIfNecessary create new entry if true\n * @returns Map of format strings indexed by column name or undefined if it doesn't exist\n */\n getColumnFormatMapForType(columnType, createIfNecessary = false) {\n const dataType = TableUtils.getNormalizedType(columnType);\n if (createIfNecessary && !this.columnFormatMap.has(dataType)) {\n this.columnFormatMap.set(dataType, new Map());\n }\n return this.columnFormatMap.get(dataType);\n }\n\n /**\n * Gets a column format object for a given column type and name\n * @param {String} columnType column type\n * @param {String} columnName column name\n * @returns format object or null for Default\n */\n getColumnFormat(columnType, columnName) {\n const columnFormatMap = this.getColumnFormatMapForType(columnType);\n if (columnFormatMap && columnFormatMap.has(columnName)) {\n return columnFormatMap.get(columnName);\n }\n return null;\n }\n\n getColumnTypeFormatter(columnType) {\n const dataType = TableUtils.getNormalizedType(columnType);\n if (dataType && this.typeFormatterMap.has(dataType)) {\n return this.typeFormatterMap.get(dataType);\n }\n return this.defaultColumnFormatter;\n }\n\n /**\n * Gets formatted string for a given value, column type and name\n * @param {Any} value Value to format\n * @param {String} columnType Column type used to determine the formatting settings\n * @param {String} columnName Column name used to determine the formatting settings\n * @param {String} formatOverride Format object passed to the formatter in place of the format defined in columnFormatMap\n */\n getFormattedString(\n value,\n columnType,\n columnName = '',\n formatOverride = null\n ) {\n if (value == null) {\n return '';\n }\n\n const formatter = this.getColumnTypeFormatter(columnType);\n const format =\n formatOverride || this.getColumnFormat(columnType, columnName);\n\n return formatter.format(value, format);\n }\n\n /**\n * Gets the timeZone name\n * @returns {string} The time zone name E.g. America/New_York\n */\n get timeZone() {\n return this.typeFormatterMap.get(TableUtils.dataType.DATETIME)?.dhTimeZone\n ?.id;\n }\n}\n\nexport default Formatter;\n"],"file":"Formatter.js"}
|
package/dist/IrisGrid.d.ts
CHANGED
|
@@ -79,6 +79,8 @@ export class IrisGrid extends React.Component<any, any, any> {
|
|
|
79
79
|
pending: Pending;
|
|
80
80
|
globalColumnFormats: any[];
|
|
81
81
|
dateTimeFormatterOptions: {};
|
|
82
|
+
decimalFormatOptions: {};
|
|
83
|
+
integerFormatOptions: {};
|
|
82
84
|
loadingScrimStartTime: number | null;
|
|
83
85
|
loadingScrimFinishTime: number | null;
|
|
84
86
|
loadingTimer: NodeJS.Timeout | null;
|
|
@@ -688,6 +690,12 @@ export namespace IrisGrid {
|
|
|
688
690
|
const showTimeZone: boolean;
|
|
689
691
|
const showTSeparator: boolean;
|
|
690
692
|
const formatter: never[];
|
|
693
|
+
const decimalFormatOptions: PropTypes.Requireable<PropTypes.InferProps<{
|
|
694
|
+
defaultFormatString: PropTypes.Requireable<string>;
|
|
695
|
+
}>>;
|
|
696
|
+
const integerFormatOptions: PropTypes.Requireable<PropTypes.InferProps<{
|
|
697
|
+
defaultFormatString: PropTypes.Requireable<string>;
|
|
698
|
+
}>>;
|
|
691
699
|
}
|
|
692
700
|
export { settings_1 as settings };
|
|
693
701
|
}
|
package/dist/IrisGrid.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IrisGrid.d.ts","sourceRoot":"","sources":["../src/IrisGrid.jsx"],"names":[],"mappings":"AAgHA;IACE,2BAAyB;IAEzB,2BAAyB;IAEzB,mCAAiC;IAEjC,
|
|
1
|
+
{"version":3,"file":"IrisGrid.d.ts","sourceRoot":"","sources":["../src/IrisGrid.jsx"],"names":[],"mappings":"AAgHA;IACE,2BAAyB;IAEzB,2BAAyB;IAEzB,mCAAiC;IAEjC,wBAmQC;IAuxCD,yEAOC;IAED,2FA0BC;IAED,iCAEC;IAED,4CAEC;IAED,iDAeC;IA0TD;;;OAGG;IACH,gDAaC;IAhCD;;;OAGG;IACH,yDASC;IAqBD;;;OAGG;IACH,8CAeC;IAroBD,4BAOC;IAED,6BAMC;IAED,2BAIC;IAuRD,0BAEC;IAED,uCAGC;IAED,kCAKC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CAAQ;;QACf,kCAAQ;;QACF,wCAAQ;;QACJ,4CAAQ;;QACD,mDAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;QAYd,6CAAQ;;;;;;;;;;;;;;;;;;;;;;;;QAYb,2CAAQ"}
|
package/dist/IrisGrid.js
CHANGED
|
@@ -2,7 +2,7 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
|
2
2
|
|
|
3
3
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
4
4
|
|
|
5
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly)
|
|
5
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
6
6
|
|
|
7
7
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
8
8
|
|
|
@@ -171,7 +171,7 @@ export class IrisGrid extends Component {
|
|
|
171
171
|
|
|
172
172
|
_defineProperty(this, "getCachedHiddenColumns", memoize(hiddenColumns => hiddenColumns, {
|
|
173
173
|
max: 1,
|
|
174
|
-
normalizer: _ref2 => {
|
|
174
|
+
normalizer: (_ref2) => {
|
|
175
175
|
var [hiddenColumns] = _ref2;
|
|
176
176
|
return hiddenColumns.join();
|
|
177
177
|
}
|
|
@@ -179,7 +179,7 @@ export class IrisGrid extends Component {
|
|
|
179
179
|
|
|
180
180
|
_defineProperty(this, "getAggregationMap", memoize((columns, aggregations) => {
|
|
181
181
|
var aggregationMap = {};
|
|
182
|
-
aggregations.forEach(_ref3 => {
|
|
182
|
+
aggregations.forEach((_ref3) => {
|
|
183
183
|
var {
|
|
184
184
|
operation,
|
|
185
185
|
selected,
|
|
@@ -192,7 +192,7 @@ export class IrisGrid extends Component {
|
|
|
192
192
|
|
|
193
193
|
_defineProperty(this, "getOperationMap", memoize((columns, aggregations) => {
|
|
194
194
|
var operationMap = {};
|
|
195
|
-
aggregations.filter(a => !AggregationUtils.isRollupOperation(a.operation)).forEach(_ref4 => {
|
|
195
|
+
aggregations.filter(a => !AggregationUtils.isRollupOperation(a.operation)).forEach((_ref4) => {
|
|
196
196
|
var {
|
|
197
197
|
operation,
|
|
198
198
|
selected,
|
|
@@ -330,7 +330,9 @@ export class IrisGrid extends Component {
|
|
|
330
330
|
this.tooltip = null;
|
|
331
331
|
this.pending = new Pending();
|
|
332
332
|
this.globalColumnFormats = [];
|
|
333
|
-
this.dateTimeFormatterOptions = {};
|
|
333
|
+
this.dateTimeFormatterOptions = {};
|
|
334
|
+
this.decimalFormatOptions = {};
|
|
335
|
+
this.integerFormatOptions = {}; // When the loading scrim started/when it should extend to the end of the screen.
|
|
334
336
|
|
|
335
337
|
this.loadingScrimStartTime = null;
|
|
336
338
|
this.loadingScrimFinishTime = null;
|
|
@@ -656,13 +658,13 @@ export class IrisGrid extends Component {
|
|
|
656
658
|
var newAdvancedFilters = replaceExisting ? new Map() : new Map(advancedFilters);
|
|
657
659
|
var newQuickFilters = replaceExisting ? new Map() : new Map(quickFilters);
|
|
658
660
|
var isChanged = replaceExisting && advancedFilters.size > 0;
|
|
659
|
-
inputFilters.forEach(_ref5 => {
|
|
661
|
+
inputFilters.forEach((_ref5) => {
|
|
660
662
|
var {
|
|
661
663
|
name,
|
|
662
664
|
type,
|
|
663
665
|
value
|
|
664
666
|
} = _ref5;
|
|
665
|
-
var modelIndex = model.columns.findIndex(_ref6 => {
|
|
667
|
+
var modelIndex = model.columns.findIndex((_ref6) => {
|
|
666
668
|
var {
|
|
667
669
|
name: columnName,
|
|
668
670
|
type: columnType
|
|
@@ -743,7 +745,7 @@ export class IrisGrid extends Component {
|
|
|
743
745
|
|
|
744
746
|
log.debug('Setting advanced filter', modelIndex, filter);
|
|
745
747
|
this.startLoading('Filtering...', true);
|
|
746
|
-
this.setState(_ref7 => {
|
|
748
|
+
this.setState((_ref7) => {
|
|
747
749
|
var {
|
|
748
750
|
advancedFilters
|
|
749
751
|
} = _ref7;
|
|
@@ -774,7 +776,7 @@ export class IrisGrid extends Component {
|
|
|
774
776
|
setQuickFilter(modelIndex, filter, text) {
|
|
775
777
|
log.debug('Setting quick filter', modelIndex, filter, text);
|
|
776
778
|
this.startLoading('Filtering...', true);
|
|
777
|
-
this.setState(_ref8 => {
|
|
779
|
+
this.setState((_ref8) => {
|
|
778
780
|
var {
|
|
779
781
|
quickFilters
|
|
780
782
|
} = _ref8;
|
|
@@ -835,7 +837,7 @@ export class IrisGrid extends Component {
|
|
|
835
837
|
|
|
836
838
|
removeColumnFilter(modelColumn) {
|
|
837
839
|
this.startLoading('Filtering...', true);
|
|
838
|
-
this.setState(_ref10 => {
|
|
840
|
+
this.setState((_ref10) => {
|
|
839
841
|
var {
|
|
840
842
|
advancedFilters,
|
|
841
843
|
quickFilters
|
|
@@ -951,12 +953,20 @@ export class IrisGrid extends Component {
|
|
|
951
953
|
var forceUpdate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
952
954
|
var globalColumnFormats = FormatterUtils.getColumnFormats(settings);
|
|
953
955
|
var dateTimeFormatterOptions = FormatterUtils.getDateTimeFormatterOptions(settings);
|
|
956
|
+
var {
|
|
957
|
+
defaultDecimalFormatOptions = {},
|
|
958
|
+
defaultIntegerFormatOptions = {}
|
|
959
|
+
} = settings;
|
|
954
960
|
var isColumnFormatChanged = !deepEqual(this.globalColumnFormats, globalColumnFormats);
|
|
955
961
|
var isDateFormattingChanged = !deepEqual(this.dateTimeFormatterOptions, dateTimeFormatterOptions);
|
|
962
|
+
var isDecimalFormattingChanged = !deepEqual(this.decimalFormatOptions, defaultDecimalFormatOptions);
|
|
963
|
+
var isIntegerFormattingChanged = !deepEqual(this.integerFormatOptions, defaultIntegerFormatOptions);
|
|
956
964
|
|
|
957
|
-
if (isColumnFormatChanged || isDateFormattingChanged) {
|
|
965
|
+
if (isColumnFormatChanged || isDateFormattingChanged || isDecimalFormattingChanged || isIntegerFormattingChanged) {
|
|
958
966
|
this.globalColumnFormats = globalColumnFormats;
|
|
959
967
|
this.dateTimeFormatterOptions = dateTimeFormatterOptions;
|
|
968
|
+
this.decimalFormatOptions = defaultDecimalFormatOptions;
|
|
969
|
+
this.integerFormatOptions = defaultIntegerFormatOptions;
|
|
960
970
|
this.updateFormatter({}, forceUpdate);
|
|
961
971
|
|
|
962
972
|
if (isDateFormattingChanged && forceUpdate) {
|
|
@@ -976,7 +986,7 @@ export class IrisGrid extends Component {
|
|
|
976
986
|
}, updatedFormats);
|
|
977
987
|
|
|
978
988
|
var mergedColumnFormats = [...this.globalColumnFormats, ...update.customColumnFormatMap.values()];
|
|
979
|
-
var formatter = new Formatter(mergedColumnFormats, this.dateTimeFormatterOptions);
|
|
989
|
+
var formatter = new Formatter(mergedColumnFormats, this.dateTimeFormatterOptions, this.decimalFormatOptions, this.integerFormatOptions);
|
|
980
990
|
log.debug('updateFormatter', this.globalColumnFormats, mergedColumnFormats);
|
|
981
991
|
this.setState(_objectSpread(_objectSpread({}, update), {}, {
|
|
982
992
|
formatter
|
|
@@ -1722,7 +1732,7 @@ export class IrisGrid extends Component {
|
|
|
1722
1732
|
|
|
1723
1733
|
handleFilterBarChange(value) {
|
|
1724
1734
|
this.startLoading('Filtering...', true);
|
|
1725
|
-
this.setState(_ref12 => {
|
|
1735
|
+
this.setState((_ref12) => {
|
|
1726
1736
|
var {
|
|
1727
1737
|
focusedFilterBarColumn,
|
|
1728
1738
|
quickFilters
|
|
@@ -1800,7 +1810,7 @@ export class IrisGrid extends Component {
|
|
|
1800
1810
|
}
|
|
1801
1811
|
|
|
1802
1812
|
handleMenuBack() {
|
|
1803
|
-
this.setState(_ref13 => {
|
|
1813
|
+
this.setState((_ref13) => {
|
|
1804
1814
|
var {
|
|
1805
1815
|
openOptions
|
|
1806
1816
|
} = _ref13;
|
|
@@ -1813,7 +1823,7 @@ export class IrisGrid extends Component {
|
|
|
1813
1823
|
}
|
|
1814
1824
|
|
|
1815
1825
|
handleMenuSelect(option) {
|
|
1816
|
-
this.setState(_ref14 => {
|
|
1826
|
+
this.setState((_ref14) => {
|
|
1817
1827
|
var {
|
|
1818
1828
|
openOptions
|
|
1819
1829
|
} = _ref14;
|
|
@@ -2063,7 +2073,7 @@ export class IrisGrid extends Component {
|
|
|
2063
2073
|
handleAggregationChange(aggregation) {
|
|
2064
2074
|
log.debug('handleAggregationChange', aggregation);
|
|
2065
2075
|
this.startLoading("Aggregating ".concat(aggregation.operation, "..."));
|
|
2066
|
-
this.setState(_ref15 => {
|
|
2076
|
+
this.setState((_ref15) => {
|
|
2067
2077
|
var {
|
|
2068
2078
|
aggregationSettings
|
|
2069
2079
|
} = _ref15;
|
|
@@ -3048,7 +3058,13 @@ IrisGrid.defaultProps = {
|
|
|
3048
3058
|
defaultDateTimeFormat: DateUtils.FULL_DATE_FORMAT,
|
|
3049
3059
|
showTimeZone: false,
|
|
3050
3060
|
showTSeparator: true,
|
|
3051
|
-
formatter: []
|
|
3061
|
+
formatter: [],
|
|
3062
|
+
decimalFormatOptions: PropTypes.shape({
|
|
3063
|
+
defaultFormatString: PropTypes.string
|
|
3064
|
+
}),
|
|
3065
|
+
integerFormatOptions: PropTypes.shape({
|
|
3066
|
+
defaultFormatString: PropTypes.string
|
|
3067
|
+
})
|
|
3052
3068
|
}
|
|
3053
3069
|
};
|
|
3054
3070
|
export default IrisGrid;
|