@addsign/moje-agenda-shared-lib 2.0.27 → 2.0.29

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.
@@ -1,4 +1,4 @@
1
- import { DataTableColumn } from '../../main';
1
+ import { DataTableColumn, IOptionItem } from '../../main';
2
2
 
3
3
  interface DataTableServerProps<T> {
4
4
  id: string;
@@ -12,11 +12,12 @@ interface DataTableServerProps<T> {
12
12
  bulkAction?: (items: T[]) => JSX.Element;
13
13
  filters?: object;
14
14
  selectedItemKey?: string;
15
+ itemsPerPageOptions?: IOptionItem[];
15
16
  }
16
17
  type DataTableInternalItems = {
17
18
  _isHighlighted?: boolean;
18
19
  id: string;
19
20
  };
20
21
  export declare const resetAllDataTablePaging: () => void;
21
- declare function DataTableServer<T extends DataTableInternalItems>({ id, url, columns, title, subtitle, allowSearch, showHeader, rowAction, bulkAction, filters, selectedItemKey, }: DataTableServerProps<T>): import("react/jsx-runtime").JSX.Element;
22
+ declare function DataTableServer<T extends DataTableInternalItems>({ id, url, columns, title, subtitle, allowSearch, showHeader, rowAction, bulkAction, filters, selectedItemKey, itemsPerPageOptions, }: DataTableServerProps<T>): import("react/jsx-runtime").JSX.Element;
22
23
  export default DataTableServer;
@@ -21698,6 +21698,11 @@ var utils = {
21698
21698
  SHEET_VERY_HIDDEN: 2
21699
21699
  }
21700
21700
  };
21701
+ const defaultItemsPerPageOptions = [
21702
+ { value: 10, label: "10" },
21703
+ { value: 50, label: "50" },
21704
+ { value: 100, label: "100" }
21705
+ ];
21701
21706
  const resetAllDataTablePaging = () => {
21702
21707
  Object.keys(localStorage).filter((key) => key.startsWith("datatable:")).forEach((key) => {
21703
21708
  const storageObject = localStorage.getItem(key);
@@ -21719,7 +21724,8 @@ function DataTableServer({
21719
21724
  rowAction,
21720
21725
  bulkAction,
21721
21726
  filters,
21722
- selectedItemKey = "id"
21727
+ selectedItemKey = "id",
21728
+ itemsPerPageOptions = defaultItemsPerPageOptions
21723
21729
  }) {
21724
21730
  var _a, _b;
21725
21731
  const abortControllerRef = useRef(null);
@@ -22377,11 +22383,7 @@ function DataTableServer({
22377
22383
  name: "itemsPerPage",
22378
22384
  onInputChange: handleItemsPerPageChange,
22379
22385
  className: "!w-[100px]",
22380
- options: [
22381
- { value: 10, label: "10" },
22382
- { value: 50, label: "50" },
22383
- { value: 100, label: "100" }
22384
- ],
22386
+ options: itemsPerPageOptions || defaultItemsPerPageOptions,
22385
22387
  value: itemsPerPageLocal
22386
22388
  }
22387
22389
  )