wt-enjoy-link-antd-repack 4.1.50 → 4.1.52
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/esm/component/BiuAButton/index.d.ts +4 -4
- package/dist/esm/component/BiuAForm/index.d.ts +1 -1
- package/dist/esm/component/BiuCustomTable/index.d.ts +1 -0
- package/dist/esm/component/BiuCustomTable/index.js +19 -18
- package/dist/esm/component/BiuField/component/orderTypeSelect.d.ts +1 -1
- package/dist/esm/component/BiuTableSelect/index.d.ts +1 -1
- package/dist/esm/component/BiuTableSelect/index.js +13 -5
- package/dist/esm/component/index.d.ts +0 -1
- package/dist/esm/component/index.js +1 -2
- package/package.json +1 -1
- package/dist/esm/component/BiuVirtualTable/index.d.ts +0 -13
- package/dist/esm/component/BiuVirtualTable/index.js +0 -162
@@ -3,16 +3,16 @@ export declare const BiuAButton: React.MemoExoticComponent<import("styled-compon
|
|
3
3
|
href: string;
|
4
4
|
target?: string | undefined;
|
5
5
|
onClick?: React.MouseEventHandler<HTMLElement> | undefined;
|
6
|
-
} & import("antd/lib/button/button").BaseButtonProps & Omit<React.AnchorHTMLAttributes<any>, "
|
6
|
+
} & import("antd/lib/button/button").BaseButtonProps & Omit<React.AnchorHTMLAttributes<any>, "type" | "onClick"> & {
|
7
7
|
htmlType?: "button" | "submit" | "reset" | undefined;
|
8
8
|
onClick?: React.MouseEventHandler<HTMLElement> | undefined;
|
9
|
-
} & Omit<React.ButtonHTMLAttributes<any>, "
|
9
|
+
} & Omit<React.ButtonHTMLAttributes<any>, "type" | "onClick">> & React.RefAttributes<HTMLElement>, never>> & Omit<React.ForwardRefExoticComponent<Partial<{
|
10
10
|
href: string;
|
11
11
|
target?: string | undefined;
|
12
12
|
onClick?: React.MouseEventHandler<HTMLElement> | undefined;
|
13
|
-
} & import("antd/lib/button/button").BaseButtonProps & Omit<React.AnchorHTMLAttributes<any>, "
|
13
|
+
} & import("antd/lib/button/button").BaseButtonProps & Omit<React.AnchorHTMLAttributes<any>, "type" | "onClick"> & {
|
14
14
|
htmlType?: "button" | "submit" | "reset" | undefined;
|
15
15
|
onClick?: React.MouseEventHandler<HTMLElement> | undefined;
|
16
|
-
} & Omit<React.ButtonHTMLAttributes<any>, "
|
16
|
+
} & Omit<React.ButtonHTMLAttributes<any>, "type" | "onClick">> & React.RefAttributes<HTMLElement>> & {
|
17
17
|
Group: React.FC<import("antd/lib/button").ButtonGroupProps>;
|
18
18
|
}, keyof React.Component<any, {}, any>>>;
|
@@ -2,6 +2,6 @@ import React from 'react';
|
|
2
2
|
export { Form as BiuAForm } from 'antd';
|
3
3
|
export declare const BiuAFormItem: React.MemoExoticComponent<(<Values = any>(props: import("antd").FormItemProps<Values>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) & {
|
4
4
|
useStatus: () => {
|
5
|
-
status?: "" | "
|
5
|
+
status?: "" | "warning" | "error" | "success" | "validating" | undefined;
|
6
6
|
};
|
7
7
|
}>;
|
@@ -10,5 +10,6 @@ export declare const BiuCustomTable: React.MemoExoticComponent<React.ForwardRefE
|
|
10
10
|
suppWidth?: number | undefined;
|
11
11
|
tableH?: number | undefined;
|
12
12
|
virtual?: boolean | undefined;
|
13
|
+
sortable?: boolean | undefined;
|
13
14
|
columns?: BiuColumnType[] | undefined;
|
14
15
|
} & Omit<TableProps<any>, "columns"> & React.RefAttributes<unknown>>>;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
2
|
-
var _excluded = ["cardtitle", "tableW", "suppWidth", "tableH", "columns",
|
2
|
+
var _excluded = ["cardtitle", "tableW", "suppWidth", "tableH", "columns"],
|
3
|
+
_excluded2 = ["dataIndex", "width", "render"];
|
3
4
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
4
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
5
6
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
@@ -8,7 +9,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
8
9
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
9
10
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
10
11
|
import React, { forwardRef, useMemo } from 'react';
|
11
|
-
import { BiuDivider,
|
12
|
+
import { BiuDivider, BiuResizeTable } from "./..";
|
12
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
13
14
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
14
15
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
@@ -30,8 +31,6 @@ export var BiuCustomTable = /*#__PURE__*/React.memo( /*#__PURE__*/forwardRef(fun
|
|
30
31
|
tableH = props.tableH,
|
31
32
|
_props$columns = props.columns,
|
32
33
|
columns = _props$columns === void 0 ? [] : _props$columns,
|
33
|
-
_props$virtual = props.virtual,
|
34
|
-
virtual = _props$virtual === void 0 ? false : _props$virtual,
|
35
34
|
tableProps = _objectWithoutProperties(props, _excluded);
|
36
35
|
var scrollX = useMemo(function () {
|
37
36
|
var scrollWidth = calcColsTotalWidth(columns, suppWidth);
|
@@ -49,28 +48,30 @@ export var BiuCustomTable = /*#__PURE__*/React.memo( /*#__PURE__*/forwardRef(fun
|
|
49
48
|
pagination: false,
|
50
49
|
columns: columns.filter(function (col) {
|
51
50
|
return !col.noShow;
|
52
|
-
}).map(function (
|
51
|
+
}).map(function (_ref) {
|
52
|
+
var dataIndex = _ref.dataIndex,
|
53
|
+
_ref$width = _ref.width,
|
54
|
+
width = _ref$width === void 0 ? 180 : _ref$width,
|
55
|
+
_render = _ref.render,
|
56
|
+
restColumn = _objectWithoutProperties(_ref, _excluded2);
|
53
57
|
return _objectSpread(_objectSpread({
|
54
|
-
key:
|
55
|
-
|
56
|
-
|
58
|
+
key: dataIndex,
|
59
|
+
dataIndex: dataIndex
|
60
|
+
}, restColumn), {}, {
|
61
|
+
width: width,
|
57
62
|
render: function render(text, record, index) {
|
58
|
-
return
|
63
|
+
return _render ? _render(text, record, index) : text;
|
59
64
|
}
|
60
65
|
});
|
61
66
|
})
|
62
67
|
};
|
63
68
|
}, [columns, scrollX, tableH]);
|
64
|
-
var myTable = virtual ? /*#__PURE__*/_jsx(BiuVirtualTable, _objectSpread(_objectSpread({
|
65
|
-
ref: ref
|
66
|
-
}, tableProps), defaultTableProps)) : /*#__PURE__*/_jsx(BiuResizeTable, _objectSpread(_objectSpread({
|
67
|
-
ref: ref,
|
68
|
-
isCellEdit: true
|
69
|
-
}, defaultTableProps), tableProps));
|
70
|
-
if (cardtitle === undefined || cardtitle === null) return myTable;
|
71
69
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
72
|
-
children: [/*#__PURE__*/_jsx(BiuDivider, {
|
70
|
+
children: [cardtitle && /*#__PURE__*/_jsx(BiuDivider, {
|
73
71
|
children: cardtitle
|
74
|
-
}),
|
72
|
+
}), /*#__PURE__*/_jsx(BiuResizeTable, _objectSpread(_objectSpread({
|
73
|
+
ref: ref,
|
74
|
+
isCellEdit: true
|
75
|
+
}, defaultTableProps), tableProps))]
|
75
76
|
});
|
76
77
|
}));
|
@@ -9,7 +9,7 @@ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponen
|
|
9
9
|
/**
|
10
10
|
* 0:入库 1:出库 2:移库 3:冻结 4:调整 5:属性变更
|
11
11
|
*/
|
12
|
-
orderType: 0 |
|
12
|
+
orderType: 0 | 3 | 1 | 4 | 2 | 5;
|
13
13
|
isFirstLoad: boolean;
|
14
14
|
} & SelectProps<any, import("antd/lib/select").DefaultOptionType> & React.RefAttributes<unknown>>>;
|
15
15
|
export default _default;
|
@@ -46,4 +46,4 @@ export declare const BiuTableSelect: React.MemoExoticComponent<React.ForwardRefE
|
|
46
46
|
* 转换下绑定到组件上的数据源
|
47
47
|
*/
|
48
48
|
dataOption?: ((value: Record<string, any>) => Record<string, any>[]) | undefined;
|
49
|
-
} & Pick<SelectProps<any, import("antd/lib/select").DefaultOptionType>, "showSearch" | "allowClear"> & Pick<TableProps<any>, "
|
49
|
+
} & Pick<SelectProps<any, import("antd/lib/select").DefaultOptionType>, "showSearch" | "allowClear"> & Pick<TableProps<any>, "dataSource" | "onRow"> & React.RefAttributes<unknown>>>;
|
@@ -21,9 +21,9 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
21
21
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
22
22
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
23
23
|
import { SearchOutlined } from '@ant-design/icons';
|
24
|
-
import { useBoolean, useControllableValue } from 'ahooks';
|
24
|
+
import { useBoolean, useControllableValue, useWhyDidYouUpdate } from 'ahooks';
|
25
25
|
import { Divider, Space, Typography } from 'antd';
|
26
|
-
import React, { forwardRef, useCallback,
|
26
|
+
import React, { forwardRef, useCallback, useLayoutEffect, useMemo, useState } from 'react';
|
27
27
|
import { BiuASelect, BiuASelectOption } from "../BiuASelect";
|
28
28
|
import { request } from "../../package";
|
29
29
|
|
@@ -71,7 +71,9 @@ export var BiuTableSelect = /*#__PURE__*/React.memo( /*#__PURE__*/forwardRef(fun
|
|
71
71
|
setOptionRows = _useState2[1];
|
72
72
|
var isSearchDeatil = useMemo(function () {
|
73
73
|
return (!optionRows || optionRows.length <= 0) && !!state;
|
74
|
-
|
74
|
+
|
75
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
76
|
+
}, [state]);
|
75
77
|
var fetchData = useCallback( /*#__PURE__*/function () {
|
76
78
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(reqObj) {
|
77
79
|
var result, formatResult;
|
@@ -105,11 +107,17 @@ export var BiuTableSelect = /*#__PURE__*/React.memo( /*#__PURE__*/forwardRef(fun
|
|
105
107
|
return _ref.apply(this, arguments);
|
106
108
|
};
|
107
109
|
}(), [dataOption, interfaceName, isSearchDeatil, onChangeData, requestConfig, rowKey, setFalse, setTrue, state]);
|
108
|
-
|
110
|
+
useLayoutEffect(function () {
|
109
111
|
if (isOnReady && isOnReady(queryData) && queryData) {
|
110
112
|
fetchData(queryData);
|
111
113
|
}
|
112
|
-
|
114
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
115
|
+
}, [queryData]);
|
116
|
+
useWhyDidYouUpdate('BiuTableSelect', {
|
117
|
+
isOnReady: isOnReady,
|
118
|
+
queryData: queryData,
|
119
|
+
fetchData: fetchData
|
120
|
+
});
|
113
121
|
var columnsConvert = useMemo(function () {
|
114
122
|
return columns.reduce(function (obj, current) {
|
115
123
|
return {
|
package/package.json
CHANGED
@@ -1,13 +0,0 @@
|
|
1
|
-
import type { TableProps } from 'antd';
|
2
|
-
import React from 'react';
|
3
|
-
import type { BiuColumnType } from "..";
|
4
|
-
export interface BiuVirtualTablePropsType {
|
5
|
-
columns: (Omit<BiuColumnType, 'width'> & {
|
6
|
-
width: number;
|
7
|
-
})[];
|
8
|
-
scroll: {
|
9
|
-
x: number;
|
10
|
-
y: number;
|
11
|
-
};
|
12
|
-
}
|
13
|
-
export declare const BiuVirtualTable: React.MemoExoticComponent<React.ForwardRefExoticComponent<BiuVirtualTablePropsType & Omit<TableProps<any>, "columns" | "scroll"> & React.RefAttributes<unknown>>>;
|
@@ -1,162 +0,0 @@
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
2
|
-
var _excluded = ["columns", "scroll", "className"];
|
3
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
4
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
5
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
6
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
7
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
8
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
9
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
10
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
11
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
12
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
13
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
14
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
15
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
16
|
-
import { useSize } from 'ahooks';
|
17
|
-
import { Table } from 'antd';
|
18
|
-
import classNames from 'classnames';
|
19
|
-
import React, { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
20
|
-
import { VariableSizeGrid } from 'react-window';
|
21
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
22
|
-
var VariableSizeGridJSX = VariableSizeGrid;
|
23
|
-
export var BiuVirtualTable = /*#__PURE__*/React.memo( /*#__PURE__*/forwardRef(function (props, parentRef) {
|
24
|
-
var columns = props.columns,
|
25
|
-
scroll = props.scroll,
|
26
|
-
className = props.className,
|
27
|
-
restProps = _objectWithoutProperties(props, _excluded);
|
28
|
-
var domRef = useRef(null);
|
29
|
-
var gridRef = useRef();
|
30
|
-
var domSize = useSize(domRef);
|
31
|
-
var _ref = domSize || {
|
32
|
-
width: 0
|
33
|
-
},
|
34
|
-
_ref$width = _ref.width,
|
35
|
-
domWidth = _ref$width === void 0 ? 0 : _ref$width;
|
36
|
-
var mergedColumns = useMemo(function () {
|
37
|
-
var widthColumnCount = columns.filter(function (_ref2) {
|
38
|
-
var width = _ref2.width;
|
39
|
-
return !width;
|
40
|
-
}).length;
|
41
|
-
var widthColumn = columns.reduce(function (sumWidth, _ref3) {
|
42
|
-
var width = _ref3.width;
|
43
|
-
return sumWidth + (width || 0);
|
44
|
-
}, 0);
|
45
|
-
return columns.map(function (column) {
|
46
|
-
if (column.width) {
|
47
|
-
if (widthColumn < domWidth && widthColumn > 0 && typeof column.width === 'number') {
|
48
|
-
return _objectSpread(_objectSpread({}, column), {}, {
|
49
|
-
width: column.width / widthColumn * domWidth
|
50
|
-
});
|
51
|
-
}
|
52
|
-
return column;
|
53
|
-
}
|
54
|
-
return _objectSpread(_objectSpread({}, column), {}, {
|
55
|
-
width: Math.floor((domWidth - widthColumn) / widthColumnCount)
|
56
|
-
});
|
57
|
-
});
|
58
|
-
}, [columns, domWidth]);
|
59
|
-
var _useState = useState(function () {
|
60
|
-
var obj = {};
|
61
|
-
Object.defineProperty(obj, 'scrollLeft', {
|
62
|
-
get: function get() {
|
63
|
-
return null;
|
64
|
-
},
|
65
|
-
set: function set(scrollLeft) {
|
66
|
-
if (gridRef.current) {
|
67
|
-
gridRef.current.scrollTo({
|
68
|
-
scrollLeft: scrollLeft
|
69
|
-
});
|
70
|
-
}
|
71
|
-
}
|
72
|
-
});
|
73
|
-
return obj;
|
74
|
-
}),
|
75
|
-
_useState2 = _slicedToArray(_useState, 1),
|
76
|
-
connectObject = _useState2[0];
|
77
|
-
var resetVirtualGrid = useCallback(function () {
|
78
|
-
if (gridRef.current && domSize !== null && domSize !== void 0 && domSize.width) {
|
79
|
-
gridRef.current.resetAfterIndices({
|
80
|
-
columnIndex: 0,
|
81
|
-
shouldForceUpdate: false
|
82
|
-
});
|
83
|
-
}
|
84
|
-
}, [domSize === null || domSize === void 0 ? void 0 : domSize.width]);
|
85
|
-
useEffect(function () {
|
86
|
-
return resetVirtualGrid;
|
87
|
-
}, [resetVirtualGrid]);
|
88
|
-
var renderVirtualListRow = useCallback(function (columnIndex, rawData, rowIndex) {
|
89
|
-
var columnRender = mergedColumns[columnIndex].render;
|
90
|
-
var dataIndex = mergedColumns[columnIndex].dataIndex;
|
91
|
-
var field = '';
|
92
|
-
if (Array.isArray(dataIndex) && dataIndex.length <= 0 || !dataIndex) return null;
|
93
|
-
if (Array.isArray(dataIndex)) {
|
94
|
-
;
|
95
|
-
var _ref4 = dataIndex;
|
96
|
-
var _ref5 = _slicedToArray(_ref4, 1);
|
97
|
-
field = _ref5[0];
|
98
|
-
} else {
|
99
|
-
field = dataIndex;
|
100
|
-
}
|
101
|
-
if (columnRender) {
|
102
|
-
return columnRender(rawData[rowIndex][field], rawData[rowIndex], rowIndex);
|
103
|
-
}
|
104
|
-
return rawData[rowIndex][field];
|
105
|
-
}, [mergedColumns]);
|
106
|
-
var renderVirtualList = useCallback(function (rawData, _ref6, rowClassName) {
|
107
|
-
var scrollbarSize = _ref6.scrollbarSize,
|
108
|
-
ref = _ref6.ref,
|
109
|
-
_onScroll = _ref6.onScroll;
|
110
|
-
ref.current = connectObject;
|
111
|
-
return /*#__PURE__*/_jsx(VariableSizeGridJSX, {
|
112
|
-
ref: gridRef,
|
113
|
-
className: "virtual-grid",
|
114
|
-
columnCount: mergedColumns.length,
|
115
|
-
columnWidth: function columnWidth(index) {
|
116
|
-
var width = mergedColumns[index].width;
|
117
|
-
return index === mergedColumns.length - 1 ? width - scrollbarSize - 1 : width;
|
118
|
-
},
|
119
|
-
height: scroll.y,
|
120
|
-
rowCount: rawData.length,
|
121
|
-
rowHeight: function rowHeight() {
|
122
|
-
return 38;
|
123
|
-
},
|
124
|
-
width: domWidth,
|
125
|
-
onScroll: function onScroll(_ref7) {
|
126
|
-
var scrollLeft = _ref7.scrollLeft;
|
127
|
-
_onScroll({
|
128
|
-
scrollLeft: scrollLeft
|
129
|
-
});
|
130
|
-
},
|
131
|
-
children: function children(_ref8) {
|
132
|
-
var columnIndex = _ref8.columnIndex,
|
133
|
-
rowIndex = _ref8.rowIndex,
|
134
|
-
style = _ref8.style;
|
135
|
-
var rowCName = rowClassName ? rowClassName(rawData[rowIndex], rowIndex) : '';
|
136
|
-
return /*#__PURE__*/_jsx("div", {
|
137
|
-
className: classNames('virtual-table-cell', rowCName, {
|
138
|
-
'virtual-table-cell-last': columnIndex === mergedColumns.length - 1
|
139
|
-
}),
|
140
|
-
style: style,
|
141
|
-
children: renderVirtualListRow(columnIndex, rawData, rowIndex)
|
142
|
-
});
|
143
|
-
}
|
144
|
-
});
|
145
|
-
}, [connectObject, domWidth, mergedColumns, renderVirtualListRow, scroll.y]);
|
146
|
-
return /*#__PURE__*/_jsx("div", {
|
147
|
-
ref: domRef,
|
148
|
-
children: /*#__PURE__*/_jsx(Table, _objectSpread(_objectSpread({
|
149
|
-
ref: parentRef
|
150
|
-
}, restProps), {}, {
|
151
|
-
scroll: scroll,
|
152
|
-
className: classNames(className, 'virtual-table'),
|
153
|
-
columns: mergedColumns,
|
154
|
-
pagination: false,
|
155
|
-
components: {
|
156
|
-
body: function body(rowData, row) {
|
157
|
-
return renderVirtualList(rowData, row, restProps.rowClassName);
|
158
|
-
}
|
159
|
-
}
|
160
|
-
}))
|
161
|
-
});
|
162
|
-
}));
|