@tsed/react-formio 2.1.4 → 2.2.1

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.
@@ -264,6 +264,7 @@ function Pagination(props) {
264
264
  pageOptions,
265
265
  pageSize,
266
266
  setPageSize,
267
+ totalLength,
267
268
  i18n = f => f
268
269
  } = props;
269
270
  const pageNumbers = getPageNumbers({
@@ -322,8 +323,13 @@ function Pagination(props) {
322
323
  }), /*#__PURE__*/React.createElement("span", {
323
324
  className: "ml-3"
324
325
  }, i18n("items per page"))), pageOptions && /*#__PURE__*/React.createElement("li", {
325
- className: "mb-3 flex items-center"
326
- }, /*#__PURE__*/React.createElement("span", null, i18n("Page"), "\xA0"), /*#__PURE__*/React.createElement("strong", null, pageIndex + 1, " of ", pageOptions.length)));
326
+ className: "mb-3 mr-3 flex items-center"
327
+ }, /*#__PURE__*/React.createElement("span", null, i18n("Page"), "\xA0"), /*#__PURE__*/React.createElement("strong", null, pageIndex + 1, " of ", pageOptions.length), totalLength !== undefined && /*#__PURE__*/React.createElement("span", {
328
+ className: "ml-3"
329
+ }, i18n("Totals"), ": ", /*#__PURE__*/React.createElement("strong", null, new Intl.NumberFormat(undefined).format(totalLength)), " ", i18n("items"))), totalLength !== undefined && /*#__PURE__*/React.createElement("li", {
330
+ className: "mb-3 flex items-center",
331
+ "data-testid": "pagination-total-items"
332
+ }, i18n("Totals"), ": ", /*#__PURE__*/React.createElement("strong", null, new Intl.NumberFormat(undefined).format(totalLength)), " ", i18n("items")));
327
333
  }
328
334
 
329
335
  function DefaultArrowSort({
@@ -688,7 +694,7 @@ function useOperations({
688
694
  };
689
695
  }
690
696
 
691
- const _excluded$9 = ["children", "className", "columns", "data", "onChange", "onClick", "onDrag", "onDrop", "operations", "pageSizes", "filters", "filterId", "pageSize", "pageIndex", "sortBy", "isLoading", "disableFilters", "disablePagination", "ArrowSort", "ColumnFilter", "EmptyData", "Loader", "Pagination", "Row", "CellHeader", "CellOperations", "i18n"];
697
+ const _excluded$9 = ["children", "className", "columns", "data", "onChange", "onClick", "onDrag", "onDrop", "operations", "pageSizes", "filters", "filterId", "pageSize", "pageIndex", "totalLength", "sortBy", "isLoading", "disableFilters", "disablePagination", "ArrowSort", "ColumnFilter", "EmptyData", "Loader", "Pagination", "Row", "CellHeader", "CellOperations", "i18n"];
692
698
  function getOperationCallback(operations, onClick) {
693
699
  return (data, action) => {
694
700
  const operation = operations.find(operation => operation.action === action || operation.alias === action);
@@ -724,6 +730,7 @@ function useCustomTable(props) {
724
730
  filterId: controlledFilterId,
725
731
  pageSize: controlledPageSize,
726
732
  pageIndex: controlledPageIndex,
733
+ totalLength,
727
734
  sortBy: controlledSortBy,
728
735
  isLoading,
729
736
  disableFilters,
@@ -813,6 +820,7 @@ function useCustomTable(props) {
813
820
  pageIndex,
814
821
  pageSize,
815
822
  pageSizes,
823
+ totalLength,
816
824
  setPageSize,
817
825
  i18n,
818
826
  children,
@@ -840,6 +848,7 @@ function Table(props) {
840
848
  pageSize,
841
849
  pageSizes,
842
850
  setPageSize,
851
+ totalLength,
843
852
  i18n,
844
853
  enableDragNDrop,
845
854
  children,
@@ -878,6 +887,7 @@ function Table(props) {
878
887
  })) : null), isLoading ? /*#__PURE__*/React.createElement(Loader, null) : null, !data.length ? /*#__PURE__*/React.createElement(EmptyData, null) : null, !isLoading && data.length && !disablePagination ? /*#__PURE__*/React.createElement("div", {
879
888
  className: "overflow-hidden"
880
889
  }, /*#__PURE__*/React.createElement(Pagination, _extends({}, tableInstance, {
890
+ totalLength: totalLength,
881
891
  className: "text-sm",
882
892
  pageIndex: pageIndex,
883
893
  pageSize: pageSize,
@@ -7411,5 +7421,5 @@ function mapPagination({
7411
7421
  };
7412
7422
  }
7413
7423
 
7414
- export { ActionsTable, Alert, ButtonTab, Card, DefaultArrowSort, DefaultCell, DefaultCellHeader, DefaultCellOperations, DefaultColumnFilter, DefaultOperationButton, Form, FormAccess, FormAction, FormBuilder, FormControl, FormEdit, FormEditCTAs, FormParameters, FormSettings, FormsTable, InputTags, InputText, Loader, Modal, Pagination, ReactComponent, RemoveModal, Select, SelectColumnFilter, SliderColumnFilter, SubmissionsTable, Table, Tabs, callLast, defaultDisplayChoices, getOperationCallback, iconClass, mapPagination, stopPropagationWrapper, useCustomTable, useForm, useFormEdit, useModal, useOperations, useTooltip };
7424
+ export { ActionsTable, Alert, ButtonTab, Card, DefaultArrowSort, DefaultCell, DefaultCellHeader, DefaultCellOperations, DefaultColumnFilter, DefaultOperationButton, Form, FormAccess, FormAction, FormBuilder, FormControl, FormEdit, FormEditCTAs, FormParameters, FormSettings, FormsTable, InputTags, InputText, LEFT_PAGE, Loader, Modal, Pagination, RIGHT_PAGE, ReactComponent, RemoveModal, Select, SelectColumnFilter, SliderColumnFilter, SubmissionsTable, Table, Tabs, callLast, defaultDisplayChoices, getOperationCallback, getPageNumbers, iconClass, mapFormToColumns, mapPagination, stopPropagationWrapper, swapElements, useCustomTable, useForm, useFormEdit, useModal, useOperations, useTooltip };
7415
7425
  //# sourceMappingURL=index.modern.js.map