@talxis/base-controls 1.2512.2 → 1.2512.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts
CHANGED
|
@@ -1338,6 +1338,8 @@ interface IInputs {
|
|
|
1338
1338
|
SelectableRows?: ComponentFramework.PropertyTypes.EnumProperty<"none" | "single" | "multiple">;
|
|
1339
1339
|
GroupingType?: ComponentFramework.PropertyTypes.EnumProperty<"nested" | "flat">;
|
|
1340
1340
|
IsLocalHarnessDebugMode?: ComponentFramework.PropertyTypes.EnumProperty<"true" | "false">;
|
|
1341
|
+
ClientApiWebresourceName?: ComponentFramework.PropertyTypes.StringProperty;
|
|
1342
|
+
ClientApiFunctionName?: ComponentFramework.PropertyTypes.StringProperty;
|
|
1341
1343
|
}
|
|
1342
1344
|
interface IVirtualDatasetAdapterOptions {
|
|
1343
1345
|
/**
|
|
@@ -35,6 +35,8 @@ interface IInputs {
|
|
|
35
35
|
SelectableRows?: ComponentFramework.PropertyTypes.EnumProperty<"none" | "single" | "multiple">;
|
|
36
36
|
GroupingType?: ComponentFramework.PropertyTypes.EnumProperty<"nested" | "flat">;
|
|
37
37
|
IsLocalHarnessDebugMode?: ComponentFramework.PropertyTypes.EnumProperty<"true" | "false">;
|
|
38
|
+
ClientApiWebresourceName?: ComponentFramework.PropertyTypes.StringProperty;
|
|
39
|
+
ClientApiFunctionName?: ComponentFramework.PropertyTypes.StringProperty;
|
|
38
40
|
}
|
|
39
41
|
interface IVirtualDatasetAdapterOptions {
|
|
40
42
|
/**
|
|
@@ -158,10 +158,10 @@ class VirtualDatasetAdapter {
|
|
|
158
158
|
},
|
|
159
159
|
IsLocalHarnessDebugMode: this._context.parameters.IsLocalHarnessDebugMode,
|
|
160
160
|
ClientApiWebresourceName: {
|
|
161
|
-
raw:
|
|
161
|
+
raw: this._context.parameters.ClientApiWebresourceName?.raw ?? null
|
|
162
162
|
},
|
|
163
163
|
ClientApiFunctionName: {
|
|
164
|
-
raw:
|
|
164
|
+
raw: this._context.parameters.ClientApiFunctionName?.raw ?? null
|
|
165
165
|
}
|
|
166
166
|
};
|
|
167
167
|
}
|
|
@@ -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, 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 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}\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?: () => 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?.();\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([], { PrimaryIdAttribute: 'id' }))\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 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: 'talxis_gridclientapidemo'\n },\n ClientApiFunctionName: {\n raw: 'onDatasetControlInitialized'\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(this._context.parameters.Data.raw as string)\n }\n case 'Memory': {\n return new MemoryDataProvider(this._context.parameters.Data.raw!, this._getEntityMetadata())\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":";;;;AAqDA;;;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,CAAC,KAAK,CAAC,wBAAwB,EAAE,SAAS;AAClE,YAAA,eAA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AAA;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, 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 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?: () => 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?.();\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([], { PrimaryIdAttribute: 'id' }))\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 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(this._context.parameters.Data.raw as string)\n }\n case 'Memory': {\n return new MemoryDataProvider(this._context.parameters.Data.raw!, this._getEntityMetadata())\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":";;;;AAuDA;;;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,eA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