@addsign/moje-agenda-shared-lib 1.0.1 → 1.0.3

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.
@@ -1315,6 +1315,10 @@ video {
1315
1315
  .\!bg-danger {
1316
1316
  background-color: var(--color-danger) !important;
1317
1317
  }
1318
+ .\!bg-gray-100 {
1319
+ --tw-bg-opacity: 1 !important;
1320
+ background-color: rgb(243 244 246 / var(--tw-bg-opacity)) !important;
1321
+ }
1318
1322
  .\!bg-primary {
1319
1323
  background-color: var(--color-primary) !important;
1320
1324
  }
@@ -1,5 +1,5 @@
1
1
  import { jsx, Fragment, jsxs } from "react/jsx-runtime";
2
- import { useState, useEffect, useCallback } from "react";
2
+ import { useState, useMemo, useEffect, useCallback } from "react";
3
3
  import '../../assets/tailwind.css';/* empty css */
4
4
  import Button from "../Button.js";
5
5
  import { e as MdOutlineFilterAlt, f as MdOutlineFilterAltOff, g as MdSearch, d as MdClose, h as MdArrowBack, i as MdArrowForward, j as MdArrowUpward, k as MdArrowDownward } from "../../index-BMFehNPK.js";
@@ -21703,7 +21703,9 @@ function DataTableServer({
21703
21703
  const [selectedItems, setSelectedItems] = useState([]);
21704
21704
  const [fulltextSearch, setFulltextSearch] = useState("");
21705
21705
  const [filterOptions, setFilterOptions] = useState({});
21706
- const [columnFilters, setColumnFilters] = useState();
21706
+ const [columnFilters, setColumnFilters] = useState(
21707
+ {}
21708
+ );
21707
21709
  const [showColFilters, setShowColFilters] = useState();
21708
21710
  const [sortConfig, setSortConfig] = useState(null);
21709
21711
  const createDataPageable = (response, itemsPerPage) => {
@@ -21721,6 +21723,9 @@ function DataTableServer({
21721
21723
  };
21722
21724
  };
21723
21725
  const [reloadData, setReloadData] = useState(false);
21726
+ const mergedFilters = useMemo(() => {
21727
+ return { ...columnFilters, ...filters };
21728
+ }, [columnFilters, filters]);
21724
21729
  useEffect(() => {
21725
21730
  setReloadData(true);
21726
21731
  }, [
@@ -21743,8 +21748,7 @@ function DataTableServer({
21743
21748
  setIsLoading(true);
21744
21749
  federationContext.apiClient.get(url, {
21745
21750
  params: {
21746
- ...filters,
21747
- ...showColFilters ? columnFilters : {},
21751
+ ...mergedFilters,
21748
21752
  pageSize: itemsPerPageLocal,
21749
21753
  page: currentPage,
21750
21754
  sortBy: sortConfig == null ? void 0 : sortConfig.sortParam,
@@ -21798,11 +21802,6 @@ function DataTableServer({
21798
21802
  setShowColFilters(storageObject.showColFilters);
21799
21803
  setCurrentPage(storageObject.currentPage || 0);
21800
21804
  setSortConfig(null);
21801
- console.log(
21802
- "%clibcomponentsdatatableDataTableServer.tsx:204 storageObject",
21803
- "color: #007acc;",
21804
- storageObject
21805
- );
21806
21805
  setItemsPerPageLocal(storageObject.itemsPerPage || 10);
21807
21806
  }
21808
21807
  }
@@ -22094,12 +22093,16 @@ function DataTableServer({
22094
22093
  ),
22095
22094
  type: filterType,
22096
22095
  options: filterOptions[String(filterParam)] || [],
22097
- value: (columnFilters == null ? void 0 : columnFilters[String(filterParam)]) || "",
22096
+ value: (mergedFilters == null ? void 0 : mergedFilters[String(filterParam)]) || "",
22098
22097
  clearable: true,
22099
22098
  className: " px-0",
22100
22099
  placeholder: "Filtr",
22101
- rounded: true
22102
- }
22100
+ rounded: true,
22101
+ disabled: Object.keys(
22102
+ filters || {}
22103
+ ).includes(String(filterParam))
22104
+ },
22105
+ JSON.stringify(mergedFilters)
22103
22106
  ) : filterType === "dateRange" ? /* @__PURE__ */ jsx(
22104
22107
  DateRangeField,
22105
22108
  {
@@ -22112,14 +22115,18 @@ function DataTableServer({
22112
22115
  type: filterType,
22113
22116
  options: filterOptions[String(filterParam)] || [],
22114
22117
  value: {
22115
- startDate: (columnFilters == null ? void 0 : columnFilters[String(filterParam)]) || "",
22116
- endDate: (columnFilters == null ? void 0 : columnFilters[String(filterParam2)]) || ""
22118
+ startDate: (mergedFilters == null ? void 0 : mergedFilters[String(filterParam)]) || "",
22119
+ endDate: (mergedFilters == null ? void 0 : mergedFilters[String(filterParam2)]) || ""
22117
22120
  },
22118
22121
  clearable: true,
22119
22122
  className: " px-0 py-0 ",
22120
22123
  placeholder: "Filtr",
22121
- rounded: true
22122
- }
22124
+ rounded: true,
22125
+ disabled: Object.keys(
22126
+ filters || {}
22127
+ ).includes(String(filterParam))
22128
+ },
22129
+ JSON.stringify(mergedFilters)
22123
22130
  ) : /* @__PURE__ */ jsx(
22124
22131
  InputField,
22125
22132
  {
@@ -22129,13 +22136,17 @@ function DataTableServer({
22129
22136
  e.target.value
22130
22137
  ),
22131
22138
  type: filterType,
22132
- value: (columnFilters == null ? void 0 : columnFilters[String(filterParam)]) || "",
22139
+ value: (mergedFilters == null ? void 0 : mergedFilters[String(filterParam)]) || "",
22140
+ disabled: Object.keys(
22141
+ filters || {}
22142
+ ).includes(String(filterParam)),
22133
22143
  clearable: true,
22134
22144
  className: " min-w-[100px] px-0 ",
22135
22145
  rounded: true,
22136
22146
  placeholder: "Filtr",
22137
22147
  debounceTimeout: 1e3
22138
- }
22148
+ },
22149
+ JSON.stringify(mergedFilters)
22139
22150
  )
22140
22151
  }
22141
22152
  )