@oceanbase/design 1.0.0-alpha.2 → 1.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/design.min.js +1 -1
- package/es/_util/genComponentStyleHook.d.ts +2 -2
- package/es/_util/genComponentStyleHook.js +15 -2
- package/es/alert/index.d.ts +2 -2
- package/es/alert/index.js +13 -4
- package/es/alert/style/index.d.ts +1 -1
- package/es/alert/style/index.js +152 -58
- package/es/app/index.d.ts +8 -0
- package/es/app/index.js +36 -1
- package/es/app/style/index.d.ts +9 -0
- package/es/{_util/genStyle.js → app/style/index.js} +10 -11
- package/es/badge/index.js +2 -3
- package/es/badge/style/index.d.ts +1 -1
- package/es/badge/style/index.js +1 -3
- package/es/button/style/index.d.ts +1 -1
- package/es/card/index.d.ts +4 -0
- package/es/card/index.js +64 -7
- package/es/card/style/index.d.ts +1 -1
- package/es/card/style/index.js +32 -8
- package/es/checkbox/style/index.d.ts +1 -1
- package/es/config-provider/context.d.ts +11 -0
- package/es/config-provider/context.js +2 -1
- package/es/config-provider/index.d.ts +2 -2
- package/es/config-provider/index.js +57 -34
- package/es/descriptions/style/index.d.ts +1 -1
- package/es/drawer/index.js +7 -5
- package/es/drawer/style/index.d.ts +1 -1
- package/es/drawer/style/index.js +31 -9
- package/es/empty/index.js +1 -1
- package/es/empty/style/index.d.ts +1 -1
- package/es/form/FormItem.d.ts +2 -1
- package/es/form/FormItem.js +14 -4
- package/es/form/style/index.d.ts +1 -1
- package/es/form/style/index.js +13 -2
- package/es/index.d.ts +4 -2
- package/es/index.js +1 -0
- package/es/input-number/index.d.ts +2 -1
- package/es/locale/ja-JP.d.ts +3 -0
- package/es/locale/ja-JP.js +28 -0
- package/es/modal/Modal.js +20 -6
- package/es/modal/style/index.d.ts +1 -1
- package/es/modal/style/index.js +62 -19
- package/es/radio/style/index.d.ts +1 -1
- package/es/result/index.d.ts +2 -2
- package/es/result/index.js +5 -4
- package/es/result/style/index.d.ts +1 -1
- package/es/select/style/index.d.ts +1 -1
- package/es/slider/style/index.d.ts +1 -1
- package/es/space/style/index.d.ts +1 -1
- package/es/spin/style/index.d.ts +1 -1
- package/es/static-function/index.js +13 -4
- package/es/switch/style/index.d.ts +1 -1
- package/es/table/style/index.d.ts +1 -1
- package/es/table/style/index.js +3 -4
- package/es/tabs/style/index.d.ts +1 -1
- package/es/tabs/style/index.js +4 -2
- package/es/tag/index.d.ts +1 -0
- package/es/tag/index.js +3 -2
- package/es/tag/style/index.d.ts +2 -4
- package/es/tag/style/index.js +20 -31
- package/es/theme/dark.d.ts +1 -48
- package/es/theme/default.d.ts +4 -2
- package/es/theme/default.js +59 -28
- package/es/theme/index.d.ts +20 -57
- package/es/theme/interface.d.ts +66 -0
- package/es/theme/interface.js +4 -1
- package/es/theme/style/aliyun.less +40 -40
- package/es/theme/style/compact.less +79 -72
- package/es/theme/style/dark.less +53 -53
- package/es/theme/style/default.less +79 -72
- package/es/tooltip/style/index.d.ts +1 -1
- package/es/tree-select/style/index.d.ts +1 -1
- package/lib/_util/genComponentStyleHook.d.ts +2 -2
- package/lib/_util/genComponentStyleHook.js +20 -4
- package/lib/alert/index.d.ts +2 -2
- package/lib/alert/index.js +18 -9
- package/lib/alert/style/index.d.ts +1 -1
- package/lib/alert/style/index.js +170 -71
- package/lib/app/index.d.ts +8 -0
- package/lib/app/index.js +36 -1
- package/lib/app/style/index.d.ts +9 -0
- package/lib/{_util/getWeakenBorderColor.js → app/style/index.js} +20 -10
- package/lib/badge/index.js +23 -20
- package/lib/badge/style/index.d.ts +1 -1
- package/lib/badge/style/index.js +1 -3
- package/lib/button/index.js +2 -1
- package/lib/button/style/index.d.ts +1 -1
- package/lib/card/index.d.ts +4 -0
- package/lib/card/index.js +70 -9
- package/lib/card/style/index.d.ts +1 -1
- package/lib/card/style/index.js +56 -10
- package/lib/checkbox/index.js +2 -1
- package/lib/checkbox/style/index.d.ts +1 -1
- package/lib/config-provider/DefaultRenderEmpty.js +4 -3
- package/lib/config-provider/context.d.ts +11 -0
- package/lib/config-provider/index.d.ts +2 -2
- package/lib/config-provider/index.js +70 -26
- package/lib/descriptions/hooks/useItems.js +5 -4
- package/lib/descriptions/index.js +3 -2
- package/lib/descriptions/style/index.d.ts +1 -1
- package/lib/drawer/index.js +44 -33
- package/lib/drawer/style/index.d.ts +1 -1
- package/lib/drawer/style/index.js +33 -6
- package/lib/dropdown/dropdown-button.js +3 -13
- package/lib/dropdown/index.js +2 -2
- package/lib/empty/colored.js +413 -327
- package/lib/empty/database.js +267 -222
- package/lib/empty/default.js +16 -21
- package/lib/empty/guide.js +201 -184
- package/lib/empty/index.js +23 -18
- package/lib/empty/style/index.d.ts +1 -1
- package/lib/form/FormItem.d.ts +2 -1
- package/lib/form/FormItem.js +18 -6
- package/lib/form/index.js +6 -3
- package/lib/form/style/index.d.ts +1 -1
- package/lib/form/style/index.js +19 -0
- package/lib/grid/col.js +2 -1
- package/lib/grid/row.js +2 -1
- package/lib/index.d.ts +4 -2
- package/lib/index.js +3 -0
- package/lib/input/Input.js +3 -2
- package/lib/input/Password.js +3 -2
- package/lib/input/Search.js +3 -2
- package/lib/input/TextArea.js +3 -2
- package/lib/input-number/index.d.ts +2 -1
- package/lib/input-number/index.js +2 -1
- package/lib/list/index.js +3 -2
- package/lib/locale/ja-JP.d.ts +3 -0
- package/lib/locale/ja-JP.js +60 -0
- package/lib/lottie/index.js +2 -1
- package/lib/modal/Modal.js +33 -9
- package/lib/modal/Progress.js +9 -5
- package/lib/modal/style/index.d.ts +1 -1
- package/lib/modal/style/index.js +76 -17
- package/lib/radio/index.js +2 -1
- package/lib/radio/style/index.d.ts +1 -1
- package/lib/result/403.js +156 -121
- package/lib/result/404.js +328 -267
- package/lib/result/500.js +295 -257
- package/lib/result/Error.js +127 -99
- package/lib/result/Processing.js +246 -213
- package/lib/result/Success.js +233 -169
- package/lib/result/Warning.js +611 -515
- package/lib/result/index.d.ts +2 -2
- package/lib/result/index.js +12 -11
- package/lib/result/style/index.d.ts +1 -1
- package/lib/segmented/index.js +8 -4
- package/lib/select/index.js +2 -1
- package/lib/select/style/index.d.ts +1 -1
- package/lib/slider/index.js +2 -1
- package/lib/slider/style/index.d.ts +1 -1
- package/lib/space/index.js +2 -1
- package/lib/space/style/index.d.ts +1 -1
- package/lib/spin/index.js +5 -4
- package/lib/spin/style/index.d.ts +1 -1
- package/lib/static-function/index.js +7 -1
- package/lib/switch/index.js +2 -1
- package/lib/switch/style/index.d.ts +1 -1
- package/lib/table/index.js +44 -31
- package/lib/table/style/index.d.ts +1 -1
- package/lib/table/style/index.js +3 -4
- package/lib/tabs/index.js +10 -5
- package/lib/tabs/style/index.d.ts +1 -1
- package/lib/tabs/style/index.js +5 -0
- package/lib/tag/index.d.ts +1 -0
- package/lib/tag/index.js +12 -6
- package/lib/tag/style/index.d.ts +2 -4
- package/lib/tag/style/index.js +20 -27
- package/lib/theme/dark.d.ts +1 -48
- package/lib/theme/default.d.ts +4 -2
- package/lib/theme/default.js +67 -27
- package/lib/theme/index.d.ts +20 -57
- package/lib/theme/interface.d.ts +66 -0
- package/lib/theme/style/aliyun.less +40 -40
- package/lib/theme/style/compact.less +79 -72
- package/lib/theme/style/dark.less +53 -53
- package/lib/theme/style/default.less +79 -72
- package/lib/tooltip/MouseTooltip.js +43 -39
- package/lib/tooltip/ReactStickyMouseTooltip.js +5 -4
- package/lib/tooltip/index.js +14 -10
- package/lib/tooltip/style/index.d.ts +1 -1
- package/lib/tree-select/index.js +2 -1
- package/lib/tree-select/style/index.d.ts +1 -1
- package/lib/typography/Link.js +5 -4
- package/lib/typography/Paragraph.js +5 -4
- package/lib/typography/Text.js +5 -4
- package/lib/typography/Title.js +5 -4
- package/package.json +7 -6
- package/es/_util/genStyle.d.ts +0 -2
- package/es/_util/getWeakenBorderColor.d.ts +0 -1
- package/es/_util/getWeakenBorderColor.js +0 -4
- package/lib/_util/genStyle.d.ts +0 -2
- package/lib/_util/genStyle.js +0 -43
- package/lib/_util/getWeakenBorderColor.d.ts +0 -1
package/es/card/style/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { CSSObject } from '@ant-design/cssinjs';
|
|
3
|
-
import type { FullToken, GenerateStyle } from '
|
|
3
|
+
import type { FullToken, GenerateStyle } from '../../theme/interface';
|
|
4
4
|
export type CardToken = FullToken<'Card'> & {
|
|
5
5
|
tabsComponentCls: string;
|
|
6
6
|
tabsPrefixCls: string;
|
package/es/card/style/index.js
CHANGED
|
@@ -28,29 +28,37 @@ export var genCardStyle = function genCardStyle(token) {
|
|
|
28
28
|
paddingSM = token.paddingSM,
|
|
29
29
|
paddingLG = token.paddingLG;
|
|
30
30
|
var tableComponentCls = "".concat(antCls, "-table");
|
|
31
|
-
return _ref2 = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref2, "".concat(componentCls), _defineProperty(_defineProperty({}, "".concat(componentCls, "
|
|
31
|
+
return _ref2 = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref2, "".concat(componentCls), _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-body"), {
|
|
32
|
+
paddingTop: token.padding
|
|
33
|
+
}), "".concat(componentCls, ":not(").concat(componentCls, "-bordered):not(").concat(componentCls, "-type-inner)"), {
|
|
32
34
|
boxShadow: 'none'
|
|
33
|
-
}), "".concat(componentCls), _defineProperty({
|
|
35
|
+
}), "".concat(componentCls).concat(componentCls, "-bordered"), _defineProperty({
|
|
34
36
|
borderRadius: token.borderRadiusLG - 2
|
|
35
|
-
}, "".concat(componentCls), _defineProperty({
|
|
37
|
+
}, "".concat(componentCls).concat(componentCls, "-bordered"), _defineProperty({
|
|
36
38
|
borderRadius: token.borderRadius
|
|
37
|
-
}, "".concat(componentCls), {
|
|
39
|
+
}, "".concat(componentCls).concat(componentCls, "-bordered"), {
|
|
38
40
|
borderRadius: token.borderRadiusSM
|
|
39
41
|
})))), "".concat(componentCls).concat(componentCls, "-no-divider"), _defineProperty({}, "".concat(componentCls, "-head"), _defineProperty({
|
|
40
42
|
// should not remove border-bottom to avoid tabs inkbar display correctly
|
|
41
|
-
borderBottomColor: 'transparent'
|
|
43
|
+
borderBottomColor: 'transparent',
|
|
44
|
+
paddingTop: token.paddingLG,
|
|
45
|
+
paddingBottom: token.padding
|
|
42
46
|
}, tabsComponentCls, _defineProperty({}, "&".concat(tabsComponentCls, "-top, &").concat(tabsComponentCls, "-bottom"), _defineProperty({}, "".concat(tabsComponentCls, "-nav::before"), {
|
|
43
47
|
border: 'none'
|
|
44
48
|
}))))), "".concat(componentCls).concat(componentCls, "-no-divider:not(").concat(componentCls, "-contain-tabs)"), _defineProperty({}, "".concat(componentCls, "-body"), {
|
|
45
49
|
padding: "0 ".concat(paddingLG, "px ").concat(paddingLG, "px ").concat(paddingLG, "px")
|
|
50
|
+
})), "".concat(componentCls, "-small"), _defineProperty({}, "".concat(componentCls, "-body"), {
|
|
51
|
+
paddingTop: token.paddingXS
|
|
46
52
|
})), "".concat(componentCls, "-small").concat(componentCls, "-no-divider:not(").concat(componentCls, "-contain-tabs)"), _defineProperty({}, "".concat(componentCls, "-body"), {
|
|
47
53
|
padding: "0 ".concat(paddingSM, "px ").concat(paddingSM, "px ").concat(paddingSM, "px")
|
|
48
54
|
})), "".concat(componentCls, "-small").concat(componentCls, "-contain-tabs >").concat(componentCls, "-head"), _defineProperty({}, "".concat(componentCls, "-head-title, ").concat(componentCls, "-head-extra"), {
|
|
49
55
|
paddingTop: token.paddingXS
|
|
50
|
-
})), "".concat(componentCls).concat(componentCls, "-contain-tabs"), _defineProperty({}, "".concat(componentCls, "-head"), genTabsStyle(_objectSpread(_objectSpread({}, token), {}, {
|
|
56
|
+
})), "".concat(componentCls).concat(componentCls, "-contain-tabs"), _defineProperty({}, "".concat(componentCls, "-head"), _objectSpread(_objectSpread({}, genTabsStyle(_objectSpread(_objectSpread({}, token), {}, {
|
|
51
57
|
componentCls: tabsComponentCls,
|
|
52
58
|
prefixCls: tabsPrefixCls
|
|
53
|
-
})))
|
|
59
|
+
}))), {}, _defineProperty({}, tabsComponentCls, _defineProperty({}, "&".concat(tabsComponentCls, "-top, &").concat(tabsComponentCls, "-bottom"), _defineProperty({}, "".concat(tabsComponentCls, "-tab"), {
|
|
60
|
+
paddingBlock: token.padding
|
|
61
|
+
})))))), "".concat(componentCls).concat(componentCls, "-contain-grid"), _defineProperty({}, "".concat(componentCls, "-head"), {
|
|
54
62
|
// work for Card containing Card.Grid
|
|
55
63
|
marginBottom: -1
|
|
56
64
|
})), "".concat(componentCls, ":not(").concat(componentCls, "-contain-grid)"), _defineProperty({}, "".concat(componentCls, "-head"), {
|
|
@@ -58,7 +66,23 @@ export var genCardStyle = function genCardStyle(token) {
|
|
|
58
66
|
marginBottom: 0
|
|
59
67
|
})), "&".concat(componentCls, "-has-title").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"), {
|
|
60
68
|
marginTop: -token.marginSM
|
|
61
|
-
}))), "".concat(componentCls).concat(componentCls, "-no-body-horizontal-padding"), genTableStyle(paddingLG, token)),
|
|
69
|
+
}))), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref2, "".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({
|
|
70
|
+
userSelect: 'none'
|
|
71
|
+
}, "".concat(componentCls, "-collapsible-icon"), {
|
|
72
|
+
fontSize: token.fontSizeLG
|
|
73
|
+
})), "".concat(componentCls, "-body"), {
|
|
74
|
+
overflow: 'hidden'
|
|
75
|
+
})), "".concat(componentCls).concat(componentCls, "-collapsible").concat(componentCls, "-collapsed"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-body"), {
|
|
76
|
+
maxHeight: 0,
|
|
77
|
+
paddingTop: 0,
|
|
78
|
+
paddingBottom: 0,
|
|
79
|
+
opacity: 0,
|
|
80
|
+
overflow: 'hidden',
|
|
81
|
+
border: 'none',
|
|
82
|
+
margin: 0
|
|
83
|
+
}), "".concat(componentCls, "-head"), {
|
|
84
|
+
borderBottom: 'none'
|
|
85
|
+
}));
|
|
62
86
|
};
|
|
63
87
|
export default (function (prefixCls, tabsPrefixCls) {
|
|
64
88
|
var useStyle = genComponentStyleHook('Card', function (token) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { FullToken, GenerateStyle } from '
|
|
2
|
+
import type { FullToken, GenerateStyle } from '../../theme/interface';
|
|
3
3
|
export type CheckboxToken = FullToken<'Checkbox'>;
|
|
4
4
|
export declare const genCheckboxStyle: GenerateStyle<CheckboxToken>;
|
|
5
5
|
declare const _default: (prefixCls: string) => {
|
|
@@ -1 +1,12 @@
|
|
|
1
|
+
import type { ThemeConfig as AntThemeConfig, MappingAlgorithm } from 'antd';
|
|
2
|
+
import type { AliasToken, OverrideToken } from '../theme/interface';
|
|
1
3
|
export * from 'antd/es/config-provider/context';
|
|
4
|
+
type ComponentsConfig = {
|
|
5
|
+
[key in keyof OverrideToken]?: OverrideToken[key] & {
|
|
6
|
+
algorithm?: boolean | MappingAlgorithm | MappingAlgorithm[];
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export interface ThemeConfig extends AntThemeConfig {
|
|
10
|
+
token?: Partial<AliasToken>;
|
|
11
|
+
components?: ComponentsConfig;
|
|
12
|
+
}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from 'antd/es/config-provider/context';
|
|
1
|
+
export * from 'antd/es/config-provider/context';
|
|
2
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ConfigProvider as AntConfigProvider } from 'antd';
|
|
3
3
|
import type { ConfigProviderProps as AntConfigProviderProps, ConfigConsumerProps as AntConfigConsumerProps, ThemeConfig as AntThemeConfig } from 'antd/es/config-provider';
|
|
4
|
-
import type { ComponentStyleConfig, CardConfig as AntCardConfig } from 'antd/es/config-provider/context';
|
|
4
|
+
import type { ComponentStyleConfig, CardConfig as AntCardConfig, TableConfig as AntTableConfig } from 'antd/es/config-provider/context';
|
|
5
5
|
import type { AppProps } from 'antd/es/app';
|
|
6
6
|
import type { PaginationConfig } from 'antd/es/pagination';
|
|
7
7
|
import type { SpinIndicator } from 'antd/es/spin';
|
|
@@ -23,7 +23,7 @@ export type CardConfig = AntCardConfig & {
|
|
|
23
23
|
export type SpinConfig = ComponentStyleConfig & {
|
|
24
24
|
indicator?: SpinIndicator;
|
|
25
25
|
};
|
|
26
|
-
export type TableConfig =
|
|
26
|
+
export type TableConfig = AntTableConfig & {
|
|
27
27
|
selectionColumnWidth?: number;
|
|
28
28
|
};
|
|
29
29
|
export interface ConfigConsumerProps extends AntConfigConsumerProps {
|
|
@@ -1,22 +1,23 @@
|
|
|
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
1
|
var _excluded = ["children", "theme", "locale", "navigate", "hideOnSinglePage", "card", "collapse", "form", "spin", "table", "tabs", "styleProviderProps", "appProps"];
|
|
2
|
+
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); }
|
|
3
3
|
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
4
|
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
|
+
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; }
|
|
6
|
+
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
7
|
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
8
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
9
|
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 _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
|
-
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
10
|
import React from 'react';
|
|
11
|
-
import {
|
|
11
|
+
import { ConfigProvider as AntConfigProvider } from 'antd';
|
|
12
12
|
import { StyleProvider } from '@ant-design/cssinjs';
|
|
13
13
|
import StyleContext from '@ant-design/cssinjs/es/StyleContext';
|
|
14
14
|
import { CaretRightOutlined } from '@oceanbase/icons';
|
|
15
15
|
import aliyunTheme from '@oceanbase/aliyun-theme';
|
|
16
16
|
import { merge } from 'lodash';
|
|
17
|
+
import App from "../app";
|
|
17
18
|
import StaticFunction from "../static-function";
|
|
18
19
|
import themeConfig from "../theme";
|
|
19
|
-
import defaultTheme, { fontFamilyEn } from "../theme/default";
|
|
20
|
+
import defaultTheme, { fontFamilyEn, fontWeightEn, fontWeightStrongEn } from "../theme/default";
|
|
20
21
|
import darkTheme from "../theme/dark";
|
|
21
22
|
import DefaultRenderEmpty from "./DefaultRenderEmpty";
|
|
22
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -31,22 +32,25 @@ var ExtendedConfigContext = /*#__PURE__*/React.createContext({
|
|
|
31
32
|
hideOnSinglePage: false,
|
|
32
33
|
injectStaticFunction: true
|
|
33
34
|
});
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
35
|
+
var getLocaleTokenValue = function getLocaleTokenValue(locale, tokenKey, tokenValue, tokenValueEn) {
|
|
36
|
+
return tokenValue !== defaultTheme.token[tokenKey] ? _defineProperty({}, tokenKey, tokenValue) : ['en', 'en-gb'].includes(locale.locale) ? _defineProperty({}, tokenKey, tokenValueEn) : {};
|
|
37
|
+
};
|
|
38
|
+
var ConfigProvider = function ConfigProvider(_ref3) {
|
|
39
|
+
var _mergedTheme$token, _mergedTheme$token2, _mergedTheme$token3, _parentContext$pagina;
|
|
40
|
+
var children = _ref3.children,
|
|
41
|
+
theme = _ref3.theme,
|
|
42
|
+
locale = _ref3.locale,
|
|
43
|
+
navigate = _ref3.navigate,
|
|
44
|
+
hideOnSinglePage = _ref3.hideOnSinglePage,
|
|
45
|
+
card = _ref3.card,
|
|
46
|
+
collapse = _ref3.collapse,
|
|
47
|
+
form = _ref3.form,
|
|
48
|
+
spin = _ref3.spin,
|
|
49
|
+
table = _ref3.table,
|
|
50
|
+
tabs = _ref3.tabs,
|
|
51
|
+
styleProviderProps = _ref3.styleProviderProps,
|
|
52
|
+
appProps = _ref3.appProps,
|
|
53
|
+
restProps = _objectWithoutProperties(_ref3, _excluded);
|
|
50
54
|
// inherit from parent ConfigProvider
|
|
51
55
|
var parentContext = React.useContext(AntConfigProvider.ConfigContext);
|
|
52
56
|
var parentExtendedContext = React.useContext(ExtendedConfigContext);
|
|
@@ -58,6 +62,9 @@ var ConfigProvider = function ConfigProvider(_ref) {
|
|
|
58
62
|
var _themeConfig$useToken = themeConfig.useToken(),
|
|
59
63
|
token = _themeConfig$useToken.token;
|
|
60
64
|
var fontFamily = ((_mergedTheme$token = mergedTheme.token) === null || _mergedTheme$token === void 0 ? void 0 : _mergedTheme$token.fontFamily) || token.fontFamily;
|
|
65
|
+
// @ts-ignore
|
|
66
|
+
var fontWeight = ((_mergedTheme$token2 = mergedTheme.token) === null || _mergedTheme$token2 === void 0 ? void 0 : _mergedTheme$token2.fontWeight) || token.fontWeight;
|
|
67
|
+
var fontWeightStrong = ((_mergedTheme$token3 = mergedTheme.token) === null || _mergedTheme$token3 === void 0 ? void 0 : _mergedTheme$token3.fontWeightStrong) || token.fontWeightStrong;
|
|
61
68
|
|
|
62
69
|
// inherit from parent StyleProvider
|
|
63
70
|
var parentStyleContext = React.useContext(StyleContext);
|
|
@@ -67,10 +74,14 @@ var ConfigProvider = function ConfigProvider(_ref) {
|
|
|
67
74
|
locale: mergedLocale,
|
|
68
75
|
card: merge({}, parentContext.card, card),
|
|
69
76
|
collapse: merge({}, {
|
|
70
|
-
expandIcon: function expandIcon(
|
|
71
|
-
var
|
|
77
|
+
expandIcon: function expandIcon(_ref4) {
|
|
78
|
+
var _mergedTheme$token4, _mergedTheme$token5;
|
|
79
|
+
var isActive = _ref4.isActive;
|
|
72
80
|
return /*#__PURE__*/_jsx(CaretRightOutlined, {
|
|
73
|
-
rotate: isActive ? 90 : 0
|
|
81
|
+
rotate: isActive ? 90 : 0,
|
|
82
|
+
style: {
|
|
83
|
+
color: ((_mergedTheme$token4 = mergedTheme.token) === null || _mergedTheme$token4 === void 0 ? void 0 : _mergedTheme$token4.colorIcon) || ((_mergedTheme$token5 = mergedTheme.token) === null || _mergedTheme$token5 === void 0 ? void 0 : _mergedTheme$token5.colorTextSecondary)
|
|
84
|
+
}
|
|
74
85
|
});
|
|
75
86
|
}
|
|
76
87
|
}, parentContext.collapse, collapse),
|
|
@@ -78,18 +89,30 @@ var ConfigProvider = function ConfigProvider(_ref) {
|
|
|
78
89
|
requiredMark: 'optional'
|
|
79
90
|
}, parentContext.form, form),
|
|
80
91
|
spin: merge({}, parentContext.spin, spin),
|
|
81
|
-
table: merge({},
|
|
92
|
+
table: merge({}, {
|
|
93
|
+
expandable: {
|
|
94
|
+
expandIcon: function expandIcon(_ref5) {
|
|
95
|
+
var _mergedTheme$token6, _mergedTheme$token7;
|
|
96
|
+
var expandable = _ref5.expandable,
|
|
97
|
+
expanded = _ref5.expanded,
|
|
98
|
+
onExpand = _ref5.onExpand,
|
|
99
|
+
record = _ref5.record;
|
|
100
|
+
return expandable && /*#__PURE__*/_jsx(CaretRightOutlined, {
|
|
101
|
+
onClick: function onClick(e) {
|
|
102
|
+
return onExpand(record, e);
|
|
103
|
+
},
|
|
104
|
+
style: {
|
|
105
|
+
transition: "transform 0.2s",
|
|
106
|
+
transform: expanded ? 'rotate(90deg)' : undefined,
|
|
107
|
+
color: ((_mergedTheme$token6 = mergedTheme.token) === null || _mergedTheme$token6 === void 0 ? void 0 : _mergedTheme$token6.colorIcon) || ((_mergedTheme$token7 = mergedTheme.token) === null || _mergedTheme$token7 === void 0 ? void 0 : _mergedTheme$token7.colorTextSecondary)
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}, parentContext.table, table),
|
|
82
113
|
tabs: merge({}, parentContext.tabs, tabs),
|
|
83
114
|
theme: merge({}, mergedTheme, {
|
|
84
|
-
token:
|
|
85
|
-
// custom fontFamily
|
|
86
|
-
fontFamily !== defaultTheme.token.fontFamily ? {
|
|
87
|
-
fontFamily: fontFamily
|
|
88
|
-
} :
|
|
89
|
-
// use fontFamilyEn for en
|
|
90
|
-
['en', 'en-gb'].includes(mergedLocale.locale) ? {
|
|
91
|
-
fontFamily: fontFamilyEn
|
|
92
|
-
} : {}
|
|
115
|
+
token: _objectSpread(_objectSpread(_objectSpread({}, getLocaleTokenValue(mergedLocale, 'fontFamily', fontFamily, fontFamilyEn)), getLocaleTokenValue(mergedLocale, 'fontWeight', fontWeight, fontWeightEn)), getLocaleTokenValue(mergedLocale, 'fontWeightStrong', fontWeightStrong, fontWeightStrongEn))
|
|
93
116
|
}),
|
|
94
117
|
renderEmpty: parentContext.renderEmpty || function (componentName) {
|
|
95
118
|
return /*#__PURE__*/_jsx(DefaultRenderEmpty, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { CSSObject } from '@ant-design/cssinjs';
|
|
3
|
-
import type { FullToken, GenerateStyle } from '
|
|
3
|
+
import type { FullToken, GenerateStyle } from '../../theme/interface';
|
|
4
4
|
import type { DescriptionsProps } from '..';
|
|
5
5
|
export type DescriptionsToken = FullToken<'Alert'> & {
|
|
6
6
|
typographyPrefixCls: string;
|
package/es/drawer/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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 = ["locale", "children", "onOk", "onClose", "onCancel", "okText", "cancelText", "okButtonProps", "confirmLoading", "footer", "footerExtra", "rootClassName", "bodyStyle", "styles", "prefixCls"];
|
|
2
|
+
var _excluded = ["locale", "children", "loading", "onOk", "onClose", "onCancel", "okText", "cancelText", "okButtonProps", "confirmLoading", "footer", "footerExtra", "rootClassName", "bodyStyle", "styles", "prefixCls"];
|
|
3
3
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
4
|
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."); }
|
|
5
5
|
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); }
|
|
@@ -28,6 +28,7 @@ export * from 'antd/es/drawer';
|
|
|
28
28
|
var Drawer = function Drawer(_ref) {
|
|
29
29
|
var customLocale = _ref.locale,
|
|
30
30
|
children = _ref.children,
|
|
31
|
+
loading = _ref.loading,
|
|
31
32
|
onOk = _ref.onOk,
|
|
32
33
|
onClose = _ref.onClose,
|
|
33
34
|
onCancel = _ref.onCancel,
|
|
@@ -58,16 +59,17 @@ var Drawer = function Drawer(_ref) {
|
|
|
58
59
|
useSize(contentElment);
|
|
59
60
|
// useScroll for re-render when scroll
|
|
60
61
|
var scroll = useScroll(contentElment);
|
|
61
|
-
var isScroll = (contentElment === null || contentElment === void 0 ? void 0 : contentElment.scrollHeight) !== (contentElment === null || contentElment === void 0 ? void 0 : contentElment.clientHeight);
|
|
62
|
+
var isScroll = !loading && (contentElment === null || contentElment === void 0 ? void 0 : contentElment.scrollHeight) !== (contentElment === null || contentElment === void 0 ? void 0 : contentElment.clientHeight);
|
|
62
63
|
// start scroll
|
|
63
|
-
var isStartScroll = scroll.top > 0;
|
|
64
|
+
var isStartScroll = !loading && scroll.top > 0;
|
|
64
65
|
// Determine if an element has been totally scrolled
|
|
65
66
|
// ref: https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight#determine_if_an_element_has_been_totally_scrolled
|
|
66
|
-
var isTotalScroll = Math.abs(((contentElment === null || contentElment === void 0 ? void 0 : contentElment.scrollHeight) || 0) - ((contentElment === null || contentElment === void 0 ? void 0 : contentElment.clientHeight) || 0) - ((contentElment === null || contentElment === void 0 ? void 0 : contentElment.scrollTop) || 0)) < 1;
|
|
67
|
+
var isTotalScroll = !loading && Math.abs(((contentElment === null || contentElment === void 0 ? void 0 : contentElment.scrollHeight) || 0) - ((contentElment === null || contentElment === void 0 ? void 0 : contentElment.clientHeight) || 0) - ((contentElment === null || contentElment === void 0 ? void 0 : contentElment.scrollTop) || 0)) < 1;
|
|
67
68
|
var handleCancel = onCancel || onClose;
|
|
68
69
|
var showFooter = !!(footer || onOk) && footer !== false && footer !== null;
|
|
69
|
-
var drawerCls = classNames(
|
|
70
|
+
var drawerCls = classNames(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-loading"), loading), "".concat(prefixCls, "-with-footer"), showFooter), rootClassName);
|
|
70
71
|
return wrapSSR( /*#__PURE__*/_jsxs(AntDrawer, _objectSpread(_objectSpread({
|
|
72
|
+
loading: loading,
|
|
71
73
|
destroyOnClose: true,
|
|
72
74
|
onClose: handleCancel,
|
|
73
75
|
rootClassName: drawerCls,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { FullToken, GenerateStyle } from '
|
|
2
|
+
import type { FullToken, GenerateStyle } from '../../theme/interface';
|
|
3
3
|
export type DrawerToken = FullToken<'Drawer'>;
|
|
4
4
|
export declare const genDrawerStyle: GenerateStyle<DrawerToken>;
|
|
5
5
|
declare const _default: (prefixCls: string) => {
|
package/es/drawer/style/index.js
CHANGED
|
@@ -4,27 +4,45 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
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
5
|
import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
|
|
6
6
|
export var genDrawerStyle = function genDrawerStyle(token) {
|
|
7
|
-
var componentCls = token.componentCls
|
|
7
|
+
var componentCls = token.componentCls,
|
|
8
|
+
antCls = token.antCls,
|
|
9
|
+
fontSizeHeading3 = token.fontSizeHeading3,
|
|
10
|
+
colorSplit = token.colorSplit;
|
|
11
|
+
var contentPadding = token.paddingLG;
|
|
8
12
|
var boxShadowBottom = '0 2px 4px 0 rgba(54,69,99,0.04), 0 1px 6px -1px rgba(54,69,99,0.04), 0 1px 2px 0 rgba(54,69,99,0.06)';
|
|
9
13
|
var boxShadowTop = '0 -2px 4px 0 rgba(54,69,99,0.04), 0 -1px 6px -1px rgba(54,69,99,0.04), 0 -1px 2px 0 rgba(54,69,99,0.06)';
|
|
10
|
-
return _defineProperty(_defineProperty({}, "".concat(componentCls), _defineProperty({}, "".concat(componentCls, "-content"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-header"), {
|
|
11
|
-
|
|
14
|
+
return _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls), _defineProperty({}, "".concat(componentCls, "-content"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-header"), _defineProperty(_defineProperty({
|
|
15
|
+
position: 'relative',
|
|
16
|
+
padding: "".concat(token.padding, "px ").concat(token.paddingLG, "px"),
|
|
12
17
|
borderBottom: 'none',
|
|
13
18
|
transition: "box-shadow ".concat(token.motionDurationMid),
|
|
14
19
|
// ensure header box-shadow cover body content
|
|
15
20
|
zIndex: 10
|
|
16
|
-
}
|
|
21
|
+
}, "".concat(componentCls, "-title"), {
|
|
22
|
+
fontSize: fontSizeHeading3
|
|
23
|
+
}), '&::after', {
|
|
24
|
+
content: '""',
|
|
25
|
+
position: 'absolute',
|
|
26
|
+
bottom: 0,
|
|
27
|
+
left: 0,
|
|
28
|
+
right: 0,
|
|
29
|
+
height: '1px',
|
|
30
|
+
backgroundColor: colorSplit,
|
|
31
|
+
// 使用负margin让分割线贯通到content边缘
|
|
32
|
+
marginLeft: "-".concat(token.paddingLG, "px"),
|
|
33
|
+
marginRight: "-".concat(token.paddingLG, "px")
|
|
34
|
+
})), "".concat(componentCls, "-header-shadow"), {
|
|
17
35
|
boxShadow: boxShadowBottom
|
|
18
36
|
}), "".concat(componentCls, "-body"), {
|
|
19
37
|
padding: 0,
|
|
20
38
|
display: 'flex',
|
|
21
39
|
flexDirection: 'column'
|
|
22
40
|
}), "".concat(componentCls, "-body-content"), {
|
|
23
|
-
padding:
|
|
41
|
+
padding: contentPadding,
|
|
24
42
|
overflow: 'auto'
|
|
25
43
|
}), "".concat(componentCls, "-footer-container"), _defineProperty({
|
|
26
44
|
position: 'sticky',
|
|
27
|
-
padding:
|
|
45
|
+
padding: "".concat(token.padding, "px ").concat(token.paddingLG, "px"),
|
|
28
46
|
transition: "box-shadow ".concat(token.motionDurationMid),
|
|
29
47
|
// ensure footer box-shadow cover body content
|
|
30
48
|
zIndex: 10
|
|
@@ -33,10 +51,14 @@ export var genDrawerStyle = function genDrawerStyle(token) {
|
|
|
33
51
|
display: 'flex',
|
|
34
52
|
justifyContent: 'space-between',
|
|
35
53
|
alignItems: 'center'
|
|
36
|
-
})), "".concat(componentCls, "-footer-container-
|
|
54
|
+
})), "".concat(componentCls, "-footer-container-no-padding-top"), {
|
|
55
|
+
paddingTop: 0
|
|
56
|
+
}), "".concat(componentCls, "-footer-container-shadow"), {
|
|
37
57
|
boxShadow: boxShadowTop
|
|
38
|
-
}))), "".concat(componentCls).concat(componentCls, "-
|
|
39
|
-
padding:
|
|
58
|
+
}))), "".concat(componentCls).concat(componentCls, "-loading"), _defineProperty({}, "".concat(componentCls, "-body > ").concat(antCls, "-skeleton"), {
|
|
59
|
+
padding: contentPadding
|
|
60
|
+
})), "".concat(componentCls).concat(componentCls, "-with-footer"), _defineProperty({}, "".concat(componentCls, "-content"), _defineProperty({}, "".concat(componentCls, "-body-content"), {
|
|
61
|
+
paddingBottom: token.paddingXS
|
|
40
62
|
})));
|
|
41
63
|
};
|
|
42
64
|
export default (function (prefixCls) {
|
package/es/empty/index.js
CHANGED
|
@@ -56,7 +56,7 @@ var Empty = function Empty(props) {
|
|
|
56
56
|
var _useStyle = useStyle(prefixCls),
|
|
57
57
|
wrapSSR = _useStyle.wrapSSR;
|
|
58
58
|
var isHorizontal = layout === 'horizontal';
|
|
59
|
-
var emptyCls = classNames(
|
|
59
|
+
var emptyCls = classNames(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-horizontal"), isHorizontal), "".concat(prefixCls, "-small"), image === defaultEmptyImg || image === simpleEmptyImg), className);
|
|
60
60
|
return wrapSSR( /*#__PURE__*/_jsx(AntEmpty, _objectSpread(_objectSpread({
|
|
61
61
|
image: image,
|
|
62
62
|
description: /*#__PURE__*/_jsxs(_Fragment, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { FullToken, GenerateStyle } from '
|
|
2
|
+
import type { FullToken, GenerateStyle } from '../../theme/interface';
|
|
3
3
|
export type EmptyToken = FullToken<'Badge'>;
|
|
4
4
|
export declare const genEmptyStyle: GenerateStyle<EmptyToken>;
|
|
5
5
|
declare const _default: (prefixCls: string) => {
|
package/es/form/FormItem.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { FormItemProps as AntFormItemProps } from 'antd/es/form';
|
|
|
4
4
|
import type { TooltipProps } from '../tooltip';
|
|
5
5
|
declare const AntFormItem: (<Values = any>(props: AntFormItemProps<Values>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) & {
|
|
6
6
|
useStatus: () => {
|
|
7
|
-
status?: "" | "
|
|
7
|
+
status?: "" | "success" | "warning" | "error" | "validating";
|
|
8
8
|
errors: React.ReactNode[];
|
|
9
9
|
warnings: React.ReactNode[];
|
|
10
10
|
};
|
|
@@ -17,6 +17,7 @@ export type LabelTooltipType = WrapperTooltipProps | React.ReactNode;
|
|
|
17
17
|
export interface FormItemProps extends AntFormItemProps {
|
|
18
18
|
tooltip?: WrapperTooltipProps | ReactNode;
|
|
19
19
|
action?: ReactNode;
|
|
20
|
+
description?: ReactNode;
|
|
20
21
|
}
|
|
21
22
|
type CompoundedComponent = React.FC<FormItemProps> & {
|
|
22
23
|
useStatus: typeof AntFormItem.useStatus;
|
package/es/form/FormItem.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var _excluded = ["children", "label", "tooltip", "action", "layout", "prefixCls", "className"],
|
|
1
|
+
var _excluded = ["children", "label", "tooltip", "action", "description", "layout", "prefixCls", "className"],
|
|
2
2
|
_excluded2 = ["icon", "type", "overlayInnerStyle"];
|
|
3
3
|
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
4
|
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
|
+
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); }
|
|
5
6
|
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
7
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
8
|
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 _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); }
|
|
9
9
|
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; }
|
|
10
10
|
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; }
|
|
11
11
|
import React, { useContext } from 'react';
|
|
@@ -27,6 +27,7 @@ var FormItem = function FormItem(_ref) {
|
|
|
27
27
|
label = _ref.label,
|
|
28
28
|
tooltip = _ref.tooltip,
|
|
29
29
|
action = _ref.action,
|
|
30
|
+
description = _ref.description,
|
|
30
31
|
externalLayout = _ref.layout,
|
|
31
32
|
customizePrefixCls = _ref.prefixCls,
|
|
32
33
|
className = _ref.className,
|
|
@@ -36,7 +37,7 @@ var FormItem = function FormItem(_ref) {
|
|
|
36
37
|
var prefixCls = getPrefixCls('form', customizePrefixCls);
|
|
37
38
|
var _useStyle = useStyle(prefixCls),
|
|
38
39
|
wrapSSR = _useStyle.wrapSSR;
|
|
39
|
-
var formItemCls = classNames(className);
|
|
40
|
+
var formItemCls = classNames(className, _defineProperty({}, "".concat(prefixCls, "-item-has-description"), !!description));
|
|
40
41
|
var _useContext2 = useContext(FormContext),
|
|
41
42
|
contextLayout = _useContext2.layout,
|
|
42
43
|
vertical = _useContext2.vertical;
|
|
@@ -59,6 +60,13 @@ var FormItem = function FormItem(_ref) {
|
|
|
59
60
|
}, overlayInnerStyle)
|
|
60
61
|
}, restTooltipProps);
|
|
61
62
|
}
|
|
63
|
+
|
|
64
|
+
// description config - only show in vertical layout
|
|
65
|
+
var isVertical = layout === 'vertical' || vertical;
|
|
66
|
+
var descriptionContent = description && isVertical ? /*#__PURE__*/_jsx("div", {
|
|
67
|
+
className: "".concat(prefixCls, "-item-description"),
|
|
68
|
+
children: description
|
|
69
|
+
}) : null;
|
|
62
70
|
return wrapSSR( /*#__PURE__*/_jsx(AntFormItem, _objectSpread(_objectSpread({
|
|
63
71
|
layout: layout,
|
|
64
72
|
label: action && (layout === 'vertical' || vertical) ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
@@ -75,7 +83,9 @@ var FormItem = function FormItem(_ref) {
|
|
|
75
83
|
prefixCls: customizePrefixCls,
|
|
76
84
|
className: formItemCls
|
|
77
85
|
}, restProps), {}, {
|
|
78
|
-
children:
|
|
86
|
+
children: /*#__PURE__*/_jsxs(_Fragment, {
|
|
87
|
+
children: [descriptionContent, children]
|
|
88
|
+
})
|
|
79
89
|
})));
|
|
80
90
|
};
|
|
81
91
|
FormItem.useStatus = AntFormItem.useStatus;
|
package/es/form/style/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { FullToken, GenerateStyle } from '
|
|
2
|
+
import type { FullToken, GenerateStyle } from '../../theme/interface';
|
|
3
3
|
export type FormToken = FullToken<'Form'>;
|
|
4
4
|
export declare const genFormStyle: GenerateStyle<FormToken>;
|
|
5
5
|
declare const _default: (prefixCls: string) => {
|
package/es/form/style/index.js
CHANGED
|
@@ -5,12 +5,23 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
5
5
|
import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
|
|
6
6
|
export var genFormStyle = function genFormStyle(token) {
|
|
7
7
|
var componentCls = token.componentCls;
|
|
8
|
-
return _defineProperty(
|
|
8
|
+
return _defineProperty(_defineProperty({}, componentCls, _defineProperty({}, "".concat(componentCls, "-item-extra"), {
|
|
9
|
+
paddingTop: token.paddingXXS,
|
|
10
|
+
fontSize: token.fontSizeSM
|
|
11
|
+
})), "".concat(componentCls).concat(componentCls, "-vertical"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-item:not(").concat(componentCls, "-item-horizontal)"), _defineProperty({}, "".concat(componentCls, "-item-label > label"), _defineProperty({
|
|
9
12
|
width: '100%'
|
|
10
13
|
}, "".concat(componentCls, "-item-action"), {
|
|
11
14
|
position: 'absolute',
|
|
12
15
|
right: 0
|
|
13
|
-
}))))
|
|
16
|
+
}))), "".concat(componentCls, "-item-has-description"), _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-item-control-input"), {
|
|
17
|
+
minHeight: 'auto'
|
|
18
|
+
}), "".concat(componentCls, "-item-label"), {
|
|
19
|
+
paddingBottom: token.paddingXXS
|
|
20
|
+
}), "".concat(componentCls, "-item-description"), {
|
|
21
|
+
paddingBottom: token.paddingXXS + 2,
|
|
22
|
+
fontSize: token.fontSizeSM,
|
|
23
|
+
color: token.colorTextDescription
|
|
24
|
+
})));
|
|
14
25
|
};
|
|
15
26
|
export default (function (prefixCls) {
|
|
16
27
|
var useStyle = genComponentStyleHook('Form', function (token) {
|
package/es/index.d.ts
CHANGED
|
@@ -13,6 +13,8 @@ export { default as Typography } from './typography';
|
|
|
13
13
|
export type { TypographyProps } from './typography';
|
|
14
14
|
export { default as Card } from './card';
|
|
15
15
|
export type { CardProps } from './card';
|
|
16
|
+
export { default as App } from './app';
|
|
17
|
+
export type { AppProps } from './app';
|
|
16
18
|
export { default as ConfigProvider } from './config-provider';
|
|
17
19
|
export type { ConfigProviderProps, ConfigConsumerProps, ThemeConfig } from './config-provider';
|
|
18
20
|
export { default as Descriptions } from './descriptions';
|
|
@@ -68,8 +70,8 @@ export { default as Lottie } from './lottie';
|
|
|
68
70
|
export type { LottieProps, LottieRef } from './lottie';
|
|
69
71
|
export { default as theme } from './theme';
|
|
70
72
|
declare const useToken: () => {
|
|
71
|
-
theme: import("@ant-design/cssinjs").Theme<import("antd/
|
|
72
|
-
token: import("
|
|
73
|
+
theme: import("@ant-design/cssinjs").Theme<import("antd/lib/theme/interface/seeds").SeedToken, import("./theme/interface").AliasToken>;
|
|
74
|
+
token: import("./theme/interface").GlobalToken;
|
|
73
75
|
hashId: string;
|
|
74
76
|
};
|
|
75
77
|
export { useToken };
|
package/es/index.js
CHANGED
|
@@ -7,6 +7,7 @@ export { default as Space } from "./space";
|
|
|
7
7
|
export { Col, Row } from "./grid";
|
|
8
8
|
export { default as Typography } from "./typography";
|
|
9
9
|
export { default as Card } from "./card";
|
|
10
|
+
export { default as App } from "./app";
|
|
10
11
|
export { default as ConfigProvider } from "./config-provider";
|
|
11
12
|
export { default as Descriptions } from "./descriptions";
|
|
12
13
|
export { default as Empty } from "./empty";
|
|
@@ -8,7 +8,8 @@ export interface InputNumberLocale {
|
|
|
8
8
|
export interface InputNumberProps extends AntInputNumberProps {
|
|
9
9
|
locale?: InputNumberLocale;
|
|
10
10
|
}
|
|
11
|
-
type
|
|
11
|
+
type InputNumberRef = React.ComponentRef<typeof AntInputNumber>;
|
|
12
|
+
type CompoundedComponent = React.ForwardRefExoticComponent<InputNumberProps & React.RefAttributes<InputNumberRef>> & {
|
|
12
13
|
_InternalPanelDoNotUseOrYouWillBeFired: typeof AntInputNumber._InternalPanelDoNotUseOrYouWillBeFired;
|
|
13
14
|
};
|
|
14
15
|
declare const InputNumber: CompoundedComponent;
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
import jaJP from 'antd/es/locale/ja_JP';
|
|
8
|
+
export default _objectSpread(_objectSpread({}, jaJP), {}, {
|
|
9
|
+
global: _objectSpread(_objectSpread({}, jaJP.global), {}, {
|
|
10
|
+
inputPlaceholder: '入力してください'
|
|
11
|
+
}),
|
|
12
|
+
Pagination: _objectSpread(_objectSpread({}, jaJP.Pagination), {}, {
|
|
13
|
+
total: '合計 ${total} 件'
|
|
14
|
+
}),
|
|
15
|
+
Drawer: {
|
|
16
|
+
okText: '確定',
|
|
17
|
+
cancelText: 'キャンセル'
|
|
18
|
+
},
|
|
19
|
+
Table: _objectSpread(_objectSpread({}, jaJP.Table), {}, {
|
|
20
|
+
batchOperationBar: {
|
|
21
|
+
selected: '選択済み',
|
|
22
|
+
object: '件',
|
|
23
|
+
cancel: 'キャンセル',
|
|
24
|
+
collapse: '折りたたむ',
|
|
25
|
+
open: '展開'
|
|
26
|
+
}
|
|
27
|
+
})
|
|
28
|
+
});
|