From 209a3b5293edbbda0e63b2d361d72474f8264f3e Mon Sep 17 00:00:00 2001 From: lijinke666 Date: Fri, 8 Nov 2024 16:12:36 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E4=BC=98=E5=8C=96=20spreadsheet=20clas?= =?UTF-8?q?s=20api=20=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../docs/api/basic-class/spreadsheet.zh.md | 10 +++++++--- s2-site/docs/api/general/S2Theme.zh.md | 19 +++++++++++++++---- .../demo/custom-header-action-icon.ts | 14 +++++++------- 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/s2-site/docs/api/basic-class/spreadsheet.zh.md b/s2-site/docs/api/basic-class/spreadsheet.zh.md index 367f15789a..66141907d3 100644 --- a/s2-site/docs/api/basic-class/spreadsheet.zh.md +++ b/s2-site/docs/api/basic-class/spreadsheet.zh.md @@ -14,7 +14,7 @@ s2.isPivotMode() | 参数 | 说明 | 类型 | 版本 | | --- |------------------------------------------------------------------------------------------------------------------------| --- |----| -| dom | 挂载的容器节点 | `string` \| `HTMLElement` | | +| themeName | 主题名 | [ThemeName](/api/general/s2-theme#themename) | | | theme | 主题配置 | [S2Theme](/docs/api/general/S2Theme) | | | store | 存储的一些信息 | [Store](/docs/api/basic-class/store) | | | dataCfg | 数据配置 | [S2DataConfig](/docs/api/general/S2DataConfig) | | @@ -24,11 +24,15 @@ s2.isPivotMode() | tooltip | 提示信息 | [BaseTooltip](/docs/api/basic-class/base-tooltip) | | | container | g-canvas 实例 | [Canvas](https://g.antv.antgroup.com/api/renderer/canvas) | | | interaction | 交互 | [Interaction](/zh/docs/api/basic-class/interaction) | | -| hd | 开启高清适配 | [HdAdapter](https://github.com/antvis/S2/blob/next/packages/s2-core/src/ui/hd-adapter/index.ts) | | +| hdAdapter | 高清适配器 | [HdAdapter](https://github.com/antvis/S2/blob/next/packages/s2-core/src/ui/hd-adapter/index.ts) | | +| destroyed | 表格是否已销毁 | `boolean` | | | on | 事件订阅 | (event: [S2Event](/docs/manual/advanced/interaction/basic), listener: () => void) => void | | | emit | 事件发布 | (event: [S2Event](/docs/manual/advanced/interaction/basic), ...args: any[]) => void | | | getDataSet | 获取数据集 | (options: [S2Options](/docs/api/general/S2Options)) => [BaseDataSet](/docs/api/basic-class/base-data-set) | | | isPivotMode | 是否是透视表 | `() => boolean` | | +| isCustomRowFields | 是否是自定义行头维值 | `() => boolean` | | +| isCustomColumnFields | 是否是自定义列头维值 | `() => boolean` | | +| isCustomHeaderFields | 是否是自定义表头维值 | `() => boolean` | | | isHierarchyTreeType | 是否是树状结构 | `() => boolean` | | | isFrozenRowHeader | 是否是冻结行头状态 | `() => boolean` | | | isTableMode | 是否是明细表 | `() => boolean` | | @@ -48,7 +52,7 @@ s2.isPivotMode() | setThemeCfg | 更新主题配置 (含主题 schema, 色板,主题名) | (themeCfg: [ThemeCfg](/docs/api/general/S2Theme/#themecfg)) => void | | | setTheme | 更新主题 (只包含主题 scheme) | (theme: [S2Theme](/docs/api/general/S2Theme/#s2theme)) => void | | | getTheme | 获取主题 (只包含主题 scheme) | ( ) => [S2Theme](/docs/api/general/S2Theme/#s2theme) | | -| getThemeName | 获取主题名 | ( ) => `default \| colorful \| gray \| dark` | | +| getThemeName | 获取主题名 | () => [ThemeName](/api/general/s2-theme#themename) | | | updatePagination | 更新分页 | (pagination: [Pagination](/docs/api/general/S2Options#pagination)) => void | | | changeSheetSize | 修改表格画布大小,不用重新加载数据 | `(width?: number, height?: number) => void` | | | getLayoutWidthType | 获取单元格宽度布局类型(LayoutWidthType: `adaptive(自适应)` \| `colAdaptive(列自适应)` \| `compact(紧凑)`) | () => `LayoutWidthType`| | diff --git a/s2-site/docs/api/general/S2Theme.zh.md b/s2-site/docs/api/general/S2Theme.zh.md index cbc521f7b5..2529de79fd 100644 --- a/s2-site/docs/api/general/S2Theme.zh.md +++ b/s2-site/docs/api/general/S2Theme.zh.md @@ -28,17 +28,28 @@ s2.setTheme({ 功能描述:表格主题配置项。查看 [文档](/manual/basic/theme) 和 [示例](/examples/theme/default/#colorful) -| 参数 | 参数 | 类型 | 默认值 | 必选 | +| 参数 | 说明 | 类型 | 默认值 | 必选 | | ------- | ----------- | --------------------------------- | --------- | ---- | | theme | 主题 schema | [S2Theme](#s2theme) | - | | | palette | 色板 | [Palette](#palette) | - | | -| name | 主题名 | `default` \| `colorful` \| `gray` | `default` | | +| name | 主题名 | [ThemeName](#themename) | `default` | | + +### ThemeName + +功能描述:表格主题名称。查看 [文档](/manual/basic/theme) 和 [示例](/examples/theme/default/#colorful) + +| 参数 | 说明 | 类型 | 默认值 | 必选 | +| ---- | -------------- | ---------------------- | ------ | ---- | +| default | 默认 | `string` | - | | +| colorful | 多彩蓝 | `string` | - | | +| gray | 简约灰 | `string` | - | | +| dark | 暗黑 | `string` | - | | ### Palette 功能描述:表主题色板。查看 [文档](/manual/basic/theme) 和 [示例](/examples/theme/custom/#custom-palette) -| 参数 | 参数 | 类型 | 默认值 | 必选 | +| 参数 | 说明 | 类型 | 默认值 | 必选 | | ------------------- | --------------------------------------------------- | ---------------------------------------------------------------- | ------ | ---- | | brandColor | 色板主题色 | `string` | - | ✓ | | basicColors | 基础颜色 | `string[]` | - | ✓ | @@ -50,7 +61,7 @@ s2.setTheme({ 功能描述:表格主题 `Schema`. 查看 [文档](/manual/basic/theme#%E4%B8%BB%E9%A2%98-schema) 和 [示例](/examples/theme/custom/#custom-palette) -| 参数 | 参数 | 类型 | 默认值 | 必选 | +| 参数 | 说明 | 类型 | 默认值 | 必选 | | ----------------- | -------------------------------------- | ----------------------------------------------- | ------ | ---- | | cornerCell | 角头单元格主题 | [DefaultCellTheme](#defaultcelltheme) | | | | rowCell | 行头单元格主题 | [DefaultCellTheme](#defaultcelltheme) | | | diff --git a/s2-site/examples/custom/custom-icon/demo/custom-header-action-icon.ts b/s2-site/examples/custom/custom-icon/demo/custom-header-action-icon.ts index 868f769143..cbfd52ddae 100644 --- a/s2-site/examples/custom/custom-icon/demo/custom-header-action-icon.ts +++ b/s2-site/examples/custom/custom-icon/demo/custom-header-action-icon.ts @@ -26,9 +26,9 @@ fetch( displayCondition: (meta) => meta.level > 0, onClick: (options) => { console.log(options); - const { meta, event } = options; - - meta.spreadsheet.handleGroupSort(event, meta); + }, + onHover: (options) => { + console.log(options); }, }, { @@ -38,7 +38,7 @@ fetch( onClick: (options) => { const { meta, event } = options; - meta.spreadsheet.tooltip.show({ + meta.spreadsheet.showTooltip({ position: { x: event.clientX, y: event.clientY }, content: `
ColTooltip
`, }); @@ -51,7 +51,7 @@ fetch( onClick: (options) => { const { meta, event } = options; - meta.spreadsheet.tooltip.show({ + meta.spreadsheet.showTooltip({ position: { x: event.clientX, y: event.clientY }, content: `
CornerTooltip
`, }); @@ -66,7 +66,7 @@ fetch( onClick: (options) => { const { meta, event } = options; - meta.spreadsheet.tooltip.show({ + meta.spreadsheet.showTooltip({ position: { x: event.clientX, y: event.clientY }, content: `
RowTooltip
`, }); @@ -83,7 +83,7 @@ fetch( content.innerHTML = '我是 RowTooltip 自定义内容'; - meta.spreadsheet.tooltip.show({ + meta.spreadsheet.showTooltip({ position: { x: event.clientX, y: event.clientY }, content, });