@deephaven/iris-grid 0.8.2-beta.6 → 0.9.1-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/AdvancedFilterCreatorSelectValueList.d.ts +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 -35
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +57 -37
- 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 +15 -12
- package/dist/IrisGrid.d.ts.map +1 -1
- package/dist/IrisGrid.js +24 -13
- 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/IrisGridModel.d.ts +23 -23
- package/dist/IrisGridModel.d.ts.map +1 -1
- package/dist/IrisGridModelFactory.d.ts +1 -1
- package/dist/IrisGridModelFactory.d.ts.map +1 -1
- package/dist/IrisGridProxyModel.d.ts +2 -2
- package/dist/IrisGridProxyModel.d.ts.map +1 -1
- package/dist/IrisGridTableModel.d.ts +5 -5
- package/dist/IrisGridTableModel.d.ts.map +1 -1
- package/dist/IrisGridTestUtils.d.ts +1 -1
- package/dist/IrisGridTestUtils.d.ts.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 +28 -28
- package/dist/IrisGridUtils.d.ts.map +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 +6 -5
- package/dist/formatters/DateTimeColumnFormatter.d.ts.map +1 -1
- package/dist/formatters/DateTimeColumnFormatter.js.map +1 -1
- package/dist/formatters/DecimalColumnFormatter.d.ts +2 -2
- package/dist/formatters/DecimalColumnFormatter.d.ts.map +1 -1
- 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 +2 -2
- package/dist/formatters/IntegerColumnFormatter.d.ts.map +1 -1
- package/dist/formatters/IntegerColumnFormatter.js.map +1 -1
- package/dist/formatters/index.d.ts +1 -0
- package/dist/formatters/index.d.ts.map +1 -1
- package/dist/formatters/index.js +1 -0
- 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 +17 -8
- 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/VisibilityOrderingBuilder.d.ts +1 -1
- package/dist/sidebar/VisibilityOrderingBuilder.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 +12 -13
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import TableColumnFormatter from './TableColumnFormatter';
|
|
2
2
|
/** Column formatter for chars */
|
|
3
|
-
declare class BooleanColumnFormatter extends TableColumnFormatter<
|
|
4
|
-
|
|
3
|
+
declare class BooleanColumnFormatter extends TableColumnFormatter<boolean | number> {
|
|
4
|
+
format(value: boolean | number): string;
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
export default BooleanColumnFormatter;
|
|
7
7
|
//# sourceMappingURL=BooleanColumnFormatter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BooleanColumnFormatter.d.ts","sourceRoot":"","sources":["../../src/formatters/BooleanColumnFormatter.
|
|
1
|
+
{"version":3,"file":"BooleanColumnFormatter.d.ts","sourceRoot":"","sources":["../../src/formatters/BooleanColumnFormatter.ts"],"names":[],"mappings":"AAEA,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAE1D,iCAAiC;AACjC,cAAM,sBAAuB,SAAQ,oBAAoB,CAAC,OAAO,GAAG,MAAM,CAAC;IACzE,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM;CAYxC;AAED,eAAe,sBAAsB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/formatters/BooleanColumnFormatter.
|
|
1
|
+
{"version":3,"sources":["../../src/formatters/BooleanColumnFormatter.ts"],"names":["TableColumnFormatter","BooleanColumnFormatter","format","value"],"mappings":"AAAA;;AACA;OACOA,oB;AAEP;;AACA,MAAMC,sBAAN,SAAqCD,oBAArC,CAA4E;AAC1EE,EAAAA,MAAM,CAACC,KAAD,EAAkC;AACtC,YAAQA,KAAR;AACE,WAAK,CAAL;AACA,WAAK,IAAL;AACE,eAAO,MAAP;;AACF,WAAK,CAAL;AACA,WAAK,KAAL;AACE,eAAO,OAAP;;AACF;AACE,eAAO,EAAP;AARJ;AAUD;;AAZyE;;AAe5E,eAAeF,sBAAf","sourcesContent":["/* eslint class-methods-use-this: \"off\" */\n/* eslint no-unused-vars: \"off\" */\nimport TableColumnFormatter from './TableColumnFormatter';\n\n/** Column formatter for chars */\nclass BooleanColumnFormatter extends TableColumnFormatter<boolean | number> {\n format(value: boolean | number): string {\n switch (value) {\n case 1:\n case true:\n return 'true';\n case 0:\n case false:\n return 'false';\n default:\n return '';\n }\n }\n}\n\nexport default BooleanColumnFormatter;\n"],"file":"BooleanColumnFormatter.js"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import TableColumnFormatter from './TableColumnFormatter';
|
|
2
2
|
/** Column formatter for chars */
|
|
3
|
-
declare class CharColumnFormatter extends TableColumnFormatter<
|
|
4
|
-
|
|
3
|
+
declare class CharColumnFormatter extends TableColumnFormatter<number> {
|
|
4
|
+
format(value: number): string;
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
export default CharColumnFormatter;
|
|
7
7
|
//# sourceMappingURL=CharColumnFormatter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CharColumnFormatter.d.ts","sourceRoot":"","sources":["../../src/formatters/CharColumnFormatter.
|
|
1
|
+
{"version":3,"file":"CharColumnFormatter.d.ts","sourceRoot":"","sources":["../../src/formatters/CharColumnFormatter.ts"],"names":[],"mappings":"AAEA,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAE1D,iCAAiC;AACjC,cAAM,mBAAoB,SAAQ,oBAAoB,CAAC,MAAM,CAAC;IAC5D,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;CAG9B;AAED,eAAe,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/formatters/CharColumnFormatter.
|
|
1
|
+
{"version":3,"sources":["../../src/formatters/CharColumnFormatter.ts"],"names":["TableColumnFormatter","CharColumnFormatter","format","value","String","fromCharCode"],"mappings":"AAAA;;AACA;OACOA,oB;AAEP;;AACA,MAAMC,mBAAN,SAAkCD,oBAAlC,CAA+D;AAC7DE,EAAAA,MAAM,CAACC,KAAD,EAAwB;AAC5B,WAAOC,MAAM,CAACC,YAAP,CAAoBF,KAApB,CAAP;AACD;;AAH4D;;AAM/D,eAAeF,mBAAf","sourcesContent":["/* eslint class-methods-use-this: \"off\" */\n/* eslint no-unused-vars: \"off\" */\nimport TableColumnFormatter from './TableColumnFormatter';\n\n/** Column formatter for chars */\nclass CharColumnFormatter extends TableColumnFormatter<number> {\n format(value: number): string {\n return String.fromCharCode(value);\n }\n}\n\nexport default CharColumnFormatter;\n"],"file":"CharColumnFormatter.js"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DateWrapper, TimeZone } from '@deephaven/jsapi-shim';
|
|
1
2
|
import TableColumnFormatter, { TableColumnFormat } from './TableColumnFormatter';
|
|
2
3
|
export declare type DateTimeColumnFormatterOptions = {
|
|
3
4
|
timeZone?: string;
|
|
@@ -5,7 +6,7 @@ export declare type DateTimeColumnFormatterOptions = {
|
|
|
5
6
|
showTSeparator?: boolean;
|
|
6
7
|
defaultDateTimeFormatString?: string;
|
|
7
8
|
};
|
|
8
|
-
export declare class DateTimeColumnFormatter extends TableColumnFormatter {
|
|
9
|
+
export declare class DateTimeColumnFormatter extends TableColumnFormatter<Date | DateWrapper | number> {
|
|
9
10
|
/**
|
|
10
11
|
* Validates format object
|
|
11
12
|
* @param format Format object
|
|
@@ -24,16 +25,16 @@ export declare class DateTimeColumnFormatter extends TableColumnFormatter {
|
|
|
24
25
|
static DEFAULT_TIME_ZONE_ID: string;
|
|
25
26
|
static makeGlobalFormatStringMap(showTimeZone: boolean, showTSeparator: boolean): Map<string, string>;
|
|
26
27
|
static getGlobalFormats(showTimeZone: boolean, showTSeparator: boolean): string[];
|
|
27
|
-
static makeFormatStringMap(showTimeZone
|
|
28
|
-
static getFormats(showTimeZone
|
|
29
|
-
dhTimeZone:
|
|
28
|
+
static makeFormatStringMap(showTimeZone?: boolean, showTSeparator?: boolean): Map<string, string>;
|
|
29
|
+
static getFormats(showTimeZone?: boolean, showTSeparator?: boolean): string[];
|
|
30
|
+
dhTimeZone: TimeZone;
|
|
30
31
|
defaultDateTimeFormatString: string;
|
|
31
32
|
showTimeZone: boolean;
|
|
32
33
|
showTSeparator: boolean;
|
|
33
34
|
formatStringMap: Map<string, string>;
|
|
34
35
|
constructor({ timeZone: timeZoneParam, showTimeZone, showTSeparator, defaultDateTimeFormatString, }?: DateTimeColumnFormatterOptions);
|
|
35
36
|
getEffectiveFormatString(baseFormatString: string): string;
|
|
36
|
-
format(value:
|
|
37
|
+
format(value: Date | DateWrapper | number, format?: TableColumnFormat): string;
|
|
37
38
|
}
|
|
38
39
|
export default DateTimeColumnFormatter;
|
|
39
40
|
//# sourceMappingURL=DateTimeColumnFormatter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimeColumnFormatter.d.ts","sourceRoot":"","sources":["../../src/formatters/DateTimeColumnFormatter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DateTimeColumnFormatter.d.ts","sourceRoot":"","sources":["../../src/formatters/DateTimeColumnFormatter.ts"],"names":[],"mappings":"AACA,OAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,oBAAoB,EAAE,EAC3B,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAIhC,oBAAY,8BAA8B,GAAG;IAE3C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,YAAY,CAAC,EAAE,OAAO,CAAC;IAGvB,cAAc,CAAC,EAAE,OAAO,CAAC;IAGzB,2BAA2B,CAAC,EAAE,MAAM,CAAC;CACtC,CAAC;AAEF,qBAAa,uBAAwB,SAAQ,oBAAoB,CAC/D,IAAI,GAAG,WAAW,GAAG,MAAM,CAC5B;IACC;;;;OAIG;IACH,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO;IASlD,MAAM,CAAC,UAAU,CACf,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,MAAM,EACpB,IAAI,yDAA2C,GAC9C,iBAAiB;IAQpB;;;;;OAKG;IACH,MAAM,CAAC,YAAY,CACjB,OAAO,CAAC,EAAE,iBAAiB,EAC3B,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO;IAUV,MAAM,CAAC,8BAA8B,SAA6B;IAElE,MAAM,CAAC,oBAAoB,SAAsB;IAEjD,MAAM,CAAC,yBAAyB,CAC9B,YAAY,EAAE,OAAO,EACrB,cAAc,EAAE,OAAO,GACtB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;IAatB,MAAM,CAAC,gBAAgB,CACrB,YAAY,EAAE,OAAO,EACrB,cAAc,EAAE,OAAO,GACtB,MAAM,EAAE;IAQX,MAAM,CAAC,mBAAmB,CACxB,YAAY,CAAC,EAAE,OAAO,EACtB,cAAc,CAAC,EAAE,OAAO,GACvB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;IAkBtB,MAAM,CAAC,UAAU,CACf,YAAY,CAAC,EAAE,OAAO,EACtB,cAAc,CAAC,EAAE,OAAO,GACvB,MAAM,EAAE;IAQX,UAAU,EAAE,QAAQ,CAAC;IAErB,2BAA2B,EAAE,MAAM,CAAC;IAEpC,YAAY,EAAE,OAAO,CAAC;IAEtB,cAAc,EAAE,OAAO,CAAC;IAExB,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;gBAEzB,EACV,QAAQ,EAAE,aAAkB,EAC5B,YAAmB,EACnB,cAAsB,EACtB,2BAAoF,GACrF,GAAE,8BAAmC;IAwBtC,wBAAwB,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM;IAI1D,MAAM,CACJ,KAAK,EAAE,IAAI,GAAG,WAAW,GAAG,MAAM,EAClC,MAAM,CAAC,EAAE,iBAAiB,GACzB,MAAM;CAeV;AAED,eAAe,uBAAuB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/formatters/DateTimeColumnFormatter.ts"],"names":["dh","Log","TableColumnFormatter","log","module","DateTimeColumnFormatter","isValid","format","i18n","DateTimeFormat","formatString","Date","e","makeFormat","label","type","TYPE_CONTEXT_PRESET","isSameFormat","formatA","formatB","makeGlobalFormatStringMap","showTimeZone","showTSeparator","separator","tz","Map","getGlobalFormats","formatStringMap","keys","makeFormatStringMap","getFormats","constructor","timeZone","timeZoneParam","defaultDateTimeFormatString","DEFAULT_DATETIME_FORMAT_STRING","DEFAULT_TIME_ZONE_ID","dhTimeZone","TimeZone","getTimeZone","error","getEffectiveFormatString","baseFormatString","get","value"],"mappings":";;AAAA;AACA,OAAOA,EAAP,
|
|
1
|
+
{"version":3,"sources":["../../src/formatters/DateTimeColumnFormatter.ts"],"names":["dh","Log","TableColumnFormatter","log","module","DateTimeColumnFormatter","isValid","format","i18n","DateTimeFormat","formatString","Date","e","makeFormat","label","type","TYPE_CONTEXT_PRESET","isSameFormat","formatA","formatB","makeGlobalFormatStringMap","showTimeZone","showTSeparator","separator","tz","Map","getGlobalFormats","formatStringMap","keys","makeFormatStringMap","getFormats","constructor","timeZone","timeZoneParam","defaultDateTimeFormatString","DEFAULT_DATETIME_FORMAT_STRING","DEFAULT_TIME_ZONE_ID","dhTimeZone","TimeZone","getTimeZone","error","getEffectiveFormatString","baseFormatString","get","value"],"mappings":";;AAAA;AACA,OAAOA,EAAP,MAA0C,uBAA1C;AACA,OAAOC,GAAP,MAAgB,gBAAhB;OACOC,oB;AAIP,IAAMC,GAAG,GAAGF,GAAG,CAACG,MAAJ,CAAW,yBAAX,CAAZ;AAgBA,OAAO,MAAMC,uBAAN,SAAsCH,oBAAtC,CAEL;AACA;AACF;AACA;AACA;AACA;AACgB,SAAPI,OAAO,CAACC,MAAD,EAAqC;AACjD,QAAI;AACFP,MAAAA,EAAE,CAACQ,IAAH,CAAQC,cAAR,CAAuBF,MAAvB,CAA8BA,MAAM,CAACG,YAArC,EAAmD,IAAIC,IAAJ,EAAnD;AACA,aAAO,IAAP;AACD,KAHD,CAGE,OAAOC,CAAP,EAAU;AACV,aAAO,KAAP;AACD;AACF;;AAEgB,SAAVC,UAAU,CACfC,KADe,EAEfJ,YAFe,EAII;AAAA,QADnBK,IACmB,uEADZb,oBAAoB,CAACc,mBACT;AACnB,WAAO;AACLF,MAAAA,KADK;AAELJ,MAAAA,YAFK;AAGLK,MAAAA;AAHK,KAAP;AAKD;AAED;AACF;AACA;AACA;AACA;AACA;;;AACqB,SAAZE,YAAY,CACjBC,OADiB,EAEjBC,OAFiB,EAGR;AACT,WACED,OAAO,KAAKC,OAAZ,IACCD,OAAO,IAAI,IAAX,IACCC,OAAO,IAAI,IADZ,IAECD,OAAO,CAACH,IAAR,KAAiBI,OAAO,CAACJ,IAF1B,IAGCG,OAAO,CAACR,YAAR,KAAyBS,OAAO,CAACT,YALrC;AAOD;;AAM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AM,CAACG,YAAlB,IAAmC,KAAKwB,2BAD1C;AAEA,QAAMxB,YAAY,GAAG,KAAK+B,wBAAL,CAA8BC,gBAA9B,CAArB;;AACA,QAAI;AACF,aAAO1C,EAAE,CAACQ,IAAH,CAAQC,cAAR,CAAuBF,MAAvB,CACLG,YADK,EAELkC,KAFK,EAGL,KAAKP,UAHA,CAAP;AAKD,KAND,CAME,OAAOzB,CAAP,EAAU;AACVT,MAAAA,GAAG,CAACqC,KAAJ,CAAU,0BAAV;AACD;;AACD,WAAO,EAAP;AACD;;AAzKD;;gBAFWnC,uB,oCAgD6B,yB;;gBAhD7BA,uB,0BAkDmB,kB;;AA4HhC,eAAeA,uBAAf","sourcesContent":["/* eslint class-methods-use-this: \"off\" */\nimport dh, { DateWrapper, TimeZone } from '@deephaven/jsapi-shim';\nimport Log from '@deephaven/log';\nimport TableColumnFormatter, {\n TableColumnFormat,\n} from './TableColumnFormatter';\n\nconst log = Log.module('DateTimeColumnFormatter');\n\nexport type DateTimeColumnFormatterOptions = {\n // Time zone\n timeZone?: string;\n\n // Show time zone in DateTime values\n showTimeZone?: boolean;\n\n // Show 'T' separator in DateTime values\n showTSeparator?: boolean;\n\n // DateTime format to use if columnFormats for DateTime isn't set\n defaultDateTimeFormatString?: string;\n};\n\nexport class DateTimeColumnFormatter extends TableColumnFormatter<\n Date | DateWrapper | number\n> {\n /**\n * Validates format object\n * @param format Format object\n * @returns true for valid object\n */\n static isValid(format: TableColumnFormat): boolean {\n try {\n dh.i18n.DateTimeFormat.format(format.formatString, new Date());\n return true;\n } catch (e) {\n return false;\n }\n }\n\n static makeFormat(\n label: string,\n formatString: string,\n type = TableColumnFormatter.TYPE_CONTEXT_PRESET\n ): TableColumnFormat {\n return {\n label,\n formatString,\n type,\n };\n }\n\n /**\n * Check if the given formats match\n * @param formatA format object to check\n * @param formatB format object to check\n * @returns True if the formats match\n */\n static isSameFormat(\n formatA?: TableColumnFormat,\n formatB?: TableColumnFormat\n ): boolean {\n return (\n formatA === formatB ||\n (formatA != null &&\n formatB != null &&\n formatA.type === formatB.type &&\n formatA.formatString === formatB.formatString)\n );\n }\n\n static DEFAULT_DATETIME_FORMAT_STRING = 'yyyy-MM-dd HH:mm:ss.SSS';\n\n static DEFAULT_TIME_ZONE_ID = 'America/New_York';\n\n static makeGlobalFormatStringMap(\n showTimeZone: boolean,\n showTSeparator: boolean\n ): Map<string, string> {\n const separator = showTSeparator ? `'T'` : ' ';\n const tz = showTimeZone ? ' z' : '';\n return new Map([\n ['yyyy-MM-dd HH:mm:ss', `yyyy-MM-dd${separator}HH:mm:ss${tz}`],\n ['yyyy-MM-dd HH:mm:ss.SSS', `yyyy-MM-dd${separator}HH:mm:ss.SSS${tz}`],\n [\n 'yyyy-MM-dd HH:mm:ss.SSSSSSSSS',\n `yyyy-MM-dd${separator}HH:mm:ss.SSSSSSSSS${tz}`,\n ],\n ]);\n }\n\n static getGlobalFormats(\n showTimeZone: boolean,\n showTSeparator: boolean\n ): string[] {\n const formatStringMap = DateTimeColumnFormatter.makeGlobalFormatStringMap(\n showTimeZone,\n showTSeparator\n );\n return [...formatStringMap.keys()];\n }\n\n static makeFormatStringMap(\n showTimeZone?: boolean,\n showTSeparator?: boolean\n ): Map<string, string> {\n const separator = showTSeparator ? `'T'` : ' ';\n const tz = showTimeZone ? ' z' : '';\n return new Map([\n ['yyyy-MM-dd', `yyyy-MM-dd${tz}`],\n ['MM-dd-yyyy', `MM-dd-yyyy${tz}`],\n ['HH:mm:ss', `HH:mm:ss${tz}`],\n ['HH:mm:ss.SSS', `HH:mm:ss.SSS${tz}`],\n ['HH:mm:ss.SSSSSSSSS', `HH:mm:ss.SSSSSSSSS${tz}`],\n ['yyyy-MM-dd HH:mm:ss', `yyyy-MM-dd${separator}HH:mm:ss${tz}`],\n ['yyyy-MM-dd HH:mm:ss.SSS', `yyyy-MM-dd${separator}HH:mm:ss.SSS${tz}`],\n [\n 'yyyy-MM-dd HH:mm:ss.SSSSSSSSS',\n `yyyy-MM-dd${separator}HH:mm:ss.SSSSSSSSS${tz}`,\n ],\n ]);\n }\n\n static getFormats(\n showTimeZone?: boolean,\n showTSeparator?: boolean\n ): string[] {\n const formatStringMap = DateTimeColumnFormatter.makeFormatStringMap(\n showTimeZone,\n showTSeparator\n );\n return [...formatStringMap.keys()];\n }\n\n dhTimeZone: TimeZone;\n\n defaultDateTimeFormatString: string;\n\n showTimeZone: boolean;\n\n showTSeparator: boolean;\n\n formatStringMap: Map<string, string>;\n\n constructor({\n timeZone: timeZoneParam = '',\n showTimeZone = true,\n showTSeparator = false,\n defaultDateTimeFormatString = DateTimeColumnFormatter.DEFAULT_DATETIME_FORMAT_STRING,\n }: DateTimeColumnFormatterOptions = {}) {\n super();\n\n const timeZone =\n timeZoneParam || DateTimeColumnFormatter.DEFAULT_TIME_ZONE_ID;\n\n try {\n this.dhTimeZone = dh.i18n.TimeZone.getTimeZone(timeZone);\n } catch (e) {\n log.error('Unsupported time zone id', timeZone);\n this.dhTimeZone = dh.i18n.TimeZone.getTimeZone(\n DateTimeColumnFormatter.DEFAULT_TIME_ZONE_ID\n );\n }\n\n this.defaultDateTimeFormatString = defaultDateTimeFormatString;\n this.showTimeZone = showTimeZone;\n this.showTSeparator = showTSeparator;\n this.formatStringMap = DateTimeColumnFormatter.makeFormatStringMap(\n showTimeZone,\n showTSeparator\n );\n }\n\n getEffectiveFormatString(baseFormatString: string): string {\n return this.formatStringMap.get(baseFormatString) || baseFormatString;\n }\n\n format(\n value: Date | DateWrapper | number,\n format?: TableColumnFormat\n ): string {\n const baseFormatString =\n (format && format.formatString) || this.defaultDateTimeFormatString;\n const formatString = this.getEffectiveFormatString(baseFormatString);\n try {\n return dh.i18n.DateTimeFormat.format(\n formatString,\n value,\n this.dhTimeZone\n );\n } catch (e) {\n log.error('Invalid format arguments');\n }\n return '';\n }\n}\n\nexport default DateTimeColumnFormatter;\n"],"file":"DateTimeColumnFormatter.js"}
|
|
@@ -5,7 +5,7 @@ export declare type DecimalColumnFormat = TableColumnFormat & {
|
|
|
5
5
|
export declare type DecimalColumnFormatterOptions = {
|
|
6
6
|
defaultFormatString?: string;
|
|
7
7
|
};
|
|
8
|
-
export declare class DecimalColumnFormatter extends TableColumnFormatter {
|
|
8
|
+
export declare class DecimalColumnFormatter extends TableColumnFormatter<number> {
|
|
9
9
|
/**
|
|
10
10
|
* Validates format object
|
|
11
11
|
* @param format Format object
|
|
@@ -58,7 +58,7 @@ export declare class DecimalColumnFormatter extends TableColumnFormatter {
|
|
|
58
58
|
* @param format Format object
|
|
59
59
|
* @returns Formatted string
|
|
60
60
|
*/
|
|
61
|
-
format(valueParam: number, format
|
|
61
|
+
format(valueParam: number, format?: DecimalColumnFormat): string;
|
|
62
62
|
}
|
|
63
63
|
export default DecimalColumnFormatter;
|
|
64
64
|
//# sourceMappingURL=DecimalColumnFormatter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecimalColumnFormatter.d.ts","sourceRoot":"","sources":["../../src/formatters/DecimalColumnFormatter.ts"],"names":[],"mappings":"AAGA,OAAO,oBAAoB,EAAE,EAC3B,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAIhC,oBAAY,mBAAmB,GAAG,iBAAiB,GAAG;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,oBAAY,6BAA6B,GAAG;IAE1C,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,qBAAa,sBAAuB,SAAQ,oBAAoB;
|
|
1
|
+
{"version":3,"file":"DecimalColumnFormatter.d.ts","sourceRoot":"","sources":["../../src/formatters/DecimalColumnFormatter.ts"],"names":[],"mappings":"AAGA,OAAO,oBAAoB,EAAE,EAC3B,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAIhC,oBAAY,mBAAmB,GAAG,iBAAiB,GAAG;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,oBAAY,6BAA6B,GAAG;IAE1C,mBAA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alColumnFormatter","isValid","format","i18n","NumberFormat","formatString","e","makeFormat","label","type","TYPE_CONTEXT_PRESET","multiplier","makePresetFormat","makeCustomFormat","TYPE_CONTEXT_CUSTOM","isSameFormat","formatA","formatB","constructor","defaultFormatString","DEFAULT_FORMAT_STRING","valueParam","value","error"],"mappings":";;AAAA;AACA,OAAOA,EAAP,MAAe,uBAAf;AACA,OAAOC,GAAP,MAAgB,gBAAhB;OACOC,oB;AAIP,IAAMC,GAAG,GAAGF,GAAG,CAACG,MAAJ,CAAW,wBAAX,CAAZ;AAWA,OAAO,MAAMC,sBAAN,SAAqCH,oBAArC,
|
|
1
|
+
{"version":3,"sources":["../../src/formatters/DecimalColumnFormatter.ts"],"names":["dh","Log","TableColumnFormatter","log","module","DecimalColumnFormatter","isValid","format","i18n","NumberFormat","formatString","e","makeFormat","label","type","TYPE_CONTEXT_PRESET","multiplier","makePresetFormat","makeCustomFormat","TYPE_CONTEXT_CUSTOM","isSameFormat","formatA","formatB","constructor","defaultFormatString","DEFAULT_FORMAT_STRING","valueParam","value","error"],"mappings":";;AAAA;AACA,OAAOA,EAAP,MAAe,uBAAf;AACA,OAAOC,GAAP,MAAgB,gBAAhB;OACOC,oB;AAIP,IAAMC,GAAG,GAAGF,GAAG,CAACG,MAAJ,CAAW,wBAAX,CAAZ;AAWA,OAAO,MAAMC,sBAAN,SAAqCH,oBAArC,CAAkE;AACvE;AACF;AACA;AACA;AACA;AACgB,SAAPI,OAAO,CAACC,MAAD,EAAqC;AACjD,QAAI;AACFP,MAAAA,EAAE,CAACQ,IAAH,CAAQC,YAAR,CAAqBF,MAArB,CAA4BA,MAAM,CAACG,YAAnC,EAAiD,CAAjD;AACA,aAAO,IAAP;AACD,KAHD,CAGE,OAAOC,CAAP,EAAU;AACV,aAAO,KAAP;AACD;AACF;AAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;;;AACmB,SAAVC,UAAU,CACfC,KADe,EAEfH,YAFe,EAKM;AAAA,QAFrBI,IAEqB,uE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GACfH,MAAM,IAAIA,MAAM,CAACG,YAAlB,IAAmC,KAAKc,mBAD1C;AAEA,QAAMG,KAAK,GACTpB,MAAM,IAAIA,MAAM,CAACS,UAAjB,GAA8BU,UAAU,GAAGnB,MAAM,CAACS,UAAlD,GAA+DU,UADjE;;AAEA,QAAI;AACF,aAAO1B,EAAE,CAACQ,IAAH,CAAQC,YAAR,CAAqBF,MAArB,CAA4BG,YAA5B,EAA0CiB,KAA1C,CAAP;AACD,KAFD,CAEE,OAAOhB,CAAP,EAAU;AACVR,MAAAA,GAAG,CAACyB,KAAJ,CAAU,0BAAV;AACD;;AACD,WAAO,EAAP;AACD;;AA5JsE;;gBAA5DvB,sB,2BA2EoB,c;;gBA3EpBA,sB,oBA6EaA,sBAAsB,CAACY,gBAAvB,CACtB,SADsB,EAEtB,SAFsB,C;;gBA7EbZ,sB,yBAkFkBA,sBAAsB,CAACY,gBAAvB,CAC3B,cAD2B,EAE3B,YAF2B,EAG3B,KAH2B,C;;gBAlFlBZ,sB,qBAwFcA,sBAAsB,CAACY,gBAAvB,CACvB,UADuB,EAEvB,gBAFuB,EAGvB,QAHuB,C;;gBAxFdZ,sB,kBA8FWA,sBAAsB,CAACY,gBAAvB,CACpB,OADoB,EAEpB,SAFoB,C;;gBA9FXZ,sB,+BAmGwBA,sBAAsB,CAACY,gBAAvB,CACjC,MADiC,EAEjC,YAFiC,C;;gBAnGxBZ,sB,gCAwGyBA,sBAAsB,CAACY,gBAAvB,CAClC,QADkC,EAElC,cAFkC,C;;AAuDtC,eAAeZ,sBAAf","sourcesContent":["/* eslint class-methods-use-this: \"off\" */\nimport dh from '@deephaven/jsapi-shim';\nimport Log from '@deephaven/log';\nimport TableColumnFormatter, {\n TableColumnFormat,\n} from './TableColumnFormatter';\n\nconst log = Log.module('DecimalColumnFormatter');\n\nexport type DecimalColumnFormat = TableColumnFormat & {\n multiplier?: number;\n};\n\nexport type DecimalColumnFormatterOptions = {\n // Default format string to use. Defaults to DecimalColumnFormatter.DEFAULT_FORMAT_STRING\n defaultFormatString?: string;\n};\n\nexport class DecimalColumnFormatter extends TableColumnFormatter<number> {\n /**\n * Validates format object\n * @param format Format object\n * @returns true for valid object\n */\n static isValid(format: TableColumnFormat): boolean {\n try {\n dh.i18n.NumberFormat.format(format.formatString, 0);\n return true;\n } catch (e) {\n return false;\n }\n }\n\n /**\n * Create a DecimalColumnFormat object with the parameters specified\n * @param label Label for the format\n * @param formatString Format string for the format\n * @param multiplier Optional multiplier for the formatter\n * @param type Type of format created\n * @returns DecimalColumnFormat object\n */\n static makeFormat(\n label: string,\n formatString: string,\n type = TableColumnFormatter.TYPE_CONTEXT_PRESET,\n multiplier?: number\n ): DecimalColumnFormat {\n return {\n label,\n type,\n formatString,\n multiplier,\n };\n }\n\n /**\n * Convenient function to create a DecimalFormatObject with Preset type set\n * @param label Label for this format object\n * @param formatString Format string to use\n * @param multiplier Multiplier to use\n * @returns DecimalColumnFormat object\n */\n static makePresetFormat(\n label: string,\n formatString = '',\n multiplier?: number\n ): DecimalColumnFormat {\n return DecimalColumnFormatter.makeFormat(\n label,\n formatString,\n TableColumnFormatter.TYPE_CONTEXT_PRESET,\n multiplier\n );\n }\n\n /**\n * Convenient function to create a DecimalFormatObject with a default 'Custom Format' label and Custom type\n * @param formatString Format string to use\n * @param multiplier Multiplier to use\n * @returns DecimalColumnFormat object\n */\n static makeCustomFormat(\n formatString = '',\n multiplier?: number\n ): DecimalColumnFormat {\n return DecimalColumnFormatter.makeFormat(\n 'Custom Format',\n formatString,\n TableColumnFormatter.TYPE_CONTEXT_CUSTOM,\n multiplier\n );\n }\n\n static DEFAULT_FORMAT_STRING = '###,##0.0000';\n\n static FORMAT_PERCENT = DecimalColumnFormatter.makePresetFormat(\n 'Percent',\n '##0.00%'\n );\n\n static FORMAT_BASIS_POINTS = DecimalColumnFormatter.makePresetFormat(\n 'Basis Points',\n '###,##0 bp',\n 10000\n );\n\n static FORMAT_MILLIONS = DecimalColumnFormatter.makePresetFormat(\n 'Millions',\n '###,##0.000 mm',\n 0.000001\n );\n\n static FORMAT_ROUND = DecimalColumnFormatter.makePresetFormat(\n 'Round',\n '###,##0'\n );\n\n static FORMAT_ROUND_TWO_DECIMALS = DecimalColumnFormatter.makePresetFormat(\n '0.00',\n '###,##0.00'\n );\n\n static FORMAT_ROUND_FOUR_DECIMALS = DecimalColumnFormatter.makePresetFormat(\n '0.0000',\n '###,##0.0000'\n );\n\n /**\n * Check if the given formats match\n * @param formatA format object to check\n * @param formatB format object to check\n * @returns True if the formats match\n */\n static isSameFormat(\n formatA?: DecimalColumnFormat,\n formatB?: DecimalColumnFormat\n ): boolean {\n return (\n formatA === formatB ||\n (formatA != null &&\n formatB != null &&\n formatA.type === formatB.type &&\n formatA.formatString === formatB.formatString &&\n formatA.multiplier === formatB.multiplier)\n );\n }\n\n defaultFormatString: string;\n\n constructor({\n defaultFormatString = DecimalColumnFormatter.DEFAULT_FORMAT_STRING,\n }: DecimalColumnFormatterOptions = {}) {\n super();\n\n this.defaultFormatString = defaultFormatString;\n }\n\n /**\n * Format a value with the provided format object\n * @param valueParam Value to format\n * @param format Format object\n * @returns Formatted string\n */\n format(valueParam: number, format?: DecimalColumnFormat): string {\n const formatString =\n (format && format.formatString) || this.defaultFormatString;\n const value =\n format && format.multiplier ? valueParam * format.multiplier : valueParam;\n try {\n return dh.i18n.NumberFormat.format(formatString, value);\n } catch (e) {\n log.error('Invalid format arguments');\n }\n return '';\n }\n}\n\nexport default DecimalColumnFormatter;\n"],"file":"DecimalColumnFormatter.js"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
declare class DefaultColumnFormatter extends TableColumnFormatter
|
|
3
|
-
|
|
1
|
+
import TableColumnFormatter from './TableColumnFormatter';
|
|
2
|
+
declare class DefaultColumnFormatter extends TableColumnFormatter {
|
|
3
|
+
format(value: unknown): string;
|
|
4
4
|
}
|
|
5
|
-
|
|
5
|
+
export default DefaultColumnFormatter;
|
|
6
6
|
//# sourceMappingURL=DefaultColumnFormatter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultColumnFormatter.d.ts","sourceRoot":"","sources":["../../src/formatters/DefaultColumnFormatter.
|
|
1
|
+
{"version":3,"file":"DefaultColumnFormatter.d.ts","sourceRoot":"","sources":["../../src/formatters/DefaultColumnFormatter.ts"],"names":[],"mappings":"AAEA,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAE1D,cAAM,sBAAuB,SAAQ,oBAAoB;IACvD,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM;CAG/B;AAED,eAAe,sBAAsB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/formatters/DefaultColumnFormatter.
|
|
1
|
+
{"version":3,"sources":["../../src/formatters/DefaultColumnFormatter.ts"],"names":["TableColumnFormatter","DefaultColumnFormatter","format","value"],"mappings":"AAAA;;AACA;OACOA,oB;;AAEP,MAAMC,sBAAN,SAAqCD,oBAArC,CAA0D;AACxDE,EAAAA,MAAM,CAACC,KAAD,EAAyB;AAC7B,qBAAUA,KAAV;AACD;;AAHuD;;AAM1D,eAAeF,sBAAf","sourcesContent":["/* eslint class-methods-use-this: \"off\" */\n/* eslint no-unused-vars: \"off\" */\nimport TableColumnFormatter from './TableColumnFormatter';\n\nclass DefaultColumnFormatter extends TableColumnFormatter {\n format(value: unknown): string {\n return `${value}`;\n }\n}\n\nexport default DefaultColumnFormatter;\n"],"file":"DefaultColumnFormatter.js"}
|
|
@@ -6,7 +6,7 @@ export declare type IntegerColumnFormatterOptions = {
|
|
|
6
6
|
defaultFormatString?: string;
|
|
7
7
|
};
|
|
8
8
|
/** Column formatter for integers/whole numbers */
|
|
9
|
-
export declare class IntegerColumnFormatter extends TableColumnFormatter {
|
|
9
|
+
export declare class IntegerColumnFormatter extends TableColumnFormatter<number> {
|
|
10
10
|
/**
|
|
11
11
|
* Validates format object
|
|
12
12
|
* @param format Format object
|
|
@@ -54,7 +54,7 @@ export declare class IntegerColumnFormatter extends TableColumnFormatter {
|
|
|
54
54
|
* @param format Format object
|
|
55
55
|
* @returns Formatted string
|
|
56
56
|
*/
|
|
57
|
-
format(valueParam: number, format
|
|
57
|
+
format(valueParam: number, format?: IntegerColumnFormat): string;
|
|
58
58
|
}
|
|
59
59
|
export default IntegerColumnFormatter;
|
|
60
60
|
//# sourceMappingURL=IntegerColumnFormatter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntegerColumnFormatter.d.ts","sourceRoot":"","sources":["../../src/formatters/IntegerColumnFormatter.ts"],"names":[],"mappings":"AAGA,OAAO,oBAAoB,EAAE,EAC3B,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAIhC,oBAAY,mBAAmB,GAAG,iBAAiB,GAAG;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,oBAAY,6BAA6B,GAAG;IAE1C,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,kDAAkD;AAClD,qBAAa,sBAAuB,SAAQ,oBAAoB;
|
|
1
|
+
{"version":3,"file":"IntegerColumnFormatter.d.ts","sourceRoot":"","sources":["../../src/formatters/IntegerColumnFormatter.ts"],"names":[],"mappings":"AAGA,OAAO,oBAAoB,EAAE,EAC3B,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAIhC,oBAAY,mBAAmB,GAAG,iBAAiB,GAAG;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,oBAAY,6BAA6B,GAAG;IAE1C,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,kDAAkD;AAClD,qBAAa,sBAAuB,SAAQ,oBAAoB,CAAC,MAAM,CAAC;IACtE;;;;OAIG;IACH,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO;IASpD;;;;;;;OAOG;IACH,MAAM,CAAC,UAAU,CACf,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,MAAM,EACpB,IAAI,yDAA2C,EAC/C,UAAU,CAAC,EAAE,MAAM,GAClB,mBAAmB;IAStB;;;;;;OAMG;IACH,MAAM,CAAC,gBAAgB,CACrB,KAAK,EAAE,MAAM,EACb,YAAY,SAAK,EACjB,UAAU,CAAC,EAAE,MAAM,GAClB,mBAAmB;IAStB;;;;;OAKG;IACH,MAAM,CAAC,gBAAgB,CACrB,YAAY,SAAK,EACjB,UAAU,CAAC,EAAE,MAAM,GAClB,mBAAmB;IAStB;;;;;OAKG;IACH,MAAM,CAAC,YAAY,CACjB,OAAO,CAAC,EAAE,mBAAmB,EAC7B,OAAO,CAAC,EAAE,mBAAmB,GAC5B,OAAO;IAWV,MAAM,CAAC,qBAAqB,SAAa;IAEzC,MAAM,CAAC,eAAe,sBAIpB;IAEF,mBAAmB,EAAE,MAAM,CAAC;gBAEhB,EACV,mBAAkE,GACnE,GAAE,6BAAkC;IAMrC;;;;;OAKG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,mBAAmB,GAAG,MAAM;CAYjE;AAED,eAAe,sBAAsB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/formatters/IntegerColumnFormatter.ts"],"names":["dh","Log","TableColumnFormatter","log","module","IntegerColumnFormatter","isValid","format","i18n","NumberFormat","formatString","e","makeFormat","label","type","TYPE_CONTEXT_PRESET","multiplier","makePresetFormat","makeCustomFormat","TYPE_CONTEXT_CUSTOM","isSameFormat","formatA","formatB","constructor","defaultFormatString","DEFAULT_FORMAT_STRING","valueParam","value","error"],"mappings":";;AAAA;AACA,OAAOA,EAAP,MAAe,uBAAf;AACA,OAAOC,GAAP,MAAgB,gBAAhB;OACOC,oB;AAIP,IAAMC,GAAG,GAAGF,GAAG,CAACG,MAAJ,CAAW,wBAAX,CAAZ;;AAWA;AACA,OAAO,MAAMC,sBAAN,SAAqCH,oBAArC,
|
|
1
|
+
{"version":3,"sources":["../../src/formatters/IntegerColumnFormatter.ts"],"names":["dh","Log","TableColumnFormatter","log","module","IntegerColumnFormatter","isValid","format","i18n","NumberFormat","formatString","e","makeFormat","label","type","TYPE_CONTEXT_PRESET","multiplier","makePresetFormat","makeCustomFormat","TYPE_CONTEXT_CUSTOM","isSameFormat","formatA","formatB","constructor","defaultFormatString","DEFAULT_FORMAT_STRING","valueParam","value","error"],"mappings":";;AAAA;AACA,OAAOA,EAAP,MAAe,uBAAf;AACA,OAAOC,GAAP,MAAgB,gBAAhB;OACOC,oB;AAIP,IAAMC,GAAG,GAAGF,GAAG,CAACG,MAAJ,CAAW,wBAAX,CAAZ;;AAWA;AACA,OAAO,MAAMC,sBAAN,SAAqCH,oBAArC,CAAkE;AACvE;AACF;AACA;AACA;AACA;AACgB,SAAPI,OAAO,CAACC,MAAD,EAAuC;AACnD,QAAI;AACFP,MAAAA,EAAE,CAACQ,IAAH,CAAQC,YAAR,CAAqBF,MAArB,CAA4BA,MAAM,CAACG,YAAnC,EAAiD,CAAjD;AACA,aAAO,IAAP;AACD,KAHD,CAGE,OAAOC,CAAP,EAAU;AACV,aAAO,KAAP;AACD;AACF;AAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;;;AACmB,SAAVC,UAAU,CACfC,KADe,EAEfH,YAFe,EAKM;AAAA,QAFrBI,IAEqB,uEAFdZ,oBAAoB,CAACa,mBAEP;AAAA,QADrBC,UACqB;AACrB,WAAO;AACLH,MAAAA,KADK;AAELC,MAAAA,IAFK;AAGLJ,MAAAA,YAHK;AAILM,MAAAA;AAJK,KAAP;AAMD;AAED;AACF;AACA;AACA;AACA;AACA;AACA;;;AACyB,SAAhBC,gBAAgB,CACrBJ,KADqB,EAIA;AAAA,QAFrBH,YAEqB,uEAFN,EAEM;AAAA,QADrBM,UACqB;AACrB,WAAOX,sBAAsB,CAACO,UAAvB,CACLC,KADK,EAELH,YAFK,EAGLR,oBAAoB,CAACa,mBAHhB,EAILC,UAJK,CAAP;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AAP;AACD;;AAlIsE;;gBAA5DvB,sB,2BA+FoB,S;;gBA/FpBA,sB,qBAiGcA,sBAAsB,CAACY,gBAAvB,CACvB,UADuB,EAEvB,gBAFuB,EAGvB,QAHuB,C;;AAoC3B,eAAeZ,sBAAf","sourcesContent":["/* eslint class-methods-use-this: \"off\" */\nimport dh from '@deephaven/jsapi-shim';\nimport Log from '@deephaven/log';\nimport TableColumnFormatter, {\n TableColumnFormat,\n} from './TableColumnFormatter';\n\nconst log = Log.module('IntegerColumnFormatter');\n\nexport type IntegerColumnFormat = TableColumnFormat & {\n multiplier?: number;\n};\n\nexport type IntegerColumnFormatterOptions = {\n // Default format string to use. Defaults to IntegerColumnFormatter.DEFAULT_FORMAT_STRING\n defaultFormatString?: string;\n};\n\n/** Column formatter for integers/whole numbers */\nexport class IntegerColumnFormatter extends TableColumnFormatter<number> {\n /**\n * Validates format object\n * @param format Format object\n * @returns true for valid object\n */\n static isValid(format: IntegerColumnFormat): boolean {\n try {\n dh.i18n.NumberFormat.format(format.formatString, 0);\n return true;\n } catch (e) {\n return false;\n }\n }\n\n /**\n * Create an IntegerColumnFormat object with the parameters specified\n * @param label Label for the format\n * @param formatString Format string for the format\n * @param multiplier Optional multiplier for the formatter\n * @param type Type of format created\n * @returns IntegerColumnFormat object\n */\n static makeFormat(\n label: string,\n formatString: string,\n type = TableColumnFormatter.TYPE_CONTEXT_PRESET,\n multiplier?: number\n ): IntegerColumnFormat {\n return {\n label,\n type,\n formatString,\n multiplier,\n };\n }\n\n /**\n * Convenient function to create a IntegerFormatObject with Preset type set\n * @param label Label for this format object\n * @param formatString Format string to use\n * @param multiplier Multiplier to use\n * @returns IntegerColumnFormat object\n */\n static makePresetFormat(\n label: string,\n formatString = '',\n multiplier?: number\n ): IntegerColumnFormat {\n return IntegerColumnFormatter.makeFormat(\n label,\n formatString,\n TableColumnFormatter.TYPE_CONTEXT_PRESET,\n multiplier\n );\n }\n\n /**\n * Convenient function to create a IntegerFormatObject with a default 'Custom Format' label and Custom type\n * @param formatString Format string to use\n * @param multiplier Multiplier to use\n * @returns IntegerColumnFormat object\n */\n static makeCustomFormat(\n formatString = '',\n multiplier?: number\n ): IntegerColumnFormat {\n return IntegerColumnFormatter.makeFormat(\n 'Custom Format',\n formatString,\n TableColumnFormatter.TYPE_CONTEXT_CUSTOM,\n multiplier\n );\n }\n\n /**\n * Check if the given formats match\n * @param formatA format object to check\n * @param formatB format object to check\n * @returns True if the formats match\n */\n static isSameFormat(\n formatA?: IntegerColumnFormat,\n formatB?: IntegerColumnFormat\n ): boolean {\n return (\n formatA === formatB ||\n (formatA != null &&\n formatB != null &&\n formatA.type === formatB.type &&\n formatA.formatString === formatB.formatString &&\n formatA.multiplier === formatB.multiplier)\n );\n }\n\n static DEFAULT_FORMAT_STRING = '###,##0';\n\n static FORMAT_MILLIONS = IntegerColumnFormatter.makePresetFormat(\n 'Millions',\n '###,##0.000 mm',\n 0.000001\n );\n\n defaultFormatString: string;\n\n constructor({\n defaultFormatString = IntegerColumnFormatter.DEFAULT_FORMAT_STRING,\n }: IntegerColumnFormatterOptions = {}) {\n super();\n\n this.defaultFormatString = defaultFormatString;\n }\n\n /**\n * Format a value with the provided format object\n * @param valueParam Value to format\n * @param format Format object\n * @returns Formatted string\n */\n format(valueParam: number, format?: IntegerColumnFormat): string {\n const formatString =\n (format && format.formatString) || this.defaultFormatString;\n const value =\n format && format.multiplier ? valueParam * format.multiplier : valueParam;\n try {\n return dh.i18n.NumberFormat.format(formatString, value);\n } catch (e) {\n log.error('Invalid format arguments');\n }\n return '';\n }\n}\n\nexport default IntegerColumnFormatter;\n"],"file":"IntegerColumnFormatter.js"}
|
|
@@ -5,4 +5,5 @@ export * from './DecimalColumnFormatter';
|
|
|
5
5
|
export { default as DefaultColumnFormatter } from './DefaultColumnFormatter';
|
|
6
6
|
export * from './IntegerColumnFormatter';
|
|
7
7
|
export { default as TableColumnFormatter } from './TableColumnFormatter';
|
|
8
|
+
export * from './TableColumnFormatter';
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/formatters/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/formatters/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,cAAc,wBAAwB,CAAC"}
|
package/dist/formatters/index.js
CHANGED
|
@@ -5,4 +5,5 @@ export * from "./DecimalColumnFormatter.js";
|
|
|
5
5
|
export { default as DefaultColumnFormatter } from "./DefaultColumnFormatter.js";
|
|
6
6
|
export * from "./IntegerColumnFormatter.js";
|
|
7
7
|
export { default as TableColumnFormatter } from "./TableColumnFormatter.js";
|
|
8
|
+
export * from "./TableColumnFormatter.js";
|
|
8
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/formatters/index.ts"],"names":["default","BooleanColumnFormatter","CharColumnFormatter","DefaultColumnFormatter","TableColumnFormatter"],"mappings":"SAASA,OAAO,IAAIC,sB;SACXD,OAAO,IAAIE,mB;;;SAGXF,OAAO,IAAIG,sB;;SAEXH,OAAO,IAAII,oB","sourcesContent":["export { default as BooleanColumnFormatter } from './BooleanColumnFormatter';\nexport { default as CharColumnFormatter } from './CharColumnFormatter';\nexport * from './DateTimeColumnFormatter';\nexport * from './DecimalColumnFormatter';\nexport { default as DefaultColumnFormatter } from './DefaultColumnFormatter';\nexport * from './IntegerColumnFormatter';\nexport { default as TableColumnFormatter } from './TableColumnFormatter';\n"],"file":"index.js"}
|
|
1
|
+
{"version":3,"sources":["../../src/formatters/index.ts"],"names":["default","BooleanColumnFormatter","CharColumnFormatter","DefaultColumnFormatter","TableColumnFormatter"],"mappings":"SAASA,OAAO,IAAIC,sB;SACXD,OAAO,IAAIE,mB;;;SAGXF,OAAO,IAAIG,sB;;SAEXH,OAAO,IAAII,oB","sourcesContent":["export { default as BooleanColumnFormatter } from './BooleanColumnFormatter';\nexport { default as CharColumnFormatter } from './CharColumnFormatter';\nexport * from './DateTimeColumnFormatter';\nexport * from './DecimalColumnFormatter';\nexport { default as DefaultColumnFormatter } from './DefaultColumnFormatter';\nexport * from './IntegerColumnFormatter';\nexport { default as TableColumnFormatter } from './TableColumnFormatter';\nexport * from './TableColumnFormatter';\n"],"file":"index.js"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as DateUtils } from "./DateUtils";
|
|
2
2
|
export { default as Formatter } from "./Formatter";
|
|
3
|
+
export * from "./Formatter";
|
|
3
4
|
export { default as FormatterUtils } from "./FormatterUtils";
|
|
4
5
|
export { default as SHORTCUTS } from "./IrisGridShortcuts";
|
|
5
6
|
export { default as IrisGridModel } from "./IrisGridModel";
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as DateUtils } from "./DateUtils.js";
|
|
2
2
|
export { default as Formatter } from "./Formatter.js";
|
|
3
|
+
export * from "./Formatter.js";
|
|
3
4
|
export { default as FormatterUtils } from "./FormatterUtils.js";
|
|
4
5
|
export { default as IrisGrid } from "./IrisGrid.js";
|
|
5
6
|
export { default as SHORTCUTS } from "./IrisGridShortcuts.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":["default","DateUtils","Formatter","FormatterUtils","IrisGrid","SHORTCUTS","IrisGridModel","IrisGridTableModel","IrisGridModelFactory","IrisGridTheme","IrisGridUtils","TableUtils"],"mappings":"SAASA,OAAO,IAAIC,S;SACXD,OAAO,IAAIE,S
|
|
1
|
+
{"version":3,"sources":["../src/index.js"],"names":["default","DateUtils","Formatter","FormatterUtils","IrisGrid","SHORTCUTS","IrisGridModel","IrisGridTableModel","IrisGridModelFactory","IrisGridTheme","IrisGridUtils","TableUtils"],"mappings":"SAASA,OAAO,IAAIC,S;SACXD,OAAO,IAAIE,S;;SAEXF,OAAO,IAAIG,c;SACXH,OAAO,IAAII,Q;SACXJ,OAAO,IAAIK,S;SACXL,OAAO,IAAIM,a;SACXN,OAAO,IAAIO,kB;SACXP,OAAO,IAAIQ,oB;SACXR,OAAO,IAAIS,a;SACXT,OAAO,IAAIU,a;SACXV,OAAO,IAAIW,U;SAEXX,O","sourcesContent":["export { default as DateUtils } from './DateUtils';\nexport { default as Formatter } from './Formatter';\nexport * from './Formatter';\nexport { default as FormatterUtils } from './FormatterUtils';\nexport { default as IrisGrid } from './IrisGrid';\nexport { default as SHORTCUTS } from './IrisGridShortcuts';\nexport { default as IrisGridModel } from './IrisGridModel';\nexport { default as IrisGridTableModel } from './IrisGridTableModel';\nexport { default as IrisGridModelFactory } from './IrisGridModelFactory';\nexport { default as IrisGridTheme } from './IrisGridTheme';\nexport { default as IrisGridUtils } from './IrisGridUtils';\nexport { default as TableUtils } from './TableUtils';\n\nexport { default } from './IrisGrid';\n"],"file":"index.js"}
|
|
@@ -22,7 +22,7 @@ declare class IrisGridContextMenuHandler extends GridMouseHandler {
|
|
|
22
22
|
* @param {FilterCondition} newColumnFilter
|
|
23
23
|
* @param {boolean} additive
|
|
24
24
|
*/
|
|
25
|
-
static getQuickFilterCondition(columnFilter:
|
|
25
|
+
static getQuickFilterCondition(columnFilter: FilterCondition, newColumnFilter: FilterCondition, additive?: boolean): any;
|
|
26
26
|
/**
|
|
27
27
|
* combines filter text with '&&' if filters are additive
|
|
28
28
|
* @param {String} filterText
|
|
@@ -35,21 +35,30 @@ declare class IrisGridContextMenuHandler extends GridMouseHandler {
|
|
|
35
35
|
* @param {dh.Column} column The column to make the filter for
|
|
36
36
|
* @param {Number} value The value to get the equality filter for
|
|
37
37
|
*/
|
|
38
|
-
static getNumberValueEqualsFilter(column:
|
|
39
|
-
static getFilterValueForNumberOrChar(columnType: any, value: any):
|
|
38
|
+
static getNumberValueEqualsFilter(column: dh.Column, value: number): any;
|
|
39
|
+
static getFilterValueForNumberOrChar(columnType: any, value: any): import("@deephaven/jsapi-shim").FilterValue;
|
|
40
40
|
constructor(irisGrid: any);
|
|
41
41
|
debouncedUpdateCustomFormat: import("lodash").DebouncedFunc<any>;
|
|
42
42
|
irisGrid: any;
|
|
43
43
|
componentWillUnmount(): void;
|
|
44
44
|
dateFormatActions(column: any): {
|
|
45
|
-
title:
|
|
46
|
-
description:
|
|
45
|
+
title: string;
|
|
46
|
+
description: string;
|
|
47
47
|
icon: import("@fortawesome/fontawesome-common-types").IconDefinition | null;
|
|
48
|
-
group:
|
|
48
|
+
group: number;
|
|
49
49
|
order: number;
|
|
50
50
|
action: () => void;
|
|
51
51
|
}[];
|
|
52
|
-
numberFormatActions(column: any):
|
|
52
|
+
numberFormatActions(column: any): {
|
|
53
|
+
icon: import("@fortawesome/fontawesome-common-types").IconDefinition | null;
|
|
54
|
+
order: number;
|
|
55
|
+
action: () => void;
|
|
56
|
+
title: string;
|
|
57
|
+
description: string;
|
|
58
|
+
group: number;
|
|
59
|
+
format: import("../formatters").TableColumnFormat | null;
|
|
60
|
+
isSelected: boolean;
|
|
61
|
+
}[] | null;
|
|
53
62
|
stringFilterActions(column: any, valueText: any, value: any, quickFilter?: {}, additive?: boolean): ({
|
|
54
63
|
menuElement: JSX.Element;
|
|
55
64
|
order: number;
|
|
@@ -141,7 +150,7 @@ declare class IrisGridContextMenuHandler extends GridMouseHandler {
|
|
|
141
150
|
action: () => void;
|
|
142
151
|
menuElement?: undefined;
|
|
143
152
|
})[];
|
|
144
|
-
checkColumnSort(columnSort: any, direction?:
|
|
153
|
+
checkColumnSort(columnSort: any, direction?: null, isAbs?: boolean): boolean;
|
|
145
154
|
}
|
|
146
155
|
import { GridMouseHandler } from "@deephaven/grid";
|
|
147
156
|
//# sourceMappingURL=IrisGridContextMenuHandler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IrisGridContextMenuHandler.d.ts","sourceRoot":"","sources":["../../src/mousehandlers/IrisGridContextMenuHandler.jsx"],"names":[],"mappings":";AA4BA;;GAEG;AACH;IACE,0BAAoD;IAEpD,kCAA4D;IAE5D,4BAAsD;IAEtD,0BAAoD;IAEpD,0BAAqD;IAErD,4BAAuD;IAEvD;;;;MAIE;IAEF;;;;;;;OAOG;IACH,
|
|
1
|
+
{"version":3,"file":"IrisGridContextMenuHandler.d.ts","sourceRoot":"","sources":["../../src/mousehandlers/IrisGridContextMenuHandler.jsx"],"names":[],"mappings":";AA4BA;;GAEG;AACH;IACE,0BAAoD;IAEpD,kCAA4D;IAE5D,4BAAsD;IAEtD,0BAAoD;IAEpD,0BAAqD;IAErD,4BAAuD;IAEvD;;;;MAIE;IAEF;;;;;;;OAOG;IACH,2GAFW,OAAO,OAWjB;IAED;;;;;OAKG;IACH,gFAFW,OAAO,UAMjB;IAED;;;;OAIG;IACH,yEAqBC;IAED,+GAIC;IAED,2BASC;IANC,iEAGC;IAED,cAAwB;IAG1B,6BAEC;IA6ZD;;;;;;;QA8BC;IAED;;;;;;;;;eA8CC;IAED;;;;;;;;;;;;SA+IC;IAED;;;;;;;;;;;;SAmKC;IAED;;;;;;;;;;;;SA4EC;IAED;;;;;;;;;;;;SAgJC;IAED;;;;;;;;;;;;SAwDC;IAED;;;;;;;;;;;;;;SA6FC;IAED;;;;;;;;;;SA0EC;IAED,6EAKC;CACF"}
|
|
@@ -3,7 +3,7 @@ export default ChartBuilder;
|
|
|
3
3
|
* Form for configuring all the settings when creating a console.
|
|
4
4
|
*/
|
|
5
5
|
declare class ChartBuilder extends React.PureComponent<any, any, any> {
|
|
6
|
-
static types: import("
|
|
6
|
+
static types: import("@deephaven/jsapi-shim").SeriesPlotStyle[];
|
|
7
7
|
/**
|
|
8
8
|
* Converts the provided chart type into a readable type.
|
|
9
9
|
* Just replaces underscores with spaces and capitals the first letter of each word.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartBuilder.d.ts","sourceRoot":"","sources":["../../src/sidebar/ChartBuilder.jsx"],"names":[],"mappings":";AA4BA;;GAEG;AACH;IACE,
|
|
1
|
+
{"version":3,"file":"ChartBuilder.d.ts","sourceRoot":"","sources":["../../src/sidebar/ChartBuilder.jsx"],"names":[],"mappings":";AA4BA;;GAEG;AACH;IACE,gEAOE;IAEF;;;OAGG;IACH,mCAeC;IAED,kDAeC;IAED,iDASC;IAED,8DASC;IAED,sDAOC;IAED;;;MAEC;IAED;;;QAQC;IAED,qDAMC;IAED,wBAgCC;IAED,wBAmBC;IAED,wCAEC;IAED,oBAYC;IAED,qCAiBC;IAED,0CAgBC;IAED,+BAOC;IAED,kCAuBC;IAED,oCAOC;IAED,mBAMC;CAgJF"}
|
|
@@ -17,7 +17,7 @@ declare class TableCsvExporter extends React.Component<any, any, any> {
|
|
|
17
17
|
LAST: string;
|
|
18
18
|
};
|
|
19
19
|
static DEFAULT_DOWNLOAD_ROWS: number;
|
|
20
|
-
static getDateString():
|
|
20
|
+
static getDateString(): string;
|
|
21
21
|
constructor(props: any);
|
|
22
22
|
handleDownloadClick(): void;
|
|
23
23
|
handleDownloadOptionChanged(event: any): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableCsvExporter.d.ts","sourceRoot":"","sources":["../../src/sidebar/TableCsvExporter.jsx"],"names":[],"mappings":";AAaA;IACE,oCAAkD;IAElD;;;;;MAKE;IAEF;;;;MAIE;IAEF;;;MAGE;IAEF,qCAAmC;IAEnC
|
|
1
|
+
{"version":3,"file":"TableCsvExporter.d.ts","sourceRoot":"","sources":["../../src/sidebar/TableCsvExporter.jsx"],"names":[],"mappings":";AAaA;IACE,oCAAkD;IAElD;;;;;MAKE;IAEF;;;;MAIE;IAEF;;;MAGE;IAEF,qCAAmC;IAEnC,+BAKC;IAED,wBAyBC;IAwDD,4BA2BC;IAED,8CAEC;IAED,wDAEC;IAED,sDAEC;IA7FD,2BAgDC;IAED,2BAEC;IA2CD,+BAkCC;CAmLF;;;;;;;;;;;;;;;QAgBkB,0CAAQ"}
|
|
@@ -29,7 +29,7 @@ declare class VisibilityOrderingBuilder extends React.Component<any, any, any> {
|
|
|
29
29
|
searchColumns(searchFilter: any): void;
|
|
30
30
|
handleVisibilityKeyDown(modelIndex: any, visibilityOption: any): void;
|
|
31
31
|
handleVisibilityDraggingStart(modelIndex: any, visibilityOption: any, event: any): void;
|
|
32
|
-
handleVisibilityDraggingEnd(event?:
|
|
32
|
+
handleVisibilityDraggingEnd(event?: null): void;
|
|
33
33
|
handleMouseEnter(targetModelIndex: any, event: any): void;
|
|
34
34
|
handleMoveColumns(option: any): void;
|
|
35
35
|
handleSortColumns(option: any): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VisibilityOrderingBuilder.d.ts","sourceRoot":"","sources":["../../src/sidebar/VisibilityOrderingBuilder.jsx"],"names":[],"mappings":";AA6BA;IACE;;;MAA2D;IAE3D;;;MAAoD;IAEpD;;;;;MAKE;IAEF;;;MAAsE;IAEtE,wBAuBC;IAmCD,0CASC;IA/DC,oFAGC;IAiIH,2CAwBC;IAED,0CA0EC;IAtNC,4BAAgB;IAOlB,gCAkBC;IAED,uBAOC;IAaD,uCA0BC;IAED,sEAGC;IAED,wFAmBC;IAED
|
|
1
|
+
{"version":3,"file":"VisibilityOrderingBuilder.d.ts","sourceRoot":"","sources":["../../src/sidebar/VisibilityOrderingBuilder.jsx"],"names":[],"mappings":";AA6BA;IACE;;;MAA2D;IAE3D;;;MAAoD;IAEpD;;;;;MAKE;IAEF;;;MAAsE;IAEtE,wBAuBC;IAmCD,0CASC;IA/DC,oFAGC;IAiIH,2CAwBC;IAED,0CA0EC;IAtNC,4BAAgB;IAOlB,gCAkBC;IAED,uBAOC;IAaD,uCA0BC;IAED,sEAGC;IAED,wFAmBC;IAED,gDAWC;IAwGD,0DAiEC;IAED,qCA0GC;IAED,qCA+CC;IAED,4FAuDC;IAED,0EAaC;IAED,gDAkBC;IAED,4CAkDC;IAED,oIAQG;IAEH,mIAQG;IAEH,6GAMG;IAEH,0WA6FE;CAkLH;;;;;;;;;;;;;;;QAiB4B,oDAAQ;;QACZ,gDAAQ"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import type { Column } from '@deephaven/jsapi-shim';
|
|
2
3
|
import { Aggregation } from './Aggregations';
|
|
3
4
|
import './AggregationEdit.scss';
|
|
4
5
|
export declare type AggregationEditProps = {
|
|
5
6
|
aggregation: Aggregation;
|
|
6
|
-
columns:
|
|
7
|
-
name: string;
|
|
8
|
-
type: string;
|
|
9
|
-
}[];
|
|
7
|
+
columns: Column[];
|
|
10
8
|
onChange: (aggregation: Aggregation) => void;
|
|
11
9
|
};
|
|
12
10
|
declare const AggregationEdit: ({ aggregation, columns, onChange, }: AggregationEditProps) => JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AggregationEdit.d.ts","sourceRoot":"","sources":["../../../src/sidebar/aggregations/AggregationEdit.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,wBAAwB,CAAC;AAQhC,oBAAY,oBAAoB,GAAG;IACjC,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE
|
|
1
|
+
{"version":3,"file":"AggregationEdit.d.ts","sourceRoot":"","sources":["../../../src/sidebar/aggregations/AggregationEdit.tsx"],"names":[],"mappings":";AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,wBAAwB,CAAC;AAQhC,oBAAY,oBAAoB,GAAG;IACjC,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,CAAC;CAC9C,CAAC;AAUF,QAAA,MAAM,eAAe,wCAIlB,oBAAoB,KAAG,WA2IzB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/sidebar/aggregations/AggregationEdit.tsx"],"names":["React","useCallback","useMemo","useRef","useState","classNames","CSSTransition","Button","Checkbox","ItemList","ThemeExport","dhSortAlphaDown","dhSortAlphaUp","filterValidColumns","TableUtils","SortType","DEFAULT_ROW_HEIGHT","AggregationEdit","aggregation","columns","onChange","top","setTop","bottom","setBottom","sort","setSort","NONE","invert","selected","list","isSelected","name","includes","validColumns","filteredColumns","operation","sortColumns","ASCENDING","items","slice","map","c","value","displayValue","handleSelect","itemIndex","selectedIndex","indexOf","newSelected","newInvert","splice","push","length","handleReset","handleViewportChange","newTop","newBottom","toggleAll","checked","isModified","transitionSlowMs","active","DESCENDING","item"],"mappings":";;;;;;AAAA,OAAOA,KAAP,IAAgBC,WAAhB,EAA6BC,OAA7B,EAAsCC,MAAtC,EAA8CC,Q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AME,IAAA,OAAO,EAAC,iBANV;AAOE,IAAA,OAAO,EAAE,MAAMc,OAAO,CAACX,QAAQ,CAACgD,UAAV;AAPxB,IAzBF,CADF,CADF,eAsCE;AAAK,IAAA,SAAS,EAAC;AAAf,kBACE,oBAAC,QAAD;AACE,IAAA,SAAS,EAAE7B,YAAY,CAACmB,MAD1B;AAEE,IAAA,KAAK,EAAEd,KAFT;AAGE,IAAA,MAAM,EAAElB,GAHV;AAIE,IAAA,UAAU,EAAE;AAAA,UAAC;AAAE2C,QAAAA;AAAF,OAAD;AAAA,0BACV,oBAAC,QAAD;AAAU,QAAA,OAAO,EAAEjC,UAAU,CAACiC,IAAI,CAACrB,KAAN;AAA7B,SACGqB,IAAI,CAACpB,YADR,CADU;AAAA,KAJd;AASE,IAAA,QAAQ,EAAEC,YATZ;AAUE,IAAA,gBAAgB,EAAEU,oBAVpB;AAWE,IAAA,SAAS,EAAEvC,kBAXb;AAYE,IAAA,aAAa,EAAC,OAZhB;AAaE,IAAA,GAAG,EAAEc;AAbP,IADF,CAtCF,CADF;AA0DD,CA/ID;;AAiJA,eAAeb,eAAf","sourcesContent":["import React, { useCallback, useMemo, useRef, useState } from 'react';\nimport classNames from 'classnames';\nimport { CSSTransition } from 'react-transition-group';\nimport { Button, Checkbox, ItemList, ThemeExport } from '@deephaven/components';\nimport { dhSortAlphaDown, dhSortAlphaUp } from '@deephaven/icons';\nimport { Aggregation } from './Aggregations';\nimport { filterValidColumns } from './AggregationUtils';\nimport './AggregationEdit.scss';\nimport TableUtils from '../../TableUtils';\n\ninterface AggregationEditItem {\n value: string;\n displayValue: string;\n}\n\nexport type AggregationEditProps = {\n aggregation: Aggregation;\n columns: { name: string; type: string }[];\n onChange: (aggregation: Aggregation) => void;\n};\n\nenum SortType {\n NONE,\n ASCENDING,\n DESCENDING,\n}\n\nconst DEFAULT_ROW_HEIGHT = 30;\n\nconst AggregationEdit = ({\n aggregation,\n columns,\n onChange,\n}: AggregationEditProps): JSX.Element => {\n const [top, setTop] = useState(-1);\n const [bottom, setBottom] = useState(-1);\n const [sort, setSort] = useState(SortType.NONE);\n const { invert, selected } = aggregation;\n const list = useRef<ItemList<AggregationEditItem>>(null);\n\n const isSelected = useCallback(\n name => (selected.includes(name) ? !invert : invert),\n [invert, selected]\n );\n\n const validColumns = useMemo(() => {\n let filteredColumns = filterValidColumns(columns, aggregation.operation);\n if (sort !== SortType.NONE) {\n filteredColumns = TableUtils.sortColumns(\n filteredColumns,\n sort === SortType.ASCENDING\n );\n }\n return filteredColumns;\n }, [columns, aggregation.operation, sort]);\n\n const items = useMemo(\n () =>\n top >= 0\n ? validColumns.slice(top, bottom + 1).map(c => ({\n value: c.name,\n displayValue: c.name,\n isSelected: isSelected(c.name),\n }))\n : [],\n [validColumns, isSelected, bottom, top]\n );\n\n const handleSelect = useCallback(\n itemIndex => {\n const { name } = validColumns[itemIndex];\n const selectedIndex = selected.indexOf(name);\n let newSelected = [...selected];\n let newInvert = invert;\n if (selectedIndex >= 0) {\n newSelected.splice(selectedIndex, 1);\n } else {\n newSelected.push(name);\n if (newSelected.length === validColumns.length) {\n // Every item is either selected or deselected, flip the inversion bit\n newSelected = [];\n newInvert = !invert;\n }\n }\n\n onChange({ ...aggregation, selected: newSelected, invert: newInvert });\n },\n [aggregation, invert, validColumns, selected, onChange]\n );\n\n const handleReset = useCallback(() => {\n setSort(SortType.NONE);\n onChange({ ...aggregation, selected: [], invert: true });\n }, [aggregation, onChange]);\n\n const handleViewportChange = useCallback(\n (newTop, newBottom) => {\n setTop(newTop);\n setBottom(newBottom);\n },\n [setTop, setBottom]\n );\n\n const toggleAll = useCallback(() => {\n if (selected.length === 0) {\n onChange({ ...aggregation, invert: !invert });\n } else {\n onChange({ ...aggregation, selected: [], invert: true });\n }\n }, [aggregation, invert, onChange, selected]);\n\n const checked = selected.length === 0 ? invert : null;\n const isModified = selected.length !== 0 || !invert || sort !== SortType.NONE;\n\n return (\n <div role=\"menu\" className=\"aggregation-edit\">\n <div className=\"top-menu\">\n <div className=\"form-inline\">\n <Checkbox checked={checked} onChange={toggleAll}>\n Toggle All\n </Checkbox>\n <div className=\"spacer\" />\n <CSSTransition\n in={isModified}\n timeout={ThemeExport.transitionSlowMs}\n classNames=\"fade\"\n mountOnEnter\n unmountOnExit\n >\n <Button kind=\"ghost\" className=\"btn-reset\" onClick={handleReset}>\n Reset\n </Button>\n </CSSTransition>\n <Button\n kind=\"ghost\"\n className={classNames({\n active: sort === SortType.ASCENDING,\n })}\n icon={dhSortAlphaDown}\n tooltip=\"Sort ascending\"\n onClick={() => setSort(SortType.ASCENDING)}\n />\n <Button\n kind=\"ghost\"\n className={classNames({\n active: sort === SortType.DESCENDING,\n })}\n icon={dhSortAlphaUp}\n tooltip=\"Sort descending\"\n onClick={() => setSort(SortType.DESCENDING)}\n />\n </div>\n </div>\n <div className=\"aggregation-edit-item-list\">\n <ItemList\n itemCount={validColumns.length}\n items={items}\n offset={top}\n renderItem={({ item }) => (\n <Checkbox checked={isSelected(item.value)}>\n {item.displayValue}\n </Checkbox>\n )}\n onSelect={handleSelect}\n onViewportChange={handleViewportChange}\n rowHeight={DEFAULT_ROW_HEIGHT}\n focusSelector=\"input\"\n ref={list}\n />\n </div>\n </div>\n );\n};\n\nexport default AggregationEdit;\n"],"file":"AggregationEdit.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/sidebar/aggregations/AggregationEdit.tsx"],"names":["React","useCallback","useMemo","useRef","useState","classNames","CSSTransition","Button","Checkbox","ItemList","ThemeExport","dhSortAlphaDown","dhSortAlphaUp","filterValidColumns","TableUtils","SortType","DEFAULT_ROW_HEIGHT","AggregationEdit","aggregation","columns","onChange","top","setTop","bottom","setBottom","sort","setSort","NONE","invert","selected","list","isSelected","name","includes","validColumns","filteredColumns","operation","sortColumns","ASCENDING","items","slice","map","c","value","displayValue","handleSelect","itemIndex","selectedIndex","indexOf","newSelected","newInvert","splice","push","length","handleReset","handleViewportChange","newTop","newBottom","toggleAll","checked","isModified","transitionSlowMs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AACpByD,MAAAA,MAAM,EAAErC,IAAI,KAAKV,QAAQ,CAACgD;AADN,KAAD,CAFvB;AAKE,IAAA,IAAI,EAAEnD,aALR;AAME,IAAA,OAAO,EAAC,iBANV;AAOE,IAAA,OAAO,EAAE,MAAMc,OAAO,CAACX,QAAQ,CAACgD,UAAV;AAPxB,IAzBF,CADF,CADF,eAsCE;AAAK,IAAA,SAAS,EAAC;AAAf,kBACE,oBAAC,QAAD;AACE,IAAA,SAAS,EAAE7B,YAAY,CAACmB,MAD1B;AAEE,IAAA,KAAK,EAAEd,KAFT;AAGE,IAAA,MAAM,EAAElB,GAHV;AAIE,IAAA,UAAU,EAAE;AAAA,UAAC;AAAE2C,QAAAA;AAAF,OAAD;AAAA,0BACV,oBAAC,QAAD;AAAU,QAAA,OAAO,EAAEjC,UAAU,CAACiC,IAAI,CAACrB,KAAN;AAA7B,SACGqB,IAAI,CAACpB,YADR,CADU;AAAA,KAJd;AASE,IAAA,QAAQ,EAAEC,YATZ;AAUE,IAAA,gBAAgB,EAAEU,oBAVpB;AAWE,IAAA,SAAS,EAAEvC,kBAXb;AAYE,IAAA,aAAa,EAAC,OAZhB;AAaE,IAAA,GAAG,EAAEc;AAbP,IADF,CAtCF,CADF;AA0DD,CA/ID;;AAiJA,eAAeb,eAAf","sourcesContent":["import React, { useCallback, useMemo, useRef, useState } from 'react';\nimport classNames from 'classnames';\nimport { CSSTransition } from 'react-transition-group';\nimport { Button, Checkbox, ItemList, ThemeExport } from '@deephaven/components';\nimport { dhSortAlphaDown, dhSortAlphaUp } from '@deephaven/icons';\nimport type { Column } from '@deephaven/jsapi-shim';\nimport { Aggregation } from './Aggregations';\nimport { filterValidColumns } from './AggregationUtils';\nimport './AggregationEdit.scss';\nimport TableUtils from '../../TableUtils';\n\ninterface AggregationEditItem {\n value: string;\n displayValue: string;\n}\n\nexport type AggregationEditProps = {\n aggregation: Aggregation;\n columns: Column[];\n onChange: (aggregation: Aggregation) => void;\n};\n\nenum SortType {\n NONE,\n ASCENDING,\n DESCENDING,\n}\n\nconst DEFAULT_ROW_HEIGHT = 30;\n\nconst AggregationEdit = ({\n aggregation,\n columns,\n onChange,\n}: AggregationEditProps): JSX.Element => {\n const [top, setTop] = useState(-1);\n const [bottom, setBottom] = useState(-1);\n const [sort, setSort] = useState(SortType.NONE);\n const { invert, selected } = aggregation;\n const list = useRef<ItemList<AggregationEditItem>>(null);\n\n const isSelected = useCallback(\n name => (selected.includes(name) ? !invert : invert),\n [invert, selected]\n );\n\n const validColumns = useMemo(() => {\n let filteredColumns = filterValidColumns(columns, aggregation.operation);\n if (sort !== SortType.NONE) {\n filteredColumns = TableUtils.sortColumns(\n filteredColumns,\n sort === SortType.ASCENDING\n );\n }\n return filteredColumns;\n }, [columns, aggregation.operation, sort]);\n\n const items = useMemo(\n () =>\n top >= 0\n ? validColumns.slice(top, bottom + 1).map(c => ({\n value: c.name,\n displayValue: c.name,\n isSelected: isSelected(c.name),\n }))\n : [],\n [validColumns, isSelected, bottom, top]\n );\n\n const handleSelect = useCallback(\n itemIndex => {\n const { name } = validColumns[itemIndex];\n const selectedIndex = selected.indexOf(name);\n let newSelected = [...selected];\n let newInvert = invert;\n if (selectedIndex >= 0) {\n newSelected.splice(selectedIndex, 1);\n } else {\n newSelected.push(name);\n if (newSelected.length === validColumns.length) {\n // Every item is either selected or deselected, flip the inversion bit\n newSelected = [];\n newInvert = !invert;\n }\n }\n\n onChange({ ...aggregation, selected: newSelected, invert: newInvert });\n },\n [aggregation, invert, validColumns, selected, onChange]\n );\n\n const handleReset = useCallback(() => {\n setSort(SortType.NONE);\n onChange({ ...aggregation, selected: [], invert: true });\n }, [aggregation, onChange]);\n\n const handleViewportChange = useCallback(\n (newTop, newBottom) => {\n setTop(newTop);\n setBottom(newBottom);\n },\n [setTop, setBottom]\n );\n\n const toggleAll = useCallback(() => {\n if (selected.length === 0) {\n onChange({ ...aggregation, invert: !invert });\n } else {\n onChange({ ...aggregation, selected: [], invert: true });\n }\n }, [aggregation, invert, onChange, selected]);\n\n const checked = selected.length === 0 ? invert : null;\n const isModified = selected.length !== 0 || !invert || sort !== SortType.NONE;\n\n return (\n <div role=\"menu\" className=\"aggregation-edit\">\n <div className=\"top-menu\">\n <div className=\"form-inline\">\n <Checkbox checked={checked} onChange={toggleAll}>\n Toggle All\n </Checkbox>\n <div className=\"spacer\" />\n <CSSTransition\n in={isModified}\n timeout={ThemeExport.transitionSlowMs}\n classNames=\"fade\"\n mountOnEnter\n unmountOnExit\n >\n <Button kind=\"ghost\" className=\"btn-reset\" onClick={handleReset}>\n Reset\n </Button>\n </CSSTransition>\n <Button\n kind=\"ghost\"\n className={classNames({\n active: sort === SortType.ASCENDING,\n })}\n icon={dhSortAlphaDown}\n tooltip=\"Sort ascending\"\n onClick={() => setSort(SortType.ASCENDING)}\n />\n <Button\n kind=\"ghost\"\n className={classNames({\n active: sort === SortType.DESCENDING,\n })}\n icon={dhSortAlphaUp}\n tooltip=\"Sort descending\"\n onClick={() => setSort(SortType.DESCENDING)}\n />\n </div>\n </div>\n <div className=\"aggregation-edit-item-list\">\n <ItemList\n itemCount={validColumns.length}\n items={items}\n offset={top}\n renderItem={({ item }) => (\n <Checkbox checked={isSelected(item.value)}>\n {item.displayValue}\n </Checkbox>\n )}\n onSelect={handleSelect}\n onViewportChange={handleViewportChange}\n rowHeight={DEFAULT_ROW_HEIGHT}\n focusSelector=\"input\"\n ref={list}\n />\n </div>\n </div>\n );\n};\n\nexport default AggregationEdit;\n"],"file":"AggregationEdit.js"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Column } from '@deephaven/jsapi-shim';
|
|
1
2
|
import AggregationOperation from './AggregationOperation';
|
|
2
3
|
/**
|
|
3
4
|
* Check if an operation requires a rollup/table grouping
|
|
@@ -11,10 +12,6 @@ export declare const isRollupOperation: (type: AggregationOperation) => boolean;
|
|
|
11
12
|
* @param columnType The column type to check against
|
|
12
13
|
*/
|
|
13
14
|
export declare const isValidOperation: (operationType: AggregationOperation, columnType: string) => boolean;
|
|
14
|
-
declare type Column = {
|
|
15
|
-
type: string;
|
|
16
|
-
name: string;
|
|
17
|
-
};
|
|
18
15
|
export declare const filterValidColumns: (columns: Column[], operationType: AggregationOperation) => Column[];
|
|
19
16
|
export declare const getOperationColumnNames: (columns: Column[], operationType: AggregationOperation, selected: string[], invert: boolean) => string[];
|
|
20
17
|
declare const _default: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AggregationUtils.d.ts","sourceRoot":"","sources":["../../../src/sidebar/aggregations/AggregationUtils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AggregationUtils.d.ts","sourceRoot":"","sources":["../../../src/sidebar/aggregations/AggregationUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAE1D;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,SAAU,oBAAoB,KAAG,OAM9D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,kBACZ,oBAAoB,cACvB,MAAM,KACjB,OA0BF,CAAC;AAEF,eAAO,MAAM,kBAAkB,YACpB,MAAM,EAAE,iBACF,oBAAoB,KAClC,MAAM,EAAkE,CAAC;AAE5E,eAAO,MAAM,uBAAuB,YACzB,MAAM,EAAE,iBACF,oBAAoB,YACzB,MAAM,EAAE,UACV,OAAO,KACd,MAAM,EAGwD,CAAC;;;;;;AAElE,wBAIE"}
|