@pdg/react-table 1.0.36 → 1.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -9836,7 +9836,25 @@ var Value = material.styled(material.Box)(templateObject_2 || (templateObject_2
9836
9836
  var ValueEllipsis = material.styled('div')(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: relative;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n"], ["\n position: relative;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n"])));
9837
9837
  var templateObject_1, templateObject_2, templateObject_3;var InfoTable = function (_a) {
9838
9838
  var cols = _a.cols, spacing = _a.spacing, className = _a.className, style = _a.style, sx = _a.sx, labelClassName = _a.labelClassName, labelColor = _a.labelColor, labelStyle = _a.labelStyle, labelSx = _a.labelSx, valueClassName = _a.valueClassName, valueStyle = _a.valueStyle, valueSx = _a.valueSx, valueUnderline = _a.valueUnderline, info = _a.info, items = _a.items;
9839
- var xs = React.useMemo(function () { return 12 / cols; }, [cols]);
9839
+ var sizeProps = React.useMemo(function () {
9840
+ var value = {};
9841
+ if (typeof cols === 'number') {
9842
+ value.xs = 12 / cols;
9843
+ }
9844
+ else {
9845
+ if (cols.xs)
9846
+ value.xs = 12 / cols.xs;
9847
+ if (cols.sm)
9848
+ value.sm = 12 / cols.sm;
9849
+ if (cols.md)
9850
+ value.md = 12 / cols.md;
9851
+ if (cols.lg)
9852
+ value.lg = 12 / cols.lg;
9853
+ if (cols.xl)
9854
+ value.xl = 12 / cols.xl;
9855
+ }
9856
+ return value;
9857
+ }, [cols]);
9840
9858
  return (React__default["default"].createElement(material.Grid, { container: true, spacing: spacing, className: classNames('InfoTable', className), style: style, sx: sx }, items.map(function (item, idx) {
9841
9859
  if (item) {
9842
9860
  var finalLabelColor = typographyColorToSxColor(item.labelColor || labelColor);
@@ -9848,7 +9866,7 @@ var templateObject_1, templateObject_2, templateObject_3;var InfoTable = functio
9848
9866
  var data = item.name !== undefined ? info[item.name] : undefined;
9849
9867
  if (item.onRender)
9850
9868
  data = item.onRender(info);
9851
- return (React__default["default"].createElement(material.Grid, { key: idx, item: true, xs: item.xs || xs, className: item.className, style: item.style, sx: item.sx },
9869
+ return (React__default["default"].createElement(material.Grid, __assign$1({ key: idx, item: true }, sizeProps, { className: item.className, style: item.style, sx: item.sx }),
9852
9870
  React__default["default"].createElement(Label, { className: classNames(labelClassName, item.labelClassName), style: __assign$1(__assign$1({}, item.labelStyle), labelStyle), sx: finalLabelSx }, item.label),
9853
9871
  React__default["default"].createElement(Value, { className: classNames(valueClassName, item.valueClassName), style: __assign$1(__assign$1(__assign$1({}, valueStyle), item.valueStyle), valueUnderlineStyle), sx: finalValueSx }, item.ellipsis ? React__default["default"].createElement(ValueEllipsis, null, data) : data)));
9854
9872
  }