@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/SideTip/Dragger.js
CHANGED
|
@@ -219,8 +219,10 @@ var Draggable = /*#__PURE__*/function (_React$Component) {
|
|
|
219
219
|
_createClass(Draggable, [{
|
|
220
220
|
key: "componentDidMount",
|
|
221
221
|
value: function componentDidMount() {
|
|
222
|
+
var _this$props$draggable = this.props.draggable,
|
|
223
|
+
draggable = _this$props$draggable === void 0 ? true : _this$props$draggable;
|
|
222
224
|
window.addEventListener('resize', this.handleResize, false);
|
|
223
|
-
window.addEventListener('mousemove', this.handleMouseMove, false);
|
|
225
|
+
if (draggable) window.addEventListener('mousemove', this.handleMouseMove, false);
|
|
224
226
|
window.addEventListener('mouseup', this.handleMouseUp, false);
|
|
225
227
|
window.addEventListener('load', this.overlapDetection, false);
|
|
226
228
|
var _this$nodeRef$current = this.nodeRef.current.getBoundingClientRect(),
|
|
@@ -232,8 +234,10 @@ var Draggable = /*#__PURE__*/function (_React$Component) {
|
|
|
232
234
|
}, {
|
|
233
235
|
key: "componentWillUnmount",
|
|
234
236
|
value: function componentWillUnmount() {
|
|
237
|
+
var _this$props$draggable2 = this.props.draggable,
|
|
238
|
+
draggable = _this$props$draggable2 === void 0 ? true : _this$props$draggable2;
|
|
235
239
|
window.removeEventListener('load', this.overlapDetection, false);
|
|
236
|
-
window.removeEventListener('mousemove', this.handleMouseMove, false);
|
|
240
|
+
if (draggable) window.removeEventListener('mousemove', this.handleMouseMove, false);
|
|
237
241
|
window.removeEventListener('mouseup', this.handleMouseUp, false);
|
|
238
242
|
window.removeEventListener('resize', this.handleResize, false);
|
|
239
243
|
}
|
package/es/SideTip/index.d.ts
CHANGED
|
@@ -147,6 +147,12 @@ export interface SideTipProps extends LocaleWrapperProps {
|
|
|
147
147
|
*/
|
|
148
148
|
getPopupContainer?: () => HTMLElement;
|
|
149
149
|
children?: any;
|
|
150
|
+
/**
|
|
151
|
+
* @title 是否可拖拽
|
|
152
|
+
* @description 是否可拖拽
|
|
153
|
+
* @default true
|
|
154
|
+
*/
|
|
155
|
+
draggable?: boolean;
|
|
150
156
|
}
|
|
151
157
|
export interface SideTipState {
|
|
152
158
|
hide?: boolean;
|
package/es/SideTip/index.js
CHANGED
|
@@ -54,6 +54,8 @@ var SideTip = function SideTip(props) {
|
|
|
54
54
|
hideable = _props$hideable === void 0 ? true : _props$hideable,
|
|
55
55
|
_props$disabled = props.disabled,
|
|
56
56
|
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
57
|
+
_props$draggable = props.draggable,
|
|
58
|
+
draggable = _props$draggable === void 0 ? true : _props$draggable,
|
|
57
59
|
getPopupContainer = props.getPopupContainer;
|
|
58
60
|
var _useState = useState(hideable ? defaultHide === undefined ? window.localStorage.getItem(getLocalStorageKey(id)) === 'true' : !!defaultHide : false),
|
|
59
61
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -175,6 +177,7 @@ var SideTip = function SideTip(props) {
|
|
|
175
177
|
onDrag: onDrag,
|
|
176
178
|
getPopupContainer: getPopupContainer,
|
|
177
179
|
className: className,
|
|
180
|
+
draggable: draggable,
|
|
178
181
|
children: [tooltip && tooltip.title ? /*#__PURE__*/_jsx(Tooltip, _objectSpread(_objectSpread({}, tooltip), {}, {
|
|
179
182
|
getPopupContainer: function getPopupContainer() {
|
|
180
183
|
return buttonRef.current;
|
package/lib/Action/Group.js
CHANGED
|
@@ -128,22 +128,22 @@ var Group_default = ({
|
|
|
128
128
|
else if (shouldDisabled)
|
|
129
129
|
disabled = shouldDisabled(action.key);
|
|
130
130
|
const actionDisabled = action.props.loading || ((0, import_lodash.isBoolean)(action.props.disabled) ? action.props.disabled : getDefaultDisabled(action.key));
|
|
131
|
-
return (
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
{
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
...(0, import_lodash.omit)(action.props, "disabled"),
|
|
142
|
-
disabled: actionDisabled
|
|
131
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
132
|
+
import_design.Menu.Item,
|
|
133
|
+
{
|
|
134
|
+
key: actionKey ?? index.toString(),
|
|
135
|
+
onClick: ({ domEvent }) => {
|
|
136
|
+
var _a, _b;
|
|
137
|
+
(_b = (_a = action.props).onClick) == null ? void 0 : _b.call(
|
|
138
|
+
_a,
|
|
139
|
+
domEvent
|
|
140
|
+
);
|
|
143
141
|
},
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
142
|
+
...(0, import_lodash.omit)(action.props, ["disabled"]),
|
|
143
|
+
disabled: actionDisabled
|
|
144
|
+
},
|
|
145
|
+
/* @__PURE__ */ import_react.default.createElement(import_design.Tooltip, { title: action.props.tooltip }, action.props.loading && /* @__PURE__ */ import_react.default.createElement(import_icons.LoadingOutlined, null), " ", action.props.children || action)
|
|
146
|
+
), action.props.divider && /* @__PURE__ */ import_react.default.createElement(import_design.Menu.Divider, null));
|
|
147
147
|
}))
|
|
148
148
|
},
|
|
149
149
|
moreDom
|
package/lib/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;
|
|
@@ -53,6 +53,7 @@ var Header = ({
|
|
|
53
53
|
extra,
|
|
54
54
|
pathname,
|
|
55
55
|
welcomePath,
|
|
56
|
+
versionNoticePath,
|
|
56
57
|
docsPath,
|
|
57
58
|
pdfPath,
|
|
58
59
|
iconUrl,
|
|
@@ -82,6 +83,8 @@ var Header = ({
|
|
|
82
83
|
var _a;
|
|
83
84
|
if (key === "welcome") {
|
|
84
85
|
navigate == null ? void 0 : navigate(welcomePath);
|
|
86
|
+
} else if (key === "versionNotice") {
|
|
87
|
+
(0, import_util.directTo)(versionNoticePath);
|
|
85
88
|
} else if (key === "viewDocs") {
|
|
86
89
|
(0, import_util.directTo)(docsPath);
|
|
87
90
|
} else if (key === "downloadDocs") {
|
|
@@ -96,6 +99,7 @@ var Header = ({
|
|
|
96
99
|
}
|
|
97
100
|
},
|
|
98
101
|
welcomePath && /* @__PURE__ */ import_react.default.createElement(import_design.Menu.Item, { key: "welcome" }, locale.welcome),
|
|
102
|
+
versionNoticePath && /* @__PURE__ */ import_react.default.createElement(import_design.Menu.Item, { key: "versionNotice" }, locale.versionNotice),
|
|
99
103
|
docsPath && /* @__PURE__ */ import_react.default.createElement(import_design.Menu.Item, { key: "viewDocs" }, locale.viewDocs),
|
|
100
104
|
pdfPath && /* @__PURE__ */ import_react.default.createElement(import_design.Menu.Item, { key: "downloadDocs" }, locale.downloadDocs),
|
|
101
105
|
/* @__PURE__ */ import_react.default.createElement(import_design.Menu.Item, { key: "about" }, `${locale.about}${appData.shortName ? ` ${appData.shortName}` : ""}`)
|
|
@@ -34,7 +34,7 @@ __export(ContentWithIcon_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(ContentWithIcon_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
36
|
var import_antd = require("antd");
|
|
37
|
-
var import_icons = require("@
|
|
37
|
+
var import_icons = require("@oceanbase/icons");
|
|
38
38
|
var import_classnames = __toESM(require("classnames"));
|
|
39
39
|
var import_util = require("../_util");
|
|
40
40
|
var import_index = require("./index.less");
|
|
@@ -46,6 +46,19 @@ var import_dayjs2 = __toESM(require("dayjs"));
|
|
|
46
46
|
var import_util = require("../_util");
|
|
47
47
|
var import_constant = require("./constant");
|
|
48
48
|
var ALL_ERROR_TYPE_LIST = ["endDate", "startDate", "endTime", "startTime"];
|
|
49
|
+
var CLICK_STATE = {
|
|
50
|
+
START: "START",
|
|
51
|
+
END: "END"
|
|
52
|
+
};
|
|
53
|
+
var useClickFSA = () => {
|
|
54
|
+
const [state, setState] = (0, import_react.useState)(CLICK_STATE.END);
|
|
55
|
+
const next = () => {
|
|
56
|
+
setState((ps) => {
|
|
57
|
+
return ps === CLICK_STATE.START ? CLICK_STATE.END : CLICK_STATE.START;
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
return [state, next];
|
|
61
|
+
};
|
|
49
62
|
var prefix = (0, import_util.getPrefix)("ranger-picker-panel");
|
|
50
63
|
var prefixCls = "ant-picker";
|
|
51
64
|
var TIME_FORMAT = "HH:mm:ss";
|
|
@@ -63,6 +76,7 @@ var InternalPickerPanel = (props) => {
|
|
|
63
76
|
} = props;
|
|
64
77
|
const rootCls = (0, import_useCSSVarCls.default)(prefixCls);
|
|
65
78
|
const [wrapCSSVar, hashId, cssVarCls] = (0, import_style.default)(prefixCls, rootCls);
|
|
79
|
+
const [clickFSA, clickFSANext] = useClickFSA();
|
|
66
80
|
const [defaultS, defaultE] = defaultValue;
|
|
67
81
|
const [calendarValue, setCalendarValue] = import_react.default.useState(defaultValue);
|
|
68
82
|
const [internalHoverValues, setInternalHoverValues] = import_react.default.useState(null);
|
|
@@ -88,7 +102,9 @@ var InternalPickerPanel = (props) => {
|
|
|
88
102
|
return clone;
|
|
89
103
|
}
|
|
90
104
|
const onPanelHover = (date) => {
|
|
91
|
-
setInternalHoverValues(
|
|
105
|
+
setInternalHoverValues(
|
|
106
|
+
date && clickFSA === CLICK_STATE.START ? fillCalendarValue(date, activeIndex) : null
|
|
107
|
+
);
|
|
92
108
|
};
|
|
93
109
|
const formatValues = [...calendarValue].sort((a, b) => {
|
|
94
110
|
return (a == null ? void 0 : a.valueOf()) - (b == null ? void 0 : b.valueOf());
|
|
@@ -99,8 +115,8 @@ var InternalPickerPanel = (props) => {
|
|
|
99
115
|
const [_sDate, _eDate] = formatValues;
|
|
100
116
|
const setFormatDateToForm = () => {
|
|
101
117
|
form.setFieldsValue({
|
|
102
|
-
startDate: _sDate,
|
|
103
|
-
endDate: _eDate
|
|
118
|
+
startDate: getDateInstance(_sDate),
|
|
119
|
+
endDate: getDateInstance(_eDate)
|
|
104
120
|
});
|
|
105
121
|
};
|
|
106
122
|
(0, import_react.useEffect)(() => {
|
|
@@ -115,88 +131,13 @@ var InternalPickerPanel = (props) => {
|
|
|
115
131
|
pre[errorKey] = "error";
|
|
116
132
|
return pre;
|
|
117
133
|
}, {});
|
|
118
|
-
const
|
|
119
|
-
const v = e.target.value;
|
|
134
|
+
const formatDate = (v) => {
|
|
120
135
|
const date = getDateInstance(v, DATE_FORMAT, true);
|
|
121
136
|
return date.isValid() ? date.format(DATE_FORMAT) : null;
|
|
122
137
|
};
|
|
123
|
-
const
|
|
138
|
+
const validateInputDate = (e) => {
|
|
124
139
|
const v = e.target.value;
|
|
125
|
-
|
|
126
|
-
if (!(h && m && s))
|
|
127
|
-
return null;
|
|
128
|
-
if (!(h.length === 2 && m.length === 2 && s.length === 2))
|
|
129
|
-
return null;
|
|
130
|
-
const date = getDateInstance(v, TIME_FORMAT, true);
|
|
131
|
-
return date.isValid() ? date.format(TIME_FORMAT) : null;
|
|
132
|
-
};
|
|
133
|
-
const selectDateInputRange = (inputDomRef) => {
|
|
134
|
-
if (!inputDomRef)
|
|
135
|
-
return;
|
|
136
|
-
if (inputDomRef.selectionStart >= 0 && inputDomRef.selectionStart <= 4) {
|
|
137
|
-
inputDomRef.setSelectionRange(0, 4);
|
|
138
|
-
}
|
|
139
|
-
if (inputDomRef.selectionStart > 4 && inputDomRef.selectionStart <= 7) {
|
|
140
|
-
inputDomRef.setSelectionRange(5, 7);
|
|
141
|
-
}
|
|
142
|
-
if (inputDomRef.selectionStart > 7 && inputDomRef.selectionStart <= 10) {
|
|
143
|
-
inputDomRef.setSelectionRange(8, 10);
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
const selectTimeInputRange = (inputDomRef) => {
|
|
147
|
-
if (!inputDomRef)
|
|
148
|
-
return;
|
|
149
|
-
if (inputDomRef.selectionStart >= 0 && inputDomRef.selectionStart <= 2) {
|
|
150
|
-
inputDomRef.setSelectionRange(0, 2);
|
|
151
|
-
}
|
|
152
|
-
if (inputDomRef.selectionStart > 2 && inputDomRef.selectionStart <= 5) {
|
|
153
|
-
inputDomRef.setSelectionRange(3, 5);
|
|
154
|
-
}
|
|
155
|
-
if (inputDomRef.selectionStart > 5 && inputDomRef.selectionStart <= 8) {
|
|
156
|
-
inputDomRef.setSelectionRange(6, 8);
|
|
157
|
-
}
|
|
158
|
-
};
|
|
159
|
-
const handleDateInputKeyDown = (inputDomRef, e) => {
|
|
160
|
-
if (!inputDomRef)
|
|
161
|
-
return;
|
|
162
|
-
if (e.key === "Enter") {
|
|
163
|
-
inputDomRef.blur();
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
if (e.key === "ArrowLeft") {
|
|
167
|
-
const curIndex = inputDomRef.selectionStart;
|
|
168
|
-
inputDomRef.setSelectionRange(curIndex - 1, curIndex - 1);
|
|
169
|
-
}
|
|
170
|
-
if (e.key === "ArrowRight") {
|
|
171
|
-
const curIndex = inputDomRef.selectionEnd;
|
|
172
|
-
inputDomRef.setSelectionRange(curIndex + 1, curIndex + 1);
|
|
173
|
-
}
|
|
174
|
-
requestIdleCallback(() => {
|
|
175
|
-
if (validateInputDate(e)) {
|
|
176
|
-
selectDateInputRange(inputDomRef);
|
|
177
|
-
}
|
|
178
|
-
});
|
|
179
|
-
};
|
|
180
|
-
const handleTimeInputKeyDown = (inputDomRef, e) => {
|
|
181
|
-
if (!inputDomRef)
|
|
182
|
-
return;
|
|
183
|
-
if (e.key === "Enter") {
|
|
184
|
-
inputDomRef.blur();
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
if (e.key === "ArrowLeft") {
|
|
188
|
-
const curIndex = inputDomRef.selectionStart;
|
|
189
|
-
inputDomRef.setSelectionRange(curIndex - 1, curIndex - 1);
|
|
190
|
-
}
|
|
191
|
-
if (e.key === "ArrowRight") {
|
|
192
|
-
const curIndex = inputDomRef.selectionEnd;
|
|
193
|
-
inputDomRef.setSelectionRange(curIndex + 1, curIndex + 1);
|
|
194
|
-
}
|
|
195
|
-
requestIdleCallback(() => {
|
|
196
|
-
if (validateInputTime(e)) {
|
|
197
|
-
selectTimeInputRange(inputDomRef);
|
|
198
|
-
}
|
|
199
|
-
});
|
|
140
|
+
return formatDate(v);
|
|
200
141
|
};
|
|
201
142
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(prefix) }, /* @__PURE__ */ import_react.default.createElement(import_design.Space, { direction: "vertical", size: 12, style: { margin: "12px 0" } }, /* @__PURE__ */ import_react.default.createElement(
|
|
202
143
|
import_design.Form,
|
|
@@ -217,25 +158,26 @@ var InternalPickerPanel = (props) => {
|
|
|
217
158
|
rules: [{ required: true }]
|
|
218
159
|
},
|
|
219
160
|
/* @__PURE__ */ import_react.default.createElement(
|
|
220
|
-
import_design.
|
|
161
|
+
import_design.DatePicker,
|
|
221
162
|
{
|
|
222
|
-
|
|
163
|
+
format: {
|
|
164
|
+
format: "YYYY-MM-DD",
|
|
165
|
+
type: "mask"
|
|
166
|
+
},
|
|
167
|
+
style: { width: 128 },
|
|
168
|
+
open: false,
|
|
169
|
+
suffixIcon: null,
|
|
170
|
+
allowClear: false,
|
|
223
171
|
onBlur: (e) => {
|
|
224
172
|
const v = validateInputDate(e);
|
|
225
173
|
if (v) {
|
|
226
|
-
form.setFieldValue("startDate", v);
|
|
174
|
+
form.setFieldValue("startDate", getDateInstance(v));
|
|
227
175
|
setCalendarValue(([, eDate]) => {
|
|
228
176
|
return [getDateInstance(v), eDate];
|
|
229
177
|
});
|
|
230
178
|
} else {
|
|
231
179
|
setFormatDateToForm();
|
|
232
180
|
}
|
|
233
|
-
},
|
|
234
|
-
onClick: () => {
|
|
235
|
-
selectDateInputRange(form.getFieldInstance("startDate").nativeElement);
|
|
236
|
-
},
|
|
237
|
-
onKeyDown: (e) => {
|
|
238
|
-
handleDateInputKeyDown(form.getFieldInstance("startDate").nativeElement, e);
|
|
239
181
|
}
|
|
240
182
|
}
|
|
241
183
|
)
|
|
@@ -257,16 +199,9 @@ var InternalPickerPanel = (props) => {
|
|
|
257
199
|
needConfirm: false,
|
|
258
200
|
getPopupContainer: (triggerNode) => triggerNode.parentNode,
|
|
259
201
|
style: { width: "100%" },
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
);
|
|
264
|
-
},
|
|
265
|
-
onKeyDown: (e) => {
|
|
266
|
-
handleTimeInputKeyDown(
|
|
267
|
-
form.getFieldInstance("startTime").nativeElement.querySelector("input"),
|
|
268
|
-
e
|
|
269
|
-
);
|
|
202
|
+
format: {
|
|
203
|
+
format: "HH:mm:ss",
|
|
204
|
+
type: "mask"
|
|
270
205
|
}
|
|
271
206
|
}
|
|
272
207
|
)
|
|
@@ -281,24 +216,26 @@ var InternalPickerPanel = (props) => {
|
|
|
281
216
|
rules: [{ required: true }]
|
|
282
217
|
},
|
|
283
218
|
/* @__PURE__ */ import_react.default.createElement(
|
|
284
|
-
import_design.
|
|
219
|
+
import_design.DatePicker,
|
|
285
220
|
{
|
|
221
|
+
format: {
|
|
222
|
+
format: "YYYY-MM-DD",
|
|
223
|
+
type: "mask"
|
|
224
|
+
},
|
|
225
|
+
style: { width: 128 },
|
|
226
|
+
open: false,
|
|
227
|
+
suffixIcon: null,
|
|
228
|
+
allowClear: false,
|
|
286
229
|
onBlur: (e) => {
|
|
287
230
|
const v = validateInputDate(e);
|
|
288
231
|
if (v) {
|
|
289
|
-
form.setFieldValue("endDate", v);
|
|
232
|
+
form.setFieldValue("endDate", getDateInstance(v));
|
|
290
233
|
setCalendarValue(([sDate]) => {
|
|
291
234
|
return [sDate, getDateInstance(v)];
|
|
292
235
|
});
|
|
293
236
|
} else {
|
|
294
237
|
setFormatDateToForm();
|
|
295
238
|
}
|
|
296
|
-
},
|
|
297
|
-
onClick: () => {
|
|
298
|
-
selectDateInputRange(form.getFieldInstance("endDate").nativeElement);
|
|
299
|
-
},
|
|
300
|
-
onKeyDown: (e) => {
|
|
301
|
-
handleDateInputKeyDown(form.getFieldInstance("endDate").nativeElement, e);
|
|
302
239
|
}
|
|
303
240
|
}
|
|
304
241
|
)
|
|
@@ -320,16 +257,9 @@ var InternalPickerPanel = (props) => {
|
|
|
320
257
|
needConfirm: false,
|
|
321
258
|
getPopupContainer: (triggerNode) => triggerNode.parentNode,
|
|
322
259
|
style: { width: "100%" },
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
);
|
|
327
|
-
},
|
|
328
|
-
onKeyDown: (e) => {
|
|
329
|
-
handleTimeInputKeyDown(
|
|
330
|
-
form.getFieldInstance("endTime").nativeElement.querySelector("input"),
|
|
331
|
-
e
|
|
332
|
-
);
|
|
260
|
+
format: {
|
|
261
|
+
format: "HH:mm:ss",
|
|
262
|
+
type: "mask"
|
|
333
263
|
}
|
|
334
264
|
}
|
|
335
265
|
)
|
|
@@ -355,7 +285,12 @@ var InternalPickerPanel = (props) => {
|
|
|
355
285
|
onPanelHover(res[0]);
|
|
356
286
|
},
|
|
357
287
|
onSelect: (...res) => {
|
|
358
|
-
|
|
288
|
+
clickFSANext();
|
|
289
|
+
if (clickFSA === CLICK_STATE.END) {
|
|
290
|
+
setCalendarValue([res[0], res[0]]);
|
|
291
|
+
} else {
|
|
292
|
+
setCalendarValue(fillCalendarValue(res[0], activeIndex));
|
|
293
|
+
}
|
|
359
294
|
setActiveIndex((index) => {
|
|
360
295
|
return index + 1 === 2 ? 0 : index + 1;
|
|
361
296
|
});
|
|
@@ -400,11 +335,11 @@ var InternalPickerPanel = (props) => {
|
|
|
400
335
|
onClick: () => {
|
|
401
336
|
form.validateFields().then((values) => {
|
|
402
337
|
const { startDate, startTime, endDate, endTime } = values;
|
|
403
|
-
const [sTime, eTime] = startDate
|
|
338
|
+
const [sTime, eTime] = startDate.isSame(endDate) ? [startTime, endTime].sort((a, b) => {
|
|
404
339
|
return (a == null ? void 0 : a.valueOf()) - (b == null ? void 0 : b.valueOf());
|
|
405
340
|
}) : [startTime, endTime];
|
|
406
|
-
const start = `${startDate} ${sTime.format(TIME_FORMAT)}`;
|
|
407
|
-
const end = `${endDate} ${eTime.format(TIME_FORMAT)}`;
|
|
341
|
+
const start = `${formatDate(startDate)} ${sTime.format(TIME_FORMAT)}`;
|
|
342
|
+
const end = `${formatDate(endDate)} ${eTime.format(TIME_FORMAT)}`;
|
|
408
343
|
let errorList = [];
|
|
409
344
|
let message = "";
|
|
410
345
|
rules == null ? void 0 : rules.some((item) => {
|
package/lib/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/lib/ProCard/index.js
CHANGED
|
@@ -35,6 +35,7 @@ module.exports = __toCommonJS(ProCard_exports);
|
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
36
|
var import_pro_components = require("@ant-design/pro-components");
|
|
37
37
|
var import_design = require("@oceanbase/design");
|
|
38
|
+
var import_util = require("@oceanbase/design/es/_util");
|
|
38
39
|
var import_classnames = __toESM(require("classnames"));
|
|
39
40
|
var import_style = __toESM(require("./style"));
|
|
40
41
|
var ProCard = ({
|
|
@@ -50,12 +51,11 @@ var ProCard = ({
|
|
|
50
51
|
const { getPrefixCls } = (0, import_react.useContext)(import_design.ConfigProvider.ConfigContext);
|
|
51
52
|
const prefixCls = getPrefixCls("pro-card", customizePrefixCls);
|
|
52
53
|
const { wrapSSR } = (0, import_style.default)(prefixCls);
|
|
53
|
-
const
|
|
54
|
-
const noBodyPadding = zeroPaddingList.includes(bodyStyle == null ? void 0 : bodyStyle.padding) || ghost;
|
|
54
|
+
const noBodyHorizontalPadding = (0, import_util.isHorizontalPaddingZero)(bodyStyle == null ? void 0 : bodyStyle.padding) || ghost;
|
|
55
55
|
const proCardCls = (0, import_classnames.default)(
|
|
56
56
|
{
|
|
57
57
|
[`${prefixCls}-has-title`]: !!title,
|
|
58
|
-
[`${prefixCls}-no-body-padding`]:
|
|
58
|
+
[`${prefixCls}-no-body-horizontal-padding`]: noBodyHorizontalPadding,
|
|
59
59
|
[`${prefixCls}-no-divider`]: !headerBordered,
|
|
60
60
|
[`${prefixCls}-contain-tabs`]: !!tabs
|
|
61
61
|
},
|
|
@@ -27,6 +27,7 @@ var import_design = require("@oceanbase/design");
|
|
|
27
27
|
var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
|
|
28
28
|
var genProCardStyle = (token) => {
|
|
29
29
|
const { componentCls, antCls, prefixCls } = token;
|
|
30
|
+
const tableComponentCls = `${antCls}-table`;
|
|
30
31
|
const tabsComponentCls = `${antCls}-tabs`;
|
|
31
32
|
const tabsPrefixCls = `${prefixCls}-tabs`;
|
|
32
33
|
return {
|
|
@@ -58,15 +59,23 @@ var genProCardStyle = (token) => {
|
|
|
58
59
|
paddingInline: 0
|
|
59
60
|
}
|
|
60
61
|
},
|
|
61
|
-
//
|
|
62
|
-
[
|
|
62
|
+
// reduce margin between card title and table
|
|
63
|
+
[`&${componentCls}-has-title${componentCls}-no-divider:not(${componentCls}-contain-tabs)`]: {
|
|
64
|
+
[`${componentCls}-body`]: {
|
|
65
|
+
[`& > ${tableComponentCls}-wrapper ${tableComponentCls}:not(${tableComponentCls}-bordered):first-child`]: {
|
|
66
|
+
marginTop: -token.marginSM
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
// no body horizontal padding card
|
|
71
|
+
[`${componentCls}${componentCls}-no-body-horizontal-padding:not(${componentCls}-contain-tabs)`]: {
|
|
63
72
|
[`${componentCls}-header`]: {
|
|
64
73
|
paddingBlockEnd: token.padding
|
|
65
74
|
},
|
|
66
75
|
...import_design.Card.genTableStyle(token.paddingLG, token)
|
|
67
76
|
},
|
|
68
|
-
// no body padding small card
|
|
69
|
-
[`${componentCls}${componentCls}-no-body-padding${componentCls}-size-small:not(${componentCls}-contain-tabs)`]: {
|
|
77
|
+
// no body horizontal padding small card
|
|
78
|
+
[`${componentCls}${componentCls}-no-body-horizontal-padding${componentCls}-size-small:not(${componentCls}-contain-tabs)`]: {
|
|
70
79
|
[`${componentCls}-header`]: {
|
|
71
80
|
paddingBlockEnd: token.paddingXS
|
|
72
81
|
},
|
package/lib/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/lib/ProTable/index.js
CHANGED
|
@@ -39,7 +39,7 @@ var import_classnames = __toESM(require("classnames"));
|
|
|
39
39
|
var import_lodash = require("lodash");
|
|
40
40
|
var import_style = __toESM(require("../LightFilter/style"));
|
|
41
41
|
var import_style2 = __toESM(require("./style"));
|
|
42
|
-
|
|
42
|
+
function ProTable({
|
|
43
43
|
form,
|
|
44
44
|
headerTitle,
|
|
45
45
|
options,
|
|
@@ -47,6 +47,8 @@ var ProTable = ({
|
|
|
47
47
|
toolbar,
|
|
48
48
|
toolBarRender,
|
|
49
49
|
size,
|
|
50
|
+
bordered,
|
|
51
|
+
innerBordered,
|
|
50
52
|
expandable,
|
|
51
53
|
rowSelection,
|
|
52
54
|
pagination: customPagination,
|
|
@@ -57,7 +59,7 @@ var ProTable = ({
|
|
|
57
59
|
tableClassName,
|
|
58
60
|
className,
|
|
59
61
|
...restProps
|
|
60
|
-
})
|
|
62
|
+
}) {
|
|
61
63
|
const { getPrefixCls } = (0, import_react.useContext)(import_design.ConfigProvider.ConfigContext);
|
|
62
64
|
const tablePrefixCls = getPrefixCls("table", customizePrefixCls);
|
|
63
65
|
const { wrapSSR: tableWrapSSR } = import_design.Table.useStyle(tablePrefixCls);
|
|
@@ -66,7 +68,8 @@ var ProTable = ({
|
|
|
66
68
|
{
|
|
67
69
|
[`${tablePrefixCls}-expandable`]: !(0, import_lodash.isEmpty)(expandable),
|
|
68
70
|
[`${tablePrefixCls}-selectable`]: !!rowSelection,
|
|
69
|
-
[`${tablePrefixCls}-has-footer`]: !!footer
|
|
71
|
+
[`${tablePrefixCls}-has-footer`]: !!footer,
|
|
72
|
+
[`${tablePrefixCls}-inner-bordered`]: innerBordered
|
|
70
73
|
},
|
|
71
74
|
tableClassName
|
|
72
75
|
);
|
|
@@ -86,6 +89,7 @@ var ProTable = ({
|
|
|
86
89
|
{
|
|
87
90
|
defaultSize: "large",
|
|
88
91
|
size,
|
|
92
|
+
bordered: bordered || innerBordered,
|
|
89
93
|
form: {
|
|
90
94
|
// query form should remove required mark
|
|
91
95
|
requiredMark: false,
|
|
@@ -128,6 +132,6 @@ var ProTable = ({
|
|
|
128
132
|
)
|
|
129
133
|
)
|
|
130
134
|
);
|
|
131
|
-
}
|
|
135
|
+
}
|
|
132
136
|
ProTable.Summary = import_pro_components.ProTable.Summary;
|
|
133
137
|
var ProTable_default = ProTable;
|
package/lib/SideTip/Dragger.d.ts
CHANGED
package/lib/SideTip/Dragger.js
CHANGED
|
@@ -198,8 +198,10 @@ var Draggable = class extends import_react.default.Component {
|
|
|
198
198
|
};
|
|
199
199
|
}
|
|
200
200
|
componentDidMount() {
|
|
201
|
+
const { draggable = true } = this.props;
|
|
201
202
|
window.addEventListener("resize", this.handleResize, false);
|
|
202
|
-
|
|
203
|
+
if (draggable)
|
|
204
|
+
window.addEventListener("mousemove", this.handleMouseMove, false);
|
|
203
205
|
window.addEventListener("mouseup", this.handleMouseUp, false);
|
|
204
206
|
window.addEventListener("load", this.overlapDetection, false);
|
|
205
207
|
const { width } = this.nodeRef.current.getBoundingClientRect();
|
|
@@ -208,8 +210,10 @@ var Draggable = class extends import_react.default.Component {
|
|
|
208
210
|
});
|
|
209
211
|
}
|
|
210
212
|
componentWillUnmount() {
|
|
213
|
+
const { draggable = true } = this.props;
|
|
211
214
|
window.removeEventListener("load", this.overlapDetection, false);
|
|
212
|
-
|
|
215
|
+
if (draggable)
|
|
216
|
+
window.removeEventListener("mousemove", this.handleMouseMove, false);
|
|
213
217
|
window.removeEventListener("mouseup", this.handleMouseUp, false);
|
|
214
218
|
window.removeEventListener("resize", this.handleResize, false);
|
|
215
219
|
}
|