@teamix/pro 1.5.16 → 1.5.18-beta
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/fonts/txddinmedium.woff +0 -0
- package/dist/pro.all.min.css +1 -0
- package/dist/pro.css +1 -0
- package/dist/pro.js +114772 -0
- package/dist/pro.min.css +1 -0
- package/dist/pro.min.js +2 -0
- package/dist/pro.min.js.LICENSE.txt +47 -0
- package/dist/pro.xconsole.min.css +1 -0
- package/es/actions/dialog-component.js +1 -4
- package/es/actions/dialog-form.js +4 -3
- package/es/actions/dialog.js +2 -1
- package/es/actions/index.js +35 -22
- package/es/actions/quick.js +1 -4
- package/es/card/card-container.js +12 -5
- package/es/card/divider.js +2 -4
- package/es/card/index.js +18 -7
- package/es/card/selectable.js +2 -4
- package/es/card/tab.js +2 -4
- package/es/form/Components/Editable/index.js +1 -1
- package/es/form/Components/FormGroup/index.js +4 -3
- package/es/form/Components/LightFilter/index.js +11 -2
- package/es/form/Components/ProField/index.js +2 -4
- package/es/form/Components/Text/index.js +2 -4
- package/es/form/Filter/AdvancedFilter.js +16 -14
- package/es/form/Filter/LightFilter.js +13 -9
- package/es/form/Filter/SimpleFilter.js +8 -5
- package/es/form/Filter/index.js +24 -7
- package/es/form/Filter/index.scss +1 -0
- package/es/form/Filter/index2.js +22 -17
- package/es/form/Filter/index2.scss +1 -0
- package/es/form/Filter/useBindUrl.js +3 -0
- package/es/form/Filter/useSpecialProps.js +1 -0
- package/es/form/ProForm/index.js +5 -2
- package/es/form/ProForm/useAutoLayout.js +4 -0
- package/es/form/ProForm/useFormDisplayValues.js +1 -0
- package/es/form/SchemaForm/adapterComponent.js +1 -0
- package/es/form/SchemaForm/adapterDecorator.js +1 -0
- package/es/form/SchemaForm/adapterType.js +1 -0
- package/es/form/SchemaForm/index.js +13 -0
- package/es/form/SchemaForm/initializeFormButton.js +2 -0
- package/es/form/SchemaForm/initializeReactions.js +1 -0
- package/es/form/SchemaForm/initializeSelectTable.js +1 -0
- package/es/form/SchemaForm/reactions.js +5 -0
- package/es/form/index.js +4 -0
- package/es/form/utils.js +12 -0
- package/es/form/warning.js +2 -0
- package/es/index.js +3 -1
- package/es/info/components/InfoGroup/index.js +2 -4
- package/es/info/components/InfoValueItem/index.js +32 -20
- package/es/info/components/ProInfoItem/index.js +1 -0
- package/es/info/components/baseInfo/index.js +3 -0
- package/es/info/components/tableInfo/index.js +6 -4
- package/es/info/index.js +11 -5
- package/es/info/utils/index.js +3 -0
- package/es/layout/index.js +2 -0
- package/es/nocode/index.js +2 -0
- package/es/nocode/pages/index.js +3 -0
- package/es/nocode/pages/playground.js +3 -5
- package/es/nocode/pages/renderer.js +4 -6
- package/es/nocode/playground.js +2 -4
- package/es/page-header/index.js +12 -7
- package/es/sidebar/components/sidebar-container/index.js +10 -7
- package/es/sidebar/components/tree/index.js +22 -4
- package/es/sidebar/components/tree-node/components/HoverTooltip/index.js +3 -4
- package/es/sidebar/components/tree-node/components/IconAction/index.js +4 -2
- package/es/sidebar/components/tree-node/components/IconSwitch/index.js +1 -0
- package/es/sidebar/components/tree-node/index.js +29 -16
- package/es/sidebar/index.js +15 -4
- package/es/sidebar/utils/index.js +19 -11
- package/es/table/components/CardView/index.js +29 -13
- package/es/table/components/Filter/index.js +11 -0
- package/es/table/components/Layout/index.js +13 -8
- package/es/table/components/LoadMore/index.js +3 -0
- package/es/table/components/Pagination/index.js +12 -10
- package/es/table/components/QuickAction/index.js +3 -2
- package/es/table/components/ToolBar/CardSwitch.js +2 -0
- package/es/table/components/ToolBar/DensityIcon.js +7 -2
- package/es/table/components/ToolBar/FilterColumnIcon.js +9 -0
- package/es/table/components/ToolBar/FullScreenIcon.js +1 -0
- package/es/table/components/ToolBar/Fullscreen.js +3 -0
- package/es/table/components/ToolBar/RefreshIcon.js +11 -0
- package/es/table/components/ToolBar/index.js +13 -10
- package/es/table/index.js +138 -51
- package/es/table/index.scss +26 -0
- package/es/table/utils/columnRender.js +78 -27
- package/es/table/utils/genAutoWidthColumns.js +340 -0
- package/es/table/utils/index.js +6 -0
- package/es/table/utils/pureColumnRender.js +9 -1
- package/es/templates/List/index.js +4 -6
- package/es/templates/index.js +2 -1
- package/es/timeline/ProTimeLineItem/index.js +8 -4
- package/es/timeline/index.js +5 -5
- package/es/utils/message.js +3 -5
- package/es/xconsole.scss +23 -0
- package/lib/form/Filter/index.scss +1 -0
- package/lib/form/Filter/index2.scss +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/table/components/CardView/index.js +5 -10
- package/lib/table/components/ToolBar/index.js +10 -7
- package/lib/table/index.js +72 -25
- package/lib/table/index.scss +26 -0
- package/lib/table/typing.d.ts +11 -1
- package/lib/table/utils/columnRender.d.ts +1 -0
- package/lib/table/utils/columnRender.js +51 -4
- package/lib/table/utils/genAutoWidthColumns.d.ts +35 -0
- package/lib/table/utils/genAutoWidthColumns.js +345 -0
- package/lib/xconsole.scss +23 -0
- package/package.json +1 -1
- package/es/actions/base.d.ts +0 -24
- package/es/actions/confirm.d.ts +0 -7
- package/es/actions/danger-confirm.d.ts +0 -7
- package/es/actions/danger-pop-confirm.d.ts +0 -5
- package/es/actions/dialog-component.d.ts +0 -10
- package/es/actions/dialog-form.d.ts +0 -29
- package/es/actions/dialog-info.d.ts +0 -9
- package/es/actions/dialog-table.d.ts +0 -9
- package/es/actions/dialog.d.ts +0 -40
- package/es/actions/drawer-form.d.ts +0 -6
- package/es/actions/drawer-info.d.ts +0 -6
- package/es/actions/drawer-table.d.ts +0 -6
- package/es/actions/drawer.d.ts +0 -6
- package/es/actions/error.d.ts +0 -7
- package/es/actions/index.d.ts +0 -114
- package/es/actions/link.d.ts +0 -8
- package/es/actions/notice.d.ts +0 -7
- package/es/actions/pop-confirm.d.ts +0 -9
- package/es/actions/quick.d.ts +0 -2
- package/es/actions/request.d.ts +0 -9
- package/es/actions/utils.d.ts +0 -1
- package/es/card/card-container.d.ts +0 -18
- package/es/card/divider.d.ts +0 -6
- package/es/card/index.d.ts +0 -109
- package/es/card/selectable.d.ts +0 -13
- package/es/card/tab.d.ts +0 -6
- package/es/card/utils.d.ts +0 -9
- package/es/field/index.d.ts +0 -3
- package/es/form/Components/Editable/index.d.ts +0 -20
- package/es/form/Components/FormGroup/index.d.ts +0 -14
- package/es/form/Components/LightFilter/componentMap.d.ts +0 -3
- package/es/form/Components/LightFilter/index.d.ts +0 -17
- package/es/form/Components/ProField/index.d.ts +0 -2
- package/es/form/Components/ProField/mapDateFormat.d.ts +0 -3
- package/es/form/Components/Text/index.d.ts +0 -8
- package/es/form/Filter/AdvancedFilter.d.ts +0 -7
- package/es/form/Filter/Layout.d.ts +0 -5
- package/es/form/Filter/LightFilter.d.ts +0 -7
- package/es/form/Filter/SimpleFilter.d.ts +0 -7
- package/es/form/Filter/index.d.ts +0 -9
- package/es/form/Filter/index2.d.ts +0 -13
- package/es/form/Filter/useBindUrl.d.ts +0 -2
- package/es/form/Filter/useSpecialProps.d.ts +0 -6
- package/es/form/ProForm/addCascadeEffect.d.ts +0 -2
- package/es/form/ProForm/customComponent.d.ts +0 -3
- package/es/form/ProForm/index.d.ts +0 -5
- package/es/form/ProForm/useAutoLayout.d.ts +0 -9
- package/es/form/ProForm/useAutoSubmit.d.ts +0 -6
- package/es/form/ProForm/useFieldRequest.d.ts +0 -5
- package/es/form/ProForm/useFormDisplayValues.d.ts +0 -4
- package/es/form/ProForm/useInitialRequest.d.ts +0 -6
- package/es/form/SchemaForm/adapterComponent.d.ts +0 -5
- package/es/form/SchemaForm/adapterDecorator.d.ts +0 -6
- package/es/form/SchemaForm/adapterType.d.ts +0 -5
- package/es/form/SchemaForm/index.d.ts +0 -4
- package/es/form/SchemaForm/initializeArrayCards.d.ts +0 -3
- package/es/form/SchemaForm/initializeArrayCollapse.d.ts +0 -3
- package/es/form/SchemaForm/initializeArrayItems.d.ts +0 -3
- package/es/form/SchemaForm/initializeArrayTable.d.ts +0 -3
- package/es/form/SchemaForm/initializeDataSource.d.ts +0 -15
- package/es/form/SchemaForm/initializeFormButton.d.ts +0 -3
- package/es/form/SchemaForm/initializeFormCollapse.d.ts +0 -3
- package/es/form/SchemaForm/initializeFormGroup.d.ts +0 -3
- package/es/form/SchemaForm/initializeFormStep.d.ts +0 -5
- package/es/form/SchemaForm/initializeFormTab.d.ts +0 -3
- package/es/form/SchemaForm/initializeReactions.d.ts +0 -2
- package/es/form/SchemaForm/initializeRequest.d.ts +0 -11
- package/es/form/SchemaForm/initializeRules.d.ts +0 -11
- package/es/form/SchemaForm/initializeSelectTable.d.ts +0 -3
- package/es/form/SchemaForm/reactions.d.ts +0 -6
- package/es/form/docs/ActionResponse.d.ts +0 -8
- package/es/form/fieldTypeMap.d.ts +0 -7
- package/es/form/index.d.ts +0 -125
- package/es/form/locales/validate.d.ts +0 -159
- package/es/form/schemaNameMap.d.ts +0 -5
- package/es/form/typing.d.ts +0 -194
- package/es/form/utils.d.ts +0 -55
- package/es/form/warning.d.ts +0 -3
- package/es/hooks/index.d.ts +0 -2
- package/es/index-without-icon.d.ts +0 -32
- package/es/index.d.ts +0 -32
- package/es/info/components/InfoGroup/index.d.ts +0 -5
- package/es/info/components/InfoValueItem/index.d.ts +0 -5
- package/es/info/components/ProInfoItem/index.d.ts +0 -5
- package/es/info/components/baseInfo/index.d.ts +0 -8
- package/es/info/components/headerInfo/index.d.ts +0 -8
- package/es/info/components/tableInfo/index.d.ts +0 -7
- package/es/info/index.d.ts +0 -10
- package/es/info/typing.d.ts +0 -220
- package/es/info/utils/index.d.ts +0 -20
- package/es/info/utils/layout.d.ts +0 -2
- package/es/info/utils/utils.d.ts +0 -1
- package/es/layout/index.d.ts +0 -2
- package/es/nocode/configurators/Card.d.ts +0 -3
- package/es/nocode/configurators/PageHeader.d.ts +0 -3
- package/es/nocode/configurators/ProTable.d.ts +0 -3
- package/es/nocode/configurators/common.d.ts +0 -280
- package/es/nocode/configurators/index.d.ts +0 -15
- package/es/nocode/configurators/map.d.ts +0 -2
- package/es/nocode/index.d.ts +0 -8
- package/es/nocode/pages/editor.d.ts +0 -12
- package/es/nocode/pages/index.d.ts +0 -14
- package/es/nocode/pages/playground.d.ts +0 -11
- package/es/nocode/pages/renderer.d.ts +0 -10
- package/es/nocode/playground.d.ts +0 -14
- package/es/page-container/index.d.ts +0 -3
- package/es/page-header/index.d.ts +0 -74
- package/es/sidebar/components/sidebar-container/index.d.ts +0 -5
- package/es/sidebar/components/tree/index.d.ts +0 -6
- package/es/sidebar/components/tree-node/components/HoverTooltip/index.d.ts +0 -15
- package/es/sidebar/components/tree-node/components/IconAction/index.d.ts +0 -12
- package/es/sidebar/components/tree-node/components/IconSwitch/index.d.ts +0 -23
- package/es/sidebar/components/tree-node/index.d.ts +0 -7
- package/es/sidebar/index.d.ts +0 -9
- package/es/sidebar/typing.d.ts +0 -141
- package/es/sidebar/utils/action-ref.d.ts +0 -3
- package/es/sidebar/utils/index.d.ts +0 -364
- package/es/skeleton/index.d.ts +0 -3
- package/es/table/components/CardView/index.d.ts +0 -5
- package/es/table/components/EmptyContent/index.d.ts +0 -2
- package/es/table/components/Filter/index.d.ts +0 -12
- package/es/table/components/Layout/index.d.ts +0 -5
- package/es/table/components/LoadMore/index.d.ts +0 -20
- package/es/table/components/Pagination/index.d.ts +0 -7
- package/es/table/components/QuickAction/index.d.ts +0 -11
- package/es/table/components/ToolBar/CardSwitch.d.ts +0 -8
- package/es/table/components/ToolBar/DensityIcon.d.ts +0 -4
- package/es/table/components/ToolBar/FilterColumnIcon.d.ts +0 -4
- package/es/table/components/ToolBar/FullScreenIcon.d.ts +0 -4
- package/es/table/components/ToolBar/Fullscreen.d.ts +0 -10
- package/es/table/components/ToolBar/RefreshIcon.d.ts +0 -4
- package/es/table/components/ToolBar/index.d.ts +0 -5
- package/es/table/index.d.ts +0 -5
- package/es/table/typing.d.ts +0 -418
- package/es/table/utils/columnRender.d.ts +0 -13
- package/es/table/utils/genProColumnToColumn.d.ts +0 -13
- package/es/table/utils/getTableProps.d.ts +0 -2
- package/es/table/utils/getTableSortIcons.d.ts +0 -3
- package/es/table/utils/index.d.ts +0 -19
- package/es/table/utils/pureColumnRender.d.ts +0 -9
- package/es/table/utils/pureGenProColumnToColumn.d.ts +0 -7
- package/es/table/utils/useTableSelection.d.ts +0 -3
- package/es/table/utils/util.d.ts +0 -5
- package/es/templates/Detail/index.d.ts +0 -2
- package/es/templates/Form/index.d.ts +0 -2
- package/es/templates/List/index.d.ts +0 -9
- package/es/templates/index.d.ts +0 -3
- package/es/timeline/ProTimeLineItem/index.d.ts +0 -5
- package/es/timeline/index.d.ts +0 -10
- package/es/timeline/typing.d.ts +0 -107
- package/es/utils/index.d.ts +0 -3
- package/es/utils/message.d.ts +0 -3
package/es/table/index.js
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
var _excluded = ["header", "className", "tableClassName", "mainAction", "extra", "dataFilter", "afterDataFilter", "toolBar", "columns", "useRowSelection", "rowSelection", "onChangeRowSelection", "getRowSelection", "primaryKey", "footerAction", "footer", "url", "pageKey", "pageSizeKey", "method", "params", "formatSort", "formatParams", "formatResult", "requestConfig", "requestWhenMount", "showPagination", "pageSizeList", "responsivePaginationType", "showSkeleton", "skeletonSize", "actionRef", "dataSource", "filterDebounce", "footerSuction", "autoRefresh", "autoRefreshProps", "customRequest", "filterColumnType", "defaultFilterParams", "reserveSelectedRecords", "size", "disableSelectAll", "context", "fixedTableBody", "isTree", "toolBarAutoWidth", "data-teamix-spm", "switchCardView", "cardViewProps", "defaultView", "emptyProps", "bindUrlProps", "bindUrl"],
|
1
|
+
var _excluded = ["header", "className", "tableClassName", "mainAction", "extra", "dataFilter", "afterDataFilter", "toolBar", "columns", "useRowSelection", "rowSelection", "onChangeRowSelection", "getRowSelection", "primaryKey", "footerAction", "footer", "url", "pageKey", "pageSizeKey", "method", "params", "formatSort", "formatParams", "formatResult", "requestConfig", "requestWhenMount", "showPagination", "pageSizeList", "responsivePaginationType", "showSkeleton", "skeletonSize", "actionRef", "dataSource", "filterDebounce", "footerSuction", "autoRefresh", "autoRefreshProps", "customRequest", "filterColumnType", "defaultFilterParams", "reserveSelectedRecords", "size", "disableSelectAll", "context", "autoWidth", "fixedTableBody", "isTree", "toolBarAutoWidth", "data-teamix-spm", "switchCardView", "cardViewProps", "defaultView", "emptyProps", "bindUrlProps", "bindUrl"],
|
2
2
|
_excluded2 = ["onChange"];
|
3
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
3
4
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
4
5
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
5
6
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
@@ -33,12 +34,15 @@ import { EmptyContent } from '@teamix/pro-field';
|
|
33
34
|
import { ProActionGroup } from '../actions';
|
34
35
|
import classNames from 'classnames';
|
35
36
|
import ProPageContainer from '../page-container';
|
37
|
+
import { genAutoWidthColumns, shadowContainer, shadowActionColumnContainer } from './utils/genAutoWidthColumns';
|
36
38
|
import debounce from 'lodash.debounce';
|
37
39
|
import CardView from './components/CardView';
|
38
40
|
import { useUrlState } from '@teamix/hooks';
|
39
41
|
import { getUrlStateFilter } from './utils/util';
|
40
42
|
export * from './typing';
|
43
|
+
console.log('ProTable hello12');
|
41
44
|
var cls = usePrefixCls('teamix-pro-table');
|
45
|
+
|
42
46
|
/**
|
43
47
|
* 处理原生传入的 columns 以便于 选择列 方便处理
|
44
48
|
* @param columns 原生传入的 columns
|
@@ -73,6 +77,7 @@ var processColumns = function processColumns(columns, initialColumns) {
|
|
73
77
|
}
|
74
78
|
return filterColumns;
|
75
79
|
};
|
80
|
+
|
76
81
|
/** 默认请求翻页参数 */
|
77
82
|
var globalPageKey = 'currentPage';
|
78
83
|
var globalPageSizeKey = 'pageSize';
|
@@ -86,6 +91,7 @@ var globalFormatSort = function globalFormatSort(sort) {
|
|
86
91
|
};
|
87
92
|
var ProTable = function ProTable(props) {
|
88
93
|
var _urlState$currentPage, _rowSelection$selecte;
|
94
|
+
console.log('ProTable---');
|
89
95
|
var header = props.header,
|
90
96
|
className = props.className,
|
91
97
|
tableClassName = props.tableClassName,
|
@@ -146,6 +152,8 @@ var ProTable = function ProTable(props) {
|
|
146
152
|
propsSize = _props$size === void 0 ? 'medium' : _props$size,
|
147
153
|
disableSelectAll = props.disableSelectAll,
|
148
154
|
context = props.context,
|
155
|
+
_props$autoWidth = props.autoWidth,
|
156
|
+
autoWidth = _props$autoWidth === void 0 ? true : _props$autoWidth,
|
149
157
|
_props$fixedTableBody = props.fixedTableBody,
|
150
158
|
fixedTableBody = _props$fixedTableBody === void 0 ? false : _props$fixedTableBody,
|
151
159
|
isTree = props.isTree,
|
@@ -206,6 +214,11 @@ var ProTable = function ProTable(props) {
|
|
206
214
|
_useState16 = _slicedToArray(_useState15, 2),
|
207
215
|
filteredColumns = _useState16[0],
|
208
216
|
setFilteredColumns = _useState16[1];
|
217
|
+
// 判断是否有操作列,有的话则渲染一个 shadow dom
|
218
|
+
var hasActionColumn = filteredColumns.some(function (column) {
|
219
|
+
var _column$actionSchema, _column$actionSchema$;
|
220
|
+
return (column === null || column === void 0 ? void 0 : column.actionSchema) && ((_column$actionSchema = column.actionSchema) === null || _column$actionSchema === void 0 ? void 0 : (_column$actionSchema$ = _column$actionSchema.actions) === null || _column$actionSchema$ === void 0 ? void 0 : _column$actionSchema$.length) > 0;
|
221
|
+
});
|
209
222
|
var _useState17 = useState(propsSize),
|
210
223
|
_useState18 = _slicedToArray(_useState17, 2),
|
211
224
|
size = _useState18[0],
|
@@ -214,6 +227,14 @@ var ProTable = function ProTable(props) {
|
|
214
227
|
_useState20 = _slicedToArray(_useState19, 2),
|
215
228
|
showLoading = _useState20[0],
|
216
229
|
setShowLoading = _useState20[1];
|
230
|
+
|
231
|
+
// 自动计算列宽需要的一些hook
|
232
|
+
var _useState21 = useState(true),
|
233
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
234
|
+
showShadowContainer = _useState22[0],
|
235
|
+
setShowShadowContainer = _useState22[1];
|
236
|
+
var shadowContainerRef = useRef(null);
|
237
|
+
var shadowActionColumnContainerRef = useRef(null);
|
217
238
|
// 表格内部用作存储的 Ref,标识 Table 组件是否被第一次渲染。用作 useUrlState filter 第一次渲染时使用 state 数据请求
|
218
239
|
var dataRef = useRef({
|
219
240
|
flag: true
|
@@ -232,31 +253,37 @@ var ProTable = function ProTable(props) {
|
|
232
253
|
}
|
233
254
|
}
|
234
255
|
}, [currentPage, pageSize, urlState]);
|
256
|
+
|
235
257
|
// 存储能够被 on 监听到的 ProTable 状态
|
236
258
|
// 因为只做存储用。不需要更新视图以及需要同步更改。所以不使用 setState 更新
|
237
|
-
var
|
259
|
+
var _useState23 = useState({
|
238
260
|
fullScreenState: false,
|
239
261
|
filterRules: {},
|
240
262
|
filterColumns: []
|
241
263
|
}),
|
242
|
-
|
243
|
-
actionRefState =
|
264
|
+
_useState24 = _slicedToArray(_useState23, 1),
|
265
|
+
actionRefState = _useState24[0];
|
266
|
+
|
244
267
|
// 存储 on 监听事件
|
245
|
-
var
|
268
|
+
var _useState25 = useState({
|
246
269
|
fullScreenState: {}
|
247
270
|
}),
|
248
|
-
|
249
|
-
actionRefCallback =
|
271
|
+
_useState26 = _slicedToArray(_useState25, 1),
|
272
|
+
actionRefCallback = _useState26[0];
|
273
|
+
|
250
274
|
// 存储定时器 id
|
251
275
|
var autoRefreshTimerRef = useRef();
|
252
276
|
var onResize = null;
|
277
|
+
|
253
278
|
// useEffect(() => {
|
254
279
|
// setShowSkeleton(propsShowSkeleton);
|
255
280
|
// }, [propsShowSkeleton]);
|
281
|
+
|
256
282
|
// useEffect(() => {
|
257
283
|
// console.log('传入的props变化', propsLoading);
|
258
284
|
// setShowLoading(propsLoading ?? false);
|
259
285
|
// }, [propsLoading]);
|
286
|
+
|
260
287
|
useEffect(function () {
|
261
288
|
var _propsDataFilter$sche, _propsDataFilter$sche2;
|
262
289
|
getHeaderHeight(fullscreenState);
|
@@ -283,6 +310,7 @@ var ProTable = function ProTable(props) {
|
|
283
310
|
}
|
284
311
|
}, 500);
|
285
312
|
}
|
313
|
+
|
286
314
|
// 如果不传 dataFilter,则在这里初始化请求
|
287
315
|
var hasDataFilter = (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : (_propsDataFilter$sche = propsDataFilter.schema) === null || _propsDataFilter$sche === void 0 ? void 0 : _propsDataFilter$sche.length) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : (_propsDataFilter$sche2 = propsDataFilter.schema) === null || _propsDataFilter$sche2 === void 0 ? void 0 : _propsDataFilter$sche2.length) > 0;
|
288
316
|
if (requestWhenMount && !hasDataFilter) {
|
@@ -301,6 +329,7 @@ var ProTable = function ProTable(props) {
|
|
301
329
|
actionRef.current = undefined;
|
302
330
|
};
|
303
331
|
}, []);
|
332
|
+
|
304
333
|
// 获取header高度,用作全屏吸底吸底高度计算以及固定body高度计算(滚动条在底部)
|
305
334
|
var getHeaderHeight = function getHeaderHeight(isFullscreen, offset) {
|
306
335
|
var _tableDom$getElements, _tableDom$getElements2, _document$querySelect, _document$querySelect2, _document$querySelect3;
|
@@ -331,6 +360,7 @@ var ProTable = function ProTable(props) {
|
|
331
360
|
// 16px 为 padding
|
332
361
|
var pageHeaderHeight = ((_pageContainerDom$off = pageContainerDom === null || pageContainerDom === void 0 ? void 0 : pageContainerDom.offsetHeight) !== null && _pageContainerDom$off !== void 0 ? _pageContainerDom$off : 0) + 16;
|
333
362
|
var teamixNavHeight = (_teamixNavDom$offsetH = teamixNavDom === null || teamixNavDom === void 0 ? void 0 : teamixNavDom.offsetHeight) !== null && _teamixNavDom$offsetH !== void 0 ? _teamixNavDom$offsetH : 0;
|
363
|
+
|
334
364
|
// 1 为预留值,js无法取出精确高度,会被四舍五入
|
335
365
|
var offsetHeaderHeight = headerHeight + tableHeaderHeight + pageHeaderHeight + teamixNavHeight + footerRowSelectionHeight + 16 + (offset !== null && offset !== void 0 ? offset : 0) + 1;
|
336
366
|
if (switchViewState === 'card') {
|
@@ -341,12 +371,15 @@ var ProTable = function ProTable(props) {
|
|
341
371
|
} else {
|
342
372
|
setFooterSuctionState(false);
|
343
373
|
}
|
374
|
+
|
344
375
|
// 如果有切换区tab,那么重新计算
|
345
376
|
if (headerFixedTopSectionDom.clientHeight) {
|
346
377
|
var _headerFixedTopSectio;
|
347
378
|
var headerFixedTopSectionHeight = (_headerFixedTopSectio = headerFixedTopSectionDom.clientHeight) !== null && _headerFixedTopSectio !== void 0 ? _headerFixedTopSectio : 0;
|
379
|
+
|
348
380
|
// const clientTableBodyHeight =
|
349
381
|
// document.body.clientHeight - offsetHeaderHeight;
|
382
|
+
|
350
383
|
setHeaderHeight(headerFixedTopSectionHeight + teamixNavHeight + footerRowSelectionHeight + tableHeaderHeight + 1);
|
351
384
|
return;
|
352
385
|
}
|
@@ -357,39 +390,45 @@ var ProTable = function ProTable(props) {
|
|
357
390
|
}
|
358
391
|
}, 50);
|
359
392
|
};
|
393
|
+
|
360
394
|
// header 区域高度。用作全屏计算吸顶吸底高度。默认不做计算
|
361
|
-
var
|
362
|
-
_useState26 = _slicedToArray(_useState25, 2),
|
363
|
-
headerHeight = _useState26[0],
|
364
|
-
setHeaderHeight = _useState26[1];
|
365
|
-
// 全屏显示 className
|
366
|
-
var _useState27 = useState(false),
|
395
|
+
var _useState27 = useState(0),
|
367
396
|
_useState28 = _slicedToArray(_useState27, 2),
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
397
|
+
headerHeight = _useState28[0],
|
398
|
+
setHeaderHeight = _useState28[1];
|
399
|
+
|
400
|
+
// 全屏显示 className
|
401
|
+
var _useState29 = useState(false),
|
372
402
|
_useState30 = _slicedToArray(_useState29, 2),
|
373
|
-
|
374
|
-
|
403
|
+
fullscreenState = _useState30[0],
|
404
|
+
setFullscreenState = _useState30[1];
|
405
|
+
// 切换视角
|
406
|
+
var _useState31 = useState(defaultView !== null && defaultView !== void 0 ? defaultView : 'table'),
|
407
|
+
_useState32 = _slicedToArray(_useState31, 2),
|
408
|
+
switchViewState = _useState32[0],
|
409
|
+
setSwitchViewState = _useState32[1];
|
375
410
|
// 切换全屏搜索开关
|
376
411
|
var filterEnableRef = useRef({
|
377
412
|
fullscreen: false,
|
378
413
|
normal: true
|
379
414
|
});
|
415
|
+
|
380
416
|
// 非全屏状态下的
|
381
417
|
var normalDataFilterFormRef = useRef();
|
382
418
|
var fullscreenDataFilterFormRef = useRef();
|
383
419
|
var normalDataFilterForm = normalDataFilterFormRef.current;
|
384
420
|
var fullscreenDataFilterForm = fullscreenDataFilterFormRef.current;
|
421
|
+
|
385
422
|
// 传给 QueryFilter 的 formRef
|
386
423
|
var dataFilterFormRef = !fullscreenState ? normalDataFilterFormRef : fullscreenDataFilterFormRef;
|
387
424
|
// let dataFilterForm = dataFilterFormRef.current;
|
425
|
+
|
388
426
|
// 整个内容区是否超过一屏。用于表格在非全屏模式下的吸底
|
389
|
-
var
|
390
|
-
|
391
|
-
footerSuctionState =
|
392
|
-
setFooterSuctionState =
|
427
|
+
var _useState33 = useState(false),
|
428
|
+
_useState34 = _slicedToArray(_useState33, 2),
|
429
|
+
footerSuctionState = _useState34[0],
|
430
|
+
setFooterSuctionState = _useState34[1];
|
431
|
+
|
393
432
|
// TODO 获取内容区是否超出一屏(暂时仅支持全家桶)
|
394
433
|
var getFooterSuctionState = function getFooterSuctionState() {
|
395
434
|
if (!footerSuction) {
|
@@ -411,6 +450,7 @@ var ProTable = function ProTable(props) {
|
|
411
450
|
}
|
412
451
|
}
|
413
452
|
};
|
453
|
+
|
414
454
|
// rowSelection 相关
|
415
455
|
var rowSelectionHook = useTableSelection(_objectSpread(_objectSpread({}, propsRowSelection), {}, {
|
416
456
|
// 当初始出现骨架屏的时候,不可选择
|
@@ -441,15 +481,17 @@ var ProTable = function ProTable(props) {
|
|
441
481
|
useEffect(function () {
|
442
482
|
getRowSelection && getRowSelection(rowSelectionHook);
|
443
483
|
}, [rowSelectionHook]);
|
484
|
+
|
444
485
|
// 获取 table 左下角 checkbox 属性
|
445
486
|
function getCheckAllProps() {
|
446
|
-
var
|
447
|
-
|
448
|
-
|
449
|
-
onSelectAll =
|
450
|
-
|
451
|
-
selectedRowKeys =
|
452
|
-
|
487
|
+
var _ref3 = rowSelection,
|
488
|
+
_ref3$onChange = _ref3.onChange,
|
489
|
+
_onChange = _ref3$onChange === void 0 ? function () {} : _ref3$onChange,
|
490
|
+
_ref3$onSelectAll = _ref3.onSelectAll,
|
491
|
+
onSelectAll = _ref3$onSelectAll === void 0 ? function () {} : _ref3$onSelectAll,
|
492
|
+
_ref3$selectedRowKeys = _ref3.selectedRowKeys,
|
493
|
+
selectedRowKeys = _ref3$selectedRowKeys === void 0 ? [] : _ref3$selectedRowKeys,
|
494
|
+
getProps = _ref3.getProps;
|
453
495
|
var dataSource = data;
|
454
496
|
var allRowKeys = dataSource.filter(function (d, i) {
|
455
497
|
var _getProps;
|
@@ -493,12 +535,14 @@ var ProTable = function ProTable(props) {
|
|
493
535
|
setFilteredColumns(columns);
|
494
536
|
(_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$se = _actionRef$current.setState) === null || _actionRef$current$se === void 0 ? void 0 : _actionRef$current$se.call(_actionRef$current, 'filterColumns', columns);
|
495
537
|
}, [propsColumns]);
|
538
|
+
|
496
539
|
// dataSource 受控
|
497
540
|
useEffect(function () {
|
498
541
|
if (propsDataSource) {
|
499
542
|
_setData(propsDataSource);
|
500
543
|
}
|
501
544
|
}, [propsDataSource]);
|
545
|
+
|
502
546
|
// 初始化 ActionRef。
|
503
547
|
initActionRef(actionRef, {
|
504
548
|
getState: function getState() {
|
@@ -518,19 +562,20 @@ var ProTable = function ProTable(props) {
|
|
518
562
|
actionRefCallback[state][name] = fun;
|
519
563
|
},
|
520
564
|
off: function off(name) {
|
521
|
-
actionRefCallback = Object.fromEntries(Object.entries(actionRefCallback).map(function (
|
522
|
-
var
|
523
|
-
k =
|
524
|
-
v =
|
525
|
-
var filterV = Object.fromEntries(Object.entries(v).filter(function (
|
526
|
-
var
|
527
|
-
k =
|
565
|
+
actionRefCallback = Object.fromEntries(Object.entries(actionRefCallback).map(function (_ref4) {
|
566
|
+
var _ref5 = _slicedToArray(_ref4, 2),
|
567
|
+
k = _ref5[0],
|
568
|
+
v = _ref5[1];
|
569
|
+
var filterV = Object.fromEntries(Object.entries(v).filter(function (_ref6) {
|
570
|
+
var _ref7 = _slicedToArray(_ref6, 1),
|
571
|
+
k = _ref7[0];
|
528
572
|
return k !== name;
|
529
573
|
}));
|
530
574
|
return [k, filterV];
|
531
575
|
}));
|
532
576
|
}
|
533
577
|
});
|
578
|
+
|
534
579
|
// 绑定 Actions
|
535
580
|
useActionType(actionRef, {
|
536
581
|
fullScreen: function fullScreen() {
|
@@ -540,6 +585,7 @@ var ProTable = function ProTable(props) {
|
|
540
585
|
setFullscreenState(state);
|
541
586
|
getHeaderHeight(state);
|
542
587
|
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$s = _actionRef$current2.setState) === null || _actionRef$current2$s === void 0 ? void 0 : _actionRef$current2$s.call(_actionRef$current2, 'fullScreenState', state);
|
588
|
+
reGenFilteredColumnsByAutoWidth();
|
543
589
|
return state;
|
544
590
|
},
|
545
591
|
setColumn: function setColumn(newColumns) {
|
@@ -551,10 +597,12 @@ var ProTable = function ProTable(props) {
|
|
551
597
|
if (update) {
|
552
598
|
emit('refreshFilterState', newColumns);
|
553
599
|
}
|
600
|
+
reGenFilteredColumnsByAutoWidth();
|
554
601
|
},
|
555
602
|
size: size,
|
556
603
|
setSize: function setSize(mode) {
|
557
604
|
_setSize(mode);
|
605
|
+
reGenFilteredColumnsByAutoWidth();
|
558
606
|
},
|
559
607
|
refresh: function refresh(params) {
|
560
608
|
// card视角的刷新等于重新请求
|
@@ -660,10 +708,29 @@ var ProTable = function ProTable(props) {
|
|
660
708
|
autoRefreshTimerRef.current = null;
|
661
709
|
}
|
662
710
|
});
|
711
|
+
|
663
712
|
// 将 Actions 绑定到传入的 propsActionRef 中
|
664
713
|
if (propsActionRef) {
|
665
714
|
propsActionRef.current = actionRef.current;
|
666
715
|
}
|
716
|
+
function reGenFilteredColumnsByAutoWidth() {
|
717
|
+
console.log('[ autoWidth ] >', autoWidth);
|
718
|
+
if (!autoWidth) {
|
719
|
+
return;
|
720
|
+
}
|
721
|
+
console.log('[ 表格计算 ] >');
|
722
|
+
console.time('calc width');
|
723
|
+
setShowShadowContainer(true);
|
724
|
+
var authWidthedColumns = genAutoWidthColumns(filteredColumns, shadowContainerRef, data, size, useRowSelection, shadowActionColumnContainerRef);
|
725
|
+
setFilteredColumns(authWidthedColumns);
|
726
|
+
// 移除 shadow dom
|
727
|
+
// setTimeout(() => {
|
728
|
+
// if (document.querySelector('.teamix-pro-table-shadow-container')) {
|
729
|
+
// document.querySelector('.teamix-pro-table-shadow-container')?.remove();
|
730
|
+
// }
|
731
|
+
// }, 0);
|
732
|
+
console.timeEnd('calc width');
|
733
|
+
}
|
667
734
|
function onFormatResult(next) {
|
668
735
|
props.onFormatResult && props.onFormatResult(next);
|
669
736
|
var time = 0;
|
@@ -692,7 +759,9 @@ var ProTable = function ProTable(props) {
|
|
692
759
|
setTotal(total + (next.total || ((_next$data2 = next.data) === null || _next$data2 === void 0 ? void 0 : _next$data2.length)));
|
693
760
|
}
|
694
761
|
setShowSkeleton(false);
|
762
|
+
reGenFilteredColumnsByAutoWidth();
|
695
763
|
}
|
764
|
+
|
696
765
|
// 请求表格数据工具函数
|
697
766
|
var getData = useRequest(function (params) {
|
698
767
|
return _defineProperty({
|
@@ -757,6 +826,7 @@ var ProTable = function ProTable(props) {
|
|
757
826
|
}
|
758
827
|
}
|
759
828
|
});
|
829
|
+
|
760
830
|
// 请求函数
|
761
831
|
function _request(params, noLoading, filterParams, isReset) {
|
762
832
|
var _dataFilterFormRef$cu2, _actionRef$current$ge, _actionRef$current6, _actionRef$current6$g, _objectSpread3;
|
@@ -765,6 +835,7 @@ var ProTable = function ProTable(props) {
|
|
765
835
|
getUrlStateFilter(urlState !== null && urlState !== void 0 ? urlState : {}, actionRef);
|
766
836
|
dataRef.current.flag = false;
|
767
837
|
}
|
838
|
+
|
768
839
|
// 如果没有传 url 且没有 customRequest,直接返回
|
769
840
|
if (!url && !customRequest) {
|
770
841
|
return;
|
@@ -778,6 +849,7 @@ var ProTable = function ProTable(props) {
|
|
778
849
|
var dataFilterParams = filterParams !== null && filterParams !== void 0 ? filterParams : (_dataFilterFormRef$cu2 = dataFilterFormRef.current) === null || _dataFilterFormRef$cu2 === void 0 ? void 0 : _dataFilterFormRef$cu2.values;
|
779
850
|
// 列过滤请求参数
|
780
851
|
var columnsFilterParams = (_actionRef$current$ge = (_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : (_actionRef$current6$g = _actionRef$current6.getFilterRules) === null || _actionRef$current6$g === void 0 ? void 0 : _actionRef$current6$g.call(_actionRef$current6)) !== null && _actionRef$current$ge !== void 0 ? _actionRef$current$ge : {};
|
852
|
+
|
781
853
|
// 格式化后的请求参数
|
782
854
|
var requestData = {};
|
783
855
|
var preParams = _objectSpread(_objectSpread({}, !showPagination ? _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, dataFilterParams), propsParams), sortParams), columnsFilterParams) : _objectSpread(_objectSpread(_objectSpread(_objectSpread((_objectSpread3 = {}, _defineProperty(_objectSpread3, targetPageKey, currentPage), _defineProperty(_objectSpread3, targetPageSizeKey, pageSize), _objectSpread3), dataFilterParams), propsParams), sortParams), columnsFilterParams)), params);
|
@@ -828,9 +900,11 @@ var ProTable = function ProTable(props) {
|
|
828
900
|
_setData([].concat(_toConsumableArray(data), _toConsumableArray(dataRes || [])));
|
829
901
|
setTotal(total + (totalRes || (dataRes === null || dataRes === void 0 ? void 0 : dataRes.length)));
|
830
902
|
}
|
903
|
+
reGenFilteredColumnsByAutoWidth();
|
831
904
|
setShowSkeleton(false);
|
832
905
|
setCustomTableLoading(false);
|
833
906
|
}
|
907
|
+
|
834
908
|
// 重新计算是否需要吸底
|
835
909
|
if (footerSuction) {
|
836
910
|
getFooterSuctionState();
|
@@ -838,6 +912,7 @@ var ProTable = function ProTable(props) {
|
|
838
912
|
if (fixedTableBody) {
|
839
913
|
getHeaderHeight(fullscreenState);
|
840
914
|
}
|
915
|
+
|
841
916
|
// customRequest 中支持 autoRefresh
|
842
917
|
var time = 0;
|
843
918
|
if (autoRefresh) {
|
@@ -866,6 +941,7 @@ var ProTable = function ProTable(props) {
|
|
866
941
|
setSort(nextSort);
|
867
942
|
_request(targetFormatSort(nextSort));
|
868
943
|
}
|
944
|
+
|
869
945
|
// 处理 dataFilter 中的 onFilter、onReset
|
870
946
|
var dataFilter = _objectSpread(_objectSpread({
|
871
947
|
mode: 'inline',
|
@@ -912,6 +988,7 @@ var ProTable = function ProTable(props) {
|
|
912
988
|
}
|
913
989
|
};
|
914
990
|
var renderTable = function renderTable(isFullScreen) {
|
991
|
+
console.log('propsColumns', propsColumns);
|
915
992
|
if (propsColumns) {
|
916
993
|
return /*#__PURE__*/React.createElement("div", {
|
917
994
|
className: classNames('teamix-pro-table-container', className, 'teamix-test-request'),
|
@@ -940,7 +1017,7 @@ var ProTable = function ProTable(props) {
|
|
940
1017
|
autoRefreshProps: autoRefreshProps,
|
941
1018
|
bindUrlProps: bindUrlProps,
|
942
1019
|
bindUrl: bindUrl
|
943
|
-
}), switchViewState === 'table' && /*#__PURE__*/React.createElement(Table.StickyLock,
|
1020
|
+
}), switchViewState === 'table' && /*#__PURE__*/React.createElement(Table.StickyLock, _extends({
|
944
1021
|
hasBorder: false,
|
945
1022
|
dataSource: showSkeleton ? skeletonDataSource : data || props.dataSource,
|
946
1023
|
columns: genProColumnToColumn(filteredColumns, showSkeleton, actionRef, context, dataTeamixSpm, bindUrl, bindUrlProps),
|
@@ -955,10 +1032,11 @@ var ProTable = function ProTable(props) {
|
|
955
1032
|
sort: sort,
|
956
1033
|
primaryKey: primaryKey,
|
957
1034
|
rowSelection: rowSelection,
|
958
|
-
emptyContent: /*#__PURE__*/React.createElement(EmptyContent,
|
1035
|
+
emptyContent: /*#__PURE__*/React.createElement(EmptyContent, emptyProps),
|
959
1036
|
sortIcons: getTableSortIcons(),
|
960
1037
|
fixedHeader: fullscreenState || fixedTableBody,
|
961
1038
|
maxBodyHeight: "calc(100vh - ".concat(headerHeight, "px)")
|
1039
|
+
// 过滤出可以传到 Table 的 Props
|
962
1040
|
}, pickProps(getTableProps(), otherProps))), switchViewState === 'card' && /*#__PURE__*/React.createElement(CardView, {
|
963
1041
|
dataSource: showSkeleton ? skeletonDataSource : data || props.dataSource,
|
964
1042
|
showSkeleton: showSkeleton,
|
@@ -968,18 +1046,20 @@ var ProTable = function ProTable(props) {
|
|
968
1046
|
scrollHeight: fullscreenState || fixedTableBody ? "calc(100vh - ".concat(headerHeight, "px)") : undefined,
|
969
1047
|
actionRef: actionRef,
|
970
1048
|
context: context,
|
971
|
-
columns: genProColumnToColumn(filteredColumns, showSkeleton, actionRef, context)
|
1049
|
+
columns: genProColumnToColumn(filteredColumns, showSkeleton, actionRef, context),
|
1050
|
+
emptyProps: emptyProps,
|
1051
|
+
emptyContent: otherProps === null || otherProps === void 0 ? void 0 : otherProps.emptyContent
|
972
1052
|
}));
|
973
1053
|
} else {
|
974
1054
|
// 不传 columns 直接返回原始 Table
|
975
|
-
return /*#__PURE__*/React.createElement(Table,
|
1055
|
+
return /*#__PURE__*/React.createElement(Table, _extends({
|
976
1056
|
className: cls()
|
977
1057
|
}, pickProps(getTableProps(), otherProps)));
|
978
1058
|
}
|
979
1059
|
};
|
980
1060
|
var renderFooterAction = function renderFooterAction() {
|
981
|
-
var
|
982
|
-
if (_typeof(footerAction) === 'object' && (footerAction === null || footerAction === void 0 ? void 0 : (
|
1061
|
+
var _actions;
|
1062
|
+
if (_typeof(footerAction) === 'object' && (footerAction === null || footerAction === void 0 ? void 0 : (_actions = footerAction.actions) === null || _actions === void 0 ? void 0 : _actions.length) >= 0) {
|
983
1063
|
// 默认 context
|
984
1064
|
var defaultContext = {
|
985
1065
|
action: actionRef.current,
|
@@ -996,7 +1076,7 @@ var ProTable = function ProTable(props) {
|
|
996
1076
|
});
|
997
1077
|
return /*#__PURE__*/React.createElement("div", {
|
998
1078
|
className: cls('footer-action')
|
999
|
-
}, /*#__PURE__*/React.createElement(ProActionGroup,
|
1079
|
+
}, /*#__PURE__*/React.createElement(ProActionGroup, _extends({}, targetFooterActions, {
|
1000
1080
|
context: _objectSpread(_objectSpread({}, defaultContext), targetFooterActions === null || targetFooterActions === void 0 ? void 0 : targetFooterActions.context),
|
1001
1081
|
"data-teamix-spm": dataTeamixSpm ? "".concat(dataTeamixSpm, "-footerAction") : undefined
|
1002
1082
|
})));
|
@@ -1033,7 +1113,7 @@ var ProTable = function ProTable(props) {
|
|
1033
1113
|
} else {
|
1034
1114
|
return /*#__PURE__*/React.createElement("div", {
|
1035
1115
|
className: cls('footer-left-wrapper')
|
1036
|
-
}, /*#__PURE__*/React.createElement(React.Fragment, null, rowSelection.mode !== 'single' && /*#__PURE__*/React.createElement(Checkbox,
|
1116
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null, rowSelection.mode !== 'single' && /*#__PURE__*/React.createElement(Checkbox, _extends({
|
1037
1117
|
className: cls("footer-checkbox-".concat(size))
|
1038
1118
|
}, getCheckAllProps())), footerAction && renderFooterAction(), /*#__PURE__*/React.createElement("span", {
|
1039
1119
|
className: cls('selected-msg')
|
@@ -1055,9 +1135,9 @@ var ProTable = function ProTable(props) {
|
|
1055
1135
|
}
|
1056
1136
|
if (showPagination && switchViewState === 'table' || (cardViewProps === null || cardViewProps === void 0 ? void 0 : cardViewProps.useTablePagination) && switchViewState === 'card') {
|
1057
1137
|
var _props$paginationProp3;
|
1058
|
-
var
|
1059
|
-
onPaginationPropsChange =
|
1060
|
-
othersPaginationProps = _objectWithoutProperties(
|
1138
|
+
var _ref9 = (_props$paginationProp3 = props === null || props === void 0 ? void 0 : props.paginationProps) !== null && _props$paginationProp3 !== void 0 ? _props$paginationProp3 : {},
|
1139
|
+
onPaginationPropsChange = _ref9.onChange,
|
1140
|
+
othersPaginationProps = _objectWithoutProperties(_ref9, _excluded2);
|
1061
1141
|
return /*#__PURE__*/React.createElement("div", {
|
1062
1142
|
className: cls('footer', {
|
1063
1143
|
'footer-has-rowSelection': rowSelection,
|
@@ -1065,16 +1145,17 @@ var ProTable = function ProTable(props) {
|
|
1065
1145
|
})
|
1066
1146
|
}, renderRowSelection(), /*#__PURE__*/React.createElement("div", {
|
1067
1147
|
className: cls('footer-right-wrapper')
|
1068
|
-
}, showSkeleton ? /*#__PURE__*/React.createElement(Skeleton.Footer.Pagination, null) : /*#__PURE__*/React.createElement(React.Fragment, null, data.length > 0 && /*#__PURE__*/React.createElement(Pagination,
|
1148
|
+
}, showSkeleton ? /*#__PURE__*/React.createElement(Skeleton.Footer.Pagination, null) : /*#__PURE__*/React.createElement(React.Fragment, null, data.length > 0 && /*#__PURE__*/React.createElement(Pagination, _extends({
|
1069
1149
|
className: cls('pagination'),
|
1070
1150
|
onChange: function onChange(number, e) {
|
1071
1151
|
onChangePagination(number);
|
1072
1152
|
onPaginationPropsChange === null || onPaginationPropsChange === void 0 ? void 0 : onPaginationPropsChange(number, e);
|
1073
1153
|
},
|
1074
1154
|
total: total,
|
1075
|
-
responsivePaginationType: responsivePaginationType
|
1155
|
+
responsivePaginationType: responsivePaginationType
|
1076
1156
|
// shape="arrow-only"
|
1077
1157
|
// pageSizePosition="end"
|
1158
|
+
,
|
1078
1159
|
totalRender: function totalRender(total) {
|
1079
1160
|
return getMessage('total', {
|
1080
1161
|
total: new Intl.NumberFormat().format(total)
|
@@ -1099,6 +1180,7 @@ var ProTable = function ProTable(props) {
|
|
1099
1180
|
}, showSkeleton ? /*#__PURE__*/React.createElement(Skeleton.Footer.Pagination, null) : footer));
|
1100
1181
|
}
|
1101
1182
|
};
|
1183
|
+
|
1102
1184
|
// 判断是否需要吸底
|
1103
1185
|
var fixFooterState = useMemo(function () {
|
1104
1186
|
if (fullscreenState) {
|
@@ -1122,8 +1204,13 @@ var ProTable = function ProTable(props) {
|
|
1122
1204
|
fullscreen: isFullScreen
|
1123
1205
|
// 'footer-suction': footerSuctionState && footerSuction,
|
1124
1206
|
}),
|
1207
|
+
|
1125
1208
|
ref: tableRef
|
1126
|
-
},
|
1209
|
+
}, showShadowContainer && shadowContainer({
|
1210
|
+
columns: filteredColumns,
|
1211
|
+
data: data,
|
1212
|
+
shadowContainerRef: shadowContainerRef
|
1213
|
+
}), hasActionColumn && shadowActionColumnContainer(filteredColumns, shadowActionColumnContainerRef), renderTable(isFullScreen), fixFooterState && /*#__PURE__*/React.createElement(ProPageContainer.FixedFooter, null, renderFooter()), !fixFooterState && renderFooter());
|
1127
1214
|
});
|
1128
1215
|
};
|
1129
1216
|
export default ProTable;
|
package/es/table/index.scss
CHANGED
@@ -77,6 +77,32 @@ $fullscreenPadding: 24px;
|
|
77
77
|
transition: all 0.1s;
|
78
78
|
}
|
79
79
|
}
|
80
|
+
&-shadow-container {
|
81
|
+
overflow: hidden;
|
82
|
+
position: absolute;
|
83
|
+
right: 0;
|
84
|
+
left: 0;
|
85
|
+
top: 0;
|
86
|
+
visibility: hidden;
|
87
|
+
pointer-events: none;
|
88
|
+
}
|
89
|
+
&-shadow-container-columns {
|
90
|
+
display: flex;
|
91
|
+
>* {
|
92
|
+
flex-shrink: 0;
|
93
|
+
}
|
94
|
+
}
|
95
|
+
&-action-column-shadow-container {
|
96
|
+
overflow: hidden;
|
97
|
+
position: absolute;
|
98
|
+
right: 0;
|
99
|
+
left: 0;
|
100
|
+
top: 0;
|
101
|
+
visibility: hidden;
|
102
|
+
pointer-events: none;
|
103
|
+
display: flex;
|
104
|
+
}
|
105
|
+
|
80
106
|
// sort icon
|
81
107
|
.next-table-sort.next-table-header-icon {
|
82
108
|
line-height: 16px;
|