z-ui-pc 1.1.21 → 1.2.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/dist/index.d.ts CHANGED
@@ -7,6 +7,8 @@ import { CascaderProps } from 'element-plus/es/components/cascader-panel/src/nod
7
7
  import { cascaderProps } from 'element-plus/es/components/cascader/src/cascader';
8
8
  import { CascaderValue } from 'element-plus';
9
9
  import { ColProps } from 'element-plus';
10
+ import { Column } from 'element-plus';
11
+ import { ColumnAlignment } from 'element-plus';
10
12
  import { Component } from 'vue';
11
13
  import { ComponentCustomProperties } from 'vue';
12
14
  import { ComponentCustomProps } from 'vue';
@@ -43,17 +45,22 @@ import { h } from 'vue';
43
45
 
44
46
 
45
47
 
48
+
46
49
  import { InputAutoSize } from 'element-plus';
47
50
  import { InputEmits } from 'element-plus';
48
51
  import { InputProps } from 'element-plus';
49
52
 
50
53
 
51
54
 
55
+
56
+
57
+
52
58
  import { JSX } from 'vue/jsx-runtime';
53
59
  import { ManipulateType } from 'dayjs';
54
60
  import { MessageBoxData } from 'element-plus';
55
61
  import { MessageOptions } from 'element-plus';
56
62
  import { nextTick } from 'vue';
63
+ import { Omit as Omit_2 } from 'lodash';
57
64
  import { OnCleanup } from '@vue/reactivity';
58
65
  import { PaginationProps } from 'element-plus';
59
66
  import { Plugin as Plugin_2 } from 'vue';
@@ -69,14 +76,19 @@ import { ShallowUnwrapRef } from 'vue';
69
76
  import { Slot } from 'vue';
70
77
  import { StyleValue } from 'vue';
71
78
  import { SwitchProps } from 'element-plus';
72
- import { TableColumnCtx } from 'element-plus/es/components/table/src/table-column/defaults';
79
+
80
+ import { TableColumnCtx } from 'element-plus';
81
+ import { TableColumnCtx as TableColumnCtx_2 } from 'element-plus/es/components/table/src/table-column/defaults';
73
82
  import { TableProps } from 'element-plus';
83
+ import { TableV2PropsPublic } from 'element-plus';
84
+
74
85
 
75
86
  import { VNode } from 'vue';
76
87
  import { VNodeProps } from 'vue';
77
88
  import { WatchOptions } from 'vue';
78
89
  import { WatchStopHandle } from 'vue';
79
90
 
91
+
80
92
  export declare function $alert(content: string, options?: ElMessageBoxOptions): Promise<MessageBoxData>;
81
93
 
82
94
  export declare function $confirm(content: string, options?: ElMessageBoxOptions): Promise<boolean | undefined>;
@@ -148,28 +160,22 @@ showArrow: EpPropMergeType<BooleanConstructor, unknown, unknown>;
148
160
  on: TEvent;
149
161
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
150
162
 
151
- declare type __VLS_Props = {
152
- src: string | TAny;
153
- alt?: string;
154
- tips?: string;
155
- };
156
-
157
- declare type __VLS_Props_2 = IBaseDateProps;
163
+ declare type __VLS_Props = IBaseDateProps;
158
164
 
159
- declare type __VLS_Props_3 = IBaseDateRangeAndSelectGroupProps;
165
+ declare type __VLS_Props_2 = IBaseDateRangeAndSelectGroupProps;
160
166
 
161
- declare type __VLS_Props_4 = IGroupSelectInputAttrs & {
167
+ declare type __VLS_Props_3 = IGroupSelectInputAttrs & {
162
168
  on?: TEvent & Partial<InputEmits>;
163
169
  modelValue: [string?, string?];
164
170
  };
165
171
 
166
172
  declare type __VLS_PublicProps = {
167
173
  "dynamicExpression"?: TUndefinable<IDynamicExpression>;
168
- } & __VLS_Props_2;
174
+ } & __VLS_Props;
169
175
 
170
176
  declare type __VLS_PublicProps_2 = {
171
177
  "dynamicExpression"?: TUndefinable<IDynamicExpression>;
172
- } & __VLS_Props_3;
178
+ } & __VLS_Props_2;
173
179
 
174
180
  declare function __VLS_template(): {
175
181
  attrs: Partial<{}>;
@@ -263,13 +269,15 @@ declare namespace allComponents {
263
269
  installer_5 as ZEmpty,
264
270
  installer_6 as ZForm,
265
271
  installer_7 as ZHorizontalStep,
266
- installer_8 as ZPlusBold,
267
- installer_9 as ZShowToTags,
268
- installer_10 as ZTable,
269
- installer_11 as ZTableLinkButton,
270
- installer_12 as ZTipsFormItem,
271
- installer_13 as ZTransitionFadeHeight,
272
- installer_14 as ZTransitionFadeSlide
272
+ installer_8 as ZOperationIconButton,
273
+ installer_9 as ZPlusBold,
274
+ installer_10 as ZShowToTags,
275
+ installer_11 as ZTable,
276
+ installer_12 as ZTableLinkButton,
277
+ installer_13 as ZTableV2,
278
+ installer_14 as ZTipsFormItem,
279
+ installer_15 as ZTransitionFadeHeight,
280
+ installer_16 as ZTransitionFadeSlide
273
281
  }
274
282
  }
275
283
 
@@ -2177,11 +2185,11 @@ export declare const getEmojiRegex: () => RegExp;
2177
2185
  */
2178
2186
  export declare const getRecentDateRange: (days: number, format?: string, type?: ManipulateType) => string[];
2179
2187
 
2180
- export declare const GroupSelectInput: DefineComponent<__VLS_Props_4, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
2188
+ export declare const GroupSelectInput: DefineComponent<__VLS_Props_3, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
2181
2189
  "update:modelValue": (args_0: string[]) => any;
2182
2190
  change: (args_0: [(string | undefined)?, (string | undefined)?]) => any;
2183
2191
  suffixClick: (args_0: string) => any;
2184
- }, string, PublicProps, Readonly<__VLS_Props_4> & Readonly<{
2192
+ }, string, PublicProps, Readonly<__VLS_Props_3> & Readonly<{
2185
2193
  "onUpdate:modelValue"?: ((args_0: string[]) => any) | undefined;
2186
2194
  onChange?: ((args_0: [(string | undefined)?, (string | undefined)?]) => any) | undefined;
2187
2195
  onSuffixClick?: ((args_0: string) => any) | undefined;
@@ -2438,7 +2446,7 @@ declare interface IBaseSearchInputProps extends Partial<InputProps> {
2438
2446
  on?: TEvent & Partial<InputEmits>;
2439
2447
  }
2440
2448
 
2441
- export declare interface IBaseTableColumn<T extends TObj = TObj> extends Partial<Omit<TableColumnCtx<T>, "prop" | "renderHeader" | "type" | "fixed">> {
2449
+ export declare interface IBaseTableColumn<T extends TObj = TObj> extends Partial<Omit<TableColumnCtx_2<T>, "prop" | "renderHeader" | "type" | "fixed">> {
2442
2450
  type?: "default" | "selection" | "index" | "expand" | string;
2443
2451
  _render?: (_: typeof h, params: T & {
2444
2452
  $index: number;
@@ -2716,6 +2724,7 @@ declare interface IConfigColumnsItem {
2716
2724
 
2717
2725
  export declare interface ICreateFormBuilderConfig extends IBaseFormProps {
2718
2726
  baseTableRef?: Readonly<ShallowRef<TNullable<IBaseTableInstance>>> | Ref<IBaseTableInstance>;
2727
+ tableBuilder?: TableBuilder<TAny>;
2719
2728
  }
2720
2729
 
2721
2730
  export declare interface ICreateFormBuilderReturn<T extends TObj> {
@@ -2785,6 +2794,115 @@ export declare interface IEllipsisTooltipConfig {
2785
2794
  maxHeight?: string;
2786
2795
  }
2787
2796
 
2797
+ /**
2798
+ * el table 的实例
2799
+ * 如果直接使用 typeof ElTable 会导致打包类型报错
2800
+ */
2801
+ export declare interface IElTableInstance {
2802
+ /**
2803
+ * 用于多选表格,清空用户的选择
2804
+ */
2805
+ clearSelection(): void;
2806
+ /**
2807
+ * 返回当前选中的行
2808
+ */
2809
+ getSelectionRows(): TAny_2[];
2810
+ /**
2811
+ * 用于多选表格,切换某一行的选中状态, 如果使用了第二个参数,则可直接设置这一行选中与否
2812
+ * @param row 要切换选中状态的行
2813
+ * @param selected 是否选中,如果设置则直接设置选中状态
2814
+ * @param ignoreSelectable 是否忽略选中状态
2815
+ */
2816
+ toggleRowSelection(row: TAny_2, selected?: boolean, ignoreSelectable?: boolean): void;
2817
+ /**
2818
+ * 用于多选表格,切换全选和全不选
2819
+ */
2820
+ toggleAllSelection(): void;
2821
+ /**
2822
+ * 用于可扩展的表格或树表格,如果某行被扩展,则切换。 使用第二个参数,您可以直接设置该行应该被扩展或折叠。
2823
+ * @param row 要切换展开状态的行
2824
+ * @param expanded 是否展开,如果设置则直接设置展开状态
2825
+ */
2826
+ toggleRowExpansion(row: TAny_2, expanded?: boolean): void;
2827
+ /**
2828
+ * 用于单选表格,设定某一行为选中行, 如果调用时不加参数,则会取消目前高亮行的选中状态。
2829
+ * @param row 要选中的行,如果不传参数则取消当前选中的行
2830
+ */
2831
+ setCurrentRow(row?: TAny_2): void;
2832
+ /**
2833
+ * 清空排序条件,数据会恢复成未排序的状态
2834
+ */
2835
+ clearSort(): void;
2836
+ /**
2837
+ * 传入由columnKey 组成的数组以清除指定列的过滤条件。 如果没有参数,清除所有过滤器
2838
+ * @param columnKeys 由columnKey组成的数组,用于清除指定列的过滤条件。如果不传,则清除所有过滤器
2839
+ */
2840
+ clearFilter(columnKeys?: string[]): void;
2841
+ /**
2842
+ * 对 Table 进行重新布局。 当表格可见性变化时,您可能需要调用此方法以获得正确的布局
2843
+ */
2844
+ doLayout(): void;
2845
+ /**
2846
+ * 手动排序表格。 参数 prop 属性指定排序列,order 指定排序顺序。
2847
+ * @param prop 排序列的 prop
2848
+ * @param order 排序顺序,'ascending' 或 'descending'
2849
+ */
2850
+ sort(prop: string, order: "ascending" | "descending"): void;
2851
+ /**
2852
+ * 滚动到一组特定坐标
2853
+ * @param options 滚动选项
2854
+ * @param yCord 垂直坐标
2855
+ */
2856
+ scrollTo(options: number | ScrollToOptions, yCord?: number): void;
2857
+ /**
2858
+ * 设置垂直滚动位置
2859
+ * @param top 垂直滚动位置
2860
+ */
2861
+ setScrollTop(top: number): void;
2862
+ /**
2863
+ * 设置水平滚动位置
2864
+ * @param left 水平滚动位置
2865
+ */
2866
+ setScrollLeft(left?: number): void;
2867
+ /**
2868
+ * 使用给定的滚动策略滚动至指定行
2869
+ * @description el-table-v2 专属
2870
+ * @param row
2871
+ * @param strategy
2872
+ */
2873
+ scrollToRow(row: number, strategy?: "center" | "end" | "start" | "smart"): void;
2874
+ /**
2875
+ * 获取表列的 context
2876
+ */
2877
+ columns: TAny_2[];
2878
+ /**
2879
+ * 适用于 lazy Table, 需要设置 rowKey, 更新 key children
2880
+ * @param key 行的 key
2881
+ * @param data 子节点数据
2882
+ */
2883
+ updateKeyChildren(key: string, data: TAny_2[]): void;
2884
+ /**
2885
+ * 组件根 DOM 元素
2886
+ */
2887
+ $el: HTMLElement;
2888
+ /**
2889
+ * 组件属性
2890
+ */
2891
+ $props: Record<string, TAny_2>;
2892
+ /**
2893
+ * 组件插槽
2894
+ */
2895
+ $slots: Record<string, TAny_2>;
2896
+ /**
2897
+ * 组件属性 (包含未声明的属性)
2898
+ */
2899
+ $attrs: Record<string, TAny_2>;
2900
+ /**
2901
+ * 组件发射的事件
2902
+ */
2903
+ $emit: (event: string, ...args: TAny_2[]) => void;
2904
+ }
2905
+
2788
2906
  /**
2789
2907
  * 分组的列的数据
2790
2908
  */
@@ -2881,15 +2999,19 @@ declare const installer: {
2881
2999
  };
2882
3000
  export default installer;
2883
3001
 
2884
- declare const installer_10 = withInstallComponent(ZTable, "ZTable");
3002
+ declare const installer_10 = withInstallComponent(ZShowToTags, "ZShowToTags");
3003
+
3004
+ declare const installer_11 = withInstallComponent(ZTable, "ZTable");
3005
+
3006
+ declare const installer_12 = withInstallComponent(ZTableLinkButton, "ZTableLinkButton");
2885
3007
 
2886
- declare const installer_11 = withInstallComponent(ZTableLinkButton, "ZTableLinkButton");
3008
+ declare const installer_13 = withInstallComponent(ZTableV2, "ZTableV2");
2887
3009
 
2888
- declare const installer_12 = withInstallComponent(ZTipsFormItem, "ZTipsFormItem");
3010
+ declare const installer_14 = withInstallComponent(ZTipsFormItem, "ZTipsFormItem");
2889
3011
 
2890
- declare const installer_13 = withInstallComponent(ZTransitionFadeHeight, "ZTransitionFadeHeight");
3012
+ declare const installer_15 = withInstallComponent(ZTransitionFadeHeight, "ZTransitionFadeHeight");
2891
3013
 
2892
- declare const installer_14 = withInstallComponent(ZTransitionFadeSlide, "ZTransitionFadeSlide");
3014
+ declare const installer_16 = withInstallComponent(ZTransitionFadeSlide, "ZTransitionFadeSlide");
2893
3015
 
2894
3016
  declare const installer_2 = withInstallComponent(ZAutoTooltip, "ZAutoTooltip");
2895
3017
 
@@ -2903,9 +3025,9 @@ declare const installer_6 = withInstallComponent(ZForm, "ZForm");
2903
3025
 
2904
3026
  declare const installer_7 = withInstallComponent(ZHorizontalStep, "ZHorizontalStep");
2905
3027
 
2906
- declare const installer_8 = withInstallComponent(ZPlusBold, "ZPlusBold");
3028
+ declare const installer_8 = withInstallComponent(ZOperationIconButton, "ZOperationIconButton");
2907
3029
 
2908
- declare const installer_9 = withInstallComponent(ZShowToTags, "ZShowToTags");
3030
+ declare const installer_9 = withInstallComponent(ZPlusBold, "ZPlusBold");
2909
3031
 
2910
3032
  export declare interface IOpenDialogOptions {
2911
3033
  /**
@@ -2936,6 +3058,30 @@ declare interface IProps_2 extends TBaseSelectAttrs, Partial<Omit<SelectProps, "
2936
3058
  on?: TEvent;
2937
3059
  }
2938
3060
 
3061
+ /**
3062
+ * tableColumn 中 用于通过 options 渲染列的结构
3063
+ */
3064
+ export declare interface IRenderToOptionType {
3065
+ /**
3066
+ * 展示的文本
3067
+ */
3068
+ label?: string;
3069
+ /**
3070
+ * 值
3071
+ */
3072
+ value?: TAllType;
3073
+ /**
3074
+ * 字体颜色
3075
+ * @description 会自动把字体颜色变化
3076
+ */
3077
+ _color?: string;
3078
+ /**
3079
+ * 状态颜色
3080
+ * @description 会给内容添加状态标识
3081
+ */
3082
+ _status?: string;
3083
+ }
3084
+
2939
3085
  /**
2940
3086
  * 判断当前时间是否大于现在
2941
3087
  * @param time
@@ -2984,6 +3130,41 @@ export declare interface IStyle {
2984
3130
  className?: string;
2985
3131
  }
2986
3132
 
3133
+ declare interface ITableCustomColumnGroup {
3134
+ /**
3135
+ * column
3136
+ * @description 只保存勾选的 column
3137
+ */
3138
+ columns: ITableCustomColumnGroupColumn[];
3139
+ /**
3140
+ * 分组名称
3141
+ */
3142
+ groupName: string;
3143
+ }
3144
+
3145
+ declare interface ITableCustomColumnGroupColumn {
3146
+ /**
3147
+ * 是否勾选
3148
+ */
3149
+ checked: boolean;
3150
+ /**
3151
+ * prop 定义
3152
+ */
3153
+ prop: string;
3154
+ /**
3155
+ * 索引
3156
+ */
3157
+ index?: number;
3158
+ /**
3159
+ * 是否固定,目前固定为 left
3160
+ */
3161
+ fixed?: TZTableV2ColumnFixed;
3162
+ /**
3163
+ * 是否只读
3164
+ */
3165
+ readonly?: boolean;
3166
+ }
3167
+
2987
3168
  export declare interface ITableSortData {
2988
3169
  oldIndex: number;
2989
3170
  newIndex: number;
@@ -3005,12 +3186,30 @@ export declare interface IUiConfig {
3005
3186
  */
3006
3187
  config: string;
3007
3188
  }, formBuilder?: FormBuilder<T>) => void | Promise<void>;
3189
+ /**
3190
+ * 表格配置
3191
+ */
3192
+ zTableV2SharedConfig?: IZTableV2Config<TObj>;
3193
+ /**
3194
+ * 空数据渲染
3195
+ */
3196
+ zTableV2DefaultSlotRender?: {
3197
+ empty?: TRenderFunction;
3198
+ };
3199
+ }
3200
+
3201
+ declare interface IUseCreateTableBuilderReturn<T extends TObj> {
3202
+ tableBuilder: TableBuilder<T>;
3203
+ registerEvent: (eventName: ZTableV2EventKeys, callback: TFunction) => void;
3204
+ refresh: (resetPagination?: boolean) => void;
3008
3205
  }
3009
3206
 
3010
- export declare interface IUseTableStickyOptions {
3207
+ export declare interface IUseTableStickyOptions<T extends {
3208
+ $el: HTMLElement;
3209
+ }> {
3011
3210
  stickyTriggerSelector?: ISelector;
3012
3211
  baseTableOperationElement: Ref<TUndefinable<HTMLElement>>;
3013
- baseTableRef: Ref<TUndefinable<IBaseTableRef>>;
3212
+ baseTableRef: Ref<TUndefinable<T>>;
3014
3213
  }
3015
3214
 
3016
3215
  export declare interface IViewConfig {
@@ -3036,163 +3235,724 @@ export declare interface IViewConfigResult {
3036
3235
  config: string;
3037
3236
  }
3038
3237
 
3039
- /**
3040
- * long 最大值
3041
- */
3042
- export declare const LONG_MAX_VALUE: bigint;
3043
-
3044
- /**
3045
- * 金额的最大值。数字框的默认最大值也是这个。
3046
- */
3047
- export declare const MAX_MONEY = 99999999;
3048
-
3049
- declare type PropsOf<T> = T extends Component<infer P> ? P : never;
3050
-
3051
- declare type PropsOf_2<T> = T extends Component<infer P> ? P : never;
3052
-
3053
- /**
3054
- * 特殊的列配置
3055
- */
3056
- export declare const specialColumnMap: Record<"index" | "selection" | string, IBaseTableColumn>;
3057
-
3058
- export declare const STICKY_CONTAINER_CLASS = "__base-table-sticky-container";
3059
-
3060
- /**
3061
- * 将一个对象的所有数字转换为字符串
3062
- */
3063
- export declare const stringifyNumberObject: <T extends TObj>(obj: T, format?: (value: number) => string) => { [key in keyof T]: string; };
3064
-
3065
- /**
3066
- * 表格开启拖拽的class
3067
- */
3068
- export declare const TABLE_DRAGGABLE_CLASS = "base-table__column__is-draggable";
3069
-
3070
- /**
3071
- * 表格默认的空值的dom
3072
- */
3073
- export declare const TABLE_EMPTY_NODE: JSX;
3074
-
3075
- /**
3076
- * 表格默认的空值
3077
- */
3078
- export declare const TABLE_EMPTY_VALUE = "-";
3079
-
3080
- /**
3081
- * 表头的默认style
3082
- */
3083
- export declare const TABLE_HEADER_CELL_STYLE: {
3084
- background: string;
3085
- color: string;
3086
- };
3087
-
3088
- export declare interface TBaseCascaderAttrs {
3089
- options?: TOptionsReturn;
3238
+ export declare interface IZTableV2Column<T extends TObj = TObj> extends Partial<Omit<TableColumnCtx<T>, "prop" | "renderHeader" | "type" | "fixed" | "align">>, Partial<Omit<Column<T>, "align">> {
3239
+ type?: "default" | "selection" | "index" | "expand" | string;
3090
3240
  /**
3091
- * 设置 cascader 的宽度
3241
+ * element-plus align
3092
3242
  */
3093
- width?: string;
3094
- }
3095
-
3096
- export declare interface TBaseDateAttrs {
3243
+ align?: ColumnAlignment;
3244
+ contentRender?: (_: typeof h, params: T & {
3245
+ $index: number;
3246
+ $tableData: T[];
3247
+ }, data: T) => TRenderReturnType;
3097
3248
  /**
3098
- * 是否自动加上秒
3249
+ * @deprecated 该属性已经废弃。为了API统一性后续使用 contentRender
3099
3250
  */
3100
- autoAddSeconds?: boolean;
3251
+ _render?: (_: typeof h, params: T & {
3252
+ $index: number;
3253
+ $tableData: T[];
3254
+ }, data: T) => TRenderReturnType;
3101
3255
  /**
3102
- * 是否使用一天的开始/结束时间(时/分/秒)作为默认值
3256
+ * 根据 options 渲染对应的数据
3257
+ * _color: 会自动把字体颜色变化
3258
+ * _status:会加上状态颜色
3103
3259
  */
3104
- useDefaultTimeToDay?: boolean;
3105
- }
3106
-
3107
- export declare interface TBaseDateRangeAndSelectGroupAttrs {
3260
+ renderToOptions?: IRenderToOptionType[];
3261
+ headerRender?: (_: typeof h, headerColumn: TAllType, $index: number, column: IZTableV2Column<T>) => TRenderReturnType;
3108
3262
  /**
3109
- * select options
3263
+ * @deprecated 该属性已经废弃。为了API统一性后续使用 headerRender
3110
3264
  */
3111
- options: TOptionsReturn<IGroupSelectOptions>;
3265
+ renderHeader?: (_: typeof h, headerColumn: TAllType, $index: number, column: IZTableV2Column<T>) => TRenderReturnType;
3266
+ hidden?: boolean | ((params: IZTableV2Column<T>) => boolean);
3267
+ prop?: keyof T | string;
3268
+ emptyValue?: TAllType;
3269
+ onClick?: (params: T) => void;
3270
+ emptyClick?: boolean;
3112
3271
  /**
3113
- * select options
3272
+ * fixed
3114
3273
  */
3115
- selectWidth?: string;
3274
+ fixed?: TZTableV2ColumnFixed;
3116
3275
  /**
3117
- * 废弃属性,请使用 selectAttrs
3118
- * @deprecated
3276
+ * 是否在列为空的时候也渲染内容(只有在有contentRender)方法的情况下生效
3277
+ * @default false
3278
+ * @description
3279
+ * emptyIsRender: true
3280
+ * // 假如表格的数据为 [{}] 是一个空对象数组,默认情况下为了避免不必要的执行是不会执行 contentRender 方法的
3281
+ * // 但是如果设置了 emptyIsRender 就会执行
3119
3282
  */
3120
- selectOptions?: Partial<SelectProps>;
3283
+ emptyIsRender?: boolean;
3121
3284
  /**
3122
- * select 的属性
3285
+ * 导出的列的 key ,默认是 prop 的值,在一些特殊的场景下,导出的字段不是 prop 的时候可以通过这个字段设置。
3286
+ * @description 比如说后端返回的字段是 id 但是需要导出的是名称
3123
3287
  */
3124
- selectAttrs?: Partial<SelectProps>;
3288
+ exportProp?: keyof T | string | (keyof T | string)[];
3125
3289
  /**
3126
- * 是否在时间为空的情况下禁用 select
3127
- * @default true
3290
+ * 是否在列为空的时候也渲染内容(只有在有 contentRender)方法的情况下生效
3291
+ * @default false
3128
3292
  */
3129
- disabledSelectByEmptyData?: boolean;
3293
+ renderToEmpty?: boolean;
3130
3294
  /**
3131
- * 是否把select放到前面
3132
- * @default false
3295
+ * 是否开启拖拽
3133
3296
  */
3134
- selectToFirst?: boolean;
3297
+ draggable?: boolean;
3135
3298
  /**
3136
- * 是否默认选中第一个下拉数据
3137
- * @default: false
3299
+ * 是否不可删除不可修改位置
3138
3300
  */
3139
- defaultSelectFirst?: boolean;
3301
+ readonly?: boolean;
3140
3302
  /**
3141
- * 当日期清空的时候是否需要清空下拉框
3142
- * @default false
3303
+ * 是否默认选中
3304
+ * @default true
3143
3305
  */
3144
- whenEmptyDateClearSelect?: boolean;
3145
- }
3146
-
3147
- export declare interface TBaseNumberInputAttrs {
3148
- precision?: number;
3306
+ defaultChecked?: boolean;
3149
3307
  /**
3150
- * 最大值
3308
+ * 分类名称,直接使用分类名称进行区分是否为同一个分类,如果未设置分类名称,则默认为默认分类 `列信息` 分类
3151
3309
  */
3152
- max?: number;
3310
+ classifyName?: string;
3153
3311
  /**
3154
- * 最小值
3312
+ * @deprecated 该属性已经废弃。为了API统一性后续使用 classifyName
3155
3313
  */
3156
- min?: number;
3314
+ groupName?: string;
3157
3315
  }
3158
3316
 
3159
- export declare interface TBaseSelectAttrs {
3317
+ export declare interface IZTableV2Config<T extends TObj> extends TZTableV2SharedConfigProps<T> {
3160
3318
  /**
3161
- * select 的 options
3319
+ * 表格列配置
3162
3320
  */
3163
- options?: TOptionsReturn<{
3164
- _render?: (_: typeof h, data: TObj) => TAllType | VNode | HTMLElement | JSX.Element;
3165
- }>;
3321
+ columns?: IZTableV2Column<T>[];
3166
3322
  /**
3167
- * 设置 select 的宽度
3323
+ * 表格数据
3324
+ * @description 如果 loadMethod 存在会优先通过 loadMethods 方法加载数据
3168
3325
  */
3169
- width?: string;
3170
- }
3171
-
3172
- export declare type TBaseTableRequestResult = IBaseTableLoadResult | Promise<IBaseTableLoadResult>;
3173
-
3174
- declare type TCascaderProps = ExtractPropTypes<typeof cascaderProps>;
3175
-
3176
- export declare type TCreateBaseFormItemParams<T extends keyof IComponentProps, U extends TObj> = Omit<IBaseFormItem<U>, "tag" | "attrs" | "componentProps"> & {
3177
- tag: T;
3326
+ tableData?: T[];
3178
3327
  /**
3179
- * @see { src/components/base-form/core/typing/attrs.ts } 用于传递给组件的属性
3180
- */
3181
- attrs?: Partial<IAttrs[T]>;
3182
- /**
3183
- * @see { src/components/base-form/core/typing/componentProps.ts } 用于定义element-plus组件的属性
3184
- */
3185
- componentProps?: Partial<IComponentProps[T]>;
3186
- };
3187
-
3188
- declare type TCreateCustomFormItemParams<T extends Component, U extends TObj = TObj> = Omit<IBaseFormItem<U>, "tag" | "attrs" | "componentProps"> & {
3189
- tag: T;
3190
- attrs?: Partial<ExtractPropTypes<PropsOf<T>>>;
3191
- componentProps?: Partial<ExtractPropTypes<PropsOf<T>>>;
3192
- };
3193
-
3194
- export declare type TCreateCustomFormItemParamsByDefinition<T extends TKeyofCustomFormComponentType, U extends TObj = TObj> = Omit<IBaseFormItem<U>, "tag" | "attrs" | "componentProps"> & {
3195
- tag: T;
3328
+ * 用于加载数据
3329
+ */
3330
+ loadMethod?: (params: Omit<IZTableV2Pagination, "total">) => IZTableV2LoadResult | Promise<TUndefinable<IZTableV2LoadResult>>;
3331
+ /**
3332
+ * 是否默认加载数据
3333
+ * @default true
3334
+ */
3335
+ autoLoad?: boolean;
3336
+ /**
3337
+ * 是否需要默认操作按钮(刷新)
3338
+ * @default true
3339
+ */
3340
+ hasDefaultOperation?: boolean;
3341
+ /**
3342
+ * 操作列按钮
3343
+ * @description 为保证API的统一性 configColumns 已废弃,请替换为 customColumn
3344
+ */
3345
+ operationBtnList?: TArrayAble<"refresh" | "download" | "resetColumnsWidth" | "configColumns" | "customColumn">;
3346
+ /**
3347
+ * 是否需要分页
3348
+ * @default true
3349
+ */
3350
+ hasPagination?: boolean;
3351
+ /**
3352
+ * 分页参数
3353
+ */
3354
+ paginationProps?: Omit<Partial<PaginationProps>, "size">;
3355
+ /**
3356
+ * 分页是否固定
3357
+ * @description true: 固定在左边
3358
+ * @description "left": 固定在左边
3359
+ * @description "right": 固定在右边
3360
+ * @description "false": 不固定,默认在左边
3361
+ * @default true
3362
+ */
3363
+ fixedPagination?: TZTableV2ColumnFixed;
3364
+ /**
3365
+ * 自定义列的配置
3366
+ */
3367
+ customColumnConfig?: IZTableV2CustomColumnConfig;
3368
+ /**
3369
+ * 自定义列的配置
3370
+ * @deprecated 为了API的统一性,请使用 customColumnConfig
3371
+ */
3372
+ columnConfig?: IZTableV2CustomColumnConfig;
3373
+ /**
3374
+ * 设置sticky的触发元素,如果没有。则默认会拿 Z_TABLE_V2_STICKY_CONTAINER_CLASS 的值
3375
+ */
3376
+ stickyTriggerSelector?: TZTableV2StickyTriggerSelector;
3377
+ /**
3378
+ * 是否需要表头固定
3379
+ * @default true
3380
+ */
3381
+ stickyHeader?: boolean;
3382
+ /**
3383
+ * 是否需要隐藏操作栏
3384
+ * @default false
3385
+ */
3386
+ hideTableWorkHeader?: boolean;
3387
+ /**
3388
+ * 表单的实例,如果需要表单加载完成事件(loaded)则需要传递
3389
+ * @description 使用 any 兼容各类型的 formBuilder
3390
+ */
3391
+ formBuilder?: FormBuilder<TAny_2>;
3392
+ /**
3393
+ * 表格列 draggable 的配置
3394
+ */
3395
+ draggableAttrs?: {
3396
+ /**
3397
+ * 表格唯一id,如果不设置会自动取表格设置的 row-key,最后是 id
3398
+ * @default id
3399
+ */
3400
+ idKey?: string;
3401
+ /**
3402
+ * 列拖拽的动画时间
3403
+ * @default 150
3404
+ */
3405
+ animation?: number;
3406
+ };
3407
+ /**
3408
+ * 是否开启列搜索
3409
+ * @description 如果开启了列搜索,可以通过 ctrl/cmd+shift+f 进行列搜索
3410
+ * @default false
3411
+ */
3412
+ enableColumnSearch?: boolean;
3413
+ /**
3414
+ * 是否在选中的时候展示选中的数量
3415
+ * @default true
3416
+ */
3417
+ showSelectCount?: boolean;
3418
+ /**
3419
+ * 是否开启虚拟滚动
3420
+ * @default false
3421
+ */
3422
+ enableVirtualScroll?: boolean;
3423
+ /**
3424
+ * 默认列的分组名称
3425
+ */
3426
+ defaultClassifyName?: string;
3427
+ }
3428
+
3429
+ /**
3430
+ * 列配置信息
3431
+ */
3432
+ export declare interface IZTableV2CustomColumnConfig {
3433
+ /**
3434
+ * 表格唯一code
3435
+ * @description 建议使用路由的path
3436
+ */
3437
+ pageId: string;
3438
+ /**
3439
+ * 当前页面名称
3440
+ * @description 会展示在设置自定义列的时候的名称上
3441
+ * @example
3442
+ * 设置会将应用于${pageName}列表
3443
+ */
3444
+ pageName?: string;
3445
+ /**
3446
+ * 系统分组名称
3447
+ * @description 一般不用设置,都统一名称:默认分组
3448
+ * @default '默认分组'
3449
+ */
3450
+ systemGroupName?: string;
3451
+ }
3452
+
3453
+ /**
3454
+ * 自定义列保存的数据格式
3455
+ */
3456
+ export declare interface IZTableV2CustomSaveData {
3457
+ useGroup: string;
3458
+ groups: ITableCustomColumnGroup[];
3459
+ }
3460
+
3461
+ /**
3462
+ * 表格加载的数据结构
3463
+ */
3464
+ export declare interface IZTableV2LoadResult {
3465
+ /**
3466
+ * 表格数据
3467
+ */
3468
+ data?: TObj[];
3469
+ /**
3470
+ * 表格数据
3471
+ */
3472
+ records?: TObj[];
3473
+ /**
3474
+ * 总条数
3475
+ */
3476
+ total?: number;
3477
+ /**
3478
+ * 总页数
3479
+ */
3480
+ count?: string;
3481
+ }
3482
+
3483
+ /**
3484
+ * 分页
3485
+ */
3486
+ export declare interface IZTableV2Pagination {
3487
+ current: number;
3488
+ size: number;
3489
+ total?: number;
3490
+ }
3491
+
3492
+ /**
3493
+ * long 最大值
3494
+ */
3495
+ export declare const LONG_MAX_VALUE: bigint;
3496
+
3497
+ /**
3498
+ * 金额的最大值。数字框的默认最大值也是这个。
3499
+ */
3500
+ export declare const MAX_MONEY = 99999999;
3501
+
3502
+ declare type PropsOf<T> = T extends Component<infer P> ? P : never;
3503
+
3504
+ declare type PropsOf_2<T> = T extends Component<infer P> ? P : never;
3505
+
3506
+ /**
3507
+ * 特殊的列配置
3508
+ */
3509
+ export declare const specialColumnMap: Record<"index" | "selection" | string, IBaseTableColumn>;
3510
+
3511
+ export declare const STICKY_CONTAINER_CLASS = "__base-table-sticky-container";
3512
+
3513
+ /**
3514
+ * 将一个对象的所有数字转换为字符串
3515
+ */
3516
+ export declare const stringifyNumberObject: <T extends TObj>(obj: T, format?: (value: number) => string) => { [key in keyof T]: string; };
3517
+
3518
+ /**
3519
+ * 表格开启拖拽的class
3520
+ */
3521
+ export declare const TABLE_DRAGGABLE_CLASS = "base-table__column__is-draggable";
3522
+
3523
+ /**
3524
+ * 表格默认的空值的dom
3525
+ */
3526
+ export declare const TABLE_EMPTY_NODE: JSX;
3527
+
3528
+ /**
3529
+ * 表格默认的空值
3530
+ */
3531
+ export declare const TABLE_EMPTY_VALUE = "-";
3532
+
3533
+ /**
3534
+ * 表头的默认style
3535
+ */
3536
+ export declare const TABLE_HEADER_CELL_STYLE: {
3537
+ background: string;
3538
+ color: string;
3539
+ };
3540
+
3541
+ declare class TableBuilder<T extends TObj = TObj> {
3542
+ /**
3543
+ * 表格事件管理
3544
+ * @private
3545
+ */
3546
+ private tableEventManager;
3547
+ /**
3548
+ * 表格事件列表
3549
+ */
3550
+ get events(): TObj<string, ITableEventStack[]>;
3551
+ /**
3552
+ * 表格列管理
3553
+ * @private
3554
+ */
3555
+ tableColumnManager: TableColumnManager<T>;
3556
+ /**
3557
+ * 显示的列
3558
+ */
3559
+ get showColumns(): ZTableV2Column<T>[];
3560
+ /**
3561
+ * 所有列
3562
+ */
3563
+ get columns(): ZTableV2Column<T>[];
3564
+ /**
3565
+ * 是否开启列拖拽
3566
+ */
3567
+ get starDraggable(): boolean;
3568
+ /**
3569
+ * 当前激活的自定义分组
3570
+ */
3571
+ get activeGroup(): string;
3572
+ /**
3573
+ * 表格配置管理
3574
+ * @private
3575
+ */
3576
+ private tableConfigManager;
3577
+ /**
3578
+ * 获取整个 zTableV2 的配置
3579
+ */
3580
+ get config(): IZTableV2Config<T>;
3581
+ get pageId(): string | undefined;
3582
+ /**
3583
+ * 获取 el-table 的属性
3584
+ */
3585
+ get elTableAttrs(): Omit_2<IZTableV2Config<T>, "height" | "width" | "columns" | "tableData" | "loadMethod" | "autoLoad" | "hasDefaultOperation" | "operationBtnList" | "hasPagination" | "paginationProps" | "fixedPagination" | "customColumnConfig" | "columnConfig" | "stickyTriggerSelector" | "stickyHeader" | "hideTableWorkHeader" | "formBuilder" | "draggableAttrs" | "enableColumnSearch" | "showSelectCount" | "defaultClassifyName">;
3586
+ get elVirtualTableAttrs(): Partial<IZTableV2Config<T>>;
3587
+ /**
3588
+ * 表格数据管理
3589
+ * @private
3590
+ */
3591
+ tableDataStore: TableDataStore<T>;
3592
+ /**
3593
+ * 表格数据
3594
+ */
3595
+ get data(): T[];
3596
+ /**
3597
+ * 设置表格数据
3598
+ * @param data
3599
+ */
3600
+ set data(data: T[]);
3601
+ /**
3602
+ * 表格分页
3603
+ */
3604
+ get pagination(): IZTableV2Pagination;
3605
+ /**
3606
+ * 传递给外部的分页参数(去掉了多余的参数)
3607
+ */
3608
+ get transmitPagination(): IZTableV2Pagination;
3609
+ /**
3610
+ * 表格是否加载中
3611
+ */
3612
+ get loading(): boolean;
3613
+ /**
3614
+ * 表格选中数据
3615
+ */
3616
+ get selectList(): T[];
3617
+ private instanceManager;
3618
+ /**
3619
+ * 表格实例
3620
+ */
3621
+ get elTableInstance(): TUndefinable<IElTableInstance>;
3622
+ /**
3623
+ * 原始表格实例
3624
+ */
3625
+ get rawElTableInstance(): TUndefinable<TElTableRefInstance>;
3626
+ /**
3627
+ * 重置表格实例标识
3628
+ */
3629
+ get resetWidthKey(): number;
3630
+ /**
3631
+ * 自定义列管理
3632
+ */
3633
+ tableCustomColumnManager: TableCustomColumnManager<T>;
3634
+ /**
3635
+ * 如果不传递 columns 则默认不会初始化
3636
+ * @param columns
3637
+ * @param config
3638
+ */
3639
+ constructor(columns: IZTableV2Column<T>[], config?: IZTableV2Config<T>);
3640
+ /**
3641
+ * 初始化表格各个状态
3642
+ * @param columns
3643
+ * @param config
3644
+ */
3645
+ init(columns: IZTableV2Column<T>[], config?: IZTableV2Config<T>): Promise<void>;
3646
+ /**
3647
+ * 初始化表格实例
3648
+ * @param instance
3649
+ */
3650
+ initElTableInstance(instance: TElTableRefInstance): void;
3651
+ /**
3652
+ * 更新激活的分组
3653
+ * @param groupName
3654
+ */
3655
+ updateActiveGroup(groupName: string): void;
3656
+ /**
3657
+ * 重置表格实例
3658
+ */
3659
+ resetWidth(): void;
3660
+ /**
3661
+ * 注册事件
3662
+ * @param eventName 事件名称
3663
+ * @param callback 因为目前类型问题,这里暂时只能使用通用回调类型
3664
+ */
3665
+ registerEvent(eventName: ZTableV2EventKeys, callback: TFunction): {
3666
+ paused: () => void;
3667
+ resume: () => void;
3668
+ destroy: () => void;
3669
+ id: string;
3670
+ };
3671
+ /**
3672
+ * 触发事件 主要给内部使用,不建议外部使用
3673
+ * @param eventName
3674
+ * @param args
3675
+ */
3676
+ triggerEvent(eventName: ZTableV2EventKeys, ...args: TAny_2[]): void;
3677
+ /**
3678
+ * 获取事件
3679
+ * @param emit
3680
+ */
3681
+ getTableRegisterEvents<E extends string>(emit: (eventName: E, ...args: TAny_2[]) => void): TObj<string, TFunction>;
3682
+ /**
3683
+ * 分页器触发的事件
3684
+ */
3685
+ getPaginationEvents<E extends string>(emit: (eventName: E, ...args: TAny_2[]) => void): TObj<string, TFunction>;
3686
+ /**
3687
+ * 更新表格数据
3688
+ * @param data
3689
+ */
3690
+ updateTableData(data: T[]): void;
3691
+ /**
3692
+ * 更新选中数据
3693
+ * @param data
3694
+ */
3695
+ updateSelectList(data: T[]): void;
3696
+ /**
3697
+ * 更新分页
3698
+ * @param pagination
3699
+ */
3700
+ updatePagination(pagination: Partial<IZTableV2Pagination>): IZTableV2Pagination;
3701
+ /**
3702
+ * 刷新数据
3703
+ * @description 会重新执行 loadMethod 方法
3704
+ * @param resetPagination 是否重置分页
3705
+ */
3706
+ refresh(resetPagination?: boolean): Promise<void>;
3707
+ /**
3708
+ * destroy
3709
+ */
3710
+ destroy(): void;
3711
+ }
3712
+
3713
+ declare class TableColumnManager<T extends TObj> {
3714
+ /**
3715
+ * 列
3716
+ */
3717
+ tableColumns: ZTableV2Column<T>[];
3718
+ /**
3719
+ * 自定义的列
3720
+ */
3721
+ customColumns: ZTableV2Column<T>[];
3722
+ /**
3723
+ * 初始化列
3724
+ * @param props
3725
+ */
3726
+ init(props: IZTableV2Column<T>[]): void;
3727
+ /**
3728
+ * 初始化自定义列
3729
+ * @param columns
3730
+ */
3731
+ initCustomColumns(columns: ITableCustomColumnGroupColumn[]): void;
3732
+ }
3733
+
3734
+ declare class TableCustomColumnGroup implements ITableCustomColumnGroup {
3735
+ columns: ITableCustomColumnGroupColumn[];
3736
+ groupName: string;
3737
+ get getNextIndex(): number;
3738
+ constructor(group: ITableCustomColumnGroup);
3739
+ updateColumnChecked(prop: string, checked: boolean): void;
3740
+ }
3741
+
3742
+ declare class TableCustomColumnManager<T extends TObj> {
3743
+ groups: TableCustomColumnGroup[];
3744
+ /**
3745
+ * 当前激活的分组
3746
+ */
3747
+ useGroup: string;
3748
+ get defaultGroupName(): string;
3749
+ private tableBuilder;
3750
+ /**
3751
+ * 创建分组
3752
+ * @param groupName
3753
+ * @param position 从上面插入还是从下面插入
3754
+ */
3755
+ createGroup(groupName: string, position?: "top" | "bottom"): TableCustomColumnGroup;
3756
+ /**
3757
+ * 更新当前激活的分组
3758
+ * @param groupName
3759
+ */
3760
+ updateActiveGroup(groupName: string): void;
3761
+ private initRemoteCustomConfig;
3762
+ /**
3763
+ * 初始化数据
3764
+ * @description 兼容旧数据
3765
+ */
3766
+ init(tableBuilder: TableBuilder<T>): Promise<void>;
3767
+ setGroups(groups: ITableCustomColumnGroup[]): void;
3768
+ /**
3769
+ * 获取列默认列分类名称
3770
+ * @param column
3771
+ */
3772
+ getColumnDefaultClassifyName(column: ZTableV2Column<T>): string;
3773
+ }
3774
+
3775
+ declare class TableDataStore<T extends TObj> {
3776
+ /**
3777
+ * 表格数据
3778
+ */
3779
+ data: T[];
3780
+ /**
3781
+ * 表格选中的数据
3782
+ */
3783
+ selectList: T[];
3784
+ /**
3785
+ * 表格的 loading
3786
+ */
3787
+ loading: boolean;
3788
+ /**
3789
+ * 表格的分页参数
3790
+ */
3791
+ pagination: IZTableV2Pagination;
3792
+ get transmitPagination(): IZTableV2Pagination;
3793
+ /**
3794
+ * 如果没有设置 loadMethods,则会启动一个 effect 自动从 tableData 中获取数据。
3795
+ * @description 用来关停 effect
3796
+ * @private
3797
+ */
3798
+ private stopEffect?;
3799
+ private tableBuilder;
3800
+ /**
3801
+ * 初始化
3802
+ */
3803
+ init(tableBuilder: TableBuilder<T>): void;
3804
+ /**
3805
+ * 更新数据
3806
+ * @param data
3807
+ */
3808
+ update(data: T[]): void;
3809
+ /**
3810
+ * 更新选中数据
3811
+ * @param data
3812
+ */
3813
+ updateSelectList(data: T[]): void;
3814
+ /**
3815
+ * 更新分页
3816
+ * @param pagination
3817
+ * @private
3818
+ */
3819
+ updatePagination(pagination: Partial<IZTableV2Pagination>): IZTableV2Pagination;
3820
+ /**
3821
+ * 加载数据
3822
+ * @param pagination
3823
+ * @private
3824
+ */
3825
+ private loadData;
3826
+ /**
3827
+ * 刷新 是否重置分页
3828
+ * @param resetPagination
3829
+ */
3830
+ refresh(resetPagination?: boolean): Promise<void>;
3831
+ destroy(): void;
3832
+ }
3833
+
3834
+ /**
3835
+ * table-v2的列的属性
3836
+ * @see https://element-plus.org/zh-CN/component/table-v2#column-attribute
3837
+ */
3838
+ declare const tableV2ColumnAttrKeys: readonly ["align", "class", "key", "dataKey", "fixed", "flexGrow", "flexShrink", "title", "hidden", "headerClass", "maxWidth", "minWidth", "style", "sortable", "width", "cellRenderer", "headerCellRenderer"];
3839
+
3840
+ declare type TableV2ColumnAttrs<T extends TObj> = Pick<Column<T>, (typeof tableV2ColumnAttrKeys)[number]>;
3841
+
3842
+ /**
3843
+ * @description: any alias
3844
+ */
3845
+ declare type TAny_2 = any;
3846
+ export { TAny_2 as TAny }
3847
+
3848
+ export declare interface TBaseCascaderAttrs {
3849
+ options?: TOptionsReturn;
3850
+ /**
3851
+ * 设置 cascader 的宽度
3852
+ */
3853
+ width?: string;
3854
+ }
3855
+
3856
+ export declare interface TBaseDateAttrs {
3857
+ /**
3858
+ * 是否自动加上秒
3859
+ */
3860
+ autoAddSeconds?: boolean;
3861
+ /**
3862
+ * 是否使用一天的开始/结束时间(时/分/秒)作为默认值
3863
+ */
3864
+ useDefaultTimeToDay?: boolean;
3865
+ }
3866
+
3867
+ export declare interface TBaseDateRangeAndSelectGroupAttrs {
3868
+ /**
3869
+ * select 的 options
3870
+ */
3871
+ options: TOptionsReturn<IGroupSelectOptions>;
3872
+ /**
3873
+ * select options
3874
+ */
3875
+ selectWidth?: string;
3876
+ /**
3877
+ * 废弃属性,请使用 selectAttrs
3878
+ * @deprecated
3879
+ */
3880
+ selectOptions?: Partial<SelectProps>;
3881
+ /**
3882
+ * select 的属性
3883
+ */
3884
+ selectAttrs?: Partial<SelectProps>;
3885
+ /**
3886
+ * 是否在时间为空的情况下禁用 select
3887
+ * @default true
3888
+ */
3889
+ disabledSelectByEmptyData?: boolean;
3890
+ /**
3891
+ * 是否把select放到前面
3892
+ * @default false
3893
+ */
3894
+ selectToFirst?: boolean;
3895
+ /**
3896
+ * 是否默认选中第一个下拉数据
3897
+ * @default: false
3898
+ */
3899
+ defaultSelectFirst?: boolean;
3900
+ /**
3901
+ * 当日期清空的时候是否需要清空下拉框
3902
+ * @default false
3903
+ */
3904
+ whenEmptyDateClearSelect?: boolean;
3905
+ }
3906
+
3907
+ export declare interface TBaseNumberInputAttrs {
3908
+ precision?: number;
3909
+ /**
3910
+ * 最大值
3911
+ */
3912
+ max?: number;
3913
+ /**
3914
+ * 最小值
3915
+ */
3916
+ min?: number;
3917
+ }
3918
+
3919
+ export declare interface TBaseSelectAttrs {
3920
+ /**
3921
+ * select 的 options
3922
+ */
3923
+ options?: TOptionsReturn<{
3924
+ _render?: (_: typeof h, data: TObj) => TAllType | VNode | HTMLElement | JSX.Element;
3925
+ }>;
3926
+ /**
3927
+ * 设置 select 的宽度
3928
+ */
3929
+ width?: string;
3930
+ }
3931
+
3932
+ export declare type TBaseTableRequestResult = IBaseTableLoadResult | Promise<IBaseTableLoadResult>;
3933
+
3934
+ declare type TCascaderProps = ExtractPropTypes<typeof cascaderProps>;
3935
+
3936
+ export declare type TCreateBaseFormItemParams<T extends keyof IComponentProps, U extends TObj> = Omit<IBaseFormItem<U>, "tag" | "attrs" | "componentProps"> & {
3937
+ tag: T;
3938
+ /**
3939
+ * @see { src/components/base-form/core/typing/attrs.ts } 用于传递给组件的属性
3940
+ */
3941
+ attrs?: Partial<IAttrs[T]>;
3942
+ /**
3943
+ * @see { src/components/base-form/core/typing/componentProps.ts } 用于定义element-plus组件的属性
3944
+ */
3945
+ componentProps?: Partial<IComponentProps[T]>;
3946
+ };
3947
+
3948
+ declare type TCreateCustomFormItemParams<T extends Component, U extends TObj = TObj> = Omit<IBaseFormItem<U>, "tag" | "attrs" | "componentProps"> & {
3949
+ tag: T;
3950
+ attrs?: Partial<ExtractPropTypes<PropsOf<T>>>;
3951
+ componentProps?: Partial<ExtractPropTypes<PropsOf<T>>>;
3952
+ };
3953
+
3954
+ export declare type TCreateCustomFormItemParamsByDefinition<T extends TKeyofCustomFormComponentType, U extends TObj = TObj> = Omit<IBaseFormItem<U>, "tag" | "attrs" | "componentProps"> & {
3955
+ tag: T;
3196
3956
  /**
3197
3957
  * 如果组件定义中存在 attrs 类型,则提供该类型的 Partial 作为提示,否则回退到 TObj。
3198
3958
  */
@@ -3232,6 +3992,8 @@ export declare type TCreateBaseFormItemParams<T extends keyof IComponentProps, U
3232
3992
  _mouseleaveHandler?: (event: MouseEvent) => void;
3233
3993
  };
3234
3994
 
3995
+ export declare type TElTableRefInstance = Ref<IElTableInstance>;
3996
+
3235
3997
  export declare const TEMP_GROUP_ID = "-2";
3236
3998
 
3237
3999
  export declare type TEvent = {
@@ -3246,6 +4008,11 @@ export declare type TCreateBaseFormItemParams<T extends keyof IComponentProps, U
3246
4008
 
3247
4009
  declare type TFixed = "left" | "right";
3248
4010
 
4011
+ /**
4012
+ * @description: Function params is any
4013
+ */
4014
+ export declare type TFunction<T = TAny_2> = (...args: TAny_2[]) => T;
4015
+
3249
4016
  export declare type TKeyofCustomFormComponentType = keyof ICustomFormComponentType;
3250
4017
 
3251
4018
  declare type TModelValue = [string?, string?, TAllType?];
@@ -3264,6 +4031,16 @@ export declare type TCreateBaseFormItemParams<T extends keyof IComponentProps, U
3264
4031
 
3265
4032
  export declare type TOptionsReturn<T extends TObj = TObj> = TOptions<T> | (() => TOptions<T> | Promise<TOptions<T>>);
3266
4033
 
4034
+ /**
4035
+ * 通用的渲染函数
4036
+ */
4037
+ declare type TRenderFunction = (_: typeof h) => TRenderReturnType;
4038
+
4039
+ /**
4040
+ * 通用的渲染返回类型
4041
+ */
4042
+ declare type TRenderReturnType = TAllType | TAllType<JSX.Element | VNode | HTMLElement>;
4043
+
3267
4044
  /**
3268
4045
  * 派发一个 input 事件
3269
4046
  * @param inputElement
@@ -3282,8 +4059,18 @@ export declare type TCreateBaseFormItemParams<T extends keyof IComponentProps, U
3282
4059
 
3283
4060
  export declare type TZTableColumnFixed = boolean | "left" | "right";
3284
4061
 
4062
+ export declare type TZTableV2ColumnFixed = boolean | "left" | "right";
4063
+
4064
+ declare type TZTableV2SharedConfigProps<T extends TObj> = Partial<TableProps<T>> & Omit<TableV2PropsPublic, keyof TableProps<T> | "columns" | "data">;
4065
+
4066
+ /**
4067
+ * 设置 sticky 的选择器
4068
+ */
4069
+ export declare type TZTableV2StickyTriggerSelector = string | HTMLElement | (() => HTMLElement) | undefined;
4070
+
3285
4071
  declare class UiConfigService {
3286
- private config?;
4072
+ private _config?;
4073
+ get config(): IUiConfig | undefined;
3287
4074
  /**
3288
4075
  * 传入配置
3289
4076
  * @param config
@@ -3303,6 +4090,15 @@ export declare type TCreateBaseFormItemParams<T extends keyof IComponentProps, U
3303
4090
  saveViewConfig<T extends TObj>(params: IViewConfig & {
3304
4091
  config: string;
3305
4092
  }, formBuilder?: FormBuilder<T>): Promise<void>;
4093
+ /**
4094
+ * 获取表格配置
4095
+ */
4096
+ get zTableV2SharedConfig(): {} & IZTableV2Config<TObj<string, any>>;
4097
+ /**
4098
+ * 根据名称获取默认插槽
4099
+ * @param name
4100
+ */
4101
+ getZTableV2DefaultSlotRenderByName(name: string): TUndefinable<TRenderFunction>;
3306
4102
  }
3307
4103
 
3308
4104
  export declare const uiConfigService: UiConfigService;
@@ -3407,6 +4203,52 @@ export declare type TCreateBaseFormItemParams<T extends keyof IComponentProps, U
3407
4203
  */
3408
4204
  export declare const useCreateFormBuilder: <T extends TObj>(fields?: (IBaseFormItem<T> | BaseFormItem<T>)[], config?: ICreateFormBuilderConfig) => ICreateFormBuilderReturn<T>;
3409
4205
 
4206
+ /**
4207
+ * 创建表格实例
4208
+ * @param columns
4209
+ * @param config
4210
+ *
4211
+ * @example
4212
+ * const { tableBuilder, registerEvent, refresh } = useCreateTableBuilder([
4213
+ * {
4214
+ * prop: "name",
4215
+ * label: "Name",
4216
+ * },
4217
+ * {
4218
+ * prop: "age",
4219
+ * label: "Age",
4220
+ * },
4221
+ * ], {
4222
+ * loadMethod: async (pagination) => {
4223
+ * // xxx execute api
4224
+ * return {
4225
+ * data: [],
4226
+ * total: 0,
4227
+ * };
4228
+ * },
4229
+ * customColumnConfig: {
4230
+ * pageId: "page-id",
4231
+ * },
4232
+ * })
4233
+ *
4234
+ * // add event
4235
+ * registerEvent("cell-click", () => {
4236
+ * console.log("表格单元格被点击");
4237
+ * });
4238
+ *
4239
+ * // refresh table
4240
+ * refresh(true);
4241
+ */
4242
+ export declare const useCreateTableBuilder: <T extends TObj = TAny_2>(columns: (IZTableV2Column<T> | IBaseTableColumn<T>)[], config?: IZTableV2Config<T>) => IUseCreateTableBuilderReturn<T>;
4243
+
4244
+ /**
4245
+ * 创建一个支持虚拟滚动的表格
4246
+ * @param columns
4247
+ * @param config
4248
+ * @description 用法与 useCreateTableBuilder 一样。只是增加了一个默认 enableVirtualScroll 为 true 的配置
4249
+ */
4250
+ export declare const useCreateVirtualTableBuilder: <T extends TObj = TAny_2>(columns: (IZTableV2Column<T> | IBaseTableColumn<T>)[], config?: IZTableV2Config<T>) => IUseCreateTableBuilderReturn<T>;
4251
+
3410
4252
  export declare class UseDialogError extends Error {
3411
4253
  }
3412
4254
 
@@ -3517,15 +4359,17 @@ export declare type TCreateBaseFormItemParams<T extends keyof IComponentProps, U
3517
4359
  * 监听元素的宽高变化
3518
4360
  */
3519
4361
  export declare const useResizeObserver: () => {
3520
- onResize: <T extends HTMLElement>(target: T | Ref<T> | (() => T | Ref<T>), callBack: (entry: ResizeObserverEntry) => void) => void;
4362
+ onResize: <T extends HTMLElement>(target: TUndefinable<T | Ref<T> | (() => TUndefinable<T | Ref<T>>)>, callBack: (entry: ResizeObserverEntry) => void) => void;
3521
4363
  stopResize: () => void;
3522
4364
  };
3523
4365
 
3524
4366
  /**
3525
4367
  * 处理表格开启表头固定的逻辑
3526
4368
  */
3527
- export declare const useTableSticky: (options: IUseTableStickyOptions) => {
3528
- start: () => void;
4369
+ export declare const useTableSticky: <T extends {
4370
+ $el: HTMLElement;
4371
+ }>(_options?: IUseTableStickyOptions<T>) => {
4372
+ start: (startOptions?: IUseTableStickyOptions<T>) => void;
3529
4373
  reset: () => Promise<void>;
3530
4374
  };
3531
4375
 
@@ -3581,6 +4425,47 @@ export declare type TCreateBaseFormItemParams<T extends keyof IComponentProps, U
3581
4425
  */
3582
4426
  export declare const Z_TABLE_MAX_CUSTOM_COLUMNS_FIXED_COUNT = 5;
3583
4427
 
4428
+ /**
4429
+ * 表格开启拖拽的class
4430
+ */
4431
+ export declare const Z_TABLE_V2_COLUMN_DRAGGABLE_CLASS = "z-table-v2__column__is-draggable";
4432
+
4433
+ /**
4434
+ * 默认选中的分组ID
4435
+ */
4436
+ export declare const Z_TABLE_V2_DEFAULT_GROUP_CHECKED_ID = "-1";
4437
+
4438
+ /**
4439
+ * 表格默认的空值的dom
4440
+ */
4441
+ export declare const Z_TABLE_V2_EMPTY_NODE: JSX;
4442
+
4443
+ /**
4444
+ * 表格默认的空值
4445
+ */
4446
+ export declare const Z_TABLE_V2_EMPTY_VALUE = "-";
4447
+
4448
+ /**
4449
+ * z-table-v2 的事件
4450
+ */
4451
+ declare const Z_TABLE_V2_EVENTS: readonly ["init", "drag", "drag-change", "loaded", "refreshed", "save-columns", "change-group", "virtual-table-rendered", "select", "select-all", "selection-change", "cell-mouse-enter", "cell-mouse-leave", "cell-contextmenu", "cell-click", "cell-dblclick", "row-click", "row-contextmenu", "row-dblclick", "header-click", "header-contextmenu", "sort-change", "filter-change", "current-change", "header-dragend", "expand-change", "scroll", "column-sort", "expanded-rows-change", "end-reached", "scroll", "rows-rendered", "row-expand", "pagination:size-change", "pagination:current-change", "pagination:prev-click", "pagination:next-click", "pagination:change"];
4452
+
4453
+ /**
4454
+ * 最大可添加分组
4455
+ */
4456
+ export declare const Z_TABLE_V2_MAX_CUSTOM_COLUMN_GROUP_COUNT = 10;
4457
+
4458
+ /**
4459
+ * 特殊的列配置
4460
+ */
4461
+ export declare const Z_TABLE_V2_SPECIAL_COLUMN_MAP: Record<"index" | "selection" | string, IZTableV2Column>;
4462
+
4463
+ /**
4464
+ * 表格 sticky 的容器的 class
4465
+ * @description 目前该值与 z-table 的一致
4466
+ */
4467
+ export declare const Z_TABLE_V2_STICKY_CONTAINER_CLASS = "__base-table-sticky-container";
4468
+
3584
4469
  export declare const ZAutoTooltip: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
3585
4470
 
3586
4471
  export declare const ZCircleText: {
@@ -3710,9 +4595,17 @@ export declare type TCreateBaseFormItemParams<T extends keyof IComponentProps, U
3710
4595
  onChange?: ((value: TNumberOrString) => any) | undefined;
3711
4596
  }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
3712
4597
 
3713
- export declare const ZOperationIconButton: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
4598
+ export declare const ZOperationIconButton: DefineComponent< {
4599
+ src: string | TAny;
4600
+ alt?: string;
4601
+ tips?: string;
4602
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
3714
4603
  click: () => any;
3715
- }, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
4604
+ }, string, PublicProps, Readonly<{
4605
+ src: string | TAny;
4606
+ alt?: string;
4607
+ tips?: string;
4608
+ }> & Readonly<{
3716
4609
  onClick?: (() => any) | undefined;
3717
4610
  }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
3718
4611
 
@@ -3803,24 +4696,24 @@ export declare type TCreateBaseFormItemParams<T extends keyof IComponentProps, U
3803
4696
  }, PublicProps, {
3804
4697
  border: boolean;
3805
4698
  columns: IBaseTableColumn<any>[];
3806
- fit: boolean;
3807
4699
  rowKey: string | ((row: TObj<string, any>) => string);
3808
- showHeader: boolean;
3809
4700
  scrollbarAlwaysOn: boolean;
4701
+ fit: boolean;
4702
+ showHeader: boolean;
3810
4703
  tableData: TObj[];
3811
4704
  autoLoad: boolean;
3812
4705
  hasDefaultOperation: boolean;
3813
4706
  operationBtnList: IOperationBtn["type"] | (IOperationBtn | IOperationBtn["type"])[];
3814
4707
  hasPagination: boolean;
3815
- paginationPosition: "left" | "right";
3816
4708
  fixedPagination: boolean;
3817
4709
  stickyHeader: boolean;
3818
4710
  hideTableWorkHeader: boolean;
3819
4711
  enableColumnSearch: boolean;
4712
+ showSelectCount: boolean;
4713
+ paginationPosition: "left" | "right";
3820
4714
  whenFixedPaginationNoPadding: boolean;
3821
4715
  fullHeight: boolean;
3822
4716
  autoScrollY: boolean;
3823
- showSelectCount: boolean;
3824
4717
  }, false, {}, {}, GlobalComponents, GlobalDirectives, string, {
3825
4718
  baseTableContainerRef: HTMLDivElement;
3826
4719
  baseTableOperationElement: HTMLDivElement;
@@ -3875,24 +4768,24 @@ export declare type TCreateBaseFormItemParams<T extends keyof IComponentProps, U
3875
4768
  }, {}, {}, {}, {
3876
4769
  border: boolean;
3877
4770
  columns: IBaseTableColumn<any>[];
3878
- fit: boolean;
3879
4771
  rowKey: string | ((row: TObj<string, any>) => string);
3880
- showHeader: boolean;
3881
4772
  scrollbarAlwaysOn: boolean;
4773
+ fit: boolean;
4774
+ showHeader: boolean;
3882
4775
  tableData: TObj[];
3883
4776
  autoLoad: boolean;
3884
4777
  hasDefaultOperation: boolean;
3885
4778
  operationBtnList: IOperationBtn["type"] | (IOperationBtn | IOperationBtn["type"])[];
3886
4779
  hasPagination: boolean;
3887
- paginationPosition: "left" | "right";
3888
4780
  fixedPagination: boolean;
3889
4781
  stickyHeader: boolean;
3890
4782
  hideTableWorkHeader: boolean;
3891
4783
  enableColumnSearch: boolean;
4784
+ showSelectCount: boolean;
4785
+ paginationPosition: "left" | "right";
3892
4786
  whenFixedPaginationNoPadding: boolean;
3893
4787
  fullHeight: boolean;
3894
4788
  autoScrollY: boolean;
3895
- showSelectCount: boolean;
3896
4789
  }>;
3897
4790
  __isFragment?: never;
3898
4791
  __isTeleport?: never;
@@ -3969,24 +4862,24 @@ export declare type TCreateBaseFormItemParams<T extends keyof IComponentProps, U
3969
4862
  }, string, {
3970
4863
  border: boolean;
3971
4864
  columns: IBaseTableColumn<any>[];
3972
- fit: boolean;
3973
4865
  rowKey: string | ((row: TObj<string, any>) => string);
3974
- showHeader: boolean;
3975
4866
  scrollbarAlwaysOn: boolean;
4867
+ fit: boolean;
4868
+ showHeader: boolean;
3976
4869
  tableData: TObj[];
3977
4870
  autoLoad: boolean;
3978
4871
  hasDefaultOperation: boolean;
3979
4872
  operationBtnList: IOperationBtn["type"] | (IOperationBtn | IOperationBtn["type"])[];
3980
4873
  hasPagination: boolean;
3981
- paginationPosition: "left" | "right";
3982
4874
  fixedPagination: boolean;
3983
4875
  stickyHeader: boolean;
3984
4876
  hideTableWorkHeader: boolean;
3985
4877
  enableColumnSearch: boolean;
4878
+ showSelectCount: boolean;
4879
+ paginationPosition: "left" | "right";
3986
4880
  whenFixedPaginationNoPadding: boolean;
3987
4881
  fullHeight: boolean;
3988
4882
  autoScrollY: boolean;
3989
- showSelectCount: boolean;
3990
4883
  }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
3991
4884
  $slots: Readonly<{
3992
4885
  header: (_props: {
@@ -4037,6 +4930,275 @@ export declare type TCreateBaseFormItemParams<T extends keyof IComponentProps, U
4037
4930
  };
4038
4931
  });
4039
4932
 
4933
+ export declare const ZTableV2: {
4934
+ new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly<{
4935
+ tableBuilder: TableBuilder<TAny>;
4936
+ }> & Readonly<{
4937
+ onSelect?: ((...args: any[]) => any) | undefined;
4938
+ onDrag?: ((...args: any[]) => any) | undefined;
4939
+ onScroll?: ((...args: any[]) => any) | undefined;
4940
+ onInit?: ((...args: any[]) => any) | undefined;
4941
+ "onEnd-reached"?: ((...args: any[]) => any) | undefined;
4942
+ "onExpand-change"?: ((...args: any[]) => any) | undefined;
4943
+ "onCurrent-change"?: ((...args: any[]) => any) | undefined;
4944
+ "onSelect-all"?: ((...args: any[]) => any) | undefined;
4945
+ "onSelection-change"?: ((...args: any[]) => any) | undefined;
4946
+ "onCell-mouse-enter"?: ((...args: any[]) => any) | undefined;
4947
+ "onCell-mouse-leave"?: ((...args: any[]) => any) | undefined;
4948
+ "onCell-contextmenu"?: ((...args: any[]) => any) | undefined;
4949
+ "onCell-click"?: ((...args: any[]) => any) | undefined;
4950
+ "onCell-dblclick"?: ((...args: any[]) => any) | undefined;
4951
+ "onRow-click"?: ((...args: any[]) => any) | undefined;
4952
+ "onRow-contextmenu"?: ((...args: any[]) => any) | undefined;
4953
+ "onRow-dblclick"?: ((...args: any[]) => any) | undefined;
4954
+ "onHeader-click"?: ((...args: any[]) => any) | undefined;
4955
+ "onHeader-contextmenu"?: ((...args: any[]) => any) | undefined;
4956
+ "onSort-change"?: ((...args: any[]) => any) | undefined;
4957
+ "onFilter-change"?: ((...args: any[]) => any) | undefined;
4958
+ "onHeader-dragend"?: ((...args: any[]) => any) | undefined;
4959
+ onRefreshed?: ((...args: any[]) => any) | undefined;
4960
+ onLoaded?: ((...args: any[]) => any) | undefined;
4961
+ "onDrag-change"?: ((...args: any[]) => any) | undefined;
4962
+ "onSave-columns"?: ((...args: any[]) => any) | undefined;
4963
+ "onChange-group"?: ((...args: any[]) => any) | undefined;
4964
+ "onVirtual-table-rendered"?: ((...args: any[]) => any) | undefined;
4965
+ "onColumn-sort"?: ((...args: any[]) => any) | undefined;
4966
+ "onExpanded-rows-change"?: ((...args: any[]) => any) | undefined;
4967
+ "onRows-rendered"?: ((...args: any[]) => any) | undefined;
4968
+ "onRow-expand"?: ((...args: any[]) => any) | undefined;
4969
+ "onPagination:size-change"?: ((...args: any[]) => any) | undefined;
4970
+ "onPagination:current-change"?: ((...args: any[]) => any) | undefined;
4971
+ "onPagination:prev-click"?: ((...args: any[]) => any) | undefined;
4972
+ "onPagination:next-click"?: ((...args: any[]) => any) | undefined;
4973
+ "onPagination:change"?: ((...args: any[]) => any) | undefined;
4974
+ }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
4975
+ select: (...args: any[]) => void;
4976
+ drag: (...args: any[]) => void;
4977
+ scroll: (...args: any[]) => void;
4978
+ init: (...args: any[]) => void;
4979
+ "end-reached": (...args: any[]) => void;
4980
+ "expand-change": (...args: any[]) => void;
4981
+ "current-change": (...args: any[]) => void;
4982
+ "select-all": (...args: any[]) => void;
4983
+ "selection-change": (...args: any[]) => void;
4984
+ "cell-mouse-enter": (...args: any[]) => void;
4985
+ "cell-mouse-leave": (...args: any[]) => void;
4986
+ "cell-contextmenu": (...args: any[]) => void;
4987
+ "cell-click": (...args: any[]) => void;
4988
+ "cell-dblclick": (...args: any[]) => void;
4989
+ "row-click": (...args: any[]) => void;
4990
+ "row-contextmenu": (...args: any[]) => void;
4991
+ "row-dblclick": (...args: any[]) => void;
4992
+ "header-click": (...args: any[]) => void;
4993
+ "header-contextmenu": (...args: any[]) => void;
4994
+ "sort-change": (...args: any[]) => void;
4995
+ "filter-change": (...args: any[]) => void;
4996
+ "header-dragend": (...args: any[]) => void;
4997
+ refreshed: (...args: any[]) => void;
4998
+ loaded: (...args: any[]) => void;
4999
+ "drag-change": (...args: any[]) => void;
5000
+ "save-columns": (...args: any[]) => void;
5001
+ "change-group": (...args: any[]) => void;
5002
+ "virtual-table-rendered": (...args: any[]) => void;
5003
+ "column-sort": (...args: any[]) => void;
5004
+ "expanded-rows-change": (...args: any[]) => void;
5005
+ "rows-rendered": (...args: any[]) => void;
5006
+ "row-expand": (...args: any[]) => void;
5007
+ "pagination:size-change": (...args: any[]) => void;
5008
+ "pagination:current-change": (...args: any[]) => void;
5009
+ "pagination:prev-click": (...args: any[]) => void;
5010
+ "pagination:next-click": (...args: any[]) => void;
5011
+ "pagination:change": (...args: any[]) => void;
5012
+ }, PublicProps, {}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {
5013
+ zTableV2ContainerRef: HTMLDivElement;
5014
+ zTableV2OperationElement: HTMLDivElement;
5015
+ zTableV2BodyRef: HTMLDivElement;
5016
+ }, HTMLDivElement, ComponentProvideOptions, {
5017
+ P: {};
5018
+ B: {};
5019
+ D: {};
5020
+ C: {};
5021
+ M: {};
5022
+ Defaults: {};
5023
+ }, Readonly<{
5024
+ tableBuilder: TableBuilder<TAny>;
5025
+ }> & Readonly<{
5026
+ onSelect?: ((...args: any[]) => any) | undefined;
5027
+ onDrag?: ((...args: any[]) => any) | undefined;
5028
+ onScroll?: ((...args: any[]) => any) | undefined;
5029
+ onInit?: ((...args: any[]) => any) | undefined;
5030
+ "onEnd-reached"?: ((...args: any[]) => any) | undefined;
5031
+ "onExpand-change"?: ((...args: any[]) => any) | undefined;
5032
+ "onCurrent-change"?: ((...args: any[]) => any) | undefined;
5033
+ "onSelect-all"?: ((...args: any[]) => any) | undefined;
5034
+ "onSelection-change"?: ((...args: any[]) => any) | undefined;
5035
+ "onCell-mouse-enter"?: ((...args: any[]) => any) | undefined;
5036
+ "onCell-mouse-leave"?: ((...args: any[]) => any) | undefined;
5037
+ "onCell-contextmenu"?: ((...args: any[]) => any) | undefined;
5038
+ "onCell-click"?: ((...args: any[]) => any) | undefined;
5039
+ "onCell-dblclick"?: ((...args: any[]) => any) | undefined;
5040
+ "onRow-click"?: ((...args: any[]) => any) | undefined;
5041
+ "onRow-contextmenu"?: ((...args: any[]) => any) | undefined;
5042
+ "onRow-dblclick"?: ((...args: any[]) => any) | undefined;
5043
+ "onHeader-click"?: ((...args: any[]) => any) | undefined;
5044
+ "onHeader-contextmenu"?: ((...args: any[]) => any) | undefined;
5045
+ "onSort-change"?: ((...args: any[]) => any) | undefined;
5046
+ "onFilter-change"?: ((...args: any[]) => any) | undefined;
5047
+ "onHeader-dragend"?: ((...args: any[]) => any) | undefined;
5048
+ onRefreshed?: ((...args: any[]) => any) | undefined;
5049
+ onLoaded?: ((...args: any[]) => any) | undefined;
5050
+ "onDrag-change"?: ((...args: any[]) => any) | undefined;
5051
+ "onSave-columns"?: ((...args: any[]) => any) | undefined;
5052
+ "onChange-group"?: ((...args: any[]) => any) | undefined;
5053
+ "onVirtual-table-rendered"?: ((...args: any[]) => any) | undefined;
5054
+ "onColumn-sort"?: ((...args: any[]) => any) | undefined;
5055
+ "onExpanded-rows-change"?: ((...args: any[]) => any) | undefined;
5056
+ "onRows-rendered"?: ((...args: any[]) => any) | undefined;
5057
+ "onRow-expand"?: ((...args: any[]) => any) | undefined;
5058
+ "onPagination:size-change"?: ((...args: any[]) => any) | undefined;
5059
+ "onPagination:current-change"?: ((...args: any[]) => any) | undefined;
5060
+ "onPagination:prev-click"?: ((...args: any[]) => any) | undefined;
5061
+ "onPagination:next-click"?: ((...args: any[]) => any) | undefined;
5062
+ "onPagination:change"?: ((...args: any[]) => any) | undefined;
5063
+ }>, {}, {}, {}, {}, {}>;
5064
+ __isFragment?: never;
5065
+ __isTeleport?: never;
5066
+ __isSuspense?: never;
5067
+ } & ComponentOptionsBase<Readonly<{
5068
+ tableBuilder: TableBuilder<TAny>;
5069
+ }> & Readonly<{
5070
+ onSelect?: ((...args: any[]) => any) | undefined;
5071
+ onDrag?: ((...args: any[]) => any) | undefined;
5072
+ onScroll?: ((...args: any[]) => any) | undefined;
5073
+ onInit?: ((...args: any[]) => any) | undefined;
5074
+ "onEnd-reached"?: ((...args: any[]) => any) | undefined;
5075
+ "onExpand-change"?: ((...args: any[]) => any) | undefined;
5076
+ "onCurrent-change"?: ((...args: any[]) => any) | undefined;
5077
+ "onSelect-all"?: ((...args: any[]) => any) | undefined;
5078
+ "onSelection-change"?: ((...args: any[]) => any) | undefined;
5079
+ "onCell-mouse-enter"?: ((...args: any[]) => any) | undefined;
5080
+ "onCell-mouse-leave"?: ((...args: any[]) => any) | undefined;
5081
+ "onCell-contextmenu"?: ((...args: any[]) => any) | undefined;
5082
+ "onCell-click"?: ((...args: any[]) => any) | undefined;
5083
+ "onCell-dblclick"?: ((...args: any[]) => any) | undefined;
5084
+ "onRow-click"?: ((...args: any[]) => any) | undefined;
5085
+ "onRow-contextmenu"?: ((...args: any[]) => any) | undefined;
5086
+ "onRow-dblclick"?: ((...args: any[]) => any) | undefined;
5087
+ "onHeader-click"?: ((...args: any[]) => any) | undefined;
5088
+ "onHeader-contextmenu"?: ((...args: any[]) => any) | undefined;
5089
+ "onSort-change"?: ((...args: any[]) => any) | undefined;
5090
+ "onFilter-change"?: ((...args: any[]) => any) | undefined;
5091
+ "onHeader-dragend"?: ((...args: any[]) => any) | undefined;
5092
+ onRefreshed?: ((...args: any[]) => any) | undefined;
5093
+ onLoaded?: ((...args: any[]) => any) | undefined;
5094
+ "onDrag-change"?: ((...args: any[]) => any) | undefined;
5095
+ "onSave-columns"?: ((...args: any[]) => any) | undefined;
5096
+ "onChange-group"?: ((...args: any[]) => any) | undefined;
5097
+ "onVirtual-table-rendered"?: ((...args: any[]) => any) | undefined;
5098
+ "onColumn-sort"?: ((...args: any[]) => any) | undefined;
5099
+ "onExpanded-rows-change"?: ((...args: any[]) => any) | undefined;
5100
+ "onRows-rendered"?: ((...args: any[]) => any) | undefined;
5101
+ "onRow-expand"?: ((...args: any[]) => any) | undefined;
5102
+ "onPagination:size-change"?: ((...args: any[]) => any) | undefined;
5103
+ "onPagination:current-change"?: ((...args: any[]) => any) | undefined;
5104
+ "onPagination:prev-click"?: ((...args: any[]) => any) | undefined;
5105
+ "onPagination:next-click"?: ((...args: any[]) => any) | undefined;
5106
+ "onPagination:change"?: ((...args: any[]) => any) | undefined;
5107
+ }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
5108
+ select: (...args: any[]) => void;
5109
+ drag: (...args: any[]) => void;
5110
+ scroll: (...args: any[]) => void;
5111
+ init: (...args: any[]) => void;
5112
+ "end-reached": (...args: any[]) => void;
5113
+ "expand-change": (...args: any[]) => void;
5114
+ "current-change": (...args: any[]) => void;
5115
+ "select-all": (...args: any[]) => void;
5116
+ "selection-change": (...args: any[]) => void;
5117
+ "cell-mouse-enter": (...args: any[]) => void;
5118
+ "cell-mouse-leave": (...args: any[]) => void;
5119
+ "cell-contextmenu": (...args: any[]) => void;
5120
+ "cell-click": (...args: any[]) => void;
5121
+ "cell-dblclick": (...args: any[]) => void;
5122
+ "row-click": (...args: any[]) => void;
5123
+ "row-contextmenu": (...args: any[]) => void;
5124
+ "row-dblclick": (...args: any[]) => void;
5125
+ "header-click": (...args: any[]) => void;
5126
+ "header-contextmenu": (...args: any[]) => void;
5127
+ "sort-change": (...args: any[]) => void;
5128
+ "filter-change": (...args: any[]) => void;
5129
+ "header-dragend": (...args: any[]) => void;
5130
+ refreshed: (...args: any[]) => void;
5131
+ loaded: (...args: any[]) => void;
5132
+ "drag-change": (...args: any[]) => void;
5133
+ "save-columns": (...args: any[]) => void;
5134
+ "change-group": (...args: any[]) => void;
5135
+ "virtual-table-rendered": (...args: any[]) => void;
5136
+ "column-sort": (...args: any[]) => void;
5137
+ "expanded-rows-change": (...args: any[]) => void;
5138
+ "rows-rendered": (...args: any[]) => void;
5139
+ "row-expand": (...args: any[]) => void;
5140
+ "pagination:size-change": (...args: any[]) => void;
5141
+ "pagination:current-change": (...args: any[]) => void;
5142
+ "pagination:prev-click": (...args: any[]) => void;
5143
+ "pagination:next-click": (...args: any[]) => void;
5144
+ "pagination:change": (...args: any[]) => void;
5145
+ }, string, {}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
5146
+ $slots: Readonly<{
5147
+ header: (props: {
5148
+ pagination: IZTableV2Pagination;
5149
+ }) => void;
5150
+ operation: (props: {
5151
+ pagination: IZTableV2Pagination;
5152
+ }) => void;
5153
+ selectSlot: (props: {
5154
+ count: number;
5155
+ }) => void;
5156
+ append: () => void;
5157
+ empty: () => void;
5158
+ }> & {
5159
+ header: (props: {
5160
+ pagination: IZTableV2Pagination;
5161
+ }) => void;
5162
+ operation: (props: {
5163
+ pagination: IZTableV2Pagination;
5164
+ }) => void;
5165
+ selectSlot: (props: {
5166
+ count: number;
5167
+ }) => void;
5168
+ append: () => void;
5169
+ empty: () => void;
5170
+ };
5171
+ });
5172
+
5173
+ declare class ZTableV2Column<T extends TObj> {
5174
+ /**
5175
+ * 存储原始列配置
5176
+ */
5177
+ props: IZTableV2Column<T>;
5178
+ constructor(props: IZTableV2Column<T>);
5179
+ /**
5180
+ * 是否隐藏当前列
5181
+ */
5182
+ get isHidden(): boolean;
5183
+ get prop(): string | keyof T | undefined;
5184
+ get label(): string | undefined;
5185
+ get readonly(): boolean | undefined;
5186
+ /**
5187
+ * 获取列的属性
5188
+ */
5189
+ get tableColumnAttrs(): Omit_2<IZTableV2Column<T>, "onClick" | "hidden" | "className" | "contentRender" | "renderToOptions" | "headerRender" | "emptyValue" | "emptyClick" | "renderToEmpty" | "draggable">;
5190
+ /**
5191
+ * 获取table-v2的列的属性
5192
+ */
5193
+ get tableV2ColumnAttrs(): TableV2ColumnAttrs<T>;
5194
+ /**
5195
+ * 获取列的class
5196
+ */
5197
+ get className(): string;
5198
+ }
5199
+
5200
+ export declare type ZTableV2EventKeys = (typeof Z_TABLE_V2_EVENTS)[number] | string;
5201
+
4040
5202
  export declare const ZTipsFormItem: {
4041
5203
  new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly<{
4042
5204
  label: string;
@@ -4159,4 +5321,6 @@ declare interface Element {
4159
5321
  style: CSSStyleDeclaration;
4160
5322
  }
4161
5323
 
5324
+ declare type TArrayAble<T> = T | T[];
5325
+
4162
5326
  export { }