@addsign/moje-agenda-shared-lib 2.0.50 → 2.0.52

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.
Files changed (30) hide show
  1. package/dist/assets/style.css +3 -0
  2. package/dist/components/datatable/DataTable.js +1 -1
  3. package/dist/components/datatable/DataTableServer.js +45 -16
  4. package/dist/components/datatable/DataTableServer.js.map +1 -1
  5. package/dist/components/datatable/DatatableSettings.js +1 -1
  6. package/dist/components/form/AutocompleteSearchBar.js +1 -1
  7. package/dist/components/form/AutocompleteSearchBarServer.js +1 -1
  8. package/dist/components/form/FileInput.js +1 -1
  9. package/dist/components/form/FileInputMultiple.js +1 -1
  10. package/dist/components/form/FormField.js +1 -1
  11. package/dist/components/form/InputField.js +1 -1
  12. package/dist/components/form/PositionsSelectorSingle.js +1 -1
  13. package/dist/components/form/SelectField.js +1 -1
  14. package/dist/components/layout/CollapsibleSection.js +1 -1
  15. package/dist/components/layout/IconInCircle.js +1 -1
  16. package/dist/components/layout/PageTitle.js +1 -1
  17. package/dist/components/layout/PageTitle.js.map +1 -1
  18. package/dist/components/layout/SectionTitle.js +1 -1
  19. package/dist/components/layout/SectionTitle.js.map +1 -1
  20. package/dist/index-CrfjcbOs.js +68 -0
  21. package/dist/index-CrfjcbOs.js.map +1 -0
  22. package/dist/index-CtWqywMt.js +2212 -0
  23. package/dist/index-CtWqywMt.js.map +1 -0
  24. package/dist/utils/handleErrors.js +6 -4
  25. package/dist/utils/handleErrors.js.map +1 -1
  26. package/lib/components/datatable/DataTableServer.tsx +65 -11
  27. package/lib/components/layout/PageTitle.tsx +1 -1
  28. package/lib/components/layout/SectionTitle.tsx +1 -1
  29. package/lib/utils/handleErrors.ts +2 -0
  30. package/package.json +1 -1
@@ -738,6 +738,9 @@ video {
738
738
  margin-top: 1rem;
739
739
  margin-bottom: 1rem;
740
740
  }
741
+ .mb-1 {
742
+ margin-bottom: 0.25rem;
743
+ }
741
744
  .mb-2 {
742
745
  margin-bottom: 0.5rem;
743
746
  }
@@ -2,7 +2,7 @@ import { jsx, Fragment, jsxs } from "react/jsx-runtime";
2
2
  import { useState, useEffect } from "react";
3
3
  import "../../tailwind-l0sNRNKZ.js";
4
4
  import Button from "../Button.js";
5
- import { f as MdOutlineFilterAlt, g as MdOutlineFilterAltOff, h as MdSearch, b as MdClose, i as MdArrowBack, j as MdArrowForward, k as MdArrowUpward, l as MdArrowDownward } from "../../index-DVD0PiGU.js";
5
+ import { f as MdOutlineFilterAlt, g as MdOutlineFilterAltOff, h as MdSearch, b as MdClose, i as MdArrowBack, j as MdArrowForward, k as MdArrowUpward, l as MdArrowDownward } from "../../index-CrfjcbOs.js";
6
6
  import FormField from "../form/FormField.js";
7
7
  import Spinner from "../Spinner.js";
8
8
  import "../ui/multi-select.js";
@@ -2,7 +2,7 @@ import { jsx, Fragment, jsxs } from "react/jsx-runtime";
2
2
  import { useRef, useState, useMemo, useEffect, useCallback } from "react";
3
3
  import "../../tailwind-l0sNRNKZ.js";
4
4
  import Button from "../Button.js";
5
- import { f as MdOutlineFilterAlt, g as MdOutlineFilterAltOff, h as MdSearch, b as MdClose, i as MdArrowBack, j as MdArrowForward, k as MdArrowUpward, l as MdArrowDownward } from "../../index-DVD0PiGU.js";
5
+ import { f as MdOutlineFilterAlt, g as MdOutlineFilterAltOff, h as MdSearch, b as MdClose, i as MdArrowBack, j as MdArrowForward, k as MdArrowUpward, l as MdArrowDownward, n as MdOutlineUnfoldMore } from "../../index-CrfjcbOs.js";
6
6
  import FormField from "../form/FormField.js";
7
7
  import InputField from "../form/InputField.js";
8
8
  import SelectField from "../form/SelectField.js";
@@ -21731,6 +21731,10 @@ function DataTableServer({
21731
21731
  }) {
21732
21732
  var _a, _b;
21733
21733
  const abortControllerRef = useRef(null);
21734
+ const topScrollbarRef = useRef(null);
21735
+ const bottomScrollbarRef = useRef(null);
21736
+ const tableRef = useRef(null);
21737
+ const syncWidthRef = useRef(null);
21734
21738
  const [itemsPerPageLocal, setItemsPerPageLocal] = useState();
21735
21739
  const federationContext = useFederationContext();
21736
21740
  const [data, setData] = useState();
@@ -21932,21 +21936,9 @@ function DataTableServer({
21932
21936
  };
21933
21937
  const getSortIcon = (sortParam) => {
21934
21938
  if ((sortConfig == null ? void 0 : sortConfig.sortParam) === sortParam) {
21935
- return sortConfig.direction === "asc" ? /* @__PURE__ */ jsx(MdArrowUpward, { fontSize: "small" }) : sortConfig.direction === "desc" ? /* @__PURE__ */ jsx(MdArrowDownward, { fontSize: "small" }) : /* @__PURE__ */ jsx(
21936
- MdArrowUpward,
21937
- {
21938
- fontSize: "small",
21939
- className: "text-gray-300 invisible group-hover:visible "
21940
- }
21941
- );
21939
+ return sortConfig.direction === "asc" ? /* @__PURE__ */ jsx(MdArrowUpward, { fontSize: "small" }) : sortConfig.direction === "desc" ? /* @__PURE__ */ jsx(MdArrowDownward, { fontSize: "small" }) : /* @__PURE__ */ jsx(MdOutlineUnfoldMore, { fontSize: "small", className: " " });
21942
21940
  }
21943
- return /* @__PURE__ */ jsx(
21944
- MdArrowUpward,
21945
- {
21946
- fontSize: "small",
21947
- className: "text-gray-300 invisible group-hover:visible "
21948
- }
21949
- );
21941
+ return /* @__PURE__ */ jsx(MdOutlineUnfoldMore, { fontSize: "small", className: " " });
21950
21942
  };
21951
21943
  const handleSelectItem = (item) => {
21952
21944
  setSelectedItems((prevSelectedItems) => {
@@ -22131,6 +22123,41 @@ function DataTableServer({
22131
22123
  handleErrors,
22132
22124
  columns
22133
22125
  ]);
22126
+ const updateSyncWidth = useCallback(() => {
22127
+ if (tableRef.current && syncWidthRef.current && setMinWidth) {
22128
+ syncWidthRef.current.style.width = tableRef.current.scrollWidth + "px";
22129
+ }
22130
+ }, [setMinWidth]);
22131
+ useEffect(() => {
22132
+ if (!setMinWidth)
22133
+ return;
22134
+ const topScrollbar = topScrollbarRef.current;
22135
+ const bottomScrollbar = bottomScrollbarRef.current;
22136
+ if (!topScrollbar || !bottomScrollbar)
22137
+ return;
22138
+ const handleTopScroll = () => {
22139
+ bottomScrollbar.scrollLeft = topScrollbar.scrollLeft;
22140
+ };
22141
+ const handleBottomScroll = () => {
22142
+ topScrollbar.scrollLeft = bottomScrollbar.scrollLeft;
22143
+ };
22144
+ topScrollbar.addEventListener("scroll", handleTopScroll);
22145
+ bottomScrollbar.addEventListener("scroll", handleBottomScroll);
22146
+ return () => {
22147
+ topScrollbar.removeEventListener("scroll", handleTopScroll);
22148
+ bottomScrollbar.removeEventListener("scroll", handleBottomScroll);
22149
+ };
22150
+ }, [setMinWidth]);
22151
+ useEffect(() => {
22152
+ if (!tableRef.current)
22153
+ return;
22154
+ const resizeObserver = new ResizeObserver(updateSyncWidth);
22155
+ resizeObserver.observe(tableRef.current);
22156
+ updateSyncWidth();
22157
+ return () => {
22158
+ resizeObserver.disconnect();
22159
+ };
22160
+ }, [updateSyncWidth, data, isLoading]);
22134
22161
  const handleItemsPerPageChange = (event) => {
22135
22162
  const selectedItemsPerPage = Number(event.target.value);
22136
22163
  setItemsPerPageLocal(selectedItemsPerPage);
@@ -22186,9 +22213,11 @@ function DataTableServer({
22186
22213
  }
22187
22214
  ) })
22188
22215
  ] }),
22189
- /* @__PURE__ */ jsx("div", { className: "overflow-auto min-h-[500px]", children: /* @__PURE__ */ jsxs(
22216
+ setMinWidth && /* @__PURE__ */ jsx("div", { ref: topScrollbarRef, className: "overflow-x-auto h-4 mb-1 mmmmm", children: /* @__PURE__ */ jsx("div", { ref: syncWidthRef, className: "h-full" }) }),
22217
+ /* @__PURE__ */ jsx("div", { ref: bottomScrollbarRef, className: "overflow-auto min-h-[500px]", children: /* @__PURE__ */ jsxs(
22190
22218
  "table",
22191
22219
  {
22220
+ ref: tableRef,
22192
22221
  className: "w-full leading-normal",
22193
22222
  "data-cy": "datatable-table-" + id,
22194
22223
  children: [