Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow passing a prop type or interface directly to the props option in the docs #3771

Merged
merged 18 commits into from
Aug 11, 2020
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
404 changes: 404 additions & 0 deletions scripts/loaders/prop-loader.js

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions src-docs/src/views/color_picker/color_picker_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import {
EuiText,
} from '../../../../src/components';
import {
EuiColorPalettePickerPaletteText,
EuiColorPalettePickerPaletteFixed,
EuiColorPalettePickerPaletteGradient,
} from './props';
EuiColorPalettePickerPaletteTextProps,
EuiColorPalettePickerPaletteFixedProps,
EuiColorPalettePickerPaletteGradientProps,
} from '!!prop-loader!../../../../src/components/color_picker/color_palette_picker/color_palette_picker';

import ColorPicker from './color_picker';
const colorPickerSource = require('!!raw-loader!./color_picker');
Expand Down Expand Up @@ -358,9 +358,9 @@ export const ColorPickerExample = {
],
props: {
EuiColorPalettePicker,
EuiColorPalettePickerPaletteText,
EuiColorPalettePickerPaletteFixed,
EuiColorPalettePickerPaletteGradient,
EuiColorPalettePickerPaletteTextProps,
EuiColorPalettePickerPaletteFixedProps,
EuiColorPalettePickerPaletteGradientProps,
},
snippet: colorPalettePickerSnippet,
demo: <ColorPalettePicker />,
Expand Down
19 changes: 0 additions & 19 deletions src-docs/src/views/color_picker/props.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import DataGridControlColumns from './control_columns';
const dataGridControlColumnsSource = require('!!raw-loader!./control_columns');
const dataGridControlColumnsHtml = renderToHtml(DataGridControlColumns);

import { DataGridControlColumn as EuiDataGridControlColumn } from './props';
import { EuiDataGridControlColumn } from '!!prop-loader!../../../../src/components/datagrid/data_grid_types';

const gridSnippet = `<EuiDataGrid
{...usualProps}
Expand Down
51 changes: 26 additions & 25 deletions src-docs/src/views/datagrid/datagrid_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,20 @@ const dataGridSource = require('!!raw-loader!./datagrid');
const dataGridHtml = renderToHtml(DataGrid);

import {
DataGridColumn,
DataGridPagination,
DataGridSorting,
DataGridInMemory,
DataGridStyle,
DataGridCellValueElement,
DataGridSchemaDetector,
DataGridToolbarVisibilityOptions,
DataGridColumnVisibility,
DataGridPopoverContent,
DataGridControlColumn,
DataGridToolBarVisibilityColumnSelectorOptions,
} from './props';
EuiDataGridColumn,
EuiDataGridPaginationProps,
EuiDataGridSorting,
EuiDataGridInMemory,
EuiDataGridStyle,
EuiDataGridToolBarVisibilityOptions,
EuiDataGridColumnVisibility,
EuiDataGridPopoverContentProps,
EuiDataGridControlColumn,
EuiDataGridToolBarVisibilityColumnSelectorOptions,
} from '!!prop-loader!../../../../src/components/datagrid/data_grid_types';

import { EuiDataGridCellValueElementProps } from '!!prop-loader!../../../../src/components/datagrid/data_grid_cell';
import { EuiDataGridSchemaDetector } from '!!prop-loader!../../../../src/components/datagrid/data_grid_schema';

const gridSnippet = `
<EuiDataGrid
Expand Down Expand Up @@ -351,18 +352,18 @@ export const DataGridExample = {
components: { DataGrid },
props: {
EuiDataGrid,
EuiDataGridColumn: DataGridColumn,
EuiDataGridColumnVisibility: DataGridColumnVisibility,
EuiDataGridControlColumn: DataGridControlColumn,
EuiDataGridInMemory: DataGridInMemory,
EuiDataGridPagination: DataGridPagination,
EuiDataGridSorting: DataGridSorting,
EuiDataGridCellValueElement: DataGridCellValueElement,
EuiDataGridSchemaDetector: DataGridSchemaDetector,
EuiDataGridStyle: DataGridStyle,
EuiDataGridToolbarVisibilityOptions: DataGridToolbarVisibilityOptions,
EuiDataGridToolBarVisibilityColumnSelectorOptions: DataGridToolBarVisibilityColumnSelectorOptions,
EuiDataGridPopoverContent: DataGridPopoverContent,
EuiDataGridColumn,
EuiDataGridColumnVisibility,
EuiDataGridControlColumn,
EuiDataGridInMemory,
EuiDataGridPaginationProps,
EuiDataGridSorting,
EuiDataGridCellValueElementProps,
EuiDataGridSchemaDetector,
EuiDataGridStyle,
EuiDataGridToolBarVisibilityOptions,
EuiDataGridToolBarVisibilityColumnSelectorOptions,
EuiDataGridPopoverContentProps,
},
demo: (
<Fragment>
Expand Down
93 changes: 47 additions & 46 deletions src-docs/src/views/datagrid/datagrid_memory_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,17 @@ const inMemorySortingDataGridSource = require('!!raw-loader!./in_memory_sorting'
const inMemorySortingDataGridHtml = renderToHtml(InMemorySortingDataGrid);

import {
DataGridColumn,
DataGridPagination,
DataGridSorting,
DataGridInMemory,
DataGridStyle,
DataGridCellValueElement,
DataGridSchemaDetector,
DataGridToolbarVisibilityOptions,
DataGridColumnVisibility,
} from './props';
EuiDataGridColumn,
EuiDataGridPaginationProps,
EuiDataGridSorting,
EuiDataGridInMemory,
EuiDataGridStyle,
EuiDataGridToolBarVisibilityOptions,
EuiDataGridColumnVisibility,
} from '!!prop-loader!../../../../src/components/datagrid/data_grid_types';

import { EuiDataGridCellValueElementProps } from '!!prop-loader!../../../../src/components/datagrid/data_grid_cell';
import { EuiDataGridSchemaDetector } from '!!prop-loader!../../../../src/components/datagrid/data_grid_schema';

export const DataGridMemoryExample = {
title: 'Data grid in-memory settings',
Expand Down Expand Up @@ -128,15 +129,15 @@ export const DataGridMemoryExample = {
),
props: {
EuiDataGrid,
EuiDataGridInMemory: DataGridInMemory,
EuiDataGridColumn: DataGridColumn,
EuiDataGridColumnVisibility: DataGridColumnVisibility,
EuiDataGridPagination: DataGridPagination,
EuiDataGridSorting: DataGridSorting,
EuiDataGridCellValueElement: DataGridCellValueElement,
EuiDataGridSchemaDetector: DataGridSchemaDetector,
EuiDataGridStyle: DataGridStyle,
EuiDataGridToolbarVisibilityOptions: DataGridToolbarVisibilityOptions,
EuiDataGridInMemory,
EuiDataGridColumn,
EuiDataGridColumnVisibility,
EuiDataGridPaginationProps,
EuiDataGridSorting,
EuiDataGridCellValueElementProps,
EuiDataGridSchemaDetector,
EuiDataGridStyle,
EuiDataGridToolBarVisibilityOptions,
},
components: { InMemoryDataGrid },
demo: <InMemoryDataGrid />,
Expand Down Expand Up @@ -166,15 +167,15 @@ export const DataGridMemoryExample = {
),
props: {
EuiDataGrid,
EuiDataGridInMemory: DataGridInMemory,
EuiDataGridColumn: DataGridColumn,
EuiDataGridColumnVisibility: DataGridColumnVisibility,
EuiDataGridPagination: DataGridPagination,
EuiDataGridSorting: DataGridSorting,
EuiDataGridCellValueElement: DataGridCellValueElement,
EuiDataGridSchemaDetector: DataGridSchemaDetector,
EuiDataGridStyle: DataGridStyle,
EuiDataGridToolbarVisibilityOptions: DataGridToolbarVisibilityOptions,
EuiDataGridInMemory,
EuiDataGridColumn,
EuiDataGridColumnVisibility,
EuiDataGridPaginationProps,
EuiDataGridSorting,
EuiDataGridCellValueElementProps,
EuiDataGridSchemaDetector,
EuiDataGridStyle,
EuiDataGridToolBarVisibilityOptions,
},
components: { InMemoryEnhancementsDataGrid },
demo: <InMemoryEnhancementsDataGrid />,
Expand Down Expand Up @@ -203,15 +204,15 @@ export const DataGridMemoryExample = {
),
props: {
EuiDataGrid,
EuiDataGridInMemory: DataGridInMemory,
EuiDataGridColumn: DataGridColumn,
EuiDataGridColumnVisibility: DataGridColumnVisibility,
EuiDataGridPagination: DataGridPagination,
EuiDataGridSorting: DataGridSorting,
EuiDataGridCellValueElement: DataGridCellValueElement,
EuiDataGridSchemaDetector: DataGridSchemaDetector,
EuiDataGridStyle: DataGridStyle,
EuiDataGridToolbarVisibilityOptions: DataGridToolbarVisibilityOptions,
EuiDataGridInMemory,
EuiDataGridColumn,
EuiDataGridColumnVisibility,
EuiDataGridPaginationProps,
EuiDataGridSorting,
EuiDataGridCellValueElementProps,
EuiDataGridSchemaDetector,
EuiDataGridStyle,
EuiDataGridToolBarVisibilityOptions,
},
components: { InMemoryPaginationDataGrid },
demo: <InMemoryPaginationDataGrid />,
Expand Down Expand Up @@ -239,15 +240,15 @@ export const DataGridMemoryExample = {
),
props: {
EuiDataGrid,
EuiDataGridInMemory: DataGridInMemory,
EuiDataGridColumn: DataGridColumn,
EuiDataGridColumnVisibility: DataGridColumnVisibility,
EuiDataGridPagination: DataGridPagination,
EuiDataGridSorting: DataGridSorting,
EuiDataGridCellValueElement: DataGridCellValueElement,
EuiDataGridSchemaDetector: DataGridSchemaDetector,
EuiDataGridStyle: DataGridStyle,
EuiDataGridToolbarVisibilityOptions: DataGridToolbarVisibilityOptions,
EuiDataGridInMemory,
EuiDataGridColumn,
EuiDataGridColumnVisibility,
EuiDataGridPaginationProps,
EuiDataGridSorting,
EuiDataGridCellValueElementProps,
EuiDataGridSchemaDetector,
EuiDataGridStyle,
EuiDataGridToolBarVisibilityOptions,
},
components: { InMemorySortingDataGrid },
demo: <InMemorySortingDataGrid />,
Expand Down
39 changes: 20 additions & 19 deletions src-docs/src/views/datagrid/datagrid_schema_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ const dataGridSchemaSource = require('!!raw-loader!./schema');
const dataGridSchemaHtml = renderToHtml(DataGridSchema);

import {
DataGridColumn,
DataGridPagination,
DataGridSorting,
DataGridInMemory,
DataGridStyle,
DataGridCellValueElement,
DataGridSchemaDetector,
DataGridToolbarVisibilityOptions,
DataGridColumnVisibility,
} from './props';
EuiDataGridColumn,
EuiDataGridPaginationProps,
EuiDataGridSorting,
EuiDataGridInMemory,
EuiDataGridStyle,
EuiDataGridToolBarVisibilityOptions,
EuiDataGridColumnVisibility,
} from '!!prop-loader!../../../../src/components/datagrid/data_grid_types';

import { EuiDataGridCellValueElementProps } from '!!prop-loader!../../../../src/components/datagrid/data_grid_cell';
import { EuiDataGridSchemaDetector } from '!!prop-loader!../../../../src/components/datagrid/data_grid_schema';

export const DataGridSchemaExample = {
title: 'Data grid schemas and popovers',
Expand Down Expand Up @@ -86,15 +87,15 @@ export const DataGridSchemaExample = {
components: { DataGridSchema },
props: {
EuiDataGrid,
EuiDataGridColumn: DataGridColumn,
EuiDataGridColumnVisibility: DataGridColumnVisibility,
EuiDataGridInMemory: DataGridInMemory,
EuiDataGridPagination: DataGridPagination,
EuiDataGridSorting: DataGridSorting,
EuiDataGridCellValueElement: DataGridCellValueElement,
EuiDataGridSchemaDetector: DataGridSchemaDetector,
EuiDataGridStyle: DataGridStyle,
EuiDataGridToolbarVisibilityOptions: DataGridToolbarVisibilityOptions,
EuiDataGridInMemory,
EuiDataGridColumn,
EuiDataGridColumnVisibility,
EuiDataGridPaginationProps,
EuiDataGridSorting,
EuiDataGridCellValueElementProps,
EuiDataGridSchemaDetector,
EuiDataGridStyle,
EuiDataGridToolBarVisibilityOptions,
},
demo: <DataGridSchema />,
},
Expand Down
14 changes: 7 additions & 7 deletions src-docs/src/views/datagrid/datagrid_styling_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ const dataGridColumnWidthsSource = require('!!raw-loader!./column_widths');
const dataGridColumnWidthsHtml = renderToHtml(DataGridColumnWidths);

import {
DataGridStyle,
DataGridToolbarVisibilityOptions,
DataGridColumn,
} from './props';
EuiDataGridColumn,
EuiDataGridStyle,
EuiDataGridToolBarVisibilityOptions,
} from '!!prop-loader!../../../../src/components/datagrid/data_grid_types';

const gridSnippet = `<EuiDataGrid
{...usualProps}
Expand Down Expand Up @@ -163,8 +163,8 @@ export const DataGridStylingExample = {

props: {
EuiDataGrid,
EuiDataGridStyle: DataGridStyle,
EuiDataGridToolbarVisibilityOptions: DataGridToolbarVisibilityOptions,
EuiDataGridStyle,
EuiDataGridToolBarVisibilityOptions,
},
demo: <DataGridStyling />,
},
Expand Down Expand Up @@ -255,7 +255,7 @@ export const DataGridStylingExample = {
snippet: widthsSnippet,
props: {
EuiDataGrid,
EuiDataGridColumn: DataGridColumn,
EuiDataGridColumn,
},
demo: <DataGridColumnWidths />,
},
Expand Down
61 changes: 0 additions & 61 deletions src-docs/src/views/datagrid/props.tsx

This file was deleted.

Loading