@oceanbase/ui 0.4.11 → 0.4.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ui.min.css +1 -1
- package/dist/ui.min.js +1 -1
- package/es/Action/Group.js +6 -7
- package/es/Action/Item.d.ts +3 -2
- 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/Boundary/index.less +10 -18
- package/es/ContentWithIcon/index.js +1 -1
- package/es/DateRanger/PickerPanel.d.ts +1 -1
- package/es/DateRanger/PickerPanel.js +88 -140
- package/es/DateRanger/Ranger.js +2 -2
- package/es/Dialog/Anchor.d.ts +1 -1
- package/es/Dialog/EventProxy.d.ts +1 -1
- package/es/Highlight/DiffView/DiffCells.d.ts +1 -1
- package/es/Highlight/HighlightCell.d.ts +1 -1
- package/es/Highlight/JsonView.d.ts +1 -1
- package/es/Highlight/index.d.ts +1 -1
- package/es/IconFont/index.d.ts +1 -1
- package/es/Login/LoginForm.d.ts +8 -1
- package/es/Login/LoginForm.js +11 -8
- package/es/Login/index.less +1 -1
- package/es/NavMenu/index.d.ts +1 -1
- package/es/PageContainer/ItemRender.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/Ranger/QuickPicker.d.ts +1 -1
- package/es/SideTip/Dragger.d.ts +1 -1
- package/es/SideTip/IconLoading.d.ts +1 -1
- package/lib/Action/Group.js +15 -15
- package/lib/Action/Item.d.ts +3 -2
- 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/Boundary/index.less +10 -18
- package/lib/ContentWithIcon/index.js +1 -1
- package/lib/DateRanger/PickerPanel.d.ts +1 -1
- package/lib/DateRanger/PickerPanel.js +57 -122
- package/lib/DateRanger/Ranger.js +2 -2
- package/lib/Dialog/Anchor.d.ts +1 -1
- package/lib/Dialog/EventProxy.d.ts +1 -1
- package/lib/Highlight/DiffView/DiffCells.d.ts +1 -1
- package/lib/Highlight/HighlightCell.d.ts +1 -1
- package/lib/Highlight/JsonView.d.ts +1 -1
- package/lib/Highlight/index.d.ts +1 -1
- package/lib/IconFont/index.d.ts +1 -1
- package/lib/Login/LoginForm.d.ts +8 -1
- package/lib/Login/LoginForm.js +9 -4
- package/lib/Login/index.less +1 -1
- package/lib/NavMenu/index.d.ts +1 -1
- package/lib/PageContainer/ItemRender.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/Ranger/QuickPicker.d.ts +1 -1
- package/lib/SideTip/Dragger.d.ts +1 -1
- package/lib/SideTip/IconLoading.d.ts +1 -1
- package/package.json +9 -9
|
@@ -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/DateRanger/Ranger.js
CHANGED
|
@@ -230,7 +230,7 @@ var Ranger = import_react.default.forwardRef((props, ref) => {
|
|
|
230
230
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
231
231
|
import_design.Space,
|
|
232
232
|
{
|
|
233
|
-
className: (0, import_classnames.default)({
|
|
233
|
+
className: (0, import_classnames.default)(rest.className, {
|
|
234
234
|
[prefix]: true,
|
|
235
235
|
[`${prefix}-show-range`]: true,
|
|
236
236
|
[`${prefix}-back-radio-focused`]: backRadioFocused
|
|
@@ -358,7 +358,7 @@ var Ranger = import_react.default.forwardRef((props, ref) => {
|
|
|
358
358
|
allowClear: false,
|
|
359
359
|
size,
|
|
360
360
|
suffixIcon: null,
|
|
361
|
-
...(0, import_lodash.omit)(rest, "value", "onChange"),
|
|
361
|
+
...(0, import_lodash.omit)(rest, "value", "onChange", "style", "className"),
|
|
362
362
|
open: false
|
|
363
363
|
}
|
|
364
364
|
)
|
package/lib/Dialog/Anchor.d.ts
CHANGED
|
@@ -15,5 +15,5 @@ export declare class Anchor extends React.Component<IAnchorProps> {
|
|
|
15
15
|
onDragStart: (event: PointerEvent) => void;
|
|
16
16
|
onDragMove: (event: PointerEvent) => void;
|
|
17
17
|
onDragEnd: (event: PointerEvent) => void;
|
|
18
|
-
render(): import("@emotion/react/
|
|
18
|
+
render(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
19
19
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'react';
|
|
2
|
-
export declare const EventProxy: (props: HTMLAttributes<HTMLDivElement>) => import("@emotion/react/
|
|
2
|
+
export declare const EventProxy: (props: HTMLAttributes<HTMLDivElement>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -14,4 +14,4 @@ export interface DiffCellsProps {
|
|
|
14
14
|
onMouseDown?: React.MouseEventHandler;
|
|
15
15
|
hashId?: string;
|
|
16
16
|
}
|
|
17
|
-
export default function DiffCells({ diffPrefixCls, data, emptyText, width, lock, rowOffset, onMouseDown, hashId, }: DiffCellsProps): import("@emotion/react/
|
|
17
|
+
export default function DiffCells({ diffPrefixCls, data, emptyText, width, lock, rowOffset, onMouseDown, hashId, }: DiffCellsProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -15,4 +15,4 @@ export interface HighlightCellProps {
|
|
|
15
15
|
lineNumber?: boolean;
|
|
16
16
|
hashId?: string;
|
|
17
17
|
}
|
|
18
|
-
export default function HighlightCell({ prefixCls, theme, data, emptyText, width, lock, lineNumber, onMouseDown, hashId, }: HighlightCellProps): import("@emotion/react/
|
|
18
|
+
export default function HighlightCell({ prefixCls, theme, data, emptyText, width, lock, lineNumber, onMouseDown, hashId, }: HighlightCellProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -3,5 +3,5 @@ import './index.less';
|
|
|
3
3
|
export interface JsonViewProps extends HighlightProps {
|
|
4
4
|
json: object;
|
|
5
5
|
}
|
|
6
|
-
declare const _default: ({ json, theme, style, className, height, onCopyChange, copyable, }: JsonViewProps) => import("@emotion/react/
|
|
6
|
+
declare const _default: ({ json, theme, style, className, height, onCopyChange, copyable, }: JsonViewProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
7
7
|
export default _default;
|
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" | "
|
|
32
|
+
declare const supportedLanguages: ("ruby" | "go" | "css" | "java" | "json" | "bash" | "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/lib/IconFont/index.d.ts
CHANGED
|
@@ -8,5 +8,5 @@ export interface IconFontProps {
|
|
|
8
8
|
/**
|
|
9
9
|
* @deprecated Please use `@oceanbase/icons` instead.
|
|
10
10
|
*/
|
|
11
|
-
declare const IconFont: (props: IconFontProps) => import("@emotion/react/
|
|
11
|
+
declare const IconFont: (props: IconFontProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
12
12
|
export default IconFont;
|
package/lib/Login/LoginForm.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { FormProps } from '@oceanbase/design
|
|
1
|
+
import type { FormProps, InputProps } from '@oceanbase/design';
|
|
2
|
+
import type { PasswordProps } from '@oceanbase/design/es/input';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import type { LoginLocale } from '.';
|
|
4
5
|
import './index.less';
|
|
@@ -15,6 +16,12 @@ export interface ILoginFormProps extends FormProps {
|
|
|
15
16
|
authCodeImg?: string;
|
|
16
17
|
otherLoginProps?: any;
|
|
17
18
|
onAuthCodeImgChange?: () => void;
|
|
19
|
+
passwordOptional?: boolean;
|
|
20
|
+
componentProps?: {
|
|
21
|
+
username: InputProps;
|
|
22
|
+
password: PasswordProps;
|
|
23
|
+
authCode: InputProps;
|
|
24
|
+
};
|
|
18
25
|
}
|
|
19
26
|
declare const Login: React.FC<ILoginFormProps>;
|
|
20
27
|
export default Login;
|
package/lib/Login/LoginForm.js
CHANGED
|
@@ -49,6 +49,8 @@ var Login = ({
|
|
|
49
49
|
authCodeImg,
|
|
50
50
|
otherLoginProps,
|
|
51
51
|
onAuthCodeImgChange,
|
|
52
|
+
componentProps,
|
|
53
|
+
passwordOptional = false,
|
|
52
54
|
...restProps
|
|
53
55
|
}) => {
|
|
54
56
|
const { token } = import_design2.theme.useToken();
|
|
@@ -88,7 +90,8 @@ var Login = ({
|
|
|
88
90
|
},
|
|
89
91
|
className: (0, import_classnames.default)({
|
|
90
92
|
[`${prefix}-focus-input`]: focusInput === "username"
|
|
91
|
-
})
|
|
93
|
+
}),
|
|
94
|
+
...(componentProps == null ? void 0 : componentProps.username) || {}
|
|
92
95
|
}
|
|
93
96
|
)
|
|
94
97
|
),
|
|
@@ -96,7 +99,7 @@ var Login = ({
|
|
|
96
99
|
import_design.Form.Item,
|
|
97
100
|
{
|
|
98
101
|
name: "password",
|
|
99
|
-
rules: [
|
|
102
|
+
rules: passwordOptional ? [] : [
|
|
100
103
|
{
|
|
101
104
|
required: true,
|
|
102
105
|
message: locale.passwordMessage
|
|
@@ -116,7 +119,8 @@ var Login = ({
|
|
|
116
119
|
onBlur: () => {
|
|
117
120
|
setFocusInput("");
|
|
118
121
|
},
|
|
119
|
-
className: focusInput === "password" ? `${prefix}-focus-input` : ""
|
|
122
|
+
className: focusInput === "password" ? `${prefix}-focus-input` : "",
|
|
123
|
+
...(componentProps == null ? void 0 : componentProps.password) || {}
|
|
120
124
|
}
|
|
121
125
|
)
|
|
122
126
|
),
|
|
@@ -144,7 +148,8 @@ var Login = ({
|
|
|
144
148
|
},
|
|
145
149
|
className: (0, import_classnames.default)({
|
|
146
150
|
[`${prefix}-focus-input`]: focusInput === "authCode"
|
|
147
|
-
})
|
|
151
|
+
}),
|
|
152
|
+
...(componentProps == null ? void 0 : componentProps.authCode) || {}
|
|
148
153
|
}
|
|
149
154
|
)
|
|
150
155
|
), /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(`${prefix}-code-btn`) }, /* @__PURE__ */ import_react.default.createElement("img", { src: authCodeImg, alt: "", width: "96", height: "38" }), /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}-code-mask`, onClick: onAuthCodeImgChange }, /* @__PURE__ */ import_react.default.createElement(import_icons.SyncOutlined, null)))),
|
package/lib/Login/index.less
CHANGED
package/lib/NavMenu/index.d.ts
CHANGED
|
@@ -15,5 +15,5 @@ export interface NavMenuProps {
|
|
|
15
15
|
className?: string;
|
|
16
16
|
style?: React.CSSProperties;
|
|
17
17
|
}
|
|
18
|
-
declare const _default: (props: NavMenuProps) => import("@emotion/react/
|
|
18
|
+
declare const _default: (props: NavMenuProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
19
19
|
export default _default;
|
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;
|
|
@@ -13,5 +13,5 @@ export interface QuickPickerProps extends LocaleWrapperProps {
|
|
|
13
13
|
isMoment?: boolean;
|
|
14
14
|
size?: 'small' | 'large' | 'middle';
|
|
15
15
|
}
|
|
16
|
-
declare const _default: (props: QuickPickerProps) => import("@emotion/react/
|
|
16
|
+
declare const _default: (props: QuickPickerProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
17
17
|
export default _default;
|
package/lib/SideTip/Dragger.d.ts
CHANGED
|
@@ -41,6 +41,6 @@ declare class Draggable extends React.Component<DraggableProps, DraggableState>
|
|
|
41
41
|
handleMouseDown: (e: any) => void;
|
|
42
42
|
handleMouseMove: (e: any) => void;
|
|
43
43
|
handleMouseUp: (e: any) => void;
|
|
44
|
-
render(): import("@emotion/react/
|
|
44
|
+
render(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
45
45
|
}
|
|
46
46
|
export default Draggable;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const iconLoading: (props: any) => import("@emotion/react/
|
|
1
|
+
declare const iconLoading: (props: any) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
2
2
|
export default iconLoading;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oceanbase/ui",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.13",
|
|
4
4
|
"description": "The UI library based on OceanBase Design",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"oceanbase",
|
|
@@ -40,23 +40,23 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@ant-design/cssinjs": "^1.23.0",
|
|
43
|
-
"@ant-design/pro-components": "^2.8.
|
|
43
|
+
"@ant-design/pro-components": "^2.8.7",
|
|
44
44
|
"@antv/g6": "3.4.10",
|
|
45
|
-
"@oceanbase/design": "^0.4.
|
|
46
|
-
"@oceanbase/icons": "^0.4.
|
|
45
|
+
"@oceanbase/design": "^0.4.10",
|
|
46
|
+
"@oceanbase/icons": "^0.4.6",
|
|
47
47
|
"@oceanbase/util": "^0.4.2",
|
|
48
48
|
"ahooks": "^2.10.14",
|
|
49
49
|
"classnames": "^2.5.1",
|
|
50
50
|
"dayjs": "^1.11.13",
|
|
51
51
|
"diff": "^5.2.0",
|
|
52
|
-
"highlight.js": "^11.
|
|
52
|
+
"highlight.js": "^11.11.1",
|
|
53
53
|
"highlightjs-solidity": "^2.0.6",
|
|
54
54
|
"hoist-non-react-statics": "^3.3.2",
|
|
55
55
|
"lodash": "^4.17.21",
|
|
56
56
|
"moment": "^2.30.1",
|
|
57
57
|
"path-to-regexp": "^7.2.0",
|
|
58
58
|
"randexp": "^0.5.3",
|
|
59
|
-
"rc-picker": "^4.11.
|
|
59
|
+
"rc-picker": "^4.11.3",
|
|
60
60
|
"rc-util": "^5.44.4",
|
|
61
61
|
"react-copy-to-clipboard": "^5.1.0",
|
|
62
62
|
"react-json-view": "^1.21.3",
|
|
@@ -64,12 +64,12 @@
|
|
|
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.7",
|
|
68
|
+
"@ant-design/pro-layout": "^7.22.4"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"react": ">=16.9.0",
|
|
72
72
|
"react-dom": ">=16.9.0"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "84305961875cebaf02361d907dc1db3a1871d1f5"
|
|
75
75
|
}
|