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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@94ai-plus/nf-confirm

v1.0.0

Published

Vue 3 confirmation dialogs with per-instance promises, asynchronous callbacks and dual themes

Readme

@94ai-plus/nf-confirm

HomePage

官网 · 项目仓库

Vue 3 确认对话框,保留旧版外观、四种状态、异步 loading、取消/确认回调与 Promise 调用。基于 Element Plus Dialog,支持 Chalk/OEM 主题和八语言默认按钮。

Installation

yarn add @94ai-plus/nf-confirm @94ai-plus/nf-theme-chalk vue element-plus

Usage

import NfConfirm, { Confirm } from '@94ai-plus/nf-confirm'
import 'element-plus/dist/index.css'
import '@94ai-plus/nf-theme-chalk/nf-confirm.css'

app.use(NfConfirm) // Options API: this.$openConfirm(options)

Confirm({ title: 'Delete', message: 'Delete this item?' })
  .then(async done => {
    try { await save(); done() }
    catch { done(false) }
  })
  .catch(() => { /* cancelled */ })

// Callback form: use this for retryable operations.
Confirm({
  title: 'Save',
  onConfirm: async done => {
    try { await save(); done() }
    catch { done(false) }
  },
  onCancel: done => done(),
})

默认导出是组件插件,可调用服务是具名 Confirm。setup 中可用 useConfirm() 继承当前 provider 的注入/语言并在卸载时清理;createConfirm(appContext) 创建应用服务。直接 Confirm 不隐式绑定最后安装的应用,可通过第二参数传入 appContext。组件也支持 v-model/v-model:visible、默认插槽和类型化 ref.close()。

API

title/message 默认空字符串(message 支持 VNode),width 默认 400,type 默认空(无图标),可设 success/info/warning/error。iconClass/customClass 默认空;有效 type 图标优先于自定义图标。dangerouslyUseHTMLString 默认 false,仅用于可信 HTML。cancelButtonText/confirmButtonText 未传时跟随八语言,显式空字符串会保留。

onConfirm(done)/onCancel(done) 不自动关闭;done() 关闭,done(false) 只清除 loading,可再次尝试。确认时进入 loading,重复确认被阻止。没有自定义 onConfirm 时,Promise 在确认时 resolve(done),保持弹窗直至业务调用 done;取消 reject(undefined)。已有 Promise resolved 后调用 done(false) 不会创建新 Promise,重试请使用 onConfirm。

有自定义回调时,Promise 在回调调用 done() 后按确认/取消结算,done(false) 保持待定。同步异常或异步拒绝会清除 loading 并 reject(error),不自动关闭;业务可捕获错误并自行决定是否保留。过期操作的 done 不会影响后续操作或重新打开的弹窗。Escape 按取消处理,遮罩点击不关闭,不提供右上角关闭按钮。

Confirm.closeAll() 关闭页面所有 Confirm;应用/provider 专属服务的 closeAll 只处理自身实例,不影响 Message/Notification。SSR 返回 resolve(空操作 done) 的 Promise,不访问 DOM;卸载时关闭并清理实例,不再暴露 Vue 2 私有实例。弹窗挂到 body,组件主题跟随根 data-nf-theme。

Build outputs

提供 ESM、CJS、browser ES/UMD、类型和 CSS。UMD 全局名 NfConfirm,外置 Vue/ElementPlus,同仓依赖打包。主题含 nf-confirm.css 与 SCSS,OEM 使用 @94ai-plus/nf-theme-oem/nf-confirm.css。

对话框文档

全局默认配置

通过总包的 NfConfigProvider 的 nfConfirm 配置项设置默认属性。支持响应式更新和嵌套继承,优先级为组件显式属性 → 最近一层配置 → 外层配置 → 组件原有默认值。undefined 继续继承,false、0 和空字符串保留;按属性合并,数组、对象和函数整体替换,不深度合并。初始化选项仍按组件原有生命周期生效,事件、插槽和原生 attributes 在组件上设置,必填业务数据仍需显式提供。详见全局配置文档。

在 Provider 后代组件的 setup 中调用 useConfirm(),由返回的服务继承当前 Provider 的默认属性与语言;单次调用传入的选项优先,组件卸载时清理该服务创建的弹层。无应用/组件上下文的直接服务调用不读取组件树配置。

import { useConfirm } from '@94ai-plus/nf-confirm'

// 在 Provider 后代组件的 setup 中执行
const confirm = useConfirm()
confirm({ title: '提示', message: '确定继续吗?' })
  .then(done => done())
  .catch(() => { /* 用户取消 */ })

Contributors

感谢每一位参与项目建设的贡献者!

最近三个月的贡献者气泡图

最近三个月的贡献者头像墙(使用姓名首字母)

以上为随本版本发布的贡献者统计快照,统计日期与分支见图中说明;仅统计 Git 非合并提交,头像使用姓名首字母,不是 GitLab 个人照片。

License

本项目采用 MIT License 开源许可。

Copyright (c) 2026-present Jiahe Zou, 94 Intelligent Technology Co., Ltd.