@oceanbase/design 1.0.0-alpha.2 → 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/design.min.js +1 -1
- package/es/_util/genComponentStyleHook.d.ts +2 -2
- package/es/_util/genComponentStyleHook.js +15 -2
- package/es/alert/style/index.d.ts +1 -1
- package/es/app/index.d.ts +8 -0
- package/es/app/index.js +36 -1
- package/es/app/style/index.d.ts +9 -0
- package/es/{_util/genStyle.js → app/style/index.js} +10 -11
- package/es/badge/style/index.d.ts +1 -1
- package/es/button/style/index.d.ts +1 -1
- package/es/card/style/index.d.ts +1 -1
- package/es/card/style/index.js +3 -3
- package/es/checkbox/style/index.d.ts +1 -1
- package/es/config-provider/context.d.ts +11 -0
- package/es/config-provider/context.js +2 -1
- package/es/config-provider/index.js +31 -32
- package/es/descriptions/hooks/useItems.d.ts +6 -6
- package/es/descriptions/style/index.d.ts +1 -1
- package/es/drawer/index.js +7 -5
- package/es/drawer/style/index.d.ts +1 -1
- package/es/drawer/style/index.js +11 -7
- package/es/empty/index.js +1 -1
- package/es/empty/style/index.d.ts +1 -1
- package/es/form/FormItem.d.ts +1 -1
- package/es/form/style/index.d.ts +1 -1
- package/es/index.d.ts +4 -2
- package/es/index.js +1 -0
- package/es/modal/style/index.d.ts +1 -1
- package/es/radio/style/index.d.ts +1 -1
- package/es/result/index.d.ts +2 -2
- package/es/result/index.js +5 -4
- package/es/result/style/index.d.ts +1 -1
- package/es/select/style/index.d.ts +1 -1
- package/es/slider/style/index.d.ts +1 -1
- package/es/space/style/index.d.ts +1 -1
- package/es/spin/style/index.d.ts +1 -1
- package/es/switch/style/index.d.ts +1 -1
- package/es/table/style/index.d.ts +1 -1
- package/es/tabs/style/index.d.ts +1 -1
- package/es/tag/style/index.d.ts +2 -4
- package/es/tag/style/index.js +14 -31
- package/es/theme/dark.d.ts +1 -48
- package/es/theme/default.d.ts +4 -2
- package/es/theme/default.js +52 -27
- package/es/theme/index.d.ts +20 -57
- package/es/theme/interface.d.ts +66 -0
- package/es/theme/interface.js +4 -1
- package/es/theme/style/aliyun.less +40 -40
- package/es/theme/style/compact.less +79 -72
- package/es/theme/style/dark.less +53 -53
- package/es/theme/style/default.less +79 -72
- package/es/tooltip/style/index.d.ts +1 -1
- package/es/tree-select/style/index.d.ts +1 -1
- package/lib/_util/genComponentStyleHook.d.ts +2 -2
- package/lib/_util/genComponentStyleHook.js +20 -4
- package/lib/alert/index.js +7 -6
- package/lib/alert/style/index.d.ts +1 -1
- package/lib/app/index.d.ts +8 -0
- package/lib/app/index.js +36 -1
- package/lib/app/style/index.d.ts +9 -0
- package/lib/{_util/getWeakenBorderColor.js → app/style/index.js} +20 -10
- package/lib/badge/index.js +21 -18
- package/lib/badge/style/index.d.ts +1 -1
- package/lib/button/index.js +2 -1
- package/lib/button/style/index.d.ts +1 -1
- package/lib/card/index.js +9 -5
- package/lib/card/style/index.d.ts +1 -1
- package/lib/card/style/index.js +4 -4
- package/lib/checkbox/index.js +2 -1
- package/lib/checkbox/style/index.d.ts +1 -1
- package/lib/config-provider/DefaultRenderEmpty.js +4 -3
- package/lib/config-provider/context.d.ts +11 -0
- package/lib/config-provider/index.js +36 -25
- package/lib/descriptions/hooks/useItems.d.ts +6 -6
- package/lib/descriptions/hooks/useItems.js +5 -4
- package/lib/descriptions/index.js +3 -2
- package/lib/descriptions/style/index.d.ts +1 -1
- package/lib/drawer/index.js +44 -33
- package/lib/drawer/style/index.d.ts +1 -1
- package/lib/drawer/style/index.js +11 -5
- package/lib/dropdown/dropdown-button.js +3 -13
- package/lib/dropdown/index.js +2 -2
- package/lib/empty/colored.js +413 -327
- package/lib/empty/database.js +267 -222
- package/lib/empty/default.js +16 -21
- package/lib/empty/guide.js +201 -184
- package/lib/empty/index.js +23 -18
- package/lib/empty/style/index.d.ts +1 -1
- package/lib/form/FormItem.d.ts +1 -1
- package/lib/form/FormItem.js +9 -5
- package/lib/form/index.js +6 -3
- package/lib/form/style/index.d.ts +1 -1
- package/lib/grid/col.js +2 -1
- package/lib/grid/row.js +2 -1
- package/lib/index.d.ts +4 -2
- package/lib/index.js +3 -0
- package/lib/input/Input.js +3 -2
- package/lib/input/Password.js +3 -2
- package/lib/input/Search.js +3 -2
- package/lib/input/TextArea.js +3 -2
- package/lib/input-number/index.js +2 -1
- package/lib/list/index.js +3 -2
- package/lib/lottie/index.js +2 -1
- package/lib/modal/Modal.js +7 -3
- package/lib/modal/Progress.js +9 -5
- package/lib/modal/style/index.d.ts +1 -1
- package/lib/radio/index.js +2 -1
- package/lib/radio/style/index.d.ts +1 -1
- package/lib/result/403.js +156 -121
- package/lib/result/404.js +328 -267
- package/lib/result/500.js +295 -257
- package/lib/result/Error.js +127 -99
- package/lib/result/Processing.js +246 -213
- package/lib/result/Success.js +233 -169
- package/lib/result/Warning.js +611 -515
- package/lib/result/index.d.ts +2 -2
- package/lib/result/index.js +12 -11
- package/lib/result/style/index.d.ts +1 -1
- package/lib/segmented/index.js +8 -4
- package/lib/select/index.js +2 -1
- package/lib/select/style/index.d.ts +1 -1
- package/lib/slider/index.js +2 -1
- package/lib/slider/style/index.d.ts +1 -1
- package/lib/space/index.js +2 -1
- package/lib/space/style/index.d.ts +1 -1
- package/lib/spin/index.js +5 -4
- package/lib/spin/style/index.d.ts +1 -1
- package/lib/switch/index.js +2 -1
- package/lib/switch/style/index.d.ts +1 -1
- package/lib/table/index.js +44 -31
- package/lib/table/style/index.d.ts +1 -1
- package/lib/tabs/index.js +10 -5
- package/lib/tabs/style/index.d.ts +1 -1
- package/lib/tag/index.js +9 -5
- package/lib/tag/style/index.d.ts +2 -4
- package/lib/tag/style/index.js +12 -27
- package/lib/theme/dark.d.ts +1 -48
- package/lib/theme/default.d.ts +4 -2
- package/lib/theme/default.js +60 -26
- package/lib/theme/index.d.ts +20 -57
- package/lib/theme/interface.d.ts +66 -0
- package/lib/theme/style/aliyun.less +40 -40
- package/lib/theme/style/compact.less +79 -72
- package/lib/theme/style/dark.less +53 -53
- package/lib/theme/style/default.less +79 -72
- package/lib/tooltip/MouseTooltip.js +43 -39
- package/lib/tooltip/ReactStickyMouseTooltip.js +5 -4
- package/lib/tooltip/index.js +14 -10
- package/lib/tooltip/style/index.d.ts +1 -1
- package/lib/tree-select/index.js +2 -1
- package/lib/tree-select/style/index.d.ts +1 -1
- package/lib/typography/Link.js +5 -4
- package/lib/typography/Paragraph.js +5 -4
- package/lib/typography/Text.js +5 -4
- package/lib/typography/Title.js +5 -4
- package/package.json +5 -4
- package/es/_util/genStyle.d.ts +0 -2
- package/es/_util/getWeakenBorderColor.d.ts +0 -1
- package/es/_util/getWeakenBorderColor.js +0 -4
- package/lib/_util/genStyle.d.ts +0 -2
- package/lib/_util/genStyle.js +0 -43
- package/lib/_util/getWeakenBorderColor.d.ts +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { CSSObject } from '@ant-design/cssinjs';
|
|
3
3
|
import type { ComponentTokenMap } from 'antd/es/theme/interface';
|
|
4
|
-
import type { FullToken, GenerateStyle } from '
|
|
5
|
-
|
|
4
|
+
import type { GlobalToken, FullToken, GenerateStyle } from '../theme/interface';
|
|
5
|
+
export declare const genSelectCommonStyle: (token: FullToken<'Select' | 'TreeSelect' | 'Cascader'>) => CSSObject;
|
|
6
6
|
export type ComponentName = keyof ComponentTokenMap;
|
|
7
7
|
export declare function genComponentStyleHook(componentName: ComponentName, styleFn: GenerateStyle<FullToken<ComponentName>>, getDefaultToken?: Partial<FullToken<ComponentName>> | ((token: GlobalToken) => Partial<FullToken<ComponentName>>)): (prefixCls: string) => {
|
|
8
8
|
wrapSSR: (node: React.ReactNode) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
@@ -29,17 +29,32 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
// src/_util/genComponentStyleHook.ts
|
|
30
30
|
var genComponentStyleHook_exports = {};
|
|
31
31
|
__export(genComponentStyleHook_exports, {
|
|
32
|
-
genComponentStyleHook: () => genComponentStyleHook
|
|
32
|
+
genComponentStyleHook: () => genComponentStyleHook,
|
|
33
|
+
genSelectCommonStyle: () => genSelectCommonStyle
|
|
33
34
|
});
|
|
34
35
|
module.exports = __toCommonJS(genComponentStyleHook_exports);
|
|
35
|
-
var import_internal = require("
|
|
36
|
+
var import_internal = require("../theme/internal");
|
|
36
37
|
var import_theme = __toESM(require("../theme"));
|
|
38
|
+
var genSelectCommonStyle = (token) => {
|
|
39
|
+
const { antCls } = token;
|
|
40
|
+
const selectComponentCls = `${antCls}-select`;
|
|
41
|
+
return {
|
|
42
|
+
[`${selectComponentCls}${selectComponentCls}-multiple`]: {
|
|
43
|
+
[`${selectComponentCls}-selection-item`]: {
|
|
44
|
+
borderRadius: token.borderRadius
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
};
|
|
37
49
|
function genComponentStyleHook(componentName, styleFn, getDefaultToken) {
|
|
38
50
|
return (prefixCls) => {
|
|
39
51
|
const useStyle = (0, import_internal.genComponentStyleHook)(
|
|
40
52
|
`OB-${componentName}`,
|
|
41
53
|
(token) => {
|
|
42
|
-
return [
|
|
54
|
+
return [
|
|
55
|
+
genSelectCommonStyle(token),
|
|
56
|
+
styleFn(token)
|
|
57
|
+
];
|
|
43
58
|
},
|
|
44
59
|
getDefaultToken,
|
|
45
60
|
{
|
|
@@ -60,5 +75,6 @@ function genComponentStyleHook(componentName, styleFn, getDefaultToken) {
|
|
|
60
75
|
}
|
|
61
76
|
// Annotate the CommonJS export names for ESM import in node:
|
|
62
77
|
0 && (module.exports = {
|
|
63
|
-
genComponentStyleHook
|
|
78
|
+
genComponentStyleHook,
|
|
79
|
+
genSelectCommonStyle
|
|
64
80
|
});
|
package/lib/alert/index.js
CHANGED
|
@@ -33,18 +33,19 @@ __export(alert_exports, {
|
|
|
33
33
|
default: () => alert_default
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(alert_exports);
|
|
36
|
-
var import_react =
|
|
36
|
+
var import_react = require("react");
|
|
37
37
|
var import_antd = require("antd");
|
|
38
38
|
var import_icons = require("@oceanbase/icons");
|
|
39
39
|
var import_classnames = __toESM(require("classnames"));
|
|
40
40
|
var import_config_provider = __toESM(require("../config-provider"));
|
|
41
41
|
var import_style = __toESM(require("./style"));
|
|
42
42
|
__reExport(alert_exports, require("antd/es/alert"), module.exports);
|
|
43
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
43
44
|
var iconMapOutlined = {
|
|
44
|
-
success: /* @__PURE__ */
|
|
45
|
-
info: /* @__PURE__ */
|
|
46
|
-
error: /* @__PURE__ */
|
|
47
|
-
warning: /* @__PURE__ */
|
|
45
|
+
success: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CheckCircleOutlined, {}),
|
|
46
|
+
info: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.InfoCircleOutlined, {}),
|
|
47
|
+
error: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CloseCircleOutlined, {}),
|
|
48
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.ExclamationCircleOutlined, {})
|
|
48
49
|
};
|
|
49
50
|
var Alert = ({
|
|
50
51
|
type,
|
|
@@ -65,7 +66,7 @@ var Alert = ({
|
|
|
65
66
|
className
|
|
66
67
|
);
|
|
67
68
|
return wrapSSR(
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
69
70
|
import_antd.Alert,
|
|
70
71
|
{
|
|
71
72
|
type,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { FullToken, GenerateStyle } from '
|
|
2
|
+
import type { FullToken, GenerateStyle } from '../../theme/interface';
|
|
3
3
|
export type AlertToken = FullToken<'Alert'>;
|
|
4
4
|
export declare const genAlertStyle: GenerateStyle<AlertToken>;
|
|
5
5
|
declare const _default: (prefixCls: string) => {
|
package/lib/app/index.d.ts
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { App as AntApp } from 'antd';
|
|
3
|
+
import type { AppProps } from 'antd/es/app';
|
|
1
4
|
export * from 'antd/es/app';
|
|
5
|
+
export type AppType = React.FC<AppProps> & {
|
|
6
|
+
useApp: typeof AntApp.useApp;
|
|
7
|
+
};
|
|
8
|
+
declare const App: AppType;
|
|
9
|
+
export default App;
|
package/lib/app/index.js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
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
|
+
};
|
|
5
11
|
var __copyProps = (to, from, except, desc) => {
|
|
6
12
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
13
|
for (let key of __getOwnPropNames(from))
|
|
@@ -11,12 +17,41 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
11
17
|
return to;
|
|
12
18
|
};
|
|
13
19
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
14
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
29
|
|
|
16
|
-
// src/app/index.
|
|
30
|
+
// src/app/index.tsx
|
|
17
31
|
var app_exports = {};
|
|
32
|
+
__export(app_exports, {
|
|
33
|
+
default: () => app_default
|
|
34
|
+
});
|
|
18
35
|
module.exports = __toCommonJS(app_exports);
|
|
36
|
+
var import_react = require("react");
|
|
37
|
+
var import_antd = require("antd");
|
|
38
|
+
var import_classnames = __toESM(require("classnames"));
|
|
39
|
+
var import_config_provider = __toESM(require("../config-provider"));
|
|
40
|
+
var import_style = __toESM(require("./style"));
|
|
19
41
|
__reExport(app_exports, require("antd/es/app"), module.exports);
|
|
42
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
43
|
+
var App = ({ prefixCls: customizePrefixCls, className, ...restProps }) => {
|
|
44
|
+
const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
|
|
45
|
+
const prefixCls = getPrefixCls("app", customizePrefixCls);
|
|
46
|
+
const { wrapSSR } = (0, import_style.default)(prefixCls);
|
|
47
|
+
const appCls = (0, import_classnames.default)(className);
|
|
48
|
+
return wrapSSR(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.App, { prefixCls: customizePrefixCls, className: appCls, ...restProps }));
|
|
49
|
+
};
|
|
50
|
+
App.useApp = import_antd.App.useApp;
|
|
51
|
+
if (process.env.NODE_ENV !== "production") {
|
|
52
|
+
App.displayName = import_antd.App.displayName;
|
|
53
|
+
}
|
|
54
|
+
var app_default = App;
|
|
20
55
|
// Annotate the CommonJS export names for ESM import in node:
|
|
21
56
|
0 && (module.exports = {
|
|
22
57
|
...require("antd/es/app")
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { FullToken, GenerateStyle } from '../../theme/interface';
|
|
3
|
+
export type AppToken = FullToken<'App'>;
|
|
4
|
+
export declare const genAppStyle: GenerateStyle<AppToken>;
|
|
5
|
+
declare const _default: (prefixCls: string) => {
|
|
6
|
+
wrapSSR: (node: import("react").ReactNode) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
7
|
+
hashId: string;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -16,17 +16,27 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
18
|
|
|
19
|
-
// src/
|
|
20
|
-
var
|
|
21
|
-
__export(
|
|
22
|
-
|
|
19
|
+
// src/app/style/index.ts
|
|
20
|
+
var style_exports = {};
|
|
21
|
+
__export(style_exports, {
|
|
22
|
+
default: () => style_default,
|
|
23
|
+
genAppStyle: () => genAppStyle
|
|
23
24
|
});
|
|
24
|
-
module.exports = __toCommonJS(
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
module.exports = __toCommonJS(style_exports);
|
|
26
|
+
var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
|
|
27
|
+
var genAppStyle = (token) => {
|
|
28
|
+
const { componentCls } = token;
|
|
29
|
+
return {
|
|
30
|
+
[`${componentCls}`]: {}
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
var style_default = (prefixCls) => {
|
|
34
|
+
const useStyle = (0, import_genComponentStyleHook.genComponentStyleHook)("App", (token) => {
|
|
35
|
+
return [genAppStyle(token)];
|
|
36
|
+
});
|
|
37
|
+
return useStyle(prefixCls);
|
|
38
|
+
};
|
|
29
39
|
// Annotate the CommonJS export names for ESM import in node:
|
|
30
40
|
0 && (module.exports = {
|
|
31
|
-
|
|
41
|
+
genAppStyle
|
|
32
42
|
});
|
package/lib/badge/index.js
CHANGED
|
@@ -40,14 +40,15 @@ var import_classnames = __toESM(require("classnames"));
|
|
|
40
40
|
var import_config_provider = __toESM(require("../config-provider"));
|
|
41
41
|
var import_style = __toESM(require("./style"));
|
|
42
42
|
__reExport(badge_exports, require("antd/es/badge"), module.exports);
|
|
43
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
43
44
|
var Badge = import_react.default.forwardRef(
|
|
44
45
|
({ prefixCls: customizePrefixCls, className, status, text, icon, ...restProps }, ref) => {
|
|
45
46
|
const { getPrefixCls, iconPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
|
|
46
47
|
const prefixCls = getPrefixCls("badge", customizePrefixCls);
|
|
47
48
|
const { wrapSSR, hashId } = (0, import_style.default)(prefixCls);
|
|
48
49
|
const iconMap = {
|
|
49
|
-
default: /* @__PURE__ */
|
|
50
|
-
processing: /* @__PURE__ */
|
|
50
|
+
default: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.MinusCircleFilled, { rotate: 45 }),
|
|
51
|
+
processing: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
51
52
|
import_icons.Loading3QuartersOutlined,
|
|
52
53
|
{
|
|
53
54
|
style: {
|
|
@@ -56,12 +57,12 @@ var Badge = import_react.default.forwardRef(
|
|
|
56
57
|
className: `${iconPrefixCls}-spin`
|
|
57
58
|
}
|
|
58
59
|
),
|
|
59
|
-
success: /* @__PURE__ */
|
|
60
|
-
error: /* @__PURE__ */
|
|
61
|
-
warning: /* @__PURE__ */
|
|
60
|
+
success: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CheckCircleFilled, {}),
|
|
61
|
+
error: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CloseCircleFilled, {}),
|
|
62
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.EllipsisCircleFilled, {})
|
|
62
63
|
};
|
|
63
64
|
return wrapSSR(
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: status && icon ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
65
66
|
"span",
|
|
66
67
|
{
|
|
67
68
|
ref,
|
|
@@ -69,17 +70,19 @@ var Badge = import_react.default.forwardRef(
|
|
|
69
70
|
style: {
|
|
70
71
|
display: "inline-block"
|
|
71
72
|
},
|
|
72
|
-
...restProps
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
73
|
+
...restProps,
|
|
74
|
+
children: [
|
|
75
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
76
|
+
"span",
|
|
77
|
+
{
|
|
78
|
+
className: (0, import_classnames.default)(`${prefixCls}-status-icon`, `${prefixCls}-status-${status}`),
|
|
79
|
+
children: import_react.default.isValidElement(icon) ? icon : iconMap[status]
|
|
80
|
+
}
|
|
81
|
+
),
|
|
82
|
+
text && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${prefixCls}-status-text`, children: text })
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
83
86
|
import_antd.Badge,
|
|
84
87
|
{
|
|
85
88
|
ref,
|
|
@@ -89,7 +92,7 @@ var Badge = import_react.default.forwardRef(
|
|
|
89
92
|
text,
|
|
90
93
|
...restProps
|
|
91
94
|
}
|
|
92
|
-
))
|
|
95
|
+
) })
|
|
93
96
|
);
|
|
94
97
|
}
|
|
95
98
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { FullToken, GenerateStyle } from '
|
|
2
|
+
import type { FullToken, GenerateStyle } from '../../theme/interface';
|
|
3
3
|
export type BadgeToken = FullToken<'Badge'>;
|
|
4
4
|
export declare const genBadgeStyle: GenerateStyle<BadgeToken>;
|
|
5
5
|
declare const _default: (prefixCls: string) => {
|
package/lib/button/index.js
CHANGED
|
@@ -39,6 +39,7 @@ var import_react = __toESM(require("react"));
|
|
|
39
39
|
var import_config_provider = __toESM(require("../config-provider"));
|
|
40
40
|
var import_style = __toESM(require("./style"));
|
|
41
41
|
__reExport(button_exports, require("antd/es/button"), module.exports);
|
|
42
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
43
|
var Button = import_react.default.forwardRef(
|
|
43
44
|
({ prefixCls: customizePrefixCls, className, ...restProps }, ref) => {
|
|
44
45
|
const { theme, getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
|
|
@@ -46,7 +47,7 @@ var Button = import_react.default.forwardRef(
|
|
|
46
47
|
const { wrapSSR } = (0, import_style.default)(prefixCls, theme == null ? void 0 : theme.isAliyun);
|
|
47
48
|
const buttonCls = (0, import_classnames.default)(className);
|
|
48
49
|
return wrapSSR(
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Button, { ref, prefixCls: customizePrefixCls, className: buttonCls, ...restProps })
|
|
50
51
|
);
|
|
51
52
|
}
|
|
52
53
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { FullToken, GenerateStyle } from '
|
|
2
|
+
import type { FullToken, GenerateStyle } from '../../theme/interface';
|
|
3
3
|
export type ButtonToken = FullToken<'Button'>;
|
|
4
4
|
export declare const genButtonStyle: GenerateStyle<ButtonToken>;
|
|
5
5
|
declare const _default: (prefixCls: string, isAliyun?: boolean) => {
|
package/lib/card/index.js
CHANGED
|
@@ -42,6 +42,7 @@ var import_util2 = require("../_util");
|
|
|
42
42
|
var import_style = __toESM(require("./style"));
|
|
43
43
|
__reExport(card_exports, require("antd/es/card/Card"), module.exports);
|
|
44
44
|
__reExport(card_exports, require("antd/es/card"), module.exports);
|
|
45
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
45
46
|
var Card = import_react.default.forwardRef(
|
|
46
47
|
({
|
|
47
48
|
children,
|
|
@@ -75,13 +76,16 @@ var Card = import_react.default.forwardRef(
|
|
|
75
76
|
if (!(0, import_util.isNullValue)(item.tag)) {
|
|
76
77
|
return {
|
|
77
78
|
...item,
|
|
78
|
-
tab: /* @__PURE__ */
|
|
79
|
+
tab: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd.Space, { size: 4, children: [
|
|
80
|
+
item.tab,
|
|
81
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Tag, { bordered: false, className: `${tabsPrefixCls}-tab-tag`, children: item.tag })
|
|
82
|
+
] })
|
|
79
83
|
};
|
|
80
84
|
}
|
|
81
85
|
return item;
|
|
82
86
|
});
|
|
83
87
|
return wrapSSR(
|
|
84
|
-
/* @__PURE__ */
|
|
88
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
85
89
|
import_antd.Card,
|
|
86
90
|
{
|
|
87
91
|
ref,
|
|
@@ -96,9 +100,9 @@ var Card = import_react.default.forwardRef(
|
|
|
96
100
|
bodyStyle,
|
|
97
101
|
styles,
|
|
98
102
|
className: cardCls,
|
|
99
|
-
...restProps
|
|
100
|
-
|
|
101
|
-
|
|
103
|
+
...restProps,
|
|
104
|
+
children
|
|
105
|
+
}
|
|
102
106
|
)
|
|
103
107
|
);
|
|
104
108
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { CSSObject } from '@ant-design/cssinjs';
|
|
3
|
-
import type { FullToken, GenerateStyle } from '
|
|
3
|
+
import type { FullToken, GenerateStyle } from '../../theme/interface';
|
|
4
4
|
export type CardToken = FullToken<'Card'> & {
|
|
5
5
|
tabsComponentCls: string;
|
|
6
6
|
tabsPrefixCls: string;
|
package/lib/card/style/index.js
CHANGED
|
@@ -63,12 +63,12 @@ var genCardStyle = (token) => {
|
|
|
63
63
|
[`${componentCls}:not(${componentCls}-bordered):not(${componentCls}-type-inner)`]: {
|
|
64
64
|
boxShadow: "none"
|
|
65
65
|
},
|
|
66
|
-
// nested Card
|
|
67
|
-
[`${componentCls}`]: {
|
|
66
|
+
// nested and bordered Card radius
|
|
67
|
+
[`${componentCls}${componentCls}-bordered`]: {
|
|
68
68
|
borderRadius: token.borderRadiusLG - 2,
|
|
69
|
-
[`${componentCls}`]: {
|
|
69
|
+
[`${componentCls}${componentCls}-bordered`]: {
|
|
70
70
|
borderRadius: token.borderRadius,
|
|
71
|
-
[`${componentCls}`]: {
|
|
71
|
+
[`${componentCls}${componentCls}-bordered`]: {
|
|
72
72
|
borderRadius: token.borderRadiusSM
|
|
73
73
|
}
|
|
74
74
|
}
|
package/lib/checkbox/index.js
CHANGED
|
@@ -39,6 +39,7 @@ var import_react = __toESM(require("react"));
|
|
|
39
39
|
var import_config_provider = __toESM(require("../config-provider"));
|
|
40
40
|
var import_style = __toESM(require("./style"));
|
|
41
41
|
__reExport(checkbox_exports, require("antd/es/checkbox"), module.exports);
|
|
42
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
43
|
var InternalCheckbox = import_react.default.forwardRef(
|
|
43
44
|
({ prefixCls: customizePrefixCls, className, ...restProps }, ref) => {
|
|
44
45
|
const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
|
|
@@ -46,7 +47,7 @@ var InternalCheckbox = import_react.default.forwardRef(
|
|
|
46
47
|
const { wrapSSR } = (0, import_style.default)(prefixCls);
|
|
47
48
|
const checkboxCls = (0, import_classnames.default)(className);
|
|
48
49
|
return wrapSSR(
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
50
51
|
import_antd.Checkbox,
|
|
51
52
|
{
|
|
52
53
|
ref,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { FullToken, GenerateStyle } from '
|
|
2
|
+
import type { FullToken, GenerateStyle } from '../../theme/interface';
|
|
3
3
|
export type CheckboxToken = FullToken<'Checkbox'>;
|
|
4
4
|
export declare const genCheckboxStyle: GenerateStyle<CheckboxToken>;
|
|
5
5
|
declare const _default: (prefixCls: string) => {
|
|
@@ -32,9 +32,10 @@ __export(DefaultRenderEmpty_exports, {
|
|
|
32
32
|
default: () => DefaultRenderEmpty_default
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(DefaultRenderEmpty_exports);
|
|
35
|
-
var import_react =
|
|
35
|
+
var import_react = require("react");
|
|
36
36
|
var import__ = require(".");
|
|
37
37
|
var import_empty = __toESM(require("../empty"));
|
|
38
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
38
39
|
var DefaultRenderEmpty = (props) => {
|
|
39
40
|
const { componentName } = props;
|
|
40
41
|
const { getPrefixCls } = (0, import_react.useContext)(import__.ConfigContext);
|
|
@@ -45,9 +46,9 @@ var DefaultRenderEmpty = (props) => {
|
|
|
45
46
|
case "Cascader":
|
|
46
47
|
case "Transfer":
|
|
47
48
|
case "Mentions":
|
|
48
|
-
return /* @__PURE__ */
|
|
49
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_empty.default, { image: import_empty.default.PRESENTED_IMAGE_SIMPLE, className: `${prefix}-small` });
|
|
49
50
|
default:
|
|
50
|
-
return /* @__PURE__ */
|
|
51
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_empty.default, { image: import_empty.default.PRESENTED_IMAGE_SIMPLE });
|
|
51
52
|
}
|
|
52
53
|
};
|
|
53
54
|
var DefaultRenderEmpty_default = DefaultRenderEmpty;
|
|
@@ -1 +1,12 @@
|
|
|
1
|
+
import type { ThemeConfig as AntThemeConfig, MappingAlgorithm } from 'antd';
|
|
2
|
+
import type { AliasToken, OverrideToken } from '../theme/interface';
|
|
1
3
|
export * from 'antd/es/config-provider/context';
|
|
4
|
+
type ComponentsConfig = {
|
|
5
|
+
[key in keyof OverrideToken]?: OverrideToken[key] & {
|
|
6
|
+
algorithm?: boolean | MappingAlgorithm | MappingAlgorithm[];
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export interface ThemeConfig extends AntThemeConfig {
|
|
10
|
+
token?: Partial<AliasToken>;
|
|
11
|
+
components?: ComponentsConfig;
|
|
12
|
+
}
|
|
@@ -40,6 +40,7 @@ var import_StyleContext = __toESM(require("@ant-design/cssinjs/es/StyleContext")
|
|
|
40
40
|
var import_icons = require("@oceanbase/icons");
|
|
41
41
|
var import_aliyun_theme = __toESM(require("@oceanbase/aliyun-theme"));
|
|
42
42
|
var import_lodash = require("lodash");
|
|
43
|
+
var import_app = __toESM(require("../app"));
|
|
43
44
|
var import_static_function = __toESM(require("../static-function"));
|
|
44
45
|
var import_theme = __toESM(require("../theme"));
|
|
45
46
|
var import_default = __toESM(require("../theme/default"));
|
|
@@ -50,11 +51,15 @@ __reExport(config_provider_exports, require("antd/es/config-provider/context"),
|
|
|
50
51
|
__reExport(config_provider_exports, require("antd/es/config-provider/SizeContext"), module.exports);
|
|
51
52
|
__reExport(config_provider_exports, require("antd/es/config-provider/DisabledContext"), module.exports);
|
|
52
53
|
__reExport(config_provider_exports, require("antd/es/config-provider"), module.exports);
|
|
54
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
53
55
|
var ExtendedConfigContext = import_react.default.createContext({
|
|
54
56
|
navigate: void 0,
|
|
55
57
|
hideOnSinglePage: false,
|
|
56
58
|
injectStaticFunction: true
|
|
57
59
|
});
|
|
60
|
+
var getLocaleTokenValue = (locale, tokenKey, tokenValue, tokenValueEn) => {
|
|
61
|
+
return tokenValue !== import_default.default.token[tokenKey] ? { [tokenKey]: tokenValue } : ["en", "en-gb"].includes(locale.locale) ? { [tokenKey]: tokenValueEn } : {};
|
|
62
|
+
};
|
|
58
63
|
var ConfigProvider = ({
|
|
59
64
|
children,
|
|
60
65
|
theme,
|
|
@@ -71,7 +76,7 @@ var ConfigProvider = ({
|
|
|
71
76
|
appProps,
|
|
72
77
|
...restProps
|
|
73
78
|
}) => {
|
|
74
|
-
var _a, _b;
|
|
79
|
+
var _a, _b, _c, _d;
|
|
75
80
|
const parentContext = import_react.default.useContext(import_antd.ConfigProvider.ConfigContext);
|
|
76
81
|
const parentExtendedContext = import_react.default.useContext(ExtendedConfigContext);
|
|
77
82
|
const { isDark, isAliyun } = (0, import_lodash.merge)({}, parentContext.theme, theme);
|
|
@@ -85,10 +90,12 @@ var ConfigProvider = ({
|
|
|
85
90
|
);
|
|
86
91
|
const { token } = import_theme.default.useToken();
|
|
87
92
|
const fontFamily = ((_a = mergedTheme.token) == null ? void 0 : _a.fontFamily) || token.fontFamily;
|
|
93
|
+
const fontWeight = ((_b = mergedTheme.token) == null ? void 0 : _b.fontWeight) || token.fontWeight;
|
|
94
|
+
const fontWeightStrong = ((_c = mergedTheme.token) == null ? void 0 : _c.fontWeightStrong) || token.fontWeightStrong;
|
|
88
95
|
const parentStyleContext = import_react.default.useContext(import_StyleContext.default);
|
|
89
96
|
const mergedStyleProviderProps = (0, import_lodash.merge)({}, parentStyleContext, styleProviderProps);
|
|
90
97
|
const mergedLocale = (0, import_lodash.merge)({}, parentContext.locale, locale);
|
|
91
|
-
return /* @__PURE__ */
|
|
98
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
92
99
|
import_antd.ConfigProvider,
|
|
93
100
|
{
|
|
94
101
|
locale: mergedLocale,
|
|
@@ -96,7 +103,7 @@ var ConfigProvider = ({
|
|
|
96
103
|
collapse: (0, import_lodash.merge)(
|
|
97
104
|
{},
|
|
98
105
|
{
|
|
99
|
-
expandIcon: ({ isActive }) => /* @__PURE__ */
|
|
106
|
+
expandIcon: ({ isActive }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CaretRightOutlined, { rotate: isActive ? 90 : 0 })
|
|
100
107
|
},
|
|
101
108
|
parentContext.collapse,
|
|
102
109
|
collapse
|
|
@@ -113,31 +120,35 @@ var ConfigProvider = ({
|
|
|
113
120
|
table: (0, import_lodash.merge)({}, parentContext.table, table),
|
|
114
121
|
tabs: (0, import_lodash.merge)({}, parentContext.tabs, tabs),
|
|
115
122
|
theme: (0, import_lodash.merge)({}, mergedTheme, {
|
|
116
|
-
token:
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
+
token: {
|
|
124
|
+
...getLocaleTokenValue(mergedLocale, "fontFamily", fontFamily, import_default.fontFamilyEn),
|
|
125
|
+
...getLocaleTokenValue(mergedLocale, "fontWeight", fontWeight, import_default.fontWeightEn),
|
|
126
|
+
...getLocaleTokenValue(
|
|
127
|
+
mergedLocale,
|
|
128
|
+
"fontWeightStrong",
|
|
129
|
+
fontWeightStrong,
|
|
130
|
+
import_default.fontWeightStrongEn
|
|
123
131
|
)
|
|
124
|
-
|
|
132
|
+
}
|
|
125
133
|
}),
|
|
126
|
-
renderEmpty: parentContext.renderEmpty || ((componentName) => /* @__PURE__ */
|
|
127
|
-
...restProps
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
134
|
+
renderEmpty: parentContext.renderEmpty || ((componentName) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DefaultRenderEmpty.default, { componentName })),
|
|
135
|
+
...restProps,
|
|
136
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
137
|
+
ExtendedConfigContext.Provider,
|
|
138
|
+
{
|
|
139
|
+
value: {
|
|
140
|
+
navigate: navigate === void 0 ? parentExtendedContext.navigate : navigate,
|
|
141
|
+
hideOnSinglePage: ((_d = parentContext.pagination) == null ? void 0 : _d.showSizeChanger) ? false : hideOnSinglePage !== void 0 ? hideOnSinglePage : parentExtendedContext.hideOnSinglePage,
|
|
142
|
+
// inject static function to outermost ConfigProvider only
|
|
143
|
+
injectStaticFunction: false
|
|
144
|
+
},
|
|
145
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_cssinjs.StyleProvider, { ...mergedStyleProviderProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_app.default, { component: false, ...appProps, children: [
|
|
146
|
+
children,
|
|
147
|
+
parentExtendedContext.injectStaticFunction && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_static_function.default, {})
|
|
148
|
+
] }) })
|
|
137
149
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
)
|
|
150
|
+
)
|
|
151
|
+
}
|
|
141
152
|
);
|
|
142
153
|
};
|
|
143
154
|
ConfigProvider.ConfigContext = import_antd.ConfigProvider.ConfigContext;
|
|
@@ -5,17 +5,17 @@ export default function useItems(items?: DescriptionsItemType[], children?: Reac
|
|
|
5
5
|
key?: React.Key;
|
|
6
6
|
label?: React.ReactNode;
|
|
7
7
|
span?: number | "filled" | {
|
|
8
|
-
xxl?: number;
|
|
9
|
-
xl?: number;
|
|
10
|
-
lg?: number;
|
|
11
|
-
md?: number;
|
|
12
|
-
sm?: number;
|
|
13
8
|
xs?: number;
|
|
9
|
+
sm?: number;
|
|
10
|
+
md?: number;
|
|
11
|
+
lg?: number;
|
|
12
|
+
xl?: number;
|
|
13
|
+
xxl?: number;
|
|
14
14
|
};
|
|
15
15
|
style?: React.CSSProperties;
|
|
16
|
-
className?: string;
|
|
17
16
|
classNames?: Partial<Record<"label" | "content", string>>;
|
|
18
17
|
styles?: Partial<Record<"label" | "content", React.CSSProperties>>;
|
|
18
|
+
className?: string;
|
|
19
19
|
labelStyle?: React.CSSProperties;
|
|
20
20
|
contentStyle?: React.CSSProperties;
|
|
21
21
|
}[];
|
|
@@ -37,6 +37,7 @@ var import_warning = __toESM(require("antd/es/_util/warning"));
|
|
|
37
37
|
var import_toArray = __toESM(require("rc-util/lib/Children/toArray"));
|
|
38
38
|
var import_typography = __toESM(require("../../typography"));
|
|
39
39
|
var import_getEllipsisConfig = require("../../_util/getEllipsisConfig");
|
|
40
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
40
41
|
var children2Items = (children) => {
|
|
41
42
|
const childrenItems = (0, import_toArray.default)(children).map((node) => {
|
|
42
43
|
if (import_react.default.isValidElement(node)) {
|
|
@@ -63,7 +64,7 @@ function convertItem(props, bordered) {
|
|
|
63
64
|
return {
|
|
64
65
|
...restItemProps,
|
|
65
66
|
// 无边框并且子元素非 Typography 时外面包一层 Typography.Text,以实现自动省略
|
|
66
|
-
children: bordered || (itemChildrenType == null ? void 0 : itemChildrenType.__ANT_TYPOGRAPHY) ? itemChildren : /* @__PURE__ */
|
|
67
|
+
children: bordered || (itemChildrenType == null ? void 0 : itemChildrenType.__ANT_TYPOGRAPHY) ? itemChildren : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
67
68
|
import_typography.default.Text,
|
|
68
69
|
{
|
|
69
70
|
...restContentProps,
|
|
@@ -76,9 +77,9 @@ function convertItem(props, bordered) {
|
|
|
76
77
|
} : editable === true ? {
|
|
77
78
|
autoSize: false
|
|
78
79
|
} : editable
|
|
79
|
-
)
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
),
|
|
81
|
+
children: itemChildren
|
|
82
|
+
}
|
|
82
83
|
)
|
|
83
84
|
};
|
|
84
85
|
}
|