Skip to content

Commit

Permalink
Merge pull request #951 from oceanbase/dengfuping-dev
Browse files Browse the repository at this point in the history
improve(site): Unify demo layout by prettier-ignore comment
  • Loading branch information
dengfuping authored Jan 17, 2025
2 parents 064ae2b + 0c07262 commit 7c9f4df
Show file tree
Hide file tree
Showing 51 changed files with 75 additions and 141 deletions.
1 change: 1 addition & 0 deletions docs/design/design-i18n.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ return (

## 使用示例

<!-- prettier-ignore -->
<code src="../../packages/design/src/locale/demo/basic.tsx"></code>

## 目前支持语言
Expand Down
4 changes: 1 addition & 3 deletions packages/charts/src/Area/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ nav:

## 代码演示

<!-- prettier-ignore -->
<code src="./demo/basic.tsx" title="基础面积图"></code>

<code src="./demo/stack.tsx" title="堆叠面积图"></code>

<code src="./demo/percent.tsx" title="百分比面积图"></code>

<code src="./demo/tooltip-scrollable.tsx" title="Tooltip 可滚动" description="适用于 Tooltip 项较多、超出图表的场景,可通过 `tooltip.scrollable: true` 配置进行开启。"></code>

## API
Expand Down
6 changes: 1 addition & 5 deletions packages/charts/src/Bar/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,12 @@ nav:

## 代码演示

<!-- prettier-ignore -->
<code src="./demo/basic.tsx" title="基础条形图"></code>

<code src="./demo/stack.tsx" title="堆叠条形图"></code>

<code src="./demo/group.tsx" title="分组条形图"></code>

<code src="./demo/percent.tsx" title="百分比条形图"></code>

<code src="./demo/progress.tsx" title="进度条形图" description="展示百分比,支持设置警告水位线、危险水位线"></code>

<code src="./demo/range.tsx" title="区间条形图"></code>

## API
Expand Down
5 changes: 1 addition & 4 deletions packages/charts/src/Column/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@ nav:

## 代码演示

<!-- prettier-ignore -->
<code src="./demo/basic.tsx" title="基础柱状图"></code>

<code src="./demo/stack.tsx" title="堆叠柱状图"></code>

<code src="./demo/group.tsx" title="分组柱状图"></code>

<code src="./demo/percent.tsx" title="百分比柱状图"></code>

<code src="./demo/range.tsx" title="区间柱状图"></code>

## API
Expand Down
5 changes: 1 addition & 4 deletions packages/charts/src/DualAxes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@ nav:

## 代码演示

<!-- prettier-ignore -->
<code src="./demo/dual-line.tsx" title="双折线双轴图"></code>

<code src="./demo/multi-line.tsx" title="多折线双轴图"></code>

<code src="./demo/column-line.tsx" title="柱线混合双轴图"></code>

<code src="./demo/column-multi-line.tsx" title="柱线混合双轴图-多折线"></code>

<code src="./demo/tooltip-scrollable.tsx" title="Tooltip 可滚动" description="适用于 Tooltip 项较多、超出图表的场景,可通过 `tooltip.scrollable: true` 配置进行开启。"></code>

## API
Expand Down
4 changes: 1 addition & 3 deletions packages/charts/src/Gauge/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ nav:

## 代码演示

<!-- prettier-ignore -->
<code src="./demo/basic.tsx" title="基础仪表盘"></code>

<code src="./demo/custom-color.tsx" title="多色仪表盘"></code>

<code src="./demo/meter.tsx" title="米轨仪表盘"></code>

<code src="./demo/without-indicator.tsx" title="无指针和刻度仪表盘"></code>

## API
Expand Down
2 changes: 1 addition & 1 deletion packages/charts/src/Histogram/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ nav:

## 代码演示

<!-- prettier-ignore -->
<code src="./demo/basic.tsx" title="基础直方图"></code>

<code src="./demo/stack.tsx" title="堆叠直方图"></code>

## API
Expand Down
5 changes: 1 addition & 4 deletions packages/charts/src/Line/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@ nav:

## 代码演示

<!-- prettier-ignore -->
<code src="./demo/basic.tsx" title="基础折线图"></code>

<code src="./demo/step.tsx" title="阶梯折线图"></code>

<code src="./demo/multiple.tsx" title="多折线图"></code>

<code src="./demo/auto-fit.tsx" title="自适应容器高度" description="调整浏览器窗口高度即可验证"></code>

<code src="./demo/tooltip-scrollable.tsx" title="Tooltip 可滚动" description="适用于 Tooltip 项较多、超出图表的场景,可通过 `tooltip.scrollable: true` 配置进行开启。"></code>

## API
Expand Down
4 changes: 1 addition & 3 deletions packages/charts/src/Liquid/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ nav:

## 代码演示

<!-- prettier-ignore -->
<code src="./demo/circle.tsx" title="圆形水波图"></code>

<code src="./demo/rect.tsx" title="矩形水波图"></code>

<code src="./demo/horizontal.tsx" title="水平布局的水波图"></code>

<code src="./demo/decimal.tsx" title="数据精度" description="默认最多保留两位有效小数,可通过 `decimal` 进行设置。"></code>

## API
Expand Down
5 changes: 4 additions & 1 deletion packages/charts/src/Score/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ nav:

## 代码演示

<code src="./demo/basic.tsx" title="基础使用"></code> <code src="./demo/customColor.tsx" title="自定义颜色和单位"></code> <code src="./demo/customThreshold.tsx" title="自定义阈值"></code>
<!-- prettier-ignore -->
<code src="./demo/basic.tsx" title="基础使用"></code>
<code src="./demo/customColor.tsx" title="自定义颜色和单位"></code>
<code src="./demo/customThreshold.tsx" title="自定义阈值"></code>

## API

Expand Down
1 change: 1 addition & 0 deletions packages/charts/src/Stat/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ nav:

## 代码演示

<!-- prettier-ignore -->
<code src="./demo/basic.tsx" title="基础数字统计"></code>

## API
Expand Down
4 changes: 1 addition & 3 deletions packages/charts/src/Tiny/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ nav:

## 代码演示

<!-- prettier-ignore -->
<code src="./demo/line.tsx" title="迷你折线图"></code>

<code src="./demo/area.tsx" title="迷你面积图"></code>

<code src="./demo/column.tsx" title="迷你柱状图"></code>

<code src="./demo/progress.tsx" title="进度条图"></code>

## API
Expand Down
5 changes: 1 addition & 4 deletions packages/design/src/descriptions/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,11 @@ nav:

## 代码演示

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

<code src="./demo/content.tsx" title="内容展示" description="内容超长自动省略,并展示 `Tooltip`。同时通过 `contentProps` 可设置省略、编辑、复制等内容属性。"></code>

<code src="./demo/vertical.tsx" title="垂直列表" description="默认去掉冒号"></code>

<code src="./demo/bordered.tsx" title="带边框"></code>

<code src="./demo/size.tsx" title="不同尺寸"></code>

## API
Expand Down
8 changes: 1 addition & 7 deletions packages/design/src/drawer/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,14 @@ nav:

## 代码演示

<!-- prettier-ignore -->
<code src="./demo/basic.tsx" title="基础抽屉" description="默认包含标题、内容。"></code>

<code src="./demo/footer.tsx" title="开启页脚" description="内容较短时,页脚跟随内容展示;可通过 `onOk` 或 `footer` 开启页脚。"></code>

<code src="./demo/footerExtra.tsx" title="设置默认页脚的额外内容" description="通过 `footerExtra` 设置,仅默认页脚生效"></code>

<code src="./demo/custom-footer.tsx" title="自定义页脚"></code>

<code src="./demo/confirmLoading.tsx" title="确定按钮 loading"></code>

<code src="./demo/form-drawer.tsx" title="用于 Form 表单" description="与 Form 表单合用,用于收集数据。"></code>

<code src="./demo/descriptions.tsx" title="用于详情展示" description="与 Descriptions 合用,用于详情展示"></code>

<code src="./demo/over-height.tsx" title="内容超出" description="支持滚动;内容较长时页脚置底展示"></code>

## API
Expand Down
4 changes: 1 addition & 3 deletions packages/design/src/grid/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ nav:

## 代码演示

<!-- prettier-ignore -->
<code src="./demo/basic.tsx" title="基础栅格" description="使用单一的一组 Row 和 Col 栅格组件,就可以创建一个基本的栅格系统,所有列(Col)必须放在 Row 内。"></code>

<code src="./demo/gutter.tsx" title="区块栅格" description="栅格常常需要和间隔进行配合,你可以使用 Row 的 gutter 属性,我们推荐使用 (16+8n)px 作为栅格间隔(n 是自然数)。"></code>

<code src="./demo/offset.tsx" title="左右偏移" description="使用 offset 可以将列向右侧偏。例如,offset={4} 将元素向右侧偏移了 4 个列(column)的宽度。"></code>

<code src="./demo/flex.tsx" title="排版" description="子元素根据不同的值 start、center、end、space-between、space-around 和 space-evenly,分别定义其在父节点里面的排版方式。"></code>

## API
Expand Down
4 changes: 1 addition & 3 deletions packages/design/src/input-number/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ nav:

## 代码演示

<!-- prettier-ignore -->
<code src="./demo/basic.tsx" title="基本" description="数字输入框"></code>

<code src="./demo/addon.tsx" title="前置/后置标签" description="用于配置一些固定组合。"></code>

<code src="./demo/formatter.tsx" title="格式化展示" description="通过 `formatter` 格式化数字,以展示具有具体含义的数据,往往需要配合 `parser` 一起使用。这里有一个更复杂的货币格式化输入框:[https://codesandbox.io/s/currency-wrapper-antd-input-3ynzo](https://codesandbox.io/s/currency-wrapper-antd-input-3ynzo)"></code>

<code src="./demo/status.tsx" title="自定义状态" description="使用 `status` 为 InputNumber 添加状态,可选 `error` 或者 `warning`。"></code>

## API
Expand Down
2 changes: 1 addition & 1 deletion packages/design/src/list/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ nav:

## 代码演示

<!-- prettier-ignore -->
<code src="./demo/simple.tsx" title="简单列表"></code>

<code src="./demo/basic.tsx" title="基础列表"></code>

## API
Expand Down
1 change: 1 addition & 0 deletions packages/design/src/message/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ nav:

## 代码演示

<!-- prettier-ignore -->
<code src="./demo/basic.tsx" title="基本"></code>

## API
Expand Down
1 change: 1 addition & 0 deletions packages/design/src/notification/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ nav:

## 代码演示

<!-- prettier-ignore -->
<code src="./demo/basic.tsx" title="基本"></code>

## API
Expand Down
2 changes: 1 addition & 1 deletion packages/design/src/popconfirm/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ nav:

## 代码演示

<!-- prettier-ignore -->
<code src="./demo/basic.tsx" title="基本"></code>

<code src="./demo/promise.tsx" title="基于 Promise 的异步关闭" description="点击确定后异步关闭气泡确认框。"></code>

## API
Expand Down
4 changes: 1 addition & 3 deletions packages/design/src/popover/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ nav:

## 代码演示

<!-- prettier-ignore -->
<code src="./demo/basic.tsx" title="基本"></code>

<code src="./demo/trigger.tsx" title="触发方式"></code>

<code src="./demo/over-length.tsx" title="超长内容" description="浮层大小默认由内容区决定,最大宽度为 100vw。如果不想浮层被内容无限撑开,可以通过 `overlayInnerStyle` 设置最大宽高。"></code>

<code src="./demo/with-table.tsx" title="和表格搭配使用" description="1、浮层设置最大宽度,避免被表格内容无限拉伸。<br/>2、表格设置横向滚动 `scroll={{ x: 'max-content' }}`,避免折行。<br/>3、表格尺寸设为 `middle`,分页器尺寸设为 `small`,减小空间占用。"></code>

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

## 代码演示

<!-- prettier-ignore -->
<code src="./demo/success.tsx" title="成功"></code>

<code src="./demo/error.tsx" title="失败"></code>

<code src="./demo/warning.tsx" title="警告"></code>

<code src="./demo/processing.tsx" title="进行中"></code>

<code src="./demo/403.tsx" title="403" description="无访问权限。"></code>

<code src="./demo/404.tsx" title="404" description="页面未找到。"></code>

<code src="./demo/500.tsx" title="500" description="服务器发生了错误。"></code>

<code src="./demo/icon.tsx" title="自定义 icon"></code>

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

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

## API
Expand Down
5 changes: 1 addition & 4 deletions packages/design/src/segmented/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,11 @@ nav:

### 基本使用

<!-- prettier-ignore -->
<code src="./demo/basic.tsx" title="基本"></code>

<code src="./demo/disabled.tsx" title="不可用"></code>

<code src="./demo/size.tsx" title="三种大小"></code>

<code src="./demo/block.tsx" title="block" description="block 属性使其撑满父元素宽度"></code>

<code src="./demo/ellipsis.tsx" title="省略" description="需要同时配置分段器的 block 和选项的 ellipsis 属性"></code>

## API
Expand Down
5 changes: 4 additions & 1 deletion packages/design/src/space/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ nav:

## 代码演示

<code src="./demo/basic.tsx" title="基本用法"></code> </code> <code src="./demo/vertical.tsx" title="相邻组件垂直间距"></code> <code src="./demo/wrap.tsx" title="自动换行"></code>
<!-- prettier-ignore -->
<code src="./demo/basic.tsx" title="基本用法"></code>
<code src="./demo/vertical.tsx" title="相邻组件垂直间距"></code>
<code src="./demo/wrap.tsx" title="自动换行"></code>

- 详见 antd Space 文档: https://ant.design/components/space-cn/
6 changes: 1 addition & 5 deletions packages/design/src/tabs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,12 @@ nav:

## 代码演示

<!-- prettier-ignore -->
<code src="./demo/basic.tsx" title="基本"></code>

<code src="./demo/size.tsx" title="大小"></code>

<code src="./demo/position.tsx" title="位置"></code>

<code src="./demo/divider.tsx" title="分割线"></code>

<code src="./demo/tag.tsx" title="标签" description="可设置选项卡后面的标签"></code>

<code src="./demo/tab-pane.tsx" title="TabPane 语法糖(不推荐使用)" description="即将废弃的 API,不推荐使用,详见 antd [文档](https://4x.ant.design/components/tabs-cn/#4.23.0-%E7%94%A8%E6%B3%95%E5%8D%87%E7%BA%A7)"></code>

## API
Expand Down
9 changes: 8 additions & 1 deletion packages/design/src/tag/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@ nav:

## 代码演示

<code src="./demo/basic.tsx" title="基本"></code> <code src="./demo/ellipsis.tsx" title="内容超长自动省略"></code> <code src="./demo/color.tsx" title="彩色标签" description="我们添加了多种预设色彩的标签样式,用作不同场景使用。如果预设值不能满足你的需求,可以设置为具体色值"></code> <code src="./demo/status.tsx" title="预设状态的标签" description="预设五种状态颜色"></code> <code src="./demo/checkable.tsx" title="可选择标签"></code> <code src="./demo/icon.tsx" title="图标按钮"></code> <code src="./demo/borderless.tsx" title="无边框模式"></code>
<!-- prettier-ignore -->
<code src="./demo/basic.tsx" title="基本"></code>
<code src="./demo/ellipsis.tsx" title="内容超长自动省略"></code>
<code src="./demo/color.tsx" title="彩色标签" description="我们添加了多种预设色彩的标签样式,用作不同场景使用。如果预设值不能满足你的需求,可以设置为具体色值"></code>
<code src="./demo/status.tsx" title="预设状态的标签" description="预设五种状态颜色"></code>
<code src="./demo/checkable.tsx" title="可选择标签"></code>
<code src="./demo/icon.tsx" title="图标按钮"></code>
<code src="./demo/borderless.tsx" title="无边框模式"></code>

## API

Expand Down
1 change: 1 addition & 0 deletions packages/design/src/theme/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ export default () {

## 主题预览

<!-- prettier-ignore -->
<code src="./demo/previewer.tsx"></code>

## API
Expand Down
5 changes: 1 addition & 4 deletions packages/design/src/tooltip/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,11 @@ nav:

## 代码演示

<!-- prettier-ignore -->
<code src="./demo/basic.tsx" title="基本"></code>

<code src="./demo/over-length.tsx" title="超长内容" description="1、浮层默认的最大宽度为 300px、最大高度为 250px,内容超出时横向折行、纵向滚动。<br/>2、可以通过 `overlayStyle={{ maxWidth: 'xxx' }}` 设置最大宽度,`overlayInnerStyle={{ maxHeight: 'xxx' }}` 设置最大高度。"></code>

<code src="./demo/close-icon.tsx" title="关闭按钮" description="Tooltip 可以通过设置 closeIcon 变为可关闭 Tooltip, 并支持自定义关闭按钮,设置为 true 时将使用默认关闭按钮。可关闭 Tooltip 具有 onClose 事件"></code>

<code src="./demo/type.tsx" title="Tooltip 类型" description="Tooltip 有五种类型:default、info、success、warning 和 error,以满足不同场景的提示需求。"></code>

<code src="./demo/mouse-follow.tsx" title="鼠标跟随" description="设置 `mouseFollow: true` 可开启鼠标跟随,此时会去掉箭头,并且 `placement`、`open` 和 `trigger` 等属性也将失效。"></code>

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

## 代码演示

<!-- prettier-ignore -->
<code src="./demo/NotificationCenterDemo.tsx"></code>

## API
Expand Down
Loading

0 comments on commit 7c9f4df

Please sign in to comment.