@robot-admin/naive-ui-components 0.37.0 → 0.37.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +24 -3
  3. package/README_EN.md +23 -2
  4. package/dist/C_Captcha.d.ts +1 -1
  5. package/dist/C_DataPicker.d.ts +0 -1
  6. package/dist/C_Density2.cjs +1 -1
  7. package/dist/C_Density2.js +1 -1
  8. package/dist/C_Form.d.cts +1 -1
  9. package/dist/C_Form.d.ts +2 -1
  10. package/dist/C_FormModal.d.ts +2 -1
  11. package/dist/C_FormSearch.d.ts +2 -2
  12. package/dist/C_Icon2.cjs +1 -1
  13. package/dist/C_Icon2.js +1 -1
  14. package/dist/C_Login.d.ts +1 -1
  15. package/dist/C_Steps.css +39 -39
  16. package/dist/C_Steps2.cjs +1 -1
  17. package/dist/C_Steps2.js +1 -1
  18. package/dist/C_Table.base.css +127 -111
  19. package/dist/C_Table.cjs +1 -1
  20. package/dist/C_Table.css +127 -111
  21. package/dist/C_Table.d.cts +1 -1
  22. package/dist/C_Table.d.ts +2 -3
  23. package/dist/C_Table.js +1 -1
  24. package/dist/C_Table2.cjs +4 -4
  25. package/dist/C_Table2.js +4 -4
  26. package/dist/C_Tree.d.ts +0 -1
  27. package/dist/C_UserPicker.d.ts +0 -1
  28. package/dist/C_WorkFlow.d.ts +0 -1
  29. package/dist/component-config.d.ts +1723 -2
  30. package/dist/config.cjs +1 -1
  31. package/dist/config.d.cts +2 -2
  32. package/dist/config.d.ts +3 -2
  33. package/dist/config.js +1 -1
  34. package/dist/constants3.d.cts +5 -5
  35. package/dist/constants3.d.ts +5 -5
  36. package/dist/constants4.d.cts +4 -4
  37. package/dist/constants4.d.ts +4 -4
  38. package/dist/constants5.d.cts +2 -2
  39. package/dist/constants5.d.ts +2 -2
  40. package/dist/context.cjs +1 -1
  41. package/dist/context.d.cts +1118 -3
  42. package/dist/context.js +1 -1
  43. package/dist/data2.d.cts +9 -9
  44. package/dist/data2.d.ts +9 -9
  45. package/dist/dateRange.d.ts +1 -1
  46. package/dist/editors.d.cts +9 -7
  47. package/dist/editors.d.ts +9 -7
  48. package/dist/index.cjs +1 -1
  49. package/dist/index.d.cts +2 -2
  50. package/dist/index.d.ts +2 -3
  51. package/dist/index.js +1 -1
  52. package/dist/index.vue.d.cts +3 -3
  53. package/dist/index.vue.d.ts +3 -3
  54. package/dist/index10.vue.d.ts +2 -2
  55. package/dist/index11.vue.d.cts +2 -2
  56. package/dist/index11.vue.d.ts +4 -4
  57. package/dist/index12.vue.d.cts +4 -4
  58. package/dist/index13.vue.d.ts +1 -1
  59. package/dist/index14.vue.d.cts +1 -1
  60. package/dist/index15.vue.d.ts +3 -3
  61. package/dist/index16.vue.d.cts +3 -3
  62. package/dist/index16.vue.d.ts +2 -2
  63. package/dist/index17.vue.d.cts +2 -2
  64. package/dist/index17.vue.d.ts +6 -6
  65. package/dist/index18.vue.d.cts +6 -6
  66. package/dist/index18.vue.d.ts +1 -1
  67. package/dist/index19.vue.d.cts +1 -1
  68. package/dist/index24.vue.d.cts +2 -2
  69. package/dist/index24.vue.d.ts +2 -2
  70. package/dist/index27.vue.d.cts +1 -1
  71. package/dist/index27.vue.d.ts +1 -1
  72. package/dist/index28.vue.d.cts +2 -2
  73. package/dist/index28.vue.d.ts +2 -2
  74. package/dist/index3.vue.d.cts +3 -3
  75. package/dist/index3.vue.d.ts +3 -3
  76. package/dist/index31.vue.d.cts +3 -3
  77. package/dist/index31.vue.d.ts +3 -3
  78. package/dist/index32.vue.d.cts +2 -2
  79. package/dist/index32.vue.d.ts +2 -2
  80. package/dist/index4.vue.d.cts +6 -6
  81. package/dist/index4.vue.d.ts +6 -6
  82. package/dist/index8.vue.d.ts +2 -2
  83. package/dist/index9.vue.d.cts +2 -2
  84. package/dist/mapUtils.d.cts +4 -4
  85. package/dist/mapUtils.d.ts +4 -4
  86. package/dist/style.css +166 -150
  87. package/dist/types3.d.ts +5 -1119
  88. package/dist/types4.d.cts +5 -1119
  89. package/dist/types6.d.ts +2 -1
  90. package/dist/types7.d.cts +2 -1
  91. package/dist/useCollapsePanel.d.cts +2 -2
  92. package/dist/useCollapsePanel.d.ts +2 -2
  93. package/dist/useCropperCore.d.cts +9 -9
  94. package/dist/useCropperCore.d.ts +9 -9
  95. package/dist/useDynamicFormState.d.cts +3 -3
  96. package/dist/useDynamicFormState.d.ts +3 -3
  97. package/dist/useEdgeInteraction.d.cts +2 -2
  98. package/dist/useEdgeInteraction.d.ts +2 -2
  99. package/dist/useFormRenderer.d.cts +1 -1
  100. package/dist/useFormRenderer.d.ts +1 -1
  101. package/dist/useFullscreen.d.cts +1 -1
  102. package/dist/useFullscreen.d.ts +1 -1
  103. package/dist/useInfiniteScroll.d.cts +5 -5
  104. package/dist/useInfiniteScroll.d.ts +5 -5
  105. package/dist/useQRCode.d.cts +4 -4
  106. package/dist/useQRCode.d.ts +4 -4
  107. package/dist/useSignatureHistory.d.cts +2 -2
  108. package/dist/useSignatureHistory.d.ts +2 -2
  109. package/dist/useSplitResize.d.cts +6 -6
  110. package/dist/useSplitResize.d.ts +6 -6
  111. package/dist/useWorkflowValidation.d.cts +84 -84
  112. package/dist/useWorkflowValidation.d.ts +84 -84
  113. package/dist/verification.d.cts +2 -2
  114. package/dist/verification.d.ts +2 -2
  115. package/docs/guides/table-density.md +19 -2
  116. package/docs/guides/theme.md +2 -0
  117. package/package.json +1 -1
  118. package/dist/context.d.ts +0 -610
  119. package/dist/useTableGlobalConfig.cjs +0 -1
  120. package/dist/useTableGlobalConfig.js +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @robot-admin/naive-ui-components
2
2
 
3
+ ## 0.37.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 启用已有全局 `persistPrefix`,按应用提供的范围与表 ID 隔离列偏好;未就绪时禁用存储,切换范围清理临时宽度及原生缓存,待提交内容仍写回原范围。补齐区域密度的范围转发和轻量配置入口,保留无范围项目的旧键兼容。
8
+
9
+ - 修复自动列保存手动宽度后丢失默认省略与最小宽度的问题,保持单行、完整表头与原始展示配置;连续缩列不再挤高数据行。
10
+
11
+ 操作列默认固定右侧,缩列余量由包内原生呈现投影承接;其他业务列宽度、偏好与导出保持独立。兼容分组、跨列合并、合计、横向虚拟化及列排序,不增加公开配置或逐行测量。
12
+
13
+ ## 0.37.1
14
+
15
+ ### Patch Changes
16
+
17
+ - 步骤条的单个 Iconify 名称和 `i-` 前缀图标通过共享图标组件渲染,不再要求宿主生成对应 CSS;只在使用这类图标时加载图标运行时,默认步骤与旧 CSS 类用法保持轻量。原有组合类、步骤状态与点击行为继续兼容。
18
+
3
19
  ## 0.37.0
4
20
 
5
21
  ### Minor Changes
package/README.md CHANGED
@@ -33,7 +33,7 @@
33
33
  | 按需消费 | 63 个独立组件入口、自动导入 Resolver、组件样式入口,以及表单/表格的基础样式层级 |
34
34
  | 独立接入 | 支持全量注册与局部导入;反馈、文案和全局配置可由宿主提供,表单弹窗可接入结构兼容的 Headless CRUD |
35
35
 
36
- 组件库负责界面与交互。业务接口、身份权限、上传服务和第三方平台配置由应用接入。当前仓库版本 **0.37.0**,版本变化见 [CHANGELOG](./CHANGELOG.md)。
36
+ 组件库负责界面与交互。业务接口、身份权限、上传服务和第三方平台配置由应用接入。当前仓库版本 **0.37.2**,版本变化见 [CHANGELOG](./CHANGELOG.md)。
37
37
 
38
38
  0.33 增强树的远程路径定位、分组选项、搜索字段设置和表格编辑契约,并保留原有默认用法。见[兼容接入与独立演示](./docs/guides/component-contracts.md)。
39
39
 
@@ -140,6 +140,27 @@ bun add vue@^3.5.3 naive-ui@^2.35.0
140
140
 
141
141
  表单内置提交、重置与校验流程。实际保存时,将异步请求放入 `config.onSubmit` 并等待完成;`@submit` 用于完成通知。表单布局、验证规则、弹窗与远程表格示例见[使用指南](./docs/guides/usage.md)。
142
142
 
143
+ ### 表格偏好按账号隔离
144
+
145
+ 应用启动时注册一次。`session` 是项目已有的响应式身份状态,未登录或身份尚未就绪时为 `undefined`:
146
+
147
+ ```ts
148
+ import { TABLE_GLOBAL_CONFIG_KEY } from '@robot-admin/naive-ui-components/config'
149
+
150
+ app.provide(TABLE_GLOBAL_CONFIG_KEY, {
151
+ get persistPrefix() {
152
+ const scope = session.value
153
+ return scope
154
+ ? JSON.stringify([scope.tenantId, scope.companyId, scope.userId])
155
+ : undefined
156
+ },
157
+ })
158
+ ```
159
+
160
+ 页面只配置稳定表 ID,如 `config: { persistKey: 'shipping' }`。组件分别保存各范围的列显隐、顺序和宽度,不改写业务列定义;`C_Density` 内同样生效。`/config` 是轻量入口,与 `/C_Table` 导出同一个配置键。
161
+
162
+ 启动时就声明该 getter;切换账号只更新响应式身份值,不删除字段。显式 `persistPrefix` 为 `undefined`、空串或空白时不读取、写入偏好,也不回退旧缓存。未配置 `persistPrefix` 的项目保留旧键;没有 `persistKey` 的表格仅保留临时设置,并在范围变化时清空。详见[表格偏好与作用域](./docs/guides/table-density.md#表格偏好与作用域)。
163
+
143
164
  ## 按需加载与样式
144
165
 
145
166
  ### 选择导入方式
@@ -260,10 +281,10 @@ const columns = [
260
281
 
261
282
  状态列复用 Naive UI 标签和主题。支持 `success/warning/danger/info/neutral`,也支持 Naive 的 `error/default/primary` 和 CSS 颜色。未知代码保持中性;`0/false` 是有效值,空值保留空态。显式 render 优先;formatter 文字会用于默认颜色判断和测宽。状态配置只改变展示,不会改写数据、排序、筛选或导出。
262
283
 
263
- 默认智能布局会在缓存的内容基准上分配可用宽度;空间充足时自动业务列按基准比例铺满,空间不足时不压缩表头。最终数值列宽总和同时决定表格与横向滚动范围,`scrollX` 不再挑某一列单独撑大。拖动只改变目标列,偏好提交后不重新分配余量。需要 Naive UI 原生铺满或强制最小滚动宽度时,显式传 `table-layout="fixed"` / `table-layout="auto"`;百分比等非数值列宽也沿用原生布局。
284
+ 默认智能布局会在缓存的内容基准上分配可用宽度;空间充足时自动业务列按基准比例铺满,空间不足时不压缩表头。数值列宽控制业务列与横向滚动,`scrollX` 不再挑某一列单独撑大。拖动只改变目标列,保存后继续保留原来的单行省略、提示和默认下限。操作列默认固定右侧;缩列后空余画布由包内承接,右固定区持续贴住视口,其他业务列保持原宽。需要 Naive UI 原生铺满或强制最小滚动宽度时,显式传 `table-layout="fixed"` / `table-layout="auto"`;百分比等非数值列宽也沿用原生布局。
264
285
 
265
286
  测宽不额外挂载或执行 render;图标、进度条和复杂自定义内容请显式指定 width。数据与列配置更新会触发新的有界测量,配置和缓存只属于当前组件实例。此版本将未声明宽度的业务列由自然布局改为有界内容宽度;既有显式布局及原生 table-layout 覆盖仍保留。
266
287
 
267
- 表头默认完整展示,不随单元格 ellipsis 配置省略。所有业务列的最小宽度计入完整标题及排序/筛选控件;初始布局、显式窄列宽、恢复列设置与拖拽缩列均受此下限保护。360px 仅限制数据内容测宽;标题更长时允许超过该值,并使用表格内部横向滚动。复杂自定义标题请配置 minWidth。
288
+ 表头默认完整展示,不随单元格 ellipsis 配置省略。所有业务列的最小宽度计入完整标题及排序/筛选控件;初始布局、显式窄列宽、恢复列设置与拖拽缩列均受此下限保护。360px 仅限制数据内容测宽;标题更长时允许超过该值,并使用表格内部横向滚动。复杂自定义标题请配置 minWidth。 自动列内的原生链接、按钮随省略容器收缩,悬停可查看完整内容;明确配置 `ellipsis: false` 时保留多行呈现。
268
289
 
269
290
  紧凑表单与搜索的纵向间距收紧至 4px,空反馈区 2px,校验按内容自然撑高。表单弹窗同步收紧并支持内部滚动;移除逐字段排队入场和布局尺寸动画。详情的左右同排展示见 Robot_Admin 产销模块。
package/README_EN.md CHANGED
@@ -33,7 +33,7 @@
33
33
  | Selective loading | 63 component entries, an auto-import resolver, component CSS and base styles for forms and tables |
34
34
  | Application integration | Global registration or local imports; injectable feedback, locale and defaults; form dialogs compatible with structurally matching headless CRUD controllers |
35
35
 
36
- The library handles UI and interaction. Applications supply business APIs, authentication, authorization, upload services and platform configuration. The current repository version is **0.37.0**. See the [changelog](./CHANGELOG.md) for release details.
36
+ The library handles UI and interaction. Applications supply business APIs, authentication, authorization, upload services and platform configuration. The current repository version is **0.37.2**. See the [changelog](./CHANGELOG.md) for release details.
37
37
 
38
38
  0.33 adds optional remote tree paths, grouped options, search field settings and table editing contracts while retaining existing defaults. See the [compatibility and standalone demo guide](./docs/guides/component-contracts.md) (Chinese).
39
39
 
@@ -140,6 +140,27 @@ Place this example in `App.vue`. It uses a component subpath and its CSS entry,
140
140
 
141
141
  The form includes submission, reset and validation. For persistence, await your async request inside `config.onSubmit`; use `@submit` for completion notifications. See the [usage guide](./docs/guides/usage.en.md) for layouts, validation rules, dialogs and remote tables.
142
142
 
143
+ ### Scope table preferences per account
144
+
145
+ Register once when the app starts. `session` is your existing reactive identity state; keep it `undefined` until the identity is fully resolved:
146
+
147
+ ```ts
148
+ import { TABLE_GLOBAL_CONFIG_KEY } from '@robot-admin/naive-ui-components/config'
149
+
150
+ app.provide(TABLE_GLOBAL_CONFIG_KEY, {
151
+ get persistPrefix() {
152
+ const scope = session.value
153
+ return scope
154
+ ? JSON.stringify([scope.tenantId, scope.companyId, scope.userId])
155
+ : undefined
156
+ },
157
+ })
158
+ ```
159
+
160
+ Each page only supplies a stable table ID, such as `config: { persistKey: 'shipping' }`. Column visibility, order and widths are stored per scope without mutating business column definitions, including inside `C_Density`. The lightweight `/config` entry exports the same configuration key as `/C_Table`.
161
+
162
+ Declare the getter at startup and change its reactive value when accounts change; do not remove the field. An explicitly configured prefix that is `undefined`, empty or whitespace disables preference reads and writes, without falling back to legacy caches. Omitting `persistPrefix` retains legacy keys. Tables without `persistKey` keep settings only in memory and clear them on scope changes. See the [scope guide](./docs/guides/table-density.md#表格偏好与作用域) (Chinese).
163
+
143
164
  ## Imports and styles
144
165
 
145
166
  ### Choose an import strategy
@@ -239,7 +260,7 @@ See [development and build](./docs/engineering.en.md) for individual checks and
239
260
 
240
261
  ## Content widths and status columns (0.24)
241
262
 
242
- Columns without `width` now measure their header and up to 100 evenly sampled loaded rows, using formatted values and status labels. Content measurement bases default to 80–360px; final automatic widths may grow proportionally to fill available space. Use `minWidth/maxWidth` to adjust the bounds. Explicit widths (including native strings), saved column widths and `display.columnWidth` take precedence. `autoWidth: false` restores the 180px default. Long automatic cells use ellipsis and a tooltip; horizontal virtualization uses the same numeric widths.
263
+ Columns without `width` now measure their header and up to 100 evenly sampled loaded rows, using formatted values and status labels. Content measurement bases default to 80–360px; final automatic widths may grow proportionally to fill available space. Saving a manual width preserves the original ellipsis, tooltip and default minimum. Action columns default to the right edge; the internal canvas absorbs spare space after shrinking without resizing peer business columns. Native links and buttons inside an ellipsis cell also shrink with a trailing ellipsis. Use `minWidth/maxWidth` to adjust the bounds. Explicit widths (including native strings), saved column widths and `display.columnWidth` take precedence. `autoWidth: false` restores the 180px default. Long automatic cells use ellipsis and a tooltip; horizontal virtualization uses the same numeric widths.
243
264
 
244
265
  Use `{ key: 'status', status: true }` for themed status tags, or `status: { S1B: { label: 'Review', color: 'danger' }, S1C: 'success' }`. Semantic colors and CSS colors are supported. Unknown codes stay neutral, zero/false stay valid, and explicit render functions win. Display changes never rewrite data or export policy. Measurement does not invoke render functions; give graphical/custom columns explicit widths. Data and column updates remeasure a bounded sample; all caches remain component-local.
245
266
 
@@ -1,4 +1,4 @@
1
- import "./context.js";
1
+ import "./types.js";
2
2
  import "./component-config.js";
3
3
  import { a as CaptchaEmits, c as CaptchaProps, d as CaptchaVerificationRequest, f as CaptchaVerificationResult, i as _default, l as CaptchaProvider, n as createCaptchaProof, o as CaptchaInstance, p as CaptchaVerifier, r as verifyCaptchaProof, s as CaptchaProof, t as CaptchaVerificationError, u as CaptchaSuccessPayload } from "./verification.js";
4
4
  export { _default as C_Captcha, type CaptchaEmits, type CaptchaInstance, type CaptchaProof, type CaptchaProps, type CaptchaProvider, type CaptchaSuccessPayload, CaptchaVerificationError, type CaptchaVerificationRequest, type CaptchaVerificationResult, type CaptchaVerifier, createCaptchaProof, verifyCaptchaProof };
@@ -1,5 +1,4 @@
1
1
  import "./types.js";
2
- import "./context.js";
3
2
  import "./component-config.js";
4
3
  import { a as DataPickerNavigationContext, c as DataPickerRequest, d as DataPickerSource, f as DataPickerSourceInput, i as DataPickerNavigation, l as DataPickerSelectedItem, n as DataPickerExpose, o as DataPickerNavigationNode, p as DataPickerValue, r as DataPickerHistoryOptions, s as DataPickerProps, t as DataPickerEmits, u as DataPickerSelectionContext } from "./types3.js";
5
4
  import { n as _default, t as createDataPickerField } from "./formField.js";
@@ -1 +1 @@
1
- require(`./chunk.cjs`);const e=require(`./context.cjs`),t=require(`./useTableGlobalConfig.cjs`);let n=require(`vue`);const r=(0,n.defineComponent)({name:`C_Density`,__name:`index`,props:{density:{}},setup(r){let i=r,a=(0,n.inject)(e.i,{}),o=(0,n.inject)(t.t,{}),s=(0,n.computed)(()=>i.density);return(0,n.provide)(e.t,s),(0,n.provide)(e.i,(0,n.reactive)({...a,density:s})),(0,n.provide)(t.t,(0,n.reactive)({...o,defaults:{...o.defaults,density:s}})),(e,t)=>(0,n.renderSlot)(e.$slots,`default`)}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return r}});
1
+ require(`./chunk.cjs`);const e=require(`./context.cjs`);let t=require(`vue`);const n=(0,t.defineComponent)({name:`C_Density`,__name:`index`,props:{density:{}},setup(n){let r=n,i=(0,t.inject)(e.i,{}),a=(0,t.inject)(e.a,{}),o=(0,t.computed)(()=>r.density);(0,t.provide)(e.t,o),(0,t.provide)(e.i,(0,t.reactive)({...i,density:o}));let s={...a,defaults:{...a.defaults,density:o}};return`persistPrefix`in a&&Object.defineProperty(s,`persistPrefix`,{enumerable:!0,configurable:!0,get:()=>a.persistPrefix}),(0,t.provide)(e.a,(0,t.reactive)(s)),(e,n)=>(0,t.renderSlot)(e.$slots,`default`)}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
@@ -1 +1 @@
1
- import{i as e,t}from"./context.js";import{t as n}from"./useTableGlobalConfig.js";import{computed as r,defineComponent as i,inject as a,provide as o,reactive as s,renderSlot as c}from"vue";const l=i({name:`C_Density`,__name:`index`,props:{density:{}},setup(i){let l=i,u=a(e,{}),d=a(n,{}),f=r(()=>l.density);return o(t,f),o(e,s({...u,density:f})),o(n,s({...d,defaults:{...d.defaults,density:f}})),(e,t)=>c(e.$slots,`default`)}});export{l as t};
1
+ import{a as e,i as t,t as n}from"./context.js";import{computed as r,defineComponent as i,inject as a,provide as o,reactive as s,renderSlot as c}from"vue";const l=i({name:`C_Density`,__name:`index`,props:{density:{}},setup(i){let l=i,u=a(t,{}),d=a(e,{}),f=r(()=>l.density);o(n,f),o(t,s({...u,density:f}));let p={...d,defaults:{...d.defaults,density:f}};return`persistPrefix`in d&&Object.defineProperty(p,`persistPrefix`,{enumerable:!0,configurable:!0,get:()=>d.persistPrefix}),o(e,s(p)),(e,t)=>c(e.$slots,`default`)}});export{l as t};
package/dist/C_Form.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { t as ComponentDensity } from "./density.cjs";
2
2
  import { t as OptionsState } from "./options.cjs";
3
- import { A as FormSlots, B as OptionItem, C as FormActionSlotProps, D as FormModel, E as FormMode, F as InlineLayoutConfig, G as NAIVE_COMBOS, H as SubmitEventPayload, I as LabelPlacement, J as SPEC_RULES, K as PRESET_RULES, L as LayoutConfig, M as FormSubmitContext, N as FormTabActionsSlotProps, O as FormOption, P as GridLayoutConfig, R as LayoutType, S as FieldPathValue, T as FormInstance, U as TabsLayoutConfig, V as StepsLayoutConfig, W as FormValidationRule, _ as DynamicFieldConfig, a as FormConfig, b as DynamicFormState, c as ResolvedFormConfig, d as shouldShowActions, f as useFormGlobalConfig, g as CustomLayoutConfig, h as ComponentType, i as FORM_DEFAULTS, j as FormStepActionsSlotProps, k as FormRecord, l as mergeFormConfig, m as CardLayoutConfig, o as LAYOUTS_WITH_OWN_CONTROLS, p as AsyncOptionsContext, q as RuleSpec, r as FORM_GLOBAL_CONFIG_KEY, s as LayoutCallbacks, u as resolveFormConfig, v as DynamicFormConfig, w as FormErrorContext, x as FieldPath, y as DynamicFormController, z as MaybePromise } from "./context.cjs";
3
+ import { $t as FormSubmitContext, At as mergeFormConfig, Bt as DynamicFormController, Dt as LAYOUTS_WITH_OWN_CONTROLS, Et as FormConfig, Ft as CardLayoutConfig, Gt as FormErrorContext, Ht as FieldPath, It as ComponentType, Jt as FormModel, Kt as FormInstance, Lt as CustomLayoutConfig, Mt as shouldShowActions, Nt as useFormGlobalConfig, Ot as LayoutCallbacks, Pt as AsyncOptionsContext, Qt as FormStepActionsSlotProps, Rt as DynamicFieldConfig, Tt as FORM_DEFAULTS, Ut as FieldPathValue, Vt as DynamicFormState, Wt as FormActionSlotProps, Xt as FormRecord, Yt as FormOption, Zt as FormSlots, an as LayoutType, cn as StepsLayoutConfig, dn as FormValidationRule, en as FormTabActionsSlotProps, fn as NAIVE_COMBOS, hn as SPEC_RULES, in as LayoutConfig, jt as resolveFormConfig, kt as ResolvedFormConfig, ln as SubmitEventPayload, mn as RuleSpec, nn as InlineLayoutConfig, on as MaybePromise, pn as PRESET_RULES, qt as FormMode, r as FORM_GLOBAL_CONFIG_KEY, rn as LabelPlacement, sn as OptionItem, tn as GridLayoutConfig, un as TabsLayoutConfig, zt as DynamicFormConfig } from "./context.cjs";
4
4
  import { a as FormRendererRegistry, c as createFormRendererRegistry, d as useFormRenderer, i as FormRendererContext, l as registerRenderer, n as FORM_RENDERER_REGISTRY_KEY, o as RendererProps, r as FormRenderer, s as UseFormRendererOptions, t as ComponentMap, u as unregisterRenderer } from "./useFormRenderer.cjs";
5
5
  import { a as UseFormDirtyReturn, c as createAutoCompleteField, d as UseCFormReturn, f as defineFormConfig, h as _default, i as useDynamicFormState, l as createSelectField, m as useCForm, n as DynamicFormStateType, o as useFormDirty, p as defineFormOptions, r as FIELD_TYPE_OPTIONS, s as useFormState, t as DYNAMIC_FORM_STATE_KEY, u as UseCFormOptions } from "./useDynamicFormState.cjs";
6
6
  export { type AsyncOptionsContext, _default as C_Form, type CardLayoutConfig, type ComponentDensity, type ComponentMap, type ComponentType, type CustomLayoutConfig, DYNAMIC_FORM_STATE_KEY, type DynamicFieldConfig, type DynamicFormConfig, type DynamicFormController, type DynamicFormState, type DynamicFormStateType, FIELD_TYPE_OPTIONS, FORM_DEFAULTS, FORM_GLOBAL_CONFIG_KEY, FORM_RENDERER_REGISTRY_KEY, type FieldPath, type FieldPathValue, type FormActionSlotProps, type FormConfig, type FormErrorContext, type FormInstance, type FormMode, type FormModel, type FormOption, type FormRecord, type FormRenderer, type FormRendererContext, type FormRendererRegistry, type FormSlots, type FormStepActionsSlotProps, type FormSubmitContext, type FormTabActionsSlotProps, type FormValidationRule, type GridLayoutConfig, type InlineLayoutConfig, LAYOUTS_WITH_OWN_CONTROLS, type LabelPlacement, type LayoutCallbacks, type LayoutConfig, type LayoutType, type MaybePromise, NAIVE_COMBOS, type OptionItem, type OptionsState, PRESET_RULES, type RendererProps, type ResolvedFormConfig, type RuleSpec, SPEC_RULES, type StepsLayoutConfig, type SubmitEventPayload, type TabsLayoutConfig, type UseCFormOptions, type UseCFormReturn, type UseFormDirtyReturn, type UseFormRendererOptions, createAutoCompleteField, createFormRendererRegistry, createSelectField, defineFormConfig, defineFormOptions, mergeFormConfig, registerRenderer, resolveFormConfig, shouldShowActions, unregisterRenderer, useCForm, useDynamicFormState, useFormDirty, useFormGlobalConfig, useFormRenderer, useFormState };
package/dist/C_Form.d.ts CHANGED
@@ -1,6 +1,7 @@
1
+ import "./types.js";
1
2
  import { t as ComponentDensity } from "./density.js";
2
3
  import "./types2.js";
3
- import { A as FormSlots, B as OptionItem, C as FormActionSlotProps, D as FormModel, E as FormMode, F as InlineLayoutConfig, G as NAIVE_COMBOS, H as SubmitEventPayload, I as LabelPlacement, J as SPEC_RULES, K as PRESET_RULES, L as LayoutConfig, M as FormSubmitContext, N as FormTabActionsSlotProps, O as FormOption, P as GridLayoutConfig, R as LayoutType, S as FieldPathValue, T as FormInstance, U as TabsLayoutConfig, V as StepsLayoutConfig, W as FormValidationRule, Y as OptionsState, _ as DynamicFieldConfig, a as FormConfig, b as DynamicFormState, c as ResolvedFormConfig, d as shouldShowActions, f as useFormGlobalConfig, g as CustomLayoutConfig, h as ComponentType, i as FORM_DEFAULTS, j as FormStepActionsSlotProps, k as FormRecord, l as mergeFormConfig, m as CardLayoutConfig, o as LAYOUTS_WITH_OWN_CONTROLS, p as AsyncOptionsContext, q as RuleSpec, r as FORM_GLOBAL_CONFIG_KEY, s as LayoutCallbacks, u as resolveFormConfig, v as DynamicFormConfig, w as FormErrorContext, x as FieldPath, y as DynamicFormController, z as MaybePromise } from "./context.js";
4
+ import { $t as FormSlots, At as LayoutCallbacks, Bt as DynamicFieldConfig, Dt as FORM_DEFAULTS, Ft as useFormGlobalConfig, Gt as FieldPathValue, Ht as DynamicFormController, It as AsyncOptionsContext, Jt as FormInstance, Kt as FormActionSlotProps, Lt as CardLayoutConfig, Mt as mergeFormConfig, Nt as resolveFormConfig, Ot as FormConfig, Pt as shouldShowActions, Qt as FormRecord, Rt as ComponentType, Ut as DynamicFormState, Vt as DynamicFormConfig, Wt as FieldPath, Xt as FormModel, Yt as FormMode, Zt as FormOption, _n as SPEC_RULES, a as FORM_GLOBAL_CONFIG_KEY, an as LabelPlacement, cn as MaybePromise, dn as SubmitEventPayload, en as FormStepActionsSlotProps, fn as TabsLayoutConfig, gn as RuleSpec, hn as PRESET_RULES, in as InlineLayoutConfig, jt as ResolvedFormConfig, kt as LAYOUTS_WITH_OWN_CONTROLS, ln as OptionItem, mn as NAIVE_COMBOS, nn as FormTabActionsSlotProps, on as LayoutConfig, pn as FormValidationRule, qt as FormErrorContext, rn as GridLayoutConfig, sn as LayoutType, tn as FormSubmitContext, un as StepsLayoutConfig, vn as OptionsState, zt as CustomLayoutConfig } from "./component-config.js";
4
5
  import { a as FormRendererRegistry, c as createFormRendererRegistry, d as useFormRenderer, i as FormRendererContext, l as registerRenderer, n as FORM_RENDERER_REGISTRY_KEY, o as RendererProps, r as FormRenderer, s as UseFormRendererOptions, t as ComponentMap, u as unregisterRenderer } from "./useFormRenderer.js";
5
6
  import { a as UseFormDirtyReturn, c as createAutoCompleteField, d as UseCFormReturn, f as defineFormConfig, h as _default, i as useDynamicFormState, l as createSelectField, m as useCForm, n as DynamicFormStateType, o as useFormDirty, p as defineFormOptions, r as FIELD_TYPE_OPTIONS, s as useFormState, t as DYNAMIC_FORM_STATE_KEY, u as UseCFormOptions } from "./useDynamicFormState.js";
6
7
  import "./types5.js";
@@ -1,5 +1,6 @@
1
+ import "./types.js";
1
2
  import "./types2.js";
2
- import "./context.js";
3
+ import "./component-config.js";
3
4
  import "./useFormRenderer.js";
4
5
  import "./useDynamicFormState.js";
5
6
  import "./types5.js";
@@ -1,6 +1,6 @@
1
+ import "./types.js";
1
2
  import { t as ComponentDensity } from "./density.js";
2
- import { Y as OptionsState } from "./context.js";
3
- import "./component-config.js";
3
+ import { vn as OptionsState } from "./component-config.js";
4
4
  import { _ as SearchOptionItem, a as SerializeSearchOptions, c as FormSearchExpose, d as SearchFieldContext, f as SearchFieldSettings, g as SearchNumberRangeValue, h as SearchFormParams, i as useSearchHistory, l as FormSearchProps, m as SearchFormItem, n as SearchDateRangeValue, o as serializeSearch, p as SearchFieldType, r as useSearchState, s as FormSearchEmits, t as DateRangeInput, u as SearchConfig, v as SearchQueryEncoding } from "./dateRange.js";
5
5
  import { AllowedComponentProps, ComponentCustomProps, EmitFn, VNode, VNodeProps } from "vue";
6
6
 
package/dist/C_Icon2.cjs CHANGED
@@ -1 +1 @@
1
- require(`./chunk.cjs`);const e=require(`./export-helper.cjs`);let t=require(`vue`),n=require(`@iconify/vue`);const r=async(e,t)=>{if(!e)return``;if(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`data:`)||e.startsWith(`blob:`)||e.startsWith(`/`))return e;if(t)try{return await t(e)}catch(t){return console.error(`[useImage] 自定义解析器处理失败: ${e}`,t),``}return e};function i(e){if(typeof e==`number`)return`${Math.max(0,e)}px`;let t=e.trim();return/^\d+(?:\.\d+)?$/.test(t)?`${t}px`:t}const a={width:24,height:24,body:`<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7" d="M5 3h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2Zm7 4v6m0 4h.01"/>`},o=[`title`,`aria-label`,`aria-busy`,`role`,`tabindex`],s=[`viewBox`,`fill`],c=[`d`],l=[`src`,`alt`],u=(0,t.defineComponent)({name:`C_Icon`,__name:`index`,props:{name:{},type:{default:`iconify`},color:{default:`currentColor`},size:{default:18},svgPath:{default:``},viewBox:{default:`0 0 24 24`},alt:{default:``},clickable:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},fallbackIcon:{default:``},loadTimeout:{default:5e3},title:{default:``},ariaLabel:{default:``},customClass:{default:``},rotate:{default:0},flip:{default:void 0},componentProps:{default:()=>({})}},emits:[`click`,`error`,`load`],setup(e,{expose:u,emit:d}){let f=e,p=d,m=(0,t.ref)(),h=(0,t.ref)(),g=(0,t.shallowRef)(null),_=(0,t.shallowRef)(null),v=(0,t.ref)(!1),y=(0,t.ref)(``),b=(0,t.ref)(``),x=(0,t.ref)(!1),S=!1,C=0,w,T=new Set,E=(0,t.computed)(()=>i(f.size)),D=(0,t.computed)(()=>({fontSize:E.value,color:f.color,width:E.value,height:E.value})),O=(0,t.computed)(()=>({display:`inline-flex`,width:E.value,height:E.value,transform:[f.rotate?`rotate(${f.rotate}deg)`:``,f.flip?`scaleX(${f.flip===`horizontal`||f.flip===`both`?-1:1}) scaleY(${f.flip===`vertical`||f.flip===`both`?-1:1})`:``].filter(Boolean).join(` `)||void 0})),k=(0,t.computed)(()=>{if(typeof f.name==`string`)return f.name;let e=f.name;return e?.__name||e?.name||(f.type===`svg`?`SVG Icon`:`Icon`)}),A=(0,t.computed)(()=>f.type===`component`&&typeof f.name!=`string`?f.name:null),j=()=>{C++,clearTimeout(w);for(let e of T)e();T.clear()},M=(e,t,r)=>{let i=C,a=(0,n.getIcon)(e);if(a){t(a);return}let o=!1,s=()=>{o=!0,clearTimeout(l),u?.(),T.delete(s)},c=e=>{o||i!==C||(s(),e?t(e):r())},l=setTimeout(()=>c(),Math.max(100,f.loadTimeout));T.add(s);let u=(0,n.loadIcons)([e],(t,r,i)=>{i.length===0&&c((0,n.getIcon)(e))})},N=(e,t,n)=>{v.value||(clearTimeout(w),x.value=!1,v.value=!0,y.value=t,p(`error`,e,n),f.fallbackIcon&&M(f.fallbackIcon.replace(/^i-([^:-]+)[:-]/,`$1:`),e=>{_.value=e},()=>{}))},P=()=>{v.value||(clearTimeout(w),x.value=!1,p(`load`))},F=async()=>{let e=C;await(0,t.nextTick)();let n=t=>{if(e!==C||!h.value)return;let r=getComputedStyle(h.value),i=r.maskImage||r.getPropertyValue(`-webkit-mask-image`);if(i&&i!==`none`||r.backgroundImage&&r.backgroundImage!==`none`){P();return}if(t===3){N(`unocss`,`UnoCSS 图标样式未生成`);return}let a=setTimeout(()=>{T.delete(o),n(t+1)},[50,150,400][t]),o=()=>clearTimeout(a);T.add(o)};n(0)},I=e=>{g.value=(0,n.getIcon)(e)||null,S&&(x.value=!g.value,M(e,e=>{g.value=e,P()},()=>N(`iconify`,`Iconify 图标不存在或请求超时`)))},L=async e=>{let t=C;x.value=!0,w=setTimeout(()=>{t===C&&N(`image`,`图片图标加载超时`)},Math.max(100,f.loadTimeout));try{let n=await r(e);if(t!==C||v.value)return;n?b.value=n:N(`image`,`图片路径解析失败`)}catch(e){t===C&&N(`image`,`图片路径解析失败`,e)}},R=e=>{f.type===`iconify`?I(e):f.type===`unocss`?e.startsWith(`i-`)?S&&F():N(`unocss`,`UnoCSS 图标名称应以 i- 开头`):f.type===`image`?L(e):N(`type`,`不支持的图标类型`)},z=()=>{if(j(),v.value=!1,y.value=``,g.value=null,_.value=null,b.value=``,x.value=!1,f.type===`svg`){f.svgPath?S&&P():N(`svg`,`SVG 路径不能为空`);return}if(!f.name){N(`validation`,`图标名称不能为空`);return}if(f.type===`component`){A.value?S&&P():N(`component`,`无法解析图标组件`);return}if(typeof f.name!=`string`){N(f.type,`图标名称必须为字符串`);return}R(f.name)},B=e=>{f.clickable&&!f.loading&&p(`click`,e)},V=e=>{f.clickable&&!f.loading&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),p(`click`,e))};return(0,t.watch)(()=>[f.name,f.type,f.svgPath,f.fallbackIcon,f.loadTimeout],()=>{z()},{immediate:!0}),(0,t.onMounted)(()=>{S=!0,z()}),(0,t.onBeforeUnmount)(j),u({validate:z,hasError:(0,t.readonly)(v),errorMessage:(0,t.readonly)(y),el:m}),(r,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{ref_key:`iconRef`,ref:m,class:(0,t.normalizeClass)([`c-icon`,[`c-icon--${e.type}`,{"c-icon--clickable":e.clickable,"c-icon--loading":e.loading||x.value,"c-icon--error":v.value}]]),style:(0,t.normalizeStyle)(D.value),title:e.title||(v.value?y.value:void 0),"aria-label":e.ariaLabel||k.value,"aria-busy":e.loading||x.value||void 0,role:e.clickable?`button`:`img`,tabindex:e.clickable?0:void 0,onClick:B,onKeydown:V},[e.type===`iconify`&&!v.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.Icon),{key:0,icon:g.value||(0,t.unref)(a),style:(0,t.normalizeStyle)(O.value),color:e.color},null,8,[`icon`,`style`,`color`])):e.type===`unocss`&&!v.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:1,ref_key:`unoRef`,ref:h,class:(0,t.normalizeClass)([e.name,e.customClass]),style:(0,t.normalizeStyle)(O.value)},null,6)):e.type===`component`&&A.value&&!v.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(A.value),(0,t.mergeProps)({key:2,style:O.value},e.componentProps),null,16,[`style`])):e.type===`svg`&&!v.value?((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,{key:3,viewBox:e.viewBox,style:(0,t.normalizeStyle)(O.value),fill:e.color,"aria-hidden":`true`},[(0,t.createElementVNode)(`path`,{d:e.svgPath},null,8,c)],12,s)):e.type===`image`&&b.value&&!v.value?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:b.value,src:b.value,alt:e.alt||k.value,style:(0,t.normalizeStyle)(O.value),onError:i[0]||=e=>N(`image`,`图片图标加载失败`),onLoad:P},null,44,l)):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.Icon),{key:5,icon:_.value||(0,t.unref)(a),style:(0,t.normalizeStyle)(O.value),color:e.color},null,8,[`icon`,`style`,`color`])),e.loading?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:6,class:`c-icon__loading`,style:(0,t.normalizeStyle)(O.value),"aria-hidden":`true`},[...i[1]||=[(0,t.createElementVNode)(`span`,{class:`c-icon__spinner`},null,-1)]],4)):(0,t.createCommentVNode)(`v-if`,!0)],46,o))}});var d=e.t(u,[[`__scopeId`,`data-v-075758a0`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return d}});
1
+ const e=require(`./chunk.cjs`),t=require(`./export-helper.cjs`);let n=require(`vue`),r=require(`@iconify/vue`);const i=async(e,t)=>{if(!e)return``;if(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`data:`)||e.startsWith(`blob:`)||e.startsWith(`/`))return e;if(t)try{return await t(e)}catch(t){return console.error(`[useImage] 自定义解析器处理失败: ${e}`,t),``}return e};function a(e){if(typeof e==`number`)return`${Math.max(0,e)}px`;let t=e.trim();return/^\d+(?:\.\d+)?$/.test(t)?`${t}px`:t}const o={width:24,height:24,body:`<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7" d="M5 3h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2Zm7 4v6m0 4h.01"/>`};var s=e.t({default:()=>p});const c=[`title`,`aria-label`,`aria-busy`,`role`,`tabindex`],l=[`viewBox`,`fill`],u=[`d`],d=[`src`,`alt`],f=(0,n.defineComponent)({name:`C_Icon`,__name:`index`,props:{name:{},type:{default:`iconify`},color:{default:`currentColor`},size:{default:18},svgPath:{default:``},viewBox:{default:`0 0 24 24`},alt:{default:``},clickable:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},fallbackIcon:{default:``},loadTimeout:{default:5e3},title:{default:``},ariaLabel:{default:``},customClass:{default:``},rotate:{default:0},flip:{default:void 0},componentProps:{default:()=>({})}},emits:[`click`,`error`,`load`],setup(e,{expose:t,emit:s}){let f=e,p=s,m=(0,n.ref)(),h=(0,n.ref)(),g=(0,n.shallowRef)(null),_=(0,n.shallowRef)(null),v=(0,n.ref)(!1),y=(0,n.ref)(``),b=(0,n.ref)(``),x=(0,n.ref)(!1),S=!1,C=0,w,T=new Set,E=(0,n.computed)(()=>a(f.size)),D=(0,n.computed)(()=>({fontSize:E.value,color:f.color,width:E.value,height:E.value})),O=(0,n.computed)(()=>({display:`inline-flex`,width:E.value,height:E.value,transform:[f.rotate?`rotate(${f.rotate}deg)`:``,f.flip?`scaleX(${f.flip===`horizontal`||f.flip===`both`?-1:1}) scaleY(${f.flip===`vertical`||f.flip===`both`?-1:1})`:``].filter(Boolean).join(` `)||void 0})),k=(0,n.computed)(()=>{if(typeof f.name==`string`)return f.name;let e=f.name;return e?.__name||e?.name||(f.type===`svg`?`SVG Icon`:`Icon`)}),A=(0,n.computed)(()=>f.type===`component`&&typeof f.name!=`string`?f.name:null),j=()=>{C++,clearTimeout(w);for(let e of T)e();T.clear()},M=(e,t,n)=>{let i=C,a=(0,r.getIcon)(e);if(a){t(a);return}let o=!1,s=()=>{o=!0,clearTimeout(l),u?.(),T.delete(s)},c=e=>{o||i!==C||(s(),e?t(e):n())},l=setTimeout(()=>c(),Math.max(100,f.loadTimeout));T.add(s);let u=(0,r.loadIcons)([e],(t,n,i)=>{i.length===0&&c((0,r.getIcon)(e))})},N=(e,t,n)=>{v.value||(clearTimeout(w),x.value=!1,v.value=!0,y.value=t,p(`error`,e,n),f.fallbackIcon&&M(f.fallbackIcon.replace(/^i-([^:-]+)[:-]/,`$1:`),e=>{_.value=e},()=>{}))},P=()=>{v.value||(clearTimeout(w),x.value=!1,p(`load`))},F=async()=>{let e=C;await(0,n.nextTick)();let t=n=>{if(e!==C||!h.value)return;let r=getComputedStyle(h.value),i=r.maskImage||r.getPropertyValue(`-webkit-mask-image`);if(i&&i!==`none`||r.backgroundImage&&r.backgroundImage!==`none`){P();return}if(n===3){N(`unocss`,`UnoCSS 图标样式未生成`);return}let a=setTimeout(()=>{T.delete(o),t(n+1)},[50,150,400][n]),o=()=>clearTimeout(a);T.add(o)};t(0)},I=e=>{g.value=(0,r.getIcon)(e)||null,S&&(x.value=!g.value,M(e,e=>{g.value=e,P()},()=>N(`iconify`,`Iconify 图标不存在或请求超时`)))},L=async e=>{let t=C;x.value=!0,w=setTimeout(()=>{t===C&&N(`image`,`图片图标加载超时`)},Math.max(100,f.loadTimeout));try{let n=await i(e);if(t!==C||v.value)return;n?b.value=n:N(`image`,`图片路径解析失败`)}catch(e){t===C&&N(`image`,`图片路径解析失败`,e)}},R=e=>{f.type===`iconify`?I(e):f.type===`unocss`?e.startsWith(`i-`)?S&&F():N(`unocss`,`UnoCSS 图标名称应以 i- 开头`):f.type===`image`?L(e):N(`type`,`不支持的图标类型`)},z=()=>{if(j(),v.value=!1,y.value=``,g.value=null,_.value=null,b.value=``,x.value=!1,f.type===`svg`){f.svgPath?S&&P():N(`svg`,`SVG 路径不能为空`);return}if(!f.name){N(`validation`,`图标名称不能为空`);return}if(f.type===`component`){A.value?S&&P():N(`component`,`无法解析图标组件`);return}if(typeof f.name!=`string`){N(f.type,`图标名称必须为字符串`);return}R(f.name)},B=e=>{f.clickable&&!f.loading&&p(`click`,e)},V=e=>{f.clickable&&!f.loading&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),p(`click`,e))};return(0,n.watch)(()=>[f.name,f.type,f.svgPath,f.fallbackIcon,f.loadTimeout],()=>{z()},{immediate:!0}),(0,n.onMounted)(()=>{S=!0,z()}),(0,n.onBeforeUnmount)(j),t({validate:z,hasError:(0,n.readonly)(v),errorMessage:(0,n.readonly)(y),el:m}),(t,i)=>((0,n.openBlock)(),(0,n.createElementBlock)(`span`,{ref_key:`iconRef`,ref:m,class:(0,n.normalizeClass)([`c-icon`,[`c-icon--${e.type}`,{"c-icon--clickable":e.clickable,"c-icon--loading":e.loading||x.value,"c-icon--error":v.value}]]),style:(0,n.normalizeStyle)(D.value),title:e.title||(v.value?y.value:void 0),"aria-label":e.ariaLabel||k.value,"aria-busy":e.loading||x.value||void 0,role:e.clickable?`button`:`img`,tabindex:e.clickable?0:void 0,onClick:B,onKeydown:V},[e.type===`iconify`&&!v.value?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(r.Icon),{key:0,icon:g.value||(0,n.unref)(o),style:(0,n.normalizeStyle)(O.value),color:e.color},null,8,[`icon`,`style`,`color`])):e.type===`unocss`&&!v.value?((0,n.openBlock)(),(0,n.createElementBlock)(`span`,{key:1,ref_key:`unoRef`,ref:h,class:(0,n.normalizeClass)([e.name,e.customClass]),style:(0,n.normalizeStyle)(O.value)},null,6)):e.type===`component`&&A.value&&!v.value?((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(A.value),(0,n.mergeProps)({key:2,style:O.value},e.componentProps),null,16,[`style`])):e.type===`svg`&&!v.value?((0,n.openBlock)(),(0,n.createElementBlock)(`svg`,{key:3,viewBox:e.viewBox,style:(0,n.normalizeStyle)(O.value),fill:e.color,"aria-hidden":`true`},[(0,n.createElementVNode)(`path`,{d:e.svgPath},null,8,u)],12,l)):e.type===`image`&&b.value&&!v.value?((0,n.openBlock)(),(0,n.createElementBlock)(`img`,{key:b.value,src:b.value,alt:e.alt||k.value,style:(0,n.normalizeStyle)(O.value),onError:i[0]||=e=>N(`image`,`图片图标加载失败`),onLoad:P},null,44,d)):((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(r.Icon),{key:5,icon:_.value||(0,n.unref)(o),style:(0,n.normalizeStyle)(O.value),color:e.color},null,8,[`icon`,`style`,`color`])),e.loading?((0,n.openBlock)(),(0,n.createElementBlock)(`span`,{key:6,class:`c-icon__loading`,style:(0,n.normalizeStyle)(O.value),"aria-hidden":`true`},[...i[1]||=[(0,n.createElementVNode)(`span`,{class:`c-icon__spinner`},null,-1)]],4)):(0,n.createCommentVNode)(`v-if`,!0)],46,c))}});var p=t.t(f,[[`__scopeId`,`data-v-075758a0`]]);Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return p}});
package/dist/C_Icon2.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./export-helper.js";import{computed as t,createBlock as n,createCommentVNode as r,createElementBlock as i,createElementVNode as a,defineComponent as o,mergeProps as s,nextTick as c,normalizeClass as l,normalizeStyle as u,onBeforeUnmount as d,onMounted as f,openBlock as p,readonly as m,ref as h,resolveDynamicComponent as ee,shallowRef as g,unref as _,watch as v}from"vue";import{Icon as y,getIcon as b,loadIcons as x}from"@iconify/vue";const S=async(e,t)=>{if(!e)return``;if(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`data:`)||e.startsWith(`blob:`)||e.startsWith(`/`))return e;if(t)try{return await t(e)}catch(t){return console.error(`[useImage] 自定义解析器处理失败: ${e}`,t),``}return e};function C(e){if(typeof e==`number`)return`${Math.max(0,e)}px`;let t=e.trim();return/^\d+(?:\.\d+)?$/.test(t)?`${t}px`:t}const w={width:24,height:24,body:`<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7" d="M5 3h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2Zm7 4v6m0 4h.01"/>`},T=[`title`,`aria-label`,`aria-busy`,`role`,`tabindex`],te=[`viewBox`,`fill`],E=[`d`],D=[`src`,`alt`];var O=e(o({name:`C_Icon`,__name:`index`,props:{name:{},type:{default:`iconify`},color:{default:`currentColor`},size:{default:18},svgPath:{default:``},viewBox:{default:`0 0 24 24`},alt:{default:``},clickable:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},fallbackIcon:{default:``},loadTimeout:{default:5e3},title:{default:``},ariaLabel:{default:``},customClass:{default:``},rotate:{default:0},flip:{default:void 0},componentProps:{default:()=>({})}},emits:[`click`,`error`,`load`],setup(e,{expose:o,emit:O}){let k=e,A=O,j=h(),M=h(),N=g(null),P=g(null),F=h(!1),I=h(``),L=h(``),R=h(!1),z=!1,B=0,V,H=new Set,U=t(()=>C(k.size)),W=t(()=>({fontSize:U.value,color:k.color,width:U.value,height:U.value})),G=t(()=>({display:`inline-flex`,width:U.value,height:U.value,transform:[k.rotate?`rotate(${k.rotate}deg)`:``,k.flip?`scaleX(${k.flip===`horizontal`||k.flip===`both`?-1:1}) scaleY(${k.flip===`vertical`||k.flip===`both`?-1:1})`:``].filter(Boolean).join(` `)||void 0})),K=t(()=>{if(typeof k.name==`string`)return k.name;let e=k.name;return e?.__name||e?.name||(k.type===`svg`?`SVG Icon`:`Icon`)}),q=t(()=>k.type===`component`&&typeof k.name!=`string`?k.name:null),J=()=>{B++,clearTimeout(V);for(let e of H)e();H.clear()},Y=(e,t,n)=>{let r=B,i=b(e);if(i){t(i);return}let a=!1,o=()=>{a=!0,clearTimeout(c),l?.(),H.delete(o)},s=e=>{a||r!==B||(o(),e?t(e):n())},c=setTimeout(()=>s(),Math.max(100,k.loadTimeout));H.add(o);let l=x([e],(t,n,r)=>{r.length===0&&s(b(e))})},X=(e,t,n)=>{F.value||(clearTimeout(V),R.value=!1,F.value=!0,I.value=t,A(`error`,e,n),k.fallbackIcon&&Y(k.fallbackIcon.replace(/^i-([^:-]+)[:-]/,`$1:`),e=>{P.value=e},()=>{}))},Z=()=>{F.value||(clearTimeout(V),R.value=!1,A(`load`))},ne=async()=>{let e=B;await c();let t=n=>{if(e!==B||!M.value)return;let r=getComputedStyle(M.value),i=r.maskImage||r.getPropertyValue(`-webkit-mask-image`);if(i&&i!==`none`||r.backgroundImage&&r.backgroundImage!==`none`){Z();return}if(n===3){X(`unocss`,`UnoCSS 图标样式未生成`);return}let a=setTimeout(()=>{H.delete(o),t(n+1)},[50,150,400][n]),o=()=>clearTimeout(a);H.add(o)};t(0)},Q=e=>{N.value=b(e)||null,z&&(R.value=!N.value,Y(e,e=>{N.value=e,Z()},()=>X(`iconify`,`Iconify 图标不存在或请求超时`)))},re=async e=>{let t=B;R.value=!0,V=setTimeout(()=>{t===B&&X(`image`,`图片图标加载超时`)},Math.max(100,k.loadTimeout));try{let n=await S(e);if(t!==B||F.value)return;n?L.value=n:X(`image`,`图片路径解析失败`)}catch(e){t===B&&X(`image`,`图片路径解析失败`,e)}},ie=e=>{k.type===`iconify`?Q(e):k.type===`unocss`?e.startsWith(`i-`)?z&&ne():X(`unocss`,`UnoCSS 图标名称应以 i- 开头`):k.type===`image`?re(e):X(`type`,`不支持的图标类型`)},$=()=>{if(J(),F.value=!1,I.value=``,N.value=null,P.value=null,L.value=``,R.value=!1,k.type===`svg`){k.svgPath?z&&Z():X(`svg`,`SVG 路径不能为空`);return}if(!k.name){X(`validation`,`图标名称不能为空`);return}if(k.type===`component`){q.value?z&&Z():X(`component`,`无法解析图标组件`);return}if(typeof k.name!=`string`){X(k.type,`图标名称必须为字符串`);return}ie(k.name)},ae=e=>{k.clickable&&!k.loading&&A(`click`,e)},oe=e=>{k.clickable&&!k.loading&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),A(`click`,e))};return v(()=>[k.name,k.type,k.svgPath,k.fallbackIcon,k.loadTimeout],()=>{$()},{immediate:!0}),f(()=>{z=!0,$()}),d(J),o({validate:$,hasError:m(F),errorMessage:m(I),el:j}),(t,o)=>(p(),i(`span`,{ref_key:`iconRef`,ref:j,class:l([`c-icon`,[`c-icon--${e.type}`,{"c-icon--clickable":e.clickable,"c-icon--loading":e.loading||R.value,"c-icon--error":F.value}]]),style:u(W.value),title:e.title||(F.value?I.value:void 0),"aria-label":e.ariaLabel||K.value,"aria-busy":e.loading||R.value||void 0,role:e.clickable?`button`:`img`,tabindex:e.clickable?0:void 0,onClick:ae,onKeydown:oe},[e.type===`iconify`&&!F.value?(p(),n(_(y),{key:0,icon:N.value||_(w),style:u(G.value),color:e.color},null,8,[`icon`,`style`,`color`])):e.type===`unocss`&&!F.value?(p(),i(`span`,{key:1,ref_key:`unoRef`,ref:M,class:l([e.name,e.customClass]),style:u(G.value)},null,6)):e.type===`component`&&q.value&&!F.value?(p(),n(ee(q.value),s({key:2,style:G.value},e.componentProps),null,16,[`style`])):e.type===`svg`&&!F.value?(p(),i(`svg`,{key:3,viewBox:e.viewBox,style:u(G.value),fill:e.color,"aria-hidden":`true`},[a(`path`,{d:e.svgPath},null,8,E)],12,te)):e.type===`image`&&L.value&&!F.value?(p(),i(`img`,{key:L.value,src:L.value,alt:e.alt||K.value,style:u(G.value),onError:o[0]||=e=>X(`image`,`图片图标加载失败`),onLoad:Z},null,44,D)):(p(),n(_(y),{key:5,icon:P.value||_(w),style:u(G.value),color:e.color},null,8,[`icon`,`style`,`color`])),e.loading?(p(),i(`span`,{key:6,class:`c-icon__loading`,style:u(G.value),"aria-hidden":`true`},[...o[1]||=[a(`span`,{class:`c-icon__spinner`},null,-1)]],4)):r(`v-if`,!0)],46,T))}}),[[`__scopeId`,`data-v-075758a0`]]);export{O as t};
1
+ import{t as e}from"./rolldown-runtime.js";import{t}from"./export-helper.js";import{computed as n,createBlock as r,createCommentVNode as i,createElementBlock as a,createElementVNode as o,defineComponent as s,mergeProps as c,nextTick as l,normalizeClass as u,normalizeStyle as d,onBeforeUnmount as f,onMounted as p,openBlock as m,readonly as h,ref as g,resolveDynamicComponent as ee,shallowRef as _,unref as v,watch as y}from"vue";import{Icon as b,getIcon as x,loadIcons as S}from"@iconify/vue";const C=async(e,t)=>{if(!e)return``;if(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`data:`)||e.startsWith(`blob:`)||e.startsWith(`/`))return e;if(t)try{return await t(e)}catch(t){return console.error(`[useImage] 自定义解析器处理失败: ${e}`,t),``}return e};function w(e){if(typeof e==`number`)return`${Math.max(0,e)}px`;let t=e.trim();return/^\d+(?:\.\d+)?$/.test(t)?`${t}px`:t}const T={width:24,height:24,body:`<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7" d="M5 3h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2Zm7 4v6m0 4h.01"/>`};var E=e({default:()=>A});const te=[`title`,`aria-label`,`aria-busy`,`role`,`tabindex`],D=[`viewBox`,`fill`],O=[`d`],k=[`src`,`alt`];var A=t(s({name:`C_Icon`,__name:`index`,props:{name:{},type:{default:`iconify`},color:{default:`currentColor`},size:{default:18},svgPath:{default:``},viewBox:{default:`0 0 24 24`},alt:{default:``},clickable:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},fallbackIcon:{default:``},loadTimeout:{default:5e3},title:{default:``},ariaLabel:{default:``},customClass:{default:``},rotate:{default:0},flip:{default:void 0},componentProps:{default:()=>({})}},emits:[`click`,`error`,`load`],setup(e,{expose:t,emit:s}){let E=e,A=s,j=g(),M=g(),N=_(null),P=_(null),F=g(!1),I=g(``),L=g(``),R=g(!1),z=!1,B=0,V,H=new Set,U=n(()=>w(E.size)),W=n(()=>({fontSize:U.value,color:E.color,width:U.value,height:U.value})),G=n(()=>({display:`inline-flex`,width:U.value,height:U.value,transform:[E.rotate?`rotate(${E.rotate}deg)`:``,E.flip?`scaleX(${E.flip===`horizontal`||E.flip===`both`?-1:1}) scaleY(${E.flip===`vertical`||E.flip===`both`?-1:1})`:``].filter(Boolean).join(` `)||void 0})),K=n(()=>{if(typeof E.name==`string`)return E.name;let e=E.name;return e?.__name||e?.name||(E.type===`svg`?`SVG Icon`:`Icon`)}),q=n(()=>E.type===`component`&&typeof E.name!=`string`?E.name:null),J=()=>{B++,clearTimeout(V);for(let e of H)e();H.clear()},Y=(e,t,n)=>{let r=B,i=x(e);if(i){t(i);return}let a=!1,o=()=>{a=!0,clearTimeout(c),l?.(),H.delete(o)},s=e=>{a||r!==B||(o(),e?t(e):n())},c=setTimeout(()=>s(),Math.max(100,E.loadTimeout));H.add(o);let l=S([e],(t,n,r)=>{r.length===0&&s(x(e))})},X=(e,t,n)=>{F.value||(clearTimeout(V),R.value=!1,F.value=!0,I.value=t,A(`error`,e,n),E.fallbackIcon&&Y(E.fallbackIcon.replace(/^i-([^:-]+)[:-]/,`$1:`),e=>{P.value=e},()=>{}))},Z=()=>{F.value||(clearTimeout(V),R.value=!1,A(`load`))},ne=async()=>{let e=B;await l();let t=n=>{if(e!==B||!M.value)return;let r=getComputedStyle(M.value),i=r.maskImage||r.getPropertyValue(`-webkit-mask-image`);if(i&&i!==`none`||r.backgroundImage&&r.backgroundImage!==`none`){Z();return}if(n===3){X(`unocss`,`UnoCSS 图标样式未生成`);return}let a=setTimeout(()=>{H.delete(o),t(n+1)},[50,150,400][n]),o=()=>clearTimeout(a);H.add(o)};t(0)},re=e=>{N.value=x(e)||null,z&&(R.value=!N.value,Y(e,e=>{N.value=e,Z()},()=>X(`iconify`,`Iconify 图标不存在或请求超时`)))},Q=async e=>{let t=B;R.value=!0,V=setTimeout(()=>{t===B&&X(`image`,`图片图标加载超时`)},Math.max(100,E.loadTimeout));try{let n=await C(e);if(t!==B||F.value)return;n?L.value=n:X(`image`,`图片路径解析失败`)}catch(e){t===B&&X(`image`,`图片路径解析失败`,e)}},ie=e=>{E.type===`iconify`?re(e):E.type===`unocss`?e.startsWith(`i-`)?z&&ne():X(`unocss`,`UnoCSS 图标名称应以 i- 开头`):E.type===`image`?Q(e):X(`type`,`不支持的图标类型`)},$=()=>{if(J(),F.value=!1,I.value=``,N.value=null,P.value=null,L.value=``,R.value=!1,E.type===`svg`){E.svgPath?z&&Z():X(`svg`,`SVG 路径不能为空`);return}if(!E.name){X(`validation`,`图标名称不能为空`);return}if(E.type===`component`){q.value?z&&Z():X(`component`,`无法解析图标组件`);return}if(typeof E.name!=`string`){X(E.type,`图标名称必须为字符串`);return}ie(E.name)},ae=e=>{E.clickable&&!E.loading&&A(`click`,e)},oe=e=>{E.clickable&&!E.loading&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),A(`click`,e))};return y(()=>[E.name,E.type,E.svgPath,E.fallbackIcon,E.loadTimeout],()=>{$()},{immediate:!0}),p(()=>{z=!0,$()}),f(J),t({validate:$,hasError:h(F),errorMessage:h(I),el:j}),(t,n)=>(m(),a(`span`,{ref_key:`iconRef`,ref:j,class:u([`c-icon`,[`c-icon--${e.type}`,{"c-icon--clickable":e.clickable,"c-icon--loading":e.loading||R.value,"c-icon--error":F.value}]]),style:d(W.value),title:e.title||(F.value?I.value:void 0),"aria-label":e.ariaLabel||K.value,"aria-busy":e.loading||R.value||void 0,role:e.clickable?`button`:`img`,tabindex:e.clickable?0:void 0,onClick:ae,onKeydown:oe},[e.type===`iconify`&&!F.value?(m(),r(v(b),{key:0,icon:N.value||v(T),style:d(G.value),color:e.color},null,8,[`icon`,`style`,`color`])):e.type===`unocss`&&!F.value?(m(),a(`span`,{key:1,ref_key:`unoRef`,ref:M,class:u([e.name,e.customClass]),style:d(G.value)},null,6)):e.type===`component`&&q.value&&!F.value?(m(),r(ee(q.value),c({key:2,style:G.value},e.componentProps),null,16,[`style`])):e.type===`svg`&&!F.value?(m(),a(`svg`,{key:3,viewBox:e.viewBox,style:d(G.value),fill:e.color,"aria-hidden":`true`},[o(`path`,{d:e.svgPath},null,8,O)],12,D)):e.type===`image`&&L.value&&!F.value?(m(),a(`img`,{key:L.value,src:L.value,alt:e.alt||K.value,style:d(G.value),onError:n[0]||=e=>X(`image`,`图片图标加载失败`),onLoad:Z},null,44,k)):(m(),r(v(b),{key:5,icon:P.value||v(T),style:d(G.value),color:e.color},null,8,[`icon`,`style`,`color`])),e.loading?(m(),a(`span`,{key:6,class:`c-icon__loading`,style:d(G.value),"aria-hidden":`true`},[...n[1]||=[o(`span`,{class:`c-icon__spinner`},null,-1)]],4)):i(`v-if`,!0)],46,te))}}),[[`__scopeId`,`data-v-075758a0`]]);export{E as n,A as t};
package/dist/C_Login.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import "./context.js";
1
+ import "./types.js";
2
2
  import "./component-config.js";
3
3
  import "./verification.js";
4
4
  import { a as LoginFeatures, c as RegisterFormData, i as DEFAULT_SOCIAL_PROVIDERS, l as SocialProvider, n as CaptchaFormData, o as LoginProps, r as DEFAULT_FEATURES, s as PasswordFormData, t as _default } from "./index20.vue.js";
package/dist/C_Steps.css CHANGED
@@ -1,5 +1,5 @@
1
1
  @import "./shared-tokens.css";
2
- .c-steps[data-v-898fd423] {
2
+ .c-steps[data-v-b8bad090] {
3
3
  --step-gap: 24px;
4
4
  --icon-size: 32px;
5
5
  --line-width: 2px;
@@ -12,17 +12,17 @@
12
12
  --bg-hover: var(--c-bg-hover, var(--c-theme-bg-hover));
13
13
  display: flex;
14
14
  }
15
- .steps-connected[data-v-898fd423] {
15
+ .steps-connected[data-v-b8bad090] {
16
16
  --line-gap: 0px;
17
17
  }
18
- .steps-horizontal[data-v-898fd423] {
18
+ .steps-horizontal[data-v-b8bad090] {
19
19
  flex-direction: row;
20
20
  align-items: flex-start;
21
21
  }
22
- .steps-vertical[data-v-898fd423] {
22
+ .steps-vertical[data-v-b8bad090] {
23
23
  flex-direction: column;
24
24
  }
25
- .step-item[data-v-898fd423] {
25
+ .step-item[data-v-b8bad090] {
26
26
  display: flex;
27
27
  position: relative;
28
28
  flex: 1;
@@ -34,36 +34,36 @@
34
34
  background: transparent;
35
35
  border: 0;
36
36
  }
37
- .step-item[data-v-898fd423]:focus-visible {
37
+ .step-item[data-v-b8bad090]:focus-visible {
38
38
  outline: 2px solid var(--primary);
39
39
  outline-offset: 2px;
40
40
  }
41
- .steps-horizontal .step-item[data-v-898fd423] {
41
+ .steps-horizontal .step-item[data-v-b8bad090] {
42
42
  flex-direction: column;
43
43
  align-items: center;
44
44
  text-align: center;
45
45
  min-width: 0;
46
46
  }
47
- .steps-vertical .step-item[data-v-898fd423] {
47
+ .steps-vertical .step-item[data-v-b8bad090] {
48
48
  flex-direction: row;
49
49
  min-height: 72px;
50
50
  flex: none;
51
51
  width: 100%;
52
52
  }
53
- .step-indicator[data-v-898fd423] {
53
+ .step-indicator[data-v-b8bad090] {
54
54
  position: relative;
55
55
  display: flex;
56
56
  align-items: center;
57
57
  flex-shrink: 0;
58
58
  }
59
- .steps-horizontal .step-indicator[data-v-898fd423] {
59
+ .steps-horizontal .step-indicator[data-v-b8bad090] {
60
60
  width: 100%;
61
61
  justify-content: center;
62
62
  }
63
- .steps-vertical .step-indicator[data-v-898fd423] {
63
+ .steps-vertical .step-indicator[data-v-b8bad090] {
64
64
  flex-direction: column;
65
65
  }
66
- .step-icon[data-v-898fd423] {
66
+ .step-icon[data-v-b8bad090] {
67
67
  width: var(--icon-size);
68
68
  height: var(--icon-size);
69
69
  border-radius: 50%;
@@ -77,111 +77,111 @@
77
77
  transition: all 0.2s ease;
78
78
  font-size: 16px;
79
79
  }
80
- .step-finish .step-icon[data-v-898fd423] {
80
+ .step-finish .step-icon[data-v-b8bad090] {
81
81
  border-color: var(--success);
82
82
  color: var(--success);
83
83
  }
84
- .step-process .step-icon[data-v-898fd423] {
84
+ .step-process .step-icon[data-v-b8bad090] {
85
85
  border-color: var(--primary);
86
86
  background: color-mix(in srgb, var(--primary) 14%, transparent);
87
87
  color: var(--primary);
88
88
  }
89
- .step-error .step-icon[data-v-898fd423] {
89
+ .step-error .step-icon[data-v-b8bad090] {
90
90
  border-color: var(--error);
91
91
  color: var(--error);
92
92
  }
93
- .step-index[data-v-898fd423] {
93
+ .step-index[data-v-b8bad090] {
94
94
  font-size: 14px;
95
95
  font-weight: 500;
96
96
  }
97
- .step-line[data-v-898fd423] {
97
+ .step-line[data-v-b8bad090] {
98
98
  background: var(--border);
99
99
  position: absolute;
100
100
  transition: background 0.2s ease;
101
101
  }
102
- .steps-horizontal .step-line[data-v-898fd423] {
102
+ .steps-horizontal .step-line[data-v-b8bad090] {
103
103
  height: var(--line-width);
104
104
  left: calc(50% + var(--icon-size) / 2 + var(--line-gap));
105
105
  right: calc(-50% + var(--icon-size) / 2 + var(--line-gap));
106
106
  top: calc(var(--icon-size) / 2);
107
107
  }
108
- .steps-vertical .step-line[data-v-898fd423] {
108
+ .steps-vertical .step-line[data-v-b8bad090] {
109
109
  width: var(--line-width);
110
110
  top: var(--icon-size);
111
111
  bottom: 0;
112
112
  left: calc(var(--icon-size) / 2 - 1px);
113
113
  }
114
- .step-finish .step-line[data-v-898fd423] {
114
+ .step-finish .step-line[data-v-b8bad090] {
115
115
  background: var(--success);
116
116
  }
117
- .step-content[data-v-898fd423] {
117
+ .step-content[data-v-b8bad090] {
118
118
  flex: 1;
119
119
  min-width: 0;
120
120
  }
121
- .steps-vertical .step-content[data-v-898fd423] {
121
+ .steps-vertical .step-content[data-v-b8bad090] {
122
122
  padding-top: 4px;
123
123
  }
124
- .step-title[data-v-898fd423] {
124
+ .step-title[data-v-b8bad090] {
125
125
  font-size: 14px;
126
126
  font-weight: 500;
127
127
  line-height: 22px;
128
128
  margin-bottom: 2px;
129
129
  word-break: break-word;
130
130
  }
131
- .step-time[data-v-898fd423] {
131
+ .step-time[data-v-b8bad090] {
132
132
  font-size: 12px;
133
133
  line-height: 20px;
134
134
  margin-bottom: 2px;
135
135
  opacity: 0.65;
136
136
  }
137
- .step-finish .step-time[data-v-898fd423] {
137
+ .step-finish .step-time[data-v-b8bad090] {
138
138
  color: var(--success);
139
139
  }
140
- .step-description[data-v-898fd423] {
140
+ .step-description[data-v-b8bad090] {
141
141
  font-size: 12px;
142
142
  line-height: 20px;
143
143
  opacity: 0.65;
144
144
  }
145
- .step-wait .step-title[data-v-898fd423] {
145
+ .step-wait .step-title[data-v-b8bad090] {
146
146
  opacity: 0.65;
147
147
  }
148
- .step-process .step-title[data-v-898fd423] {
148
+ .step-process .step-title[data-v-b8bad090] {
149
149
  color: var(--primary);
150
150
  font-weight: 600;
151
151
  }
152
- .step-error .step-title[data-v-898fd423] {
152
+ .step-error .step-title[data-v-b8bad090] {
153
153
  color: var(--error);
154
154
  }
155
- .step-clickable[data-v-898fd423] {
155
+ .step-clickable[data-v-b8bad090] {
156
156
  cursor: pointer;
157
157
  }
158
- .step-clickable:hover .step-icon[data-v-898fd423] {
158
+ .step-clickable:hover .step-icon[data-v-b8bad090] {
159
159
  transform: scale(1.05);
160
160
  }
161
- .step-clickable:not(.step-process):hover .step-icon[data-v-898fd423] {
161
+ .step-clickable:not(.step-process):hover .step-icon[data-v-b8bad090] {
162
162
  background: var(--bg-hover);
163
163
  }
164
- .step-clickable:hover .step-title[data-v-898fd423] {
164
+ .step-clickable:hover .step-title[data-v-b8bad090] {
165
165
  color: var(--primary);
166
166
  }
167
167
  @media (max-width: 768px) {
168
- .steps-horizontal[data-v-898fd423] {
168
+ .steps-horizontal[data-v-b8bad090] {
169
169
  flex-wrap: wrap;
170
170
  }
171
- .steps-horizontal .step-item[data-v-898fd423] {
171
+ .steps-horizontal .step-item[data-v-b8bad090] {
172
172
  flex: 0 0 50%;
173
173
  margin-bottom: 24px;
174
174
  }
175
- .steps-horizontal .step-line[data-v-898fd423] {
175
+ .steps-horizontal .step-line[data-v-b8bad090] {
176
176
  display: none;
177
177
  }
178
178
  }
179
179
  @media (prefers-reduced-motion: reduce) {
180
- .step-icon[data-v-898fd423],
181
- .step-line[data-v-898fd423] {
180
+ .step-icon[data-v-b8bad090],
181
+ .step-line[data-v-b8bad090] {
182
182
  transition: none;
183
183
  }
184
184
  }
185
185
 
186
186
  /* layer: icons */
187
- .i-mdi\:check[data-v-898fd423]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M21 7L9 19l-5.5-5.5l1.41-1.41L9 16.17L19.59 5.59z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
187
+ .i-mdi\:check[data-v-b8bad090]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M21 7L9 19l-5.5-5.5l1.41-1.41L9 16.17L19.59 5.59z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
package/dist/C_Steps2.cjs CHANGED
@@ -1 +1 @@
1
- require(`./chunk.cjs`);const e=require(`./useComponentTheme.cjs`),t=require(`./export-helper.cjs`);let n=require(`vue`);const r={class:`step-indicator`},i={class:`step-icon`},a={key:1,class:`i-mdi:check`},o={key:2,class:`step-index`},s={key:0,class:`step-line`},c={class:`step-content`},l={class:`step-title`},u={key:0,class:`step-time`},d={key:1,class:`step-description`},f=(0,n.defineComponent)({name:`C_Steps`,__name:`index`,props:{steps:{},current:{default:0},direction:{default:`horizontal`},clickable:{type:Boolean,default:!1},connected:{type:Boolean,default:!1}},emits:[`update:current`,`change`],setup(t,{emit:f}){let p=e.n(),m=t,h=f,g=e=>m.steps[e].status?m.steps[e].status:e<m.current?`finish`:e===m.current?`process`:`wait`,_=e=>{!m.clickable||m.steps[e].disabled||(h(`update:current`,e),h(`change`,e))};return(e,f)=>((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{class:(0,n.normalizeClass)([`c-steps`,[`steps-${t.direction}`,{"steps-connected":t.connected}]]),style:(0,n.normalizeStyle)((0,n.unref)(p))},[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(t.steps,(e,f)=>((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(t.clickable?`button`:`div`),{key:f,type:t.clickable?`button`:void 0,disabled:t.clickable&&e.disabled,"aria-current":g(f)===`process`?`step`:void 0,class:(0,n.normalizeClass)([`step-item`,[`step-${g(f)}`,{"step-clickable":t.clickable&&!e.disabled}]]),onClick:e=>_(f)},{default:(0,n.withCtx)(()=>[(0,n.createElementVNode)(`div`,r,[(0,n.createElementVNode)(`div`,i,[e.icon?((0,n.openBlock)(),(0,n.createElementBlock)(`i`,{key:0,class:(0,n.normalizeClass)(e.icon)},null,2)):g(f)===`finish`?((0,n.openBlock)(),(0,n.createElementBlock)(`i`,a)):((0,n.openBlock)(),(0,n.createElementBlock)(`span`,o,(0,n.toDisplayString)(f+1),1))]),f<t.steps.length-1?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,s)):(0,n.createCommentVNode)(`v-if`,!0)]),(0,n.createElementVNode)(`div`,c,[(0,n.createElementVNode)(`div`,l,(0,n.toDisplayString)(e.title),1),e.time?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,u,(0,n.toDisplayString)(e.time),1)):(0,n.createCommentVNode)(`v-if`,!0),e.description?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,d,(0,n.toDisplayString)(e.description),1)):(0,n.createCommentVNode)(`v-if`,!0)])]),_:2},1032,[`type`,`disabled`,`aria-current`,`class`,`onClick`]))),128))],6))}});var p=t.t(f,[[`__scopeId`,`data-v-898fd423`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return p}});
1
+ require(`./chunk.cjs`);const e=require(`./useComponentTheme.cjs`),t=require(`./export-helper.cjs`);let n=require(`vue`);const r={class:`step-indicator`},i={class:`step-icon`},a={key:2,class:`i-mdi:check`,"aria-hidden":`true`},o={key:3,class:`step-index`},s={key:0,class:`step-line`},c={class:`step-content`},l={class:`step-title`},u={key:0,class:`step-time`},d={key:1,class:`step-description`},f=(0,n.defineComponent)({name:`C_Steps`,__name:`index`,props:{steps:{},current:{default:0},direction:{default:`horizontal`},clickable:{type:Boolean,default:!1},connected:{type:Boolean,default:!1}},emits:[`update:current`,`change`],setup(t,{emit:f}){let p=e.n(),m=(0,n.defineAsyncComponent)(()=>Promise.resolve().then(()=>require(`./C_Icon2.cjs`)).then(e=>e.n)),h=t,g=f,_=(0,n.computed)(()=>h.steps.map(e=>{let t=e.icon?.replace(/^i-/,``)??``;return/^[a-z0-9]+(?:-[a-z0-9]+)*:[a-z0-9]+(?:-[a-z0-9]+)*$/.test(t)?t:``})),v=e=>h.steps[e].status?h.steps[e].status:e<h.current?`finish`:e===h.current?`process`:`wait`,y=e=>{!h.clickable||h.steps[e].disabled||(g(`update:current`,e),g(`change`,e))};return(e,f)=>((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{class:(0,n.normalizeClass)([`c-steps`,[`steps-${t.direction}`,{"steps-connected":t.connected}]]),style:(0,n.normalizeStyle)((0,n.unref)(p))},[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(t.steps,(e,f)=>((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(t.clickable?`button`:`div`),{key:f,type:t.clickable?`button`:void 0,disabled:t.clickable&&e.disabled,"aria-current":v(f)===`process`?`step`:void 0,class:(0,n.normalizeClass)([`step-item`,[`step-${v(f)}`,{"step-clickable":t.clickable&&!e.disabled}]]),onClick:e=>y(f)},{default:(0,n.withCtx)(()=>[(0,n.createElementVNode)(`div`,r,[(0,n.createElementVNode)(`div`,i,[_.value[f]?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(m),{key:0,name:_.value[f],size:16,"aria-hidden":`true`},null,8,[`name`])):e.icon?((0,n.openBlock)(),(0,n.createElementBlock)(`i`,{key:1,class:(0,n.normalizeClass)(e.icon),"aria-hidden":`true`},null,2)):v(f)===`finish`?((0,n.openBlock)(),(0,n.createElementBlock)(`i`,a)):((0,n.openBlock)(),(0,n.createElementBlock)(`span`,o,(0,n.toDisplayString)(f+1),1))]),f<t.steps.length-1?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,s)):(0,n.createCommentVNode)(`v-if`,!0)]),(0,n.createElementVNode)(`div`,c,[(0,n.createElementVNode)(`div`,l,(0,n.toDisplayString)(e.title),1),e.time?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,u,(0,n.toDisplayString)(e.time),1)):(0,n.createCommentVNode)(`v-if`,!0),e.description?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,d,(0,n.toDisplayString)(e.description),1)):(0,n.createCommentVNode)(`v-if`,!0)])]),_:2},1032,[`type`,`disabled`,`aria-current`,`class`,`onClick`]))),128))],6))}});var p=t.t(f,[[`__scopeId`,`data-v-b8bad090`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return p}});
package/dist/C_Steps2.js CHANGED
@@ -1 +1 @@
1
- import{n as e}from"./useComponentTheme.js";import{t}from"./export-helper.js";import{Fragment as n,createBlock as r,createCommentVNode as i,createElementBlock as a,createElementVNode as o,defineComponent as s,normalizeClass as c,normalizeStyle as l,openBlock as u,renderList as d,resolveDynamicComponent as f,toDisplayString as p,unref as m,withCtx as h}from"vue";const g={class:`step-indicator`},_={class:`step-icon`},v={key:1,class:`i-mdi:check`},y={key:2,class:`step-index`},b={key:0,class:`step-line`},x={class:`step-content`},S={class:`step-title`},C={key:0,class:`step-time`},w={key:1,class:`step-description`};var T=t(s({name:`C_Steps`,__name:`index`,props:{steps:{},current:{default:0},direction:{default:`horizontal`},clickable:{type:Boolean,default:!1},connected:{type:Boolean,default:!1}},emits:[`update:current`,`change`],setup(t,{emit:s}){let T=e(),E=t,D=s,O=e=>E.steps[e].status?E.steps[e].status:e<E.current?`finish`:e===E.current?`process`:`wait`,k=e=>{!E.clickable||E.steps[e].disabled||(D(`update:current`,e),D(`change`,e))};return(e,s)=>(u(),a(`div`,{class:c([`c-steps`,[`steps-${t.direction}`,{"steps-connected":t.connected}]]),style:l(m(T))},[(u(!0),a(n,null,d(t.steps,(e,n)=>(u(),r(f(t.clickable?`button`:`div`),{key:n,type:t.clickable?`button`:void 0,disabled:t.clickable&&e.disabled,"aria-current":O(n)===`process`?`step`:void 0,class:c([`step-item`,[`step-${O(n)}`,{"step-clickable":t.clickable&&!e.disabled}]]),onClick:e=>k(n)},{default:h(()=>[o(`div`,g,[o(`div`,_,[e.icon?(u(),a(`i`,{key:0,class:c(e.icon)},null,2)):O(n)===`finish`?(u(),a(`i`,v)):(u(),a(`span`,y,p(n+1),1))]),n<t.steps.length-1?(u(),a(`div`,b)):i(`v-if`,!0)]),o(`div`,x,[o(`div`,S,p(e.title),1),e.time?(u(),a(`div`,C,p(e.time),1)):i(`v-if`,!0),e.description?(u(),a(`div`,w,p(e.description),1)):i(`v-if`,!0)])]),_:2},1032,[`type`,`disabled`,`aria-current`,`class`,`onClick`]))),128))],6))}}),[[`__scopeId`,`data-v-898fd423`]]);export{T as t};
1
+ import{n as e}from"./useComponentTheme.js";import{t}from"./export-helper.js";import{Fragment as n,computed as r,createBlock as i,createCommentVNode as a,createElementBlock as o,createElementVNode as s,defineAsyncComponent as c,defineComponent as l,normalizeClass as u,normalizeStyle as d,openBlock as f,renderList as p,resolveDynamicComponent as m,toDisplayString as h,unref as g,withCtx as _}from"vue";const v={class:`step-indicator`},y={class:`step-icon`},b={key:2,class:`i-mdi:check`,"aria-hidden":`true`},x={key:3,class:`step-index`},S={key:0,class:`step-line`},C={class:`step-content`},w={class:`step-title`},T={key:0,class:`step-time`},E={key:1,class:`step-description`};var D=t(l({name:`C_Steps`,__name:`index`,props:{steps:{},current:{default:0},direction:{default:`horizontal`},clickable:{type:Boolean,default:!1},connected:{type:Boolean,default:!1}},emits:[`update:current`,`change`],setup(t,{emit:l}){let D=e(),O=c(()=>import(`./C_Icon2.js`).then(e=>e.n)),k=t,A=l,j=r(()=>k.steps.map(e=>{let t=e.icon?.replace(/^i-/,``)??``;return/^[a-z0-9]+(?:-[a-z0-9]+)*:[a-z0-9]+(?:-[a-z0-9]+)*$/.test(t)?t:``})),M=e=>k.steps[e].status?k.steps[e].status:e<k.current?`finish`:e===k.current?`process`:`wait`,N=e=>{!k.clickable||k.steps[e].disabled||(A(`update:current`,e),A(`change`,e))};return(e,r)=>(f(),o(`div`,{class:u([`c-steps`,[`steps-${t.direction}`,{"steps-connected":t.connected}]]),style:d(g(D))},[(f(!0),o(n,null,p(t.steps,(e,n)=>(f(),i(m(t.clickable?`button`:`div`),{key:n,type:t.clickable?`button`:void 0,disabled:t.clickable&&e.disabled,"aria-current":M(n)===`process`?`step`:void 0,class:u([`step-item`,[`step-${M(n)}`,{"step-clickable":t.clickable&&!e.disabled}]]),onClick:e=>N(n)},{default:_(()=>[s(`div`,v,[s(`div`,y,[j.value[n]?(f(),i(g(O),{key:0,name:j.value[n],size:16,"aria-hidden":`true`},null,8,[`name`])):e.icon?(f(),o(`i`,{key:1,class:u(e.icon),"aria-hidden":`true`},null,2)):M(n)===`finish`?(f(),o(`i`,b)):(f(),o(`span`,x,h(n+1),1))]),n<t.steps.length-1?(f(),o(`div`,S)):a(`v-if`,!0)]),s(`div`,C,[s(`div`,w,h(e.title),1),e.time?(f(),o(`div`,T,h(e.time),1)):a(`v-if`,!0),e.description?(f(),o(`div`,E,h(e.description),1)):a(`v-if`,!0)])]),_:2},1032,[`type`,`disabled`,`aria-current`,`class`,`onClick`]))),128))],6))}}),[[`__scopeId`,`data-v-b8bad090`]]);export{D as t};