@robot-admin/naive-ui-components 0.32.0 → 0.33.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.
- package/CHANGELOG.md +8 -0
- package/README.md +3 -1
- package/README_EN.md +3 -1
- package/dist/C_DataPicker.css +60 -23
- package/dist/C_Form.base.css +1 -1
- package/dist/C_Form.css +1 -1
- package/dist/C_FormSearch.css +93 -72
- package/dist/C_FormSearch.d.cts +2 -2
- package/dist/C_FormSearch.d.ts +2 -2
- package/dist/C_GlobalSearch2.cjs +1 -1
- package/dist/C_GlobalSearch2.js +1 -1
- package/dist/C_Select.css +1 -1
- package/dist/C_Select.d.cts +2 -2
- package/dist/C_Select.d.ts +2 -2
- package/dist/C_Select2.cjs +1 -1
- package/dist/C_Select2.js +1 -1
- package/dist/C_Table.base.css +147 -147
- package/dist/C_Table.cjs +1 -1
- package/dist/C_Table.css +146 -146
- package/dist/C_Table.d.cts +3 -3
- package/dist/C_Table.d.ts +3 -3
- package/dist/C_Table.js +1 -1
- package/dist/C_Table2.cjs +4 -3
- package/dist/C_Table2.js +4 -3
- package/dist/C_TagsView.css +51 -51
- package/dist/C_TagsView2.cjs +1 -1
- package/dist/C_TagsView2.js +1 -1
- package/dist/C_Tree.css +60 -23
- package/dist/C_Tree.d.cts +2 -2
- package/dist/C_Tree.d.ts +2 -2
- package/dist/C_Tree2.cjs +1 -1
- package/dist/C_Tree2.js +1 -1
- package/dist/SearchFieldSettings.cjs +1 -0
- package/dist/SearchFieldSettings.js +1 -0
- package/dist/constants.d.cts +2 -2
- package/dist/constants.d.ts +2 -2
- package/dist/constants2.d.cts +2 -2
- package/dist/constants2.d.ts +2 -2
- package/dist/constants4.d.cts +8 -8
- package/dist/constants4.d.ts +8 -8
- package/dist/constants5.d.cts +2 -2
- package/dist/constants5.d.ts +2 -2
- package/dist/data2.d.cts +8 -8
- package/dist/data2.d.ts +8 -8
- package/dist/dateRange.d.cts +44 -4
- package/dist/dateRange.d.ts +44 -4
- package/dist/editors.cjs +1 -0
- package/dist/{useTableQuery.d.cts → editors.d.cts} +123 -14
- package/dist/{useTableQuery.d.ts → editors.d.ts} +123 -14
- package/dist/editors.js +1 -0
- package/dist/fieldRenderers.cjs +1 -1
- package/dist/fieldRenderers.js +1 -1
- package/dist/formField.cjs +1 -1
- package/dist/formField.d.cts +35 -12
- package/dist/formField.d.ts +35 -12
- package/dist/formField.js +1 -1
- package/dist/helpers.cjs +1 -1
- package/dist/helpers.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +1 -1
- package/dist/index.vue.d.cts +4 -4
- package/dist/index.vue.d.ts +4 -4
- package/dist/index10.vue.d.cts +2 -2
- package/dist/index10.vue.d.ts +4 -4
- package/dist/index11.vue.d.cts +4 -4
- package/dist/index11.vue.d.ts +1 -1
- package/dist/index12.vue.d.cts +1 -1
- package/dist/index13.vue.d.ts +4 -4
- package/dist/index14.vue.d.cts +4 -4
- package/dist/index16.vue.d.ts +3 -3
- package/dist/index17.vue.d.cts +3 -3
- package/dist/index17.vue.d.ts +7 -7
- package/dist/index18.vue.d.cts +7 -7
- package/dist/index18.vue.d.ts +2 -2
- package/dist/index19.vue.d.cts +2 -2
- package/dist/index2.vue.d.cts +2 -2
- package/dist/index2.vue.d.ts +2 -2
- package/dist/index21.vue.d.ts +5 -5
- package/dist/index22.vue.d.cts +5 -5
- package/dist/index22.vue.d.ts +3 -3
- package/dist/index23.vue.d.cts +1 -1
- package/dist/index23.vue.d.ts +1 -1
- package/dist/index25.vue.d.cts +2 -2
- package/dist/index25.vue.d.ts +2 -2
- package/dist/index26.vue.d.cts +3 -3
- package/dist/index26.vue.d.ts +3 -3
- package/dist/index27.vue.d.cts +1 -1
- package/dist/index27.vue.d.ts +1 -1
- package/dist/index28.vue.d.cts +2 -2
- package/dist/index28.vue.d.ts +2 -2
- package/dist/index3.vue.d.cts +2 -2
- package/dist/index3.vue.d.ts +2 -2
- package/dist/index30.vue.d.cts +1 -1
- package/dist/index30.vue.d.ts +1 -1
- package/dist/index31.vue.d.cts +2 -2
- package/dist/index31.vue.d.ts +2 -2
- package/dist/index32.vue.d.cts +2 -2
- package/dist/index32.vue.d.ts +2 -2
- package/dist/index4.vue.d.cts +3 -3
- package/dist/index4.vue.d.ts +3 -3
- package/dist/index6.vue.d.cts +3 -3
- package/dist/index7.vue.d.ts +2 -2
- package/dist/index8.vue.d.cts +2 -2
- package/dist/index8.vue.d.ts +3 -3
- package/dist/index9.vue.d.cts +3 -3
- package/dist/index9.vue.d.ts +2 -2
- package/dist/presets.d.cts +1 -1
- package/dist/presets.d.ts +1 -1
- package/dist/public.d.ts +2 -0
- package/dist/selectPresentation.cjs +1 -1
- package/dist/selectPresentation.js +1 -1
- package/dist/serializeSearch.cjs +1 -1
- package/dist/serializeSearch.js +1 -1
- package/dist/sourceControls.cjs +1 -0
- package/dist/sourceControls.js +1 -0
- package/dist/style.css +351 -293
- package/dist/types3.d.cts +2 -0
- package/dist/types4.d.ts +10 -2
- package/dist/types5.d.cts +10 -2
- package/dist/useCalendarEvents.d.cts +1 -1
- package/dist/useCalendarEvents.d.ts +1 -1
- package/dist/useCollapsePanel.d.cts +4 -4
- package/dist/useCollapsePanel.d.ts +4 -4
- package/dist/useComponentLocale.cjs +1 -1
- package/dist/useComponentLocale.js +1 -1
- package/dist/useCropperCore.d.cts +9 -9
- package/dist/useCropperCore.d.ts +9 -9
- package/dist/useDynamicFormState.d.cts +3 -3
- package/dist/useDynamicFormState.d.ts +3 -3
- package/dist/useEdgeInteraction.d.cts +2 -2
- package/dist/useEdgeInteraction.d.ts +2 -2
- package/dist/useFullscreen.d.cts +3 -3
- package/dist/useFullscreen.d.ts +3 -3
- package/dist/useGlobalSearch.d.cts +8 -0
- package/dist/useGlobalSearch.d.ts +8 -0
- package/dist/useGridWidth.cjs +1 -1
- package/dist/useGridWidth.js +1 -1
- package/dist/useInfiniteScroll.d.cts +1 -1
- package/dist/useInfiniteScroll.d.ts +1 -1
- package/dist/useQRCode.d.cts +1 -1
- package/dist/useQRCode.d.ts +1 -1
- package/dist/useSignatureHistory.d.cts +5 -5
- package/dist/useSignatureHistory.d.ts +5 -5
- package/dist/useSplitResize.d.cts +7 -7
- package/dist/useSplitResize.d.ts +7 -7
- package/dist/useWorkflowValidation.d.cts +37 -37
- package/dist/useWorkflowValidation.d.ts +37 -37
- package/dist/verification.d.cts +8 -8
- package/dist/verification.d.ts +8 -8
- package/docs/guides/component-contracts.md +72 -0
- package/docs/guides/remote-options.md +24 -0
- package/docs/guides/search-workflows.md +63 -0
- package/docs/guides/table-editing.md +79 -0
- package/docs/guides/tree.en.md +41 -0
- package/docs/guides/tree.md +80 -1
- package/package.json +1 -1
- package/dist/temporalField.cjs +0 -1
- package/dist/temporalField.js +0 -1
- package/dist/useTableQuery.cjs +0 -1
- package/dist/useTableQuery.js +0 -1
|
@@ -259,22 +259,22 @@ declare const __VLS_export: vue.DefineComponent<WorkflowProps, {
|
|
|
259
259
|
conditionNodes: number;
|
|
260
260
|
}>;
|
|
261
261
|
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
262
|
-
"update:modelValue": (value: WorkflowData) => any;
|
|
263
262
|
change: (value: WorkflowData) => any;
|
|
264
|
-
|
|
265
|
-
"validate-error": (errors: ValidationError[]) => any;
|
|
263
|
+
"update:modelValue": (value: WorkflowData) => any;
|
|
266
264
|
"node-click": (node: WorkflowNode<NodeType>) => any;
|
|
265
|
+
save: (data: WorkflowData) => any;
|
|
267
266
|
"edge-click": (edge: WorkflowEdge) => any;
|
|
267
|
+
"validate-error": (errors: ValidationError[]) => any;
|
|
268
268
|
}, string, vue.PublicProps, Readonly<WorkflowProps> & Readonly<{
|
|
269
|
-
"onUpdate:modelValue"?: ((value: WorkflowData) => any) | undefined;
|
|
270
269
|
onChange?: ((value: WorkflowData) => any) | undefined;
|
|
271
|
-
|
|
272
|
-
"onValidate-error"?: ((errors: ValidationError[]) => any) | undefined;
|
|
270
|
+
"onUpdate:modelValue"?: ((value: WorkflowData) => any) | undefined;
|
|
273
271
|
"onNode-click"?: ((node: WorkflowNode<NodeType>) => any) | undefined;
|
|
272
|
+
onSave?: ((data: WorkflowData) => any) | undefined;
|
|
274
273
|
"onEdge-click"?: ((edge: WorkflowEdge) => any) | undefined;
|
|
274
|
+
"onValidate-error"?: ((errors: ValidationError[]) => any) | undefined;
|
|
275
275
|
}>, {
|
|
276
|
-
readonly: boolean;
|
|
277
276
|
theme: "light" | "dark";
|
|
277
|
+
readonly: boolean;
|
|
278
278
|
users: User[];
|
|
279
279
|
roles: Role[];
|
|
280
280
|
departments: Department[];
|
|
@@ -337,9 +337,9 @@ declare function useWorkflowNodes(props: WorkflowProps, emit: EmitFn$1, vueFlowR
|
|
|
337
337
|
zIndex?: number | undefined;
|
|
338
338
|
extent?: "parent" | [[number, number], [number, number]] | undefined;
|
|
339
339
|
expandParent?: boolean | undefined;
|
|
340
|
-
type: "
|
|
340
|
+
type: "copy";
|
|
341
341
|
data: {
|
|
342
|
-
|
|
342
|
+
copyUsers?: {
|
|
343
343
|
id: string;
|
|
344
344
|
name: string;
|
|
345
345
|
avatar?: string | undefined;
|
|
@@ -348,7 +348,6 @@ declare function useWorkflowNodes(props: WorkflowProps, emit: EmitFn$1, vueFlowR
|
|
|
348
348
|
email?: string | undefined;
|
|
349
349
|
phone?: string | undefined;
|
|
350
350
|
}[] | undefined;
|
|
351
|
-
approvalMode?: ApprovalMode | undefined;
|
|
352
351
|
title: string;
|
|
353
352
|
status?: NodeStatus | undefined;
|
|
354
353
|
config?: Record<string, unknown> | undefined;
|
|
@@ -380,9 +379,9 @@ declare function useWorkflowNodes(props: WorkflowProps, emit: EmitFn$1, vueFlowR
|
|
|
380
379
|
zIndex?: number | undefined;
|
|
381
380
|
extent?: "parent" | [[number, number], [number, number]] | undefined;
|
|
382
381
|
expandParent?: boolean | undefined;
|
|
383
|
-
type: "
|
|
382
|
+
type: "approval";
|
|
384
383
|
data: {
|
|
385
|
-
|
|
384
|
+
approvers?: {
|
|
386
385
|
id: string;
|
|
387
386
|
name: string;
|
|
388
387
|
avatar?: string | undefined;
|
|
@@ -391,6 +390,7 @@ declare function useWorkflowNodes(props: WorkflowProps, emit: EmitFn$1, vueFlowR
|
|
|
391
390
|
email?: string | undefined;
|
|
392
391
|
phone?: string | undefined;
|
|
393
392
|
}[] | undefined;
|
|
393
|
+
approvalMode?: ApprovalMode | undefined;
|
|
394
394
|
title: string;
|
|
395
395
|
status?: NodeStatus | undefined;
|
|
396
396
|
config?: Record<string, unknown> | undefined;
|
|
@@ -495,9 +495,9 @@ declare function useWorkflowNodes(props: WorkflowProps, emit: EmitFn$1, vueFlowR
|
|
|
495
495
|
zIndex?: number | undefined;
|
|
496
496
|
extent?: "parent" | [[number, number], [number, number]] | undefined;
|
|
497
497
|
expandParent?: boolean | undefined;
|
|
498
|
-
type: "
|
|
498
|
+
type: "copy";
|
|
499
499
|
data: {
|
|
500
|
-
|
|
500
|
+
copyUsers?: {
|
|
501
501
|
id: string;
|
|
502
502
|
name: string;
|
|
503
503
|
avatar?: string | undefined;
|
|
@@ -506,7 +506,6 @@ declare function useWorkflowNodes(props: WorkflowProps, emit: EmitFn$1, vueFlowR
|
|
|
506
506
|
email?: string | undefined;
|
|
507
507
|
phone?: string | undefined;
|
|
508
508
|
}[] | undefined;
|
|
509
|
-
approvalMode?: ApprovalMode | undefined;
|
|
510
509
|
title: string;
|
|
511
510
|
status?: NodeStatus | undefined;
|
|
512
511
|
config?: Record<string, unknown> | undefined;
|
|
@@ -538,9 +537,9 @@ declare function useWorkflowNodes(props: WorkflowProps, emit: EmitFn$1, vueFlowR
|
|
|
538
537
|
zIndex?: number | undefined;
|
|
539
538
|
extent?: "parent" | [[number, number], [number, number]] | undefined;
|
|
540
539
|
expandParent?: boolean | undefined;
|
|
541
|
-
type: "
|
|
540
|
+
type: "approval";
|
|
542
541
|
data: {
|
|
543
|
-
|
|
542
|
+
approvers?: {
|
|
544
543
|
id: string;
|
|
545
544
|
name: string;
|
|
546
545
|
avatar?: string | undefined;
|
|
@@ -549,6 +548,7 @@ declare function useWorkflowNodes(props: WorkflowProps, emit: EmitFn$1, vueFlowR
|
|
|
549
548
|
email?: string | undefined;
|
|
550
549
|
phone?: string | undefined;
|
|
551
550
|
}[] | undefined;
|
|
551
|
+
approvalMode?: ApprovalMode | undefined;
|
|
552
552
|
title: string;
|
|
553
553
|
status?: NodeStatus | undefined;
|
|
554
554
|
config?: Record<string, unknown> | undefined;
|
|
@@ -706,9 +706,9 @@ declare function useWorkflowNodes(props: WorkflowProps, emit: EmitFn$1, vueFlowR
|
|
|
706
706
|
zIndex?: number | undefined;
|
|
707
707
|
extent?: "parent" | [[number, number], [number, number]] | undefined;
|
|
708
708
|
expandParent?: boolean | undefined;
|
|
709
|
-
type: "
|
|
709
|
+
type: "copy";
|
|
710
710
|
data: {
|
|
711
|
-
|
|
711
|
+
copyUsers?: {
|
|
712
712
|
id: string;
|
|
713
713
|
name: string;
|
|
714
714
|
avatar?: string | undefined;
|
|
@@ -717,7 +717,6 @@ declare function useWorkflowNodes(props: WorkflowProps, emit: EmitFn$1, vueFlowR
|
|
|
717
717
|
email?: string | undefined;
|
|
718
718
|
phone?: string | undefined;
|
|
719
719
|
}[] | undefined;
|
|
720
|
-
approvalMode?: ApprovalMode | undefined;
|
|
721
720
|
title: string;
|
|
722
721
|
status?: NodeStatus | undefined;
|
|
723
722
|
config?: Record<string, unknown> | undefined;
|
|
@@ -749,9 +748,9 @@ declare function useWorkflowNodes(props: WorkflowProps, emit: EmitFn$1, vueFlowR
|
|
|
749
748
|
zIndex?: number | undefined;
|
|
750
749
|
extent?: "parent" | [[number, number], [number, number]] | undefined;
|
|
751
750
|
expandParent?: boolean | undefined;
|
|
752
|
-
type: "
|
|
751
|
+
type: "approval";
|
|
753
752
|
data: {
|
|
754
|
-
|
|
753
|
+
approvers?: {
|
|
755
754
|
id: string;
|
|
756
755
|
name: string;
|
|
757
756
|
avatar?: string | undefined;
|
|
@@ -760,6 +759,7 @@ declare function useWorkflowNodes(props: WorkflowProps, emit: EmitFn$1, vueFlowR
|
|
|
760
759
|
email?: string | undefined;
|
|
761
760
|
phone?: string | undefined;
|
|
762
761
|
}[] | undefined;
|
|
762
|
+
approvalMode?: ApprovalMode | undefined;
|
|
763
763
|
title: string;
|
|
764
764
|
status?: NodeStatus | undefined;
|
|
765
765
|
config?: Record<string, unknown> | undefined;
|
|
@@ -864,9 +864,9 @@ declare function useWorkflowNodes(props: WorkflowProps, emit: EmitFn$1, vueFlowR
|
|
|
864
864
|
zIndex?: number | undefined;
|
|
865
865
|
extent?: "parent" | [[number, number], [number, number]] | undefined;
|
|
866
866
|
expandParent?: boolean | undefined;
|
|
867
|
-
type: "
|
|
867
|
+
type: "copy";
|
|
868
868
|
data: {
|
|
869
|
-
|
|
869
|
+
copyUsers?: {
|
|
870
870
|
id: string;
|
|
871
871
|
name: string;
|
|
872
872
|
avatar?: string | undefined;
|
|
@@ -875,7 +875,6 @@ declare function useWorkflowNodes(props: WorkflowProps, emit: EmitFn$1, vueFlowR
|
|
|
875
875
|
email?: string | undefined;
|
|
876
876
|
phone?: string | undefined;
|
|
877
877
|
}[] | undefined;
|
|
878
|
-
approvalMode?: ApprovalMode | undefined;
|
|
879
878
|
title: string;
|
|
880
879
|
status?: NodeStatus | undefined;
|
|
881
880
|
config?: Record<string, unknown> | undefined;
|
|
@@ -907,9 +906,9 @@ declare function useWorkflowNodes(props: WorkflowProps, emit: EmitFn$1, vueFlowR
|
|
|
907
906
|
zIndex?: number | undefined;
|
|
908
907
|
extent?: "parent" | [[number, number], [number, number]] | undefined;
|
|
909
908
|
expandParent?: boolean | undefined;
|
|
910
|
-
type: "
|
|
909
|
+
type: "approval";
|
|
911
910
|
data: {
|
|
912
|
-
|
|
911
|
+
approvers?: {
|
|
913
912
|
id: string;
|
|
914
913
|
name: string;
|
|
915
914
|
avatar?: string | undefined;
|
|
@@ -918,6 +917,7 @@ declare function useWorkflowNodes(props: WorkflowProps, emit: EmitFn$1, vueFlowR
|
|
|
918
917
|
email?: string | undefined;
|
|
919
918
|
phone?: string | undefined;
|
|
920
919
|
}[] | undefined;
|
|
920
|
+
approvalMode?: ApprovalMode | undefined;
|
|
921
921
|
title: string;
|
|
922
922
|
status?: NodeStatus | undefined;
|
|
923
923
|
config?: Record<string, unknown> | undefined;
|
|
@@ -1088,9 +1088,9 @@ declare function useWorkflowPreview(nodes: Ref<WorkflowNode[]>, edges: Ref<Workf
|
|
|
1088
1088
|
zIndex?: number | undefined;
|
|
1089
1089
|
extent?: "parent" | [[number, number], [number, number]] | undefined;
|
|
1090
1090
|
expandParent?: boolean | undefined;
|
|
1091
|
-
type: "
|
|
1091
|
+
type: "copy";
|
|
1092
1092
|
data: {
|
|
1093
|
-
|
|
1093
|
+
copyUsers?: {
|
|
1094
1094
|
id: string;
|
|
1095
1095
|
name: string;
|
|
1096
1096
|
avatar?: string | undefined;
|
|
@@ -1099,7 +1099,6 @@ declare function useWorkflowPreview(nodes: Ref<WorkflowNode[]>, edges: Ref<Workf
|
|
|
1099
1099
|
email?: string | undefined;
|
|
1100
1100
|
phone?: string | undefined;
|
|
1101
1101
|
}[] | undefined;
|
|
1102
|
-
approvalMode?: ApprovalMode | undefined;
|
|
1103
1102
|
title: string;
|
|
1104
1103
|
status?: NodeStatus | undefined;
|
|
1105
1104
|
config?: Record<string, unknown> | undefined;
|
|
@@ -1131,9 +1130,9 @@ declare function useWorkflowPreview(nodes: Ref<WorkflowNode[]>, edges: Ref<Workf
|
|
|
1131
1130
|
zIndex?: number | undefined;
|
|
1132
1131
|
extent?: "parent" | [[number, number], [number, number]] | undefined;
|
|
1133
1132
|
expandParent?: boolean | undefined;
|
|
1134
|
-
type: "
|
|
1133
|
+
type: "approval";
|
|
1135
1134
|
data: {
|
|
1136
|
-
|
|
1135
|
+
approvers?: {
|
|
1137
1136
|
id: string;
|
|
1138
1137
|
name: string;
|
|
1139
1138
|
avatar?: string | undefined;
|
|
@@ -1142,6 +1141,7 @@ declare function useWorkflowPreview(nodes: Ref<WorkflowNode[]>, edges: Ref<Workf
|
|
|
1142
1141
|
email?: string | undefined;
|
|
1143
1142
|
phone?: string | undefined;
|
|
1144
1143
|
}[] | undefined;
|
|
1144
|
+
approvalMode?: ApprovalMode | undefined;
|
|
1145
1145
|
title: string;
|
|
1146
1146
|
status?: NodeStatus | undefined;
|
|
1147
1147
|
config?: Record<string, unknown> | undefined;
|
|
@@ -1263,9 +1263,9 @@ declare function useWorkflowPreview(nodes: Ref<WorkflowNode[]>, edges: Ref<Workf
|
|
|
1263
1263
|
zIndex?: number | undefined;
|
|
1264
1264
|
extent?: "parent" | [[number, number], [number, number]] | undefined;
|
|
1265
1265
|
expandParent?: boolean | undefined;
|
|
1266
|
-
type: "
|
|
1266
|
+
type: "copy";
|
|
1267
1267
|
data: {
|
|
1268
|
-
|
|
1268
|
+
copyUsers?: {
|
|
1269
1269
|
id: string;
|
|
1270
1270
|
name: string;
|
|
1271
1271
|
avatar?: string | undefined;
|
|
@@ -1274,7 +1274,6 @@ declare function useWorkflowPreview(nodes: Ref<WorkflowNode[]>, edges: Ref<Workf
|
|
|
1274
1274
|
email?: string | undefined;
|
|
1275
1275
|
phone?: string | undefined;
|
|
1276
1276
|
}[] | undefined;
|
|
1277
|
-
approvalMode?: ApprovalMode | undefined;
|
|
1278
1277
|
title: string;
|
|
1279
1278
|
status?: NodeStatus | undefined;
|
|
1280
1279
|
config?: Record<string, unknown> | undefined;
|
|
@@ -1306,9 +1305,9 @@ declare function useWorkflowPreview(nodes: Ref<WorkflowNode[]>, edges: Ref<Workf
|
|
|
1306
1305
|
zIndex?: number | undefined;
|
|
1307
1306
|
extent?: "parent" | [[number, number], [number, number]] | undefined;
|
|
1308
1307
|
expandParent?: boolean | undefined;
|
|
1309
|
-
type: "
|
|
1308
|
+
type: "approval";
|
|
1310
1309
|
data: {
|
|
1311
|
-
|
|
1310
|
+
approvers?: {
|
|
1312
1311
|
id: string;
|
|
1313
1312
|
name: string;
|
|
1314
1313
|
avatar?: string | undefined;
|
|
@@ -1317,6 +1316,7 @@ declare function useWorkflowPreview(nodes: Ref<WorkflowNode[]>, edges: Ref<Workf
|
|
|
1317
1316
|
email?: string | undefined;
|
|
1318
1317
|
phone?: string | undefined;
|
|
1319
1318
|
}[] | undefined;
|
|
1319
|
+
approvalMode?: ApprovalMode | undefined;
|
|
1320
1320
|
title: string;
|
|
1321
1321
|
status?: NodeStatus | undefined;
|
|
1322
1322
|
config?: Record<string, unknown> | undefined;
|
package/dist/verification.d.cts
CHANGED
|
@@ -77,25 +77,25 @@ declare const __VLS_export: vue.DefineComponent<CaptchaProps, {
|
|
|
77
77
|
show: () => void;
|
|
78
78
|
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
79
79
|
success: (data: CaptchaSuccessPayload) => any;
|
|
80
|
-
change: (valid: boolean) => any;
|
|
81
|
-
reset: () => any;
|
|
82
|
-
"load-error": (error: unknown) => any;
|
|
83
80
|
fail: (error: string) => any;
|
|
84
81
|
"verify-error": (error: unknown) => any;
|
|
82
|
+
"load-error": (error: unknown) => any;
|
|
83
|
+
change: (valid: boolean) => any;
|
|
85
84
|
"visible-change": (visible: boolean) => any;
|
|
85
|
+
reset: () => any;
|
|
86
86
|
}, string, vue.PublicProps, Readonly<CaptchaProps> & Readonly<{
|
|
87
87
|
onSuccess?: ((data: CaptchaSuccessPayload) => any) | undefined;
|
|
88
|
-
onChange?: ((valid: boolean) => any) | undefined;
|
|
89
|
-
onReset?: (() => any) | undefined;
|
|
90
|
-
"onLoad-error"?: ((error: unknown) => any) | undefined;
|
|
91
88
|
onFail?: ((error: string) => any) | undefined;
|
|
92
89
|
"onVerify-error"?: ((error: unknown) => any) | undefined;
|
|
90
|
+
"onLoad-error"?: ((error: unknown) => any) | undefined;
|
|
91
|
+
onChange?: ((valid: boolean) => any) | undefined;
|
|
93
92
|
"onVisible-change"?: ((visible: boolean) => any) | undefined;
|
|
93
|
+
onReset?: (() => any) | undefined;
|
|
94
94
|
}>, {
|
|
95
|
-
disabled: boolean;
|
|
96
|
-
theme: "light" | "dark";
|
|
97
95
|
provider: CaptchaProvider;
|
|
98
96
|
images: string[];
|
|
97
|
+
disabled: boolean;
|
|
98
|
+
theme: "light" | "dark";
|
|
99
99
|
verificationTimeout: number;
|
|
100
100
|
requireServerVerification: boolean;
|
|
101
101
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
package/dist/verification.d.ts
CHANGED
|
@@ -77,25 +77,25 @@ declare const __VLS_export: vue.DefineComponent<CaptchaProps, {
|
|
|
77
77
|
show: () => void;
|
|
78
78
|
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
79
79
|
success: (data: CaptchaSuccessPayload) => any;
|
|
80
|
-
change: (valid: boolean) => any;
|
|
81
|
-
reset: () => any;
|
|
82
|
-
"load-error": (error: unknown) => any;
|
|
83
80
|
fail: (error: string) => any;
|
|
84
81
|
"verify-error": (error: unknown) => any;
|
|
82
|
+
"load-error": (error: unknown) => any;
|
|
83
|
+
change: (valid: boolean) => any;
|
|
85
84
|
"visible-change": (visible: boolean) => any;
|
|
85
|
+
reset: () => any;
|
|
86
86
|
}, string, vue.PublicProps, Readonly<CaptchaProps> & Readonly<{
|
|
87
87
|
onSuccess?: ((data: CaptchaSuccessPayload) => any) | undefined;
|
|
88
|
-
onChange?: ((valid: boolean) => any) | undefined;
|
|
89
|
-
onReset?: (() => any) | undefined;
|
|
90
|
-
"onLoad-error"?: ((error: unknown) => any) | undefined;
|
|
91
88
|
onFail?: ((error: string) => any) | undefined;
|
|
92
89
|
"onVerify-error"?: ((error: unknown) => any) | undefined;
|
|
90
|
+
"onLoad-error"?: ((error: unknown) => any) | undefined;
|
|
91
|
+
onChange?: ((valid: boolean) => any) | undefined;
|
|
93
92
|
"onVisible-change"?: ((visible: boolean) => any) | undefined;
|
|
93
|
+
onReset?: (() => any) | undefined;
|
|
94
94
|
}>, {
|
|
95
|
-
disabled: boolean;
|
|
96
|
-
theme: "light" | "dark";
|
|
97
95
|
provider: CaptchaProvider;
|
|
98
96
|
images: string[];
|
|
97
|
+
disabled: boolean;
|
|
98
|
+
theme: "light" | "dark";
|
|
99
99
|
verificationTimeout: number;
|
|
100
100
|
requireServerVerification: boolean;
|
|
101
101
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# 组件契约增强与兼容接入
|
|
2
|
+
|
|
3
|
+
本轮延续 0.32.0 的来源、密度和受控模型,优先补齐真实产销、质量、物流与 MDM 场景的公共配置。项目接口、权限、领域规则和真实审批执行仍由应用负责。
|
|
4
|
+
|
|
5
|
+
## 保留的旧行为
|
|
6
|
+
|
|
7
|
+
- 原有平坦列、列级 boolean 编辑开关、静态候选和 `editRender` 继续可用。
|
|
8
|
+
- 普通 C_Select 叶选项不需要增加组节点,也不会因为业务行含 children 就自动被当成分组。
|
|
9
|
+
- 搜索字段设置默认关闭;不启用时保留原显示/折叠/重置和查询载荷。设置字段可见性不会偷偷删除草稿值。
|
|
10
|
+
- Tree 不传远程来源时仍使用原数据、本地搜索与原生 `treeProps.onLoad`;原生透传继续可用。
|
|
11
|
+
- 全局搜索默认 `literal`,保留历史子串和结果顺序;新检索方式显式启用。
|
|
12
|
+
- 页签仍按 `path` 标识同一页面,旧持久化记录不需要迁移;query/hash 仅更新该标签保存的访问地址。
|
|
13
|
+
- 无页眉/页尾的打印继续使用原图片路径;显式打印 CSS 仍最后覆盖生成样式。
|
|
14
|
+
|
|
15
|
+
## 导航搜索:用配置启用更丰富的匹配
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
const options = {
|
|
19
|
+
menuItems: () => authorizedMenus,
|
|
20
|
+
matchMode: 'tokens' as const,
|
|
21
|
+
onSelect: (key: string) => router.push(key),
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
`SearchMenuItem` 可选 `keywords: readonly string[]`、`breadcrumb: string`。tokens 模式归一化全角/大小写/空白,按词交集搜索标签、展示路径、所属目录和额外关键词;完整标题、标题前缀和标题子串优先,等权项保留源顺序。业务简称、拼音和领域别名由应用提供,组件不附带词库或额外搜索依赖。
|
|
26
|
+
|
|
27
|
+
需要自定义模糊匹配或范围策略时可提供 `options.search(query, currentItems)`,返回同步的匹配记录。组件按当前菜单键重新校验结果、去重并使用当前记录,避免旧菜单快照重新出现;当前菜单权限裁剪仍由应用负责。历史记录同样通过当前来源重新解析。
|
|
28
|
+
|
|
29
|
+
## 页签地址:身份与访问位置分开
|
|
30
|
+
|
|
31
|
+
`TagItem` 新增可选 `fullPath`。组件跟踪实际地址变化,将最新 query/hash 保存到原 path 的标签;点击标签、关闭后的回退均使用该完整地址。默认不会因为 query 变化创建新标签,也不会改变宿主路由/KeepAlive 缓存策略。
|
|
32
|
+
|
|
33
|
+
旧记录只有 path 时仍按原路径跳转。恢复 fullPath 时只接受属于该 path 的站内地址;损坏、跨站或与标签路径不符的地址回退到 path。独立使用 `useTagsView()` 的应用可以在 `addTag` 时一起传入 fullPath。
|
|
34
|
+
|
|
35
|
+
## 打印配置:传入参数具有实际行为
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
const printer = usePrintWatermark()
|
|
39
|
+
await printer.utils.printImage(imageUrl, {
|
|
40
|
+
paperSize: 'A4',
|
|
41
|
+
orientation: 'landscape',
|
|
42
|
+
margin: '8mm 10mm',
|
|
43
|
+
header: '库存盘点',
|
|
44
|
+
footer: '复核签字:',
|
|
45
|
+
})
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
纸张/方向和边距生成 `@page` CSS;`style` 最后应用,可保留已有自定义打印样式。支持纸张名称或两项明确尺寸,例如 `100mm 150mm`;明确尺寸本身决定方向,不再追加 CSS 不支持的方向后缀。margin 接受一至四项长度,畸形值在打开引擎前报错。
|
|
49
|
+
|
|
50
|
+
页眉/页尾按**纯文本**转义,随图片前后排版,不执行 HTML。锁定的 print-js 1.6.0 图片路径没有页尾渲染,因此有页眉/页尾时使用该引擎的 raw-html 路径,并保留图片自适应。这里不是跨页重复页眉页脚或精准报表分页引擎。
|
|
51
|
+
|
|
52
|
+
异步打印引擎失败会拒绝 Promise,可通过 `onError` 接收错误;通知回调抛错不会阻断结束与清理。Promise 完成表示浏览器打印对话框关闭,不能当作实际出纸凭证。纸张和边距的最终结果仍受浏览器、打印设置与驱动影响。
|
|
53
|
+
|
|
54
|
+
## 验证示例
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
bun run build
|
|
58
|
+
bun run dev:search-workflows
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
打开 `http://127.0.0.1:4188/contracts.html`。示例只存在于组件库 dev 目录,通过正式公开入口导入;支持离线来源、失败重试、范围切换、明暗主题、紧凑密度、分组 false/0、查询字段设置、分组表头与按行编辑。dev、测试和示例不会进入 npm 包。
|
|
62
|
+
|
|
63
|
+
Tree 的来源与方法见[树组件指南](./tree.md),搜索字段与偏好见[搜索工作流](./search-workflows.md)。大树交互沿用 [Naive UI 官方 Tree](https://github.com/tusen-ai/naive-ui/blob/main/src/tree/demos/zhCN/index.demo-entry.md);虚拟滚动时节点样式与测量高度必须一致,相关社区问题见 [#7529](https://github.com/tusen-ai/naive-ui/issues/7529)。
|
|
64
|
+
|
|
65
|
+
## 0.33.0 验证范围
|
|
66
|
+
|
|
67
|
+
- `bun run verify`:521 项单测、668 项组件回归、源码与消费者类型、导出冲突、发布清单、代码质量、构建、按需入口体积和打包消费者契约。
|
|
68
|
+
- `bun run check:consumer-contracts minimum`:全新安装 Vue 3.5.3、Naive UI 2.35.0、Vue Router 4.6.4、SortableJS 1.15.7,验证七个组件的浏览器构建、公开样式、CJS 运行和双格式声明。此历史最低组合仍不承诺原生 Node ESM,消费者检查使用 `skipLibCheck`,不代表第三方声明内部无错误。
|
|
69
|
+
- 浏览器离线交互:Tree 搜索路径自动展开、结果导航、未加载节点定位、失败重试和范围隔离;分组 false 原始值;查询字段锁定与范围偏好、树选择叶值序列化;分组表头、行锁定、三位精度与远程候选保存;多词菜单检索和键盘选择。检查明暗主题及 390px 视口,页面无横向溢出,宽表在自身容器滚动。
|
|
70
|
+
- 既有 400 字段用例保留单字段渲染次数及 DOM 身份断言,仅给予重型夹具 15 秒执行时限以容纳并行调度,并确保失败后卸载;它不是机器耗时基准。
|
|
71
|
+
|
|
72
|
+
所有按需入口预算保持不变;功能增加后的双格式运行代码与声明使物理总包预算增加 80 KiB,不以放宽入口门槛掩盖接入成本。大表数据量、远程接口延迟和节点高度仍需由真实业务数据验证。分组表头的跨组原生拖拽不启用,同组叶列顺序通过列设置调整。打印已验证配置与回调契约,未验证实体打印机出纸或驱动分页效果。
|
|
@@ -91,3 +91,27 @@
|
|
|
91
91
|
/>
|
|
92
92
|
</template>
|
|
93
93
|
```
|
|
94
|
+
|
|
95
|
+
## 本地分组选项
|
|
96
|
+
|
|
97
|
+
`C_Select` 接受原生组/叶结构;业务值仍只来自叶项。`0`、`false` 和普通字符串维持原类型,`select` 返回原始叶记录,多选按选中值顺序返回。组本身不参与提交,不使用组标题代替值。
|
|
98
|
+
|
|
99
|
+
```vue
|
|
100
|
+
<C_Select
|
|
101
|
+
v-model="enabled"
|
|
102
|
+
:options="[
|
|
103
|
+
{
|
|
104
|
+
type: 'group',
|
|
105
|
+
label: '系统状态',
|
|
106
|
+
children: [
|
|
107
|
+
{ label: '启用', value: true, code: 'enabled' },
|
|
108
|
+
{ label: '停用', value: false, code: 'disabled' },
|
|
109
|
+
],
|
|
110
|
+
},
|
|
111
|
+
]"
|
|
112
|
+
/>
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
公开类型为 `SelectOptionNode<V>`(组/叶联合)、`SelectOptionGroup<V>` 和原有 `SelectOptionItem<V>`。原来的平坦数组保持兼容。组内叶项的编码、回显和 `select` 走同一链,调用方不需要自己展平或编码布尔值。业务记录上普通的 `children` 属性只有在 `type: 'group'` 时才被解释为分组,原记录不会被改写。
|
|
116
|
+
|
|
117
|
+
远程 `source` 继续返回平坦实体页,保留已有分页/取消/回显所有权;本地组不会触发另一套远程分组请求。需要服务端分组时先明确分页边界,不把当前页面临时分组误当全量目录。
|
|
@@ -262,3 +262,66 @@ const options = [{ prop: 'assigneeId', type: 'assignee', label: '经办人' }]
|
|
|
262
262
|
覆盖仓库/货位联动、编码回显、分页候选、自由备注、快捷/完整实体选择、分类导航、数量限制和禁选行。页面还提供错误重试、记录失效、固定工厂切换、紧凑/默认密度及深浅色检查入口。`bun run check:search-workflows` 验证该使用示例的公开类型和生产构建。
|
|
263
263
|
|
|
264
264
|
验收正式构建时,执行 `bun run check:search-workflows && bun run preview:search-workflows`,在 `http://127.0.0.1:4189` 操作;生产预览不会受到开发依赖预构建或热更新重载的影响。
|
|
265
|
+
|
|
266
|
+
## 用户自选查询字段
|
|
267
|
+
|
|
268
|
+
可选的字段设置只管理显示偏好,不改变条件值和原有 `onSearch` 载荷。默认关闭,旧页面保持原来的字段显示、折叠和重置方式。
|
|
269
|
+
|
|
270
|
+
```vue
|
|
271
|
+
<C_FormSearch
|
|
272
|
+
v-model="query"
|
|
273
|
+
:form-item-list="fields"
|
|
274
|
+
:config="{
|
|
275
|
+
fieldSettings: {
|
|
276
|
+
defaultVisibleKeys: ['keyword', 'department'],
|
|
277
|
+
lockedKeys: ['keyword'],
|
|
278
|
+
persistKey: 'orders:search-fields',
|
|
279
|
+
scope: companyId,
|
|
280
|
+
},
|
|
281
|
+
}"
|
|
282
|
+
/>
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
- `fieldSettings: true` 显示设置入口,初始采用当前可见字段。高级配置的 `defaultVisibleKeys` 控制默认选择,`lockedKeys` 和 `fixed` 字段不能由用户隐藏。
|
|
286
|
+
- 业务设置的 `show: false` 优先:即使存储、默认值或受控键包含该字段,也不会在设置面板或表单中重新显示。字段设置不是权限控制机制。
|
|
287
|
+
- 只有显式 `persistKey` 才会存储键列表,按 `scope` 隔离;不存查询值。可选 `version` 默认为 1,版本不符、记录损坏或过期字段会安全回退/过滤。浏览器存储不可用不阻断搜索。
|
|
288
|
+
- 可选 `v-model:visible-fields` 接管键列表。受控模式由调用方保存状态,组件不以本地偏好覆盖它;调用方需按自己的用户/公司上下文切换受控值。
|
|
289
|
+
- 隐藏字段的旧值保留,并计入已有隐藏条件提示。搜索与重置继续遵循原有规则,不偷偷删除查询上下文或转换回调载荷。
|
|
290
|
+
|
|
291
|
+
如果请求只应包含当前启用的字段,可显式使用已有的 `active` 序列化范围,并传入当前显示键。固定条件始终保留,`scope: 'all'` 不受此选项影响:
|
|
292
|
+
|
|
293
|
+
```ts
|
|
294
|
+
const visibleFields = ref(['keyword', 'department'])
|
|
295
|
+
const config = {
|
|
296
|
+
fieldSettings: true,
|
|
297
|
+
onSearch: (values: Query) =>
|
|
298
|
+
fetchRows(
|
|
299
|
+
serializeSearch(values, fields, {
|
|
300
|
+
scope: 'active',
|
|
301
|
+
visibleFields: visibleFields.value,
|
|
302
|
+
})
|
|
303
|
+
),
|
|
304
|
+
}
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
在模板使用 `v-model:visible-fields="visibleFields"`;不需要受控状态的页面直接省略此绑定。组件公开实例也可读取 `visibleFields`。设置面板的“恢复默认字段”仅恢复显示偏好,不触发查询或清空草稿。
|
|
308
|
+
|
|
309
|
+
## 层级查询字段
|
|
310
|
+
|
|
311
|
+
搜索表单提供 `treeSelect` 与 `cascader` 字段。它们复用 Naive 原生控件并按需加载;不提前加载完整 `C_Form`。`list` 或 `attrs.options` 提供树,`attrs` 保留原生字段映射、勾选策略和 `onLoad` 扩展,外部异步状态通过已有 `optionsState` 展示加载/失败/重试。
|
|
312
|
+
|
|
313
|
+
```ts
|
|
314
|
+
const fields: SearchFormItem<Query>[] = [
|
|
315
|
+
{
|
|
316
|
+
type: 'treeSelect',
|
|
317
|
+
prop: 'departmentIds',
|
|
318
|
+
attrs: { multiple: true },
|
|
319
|
+
list: departmentTree,
|
|
320
|
+
},
|
|
321
|
+
{ type: 'cascader', prop: 'regionId', list: regionTree },
|
|
322
|
+
]
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
`treeSelect` 默认节点键为 `key`,`cascader` 默认节点值为 `value`;自定义字段名通过原生 `attrs` 声明。单选模型是 `string | number | null`,多选是键数组,清空/重置保持对应形状。数字键 `0` 不会被当作空值。只读/禁用/固定字段继续使用相同的受控更新边界,尺寸继承搜索密度。
|
|
326
|
+
|
|
327
|
+
这里使用 Naive 的叶键/勾选键模型,**不把一个单选路径数组猜成多选值,也不兼容 Element Plus 的 `emitPath` 协议**。请求需要祖先路径时,由项目在显式 `query.serialize` 中映射;不要为了适配一个后台修改所有页面的模型。
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# 表格编辑与分组列
|
|
2
|
+
|
|
3
|
+
旧的平铺列、`editable: false`、静态选项和 `editRender` 保持有效。行键继续由业务提供,`0` 也是有效身份。
|
|
4
|
+
|
|
5
|
+
## 按行决定编辑许可
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
const columns = defineTableColumns<OrderRow>([
|
|
9
|
+
{
|
|
10
|
+
key: 'quantity',
|
|
11
|
+
title: '数量',
|
|
12
|
+
editable: row => !row.released,
|
|
13
|
+
editType: 'number',
|
|
14
|
+
editProps: { precision: 3, min: 0, step: 0.001 },
|
|
15
|
+
},
|
|
16
|
+
])
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
`editable(row, index)` 读取当前源行及源数据索引,不读取正在输入的草稿;表格展示、单元格/行/弹窗编辑和公开编辑方法使用同一判断。数字编辑支持原生 `precision`、`format`、`parse` 等属性。日期编辑继续使用字符串 `format` 和原有 `valueMode`。
|
|
20
|
+
|
|
21
|
+
来源状态变化使字段不可编辑后,控件停止修改该字段;单元格保存保留草稿并拒绝派发,行/弹窗保存将该字段恢复为最新源值。启用行谓词时,未声明的元数据同样以最新源行为准,防止旧草稿覆盖新的生效/锁定状态。业务回调抛错仍走原错误通道,不会被当成允许编辑。已经发送的请求及后端授权由业务服务负责。
|
|
22
|
+
|
|
23
|
+
## 远程候选只配置来源
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
const columns = defineTableColumns<OrderRow>([
|
|
27
|
+
{
|
|
28
|
+
key: 'customerId',
|
|
29
|
+
title: '客户',
|
|
30
|
+
editType: 'select',
|
|
31
|
+
editProps: {
|
|
32
|
+
source: row => ({ ...customers, filters: { company: row.company } }),
|
|
33
|
+
clearable: true,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
])
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
`customers` 使用与 C_Select、表单和搜索字段相同的 `OptionSource`,防抖、取消、分页、初值回显和失败重试由已有来源控件处理。表格没有另一套请求引擎。`editType: 'autocomplete'` 对应自由文本建议;值保持文本,选中时才产生候选记录事件。静态 select 沿用原生轻入口;来源字段按需加载,不使基础表格提前加载完整表单字段。
|
|
40
|
+
|
|
41
|
+
需要对候选的业务字段保持完整类型推导时,可选用编辑器助手:
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
const columns = defineTableColumns<OrderRow>([
|
|
45
|
+
{
|
|
46
|
+
key: 'customerId',
|
|
47
|
+
title: '客户',
|
|
48
|
+
editRender: createTableSelectEditor({
|
|
49
|
+
source: customers,
|
|
50
|
+
onSelect: customer => inspectCredit(customer?.creditCode),
|
|
51
|
+
}),
|
|
52
|
+
},
|
|
53
|
+
])
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
`createTableSelectEditor`、`createTableAutoCompleteEditor` 返回已有 `editRender`,来源记录从传入 source 推导;不要求消费者提取条件类型或断言候选对象。`onSelect` 在主字段模型更新后的 nextTick 调用。第二个参数提供只读 `row`、`index` 和当前字段 `updateValue`;关联业务字段如何回填仍由应用明确决定。
|
|
57
|
+
|
|
58
|
+
同一编辑器也用于生成的编辑弹窗。控件尺寸默认跟随表格密度,助手显式设置 size 时以该值为准。自定义 `editRender` 现在可读取可选的 `context.disabled` 和 `context.size`;旧的 `{ onUpdate }` 写法无需改动。
|
|
59
|
+
|
|
60
|
+
## 分组表头
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
const columns = defineTableColumns<OrderRow>([
|
|
64
|
+
{
|
|
65
|
+
type: 'group',
|
|
66
|
+
title: '计量',
|
|
67
|
+
children: [
|
|
68
|
+
{ key: 'quantity', title: '数量', editType: 'number' },
|
|
69
|
+
{ key: 'weight', title: '重量', editType: 'number' },
|
|
70
|
+
],
|
|
71
|
+
},
|
|
72
|
+
])
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
组列使用明确的 `type: 'group'`,可嵌套;组本身不编辑、不参与排序和取业务值。列设置、内容测宽、横向滚动、编辑校验、动态列失效和数据导出统一遍历叶列。所有叶列都隐藏时,不渲染空组;调用方列对象不被修改。
|
|
76
|
+
|
|
77
|
+
列设置可调整叶列的可见性、宽度、固定方向及同组顺序,持久化仍使用原来的 persistKey;跨组移动不会重写调用方定义的结构。业务叶列被动态移除时会关闭当前编辑会话,并阻止迟到保存结果回写;新增列、重排、组名及列宽变化不丢弃草稿。分组模式下原生表头拖动关闭,使用列设置调整同组顺序;旧平铺表头拖动保持原有行为。CSV/XLSX 基础导出采用叶列标题和值,不承诺合并多行表头或工作簿版式保真。
|
|
78
|
+
|
|
79
|
+
这项能力用于普通分组列表,不代表工业矩阵、Excel 区域编辑、调度拖动或报表设计器已经等价实现。
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
## Direct native options
|
|
2
|
+
|
|
3
|
+
`checkable`, `multiple`, `cascade`, `checkStrategy`, `selectable`, `disabled`, `virtualScroll`, `accordion` and `expandOnClick` are optional direct props. Omitted values retain `treeProps` and existing defaults; explicit false wins. All remaining native features stay in `treeProps`. A virtual tree needs a definite height. Change the native `themeOverrides.nodeHeight`, rather than adding row margins that disagree with virtual measurements.
|
|
4
|
+
|
|
5
|
+
## Remote search over a partially loaded tree
|
|
6
|
+
|
|
7
|
+
Pass an optional `searchSource` when matches may be outside the loaded subtree:
|
|
8
|
+
|
|
9
|
+
```vue
|
|
10
|
+
<C_Tree
|
|
11
|
+
ref="tree"
|
|
12
|
+
:data="roots"
|
|
13
|
+
:search-source="{
|
|
14
|
+
scope: companyId,
|
|
15
|
+
request: ({ search, signal, limit }) =>
|
|
16
|
+
api.searchPaths(search, limit, signal),
|
|
17
|
+
resolve: (key, signal) => api.resolvePath(key, signal),
|
|
18
|
+
load: (node, { signal }) => api.children(node.id, signal),
|
|
19
|
+
}"
|
|
20
|
+
:addable="false"
|
|
21
|
+
/>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The source infers the domain node type from `data`; it needs no string index signature or caller casts. `TreeSearchSource<Node>` is also exported for separately declared source objects.
|
|
25
|
+
|
|
26
|
+
- `request({search, signal, limit})` returns paths ordered root→ancestors→match. For example, `[[root, department, team], [root, finance]]`. Return `[]` for no results. The server owns authorization, matching and result ordering; the component does not apply a second local text filter.
|
|
27
|
+
- Optional `resolve(key, signal)` returns one path or null. `locate(key)` uses the loaded tree first, then resolve. An unknown controlled selection does not automatically trigger a network request.
|
|
28
|
+
- Optional `load(node, {signal})` returns **all direct children**. Search paths are partial evidence, not a complete child list. Locating a result expands its known ancestors without bulk-fetching every branch; a later user expansion completes a partial branch. Source load takes precedence in the new mode; existing `treeProps.onLoad` remains available when it is omitted.
|
|
29
|
+
- Defaults are `debounce=250`, `minChars=1`, `limit=100`. The result limit is capped at 1000 and a path at 256 nodes. Invalid keys, cycles, conflicting parents and duplicate matches are rejected atomically. String/finite number keys remain supported, including numeric zero.
|
|
30
|
+
|
|
31
|
+
The component maintains an instance-local projection and never mutates caller data or path arrays. Custom key/label/children fields and `getChildren` remain supported. Clearing a query removes matches and keeps the most recently located path and completed branches. Changing source functions, scope, field mapping or the root data array aborts outstanding work and discards the projection. Update scope when tenant/company conditions change inside a stable closure. Unmount and KeepAlive deactivation cancel work; activation reloads the current query. Stale results are ignored even when transport ignores AbortSignal.
|
|
32
|
+
|
|
33
|
+
Use `locate(key)`, `locateMatch(index)`, `nextMatch()` or `previousMatch()`; each returns `Promise<boolean>`. Next/previous wrap across matches and return false for an empty result. Enter/Shift+Enter in the search input navigates results, except during IME composition. Positioning requests ancestor expansion and selects only when allowed by native disabled/selectable settings. Controlled selection/expansion still belongs to the parent.
|
|
34
|
+
|
|
35
|
+
`retrySearch()` immediately retries the current query. Exposed state includes `searchLoading`, `searchError`, `searchMatchCount` and `searchMatchIndex` (-1 before positioning). The UI provides pending/error/retry and result navigation; partial branch completion has an inline loading indicator.
|
|
36
|
+
|
|
37
|
+
Existing native `onLoad` closures continue to own their requests and writes. The wrapper cannot abort a request or intercept a mutation hidden inside that legacy closure; retain the generation/abort guard described above. Checking unloaded descendants still requires an explicit server contract matching native `allowCheckingNotLoaded` and `checkStrategy` semantics.
|
|
38
|
+
|
|
39
|
+
Official references: [Tree API](https://github.com/tusen-ai/naive-ui/blob/main/src/tree/demos/enUS/index.demo-entry.md), [Tree source](https://github.com/tusen-ai/naive-ui/blob/main/src/tree/src/Tree.tsx), and the community [virtual row height report #7529](https://github.com/tusen-ai/naive-ui/issues/7529). Native checking, keyboard, dragging, loading and virtualization stay in Naive UI; the added source coordinates remote paths rather than replacing those engines. The issue report is a regression reference, not proof that every current Naive version has that bug.
|
|
40
|
+
|
|
41
|
+
Successful search previews results by expanding all matching ancestors once and scrolling to the first match, without selecting a node or emitting business selection. Next/previous or Enter performs explicit positioning and selection. Collapse-all, a single-node collapse or controlled collapse prevents a late load from reopening the node; valid children may stay cached. Collapsing one node does not invalidate sibling loads. Legacy onLoad deduplication uses original business node identity across projection updates.
|