@oceanbase/design 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/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/badge/style/index.js +7 -10
- package/es/button/style/index.d.ts +1 -1
- package/es/card/index.js +5 -1
- package/es/card/style/index.d.ts +1 -1
- package/es/card/style/index.js +8 -2
- 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/descriptions/style/index.js +4 -2
- 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/table/style/index.js +1 -3
- package/es/tabs/style/index.d.ts +1 -1
- package/es/tabs/style/index.js +1 -2
- 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 +71 -35
- 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 +41 -41
- package/es/theme/style/compact.less +87 -80
- package/es/theme/style/dark.less +58 -58
- package/es/theme/style/default.less +89 -82
- 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/badge/style/index.js +6 -7
- package/lib/button/index.js +2 -1
- package/lib/button/style/index.d.ts +1 -1
- package/lib/card/index.js +14 -5
- package/lib/card/style/index.d.ts +1 -1
- package/lib/card/style/index.js +10 -0
- 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/descriptions/style/index.js +6 -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/table/style/index.js +2 -4
- package/lib/tabs/index.js +10 -5
- package/lib/tabs/style/index.d.ts +1 -1
- package/lib/tabs/style/index.js +1 -2
- 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 +79 -34
- package/lib/theme/index.d.ts +20 -57
- package/lib/theme/interface.d.ts +66 -0
- package/lib/theme/style/aliyun.less +41 -41
- package/lib/theme/style/compact.less +87 -80
- package/lib/theme/style/dark.less +58 -58
- package/lib/theme/style/default.less +89 -82
- 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 +8 -7
- 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
package/lib/card/index.js
CHANGED
|
@@ -42,12 +42,14 @@ 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,
|
|
48
49
|
size,
|
|
49
50
|
title,
|
|
50
51
|
tabList,
|
|
52
|
+
tabProps,
|
|
51
53
|
divided: outerDivided,
|
|
52
54
|
prefixCls: customizePrefixCls,
|
|
53
55
|
bodyStyle,
|
|
@@ -74,26 +76,33 @@ var Card = import_react.default.forwardRef(
|
|
|
74
76
|
if (!(0, import_util.isNullValue)(item.tag)) {
|
|
75
77
|
return {
|
|
76
78
|
...item,
|
|
77
|
-
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
|
+
] })
|
|
78
83
|
};
|
|
79
84
|
}
|
|
80
85
|
return item;
|
|
81
86
|
});
|
|
82
87
|
return wrapSSR(
|
|
83
|
-
/* @__PURE__ */
|
|
88
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
84
89
|
import_antd.Card,
|
|
85
90
|
{
|
|
86
91
|
ref,
|
|
87
92
|
size,
|
|
88
93
|
title,
|
|
89
94
|
tabList: newTabList,
|
|
95
|
+
tabProps: {
|
|
96
|
+
size: "middle",
|
|
97
|
+
...tabProps
|
|
98
|
+
},
|
|
90
99
|
prefixCls: customizePrefixCls,
|
|
91
100
|
bodyStyle,
|
|
92
101
|
styles,
|
|
93
102
|
className: cardCls,
|
|
94
|
-
...restProps
|
|
95
|
-
|
|
96
|
-
|
|
103
|
+
...restProps,
|
|
104
|
+
children
|
|
105
|
+
}
|
|
97
106
|
)
|
|
98
107
|
);
|
|
99
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
|
@@ -62,6 +62,16 @@ var genCardStyle = (token) => {
|
|
|
62
62
|
// nested Card style
|
|
63
63
|
[`${componentCls}:not(${componentCls}-bordered):not(${componentCls}-type-inner)`]: {
|
|
64
64
|
boxShadow: "none"
|
|
65
|
+
},
|
|
66
|
+
// nested and bordered Card radius
|
|
67
|
+
[`${componentCls}${componentCls}-bordered`]: {
|
|
68
|
+
borderRadius: token.borderRadiusLG - 2,
|
|
69
|
+
[`${componentCls}${componentCls}-bordered`]: {
|
|
70
|
+
borderRadius: token.borderRadius,
|
|
71
|
+
[`${componentCls}${componentCls}-bordered`]: {
|
|
72
|
+
borderRadius: token.borderRadiusSM
|
|
73
|
+
}
|
|
74
|
+
}
|
|
65
75
|
}
|
|
66
76
|
},
|
|
67
77
|
[`${componentCls}${componentCls}-no-divider`]: {
|
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
|
}
|
|
@@ -35,12 +35,13 @@ __export(descriptions_exports, {
|
|
|
35
35
|
module.exports = __toCommonJS(descriptions_exports);
|
|
36
36
|
var import_antd = require("antd");
|
|
37
37
|
var import_classnames = __toESM(require("classnames"));
|
|
38
|
-
var import_react =
|
|
38
|
+
var import_react = require("react");
|
|
39
39
|
var import_config_provider = __toESM(require("../config-provider"));
|
|
40
40
|
var import_Item = __toESM(require("./Item"));
|
|
41
41
|
var import_useItems = __toESM(require("./hooks/useItems"));
|
|
42
42
|
var import_style = __toESM(require("./style"));
|
|
43
43
|
__reExport(descriptions_exports, require("antd/es/descriptions"), module.exports);
|
|
44
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
44
45
|
var Descriptions = ({
|
|
45
46
|
children,
|
|
46
47
|
bordered,
|
|
@@ -61,7 +62,7 @@ var Descriptions = ({
|
|
|
61
62
|
});
|
|
62
63
|
const newItems = (0, import_useItems.default)(items, children, bordered);
|
|
63
64
|
return wrapSSR(
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
65
66
|
import_antd.Descriptions,
|
|
66
67
|
{
|
|
67
68
|
layout,
|
|
@@ -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
|
import type { DescriptionsProps } from '..';
|
|
5
5
|
export type DescriptionsToken = FullToken<'Alert'> & {
|
|
6
6
|
typographyPrefixCls: string;
|
|
@@ -29,7 +29,7 @@ var genVerticalStyle = (size, token) => {
|
|
|
29
29
|
const { componentCls } = token;
|
|
30
30
|
const paddingMap = {
|
|
31
31
|
default: {
|
|
32
|
-
paddingIn: token.
|
|
32
|
+
paddingIn: token.paddingXXS,
|
|
33
33
|
paddingOut: token.paddingLG
|
|
34
34
|
},
|
|
35
35
|
middle: {
|
|
@@ -54,6 +54,11 @@ var genVerticalStyle = (size, token) => {
|
|
|
54
54
|
[`& > th, & > td`]: {
|
|
55
55
|
paddingBottom: paddingConfig.paddingOut
|
|
56
56
|
}
|
|
57
|
+
},
|
|
58
|
+
[`${componentCls}-item`]: {
|
|
59
|
+
[`${componentCls}-item-label`]: {
|
|
60
|
+
fontSize: token.fontSizeSM
|
|
61
|
+
}
|
|
57
62
|
}
|
|
58
63
|
}
|
|
59
64
|
};
|
package/lib/drawer/index.js
CHANGED
|
@@ -43,9 +43,11 @@ var import_button = __toESM(require("../button"));
|
|
|
43
43
|
var import_en_US = __toESM(require("../locale/en-US"));
|
|
44
44
|
var import_style = __toESM(require("./style"));
|
|
45
45
|
__reExport(drawer_exports, require("antd/es/drawer"), module.exports);
|
|
46
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
46
47
|
var Drawer = ({
|
|
47
48
|
locale: customLocale,
|
|
48
49
|
children,
|
|
50
|
+
loading,
|
|
49
51
|
onOk,
|
|
50
52
|
onClose,
|
|
51
53
|
onCancel,
|
|
@@ -75,24 +77,25 @@ var Drawer = ({
|
|
|
75
77
|
const [contentElment, setContentElement] = (0, import_react.useState)(null);
|
|
76
78
|
(0, import_ahooks.useSize)(contentElment);
|
|
77
79
|
const scroll = (0, import_ahooks.useScroll)(contentElment);
|
|
78
|
-
const isScroll = (contentElment == null ? void 0 : contentElment.scrollHeight) !== (contentElment == null ? void 0 : contentElment.clientHeight);
|
|
79
|
-
const isStartScroll = scroll.top > 0;
|
|
80
|
-
const isTotalScroll = Math.abs(
|
|
80
|
+
const isScroll = !loading && (contentElment == null ? void 0 : contentElment.scrollHeight) !== (contentElment == null ? void 0 : contentElment.clientHeight);
|
|
81
|
+
const isStartScroll = !loading && scroll.top > 0;
|
|
82
|
+
const isTotalScroll = !loading && Math.abs(
|
|
81
83
|
((contentElment == null ? void 0 : contentElment.scrollHeight) || 0) - ((contentElment == null ? void 0 : contentElment.clientHeight) || 0) - ((contentElment == null ? void 0 : contentElment.scrollTop) || 0)
|
|
82
84
|
) < 1;
|
|
83
85
|
const handleCancel = onCancel || onClose;
|
|
84
86
|
const showFooter = !!(footer || onOk) && footer !== false && footer !== null;
|
|
85
87
|
const drawerCls = (0, import_classnames.default)(
|
|
86
|
-
prefixCls,
|
|
87
88
|
{
|
|
89
|
+
[`${prefixCls}-loading`]: loading,
|
|
88
90
|
[`${prefixCls}-with-footer`]: showFooter
|
|
89
91
|
},
|
|
90
92
|
rootClassName
|
|
91
93
|
);
|
|
92
94
|
return wrapSSR(
|
|
93
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
94
96
|
import_antd.Drawer,
|
|
95
97
|
{
|
|
98
|
+
loading,
|
|
96
99
|
destroyOnClose: true,
|
|
97
100
|
onClose: handleCancel,
|
|
98
101
|
rootClassName: drawerCls,
|
|
@@ -103,34 +106,42 @@ var Drawer = ({
|
|
|
103
106
|
})
|
|
104
107
|
},
|
|
105
108
|
styles: (0, import_lodash.omit)(styles, ["body", "footer"]),
|
|
106
|
-
...restProps
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
109
|
+
...restProps,
|
|
110
|
+
children: [
|
|
111
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
112
|
+
"div",
|
|
113
|
+
{
|
|
114
|
+
ref: (element) => {
|
|
115
|
+
setContentElement(element);
|
|
116
|
+
},
|
|
117
|
+
className: `${prefixCls}-body-content`,
|
|
118
|
+
style: {
|
|
119
|
+
...bodyStyle,
|
|
120
|
+
...styles == null ? void 0 : styles.body
|
|
121
|
+
},
|
|
122
|
+
children
|
|
123
|
+
}
|
|
124
|
+
),
|
|
125
|
+
showFooter && // footer className should not be `${prefixCls}-footer` to avoid conflicts with antd
|
|
126
|
+
// ref: https://github.com/ant-design/ant-design/blob/master/components/drawer/style/index.ts#L214
|
|
127
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
128
|
+
"div",
|
|
129
|
+
{
|
|
130
|
+
className: (0, import_classnames.default)(`${prefixCls}-footer-container`, {
|
|
131
|
+
[`${prefixCls}-footer-container-shadow`]: isScroll && !isTotalScroll
|
|
132
|
+
}),
|
|
133
|
+
style: styles == null ? void 0 : styles.footer,
|
|
134
|
+
children: (0, import_react.isValidElement)(footer) ? footer : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `${prefixCls}-footer-content`, children: [
|
|
135
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd.Space, { children: [
|
|
136
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.default, { onClick: onOk, type: "primary", loading: confirmLoading, ...okButtonProps, children: okText || (drawerLocale == null ? void 0 : drawerLocale.okText) }),
|
|
137
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.default, { onClick: handleCancel, children: cancelText || (drawerLocale == null ? void 0 : drawerLocale.cancelText) })
|
|
138
|
+
] }),
|
|
139
|
+
footerExtra
|
|
140
|
+
] })
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
]
|
|
144
|
+
}
|
|
134
145
|
)
|
|
135
146
|
);
|
|
136
147
|
};
|
|
@@ -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 DrawerToken = FullToken<'Drawer'>;
|
|
4
4
|
export declare const genDrawerStyle: GenerateStyle<DrawerToken>;
|
|
5
5
|
declare const _default: (prefixCls: string) => {
|
|
@@ -25,7 +25,8 @@ __export(style_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(style_exports);
|
|
26
26
|
var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
|
|
27
27
|
var genDrawerStyle = (token) => {
|
|
28
|
-
const { componentCls } = token;
|
|
28
|
+
const { componentCls, antCls } = token;
|
|
29
|
+
const contentPadding = `${token.paddingXS}px ${token.paddingLG}px ${token.paddingLG}px ${token.paddingLG}px`;
|
|
29
30
|
const boxShadowBottom = "0 2px 4px 0 rgba(54,69,99,0.04), 0 1px 6px -1px rgba(54,69,99,0.04), 0 1px 2px 0 rgba(54,69,99,0.06)";
|
|
30
31
|
const boxShadowTop = "0 -2px 4px 0 rgba(54,69,99,0.04), 0 -1px 6px -1px rgba(54,69,99,0.04), 0 -1px 2px 0 rgba(54,69,99,0.06)";
|
|
31
32
|
return {
|
|
@@ -33,7 +34,7 @@ var genDrawerStyle = (token) => {
|
|
|
33
34
|
// should be wrapped by `${componentCls}-content` to overwritten antd style
|
|
34
35
|
[`${componentCls}-content`]: {
|
|
35
36
|
[`${componentCls}-header`]: {
|
|
36
|
-
padding:
|
|
37
|
+
padding: `${token.padding}px ${token.paddingLG}px`,
|
|
37
38
|
borderBottom: "none",
|
|
38
39
|
transition: `box-shadow ${token.motionDurationMid}`,
|
|
39
40
|
// ensure header box-shadow cover body content
|
|
@@ -48,12 +49,12 @@ var genDrawerStyle = (token) => {
|
|
|
48
49
|
flexDirection: "column"
|
|
49
50
|
},
|
|
50
51
|
[`${componentCls}-body-content`]: {
|
|
51
|
-
padding:
|
|
52
|
+
padding: contentPadding,
|
|
52
53
|
overflow: "auto"
|
|
53
54
|
},
|
|
54
55
|
[`${componentCls}-footer-container`]: {
|
|
55
56
|
position: "sticky",
|
|
56
|
-
padding:
|
|
57
|
+
padding: `${token.padding}px ${token.paddingLG}px`,
|
|
57
58
|
transition: `box-shadow ${token.motionDurationMid}`,
|
|
58
59
|
// ensure footer box-shadow cover body content
|
|
59
60
|
zIndex: 10,
|
|
@@ -69,11 +70,16 @@ var genDrawerStyle = (token) => {
|
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
72
|
},
|
|
73
|
+
[`${componentCls}${componentCls}-loading`]: {
|
|
74
|
+
[`${componentCls}-body > ${antCls}-skeleton`]: {
|
|
75
|
+
padding: contentPadding
|
|
76
|
+
}
|
|
77
|
+
},
|
|
72
78
|
[`${componentCls}${componentCls}-with-footer`]: {
|
|
73
79
|
// should be wrapped by `${componentCls}-content` to overwritten antd style
|
|
74
80
|
[`${componentCls}-content`]: {
|
|
75
81
|
[`${componentCls}-body-content`]: {
|
|
76
|
-
padding:
|
|
82
|
+
padding: `${token.paddingXS}px ${token.paddingLG}px`
|
|
77
83
|
}
|
|
78
84
|
}
|
|
79
85
|
}
|
|
@@ -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/dropdown/dropdown-button.tsx
|
|
@@ -32,11 +22,11 @@ __export(dropdown_button_exports, {
|
|
|
32
22
|
default: () => dropdown_button_default
|
|
33
23
|
});
|
|
34
24
|
module.exports = __toCommonJS(dropdown_button_exports);
|
|
35
|
-
var import_react = __toESM(require("react"));
|
|
36
25
|
var import_antd = require("antd");
|
|
37
26
|
var import_icons = require("@oceanbase/icons");
|
|
38
|
-
var
|
|
39
|
-
|
|
27
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
28
|
+
var DropdownButton = ({ icon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.DownOutlined, {}), ...restProps }) => {
|
|
29
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Dropdown.Button, { icon, ...restProps });
|
|
40
30
|
};
|
|
41
31
|
DropdownButton.__ANT_BUTTON = true;
|
|
42
32
|
var dropdown_button_default = DropdownButton;
|
package/lib/dropdown/index.js
CHANGED
|
@@ -33,12 +33,12 @@ __export(dropdown_exports, {
|
|
|
33
33
|
default: () => dropdown_default
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(dropdown_exports);
|
|
36
|
-
var import_react = __toESM(require("react"));
|
|
37
36
|
var import_antd = require("antd");
|
|
38
37
|
var import_dropdown_button = __toESM(require("./dropdown-button"));
|
|
39
38
|
__reExport(dropdown_exports, require("antd/es/dropdown"), module.exports);
|
|
39
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
40
40
|
var Dropdown = (props) => {
|
|
41
|
-
return /* @__PURE__ */
|
|
41
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Dropdown, { ...props });
|
|
42
42
|
};
|
|
43
43
|
Dropdown._InternalPanelDoNotUseOrYouWillBeFired = import_antd.Dropdown._InternalPanelDoNotUseOrYouWillBeFired;
|
|
44
44
|
Dropdown.Button = import_dropdown_button.default;
|