@oceanbase/ui 0.4.7 → 0.4.9
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.js +1 -1
- package/es/DateRanger/PickerPanel.js +9 -2
- package/es/DateRanger/Ranger.d.ts +3 -0
- package/es/DateRanger/Ranger.js +12 -6
- package/es/DateRanger/locale/en-US.d.ts +1 -0
- package/es/DateRanger/locale/zh-CN.d.ts +1 -0
- package/es/DateRanger/locale/zh-TW.d.ts +1 -0
- package/es/Highlight/index.d.ts +1 -1
- package/es/ProCard/index.js +5 -3
- package/es/ProCard/style/index.js +9 -4
- package/es/ProTable/index.js +17 -1
- package/es/ProTable/style/index.js +12 -2
- package/lib/DateRanger/PickerPanel.js +5 -2
- package/lib/DateRanger/Ranger.d.ts +3 -0
- package/lib/DateRanger/Ranger.js +38 -24
- package/lib/DateRanger/locale/en-US.d.ts +1 -0
- package/lib/DateRanger/locale/zh-CN.d.ts +1 -0
- package/lib/DateRanger/locale/zh-TW.d.ts +1 -0
- package/lib/ProCard/index.js +3 -1
- package/lib/ProCard/style/index.js +12 -2
- package/lib/ProTable/index.js +25 -0
- package/lib/ProTable/style/index.js +14 -0
- package/package.json +10 -10
|
@@ -462,8 +462,15 @@ var InternalPickerPanel = function InternalPickerPanel(props) {
|
|
|
462
462
|
startTime = values.startTime,
|
|
463
463
|
endDate = values.endDate,
|
|
464
464
|
endTime = values.endTime;
|
|
465
|
-
|
|
466
|
-
var
|
|
465
|
+
// 日期同一天时对时间进行排序,保证开始时间在结束时间之前
|
|
466
|
+
var _ref7 = startDate === endDate ? [startTime, endTime].sort(function (a, b) {
|
|
467
|
+
return (a === null || a === void 0 ? void 0 : a.valueOf()) - (b === null || b === void 0 ? void 0 : b.valueOf());
|
|
468
|
+
}) : [startTime, endTime],
|
|
469
|
+
_ref8 = _slicedToArray(_ref7, 2),
|
|
470
|
+
sTime = _ref8[0],
|
|
471
|
+
eTime = _ref8[1];
|
|
472
|
+
var start = "".concat(startDate, " ").concat(sTime.format(TIME_FORMAT));
|
|
473
|
+
var end = "".concat(endDate, " ").concat(eTime.format(TIME_FORMAT));
|
|
467
474
|
var errorList = [];
|
|
468
475
|
var message = '';
|
|
469
476
|
rules === null || rules === void 0 || rules.some(function (item) {
|
|
@@ -35,6 +35,9 @@ export interface DateRangerProps extends Omit<RangePickerProps, 'mode' | 'picker
|
|
|
35
35
|
defaultValue?: RangeValue;
|
|
36
36
|
size?: 'small' | 'large' | 'middle';
|
|
37
37
|
tooltipProps?: TooltipProps;
|
|
38
|
+
autoAdjustOverflow?: boolean;
|
|
39
|
+
overlayClassName?: string;
|
|
40
|
+
overlayStyle?: React.CSSProperties;
|
|
38
41
|
locale?: any;
|
|
39
42
|
}
|
|
40
43
|
declare const _default: React.ForwardRefExoticComponent<DateRangerProps & React.RefAttributes<unknown>>;
|
package/es/DateRanger/Ranger.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 = ["selects", "value", "defaultValue", "defaultQuickValue", "hasRewind", "hasPlay", "hasSync", "hasForward", "hasZoomOut", "hasTagInPicker", "pastOnly", "simpleMode", "hideYear", "hideSecond", "autoCalcRange", "onChange", "disabledDate", "locale", "size", "stickRangeName", "tooltipProps", "isMoment", "rules", "tip"];
|
|
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"];
|
|
3
3
|
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
4
|
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
5
|
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; }
|
|
@@ -22,7 +22,7 @@ import moment from 'moment';
|
|
|
22
22
|
import classNames from 'classnames';
|
|
23
23
|
import LocaleWrapper from "../locale/LocaleWrapper";
|
|
24
24
|
import { getPrefix } from "../_util";
|
|
25
|
-
import { CUSTOMIZE, DATE_TIME_FORMAT, NEAR_1_MINUTES, NEAR_30_MINUTES, NEAR_1_HOURS, NEAR_3_HOURS, NEAR_6_HOURS, TODAY,
|
|
25
|
+
import { CUSTOMIZE, DATE_TIME_FORMAT, NEAR_1_MINUTES, NEAR_30_MINUTES, NEAR_1_HOURS, NEAR_3_HOURS, NEAR_6_HOURS, TODAY, YEAR_DATE_TIME_FORMAT, LAST_3_DAYS, DATE_TIME_SECOND_FORMAT, YEAR_DATE_TIME_SECOND_FORMAT, DATE_TIME_FORMAT_CN, DATE_TIME_SECOND_FORMAT_CN, YEAR_DATE_TIME_FORMAT_CN, YEAR_DATE_TIME_SECOND_FORMAT_CN } from "./constant";
|
|
26
26
|
import InternalPickerPanel from "./PickerPanel";
|
|
27
27
|
import zhCN from "./locale/zh-CN";
|
|
28
28
|
import "./index.less";
|
|
@@ -69,6 +69,9 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
69
69
|
isMomentProps = props.isMoment,
|
|
70
70
|
rules = props.rules,
|
|
71
71
|
tip = props.tip,
|
|
72
|
+
autoAdjustOverflow = props.autoAdjustOverflow,
|
|
73
|
+
overlayClassName = props.overlayClassName,
|
|
74
|
+
overlayStyle = props.overlayStyle,
|
|
72
75
|
rest = _objectWithoutProperties(props, _excluded);
|
|
73
76
|
var _theme$useToken = theme.useToken(),
|
|
74
77
|
token = _theme$useToken.token;
|
|
@@ -211,7 +214,7 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
211
214
|
return isEN ? "Nearly ".concat(differenceSeconds, " seconds") : "\u8FD1 ".concat(differenceSeconds, " \u79D2");
|
|
212
215
|
};
|
|
213
216
|
var setNow = function setNow() {
|
|
214
|
-
var selected =
|
|
217
|
+
var selected = selects.find(function (item) {
|
|
215
218
|
return item.name === rangeName;
|
|
216
219
|
});
|
|
217
220
|
if (selected !== null && selected !== void 0 && selected.range) {
|
|
@@ -255,7 +258,9 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
255
258
|
className: classNames("".concat(prefix, "-wrapper"), _defineProperty({}, "".concat(prefix, "-wrapper-has-jumper"), hasRewind || hasForward)),
|
|
256
259
|
children: [/*#__PURE__*/_jsx(Dropdown, {
|
|
257
260
|
trigger: ['click'],
|
|
258
|
-
open: open
|
|
261
|
+
open: open,
|
|
262
|
+
placement: rest.placement,
|
|
263
|
+
autoAdjustOverflow: autoAdjustOverflow
|
|
259
264
|
// 关闭后进行销毁,才可以将 Tooltip 进行同步关闭
|
|
260
265
|
,
|
|
261
266
|
destroyPopupOnHide: true
|
|
@@ -269,7 +274,8 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
269
274
|
},
|
|
270
275
|
dropdownRender: function dropdownRender(originNode) {
|
|
271
276
|
return /*#__PURE__*/_jsxs("div", {
|
|
272
|
-
className: "".concat(prefix, "-dropdown-picker"),
|
|
277
|
+
className: classNames("".concat(prefix, "-dropdown-picker"), overlayClassName),
|
|
278
|
+
style: overlayStyle,
|
|
273
279
|
children: [originNode, /*#__PURE__*/_jsx(Divider, {
|
|
274
280
|
type: "vertical",
|
|
275
281
|
style: {
|
|
@@ -310,7 +316,7 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
310
316
|
} else {
|
|
311
317
|
refState.current.tooltipOpen = false;
|
|
312
318
|
}
|
|
313
|
-
var selected =
|
|
319
|
+
var selected = selects.find(function (_item) {
|
|
314
320
|
return _item.name === key;
|
|
315
321
|
});
|
|
316
322
|
// 存在快捷选项切换为极简模式
|
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: ("ruby" | "css" | "go" | "
|
|
32
|
+
declare const supportedLanguages: ("ruby" | "css" | "go" | "bash" | "json" | "java" | "javascript" | "typescript" | "groovy" | "python" | "cpp" | "http" | "markdown" | "nginx" | "sql" | "xml" | "dockerfile" | "yaml" | "solidity" | "tsx" | "jsx")[];
|
|
33
33
|
export type LanguageType = (typeof supportedLanguages)[number] | 'html';
|
|
34
34
|
export interface HighlightProps extends LocaleWrapperProps {
|
|
35
35
|
/**
|
package/es/ProCard/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["title", "tabs", "headerBordered", "bodyStyle", "prefixCls", "className"];
|
|
1
|
+
var _excluded = ["ghost", "title", "tabs", "headerBordered", "bodyStyle", "prefixCls", "className"];
|
|
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); }
|
|
@@ -15,7 +15,8 @@ import useStyle from "./style";
|
|
|
15
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
16
|
// @ts-ignore
|
|
17
17
|
var ProCard = function ProCard(_ref) {
|
|
18
|
-
var
|
|
18
|
+
var ghost = _ref.ghost,
|
|
19
|
+
title = _ref.title,
|
|
19
20
|
tabs = _ref.tabs,
|
|
20
21
|
headerBordered = _ref.headerBordered,
|
|
21
22
|
bodyStyle = _ref.bodyStyle,
|
|
@@ -29,10 +30,11 @@ var ProCard = function ProCard(_ref) {
|
|
|
29
30
|
wrapSSR = _useStyle.wrapSSR;
|
|
30
31
|
var zeroPaddingList = [0, '0', '0px'];
|
|
31
32
|
// ProCard body has no padding
|
|
32
|
-
var noBodyPadding = zeroPaddingList.includes(bodyStyle === null || bodyStyle === void 0 ? void 0 : bodyStyle.padding);
|
|
33
|
+
var noBodyPadding = zeroPaddingList.includes(bodyStyle === null || bodyStyle === void 0 ? void 0 : bodyStyle.padding) || ghost;
|
|
33
34
|
var proCardCls = classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-has-title"), !!title), "".concat(prefixCls, "-no-body-padding"), noBodyPadding), "".concat(prefixCls, "-no-divider"), !headerBordered), "".concat(prefixCls, "-contain-tabs"), !!tabs), className);
|
|
34
35
|
return wrapSSR( /*#__PURE__*/_jsx(AntProCard, _objectSpread({
|
|
35
36
|
prefixCls: customizePrefixCls,
|
|
37
|
+
ghost: ghost,
|
|
36
38
|
title: title,
|
|
37
39
|
tabs: _typeof(tabs) === 'object' ? _objectSpread({
|
|
38
40
|
size: 'large'
|
|
@@ -12,15 +12,20 @@ export var genProCardStyle = function genProCardStyle(token) {
|
|
|
12
12
|
prefixCls = token.prefixCls;
|
|
13
13
|
var tabsComponentCls = "".concat(antCls, "-tabs");
|
|
14
14
|
var tabsPrefixCls = "".concat(prefixCls, "-tabs");
|
|
15
|
-
return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "div".concat(componentCls), {
|
|
15
|
+
return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "div".concat(componentCls), {
|
|
16
16
|
borderRadius: token.borderRadiusLG
|
|
17
|
-
}), "".concat(componentCls, ":not(").concat(componentCls, "-border)"), {
|
|
17
|
+
}), "".concat(componentCls, ":not(").concat(componentCls, "-border):not(").concat(componentCls, "-ghost)"), {
|
|
18
18
|
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)'
|
|
19
|
-
}), "".concat(componentCls, ":not(").concat(componentCls, "-size-small)"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-body"), {
|
|
19
|
+
}), "".concat(componentCls, ":not(").concat(componentCls, "-size-small):not(").concat(componentCls, "-ghost)"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-body"), {
|
|
20
20
|
paddingBlock: token.paddingLG
|
|
21
21
|
}), "&".concat(componentCls, "-has-title").concat(componentCls, "-no-divider"), _defineProperty({}, "".concat(componentCls, "-body"), {
|
|
22
22
|
paddingBlockStart: token.padding
|
|
23
|
-
}))), "".concat(componentCls).concat(componentCls, "-
|
|
23
|
+
}))), "".concat(componentCls).concat(componentCls, "-size-small").concat(componentCls, "-ghost"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-header"), {
|
|
24
|
+
paddingInline: 0
|
|
25
|
+
}), "".concat(componentCls, "-body"), {
|
|
26
|
+
paddingBlock: 0,
|
|
27
|
+
paddingInline: 0
|
|
28
|
+
})), "".concat(componentCls).concat(componentCls, "-no-body-padding:not(").concat(componentCls, "-contain-tabs)"), _objectSpread(_defineProperty({}, "".concat(componentCls, "-header"), {
|
|
24
29
|
paddingBlockEnd: token.padding
|
|
25
30
|
}), Card.genTableStyle(token.paddingLG, token))), "".concat(componentCls).concat(componentCls, "-no-body-padding").concat(componentCls, "-size-small:not(").concat(componentCls, "-contain-tabs)"), _objectSpread(_defineProperty({}, "".concat(componentCls, "-header"), {
|
|
26
31
|
paddingBlockEnd: token.paddingXS
|
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", "expandable", "rowSelection", "pagination", "footer", "locale", "prefixCls", "tableClassName", "className"],
|
|
2
|
+
var _excluded = ["form", "headerTitle", "options", "optionsRender", "toolbar", "toolBarRender", "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; }
|
|
@@ -18,11 +18,17 @@ import useStyle from "./style";
|
|
|
18
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
19
|
var ProTable = function ProTable(_ref) {
|
|
20
20
|
var form = _ref.form,
|
|
21
|
+
headerTitle = _ref.headerTitle,
|
|
22
|
+
options = _ref.options,
|
|
23
|
+
optionsRender = _ref.optionsRender,
|
|
24
|
+
toolbar = _ref.toolbar,
|
|
25
|
+
toolBarRender = _ref.toolBarRender,
|
|
21
26
|
expandable = _ref.expandable,
|
|
22
27
|
rowSelection = _ref.rowSelection,
|
|
23
28
|
customPagination = _ref.pagination,
|
|
24
29
|
footer = _ref.footer,
|
|
25
30
|
locale = _ref.locale,
|
|
31
|
+
outerCardProps = _ref.cardProps,
|
|
26
32
|
customizePrefixCls = _ref.prefixCls,
|
|
27
33
|
tableClassName = _ref.tableClassName,
|
|
28
34
|
className = _ref.className,
|
|
@@ -51,6 +57,8 @@ var ProTable = function ProTable(_ref) {
|
|
|
51
57
|
image: Empty.PRESENTED_IMAGE_SIMPLE
|
|
52
58
|
}) : _ref2$emptyText,
|
|
53
59
|
restLocale = _objectWithoutProperties(_ref2, _excluded2);
|
|
60
|
+
var cardProps = typeof outerCardProps === 'boolean' ? {} : outerCardProps;
|
|
61
|
+
var proCardCls = getPrefixCls('pro-card', customizePrefixCls);
|
|
54
62
|
return tableWrapSSR(lightFilterWrapSSR(wrapSSR( /*#__PURE__*/_jsx(AntProTable
|
|
55
63
|
// default size change to `large` as same as Table
|
|
56
64
|
, _objectSpread({
|
|
@@ -59,6 +67,14 @@ var ProTable = function ProTable(_ref) {
|
|
|
59
67
|
// query form should remove required mark
|
|
60
68
|
requiredMark: false
|
|
61
69
|
}, form),
|
|
70
|
+
headerTitle: headerTitle,
|
|
71
|
+
options: options,
|
|
72
|
+
optionsRender: optionsRender,
|
|
73
|
+
toolbar: toolbar,
|
|
74
|
+
toolBarRender: toolBarRender,
|
|
75
|
+
cardProps: _objectSpread(_objectSpread({}, cardProps), {}, {
|
|
76
|
+
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)
|
|
77
|
+
}),
|
|
62
78
|
expandable: expandable ? _objectSpread({
|
|
63
79
|
columnWidth: 32
|
|
64
80
|
}, expandable) : undefined,
|
|
@@ -1,15 +1,25 @@
|
|
|
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
|
+
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
|
+
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; }
|
|
2
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; }
|
|
3
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
4
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
|
+
import { Card } from '@oceanbase/design';
|
|
5
8
|
import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
|
|
6
9
|
export var genProTableStyle = function genProTableStyle(token) {
|
|
7
10
|
var antCls = token.antCls,
|
|
8
11
|
componentCls = token.componentCls,
|
|
9
12
|
proComponentsCls = token.proComponentsCls;
|
|
10
|
-
|
|
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"), {
|
|
11
15
|
flexDirection: 'row-reverse'
|
|
12
|
-
})))
|
|
16
|
+
})), "".concat(proCardComponentCls).concat(proCardComponentCls, "-no-padding"), _objectSpread(_defineProperty({}, "".concat(proCardComponentCls, "-body"), _defineProperty({
|
|
17
|
+
paddingInline: 0
|
|
18
|
+
}, "".concat(componentCls, "-list-toolbar-container"), {
|
|
19
|
+
paddingInline: token.paddingLG
|
|
20
|
+
})), Card.genTableStyle(token.paddingLG, _objectSpread(_objectSpread({}, token), {}, {
|
|
21
|
+
componentCls: proCardComponentCls
|
|
22
|
+
})))));
|
|
13
23
|
};
|
|
14
24
|
export default (function (prefixCls) {
|
|
15
25
|
var useStyle = genComponentStyleHook('ProTable', function (token) {
|
|
@@ -400,8 +400,11 @@ var InternalPickerPanel = (props) => {
|
|
|
400
400
|
onClick: () => {
|
|
401
401
|
form.validateFields().then((values) => {
|
|
402
402
|
const { startDate, startTime, endDate, endTime } = values;
|
|
403
|
-
const
|
|
404
|
-
|
|
403
|
+
const [sTime, eTime] = startDate === endDate ? [startTime, endTime].sort((a, b) => {
|
|
404
|
+
return (a == null ? void 0 : a.valueOf()) - (b == null ? void 0 : b.valueOf());
|
|
405
|
+
}) : [startTime, endTime];
|
|
406
|
+
const start = `${startDate} ${sTime.format(TIME_FORMAT)}`;
|
|
407
|
+
const end = `${endDate} ${eTime.format(TIME_FORMAT)}`;
|
|
405
408
|
let errorList = [];
|
|
406
409
|
let message = "";
|
|
407
410
|
rules == null ? void 0 : rules.some((item) => {
|
|
@@ -35,6 +35,9 @@ export interface DateRangerProps extends Omit<RangePickerProps, 'mode' | 'picker
|
|
|
35
35
|
defaultValue?: RangeValue;
|
|
36
36
|
size?: 'small' | 'large' | 'middle';
|
|
37
37
|
tooltipProps?: TooltipProps;
|
|
38
|
+
autoAdjustOverflow?: boolean;
|
|
39
|
+
overlayClassName?: string;
|
|
40
|
+
overlayStyle?: React.CSSProperties;
|
|
38
41
|
locale?: any;
|
|
39
42
|
}
|
|
40
43
|
declare const _default: React.ForwardRefExoticComponent<DateRangerProps & React.RefAttributes<unknown>>;
|
package/lib/DateRanger/Ranger.js
CHANGED
|
@@ -82,6 +82,9 @@ var Ranger = import_react.default.forwardRef((props, ref) => {
|
|
|
82
82
|
isMoment: isMomentProps,
|
|
83
83
|
rules,
|
|
84
84
|
tip,
|
|
85
|
+
autoAdjustOverflow,
|
|
86
|
+
overlayClassName,
|
|
87
|
+
overlayStyle,
|
|
85
88
|
...rest
|
|
86
89
|
} = props;
|
|
87
90
|
const { token } = import_design.theme.useToken();
|
|
@@ -201,7 +204,7 @@ var Ranger = import_react.default.forwardRef((props, ref) => {
|
|
|
201
204
|
return isEN ? `Nearly ${differenceSeconds} seconds` : `近 ${differenceSeconds} 秒`;
|
|
202
205
|
};
|
|
203
206
|
const setNow = () => {
|
|
204
|
-
const selected =
|
|
207
|
+
const selected = selects.find((item) => item.name === rangeName);
|
|
205
208
|
if (selected == null ? void 0 : selected.range) {
|
|
206
209
|
rangeChange(selected.range(isMoment ? (0, import_moment.default)() : (0, import_dayjs.default)()));
|
|
207
210
|
}
|
|
@@ -246,6 +249,8 @@ var Ranger = import_react.default.forwardRef((props, ref) => {
|
|
|
246
249
|
{
|
|
247
250
|
trigger: ["click"],
|
|
248
251
|
open,
|
|
252
|
+
placement: rest.placement,
|
|
253
|
+
autoAdjustOverflow,
|
|
249
254
|
destroyPopupOnHide: true,
|
|
250
255
|
onOpenChange: (o) => {
|
|
251
256
|
if (o === false && refState.current.tooltipOpen) {
|
|
@@ -254,30 +259,39 @@ var Ranger = import_react.default.forwardRef((props, ref) => {
|
|
|
254
259
|
setOpen(o);
|
|
255
260
|
},
|
|
256
261
|
dropdownRender: (originNode) => {
|
|
257
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
258
|
-
|
|
262
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
263
|
+
"div",
|
|
259
264
|
{
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
265
|
+
className: (0, import_classnames.default)(`${prefix}-dropdown-picker`, overlayClassName),
|
|
266
|
+
style: overlayStyle
|
|
267
|
+
},
|
|
268
|
+
originNode,
|
|
269
|
+
/* @__PURE__ */ import_react.default.createElement(import_design.Divider, { type: "vertical", style: { height: "auto", margin: "0px 4px 0px 0px" } }),
|
|
270
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
271
|
+
import_PickerPanel.default,
|
|
272
|
+
{
|
|
273
|
+
defaultValue: innerValue || [],
|
|
274
|
+
locale,
|
|
275
|
+
disabledDate: pastOnly ? disabledFuture : disabledDate,
|
|
276
|
+
tip,
|
|
277
|
+
isMoment,
|
|
278
|
+
rules,
|
|
279
|
+
onOk: (vList) => {
|
|
280
|
+
setIsPlay(false);
|
|
281
|
+
handleNameChange(import_constant.CUSTOMIZE);
|
|
282
|
+
rangeChange(
|
|
283
|
+
vList.map((v) => {
|
|
284
|
+
return isMoment ? (0, import_moment.default)(v) : (0, import_dayjs.default)(v);
|
|
285
|
+
})
|
|
286
|
+
);
|
|
287
|
+
closeTooltip();
|
|
288
|
+
},
|
|
289
|
+
onCancel: () => {
|
|
290
|
+
closeTooltip();
|
|
291
|
+
}
|
|
278
292
|
}
|
|
279
|
-
|
|
280
|
-
)
|
|
293
|
+
)
|
|
294
|
+
);
|
|
281
295
|
},
|
|
282
296
|
menu: {
|
|
283
297
|
selectable: true,
|
|
@@ -288,7 +302,7 @@ var Ranger = import_react.default.forwardRef((props, ref) => {
|
|
|
288
302
|
} else {
|
|
289
303
|
refState.current.tooltipOpen = false;
|
|
290
304
|
}
|
|
291
|
-
const selected =
|
|
305
|
+
const selected = selects.find((_item) => _item.name === key);
|
|
292
306
|
if (selected == null ? void 0 : selected.range) {
|
|
293
307
|
handleNameChange(key);
|
|
294
308
|
setIsPlay(true);
|
package/lib/ProCard/index.js
CHANGED
|
@@ -38,6 +38,7 @@ var import_design = require("@oceanbase/design");
|
|
|
38
38
|
var import_classnames = __toESM(require("classnames"));
|
|
39
39
|
var import_style = __toESM(require("./style"));
|
|
40
40
|
var ProCard = ({
|
|
41
|
+
ghost,
|
|
41
42
|
title,
|
|
42
43
|
tabs,
|
|
43
44
|
headerBordered,
|
|
@@ -50,7 +51,7 @@ var ProCard = ({
|
|
|
50
51
|
const prefixCls = getPrefixCls("pro-card", customizePrefixCls);
|
|
51
52
|
const { wrapSSR } = (0, import_style.default)(prefixCls);
|
|
52
53
|
const zeroPaddingList = [0, "0", "0px"];
|
|
53
|
-
const noBodyPadding = zeroPaddingList.includes(bodyStyle == null ? void 0 : bodyStyle.padding);
|
|
54
|
+
const noBodyPadding = zeroPaddingList.includes(bodyStyle == null ? void 0 : bodyStyle.padding) || ghost;
|
|
54
55
|
const proCardCls = (0, import_classnames.default)(
|
|
55
56
|
{
|
|
56
57
|
[`${prefixCls}-has-title`]: !!title,
|
|
@@ -65,6 +66,7 @@ var ProCard = ({
|
|
|
65
66
|
import_pro_components.ProCard,
|
|
66
67
|
{
|
|
67
68
|
prefixCls: customizePrefixCls,
|
|
69
|
+
ghost,
|
|
68
70
|
title,
|
|
69
71
|
tabs: typeof tabs === "object" ? {
|
|
70
72
|
size: "large",
|
|
@@ -35,10 +35,10 @@ var genProCardStyle = (token) => {
|
|
|
35
35
|
[`div${componentCls}`]: {
|
|
36
36
|
borderRadius: token.borderRadiusLG
|
|
37
37
|
},
|
|
38
|
-
[`${componentCls}:not(${componentCls}-border)`]: {
|
|
38
|
+
[`${componentCls}:not(${componentCls}-border):not(${componentCls}-ghost)`]: {
|
|
39
39
|
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)"
|
|
40
40
|
},
|
|
41
|
-
[`${componentCls}:not(${componentCls}-size-small)`]: {
|
|
41
|
+
[`${componentCls}:not(${componentCls}-size-small):not(${componentCls}-ghost)`]: {
|
|
42
42
|
[`${componentCls}-body`]: {
|
|
43
43
|
paddingBlock: token.paddingLG
|
|
44
44
|
},
|
|
@@ -48,6 +48,16 @@ var genProCardStyle = (token) => {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
|
+
// need to handle style for small and ghost ProCard
|
|
52
|
+
[`${componentCls}${componentCls}-size-small${componentCls}-ghost`]: {
|
|
53
|
+
[`${componentCls}-header`]: {
|
|
54
|
+
paddingInline: 0
|
|
55
|
+
},
|
|
56
|
+
[`${componentCls}-body`]: {
|
|
57
|
+
paddingBlock: 0,
|
|
58
|
+
paddingInline: 0
|
|
59
|
+
}
|
|
60
|
+
},
|
|
51
61
|
// no body padding card
|
|
52
62
|
[`${componentCls}${componentCls}-no-body-padding:not(${componentCls}-contain-tabs)`]: {
|
|
53
63
|
[`${componentCls}-header`]: {
|
package/lib/ProTable/index.js
CHANGED
|
@@ -41,11 +41,17 @@ var import_style = __toESM(require("../LightFilter/style"));
|
|
|
41
41
|
var import_style2 = __toESM(require("./style"));
|
|
42
42
|
var ProTable = ({
|
|
43
43
|
form,
|
|
44
|
+
headerTitle,
|
|
45
|
+
options,
|
|
46
|
+
optionsRender,
|
|
47
|
+
toolbar,
|
|
48
|
+
toolBarRender,
|
|
44
49
|
expandable,
|
|
45
50
|
rowSelection,
|
|
46
51
|
pagination: customPagination,
|
|
47
52
|
footer,
|
|
48
53
|
locale,
|
|
54
|
+
cardProps: outerCardProps,
|
|
49
55
|
prefixCls: customizePrefixCls,
|
|
50
56
|
tableClassName,
|
|
51
57
|
className,
|
|
@@ -69,6 +75,8 @@ var ProTable = ({
|
|
|
69
75
|
const { wrapSSR } = (0, import_style2.default)(prefixCls);
|
|
70
76
|
const proTableCls = (0, import_classnames.default)(className);
|
|
71
77
|
const { emptyText = /* @__PURE__ */ import_react.default.createElement(import_design.Empty, { image: import_design.Empty.PRESENTED_IMAGE_SIMPLE }), ...restLocale } = locale || {};
|
|
78
|
+
const cardProps = typeof outerCardProps === "boolean" ? {} : outerCardProps;
|
|
79
|
+
const proCardCls = getPrefixCls("pro-card", customizePrefixCls);
|
|
72
80
|
return tableWrapSSR(
|
|
73
81
|
lightFilterWrapSSR(
|
|
74
82
|
wrapSSR(
|
|
@@ -81,6 +89,23 @@ var ProTable = ({
|
|
|
81
89
|
requiredMark: false,
|
|
82
90
|
...form
|
|
83
91
|
},
|
|
92
|
+
headerTitle,
|
|
93
|
+
options,
|
|
94
|
+
optionsRender,
|
|
95
|
+
toolbar,
|
|
96
|
+
toolBarRender,
|
|
97
|
+
cardProps: {
|
|
98
|
+
...cardProps,
|
|
99
|
+
className: (0, import_classnames.default)(
|
|
100
|
+
{
|
|
101
|
+
[`${proCardCls}-has-title`]: !!headerTitle || options || options === void 0 || optionsRender || toolbar || toolBarRender,
|
|
102
|
+
[`${proCardCls}-no-divider`]: !(cardProps == null ? void 0 : cardProps.headerBordered),
|
|
103
|
+
[`${proCardCls}-no-padding`]: true,
|
|
104
|
+
[`${proCardCls}-contain-tabs`]: !!(cardProps == null ? void 0 : cardProps.tabs)
|
|
105
|
+
},
|
|
106
|
+
cardProps == null ? void 0 : cardProps.className
|
|
107
|
+
)
|
|
108
|
+
},
|
|
84
109
|
expandable: expandable ? {
|
|
85
110
|
columnWidth: 32,
|
|
86
111
|
...expandable
|
|
@@ -23,9 +23,11 @@ __export(style_exports, {
|
|
|
23
23
|
genProTableStyle: () => genProTableStyle
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(style_exports);
|
|
26
|
+
var import_design = require("@oceanbase/design");
|
|
26
27
|
var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
|
|
27
28
|
var genProTableStyle = (token) => {
|
|
28
29
|
const { antCls, componentCls, proComponentsCls } = token;
|
|
30
|
+
const proCardComponentCls = `${proComponentsCls}-card`;
|
|
29
31
|
return {
|
|
30
32
|
[`${componentCls}`]: {
|
|
31
33
|
[`${proComponentsCls}-query-filter-actions`]: {
|
|
@@ -33,6 +35,18 @@ var genProTableStyle = (token) => {
|
|
|
33
35
|
[`${antCls}-space${antCls}-space-horizontal${antCls}-space-align-center`]: {
|
|
34
36
|
flexDirection: "row-reverse"
|
|
35
37
|
}
|
|
38
|
+
},
|
|
39
|
+
[`${proCardComponentCls}${proCardComponentCls}-no-padding`]: {
|
|
40
|
+
[`${proCardComponentCls}-body`]: {
|
|
41
|
+
paddingInline: 0,
|
|
42
|
+
[`${componentCls}-list-toolbar-container`]: {
|
|
43
|
+
paddingInline: token.paddingLG
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
...import_design.Card.genTableStyle(token.paddingLG, {
|
|
47
|
+
...token,
|
|
48
|
+
componentCls: proCardComponentCls
|
|
49
|
+
})
|
|
36
50
|
}
|
|
37
51
|
}
|
|
38
52
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oceanbase/ui",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.9",
|
|
4
4
|
"description": "The UI library based on OceanBase Design",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"oceanbase",
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
"build": "NODE_OPTIONS=--max_old_space_size=4096 father build"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@ant-design/cssinjs": "^1.
|
|
43
|
-
"@ant-design/pro-components": "^2.8.
|
|
42
|
+
"@ant-design/cssinjs": "^1.23.0",
|
|
43
|
+
"@ant-design/pro-components": "^2.8.5",
|
|
44
44
|
"@antv/g6": "3.4.10",
|
|
45
|
-
"@oceanbase/design": "^0.4.
|
|
46
|
-
"@oceanbase/icons": "^0.4.
|
|
45
|
+
"@oceanbase/design": "^0.4.8",
|
|
46
|
+
"@oceanbase/icons": "^0.4.5",
|
|
47
47
|
"@oceanbase/util": "^0.4.2",
|
|
48
48
|
"ahooks": "^2.10.14",
|
|
49
49
|
"classnames": "^2.5.1",
|
|
@@ -56,20 +56,20 @@
|
|
|
56
56
|
"moment": "^2.30.1",
|
|
57
57
|
"path-to-regexp": "^7.2.0",
|
|
58
58
|
"randexp": "^0.5.3",
|
|
59
|
-
"rc-picker": "^4.
|
|
60
|
-
"rc-util": "^5.44.
|
|
59
|
+
"rc-picker": "^4.11.1",
|
|
60
|
+
"rc-util": "^5.44.4",
|
|
61
61
|
"react-copy-to-clipboard": "^5.1.0",
|
|
62
62
|
"react-json-view": "^1.21.3",
|
|
63
63
|
"react-split-pane": "^0.1.92",
|
|
64
64
|
"screenfull": "^6.0.2"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@ant-design/pro-form": "^2.31.
|
|
68
|
-
"@ant-design/pro-layout": "^7.22.
|
|
67
|
+
"@ant-design/pro-form": "^2.31.5",
|
|
68
|
+
"@ant-design/pro-layout": "^7.22.2"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"react": ">=16.9.0",
|
|
72
72
|
"react-dom": ">=16.9.0"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "617efa9eb09833f74f0ab0065467b556b5b6843e"
|
|
75
75
|
}
|