@ucloud-fe/react-components 1.3.11 → 1.3.15
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/CHANGELOG.md +28 -0
- package/dist/main.min.js +4 -4
- package/lib/components/Table/DragWrap.d.ts +2 -2
- package/lib/components/Table/DragWrap.js +2 -2
- package/lib/components/Table/TableRow.js +11 -14
- package/lib/components/Tabs/Pane.d.ts +1 -1
- package/lib/components/Tabs/Pane.js +2 -1
- package/lib/libs/rc-table/ExpandableTable.js +1 -0
- package/lib/libs/rc-table/Table.d.ts +13 -1
- package/lib/libs/rc-table/Table.js +12 -11
- package/package.json +1 -2
|
@@ -23,7 +23,7 @@ declare const DragContext: React.Context<{
|
|
|
23
23
|
onDrop: (e: any) => void;
|
|
24
24
|
} | undefined;
|
|
25
25
|
}>;
|
|
26
|
-
declare const DragWrap: ({ children, draggable, ...events }: {
|
|
26
|
+
declare const DragWrap: React.MemoExoticComponent<({ children, draggable, ...events }: {
|
|
27
27
|
onDragStart?: ((source: Element) => void) | undefined;
|
|
28
28
|
onDragEnter?: ((source: Element, target: Element) => void) | undefined;
|
|
29
29
|
onDragOver?: ((source: Element, target: Element) => void) | undefined;
|
|
@@ -37,6 +37,6 @@ declare const DragWrap: ({ children, draggable, ...events }: {
|
|
|
37
37
|
} & {
|
|
38
38
|
children: ReactNode;
|
|
39
39
|
draggable: boolean;
|
|
40
|
-
}) => JSX.Element
|
|
40
|
+
}) => JSX.Element>;
|
|
41
41
|
export { DragContext };
|
|
42
42
|
export default DragWrap;
|
|
@@ -36,7 +36,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
36
36
|
var DragContext = /*#__PURE__*/(0, _react.createContext)({});
|
|
37
37
|
exports.DragContext = DragContext;
|
|
38
38
|
|
|
39
|
-
var DragWrap = function
|
|
39
|
+
var DragWrap = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
40
40
|
(0, _newArrowCheck2.default)(this, _this);
|
|
41
41
|
var children = _ref.children,
|
|
42
42
|
draggable = _ref.draggable,
|
|
@@ -58,7 +58,7 @@ var DragWrap = function DragWrap(_ref) {
|
|
|
58
58
|
draggable: draggable
|
|
59
59
|
}
|
|
60
60
|
}, children);
|
|
61
|
-
}.bind(void 0);
|
|
61
|
+
}.bind(void 0));
|
|
62
62
|
|
|
63
63
|
var _default = DragWrap;
|
|
64
64
|
exports.default = _default;
|
|
@@ -11,12 +11,12 @@ exports.default = void 0;
|
|
|
11
11
|
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
13
|
|
|
14
|
+
var _newArrowCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/newArrowCheck"));
|
|
15
|
+
|
|
14
16
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
17
|
|
|
16
18
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
17
19
|
|
|
18
|
-
var _newArrowCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/newArrowCheck"));
|
|
19
|
-
|
|
20
20
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
21
21
|
|
|
22
22
|
var _react = _interopRequireWildcard(require("react"));
|
|
@@ -25,18 +25,17 @@ var _Popover = _interopRequireDefault(require("../../components/Popover"));
|
|
|
25
25
|
|
|
26
26
|
var _DragWrap = require("./DragWrap");
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _this2 = void 0;
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _excluded = ["record", "contextMenu"];
|
|
31
31
|
|
|
32
32
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
33
33
|
|
|
34
34
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
35
35
|
|
|
36
|
-
var TableRowWithContextMenu = function TableRowWithContextMenu(_ref) {
|
|
37
|
-
var
|
|
36
|
+
var TableRowWithContextMenu = /*#__PURE__*/_react.default.memo(function TableRowWithContextMenu(_ref) {
|
|
37
|
+
var _this = this;
|
|
38
38
|
|
|
39
|
-
(0, _newArrowCheck2.default)(this, _this);
|
|
40
39
|
var record = _ref.record,
|
|
41
40
|
contextMenu = _ref.contextMenu,
|
|
42
41
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
@@ -47,7 +46,7 @@ var TableRowWithContextMenu = function TableRowWithContextMenu(_ref) {
|
|
|
47
46
|
setContextMenuVisible = _useState2[1];
|
|
48
47
|
|
|
49
48
|
var hideContextMenu = (0, _react.useCallback)(function () {
|
|
50
|
-
(0, _newArrowCheck2.default)(this,
|
|
49
|
+
(0, _newArrowCheck2.default)(this, _this);
|
|
51
50
|
setContextMenuVisible(false);
|
|
52
51
|
}.bind(this), []);
|
|
53
52
|
|
|
@@ -64,11 +63,9 @@ var TableRowWithContextMenu = function TableRowWithContextMenu(_ref) {
|
|
|
64
63
|
}
|
|
65
64
|
|
|
66
65
|
return /*#__PURE__*/_react.default.createElement("tr", rest);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
var TableRowWithDrag = function TableRowWithDrag(props) {
|
|
70
|
-
(0, _newArrowCheck2.default)(this, _this);
|
|
66
|
+
});
|
|
71
67
|
|
|
68
|
+
var TableRowWithDrag = /*#__PURE__*/_react.default.memo(function TableRowWithDrag(props) {
|
|
72
69
|
var _useContext = (0, _react.useContext)(_DragWrap.DragContext),
|
|
73
70
|
dragProps = _useContext.dragProps,
|
|
74
71
|
dropProps = _useContext.dropProps;
|
|
@@ -76,10 +73,10 @@ var TableRowWithDrag = function TableRowWithDrag(props) {
|
|
|
76
73
|
return /*#__PURE__*/_react.default.createElement(TableRowWithContextMenu, (0, _extends2.default)({}, props, dragProps, dropProps, {
|
|
77
74
|
draggable: false
|
|
78
75
|
}));
|
|
79
|
-
}
|
|
76
|
+
});
|
|
80
77
|
|
|
81
78
|
var TableRow = function TableRow(_ref2) {
|
|
82
|
-
(0, _newArrowCheck2.default)(this,
|
|
79
|
+
(0, _newArrowCheck2.default)(this, _this2);
|
|
83
80
|
var restProps = (0, _extends2.default)({}, _ref2);
|
|
84
81
|
|
|
85
82
|
var _useContext2 = (0, _react.useContext)(_DragWrap.DragContext),
|
|
@@ -26,5 +26,5 @@ export interface DefinedTabPaneProps {
|
|
|
26
26
|
tabKey?: string;
|
|
27
27
|
}
|
|
28
28
|
export declare type TabPaneProps = DefinedTabPaneProps & Omit<HTMLAttributes<HTMLDivElement>, keyof DefinedTabPaneProps>;
|
|
29
|
-
declare const _default: React.MemoExoticComponent<({ className, active, destroyInactiveTabPane, forceRender, placeholder, children, tabKey, ...rest }: TabPaneProps) => JSX.Element>;
|
|
29
|
+
declare const _default: React.MemoExoticComponent<({ className, active, destroyInactiveTabPane, forceRender, placeholder, children, tabKey, tab, ...rest }: TabPaneProps) => JSX.Element>;
|
|
30
30
|
export default _default;
|
|
@@ -23,7 +23,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
23
23
|
|
|
24
24
|
var _style = require("./style");
|
|
25
25
|
|
|
26
|
-
var _excluded = ["className", "active", "destroyInactiveTabPane", "forceRender", "placeholder", "children", "tabKey"];
|
|
26
|
+
var _excluded = ["className", "active", "destroyInactiveTabPane", "forceRender", "placeholder", "children", "tabKey", "tab"];
|
|
27
27
|
|
|
28
28
|
var _this = void 0;
|
|
29
29
|
|
|
@@ -42,6 +42,7 @@ var Pane = function Pane(_ref) {
|
|
|
42
42
|
placeholder = _ref.placeholder,
|
|
43
43
|
children = _ref.children,
|
|
44
44
|
tabKey = _ref.tabKey,
|
|
45
|
+
tab = _ref.tab,
|
|
45
46
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
46
47
|
var alreadyActiveRef = (0, _react.useRef)(false);
|
|
47
48
|
var panePrefixCls = "".concat(_style.prefixCls, "-tabpane");
|
|
@@ -37,7 +37,19 @@ declare class Table extends React.Component<any, any, any> {
|
|
|
37
37
|
}>;
|
|
38
38
|
columnManager: ColumnManager;
|
|
39
39
|
saveRef: (name: any) => (node: any) => void;
|
|
40
|
-
components:
|
|
40
|
+
components: {
|
|
41
|
+
table: any;
|
|
42
|
+
header: {
|
|
43
|
+
wrapper: any;
|
|
44
|
+
row: any;
|
|
45
|
+
cell: any;
|
|
46
|
+
};
|
|
47
|
+
body: {
|
|
48
|
+
wrapper: any;
|
|
49
|
+
row: any;
|
|
50
|
+
cell: any;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
41
53
|
};
|
|
42
54
|
};
|
|
43
55
|
getRowKey: (record: any, index: any) => any;
|
|
@@ -31,8 +31,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
31
31
|
|
|
32
32
|
var _miniStore = require("mini-store");
|
|
33
33
|
|
|
34
|
-
var _merge = _interopRequireDefault(require("lodash/merge"));
|
|
35
|
-
|
|
36
34
|
var _componentClasses = _interopRequireDefault(require("component-classes"));
|
|
37
35
|
|
|
38
36
|
var _reactLifecyclesCompat = require("react-lifecycles-compat");
|
|
@@ -151,24 +149,27 @@ var Table = /*#__PURE__*/function (_React$Component) {
|
|
|
151
149
|
(0, _createClass2.default)(Table, [{
|
|
152
150
|
key: "getChildContext",
|
|
153
151
|
value: function getChildContext() {
|
|
152
|
+
var _components$header, _components$header2, _components$header3, _components$body, _components$body2, _components$body3;
|
|
153
|
+
|
|
154
|
+
var components = this.props.components || {};
|
|
154
155
|
return {
|
|
155
156
|
table: {
|
|
156
157
|
props: this.props,
|
|
157
158
|
columnManager: this.columnManager,
|
|
158
159
|
saveRef: this.saveRef,
|
|
159
|
-
components:
|
|
160
|
-
table: 'table',
|
|
160
|
+
components: {
|
|
161
|
+
table: components.table || 'table',
|
|
161
162
|
header: {
|
|
162
|
-
wrapper: 'thead',
|
|
163
|
-
row: 'tr',
|
|
164
|
-
cell: 'th'
|
|
163
|
+
wrapper: ((_components$header = components.header) === null || _components$header === void 0 ? void 0 : _components$header.wrapper) || 'thead',
|
|
164
|
+
row: ((_components$header2 = components.header) === null || _components$header2 === void 0 ? void 0 : _components$header2.row) || 'tr',
|
|
165
|
+
cell: ((_components$header3 = components.header) === null || _components$header3 === void 0 ? void 0 : _components$header3.cell) || 'th'
|
|
165
166
|
},
|
|
166
167
|
body: {
|
|
167
|
-
wrapper: 'tbody',
|
|
168
|
-
row: 'tr',
|
|
169
|
-
cell: 'td'
|
|
168
|
+
wrapper: ((_components$body = components.body) === null || _components$body === void 0 ? void 0 : _components$body.wrapper) || 'tbody',
|
|
169
|
+
row: ((_components$body2 = components.body) === null || _components$body2 === void 0 ? void 0 : _components$body2.row) || 'tr',
|
|
170
|
+
cell: ((_components$body3 = components.body) === null || _components$body3 === void 0 ? void 0 : _components$body3.cell) || 'td'
|
|
170
171
|
}
|
|
171
|
-
}
|
|
172
|
+
}
|
|
172
173
|
}
|
|
173
174
|
};
|
|
174
175
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ucloud-fe/react-components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.15",
|
|
4
4
|
"title": "UCloud react components",
|
|
5
5
|
"description": "UCloud react components",
|
|
6
6
|
"keywords": [
|
|
@@ -127,7 +127,6 @@
|
|
|
127
127
|
"eslint-plugin-react-hooks": "^4.2.0",
|
|
128
128
|
"file-loader": "^1.1.11",
|
|
129
129
|
"fs-extra": "^9",
|
|
130
|
-
"gitalk": "^1.7.0",
|
|
131
130
|
"html-webpack-plugin": "^4",
|
|
132
131
|
"husky": "^0.14.3",
|
|
133
132
|
"jest": "^26.4.2",
|