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

modal-material

v0.2.6

Published

A service developed based on the angular material. Containing customizable and templete alerts.

Downloads

208

Readme

A Service developed based on Angular Material using the Angular CLI framework. Containing Customized Alerts and Templates pre made with basic settings for display.

Table of contents

  1. Installation and Dependencies
  2. Quick start
  3. Available Functions
  4. DEMO

Installation and Dependencies

Use the command below to add the service to your Angular application.

npm install --save modal-material

Immediately after installing the service, import the module into your application.

import { ModalMaterialModule } from 'modal-material';

/*---------------------------------------------------*/

@NgModule({
  imports: [
    ModalMaterialModule
  ],
})

Once this is done, it is ready to be used, just import the service into one of its components of use.

import { Component } from '@angular/core';

// Import Service

import { ModalMaterialService } from 'modal-material';

@Component({
  selector: 'app-test-modal',
  templateUrl: './test-modal.component.html',
  styleUrls: ['./test-modal.component.scss']
})
export class TestModalComponent {

  constructor(private modal: ModalMaterialService) {}

}

It is necessary to install the Font Awesome library to use 100% of the service.

To install it in your angular application just go to the angular.json file in the styles section and add the following line.

"styles": [
  "./node_modules/components-font-awesome/css/all.css",
],

That done, you are ready to enjoy the service 100%.

Quick start

import { Component } from '@angular/core';

// Import Service

import { ModalMaterialService } from 'modal-material';

@Component({
  selector: 'app-test-modal',
  templateUrl: './test-modal.component.html',
  styleUrls: ['./test-modal.component.scss']
})
export class TestModalComponent implements OnInit {

  constructor(private modal: ModalMaterialService) {}

  ngOnInit() {
    this.modal.mTSuccess({
      title: 'Test Alert Success', // Alert Title
      description: 'Test Description',  // Alert Description
      btnCloseTitle: 'Close', // Close Alert Button Title
      width: 'auto',  // Alert Width. Example 100px, 100%.
      height: 'auto', // Alert height. Example 100px, 100%.
      disableClose: true // When you click outside the modal it will close itself. True case it does not close.
    });
  }
}
  • Quick start result

result-quick-start

Available Functions

Below are all available functions and possible alerts.

mTSuccess

this.modal.mTSuccess({
  title: 'Test Alert Success', // Alert Title
  description: 'Test Description',  // Alert Description
  btnCloseTitle: 'Close', // Close Alert Button Title
  width: 'auto',  // Alert Width. Example 100px, 100%.
  height: 'auto', // Alert height. Example 100px, 100%.
  disableClose: true // When you click outside the modal it will close itself. True case it does not close.
});

mTSuccessLog

this.modal.mTSuccessLog(
  {
   title: 'Test Alert Success Log', // Alert Title
   description: 'Test Description Log', // Alert Description
   btnCloseTitle: 'Close', // Close Alert Button Title
   btnLogTitle: 'Details', // Details button title.
   log: 'Careful it looks like the system is getting overloaded.', // Log
   width: 'auto', // Alert Width. Example 100px, 100%.
   height: 'auto', // Alert height. Example 100px, 100%.
   disableClose: true // When you click outside the modal it will close itself. True case it does not close.
  }
);

mTSuccessConfirm

this.modal.mTSuccessConfirm(
  {
   title: 'Test Alert Success', // Alert Title
   description: 'Test Description', // Alert Description
   btnCloseTitle: 'Close', // Close Alert Button Title
   btnConfirmTitle: 'Confirm', // Confirmation Button title.
   width: 'auto', // Alert Width. Example 100px, 100%.
   height: 'auto', // Alert height. Example 100px, 100%.
   disableClose: true // When you click outside the modal it will close itself. True case it does not close.
  }
).subscribe((res) => {
  if (res) {
    console.log('Confirmed!');
  } else {
    console.log('Canceled');
  }
});

mTAlert

this.modal.mTAlert(
  {
    title: 'Test Alert', // Alert Title
    description: 'Test Description',  // Alert Description
    btnCloseTitle: 'Close', // Close Alert Button Title
    width: 'auto',  // Alert Width. Example 100px, 100%.
    height: 'auto', // Alert height. Example 100px, 100%.
    disableClose: true
  }
);

mTAlertLog

this.modal.mTAlertLog(
  {
    title: 'Test Alert Log', // Alert Title
    description: 'Test Description Log', // Alert Description
    btnCloseTitle: 'Close', // Close Alert Button Title
    btnLogTitle: 'Details', // Details button title.
    log: 'Congratulations you have just used the alert log service', // Log
    width: 'auto', // Alert Width. Example 100px, 100%.
    height: 'auto', // Alert height. Example 100px, 100%.
    disableClose: true // When you click outside the modal it will close itself. True case it does not close.
  }
);

mTAlertConfirm

this.modal.mTAlertConfirm(
  {
    title: 'Test Alert', // Alert Title
    description: 'Test Description', // Alert Description
    btnCloseTitle: 'Close', // Close Alert Button Title
    btnConfirmTitle: 'Confirm', // Confirmation Button title.
    width: 'auto', // Alert Width. Example 100px, 100%.
    height: 'auto', // Alert height. Example 100px, 100%.
    disableClose: true // When you click outside the modal it will close itself. True case it does not close.
  }
).subscribe((res) => {
  if (res) {
    console.log('Confirmed!');
  } else {
    console.log('Canceled');
  }
});

mTError

this.modal.mTError(
  {
    title: 'Test Alert Error', // Alert Title
    description: 'Test Description',  // Alert Description
    btnCloseTitle: 'Close', // Close Alert Button Title
    width: 'auto',  // Alert Width. Example 100px, 100%.
    height: 'auto', // Alert height. Example 100px, 100%.
    disableClose: true
  }
);

mTErrorLog

this.modal.mTErrorLog(
  {
    title: 'Test Alert Error Log', // Alert Title
    description: 'Test Description Log', // Alert Description
    btnCloseTitle: 'Close', // Close Alert Button Title
    btnLogTitle: 'Details', // Details button title.
    log: 'Error failed to bring user from database.', // Log
    width: 'auto', // Alert Width. Example 100px, 100%.
    height: 'auto', // Alert height. Example 100px, 100%.
    disableClose: true // When you click outside the modal it will close itself. True case it does not close.
  }
);

mTErrorConfirm

this.modal.mTErrorConfirm(
  {
    title: 'Test Alert Error', // Alert Title
    description: 'Test Description', // Alert Description
    btnCloseTitle: 'Close', // Close Alert Button Title
    btnConfirmTitle: 'Confirm', // Confirmation Button title.
    width: 'auto', // Alert Width. Example 100px, 100%.
    height: 'auto', // Alert height. Example 100px, 100%.
    disableClose: true // When you click outside the modal it will close itself. True case it does not close.
  }
).subscribe((res) => {
  if (res) {
    console.log('Confirmed!');
  } else {
    console.log('Canceled');
  }
});

mManualBasic

this.modal.mManualBasic(
  {
    title: 'Test Alert', // Alert Title
    description: 'Test Description',  // Alert Description
    btnCloseTitle: 'Close', // Close Alert Button Title
    icon: 'fab fa-npm', // Put the icon class if it is https://fontawesome.com/
    // if not just put the icon name if you are going to use https://material.io/
    mBackgroundColorIcon: 'green', // Background color that will be behind the icon when the modal appears.
    useMatIcon: false, // If using https://material.io/ leave true if using https://fontawesome.com/ leave false.
    width: 'auto', // Alert Width. Example 100px, 100%.
    height: 'auto', // Alert height. Example 100px, 100%.
    disableClose: true // When you click outside the modal it will close itself. True case it does not close.
  }
);

mManualLog

this.modal.mManualLog(
  {
    modalMB: {
     title: 'Title Alert', // Alert Title
     description: 'Title Description', // Alert Description
     btnCloseTitle: 'Close', // Close Alert Button Title
     icon: 'person', // Put the icon class if it is https://fontawesome.com/
      // if not just put the icon name if you are going to use https://material.io/
     mBackgroundColorIcon: 'red', // Background color that will be behind the icon when the modal appears.
     useMatIcon: true,  // If using https://material.io/ leave true if using https://fontawesome.com/ leave false.
     width: 'auto',  // Alert Width. Example 100px, 100%.
     height: 'auto', // Alert height. Example 100px, 100%.
     disableClose: true // When you click outside the modal it will close itself. True case it does not close.
    },
    btnLogTitle: 'Details', // Details button title.
    log: 'Failed to add person.', // Log
  }
);

mManualConfirm

this.modal.mManualConfirm(
  {
    modalMB: {
      title: 'Test Alert', // Alert Title
      description: 'Test Description', // Alert Description
      btnCloseTitle: 'Close', // Close Alert Button Title
      icon: 'warning', // Put the icon class if it is https://fontawesome.com/
      // if not just put the icon name if you are going to use https://material.io/
      mBackgroundColorIcon: 'yellow', // Background color that will be behind the icon when the modal appears.
      useMatIcon: true,  // If using https://material.io/ leave true if using https://fontawesome.com/ leave false.
      width: 'auto',  // Alert Width. Example 100px, 100%.
      height: 'auto', // Alert height. Example 100px, 100%.
      disableClose: true // When you click outside the modal it will close itself. True case it does not close.
    },
    btnConfirmTitle: 'Confirm', // Confirmation Button title.
  }
).subscribe((res) => {
  if (res) {
    console.log('Confirmed!');
  } else {
    console.log('Canceled');
  }
});