loon-bulma-react 2026.0.13 → 2026.0.15
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.
|
@@ -21,20 +21,25 @@ type DataTableColumnProp<T extends unknown = unknown> = {
|
|
|
21
21
|
/** className voor de kolom, om een cel te stylen afhankelijk van de waarde */
|
|
22
22
|
columnClass?: string | ((item: T) => string);
|
|
23
23
|
};
|
|
24
|
-
type
|
|
24
|
+
type DatatablePaginationOptionsProp = {
|
|
25
25
|
/** tonen we paginatie? */
|
|
26
26
|
hidden?: boolean;
|
|
27
27
|
/** vanaf wel aantal rijen is paginatie actief */
|
|
28
28
|
threshold?: number;
|
|
29
29
|
/** initiele pagination number. default = 1 (first) */
|
|
30
30
|
initialPage?: number;
|
|
31
|
-
/** Default aantal rijen per pagina (
|
|
31
|
+
/** Default aantal rijen per pagina (Infinity voor alles)*/
|
|
32
32
|
initialRowsPerPage?: number;
|
|
33
|
-
/** Opties voor aantal rijen per pagina (gebruik
|
|
33
|
+
/** Opties voor aantal rijen per pagina (gebruik `Infinity` voor alles) */
|
|
34
34
|
rowsPerPageOptions?: {
|
|
35
35
|
label: string;
|
|
36
36
|
value: number;
|
|
37
37
|
}[];
|
|
38
|
+
/** callback voor wijzigen van de `rowsPerPage` - zodat je die (als gewenst) kan opslaan */
|
|
39
|
+
onRowsPerPerPageOptionChanged?: (selected: {
|
|
40
|
+
label: string;
|
|
41
|
+
value: number;
|
|
42
|
+
}) => void;
|
|
38
43
|
};
|
|
39
44
|
type DataTableProps<T extends unknown = unknown> = {
|
|
40
45
|
/** De kolommen voor de DataTable
|
|
@@ -121,7 +126,8 @@ type DataTableProps<T extends unknown = unknown> = {
|
|
|
121
126
|
footerContent?: React.ReactNode;
|
|
122
127
|
itemRef?: React.RefObject<any> | null;
|
|
123
128
|
id?: string;
|
|
124
|
-
|
|
129
|
+
/** opties voor paginatie */
|
|
130
|
+
paginationOptions?: DatatablePaginationOptionsProp | undefined;
|
|
125
131
|
};
|
|
126
132
|
/**
|
|
127
133
|
* Maak een tabel voor grote hoeveelheden data. De tabel is doorzoekbaar en heeft paginatie. Dat is allemaal uit te zetten.
|
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Informatie over een item die wordt meegegeven aan de renderItem functie
|
|
4
|
+
*/
|
|
5
|
+
type RenderItemInfo = {
|
|
6
|
+
/** De index van het item in de lijst */
|
|
7
|
+
index: number;
|
|
8
|
+
/** Of het item disabled is */
|
|
9
|
+
isDisabled: boolean;
|
|
10
|
+
/** Of dit het eerste item in de lijst is */
|
|
11
|
+
isFirstItem: boolean;
|
|
12
|
+
/** Of dit het laatste item in de lijst is */
|
|
13
|
+
isLastItem: boolean;
|
|
14
|
+
/** Of dit item momenteel wordt gesleept */
|
|
15
|
+
isDragging: boolean;
|
|
16
|
+
/** Of dit een placeholder/preview is van waar het item zal landen */
|
|
17
|
+
isPlaceholder: boolean;
|
|
18
|
+
/** Totaal aantal items in de lijst */
|
|
19
|
+
totalItems: number;
|
|
20
|
+
};
|
|
2
21
|
/**
|
|
3
22
|
* Props voor de DragDropList component
|
|
4
23
|
* @template T - Het type van de items in de lijst
|
|
@@ -9,9 +28,11 @@ type DragDropListProps<T> = {
|
|
|
9
28
|
/** Callback functie die wordt aangeroepen wanneer de volgorde van items verandert */
|
|
10
29
|
onReorder: (items: T[]) => void;
|
|
11
30
|
/** Functie die bepaalt hoe elk item gerenderd wordt */
|
|
12
|
-
renderItem: (item: T,
|
|
31
|
+
renderItem: (item: T, info: RenderItemInfo) => React.ReactNode;
|
|
13
32
|
/** Functie of property naam die de unieke key voor elk item bepaalt */
|
|
14
33
|
keyExtractor: ((item: T, index: number) => string | number) | keyof T;
|
|
34
|
+
/** Functie of property naam die bepaalt of een item disabled is */
|
|
35
|
+
isDisabled?: ((item: T, index: number) => boolean) | keyof T;
|
|
15
36
|
/** Optionele CSS class voor de lijst container */
|
|
16
37
|
className?: string;
|
|
17
38
|
/** Optionele CSS class voor elk list item */
|
|
@@ -21,23 +42,28 @@ type DragDropListProps<T> = {
|
|
|
21
42
|
};
|
|
22
43
|
/**
|
|
23
44
|
* Een drag-and-drop lijst component waarmee items verticaal herschikt kunnen worden.
|
|
24
|
-
*
|
|
25
45
|
* @template T - Het type van de items in de lijst
|
|
26
|
-
*
|
|
27
46
|
* @example
|
|
28
47
|
* ```tsx
|
|
29
48
|
* const [items, setItems] = useState([
|
|
30
|
-
* { id: 1, name: 'Item 1' },
|
|
31
|
-
* { id: 2, name: 'Item 2' },
|
|
49
|
+
* { id: 1, name: 'Item 1', locked: false },
|
|
50
|
+
* { id: 2, name: 'Item 2', locked: true },
|
|
32
51
|
* ]);
|
|
33
52
|
*
|
|
34
53
|
* <DragDropList
|
|
35
54
|
* items={items}
|
|
36
55
|
* onReorder={setItems}
|
|
37
56
|
* keyExtractor="id"
|
|
57
|
+
* isDisabled="locked"
|
|
38
58
|
* className='container-class'
|
|
39
59
|
* itemClassName='item-class'
|
|
40
|
-
* renderItem={(item) =>
|
|
60
|
+
* renderItem={(item, info) => (
|
|
61
|
+
* <div>
|
|
62
|
+
* {item.name}
|
|
63
|
+
* {info.isFirstItem && ' (eerste)'}
|
|
64
|
+
* {info.isDisabled && ' (vergrendeld)'}
|
|
65
|
+
* </div>
|
|
66
|
+
* )}
|
|
41
67
|
* >
|
|
42
68
|
* <DragDropList.Handle>
|
|
43
69
|
* <Icon icon={faGripVertical} />
|
|
@@ -46,7 +72,7 @@ type DragDropListProps<T> = {
|
|
|
46
72
|
* </DragDropList>
|
|
47
73
|
* ```
|
|
48
74
|
*/
|
|
49
|
-
export declare function DragDropList<T>({ items, onReorder, renderItem, keyExtractor, className, itemClassName, children }: DragDropListProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
75
|
+
export declare function DragDropList<T>({ items, onReorder, renderItem, keyExtractor, isDisabled, className, itemClassName, children }: DragDropListProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
50
76
|
export declare namespace DragDropList {
|
|
51
77
|
var Handle: ({ children }: {
|
|
52
78
|
children?: React.ReactNode;
|
|
@@ -37,22 +37,28 @@ type DefaultsType = {
|
|
|
37
37
|
tags: TagSettings;
|
|
38
38
|
/** default alignment settings */
|
|
39
39
|
alignment: AlignmentProp;
|
|
40
|
-
|
|
40
|
+
/** default settings voor de datatable paginatie */
|
|
41
|
+
datatablePagination: DatatablePaginationOptions;
|
|
41
42
|
};
|
|
42
|
-
export type
|
|
43
|
+
export type DatatablePaginationOptions = {
|
|
43
44
|
/** tonen we pagination? */
|
|
44
45
|
hidden: boolean;
|
|
45
46
|
/** vanaf wel aantal rijen is paginatie actief */
|
|
46
47
|
threshold: number;
|
|
47
48
|
/** initiele pagination number. default = 1 (first) */
|
|
48
49
|
initialPage: number;
|
|
49
|
-
/** Default aantal rijen per pagina (
|
|
50
|
+
/** Default aantal rijen per pagina (Infinity voor alles)*/
|
|
50
51
|
initialRowsPerPage: number;
|
|
51
|
-
/** Opties voor aantal rijen per pagina (gebruik value
|
|
52
|
+
/** Opties voor aantal rijen per pagina (gebruik value `Infinity` voor alles) */
|
|
52
53
|
rowsPerPageOptions: {
|
|
53
54
|
label: string;
|
|
54
55
|
value: number;
|
|
55
56
|
}[];
|
|
57
|
+
/** Callback functie die wordt aangeroepen als de user een andere rowsPerPage optie kiest. Zodat je deze kan opslaan (als gewenst) */
|
|
58
|
+
onRowsPerPerPageOptionChanged?: (option: {
|
|
59
|
+
label: string;
|
|
60
|
+
value: number;
|
|
61
|
+
}) => void;
|
|
56
62
|
};
|
|
57
63
|
/** Partial type voor het updaten van een of meer enkele settings.
|
|
58
64
|
* Alle properties zijn optioneel, en kunnen dus ook weggelaten worden.
|
|
@@ -68,7 +74,7 @@ export type OptionalDefaultsType = Partial<{
|
|
|
68
74
|
tags: Partial<TagSettings>;
|
|
69
75
|
/** default alignment settings */
|
|
70
76
|
alignment: Partial<AlignmentProp>;
|
|
71
|
-
datatablePagination: Partial<
|
|
77
|
+
datatablePagination: Partial<DatatablePaginationOptions>;
|
|
72
78
|
}>;
|
|
73
79
|
/**
|
|
74
80
|
* Context voor het bijhouden van de default waardes voor de LoonBulmaReact componenten
|