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

@coodoo/coo-dialog

v2.0.1-alpha

Published

Beautiful Alert, confirm and prompt dialogs for Angular

Downloads

2

Readme

coo-dialog

standard-readme compliant

THIS IS A WORK IN PROGRESS - wait for a final release, before installing, but please, come again!

This is an Angular 2 Module for having standard Pop Up Dialogs with Bootstrap 4 Styling

Visit our Demo Page

Table of Contents

Install

npm install coo-dialog

Setup

Import the CooDialog Module to your Project

import { CooDialogModule } from '@coodoo/coo-dialog';

@NgModule({
    imports : [ CooDialogModule, ... ],
    [...]
})

Inject the DialogService in the constructor of your component

import { DialogService } from '@coodoo/coo-dialog';
[...]
constructor(private dialogService: DialogService){}

Optional: Update your angluar-cli.json with the styles from the installed bootstrap version or your own

"styles": [
        "./src/styles.css",
        "./../node_modules/bootstrap/dist/css/bootstrap.css"
      ],

Usage

Every Service call will return a promise with the information about the closing of the dialog. In the then function the approval of the Dialog will be catched in the catch block the dismissal. The data will contain an object with the key status for the information about the state. In the Prompt dialog there will also be a value key with the information from the input field. Alert and Confirm only have a accept button so yu can only close them and get the status information in the then block.

const dialogOption: DialogConfiguration = new DialogConfiguration(`Your Message Content here`, new DialogSettings('Decline', 'Approve'));

this._dialog.alert(dialogOption);

this._dialog.prompt(dialogOption)
    .then((data) => {
        data.status;
        data.value;
    })
    .catch(() => {});

this._dialog.confirm(dialogOption);

API Dialog Service

public function alert(dialogConfiguration: DialogConfiguration)
public function prompt(dialogConfiguration: DialogConfiguration)
public function confirm(dialogConfiguration: DialogConfiguration)

API Dialog Configuration

/**
* The Constructor of the DialogConfiguration model
* @param {string} msg
* @param {DialogSettings} settings
* @param {DialogButtonPosition} buttonPosition
*/
constructor(msg: string, settings: DialogSettings = new DialogSettings(), buttonPosition: DialogButtonPosition = new DialogButtonPosition()) {}

Example

alt text

new DialogConfiguration('Nachricht welche angezeigt werden soll', new DialogSettings(), new DialogButtonPosition());

/**
* Constructor of Dialog Settings Module
* The Object Containing the text for the decline and the approve button
*
* @param {string} textDecline
* @param {string} textApprove
* @param {boolean} promptTextRequried
* @param {string} prompMessageTextLabel
* @param {boolean} showIcon
*/
constructor(textDecline: string = '', textApprove: string = '', promptTextRequried: boolean = false, promptMessageTextLabel: string = '', showIcon: boolean = false) {}

Example

new DialogSettings('Abbrechen', 'Ok', false, '');

/**
* Constructor of DialogButtonPosition Module
* The Object Containing the position class name for the button.
* It could be decline-left or decline-right || approve-left or approve-right
*
* @param {string} positionDecline
* @param {string} textApprove
*/
constructor(positionDecline: string = 'decline-right', positionApprove: string = 'approve-right') {}

Example

new DialogButtonPosition('decline-left');

License

MIT © coodoo