Skip to content

Commit fc7f7c0

Browse files
authored
feat(ConfigProvider): new components (#574)
* feat(ConfigProvider): new components * fix(site): fix md rendering errors * test: update snapshots * fix: fix builde error
1 parent 20bf886 commit fc7f7c0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+4253
-352
lines changed

site/mobile/mobile.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,5 +292,10 @@ export default {
292292
name: 'color-picker',
293293
component: () => import('tdesign-mobile-react/color-picker/_example/index.tsx'),
294294
},
295+
{
296+
title: 'ConfigProvider 全局特性配置',
297+
name: 'config-provider',
298+
component: () => import('tdesign-mobile-react/config-provider/_example/index.tsx'),
299+
},
295300
],
296301
};

site/plugin-tdoc/md-to-react.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ function customRender({ source, file, md }) {
190190
let [demoMd = '', apiMd = ''] = content.split(pageData.apiFlag);
191191

192192
// fix table | render error
193-
demoMd = demoMd.replace(/`([^`]+)`/g, (str, codeStr) => {
193+
demoMd = demoMd.replace(/`([^`\r\n]+)`/g, (str, codeStr) => {
194194
codeStr = codeStr.replace(/"/g, "'");
195195
return `<td-code text="${codeStr}"></td-code>`;
196196
});

site/vite.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export default ({ mode }) =>
2525
'@doc': path.resolve(__dirname, './doc'),
2626
'@components': path.resolve(__dirname, './src/components'),
2727
'@common': path.resolve(__dirname, '../src/_common'),
28+
'tdesign-mobile-react/es': path.resolve(__dirname, '../src'),
2829
'tdesign-mobile-react': path.resolve(__dirname, '../src'),
2930
'@test/utils': path.resolve(__dirname, '../test/utils'),
3031
},

site/web/site.config.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@ export default {
2424
},
2525
],
2626
},
27+
{
28+
title: '全局配置',
29+
type: 'component',
30+
children: [
31+
{
32+
title: '全局特性配置',
33+
name: 'button',
34+
path: '/mobile-react/components/config-provider',
35+
component: () => import('tdesign-mobile-react/config-provider/config-provider.md'),
36+
},
37+
],
38+
},
2739
{
2840
title: '基础组件',
2941
type: 'component', // 组件文档

src/_util/useConfig.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/back-top/Backtop.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import smoothscroll from 'smoothscroll-polyfill';
55
import { isString } from 'lodash-es';
66
import { Icon } from 'tdesign-icons-react';
77
import withNativeProps, { NativeProps } from '../_util/withNativeProps';
8-
import useConfig from '../_util/useConfig';
8+
import useConfig from '../hooks/useConfig';
99
import { TdBackTopProps } from './type';
1010

1111
export type ThemeList = 'round' | 'half-round' | 'round-dark' | 'half-round-dark';

src/button/Button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { forwardRef } from 'react';
22
import classnames from 'classnames';
33
import TLoading from '../loading';
4-
import useConfig from '../_util/useConfig';
4+
import useConfig from '../hooks/useConfig';
55
import parseTNode from '../_util/parseTNode';
66
import { TdButtonProps } from './type';
77
import { buttonDefaultProps } from './defaultProps';

src/cell/Cell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { cellDefaultProps } from './defaultProps';
99
import withNativeProps, { NativeProps } from '../_util/withNativeProps';
1010
import useDefaultProps from '../hooks/useDefaultProps';
1111
import useHover from '../hooks/useHover';
12-
import useConfig from '../_util/useConfig';
12+
import useConfig from '../hooks/useConfig';
1313

1414
export interface CellProps extends TdCellProps, NativeProps {}
1515

src/cell/CellGroup.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useMemo } from 'react';
22
import classnames from 'classnames';
3-
import useConfig from '../_util/useConfig';
3+
import useConfig from '../hooks/useConfig';
44
import { TdCellGroupProps } from './type';
55
import { cellGroupDefaultProps } from './defaultProps';
66
import withNativeProps, { NativeProps } from '../_util/withNativeProps';

0 commit comments

Comments
 (0)