How to use the @patternfly/react-styles/css/components/Table/table.modifiers function in @patternfly/react-styles

To help you get started, we’ve selected a few @patternfly/react-styles examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github patternfly / patternfly-react / packages / patternfly-4 / react-table / src / components / Table / utils / decorators / compoundExpand.tsx View on Github external
const {
    extraParams: { onExpand }
  } = column;
  const extraData = {
    rowIndex,
    columnIndex,
    column,
    property
  };

  function onToggle(event: React.MouseEvent) {
    // tslint:disable-next-line:no-unused-expression
    onExpand && onExpand(event, rowIndex, columnIndex, props.isOpen, rowData, extraData);
  }
  return {
    className: css(styles.tableCompoundExpansionToggle, props.isOpen && styles.modifiers.expanded),
    children: props.isOpen !== undefined && (
      <button aria-controls="{props.ariaControls}" aria-expanded="{props.isOpen}">
        {title}
      </button>
    )
  };
};
github patternfly / patternfly-react / packages / patternfly-4 / react-table / src / components / Table / utils / decorators / classNames.ts View on Github external
import { css, pickProperties } from '@patternfly/react-styles';
import styles from '@patternfly/react-styles/css/components/Table/table';
import { ITransform } from '../../Table';

export const Visibility = pickProperties(styles.modifiers, [
  'hidden',
  'hiddenOnSm',
  'hiddenOnMd',
  'hiddenOnLg',
  'hiddenOnXl',
  'hiddenOn_2xl',
  'visibleOnSm',
  'visibleOnMd',
  'visibleOnLg',
  'visibleOnXl',
  'visibleOn_2xl'
]);

// tslint:disable-next-line:no-shadowed-variable
export const classNames = (...classNames: string[]): ITransform => () => ({
  className: css(...classNames)
github patternfly / patternfly-react / packages / patternfly-4 / react-table / src / components / Table / BodyCell.tsx View on Github external
colSpan,
  component = 'td',
  isVisible,
  parentId,
  textCenter = false,
  isOpen,
  ariaControls = '',
  ...props
}: BodyCellProps) =&gt; {
  const Component = component as any;
  const mappedProps = {
    ...(dataLabel ? { 'data-label': dataLabel } : {}),
    ...props
  };
  return (parentId !== undefined &amp;&amp; colSpan === undefined) || !isVisible ? null : (
    
  );
};
github patternfly / patternfly-react / packages / patternfly-4 / react-table / src / components / Table / BodyWrapper.js View on Github external
{mapOpenedRows(mappedRows, this.props.children).map((oneRow, key) =&gt; (
            
              {oneRow.rows}
            
          ))}
github patternfly / patternfly-react / packages / patternfly-4 / react-table / src / components / Table / HeaderCell.js View on Github external
const HeaderCell = ({
  'data-label': dataLabel,
  className,
  component: Component,
  isVisible,
  scope,
  textCenter,
  ...props
}) =&gt; {
  const mappedProps = {
    ...(scope ? { scope } : {}),
    ...props
  };
  return ;
};
github patternfly / patternfly-react / packages / patternfly-4 / react-table / src / components / Table / CollapseColumn.tsx View on Github external
export const CollapseColumn: React.FunctionComponent = ({
  className = '' as string,
  children = null as React.ReactNode,
  isOpen,
  onToggle,
  ...props
}: CollapseColumnProps) =&gt; {
  return (
    
      {isOpen !== undefined &amp;&amp; (
        <button aria-expanded="{isOpen}" aria-label="Details">
          
        </button>
      )}
      {children}
    
  );
};
github patternfly / patternfly-react / packages / patternfly-4 / react-table / src / components / Table / Table.tsx View on Github external
wrapper: bodyWrapper || BodyWrapper,
              row: rowWrapper || RowWrapper,
              cell: BodyCell
            },
            header: {
              cell: HeaderCell
            }
          }}
          columns={headerData}
          role={role}
          className={css(
            styles.table,
            gridBreakPoint &amp;&amp; getModifier(stylesGrid, gridBreakPoint),
            getModifier(styles, variant),
            ((onCollapse &amp;&amp; variant === TableVariant.compact) || onExpand) &amp;&amp; styles.modifiers.expandable,
            variant === TableVariant.compact &amp;&amp; borders === false ? styles.modifiers.noBorderRows : null,
            className
          )}
          {...ouiaContext.isOuia &amp;&amp; {
            'data-ouia-component-type': 'Table',
            'data-ouia-component-id': ouiaId || ouiaContext.ouiaId
          }}
        &gt;
          {caption &amp;&amp; {caption}}
          {children}
        
      
    );
  }
}
github patternfly / patternfly-react / packages / patternfly-4 / react-table / src / components / Table / HeaderCell.tsx View on Github external
export const HeaderCell: React.FunctionComponent = ({
  className = '',
  component = 'th',
  isVisible,
  scope = '',
  textCenter = false,
  dataLabel = '',
  ...props
}: HeaderCellProps) =&gt; {
  const Component = component as any;
  const mappedProps = {
    ...(scope ? { scope } : {}),
    ...props
  };
  return ;
};
github patternfly / patternfly-react / packages / patternfly-4 / react-table / src / components / Table / BodyCell.js View on Github external
className,
  colSpan,
  component: Component,
  isVisible,
  parentId,
  textCenter,
  isOpen,
  ariaControls,
  ...props
}) =&gt; {
  const mappedProps = {
    ...(dataLabel ? { 'data-label': dataLabel } : {}),
    ...props
  };
  return (parentId !== undefined &amp;&amp; colSpan === undefined) || !isVisible ? null : (
    
  );
};
github patternfly / patternfly-react / packages / patternfly-4 / react-table / src / components / Table / RowWrapper.tsx View on Github external
onResize,
      row: { isExpanded, isHeightAuto },
      rowProps,
      ouiaContext,
      ouiaId,
      ...props
    } = this.props;

    return (
      }
        className={css(
          className,
          isExpanded !== undefined &amp;&amp; styles.tableExpandableRow,
          isExpanded &amp;&amp; styles.modifiers.expanded,
          isHeightAuto &amp;&amp; styles.modifiers.heightAuto
        )}
        hidden={isExpanded !== undefined &amp;&amp; !isExpanded}
        {...ouiaContext.isOuia &amp;&amp; {
          'data-ouia-component-type': 'TableRow',
          'data-ouia-component-id': ouiaId || ouiaContext.ouiaId
        }}
      /&gt;
    );
  }
}