@deephaven/iris-grid 0.6.2 → 0.6.3-bard.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.
- 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 +21 -4
- package/dist/IrisGrid.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/sidebar/TableCsvExporter.d.ts.map +1 -1
- package/dist/sidebar/TableCsvExporter.js +10 -3
- package/dist/sidebar/TableCsvExporter.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -11
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","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,W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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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gCC;IAED,gCAYC;IAED;;;OAGG;IACH,gCAGC;IAED;;OAEG;IACH,kDAcC;IAogBD;;;OAGG;IACH,qBAFW,SAAS,EAAE,QASrB;IAED,6BAYC;IAED,gDAUC;IAED,wBASC;CAqtBF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA6GgB,wCAAQ;;QACL,2CAAQ;;QACV,yCAAQ;;QACf,kCAAQ;;QACF,wCAAQ;;QACJ,4CAAQ;;QACD,mDAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;QAYd,6CAAQ;;;;;;;;;;;;;;;;;;;;;;;;QAYb,2CAAQ"}
|
package/dist/IrisGrid.js
CHANGED
|
@@ -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;
|
|
@@ -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
|
|
@@ -2844,6 +2854,7 @@ export class IrisGrid extends Component {
|
|
|
2844
2854
|
})
|
|
2845
2855
|
}, /*#__PURE__*/React.createElement("button", {
|
|
2846
2856
|
type: "button",
|
|
2857
|
+
"data-testid": "btn-iris-grid-settings-button-".concat(name),
|
|
2847
2858
|
className: "btn btn-link btn-link-icon",
|
|
2848
2859
|
onClick: this.handleMenu
|
|
2849
2860
|
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
@@ -3048,7 +3059,13 @@ IrisGrid.defaultProps = {
|
|
|
3048
3059
|
defaultDateTimeFormat: DateUtils.FULL_DATE_FORMAT,
|
|
3049
3060
|
showTimeZone: false,
|
|
3050
3061
|
showTSeparator: true,
|
|
3051
|
-
formatter: []
|
|
3062
|
+
formatter: [],
|
|
3063
|
+
decimalFormatOptions: PropTypes.shape({
|
|
3064
|
+
defaultFormatString: PropTypes.string
|
|
3065
|
+
}),
|
|
3066
|
+
integerFormatOptions: PropTypes.shape({
|
|
3067
|
+
defaultFormatString: PropTypes.string
|
|
3068
|
+
})
|
|
3052
3069
|
}
|
|
3053
3070
|
};
|
|
3054
3071
|
export default IrisGrid;
|