@slickgrid-universal/aurelia-row-detail-plugin 10.6.0 → 10.7.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.
@@ -4,7 +4,7 @@ import { SlickEventData, type EventSubscription, type OnBeforeRowDetailToggleArg
4
4
  import { EventPubSubService } from '@slickgrid-universal/event-pub-sub';
5
5
  import { SlickRowDetailView as UniversalSlickRowDetailView } from '@slickgrid-universal/row-detail-view-plugin';
6
6
  import type { AureliaUtilService, CreatedView, GridOption } from 'aurelia-slickgrid';
7
- import type { RowDetailView } from './interfaces';
7
+ import type { RowDetailView } from './interfaces.js';
8
8
  export declare class AureliaRowDetailView extends UniversalSlickRowDetailView {
9
9
  protected readonly aureliaUtilService: AureliaUtilService;
10
10
  protected readonly eventPubSubService: EventPubSubService;
@@ -1 +1 @@
1
- {"version":3,"file":"aureliaRowDetailView.js","sourceRoot":"","sources":["../src/aureliaRowDetailView.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAsB,MAAM,iBAAiB,CAAC;AAEhE,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;AAIhH,MAAM,2BAA2B,GAAG,YAAY,CAAC;AACjD,MAAM,wBAAwB,GAAG,mBAAmB,CAAC;IAGxC,oBAAoB;4BADhC,SAAS,EAAE;;;;sBAC8B,2BAA2B;oCAAnC,SAAQ,WAA2B;;;;YAArE,6KA6WC;;;;QAlWsB,kBAAkB;QAClB,kBAAkB;QAClB,oBAAoB;QAZzC,MAAM,CAAU,UAAU,GAAG,sBAAsB,CAAC;QAC1C,iBAAiB,CAAiB;QAClC,kBAAkB,CAA4B;QAC9C,MAAM,GAAkB,EAAE,CAAC;QAC3B,cAAc,GAAwB,EAAE,CAAC;QACzC,cAAc,CA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IAAI,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;oBAC3C,iBAAiB,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,2BAA2B;gBACtE,CAAC;gBAED,IAAI,CAAC,iBAAiB,IAAI,CAAC,iBAAiB,CAAC,cAAc,CAAC,IAAI,CAAC,iBAAiB,CAAC,EAAE,CAAC;oBACpF,MAAM,IAAI,KAAK,CACb,sGAAsG;wBACpG,uCAAuC,IAAI,CAAC,iBAAiB,YAAY,CAC5E,CAAC;gBACJ,CAAC;gBAED,8CAA8C;gBAC9C,IAAI,CAAC,cAAc,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;YAC/C,CAAC;QACH,CAAC;;YA5WU,uDAAoB;;;;;SAApB,oBAAoB","sourcesContent":["import { transient, type Constructable } from '@aurelia/kernel';\nimport type { ICustomElementController } from '@aurelia/runtime-html';\nimport {\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 { EventPubSubService } from '@slickgrid-universal/event-pub-sub';\nimport { SlickRowDetailView as UniversalSlickRowDetailView } from '@slickgrid-universal/row-detail-view-plugin';\nimport type { AureliaUtilService, CreatedView, GridOption, ViewModelBindableInputData } from 'aurelia-slickgrid';\nimport type { RowDetailView } from './interfaces';\n\nconst ROW_DETAIL_CONTAINER_PREFIX = 'container_';\nconst PRELOAD_CONTAINER_PREFIX = 'container_loading';\n\n@transient()\nexport class AureliaRowDetailView extends UniversalSlickRowDetailView {\n static readonly pluginName = 'AureliaRowDetailView';\n protected _preloadViewModel?: Constructable;\n protected _preloadController?: ICustomElementController;\n protected _slots: CreatedView[] = [];\n protected _subscriptions: EventSubscription[] = [];\n protected _userProcessFn?: (item: any) => Promise<any>;\n protected _viewModel?: Constructable;\n protected _timer?: any;\n\n constructor(\n protected readonly aureliaUtilService: AureliaUtilService,\n protected readonly eventPubSubService: EventPubSubService,\n protected readonly gridContainerElement: HTMLElement\n ) {\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.disposeAllViewSlot();\n unsubscribeAll(this._subscriptions);\n super.dispose();\n }\n\n /** Dispose of all the opened Row Detail Panels Aurelia View Slots */\n disposeAllViewSlot() {\n do {\n const view = this._slots.pop();\n if (view) {\n this.disposeView(view);\n }\n } while (this._slots.length > 0);\n }\n\n /** Get the instance of the SlickGrid addon (control or plugin). */\n getAddonInstance(): AureliaRowDetailView | null {\n return this;\n }\n\n init(grid: SlickGrid) {\n this._grid = grid;\n super.init(grid);\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('[Aurelia-Slickgrid] 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 Aurelia View/ViewModel)\n // when those are Aurelia View/ViewModel, we need to create View Slot & provide the html containers to the Plugin (preTemplate/postTemplate methods)\n if (!this.gridOptions.rowDetailView.preTemplate) {\n this._preloadViewModel = this.gridOptions.rowDetailView.preloadViewModel;\n this.addonOptions.preTemplate = () => createDomElement('div', { className: `${PRELOAD_CONTAINER_PREFIX}` });\n }\n if (!this.gridOptions.rowDetailView.postTemplate) {\n this._viewModel = this.gridOptions.rowDetailView.viewModel;\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._preloadController?.dispose();\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(async () => {\n await 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 await this.renderPreloadView();\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 Slot 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 Slot(s)\n await 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.disposeView(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.redrawAllViewSlots.bind(this, 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.redrawAllViewSlots.bind(this, 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.disposeAllViewSlot.bind(this));\n\n // redraw all Views whenever certain events are triggered\n this._subscriptions.push(\n this.eventPubSubService?.subscribe(\n ['onFilterChanged', 'onGridMenuColumnsChanged', 'onColumnPickerColumnsChanged'],\n this.redrawAllViewSlots.bind(this, false)\n ),\n this.eventPubSubService?.subscribe(['onGridMenuClearAllFilters', 'onGridMenuClearAllSorting'], () => {\n clearTimeout(this._timer);\n this._timer = setTimeout(() => this.redrawAllViewSlots());\n })\n );\n }\n }\n }\n\n return this;\n }\n\n /** Redraw (re-render) all the expanded row detail View Slots */\n async redrawAllViewSlots(forceRedraw = false) {\n this.resetRenderedRows();\n const promises: Promise<void>[] = [];\n this._slots.forEach((x) => {\n forceRedraw && x.controller?.deactivate(x.controller, null);\n promises.push(this.redrawViewSlot(x));\n });\n await Promise.all(promises);\n }\n\n /** Render all the expanded row detail View Slots */\n async renderAllViewModels() {\n const promises: Promise<void>[] = [];\n this._slots.filter((x) => x?.dataContext).forEach((x) => promises.push(this.renderViewModel(x.dataContext)));\n await Promise.all(promises);\n }\n\n /** Redraw the necessary View Slot */\n async redrawViewSlot(slot: CreatedView) {\n const containerElement = this.gridContainerElement.querySelector(`.${ROW_DETAIL_CONTAINER_PREFIX}${slot.id}`);\n if (containerElement) {\n await this.renderViewModel(slot.dataContext);\n }\n }\n\n /** Render (or re-render) the View Slot (Row Detail) */\n async renderPreloadView() {\n const containerElement = this.gridContainerElement.querySelector<HTMLElement>(`.${PRELOAD_CONTAINER_PREFIX}`);\n if (this._preloadViewModel && containerElement) {\n const preloadComp = await this.aureliaUtilService.createAureliaViewModelAddToSlot(\n this._preloadViewModel,\n undefined,\n containerElement\n );\n this._preloadController = preloadComp?.controller;\n }\n }\n\n /** Render (or re-render) the View Slot (Row Detail) */\n async renderViewModel(item: any) {\n const containerElement = this.gridContainerElement.querySelector<HTMLElement>(\n `.${ROW_DETAIL_CONTAINER_PREFIX}${item[this.datasetIdPropName]}`\n );\n if (this._viewModel && 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 aureliaComp = await this.aureliaUtilService.createAureliaViewModelAddToSlot(this._viewModel, bindableData, containerElement);\n const slotObj = this._slots.find((obj) => obj.id === item[this.datasetIdPropName]);\n\n if (slotObj && aureliaComp) {\n slotObj.controller = aureliaComp.controller;\n }\n }\n }\n\n // --\n // protected functions\n // ------------------\n\n protected disposeView(item: any, removeFromArray = false): void {\n const foundSlotIndex = this._slots.findIndex((slot: CreatedView) => slot.id === item[this.datasetIdPropName]);\n if (foundSlotIndex >= 0 && this.disposeViewSlot(this._slots[foundSlotIndex])) {\n if (removeFromArray) {\n this._slots.splice(foundSlotIndex, 1);\n }\n }\n }\n\n protected disposeViewSlot(expandedView: CreatedView): CreatedView | void {\n if (expandedView?.controller) {\n const container = this.gridContainerElement.querySelector(`.${ROW_DETAIL_CONTAINER_PREFIX}${expandedView.id}`);\n if (container) {\n expandedView.controller.deactivate(expandedView.controller, null);\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 Slots reference array if we don't already have it\n * or if it's collapsing we will remove it from our View Slots 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 const viewInfo: CreatedView = {\n id: args.item[this.datasetIdPropName],\n dataContext: args.item,\n };\n addToArrayWhenNotExists(this._slots, viewInfo, this.datasetIdPropName);\n } else {\n // collapsing, so dispose of the View/ViewSlot\n this.disposeView(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 slot = this._slots.find((x) => x.id === args.rowId);\n if (slot) {\n this.redrawViewSlot(slot);\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 aurelia-http-client\n }\n\n if (!awaitedItemDetail || !awaitedItemDetail.hasOwnProperty(this.datasetIdPropName)) {\n throw new Error(\n '[Aurelia-Slickgrid] 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"]}
1
+ {"version":3,"file":"aureliaRowDetailView.js","sourceRoot":"","sources":["../src/aureliaRowDetailView.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAsB,MAAM,iBAAiB,CAAC;AAEhE,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;AAIhH,MAAM,2BAA2B,GAAG,YAAY,CAAC;AACjD,MAAM,wBAAwB,GAAG,mBAAmB,CAAC;IAGxC,oBAAoB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CAAC,iBAAiB,CAAC,EAAE,CAAC;oBACpD,iBAAiB,GAAG,QAAQ,CAAC,CAAC,eAAe;gBAC/C,CAAC;qBAAM,IAAI,QAAQ,YAAY,QAAQ,IAAI,OAAO,QAAQ,CAAC,MAAM,CAAC,KAAK,UAAU,EAAE,CAAC;oBAClF,iBAAiB,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,aAAa;gBAC7D,CAAC;qBAAM,IAAI,QAAQ,IAAI,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;oBAC3C,iBAAiB,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,2BAA2B;gBACtE,CAAC;gBAED,IAAI,CAAC,iBAAiB,IAAI,CAAC,iBAAiB,CAAC,cAAc,CAAC,IAAI,CAAC,iBAAiB,CAAC,EAAE,CAAC;oBACpF,MAAM,IAAI,KAAK,CACb,sGAAsG;wBACpG,uCAAuC,IAAI,CAAC,iBAAiB,YAAY,CAC5E,CAAC;gBACJ,CAAC;gBAED,8CAA8C;gBAC9C,IAAI,CAAC,cAAc,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;YAC/C,CAAC;QACH,CAAC;;YA5WU,uDAAoB;;;;;SAApB,oBAAoB","sourcesContent":["import { transient, type Constructable } from '@aurelia/kernel';\nimport type { ICustomElementController } from '@aurelia/runtime-html';\nimport {\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 { EventPubSubService } from '@slickgrid-universal/event-pub-sub';\nimport { SlickRowDetailView as UniversalSlickRowDetailView } from '@slickgrid-universal/row-detail-view-plugin';\nimport type { AureliaUtilService, CreatedView, GridOption, ViewModelBindableInputData } from 'aurelia-slickgrid';\nimport type { RowDetailView } from './interfaces.js';\n\nconst ROW_DETAIL_CONTAINER_PREFIX = 'container_';\nconst PRELOAD_CONTAINER_PREFIX = 'container_loading';\n\n@transient()\nexport class AureliaRowDetailView extends UniversalSlickRowDetailView {\n static readonly pluginName = 'AureliaRowDetailView';\n protected _preloadViewModel?: Constructable;\n protected _preloadController?: ICustomElementController;\n protected _slots: CreatedView[] = [];\n protected _subscriptions: EventSubscription[] = [];\n protected _userProcessFn?: (item: any) => Promise<any>;\n protected _viewModel?: Constructable;\n protected _timer?: any;\n\n constructor(\n protected readonly aureliaUtilService: AureliaUtilService,\n protected readonly eventPubSubService: EventPubSubService,\n protected readonly gridContainerElement: HTMLElement\n ) {\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.disposeAllViewSlot();\n unsubscribeAll(this._subscriptions);\n super.dispose();\n }\n\n /** Dispose of all the opened Row Detail Panels Aurelia View Slots */\n disposeAllViewSlot() {\n do {\n const view = this._slots.pop();\n if (view) {\n this.disposeView(view);\n }\n } while (this._slots.length > 0);\n }\n\n /** Get the instance of the SlickGrid addon (control or plugin). */\n getAddonInstance(): AureliaRowDetailView | null {\n return this;\n }\n\n init(grid: SlickGrid) {\n this._grid = grid;\n super.init(grid);\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('[Aurelia-Slickgrid] 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 Aurelia View/ViewModel)\n // when those are Aurelia View/ViewModel, we need to create View Slot & provide the html containers to the Plugin (preTemplate/postTemplate methods)\n if (!this.gridOptions.rowDetailView.preTemplate) {\n this._preloadViewModel = this.gridOptions.rowDetailView.preloadViewModel;\n this.addonOptions.preTemplate = () => createDomElement('div', { className: `${PRELOAD_CONTAINER_PREFIX}` });\n }\n if (!this.gridOptions.rowDetailView.postTemplate) {\n this._viewModel = this.gridOptions.rowDetailView.viewModel;\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._preloadController?.dispose();\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(async () => {\n await 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 await this.renderPreloadView();\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 Slot 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 Slot(s)\n await 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.disposeView(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.redrawAllViewSlots.bind(this, 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.redrawAllViewSlots.bind(this, 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.disposeAllViewSlot.bind(this));\n\n // redraw all Views whenever certain events are triggered\n this._subscriptions.push(\n this.eventPubSubService?.subscribe(\n ['onFilterChanged', 'onGridMenuColumnsChanged', 'onColumnPickerColumnsChanged'],\n this.redrawAllViewSlots.bind(this, false)\n ),\n this.eventPubSubService?.subscribe(['onGridMenuClearAllFilters', 'onGridMenuClearAllSorting'], () => {\n clearTimeout(this._timer);\n this._timer = setTimeout(() => this.redrawAllViewSlots());\n })\n );\n }\n }\n }\n\n return this;\n }\n\n /** Redraw (re-render) all the expanded row detail View Slots */\n async redrawAllViewSlots(forceRedraw = false) {\n this.resetRenderedRows();\n const promises: Promise<void>[] = [];\n this._slots.forEach((x) => {\n forceRedraw && x.controller?.deactivate(x.controller, null);\n promises.push(this.redrawViewSlot(x));\n });\n await Promise.all(promises);\n }\n\n /** Render all the expanded row detail View Slots */\n async renderAllViewModels() {\n const promises: Promise<void>[] = [];\n this._slots.filter((x) => x?.dataContext).forEach((x) => promises.push(this.renderViewModel(x.dataContext)));\n await Promise.all(promises);\n }\n\n /** Redraw the necessary View Slot */\n async redrawViewSlot(slot: CreatedView) {\n const containerElement = this.gridContainerElement.querySelector(`.${ROW_DETAIL_CONTAINER_PREFIX}${slot.id}`);\n if (containerElement) {\n await this.renderViewModel(slot.dataContext);\n }\n }\n\n /** Render (or re-render) the View Slot (Row Detail) */\n async renderPreloadView() {\n const containerElement = this.gridContainerElement.querySelector<HTMLElement>(`.${PRELOAD_CONTAINER_PREFIX}`);\n if (this._preloadViewModel && containerElement) {\n const preloadComp = await this.aureliaUtilService.createAureliaViewModelAddToSlot(\n this._preloadViewModel,\n undefined,\n containerElement\n );\n this._preloadController = preloadComp?.controller;\n }\n }\n\n /** Render (or re-render) the View Slot (Row Detail) */\n async renderViewModel(item: any) {\n const containerElement = this.gridContainerElement.querySelector<HTMLElement>(\n `.${ROW_DETAIL_CONTAINER_PREFIX}${item[this.datasetIdPropName]}`\n );\n if (this._viewModel && 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 aureliaComp = await this.aureliaUtilService.createAureliaViewModelAddToSlot(this._viewModel, bindableData, containerElement);\n const slotObj = this._slots.find((obj) => obj.id === item[this.datasetIdPropName]);\n\n if (slotObj && aureliaComp) {\n slotObj.controller = aureliaComp.controller;\n }\n }\n }\n\n // --\n // protected functions\n // ------------------\n\n protected disposeView(item: any, removeFromArray = false): void {\n const foundSlotIndex = this._slots.findIndex((slot: CreatedView) => slot.id === item[this.datasetIdPropName]);\n if (foundSlotIndex >= 0 && this.disposeViewSlot(this._slots[foundSlotIndex])) {\n if (removeFromArray) {\n this._slots.splice(foundSlotIndex, 1);\n }\n }\n }\n\n protected disposeViewSlot(expandedView: CreatedView): CreatedView | void {\n if (expandedView?.controller) {\n const container = this.gridContainerElement.querySelector(`.${ROW_DETAIL_CONTAINER_PREFIX}${expandedView.id}`);\n if (container) {\n expandedView.controller.deactivate(expandedView.controller, null);\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 Slots reference array if we don't already have it\n * or if it's collapsing we will remove it from our View Slots 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 const viewInfo: CreatedView = {\n id: args.item[this.datasetIdPropName],\n dataContext: args.item,\n };\n addToArrayWhenNotExists(this._slots, viewInfo, this.datasetIdPropName);\n } else {\n // collapsing, so dispose of the View/ViewSlot\n this.disposeView(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 slot = this._slots.find((x) => x.id === args.rowId);\n if (slot) {\n this.redrawViewSlot(slot);\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 aurelia-http-client\n }\n\n if (!awaitedItemDetail || !awaitedItemDetail.hasOwnProperty(this.datasetIdPropName)) {\n throw new Error(\n '[Aurelia-Slickgrid] 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/aurelia-row-detail-plugin",
3
- "version": "10.6.0",
3
+ "version": "10.7.1",
4
4
  "description": "Aurelia Row Detail Plugin for Aurelia-SlickGrid",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -33,12 +33,12 @@
33
33
  "dependencies": {
34
34
  "@aurelia/kernel": "^2.0.0-rc.1",
35
35
  "@aurelia/runtime-html": "^2.0.0-rc.1",
36
- "@slickgrid-universal/common": "10.6.0",
37
- "@slickgrid-universal/event-pub-sub": "10.3.0",
38
- "@slickgrid-universal/row-detail-view-plugin": "10.6.0",
39
- "aurelia-slickgrid": "10.6.0",
36
+ "@slickgrid-universal/common": "10.7.1",
37
+ "@slickgrid-universal/event-pub-sub": "10.7.0",
38
+ "@slickgrid-universal/row-detail-view-plugin": "10.7.1",
39
+ "aurelia-slickgrid": "10.7.1",
40
40
  "rxjs": "^7.8.2",
41
41
  "tslib": "^2.8.1"
42
42
  },
43
- "gitHead": "bd0f5130f2ee22c719f7420df79eaae2c15f7ff0"
43
+ "gitHead": "4ac1956ed562e1523ac34d7381d5faba06040590"
44
44
  }
@@ -15,7 +15,7 @@ import {
15
15
  import { EventPubSubService } from '@slickgrid-universal/event-pub-sub';
16
16
  import { SlickRowDetailView as UniversalSlickRowDetailView } from '@slickgrid-universal/row-detail-view-plugin';
17
17
  import type { AureliaUtilService, CreatedView, GridOption, ViewModelBindableInputData } from 'aurelia-slickgrid';
18
- import type { RowDetailView } from './interfaces';
18
+ import type { RowDetailView } from './interfaces.js';
19
19
 
20
20
  const ROW_DETAIL_CONTAINER_PREFIX = 'container_';
21
21
  const PRELOAD_CONTAINER_PREFIX = 'container_loading';