@oceanbase/design 1.0.0-alpha.21 → 1.0.0-alpha.22
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/config-provider/index.js +13 -6
- package/es/descriptions/hooks/useItems.d.ts +8 -8
- package/es/form/FormItem.d.ts +1 -1
- package/es/spin/style/index.js +8 -3
- package/es/table/index.d.ts +2 -2
- package/lib/config-provider/index.js +18 -10
- package/lib/descriptions/hooks/useItems.d.ts +8 -8
- package/lib/form/FormItem.d.ts +1 -1
- package/lib/spin/style/index.js +7 -1
- package/lib/table/index.d.ts +2 -2
- package/package.json +2 -2
|
@@ -140,6 +140,17 @@ var ConfigProvider = function ConfigProvider(_ref5) {
|
|
|
140
140
|
var parentStyleContext = React.useContext(StyleContext);
|
|
141
141
|
var mergedStyleProviderProps = merge({}, parentStyleContext, styleProviderProps);
|
|
142
142
|
var mergedLocale = merge({}, parentContext.locale, locale);
|
|
143
|
+
var resolvedAntTheme = merge({}, mergedTheme, getLocaleFontSizeThemePatch(mergedLocale, mergedTheme, fontSize), {
|
|
144
|
+
token: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, getLocaleTokenValue(mergedTheme.token || {}, mergedLocale, 'fontFamily', fontFamily, fontFamilyEn)), getLocaleTokenValue(mergedTheme.token || {}, mergedLocale, 'fontWeightWeak', fontWeightWeak, fontWeightWeakEn)), getLocaleTokenValue(mergedTheme.token || {}, mergedLocale, 'fontWeight', fontWeight, fontWeightEn)), getLocaleTokenValue(mergedTheme.token || {}, mergedLocale, 'fontWeightStrong', fontWeightStrong, fontWeightStrongEn))
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
// cssVar 模式下 App 必须有真实 DOM 节点挂载 cssVarCls,component={false} 会导致变量作用域丢失
|
|
148
|
+
var cssVarEnabled = Boolean(resolvedAntTheme === null || resolvedAntTheme === void 0 ? void 0 : resolvedAntTheme.cssVar);
|
|
149
|
+
var resolvedAppProps = merge({}, cssVarEnabled ? {
|
|
150
|
+
component: 'div'
|
|
151
|
+
} : {
|
|
152
|
+
component: false
|
|
153
|
+
}, appProps);
|
|
143
154
|
return /*#__PURE__*/_jsx(AntConfigProvider, _objectSpread(_objectSpread({
|
|
144
155
|
locale: mergedLocale,
|
|
145
156
|
wave: merge({}, {
|
|
@@ -181,9 +192,7 @@ var ConfigProvider = function ConfigProvider(_ref5) {
|
|
|
181
192
|
}
|
|
182
193
|
}, parentContext.table, table),
|
|
183
194
|
tabs: merge({}, parentContext.tabs, tabs),
|
|
184
|
-
theme:
|
|
185
|
-
token: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, getLocaleTokenValue(mergedTheme.token || {}, mergedLocale, 'fontFamily', fontFamily, fontFamilyEn)), getLocaleTokenValue(mergedTheme.token || {}, mergedLocale, 'fontWeightWeak', fontWeightWeak, fontWeightWeakEn)), getLocaleTokenValue(mergedTheme.token || {}, mergedLocale, 'fontWeight', fontWeight, fontWeightEn)), getLocaleTokenValue(mergedTheme.token || {}, mergedLocale, 'fontWeightStrong', fontWeightStrong, fontWeightStrongEn))
|
|
186
|
-
}),
|
|
195
|
+
theme: resolvedAntTheme,
|
|
187
196
|
renderEmpty: parentContext.renderEmpty || function (componentName) {
|
|
188
197
|
return /*#__PURE__*/_jsx(DefaultRenderEmpty, {
|
|
189
198
|
componentName: componentName
|
|
@@ -201,9 +210,7 @@ var ConfigProvider = function ConfigProvider(_ref5) {
|
|
|
201
210
|
children: [/*#__PURE__*/_jsx(CssVariablesStyle, {}), /*#__PURE__*/_jsx(GlobalStyle, {
|
|
202
211
|
prefixCls: restProps.prefixCls,
|
|
203
212
|
iconPrefixCls: restProps.iconPrefixCls
|
|
204
|
-
}), /*#__PURE__*/_jsxs(App, _objectSpread(_objectSpread({
|
|
205
|
-
component: false
|
|
206
|
-
}, appProps), {}, {
|
|
213
|
+
}), /*#__PURE__*/_jsxs(App, _objectSpread(_objectSpread({}, resolvedAppProps), {}, {
|
|
207
214
|
children: [children, parentExtendedContext.injectStaticFunction && /*#__PURE__*/_jsx(StaticFunction, {})]
|
|
208
215
|
}))]
|
|
209
216
|
}))
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { DescriptionsItemType } from '..';
|
|
3
3
|
export default function useItems(items?: DescriptionsItemType[], children?: React.ReactNode, bordered?: boolean): {
|
|
4
|
-
children: string | number | boolean | import("@emotion/react/jsx-runtime").JSX.Element
|
|
4
|
+
children: string | number | boolean | Iterable<React.ReactNode> | import("@emotion/react/jsx-runtime").JSX.Element;
|
|
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
|
+
classNames?: Partial<Record<"label" | "content", string>>;
|
|
17
|
+
styles?: Partial<Record<"label" | "content", React.CSSProperties>>;
|
|
16
18
|
className?: string;
|
|
17
|
-
classNames?: Partial<Record<"content" | "label", string>>;
|
|
18
|
-
styles?: Partial<Record<"content" | "label", React.CSSProperties>>;
|
|
19
19
|
labelStyle?: React.CSSProperties;
|
|
20
20
|
contentStyle?: React.CSSProperties;
|
|
21
21
|
}[];
|
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
|
};
|
package/es/spin/style/index.js
CHANGED
|
@@ -10,10 +10,15 @@ var genSizeStyle = function genSizeStyle(spinDotSize, token) {
|
|
|
10
10
|
colorText = token.colorText;
|
|
11
11
|
var spinDotWidth = spinDotSize;
|
|
12
12
|
var spinDotHight = spinDotWidth;
|
|
13
|
-
return _defineProperty({}, "&".concat(componentCls, "-oceanbase"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-dot"), {
|
|
13
|
+
return _defineProperty({}, "&".concat(componentCls, "-oceanbase"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-dot"), _defineProperty({
|
|
14
14
|
width: spinDotWidth,
|
|
15
|
-
height: spinDotHight
|
|
16
|
-
|
|
15
|
+
height: spinDotHight,
|
|
16
|
+
overflow: 'hidden',
|
|
17
|
+
lineHeight: 0
|
|
18
|
+
}, "> div", {
|
|
19
|
+
width: '100%',
|
|
20
|
+
height: '100%'
|
|
21
|
+
})), "".concat(componentCls, "-text"), {
|
|
17
22
|
width: spinDotWidth,
|
|
18
23
|
color: colorText
|
|
19
24
|
}));
|
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, rootCls?: string) => readonly [(node: ReactElement<any, string | React.JSXElementConstructor<any>>) => ReactElement<any, string | React.JSXElementConstructor<any>>, string, string];
|
|
45
45
|
useDefaultPagination: (pagination?: false | import("antd").TablePaginationConfig) => false | import("antd").TablePaginationConfig;
|
|
@@ -198,6 +198,22 @@ const ConfigProvider = ({
|
|
|
198
198
|
const parentStyleContext = _react.default.useContext(_StyleContext.default);
|
|
199
199
|
const mergedStyleProviderProps = (0, _lodash.merge)({}, parentStyleContext, styleProviderProps);
|
|
200
200
|
const mergedLocale = (0, _lodash.merge)({}, parentContext.locale, locale);
|
|
201
|
+
const resolvedAntTheme = (0, _lodash.merge)({}, mergedTheme, getLocaleFontSizeThemePatch(mergedLocale, mergedTheme, fontSize), {
|
|
202
|
+
token: {
|
|
203
|
+
...getLocaleTokenValue(mergedTheme.token || {}, mergedLocale, 'fontFamily', fontFamily, _default2.fontFamilyEn),
|
|
204
|
+
...getLocaleTokenValue(mergedTheme.token || {}, mergedLocale, 'fontWeightWeak', fontWeightWeak, _default2.fontWeightWeakEn),
|
|
205
|
+
...getLocaleTokenValue(mergedTheme.token || {}, mergedLocale, 'fontWeight', fontWeight, _default2.fontWeightEn),
|
|
206
|
+
...getLocaleTokenValue(mergedTheme.token || {}, mergedLocale, 'fontWeightStrong', fontWeightStrong, _default2.fontWeightStrongEn)
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
// cssVar 模式下 App 必须有真实 DOM 节点挂载 cssVarCls,component={false} 会导致变量作用域丢失
|
|
211
|
+
const cssVarEnabled = Boolean(resolvedAntTheme?.cssVar);
|
|
212
|
+
const resolvedAppProps = (0, _lodash.merge)({}, cssVarEnabled ? {
|
|
213
|
+
component: 'div'
|
|
214
|
+
} : {
|
|
215
|
+
component: false
|
|
216
|
+
}, appProps);
|
|
201
217
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.ConfigProvider, {
|
|
202
218
|
locale: mergedLocale,
|
|
203
219
|
wave: (0, _lodash.merge)({}, {
|
|
@@ -234,14 +250,7 @@ const ConfigProvider = ({
|
|
|
234
250
|
}
|
|
235
251
|
}, parentContext.table, table),
|
|
236
252
|
tabs: (0, _lodash.merge)({}, parentContext.tabs, tabs),
|
|
237
|
-
theme:
|
|
238
|
-
token: {
|
|
239
|
-
...getLocaleTokenValue(mergedTheme.token || {}, mergedLocale, 'fontFamily', fontFamily, _default2.fontFamilyEn),
|
|
240
|
-
...getLocaleTokenValue(mergedTheme.token || {}, mergedLocale, 'fontWeightWeak', fontWeightWeak, _default2.fontWeightWeakEn),
|
|
241
|
-
...getLocaleTokenValue(mergedTheme.token || {}, mergedLocale, 'fontWeight', fontWeight, _default2.fontWeightEn),
|
|
242
|
-
...getLocaleTokenValue(mergedTheme.token || {}, mergedLocale, 'fontWeightStrong', fontWeightStrong, _default2.fontWeightStrongEn)
|
|
243
|
-
}
|
|
244
|
-
}),
|
|
253
|
+
theme: resolvedAntTheme,
|
|
245
254
|
renderEmpty: parentContext.renderEmpty || (componentName => /*#__PURE__*/(0, _jsxRuntime.jsx)(_DefaultRenderEmpty.default, {
|
|
246
255
|
componentName: componentName
|
|
247
256
|
})),
|
|
@@ -259,8 +268,7 @@ const ConfigProvider = ({
|
|
|
259
268
|
prefixCls: restProps.prefixCls,
|
|
260
269
|
iconPrefixCls: restProps.iconPrefixCls
|
|
261
270
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_app.default, {
|
|
262
|
-
|
|
263
|
-
...appProps,
|
|
271
|
+
...resolvedAppProps,
|
|
264
272
|
children: [children, parentExtendedContext.injectStaticFunction && /*#__PURE__*/(0, _jsxRuntime.jsx)(_staticFunction.default, {})]
|
|
265
273
|
})]
|
|
266
274
|
})
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { DescriptionsItemType } from '..';
|
|
3
3
|
export default function useItems(items?: DescriptionsItemType[], children?: React.ReactNode, bordered?: boolean): {
|
|
4
|
-
children: string | number | boolean | import("@emotion/react/jsx-runtime").JSX.Element
|
|
4
|
+
children: string | number | boolean | Iterable<React.ReactNode> | import("@emotion/react/jsx-runtime").JSX.Element;
|
|
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
|
+
classNames?: Partial<Record<"label" | "content", string>>;
|
|
17
|
+
styles?: Partial<Record<"label" | "content", React.CSSProperties>>;
|
|
16
18
|
className?: string;
|
|
17
|
-
classNames?: Partial<Record<"content" | "label", string>>;
|
|
18
|
-
styles?: Partial<Record<"content" | "label", React.CSSProperties>>;
|
|
19
19
|
labelStyle?: React.CSSProperties;
|
|
20
20
|
contentStyle?: React.CSSProperties;
|
|
21
21
|
}[];
|
package/lib/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
|
};
|
package/lib/spin/style/index.js
CHANGED
|
@@ -17,7 +17,13 @@ const genSizeStyle = (spinDotSize, token) => {
|
|
|
17
17
|
[`&${componentCls}-oceanbase`]: {
|
|
18
18
|
[`${componentCls}-dot`]: {
|
|
19
19
|
width: spinDotWidth,
|
|
20
|
-
height: spinDotHight
|
|
20
|
+
height: spinDotHight,
|
|
21
|
+
overflow: 'hidden',
|
|
22
|
+
lineHeight: 0,
|
|
23
|
+
[`> div`]: {
|
|
24
|
+
width: '100%',
|
|
25
|
+
height: '100%'
|
|
26
|
+
}
|
|
21
27
|
},
|
|
22
28
|
[`${componentCls}-text`]: {
|
|
23
29
|
width: spinDotWidth,
|
package/lib/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, rootCls?: string) => readonly [(node: ReactElement<any, string | React.JSXElementConstructor<any>>) => ReactElement<any, string | React.JSXElementConstructor<any>>, string, string];
|
|
45
45
|
useDefaultPagination: (pagination?: false | import("antd").TablePaginationConfig) => false | import("antd").TablePaginationConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oceanbase/design",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.22",
|
|
4
4
|
"description": "The Design System of OceanBase",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"oceanbase",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"react": ">=16.9.0",
|
|
67
67
|
"react-dom": ">=16.9.0"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "5eca952eb89ecccc408d803fd6ab84cc4a878eef"
|
|
70
70
|
}
|