@deephaven/jsapi-utils 0.34.1-relative-links.13 → 0.34.1-relative-links.23
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.d.ts +1 -1
- package/dist/ConnectionUtils.d.ts.map +1 -1
- package/dist/ConnectionUtils.js.map +1 -1
- package/dist/DateUtils.d.ts +1 -1
- package/dist/DateUtils.d.ts.map +1 -1
- package/dist/DateUtils.js.map +1 -1
- package/dist/MessageUtils.d.ts +34 -0
- package/dist/MessageUtils.d.ts.map +1 -0
- package/dist/MessageUtils.js +80 -0
- package/dist/MessageUtils.js.map +1 -0
- package/dist/NoConsolesError.d.ts +6 -0
- package/dist/NoConsolesError.d.ts.map +1 -0
- package/dist/NoConsolesError.js +14 -0
- package/dist/NoConsolesError.js.map +1 -0
- package/dist/SessionUtils.d.ts +28 -0
- package/dist/SessionUtils.d.ts.map +1 -0
- package/dist/SessionUtils.js +93 -0
- package/dist/SessionUtils.js.map +1 -0
- package/dist/TableUtils.d.ts +1 -1
- package/dist/TableUtils.d.ts.map +1 -1
- package/dist/TableUtils.js.map +1 -1
- package/dist/ViewportDataUtils.d.ts +75 -0
- package/dist/ViewportDataUtils.d.ts.map +1 -0
- package/dist/ViewportDataUtils.js +125 -0
- package/dist/ViewportDataUtils.js.map +1 -0
- package/dist/formatters/DateTimeColumnFormatter.d.ts +1 -1
- package/dist/formatters/DateTimeColumnFormatter.d.ts.map +1 -1
- package/dist/formatters/DateTimeColumnFormatter.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/package.json +12 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ViewportDataUtils.js","names":["clamp","Log","log","module","createKeyFromOffsetRow","row","offset","String","offsetInSnapshot","createOnTableUpdatedHandler","table","viewportData","deserializeRow","onTableUpdated","event","rows","detail","debug","forEach","item","columns","keyedItem","key","getItem","update","append","defaultRowDeserializer","reduce","result","col","name","get","generateEmptyKeyedItems","count","i","getSize","isClosed","size","padFirstAndLastRow","firstRow","viewportSize","padding","tableSize","lastRow","min","max","first","last"],"sources":["../src/ViewportDataUtils.ts"],"sourcesContent":["import { ListData } from '@react-stately/data';\nimport clamp from 'lodash.clamp';\nimport { Column, Row, Table, TreeTable } from '@deephaven/jsapi-shim';\nimport Log from '@deephaven/log';\n\nexport interface KeyedItem<T> {\n key: string;\n item?: T;\n}\n\nexport type OnTableUpdatedEvent = CustomEvent<{\n offset: number;\n rows: ViewportRow[];\n}>;\n\nexport type RowDeserializer<T> = (row: ViewportRow, columns: Column[]) => T;\n\nexport type ViewportRow = Row & { offsetInSnapshot: number };\n\nconst log = Log.module('ViewportDataUtils');\n\n/**\n * Create a unique string key for a row based on its ordinal position in its\n * source table. This is calculated based on it's offset in the viewport\n * (row.offsetInSnapshot) + the offset of the snapshot.\n * @param row Row from a Table update event.\n * @param offset Offset of the current viewport.\n * @returns Unique string key for the oridinal position of the given row.\n */\nexport function createKeyFromOffsetRow(row: ViewportRow, offset: number) {\n return String(row.offsetInSnapshot + offset);\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 added to or updated in the given\n * `viewportData` object.\n * @param table DH table instance.\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 table: Table | TreeTable | null,\n viewportData: ListData<KeyedItem<T>>,\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 if (table == null) {\n return;\n }\n\n const { offset, rows } = event.detail;\n\n log.debug('table updated', event.detail);\n\n rows.forEach(row => {\n const item = deserializeRow(row, table.columns);\n\n const keyedItem = {\n key: createKeyFromOffsetRow(row, offset),\n item,\n };\n\n if (viewportData.getItem(keyedItem.key) != null) {\n viewportData.update(keyedItem.key, keyedItem);\n } else {\n viewportData.append(keyedItem);\n }\n });\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: ViewportRow,\n columns: 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);\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 count The number of items to generate\n */\nexport function* generateEmptyKeyedItems<T>(\n count: number\n): Generator<KeyedItem<T>, void, unknown> {\n // eslint-disable-next-line no-plusplus\n for (let i = 0; i < count; ++i) {\n yield { key: String(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?: Table | TreeTable | null): number {\n return table == null || isClosed(table) ? 0 : table.size;\n}\n\n/**\n * Check if a given table is closed. Tree tables don't have an `isClosed` prop,\n * so will always return false.\n * @param table The table to check if it is closed.\n */\nexport function isClosed(table: Table | TreeTable): boolean {\n if ('isClosed' in table) {\n return table.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;AAgBhC,IAAMC,GAAG,GAAGD,GAAG,CAACE,MAAM,CAAC,mBAAmB,CAAC;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsB,CAACC,GAAgB,EAAEC,MAAc,EAAE;EACvE,OAAOC,MAAM,CAACF,GAAG,CAACG,gBAAgB,GAAGF,MAAM,CAAC;AAC9C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,2BAA2B,CACzCC,KAA+B,EAC/BC,YAAoC,EACpCC,cAAkC,EACI;EACtC;AACF;AACA;EACE,OAAO,SAASC,cAAc,CAACC,KAA0B,EAAE;IACzD,IAAIJ,KAAK,IAAI,IAAI,EAAE;MACjB;IACF;IAEA,IAAM;MAAEJ,MAAM;MAAES;IAAK,CAAC,GAAGD,KAAK,CAACE,MAAM;IAErCd,GAAG,CAACe,KAAK,CAAC,eAAe,EAAEH,KAAK,CAACE,MAAM,CAAC;IAExCD,IAAI,CAACG,OAAO,CAACb,GAAG,IAAI;MAClB,IAAMc,IAAI,GAAGP,cAAc,CAACP,GAAG,EAAEK,KAAK,CAACU,OAAO,CAAC;MAE/C,IAAMC,SAAS,GAAG;QAChBC,GAAG,EAAElB,sBAAsB,CAACC,GAAG,EAAEC,MAAM,CAAC;QACxCa;MACF,CAAC;MAED,IAAIR,YAAY,CAACY,OAAO,CAACF,SAAS,CAACC,GAAG,CAAC,IAAI,IAAI,EAAE;QAC/CX,YAAY,CAACa,MAAM,CAACH,SAAS,CAACC,GAAG,EAAED,S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C,YAAY,GAAG,CAAC;EAC3C,IAAM,CAACI,GAAG,EAAEC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAEH,SAAS,GAAG,CAAC,CAAC;EAErC,IAAMI,KAAK,GAAG9C,KAAK,CAACuC,QAAQ,GAAGE,OAAO,EAAEG,GAAG,EAAEC,GAAG,CAAC;EACjD,IAAME,IAAI,GAAG/C,KAAK,CAAC2C,OAAO,GAAGF,OAAO,EAAEG,GAAG,EAAEC,GAAG,CAAC;EAE/C,OAAO,CAACC,KAAK,EAAEC,IAAI,CAAC;AACtB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DateWrapper, TimeZone } from '@deephaven/jsapi-
|
|
1
|
+
import type { DateWrapper, TimeZone } from '@deephaven/jsapi-types';
|
|
2
2
|
import TableColumnFormatter, { TableColumnFormat } from './TableColumnFormatter';
|
|
3
3
|
export type DateTimeColumnFormatterOptions = {
|
|
4
4
|
timeZone?: string;
|
|
@@ -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":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEpE,OAAO,oBAAoB,EAAE,EAC3B,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAIhC,MAAM,MAAM,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,MAA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IAAI,GAAG,WAAW,GAAG,MAAM,EAClC,MAAM,GAAE,OAAO,CAAC,iBAAiB,CAAM,GACtC,MAAM;CAiBV;AAED,eAAe,uBAAuB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimeColumnFormatter.js","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","undefined","getFormats","constructor","timeZone","timeZoneParam","defaultDateTimeFormatString","DEFAULT_DATETIME_FORMAT_STRING","DEFAULT_TIME_ZONE_ID","dhTimeZone","TimeZone","getTimeZone","error","getEffectiveFormatString","baseFormatString","get","value"],"sources":["../../src/formatters/DateTimeColumnFormatter.ts"],"sourcesContent":["/* eslint class-methods-use-this: \"off\" */\nimport dh
|
|
1
|
+
{"version":3,"file":"DateTimeColumnFormatter.js","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","undefined","getFormats","constructor","timeZone","timeZoneParam","defaultDateTimeFormatString","DEFAULT_DATETIME_FORMAT_STRING","DEFAULT_TIME_ZONE_ID","dhTimeZone","TimeZone","getTimeZone","error","getEffectiveFormatString","baseFormatString","get","value"],"sources":["../../src/formatters/DateTimeColumnFormatter.ts"],"sourcesContent":["/* eslint class-methods-use-this: \"off\" */\nimport dh from '@deephaven/jsapi-shim';\nimport type { DateWrapper, TimeZone } from '@deephaven/jsapi-types';\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: Pick<TableColumnFormat, 'formatString'>): 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 | 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 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: 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 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;AACA,OAAOA,EAAE,MAAM,uBAAuB;AAEtC,OAAOC,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;EACE,OAAOI,OAAO,CAACC,MAA+C,EAAW;IACvE,IAAI;MACFP,EAAE,CAACQ,IAAI,CAACC,cAAc,CAACF,MAAM,CAACA,MAAM,CAACG,YAAY,EAAE,IAAIC,IAAI,EAAE,CAAC;MAC9D,OAAO,IAAI;IACb,CAAC,CAAC,OAAOC,CAAC,EAAE;MACV,OAAO,KAAK;IACd;EACF;EAEA,OAAOC,UAAU,CACfC,KAAa,EACbJ,YAAoB,EAED;IAAA,IADnBK,IAAI,uEAAG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IAChC,IAAI,CAACC,cAAc,GAAGA,cAAc;IACpC,IAAI,CAACK,eAAe,GAAGtB,uBAAuB,CAACwB,mBAAmB,CAChER,YAAY,EACZC,cAAc,CACf;EACH;EAEAoB,wBAAwB,CAACC,gBAAwB,EAAU;IAAA;IACzD,gCAAO,IAAI,CAAChB,eAAe,CAACiB,GAAG,CAACD,gBAAgB,CAAC,yEAAIA,gBAAgB;EACvE;EAEApC,MAAM,CACJsC,KAAkC,EAE1B;IAAA,IADRtC,MAAkC,uEAAG,CAAC,CAAC;IAEvC,IAAMoC,gBAAgB,GACpBpC,MAAM,CAACG,YAAY,IAAI,IAAI,IAAIH,MAAM,CAACG,YAAY,KAAK,EAAE,GACrDH,MAAM,CAACG,YAAY,GACnB,IAAI,CAACyB,2BAA2B;IACtC,IAAMzB,YAAY,GAAG,IAAI,CAACgC,wBAAwB,CAACC,gBAAgB,CAAC;IACpE,IAAI;MACF,OAAO3C,EAAE,CAACQ,IAAI,CAACC,cAAc,CAACF,MAAM,CAClCG,YAAY,EACZmC,KAAK,EACL,IAAI,CAACP,UAAU,CAChB;IACH,CAAC,CAAC,OAAO1B,CAAC,EAAE;MACVT,GAAG,CAACsC,KAAK,CAAC,0BAA0B,CAAC;IACvC;IACA,OAAO,EAAE;EACX;AACF;AAAC,gBA/KYpC,uBAAuB,oCAgDM,yBAAyB;AAAA,gBAhDtDA,uBAAuB,0BAkDJ,kBAAkB;AA+HlD,eAAeA,uBAAuB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,10 @@ export * from './DateUtils';
|
|
|
4
4
|
export * from './Formatter';
|
|
5
5
|
export { default as FormatterUtils } from './FormatterUtils';
|
|
6
6
|
export * from './FormatterUtils';
|
|
7
|
+
export * from './MessageUtils';
|
|
8
|
+
export * from './NoConsolesError';
|
|
9
|
+
export * from './SessionUtils';
|
|
7
10
|
export * from './Settings';
|
|
8
11
|
export * from './TableUtils';
|
|
12
|
+
export * from './ViewportDataUtils';
|
|
9
13
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,10 @@ export * from "./DateUtils.js";
|
|
|
4
4
|
export * from "./Formatter.js";
|
|
5
5
|
export { default as FormatterUtils } from "./FormatterUtils.js";
|
|
6
6
|
export * from "./FormatterUtils.js";
|
|
7
|
+
export * from "./MessageUtils.js";
|
|
8
|
+
export * from "./NoConsolesError.js";
|
|
9
|
+
export * from "./SessionUtils.js";
|
|
7
10
|
export * from "./Settings.js";
|
|
8
11
|
export * from "./TableUtils.js";
|
|
12
|
+
export * from "./ViewportDataUtils.js";
|
|
9
13
|
//# sourceMappingURL=index.js.map
|
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 './Formatter';\nexport { default as FormatterUtils } from './FormatterUtils';\nexport * from './FormatterUtils';\nexport * from './Settings';\nexport * from './TableUtils';\n"],"mappings":";;;;SAISA,OAAO,IAAIC,cAAc;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 './Formatter';\nexport { default as FormatterUtils } from './FormatterUtils';\nexport * from './FormatterUtils';\nexport * from './MessageUtils';\nexport * from './NoConsolesError';\nexport * from './SessionUtils';\nexport * from './Settings';\nexport * from './TableUtils';\nexport * from './ViewportDataUtils';\n"],"mappings":";;;;SAISA,OAAO,IAAIC,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deephaven/jsapi-utils",
|
|
3
|
-
"version": "0.34.1-relative-links.
|
|
3
|
+
"version": "0.34.1-relative-links.23+4a37c7e4",
|
|
4
4
|
"description": "Deephaven JSAPI Utils",
|
|
5
5
|
"author": "Deephaven Data Labs LLC",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -21,19 +21,24 @@
|
|
|
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": "^0.34.1-relative-links.
|
|
25
|
-
"@deephaven/jsapi-shim": "^0.34.1-relative-links.
|
|
26
|
-
"@deephaven/
|
|
27
|
-
"@deephaven/
|
|
24
|
+
"@deephaven/filters": "^0.34.1-relative-links.23+4a37c7e4",
|
|
25
|
+
"@deephaven/jsapi-shim": "^0.34.1-relative-links.23+4a37c7e4",
|
|
26
|
+
"@deephaven/jsapi-types": "^0.34.1-relative-links.23+4a37c7e4",
|
|
27
|
+
"@deephaven/log": "^0.34.1-relative-links.23+4a37c7e4",
|
|
28
|
+
"@deephaven/utils": "^0.34.1-relative-links.23+4a37c7e4",
|
|
29
|
+
"@react-stately/data": "^3.9.1",
|
|
30
|
+
"lodash.clamp": "^4.0.3",
|
|
31
|
+
"shortid": "^2.2.16"
|
|
28
32
|
},
|
|
29
33
|
"devDependencies": {
|
|
30
|
-
"@deephaven/tsconfig": "^0.34.1-relative-links.
|
|
34
|
+
"@deephaven/tsconfig": "^0.34.1-relative-links.23+4a37c7e4"
|
|
31
35
|
},
|
|
32
36
|
"files": [
|
|
33
37
|
"dist"
|
|
34
38
|
],
|
|
39
|
+
"sideEffects": false,
|
|
35
40
|
"publishConfig": {
|
|
36
41
|
"access": "public"
|
|
37
42
|
},
|
|
38
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "4a37c7e4f53c5c99ff185be1ac9f7800b6065d98"
|
|
39
44
|
}
|