Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic, nested and synced mat expansion panel #52

Open
hadrien-toma opened this issue Apr 17, 2020 · 0 comments
Open

Dynamic, nested and synced mat expansion panel #52

hadrien-toma opened this issue Apr 17, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@hadrien-toma
Copy link
Collaborator

hadrien-toma commented Apr 17, 2020

Enhancement

Metadata

key value
name dynamic-nested-synced-mat-expansion-panel

Description

  • In a SideNav, there is only one component: expansion-panel
  • expansion-panel needs a tree as input, which signature is:
export interface ExpansionPanelTreeHeader {
    description: string;
    title: string;
}
export interface ExpansionPanelTreeRouterLink {
    queryParams: { [k: string]: any; }
    fragment: string;
    queryParamsHandling: QueryParamsHandling;
    preserveFragment: boolean;
    skipLocationChange: boolean;
    replaceUrl: boolean;
    state?: { [k: string]: any; };
    routerLink: string | any[];
}
export interface ExpansionPanelTree {
    data: {
        header?: ExpansionPanelTreeHeader;
        routerLink?: ExpansionPanelTreeRouterLink;
    },
    childList: ExpansionPanelTree[];
}
  • If an ExpansionPanelTree has an empty childList, it will not be a "mat-expansion-pannel" but a mat-toolbar. This toolbar will contain a <a> with all the routerLink inputs (cf. references bellow).
  • The ExpansionPanelTree data come from an NgRx selector which use an IndexTree selector and a CurrentLang selector.
export interface IndexTree {
    data: { id: string; };
    childList: TreeIndex[];
}
export interface ExpansionPanelIndexToHeaderTranslations {
    [lang: string]: {
        indexTreeDataId: string;
        header: {
            title: string;
            description: string;
        }
    }
}
  • There will be one findRequest for each part of the tree that is synced (when an ExpansionPanelTree is expanded, it will reveal its childList, triggering new findRequests, one for each of the "future" childList. This will allow to have no latency in the user experience, as a childList will be loaded/synced ahead of time : before the user want to see it.

Reference(s)

@hadrien-toma hadrien-toma added the enhancement New feature or request label Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants