@oceanbase/ui 0.4.10 → 0.4.12
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/Action/Group.js +6 -7
- package/es/Action/Item.d.ts +1 -0
- package/es/BasicLayout/Header.d.ts +2 -0
- package/es/BasicLayout/Header.js +7 -2
- package/es/BasicLayout/locale/en-US.d.ts +1 -0
- package/es/BasicLayout/locale/en-US.js +1 -0
- package/es/BasicLayout/locale/zh-CN.d.ts +1 -0
- package/es/BasicLayout/locale/zh-CN.js +1 -0
- package/es/BasicLayout/locale/zh-TW.d.ts +1 -0
- package/es/BasicLayout/locale/zh-TW.js +1 -0
- package/es/ContentWithIcon/index.js +1 -1
- package/es/DateRanger/PickerPanel.js +88 -140
- package/es/Highlight/index.d.ts +1 -1
- package/es/ProCard/index.js +5 -4
- package/es/ProCard/style/index.js +6 -3
- package/es/ProTable/index.d.ts +9 -4
- package/es/ProTable/index.js +9 -4
- package/es/SideTip/Dragger.d.ts +1 -0
- package/es/SideTip/Dragger.js +6 -2
- package/es/SideTip/index.d.ts +6 -0
- package/es/SideTip/index.js +3 -0
- package/lib/Action/Group.js +15 -15
- package/lib/Action/Item.d.ts +1 -0
- package/lib/BasicLayout/Header.d.ts +2 -0
- package/lib/BasicLayout/Header.js +4 -0
- package/lib/BasicLayout/locale/en-US.d.ts +1 -0
- package/lib/BasicLayout/locale/en-US.js +1 -0
- package/lib/BasicLayout/locale/zh-CN.d.ts +1 -0
- package/lib/BasicLayout/locale/zh-CN.js +1 -0
- package/lib/BasicLayout/locale/zh-TW.d.ts +1 -0
- package/lib/BasicLayout/locale/zh-TW.js +1 -0
- package/lib/ContentWithIcon/index.js +1 -1
- package/lib/DateRanger/PickerPanel.js +57 -122
- package/lib/Highlight/index.d.ts +1 -1
- package/lib/ProCard/index.js +3 -3
- package/lib/ProCard/style/index.js +13 -4
- package/lib/ProTable/index.d.ts +9 -4
- package/lib/ProTable/index.js +8 -4
- package/lib/SideTip/Dragger.d.ts +1 -0
- package/lib/SideTip/Dragger.js +6 -2
- package/lib/SideTip/index.d.ts +6 -0
- package/lib/SideTip/index.js +3 -1
- package/package.json +9 -9
package/es/Action/Group.js
CHANGED
|
@@ -11,6 +11,7 @@ import { isBoolean, max, omit } from 'lodash';
|
|
|
11
11
|
import useStyle from "./style";
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
15
|
var getOrder = function getOrder(_ref) {
|
|
15
16
|
var type = _ref.type,
|
|
16
17
|
fixed = _ref.fixed;
|
|
@@ -124,24 +125,22 @@ export default (function (_ref2) {
|
|
|
124
125
|
if (isBoolean(action.props.disabled)) disabled = action.props.disabled;else if (shouldDisabled) disabled = shouldDisabled(action.key);
|
|
125
126
|
// 当用户传入loading 或者 传入 disabled 的情况都要禁用按钮
|
|
126
127
|
var actionDisabled = action.props.loading || (isBoolean(action.props.disabled) ? action.props.disabled : getDefaultDisabled(action.key));
|
|
127
|
-
return (
|
|
128
|
-
/*#__PURE__*/
|
|
129
|
-
// @ts-ignore
|
|
130
|
-
_jsx(Menu.Item, _objectSpread(_objectSpread({
|
|
128
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
129
|
+
children: [/*#__PURE__*/_jsx(Menu.Item, _objectSpread(_objectSpread({
|
|
131
130
|
// @ts-ignore
|
|
132
131
|
onClick: function onClick(_ref4) {
|
|
133
132
|
var _action$props$onClick, _action$props;
|
|
134
133
|
var domEvent = _ref4.domEvent;
|
|
135
134
|
(_action$props$onClick = (_action$props = action.props).onClick) === null || _action$props$onClick === void 0 || _action$props$onClick.call(_action$props, domEvent);
|
|
136
135
|
}
|
|
137
|
-
}, omit(action.props, 'disabled')), {}, {
|
|
136
|
+
}, omit(action.props, ['disabled'])), {}, {
|
|
138
137
|
disabled: actionDisabled,
|
|
139
138
|
children: /*#__PURE__*/_jsxs(Tooltip, {
|
|
140
139
|
title: action.props.tooltip,
|
|
141
140
|
children: [action.props.loading && /*#__PURE__*/_jsx(LoadingOutlined, {}), ' ', action.props.children || action]
|
|
142
141
|
})
|
|
143
|
-
}), (_ref3 = actionKey) !== null && _ref3 !== void 0 ? _ref3 : index.toString())
|
|
144
|
-
);
|
|
142
|
+
}), (_ref3 = actionKey) !== null && _ref3 !== void 0 ? _ref3 : index.toString()), action.props.divider && /*#__PURE__*/_jsx(Menu.Divider, {})]
|
|
143
|
+
});
|
|
145
144
|
})
|
|
146
145
|
}),
|
|
147
146
|
children: moreDom
|
package/es/Action/Item.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export type OverlayFunc = () => React.ReactElement;
|
|
|
5
5
|
export interface HeaderLocale {
|
|
6
6
|
help: string;
|
|
7
7
|
welcome: string;
|
|
8
|
+
versionNotice?: string;
|
|
8
9
|
viewDocs: string;
|
|
9
10
|
downloadDocs?: string;
|
|
10
11
|
about: string;
|
|
@@ -27,6 +28,7 @@ export interface HeaderProps extends LocaleWrapperProps {
|
|
|
27
28
|
extra?: React.ReactNode;
|
|
28
29
|
pathname?: string;
|
|
29
30
|
welcomePath?: string;
|
|
31
|
+
versionNoticePath?: string;
|
|
30
32
|
docsPath?: string;
|
|
31
33
|
pdfPath?: string;
|
|
32
34
|
iconUrl?: string;
|
package/es/BasicLayout/Header.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 = ["prefixCls", "showLabel", "title", "extra", "pathname", "welcomePath", "docsPath", "pdfPath", "iconUrl", "logoUrl", "simpleLogoUrl", "username", "userMenu", "appData", "locale", "showHelp", "showLocale", "locales", "langs"];
|
|
2
|
+
var _excluded = ["prefixCls", "showLabel", "title", "extra", "pathname", "welcomePath", "versionNoticePath", "docsPath", "pdfPath", "iconUrl", "logoUrl", "simpleLogoUrl", "username", "userMenu", "appData", "locale", "showHelp", "showLocale", "locales", "langs"];
|
|
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; }
|
|
@@ -42,6 +42,7 @@ var Header = function Header(_ref) {
|
|
|
42
42
|
extra = _ref.extra,
|
|
43
43
|
pathname = _ref.pathname,
|
|
44
44
|
welcomePath = _ref.welcomePath,
|
|
45
|
+
versionNoticePath = _ref.versionNoticePath,
|
|
45
46
|
docsPath = _ref.docsPath,
|
|
46
47
|
pdfPath = _ref.pdfPath,
|
|
47
48
|
iconUrl = _ref.iconUrl,
|
|
@@ -81,6 +82,8 @@ var Header = function Header(_ref) {
|
|
|
81
82
|
var key = _ref2.key;
|
|
82
83
|
if (key === 'welcome') {
|
|
83
84
|
navigate === null || navigate === void 0 || navigate(welcomePath);
|
|
85
|
+
} else if (key === 'versionNotice') {
|
|
86
|
+
directTo(versionNoticePath);
|
|
84
87
|
} else if (key === 'viewDocs') {
|
|
85
88
|
directTo(docsPath);
|
|
86
89
|
} else if (key === 'downloadDocs') {
|
|
@@ -96,7 +99,9 @@ var Header = function Header(_ref) {
|
|
|
96
99
|
},
|
|
97
100
|
children: [welcomePath && /*#__PURE__*/_jsx(Menu.Item, {
|
|
98
101
|
children: locale.welcome
|
|
99
|
-
}, "welcome"),
|
|
102
|
+
}, "welcome"), versionNoticePath && /*#__PURE__*/_jsx(Menu.Item, {
|
|
103
|
+
children: locale.versionNotice
|
|
104
|
+
}, "versionNotice"), docsPath && /*#__PURE__*/_jsx(Menu.Item, {
|
|
100
105
|
children: locale.viewDocs
|
|
101
106
|
}, "viewDocs"), pdfPath && /*#__PURE__*/_jsx(Menu.Item, {
|
|
102
107
|
children: locale.downloadDocs
|
|
@@ -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, { isValidElement } from 'react';
|
|
11
11
|
import { Tooltip, Space, Popover } from 'antd';
|
|
12
|
-
import { ExclamationCircleFilled, InfoCircleFilled, InfoCircleOutlined, QuestionCircleOutlined } from '@
|
|
12
|
+
import { ExclamationCircleFilled, InfoCircleFilled, InfoCircleOutlined, QuestionCircleOutlined } from '@oceanbase/icons';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
14
|
import { getPrefix } from "../_util";
|
|
15
15
|
import "./index.less";
|
|
@@ -15,7 +15,7 @@ import useCSSVarCls from 'antd/es/config-provider/hooks/useCSSVarCls';
|
|
|
15
15
|
import useStyle from 'antd/es/date-picker/style/index';
|
|
16
16
|
import { PickerPanel } from 'rc-picker';
|
|
17
17
|
import classNames from 'classnames';
|
|
18
|
-
import { Alert, Button, Col, Divider, Form,
|
|
18
|
+
import { Alert, Button, Col, DatePicker, Divider, Form, Row, Space, TimePicker } from '@oceanbase/design';
|
|
19
19
|
import { noop } from 'lodash';
|
|
20
20
|
import moment from 'moment';
|
|
21
21
|
import dayjs from 'dayjs';
|
|
@@ -24,6 +24,28 @@ import { DATE_TIME_MONTH_FORMAT, DATE_TIME_MONTH_FORMAT_CN } from "./constant";
|
|
|
24
24
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
25
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
26
|
var ALL_ERROR_TYPE_LIST = ['endDate', 'startDate', 'endTime', 'startTime'];
|
|
27
|
+
/**
|
|
28
|
+
* 点击交互/时间选择交互
|
|
29
|
+
* - 首次点击时,开始时间和结束时间都置为所点击的时间
|
|
30
|
+
* - 第二次点击时,根据点击的时间,判断是开始时间还是结束时间进行赋值
|
|
31
|
+
* - 新一轮交互开始...
|
|
32
|
+
*/
|
|
33
|
+
var CLICK_STATE = {
|
|
34
|
+
START: 'START',
|
|
35
|
+
END: 'END'
|
|
36
|
+
};
|
|
37
|
+
var useClickFSA = function useClickFSA() {
|
|
38
|
+
var _useState = useState(CLICK_STATE.END),
|
|
39
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
40
|
+
state = _useState2[0],
|
|
41
|
+
setState = _useState2[1];
|
|
42
|
+
var next = function next() {
|
|
43
|
+
setState(function (ps) {
|
|
44
|
+
return ps === CLICK_STATE.START ? CLICK_STATE.END : CLICK_STATE.START;
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
return [state, next];
|
|
48
|
+
};
|
|
27
49
|
var prefix = getPrefix('ranger-picker-panel');
|
|
28
50
|
var prefixCls = 'ant-picker';
|
|
29
51
|
var TIME_FORMAT = 'HH:mm:ss';
|
|
@@ -46,6 +68,10 @@ var InternalPickerPanel = function InternalPickerPanel(props) {
|
|
|
46
68
|
wrapCSSVar = _useStyle2[0],
|
|
47
69
|
hashId = _useStyle2[1],
|
|
48
70
|
cssVarCls = _useStyle2[2];
|
|
71
|
+
var _useClickFSA = useClickFSA(),
|
|
72
|
+
_useClickFSA2 = _slicedToArray(_useClickFSA, 2),
|
|
73
|
+
clickFSA = _useClickFSA2[0],
|
|
74
|
+
clickFSANext = _useClickFSA2[1];
|
|
49
75
|
var _defaultValue = _slicedToArray(defaultValue, 2),
|
|
50
76
|
defaultS = _defaultValue[0],
|
|
51
77
|
defaultE = _defaultValue[1];
|
|
@@ -85,7 +111,7 @@ var InternalPickerPanel = function InternalPickerPanel(props) {
|
|
|
85
111
|
return clone;
|
|
86
112
|
}
|
|
87
113
|
var onPanelHover = function onPanelHover(date) {
|
|
88
|
-
setInternalHoverValues(date ? fillCalendarValue(date, activeIndex) : null);
|
|
114
|
+
setInternalHoverValues(date && clickFSA === CLICK_STATE.START ? fillCalendarValue(date, activeIndex) : null);
|
|
89
115
|
};
|
|
90
116
|
|
|
91
117
|
// 对日期进行排序
|
|
@@ -102,8 +128,8 @@ var InternalPickerPanel = function InternalPickerPanel(props) {
|
|
|
102
128
|
_eDate = _formatValues[1];
|
|
103
129
|
var setFormatDateToForm = function setFormatDateToForm() {
|
|
104
130
|
form.setFieldsValue({
|
|
105
|
-
startDate: _sDate,
|
|
106
|
-
endDate: _eDate
|
|
131
|
+
startDate: getDateInstance(_sDate),
|
|
132
|
+
endDate: getDateInstance(_eDate)
|
|
107
133
|
});
|
|
108
134
|
};
|
|
109
135
|
useEffect(function () {
|
|
@@ -112,111 +138,25 @@ var InternalPickerPanel = function InternalPickerPanel(props) {
|
|
|
112
138
|
var defaultTime = useMemo(function () {
|
|
113
139
|
return getDateInstance();
|
|
114
140
|
}, []);
|
|
115
|
-
var
|
|
116
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
117
|
-
errorMessage = _useState2[0],
|
|
118
|
-
setErrorMessage = _useState2[1];
|
|
119
|
-
var _useState3 = useState([]),
|
|
141
|
+
var _useState3 = useState(''),
|
|
120
142
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
121
|
-
|
|
122
|
-
|
|
143
|
+
errorMessage = _useState4[0],
|
|
144
|
+
setErrorMessage = _useState4[1];
|
|
145
|
+
var _useState5 = useState([]),
|
|
146
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
147
|
+
errorTypeList = _useState6[0],
|
|
148
|
+
setErrorTypeList = _useState6[1];
|
|
123
149
|
var errorTypeMap = errorTypeList.reduce(function (pre, errorKey) {
|
|
124
150
|
pre[errorKey] = 'error';
|
|
125
151
|
return pre;
|
|
126
152
|
}, {});
|
|
127
|
-
var
|
|
128
|
-
var v = e.target.value;
|
|
153
|
+
var formatDate = function formatDate(v) {
|
|
129
154
|
var date = getDateInstance(v, DATE_FORMAT, true);
|
|
130
155
|
return date.isValid() ? date.format(DATE_FORMAT) : null;
|
|
131
156
|
};
|
|
132
|
-
var
|
|
133
|
-
var _v$split;
|
|
157
|
+
var validateInputDate = function validateInputDate(e) {
|
|
134
158
|
var v = e.target.value;
|
|
135
|
-
|
|
136
|
-
_ref2 = _slicedToArray(_ref, 3),
|
|
137
|
-
h = _ref2[0],
|
|
138
|
-
m = _ref2[1],
|
|
139
|
-
s = _ref2[2];
|
|
140
|
-
if (!(h && m && s)) return null;
|
|
141
|
-
if (!(h.length === 2 && m.length === 2 && s.length === 2)) return null;
|
|
142
|
-
var date = getDateInstance(v, TIME_FORMAT, true);
|
|
143
|
-
return date.isValid() ? date.format(TIME_FORMAT) : null;
|
|
144
|
-
};
|
|
145
|
-
var selectDateInputRange = function selectDateInputRange(inputDomRef) {
|
|
146
|
-
if (!inputDomRef) return;
|
|
147
|
-
// year
|
|
148
|
-
if (inputDomRef.selectionStart >= 0 && inputDomRef.selectionStart <= 4) {
|
|
149
|
-
inputDomRef.setSelectionRange(0, 4);
|
|
150
|
-
}
|
|
151
|
-
// month
|
|
152
|
-
if (inputDomRef.selectionStart > 4 && inputDomRef.selectionStart <= 7) {
|
|
153
|
-
inputDomRef.setSelectionRange(5, 7);
|
|
154
|
-
}
|
|
155
|
-
// day
|
|
156
|
-
if (inputDomRef.selectionStart > 7 && inputDomRef.selectionStart <= 10) {
|
|
157
|
-
inputDomRef.setSelectionRange(8, 10);
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
var selectTimeInputRange = function selectTimeInputRange(inputDomRef) {
|
|
161
|
-
if (!inputDomRef) return;
|
|
162
|
-
// hour
|
|
163
|
-
if (inputDomRef.selectionStart >= 0 && inputDomRef.selectionStart <= 2) {
|
|
164
|
-
inputDomRef.setSelectionRange(0, 2);
|
|
165
|
-
}
|
|
166
|
-
// minute
|
|
167
|
-
if (inputDomRef.selectionStart > 2 && inputDomRef.selectionStart <= 5) {
|
|
168
|
-
inputDomRef.setSelectionRange(3, 5);
|
|
169
|
-
}
|
|
170
|
-
// second
|
|
171
|
-
if (inputDomRef.selectionStart > 5 && inputDomRef.selectionStart <= 8) {
|
|
172
|
-
inputDomRef.setSelectionRange(6, 8);
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
var handleDateInputKeyDown = function handleDateInputKeyDown(inputDomRef, e) {
|
|
176
|
-
if (!inputDomRef) return;
|
|
177
|
-
if (e.key === 'Enter') {
|
|
178
|
-
inputDomRef.blur();
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
if (e.key === 'ArrowLeft') {
|
|
182
|
-
var curIndex = inputDomRef.selectionStart;
|
|
183
|
-
inputDomRef.setSelectionRange(curIndex - 1, curIndex - 1);
|
|
184
|
-
}
|
|
185
|
-
if (e.key === 'ArrowRight') {
|
|
186
|
-
var _curIndex = inputDomRef.selectionEnd;
|
|
187
|
-
inputDomRef.setSelectionRange(_curIndex + 1, _curIndex + 1);
|
|
188
|
-
}
|
|
189
|
-
// NOTE: onKeyDown事件执行时,由于TimePicker需要执行受控逻辑,这会引起React rerender,
|
|
190
|
-
// 导致onKeyDown事件中拿到的Event还未更新,将下述校验逻辑放入requestIdleCallback确保其跟在React fiber调用栈后执行,这可取到最新的Event对象。
|
|
191
|
-
requestIdleCallback(function () {
|
|
192
|
-
// 校验
|
|
193
|
-
if (validateInputDate(e)) {
|
|
194
|
-
selectDateInputRange(inputDomRef);
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
};
|
|
198
|
-
var handleTimeInputKeyDown = function handleTimeInputKeyDown(inputDomRef, e) {
|
|
199
|
-
if (!inputDomRef) return;
|
|
200
|
-
if (e.key === 'Enter') {
|
|
201
|
-
inputDomRef.blur();
|
|
202
|
-
return;
|
|
203
|
-
}
|
|
204
|
-
if (e.key === 'ArrowLeft') {
|
|
205
|
-
var curIndex = inputDomRef.selectionStart;
|
|
206
|
-
inputDomRef.setSelectionRange(curIndex - 1, curIndex - 1);
|
|
207
|
-
}
|
|
208
|
-
if (e.key === 'ArrowRight') {
|
|
209
|
-
var _curIndex2 = inputDomRef.selectionEnd;
|
|
210
|
-
inputDomRef.setSelectionRange(_curIndex2 + 1, _curIndex2 + 1);
|
|
211
|
-
}
|
|
212
|
-
// NOTE: onKeyDown事件执行时,由于TimePicker需要执行受控逻辑,这会引起React rerender,
|
|
213
|
-
// 导致onKeyDown事件中拿到的Event还未更新,将下述校验逻辑放入requestIdleCallback确保其跟在React fiber调用栈后执行,这可取到最新的Event对象。
|
|
214
|
-
requestIdleCallback(function () {
|
|
215
|
-
// 校验
|
|
216
|
-
if (validateInputTime(e)) {
|
|
217
|
-
selectTimeInputRange(inputDomRef);
|
|
218
|
-
}
|
|
219
|
-
});
|
|
159
|
+
return formatDate(v);
|
|
220
160
|
};
|
|
221
161
|
return /*#__PURE__*/_jsxs("div", {
|
|
222
162
|
className: classNames(prefix),
|
|
@@ -254,26 +194,29 @@ var InternalPickerPanel = function InternalPickerPanel(props) {
|
|
|
254
194
|
rules: [{
|
|
255
195
|
required: true
|
|
256
196
|
}],
|
|
257
|
-
children: /*#__PURE__*/_jsx(
|
|
258
|
-
|
|
197
|
+
children: /*#__PURE__*/_jsx(DatePicker, {
|
|
198
|
+
format: {
|
|
199
|
+
format: 'YYYY-MM-DD',
|
|
200
|
+
type: 'mask'
|
|
201
|
+
},
|
|
202
|
+
style: {
|
|
203
|
+
width: 128
|
|
204
|
+
},
|
|
205
|
+
open: false,
|
|
206
|
+
suffixIcon: null,
|
|
207
|
+
allowClear: false,
|
|
259
208
|
onBlur: function onBlur(e) {
|
|
260
209
|
var v = validateInputDate(e);
|
|
261
210
|
if (v) {
|
|
262
|
-
form.setFieldValue('startDate', v);
|
|
263
|
-
setCalendarValue(function (
|
|
264
|
-
var
|
|
265
|
-
eDate =
|
|
211
|
+
form.setFieldValue('startDate', getDateInstance(v));
|
|
212
|
+
setCalendarValue(function (_ref) {
|
|
213
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
214
|
+
eDate = _ref2[1];
|
|
266
215
|
return [getDateInstance(v), eDate];
|
|
267
216
|
});
|
|
268
217
|
} else {
|
|
269
218
|
setFormatDateToForm();
|
|
270
219
|
}
|
|
271
|
-
},
|
|
272
|
-
onClick: function onClick() {
|
|
273
|
-
selectDateInputRange(form.getFieldInstance('startDate').nativeElement);
|
|
274
|
-
},
|
|
275
|
-
onKeyDown: function onKeyDown(e) {
|
|
276
|
-
handleDateInputKeyDown(form.getFieldInstance('startDate').nativeElement, e);
|
|
277
220
|
}
|
|
278
221
|
})
|
|
279
222
|
})
|
|
@@ -303,11 +246,9 @@ var InternalPickerPanel = function InternalPickerPanel(props) {
|
|
|
303
246
|
style: {
|
|
304
247
|
width: '100%'
|
|
305
248
|
},
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
onKeyDown: function onKeyDown(e) {
|
|
310
|
-
handleTimeInputKeyDown(form.getFieldInstance('startTime').nativeElement.querySelector('input'), e);
|
|
249
|
+
format: {
|
|
250
|
+
format: 'HH:mm:ss',
|
|
251
|
+
type: 'mask'
|
|
311
252
|
}
|
|
312
253
|
})
|
|
313
254
|
})
|
|
@@ -329,25 +270,29 @@ var InternalPickerPanel = function InternalPickerPanel(props) {
|
|
|
329
270
|
rules: [{
|
|
330
271
|
required: true
|
|
331
272
|
}],
|
|
332
|
-
children: /*#__PURE__*/_jsx(
|
|
273
|
+
children: /*#__PURE__*/_jsx(DatePicker, {
|
|
274
|
+
format: {
|
|
275
|
+
format: 'YYYY-MM-DD',
|
|
276
|
+
type: 'mask'
|
|
277
|
+
},
|
|
278
|
+
style: {
|
|
279
|
+
width: 128
|
|
280
|
+
},
|
|
281
|
+
open: false,
|
|
282
|
+
suffixIcon: null,
|
|
283
|
+
allowClear: false,
|
|
333
284
|
onBlur: function onBlur(e) {
|
|
334
285
|
var v = validateInputDate(e);
|
|
335
286
|
if (v) {
|
|
336
|
-
form.setFieldValue('endDate', v);
|
|
337
|
-
setCalendarValue(function (
|
|
338
|
-
var
|
|
339
|
-
sDate =
|
|
287
|
+
form.setFieldValue('endDate', getDateInstance(v));
|
|
288
|
+
setCalendarValue(function (_ref3) {
|
|
289
|
+
var _ref4 = _slicedToArray(_ref3, 1),
|
|
290
|
+
sDate = _ref4[0];
|
|
340
291
|
return [sDate, getDateInstance(v)];
|
|
341
292
|
});
|
|
342
293
|
} else {
|
|
343
294
|
setFormatDateToForm();
|
|
344
295
|
}
|
|
345
|
-
},
|
|
346
|
-
onClick: function onClick() {
|
|
347
|
-
selectDateInputRange(form.getFieldInstance('endDate').nativeElement);
|
|
348
|
-
},
|
|
349
|
-
onKeyDown: function onKeyDown(e) {
|
|
350
|
-
handleDateInputKeyDown(form.getFieldInstance('endDate').nativeElement, e);
|
|
351
296
|
}
|
|
352
297
|
})
|
|
353
298
|
})
|
|
@@ -377,11 +322,9 @@ var InternalPickerPanel = function InternalPickerPanel(props) {
|
|
|
377
322
|
style: {
|
|
378
323
|
width: '100%'
|
|
379
324
|
},
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
onKeyDown: function onKeyDown(e) {
|
|
384
|
-
handleTimeInputKeyDown(form.getFieldInstance('endTime').nativeElement.querySelector('input'), e);
|
|
325
|
+
format: {
|
|
326
|
+
format: 'HH:mm:ss',
|
|
327
|
+
type: 'mask'
|
|
385
328
|
}
|
|
386
329
|
})
|
|
387
330
|
})
|
|
@@ -407,7 +350,12 @@ var InternalPickerPanel = function InternalPickerPanel(props) {
|
|
|
407
350
|
onPanelHover(arguments.length <= 0 ? undefined : arguments[0]);
|
|
408
351
|
},
|
|
409
352
|
onSelect: function onSelect() {
|
|
410
|
-
|
|
353
|
+
clickFSANext();
|
|
354
|
+
if (clickFSA === CLICK_STATE.END) {
|
|
355
|
+
setCalendarValue([arguments.length <= 0 ? undefined : arguments[0], arguments.length <= 0 ? undefined : arguments[0]]);
|
|
356
|
+
} else {
|
|
357
|
+
setCalendarValue(fillCalendarValue(arguments.length <= 0 ? undefined : arguments[0], activeIndex));
|
|
358
|
+
}
|
|
411
359
|
setActiveIndex(function (index) {
|
|
412
360
|
return index + 1 === 2 ? 0 : index + 1;
|
|
413
361
|
});
|
|
@@ -463,14 +411,14 @@ var InternalPickerPanel = function InternalPickerPanel(props) {
|
|
|
463
411
|
endDate = values.endDate,
|
|
464
412
|
endTime = values.endTime;
|
|
465
413
|
// 日期同一天时对时间进行排序,保证开始时间在结束时间之前
|
|
466
|
-
var
|
|
414
|
+
var _ref5 = startDate.isSame(endDate) ? [startTime, endTime].sort(function (a, b) {
|
|
467
415
|
return (a === null || a === void 0 ? void 0 : a.valueOf()) - (b === null || b === void 0 ? void 0 : b.valueOf());
|
|
468
416
|
}) : [startTime, endTime],
|
|
469
|
-
|
|
470
|
-
sTime =
|
|
471
|
-
eTime =
|
|
472
|
-
var start = "".concat(startDate, " ").concat(sTime.format(TIME_FORMAT));
|
|
473
|
-
var end = "".concat(endDate, " ").concat(eTime.format(TIME_FORMAT));
|
|
417
|
+
_ref6 = _slicedToArray(_ref5, 2),
|
|
418
|
+
sTime = _ref6[0],
|
|
419
|
+
eTime = _ref6[1];
|
|
420
|
+
var start = "".concat(formatDate(startDate), " ").concat(sTime.format(TIME_FORMAT));
|
|
421
|
+
var end = "".concat(formatDate(endDate), " ").concat(eTime.format(TIME_FORMAT));
|
|
474
422
|
var errorList = [];
|
|
475
423
|
var message = '';
|
|
476
424
|
rules === null || rules === void 0 || rules.some(function (item) {
|
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" | "java" | "python" | "sql" | "json" | "javascript" | "typescript" | "groovy" | "bash" | "cpp" | "http" | "markdown" | "nginx" | "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
|
@@ -10,6 +10,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
10
10
|
import React, { useContext } from 'react';
|
|
11
11
|
import { ProCard as AntProCard } from '@ant-design/pro-components';
|
|
12
12
|
import { ConfigProvider } from '@oceanbase/design';
|
|
13
|
+
import { isHorizontalPaddingZero } from '@oceanbase/design/es/_util';
|
|
13
14
|
import classNames from 'classnames';
|
|
14
15
|
import useStyle from "./style";
|
|
15
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -28,10 +29,10 @@ var ProCard = function ProCard(_ref) {
|
|
|
28
29
|
var prefixCls = getPrefixCls('pro-card', customizePrefixCls);
|
|
29
30
|
var _useStyle = useStyle(prefixCls),
|
|
30
31
|
wrapSSR = _useStyle.wrapSSR;
|
|
31
|
-
|
|
32
|
-
// ProCard body
|
|
33
|
-
var
|
|
34
|
-
var proCardCls = classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-has-title"), !!title), "".concat(prefixCls, "-no-body-padding"),
|
|
32
|
+
|
|
33
|
+
// ProCard body no horizontal padding
|
|
34
|
+
var noBodyHorizontalPadding = isHorizontalPaddingZero(bodyStyle === null || bodyStyle === void 0 ? void 0 : bodyStyle.padding) || ghost;
|
|
35
|
+
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);
|
|
35
36
|
return wrapSSR( /*#__PURE__*/_jsx(AntProCard, _objectSpread({
|
|
36
37
|
prefixCls: customizePrefixCls,
|
|
37
38
|
ghost: ghost,
|
|
@@ -10,9 +10,10 @@ export var genProCardStyle = function genProCardStyle(token) {
|
|
|
10
10
|
var componentCls = token.componentCls,
|
|
11
11
|
antCls = token.antCls,
|
|
12
12
|
prefixCls = token.prefixCls;
|
|
13
|
+
var tableComponentCls = "".concat(antCls, "-table");
|
|
13
14
|
var tabsComponentCls = "".concat(antCls, "-tabs");
|
|
14
15
|
var tabsPrefixCls = "".concat(prefixCls, "-tabs");
|
|
15
|
-
return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "div".concat(componentCls), {
|
|
16
|
+
return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "div".concat(componentCls), {
|
|
16
17
|
borderRadius: token.borderRadiusLG
|
|
17
18
|
}), "".concat(componentCls, ":not(").concat(componentCls, "-border):not(").concat(componentCls, "-ghost)"), {
|
|
18
19
|
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)'
|
|
@@ -25,9 +26,11 @@ export var genProCardStyle = function genProCardStyle(token) {
|
|
|
25
26
|
}), "".concat(componentCls, "-body"), {
|
|
26
27
|
paddingBlock: 0,
|
|
27
28
|
paddingInline: 0
|
|
28
|
-
})), "".concat(componentCls).concat(componentCls, "-no-
|
|
29
|
+
})), "&".concat(componentCls, "-has-title").concat(componentCls, "-no-divider:not(").concat(componentCls, "-contain-tabs)"), _defineProperty({}, "".concat(componentCls, "-body"), _defineProperty({}, "& > ".concat(tableComponentCls, "-wrapper ").concat(tableComponentCls, ":not(").concat(tableComponentCls, "-bordered):first-child"), {
|
|
30
|
+
marginTop: -token.marginSM
|
|
31
|
+
}))), "".concat(componentCls).concat(componentCls, "-no-body-horizontal-padding:not(").concat(componentCls, "-contain-tabs)"), _objectSpread(_defineProperty({}, "".concat(componentCls, "-header"), {
|
|
29
32
|
paddingBlockEnd: token.padding
|
|
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"), {
|
|
33
|
+
}), Card.genTableStyle(token.paddingLG, token))), "".concat(componentCls).concat(componentCls, "-no-body-horizontal-padding").concat(componentCls, "-size-small:not(").concat(componentCls, "-contain-tabs)"), _objectSpread(_defineProperty({}, "".concat(componentCls, "-header"), {
|
|
31
34
|
paddingBlockEnd: token.paddingXS
|
|
32
35
|
}), Card.genTableStyle(token.paddingSM, token))), "".concat(componentCls), _defineProperty({}, "".concat(componentCls, "-tabs"), _objectSpread(_defineProperty({}, "".concat(tabsComponentCls, "-top, ").concat(tabsComponentCls, "-bottom"), _defineProperty({}, ">".concat(tabsComponentCls, "-nav ").concat(tabsComponentCls, "-nav-list"), {
|
|
33
36
|
marginBlockStart: 0,
|
package/es/ProTable/index.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { ProTableProps } from '@ant-design/pro-components';
|
|
3
|
-
export
|
|
4
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ProTableProps as AntProTableProps } from '@ant-design/pro-components';
|
|
3
|
+
export interface ProTableProps<T, U, ValueType> extends AntProTableProps<T, U, ValueType> {
|
|
4
|
+
innerBordered?: boolean;
|
|
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>>;
|
|
7
|
+
declare namespace ProTable {
|
|
8
|
+
var Summary;
|
|
9
|
+
}
|
|
5
10
|
export default ProTable;
|
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", "expandable", "rowSelection", "pagination", "footer", "locale", "cardProps", "prefixCls", "tableClassName", "className"],
|
|
2
|
+
var _excluded = ["form", "headerTitle", "options", "optionsRender", "toolbar", "toolBarRender", "size", "bordered", "innerBordered", "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; }
|
|
@@ -16,7 +16,9 @@ import { isEmpty } 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";
|
|
19
|
-
|
|
19
|
+
// type CompoundedComponent = React.FC<ProTableProps<T, U, ValueType>> & typeof AntProTable;
|
|
20
|
+
|
|
21
|
+
function ProTable(_ref) {
|
|
20
22
|
var form = _ref.form,
|
|
21
23
|
headerTitle = _ref.headerTitle,
|
|
22
24
|
options = _ref.options,
|
|
@@ -24,6 +26,8 @@ var ProTable = function ProTable(_ref) {
|
|
|
24
26
|
toolbar = _ref.toolbar,
|
|
25
27
|
toolBarRender = _ref.toolBarRender,
|
|
26
28
|
size = _ref.size,
|
|
29
|
+
bordered = _ref.bordered,
|
|
30
|
+
innerBordered = _ref.innerBordered,
|
|
27
31
|
expandable = _ref.expandable,
|
|
28
32
|
rowSelection = _ref.rowSelection,
|
|
29
33
|
customPagination = _ref.pagination,
|
|
@@ -42,7 +46,7 @@ var ProTable = function ProTable(_ref) {
|
|
|
42
46
|
var _Table$useStyle = Table.useStyle(tablePrefixCls),
|
|
43
47
|
tableWrapSSR = _Table$useStyle.wrapSSR;
|
|
44
48
|
var pagination = Table.useDefaultPagination(customPagination);
|
|
45
|
-
var tableCls = classNames(_defineProperty(_defineProperty(_defineProperty({}, "".concat(tablePrefixCls, "-expandable"), !isEmpty(expandable)), "".concat(tablePrefixCls, "-selectable"), !!rowSelection), "".concat(tablePrefixCls, "-has-footer"), !!footer), tableClassName);
|
|
49
|
+
var tableCls = classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(tablePrefixCls, "-expandable"), !isEmpty(expandable)), "".concat(tablePrefixCls, "-selectable"), !!rowSelection), "".concat(tablePrefixCls, "-has-footer"), !!footer), "".concat(tablePrefixCls, "-inner-bordered"), innerBordered), tableClassName);
|
|
46
50
|
|
|
47
51
|
// customize LightFilter style
|
|
48
52
|
var lightFilterPrefixCls = getPrefixCls('pro-form-light-filter', customizePrefixCls);
|
|
@@ -65,6 +69,7 @@ var ProTable = function ProTable(_ref) {
|
|
|
65
69
|
, _objectSpread({
|
|
66
70
|
defaultSize: "large",
|
|
67
71
|
size: size,
|
|
72
|
+
bordered: bordered || innerBordered,
|
|
68
73
|
form: _objectSpread({
|
|
69
74
|
// query form should remove required mark
|
|
70
75
|
requiredMark: false
|
|
@@ -93,6 +98,6 @@ var ProTable = function ProTable(_ref) {
|
|
|
93
98
|
tableClassName: tableCls,
|
|
94
99
|
className: proTableCls
|
|
95
100
|
}, restProps)))));
|
|
96
|
-
}
|
|
101
|
+
}
|
|
97
102
|
ProTable.Summary = AntProTable.Summary;
|
|
98
103
|
export default ProTable;
|