@oceanbase/design 1.0.0-alpha.0 → 1.0.0-alpha.10
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.css +1 -1
- package/dist/design.min.js +1 -1
- package/dist/reset.css +2 -1
- package/dist/static/Inter-Medium.ea234620.woff2 +0 -0
- package/dist/static/Inter-Regular.34ba43c9.woff2 +0 -0
- package/dist/static/Inter-SemiBold.95439fb4.woff2 +0 -0
- package/es/_util/genComponentStyleHook.d.ts +21 -4
- package/es/_util/genComponentStyleHook.js +68 -20
- package/es/alert/index.d.ts +2 -2
- package/es/alert/index.js +22 -6
- package/es/alert/style/index.d.ts +2 -5
- package/es/alert/style/index.js +157 -67
- package/es/app/index.d.ts +8 -0
- package/es/app/index.js +43 -1
- package/es/app/style/index.d.ts +6 -0
- package/es/app/style/index.js +9 -0
- package/es/badge/index.js +15 -7
- package/es/badge/style/index.d.ts +2 -5
- package/es/badge/style/index.js +13 -18
- package/es/button/index.js +10 -4
- package/es/button/style/index.d.ts +4 -5
- package/es/button/style/index.js +40 -7
- package/es/card/index.d.ts +11 -0
- package/es/card/index.js +151 -9
- package/es/card/style/index.d.ts +2 -5
- package/es/card/style/index.js +83 -18
- package/es/checkbox/index.js +9 -2
- package/es/checkbox/style/index.d.ts +2 -5
- package/es/checkbox/style/index.js +14 -11
- package/es/config-provider/context.d.ts +11 -0
- package/es/config-provider/context.js +2 -1
- package/es/config-provider/index.d.ts +4 -3
- package/es/config-provider/index.js +92 -40
- package/es/descriptions/index.d.ts +10 -0
- package/es/descriptions/index.js +62 -5
- package/es/descriptions/style/index.d.ts +3 -6
- package/es/descriptions/style/index.js +70 -10
- package/es/drawer/index.js +10 -7
- package/es/drawer/style/index.d.ts +2 -5
- package/es/drawer/style/index.js +44 -17
- package/es/dropdown/dropdown-button.js +26 -6
- package/es/dropdown/style/index.d.ts +6 -0
- package/es/{_util/genStyle.js → dropdown/style/index.js} +14 -11
- package/es/empty/index.js +4 -3
- package/es/empty/style/index.d.ts +2 -5
- package/es/empty/style/index.js +10 -10
- package/es/fonts/Inter-Medium.woff2 +0 -0
- package/es/fonts/Inter-Regular.woff2 +0 -0
- package/es/fonts/Inter-SemiBold.woff2 +0 -0
- package/es/form/FormItem.d.ts +2 -1
- package/es/form/FormItem.js +26 -11
- package/es/form/index.js +9 -2
- package/es/form/style/index.d.ts +2 -5
- package/es/form/style/index.js +19 -8
- package/es/index.d.ts +4 -3
- package/es/index.js +1 -1
- package/es/input/Input.d.ts +2 -0
- package/es/input/Input.js +30 -7
- package/es/input/Password.js +24 -5
- package/es/input/Search.js +24 -5
- package/es/input/TextArea.js +24 -5
- package/es/input/style/index.d.ts +6 -0
- package/es/input/style/index.js +32 -0
- package/es/input-number/index.d.ts +2 -1
- package/es/input-number/index.js +18 -4
- package/es/input-number/style/index.d.ts +6 -0
- package/es/input-number/style/index.js +19 -0
- package/es/locale/en-US.js +4 -1
- package/es/locale/index.d.ts +2 -0
- package/es/locale/ja-JP.d.ts +3 -0
- package/es/locale/ja-JP.js +31 -0
- package/es/locale/zh-CN.js +4 -1
- package/es/locale/zh-TW.js +4 -1
- package/es/modal/Modal.js +29 -8
- package/es/modal/style/index.d.ts +2 -5
- package/es/modal/style/index.js +67 -26
- package/es/radio/index.js +9 -2
- package/es/radio/style/index.d.ts +2 -5
- package/es/radio/style/index.js +16 -10
- package/es/result/index.d.ts +2 -2
- package/es/result/index.js +14 -6
- package/es/result/style/index.d.ts +2 -5
- package/es/result/style/index.js +3 -6
- package/es/segmented/index.d.ts +1 -0
- package/es/segmented/index.js +24 -9
- package/es/segmented/style/index.d.ts +1 -4
- package/es/segmented/style/index.js +4 -6
- package/es/select/index.js +9 -2
- package/es/select/style/index.d.ts +2 -5
- package/es/select/style/index.js +6 -7
- package/es/slider/index.js +9 -2
- package/es/slider/style/index.d.ts +2 -5
- package/es/slider/style/index.js +11 -11
- package/es/space/index.js +9 -2
- package/es/space/style/index.d.ts +2 -5
- package/es/space/style/index.js +3 -6
- package/es/spin/index.js +9 -2
- package/es/spin/style/index.d.ts +2 -5
- package/es/spin/style/index.js +27 -27
- package/es/static-function/index.js +13 -4
- package/es/style/cssVariables.d.ts +25 -0
- package/es/style/cssVariables.js +48 -0
- package/es/style/cssVariablesMeta.d.ts +24 -0
- package/es/style/cssVariablesMeta.js +974 -0
- package/es/style/global.d.ts +8 -0
- package/es/style/global.js +121 -0
- package/es/style/reset.css +2 -1
- package/es/switch/index.js +9 -2
- package/es/switch/style/index.d.ts +2 -5
- package/es/switch/style/index.js +3 -6
- package/es/table/index.d.ts +1 -4
- package/es/table/index.js +67 -34
- package/es/table/style/index.d.ts +2 -5
- package/es/table/style/index.js +58 -36
- package/es/tabs/index.js +9 -2
- package/es/tabs/style/index.d.ts +2 -5
- package/es/tabs/style/index.js +10 -10
- package/es/tag/index.d.ts +1 -0
- package/es/tag/index.js +17 -4
- package/es/tag/style/index.d.ts +3 -8
- package/es/tag/style/index.js +39 -35
- package/es/theme/compact.d.ts +1 -1
- package/es/theme/compact.js +2 -6
- package/es/theme/dark.d.ts +1 -48
- package/es/theme/default.d.ts +48 -2
- package/es/theme/default.js +333 -78
- package/es/theme/index.d.ts +20 -57
- package/es/theme/interface.d.ts +130 -0
- package/es/theme/interface.js +4 -1
- package/es/theme/style/aliyun.less +86 -86
- package/es/theme/style/compact.less +199 -170
- package/es/theme/style/dark.less +103 -103
- package/es/theme/style/default.less +202 -173
- package/es/tooltip/index.js +4 -4
- package/es/tooltip/style/index.d.ts +2 -5
- package/es/tooltip/style/index.js +10 -13
- package/es/tree-select/index.js +9 -2
- package/es/tree-select/style/index.d.ts +2 -5
- package/es/tree-select/style/index.js +3 -6
- package/es/typography/Link.js +9 -2
- package/es/typography/Paragraph.js +9 -2
- package/es/typography/Text.d.ts +1 -0
- package/es/typography/Text.js +12 -4
- package/es/typography/Title.js +9 -2
- package/es/typography/hooks/useClassName.d.ts +1 -1
- package/es/typography/hooks/useClassName.js +2 -2
- package/es/typography/index.d.ts +12 -1
- package/es/typography/index.js +2 -1
- package/es/typography/style/index.d.ts +2 -5
- package/es/typography/style/index.js +36 -28
- package/lib/_util/genComponentStyleHook.d.ts +21 -4
- package/lib/_util/genComponentStyleHook.js +50 -31
- package/lib/alert/index.d.ts +2 -2
- package/lib/alert/index.js +20 -11
- package/lib/alert/style/index.d.ts +2 -5
- package/lib/alert/style/index.js +174 -79
- package/lib/app/index.d.ts +8 -0
- package/lib/app/index.js +36 -1
- package/lib/app/style/index.d.ts +6 -0
- package/lib/{_util/getWeakenBorderColor.js → app/style/index.js} +15 -10
- package/lib/badge/index.js +32 -23
- package/lib/badge/style/index.d.ts +2 -5
- package/lib/badge/style/index.js +14 -16
- package/lib/button/index.js +5 -4
- package/lib/button/style/index.d.ts +4 -5
- package/lib/button/style/index.js +48 -9
- package/lib/card/index.d.ts +11 -0
- package/lib/card/index.js +160 -12
- package/lib/card/style/index.d.ts +2 -5
- package/lib/card/style/index.js +132 -21
- package/lib/checkbox/index.js +4 -3
- package/lib/checkbox/style/index.d.ts +2 -5
- package/lib/checkbox/style/index.js +10 -8
- package/lib/config-provider/DefaultRenderEmpty.js +4 -3
- package/lib/config-provider/context.d.ts +11 -0
- package/lib/config-provider/index.d.ts +4 -3
- package/lib/config-provider/index.js +133 -30
- package/lib/descriptions/hooks/useItems.js +5 -4
- package/lib/descriptions/index.d.ts +10 -0
- package/lib/descriptions/index.js +54 -6
- package/lib/descriptions/style/index.d.ts +3 -6
- package/lib/descriptions/style/index.js +117 -7
- package/lib/drawer/index.js +46 -35
- package/lib/drawer/style/index.d.ts +2 -5
- package/lib/drawer/style/index.js +44 -14
- package/lib/dropdown/dropdown-button.js +26 -3
- package/lib/dropdown/index.js +2 -2
- package/lib/dropdown/style/index.d.ts +6 -0
- package/lib/dropdown/style/index.js +46 -0
- 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 +25 -20
- package/lib/empty/style/index.d.ts +2 -5
- package/lib/empty/style/index.js +9 -10
- package/lib/fonts/Inter-Medium.woff2 +0 -0
- package/lib/fonts/Inter-Regular.woff2 +0 -0
- package/lib/fonts/Inter-SemiBold.woff2 +0 -0
- package/lib/form/FormItem.d.ts +2 -1
- package/lib/form/FormItem.js +19 -8
- package/lib/form/index.js +8 -5
- package/lib/form/style/index.d.ts +2 -5
- package/lib/form/style/index.js +28 -7
- package/lib/grid/col.js +2 -1
- package/lib/grid/row.js +2 -1
- package/lib/index.d.ts +4 -3
- package/lib/index.js +3 -1
- package/lib/input/Input.d.ts +2 -0
- package/lib/input/Input.js +37 -13
- package/lib/input/Password.js +22 -4
- package/lib/input/Search.js +32 -12
- package/lib/input/TextArea.js +22 -4
- package/lib/input/style/index.d.ts +6 -0
- package/lib/input/style/index.js +74 -0
- package/lib/input-number/index.d.ts +2 -1
- package/lib/input-number/index.js +19 -3
- package/lib/input-number/style/index.d.ts +6 -0
- package/lib/{_util/genStyle.js → input-number/style/index.js} +22 -17
- package/lib/list/index.js +3 -2
- package/lib/locale/en-US.js +3 -0
- package/lib/locale/index.d.ts +2 -0
- package/lib/locale/ja-JP.d.ts +3 -0
- package/lib/locale/ja-JP.js +63 -0
- package/lib/locale/zh-CN.js +3 -0
- package/lib/locale/zh-TW.js +3 -0
- package/lib/lottie/index.js +2 -1
- package/lib/modal/Modal.js +35 -11
- package/lib/modal/Progress.js +9 -5
- package/lib/modal/style/index.d.ts +2 -5
- package/lib/modal/style/index.js +81 -24
- package/lib/radio/index.js +4 -3
- package/lib/radio/style/index.d.ts +2 -5
- package/lib/radio/style/index.js +17 -8
- 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 +14 -13
- package/lib/result/style/index.d.ts +2 -5
- package/lib/result/style/index.js +3 -6
- package/lib/segmented/index.d.ts +1 -0
- package/lib/segmented/index.js +17 -6
- package/lib/segmented/style/index.d.ts +1 -4
- package/lib/segmented/style/index.js +4 -6
- package/lib/select/index.js +4 -3
- package/lib/select/style/index.d.ts +2 -5
- package/lib/select/style/index.js +7 -7
- package/lib/slider/index.js +4 -3
- package/lib/slider/style/index.d.ts +2 -5
- package/lib/slider/style/index.js +12 -11
- package/lib/space/index.js +3 -2
- package/lib/space/style/index.d.ts +2 -5
- package/lib/space/style/index.js +3 -6
- package/lib/spin/index.js +7 -6
- package/lib/spin/style/index.d.ts +2 -5
- package/lib/spin/style/index.js +26 -28
- package/lib/static-function/index.js +7 -1
- package/lib/style/cssVariables.d.ts +25 -0
- package/lib/style/cssVariables.js +261 -0
- package/lib/style/cssVariablesMeta.d.ts +24 -0
- package/lib/style/cssVariablesMeta.js +1059 -0
- package/lib/style/global.d.ts +8 -0
- package/lib/style/global.js +176 -0
- package/lib/style/reset.css +2 -1
- package/lib/switch/index.js +4 -3
- package/lib/switch/style/index.d.ts +2 -5
- package/lib/switch/style/index.js +3 -6
- package/lib/table/index.d.ts +1 -4
- package/lib/table/index.js +114 -68
- package/lib/table/style/index.d.ts +2 -5
- package/lib/table/style/index.js +68 -32
- package/lib/tabs/index.js +12 -7
- package/lib/tabs/style/index.d.ts +2 -5
- package/lib/tabs/style/index.js +12 -8
- package/lib/tag/index.d.ts +1 -0
- package/lib/tag/index.js +18 -8
- package/lib/tag/style/index.d.ts +3 -8
- package/lib/tag/style/index.js +45 -36
- package/lib/theme/compact.d.ts +1 -1
- package/lib/theme/compact.js +1 -5
- package/lib/theme/dark.d.ts +1 -48
- package/lib/theme/default.d.ts +48 -2
- package/lib/theme/default.js +412 -79
- package/lib/theme/index.d.ts +20 -57
- package/lib/theme/interface.d.ts +130 -0
- package/lib/theme/style/aliyun.less +86 -86
- package/lib/theme/style/compact.less +199 -170
- package/lib/theme/style/dark.less +103 -103
- package/lib/theme/style/default.less +202 -173
- package/lib/tooltip/MouseTooltip.js +43 -39
- package/lib/tooltip/ReactStickyMouseTooltip.js +5 -4
- package/lib/tooltip/index.js +17 -13
- package/lib/tooltip/style/index.d.ts +2 -5
- package/lib/tooltip/style/index.js +10 -13
- package/lib/tree-select/index.js +4 -3
- package/lib/tree-select/style/index.d.ts +2 -5
- package/lib/tree-select/style/index.js +3 -6
- package/lib/typography/Link.js +7 -6
- package/lib/typography/Paragraph.js +7 -6
- package/lib/typography/Text.d.ts +1 -0
- package/lib/typography/Text.js +9 -8
- package/lib/typography/Title.js +7 -6
- package/lib/typography/hooks/useClassName.d.ts +1 -1
- package/lib/typography/hooks/useClassName.js +3 -2
- package/lib/typography/index.d.ts +12 -1
- package/lib/typography/index.js +6 -5
- package/lib/typography/style/index.d.ts +2 -5
- package/lib/typography/style/index.js +34 -26
- package/package.json +11 -10
- package/dist/static/Inter.f6bcdfb6.woff2 +0 -0
- package/es/_util/genStyle.d.ts +0 -2
- package/es/_util/getWeakenBorderColor.d.ts +0 -1
- package/es/_util/getWeakenBorderColor.js +0 -4
- package/es/fonts/Inter.woff2 +0 -0
- package/es/global.css +0 -48
- package/lib/_util/genStyle.d.ts +0 -2
- package/lib/_util/getWeakenBorderColor.d.ts +0 -1
- package/lib/fonts/Inter.woff2 +0 -0
- package/lib/global.css +0 -48
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { FullToken, GenerateStyle } from '
|
|
2
|
+
import type { FullToken, GenerateStyle } from '../../theme/interface';
|
|
3
3
|
export type BadgeToken = FullToken<'Badge'>;
|
|
4
4
|
export declare const genBadgeStyle: GenerateStyle<BadgeToken>;
|
|
5
|
-
declare const _default: (prefixCls: string) =>
|
|
6
|
-
wrapSSR: (node: import("react").ReactNode) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
7
|
-
hashId: string;
|
|
8
|
-
};
|
|
5
|
+
declare const _default: (prefixCls: string, rootCls?: string) => readonly [(node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>, string, string];
|
|
9
6
|
export default _default;
|
package/es/badge/style/index.js
CHANGED
|
@@ -2,20 +2,17 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2
2
|
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; }
|
|
3
3
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
4
4
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
5
|
-
import {
|
|
5
|
+
import { genStyleHooks } from "../../_util/genComponentStyleHook";
|
|
6
6
|
export var genBadgeStyle = function genBadgeStyle(token) {
|
|
7
7
|
var componentCls = token.componentCls;
|
|
8
|
-
// dot size is larger than antd
|
|
9
|
-
var dotSize = token.fontSizeLG / 2;
|
|
10
8
|
return _defineProperty(_defineProperty({}, "".concat(componentCls), {
|
|
11
|
-
//
|
|
12
|
-
color: 'inherit'
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
})), "".concat(componentCls, "-status-icon"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
9
|
+
// make status text inherit parent style
|
|
10
|
+
color: 'inherit',
|
|
11
|
+
fontSize: 'inherit'
|
|
12
|
+
}), "".concat(componentCls).concat(componentCls, "-status"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-status-dot"), _defineProperty({}, "&".concat(componentCls, "-status-default"), {})), "".concat(componentCls, "-status-processing::after"), {
|
|
13
|
+
// remove animation for processing status dot
|
|
14
|
+
display: 'none'
|
|
15
|
+
}), "".concat(componentCls, "-status-icon"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
19
16
|
// remove dot style
|
|
20
17
|
backgroundColor: 'transparent'
|
|
21
18
|
}, '&::after', {
|
|
@@ -32,13 +29,11 @@ export var genBadgeStyle = function genBadgeStyle(token) {
|
|
|
32
29
|
color: token.colorWarning
|
|
33
30
|
})), "".concat(componentCls, "-status-text"), {
|
|
34
31
|
marginInlineStart: token.marginXS,
|
|
35
|
-
// inherit
|
|
36
|
-
color: 'inherit'
|
|
32
|
+
// inherit style from parent
|
|
33
|
+
color: 'inherit',
|
|
34
|
+
fontSize: 'inherit'
|
|
37
35
|
}));
|
|
38
36
|
};
|
|
39
|
-
export default (function (
|
|
40
|
-
|
|
41
|
-
return [genBadgeStyle(token)];
|
|
42
|
-
});
|
|
43
|
-
return useStyle(prefixCls);
|
|
37
|
+
export default genStyleHooks('Badge', function (token) {
|
|
38
|
+
return [genBadgeStyle(token)];
|
|
44
39
|
});
|
package/es/button/index.js
CHANGED
|
@@ -5,6 +5,12 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
5
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
6
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
7
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
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(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
13
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
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; }
|
|
9
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; }
|
|
10
16
|
import { Button as AntButton } from 'antd';
|
|
@@ -19,13 +25,13 @@ var Button = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
19
25
|
className = _ref.className,
|
|
20
26
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
21
27
|
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
22
|
-
theme = _useContext.theme,
|
|
23
28
|
getPrefixCls = _useContext.getPrefixCls;
|
|
24
29
|
var prefixCls = getPrefixCls('btn', customizePrefixCls);
|
|
25
|
-
var _useStyle = useStyle(prefixCls
|
|
26
|
-
|
|
30
|
+
var _useStyle = useStyle(prefixCls),
|
|
31
|
+
_useStyle2 = _slicedToArray(_useStyle, 1),
|
|
32
|
+
wrapCSSVar = _useStyle2[0];
|
|
27
33
|
var buttonCls = classNames(className);
|
|
28
|
-
return
|
|
34
|
+
return wrapCSSVar( /*#__PURE__*/_jsx(AntButton, _objectSpread({
|
|
29
35
|
ref: ref,
|
|
30
36
|
prefixCls: customizePrefixCls,
|
|
31
37
|
className: buttonCls
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
2
|
+
import type { CSSObject } from '@ant-design/cssinjs';
|
|
3
|
+
import type { FullToken, GenerateStyle } from '../../theme/interface';
|
|
3
4
|
export type ButtonToken = FullToken<'Button'>;
|
|
5
|
+
export declare const genPresetColorStyle: (token: ButtonToken) => Record<string, CSSObject>;
|
|
4
6
|
export declare const genButtonStyle: GenerateStyle<ButtonToken>;
|
|
5
|
-
declare const _default: (prefixCls: string,
|
|
6
|
-
wrapSSR: (node: import("react").ReactNode) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
7
|
-
hashId: string;
|
|
8
|
-
};
|
|
7
|
+
declare const _default: (prefixCls: string, rootCls?: string) => readonly [(node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>, string, string];
|
|
9
8
|
export default _default;
|
package/es/button/style/index.js
CHANGED
|
@@ -1,10 +1,43 @@
|
|
|
1
|
-
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
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; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
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); }
|
|
10
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
11
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
12
|
+
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; }
|
|
13
|
+
import { PresetColors } from "../../theme/interface";
|
|
14
|
+
import { genStyleHooks } from "../../_util/genComponentStyleHook";
|
|
15
|
+
export var genPresetColorStyle = function genPresetColorStyle(token) {
|
|
16
|
+
var componentCls = token.componentCls;
|
|
17
|
+
var addPresetColors = ['primary', 'dangerous'];
|
|
18
|
+
return [].concat(_toConsumableArray(PresetColors), addPresetColors).reduce(function (prev, colorKey) {
|
|
19
|
+
var colorKeyMap = {
|
|
20
|
+
primary: 'blue',
|
|
21
|
+
dangerous: 'red'
|
|
22
|
+
};
|
|
23
|
+
var bgColor = addPresetColors.includes(colorKey) ? token["".concat(colorKeyMap[colorKey], "4")] : token["".concat(colorKey, "6")];
|
|
24
|
+
return _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, "&".concat(componentCls, "-color-").concat(colorKey, ":hover"), {
|
|
25
|
+
color: token.colorTextLightSolid,
|
|
26
|
+
background: bgColor,
|
|
27
|
+
borderColor: bgColor
|
|
28
|
+
}));
|
|
29
|
+
}, {});
|
|
30
|
+
};
|
|
2
31
|
export var genButtonStyle = function genButtonStyle(token) {
|
|
3
|
-
|
|
32
|
+
var componentCls = token.componentCls;
|
|
33
|
+
return _defineProperty({}, "".concat(componentCls), _defineProperty({
|
|
34
|
+
// remove box-shadow for button
|
|
35
|
+
boxShadow: 'none !important'
|
|
36
|
+
}, "&".concat(componentCls, "-variant-outlined, &").concat(componentCls, "-variant-dashed"), _defineProperty({}, "&:not(:disabled):not(".concat(componentCls, "-disabled):hover"), _defineProperty(_defineProperty({}, "&:not(".concat(componentCls, "-color-dangerous)"), {
|
|
37
|
+
borderColor: token.gray7,
|
|
38
|
+
color: token.colorText
|
|
39
|
+
}), "&:not(".concat(componentCls, "-loading)"), _objectSpread({}, genPresetColorStyle(token))))));
|
|
4
40
|
};
|
|
5
|
-
export default (function (
|
|
6
|
-
|
|
7
|
-
return isAliyun ? [] : [genButtonStyle(token)];
|
|
8
|
-
});
|
|
9
|
-
return useStyle(prefixCls);
|
|
41
|
+
export default genStyleHooks('Button', function (token) {
|
|
42
|
+
return [genButtonStyle(token)];
|
|
10
43
|
});
|
package/es/card/index.d.ts
CHANGED
|
@@ -5,9 +5,20 @@ export * from 'antd/es/card';
|
|
|
5
5
|
export interface CardTabListType extends AntCardTabListType {
|
|
6
6
|
tag?: React.ReactNode;
|
|
7
7
|
}
|
|
8
|
+
export interface CardLocale {
|
|
9
|
+
viewDocument?: string;
|
|
10
|
+
}
|
|
8
11
|
export interface CardProps extends AntCardProps {
|
|
12
|
+
subTitle?: React.ReactNode;
|
|
13
|
+
document?: string | React.MouseEventHandler<HTMLAnchorElement> | React.ReactNode;
|
|
9
14
|
divided?: boolean;
|
|
15
|
+
gray?: boolean;
|
|
10
16
|
tabList?: CardTabListType[];
|
|
17
|
+
collapsible?: boolean;
|
|
18
|
+
defaultCollapsed?: boolean;
|
|
19
|
+
collapsed?: boolean;
|
|
20
|
+
onCollapse?: (collapsed: boolean) => void;
|
|
21
|
+
locale?: CardLocale;
|
|
11
22
|
}
|
|
12
23
|
declare const _default: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>> & {
|
|
13
24
|
Grid: React.FC<import("antd/es/card").CardGridProps>;
|
package/es/card/index.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["children", "size", "title", "tabList", "divided", "prefixCls", "bodyStyle", "styles", "className"];
|
|
2
|
+
var _excluded = ["children", "size", "title", "subTitle", "document", "extra", "tabList", "tabProps", "tabBarExtraContent", "divided", "gray", "prefixCls", "bodyStyle", "styles", "className", "collapsible", "defaultCollapsed", "collapsed", "onCollapse", "locale"];
|
|
3
|
+
import { useUniqueInlineId } from '@inline-svg-unique-id/react';
|
|
4
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
5
|
+
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."); }
|
|
6
|
+
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); }
|
|
7
|
+
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; }
|
|
8
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
9
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
3
10
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
11
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
12
|
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; }
|
|
@@ -8,14 +15,18 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
8
15
|
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; }
|
|
9
16
|
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; }
|
|
10
17
|
import { isNullValue } from '@oceanbase/util';
|
|
11
|
-
import { Card as AntCard, Space, Tag } from 'antd';
|
|
18
|
+
import { Card as AntCard, Space, Tag, Divider, Tooltip } from 'antd';
|
|
12
19
|
import classNames from 'classnames';
|
|
13
|
-
import React, { useContext } from 'react';
|
|
20
|
+
import React, { useContext, useState, useMemo, useCallback } from 'react';
|
|
21
|
+
import { CaretRightFilled } from '@oceanbase/icons';
|
|
14
22
|
import ConfigProvider from "../config-provider";
|
|
23
|
+
import defaultLocale from "../locale/en-US";
|
|
15
24
|
import { isHorizontalPaddingZero } from "../_util";
|
|
25
|
+
import theme from "../theme";
|
|
16
26
|
import useStyle, { genTableStyle } from "./style";
|
|
17
27
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
28
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
29
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
19
30
|
export * from 'antd/es/card/Card';
|
|
20
31
|
export * from 'antd/es/card';
|
|
21
32
|
var Card = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
@@ -23,25 +34,121 @@ var Card = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
23
34
|
var children = _ref.children,
|
|
24
35
|
size = _ref.size,
|
|
25
36
|
title = _ref.title,
|
|
37
|
+
subTitle = _ref.subTitle,
|
|
38
|
+
document = _ref.document,
|
|
39
|
+
extra = _ref.extra,
|
|
26
40
|
tabList = _ref.tabList,
|
|
41
|
+
tabProps = _ref.tabProps,
|
|
42
|
+
tabBarExtraContent = _ref.tabBarExtraContent,
|
|
27
43
|
outerDivided = _ref.divided,
|
|
44
|
+
gray = _ref.gray,
|
|
28
45
|
customizePrefixCls = _ref.prefixCls,
|
|
29
46
|
bodyStyle = _ref.bodyStyle,
|
|
30
47
|
styles = _ref.styles,
|
|
31
48
|
className = _ref.className,
|
|
49
|
+
collapsible = _ref.collapsible,
|
|
50
|
+
defaultCollapsed = _ref.defaultCollapsed,
|
|
51
|
+
outerCollapsed = _ref.collapsed,
|
|
52
|
+
onCollapse = _ref.onCollapse,
|
|
53
|
+
customLocale = _ref.locale,
|
|
32
54
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
33
55
|
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
34
56
|
getPrefixCls = _useContext.getPrefixCls,
|
|
35
|
-
contextCard = _useContext.card
|
|
57
|
+
contextCard = _useContext.card,
|
|
58
|
+
contextLocale = _useContext.locale;
|
|
59
|
+
var _theme$useToken = theme.useToken(),
|
|
60
|
+
token = _theme$useToken.token;
|
|
36
61
|
var divided = (_ref2 = outerDivided !== null && outerDivided !== void 0 ? outerDivided : contextCard === null || contextCard === void 0 ? void 0 : contextCard.divided) !== null && _ref2 !== void 0 ? _ref2 : true;
|
|
62
|
+
var cardLocale = _objectSpread(_objectSpread(_objectSpread({}, defaultLocale.Card), contextLocale === null || contextLocale === void 0 ? void 0 : contextLocale.Card), customLocale);
|
|
37
63
|
var prefixCls = getPrefixCls('card', customizePrefixCls);
|
|
38
64
|
var tabsPrefixCls = getPrefixCls('tabs', customizePrefixCls);
|
|
39
65
|
var _useStyle = useStyle(prefixCls, tabsPrefixCls),
|
|
40
|
-
|
|
66
|
+
_useStyle2 = _slicedToArray(_useStyle, 1),
|
|
67
|
+
wrapCSSVar = _useStyle2[0];
|
|
68
|
+
var _useState = useState(defaultCollapsed !== null && defaultCollapsed !== void 0 ? defaultCollapsed : false),
|
|
69
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
70
|
+
internalCollapsed = _useState2[0],
|
|
71
|
+
setInternalCollapsed = _useState2[1];
|
|
72
|
+
var collapsed = outerCollapsed !== undefined ? outerCollapsed : internalCollapsed;
|
|
73
|
+
var handleCollapse = useCallback(function () {
|
|
74
|
+
var newCollapsed = !collapsed;
|
|
75
|
+
if (outerCollapsed === undefined) {
|
|
76
|
+
setInternalCollapsed(newCollapsed);
|
|
77
|
+
}
|
|
78
|
+
onCollapse === null || onCollapse === void 0 || onCollapse(newCollapsed);
|
|
79
|
+
}, [collapsed, outerCollapsed, onCollapse]);
|
|
80
|
+
var documentLink = typeof document === 'string' ? document : undefined;
|
|
81
|
+
var documentClick = typeof document === 'function' ? document : undefined;
|
|
82
|
+
var cardTitle = useMemo(function () {
|
|
83
|
+
if (!collapsible && !subTitle && !document) {
|
|
84
|
+
return title;
|
|
85
|
+
}
|
|
86
|
+
if (!title) {
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
var titleContent = /*#__PURE__*/_jsxs(_Fragment, {
|
|
90
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
91
|
+
children: title
|
|
92
|
+
}), (subTitle || document) && /*#__PURE__*/_jsxs(Space, {
|
|
93
|
+
className: "".concat(prefixCls, "-sub-title-wrapper"),
|
|
94
|
+
size: "small",
|
|
95
|
+
children: [subTitle && /*#__PURE__*/_jsx("div", {
|
|
96
|
+
className: "".concat(prefixCls, "-sub-title"),
|
|
97
|
+
children: subTitle
|
|
98
|
+
}), document && /*#__PURE__*/_jsxs(Space, {
|
|
99
|
+
size: "small",
|
|
100
|
+
children: [document && /*#__PURE__*/_jsx(Divider, {
|
|
101
|
+
type: "vertical",
|
|
102
|
+
className: "".concat(prefixCls, "-document-divider")
|
|
103
|
+
}), /*#__PURE__*/_jsx(Tooltip, {
|
|
104
|
+
title: cardLocale.viewDocument,
|
|
105
|
+
children: /*#__PURE__*/_jsx("a", {
|
|
106
|
+
href: documentLink,
|
|
107
|
+
target: "_blank",
|
|
108
|
+
rel: "noopener noreferrer",
|
|
109
|
+
onClick: documentClick,
|
|
110
|
+
className: "".concat(prefixCls, "-document-icon"),
|
|
111
|
+
children: documentLink || documentClick ? /*#__PURE__*/_jsx(DocumentIcon, {
|
|
112
|
+
className: "".concat(prefixCls, "-document-default-icon")
|
|
113
|
+
}) : document
|
|
114
|
+
})
|
|
115
|
+
})]
|
|
116
|
+
})]
|
|
117
|
+
})]
|
|
118
|
+
});
|
|
119
|
+
if (!collapsible) {
|
|
120
|
+
return /*#__PURE__*/_jsx("div", {
|
|
121
|
+
className: "".concat(prefixCls, "-title-wrapper"),
|
|
122
|
+
style: {
|
|
123
|
+
display: 'flex',
|
|
124
|
+
alignItems: 'center'
|
|
125
|
+
},
|
|
126
|
+
children: titleContent
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
130
|
+
className: "".concat(prefixCls, "-title-wrapper"),
|
|
131
|
+
onClick: handleCollapse,
|
|
132
|
+
style: {
|
|
133
|
+
cursor: 'pointer',
|
|
134
|
+
display: 'flex',
|
|
135
|
+
alignItems: 'center'
|
|
136
|
+
},
|
|
137
|
+
children: [/*#__PURE__*/_jsx(CaretRightFilled, {
|
|
138
|
+
className: "".concat(prefixCls, "-collapsible-icon"),
|
|
139
|
+
style: {
|
|
140
|
+
transition: "transform ".concat(token.motionDurationMid),
|
|
141
|
+
transform: collapsed ? undefined : 'rotate(90deg)',
|
|
142
|
+
color: token.colorIcon,
|
|
143
|
+
marginRight: token.marginXS
|
|
144
|
+
}
|
|
145
|
+
}), titleContent]
|
|
146
|
+
});
|
|
147
|
+
}, [collapsible, title, subTitle, document, documentLink, documentClick, collapsed, prefixCls, token, handleCollapse, cardLocale.viewDocument]);
|
|
41
148
|
|
|
42
149
|
// card body no horizontal padding
|
|
43
150
|
var noBodyHorizontalPadding = isHorizontalPaddingZero(bodyStyle === null || bodyStyle === void 0 ? void 0 : bodyStyle.padding) || isHorizontalPaddingZero(styles === null || styles === void 0 || (_styles$body = styles.body) === null || _styles$body === void 0 ? void 0 : _styles$body.padding);
|
|
44
|
-
var cardCls = classNames(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-has-
|
|
151
|
+
var cardCls = classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-has-head"), !!(title || extra || tabList || tabBarExtraContent)), "".concat(prefixCls, "-no-divider"), !divided), "".concat(prefixCls, "-gray"), gray), "".concat(prefixCls, "-no-body-horizontal-padding"), noBodyHorizontalPadding), "".concat(prefixCls, "-collapsible"), collapsible), "".concat(prefixCls, "-collapsed"), collapsed), className);
|
|
45
152
|
var newTabList = tabList === null || tabList === void 0 ? void 0 : tabList.map(function (item) {
|
|
46
153
|
if (!isNullValue(item.tag)) {
|
|
47
154
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
@@ -57,13 +164,18 @@ var Card = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
57
164
|
}
|
|
58
165
|
return item;
|
|
59
166
|
});
|
|
60
|
-
return
|
|
167
|
+
return wrapCSSVar( /*#__PURE__*/_jsx(AntCard, _objectSpread(_objectSpread({
|
|
61
168
|
ref: ref,
|
|
62
169
|
size: size,
|
|
63
|
-
title:
|
|
170
|
+
title: cardTitle,
|
|
171
|
+
extra: extra,
|
|
64
172
|
tabList: newTabList,
|
|
173
|
+
tabBarExtraContent: tabBarExtraContent,
|
|
174
|
+
tabProps: _objectSpread({
|
|
175
|
+
size: size === 'small' ? 'small' : 'middle'
|
|
176
|
+
}, tabProps),
|
|
65
177
|
prefixCls: customizePrefixCls,
|
|
66
|
-
bodyStyle: bodyStyle,
|
|
178
|
+
bodyStyle: _objectSpread({}, bodyStyle),
|
|
67
179
|
styles: styles,
|
|
68
180
|
className: cardCls
|
|
69
181
|
}, restProps), {}, {
|
|
@@ -73,6 +185,36 @@ var Card = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
73
185
|
if (process.env.NODE_ENV !== 'production') {
|
|
74
186
|
Card.displayName = AntCard.displayName;
|
|
75
187
|
}
|
|
188
|
+
var DocumentIcon = function DocumentIcon(_ref3) {
|
|
189
|
+
var className = _ref3.className;
|
|
190
|
+
var _id = useUniqueInlineId();
|
|
191
|
+
return /*#__PURE__*/_jsxs("svg", {
|
|
192
|
+
width: "16",
|
|
193
|
+
height: "16",
|
|
194
|
+
viewBox: "0 0 16 16",
|
|
195
|
+
fill: "none",
|
|
196
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
197
|
+
className: className,
|
|
198
|
+
children: [/*#__PURE__*/_jsx("g", {
|
|
199
|
+
clipPath: "url(#".concat(_id, ")"),
|
|
200
|
+
children: /*#__PURE__*/_jsx("path", {
|
|
201
|
+
d: "M7.99992 4.66667C7.99992 3.95942 7.71897 3.28115 7.21887 2.78105C6.71877 2.28095 6.0405 2 5.33325 2H1.33325V12H5.99992C6.53035 12 7.03906 12.2107 7.41413 12.5858C7.78921 12.9609 7.99992 13.4696 7.99992 14M7.99992 4.66667V14M7.99992 4.66667C7.99992 3.95942 8.28087 3.28115 8.78097 2.78105C9.28106 2.28095 9.95934 2 10.6666 2H14.6666V12H9.99992C9.46949 12 8.96078 12.2107 8.5857 12.5858C8.21063 12.9609 7.99992 13.4696 7.99992 14",
|
|
202
|
+
stroke: "currentColor",
|
|
203
|
+
strokeLinecap: "round",
|
|
204
|
+
strokeLinejoin: "round"
|
|
205
|
+
})
|
|
206
|
+
}), /*#__PURE__*/_jsx("defs", {
|
|
207
|
+
children: /*#__PURE__*/_jsx("clipPath", {
|
|
208
|
+
id: _id,
|
|
209
|
+
children: /*#__PURE__*/_jsx("rect", {
|
|
210
|
+
width: "16",
|
|
211
|
+
height: "16",
|
|
212
|
+
fill: "white"
|
|
213
|
+
})
|
|
214
|
+
})
|
|
215
|
+
})]
|
|
216
|
+
});
|
|
217
|
+
};
|
|
76
218
|
export default Object.assign(Card, {
|
|
77
219
|
Grid: AntCard.Grid,
|
|
78
220
|
Meta: AntCard.Meta,
|
package/es/card/style/index.d.ts
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
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;
|
|
7
7
|
};
|
|
8
8
|
export declare const genTableStyle: (padding: number, token: Partial<CardToken>) => CSSObject;
|
|
9
9
|
export declare const genCardStyle: GenerateStyle<CardToken>;
|
|
10
|
-
declare const _default: (prefixCls: string, tabsPrefixCls: string) =>
|
|
11
|
-
wrapSSR: (node: import("react").ReactNode) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
12
|
-
hashId: string;
|
|
13
|
-
};
|
|
10
|
+
declare const _default: (prefixCls: string, tabsPrefixCls: string) => readonly [(node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>, string, string];
|
|
14
11
|
export default _default;
|
package/es/card/style/index.js
CHANGED
|
@@ -5,7 +5,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
import { genTabsStyle } from "../../tabs/style";
|
|
8
|
-
import {
|
|
8
|
+
import { genStyleHooks } from "../../_util/genComponentStyleHook";
|
|
9
9
|
export var genTableStyle = function genTableStyle(padding, token) {
|
|
10
10
|
var antCls = token.antCls;
|
|
11
11
|
var tableComponentCls = "".concat(antCls, "-table");
|
|
@@ -20,42 +20,107 @@ export var genTableStyle = function genTableStyle(padding, token) {
|
|
|
20
20
|
})));
|
|
21
21
|
};
|
|
22
22
|
export var genCardStyle = function genCardStyle(token) {
|
|
23
|
-
var _ref2;
|
|
23
|
+
var _token$Table, _ref2;
|
|
24
24
|
var componentCls = token.componentCls,
|
|
25
25
|
antCls = token.antCls,
|
|
26
26
|
tabsComponentCls = token.tabsComponentCls,
|
|
27
27
|
tabsPrefixCls = token.tabsPrefixCls,
|
|
28
28
|
paddingSM = token.paddingSM,
|
|
29
|
-
paddingLG = token.paddingLG
|
|
29
|
+
paddingLG = token.paddingLG,
|
|
30
|
+
calc = token.calc;
|
|
30
31
|
var tableComponentCls = "".concat(antCls, "-table");
|
|
31
|
-
return _ref2 = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref2, "".concat(componentCls), _defineProperty({}, "".concat(componentCls, "
|
|
32
|
+
return _ref2 = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref2, "".concat(componentCls), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-head"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-sub-title-wrapper"), {
|
|
33
|
+
marginInlineStart: token.marginXS
|
|
34
|
+
}), "".concat(componentCls, "-sub-title"), {
|
|
35
|
+
fontWeight: 'normal',
|
|
36
|
+
fontSize: token.fontSize,
|
|
37
|
+
color: token.colorTextDescription
|
|
38
|
+
}), "".concat(componentCls, "-document-divider"), {
|
|
39
|
+
marginInline: 0,
|
|
40
|
+
height: token.size
|
|
41
|
+
}), "".concat(componentCls, "-document-icon"), {
|
|
42
|
+
display: 'inline-block',
|
|
43
|
+
color: token.colorIcon,
|
|
44
|
+
fontSize: token.fontSizeLG,
|
|
45
|
+
cursor: 'pointer',
|
|
46
|
+
'&:hover': {
|
|
47
|
+
color: token.colorLinkHover
|
|
48
|
+
},
|
|
49
|
+
'&:active': {
|
|
50
|
+
color: token.colorLinkActive
|
|
51
|
+
}
|
|
52
|
+
}), "".concat(componentCls, "-document-default-icon"), {
|
|
53
|
+
marginTop: (token.controlHeight - token.fontSizeLG) / 2
|
|
54
|
+
}), tabsComponentCls, _defineProperty({}, "&".concat(tabsComponentCls, "-top, &").concat(tabsComponentCls, "-bottom"), _defineProperty({}, "".concat(tabsComponentCls, "-nav::before"), {
|
|
55
|
+
border: 'none'
|
|
56
|
+
})))), "".concat(componentCls, "-body"), {
|
|
57
|
+
paddingTop: token.padding
|
|
58
|
+
}), "".concat(componentCls, ":not(").concat(componentCls, "-bordered):not(").concat(componentCls, "-type-inner)"), {
|
|
32
59
|
boxShadow: 'none'
|
|
33
|
-
})
|
|
34
|
-
|
|
60
|
+
}), "".concat(componentCls).concat(componentCls, "-bordered"), _defineProperty({
|
|
61
|
+
borderRadius: calc(token.borderRadiusLG).sub(2).equal()
|
|
62
|
+
}, "".concat(componentCls).concat(componentCls, "-bordered"), _defineProperty({
|
|
63
|
+
borderRadius: token.borderRadius
|
|
64
|
+
}, "".concat(componentCls).concat(componentCls, "-bordered"), {
|
|
65
|
+
borderRadius: token.borderRadiusSM
|
|
66
|
+
})))), "".concat(componentCls).concat(componentCls, "-has-head").concat(componentCls, "-no-divider:not(").concat(componentCls, "-contain-tabs)"), _defineProperty({}, "".concat(componentCls, "-body"), {
|
|
67
|
+
paddingTop: 0
|
|
68
|
+
})), "".concat(componentCls, ":not(").concat(componentCls, "-has-head)"), _defineProperty({}, "".concat(componentCls, "-body"), {
|
|
69
|
+
paddingTop: paddingLG
|
|
70
|
+
})), "".concat(componentCls).concat(componentCls, "-no-divider"), _defineProperty({}, "".concat(componentCls, "-head"), {
|
|
71
|
+
// hide bottom border by setting borderBottomColor to transparent
|
|
35
72
|
borderBottomColor: 'transparent'
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
73
|
+
})), "".concat(componentCls).concat(componentCls, "-no-divider:not(").concat(componentCls, "-contain-tabs)"), _defineProperty({}, "".concat(componentCls, "-head"), {
|
|
74
|
+
paddingTop: token.paddingLG,
|
|
75
|
+
paddingBottom: token.padding
|
|
76
|
+
})), "".concat(componentCls).concat(componentCls, "-small:not(").concat(componentCls, "-has-head)"), _defineProperty({}, "".concat(componentCls, "-body"), {
|
|
77
|
+
paddingTop: paddingSM
|
|
78
|
+
})), "".concat(componentCls).concat(componentCls, "-small").concat(componentCls, "-no-divider:not(").concat(componentCls, "-contain-tabs)"), _defineProperty({}, "".concat(componentCls, "-head"), {
|
|
79
|
+
paddingTop: token.paddingSM,
|
|
80
|
+
paddingBottom: token.paddingXS
|
|
81
|
+
})), "".concat(componentCls, "-small"), _defineProperty({}, "".concat(componentCls, "-body"), {
|
|
82
|
+
paddingTop: token.paddingXS
|
|
42
83
|
})), "".concat(componentCls, "-small").concat(componentCls, "-contain-tabs >").concat(componentCls, "-head"), _defineProperty({}, "".concat(componentCls, "-head-title, ").concat(componentCls, "-head-extra"), {
|
|
43
84
|
paddingTop: token.paddingXS
|
|
44
|
-
})), "".concat(componentCls).concat(componentCls, "-contain-tabs"), _defineProperty({}, "".concat(componentCls, "-head"), genTabsStyle(_objectSpread(_objectSpread({}, token), {}, {
|
|
85
|
+
})), "".concat(componentCls).concat(componentCls, "-contain-tabs"), _defineProperty({}, "".concat(componentCls, "-head"), _objectSpread({}, genTabsStyle(_objectSpread(_objectSpread({}, token), {}, {
|
|
45
86
|
componentCls: tabsComponentCls,
|
|
46
87
|
prefixCls: tabsPrefixCls
|
|
47
|
-
})))), "".concat(componentCls).concat(componentCls, "-contain-grid"), _defineProperty({}, "".concat(componentCls, "-head"), {
|
|
88
|
+
}))))), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref2, "".concat(componentCls).concat(componentCls, "-contain-grid"), _defineProperty({}, "".concat(componentCls, "-head"), {
|
|
48
89
|
// work for Card containing Card.Grid
|
|
49
90
|
marginBottom: -1
|
|
50
91
|
})), "".concat(componentCls, ":not(").concat(componentCls, "-contain-grid)"), _defineProperty({}, "".concat(componentCls, "-head"), {
|
|
51
92
|
// work for Card not containing Card.Grid
|
|
52
93
|
marginBottom: 0
|
|
53
|
-
})), "&".concat(componentCls, "-has-
|
|
54
|
-
marginTop:
|
|
55
|
-
}))), "".concat(componentCls).concat(componentCls, "-no-body-horizontal-padding"), genTableStyle(paddingLG, token)),
|
|
94
|
+
})), "&".concat(componentCls, "-has-head").concat(componentCls, "-no-divider:not(").concat(componentCls, "-contain-tabs)"), _defineProperty({}, "".concat(componentCls, "-body"), _defineProperty({}, "& > ".concat(tableComponentCls, "-wrapper ").concat(tableComponentCls, ":not(").concat(tableComponentCls, "-bordered):first-child"), {
|
|
95
|
+
marginTop: calc((_token$Table = token.Table) === null || _token$Table === void 0 ? void 0 : _token$Table.cellPaddingBlock).mul(-1).equal()
|
|
96
|
+
}))), "".concat(componentCls).concat(componentCls, "-no-body-horizontal-padding"), genTableStyle(paddingLG, token)), "".concat(componentCls).concat(componentCls, "-no-body-horizontal-padding").concat(componentCls, "-small"), genTableStyle(paddingSM, token)), "".concat(componentCls).concat(componentCls, "-collapsible"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-title-wrapper"), _defineProperty({
|
|
97
|
+
userSelect: 'none'
|
|
98
|
+
}, "".concat(componentCls, "-collapsible-icon"), {
|
|
99
|
+
fontSize: token.fontSizeLG
|
|
100
|
+
})), "".concat(componentCls, "-body"), {
|
|
101
|
+
overflow: 'hidden'
|
|
102
|
+
})), "".concat(componentCls).concat(componentCls, "-collapsible").concat(componentCls, "-collapsed"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-body"), {
|
|
103
|
+
maxHeight: 0,
|
|
104
|
+
paddingTop: 0,
|
|
105
|
+
paddingBottom: 0,
|
|
106
|
+
opacity: 0,
|
|
107
|
+
overflow: 'hidden',
|
|
108
|
+
border: 'none',
|
|
109
|
+
margin: 0
|
|
110
|
+
}), "".concat(componentCls, "-head"), {
|
|
111
|
+
borderBottomColor: 'transparent'
|
|
112
|
+
}), "&".concat(componentCls, "-no-divider"), _defineProperty({}, "".concat(componentCls, "-head"), {
|
|
113
|
+
paddingBottom: paddingLG
|
|
114
|
+
})), "&".concat(componentCls, "-no-divider").concat(componentCls, "-small"), _defineProperty({}, "".concat(componentCls, "-head"), {
|
|
115
|
+
paddingBottom: paddingSM
|
|
116
|
+
}))), "".concat(componentCls).concat(componentCls, "-gray"), {
|
|
117
|
+
boxShadow: 'none',
|
|
118
|
+
borderRadius: token.borderRadiusMD,
|
|
119
|
+
backgroundColor: token.colorFillQuaternary
|
|
120
|
+
});
|
|
56
121
|
};
|
|
57
122
|
export default (function (prefixCls, tabsPrefixCls) {
|
|
58
|
-
var useStyle =
|
|
123
|
+
var useStyle = genStyleHooks('Card', function (token) {
|
|
59
124
|
return [genCardStyle(_objectSpread(_objectSpread({}, token), {}, {
|
|
60
125
|
tabsComponentCls: ".".concat(tabsPrefixCls),
|
|
61
126
|
tabsPrefixCls: tabsPrefixCls
|
package/es/checkbox/index.js
CHANGED
|
@@ -5,6 +5,12 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
5
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
6
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
7
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
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(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
13
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
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; }
|
|
9
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; }
|
|
10
16
|
import { Checkbox as AntCheckbox } from 'antd';
|
|
@@ -22,9 +28,10 @@ var InternalCheckbox = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
22
28
|
getPrefixCls = _useContext.getPrefixCls;
|
|
23
29
|
var prefixCls = getPrefixCls('checkbox', customizePrefixCls);
|
|
24
30
|
var _useStyle = useStyle(prefixCls),
|
|
25
|
-
|
|
31
|
+
_useStyle2 = _slicedToArray(_useStyle, 1),
|
|
32
|
+
wrapCSSVar = _useStyle2[0];
|
|
26
33
|
var checkboxCls = classNames(className);
|
|
27
|
-
return
|
|
34
|
+
return wrapCSSVar( /*#__PURE__*/_jsx(AntCheckbox, _objectSpread({
|
|
28
35
|
ref: ref,
|
|
29
36
|
prefixCls: customizePrefixCls,
|
|
30
37
|
className: checkboxCls
|
|
@@ -1,9 +1,6 @@
|
|
|
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
|
-
declare const _default: (prefixCls: string) =>
|
|
6
|
-
wrapSSR: (node: import("react").ReactNode) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
7
|
-
hashId: string;
|
|
8
|
-
};
|
|
5
|
+
declare const _default: (prefixCls: string, rootCls?: string) => readonly [(node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>, string, string];
|
|
9
6
|
export default _default;
|