@oceanbase/design 0.2.13 → 0.2.14
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 +3 -1
- package/es/_util/genComponentStyleHook.js +2 -2
- package/es/alert/index.js +2 -3
- package/es/alert/style/index.js +21 -4
- package/es/button/index.d.ts +1 -1
- package/es/button/index.js +2 -3
- package/es/card/index.js +2 -3
- package/es/card/style/index.js +2 -2
- package/es/config-provider/index.d.ts +12 -3
- package/es/config-provider/index.js +3 -1
- package/es/descriptions/index.js +5 -7
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/lottie/index.d.ts +16 -0
- package/es/lottie/index.js +65 -0
- package/es/modal/index.d.ts +1 -1
- package/es/modal/index.js +8 -5
- package/es/modal/style/index.js +21 -4
- package/es/spin/assets/spin-gray.json +1 -0
- package/es/spin/assets/spin.json +1 -0
- package/es/spin/index.d.ts +11 -0
- package/es/spin/index.js +49 -1
- package/es/spin/style/index.d.ts +13 -0
- package/es/spin/style/index.js +70 -0
- package/es/table/index.d.ts +2 -2
- package/es/table/index.js +8 -4
- package/es/tabs/index.js +5 -4
- package/es/tabs/style/index.d.ts +2 -1
- package/es/theme/index.d.ts +0 -48
- package/es/theme/index.js +5 -3
- package/es/theme/internal.d.ts +1 -0
- package/es/theme/internal.js +1 -0
- package/es/tooltip/MouseTooltip.js +1 -1
- package/lib/_util/genComponentStyleHook.d.ts +3 -1
- package/lib/_util/genComponentStyleHook.js +8 -4
- package/lib/alert/index.js +2 -3
- package/lib/alert/style/index.js +20 -1
- package/lib/button/index.d.ts +1 -1
- package/lib/button/index.js +2 -2
- package/lib/card/index.js +2 -3
- package/lib/card/style/index.js +5 -7
- package/lib/config-provider/index.d.ts +12 -3
- package/lib/config-provider/index.js +2 -1
- package/lib/descriptions/index.js +4 -5
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lib/lottie/index.d.ts +16 -0
- package/lib/lottie/index.js +79 -0
- package/lib/modal/index.d.ts +1 -1
- package/lib/modal/index.js +7 -3
- package/lib/modal/style/index.js +26 -1
- package/lib/spin/assets/spin-gray.json +1 -0
- package/lib/spin/assets/spin.json +1 -0
- package/lib/spin/index.d.ts +11 -0
- package/lib/spin/index.js +63 -1
- package/lib/spin/style/index.d.ts +13 -0
- package/lib/spin/style/index.js +105 -0
- package/lib/table/index.d.ts +2 -2
- package/lib/table/index.js +7 -4
- package/lib/tabs/index.js +2 -2
- package/lib/tabs/style/index.d.ts +2 -1
- package/lib/theme/index.d.ts +0 -48
- package/lib/theme/index.js +3 -4
- package/lib/theme/internal.d.ts +1 -0
- package/lib/theme/internal.js +23 -0
- package/lib/tooltip/MouseTooltip.js +1 -1
- package/package.json +10 -9
package/es/tabs/index.js
CHANGED
|
@@ -42,9 +42,8 @@ var Tabs = function Tabs(_ref) {
|
|
|
42
42
|
getPrefixCls = _useContext.getPrefixCls;
|
|
43
43
|
var prefixCls = getPrefixCls('tabs', customizePrefixCls);
|
|
44
44
|
var _useStyle = useStyle(prefixCls),
|
|
45
|
-
wrapSSR = _useStyle.wrapSSR
|
|
46
|
-
|
|
47
|
-
var tabsCls = classNames(className, hashId);
|
|
45
|
+
wrapSSR = _useStyle.wrapSSR;
|
|
46
|
+
var tabsCls = classNames(className);
|
|
48
47
|
var ref = useRef();
|
|
49
48
|
var isHorizontal = !tabPosition || tabPosition === 'top' || tabPosition === 'bottom';
|
|
50
49
|
var newItems = items === null || items === void 0 ? void 0 : items.map(function (item) {
|
|
@@ -81,7 +80,9 @@ var Tabs = function Tabs(_ref) {
|
|
|
81
80
|
tabPosition: tabPosition,
|
|
82
81
|
containerRef: ref
|
|
83
82
|
});
|
|
84
|
-
return wrapSSR( /*#__PURE__*/React.createElement(AntTabs
|
|
83
|
+
return wrapSSR( /*#__PURE__*/React.createElement(AntTabs
|
|
84
|
+
// @ts-ignore
|
|
85
|
+
, _extends({
|
|
85
86
|
ref: ref,
|
|
86
87
|
items: newItems,
|
|
87
88
|
defaultActiveKey: defaultActiveKey,
|
package/es/tabs/style/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { FullToken, GenerateStyle } from 'antd/es/theme/internal';
|
|
3
3
|
export type TabsToken = FullToken<'Tabs'>;
|
|
4
|
-
export
|
|
4
|
+
export type CardToken = FullToken<'Card'>;
|
|
5
|
+
export declare const genTagStyle: GenerateStyle<TabsToken | CardToken>;
|
|
5
6
|
declare const _default: (prefixCls: string) => {
|
|
6
7
|
wrapSSR: (node: import("react").ReactNode) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
7
8
|
hashId: string;
|
package/es/theme/index.d.ts
CHANGED
|
@@ -50,54 +50,6 @@ declare const _default: {
|
|
|
50
50
|
gold: string;
|
|
51
51
|
};
|
|
52
52
|
defaultConfig: {
|
|
53
|
-
defaultSeed: {
|
|
54
|
-
colorPrimary: string;
|
|
55
|
-
colorInfo: string;
|
|
56
|
-
colorSuccess: string;
|
|
57
|
-
colorWarning: string;
|
|
58
|
-
colorError: string;
|
|
59
|
-
borderRadius: number;
|
|
60
|
-
blue: string;
|
|
61
|
-
green: string;
|
|
62
|
-
yellow: string;
|
|
63
|
-
red: string;
|
|
64
|
-
colorTextBase: string;
|
|
65
|
-
colorBgBase: string;
|
|
66
|
-
colorLink: string;
|
|
67
|
-
fontFamily: string;
|
|
68
|
-
fontFamilyCode: string;
|
|
69
|
-
fontSize: number;
|
|
70
|
-
lineWidth: number;
|
|
71
|
-
lineType: string;
|
|
72
|
-
sizeUnit: number;
|
|
73
|
-
sizeStep: number;
|
|
74
|
-
sizePopupArrow: number;
|
|
75
|
-
controlHeight: number;
|
|
76
|
-
zIndexBase: number;
|
|
77
|
-
zIndexPopupBase: number;
|
|
78
|
-
opacityImage: number;
|
|
79
|
-
motionUnit: number;
|
|
80
|
-
motionBase: number;
|
|
81
|
-
motionEaseOutCirc: string;
|
|
82
|
-
motionEaseInOutCirc: string;
|
|
83
|
-
motionEaseInOut: string;
|
|
84
|
-
motionEaseOutBack: string;
|
|
85
|
-
motionEaseInBack: string;
|
|
86
|
-
motionEaseInQuint: string;
|
|
87
|
-
motionEaseOutQuint: string;
|
|
88
|
-
motionEaseOut: string;
|
|
89
|
-
wireframe: boolean;
|
|
90
|
-
motion: boolean;
|
|
91
|
-
purple: string;
|
|
92
|
-
cyan: string;
|
|
93
|
-
magenta: string;
|
|
94
|
-
pink: string;
|
|
95
|
-
orange: string;
|
|
96
|
-
volcano: string;
|
|
97
|
-
geekblue: string;
|
|
98
|
-
lime: string;
|
|
99
|
-
gold: string;
|
|
100
|
-
};
|
|
101
53
|
token: import("antd/es/theme/internal").SeedToken;
|
|
102
54
|
hashed: boolean;
|
|
103
55
|
};
|
package/es/theme/index.js
CHANGED
|
@@ -20,11 +20,13 @@ var defaultSeed = _objectSpread(_objectSpread({}, theme.defaultSeed), {}, {
|
|
|
20
20
|
yellow: '#ffac33',
|
|
21
21
|
red: '#ff4b4b'
|
|
22
22
|
});
|
|
23
|
+
|
|
24
|
+
// should use reference assign instead of clone assign
|
|
25
|
+
var defaultConfig = theme.defaultConfig;
|
|
26
|
+
defaultConfig.token = defaultSeed;
|
|
23
27
|
export default _objectSpread(_objectSpread({}, theme), {}, {
|
|
24
28
|
defaultSeed: defaultSeed,
|
|
25
|
-
defaultConfig:
|
|
26
|
-
defaultSeed: defaultSeed
|
|
27
|
-
}),
|
|
29
|
+
defaultConfig: defaultConfig,
|
|
28
30
|
components: {
|
|
29
31
|
InputNumber: {
|
|
30
32
|
handleVisible: true
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from 'antd/es/theme/internal';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from 'antd/es/theme/internal';
|
|
@@ -94,7 +94,7 @@ var MouseTooltip = function MouseTooltip(_ref) {
|
|
|
94
94
|
}, restOverlayInnerStyle)
|
|
95
95
|
}, restProps), /*#__PURE__*/React.createElement("div", {
|
|
96
96
|
ref: ref
|
|
97
|
-
}, title)));
|
|
97
|
+
}, typeof title === 'function' ? title() : title)));
|
|
98
98
|
};
|
|
99
99
|
if (process.env.NODE_ENV !== 'production') {
|
|
100
100
|
MouseTooltip.displayName = 'MouseTooltip';
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
import type { CSSObject } from '@ant-design/cssinjs';
|
|
3
3
|
import type { ComponentTokenMap } from 'antd/es/theme/interface';
|
|
4
4
|
import type { FullToken, GenerateStyle } from 'antd/es/theme/internal';
|
|
5
|
+
import type { GlobalToken } from 'antd/es/theme/interface';
|
|
6
|
+
import type { OverrideTokenWithoutDerivative } from 'antd/es/theme/util/genComponentStyleHook';
|
|
5
7
|
export type ComponentName = keyof ComponentTokenMap;
|
|
6
|
-
export declare function genComponentStyleHook(componentName: ComponentName, styleFn: GenerateStyle<FullToken<ComponentName
|
|
8
|
+
export declare function genComponentStyleHook(componentName: ComponentName, styleFn: GenerateStyle<FullToken<ComponentName>>, getDefaultToken?: OverrideTokenWithoutDerivative[ComponentName] | ((token: GlobalToken) => OverrideTokenWithoutDerivative[ComponentName])): (prefixCls: string) => {
|
|
7
9
|
wrapSSR: (node: import("react").ReactNode) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
8
10
|
hashId: string;
|
|
9
11
|
};
|
|
@@ -23,11 +23,15 @@ __export(genComponentStyleHook_exports, {
|
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(genComponentStyleHook_exports);
|
|
25
25
|
var import_internal = require("antd/es/theme/internal");
|
|
26
|
-
function genComponentStyleHook(componentName, styleFn) {
|
|
26
|
+
function genComponentStyleHook(componentName, styleFn, getDefaultToken) {
|
|
27
27
|
return (prefixCls) => {
|
|
28
|
-
const useStyle = (0, import_internal.genComponentStyleHook)(
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
const useStyle = (0, import_internal.genComponentStyleHook)(
|
|
29
|
+
`OB-${componentName}`,
|
|
30
|
+
(token) => {
|
|
31
|
+
return [styleFn(token)];
|
|
32
|
+
},
|
|
33
|
+
getDefaultToken
|
|
34
|
+
);
|
|
31
35
|
const [wrapSSR, hashId] = useStyle(prefixCls);
|
|
32
36
|
return {
|
|
33
37
|
wrapSSR,
|
package/lib/alert/index.js
CHANGED
|
@@ -48,14 +48,13 @@ var Alert = ({
|
|
|
48
48
|
}) => {
|
|
49
49
|
const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
|
|
50
50
|
const prefixCls = getPrefixCls("alert", customizePrefixCls);
|
|
51
|
-
const { wrapSSR
|
|
51
|
+
const { wrapSSR } = (0, import_style.default)(prefixCls);
|
|
52
52
|
const alertCls = (0, import_classnames.default)(
|
|
53
53
|
{
|
|
54
54
|
[`${prefixCls}-ghost`]: ghost,
|
|
55
55
|
[`${prefixCls}-colored`]: colored
|
|
56
56
|
},
|
|
57
|
-
className
|
|
58
|
-
hashId
|
|
57
|
+
className
|
|
59
58
|
);
|
|
60
59
|
return wrapSSR(/* @__PURE__ */ import_react.default.createElement(import_antd.Alert, { prefixCls: customizePrefixCls, className: alertCls, ...restProps }));
|
|
61
60
|
};
|
package/lib/alert/style/index.js
CHANGED
|
@@ -75,9 +75,28 @@ var genAlertStyle = (token) => {
|
|
|
75
75
|
colorWarning,
|
|
76
76
|
colorWarningHover,
|
|
77
77
|
colorError,
|
|
78
|
-
colorErrorHover
|
|
78
|
+
colorErrorHover,
|
|
79
|
+
colorIcon,
|
|
80
|
+
colorIconHover,
|
|
81
|
+
motionDurationMid
|
|
79
82
|
} = token;
|
|
83
|
+
const height = token.fontSize * token.lineHeight;
|
|
80
84
|
return {
|
|
85
|
+
[`${componentCls}`]: {
|
|
86
|
+
// vertical align to flex-start
|
|
87
|
+
alignItems: "flex-start",
|
|
88
|
+
[`${componentCls}-icon`]: {
|
|
89
|
+
height
|
|
90
|
+
},
|
|
91
|
+
[`${componentCls}-close-icon`]: {
|
|
92
|
+
height,
|
|
93
|
+
color: colorIcon,
|
|
94
|
+
transition: `color ${motionDurationMid}`,
|
|
95
|
+
"&:hover": {
|
|
96
|
+
color: colorIconHover
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
81
100
|
[`${componentCls}${componentCls}-with-description`]: {
|
|
82
101
|
paddingBlock: token.padding,
|
|
83
102
|
[`${componentCls}-message`]: {
|
package/lib/button/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export type ButtonProps = AntButtonProps;
|
|
|
5
5
|
declare const Button: {
|
|
6
6
|
({ prefixCls: customizePrefixCls, className, ...restProps }: ButtonProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
7
7
|
Group: React.FC<import("antd/es/button").ButtonGroupProps>;
|
|
8
|
-
__ANT_BUTTON:
|
|
8
|
+
__ANT_BUTTON: boolean;
|
|
9
9
|
displayName: string;
|
|
10
10
|
};
|
|
11
11
|
export default Button;
|
package/lib/button/index.js
CHANGED
|
@@ -42,8 +42,8 @@ __reExport(button_exports, require("antd/es/button"), module.exports);
|
|
|
42
42
|
var Button = ({ prefixCls: customizePrefixCls, className, ...restProps }) => {
|
|
43
43
|
const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
|
|
44
44
|
const prefixCls = getPrefixCls("btn", customizePrefixCls);
|
|
45
|
-
const { wrapSSR
|
|
46
|
-
const buttonCls = (0, import_classnames.default)(className
|
|
45
|
+
const { wrapSSR } = (0, import_style.default)(prefixCls);
|
|
46
|
+
const buttonCls = (0, import_classnames.default)(className);
|
|
47
47
|
return wrapSSR(/* @__PURE__ */ import_react.default.createElement(import_antd.Button, { prefixCls: customizePrefixCls, className: buttonCls, ...restProps }));
|
|
48
48
|
};
|
|
49
49
|
Button.Group = import_antd.Button.Group;
|
package/lib/card/index.js
CHANGED
|
@@ -57,13 +57,12 @@ var Card = ({
|
|
|
57
57
|
const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
|
|
58
58
|
const prefixCls = getPrefixCls("card", customizePrefixCls);
|
|
59
59
|
const tabsPrefixCls = getPrefixCls("tabs", customizePrefixCls);
|
|
60
|
-
const { wrapSSR
|
|
60
|
+
const { wrapSSR } = (0, import_style.default)(prefixCls, tabsPrefixCls);
|
|
61
61
|
const cardCls = (0, import_classnames.default)(
|
|
62
62
|
{
|
|
63
63
|
[`${prefixCls}-no-divider`]: !divided
|
|
64
64
|
},
|
|
65
|
-
className
|
|
66
|
-
hashId
|
|
65
|
+
className
|
|
67
66
|
);
|
|
68
67
|
const ref = (0, import_react.useRef)();
|
|
69
68
|
const newTabList = tabList == null ? void 0 : tabList.map((item) => {
|
package/lib/card/style/index.js
CHANGED
|
@@ -44,13 +44,11 @@ var genCardStyle = (token) => {
|
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
[`${componentCls}${componentCls}-contain-tabs`]: {
|
|
47
|
-
[`${componentCls}-head`]: {
|
|
48
|
-
...
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
})
|
|
53
|
-
}
|
|
47
|
+
[`${componentCls}-head`]: (0, import_style.genTagStyle)({
|
|
48
|
+
...token,
|
|
49
|
+
componentCls: tabsComponentCls,
|
|
50
|
+
prefixCls: tabsPrefixCls
|
|
51
|
+
})
|
|
54
52
|
}
|
|
55
53
|
};
|
|
56
54
|
};
|
|
@@ -1,21 +1,30 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { ConfigProviderProps as AntConfigProviderProps, ThemeConfig as AntThemeConfig } from 'antd/es/config-provider';
|
|
2
|
+
import type { ConfigProviderProps as AntConfigProviderProps, ConfigConsumerProps as AntConfigConsumerProps, ThemeConfig as AntThemeConfig } from 'antd/es/config-provider';
|
|
3
|
+
import type { ComponentStyleConfig } from 'antd/es/config-provider/context';
|
|
4
|
+
import type { SpinIndicator } from 'antd/es/spin';
|
|
3
5
|
import type { NavigateFunction } from './navigate';
|
|
4
6
|
export * from './navigate';
|
|
5
7
|
export * from 'antd/es/config-provider';
|
|
6
8
|
export interface ThemeConfig extends AntThemeConfig {
|
|
7
9
|
isDark?: boolean;
|
|
8
10
|
}
|
|
11
|
+
export type SpinConfig = ComponentStyleConfig & {
|
|
12
|
+
indicator?: SpinIndicator;
|
|
13
|
+
};
|
|
14
|
+
export interface ConfigConsumerProps extends AntConfigConsumerProps {
|
|
15
|
+
spin?: SpinConfig;
|
|
16
|
+
}
|
|
9
17
|
export interface ConfigProviderProps extends AntConfigProviderProps {
|
|
10
18
|
theme?: ThemeConfig;
|
|
11
19
|
navigate?: NavigateFunction;
|
|
20
|
+
spin?: SpinConfig;
|
|
12
21
|
}
|
|
13
22
|
export interface ExtendedConfigConsumerProps {
|
|
14
23
|
navigate?: NavigateFunction;
|
|
15
24
|
}
|
|
16
25
|
declare const ConfigProvider: {
|
|
17
|
-
({ children, theme, navigate, ...restProps }: ConfigProviderProps): React.JSX.Element;
|
|
18
|
-
ConfigContext: React.Context<
|
|
26
|
+
({ children, theme, navigate, spin, ...restProps }: ConfigProviderProps): React.JSX.Element;
|
|
27
|
+
ConfigContext: React.Context<ConfigConsumerProps>;
|
|
19
28
|
ExtendedConfigContext: React.Context<ExtendedConfigConsumerProps>;
|
|
20
29
|
SizeContext: React.Context<import("antd/es/button").ButtonSize>;
|
|
21
30
|
config: ({ prefixCls, iconPrefixCls, theme, }: Pick<AntConfigProviderProps, "prefixCls" | "iconPrefixCls"> & {
|
|
@@ -44,11 +44,12 @@ var ExtendedConfigContext = import_react.default.createContext({
|
|
|
44
44
|
navigate: void 0
|
|
45
45
|
});
|
|
46
46
|
var { defaultSeed, components } = import_theme.default;
|
|
47
|
-
var ConfigProvider = ({ children, theme, navigate, ...restProps }) => {
|
|
47
|
+
var ConfigProvider = ({ children, theme, navigate, spin, ...restProps }) => {
|
|
48
48
|
var _a;
|
|
49
49
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
50
50
|
import_antd.ConfigProvider,
|
|
51
51
|
{
|
|
52
|
+
spin,
|
|
52
53
|
theme: {
|
|
53
54
|
...theme,
|
|
54
55
|
// Only set seed token for dark theme
|
|
@@ -35,7 +35,6 @@ __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_lodash = require("lodash");
|
|
39
38
|
var import_toArray = __toESM(require("rc-util/lib/Children/toArray"));
|
|
40
39
|
var import_react = __toESM(require("react"));
|
|
41
40
|
var import_config_provider = __toESM(require("../config-provider"));
|
|
@@ -52,8 +51,8 @@ var Descriptions = ({
|
|
|
52
51
|
const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
|
|
53
52
|
const prefixCls = getPrefixCls("descriptions", customizePrefixCls);
|
|
54
53
|
const typographyPrefixCls = getPrefixCls("typography", customizePrefixCls);
|
|
55
|
-
const { wrapSSR
|
|
56
|
-
const descriptionsCls = (0, import_classnames.default)(className
|
|
54
|
+
const { wrapSSR } = (0, import_style.default)(prefixCls, typographyPrefixCls);
|
|
55
|
+
const descriptionsCls = (0, import_classnames.default)(className);
|
|
57
56
|
const newChildren = bordered ? children : (0, import_toArray.default)(children).map((node) => {
|
|
58
57
|
if (import_react.default.isValidElement(node)) {
|
|
59
58
|
const { props } = node;
|
|
@@ -74,14 +73,14 @@ var Descriptions = ({
|
|
|
74
73
|
import_antd.Typography.Text,
|
|
75
74
|
{
|
|
76
75
|
...restContentProps,
|
|
77
|
-
ellipsis:
|
|
76
|
+
ellipsis: typeof ellipsis === "object" ? {
|
|
78
77
|
...ellipsis,
|
|
79
78
|
tooltip: (
|
|
80
79
|
// 如果目标元素已经被 Tooltip 包裹,则去掉默认的 Tooltip,避免有两个 Tooltip
|
|
81
80
|
(itemChildrenType == null ? void 0 : itemChildrenType.__ANT_TOOLTIP) ? void 0 : {
|
|
82
81
|
...defaultEllipsis.tooltip,
|
|
83
82
|
// TooltipProps
|
|
84
|
-
...
|
|
83
|
+
...typeof ellipsis.tooltip === "object" && !(0, import_react.isValidElement)(ellipsis.tooltip) ? ellipsis.tooltip : {
|
|
85
84
|
title: ellipsis.tooltip
|
|
86
85
|
}
|
|
87
86
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export { default as Tabs } from './tabs';
|
|
|
14
14
|
export { default as theme } from './theme';
|
|
15
15
|
export { default as Tooltip } from './tooltip';
|
|
16
16
|
export { default as Breadcrumb } from './breadcrumb';
|
|
17
|
+
export { default as Spin } from './spin';
|
|
17
18
|
declare const useToken: () => {
|
|
18
19
|
theme: import("@ant-design/cssinjs").Theme<import("antd/es/theme/interface/seeds").SeedToken, import("antd/es/theme/interface").MapToken>;
|
|
19
20
|
token: import("antd").GlobalToken;
|
package/lib/index.js
CHANGED
|
@@ -38,6 +38,7 @@ __export(src_exports, {
|
|
|
38
38
|
Descriptions: () => import_descriptions.default,
|
|
39
39
|
Form: () => import_form.default,
|
|
40
40
|
Modal: () => import_modal.default,
|
|
41
|
+
Spin: () => import_spin.default,
|
|
41
42
|
Table: () => import_table.default,
|
|
42
43
|
Tabs: () => import_tabs.default,
|
|
43
44
|
Tooltip: () => import_tooltip.default,
|
|
@@ -66,6 +67,7 @@ var import_tabs = __toESM(require("./tabs"));
|
|
|
66
67
|
var import_theme = __toESM(require("./theme"));
|
|
67
68
|
var import_tooltip = __toESM(require("./tooltip"));
|
|
68
69
|
var import_breadcrumb = __toESM(require("./breadcrumb"));
|
|
70
|
+
var import_spin = __toESM(require("./spin"));
|
|
69
71
|
var { useToken } = import_antd.theme;
|
|
70
72
|
// Annotate the CommonJS export names for ESM import in node:
|
|
71
73
|
0 && (module.exports = {
|
|
@@ -77,6 +79,7 @@ var { useToken } = import_antd.theme;
|
|
|
77
79
|
Descriptions,
|
|
78
80
|
Form,
|
|
79
81
|
Modal,
|
|
82
|
+
Spin,
|
|
80
83
|
Table,
|
|
81
84
|
Tabs,
|
|
82
85
|
Tooltip,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AnimationConfig, AnimationItem } from 'lottie-web';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface LottieProps extends Omit<AnimationConfig, 'container'> {
|
|
4
|
+
path?: string;
|
|
5
|
+
animationData?: any;
|
|
6
|
+
mode?: 'default' | 'icon';
|
|
7
|
+
loop?: boolean;
|
|
8
|
+
speed?: number;
|
|
9
|
+
className?: string;
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
}
|
|
12
|
+
export interface LottieRef {
|
|
13
|
+
animation: AnimationItem;
|
|
14
|
+
}
|
|
15
|
+
declare const Lottie: React.ForwardRefExoticComponent<LottieProps & React.RefAttributes<LottieRef>>;
|
|
16
|
+
export default Lottie;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/lottie/index.tsx
|
|
30
|
+
var lottie_exports = {};
|
|
31
|
+
__export(lottie_exports, {
|
|
32
|
+
default: () => lottie_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(lottie_exports);
|
|
35
|
+
var import_lottie_web = __toESM(require("lottie-web"));
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_ahooks = require("ahooks");
|
|
38
|
+
var import_classnames = __toESM(require("classnames"));
|
|
39
|
+
var Lottie = import_react.default.forwardRef(
|
|
40
|
+
({ mode = "default", loop = true, speed = 1, className, style, ...restProps }, ref) => {
|
|
41
|
+
const [animation, setAnimation] = (0, import_react.useState)();
|
|
42
|
+
const containerRef = (0, import_react.useRef)();
|
|
43
|
+
(0, import_react.useEffect)(() => {
|
|
44
|
+
if (!animation) {
|
|
45
|
+
const newAnimation = import_lottie_web.default.loadAnimation({
|
|
46
|
+
container: containerRef.current,
|
|
47
|
+
renderer: "svg",
|
|
48
|
+
loop,
|
|
49
|
+
...restProps
|
|
50
|
+
});
|
|
51
|
+
setAnimation(newAnimation);
|
|
52
|
+
}
|
|
53
|
+
}, []);
|
|
54
|
+
(0, import_ahooks.useUpdateEffect)(() => {
|
|
55
|
+
if (animation) {
|
|
56
|
+
animation.setLoop(loop);
|
|
57
|
+
animation.setSpeed(speed);
|
|
58
|
+
}
|
|
59
|
+
}, [loop, speed]);
|
|
60
|
+
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
61
|
+
animation
|
|
62
|
+
}));
|
|
63
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
64
|
+
"div",
|
|
65
|
+
{
|
|
66
|
+
ref: containerRef,
|
|
67
|
+
className: (0, import_classnames.default)(className, {
|
|
68
|
+
// 图标展示模式,则追加 anticon 类名
|
|
69
|
+
["anticon"]: mode === "icon"
|
|
70
|
+
}),
|
|
71
|
+
style: {
|
|
72
|
+
display: "inline-block",
|
|
73
|
+
...style
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
var lottie_default = Lottie;
|
package/lib/modal/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
export * from 'antd/es/modal';
|
|
4
4
|
export type ModalProps = AntModalProps;
|
|
5
5
|
declare const Modal: {
|
|
6
|
-
({ prefixCls: customizePrefixCls, className, rootClassName, ...restProps }: ModalProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
6
|
+
({ prefixCls: customizePrefixCls, className, rootClassName, title, footer, ...restProps }: ModalProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
7
7
|
info(props: any): {
|
|
8
8
|
destroy: () => void;
|
|
9
9
|
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
package/lib/modal/index.js
CHANGED
|
@@ -44,19 +44,23 @@ var Modal = ({
|
|
|
44
44
|
prefixCls: customizePrefixCls,
|
|
45
45
|
className,
|
|
46
46
|
rootClassName,
|
|
47
|
+
title,
|
|
48
|
+
footer,
|
|
47
49
|
...restProps
|
|
48
50
|
}) => {
|
|
49
51
|
const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
|
|
50
52
|
const prefixCls = getPrefixCls("modal", customizePrefixCls);
|
|
51
|
-
const { wrapSSR
|
|
52
|
-
const modalCls = (0, import_classnames.default)(className
|
|
53
|
+
const { wrapSSR } = (0, import_style.default)(prefixCls);
|
|
54
|
+
const modalCls = (0, import_classnames.default)(className);
|
|
53
55
|
return wrapSSR(
|
|
54
56
|
/* @__PURE__ */ import_react.default.createElement(
|
|
55
57
|
import_antd.Modal,
|
|
56
58
|
{
|
|
57
59
|
prefixCls: customizePrefixCls,
|
|
58
60
|
className: modalCls,
|
|
59
|
-
rootClassName: (0, import_classnames.default)(rootClassName
|
|
61
|
+
rootClassName: (0, import_classnames.default)(rootClassName),
|
|
62
|
+
title,
|
|
63
|
+
footer,
|
|
60
64
|
...restProps
|
|
61
65
|
}
|
|
62
66
|
)
|
package/lib/modal/style/index.js
CHANGED
|
@@ -25,15 +25,40 @@ __export(style_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(style_exports);
|
|
26
26
|
var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
|
|
27
27
|
var genModalStyle = (token) => {
|
|
28
|
-
const {
|
|
28
|
+
const {
|
|
29
|
+
componentCls,
|
|
30
|
+
marginSM,
|
|
31
|
+
marginLG,
|
|
32
|
+
paddingMD,
|
|
33
|
+
borderRadius,
|
|
34
|
+
controlHeight,
|
|
35
|
+
fontSizeHeading5,
|
|
36
|
+
lineHeightHeading5
|
|
37
|
+
} = token;
|
|
38
|
+
const top = 100;
|
|
39
|
+
const bottom = 100;
|
|
40
|
+
const titleHeight = fontSizeHeading5 * lineHeightHeading5;
|
|
29
41
|
return {
|
|
30
42
|
[`${componentCls}:not(${componentCls}-confirm)`]: {
|
|
31
43
|
[`${componentCls}-header`]: {
|
|
32
44
|
marginBottom: marginLG
|
|
33
45
|
},
|
|
46
|
+
[`${componentCls}-body`]: {
|
|
47
|
+
maxHeight: `calc(100vh - ${top + bottom}px - ${paddingMD * 2}px - ${marginLG * 2}px - ${titleHeight + controlHeight}px)`,
|
|
48
|
+
overflowY: "auto",
|
|
49
|
+
borderRadius
|
|
50
|
+
},
|
|
34
51
|
[`${componentCls}-footer`]: {
|
|
35
52
|
marginTop: marginLG
|
|
36
53
|
}
|
|
54
|
+
},
|
|
55
|
+
[`${componentCls}-confirm`]: {
|
|
56
|
+
[`${componentCls}-body ${componentCls}-confirm-title +${componentCls}-confirm-content`]: {
|
|
57
|
+
marginBlockStart: marginSM
|
|
58
|
+
},
|
|
59
|
+
[`${componentCls}-confirm-btns`]: {
|
|
60
|
+
marginTop: marginLG
|
|
61
|
+
}
|
|
37
62
|
}
|
|
38
63
|
};
|
|
39
64
|
};
|