@robot-admin/naive-ui-components 0.27.0 → 0.28.1
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 +14 -0
- package/README.md +5 -13
- package/README_EN.md +5 -13
- package/dist/C_Table.base.css +145 -145
- package/dist/C_Table.css +145 -145
- package/dist/C_Table2.cjs +3 -3
- package/dist/C_Table2.js +3 -3
- 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/constants3.d.cts +5 -5
- package/dist/constants3.d.ts +5 -5
- 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 +11 -11
- package/dist/data2.d.ts +11 -11
- package/dist/index.vue.d.cts +7 -7
- package/dist/index.vue.d.ts +7 -7
- package/dist/index10.vue.d.cts +3 -3
- package/dist/index10.vue.d.ts +2 -2
- package/dist/index11.vue.d.cts +2 -2
- package/dist/index11.vue.d.ts +4 -2
- package/dist/index12.vue.d.cts +4 -2
- package/dist/index13.vue.d.ts +3 -3
- package/dist/index14.vue.d.cts +3 -3
- package/dist/index16.vue.d.ts +2 -2
- package/dist/index17.vue.d.cts +2 -2
- package/dist/index17.vue.d.ts +10 -10
- package/dist/index18.vue.d.cts +10 -10
- package/dist/index18.vue.d.ts +2 -2
- package/dist/index19.vue.d.cts +2 -2
- package/dist/index19.vue.d.ts +1 -1
- package/dist/index2.vue.d.cts +3 -3
- package/dist/index2.vue.d.ts +3 -3
- package/dist/index20.vue.d.cts +1 -1
- package/dist/index20.vue.d.ts +2 -2
- package/dist/index21.vue.d.cts +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 +2 -2
- package/dist/index23.vue.d.ts +2 -2
- package/dist/index24.vue.d.cts +3 -3
- package/dist/index24.vue.d.ts +3 -3
- package/dist/index25.vue.d.cts +2 -2
- package/dist/index25.vue.d.ts +2 -2
- package/dist/index26.vue.d.cts +1 -1
- package/dist/index26.vue.d.ts +1 -1
- package/dist/index27.vue.d.cts +2 -2
- package/dist/index27.vue.d.ts +2 -2
- package/dist/index29.vue.d.cts +1 -1
- package/dist/index29.vue.d.ts +1 -1
- package/dist/index3.vue.d.cts +6 -6
- package/dist/index3.vue.d.ts +6 -6
- package/dist/index30.vue.d.cts +5 -5
- package/dist/index30.vue.d.ts +5 -5
- package/dist/index31.vue.d.cts +2 -2
- package/dist/index31.vue.d.ts +2 -2
- package/dist/index5.vue.d.cts +3 -3
- package/dist/index6.vue.d.ts +2 -2
- package/dist/index7.vue.d.cts +2 -2
- package/dist/index7.vue.d.ts +3 -3
- package/dist/index8.vue.d.cts +3 -3
- package/dist/index8.vue.d.ts +2 -2
- package/dist/index9.vue.d.cts +2 -2
- package/dist/index9.vue.d.ts +3 -3
- package/dist/mapUtils.d.cts +1 -1
- package/dist/mapUtils.d.ts +1 -1
- package/dist/style.css +146 -146
- package/dist/useCalendarEvents.d.cts +1 -1
- package/dist/useCalendarEvents.d.ts +1 -1
- package/dist/useCollapsePanel.d.cts +7 -7
- package/dist/useCollapsePanel.d.ts +7 -7
- package/dist/useComponentLocale.cjs +1 -1
- package/dist/useComponentLocale.js +1 -1
- package/dist/useCropperCore.d.cts +4 -4
- package/dist/useCropperCore.d.ts +4 -4
- package/dist/useDraggableLayout.d.cts +2 -2
- package/dist/useDraggableLayout.d.ts +2 -2
- package/dist/useEdgeInteraction.d.cts +2 -2
- package/dist/useEdgeInteraction.d.ts +2 -2
- package/dist/useFullscreen.d.cts +2 -2
- package/dist/useFullscreen.d.ts +2 -2
- package/dist/useInfiniteScroll.d.cts +1 -1
- package/dist/useInfiniteScroll.d.ts +1 -1
- package/dist/useQRCode.d.cts +4 -4
- package/dist/useQRCode.d.ts +4 -4
- package/dist/useSignatureHistory.d.cts +6 -6
- package/dist/useSignatureHistory.d.ts +6 -6
- package/dist/useSplitResize.d.cts +5 -5
- package/dist/useSplitResize.d.ts +5 -5
- package/dist/useTableQuery.d.cts +16 -10
- package/dist/useTableQuery.d.ts +16 -10
- package/dist/useWorkflowValidation.d.cts +3 -3
- package/dist/useWorkflowValidation.d.ts +3 -3
- package/dist/verification.d.cts +5 -5
- package/dist/verification.d.ts +5 -5
- package/docs/guides/data-workflows.md +15 -0
- package/docs/guides/runtime-performance.md +4 -0
- package/docs/guides/usage.en.md +6 -3
- package/docs/guides/usage.md +43 -3
- package/package.json +1 -1
package/dist/useTableQuery.d.cts
CHANGED
|
@@ -19,6 +19,7 @@ declare function useComponentFeedback(local?: MaybeRefOrGetter<ComponentFeedback
|
|
|
19
19
|
//#region src/components/C_Table/index.vue.d.ts
|
|
20
20
|
declare const __VLS_export$1: <T extends object = DataRecord, C = unknown>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal$1<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
21
21
|
props: vue.PublicProps & __VLS_PrettifyLocal$1<TableRuntimeProps<T, C> & {
|
|
22
|
+
onSave?: ((rowData: T, rowIndex: number, columnKey?: string | undefined) => any) | undefined;
|
|
22
23
|
onCancel?: ((rowData: T, rowIndex: number) => any) | undefined;
|
|
23
24
|
"onPagination-change"?: ((page: number, pageSize: number) => any) | undefined;
|
|
24
25
|
"onRow-delete"?: ((deletedRow: T, index: number) => any) | undefined;
|
|
@@ -35,7 +36,6 @@ declare const __VLS_export$1: <T extends object = DataRecord, C = unknown>(__VLS
|
|
|
35
36
|
"onChild-selection-change"?: ((parentKey: DataTableRowKey, childKeys: DataTableRowKey[], childRows: C[]) => any) | undefined;
|
|
36
37
|
"onParent-child-link-change"?: ((parentKey: DataTableRowKey, shouldSelect: boolean) => any) | undefined;
|
|
37
38
|
"onUpdate:data"?: ((data: T[]) => any) | undefined;
|
|
38
|
-
onSave?: ((rowData: T, rowIndex: number, columnKey?: string | undefined) => any) | undefined;
|
|
39
39
|
"onEdit-error"?: ((error: unknown) => any) | undefined;
|
|
40
40
|
}> & (typeof globalThis extends {
|
|
41
41
|
__VLS_PROPS_FALLBACK: infer P;
|
|
@@ -55,7 +55,7 @@ declare const __VLS_export$1: <T extends object = DataRecord, C = unknown>(__VLS
|
|
|
55
55
|
} & {
|
|
56
56
|
empty?: (props: {}) => any;
|
|
57
57
|
};
|
|
58
|
-
emit: ((evt: "cancel", rowData: T, rowIndex: number) => void) & ((evt: "pagination-change", page: number, pageSize: number) => void) & ((evt: "row-delete", deletedRow: T, index: number) => void) & ((evt: "batch-action-error", error: unknown, actionKey: string) => void) & ((evt: "row-key-error", issues: TableRowKeyIssue<T>[]) => void) & ((evt: "row-add", newRow: T) => void) & ((evt: "row-copy", originalRow: T, newRow: T) => void) & ((evt: "row-move", row: T, fromIndex: number, toIndex: number) => void) & ((evt: "row-selection-change", selectedKey: DataTableRowKey | null, selectedRow: T | null) => void) & ((evt: "view-detail", data: T) => void) & ((evt: "column-change", columns: TableColumn<T>[]) => void) & ((evt: "expand-change", expandedKeys: DataTableRowKey[], row?: T | undefined, expanded?: boolean | undefined) => void) & ((evt: "selection-change", checkedKeys: DataTableRowKey[], checkedRows: T[], childSelections?: Map<DataTableRowKey, DataTableRowKey[]> | undefined) => void) & ((evt: "child-selection-change", parentKey: DataTableRowKey, childKeys: DataTableRowKey[], childRows: C[]) => void) & ((evt: "parent-child-link-change", parentKey: DataTableRowKey, shouldSelect: boolean) => void) & ((evt: "update:data", data: T[]) => void) & ((evt: "
|
|
58
|
+
emit: ((evt: "save", rowData: T, rowIndex: number, columnKey?: string | undefined) => void) & ((evt: "cancel", rowData: T, rowIndex: number) => void) & ((evt: "pagination-change", page: number, pageSize: number) => void) & ((evt: "row-delete", deletedRow: T, index: number) => void) & ((evt: "batch-action-error", error: unknown, actionKey: string) => void) & ((evt: "row-key-error", issues: TableRowKeyIssue<T>[]) => void) & ((evt: "row-add", newRow: T) => void) & ((evt: "row-copy", originalRow: T, newRow: T) => void) & ((evt: "row-move", row: T, fromIndex: number, toIndex: number) => void) & ((evt: "row-selection-change", selectedKey: DataTableRowKey | null, selectedRow: T | null) => void) & ((evt: "view-detail", data: T) => void) & ((evt: "column-change", columns: TableColumn<T>[]) => void) & ((evt: "expand-change", expandedKeys: DataTableRowKey[], row?: T | undefined, expanded?: boolean | undefined) => void) & ((evt: "selection-change", checkedKeys: DataTableRowKey[], checkedRows: T[], childSelections?: Map<DataTableRowKey, DataTableRowKey[]> | undefined) => void) & ((evt: "child-selection-change", parentKey: DataTableRowKey, childKeys: DataTableRowKey[], childRows: C[]) => void) & ((evt: "parent-child-link-change", parentKey: DataTableRowKey, shouldSelect: boolean) => void) & ((evt: "update:data", data: T[]) => void) & ((evt: "edit-error", error: unknown) => void);
|
|
59
59
|
}>) => vue.VNode & {
|
|
60
60
|
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
61
61
|
};
|
|
@@ -125,6 +125,9 @@ interface UseTableColumnsOptions {
|
|
|
125
125
|
}>;
|
|
126
126
|
/** 是否渲染操作列 */
|
|
127
127
|
showActionsColumn: ComputedRef<boolean>;
|
|
128
|
+
rowNumber?: ComputedRef<boolean>;
|
|
129
|
+
getRowNumber?: (row: DataRecord, index: number) => number | string;
|
|
130
|
+
rowNumberTitle?: () => string;
|
|
128
131
|
}
|
|
129
132
|
interface UseTableColumnsReturn {
|
|
130
133
|
reactiveColumns: Ref<TableColumn[]>;
|
|
@@ -132,6 +135,9 @@ interface UseTableColumnsReturn {
|
|
|
132
135
|
computedColumns: ComputedRef<DataTableColumn[]>;
|
|
133
136
|
computedScrollX: ComputedRef<number | string | undefined>;
|
|
134
137
|
handleColumnChange: (columns: TableColumn[]) => void;
|
|
138
|
+
resetColumnPreferences: () => void;
|
|
139
|
+
rememberColumnWidth: (key: DataTableRowKey, width: number) => void;
|
|
140
|
+
flushColumnWidths: () => void;
|
|
135
141
|
}
|
|
136
142
|
/**
|
|
137
143
|
* 表格列处理引擎
|
|
@@ -691,26 +697,26 @@ interface TreeSlots<T extends object = TreeOption$1> {
|
|
|
691
697
|
declare const __VLS_export: <T extends object = TreeNodeData>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
692
698
|
props: vue.PublicProps & __VLS_PrettifyLocal<TreeProps$1<T> & {
|
|
693
699
|
onAdd?: ((parentNode?: T | undefined) => any) | undefined;
|
|
700
|
+
onRefresh?: (() => any) | undefined;
|
|
701
|
+
"onLoad-error"?: ((error: unknown, node: T) => any) | undefined;
|
|
702
|
+
"onUpdate:expandedKeys"?: ((keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "filter" | "expand" | "collapse" | "select" | "unselect" | "check" | "uncheck">) => any) | undefined;
|
|
694
703
|
"onUpdate:searchPattern"?: ((pattern: string) => any) | undefined;
|
|
695
|
-
"onUpdate:
|
|
696
|
-
"onUpdate:
|
|
697
|
-
"onUpdate:checkedKeys"?: ((keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "filter" | "select" | "unselect" | "check" | "uncheck" | "expand" | "collapse">) => any) | undefined;
|
|
704
|
+
"onUpdate:selectedKeys"?: ((keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "filter" | "expand" | "collapse" | "select" | "unselect" | "check" | "uncheck">) => any) | undefined;
|
|
705
|
+
"onUpdate:checkedKeys"?: ((keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "filter" | "expand" | "collapse" | "select" | "unselect" | "check" | "uncheck">) => any) | undefined;
|
|
698
706
|
"onNode-select"?: ((node: T | null, selectedKeys: TreeKey[]) => any) | undefined;
|
|
699
707
|
"onNode-action"?: ((action: string, node: T) => any) | undefined;
|
|
700
708
|
"onNode-drop"?: ((info: DropInfo<T>) => any) | undefined;
|
|
701
|
-
"onLoad-error"?: ((error: unknown, node: T) => any) | undefined;
|
|
702
|
-
onRefresh?: (() => any) | undefined;
|
|
703
709
|
}> & (typeof globalThis extends {
|
|
704
710
|
__VLS_PROPS_FALLBACK: infer P;
|
|
705
711
|
} ? P : {});
|
|
706
|
-
expose: (exposed: vue.ShallowUnwrapRef<Omit<TreeExpose<T>, "
|
|
712
|
+
expose: (exposed: vue.ShallowUnwrapRef<Omit<TreeExpose<T>, "selectedKeys" | "expandedKeys" | "checkedKeys"> & {
|
|
707
713
|
expandedKeys: vue.Ref<TreeKey[]>;
|
|
708
714
|
selectedKeys: vue.Ref<TreeKey[]>;
|
|
709
715
|
checkedKeys: vue.Ref<TreeKey[]>;
|
|
710
716
|
}>) => void;
|
|
711
717
|
attrs: any;
|
|
712
718
|
slots: TreeSlots<T>;
|
|
713
|
-
emit: ((evt: "add", parentNode?: T | undefined) => void) & ((evt: "
|
|
719
|
+
emit: ((evt: "add", parentNode?: T | undefined) => void) & ((evt: "refresh") => void) & ((evt: "load-error", error: unknown, node: T) => void) & ((evt: "update:expandedKeys", keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "filter" | "expand" | "collapse" | "select" | "unselect" | "check" | "uncheck">) => void) & ((evt: "update:searchPattern", pattern: string) => void) & ((evt: "update:selectedKeys", keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "filter" | "expand" | "collapse" | "select" | "unselect" | "check" | "uncheck">) => void) & ((evt: "update:checkedKeys", keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "filter" | "expand" | "collapse" | "select" | "unselect" | "check" | "uncheck">) => void) & ((evt: "node-select", node: T | null, selectedKeys: TreeKey[]) => void) & ((evt: "node-action", action: string, node: T) => void) & ((evt: "node-drop", info: DropInfo<T>) => void);
|
|
714
720
|
}>) => vue.VNode & {
|
|
715
721
|
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
716
722
|
};
|
|
@@ -748,7 +754,7 @@ declare function useTreeOperations<T extends object = TreeNodeData>(props: TreeP
|
|
|
748
754
|
handleDrop: (info: DropInfo<T>) => void;
|
|
749
755
|
handleAdd: () => void;
|
|
750
756
|
handleRefresh: () => void;
|
|
751
|
-
expose: Omit<TreeExpose<T>, "
|
|
757
|
+
expose: Omit<TreeExpose<T>, "selectedKeys" | "expandedKeys" | "checkedKeys"> & {
|
|
752
758
|
expandedKeys: Ref<TreeKey[]>;
|
|
753
759
|
selectedKeys: Ref<TreeKey[]>;
|
|
754
760
|
checkedKeys: Ref<TreeKey[]>;
|
package/dist/useTableQuery.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { HLJSApi } from "highlight.js";
|
|
|
9
9
|
//#region src/components/C_Table/index.vue.d.ts
|
|
10
10
|
declare const __VLS_export$1: <T extends object = DataRecord, C = unknown>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal$1<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
11
11
|
props: vue.PublicProps & __VLS_PrettifyLocal$1<TableRuntimeProps<T, C> & {
|
|
12
|
+
onSave?: ((rowData: T, rowIndex: number, columnKey?: string | undefined) => any) | undefined;
|
|
12
13
|
onCancel?: ((rowData: T, rowIndex: number) => any) | undefined;
|
|
13
14
|
"onPagination-change"?: ((page: number, pageSize: number) => any) | undefined;
|
|
14
15
|
"onRow-delete"?: ((deletedRow: T, index: number) => any) | undefined;
|
|
@@ -25,7 +26,6 @@ declare const __VLS_export$1: <T extends object = DataRecord, C = unknown>(__VLS
|
|
|
25
26
|
"onChild-selection-change"?: ((parentKey: DataTableRowKey, childKeys: DataTableRowKey[], childRows: C[]) => any) | undefined;
|
|
26
27
|
"onParent-child-link-change"?: ((parentKey: DataTableRowKey, shouldSelect: boolean) => any) | undefined;
|
|
27
28
|
"onUpdate:data"?: ((data: T[]) => any) | undefined;
|
|
28
|
-
onSave?: ((rowData: T, rowIndex: number, columnKey?: string | undefined) => any) | undefined;
|
|
29
29
|
"onEdit-error"?: ((error: unknown) => any) | undefined;
|
|
30
30
|
}> & (typeof globalThis extends {
|
|
31
31
|
__VLS_PROPS_FALLBACK: infer P;
|
|
@@ -45,7 +45,7 @@ declare const __VLS_export$1: <T extends object = DataRecord, C = unknown>(__VLS
|
|
|
45
45
|
} & {
|
|
46
46
|
empty?: (props: {}) => any;
|
|
47
47
|
};
|
|
48
|
-
emit: ((evt: "cancel", rowData: T, rowIndex: number) => void) & ((evt: "pagination-change", page: number, pageSize: number) => void) & ((evt: "row-delete", deletedRow: T, index: number) => void) & ((evt: "batch-action-error", error: unknown, actionKey: string) => void) & ((evt: "row-key-error", issues: TableRowKeyIssue<T>[]) => void) & ((evt: "row-add", newRow: T) => void) & ((evt: "row-copy", originalRow: T, newRow: T) => void) & ((evt: "row-move", row: T, fromIndex: number, toIndex: number) => void) & ((evt: "row-selection-change", selectedKey: DataTableRowKey | null, selectedRow: T | null) => void) & ((evt: "view-detail", data: T) => void) & ((evt: "column-change", columns: TableColumn<T>[]) => void) & ((evt: "expand-change", expandedKeys: DataTableRowKey[], row?: T | undefined, expanded?: boolean | undefined) => void) & ((evt: "selection-change", checkedKeys: DataTableRowKey[], checkedRows: T[], childSelections?: Map<DataTableRowKey, DataTableRowKey[]> | undefined) => void) & ((evt: "child-selection-change", parentKey: DataTableRowKey, childKeys: DataTableRowKey[], childRows: C[]) => void) & ((evt: "parent-child-link-change", parentKey: DataTableRowKey, shouldSelect: boolean) => void) & ((evt: "update:data", data: T[]) => void) & ((evt: "
|
|
48
|
+
emit: ((evt: "save", rowData: T, rowIndex: number, columnKey?: string | undefined) => void) & ((evt: "cancel", rowData: T, rowIndex: number) => void) & ((evt: "pagination-change", page: number, pageSize: number) => void) & ((evt: "row-delete", deletedRow: T, index: number) => void) & ((evt: "batch-action-error", error: unknown, actionKey: string) => void) & ((evt: "row-key-error", issues: TableRowKeyIssue<T>[]) => void) & ((evt: "row-add", newRow: T) => void) & ((evt: "row-copy", originalRow: T, newRow: T) => void) & ((evt: "row-move", row: T, fromIndex: number, toIndex: number) => void) & ((evt: "row-selection-change", selectedKey: DataTableRowKey | null, selectedRow: T | null) => void) & ((evt: "view-detail", data: T) => void) & ((evt: "column-change", columns: TableColumn<T>[]) => void) & ((evt: "expand-change", expandedKeys: DataTableRowKey[], row?: T | undefined, expanded?: boolean | undefined) => void) & ((evt: "selection-change", checkedKeys: DataTableRowKey[], checkedRows: T[], childSelections?: Map<DataTableRowKey, DataTableRowKey[]> | undefined) => void) & ((evt: "child-selection-change", parentKey: DataTableRowKey, childKeys: DataTableRowKey[], childRows: C[]) => void) & ((evt: "parent-child-link-change", parentKey: DataTableRowKey, shouldSelect: boolean) => void) & ((evt: "update:data", data: T[]) => void) & ((evt: "edit-error", error: unknown) => void);
|
|
49
49
|
}>) => vue.VNode & {
|
|
50
50
|
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
51
51
|
};
|
|
@@ -115,6 +115,9 @@ interface UseTableColumnsOptions {
|
|
|
115
115
|
}>;
|
|
116
116
|
/** 是否渲染操作列 */
|
|
117
117
|
showActionsColumn: ComputedRef<boolean>;
|
|
118
|
+
rowNumber?: ComputedRef<boolean>;
|
|
119
|
+
getRowNumber?: (row: DataRecord, index: number) => number | string;
|
|
120
|
+
rowNumberTitle?: () => string;
|
|
118
121
|
}
|
|
119
122
|
interface UseTableColumnsReturn {
|
|
120
123
|
reactiveColumns: Ref<TableColumn[]>;
|
|
@@ -122,6 +125,9 @@ interface UseTableColumnsReturn {
|
|
|
122
125
|
computedColumns: ComputedRef<DataTableColumn[]>;
|
|
123
126
|
computedScrollX: ComputedRef<number | string | undefined>;
|
|
124
127
|
handleColumnChange: (columns: TableColumn[]) => void;
|
|
128
|
+
resetColumnPreferences: () => void;
|
|
129
|
+
rememberColumnWidth: (key: DataTableRowKey, width: number) => void;
|
|
130
|
+
flushColumnWidths: () => void;
|
|
125
131
|
}
|
|
126
132
|
/**
|
|
127
133
|
* 表格列处理引擎
|
|
@@ -681,26 +687,26 @@ interface TreeSlots<T extends object = TreeOption$1> {
|
|
|
681
687
|
declare const __VLS_export: <T extends object = TreeNodeData>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
682
688
|
props: vue.PublicProps & __VLS_PrettifyLocal<TreeProps$1<T> & {
|
|
683
689
|
onAdd?: ((parentNode?: T | undefined) => any) | undefined;
|
|
690
|
+
onRefresh?: (() => any) | undefined;
|
|
691
|
+
"onLoad-error"?: ((error: unknown, node: T) => any) | undefined;
|
|
692
|
+
"onUpdate:expandedKeys"?: ((keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "filter" | "expand" | "collapse" | "select" | "unselect" | "check" | "uncheck">) => any) | undefined;
|
|
684
693
|
"onUpdate:searchPattern"?: ((pattern: string) => any) | undefined;
|
|
685
|
-
"onUpdate:
|
|
686
|
-
"onUpdate:
|
|
687
|
-
"onUpdate:checkedKeys"?: ((keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "filter" | "select" | "unselect" | "check" | "uncheck" | "expand" | "collapse">) => any) | undefined;
|
|
694
|
+
"onUpdate:selectedKeys"?: ((keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "filter" | "expand" | "collapse" | "select" | "unselect" | "check" | "uncheck">) => any) | undefined;
|
|
695
|
+
"onUpdate:checkedKeys"?: ((keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "filter" | "expand" | "collapse" | "select" | "unselect" | "check" | "uncheck">) => any) | undefined;
|
|
688
696
|
"onNode-select"?: ((node: T | null, selectedKeys: TreeKey[]) => any) | undefined;
|
|
689
697
|
"onNode-action"?: ((action: string, node: T) => any) | undefined;
|
|
690
698
|
"onNode-drop"?: ((info: DropInfo<T>) => any) | undefined;
|
|
691
|
-
"onLoad-error"?: ((error: unknown, node: T) => any) | undefined;
|
|
692
|
-
onRefresh?: (() => any) | undefined;
|
|
693
699
|
}> & (typeof globalThis extends {
|
|
694
700
|
__VLS_PROPS_FALLBACK: infer P;
|
|
695
701
|
} ? P : {});
|
|
696
|
-
expose: (exposed: vue.ShallowUnwrapRef<Omit<TreeExpose<T>, "
|
|
702
|
+
expose: (exposed: vue.ShallowUnwrapRef<Omit<TreeExpose<T>, "selectedKeys" | "expandedKeys" | "checkedKeys"> & {
|
|
697
703
|
expandedKeys: vue.Ref<TreeKey[]>;
|
|
698
704
|
selectedKeys: vue.Ref<TreeKey[]>;
|
|
699
705
|
checkedKeys: vue.Ref<TreeKey[]>;
|
|
700
706
|
}>) => void;
|
|
701
707
|
attrs: any;
|
|
702
708
|
slots: TreeSlots<T>;
|
|
703
|
-
emit: ((evt: "add", parentNode?: T | undefined) => void) & ((evt: "
|
|
709
|
+
emit: ((evt: "add", parentNode?: T | undefined) => void) & ((evt: "refresh") => void) & ((evt: "load-error", error: unknown, node: T) => void) & ((evt: "update:expandedKeys", keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "filter" | "expand" | "collapse" | "select" | "unselect" | "check" | "uncheck">) => void) & ((evt: "update:searchPattern", pattern: string) => void) & ((evt: "update:selectedKeys", keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "filter" | "expand" | "collapse" | "select" | "unselect" | "check" | "uncheck">) => void) & ((evt: "update:checkedKeys", keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "filter" | "expand" | "collapse" | "select" | "unselect" | "check" | "uncheck">) => void) & ((evt: "node-select", node: T | null, selectedKeys: TreeKey[]) => void) & ((evt: "node-action", action: string, node: T) => void) & ((evt: "node-drop", info: DropInfo<T>) => void);
|
|
704
710
|
}>) => vue.VNode & {
|
|
705
711
|
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
706
712
|
};
|
|
@@ -738,7 +744,7 @@ declare function useTreeOperations<T extends object = TreeNodeData>(props: TreeP
|
|
|
738
744
|
handleDrop: (info: DropInfo<T>) => void;
|
|
739
745
|
handleAdd: () => void;
|
|
740
746
|
handleRefresh: () => void;
|
|
741
|
-
expose: Omit<TreeExpose<T>, "
|
|
747
|
+
expose: Omit<TreeExpose<T>, "selectedKeys" | "expandedKeys" | "checkedKeys"> & {
|
|
742
748
|
expandedKeys: Ref<TreeKey[]>;
|
|
743
749
|
selectedKeys: Ref<TreeKey[]>;
|
|
744
750
|
checkedKeys: Ref<TreeKey[]>;
|
|
@@ -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;
|
|
263
|
+
"update:modelValue": (value: WorkflowData) => any;
|
|
264
264
|
save: (data: WorkflowData) => any;
|
|
265
265
|
"validate-error": (errors: ValidationError[]) => any;
|
|
266
266
|
"node-click": (node: WorkflowNode<NodeType>) => any;
|
|
267
267
|
"edge-click": (edge: WorkflowEdge) => any;
|
|
268
268
|
}, string, vue.PublicProps, Readonly<WorkflowProps> & Readonly<{
|
|
269
|
-
"onUpdate:modelValue"?: ((value: WorkflowData) => any) | undefined;
|
|
270
269
|
onChange?: ((value: WorkflowData) => any) | undefined;
|
|
270
|
+
"onUpdate:modelValue"?: ((value: WorkflowData) => any) | undefined;
|
|
271
271
|
onSave?: ((data: WorkflowData) => any) | undefined;
|
|
272
272
|
"onValidate-error"?: ((errors: ValidationError[]) => any) | undefined;
|
|
273
273
|
"onNode-click"?: ((node: WorkflowNode<NodeType>) => any) | undefined;
|
|
274
274
|
"onEdge-click"?: ((edge: WorkflowEdge) => any) | undefined;
|
|
275
275
|
}>, {
|
|
276
|
-
theme: "light" | "dark";
|
|
277
276
|
readonly: boolean;
|
|
277
|
+
theme: "light" | "dark";
|
|
278
278
|
users: User[];
|
|
279
279
|
roles: Role[];
|
|
280
280
|
departments: Department[];
|
|
@@ -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;
|
|
263
|
+
"update:modelValue": (value: WorkflowData) => any;
|
|
264
264
|
save: (data: WorkflowData) => any;
|
|
265
265
|
"validate-error": (errors: ValidationError[]) => any;
|
|
266
266
|
"node-click": (node: WorkflowNode<NodeType>) => any;
|
|
267
267
|
"edge-click": (edge: WorkflowEdge) => any;
|
|
268
268
|
}, string, vue.PublicProps, Readonly<WorkflowProps> & Readonly<{
|
|
269
|
-
"onUpdate:modelValue"?: ((value: WorkflowData) => any) | undefined;
|
|
270
269
|
onChange?: ((value: WorkflowData) => any) | undefined;
|
|
270
|
+
"onUpdate:modelValue"?: ((value: WorkflowData) => any) | undefined;
|
|
271
271
|
onSave?: ((data: WorkflowData) => any) | undefined;
|
|
272
272
|
"onValidate-error"?: ((errors: ValidationError[]) => any) | undefined;
|
|
273
273
|
"onNode-click"?: ((node: WorkflowNode<NodeType>) => any) | undefined;
|
|
274
274
|
"onEdge-click"?: ((edge: WorkflowEdge) => any) | undefined;
|
|
275
275
|
}>, {
|
|
276
|
-
theme: "light" | "dark";
|
|
277
276
|
readonly: boolean;
|
|
277
|
+
theme: "light" | "dark";
|
|
278
278
|
users: User[];
|
|
279
279
|
roles: Role[];
|
|
280
280
|
departments: Department[];
|
package/dist/verification.d.cts
CHANGED
|
@@ -77,23 +77,23 @@ declare const __VLS_export: vue.DefineComponent<CaptchaProps, {
|
|
|
77
77
|
show: () => void;
|
|
78
78
|
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
79
79
|
change: (valid: boolean) => any;
|
|
80
|
-
reset: () => any;
|
|
81
80
|
success: (data: CaptchaSuccessPayload) => any;
|
|
82
|
-
"load-error": (error: unknown) => any;
|
|
83
81
|
fail: (error: string) => any;
|
|
84
82
|
"verify-error": (error: unknown) => any;
|
|
83
|
+
"load-error": (error: unknown) => any;
|
|
85
84
|
"visible-change": (visible: boolean) => any;
|
|
85
|
+
reset: () => any;
|
|
86
86
|
}, string, vue.PublicProps, Readonly<CaptchaProps> & Readonly<{
|
|
87
87
|
onChange?: ((valid: boolean) => any) | undefined;
|
|
88
|
-
onReset?: (() => any) | undefined;
|
|
89
88
|
onSuccess?: ((data: CaptchaSuccessPayload) => any) | undefined;
|
|
90
|
-
"onLoad-error"?: ((error: unknown) => any) | undefined;
|
|
91
89
|
onFail?: ((error: string) => any) | undefined;
|
|
92
90
|
"onVerify-error"?: ((error: unknown) => any) | undefined;
|
|
91
|
+
"onLoad-error"?: ((error: unknown) => any) | undefined;
|
|
93
92
|
"onVisible-change"?: ((visible: boolean) => any) | undefined;
|
|
93
|
+
onReset?: (() => any) | undefined;
|
|
94
94
|
}>, {
|
|
95
|
-
theme: "light" | "dark";
|
|
96
95
|
disabled: boolean;
|
|
96
|
+
theme: "light" | "dark";
|
|
97
97
|
provider: CaptchaProvider;
|
|
98
98
|
images: string[];
|
|
99
99
|
verificationTimeout: number;
|
package/dist/verification.d.ts
CHANGED
|
@@ -77,23 +77,23 @@ declare const __VLS_export: vue.DefineComponent<CaptchaProps, {
|
|
|
77
77
|
show: () => void;
|
|
78
78
|
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
79
79
|
change: (valid: boolean) => any;
|
|
80
|
-
reset: () => any;
|
|
81
80
|
success: (data: CaptchaSuccessPayload) => any;
|
|
82
|
-
"load-error": (error: unknown) => any;
|
|
83
81
|
fail: (error: string) => any;
|
|
84
82
|
"verify-error": (error: unknown) => any;
|
|
83
|
+
"load-error": (error: unknown) => any;
|
|
85
84
|
"visible-change": (visible: boolean) => any;
|
|
85
|
+
reset: () => any;
|
|
86
86
|
}, string, vue.PublicProps, Readonly<CaptchaProps> & Readonly<{
|
|
87
87
|
onChange?: ((valid: boolean) => any) | undefined;
|
|
88
|
-
onReset?: (() => any) | undefined;
|
|
89
88
|
onSuccess?: ((data: CaptchaSuccessPayload) => any) | undefined;
|
|
90
|
-
"onLoad-error"?: ((error: unknown) => any) | undefined;
|
|
91
89
|
onFail?: ((error: string) => any) | undefined;
|
|
92
90
|
"onVerify-error"?: ((error: unknown) => any) | undefined;
|
|
91
|
+
"onLoad-error"?: ((error: unknown) => any) | undefined;
|
|
93
92
|
"onVisible-change"?: ((visible: boolean) => any) | undefined;
|
|
93
|
+
onReset?: (() => any) | undefined;
|
|
94
94
|
}>, {
|
|
95
|
-
theme: "light" | "dark";
|
|
96
95
|
disabled: boolean;
|
|
96
|
+
theme: "light" | "dark";
|
|
97
97
|
provider: CaptchaProvider;
|
|
98
98
|
images: string[];
|
|
99
99
|
verificationTimeout: number;
|
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
搜索、表单和表格共享值语义,应用保留接口、权限、缓存和业务事务。新增能力均按需接入;未配置时沿用既有行为。
|
|
4
4
|
|
|
5
|
+
## 搜索表单与弹窗组合
|
|
6
|
+
|
|
7
|
+
页面按业务模式用 `computed` 生成搜索字段、编辑字段和动作。字段用稳定的 `prop`,按钮用稳定的 `key`。临时折叠的搜索条件继续生效,固定条件继续随请求发送。如果切换业务类型后某个条件已失效,在应用中清除该值,或从当前适用字段构造一份新查询。`serializeSearch()` 会保留模型中未参与字段编码的键。
|
|
8
|
+
|
|
9
|
+
| 场景 | 接入方式 |
|
|
10
|
+
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
11
|
+
| 搜索、分页、刷新 | `C_FormSearch` 的 `config.onSearch` 交给当前页面的查询控制器。C_Table 可直接返回 `useTableQuery().setQuery()` 的执行结果。MachTable 可使用自己的查询控制器和分页,页面负责提交查询快照并将执行结果返回搜索区。 |
|
|
12
|
+
| 列表操作、编辑弹窗 | `C_ActionBar` 按业务状态计算 `show` 和 `disabled`,动作返回实际的 Promise。新增、编辑共用 `C_FormModal` 和结构化 `editor`,保存成功后由页面刷新列表。 |
|
|
13
|
+
| 字段联动和回填 | `C_Form` 用 `showWhen`、函数式 `readonly` / `disabled`、`dependsOn` 与 `asyncOptions`。简单实体查找用 `C_DataPicker`,在字段插槽中接入,确认后把选中行映射成业务字段。 |
|
|
14
|
+
| 主档、子表和分区弹窗 | `useDataResource` 按主记录标识管理从表请求,`useValidationScope` 聚合跨区校验。主档与子表的草稿、整单保存和操作权限由页面控制器统一持有。 |
|
|
15
|
+
|
|
16
|
+
搜索组件以 `onSearch` 的返回结果更新已执行快照。控制器返回 `false` 时,应把这个值原样传回搜索区。服务端分页用同一份已提交查询翻页,表格组件按各自公开属性绑定。
|
|
17
|
+
|
|
18
|
+
需要多条件筛选、固定业务上下文和多项回填的选择弹窗,可组合 `C_FormSearch`、表格与弹窗外壳。简单选择用 [C_DataPicker](./data-picker.md) 即可。需要先预览再发布时,在页面控制器中保存预览对应的输入快照,并在输入变更后使旧预览失效。
|
|
19
|
+
|
|
5
20
|
## 外部选项与格式化
|
|
6
21
|
|
|
7
22
|
组件库不注册、加载或订阅字典,也不约定第三方插件的字段或注入协议。项目可使用任意数据服务,组合成组件已有的普通配置:
|
|
@@ -23,6 +23,10 @@
|
|
|
23
23
|
|
|
24
24
|
若打印、DOM 集成或自定义穿梭框行高需要完整节点,可给 `C_Transfer` 或 `C_Chat` 设置 `:virtual-scroll="false"`。不要把此开关作为加载更多数据的接口;聊天加载历史仍通过 `load-more` 事件及 `loading-history` 状态接入。
|
|
25
25
|
|
|
26
|
+
## 宽表与分页
|
|
27
|
+
|
|
28
|
+
`C_Table` 只为启用的排序规则查找列。后续切换排序复用按列键建立的索引,动态列变化后按新列重建。本地原生分页的连续序号复用 Naive UI 的筛选行数,兼容路径只计算筛选数量。常规本地分页在筛选和排序后取当前页,远程分页直接使用接口返回的行。
|
|
29
|
+
|
|
26
30
|
## 聊天滚动与输入
|
|
27
31
|
|
|
28
32
|
打开或切换会话定位最新消息。阅读历史时,新增消息不抢滚动位置;前插历史保留阅读锚点。正在底部时,流式文本、迟到图片与面板高度变化继续跟随。跨越自动窗口化门槛也保持当前阅读状态。
|
package/docs/guides/usage.en.md
CHANGED
|
@@ -296,6 +296,10 @@ const { bindings } = useTableQuery<UserRow, { keyword: string }>({
|
|
|
296
296
|
|
|
297
297
|
When binding a headless CRUD controller through `:crud`, the table recognizes `{ error }` action results: failed deletes do not emit a successful-deletion event, and feedback already shown by the controller is not duplicated. Custom `actions.delete` callbacks may return a promise or a `{ data, error }` result.
|
|
298
298
|
|
|
299
|
+
For dynamic reports, bind `<C_Table :columns="report.columns" :data="report.rows" row-key="id" />` and replace the report snapshot when the request completes. Each column uses `{ key, title }`. User width, visibility, pinning, and order follow stable keys. Give separate reports distinct `config.persistKey` values and update the report key, columns, and rows together.
|
|
300
|
+
|
|
301
|
+
The table displays continuous row numbers and a pager with 10 rows per page by default. Use `:row-number="false"` for the automatic index and `:pagination="false"` to disable pagination. An explicit `{ type: 'index' }` keeps its configured position and title. Column headers and cells, including numbers, are centered by default and can be overridden with `titleAlign` and `align`.
|
|
302
|
+
|
|
299
303
|
Tree data can use `<C_Table :data="rows" :columns="columns" :config="{ tree: { defaultExpandAll: true }, pagination: false }" />` directly. `children` is the default child key and can be changed with `tree.childrenKey`. Default expansion includes parent rows added later without reopening rows the user collapsed.
|
|
300
304
|
|
|
301
305
|
`C_Tabs` is the data-driven page-scenario switcher for the global `C_*` system. It defaults to the compact
|
|
@@ -489,9 +493,8 @@ Use `C_FormSearch` with `v-model`; legacy `formParams` remains supported. Put re
|
|
|
489
493
|
rowKey: 'id',
|
|
490
494
|
request: loadUsers,
|
|
491
495
|
})
|
|
492
|
-
const applyQuery =
|
|
493
|
-
|
|
494
|
-
}
|
|
496
|
+
const applyQuery = (params: SearchFormParams) =>
|
|
497
|
+
setQuery({ keyword: String(params.keyword ?? '') })
|
|
495
498
|
const searchConfig: SearchConfig = {
|
|
496
499
|
requireValue: false,
|
|
497
500
|
onSearch: applyQuery,
|
package/docs/guides/usage.md
CHANGED
|
@@ -376,6 +376,47 @@ const fields = defineFormOptions([
|
|
|
376
376
|
|
|
377
377
|
将 Headless CRUD 绑定到 `:crud` 时,表格会识别操作结果中的 `{ error }`:失败不会触发删除成功事件,也不会重复展示 CRUD 控制器已经展示的反馈。自定义 `actions.delete` 可返回 Promise,或返回 `{ data, error }` 结构。
|
|
378
378
|
|
|
379
|
+
### 后端返回列和行
|
|
380
|
+
|
|
381
|
+
接口的列定义使用 `{ key, title }` 时直接绑定。把同一次查询的列和行一起提交给响应式状态:
|
|
382
|
+
|
|
383
|
+
```vue
|
|
384
|
+
<script setup lang="ts">
|
|
385
|
+
import { shallowRef } from 'vue'
|
|
386
|
+
import {
|
|
387
|
+
C_Table,
|
|
388
|
+
type TableColumn,
|
|
389
|
+
} from '@robot-admin/naive-ui-components/C_Table'
|
|
390
|
+
import { getReport } from './api'
|
|
391
|
+
|
|
392
|
+
const report = shallowRef<{
|
|
393
|
+
columns: TableColumn[]
|
|
394
|
+
rows: Record<string, unknown>[]
|
|
395
|
+
}>({ columns: [], rows: [] })
|
|
396
|
+
|
|
397
|
+
async function load() {
|
|
398
|
+
report.value = await getReport()
|
|
399
|
+
}
|
|
400
|
+
</script>
|
|
401
|
+
|
|
402
|
+
<template>
|
|
403
|
+
<button
|
|
404
|
+
type="button"
|
|
405
|
+
@click="load"
|
|
406
|
+
>查询</button
|
|
407
|
+
>
|
|
408
|
+
<C_Table
|
|
409
|
+
:columns="report.columns"
|
|
410
|
+
:data="report.rows"
|
|
411
|
+
row-key="id"
|
|
412
|
+
/>
|
|
413
|
+
</template>
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
表格默认显示跨页连续序号和分页器(每页 10 条),标题及单元格均居中,数字也一样。通过 `:row-number="false"` 关闭自动序号,通过 `:pagination="false"` 或 `:config="{ pagination: false }"` 关闭分页。手动声明的 `{ type: 'index' }` 保留指定的位置和标题,表格只补一份序号。单列可以用 `align`、`titleAlign` 覆盖默认对齐。
|
|
417
|
+
|
|
418
|
+
同一张报表的列 `key` 保持稳定时,换列仍会应用已有的宽度、显隐、固定和排序偏好。新列使用接口给出的配置,已移除的列退出当前偏好。需要跨页面刷新恢复偏好或切换多张报表时,给每张报表一个不同的 `config.persistKey`。切换报表时一起更新该标识、列和行。
|
|
419
|
+
|
|
379
420
|
树形数据可直接使用 `<C_Table :data="rows" :columns="columns" :config="{ tree: { defaultExpandAll: true }, pagination: false }" />`;`children` 是默认子节点字段,也可通过 `tree.childrenKey` 指定。默认展开会初始化所有父节点,并在异步追加新父节点时展开新节点,不会重新展开用户手动收起的旧节点。
|
|
380
421
|
|
|
381
422
|
`C_Tabs` 是面向页面场景切换的统一数据驱动标签页,名称与全局 `C_*` 体系保持一致。默认使用紧凑
|
|
@@ -591,9 +632,8 @@ const filters: SearchFormItem[] = [
|
|
|
591
632
|
rowKey: 'id',
|
|
592
633
|
request: loadUsers,
|
|
593
634
|
})
|
|
594
|
-
const applyQuery =
|
|
595
|
-
|
|
596
|
-
}
|
|
635
|
+
const applyQuery = (params: SearchFormParams) =>
|
|
636
|
+
setQuery({ keyword: String(params.keyword ?? '') })
|
|
597
637
|
const searchConfig: SearchConfig = {
|
|
598
638
|
requireValue: false,
|
|
599
639
|
onSearch: applyQuery,
|