@slickgrid-universal/react-row-detail-plugin 10.0.0-beta.0 → 10.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,14 +1,7 @@
1
1
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
2
2
  [![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)
3
- [![lerna--lite](https://img.shields.io/badge/maintained%20with-lerna--lite-e137ff)](https://github.com/ghiscoding/lerna-lite)
4
- [![npm](https://img.shields.io/npm/v/@slickgrid-universal/react-row-detail-plugin.svg)](https://www.npmjs.com/package/@slickgrid-universal/react-row-detail-plugin)
5
- [![npm](https://img.shields.io/npm/dy/@slickgrid-universal/react-row-detail-plugin)](https://www.npmjs.com/package/@slickgrid-universal/react-row-detail-plugin)
6
- [![npm bundle size](https://img.shields.io/bundlephobia/minzip/@slickgrid-universal/react-row-detail-plugin?color=success&label=gzip)](https://bundlephobia.com/result?p=@slickgrid-universal/react-row-detail-plugin)
7
-
8
- [![Actions Status](https://github.com/ghiscoding/slickgrid-universal/workflows/CI%20Build/badge.svg)](https://github.com/ghiscoding/slickgrid-universal/actions)
9
- [![Cypress.io](https://img.shields.io/badge/tested%20with-Cypress-04C38E.svg)](https://www.cypress.io/)
10
- [![Vitest](https://img.shields.io/badge/tested%20with-vitest-fcc72b.svg?logo=vitest)](https://vitest.dev/)
11
- [![codecov](https://codecov.io/gh/ghiscoding/slickgrid-universal/branch/master/graph/badge.svg)](https://codecov.io/gh/ghiscoding/slickgrid-universal)
3
+ [![NPM downloads](https://img.shields.io/npm/dy/@slickgrid-universal/react-row-detail-plugin)](https://npmjs.org/package/@slickgrid-universal/react-row-detail-plugin)
4
+ [![npm](https://img.shields.io/npm/v/@slickgrid-universal/react-row-detail-plugin.svg?logo=npm&logoColor=fff&label=npm)](https://www.npmjs.com/package/@slickgrid-universal/react-row-detail-plugin)
12
5
 
13
6
  ## Slickgrid-React Row Detail plugin
14
7
  #### @slickgrid-universal/react-row-detail-plugin
package/dist/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from './reactSlickRowDetailView.js';
1
+ export * from './reactRowDetailView.js';
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export * from './reactSlickRowDetailView.js';
1
+ export * from './reactRowDetailView.js';
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC","sourcesContent":["export * from './reactSlickRowDetailView.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC","sourcesContent":["export * from './reactRowDetailView.js';\n"]}
@@ -10,9 +10,9 @@ export interface CreatedView {
10
10
  root: Root | null;
11
11
  rendered?: boolean;
12
12
  }
13
- export declare class ReactSlickRowDetailView extends UniversalSlickRowDetailView {
13
+ export declare class ReactRowDetailView extends UniversalSlickRowDetailView {
14
14
  private readonly eventPubSubService;
15
- static readonly pluginName = "ReactSlickRowDetailView";
15
+ static readonly pluginName = "ReactRowDetailView";
16
16
  protected _component?: any;
17
17
  protected _preloadComponent?: any;
18
18
  protected _preloadRoot?: Root;
@@ -20,6 +20,7 @@ export declare class ReactSlickRowDetailView extends UniversalSlickRowDetailView
20
20
  protected _subscriptions: EventSubscription[];
21
21
  protected _userProcessFn?: (item: any) => Promise<any>;
22
22
  protected gridContainerElement: HTMLElement;
23
+ protected _timer?: any;
23
24
  _root?: Root;
24
25
  constructor(eventPubSubService: EventPubSubService);
25
26
  get addonOptions(): import("slickgrid-react").RowDetailViewOption;
@@ -31,7 +32,7 @@ export declare class ReactSlickRowDetailView extends UniversalSlickRowDetailView
31
32
  /** Dispose of all the opened Row Detail Panels Components */
32
33
  disposeAllViewComponents(): void;
33
34
  /** Get the instance of the SlickGrid addon (control or plugin). */
34
- getAddonInstance(): ReactSlickRowDetailView | null;
35
+ getAddonInstance(): ReactRowDetailView | null;
35
36
  init(grid: SlickGrid): void;
36
37
  /**
37
38
  * Create the plugin before the Grid creation, else it will behave oddly.
@@ -3,9 +3,9 @@ import { SlickRowDetailView as UniversalSlickRowDetailView } from '@slickgrid-un
3
3
  import { createReactComponentDynamically } from 'slickgrid-react';
4
4
  const ROW_DETAIL_CONTAINER_PREFIX = 'container_';
5
5
  const PRELOAD_CONTAINER_PREFIX = 'container_loading';
6
- export class ReactSlickRowDetailView extends UniversalSlickRowDetailView {
6
+ export class ReactRowDetailView extends UniversalSlickRowDetailView {
7
7
  eventPubSubService;
8
- static pluginName = 'ReactSlickRowDetailView';
8
+ static pluginName = 'ReactRowDetailView';
9
9
  _component;
10
10
  _preloadComponent;
11
11
  _preloadRoot;
@@ -13,6 +13,7 @@ export class ReactSlickRowDetailView extends UniversalSlickRowDetailView {
13
13
  _subscriptions = [];
14
14
  _userProcessFn;
15
15
  gridContainerElement;
16
+ _timer;
16
17
  _root;
17
18
  constructor(eventPubSubService) {
18
19
  super(eventPubSubService);
@@ -32,6 +33,7 @@ export class ReactSlickRowDetailView extends UniversalSlickRowDetailView {
32
33
  }
33
34
  /** Dispose of the RowDetailView Extension */
34
35
  dispose() {
36
+ clearTimeout(this._timer);
35
37
  this.disposeAllViewComponents();
36
38
  unsubscribeAll(this._subscriptions);
37
39
  super.dispose();
@@ -169,7 +171,8 @@ export class ReactSlickRowDetailView extends UniversalSlickRowDetailView {
169
171
  }
170
172
  /** Redraw (re-render) all the expanded row detail View Components */
171
173
  async redrawAllViewComponents(forceRedraw = false) {
172
- setTimeout(() => {
174
+ clearTimeout(this._timer);
175
+ this._timer = setTimeout(() => {
173
176
  this.resetRenderedRows();
174
177
  this._views.forEach((view) => {
175
178
  if (!view.rendered || forceRedraw) {
@@ -332,4 +335,4 @@ export class ReactSlickRowDetailView extends UniversalSlickRowDetailView {
332
335
  }
333
336
  }
334
337
  }
335
- //# sourceMappingURL=reactSlickRowDetailView.js.map
338
+ //# sourceMappingURL=reactRowDetailView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reactRowDetailView.js","sourceRoot":"","sources":["../src/reactRowDetailView.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,cAAc,EACd,yBAAyB,EACzB,cAAc,GAMf,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,kBAAkB,IAAI,2BAA2B,EAAE,MAAM,6CAA6C,CAAC;AAEhH,OAAO,EAAE,+BAA+B,EAAoD,MAAM,iBAAiB,CAAC;AAGpH,MAAM,2BAA2B,GAAG,YAAY,CAAC;AACjD,MAAM,wBAAwB,GAAG,mBAAmB,CAAC;AASrD,MAAM,OAAO,kBAAmB,SAAQ,2BAA2B;IAYpC;IAX7B,MAAM,CAAU,UAAU,GAAG,oBAAoB,CAAC;IACxC,UAAU,CAAO;IACjB,iBAAiB,CAAO;IACxB,YAAY,CAAQ;IACpB,MAAM,GAAkB,EAAE,CAAC;IAC3B,cAAc,GAAwB,EAAE,CAAC;IACzC,cAAc,CAA+B;IAC7C,oBAAoB,CAAe;IACnC,MAAM,CAAO;IACvB,KAAK,CAAQ;IAEb,YAA6B,kBAAsC;QACjE,KAAK,CAAC,kBAAkB,CAAC,CAAC;QADC,uBAAkB,GAAlB,kBAAkB,CAAoB;IAEnE,CAAC;IAED,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;IAC3B,CAAC;IAED,IAAc,iBAAiB;QAC7B,OAAO,IAAI,CAAC,WAAW,CAAC,qBAAqB,IAAI,IAAI,CAAC;IACxD,CAAC;IAED,IAAI,WAAW;QACb,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,CAAe,CAAC;IACxD,CAAC;IAED,IAAI,oBAAoB;QACtB,OAAO,IA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,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,aAAa;YAC7D,CAAC;iBAAM,IAAI,QAAQ,IAAI,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;gBAC3C,iBAAiB,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,mBAAmB;YAC9D,CAAC;YAED,IAAI,CAAC,iBAAiB,IAAI,CAAC,iBAAiB,CAAC,cAAc,CAAC,IAAI,CAAC,iBAAiB,CAAC,EAAE,CAAC;gBACpF,MAAM,IAAI,KAAK,CACb,oGAAoG;oBAClG,uCAAuC,IAAI,CAAC,iBAAiB,YAAY,CAC5E,CAAC;YACJ,CAAC;YAED,8CAA8C;YAC9C,IAAI,CAAC,cAAc,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC","sourcesContent":["import {\n addToArrayWhenNotExists,\n createDomElement,\n SlickEventData,\n SlickHybridSelectionModel,\n unsubscribeAll,\n type EventSubscription,\n type OnBeforeRowDetailToggleArgs,\n type OnRowBackOrOutOfViewportRangeArgs,\n type SelectionModel,\n type SlickGrid,\n} from '@slickgrid-universal/common';\nimport { type EventPubSubService } from '@slickgrid-universal/event-pub-sub';\nimport { SlickRowDetailView as UniversalSlickRowDetailView } from '@slickgrid-universal/row-detail-view-plugin';\nimport type { Root } from 'react-dom/client';\nimport { createReactComponentDynamically, type GridOption, type ViewModelBindableInputData } from 'slickgrid-react';\nimport type { RowDetailView } from './interfaces';\n\nconst ROW_DETAIL_CONTAINER_PREFIX = 'container_';\nconst PRELOAD_CONTAINER_PREFIX = 'container_loading';\n\nexport interface CreatedView {\n id: string | number;\n dataContext: any;\n root: Root | null;\n rendered?: boolean;\n}\n\nexport class ReactRowDetailView extends UniversalSlickRowDetailView {\n static readonly pluginName = 'ReactRowDetailView';\n protected _component?: any;\n protected _preloadComponent?: any;\n protected _preloadRoot?: Root;\n protected _views: CreatedView[] = [];\n protected _subscriptions: EventSubscription[] = [];\n protected _userProcessFn?: (item: any) => Promise<any>;\n protected gridContainerElement!: HTMLElement;\n protected _timer?: any;\n _root?: Root;\n\n constructor(private readonly eventPubSubService: EventPubSubService) {\n super(eventPubSubService);\n }\n\n get addonOptions() {\n return this.getOptions();\n }\n\n protected get datasetIdPropName(): string {\n return this.gridOptions.datasetIdPropertyName || 'id';\n }\n\n get gridOptions(): GridOption {\n return (this._grid?.getOptions() || {}) as GridOption;\n }\n\n get rowDetailViewOptions(): RowDetailView | undefined {\n return this.gridOptions.rowDetailView;\n }\n\n /** Dispose of the RowDetailView Extension */\n dispose() {\n clearTimeout(this._timer);\n this.disposeAllViewComponents();\n unsubscribeAll(this._subscriptions);\n super.dispose();\n }\n\n /** Dispose of all the opened Row Detail Panels Components */\n disposeAllViewComponents() {\n do {\n const view = this._views.pop();\n if (view) {\n this.disposeViewByItem(view);\n }\n } while (this._views.length > 0);\n }\n\n /** Get the instance of the SlickGrid addon (control or plugin). */\n getAddonInstance(): ReactRowDetailView | null {\n return this;\n }\n\n init(grid: SlickGrid) {\n this._grid = grid;\n super.init(grid);\n this.gridContainerElement = grid.getContainerNode();\n this.register(grid.getSelectionModel());\n }\n\n /**\n * Create the plugin before the Grid creation, else it will behave oddly.\n * Mostly because the column definitions might change after the grid creation\n */\n register(rowSelectionPlugin?: SelectionModel) {\n if (typeof this.gridOptions.rowDetailView?.process === 'function') {\n // we need to keep the user \"process\" method and replace it with our own execution method\n // we do this because when we get the item detail, we need to call \"onAsyncResponse.notify\" for the plugin to work\n this._userProcessFn = this.gridOptions.rowDetailView.process as (item: any) => Promise<any>; // keep user's process method\n this.addonOptions.process = (item) => this.onProcessing(item); // replace process method & run our internal one\n } else {\n throw new Error('[Slickgrid-React] You need to provide a \"process\" function for the Row Detail Extension to work properly');\n }\n\n if (this._grid && this.gridOptions?.rowDetailView) {\n // load the Preload & RowDetail Templates (could be straight HTML or React Components)\n // when those are React Components, we need to create View Component & provide the html containers to the Plugin (preTemplate/postTemplate methods)\n if (!this.gridOptions.rowDetailView.preTemplate) {\n this._preloadComponent = this.gridOptions.rowDetailView.preloadComponent;\n this.addonOptions.preTemplate = () => createDomElement('div', { className: `${PRELOAD_CONTAINER_PREFIX}` });\n }\n if (!this.gridOptions.rowDetailView.postTemplate) {\n this._component = this.gridOptions.rowDetailView.viewComponent;\n this.addonOptions.postTemplate = (itemDetail: any) =>\n createDomElement('div', { className: `${ROW_DETAIL_CONTAINER_PREFIX}${itemDetail[this.datasetIdPropName]}` });\n }\n\n if (this._grid && this.gridOptions) {\n // this also requires the Row Selection Model to be registered as well\n if (!rowSelectionPlugin || !this._grid.getSelectionModel()) {\n const selectionType = this.gridOptions.selectionOptions?.selectionType || 'row';\n const selectActiveRow = this.gridOptions.selectionOptions?.selectActiveRow ?? true;\n rowSelectionPlugin = new SlickHybridSelectionModel({ ...this.gridOptions.selectionOptions, selectionType, selectActiveRow });\n this._grid.setSelectionModel(rowSelectionPlugin);\n }\n\n // hook all events\n if (this._grid && this.rowDetailViewOptions) {\n if (this.rowDetailViewOptions.onExtensionRegistered) {\n this.rowDetailViewOptions.onExtensionRegistered(this);\n }\n\n this._eventHandler.subscribe(this.onAsyncResponse, (event, args) => {\n if (typeof this.rowDetailViewOptions?.onAsyncResponse === 'function') {\n this.rowDetailViewOptions.onAsyncResponse(event, args);\n }\n });\n\n this._eventHandler.subscribe(this.onAsyncEndUpdate, async (event, args) => {\n // dispose preload if exists\n this._preloadRoot?.unmount();\n\n // triggers after backend called \"onAsyncResponse.notify()\"\n // because of the preload destroy above, we need a small delay to make sure the DOM element is ready to render the Row Detail\n queueMicrotask(() => {\n this.renderViewModel(args?.item);\n\n if (typeof this.rowDetailViewOptions?.onAsyncEndUpdate === 'function') {\n this.rowDetailViewOptions.onAsyncEndUpdate(event, args);\n }\n });\n });\n\n this._eventHandler.subscribe(this.onAfterRowDetailToggle, async (event, args) => {\n // display preload template & re-render all the other Detail Views after toggling\n // the preload View will eventually go away once the data gets loaded after the \"onAsyncEndUpdate\" event\n this.renderPreloadView(args.item);\n\n if (typeof this.rowDetailViewOptions?.onAfterRowDetailToggle === 'function') {\n this.rowDetailViewOptions.onAfterRowDetailToggle(event, args);\n }\n });\n\n this._eventHandler.subscribe(this.onBeforeRowDetailToggle, (event, args) => {\n // before toggling row detail, we need to create View Component if it doesn't exist\n this.handleOnBeforeRowDetailToggle(event, args);\n\n if (typeof this.rowDetailViewOptions?.onBeforeRowDetailToggle === 'function') {\n return this.rowDetailViewOptions.onBeforeRowDetailToggle(event, args);\n }\n return true;\n });\n\n this._eventHandler.subscribe(this.onRowBackToViewportRange, async (event, args) => {\n // when row is back to viewport range, we will re-render the View Component(s)\n this.handleOnRowBackToViewportRange(event, args);\n\n if (typeof this.rowDetailViewOptions?.onRowBackToViewportRange === 'function') {\n this.rowDetailViewOptions.onRowBackToViewportRange(event, args);\n }\n });\n\n this._eventHandler.subscribe(this.onBeforeRowOutOfViewportRange, (event, args) => {\n if (typeof this.rowDetailViewOptions?.onBeforeRowOutOfViewportRange === 'function') {\n this.rowDetailViewOptions.onBeforeRowOutOfViewportRange(event, args);\n }\n this.disposeViewByItem(args.item);\n });\n\n this._eventHandler.subscribe(this.onRowOutOfViewportRange, (event, args) => {\n if (typeof this.rowDetailViewOptions?.onRowOutOfViewportRange === 'function') {\n this.rowDetailViewOptions.onRowOutOfViewportRange(event, args);\n }\n });\n\n // --\n // hook some events needed by the Plugin itself\n\n // we need to redraw the open detail views if we change column position (column reorder)\n this.eventHandler.subscribe(this._grid.onColumnsReordered, () => this.redrawAllViewComponents(false));\n\n // on row selection changed, we also need to redraw\n if (this.gridOptions.enableSelection || this.gridOptions.enableCheckboxSelector) {\n this._eventHandler.subscribe(this._grid.onSelectedRowsChanged, () => this.redrawAllViewComponents(false));\n }\n\n // on column sort/reorder, all row detail are collapsed so we can dispose of all the Views as well\n this._eventHandler.subscribe(this._grid.onSort, this.disposeAllViewComponents.bind(this));\n\n // on filter changed, we need to re-render all Views\n this._subscriptions.push(\n this.eventPubSubService?.subscribe(\n [\n 'onFilterChanged',\n 'onGridMenuColumnsChanged',\n 'onColumnPickerColumnsChanged',\n 'onGridMenuClearAllFilters',\n 'onGridMenuClearAllSorting',\n ],\n () => this.redrawAllViewComponents(true)\n )\n );\n }\n }\n }\n\n return this;\n }\n\n /** Redraw (re-render) all the expanded row detail View Components */\n async redrawAllViewComponents(forceRedraw = false) {\n clearTimeout(this._timer);\n this._timer = setTimeout(() => {\n this.resetRenderedRows();\n this._views.forEach((view) => {\n if (!view.rendered || forceRedraw) {\n forceRedraw && this.disposeViewComponent(view);\n this.redrawViewComponent(view);\n }\n });\n });\n }\n\n /** Render all the expanded row detail View Components */\n async renderAllViewModels() {\n this._views.filter((x) => x?.dataContext).forEach((x) => this.renderViewModel(x.dataContext));\n }\n\n /** Redraw the necessary View Component */\n redrawViewComponent(view: CreatedView) {\n const containerElement = this.gridContainerElement.querySelector(`.${ROW_DETAIL_CONTAINER_PREFIX}${view.id}`);\n if (containerElement) {\n this.renderViewModel(view.dataContext);\n }\n }\n\n /** Render (or re-render) the View Component (Row Detail) */\n renderPreloadView(item: any) {\n const containerElement = this.gridContainerElement.querySelector(`.${PRELOAD_CONTAINER_PREFIX}`);\n if (this._preloadComponent && containerElement) {\n // render row detail\n const bindableData = {\n model: item,\n addon: this,\n grid: this._grid,\n dataView: this.dataView,\n parentRef: this.rowDetailViewOptions?.parentRef,\n } as ViewModelBindableInputData;\n const detailContainer = document.createElement('section');\n containerElement.appendChild(detailContainer);\n\n const { root } = createReactComponentDynamically(this._preloadComponent, detailContainer, bindableData);\n this._preloadRoot = root;\n }\n }\n\n /** Render (or re-render) the View Component (Row Detail) */\n renderViewModel(item: any) {\n const containerElement = this.gridContainerElement.querySelector<HTMLElement>(\n `.${ROW_DETAIL_CONTAINER_PREFIX}${item[this.datasetIdPropName]}`\n );\n if (this._component && containerElement) {\n const bindableData = {\n model: item,\n addon: this,\n grid: this._grid,\n dataView: this.dataView,\n parentRef: this.rowDetailViewOptions?.parentRef,\n } as ViewModelBindableInputData;\n\n // load our Row Detail React Component dynamically, typically we would want to use `root.render()` after the preload component (last argument below)\n // BUT the root render doesn't seem to work and shows a blank element, so we'll use `createRoot()` every time even though it shows a console log in Dev\n // that is the only way I got it working so let's use it anyway and console warnings are removed in production anyway\n const viewObj = this._views.find((obj) => obj.id === item[this.datasetIdPropName]);\n const { root } = createReactComponentDynamically(this._component, containerElement, bindableData);\n if (viewObj) {\n viewObj.root = root;\n viewObj.rendered = true;\n } else {\n this.upsertViewRefs(item, root);\n }\n }\n }\n\n // --\n // protected functions\n // ------------------\n\n protected upsertViewRefs(item: any, root: Root | null) {\n const viewIdx = this._views.findIndex((obj) => obj.id === item[this.datasetIdPropName]);\n const viewInfo: CreatedView = {\n id: item[this.datasetIdPropName],\n dataContext: item,\n root,\n rendered: !!root,\n };\n if (viewIdx >= 0) {\n this._views[viewIdx] = viewInfo;\n } else {\n this._views.push(viewInfo);\n }\n addToArrayWhenNotExists(this._views, viewInfo, this.datasetIdPropName);\n }\n\n protected disposeViewByItem(item: any, removeFromArray = false): void {\n const foundViewIdx = this._views.findIndex((view: CreatedView) => view.id === item[this.datasetIdPropName]);\n if (foundViewIdx >= 0) {\n this.disposeViewComponent(this._views[foundViewIdx]);\n if (removeFromArray) {\n this._views.splice(foundViewIdx, 1);\n }\n }\n }\n\n protected disposeViewComponent(expandedView: CreatedView): CreatedView | void {\n expandedView.rendered = false;\n if (expandedView?.root) {\n const container = this.gridContainerElement.querySelector(`.${ROW_DETAIL_CONTAINER_PREFIX}${expandedView.id}`);\n if (container) {\n expandedView.root.unmount();\n container.textContent = '';\n return expandedView;\n }\n }\n }\n\n /**\n * Just before the row get expanded or collapsed we will do the following\n * First determine if the row is expanding or collapsing,\n * if it's expanding we will add it to our View Components reference array,\n * if we don't already have it or if it's collapsing we will remove it from our View Components reference array\n */\n protected handleOnBeforeRowDetailToggle(_e: SlickEventData<OnBeforeRowDetailToggleArgs>, args: { grid: SlickGrid; item: any }) {\n // expanding\n if (args?.item?.__collapsed) {\n // expanding row detail\n this.upsertViewRefs(args.item, null);\n } else {\n // collapsing, so dispose of the View\n this.disposeViewByItem(args.item, true);\n }\n }\n\n /** When Row comes back to Viewport Range, we need to redraw the View */\n protected async handleOnRowBackToViewportRange(\n _e: SlickEventData<OnRowBackOrOutOfViewportRangeArgs>,\n args: {\n item: any;\n rowId: string | number;\n rowIndex: number;\n expandedRows: (string | number)[];\n rowIdsOutOfViewport: (string | number)[];\n grid: SlickGrid;\n }\n ) {\n const viewModel = this._views.find((x) => x.id === args.rowId);\n if (viewModel && !viewModel.rendered) {\n this.redrawViewComponent(viewModel);\n }\n }\n\n /**\n * notify the onAsyncResponse with the \"args.item\" (required property)\n * the plugin will then use item to populate the row detail panel with the \"postTemplate\"\n * @param item\n */\n protected notifyTemplate(item: any) {\n this.onAsyncResponse.notify({ item }, new SlickEventData(), this);\n }\n\n /**\n * On Processing, we will notify the plugin with the new item detail once backend server call completes\n * @param item\n */\n protected async onProcessing(item: any) {\n if (item && typeof this._userProcessFn === 'function') {\n let awaitedItemDetail: any;\n const userProcessFn = this._userProcessFn(item);\n\n // wait for the \"userProcessFn\", once resolved we will save it into the \"collection\"\n const response: any | any[] = await userProcessFn;\n\n if (response.hasOwnProperty(this.datasetIdPropName)) {\n awaitedItemDetail = response; // from Promise\n } else if (response instanceof Response && typeof response['json'] === 'function') {\n awaitedItemDetail = await response['json'](); // from Fetch\n } else if (response && response['content']) {\n awaitedItemDetail = response['content']; // from http-client\n }\n\n if (!awaitedItemDetail || !awaitedItemDetail.hasOwnProperty(this.datasetIdPropName)) {\n throw new Error(\n '[Slickgrid-React] could not process the Row Detail, please make sure that your \"process\" callback ' +\n `returns an item object that has an \"${this.datasetIdPropName}\" property`\n );\n }\n\n // notify the plugin with the new item details\n this.notifyTemplate(awaitedItemDetail || {});\n }\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slickgrid-universal/react-row-detail-plugin",
3
- "version": "10.0.0-beta.0",
3
+ "version": "10.1.0",
4
4
  "description": "React Row Detail Plugin for SlickGrid-React",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -31,13 +31,13 @@
31
31
  "url": "https://github.com/ghiscoding/slickgrid-universal/issues"
32
32
  },
33
33
  "dependencies": {
34
- "@slickgrid-universal/common": "10.0.0-beta.0",
35
- "@slickgrid-universal/event-pub-sub": "10.0.0-beta.0",
36
- "@slickgrid-universal/row-detail-view-plugin": "10.0.0-beta.0",
34
+ "@slickgrid-universal/common": "10.1.0",
35
+ "@slickgrid-universal/event-pub-sub": "10.1.0",
36
+ "@slickgrid-universal/row-detail-view-plugin": "10.1.0",
37
37
  "react": "^19.2.4",
38
38
  "react-dom": "^19.2.4",
39
- "slickgrid-react": "10.0.0-beta.0",
39
+ "slickgrid-react": "10.1.0",
40
40
  "tslib": "^2.8.1"
41
41
  },
42
- "gitHead": "9ee3b4ce76e171dd3375f1e68e232e315364600e"
42
+ "gitHead": "a3eee6a849bf67e76161ddef91a18b91a4f4ef1f"
43
43
  }
package/src/index.ts CHANGED
@@ -1 +1 @@
1
- export * from './reactSlickRowDetailView.js';
1
+ export * from './reactRowDetailView.js';
@@ -26,8 +26,8 @@ export interface CreatedView {
26
26
  rendered?: boolean;
27
27
  }
28
28
 
29
- export class ReactSlickRowDetailView extends UniversalSlickRowDetailView {
30
- static readonly pluginName = 'ReactSlickRowDetailView';
29
+ export class ReactRowDetailView extends UniversalSlickRowDetailView {
30
+ static readonly pluginName = 'ReactRowDetailView';
31
31
  protected _component?: any;
32
32
  protected _preloadComponent?: any;
33
33
  protected _preloadRoot?: Root;
@@ -35,6 +35,7 @@ export class ReactSlickRowDetailView extends UniversalSlickRowDetailView {
35
35
  protected _subscriptions: EventSubscription[] = [];
36
36
  protected _userProcessFn?: (item: any) => Promise<any>;
37
37
  protected gridContainerElement!: HTMLElement;
38
+ protected _timer?: any;
38
39
  _root?: Root;
39
40
 
40
41
  constructor(private readonly eventPubSubService: EventPubSubService) {
@@ -59,6 +60,7 @@ export class ReactSlickRowDetailView extends UniversalSlickRowDetailView {
59
60
 
60
61
  /** Dispose of the RowDetailView Extension */
61
62
  dispose() {
63
+ clearTimeout(this._timer);
62
64
  this.disposeAllViewComponents();
63
65
  unsubscribeAll(this._subscriptions);
64
66
  super.dispose();
@@ -75,7 +77,7 @@ export class ReactSlickRowDetailView extends UniversalSlickRowDetailView {
75
77
  }
76
78
 
77
79
  /** Get the instance of the SlickGrid addon (control or plugin). */
78
- getAddonInstance(): ReactSlickRowDetailView | null {
80
+ getAddonInstance(): ReactRowDetailView | null {
79
81
  return this;
80
82
  }
81
83
 
@@ -227,7 +229,8 @@ export class ReactSlickRowDetailView extends UniversalSlickRowDetailView {
227
229
 
228
230
  /** Redraw (re-render) all the expanded row detail View Components */
229
231
  async redrawAllViewComponents(forceRedraw = false) {
230
- setTimeout(() => {
232
+ clearTimeout(this._timer);
233
+ this._timer = setTimeout(() => {
231
234
  this.resetRenderedRows();
232
235
  this._views.forEach((view) => {
233
236
  if (!view.rendered || forceRedraw) {
@@ -1 +0,0 @@
1
- {"version":3,"file":"reactSlickRowDetailView.js","sourceRoot":"","sources":["../src/reactSlickRowDetailView.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,cAAc,EACd,yBAAyB,EACzB,cAAc,GAMf,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,kBAAkB,IAAI,2BAA2B,EAAE,MAAM,6CAA6C,CAAC;AAEhH,OAAO,EAAE,+BAA+B,EAAoD,MAAM,iBAAiB,CAAC;AAGpH,MAAM,2BAA2B,GAAG,YAAY,CAAC;AACjD,MAAM,wBAAwB,GAAG,mBAAmB,CAAC;AASrD,MAAM,OAAO,uBAAwB,SAAQ,2BAA2B;IAWzC;IAV7B,MAAM,CAAU,UAAU,GAAG,yBAAyB,CAAC;IAC7C,UAAU,CAAO;IACjB,iBAAiB,CAAO;IACxB,YAAY,CAAQ;IACpB,MAAM,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AI,iBAAsB,CAAC;YAC3B,MAAM,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;YAEhD,oFAAoF;YACpF,MAAM,QAAQ,GAAgB,MAAM,aAAa,CAAC;YAElD,IAAI,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,iBAAiB,CAAC,EAAE,CAAC;gBACpD,iBAAiB,GAAG,QAAQ,CAAC,CAAC,eAAe;YAC/C,CAAC;iBAAM,IAAI,QAAQ,YAAY,QAAQ,IAAI,OAAO,QAAQ,CAAC,MAAM,CAAC,KAAK,UAAU,EAAE,CAAC;gBAClF,iBAAiB,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,aAAa;YAC7D,CAAC;iBAAM,IAAI,QAAQ,IAAI,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;gBAC3C,iBAAiB,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,mBAAmB;YAC9D,CAAC;YAED,IAAI,CAAC,iBAAiB,IAAI,CAAC,iBAAiB,CAAC,cAAc,CAAC,IAAI,CAAC,iBAAiB,CAAC,EAAE,CAAC;gBACpF,MAAM,IAAI,KAAK,CACb,oGAAoG;oBAClG,uCAAuC,IAAI,CAAC,iBAAiB,YAAY,CAC5E,CAAC;YACJ,CAAC;YAED,8CAA8C;YAC9C,IAAI,CAAC,cAAc,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC","sourcesContent":["import {\n addToArrayWhenNotExists,\n createDomElement,\n SlickEventData,\n SlickHybridSelectionModel,\n unsubscribeAll,\n type EventSubscription,\n type OnBeforeRowDetailToggleArgs,\n type OnRowBackOrOutOfViewportRangeArgs,\n type SelectionModel,\n type SlickGrid,\n} from '@slickgrid-universal/common';\nimport { type EventPubSubService } from '@slickgrid-universal/event-pub-sub';\nimport { SlickRowDetailView as UniversalSlickRowDetailView } from '@slickgrid-universal/row-detail-view-plugin';\nimport type { Root } from 'react-dom/client';\nimport { createReactComponentDynamically, type GridOption, type ViewModelBindableInputData } from 'slickgrid-react';\nimport type { RowDetailView } from './interfaces';\n\nconst ROW_DETAIL_CONTAINER_PREFIX = 'container_';\nconst PRELOAD_CONTAINER_PREFIX = 'container_loading';\n\nexport interface CreatedView {\n id: string | number;\n dataContext: any;\n root: Root | null;\n rendered?: boolean;\n}\n\nexport class ReactSlickRowDetailView extends UniversalSlickRowDetailView {\n static readonly pluginName = 'ReactSlickRowDetailView';\n protected _component?: any;\n protected _preloadComponent?: any;\n protected _preloadRoot?: Root;\n protected _views: CreatedView[] = [];\n protected _subscriptions: EventSubscription[] = [];\n protected _userProcessFn?: (item: any) => Promise<any>;\n protected gridContainerElement!: HTMLElement;\n _root?: Root;\n\n constructor(private readonly eventPubSubService: EventPubSubService) {\n super(eventPubSubService);\n }\n\n get addonOptions() {\n return this.getOptions();\n }\n\n protected get datasetIdPropName(): string {\n return this.gridOptions.datasetIdPropertyName || 'id';\n }\n\n get gridOptions(): GridOption {\n return (this._grid?.getOptions() || {}) as GridOption;\n }\n\n get rowDetailViewOptions(): RowDetailView | undefined {\n return this.gridOptions.rowDetailView;\n }\n\n /** Dispose of the RowDetailView Extension */\n dispose() {\n this.disposeAllViewComponents();\n unsubscribeAll(this._subscriptions);\n super.dispose();\n }\n\n /** Dispose of all the opened Row Detail Panels Components */\n disposeAllViewComponents() {\n do {\n const view = this._views.pop();\n if (view) {\n this.disposeViewByItem(view);\n }\n } while (this._views.length > 0);\n }\n\n /** Get the instance of the SlickGrid addon (control or plugin). */\n getAddonInstance(): ReactSlickRowDetailView | null {\n return this;\n }\n\n init(grid: SlickGrid) {\n this._grid = grid;\n super.init(grid);\n this.gridContainerElement = grid.getContainerNode();\n this.register(grid.getSelectionModel());\n }\n\n /**\n * Create the plugin before the Grid creation, else it will behave oddly.\n * Mostly because the column definitions might change after the grid creation\n */\n register(rowSelectionPlugin?: SelectionModel) {\n if (typeof this.gridOptions.rowDetailView?.process === 'function') {\n // we need to keep the user \"process\" method and replace it with our own execution method\n // we do this because when we get the item detail, we need to call \"onAsyncResponse.notify\" for the plugin to work\n this._userProcessFn = this.gridOptions.rowDetailView.process as (item: any) => Promise<any>; // keep user's process method\n this.addonOptions.process = (item) => this.onProcessing(item); // replace process method & run our internal one\n } else {\n throw new Error('[Slickgrid-React] You need to provide a \"process\" function for the Row Detail Extension to work properly');\n }\n\n if (this._grid && this.gridOptions?.rowDetailView) {\n // load the Preload & RowDetail Templates (could be straight HTML or React Components)\n // when those are React Components, we need to create View Component & provide the html containers to the Plugin (preTemplate/postTemplate methods)\n if (!this.gridOptions.rowDetailView.preTemplate) {\n this._preloadComponent = this.gridOptions.rowDetailView.preloadComponent;\n this.addonOptions.preTemplate = () => createDomElement('div', { className: `${PRELOAD_CONTAINER_PREFIX}` });\n }\n if (!this.gridOptions.rowDetailView.postTemplate) {\n this._component = this.gridOptions.rowDetailView.viewComponent;\n this.addonOptions.postTemplate = (itemDetail: any) =>\n createDomElement('div', { className: `${ROW_DETAIL_CONTAINER_PREFIX}${itemDetail[this.datasetIdPropName]}` });\n }\n\n if (this._grid && this.gridOptions) {\n // this also requires the Row Selection Model to be registered as well\n if (!rowSelectionPlugin || !this._grid.getSelectionModel()) {\n const selectionType = this.gridOptions.selectionOptions?.selectionType || 'row';\n const selectActiveRow = this.gridOptions.selectionOptions?.selectActiveRow ?? true;\n rowSelectionPlugin = new SlickHybridSelectionModel({ ...this.gridOptions.selectionOptions, selectionType, selectActiveRow });\n this._grid.setSelectionModel(rowSelectionPlugin);\n }\n\n // hook all events\n if (this._grid && this.rowDetailViewOptions) {\n if (this.rowDetailViewOptions.onExtensionRegistered) {\n this.rowDetailViewOptions.onExtensionRegistered(this);\n }\n\n this._eventHandler.subscribe(this.onAsyncResponse, (event, args) => {\n if (typeof this.rowDetailViewOptions?.onAsyncResponse === 'function') {\n this.rowDetailViewOptions.onAsyncResponse(event, args);\n }\n });\n\n this._eventHandler.subscribe(this.onAsyncEndUpdate, async (event, args) => {\n // dispose preload if exists\n this._preloadRoot?.unmount();\n\n // triggers after backend called \"onAsyncResponse.notify()\"\n // because of the preload destroy above, we need a small delay to make sure the DOM element is ready to render the Row Detail\n queueMicrotask(() => {\n this.renderViewModel(args?.item);\n\n if (typeof this.rowDetailViewOptions?.onAsyncEndUpdate === 'function') {\n this.rowDetailViewOptions.onAsyncEndUpdate(event, args);\n }\n });\n });\n\n this._eventHandler.subscribe(this.onAfterRowDetailToggle, async (event, args) => {\n // display preload template & re-render all the other Detail Views after toggling\n // the preload View will eventually go away once the data gets loaded after the \"onAsyncEndUpdate\" event\n this.renderPreloadView(args.item);\n\n if (typeof this.rowDetailViewOptions?.onAfterRowDetailToggle === 'function') {\n this.rowDetailViewOptions.onAfterRowDetailToggle(event, args);\n }\n });\n\n this._eventHandler.subscribe(this.onBeforeRowDetailToggle, (event, args) => {\n // before toggling row detail, we need to create View Component if it doesn't exist\n this.handleOnBeforeRowDetailToggle(event, args);\n\n if (typeof this.rowDetailViewOptions?.onBeforeRowDetailToggle === 'function') {\n return this.rowDetailViewOptions.onBeforeRowDetailToggle(event, args);\n }\n return true;\n });\n\n this._eventHandler.subscribe(this.onRowBackToViewportRange, async (event, args) => {\n // when row is back to viewport range, we will re-render the View Component(s)\n this.handleOnRowBackToViewportRange(event, args);\n\n if (typeof this.rowDetailViewOptions?.onRowBackToViewportRange === 'function') {\n this.rowDetailViewOptions.onRowBackToViewportRange(event, args);\n }\n });\n\n this._eventHandler.subscribe(this.onBeforeRowOutOfViewportRange, (event, args) => {\n if (typeof this.rowDetailViewOptions?.onBeforeRowOutOfViewportRange === 'function') {\n this.rowDetailViewOptions.onBeforeRowOutOfViewportRange(event, args);\n }\n this.disposeViewByItem(args.item);\n });\n\n this._eventHandler.subscribe(this.onRowOutOfViewportRange, (event, args) => {\n if (typeof this.rowDetailViewOptions?.onRowOutOfViewportRange === 'function') {\n this.rowDetailViewOptions.onRowOutOfViewportRange(event, args);\n }\n });\n\n // --\n // hook some events needed by the Plugin itself\n\n // we need to redraw the open detail views if we change column position (column reorder)\n this.eventHandler.subscribe(this._grid.onColumnsReordered, () => this.redrawAllViewComponents(false));\n\n // on row selection changed, we also need to redraw\n if (this.gridOptions.enableSelection || this.gridOptions.enableCheckboxSelector) {\n this._eventHandler.subscribe(this._grid.onSelectedRowsChanged, () => this.redrawAllViewComponents(false));\n }\n\n // on column sort/reorder, all row detail are collapsed so we can dispose of all the Views as well\n this._eventHandler.subscribe(this._grid.onSort, this.disposeAllViewComponents.bind(this));\n\n // on filter changed, we need to re-render all Views\n this._subscriptions.push(\n this.eventPubSubService?.subscribe(\n [\n 'onFilterChanged',\n 'onGridMenuColumnsChanged',\n 'onColumnPickerColumnsChanged',\n 'onGridMenuClearAllFilters',\n 'onGridMenuClearAllSorting',\n ],\n () => this.redrawAllViewComponents(true)\n )\n );\n }\n }\n }\n\n return this;\n }\n\n /** Redraw (re-render) all the expanded row detail View Components */\n async redrawAllViewComponents(forceRedraw = false) {\n setTimeout(() => {\n this.resetRenderedRows();\n this._views.forEach((view) => {\n if (!view.rendered || forceRedraw) {\n forceRedraw && this.disposeViewComponent(view);\n this.redrawViewComponent(view);\n }\n });\n });\n }\n\n /** Render all the expanded row detail View Components */\n async renderAllViewModels() {\n this._views.filter((x) => x?.dataContext).forEach((x) => this.renderViewModel(x.dataContext));\n }\n\n /** Redraw the necessary View Component */\n redrawViewComponent(view: CreatedView) {\n const containerElement = this.gridContainerElement.querySelector(`.${ROW_DETAIL_CONTAINER_PREFIX}${view.id}`);\n if (containerElement) {\n this.renderViewModel(view.dataContext);\n }\n }\n\n /** Render (or re-render) the View Component (Row Detail) */\n renderPreloadView(item: any) {\n const containerElement = this.gridContainerElement.querySelector(`.${PRELOAD_CONTAINER_PREFIX}`);\n if (this._preloadComponent && containerElement) {\n // render row detail\n const bindableData = {\n model: item,\n addon: this,\n grid: this._grid,\n dataView: this.dataView,\n parentRef: this.rowDetailViewOptions?.parentRef,\n } as ViewModelBindableInputData;\n const detailContainer = document.createElement('section');\n containerElement.appendChild(detailContainer);\n\n const { root } = createReactComponentDynamically(this._preloadComponent, detailContainer, bindableData);\n this._preloadRoot = root;\n }\n }\n\n /** Render (or re-render) the View Component (Row Detail) */\n renderViewModel(item: any) {\n const containerElement = this.gridContainerElement.querySelector<HTMLElement>(\n `.${ROW_DETAIL_CONTAINER_PREFIX}${item[this.datasetIdPropName]}`\n );\n if (this._component && containerElement) {\n const bindableData = {\n model: item,\n addon: this,\n grid: this._grid,\n dataView: this.dataView,\n parentRef: this.rowDetailViewOptions?.parentRef,\n } as ViewModelBindableInputData;\n\n // load our Row Detail React Component dynamically, typically we would want to use `root.render()` after the preload component (last argument below)\n // BUT the root render doesn't seem to work and shows a blank element, so we'll use `createRoot()` every time even though it shows a console log in Dev\n // that is the only way I got it working so let's use it anyway and console warnings are removed in production anyway\n const viewObj = this._views.find((obj) => obj.id === item[this.datasetIdPropName]);\n const { root } = createReactComponentDynamically(this._component, containerElement, bindableData);\n if (viewObj) {\n viewObj.root = root;\n viewObj.rendered = true;\n } else {\n this.upsertViewRefs(item, root);\n }\n }\n }\n\n // --\n // protected functions\n // ------------------\n\n protected upsertViewRefs(item: any, root: Root | null) {\n const viewIdx = this._views.findIndex((obj) => obj.id === item[this.datasetIdPropName]);\n const viewInfo: CreatedView = {\n id: item[this.datasetIdPropName],\n dataContext: item,\n root,\n rendered: !!root,\n };\n if (viewIdx >= 0) {\n this._views[viewIdx] = viewInfo;\n } else {\n this._views.push(viewInfo);\n }\n addToArrayWhenNotExists(this._views, viewInfo, this.datasetIdPropName);\n }\n\n protected disposeViewByItem(item: any, removeFromArray = false): void {\n const foundViewIdx = this._views.findIndex((view: CreatedView) => view.id === item[this.datasetIdPropName]);\n if (foundViewIdx >= 0) {\n this.disposeViewComponent(this._views[foundViewIdx]);\n if (removeFromArray) {\n this._views.splice(foundViewIdx, 1);\n }\n }\n }\n\n protected disposeViewComponent(expandedView: CreatedView): CreatedView | void {\n expandedView.rendered = false;\n if (expandedView?.root) {\n const container = this.gridContainerElement.querySelector(`.${ROW_DETAIL_CONTAINER_PREFIX}${expandedView.id}`);\n if (container) {\n expandedView.root.unmount();\n container.textContent = '';\n return expandedView;\n }\n }\n }\n\n /**\n * Just before the row get expanded or collapsed we will do the following\n * First determine if the row is expanding or collapsing,\n * if it's expanding we will add it to our View Components reference array,\n * if we don't already have it or if it's collapsing we will remove it from our View Components reference array\n */\n protected handleOnBeforeRowDetailToggle(_e: SlickEventData<OnBeforeRowDetailToggleArgs>, args: { grid: SlickGrid; item: any }) {\n // expanding\n if (args?.item?.__collapsed) {\n // expanding row detail\n this.upsertViewRefs(args.item, null);\n } else {\n // collapsing, so dispose of the View\n this.disposeViewByItem(args.item, true);\n }\n }\n\n /** When Row comes back to Viewport Range, we need to redraw the View */\n protected async handleOnRowBackToViewportRange(\n _e: SlickEventData<OnRowBackOrOutOfViewportRangeArgs>,\n args: {\n item: any;\n rowId: string | number;\n rowIndex: number;\n expandedRows: (string | number)[];\n rowIdsOutOfViewport: (string | number)[];\n grid: SlickGrid;\n }\n ) {\n const viewModel = this._views.find((x) => x.id === args.rowId);\n if (viewModel && !viewModel.rendered) {\n this.redrawViewComponent(viewModel);\n }\n }\n\n /**\n * notify the onAsyncResponse with the \"args.item\" (required property)\n * the plugin will then use item to populate the row detail panel with the \"postTemplate\"\n * @param item\n */\n protected notifyTemplate(item: any) {\n this.onAsyncResponse.notify({ item }, new SlickEventData(), this);\n }\n\n /**\n * On Processing, we will notify the plugin with the new item detail once backend server call completes\n * @param item\n */\n protected async onProcessing(item: any) {\n if (item && typeof this._userProcessFn === 'function') {\n let awaitedItemDetail: any;\n const userProcessFn = this._userProcessFn(item);\n\n // wait for the \"userProcessFn\", once resolved we will save it into the \"collection\"\n const response: any | any[] = await userProcessFn;\n\n if (response.hasOwnProperty(this.datasetIdPropName)) {\n awaitedItemDetail = response; // from Promise\n } else if (response instanceof Response && typeof response['json'] === 'function') {\n awaitedItemDetail = await response['json'](); // from Fetch\n } else if (response && response['content']) {\n awaitedItemDetail = response['content']; // from http-client\n }\n\n if (!awaitedItemDetail || !awaitedItemDetail.hasOwnProperty(this.datasetIdPropName)) {\n throw new Error(\n '[Slickgrid-React] could not process the Row Detail, please make sure that your \"process\" callback ' +\n `returns an item object that has an \"${this.datasetIdPropName}\" property`\n );\n }\n\n // notify the plugin with the new item details\n this.notifyTemplate(awaitedItemDetail || {});\n }\n }\n}\n"]}