@oceanbase/ui 1.0.0-alpha.1 → 1.0.0-alpha.3
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/style/index.d.ts +2 -2
- package/es/DateRanger/Ranger.d.ts +4 -0
- package/es/DateRanger/Ranger.js +158 -14
- package/es/DateRanger/constant/index.js +1 -1
- package/es/DateRanger/index.less +23 -0
- package/es/FooterToolbar/style/index.d.ts +0 -2
- package/es/FooterToolbar/style/index.js +0 -12
- package/es/PageContainer/index.js +14 -4
- package/es/PageContainer/style/index.js +5 -7
- package/es/ProCard/index.js +11 -3
- package/es/ProCard/style/index.d.ts +2 -2
- package/es/ProCard/style/index.js +6 -3
- package/es/ProTable/index.d.ts +1 -1
- package/es/ProTable/index.js +11 -5
- package/es/ProTable/style/index.d.ts +2 -2
- package/es/ProTable/style/index.js +6 -3
- package/lib/Action/Group.js +57 -46
- package/lib/Action/Item.js +14 -9
- package/lib/Action/style/index.d.ts +2 -2
- package/lib/BackgroundTaskManager/RefreshMan.js +3 -12
- package/lib/BackgroundTaskManager/index.js +3 -12
- package/lib/BasicLayout/Header.js +120 -62
- package/lib/BasicLayout/index.js +166 -143
- package/lib/BatchOperationBar/index.js +59 -44
- package/lib/Boundary/Components/Code.js +11 -5
- package/lib/Boundary/Components/Exception.js +33 -23
- package/lib/Boundary/Components/Function.js +11 -5
- package/lib/ContentWithIcon/index.js +30 -22
- package/lib/ContentWithQuestion/index.js +8 -3
- package/lib/DateRanger/PickerPanel.js +235 -217
- package/lib/DateRanger/Ranger.d.ts +4 -0
- package/lib/DateRanger/Ranger.js +396 -227
- package/lib/DateRanger/constant/index.js +1 -1
- package/lib/DateRanger/index.less +23 -0
- package/lib/Dialog/Anchor.js +8 -5
- package/lib/Dialog/EventProxy.js +3 -12
- package/lib/Dialog/index.js +132 -108
- package/lib/DocDialog/index.js +3 -2
- package/lib/FooterToolbar/index.js +3 -2
- package/lib/FooterToolbar/style/index.d.ts +0 -2
- package/lib/FooterToolbar/style/index.js +0 -17
- package/lib/FullscreenBox/index.js +16 -7
- package/lib/GraphToolbar/index.js +70 -58
- package/lib/Highlight/DiffView/DiffCells.js +17 -10
- package/lib/Highlight/DiffView/index.js +35 -31
- package/lib/Highlight/HighlightCell.js +13 -10
- package/lib/Highlight/JsonView.js +15 -14
- package/lib/Highlight/index.js +50 -45
- package/lib/IconFont/index.js +2 -12
- package/lib/LightFilter/index.js +3 -2
- package/lib/LocaleDropdown/index.js +13 -20
- package/lib/Login/ActivateForm.js +53 -60
- package/lib/Login/LoginForm.js +118 -109
- package/lib/Login/RegisterForm.js +79 -86
- package/lib/Login/index.js +92 -64
- package/lib/NavMenu/index.js +9 -8
- package/lib/PageContainer/ItemRender.js +5 -5
- package/lib/PageContainer/index.js +17 -6
- package/lib/PageContainer/style/index.js +5 -6
- package/lib/PageLoading/index.js +6 -16
- package/lib/Password/Content.js +38 -42
- package/lib/Password/index.js +83 -68
- package/lib/ProCard/index.js +6 -3
- package/lib/ProCard/style/index.d.ts +2 -2
- package/lib/ProCard/style/index.js +6 -2
- package/lib/ProTable/index.d.ts +1 -1
- package/lib/ProTable/index.js +19 -8
- package/lib/ProTable/style/index.d.ts +2 -2
- package/lib/ProTable/style/index.js +7 -1
- package/lib/Ranger/QuickPicker.js +24 -15
- package/lib/Ranger/Ranger.js +37 -34
- package/lib/SideTip/Dragger.js +5 -4
- package/lib/SideTip/IconLoading.js +25 -25
- package/lib/SideTip/index.js +19 -10
- package/lib/TagSelect/Group.js +9 -5
- package/lib/TagSelect/Item.js +22 -18
- package/lib/TaskGraph/Graph.js +29 -24
- package/lib/TaskGraph/index.js +56 -50
- package/lib/TreeSearch/index.js +30 -35
- package/lib/Welcome/index.js +64 -37
- package/lib/Welcome/step.js +11 -4
- package/lib/locale/LocaleWrapper.js +15 -14
- package/package.json +4 -4
package/lib/Password/Content.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
5
|
var __export = (target, all) => {
|
|
8
6
|
for (var name in all)
|
|
@@ -16,14 +14,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
14
|
}
|
|
17
15
|
return to;
|
|
18
16
|
};
|
|
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
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
18
|
|
|
29
19
|
// src/Password/Content.tsx
|
|
@@ -34,14 +24,14 @@ __export(Content_exports, {
|
|
|
34
24
|
module.exports = __toCommonJS(Content_exports);
|
|
35
25
|
var import_icons = require("@oceanbase/icons");
|
|
36
26
|
var import_design = require("@oceanbase/design");
|
|
37
|
-
var import_react = __toESM(require("react"));
|
|
38
27
|
var import_design2 = require("@oceanbase/design");
|
|
28
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
29
|
var Content = ({ rules, fieldError, isValidating, value, isTouched }) => {
|
|
40
30
|
const { token } = import_design2.theme.useToken();
|
|
41
31
|
const statusIconMap = {
|
|
42
|
-
error: /* @__PURE__ */
|
|
43
|
-
success: /* @__PURE__ */
|
|
44
|
-
wait: /* @__PURE__ */
|
|
32
|
+
error: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CloseCircleFilled, { style: { color: token.colorError } }),
|
|
33
|
+
success: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CheckCircleFilled, { style: { color: token.colorSuccess } }),
|
|
34
|
+
wait: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
45
35
|
"div",
|
|
46
36
|
{
|
|
47
37
|
style: {
|
|
@@ -49,19 +39,19 @@ var Content = ({ rules, fieldError, isValidating, value, isTouched }) => {
|
|
|
49
39
|
alignItems: "center",
|
|
50
40
|
justifyContent: "center",
|
|
51
41
|
height: token.fontSize * token.lineHeight
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
42
|
+
},
|
|
43
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
style: {
|
|
47
|
+
width: 8,
|
|
48
|
+
height: 8,
|
|
49
|
+
backgroundColor: token.colorFillSecondary,
|
|
50
|
+
borderRadius: "50%"
|
|
51
|
+
}
|
|
62
52
|
}
|
|
63
|
-
|
|
64
|
-
|
|
53
|
+
)
|
|
54
|
+
}
|
|
65
55
|
)
|
|
66
56
|
};
|
|
67
57
|
const isRequireFail = rules.filter((rule) => !rule.optional).filter((rule) => fieldError.includes(rule.message)).length > 0;
|
|
@@ -78,21 +68,27 @@ var Content = ({ rules, fieldError, isValidating, value, isTouched }) => {
|
|
|
78
68
|
} else {
|
|
79
69
|
strokeColor = token.colorSuccess;
|
|
80
70
|
}
|
|
81
|
-
return /* @__PURE__ */
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
status =
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
71
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
72
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Progress, { percent: value ? percent : 0, strokeColor, showInfo: false }),
|
|
73
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { style: { margin: 0, marginTop: "10px", listStyle: "none", padding: "0" }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Space, { size: 4, direction: "vertical", children: rules == null ? void 0 : rules.map((rule) => {
|
|
74
|
+
const isError = fieldError.includes(rule.message);
|
|
75
|
+
let status = "wait";
|
|
76
|
+
if (isError) {
|
|
77
|
+
status = rule.optional ? "wait" : "error";
|
|
78
|
+
} else {
|
|
79
|
+
status = "success";
|
|
80
|
+
}
|
|
81
|
+
if (!value) {
|
|
82
|
+
status = "error";
|
|
83
|
+
}
|
|
84
|
+
if (!isTouched) {
|
|
85
|
+
status = "wait";
|
|
86
|
+
}
|
|
87
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_design.Space, { size: status === "wait" ? 14 : 8, align: "start", children: [
|
|
88
|
+
isValidating ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.LoadingOutlined, {}) : statusIconMap[status],
|
|
89
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: rule.message })
|
|
90
|
+
] }) }, `${rule.message}`);
|
|
91
|
+
}) }) })
|
|
92
|
+
] });
|
|
97
93
|
};
|
|
98
94
|
var Content_default = Content;
|
package/lib/Password/index.js
CHANGED
|
@@ -34,12 +34,13 @@ __export(Password_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(Password_exports);
|
|
35
35
|
var import_design = require("@oceanbase/design");
|
|
36
36
|
var import_randexp = __toESM(require("randexp"));
|
|
37
|
-
var import_react =
|
|
37
|
+
var import_react = require("react");
|
|
38
38
|
var import_design2 = require("@oceanbase/design");
|
|
39
39
|
var import_icons = require("@oceanbase/icons");
|
|
40
40
|
var import_LocaleWrapper = __toESM(require("../locale/LocaleWrapper"));
|
|
41
41
|
var import_Content = __toESM(require("./Content"));
|
|
42
42
|
var import_zh_CN = __toESM(require("./locale/zh-CN"));
|
|
43
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
43
44
|
var Password = ({
|
|
44
45
|
value,
|
|
45
46
|
locale,
|
|
@@ -95,81 +96,95 @@ var Password = ({
|
|
|
95
96
|
}
|
|
96
97
|
return getRandomPassword();
|
|
97
98
|
};
|
|
98
|
-
return /* @__PURE__ */
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
placement: "right",
|
|
103
|
-
popupAlign: {
|
|
104
|
-
offset: [48, 0]
|
|
105
|
-
},
|
|
106
|
-
content: /* @__PURE__ */ import_react.default.createElement(
|
|
107
|
-
import_Content.default,
|
|
99
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
100
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { display: "flex" }, children: [
|
|
101
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
102
|
+
import_design.Popover,
|
|
108
103
|
{
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
104
|
+
trigger: "click",
|
|
105
|
+
placement: "right",
|
|
106
|
+
popupAlign: {
|
|
107
|
+
offset: [48, 0]
|
|
108
|
+
},
|
|
109
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
110
|
+
import_Content.default,
|
|
111
|
+
{
|
|
112
|
+
isTouched,
|
|
113
|
+
value,
|
|
114
|
+
isValidating,
|
|
115
|
+
rules: newRules,
|
|
116
|
+
fieldError
|
|
117
|
+
}
|
|
118
|
+
),
|
|
119
|
+
overlayStyle: { maxWidth: 400 },
|
|
120
|
+
overlayInnerStyle: {
|
|
121
|
+
padding: `${token.padding / 2}px ${token.padding}px ${token.padding}px ${token.padding}px`
|
|
122
|
+
},
|
|
123
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
124
|
+
import_design.Input.Password,
|
|
125
|
+
{
|
|
126
|
+
value,
|
|
127
|
+
autoComplete: "new-password",
|
|
128
|
+
onChange: (e) => {
|
|
129
|
+
var _a;
|
|
130
|
+
handleChange((_a = e == null ? void 0 : e.target) == null ? void 0 : _a.value);
|
|
131
|
+
},
|
|
132
|
+
placeholder: generatePasswordRegex ? locale.generatePlaceholder : locale.placeholder,
|
|
133
|
+
...restProps
|
|
134
|
+
}
|
|
135
|
+
)
|
|
114
136
|
}
|
|
115
137
|
),
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
handleChange((_a = e == null ? void 0 : e.target) == null ? void 0 : _a.value);
|
|
129
|
-
},
|
|
130
|
-
placeholder: generatePasswordRegex ? locale.generatePlaceholder : locale.placeholder,
|
|
131
|
-
...restProps
|
|
132
|
-
}
|
|
133
|
-
)
|
|
134
|
-
), generatePasswordRegex && /* @__PURE__ */ import_react.default.createElement(
|
|
135
|
-
import_design.Button,
|
|
136
|
-
{
|
|
137
|
-
onClick: () => {
|
|
138
|
-
if (generatePassword instanceof Function) {
|
|
139
|
-
handleChange(generatePassword());
|
|
140
|
-
} else {
|
|
141
|
-
handleChange(getRandomPassword());
|
|
138
|
+
generatePasswordRegex && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
139
|
+
import_design.Button,
|
|
140
|
+
{
|
|
141
|
+
onClick: () => {
|
|
142
|
+
if (generatePassword instanceof Function) {
|
|
143
|
+
handleChange(generatePassword());
|
|
144
|
+
} else {
|
|
145
|
+
handleChange(getRandomPassword());
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
style: { marginLeft: 8 },
|
|
149
|
+
children: locale.randomlyGenerate
|
|
142
150
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
)), value && (fieldError == null ? void 0 : fieldError.length) === 0 && /* @__PURE__ */ import_react.default.createElement(
|
|
148
|
-
"div",
|
|
149
|
-
{
|
|
150
|
-
style: {
|
|
151
|
-
fontSize: 14,
|
|
152
|
-
color: token.colorTextTertiary,
|
|
153
|
-
lineHeight: "22px",
|
|
154
|
-
marginTop: token.marginXXS
|
|
155
|
-
}
|
|
156
|
-
},
|
|
157
|
-
locale.pleaseRememberYourPassword,
|
|
158
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
159
|
-
import_design.Typography.Text,
|
|
151
|
+
)
|
|
152
|
+
] }),
|
|
153
|
+
value && (fieldError == null ? void 0 : fieldError.length) === 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
154
|
+
"div",
|
|
160
155
|
{
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
],
|
|
167
|
-
tooltips: ["", locale.copySuccessfully]
|
|
156
|
+
style: {
|
|
157
|
+
fontSize: 14,
|
|
158
|
+
color: token.colorTextTertiary,
|
|
159
|
+
lineHeight: "22px",
|
|
160
|
+
marginTop: token.marginXXS
|
|
168
161
|
},
|
|
169
|
-
|
|
162
|
+
children: [
|
|
163
|
+
locale.pleaseRememberYourPassword,
|
|
164
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
165
|
+
import_design.Typography.Text,
|
|
166
|
+
{
|
|
167
|
+
copyable: {
|
|
168
|
+
text: value,
|
|
169
|
+
icon: [
|
|
170
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_design.Space, { size: token.marginXXS, children: [
|
|
171
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CopyOutlined, {}),
|
|
172
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", { children: locale.copyPassword })
|
|
173
|
+
] }, "copy"),
|
|
174
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_design.Space, { size: token.marginXXS, children: [
|
|
175
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CheckOutlined, {}),
|
|
176
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", { children: locale.copyPassword })
|
|
177
|
+
] }, "copy-success")
|
|
178
|
+
],
|
|
179
|
+
tooltips: ["", locale.copySuccessfully]
|
|
180
|
+
},
|
|
181
|
+
style: { marginLeft: token.marginXS }
|
|
182
|
+
}
|
|
183
|
+
)
|
|
184
|
+
]
|
|
170
185
|
}
|
|
171
186
|
)
|
|
172
|
-
)
|
|
187
|
+
] });
|
|
173
188
|
};
|
|
174
189
|
var Password_default = (0, import_LocaleWrapper.default)({
|
|
175
190
|
componentName: "Password",
|
package/lib/ProCard/index.js
CHANGED
|
@@ -32,14 +32,16 @@ __export(ProCard_exports, {
|
|
|
32
32
|
default: () => ProCard_default
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(ProCard_exports);
|
|
35
|
-
var import_react =
|
|
35
|
+
var import_react = require("react");
|
|
36
36
|
var import_pro_components = require("@ant-design/pro-components");
|
|
37
37
|
var import_design = require("@oceanbase/design");
|
|
38
38
|
var import_util = require("@oceanbase/design/es/_util");
|
|
39
39
|
var import_icons = require("@oceanbase/icons");
|
|
40
40
|
var import_classnames = __toESM(require("classnames"));
|
|
41
41
|
var import_style = __toESM(require("./style"));
|
|
42
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
43
|
var ProCard = ({
|
|
44
|
+
loading,
|
|
43
45
|
bordered,
|
|
44
46
|
ghost,
|
|
45
47
|
title,
|
|
@@ -71,9 +73,10 @@ var ProCard = ({
|
|
|
71
73
|
className
|
|
72
74
|
);
|
|
73
75
|
return wrapSSR(
|
|
74
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
75
77
|
import_pro_components.ProCard,
|
|
76
78
|
{
|
|
79
|
+
loading: loading === true ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Skeleton, { active: true, title: false, paragraph: { rows: 4 } }) : loading,
|
|
77
80
|
prefixCls: customizePrefixCls,
|
|
78
81
|
bordered: bordered ?? ((contextCard == null ? void 0 : contextCard.variant) ? (contextCard == null ? void 0 : contextCard.variant) === "outlined" : void 0),
|
|
79
82
|
ghost,
|
|
@@ -90,7 +93,7 @@ var ProCard = ({
|
|
|
90
93
|
...style
|
|
91
94
|
},
|
|
92
95
|
collapsibleIconRender: ({ collapsed }) => {
|
|
93
|
-
return /* @__PURE__ */
|
|
96
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
94
97
|
import_icons.CaretRightFilled,
|
|
95
98
|
{
|
|
96
99
|
className: `${iconPrefixCls} ${iconPrefixCls}-right ${prefixCls}-collapsible-icon`,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
2
|
+
import type { CSSObject } from '@ant-design/cssinjs';
|
|
3
3
|
import type { OBToken } from '../../_util/genComponentStyleHook';
|
|
4
|
-
export declare const genProCardStyle:
|
|
4
|
+
export declare const genProCardStyle: (token: OBToken, outerComponentCls?: string) => CSSObject;
|
|
5
5
|
declare const _default: (prefixCls: string) => {
|
|
6
6
|
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").JSX.Element;
|
|
7
7
|
hashId: string;
|
|
@@ -25,8 +25,9 @@ __export(style_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(style_exports);
|
|
26
26
|
var import_design = require("@oceanbase/design");
|
|
27
27
|
var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
|
|
28
|
-
var genProCardStyle = (token) => {
|
|
29
|
-
const { componentCls, antCls, prefixCls } = token;
|
|
28
|
+
var genProCardStyle = (token, outerComponentCls) => {
|
|
29
|
+
const { componentCls: innerComponentCls, antCls, prefixCls } = token;
|
|
30
|
+
const componentCls = outerComponentCls || innerComponentCls;
|
|
30
31
|
const tableComponentCls = `${antCls}-table`;
|
|
31
32
|
const tabsComponentCls = `${antCls}-tabs`;
|
|
32
33
|
const tabsPrefixCls = `${prefixCls}-tabs`;
|
|
@@ -36,6 +37,9 @@ var genProCardStyle = (token) => {
|
|
|
36
37
|
[`div${componentCls}`]: {
|
|
37
38
|
borderRadius: token.borderRadiusLG
|
|
38
39
|
},
|
|
40
|
+
[`${componentCls}${componentCls}-border`]: {
|
|
41
|
+
border: `${token.lineWidth}px solid ${token.colorBorderSecondary}`
|
|
42
|
+
},
|
|
39
43
|
[`${componentCls}:not(${componentCls}-border):not(${componentCls}-ghost)`]: {
|
|
40
44
|
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)"
|
|
41
45
|
},
|
package/lib/ProTable/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { ProTableProps as AntProTableProps } from '@ant-design/pro-componen
|
|
|
3
3
|
export interface ProTableProps<T, U, ValueType> extends AntProTableProps<T, U, ValueType> {
|
|
4
4
|
innerBordered?: boolean;
|
|
5
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>>;
|
|
6
|
+
declare function ProTable<T, U, ValueType>({ form, headerTitle, options, optionsRender, toolbar, toolBarRender, size, bordered, innerBordered, cardBordered, 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
7
|
declare namespace ProTable {
|
|
8
8
|
var Summary;
|
|
9
9
|
}
|
package/lib/ProTable/index.js
CHANGED
|
@@ -32,13 +32,14 @@ __export(ProTable_exports, {
|
|
|
32
32
|
default: () => ProTable_default
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(ProTable_exports);
|
|
35
|
-
var import_react =
|
|
35
|
+
var import_react = require("react");
|
|
36
36
|
var import_pro_components = require("@ant-design/pro-components");
|
|
37
37
|
var import_design = require("@oceanbase/design");
|
|
38
38
|
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
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
43
|
function ProTable({
|
|
43
44
|
form,
|
|
44
45
|
headerTitle,
|
|
@@ -49,6 +50,7 @@ function ProTable({
|
|
|
49
50
|
size,
|
|
50
51
|
bordered,
|
|
51
52
|
innerBordered,
|
|
53
|
+
cardBordered,
|
|
52
54
|
expandable,
|
|
53
55
|
rowSelection,
|
|
54
56
|
pagination: customPagination,
|
|
@@ -60,7 +62,7 @@ function ProTable({
|
|
|
60
62
|
className,
|
|
61
63
|
...restProps
|
|
62
64
|
}) {
|
|
63
|
-
const { getPrefixCls } = (0, import_react.useContext)(import_design.ConfigProvider.ConfigContext);
|
|
65
|
+
const { getPrefixCls, card: contextCard } = (0, import_react.useContext)(import_design.ConfigProvider.ConfigContext);
|
|
64
66
|
const tablePrefixCls = getPrefixCls("table", customizePrefixCls);
|
|
65
67
|
const { wrapSSR: tableWrapSSR } = import_design.Table.useStyle(tablePrefixCls);
|
|
66
68
|
const pagination = import_design.Table.useDefaultPagination(customPagination);
|
|
@@ -78,18 +80,23 @@ function ProTable({
|
|
|
78
80
|
const prefixCls = getPrefixCls("pro-table", customizePrefixCls);
|
|
79
81
|
const { wrapSSR } = (0, import_style2.default)(prefixCls);
|
|
80
82
|
const proTableCls = (0, import_classnames.default)(className);
|
|
81
|
-
const { emptyText = /* @__PURE__ */
|
|
82
|
-
const cardProps =
|
|
83
|
+
const { emptyText = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Empty, { image: import_design.Empty.PRESENTED_IMAGE_SIMPLE }), ...restLocale } = locale || {};
|
|
84
|
+
const cardProps = (0, import_lodash.merge)(
|
|
85
|
+
{},
|
|
86
|
+
contextCard,
|
|
87
|
+
typeof outerCardProps === "boolean" ? {} : outerCardProps
|
|
88
|
+
);
|
|
83
89
|
const proCardCls = getPrefixCls("pro-card", customizePrefixCls);
|
|
84
90
|
return tableWrapSSR(
|
|
85
91
|
lightFilterWrapSSR(
|
|
86
92
|
wrapSSR(
|
|
87
|
-
/* @__PURE__ */
|
|
93
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
88
94
|
import_pro_components.ProTable,
|
|
89
95
|
{
|
|
90
96
|
defaultSize: "large",
|
|
91
97
|
size,
|
|
92
98
|
bordered: bordered || innerBordered,
|
|
99
|
+
cardBordered: cardBordered ?? ((contextCard == null ? void 0 : contextCard.variant) ? (contextCard == null ? void 0 : contextCard.variant) === "outlined" : void 0),
|
|
93
100
|
form: {
|
|
94
101
|
// query form should remove required mark
|
|
95
102
|
requiredMark: false,
|
|
@@ -105,12 +112,16 @@ function ProTable({
|
|
|
105
112
|
className: (0, import_classnames.default)(
|
|
106
113
|
{
|
|
107
114
|
[`${proCardCls}-has-title`]: !!headerTitle || options || options === void 0 || optionsRender || toolbar || toolBarRender,
|
|
108
|
-
[`${proCardCls}-no-divider`]: !(cardProps == null ? void 0 : cardProps.headerBordered),
|
|
115
|
+
[`${proCardCls}-no-divider`]: !(cardProps == null ? void 0 : cardProps.headerBordered) && !(cardProps == null ? void 0 : cardProps.divided),
|
|
109
116
|
[`${proCardCls}-no-padding`]: true,
|
|
110
117
|
[`${proCardCls}-contain-tabs`]: !!(cardProps == null ? void 0 : cardProps.tabs)
|
|
111
118
|
},
|
|
112
119
|
cardProps == null ? void 0 : cardProps.className
|
|
113
|
-
)
|
|
120
|
+
),
|
|
121
|
+
bodyStyle: {
|
|
122
|
+
paddingBlock: 0,
|
|
123
|
+
...cardProps == null ? void 0 : cardProps.bodyStyle
|
|
124
|
+
}
|
|
114
125
|
},
|
|
115
126
|
expandable: expandable ? {
|
|
116
127
|
columnWidth: !size || size === "large" ? 40 : 32,
|
|
@@ -121,7 +132,7 @@ function ProTable({
|
|
|
121
132
|
footer,
|
|
122
133
|
locale: {
|
|
123
134
|
...restLocale,
|
|
124
|
-
emptyText: /* @__PURE__ */
|
|
135
|
+
emptyText: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${tablePrefixCls}-empty-wrapper`, children: typeof emptyText === "function" ? emptyText() : emptyText })
|
|
125
136
|
},
|
|
126
137
|
prefixCls: customizePrefixCls,
|
|
127
138
|
tableClassName: tableCls,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
2
|
+
import type { CSSObject } from '@ant-design/cssinjs';
|
|
3
3
|
import type { OBToken } from '../../_util/genComponentStyleHook';
|
|
4
|
-
export declare const genProTableStyle:
|
|
4
|
+
export declare const genProTableStyle: (token: OBToken) => CSSObject;
|
|
5
5
|
declare const _default: (prefixCls: string) => {
|
|
6
6
|
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").JSX.Element;
|
|
7
7
|
hashId: string;
|
|
@@ -25,6 +25,7 @@ __export(style_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(style_exports);
|
|
26
26
|
var import_design = require("@oceanbase/design");
|
|
27
27
|
var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
|
|
28
|
+
var import_style = require("../../ProCard/style");
|
|
28
29
|
var genProTableStyle = (token) => {
|
|
29
30
|
const { antCls, componentCls, proComponentsCls } = token;
|
|
30
31
|
const proCardComponentCls = `${proComponentsCls}-card`;
|
|
@@ -36,6 +37,10 @@ var genProTableStyle = (token) => {
|
|
|
36
37
|
flexDirection: "row-reverse"
|
|
37
38
|
}
|
|
38
39
|
},
|
|
40
|
+
// Remove nested ProCard box-shadow
|
|
41
|
+
[`& > ${proCardComponentCls}, ${proCardComponentCls}${componentCls}-search-light-filter`]: {
|
|
42
|
+
boxShadow: "none !important"
|
|
43
|
+
},
|
|
39
44
|
[`${proCardComponentCls}${proCardComponentCls}-no-padding`]: {
|
|
40
45
|
[`${proCardComponentCls}-body`]: {
|
|
41
46
|
paddingInline: 0,
|
|
@@ -48,7 +53,8 @@ var genProTableStyle = (token) => {
|
|
|
48
53
|
componentCls: proCardComponentCls
|
|
49
54
|
})
|
|
50
55
|
}
|
|
51
|
-
}
|
|
56
|
+
},
|
|
57
|
+
...(0, import_style.genProCardStyle)(token, proCardComponentCls)
|
|
52
58
|
};
|
|
53
59
|
};
|
|
54
60
|
var style_default = (prefixCls) => {
|
|
@@ -38,9 +38,10 @@ var import_classnames = __toESM(require("classnames"));
|
|
|
38
38
|
var import_dayjs = __toESM(require("dayjs"));
|
|
39
39
|
var import_lodash = require("lodash");
|
|
40
40
|
var import_moment = __toESM(require("moment"));
|
|
41
|
-
var import_react =
|
|
41
|
+
var import_react = require("react");
|
|
42
42
|
var import_util = require("../_util");
|
|
43
43
|
var import_constant = require("./constant");
|
|
44
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
44
45
|
var prefix = (0, import_util.getPrefix)("ranger-quick-picker");
|
|
45
46
|
var RangeDropdown = ({
|
|
46
47
|
selects,
|
|
@@ -50,19 +51,25 @@ var RangeDropdown = ({
|
|
|
50
51
|
locale = {},
|
|
51
52
|
...rest
|
|
52
53
|
}) => {
|
|
53
|
-
const menu = /* @__PURE__ */
|
|
54
|
+
const menu = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
54
55
|
import_design.Menu,
|
|
55
56
|
{
|
|
56
57
|
onClick: (e) => {
|
|
57
58
|
onChange(e.key);
|
|
58
59
|
},
|
|
59
|
-
style: { minWidth: 120 }
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
style: { minWidth: 120 },
|
|
61
|
+
children: [
|
|
62
|
+
selects.map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Menu.Item, { children: locale[item.name] || item.name }, item.name)),
|
|
63
|
+
customable && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Menu.Item, { children: locale.customize }, import_constant.CUSTOMIZE)
|
|
64
|
+
]
|
|
65
|
+
}
|
|
63
66
|
);
|
|
64
67
|
const match = selects.find((item) => item.name === value);
|
|
65
|
-
return /* @__PURE__ */
|
|
68
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Dropdown, { overlay: menu, ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_design.Space, { style: { cursor: "pointer" }, className: (0, import_classnames.default)(prefix, `${prefix}-dropdown`), children: [
|
|
69
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.ClockCircleOutlined, {}),
|
|
70
|
+
locale[match == null ? void 0 : match.name] || (match == null ? void 0 : match.name),
|
|
71
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.DownOutlined, {})
|
|
72
|
+
] }) });
|
|
66
73
|
};
|
|
67
74
|
var RangeSelect = ({
|
|
68
75
|
selects,
|
|
@@ -76,7 +83,7 @@ var RangeSelect = ({
|
|
|
76
83
|
const handleChange = (nextValue) => {
|
|
77
84
|
onChange(nextValue);
|
|
78
85
|
};
|
|
79
|
-
return /* @__PURE__ */
|
|
86
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
80
87
|
import_design.Select,
|
|
81
88
|
{
|
|
82
89
|
className: (0, import_classnames.default)(prefix, `${prefix}-select`),
|
|
@@ -84,12 +91,14 @@ var RangeSelect = ({
|
|
|
84
91
|
onSelect: handleChange,
|
|
85
92
|
value,
|
|
86
93
|
size,
|
|
87
|
-
...rest
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
94
|
+
...rest,
|
|
95
|
+
children: [
|
|
96
|
+
selects.map((item) => {
|
|
97
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Select.Option, { value: item.name, children: locale[item.name] || item.name }, item.name);
|
|
98
|
+
}),
|
|
99
|
+
customable && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Select.Option, { value: import_constant.CUSTOMIZE, children: locale.customize }, import_constant.CUSTOMIZE)
|
|
100
|
+
]
|
|
101
|
+
}
|
|
93
102
|
);
|
|
94
103
|
};
|
|
95
104
|
var QuickPicker_default = (props) => {
|
|
@@ -118,5 +127,5 @@ var QuickPicker_default = (props) => {
|
|
|
118
127
|
}
|
|
119
128
|
onNameChange(value);
|
|
120
129
|
};
|
|
121
|
-
return type === "select" ? /* @__PURE__ */
|
|
130
|
+
return type === "select" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RangeSelect, { value: innerName, selects, onChange: handleChange, ...rest }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RangeDropdown, { value: innerName, selects, onChange: handleChange, ...rest });
|
|
122
131
|
};
|