@addsign/moje-agenda-shared-lib 2.0.70 → 2.0.72

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.
@@ -1561,6 +1561,10 @@ video {
1561
1561
  .border-t-transparent {
1562
1562
  border-top-color: transparent;
1563
1563
  }
1564
+ .\!bg-\[\#f3f3f3\] {
1565
+ --tw-bg-opacity: 1 !important;
1566
+ background-color: rgb(243 243 243 / var(--tw-bg-opacity)) !important;
1567
+ }
1564
1568
  .\!bg-danger {
1565
1569
  background-color: var(--color-danger) !important;
1566
1570
  }
@@ -2158,6 +2162,10 @@ video {
2158
2162
  .tracking-widest {
2159
2163
  letter-spacing: 0.1em;
2160
2164
  }
2165
+ .\!text-black {
2166
+ --tw-text-opacity: 1 !important;
2167
+ color: rgb(0 0 0 / var(--tw-text-opacity)) !important;
2168
+ }
2161
2169
  .text-accent-foreground {
2162
2170
  color: var(--accent-foreground);
2163
2171
  }
@@ -2445,6 +2453,11 @@ video {
2445
2453
  .opacity-90 {
2446
2454
  opacity: 0.9;
2447
2455
  }
2456
+ .\!shadow-\[inset_0_2px_0_0_\#525252\] {
2457
+ --tw-shadow: inset 0 2px 0 0 #525252 !important;
2458
+ --tw-shadow-colored: inset 0 2px 0 0 var(--tw-shadow-color) !important;
2459
+ box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;
2460
+ }
2448
2461
  .shadow {
2449
2462
  --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
2450
2463
  --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
@@ -14,11 +14,24 @@ interface DataTableServerProps<T> {
14
14
  selectedItemKey?: string;
15
15
  itemsPerPageOptions?: IOptionItem[];
16
16
  setMinWidth?: boolean;
17
+ onDataLoaded?: (data: IPageable<T>) => void;
17
18
  }
18
19
  type DataTableInternalItems = {
19
20
  _isHighlighted?: boolean;
20
21
  id: string;
21
22
  };
22
23
  export declare const resetAllDataTablePaging: () => void;
23
- declare function DataTableServer<T extends DataTableInternalItems>({ id, url, columns, title, subtitle, allowSearch, showHeader, rowAction, bulkAction, filters, selectedItemKey, itemsPerPageOptions, setMinWidth, }: DataTableServerProps<T>): import("react/jsx-runtime").JSX.Element;
24
+ interface IPageable<T> {
25
+ content: T[];
26
+ empty: boolean;
27
+ first: boolean;
28
+ last: boolean;
29
+ number: number;
30
+ numberOfElements: number;
31
+ size: number;
32
+ totalElements: number;
33
+ totalPages: number;
34
+ isPageable?: boolean;
35
+ }
36
+ declare function DataTableServer<T extends DataTableInternalItems>({ id, url, columns, title, subtitle, allowSearch, showHeader, rowAction, bulkAction, filters, selectedItemKey, itemsPerPageOptions, setMinWidth, onDataLoaded, }: DataTableServerProps<T>): import("react/jsx-runtime").JSX.Element;
24
37
  export default DataTableServer;
@@ -21725,7 +21725,8 @@ function DataTableServer({
21725
21725
  filters,
21726
21726
  selectedItemKey = "id",
21727
21727
  itemsPerPageOptions = defaultItemsPerPageOptions,
21728
- setMinWidth = false
21728
+ setMinWidth = false,
21729
+ onDataLoaded
21729
21730
  }) {
21730
21731
  var _a, _b;
21731
21732
  const abortControllerRef = useRef(null);
@@ -21854,13 +21855,14 @@ function DataTableServer({
21854
21855
  );
21855
21856
  setData(dataPageable);
21856
21857
  setIsLoading(false);
21858
+ onDataLoaded == null ? void 0 : onDataLoaded(dataPageable);
21857
21859
  }).catch((error) => {
21858
21860
  if (error.code === "ERR_CANCELED") {
21859
21861
  console.log("Request was aborted");
21860
21862
  } else {
21861
21863
  console.error("Error fetching data:", error);
21862
21864
  handleErrors(error, federationContext.emitter);
21863
- setData({
21865
+ const emptyDataPageable = {
21864
21866
  content: [],
21865
21867
  empty: true,
21866
21868
  first: true,
@@ -21870,8 +21872,10 @@ function DataTableServer({
21870
21872
  size: itemsPerPageLocal || 10,
21871
21873
  totalElements: 0,
21872
21874
  totalPages: 1
21873
- });
21875
+ };
21876
+ setData(emptyDataPageable);
21874
21877
  setIsLoading(false);
21878
+ onDataLoaded == null ? void 0 : onDataLoaded(emptyDataPageable);
21875
21879
  }
21876
21880
  });
21877
21881
  setReloadData(false);
@@ -22374,11 +22378,30 @@ function DataTableServer({
22374
22378
  setMinWidth,
22375
22379
  children: ({ ref }) => {
22376
22380
  var _a2, _b2, _c;
22381
+ const hasActiveFilter = (() => {
22382
+ if (!filterParam)
22383
+ return false;
22384
+ const filterValue = mergedFilters == null ? void 0 : mergedFilters[String(filterParam)];
22385
+ const filterValue2 = filterParam2 ? mergedFilters == null ? void 0 : mergedFilters[String(filterParam2)] : null;
22386
+ if (filterType === "select") {
22387
+ return filterValue && filterValue !== "__clear__" && filterValue !== "";
22388
+ }
22389
+ if (filterType === "multi-select") {
22390
+ return Array.isArray(filterValue) && filterValue.length > 0;
22391
+ }
22392
+ if (filterType === "dateRange") {
22393
+ return filterValue && filterValue !== "" || filterValue2 && filterValue2 !== "";
22394
+ }
22395
+ if (filterType === "date" || filterType === "text") {
22396
+ return filterValue && filterValue !== "";
22397
+ }
22398
+ return false;
22399
+ })();
22377
22400
  return /* @__PURE__ */ jsxs(
22378
22401
  "th",
22379
22402
  {
22380
22403
  className: `tableHeader relative font-medium text-xs !leading-9 text-left px-3 text-gray-600
22381
- bg-gray-50 border-t border-b border-gray-200 content-start ${!title && !subtitle ? "border-t-0" : ""} ${sortParam ? " cursor-pointer " : ""}`,
22404
+ bg-gray-50 border-t border-b border-gray-200 content-start ${!title && !subtitle ? "border-t-0" : ""} ${sortParam ? " cursor-pointer " : ""} ${hasActiveFilter ? "!bg-[#f3f3f3] !shadow-[inset_0_2px_0_0_#525252] !text-black" : ""}`,
22382
22405
  onClick: () => sortParam ? requestSort(sortParam) : void 0,
22383
22406
  "data-cy": "datatable-header-" + id + "-" + String(key),
22384
22407
  children: [
@@ -22523,7 +22546,7 @@ function DataTableServer({
22523
22546
  filters || {}
22524
22547
  ).includes(String(filterParam)),
22525
22548
  clearable: true,
22526
- className: "min-w-[100px] px-2 font-normal placeholder-muted-foreground\r\n",
22549
+ className: "min-w-[100px] px-2 font-normal placeholder-muted-foreground\n",
22527
22550
  placeholder: "Zadejte filtr",
22528
22551
  debounceTimeout: 1e3
22529
22552
  }