diff --git a/dist/views/CompositeView.d.ts b/dist/views/CompositeView.d.ts index 3acdfdc61..d72b6ede4 100644 --- a/dist/views/CompositeView.d.ts +++ b/dist/views/CompositeView.d.ts @@ -22,11 +22,13 @@ export interface ICompositeViewPluginDesc extends IViewPluginDesc { layout?: ICompositeLayout; linkedSelections: ILinkedSelection[]; } +export declare function isCompositeViewPluginDesc(desc: any): desc is ICompositeViewPluginDesc; export interface IACompositeViewOptions { showHeaders: boolean; } export interface ICompositeInfo { key: string; + desc: IElementDesc; create(context: IViewContext, selection: ISelection, parent: HTMLElement, options?: any): IView; options?: any; } diff --git a/dist/views/CompositeView.js b/dist/views/CompositeView.js index 0bfd274b9..1a901d7d0 100644 --- a/dist/views/CompositeView.js +++ b/dist/views/CompositeView.js @@ -4,6 +4,9 @@ import { BuilderUtils, LAYOUT_CONTAINER_WRAPPER } from 'phovea_ui'; import { AView } from './AView'; import { EViewMode } from '../base/interfaces'; import { ViewUtils } from './ViewUtils'; +export function isCompositeViewPluginDesc(desc) { + return Array.isArray(desc.elements); +} function prefix(key, rest) { return `${key}.${rest}`; } @@ -150,7 +153,15 @@ export class CompositeView extends EventHandler { if (links.length > 0 && !links.some((l) => l.fromKey === '_input' && l.toKey === d.key)) { s = { idtype: this.selection.idtype, range: Range.none() }; } - const instance = d.create(this.context, s, helper, d.options); + // Fix for nested CompositeViews: + // Previously, nested CompositeViews were not possible, i.e. when using a CompositeView as element of a CompositeView. + // This is due to the fact that the context given to the children of a CompositeView is the context of the CompositeView. + // This of course breaks when a child is a CompositeView, as it expects its "own" desc. When you give it the parent desc, it extracts + // the children from the parent causing an infinite loop as it receives itself as child. + // I have to admit that I do not know why we give it the desc of the CompositeView parent, and not its own. + // The fix is to override the desc with the child desc if it is a CompositeViewDesc, such that it receives the "correct" children. + const patchedContext = isCompositeViewPluginDesc(d.desc) ? { ...this.context, desc: d.desc } : this.context; + const instance = d.create(patchedContext, s, helper, d.options); if (links.length === 0 || links.some((l) => l.fromKey === d.key && l.toKey === '_item')) { instance.on(AView.EVENT_ITEM_SELECT, debounceItemSelection); } @@ -344,6 +355,7 @@ export class CompositeView extends EventHandler { const descOptions = desc.options || {}; return Promise.resolve(desc.loader()).then((instance) => ({ key: desc.key, + desc, options: Object.assign({}, descOptions, this.options), create: PluginRegistry.getInstance().getFactoryMethod(instance, desc.factory || 'create') })); diff --git a/dist/views/CompositeView.js.map b/dist/views/CompositeView.js.map index f18431c02..5ca50335a 100644 --- a/dist/views/CompositeView.js.map +++ b/dist/views/CompositeView.js.map @@ -1 +1 @@ -{"version":3,"file":"CompositeView.js","sourceRoot":"","sources":["../../src/views/CompositeView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,UAAU,EAAE,YAAY,EAAkB,aAAa,EAAE,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,UAAU,EAAC,MAAM,aAAa,CAAC;AAClJ,OAAO,EAML,qBAAqB,EACtB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAC,YAAY,EAAe,wBAAwB,EAAC,MAAM,WAAW,CAAC;AAC9E,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAmDtC,SAAS,MAAM,CAAC,GAAW,EAAE,IAAY;IACvC,OAAO,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;AAC1B,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY;IAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAChC,IAAI,KAAK,GAAG,CAAC,EAAE;QACb,OAAO,EAAC,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAC,CAAC;KAC9B;IACD,OAAO;QACL,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC;QACzB,IAAI,EAAE,IAAI,CAAC,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AAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC/D,CAAC;;AA3WsB,gDAAkC,GAAG,cAAc,CAAC;AACpD,iDAAmC,GAAG,cAAc,CAAC"} \ No newline at end of file diff --git a/src/views/CompositeView.ts b/src/views/CompositeView.ts index 3cb61b26e..896b999a4 100644 --- a/src/views/CompositeView.ts +++ b/src/views/CompositeView.ts @@ -41,6 +41,10 @@ export interface ICompositeViewPluginDesc extends IViewPluginDesc { linkedSelections: ILinkedSelection[]; } +export function isCompositeViewPluginDesc(desc: any): desc is ICompositeViewPluginDesc { + return Array.isArray(desc.elements); +} + export interface IACompositeViewOptions { showHeaders: boolean; } @@ -49,6 +53,8 @@ export interface IACompositeViewOptions { export interface ICompositeInfo { key: string; + desc: IElementDesc; + create(context: IViewContext, selection: ISelection, parent: HTMLElement, options?: any): IView; options?: any; @@ -246,7 +252,15 @@ export class CompositeView extends EventHandler implements IView { if (links.length > 0 && !links.some((l) => l.fromKey === '_input' && l.toKey === d.key)) { s = {idtype: this.selection.idtype, range: Range.none()}; } - const instance = d.create(this.context, s, helper, d.options); + // Fix for nested CompositeViews: + // Previously, nested CompositeViews were not possible, i.e. when using a CompositeView as element of a CompositeView. + // This is due to the fact that the context given to the children of a CompositeView is the context of the CompositeView. + // This of course breaks when a child is a CompositeView, as it expects its "own" desc. When you give it the parent desc, it extracts + // the children from the parent causing an infinite loop as it receives itself as child. + // I have to admit that I do not know why we give it the desc of the CompositeView parent, and not its own. + // The fix is to override the desc with the child desc if it is a CompositeViewDesc, such that it receives the "correct" children. + const patchedContext = isCompositeViewPluginDesc(d.desc) ? {...this.context, desc: d.desc} : this.context; + const instance = d.create(patchedContext, s, helper, d.options); if (links.length === 0 || links.some((l) => l.fromKey === d.key && l.toKey === '_item')) { instance.on(AView.EVENT_ITEM_SELECT, debounceItemSelection); } @@ -461,6 +475,7 @@ export class CompositeView extends EventHandler implements IView { const descOptions = desc.options || {}; return Promise.resolve(desc.loader()).then((instance) => ({ key: desc.key, + desc, options: Object.assign({}, descOptions, this.options), // also pass the view options from the ViewWrapper to all views create: PluginRegistry.getInstance().getFactoryMethod(instance, desc.factory || 'create') }));