bw-pro-table 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/README.md +827 -151
  2. package/dist/bw-pro-table.css +1 -1
  3. package/dist/bw-pro-table.js +2638 -2112
  4. package/dist/bw-pro-table.umd.cjs +9 -9
  5. package/dist/types/BwProTable.vue.d.ts +35 -12
  6. package/dist/types/BwProTableBatchEditModal.vue.d.ts +4 -4
  7. package/dist/types/BwProTableColumnSearch.vue.d.ts +3 -3
  8. package/dist/types/BwProTableColumnSetting.vue.d.ts +4 -4
  9. package/dist/types/BwProTableCore.vue.d.ts +8 -5
  10. package/dist/types/BwProTableImportModal.vue.d.ts +40 -0
  11. package/dist/types/BwProTableSearch.vue.d.ts +5 -5
  12. package/dist/types/BwProTableToolbar.vue.d.ts +18 -6
  13. package/dist/types/composables/useBwKeyboard.d.ts +1 -1
  14. package/dist/types/composables/useBwPermission.d.ts +2 -2
  15. package/dist/types/composables/useBwRowEdit.d.ts +10 -8
  16. package/dist/types/composables/useBwRowSelection.d.ts +2 -2
  17. package/dist/types/composables/useColumnHeaderSearch.d.ts +2 -2
  18. package/dist/types/composables/useContextMenu.d.ts +4 -2
  19. package/dist/types/composables/useDragSort.d.ts +2 -2
  20. package/dist/types/composables/useExportExcel.d.ts +14 -7
  21. package/dist/types/composables/useImportExcel.d.ts +14 -8
  22. package/dist/types/composables/useLocale.d.ts +8 -4
  23. package/dist/types/composables/usePersistence.d.ts +4 -2
  24. package/dist/types/composables/useQueryParams.d.ts +2 -2
  25. package/dist/types/composables/useTableView.d.ts +4 -2
  26. package/dist/types/constants.d.ts +7 -3
  27. package/dist/types/drag-icon.vue.d.ts +3 -3
  28. package/dist/types/index.d.ts +1 -1
  29. package/dist/types/injection-keys.d.ts +7 -10
  30. package/dist/types/locales/zh-CN.d.ts +1 -4
  31. package/dist/types/renderers/action-renderer.d.ts +2 -2
  32. package/dist/types/renderers/avatar-renderer.d.ts +1 -1
  33. package/dist/types/renderers/boolean-renderer.d.ts +1 -1
  34. package/dist/types/renderers/currency-renderer.d.ts +1 -1
  35. package/dist/types/renderers/date-renderer.d.ts +1 -1
  36. package/dist/types/renderers/image-renderer.d.ts +1 -1
  37. package/dist/types/renderers/index-renderer.d.ts +1 -1
  38. package/dist/types/renderers/index.d.ts +1 -9
  39. package/dist/types/renderers/link-renderer.d.ts +1 -1
  40. package/dist/types/renderers/number-renderer.d.ts +1 -1
  41. package/dist/types/renderers/progress-renderer.d.ts +1 -1
  42. package/dist/types/renderers/registry.d.ts +6 -2
  43. package/dist/types/renderers/tag-enum-renderer.d.ts +1 -1
  44. package/dist/types/renderers/text-renderer.d.ts +1 -1
  45. package/dist/types/types.d.ts +69 -8
  46. package/locales/zh-CN.ts +1 -0
  47. package/package.json +12 -11
  48. package/dist/types/BwProTableAdvancedFilter.vue.d.ts +0 -17
  49. package/dist/types/BwProTableContextMenu.vue.d.ts +0 -20
@@ -1,20 +1,20 @@
1
- import type { BwProTableProps, ProColumnType } from './types';
1
+ import { BwProTableProps, ProColumnType } from './types';
2
2
  interface Props extends BwProTableProps {
3
3
  }
4
4
  declare function fetchData(_retryCount?: number): Promise<void>;
5
5
  /** 清空所有跨页选择 */
6
6
  declare function handleClearAllSelection(): void;
7
- declare var __VLS_1: {}, __VLS_12: {}, __VLS_23: {}, __VLS_35: string, __VLS_36: any;
7
+ declare var __VLS_7: {}, __VLS_19: {}, __VLS_42: {}, __VLS_56: string, __VLS_57: any;
8
8
  type __VLS_Slots = {} & {
9
- [K in NonNullable<typeof __VLS_35>]?: (props: typeof __VLS_36) => any;
9
+ [K in NonNullable<typeof __VLS_56>]?: (props: typeof __VLS_57) => any;
10
10
  } & {
11
- search?: (props: typeof __VLS_1) => any;
11
+ search?: (props: typeof __VLS_7) => any;
12
12
  } & {
13
- toolbar?: (props: typeof __VLS_12) => any;
13
+ toolbar?: (props: typeof __VLS_19) => any;
14
14
  } & {
15
- 'toolbar-extra'?: (props: typeof __VLS_23) => any;
15
+ 'toolbar-extra'?: (props: typeof __VLS_42) => any;
16
16
  };
17
- declare const __VLS_base: import("vue").DefineComponent<Props, {
17
+ declare const __VLS_base: import('vue').DefineComponent<Props, {
18
18
  fetchData: typeof fetchData;
19
19
  getSelectedRowKeys: () => (string | number)[];
20
20
  getSelectedRows: () => any[];
@@ -22,7 +22,30 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {
22
22
  clearSelection: typeof handleClearAllSelection;
23
23
  getCrossPageSelectedKeys: () => (string | number)[];
24
24
  getCrossPageSelectedRows: () => any[];
25
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
25
+ startRowEdit: (key: string | number) => Promise<void>;
26
+ startCellEdit: (key: string | number, field: string) => Promise<void>;
27
+ saveEdit: (key: string | number) => Promise<boolean>;
28
+ cancelEdit: (key: string | number, field?: string) => void;
29
+ addRow: (position?: "top" | "bottom") => void;
30
+ cloneRow: (key: string | number) => void;
31
+ deleteRow: (key: string | number) => Promise<void>;
32
+ deleteRows: (keys: (string | number)[]) => Promise<void>;
33
+ isCellEditing: (key: string | number, field: string) => boolean;
34
+ getEditingKeys: () => Set<string | number>;
35
+ canUndo: () => boolean;
36
+ canRedo: () => boolean;
37
+ undo: () => void;
38
+ redo: () => void;
39
+ openBatchEdit: () => void;
40
+ exportExcel: () => Promise<void>;
41
+ exportCsv: () => Promise<void>;
42
+ exportSelected: (selectedRows: any[], selectedKeys?: (string | number)[]) => Promise<void>;
43
+ openFileDialog: () => void;
44
+ downloadTemplate: (columns: {
45
+ title: string;
46
+ dataIndex: string;
47
+ }[]) => Promise<void>;
48
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
26
49
  error: (error: Error) => any;
27
50
  change: (pagination: any, filters: any, sorter: any, extra?: {
28
51
  action: "paginate" | "sort" | "filter";
@@ -33,7 +56,7 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {
33
56
  total: number;
34
57
  }) => any;
35
58
  resizeColumn: (w: number, col: ProColumnType<any>) => any;
36
- }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
59
+ }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
37
60
  onError?: ((error: Error) => any) | undefined;
38
61
  onChange?: ((pagination: any, filters: any, sorter: any, extra?: {
39
62
  action: "paginate" | "sort" | "filter";
@@ -45,12 +68,12 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {
45
68
  }) => any) | undefined;
46
69
  onResizeColumn?: ((w: number, col: ProColumnType<any>) => any) | undefined;
47
70
  }>, {
48
- rowKey: string | import("ant-design-vue/es/vc-table/interface").GetRowKey<any>;
71
+ rowKey: string | import('./types').GetRowKey<any>;
49
72
  size: "small" | "middle" | "default";
50
73
  tableId: string;
51
- pagination: false | import("ant-design-vue").TablePaginationConfig;
74
+ pagination: false | import('ant-design-vue').TablePaginationConfig;
52
75
  defaultEmptyText: string;
53
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
76
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
54
77
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
55
78
  declare const _default: typeof __VLS_export;
56
79
  export default _default;
@@ -1,4 +1,4 @@
1
- import type { ProColumnsType } from './types';
1
+ import { ProColumnsType } from './types';
2
2
  interface Props {
3
3
  visible: boolean;
4
4
  columns: ProColumnsType;
@@ -6,18 +6,18 @@ interface Props {
6
6
  /** 行主键属性名(排除 rowKey 列,防止将主键字段作为批量编辑目标) */
7
7
  rowKey?: string;
8
8
  }
9
- declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
+ declare const __VLS_export: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
10
10
  "update:visible": (value: boolean) => any;
11
11
  confirm: (payload: {
12
12
  field: string;
13
13
  value: any;
14
14
  }) => any;
15
- }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
15
+ }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
16
16
  "onUpdate:visible"?: ((value: boolean) => any) | undefined;
17
17
  onConfirm?: ((payload: {
18
18
  field: string;
19
19
  value: any;
20
20
  }) => any) | undefined;
21
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
21
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
22
22
  declare const _default: typeof __VLS_export;
23
23
  export default _default;
@@ -5,10 +5,10 @@ interface Props {
5
5
  searchText?: string;
6
6
  resetText?: string;
7
7
  }
8
- declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
+ declare const __VLS_export: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
9
9
  close: () => any;
10
- }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
10
+ }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
11
11
  onClose?: (() => any) | undefined;
12
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
13
13
  declare const _default: typeof __VLS_export;
14
14
  export default _default;
@@ -1,14 +1,14 @@
1
- import type { ProColumnsType, PersistedColumnState } from './types';
1
+ import { ProColumnsType, PersistedColumnState } from './types';
2
2
  interface Props {
3
3
  columns: ProColumnsType;
4
4
  persistedColumns?: PersistedColumnState[];
5
5
  }
6
- declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ declare const __VLS_export: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
7
  change: (columns: PersistedColumnState[]) => any;
8
8
  reset: () => any;
9
- }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
9
+ }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
10
10
  onChange?: ((columns: PersistedColumnState[]) => any) | undefined;
11
11
  onReset?: (() => any) | undefined;
12
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
13
13
  declare const _default: typeof __VLS_export;
14
14
  export default _default;
@@ -1,4 +1,4 @@
1
- import type { ProColumnsType } from './types';
1
+ import { ProColumnsType } from './types';
2
2
  interface Props {
3
3
  columns: ProColumnsType;
4
4
  /** 行 key 属性名(与 ant-design-vue Table rowKey 语义一致,默认 'id') */
@@ -7,6 +7,8 @@ interface Props {
7
7
  errorMessage?: string;
8
8
  pagination?: false | Record<string, any>;
9
9
  onRetry?: () => void | Promise<void>;
10
+ /** 全局空单元格占位符,优先级低于列级 emptyText */
11
+ defaultEmptyText?: string;
10
12
  }
11
13
  declare var __VLS_24: string, __VLS_25: any, __VLS_28: any, __VLS_36: {
12
14
  column: any;
@@ -18,16 +20,17 @@ type __VLS_Slots = {} & {
18
20
  } & {
19
21
  headerCell?: (props: typeof __VLS_36) => any;
20
22
  };
21
- declare const __VLS_base: import("vue").DefineComponent<Props, {
23
+ declare const __VLS_base: import('vue').DefineComponent<Props, {
22
24
  retry: () => void;
23
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
25
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
24
26
  retry: () => any;
25
- }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
27
+ }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
26
28
  onRetry?: (() => any) | undefined;
27
29
  }>, {
28
30
  columns: ProColumnsType;
29
31
  rowKey: string;
30
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
32
+ defaultEmptyText: string;
33
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
31
34
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
32
35
  declare const _default: typeof __VLS_export;
33
36
  export default _default;
@@ -0,0 +1,40 @@
1
+ import { ProColumnsType } from './types';
2
+ interface Props {
3
+ /** 是否显示弹窗 */
4
+ visible: boolean;
5
+ /** 是否正在导入 */
6
+ importing?: boolean;
7
+ /** 预览数据 */
8
+ previewData?: any[];
9
+ /** 预览列头 */
10
+ previewColumns?: string[];
11
+ /** 校验错误 */
12
+ validateErrors?: string[];
13
+ /** 表格列定义(用于列映射下拉和模板下载) */
14
+ columns?: ProColumnsType;
15
+ /** 列映射当前值 */
16
+ columnMapping?: Record<string, string>;
17
+ }
18
+ declare const __VLS_export: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
19
+ cancel: () => any;
20
+ "update:visible": (val: boolean) => any;
21
+ confirm: () => any;
22
+ "select-file": () => any;
23
+ "update:columnMapping": (val: Record<string, string>) => any;
24
+ "download-template": () => any;
25
+ }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
26
+ onCancel?: (() => any) | undefined;
27
+ "onUpdate:visible"?: ((val: boolean) => any) | undefined;
28
+ onConfirm?: (() => any) | undefined;
29
+ "onSelect-file"?: (() => any) | undefined;
30
+ "onUpdate:columnMapping"?: ((val: Record<string, string>) => any) | undefined;
31
+ "onDownload-template"?: (() => any) | undefined;
32
+ }>, {
33
+ importing: boolean;
34
+ previewData: any[];
35
+ previewColumns: string[];
36
+ validateErrors: string[];
37
+ columnMapping: Record<string, string>;
38
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
39
+ declare const _default: typeof __VLS_export;
40
+ export default _default;
@@ -1,4 +1,4 @@
1
- import type { ProColumnsType } from './types';
1
+ import { ProColumnsType } from './types';
2
2
  interface Props {
3
3
  columns: ProColumnsType;
4
4
  searchConfig?: {
@@ -11,12 +11,12 @@ interface Props {
11
11
  }
12
12
  /** 暴露给父组件:仅清空表单 UI,不触发事件 */
13
13
  declare function resetForm(): void;
14
- declare const __VLS_export: import("vue").DefineComponent<Props, {
14
+ declare const __VLS_export: import('vue').DefineComponent<Props, {
15
15
  resetForm: typeof resetForm;
16
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
16
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
17
17
  search: (params: Record<string, any>) => any;
18
18
  reset: () => any;
19
- }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
19
+ }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
20
20
  onSearch?: ((params: Record<string, any>) => any) | undefined;
21
21
  onReset?: (() => any) | undefined;
22
22
  }>, {
@@ -28,6 +28,6 @@ declare const __VLS_export: import("vue").DefineComponent<Props, {
28
28
  searchText?: string;
29
29
  collapsedCount?: number;
30
30
  };
31
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
31
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
32
32
  declare const _default: typeof __VLS_export;
33
33
  export default _default;
@@ -1,4 +1,4 @@
1
- import type { ProColumnsType, PersistedColumnState } from './types';
1
+ import { ProColumnsType, PersistedColumnState } from './types';
2
2
  interface Props {
3
3
  title?: string;
4
4
  loading?: boolean;
@@ -29,16 +29,23 @@ interface Props {
29
29
  selectionCount?: number;
30
30
  /** 是否启用跨页选择 */
31
31
  hasCrossPageSelection?: boolean;
32
+ /** 是否正在导出 */
33
+ exporting?: boolean;
34
+ /** 是否正在导入 */
35
+ importing?: boolean;
32
36
  }
33
37
  declare var __VLS_1: {};
34
38
  type __VLS_Slots = {} & {
35
39
  extra?: (props: typeof __VLS_1) => any;
36
40
  };
37
- declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
38
- export: () => any;
41
+ declare const __VLS_base: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
42
+ import: () => any;
39
43
  refresh: () => any;
40
44
  "clear-filter": () => any;
41
45
  "clear-selection": () => any;
46
+ "export-excel": () => any;
47
+ "export-csv": () => any;
48
+ "export-selected": () => any;
42
49
  "density-change": (size: "default" | "small" | "middle") => any;
43
50
  "column-setting": () => any;
44
51
  "column-change": (columns: PersistedColumnState[]) => any;
@@ -46,11 +53,14 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
46
53
  "toggle-bordered": () => any;
47
54
  "toggle-striped": () => any;
48
55
  fullscreen: () => any;
49
- }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
50
- onExport?: (() => any) | undefined;
56
+ }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
57
+ onImport?: (() => any) | undefined;
51
58
  onRefresh?: (() => any) | undefined;
52
59
  "onClear-filter"?: (() => any) | undefined;
53
60
  "onClear-selection"?: (() => any) | undefined;
61
+ "onExport-excel"?: (() => any) | undefined;
62
+ "onExport-csv"?: (() => any) | undefined;
63
+ "onExport-selected"?: (() => any) | undefined;
54
64
  "onDensity-change"?: ((size: "default" | "small" | "middle") => any) | undefined;
55
65
  "onColumn-setting"?: (() => any) | undefined;
56
66
  "onColumn-change"?: ((columns: PersistedColumnState[]) => any) | undefined;
@@ -73,7 +83,9 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
73
83
  viewManager?: boolean;
74
84
  };
75
85
  isFullscreen: boolean;
76
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
86
+ exporting: boolean;
87
+ importing: boolean;
88
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
77
89
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
78
90
  declare const _default: typeof __VLS_export;
79
91
  export default _default;
@@ -1,4 +1,4 @@
1
- import { type Ref } from 'vue';
1
+ import { Ref } from 'vue';
2
2
  export interface UseBwKeyboardOptions {
3
3
  /** 数据源长度 */
4
4
  dataLength: Ref<number> | number;
@@ -1,5 +1,5 @@
1
- import { type Ref, type ComputedRef } from 'vue';
2
- import type { ProColumnsType } from '../types';
1
+ import { Ref, ComputedRef } from 'vue';
2
+ import { ProColumnsType } from '../types';
3
3
  export interface UseBwPermissionOptions {
4
4
  /** 列定义 */
5
5
  columns: Ref<ProColumnsType> | ComputedRef<ProColumnsType>;
@@ -1,18 +1,20 @@
1
- import { type Ref, type ComputedRef } from 'vue';
2
- import type { EditConfig, ProColumnsType } from '../types';
1
+ import { Ref, ComputedRef } from 'vue';
2
+ import { EditConfig, ProColumnsType } from '../types';
3
3
  export interface UseBwRowEditOptions<RecordType = any> {
4
4
  /** 全量数据源 */
5
5
  dataSource: Ref<RecordType[]>;
6
6
  /** 列定义 */
7
7
  columns: Ref<ProColumnsType<RecordType>> | ComputedRef<ProColumnsType<RecordType>>;
8
- /** 行 key 属性名 */
9
- rowKey?: string;
8
+ /** 行 key 属性名(支持 ComputedRef 以响应 rowKey 变化) */
9
+ rowKey?: string | ComputedRef<string>;
10
10
  /** 编辑配置 */
11
11
  editConfig?: Ref<EditConfig<RecordType> | undefined>;
12
12
  /** 保存回调 */
13
13
  onSave?: (record: RecordType, isNew: boolean) => Promise<void>;
14
14
  /** 删除回调 */
15
15
  onDelete?: (keys: (string | number)[]) => Promise<void>;
16
+ /** 国际化语言包(由 BwProTable 传入,避免 provide/inject 时序问题) */
17
+ locale?: ComputedRef<import('../types').BwProTableLocale>;
16
18
  }
17
19
  export interface UseBwRowEditReturn<RecordType = any> {
18
20
  /** 当前处于编辑态的行 keys */
@@ -28,17 +30,17 @@ export interface UseBwRowEditReturn<RecordType = any> {
28
30
  /** 设置草稿值 */
29
31
  setDraftValue: (key: string | number, field: string, value: any) => void;
30
32
  /** 进入单元格编辑 */
31
- startCellEdit: (key: string | number, field: string) => void;
33
+ startCellEdit: (key: string | number, field: string) => Promise<void>;
32
34
  /** 进入行编辑 */
33
- startRowEdit: (key: string | number) => void;
35
+ startRowEdit: (key: string | number) => Promise<void>;
34
36
  /** 新增空行 */
35
37
  addRow: (position?: 'top' | 'bottom') => void;
36
38
  /** 克隆行 */
37
39
  cloneRow: (key: string | number) => void;
38
40
  /** 保存编辑 */
39
41
  saveEdit: (key: string | number) => Promise<boolean>;
40
- /** 取消编辑 */
41
- cancelEdit: (key: string | number) => void;
42
+ /** 取消编辑(指定 field 时仅取消该单元格编辑) */
43
+ cancelEdit: (key: string | number, field?: string) => void;
42
44
  /** 删除行 */
43
45
  deleteRow: (key: string | number) => Promise<void>;
44
46
  /** 批量删除 */
@@ -1,5 +1,5 @@
1
- import { type Ref, type ComputedRef } from 'vue';
2
- import type { TableRowSelection } from 'ant-design-vue/es/table/interface';
1
+ import { Ref, ComputedRef } from 'vue';
2
+ import { TableRowSelection } from '../types';
3
3
  export interface UseBwRowSelectionOptions<RecordType = any> {
4
4
  /** 全量数据源 */
5
5
  dataSource: Ref<RecordType[]> | ComputedRef<RecordType[]>;
@@ -1,5 +1,5 @@
1
- import { type Ref, type ComputedRef } from 'vue';
2
- import type { ProColumnsType, FilterValue } from '../types';
1
+ import { Ref, ComputedRef } from 'vue';
2
+ import { ProColumnsType, FilterValue } from '../types';
3
3
  export interface UseColumnHeaderSearchOptions<RecordType = any> {
4
4
  /** 列定义 */
5
5
  columns: Ref<ProColumnsType<RecordType>> | ComputedRef<ProColumnsType<RecordType>>;
@@ -1,5 +1,5 @@
1
- import { type Ref, type ComputedRef } from 'vue';
2
- import type { ContextMenuItem, ContextMenuType, ContextMenuConfig, ProColumnsType } from '../types';
1
+ import { Ref, ComputedRef } from 'vue';
2
+ import { ContextMenuItem, ContextMenuType, ContextMenuConfig, ProColumnsType } from '../types';
3
3
  export interface ContextMenuState {
4
4
  /** 是否可见 */
5
5
  visible: boolean;
@@ -24,6 +24,8 @@ export interface UseContextMenuOptions {
24
24
  config?: ContextMenuConfig;
25
25
  /** 列定义(用于生成表头菜单默认项) */
26
26
  columns?: Ref<ProColumnsType> | ComputedRef<ProColumnsType>;
27
+ /** 国际化语言包(由 BwProTable 传入,避免 provide/inject 时序问题) */
28
+ locale?: ComputedRef<import('../types').BwProTableLocale>;
27
29
  }
28
30
  export interface UseContextMenuReturn {
29
31
  /** 菜单状态 */
@@ -1,5 +1,5 @@
1
- import { type Ref, type ComputedRef } from 'vue';
2
- import type { DragConfig, ProColumnsType } from '../types';
1
+ import { Ref, ComputedRef } from 'vue';
2
+ import { DragConfig, ProColumnsType } from '../types';
3
3
  export interface UseDragSortOptions<RecordType = any> {
4
4
  /** 数据源 */
5
5
  dataSource: Ref<RecordType[]>;
@@ -1,20 +1,24 @@
1
- import { type Ref } from 'vue';
2
- import type { ProColumnsType, ExportConfig } from '../types';
1
+ import { Ref, ComputedRef } from 'vue';
2
+ import { ProColumnsType, ExportConfig } from '../types';
3
3
  export interface UseExportExcelOptions<RecordType = any> {
4
4
  /** 列定义 */
5
- columns: Ref<ProColumnsType<RecordType>>;
5
+ columns: Ref<ProColumnsType<RecordType>> | ComputedRef<ProColumnsType<RecordType>>;
6
6
  /** 数据源 */
7
7
  dataSource: Ref<readonly RecordType[]>;
8
- /** 导出配置 */
9
- exportConfig?: ExportConfig;
8
+ /** 导出配置(支持响应式) */
9
+ exportConfig?: Ref<ExportConfig | undefined> | ComputedRef<ExportConfig | undefined> | ExportConfig;
10
+ /** 当前搜索/筛选/排序参数(传入 onExportAll 回调) */
11
+ searchParams?: Ref<Record<string, any>> | ComputedRef<Record<string, any>>;
12
+ /** 国际化语言包(由 BwProTable 传入,避免 provide/inject 时序问题) */
13
+ locale?: ComputedRef<import('../types').BwProTableLocale>;
10
14
  }
11
15
  export interface UseExportExcelReturn {
12
16
  /** 导出 Excel */
13
17
  exportExcel: () => Promise<void>;
14
18
  /** 导出 CSV */
15
- exportCsv: () => void;
19
+ exportCsv: () => Promise<void>;
16
20
  /** 导出选中行 */
17
- exportSelected: (selectedRows: any[]) => Promise<void>;
21
+ exportSelected: (selectedRows: any[], selectedKeys?: (string | number)[]) => Promise<void>;
18
22
  /** 导出自定义列弹窗 */
19
23
  showColumnSelect: Ref<boolean>;
20
24
  /** 是否正在导出 */
@@ -29,7 +33,10 @@ export interface UseExportExcelReturn {
29
33
  * 支持:
30
34
  * - 导出 Excel / CSV
31
35
  * - 导出选中行
36
+ * - Request 模式通过 onExportAll 回调获取全量数据
37
+ * - beforeExport 导出前拦截
32
38
  * - 分片导出(大数据量 + 进度条)
33
39
  * - 自定义列选择导出
40
+ * - 导出配置响应式更新
34
41
  */
35
42
  export declare function useExportExcel<RecordType extends Record<string, any> = any>(options: UseExportExcelOptions<RecordType>): UseExportExcelReturn;
@@ -1,8 +1,12 @@
1
- import { type Ref } from 'vue';
2
- import type { ImportConfig } from '../types';
1
+ import { Ref, ComputedRef } from 'vue';
2
+ import { ImportConfig, ProColumnsType } from '../types';
3
3
  export interface UseImportExcelOptions {
4
- /** 导入配置 */
5
- importConfig?: ImportConfig;
4
+ /** 导入配置(支持响应式) */
5
+ importConfig?: Ref<ImportConfig | undefined> | ComputedRef<ImportConfig | undefined> | ImportConfig;
6
+ /** 列定义(用于自动列映射) */
7
+ columns?: Ref<ProColumnsType> | ComputedRef<ProColumnsType>;
8
+ /** 国际化语言包(由 BwProTable 传入,避免 provide/inject 时序问题) */
9
+ locale?: ComputedRef<import('../types').BwProTableLocale>;
6
10
  }
7
11
  export interface UseImportExcelReturn {
8
12
  /** 是否正在导入 */
@@ -21,8 +25,8 @@ export interface UseImportExcelReturn {
21
25
  openFileDialog: () => void;
22
26
  /** 处理文件 */
23
27
  handleFile: (file: File) => Promise<void>;
24
- /** 确认导入 */
25
- confirmImport: () => Promise<void>;
28
+ /** 确认导入,返回是否成功 */
29
+ confirmImport: () => Promise<boolean>;
26
30
  /** 取消 */
27
31
  cancel: () => void;
28
32
  /** 下载模板 */
@@ -37,9 +41,11 @@ export interface UseImportExcelReturn {
37
41
  * 使用 FileReader + xlsx 解析 Excel 文件。
38
42
  * 支持:
39
43
  * - 预览解析数据
40
- * - 列映射配置
41
- * - 数据校验
44
+ * - 自动列映射(基于 Excel 表头 ↔ 列 title 匹配)
45
+ * - 手动列映射配置
46
+ * - 数据校验(基于 FormRule 指定字段)
42
47
  * - 导入提交
43
48
  * - 模板下载
49
+ * - 配置响应式更新
44
50
  */
45
51
  export declare function useImportExcel(options?: UseImportExcelOptions): UseImportExcelReturn;
@@ -1,12 +1,16 @@
1
- import type { InjectionKey, ComputedRef } from 'vue';
2
- import type { BwProTableLocale } from '../types';
1
+ import { InjectionKey, ComputedRef } from 'vue';
2
+ import { BwProTableLocale } from '../types';
3
3
  /** 注入 Key */
4
4
  export declare const BW_PRO_TABLE_LOCALE_KEY: InjectionKey<ComputedRef<BwProTableLocale>>;
5
5
  /**
6
6
  * 在 setup 中获取当前生效的语言包。
7
- * 必须在 BwProTable 子树内调用(即通过 provide 已提供 locale),否则回退到默认 zh-CN。
7
+ *
8
+ * 优先级:
9
+ * 1. 直接传入的 locale 参数(父组件 provide 时自身无法 inject,需显式传递)
10
+ * 2. 通过 provide/inject 注入的 locale(子组件场景)
11
+ * 3. 回退到默认 zh-CN
8
12
  */
9
- export declare function useLocale(): ComputedRef<BwProTableLocale>;
13
+ export declare function useLocale(directLocale?: ComputedRef<BwProTableLocale>): ComputedRef<BwProTableLocale>;
10
14
  /**
11
15
  * 深度合并自定义 locale 到默认 zh-CN。
12
16
  * 外部传入 Partial<BwProTableLocale>,内部补全缺失字段。
@@ -1,5 +1,5 @@
1
- import { type Ref } from 'vue';
2
- import type { PersistedColumnState, ProColumnsType, PersistenceConfig, FilterValue, SortOrder } from '../types';
1
+ import { Ref } from 'vue';
2
+ import { PersistedTableState, PersistedColumnState, ProColumnsType, PersistenceConfig, FilterValue, SortOrder } from '../types';
3
3
  export interface UsePersistenceOptions {
4
4
  /** 表格唯一标识 */
5
5
  tableId?: string;
@@ -47,6 +47,8 @@ export interface UsePersistenceReturn {
47
47
  clearCache: () => void;
48
48
  /** 同步当前 columns 到缓存 */
49
49
  syncColumnState: () => void;
50
+ /** 一次性读取完整持久化状态(避免批量加载时多次 localStorage.get + JSON.parse) */
51
+ readFullState: () => PersistedTableState | null;
50
52
  }
51
53
  /**
52
54
  * usePersistence — 列配置持久化 composable
@@ -1,5 +1,5 @@
1
- import { type Ref, type ComputedRef } from 'vue';
2
- import type { SortOrder, FilterValue } from '../types';
1
+ import { Ref, ComputedRef } from 'vue';
2
+ import { SortOrder, FilterValue } from '../types';
3
3
  export interface UseQueryParamsOptions {
4
4
  /** 初始分页 */
5
5
  initialPageSize?: number;
@@ -1,9 +1,11 @@
1
- import { type Ref } from 'vue';
2
- import type { ViewConfig, PersistedColumnState, ProColumnsType } from '../types';
1
+ import { Ref, ComputedRef } from 'vue';
2
+ import { ViewConfig, PersistedColumnState, ProColumnsType } from '../types';
3
3
  export interface UseTableViewOptions {
4
4
  tableId: string;
5
5
  columns?: Ref<ProColumnsType>;
6
6
  defaultColumns?: PersistedColumnState[];
7
+ /** 国际化语言包(由 BwProTable 传入,避免 provide/inject 时序问题) */
8
+ locale?: ComputedRef<import('../types').BwProTableLocale>;
7
9
  }
8
10
  export interface UseTableViewReturn {
9
11
  /** 所有视图列表 */
@@ -1,4 +1,4 @@
1
- import type { ValueType, PersistedTableState, TableState } from './types';
1
+ import { ValueType, PersistedTableState, TableState, ProColumnType } from './types';
2
2
  /** 默认每页条数 */
3
3
  export declare const DEFAULT_PAGE_SIZE = 10;
4
4
  /** 可选每页条数 */
@@ -42,8 +42,6 @@ export declare const DEFAULT_EXPORT_CHUNK_SIZE = 10000;
42
42
  export declare const DEFAULT_EXPORT_MAX_ROWS_WARNING = 50000;
43
43
  /** 导出默认文件名 */
44
44
  export declare const DEFAULT_EXPORT_FILENAME = "export";
45
- /** 请求防抖延迟(ms) */
46
- export declare const REQUEST_DEBOUNCE_DELAY = 300;
47
45
  /** 键盘导航列键映射 */
48
46
  export declare const KEYBOARD_NAV_KEYS: {
49
47
  readonly UP: "ArrowUp";
@@ -58,3 +56,9 @@ export declare const KEYBOARD_NAV_KEYS: {
58
56
  };
59
57
  /** 导入预览显示行数 */
60
58
  export declare const IMPORT_PREVIEW_MAX_ROWS = 10;
59
+ /**
60
+ * Issue #13 修复:统一的特殊列判断工具函数
61
+ * 判断列是否属于「特殊列」(不应参与拖拽排序、导出、列设置等操作)
62
+ * 覆盖 valueType 和 dataIndex/key 两种标识方式
63
+ */
64
+ export declare function isSpecialColumn(col: ProColumnType): boolean;
@@ -1,14 +1,14 @@
1
1
  interface Props {
2
2
  draggable?: boolean;
3
3
  }
4
- declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
4
+ declare const __VLS_export: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
5
5
  dragend: (e: DragEvent) => any;
6
6
  dragstart: (e: DragEvent) => any;
7
- }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
7
+ }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
8
8
  onDragend?: ((e: DragEvent) => any) | undefined;
9
9
  onDragstart?: ((e: DragEvent) => any) | undefined;
10
10
  }>, {
11
11
  draggable: boolean;
12
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
13
13
  declare const _default: typeof __VLS_export;
14
14
  export default _default;
@@ -12,7 +12,7 @@ export { initBuiltinRenderers, resetRenderers } from './renderers/index';
12
12
  export { BW_PRO_TABLE_KEY } from './injection-keys';
13
13
  export type { BwProTableContext } from './injection-keys';
14
14
  export { useQueryParams, useBwRowEdit, useBwRowSelection, useExportExcel, useImportExcel, usePersistence, useContextMenu, useDragSort, useBwKeyboard, useTableView, useBwPermission, useColumnHeaderSearch, } from './composables/index';
15
- export type { ProColumnType, ProColumnsType, ValueType, ValueEnumItem, ValueEnumMap, ActionItem, FormRule, BwProTableProps, EditConfig, ContextMenuConfig, ContextMenuItem, DragConfig, ExportConfig, ImportConfig, ViewConfig, TableState, TableStatus, PersistedColumnState, PersistedTableState, StorageAdapter, PersistenceConfig, EditCommand, FilterOperator, AdvancedFilterCondition, AdvancedFilterGroup, } from './types';
15
+ export type { ProColumnType, ProColumnsType, ValueType, ValueEnumItem, ValueEnumMap, ActionItem, FormRule, GetRowKey, TableRowSelection, ExpandableConfig, BwProTableProps, EditConfig, ContextMenuConfig, ContextMenuItem, DragConfig, ExportConfig, ImportConfig, ViewConfig, TableState, TableStatus, PersistedColumnState, PersistedTableState, StorageAdapter, PersistenceConfig, EditCommand, FilterOperator, AdvancedFilterCondition, AdvancedFilterGroup, } from './types';
16
16
  export type { RendererFn, RendererContext } from './renderers/index';
17
17
  export { DEFAULT_EMPTY_TEXT, DEFAULT_PAGE_SIZE, DEFAULT_DATE_FORMAT } from './constants';
18
18
  export { default as zhCN } from './locales/zh-CN';