Download material-table/src/utils/common-values.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 820 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/material-table/src/utils/common-values.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/material-table/src/utils/common-values.js
-
curl -L -o common-values.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/material-table/src/utils/common-values.js
820 Bytes
| export const elementSize = (props) => | |
| props.options.padding === "default" ? "medium" : "small"; | |
| export const baseIconSize = (props) => | |
| elementSize(props) === "medium" ? 48 : 32; | |
| export const rowActions = (props) => | |
| props.actions.filter((a) => a.position === "row" || typeof a === "function"); | |
| export const actionsColumnWidth = (props) => | |
| rowActions(props).length * baseIconSize(props); | |
| export const selectionMaxWidth = (props, maxTreeLevel) => | |
| baseIconSize(props) + 9 * maxTreeLevel; | |
| export const reducePercentsInCalc = (calc, fullValue) => { | |
| const captureGroups = calc.match(/(\d*)%/); | |
| if (captureGroups && captureGroups.length > 1) { | |
| const percentage = captureGroups[1]; | |
| return calc.replace(/\d*%/, `${fullValue * (percentage / 100)}px`); | |
| } | |
| return calc.replace(/\d*%/, `${fullValue}px`); | |
| }; | |