Skip to content

Commit

Permalink
Merge pull request #888 from oceanbase/dengfuping-dev
Browse files Browse the repository at this point in the history
fix(site): show code and debug for demo should work
  • Loading branch information
dengfuping authored Dec 13, 2024
2 parents 0963c1f + adddcfa commit 50361ac
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 39 deletions.
7 changes: 4 additions & 3 deletions .dumi/theme/builtins/DemoWrapper/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,14 @@ const DemoWrapper: typeof DumiDemoGrid = ({ items }) => {
(acc, item) => {
const { previewerProps } = item;
const { debug } = previewerProps;
console.log(debug);

if (debug && !showDebug) return acc;

return acc.concat({
...item,
previewerProps: {
...previewerProps,
expand: expandAll,
defaultShowCode: expandAll,
/**
* extra marker for the original debug
*/
Expand Down Expand Up @@ -66,7 +65,9 @@ const DemoWrapper: typeof DumiDemoGrid = ({ items }) => {
</Tooltip>
<Tooltip
title={
<FormattedMessage id={`app.component.examples.${showDebug ? 'hide' : 'visible'}`} />
<FormattedMessage
id={showDebug ? 'app.component.examples.hide' : 'app.component.examples.visible'}
/>
}
>
{showDebug ? (
Expand Down
5 changes: 1 addition & 4 deletions packages/charts/src/Pie/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@ nav:

## 代码演示

<!-- prettier-ignore -->
<code src="./demo/pie.tsx" title="基础饼图"></code>

<code src="./demo/donut.tsx" title="基础环图"></code>

<code src="./demo/donut-floor.tsx" title="环图-浮点数精度" debug></code>

<code src="./demo/half-donut.tsx" title="半圆环图"></code>

<code src="./demo/state-change.tsx" title="useMemo-状态改变" debug></code>

## API
Expand Down
10 changes: 2 additions & 8 deletions packages/design/src/card/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,15 @@ nav:

## 代码演示

<!-- prettier-ignore -->
<code src="./demo/basic.tsx" title="典型卡片" description="包含标题、内容、操作区域。"></code>

<code src="./demo/border-less.tsx" title="无边框" description="带有阴影,通常位于灰色背景之上。"></code>

<code src="./demo/no-divider.tsx" title="无分割线" description="去掉卡片头部和内容区的分割线。"></code>

<code src="./demo/inner.tsx" title="嵌套卡片" description="多层级展示,支持多种内部卡片样式。"></code>

<code src="./demo/grid.tsx" title="网格型内嵌卡片"></code>

<code src="./demo/tabs.tsx" title="带页签的卡片" description="页签可设置选项卡后面的标签。"></code>

<code src="./demo/config-provider.tsx" title="ConfigProvider" description="用于调试内部的 ConfigProvider 是否表现正常,需要连续触发 2 次及以上,观察第二个弹窗是否正常展示" debug></code>

<code src="../table/demo/card-table.tsx" title="和 Table 组合使用"></code>
<code src="./demo/config-provider.tsx" title="ConfigProvider" description="用于调试内部的 ConfigProvider 是否表现正常,需要连续触发 2 次及以上,观察第二个弹窗是否正常展示" debug></code>

## API

Expand Down
10 changes: 1 addition & 9 deletions packages/design/src/empty/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,16 @@ nav:

## 代码演示

<!-- prettier-ignore -->
<code src="./demo/basic.tsx" title="默认" description="简单展示"></code>

<code src="./demo/complete.tsx" title="完整使用" description="图片为 Empty.PRESENTED_IMAGE_COLORED,包含标题、描述和操作"></code>

<code src="./demo/complete-debug.tsx" title="完整使用 debug" description="图片为 Empty.PRESENTED_IMAGE_COLORED,包含标题、描述和操作" debug></code>

<code src="./demo/database.tsx" title="数据库实例插图" description="图片为 Empty.PRESENTED_IMAGE_DATABASE"></code>

<code src="./demo/image.tsx" title="自定义图片" description="可设置图片链接或 ReactNode"></code>

<code src="./demo/steps.tsx" title="步骤提示"></code>

<code src="./demo/over-length.tsx" title="超长内容" description="为了避免无限拉伸,限制描述区的最大宽度为 600px、步骤区的最大宽度为 1000px。"></code>

<code src="./demo/horizontal.tsx" title="横向布局" description="图片为 PRESENTED_IMAGE_GUIDE,常用于功能开通等引导类场景"></code>

<code src="./demo/with-page-container.tsx" title="和页容器搭配使用"></code>

<code src="./demo/config-provider.tsx" title="全局组件的 Empty 样式"></code>

## API
Expand Down
7 changes: 2 additions & 5 deletions packages/design/src/form/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,13 @@ nav:

## 代码演示

<!-- prettier-ignore -->
<code src="./demo/basic.tsx" title="基本" description="默认为可选样式"></code>

<code src="./demo/requiredMark-same-with-antd.tsx" title="设置为必选样式" description="可以通过全局或局部设置 `requiredMark`,让必选样式和 `antd` 保持一致"></code>

<code src="./demo/form-item-tooltip.tsx" title="配置提示信息"></code>
<code src="./demo/hideRequiredMark.tsx" title="hideRequiredMark" debug></code>

<code src="./demo/pro-form.tsx" title="ProForm" debug></code>

<code src="./demo/form-item-tooltip.tsx" title="配置提示信息"></code>

## API

| 参数 | 说明 | 类型 | 默认值 | 版本 |
Expand Down
5 changes: 1 addition & 4 deletions packages/design/src/typography/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,11 @@ nav:

## 代码演示

<!-- prettier-ignore -->
<code src="./demo/title.tsx" title="标题"></code>

<code src="./demo/text.tsx" title="文本与超链接"></code>

<code src="./demo/editable.tsx" title="可编辑"></code>

<code src="./demo/font-family.tsx" title="字体" description="详见 [字体设计规范](/docs/spec/typography)。"></code>

<code src="./demo/inner.tsx" title="和其他组件组合使用" debug></code>

## API
Expand Down
7 changes: 1 addition & 6 deletions packages/ui/src/PageContainer/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,13 @@ nav:

## 代码演示

<!-- prettier-ignore -->
<code src="./demo/basic.tsx" title="基本" description="包含标题、操作区、内容区、页脚"></code>

<code src="./demo/complete.tsx" iframe="600" title="完整使用" description="包含面包屑、页面返回、reload 刷新等,并支持页面滚动"></code>

<code src="./demo/with-tabs.tsx" iframe="600" title="和 Tabs 组合使用"></code>

<code src="./demo/header-less.tsx" iframe="600" title="无 PageHeader" description="头部内容为空"></code>

<code src="./demo/empty.tsx" title="空页面"></code>

<code src="./demo/extra-footer.tsx" title="页头和页脚操作区" description="位于页头和页脚操作区的组件尺寸为 `large`,字体大小为 `middle`。" debug></code>

<code src="./demo/title.tsx" title="title 属性" description="样式需要符合预期" debug></code>

## 与路由搭配使用
Expand Down

0 comments on commit 50361ac

Please sign in to comment.