@oceanbase/design 1.0.0-alpha.6 → 1.0.0-alpha.8
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/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/alert/index.js +1 -4
- package/es/app/style/index.js +3 -6
- package/es/config-provider/index.js +13 -11
- package/es/descriptions/hooks/useItems.d.ts +6 -6
- package/es/descriptions/style/index.js +3 -1
- 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.js +7 -9
- package/es/form/style/index.js +12 -10
- package/es/input/Input.d.ts +2 -0
- package/es/input/Input.js +23 -7
- package/es/input/Password.js +17 -5
- package/es/input/Search.js +17 -5
- package/es/input/TextArea.js +17 -5
- package/es/input/style/index.d.ts +9 -0
- package/es/input/style/index.js +17 -0
- package/es/input-number/index.js +11 -4
- package/es/input-number/style/index.d.ts +9 -0
- package/es/input-number/style/index.js +22 -0
- package/es/locale/ja-JP.js +2 -2
- package/es/segmented/index.d.ts +1 -0
- package/es/segmented/index.js +15 -7
- package/es/segmented/style/index.js +1 -0
- package/es/style/global.d.ts +4 -1
- package/es/style/global.js +75 -19
- package/es/table/index.d.ts +2 -2
- package/es/table/style/index.js +5 -1
- package/es/theme/default.d.ts +1 -1
- package/es/theme/default.js +1 -1
- package/es/typography/style/index.js +3 -0
- package/lib/alert/index.js +1 -3
- package/lib/app/style/index.js +2 -4
- package/lib/config-provider/index.js +13 -5
- package/lib/descriptions/hooks/useItems.d.ts +6 -6
- package/lib/descriptions/style/index.js +3 -0
- 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.js +5 -6
- package/lib/form/style/index.js +17 -12
- package/lib/input/Input.d.ts +2 -0
- package/lib/input/Input.js +35 -12
- package/lib/input/Password.js +20 -3
- package/lib/input/Search.js +30 -11
- package/lib/input/TextArea.js +20 -3
- package/lib/input/style/index.d.ts +9 -0
- package/lib/input/style/index.js +46 -0
- package/lib/input-number/index.js +18 -3
- package/lib/input-number/style/index.d.ts +9 -0
- package/lib/input-number/style/index.js +51 -0
- package/lib/locale/ja-JP.js +2 -2
- package/lib/segmented/index.d.ts +1 -0
- package/lib/segmented/index.js +10 -3
- package/lib/segmented/style/index.js +1 -0
- package/lib/style/global.d.ts +4 -1
- package/lib/style/global.js +77 -10
- package/lib/table/index.d.ts +2 -2
- package/lib/table/style/index.js +5 -1
- package/lib/theme/default.d.ts +1 -1
- package/lib/theme/default.js +1 -1
- package/lib/typography/style/index.js +3 -0
- package/package.json +3 -2
- package/dist/static/Inter.f6bcdfb6.woff2 +0 -0
- package/es/fonts/Inter.woff2 +0 -0
- package/lib/fonts/Inter.woff2 +0 -0
package/es/segmented/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var _excluded = ["prefixCls", "options"],
|
|
2
|
-
_excluded2 = ["label", "badge"];
|
|
2
|
+
_excluded2 = ["label", "icon", "badge", "ellipsis"];
|
|
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
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; }
|
|
@@ -39,16 +39,24 @@ var Segmented = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
39
39
|
}, []);
|
|
40
40
|
var newOptions = options === null || options === void 0 ? void 0 : options.map(function (item) {
|
|
41
41
|
if (_typeof(item) === 'object') {
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
var _ref2 = item,
|
|
43
|
+
label = _ref2.label,
|
|
44
|
+
icon = _ref2.icon,
|
|
45
|
+
badge = _ref2.badge,
|
|
46
|
+
_ref2$ellipsis = _ref2.ellipsis,
|
|
47
|
+
ellipsis = _ref2$ellipsis === void 0 ? {
|
|
48
|
+
tooltip: true
|
|
49
|
+
} : _ref2$ellipsis,
|
|
50
|
+
restItem = _objectWithoutProperties(_ref2, _excluded2);
|
|
45
51
|
return _objectSpread(_objectSpread({}, restItem), {}, {
|
|
46
52
|
label: /*#__PURE__*/_jsxs(Flex, {
|
|
47
|
-
gap: 4,
|
|
48
53
|
align: "center",
|
|
49
54
|
justify: "center",
|
|
50
|
-
children: [
|
|
51
|
-
|
|
55
|
+
children: [icon && /*#__PURE__*/_jsx("span", {
|
|
56
|
+
className: "".concat(prefixCls, "-item-icon"),
|
|
57
|
+
children: icon
|
|
58
|
+
}), ellipsis ? /*#__PURE__*/_jsx(Typography.Text, {
|
|
59
|
+
ellipsis: ellipsis,
|
|
52
60
|
children: label
|
|
53
61
|
}) : label, badge && renderBadge(badge)]
|
|
54
62
|
})
|
|
@@ -13,6 +13,7 @@ export var genSegmentedStyle = function genSegmentedStyle(token) {
|
|
|
13
13
|
})), '&:active', _defineProperty({}, "".concat(antCls, "-badge >").concat(antCls, "-badge-count"), {
|
|
14
14
|
backgroundColor: colorFillSecondary
|
|
15
15
|
})))), ">".concat(componentCls, "-item"), _defineProperty({}, ">".concat(componentCls, "-item-label"), _defineProperty({}, "".concat(antCls, "-badge >").concat(antCls, "-badge-count"), {
|
|
16
|
+
marginInlineStart: 4,
|
|
16
17
|
backgroundColor: colorFillSecondary,
|
|
17
18
|
color: 'inherit',
|
|
18
19
|
boxShadow: 'none'
|
package/es/style/global.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import 'antd/dist/reset.css';
|
|
3
|
-
|
|
3
|
+
export interface GlobalStyleProps {
|
|
4
|
+
prefixCls?: string;
|
|
5
|
+
}
|
|
6
|
+
declare const GlobalStyle: React.FC<GlobalStyleProps>;
|
|
4
7
|
export { GlobalStyle };
|
|
5
8
|
export default GlobalStyle;
|
package/es/style/global.js
CHANGED
|
@@ -1,36 +1,69 @@
|
|
|
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 _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
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
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); }
|
|
1
5
|
import React from 'react';
|
|
2
6
|
import { useStyleRegister } from '@ant-design/cssinjs';
|
|
3
7
|
import themeConfig from "../theme";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
8
|
+
import interRegular from "../fonts/Inter-Regular.woff2";
|
|
9
|
+
import interMedium from "../fonts/Inter-Medium.woff2";
|
|
10
|
+
import interSemibold from "../fonts/Inter-SemiBold.woff2";
|
|
11
|
+
import consolas from "../fonts/Consolas.woff2";
|
|
12
|
+
import helveticaNeue from "../fonts/HelveticaNeue.woff2";
|
|
7
13
|
import 'antd/dist/reset.css';
|
|
8
14
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
9
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
var genGlobalStyle = function genGlobalStyle(token) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
16
|
+
var genGlobalStyle = function genGlobalStyle(token, prefixCls) {
|
|
17
|
+
var antCls = ".".concat(prefixCls);
|
|
18
|
+
var buttonComponentCls = "".concat(antCls, "-btn");
|
|
19
|
+
var typographyComponentCls = "".concat(antCls, "-typography");
|
|
20
|
+
var menuComponentCls = "".concat(antCls, "-menu");
|
|
21
|
+
return [{
|
|
14
22
|
'@font-face': {
|
|
15
|
-
fontFamily:
|
|
16
|
-
|
|
23
|
+
fontFamily: 'Inter',
|
|
24
|
+
fontStyle: 'lighter',
|
|
25
|
+
fontWeight: 300,
|
|
26
|
+
// load priority: local font > self-hosting font > remote font
|
|
27
|
+
src: "local('Inter'), url(".concat(interRegular, ") format('woff2'), url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*ucHoQ4exBNYAAAAARtAAAAgAemfOAQ/Inter-Regular.woff2') format('woff2')"),
|
|
17
28
|
fontDisplay: 'swap'
|
|
18
29
|
}
|
|
19
30
|
}, {
|
|
20
31
|
'@font-face': {
|
|
21
|
-
fontFamily:
|
|
22
|
-
|
|
32
|
+
fontFamily: 'Inter',
|
|
33
|
+
fontStyle: 'normal',
|
|
34
|
+
fontWeight: 400,
|
|
35
|
+
src: "local('Inter'), url(".concat(interMedium, ") format('woff2'), url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*GboAQ56sQbkAAAAARwAAAAgAemfOAQ/Inter-Medium.woff2') format('woff2')"),
|
|
23
36
|
fontDisplay: 'swap'
|
|
24
37
|
}
|
|
25
38
|
}, {
|
|
26
39
|
'@font-face': {
|
|
27
|
-
fontFamily:
|
|
28
|
-
|
|
40
|
+
fontFamily: 'Inter',
|
|
41
|
+
fontStyle: 'medium',
|
|
42
|
+
fontWeight: 500,
|
|
43
|
+
src: "local('Inter'), url(".concat(interMedium, ") format('woff2'), url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*GboAQ56sQbkAAAAARwAAAAgAemfOAQ/Inter-Medium.woff2') format('woff2')"),
|
|
29
44
|
fontDisplay: 'swap'
|
|
30
45
|
}
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
|
|
46
|
+
}, {
|
|
47
|
+
'@font-face': {
|
|
48
|
+
fontFamily: 'Inter',
|
|
49
|
+
fontStyle: 'semibold',
|
|
50
|
+
fontWeight: 600,
|
|
51
|
+
src: "local('Inter'), url(".concat(interSemibold, ") format('woff2'), url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*tcOIT5gLQl4AAAAARwAAAAgAemfOAQ/Inter-SemiBold.woff2') format('woff2')"),
|
|
52
|
+
fontDisplay: 'swap'
|
|
53
|
+
}
|
|
54
|
+
}, {
|
|
55
|
+
'@font-face': {
|
|
56
|
+
fontFamily: 'Consolas',
|
|
57
|
+
src: "local('Consolas'), url(".concat(consolas, ") format('woff2'), url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*R8bMTqAdGWgAAAAAAAAAAAAADmfOAQ/Consolas.woff2') format('woff2')"),
|
|
58
|
+
fontDisplay: 'swap'
|
|
59
|
+
}
|
|
60
|
+
}, {
|
|
61
|
+
'@font-face': {
|
|
62
|
+
fontFamily: 'Helvetica Neue',
|
|
63
|
+
src: "local('Helvetica Neue'), url(".concat(helveticaNeue, ") format('woff2'), url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*3EzqR6aYJMkAAAAAAAAAAAAADmfOAQ/HelveticaNeue.woff2') format('woff2')"),
|
|
64
|
+
fontDisplay: 'swap'
|
|
65
|
+
}
|
|
66
|
+
}, _defineProperty(_defineProperty(_defineProperty({
|
|
34
67
|
'pre, code, kbd, samp': {
|
|
35
68
|
fontFamily: token.fontFamilyCode
|
|
36
69
|
},
|
|
@@ -39,10 +72,33 @@ var genGlobalStyle = function genGlobalStyle(token) {
|
|
|
39
72
|
},
|
|
40
73
|
'.rc-virtual-list-scrollbar-thumb': {
|
|
41
74
|
background: "".concat(token.colorFillSecondary, " !important")
|
|
75
|
+
},
|
|
76
|
+
// link with href or data-aspm-param^="obcloud_openLink= show underline on hover
|
|
77
|
+
// except disabled and antd element
|
|
78
|
+
'a[href], a[data-aspm-param^="obcloud_openLink="]': _defineProperty({}, "&:not([disabled]):not([class^=\"".concat(prefixCls, "-\"]):hover"), {
|
|
79
|
+
textDecoration: 'underline'
|
|
80
|
+
})
|
|
81
|
+
}, "".concat(buttonComponentCls).concat(buttonComponentCls, "-link:not(").concat(buttonComponentCls, "-disabled)"), {
|
|
82
|
+
'&[href], &[data-aspm-param^="obcloud_openLink="]': {
|
|
83
|
+
'&:hover': {
|
|
84
|
+
textDecoration: 'underline'
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}), "".concat(typographyComponentCls, ":not(").concat(typographyComponentCls, "-disabled)"), {
|
|
88
|
+
'&[href], &[data-aspm-param^="obcloud_openLink="]': {
|
|
89
|
+
'&:hover': {
|
|
90
|
+
textDecoration: 'underline'
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}), "".concat(menuComponentCls), _defineProperty({}, "".concat(menuComponentCls, "-item"), _defineProperty({}, "".concat(menuComponentCls, "-title-content"), {
|
|
94
|
+
'a:hover': {
|
|
95
|
+
textDecoration: 'none'
|
|
42
96
|
}
|
|
43
|
-
}];
|
|
97
|
+
})))];
|
|
44
98
|
};
|
|
45
|
-
var GlobalStyle = function GlobalStyle() {
|
|
99
|
+
var GlobalStyle = function GlobalStyle(_ref2) {
|
|
100
|
+
var _ref2$prefixCls = _ref2.prefixCls,
|
|
101
|
+
prefixCls = _ref2$prefixCls === void 0 ? 'ant' : _ref2$prefixCls;
|
|
46
102
|
var _themeConfig$useToken = themeConfig.useToken(),
|
|
47
103
|
theme = _themeConfig$useToken.theme,
|
|
48
104
|
token = _themeConfig$useToken.token;
|
|
@@ -54,7 +110,7 @@ var GlobalStyle = function GlobalStyle() {
|
|
|
54
110
|
// Empty hashId for global styles
|
|
55
111
|
order: -1000 // Inject before other styles
|
|
56
112
|
}, function () {
|
|
57
|
-
return genGlobalStyle(token);
|
|
113
|
+
return genGlobalStyle(token, prefixCls);
|
|
58
114
|
});
|
|
59
115
|
return wrapSSR( /*#__PURE__*/_jsx(_Fragment, {}));
|
|
60
116
|
};
|
package/es/table/index.d.ts
CHANGED
|
@@ -38,8 +38,8 @@ declare const _default: (<RecordType extends AnyObject = AnyObject>(props: Table
|
|
|
38
38
|
SELECTION_ALL: "SELECT_ALL";
|
|
39
39
|
SELECTION_INVERT: "SELECT_INVERT";
|
|
40
40
|
SELECTION_NONE: "SELECT_NONE";
|
|
41
|
-
Column: <
|
|
42
|
-
ColumnGroup: <
|
|
41
|
+
Column: <RecordType_1 extends import("antd/es/_util/type").AnyObject>(_: import("antd").TableColumnProps<RecordType_1>) => null;
|
|
42
|
+
ColumnGroup: <RecordType_2 extends import("antd/es/_util/type").AnyObject>(_: import("antd/es/table/ColumnGroup").ColumnGroupProps<RecordType_2>) => null;
|
|
43
43
|
Summary: typeof Summary;
|
|
44
44
|
useStyle: (prefixCls: string) => {
|
|
45
45
|
wrapSSR: (node: ReactNode) => ReactElement<any, string | React.JSXElementConstructor<any>>;
|
package/es/table/style/index.js
CHANGED
|
@@ -46,7 +46,11 @@ export var genTableStyle = function genTableStyle(token) {
|
|
|
46
46
|
}, "& ~ td", {
|
|
47
47
|
borderBottom: 'none'
|
|
48
48
|
})), "tr > td", {
|
|
49
|
-
|
|
49
|
+
fontWeight: token.fontWeight,
|
|
50
|
+
transition: "background ".concat(token.motionDurationMid),
|
|
51
|
+
a: {
|
|
52
|
+
fontWeight: token.fontWeightStrong
|
|
53
|
+
}
|
|
50
54
|
}), "".concat(componentCls, "-placeholder td"), {}), "".concat(componentCls, "-empty-wrapper"), {
|
|
51
55
|
minHeight: calc(360).sub(calc(token.paddingSM).mul(2).equal()).equal(),
|
|
52
56
|
display: 'flex',
|
package/es/theme/default.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const fontFamilyEn = "Inter, 'Noto sans', sans-serif, Roboto, 'Open Sans', 'Segoe UI', 'Helvetica Neue', 'Helvetica, Arial', 'Apple Color Emoji'";
|
|
2
|
-
export declare const fontWeightWeakEn =
|
|
2
|
+
export declare const fontWeightWeakEn = 300;
|
|
3
3
|
export declare const fontWeightEn = 500;
|
|
4
4
|
export declare const fontWeightStrongEn = 600;
|
|
5
5
|
declare const _default: import("antd").ThemeConfig;
|
package/es/theme/default.js
CHANGED
|
@@ -23,7 +23,7 @@ var borderRadius = 4;
|
|
|
23
23
|
var borderRadiusMD = 6;
|
|
24
24
|
var borderRadiusLG = 8;
|
|
25
25
|
export var fontFamilyEn = "Inter, 'Noto sans', sans-serif, Roboto, 'Open Sans', 'Segoe UI', 'Helvetica Neue', 'Helvetica, Arial', 'Apple Color Emoji'";
|
|
26
|
-
export var fontWeightWeakEn =
|
|
26
|
+
export var fontWeightWeakEn = 300;
|
|
27
27
|
export var fontWeightEn = 500;
|
|
28
28
|
export var fontWeightStrongEn = 600;
|
|
29
29
|
var defaultTheme = {
|
|
@@ -46,14 +46,17 @@ export var genTypographyStyle = function genTypographyStyle(token) {
|
|
|
46
46
|
}
|
|
47
47
|
}), "".concat(componentCls).concat(componentCls, "-edit-content"), _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-div&"), {
|
|
48
48
|
insetInlineStart: calc(token.paddingSM).mul(-1).equal(),
|
|
49
|
+
insetBlockStart: 0,
|
|
49
50
|
marginTop: negativeMarginOffset,
|
|
50
51
|
marginBottom: calc('1em').sub(marginOffset).equal()
|
|
51
52
|
}), "".concat(componentCls, "-span&"), {
|
|
52
53
|
insetInlineStart: calc(token.paddingSM).mul(-1).equal(),
|
|
54
|
+
insetBlockStart: 0,
|
|
53
55
|
marginTop: negativeMarginOffset,
|
|
54
56
|
marginBottom: negativeMarginOffset
|
|
55
57
|
}), "".concat(componentCls, "-h1&, ").concat(componentCls, "-h2&, ").concat(componentCls, "-h3&, ").concat(componentCls, "-h4&, ").concat(componentCls, "-h5&"), {
|
|
56
58
|
insetInlineStart: calc(token.paddingSM).mul(-1).equal(),
|
|
59
|
+
insetBlockStart: 0,
|
|
57
60
|
marginTop: "".concat(negativeMarginOffset, " !important"),
|
|
58
61
|
marginBottom: "".concat(negativeMarginOffset, " !important")
|
|
59
62
|
}));
|
package/lib/alert/index.js
CHANGED
|
@@ -39,7 +39,6 @@ var import_icons = require("@oceanbase/icons");
|
|
|
39
39
|
var import_classnames = __toESM(require("classnames"));
|
|
40
40
|
var import_config_provider = __toESM(require("../config-provider"));
|
|
41
41
|
var import_style = __toESM(require("./style"));
|
|
42
|
-
var import_theme = __toESM(require("../theme"));
|
|
43
42
|
__reExport(alert_exports, require("antd/es/alert"), module.exports);
|
|
44
43
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
45
44
|
var iconMapOutlined = {
|
|
@@ -59,8 +58,7 @@ var Alert = ({
|
|
|
59
58
|
className,
|
|
60
59
|
...restProps
|
|
61
60
|
}) => {
|
|
62
|
-
const
|
|
63
|
-
const type = banner && !typeProp ? "warning" : typeProp;
|
|
61
|
+
const type = (banner && !typeProp ? "warning" : typeProp) || "info";
|
|
64
62
|
const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
|
|
65
63
|
const prefixCls = getPrefixCls("alert", customizePrefixCls);
|
|
66
64
|
const { wrapSSR } = (0, import_style.default)(prefixCls);
|
package/lib/app/style/index.js
CHANGED
|
@@ -25,10 +25,8 @@ __export(style_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(style_exports);
|
|
26
26
|
var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
|
|
27
27
|
var genAppStyle = (token) => {
|
|
28
|
-
const { componentCls } = token;
|
|
29
|
-
return {
|
|
30
|
-
[`${componentCls}`]: {}
|
|
31
|
-
};
|
|
28
|
+
const { antCls, componentCls } = token;
|
|
29
|
+
return {};
|
|
32
30
|
};
|
|
33
31
|
var style_default = (prefixCls) => {
|
|
34
32
|
const useStyle = (0, import_genComponentStyleHook.genComponentStyleHook)("App", (token) => {
|
|
@@ -78,7 +78,7 @@ var ConfigProvider = ({
|
|
|
78
78
|
appProps,
|
|
79
79
|
...restProps
|
|
80
80
|
}) => {
|
|
81
|
-
var _a, _b, _c, _d;
|
|
81
|
+
var _a, _b, _c, _d, _e;
|
|
82
82
|
const parentContext = import_react.default.useContext(import_antd.ConfigProvider.ConfigContext);
|
|
83
83
|
const parentExtendedContext = import_react.default.useContext(ExtendedConfigContext);
|
|
84
84
|
const { isAliyun, isDark, isCompact } = (0, import_lodash.merge)({}, parentContext.theme, theme);
|
|
@@ -122,8 +122,9 @@ var ConfigProvider = ({
|
|
|
122
122
|
);
|
|
123
123
|
const { token } = import_theme.default.useToken();
|
|
124
124
|
const fontFamily = ((_a = mergedTheme.token) == null ? void 0 : _a.fontFamily) || token.fontFamily;
|
|
125
|
-
const
|
|
126
|
-
const
|
|
125
|
+
const fontWeightWeak = ((_b = mergedTheme.token) == null ? void 0 : _b.fontWeightWeak) || token.fontWeightWeak;
|
|
126
|
+
const fontWeight = ((_c = mergedTheme.token) == null ? void 0 : _c.fontWeight) || token.fontWeight;
|
|
127
|
+
const fontWeightStrong = ((_d = mergedTheme.token) == null ? void 0 : _d.fontWeightStrong) || token.fontWeightStrong;
|
|
127
128
|
const parentStyleContext = import_react.default.useContext(import_StyleContext.default);
|
|
128
129
|
const mergedStyleProviderProps = (0, import_lodash.merge)({}, parentStyleContext, styleProviderProps);
|
|
129
130
|
const mergedLocale = (0, import_lodash.merge)({}, parentContext.locale, locale);
|
|
@@ -193,6 +194,13 @@ var ConfigProvider = ({
|
|
|
193
194
|
fontFamily,
|
|
194
195
|
import_default.fontFamilyEn
|
|
195
196
|
),
|
|
197
|
+
...getLocaleTokenValue(
|
|
198
|
+
mergedTheme.token || {},
|
|
199
|
+
mergedLocale,
|
|
200
|
+
"fontWeightWeak",
|
|
201
|
+
fontWeightWeak,
|
|
202
|
+
import_default.fontWeightWeakEn
|
|
203
|
+
),
|
|
196
204
|
...getLocaleTokenValue(
|
|
197
205
|
mergedTheme.token || {},
|
|
198
206
|
mergedLocale,
|
|
@@ -216,12 +224,12 @@ var ConfigProvider = ({
|
|
|
216
224
|
{
|
|
217
225
|
value: {
|
|
218
226
|
navigate: navigate === void 0 ? parentExtendedContext.navigate : navigate,
|
|
219
|
-
hideOnSinglePage: ((
|
|
227
|
+
hideOnSinglePage: ((_e = parentContext.pagination) == null ? void 0 : _e.showSizeChanger) ? false : hideOnSinglePage !== void 0 ? hideOnSinglePage : parentExtendedContext.hideOnSinglePage,
|
|
220
228
|
// inject static function to outermost ConfigProvider only
|
|
221
229
|
injectStaticFunction: false
|
|
222
230
|
},
|
|
223
231
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_cssinjs.StyleProvider, { ...mergedStyleProviderProps, children: [
|
|
224
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_global.default, {}),
|
|
232
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_global.default, { prefixCls: restProps.prefixCls }),
|
|
225
233
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_app.default, { component: false, ...appProps, children: [
|
|
226
234
|
children,
|
|
227
235
|
parentExtendedContext.injectStaticFunction && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_static_function.default, {})
|
|
@@ -5,17 +5,17 @@ export default function useItems(items?: DescriptionsItemType[], children?: Reac
|
|
|
5
5
|
key?: React.Key;
|
|
6
6
|
label?: React.ReactNode;
|
|
7
7
|
span?: number | "filled" | {
|
|
8
|
-
xxl?: number;
|
|
9
|
-
xl?: number;
|
|
10
|
-
lg?: number;
|
|
11
|
-
md?: number;
|
|
12
|
-
sm?: number;
|
|
13
8
|
xs?: number;
|
|
9
|
+
sm?: number;
|
|
10
|
+
md?: number;
|
|
11
|
+
lg?: number;
|
|
12
|
+
xl?: number;
|
|
13
|
+
xxl?: number;
|
|
14
14
|
};
|
|
15
15
|
style?: React.CSSProperties;
|
|
16
|
-
className?: string;
|
|
17
16
|
classNames?: Partial<Record<"label" | "content", string>>;
|
|
18
17
|
styles?: Partial<Record<"label" | "content", React.CSSProperties>>;
|
|
18
|
+
className?: string;
|
|
19
19
|
labelStyle?: React.CSSProperties;
|
|
20
20
|
contentStyle?: React.CSSProperties;
|
|
21
21
|
}[];
|
|
@@ -68,6 +68,9 @@ var genDescriptionsStyle = (token) => {
|
|
|
68
68
|
return {
|
|
69
69
|
[`${componentCls}`]: {
|
|
70
70
|
...genVerticalStyle("default", token),
|
|
71
|
+
[`${componentCls}-item-label`]: {
|
|
72
|
+
fontWeight: token.fontWeightWeak
|
|
73
|
+
},
|
|
71
74
|
[`${componentCls}-item-container`]: {
|
|
72
75
|
[`${componentCls}-item-content`]: {
|
|
73
76
|
paddingRight: 12,
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/form/FormItem.js
CHANGED
|
@@ -85,24 +85,23 @@ var FormItem = ({
|
|
|
85
85
|
}
|
|
86
86
|
const isVertical = layout === "vertical" || vertical;
|
|
87
87
|
const descriptionContent = description && isVertical ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefixCls}-item-description`, children: description }) : null;
|
|
88
|
+
const actionContent = action && (layout === "vertical" || vertical) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${prefixCls}-item-action`, children: action }) : null;
|
|
88
89
|
return wrapSSR(
|
|
89
90
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
90
91
|
AntFormItem,
|
|
91
92
|
{
|
|
92
93
|
layout,
|
|
93
|
-
label:
|
|
94
|
+
label: actionContent || descriptionContent ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
94
95
|
label,
|
|
95
|
-
|
|
96
|
+
actionContent,
|
|
97
|
+
descriptionContent
|
|
96
98
|
] }) : label,
|
|
97
99
|
tooltip,
|
|
98
100
|
required: (0, import_lodash.isPlainObject)(children) && ((_a = children.type) == null ? void 0 : _a.__ANT_SWITCH) ? true : void 0,
|
|
99
101
|
prefixCls: customizePrefixCls,
|
|
100
102
|
className: formItemCls,
|
|
101
103
|
...restProps,
|
|
102
|
-
children
|
|
103
|
-
descriptionContent,
|
|
104
|
-
children
|
|
105
|
-
] })
|
|
104
|
+
children
|
|
106
105
|
}
|
|
107
106
|
)
|
|
108
107
|
);
|
package/lib/form/style/index.js
CHANGED
|
@@ -28,32 +28,37 @@ var genFormStyle = (token) => {
|
|
|
28
28
|
const { componentCls, calc } = token;
|
|
29
29
|
return {
|
|
30
30
|
[componentCls]: {
|
|
31
|
-
|
|
31
|
+
// extra style
|
|
32
|
+
[`${componentCls}-item-explain, ${componentCls}-item-extra`]: {
|
|
32
33
|
paddingTop: token.paddingXXS,
|
|
33
34
|
fontSize: token.fontSizeSM
|
|
35
|
+
},
|
|
36
|
+
[`${componentCls}-item-explain + ${componentCls}-item-extra`]: {
|
|
37
|
+
paddingTop: 0
|
|
34
38
|
}
|
|
35
39
|
},
|
|
40
|
+
// vertical layout style
|
|
36
41
|
[`${componentCls}${componentCls}-vertical`]: {
|
|
37
42
|
[`${componentCls}-item:not(${componentCls}-item-horizontal)`]: {
|
|
38
|
-
|
|
39
|
-
width: "100%",
|
|
40
|
-
[`${componentCls}-item-action`]: {
|
|
41
|
-
position: "absolute",
|
|
42
|
-
right: 0
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
[`${componentCls}-item-has-description`]: {
|
|
43
|
+
// description style
|
|
47
44
|
[`${componentCls}-item-control-input`]: {
|
|
48
45
|
minHeight: "auto"
|
|
49
46
|
},
|
|
50
47
|
[`${componentCls}-item-label`]: {
|
|
51
|
-
paddingBottom: token.paddingXXS
|
|
48
|
+
paddingBottom: calc(token.paddingXXS).add(2).equal()
|
|
52
49
|
},
|
|
53
50
|
[`${componentCls}-item-description`]: {
|
|
54
|
-
|
|
51
|
+
paddingTop: token.paddingXXS,
|
|
55
52
|
fontSize: token.fontSizeSM,
|
|
56
53
|
color: token.colorTextDescription
|
|
54
|
+
},
|
|
55
|
+
// action style
|
|
56
|
+
[`${componentCls}-item-label > label`]: {
|
|
57
|
+
width: "100%",
|
|
58
|
+
[`${componentCls}-item-action`]: {
|
|
59
|
+
position: "absolute",
|
|
60
|
+
right: 0
|
|
61
|
+
}
|
|
57
62
|
}
|
|
58
63
|
}
|
|
59
64
|
}
|
package/lib/input/Input.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { InputProps as AntInputProps, InputRef } from 'antd';
|
|
3
|
+
import type { ShowCountFormatter } from 'rc-input/es/interface';
|
|
3
4
|
export * from 'antd/es/input/Input';
|
|
4
5
|
export interface InputLocale {
|
|
5
6
|
placeholder?: string;
|
|
@@ -7,5 +8,6 @@ export interface InputLocale {
|
|
|
7
8
|
export interface InputProps extends AntInputProps {
|
|
8
9
|
locale?: InputLocale;
|
|
9
10
|
}
|
|
11
|
+
export declare const showCountFormatter: ShowCountFormatter;
|
|
10
12
|
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<InputRef>>;
|
|
11
13
|
export default Input;
|
package/lib/input/Input.js
CHANGED
|
@@ -30,31 +30,54 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/input/Input.tsx
|
|
31
31
|
var Input_exports = {};
|
|
32
32
|
__export(Input_exports, {
|
|
33
|
-
default: () => Input_default
|
|
33
|
+
default: () => Input_default,
|
|
34
|
+
showCountFormatter: () => showCountFormatter
|
|
34
35
|
});
|
|
35
36
|
module.exports = __toCommonJS(Input_exports);
|
|
36
37
|
var import_react = require("react");
|
|
37
38
|
var import_antd = require("antd");
|
|
38
39
|
var import_config_provider = __toESM(require("../config-provider"));
|
|
39
40
|
var import_en_US = __toESM(require("../locale/en-US"));
|
|
41
|
+
var import_style = __toESM(require("./style"));
|
|
40
42
|
__reExport(Input_exports, require("antd/es/input/Input"), module.exports);
|
|
41
43
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
var showCountFormatter = ({ count, maxLength }) => {
|
|
45
|
+
return `${count}/${maxLength}`;
|
|
46
|
+
};
|
|
47
|
+
var Input = (0, import_react.forwardRef)(
|
|
48
|
+
({ prefixCls: customizePrefixCls, locale: customLocale, showCount, ...restProps }, ref) => {
|
|
49
|
+
var _a, _b;
|
|
50
|
+
const { getPrefixCls, locale: contextLocale } = (0, import_react.useContext)(
|
|
51
|
+
import_config_provider.default.ConfigContext
|
|
52
|
+
);
|
|
53
|
+
const inputLocale = {
|
|
54
|
+
placeholder: ((_a = contextLocale == null ? void 0 : contextLocale.global) == null ? void 0 : _a.inputPlaceholder) || ((_b = import_en_US.default.global) == null ? void 0 : _b.inputPlaceholder),
|
|
55
|
+
...import_en_US.default.Input,
|
|
56
|
+
...contextLocale == null ? void 0 : contextLocale.Input,
|
|
57
|
+
...customLocale
|
|
58
|
+
};
|
|
59
|
+
const prefixCls = getPrefixCls("input", customizePrefixCls);
|
|
60
|
+
const { wrapSSR } = (0, import_style.default)(prefixCls);
|
|
61
|
+
return wrapSSR(
|
|
62
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
63
|
+
import_antd.Input,
|
|
64
|
+
{
|
|
65
|
+
ref,
|
|
66
|
+
prefixCls: customizePrefixCls,
|
|
67
|
+
placeholder: inputLocale.placeholder,
|
|
68
|
+
showCount: showCount === true ? { formatter: showCountFormatter } : showCount,
|
|
69
|
+
...restProps
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
);
|
|
53
75
|
if (process.env.NODE_ENV !== "production") {
|
|
54
76
|
Input.displayName = "Input";
|
|
55
77
|
}
|
|
56
78
|
var Input_default = Input;
|
|
57
79
|
// Annotate the CommonJS export names for ESM import in node:
|
|
58
80
|
0 && (module.exports = {
|
|
81
|
+
showCountFormatter,
|
|
59
82
|
...require("antd/es/input/Input")
|
|
60
83
|
});
|
package/lib/input/Password.js
CHANGED
|
@@ -37,19 +37,36 @@ var import_react = require("react");
|
|
|
37
37
|
var import_antd = require("antd");
|
|
38
38
|
var import_config_provider = __toESM(require("../config-provider"));
|
|
39
39
|
var import_en_US = __toESM(require("../locale/en-US"));
|
|
40
|
+
var import_Input = require("./Input");
|
|
41
|
+
var import_style = __toESM(require("./style"));
|
|
40
42
|
__reExport(Password_exports, require("antd/es/input/Password"), module.exports);
|
|
41
43
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
44
|
var Password = (0, import_react.forwardRef)(
|
|
43
|
-
({ locale: customLocale, ...restProps }, ref) => {
|
|
45
|
+
({ prefixCls: customizePrefixCls, locale: customLocale, showCount, ...restProps }, ref) => {
|
|
44
46
|
var _a, _b;
|
|
45
|
-
const { locale: contextLocale } = (0, import_react.useContext)(
|
|
47
|
+
const { getPrefixCls, locale: contextLocale } = (0, import_react.useContext)(
|
|
48
|
+
import_config_provider.default.ConfigContext
|
|
49
|
+
);
|
|
50
|
+
const prefixCls = getPrefixCls("input", customizePrefixCls);
|
|
51
|
+
const { wrapSSR } = (0, import_style.default)(prefixCls);
|
|
46
52
|
const inputLocale = {
|
|
47
53
|
placeholder: ((_a = contextLocale == null ? void 0 : contextLocale.global) == null ? void 0 : _a.inputPlaceholder) || ((_b = import_en_US.default.global) == null ? void 0 : _b.inputPlaceholder),
|
|
48
54
|
...import_en_US.default.Input,
|
|
49
55
|
...contextLocale == null ? void 0 : contextLocale.Input,
|
|
50
56
|
...customLocale
|
|
51
57
|
};
|
|
52
|
-
return
|
|
58
|
+
return wrapSSR(
|
|
59
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
60
|
+
import_antd.Input.Password,
|
|
61
|
+
{
|
|
62
|
+
ref,
|
|
63
|
+
prefixCls: customizePrefixCls,
|
|
64
|
+
placeholder: inputLocale.placeholder,
|
|
65
|
+
showCount: showCount === true ? { formatter: import_Input.showCountFormatter } : showCount,
|
|
66
|
+
...restProps
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
);
|
|
53
70
|
}
|
|
54
71
|
);
|
|
55
72
|
if (process.env.NODE_ENV !== "production") {
|
package/lib/input/Search.js
CHANGED
|
@@ -37,19 +37,38 @@ var import_react = require("react");
|
|
|
37
37
|
var import_antd = require("antd");
|
|
38
38
|
var import_config_provider = __toESM(require("../config-provider"));
|
|
39
39
|
var import_en_US = __toESM(require("../locale/en-US"));
|
|
40
|
+
var import_Input = require("./Input");
|
|
41
|
+
var import_style = __toESM(require("./style"));
|
|
40
42
|
__reExport(Search_exports, require("antd/es/input/Search"), module.exports);
|
|
41
43
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
|
-
var Search = (0, import_react.forwardRef)(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
var Search = (0, import_react.forwardRef)(
|
|
45
|
+
({ prefixCls: customizePrefixCls, locale: customLocale, showCount, ...restProps }, ref) => {
|
|
46
|
+
var _a, _b;
|
|
47
|
+
const { getPrefixCls, locale: contextLocale } = (0, import_react.useContext)(
|
|
48
|
+
import_config_provider.default.ConfigContext
|
|
49
|
+
);
|
|
50
|
+
const prefixCls = getPrefixCls("input", customizePrefixCls);
|
|
51
|
+
const { wrapSSR } = (0, import_style.default)(prefixCls);
|
|
52
|
+
const inputLocale = {
|
|
53
|
+
placeholder: ((_a = contextLocale == null ? void 0 : contextLocale.global) == null ? void 0 : _a.inputPlaceholder) || ((_b = import_en_US.default.global) == null ? void 0 : _b.inputPlaceholder),
|
|
54
|
+
...import_en_US.default.Input,
|
|
55
|
+
...contextLocale == null ? void 0 : contextLocale.Input,
|
|
56
|
+
...customLocale
|
|
57
|
+
};
|
|
58
|
+
return wrapSSR(
|
|
59
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
60
|
+
import_antd.Input.Search,
|
|
61
|
+
{
|
|
62
|
+
ref,
|
|
63
|
+
prefixCls: customizePrefixCls,
|
|
64
|
+
placeholder: inputLocale.placeholder,
|
|
65
|
+
showCount: showCount === true ? { formatter: import_Input.showCountFormatter } : showCount,
|
|
66
|
+
...restProps
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
);
|
|
53
72
|
if (process.env.NODE_ENV !== "production") {
|
|
54
73
|
Search.displayName = "Search";
|
|
55
74
|
}
|