Skip to content

Commit 2420fd1

Browse files
KrotovPetrPetr Krotov
andauthored
chore(Table): update story and mdx (#1349)
* chore(Table): update story and mdx * chore(Table): update story and mdx --------- Co-authored-by: Petr Krotov <peterkrotov@peterkrotov-dev.vla.yp-c.yandex.net>
1 parent 7e36ea8 commit 2420fd1

File tree

6 files changed

+19
-5
lines changed

6 files changed

+19
-5
lines changed
-788 Bytes
Loading
-2.3 KB
Loading
-1002 Bytes
Loading
-2.49 KB
Loading

src/blocks/Table/__stories__/Table.mdx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,26 @@ import {StoryTemplate} from '../../../demo/StoryTemplate.mdx';
44
import * as TableStories from './Table.stories.tsx';
55

66
<Meta of={TableStories} />
7+
78
<StoryTemplate>
89
## Parameters
910

1011
`type: 'table-block'`
1112

1213
`title: string` — Title on the left
1314

14-
`table: Table` — Table content
15+
`table: TableProps` — Table content
16+
17+
---
18+
19+
## TableProps
20+
21+
- `content: string[][]` — Двумерный массив со строками и ячейками таблицы.
22+
- `legend?: string[]` — Подписи (легенда) под таблицей.
23+
- `hideLegend?: boolean` — Скрыть легенду, если `true`.
24+
- `justify?: Justify[]` — Выравнивание колонок; одно значение на колонку.
25+
- `marker?: LegendTableMarkerType` — Тип маркера для элементов легенды.
26+
- `caption?: string` — Используется только как доступное имя (не отображается визуально).
27+
1528
</StoryTemplate>
29+

src/blocks/Table/__stories__/Table.stories.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import {Meta, StoryFn} from '@storybook/react';
22

3-
import {PageConstructor} from '../../../containers/PageConstructor';
4-
import {TableBlockModel} from '../../../models';
5-
import Table from '../Table';
3+
import {blockTransform} from '../../../../.storybook/utils';
4+
import {TableBlockModel, TableBlockProps} from '../../../models';
5+
import Table, {TableBlock} from '../Table';
66

77
import data from './data.json';
88

@@ -12,7 +12,7 @@ export default {
1212
} as Meta;
1313

1414
const DefaultTemplate: StoryFn<TableBlockModel> = (args) => (
15-
<PageConstructor content={{blocks: [args]}} />
15+
<TableBlock {...(blockTransform(args) as TableBlockProps)} />
1616
);
1717

1818
export const Default = DefaultTemplate.bind({});

0 commit comments

Comments
 (0)