@robot-admin/naive-ui-components 0.18.0 → 0.19.0

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 (82) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/C_Form.cjs +1 -1
  3. package/dist/C_Table.base.css +108 -108
  4. package/dist/C_Table.css +108 -108
  5. package/dist/constants3.d.cts +3 -3
  6. package/dist/constants3.d.ts +3 -3
  7. package/dist/constants4.d.cts +3 -3
  8. package/dist/constants4.d.ts +3 -3
  9. package/dist/constants5.d.cts +2 -2
  10. package/dist/constants5.d.ts +2 -2
  11. package/dist/data.d.cts +5 -5
  12. package/dist/data.d.ts +5 -5
  13. package/dist/formValidation.cjs +1 -1
  14. package/dist/formValidation.js +1 -1
  15. package/dist/helpers.cjs +1 -1
  16. package/dist/index.cjs +1 -1
  17. package/dist/index.vue.d.cts +4 -4
  18. package/dist/index.vue.d.ts +4 -4
  19. package/dist/index10.vue.d.cts +1 -1
  20. package/dist/index10.vue.d.ts +5 -5
  21. package/dist/index11.vue.d.cts +5 -5
  22. package/dist/index12.vue.d.ts +2 -2
  23. package/dist/index13.vue.d.cts +2 -2
  24. package/dist/index13.vue.d.ts +5 -5
  25. package/dist/index14.vue.d.cts +5 -5
  26. package/dist/index16.vue.d.ts +1 -1
  27. package/dist/index17.vue.d.cts +1 -1
  28. package/dist/index17.vue.d.ts +2 -2
  29. package/dist/index18.vue.d.cts +2 -2
  30. package/dist/index19.vue.d.cts +1 -1
  31. package/dist/index19.vue.d.ts +1 -1
  32. package/dist/index2.vue.d.cts +2 -2
  33. package/dist/index2.vue.d.ts +2 -2
  34. package/dist/index20.vue.d.cts +1 -1
  35. package/dist/index20.vue.d.ts +1 -1
  36. package/dist/index21.vue.d.cts +1 -1
  37. package/dist/index21.vue.d.ts +1 -1
  38. package/dist/index22.vue.d.cts +2 -2
  39. package/dist/index22.vue.d.ts +2 -2
  40. package/dist/index25.vue.d.cts +4 -4
  41. package/dist/index25.vue.d.ts +4 -4
  42. package/dist/index26.vue.d.cts +2 -2
  43. package/dist/index26.vue.d.ts +2 -2
  44. package/dist/index3.vue.d.cts +3 -3
  45. package/dist/index3.vue.d.ts +3 -3
  46. package/dist/index6.vue.d.ts +2 -2
  47. package/dist/index7.vue.d.cts +2 -2
  48. package/dist/index8.vue.d.ts +6 -6
  49. package/dist/index9.vue.d.cts +6 -6
  50. package/dist/index9.vue.d.ts +1 -1
  51. package/dist/mapUtils.d.cts +2 -2
  52. package/dist/mapUtils.d.ts +2 -2
  53. package/dist/presets.d.cts +4 -2
  54. package/dist/presets.d.ts +4 -2
  55. package/dist/style.css +108 -108
  56. package/dist/useCalendarEvents.d.cts +1 -1
  57. package/dist/useCalendarEvents.d.ts +1 -1
  58. package/dist/useCollapsePanel.d.cts +6 -6
  59. package/dist/useCollapsePanel.d.ts +6 -6
  60. package/dist/useCropperCore.d.cts +5 -5
  61. package/dist/useCropperCore.d.ts +5 -5
  62. package/dist/useDynamicFormState.d.cts +2 -7
  63. package/dist/useDynamicFormState.d.ts +2 -7
  64. package/dist/useEdgeInteraction.d.cts +2 -2
  65. package/dist/useEdgeInteraction.d.ts +2 -2
  66. package/dist/useQRCode.d.cts +3 -3
  67. package/dist/useQRCode.d.ts +3 -3
  68. package/dist/useSignatureHistory.d.cts +5 -5
  69. package/dist/useSignatureHistory.d.ts +5 -5
  70. package/dist/useSplitResize.d.cts +6 -6
  71. package/dist/useSplitResize.d.ts +6 -6
  72. package/dist/useTableQuery.cjs +2 -2
  73. package/dist/useTableQuery.d.cts +33 -72
  74. package/dist/useTableQuery.d.ts +33 -72
  75. package/dist/useTableQuery.js +1 -1
  76. package/dist/useWorkflowValidation.d.cts +81 -81
  77. package/dist/useWorkflowValidation.d.ts +81 -81
  78. package/dist/verification.d.cts +2 -2
  79. package/dist/verification.d.ts +2 -2
  80. package/docs/guides/usage.en.md +3 -1
  81. package/docs/guides/usage.md +3 -1
  82. package/package.json +2 -2
@@ -260,23 +260,23 @@ declare const __VLS_export: vue.DefineComponent<WorkflowProps, {
260
260
  }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
261
261
  "update:modelValue": (value: WorkflowData) => any;
262
262
  change: (value: WorkflowData) => any;
263
+ save: (data: WorkflowData) => any;
263
264
  "node-click": (node: WorkflowNode<NodeType>) => any;
264
265
  "edge-click": (edge: WorkflowEdge) => any;
265
- save: (data: WorkflowData) => any;
266
266
  "validate-error": (errors: ValidationError[]) => any;
267
267
  }, string, vue.PublicProps, Readonly<WorkflowProps> & Readonly<{
268
268
  "onUpdate:modelValue"?: ((value: WorkflowData) => any) | undefined;
269
269
  onChange?: ((value: WorkflowData) => any) | undefined;
270
+ onSave?: ((data: WorkflowData) => any) | undefined;
270
271
  "onNode-click"?: ((node: WorkflowNode<NodeType>) => any) | undefined;
271
272
  "onEdge-click"?: ((edge: WorkflowEdge) => any) | undefined;
272
- onSave?: ((data: WorkflowData) => any) | undefined;
273
273
  "onValidate-error"?: ((errors: ValidationError[]) => any) | undefined;
274
274
  }>, {
275
- readonly: boolean;
276
275
  theme: "light" | "dark";
277
276
  users: User[];
278
277
  roles: Role[];
279
278
  departments: Department[];
279
+ readonly: boolean;
280
280
  allowCycles: boolean;
281
281
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
282
282
  declare const _default: typeof __VLS_export;
@@ -303,19 +303,10 @@ declare function useWorkflowNodes(props: WorkflowProps, emit: EmitFn$1, vueFlowR
303
303
  zIndex?: number | undefined;
304
304
  extent?: "parent" | [[number, number], [number, number]] | undefined;
305
305
  expandParent?: boolean | undefined;
306
- type: "copy";
306
+ type: "start";
307
307
  data: {
308
- copyUsers?: {
309
- id: string;
310
- name: string;
311
- avatar?: string | undefined;
312
- department: string;
313
- role: string;
314
- email?: string | undefined;
315
- phone?: string | undefined;
316
- }[] | undefined;
317
308
  title: string;
318
- status?: NodeStatus | undefined;
309
+ status: "active";
319
310
  config?: Record<string, unknown> | undefined;
320
311
  initiators?: {
321
312
  id: string;
@@ -345,10 +336,19 @@ declare function useWorkflowNodes(props: WorkflowProps, emit: EmitFn$1, vueFlowR
345
336
  zIndex?: number | undefined;
346
337
  extent?: "parent" | [[number, number], [number, number]] | undefined;
347
338
  expandParent?: boolean | undefined;
348
- type: "start";
339
+ type: "copy";
349
340
  data: {
341
+ copyUsers?: {
342
+ id: string;
343
+ name: string;
344
+ avatar?: string | undefined;
345
+ department: string;
346
+ role: string;
347
+ email?: string | undefined;
348
+ phone?: string | undefined;
349
+ }[] | undefined;
350
350
  title: string;
351
- status: "active";
351
+ status?: NodeStatus | undefined;
352
352
  config?: Record<string, unknown> | undefined;
353
353
  initiators?: {
354
354
  id: string;
@@ -461,19 +461,10 @@ declare function useWorkflowNodes(props: WorkflowProps, emit: EmitFn$1, vueFlowR
461
461
  zIndex?: number | undefined;
462
462
  extent?: "parent" | [[number, number], [number, number]] | undefined;
463
463
  expandParent?: boolean | undefined;
464
- type: "copy";
464
+ type: "start";
465
465
  data: {
466
- copyUsers?: {
467
- id: string;
468
- name: string;
469
- avatar?: string | undefined;
470
- department: string;
471
- role: string;
472
- email?: string | undefined;
473
- phone?: string | undefined;
474
- }[] | undefined;
475
466
  title: string;
476
- status?: NodeStatus | undefined;
467
+ status: "active";
477
468
  config?: Record<string, unknown> | undefined;
478
469
  initiators?: {
479
470
  id: string;
@@ -503,10 +494,19 @@ declare function useWorkflowNodes(props: WorkflowProps, emit: EmitFn$1, vueFlowR
503
494
  zIndex?: number | undefined;
504
495
  extent?: "parent" | [[number, number], [number, number]] | undefined;
505
496
  expandParent?: boolean | undefined;
506
- type: "start";
497
+ type: "copy";
507
498
  data: {
499
+ copyUsers?: {
500
+ id: string;
501
+ name: string;
502
+ avatar?: string | undefined;
503
+ department: string;
504
+ role: string;
505
+ email?: string | undefined;
506
+ phone?: string | undefined;
507
+ }[] | undefined;
508
508
  title: string;
509
- status: "active";
509
+ status?: NodeStatus | undefined;
510
510
  config?: Record<string, unknown> | undefined;
511
511
  initiators?: {
512
512
  id: string;
@@ -672,19 +672,10 @@ declare function useWorkflowNodes(props: WorkflowProps, emit: EmitFn$1, vueFlowR
672
672
  zIndex?: number | undefined;
673
673
  extent?: "parent" | [[number, number], [number, number]] | undefined;
674
674
  expandParent?: boolean | undefined;
675
- type: "copy";
675
+ type: "start";
676
676
  data: {
677
- copyUsers?: {
678
- id: string;
679
- name: string;
680
- avatar?: string | undefined;
681
- department: string;
682
- role: string;
683
- email?: string | undefined;
684
- phone?: string | undefined;
685
- }[] | undefined;
686
677
  title: string;
687
- status?: NodeStatus | undefined;
678
+ status: "active";
688
679
  config?: Record<string, unknown> | undefined;
689
680
  initiators?: {
690
681
  id: string;
@@ -714,10 +705,19 @@ declare function useWorkflowNodes(props: WorkflowProps, emit: EmitFn$1, vueFlowR
714
705
  zIndex?: number | undefined;
715
706
  extent?: "parent" | [[number, number], [number, number]] | undefined;
716
707
  expandParent?: boolean | undefined;
717
- type: "start";
708
+ type: "copy";
718
709
  data: {
710
+ copyUsers?: {
711
+ id: string;
712
+ name: string;
713
+ avatar?: string | undefined;
714
+ department: string;
715
+ role: string;
716
+ email?: string | undefined;
717
+ phone?: string | undefined;
718
+ }[] | undefined;
719
719
  title: string;
720
- status: "active";
720
+ status?: NodeStatus | undefined;
721
721
  config?: Record<string, unknown> | undefined;
722
722
  initiators?: {
723
723
  id: string;
@@ -830,19 +830,10 @@ declare function useWorkflowNodes(props: WorkflowProps, emit: EmitFn$1, vueFlowR
830
830
  zIndex?: number | undefined;
831
831
  extent?: "parent" | [[number, number], [number, number]] | undefined;
832
832
  expandParent?: boolean | undefined;
833
- type: "copy";
833
+ type: "start";
834
834
  data: {
835
- copyUsers?: {
836
- id: string;
837
- name: string;
838
- avatar?: string | undefined;
839
- department: string;
840
- role: string;
841
- email?: string | undefined;
842
- phone?: string | undefined;
843
- }[] | undefined;
844
835
  title: string;
845
- status?: NodeStatus | undefined;
836
+ status: "active";
846
837
  config?: Record<string, unknown> | undefined;
847
838
  initiators?: {
848
839
  id: string;
@@ -872,10 +863,19 @@ declare function useWorkflowNodes(props: WorkflowProps, emit: EmitFn$1, vueFlowR
872
863
  zIndex?: number | undefined;
873
864
  extent?: "parent" | [[number, number], [number, number]] | undefined;
874
865
  expandParent?: boolean | undefined;
875
- type: "start";
866
+ type: "copy";
876
867
  data: {
868
+ copyUsers?: {
869
+ id: string;
870
+ name: string;
871
+ avatar?: string | undefined;
872
+ department: string;
873
+ role: string;
874
+ email?: string | undefined;
875
+ phone?: string | undefined;
876
+ }[] | undefined;
877
877
  title: string;
878
- status: "active";
878
+ status?: NodeStatus | undefined;
879
879
  config?: Record<string, unknown> | undefined;
880
880
  initiators?: {
881
881
  id: string;
@@ -1047,19 +1047,10 @@ declare function useWorkflowPreview(nodes: Ref<WorkflowNode[]>, edges: Ref<Workf
1047
1047
  zIndex?: number | undefined;
1048
1048
  extent?: "parent" | [[number, number], [number, number]] | undefined;
1049
1049
  expandParent?: boolean | undefined;
1050
- type: "copy";
1050
+ type: "start";
1051
1051
  data: {
1052
- copyUsers?: {
1053
- id: string;
1054
- name: string;
1055
- avatar?: string | undefined;
1056
- department: string;
1057
- role: string;
1058
- email?: string | undefined;
1059
- phone?: string | undefined;
1060
- }[] | undefined;
1061
1052
  title: string;
1062
- status?: NodeStatus | undefined;
1053
+ status: "active";
1063
1054
  config?: Record<string, unknown> | undefined;
1064
1055
  initiators?: {
1065
1056
  id: string;
@@ -1089,10 +1080,19 @@ declare function useWorkflowPreview(nodes: Ref<WorkflowNode[]>, edges: Ref<Workf
1089
1080
  zIndex?: number | undefined;
1090
1081
  extent?: "parent" | [[number, number], [number, number]] | undefined;
1091
1082
  expandParent?: boolean | undefined;
1092
- type: "start";
1083
+ type: "copy";
1093
1084
  data: {
1085
+ copyUsers?: {
1086
+ id: string;
1087
+ name: string;
1088
+ avatar?: string | undefined;
1089
+ department: string;
1090
+ role: string;
1091
+ email?: string | undefined;
1092
+ phone?: string | undefined;
1093
+ }[] | undefined;
1094
1094
  title: string;
1095
- status: "active";
1095
+ status?: NodeStatus | undefined;
1096
1096
  config?: Record<string, unknown> | undefined;
1097
1097
  initiators?: {
1098
1098
  id: string;
@@ -1222,19 +1222,10 @@ declare function useWorkflowPreview(nodes: Ref<WorkflowNode[]>, edges: Ref<Workf
1222
1222
  zIndex?: number | undefined;
1223
1223
  extent?: "parent" | [[number, number], [number, number]] | undefined;
1224
1224
  expandParent?: boolean | undefined;
1225
- type: "copy";
1225
+ type: "start";
1226
1226
  data: {
1227
- copyUsers?: {
1228
- id: string;
1229
- name: string;
1230
- avatar?: string | undefined;
1231
- department: string;
1232
- role: string;
1233
- email?: string | undefined;
1234
- phone?: string | undefined;
1235
- }[] | undefined;
1236
1227
  title: string;
1237
- status?: NodeStatus | undefined;
1228
+ status: "active";
1238
1229
  config?: Record<string, unknown> | undefined;
1239
1230
  initiators?: {
1240
1231
  id: string;
@@ -1264,10 +1255,19 @@ declare function useWorkflowPreview(nodes: Ref<WorkflowNode[]>, edges: Ref<Workf
1264
1255
  zIndex?: number | undefined;
1265
1256
  extent?: "parent" | [[number, number], [number, number]] | undefined;
1266
1257
  expandParent?: boolean | undefined;
1267
- type: "start";
1258
+ type: "copy";
1268
1259
  data: {
1260
+ copyUsers?: {
1261
+ id: string;
1262
+ name: string;
1263
+ avatar?: string | undefined;
1264
+ department: string;
1265
+ role: string;
1266
+ email?: string | undefined;
1267
+ phone?: string | undefined;
1268
+ }[] | undefined;
1269
1269
  title: string;
1270
- status: "active";
1270
+ status?: NodeStatus | undefined;
1271
1271
  config?: Record<string, unknown> | undefined;
1272
1272
  initiators?: {
1273
1273
  id: string;
@@ -79,17 +79,17 @@ declare const __VLS_export: vue.DefineComponent<CaptchaProps, {
79
79
  change: (valid: boolean) => any;
80
80
  success: (data: CaptchaSuccessPayload) => any;
81
81
  reset: () => any;
82
- "load-error": (error: unknown) => any;
83
82
  fail: (error: string) => any;
84
83
  "verify-error": (error: unknown) => any;
84
+ "load-error": (error: unknown) => any;
85
85
  "visible-change": (visible: boolean) => any;
86
86
  }, string, vue.PublicProps, Readonly<CaptchaProps> & Readonly<{
87
87
  onChange?: ((valid: boolean) => any) | undefined;
88
88
  onSuccess?: ((data: CaptchaSuccessPayload) => any) | undefined;
89
89
  onReset?: (() => any) | undefined;
90
- "onLoad-error"?: ((error: unknown) => any) | undefined;
91
90
  onFail?: ((error: string) => any) | undefined;
92
91
  "onVerify-error"?: ((error: unknown) => any) | undefined;
92
+ "onLoad-error"?: ((error: unknown) => any) | undefined;
93
93
  "onVisible-change"?: ((visible: boolean) => any) | undefined;
94
94
  }>, {
95
95
  disabled: boolean;
@@ -79,17 +79,17 @@ declare const __VLS_export: vue.DefineComponent<CaptchaProps, {
79
79
  change: (valid: boolean) => any;
80
80
  success: (data: CaptchaSuccessPayload) => any;
81
81
  reset: () => any;
82
- "load-error": (error: unknown) => any;
83
82
  fail: (error: string) => any;
84
83
  "verify-error": (error: unknown) => any;
84
+ "load-error": (error: unknown) => any;
85
85
  "visible-change": (visible: boolean) => any;
86
86
  }, string, vue.PublicProps, Readonly<CaptchaProps> & Readonly<{
87
87
  onChange?: ((valid: boolean) => any) | undefined;
88
88
  onSuccess?: ((data: CaptchaSuccessPayload) => any) | undefined;
89
89
  onReset?: (() => any) | undefined;
90
- "onLoad-error"?: ((error: unknown) => any) | undefined;
91
90
  onFail?: ((error: string) => any) | undefined;
92
91
  "onVerify-error"?: ((error: unknown) => any) | undefined;
92
+ "onLoad-error"?: ((error: unknown) => any) | undefined;
93
93
  "onVisible-change"?: ((visible: boolean) => any) | undefined;
94
94
  }>, {
95
95
  disabled: boolean;
@@ -421,7 +421,9 @@ Read `TimeExpose.startTime/endTime/singleTime` directly as numbers or null, and
421
421
 
422
422
  ### Table pagination, selection, and export
423
423
 
424
- `TableProps<Row>` includes `config`, `crud`, `remote`, and `virtualScrollX`; columns and data may be omitted when supplied by CRUD. Legacy edit, expansion, and selection prop types remain as compatibility declarations; component features belong in `config`.
424
+ `TableProps<Row>` includes `config`, `crud`, `remote`, and `virtualScrollX`; columns and data may be omitted when supplied by CRUD. `TableProps` shares runtime props with the component and retains native display attributes such as `size` / `minHeight` and actual event listeners. Since 0.19 it rejects previously ignored legacy props (`editable`, `editMode`, `onLoadExpandData`, `enableSelection`); use `config.edit`, `config.expand`, and `config.selection`. Use `config.display.maxHeight` and `config.display.scrollX` for height limits and horizontal scrolling; top-level attributes are overridden internally and are excluded from the main contract. Standalone deprecated types remain available.
425
+
426
+ Form submission, table save, and action callbacks accept business return values such as `Promise<Row>` or `Promise<boolean>` directly. For example, use `onClick: form.submit` or `onSave: saveRow`. The component waits for asynchronous completion and retains its loading, concurrency, and error handling; callback results are ignored. Boolean guards keep their separate result contract.
425
427
 
426
428
  Use `config.pagination` for new pages. For remote tables, bind the `useTableQuery().bindings` shown above so pagination, totals, loading, and requests have one owner. The compatibility `:pagination="..."` prop delegates pagination to Naive UI. Explicitly passing that prop, including `false`, takes precedence over `config.pagination`; the component does not render a second pager. With native remote pagination, also pass `remote` and manage requests and native update events yourself.
427
429
 
@@ -482,7 +482,9 @@ function preview() {
482
482
 
483
483
  ### 表格分页、选择与导出
484
484
 
485
- `TableProps<Row>` 支持 `config`、`crud`、`remote` 与 `virtualScrollX`;CRUD 绑定已提供列和数据时不必重复传入。旧编辑、展开和选择属性类型仅保留兼容声明,组件功能统一放在 `config` 中。
485
+ `TableProps<Row>` 支持 `config`、`crud`、`remote` 与 `virtualScrollX`;CRUD 绑定已提供列和数据时不必重复传入。`TableProps` 与组件共用实际运行属性,并保留 `size`、`minHeight` 等原生显示属性和真实事件监听器。从 0.19 起,主契约不再接受未生效的旧属性(如 `editable`、`editMode`、`onLoadExpandData`、`enableSelection`);分别迁移到 `config.edit`、`config.expand`、`config.selection`。高度上限和横向滚动使用 `config.display.maxHeight` / `config.display.scrollX`;顶层同名属性会被内部绑定覆盖,因此不再列入主契约。独立旧类型仍保留弃用声明。
486
+
487
+ 表单 `onSubmit`、表格 `onSave` 和操作按钮 `onClick` 可直接传入业务函数,例如 `onClick: form.submit` 或 `onSave: saveRow`,即使函数返回 `Promise<Row>` 或 `Promise<boolean>` 也无需包装。组件等待异步完成以维护 loading、并发和错误状态;这些回调的返回值不参与业务判断。返回值有语义的切换守卫继续保留自己的布尔契约。
486
488
 
487
489
  新页面统一通过 `config.pagination` 配置分页;远程表格直接使用上例 `useTableQuery().bindings`,分页、总数、loading 与请求只维护一份状态。兼容路径 `:pagination="..."` 由 Naive 原生分页负责;只要显式传入该 prop(包括 `false`),它就优先于 `config.pagination`,组件不会再显示第二个分页器。原生远程模式同时传 `remote` 并自行管理请求及原生更新事件。
488
490
 
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.18.0",
6
+ "version": "0.19.0",
7
7
  "description": "基于 Naive UI 的 Vue 3 组件库",
8
8
  "packageManager": "bun@1.3.14",
9
9
  "engines": {
@@ -141,7 +141,7 @@
141
141
  "@fullcalendar/list": "^6.1.21",
142
142
  "@fullcalendar/vue3": "^6.1.21",
143
143
  "@iconify/vue": "^5.0.1",
144
- "@robot-admin/form-validate": "3.4.2",
144
+ "@robot-admin/form-validate": "3.4.4",
145
145
  "@types/leaflet": "^1.9.22",
146
146
  "@visactor/vtable": "^1.26.7",
147
147
  "@visactor/vtable-editors": "^1.26.7",