@oceanbase/design 1.0.0-alpha.10 → 1.0.0-alpha.11
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/design.min.js +1 -1
- package/es/_util/index.js +1 -0
- package/es/_util/styleChecker.js +1 -0
- package/es/affix/index.js +1 -0
- package/es/alert/index.d.ts +1 -1
- package/es/alert/index.js +5 -2
- package/es/alert/style/index.js +17 -8
- package/es/anchor/index.js +1 -0
- package/es/app/index.js +1 -0
- package/es/auto-complete/index.js +1 -0
- package/es/avatar/index.js +1 -0
- package/es/badge/index.d.ts +2 -0
- package/es/badge/index.js +26 -10
- package/es/badge/style/index.js +3 -1
- package/es/breadcrumb/Breadcrumb.js +1 -0
- package/es/breadcrumb/index.js +1 -0
- package/es/button/index.js +1 -0
- package/es/calendar/index.js +1 -0
- package/es/card/index.js +2 -0
- package/es/card/style/index.js +3 -1
- package/es/carousel/index.js +1 -0
- package/es/cascader/index.js +1 -0
- package/es/checkbox/index.js +1 -0
- package/es/collapse/index.js +1 -0
- package/es/color-picker/index.js +1 -0
- package/es/config-provider/DefaultRenderEmpty.js +1 -0
- package/es/config-provider/index.js +1 -0
- package/es/date-picker/index.js +1 -0
- package/es/descriptions/hooks/useItems.d.ts +4 -4
- package/es/descriptions/hooks/useItems.js +1 -0
- package/es/descriptions/index.js +1 -0
- package/es/divider/index.js +1 -0
- package/es/drawer/index.js +1 -0
- package/es/dropdown/dropdown-button.js +1 -0
- package/es/dropdown/index.js +1 -0
- package/es/empty/colored.js +1 -0
- package/es/empty/database.js +1 -0
- package/es/empty/default.js +1 -0
- package/es/empty/guide.js +1 -0
- package/es/empty/index.js +1 -0
- package/es/float-button/index.js +1 -0
- package/es/form/FormItem.js +1 -0
- package/es/form/index.js +1 -0
- package/es/grid/col.js +1 -0
- package/es/grid/index.js +1 -0
- package/es/grid/row.js +1 -0
- package/es/image/index.js +1 -0
- package/es/index.js +1 -0
- package/es/input/Input.js +1 -0
- package/es/input/Password.js +1 -0
- package/es/input/Search.js +1 -0
- package/es/input/TextArea.js +1 -0
- package/es/input/index.js +1 -0
- package/es/input-number/index.js +1 -0
- package/es/layout/index.js +1 -0
- package/es/list/index.js +1 -0
- package/es/locale/index.js +1 -0
- package/es/lottie/index.js +1 -0
- package/es/mentions/index.js +1 -0
- package/es/menu/index.js +1 -0
- package/es/message/index.js +1 -0
- package/es/modal/Modal.d.ts +1 -1
- package/es/modal/Modal.js +7 -4
- package/es/modal/Progress.js +1 -0
- package/es/modal/index.js +1 -0
- package/es/modal/style/index.js +9 -5
- package/es/notification/index.js +1 -0
- package/es/pagination/index.js +1 -0
- package/es/popconfirm/index.js +1 -0
- package/es/popover/index.js +1 -0
- package/es/progress/index.js +1 -0
- package/es/qrcode/index.js +1 -0
- package/es/radio/index.js +1 -0
- package/es/rate/index.js +1 -0
- package/es/result/403.js +1 -0
- package/es/result/404.js +1 -0
- package/es/result/500.js +1 -0
- package/es/result/Error.js +1 -0
- package/es/result/Processing.js +1 -0
- package/es/result/Success.js +1 -0
- package/es/result/Warning.js +1 -0
- package/es/result/index.js +1 -0
- package/es/segmented/index.js +1 -0
- package/es/select/index.js +1 -0
- package/es/skeleton/index.js +1 -0
- package/es/slider/index.js +1 -0
- package/es/space/index.js +1 -0
- package/es/spin/index.js +1 -0
- package/es/static-function/index.js +1 -0
- package/es/statistic/index.js +1 -0
- package/es/steps/index.js +1 -0
- package/es/style/cssVariables.js +2 -1
- package/es/style/cssVariablesMeta.js +7 -7
- package/es/style/global.js +1 -0
- package/es/switch/index.js +1 -0
- package/es/table/index.js +38 -61
- package/es/table/style/index.js +23 -17
- package/es/tabs/TabPane.js +1 -0
- package/es/tabs/hooks/useLegacyItems.js +1 -0
- package/es/tabs/index.js +1 -0
- package/es/tag/index.js +1 -0
- package/es/tag/style/index.js +4 -1
- package/es/theme/index.js +1 -0
- package/es/theme/interface.d.ts +7 -0
- package/es/theme/style/aliyun.less +1 -1
- package/es/theme/style/compact.less +3 -3
- package/es/theme/style/dark.less +1 -1
- package/es/theme/style/default.less +3 -3
- package/es/time-picker/index.js +1 -0
- package/es/timeline/index.js +1 -0
- package/es/tooltip/MouseTooltip.js +1 -0
- package/es/tooltip/ReactStickyMouseTooltip.js +1 -0
- package/es/tooltip/index.js +1 -0
- package/es/tour/index.js +1 -0
- package/es/transfer/index.js +1 -0
- package/es/tree/index.js +1 -0
- package/es/tree-select/index.js +1 -0
- package/es/typography/Link.js +1 -0
- package/es/typography/Paragraph.js +1 -0
- package/es/typography/Text.js +1 -0
- package/es/typography/Title.js +1 -0
- package/es/typography/index.js +1 -0
- package/es/upload/index.js +1 -0
- package/es/watermark/index.js +1 -0
- package/lib/_util/genComponentStyleHook.js +52 -59
- package/lib/_util/getEllipsisConfig.js +16 -39
- package/lib/_util/index.js +13 -29
- package/lib/_util/styleChecker.js +33 -53
- package/lib/_util/type.js +4 -16
- package/lib/_util/useFlexGapSupport.js +11 -36
- package/lib/affix/index.js +15 -21
- package/lib/alert/index.d.ts +1 -1
- package/lib/alert/index.js +63 -82
- package/lib/alert/style/index.js +111 -108
- package/lib/anchor/index.js +26 -23
- package/lib/app/index.js +47 -54
- package/lib/app/style/index.js +13 -32
- package/lib/auto-complete/index.js +15 -21
- package/lib/avatar/index.js +26 -23
- package/lib/badge/index.d.ts +2 -0
- package/lib/badge/index.js +108 -110
- package/lib/badge/style/index.js +21 -40
- package/lib/breadcrumb/Breadcrumb.js +15 -21
- package/lib/breadcrumb/index.js +31 -31
- package/lib/button/index.js +50 -60
- package/lib/button/style/index.js +35 -57
- package/lib/calendar/index.js +15 -21
- package/lib/card/Card.js +14 -21
- package/lib/card/index.js +246 -255
- package/lib/card/style/index.js +50 -61
- package/lib/carousel/index.js +15 -21
- package/lib/cascader/index.js +15 -21
- package/lib/checkbox/index.js +52 -69
- package/lib/checkbox/style/index.js +20 -35
- package/lib/collapse/index.js +15 -21
- package/lib/color-picker/index.js +15 -21
- package/lib/color-picker/interface.js +14 -21
- package/lib/config-provider/DefaultRenderEmpty.js +34 -48
- package/lib/config-provider/SizeContext.js +14 -21
- package/lib/config-provider/context.js +14 -21
- package/lib/config-provider/index.js +200 -233
- package/lib/config-provider/navigate.js +4 -16
- package/lib/date-picker/index.js +15 -21
- package/lib/descriptions/Item.js +6 -24
- package/lib/descriptions/hooks/useItems.d.ts +4 -4
- package/lib/descriptions/hooks/useItems.js +50 -73
- package/lib/descriptions/index.js +83 -101
- package/lib/descriptions/style/index.js +46 -64
- package/lib/divider/index.js +15 -21
- package/lib/drawer/index.js +108 -127
- package/lib/drawer/style/index.js +36 -51
- package/lib/dropdown/dropdown-button.js +30 -57
- package/lib/dropdown/index.js +30 -46
- package/lib/dropdown/style/index.js +13 -32
- package/lib/empty/colored.js +198 -314
- package/lib/empty/database.js +117 -185
- package/lib/empty/default.js +53 -48
- package/lib/empty/guide.js +145 -224
- package/lib/empty/index.js +77 -95
- package/lib/empty/style/index.js +28 -43
- package/lib/float-button/index.js +15 -21
- package/lib/float-button/interface.js +14 -21
- package/lib/form/FormItem.js +78 -84
- package/lib/form/index.js +57 -77
- package/lib/form/interface.js +14 -21
- package/lib/form/style/index.js +16 -35
- package/lib/grid/col.js +28 -45
- package/lib/grid/index.js +26 -44
- package/lib/grid/row.js +30 -45
- package/lib/image/index.js +15 -21
- package/lib/index.js +333 -154
- package/lib/input/Input.js +65 -78
- package/lib/input/Password.js +59 -76
- package/lib/input/Search.js +59 -76
- package/lib/input/TextArea.js +59 -76
- package/lib/input/index.js +30 -49
- package/lib/input/style/index.js +19 -36
- package/lib/input-number/index.js +56 -76
- package/lib/input-number/style/index.js +13 -32
- package/lib/layout/index.js +15 -21
- package/lib/list/index.js +52 -59
- package/lib/locale/en-US.js +22 -49
- package/lib/locale/index.js +25 -38
- package/lib/locale/ja-JP.js +22 -49
- package/lib/locale/useLocale.js +6 -24
- package/lib/locale/zh-CN.js +22 -49
- package/lib/locale/zh-TW.js +22 -49
- package/lib/lottie/index.js +61 -80
- package/lib/mentions/index.js +15 -21
- package/lib/menu/index.js +15 -21
- package/lib/menu/interface.js +14 -21
- package/lib/message/index.js +15 -21
- package/lib/message/interface.js +14 -21
- package/lib/modal/Modal.d.ts +1 -1
- package/lib/modal/Modal.js +69 -80
- package/lib/modal/Progress.js +44 -61
- package/lib/modal/index.js +23 -42
- package/lib/modal/interface.js +14 -21
- package/lib/modal/style/index.js +34 -46
- package/lib/notification/index.js +15 -21
- package/lib/notification/interface.js +14 -21
- package/lib/pagination/index.js +15 -21
- package/lib/popconfirm/index.js +15 -21
- package/lib/popover/index.js +15 -21
- package/lib/progress/index.js +26 -23
- package/lib/progress/progress.js +14 -21
- package/lib/qrcode/index.js +15 -21
- package/lib/qrcode/interface.js +14 -21
- package/lib/radio/index.js +53 -62
- package/lib/radio/interface.js +14 -21
- package/lib/radio/style/index.js +18 -33
- package/lib/rate/index.js +15 -21
- package/lib/result/403.js +164 -195
- package/lib/result/404.js +291 -354
- package/lib/result/500.js +156 -259
- package/lib/result/Error.js +127 -161
- package/lib/result/Processing.js +320 -252
- package/lib/result/Success.js +202 -261
- package/lib/result/Warning.js +302 -434
- package/lib/result/index.js +65 -80
- package/lib/result/style/index.js +15 -35
- package/lib/segmented/index.js +86 -83
- package/lib/segmented/style/index.js +19 -36
- package/lib/select/index.js +63 -81
- package/lib/select/style/index.js +12 -32
- package/lib/skeleton/index.js +15 -21
- package/lib/slider/index.js +48 -58
- package/lib/slider/style/index.js +19 -37
- package/lib/space/index.js +63 -69
- package/lib/space/style/index.js +16 -36
- package/lib/spin/index.js +58 -76
- package/lib/spin/style/index.js +48 -52
- package/lib/static-function/index.js +48 -73
- package/lib/statistic/index.js +15 -21
- package/lib/steps/index.js +15 -21
- package/lib/style/cssVariables.js +237 -256
- package/lib/style/cssVariablesMeta.js +978 -1057
- package/lib/style/global.js +119 -155
- package/lib/switch/index.js +52 -60
- package/lib/switch/style/index.js +12 -32
- package/lib/table/hooks/useDefaultPagination.js +18 -46
- package/lib/table/index.js +179 -219
- package/lib/table/interface.js +14 -21
- package/lib/table/style/index.js +59 -73
- package/lib/tabs/TabPane.js +7 -24
- package/lib/tabs/hooks/useLegacyItems.js +27 -43
- package/lib/tabs/index.js +107 -124
- package/lib/tabs/style/index.js +23 -38
- package/lib/tag/index.js +78 -98
- package/lib/tag/style/index.js +35 -57
- package/lib/theme/aliyun.js +7 -34
- package/lib/theme/compact.js +9 -36
- package/lib/theme/dark.js +9 -36
- package/lib/theme/default.js +130 -232
- package/lib/theme/index.js +48 -55
- package/lib/theme/interface.d.ts +7 -0
- package/lib/theme/interface.js +14 -21
- package/lib/theme/internal.js +14 -21
- package/lib/theme/style/aliyun.less +1 -1
- package/lib/theme/style/compact.less +3 -3
- package/lib/theme/style/dark.less +1 -1
- package/lib/theme/style/default.less +3 -3
- package/lib/theme/themes/compact/index.js +19 -39
- package/lib/theme/themes/dark/index.js +19 -39
- package/lib/theme/themes/default/index.js +19 -39
- package/lib/theme/themes/seed.js +24 -43
- package/lib/theme/util/alias.js +19 -39
- package/lib/theme/util/format.js +15 -35
- package/lib/time-picker/index.js +15 -21
- package/lib/timeline/index.js +15 -21
- package/lib/tooltip/MouseTooltip.js +84 -98
- package/lib/tooltip/ReactStickyMouseTooltip.js +63 -88
- package/lib/tooltip/hooks/useTooltipTypeList.js +28 -61
- package/lib/tooltip/index.js +123 -137
- package/lib/tooltip/style/index.js +26 -47
- package/lib/tour/index.js +15 -21
- package/lib/tour/interface.js +14 -21
- package/lib/transfer/index.js +15 -21
- package/lib/transfer/interface.js +14 -21
- package/lib/tree/index.js +15 -21
- package/lib/tree-select/index.js +67 -85
- package/lib/tree-select/style/index.js +9 -31
- package/lib/typography/Link.js +54 -68
- package/lib/typography/Paragraph.js +54 -68
- package/lib/typography/Text.js +55 -68
- package/lib/typography/Title.js +54 -68
- package/lib/typography/hooks/useClassName.js +12 -43
- package/lib/typography/index.js +89 -58
- package/lib/typography/style/index.js +29 -45
- package/lib/upload/index.js +15 -21
- package/lib/upload/interface.js +14 -21
- package/lib/watermark/index.js +15 -21
- package/package.json +3 -3
package/lib/table/index.js
CHANGED
|
@@ -1,54 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";
|
|
29
2
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
__export(table_exports, {
|
|
33
|
-
default: () => table_default
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
34
5
|
});
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
var
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
var
|
|
42
|
-
var
|
|
43
|
-
var
|
|
44
|
-
var
|
|
45
|
-
var
|
|
46
|
-
var
|
|
47
|
-
var
|
|
48
|
-
|
|
49
|
-
var
|
|
6
|
+
var _exportNames = {};
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _antd = require("antd");
|
|
9
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
+
var _lodash = require("lodash");
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _configProvider = _interopRequireDefault(require("../config-provider"));
|
|
13
|
+
var _typography = _interopRequireDefault(require("../typography"));
|
|
14
|
+
var _empty = _interopRequireDefault(require("../empty"));
|
|
15
|
+
var _style = _interopRequireDefault(require("./style"));
|
|
16
|
+
var _useDefaultPagination = _interopRequireDefault(require("./hooks/useDefaultPagination"));
|
|
17
|
+
var _useMergedState = _interopRequireDefault(require("rc-util/lib/hooks/useMergedState"));
|
|
18
|
+
var _enUS = _interopRequireDefault(require("../locale/en-US"));
|
|
19
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
|
+
var _table = require("antd/es/table");
|
|
21
|
+
Object.keys(_table).forEach(function (key) {
|
|
22
|
+
if (key === "default" || key === "__esModule") return;
|
|
23
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
24
|
+
if (key in exports && exports[key] === _table[key]) return;
|
|
25
|
+
Object.defineProperty(exports, key, {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () {
|
|
28
|
+
return _table[key];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
33
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
34
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
35
|
+
"use client";
|
|
50
36
|
function Table(props, ref) {
|
|
51
|
-
var _a, _b;
|
|
52
37
|
const {
|
|
53
38
|
locale: customLocale,
|
|
54
39
|
size,
|
|
@@ -71,41 +56,43 @@ function Table(props, ref) {
|
|
|
71
56
|
prefixCls: customizePrefixCls,
|
|
72
57
|
className
|
|
73
58
|
} = props;
|
|
74
|
-
const extendedContext = (0,
|
|
75
|
-
const pagination = (0,
|
|
76
|
-
const {
|
|
77
|
-
|
|
59
|
+
const extendedContext = (0, _react.useContext)(_configProvider.default.ExtendedConfigContext);
|
|
60
|
+
const pagination = (0, _useDefaultPagination.default)(customPagination);
|
|
61
|
+
const {
|
|
62
|
+
getPrefixCls,
|
|
63
|
+
locale,
|
|
64
|
+
table
|
|
65
|
+
} = (0, _react.useContext)(_configProvider.default.ConfigContext);
|
|
78
66
|
const {
|
|
79
67
|
batchOperationBar,
|
|
80
|
-
emptyText =
|
|
68
|
+
emptyText = /*#__PURE__*/(0, _jsxRuntime.jsx)(_empty.default, {
|
|
69
|
+
image: _empty.default.PRESENTED_IMAGE_SIMPLE
|
|
70
|
+
}),
|
|
81
71
|
...restLocale
|
|
82
72
|
} = {
|
|
83
73
|
...customLocale,
|
|
84
74
|
batchOperationBar: {
|
|
85
|
-
...
|
|
86
|
-
...
|
|
87
|
-
...customLocale
|
|
75
|
+
..._enUS.default.Table?.batchOperationBar,
|
|
76
|
+
...locale?.Table?.batchOperationBar,
|
|
77
|
+
...customLocale?.batchOperationBar
|
|
88
78
|
}
|
|
89
79
|
};
|
|
90
|
-
const prefixCls = getPrefixCls(
|
|
91
|
-
const [wrapCSSVar] = (0,
|
|
92
|
-
const tableCls = (0,
|
|
93
|
-
{
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
const [currentSelectedRowKeys, setCurrentSelectedRowKeys] = (0, import_useMergedState.default)([], {
|
|
103
|
-
value: rowSelection == null ? void 0 : rowSelection.selectedRowKeys,
|
|
104
|
-
defaultValue: rowSelection == null ? void 0 : rowSelection.defaultSelectedRowKeys
|
|
80
|
+
const prefixCls = getPrefixCls('table', customizePrefixCls);
|
|
81
|
+
const [wrapCSSVar] = (0, _style.default)(prefixCls);
|
|
82
|
+
const tableCls = (0, _classnames.default)({
|
|
83
|
+
[`${prefixCls}-expandable`]: !(0, _lodash.isEmpty)(expandable),
|
|
84
|
+
[`${prefixCls}-selectable`]: !!rowSelection,
|
|
85
|
+
[`${prefixCls}-has-footer`]: !!footer,
|
|
86
|
+
[`${prefixCls}-inner-bordered`]: innerBordered
|
|
87
|
+
}, className);
|
|
88
|
+
const [openPopover, setOpenPopover] = (0, _react.useState)(false);
|
|
89
|
+
const [currentSelectedRowKeys, setCurrentSelectedRowKeys] = (0, _useMergedState.default)([], {
|
|
90
|
+
value: rowSelection?.selectedRowKeys,
|
|
91
|
+
defaultValue: rowSelection?.defaultSelectedRowKeys
|
|
105
92
|
});
|
|
106
|
-
const [currentSelectedRows, setCurrentSelectedRows] = (0,
|
|
107
|
-
const [currentSelectedInfo, setCurrentSelectedInfo] = (0,
|
|
108
|
-
const newColumns = columns
|
|
93
|
+
const [currentSelectedRows, setCurrentSelectedRows] = (0, _react.useState)([]);
|
|
94
|
+
const [currentSelectedInfo, setCurrentSelectedInfo] = (0, _react.useState)({});
|
|
95
|
+
const newColumns = columns?.map(item => {
|
|
109
96
|
if (item.ellipsis) {
|
|
110
97
|
return {
|
|
111
98
|
...item,
|
|
@@ -115,172 +102,145 @@ function Table(props, ref) {
|
|
|
115
102
|
},
|
|
116
103
|
render: (text, record, index) => {
|
|
117
104
|
const element = item.render ? item.render(text, record, index) : record[item.dataIndex];
|
|
118
|
-
const elementType = element
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
{
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
children:
|
|
129
|
-
}
|
|
130
|
-
);
|
|
105
|
+
const elementType = element?.type;
|
|
106
|
+
// 如果目标元素已经被 Tooltip 包裹,则去掉默认的 Tooltip,避免有两个 Tooltip
|
|
107
|
+
return elementType?.__ANT_TOOLTIP === true ? element : /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.default.Text, {
|
|
108
|
+
ellipsis: {
|
|
109
|
+
tooltip: {
|
|
110
|
+
placement: 'topLeft',
|
|
111
|
+
title: element
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
115
|
+
children: element
|
|
116
|
+
})
|
|
117
|
+
});
|
|
131
118
|
}
|
|
132
119
|
};
|
|
133
120
|
}
|
|
134
121
|
return item;
|
|
135
122
|
});
|
|
136
|
-
const hasEllipsisColumn = newColumns.some(
|
|
123
|
+
const hasEllipsisColumn = newColumns.some(item => item.ellipsis);
|
|
137
124
|
const handleSelectedData = (selectedRowKeys, selectedRows, info) => {
|
|
138
125
|
setCurrentSelectedRowKeys(selectedRowKeys);
|
|
139
126
|
setCurrentSelectedRows(selectedRows);
|
|
140
127
|
setCurrentSelectedInfo(info);
|
|
141
128
|
};
|
|
142
129
|
const handleOptionsCancel = () => {
|
|
143
|
-
|
|
144
|
-
(_a2 = rowSelection == null ? void 0 : rowSelection.onChange) == null ? void 0 : _a2.call(rowSelection, [], [], currentSelectedInfo);
|
|
130
|
+
rowSelection?.onChange?.([], [], currentSelectedInfo);
|
|
145
131
|
handleSelectedData([], [], currentSelectedInfo);
|
|
146
132
|
};
|
|
147
|
-
(0,
|
|
148
|
-
if ((0,
|
|
133
|
+
(0, _react.useEffect)(() => {
|
|
134
|
+
if ((0, _lodash.isEmpty)(currentSelectedRows) && toolSelectedContent) {
|
|
149
135
|
setOpenPopover(false);
|
|
150
136
|
}
|
|
151
137
|
}, [currentSelectedRows]);
|
|
152
138
|
const renderOptionsBar = (total, range) => {
|
|
153
|
-
if ((0,
|
|
139
|
+
if ((0, _lodash.isEmpty)(rowSelection) || (0, _lodash.isEmpty)(currentSelectedRowKeys)) {
|
|
154
140
|
return (
|
|
141
|
+
/*#__PURE__*/
|
|
155
142
|
// @ts-ignore
|
|
156
|
-
|
|
143
|
+
(0, _jsxRuntime.jsx)("span", {
|
|
144
|
+
children: pagination && pagination?.showTotal && pagination?.showTotal(total, range)
|
|
145
|
+
})
|
|
157
146
|
);
|
|
158
147
|
}
|
|
159
|
-
return
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
148
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
149
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
150
|
+
className: `${prefixCls}-batch-operation-bar`,
|
|
151
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
152
|
+
size: 8,
|
|
153
|
+
style: {
|
|
154
|
+
marginRight: 24
|
|
155
|
+
},
|
|
156
|
+
children: [toolAlertRender && toolAlertRender(currentSelectedRowKeys, currentSelectedRows), !toolAlertRender && toolAlertRender !== false && /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
157
|
+
className: `${prefixCls}-batch-operation-selection`,
|
|
158
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
159
|
+
children: batchOperationBar?.selected
|
|
160
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
161
|
+
className: `${prefixCls}-batch-operation-selection-count`,
|
|
162
|
+
children: currentSelectedRowKeys?.length || 0
|
|
163
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
164
|
+
children: batchOperationBar?.object
|
|
165
|
+
})]
|
|
166
|
+
}), !hiddenCancelBtn && /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
|
|
167
|
+
onClick: handleOptionsCancel,
|
|
168
|
+
children: cancelText ?? batchOperationBar?.cancel
|
|
169
|
+
}), toolSelectedContent && /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Popover, {
|
|
170
|
+
placement: "top",
|
|
171
|
+
overlayClassName: `${prefixCls}-batch-operation-selection-popover`,
|
|
172
|
+
content: toolSelectedContent?.(currentSelectedRowKeys, currentSelectedRows),
|
|
173
|
+
trigger: "click",
|
|
174
|
+
open: openPopover,
|
|
175
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
|
|
176
|
+
onClick: () => setOpenPopover(!openPopover),
|
|
177
|
+
children: openPopover ? collapseText ?? batchOperationBar?.collapse : openText ?? batchOperationBar?.open
|
|
178
|
+
})
|
|
179
|
+
})]
|
|
180
|
+
}), toolOptionsRender && /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Space, {
|
|
181
|
+
size: 8,
|
|
182
|
+
children: toolOptionsRender?.(currentSelectedRowKeys, currentSelectedRows)
|
|
183
|
+
})]
|
|
184
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
185
|
+
children: pagination && pagination?.showTotal && pagination?.showTotal(total, range)
|
|
186
|
+
})]
|
|
187
|
+
});
|
|
194
188
|
};
|
|
195
|
-
return wrapCSSVar(
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
locale: {
|
|
226
|
-
...restLocale,
|
|
227
|
-
emptyText: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefixCls}-empty-wrapper`, children: typeof emptyText === "function" ? emptyText() : emptyText })
|
|
228
|
-
},
|
|
229
|
-
size,
|
|
230
|
-
bordered: bordered || innerBordered,
|
|
231
|
-
columns: newColumns,
|
|
232
|
-
rowClassName: (...args) => {
|
|
233
|
-
return (0, import_classnames.default)(
|
|
234
|
-
typeof rowClassName === "function" ? rowClassName(...args) : rowClassName,
|
|
235
|
-
{
|
|
236
|
-
[`${prefixCls}-expand-row-by-click`]: expandable == null ? void 0 : expandable.expandRowByClick
|
|
237
|
-
}
|
|
238
|
-
);
|
|
239
|
-
},
|
|
240
|
-
expandable: expandable ? {
|
|
241
|
-
columnWidth: !size || size === "large" ? 40 : 32,
|
|
242
|
-
...expandable
|
|
243
|
-
} : void 0,
|
|
244
|
-
rowSelection: rowSelection ? {
|
|
245
|
-
columnWidth: table == null ? void 0 : table.selectionColumnWidth,
|
|
246
|
-
...rowSelection,
|
|
247
|
-
onChange: (selectedRowKeys, selectedRows, info) => {
|
|
248
|
-
var _a2;
|
|
249
|
-
handleSelectedData(selectedRowKeys, selectedRows, info);
|
|
250
|
-
(_a2 = rowSelection == null ? void 0 : rowSelection.onChange) == null ? void 0 : _a2.call(rowSelection, selectedRowKeys, selectedRows, info);
|
|
251
|
-
}
|
|
252
|
-
} : void 0,
|
|
253
|
-
scroll: {
|
|
254
|
-
// enable auto x scroll when there is no ellipsis column
|
|
255
|
-
x: hasEllipsisColumn ? void 0 : "max-content",
|
|
256
|
-
...scroll
|
|
257
|
-
},
|
|
258
|
-
footer,
|
|
259
|
-
pagination: pagination === false ? false : {
|
|
260
|
-
...pagination,
|
|
261
|
-
hideOnSinglePage: toolAlertRender || toolOptionsRender || toolSelectedContent || (pagination == null ? void 0 : pagination.showSizeChanger) ? false : (pagination == null ? void 0 : pagination.hideOnSinglePage) !== void 0 ? pagination == null ? void 0 : pagination.hideOnSinglePage : extendedContext.hideOnSinglePage,
|
|
262
|
-
showTotal: renderOptionsBar
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
)
|
|
189
|
+
return wrapCSSVar( /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Table, {
|
|
190
|
+
...props,
|
|
191
|
+
ref: ref,
|
|
192
|
+
prefixCls: customizePrefixCls,
|
|
193
|
+
className: tableCls,
|
|
194
|
+
locale: {
|
|
195
|
+
...restLocale,
|
|
196
|
+
emptyText: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
197
|
+
className: `${prefixCls}-empty-wrapper`,
|
|
198
|
+
children: typeof emptyText === 'function' ? emptyText() : emptyText
|
|
199
|
+
})
|
|
200
|
+
},
|
|
201
|
+
size: size,
|
|
202
|
+
bordered: bordered || innerBordered,
|
|
203
|
+
columns: newColumns,
|
|
204
|
+
rowClassName: (...args) => {
|
|
205
|
+
return (0, _classnames.default)(typeof rowClassName === 'function' ? rowClassName(...args) : rowClassName, {
|
|
206
|
+
[`${prefixCls}-expand-row-by-click`]: expandable?.expandRowByClick
|
|
207
|
+
});
|
|
208
|
+
},
|
|
209
|
+
expandable: expandable ? {
|
|
210
|
+
columnWidth: !size || size === 'large' ? 40 : 32,
|
|
211
|
+
...expandable
|
|
212
|
+
} : undefined,
|
|
213
|
+
rowSelection: rowSelection ? {
|
|
214
|
+
columnWidth: table?.selectionColumnWidth,
|
|
215
|
+
...rowSelection,
|
|
216
|
+
onChange: (selectedRowKeys, selectedRows, info) => {
|
|
217
|
+
handleSelectedData(selectedRowKeys, selectedRows, info);
|
|
218
|
+
rowSelection?.onChange?.(selectedRowKeys, selectedRows, info);
|
|
266
219
|
}
|
|
267
|
-
|
|
268
|
-
|
|
220
|
+
} : undefined,
|
|
221
|
+
scroll: {
|
|
222
|
+
// enable auto x scroll when there is no ellipsis column
|
|
223
|
+
x: hasEllipsisColumn ? undefined : 'max-content',
|
|
224
|
+
...scroll
|
|
225
|
+
},
|
|
226
|
+
footer: footer,
|
|
227
|
+
pagination: pagination === false ? false : {
|
|
228
|
+
...pagination,
|
|
229
|
+
hideOnSinglePage: toolAlertRender || toolOptionsRender || toolSelectedContent || pagination?.showSizeChanger ? false : pagination?.hideOnSinglePage !== undefined ? pagination?.hideOnSinglePage : extendedContext.hideOnSinglePage,
|
|
230
|
+
showTotal: renderOptionsBar
|
|
231
|
+
}
|
|
232
|
+
}));
|
|
269
233
|
}
|
|
270
|
-
|
|
271
|
-
var
|
|
272
|
-
SELECTION_COLUMN:
|
|
273
|
-
EXPAND_COLUMN:
|
|
274
|
-
SELECTION_ALL:
|
|
275
|
-
SELECTION_INVERT:
|
|
276
|
-
SELECTION_NONE:
|
|
277
|
-
Column:
|
|
278
|
-
ColumnGroup:
|
|
279
|
-
Summary:
|
|
280
|
-
useStyle:
|
|
281
|
-
useDefaultPagination:
|
|
282
|
-
});
|
|
283
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
284
|
-
0 && (module.exports = {
|
|
285
|
-
...require("antd/es/table")
|
|
286
|
-
});
|
|
234
|
+
const ForwardTable = /*#__PURE__*/_react.default.forwardRef(Table);
|
|
235
|
+
var _default = exports.default = Object.assign(ForwardTable, {
|
|
236
|
+
SELECTION_COLUMN: _antd.Table.SELECTION_COLUMN,
|
|
237
|
+
EXPAND_COLUMN: _antd.Table.EXPAND_COLUMN,
|
|
238
|
+
SELECTION_ALL: _antd.Table.SELECTION_ALL,
|
|
239
|
+
SELECTION_INVERT: _antd.Table.SELECTION_INVERT,
|
|
240
|
+
SELECTION_NONE: _antd.Table.SELECTION_NONE,
|
|
241
|
+
Column: _antd.Table.Column,
|
|
242
|
+
ColumnGroup: _antd.Table.ColumnGroup,
|
|
243
|
+
Summary: _antd.Table.Summary,
|
|
244
|
+
useStyle: _style.default,
|
|
245
|
+
useDefaultPagination: _useDefaultPagination.default
|
|
246
|
+
});
|
package/lib/table/interface.js
CHANGED
|
@@ -1,23 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
-
for (let key of __getOwnPropNames(from))
|
|
8
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
-
}
|
|
11
|
-
return to;
|
|
12
|
-
};
|
|
13
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";
|
|
15
2
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
module.exports = __toCommonJS(interface_exports);
|
|
19
|
-
__reExport(interface_exports, require("antd/es/table/interface"), module.exports);
|
|
20
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
21
|
-
0 && (module.exports = {
|
|
22
|
-
...require("antd/es/table/interface")
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
23
5
|
});
|
|
6
|
+
var _interface = require("antd/es/table/interface");
|
|
7
|
+
Object.keys(_interface).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _interface[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _interface[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|