MCPcopy Create free account
hub / github.com/bvaughn/react-virtualized / getFlexStyleForColumn

Function getFlexStyleForColumn

lib/components/Table/Table.tsx:69–91  ·  view source on GitHub ↗

Determines the flex-shrink, flex-grow, and width values for a cell (header or column).

(
  column: ColumnPropsWithDefaults,
  customStyle: CSSProperties = {}
)

Source from the content-addressed store, hash-verified

67
68/** Determines the flex-shrink, flex-grow, and width values for a cell (header or column). */
69function getFlexStyleForColumn(
70 column: ColumnPropsWithDefaults,
71 customStyle: CSSProperties = {}
72): CSSProperties {
73 const flexValue = `${column.flexGrow} ${column.flexShrink} ${column.width}px`;
74
75 const style: CSSProperties = {
76 ...customStyle,
77 flex: flexValue,
78 msFlex: flexValue,
79 WebkitFlex: flexValue
80 };
81
82 if (column.maxWidth) {
83 style.maxWidth = column.maxWidth;
84 }
85
86 if (column.minWidth) {
87 style.minWidth = column.minWidth;
88 }
89
90 return style;
91}
92
93// Callbacks read by the (stable) Grid event handlers.
94// They are updated in an insertion effect, so they are current when the Grid calls them during its commit phase.

Callers 2

Table.tsxFile · 0.85
createHeaderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected