npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@smartbit4all/dialog

v1.0.8

Published

## References

Downloads

211

Readme

Smart Dialog

References

These packages must be updated in case of a new version:


How to use

Installation

Go to your project, open the terminal and use the following command:

npm i @smartbit4all/dialog

Then import it in the AppModule:

app.module.ts:

import { SmartdialogModule, SmartdialogService } from '@smartbit4all/dialog';
...
@NgModule({
    declarations: [...]
    imports: [
        ...
        SmartdialogModule,
    ],
    providers: [
        ...
	    SmartdialogService,
    ]
    ...
})

Usage #1

If you do not use the SmartViewContext package in your project or the dialog is not opened by the BFF, you have to create a service for you component.

Create a component for the content of the dialog. In the folder of the component create an Angular Service.

  • src/app/.../example-dialog/
    • example-dialog.component.css
    • example-dialog.component.html
    • example-dialog.component.ts
    • example-dialog.service.ts

Extend your service with the SmartdialogService. You can see an example for a specific service belove.

example-dialog.service.ts:

@Injectable({
    providedIn: 'root'
})
export class ExampleDialogService extends SmartdialogService {
    constructor(
        dialog: MatDialog,
        router: Router
    ) {
        super(dialog, router);
    }

    override handleAfterClosed(result: any): void {
        ...
    }

    openDialog(): void {
        const dialogData: SmartDialogData = { ... };
        this.createDialog(dialogData, SmartDialog);
    }

    onAction(params: any): void {
        this.closeDialog().then(() => {
            ...
        });
    }
}

In case if you use RouterOutlet in your dialog, it should be used like this:

example-dialog.component.html:

<router-outlet name="exampleNamedOutlet"></router-outlet>

app-routing.module.ts:

...
{
	path: 'example-url',
	component: ExampleComponent,
	outlet: 'exampleNamedOutlet'
}

example-dialog.service.ts:

const dialogData: SmartDialogData = {
    ...
    outlets: {
        exampleNamedOutlet: null
    }
};

Usage #2

If you use the SmartViewContext package in your project and the dialog is opened by the BFF, you do not have to create a service for you component.

view-context.pages.ts:

export enum Pages {
    VIEW_CONTEXT = 'viewContextUuid',
    EXAMPLE_DIALOG = 'exampleDialog'
}

view-context.handlers.ts:

export const viewContextHandlers: SmartViewHandlerModel[] = [
    {
        name: Pages.EXAMPLE_DIALOG,
        component: ExmapleDialogComponent
    }
];

Version logs

@smartbit4all/form v1.0.5

Type: Update

The openComponentAsDialog function returns the reference of the created dialog.

openComponentAsDialog(component: ComponentType<any>, viewName: string): MatDialogRef<any, any> { ... }

@smartbit4all/form v1.0.4

Type: Update

@smartbit4all/icon support.

@smartbit4all/form v1.0.1

Type: Update

The package has been published.

@smartbit4all/dialog v0.1.0

Type: Feature

From this version the usage of SmartViewContext is supported.

The SmartDialogService got a new function which creates a unified SmartDialogData object and opens the dialog.

export class SmartdialogService {

    ...

    openComponentAsDialog(component: ComponentType<any>, viewName: string): void {
        let smartDialog: SmartDialogData = {
            size: {},
            content: {
                title: viewName,
            },
            customComponent: component,
        };

        this.createDialog(smartDialog, component);
    }
}

@smartbit4all/dialog v0.0.7

Type: Feature

In this update a new way to handle dialogs and its data has been introduced.

With the SmartdialogService creating and closing a dialog has become easier and more unified. This service should be used as a parent class of a workflow specific service.

@smartbit4all/dialog v0.0.2

Type: Version updates

The versions of the SmartForm and the SmartTable have been updated.

New versions:

  • @smartbit4all/form: v0.1.1
  • @smartbit4all/table: v0.1.3

@smartbit4all/dialog v0.0.1

Type: Feature

The basic smart dialog with its features.