@oceanbase/ui 1.0.0-alpha.0 → 1.0.0-alpha.2
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/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 +24 -1
- package/es/GraphToolbar/index.less +1 -1
- package/es/Highlight/index.d.ts +1 -1
- package/es/Highlight/index.less +2 -2
- package/es/PageContainer/index.js +14 -4
- package/es/PageContainer/style/index.js +5 -7
- package/es/ProCard/index.d.ts +2 -1
- package/es/ProCard/index.js +20 -8
- package/es/ProCard/style/index.js +3 -1
- package/es/ProTable/index.d.ts +1 -1
- package/es/ProTable/index.js +11 -5
- package/es/ProTable/style/index.js +4 -2
- package/lib/DateRanger/Ranger.d.ts +4 -0
- package/lib/DateRanger/Ranger.js +134 -1
- package/lib/DateRanger/constant/index.js +1 -1
- package/lib/DateRanger/index.less +24 -1
- package/lib/GraphToolbar/index.less +1 -1
- package/lib/Highlight/index.d.ts +1 -1
- package/lib/Highlight/index.less +2 -2
- package/lib/PageContainer/index.js +9 -2
- package/lib/PageContainer/style/index.js +5 -6
- package/lib/ProCard/index.d.ts +2 -1
- package/lib/ProCard/index.js +18 -5
- package/lib/ProCard/style/index.js +3 -0
- package/lib/ProTable/index.d.ts +1 -1
- package/lib/ProTable/index.js +14 -4
- package/lib/ProTable/style/index.js +7 -0
- package/package.json +5 -5
|
@@ -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
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
border: 1px solid @colorBorder;
|
|
11
11
|
box-sizing: border-box;
|
|
12
12
|
display: flex;
|
|
13
|
-
border-radius:
|
|
13
|
+
border-radius: @borderRadius;
|
|
14
14
|
transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
15
15
|
// FIXED: 存在不生效情况
|
|
16
16
|
.@{prefix}-picker {
|
|
@@ -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
|
+
}
|
package/es/Highlight/index.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export declare const THEME_DARK = "dark";
|
|
|
29
29
|
export declare const THEME_LIGHT = "light";
|
|
30
30
|
declare const ThemeTypes: ["dark", "light"];
|
|
31
31
|
export type ThemeType = (typeof ThemeTypes)[number];
|
|
32
|
-
declare const supportedLanguages: ("
|
|
32
|
+
declare const supportedLanguages: ("css" | "json" | "jsx" | "tsx" | "ruby" | "javascript" | "typescript" | "groovy" | "java" | "python" | "bash" | "cpp" | "http" | "markdown" | "nginx" | "sql" | "xml" | "dockerfile" | "go" | "yaml" | "solidity")[];
|
|
33
33
|
export type LanguageType = (typeof supportedLanguages)[number] | 'html';
|
|
34
34
|
export interface HighlightProps extends LocaleWrapperProps {
|
|
35
35
|
/**
|
package/es/Highlight/index.less
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
font-size: 14px;
|
|
11
11
|
line-height: 1.5714285714285714;
|
|
12
12
|
list-style: none;
|
|
13
|
-
border-radius:
|
|
13
|
+
border-radius: @borderRadius;
|
|
14
14
|
|
|
15
15
|
&:not(:hover) .@{prefix}-copy {
|
|
16
16
|
visibility: hidden;
|
|
@@ -192,7 +192,7 @@
|
|
|
192
192
|
overflow-x: auto;
|
|
193
193
|
color: #c0c5ce;
|
|
194
194
|
background: #2b303b;
|
|
195
|
-
border-radius:
|
|
195
|
+
border-radius: @borderRadius;
|
|
196
196
|
|
|
197
197
|
&.@{prefix}-index {
|
|
198
198
|
border-inline-end: 1px solid rgba(255, 255, 255, 0.05);
|
|
@@ -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.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ProCard as AntProCard } from '@ant-design/pro-components';
|
|
2
2
|
import type { ProCardProps } from '@ant-design/pro-components';
|
|
3
3
|
export { ProCardProps };
|
|
4
|
-
|
|
4
|
+
export type ProCardType = typeof AntProCard;
|
|
5
|
+
declare const ProCard: ProCardType;
|
|
5
6
|
export default ProCard;
|
package/es/ProCard/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["ghost", "title", "tabs", "headerBordered", "bodyStyle", "prefixCls", "className"];
|
|
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,26 +9,29 @@ 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 } from '@oceanbase/design';
|
|
12
|
+
import { ConfigProvider, Skeleton, theme } from '@oceanbase/design';
|
|
13
13
|
import { isHorizontalPaddingZero } from '@oceanbase/design/es/_util';
|
|
14
|
-
import {
|
|
14
|
+
import { CaretRightFilled } from '@oceanbase/icons';
|
|
15
15
|
import classNames from 'classnames';
|
|
16
16
|
import useStyle from "./style";
|
|
17
|
-
import { CaretRightFilled } from '@oceanbase/icons';
|
|
18
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
18
|
// @ts-ignore
|
|
20
19
|
var ProCard = function ProCard(_ref) {
|
|
21
|
-
var
|
|
20
|
+
var loading = _ref.loading,
|
|
21
|
+
bordered = _ref.bordered,
|
|
22
|
+
ghost = _ref.ghost,
|
|
22
23
|
title = _ref.title,
|
|
23
24
|
tabs = _ref.tabs,
|
|
24
25
|
headerBordered = _ref.headerBordered,
|
|
25
26
|
bodyStyle = _ref.bodyStyle,
|
|
26
27
|
customizePrefixCls = _ref.prefixCls,
|
|
27
28
|
className = _ref.className,
|
|
29
|
+
style = _ref.style,
|
|
28
30
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
29
31
|
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
30
32
|
getPrefixCls = _useContext.getPrefixCls,
|
|
31
|
-
iconPrefixCls = _useContext.iconPrefixCls
|
|
33
|
+
iconPrefixCls = _useContext.iconPrefixCls,
|
|
34
|
+
contextCard = _useContext.card;
|
|
32
35
|
var prefixCls = getPrefixCls('pro-card', customizePrefixCls);
|
|
33
36
|
var _useStyle = useStyle(prefixCls),
|
|
34
37
|
wrapSSR = _useStyle.wrapSSR;
|
|
@@ -37,17 +40,26 @@ var ProCard = function ProCard(_ref) {
|
|
|
37
40
|
|
|
38
41
|
// ProCard body no horizontal padding
|
|
39
42
|
var noBodyHorizontalPadding = isHorizontalPaddingZero(bodyStyle === null || bodyStyle === void 0 ? void 0 : bodyStyle.padding) || ghost;
|
|
40
|
-
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), className);
|
|
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);
|
|
41
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,
|
|
42
52
|
prefixCls: customizePrefixCls,
|
|
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,
|
|
43
54
|
ghost: ghost,
|
|
44
55
|
title: title,
|
|
45
56
|
tabs: _typeof(tabs) === 'object' ? _objectSpread({
|
|
46
57
|
size: 'large'
|
|
47
58
|
}, tabs) : tabs,
|
|
48
|
-
headerBordered: headerBordered,
|
|
59
|
+
headerBordered: headerBordered !== null && headerBordered !== void 0 ? headerBordered : contextCard === null || contextCard === void 0 ? void 0 : contextCard.divided,
|
|
49
60
|
bodyStyle: bodyStyle,
|
|
50
61
|
className: proCardCls,
|
|
62
|
+
style: _objectSpread(_objectSpread({}, contextCard === null || contextCard === void 0 ? void 0 : contextCard.style), style),
|
|
51
63
|
collapsibleIconRender: function collapsibleIconRender(_ref2) {
|
|
52
64
|
var collapsed = _ref2.collapsed;
|
|
53
65
|
return /*#__PURE__*/_jsx(CaretRightFilled, {
|
|
@@ -13,8 +13,10 @@ export var genProCardStyle = function genProCardStyle(token) {
|
|
|
13
13
|
var tableComponentCls = "".concat(antCls, "-table");
|
|
14
14
|
var tabsComponentCls = "".concat(antCls, "-tabs");
|
|
15
15
|
var tabsPrefixCls = "".concat(prefixCls, "-tabs");
|
|
16
|
-
return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "div".concat(componentCls), {
|
|
16
|
+
return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "div".concat(componentCls), {
|
|
17
17
|
borderRadius: token.borderRadiusLG
|
|
18
|
+
}), "".concat(componentCls).concat(componentCls, "-border"), {
|
|
19
|
+
border: "".concat(token.lineWidth, "px solid ").concat(token.colorBorderSecondary)
|
|
18
20
|
}), "".concat(componentCls, ":not(").concat(componentCls, "-border):not(").concat(componentCls, "-ghost)"), {
|
|
19
21
|
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
22
|
}), "".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
|
|
@@ -11,9 +11,11 @@ export var genProTableStyle = function genProTableStyle(token) {
|
|
|
11
11
|
componentCls = token.componentCls,
|
|
12
12
|
proComponentsCls = token.proComponentsCls;
|
|
13
13
|
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"), {
|
|
14
|
+
return _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
15
|
flexDirection: 'row-reverse'
|
|
16
|
-
})), "".concat(proCardComponentCls).concat(proCardComponentCls, "-no-
|
|
16
|
+
})), "".concat(proCardComponentCls, ":not(").concat(proCardComponentCls, "-no-divider)"), _defineProperty({}, "".concat(proCardComponentCls, "-body"), _defineProperty({}, "".concat(componentCls, "-list-toolbar-container"), {
|
|
17
|
+
borderBottom: "".concat(token.lineWidth, "px solid ").concat(token.colorBorderSecondary)
|
|
18
|
+
}))), "".concat(proCardComponentCls).concat(proCardComponentCls, "-no-padding"), _objectSpread(_defineProperty({}, "".concat(proCardComponentCls, "-body"), _defineProperty({
|
|
17
19
|
paddingInline: 0
|
|
18
20
|
}, "".concat(componentCls, "-list-toolbar-container"), {
|
|
19
21
|
paddingInline: token.paddingLG
|