@talxis/base-controls 1.2604.1 → 1.2605.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/TaskGrid/components/grid/grid-customizer/GridCustomizer.d.ts +12 -9
- package/dist/components/TaskGrid/components/grid/grid-customizer/GridCustomizer.js.map +1 -1
- package/dist/index.d.ts +10 -7
- package/dist/utils/dataset/adapters/VirtualDatasetAdapter.js.map +1 -1
- package/package.json +6 -6
|
@@ -1,27 +1,30 @@
|
|
|
1
|
-
import { ColDef, GridApi, RowClassRules } from "@ag-grid-community/core";
|
|
1
|
+
import { ColDef as ColDefBase, GridApi as GridApiBase, RowClassRules as RowClassRulesBase } from "@ag-grid-community/core";
|
|
2
2
|
import { ITaskDataProvider } from "../../../data-providers/task-data-provider";
|
|
3
3
|
import { IRecord } from "@talxis/client-libraries";
|
|
4
4
|
import { ITaskGridDatasetControl } from "../../../interfaces";
|
|
5
5
|
export declare const ADD_TASK_COLUMN_NAME = "addTask";
|
|
6
|
+
export type ColDef = ColDefBase<IRecord>;
|
|
7
|
+
export type GridApi = GridApiBase<IRecord>;
|
|
8
|
+
export type RowClassRules = RowClassRulesBase<IRecord>;
|
|
6
9
|
/** Strategy interface for deep customization of the AG Grid instance inside TaskGrid. */
|
|
7
10
|
export interface IGridCustomizerStrategy {
|
|
8
11
|
/** Called once after the grid is ready. Use to call `customizer.registerExpressionDecorator` or perform other one-time setup. */
|
|
9
12
|
onInitialize: (customizer: IGridCustomizer) => void;
|
|
10
13
|
/** Receives the computed column definitions and may return a modified array. */
|
|
11
|
-
onGetColumnDefinitions?: (columnDefs: ColDef
|
|
14
|
+
onGetColumnDefinitions?: (columnDefs: ColDef[]) => ColDef[];
|
|
12
15
|
/** Receives the default row class rules map and may return an extended or overridden version. */
|
|
13
|
-
onGetRowClassRules?: (rules: RowClassRules
|
|
16
|
+
onGetRowClassRules?: (rules: RowClassRules) => RowClassRules;
|
|
14
17
|
/** Return a custom cell renderer component for the given column definition, or `undefined` to use the default. */
|
|
15
|
-
onGetCellRenderer?: (colDef: ColDef
|
|
18
|
+
onGetCellRenderer?: (colDef: ColDef) => any;
|
|
16
19
|
/** Return a custom cell editor component for the given column definition, or `undefined` to use the default. */
|
|
17
|
-
onGetCellEditor?: (colDef: ColDef
|
|
20
|
+
onGetCellEditor?: (colDef: ColDef) => any;
|
|
18
21
|
/** Receives the raw AG Grid `GridApi` instance, useful if the strategy needs to retain a reference. */
|
|
19
|
-
onRetrieveGridApi?: (gridApi: GridApi
|
|
22
|
+
onRetrieveGridApi?: (gridApi: GridApi) => void;
|
|
20
23
|
}
|
|
21
24
|
/** Provides access to the AG Grid instance and the TaskGrid control to code running inside `IGridCustomizerStrategy`. */
|
|
22
25
|
export interface IGridCustomizer {
|
|
23
26
|
/** Returns the underlying AG Grid `GridApi`. */
|
|
24
|
-
getGridApi(): GridApi
|
|
27
|
+
getGridApi(): GridApi;
|
|
25
28
|
/** Returns the `ITaskDataProvider` that backs the grid data layer. */
|
|
26
29
|
getTaskDataProvider(): ITaskDataProvider;
|
|
27
30
|
/** Returns the `ITaskGridDatasetControl` runtime control interface. */
|
|
@@ -33,7 +36,7 @@ export interface IGridCustomizer {
|
|
|
33
36
|
registerExpressionDecorator(columnName: string, registrator: () => void): void;
|
|
34
37
|
}
|
|
35
38
|
export interface IGridCustomizerParameters {
|
|
36
|
-
gridApi: GridApi
|
|
39
|
+
gridApi: GridApi;
|
|
37
40
|
datasetControl: ITaskGridDatasetControl;
|
|
38
41
|
strategy?: IGridCustomizerStrategy;
|
|
39
42
|
}
|
|
@@ -48,7 +51,7 @@ export declare class GridCustomizer implements IGridCustomizer {
|
|
|
48
51
|
private _strategy?;
|
|
49
52
|
constructor(parameters: IGridCustomizerParameters);
|
|
50
53
|
getDatasetControl(): ITaskGridDatasetControl;
|
|
51
|
-
getGridApi(): GridApi
|
|
54
|
+
getGridApi(): GridApi;
|
|
52
55
|
getTaskDataProvider(): ITaskDataProvider;
|
|
53
56
|
registerExpressionDecorator(columnName: string, registrator: () => void): void;
|
|
54
57
|
private _patchGridApi;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridCustomizer.js","sources":["../../../../../../src/components/TaskGrid/components/grid/grid-customizer/GridCustomizer.ts"],"sourcesContent":["import { ColDef, GridApi, IRowNode, IsServerSideGroupOpenByDefaultParams, RowClassRules } from \"@ag-grid-community/core\";\nimport { ITaskDataProvider } from \"../../../data-providers/task-data-provider\";\nimport { DatasetConstants, IRawRecord, IRecord } from \"@talxis/client-libraries\";\nimport { GridDragHandler, IDragOperation } from \"../grid-drag-handler\";\nimport { GroupCell } from \"../group-cell\";\nimport { TreeExpandCollapseHeader } from \"../cell-headers/tree-expand-collapse-header\";\nimport { AddTaskButton } from \"../cell-renderers/add-task-button\";\nimport { ILocalizationService, ITaskGridLabels } from \"../../../labels\";\nimport { PercentComplete } from \"../cell-renderers/percent-complete\";\nimport { INativeColumns, ITaskGridDatasetControl } from \"../../../interfaces\";\n\nexport const ADD_TASK_COLUMN_NAME = 'addTask';\n\n\n/** Strategy interface for deep customization of the AG Grid instance inside TaskGrid. */\nexport interface IGridCustomizerStrategy {\n /** Called once after the grid is ready. Use to call `customizer.registerExpressionDecorator` or perform other one-time setup. */\n onInitialize: (customizer: IGridCustomizer) => void;\n /** Receives the computed column definitions and may return a modified array. */\n onGetColumnDefinitions?: (columnDefs: ColDef<IRecord>[]) => ColDef<IRecord>[];\n /** Receives the default row class rules map and may return an extended or overridden version. */\n onGetRowClassRules?: (rules: RowClassRules<IRecord>) => RowClassRules<IRecord>;\n /** Return a custom cell renderer component for the given column definition, or `undefined` to use the default. */\n onGetCellRenderer?: (colDef: ColDef<IRecord>) => any;\n /** Return a custom cell editor component for the given column definition, or `undefined` to use the default. */\n onGetCellEditor?: (colDef: ColDef<IRecord>) => any;\n /** Receives the raw AG Grid `GridApi` instance, useful if the strategy needs to retain a reference. */\n onRetrieveGridApi?: (gridApi: GridApi<IRecord>) => void;\n}\n\n/** Provides access to the AG Grid instance and the TaskGrid control to code running inside `IGridCustomizerStrategy`. */\nexport interface IGridCustomizer {\n /** Returns the underlying AG Grid `GridApi`. */\n getGridApi(): GridApi<IRecord>;\n /** Returns the `ITaskDataProvider` that backs the grid data layer. */\n getTaskDataProvider(): ITaskDataProvider;\n /** Returns the `ITaskGridDatasetControl` runtime control interface. */\n getDatasetControl(): ITaskGridDatasetControl;\n /**\n * Registers a column-expression decorator only when the given column exists in the current columns map.\n * Prevents errors when registering decorators for columns that may not be present in all views.\n */\n registerExpressionDecorator(columnName: string, registrator: () => void): void;\n}\n\nexport interface IGridCustomizerParameters {\n gridApi: GridApi<IRecord>;\n datasetControl: ITaskGridDatasetControl;\n strategy?: IGridCustomizerStrategy;\n}\n\nexport class GridCustomizer implements IGridCustomizer {\n private _taskDataProvider: ITaskDataProvider;\n private _gridApi: GridApi<IRecord>;\n private _gridDragHandler: GridDragHandler;\n private _localizationService: ILocalizationService<ITaskGridLabels>;\n private _nativeColumns: INativeColumns;\n private _pcfContext: ComponentFramework.Context<any>;\n private _datasetControl: ITaskGridDatasetControl;\n private _strategy?: IGridCustomizerStrategy;\n\n constructor(parameters: IGridCustomizerParameters) {\n this._datasetControl = parameters.datasetControl;\n this._taskDataProvider = this._datasetControl.getDataProvider();\n this._gridApi = parameters.gridApi;\n this._localizationService = this._datasetControl.getLocalizationService();\n this._nativeColumns = this._datasetControl.getNativeColumns();\n this._strategy = parameters.strategy;\n this._pcfContext = this._datasetControl.getPcfContext();\n\n this._gridDragHandler = new GridDragHandler({\n gridApi: this._gridApi,\n datasetControl: this._datasetControl\n });\n this._patchGridApi();\n this._registerEventListeners();\n this._gridApi.setGridOption('rowClassRules', this._getRowClassRules());\n this._strategy?.onInitialize?.(this);\n }\n\n public getDatasetControl(): ITaskGridDatasetControl {\n return this._datasetControl;\n }\n\n public getGridApi(): GridApi<IRecord> {\n return this._gridApi;\n }\n\n public getTaskDataProvider(): ITaskDataProvider {\n return this._taskDataProvider;\n }\n\n //makes sure we do not try to register an expression for a column that does not exist\n public registerExpressionDecorator(columnName: string, registrator: () => void) {\n if (columnName && this._taskDataProvider.getColumnsMap()[columnName]) {\n registrator();\n }\n }\n\n private _patchGridApi() {\n const originalSetGridOption = this._gridApi.setGridOption.bind(this._gridApi);\n this._gridApi.setGridOption = (key: any, value: any): void => {\n switch (key) {\n case 'columnDefs': {\n const columnDefs = this._getColumnDefinitions(value);\n originalSetGridOption(key, columnDefs);\n break;\n }\n case 'isServerSideGroupOpenByDefault': {\n originalSetGridOption(key, (params: IsServerSideGroupOpenByDefaultParams) => this._isServerSideGroupOpenByDefault(params));\n break;\n }\n default: {\n originalSetGridOption(key, value);\n }\n }\n }\n }\n\n private _isServerSideGroupOpenByDefault(params: IsServerSideGroupOpenByDefaultParams) {\n if (!params.data) {\n return false;\n }\n const matchingRecords = this._taskDataProvider.getRecordTree().getMatchingRecords();\n return !matchingRecords[params.data.getRecordId()];\n }\n\n private _injectAddTaskColumn(columnDefs: ColDef<IRecord>[]) {\n if (!columnDefs.find(colDef => colDef.colId === ADD_TASK_COLUMN_NAME)) {\n columnDefs.push({\n colId: ADD_TASK_COLUMN_NAME,\n headerName: '',\n pinned: 'left',\n width: 50,\n resizable: false,\n lockPinned: true,\n lockPosition: true,\n suppressMovable: true,\n suppressSizeToFit: true,\n cellRenderer: AddTaskButton,\n headerComponent: TreeExpandCollapseHeader\n })\n }\n }\n\n private _getColumnDefinitions(columnDefs: ColDef<IRecord>[]) {\n this._injectAddTaskColumn(columnDefs);\n for (const colDef of columnDefs) {\n colDef.onCellDoubleClicked = () => { }\n const columnName = colDef.colId as string;\n switch (columnName) {\n case this._nativeColumns.subject: {\n colDef.cellRenderer = GroupCell;\n colDef.pinned = 'left';\n break;\n }\n case DatasetConstants.CHECKBOX_COLUMN_KEY: {\n colDef.lockPosition = true;\n break;\n }\n case this._nativeColumns.percentComplete: {\n colDef.cellRenderer = PercentComplete;\n break\n }\n }\n }\n\n columnDefs.sort((a, b) => this._getColumnPriority(a) - this._getColumnPriority(b));\n columnDefs = this._strategy?.onGetColumnDefinitions?.(columnDefs) ?? columnDefs;\n for (const colDef of columnDefs) {\n colDef.cellRenderer = this._strategy?.onGetCellRenderer?.(colDef) ?? colDef.cellRenderer;\n colDef.cellEditor = this._strategy?.onGetCellEditor?.(colDef) ?? colDef.cellEditor;\n }\n return columnDefs;\n\n }\n\n private _getColumnPriority(col: ColDef<IRecord>): number {\n if (col.colId === DatasetConstants.CHECKBOX_COLUMN_KEY) return 0;\n if (col.colId === ADD_TASK_COLUMN_NAME) return 1;\n if (col.field === this._nativeColumns.subject) return 2;\n return 3;\n }\n\n private _getRowClassRules(): RowClassRules<IRecord> {\n const rules: RowClassRules<IRecord> = {\n 'talxis_task-grid_row--drag-over-middle': (params) => {\n return !!params.data?.isActive() && this._getNodeDragOverSection(params.node) === 'middle'\n },\n 'talxis_task-grid_row--drag-over-top': (params) => {\n return this._getNodeDragOverSection(params.node) === 'top'\n },\n 'talxis_task-grid_row--drag-over-bottom': (params) => {\n return this._getNodeDragOverSection(params.node) === 'bottom'\n },\n 'talxis_task-grid_row--inactive': (params) => {\n return !params.data?.isActive()\n },\n 'talxis_task-grid_row--unmatched-parent': (params) => {\n if (params.data) {\n const matchingRecordsMap = this._taskDataProvider.getRecordTree().getMatchingRecords();\n return !matchingRecordsMap[params.data!.getRecordId()]\n }\n else {\n return false;\n }\n }\n }\n return this._strategy?.onGetRowClassRules?.(rules) ?? rules;\n }\n\n private _getPathToParent(node: IRowNode<IRecord> | null): string[] {\n const path: string[] = [];\n let parent = node?.parent;\n while (parent) {\n path.push(parent.id!);\n parent = parent.parent;\n }\n return path.filter(id => id).reverse();\n }\n\n //undefined means we should target top level\n private _onRecordTreeUpdated = (affectedIds: (string | undefined)[]) => {\n for (const id of affectedIds) {\n if (!id) {\n this._gridApi.refreshServerSide();\n }\n else {\n const node = this._gridApi.getRowNode(id)!;\n this._gridApi.refreshServerSide({\n route: this._getPathToParent(node)\n });\n this._gridApi.refreshServerSide({\n route: [...this._getPathToParent(node), id]\n })\n }\n }\n this._gridApi.refreshCells({\n columns: [this._nativeColumns.subject],\n force: true\n });\n this._taskDataProvider.requestRender();\n }\n\n private _getNodeDragOverSection(node: IRowNode<IRecord>): IDragOperation['dragOverSection'] | null {\n const pendingDragOperation = this._gridDragHandler.getPendingDragOperation();\n if (!pendingDragOperation) {\n return null;\n }\n else {\n const isCurrentNode = pendingDragOperation.overNode === node;\n const isDraggedNode = pendingDragOperation.draggedNode === pendingDragOperation.overNode;\n if (isCurrentNode && !isDraggedNode) {\n return pendingDragOperation.dragOverSection;\n }\n else {\n return null;\n }\n }\n }\n\n private async _onDragEnd(dragOperation: IDragOperation) {\n if (this._isDragOperationAllowed(dragOperation)) {\n this._moveTask(dragOperation);\n }\n }\n\n private _isDragOperationAllowed(dragOperation: IDragOperation): boolean {\n const { draggedNode, overNode } = dragOperation;\n // Check if either node is null/undefined\n if (!draggedNode || !overNode) {\n return false;\n }\n if (draggedNode === overNode) {\n return false;\n }\n if (!overNode.data?.isActive() && dragOperation.dragOverSection === 'middle') {\n return false;\n }\n\n let parent = overNode.parent;\n while (parent) {\n if (parent === draggedNode) {\n return false;\n }\n parent = parent.parent;\n }\n return true;\n }\n\n private _getPositionFromDragOverSection(dragOverSection: IDragOperation['dragOverSection']): 'above' | 'below' | 'child' {\n switch (dragOverSection) {\n case 'top': {\n return 'above';\n }\n case 'bottom': {\n return 'below';\n }\n case 'middle': {\n return 'child';\n }\n }\n }\n\n private async _moveTask(dragOperation: IDragOperation) {\n const { draggedNode, overNode, dragOverSection } = dragOperation;\n const position = this._getPositionFromDragOverSection(dragOverSection);\n this._taskDataProvider.moveTask(draggedNode.id!, overNode.id!, position);\n }\n\n private _moveInto(movingFromRecordId: string, movingToRecordId: string, position: 'child' | 'above' | 'below') {\n const draggedRecordNode = this._taskDataProvider.getRecordTree().getNode(movingFromRecordId);\n const draggedRecord = this._taskDataProvider.getRecordsMap()[movingFromRecordId];\n const draggedNode = this._gridApi.getRowNode(movingFromRecordId)!;\n const overNode = this._gridApi.getRowNode(movingToRecordId)!;\n\n let addIndex: number | null = draggedRecordNode.index;\n\n //first remove from old location\n this._gridApi.applyServerSideTransaction({\n route: this._getPathToParent(draggedNode),\n remove: [draggedRecord],\n });\n\n //update the store where dragged parent node is (so the arrow can disappear if needed)\n this._gridApi.applyServerSideTransaction({\n route: this._getPathToParent(draggedNode.parent),\n update: [draggedNode.data],\n });\n\n //update the store where over node is (so the arrow can appear if needed)\n this._gridApi.applyServerSideTransaction({\n route: this._getPathToParent(overNode),\n update: [overNode.data],\n });\n //then add to new location\n this._gridApi.applyServerSideTransaction({\n // i need to set route to parent of over node\n route: [...this._getPathToParent(overNode), ...(position === 'child' ? [overNode.id!] : [])],\n add: [draggedRecord],\n addIndex: addIndex !== null ? addIndex : undefined,\n });\n\n if (position === 'child') {\n overNode.setExpanded(true);\n }\n this._gridApi.refreshCells({\n columns: [this._nativeColumns.subject],\n force: true\n });\n this._taskDataProvider.clearSelectedRecordIds();\n }\n\n\n private _onAfterTasksCreated = (records: IRawRecord[] | null, parentId?: string) => {\n if (!records || records.length === 0) return;\n if (parentId) {\n const parentNode = this._gridApi.getRowNode(parentId);\n if (parentNode && !parentNode.expanded) {\n parentNode.setExpanded(true);\n }\n }\n if (!parentId) {\n this._gridApi.ensureIndexVisible(0);\n }\n }\n\n private _onAfterTaskDataUpdated = (newData: IRawRecord[]) => {\n const recordIdsSet = new Set(newData.map(item => item[this._taskDataProvider.getMetadata().PrimaryIdAttribute]));\n const nodes = this._gridApi.getRenderedNodes().filter(node => recordIdsSet.has(node.id!));\n this._gridApi.refreshCells({\n rowNodes: nodes,\n force: true\n })\n }\n\n private _registerEventListeners() {\n this._taskDataProvider.taskEvents.addEventListener('onAfterTaskMoved', (movingFromTaskId, movingToTaskId, position) => this._moveInto(movingFromTaskId, movingToTaskId, position));\n this._taskDataProvider.taskEvents.addEventListener('onAfterTasksCreated', (records, parentId) => this._onAfterTasksCreated(records, parentId));\n this._taskDataProvider.taskEvents.addEventListener('onRecordTreeUpdated', (updatedParentIds) => this._onRecordTreeUpdated(updatedParentIds));\n this._taskDataProvider.taskEvents.addEventListener('onTaskDataUpdated', (newData) => this._onAfterTaskDataUpdated(newData));\n this._gridDragHandler.addEventListener('onDragEnd', (dragOperation) => this._onDragEnd(dragOperation));\n }\n}"],"names":[],"mappings":";;;;;;;AAWO,MAAM,oBAAoB,GAAG,UAAU;MAwCjC,cAAc,CAAA;AAUvB,IAAA,WAAA,CAAY,UAAqC,EAAA;;AAiKzC,QAAA,IAAA,CAAA,oBAAoB,GAAG,CAAC,WAAmC,KAAI;AACnE,YAAA,KAAK,MAAM,EAAE,IAAI,WAAW,EAAE;gBAC1B,IAAI,CAAC,EAAE,EAAE;AACL,oBAAA,IAAI,CAAC,QAAQ,CAAC,iBAAiB,EAAE,CAAC;AACrC,iBAAA;AACI,qBAAA;oBACD,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAE,CAAC;AAC3C,oBAAA,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC;AAC5B,wBAAA,KAAK,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC;AACrC,qBAAA,CAAC,CAAC;AACH,oBAAA,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC;wBAC5B,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;AAC9C,qBAAA,CAAC,CAAA;AACL,iBAAA;AACJ,aAAA;AACD,YAAA,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC;AACvB,gBAAA,OAAO,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;AACtC,gBAAA,KAAK,EAAE,IAAI;AACd,aAAA,CAAC,CAAC;AACH,YAAA,IAAI,CAAC,iBAAiB,CAAC,aAAa,EAAE,CAAC;AAC3C,SAAC,CA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Q,CAAC,CAAC,CAAC;QAC/I,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,gBAAgB,CAAC,qBAAqB,EAAE,CAAC,gBAAgB,KAAK,IAAI,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAC,CAAC;QAC7I,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,gBAAgB,CAAC,mBAAmB,EAAE,CAAC,OAAO,KAAK,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC,CAAC;AAC5H,QAAA,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,aAAa,KAAK,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC;KAC1G;AACJ;;;;"}
|
|
1
|
+
{"version":3,"file":"GridCustomizer.js","sources":["../../../../../../src/components/TaskGrid/components/grid/grid-customizer/GridCustomizer.ts"],"sourcesContent":["import { ColDef as ColDefBase, GridApi as GridApiBase, IRowNode, IsServerSideGroupOpenByDefaultParams, RowClassRules as RowClassRulesBase } from \"@ag-grid-community/core\";\nimport { ITaskDataProvider } from \"../../../data-providers/task-data-provider\";\nimport { DatasetConstants, IRawRecord, IRecord } from \"@talxis/client-libraries\";\nimport { GridDragHandler, IDragOperation } from \"../grid-drag-handler\";\nimport { GroupCell } from \"../group-cell\";\nimport { TreeExpandCollapseHeader } from \"../cell-headers/tree-expand-collapse-header\";\nimport { AddTaskButton } from \"../cell-renderers/add-task-button\";\nimport { ILocalizationService, ITaskGridLabels } from \"../../../labels\";\nimport { PercentComplete } from \"../cell-renderers/percent-complete\";\nimport { INativeColumns, ITaskGridDatasetControl } from \"../../../interfaces\";\n\nexport const ADD_TASK_COLUMN_NAME = 'addTask';\n\nexport type ColDef = ColDefBase<IRecord>;\nexport type GridApi = GridApiBase<IRecord>;\nexport type RowClassRules = RowClassRulesBase<IRecord>;\n\n\n/** Strategy interface for deep customization of the AG Grid instance inside TaskGrid. */\nexport interface IGridCustomizerStrategy {\n /** Called once after the grid is ready. Use to call `customizer.registerExpressionDecorator` or perform other one-time setup. */\n onInitialize: (customizer: IGridCustomizer) => void;\n /** Receives the computed column definitions and may return a modified array. */\n onGetColumnDefinitions?: (columnDefs: ColDef[]) => ColDef[];\n /** Receives the default row class rules map and may return an extended or overridden version. */\n onGetRowClassRules?: (rules: RowClassRules) => RowClassRules;\n /** Return a custom cell renderer component for the given column definition, or `undefined` to use the default. */\n onGetCellRenderer?: (colDef: ColDef) => any;\n /** Return a custom cell editor component for the given column definition, or `undefined` to use the default. */\n onGetCellEditor?: (colDef: ColDef) => any;\n /** Receives the raw AG Grid `GridApi` instance, useful if the strategy needs to retain a reference. */\n onRetrieveGridApi?: (gridApi: GridApi) => void;\n}\n\n/** Provides access to the AG Grid instance and the TaskGrid control to code running inside `IGridCustomizerStrategy`. */\nexport interface IGridCustomizer {\n /** Returns the underlying AG Grid `GridApi`. */\n getGridApi(): GridApi;\n /** Returns the `ITaskDataProvider` that backs the grid data layer. */\n getTaskDataProvider(): ITaskDataProvider;\n /** Returns the `ITaskGridDatasetControl` runtime control interface. */\n getDatasetControl(): ITaskGridDatasetControl;\n /**\n * Registers a column-expression decorator only when the given column exists in the current columns map.\n * Prevents errors when registering decorators for columns that may not be present in all views.\n */\n registerExpressionDecorator(columnName: string, registrator: () => void): void;\n}\n\nexport interface IGridCustomizerParameters {\n gridApi: GridApi;\n datasetControl: ITaskGridDatasetControl;\n strategy?: IGridCustomizerStrategy;\n}\n\nexport class GridCustomizer implements IGridCustomizer {\n private _taskDataProvider: ITaskDataProvider;\n private _gridApi: GridApi;\n private _gridDragHandler: GridDragHandler;\n private _localizationService: ILocalizationService<ITaskGridLabels>;\n private _nativeColumns: INativeColumns;\n private _pcfContext: ComponentFramework.Context<any>;\n private _datasetControl: ITaskGridDatasetControl;\n private _strategy?: IGridCustomizerStrategy;\n\n constructor(parameters: IGridCustomizerParameters) {\n this._datasetControl = parameters.datasetControl;\n this._taskDataProvider = this._datasetControl.getDataProvider();\n this._gridApi = parameters.gridApi;\n this._localizationService = this._datasetControl.getLocalizationService();\n this._nativeColumns = this._datasetControl.getNativeColumns();\n this._strategy = parameters.strategy;\n this._pcfContext = this._datasetControl.getPcfContext();\n\n this._gridDragHandler = new GridDragHandler({\n gridApi: this._gridApi,\n datasetControl: this._datasetControl\n });\n this._patchGridApi();\n this._registerEventListeners();\n this._gridApi.setGridOption('rowClassRules', this._getRowClassRules());\n this._strategy?.onInitialize?.(this);\n }\n\n public getDatasetControl(): ITaskGridDatasetControl {\n return this._datasetControl;\n }\n\n public getGridApi(): GridApi {\n return this._gridApi;\n }\n\n public getTaskDataProvider(): ITaskDataProvider {\n return this._taskDataProvider;\n }\n\n //makes sure we do not try to register an expression for a column that does not exist\n public registerExpressionDecorator(columnName: string, registrator: () => void) {\n if (columnName && this._taskDataProvider.getColumnsMap()[columnName]) {\n registrator();\n }\n }\n\n private _patchGridApi() {\n const originalSetGridOption = this._gridApi.setGridOption.bind(this._gridApi);\n this._gridApi.setGridOption = (key: any, value: any): void => {\n switch (key) {\n case 'columnDefs': {\n const columnDefs = this._getColumnDefinitions(value);\n originalSetGridOption(key, columnDefs);\n break;\n }\n case 'isServerSideGroupOpenByDefault': {\n originalSetGridOption(key, (params: IsServerSideGroupOpenByDefaultParams) => this._isServerSideGroupOpenByDefault(params));\n break;\n }\n default: {\n originalSetGridOption(key, value);\n }\n }\n }\n }\n\n private _isServerSideGroupOpenByDefault(params: IsServerSideGroupOpenByDefaultParams) {\n if (!params.data) {\n return false;\n }\n const matchingRecords = this._taskDataProvider.getRecordTree().getMatchingRecords();\n return !matchingRecords[params.data.getRecordId()];\n }\n\n private _injectAddTaskColumn(columnDefs: ColDef[]) {\n if (!columnDefs.find(colDef => colDef.colId === ADD_TASK_COLUMN_NAME)) {\n columnDefs.push({\n colId: ADD_TASK_COLUMN_NAME,\n headerName: '',\n pinned: 'left',\n width: 50,\n resizable: false,\n lockPinned: true,\n lockPosition: true,\n suppressMovable: true,\n suppressSizeToFit: true,\n cellRenderer: AddTaskButton,\n headerComponent: TreeExpandCollapseHeader\n })\n }\n }\n\n private _getColumnDefinitions(columnDefs: ColDef[]) {\n this._injectAddTaskColumn(columnDefs);\n for (const colDef of columnDefs) {\n colDef.onCellDoubleClicked = () => { }\n const columnName = colDef.colId as string;\n switch (columnName) {\n case this._nativeColumns.subject: {\n colDef.cellRenderer = GroupCell;\n colDef.pinned = 'left';\n break;\n }\n case DatasetConstants.CHECKBOX_COLUMN_KEY: {\n colDef.lockPosition = true;\n break;\n }\n case this._nativeColumns.percentComplete: {\n colDef.cellRenderer = PercentComplete;\n break\n }\n }\n }\n\n columnDefs.sort((a, b) => this._getColumnPriority(a) - this._getColumnPriority(b));\n columnDefs = this._strategy?.onGetColumnDefinitions?.(columnDefs) ?? columnDefs;\n for (const colDef of columnDefs) {\n colDef.cellRenderer = this._strategy?.onGetCellRenderer?.(colDef) ?? colDef.cellRenderer;\n colDef.cellEditor = this._strategy?.onGetCellEditor?.(colDef) ?? colDef.cellEditor;\n }\n return columnDefs;\n\n }\n\n private _getColumnPriority(col: ColDef): number {\n if (col.colId === DatasetConstants.CHECKBOX_COLUMN_KEY) return 0;\n if (col.colId === ADD_TASK_COLUMN_NAME) return 1;\n if (col.field === this._nativeColumns.subject) return 2;\n return 3;\n }\n\n private _getRowClassRules(): RowClassRules {\n const rules: RowClassRules = {\n 'talxis_task-grid_row--drag-over-middle': (params) => {\n return !!params.data?.isActive() && this._getNodeDragOverSection(params.node) === 'middle'\n },\n 'talxis_task-grid_row--drag-over-top': (params) => {\n return this._getNodeDragOverSection(params.node) === 'top'\n },\n 'talxis_task-grid_row--drag-over-bottom': (params) => {\n return this._getNodeDragOverSection(params.node) === 'bottom'\n },\n 'talxis_task-grid_row--inactive': (params) => {\n return !params.data?.isActive()\n },\n 'talxis_task-grid_row--unmatched-parent': (params) => {\n if (params.data) {\n const matchingRecordsMap = this._taskDataProvider.getRecordTree().getMatchingRecords();\n return !matchingRecordsMap[params.data!.getRecordId()]\n }\n else {\n return false;\n }\n }\n }\n return this._strategy?.onGetRowClassRules?.(rules) ?? rules;\n }\n\n private _getPathToParent(node: IRowNode<IRecord> | null): string[] {\n const path: string[] = [];\n let parent = node?.parent;\n while (parent) {\n path.push(parent.id!);\n parent = parent.parent;\n }\n return path.filter(id => id).reverse();\n }\n\n //undefined means we should target top level\n private _onRecordTreeUpdated = (affectedIds: (string | undefined)[]) => {\n for (const id of affectedIds) {\n if (!id) {\n this._gridApi.refreshServerSide();\n }\n else {\n const node = this._gridApi.getRowNode(id)!;\n this._gridApi.refreshServerSide({\n route: this._getPathToParent(node)\n });\n this._gridApi.refreshServerSide({\n route: [...this._getPathToParent(node), id]\n })\n }\n }\n this._gridApi.refreshCells({\n columns: [this._nativeColumns.subject],\n force: true\n });\n this._taskDataProvider.requestRender();\n }\n\n private _getNodeDragOverSection(node: IRowNode<IRecord>): IDragOperation['dragOverSection'] | null {\n const pendingDragOperation = this._gridDragHandler.getPendingDragOperation();\n if (!pendingDragOperation) {\n return null;\n }\n else {\n const isCurrentNode = pendingDragOperation.overNode === node;\n const isDraggedNode = pendingDragOperation.draggedNode === pendingDragOperation.overNode;\n if (isCurrentNode && !isDraggedNode) {\n return pendingDragOperation.dragOverSection;\n }\n else {\n return null;\n }\n }\n }\n\n private async _onDragEnd(dragOperation: IDragOperation) {\n if (this._isDragOperationAllowed(dragOperation)) {\n this._moveTask(dragOperation);\n }\n }\n\n private _isDragOperationAllowed(dragOperation: IDragOperation): boolean {\n const { draggedNode, overNode } = dragOperation;\n // Check if either node is null/undefined\n if (!draggedNode || !overNode) {\n return false;\n }\n if (draggedNode === overNode) {\n return false;\n }\n if (!overNode.data?.isActive() && dragOperation.dragOverSection === 'middle') {\n return false;\n }\n\n let parent = overNode.parent;\n while (parent) {\n if (parent === draggedNode) {\n return false;\n }\n parent = parent.parent;\n }\n return true;\n }\n\n private _getPositionFromDragOverSection(dragOverSection: IDragOperation['dragOverSection']): 'above' | 'below' | 'child' {\n switch (dragOverSection) {\n case 'top': {\n return 'above';\n }\n case 'bottom': {\n return 'below';\n }\n case 'middle': {\n return 'child';\n }\n }\n }\n\n private async _moveTask(dragOperation: IDragOperation) {\n const { draggedNode, overNode, dragOverSection } = dragOperation;\n const position = this._getPositionFromDragOverSection(dragOverSection);\n this._taskDataProvider.moveTask(draggedNode.id!, overNode.id!, position);\n }\n\n private _moveInto(movingFromRecordId: string, movingToRecordId: string, position: 'child' | 'above' | 'below') {\n const draggedRecordNode = this._taskDataProvider.getRecordTree().getNode(movingFromRecordId);\n const draggedRecord = this._taskDataProvider.getRecordsMap()[movingFromRecordId];\n const draggedNode = this._gridApi.getRowNode(movingFromRecordId)!;\n const overNode = this._gridApi.getRowNode(movingToRecordId)!;\n\n let addIndex: number | null = draggedRecordNode.index;\n\n //first remove from old location\n this._gridApi.applyServerSideTransaction({\n route: this._getPathToParent(draggedNode),\n remove: [draggedRecord],\n });\n\n //update the store where dragged parent node is (so the arrow can disappear if needed)\n this._gridApi.applyServerSideTransaction({\n route: this._getPathToParent(draggedNode.parent),\n update: [draggedNode.data],\n });\n\n //update the store where over node is (so the arrow can appear if needed)\n this._gridApi.applyServerSideTransaction({\n route: this._getPathToParent(overNode),\n update: [overNode.data],\n });\n //then add to new location\n this._gridApi.applyServerSideTransaction({\n // i need to set route to parent of over node\n route: [...this._getPathToParent(overNode), ...(position === 'child' ? [overNode.id!] : [])],\n add: [draggedRecord],\n addIndex: addIndex !== null ? addIndex : undefined,\n });\n\n if (position === 'child') {\n overNode.setExpanded(true);\n }\n this._gridApi.refreshCells({\n columns: [this._nativeColumns.subject],\n force: true\n });\n this._taskDataProvider.clearSelectedRecordIds();\n }\n\n\n private _onAfterTasksCreated = (records: IRawRecord[] | null, parentId?: string) => {\n if (!records || records.length === 0) return;\n if (parentId) {\n const parentNode = this._gridApi.getRowNode(parentId);\n if (parentNode && !parentNode.expanded) {\n parentNode.setExpanded(true);\n }\n }\n if (!parentId) {\n this._gridApi.ensureIndexVisible(0);\n }\n }\n\n private _onAfterTaskDataUpdated = (newData: IRawRecord[]) => {\n const recordIdsSet = new Set(newData.map(item => item[this._taskDataProvider.getMetadata().PrimaryIdAttribute]));\n const nodes = this._gridApi.getRenderedNodes().filter(node => recordIdsSet.has(node.id!));\n this._gridApi.refreshCells({\n rowNodes: nodes,\n force: true\n })\n }\n\n private _registerEventListeners() {\n this._taskDataProvider.taskEvents.addEventListener('onAfterTaskMoved', (movingFromTaskId, movingToTaskId, position) => this._moveInto(movingFromTaskId, movingToTaskId, position));\n this._taskDataProvider.taskEvents.addEventListener('onAfterTasksCreated', (records, parentId) => this._onAfterTasksCreated(records, parentId));\n this._taskDataProvider.taskEvents.addEventListener('onRecordTreeUpdated', (updatedParentIds) => this._onRecordTreeUpdated(updatedParentIds));\n this._taskDataProvider.taskEvents.addEventListener('onTaskDataUpdated', (newData) => this._onAfterTaskDataUpdated(newData));\n this._gridDragHandler.addEventListener('onDragEnd', (dragOperation) => this._onDragEnd(dragOperation));\n }\n}"],"names":[],"mappings":";;;;;;;AAWO,MAAM,oBAAoB,GAAG,UAAU;MA4CjC,cAAc,CAAA;AAUvB,IAAA,WAAA,CAAY,UAAqC,EAAA;;AAiKzC,QAAA,IAAA,CAAA,oBAAoB,GAAG,CAAC,WAAmC,KAAI;AACnE,YAAA,KAAK,MAAM,EAAE,IAAI,WAAW,EAAE;gBAC1B,IAAI,CAAC,EAAE,EAAE;AACL,oBAAA,IAAI,CAAC,QAAQ,CAAC,iBAAiB,EAAE,CAAC;AACrC,iBAAA;AACI,qBAAA;oBACD,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAE,CAAC;AAC3C,oBAAA,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC;AAC5B,wBAAA,KAAK,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC;AACrC,qBAAA,CAAC,CAAC;AACH,oBAAA,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC;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AC;KACnD;IAyBO,uBAAuB,GAAA;AAC3B,QAAA,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,CAAC,gBAAgB,EAAE,cAAc,EAAE,QAAQ,KAAK,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE,cAAc,EAAE,QAAQ,CAAC,CAAC,CAAC;QACnL,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,gBAAgB,CAAC,qBAAqB,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,IAAI,CAAC,oBAAoB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;QAC/I,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,gBAAgB,CAAC,qBAAqB,EAAE,CAAC,gBAAgB,KAAK,IAAI,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAC,CAAC;QAC7I,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,gBAAgB,CAAC,mBAAmB,EAAE,CAAC,OAAO,KAAK,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC,CAAC;AAC5H,QAAA,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,aAAa,KAAK,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC;KAC1G;AACJ;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
7
7
|
import * as React$1 from 'react';
|
|
8
8
|
import React__default from 'react';
|
|
9
9
|
import { AgGridReactProps } from '@ag-grid-community/react';
|
|
10
|
-
import { ColDef
|
|
10
|
+
import { ColDef as ColDef$1, GridApi as GridApi$1, RowClassRules as RowClassRules$1 } from '@ag-grid-community/core';
|
|
11
11
|
|
|
12
12
|
type ExcludedProps = Pick<ComponentFramework.PropertyTypes.Property, 'formatted'>;
|
|
13
13
|
interface IProperty extends Omit<Partial<ComponentFramework.PropertyTypes.Property>, keyof ExcludedProps | 'attributes'> {
|
|
@@ -1599,25 +1599,28 @@ interface ITaskDataProvider extends IDataProvider {
|
|
|
1599
1599
|
moveTask(movingTaskId: string, movingToTaskId: string, position: 'above' | 'below' | 'child'): Promise<IRawRecord[] | null>;
|
|
1600
1600
|
}
|
|
1601
1601
|
|
|
1602
|
+
type ColDef = ColDef$1<IRecord>;
|
|
1603
|
+
type GridApi = GridApi$1<IRecord>;
|
|
1604
|
+
type RowClassRules = RowClassRules$1<IRecord>;
|
|
1602
1605
|
/** Strategy interface for deep customization of the AG Grid instance inside TaskGrid. */
|
|
1603
1606
|
interface IGridCustomizerStrategy {
|
|
1604
1607
|
/** Called once after the grid is ready. Use to call `customizer.registerExpressionDecorator` or perform other one-time setup. */
|
|
1605
1608
|
onInitialize: (customizer: IGridCustomizer) => void;
|
|
1606
1609
|
/** Receives the computed column definitions and may return a modified array. */
|
|
1607
|
-
onGetColumnDefinitions?: (columnDefs: ColDef
|
|
1610
|
+
onGetColumnDefinitions?: (columnDefs: ColDef[]) => ColDef[];
|
|
1608
1611
|
/** Receives the default row class rules map and may return an extended or overridden version. */
|
|
1609
|
-
onGetRowClassRules?: (rules: RowClassRules
|
|
1612
|
+
onGetRowClassRules?: (rules: RowClassRules) => RowClassRules;
|
|
1610
1613
|
/** Return a custom cell renderer component for the given column definition, or `undefined` to use the default. */
|
|
1611
|
-
onGetCellRenderer?: (colDef: ColDef
|
|
1614
|
+
onGetCellRenderer?: (colDef: ColDef) => any;
|
|
1612
1615
|
/** Return a custom cell editor component for the given column definition, or `undefined` to use the default. */
|
|
1613
|
-
onGetCellEditor?: (colDef: ColDef
|
|
1616
|
+
onGetCellEditor?: (colDef: ColDef) => any;
|
|
1614
1617
|
/** Receives the raw AG Grid `GridApi` instance, useful if the strategy needs to retain a reference. */
|
|
1615
|
-
onRetrieveGridApi?: (gridApi: GridApi
|
|
1618
|
+
onRetrieveGridApi?: (gridApi: GridApi) => void;
|
|
1616
1619
|
}
|
|
1617
1620
|
/** Provides access to the AG Grid instance and the TaskGrid control to code running inside `IGridCustomizerStrategy`. */
|
|
1618
1621
|
interface IGridCustomizer {
|
|
1619
1622
|
/** Returns the underlying AG Grid `GridApi`. */
|
|
1620
|
-
getGridApi(): GridApi
|
|
1623
|
+
getGridApi(): GridApi;
|
|
1621
1624
|
/** Returns the `ITaskDataProvider` that backs the grid data layer. */
|
|
1622
1625
|
getTaskDataProvider(): ITaskDataProvider;
|
|
1623
1626
|
/** Returns the `ITaskGridDatasetControl` runtime control interface. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VirtualDatasetAdapter.js","sources":["../../../../src/utils/dataset/adapters/VirtualDatasetAdapter.ts"],"sourcesContent":["import { mergeStyles } from \"@fluentui/react\";\nimport { Dataset, FetchXmlDataProvider, IColumn, IDataProvider, IDataset, Interceptors, IRawRecord, MemoryDataProvider } from \"@talxis/client-libraries\";\nimport { IDatasetControlParameters, IDatasetControlProps } from \"../../../components\";\nimport { DatasetControl, IDatasetControl } from \"../../dataset-control\";\n\ninterface IOutputs {\n DatasetControl?: any;\n}\n\ninterface IInputs {\n Data: ComponentFramework.PropertyTypes.StringProperty | {\n raw: IRawRecord[]\n }\n EntityMetadata: ComponentFramework.PropertyTypes.StringProperty;\n DataProvider: ComponentFramework.PropertyTypes.EnumProperty<\"Memory\" | \"FetchXml\">;\n EnableQuickFind?: ComponentFramework.PropertyTypes.EnumProperty<\"true\" | \"false\">;\n Columns?: ComponentFramework.PropertyTypes.StringProperty;\n Height?: ComponentFramework.PropertyTypes.StringProperty;\n RowHeight?: ComponentFramework.PropertyTypes.WholeNumberProperty;\n EnableEditing?: ComponentFramework.PropertyTypes.EnumProperty<\"true\" | \"false\">;\n EnablePagination?: ComponentFramework.PropertyTypes.EnumProperty<\"true\" | \"false\">;\n EnableFiltering?: ComponentFramework.PropertyTypes.EnumProperty<\"true\" | \"false\">;\n EnableSorting?: ComponentFramework.PropertyTypes.EnumProperty<\"true\" | \"false\">;\n EnableNavigation?: ComponentFramework.PropertyTypes.EnumProperty<\"true\" | \"false\">;\n EnableOptionSetColors?: ComponentFramework.PropertyTypes.EnumProperty<\"true\" | \"false\">;\n EnableAggregation?: ComponentFramework.PropertyTypes.EnumProperty<\"true\" | \"false\">;\n EnableGrouping?: ComponentFramework.PropertyTypes.EnumProperty<\"true\" | \"false\">;\n EnableEditColumns?: ComponentFramework.PropertyTypes.EnumProperty<\"true\" | \"false\">;\n EnableAutoSave?: ComponentFramework.PropertyTypes.EnumProperty<\"true\" | \"false\">;\n EnableCommandBar?: ComponentFramework.PropertyTypes.EnumProperty<\"true\" | \"false\">;\n EnableZebra?: ComponentFramework.PropertyTypes.EnumProperty<\"true\" | \"false\">;\n EnableGroupedColumnsPinning?: ComponentFramework.PropertyTypes.EnumProperty<\"true\" | \"false\">;\n EnablePageSizeSwitcher?: ComponentFramework.PropertyTypes.EnumProperty<\"true\" | \"false\">;\n EnableRecordCount?: ComponentFramework.PropertyTypes.EnumProperty<\"true\" | \"false\">;\n HomePageGridClientApiRibbonButtonId?: ComponentFramework.PropertyTypes.StringProperty;\n InlineRibbonButtonIds?: ComponentFramework.PropertyTypes.StringProperty;\n DefaultExpandedGroupLevel?: ComponentFramework.PropertyTypes.WholeNumberProperty;\n SelectableRows?: ComponentFramework.PropertyTypes.EnumProperty<\"none\" | \"single\" | \"multiple\">;\n GroupingType?: ComponentFramework.PropertyTypes.EnumProperty<\"nested\" | \"flat\">;\n IsLocalHarnessDebugMode?: ComponentFramework.PropertyTypes.EnumProperty<\"true\" | \"false\">;\n ClientApiWebresourceName?: ComponentFramework.PropertyTypes.StringProperty;\n ClientApiFunctionName?: ComponentFramework.PropertyTypes.StringProperty;\n}\n\ninterface IVirtualDatasetAdapterOptions {\n /**\n * Runs a promise that is awaited when the dataset control is initialized, before loading the first data.\n */\n onInitialize?: (dataset: IDataset) => Promise<void>;\n /**\n * If provided, this function is called when the dataset is initialized and awaited before loading first data.\n */\n CustomDataProviderClass?: new (...args: any) => IDataProvider;\n}\n\n\n/**\n * Helper class that holds boilerplate code for handling a virtual dataset in PCF, like syncing data, columns, and metadata from parameters.\n *\n */\nexport class VirtualDatasetAdapter {\n private _context!: ComponentFramework.Context<IInputs, IOutputs>;\n private _dataset!: Dataset<IDataProvider>;\n private _container!: HTMLDivElement;\n private _options?: IVirtualDatasetAdapterOptions\n private _initialized: boolean = false;\n private _state: ComponentFramework.Dictionary = {};\n private _datasetControl!: IDatasetControl;\n\n constructor(options?: IVirtualDatasetAdapterOptions) {\n this._options = options;\n }\n\n public init(context: ComponentFramework.Context<IInputs, IOutputs>, container: HTMLDivElement, state: ComponentFramework.Dictionary) {\n this._container = container;\n this._context = context;\n this._state = state ?? {};\n if (!context.parameters.Data.raw) {\n this._createDummyDatasetControl();\n return this;\n }\n const dataProvider = this._getDataProviderInstance();\n this._dataset = new Dataset(dataProvider);\n //loads parameter columns\n this._dataset.setMetadata(this._getEntityMetadata());\n this._dataset.setDataSource(context.parameters.Data.raw);\n this._datasetControl = new DatasetControl({\n state: this._state,\n //@ts-ignore - typings\n controlId: this._context.utils._customControlProperties?.controlId,\n onGetPcfContext: () => this._context,\n onGetParameters: () => this._getDatasetControlParameters()\n });\n this._datasetControl.setInterceptor('onInitialize', async (parameters, defaultAction) => {\n //preloads dataset\n await defaultAction(parameters);\n //sets columns after preload\n this._dataset.setColumns(this._getColumns());\n await this._options?.onInitialize?.(this.getDataset());\n });\n if (this._context.parameters.Height?.raw === '100%') {\n this._container.classList.add(this._getFullTabStyles());\n }\n this._initialized = true;\n }\n\n /**\n * @param {?() => void} [onRenderEmptyData] - Only called when the data parameter is set to `null`. This should usually not happen since it's a required parameter, but Power Apps can pass null in certain scenarios (for example on a form with new record).\n */\n public updateView(context: ComponentFramework.Context<IInputs, IOutputs>, onRenderComponent: (datasetControlProps: Omit<IDatasetControlProps, 'onGetControlComponent'>) => void, onRenderEmptyData?: () => void) {\n this._context = context;\n if (!context.parameters.Data.raw) {\n return onRenderEmptyData?.()\n }\n //if not yet initialized, initialize, can happen if we start without data\n if (!this._initialized) {\n this.init(context, this._container, this._state);\n }\n return onRenderComponent({\n onGetDatasetControlInstance: () => this._datasetControl\n });\n }\n\n public getDataset(): Dataset<IDataProvider> {\n return this._dataset;\n }\n\n public getDatasetControl(): IDatasetControl {\n return this._datasetControl;\n }\n\n private _isEditingEnabled(): boolean {\n return this._context.parameters.EnableEditing?.raw === 'true';\n }\n\n private _isAutoSaveEnabled(): boolean {\n return this._context.parameters.EnableAutoSave?.raw === 'true';\n }\n\n private _isCommandBarEnabled(): boolean {\n return this._context.parameters.EnableCommandBar?.raw !== 'false'\n }\n\n private _createDummyDatasetControl() {\n this._datasetControl = new DatasetControl({\n state: this._state,\n //@ts-ignore - typings\n controlId: this._context.utils._customControlProperties?.controlId,\n onGetPcfContext: () => this._context,\n onGetParameters: () => {\n return {\n ...this._getDatasetControlParameters(),\n Grid: new Dataset(new MemoryDataProvider({\n dataSource: [],\n metadata: {PrimaryIdAttribute: 'id'}\n }))\n }\n }\n });\n }\n\n private _getDatasetControlParameters(): IDatasetControlParameters {\n return {\n Grid: this.getDataset(),\n EnableEditing: {\n raw: this._isEditingEnabled()\n },\n EnableCommandBar: {\n raw: this._isCommandBarEnabled()\n },\n EnableAutoSave: {\n raw: this._isAutoSaveEnabled()\n },\n EnablePagination: {\n raw: this._context.parameters.EnablePagination?.raw !== 'false'\n },\n EnableFiltering: {\n raw: this._context.parameters.EnableFiltering?.raw !== 'false'\n },\n EnableSorting: {\n raw: this._context.parameters.EnableSorting?.raw !== 'false'\n },\n EnableNavigation: {\n raw: this._context.parameters.EnableNavigation?.raw !== 'false'\n },\n EnableOptionSetColors: {\n raw: this._context.parameters.EnableOptionSetColors?.raw === 'true'\n },\n SelectableRows: {\n raw: this._context.parameters.SelectableRows?.raw ?? 'single'\n },\n RowHeight: {\n raw: this._context.parameters.RowHeight?.raw ?? 42\n },\n //quick find is always handled by platform\n EnableQuickFind: {\n raw: this._context.parameters.EnableQuickFind?.raw === 'true'\n },\n EnableEditColumns: {\n raw: this._context.parameters.EnableEditColumns?.raw === 'true'\n },\n EnableAggregation: {\n raw: this._context.parameters.EnableAggregation?.raw === 'true',\n },\n EnableGrouping: {\n raw: this._context.parameters.EnableGrouping?.raw === 'true'\n },\n Height: {\n raw: this._context.parameters.Height?.raw ?? null\n },\n InlineRibbonButtonIds: {\n raw: this._context.parameters.InlineRibbonButtonIds?.raw ?? null\n },\n EnableZebra: {\n raw: this._context.parameters.EnableZebra?.raw !== 'false'\n },\n DefaultExpandedGroupLevel: {\n raw: this._context.parameters.DefaultExpandedGroupLevel?.raw ?? null\n },\n EnableRecordCount: {\n raw: this._context.parameters.EnableRecordCount?.raw !== 'false'\n },\n EnableGroupedColumnsPinning: {\n raw: this._context.parameters.EnableGroupedColumnsPinning?.raw !== 'false'\n },\n EnablePageSizeSwitcher: {\n raw: this._context.parameters.EnablePageSizeSwitcher?.raw !== 'false'\n },\n GroupingType: {\n raw: this._context.parameters.GroupingType?.raw ?? 'nested'\n },\n IsLocalHarnessDebugMode: this._context.parameters.IsLocalHarnessDebugMode,\n ClientApiWebresourceName: {\n raw: this._context.parameters.ClientApiWebresourceName?.raw ?? null\n },\n ClientApiFunctionName: {\n raw: this._context.parameters.ClientApiFunctionName?.raw ?? null\n }\n }\n }\n\n private _getDataProviderInstance(): IDataProvider {\n if (this._options?.CustomDataProviderClass) {\n return new this._options.CustomDataProviderClass(this._context.parameters.Data.raw);\n }\n switch (this._context.parameters.DataProvider.raw) {\n case \"FetchXml\": {\n return new FetchXmlDataProvider({\n fetchXml: this._context.parameters.Data.raw as string\n })\n }\n case 'Memory': {\n return new MemoryDataProvider({\n dataSource: this._context.parameters.Data.raw!,\n metadata: this._getEntityMetadata()\n\n });\n }\n }\n }\n\n private _getColumns() {\n try {\n const parameterColumns = this._context.parameters.Columns?.raw;\n const columns: IColumn[] = Array.isArray(parameterColumns) ? parameterColumns : JSON.parse(parameterColumns ?? \"[]\");\n return this._getMergedColumns(columns);\n }\n catch (err) {\n console.error(err);\n return this._dataset.columns;\n }\n }\n\n private _getMergedColumns(parameterColumns: IColumn[]): IColumn[] {\n const columnsMap = new Map<string, IColumn>(this._dataset.columns.map((col: IColumn) => [col.name, col]));\n const stateColumnsMap = new Map<string, IColumn>(this._state?.DatasetControlState?.columns?.map((col: IColumn) => [col.name, col]) ?? []);\n //if we have state, return it\n if (stateColumnsMap.size > 0) {\n return [...stateColumnsMap.values()];\n }\n //no state, save to load from parameters\n else {\n parameterColumns.forEach(parameterCol => {\n const col = columnsMap.get(parameterCol.name);\n if (col) {\n columnsMap.set(col.name, {\n ...col,\n ...parameterCol\n });\n } else {\n columnsMap.set(parameterCol.name, parameterCol);\n }\n });\n }\n return [...columnsMap.values()];\n }\n\n private _getEntityMetadata() {\n const parameterMetadata = this._context.parameters.EntityMetadata.raw;\n if (parameterMetadata) {\n return JSON.parse(parameterMetadata);\n }\n return {};\n }\n\n private _getFullTabStyles() {\n return mergeStyles({\n display: 'flex',\n flexDirection: 'column',\n flexGrow: 1\n });\n }\n}"],"names":[],"mappings":";;;;AAwDA;;;AAGG;MACU,qBAAqB,CAAA;AAS9B,IAAA,WAAA,CAAY,OAAuC,EAAA;QAJ3C,IAAY,CAAA,YAAA,GAAY,KAAK,CAAC;QAC9B,IAAM,CAAA,MAAA,GAAkC,EAAE,CAAC;AAI/C,QAAA,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;KAC3B;AAEM,IAAA,IAAI,CAAC,OAAsD,EAAE,SAAyB,EAAE,KAAoC,EAAA;AAC/H,QAAA,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;AAC5B,QAAA,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;AACxB,QAAA,IAAI,CAAC,MAAM,GAAG,KAAK,IAAI,EAAE,CAAC;QAC1B,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE;YAC9B,IAAI,CAAC,0BAA0B,EAAE,CA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E,CAAC,CAAC;;AAE1I,QAAA,IAAI,eAAe,CAAC,IAAI,GAAG,CAAC,EAAE;AAC1B,YAAA,OAAO,CAAC,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC;AACxC,SAAA;;AAEI,aAAA;AACD,YAAA,gBAAgB,CAAC,OAAO,CAAC,YAAY,IAAG;gBACpC,MAAM,GAAG,GAAG,UAAU,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;AAC9C,gBAAA,IAAI,GAAG,EAAE;AACL,oBAAA,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE;AACrB,wBAAA,GAAG,GAAG;AACN,wBAAA,GAAG,YAAY;AAClB,qBAAA,CAAC,CAAC;AACN,iBAAA;AAAM,qBAAA;oBACH,UAAU,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;AACnD,iBAAA;AACL,aAAC,CAAC,CAAC;AACN,SAAA;AACD,QAAA,OAAO,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC;KACnC;IAEO,kBAAkB,GAAA;QACtB,MAAM,iBAAiB,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,CAAC;AACtE,QAAA,IAAI,iBAAiB,EAAE;AACnB,YAAA,OAAO,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;AACxC,SAAA;AACD,QAAA,OAAO,EAAE,CAAC;KACb;IAEO,iBAAiB,GAAA;AACrB,QAAA,OAAO,WAAW,CAAC;AACf,YAAA,OAAO,EAAE,MAAM;AACf,YAAA,aAAa,EAAE,QAAQ;AACvB,YAAA,QAAQ,EAAE,CAAC;AACd,SAAA,CAAC,CAAC;KACN;AACJ;;;;"}
|
|
1
|
+
{"version":3,"file":"VirtualDatasetAdapter.js","sources":["../../../../src/utils/dataset/adapters/VirtualDatasetAdapter.ts"],"sourcesContent":["import { mergeStyles } from \"@fluentui/react\";\nimport { Dataset, FetchXmlDataProvider, IColumn, IDataProvider, IDataset, Interceptors, IRawRecord, MemoryDataProvider } from \"@talxis/client-libraries\";\nimport { IDatasetControlParameters, IDatasetControlProps } from \"../../../components\";\nimport { DatasetControl, IDatasetControl } from \"../../dataset-control\";\n\ninterface IOutputs {\n DatasetControl?: any;\n}\n\ninterface IInputs {\n Data: ComponentFramework.PropertyTypes.StringProperty | {\n raw: IRawRecord[]\n }\n EntityMetadata: ComponentFramework.PropertyTypes.StringProperty;\n DataProvider: ComponentFramework.PropertyTypes.EnumProperty<\"Memory\" | \"FetchXml\">;\n EnableQuickFind?: ComponentFramework.PropertyTypes.EnumProperty<\"true\" | \"false\">;\n Columns?: ComponentFramework.PropertyTypes.StringProperty;\n Height?: ComponentFramework.PropertyTypes.StringProperty;\n RowHeight?: ComponentFramework.PropertyTypes.WholeNumberProperty;\n EnableEditing?: ComponentFramework.PropertyTypes.EnumProperty<\"true\" | \"false\">;\n EnablePagination?: ComponentFramework.PropertyTypes.EnumProperty<\"true\" | \"false\">;\n EnableFiltering?: ComponentFramework.PropertyTypes.EnumProperty<\"true\" | \"false\">;\n EnableSorting?: ComponentFramework.PropertyTypes.EnumProperty<\"true\" | \"false\">;\n EnableNavigation?: ComponentFramework.PropertyTypes.EnumProperty<\"true\" | \"false\">;\n EnableOptionSetColors?: ComponentFramework.PropertyTypes.EnumProperty<\"true\" | \"false\">;\n EnableAggregation?: ComponentFramework.PropertyTypes.EnumProperty<\"true\" | \"false\">;\n EnableGrouping?: ComponentFramework.PropertyTypes.EnumProperty<\"true\" | \"false\">;\n EnableEditColumns?: ComponentFramework.PropertyTypes.EnumProperty<\"true\" | \"false\">;\n EnableAutoSave?: ComponentFramework.PropertyTypes.EnumProperty<\"true\" | \"false\">;\n EnableCommandBar?: ComponentFramework.PropertyTypes.EnumProperty<\"true\" | \"false\">;\n EnableZebra?: ComponentFramework.PropertyTypes.EnumProperty<\"true\" | \"false\">;\n EnableGroupedColumnsPinning?: ComponentFramework.PropertyTypes.EnumProperty<\"true\" | \"false\">;\n EnablePageSizeSwitcher?: ComponentFramework.PropertyTypes.EnumProperty<\"true\" | \"false\">;\n EnableRecordCount?: ComponentFramework.PropertyTypes.EnumProperty<\"true\" | \"false\">;\n HomePageGridClientApiRibbonButtonId?: ComponentFramework.PropertyTypes.StringProperty;\n InlineRibbonButtonIds?: ComponentFramework.PropertyTypes.StringProperty;\n DefaultExpandedGroupLevel?: ComponentFramework.PropertyTypes.WholeNumberProperty;\n SelectableRows?: ComponentFramework.PropertyTypes.EnumProperty<\"none\" | \"single\" | \"multiple\">;\n GroupingType?: ComponentFramework.PropertyTypes.EnumProperty<\"nested\" | \"flat\">;\n IsLocalHarnessDebugMode?: ComponentFramework.PropertyTypes.EnumProperty<\"true\" | \"false\">;\n ClientApiWebresourceName?: ComponentFramework.PropertyTypes.StringProperty;\n ClientApiFunctionName?: ComponentFramework.PropertyTypes.StringProperty;\n}\n\ninterface IVirtualDatasetAdapterOptions {\n /**\n * Runs a promise that is awaited when the dataset control is initialized, before loading the first data.\n */\n onInitialize?: (dataset: IDataset) => Promise<void>;\n /**\n * If provided, this function is called when the dataset is initialized and awaited before loading first data.\n */\n CustomDataProviderClass?: new (...args: any) => IDataProvider;\n}\n\n\n/**\n * Helper class that holds boilerplate code for handling a virtual dataset in PCF, like syncing data, columns, and metadata from parameters.\n *\n */\nexport class VirtualDatasetAdapter {\n private _context!: ComponentFramework.Context<IInputs, IOutputs>;\n private _dataset!: Dataset<IDataProvider>;\n private _container!: HTMLDivElement;\n private _options?: IVirtualDatasetAdapterOptions\n private _initialized: boolean = false;\n private _state: ComponentFramework.Dictionary = {};\n private _datasetControl!: IDatasetControl;\n\n constructor(options?: IVirtualDatasetAdapterOptions) {\n this._options = options;\n }\n\n public init(context: ComponentFramework.Context<IInputs, IOutputs>, container: HTMLDivElement, state: ComponentFramework.Dictionary) {\n this._container = container;\n this._context = context;\n this._state = state ?? {};\n if (!context.parameters.Data.raw) {\n this._createDummyDatasetControl();\n return this;\n }\n const dataProvider = this._getDataProviderInstance();\n this._dataset = new Dataset(dataProvider);\n //loads parameter columns\n this._dataset.setMetadata(this._getEntityMetadata());\n this._dataset.setDataSource(context.parameters.Data.raw);\n this._datasetControl = new DatasetControl({\n state: this._state,\n //@ts-ignore - typings\n controlId: this._context.utils._customControlProperties?.controlId,\n onGetPcfContext: () => this._context,\n onGetParameters: () => this._getDatasetControlParameters()\n });\n this._datasetControl.setInterceptor('onInitialize', async (parameters, defaultAction) => {\n //preloads dataset\n await defaultAction(parameters);\n //sets columns after preload\n this._dataset.setColumns(this._getColumns());\n await this._options?.onInitialize?.(this.getDataset());\n });\n if (this._context.parameters.Height?.raw === '100%') {\n this._container.classList.add(this._getFullTabStyles());\n }\n this._initialized = true;\n }\n\n /**\n * @param {?() => void} [onRenderEmptyData] - Only called when the data parameter is set to `null`. This should usually not happen since it's a required parameter, but Power Apps can pass null in certain scenarios (for example on a form with new record).\n */\n public updateView(context: ComponentFramework.Context<IInputs, IOutputs>, onRenderComponent: (datasetControlProps: Omit<IDatasetControlProps, 'onGetControlComponent'>) => void, onRenderEmptyData?: () => void) {\n this._context = context;\n if (!context.parameters.Data.raw) {\n return onRenderEmptyData?.()\n }\n //if not yet initialized, initialize, can happen if we start without data\n if (!this._initialized) {\n this.init(context, this._container, this._state);\n }\n return onRenderComponent({\n onGetDatasetControlInstance: () => this._datasetControl\n });\n }\n\n public getDataset(): Dataset<IDataProvider> {\n return this._dataset;\n }\n\n public getDatasetControl(): IDatasetControl {\n return this._datasetControl;\n }\n\n private _isEditingEnabled(): boolean {\n return this._context.parameters.EnableEditing?.raw === 'true';\n }\n\n private _isAutoSaveEnabled(): boolean {\n return this._context.parameters.EnableAutoSave?.raw === 'true';\n }\n\n private _isCommandBarEnabled(): boolean {\n return this._context.parameters.EnableCommandBar?.raw !== 'false'\n }\n\n private _createDummyDatasetControl() {\n this._datasetControl = new DatasetControl({\n state: this._state,\n //@ts-ignore - typings\n controlId: this._context.utils._customControlProperties?.controlId,\n onGetPcfContext: () => this._context,\n onGetParameters: () => {\n return {\n ...this._getDatasetControlParameters(),\n Grid: new Dataset(new MemoryDataProvider({\n dataSource: [],\n metadata: {PrimaryIdAttribute: 'id'}\n }))\n }\n }\n });\n }\n\n private _getDatasetControlParameters(): IDatasetControlParameters {\n return {\n Grid: this.getDataset(),\n EnableEditing: {\n raw: this._isEditingEnabled()\n },\n EnableCommandBar: {\n raw: this._isCommandBarEnabled()\n },\n EnableAutoSave: {\n raw: this._isAutoSaveEnabled()\n },\n EnablePagination: {\n raw: this._context.parameters.EnablePagination?.raw !== 'false'\n },\n EnableFiltering: {\n raw: this._context.parameters.EnableFiltering?.raw !== 'false'\n },\n EnableSorting: {\n raw: this._context.parameters.EnableSorting?.raw !== 'false'\n },\n EnableNavigation: {\n raw: this._context.parameters.EnableNavigation?.raw !== 'false'\n },\n EnableOptionSetColors: {\n raw: this._context.parameters.EnableOptionSetColors?.raw === 'true'\n },\n SelectableRows: {\n raw: this._context.parameters.SelectableRows?.raw ?? 'single'\n },\n RowHeight: {\n raw: this._context.parameters.RowHeight?.raw ?? 42\n },\n //quick find is always handled by platform\n EnableQuickFind: {\n raw: this._context.parameters.EnableQuickFind?.raw === 'true'\n },\n EnableEditColumns: {\n raw: this._context.parameters.EnableEditColumns?.raw === 'true'\n },\n EnableAggregation: {\n raw: this._context.parameters.EnableAggregation?.raw === 'true',\n },\n EnableGrouping: {\n raw: this._context.parameters.EnableGrouping?.raw === 'true'\n },\n Height: {\n raw: this._context.parameters.Height?.raw ?? null\n },\n InlineRibbonButtonIds: {\n raw: this._context.parameters.InlineRibbonButtonIds?.raw ?? null\n },\n EnableZebra: {\n raw: this._context.parameters.EnableZebra?.raw !== 'false'\n },\n DefaultExpandedGroupLevel: {\n raw: this._context.parameters.DefaultExpandedGroupLevel?.raw ?? null\n },\n EnableRecordCount: {\n raw: this._context.parameters.EnableRecordCount?.raw !== 'false'\n },\n EnableGroupedColumnsPinning: {\n raw: this._context.parameters.EnableGroupedColumnsPinning?.raw !== 'false'\n },\n EnablePageSizeSwitcher: {\n raw: this._context.parameters.EnablePageSizeSwitcher?.raw !== 'false'\n },\n GroupingType: {\n raw: this._context.parameters.GroupingType?.raw ?? 'nested'\n },\n IsLocalHarnessDebugMode: this._context.parameters.IsLocalHarnessDebugMode,\n ClientApiWebresourceName: {\n raw: this._context.parameters.ClientApiWebresourceName?.raw ?? null\n },\n ClientApiFunctionName: {\n raw: this._context.parameters.ClientApiFunctionName?.raw ?? null\n }\n }\n }\n\n private _getDataProviderInstance(): IDataProvider {\n if (this._options?.CustomDataProviderClass) {\n return new this._options.CustomDataProviderClass(this._context.parameters.Data.raw);\n }\n switch (this._context.parameters.DataProvider.raw) {\n case \"FetchXml\": {\n return new FetchXmlDataProvider({\n fetchXml: this._context.parameters.Data.raw as string\n })\n }\n case 'Memory': {\n return new MemoryDataProvider({\n dataSource: this._context.parameters.Data.raw!,\n metadata: this._getEntityMetadata()\n });\n }\n }\n }\n\n private _getColumns() {\n try {\n const parameterColumns = this._context.parameters.Columns?.raw;\n const columns: IColumn[] = Array.isArray(parameterColumns) ? parameterColumns : JSON.parse(parameterColumns ?? \"[]\");\n return this._getMergedColumns(columns);\n }\n catch (err) {\n console.error(err);\n return this._dataset.columns;\n }\n }\n\n private _getMergedColumns(parameterColumns: IColumn[]): IColumn[] {\n const columnsMap = new Map<string, IColumn>(this._dataset.columns.map((col: IColumn) => [col.name, col]));\n const stateColumnsMap = new Map<string, IColumn>(this._state?.DatasetControlState?.columns?.map((col: IColumn) => [col.name, col]) ?? []);\n //if we have state, return it\n if (stateColumnsMap.size > 0) {\n return [...stateColumnsMap.values()];\n }\n //no state, save to load from parameters\n else {\n parameterColumns.forEach(parameterCol => {\n const col = columnsMap.get(parameterCol.name);\n if (col) {\n columnsMap.set(col.name, {\n ...col,\n ...parameterCol\n });\n } else {\n columnsMap.set(parameterCol.name, parameterCol);\n }\n });\n }\n return [...columnsMap.values()];\n }\n\n private _getEntityMetadata() {\n const parameterMetadata = this._context.parameters.EntityMetadata.raw;\n if (parameterMetadata) {\n return JSON.parse(parameterMetadata);\n }\n return {};\n }\n\n private _getFullTabStyles() {\n return mergeStyles({\n display: 'flex',\n flexDirection: 'column',\n flexGrow: 1\n });\n }\n}"],"names":[],"mappings":";;;;AAwDA;;;AAGG;MACU,qBAAqB,CAAA;AAS9B,IAAA,WAAA,CAAY,OAAuC,EAAA;QAJ3C,IAAY,CAAA,YAAA,GAAY,KAAK,CAAC;QAC9B,IAAM,CAAA,MAAA,GAAkC,EAAE,CAAC;AAI/C,QAAA,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;KAC3B;AAEM,IAAA,IAAI,CAAC,OAAsD,EAAE,SAAyB,EAAE,KAAoC,EAAA;AAC/H,QAAA,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;AAC5B,QAAA,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;AACxB,QAAA,IAAI,CAAC,MAAM,GAAG,KAAK,IAAI,EAAE,CAAC;QAC1B,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE;YAC9B,IAAI,CAAC,0BAA0B,EAAE,CAAC;AAClC,YAAA,OAAO,IAAI,CAAC;AACf,SAAA;AACD,QAAA,MAAM,YAAY,GAAG,IAAI,CAAC,wBAAwB,EAAE,CAAC;QACrD,IAAI,CAAC,QAAQ,GAAG,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC;;QAE1C,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,kBAAkB,EAAE,CAAC,CAAC;AACrD,QAAA,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzD,QAAA,IAAI,CAAC,eAAe,GAAG,IAAI,cAAc,CAAC;YACtC,KAAK,EAAE,IAAI,CAAC,MAAM;;YAElB,SAAS,EAAE,IAAI,CAAC,QAAQ,CA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AU,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;AACnD,iBAAA;AACL,aAAC,CAAC,CAAC;AACN,SAAA;AACD,QAAA,OAAO,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC;KACnC;IAEO,kBAAkB,GAAA;QACtB,MAAM,iBAAiB,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,CAAC;AACtE,QAAA,IAAI,iBAAiB,EAAE;AACnB,YAAA,OAAO,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;AACxC,SAAA;AACD,QAAA,OAAO,EAAE,CAAC;KACb;IAEO,iBAAiB,GAAA;AACrB,QAAA,OAAO,WAAW,CAAC;AACf,YAAA,OAAO,EAAE,MAAM;AACf,YAAA,aAAa,EAAE,QAAQ;AACvB,YAAA,QAAQ,EAAE,CAAC;AACd,SAAA,CAAC,CAAC;KACN;AACJ;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@talxis/base-controls",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2605.1",
|
|
4
4
|
"description": "Set of React components that natively work with Power Apps Component Framework APIs.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -71,10 +71,10 @@
|
|
|
71
71
|
]
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
|
-
"@ag-grid-community/client-side-row-model": "
|
|
75
|
-
"@ag-grid-community/core": "
|
|
76
|
-
"@ag-grid-community/react": "
|
|
77
|
-
"@ag-grid-community/styles": "
|
|
74
|
+
"@ag-grid-community/client-side-row-model": "31.3.2",
|
|
75
|
+
"@ag-grid-community/core": "31.3.2",
|
|
76
|
+
"@ag-grid-community/react": "31.3.2",
|
|
77
|
+
"@ag-grid-community/styles": "31.3.2",
|
|
78
78
|
"@ag-grid-enterprise/clipboard": "31.3.2",
|
|
79
79
|
"@ag-grid-enterprise/core": "31.3.2",
|
|
80
80
|
"@ag-grid-enterprise/row-grouping": "31.3.2",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"@dnd-kit/sortable": "^10.0.0",
|
|
85
85
|
"@dnd-kit/utilities": "^3.2.2",
|
|
86
86
|
"@fluentui/react-migration-v8-v9": "^9.6.20",
|
|
87
|
-
"@talxis/client-libraries": "1.
|
|
87
|
+
"@talxis/client-libraries": "1.2605.1",
|
|
88
88
|
"@talxis/client-metadata": "^0.0.3",
|
|
89
89
|
"color": "^4.2.3",
|
|
90
90
|
"dayjs": "^1.11.10",
|