@oceanbase/ui 0.4.6 → 0.4.7
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.d.ts +3 -2
- package/es/Action/Group.js +18 -12
- package/es/Action/Item.d.ts +1 -1
- package/es/Action/index.d.ts +2 -1
- package/es/Action/style/index.d.ts +9 -0
- package/es/Action/style/index.js +43 -0
- package/es/DateRanger/PickerPanel.d.ts +4 -6
- package/es/DateRanger/PickerPanel.js +42 -29
- package/es/DateRanger/Ranger.d.ts +4 -3
- package/es/DateRanger/Ranger.js +6 -4
- package/es/DateRanger/constant/index.d.ts +6 -2
- package/es/DateRanger/constant/index.js +35 -13
- package/es/DateRanger/index.d.ts +24 -1
- package/es/DateRanger/index.js +24 -23
- package/es/DateRanger/index.less +16 -1
- package/es/DateRanger/locale/en-US.js +7 -7
- package/es/Highlight/index.d.ts +1 -1
- package/es/ProCard/index.d.ts +5 -0
- package/es/ProCard/index.js +52 -0
- package/es/ProCard/style/index.d.ts +9 -0
- package/es/ProCard/style/index.js +40 -0
- package/es/TagSelect/style/index.d.ts +3 -2
- package/es/_util/genComponentStyleHook.js +1 -1
- package/es/index.d.ts +2 -0
- package/es/index.js +1 -0
- package/lib/Action/Group.d.ts +3 -2
- package/lib/Action/Group.js +56 -43
- package/lib/Action/Item.d.ts +1 -1
- package/lib/Action/index.d.ts +2 -1
- package/lib/Action/style/index.d.ts +9 -0
- package/lib/Action/style/index.js +78 -0
- package/lib/DateRanger/PickerPanel.d.ts +4 -6
- package/lib/DateRanger/PickerPanel.js +67 -29
- package/lib/DateRanger/Ranger.d.ts +4 -3
- package/lib/DateRanger/Ranger.js +4 -3
- package/lib/DateRanger/constant/index.d.ts +6 -2
- package/lib/DateRanger/constant/index.js +44 -12
- package/lib/DateRanger/index.d.ts +24 -1
- package/lib/DateRanger/index.js +23 -20
- package/lib/DateRanger/index.less +16 -1
- package/lib/DateRanger/locale/en-US.js +7 -7
- package/lib/Highlight/index.d.ts +1 -1
- package/lib/ProCard/index.d.ts +5 -0
- package/lib/ProCard/index.js +88 -0
- package/lib/ProCard/style/index.d.ts +9 -0
- package/lib/ProCard/style/index.js +92 -0
- package/lib/TagSelect/style/index.d.ts +3 -2
- package/lib/_util/genComponentStyleHook.js +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +3 -0
- package/package.json +9 -9
|
@@ -44,18 +44,19 @@ var import_lodash = require("lodash");
|
|
|
44
44
|
var import_moment2 = __toESM(require("moment"));
|
|
45
45
|
var import_dayjs2 = __toESM(require("dayjs"));
|
|
46
46
|
var import_util = require("../_util");
|
|
47
|
+
var import_constant = require("./constant");
|
|
48
|
+
var ALL_ERROR_TYPE_LIST = ["endDate", "startDate", "endTime", "startTime"];
|
|
47
49
|
var prefix = (0, import_util.getPrefix)("ranger-picker-panel");
|
|
48
50
|
var prefixCls = "ant-picker";
|
|
49
|
-
var DATE_FORMAT = "YYYY-MM-DD";
|
|
50
51
|
var TIME_FORMAT = "HH:mm:ss";
|
|
51
52
|
var InternalPickerPanel = (props) => {
|
|
52
53
|
const {
|
|
53
|
-
defaultValue
|
|
54
|
+
defaultValue,
|
|
54
55
|
isMoment,
|
|
55
56
|
locale,
|
|
56
57
|
tip,
|
|
57
58
|
rules,
|
|
58
|
-
|
|
59
|
+
required = true,
|
|
59
60
|
onOk = import_lodash.noop,
|
|
60
61
|
onCancel = import_lodash.noop,
|
|
61
62
|
disabledDate
|
|
@@ -66,6 +67,8 @@ var InternalPickerPanel = (props) => {
|
|
|
66
67
|
const [calendarValue, setCalendarValue] = import_react.default.useState(defaultValue);
|
|
67
68
|
const [internalHoverValues, setInternalHoverValues] = import_react.default.useState(null);
|
|
68
69
|
const [activeIndex, setActiveIndex] = import_react.default.useState(0);
|
|
70
|
+
const isEn = (locale == null ? void 0 : locale.antLocale) === "en";
|
|
71
|
+
const DATE_FORMAT = isEn ? import_constant.DATE_TIME_MONTH_FORMAT : import_constant.DATE_TIME_MONTH_FORMAT_CN;
|
|
69
72
|
const getDateInstance = (0, import_react.useCallback)(
|
|
70
73
|
(v, format, strict) => {
|
|
71
74
|
return isMoment ? (0, import_moment2.default)(v, format, strict) : (0, import_dayjs2.default)(v, format, strict);
|
|
@@ -210,7 +213,8 @@ var InternalPickerPanel = (props) => {
|
|
|
210
213
|
name: "startDate",
|
|
211
214
|
label: locale.startDate,
|
|
212
215
|
validateStatus: errorTypeMap["startDate"],
|
|
213
|
-
style: { marginBottom: 8 }
|
|
216
|
+
style: { marginBottom: 8 },
|
|
217
|
+
rules: [{ required: true }]
|
|
214
218
|
},
|
|
215
219
|
/* @__PURE__ */ import_react.default.createElement(
|
|
216
220
|
import_design.Input,
|
|
@@ -242,7 +246,8 @@ var InternalPickerPanel = (props) => {
|
|
|
242
246
|
label: locale.startTime,
|
|
243
247
|
style: { marginBottom: 8 },
|
|
244
248
|
validateStatus: errorTypeMap["startTime"],
|
|
245
|
-
initialValue: defaultS || defaultTime
|
|
249
|
+
initialValue: defaultS || defaultTime,
|
|
250
|
+
rules: [{ required: true }]
|
|
246
251
|
},
|
|
247
252
|
/* @__PURE__ */ import_react.default.createElement(
|
|
248
253
|
import_design.TimePicker,
|
|
@@ -272,7 +277,8 @@ var InternalPickerPanel = (props) => {
|
|
|
272
277
|
name: "endDate",
|
|
273
278
|
label: locale.endDate,
|
|
274
279
|
style: { marginBottom: 0 },
|
|
275
|
-
validateStatus: errorTypeMap["endDate"]
|
|
280
|
+
validateStatus: errorTypeMap["endDate"],
|
|
281
|
+
rules: [{ required: true }]
|
|
276
282
|
},
|
|
277
283
|
/* @__PURE__ */ import_react.default.createElement(
|
|
278
284
|
import_design.Input,
|
|
@@ -303,7 +309,8 @@ var InternalPickerPanel = (props) => {
|
|
|
303
309
|
label: locale.endTime,
|
|
304
310
|
style: { marginBottom: 0 },
|
|
305
311
|
validateStatus: errorTypeMap["endTime"],
|
|
306
|
-
initialValue: defaultE || defaultTime
|
|
312
|
+
initialValue: defaultE || defaultTime,
|
|
313
|
+
rules: [{ required: true }]
|
|
307
314
|
},
|
|
308
315
|
/* @__PURE__ */ import_react.default.createElement(
|
|
309
316
|
import_design.TimePicker,
|
|
@@ -366,30 +373,61 @@ var InternalPickerPanel = (props) => {
|
|
|
366
373
|
}
|
|
367
374
|
)
|
|
368
375
|
)
|
|
369
|
-
), /* @__PURE__ */ import_react.default.createElement(import_design.Divider, { style: { margin: "8px 0" } }), tip && !errorMessage && /* @__PURE__ */ import_react.default.createElement(import_design.Alert, { message: tip, type: "info", style: { marginBottom: 8 }, showIcon: true }), errorMessage && /* @__PURE__ */ import_react.default.createElement(import_design.Alert, { message: errorMessage, type: "error", style: { marginBottom: 8 }, showIcon: true }), /* @__PURE__ */ import_react.default.createElement(
|
|
370
|
-
import_design.
|
|
371
|
-
{
|
|
372
|
-
size: "small",
|
|
373
|
-
onClick: () => {
|
|
374
|
-
onCancel();
|
|
375
|
-
}
|
|
376
|
-
},
|
|
377
|
-
locale.cancel
|
|
378
|
-
), /* @__PURE__ */ import_react.default.createElement(
|
|
379
|
-
import_design.Button,
|
|
376
|
+
), /* @__PURE__ */ import_react.default.createElement(import_design.Divider, { style: { margin: "8px 0" } }), tip && !errorMessage && /* @__PURE__ */ import_react.default.createElement(import_design.Alert, { message: tip, type: "info", style: { marginBottom: 8 }, showIcon: true }), errorMessage && /* @__PURE__ */ import_react.default.createElement(import_design.Alert, { message: errorMessage, type: "error", style: { marginBottom: 8 }, showIcon: true }), /* @__PURE__ */ import_react.default.createElement(
|
|
377
|
+
import_design.Space,
|
|
380
378
|
{
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
const { startDate, startTime, endDate, endTime } = values;
|
|
386
|
-
const start = `${startDate} ${startTime.format(TIME_FORMAT)}`;
|
|
387
|
-
const end = `${endDate} ${endTime.format(TIME_FORMAT)}`;
|
|
388
|
-
onOk([start, end]);
|
|
389
|
-
});
|
|
379
|
+
style: {
|
|
380
|
+
width: "100%",
|
|
381
|
+
justifyContent: "flex-end",
|
|
382
|
+
padding: "0 12px 4px 0"
|
|
390
383
|
}
|
|
391
384
|
},
|
|
392
|
-
|
|
393
|
-
|
|
385
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
386
|
+
import_design.Button,
|
|
387
|
+
{
|
|
388
|
+
size: "small",
|
|
389
|
+
onClick: () => {
|
|
390
|
+
onCancel();
|
|
391
|
+
}
|
|
392
|
+
},
|
|
393
|
+
locale.cancel
|
|
394
|
+
),
|
|
395
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
396
|
+
import_design.Button,
|
|
397
|
+
{
|
|
398
|
+
size: "small",
|
|
399
|
+
type: "primary",
|
|
400
|
+
onClick: () => {
|
|
401
|
+
form.validateFields().then((values) => {
|
|
402
|
+
const { startDate, startTime, endDate, endTime } = values;
|
|
403
|
+
const start = `${startDate} ${startTime.format(TIME_FORMAT)}`;
|
|
404
|
+
const end = `${endDate} ${endTime.format(TIME_FORMAT)}`;
|
|
405
|
+
let errorList = [];
|
|
406
|
+
let message = "";
|
|
407
|
+
rules == null ? void 0 : rules.some((item) => {
|
|
408
|
+
if (typeof (item == null ? void 0 : item.validator) === "function") {
|
|
409
|
+
const errorType = item.validator([start, end]);
|
|
410
|
+
if (errorType) {
|
|
411
|
+
errorList = Array.isArray(errorType) ? errorType : [errorType];
|
|
412
|
+
message = item.message;
|
|
413
|
+
return true;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
return false;
|
|
417
|
+
});
|
|
418
|
+
if (errorList.length > 0) {
|
|
419
|
+
setErrorTypeList(errorList.includes("all") ? ALL_ERROR_TYPE_LIST : errorList);
|
|
420
|
+
setErrorMessage(message);
|
|
421
|
+
} else {
|
|
422
|
+
setErrorMessage("");
|
|
423
|
+
setErrorTypeList([]);
|
|
424
|
+
onOk([start, end]);
|
|
425
|
+
}
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
},
|
|
429
|
+
locale.confirm
|
|
430
|
+
)
|
|
431
|
+
));
|
|
394
432
|
};
|
|
395
433
|
var PickerPanel_default = InternalPickerPanel;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { TooltipProps } from '@oceanbase/design';
|
|
2
3
|
import type { RangePickerProps } from '@oceanbase/design/es/date-picker';
|
|
3
4
|
import type { Dayjs } from 'dayjs';
|
|
@@ -6,7 +7,7 @@ import type { RangeOption } from './typing';
|
|
|
6
7
|
import type { Rule } from './PickerPanel';
|
|
7
8
|
import './index.less';
|
|
8
9
|
export type RangeName = 'customize' | string;
|
|
9
|
-
export type RangeValue = [Moment, Moment] | [Dayjs, Dayjs];
|
|
10
|
+
export type RangeValue = [Moment, Moment] | [Dayjs, Dayjs] | [] | null;
|
|
10
11
|
export type RangeDateValue = {
|
|
11
12
|
name: RangeName;
|
|
12
13
|
range: RangeValue;
|
|
@@ -34,7 +35,7 @@ export interface DateRangerProps extends Omit<RangePickerProps, 'mode' | 'picker
|
|
|
34
35
|
defaultValue?: RangeValue;
|
|
35
36
|
size?: 'small' | 'large' | 'middle';
|
|
36
37
|
tooltipProps?: TooltipProps;
|
|
37
|
-
locale
|
|
38
|
+
locale?: any;
|
|
38
39
|
}
|
|
39
|
-
declare const _default:
|
|
40
|
+
declare const _default: React.ForwardRefExoticComponent<DateRangerProps & React.RefAttributes<unknown>>;
|
|
40
41
|
export default _default;
|
package/lib/DateRanger/Ranger.js
CHANGED
|
@@ -257,7 +257,7 @@ var Ranger = import_react.default.forwardRef((props, ref) => {
|
|
|
257
257
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}-dropdown-picker` }, originNode, /* @__PURE__ */ import_react.default.createElement(import_design.Divider, { type: "vertical", style: { height: "auto", margin: "0px 4px 0px 0px" } }), /* @__PURE__ */ import_react.default.createElement(
|
|
258
258
|
import_PickerPanel.default,
|
|
259
259
|
{
|
|
260
|
-
defaultValue: innerValue,
|
|
260
|
+
defaultValue: innerValue || [],
|
|
261
261
|
locale,
|
|
262
262
|
disabledDate: pastOnly ? disabledFuture : disabledDate,
|
|
263
263
|
tip,
|
|
@@ -328,7 +328,7 @@ var Ranger = import_react.default.forwardRef((props, ref) => {
|
|
|
328
328
|
{
|
|
329
329
|
className: (0, import_classnames.default)(`${prefix}-picker`),
|
|
330
330
|
style: {
|
|
331
|
-
pointerEvents:
|
|
331
|
+
// pointerEvents: 'none',
|
|
332
332
|
border: 0
|
|
333
333
|
},
|
|
334
334
|
format: (v) => {
|
|
@@ -344,7 +344,8 @@ var Ranger = import_react.default.forwardRef((props, ref) => {
|
|
|
344
344
|
allowClear: false,
|
|
345
345
|
size,
|
|
346
346
|
suffixIcon: null,
|
|
347
|
-
...(0, import_lodash.omit)(rest, "value", "onChange")
|
|
347
|
+
...(0, import_lodash.omit)(rest, "value", "onChange"),
|
|
348
|
+
open: false
|
|
348
349
|
}
|
|
349
350
|
)
|
|
350
351
|
)
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { RangeOption } from '../typing';
|
|
2
2
|
export declare const CUSTOMIZE = "customize";
|
|
3
|
-
export declare const YEAR_DATE_TIME_SECOND_FORMAT = "
|
|
4
|
-
export declare const YEAR_DATE_TIME_FORMAT = "
|
|
3
|
+
export declare const YEAR_DATE_TIME_SECOND_FORMAT = "MM/DD/YYYY HH:mm:ss";
|
|
4
|
+
export declare const YEAR_DATE_TIME_FORMAT = "MM/DD/YYYY HH:mm";
|
|
5
5
|
export declare const DATE_TIME_SECOND_FORMAT = "MM/DD HH:mm:ss";
|
|
6
6
|
export declare const DATE_TIME_FORMAT = "MM/DD HH:mm";
|
|
7
|
+
export declare const DATE_TIME_MONTH_FORMAT = "MM/DD/YYYY";
|
|
7
8
|
export declare const YEAR_DATE_TIME_SECOND_FORMAT_CN = "YYYY-MM-DD HH:mm:ss";
|
|
8
9
|
export declare const YEAR_DATE_TIME_FORMAT_CN = "YYYY-MM-DD HH:mm";
|
|
10
|
+
export declare const DATE_TIME_MONTH_FORMAT_CN = "YYYY-MM-DD";
|
|
9
11
|
export declare const DATE_TIME_SECOND_FORMAT_CN = "MM-DD HH:mm:ss";
|
|
10
12
|
export declare const DATE_TIME_FORMAT_CN = "MM-DD HH:mm";
|
|
11
13
|
export declare const NEAR_1_MINUTES: RangeOption;
|
|
@@ -17,8 +19,10 @@ export declare const NEAR_1_HOURS: RangeOption;
|
|
|
17
19
|
export declare const NEAR_2_HOURS: RangeOption;
|
|
18
20
|
export declare const NEAR_3_HOURS: RangeOption;
|
|
19
21
|
export declare const NEAR_6_HOURS: RangeOption;
|
|
22
|
+
export declare const NEAR_12_HOURS: RangeOption;
|
|
20
23
|
export declare const TODAY: RangeOption;
|
|
21
24
|
export declare const YESTERDAY: RangeOption;
|
|
25
|
+
export declare const LAST_1_DAY: RangeOption;
|
|
22
26
|
export declare const LAST_3_DAYS: RangeOption;
|
|
23
27
|
export declare const THIS_WEEK: RangeOption;
|
|
24
28
|
export declare const LAST_WEEK: RangeOption;
|
|
@@ -32,13 +32,17 @@ __export(constant_exports, {
|
|
|
32
32
|
CUSTOMIZE: () => CUSTOMIZE,
|
|
33
33
|
DATE_TIME_FORMAT: () => DATE_TIME_FORMAT,
|
|
34
34
|
DATE_TIME_FORMAT_CN: () => DATE_TIME_FORMAT_CN,
|
|
35
|
+
DATE_TIME_MONTH_FORMAT: () => DATE_TIME_MONTH_FORMAT,
|
|
36
|
+
DATE_TIME_MONTH_FORMAT_CN: () => DATE_TIME_MONTH_FORMAT_CN,
|
|
35
37
|
DATE_TIME_SECOND_FORMAT: () => DATE_TIME_SECOND_FORMAT,
|
|
36
38
|
DATE_TIME_SECOND_FORMAT_CN: () => DATE_TIME_SECOND_FORMAT_CN,
|
|
39
|
+
LAST_1_DAY: () => LAST_1_DAY,
|
|
37
40
|
LAST_3_DAYS: () => LAST_3_DAYS,
|
|
38
41
|
LAST_MONTH: () => LAST_MONTH,
|
|
39
42
|
LAST_WEEK: () => LAST_WEEK,
|
|
40
43
|
LAST_YEAR: () => LAST_YEAR,
|
|
41
44
|
NEAR_10_MINUTES: () => NEAR_10_MINUTES,
|
|
45
|
+
NEAR_12_HOURS: () => NEAR_12_HOURS,
|
|
42
46
|
NEAR_1_HOURS: () => NEAR_1_HOURS,
|
|
43
47
|
NEAR_1_MINUTES: () => NEAR_1_MINUTES,
|
|
44
48
|
NEAR_20_MINUTES: () => NEAR_20_MINUTES,
|
|
@@ -69,17 +73,19 @@ var DAY_UNIT = "day";
|
|
|
69
73
|
var WEEK_UNIT = "week";
|
|
70
74
|
var MONTH_UNIT = "month";
|
|
71
75
|
var YEAR_UNIT = "year";
|
|
72
|
-
var YEAR_DATE_TIME_SECOND_FORMAT = "
|
|
73
|
-
var YEAR_DATE_TIME_FORMAT = "
|
|
76
|
+
var YEAR_DATE_TIME_SECOND_FORMAT = "MM/DD/YYYY HH:mm:ss";
|
|
77
|
+
var YEAR_DATE_TIME_FORMAT = "MM/DD/YYYY HH:mm";
|
|
74
78
|
var DATE_TIME_SECOND_FORMAT = "MM/DD HH:mm:ss";
|
|
75
79
|
var DATE_TIME_FORMAT = "MM/DD HH:mm";
|
|
80
|
+
var DATE_TIME_MONTH_FORMAT = "MM/DD/YYYY";
|
|
76
81
|
var YEAR_DATE_TIME_SECOND_FORMAT_CN = "YYYY-MM-DD HH:mm:ss";
|
|
77
82
|
var YEAR_DATE_TIME_FORMAT_CN = "YYYY-MM-DD HH:mm";
|
|
83
|
+
var DATE_TIME_MONTH_FORMAT_CN = "YYYY-MM-DD";
|
|
78
84
|
var DATE_TIME_SECOND_FORMAT_CN = "MM-DD HH:mm:ss";
|
|
79
85
|
var DATE_TIME_FORMAT_CN = "MM-DD HH:mm";
|
|
80
86
|
var NEAR_1_MINUTES = {
|
|
81
87
|
label: "近 1 分钟",
|
|
82
|
-
enLabel: "
|
|
88
|
+
enLabel: "Last 1 Minute",
|
|
83
89
|
rangeLabel: "1m",
|
|
84
90
|
name: "NEAR_1_MINUTES",
|
|
85
91
|
range: (current = (0, import_moment.default)()) => [
|
|
@@ -89,7 +95,7 @@ var NEAR_1_MINUTES = {
|
|
|
89
95
|
};
|
|
90
96
|
var NEAR_5_MINUTES = {
|
|
91
97
|
label: "近 5 分钟",
|
|
92
|
-
enLabel: "
|
|
98
|
+
enLabel: "Last 5 Minutes",
|
|
93
99
|
rangeLabel: "5m",
|
|
94
100
|
name: "NEAR_5_MINUTES",
|
|
95
101
|
range: (current = (0, import_moment.default)()) => [
|
|
@@ -99,7 +105,7 @@ var NEAR_5_MINUTES = {
|
|
|
99
105
|
};
|
|
100
106
|
var NEAR_10_MINUTES = {
|
|
101
107
|
label: "近 10 分钟",
|
|
102
|
-
enLabel: "
|
|
108
|
+
enLabel: "Last 10 Minutes",
|
|
103
109
|
rangeLabel: "10m",
|
|
104
110
|
name: "NEAR_10_MINUTES",
|
|
105
111
|
range: (current = (0, import_moment.default)()) => [
|
|
@@ -109,7 +115,7 @@ var NEAR_10_MINUTES = {
|
|
|
109
115
|
};
|
|
110
116
|
var NEAR_20_MINUTES = {
|
|
111
117
|
label: "近 20 分钟",
|
|
112
|
-
enLabel: "
|
|
118
|
+
enLabel: "Last 20 Minutes",
|
|
113
119
|
rangeLabel: "20m",
|
|
114
120
|
name: "NEAR_20_MINUTES",
|
|
115
121
|
range: (current = (0, import_moment.default)()) => [
|
|
@@ -119,7 +125,7 @@ var NEAR_20_MINUTES = {
|
|
|
119
125
|
};
|
|
120
126
|
var NEAR_30_MINUTES = {
|
|
121
127
|
label: "近 30 分钟",
|
|
122
|
-
enLabel: "
|
|
128
|
+
enLabel: "Last 30 Minutes",
|
|
123
129
|
rangeLabel: "30m",
|
|
124
130
|
name: "NEAR_30_MINUTES",
|
|
125
131
|
range: (current = (0, import_moment.default)()) => [
|
|
@@ -129,7 +135,7 @@ var NEAR_30_MINUTES = {
|
|
|
129
135
|
};
|
|
130
136
|
var NEAR_1_HOURS = {
|
|
131
137
|
label: "近 1 小时",
|
|
132
|
-
enLabel: "
|
|
138
|
+
enLabel: "Last 1 Hour",
|
|
133
139
|
rangeLabel: "1h",
|
|
134
140
|
name: "NEAR_1_HOURS",
|
|
135
141
|
range: (current = (0, import_moment.default)()) => [
|
|
@@ -139,7 +145,7 @@ var NEAR_1_HOURS = {
|
|
|
139
145
|
};
|
|
140
146
|
var NEAR_2_HOURS = {
|
|
141
147
|
label: "近 2 小时",
|
|
142
|
-
enLabel: "
|
|
148
|
+
enLabel: "Last 2 Hours",
|
|
143
149
|
rangeLabel: "2h",
|
|
144
150
|
name: "NEAR_2_HOURS",
|
|
145
151
|
range: (current = (0, import_moment.default)()) => [
|
|
@@ -149,7 +155,7 @@ var NEAR_2_HOURS = {
|
|
|
149
155
|
};
|
|
150
156
|
var NEAR_3_HOURS = {
|
|
151
157
|
label: "近 3 小时",
|
|
152
|
-
enLabel: "
|
|
158
|
+
enLabel: "Last 3 Hours",
|
|
153
159
|
rangeLabel: "3h",
|
|
154
160
|
name: "NEAR_3_HOURS",
|
|
155
161
|
range: (current = (0, import_moment.default)()) => [
|
|
@@ -159,7 +165,7 @@ var NEAR_3_HOURS = {
|
|
|
159
165
|
};
|
|
160
166
|
var NEAR_6_HOURS = {
|
|
161
167
|
label: "近 6 小时",
|
|
162
|
-
enLabel: "
|
|
168
|
+
enLabel: "Last 6 Hours",
|
|
163
169
|
rangeLabel: "6h",
|
|
164
170
|
name: "NEAR_6_HOURS",
|
|
165
171
|
range: (current = (0, import_moment.default)()) => [
|
|
@@ -167,6 +173,16 @@ var NEAR_6_HOURS = {
|
|
|
167
173
|
current.clone()
|
|
168
174
|
]
|
|
169
175
|
};
|
|
176
|
+
var NEAR_12_HOURS = {
|
|
177
|
+
label: "近 12 小时",
|
|
178
|
+
enLabel: "Last 12 Hours",
|
|
179
|
+
rangeLabel: "12h",
|
|
180
|
+
name: "NEAR_12_HOURS",
|
|
181
|
+
range: (current = (0, import_moment.default)()) => [
|
|
182
|
+
current.clone().subtract(12, "hour"),
|
|
183
|
+
current.clone()
|
|
184
|
+
]
|
|
185
|
+
};
|
|
170
186
|
var TODAY = {
|
|
171
187
|
label: "今天",
|
|
172
188
|
enLabel: "Today",
|
|
@@ -187,9 +203,19 @@ var YESTERDAY = {
|
|
|
187
203
|
current.clone().endOf(DAY_UNIT).add(-1, DAY_UNIT)
|
|
188
204
|
]
|
|
189
205
|
};
|
|
206
|
+
var LAST_1_DAY = {
|
|
207
|
+
label: "近 1 天",
|
|
208
|
+
enLabel: "Last 1 Day",
|
|
209
|
+
rangeLabel: "1d",
|
|
210
|
+
name: "LAST_1_DAY",
|
|
211
|
+
range: (current = (0, import_moment.default)()) => [
|
|
212
|
+
current.clone().subtract(1, "days"),
|
|
213
|
+
current.clone()
|
|
214
|
+
]
|
|
215
|
+
};
|
|
190
216
|
var LAST_3_DAYS = {
|
|
191
217
|
label: "近 3 天",
|
|
192
|
-
enLabel: "
|
|
218
|
+
enLabel: "Last 3 Days",
|
|
193
219
|
rangeLabel: "3d",
|
|
194
220
|
name: "LAST_3_DAYS",
|
|
195
221
|
range: (current = (0, import_moment.default)()) => [
|
|
@@ -277,6 +303,8 @@ var NEAR_TIME_LIST = [
|
|
|
277
303
|
NEAR_2_HOURS,
|
|
278
304
|
NEAR_3_HOURS,
|
|
279
305
|
NEAR_6_HOURS,
|
|
306
|
+
NEAR_12_HOURS,
|
|
307
|
+
LAST_1_DAY,
|
|
280
308
|
LAST_3_DAYS,
|
|
281
309
|
TODAY,
|
|
282
310
|
YESTERDAY,
|
|
@@ -293,13 +321,17 @@ var NEAR_TIME_LIST = [
|
|
|
293
321
|
CUSTOMIZE,
|
|
294
322
|
DATE_TIME_FORMAT,
|
|
295
323
|
DATE_TIME_FORMAT_CN,
|
|
324
|
+
DATE_TIME_MONTH_FORMAT,
|
|
325
|
+
DATE_TIME_MONTH_FORMAT_CN,
|
|
296
326
|
DATE_TIME_SECOND_FORMAT,
|
|
297
327
|
DATE_TIME_SECOND_FORMAT_CN,
|
|
328
|
+
LAST_1_DAY,
|
|
298
329
|
LAST_3_DAYS,
|
|
299
330
|
LAST_MONTH,
|
|
300
331
|
LAST_WEEK,
|
|
301
332
|
LAST_YEAR,
|
|
302
333
|
NEAR_10_MINUTES,
|
|
334
|
+
NEAR_12_HOURS,
|
|
303
335
|
NEAR_1_HOURS,
|
|
304
336
|
NEAR_1_MINUTES,
|
|
305
337
|
NEAR_20_MINUTES,
|
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export * from './Ranger';
|
|
2
|
-
declare const DateRanger:
|
|
3
|
+
declare const DateRanger: import("react").ForwardRefExoticComponent<import("./Ranger").DateRangerProps & import("react").RefAttributes<unknown>> & {
|
|
4
|
+
NEAR_1_MINUTES: import("./typing").RangeOption;
|
|
5
|
+
NEAR_5_MINUTES: import("./typing").RangeOption;
|
|
6
|
+
NEAR_10_MINUTES: import("./typing").RangeOption;
|
|
7
|
+
NEAR_20_MINUTES: import("./typing").RangeOption;
|
|
8
|
+
NEAR_30_MINUTES: import("./typing").RangeOption;
|
|
9
|
+
NEAR_1_HOURS: import("./typing").RangeOption;
|
|
10
|
+
NEAR_2_HOURS: import("./typing").RangeOption;
|
|
11
|
+
NEAR_3_HOURS: import("./typing").RangeOption;
|
|
12
|
+
NEAR_6_HOURS: import("./typing").RangeOption;
|
|
13
|
+
NEAR_12_HOURS: import("./typing").RangeOption;
|
|
14
|
+
TODAY: import("./typing").RangeOption;
|
|
15
|
+
LAST_1_DAY: import("./typing").RangeOption;
|
|
16
|
+
LAST_3_DAYS: import("./typing").RangeOption;
|
|
17
|
+
YESTERDAY: import("./typing").RangeOption;
|
|
18
|
+
THIS_WEEK: import("./typing").RangeOption;
|
|
19
|
+
LAST_WEEK: import("./typing").RangeOption;
|
|
20
|
+
THIS_MONTH: import("./typing").RangeOption;
|
|
21
|
+
LAST_MONTH: import("./typing").RangeOption;
|
|
22
|
+
THIS_YEAR: import("./typing").RangeOption;
|
|
23
|
+
LAST_YEAR: import("./typing").RangeOption;
|
|
24
|
+
NEXT_YEAR: import("./typing").RangeOption;
|
|
25
|
+
};
|
|
3
26
|
export default DateRanger;
|
package/lib/DateRanger/index.js
CHANGED
|
@@ -36,26 +36,29 @@ module.exports = __toCommonJS(DateRanger_exports);
|
|
|
36
36
|
var import_constant = require("./constant");
|
|
37
37
|
var import_Ranger = __toESM(require("./Ranger"));
|
|
38
38
|
__reExport(DateRanger_exports, require("./Ranger"), module.exports);
|
|
39
|
-
var DateRanger = import_Ranger.default
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
39
|
+
var DateRanger = Object.assign(import_Ranger.default, {
|
|
40
|
+
NEAR_1_MINUTES: import_constant.NEAR_1_MINUTES,
|
|
41
|
+
NEAR_5_MINUTES: import_constant.NEAR_5_MINUTES,
|
|
42
|
+
NEAR_10_MINUTES: import_constant.NEAR_10_MINUTES,
|
|
43
|
+
NEAR_20_MINUTES: import_constant.NEAR_20_MINUTES,
|
|
44
|
+
NEAR_30_MINUTES: import_constant.NEAR_30_MINUTES,
|
|
45
|
+
NEAR_1_HOURS: import_constant.NEAR_1_HOURS,
|
|
46
|
+
NEAR_2_HOURS: import_constant.NEAR_2_HOURS,
|
|
47
|
+
NEAR_3_HOURS: import_constant.NEAR_3_HOURS,
|
|
48
|
+
NEAR_6_HOURS: import_constant.NEAR_6_HOURS,
|
|
49
|
+
NEAR_12_HOURS: import_constant.NEAR_12_HOURS,
|
|
50
|
+
TODAY: import_constant.TODAY,
|
|
51
|
+
LAST_1_DAY: import_constant.LAST_1_DAY,
|
|
52
|
+
LAST_3_DAYS: import_constant.LAST_3_DAYS,
|
|
53
|
+
YESTERDAY: import_constant.YESTERDAY,
|
|
54
|
+
THIS_WEEK: import_constant.THIS_WEEK,
|
|
55
|
+
LAST_WEEK: import_constant.LAST_WEEK,
|
|
56
|
+
THIS_MONTH: import_constant.THIS_MONTH,
|
|
57
|
+
LAST_MONTH: import_constant.LAST_MONTH,
|
|
58
|
+
THIS_YEAR: import_constant.THIS_YEAR,
|
|
59
|
+
LAST_YEAR: import_constant.LAST_YEAR,
|
|
60
|
+
NEXT_YEAR: import_constant.NEXT_YEAR
|
|
61
|
+
});
|
|
59
62
|
var DateRanger_default = DateRanger;
|
|
60
63
|
// Annotate the CommonJS export names for ESM import in node:
|
|
61
64
|
0 && (module.exports = {
|
|
@@ -14,11 +14,23 @@
|
|
|
14
14
|
// FIXED: 存在不生效情况
|
|
15
15
|
.@{prefix}-picker {
|
|
16
16
|
padding-left: 0px;
|
|
17
|
+
padding-right: 16px;
|
|
17
18
|
border: 0px;
|
|
18
|
-
|
|
19
|
+
&:focus,
|
|
20
|
+
&:focus-within {
|
|
21
|
+
box-shadow: none;
|
|
22
|
+
}
|
|
19
23
|
input {
|
|
20
24
|
text-align: center;
|
|
21
25
|
}
|
|
26
|
+
// 覆盖默认 antd 样式,定制出 RangerPicker 整体的感觉
|
|
27
|
+
.@{prefixCls}-picker-active-bar {
|
|
28
|
+
height: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.@{prefixCls}-picker-input > input {
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
}
|
|
22
34
|
}
|
|
23
35
|
|
|
24
36
|
&:hover {
|
|
@@ -99,6 +111,9 @@
|
|
|
99
111
|
}
|
|
100
112
|
|
|
101
113
|
.@{prefix}-playback-control {
|
|
114
|
+
display: flex;
|
|
115
|
+
flex-wrap: nowrap;
|
|
116
|
+
|
|
102
117
|
.@{prefixCls}-radio-button-wrapper {
|
|
103
118
|
padding-inline: 8px;
|
|
104
119
|
color: @colorTextSecondary;
|
|
@@ -36,13 +36,13 @@ var import_en_US = __toESM(require("rc-picker/es/locale/en_US"));
|
|
|
36
36
|
var en_US_default = {
|
|
37
37
|
customize: "Custom",
|
|
38
38
|
customTime: "Custom Time",
|
|
39
|
-
startDate: "Start
|
|
40
|
-
startTime: "Start
|
|
41
|
-
endDate: "End
|
|
42
|
-
endTime: "End
|
|
43
|
-
cancel: "
|
|
44
|
-
confirm: "
|
|
45
|
-
current: "
|
|
39
|
+
startDate: "Start Date",
|
|
40
|
+
startTime: "Start Time",
|
|
41
|
+
endDate: "End Date",
|
|
42
|
+
endTime: "End Time",
|
|
43
|
+
cancel: "Cancel",
|
|
44
|
+
confirm: "Confirm",
|
|
45
|
+
current: "Current",
|
|
46
46
|
jumpBack: "Previous Interval",
|
|
47
47
|
jumpForward: "Next Interval",
|
|
48
48
|
...import_en_US.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" | "css" | "go" | "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
|
/**
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/ProCard/index.tsx
|
|
30
|
+
var ProCard_exports = {};
|
|
31
|
+
__export(ProCard_exports, {
|
|
32
|
+
default: () => ProCard_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(ProCard_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_pro_components = require("@ant-design/pro-components");
|
|
37
|
+
var import_design = require("@oceanbase/design");
|
|
38
|
+
var import_classnames = __toESM(require("classnames"));
|
|
39
|
+
var import_style = __toESM(require("./style"));
|
|
40
|
+
var ProCard = ({
|
|
41
|
+
title,
|
|
42
|
+
tabs,
|
|
43
|
+
headerBordered,
|
|
44
|
+
bodyStyle,
|
|
45
|
+
prefixCls: customizePrefixCls,
|
|
46
|
+
className,
|
|
47
|
+
...restProps
|
|
48
|
+
}) => {
|
|
49
|
+
const { getPrefixCls } = (0, import_react.useContext)(import_design.ConfigProvider.ConfigContext);
|
|
50
|
+
const prefixCls = getPrefixCls("pro-card", customizePrefixCls);
|
|
51
|
+
const { wrapSSR } = (0, import_style.default)(prefixCls);
|
|
52
|
+
const zeroPaddingList = [0, "0", "0px"];
|
|
53
|
+
const noBodyPadding = zeroPaddingList.includes(bodyStyle == null ? void 0 : bodyStyle.padding);
|
|
54
|
+
const proCardCls = (0, import_classnames.default)(
|
|
55
|
+
{
|
|
56
|
+
[`${prefixCls}-has-title`]: !!title,
|
|
57
|
+
[`${prefixCls}-no-body-padding`]: noBodyPadding,
|
|
58
|
+
[`${prefixCls}-no-divider`]: !headerBordered,
|
|
59
|
+
[`${prefixCls}-contain-tabs`]: !!tabs
|
|
60
|
+
},
|
|
61
|
+
className
|
|
62
|
+
);
|
|
63
|
+
return wrapSSR(
|
|
64
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
65
|
+
import_pro_components.ProCard,
|
|
66
|
+
{
|
|
67
|
+
prefixCls: customizePrefixCls,
|
|
68
|
+
title,
|
|
69
|
+
tabs: typeof tabs === "object" ? {
|
|
70
|
+
size: "large",
|
|
71
|
+
...tabs
|
|
72
|
+
} : tabs,
|
|
73
|
+
headerBordered,
|
|
74
|
+
bodyStyle,
|
|
75
|
+
className: proCardCls,
|
|
76
|
+
...restProps
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
);
|
|
80
|
+
};
|
|
81
|
+
if (process.env.NODE_ENV !== "production") {
|
|
82
|
+
ProCard.displayName = import_pro_components.ProCard.displayName;
|
|
83
|
+
}
|
|
84
|
+
ProCard.isProCard = import_pro_components.ProCard.isProCard;
|
|
85
|
+
ProCard.Divider = import_pro_components.ProCard.Divider;
|
|
86
|
+
ProCard.TabPane = import_pro_components.ProCard.TabPane;
|
|
87
|
+
ProCard.Group = import_pro_components.ProCard.Group;
|
|
88
|
+
var ProCard_default = ProCard;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { GenerateStyle } from '@oceanbase/design/es/theme';
|
|
3
|
+
import type { OBToken } from '../../_util/genComponentStyleHook';
|
|
4
|
+
export declare const genProCardStyle: GenerateStyle<OBToken>;
|
|
5
|
+
declare const _default: (prefixCls: string) => {
|
|
6
|
+
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").JSX.Element;
|
|
7
|
+
hashId: string;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|