@gx-design-vue/pro-table 0.2.0-alpha.20 → 0.2.0-alpha.21
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/ProTable.js +61 -2
- package/dist/components/Drag/Handle.d.ts +90 -0
- package/dist/components/Drag/Handle.js +64 -0
- package/dist/components/Drag/Tbody.d.ts +17 -0
- package/dist/components/Drag/Tbody.js +27 -0
- package/dist/components/EllipsisText/index.d.ts +50 -0
- package/dist/components/EllipsisText/index.js +65 -0
- package/dist/components/SearchForm/CollapseToggle.d.ts +1 -1
- package/dist/components/SearchForm/FormItemWrapper.d.ts +1 -1
- package/dist/components/SearchForm/SearchForm.d.ts +2 -2
- package/dist/components/Toolbar/ListToolBar.d.ts +4 -4
- package/dist/components/Toolbar/index.d.ts +5 -5
- package/dist/hooks/index.d.ts +4 -1
- package/dist/hooks/index.js +4 -1
- package/dist/hooks/useAutoScroll.d.ts +32 -0
- package/dist/hooks/useAutoScroll.js +127 -0
- package/dist/hooks/useCellRender.js +14 -2
- package/dist/hooks/useColumnResize.js +2 -0
- package/dist/hooks/useDragHandleColumn.d.ts +26 -0
- package/dist/hooks/useDragHandleColumn.js +52 -0
- package/dist/hooks/useEllipsis.d.ts +20 -0
- package/dist/hooks/useEllipsis.js +51 -0
- package/dist/hooks/useRowDrag.d.ts +42 -0
- package/dist/hooks/useRowDrag.js +268 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2 -1
- package/dist/interface.d.ts +47 -9
- package/dist/pro-table.esm.js +6156 -613
- package/dist/pro-table.js +4 -1
- package/dist/style/ellipsis.d.ts +13 -0
- package/dist/style/ellipsis.js +16 -0
- package/dist/style/index.js +4 -0
- package/dist/style/row-drag.d.ts +8 -0
- package/dist/style/row-drag.js +44 -0
- package/dist/utils/arrayMove.d.ts +9 -0
- package/dist/utils/arrayMove.js +15 -0
- package/dist/utils/ellipsis.d.ts +19 -0
- package/dist/utils/ellipsis.js +30 -0
- package/dist/utils/flipAnimate.d.ts +25 -0
- package/dist/utils/flipAnimate.js +40 -0
- package/dist/utils/formConstants.js +3 -3
- package/package.json +15 -13
package/dist/interface.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComputedRef, Ref } from "vue";
|
|
2
2
|
import { AlignType, Breakpoint, CustomRender, RecordType, SemanticClassNames, SemanticStyles, WithFalse } from "@gx-design-vue/pro-utils";
|
|
3
3
|
import { SpinProps, TableEmits, TableProps, TableSlots, TooltipProps } from "antdv-next";
|
|
4
4
|
import { ColumnType, FilterValue, SorterResult, TableCurrentDataSource, TablePaginationConfig } from "antdv-next/dist/table/interface";
|
|
@@ -282,6 +282,30 @@ interface ProTableIndexColumn {
|
|
|
282
282
|
align?: AlignType;
|
|
283
283
|
fixed?: DefaultProColumn['fixed'];
|
|
284
284
|
}
|
|
285
|
+
/** 行拖拽把手列配置 */
|
|
286
|
+
interface ProTableRowDragOptions {
|
|
287
|
+
/** 把手列宽度,默认 40 */
|
|
288
|
+
width?: number;
|
|
289
|
+
/** 把手列对齐方式,默认 'center' */
|
|
290
|
+
align?: AlignType;
|
|
291
|
+
/** 把手列 fixed 位置,默认 'start' */
|
|
292
|
+
fixed?: 'start' | 'end';
|
|
293
|
+
/** 自定义把手渲染(默认 HolderOutlined 图标) */
|
|
294
|
+
handleRender?: (record: any, index: number) => CustomRender;
|
|
295
|
+
/** 是否禁用某行拖拽,返回 true 则该行不可拖动 */
|
|
296
|
+
disabled?: (record: any) => boolean;
|
|
297
|
+
}
|
|
298
|
+
/** 行拖拽排序结束事件 */
|
|
299
|
+
interface ProTableRowSortEndEvent<DataRecord = RecordType> {
|
|
300
|
+
/** 原索引 */
|
|
301
|
+
from: number;
|
|
302
|
+
/** 新索引 */
|
|
303
|
+
to: number;
|
|
304
|
+
/** 重排后的完整数据 */
|
|
305
|
+
data: DataRecord[];
|
|
306
|
+
/** 被拖拽的记录 */
|
|
307
|
+
record: DataRecord;
|
|
308
|
+
}
|
|
285
309
|
interface ProTableScrollPolicy {
|
|
286
310
|
mode?: 'auto' | 'manual' | 'disabled';
|
|
287
311
|
breakpoint?: Breakpoint | number;
|
|
@@ -292,16 +316,25 @@ interface ProTableScrollPolicy {
|
|
|
292
316
|
};
|
|
293
317
|
actionFixed?: boolean | 'auto';
|
|
294
318
|
}
|
|
295
|
-
|
|
319
|
+
/** 列文本溢出(省略)配置 */
|
|
320
|
+
interface ProColumnEllipsis {
|
|
321
|
+
/** 省略行数,默认 1 */
|
|
322
|
+
lines?: number;
|
|
323
|
+
/** 是否使用原生 title 属性展示完整文本(不走 Tooltip),默认 false */
|
|
324
|
+
showTitle?: boolean;
|
|
325
|
+
/** tooltip 配置;设为 false 则仅省略不显示 tooltip */
|
|
326
|
+
tooltip?: false | TooltipProps;
|
|
327
|
+
}
|
|
328
|
+
type ProColumnType<DataValue = RecordType, SearchParams = RecordType> = ProColumn<Omit<ColumnType<DataValue>, keyof DefaultProColumnWithKeyOrDataIndex | 'ellipsis'> & {
|
|
296
329
|
children?: ProColumnType<DataValue, SearchParams>[];
|
|
297
330
|
index?: number;
|
|
298
331
|
copyText?: string | ((record: ProColumnType) => string);
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
332
|
+
/**
|
|
333
|
+
* 文本溢出配置:
|
|
334
|
+
* - true:单行省略 + tooltip
|
|
335
|
+
* - 对象:可指定 lines(省略行数,默认 1)、tooltip(false 关闭提示,或透传 TooltipProps)、showTitle(原生 title)
|
|
336
|
+
*/
|
|
337
|
+
ellipsis?: boolean | ProColumnEllipsis; /** 不在列表中显示 */
|
|
305
338
|
show?: boolean; /** 列表顺序值 */
|
|
306
339
|
order?: number; /** 表单搜索配置 */
|
|
307
340
|
searchConfig?: ProSearchMap<undefined, keyof DataValue | keyof SearchParams>; /** 是否拷贝 */
|
|
@@ -419,6 +452,10 @@ interface ProTableProps<DataRecord = RecordType, ParamsType = RecordType> extend
|
|
|
419
452
|
onResizeColumn?: (width: number, column: ProColumnType<DataRecord>) => void;
|
|
420
453
|
/** 启用列宽拖拽调整 */
|
|
421
454
|
draggable?: boolean;
|
|
455
|
+
/** 启用行拖拽排序(把手列自动注入到首列,比序号列更靠前) */
|
|
456
|
+
rowDraggable?: boolean | ProTableRowDragOptions;
|
|
457
|
+
/** 行拖拽排序结束回调 */
|
|
458
|
+
onRowSortEnd?: (event: ProTableRowSortEndEvent<DataRecord>) => void;
|
|
422
459
|
/**
|
|
423
460
|
* keep-alive 页面重新进入时是否触发数据请求
|
|
424
461
|
*/
|
|
@@ -494,6 +531,7 @@ interface ProTableEmits<DataRecord = RecordType, ParamsType = RecordType> extend
|
|
|
494
531
|
'sizeChange': ProTableProps<DataRecord, ParamsType>['onSizeChange'];
|
|
495
532
|
'resizeColumn': ProTableProps<DataRecord, ParamsType>['onResizeColumn'];
|
|
496
533
|
'fullscreenChange': ProTableProps<DataRecord, ParamsType>['onFullscreenChange'];
|
|
534
|
+
'rowSortEnd': ProTableProps<DataRecord, ParamsType>['onRowSortEnd'];
|
|
497
535
|
}
|
|
498
536
|
//#endregion
|
|
499
|
-
export { BeforeSearchSubmit, ColConfig, ColumnWithKeyOrDataIndex, CustomDataFn, CustomDataRender, CustomRenderResult, DefaultProColumn, DefaultProColumnWithKeyOrDataIndex, DefaultRender, FormConfig, OperateRowProps, PageItemFn, PageItemRender, PageState, ProColumn, ProColumnType, ProColumnsValueType, ProCoreActionType, ProCoreFormType, ProFieldValueFormat, ProFieldValueType, ProSchemaValueEnumType, ProSearchMap, ProTableBodyCellProps, ProTableClassNamesType, ProTableCustomProps, ProTableEmits, ProTableFetchParams, ProTableIndexColumn, ProTablePagination, ProTablePaginationConfig, ProTableProps, ProTableRef, ProTableScrollPolicy, ProTableSizeType, ProTableSlots, ProTableStylesType, RequestConfig, RequestData, RequestFunction, RowSelectionActions, TableSemanticName, TableSorterRecord, ToolbarOptionConfig, ToolbarPlacement };
|
|
537
|
+
export { BeforeSearchSubmit, ColConfig, ColumnWithKeyOrDataIndex, CustomDataFn, CustomDataRender, CustomRenderResult, DefaultProColumn, DefaultProColumnWithKeyOrDataIndex, DefaultRender, FormConfig, OperateRowProps, PageItemFn, PageItemRender, PageState, ProColumn, ProColumnEllipsis, ProColumnType, ProColumnsValueType, ProCoreActionType, ProCoreFormType, ProFieldValueFormat, ProFieldValueType, ProSchemaValueEnumType, ProSearchMap, ProTableBodyCellProps, ProTableClassNamesType, ProTableCustomProps, ProTableEmits, ProTableFetchParams, ProTableIndexColumn, ProTablePagination, ProTablePaginationConfig, ProTableProps, ProTableRef, ProTableRowDragOptions, ProTableRowSortEndEvent, ProTableScrollPolicy, ProTableSizeType, ProTableSlots, ProTableStylesType, RequestConfig, RequestData, RequestFunction, RowSelectionActions, TableSemanticName, TableSorterRecord, ToolbarOptionConfig, ToolbarPlacement };
|