🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

@cargos/cs-modal

Package Overview
Dependencies
Maintainers
8
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cargos/cs-modal

Modal for Angular applications

0.11.0
latest
Source
npm
Version published
Maintainers
8
Created
Source

Angular cs-modal

This library was generated with [Angular CLI].

Getting started

Step 1: Install cs-modal:

NPM

npm install --save @cargos/cs-modal

Step 2: Import the CsModalModule:

import { CsModalModule } from '@cargos/cs-modal';

@NgModule({
  declarations: [AppComponent],
  imports: [CsModalModule],
  bootstrap: [AppComponent]
})
export class AppModule {}

Step 3: Import the csModal in AppComponent and initialize the settings:

import { csModal, Modal } from '@cargos/cs-modal';

export class AppComponent {

  public settingsModal: Observable<Modal>;

  constructor() {
    this.settingsModal = csModal.getSettings();
  }

}

Step 4: Declare cs-modal component in app.component.html:

<cs-modal [settings]="settingsModal"></cs-modal>

Step 5: Include style dependencies and a theme:

@import "~material-icons/iconfont/material-icons.css";
@import "~@cargos/cs-modal/styles/modal.css";

//theme
@import "~@cargos/cs-modal/styles/sprintpass.theme.css";

Note: Only sprintpass.theme is available at the moment.

Settings

KeyTypeDefaultDescription
titlestring''...
titleClassstring''...
titleAlign'left''center''right''center'...
contentModalContent''...
contentAlign'left''center''right''center'...
type'default''warning''error''success''info''default'...
spinner'dots''circle''dots'...
buttonsButtonOptions[][]...
buttonsAlign'left''center''right''space-evenly''center'...
iconNamestring''...
iconFontClassstring'material-icons'...
iconAlign'left''center''right''center'...
bgTheme'black''white''black'...
theme'sprintpass''sprintpass'...
animation'scale''fade''fade'...
closeAnimation'scale''fade''fade'...
closeIconboolean(modal?: Modal) => Observable<any>null...
closeIconNamestring'close'...
columnClass'xsmall''small''medium''large''cover''small'...
fontSize'small''medium''large''small'...
autoClosenumber0...
autoCloseAction(modal?: Modal) => Observable<any>string''...
backgroundDismissboolean(modal?: Modal) => Observable<any>null...
backgroundDismissAnimation'none''shake''shake'...
escapeKeyboolean(modal?: Modal) => Observable<any>null...
maximizebooleanfalse...
onContentReady(modal?: Modal) => Observable<void>null...
zIndexnumber1000...

Methods

NameSettingsDescription
confirm````
success````
warning````
error````
closeN/A``

How to use

import { csModal } from '@cargos/cs-modal';

export class MyComponent {

  constructor() { }

  /* Optional if you want to close the modal when the component is destroyed */
  ngOnDestroy() {
    csModal.close();
  }

  showModal() {
    csModal.confirm({
        //...custom settings
    });
  }

}

Further help

Coming soon.

Keywords

cs-modal

FAQs

Package last updated on 07 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts