plataforma-fundacao-componentes 2.22.14 → 2.22.17

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.
@@ -1342,7 +1342,7 @@ function Checkbox(props) {
1342
1342
  var fProps = useMemo(function () {
1343
1343
  var handleClick = function handleClick(evt) {
1344
1344
  if (typeof props.onChange === 'function' && !props.disabled) {
1345
- props.onChange(!props.value);
1345
+ props.onChange(!props.value, evt);
1346
1346
  evt.stopPropagation();
1347
1347
  }
1348
1348
  };
@@ -9599,7 +9599,7 @@ var LeftCheckboxWithLabel = function LeftCheckboxWithLabel(props) {
9599
9599
  var _props$spanProps3;
9600
9600
 
9601
9601
  if (props.anchorLabelToCheckbox) {
9602
- props.onChange(!props.value);
9602
+ props.onChange(!props.value, evt);
9603
9603
  }
9604
9604
 
9605
9605
  if (props.spanProps && typeof props.spanProps.onClick === 'function') (_props$spanProps3 = props.spanProps) === null || _props$spanProps3 === void 0 ? void 0 : _props$spanProps3.onClick(evt);
@@ -9891,38 +9891,49 @@ function TableUpperHeader(props) {
9891
9891
  }, React.createElement("div", {
9892
9892
  className: rootClassName$1A + "-left"
9893
9893
  }, (_props$leftContent = props.leftContent) === null || _props$leftContent === void 0 ? void 0 : _props$leftContent.map(function (btn, i) {
9894
- return btn.type === 'Button' ? React.createElement("button", Object.assign({
9895
- key: i
9896
- }, btn, {
9894
+ return btn.type === 'Button' ? React.createElement("button", {
9895
+ key: i,
9896
+ id: btn.id,
9897
+ onClick: btn.onClick,
9897
9898
  disabled: !props.active || (btn === null || btn === void 0 ? void 0 : btn.disabled) || false,
9898
- type: 'button',
9899
- className: rootClassName$1A + "-btn"
9900
- }), btn.leftIcon && React.createElement("span", null, btn.leftIcon), btn.label, btn.rightIcon && React.createElement("span", null, btn.rightIcon)) : React.createElement(DropdownMenu, Object.assign({}, btn, {
9901
- key: i
9902
- }), React.createElement("button", Object.assign({
9899
+ className: rootClassName$1A + "-btn",
9900
+ type: 'button'
9901
+ }, btn.leftIcon && React.createElement("span", null, btn.leftIcon), btn.label, btn.rightIcon && React.createElement("span", null, btn.rightIcon)) : React.createElement(DropdownMenu, Object.assign({}, btn, {
9903
9902
  key: i
9904
- }, btn.children, {
9903
+ }), React.createElement("button", {
9904
+ key: i,
9905
+ id: btn.children.id,
9906
+ onClick: btn.children.onClick,
9905
9907
  className: rootClassName$1A + "-btn",
9906
9908
  disabled: !props.active || (btn === null || btn === void 0 ? void 0 : btn.children.disabled) || false,
9907
9909
  type: 'button'
9908
- }), btn.children.leftIcon && React.createElement("span", null, btn.children.leftIcon), btn.children.label, btn.children.rightIcon && React.createElement("span", null, btn.children.rightIcon)));
9910
+ }, btn.children.leftIcon && React.createElement("span", null, btn.children.leftIcon), btn.children.label, btn.children.rightIcon && React.createElement("span", null, btn.children.rightIcon)));
9909
9911
  })), React.createElement("div", {
9910
9912
  className: rootClassName$1A + "-right"
9911
9913
  }, (_props$rightContent = props.rightContent) === null || _props$rightContent === void 0 ? void 0 : _props$rightContent.map(function (btn, i) {
9912
- return btn.type === 'Button' ? React.createElement("button", Object.assign({
9913
- key: i
9914
- }, btn, {
9914
+ return btn.type === 'Button' ? React.createElement("button", {
9915
+ key: i,
9916
+ id: btn.id,
9917
+ onClick: btn.onClick,
9915
9918
  disabled: !props.active || (btn === null || btn === void 0 ? void 0 : btn.disabled) || false,
9916
9919
  className: rootClassName$1A + "-btn",
9917
9920
  type: 'button'
9918
- }), btn.leftIcon && React.createElement("span", null, btn.leftIcon), btn.label, btn.rightIcon && React.createElement("span", null, btn.rightIcon)) : React.createElement(DropdownMenu, Object.assign({}, btn), React.createElement("button", Object.assign({
9919
- key: i
9920
- }, btn.children, {
9921
+ }, btn.leftIcon && React.createElement("span", null, btn.leftIcon), btn.label, btn.rightIcon && React.createElement("span", null, btn.rightIcon)) : React.createElement(DropdownMenu, Object.assign({}, btn, {
9922
+ key: "children_" + i
9923
+ }), React.createElement("button", {
9924
+ key: i,
9925
+ id: btn.children.id,
9926
+ onClick: btn.children.onClick,
9921
9927
  disabled: !props.active || (btn === null || btn === void 0 ? void 0 : btn.children.disabled) || false,
9922
9928
  className: rootClassName$1A + "-btn",
9923
9929
  type: 'button'
9924
- }), btn.children.leftIcon && React.createElement("span", null, btn.children.leftIcon), btn.children.label, btn.children.rightIcon && React.createElement("span", null, btn.children.rightIcon)));
9925
- })));
9930
+ }, btn.children.leftIcon && React.createElement("span", null, btn.children.leftIcon), btn.children.label, btn.children.rightIcon && React.createElement("span", null, btn.children.rightIcon)));
9931
+ })), props.collapsedContent ? React.createElement(Collapse$1, {
9932
+ opened: props.opened,
9933
+ animateOpacity: true
9934
+ }, React.createElement(Row$1, {
9935
+ className: rootClassName$1A + "-collapsed"
9936
+ }, props.collapsedContent)) : undefined);
9926
9937
  }
9927
9938
 
9928
9939
  var TableUpperHeader$1 = memo(TableUpperHeader);
@@ -9934,8 +9945,8 @@ function TableWithOverflow(props) {
9934
9945
 
9935
9946
  var mediaQuery = useScreenSize();
9936
9947
  var wrapperClassName = useMemo(function () {
9937
- return getMergedClassNames([rootClassName$1B + "-wrapper", props.hasActionsCol ? 'has-actions-col' : '', props.upperHeader ? 'has-upper-header' : '', 'left-columns-padding']);
9938
- }, [props.hasActionsCol, props.upperHeader]);
9948
+ return getMergedClassNames([rootClassName$1B + "-wrapper", props.upperHeader ? 'has-upper-header' : '', 'left-columns-padding']);
9949
+ }, [props.upperHeader]);
9939
9950
  var outerTableRef = createRef();
9940
9951
  useDraggableScroll(outerTableRef, {
9941
9952
  mouseDownCondition: function mouseDownCondition(el) {
@@ -9960,22 +9971,27 @@ function TableWithOverflow(props) {
9960
9971
  }
9961
9972
  };
9962
9973
 
9974
+ var atLeastOneStaticColumn = useMemo(function () {
9975
+ return props.columns.some(function (c) {
9976
+ return !c.absolute;
9977
+ });
9978
+ }, [props.columns]);
9963
9979
  var paddingLeft = useMemo(function () {
9964
- return props.columns.reduce(function (prev, atual) {
9980
+ return atLeastOneStaticColumn ? props.columns.reduce(function (prev, atual) {
9965
9981
  var _atual$absolute;
9966
9982
 
9967
9983
  var n = (_atual$absolute = atual.absolute) !== null && _atual$absolute !== void 0 && _atual$absolute.left ? parseInt(atual.absolute.width) : 0;
9968
9984
  return prev + n;
9969
- }, 8) + "px";
9970
- }, [props.columns]);
9985
+ }, 8) + "px" : '8px';
9986
+ }, [props.columns, atLeastOneStaticColumn]);
9971
9987
  var paddingRight = useMemo(function () {
9972
- return props.columns.reduce(function (prev, atual) {
9988
+ return atLeastOneStaticColumn ? props.columns.reduce(function (prev, atual) {
9973
9989
  var _atual$absolute2;
9974
9990
 
9975
9991
  var n = (_atual$absolute2 = atual.absolute) !== null && _atual$absolute2 !== void 0 && _atual$absolute2.right ? parseInt(atual.absolute.width) : 0;
9976
9992
  return prev + n;
9977
- }, 8) + "px";
9978
- }, [props.columns]);
9993
+ }, 8) + "px" : '8px';
9994
+ }, [props.columns, atLeastOneStaticColumn]);
9979
9995
  return React.createElement("div", {
9980
9996
  className: rootClassName$1B
9981
9997
  }, props.upperHeader ? React.createElement("div", {
@@ -10006,12 +10022,13 @@ function TableWithOverflow(props) {
10006
10022
  }), (_props$columns = props.columns) === null || _props$columns === void 0 ? void 0 : _props$columns.map(function (column) {
10007
10023
  var _column$props;
10008
10024
 
10025
+ var absoluteObj = atLeastOneStaticColumn && column.absolute ? column.absolute : {};
10009
10026
  return React.createElement("th", Object.assign({
10010
10027
  key: "header-" + column.key,
10011
- "data-draggable": !Boolean(column.absolute)
10028
+ "data-draggable": atLeastOneStaticColumn && !Boolean(absoluteObj)
10012
10029
  }, column.props, {
10013
- style: _extends({}, (_column$props = column.props) === null || _column$props === void 0 ? void 0 : _column$props.style, column.absolute),
10014
- className: getMergedClassNames([column.key + "-cell", column.absolute ? 'absolute' : ''])
10030
+ style: _extends({}, (_column$props = column.props) === null || _column$props === void 0 ? void 0 : _column$props.style, absoluteObj),
10031
+ className: getMergedClassNames([column.key + "-cell", atLeastOneStaticColumn && column.absolute ? 'absolute' : ''])
10015
10032
  }), column.value);
10016
10033
  }), React.createElement("th", {
10017
10034
  className: 'absolute right-0'
@@ -10027,12 +10044,13 @@ function TableWithOverflow(props) {
10027
10044
  }), (_props$columns2 = props.columns) === null || _props$columns2 === void 0 ? void 0 : _props$columns2.map(function (column) {
10028
10045
  var _column$props2, _column$props3;
10029
10046
 
10047
+ var absoluteObj = atLeastOneStaticColumn && column.absolute ? column.absolute : {};
10030
10048
  return React.createElement("td", Object.assign({
10031
- "data-draggable": !Boolean(column.absolute),
10049
+ "data-draggable": atLeastOneStaticColumn && !Boolean(column.absolute),
10032
10050
  key: lineIndex + "-" + column.key
10033
10051
  }, column.props, {
10034
- style: _extends({}, (_column$props2 = column.props) === null || _column$props2 === void 0 ? void 0 : _column$props2.style, column.absolute),
10035
- className: getMergedClassNames([(_column$props3 = column.props) === null || _column$props3 === void 0 ? void 0 : _column$props3.className, column.key + "-cell", column.absolute ? 'absolute' : ''])
10052
+ style: _extends({}, (_column$props2 = column.props) === null || _column$props2 === void 0 ? void 0 : _column$props2.style, absoluteObj),
10053
+ className: getMergedClassNames([(_column$props3 = column.props) === null || _column$props3 === void 0 ? void 0 : _column$props3.className, column.key + "-cell", atLeastOneStaticColumn && column.absolute ? 'absolute' : ''])
10036
10054
  }), line[column.key]);
10037
10055
  }), React.createElement("td", {
10038
10056
  className: 'absolute right-0'
@@ -10041,8 +10059,6 @@ function TableWithOverflow(props) {
10041
10059
  }
10042
10060
 
10043
10061
  TableWithOverflow.defaultProps = {
10044
- showArrowControl: true,
10045
- hasActionsCol: true,
10046
10062
  showTopNavigator: true
10047
10063
  };
10048
10064
  var TableWithOverflow$1 = memo(TableWithOverflow);