@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.
- package/dist/ui.min.css +1 -1
- package/dist/ui.min.js +1 -1
- package/es/Action/Group.d.ts +4 -3
- package/es/Action/Group.js +30 -16
- 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 +20 -26
- package/es/DateRanger/constant/index.d.ts +6 -2
- package/es/DateRanger/constant/index.js +44 -3
- 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/DateRanger/typing.d.ts +4 -0
- 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/es/locale/LocaleWrapper.js +4 -1
- package/lib/Action/Group.d.ts +4 -3
- package/lib/Action/Group.js +64 -46
- 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 +17 -17
- package/lib/DateRanger/constant/index.d.ts +6 -2
- package/lib/DateRanger/constant/index.js +55 -2
- 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/DateRanger/typing.d.ts +4 -0
- 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/lib/locale/LocaleWrapper.js +3 -1
- package/package.json +9 -9
|
@@ -9,16 +9,19 @@ var DAY_UNIT = 'day';
|
|
|
9
9
|
var WEEK_UNIT = 'week';
|
|
10
10
|
var MONTH_UNIT = 'month';
|
|
11
11
|
var YEAR_UNIT = 'year';
|
|
12
|
-
export var YEAR_DATE_TIME_SECOND_FORMAT = '
|
|
13
|
-
export var YEAR_DATE_TIME_FORMAT = '
|
|
12
|
+
export var YEAR_DATE_TIME_SECOND_FORMAT = 'MM/DD/YYYY HH:mm:ss';
|
|
13
|
+
export var YEAR_DATE_TIME_FORMAT = 'MM/DD/YYYY HH:mm';
|
|
14
14
|
export var DATE_TIME_SECOND_FORMAT = 'MM/DD HH:mm:ss';
|
|
15
15
|
export var DATE_TIME_FORMAT = 'MM/DD HH:mm';
|
|
16
|
+
export var DATE_TIME_MONTH_FORMAT = 'MM/DD/YYYY';
|
|
16
17
|
export var YEAR_DATE_TIME_SECOND_FORMAT_CN = 'YYYY-MM-DD HH:mm:ss';
|
|
17
18
|
export var YEAR_DATE_TIME_FORMAT_CN = 'YYYY-MM-DD HH:mm';
|
|
19
|
+
export var DATE_TIME_MONTH_FORMAT_CN = 'YYYY-MM-DD';
|
|
18
20
|
export var DATE_TIME_SECOND_FORMAT_CN = 'MM-DD HH:mm:ss';
|
|
19
21
|
export var DATE_TIME_FORMAT_CN = 'MM-DD HH:mm';
|
|
20
22
|
export var NEAR_1_MINUTES = {
|
|
21
23
|
label: '近 1 分钟',
|
|
24
|
+
enLabel: 'Last 1 Minute',
|
|
22
25
|
rangeLabel: '1m',
|
|
23
26
|
name: 'NEAR_1_MINUTES',
|
|
24
27
|
range: function range() {
|
|
@@ -28,6 +31,7 @@ export var NEAR_1_MINUTES = {
|
|
|
28
31
|
};
|
|
29
32
|
export var NEAR_5_MINUTES = {
|
|
30
33
|
label: '近 5 分钟',
|
|
34
|
+
enLabel: 'Last 5 Minutes',
|
|
31
35
|
rangeLabel: '5m',
|
|
32
36
|
name: 'NEAR_5_MINUTES',
|
|
33
37
|
range: function range() {
|
|
@@ -37,6 +41,7 @@ export var NEAR_5_MINUTES = {
|
|
|
37
41
|
};
|
|
38
42
|
export var NEAR_10_MINUTES = {
|
|
39
43
|
label: '近 10 分钟',
|
|
44
|
+
enLabel: 'Last 10 Minutes',
|
|
40
45
|
rangeLabel: '10m',
|
|
41
46
|
name: 'NEAR_10_MINUTES',
|
|
42
47
|
range: function range() {
|
|
@@ -46,6 +51,7 @@ export var NEAR_10_MINUTES = {
|
|
|
46
51
|
};
|
|
47
52
|
export var NEAR_20_MINUTES = {
|
|
48
53
|
label: '近 20 分钟',
|
|
54
|
+
enLabel: 'Last 20 Minutes',
|
|
49
55
|
rangeLabel: '20m',
|
|
50
56
|
name: 'NEAR_20_MINUTES',
|
|
51
57
|
range: function range() {
|
|
@@ -55,6 +61,7 @@ export var NEAR_20_MINUTES = {
|
|
|
55
61
|
};
|
|
56
62
|
export var NEAR_30_MINUTES = {
|
|
57
63
|
label: '近 30 分钟',
|
|
64
|
+
enLabel: 'Last 30 Minutes',
|
|
58
65
|
rangeLabel: '30m',
|
|
59
66
|
name: 'NEAR_30_MINUTES',
|
|
60
67
|
range: function range() {
|
|
@@ -64,6 +71,7 @@ export var NEAR_30_MINUTES = {
|
|
|
64
71
|
};
|
|
65
72
|
export var NEAR_1_HOURS = {
|
|
66
73
|
label: '近 1 小时',
|
|
74
|
+
enLabel: 'Last 1 Hour',
|
|
67
75
|
rangeLabel: '1h',
|
|
68
76
|
name: 'NEAR_1_HOURS',
|
|
69
77
|
range: function range() {
|
|
@@ -73,6 +81,7 @@ export var NEAR_1_HOURS = {
|
|
|
73
81
|
};
|
|
74
82
|
export var NEAR_2_HOURS = {
|
|
75
83
|
label: '近 2 小时',
|
|
84
|
+
enLabel: 'Last 2 Hours',
|
|
76
85
|
rangeLabel: '2h',
|
|
77
86
|
name: 'NEAR_2_HOURS',
|
|
78
87
|
range: function range() {
|
|
@@ -82,6 +91,7 @@ export var NEAR_2_HOURS = {
|
|
|
82
91
|
};
|
|
83
92
|
export var NEAR_3_HOURS = {
|
|
84
93
|
label: '近 3 小时',
|
|
94
|
+
enLabel: 'Last 3 Hours',
|
|
85
95
|
rangeLabel: '3h',
|
|
86
96
|
name: 'NEAR_3_HOURS',
|
|
87
97
|
range: function range() {
|
|
@@ -91,6 +101,7 @@ export var NEAR_3_HOURS = {
|
|
|
91
101
|
};
|
|
92
102
|
export var NEAR_6_HOURS = {
|
|
93
103
|
label: '近 6 小时',
|
|
104
|
+
enLabel: 'Last 6 Hours',
|
|
94
105
|
rangeLabel: '6h',
|
|
95
106
|
name: 'NEAR_6_HOURS',
|
|
96
107
|
range: function range() {
|
|
@@ -98,8 +109,19 @@ export var NEAR_6_HOURS = {
|
|
|
98
109
|
return [current.clone().subtract(6, 'hour'), current.clone()];
|
|
99
110
|
}
|
|
100
111
|
};
|
|
112
|
+
export var NEAR_12_HOURS = {
|
|
113
|
+
label: '近 12 小时',
|
|
114
|
+
enLabel: 'Last 12 Hours',
|
|
115
|
+
rangeLabel: '12h',
|
|
116
|
+
name: 'NEAR_12_HOURS',
|
|
117
|
+
range: function range() {
|
|
118
|
+
var current = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : moment();
|
|
119
|
+
return [current.clone().subtract(12, 'hour'), current.clone()];
|
|
120
|
+
}
|
|
121
|
+
};
|
|
101
122
|
export var TODAY = {
|
|
102
123
|
label: '今天',
|
|
124
|
+
enLabel: 'Today',
|
|
103
125
|
rangeLabel: '1d',
|
|
104
126
|
name: 'TODAY',
|
|
105
127
|
range: function range() {
|
|
@@ -109,6 +131,7 @@ export var TODAY = {
|
|
|
109
131
|
};
|
|
110
132
|
export var YESTERDAY = {
|
|
111
133
|
label: '昨天',
|
|
134
|
+
enLabel: 'Yesterday',
|
|
112
135
|
rangeLabel: '1d',
|
|
113
136
|
name: 'YESTERDAY',
|
|
114
137
|
range: function range() {
|
|
@@ -116,8 +139,19 @@ export var YESTERDAY = {
|
|
|
116
139
|
return [current.clone().startOf(DAY_UNIT).add(-1, DAY_UNIT), current.clone().endOf(DAY_UNIT).add(-1, DAY_UNIT)];
|
|
117
140
|
}
|
|
118
141
|
};
|
|
142
|
+
export var LAST_1_DAY = {
|
|
143
|
+
label: '近 1 天',
|
|
144
|
+
enLabel: 'Last 1 Day',
|
|
145
|
+
rangeLabel: '1d',
|
|
146
|
+
name: 'LAST_1_DAY',
|
|
147
|
+
range: function range() {
|
|
148
|
+
var current = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : moment();
|
|
149
|
+
return [current.clone().subtract(1, 'days'), current.clone()];
|
|
150
|
+
}
|
|
151
|
+
};
|
|
119
152
|
export var LAST_3_DAYS = {
|
|
120
153
|
label: '近 3 天',
|
|
154
|
+
enLabel: 'Last 3 Days',
|
|
121
155
|
rangeLabel: '3d',
|
|
122
156
|
name: 'LAST_3_DAYS',
|
|
123
157
|
range: function range() {
|
|
@@ -127,6 +161,7 @@ export var LAST_3_DAYS = {
|
|
|
127
161
|
};
|
|
128
162
|
export var THIS_WEEK = {
|
|
129
163
|
label: '近一周',
|
|
164
|
+
enLabel: 'Nearly a week',
|
|
130
165
|
rangeLabel: '1w',
|
|
131
166
|
name: 'THIS_WEEK',
|
|
132
167
|
range: function range() {
|
|
@@ -136,6 +171,7 @@ export var THIS_WEEK = {
|
|
|
136
171
|
};
|
|
137
172
|
export var LAST_WEEK = {
|
|
138
173
|
label: '上周',
|
|
174
|
+
enLabel: 'Last week',
|
|
139
175
|
rangeLabel: 'last week',
|
|
140
176
|
name: 'LAST_WEEK',
|
|
141
177
|
range: function range() {
|
|
@@ -145,6 +181,7 @@ export var LAST_WEEK = {
|
|
|
145
181
|
};
|
|
146
182
|
export var THIS_MONTH = {
|
|
147
183
|
label: '本月',
|
|
184
|
+
enLabel: 'This month',
|
|
148
185
|
rangeLabel: '1mo',
|
|
149
186
|
name: 'THIS_MONTH',
|
|
150
187
|
range: function range() {
|
|
@@ -154,6 +191,7 @@ export var THIS_MONTH = {
|
|
|
154
191
|
};
|
|
155
192
|
export var LAST_MONTH = {
|
|
156
193
|
label: '上月',
|
|
194
|
+
enLabel: 'Last month',
|
|
157
195
|
rangeLabel: '1mo',
|
|
158
196
|
name: 'LAST_MONTH',
|
|
159
197
|
range: function range() {
|
|
@@ -163,6 +201,7 @@ export var LAST_MONTH = {
|
|
|
163
201
|
};
|
|
164
202
|
export var THIS_YEAR = {
|
|
165
203
|
label: '今年',
|
|
204
|
+
enLabel: 'This year',
|
|
166
205
|
rangeLabel: '1y',
|
|
167
206
|
name: 'THIS_YEAR',
|
|
168
207
|
range: function range() {
|
|
@@ -172,6 +211,7 @@ export var THIS_YEAR = {
|
|
|
172
211
|
};
|
|
173
212
|
export var LAST_YEAR = {
|
|
174
213
|
label: '去年',
|
|
214
|
+
enLabel: 'Last year',
|
|
175
215
|
rangeLabel: '1y',
|
|
176
216
|
name: 'LAST_YEAR',
|
|
177
217
|
range: function range() {
|
|
@@ -181,6 +221,7 @@ export var LAST_YEAR = {
|
|
|
181
221
|
};
|
|
182
222
|
export var NEXT_YEAR = {
|
|
183
223
|
label: '明年',
|
|
224
|
+
enLabel: 'Next year',
|
|
184
225
|
rangeLabel: '1y',
|
|
185
226
|
name: 'NEXT_YEAR',
|
|
186
227
|
range: function range() {
|
|
@@ -188,4 +229,4 @@ export var NEXT_YEAR = {
|
|
|
188
229
|
return [current.clone().startOf(YEAR_UNIT).add(1, YEAR_UNIT), current.clone().endOf(YEAR_UNIT).add(1, YEAR_UNIT)];
|
|
189
230
|
}
|
|
190
231
|
};
|
|
191
|
-
export var NEAR_TIME_LIST = [NEAR_1_MINUTES, NEAR_5_MINUTES, NEAR_10_MINUTES, NEAR_20_MINUTES, NEAR_30_MINUTES, NEAR_1_HOURS, NEAR_2_HOURS, NEAR_3_HOURS, NEAR_6_HOURS, LAST_3_DAYS, TODAY, YESTERDAY, THIS_MONTH, LAST_MONTH, THIS_YEAR, LAST_YEAR, NEXT_YEAR];
|
|
232
|
+
export var NEAR_TIME_LIST = [NEAR_1_MINUTES, NEAR_5_MINUTES, NEAR_10_MINUTES, NEAR_20_MINUTES, NEAR_30_MINUTES, NEAR_1_HOURS, NEAR_2_HOURS, NEAR_3_HOURS, NEAR_6_HOURS, NEAR_12_HOURS, LAST_1_DAY, LAST_3_DAYS, TODAY, YESTERDAY, THIS_WEEK, LAST_WEEK, THIS_MONTH, LAST_MONTH, THIS_YEAR, LAST_YEAR, NEXT_YEAR];
|
package/es/DateRanger/index.d.ts
CHANGED
|
@@ -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/es/DateRanger/index.js
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { LAST_3_DAYS, LAST_MONTH, LAST_WEEK, LAST_YEAR, NEAR_10_MINUTES, NEAR_1_HOURS, NEAR_1_MINUTES, NEAR_20_MINUTES, NEAR_2_HOURS, NEAR_30_MINUTES, NEAR_3_HOURS, NEAR_5_MINUTES, NEAR_6_HOURS, NEXT_YEAR, THIS_MONTH, THIS_WEEK, THIS_YEAR, TODAY, YESTERDAY } from "./constant";
|
|
1
|
+
import { LAST_1_DAY, LAST_3_DAYS, LAST_MONTH, LAST_WEEK, LAST_YEAR, NEAR_10_MINUTES, NEAR_12_HOURS, NEAR_1_HOURS, NEAR_1_MINUTES, NEAR_20_MINUTES, NEAR_2_HOURS, NEAR_30_MINUTES, NEAR_3_HOURS, NEAR_5_MINUTES, NEAR_6_HOURS, NEXT_YEAR, THIS_MONTH, THIS_WEEK, THIS_YEAR, TODAY, YESTERDAY } from "./constant";
|
|
2
2
|
import InternalDateRanger from "./Ranger";
|
|
3
3
|
export * from "./Ranger";
|
|
4
|
-
var DateRanger = InternalDateRanger
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
4
|
+
var DateRanger = Object.assign(InternalDateRanger, {
|
|
5
|
+
NEAR_1_MINUTES: NEAR_1_MINUTES,
|
|
6
|
+
NEAR_5_MINUTES: NEAR_5_MINUTES,
|
|
7
|
+
NEAR_10_MINUTES: NEAR_10_MINUTES,
|
|
8
|
+
NEAR_20_MINUTES: NEAR_20_MINUTES,
|
|
9
|
+
NEAR_30_MINUTES: NEAR_30_MINUTES,
|
|
10
|
+
NEAR_1_HOURS: NEAR_1_HOURS,
|
|
11
|
+
NEAR_2_HOURS: NEAR_2_HOURS,
|
|
12
|
+
NEAR_3_HOURS: NEAR_3_HOURS,
|
|
13
|
+
NEAR_6_HOURS: NEAR_6_HOURS,
|
|
14
|
+
NEAR_12_HOURS: NEAR_12_HOURS,
|
|
15
|
+
TODAY: TODAY,
|
|
16
|
+
LAST_1_DAY: LAST_1_DAY,
|
|
17
|
+
LAST_3_DAYS: LAST_3_DAYS,
|
|
18
|
+
YESTERDAY: YESTERDAY,
|
|
19
|
+
THIS_WEEK: THIS_WEEK,
|
|
20
|
+
LAST_WEEK: LAST_WEEK,
|
|
21
|
+
THIS_MONTH: THIS_MONTH,
|
|
22
|
+
LAST_MONTH: LAST_MONTH,
|
|
23
|
+
THIS_YEAR: THIS_YEAR,
|
|
24
|
+
LAST_YEAR: LAST_YEAR,
|
|
25
|
+
NEXT_YEAR: NEXT_YEAR
|
|
26
|
+
});
|
|
26
27
|
export default DateRanger;
|
package/es/DateRanger/index.less
CHANGED
|
@@ -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;
|
|
@@ -8,13 +8,13 @@ import en_US from 'rc-picker/es/locale/en_US';
|
|
|
8
8
|
export default _objectSpread({
|
|
9
9
|
customize: 'Custom',
|
|
10
10
|
customTime: 'Custom Time',
|
|
11
|
-
startDate: 'Start
|
|
12
|
-
startTime: 'Start
|
|
13
|
-
endDate: 'End
|
|
14
|
-
endTime: 'End
|
|
15
|
-
cancel: '
|
|
16
|
-
confirm: '
|
|
17
|
-
current: '
|
|
11
|
+
startDate: 'Start Date',
|
|
12
|
+
startTime: 'Start Time',
|
|
13
|
+
endDate: 'End Date',
|
|
14
|
+
endTime: 'End Time',
|
|
15
|
+
cancel: 'Cancel',
|
|
16
|
+
confirm: 'Confirm',
|
|
17
|
+
current: 'Current',
|
|
18
18
|
jumpBack: 'Previous Interval',
|
|
19
19
|
jumpForward: 'Next Interval'
|
|
20
20
|
}, en_US);
|
package/es/Highlight/index.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export declare const THEME_DARK = "dark";
|
|
|
29
29
|
export declare const THEME_LIGHT = "light";
|
|
30
30
|
declare const ThemeTypes: ["dark", "light"];
|
|
31
31
|
export type ThemeType = (typeof ThemeTypes)[number];
|
|
32
|
-
declare const supportedLanguages: ("
|
|
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,52 @@
|
|
|
1
|
+
var _excluded = ["title", "tabs", "headerBordered", "bodyStyle", "prefixCls", "className"];
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
+
import React, { useContext } from 'react';
|
|
11
|
+
import { ProCard as AntProCard } from '@ant-design/pro-components';
|
|
12
|
+
import { ConfigProvider } from '@oceanbase/design';
|
|
13
|
+
import classNames from 'classnames';
|
|
14
|
+
import useStyle from "./style";
|
|
15
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
var ProCard = function ProCard(_ref) {
|
|
18
|
+
var title = _ref.title,
|
|
19
|
+
tabs = _ref.tabs,
|
|
20
|
+
headerBordered = _ref.headerBordered,
|
|
21
|
+
bodyStyle = _ref.bodyStyle,
|
|
22
|
+
customizePrefixCls = _ref.prefixCls,
|
|
23
|
+
className = _ref.className,
|
|
24
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
25
|
+
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
26
|
+
getPrefixCls = _useContext.getPrefixCls;
|
|
27
|
+
var prefixCls = getPrefixCls('pro-card', customizePrefixCls);
|
|
28
|
+
var _useStyle = useStyle(prefixCls),
|
|
29
|
+
wrapSSR = _useStyle.wrapSSR;
|
|
30
|
+
var zeroPaddingList = [0, '0', '0px'];
|
|
31
|
+
// ProCard body has no padding
|
|
32
|
+
var noBodyPadding = zeroPaddingList.includes(bodyStyle === null || bodyStyle === void 0 ? void 0 : bodyStyle.padding);
|
|
33
|
+
var proCardCls = classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-has-title"), !!title), "".concat(prefixCls, "-no-body-padding"), noBodyPadding), "".concat(prefixCls, "-no-divider"), !headerBordered), "".concat(prefixCls, "-contain-tabs"), !!tabs), className);
|
|
34
|
+
return wrapSSR( /*#__PURE__*/_jsx(AntProCard, _objectSpread({
|
|
35
|
+
prefixCls: customizePrefixCls,
|
|
36
|
+
title: title,
|
|
37
|
+
tabs: _typeof(tabs) === 'object' ? _objectSpread({
|
|
38
|
+
size: 'large'
|
|
39
|
+
}, tabs) : tabs,
|
|
40
|
+
headerBordered: headerBordered,
|
|
41
|
+
bodyStyle: bodyStyle,
|
|
42
|
+
className: proCardCls
|
|
43
|
+
}, restProps)));
|
|
44
|
+
};
|
|
45
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
46
|
+
ProCard.displayName = AntProCard.displayName;
|
|
47
|
+
}
|
|
48
|
+
ProCard.isProCard = AntProCard.isProCard;
|
|
49
|
+
ProCard.Divider = AntProCard.Divider;
|
|
50
|
+
ProCard.TabPane = AntProCard.TabPane;
|
|
51
|
+
ProCard.Group = AntProCard.Group;
|
|
52
|
+
export 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,40 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import { Card, Tabs } from '@oceanbase/design';
|
|
8
|
+
import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
|
|
9
|
+
export var genProCardStyle = function genProCardStyle(token) {
|
|
10
|
+
var componentCls = token.componentCls,
|
|
11
|
+
antCls = token.antCls,
|
|
12
|
+
prefixCls = token.prefixCls;
|
|
13
|
+
var tabsComponentCls = "".concat(antCls, "-tabs");
|
|
14
|
+
var tabsPrefixCls = "".concat(prefixCls, "-tabs");
|
|
15
|
+
return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "div".concat(componentCls), {
|
|
16
|
+
borderRadius: token.borderRadiusLG
|
|
17
|
+
}), "".concat(componentCls, ":not(").concat(componentCls, "-border)"), {
|
|
18
|
+
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)'
|
|
19
|
+
}), "".concat(componentCls, ":not(").concat(componentCls, "-size-small)"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-body"), {
|
|
20
|
+
paddingBlock: token.paddingLG
|
|
21
|
+
}), "&".concat(componentCls, "-has-title").concat(componentCls, "-no-divider"), _defineProperty({}, "".concat(componentCls, "-body"), {
|
|
22
|
+
paddingBlockStart: token.padding
|
|
23
|
+
}))), "".concat(componentCls).concat(componentCls, "-no-body-padding:not(").concat(componentCls, "-contain-tabs)"), _objectSpread(_defineProperty({}, "".concat(componentCls, "-header"), {
|
|
24
|
+
paddingBlockEnd: token.padding
|
|
25
|
+
}), Card.genTableStyle(token.paddingLG, token))), "".concat(componentCls).concat(componentCls, "-no-body-padding").concat(componentCls, "-size-small:not(").concat(componentCls, "-contain-tabs)"), _objectSpread(_defineProperty({}, "".concat(componentCls, "-header"), {
|
|
26
|
+
paddingBlockEnd: token.paddingXS
|
|
27
|
+
}), Card.genTableStyle(token.paddingSM, token))), "".concat(componentCls), _defineProperty({}, "".concat(componentCls, "-tabs"), _objectSpread(_defineProperty({}, "".concat(tabsComponentCls, "-top, ").concat(tabsComponentCls, "-bottom"), _defineProperty({}, ">".concat(tabsComponentCls, "-nav ").concat(tabsComponentCls, "-nav-list"), {
|
|
28
|
+
marginBlockStart: 0,
|
|
29
|
+
paddingInlineStart: token.marginLG
|
|
30
|
+
})), Tabs.genTabsStyle(_objectSpread(_objectSpread({}, token), {}, {
|
|
31
|
+
componentCls: tabsComponentCls,
|
|
32
|
+
prefixCls: tabsPrefixCls
|
|
33
|
+
})))));
|
|
34
|
+
};
|
|
35
|
+
export default (function (prefixCls) {
|
|
36
|
+
var useStyle = genComponentStyleHook('ProCard', function (token) {
|
|
37
|
+
return [genProCardStyle(token)];
|
|
38
|
+
});
|
|
39
|
+
return useStyle(prefixCls);
|
|
40
|
+
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
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:
|
|
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;
|
|
@@ -14,7 +14,7 @@ export function genComponentStyleHook(componentName, styleFn) {
|
|
|
14
14
|
iconPrefixCls = _React$useContext.iconPrefixCls;
|
|
15
15
|
var rootPrefixCls = getPrefixCls();
|
|
16
16
|
var componentCls = ".".concat(prefixCls);
|
|
17
|
-
return useStyle(componentName, function (token) {
|
|
17
|
+
return useStyle("OB-".concat(componentName), function (token) {
|
|
18
18
|
var mergedToken = _objectSpread(_objectSpread({}, token), {}, {
|
|
19
19
|
componentCls: componentCls,
|
|
20
20
|
prefixCls: prefixCls,
|
package/es/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/es/index.js
CHANGED
|
@@ -22,6 +22,7 @@ export { default as PageContainer } from "./PageContainer";
|
|
|
22
22
|
export { default as PageLoading } from "./PageLoading";
|
|
23
23
|
export { default as FooterToolbar } from "./FooterToolbar";
|
|
24
24
|
export { default as ProTable } from "./ProTable";
|
|
25
|
+
export { default as ProCard } from "./ProCard";
|
|
25
26
|
export { default as LightFilter } from "./LightFilter";
|
|
26
27
|
export { default as Password } from "./Password";
|
|
27
28
|
export { default as Ranger } from "./Ranger";
|
|
@@ -43,7 +43,10 @@ export default (function (_ref) {
|
|
|
43
43
|
// @ts-ignore
|
|
44
44
|
var antLocale = this.context.locale;
|
|
45
45
|
var localeFromContext = componentName && antLocale ? antLocale[componentName] : {};
|
|
46
|
-
var localeData = _objectSpread(_objectSpread({}, defaultLocale), localeFromContext || {})
|
|
46
|
+
var localeData = _objectSpread(_objectSpread(_objectSpread({}, defaultLocale), localeFromContext || {}), {}, {
|
|
47
|
+
// 这里使用 antLocale,不能直接顶掉 locale 属性,有些组件内部会维护一个 locale 去做特殊判断
|
|
48
|
+
antLocale: (antLocale === null || antLocale === void 0 ? void 0 : antLocale.locale) || 'zh-cn'
|
|
49
|
+
});
|
|
47
50
|
return (
|
|
48
51
|
/*#__PURE__*/
|
|
49
52
|
// @ts-ignore
|
package/lib/Action/Group.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import type { ButtonSize } from '@oceanbase/design/es/button';
|
|
2
1
|
import React from 'react';
|
|
2
|
+
import type { ButtonSize } from '@oceanbase/design/es/button';
|
|
3
3
|
import type { BaseProps } from './Item';
|
|
4
4
|
export interface GroupProps {
|
|
5
|
+
prefixCls?: string;
|
|
5
6
|
size?: number;
|
|
6
7
|
dropDownPlacement?: 'topLeft' | 'topCenter' | 'topRight' | 'bottomLeft' | 'bottomCenter' | 'bottomRight';
|
|
7
8
|
children: React.ReactElement<BaseProps> | React.ReactElement<BaseProps>[];
|
|
8
9
|
shouldVisible?: (key: string) => boolean;
|
|
9
10
|
shouldDisabled?: (key: string) => boolean;
|
|
10
11
|
enableLoading?: boolean;
|
|
11
|
-
/** 更多操作的自定义展示 */
|
|
12
12
|
moreText?: React.ReactNode;
|
|
13
|
+
moreType?: 'button' | 'link';
|
|
13
14
|
buttonSize?: ButtonSize;
|
|
14
15
|
}
|
|
15
|
-
declare const _default: ({ size, children, dropDownPlacement, shouldVisible, shouldDisabled, enableLoading, moreText, buttonSize, }: GroupProps) =>
|
|
16
|
+
declare const _default: ({ prefixCls: customizePrefixCls, size, children, dropDownPlacement, shouldVisible, shouldDisabled, enableLoading, moreText, moreType, buttonSize, }: GroupProps) => React.JSX.Element;
|
|
16
17
|
export default _default;
|