plataforma-fundacao-componentes 2.22.17 → 2.22.20

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.
@@ -20,4 +20,5 @@ declare namespace Checkbox {
20
20
  onChange: () => void;
21
21
  };
22
22
  }
23
- export default Checkbox;
23
+ declare const _default: React.MemoExoticComponent<typeof Checkbox>;
24
+ export default _default;
@@ -19,6 +19,7 @@ interface TableWithOverflowProps {
19
19
  showTopNavigator?: boolean;
20
20
  columns: ColumnObject[];
21
21
  lines?: any[];
22
+ noResultMessage?: string;
22
23
  }
23
24
  declare function TableWithOverflow(props: TableWithOverflowProps): JSX.Element;
24
25
  declare namespace TableWithOverflow {
package/dist/index.css CHANGED
@@ -15531,6 +15531,22 @@ tr:first-child th:last-child {
15531
15531
  right: 0;
15532
15532
  width: 8px;
15533
15533
  height: 44px; } }
15534
+ .component-table-with-overflow .component-table-with-overflow-wrapper.no-result {
15535
+ padding-bottom: 44px; }
15536
+ .component-table-with-overflow .component-table-with-overflow-no-result {
15537
+ -webkit-user-select: none;
15538
+ -moz-user-select: none;
15539
+ -ms-user-select: none;
15540
+ user-select: none;
15541
+ position: absolute;
15542
+ left: 0;
15543
+ width: 100%;
15544
+ display: flex;
15545
+ align-items: center;
15546
+ justify-content: center;
15547
+ background-color: #fefefe;
15548
+ border-radius: 8px;
15549
+ min-height: 44px; }
15534
15550
 
15535
15551
  @import url("https://fonts.googleapis.com/css2?family=Exo+2:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");
15536
15552
  @import url("https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200;0,300;0,400;0,600;0,700;0,800;0,900;1,200;1,300;1,400;1,600;1,700;1,800;1,900&display=swap");
package/dist/index.js CHANGED
@@ -1335,6 +1335,7 @@ var TrashIcon = function TrashIcon() {
1335
1335
  })(exports.CheckboxThemes || (exports.CheckboxThemes = {}));
1336
1336
 
1337
1337
  var rootClassName$s = 'component-checkbox';
1338
+
1338
1339
  function Checkbox(props) {
1339
1340
  var fProps = React.useMemo(function () {
1340
1341
  var handleClick = function handleClick(evt) {
@@ -1363,12 +1364,14 @@ function Checkbox(props) {
1363
1364
 
1364
1365
  return React__default.createElement("button", Object.assign({}, fProps));
1365
1366
  }
1367
+
1366
1368
  Checkbox.defaultProps = {
1367
1369
  disabled: false,
1368
1370
  value: false,
1369
1371
  theme: 'primary',
1370
1372
  onChange: function onChange() {}
1371
1373
  };
1374
+ var Checkbox$1 = React.memo(Checkbox);
1372
1375
 
1373
1376
  var rootClassName$t = 'component-bloco-de-notas';
1374
1377
  function BlocoDeNotas(props) {
@@ -1404,7 +1407,7 @@ function BlocoDeNotas(props) {
1404
1407
  className: rootClassName$t + "-left-content"
1405
1408
  }, React__default.createElement("div", {
1406
1409
  className: rootClassName$t + "-checkbox"
1407
- }, React__default.createElement(Checkbox, {
1410
+ }, React__default.createElement(Checkbox$1, {
1408
1411
  disabled: props.loading || !props.notas || !props.notas.length,
1409
1412
  theme: exports.CheckboxThemes.Blue,
1410
1413
  value: Boolean(props.notas && props.notas.length && props.notas.length === props.selected.length),
@@ -1472,7 +1475,7 @@ function BlocoDeNotas(props) {
1472
1475
  className: rootClassName$t + "-nota-left-content"
1473
1476
  }, React__default.createElement("div", {
1474
1477
  className: rootClassName$t + "-checkbox"
1475
- }, React__default.createElement(Checkbox, {
1478
+ }, React__default.createElement(Checkbox$1, {
1476
1479
  theme: exports.CheckboxThemes.Blue,
1477
1480
  value: nota.id ? props.selected.indexOf(nota.id) > -1 : false,
1478
1481
  onChange: function onChange(evt) {
@@ -9245,7 +9248,7 @@ function Select(props) {
9245
9248
  }
9246
9249
  },
9247
9250
  onClick: handleChange
9248
- }, React__default.createElement(Checkbox, {
9251
+ }, React__default.createElement(Checkbox$1, {
9249
9252
  value: checked,
9250
9253
  disabled: props.readOnly,
9251
9254
  onChange: function onChange() {
@@ -9568,7 +9571,7 @@ var LeftCheckboxWithLabel = function LeftCheckboxWithLabel(props) {
9568
9571
  className: rootClassName$1w + "-checkbox-wrapper",
9569
9572
  "tooltip-position": props['tooltip-position'],
9570
9573
  "tooltip-text": props['tooltip-text']
9571
- }, React__default.createElement(Checkbox, {
9574
+ }, React__default.createElement(Checkbox$1, {
9572
9575
  value: props.value,
9573
9576
  disabled: props.disabled,
9574
9577
  onChange: props.onChange,
@@ -9922,12 +9925,12 @@ var TableUpperHeader$1 = React.memo(TableUpperHeader);
9922
9925
  var rootClassName$1B = 'component-table-with-overflow';
9923
9926
 
9924
9927
  function TableWithOverflow(props) {
9925
- var _props$columns, _props$lines;
9928
+ var _props$lines;
9926
9929
 
9927
9930
  var mediaQuery = useScreenSize();
9928
9931
  var wrapperClassName = React.useMemo(function () {
9929
- return getMergedClassNames([rootClassName$1B + "-wrapper", props.upperHeader ? 'has-upper-header' : '', 'left-columns-padding']);
9930
- }, [props.upperHeader]);
9932
+ return getMergedClassNames([rootClassName$1B + "-wrapper", props.upperHeader ? 'has-upper-header' : '', props.noResultMessage && !props.lines.length ? 'no-result' : '', 'left-columns-padding']);
9933
+ }, [props.upperHeader, props.lines, props.noResultMessage]);
9931
9934
  var outerTableRef = React.createRef();
9932
9935
  useDraggableScroll(outerTableRef, {
9933
9936
  mouseDownCondition: function mouseDownCondition(el) {
@@ -9973,6 +9976,25 @@ function TableWithOverflow(props) {
9973
9976
  return prev + n;
9974
9977
  }, 8) + "px" : '8px';
9975
9978
  }, [props.columns, atLeastOneStaticColumn]);
9979
+ var renderKey = React.useMemo(function () {
9980
+ return getUniqueKey();
9981
+ }, [props.lines]);
9982
+ var columnsHeader = React.useMemo(function () {
9983
+ var _props$columns;
9984
+
9985
+ return (_props$columns = props.columns) === null || _props$columns === void 0 ? void 0 : _props$columns.map(function (column) {
9986
+ var _column$props;
9987
+
9988
+ var absoluteObj = atLeastOneStaticColumn && column.absolute ? column.absolute : {};
9989
+ return React__default.createElement("th", Object.assign({
9990
+ key: "header-" + column.key,
9991
+ "data-draggable": atLeastOneStaticColumn && !Boolean(column.absolute)
9992
+ }, column.props, {
9993
+ style: _extends({}, (_column$props = column.props) === null || _column$props === void 0 ? void 0 : _column$props.style, absoluteObj),
9994
+ className: getMergedClassNames([column.key + "-cell", atLeastOneStaticColumn && column.absolute ? 'absolute' : ''])
9995
+ }), column.value);
9996
+ });
9997
+ }, [props.columns, renderKey]);
9976
9998
  return React__default.createElement("div", {
9977
9999
  className: rootClassName$1B
9978
10000
  }, props.upperHeader ? React__default.createElement("div", {
@@ -10000,24 +10022,14 @@ function TableWithOverflow(props) {
10000
10022
  ref: outerTableRef
10001
10023
  }, React__default.createElement("table", null, React__default.createElement("thead", null, React__default.createElement("tr", null, React__default.createElement("th", {
10002
10024
  className: 'absolute left-0'
10003
- }), (_props$columns = props.columns) === null || _props$columns === void 0 ? void 0 : _props$columns.map(function (column) {
10004
- var _column$props;
10005
-
10006
- var absoluteObj = atLeastOneStaticColumn && column.absolute ? column.absolute : {};
10007
- return React__default.createElement("th", Object.assign({
10008
- key: "header-" + column.key,
10009
- "data-draggable": atLeastOneStaticColumn && !Boolean(absoluteObj)
10010
- }, column.props, {
10011
- style: _extends({}, (_column$props = column.props) === null || _column$props === void 0 ? void 0 : _column$props.style, absoluteObj),
10012
- className: getMergedClassNames([column.key + "-cell", atLeastOneStaticColumn && column.absolute ? 'absolute' : ''])
10013
- }), column.value);
10014
- }), React__default.createElement("th", {
10025
+ }), columnsHeader, React__default.createElement("th", {
10015
10026
  className: 'absolute right-0'
10016
10027
  })), React__default.createElement("tr", null)), React__default.createElement("tbody", null, (_props$lines = props.lines) === null || _props$lines === void 0 ? void 0 : _props$lines.map(function (line, lineIndex) {
10017
10028
  var _props$columns2;
10018
10029
 
10030
+ var k = line.key ? line.key : lineIndex;
10019
10031
  return React__default.createElement("tr", {
10020
- key: lineIndex,
10032
+ key: k,
10021
10033
  "aria-disabled": line.disabled || false
10022
10034
  }, React__default.createElement("td", {
10023
10035
  "data-draggable": false,
@@ -10028,7 +10040,7 @@ function TableWithOverflow(props) {
10028
10040
  var absoluteObj = atLeastOneStaticColumn && column.absolute ? column.absolute : {};
10029
10041
  return React__default.createElement("td", Object.assign({
10030
10042
  "data-draggable": atLeastOneStaticColumn && !Boolean(column.absolute),
10031
- key: lineIndex + "-" + column.key
10043
+ key: k + "-" + column.key
10032
10044
  }, column.props, {
10033
10045
  style: _extends({}, (_column$props2 = column.props) === null || _column$props2 === void 0 ? void 0 : _column$props2.style, absoluteObj),
10034
10046
  className: getMergedClassNames([(_column$props3 = column.props) === null || _column$props3 === void 0 ? void 0 : _column$props3.className, column.key + "-cell", atLeastOneStaticColumn && column.absolute ? 'absolute' : ''])
@@ -10036,7 +10048,9 @@ function TableWithOverflow(props) {
10036
10048
  }), React__default.createElement("td", {
10037
10049
  className: 'absolute right-0'
10038
10050
  }));
10039
- }))))));
10051
+ })))), props.noResultMessage && !props.lines.length ? React__default.createElement("div", {
10052
+ className: rootClassName$1B + "-no-result"
10053
+ }, props.noResultMessage) : undefined));
10040
10054
  }
10041
10055
 
10042
10056
  TableWithOverflow.defaultProps = {
@@ -10632,7 +10646,7 @@ function TextEditorUrlCreator(props) {
10632
10646
  onEnter: handleSubmit
10633
10647
  })), /*#__PURE__*/React__default.createElement(Row$1, {
10634
10648
  className: rootClassName$1U + "-new-tab-row"
10635
- }, /*#__PURE__*/React__default.createElement(Checkbox, {
10649
+ }, /*#__PURE__*/React__default.createElement(Checkbox$1, {
10636
10650
  value: newTab,
10637
10651
  onChange: function onChange(value) {
10638
10652
  return setNewTab(value);
@@ -11917,7 +11931,7 @@ exports.Card = Card;
11917
11931
  exports.Carousel = Carousel;
11918
11932
  exports.CarouselPersona = CarouselPersona$1;
11919
11933
  exports.CarouselTouchFrendly = CarouselTouchFrendly$1;
11920
- exports.Checkbox = Checkbox;
11934
+ exports.Checkbox = Checkbox$1;
11921
11935
  exports.Col = Col$1;
11922
11936
  exports.Collapse = Collapse$1;
11923
11937
  exports.ConfirmModal = ConfirmModal;