@pdg/react-table 1.0.72 → 1.0.73

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
@@ -4607,13 +4607,15 @@ TableMenuButton.defaultProps = TableMenuButtonDefaultProps;var InfoTableDefaultP
4607
4607
  spacing: 2,
4608
4608
  rowSpacing: 3,
4609
4609
  labelColor: 'primary',
4610
+ dividerColor: 'gray',
4610
4611
  };var Label = material.styled(material.Box)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-size: 12px;\n font-weight: bold;\n"], ["\n font-size: 12px;\n font-weight: bold;\n"])));
4611
4612
  var ValueWrap = material.styled(material.Box)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin-top: 3px;\n position: relative;\n display: flex;\n flex-direction: row;\n"], ["\n margin-top: 3px;\n position: relative;\n display: flex;\n flex-direction: row;\n"])));
4612
4613
  var Value = material.styled('div')(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex: 1;\n"], ["\n flex: 1;\n"])));
4613
4614
  var ValueEllipsis = material.styled('div')(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n flex: 1;\n position: relative;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n"], ["\n flex: 1;\n position: relative;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n"])));
4614
4615
  var ValueClipboard = material.styled('div')(templateObject_5 || (templateObject_5 = __makeTemplateObject([""], [""])));
4615
4616
  var ClipboardIconButton = material.styled(material.IconButton)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n margin-top: -10px;\n margin-bottom: -10px;\n"], ["\n margin-top: -10px;\n margin-bottom: -10px;\n"])));
4616
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;var Component = {};var toggleSelection = function () {
4617
+ var Line = material.styled('div')(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n border-top: 1px solid #efefef;\n height: 1px;\n flex: 1;\n"], ["\n border-top: 1px solid #efefef;\n height: 1px;\n flex: 1;\n"])));
4618
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;var Component = {};var toggleSelection = function () {
4617
4619
  var selection = document.getSelection();
4618
4620
  if (!selection.rangeCount) {
4619
4621
  return function () {};
@@ -4878,7 +4880,7 @@ _defineProperty(CopyToClipboard$1, "defaultProps", {
4878
4880
 
4879
4881
  CopyToClipboard.CopyToClipboard = CopyToClipboard;
4880
4882
  var lib = CopyToClipboard;var InfoTable = function (_a) {
4881
- var cols = _a.cols, spacing = _a.spacing, columnSpacing = _a.columnSpacing, rowSpacing = _a.rowSpacing, 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, ellipsis = _a.ellipsis, valueUnderline = _a.valueUnderline, info = _a.info, items = _a.items, onCopyToClipboard = _a.onCopyToClipboard;
4883
+ var cols = _a.cols, spacing = _a.spacing, columnSpacing = _a.columnSpacing, rowSpacing = _a.rowSpacing, className = _a.className, style = _a.style, sx = _a.sx, labelClassName = _a.labelClassName, labelColor = _a.labelColor, labelStyle = _a.labelStyle, labelSx = _a.labelSx, dividerColor = _a.dividerColor, valueClassName = _a.valueClassName, valueStyle = _a.valueStyle, valueSx = _a.valueSx, ellipsis = _a.ellipsis, valueUnderline = _a.valueUnderline, info = _a.info, items = _a.items, onCopyToClipboard = _a.onCopyToClipboard;
4882
4884
  var sizeProps = React.useMemo(function () {
4883
4885
  var value = {};
4884
4886
  if (typeof cols === 'number') {
@@ -4900,7 +4902,7 @@ var lib = CopyToClipboard;var InfoTable = function (_a) {
4900
4902
  }, [cols]);
4901
4903
  return (React.createElement(material.Grid, { container: true, spacing: spacing, columnSpacing: columnSpacing, rowSpacing: rowSpacing, className: classNames('InfoTable', className), style: style, sx: sx }, items.map(function (item, idx) {
4902
4904
  if (item) {
4903
- var finalLabelColor = typographyColorToSxColor(item.labelColor || labelColor);
4905
+ var finalLabelColor = typographyColorToSxColor(item.type === 'divider' ? item.dividerColor || dividerColor : item.labelColor || labelColor);
4904
4906
  var finalLabelSx = combineSx(labelSx, item.labelSx, !!finalLabelColor && { color: finalLabelColor });
4905
4907
  var finalValueSx = combineSx(valueSx, item.valueSx);
4906
4908
  var valueUnderlineStyle = valueUnderline
@@ -5015,8 +5017,15 @@ var lib = CopyToClipboard;var InfoTable = function (_a) {
5015
5017
  if (empty(data))
5016
5018
  data = item.onRenderEmpty ? item.onRenderEmpty(info) : React.createElement(React.Fragment, null, "\u00A0");
5017
5019
  var copyToClipboardText_1 = item.clipboardText || (typeof data === 'string' ? data : typeof data === 'number' ? data.toString() : '');
5018
- return (React.createElement(material.Grid, __assign$3({ key: idx, item: true }, finalSizeProps, { className: item.className, style: item.style, sx: item.sx }),
5019
- React.createElement(Label, { className: classNames(labelClassName, item.labelClassName), style: __assign$3(__assign$3({}, item.labelStyle), labelStyle), sx: finalLabelSx }, item.label),
5020
+ return item.type === 'divider' ? (React.createElement(material.Grid, { key: idx, item: true, xs: 12 },
5021
+ React.createElement(material.Stack, { direction: 'row', spacing: 0.5, alignItems: 'center' },
5022
+ item.icon && (React.createElement(reactForm.FormIcon, { sx: { color: item.dividerColor || dividerColor }, fontSize: 'small' }, item.icon)),
5023
+ item.label && (React.createElement(Label, { className: classNames(labelClassName, item.labelClassName), style: __assign$3(__assign$3({}, item.labelStyle), labelStyle), sx: finalLabelSx }, item.label)),
5024
+ item.dividerLine && (React.createElement(React.Fragment, null, item.icon || item.label ? (React.createElement("div", { style: { flex: 1, paddingLeft: 5 } },
5025
+ React.createElement(Line, null))) : (React.createElement(Line, null))))))) : (React.createElement(material.Grid, __assign$3({ key: idx, item: true }, finalSizeProps, { className: item.className, style: item.style, sx: item.sx }),
5026
+ React.createElement(material.Stack, { direction: 'row', spacing: 0.5, alignItems: 'center' },
5027
+ item.icon && (React.createElement(reactForm.FormIcon, { sx: { color: finalLabelColor }, fontSize: 'small' }, "CalendarMonth")),
5028
+ React.createElement(Label, { className: classNames(labelClassName, item.labelClassName), style: __assign$3(__assign$3({}, item.labelStyle), labelStyle), sx: finalLabelSx }, item.label)),
5020
5029
  React.createElement(ValueWrap, { className: classNames(valueClassName, item.valueClassName), style: __assign$3(__assign$3(__assign$3({}, valueStyle), item.valueStyle), valueUnderlineStyle), sx: finalValueSx },
5021
5030
  item.ellipsis || ellipsis ? React.createElement(ValueEllipsis, null, data) : React.createElement(Value, null, data),
5022
5031
  item.clipboard && notEmpty(copyToClipboardText_1) && (React.createElement(ValueClipboard, null,