@oceanbase/ui 0.4.5 → 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.
Files changed (57) hide show
  1. package/dist/ui.min.css +1 -1
  2. package/dist/ui.min.js +1 -1
  3. package/es/Action/Group.d.ts +4 -3
  4. package/es/Action/Group.js +30 -16
  5. package/es/Action/Item.d.ts +1 -1
  6. package/es/Action/index.d.ts +2 -1
  7. package/es/Action/style/index.d.ts +9 -0
  8. package/es/Action/style/index.js +43 -0
  9. package/es/DateRanger/PickerPanel.d.ts +4 -6
  10. package/es/DateRanger/PickerPanel.js +42 -29
  11. package/es/DateRanger/Ranger.d.ts +4 -3
  12. package/es/DateRanger/Ranger.js +20 -26
  13. package/es/DateRanger/constant/index.d.ts +6 -2
  14. package/es/DateRanger/constant/index.js +44 -3
  15. package/es/DateRanger/index.d.ts +24 -1
  16. package/es/DateRanger/index.js +24 -23
  17. package/es/DateRanger/index.less +16 -1
  18. package/es/DateRanger/locale/en-US.js +7 -7
  19. package/es/DateRanger/typing.d.ts +4 -0
  20. package/es/Highlight/index.d.ts +1 -1
  21. package/es/ProCard/index.d.ts +5 -0
  22. package/es/ProCard/index.js +52 -0
  23. package/es/ProCard/style/index.d.ts +9 -0
  24. package/es/ProCard/style/index.js +40 -0
  25. package/es/TagSelect/style/index.d.ts +3 -2
  26. package/es/_util/genComponentStyleHook.js +1 -1
  27. package/es/index.d.ts +2 -0
  28. package/es/index.js +1 -0
  29. package/es/locale/LocaleWrapper.js +4 -1
  30. package/lib/Action/Group.d.ts +4 -3
  31. package/lib/Action/Group.js +64 -46
  32. package/lib/Action/Item.d.ts +1 -1
  33. package/lib/Action/index.d.ts +2 -1
  34. package/lib/Action/style/index.d.ts +9 -0
  35. package/lib/Action/style/index.js +78 -0
  36. package/lib/DateRanger/PickerPanel.d.ts +4 -6
  37. package/lib/DateRanger/PickerPanel.js +67 -29
  38. package/lib/DateRanger/Ranger.d.ts +4 -3
  39. package/lib/DateRanger/Ranger.js +17 -17
  40. package/lib/DateRanger/constant/index.d.ts +6 -2
  41. package/lib/DateRanger/constant/index.js +55 -2
  42. package/lib/DateRanger/index.d.ts +24 -1
  43. package/lib/DateRanger/index.js +23 -20
  44. package/lib/DateRanger/index.less +16 -1
  45. package/lib/DateRanger/locale/en-US.js +7 -7
  46. package/lib/DateRanger/typing.d.ts +4 -0
  47. package/lib/Highlight/index.d.ts +1 -1
  48. package/lib/ProCard/index.d.ts +5 -0
  49. package/lib/ProCard/index.js +88 -0
  50. package/lib/ProCard/style/index.d.ts +9 -0
  51. package/lib/ProCard/style/index.js +92 -0
  52. package/lib/TagSelect/style/index.d.ts +3 -2
  53. package/lib/_util/genComponentStyleHook.js +1 -1
  54. package/lib/index.d.ts +2 -0
  55. package/lib/index.js +3 -0
  56. package/lib/locale/LocaleWrapper.js +3 -1
  57. package/package.json +9 -9
@@ -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,16 +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 = "YYYY/MM/DD HH:mm:ss";
73
- var YEAR_DATE_TIME_FORMAT = "YYYY/MM/DD HH:mm";
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 分钟",
88
+ enLabel: "Last 1 Minute",
82
89
  rangeLabel: "1m",
83
90
  name: "NEAR_1_MINUTES",
84
91
  range: (current = (0, import_moment.default)()) => [
@@ -88,6 +95,7 @@ var NEAR_1_MINUTES = {
88
95
  };
89
96
  var NEAR_5_MINUTES = {
90
97
  label: "近 5 分钟",
98
+ enLabel: "Last 5 Minutes",
91
99
  rangeLabel: "5m",
92
100
  name: "NEAR_5_MINUTES",
93
101
  range: (current = (0, import_moment.default)()) => [
@@ -97,6 +105,7 @@ var NEAR_5_MINUTES = {
97
105
  };
98
106
  var NEAR_10_MINUTES = {
99
107
  label: "近 10 分钟",
108
+ enLabel: "Last 10 Minutes",
100
109
  rangeLabel: "10m",
101
110
  name: "NEAR_10_MINUTES",
102
111
  range: (current = (0, import_moment.default)()) => [
@@ -106,6 +115,7 @@ var NEAR_10_MINUTES = {
106
115
  };
107
116
  var NEAR_20_MINUTES = {
108
117
  label: "近 20 分钟",
118
+ enLabel: "Last 20 Minutes",
109
119
  rangeLabel: "20m",
110
120
  name: "NEAR_20_MINUTES",
111
121
  range: (current = (0, import_moment.default)()) => [
@@ -115,6 +125,7 @@ var NEAR_20_MINUTES = {
115
125
  };
116
126
  var NEAR_30_MINUTES = {
117
127
  label: "近 30 分钟",
128
+ enLabel: "Last 30 Minutes",
118
129
  rangeLabel: "30m",
119
130
  name: "NEAR_30_MINUTES",
120
131
  range: (current = (0, import_moment.default)()) => [
@@ -124,6 +135,7 @@ var NEAR_30_MINUTES = {
124
135
  };
125
136
  var NEAR_1_HOURS = {
126
137
  label: "近 1 小时",
138
+ enLabel: "Last 1 Hour",
127
139
  rangeLabel: "1h",
128
140
  name: "NEAR_1_HOURS",
129
141
  range: (current = (0, import_moment.default)()) => [
@@ -133,6 +145,7 @@ var NEAR_1_HOURS = {
133
145
  };
134
146
  var NEAR_2_HOURS = {
135
147
  label: "近 2 小时",
148
+ enLabel: "Last 2 Hours",
136
149
  rangeLabel: "2h",
137
150
  name: "NEAR_2_HOURS",
138
151
  range: (current = (0, import_moment.default)()) => [
@@ -142,6 +155,7 @@ var NEAR_2_HOURS = {
142
155
  };
143
156
  var NEAR_3_HOURS = {
144
157
  label: "近 3 小时",
158
+ enLabel: "Last 3 Hours",
145
159
  rangeLabel: "3h",
146
160
  name: "NEAR_3_HOURS",
147
161
  range: (current = (0, import_moment.default)()) => [
@@ -151,6 +165,7 @@ var NEAR_3_HOURS = {
151
165
  };
152
166
  var NEAR_6_HOURS = {
153
167
  label: "近 6 小时",
168
+ enLabel: "Last 6 Hours",
154
169
  rangeLabel: "6h",
155
170
  name: "NEAR_6_HOURS",
156
171
  range: (current = (0, import_moment.default)()) => [
@@ -158,8 +173,19 @@ var NEAR_6_HOURS = {
158
173
  current.clone()
159
174
  ]
160
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
+ };
161
186
  var TODAY = {
162
187
  label: "今天",
188
+ enLabel: "Today",
163
189
  rangeLabel: "1d",
164
190
  name: "TODAY",
165
191
  range: (current = (0, import_moment.default)()) => [
@@ -169,6 +195,7 @@ var TODAY = {
169
195
  };
170
196
  var YESTERDAY = {
171
197
  label: "昨天",
198
+ enLabel: "Yesterday",
172
199
  rangeLabel: "1d",
173
200
  name: "YESTERDAY",
174
201
  range: (current = (0, import_moment.default)()) => [
@@ -176,8 +203,19 @@ var YESTERDAY = {
176
203
  current.clone().endOf(DAY_UNIT).add(-1, DAY_UNIT)
177
204
  ]
178
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
+ };
179
216
  var LAST_3_DAYS = {
180
217
  label: "近 3 天",
218
+ enLabel: "Last 3 Days",
181
219
  rangeLabel: "3d",
182
220
  name: "LAST_3_DAYS",
183
221
  range: (current = (0, import_moment.default)()) => [
@@ -187,6 +225,7 @@ var LAST_3_DAYS = {
187
225
  };
188
226
  var THIS_WEEK = {
189
227
  label: "近一周",
228
+ enLabel: "Nearly a week",
190
229
  rangeLabel: "1w",
191
230
  name: "THIS_WEEK",
192
231
  range: (current = (0, import_moment.default)()) => [
@@ -196,6 +235,7 @@ var THIS_WEEK = {
196
235
  };
197
236
  var LAST_WEEK = {
198
237
  label: "上周",
238
+ enLabel: "Last week",
199
239
  rangeLabel: "last week",
200
240
  name: "LAST_WEEK",
201
241
  range: (current = (0, import_moment.default)()) => [
@@ -205,6 +245,7 @@ var LAST_WEEK = {
205
245
  };
206
246
  var THIS_MONTH = {
207
247
  label: "本月",
248
+ enLabel: "This month",
208
249
  rangeLabel: "1mo",
209
250
  name: "THIS_MONTH",
210
251
  range: (current = (0, import_moment.default)()) => [
@@ -214,6 +255,7 @@ var THIS_MONTH = {
214
255
  };
215
256
  var LAST_MONTH = {
216
257
  label: "上月",
258
+ enLabel: "Last month",
217
259
  rangeLabel: "1mo",
218
260
  name: "LAST_MONTH",
219
261
  range: (current = (0, import_moment.default)()) => [
@@ -223,6 +265,7 @@ var LAST_MONTH = {
223
265
  };
224
266
  var THIS_YEAR = {
225
267
  label: "今年",
268
+ enLabel: "This year",
226
269
  rangeLabel: "1y",
227
270
  name: "THIS_YEAR",
228
271
  range: (current = (0, import_moment.default)()) => [
@@ -232,6 +275,7 @@ var THIS_YEAR = {
232
275
  };
233
276
  var LAST_YEAR = {
234
277
  label: "去年",
278
+ enLabel: "Last year",
235
279
  rangeLabel: "1y",
236
280
  name: "LAST_YEAR",
237
281
  range: (current = (0, import_moment.default)()) => [
@@ -241,6 +285,7 @@ var LAST_YEAR = {
241
285
  };
242
286
  var NEXT_YEAR = {
243
287
  label: "明年",
288
+ enLabel: "Next year",
244
289
  rangeLabel: "1y",
245
290
  name: "NEXT_YEAR",
246
291
  range: (current = (0, import_moment.default)()) => [
@@ -258,9 +303,13 @@ var NEAR_TIME_LIST = [
258
303
  NEAR_2_HOURS,
259
304
  NEAR_3_HOURS,
260
305
  NEAR_6_HOURS,
306
+ NEAR_12_HOURS,
307
+ LAST_1_DAY,
261
308
  LAST_3_DAYS,
262
309
  TODAY,
263
310
  YESTERDAY,
311
+ THIS_WEEK,
312
+ LAST_WEEK,
264
313
  THIS_MONTH,
265
314
  LAST_MONTH,
266
315
  THIS_YEAR,
@@ -272,13 +321,17 @@ var NEAR_TIME_LIST = [
272
321
  CUSTOMIZE,
273
322
  DATE_TIME_FORMAT,
274
323
  DATE_TIME_FORMAT_CN,
324
+ DATE_TIME_MONTH_FORMAT,
325
+ DATE_TIME_MONTH_FORMAT_CN,
275
326
  DATE_TIME_SECOND_FORMAT,
276
327
  DATE_TIME_SECOND_FORMAT_CN,
328
+ LAST_1_DAY,
277
329
  LAST_3_DAYS,
278
330
  LAST_MONTH,
279
331
  LAST_WEEK,
280
332
  LAST_YEAR,
281
333
  NEAR_10_MINUTES,
334
+ NEAR_12_HOURS,
282
335
  NEAR_1_HOURS,
283
336
  NEAR_1_MINUTES,
284
337
  NEAR_20_MINUTES,
@@ -1,3 +1,26 @@
1
+ /// <reference types="react" />
1
2
  export * from './Ranger';
2
- declare const DateRanger: any;
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;
@@ -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
- DateRanger.NEAR_1_MINUTES = import_constant.NEAR_1_MINUTES;
41
- DateRanger.NEAR_5_MINUTES = import_constant.NEAR_5_MINUTES;
42
- DateRanger.NEAR_10_MINUTES = import_constant.NEAR_10_MINUTES;
43
- DateRanger.NEAR_20_MINUTES = import_constant.NEAR_20_MINUTES;
44
- DateRanger.NEAR_30_MINUTES = import_constant.NEAR_30_MINUTES;
45
- DateRanger.NEAR_1_HOURS = import_constant.NEAR_1_HOURS;
46
- DateRanger.NEAR_2_HOURS = import_constant.NEAR_2_HOURS;
47
- DateRanger.NEAR_3_HOURS = import_constant.NEAR_3_HOURS;
48
- DateRanger.NEAR_6_HOURS = import_constant.NEAR_6_HOURS;
49
- DateRanger.TODAY = import_constant.TODAY;
50
- DateRanger.LAST_3_DAYS = import_constant.LAST_3_DAYS;
51
- DateRanger.YESTERDAY = import_constant.YESTERDAY;
52
- DateRanger.THIS_WEEK = import_constant.THIS_WEEK;
53
- DateRanger.LAST_WEEK = import_constant.LAST_WEEK;
54
- DateRanger.THIS_MONTH = import_constant.THIS_MONTH;
55
- DateRanger.LAST_MONTH = import_constant.LAST_MONTH;
56
- DateRanger.THIS_YEAR = import_constant.THIS_YEAR;
57
- DateRanger.LAST_YEAR = import_constant.LAST_YEAR;
58
- DateRanger.NEXT_YEAR = import_constant.NEXT_YEAR;
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
- pointer-events: none;
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 date",
40
- startTime: "Start time",
41
- endDate: "End date",
42
- endTime: "End time",
43
- cancel: "cancel",
44
- confirm: "confirm",
45
- current: "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
@@ -5,6 +5,10 @@ export interface RangeOption {
5
5
  * @description 选项展示名称
6
6
  */
7
7
  label: string;
8
+ /**
9
+ * @description 选项英文展示名称,用来兼容内部国际化,外部传入的选项直接对 label 做国际化即可
10
+ */
11
+ enLabel?: string;
8
12
  /**
9
13
  * @description 选项 key
10
14
  */
@@ -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: ("go" | "ruby" | "css" | "javascript" | "typescript" | "groovy" | "java" | "python" | "bash" | "json" | "cpp" | "http" | "markdown" | "nginx" | "sql" | "xml" | "dockerfile" | "yaml" | "solidity" | "tsx" | "jsx")[];
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,5 @@
1
+ import { ProCard as AntProCard } from '@ant-design/pro-components';
2
+ import type { ProCardProps } from '@ant-design/pro-components';
3
+ export { ProCardProps };
4
+ declare const ProCard: typeof AntProCard;
5
+ export default ProCard;
@@ -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;
@@ -0,0 +1,92 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/ProCard/style/index.ts
20
+ var style_exports = {};
21
+ __export(style_exports, {
22
+ default: () => style_default,
23
+ genProCardStyle: () => genProCardStyle
24
+ });
25
+ module.exports = __toCommonJS(style_exports);
26
+ var import_design = require("@oceanbase/design");
27
+ var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
28
+ var genProCardStyle = (token) => {
29
+ const { componentCls, antCls, prefixCls } = token;
30
+ const tabsComponentCls = `${antCls}-tabs`;
31
+ const tabsPrefixCls = `${prefixCls}-tabs`;
32
+ return {
33
+ // follow Card style
34
+ // need add `div` to make style work
35
+ [`div${componentCls}`]: {
36
+ borderRadius: token.borderRadiusLG
37
+ },
38
+ [`${componentCls}:not(${componentCls}-border)`]: {
39
+ boxShadow: "0 1px 2px 0 rgba(0, 0, 0, 0.03),0 1px 6px -1px rgba(0, 0, 0, 0.02),0 2px 4px 0 rgba(0, 0, 0, 0.02)"
40
+ },
41
+ [`${componentCls}:not(${componentCls}-size-small)`]: {
42
+ [`${componentCls}-body`]: {
43
+ paddingBlock: token.paddingLG
44
+ },
45
+ [`&${componentCls}-has-title${componentCls}-no-divider`]: {
46
+ [`${componentCls}-body`]: {
47
+ paddingBlockStart: token.padding
48
+ }
49
+ }
50
+ },
51
+ // no body padding card
52
+ [`${componentCls}${componentCls}-no-body-padding:not(${componentCls}-contain-tabs)`]: {
53
+ [`${componentCls}-header`]: {
54
+ paddingBlockEnd: token.padding
55
+ },
56
+ ...import_design.Card.genTableStyle(token.paddingLG, token)
57
+ },
58
+ // no body padding small card
59
+ [`${componentCls}${componentCls}-no-body-padding${componentCls}-size-small:not(${componentCls}-contain-tabs)`]: {
60
+ [`${componentCls}-header`]: {
61
+ paddingBlockEnd: token.paddingXS
62
+ },
63
+ ...import_design.Card.genTableStyle(token.paddingSM, token)
64
+ },
65
+ // custom ProCard tabs style
66
+ [`${componentCls}`]: {
67
+ [`${componentCls}-tabs`]: {
68
+ [`${tabsComponentCls}-top, ${tabsComponentCls}-bottom`]: {
69
+ [`>${tabsComponentCls}-nav ${tabsComponentCls}-nav-list`]: {
70
+ marginBlockStart: 0,
71
+ paddingInlineStart: token.marginLG
72
+ }
73
+ },
74
+ ...import_design.Tabs.genTabsStyle({
75
+ ...token,
76
+ componentCls: tabsComponentCls,
77
+ prefixCls: tabsPrefixCls
78
+ })
79
+ }
80
+ }
81
+ };
82
+ };
83
+ var style_default = (prefixCls) => {
84
+ const useStyle = (0, import_genComponentStyleHook.genComponentStyleHook)("ProCard", (token) => {
85
+ return [genProCardStyle(token)];
86
+ });
87
+ return useStyle(prefixCls);
88
+ };
89
+ // Annotate the CommonJS export names for ESM import in node:
90
+ 0 && (module.exports = {
91
+ genProCardStyle
92
+ });
@@ -1,7 +1,8 @@
1
1
  /// <reference types="react" />
2
- import type { FullToken, GenerateStyle } from '@oceanbase/design/es/theme';
2
+ import type { CSSObject } from '@ant-design/cssinjs';
3
+ import type { FullToken } from '@oceanbase/design/es/theme';
3
4
  export type TagSelectToken = FullToken<any>;
4
- export declare const genTagSelectStyle: GenerateStyle<TagSelectToken>;
5
+ export declare const genTagSelectStyle: (token: TagSelectToken) => CSSObject;
5
6
  declare const _default: (prefixCls: string) => {
6
7
  wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").JSX.Element;
7
8
  hashId: string;
@@ -40,7 +40,7 @@ function genComponentStyleHook(componentName, styleFn) {
40
40
  const { getPrefixCls, iconPrefixCls } = import_react.default.useContext(import_design.ConfigProvider.ConfigContext);
41
41
  const rootPrefixCls = getPrefixCls();
42
42
  const componentCls = `.${prefixCls}`;
43
- return (0, import_pro_components.useStyle)(componentName, (token) => {
43
+ return (0, import_pro_components.useStyle)(`OB-${componentName}`, (token) => {
44
44
  const mergedToken = {
45
45
  ...token,
46
46
  componentCls,
package/lib/index.d.ts CHANGED
@@ -40,6 +40,8 @@ export { default as FooterToolbar } from './FooterToolbar';
40
40
  export type { FooterToolbarProps } from './FooterToolbar';
41
41
  export { default as ProTable } from './ProTable';
42
42
  export type { ProTableProps } from './ProTable';
43
+ export { default as ProCard } from './ProCard';
44
+ export type { ProCardProps } from './ProCard';
43
45
  export { default as LightFilter } from './LightFilter';
44
46
  export type { LightFilterProps } from './LightFilter';
45
47
  export { default as Password } from './Password';
package/lib/index.js CHANGED
@@ -53,6 +53,7 @@ __export(src_exports, {
53
53
  PageContainer: () => import_PageContainer.default,
54
54
  PageLoading: () => import_PageLoading.default,
55
55
  Password: () => import_Password.default,
56
+ ProCard: () => import_ProCard.default,
56
57
  ProTable: () => import_ProTable.default,
57
58
  Ranger: () => import_Ranger.default,
58
59
  SideTip: () => import_SideTip.default,
@@ -87,6 +88,7 @@ var import_PageContainer = __toESM(require("./PageContainer"));
87
88
  var import_PageLoading = __toESM(require("./PageLoading"));
88
89
  var import_FooterToolbar = __toESM(require("./FooterToolbar"));
89
90
  var import_ProTable = __toESM(require("./ProTable"));
91
+ var import_ProCard = __toESM(require("./ProCard"));
90
92
  var import_LightFilter = __toESM(require("./LightFilter"));
91
93
  var import_Password = __toESM(require("./Password"));
92
94
  var import_Ranger = __toESM(require("./Ranger"));
@@ -122,6 +124,7 @@ var import_BackgroundTaskManager = __toESM(require("./BackgroundTaskManager"));
122
124
  PageContainer,
123
125
  PageLoading,
124
126
  Password,
127
+ ProCard,
125
128
  ProTable,
126
129
  Ranger,
127
130
  SideTip,
@@ -44,7 +44,9 @@ var LocaleWrapper_default = ({ componentName, defaultLocale }) => (BaseComponent
44
44
  const localeFromContext = componentName && antLocale ? antLocale[componentName] : {};
45
45
  const localeData = {
46
46
  ...defaultLocale,
47
- ...localeFromContext || {}
47
+ ...localeFromContext || {},
48
+ // 这里使用 antLocale,不能直接顶掉 locale 属性,有些组件内部会维护一个 locale 去做特殊判断
49
+ antLocale: (antLocale == null ? void 0 : antLocale.locale) || "zh-cn"
48
50
  };
49
51
  return (
50
52
  // @ts-ignore