@deephaven/iris-grid 1.22.2-alpha-pivot-builder.0 → 1.23.0
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/README.md +13 -1
- package/dist/CommonTypes.d.ts +26 -4
- package/dist/CommonTypes.d.ts.map +1 -1
- package/dist/CommonTypes.js.map +1 -1
- package/dist/FilterInputField.css +3 -0
- package/dist/FilterInputField.css.map +1 -1
- package/dist/IrisGrid.css +3 -0
- package/dist/IrisGrid.css.map +1 -1
- package/dist/IrisGrid.d.ts +21 -9
- package/dist/IrisGrid.d.ts.map +1 -1
- package/dist/IrisGrid.js +54 -30
- package/dist/IrisGrid.js.map +1 -1
- package/dist/IrisGridModel.d.ts +7 -1
- package/dist/IrisGridModel.d.ts.map +1 -1
- package/dist/IrisGridModel.js +7 -1
- package/dist/IrisGridModel.js.map +1 -1
- package/dist/IrisGridProxyModel.js +1 -1
- package/dist/IrisGridProxyModel.js.map +1 -1
- package/dist/sidebar/OptionType.d.ts +11 -4
- package/dist/sidebar/OptionType.d.ts.map +1 -1
- package/dist/sidebar/OptionType.js +9 -3
- package/dist/sidebar/OptionType.js.map +1 -1
- package/dist/sidebar/PluginTableOptionsErrorBoundary.d.ts +6 -11
- package/dist/sidebar/PluginTableOptionsErrorBoundary.d.ts.map +1 -1
- package/dist/sidebar/PluginTableOptionsErrorBoundary.js +14 -20
- package/dist/sidebar/PluginTableOptionsErrorBoundary.js.map +1 -1
- package/dist/sidebar/index.d.ts +2 -2
- package/dist/sidebar/index.d.ts.map +1 -1
- package/dist/sidebar/index.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/SearchWithModal.css +3 -0
- package/dist/sidebar/visibility-ordering-builder/SearchWithModal.css.map +1 -1
- package/package.json +16 -16
package/dist/IrisGridModel.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ declare abstract class IrisGridModel<TEventMap extends Record<string, Event<stri
|
|
|
43
43
|
* every inner-model swap regardless of model class, so the host can reset
|
|
44
44
|
* view state (e.g. `movedColumns`) that the previous model owned.
|
|
45
45
|
*/
|
|
46
|
-
readonly
|
|
46
|
+
readonly SCHEMA_CHANGED: "SCHEMA_CHANGED";
|
|
47
47
|
readonly FILTERS_CHANGED: "FILTERS_CHANGED";
|
|
48
48
|
readonly SORTS_CHANGED: "SORTS_CHANGED";
|
|
49
49
|
readonly DISCONNECT: "DISCONNECT";
|
|
@@ -64,6 +64,12 @@ declare abstract class IrisGridModel<TEventMap extends Record<string, Event<stri
|
|
|
64
64
|
* naturally end in `UPDATED` / `COLUMNS_CHANGED` / `REQUEST_FAILED`.
|
|
65
65
|
* Built-in operations never need this; their existing events clear the
|
|
66
66
|
* scrim.
|
|
67
|
+
*
|
|
68
|
+
* Assumes a single outstanding model-driven operation: the scrim is not
|
|
69
|
+
* ref-counted, so a `PENDING_CLEARED` clears it regardless of other
|
|
70
|
+
* in-flight operations. Ref-counting is deferred to the planned migration
|
|
71
|
+
* that routes built-in `startLoading` calls through these events, where a
|
|
72
|
+
* depth counter can stay balanced.
|
|
67
73
|
*/
|
|
68
74
|
readonly PENDING_CLEARED: "PENDING_CLEARED";
|
|
69
75
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IrisGridModel.d.ts","sourceRoot":"","sources":["../src/IrisGridModel.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,SAAS,EACT,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,YAAY,EAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,cA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AK,EAAE,OAAO,EACd,WAAW,CAAC,EAAE,OAAO,EACrB,QAAQ,CAAC,EAAE,OAAO,EAClB,WAAW,CAAC,EAAE,OAAO,GACpB,OAAO,CAAC,MAAM,CAAC;IAElB,IAAI,kBAAkB,IAAI,OAAO,CAEhC;IAED,QAAQ,KAAK,kBAAkB,IAAI,SAAS,iBAAiB,EAAE,CAAC;IAEhE,QAAQ,KAAK,kBAAkB,CAAC,MAAM,EAAE,SAAS,iBAAiB,EAAE,EAAE;IAEtE,QAAQ,KAAK,oBAAoB,IAAI,WAAW,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAE5E,QAAQ,CAAC,0BAA0B,CACjC,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,MAAM,GACZ,iBAAiB,GAAG,SAAS;IAEhC,qBAAqB,CACnB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,aAAa,GACnB,cAAc;IAIjB,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI;CAGnE;AAED,eAAe,aAAa,CAAC"}
|
package/dist/IrisGridModel.js
CHANGED
|
@@ -502,7 +502,7 @@ _defineProperty(IrisGridModel, "EVENT", Object.freeze({
|
|
|
502
502
|
* every inner-model swap regardless of model class, so the host can reset
|
|
503
503
|
* view state (e.g. `movedColumns`) that the previous model owned.
|
|
504
504
|
*/
|
|
505
|
-
|
|
505
|
+
SCHEMA_CHANGED: 'SCHEMA_CHANGED',
|
|
506
506
|
FILTERS_CHANGED: 'FILTERS_CHANGED',
|
|
507
507
|
SORTS_CHANGED: 'SORTS_CHANGED',
|
|
508
508
|
DISCONNECT: 'DISCONNECT',
|
|
@@ -523,6 +523,12 @@ _defineProperty(IrisGridModel, "EVENT", Object.freeze({
|
|
|
523
523
|
* naturally end in `UPDATED` / `COLUMNS_CHANGED` / `REQUEST_FAILED`.
|
|
524
524
|
* Built-in operations never need this; their existing events clear the
|
|
525
525
|
* scrim.
|
|
526
|
+
*
|
|
527
|
+
* Assumes a single outstanding model-driven operation: the scrim is not
|
|
528
|
+
* ref-counted, so a `PENDING_CLEARED` clears it regardless of other
|
|
529
|
+
* in-flight operations. Ref-counting is deferred to the planned migration
|
|
530
|
+
* that routes built-in `startLoading` calls through these events, where a
|
|
531
|
+
* depth counter can stay balanced.
|
|
526
532
|
*/
|
|
527
533
|
PENDING_CLEARED: 'PENDING_CLEARED'
|
|
528
534
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IrisGridModel.js","names":["GridModel","EventShimCustomEvent","EMPTY_ARRAY","EMPTY_SET","Set","IrisGridModel","constructor","dh","_defineProperty","listenerCount","addEventListener","type0","callback0","options0","startListening","removeEventListener","stopListening","dispatchPending","detail","dispatchEvent","EVENT","PENDING","aggregatedColumns","groupedColumns","originalColumns","columns","sourceForCell","column","row","getClearFilterRange","isFilterable","initialMovedColumns","initialMovedRows","initialColumnHeaderGroups","layoutHints","frontColumns","backColumns","keyColumnSet","valueColumnSet","frozenColumns","isColumnFrozen","index","isColumnSortable","isFilterRequired","isReversible","isColumnStatisticsAvailable","description","isAggregatedColumnsAvailable","isCustomColumnsAvailable","isFormatColumnsAvailable","isExportAvailable","isValuesTableAvailable","isChartBuilderAvailable","isOrganizeColumnsAvailable","isRollupAvailable","isSelectDistinctAvailable","isTotalsAvailable","isViewportPending","columnIndex","close","isRowMovable","isSeekRowAvailable","dataBarOptionsForCell","theme","Error","tooltipForCell","Object","freeze","UPDATED","FORMATTER_UPDATED","REQUEST_FAILED","COLUMNS_CHANGED","TABLE_CHANGED","MODEL_CHANGED","FILTERS_CHANGED","SORTS_CHANGED","DISCONNECT","RECONNECT","TOTALS_UPDATED","PENDING_DATA_UPDATED","VIEWPORT_UPDATED","PENDING_CLEARED"],"sources":["../src/IrisGridModel.ts"],"sourcesContent":["/* eslint-disable class-methods-use-this */\nimport type { Event, EventTarget } from 'event-target-shim';\nimport {\n type BoundedAxisRange,\n type DataBarGridModel,\n type DataBarOptions,\n type GridCell,\n GridModel,\n type GridRange,\n type GridThemeType,\n type ModelIndex,\n type MoveOperation,\n type VisibleIndex,\n} from '@deephaven/grid';\nimport type { dh as DhType } from '@deephaven/jsapi-types';\nimport { type Formatter, type SortDescriptor } from '@deephaven/jsapi-utils';\nimport { EventShimCustomEvent } from '@deephaven/utils';\nimport {\n type ColumnName,\n type UITotalsTableConfig,\n type PendingDataMap,\n type PendingDataErrorMap,\n type PendingOperationDetail,\n} from './CommonTypes';\nimport type ColumnHeaderGroup from './ColumnHeaderGroup';\n\nexport type DisplayColumn = DhType.Column & {\n /**\n * Name to display with the column.\n * The `name` property on `Column` is a unique identifier and must be a valid Java identifier,\n * whereas `displayName` can be any string and does not need to be unique.\n */\n displayName?: string;\n\n /**\n * Whether this column is a proxy column for other columns or not.\n * If it's a proxy column, it may not appear in some lists.\n */\n isProxy?: boolean;\n};\n\ntype IrisGridModelEventNames =\n (typeof IrisGridModel.EVENT)[keyof typeof IrisGridModel.EVENT];\n\ntype IrisGridModelEventMap = {\n [E in IrisGridModelEventNames]: Event<E>;\n};\n\nconst EMPTY_ARRAY: never[] = [];\nconst EMPTY_SET: Set<never> = new Set();\n\n/**\n * Abstract class that extends the GridModel to have more functionality, like filtering and sorting.\n * For use from IrisGrid.\n * Provides some abstraction from the dh.Table and dh.TreeTable classes, so we can treat them somewhat the same.\n * Note that it still uses dh.Column, dh.FilterCondition, dh.Sort, etc., still. Theoretically should abstract\n * those out as well, so there's no dependency on IrisAPI at all, but it's a lot of work for no real gain at this time.\n */\nabstract class IrisGridModel<\n TEventMap extends Record<string, Event<string>> = Record<\n string,\n Event<string>\n >,\n TMode extends 'standard' | 'strict' = 'standard',\n >\n extends GridModel<TEventMap & IrisGridModelEventMap, TMode>\n implements DataBarGridModel\n{\n static EVENT = Object.freeze({\n UPDATED: 'UPDATED',\n FORMATTER_UPDATED: 'FORMATTER_UPDATED',\n REQUEST_FAILED: 'REQUEST_FAILED',\n COLUMNS_CHANGED: 'COLUMNS_CHANGED',\n TABLE_CHANGED: 'TABLE_CHANGED',\n /**\n * Fired by `IrisGridProxyModel` whenever its inner model is swapped for a\n * different instance (e.g. pivot-builder swapping a table model for a pivot\n * model, or back). The `detail` is the new inner model. Unlike\n * `TABLE_CHANGED` (only dispatched for table-template models), this fires on\n * every inner-model swap regardless of model class, so the host can reset\n * view state (e.g. `movedColumns`) that the previous model owned.\n */\n MODEL_CHANGED: 'MODEL_CHANGED',\n FILTERS_CHANGED: 'FILTERS_CHANGED',\n SORTS_CHANGED: 'SORTS_CHANGED',\n DISCONNECT: 'DISCONNECT',\n RECONNECT: 'RECONNECT',\n TOTALS_UPDATED: 'TOTALS_UPDATED',\n /** Fired when the viewport is applied to the table and we're waiting for a response. */\n PENDING_DATA_UPDATED: 'PENDING_DATA_UPDATED',\n VIEWPORT_UPDATED: 'VIEWPORT_UPDATED',\n /**\n * Fired when an async, config-changing operation has begun. Raises the\n * IrisGrid loading scrim. Detail is an optional, self-describing\n * {@link PendingOperationDetail} so an initiator (e.g. a plugin) can raise\n * the scrim for an operation IrisGrid has no built-in knowledge of.\n */\n PENDING: 'PENDING',\n /**\n * Optional completion signal for a pending operation that does NOT\n * naturally end in `UPDATED` / `COLUMNS_CHANGED` / `REQUEST_FAILED`.\n * Built-in operations never need this; their existing events clear the\n * scrim.\n */\n PENDING_CLEARED: 'PENDING_CLEARED',\n } as const);\n\n constructor(dh: typeof DhType) {\n super();\n\n this.dh = dh;\n this.listenerCount = 0;\n }\n\n dh: typeof DhType;\n\n listenerCount: number;\n\n // Pulled directly from event-target-shim implementation signature\n // https://github.com/mysticatea/event-target-shim/blob/master/src/lib/event-target.ts#L99\n // Using Parameters<GridModel['addEventListener']> doesn't work\n addEventListener<T extends string & keyof TEventMap>(\n type0: T,\n callback0?: EventTarget.EventListener<this, TEventMap[T]> | null,\n options0?: boolean | EventTarget.AddOptions\n ): void {\n super.addEventListener(type0, callback0 as never, options0 as never);\n\n this.listenerCount += 1;\n if (this.listenerCount === 1) {\n this.startListening();\n }\n }\n\n removeEventListener<T extends string & keyof TEventMap>(\n type0: T,\n callback0?: EventTarget.EventListener<this, TEventMap[T]> | null,\n options0?: boolean | EventTarget.Options\n ): void {\n super.removeEventListener(type0, callback0 as never, options0 as never);\n\n this.listenerCount -= 1;\n if (this.listenerCount === 0) {\n this.stopListening();\n }\n }\n\n /**\n * Function called when first listener is added.\n * Override for implementation specific behaviour.\n */\n startListening(): void {\n // no-op\n }\n\n /**\n * Function called when last listener is removed.\n * Override for implementation specific behaviour.\n */\n stopListening(): void {\n // no-op\n }\n\n /**\n * Dispatch a `PENDING` event to raise the IrisGrid loading scrim for an\n * async, config-changing operation initiated on this model.\n * @param detail Optional self-describing detail (scrim text and options).\n */\n protected dispatchPending(detail?: PendingOperationDetail): void {\n this.dispatchEvent(\n new EventShimCustomEvent(IrisGridModel.EVENT.PENDING, {\n detail,\n }) as never\n );\n }\n\n /**\n * Gets the columns for this model\n * @returns All columns in the model\n */\n abstract get columns(): readonly DisplayColumn[];\n\n /**\n * Retrieve the aggregated columns for this model\n * @returns The columns that are aggregated\n */\n get aggregatedColumns(): readonly DisplayColumn[] {\n return EMPTY_ARRAY;\n }\n\n /**\n * Retrieve the grouped columns for this model\n * @returns The columns that are grouped\n */\n get groupedColumns(): readonly DisplayColumn[] {\n return EMPTY_ARRAY;\n }\n\n /**\n * Gets the columns for the model before any transformations (such as rollups) are applied.\n * @returns All original columns in the model.\n */\n get originalColumns(): readonly DisplayColumn[] {\n return this.columns;\n }\n\n /**\n * Gets the column index for this model\n * @param name The model column name.\n * @returns The numeric index of the requested column.\n */\n abstract getColumnIndexByName(name: string): ModelIndex | undefined;\n\n /**\n * Retrieve the source cell for a given cell. Returns something different if the cell is a proxied cell\n * that retrieves data from another cell.\n * @param column Column to get the source for\n * @param row Row to get the source for\n * @returns Source cell where the data is coming from\n */\n sourceForCell(column: ModelIndex, row: ModelIndex): GridCell {\n return { column, row };\n }\n\n /**\n * Retrieve the range of columns to clear filters on for a given column.\n * @param column Column to get the range of filters to clear.\n * @returns Axis range of the column filters to clear, or `null` if this should not have a clear filter option.\n */\n getClearFilterRange(column: ModelIndex): BoundedAxisRange | null {\n if (this.isFilterable(column)) {\n return [column, column];\n }\n return null;\n }\n\n /** List of column movements defined by the model. Used as initial movements for IrisGrid */\n get initialMovedColumns(): readonly MoveOperation[] {\n return EMPTY_ARRAY;\n }\n\n /** List of row movements defined by the model. Used as initial movements for IrisGrid */\n get initialMovedRows(): readonly MoveOperation[] {\n return EMPTY_ARRAY;\n }\n\n /** List of column header groups defined by the model */\n get initialColumnHeaderGroups(): readonly ColumnHeaderGroup[] {\n return EMPTY_ARRAY;\n }\n\n /**\n * @param column The model column index\n * @param row The model row index\n * @returns The format stored for that cell\n */\n abstract formatForCell(\n column: ModelIndex,\n row: ModelIndex\n ): DhType.Format | undefined;\n\n /**\n * @param column The model column index\n * @param row The model row index\n * @returns The value stored for that cell\n */\n abstract valueForCell(column: ModelIndex, row: ModelIndex): unknown;\n\n /**\n * @returns The filters set on this model\n */\n abstract get filter(): readonly DhType.FilterCondition[];\n\n /**\n * @param filter The filters to set\n */\n abstract set filter(filter: readonly DhType.FilterCondition[]);\n\n /**\n * @returns The formatter used when formatting data\n */\n abstract get formatter(): Formatter;\n\n /**\n * @param formatter The formatter to set\n */\n abstract set formatter(formatter: Formatter);\n\n /**\n * @returns The column alignment map\n */\n abstract get columnAlignmentMap(): ReadonlyMap<string, CanvasTextAlign>;\n\n /**\n * @param columnAlignmentMap The column alignment map to set\n */\n abstract set columnAlignmentMap(\n columnAlignmentMap: Map<string, CanvasTextAlign>\n );\n\n /**\n * @param value The value to format\n * @param columnType The column type to format\n * @param columnName The column name to format\n */\n abstract displayString(\n value: unknown,\n columnType: string,\n columnName?: ColumnName\n ): string;\n\n /**\n * @returns The sorts used on this model\n */\n abstract get sort(): readonly SortDescriptor[];\n\n /**\n * @param sort The sorts to use on this model\n */\n abstract set sort(sort: readonly SortDescriptor[]);\n\n /**\n /**\n * @returns The custom columns on this model\n */\n abstract get customColumns(): readonly ColumnName[];\n\n /**\n * @param customColumns The custom columns to use\n */\n abstract set customColumns(customColumns: readonly ColumnName[]);\n\n /**\n * @returns The format columns on this model\n */\n abstract get formatColumns(): readonly DhType.CustomColumn[];\n\n /**\n * @param formatColumns The format columns to use\n */\n abstract set formatColumns(formatColumns: readonly DhType.CustomColumn[]);\n\n /**\n * @param columns The columns to treat as frozen\n */\n abstract updateFrozenColumns(columns: readonly ColumnName[]): void;\n\n /**\n * @returns The config to use for rolling up this table\n */\n abstract get rollupConfig(): DhType.RollupConfig | null;\n\n abstract set rollupConfig(rollupConfig: DhType.RollupConfig | null);\n\n /**\n * @returns The config to use for the totals table of this model\n */\n abstract get totalsConfig(): UITotalsTableConfig | null;\n\n abstract set totalsConfig(totalsConfig: UITotalsTableConfig | null);\n\n /**\n * @returns The LayoutHints to use for the columns of this table model\n */\n get layoutHints(): DhType.LayoutHints | null | undefined {\n return null;\n }\n\n /**\n * @returns Names of columns which should be locked to the front, but not floating\n */\n get frontColumns(): readonly ColumnName[] {\n return EMPTY_ARRAY;\n }\n\n /**\n * @returns Names of columns which should be locked to the back, but not floating\n */\n get backColumns(): readonly ColumnName[] {\n return EMPTY_ARRAY;\n }\n\n /**\n * @returns Names of key columns\n */\n get keyColumnSet(): Set<ColumnName> {\n return EMPTY_SET;\n }\n\n /**\n * @returns Names of value columns\n */\n get valueColumnSet(): Set<ColumnName> {\n return EMPTY_SET;\n }\n\n /**\n * @returns Names of columns which should be frozen to the front and floating\n */\n get frozenColumns(): readonly ColumnName[] {\n return EMPTY_ARRAY;\n }\n\n /**\n * @param index The column index to check\n * @returns Whether the column is one of LayoutHints' frozen columns\n */\n isColumnFrozen(index: ModelIndex): boolean {\n return false;\n }\n\n /**\n * @param index The column index to check\n * @returns Whether the column is sortable\n */\n isColumnSortable(index: ModelIndex): boolean {\n return false;\n }\n\n /**\n * @deprecated Replaced with isPartitionRequired()\n * @returns True if this model requires a filter to be set\n */\n get isFilterRequired(): boolean {\n return false;\n }\n\n get isReversible(): boolean {\n return true;\n }\n\n /**\n * @returns Returns a raw table that is frozen and can be used for exporting data\n */\n abstract export(): Promise<DhType.Table>;\n\n /**\n * @returns True if this model supports the columnStatistics(column) function\n */\n get isColumnStatisticsAvailable(): boolean {\n return false;\n }\n\n /**\n * The description for this model.\n * @returns The description of the model\n */\n get description(): string {\n return '';\n }\n\n /**\n * @param column The column to get statistics for\n * @returns The column statistics\n */\n abstract columnStatistics(\n column: DhType.Column\n ): Promise<DhType.ColumnStatistics>;\n\n /**\n * @returns True if this model supports aggregatedColumns\n */\n get isAggregatedColumnsAvailable(): boolean {\n return false;\n }\n\n /**\n * @returns True if this model supports customColumns\n */\n get isCustomColumnsAvailable(): boolean {\n return false;\n }\n\n /**\n * @returns True if this model supports customColumns\n */\n get isFormatColumnsAvailable(): boolean {\n return false;\n }\n\n /**\n * @returns True if this model supports the export() function\n */\n get isExportAvailable(): boolean {\n return false;\n }\n\n /**\n * @returns True if this model supports the valuesTable(column) function\n */\n get isValuesTableAvailable(): boolean {\n return false;\n }\n\n /**\n * @returns True if this model should allow the chart builder\n */\n get isChartBuilderAvailable(): boolean {\n return false;\n }\n\n /**\n * @returns True if this model should allow to organize columns\n */\n get isOrganizeColumnsAvailable(): boolean {\n return false;\n }\n\n /**\n * @returns True if the rollup rows functionality is available\n */\n get isRollupAvailable(): boolean {\n return false;\n }\n\n /**\n * @returns True if select distinct functionality is available\n */\n get isSelectDistinctAvailable(): boolean {\n return false;\n }\n\n /**\n * @returns True if the totals functionality is available\n */\n get isTotalsAvailable(): boolean {\n return false;\n }\n\n /**\n * The names of columns with select distinct enabled\n * @returns An array of column names\n */\n abstract get selectDistinctColumns(): readonly ColumnName[];\n\n /**\n * Set the columns with select distinct enabled\n * @param names The array of column names to enable select distinct on\n */\n abstract set selectDistinctColumns(names: readonly ColumnName[]);\n\n /**\n * The pending data for this model\n * @returns A map of row index to a map of column name/value pairs\n */\n abstract get pendingDataMap(): PendingDataMap;\n\n /**\n * Set the pending data for this model\n * @param A map of row index to a map of column name/value pairs\n */\n abstract set pendingDataMap(map: PendingDataMap);\n\n /**\n * @returns The count of pending rows to show\n */\n abstract get pendingRowCount(): number;\n\n /**\n * Set the count of pending rows to show\n * @param count The count of pending rows to show\n */\n abstract set pendingRowCount(count: number);\n\n /**\n * Errors for the pending data\n * @returns Map from row number to the error\n */\n abstract get pendingDataErrors(): PendingDataErrorMap;\n\n /**\n * Commit pending data and save all data to the table\n */\n abstract commitPending(): Promise<void>;\n\n /**\n * Check if viewport is still loading data\n */\n get isViewportPending(): boolean {\n return false;\n }\n\n /**\n * Check if a column is filterable\n * @param columnIndex The column index to check for filterability\n * @returns True if the current provided column index is filterable, false otherwise\n */\n isFilterable(columnIndex: ModelIndex): boolean {\n return false;\n }\n\n /**\n * Set the indices of the viewport\n * @param top Top of viewport\n * @param bottom Bottom of viewport\n * @param columns The columns in the viewport. `undefined` for all columns\n */\n abstract setViewport(\n top: VisibleIndex,\n bottom: VisibleIndex,\n columns?: DhType.Column[]\n ): void;\n\n /**\n * Takes a snapshot of the provided ranges\n * @param ranges The model ranges to take the snapshot of\n * @returns Returns the data in a row/column matrix\n */\n abstract snapshot(\n ranges: readonly GridRange[]\n ): Promise<readonly unknown[][]>;\n\n /**\n * @param ranges The ranges to take a snapshot of\n * @param includeHeaders Whether to include the headers in the snapshot or not\n * @param formatValue A function to format a value for a cell. Defaults to model format value.\n * @returns A text formatted snapshot of the data for the specified range set\n */\n abstract textSnapshot(\n ranges: readonly GridRange[],\n includeHeaders?: boolean,\n formatValue?: (\n value: unknown,\n column: DhType.Column,\n row?: DhType.Row\n ) => string\n ): Promise<string>;\n\n /**\n * @param column The columns to get the distinct values for\n * @returns A table partitioned on the specified columns in the order given in\n */\n abstract valuesTable(\n columns: DhType.Column | readonly DhType.Column[]\n ): Promise<DhType.Table>;\n\n /**\n * Close this model. It can no longer be used after being closed\n */\n close(): void {\n // no-op\n }\n\n /**\n * Don't allow any rows to be movable in any IrisGrids by default. Just columns.\n */\n isRowMovable(): boolean {\n return false;\n }\n\n abstract seekRow(\n startRow: number,\n column: DhType.Column,\n valueType: DhType.ValueTypeType,\n value: unknown,\n insensitive?: boolean,\n contains?: boolean,\n isBackwards?: boolean\n ): Promise<number>;\n\n get isSeekRowAvailable(): boolean {\n return false;\n }\n\n abstract get columnHeaderGroups(): readonly ColumnHeaderGroup[];\n\n abstract set columnHeaderGroups(groups: readonly ColumnHeaderGroup[]);\n\n abstract get columnHeaderGroupMap(): ReadonlyMap<string, ColumnHeaderGroup>;\n\n abstract getColumnHeaderParentGroup(\n modelIndex: ModelIndex,\n depth: number\n ): ColumnHeaderGroup | undefined;\n\n dataBarOptionsForCell(\n column: number,\n row: number,\n theme: GridThemeType\n ): DataBarOptions {\n throw new Error('Method not implemented.');\n }\n\n tooltipForCell(column: ModelIndex, row: ModelIndex): string | null {\n return null;\n }\n}\n\nexport default IrisGridModel;\n"],"mappings":";;;AAAA;;AAEA,SAKEA,SAAS,QAMJ,iBAAiB;AAGxB,SAASC,oBAAoB,QAAQ,kBAAkB;AAgCvD,IAAMC,WAAoB,GAAG,EAAE;AAC/B,IAAMC,SAAqB,GAAG,IAAIC,GAAG,CAAC,CAAC;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAeC,aAAa,SAOlBL,SAAS,CAEnB;EAwCEM,WAAWA,CAACC,EAAiB,EAAE;IAC7B,KAAK,CAAC,CAAC;IAACC,eAAA;IAAAA,eAAA;IAER,IAAI,CAACD,EAAE,GAAGA,EAAE;IACZ,IAAI,CAACE,aAAa,GAAG,CAAC;EACxB;EAMA;EACA;EACA;EACAC,gBAAgBA,CACdC,KAAQ,EACRC,SAAgE,EAChEC,QAA2C,EACrC;IACN,KAAK,CAACH,gBAAgB,CAACC,KAAK,EAAEC,SAAS,EAAWC,QAAiB,CAAC;IAEpE,IAAI,CAACJ,aAAa,IAAI,CAAC;IACvB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Aa","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"IrisGridModel.js","names":["GridModel","EventShimCustomEvent","EMPTY_ARRAY","EMPTY_SET","Set","IrisGridModel","constructor","dh","_defineProperty","listenerCount","addEventListener","type0","callback0","options0","startListening","removeEventListener","stopListening","dispatchPending","detail","dispatchEvent","EVENT","PENDING","aggregatedColumns","groupedColumns","originalColumns","columns","sourceForCell","column","row","getClearFilterRange","isFilterable","initialMovedColumns","initialMovedRows","initialColumnHeaderGroups","layoutHints","frontColumns","backColumns","keyColumnSet","valueColumnSet","frozenColumns","isColumnFrozen","index","isColumnSortable","isFilterRequired","isReversible","isColumnStatisticsAvailable","description","isAggregatedColumnsAvailable","isCustomColumnsAvailable","isFormatColumnsAvailable","isExportAvailable","isValuesTableAvailable","isChartBuilderAvailable","isOrganizeColumnsAvailable","isRollupAvailable","isSelectDistinctAvailable","isTotalsAvailable","isViewportPending","columnIndex","close","isRowMovable","isSeekRowAvailable","dataBarOptionsForCell","theme","Error","tooltipForCell","Object","freeze","UPDATED","FORMATTER_UPDATED","REQUEST_FAILED","COLUMNS_CHANGED","TABLE_CHANGED","SCHEMA_CHANGED","FILTERS_CHANGED","SORTS_CHANGED","DISCONNECT","RECONNECT","TOTALS_UPDATED","PENDING_DATA_UPDATED","VIEWPORT_UPDATED","PENDING_CLEARED"],"sources":["../src/IrisGridModel.ts"],"sourcesContent":["/* eslint-disable class-methods-use-this */\nimport type { Event, EventTarget } from 'event-target-shim';\nimport {\n type BoundedAxisRange,\n type DataBarGridModel,\n type DataBarOptions,\n type GridCell,\n GridModel,\n type GridRange,\n type GridThemeType,\n type ModelIndex,\n type MoveOperation,\n type VisibleIndex,\n} from '@deephaven/grid';\nimport type { dh as DhType } from '@deephaven/jsapi-types';\nimport { type Formatter, type SortDescriptor } from '@deephaven/jsapi-utils';\nimport { EventShimCustomEvent } from '@deephaven/utils';\nimport {\n type ColumnName,\n type UITotalsTableConfig,\n type PendingDataMap,\n type PendingDataErrorMap,\n type PendingOperationDetail,\n} from './CommonTypes';\nimport type ColumnHeaderGroup from './ColumnHeaderGroup';\n\nexport type DisplayColumn = DhType.Column & {\n /**\n * Name to display with the column.\n * The `name` property on `Column` is a unique identifier and must be a valid Java identifier,\n * whereas `displayName` can be any string and does not need to be unique.\n */\n displayName?: string;\n\n /**\n * Whether this column is a proxy column for other columns or not.\n * If it's a proxy column, it may not appear in some lists.\n */\n isProxy?: boolean;\n};\n\ntype IrisGridModelEventNames =\n (typeof IrisGridModel.EVENT)[keyof typeof IrisGridModel.EVENT];\n\ntype IrisGridModelEventMap = {\n [E in IrisGridModelEventNames]: Event<E>;\n};\n\nconst EMPTY_ARRAY: never[] = [];\nconst EMPTY_SET: Set<never> = new Set();\n\n/**\n * Abstract class that extends the GridModel to have more functionality, like filtering and sorting.\n * For use from IrisGrid.\n * Provides some abstraction from the dh.Table and dh.TreeTable classes, so we can treat them somewhat the same.\n * Note that it still uses dh.Column, dh.FilterCondition, dh.Sort, etc., still. Theoretically should abstract\n * those out as well, so there's no dependency on IrisAPI at all, but it's a lot of work for no real gain at this time.\n */\nabstract class IrisGridModel<\n TEventMap extends Record<string, Event<string>> = Record<\n string,\n Event<string>\n >,\n TMode extends 'standard' | 'strict' = 'standard',\n >\n extends GridModel<TEventMap & IrisGridModelEventMap, TMode>\n implements DataBarGridModel\n{\n static EVENT = Object.freeze({\n UPDATED: 'UPDATED',\n FORMATTER_UPDATED: 'FORMATTER_UPDATED',\n REQUEST_FAILED: 'REQUEST_FAILED',\n COLUMNS_CHANGED: 'COLUMNS_CHANGED',\n TABLE_CHANGED: 'TABLE_CHANGED',\n /**\n * Fired by `IrisGridProxyModel` whenever its inner model is swapped for a\n * different instance (e.g. pivot-builder swapping a table model for a pivot\n * model, or back). The `detail` is the new inner model. Unlike\n * `TABLE_CHANGED` (only dispatched for table-template models), this fires on\n * every inner-model swap regardless of model class, so the host can reset\n * view state (e.g. `movedColumns`) that the previous model owned.\n */\n SCHEMA_CHANGED: 'SCHEMA_CHANGED',\n FILTERS_CHANGED: 'FILTERS_CHANGED',\n SORTS_CHANGED: 'SORTS_CHANGED',\n DISCONNECT: 'DISCONNECT',\n RECONNECT: 'RECONNECT',\n TOTALS_UPDATED: 'TOTALS_UPDATED',\n /** Fired when the viewport is applied to the table and we're waiting for a response. */\n PENDING_DATA_UPDATED: 'PENDING_DATA_UPDATED',\n VIEWPORT_UPDATED: 'VIEWPORT_UPDATED',\n /**\n * Fired when an async, config-changing operation has begun. Raises the\n * IrisGrid loading scrim. Detail is an optional, self-describing\n * {@link PendingOperationDetail} so an initiator (e.g. a plugin) can raise\n * the scrim for an operation IrisGrid has no built-in knowledge of.\n */\n PENDING: 'PENDING',\n /**\n * Optional completion signal for a pending operation that does NOT\n * naturally end in `UPDATED` / `COLUMNS_CHANGED` / `REQUEST_FAILED`.\n * Built-in operations never need this; their existing events clear the\n * scrim.\n *\n * Assumes a single outstanding model-driven operation: the scrim is not\n * ref-counted, so a `PENDING_CLEARED` clears it regardless of other\n * in-flight operations. Ref-counting is deferred to the planned migration\n * that routes built-in `startLoading` calls through these events, where a\n * depth counter can stay balanced.\n */\n PENDING_CLEARED: 'PENDING_CLEARED',\n } as const);\n\n constructor(dh: typeof DhType) {\n super();\n\n this.dh = dh;\n this.listenerCount = 0;\n }\n\n dh: typeof DhType;\n\n listenerCount: number;\n\n // Pulled directly from event-target-shim implementation signature\n // https://github.com/mysticatea/event-target-shim/blob/master/src/lib/event-target.ts#L99\n // Using Parameters<GridModel['addEventListener']> doesn't work\n addEventListener<T extends string & keyof TEventMap>(\n type0: T,\n callback0?: EventTarget.EventListener<this, TEventMap[T]> | null,\n options0?: boolean | EventTarget.AddOptions\n ): void {\n super.addEventListener(type0, callback0 as never, options0 as never);\n\n this.listenerCount += 1;\n if (this.listenerCount === 1) {\n this.startListening();\n }\n }\n\n removeEventListener<T extends string & keyof TEventMap>(\n type0: T,\n callback0?: EventTarget.EventListener<this, TEventMap[T]> | null,\n options0?: boolean | EventTarget.Options\n ): void {\n super.removeEventListener(type0, callback0 as never, options0 as never);\n\n this.listenerCount -= 1;\n if (this.listenerCount === 0) {\n this.stopListening();\n }\n }\n\n /**\n * Function called when first listener is added.\n * Override for implementation specific behaviour.\n */\n startListening(): void {\n // no-op\n }\n\n /**\n * Function called when last listener is removed.\n * Override for implementation specific behaviour.\n */\n stopListening(): void {\n // no-op\n }\n\n /**\n * Dispatch a `PENDING` event to raise the IrisGrid loading scrim for an\n * async, config-changing operation initiated on this model.\n * @param detail Optional self-describing detail (scrim text and options).\n */\n protected dispatchPending(detail?: PendingOperationDetail): void {\n this.dispatchEvent(\n new EventShimCustomEvent(IrisGridModel.EVENT.PENDING, {\n detail,\n }) as never\n );\n }\n\n /**\n * Gets the columns for this model\n * @returns All columns in the model\n */\n abstract get columns(): readonly DisplayColumn[];\n\n /**\n * Retrieve the aggregated columns for this model\n * @returns The columns that are aggregated\n */\n get aggregatedColumns(): readonly DisplayColumn[] {\n return EMPTY_ARRAY;\n }\n\n /**\n * Retrieve the grouped columns for this model\n * @returns The columns that are grouped\n */\n get groupedColumns(): readonly DisplayColumn[] {\n return EMPTY_ARRAY;\n }\n\n /**\n * Gets the columns for the model before any transformations (such as rollups) are applied.\n * @returns All original columns in the model.\n */\n get originalColumns(): readonly DisplayColumn[] {\n return this.columns;\n }\n\n /**\n * Gets the column index for this model\n * @param name The model column name.\n * @returns The numeric index of the requested column.\n */\n abstract getColumnIndexByName(name: string): ModelIndex | undefined;\n\n /**\n * Retrieve the source cell for a given cell. Returns something different if the cell is a proxied cell\n * that retrieves data from another cell.\n * @param column Column to get the source for\n * @param row Row to get the source for\n * @returns Source cell where the data is coming from\n */\n sourceForCell(column: ModelIndex, row: ModelIndex): GridCell {\n return { column, row };\n }\n\n /**\n * Retrieve the range of columns to clear filters on for a given column.\n * @param column Column to get the range of filters to clear.\n * @returns Axis range of the column filters to clear, or `null` if this should not have a clear filter option.\n */\n getClearFilterRange(column: ModelIndex): BoundedAxisRange | null {\n if (this.isFilterable(column)) {\n return [column, column];\n }\n return null;\n }\n\n /** List of column movements defined by the model. Used as initial movements for IrisGrid */\n get initialMovedColumns(): readonly MoveOperation[] {\n return EMPTY_ARRAY;\n }\n\n /** List of row movements defined by the model. Used as initial movements for IrisGrid */\n get initialMovedRows(): readonly MoveOperation[] {\n return EMPTY_ARRAY;\n }\n\n /** List of column header groups defined by the model */\n get initialColumnHeaderGroups(): readonly ColumnHeaderGroup[] {\n return EMPTY_ARRAY;\n }\n\n /**\n * @param column The model column index\n * @param row The model row index\n * @returns The format stored for that cell\n */\n abstract formatForCell(\n column: ModelIndex,\n row: ModelIndex\n ): DhType.Format | undefined;\n\n /**\n * @param column The model column index\n * @param row The model row index\n * @returns The value stored for that cell\n */\n abstract valueForCell(column: ModelIndex, row: ModelIndex): unknown;\n\n /**\n * @returns The filters set on this model\n */\n abstract get filter(): readonly DhType.FilterCondition[];\n\n /**\n * @param filter The filters to set\n */\n abstract set filter(filter: readonly DhType.FilterCondition[]);\n\n /**\n * @returns The formatter used when formatting data\n */\n abstract get formatter(): Formatter;\n\n /**\n * @param formatter The formatter to set\n */\n abstract set formatter(formatter: Formatter);\n\n /**\n * @returns The column alignment map\n */\n abstract get columnAlignmentMap(): ReadonlyMap<string, CanvasTextAlign>;\n\n /**\n * @param columnAlignmentMap The column alignment map to set\n */\n abstract set columnAlignmentMap(\n columnAlignmentMap: Map<string, CanvasTextAlign>\n );\n\n /**\n * @param value The value to format\n * @param columnType The column type to format\n * @param columnName The column name to format\n */\n abstract displayString(\n value: unknown,\n columnType: string,\n columnName?: ColumnName\n ): string;\n\n /**\n * @returns The sorts used on this model\n */\n abstract get sort(): readonly SortDescriptor[];\n\n /**\n * @param sort The sorts to use on this model\n */\n abstract set sort(sort: readonly SortDescriptor[]);\n\n /**\n /**\n * @returns The custom columns on this model\n */\n abstract get customColumns(): readonly ColumnName[];\n\n /**\n * @param customColumns The custom columns to use\n */\n abstract set customColumns(customColumns: readonly ColumnName[]);\n\n /**\n * @returns The format columns on this model\n */\n abstract get formatColumns(): readonly DhType.CustomColumn[];\n\n /**\n * @param formatColumns The format columns to use\n */\n abstract set formatColumns(formatColumns: readonly DhType.CustomColumn[]);\n\n /**\n * @param columns The columns to treat as frozen\n */\n abstract updateFrozenColumns(columns: readonly ColumnName[]): void;\n\n /**\n * @returns The config to use for rolling up this table\n */\n abstract get rollupConfig(): DhType.RollupConfig | null;\n\n abstract set rollupConfig(rollupConfig: DhType.RollupConfig | null);\n\n /**\n * @returns The config to use for the totals table of this model\n */\n abstract get totalsConfig(): UITotalsTableConfig | null;\n\n abstract set totalsConfig(totalsConfig: UITotalsTableConfig | null);\n\n /**\n * @returns The LayoutHints to use for the columns of this table model\n */\n get layoutHints(): DhType.LayoutHints | null | undefined {\n return null;\n }\n\n /**\n * @returns Names of columns which should be locked to the front, but not floating\n */\n get frontColumns(): readonly ColumnName[] {\n return EMPTY_ARRAY;\n }\n\n /**\n * @returns Names of columns which should be locked to the back, but not floating\n */\n get backColumns(): readonly ColumnName[] {\n return EMPTY_ARRAY;\n }\n\n /**\n * @returns Names of key columns\n */\n get keyColumnSet(): Set<ColumnName> {\n return EMPTY_SET;\n }\n\n /**\n * @returns Names of value columns\n */\n get valueColumnSet(): Set<ColumnName> {\n return EMPTY_SET;\n }\n\n /**\n * @returns Names of columns which should be frozen to the front and floating\n */\n get frozenColumns(): readonly ColumnName[] {\n return EMPTY_ARRAY;\n }\n\n /**\n * @param index The column index to check\n * @returns Whether the column is one of LayoutHints' frozen columns\n */\n isColumnFrozen(index: ModelIndex): boolean {\n return false;\n }\n\n /**\n * @param index The column index to check\n * @returns Whether the column is sortable\n */\n isColumnSortable(index: ModelIndex): boolean {\n return false;\n }\n\n /**\n * @deprecated Replaced with isPartitionRequired()\n * @returns True if this model requires a filter to be set\n */\n get isFilterRequired(): boolean {\n return false;\n }\n\n get isReversible(): boolean {\n return true;\n }\n\n /**\n * @returns Returns a raw table that is frozen and can be used for exporting data\n */\n abstract export(): Promise<DhType.Table>;\n\n /**\n * @returns True if this model supports the columnStatistics(column) function\n */\n get isColumnStatisticsAvailable(): boolean {\n return false;\n }\n\n /**\n * The description for this model.\n * @returns The description of the model\n */\n get description(): string {\n return '';\n }\n\n /**\n * @param column The column to get statistics for\n * @returns The column statistics\n */\n abstract columnStatistics(\n column: DhType.Column\n ): Promise<DhType.ColumnStatistics>;\n\n /**\n * @returns True if this model supports aggregatedColumns\n */\n get isAggregatedColumnsAvailable(): boolean {\n return false;\n }\n\n /**\n * @returns True if this model supports customColumns\n */\n get isCustomColumnsAvailable(): boolean {\n return false;\n }\n\n /**\n * @returns True if this model supports customColumns\n */\n get isFormatColumnsAvailable(): boolean {\n return false;\n }\n\n /**\n * @returns True if this model supports the export() function\n */\n get isExportAvailable(): boolean {\n return false;\n }\n\n /**\n * @returns True if this model supports the valuesTable(column) function\n */\n get isValuesTableAvailable(): boolean {\n return false;\n }\n\n /**\n * @returns True if this model should allow the chart builder\n */\n get isChartBuilderAvailable(): boolean {\n return false;\n }\n\n /**\n * @returns True if this model should allow to organize columns\n */\n get isOrganizeColumnsAvailable(): boolean {\n return false;\n }\n\n /**\n * @returns True if the rollup rows functionality is available\n */\n get isRollupAvailable(): boolean {\n return false;\n }\n\n /**\n * @returns True if select distinct functionality is available\n */\n get isSelectDistinctAvailable(): boolean {\n return false;\n }\n\n /**\n * @returns True if the totals functionality is available\n */\n get isTotalsAvailable(): boolean {\n return false;\n }\n\n /**\n * The names of columns with select distinct enabled\n * @returns An array of column names\n */\n abstract get selectDistinctColumns(): readonly ColumnName[];\n\n /**\n * Set the columns with select distinct enabled\n * @param names The array of column names to enable select distinct on\n */\n abstract set selectDistinctColumns(names: readonly ColumnName[]);\n\n /**\n * The pending data for this model\n * @returns A map of row index to a map of column name/value pairs\n */\n abstract get pendingDataMap(): PendingDataMap;\n\n /**\n * Set the pending data for this model\n * @param A map of row index to a map of column name/value pairs\n */\n abstract set pendingDataMap(map: PendingDataMap);\n\n /**\n * @returns The count of pending rows to show\n */\n abstract get pendingRowCount(): number;\n\n /**\n * Set the count of pending rows to show\n * @param count The count of pending rows to show\n */\n abstract set pendingRowCount(count: number);\n\n /**\n * Errors for the pending data\n * @returns Map from row number to the error\n */\n abstract get pendingDataErrors(): PendingDataErrorMap;\n\n /**\n * Commit pending data and save all data to the table\n */\n abstract commitPending(): Promise<void>;\n\n /**\n * Check if viewport is still loading data\n */\n get isViewportPending(): boolean {\n return false;\n }\n\n /**\n * Check if a column is filterable\n * @param columnIndex The column index to check for filterability\n * @returns True if the current provided column index is filterable, false otherwise\n */\n isFilterable(columnIndex: ModelIndex): boolean {\n return false;\n }\n\n /**\n * Set the indices of the viewport\n * @param top Top of viewport\n * @param bottom Bottom of viewport\n * @param columns The columns in the viewport. `undefined` for all columns\n */\n abstract setViewport(\n top: VisibleIndex,\n bottom: VisibleIndex,\n columns?: DhType.Column[]\n ): void;\n\n /**\n * Takes a snapshot of the provided ranges\n * @param ranges The model ranges to take the snapshot of\n * @returns Returns the data in a row/column matrix\n */\n abstract snapshot(\n ranges: readonly GridRange[]\n ): Promise<readonly unknown[][]>;\n\n /**\n * @param ranges The ranges to take a snapshot of\n * @param includeHeaders Whether to include the headers in the snapshot or not\n * @param formatValue A function to format a value for a cell. Defaults to model format value.\n * @returns A text formatted snapshot of the data for the specified range set\n */\n abstract textSnapshot(\n ranges: readonly GridRange[],\n includeHeaders?: boolean,\n formatValue?: (\n value: unknown,\n column: DhType.Column,\n row?: DhType.Row\n ) => string\n ): Promise<string>;\n\n /**\n * @param column The columns to get the distinct values for\n * @returns A table partitioned on the specified columns in the order given in\n */\n abstract valuesTable(\n columns: DhType.Column | readonly DhType.Column[]\n ): Promise<DhType.Table>;\n\n /**\n * Close this model. It can no longer be used after being closed\n */\n close(): void {\n // no-op\n }\n\n /**\n * Don't allow any rows to be movable in any IrisGrids by default. Just columns.\n */\n isRowMovable(): boolean {\n return false;\n }\n\n abstract seekRow(\n startRow: number,\n column: DhType.Column,\n valueType: DhType.ValueTypeType,\n value: unknown,\n insensitive?: boolean,\n contains?: boolean,\n isBackwards?: boolean\n ): Promise<number>;\n\n get isSeekRowAvailable(): boolean {\n return false;\n }\n\n abstract get columnHeaderGroups(): readonly ColumnHeaderGroup[];\n\n abstract set columnHeaderGroups(groups: readonly ColumnHeaderGroup[]);\n\n abstract get columnHeaderGroupMap(): ReadonlyMap<string, ColumnHeaderGroup>;\n\n abstract getColumnHeaderParentGroup(\n modelIndex: ModelIndex,\n depth: number\n ): ColumnHeaderGroup | undefined;\n\n dataBarOptionsForCell(\n column: number,\n row: number,\n theme: GridThemeType\n ): DataBarOptions {\n throw new Error('Method not implemented.');\n }\n\n tooltipForCell(column: ModelIndex, row: ModelIndex): string | null {\n return null;\n }\n}\n\nexport default IrisGridModel;\n"],"mappings":";;;AAAA;;AAEA,SAKEA,SAAS,QAMJ,iBAAiB;AAGxB,SAASC,oBAAoB,QAAQ,kBAAkB;AAgCvD,IAAMC,WAAoB,GAAG,EAAE;AAC/B,IAAMC,SAAqB,GAAG,IAAIC,GAAG,CAAC,CAAC;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAeC,aAAa,SAOlBL,SAAS,CAEnB;EA8CEM,WAAWA,CAACC,EAAiB,EAAE;IAC7B,KAAK,CAAC,CAAC;IAACC,eAAA;IAAAA,eAAA;IAER,IAAI,CAACD,EAAE,GAAGA,EAAE;IACZ,IAAI,CAACE,aAAa,GAAG,CAAC;EACxB;EAMA;EACA;EACA;EACAC,gBAAgBA,CACdC,KAAQ,EACRC,SAAgE,EAChEC,QAA2C,EACrC;IACN,KAAK,CAACH,gBAAgB,CAACC,KAAK,EAAEC,SAAS,EAAWC,QAAiB,CAAC;IAEpE,IAAI,CAACJ,aAAa,IAAI,CAAC;IACvB,IAAI,IAAI,CAACA,aAAa,KAAK,CAAC,EAAE;MAC5B,IAAI,CAACK,cAAc,CAAC,CAAC;IACvB;EACF;EAEAC,mBAAmBA,CACjBJ,KAAQ,EACRC,SAAgE,EAChEC,QAAwC,EA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F;AACA;AACA;AACA;AACA;;EAOE;AACF;AACA;AACA;AACA;;EAKE;AACF;AACA;AACA;AACA;AACA;;EAWE;AACF;AACA;AACA;;EAKE;AACF;AACA;EACEC,KAAKA,CAAA,EAAS;IACZ;EAAA;;EAGF;AACF;AACA;EACEC,YAAYA,CAAA,EAAY;IACtB,OAAO,KAAK;EACd;EAYA,IAAIC,kBAAkBA,CAAA,EAAY;IAChC,OAAO,KAAK;EACd;EAaAC,qBAAqBA,CACnBnC,MAAc,EACdC,GAAW,EACXmC,KAAoB,EACJ;IAChB,MAAM,IAAIC,KAAK,CAAC,yBAAyB,CAAC;EAC5C;EAEAC,cAAcA,CAACtC,MAAkB,EAAEC,GAAe,EAAiB;IACjE,OAAO,IAAI;EACb;AACF;AAACpB,eAAA,CA1nBcH,aAAa,WAUX6D,MAAM,CAACC,MAAM,CAAC;EAC3BC,OAAO,EAAE,SAAS;EAClBC,iBAAiB,EAAE,mBAAmB;EACtCC,cAAc,EAAE,gBAAgB;EAChCC,eAAe,EAAE,iBAAiB;EAClCC,aAAa,EAAE,eAAe;EAC9B;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;EACIC,cAAc,EAAE,gBAAgB;EAChCC,eAAe,EAAE,iBAAiB;EAClCC,aAAa,EAAE,eAAe;EAC9BC,UAAU,EAAE,YAAY;EACxBC,SAAS,EAAE,WAAW;EACtBC,cAAc,EAAE,gBAAgB;EAChC;EACAC,oBAAoB,EAAE,sBAAsB;EAC5CC,gBAAgB,EAAE,kBAAkB;EACpC;AACJ;AACA;AACA;AACA;AACA;EACI3D,OAAO,EAAE,SAAS;EAClB;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACI4D,eAAe,EAAE;AACnB,CAAU,CAAC;AAukBb,eAAe5E,aAAa","ignoreList":[]}
|
|
@@ -147,7 +147,7 @@ class IrisGridProxyModel extends IrisGridModel {
|
|
|
147
147
|
// the previous model (e.g. `movedColumns`). Dispatched before
|
|
148
148
|
// COLUMNS_CHANGED / TABLE_CHANGED so the host resets moves first, then
|
|
149
149
|
// reacts to the new column set.
|
|
150
|
-
this.dispatchEvent(new EventShimCustomEvent(IrisGridModel.EVENT.
|
|
150
|
+
this.dispatchEvent(new EventShimCustomEvent(IrisGridModel.EVENT.SCHEMA_CHANGED, {
|
|
151
151
|
detail: model
|
|
152
152
|
}));
|
|
153
153
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IrisGridProxyModel.js","names":["deepEqual","Formatter","TableUtils","Log","EventShimCustomEvent","PromiseUtils","IrisGridTableModel","IrisGridPartitionedTableModel","IrisGridTreeTableModel","IrisGridModel","isIrisGridTableModelTemplate","isPartitionedGridModelProvider","isPartitionedGridModel","log","module","makeModel","dh","table","formatter","inputTable","isTreeTable","isPartitionedTable","IrisGridProxyModel","constructor","arguments","length","undefined","_defineProperty","top","bottom","columns","currentViewport","model","setViewport","addEventListener","bind","removeEventListener","dispatchEvent","handleModelEvent","originalModel","modelPromise","rollup","partition","selectDistinct","Proxy","get","target","prop","receiver","_Object$getOwnPropert","proxyHasGetter","Object","getOwnPropertyDescriptor","getPrototypeOf","Reflect","proxyHasProp","prototype","hasOwnProperty","call","proxyHasFn","trueTarget","set","value","_Object$getOwnPropert2","proxyHasSetter","has","close","cancel","event","debug2","detail","type","setModel","debug","oldModel","oldColumns","listenerCount","addListeners","EVENT","MODEL_CHANGED","COLUMNS_CHANGED","_this$currentViewport","TABLE_CHANGED","setNextModel","removeListeners","makeCancelable","then","catch","err","isCanceled","error","REQUEST_FAILED","startListening","stopListening","events","keys","i","isCustomColumnsAvailable","isSelectDistinctAvailable","selectDistinctColumns","isRollupAvailable","originalColumns","partitionColumns","partitionConfig","isPartitionRequired","Error","mode","partitions","every","p","Promise","resolve","partitionBaseTable","partitionMergedTable","partitionTable","partitionKeysTable","rollupConfig","columnNames","map","name","find","column","filter","totalsConfig","isFilterRequired","isPartitionAwareSourceTable","columnAlignmentMap"],"sources":["../src/IrisGridProxyModel.ts"],"sourcesContent":["import deepEqual from 'fast-deep-equal';\nimport { Formatter, TableUtils } from '@deephaven/jsapi-utils';\nimport Log from '@deephaven/log';\nimport {\n type CancelablePromise,\n EventShimCustomEvent,\n PromiseUtils,\n} from '@deephaven/utils';\nimport type { dh as DhType } from '@deephaven/jsapi-types';\nimport IrisGridTableModel from './IrisGridTableModel';\nimport IrisGridPartitionedTableModel from './IrisGridPartitionedTableModel';\nimport IrisGridTreeTableModel from './IrisGridTreeTableModel';\nimport IrisGridModel from './IrisGridModel';\nimport { type ColumnName, type UITotalsTableConfig } from './CommonTypes';\nimport { isIrisGridTableModelTemplate } from './IrisGridTableModelTemplate';\nimport {\n type PartitionConfig,\n type PartitionedGridModel,\n isPartitionedGridModelProvider,\n isPartitionedGridModel,\n} from './PartitionedGridModel';\n\nconst log = Log.module('IrisGridProxyModel');\n\nfunction makeModel(\n dh: typeof DhType,\n table: DhType.Table | DhType.TreeTable | DhType.PartitionedTable,\n formatter?: Formatter,\n inputTable?: DhType.InputTable | null\n): IrisGridModel {\n if (TableUtils.isTreeTable(table)) {\n return new IrisGridTreeTableModel(dh, table, formatter);\n }\n if (TableUtils.isPartitionedTable(table)) {\n return new IrisGridPartitionedTableModel(dh, table, formatter);\n }\n return new IrisGridTableModel(dh, table, formatter, inputTable);\n}\n\n/**\n * Model which proxies calls to other IrisGridModels.\n * This allows for operations that generate new tables, like rollups.\n * The proxy model will call any methods it has implemented and delegate any\n * it does not implement to the underlying model.\n */\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nclass IrisGridProxyModel extends IrisGridModel implements PartitionedGridModel {\n /**\n * @param dh JSAPI instance\n * @param table Iris data table to be used in the model\n * @param formatter The formatter to use when getting formats\n * @param inputTable Iris input table associated with this table\n */\n\n model: IrisGridModel;\n\n dh: typeof DhType;\n\n private originalModel: IrisGridModel;\n\n private modelPromise: CancelablePromise<IrisGridModel> | null;\n\n private rollup: DhType.RollupConfig | null;\n\n private partition: PartitionConfig | null;\n\n private selectDistinct: ColumnName[];\n\n private currentViewport?: {\n top: number;\n bottom: number;\n columns?: DhType.Column[];\n };\n\n constructor(\n dh: typeof DhType,\n table: DhType.Table | DhType.TreeTable | DhType.PartitionedTable,\n formatter = new Formatter(dh),\n inputTable: DhType.InputTable | null = null\n ) {\n super(dh);\n\n // The EventTarget methods must be bound to this instance\n // Otherwise they throw errors because of the Proxy\n this.addEventListener = this.addEventListener.bind(this);\n this.removeEventListener = this.removeEventListener.bind(this);\n this.dispatchEvent = this.dispatchEvent.bind(this);\n\n this.handleModelEvent = this.handleModelEvent.bind(this);\n\n const model = makeModel(dh, table, formatter, inputTable);\n this.dh = dh;\n this.originalModel = model;\n this.model = model;\n this.modelPromise = null;\n this.rollup = null;\n this.partition = null;\n this.selectDistinct = [];\n\n // eslint-disable-next-line no-constructor-return\n return new Proxy(this, {\n // We want to use any properties on the proxy model if defined\n // If not, then proxy to the underlying model\n get(target, prop, receiver) {\n // Does this class have a getter for the prop\n // Getter functions are on the prototype\n const proxyHasGetter =\n Object.getOwnPropertyDescriptor(Object.getPrototypeOf(target), prop)\n ?.get != null;\n\n if (proxyHasGetter) {\n return Reflect.get(target, prop, receiver);\n }\n\n // Does this class implement the property\n const proxyHasProp = Object.prototype.hasOwnProperty.call(target, prop);\n\n // Does the class implement a function for the property\n const proxyHasFn = Object.prototype.hasOwnProperty.call(\n Object.getPrototypeOf(target),\n prop\n );\n\n const trueTarget = proxyHasProp || proxyHasFn ? target : target.model;\n return Reflect.get(trueTarget, prop);\n },\n set(target, prop, value) {\n const proxyHasSetter =\n Object.getOwnPropertyDescriptor(Object.getPrototypeOf(target), prop)\n ?.set != null;\n\n const proxyHasProp = Object.prototype.hasOwnProperty.call(target, prop);\n\n if (proxyHasSetter || proxyHasProp) {\n return Reflect.set(target, prop, value, target);\n }\n\n return Reflect.set(target.model, prop, value, target.model);\n },\n // Mirror `get` so duck-type checks (`'prop' in model`) used by inner\n // model variants (e.g. pivot) resolve against the inner model when\n // the proxy itself doesn't define the property.\n has(target, prop) {\n if (Reflect.has(target, prop)) {\n return true;\n }\n return Reflect.has(target.model, prop);\n },\n });\n }\n\n close(): void {\n this.originalModel.close();\n if (this.model !== this.originalModel) {\n this.model.close();\n }\n if (this.modelPromise != null) {\n this.modelPromise.cancel();\n }\n }\n\n handleModelEvent(event: CustomEvent): void {\n log.debug2('handleModelEvent', event);\n\n const { detail, type } = event;\n this.dispatchEvent(new EventShimCustomEvent(type, { detail }));\n }\n\n setModel(model: IrisGridModel): void {\n log.debug('setModel', model);\n\n const oldModel = this.model;\n const { columns: oldColumns } = oldModel;\n\n if (oldModel !== this.originalModel) {\n oldModel.close();\n }\n\n this.model = model;\n\n if (this.listenerCount > 0) {\n this.addListeners(model);\n }\n\n if (oldModel !== model) {\n // Signal an inner-model swap so the host can reset view state owned by\n // the previous model (e.g. `movedColumns`). Dispatched before\n // COLUMNS_CHANGED / TABLE_CHANGED so the host resets moves first, then\n // reacts to the new column set.\n this.dispatchEvent(\n new EventShimCustomEvent(IrisGridModel.EVENT.MODEL_CHANGED, {\n detail: model,\n })\n );\n }\n\n if (oldColumns !== model.columns) {\n this.dispatchEvent(\n new EventShimCustomEvent(IrisGridModel.EVENT.COLUMNS_CHANGED, {\n detail: model.columns,\n })\n );\n } else if (this.currentViewport != null) {\n // If the columns haven't changed, the current viewport should still valid, and needs to be set on the new model\n const { top, bottom, columns } = this.currentViewport;\n model.setViewport(top, bottom, columns);\n }\n\n if (isIrisGridTableModelTemplate(model)) {\n this.dispatchEvent(\n new EventShimCustomEvent(IrisGridModel.EVENT.TABLE_CHANGED, {\n detail: model.table,\n })\n );\n }\n }\n\n setNextModel(modelPromise: Promise<IrisGridModel>): void {\n log.debug2('setNextModel');\n\n if (this.modelPromise) {\n this.modelPromise.cancel();\n }\n\n if (this.listenerCount > 0) {\n this.removeListeners(this.model);\n }\n\n this.modelPromise = PromiseUtils.makeCancelable(\n modelPromise,\n (model: IrisGridModel) => {\n // Don't close originalModel — it's the source-of-truth model owned\n // by this proxy, not a transient transform result. Closing it would\n // invalidate the underlying table for any consumer that later asks\n // to swap back to it.\n if (model !== this.originalModel) {\n model.close();\n }\n }\n );\n this.modelPromise\n .then(model => {\n this.modelPromise = null;\n this.setModel(model);\n })\n .catch((err: unknown) => {\n if (PromiseUtils.isCanceled(err)) {\n log.debug2('setNextModel cancelled');\n return;\n }\n\n log.error('Unable to set next model', err);\n this.modelPromise = null;\n\n this.dispatchEvent(\n new EventShimCustomEvent(IrisGridModel.EVENT.REQUEST_FAILED, {\n detail: err,\n })\n );\n });\n }\n\n startListening(): void {\n super.startListening();\n\n this.addListeners(this.model);\n }\n\n stopListening(): void {\n super.stopListening();\n\n this.removeListeners(this.model);\n }\n\n addListeners(model: IrisGridModel): void {\n const events = Object.keys(IrisGridModel.EVENT);\n for (let i = 0; i < events.length; i += 1) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n model.addEventListener(events[i], this.handleModelEvent);\n }\n }\n\n removeListeners(model: IrisGridModel): void {\n const events = Object.keys(IrisGridModel.EVENT);\n for (let i = 0; i < events.length; i += 1) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n model.removeEventListener(events[i], this.handleModelEvent);\n }\n }\n\n get isCustomColumnsAvailable(): boolean {\n return (\n this.model.isCustomColumnsAvailable &&\n // Disable for selectDistinct tables\n !(this.isSelectDistinctAvailable && this.selectDistinctColumns.length > 0)\n );\n }\n\n get isRollupAvailable(): boolean {\n return (\n (this.originalModel.isRollupAvailable || this.rollup != null) &&\n this.selectDistinct.length === 0\n );\n }\n\n get isSelectDistinctAvailable(): boolean {\n return (\n // The presented model must support select distinct. Models that don't\n // (e.g. pivot models) report false here even though the underlying\n // source table would. This keeps the capability consistent with whatever\n // is currently displayed.\n this.model.isSelectDistinctAvailable &&\n (this.originalModel.isSelectDistinctAvailable ||\n this.selectDistinct.length > 0) &&\n this.rollup == null\n );\n }\n\n get originalColumns(): readonly DhType.Column[] {\n return this.originalModel.columns;\n }\n\n get partitionColumns(): readonly DhType.Column[] {\n if (!isPartitionedGridModelProvider(this.originalModel)) {\n return [];\n }\n return this.originalModel.partitionColumns;\n }\n\n get partitionConfig(): PartitionConfig | null {\n if (\n !isPartitionedGridModelProvider(this.originalModel) ||\n !this.originalModel.isPartitionRequired\n ) {\n if (!isPartitionedGridModel(this.originalModel)) {\n // @ts-expect-error If the original model has an undefined partitionConfig return undefined to make the proxy model also return false in isPartitionedGridModel\n return undefined;\n }\n return null;\n }\n return this.partition;\n }\n\n set partitionConfig(partitionConfig: PartitionConfig | null) {\n if (!this.isPartitionRequired) {\n throw new Error('Partitions are not available');\n }\n // Skip if config hasn't changed to avoid unnecessary model swaps (e.g. on remount)\n if (\n this.partition === partitionConfig ||\n (this.partition != null &&\n partitionConfig != null &&\n this.partition.mode === partitionConfig.mode &&\n this.partition.partitions.length ===\n partitionConfig.partitions.length &&\n this.partition.partitions.every(\n (p, i) => p === partitionConfig.partitions[i]\n ))\n ) {\n return;\n }\n log.debug('set partitionConfig', partitionConfig);\n this.partition = partitionConfig;\n\n let modelPromise = Promise.resolve(this.originalModel);\n if (\n partitionConfig != null &&\n isPartitionedGridModelProvider(this.originalModel)\n ) {\n if (partitionConfig.mode === 'keys') {\n modelPromise = this.originalModel\n .partitionBaseTable()\n .then(table => makeModel(this.dh, table, this.formatter));\n } else if (partitionConfig.mode === 'merged') {\n modelPromise = this.originalModel\n .partitionMergedTable()\n .then(table => makeModel(this.dh, table, this.formatter));\n } else {\n modelPromise = this.originalModel\n .partitionTable(partitionConfig.partitions)\n .then(table => makeModel(this.dh, table, this.formatter));\n }\n }\n\n this.setNextModel(modelPromise);\n }\n\n partitionKeysTable(): Promise<DhType.Table> {\n if (!isPartitionedGridModelProvider(this.originalModel)) {\n throw new Error('Partitions are not available');\n }\n return this.originalModel.partitionKeysTable();\n }\n\n partitionMergedTable(): Promise<DhType.Table> {\n if (!isPartitionedGridModelProvider(this.originalModel)) {\n throw new Error('Partitions are not available');\n }\n return this.originalModel.partitionMergedTable();\n }\n\n partitionTable(partitions: unknown[]): Promise<DhType.Table> {\n if (!isPartitionedGridModelProvider(this.originalModel)) {\n throw new Error('Partitions are not available');\n }\n return this.originalModel.partitionTable(partitions);\n }\n\n get rollupConfig(): DhType.RollupConfig | null {\n return this.rollup;\n }\n\n set rollupConfig(rollupConfig: DhType.RollupConfig | null) {\n log.debug('set rollupConfig', rollupConfig);\n\n if (!this.isRollupAvailable) {\n throw new Error('Rollup Rows are not available');\n }\n\n // Prevent model update when IrisGridModelUpdater is mounted\n // if rollup is already initialized in IrisGridPanel\n if (deepEqual(rollupConfig, this.rollup)) {\n return;\n }\n\n this.rollup = rollupConfig;\n\n let modelPromise = Promise.resolve(this.originalModel);\n\n if (\n isIrisGridTableModelTemplate(this.originalModel) &&\n rollupConfig != null\n ) {\n modelPromise = this.originalModel.table\n .rollup(rollupConfig)\n .then(table => makeModel(this.dh, table, this.formatter));\n }\n this.setNextModel(modelPromise);\n }\n\n get selectDistinctColumns(): ColumnName[] {\n return this.selectDistinct;\n }\n\n set selectDistinctColumns(columnNames: string[]) {\n log.debug('set selectDistinctColumns', columnNames);\n\n if (!this.isSelectDistinctAvailable) {\n throw new Error('Select distinct is not available');\n }\n\n if (\n columnNames === this.selectDistinctColumns ||\n (columnNames.length === 0 && this.selectDistinctColumns.length === 0)\n ) {\n log.debug('Ignore same selectDistinctColumns', columnNames);\n return;\n }\n\n this.selectDistinct = columnNames;\n\n const selectDistinctColumns = columnNames\n .map(name => this.originalColumns.find(column => column.name === name))\n .filter(column => column != null) as DhType.Column[];\n\n let modelPromise = Promise.resolve(this.originalModel);\n\n if (\n isIrisGridTableModelTemplate(this.originalModel) &&\n selectDistinctColumns.length > 0\n ) {\n modelPromise = this.originalModel.table\n .selectDistinct(selectDistinctColumns)\n .then(table => makeModel(this.dh, table, this.formatter));\n }\n this.setNextModel(modelPromise);\n }\n\n set totalsConfig(totalsConfig: UITotalsTableConfig | null) {\n if (this.modelPromise != null) {\n // Model switch in progress. Don't forward, as the config may reference stale columns.\n // COLUMNS_CHANGED will reapply the correct config after.\n return;\n }\n this.model.totalsConfig = totalsConfig;\n }\n\n get isFilterRequired(): boolean {\n return this.originalModel.isFilterRequired;\n }\n\n get isPartitionRequired(): boolean {\n // @ts-expect-error If the original model is not a partitioned model return undefined to make the proxy model also return false in isPartitionedGridModelProvider\n return isPartitionedGridModelProvider(this.originalModel)\n ? this.originalModel.isPartitionRequired\n : undefined;\n }\n\n get isPartitionAwareSourceTable(): boolean {\n return (\n isPartitionedGridModelProvider(this.originalModel) &&\n this.originalModel.isPartitionAwareSourceTable\n );\n }\n\n get formatter(): Formatter {\n return this.originalModel.formatter;\n }\n\n set formatter(formatter: Formatter) {\n this.originalModel.formatter = formatter;\n }\n\n get columnAlignmentMap(): ReadonlyMap<string, CanvasTextAlign> {\n return this.originalModel.columnAlignmentMap;\n }\n\n set columnAlignmentMap(columnAlignmentMap: Map<string, CanvasTextAlign>) {\n this.originalModel.columnAlignmentMap = columnAlignmentMap;\n }\n\n setViewport = (\n top: number,\n bottom: number,\n columns?: DhType.Column[]\n ): void => {\n this.currentViewport = { top, bottom, columns };\n this.model.setViewport(top, bottom, columns);\n };\n}\n\nexport default IrisGridProxyModel;\n"],"mappings":";;;AAAA,OAAOA,SAAS,MAAM,iBAAiB;AACvC,SAASC,SAAS,EAAEC,UAAU,QAAQ,wBAAwB;AAC9D,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SAEEC,oBAAoB,EACpBC,YAAY,QACP,kBAAkB;AAAC,OAEnBC,kBAAkB;AAAA,OAClBC,6BAA6B;AAAA,OAC7BC,sBAAsB;AAAA,OACtBC,aAAa;AAAA,SAEXC,4BAA4B;AAAA,SAInCC,8BAA8B,EAC9BC,sBAAsB;AAGxB,IAAMC,GAAG,GAAGV,GAAG,CAACW,MAAM,CAAC,oBAAoB,CAAC;AAE5C,SAASC,SAASA,CAChBC,EAAiB,EACjBC,KAAgE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8B,CAAC,IAAI,CAAC4B,aAAa,CAAC,IAClD,IAAI,CAACA,aAAa,CAACsF,2BAA2B;EAElD;EAEA,IAAI3G,SAASA,CAAA,EAAc;IACzB,OAAO,IAAI,CAACqB,aAAa,CAACrB,SAAS;EACrC;EAEA,IAAIA,SAASA,CAACA,SAAoB,EAAE;IAClC,IAAI,CAACqB,aAAa,CAACrB,SAAS,GAAGA,SAAS;EAC1C;EAEA,IAAI4G,kBAAkBA,CAAA,EAAyC;IAC7D,OAAO,IAAI,CAACvF,aAAa,CAACuF,kBAAkB;EAC9C;EAEA,IAAIA,kBAAkBA,CAACA,kBAAgD,EAAE;IACvE,IAAI,CAACvF,aAAa,CAACuF,kBAAkB,GAAGA,kBAAkB;EAC5D;AAUF;AAEA,eAAexG,kBAAkB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"IrisGridProxyModel.js","names":["deepEqual","Formatter","TableUtils","Log","EventShimCustomEvent","PromiseUtils","IrisGridTableModel","IrisGridPartitionedTableModel","IrisGridTreeTableModel","IrisGridModel","isIrisGridTableModelTemplate","isPartitionedGridModelProvider","isPartitionedGridModel","log","module","makeModel","dh","table","formatter","inputTable","isTreeTable","isPartitionedTable","IrisGridProxyModel","constructor","arguments","length","undefined","_defineProperty","top","bottom","columns","currentViewport","model","setViewport","addEventListener","bind","removeEventListener","dispatchEvent","handleModelEvent","originalModel","modelPromise","rollup","partition","selectDistinct","Proxy","get","target","prop","receiver","_Object$getOwnPropert","proxyHasGetter","Object","getOwnPropertyDescriptor","getPrototypeOf","Reflect","proxyHasProp","prototype","hasOwnProperty","call","proxyHasFn","trueTarget","set","value","_Object$getOwnPropert2","proxyHasSetter","has","close","cancel","event","debug2","detail","type","setModel","debug","oldModel","oldColumns","listenerCount","addListeners","EVENT","SCHEMA_CHANGED","COLUMNS_CHANGED","_this$currentViewport","TABLE_CHANGED","setNextModel","removeListeners","makeCancelable","then","catch","err","isCanceled","error","REQUEST_FAILED","startListening","stopListening","events","keys","i","isCustomColumnsAvailable","isSelectDistinctAvailable","selectDistinctColumns","isRollupAvailable","originalColumns","partitionColumns","partitionConfig","isPartitionRequired","Error","mode","partitions","every","p","Promise","resolve","partitionBaseTable","partitionMergedTable","partitionTable","partitionKeysTable","rollupConfig","columnNames","map","name","find","column","filter","totalsConfig","isFilterRequired","isPartitionAwareSourceTable","columnAlignmentMap"],"sources":["../src/IrisGridProxyModel.ts"],"sourcesContent":["import deepEqual from 'fast-deep-equal';\nimport { Formatter, TableUtils } from '@deephaven/jsapi-utils';\nimport Log from '@deephaven/log';\nimport {\n type CancelablePromise,\n EventShimCustomEvent,\n PromiseUtils,\n} from '@deephaven/utils';\nimport type { dh as DhType } from '@deephaven/jsapi-types';\nimport IrisGridTableModel from './IrisGridTableModel';\nimport IrisGridPartitionedTableModel from './IrisGridPartitionedTableModel';\nimport IrisGridTreeTableModel from './IrisGridTreeTableModel';\nimport IrisGridModel from './IrisGridModel';\nimport { type ColumnName, type UITotalsTableConfig } from './CommonTypes';\nimport { isIrisGridTableModelTemplate } from './IrisGridTableModelTemplate';\nimport {\n type PartitionConfig,\n type PartitionedGridModel,\n isPartitionedGridModelProvider,\n isPartitionedGridModel,\n} from './PartitionedGridModel';\n\nconst log = Log.module('IrisGridProxyModel');\n\nfunction makeModel(\n dh: typeof DhType,\n table: DhType.Table | DhType.TreeTable | DhType.PartitionedTable,\n formatter?: Formatter,\n inputTable?: DhType.InputTable | null\n): IrisGridModel {\n if (TableUtils.isTreeTable(table)) {\n return new IrisGridTreeTableModel(dh, table, formatter);\n }\n if (TableUtils.isPartitionedTable(table)) {\n return new IrisGridPartitionedTableModel(dh, table, formatter);\n }\n return new IrisGridTableModel(dh, table, formatter, inputTable);\n}\n\n/**\n * Model which proxies calls to other IrisGridModels.\n * This allows for operations that generate new tables, like rollups.\n * The proxy model will call any methods it has implemented and delegate any\n * it does not implement to the underlying model.\n */\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nclass IrisGridProxyModel extends IrisGridModel implements PartitionedGridModel {\n /**\n * @param dh JSAPI instance\n * @param table Iris data table to be used in the model\n * @param formatter The formatter to use when getting formats\n * @param inputTable Iris input table associated with this table\n */\n\n model: IrisGridModel;\n\n dh: typeof DhType;\n\n private originalModel: IrisGridModel;\n\n private modelPromise: CancelablePromise<IrisGridModel> | null;\n\n private rollup: DhType.RollupConfig | null;\n\n private partition: PartitionConfig | null;\n\n private selectDistinct: ColumnName[];\n\n private currentViewport?: {\n top: number;\n bottom: number;\n columns?: DhType.Column[];\n };\n\n constructor(\n dh: typeof DhType,\n table: DhType.Table | DhType.TreeTable | DhType.PartitionedTable,\n formatter = new Formatter(dh),\n inputTable: DhType.InputTable | null = null\n ) {\n super(dh);\n\n // The EventTarget methods must be bound to this instance\n // Otherwise they throw errors because of the Proxy\n this.addEventListener = this.addEventListener.bind(this);\n this.removeEventListener = this.removeEventListener.bind(this);\n this.dispatchEvent = this.dispatchEvent.bind(this);\n\n this.handleModelEvent = this.handleModelEvent.bind(this);\n\n const model = makeModel(dh, table, formatter, inputTable);\n this.dh = dh;\n this.originalModel = model;\n this.model = model;\n this.modelPromise = null;\n this.rollup = null;\n this.partition = null;\n this.selectDistinct = [];\n\n // eslint-disable-next-line no-constructor-return\n return new Proxy(this, {\n // We want to use any properties on the proxy model if defined\n // If not, then proxy to the underlying model\n get(target, prop, receiver) {\n // Does this class have a getter for the prop\n // Getter functions are on the prototype\n const proxyHasGetter =\n Object.getOwnPropertyDescriptor(Object.getPrototypeOf(target), prop)\n ?.get != null;\n\n if (proxyHasGetter) {\n return Reflect.get(target, prop, receiver);\n }\n\n // Does this class implement the property\n const proxyHasProp = Object.prototype.hasOwnProperty.call(target, prop);\n\n // Does the class implement a function for the property\n const proxyHasFn = Object.prototype.hasOwnProperty.call(\n Object.getPrototypeOf(target),\n prop\n );\n\n const trueTarget = proxyHasProp || proxyHasFn ? target : target.model;\n return Reflect.get(trueTarget, prop);\n },\n set(target, prop, value) {\n const proxyHasSetter =\n Object.getOwnPropertyDescriptor(Object.getPrototypeOf(target), prop)\n ?.set != null;\n\n const proxyHasProp = Object.prototype.hasOwnProperty.call(target, prop);\n\n if (proxyHasSetter || proxyHasProp) {\n return Reflect.set(target, prop, value, target);\n }\n\n return Reflect.set(target.model, prop, value, target.model);\n },\n // Mirror `get` so duck-type checks (`'prop' in model`) used by inner\n // model variants (e.g. pivot) resolve against the inner model when\n // the proxy itself doesn't define the property.\n has(target, prop) {\n if (Reflect.has(target, prop)) {\n return true;\n }\n return Reflect.has(target.model, prop);\n },\n });\n }\n\n close(): void {\n this.originalModel.close();\n if (this.model !== this.originalModel) {\n this.model.close();\n }\n if (this.modelPromise != null) {\n this.modelPromise.cancel();\n }\n }\n\n handleModelEvent(event: CustomEvent): void {\n log.debug2('handleModelEvent', event);\n\n const { detail, type } = event;\n this.dispatchEvent(new EventShimCustomEvent(type, { detail }));\n }\n\n setModel(model: IrisGridModel): void {\n log.debug('setModel', model);\n\n const oldModel = this.model;\n const { columns: oldColumns } = oldModel;\n\n if (oldModel !== this.originalModel) {\n oldModel.close();\n }\n\n this.model = model;\n\n if (this.listenerCount > 0) {\n this.addListeners(model);\n }\n\n if (oldModel !== model) {\n // Signal an inner-model swap so the host can reset view state owned by\n // the previous model (e.g. `movedColumns`). Dispatched before\n // COLUMNS_CHANGED / TABLE_CHANGED so the host resets moves first, then\n // reacts to the new column set.\n this.dispatchEvent(\n new EventShimCustomEvent(IrisGridModel.EVENT.SCHEMA_CHANGED, {\n detail: model,\n })\n );\n }\n\n if (oldColumns !== model.columns) {\n this.dispatchEvent(\n new EventShimCustomEvent(IrisGridModel.EVENT.COLUMNS_CHANGED, {\n detail: model.columns,\n })\n );\n } else if (this.currentViewport != null) {\n // If the columns haven't changed, the current viewport should still valid, and needs to be set on the new model\n const { top, bottom, columns } = this.currentViewport;\n model.setViewport(top, bottom, columns);\n }\n\n if (isIrisGridTableModelTemplate(model)) {\n this.dispatchEvent(\n new EventShimCustomEvent(IrisGridModel.EVENT.TABLE_CHANGED, {\n detail: model.table,\n })\n );\n }\n }\n\n setNextModel(modelPromise: Promise<IrisGridModel>): void {\n log.debug2('setNextModel');\n\n if (this.modelPromise) {\n this.modelPromise.cancel();\n }\n\n if (this.listenerCount > 0) {\n this.removeListeners(this.model);\n }\n\n this.modelPromise = PromiseUtils.makeCancelable(\n modelPromise,\n (model: IrisGridModel) => {\n // Don't close originalModel — it's the source-of-truth model owned\n // by this proxy, not a transient transform result. Closing it would\n // invalidate the underlying table for any consumer that later asks\n // to swap back to it.\n if (model !== this.originalModel) {\n model.close();\n }\n }\n );\n this.modelPromise\n .then(model => {\n this.modelPromise = null;\n this.setModel(model);\n })\n .catch((err: unknown) => {\n if (PromiseUtils.isCanceled(err)) {\n log.debug2('setNextModel cancelled');\n return;\n }\n\n log.error('Unable to set next model', err);\n this.modelPromise = null;\n\n this.dispatchEvent(\n new EventShimCustomEvent(IrisGridModel.EVENT.REQUEST_FAILED, {\n detail: err,\n })\n );\n });\n }\n\n startListening(): void {\n super.startListening();\n\n this.addListeners(this.model);\n }\n\n stopListening(): void {\n super.stopListening();\n\n this.removeListeners(this.model);\n }\n\n addListeners(model: IrisGridModel): void {\n const events = Object.keys(IrisGridModel.EVENT);\n for (let i = 0; i < events.length; i += 1) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n model.addEventListener(events[i], this.handleModelEvent);\n }\n }\n\n removeListeners(model: IrisGridModel): void {\n const events = Object.keys(IrisGridModel.EVENT);\n for (let i = 0; i < events.length; i += 1) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n model.removeEventListener(events[i], this.handleModelEvent);\n }\n }\n\n get isCustomColumnsAvailable(): boolean {\n return (\n this.model.isCustomColumnsAvailable &&\n // Disable for selectDistinct tables\n !(this.isSelectDistinctAvailable && this.selectDistinctColumns.length > 0)\n );\n }\n\n get isRollupAvailable(): boolean {\n return (\n (this.originalModel.isRollupAvailable || this.rollup != null) &&\n this.selectDistinct.length === 0\n );\n }\n\n get isSelectDistinctAvailable(): boolean {\n return (\n // The presented model must support select distinct. Models that don't\n // (e.g. pivot models) report false here even though the underlying\n // source table would. This keeps the capability consistent with whatever\n // is currently displayed.\n this.model.isSelectDistinctAvailable &&\n (this.originalModel.isSelectDistinctAvailable ||\n this.selectDistinct.length > 0) &&\n this.rollup == null\n );\n }\n\n get originalColumns(): readonly DhType.Column[] {\n return this.originalModel.columns;\n }\n\n get partitionColumns(): readonly DhType.Column[] {\n if (!isPartitionedGridModelProvider(this.originalModel)) {\n return [];\n }\n return this.originalModel.partitionColumns;\n }\n\n get partitionConfig(): PartitionConfig | null {\n if (\n !isPartitionedGridModelProvider(this.originalModel) ||\n !this.originalModel.isPartitionRequired\n ) {\n if (!isPartitionedGridModel(this.originalModel)) {\n // @ts-expect-error If the original model has an undefined partitionConfig return undefined to make the proxy model also return false in isPartitionedGridModel\n return undefined;\n }\n return null;\n }\n return this.partition;\n }\n\n set partitionConfig(partitionConfig: PartitionConfig | null) {\n if (!this.isPartitionRequired) {\n throw new Error('Partitions are not available');\n }\n // Skip if config hasn't changed to avoid unnecessary model swaps (e.g. on remount)\n if (\n this.partition === partitionConfig ||\n (this.partition != null &&\n partitionConfig != null &&\n this.partition.mode === partitionConfig.mode &&\n this.partition.partitions.length ===\n partitionConfig.partitions.length &&\n this.partition.partitions.every(\n (p, i) => p === partitionConfig.partitions[i]\n ))\n ) {\n return;\n }\n log.debug('set partitionConfig', partitionConfig);\n this.partition = partitionConfig;\n\n let modelPromise = Promise.resolve(this.originalModel);\n if (\n partitionConfig != null &&\n isPartitionedGridModelProvider(this.originalModel)\n ) {\n if (partitionConfig.mode === 'keys') {\n modelPromise = this.originalModel\n .partitionBaseTable()\n .then(table => makeModel(this.dh, table, this.formatter));\n } else if (partitionConfig.mode === 'merged') {\n modelPromise = this.originalModel\n .partitionMergedTable()\n .then(table => makeModel(this.dh, table, this.formatter));\n } else {\n modelPromise = this.originalModel\n .partitionTable(partitionConfig.partitions)\n .then(table => makeModel(this.dh, table, this.formatter));\n }\n }\n\n this.setNextModel(modelPromise);\n }\n\n partitionKeysTable(): Promise<DhType.Table> {\n if (!isPartitionedGridModelProvider(this.originalModel)) {\n throw new Error('Partitions are not available');\n }\n return this.originalModel.partitionKeysTable();\n }\n\n partitionMergedTable(): Promise<DhType.Table> {\n if (!isPartitionedGridModelProvider(this.originalModel)) {\n throw new Error('Partitions are not available');\n }\n return this.originalModel.partitionMergedTable();\n }\n\n partitionTable(partitions: unknown[]): Promise<DhType.Table> {\n if (!isPartitionedGridModelProvider(this.originalModel)) {\n throw new Error('Partitions are not available');\n }\n return this.originalModel.partitionTable(partitions);\n }\n\n get rollupConfig(): DhType.RollupConfig | null {\n return this.rollup;\n }\n\n set rollupConfig(rollupConfig: DhType.RollupConfig | null) {\n log.debug('set rollupConfig', rollupConfig);\n\n if (!this.isRollupAvailable) {\n throw new Error('Rollup Rows are not available');\n }\n\n // Prevent model update when IrisGridModelUpdater is mounted\n // if rollup is already initialized in IrisGridPanel\n if (deepEqual(rollupConfig, this.rollup)) {\n return;\n }\n\n this.rollup = rollupConfig;\n\n let modelPromise = Promise.resolve(this.originalModel);\n\n if (\n isIrisGridTableModelTemplate(this.originalModel) &&\n rollupConfig != null\n ) {\n modelPromise = this.originalModel.table\n .rollup(rollupConfig)\n .then(table => makeModel(this.dh, table, this.formatter));\n }\n this.setNextModel(modelPromise);\n }\n\n get selectDistinctColumns(): ColumnName[] {\n return this.selectDistinct;\n }\n\n set selectDistinctColumns(columnNames: string[]) {\n log.debug('set selectDistinctColumns', columnNames);\n\n if (!this.isSelectDistinctAvailable) {\n throw new Error('Select distinct is not available');\n }\n\n if (\n columnNames === this.selectDistinctColumns ||\n (columnNames.length === 0 && this.selectDistinctColumns.length === 0)\n ) {\n log.debug('Ignore same selectDistinctColumns', columnNames);\n return;\n }\n\n this.selectDistinct = columnNames;\n\n const selectDistinctColumns = columnNames\n .map(name => this.originalColumns.find(column => column.name === name))\n .filter(column => column != null) as DhType.Column[];\n\n let modelPromise = Promise.resolve(this.originalModel);\n\n if (\n isIrisGridTableModelTemplate(this.originalModel) &&\n selectDistinctColumns.length > 0\n ) {\n modelPromise = this.originalModel.table\n .selectDistinct(selectDistinctColumns)\n .then(table => makeModel(this.dh, table, this.formatter));\n }\n this.setNextModel(modelPromise);\n }\n\n set totalsConfig(totalsConfig: UITotalsTableConfig | null) {\n if (this.modelPromise != null) {\n // Model switch in progress. Don't forward, as the config may reference stale columns.\n // COLUMNS_CHANGED will reapply the correct config after.\n return;\n }\n this.model.totalsConfig = totalsConfig;\n }\n\n get isFilterRequired(): boolean {\n return this.originalModel.isFilterRequired;\n }\n\n get isPartitionRequired(): boolean {\n // @ts-expect-error If the original model is not a partitioned model return undefined to make the proxy model also return false in isPartitionedGridModelProvider\n return isPartitionedGridModelProvider(this.originalModel)\n ? this.originalModel.isPartitionRequired\n : undefined;\n }\n\n get isPartitionAwareSourceTable(): boolean {\n return (\n isPartitionedGridModelProvider(this.originalModel) &&\n this.originalModel.isPartitionAwareSourceTable\n );\n }\n\n get formatter(): Formatter {\n return this.originalModel.formatter;\n }\n\n set formatter(formatter: Formatter) {\n this.originalModel.formatter = formatter;\n }\n\n get columnAlignmentMap(): ReadonlyMap<string, CanvasTextAlign> {\n return this.originalModel.columnAlignmentMap;\n }\n\n set columnAlignmentMap(columnAlignmentMap: Map<string, CanvasTextAlign>) {\n this.originalModel.columnAlignmentMap = columnAlignmentMap;\n }\n\n setViewport = (\n top: number,\n bottom: number,\n columns?: DhType.Column[]\n ): void => {\n this.currentViewport = { top, bottom, columns };\n this.model.setViewport(top, bottom, columns);\n };\n}\n\nexport default IrisGridProxyModel;\n"],"mappings":";;;AAAA,OAAOA,SAAS,MAAM,iBAAiB;AACvC,SAASC,SAAS,EAAEC,UAAU,QAAQ,wBAAwB;AAC9D,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SAEEC,oBAAoB,EACpBC,YAAY,QACP,kBAAkB;AAAC,OAEnBC,kBA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AACrF,aAAa,CAACqF,gBAAgB;EAC5C;EAEA,IAAIpB,mBAAmBA,CAAA,EAAY;IACjC;IACA,OAAO7F,8BAA8B,CAAC,IAAI,CAAC4B,aAAa,CAAC,GACrD,IAAI,CAACA,aAAa,CAACiE,mBAAmB,GACtC9E,SAAS;EACf;EAEA,IAAImG,2BAA2BA,CAAA,EAAY;IACzC,OACElH,8BAA8B,CAAC,IAAI,CAAC4B,aAAa,CAAC,IAClD,IAAI,CAACA,aAAa,CAACsF,2BAA2B;EAElD;EAEA,IAAI3G,SAASA,CAAA,EAAc;IACzB,OAAO,IAAI,CAACqB,aAAa,CAACrB,SAAS;EACrC;EAEA,IAAIA,SAASA,CAACA,SAAoB,EAAE;IAClC,IAAI,CAACqB,aAAa,CAACrB,SAAS,GAAGA,SAAS;EAC1C;EAEA,IAAI4G,kBAAkBA,CAAA,EAAyC;IAC7D,OAAO,IAAI,CAACvF,aAAa,CAACuF,kBAAkB;EAC9C;EAEA,IAAIA,kBAAkBA,CAACA,kBAAgD,EAAE;IACvE,IAAI,CAACvF,aAAa,CAACuF,kBAAkB,GAAGA,kBAAkB;EAC5D;AAUF;AAEA,eAAexG,kBAAkB","ignoreList":[]}
|
|
@@ -14,13 +14,20 @@ declare enum OptionType {
|
|
|
14
14
|
CONDITIONAL_FORMATTING_EDIT = "CONDITIONAL_FORMATTING_EDIT",
|
|
15
15
|
GOTO = "GOTO"
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Key for a plugin-contributed sidebar entry, following the
|
|
19
|
+
* `plugin:<plugin-name>:<id>` convention. Modeling it as a
|
|
20
|
+
* template-literal type rather than a bare `string` keeps `OptionItemKey`
|
|
21
|
+
* from collapsing to `string`, so `OptionType` autocomplete survives and
|
|
22
|
+
* an un-namespaced key is rejected at compile time.
|
|
23
|
+
*/
|
|
24
|
+
export type PluginOptionKey = `plugin:${string}:${string}`;
|
|
17
25
|
/**
|
|
18
26
|
* Identifier for a sidebar entry. Built-in entries use the closed
|
|
19
|
-
* `OptionType` enum; plugin-supplied entries use a
|
|
20
|
-
*
|
|
21
|
-
* distinguishes the two by the presence of `configPage` on the
|
|
27
|
+
* `OptionType` enum; plugin-supplied entries use a `PluginOptionKey`. The
|
|
28
|
+
* page-switch distinguishes the two by the presence of `configPage` on the
|
|
22
29
|
* `OptionItem`, not by inspecting the key.
|
|
23
30
|
*/
|
|
24
|
-
export type OptionItemKey = OptionType |
|
|
31
|
+
export type OptionItemKey = OptionType | PluginOptionKey;
|
|
25
32
|
export default OptionType;
|
|
26
33
|
//# sourceMappingURL=OptionType.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OptionType.d.ts","sourceRoot":"","sources":["../../src/sidebar/OptionType.ts"],"names":[],"mappings":"AAAA,aAAK,UAAU;IACb,iBAAiB,sBAAsB;IACvC,YAAY,iBAAiB;IAC7B,gBAAgB,sBAAsB;IACtC,aAAa,kBAAkB;IAC/B,qBAAqB,0BAA0B;IAC/C,aAAa,kBAAkB;IAC/B,WAAW,gBAAgB;IAC3B,UAAU,eAAe;IACzB,eAAe,oBAAoB;IACnC,cAAc,mBAAmB;IACjC,2BAA2B,gCAAgC;IAC3D,sBAAsB,2BAA2B;IACjD,2BAA2B,gCAAgC;IAC3D,IAAI,SAAS;CACd;AAED;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"OptionType.d.ts","sourceRoot":"","sources":["../../src/sidebar/OptionType.ts"],"names":[],"mappings":"AAAA,aAAK,UAAU;IACb,iBAAiB,sBAAsB;IACvC,YAAY,iBAAiB;IAC7B,gBAAgB,sBAAsB;IACtC,aAAa,kBAAkB;IAC/B,qBAAqB,0BAA0B;IAC/C,aAAa,kBAAkB;IAC/B,WAAW,gBAAgB;IAC3B,UAAU,eAAe;IACzB,eAAe,oBAAoB;IACnC,cAAc,mBAAmB;IACjC,2BAA2B,gCAAgC;IAC3D,sBAAsB,2BAA2B;IACjD,2BAA2B,gCAAgC;IAC3D,IAAI,SAAS;CACd;AAED;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,MAAM,IAAI,MAAM,EAAE,CAAC;AAE3D;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,eAAe,CAAC;AAEzD,eAAe,UAAU,CAAC"}
|
|
@@ -15,11 +15,17 @@ var OptionType = /*#__PURE__*/function (OptionType) {
|
|
|
15
15
|
OptionType["GOTO"] = "GOTO";
|
|
16
16
|
return OptionType;
|
|
17
17
|
}(OptionType || {});
|
|
18
|
+
/**
|
|
19
|
+
* Key for a plugin-contributed sidebar entry, following the
|
|
20
|
+
* `plugin:<plugin-name>:<id>` convention. Modeling it as a
|
|
21
|
+
* template-literal type rather than a bare `string` keeps `OptionItemKey`
|
|
22
|
+
* from collapsing to `string`, so `OptionType` autocomplete survives and
|
|
23
|
+
* an un-namespaced key is rejected at compile time.
|
|
24
|
+
*/
|
|
18
25
|
/**
|
|
19
26
|
* Identifier for a sidebar entry. Built-in entries use the closed
|
|
20
|
-
* `OptionType` enum; plugin-supplied entries use a
|
|
21
|
-
*
|
|
22
|
-
* distinguishes the two by the presence of `configPage` on the
|
|
27
|
+
* `OptionType` enum; plugin-supplied entries use a `PluginOptionKey`. The
|
|
28
|
+
* page-switch distinguishes the two by the presence of `configPage` on the
|
|
23
29
|
* `OptionItem`, not by inspecting the key.
|
|
24
30
|
*/
|
|
25
31
|
export default OptionType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OptionType.js","names":["OptionType"],"sources":["../../src/sidebar/OptionType.ts"],"sourcesContent":["enum OptionType {\n ADVANCED_SETTINGS = 'ADVANCED_SETTINGS',\n AGGREGATIONS = 'AGGREGATIONS',\n AGGREGATION_EDIT = 'AGGREGATIONS_EDIT',\n CHART_BUILDER = 'CHART_BUILDER',\n CUSTOM_COLUMN_BUILDER = 'CUSTOM_COLUMN_BUILDER',\n QUICK_FILTERS = 'QUICK_FILTERS',\n ROLLUP_ROWS = 'ROLLUP_ROWS',\n SEARCH_BAR = 'SEARCH_BAR',\n SELECT_DISTINCT = 'SELECT_DISTINCT',\n TABLE_EXPORTER = 'TABLE_EXPORTER',\n VISIBILITY_ORDERING_BUILDER = 'VISIBILITY_ORDERING_BUILDER',\n CONDITIONAL_FORMATTING = 'CONDITIONAL_FORMATTING',\n CONDITIONAL_FORMATTING_EDIT = 'CONDITIONAL_FORMATTING_EDIT',\n GOTO = 'GOTO',\n}\n\n/**\n * Identifier for a sidebar entry. Built-in entries use the closed\n * `OptionType` enum; plugin-supplied entries use a
|
|
1
|
+
{"version":3,"file":"OptionType.js","names":["OptionType"],"sources":["../../src/sidebar/OptionType.ts"],"sourcesContent":["enum OptionType {\n ADVANCED_SETTINGS = 'ADVANCED_SETTINGS',\n AGGREGATIONS = 'AGGREGATIONS',\n AGGREGATION_EDIT = 'AGGREGATIONS_EDIT',\n CHART_BUILDER = 'CHART_BUILDER',\n CUSTOM_COLUMN_BUILDER = 'CUSTOM_COLUMN_BUILDER',\n QUICK_FILTERS = 'QUICK_FILTERS',\n ROLLUP_ROWS = 'ROLLUP_ROWS',\n SEARCH_BAR = 'SEARCH_BAR',\n SELECT_DISTINCT = 'SELECT_DISTINCT',\n TABLE_EXPORTER = 'TABLE_EXPORTER',\n VISIBILITY_ORDERING_BUILDER = 'VISIBILITY_ORDERING_BUILDER',\n CONDITIONAL_FORMATTING = 'CONDITIONAL_FORMATTING',\n CONDITIONAL_FORMATTING_EDIT = 'CONDITIONAL_FORMATTING_EDIT',\n GOTO = 'GOTO',\n}\n\n/**\n * Key for a plugin-contributed sidebar entry, following the\n * `plugin:<plugin-name>:<id>` convention. Modeling it as a\n * template-literal type rather than a bare `string` keeps `OptionItemKey`\n * from collapsing to `string`, so `OptionType` autocomplete survives and\n * an un-namespaced key is rejected at compile time.\n */\nexport type PluginOptionKey = `plugin:${string}:${string}`;\n\n/**\n * Identifier for a sidebar entry. Built-in entries use the closed\n * `OptionType` enum; plugin-supplied entries use a `PluginOptionKey`. The\n * page-switch distinguishes the two by the presence of `configPage` on the\n * `OptionItem`, not by inspecting the key.\n */\nexport type OptionItemKey = OptionType | PluginOptionKey;\n\nexport default OptionType;\n"],"mappings":"IAAKA,UAAU,0BAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA,EAAVA,UAAU;AAiBf;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AAGA,eAAeA,UAAU","ignoreList":[]}
|
|
@@ -2,26 +2,21 @@ import React, { type ErrorInfo, type ReactNode } from 'react';
|
|
|
2
2
|
type Props = {
|
|
3
3
|
/** Identifier for the failing item, used for log correlation. */
|
|
4
4
|
itemType: string;
|
|
5
|
-
/**
|
|
6
|
-
* Optional callback to pop the failing page off the sidebar stack.
|
|
7
|
-
* When provided, the fallback UI shows a Back button wired to it.
|
|
8
|
-
*/
|
|
9
|
-
onBack?: () => void;
|
|
10
5
|
children: ReactNode;
|
|
11
6
|
};
|
|
12
7
|
type State = {
|
|
13
|
-
|
|
8
|
+
error: Error | null;
|
|
14
9
|
};
|
|
15
10
|
/**
|
|
16
11
|
* Tiny error boundary scoped to a single plugin-supplied sidebar page.
|
|
17
12
|
* If the plugin's `configPage` throws during render, we log the error
|
|
18
|
-
* once and render a minimal fallback ("
|
|
19
|
-
* rather than tearing down the entire `IrisGrid`
|
|
20
|
-
* blank panel. Used only by the page-switch
|
|
21
|
-
* `IrisGrid.tsx`.
|
|
13
|
+
* once and render a minimal fallback ("<name> failed to render:" + the
|
|
14
|
+
* thrown message) rather than tearing down the entire `IrisGrid`
|
|
15
|
+
* subtree or leaving a blank panel. Used only by the page-switch
|
|
16
|
+
* `default` case in `IrisGrid.tsx`.
|
|
22
17
|
*/
|
|
23
18
|
export default class PluginTableOptionsErrorBoundary extends React.Component<Props, State> {
|
|
24
|
-
static getDerivedStateFromError(): State;
|
|
19
|
+
static getDerivedStateFromError(error: Error): State;
|
|
25
20
|
constructor(props: Props);
|
|
26
21
|
componentDidCatch(error: Error, info: ErrorInfo): void;
|
|
27
22
|
render(): ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PluginTableOptionsErrorBoundary.d.ts","sourceRoot":"","sources":["../../src/sidebar/PluginTableOptionsErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAK9D,KAAK,KAAK,GAAG;IACX,iEAAiE;IACjE,QAAQ,EAAE,MAAM,CAAC;IACjB
|
|
1
|
+
{"version":3,"file":"PluginTableOptionsErrorBoundary.d.ts","sourceRoot":"","sources":["../../src/sidebar/PluginTableOptionsErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAK9D,KAAK,KAAK,GAAG;IACX,iEAAiE;IACjE,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,KAAK,KAAK,GAAG;IAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;CAAE,CAAC;AAErC;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,OAAO,+BAAgC,SAAQ,KAAK,CAAC,SAAS,CAC1E,KAAK,EACL,KAAK,CACN;IACC,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK;gBAIxC,KAAK,EAAE,KAAK;IAKxB,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,GAAG,IAAI;IAStD,MAAM,IAAI,SAAS;CAiBpB"}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Log from '@deephaven/log';
|
|
3
|
-
import {
|
|
3
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
4
4
|
var log = Log.module('PluginTableOptionsErrorBoundary');
|
|
5
5
|
/**
|
|
6
6
|
* Tiny error boundary scoped to a single plugin-supplied sidebar page.
|
|
7
7
|
* If the plugin's `configPage` throws during render, we log the error
|
|
8
|
-
* once and render a minimal fallback ("
|
|
9
|
-
* rather than tearing down the entire `IrisGrid`
|
|
10
|
-
* blank panel. Used only by the page-switch
|
|
11
|
-
* `IrisGrid.tsx`.
|
|
8
|
+
* once and render a minimal fallback ("<name> failed to render:" + the
|
|
9
|
+
* thrown message) rather than tearing down the entire `IrisGrid`
|
|
10
|
+
* subtree or leaving a blank panel. Used only by the page-switch
|
|
11
|
+
* `default` case in `IrisGrid.tsx`.
|
|
12
12
|
*/
|
|
13
13
|
export default class PluginTableOptionsErrorBoundary extends React.Component {
|
|
14
|
-
static getDerivedStateFromError() {
|
|
14
|
+
static getDerivedStateFromError(error) {
|
|
15
15
|
return {
|
|
16
|
-
|
|
16
|
+
error
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
constructor(props) {
|
|
20
20
|
super(props);
|
|
21
21
|
this.state = {
|
|
22
|
-
|
|
22
|
+
error: null
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
componentDidCatch(error, info) {
|
|
@@ -27,12 +27,11 @@ export default class PluginTableOptionsErrorBoundary extends React.Component {
|
|
|
27
27
|
log.error("Plugin sidebar page \"".concat(itemType, "\" threw during render; suppressing."), error, info);
|
|
28
28
|
}
|
|
29
29
|
render() {
|
|
30
|
-
var
|
|
30
|
+
var error = this.state.error;
|
|
31
31
|
var _this$props = this.props,
|
|
32
32
|
children = _this$props.children,
|
|
33
|
-
itemType = _this$props.itemType
|
|
34
|
-
|
|
35
|
-
if (!hasError) {
|
|
33
|
+
itemType = _this$props.itemType;
|
|
34
|
+
if (error == null) {
|
|
36
35
|
return children;
|
|
37
36
|
}
|
|
38
37
|
return /*#__PURE__*/_jsxs("div", {
|
|
@@ -40,14 +39,9 @@ export default class PluginTableOptionsErrorBoundary extends React.Component {
|
|
|
40
39
|
role: "alert",
|
|
41
40
|
"data-testid": "plugin-sidebar-error",
|
|
42
41
|
children: [/*#__PURE__*/_jsxs("p", {
|
|
43
|
-
children: ["
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}), onBack != null && /*#__PURE__*/_jsx("button", {
|
|
47
|
-
type: "button",
|
|
48
|
-
className: "btn btn-secondary",
|
|
49
|
-
onClick: onBack,
|
|
50
|
-
children: "Back"
|
|
42
|
+
children: [itemType, " failed to render:"]
|
|
43
|
+
}), /*#__PURE__*/_jsx("p", {
|
|
44
|
+
children: error.message
|
|
51
45
|
})]
|
|
52
46
|
});
|
|
53
47
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PluginTableOptionsErrorBoundary.js","names":["React","Log","
|
|
1
|
+
{"version":3,"file":"PluginTableOptionsErrorBoundary.js","names":["React","Log","jsxs","_jsxs","jsx","_jsx","log","module","PluginTableOptionsErrorBoundary","Component","getDerivedStateFromError","error","constructor","props","state","componentDidCatch","info","itemType","concat","render","_this$props","children","className","role","message"],"sources":["../../src/sidebar/PluginTableOptionsErrorBoundary.tsx"],"sourcesContent":["import React, { type ErrorInfo, type ReactNode } from 'react';\nimport Log from '@deephaven/log';\n\nconst log = Log.module('PluginTableOptionsErrorBoundary');\n\ntype Props = {\n /** Identifier for the failing item, used for log correlation. */\n itemType: string;\n children: ReactNode;\n};\n\ntype State = { error: Error | null };\n\n/**\n * Tiny error boundary scoped to a single plugin-supplied sidebar page.\n * If the plugin's `configPage` throws during render, we log the error\n * once and render a minimal fallback (\"<name> failed to render:\" + the\n * thrown message) rather than tearing down the entire `IrisGrid`\n * subtree or leaving a blank panel. Used only by the page-switch\n * `default` case in `IrisGrid.tsx`.\n */\nexport default class PluginTableOptionsErrorBoundary extends React.Component<\n Props,\n State\n> {\n static getDerivedStateFromError(error: Error): State {\n return { error };\n }\n\n constructor(props: Props) {\n super(props);\n this.state = { error: null };\n }\n\n componentDidCatch(error: Error, info: ErrorInfo): void {\n const { itemType } = this.props;\n log.error(\n `Plugin sidebar page \"${itemType}\" threw during render; suppressing.`,\n error,\n info\n );\n }\n\n render(): ReactNode {\n const { error } = this.state;\n const { children, itemType } = this.props;\n if (error == null) {\n return children;\n }\n return (\n <div\n className=\"plugin-sidebar-error\"\n role=\"alert\"\n data-testid=\"plugin-sidebar-error\"\n >\n <p>{itemType} failed to render:</p>\n <p>{error.message}</p>\n </div>\n );\n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAA0C,OAAO;AAC7D,OAAOC,GAAG,MAAM,gBAAgB;AAAC,SAAAC,IAAA,IAAAC,KAAA,EAAAC,GAAA,IAAAC,IAAA;AAEjC,IAAMC,GAAG,GAAGL,GAAG,CAACM,MAAM,CAAC,iCAAiC,CAAC;AAUzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAMC,+BAA+B,SAASR,KAAK,CAACS,SAAS,CAG1E;EACA,OAAOC,wBAAwBA,CAACC,KAAY,EAAS;IACnD,OAAO;MAAEA;IAAM,CAAC;EAClB;EAEAC,WAAWA,CAACC,KAAY,EAAE;IACxB,KAAK,CAACA,KAAK,CAAC;IACZ,IAAI,CAACC,KAAK,GAAG;MAAEH,KAAK,EAAE;IAAK,CAAC;EAC9B;EAEAI,iBAAiBA,CAACJ,KAAY,EAAEK,IAAe,EAAQ;IACrD,IAAQC,QAAQ,GAAK,IAAI,CAACJ,KAAK,CAAvBI,QAAQ;IAChBX,GAAG,CAACK,KAAK,0BAAAO,MAAA,CACiBD,QAAQ,2CAChCN,KAAK,EACLK,IACF,CAAC;EACH;EAEAG,MAAMA,CAAA,EAAc;IAClB,IAAQR,KAAK,GAAK,IAAI,CAACG,KAAK,CAApBH,KAAK;IACb,IAAAS,WAAA,GAA+B,IAAI,CAACP,KAAK;MAAjCQ,QAAQ,GAAAD,WAAA,CAARC,QAAQ;MAAEJ,QAAQ,GAAAG,WAAA,CAARH,QAAQ;IAC1B,IAAIN,KAAK,IAAI,IAAI,EAAE;MACjB,OAAOU,QAAQ;IACjB;IACA,oBACElB,KAAA;MACEmB,SAAS,EAAC,sBAAsB;MAChCC,IAAI,EAAC,OAAO;MACZ,eAAY,sBAAsB;MAAAF,QAAA,gBAElClB,KAAA;QAAAkB,QAAA,GAAIJ,QAAQ,EAAC,oBAAkB;MAAA,CAAG,CAAC,eACnCZ,IAAA;QAAAgB,QAAA,EAAIV,KAAK,CAACa;MAAO,CAAI,CAAC;IAAA,CACnB,CAAC;EAEV;AACF","ignoreList":[]}
|
package/dist/sidebar/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import AggregationEdit from './aggregations/AggregationEdit';
|
|
|
4
4
|
import AggregationUtils from './aggregations/AggregationUtils';
|
|
5
5
|
import ChartBuilder from './ChartBuilder';
|
|
6
6
|
import CustomColumnBuilder from './CustomColumnBuilder';
|
|
7
|
-
import OptionType, { type OptionItemKey } from './OptionType';
|
|
7
|
+
import OptionType, { type OptionItemKey, type PluginOptionKey } from './OptionType';
|
|
8
8
|
import RollupRows from './RollupRows';
|
|
9
9
|
import TableCsvExporter from './TableCsvExporter';
|
|
10
10
|
import TableSaver from './TableSaver';
|
|
@@ -13,7 +13,7 @@ import { type FormattingRule } from './conditional-formatting/ConditionalFormatt
|
|
|
13
13
|
import AdvancedSettingsType from './AdvancedSettingsType';
|
|
14
14
|
import DownloadServiceWorkerUtils from './DownloadServiceWorkerUtils';
|
|
15
15
|
import { type IrisGridTableOptionsWidgetProps, type TableOptionsTransform } from './IrisGridTableOptionsWidgetProps';
|
|
16
|
-
export { AdvancedSettings, Aggregations, AggregationEdit, AggregationUtils, ChartBuilder, CustomColumnBuilder, OptionType, type OptionItemKey, RollupRows, TableCsvExporter, TableSaver, VisibilityOrderingBuilder, AdvancedSettingsType, DownloadServiceWorkerUtils, type IrisGridTableOptionsWidgetProps, type TableOptionsTransform, };
|
|
16
|
+
export { AdvancedSettings, Aggregations, AggregationEdit, AggregationUtils, ChartBuilder, CustomColumnBuilder, OptionType, type OptionItemKey, type PluginOptionKey, RollupRows, TableCsvExporter, TableSaver, VisibilityOrderingBuilder, AdvancedSettingsType, DownloadServiceWorkerUtils, type IrisGridTableOptionsWidgetProps, type TableOptionsTransform, };
|
|
17
17
|
export type { FormattingRule as SidebarFormattingRule };
|
|
18
18
|
export * from './aggregations';
|
|
19
19
|
export * from './RollupRows';
|