Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 15 additions & 1 deletion src/blocks/Table/__stories__/Table.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,26 @@ import {StoryTemplate} from '../../../demo/StoryTemplate.mdx';
import * as TableStories from './Table.stories.tsx';

<Meta of={TableStories} />

<StoryTemplate>
## Parameters

`type: 'table-block'`

`title: string` — Title on the left

`table: Table` — Table content
`table: TableProps` — Table content

---

## TableProps

- `content: string[][]` — Двумерный массив со строками и ячейками таблицы.
- `legend?: string[]` — Подписи (легенда) под таблицей.
- `hideLegend?: boolean` — Скрыть легенду, если `true`.
- `justify?: Justify[]` — Выравнивание колонок; одно значение на колонку.
- `marker?: LegendTableMarkerType` — Тип маркера для элементов легенды.
- `caption?: string` — Используется только как доступное имя (не отображается визуально).

</StoryTemplate>

8 changes: 4 additions & 4 deletions src/blocks/Table/__stories__/Table.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {Meta, StoryFn} from '@storybook/react';

import {PageConstructor} from '../../../containers/PageConstructor';
import {TableBlockModel} from '../../../models';
import Table from '../Table';
import {blockTransform} from '../../../../.storybook/utils';
import {TableBlockModel, TableBlockProps} from '../../../models';
import Table, {TableBlock} from '../Table';

import data from './data.json';

Expand All @@ -12,7 +12,7 @@ export default {
} as Meta;

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

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