@addsign/moje-agenda-shared-lib 1.0.46 → 1.0.48

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.
@@ -1447,10 +1447,6 @@ video {
1447
1447
  --tw-bg-opacity: 1;
1448
1448
  background-color: rgb(229 231 235 / var(--tw-bg-opacity));
1449
1449
  }
1450
- .bg-gray-300 {
1451
- --tw-bg-opacity: 1;
1452
- background-color: rgb(209 213 219 / var(--tw-bg-opacity));
1453
- }
1454
1450
  .bg-gray-50 {
1455
1451
  --tw-bg-opacity: 1;
1456
1452
  background-color: rgb(249 250 251 / var(--tw-bg-opacity));
@@ -2112,9 +2108,6 @@ video {
2112
2108
  .opacity-25 {
2113
2109
  opacity: 0.25;
2114
2110
  }
2115
- .opacity-50 {
2116
- opacity: 0.5;
2117
- }
2118
2111
  .opacity-75 {
2119
2112
  opacity: 0.75;
2120
2113
  }
@@ -1,5 +1,5 @@
1
1
  import { jsx, Fragment, jsxs } from "react/jsx-runtime";
2
- import { useState, useMemo, useEffect, useCallback } from "react";
2
+ import { useRef, useState, useMemo, useEffect, useCallback } from "react";
3
3
  import '../../assets/tailwind.css';/* empty css */
4
4
  import Button from "../Button.js";
5
5
  import { g as MdOutlineFilterAlt, h as MdOutlineFilterAltOff, i as MdSearch, f as MdClose, j as MdArrowBack, k as MdArrowForward, l as MdArrowUpward, m as MdArrowDownward } from "../../index-B4OkVXmW.js";
@@ -21705,7 +21705,8 @@ function DataTableServer({
21705
21705
  filters,
21706
21706
  selectedItemKey = "id"
21707
21707
  }) {
21708
- var _a, _b, _c;
21708
+ var _a, _b;
21709
+ const abortControllerRef = useRef(null);
21709
21710
  const [itemsPerPageLocal, setItemsPerPageLocal] = useState();
21710
21711
  const federationContext = useFederationContext();
21711
21712
  const [data, setData] = useState();
@@ -21723,12 +21724,12 @@ function DataTableServer({
21723
21724
  const [showColFilters, setShowColFilters] = useState();
21724
21725
  const [sortConfig, setSortConfig] = useState(null);
21725
21726
  const createDataPageable = (response, itemsPerPage) => {
21726
- var _a2, _b2, _c2, _d, _e, _f, _g;
21727
+ var _a2, _b2, _c, _d, _e, _f, _g;
21727
21728
  return {
21728
21729
  content: response.data.content || response.data,
21729
21730
  empty: ((_a2 = response.data) == null ? void 0 : _a2.content) ? response.data.empty : true,
21730
21731
  first: ((_b2 = response.data) == null ? void 0 : _b2.content) ? response.data.first : true,
21731
- last: ((_c2 = response.data) == null ? void 0 : _c2.content) ? response.data.last : true,
21732
+ last: ((_c = response.data) == null ? void 0 : _c.content) ? response.data.last : true,
21732
21733
  number: ((_d = response.data) == null ? void 0 : _d.content) ? response.data.number : 0,
21733
21734
  numberOfElements: response.data.numberOfElements || response.data.length,
21734
21735
  size: ((_e = response.data) == null ? void 0 : _e.size) || itemsPerPage,
@@ -21757,6 +21758,11 @@ function DataTableServer({
21757
21758
  ]);
21758
21759
  useEffect(() => {
21759
21760
  if (reloadData) {
21761
+ if (abortControllerRef.current) {
21762
+ abortControllerRef.current.abort();
21763
+ }
21764
+ abortControllerRef.current = new AbortController();
21765
+ const currentAbortController = abortControllerRef.current;
21760
21766
  if (currentPage === void 0)
21761
21767
  return;
21762
21768
  setIsLoading(true);
@@ -21770,6 +21776,8 @@ function DataTableServer({
21770
21776
  {}
21771
21777
  );
21772
21778
  federationContext.apiClient.get(url, {
21779
+ signal: currentAbortController.signal,
21780
+ // Pass the AbortController signal to the request
21773
21781
  params: {
21774
21782
  ...filteredMergedFilters,
21775
21783
  pageSize: itemsPerPageLocal,
@@ -21785,20 +21793,24 @@ function DataTableServer({
21785
21793
  setData(dataPageable);
21786
21794
  setIsLoading(false);
21787
21795
  }).catch((error) => {
21788
- console.error("Error fetching data:", error);
21789
- handleErrors(error, federationContext.emitter);
21790
- setData({
21791
- content: [],
21792
- empty: true,
21793
- first: true,
21794
- last: true,
21795
- number: 0,
21796
- numberOfElements: 0,
21797
- size: itemsPerPageLocal || 10,
21798
- totalElements: 0,
21799
- totalPages: 1
21800
- });
21801
- setIsLoading(false);
21796
+ if (error.code === "ERR_CANCELED") {
21797
+ console.log("Request was aborted");
21798
+ } else {
21799
+ console.error("Error fetching data:", error);
21800
+ handleErrors(error, federationContext.emitter);
21801
+ setData({
21802
+ content: [],
21803
+ empty: true,
21804
+ first: true,
21805
+ last: true,
21806
+ number: 0,
21807
+ numberOfElements: 0,
21808
+ size: itemsPerPageLocal || 10,
21809
+ totalElements: 0,
21810
+ totalPages: 1
21811
+ });
21812
+ setIsLoading(false);
21813
+ }
21802
21814
  });
21803
21815
  setReloadData(false);
21804
21816
  }
@@ -22230,8 +22242,7 @@ function DataTableServer({
22230
22242
  )
22231
22243
  )
22232
22244
  ] }) }),
22233
- data && (data == null ? void 0 : data.content) && (data == null ? void 0 : data.content.length) > 0 && /* @__PURE__ */ jsxs("tbody", { className: "relative", children: [
22234
- isLoading && /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-gray-300 opacity-50 z-50", children: /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-[500px]", children: /* @__PURE__ */ jsx(Spinner, {}) }) }) }) }),
22245
+ !isLoading && data && (data == null ? void 0 : data.content) && (data == null ? void 0 : data.content.length) > 0 && /* @__PURE__ */ jsxs("tbody", { className: "relative", children: [
22235
22246
  data.content.map((item, rowIndex) => /* @__PURE__ */ jsxs(
22236
22247
  "tr",
22237
22248
  {
@@ -22306,8 +22317,8 @@ function DataTableServer({
22306
22317
  "td-nodata"
22307
22318
  ) }, "tr-nodata")
22308
22319
  ] }),
22309
- isLoading && (!data || ((_b = data == null ? void 0 : data.content) == null ? void 0 : _b.length) === 0) && /* @__PURE__ */ jsx("tbody", { className: "relative", children: /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan: 100, children: /* @__PURE__ */ jsx("div", { className: "w-full flex items-center justify-center h-[500px] py-2", children: /* @__PURE__ */ jsx(Spinner, {}) }) }) }) }),
22310
- !isLoading && (!data || ((_c = data == null ? void 0 : data.content) == null ? void 0 : _c.length) === 0) && /* @__PURE__ */ jsx("tbody", { className: "relative h-[440px]", children: /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan: 100, children: /* @__PURE__ */ jsx("div", { className: "w-full flex items-center justify-center h-full py-2 text-gray-600 font-medium text-xs ", children: "Žádná data" }) }) }) })
22320
+ isLoading && /* @__PURE__ */ jsx("tbody", { className: "relative", children: /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan: 100, children: /* @__PURE__ */ jsx("div", { className: "w-full flex items-center justify-center h-[500px] py-2", children: /* @__PURE__ */ jsx(Spinner, {}) }) }) }) }),
22321
+ !isLoading && (!data || ((_b = data == null ? void 0 : data.content) == null ? void 0 : _b.length) === 0) && /* @__PURE__ */ jsx("tbody", { className: "relative h-[440px]", children: /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan: 100, children: /* @__PURE__ */ jsx("div", { className: "w-full flex items-center justify-center h-full py-2 text-gray-600 font-medium text-xs ", children: "Žádná data" }) }) }) })
22311
22322
  ] }, tableKey) }),
22312
22323
  /* @__PURE__ */ jsxs("div", { className: "w-full p-5 flex gap-5 justify-between", children: [
22313
22324
  /* @__PURE__ */ jsxs("div", { className: "flex gap-5 text-sm ", children: [