@addsign/moje-agenda-shared-lib 2.0.27 → 2.0.28
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.
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
DateField,
|
|
13
13
|
DateRangeField,
|
|
14
14
|
FormField,
|
|
15
|
+
IOptionItem,
|
|
15
16
|
IPageable,
|
|
16
17
|
Spinner,
|
|
17
18
|
handleErrors,
|
|
@@ -52,7 +53,13 @@ interface DataTableServerProps<T> {
|
|
|
52
53
|
bulkAction?: (items: T[]) => JSX.Element;
|
|
53
54
|
filters?: object;
|
|
54
55
|
selectedItemKey?: string;
|
|
56
|
+
itemsPerPageOptions?: IOptionItem[];
|
|
55
57
|
}
|
|
58
|
+
const defaultItemsPerPageOptions: IOptionItem[] = [
|
|
59
|
+
{ value: 10, label: "10" },
|
|
60
|
+
{ value: 50, label: "50" },
|
|
61
|
+
{ value: 100, label: "100" },
|
|
62
|
+
];
|
|
56
63
|
|
|
57
64
|
type DataTableInternalItems = {
|
|
58
65
|
_isHighlighted?: boolean;
|
|
@@ -90,6 +97,7 @@ function DataTableServer<T extends DataTableInternalItems>({
|
|
|
90
97
|
bulkAction,
|
|
91
98
|
filters,
|
|
92
99
|
selectedItemKey = "id",
|
|
100
|
+
itemsPerPageOptions = defaultItemsPerPageOptions,
|
|
93
101
|
}: DataTableServerProps<T>) {
|
|
94
102
|
const abortControllerRef = useRef<AbortController | null>(null);
|
|
95
103
|
const [itemsPerPageLocal, setItemsPerPageLocal] = useState<number>();
|
|
@@ -926,11 +934,7 @@ function DataTableServer<T extends DataTableInternalItems>({
|
|
|
926
934
|
name="itemsPerPage"
|
|
927
935
|
onInputChange={handleItemsPerPageChange}
|
|
928
936
|
className="!w-[100px]"
|
|
929
|
-
options={
|
|
930
|
-
{ value: 10, label: "10" },
|
|
931
|
-
{ value: 50, label: "50" },
|
|
932
|
-
{ value: 100, label: "100" },
|
|
933
|
-
]}
|
|
937
|
+
options={itemsPerPageOptions || defaultItemsPerPageOptions}
|
|
934
938
|
value={itemsPerPageLocal}
|
|
935
939
|
/>
|
|
936
940
|
</div>
|