@oceanbase/design 1.0.0-alpha.5 → 1.0.0-alpha.7
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/alert/index.js +1 -4
- package/es/alert/style/index.js +17 -19
- package/es/app/style/index.js +3 -6
- package/es/button/style/index.js +10 -2
- package/es/config-provider/index.d.ts +2 -1
- package/es/config-provider/index.js +43 -16
- 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/style/index.js +3 -1
- package/es/index.d.ts +0 -1
- package/es/index.js +0 -1
- 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 +8 -0
- package/es/style/global.js +118 -0
- package/es/style/reset.css +2 -1
- package/es/table/index.d.ts +2 -2
- package/es/table/style/index.js +5 -1
- package/es/theme/compact.d.ts +1 -1
- package/es/theme/compact.js +2 -6
- package/es/theme/default.d.ts +1 -1
- package/es/theme/default.js +29 -10
- package/es/typography/style/index.js +3 -0
- package/lib/alert/index.js +1 -3
- package/lib/alert/style/index.js +15 -16
- package/lib/app/style/index.js +2 -4
- package/lib/button/style/index.js +8 -2
- package/lib/config-provider/index.d.ts +2 -1
- package/lib/config-provider/index.js +60 -12
- 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/style/index.js +4 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -1
- 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 +8 -0
- package/lib/style/global.js +168 -0
- package/lib/style/reset.css +2 -1
- package/lib/table/index.d.ts +2 -2
- package/lib/table/style/index.js +5 -1
- package/lib/theme/compact.d.ts +1 -1
- package/lib/theme/compact.js +1 -5
- package/lib/theme/default.d.ts +1 -1
- package/lib/theme/default.js +29 -10
- 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/es/global.css +0 -48
- package/lib/fonts/Inter.woff2 +0 -0
- package/lib/global.css +0 -48
|
@@ -45,7 +45,9 @@ var import_static_function = __toESM(require("../static-function"));
|
|
|
45
45
|
var import_theme = __toESM(require("../theme"));
|
|
46
46
|
var import_default = __toESM(require("../theme/default"));
|
|
47
47
|
var import_dark = __toESM(require("../theme/dark"));
|
|
48
|
+
var import_compact = __toESM(require("../theme/compact"));
|
|
48
49
|
var import_DefaultRenderEmpty = __toESM(require("./DefaultRenderEmpty"));
|
|
50
|
+
var import_global = __toESM(require("../style/global"));
|
|
49
51
|
__reExport(config_provider_exports, require("./navigate"), module.exports);
|
|
50
52
|
__reExport(config_provider_exports, require("antd/es/config-provider/context"), module.exports);
|
|
51
53
|
__reExport(config_provider_exports, require("antd/es/config-provider/SizeContext"), module.exports);
|
|
@@ -57,8 +59,8 @@ var ExtendedConfigContext = import_react.default.createContext({
|
|
|
57
59
|
hideOnSinglePage: false,
|
|
58
60
|
injectStaticFunction: true
|
|
59
61
|
});
|
|
60
|
-
var getLocaleTokenValue = (locale, tokenKey, tokenValue, tokenValueEn) => {
|
|
61
|
-
return tokenValue !==
|
|
62
|
+
var getLocaleTokenValue = (mergedThemeToken, locale, tokenKey, tokenValue, tokenValueEn) => {
|
|
63
|
+
return tokenValue !== mergedThemeToken[tokenKey] ? { [tokenKey]: tokenValue } : ["en", "en-gb"].includes(locale.locale) ? { [tokenKey]: tokenValueEn } : {};
|
|
62
64
|
};
|
|
63
65
|
var ConfigProvider = ({
|
|
64
66
|
children,
|
|
@@ -79,13 +81,43 @@ var ConfigProvider = ({
|
|
|
79
81
|
var _a, _b, _c, _d;
|
|
80
82
|
const parentContext = import_react.default.useContext(import_antd.ConfigProvider.ConfigContext);
|
|
81
83
|
const parentExtendedContext = import_react.default.useContext(ExtendedConfigContext);
|
|
82
|
-
const { isDark,
|
|
83
|
-
const
|
|
84
|
+
const { isAliyun, isDark, isCompact } = (0, import_lodash.merge)({}, parentContext.theme, theme);
|
|
85
|
+
const aliyunThemeConfig = isAliyun ? import_aliyun_theme.default : void 0;
|
|
86
|
+
const darkThemeConfig = isDark && !isAliyun ? isCompact ? import_dark.default : {
|
|
87
|
+
...import_dark.default,
|
|
88
|
+
token: {
|
|
89
|
+
...import_dark.default.token,
|
|
90
|
+
...Object.fromEntries(
|
|
91
|
+
Object.entries(import_default.default.token).filter(
|
|
92
|
+
([key]) => {
|
|
93
|
+
var _a2;
|
|
94
|
+
return !((_a2 = key == null ? void 0 : key.toLowerCase()) == null ? void 0 : _a2.startsWith("color"));
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
)
|
|
98
|
+
}
|
|
99
|
+
} : void 0;
|
|
100
|
+
const compactThemeConfig = isCompact && !isAliyun ? isDark ? import_compact.default : {
|
|
101
|
+
...import_compact.default,
|
|
102
|
+
token: {
|
|
103
|
+
...import_compact.default.token,
|
|
104
|
+
...Object.fromEntries(
|
|
105
|
+
Object.entries(import_default.default.token).filter(
|
|
106
|
+
([key]) => {
|
|
107
|
+
var _a2;
|
|
108
|
+
return ((_a2 = key == null ? void 0 : key.toLowerCase()) == null ? void 0 : _a2.startsWith("color")) && !["colorBgBase", "colorTextBase"].includes(key);
|
|
109
|
+
}
|
|
110
|
+
)
|
|
111
|
+
)
|
|
112
|
+
}
|
|
113
|
+
} : void 0;
|
|
84
114
|
const mergedTheme = (0, import_lodash.merge)(
|
|
85
115
|
{},
|
|
86
|
-
|
|
116
|
+
isAliyun ? {} : isDark || isCompact ? import_theme.default.defaultSeed : import_default.default,
|
|
87
117
|
parentContext.theme,
|
|
88
|
-
|
|
118
|
+
aliyunThemeConfig,
|
|
119
|
+
darkThemeConfig,
|
|
120
|
+
compactThemeConfig,
|
|
89
121
|
theme
|
|
90
122
|
);
|
|
91
123
|
const { token } = import_theme.default.useToken();
|
|
@@ -154,9 +186,22 @@ var ConfigProvider = ({
|
|
|
154
186
|
tabs: (0, import_lodash.merge)({}, parentContext.tabs, tabs),
|
|
155
187
|
theme: (0, import_lodash.merge)({}, mergedTheme, {
|
|
156
188
|
token: {
|
|
157
|
-
...getLocaleTokenValue(mergedLocale, "fontFamily", fontFamily, import_default.fontFamilyEn),
|
|
158
|
-
...getLocaleTokenValue(mergedLocale, "fontWeight", fontWeight, import_default.fontWeightEn),
|
|
159
189
|
...getLocaleTokenValue(
|
|
190
|
+
mergedTheme.token || {},
|
|
191
|
+
mergedLocale,
|
|
192
|
+
"fontFamily",
|
|
193
|
+
fontFamily,
|
|
194
|
+
import_default.fontFamilyEn
|
|
195
|
+
),
|
|
196
|
+
...getLocaleTokenValue(
|
|
197
|
+
mergedTheme.token || {},
|
|
198
|
+
mergedLocale,
|
|
199
|
+
"fontWeight",
|
|
200
|
+
fontWeight,
|
|
201
|
+
import_default.fontWeightEn
|
|
202
|
+
),
|
|
203
|
+
...getLocaleTokenValue(
|
|
204
|
+
mergedTheme.token || {},
|
|
160
205
|
mergedLocale,
|
|
161
206
|
"fontWeightStrong",
|
|
162
207
|
fontWeightStrong,
|
|
@@ -175,10 +220,13 @@ var ConfigProvider = ({
|
|
|
175
220
|
// inject static function to outermost ConfigProvider only
|
|
176
221
|
injectStaticFunction: false
|
|
177
222
|
},
|
|
178
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
223
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_cssinjs.StyleProvider, { ...mergedStyleProviderProps, children: [
|
|
224
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_global.default, { prefixCls: restProps.prefixCls }),
|
|
225
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_app.default, { component: false, ...appProps, children: [
|
|
226
|
+
children,
|
|
227
|
+
parentExtendedContext.injectStaticFunction && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_static_function.default, {})
|
|
228
|
+
] })
|
|
229
|
+
] })
|
|
182
230
|
}
|
|
183
231
|
)
|
|
184
232
|
}
|
|
@@ -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/style/index.js
CHANGED
|
@@ -28,9 +28,12 @@ var genFormStyle = (token) => {
|
|
|
28
28
|
const { componentCls, calc } = token;
|
|
29
29
|
return {
|
|
30
30
|
[componentCls]: {
|
|
31
|
-
[`${componentCls}-item-extra`]: {
|
|
31
|
+
[`${componentCls}-item-explain, ${componentCls}-item-extra`]: {
|
|
32
32
|
paddingTop: token.paddingXXS,
|
|
33
33
|
fontSize: token.fontSizeSM
|
|
34
|
+
},
|
|
35
|
+
[`${componentCls}-item-explain + ${componentCls}-item-extra`]: {
|
|
36
|
+
paddingTop: 0
|
|
34
37
|
}
|
|
35
38
|
},
|
|
36
39
|
[`${componentCls}${componentCls}-vertical`]: {
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -72,7 +72,6 @@ __export(src_exports, {
|
|
|
72
72
|
version: () => import_package.version
|
|
73
73
|
});
|
|
74
74
|
module.exports = __toCommonJS(src_exports);
|
|
75
|
-
var import_global = require("./global.css");
|
|
76
75
|
__reExport(src_exports, require("antd"), module.exports);
|
|
77
76
|
var import_package = require("../package.json");
|
|
78
77
|
var import_alert = __toESM(require("./alert"));
|
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
|
}
|
package/lib/input/TextArea.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(TextArea_exports, require("antd/es/input/TextArea"), module.exports);
|
|
41
43
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
44
|
var TextArea = (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.TextArea,
|
|
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") {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { FullToken, GenerateStyle } from '../../theme/interface';
|
|
3
|
+
export type InputToken = FullToken<'Input'>;
|
|
4
|
+
export declare const genInputStyle: GenerateStyle<InputToken>;
|
|
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
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/input/style/index.ts
|
|
20
|
+
var style_exports = {};
|
|
21
|
+
__export(style_exports, {
|
|
22
|
+
default: () => style_default,
|
|
23
|
+
genInputStyle: () => genInputStyle
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(style_exports);
|
|
26
|
+
var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
|
|
27
|
+
var genInputStyle = (token) => {
|
|
28
|
+
const { componentCls } = token;
|
|
29
|
+
return {
|
|
30
|
+
[`${componentCls}-affix-wrapper`]: {
|
|
31
|
+
[`${componentCls}-suffix`]: {
|
|
32
|
+
fontSize: token.fontSizeSM
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
var style_default = (prefixCls) => {
|
|
38
|
+
const useStyle = (0, import_genComponentStyleHook.genComponentStyleHook)("Input", (token) => {
|
|
39
|
+
return [genInputStyle(token)];
|
|
40
|
+
});
|
|
41
|
+
return useStyle(prefixCls);
|
|
42
|
+
};
|
|
43
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
+
0 && (module.exports = {
|
|
45
|
+
genInputStyle
|
|
46
|
+
});
|
|
@@ -37,19 +37,34 @@ var import_antd = require("antd");
|
|
|
37
37
|
var import_react = __toESM(require("react"));
|
|
38
38
|
var import_config_provider = __toESM(require("../config-provider"));
|
|
39
39
|
var import_en_US = __toESM(require("../locale/en-US"));
|
|
40
|
+
var import_style = __toESM(require("./style"));
|
|
40
41
|
__reExport(input_number_exports, require("antd/es/input-number"), module.exports);
|
|
41
42
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
43
|
var InternalInputNumber = import_react.default.forwardRef(
|
|
43
|
-
({ locale: customLocale, ...restProps }, ref) => {
|
|
44
|
+
({ prefixCls: customizePrefixCls, locale: customLocale, ...restProps }, ref) => {
|
|
44
45
|
var _a, _b;
|
|
45
|
-
const { locale: contextLocale } = (0, import_react.useContext)(
|
|
46
|
+
const { getPrefixCls, locale: contextLocale } = (0, import_react.useContext)(
|
|
47
|
+
import_config_provider.default.ConfigContext
|
|
48
|
+
);
|
|
49
|
+
const prefixCls = getPrefixCls("input-number", customizePrefixCls);
|
|
50
|
+
const { wrapSSR } = (0, import_style.default)(prefixCls);
|
|
46
51
|
const inputNumberLocale = {
|
|
47
52
|
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
53
|
...import_en_US.default.InputNumber,
|
|
49
54
|
...contextLocale == null ? void 0 : contextLocale.InputNumber,
|
|
50
55
|
...customLocale
|
|
51
56
|
};
|
|
52
|
-
return
|
|
57
|
+
return wrapSSR(
|
|
58
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
59
|
+
import_antd.InputNumber,
|
|
60
|
+
{
|
|
61
|
+
ref,
|
|
62
|
+
prefixCls: customizePrefixCls,
|
|
63
|
+
placeholder: inputNumberLocale.placeholder,
|
|
64
|
+
...restProps
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
);
|
|
53
68
|
}
|
|
54
69
|
);
|
|
55
70
|
var InputNumber = InternalInputNumber;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { FullToken, GenerateStyle } from '../../theme/interface';
|
|
3
|
+
export type InputNumberToken = FullToken<'InputNumber'>;
|
|
4
|
+
export declare const genInputStyle: GenerateStyle<InputNumberToken>;
|
|
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
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/input-number/style/index.ts
|
|
20
|
+
var style_exports = {};
|
|
21
|
+
__export(style_exports, {
|
|
22
|
+
default: () => style_default,
|
|
23
|
+
genInputStyle: () => genInputStyle
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(style_exports);
|
|
26
|
+
var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
|
|
27
|
+
var genInputStyle = (token) => {
|
|
28
|
+
const { antCls, componentCls } = token;
|
|
29
|
+
const selectComponentCls = `${antCls}-select-selector`;
|
|
30
|
+
return {
|
|
31
|
+
[`${componentCls}-group-wrapper`]: {
|
|
32
|
+
[`${componentCls}-group-addon`]: {
|
|
33
|
+
color: token.colorTextTertiary,
|
|
34
|
+
fontSize: token.fontSizeSM,
|
|
35
|
+
[selectComponentCls]: {
|
|
36
|
+
color: token.colorTextTertiary
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
var style_default = (prefixCls) => {
|
|
43
|
+
const useStyle = (0, import_genComponentStyleHook.genComponentStyleHook)("InputNumber", (token) => {
|
|
44
|
+
return [genInputStyle(token)];
|
|
45
|
+
});
|
|
46
|
+
return useStyle(prefixCls);
|
|
47
|
+
};
|
|
48
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
49
|
+
0 && (module.exports = {
|
|
50
|
+
genInputStyle
|
|
51
|
+
});
|
package/lib/locale/ja-JP.js
CHANGED
|
@@ -44,13 +44,13 @@ var ja_JP_default = {
|
|
|
44
44
|
total: "合計 ${total} 件"
|
|
45
45
|
},
|
|
46
46
|
Drawer: {
|
|
47
|
-
okText: "
|
|
47
|
+
okText: "OK",
|
|
48
48
|
cancelText: "キャンセル"
|
|
49
49
|
},
|
|
50
50
|
Table: {
|
|
51
51
|
...import_ja_JP.default.Table,
|
|
52
52
|
batchOperationBar: {
|
|
53
|
-
selected: "
|
|
53
|
+
selected: "選択中",
|
|
54
54
|
object: "件",
|
|
55
55
|
cancel: "キャンセル",
|
|
56
56
|
collapse: "折りたたむ",
|
package/lib/segmented/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type { SegmentedRawOption } from 'rc-segmented';
|
|
|
6
6
|
export * from 'antd/es/segmented';
|
|
7
7
|
type BadgeType = BadgeProps | BadgeProps['count'];
|
|
8
8
|
export type SegmentedLabeledOption = AntSegmentedLabeledOption & {
|
|
9
|
+
icon?: React.ReactNode;
|
|
9
10
|
ellipsis?: EllipsisConfig;
|
|
10
11
|
badge?: BadgeType;
|
|
11
12
|
};
|
package/lib/segmented/index.js
CHANGED
|
@@ -57,11 +57,18 @@ var Segmented = import_react.default.forwardRef(
|
|
|
57
57
|
}, []);
|
|
58
58
|
const newOptions = options == null ? void 0 : options.map((item) => {
|
|
59
59
|
if (typeof item === "object") {
|
|
60
|
-
const {
|
|
60
|
+
const {
|
|
61
|
+
label,
|
|
62
|
+
icon,
|
|
63
|
+
badge,
|
|
64
|
+
ellipsis = { tooltip: true },
|
|
65
|
+
...restItem
|
|
66
|
+
} = item;
|
|
61
67
|
return {
|
|
62
68
|
...restItem,
|
|
63
|
-
label: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd.Flex, {
|
|
64
|
-
|
|
69
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd.Flex, { align: "center", justify: "center", children: [
|
|
70
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${prefixCls}-item-icon`, children: icon }),
|
|
71
|
+
ellipsis ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_typography.default.Text, { ellipsis, children: label }) : label,
|
|
65
72
|
badge && renderBadge(badge)
|
|
66
73
|
] })
|
|
67
74
|
};
|
|
@@ -45,6 +45,7 @@ var genSegmentedStyle = (token) => {
|
|
|
45
45
|
[`>${componentCls}-item`]: {
|
|
46
46
|
[`>${componentCls}-item-label`]: {
|
|
47
47
|
[`${antCls}-badge >${antCls}-badge-count`]: {
|
|
48
|
+
marginInlineStart: 4,
|
|
48
49
|
backgroundColor: colorFillSecondary,
|
|
49
50
|
color: "inherit",
|
|
50
51
|
boxShadow: "none"
|