@deephaven/jsapi-utils 1.7.2-beta.1 → 1.7.2-beta.3
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/ConnectionUtils.js +2 -2
- package/dist/ConnectionUtils.js.map +1 -1
- package/dist/DateUtils.js.map +1 -1
- package/dist/FilterUtils.js.map +1 -1
- package/dist/Formatter.d.ts +2 -2
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +3 -3
- package/dist/Formatter.js.map +1 -1
- package/dist/FormatterUtils.d.ts +1 -1
- package/dist/FormatterUtils.d.ts.map +1 -1
- package/dist/FormatterUtils.js.map +1 -1
- package/dist/MessageUtils.js.map +1 -1
- package/dist/NewTableColumnTypes.js.map +1 -1
- package/dist/NoConsolesError.js.map +1 -1
- package/dist/SessionUtils.js.map +1 -1
- package/dist/Settings.d.ts +1 -1
- package/dist/Settings.d.ts.map +1 -1
- package/dist/Settings.js.map +1 -1
- package/dist/TableUtils.js +8 -11
- package/dist/TableUtils.js.map +1 -1
- package/dist/ViewportDataUtils.d.ts +1 -1
- package/dist/ViewportDataUtils.d.ts.map +1 -1
- package/dist/ViewportDataUtils.js.map +1 -1
- package/dist/formatters/BooleanColumnFormatter.js.map +1 -1
- package/dist/formatters/CharColumnFormatter.js.map +1 -1
- package/dist/formatters/DateTimeColumnFormatter.js.map +1 -1
- package/dist/formatters/DecimalColumnFormatter.js +10 -8
- package/dist/formatters/DecimalColumnFormatter.js.map +1 -1
- package/dist/formatters/DefaultColumnFormatter.js.map +1 -1
- package/dist/formatters/IntegerColumnFormatter.js +5 -3
- package/dist/formatters/IntegerColumnFormatter.js.map +1 -1
- package/dist/formatters/StringColumnFormatter.js.map +1 -1
- package/dist/formatters/TableColumnFormatter.js.map +1 -1
- package/dist/formatters/index.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewportDataUtils.js","names":["clamp","Log","ITEM_KEY_PREFIX","log","module","createKeyedItemKey","index","concat","createOnTableUpdatedHandler","_ref","deserializeRow","bulkUpdate","onTableUpdated","event","columns","offset","rows","detail","debug","updateKeyMap","Map","forEach","row","offsetInSnapshot","item","key","set","defaultRowDeserializer","reduce","result","col","name","get","generateEmptyKeyedItems","start","end","i","getSize","table","isClosed","size","widget","padFirstAndLastRow","firstRow","viewportSize","padding","tableSize","lastRow","min","max","first","last"],"sources":["../src/ViewportDataUtils.ts"],"sourcesContent":["import type { Key } from 'react';\nimport clamp from 'lodash.clamp';\nimport type { dh } from '@deephaven/jsapi-types';\nimport Log from '@deephaven/log';\nimport { type KeyedItem, type ValueOf } from '@deephaven/utils';\n\nexport const ITEM_KEY_PREFIX = 'DH_ITEM_KEY';\n\nexport type OnTableUpdatedEvent = dh.Event<{\n offset: number;\n columns: dh.Column[];\n rows: dh.Row[];\n}>;\n\nexport type RowDeserializer<T> = (row: dh.Row, columns: dh.Column[]) => T;\n\nconst log = Log.module('ViewportDataUtils');\n\n/**\n * Create a `KeyedItem.key` for a given index. The prefix is necessary to avoid\n * collisions with property values in the `item` property that may be used as\n * keys once the item is loaded and rendered.\n * @param index Index to create a key for.\n * @returns A unique key for the given index.\n */\nexport function createKeyedItemKey(index: number): string {\n return `${ITEM_KEY_PREFIX}_${index}`;\n}\n\n/**\n * Creates a handler function for a `dh.Table.EVENT_UPDATED` event. Rows that\n * get passed to the handler will be bulk updated in the given `viewportData`\n * object based on their derived item keys.\n * @param viewportData State object for managing a list of KeyedItem data.\n * @param deserializeRow Converts a DH Row to an item object.\n * @returns Handler function for a `dh.Table.EVENT_UPDATED` event.\n */\nexport function createOnTableUpdatedHandler<T>(\n { bulkUpdate }: { bulkUpdate: (itemMap: Map<Key, KeyedItem<T>>) => void },\n deserializeRow: RowDeserializer<T>\n): (event: OnTableUpdatedEvent) => void {\n /**\n * Handler for a `dh.Table.EVENT_UPDATED` event.\n */\n return function onTableUpdated(event: OnTableUpdatedEvent) {\n const { columns, offset, rows } = event.detail;\n\n log.debug('table updated', event.detail);\n\n const updateKeyMap = new Map<Key, KeyedItem<T>>();\n\n rows.forEach((row, offsetInSnapshot) => {\n const item = deserializeRow(row, columns);\n const key = createKeyedItemKey(offset + offsetInSnapshot);\n updateKeyMap.set(key, { key, item });\n });\n\n log.debug('update keys', updateKeyMap);\n\n bulkUpdate(updateKeyMap);\n };\n}\n\n/**\n * Maps a Row to a key / value object. Keys are mapped ver batim from column\n * names.\n * @param row Row to map to an item.\n * @param columns Columns to map.\n * @returns A key / value object for the row.\n */\nexport function defaultRowDeserializer<T>(\n row: dh.Row,\n columns: dh.Column[]\n): T {\n return columns.reduce((result, col) => {\n // eslint-disable-next-line no-param-reassign\n result[col.name as keyof T] = row.get(col) as ValueOf<T>;\n return result;\n }, {} as T);\n}\n\n/**\n * For windowing to work, the underlying list needs to maintain a KeyedItem for\n * each row in the backing table (even if these rows haven't been loaded yet).\n * This is needed internally by react-spectrum so it can calculate the content\n * area size. This generator can create a range of empty `KeyedItem` objects.\n * @param start The starting index to generate\n * @param end The ending index to generate\n */\nexport function* generateEmptyKeyedItems<T>(\n start: number,\n end: number\n): Generator<KeyedItem<T>, void, unknown> {\n // eslint-disable-next-line no-plusplus\n for (let i = start; i <= end; ++i) {\n yield { key: createKeyedItemKey(i) };\n }\n}\n\n/**\n * Check a Table to see if it is closed before checking its size property. This\n * is important because calling Table.size on a closed table throws an error. If\n * the table is null or closed, return zero. Otherwise, return the current size.\n * @param table The table to check for its size.\n * @returns The size of the table or zero if the table is null or closed.\n */\nexport function getSize(table?: dh.Table | dh.TreeTable | null): number {\n return table == null || isClosed(table) ? 0 : table.size;\n}\n\n/**\n * Check if a given widget is closed based on `isClosed` prop.\n * Tree tables and other widgets don't have an `isClosed` prop,\n * so will always return false.\n * @param table The widget to check if it is closed.\n */\nexport function isClosed(widget: unknown): boolean {\n if (\n widget != null &&\n typeof widget === 'object' &&\n 'isClosed' in widget &&\n typeof widget.isClosed === 'boolean'\n ) {\n return widget.isClosed;\n }\n\n return false;\n}\n\n/**\n * Determine the first and last row index for a viewport + extra leading and\n * trailing padding. Values will be \"clamped\" to stay within the table size.\n * @param firstRow Starting row index for the viewport.\n * @param viewportSize Size of the viewport.\n * @param padding Extra rows to add to the viewport. Will be used for leading\n * and trailing rows.\n * @param tableSize Total table size.\n * @returns Tuple containing indices for the first and last row.\n */\nexport function padFirstAndLastRow(\n firstRow: number,\n viewportSize: number,\n padding: number,\n tableSize: number\n): [number, number] {\n const lastRow = firstRow + viewportSize - 1;\n const [min, max] = [0, tableSize - 1];\n\n const first = clamp(firstRow - padding, min, max);\n const last = clamp(lastRow + padding, min, max);\n\n return [first, last];\n}\n"],"mappings":"AACA,OAAOA,KAAK,MAAM,cAAc;AAEhC,OAAOC,GAAG,MAAM,gBAAgB;AAGhC,OAAO,IAAMC,eAAe,GAAG,aAAa;AAU5C,IAAMC,GAAG,GAAGF,GAAG,CAACG,MAAM,CAAC,mBAAmB,CAAC;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,kBAAkBA,CAACC,KAAa,EAAU;EACxD,UAAAC,MAAA,CAAUL,eAAe,OAAAK,MAAA,CAAID,KAAK;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,2BAA2BA,CAAAC,IAAA,EAEzCC,cAAkC,EACI;EAAA,IAFtC;IAAEC;EAAsE,CAAC,GAAAF,IAAA;EAGzE;AACF;AACA;EACE,OAAO,SAASG,cAAcA,CAACC,KAA0B,EAAE;IACzD,IAAM;MAAEC,OAAO;MAAEC,MAAM;MAAEC;IAAK,CAAC,GAAGH,KAAK,CAACI,MAAM;IAE9Cd,GAAG,CAACe,KAAK,CAAC,eAAe,EAAEL,KAAK,CAACI,MAAM,CAAC;IAExC,IAAME,YAAY,GAAG,IAAIC,GAAG,CAAoB,CAAC;IAEjDJ,IAAI,CAACK,OAAO,CAAC,CAACC,GAAG,EAAEC,gBAAgB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d,OAAOA,MAAM,KAAK,QAAQ,IAC1B,UAAU,IAAIA,MAAM,IACpB,OAAOA,MAAM,CAACF,QAAQ,KAAK,SAAS,EACpC;IACA,OAAOE,MAAM,CAACF,QAAQ;EACxB;EAEA,OAAO,KAAK;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,kBAAkBA,CAChCC,QAAgB,EAChBC,YAAoB,EACpBC,OAAe,EACfC,SAAiB,EACC;EAClB,IAAMC,OAAO,GAAGJ,QAAQ,GAAGC,YAAY,GAAG,CAAC;EAC3C,IAAM,CAACI,GAAG,EAAEC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAEH,SAAS,GAAG,CAAC,CAAC;EAErC,IAAMI,KAAK,GAAGlD,KAAK,CAAC2C,QAAQ,GAAGE,OAAO,EAAEG,GAAG,EAAEC,GAAG,CAAC;EACjD,IAAME,IAAI,GAAGnD,KAAK,CAAC+C,OAAO,GAAGF,OAAO,EAAEG,GAAG,EAAEC,GAAG,CAAC;EAE/C,OAAO,CAACC,KAAK,EAAEC,IAAI,CAAC;AACtB"}
|
|
1
|
+
{"version":3,"file":"ViewportDataUtils.js","names":["clamp","Log","ITEM_KEY_PREFIX","log","module","createKeyedItemKey","index","concat","createOnTableUpdatedHandler","_ref","deserializeRow","bulkUpdate","onTableUpdated","event","columns","offset","rows","detail","debug","updateKeyMap","Map","forEach","row","offsetInSnapshot","item","key","set","defaultRowDeserializer","reduce","result","col","name","get","generateEmptyKeyedItems","start","end","i","getSize","table","isClosed","size","widget","padFirstAndLastRow","firstRow","viewportSize","padding","tableSize","lastRow","min","max","first","last"],"sources":["../src/ViewportDataUtils.ts"],"sourcesContent":["import type { Key } from '@react-types/shared';\nimport clamp from 'lodash.clamp';\nimport type { dh } from '@deephaven/jsapi-types';\nimport Log from '@deephaven/log';\nimport { type KeyedItem, type ValueOf } from '@deephaven/utils';\n\nexport const ITEM_KEY_PREFIX = 'DH_ITEM_KEY';\n\nexport type OnTableUpdatedEvent = dh.Event<{\n offset: number;\n columns: dh.Column[];\n rows: dh.Row[];\n}>;\n\nexport type RowDeserializer<T> = (row: dh.Row, columns: dh.Column[]) => T;\n\nconst log = Log.module('ViewportDataUtils');\n\n/**\n * Create a `KeyedItem.key` for a given index. The prefix is necessary to avoid\n * collisions with property values in the `item` property that may be used as\n * keys once the item is loaded and rendered.\n * @param index Index to create a key for.\n * @returns A unique key for the given index.\n */\nexport function createKeyedItemKey(index: number): string {\n return `${ITEM_KEY_PREFIX}_${index}`;\n}\n\n/**\n * Creates a handler function for a `dh.Table.EVENT_UPDATED` event. Rows that\n * get passed to the handler will be bulk updated in the given `viewportData`\n * object based on their derived item keys.\n * @param viewportData State object for managing a list of KeyedItem data.\n * @param deserializeRow Converts a DH Row to an item object.\n * @returns Handler function for a `dh.Table.EVENT_UPDATED` event.\n */\nexport function createOnTableUpdatedHandler<T>(\n { bulkUpdate }: { bulkUpdate: (itemMap: Map<Key, KeyedItem<T>>) => void },\n deserializeRow: RowDeserializer<T>\n): (event: OnTableUpdatedEvent) => void {\n /**\n * Handler for a `dh.Table.EVENT_UPDATED` event.\n */\n return function onTableUpdated(event: OnTableUpdatedEvent) {\n const { columns, offset, rows } = event.detail;\n\n log.debug('table updated', event.detail);\n\n const updateKeyMap = new Map<Key, KeyedItem<T>>();\n\n rows.forEach((row, offsetInSnapshot) => {\n const item = deserializeRow(row, columns);\n const key = createKeyedItemKey(offset + offsetInSnapshot);\n updateKeyMap.set(key, { key, item });\n });\n\n log.debug('update keys', updateKeyMap);\n\n bulkUpdate(updateKeyMap);\n };\n}\n\n/**\n * Maps a Row to a key / value object. Keys are mapped ver batim from column\n * names.\n * @param row Row to map to an item.\n * @param columns Columns to map.\n * @returns A key / value object for the row.\n */\nexport function defaultRowDeserializer<T>(\n row: dh.Row,\n columns: dh.Column[]\n): T {\n return columns.reduce((result, col) => {\n // eslint-disable-next-line no-param-reassign\n result[col.name as keyof T] = row.get(col) as ValueOf<T>;\n return result;\n }, {} as T);\n}\n\n/**\n * For windowing to work, the underlying list needs to maintain a KeyedItem for\n * each row in the backing table (even if these rows haven't been loaded yet).\n * This is needed internally by react-spectrum so it can calculate the content\n * area size. This generator can create a range of empty `KeyedItem` objects.\n * @param start The starting index to generate\n * @param end The ending index to generate\n */\nexport function* generateEmptyKeyedItems<T>(\n start: number,\n end: number\n): Generator<KeyedItem<T>, void, unknown> {\n // eslint-disable-next-line no-plusplus\n for (let i = start; i <= end; ++i) {\n yield { key: createKeyedItemKey(i) };\n }\n}\n\n/**\n * Check a Table to see if it is closed before checking its size property. This\n * is important because calling Table.size on a closed table throws an error. If\n * the table is null or closed, return zero. Otherwise, return the current size.\n * @param table The table to check for its size.\n * @returns The size of the table or zero if the table is null or closed.\n */\nexport function getSize(table?: dh.Table | dh.TreeTable | null): number {\n return table == null || isClosed(table) ? 0 : table.size;\n}\n\n/**\n * Check if a given widget is closed based on `isClosed` prop.\n * Tree tables and other widgets don't have an `isClosed` prop,\n * so will always return false.\n * @param table The widget to check if it is closed.\n */\nexport function isClosed(widget: unknown): boolean {\n if (\n widget != null &&\n typeof widget === 'object' &&\n 'isClosed' in widget &&\n typeof widget.isClosed === 'boolean'\n ) {\n return widget.isClosed;\n }\n\n return false;\n}\n\n/**\n * Determine the first and last row index for a viewport + extra leading and\n * trailing padding. Values will be \"clamped\" to stay within the table size.\n * @param firstRow Starting row index for the viewport.\n * @param viewportSize Size of the viewport.\n * @param padding Extra rows to add to the viewport. Will be used for leading\n * and trailing rows.\n * @param tableSize Total table size.\n * @returns Tuple containing indices for the first and last row.\n */\nexport function padFirstAndLastRow(\n firstRow: number,\n viewportSize: number,\n padding: number,\n tableSize: number\n): [number, number] {\n const lastRow = firstRow + viewportSize - 1;\n const [min, max] = [0, tableSize - 1];\n\n const first = clamp(firstRow - padding, min, max);\n const last = clamp(lastRow + padding, min, max);\n\n return [first, last];\n}\n"],"mappings":"AACA,OAAOA,KAAK,MAAM,cAAc;AAEhC,OAAOC,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K,CAAC2C,QAAQ,GAAGE,OAAO,EAAEG,GAAG,EAAEC,GAAG,CAAC;EACjD,IAAME,IAAI,GAAGnD,KAAK,CAAC+C,OAAO,GAAGF,OAAO,EAAEG,GAAG,EAAEC,GAAG,CAAC;EAE/C,OAAO,CAACC,KAAK,EAAEC,IAAI,CAAC;AACtB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BooleanColumnFormatter.js","names":["TableColumnFormatter","BooleanColumnFormatter","format","value"],"sources":["../../src/formatters/BooleanColumnFormatter.ts"],"sourcesContent":["/* eslint class-methods-use-this: \"off\" */\n/* eslint no-unused-vars: \"off\" */\nimport TableColumnFormatter from './TableColumnFormatter';\n\n/** Column formatter for booleans */\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"],"mappings":"AAAA;AACA;AAAA,OACOA,oBAAoB;AAE3B;AACA,MAAMC,sBAAsB,SAASD,oBAAoB,CAAmB;EAC1EE,MAAMA,CAACC,KAAuB,EAAU;IACtC,QAAQA,KAAK;MACX,KAAK,CAAC;MACN,KAAK,IAAI;QACP,OAAO,MAAM;MACf,KAAK,CAAC;MACN,KAAK,KAAK;QACR,OAAO,OAAO;MAChB;QACE,OAAO,EAAE;IACb;EACF;AACF;AAEA,eAAeF,sBAAsB"}
|
|
1
|
+
{"version":3,"file":"BooleanColumnFormatter.js","names":["TableColumnFormatter","BooleanColumnFormatter","format","value"],"sources":["../../src/formatters/BooleanColumnFormatter.ts"],"sourcesContent":["/* eslint class-methods-use-this: \"off\" */\n/* eslint no-unused-vars: \"off\" */\nimport TableColumnFormatter from './TableColumnFormatter';\n\n/** Column formatter for booleans */\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"],"mappings":"AAAA;AACA;AAAA,OACOA,oBAAoB;AAE3B;AACA,MAAMC,sBAAsB,SAASD,oBAAoB,CAAmB;EAC1EE,MAAMA,CAACC,KAAuB,EAAU;IACtC,QAAQA,KAAK;MACX,KAAK,CAAC;MACN,KAAK,IAAI;QACP,OAAO,MAAM;MACf,KAAK,CAAC;MACN,KAAK,KAAK;QACR,OAAO,OAAO;MAChB;QACE,OAAO,EAAE;IACb;EACF;AACF;AAEA,eAAeF,sBAAsB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CharColumnFormatter.js","names":["TableColumnFormatter","CharColumnFormatter","format","value","String","fromCharCode"],"sources":["../../src/formatters/CharColumnFormatter.ts"],"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"],"mappings":"AAAA;AACA;AAAA,OACOA,oBAAoB;AAE3B;AACA,MAAMC,mBAAmB,SAASD,oBAAoB,CAAS;EAC7DE,MAAMA,CAACC,KAAa,EAAU;IAC5B,OAAOC,MAAM,CAACC,YAAY,CAACF,KAAK,CAAC;EACnC;AACF;AAEA,eAAeF,mBAAmB"}
|
|
1
|
+
{"version":3,"file":"CharColumnFormatter.js","names":["TableColumnFormatter","CharColumnFormatter","format","value","String","fromCharCode"],"sources":["../../src/formatters/CharColumnFormatter.ts"],"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"],"mappings":"AAAA;AACA;AAAA,OACOA,oBAAoB;AAE3B;AACA,MAAMC,mBAAmB,SAASD,oBAAoB,CAAS;EAC7DE,MAAMA,CAACC,KAAa,EAAU;IAC5B,OAAOC,MAAM,CAACC,YAAY,CAACF,KAAK,CAAC;EACnC;AACF;AAEA,eAAeF,mBAAmB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimeColumnFormatter.js","names":["Log","TableColumnFormatter","log","module","DateTimeColumnFormatter","isValid","dh","format","formatString","i18n","DateTimeFormat","Date","e","makeFormat","label","type","arguments","length","undefined","TYPE_CONTEXT_PRESET","isSameFormat","formatA","formatB","makeGlobalFormatStringMap","showTimeZone","showTSeparator","separator","tz","Map","concat","getGlobalFormats","formatStringMap","keys","makeFormatStringMap","getFormats","constructor","timeZone","timeZoneParam","defaultDateTimeFormatString","DEFAULT_DATETIME_FORMAT_STRING","_defineProperty","DEFAULT_TIME_ZONE_ID","dhTimeZone","TimeZone","getTimeZone","error","getEffectiveFormatString","baseFormatString","_this$formatStringMap","get","value"],"sources":["../../src/formatters/DateTimeColumnFormatter.ts"],"sourcesContent":["/* eslint class-methods-use-this: \"off\" */\nimport type { dh as DhType } from '@deephaven/jsapi-types';\nimport Log from '@deephaven/log';\nimport TableColumnFormatter, {\n type 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 | DhType.DateWrapper | number\n> {\n /**\n * Validates format object\n * @param dh JSAPI instance\n * @param format Format object\n * @returns true for valid object\n */\n static isValid(\n dh: typeof DhType,\n format: Pick<TableColumnFormat, 'formatString'>\n ): boolean {\n if (format.formatString == null) {\n return false;\n }\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 | null,\n formatB: TableColumnFormat | null\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 =\n showTSeparator !== undefined && showTSeparator ? `'T'` : ' ';\n const tz = showTimeZone !== undefined && 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 dh: typeof DhType;\n\n dhTimeZone: DhType.i18n.TimeZone;\n\n defaultDateTimeFormatString: string;\n\n showTimeZone: boolean;\n\n showTSeparator: boolean;\n\n formatStringMap: Map<string, string>;\n\n constructor(\n dh: typeof DhType,\n {\n timeZone: timeZoneParam = '',\n showTimeZone = true,\n showTSeparator = false,\n defaultDateTimeFormatString = DateTimeColumnFormatter.DEFAULT_DATETIME_FORMAT_STRING,\n }: DateTimeColumnFormatterOptions = {}\n ) {\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 this.dh = dh;\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 | DhType.DateWrapper | number,\n format: Partial<TableColumnFormat> = {}\n ): string {\n const baseFormatString =\n format.formatString != null && format.formatString !== ''\n ? format.formatString\n : this.defaultDateTimeFormatString;\n const formatString = this.getEffectiveFormatString(baseFormatString);\n try {\n return this.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"],"mappings":";;;AAAA;;AAEA,OAAOA,GAAG,MAAM,gBAAgB;AAAC,OAC1BC,oBAAoB;AAI3B,IAAMC,GAAG,GAAGF,GAAG,CAACG,MAAM,CAAC,yBAAyB,CAAC;AAgBjD,OAAO,MAAMC,uBAAuB,SAASH,oBAAoB,CAE/D;EACA;AACF;AACA;AACA;AACA;AACA;EACE,OAAOI,OAAOA,CACZC,EAAiB,EACjBC,MAA+C,EACtC;IACT,IAAIA,MAAM,CAACC,YAAY,IAAI,IAAI,EAAE;MAC/B,OAAO,KAAK;IACd;IACA,IAAI;MACFF,EAAE,CAACG,IAAI,CAACC,cAAc,CAACH,MAAM,CAACA,MAAM,CAACC,YAAY,EAAE,IAAIG,IAAI,CAAC,CAAC,CAAC;MAC9D,OAAO,IAAI;IACb,CAAC,CAAC,OAAOC,CAAC,EAAE;MACV,OAAO,KAAK;IACd;EACF;EAEA,OAAOC,UAAUA,CACfC,KAAa,EACbN,YAAoB,EAED;IAAA,IADnBO,IAAI,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGf,oBAAoB,CAACkB,mBAAmB;IAE/C,OAAO;MACLL,KAAK;MACLN,YAAY;MACZO;IACF,CAAC;EACH;;EAEA;AACF;AACA;AAC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,eAAA,CA3LYpC,uBAAuB,oCAuDM,yBAAyB;AAAAoC,eAAA,CAvDtDpC,uBAAuB,0BAyDJ,kBAAkB;AAoIlD,eAAeA,uBAAuB"}
|
|
1
|
+
{"version":3,"file":"DateTimeColumnFormatter.js","names":["Log","TableColumnFormatter","log","module","DateTimeColumnFormatter","isValid","dh","format","formatString","i18n","DateTimeFormat","Date","e","makeFormat","label","type","arguments","length","undefined","TYPE_CONTEXT_PRESET","isSameFormat","formatA","formatB","makeGlobalFormatStringMap","showTimeZone","showTSeparator","separator","tz","Map","concat","getGlobalFormats","formatStringMap","keys","makeFormatStringMap","getFormats","constructor","timeZone","timeZoneParam","defaultDateTimeFormatString","DEFAULT_DATETIME_FORMAT_STRING","_defineProperty","DEFAULT_TIME_ZONE_ID","dhTimeZone","TimeZone","getTimeZone","error","getEffectiveFormatString","baseFormatString","_this$formatStringMap","get","value"],"sources":["../../src/formatters/DateTimeColumnFormatter.ts"],"sourcesContent":["/* eslint class-methods-use-this: \"off\" */\nimport type { dh as DhType } from '@deephaven/jsapi-types';\nimport Log from '@deephaven/log';\nimport TableColumnFormatter, {\n type 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 | DhType.DateWrapper | number\n> {\n /**\n * Validates format object\n * @param dh JSAPI instance\n * @param format Format object\n * @returns true for valid object\n */\n static isValid(\n dh: typeof DhType,\n format: Pick<TableColumnFormat, 'formatString'>\n ): boolean {\n if (format.formatString == null) {\n return false;\n }\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 | null,\n formatB: TableColumnFormat | null\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 =\n showTSeparator !== undefined && showTSeparator ? `'T'` : ' ';\n const tz = showTimeZone !== undefined && 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 dh: typeof DhType;\n\n dhTimeZone: DhType.i18n.TimeZone;\n\n defaultDateTimeFormatString: string;\n\n showTimeZone: boolean;\n\n showTSeparator: boolean;\n\n formatStringMap: Map<string, string>;\n\n constructor(\n dh: typeof DhType,\n {\n timeZone: timeZoneParam = '',\n showTimeZone = true,\n showTSeparator = false,\n defaultDateTimeFormatString = DateTimeColumnFormatter.DEFAULT_DATETIME_FORMAT_STRING,\n }: DateTimeColumnFormatterOptions = {}\n ) {\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 this.dh = dh;\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 | DhType.DateWrapper | number,\n format: Partial<TableColumnFormat> = {}\n ): string {\n const baseFormatString =\n format.formatString != null && format.formatString !== ''\n ? format.formatString\n : this.defaultDateTimeFormatString;\n const formatString = this.getEffectiveFormatString(baseFormatString);\n try {\n return this.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"],"mappings":";;;AAAA;;AAEA,OAAOA,GAAG,MAAM,gBAAgB;AAAC,OAC1BC,oBAAoB;AAI3B,IAAMC,GAAG,GAAGF,GAAG,CAACG,MAAM,CAAC,yBAAyB,CAAC;AAgBjD,OAAO,MAAMC,uBAAuB,SAASH,oBAAoB,CAE/D;EACA;AACF;AACA;AACA;AACA;AACA;EACE,OAAOI,OAAOA,CACZC,EAAiB,EACjBC,MAA+C,EACtC;IACT,IAAIA,MAAM,CAACC,YAAY,IAAI,IAAI,EAAE;MAC/B,OAAO,KAAK;IACd;IACA,IAAI;MACFF,EAAE,CAACG,IAAI,CAACC,cAAc,CAACH,MAAM,CAACA,MAAM,CAACC,YAAY,EAAE,IAAIG,IAAI,CAAC,CAAC,CAAC;MAC9D,OAAO,IAAI;IACb,CAAC,CAAC,OAAOC,CAAC,EAAE;MACV,OAAO,KAAK;IACd;EACF;EAEA,OAAOC,UAAUA,CACfC,KAAa,EACbN,YAAoB,EAED;IAAA,IADnBO,IAAI,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGf,oBAAoB,CAACkB,mBAAmB;IAE/C,OAAO;MACLL,KAAK;MACLN,YAAY;MACZO;IACF,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;EACE,OAAOK,YAAYA,CACjBC,OAAiC,EACjCC,OAAiC,EACxB;IACT,OACED,OAAO,KAAKC,OAAO,IAClBD,OAAO,KAAK,IAAI,IACfC,OAAO,KAAK,I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1,3 +1,4 @@
|
|
|
1
|
+
var _DecimalColumnFormatter;
|
|
1
2
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
2
3
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
3
4
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
@@ -106,14 +107,15 @@ export class DecimalColumnFormatter extends TableColumnFormatter {
|
|
|
106
107
|
return '';
|
|
107
108
|
}
|
|
108
109
|
}
|
|
110
|
+
_DecimalColumnFormatter = DecimalColumnFormatter;
|
|
109
111
|
_defineProperty(DecimalColumnFormatter, "DEFAULT_FORMAT_STRING", '###,##0.0000');
|
|
110
|
-
_defineProperty(DecimalColumnFormatter, "FORMAT_PERCENT",
|
|
111
|
-
_defineProperty(DecimalColumnFormatter, "FORMAT_BASIS_POINTS",
|
|
112
|
-
_defineProperty(DecimalColumnFormatter, "FORMAT_THOUSANDS",
|
|
113
|
-
_defineProperty(DecimalColumnFormatter, "FORMAT_MILLIONS",
|
|
114
|
-
_defineProperty(DecimalColumnFormatter, "FORMAT_SCIENTIFIC_NOTATION",
|
|
115
|
-
_defineProperty(DecimalColumnFormatter, "FORMAT_ROUND",
|
|
116
|
-
_defineProperty(DecimalColumnFormatter, "FORMAT_ROUND_TWO_DECIMALS",
|
|
117
|
-
_defineProperty(DecimalColumnFormatter, "FORMAT_ROUND_FOUR_DECIMALS",
|
|
112
|
+
_defineProperty(DecimalColumnFormatter, "FORMAT_PERCENT", _DecimalColumnFormatter.makePresetFormat('Percent', '##0.00%'));
|
|
113
|
+
_defineProperty(DecimalColumnFormatter, "FORMAT_BASIS_POINTS", _DecimalColumnFormatter.makePresetFormat('Basis Points', '###,##0 bp', 10000));
|
|
114
|
+
_defineProperty(DecimalColumnFormatter, "FORMAT_THOUSANDS", _DecimalColumnFormatter.makePresetFormat('Thousands', '##0.000 k', 0.001));
|
|
115
|
+
_defineProperty(DecimalColumnFormatter, "FORMAT_MILLIONS", _DecimalColumnFormatter.makePresetFormat('Millions', '###,##0.000 mm', 0.000001));
|
|
116
|
+
_defineProperty(DecimalColumnFormatter, "FORMAT_SCIENTIFIC_NOTATION", _DecimalColumnFormatter.makePresetFormat('Scientific Notation', '0.0000E0'));
|
|
117
|
+
_defineProperty(DecimalColumnFormatter, "FORMAT_ROUND", _DecimalColumnFormatter.makePresetFormat('Round', '###,##0'));
|
|
118
|
+
_defineProperty(DecimalColumnFormatter, "FORMAT_ROUND_TWO_DECIMALS", _DecimalColumnFormatter.makePresetFormat('0.00', '###,##0.00'));
|
|
119
|
+
_defineProperty(DecimalColumnFormatter, "FORMAT_ROUND_FOUR_DECIMALS", _DecimalColumnFormatter.makePresetFormat('0.0000', '###,##0.0000'));
|
|
118
120
|
export default DecimalColumnFormatter;
|
|
119
121
|
//# sourceMappingURL=DecimalColumnFormatter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecimalColumnFormatter.js","names":["Log","TableColumnFormatter","log","module","DecimalColumnFormatter","isValid","dh","format","formatString","i18n","NumberFormat","e","makeFormat","label","type","arguments","length","undefined","TYPE_CONTEXT_PRESET","multiplier","makePresetFormat","makeCustomFormat","TYPE_CONTEXT_CUSTOM","isSameFormat","formatA","formatB","constructor","defaultFormatString","DEFAULT_FORMAT_STRING","_defineProperty","valueParam","value","error"],"sources":["../../src/formatters/DecimalColumnFormatter.ts"],"sourcesContent":["/* eslint class-methods-use-this: \"off\" */\nimport type { dh as DhType } from '@deephaven/jsapi-types';\nimport Log from '@deephaven/log';\nimport TableColumnFormatter, {\n type TableColumnFormat,\n} from './TableColumnFormatter';\n\nconst log = Log.module('DecimalColumnFormatter');\n\nexport type DecimalColumnFormat = TableColumnFormat & {\n multiplier?: number | null;\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 dh JSAPI instance\n * @param format Format object\n * @returns true for valid object\n */\n static isValid(\n dh: typeof DhType,\n format: Pick<TableColumnFormat, 'formatString'>\n ): boolean {\n if (format.formatString == null) {\n return false;\n }\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_THOUSANDS = DecimalColumnFormatter.makePresetFormat(\n 'Thousands',\n '##0.000 k',\n 0.001\n );\n\n static FORMAT_MILLIONS = DecimalColumnFormatter.makePresetFormat(\n 'Millions',\n '###,##0.000 mm',\n 0.000001\n );\n\n static FORMAT_SCIENTIFIC_NOTATION = DecimalColumnFormatter.makePresetFormat(\n 'Scientific Notation',\n '0.0000E0'\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 | null,\n formatB: DecimalColumnFormat | null\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 dh: typeof DhType;\n\n constructor(\n dh: typeof DhType,\n {\n defaultFormatString = DecimalColumnFormatter.DEFAULT_FORMAT_STRING,\n }: DecimalColumnFormatterOptions = {}\n ) {\n super();\n\n this.dh = dh;\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(\n valueParam: number,\n format: Partial<DecimalColumnFormat> = {}\n ): string {\n const formatString =\n format.formatString != null && format.formatString !== ''\n ? format.formatString\n : this.defaultFormatString;\n const value =\n format.multiplier != null && format.multiplier !== 0\n ? valueParam * format.multiplier\n : valueParam;\n try {\n return this.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"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DecimalColumnFormatter.js","names":["Log","TableColumnFormatter","log","module","DecimalColumnFormatter","isValid","dh","format","formatString","i18n","NumberFormat","e","makeFormat","label","type","arguments","length","undefined","TYPE_CONTEXT_PRESET","multiplier","makePresetFormat","makeCustomFormat","TYPE_CONTEXT_CUSTOM","isSameFormat","formatA","formatB","constructor","defaultFormatString","DEFAULT_FORMAT_STRING","_defineProperty","valueParam","value","error","_DecimalColumnFormatter"],"sources":["../../src/formatters/DecimalColumnFormatter.ts"],"sourcesContent":["/* eslint class-methods-use-this: \"off\" */\nimport type { dh as DhType } from '@deephaven/jsapi-types';\nimport Log from '@deephaven/log';\nimport TableColumnFormatter, {\n type TableColumnFormat,\n} from './TableColumnFormatter';\n\nconst log = Log.module('DecimalColumnFormatter');\n\nexport type DecimalColumnFormat = TableColumnFormat & {\n multiplier?: number | null;\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 dh JSAPI instance\n * @param format Format object\n * @returns true for valid object\n */\n static isValid(\n dh: typeof DhType,\n format: Pick<TableColumnFormat, 'formatString'>\n ): boolean {\n if (format.formatString == null) {\n return false;\n }\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_THOUSANDS = DecimalColumnFormatter.makePresetFormat(\n 'Thousands',\n '##0.000 k',\n 0.001\n );\n\n static FORMAT_MILLIONS = DecimalColumnFormatter.makePresetFormat(\n 'Millions',\n '###,##0.000 mm',\n 0.000001\n );\n\n static FORMAT_SCIENTIFIC_NOTATION = DecimalColumnFormatter.makePresetFormat(\n 'Scientific Notation',\n '0.0000E0'\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 | null,\n formatB: DecimalColumnFormat | null\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 dh: typeof DhType;\n\n constructor(\n dh: typeof DhType,\n {\n defaultFormatString = DecimalColumnFormatter.DEFAULT_FORMAT_STRING,\n }: DecimalColumnFormatterOptions = {}\n ) {\n super();\n\n this.dh = dh;\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(\n valueParam: number,\n format: Partial<DecimalColumnFormat> = {}\n ): string {\n const formatString =\n format.formatString != null && format.formatString !== ''\n ? format.formatString\n : this.defaultFormatString;\n const value =\n format.multiplier != null && format.multiplier !== 0\n ? valueParam * format.multiplier\n : valueParam;\n try {\n return this.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"],"mappings":";;;;AAAA;;AAEA,OAAOA,GAAG,MAAM,gBAAgB;AAAC,OAC1BC,oBAAoB;AAI3B,IAAMC,GAAG,GAAGF,GAAG,CAACG,MAAM,CAAC,wBAAwB,CAAC;AAWhD,OAAO,MAAMC,sBAAsB,SAASH,oBAAoB,CAAS;EACvE;AACF;AACA;AACA;AACA;AACA;EACE,OAAOI,OAAOA,CACZC,EAAiB,EACjBC,MAA+C,EACtC;IACT,IAAIA,MAAM,CAACC,YAAY,IAAI,IAAI,EAAE;MAC/B,OAAO,KAAK;IACd;IACA,IAAI;MACFF,EAAE,CAACG,IAAI,CAACC,YAAY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OpB,CAAC,EAAE;MACVT,GAAG,CAAC8B,KAAK,CAAC,0BAA0B,CAAC;IACvC;IACA,OAAO,EAAE;EACX;AACF;AAACC,uBAAA,GA5LY7B,sBAAsB;AAAAyB,eAAA,CAAtBzB,sBAAsB,2BAkFF,cAAc;AAAAyB,eAAA,CAlFlCzB,sBAAsB,oBAoFTA,uBAAsB,CAACgB,gBAAgB,CAC7D,SAAS,EACT,SACF,CAAC;AAAAS,eAAA,CAvFUzB,sBAAsB,yBAyFJA,uBAAsB,CAACgB,gBAAgB,CAClE,cAAc,EACd,YAAY,EACZ,KACF,CAAC;AAAAS,eAAA,CA7FUzB,sBAAsB,sBA+FPA,uBAAsB,CAACgB,gBAAgB,CAC/D,WAAW,EACX,WAAW,EACX,KACF,CAAC;AAAAS,eAAA,CAnGUzB,sBAAsB,qBAqGRA,uBAAsB,CAACgB,gBAAgB,CAC9D,UAAU,EACV,gBAAgB,EAChB,QACF,CAAC;AAAAS,eAAA,CAzGUzB,sBAAsB,gCA2GGA,uBAAsB,CAACgB,gBAAgB,CACzE,qBAAqB,EACrB,UACF,CAAC;AAAAS,eAAA,CA9GUzB,sBAAsB,kBAgHXA,uBAAsB,CAACgB,gBAAgB,CAC3D,OAAO,EACP,SACF,CAAC;AAAAS,eAAA,CAnHUzB,sBAAsB,+BAqHEA,uBAAsB,CAACgB,gBAAgB,CACxE,MAAM,EACN,YACF,CAAC;AAAAS,eAAA,CAxHUzB,sBAAsB,gCA0HGA,uBAAsB,CAACgB,gBAAgB,CACzE,QAAQ,EACR,cACF,CAAC;AAiEH,eAAehB,sBAAsB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultColumnFormatter.js","names":["TableColumnFormatter","DefaultColumnFormatter","format","value","concat"],"sources":["../../src/formatters/DefaultColumnFormatter.ts"],"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"],"mappings":"AAAA;AACA;AAAA,OACOA,oBAAoB;AAE3B,MAAMC,sBAAsB,SAASD,oBAAoB,CAAC;EACxDE,MAAMA,CAACC,KAAc,EAAU;IAC7B,UAAAC,MAAA,CAAUD,KAAK;EACjB;AACF;AAEA,eAAeF,sBAAsB"}
|
|
1
|
+
{"version":3,"file":"DefaultColumnFormatter.js","names":["TableColumnFormatter","DefaultColumnFormatter","format","value","concat"],"sources":["../../src/formatters/DefaultColumnFormatter.ts"],"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"],"mappings":"AAAA;AACA;AAAA,OACOA,oBAAoB;AAE3B,MAAMC,sBAAsB,SAASD,oBAAoB,CAAC;EACxDE,MAAMA,CAACC,KAAc,EAAU;IAC7B,UAAAC,MAAA,CAAUD,KAAK;EACjB;AACF;AAEA,eAAeF,sBAAsB","ignoreList":[]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
var _IntegerColumnFormatter;
|
|
1
2
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
2
3
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
3
4
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
@@ -108,9 +109,10 @@ export class IntegerColumnFormatter extends TableColumnFormatter {
|
|
|
108
109
|
return '';
|
|
109
110
|
}
|
|
110
111
|
}
|
|
112
|
+
_IntegerColumnFormatter = IntegerColumnFormatter;
|
|
111
113
|
_defineProperty(IntegerColumnFormatter, "DEFAULT_FORMAT_STRING", '###,##0');
|
|
112
|
-
_defineProperty(IntegerColumnFormatter, "FORMAT_THOUSANDS",
|
|
113
|
-
_defineProperty(IntegerColumnFormatter, "FORMAT_MILLIONS",
|
|
114
|
-
_defineProperty(IntegerColumnFormatter, "FORMAT_SCIENTIFIC_NOTATION",
|
|
114
|
+
_defineProperty(IntegerColumnFormatter, "FORMAT_THOUSANDS", _IntegerColumnFormatter.makePresetFormat('Thousands', '##0.000 k', 0.001));
|
|
115
|
+
_defineProperty(IntegerColumnFormatter, "FORMAT_MILLIONS", _IntegerColumnFormatter.makePresetFormat('Millions', '###,##0.000 mm', 0.000001));
|
|
116
|
+
_defineProperty(IntegerColumnFormatter, "FORMAT_SCIENTIFIC_NOTATION", _IntegerColumnFormatter.makePresetFormat('Scientific Notation', '0.0000E0'));
|
|
115
117
|
export default IntegerColumnFormatter;
|
|
116
118
|
//# sourceMappingURL=IntegerColumnFormatter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntegerColumnFormatter.js","names":["Log","TableColumnFormatter","log","module","IntegerColumnFormatter","isValid","dh","format","formatString","i18n","NumberFormat","e","makeFormat","label","type","arguments","length","undefined","TYPE_CONTEXT_PRESET","multiplier","makePresetFormat","makeCustomFormat","TYPE_CONTEXT_CUSTOM","isSameFormat","formatA","formatB","constructor","defaultFormatString","DEFAULT_FORMAT_STRING","_defineProperty","valueParam","value","error"],"sources":["../../src/formatters/IntegerColumnFormatter.ts"],"sourcesContent":["/* eslint class-methods-use-this: \"off\" */\nimport type { dh as DhType } from '@deephaven/jsapi-types';\nimport Log from '@deephaven/log';\nimport TableColumnFormatter, {\n type TableColumnFormat,\n} from './TableColumnFormatter';\n\nconst log = Log.module('IntegerColumnFormatter');\n\nexport type IntegerColumnFormat = TableColumnFormat & {\n multiplier?: number | null;\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 dh JSAPI instance\n * @param format Format object\n * @returns true for valid object\n */\n static isValid(\n dh: typeof DhType,\n format: Pick<TableColumnFormat, 'formatString'>\n ): boolean {\n if (format.formatString == null) {\n return false;\n }\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 | null,\n formatB: IntegerColumnFormat | null\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_THOUSANDS = IntegerColumnFormatter.makePresetFormat(\n 'Thousands',\n '##0.000 k',\n 0.001\n );\n\n static FORMAT_MILLIONS = IntegerColumnFormatter.makePresetFormat(\n 'Millions',\n '###,##0.000 mm',\n 0.000001\n );\n\n static FORMAT_SCIENTIFIC_NOTATION = IntegerColumnFormatter.makePresetFormat(\n 'Scientific Notation',\n '0.0000E0'\n );\n\n dh: typeof DhType;\n\n defaultFormatString: string;\n\n constructor(\n dh: typeof DhType,\n {\n defaultFormatString = IntegerColumnFormatter.DEFAULT_FORMAT_STRING,\n }: IntegerColumnFormatterOptions = {}\n ) {\n super();\n this.dh = dh;\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(\n valueParam: number,\n format: Partial<IntegerColumnFormat> = {}\n ): string {\n const formatString =\n format.formatString != null && format.formatString !== ''\n ? format.formatString\n : this.defaultFormatString;\n const value =\n format.multiplier != null && format.multiplier !== 0\n ? valueParam * format.multiplier\n : valueParam;\n try {\n return this.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"],"mappings":"
|
|
1
|
+
{"version":3,"file":"IntegerColumnFormatter.js","names":["Log","TableColumnFormatter","log","module","IntegerColumnFormatter","isValid","dh","format","formatString","i18n","NumberFormat","e","makeFormat","label","type","arguments","length","undefined","TYPE_CONTEXT_PRESET","multiplier","makePresetFormat","makeCustomFormat","TYPE_CONTEXT_CUSTOM","isSameFormat","formatA","formatB","constructor","defaultFormatString","DEFAULT_FORMAT_STRING","_defineProperty","valueParam","value","error","_IntegerColumnFormatter"],"sources":["../../src/formatters/IntegerColumnFormatter.ts"],"sourcesContent":["/* eslint class-methods-use-this: \"off\" */\nimport type { dh as DhType } from '@deephaven/jsapi-types';\nimport Log from '@deephaven/log';\nimport TableColumnFormatter, {\n type TableColumnFormat,\n} from './TableColumnFormatter';\n\nconst log = Log.module('IntegerColumnFormatter');\n\nexport type IntegerColumnFormat = TableColumnFormat & {\n multiplier?: number | null;\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 dh JSAPI instance\n * @param format Format object\n * @returns true for valid object\n */\n static isValid(\n dh: typeof DhType,\n format: Pick<TableColumnFormat, 'formatString'>\n ): boolean {\n if (format.formatString == null) {\n return false;\n }\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 | null,\n formatB: IntegerColumnFormat | null\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_THOUSANDS = IntegerColumnFormatter.makePresetFormat(\n 'Thousands',\n '##0.000 k',\n 0.001\n );\n\n static FORMAT_MILLIONS = IntegerColumnFormatter.makePresetFormat(\n 'Millions',\n '###,##0.000 mm',\n 0.000001\n );\n\n static FORMAT_SCIENTIFIC_NOTATION = IntegerColumnFormatter.makePresetFormat(\n 'Scientific Notation',\n '0.0000E0'\n );\n\n dh: typeof DhType;\n\n defaultFormatString: string;\n\n constructor(\n dh: typeof DhType,\n {\n defaultFormatString = IntegerColumnFormatter.DEFAULT_FORMAT_STRING,\n }: IntegerColumnFormatterOptions = {}\n ) {\n super();\n this.dh = dh;\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(\n valueParam: number,\n format: Partial<IntegerColumnFormat> = {}\n ): string {\n const formatString =\n format.formatString != null && format.formatString !== ''\n ? format.formatString\n : this.defaultFormatString;\n const value =\n format.multiplier != null && format.multiplier !== 0\n ? valueParam * format.multiplier\n : valueParam;\n try {\n return this.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"],"mappings":";;;;AAAA;;AAEA,OAAOA,GAAG,MAAM,gBAAgB;AAAC,OAC1BC,oBAAoB;AAI3B,IAAMC,GAAG,GAAGF,GAAG,CAACG,MAAM,CAAC,wBAAwB,CAAC;AAWhD;AACA,OAAO,MAAMC,sBAAsB,SAASH,oBAAoB,CAAS;EACvE;AACF;AACA;AACA;AACA;AACA;EACE,OAAOI,OAAOA,CACZC,EAAiB,EACjBC,MAA+C,EACtC;IACT,IAAIA,MAAM,CAACC,YAAY,IAAI,IAAI,EAAE;MAC/B,OAAO,KAAK;IACd;IACA,IAAI;MACFF,EAAE,CAACG,IAAI,CAACC,YAAY,CAACH,MAAM,CAACA,MAAM,CAACC,YAAY,EAAE,CAAC,CAAC;MACnD,OAAO,IAAI;IACb,CAAC,CAAC,OAAOG,CAAC,EAAE;MACV,OAAO,KAAK;IACd;EACF;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACE,OAAOC,UAAUA,CACfC,KAAa,EACbL,YAAoB,EAGC;IAAA,IAFrBM,IAAI,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGd,oBAAoB,CAACiB,mBAAmB;IAAA,IAC/CC,UAAmB,GAAAJ,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,SAAA;IAEnB,OAAO;MACLJ,KAAK;MACLC,IAAI;MACJN,YAAY;MACZW;IACF,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACE,OAAOC,gBAAgBA,CACrBP,KAAa,EAGQ;IAAA,IAFrBL,YAAY,GAAAO,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;IAAA,IACjBI,UAAmB,GAAAJ,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,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MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;IAEzC,IAAMP,YAAY,GAChBD,MAAM,CAACC,YAAY,IAAI,IAAI,IAAID,MAAM,CAACC,YAAY,KAAK,EAAE,GACrDD,MAAM,CAACC,YAAY,GACnB,IAAI,CAACmB,mBAAmB;IAC9B,IAAMI,KAAK,GACTxB,MAAM,CAACY,UAAU,IAAI,IAAI,IAAIZ,MAAM,CAACY,UAAU,KAAK,CAAC,GAChDW,UAAU,GAAGvB,MAAM,CAACY,UAAU,GAC9BW,UAAU;IAChB,IAAI;MACF,OAAO,IAAI,CAACxB,EAAE,CAACG,IAAI,CAACC,YAAY,CAACH,MAAM,CAACC,YAAY,EAAEuB,KAAK,CAAC;IAC9D,CAAC,CAAC,OAAOpB,CAAC,EAAE;MACVT,GAAG,CAAC8B,KAAK,CAAC,0BAA0B,CAAC;IACvC;IACA,OAAO,EAAE;EACX;AACF;AAACC,uBAAA,GAjKY7B,sBAAsB;AAAAyB,eAAA,CAAtBzB,sBAAsB,2BAsGF,SAAS;AAAAyB,eAAA,CAtG7BzB,sBAAsB,sBAwGPA,uBAAsB,CAACgB,gBAAgB,CAC/D,WAAW,EACX,WAAW,EACX,KACF,CAAC;AAAAS,eAAA,CA5GUzB,sBAAsB,qBA8GRA,uBAAsB,CAACgB,gBAAgB,CAC9D,UAAU,EACV,gBAAgB,EAChB,QACF,CAAC;AAAAS,eAAA,CAlHUzB,sBAAsB,gCAoHGA,uBAAsB,CAACgB,gBAAgB,CACzE,qBAAqB,EACrB,UACF,CAAC;AA4CH,eAAehB,sBAAsB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StringColumnFormatter.js","names":["TableColumnFormatter","StringColumnFormatter","format","value"],"sources":["../../src/formatters/StringColumnFormatter.ts"],"sourcesContent":["/* eslint class-methods-use-this: \"off\" */\nimport TableColumnFormatter from './TableColumnFormatter';\n\n/** Column formatter for strings */\nexport class StringColumnFormatter extends TableColumnFormatter<string> {\n format(value: string): string {\n return value;\n }\n}\n\nexport default StringColumnFormatter;\n"],"mappings":"AAAA;AAAA,OACOA,oBAAoB;AAE3B;AACA,OAAO,MAAMC,qBAAqB,SAASD,oBAAoB,CAAS;EACtEE,MAAMA,CAACC,KAAa,EAAU;IAC5B,OAAOA,KAAK;EACd;AACF;AAEA,eAAeF,qBAAqB"}
|
|
1
|
+
{"version":3,"file":"StringColumnFormatter.js","names":["TableColumnFormatter","StringColumnFormatter","format","value"],"sources":["../../src/formatters/StringColumnFormatter.ts"],"sourcesContent":["/* eslint class-methods-use-this: \"off\" */\nimport TableColumnFormatter from './TableColumnFormatter';\n\n/** Column formatter for strings */\nexport class StringColumnFormatter extends TableColumnFormatter<string> {\n format(value: string): string {\n return value;\n }\n}\n\nexport default StringColumnFormatter;\n"],"mappings":"AAAA;AAAA,OACOA,oBAAoB;AAE3B;AACA,OAAO,MAAMC,qBAAqB,SAASD,oBAAoB,CAAS;EACtEE,MAAMA,CAACC,KAAa,EAAU;IAC5B,OAAOA,KAAK;EACd;AACF;AAEA,eAAeF,qBAAqB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableColumnFormatter.js","names":["TableColumnFormatter","isValid","dh","format","isSameFormat","formatA","formatB","Error","makeFormat","label","formatString","type","value","_defineProperty"],"sources":["../../src/formatters/TableColumnFormatter.ts"],"sourcesContent":["/* eslint class-methods-use-this: \"off\" */\n/**\n * Default column data formatter. Just interpolates the value as a string and returns.\n * Extend this class and register with TableUtils to make use of it.\n */\n\nimport type { dh as DhType } from '@deephaven/jsapi-types';\n\nexport type TableColumnFormatType =\n | 'type-global'\n | 'type-context-preset'\n | 'type-context-custom';\n\nexport type TableColumnFormat = {\n label: string;\n formatString: string | null;\n type: TableColumnFormatType;\n};\n\nexport class TableColumnFormatter<T = unknown> {\n static TYPE_GLOBAL: TableColumnFormatType = 'type-global';\n\n static TYPE_CONTEXT_PRESET: TableColumnFormatType = 'type-context-preset';\n\n static TYPE_CONTEXT_CUSTOM: TableColumnFormatType = 'type-context-custom';\n\n /**\n * Validates format object\n * @param dh JSAPI instance\n * @param format Format object\n * @returns true for valid object\n */\n static isValid(dh: typeof DhType, format: TableColumnFormat): boolean {\n return true;\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 | null,\n formatB: TableColumnFormat | null\n ): boolean {\n throw new Error('isSameFormat not implemented');\n }\n\n /**\n * Create and return a Format object\n * @param label The label of the format object\n * @param formatString Format string to use for the format\n * @param type The type of column to use for this format\n * @returns A format object\n */\n static makeFormat(\n label: string,\n formatString: string,\n type: TableColumnFormatType\n ): TableColumnFormat {\n return { label, formatString, type };\n }\n\n /**\n * @param value The value to format\n * @param format Optional format object with value transformation options\n * @returns String the formatted text string of the value passed in.\n */\n format(value: T, format?: Partial<TableColumnFormat>): string {\n return '';\n }\n}\n\nexport default TableColumnFormatter;\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;;AAeA,OAAO,MAAMA,oBAAoB,CAAc;EAO7C;AACF;AACA;AACA;AACA;AACA;EACE,OAAOC,OAAOA,CAACC,EAAiB,EAAEC,MAAyB,EAAW;IACpE,OAAO,IAAI;EACb;;EAEA;AACF;AACA;AACA;AACA;AACA;EACE,OAAOC,YAAYA,CACjBC,OAAiC,EACjCC,OAAiC,EACxB;IACT,MAAM,IAAIC,KAAK,CAAC,8BAA8B,CAAC;EACjD;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACE,OAAOC,UAAUA,CACfC,KAAa,EACbC,YAAoB,EACpBC,IAA2B,EACR;IACnB,OAAO;MAAEF,KAAK;MAAEC,YAAY;MAAEC;IAAK,CAAC;EACtC;;EAEA;AACF;AACA;AACA;AACA;EACER,MAAMA,CAACS,KAAQ,EAAET,MAAmC,EAAU;IAC5D,OAAO,EAAE;EACX;AACF;AAACU,eAAA,CArDYb,oBAAoB,iBACa,aAAa;AAAAa,eAAA,CAD9Cb,oBAAoB,yBAGqB,qBAAqB;AAAAa,eAAA,CAH9Db,oBAAoB,yBAKqB,qBAAqB;AAkD3E,eAAeA,oBAAoB"}
|
|
1
|
+
{"version":3,"file":"TableColumnFormatter.js","names":["TableColumnFormatter","isValid","dh","format","isSameFormat","formatA","formatB","Error","makeFormat","label","formatString","type","value","_defineProperty"],"sources":["../../src/formatters/TableColumnFormatter.ts"],"sourcesContent":["/* eslint class-methods-use-this: \"off\" */\n/**\n * Default column data formatter. Just interpolates the value as a string and returns.\n * Extend this class and register with TableUtils to make use of it.\n */\n\nimport type { dh as DhType } from '@deephaven/jsapi-types';\n\nexport type TableColumnFormatType =\n | 'type-global'\n | 'type-context-preset'\n | 'type-context-custom';\n\nexport type TableColumnFormat = {\n label: string;\n formatString: string | null;\n type: TableColumnFormatType;\n};\n\nexport class TableColumnFormatter<T = unknown> {\n static TYPE_GLOBAL: TableColumnFormatType = 'type-global';\n\n static TYPE_CONTEXT_PRESET: TableColumnFormatType = 'type-context-preset';\n\n static TYPE_CONTEXT_CUSTOM: TableColumnFormatType = 'type-context-custom';\n\n /**\n * Validates format object\n * @param dh JSAPI instance\n * @param format Format object\n * @returns true for valid object\n */\n static isValid(dh: typeof DhType, format: TableColumnFormat): boolean {\n return true;\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 | null,\n formatB: TableColumnFormat | null\n ): boolean {\n throw new Error('isSameFormat not implemented');\n }\n\n /**\n * Create and return a Format object\n * @param label The label of the format object\n * @param formatString Format string to use for the format\n * @param type The type of column to use for this format\n * @returns A format object\n */\n static makeFormat(\n label: string,\n formatString: string,\n type: TableColumnFormatType\n ): TableColumnFormat {\n return { label, formatString, type };\n }\n\n /**\n * @param value The value to format\n * @param format Optional format object with value transformation options\n * @returns String the formatted text string of the value passed in.\n */\n format(value: T, format?: Partial<TableColumnFormat>): string {\n return '';\n }\n}\n\nexport default TableColumnFormatter;\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;;AAeA,OAAO,MAAMA,oBAAoB,CAAc;EAO7C;AACF;AACA;AACA;AACA;AACA;EACE,OAAOC,OAAOA,CAACC,EAAiB,EAAEC,MAAyB,EAAW;IACpE,OAAO,IAAI;EACb;;EAEA;AACF;AACA;AACA;AACA;AACA;EACE,OAAOC,YAAYA,CACjBC,OAAiC,EACjCC,OAAiC,EACxB;IACT,MAAM,IAAIC,KAAK,CAAC,8BAA8B,CAAC;EACjD;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACE,OAAOC,UAAUA,CACfC,KAAa,EACbC,YAAoB,EACpBC,IAA2B,EACR;IACnB,OAAO;MAAEF,KAAK;MAAEC,YAAY;MAAEC;IAAK,CAAC;EACtC;;EAEA;AACF;AACA;AACA;AACA;EACER,MAAMA,CAACS,KAAQ,EAAET,MAAmC,EAAU;IAC5D,OAAO,EAAE;EACX;AACF;AAACU,eAAA,CArDYb,oBAAoB,iBACa,aAAa;AAAAa,eAAA,CAD9Cb,oBAAoB,yBAGqB,qBAAqB;AAAAa,eAAA,CAH9Db,oBAAoB,yBAKqB,qBAAqB;AAkD3E,eAAeA,oBAAoB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default","BooleanColumnFormatter","CharColumnFormatter","DefaultColumnFormatter","TableColumnFormatter"],"sources":["../../src/formatters/index.ts"],"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';\nexport * from './StringColumnFormatter';\n"],"mappings":"SAASA,OAAO,IAAIC,sBAAsB;AAAA,SACjCD,OAAO,IAAIE,mBAAmB;AAAA;AAAA;AAAA,SAG9BF,OAAO,IAAIG,sBAAsB;AAAA;AAAA,SAEjCH,OAAO,IAAII,oBAAoB;AAAA;AAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","BooleanColumnFormatter","CharColumnFormatter","DefaultColumnFormatter","TableColumnFormatter"],"sources":["../../src/formatters/index.ts"],"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';\nexport * from './StringColumnFormatter';\n"],"mappings":"SAASA,OAAO,IAAIC,sBAAsB;AAAA,SACjCD,OAAO,IAAIE,mBAAmB;AAAA;AAAA;AAAA,SAG9BF,OAAO,IAAIG,sBAAsB;AAAA;AAAA,SAEjCH,OAAO,IAAII,oBAAoB;AAAA;AAAA","ignoreList":[]}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default","FormatterUtils"],"sources":["../src/index.ts"],"sourcesContent":["export * from './ConnectionUtils';\nexport * from './formatters';\nexport * from './DateUtils';\nexport * from './FilterUtils';\nexport * from './Formatter';\nexport { default as FormatterUtils } from './FormatterUtils';\nexport * from './FormatterUtils';\nexport * from './MessageUtils';\nexport * from './NewTableColumnTypes';\nexport * from './NoConsolesError';\nexport * from './SessionUtils';\nexport * from './Settings';\nexport * from './TableUtils';\nexport * from './ViewportDataUtils';\n"],"mappings":";;;;;SAKSA,OAAO,IAAIC,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","FormatterUtils"],"sources":["../src/index.ts"],"sourcesContent":["export * from './ConnectionUtils';\nexport * from './formatters';\nexport * from './DateUtils';\nexport * from './FilterUtils';\nexport * from './Formatter';\nexport { default as FormatterUtils } from './FormatterUtils';\nexport * from './FormatterUtils';\nexport * from './MessageUtils';\nexport * from './NewTableColumnTypes';\nexport * from './NoConsolesError';\nexport * from './SessionUtils';\nexport * from './Settings';\nexport * from './TableUtils';\nexport * from './ViewportDataUtils';\n"],"mappings":";;;;;SAKSA,OAAO,IAAIC,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deephaven/jsapi-utils",
|
|
3
|
-
"version": "1.7.2-beta.
|
|
3
|
+
"version": "1.7.2-beta.3+b369a51e",
|
|
4
4
|
"description": "Deephaven JSAPI Utils",
|
|
5
5
|
"author": "Deephaven Data Labs LLC",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -21,16 +21,16 @@
|
|
|
21
21
|
"build:babel": "babel ./src --out-dir ./dist --extensions \".ts,.tsx,.js,.jsx\" --source-maps --root-mode upward"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@deephaven/filters": "^1.7.2-beta.
|
|
24
|
+
"@deephaven/filters": "^1.7.2-beta.3+b369a51e",
|
|
25
25
|
"@deephaven/jsapi-types": "^1.0.0-dev0.39.4",
|
|
26
|
-
"@deephaven/log": "^1.7.2-beta.
|
|
27
|
-
"@deephaven/utils": "^1.7.2-beta.
|
|
26
|
+
"@deephaven/log": "^1.7.2-beta.3+b369a51e",
|
|
27
|
+
"@deephaven/utils": "^1.7.2-beta.3+b369a51e",
|
|
28
28
|
"lodash.clamp": "^4.0.3",
|
|
29
29
|
"nanoid": "^5.0.7"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@deephaven/jsapi-shim": "^1.7.2-beta.
|
|
33
|
-
"@deephaven/test-utils": "^1.7.2-beta.
|
|
32
|
+
"@deephaven/jsapi-shim": "^1.7.2-beta.3+b369a51e",
|
|
33
|
+
"@deephaven/test-utils": "^1.7.2-beta.3+b369a51e"
|
|
34
34
|
},
|
|
35
35
|
"files": [
|
|
36
36
|
"dist"
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "b369a51ee94d212641a14c6ce1f19fcc85168339"
|
|
43
43
|
}
|