z-ui-pc 1.1.21 → 1.2.0

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