{"_id":"@daflow-ui/ui-dialog","_rev":"3-1e523b964c9a980c760f9fa146328e66","name":"@daflow-ui/ui-dialog","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@daflow-ui/ui-dialog","version":"0.1.0","keywords":["vue","ui","component","daflow","dialog"],"license":"MIT","_id":"@daflow-ui/ui-dialog@0.1.0","maintainers":[{"name":"cuiguojie","email":"cuiguojie@me.com"},{"name":"charicexxuan","email":"xiaoxuan.chang@kanjian.com"}],"dist":{"shasum":"7e366fd6b02f05b60961accb113de7afb6ab1652","tarball":"https://registry.npmjs.org/@daflow-ui/ui-dialog/-/ui-dialog-0.1.0.tgz","fileCount":10,"integrity":"sha512-JXv2HfVlr5Cp6HW9ImqtoH2opPMoKMK+3fs74PRR5hbe0Y3HvvBkX4AwVOD43TgFg+hCyitZBcVfFiZbQBI3Pg==","signatures":[{"sig":"MEUCIQCNyc9ETPnaJmSUiCWPTCE4EMrULDEMU+1wH42StBSIRwIgZ8tKPfIS2Ak6m11pBzoKegOtNgKqOTe95kxc7lupYR4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19530},"main":"./dist/index.js","type":"module","_from":"file:daflow-ui-ui-dialog-0.1.0.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./style.css":"./dist/style.css"},"scripts":{"lint":"eslint .","build":"vite build && vue-tsc -p tsconfig.build.json --emitDeclarationOnly","lint:fix":"eslint . --fix","typecheck":"vue-tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"cuiguojie","email":"cuiguojie@me.com"},"_resolved":"/private/var/folders/vs/64py3jt92l966q_27tfst1xh0000gn/T/a59bae7cdc3da52a1980b536b85d4b92/daflow-ui-ui-dialog-0.1.0.tgz","_integrity":"sha512-JXv2HfVlr5Cp6HW9ImqtoH2opPMoKMK+3fs74PRR5hbe0Y3HvvBkX4AwVOD43TgFg+hCyitZBcVfFiZbQBI3Pg==","_npmVersion":"10.9.2","description":"Dialog component for DaFlow UI","directories":{},"sideEffects":["**/*.css"],"_nodeVersion":"22.17.0","dependencies":{"@ark-ui/vue":"5.30.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vue":"^3.5.27","vite":"^7.3.1","eslint":"^9.39.2","vue-tsc":"^3.2.4","typescript":"^5.9.3","@types/node":"^22.10.5","sass-embedded":"^1.97.3","@vue/compiler-sfc":"^3.5.27","@vitejs/plugin-vue":"^6.0.3","vite-plugin-vue-devtools":"^8.0.5","@seemusic/eslint-config-vue3":"^2.0.0"},"peerDependencies":{"vue":"^3.5.0"},"_npmOperationalInternal":{"tmp":"tmp/ui-dialog_0.1.0_1773730175627_0.7621243619435769","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@daflow-ui/ui-dialog","version":"0.1.1","keywords":["vue","ui","component","daflow","dialog"],"license":"MIT","_id":"@daflow-ui/ui-dialog@0.1.1","maintainers":[{"name":"cuiguojie","email":"cuiguojie@me.com"},{"name":"charicexxuan","email":"xiaoxuan.chang@kanjian.com"}],"dist":{"shasum":"1e253867c5f89455bb1bd866000a16eb8187acfb","tarball":"https://registry.npmjs.org/@daflow-ui/ui-dialog/-/ui-dialog-0.1.1.tgz","fileCount":10,"integrity":"sha512-j6sk1wt0ZEX/k+zOUe6+nHuflN/Yejynp05m8QVogvAs1cjvW9QlhQ9dNJvASOkZ7gk3EcjL5b+n73WuUaSxVQ==","signatures":[{"sig":"MEYCIQCV3yKeaIhcvIwq4bcR1rb+HC+a7F6xX4r/JYgwlmjvbgIhAI9UytmJKUwuDm5INfw66NRGsW7wZZaiz4aaYCUryaxs","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":24359},"main":"./dist/index.js","type":"module","_from":"file:daflow-ui-ui-dialog-0.1.1.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./style.css":"./dist/style.css"},"scripts":{"lint":"eslint .","build":"vite build && vue-tsc -p tsconfig.build.json --emitDeclarationOnly","lint:fix":"eslint . --fix","typecheck":"vue-tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"charicexxuan","email":"xiaoxuan.chang@kanjian.com"},"_resolved":"/private/var/folders/pc/vbwk747s1mn2dnbr__fbrfrc0000gn/T/fab688b5e5809518ee5bcbdf8ae302be/daflow-ui-ui-dialog-0.1.1.tgz","_integrity":"sha512-j6sk1wt0ZEX/k+zOUe6+nHuflN/Yejynp05m8QVogvAs1cjvW9QlhQ9dNJvASOkZ7gk3EcjL5b+n73WuUaSxVQ==","_npmVersion":"10.9.2","description":"Dialog component for DaFlow UI","directories":{},"sideEffects":["**/*.css"],"_nodeVersion":"22.17.0","dependencies":{"@ark-ui/vue":"5.30.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vue":"^3.5.27","vite":"^7.3.1","eslint":"^9.39.2","vue-tsc":"^3.2.4","typescript":"^5.9.3","@types/node":"^22.10.5","sass-embedded":"^1.97.3","@vue/compiler-sfc":"^3.5.27","@vitejs/plugin-vue":"^6.0.3","vite-plugin-vue-devtools":"^8.0.5","@seemusic/eslint-config-vue3":"^2.0.0"},"peerDependencies":{"vue":"^3.5.0"},"_npmOperationalInternal":{"tmp":"tmp/ui-dialog_0.1.1_1776843118266_0.46953247039924584","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@daflow-ui/ui-dialog","version":"0.1.2","description":"Dialog component for DaFlow UI","type":"module","license":"MIT","sideEffects":["**/*.css"],"publishConfig":{"access":"public"},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./style.css":"./dist/style.css"},"dependencies":{"@ark-ui/vue":"5.30.0"},"peerDependencies":{"vue":"^3.5.0"},"devDependencies":{"@seemusic/eslint-config-vue3":"^2.0.0","@types/node":"^22.10.5","@vitejs/plugin-vue":"^6.0.3","@vue/compiler-sfc":"^3.5.27","eslint":"^9.39.2","sass-embedded":"^1.97.3","typescript":"^5.9.3","vite":"^7.3.1","vite-plugin-vue-devtools":"^8.0.5","vue":"^3.5.27","vue-tsc":"^3.2.4"},"keywords":["vue","ui","component","daflow","dialog"],"scripts":{"build":"vite build && vue-tsc -p tsconfig.build.json --emitDeclarationOnly","lint":"eslint .","lint:fix":"eslint . --fix","typecheck":"vue-tsc -p tsconfig.json --noEmit"},"_id":"@daflow-ui/ui-dialog@0.1.2","_integrity":"sha512-kyheGxOKwr532nJCe/ncof26FNkrZWoYL6wnqAi1o1+Hr4HQ40AeQSBUfSV4xuc5S1JPeIZfFi7Hz5EH7+I/OA==","_resolved":"/private/var/folders/pc/vbwk747s1mn2dnbr__fbrfrc0000gn/T/c41474b2bebbd638b7d643f3951d3549/daflow-ui-ui-dialog-0.1.2.tgz","_from":"file:daflow-ui-ui-dialog-0.1.2.tgz","_nodeVersion":"22.17.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-kyheGxOKwr532nJCe/ncof26FNkrZWoYL6wnqAi1o1+Hr4HQ40AeQSBUfSV4xuc5S1JPeIZfFi7Hz5EH7+I/OA==","shasum":"f1cf917108484b1b205a7ffdeaef35e78c371c1b","tarball":"https://registry.npmjs.org/@daflow-ui/ui-dialog/-/ui-dialog-0.1.2.tgz","fileCount":10,"unpackedSize":24654,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFDOtVW+tnxPLCP1LL0qTRd5j2yCih5YWhxhw428vXrpAiEAtoDRVGni2bakmJuTUx0DeNdNkg0SkRckfOWwF2P6ilI="}]},"_npmUser":{"name":"charicexxuan","email":"xiaoxuan.chang@kanjian.com"},"directories":{},"maintainers":[{"name":"cuiguojie","email":"cuiguojie@me.com"},{"name":"charicexxuan","email":"xiaoxuan.chang@kanjian.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ui-dialog_0.1.2_1776846858816_0.13766811315475302"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-17T06:49:35.566Z","modified":"2026-04-22T08:34:19.113Z","0.1.0":"2026-03-17T06:49:35.774Z","0.1.1":"2026-04-22T07:31:58.414Z","0.1.2":"2026-04-22T08:34:18.952Z"},"license":"MIT","keywords":["vue","ui","component","daflow","dialog"],"description":"Dialog component for DaFlow UI","maintainers":[{"name":"cuiguojie","email":"cuiguojie@me.com"},{"name":"charicexxuan","email":"xiaoxuan.chang@kanjian.com"}],"readme":"# @daflow-ui/ui-dialog\n\nDialog component for DaFlow UI.\n\n## Installation\n\n```bash\npnpm add @daflow-ui/ui-dialog\n```\n\n## Usage\n\n全局引入样式（在 `main.ts` 中）：\n\n```ts\nimport '@daflow-ui/ui-dialog/style.css';\n```\n\n在组件中使用：\n\n```vue\n<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { DfDialog } from '@daflow-ui/ui-dialog';\n\nconst open = ref(false);\n</script>\n\n<template>\n  <button @click=\"open = true\">\n    打开对话框\n  </button>\n\n  <DfDialog v-model=\"open\" title=\"基础对话框\">\n    <p>这是对话框的主体内容。</p>\n\n    <template #footer>\n      <button @click=\"open = false\">\n        关闭\n      </button>\n    </template>\n  </DfDialog>\n</template>\n```\n\n## Props\n\n| Prop | Type | Default | Description |\n|------|------|---------|-------------|\n| `modelValue` | `boolean` | `false` | 控制显示/隐藏 |\n| `title` | `string` | — | 标题文字；存在 `header` slot 时不生效 |\n| `id` | `string` | 自动生成 | Dialog 根 id；只接受字母、数字、`-` 和 `_`；非法值会在开发环境告警，并回退到内部生成的安全 id |\n| `ids` | `Partial<DialogIds>` | 自动生成 | 覆盖 `trigger / content / positioner / backdrop / title / description / closeTrigger` 的最终 DOM id；各项只接受字母、数字、`-` 和 `_`，非法值会回退到默认派生 id |\n| `width` | `string \\| number` | `'640px'` | 宽度，传 `number` 自动加 `px` |\n| `fullscreen` | `boolean` | `false` | 是否以全屏布局渲染 Dialog |\n| `destroyOnClose` | `boolean` | `false` | 关闭后销毁内容 DOM，下次打开重新挂载 |\n| `closeOnBackdropClick` | `boolean` | `true` | 点击遮罩是否关闭 |\n| `closeOnEscape` | `boolean` | `true` | 按 `ESC` 是否关闭 |\n| `restoreFocus` | `boolean` | `true` | 关闭时是否恢复焦点到打开前的元素 |\n| `initialFocusEl` | `() => HTMLElement \\| null` | — | 指定 Dialog 打开时的初始焦点元素 |\n| `finalFocusEl` | `() => HTMLElement \\| null` | 自动回退 | 指定 Dialog 关闭时的返回焦点元素；未传时优先回退到打开前缓存的 activeElement |\n| `showClose` | `boolean` | `true` | 是否显示右上角关闭按钮；存在 `header` slot 时不生效 |\n| `beforeClose` | `() => void \\| boolean \\| Promise<void \\| boolean>` | — | 关闭前拦截，显式返回 `false` 阻止关闭 |\n\n## Emits\n\n| Event | Payload | Description |\n|-------|---------|-------------|\n| `update:modelValue` | `boolean` | `v-model` 同步 |\n| `open` | — | 开始打开时触发 |\n| `opened` | — | 打开动画结束后触发 |\n| `close` | — | 开始关闭时触发 |\n| `closed` | — | 关闭动画结束后触发 |\n\n## Slots\n\n| Slot | Description |\n|------|-------------|\n| `default` | 主体内容区，内容过长时 body 区域自动滚动 |\n| `header` | 自定义头部，完全替换默认头部结构；`title`、内置关闭按钮和默认头部内边距都不会保留 |\n| `footer` | 底部操作区，内置布局与间距，不含预置按钮 |\n\n## Notes\n\n- 始终 Teleport 到 `body`\n- 遮罩始终存在，不暴露 `modal` 开关\n- body scroll 锁定由 Ark UI 处理\n- `class` 会透传到 content 根节点\n- `body-inner` 是内部布局用 `data-part`，当前不作为公开 selector contract 承诺\n- 默认会生成不含冒号的安全 ids；显式传入的 `id` / `ids` 不会被静默改写，非法值会在开发环境告警并回退到安全默认值\n- 如需稳定控制打开/关闭时的焦点行为，优先使用 `initialFocusEl` 与 `finalFocusEl`\n\n## Development\n\n### Install dependencies\n\n```bash\npnpm install\n```\n\n### Start playground (at monorepo root)\n\n```bash\ncd ../..\npnpm dev\n```\n\n### Build\n\n```bash\npnpm build\n```\n\n### Type check\n\n```bash\npnpm typecheck\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}