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

dialog-notek

v0.0.43

Published

angular6+ dialog组件 弹窗组件

Downloads

31

Readme

dialog-notek angular4+ 弹窗组件

安装

npm install dialog-notek -D

使用
// app.module.ts
import { DialogModule } from 'dialog-notek';
@NgModule({
    declarations: [...],
    imports: [
        DialogModule.forRoot()
    ],
    providers: [],
    bootstrap: [...]
})

// component.
import { DialogService } from 'dialog-notek';

export class YourComponent {
    constructor(private dialogSrv: DialogService) { };

    test() {
        this.dialogSrv.create({
            title: '我是弹窗组件',
            content: '我是弹窗组件的内容'
        });
    };
}
支持
**类型**
混合类型: dialog.create(params)
提示类型: dialog.alert('标题', params)
用户交互类型: dialog.prompt('标题', params)

**参数**
dialog.create:
    title?: string;           // 标题.
    content?: string;         // 内容 支持html(仅在type为1的时候支持).
    width?: string;           // 宽度.
    contentHeight?: string;   // 内容固定高度.
    contentMaxHeight?: string;// 内容最大高度.
    definiteFn?: any;         // 确定按钮回调.
    cancelFn?: any;           // 取消按钮回调.
    time?: number;            // 定时关闭 ms.
    timeFn?: any;             // 定时关闭回调.
    definiteBtnText?: string; // 确定按钮文本 默认「确定」.
    cancelBtnText?: string;   // 取消按钮文本 默认「取消」.
    isBtns?: boolean;         // 是否显示按钮 默认显示.  
    isTitle?: boolean;        // 是否显示标题 默认显示.  
    type?: number;            // 弹出层类型 1 通用 2 提示 3 输入交互.
    icon?: number;            // 图标类型 1 成功 2 失败 3 警告 只能在type等于2时使用.
    bgClickHide?: boolean;    // 点击页面其他地方是否允许关闭 默认不关闭.
    isBg?: boolean;           // 是否需要遮照背景 默认需要.
    animType?: number;        // 动画类型 1 跳动(默认) 2 从上到下 3 抖动.
    place?: string;           // 输入框placeholder文本 只能在type等于3时使用.
    preVal?: string;          // 输入框预置内容 只能在type等于3时使用.
    isTextarea?: boolean;      // 当type为3时 输入框是否呈现为textarea 默认呈现input.
    preventCMCancel?: boolean; // 点击确定按钮的时候是否阻止组件消失 默认true.
    createdFn?: any;           // 创建组件完成的回调.
    isCancelBtn?: boolean;   // 是否显示取消按钮.

dialog.alert:
    content?: string;         // 内容 不支持html.
    time?: number;            // 定时关闭 ms.
    timeFn?: any;             // 定时关闭回调.
    definiteBtnText?: string; // 确定按钮文本 默认「确定」.
    definiteFn?: any;         // 确定按钮回调.
    icon?: number;            // 图标类型 1 成功 2 失败 3 警告 只能在type等于2时使用.
    bgClickHide?: boolean;    // 点击页面其他地方是否允许关闭 默认不关闭.
    isBg?: boolean;           // 是否需要遮照背景 默认需要.
    animType?: number;        // 动画类型 1 跳动(默认) 2 从上到下 3 抖动.

dialog.prompt:
    definiteFn?: any;         // 确定按钮回调.
    cancelFn?: any;           // 取消按钮回调.
    definiteBtnText?: string; // 确定按钮文本 默认「确定」.
    cancelBtnText?: string;   // 取消按钮文本 默认「取消」.
    bgClickHide?: boolean;    // 点击页面其他地方是否允许关闭 默认不关闭.
    isBg?: boolean;           // 是否需要遮照背景 默认需要.
    place?: string;           // 输入框placeholder文本 只能在type等于3时使用.
    preVal?: string;          // 输入框预置内容 只能在type等于3时使用.
    isTextarea?: boolean;     // 输入框是否呈现为textarea 默认呈现input.
    animType?: number;        // 动画类型 1 跳动(默认) 2 从上到下 3 抖动.
提示

组件默认提供了alertprompt两个快捷方法,用于快速使用。 除此之外,你还可以使用最强大的create方法来模拟所有的场景。 create方法的所有参数请参考上面的支持部分。