{"size": 1649, "ext": "js", "max_stars_repo_path": "packages/patternfly-3/patternfly-react/src/components/Table/Stories/InlineEditColumnTableStory.js", "max_stars_repo_name": "pfbreakaway/patternfly-react", "max_stars_repo_stars_event_min_datetime": "2021-03-03T13:49:19.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-03T13:49:19.000Z", "max_issues_repo_path": "packages/patternfly-3/patternfly-react/src/components/Table/Stories/InlineEditColumnTableStory.js", "max_issues_repo_name": "pfbreakaway/patternfly-react", "max_issues_repo_issues_event_min_datetime": "2018-09-20T14:55:38.000Z", "max_issues_repo_issues_event_max_datetime": "2018-11-15T15:19:36.000Z", "max_forks_repo_path": "packages/patternfly-3/patternfly-react/src/components/Table/Stories/InlineEditColumnTableStory.js", "max_forks_repo_name": "pfbreakaway/patternfly-react", "max_forks_repo_forks_event_min_datetime": "2019-10-27T08:59:12.000Z", "max_forks_repo_forks_event_max_datetime": "2019-10-27T08:59:12.000Z"}
{"max_stars_count": 1, "max_issues_count": 21, "max_forks_count": 1, "avg_line_length": 30.537037037, "max_line_length": 116, "alphanum_fraction": 0.6925409339}
import React from 'react';
import { withInfo } from '@storybook/addon-info';
import { withKnobs, boolean } from '@storybook/addon-knobs';
import { MockInlineEditColumnTable, mockInlineEditColumnTableSource } from '../__mocks__/mockInlineEditColumnTable';
import {
  actionHeaderCellFormatter,
  customHeaderFormattersDefinition,
  sortableHeaderCellFormatter,
  tableCellFormatter,
  Table
} from '../index';
import { inlineTemplate } from 'storybook/decorators/storyTemplates';
import { DOCUMENTATION_URL } from 'storybook/constants/siteConstants';
import { reactabularDescription } from './tableStoryDescriptions';

/**
 * Inline Edit Column Table stories
 */
const inlineEditColumnTable = stories => {
  stories.addDecorator(withKnobs);
  stories.add(
    'Table With Inline Edit Column',
    withInfo({
      source: false,
      propTablesExclude: [MockInlineEditColumnTable],
      propTables: [
        Table.Cell,
        Table.Heading,
        Table.PfProvider,
        actionHeaderCellFormatter,
        customHeaderFormattersDefinition,
        sortableHeaderCellFormatter,
        tableCellFormatter
      ],
      text: (
        <div>
          <h1>Story Source</h1>
          <pre>{mockInlineEditColumnTableSource}</pre>
        </div>
      )
    })(() => {
      const story = <MockInlineEditColumnTable fullTableEdit={boolean('Edit whole table', true)} />;
      return inlineTemplate({
        title: 'Table With Inline Edit Column',
        documentationLink: DOCUMENTATION_URL.PATTERNFLY_ORG_INLINE_EDIT,
        story,
        description: reactabularDescription
      });
    })
  );
};

export default inlineEditColumnTable;
