plataforma-fundacao-componentes 2.20.28 → 2.21.0

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.
@@ -1,19 +1,19 @@
1
- declare namespace _default {
2
- export const title: string;
3
- export { Input as component };
4
- }
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
5
  export default _default;
6
- export function Primary(): JSX.Element;
7
- export function PrimaryFormat(): JSX.Element;
8
- export function RightObject(): JSX.Element;
9
- export function ButtonLoading(): JSX.Element;
10
- export function Counter(): JSX.Element;
11
- export function CounterAndMaxLength(): JSX.Element;
12
- export function Error(): JSX.Element;
13
- export function Loading(): JSX.Element;
14
- export function LoadingWithValue(): JSX.Element;
15
- export function Disabled(): JSX.Element;
16
- export function DisabledWithValue(): JSX.Element;
17
- export function DisabledAndLoading(): JSX.Element;
18
- export function ForceFocus(): JSX.Element;
19
- import Input from "./Input";
6
+ export declare const Primary: () => JSX.Element;
7
+ export declare const PrimaryFormat: () => JSX.Element;
8
+ export declare const RightObject: () => JSX.Element;
9
+ export declare const ButtonLoading: () => JSX.Element;
10
+ export declare const Counter: () => JSX.Element;
11
+ export declare const CounterAndMaxLength: () => JSX.Element;
12
+ export declare const Error: () => JSX.Element;
13
+ export declare const Loading: () => JSX.Element;
14
+ export declare const LoadingWithValue: () => JSX.Element;
15
+ export declare const Disabled: () => JSX.Element;
16
+ export declare const DisabledWithValue: () => JSX.Element;
17
+ export declare const DisabledAndLoading: () => JSX.Element;
18
+ export declare const ForceFocus: () => JSX.Element;
19
+ export declare const WithValidationState: () => JSX.Element;
@@ -1,13 +1,22 @@
1
1
  import React from 'react';
2
2
  import './Table.scss';
3
- export interface TableProps {
3
+ declare type indexes = string | number;
4
+ declare type AceptedValue = string | React.ReactNode | number;
5
+ export interface TableCell extends React.HTMLAttributes<HTMLTableCellElement> {
6
+ align: 'left' | 'center' | 'right' | 'justify' | 'char';
7
+ }
8
+ export declare type ColumnObject<R extends indexes | undefined = undefined> = {
9
+ key: R extends indexes ? R : indexes;
10
+ value: AceptedValue;
11
+ props?: TableCell;
12
+ };
13
+ export declare type LineObject<R extends indexes | undefined = undefined> = R extends indexes ? {
14
+ [key in R]: AceptedValue;
15
+ } : any;
16
+ interface BasicTableProps {
17
+ columns: unknown[];
18
+ lines?: unknown[];
4
19
  className?: string;
5
- columns?: {
6
- key: string;
7
- value: any;
8
- props?: any;
9
- }[];
10
- lines?: object[];
11
20
  sortable?: boolean;
12
21
  onSort?: (event?: {
13
22
  oldIndex: number;
@@ -25,4 +34,14 @@ export interface TableProps {
25
34
  }[];
26
35
  };
27
36
  }
37
+ export interface TableProps extends BasicTableProps {
38
+ columns: ColumnObject[] | ColumnObject<indexes>[];
39
+ lines?: LineObject[] | LineObject<indexes>[];
40
+ }
41
+ export interface TypedTableProps<R extends indexes> extends BasicTableProps {
42
+ columns: ColumnObject<R>[];
43
+ lines?: LineObject<R>[];
44
+ }
45
+ export declare function TypedTable<R extends indexes>(props: TypedTableProps<R>): JSX.Element;
28
46
  export default function Table(props: TableProps): JSX.Element;
47
+ export {};
@@ -1,12 +1,14 @@
1
- declare namespace _default {
2
- export const title: string;
3
- export { Table as component };
4
- }
1
+ /// <reference types="react" />
2
+ import Table from './Table';
3
+ declare const _default: {
4
+ title: string;
5
+ component: typeof Table;
6
+ };
5
7
  export default _default;
6
- export function Example(): JSX.Element;
7
- export function TableLikeZeplin(): JSX.Element;
8
- export function Draggable(): JSX.Element;
9
- export function ConfirmSort(): JSX.Element;
10
- export function WithActions(): JSX.Element;
11
- export function UpperHeader(): JSX.Element;
12
- import Table from "./Table";
8
+ export declare const Example: () => JSX.Element;
9
+ export declare const TableLikeZeplin: () => JSX.Element;
10
+ export declare const Draggable: () => JSX.Element;
11
+ export declare const ConfirmSort: () => JSX.Element;
12
+ export declare const WithActions: () => JSX.Element;
13
+ export declare const UpperHeader: () => JSX.Element;
14
+ export declare const Typed: () => JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { Dispatch, SetStateAction } from 'react';
2
+ export default function useCallbackedState<T = any>(callback: (newValue: any) => void, initialValue?: T | undefined): [T | undefined, Dispatch<SetStateAction<T | undefined>>];
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { ToastProps } from '../../components/toast/Toast';
3
- interface ToastManagerProps {
3
+ export interface ToastManagerProps {
4
4
  max?: string | number;
5
5
  marginTop?: string | number;
6
6
  verticalPosition?: 'top' | 'bottom';
@@ -9,5 +9,11 @@ interface ToastManagerProps {
9
9
  animateSize?: boolean;
10
10
  pauseOnFocusLoss?: boolean;
11
11
  }
12
- export default function useToastManager(props: ToastManagerProps): [React.ReactNode, (toast: ToastProps) => void, () => void];
13
- export {};
12
+ declare function useToastManager(props: ToastManagerProps): [React.ReactNode, (toast: ToastProps) => void, () => void];
13
+ declare namespace useToastManager {
14
+ var defaultProps: {
15
+ verticalPosition: string;
16
+ horizontalPosition: string;
17
+ };
18
+ }
19
+ export default useToastManager;
@@ -0,0 +1,8 @@
1
+ import { Dispatch, SetStateAction } from 'react';
2
+ export default function useValidatedState<T = any>(validation: (value: T | undefined) => {
3
+ error: boolean;
4
+ text?: string;
5
+ }, initialValue?: T | undefined): [T | undefined, Dispatch<SetStateAction<T | undefined>>, {
6
+ error: boolean;
7
+ text?: string;
8
+ }];
package/dist/index.d.ts CHANGED
@@ -66,7 +66,7 @@ import Select from './components/select/Select';
66
66
  import Switch from './components/switch/Switch';
67
67
  import { ActionsColumn } from './components/table/components/actionsColumn/ActionsColumn';
68
68
  import { LeftCheckboxWithLabel } from './components/table/components/leftCheckboxWithLabel/LeftCheckboxWithLabel';
69
- import Table from './components/table/Table';
69
+ import Table, { TypedTable } from './components/table/Table';
70
70
  import TableActions from './components/tableActions/TableActions';
71
71
  import TableFileNameAndAction from './components/tableFileNameAndAction/TableFileNameAndAction';
72
72
  import TableWithOverflow from './components/tableWithOverflow/TableWithOverflow';
@@ -79,12 +79,14 @@ import TopLoader from './components/topLoader/TopLoader';
79
79
  import VideoItem from './components/videoItem/VideoItem';
80
80
  import VideoModal from './components/videoModal/VideoModal';
81
81
  import VideoPlayer from './components/videoPlayer/VideoPlayer';
82
+ import useCallbackedState from './hooks/useCallbackedState/useCallbackedState';
82
83
  import useCarouselBehaviour from './hooks/useCarouselBehaviour/useCarouselBehaviour';
83
84
  import useDraggableContainer from './hooks/useDraggableContainer/useDraggableContainer';
84
85
  import useModalManager from './hooks/useModalManager/useModalManager';
85
86
  import useProgressiveCount from './hooks/useProgressiveCount/useProgressiveCount';
86
87
  import useTimeElapsed from './hooks/useTimeElapsed/useTimeElapsed';
87
88
  import useToastManager from './hooks/useToastManager/useToastManager';
89
+ import useValidatedState from './hooks/useValidatedState/useValidatedState';
88
90
  export * from './components/modal/ModalTypes';
89
91
  export * from './libraries/BlobFileTypes';
90
92
  export * from './libraries/ButtonTheme';
@@ -100,4 +102,4 @@ export * from './libraries/RadioButtonTheme';
100
102
  export * from './libraries/SicrediLogoThemes';
101
103
  export * from './libraries/Toast';
102
104
  export * from './libraries/Tooltips';
103
- export { Accordion, AdvancedSemiHeader, AssembleiaItem, AssembleiaPauta, Aconteceu, AnimatedLink, Banner, BannerAssembleia, BannerPesquisaCpfCnpj, BigBlockButton, BlocoDeNotas, BreadCrumb, Button, ButtonFileUpload, BlocoMinhasAssembleias, BottomNavigation, Card, Carousel, CarouselPersona, CarouselTouchFrendly, Checkbox, Col, Collapse, Container, DatePicker, Doughnut, DoughnutSquare, DropdownItem, DropdownMenu, EditableVideoItem, ElementPaginator, Etapas, Etiqueta, FileLoader, FileUpload, FooterSicredi, FullHeightContainer, Header, HeaderSeparator, HeaderSearchField, IconButton, IconButtonWithLabel, Information, Input, InputArea, ItemDropdownDownload, InformativoAssembleiasComImagem, InformativoAssembleiasComVideo, Menu, MenuItem, Modal, ModalManager, ModulosTitle, MoneyByMonth, MoneyMonthLineChart, NotaEdit, Notification, PageSubTitle, PageTitle, Paginator, PreviaVideo, ProgressBar, RadioButton, Row, SearchBlocoDeNotas, Select, Switch, Table, TableFileNameAndAction, TableActions, TableWithOverflow, TextEditor, LeftCheckboxWithLabel, ActionsColumn, Toast, ToastManager, Tooltip, TooltipManager, TopLoader, VideoItem, VideoPlayer, VideoModal, useProgressiveCount, useCarouselBehaviour, useDraggableContainer, useTimeElapsed, useModalManager, useToastManager };
105
+ export { Accordion, AdvancedSemiHeader, AssembleiaItem, AssembleiaPauta, Aconteceu, AnimatedLink, Banner, BannerAssembleia, BannerPesquisaCpfCnpj, BigBlockButton, BlocoDeNotas, BreadCrumb, Button, ButtonFileUpload, BlocoMinhasAssembleias, BottomNavigation, Card, Carousel, CarouselPersona, CarouselTouchFrendly, Checkbox, Col, Collapse, Container, DatePicker, Doughnut, DoughnutSquare, DropdownItem, DropdownMenu, EditableVideoItem, ElementPaginator, Etapas, Etiqueta, FileLoader, FileUpload, FooterSicredi, FullHeightContainer, Header, HeaderSeparator, HeaderSearchField, IconButton, IconButtonWithLabel, Information, Input, InputArea, ItemDropdownDownload, InformativoAssembleiasComImagem, InformativoAssembleiasComVideo, Menu, MenuItem, Modal, ModalManager, ModulosTitle, MoneyByMonth, MoneyMonthLineChart, NotaEdit, Notification, PageSubTitle, PageTitle, Paginator, PreviaVideo, ProgressBar, RadioButton, Row, SearchBlocoDeNotas, Select, Switch, Table, TypedTable, TableFileNameAndAction, TableActions, TableWithOverflow, TextEditor, LeftCheckboxWithLabel, ActionsColumn, Toast, ToastManager, Tooltip, TooltipManager, TopLoader, VideoItem, VideoPlayer, VideoModal, useProgressiveCount, useCarouselBehaviour, useDraggableContainer, useTimeElapsed, useModalManager, useToastManager, useCallbackedState, useValidatedState };
package/dist/index.js CHANGED
@@ -563,12 +563,14 @@ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
563
563
 
564
564
  var ReactPropTypesSecret_1 = ReactPropTypesSecret;
565
565
 
566
+ var has = Function.call.bind(Object.prototype.hasOwnProperty);
567
+
566
568
  var printWarning = function() {};
567
569
 
568
570
  if (process.env.NODE_ENV !== 'production') {
569
571
  var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
570
572
  var loggedTypeFailures = {};
571
- var has = Function.call.bind(Object.prototype.hasOwnProperty);
573
+ var has$1 = has;
572
574
 
573
575
  printWarning = function(text) {
574
576
  var message = 'Warning: ' + text;
@@ -580,7 +582,7 @@ if (process.env.NODE_ENV !== 'production') {
580
582
  // This error was thrown as a convenience so that you can use this stack
581
583
  // to find the callsite that caused this warning to fire.
582
584
  throw new Error(message);
583
- } catch (x) {}
585
+ } catch (x) { /**/ }
584
586
  };
585
587
  }
586
588
 
@@ -598,7 +600,7 @@ if (process.env.NODE_ENV !== 'production') {
598
600
  function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
599
601
  if (process.env.NODE_ENV !== 'production') {
600
602
  for (var typeSpecName in typeSpecs) {
601
- if (has(typeSpecs, typeSpecName)) {
603
+ if (has$1(typeSpecs, typeSpecName)) {
602
604
  var error;
603
605
  // Prop type validation may throw. In case they do, we don't want to
604
606
  // fail the render phase where it didn't fail before. So we log it.
@@ -609,7 +611,8 @@ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
609
611
  if (typeof typeSpecs[typeSpecName] !== 'function') {
610
612
  var err = Error(
611
613
  (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
612
- 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
614
+ 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
615
+ 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
613
616
  );
614
617
  err.name = 'Invariant Violation';
615
618
  throw err;
@@ -657,7 +660,6 @@ checkPropTypes.resetWarningCache = function() {
657
660
 
658
661
  var checkPropTypes_1 = checkPropTypes;
659
662
 
660
- var has$1 = Function.call.bind(Object.prototype.hasOwnProperty);
661
663
  var printWarning$1 = function() {};
662
664
 
663
665
  if (process.env.NODE_ENV !== 'production') {
@@ -758,6 +760,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
758
760
  // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
759
761
  var ReactPropTypes = {
760
762
  array: createPrimitiveTypeChecker('array'),
763
+ bigint: createPrimitiveTypeChecker('bigint'),
761
764
  bool: createPrimitiveTypeChecker('boolean'),
762
765
  func: createPrimitiveTypeChecker('function'),
763
766
  number: createPrimitiveTypeChecker('number'),
@@ -803,8 +806,9 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
803
806
  * is prohibitively expensive if they are created too often, such as what
804
807
  * happens in oneOfType() for any type before the one that matched.
805
808
  */
806
- function PropTypeError(message) {
809
+ function PropTypeError(message, data) {
807
810
  this.message = message;
811
+ this.data = data && typeof data === 'object' ? data: {};
808
812
  this.stack = '';
809
813
  }
810
814
  // Make `instanceof Error` still work for returned errors.
@@ -839,7 +843,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
839
843
  ) {
840
844
  printWarning$1(
841
845
  'You are manually calling a React.PropTypes validation ' +
842
- 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
846
+ 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
843
847
  'and will throw in the standalone `prop-types` package. ' +
844
848
  'You may be seeing this warning due to a third-party PropTypes ' +
845
849
  'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
@@ -878,7 +882,10 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
878
882
  // 'of type `object`'.
879
883
  var preciseType = getPreciseType(propValue);
880
884
 
881
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
885
+ return new PropTypeError(
886
+ 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
887
+ {expectedType: expectedType}
888
+ );
882
889
  }
883
890
  return null;
884
891
  }
@@ -992,7 +999,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
992
999
  return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
993
1000
  }
994
1001
  for (var key in propValue) {
995
- if (has$1(propValue, key)) {
1002
+ if (has(propValue, key)) {
996
1003
  var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
997
1004
  if (error instanceof Error) {
998
1005
  return error;
@@ -1022,14 +1029,19 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
1022
1029
  }
1023
1030
 
1024
1031
  function validate(props, propName, componentName, location, propFullName) {
1032
+ var expectedTypes = [];
1025
1033
  for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
1026
1034
  var checker = arrayOfTypeCheckers[i];
1027
- if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret_1) == null) {
1035
+ var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret_1);
1036
+ if (checkerResult == null) {
1028
1037
  return null;
1029
1038
  }
1039
+ if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
1040
+ expectedTypes.push(checkerResult.data.expectedType);
1041
+ }
1030
1042
  }
1031
-
1032
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
1043
+ var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
1044
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
1033
1045
  }
1034
1046
  return createChainableTypeChecker(validate);
1035
1047
  }
@@ -1044,6 +1056,13 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
1044
1056
  return createChainableTypeChecker(validate);
1045
1057
  }
1046
1058
 
1059
+ function invalidValidatorError(componentName, location, propFullName, key, type) {
1060
+ return new PropTypeError(
1061
+ (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
1062
+ 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
1063
+ );
1064
+ }
1065
+
1047
1066
  function createShapeTypeChecker(shapeTypes) {
1048
1067
  function validate(props, propName, componentName, location, propFullName) {
1049
1068
  var propValue = props[propName];
@@ -1053,8 +1072,8 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
1053
1072
  }
1054
1073
  for (var key in shapeTypes) {
1055
1074
  var checker = shapeTypes[key];
1056
- if (!checker) {
1057
- continue;
1075
+ if (typeof checker !== 'function') {
1076
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
1058
1077
  }
1059
1078
  var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
1060
1079
  if (error) {
@@ -1073,16 +1092,18 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
1073
1092
  if (propType !== 'object') {
1074
1093
  return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
1075
1094
  }
1076
- // We need to check all keys in case some are required but missing from
1077
- // props.
1095
+ // We need to check all keys in case some are required but missing from props.
1078
1096
  var allKeys = objectAssign({}, props[propName], shapeTypes);
1079
1097
  for (var key in allKeys) {
1080
1098
  var checker = shapeTypes[key];
1099
+ if (has(shapeTypes, key) && typeof checker !== 'function') {
1100
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
1101
+ }
1081
1102
  if (!checker) {
1082
1103
  return new PropTypeError(
1083
1104
  'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
1084
1105
  '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
1085
- '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
1106
+ '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
1086
1107
  );
1087
1108
  }
1088
1109
  var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
@@ -1258,6 +1279,7 @@ var factoryWithThrowingShims = function() {
1258
1279
  // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
1259
1280
  var ReactPropTypes = {
1260
1281
  array: shim,
1282
+ bigint: shim,
1261
1283
  bool: shim,
1262
1284
  func: shim,
1263
1285
  number: shim,
@@ -9436,6 +9458,9 @@ LeftCheckboxWithLabel.propTypes = {
9436
9458
  };
9437
9459
 
9438
9460
  var rootClassName$1x = 'component-table';
9461
+ function TypedTable(props) {
9462
+ return React__default.createElement(Table, Object.assign({}, props));
9463
+ }
9439
9464
  function Table(props) {
9440
9465
  var _useState = React.useState("table" + getUniqueKey()),
9441
9466
  itemsId = _useState[0];
@@ -9509,13 +9534,13 @@ function Table(props) {
9509
9534
  }, React__default.createElement("span", null, btn.icon), btn.label);
9510
9535
  }) : undefined)) : undefined, React__default.createElement("div", {
9511
9536
  className: rootClassName$1x + "-outer-table"
9512
- }, React__default.createElement("table", Object.assign({}, getProps()), React__default.createElement("thead", null, React__default.createElement("tr", null, React__default.createElement("th", null), props.columns && props.columns.length ? props.columns.map(function (column, columnIndex) {
9537
+ }, React__default.createElement("table", Object.assign({}, getProps()), React__default.createElement("thead", null, React__default.createElement("tr", null, React__default.createElement("th", null), props.columns && props.columns.length ? Array.from(props.columns).map(function (column, columnIndex) {
9513
9538
  return React__default.createElement("th", Object.assign({}, column.props, {
9514
9539
  key: column.key ? column.key : columnIndex
9515
9540
  }), column.value);
9516
9541
  }) : undefined, React__default.createElement("th", null))), React__default.createElement("tbody", {
9517
9542
  id: itemsId
9518
- }, React__default.createElement("tr", null), props.lines && props.lines.length ? props.lines.map(function (line, index) {
9543
+ }, React__default.createElement("tr", null), props.lines && props.lines.length ? Array.from(props.lines).map(function (line, index) {
9519
9544
  var key = line.key ? line.key : index;
9520
9545
  delete line.key;
9521
9546
  var lineProps = line.props ? line.props : {};
@@ -9760,11 +9785,11 @@ function TableWithOverflow(props) {
9760
9785
  }, React__default.createElement("table", {
9761
9786
  id: fakeId,
9762
9787
  className: rootClassName$1A + "-fake-table"
9763
- }, React__default.createElement("thead", null, React__default.createElement("tr", null, React__default.createElement("th", null), props.columns && props.columns.length ? props.columns.map(function (column, columnIndex) {
9788
+ }, React__default.createElement("thead", null, React__default.createElement("tr", null, React__default.createElement("th", null), props.columns && props.columns.length ? Array.from(props.columns).map(function (column, columnIndex) {
9764
9789
  return React__default.createElement("th", Object.assign({}, column.props, {
9765
9790
  key: column.key ? column.key : columnIndex
9766
9791
  }), column.value);
9767
- }) : undefined, React__default.createElement("th", null))), React__default.createElement("tbody", null, React__default.createElement("tr", null), props.lines && props.lines.length ? props.lines.map(function (line, index) {
9792
+ }) : undefined, React__default.createElement("th", null))), React__default.createElement("tbody", null, React__default.createElement("tr", null), props.lines && props.lines.length ? Array.from(props.lines).map(function (line, index) {
9768
9793
  var key = line.key ? line.key : index;
9769
9794
  delete line.key;
9770
9795
  var lineProps = line.props ? line.props : {};
@@ -9795,7 +9820,7 @@ function TableWithOverflow(props) {
9795
9820
  className: rootClassName$1A + "-left"
9796
9821
  }, React__default.createElement("div", {
9797
9822
  className: rootClassName$1A + "-header"
9798
- }, props.columns && props.columns.length ? props.columns.slice(0, 2).map(function (column, index) {
9823
+ }, props.columns && props.columns.length ? Array.from(props.columns).slice(0, 2).map(function (column, index) {
9799
9824
  return React__default.createElement("div", Object.assign({
9800
9825
  key: index
9801
9826
  }, column.props, {
@@ -9806,7 +9831,7 @@ function TableWithOverflow(props) {
9806
9831
  }), column.value);
9807
9832
  }) : undefined), React__default.createElement("div", {
9808
9833
  className: rootClassName$1A + "-body"
9809
- }, props.lines && props.lines.length ? props.lines.map(function (line, index) {
9834
+ }, props.lines && props.lines.length ? Array.from(props.lines).map(function (line, index) {
9810
9835
  var _props$columns$, _props$columns$2;
9811
9836
 
9812
9837
  return React__default.createElement("div", {
@@ -9825,7 +9850,7 @@ function TableWithOverflow(props) {
9825
9850
  className: rootClassName$1A + "-mid"
9826
9851
  }, React__default.createElement("div", {
9827
9852
  className: rootClassName$1A + "-header"
9828
- }, props.columns && props.columns.length ? props.columns.map(function (column, index) {
9853
+ }, props.columns && props.columns.length ? Array.from(props.columns).map(function (column, index) {
9829
9854
  return React__default.createElement("div", Object.assign({
9830
9855
  key: index
9831
9856
  }, column.props, {
@@ -9833,7 +9858,7 @@ function TableWithOverflow(props) {
9833
9858
  }), column.value);
9834
9859
  }).slice(2, props.columns.length - 1) : undefined), React__default.createElement("div", {
9835
9860
  className: rootClassName$1A + "-body"
9836
- }, props.lines && props.lines.length ? props.lines.map(function (line, lineIndex) {
9861
+ }, props.lines && props.lines.length ? Array.from(props.lines).map(function (line, lineIndex) {
9837
9862
  return React__default.createElement("div", {
9838
9863
  key: lineIndex,
9839
9864
  className: rootClassName$1A + "-row"
@@ -9849,7 +9874,7 @@ function TableWithOverflow(props) {
9849
9874
  className: rootClassName$1A + "-right"
9850
9875
  }, React__default.createElement("div", {
9851
9876
  className: rootClassName$1A + "-header"
9852
- }, props.columns && props.columns.length ? props.columns.map(function (column, index) {
9877
+ }, props.columns && props.columns.length ? Array.from(props.columns).map(function (column, index) {
9853
9878
  return React__default.createElement("div", Object.assign({
9854
9879
  key: index
9855
9880
  }, column.props, {
@@ -9883,7 +9908,7 @@ function TableWithOverflow(props) {
9883
9908
  }
9884
9909
  })) : undefined), React__default.createElement("div", {
9885
9910
  className: rootClassName$1A + "-body"
9886
- }, props.lines && props.lines.length ? props.lines.map(function (line, lineIndex) {
9911
+ }, props.lines && props.lines.length ? Array.from(props.lines).map(function (line, lineIndex) {
9887
9912
  return React__default.createElement("div", {
9888
9913
  key: lineIndex,
9889
9914
  className: rootClassName$1A + "-row"
@@ -11262,6 +11287,17 @@ VideoModal.defaultProps = {
11262
11287
  size: 'md'
11263
11288
  };
11264
11289
 
11290
+ function useCallbackedState(callback, initialValue) {
11291
+ var _useState = React.useState(initialValue),
11292
+ value = _useState[0],
11293
+ setValue = _useState[1];
11294
+
11295
+ React.useEffect(function () {
11296
+ callback(value);
11297
+ }, [value]);
11298
+ return [value, setValue];
11299
+ }
11300
+
11265
11301
  var rootClassName$1$ = 'comp-modal-manager';
11266
11302
  var maskRootClassName$1 = 'component-modal-mask';
11267
11303
 
@@ -11382,6 +11418,11 @@ function useToastManager(props) {
11382
11418
  arrayOfToast = _useState[0],
11383
11419
  setArrayOfToast = _useState[1];
11384
11420
 
11421
+ var verticalPosition = (props === null || props === void 0 ? void 0 : props.verticalPosition) || 'top';
11422
+ var horizontalPosition = (props === null || props === void 0 ? void 0 : props.horizontalPosition) || 'right';
11423
+ var max = (props === null || props === void 0 ? void 0 : props.max) || undefined;
11424
+ var reverse = (props === null || props === void 0 ? void 0 : props.reverse) || false;
11425
+ var animateSize = (props === null || props === void 0 ? void 0 : props.animateSize) || false;
11385
11426
  var closeById = React.useCallback(function (id) {
11386
11427
  var arr = arrayOfToast.filter(function (a) {
11387
11428
  return a.id !== id;
@@ -11403,25 +11444,25 @@ function useToastManager(props) {
11403
11444
  id: id
11404
11445
  }, toast);
11405
11446
 
11406
- if (!props.max || arrayOfToast.length < props.max) {
11447
+ if (!max || arrayOfToast.length < max) {
11407
11448
  arr.push(obj);
11408
11449
  setArrayOfToast(arr);
11409
11450
  count$1++;
11410
11451
  }
11411
- }, [props.max, arrayOfToast]);
11452
+ }, [max, arrayOfToast]);
11412
11453
  var clearToast = React.useCallback(function () {
11413
11454
  setArrayOfToast([]);
11414
11455
  }, []);
11415
11456
  var classNames = React.useMemo(function () {
11416
- return getMergedClassNames([rootClassName$20 + "-toasts", rootClassName$20 + "-" + props.verticalPosition, rootClassName$20 + "-" + props.horizontalPosition, props.reverse ? rootClassName$20 + "-reverse" : '', props.animateSize ? rootClassName$20 + "-animate-size" : '']);
11417
- }, [props.reverse, props.animateSize, props.horizontalPosition, props.verticalPosition]);
11457
+ return getMergedClassNames([rootClassName$20 + "-toasts", rootClassName$20 + "-" + verticalPosition, rootClassName$20 + "-" + horizontalPosition, reverse ? rootClassName$20 + "-reverse" : '', animateSize ? rootClassName$20 + "-animate-size" : '']);
11458
+ }, [reverse, animateSize, horizontalPosition, verticalPosition]);
11418
11459
  React.useLayoutEffect(function () {
11419
11460
  var wrapper = document.querySelector("." + rootClassName$20 + "-toasts");
11420
11461
 
11421
11462
  if (wrapper && wrapper.childElementCount > 0) {
11422
11463
  var somaDasAlturas = 0;
11423
11464
 
11424
- if (props.verticalPosition === 'top' && !props.reverse) {
11465
+ if (verticalPosition === 'top' && !reverse) {
11425
11466
  somaDasAlturas = 12;
11426
11467
 
11427
11468
  for (var i = 0; i < wrapper.children.length; i++) {
@@ -11432,7 +11473,7 @@ function useToastManager(props) {
11432
11473
  somaDasAlturas += el.getBoundingClientRect().height + 12;
11433
11474
  }
11434
11475
  }
11435
- } else if (props.verticalPosition === 'top') {
11476
+ } else if (verticalPosition === 'top') {
11436
11477
  for (var _i = wrapper.children.length - 1; _i >= 0; _i--) {
11437
11478
  var _el = wrapper.children[_i];
11438
11479
 
@@ -11441,7 +11482,7 @@ function useToastManager(props) {
11441
11482
  _el.style.transform = "translateY(" + somaDasAlturas + "px)";
11442
11483
  }
11443
11484
  }
11444
- } else if (props.verticalPosition === 'bottom' && !props.reverse) {
11485
+ } else if (verticalPosition === 'bottom' && !reverse) {
11445
11486
  for (var _i2 = 0; _i2 < wrapper.children.length; _i2++) {
11446
11487
  var _el2 = wrapper.children[_i2];
11447
11488
 
@@ -11463,7 +11504,7 @@ function useToastManager(props) {
11463
11504
  }
11464
11505
  }
11465
11506
  }
11466
- }, [arrayOfToast, props.reverse, props.verticalPosition]);
11507
+ }, [arrayOfToast, reverse, verticalPosition]);
11467
11508
  return [React__default.createElement(React__default.Fragment, null, React__default.createElement(reactTransitionGroup.TransitionGroup, {
11468
11509
  className: classNames
11469
11510
  }, arrayOfToast.map(function (toast) {
@@ -11485,10 +11526,22 @@ function useToastManager(props) {
11485
11526
  showActionButton: toast.showActionButton,
11486
11527
  onActionButtonClick: toast.onActionButtonClick,
11487
11528
  actionButtonText: toast.actionButtonText,
11488
- pauseOnFocusLoss: props.pauseOnFocusLoss
11529
+ pauseOnFocusLoss: props === null || props === void 0 ? void 0 : props.pauseOnFocusLoss
11489
11530
  })));
11490
11531
  }))), showToast, clearToast];
11491
11532
  }
11533
+ useToastManager.defaultProps = {
11534
+ verticalPosition: 'top',
11535
+ horizontalPosition: 'right'
11536
+ };
11537
+
11538
+ function useValidatedState(validation, initialValue) {
11539
+ var _useState = React.useState(initialValue),
11540
+ value = _useState[0],
11541
+ setValue = _useState[1];
11542
+
11543
+ return [value, setValue, validation(value)];
11544
+ }
11492
11545
 
11493
11546
  function AlertModal(props) {
11494
11547
  var getProps = function getProps() {
@@ -11739,14 +11792,17 @@ exports.ToastManager = ToastManager;
11739
11792
  exports.Tooltip = Tooltip;
11740
11793
  exports.TooltipManager = TooltipManager;
11741
11794
  exports.TopLoader = TopLoader;
11795
+ exports.TypedTable = TypedTable;
11742
11796
  exports.VideoItem = VideoItem;
11743
11797
  exports.VideoModal = VideoModal;
11744
11798
  exports.VideoPlayer = VideoPlayer;
11745
11799
  exports.getStatusClassName = getStatusClassName;
11800
+ exports.useCallbackedState = useCallbackedState;
11746
11801
  exports.useCarouselBehaviour = useCarouselBehaviour;
11747
11802
  exports.useDraggableContainer = useDraggableContainer;
11748
11803
  exports.useModalManager = useModalManager;
11749
11804
  exports.useProgressiveCount = useProgressiveCount;
11750
11805
  exports.useTimeElapsed = useTimeElapsed;
11751
11806
  exports.useToastManager = useToastManager;
11807
+ exports.useValidatedState = useValidatedState;
11752
11808
  //# sourceMappingURL=index.js.map