@deephaven/iris-grid 0.6.3-alpha.5 → 0.6.3-bard.6

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 (70) hide show
  1. package/dist/Formatter.d.ts +7 -14
  2. package/dist/Formatter.d.ts.map +1 -1
  3. package/dist/Formatter.js +6 -6
  4. package/dist/Formatter.js.map +1 -1
  5. package/dist/FormatterUtils.d.ts +8 -0
  6. package/dist/FormatterUtils.d.ts.map +1 -1
  7. package/dist/FormatterUtils.js +15 -0
  8. package/dist/FormatterUtils.js.map +1 -1
  9. package/dist/IrisGrid.d.ts +8 -0
  10. package/dist/IrisGrid.d.ts.map +1 -1
  11. package/dist/IrisGrid.js +34 -17
  12. package/dist/IrisGrid.js.map +1 -1
  13. package/dist/IrisGridBottomBar.js +1 -1
  14. package/dist/IrisGridModelUpdater.js +1 -1
  15. package/dist/IrisGridModelUpdater.js.map +1 -1
  16. package/dist/IrisGridTableModel.d.ts.map +1 -1
  17. package/dist/IrisGridTableModel.js +3 -7
  18. package/dist/IrisGridTableModel.js.map +1 -1
  19. package/dist/IrisGridTreeTableModel.js +1 -1
  20. package/dist/IrisGridUtils.js +32 -32
  21. package/dist/IrisGridUtils.js.map +1 -1
  22. package/dist/PendingDataBottomBar.js +1 -1
  23. package/dist/PendingDataBottomBar.js.map +1 -1
  24. package/dist/TableUtils.d.ts.map +1 -1
  25. package/dist/TableUtils.js +3 -1
  26. package/dist/TableUtils.js.map +1 -1
  27. package/dist/ToastBottomBar.js +1 -1
  28. package/dist/ToastBottomBar.js.map +1 -1
  29. package/dist/formatters/DateTimeColumnFormatter.d.ts +8 -7
  30. package/dist/formatters/DateTimeColumnFormatter.d.ts.map +1 -1
  31. package/dist/formatters/DateTimeColumnFormatter.js +1 -2
  32. package/dist/formatters/DateTimeColumnFormatter.js.map +1 -1
  33. package/dist/formatters/DecimalColumnFormatter.d.ts +55 -59
  34. package/dist/formatters/DecimalColumnFormatter.d.ts.map +1 -1
  35. package/dist/formatters/DecimalColumnFormatter.js +66 -27
  36. package/dist/formatters/DecimalColumnFormatter.js.map +1 -1
  37. package/dist/formatters/IntegerColumnFormatter.d.ts +50 -29
  38. package/dist/formatters/IntegerColumnFormatter.d.ts.map +1 -1
  39. package/dist/formatters/IntegerColumnFormatter.js +60 -19
  40. package/dist/formatters/IntegerColumnFormatter.js.map +1 -1
  41. package/dist/formatters/index.d.ts +7 -7
  42. package/dist/formatters/index.d.ts.map +1 -1
  43. package/dist/formatters/index.js +3 -3
  44. package/dist/formatters/index.js.map +1 -1
  45. package/dist/memoizeClear.js +1 -1
  46. package/dist/mousehandlers/IrisGridContextMenuHandler.js +1 -1
  47. package/dist/sidebar/AdvancedSettingsMenu.js +2 -2
  48. package/dist/sidebar/CustomColumnBuilder.js +2 -2
  49. package/dist/sidebar/CustomColumnBuilder.js.map +1 -1
  50. package/dist/sidebar/InputEditor.js +1 -1
  51. package/dist/sidebar/RollupRows.js +10 -10
  52. package/dist/sidebar/RollupRows.js.map +1 -1
  53. package/dist/sidebar/SelectDistinctBuilder.js +5 -5
  54. package/dist/sidebar/SelectDistinctBuilder.js.map +1 -1
  55. package/dist/sidebar/TableCsvExporter.d.ts.map +1 -1
  56. package/dist/sidebar/TableCsvExporter.js +10 -3
  57. package/dist/sidebar/TableCsvExporter.js.map +1 -1
  58. package/dist/sidebar/TableSaver.d.ts +1 -0
  59. package/dist/sidebar/TableSaver.d.ts.map +1 -1
  60. package/dist/sidebar/TableSaver.js +20 -1
  61. package/dist/sidebar/TableSaver.js.map +1 -1
  62. package/dist/sidebar/VisibilityOrderingBuilder.js +10 -10
  63. package/dist/sidebar/VisibilityOrderingBuilder.js.map +1 -1
  64. package/dist/sidebar/aggregations/AggregationEdit.js +3 -3
  65. package/dist/sidebar/aggregations/AggregationEdit.js.map +1 -1
  66. package/dist/sidebar/aggregations/AggregationUtils.js +1 -1
  67. package/dist/sidebar/aggregations/Aggregations.js +4 -4
  68. package/dist/sidebar/aggregations/Aggregations.js.map +1 -1
  69. package/dist/tsconfig.tsbuildinfo +1 -1
  70. package/package.json +12 -12
@@ -19,20 +19,13 @@ declare class Formatter {
19
19
  };
20
20
  /**
21
21
  * @param {Array} columnFormattingRules Optional array of column formatting rules
22
- * @param {Object} dateTimeOptions Optional object with DateTime configuration
23
- * @param {string} dateTimeOptions.timeZone Time zone
24
- * @param {boolean} dateTimeOptions.showTimeZone Show time zone in DateTime values
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, DateTimeColumnFormatter>;
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): DateTimeColumnFormatter | DefaultColumnFormatter | undefined;
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 { DateTimeColumnFormatter } from "./formatters";
60
+ import { CharColumnFormatter } from "./formatters";
68
61
  //# sourceMappingURL=Formatter.d.ts.map
@@ -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;;;;;;;OAOG;IACH;QALmC,QAAQ,EAAhC,MAAM;QACmB,YAAY,EAArC,OAAO;QACkB,cAAc,EAAvC,OAAO;QACiB,2BAA2B,EAAnD,MAAM;OAwBhB;IAhBC,+CAA0D;IAG1D,uDASE;IAGF,qBAA2E;IAG7E;;;;;OAKG;IACH,gFAMC;IAED;;;;;OAKG;IACH,6DAMC;IAED,sGAMC;IAED;;;;;;OAMG;IACH,yGAeC;IAED;;;OAGG;IACH,uBAGC;CACF"}
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 {Object} dateTimeOptions Optional object with DateTime configuration
45
- * @param {string} dateTimeOptions.timeZone Time zone
46
- * @param {boolean} dateTimeOptions.showTimeZone Show time zone in DateTime values
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
  }
@@ -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,EA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;;AACb,oCAAO,KAAKf,gBAAL,CAAsBP,GAAtB,CAA0BpB,UAAU,CAACc,QAAX,CAAoBgB,QAA9C,CAAP,oFAAO,sBAAyDa,UAAhE,2DAAO,uBACHC,EADJ;AAED;;AAtIa;;AAyIhB,eAAerC,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 {Object} dateTimeOptions Optional object with DateTime configuration\n * @param {string} dateTimeOptions.timeZone Time zone\n * @param {boolean} dateTimeOptions.showTimeZone Show time zone in DateTime values\n * @param {boolean} dateTimeOptions.showTSeparator Show 'T' separator in DateTime values\n * @param {string} dateTimeOptions.defaultDateTimeFormatString DateTime format to use if columnFormats for DateTime isn't set\n */\n constructor(columnFormattingRules = [], dateTimeOptions = {}) {\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 [TableUtils.dataType.DECIMAL, new DecimalColumnFormatter()],\n [TableUtils.dataType.INT, new IntegerColumnFormatter()],\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"}
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;AACA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,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"}
@@ -7,5 +7,13 @@ declare class FormatterUtils {
7
7
  showTimeZone: any;
8
8
  showTSeparator: any;
9
9
  };
10
+ /**
11
+ * Check if the formatter has a custom format defined for the column name and type
12
+ * @param formatter Formatter to check
13
+ * @param columnName Column name
14
+ * @param columnType Column type
15
+ * @returns True, if a custom format is defined
16
+ */
17
+ static isCustomColumnFormatDefined(formatter: any, columnName: any, columnType: any): boolean;
10
18
  }
11
19
  //# sourceMappingURL=FormatterUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormatterUtils.d.ts","sourceRoot":"","sources":["../src/FormatterUtils.js"],"names":[],"mappings":";AAAA;IACE,4CAGC;IAED;;;;;MAaC;CACF"}
1
+ {"version":3,"file":"FormatterUtils.d.ts","sourceRoot":"","sources":["../src/FormatterUtils.js"],"names":[],"mappings":";AAEA;IACE,4CAGC;IAED;;;;;MAaC;IAED;;;;;;OAMG;IACH,8FAOC;CACF"}
@@ -1,3 +1,5 @@
1
+ import { TableColumnFormatter } from "./formatters/index.js";
2
+
1
3
  class FormatterUtils {
2
4
  static getColumnFormats(settings) {
3
5
  var {
@@ -20,6 +22,19 @@ class FormatterUtils {
20
22
  showTSeparator
21
23
  };
22
24
  }
25
+ /**
26
+ * Check if the formatter has a custom format defined for the column name and type
27
+ * @param formatter Formatter to check
28
+ * @param columnName Column name
29
+ * @param columnType Column type
30
+ * @returns True, if a custom format is defined
31
+ */
32
+
33
+
34
+ static isCustomColumnFormatDefined(formatter, columnName, columnType) {
35
+ var columnFormat = formatter.getColumnFormat(columnType, columnName);
36
+ return columnFormat != null && (columnFormat.type === TableColumnFormatter.TYPE_CONTEXT_PRESET || columnFormat.type === TableColumnFormatter.TYPE_CONTEXT_CUSTOM);
37
+ }
23
38
 
24
39
  }
25
40
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/FormatterUtils.js"],"names":["FormatterUtils","getColumnFormats","settings","formatter","getDateTimeFormatterOptions","timeZone","defaultDateTimeFormat","showTimeZone","showTSeparator","defaultDateTimeFormatString"],"mappings":"AAAA,MAAMA,cAAN,CAAqB;AACI,SAAhBC,gBAAgB,CAACC,QAAD,EAAW;AAChC,QAAM;AAAEC,MAAAA;AAAF,QAAgBD,QAAtB;AACA,WAAOC,SAAP;AACD;;AAEiC,SAA3BC,2BAA2B,CAACF,QAAD,EAAW;AAC3C,QAAM;AACJG,MAAAA,QADI;AAEJC,MAAAA,qBAFI;AAGJC,MAAAA,YAHI;AAIJC,MAAAA;AAJI,QAKFN,QALJ;AAMA,WAAO;AACLG,MAAAA,QADK;AAELI,MAAAA,2BAA2B,EAAEH,qBAFxB;AAGLC,MAAAA,YAHK;AAILC,MAAAA;AAJK,KAAP;AAMD;;AAnBkB;;AAsBrB,eAAeR,cAAf","sourcesContent":["class FormatterUtils {\n static getColumnFormats(settings) {\n const { formatter } = settings;\n return formatter;\n }\n\n static getDateTimeFormatterOptions(settings) {\n const {\n timeZone,\n defaultDateTimeFormat,\n showTimeZone,\n showTSeparator,\n } = settings;\n return {\n timeZone,\n defaultDateTimeFormatString: defaultDateTimeFormat,\n showTimeZone,\n showTSeparator,\n };\n }\n}\n\nexport default FormatterUtils;\n"],"file":"FormatterUtils.js"}
1
+ {"version":3,"sources":["../src/FormatterUtils.js"],"names":["TableColumnFormatter","FormatterUtils","getColumnFormats","settings","formatter","getDateTimeFormatterOptions","timeZone","defaultDateTimeFormat","showTimeZone","showTSeparator","defaultDateTimeFormatString","isCustomColumnFormatDefined","columnName","columnType","columnFormat","getColumnFormat","type","TYPE_CONTEXT_PRESET","TYPE_CONTEXT_CUSTOM"],"mappings":"SAASA,oB;;AAET,MAAMC,cAAN,CAAqB;AACI,SAAhBC,gBAAgB,CAACC,QAAD,EAAW;AAChC,QAAM;AAAEC,MAAAA;AAAF,QAAgBD,QAAtB;AACA,WAAOC,SAAP;AACD;;AAEiC,SAA3BC,2BAA2B,CAACF,QAAD,EAAW;AAC3C,QAAM;AACJG,MAAAA,QADI;AAEJC,MAAAA,qBAFI;AAGJC,MAAAA,YAHI;AAIJC,MAAAA;AAJI,QAKFN,QALJ;AAMA,WAAO;AACLG,MAAAA,QADK;AAELI,MAAAA,2BAA2B,EAAEH,qBAFxB;AAGLC,MAAAA,YAHK;AAILC,MAAAA;AAJK,KAAP;AAMD;AAED;AACF;AACA;AACA;AACA;AACA;AACA;;;AACoC,SAA3BE,2BAA2B,CAACP,SAAD,EAAYQ,UAAZ,EAAwBC,UAAxB,EAAoC;AACpE,QAAMC,YAAY,GAAGV,SAAS,CAACW,eAAV,CAA0BF,UAA1B,EAAsCD,UAAtC,CAArB;AACA,WACEE,YAAY,IAAI,IAAhB,KACCA,YAAY,CAACE,IAAb,KAAsBhB,oBAAoB,CAACiB,mBAA3C,IACCH,YAAY,CAACE,IAAb,KAAsBhB,oBAAoB,CAACkB,mBAF7C,CADF;AAKD;;AAnCkB;;AAsCrB,eAAejB,cAAf","sourcesContent":["import { TableColumnFormatter } from './formatters';\n\nclass FormatterUtils {\n static getColumnFormats(settings) {\n const { formatter } = settings;\n return formatter;\n }\n\n static getDateTimeFormatterOptions(settings) {\n const {\n timeZone,\n defaultDateTimeFormat,\n showTimeZone,\n showTSeparator,\n } = settings;\n return {\n timeZone,\n defaultDateTimeFormatString: defaultDateTimeFormat,\n showTimeZone,\n showTSeparator,\n };\n }\n\n /**\n * Check if the formatter has a custom format defined for the column name and type\n * @param formatter Formatter to check\n * @param columnName Column name\n * @param columnType Column type\n * @returns True, if a custom format is defined\n */\n static isCustomColumnFormatDefined(formatter, columnName, columnType) {\n const columnFormat = formatter.getColumnFormat(columnType, columnName);\n return (\n columnFormat != null &&\n (columnFormat.type === TableColumnFormatter.TYPE_CONTEXT_PRESET ||\n columnFormat.type === TableColumnFormatter.TYPE_CONTEXT_CUSTOM)\n );\n }\n}\n\nexport default FormatterUtils;\n"],"file":"FormatterUtils.js"}
@@ -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
  }
@@ -1 +1 @@
1
- {"version":3,"file":"IrisGrid.d.ts","sourceRoot":"","sources":["../src/IrisGrid.jsx"],"names":[],"mappings":"AAgHA;IACE,2BAAyB;IAEzB,2BAAyB;IAEzB,mCAAiC;IAEjC,wBAiQC;IAkwCD,yEAOC;IAED,2FA0BC;IAED,iCAEC;IAED,4CAEC;IAED,iDAeC;IA0TD;;;OAGG;IACH,gDAaC;IAhCD;;;O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X,OAAO,iBACP,OAAO,UACP,MAAM,GAAC,IAAI,QA0BrB;IAED,4DA6BC;IAED,oBAaC;IAED;;OAEG;IACH,iBA8BC;IAED;;;OAGG;IACH,eAFa,OAAO,CAInB;IAED,iCAcC;IAED,gCAcC;IAED,kCA0BC;IAED,wDAQC;IAmGD,uCASC;IAED,uBAWC;IAED,uDAeC;IAED,6FAYC;IAED,gCAIC;IAED,oBAGC;IAED,wCA2BC;IAED,wBAeC;IAED,+BAgCC;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
@@ -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) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
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 = {}; // When the loading scrim started/when it should extend to the end of the screen.
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;
@@ -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;