@oceanbase/ui 1.0.0-alpha.1 → 1.0.0-alpha.3
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/ui.min.css +1 -1
- package/dist/ui.min.js +1 -1
- package/es/Action/style/index.d.ts +2 -2
- package/es/DateRanger/Ranger.d.ts +4 -0
- package/es/DateRanger/Ranger.js +158 -14
- package/es/DateRanger/constant/index.js +1 -1
- package/es/DateRanger/index.less +23 -0
- package/es/FooterToolbar/style/index.d.ts +0 -2
- package/es/FooterToolbar/style/index.js +0 -12
- package/es/PageContainer/index.js +14 -4
- package/es/PageContainer/style/index.js +5 -7
- package/es/ProCard/index.js +11 -3
- package/es/ProCard/style/index.d.ts +2 -2
- package/es/ProCard/style/index.js +6 -3
- package/es/ProTable/index.d.ts +1 -1
- package/es/ProTable/index.js +11 -5
- package/es/ProTable/style/index.d.ts +2 -2
- package/es/ProTable/style/index.js +6 -3
- package/lib/Action/Group.js +57 -46
- package/lib/Action/Item.js +14 -9
- package/lib/Action/style/index.d.ts +2 -2
- package/lib/BackgroundTaskManager/RefreshMan.js +3 -12
- package/lib/BackgroundTaskManager/index.js +3 -12
- package/lib/BasicLayout/Header.js +120 -62
- package/lib/BasicLayout/index.js +166 -143
- package/lib/BatchOperationBar/index.js +59 -44
- package/lib/Boundary/Components/Code.js +11 -5
- package/lib/Boundary/Components/Exception.js +33 -23
- package/lib/Boundary/Components/Function.js +11 -5
- package/lib/ContentWithIcon/index.js +30 -22
- package/lib/ContentWithQuestion/index.js +8 -3
- package/lib/DateRanger/PickerPanel.js +235 -217
- package/lib/DateRanger/Ranger.d.ts +4 -0
- package/lib/DateRanger/Ranger.js +396 -227
- package/lib/DateRanger/constant/index.js +1 -1
- package/lib/DateRanger/index.less +23 -0
- package/lib/Dialog/Anchor.js +8 -5
- package/lib/Dialog/EventProxy.js +3 -12
- package/lib/Dialog/index.js +132 -108
- package/lib/DocDialog/index.js +3 -2
- package/lib/FooterToolbar/index.js +3 -2
- package/lib/FooterToolbar/style/index.d.ts +0 -2
- package/lib/FooterToolbar/style/index.js +0 -17
- package/lib/FullscreenBox/index.js +16 -7
- package/lib/GraphToolbar/index.js +70 -58
- package/lib/Highlight/DiffView/DiffCells.js +17 -10
- package/lib/Highlight/DiffView/index.js +35 -31
- package/lib/Highlight/HighlightCell.js +13 -10
- package/lib/Highlight/JsonView.js +15 -14
- package/lib/Highlight/index.js +50 -45
- package/lib/IconFont/index.js +2 -12
- package/lib/LightFilter/index.js +3 -2
- package/lib/LocaleDropdown/index.js +13 -20
- package/lib/Login/ActivateForm.js +53 -60
- package/lib/Login/LoginForm.js +118 -109
- package/lib/Login/RegisterForm.js +79 -86
- package/lib/Login/index.js +92 -64
- package/lib/NavMenu/index.js +9 -8
- package/lib/PageContainer/ItemRender.js +5 -5
- package/lib/PageContainer/index.js +17 -6
- package/lib/PageContainer/style/index.js +5 -6
- package/lib/PageLoading/index.js +6 -16
- package/lib/Password/Content.js +38 -42
- package/lib/Password/index.js +83 -68
- package/lib/ProCard/index.js +6 -3
- package/lib/ProCard/style/index.d.ts +2 -2
- package/lib/ProCard/style/index.js +6 -2
- package/lib/ProTable/index.d.ts +1 -1
- package/lib/ProTable/index.js +19 -8
- package/lib/ProTable/style/index.d.ts +2 -2
- package/lib/ProTable/style/index.js +7 -1
- package/lib/Ranger/QuickPicker.js +24 -15
- package/lib/Ranger/Ranger.js +37 -34
- package/lib/SideTip/Dragger.js +5 -4
- package/lib/SideTip/IconLoading.js +25 -25
- package/lib/SideTip/index.js +19 -10
- package/lib/TagSelect/Group.js +9 -5
- package/lib/TagSelect/Item.js +22 -18
- package/lib/TaskGraph/Graph.js +29 -24
- package/lib/TaskGraph/index.js +56 -50
- package/lib/TreeSearch/index.js +30 -35
- package/lib/Welcome/index.js +64 -37
- package/lib/Welcome/step.js +11 -4
- package/lib/locale/LocaleWrapper.js +15 -14
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
2
|
+
import type { CSSObject } from '@ant-design/cssinjs';
|
|
3
3
|
import type { OBToken } from '../../_util/genComponentStyleHook';
|
|
4
|
-
export declare const genActionStyle:
|
|
4
|
+
export declare const genActionStyle: (token: OBToken) => CSSObject;
|
|
5
5
|
declare const _default: (prefixCls: string) => {
|
|
6
6
|
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").JSX.Element;
|
|
7
7
|
hashId: string;
|
|
@@ -8,6 +8,7 @@ import type { Rule } from './PickerPanel';
|
|
|
8
8
|
import './index.less';
|
|
9
9
|
export type RangeName = 'customize' | string;
|
|
10
10
|
export type RangeValue = [Moment, Moment] | [Dayjs, Dayjs] | [] | null;
|
|
11
|
+
export type RangeValueFormat = [string, string] | [] | null;
|
|
11
12
|
export type RangeDateValue = {
|
|
12
13
|
name: RangeName;
|
|
13
14
|
range: RangeValue;
|
|
@@ -20,6 +21,9 @@ export interface DateRangerProps extends Omit<RangePickerProps, 'mode' | 'picker
|
|
|
20
21
|
hasSync?: boolean;
|
|
21
22
|
hasForward?: boolean;
|
|
22
23
|
hasZoomOut?: boolean;
|
|
24
|
+
history?: boolean | {
|
|
25
|
+
capacity: number;
|
|
26
|
+
};
|
|
23
27
|
hasTagInPicker?: boolean;
|
|
24
28
|
tip?: string;
|
|
25
29
|
rules?: Rule[];
|
package/es/DateRanger/Ranger.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var _excluded = ["selects", "value", "defaultValue", "defaultQuickValue", "hasRewind", "hasPlay", "hasSync", "hasForward", "hasZoomOut", "hasTagInPicker", "pastOnly", "simpleMode", "hideYear", "hideSecond", "autoCalcRange", "onChange", "disabledDate", "locale", "size", "stickRangeName", "tooltipProps", "isMoment", "rules", "tip", "autoAdjustOverflow", "overlayClassName", "overlayStyle", "getPopupContainer"];
|
|
1
|
+
var _excluded = ["selects", "value", "defaultValue", "defaultQuickValue", "hasRewind", "hasPlay", "hasSync", "hasForward", "hasZoomOut", "hasTagInPicker", "pastOnly", "simpleMode", "hideYear", "hideSecond", "autoCalcRange", "history", "onChange", "disabledDate", "locale", "size", "stickRangeName", "tooltipProps", "isMoment", "rules", "tip", "autoAdjustOverflow", "overlayClassName", "overlayStyle", "getPopupContainer"];
|
|
3
2
|
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
3
|
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
4
|
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; }
|
|
@@ -9,6 +8,7 @@ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableTo
|
|
|
9
8
|
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."); }
|
|
10
9
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
11
10
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
11
|
+
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); }
|
|
12
12
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
13
13
|
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."); }
|
|
14
14
|
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); }
|
|
@@ -17,11 +17,11 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
17
17
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
18
|
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; }
|
|
19
19
|
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; }
|
|
20
|
-
import React, { useEffect, useState, useImperativeHandle,
|
|
21
|
-
import { Button, DatePicker, Divider, Dropdown, Radio, Space, Tooltip, theme } from '@oceanbase/design';
|
|
22
|
-
import { LeftOutlined, RightOutlined, ZoomOutOutlined, SyncOutlined } from '@oceanbase/icons';
|
|
20
|
+
import React, { useEffect, useRef, useState, useImperativeHandle, useMemo } from 'react';
|
|
21
|
+
import { Button, DatePicker, Divider, Dropdown, Flex, Menu, Radio, Space, Tooltip, message, theme } from '@oceanbase/design';
|
|
22
|
+
import { LeftOutlined, RightOutlined, ZoomOutOutlined, SyncOutlined, ArrowLeftOutlined, CopyOutlined, DeleteOutlined } from '@oceanbase/icons';
|
|
23
23
|
import dayjs from 'dayjs';
|
|
24
|
-
import { findIndex, isNil, noop, omit } from 'lodash';
|
|
24
|
+
import { findIndex, isEqual as _isEqual, isNil, noop, omit } from 'lodash';
|
|
25
25
|
import moment from 'moment';
|
|
26
26
|
import classNames from 'classnames';
|
|
27
27
|
import LocaleWrapper from "../locale/LocaleWrapper";
|
|
@@ -31,8 +31,10 @@ import InternalPickerPanel from "./PickerPanel";
|
|
|
31
31
|
import zhCN from "./locale/zh-CN";
|
|
32
32
|
import "./index.less";
|
|
33
33
|
import { useClickAway } from 'ahooks';
|
|
34
|
+
import { useLocalStorageState } from '@oceanbase/util';
|
|
34
35
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
35
36
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
37
|
+
var DefaultMaxHistoryCapacity = 20;
|
|
36
38
|
var prefix = getPrefix('date-ranger');
|
|
37
39
|
var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
38
40
|
var _selects$;
|
|
@@ -63,6 +65,8 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
63
65
|
hideSecond = _props$hideSecond === void 0 ? false : _props$hideSecond,
|
|
64
66
|
_props$autoCalcRange = props.autoCalcRange,
|
|
65
67
|
autoCalcRange = _props$autoCalcRange === void 0 ? false : _props$autoCalcRange,
|
|
68
|
+
_props$history = props.history,
|
|
69
|
+
historyProp = _props$history === void 0 ? false : _props$history,
|
|
66
70
|
_props$onChange = props.onChange,
|
|
67
71
|
onChange = _props$onChange === void 0 ? noop : _props$onChange,
|
|
68
72
|
disabledDate = props.disabledDate,
|
|
@@ -116,15 +120,59 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
116
120
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
117
121
|
backRadioFocused = _useState10[0],
|
|
118
122
|
setBackRadioFocused = _useState10[1];
|
|
123
|
+
var _useState11 = useState(false),
|
|
124
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
125
|
+
historyMenuVisible = _useState12[0],
|
|
126
|
+
setHistoryMenuVisible = _useState12[1];
|
|
119
127
|
var rangeRef = useRef(null);
|
|
120
128
|
var popRef = useRef(null);
|
|
121
129
|
var labelRef = useRef(null);
|
|
122
130
|
|
|
123
131
|
// 没有 selects 时,回退到普通 RangePicker, 当前时间选项为自定义时,应该显示 RangePicker
|
|
124
|
-
var
|
|
125
|
-
|
|
126
|
-
isPlay =
|
|
127
|
-
setIsPlay =
|
|
132
|
+
var _useState13 = useState(rangeName !== CUSTOMIZE),
|
|
133
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
134
|
+
isPlay = _useState14[0],
|
|
135
|
+
setIsPlay = _useState14[1];
|
|
136
|
+
var history = useMemo(function () {
|
|
137
|
+
if (historyProp) {
|
|
138
|
+
return {
|
|
139
|
+
capacity: _typeof(historyProp) === 'object' ? historyProp.capacity : DefaultMaxHistoryCapacity
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
return false;
|
|
143
|
+
}, [historyProp]);
|
|
144
|
+
var _useLocalStorageState = useLocalStorageState('ob-design-date-ranger-local-storage-range-history-state', {
|
|
145
|
+
defaultValue: [],
|
|
146
|
+
listenStorageChange: true
|
|
147
|
+
}),
|
|
148
|
+
_useLocalStorageState2 = _slicedToArray(_useLocalStorageState, 2),
|
|
149
|
+
rangeHistory = _useLocalStorageState2[0],
|
|
150
|
+
setRangeHistory = _useLocalStorageState2[1];
|
|
151
|
+
var updateRangeHistory = function updateRangeHistory(range) {
|
|
152
|
+
if (!range) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
if (range.length < 2 || !history) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
var formattedValue = [range[0].format(YEAR_DATE_TIME_SECOND_FORMAT_CN), range[1].format(YEAR_DATE_TIME_SECOND_FORMAT_CN)];
|
|
159
|
+
if (rangeHistory.find(function (item) {
|
|
160
|
+
return _isEqual(item, formattedValue);
|
|
161
|
+
})) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
var updatedValue = [formattedValue].concat(_toConsumableArray(rangeHistory));
|
|
165
|
+
if (updatedValue.length > history.capacity) {
|
|
166
|
+
updatedValue.splice(0, history.capacity);
|
|
167
|
+
}
|
|
168
|
+
setRangeHistory(updatedValue);
|
|
169
|
+
};
|
|
170
|
+
var delRangeHistory = function delRangeHistory(range) {
|
|
171
|
+
var updatedValue = rangeHistory.filter(function (item) {
|
|
172
|
+
return !_isEqual(item, range);
|
|
173
|
+
});
|
|
174
|
+
setRangeHistory(updatedValue);
|
|
175
|
+
};
|
|
128
176
|
var compare = function compare(m1, m2) {
|
|
129
177
|
if (Array.isArray(m1) && !Array.isArray(m2)) return false;
|
|
130
178
|
if (Array.isArray(m2) && !Array.isArray(m1)) return false;
|
|
@@ -159,6 +207,7 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
159
207
|
var rangeChange = function rangeChange(range) {
|
|
160
208
|
setInnerValue(range);
|
|
161
209
|
onChange(range);
|
|
210
|
+
updateRangeHistory(range);
|
|
162
211
|
};
|
|
163
212
|
var datePickerChange = function datePickerChange(range) {
|
|
164
213
|
rangeChange(range);
|
|
@@ -221,6 +270,9 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
221
270
|
}
|
|
222
271
|
return isEN ? "Nearly ".concat(differenceSeconds, " seconds") : "\u8FD1 ".concat(differenceSeconds, " \u79D2");
|
|
223
272
|
};
|
|
273
|
+
var getHistoryTitle = function getHistoryTitle() {
|
|
274
|
+
return isEN ? 'History records' : '历史记录';
|
|
275
|
+
};
|
|
224
276
|
var setNow = function setNow() {
|
|
225
277
|
var selected = selects.find(function (item) {
|
|
226
278
|
return item.name === rangeName;
|
|
@@ -284,7 +336,99 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
284
336
|
ref: popRef,
|
|
285
337
|
className: classNames("".concat(prefix, "-dropdown-picker"), overlayClassName),
|
|
286
338
|
style: overlayStyle,
|
|
287
|
-
children: [
|
|
339
|
+
children: [/*#__PURE__*/_jsxs(Flex, {
|
|
340
|
+
vertical: true,
|
|
341
|
+
justify: "space-between",
|
|
342
|
+
children: [!historyMenuVisible && /*#__PURE__*/_jsx("div", {
|
|
343
|
+
className: "options",
|
|
344
|
+
children: originNode
|
|
345
|
+
}), history && historyMenuVisible && /*#__PURE__*/_jsxs("div", {
|
|
346
|
+
className: "history",
|
|
347
|
+
children: [/*#__PURE__*/_jsxs(Button, {
|
|
348
|
+
type: "link",
|
|
349
|
+
style: {
|
|
350
|
+
paddingLeft: 8,
|
|
351
|
+
color: token.colorTextBase
|
|
352
|
+
},
|
|
353
|
+
onClick: function onClick(e) {
|
|
354
|
+
setHistoryMenuVisible(false);
|
|
355
|
+
e.stopPropagation();
|
|
356
|
+
},
|
|
357
|
+
children: [/*#__PURE__*/_jsx(ArrowLeftOutlined, {
|
|
358
|
+
color: token.colorTextLabel
|
|
359
|
+
}), getHistoryTitle()]
|
|
360
|
+
}), /*#__PURE__*/_jsx(Menu, {
|
|
361
|
+
onClick: function onClick(_ref4) {
|
|
362
|
+
var rangeString = _ref4.key;
|
|
363
|
+
var vList = rangeString.split(',').map(function (v) {
|
|
364
|
+
return v.trim();
|
|
365
|
+
});
|
|
366
|
+
rangeChange(vList.map(function (v) {
|
|
367
|
+
return isMoment ? moment(v) : dayjs(v);
|
|
368
|
+
}));
|
|
369
|
+
handleNameChange(CUSTOMIZE);
|
|
370
|
+
},
|
|
371
|
+
style: {
|
|
372
|
+
maxHeight: 480,
|
|
373
|
+
overflowY: 'auto'
|
|
374
|
+
},
|
|
375
|
+
items: rangeHistory.map(function (range) {
|
|
376
|
+
return {
|
|
377
|
+
key: String(range),
|
|
378
|
+
label: /*#__PURE__*/_jsxs(Flex, {
|
|
379
|
+
className: "".concat(prefix, "-history-menu-item"),
|
|
380
|
+
vertical: true,
|
|
381
|
+
children: [/*#__PURE__*/_jsxs("span", {
|
|
382
|
+
children: [(isMoment ? moment(range[0]) : dayjs(range[0])).format(YEAR_DATE_TIME_SECOND_FORMAT_CN), "~"]
|
|
383
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
384
|
+
children: (isMoment ? moment(range[1]) : dayjs(range[1])).format(YEAR_DATE_TIME_SECOND_FORMAT_CN)
|
|
385
|
+
}), /*#__PURE__*/_jsxs(Space, {
|
|
386
|
+
className: "".concat(prefix, "-menu-text-btn-wrapper"),
|
|
387
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
388
|
+
className: "".concat(prefix, "-menu-text-btn"),
|
|
389
|
+
type: "text",
|
|
390
|
+
color: "default",
|
|
391
|
+
variant: "filled",
|
|
392
|
+
size: "small",
|
|
393
|
+
onClick: function onClick(e) {
|
|
394
|
+
e.stopPropagation();
|
|
395
|
+
var vList = range.map(function (v) {
|
|
396
|
+
return v;
|
|
397
|
+
});
|
|
398
|
+
var text = "".concat(vList.join('~'));
|
|
399
|
+
navigator.clipboard.writeText(text);
|
|
400
|
+
message.success(text);
|
|
401
|
+
},
|
|
402
|
+
children: /*#__PURE__*/_jsx(CopyOutlined, {})
|
|
403
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
404
|
+
className: "".concat(prefix, "-menu-text-btn"),
|
|
405
|
+
type: "text",
|
|
406
|
+
color: "default",
|
|
407
|
+
variant: "filled",
|
|
408
|
+
size: "small",
|
|
409
|
+
onClick: function onClick(e) {
|
|
410
|
+
e.stopPropagation();
|
|
411
|
+
delRangeHistory(range);
|
|
412
|
+
},
|
|
413
|
+
children: /*#__PURE__*/_jsx(DeleteOutlined, {})
|
|
414
|
+
})]
|
|
415
|
+
})]
|
|
416
|
+
}, String(range))
|
|
417
|
+
};
|
|
418
|
+
})
|
|
419
|
+
})]
|
|
420
|
+
}), history && !historyMenuVisible && /*#__PURE__*/_jsxs(Button, {
|
|
421
|
+
type: "link",
|
|
422
|
+
style: {
|
|
423
|
+
width: 'max-content'
|
|
424
|
+
},
|
|
425
|
+
onClick: function onClick(e) {
|
|
426
|
+
setHistoryMenuVisible(true);
|
|
427
|
+
e.stopPropagation();
|
|
428
|
+
},
|
|
429
|
+
children: [getHistoryTitle(), /*#__PURE__*/_jsx(RightOutlined, {})]
|
|
430
|
+
})]
|
|
431
|
+
}), /*#__PURE__*/_jsx(Divider, {
|
|
288
432
|
type: "vertical",
|
|
289
433
|
style: {
|
|
290
434
|
height: 'auto',
|
|
@@ -317,9 +461,9 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
317
461
|
menu: {
|
|
318
462
|
selectable: true,
|
|
319
463
|
defaultSelectedKeys: [rangeName],
|
|
320
|
-
onClick: function onClick(
|
|
321
|
-
var key =
|
|
322
|
-
domEvent =
|
|
464
|
+
onClick: function onClick(_ref5) {
|
|
465
|
+
var key = _ref5.key,
|
|
466
|
+
domEvent = _ref5.domEvent;
|
|
323
467
|
var selected = selects.find(function (_item) {
|
|
324
468
|
return _item.name === key;
|
|
325
469
|
});
|
|
@@ -192,7 +192,7 @@ export var THIS_WEEK = {
|
|
|
192
192
|
export var LAST_WEEK = {
|
|
193
193
|
label: '上周',
|
|
194
194
|
enLabel: 'Last week',
|
|
195
|
-
rangeLabel: '
|
|
195
|
+
rangeLabel: '1w',
|
|
196
196
|
name: 'LAST_WEEK',
|
|
197
197
|
range: function range() {
|
|
198
198
|
var current = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : moment();
|
package/es/DateRanger/index.less
CHANGED
|
@@ -155,3 +155,26 @@
|
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
+
|
|
159
|
+
.@{prefix}-history-menu-item {
|
|
160
|
+
.@{prefix}-menu-text-btn-wrapper {
|
|
161
|
+
justify-content: space-between;
|
|
162
|
+
height: 0;
|
|
163
|
+
transition: height 0.2s;
|
|
164
|
+
overflow: hidden;
|
|
165
|
+
}
|
|
166
|
+
&:hover {
|
|
167
|
+
.@{prefix}-menu-text-btn-wrapper {
|
|
168
|
+
height: 22px;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.@{prefix}-menu-text-btn {
|
|
174
|
+
width: 72px;
|
|
175
|
+
|
|
176
|
+
background-color: @colorFillSecondary !important;
|
|
177
|
+
&:hover {
|
|
178
|
+
background-color: @colorFill !important;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { CSSObject } from '@ant-design/cssinjs';
|
|
3
2
|
import type { FooterToolBarToken } from '@ant-design/pro-layout/es/components/FooterToolbar/style';
|
|
4
3
|
import type { GenerateStyle } from '@oceanbase/design/es/theme';
|
|
5
|
-
export declare const genCompactStyle: (componentCls: string, subComponentCls?: string) => CSSObject;
|
|
6
4
|
export declare const genFooterToolbarStyle: GenerateStyle<FooterToolBarToken>;
|
|
7
5
|
declare const _default: (prefixCls: string) => {
|
|
8
6
|
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").JSX.Element;
|
|
@@ -3,18 +3,6 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
3
3
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
4
4
|
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); }
|
|
5
5
|
import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
|
|
6
|
-
export var genCompactStyle = function genCompactStyle(componentCls) {
|
|
7
|
-
var subComponentCls = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
8
|
-
return _defineProperty(_defineProperty(_defineProperty({}, "&".concat(componentCls, "-compact-item:not(").concat(componentCls, "-compact-last-item)").concat(componentCls, "-compact-first-item ").concat(subComponentCls), {
|
|
9
|
-
borderStartEndRadius: 0,
|
|
10
|
-
borderEndEndRadius: 0
|
|
11
|
-
}), "&".concat(componentCls, "-compact-item:not(").concat(componentCls, "-compact-first-item):not(").concat(componentCls, "-compact-last-item) ").concat(subComponentCls), {
|
|
12
|
-
borderRadius: 0
|
|
13
|
-
}), "&".concat(componentCls, "-compact-item:not(").concat(componentCls, "-compact-first-item)").concat(componentCls, "-compact-last-item ").concat(subComponentCls), {
|
|
14
|
-
borderStartStartRadius: 0,
|
|
15
|
-
borderEndStartRadius: 0
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
6
|
export var genFooterToolbarStyle = function genFooterToolbarStyle(token) {
|
|
19
7
|
var componentCls = token.componentCls,
|
|
20
8
|
colorBgBase = token.colorBgBase,
|
|
@@ -7,12 +7,12 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
7
7
|
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); }
|
|
8
8
|
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
9
|
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
|
-
import { SyncOutlined } from '@oceanbase/icons';
|
|
10
|
+
import { ArrowLeftOutlined, SyncOutlined } from '@oceanbase/icons';
|
|
11
11
|
import { PageContainer as AntPageContainer } from '@ant-design/pro-components';
|
|
12
12
|
import classNames from 'classnames';
|
|
13
13
|
import { isObject } from 'lodash';
|
|
14
14
|
import React, { useContext } from 'react';
|
|
15
|
-
import { ConfigProvider, Space, Tooltip } from '@oceanbase/design';
|
|
15
|
+
import { Button, ConfigProvider, Space, Tooltip, theme } from '@oceanbase/design';
|
|
16
16
|
import LocaleWrapper from "../locale/LocaleWrapper";
|
|
17
17
|
import ItemRender from "./ItemRender";
|
|
18
18
|
import PageLoading from "../PageLoading";
|
|
@@ -39,10 +39,19 @@ var PageContainer = function PageContainer(_ref) {
|
|
|
39
39
|
var prefixCls = getPrefixCls('pro-page-container', customizePrefixCls);
|
|
40
40
|
var _useStyle = useStyle(prefixCls),
|
|
41
41
|
wrapSSR = _useStyle.wrapSSR;
|
|
42
|
+
var _theme$useToken = theme.useToken(),
|
|
43
|
+
token = _theme$useToken.token;
|
|
42
44
|
var _ref2 = header || {},
|
|
43
45
|
reload = _ref2.reload,
|
|
44
46
|
subTitle = _ref2.subTitle,
|
|
45
|
-
breadcrumb = _ref2.breadcrumb
|
|
47
|
+
breadcrumb = _ref2.breadcrumb,
|
|
48
|
+
_ref2$backIcon = _ref2.backIcon,
|
|
49
|
+
backIcon = _ref2$backIcon === void 0 ? /*#__PURE__*/_jsx(Button, {
|
|
50
|
+
style: {
|
|
51
|
+
fontSize: token.fontSizeLG
|
|
52
|
+
},
|
|
53
|
+
icon: /*#__PURE__*/_jsx(ArrowLeftOutlined, {})
|
|
54
|
+
}) : _ref2$backIcon;
|
|
46
55
|
var reloadProps = isObject(reload) && ! /*#__PURE__*/React.isValidElement(reload) ? reload : {};
|
|
47
56
|
var reloadCls = classNames("".concat(rootPrefixCls, "-page-header-heading-reload"), reloadProps.className);
|
|
48
57
|
var newSubTitle = (reload || subTitle) && /*#__PURE__*/_jsxs(Space, {
|
|
@@ -64,7 +73,8 @@ var PageContainer = function PageContainer(_ref) {
|
|
|
64
73
|
paths: paths
|
|
65
74
|
});
|
|
66
75
|
}
|
|
67
|
-
}, breadcrumb)
|
|
76
|
+
}, breadcrumb),
|
|
77
|
+
backIcon: backIcon
|
|
68
78
|
});
|
|
69
79
|
var noHasHeader = !title && ['title', 'subTitle', 'extra', 'tags', 'avatar', 'backIcon', 'breadcrumb'].every(function (item) {
|
|
70
80
|
return !(newHeader !== null && newHeader !== void 0 && newHeader[item]);
|
|
@@ -11,18 +11,16 @@ export var genPageContainerStyle = function genPageContainerStyle(token) {
|
|
|
11
11
|
proComponentsCls = token.proComponentsCls,
|
|
12
12
|
componentCls = token.componentCls,
|
|
13
13
|
colorBgLayout = token.colorBgLayout,
|
|
14
|
-
|
|
14
|
+
fontSizeHeading2 = token.fontSizeHeading2,
|
|
15
15
|
controlHeightLG = token.controlHeightLG,
|
|
16
16
|
padding = token.padding,
|
|
17
17
|
paddingLG = token.paddingLG;
|
|
18
|
-
var height = controlHeightLG;
|
|
19
|
-
var lineHeight = "".concat(controlHeightLG, "px");
|
|
20
18
|
return _objectSpread(_defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls), _defineProperty(_defineProperty(_defineProperty({
|
|
21
19
|
minHeight: '100vh',
|
|
22
20
|
backgroundColor: colorBgLayout
|
|
23
21
|
}, "".concat(proComponentsCls, "-grid-content"), {
|
|
24
22
|
minHeight: 'auto'
|
|
25
|
-
}), "".concat(componentCls, "-warp-page-header,").concat(componentCls, "-wrap-page-header"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
23
|
+
}), "".concat(componentCls, "-warp-page-header,").concat(componentCls, "-wrap-page-header"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
26
24
|
// 减小内容区左右两侧间距
|
|
27
25
|
paddingInlineStart: "".concat(paddingLG, "px !important"),
|
|
28
26
|
paddingInlineEnd: "".concat(paddingLG, "px !important"),
|
|
@@ -34,15 +32,15 @@ export var genPageContainerStyle = function genPageContainerStyle(token) {
|
|
|
34
32
|
}), "".concat(antCls, "-page-header-heading"), {
|
|
35
33
|
paddingBlockStart: 0
|
|
36
34
|
}), "".concat(antCls, "-page-header-heading-title"), {
|
|
37
|
-
fontSize:
|
|
35
|
+
fontSize: fontSizeHeading2,
|
|
38
36
|
marginInlineEnd: token.marginXS
|
|
39
37
|
}), "".concat(antCls, "-page-header-heading-reload"), {
|
|
40
38
|
cursor: 'pointer',
|
|
41
39
|
fontSize: token.fontSizeLG,
|
|
42
40
|
marginTop: token.marginXXS
|
|
41
|
+
}), "".concat(antCls, "-page-header-heading-left"), {
|
|
42
|
+
marginBlock: 0
|
|
43
43
|
}), "".concat(antCls, "-page-header-heading-extra"), {
|
|
44
|
-
height: height,
|
|
45
|
-
lineHeight: lineHeight,
|
|
46
44
|
marginBlock: 0
|
|
47
45
|
}), "".concat(antCls, "-page-header-footer"), {
|
|
48
46
|
marginBlockStart: 0
|
package/es/ProCard/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["bordered", "ghost", "title", "tabs", "headerBordered", "bodyStyle", "prefixCls", "className", "style"];
|
|
1
|
+
var _excluded = ["loading", "bordered", "ghost", "title", "tabs", "headerBordered", "bodyStyle", "prefixCls", "className", "style"];
|
|
2
2
|
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; }
|
|
3
3
|
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; }
|
|
4
4
|
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); }
|
|
@@ -9,7 +9,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
9
9
|
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
10
|
import React, { useContext } from 'react';
|
|
11
11
|
import { ProCard as AntProCard } from '@ant-design/pro-components';
|
|
12
|
-
import { ConfigProvider, theme } from '@oceanbase/design';
|
|
12
|
+
import { ConfigProvider, Skeleton, theme } from '@oceanbase/design';
|
|
13
13
|
import { isHorizontalPaddingZero } from '@oceanbase/design/es/_util';
|
|
14
14
|
import { CaretRightFilled } from '@oceanbase/icons';
|
|
15
15
|
import classNames from 'classnames';
|
|
@@ -17,7 +17,8 @@ import useStyle from "./style";
|
|
|
17
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
18
|
// @ts-ignore
|
|
19
19
|
var ProCard = function ProCard(_ref) {
|
|
20
|
-
var
|
|
20
|
+
var loading = _ref.loading,
|
|
21
|
+
bordered = _ref.bordered,
|
|
21
22
|
ghost = _ref.ghost,
|
|
22
23
|
title = _ref.title,
|
|
23
24
|
tabs = _ref.tabs,
|
|
@@ -41,6 +42,13 @@ var ProCard = function ProCard(_ref) {
|
|
|
41
42
|
var noBodyHorizontalPadding = isHorizontalPaddingZero(bodyStyle === null || bodyStyle === void 0 ? void 0 : bodyStyle.padding) || ghost;
|
|
42
43
|
var proCardCls = classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-has-title"), !!title), "".concat(prefixCls, "-no-body-horizontal-padding"), noBodyHorizontalPadding), "".concat(prefixCls, "-no-divider"), !headerBordered), "".concat(prefixCls, "-contain-tabs"), !!tabs), contextCard === null || contextCard === void 0 ? void 0 : contextCard.className, className);
|
|
43
44
|
return wrapSSR( /*#__PURE__*/_jsx(AntProCard, _objectSpread({
|
|
45
|
+
loading: loading === true ? /*#__PURE__*/_jsx(Skeleton, {
|
|
46
|
+
active: true,
|
|
47
|
+
title: false,
|
|
48
|
+
paragraph: {
|
|
49
|
+
rows: 4
|
|
50
|
+
}
|
|
51
|
+
}) : loading,
|
|
44
52
|
prefixCls: customizePrefixCls,
|
|
45
53
|
bordered: bordered !== null && bordered !== void 0 ? bordered : contextCard !== null && contextCard !== void 0 && contextCard.variant ? (contextCard === null || contextCard === void 0 ? void 0 : contextCard.variant) === 'outlined' : undefined,
|
|
46
54
|
ghost: ghost,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
2
|
+
import type { CSSObject } from '@ant-design/cssinjs';
|
|
3
3
|
import type { OBToken } from '../../_util/genComponentStyleHook';
|
|
4
|
-
export declare const genProCardStyle:
|
|
4
|
+
export declare const genProCardStyle: (token: OBToken, outerComponentCls?: string) => CSSObject;
|
|
5
5
|
declare const _default: (prefixCls: string) => {
|
|
6
6
|
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").JSX.Element;
|
|
7
7
|
hashId: string;
|
|
@@ -6,15 +6,18 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
6
6
|
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); }
|
|
7
7
|
import { Card, Tabs } from '@oceanbase/design';
|
|
8
8
|
import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
|
|
9
|
-
export var genProCardStyle = function genProCardStyle(token) {
|
|
10
|
-
var
|
|
9
|
+
export var genProCardStyle = function genProCardStyle(token, outerComponentCls) {
|
|
10
|
+
var innerComponentCls = token.componentCls,
|
|
11
11
|
antCls = token.antCls,
|
|
12
12
|
prefixCls = token.prefixCls;
|
|
13
|
+
var componentCls = outerComponentCls || innerComponentCls;
|
|
13
14
|
var tableComponentCls = "".concat(antCls, "-table");
|
|
14
15
|
var tabsComponentCls = "".concat(antCls, "-tabs");
|
|
15
16
|
var tabsPrefixCls = "".concat(prefixCls, "-tabs");
|
|
16
|
-
return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "div".concat(componentCls), {
|
|
17
|
+
return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "div".concat(componentCls), {
|
|
17
18
|
borderRadius: token.borderRadiusLG
|
|
19
|
+
}), "".concat(componentCls).concat(componentCls, "-border"), {
|
|
20
|
+
border: "".concat(token.lineWidth, "px solid ").concat(token.colorBorderSecondary)
|
|
18
21
|
}), "".concat(componentCls, ":not(").concat(componentCls, "-border):not(").concat(componentCls, "-ghost)"), {
|
|
19
22
|
boxShadow: '0 1px 2px 0 rgba(0, 0, 0, 0.03),0 1px 6px -1px rgba(0, 0, 0, 0.02),0 2px 4px 0 rgba(0, 0, 0, 0.02)'
|
|
20
23
|
}), "".concat(componentCls, ":not(").concat(componentCls, "-size-small):not(").concat(componentCls, "-ghost)"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-body"), {
|
package/es/ProTable/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { ProTableProps as AntProTableProps } from '@ant-design/pro-componen
|
|
|
3
3
|
export interface ProTableProps<T, U, ValueType> extends AntProTableProps<T, U, ValueType> {
|
|
4
4
|
innerBordered?: boolean;
|
|
5
5
|
}
|
|
6
|
-
declare function ProTable<T, U, ValueType>({ form, headerTitle, options, optionsRender, toolbar, toolBarRender, size, bordered, innerBordered, expandable, rowSelection, pagination: customPagination, footer, locale, cardProps: outerCardProps, prefixCls: customizePrefixCls, tableClassName, className, ...restProps }: ProTableProps<T, U, ValueType>): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
6
|
+
declare function ProTable<T, U, ValueType>({ form, headerTitle, options, optionsRender, toolbar, toolBarRender, size, bordered, innerBordered, cardBordered, expandable, rowSelection, pagination: customPagination, footer, locale, cardProps: outerCardProps, prefixCls: customizePrefixCls, tableClassName, className, ...restProps }: ProTableProps<T, U, ValueType>): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
7
7
|
declare namespace ProTable {
|
|
8
8
|
var Summary;
|
|
9
9
|
}
|
package/es/ProTable/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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 = ["form", "headerTitle", "options", "optionsRender", "toolbar", "toolBarRender", "size", "bordered", "innerBordered", "expandable", "rowSelection", "pagination", "footer", "locale", "cardProps", "prefixCls", "tableClassName", "className"],
|
|
2
|
+
var _excluded = ["form", "headerTitle", "options", "optionsRender", "toolbar", "toolBarRender", "size", "bordered", "innerBordered", "cardBordered", "expandable", "rowSelection", "pagination", "footer", "locale", "cardProps", "prefixCls", "tableClassName", "className"],
|
|
3
3
|
_excluded2 = ["emptyText"];
|
|
4
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; }
|
|
5
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; }
|
|
@@ -12,7 +12,7 @@ import React, { useContext } from 'react';
|
|
|
12
12
|
import { ProTable as AntProTable } from '@ant-design/pro-components';
|
|
13
13
|
import { ConfigProvider, Empty, Table } from '@oceanbase/design';
|
|
14
14
|
import classNames from 'classnames';
|
|
15
|
-
import { isEmpty } from 'lodash';
|
|
15
|
+
import { isEmpty, merge } from 'lodash';
|
|
16
16
|
import useLightFilterStyle from "../LightFilter/style";
|
|
17
17
|
import useStyle from "./style";
|
|
18
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -28,6 +28,7 @@ function ProTable(_ref) {
|
|
|
28
28
|
size = _ref.size,
|
|
29
29
|
bordered = _ref.bordered,
|
|
30
30
|
innerBordered = _ref.innerBordered,
|
|
31
|
+
cardBordered = _ref.cardBordered,
|
|
31
32
|
expandable = _ref.expandable,
|
|
32
33
|
rowSelection = _ref.rowSelection,
|
|
33
34
|
customPagination = _ref.pagination,
|
|
@@ -39,7 +40,8 @@ function ProTable(_ref) {
|
|
|
39
40
|
className = _ref.className,
|
|
40
41
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
41
42
|
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
42
|
-
getPrefixCls = _useContext.getPrefixCls
|
|
43
|
+
getPrefixCls = _useContext.getPrefixCls,
|
|
44
|
+
contextCard = _useContext.card;
|
|
43
45
|
|
|
44
46
|
// customize Table style
|
|
45
47
|
var tablePrefixCls = getPrefixCls('table', customizePrefixCls);
|
|
@@ -62,7 +64,7 @@ function ProTable(_ref) {
|
|
|
62
64
|
image: Empty.PRESENTED_IMAGE_SIMPLE
|
|
63
65
|
}) : _ref2$emptyText,
|
|
64
66
|
restLocale = _objectWithoutProperties(_ref2, _excluded2);
|
|
65
|
-
var cardProps = typeof outerCardProps === 'boolean' ? {} : outerCardProps;
|
|
67
|
+
var cardProps = merge({}, contextCard, typeof outerCardProps === 'boolean' ? {} : outerCardProps);
|
|
66
68
|
var proCardCls = getPrefixCls('pro-card', customizePrefixCls);
|
|
67
69
|
return tableWrapSSR(lightFilterWrapSSR(wrapSSR( /*#__PURE__*/_jsx(AntProTable
|
|
68
70
|
// default size change to `large` as same as Table
|
|
@@ -70,6 +72,7 @@ function ProTable(_ref) {
|
|
|
70
72
|
defaultSize: "large",
|
|
71
73
|
size: size,
|
|
72
74
|
bordered: bordered || innerBordered,
|
|
75
|
+
cardBordered: cardBordered !== null && cardBordered !== void 0 ? cardBordered : contextCard !== null && contextCard !== void 0 && contextCard.variant ? (contextCard === null || contextCard === void 0 ? void 0 : contextCard.variant) === 'outlined' : undefined,
|
|
73
76
|
form: _objectSpread({
|
|
74
77
|
// query form should remove required mark
|
|
75
78
|
requiredMark: false
|
|
@@ -80,7 +83,10 @@ function ProTable(_ref) {
|
|
|
80
83
|
toolbar: toolbar,
|
|
81
84
|
toolBarRender: toolBarRender,
|
|
82
85
|
cardProps: _objectSpread(_objectSpread({}, cardProps), {}, {
|
|
83
|
-
className: classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(proCardCls, "-has-title"), !!headerTitle || options || options === undefined || optionsRender || toolbar || toolBarRender), "".concat(proCardCls, "-no-divider"), !(cardProps !== null && cardProps !== void 0 && cardProps.headerBordered)), "".concat(proCardCls, "-no-padding"), true), "".concat(proCardCls, "-contain-tabs"), !!(cardProps !== null && cardProps !== void 0 && cardProps.tabs)), cardProps === null || cardProps === void 0 ? void 0 : cardProps.className)
|
|
86
|
+
className: classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(proCardCls, "-has-title"), !!headerTitle || options || options === undefined || optionsRender || toolbar || toolBarRender), "".concat(proCardCls, "-no-divider"), !(cardProps !== null && cardProps !== void 0 && cardProps.headerBordered) && !(cardProps !== null && cardProps !== void 0 && cardProps.divided)), "".concat(proCardCls, "-no-padding"), true), "".concat(proCardCls, "-contain-tabs"), !!(cardProps !== null && cardProps !== void 0 && cardProps.tabs)), cardProps === null || cardProps === void 0 ? void 0 : cardProps.className),
|
|
87
|
+
bodyStyle: _objectSpread({
|
|
88
|
+
paddingBlock: 0
|
|
89
|
+
}, cardProps === null || cardProps === void 0 ? void 0 : cardProps.bodyStyle)
|
|
84
90
|
}),
|
|
85
91
|
expandable: expandable ? _objectSpread({
|
|
86
92
|
columnWidth: !size || size === 'large' ? 40 : 32
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
2
|
+
import type { CSSObject } from '@ant-design/cssinjs';
|
|
3
3
|
import type { OBToken } from '../../_util/genComponentStyleHook';
|
|
4
|
-
export declare const genProTableStyle:
|
|
4
|
+
export declare const genProTableStyle: (token: OBToken) => CSSObject;
|
|
5
5
|
declare const _default: (prefixCls: string) => {
|
|
6
6
|
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").JSX.Element;
|
|
7
7
|
hashId: string;
|
|
@@ -6,20 +6,23 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
6
6
|
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); }
|
|
7
7
|
import { Card } from '@oceanbase/design';
|
|
8
8
|
import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
|
|
9
|
+
import { genProCardStyle } from "../../ProCard/style";
|
|
9
10
|
export var genProTableStyle = function genProTableStyle(token) {
|
|
10
11
|
var antCls = token.antCls,
|
|
11
12
|
componentCls = token.componentCls,
|
|
12
13
|
proComponentsCls = token.proComponentsCls;
|
|
13
14
|
var proCardComponentCls = "".concat(proComponentsCls, "-card");
|
|
14
|
-
return _defineProperty({}, "".concat(componentCls), _defineProperty(_defineProperty({}, "".concat(proComponentsCls, "-query-filter-actions"), _defineProperty({}, "".concat(antCls, "-space").concat(antCls, "-space-horizontal").concat(antCls, "-space-align-center"), {
|
|
15
|
+
return _objectSpread(_defineProperty({}, "".concat(componentCls), _defineProperty(_defineProperty(_defineProperty({}, "".concat(proComponentsCls, "-query-filter-actions"), _defineProperty({}, "".concat(antCls, "-space").concat(antCls, "-space-horizontal").concat(antCls, "-space-align-center"), {
|
|
15
16
|
flexDirection: 'row-reverse'
|
|
16
|
-
})), "".concat(proCardComponentCls
|
|
17
|
+
})), "& > ".concat(proCardComponentCls, ", ").concat(proCardComponentCls).concat(componentCls, "-search-light-filter"), {
|
|
18
|
+
boxShadow: 'none !important'
|
|
19
|
+
}), "".concat(proCardComponentCls).concat(proCardComponentCls, "-no-padding"), _objectSpread(_defineProperty({}, "".concat(proCardComponentCls, "-body"), _defineProperty({
|
|
17
20
|
paddingInline: 0
|
|
18
21
|
}, "".concat(componentCls, "-list-toolbar-container"), {
|
|
19
22
|
paddingInline: token.paddingLG
|
|
20
23
|
})), Card.genTableStyle(token.paddingLG, _objectSpread(_objectSpread({}, token), {}, {
|
|
21
24
|
componentCls: proCardComponentCls
|
|
22
|
-
})))));
|
|
25
|
+
}))))), genProCardStyle(token, proCardComponentCls));
|
|
23
26
|
};
|
|
24
27
|
export default (function (prefixCls) {
|
|
25
28
|
var useStyle = genComponentStyleHook('ProTable', function (token) {
|