MCPcopy Index your code
hub / github.com/reactstrap/reactstrap / getColumnClasses

Function getColumnClasses

src/Col.js:51–92  ·  view source on GitHub ↗
(attributes, cssModule, widths = colWidths)

Source from the content-addressed store, hash-verified

49};
50
51export const getColumnClasses = (attributes, cssModule, widths = colWidths) => {
52 const modifiedAttributes = attributes;
53 const colClasses = [];
54
55 widths.forEach((colWidth, i) => {
56 let columnProp = modifiedAttributes[colWidth];
57
58 delete modifiedAttributes[colWidth];
59
60 if (!columnProp && columnProp !== '') {
61 return;
62 }
63
64 const isXs = !i;
65
66 if (isObject(columnProp)) {
67 const colSizeInterfix = isXs ? '-' : `-${colWidth}-`;
68 const colClass = getColumnSizeClass(isXs, colWidth, columnProp.size);
69
70 colClasses.push(
71 mapToCssModules(
72 classNames({
73 [colClass]: columnProp.size || columnProp.size === '',
74 [`order${colSizeInterfix}${columnProp.order}`]:
75 columnProp.order || columnProp.order === 0,
76 [`offset${colSizeInterfix}${columnProp.offset}`]:
77 columnProp.offset || columnProp.offset === 0,
78 }),
79 cssModule,
80 ),
81 );
82 } else {
83 const colClass = getColumnSizeClass(isXs, colWidth, columnProp);
84 colClasses.push(colClass);
85 }
86 });
87
88 return {
89 colClasses,
90 modifiedAttributes,
91 };
92};
93
94function Col(props) {
95 const {

Callers 3

PlaceholderButtonFunction · 0.90
PlaceholderFunction · 0.90
ColFunction · 0.85

Calls 3

isObjectFunction · 0.90
mapToCssModulesFunction · 0.90
getColumnSizeClassFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…