@oceanbase/design 0.2.13 → 0.2.15
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/form/FormItem.d.ts +1 -1
- 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/Modal.d.ts +30 -0
- package/es/modal/Modal.js +50 -0
- package/es/modal/Progress.d.ts +10 -0
- package/es/modal/Progress.js +46 -0
- package/es/modal/index.d.ts +7 -30
- package/es/modal/index.js +4 -52
- package/es/modal/style/index.js +42 -5
- 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/es/tooltip/index.d.ts +2 -0
- package/es/tooltip/index.js +70 -7
- package/es/tooltip/style/index.d.ts +9 -0
- package/es/tooltip/style/index.js +29 -0
- 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/form/FormItem.d.ts +1 -1
- 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/Modal.d.ts +30 -0
- package/lib/modal/Modal.js +59 -0
- package/lib/modal/Progress.d.ts +10 -0
- package/lib/modal/Progress.js +71 -0
- package/lib/modal/index.d.ts +7 -30
- package/lib/modal/index.js +5 -40
- package/lib/modal/style/index.js +60 -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/lib/tooltip/index.d.ts +2 -0
- package/lib/tooltip/index.js +44 -2
- package/lib/tooltip/style/index.d.ts +9 -0
- package/lib/tooltip/style/index.js +55 -0
- package/package.json +10 -9
|
@@ -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
|
};
|
|
@@ -5,11 +5,11 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5
5
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import { genComponentStyleHook as antGenComponentStyleHook } from 'antd/es/theme/internal';
|
|
8
|
-
export function genComponentStyleHook(componentName, styleFn) {
|
|
8
|
+
export function genComponentStyleHook(componentName, styleFn, getDefaultToken) {
|
|
9
9
|
return function (prefixCls) {
|
|
10
10
|
var useStyle = antGenComponentStyleHook("OB-".concat(componentName), function (token) {
|
|
11
11
|
return [styleFn(token)];
|
|
12
|
-
});
|
|
12
|
+
}, getDefaultToken);
|
|
13
13
|
var _useStyle = useStyle(prefixCls),
|
|
14
14
|
_useStyle2 = _slicedToArray(_useStyle, 2),
|
|
15
15
|
wrapSSR = _useStyle2[0],
|
package/es/alert/index.js
CHANGED
|
@@ -23,9 +23,8 @@ var Alert = function Alert(_ref) {
|
|
|
23
23
|
getPrefixCls = _useContext.getPrefixCls;
|
|
24
24
|
var prefixCls = getPrefixCls('alert', customizePrefixCls);
|
|
25
25
|
var _useStyle = useStyle(prefixCls),
|
|
26
|
-
wrapSSR = _useStyle.wrapSSR
|
|
27
|
-
|
|
28
|
-
var alertCls = classNames((_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-ghost"), ghost), _defineProperty(_classNames, "".concat(prefixCls, "-colored"), colored), _classNames), className, hashId);
|
|
26
|
+
wrapSSR = _useStyle.wrapSSR;
|
|
27
|
+
var alertCls = classNames((_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-ghost"), ghost), _defineProperty(_classNames, "".concat(prefixCls, "-colored"), colored), _classNames), className);
|
|
29
28
|
return wrapSSR( /*#__PURE__*/React.createElement(AntAlert, _extends({
|
|
30
29
|
prefixCls: customizePrefixCls,
|
|
31
30
|
className: alertCls
|
package/es/alert/style/index.js
CHANGED
|
@@ -41,7 +41,7 @@ var genColoredStyle = function genColoredStyle(color, colorHover, token) {
|
|
|
41
41
|
}), _$concat)), _ref;
|
|
42
42
|
};
|
|
43
43
|
export var genAlertStyle = function genAlertStyle(token) {
|
|
44
|
-
var _$concat$concat, _$concat$concat$conca, _$
|
|
44
|
+
var _$concat2, _$concat$concat, _$concat$concat$conca, _$concat3, _ref2;
|
|
45
45
|
var componentCls = token.componentCls,
|
|
46
46
|
colorSuccess = token.colorSuccess,
|
|
47
47
|
colorSuccessHover = token.colorSuccessHover,
|
|
@@ -50,8 +50,25 @@ export var genAlertStyle = function genAlertStyle(token) {
|
|
|
50
50
|
colorWarning = token.colorWarning,
|
|
51
51
|
colorWarningHover = token.colorWarningHover,
|
|
52
52
|
colorError = token.colorError,
|
|
53
|
-
colorErrorHover = token.colorErrorHover
|
|
54
|
-
|
|
53
|
+
colorErrorHover = token.colorErrorHover,
|
|
54
|
+
colorIcon = token.colorIcon,
|
|
55
|
+
colorIconHover = token.colorIconHover,
|
|
56
|
+
motionDurationMid = token.motionDurationMid;
|
|
57
|
+
// height = fontSize * lineHeight
|
|
58
|
+
var height = token.fontSize * token.lineHeight;
|
|
59
|
+
return _ref2 = {}, _defineProperty(_ref2, "".concat(componentCls), (_$concat2 = {
|
|
60
|
+
// vertical align to flex-start
|
|
61
|
+
alignItems: 'flex-start'
|
|
62
|
+
}, _defineProperty(_$concat2, "".concat(componentCls, "-icon"), {
|
|
63
|
+
height: height
|
|
64
|
+
}), _defineProperty(_$concat2, "".concat(componentCls, "-close-icon"), {
|
|
65
|
+
height: height,
|
|
66
|
+
color: colorIcon,
|
|
67
|
+
transition: "color ".concat(motionDurationMid),
|
|
68
|
+
'&:hover': {
|
|
69
|
+
color: colorIconHover
|
|
70
|
+
}
|
|
71
|
+
}), _$concat2)), _defineProperty(_ref2, "".concat(componentCls).concat(componentCls, "-with-description"), (_$concat$concat = {
|
|
55
72
|
paddingBlock: token.padding
|
|
56
73
|
}, _defineProperty(_$concat$concat, "".concat(componentCls, "-message"), {
|
|
57
74
|
marginBottom: token.marginXXS
|
|
@@ -63,7 +80,7 @@ export var genAlertStyle = function genAlertStyle(token) {
|
|
|
63
80
|
border: 'none',
|
|
64
81
|
padding: 0,
|
|
65
82
|
borderRadius: 0
|
|
66
|
-
}), _defineProperty(_ref2, "".concat(componentCls, "-colored"), (_$
|
|
83
|
+
}), _defineProperty(_ref2, "".concat(componentCls, "-colored"), (_$concat3 = {}, _defineProperty(_$concat3, "&".concat(componentCls, "-success"), genColoredStyle(colorSuccess, colorSuccessHover, token)), _defineProperty(_$concat3, "&".concat(componentCls, "-info"), genColoredStyle(colorInfo, colorInfoHover, token)), _defineProperty(_$concat3, "&".concat(componentCls, "-warning"), genColoredStyle(colorWarning, colorWarningHover, token)), _defineProperty(_$concat3, "&".concat(componentCls, "-error"), genColoredStyle(colorError, colorErrorHover, token)), _$concat3)), _ref2;
|
|
67
84
|
};
|
|
68
85
|
export default (function (prefixCls) {
|
|
69
86
|
var useStyle = genComponentStyleHook('Alert', function (token) {
|
package/es/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/es/button/index.js
CHANGED
|
@@ -16,9 +16,8 @@ var Button = function Button(_ref) {
|
|
|
16
16
|
getPrefixCls = _useContext.getPrefixCls;
|
|
17
17
|
var prefixCls = getPrefixCls('btn', customizePrefixCls);
|
|
18
18
|
var _useStyle = useStyle(prefixCls),
|
|
19
|
-
wrapSSR = _useStyle.wrapSSR
|
|
20
|
-
|
|
21
|
-
var buttonCls = classNames(className, hashId);
|
|
19
|
+
wrapSSR = _useStyle.wrapSSR;
|
|
20
|
+
var buttonCls = classNames(className);
|
|
22
21
|
return wrapSSR( /*#__PURE__*/React.createElement(AntButton, _extends({
|
|
23
22
|
prefixCls: customizePrefixCls,
|
|
24
23
|
className: buttonCls
|
package/es/card/index.js
CHANGED
|
@@ -40,9 +40,8 @@ var Card = function Card(_ref) {
|
|
|
40
40
|
var prefixCls = getPrefixCls('card', customizePrefixCls);
|
|
41
41
|
var tabsPrefixCls = getPrefixCls('tabs', customizePrefixCls);
|
|
42
42
|
var _useStyle = useStyle(prefixCls, tabsPrefixCls),
|
|
43
|
-
wrapSSR = _useStyle.wrapSSR
|
|
44
|
-
|
|
45
|
-
var cardCls = classNames(_defineProperty({}, "".concat(prefixCls, "-no-divider"), !divided), className, hashId);
|
|
43
|
+
wrapSSR = _useStyle.wrapSSR;
|
|
44
|
+
var cardCls = classNames(_defineProperty({}, "".concat(prefixCls, "-no-divider"), !divided), className);
|
|
46
45
|
var ref = useRef();
|
|
47
46
|
var newTabList = tabList === null || tabList === void 0 ? void 0 : tabList.map(function (item) {
|
|
48
47
|
if (!isNullValue(item.tag)) {
|
package/es/card/style/index.js
CHANGED
|
@@ -20,10 +20,10 @@ export var genCardStyle = function genCardStyle(token) {
|
|
|
20
20
|
padding: "0 ".concat(paddingLG, "px ").concat(padding, "px ").concat(paddingLG, "px")
|
|
21
21
|
})), _defineProperty(_ref, "".concat(componentCls, "-small").concat(componentCls, "-no-divider:not(").concat(componentCls, "-contain-tabs)"), _defineProperty({}, "".concat(componentCls, "-body"), {
|
|
22
22
|
padding: "0 ".concat(paddingSM, "px 12px ").concat(paddingSM, "px")
|
|
23
|
-
})), _defineProperty(_ref, "".concat(componentCls).concat(componentCls, "-contain-tabs"), _defineProperty({}, "".concat(componentCls, "-head"),
|
|
23
|
+
})), _defineProperty(_ref, "".concat(componentCls).concat(componentCls, "-contain-tabs"), _defineProperty({}, "".concat(componentCls, "-head"), genTagStyle(_objectSpread(_objectSpread({}, token), {}, {
|
|
24
24
|
componentCls: tabsComponentCls,
|
|
25
25
|
prefixCls: tabsPrefixCls
|
|
26
|
-
}))))
|
|
26
|
+
})))), _ref;
|
|
27
27
|
};
|
|
28
28
|
export default (function (prefixCls, tabsPrefixCls) {
|
|
29
29
|
var useStyle = genComponentStyleHook('Card', function (token) {
|
|
@@ -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"> & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
var _excluded = ["children", "theme", "navigate"];
|
|
2
|
+
var _excluded = ["children", "theme", "navigate", "spin"];
|
|
3
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -28,8 +28,10 @@ var ConfigProvider = function ConfigProvider(_ref) {
|
|
|
28
28
|
var children = _ref.children,
|
|
29
29
|
theme = _ref.theme,
|
|
30
30
|
navigate = _ref.navigate,
|
|
31
|
+
spin = _ref.spin,
|
|
31
32
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
32
33
|
return /*#__PURE__*/React.createElement(AntConfigProvider, _extends({
|
|
34
|
+
spin: spin,
|
|
33
35
|
theme: _objectSpread(_objectSpread({}, theme), {}, {
|
|
34
36
|
// Only set seed token for dark theme
|
|
35
37
|
// Because defaultThemeToken is designed for light theme
|
package/es/descriptions/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
1
|
var _excluded = ["children", "bordered", "prefixCls", "className"],
|
|
3
2
|
_excluded2 = ["children", "contentProps"],
|
|
4
3
|
_excluded3 = ["ellipsis"];
|
|
5
4
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
6
6
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7
7
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8
8
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -12,7 +12,6 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
12
12
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
13
13
|
import { Descriptions as AntDescriptions, Typography } from 'antd';
|
|
14
14
|
import classNames from 'classnames';
|
|
15
|
-
import { isObject } from 'lodash';
|
|
16
15
|
import toArray from 'rc-util/lib/Children/toArray';
|
|
17
16
|
import React, { isValidElement, useContext } from 'react';
|
|
18
17
|
import ConfigProvider from "../config-provider";
|
|
@@ -30,9 +29,8 @@ var Descriptions = function Descriptions(_ref) {
|
|
|
30
29
|
var prefixCls = getPrefixCls('descriptions', customizePrefixCls);
|
|
31
30
|
var typographyPrefixCls = getPrefixCls('typography', customizePrefixCls);
|
|
32
31
|
var _useStyle = useStyle(prefixCls, typographyPrefixCls),
|
|
33
|
-
wrapSSR = _useStyle.wrapSSR
|
|
34
|
-
|
|
35
|
-
var descriptionsCls = classNames(className, hashId);
|
|
32
|
+
wrapSSR = _useStyle.wrapSSR;
|
|
33
|
+
var descriptionsCls = classNames(className);
|
|
36
34
|
|
|
37
35
|
// 仅无边框时定制 children
|
|
38
36
|
var newChildren = bordered ? children : toArray(children).map(function (node) {
|
|
@@ -55,10 +53,10 @@ var Descriptions = function Descriptions(_ref) {
|
|
|
55
53
|
return _objectSpread(_objectSpread({}, node), {}, {
|
|
56
54
|
props: _objectSpread(_objectSpread({}, restItemProps), {}, {
|
|
57
55
|
children: /*#__PURE__*/React.createElement(Typography.Text, _extends({}, restContentProps, {
|
|
58
|
-
ellipsis:
|
|
56
|
+
ellipsis: _typeof(ellipsis) === 'object' ? _objectSpread(_objectSpread({}, ellipsis), {}, {
|
|
59
57
|
tooltip:
|
|
60
58
|
// 如果目标元素已经被 Tooltip 包裹,则去掉默认的 Tooltip,避免有两个 Tooltip
|
|
61
|
-
itemChildrenType !== null && itemChildrenType !== void 0 && itemChildrenType.__ANT_TOOLTIP ? undefined : _objectSpread(_objectSpread({}, defaultEllipsis.tooltip),
|
|
59
|
+
itemChildrenType !== null && itemChildrenType !== void 0 && itemChildrenType.__ANT_TOOLTIP ? undefined : _objectSpread(_objectSpread({}, defaultEllipsis.tooltip), _typeof(ellipsis.tooltip) === 'object' && ! /*#__PURE__*/isValidElement(ellipsis.tooltip) ? ellipsis.tooltip : {
|
|
62
60
|
title: ellipsis.tooltip
|
|
63
61
|
})
|
|
64
62
|
}) : ellipsis
|
package/es/form/FormItem.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export type WrapperTooltipProps = Omit<TooltipProps, 'mouseFollow'> & {
|
|
|
8
8
|
export type LabelTooltipType = WrapperTooltipProps | React.ReactNode;
|
|
9
9
|
declare const FormItem: (<Values = any>(props: AntFormItemProps<Values>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) & {
|
|
10
10
|
useStatus: () => {
|
|
11
|
-
status?: "" | "success" | "
|
|
11
|
+
status?: "" | "success" | "warning" | "error" | "validating";
|
|
12
12
|
errors: ReactNode[];
|
|
13
13
|
warnings: ReactNode[];
|
|
14
14
|
};
|
package/es/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/es/index.js
CHANGED
|
@@ -18,6 +18,7 @@ export { default as Tabs } from "./tabs";
|
|
|
18
18
|
export { default as theme } from "./theme";
|
|
19
19
|
export { default as Tooltip } from "./tooltip";
|
|
20
20
|
export { default as Breadcrumb } from "./breadcrumb";
|
|
21
|
+
export { default as Spin } from "./spin";
|
|
21
22
|
var useToken = theme.useToken;
|
|
22
23
|
|
|
23
24
|
// 直接导出 useToken,方便上层使用
|
|
@@ -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,65 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["mode", "loop", "speed", "className", "style"];
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
9
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
11
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
12
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
13
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
15
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
16
|
+
import lottie from 'lottie-web';
|
|
17
|
+
import React, { useState, useEffect, useRef, useImperativeHandle } from 'react';
|
|
18
|
+
import { useUpdateEffect } from 'ahooks';
|
|
19
|
+
import classNames from 'classnames';
|
|
20
|
+
var Lottie = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
21
|
+
var _ref$mode = _ref.mode,
|
|
22
|
+
mode = _ref$mode === void 0 ? 'default' : _ref$mode,
|
|
23
|
+
_ref$loop = _ref.loop,
|
|
24
|
+
loop = _ref$loop === void 0 ? true : _ref$loop,
|
|
25
|
+
_ref$speed = _ref.speed,
|
|
26
|
+
speed = _ref$speed === void 0 ? 1 : _ref$speed,
|
|
27
|
+
className = _ref.className,
|
|
28
|
+
style = _ref.style,
|
|
29
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
30
|
+
var _useState = useState(),
|
|
31
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
32
|
+
animation = _useState2[0],
|
|
33
|
+
setAnimation = _useState2[1];
|
|
34
|
+
var containerRef = useRef();
|
|
35
|
+
useEffect(function () {
|
|
36
|
+
if (!animation) {
|
|
37
|
+
// ref: https://github.com/airbnb/lottie-web/blob/master/index.d.ts#L129
|
|
38
|
+
var newAnimation = lottie.loadAnimation(_objectSpread({
|
|
39
|
+
container: containerRef.current,
|
|
40
|
+
renderer: 'svg',
|
|
41
|
+
loop: loop
|
|
42
|
+
}, restProps));
|
|
43
|
+
setAnimation(newAnimation);
|
|
44
|
+
}
|
|
45
|
+
}, []);
|
|
46
|
+
useUpdateEffect(function () {
|
|
47
|
+
if (animation) {
|
|
48
|
+
animation.setLoop(loop);
|
|
49
|
+
animation.setSpeed(speed);
|
|
50
|
+
}
|
|
51
|
+
}, [loop, speed]);
|
|
52
|
+
useImperativeHandle(ref, function () {
|
|
53
|
+
return {
|
|
54
|
+
animation: animation
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
58
|
+
ref: containerRef,
|
|
59
|
+
className: classNames(className, _defineProperty({}, 'anticon', mode === 'icon')),
|
|
60
|
+
style: _objectSpread({
|
|
61
|
+
display: 'inline-block'
|
|
62
|
+
}, style)
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
export default Lottie;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ModalProps } from 'antd/es/modal';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare const Modal: {
|
|
4
|
+
({ prefixCls: customizePrefixCls, className, ...restProps }: ModalProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
5
|
+
info(props: any): {
|
|
6
|
+
destroy: () => void;
|
|
7
|
+
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
|
8
|
+
};
|
|
9
|
+
success(props: any): {
|
|
10
|
+
destroy: () => void;
|
|
11
|
+
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
|
12
|
+
};
|
|
13
|
+
error(props: any): {
|
|
14
|
+
destroy: () => void;
|
|
15
|
+
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
|
16
|
+
};
|
|
17
|
+
warning(props: any): {
|
|
18
|
+
destroy: () => void;
|
|
19
|
+
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
|
20
|
+
};
|
|
21
|
+
confirm(props: any): {
|
|
22
|
+
destroy: () => void;
|
|
23
|
+
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
|
24
|
+
};
|
|
25
|
+
useModal: typeof import("antd/es/modal/useModal").default;
|
|
26
|
+
destroyAll: () => void;
|
|
27
|
+
config: typeof import("antd/es/modal/confirm").modalGlobalConfig;
|
|
28
|
+
displayName: string;
|
|
29
|
+
};
|
|
30
|
+
export default Modal;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
var _excluded = ["prefixCls", "className"];
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
|
+
import { Modal as AntModal } from 'antd';
|
|
6
|
+
import classNames from 'classnames';
|
|
7
|
+
import React, { useContext } from 'react';
|
|
8
|
+
import ConfigProvider from "../config-provider";
|
|
9
|
+
import { modal } from "../static-function";
|
|
10
|
+
import useStyle from "./style";
|
|
11
|
+
var Modal = function Modal(_ref) {
|
|
12
|
+
var customizePrefixCls = _ref.prefixCls,
|
|
13
|
+
className = _ref.className,
|
|
14
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
15
|
+
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
16
|
+
getPrefixCls = _useContext.getPrefixCls;
|
|
17
|
+
var prefixCls = getPrefixCls('modal', customizePrefixCls);
|
|
18
|
+
var _useStyle = useStyle(prefixCls),
|
|
19
|
+
wrapSSR = _useStyle.wrapSSR;
|
|
20
|
+
var modalCls = classNames(className);
|
|
21
|
+
return wrapSSR( /*#__PURE__*/React.createElement(AntModal, _extends({
|
|
22
|
+
prefixCls: customizePrefixCls,
|
|
23
|
+
className: modalCls
|
|
24
|
+
}, restProps)));
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// 替换 Modal 上的静态方法,支持消费 ConfigProvider 配置
|
|
28
|
+
// 注意: 不能使用 Modal.info = modal.info 进行属性赋值,需要新建函数赋值,否则仍然无法消费 ConfigProvider 配置
|
|
29
|
+
Modal.info = function (props) {
|
|
30
|
+
return modal.info(props);
|
|
31
|
+
};
|
|
32
|
+
Modal.success = function (props) {
|
|
33
|
+
return modal.success(props);
|
|
34
|
+
};
|
|
35
|
+
Modal.error = function (props) {
|
|
36
|
+
return modal.error(props);
|
|
37
|
+
};
|
|
38
|
+
Modal.warning = function (props) {
|
|
39
|
+
return modal.warning(props);
|
|
40
|
+
};
|
|
41
|
+
Modal.confirm = function (props) {
|
|
42
|
+
return modal.confirm(props);
|
|
43
|
+
};
|
|
44
|
+
Modal.useModal = AntModal.useModal;
|
|
45
|
+
Modal.destroyAll = AntModal.destroyAll;
|
|
46
|
+
Modal.config = AntModal.config;
|
|
47
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
48
|
+
Modal.displayName = AntModal.displayName;
|
|
49
|
+
}
|
|
50
|
+
export default Modal;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ModalProps } from 'antd/es/modal';
|
|
3
|
+
import type { ProgressProps } from 'antd/es/progress';
|
|
4
|
+
export interface ModalProgressProps extends ModalProps {
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
progress?: ProgressProps;
|
|
7
|
+
description?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
declare const Progress: ({ prefixCls: customizePrefixCls, className, width, maskClosable, loading, progress, description, footer, ...restProps }: ModalProgressProps) => React.JSX.Element;
|
|
10
|
+
export default Progress;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
var _excluded = ["prefixCls", "className", "width", "maskClosable", "loading", "progress", "description", "footer"];
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
|
+
import React, { useContext } from 'react';
|
|
6
|
+
import { Progress as AntProgress } from 'antd';
|
|
7
|
+
import classNames from 'classnames';
|
|
8
|
+
import ConfigProvider from "../config-provider";
|
|
9
|
+
import Modal from "./Modal";
|
|
10
|
+
import { LoadingOutlined } from '@oceanbase/icons';
|
|
11
|
+
var Progress = function Progress(_ref) {
|
|
12
|
+
var customizePrefixCls = _ref.prefixCls,
|
|
13
|
+
className = _ref.className,
|
|
14
|
+
_ref$width = _ref.width,
|
|
15
|
+
width = _ref$width === void 0 ? 567 : _ref$width,
|
|
16
|
+
_ref$maskClosable = _ref.maskClosable,
|
|
17
|
+
maskClosable = _ref$maskClosable === void 0 ? false : _ref$maskClosable,
|
|
18
|
+
loading = _ref.loading,
|
|
19
|
+
progress = _ref.progress,
|
|
20
|
+
description = _ref.description,
|
|
21
|
+
_ref$footer = _ref.footer,
|
|
22
|
+
footer = _ref$footer === void 0 ? null : _ref$footer,
|
|
23
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
24
|
+
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
25
|
+
getPrefixCls = _useContext.getPrefixCls;
|
|
26
|
+
var prefixCls = getPrefixCls('modal', customizePrefixCls);
|
|
27
|
+
var progressModalCls = classNames("".concat(prefixCls, "-progress"), className);
|
|
28
|
+
return /*#__PURE__*/React.createElement(Modal, _extends({
|
|
29
|
+
prefixCls: customizePrefixCls,
|
|
30
|
+
className: progressModalCls,
|
|
31
|
+
width: width,
|
|
32
|
+
maskClosable: maskClosable,
|
|
33
|
+
footer: footer
|
|
34
|
+
}, restProps), /*#__PURE__*/React.createElement(React.Fragment, null, loading ? /*#__PURE__*/React.createElement(LoadingOutlined, {
|
|
35
|
+
className: "".concat(prefixCls, "-progress-loading")
|
|
36
|
+
}) : /*#__PURE__*/React.createElement(AntProgress, _extends({
|
|
37
|
+
type: "circle",
|
|
38
|
+
size: 200
|
|
39
|
+
}, progress)), description && /*#__PURE__*/React.createElement("div", {
|
|
40
|
+
className: "".concat(prefixCls, "-progress-description")
|
|
41
|
+
}, description)));
|
|
42
|
+
};
|
|
43
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
44
|
+
Modal.displayName = 'Modal.Progress';
|
|
45
|
+
}
|
|
46
|
+
export default Progress;
|
package/es/modal/index.d.ts
CHANGED
|
@@ -1,32 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import Progress from './Progress';
|
|
2
|
+
import OriginModal from './Modal';
|
|
3
3
|
export * from 'antd/es/modal';
|
|
4
|
-
export type
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
info(props: any): {
|
|
8
|
-
destroy: () => void;
|
|
9
|
-
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
|
10
|
-
};
|
|
11
|
-
success(props: any): {
|
|
12
|
-
destroy: () => void;
|
|
13
|
-
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
|
14
|
-
};
|
|
15
|
-
error(props: any): {
|
|
16
|
-
destroy: () => void;
|
|
17
|
-
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
|
18
|
-
};
|
|
19
|
-
warning(props: any): {
|
|
20
|
-
destroy: () => void;
|
|
21
|
-
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
|
22
|
-
};
|
|
23
|
-
confirm(props: any): {
|
|
24
|
-
destroy: () => void;
|
|
25
|
-
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
|
26
|
-
};
|
|
27
|
-
useModal: typeof import("antd/es/modal/useModal").default;
|
|
28
|
-
destroyAll: () => void;
|
|
29
|
-
config: typeof import("antd/es/modal/confirm").modalGlobalConfig;
|
|
30
|
-
displayName: string;
|
|
4
|
+
export type { ModalProgressProps } from './Progress';
|
|
5
|
+
export type ModalType = typeof OriginModal & {
|
|
6
|
+
Progress: typeof Progress;
|
|
31
7
|
};
|
|
32
|
-
|
|
8
|
+
declare const _default: ModalType;
|
|
9
|
+
export default _default;
|
package/es/modal/index.js
CHANGED
|
@@ -1,54 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
|
-
import { Modal as AntModal } from 'antd';
|
|
6
|
-
import classNames from 'classnames';
|
|
7
|
-
import React, { useContext } from 'react';
|
|
8
|
-
import ConfigProvider from "../config-provider";
|
|
9
|
-
import { modal } from "../static-function";
|
|
10
|
-
import useStyle from "./style";
|
|
1
|
+
import Progress from "./Progress";
|
|
2
|
+
import OriginModal from "./Modal";
|
|
11
3
|
export * from 'antd/es/modal';
|
|
12
|
-
var Modal =
|
|
13
|
-
|
|
14
|
-
className = _ref.className,
|
|
15
|
-
rootClassName = _ref.rootClassName,
|
|
16
|
-
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
17
|
-
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
18
|
-
getPrefixCls = _useContext.getPrefixCls;
|
|
19
|
-
var prefixCls = getPrefixCls('modal', customizePrefixCls);
|
|
20
|
-
var _useStyle = useStyle(prefixCls),
|
|
21
|
-
wrapSSR = _useStyle.wrapSSR,
|
|
22
|
-
hashId = _useStyle.hashId;
|
|
23
|
-
var modalCls = classNames(className, hashId);
|
|
24
|
-
return wrapSSR( /*#__PURE__*/React.createElement(AntModal, _extends({
|
|
25
|
-
prefixCls: customizePrefixCls,
|
|
26
|
-
className: modalCls,
|
|
27
|
-
rootClassName: classNames(rootClassName, hashId)
|
|
28
|
-
}, restProps)));
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
// 替换 Modal 上的静态方法,支持消费 ConfigProvider 配置
|
|
32
|
-
// 注意: 不能使用 Modal.info = modal.info 进行属性赋值,需要新建函数赋值,否则仍然无法消费 ConfigProvider 配置
|
|
33
|
-
Modal.info = function (props) {
|
|
34
|
-
return modal.info(props);
|
|
35
|
-
};
|
|
36
|
-
Modal.success = function (props) {
|
|
37
|
-
return modal.success(props);
|
|
38
|
-
};
|
|
39
|
-
Modal.error = function (props) {
|
|
40
|
-
return modal.error(props);
|
|
41
|
-
};
|
|
42
|
-
Modal.warning = function (props) {
|
|
43
|
-
return modal.warning(props);
|
|
44
|
-
};
|
|
45
|
-
Modal.confirm = function (props) {
|
|
46
|
-
return modal.confirm(props);
|
|
47
|
-
};
|
|
48
|
-
Modal.useModal = AntModal.useModal;
|
|
49
|
-
Modal.destroyAll = AntModal.destroyAll;
|
|
50
|
-
Modal.config = AntModal.config;
|
|
51
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
52
|
-
Modal.displayName = AntModal.displayName;
|
|
53
|
-
}
|
|
4
|
+
var Modal = OriginModal;
|
|
5
|
+
Modal.Progress = Progress;
|
|
54
6
|
export default Modal;
|