loon-bulma-react 2026.0.39 → 2026.0.41
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.
- package/dist/components/DragDrop/DragDropList.d.ts +6 -4
- package/dist/forms/Select/Select.d.ts +1 -1
- package/dist/hooks/useClipboard.d.ts +3 -3
- package/dist/index.js +1257 -1249
- package/dist/internal_functions/createIconsInternal.d.ts +2 -1
- package/dist/lib/classes/Console.d.ts +29 -0
- package/dist/lib/classes/FetchWrapper.d.ts +124 -0
- package/dist/lib/components/AspectRatio/AspectRatio.d.ts +28 -0
- package/dist/lib/components/Block/Block.d.ts +9 -0
- package/dist/lib/components/Box/BorderBox.d.ts +29 -0
- package/dist/lib/components/Box/Box.d.ts +20 -0
- package/dist/lib/components/Button/Button.d.ts +87 -0
- package/dist/lib/components/ButtonGroup/ButtonGroup.d.ts +26 -0
- package/dist/lib/components/Calendar/CalendarItems/CalendarColoredItem.d.ts +18 -0
- package/dist/lib/components/Calendar/CalendarItems/CalendarItem.d.ts +18 -0
- package/dist/lib/components/Calendar/DayContainer.d.ts +25 -0
- package/dist/lib/components/Calendar/EventDescriptions.d.ts +33 -0
- package/dist/lib/components/Calendar/Fourweeks/FourweeksView.d.ts +23 -0
- package/dist/lib/components/Calendar/Mini/MiniView.d.ts +24 -0
- package/dist/lib/components/Calendar/Month/MonthView.d.ts +23 -0
- package/dist/lib/components/Calendar/Planning/PlanningView.d.ts +41 -0
- package/dist/lib/components/Calendar/Props.d.ts +58 -0
- package/dist/lib/components/Calendar/Week/AlldayContainer.d.ts +19 -0
- package/dist/lib/components/Calendar/Week/HourRow.d.ts +30 -0
- package/dist/lib/components/Calendar/Week/WeekView.d.ts +24 -0
- package/dist/lib/components/Calendar/calendar.functions.d.ts +10 -0
- package/dist/lib/components/Calendar/index.d.ts +15 -0
- package/dist/lib/components/CodeBlock/CodeBlock.d.ts +49 -0
- package/dist/lib/components/Columns/Column.d.ts +207 -0
- package/dist/lib/components/Columns/Columns.d.ts +35 -0
- package/dist/lib/components/Container/Container.d.ts +45 -0
- package/dist/lib/components/Content/Content.d.ts +22 -0
- package/dist/lib/components/DataTable/DataTable.d.ts +227 -0
- package/dist/lib/components/DataTable/DataTableDropdown.d.ts +39 -0
- package/dist/lib/components/Divider/Divider.d.ts +23 -0
- package/dist/lib/components/DragDrop/DragDropList.d.ts +97 -0
- package/dist/lib/components/Dropdown/Dropdown.d.ts +42 -0
- package/dist/lib/components/Footer/Footer.d.ts +22 -0
- package/dist/lib/components/Help/Help.d.ts +19 -0
- package/dist/lib/components/Hero/Hero.d.ts +104 -0
- package/dist/lib/components/Icon/Icon.d.ts +84 -0
- package/dist/lib/components/Image/Image.d.ts +28 -0
- package/dist/lib/components/Indicator/Indicator.d.ts +25 -0
- package/dist/lib/components/Kbd/Kbd.d.ts +30 -0
- package/dist/lib/components/Label/Label.d.ts +11 -0
- package/dist/lib/components/Link/Link.d.ts +44 -0
- package/dist/lib/components/Menu/Menu.d.ts +64 -0
- package/dist/lib/components/Message/Message.d.ts +49 -0
- package/dist/lib/components/Modal/Modal.d.ts +89 -0
- package/dist/lib/components/Notification/Notification.d.ts +38 -0
- package/dist/lib/components/Pagination/Pagination.d.ts +58 -0
- package/dist/lib/components/Panel/Panel.d.ts +99 -0
- package/dist/lib/components/ProgressBar/ProgressBar.d.ts +28 -0
- package/dist/lib/components/QuickView/QuickView.d.ts +61 -0
- package/dist/lib/components/ScrollArea/ScrollArea.d.ts +76 -0
- package/dist/lib/components/Section/Section.d.ts +21 -0
- package/dist/lib/components/SimpleTable/SimpleTable.d.ts +130 -0
- package/dist/lib/components/Steps/Steps.d.ts +61 -0
- package/dist/lib/components/TabBar/TabBar.d.ts +47 -0
- package/dist/lib/components/Tag/Tag.d.ts +54 -0
- package/dist/lib/components/TimeLine/TimeLine.d.ts +62 -0
- package/dist/lib/components/Titles/Titles.d.ts +71 -0
- package/dist/lib/components/ToggleBar/ToggleBar.d.ts +80 -0
- package/dist/lib/components/Tooltip/Tooltip.d.ts +50 -0
- package/dist/lib/components/TreeView/TreeView.d.ts +185 -0
- package/dist/lib/contexts/ActionSheet/ActionSheetContextProvider.d.ts +76 -0
- package/dist/lib/contexts/AppProvider/AppProviders.d.ts +17 -0
- package/dist/lib/contexts/ColorSchemeProvider/ColorSchemeProvider.d.ts +15 -0
- package/dist/lib/contexts/Confirm/ConfirmContextProvider.d.ts +60 -0
- package/dist/lib/contexts/DefaultsProvider/DefaultsProvider.d.ts +100 -0
- package/dist/lib/contexts/DialogsProvider/DialogsProvider.d.ts +4 -0
- package/dist/lib/contexts/KeysProvider/KeysProvider.d.ts +52 -0
- package/dist/lib/contexts/ModalProvider/ModalProvider.d.ts +11 -0
- package/dist/lib/contexts/ModeProvider/ModeProvider.d.ts +16 -0
- package/dist/lib/contexts/Notifier/Notifier.d.ts +81 -0
- package/dist/lib/contexts/Prompt/PromptContextProvider.d.ts +71 -0
- package/dist/lib/forms/Checkbox/Checkbox.d.ts +48 -0
- package/dist/lib/forms/ComboBox/ComboBox.d.ts +44 -0
- package/dist/lib/forms/ComboBox/MultiComboBox.d.ts +44 -0
- package/dist/lib/forms/ComboBox/useComboBoxScroll.d.ts +4 -0
- package/dist/lib/forms/Currency/CurrencyInput.d.ts +50 -0
- package/dist/lib/forms/Datetimes/DateInput.d.ts +37 -0
- package/dist/lib/forms/Datetimes/DateTimeInput.d.ts +44 -0
- package/dist/lib/forms/Datetimes/TimeInput.d.ts +42 -0
- package/dist/lib/forms/File/FileInput.d.ts +71 -0
- package/dist/lib/forms/Input.d.ts +248 -0
- package/dist/lib/forms/MaskedInput/IBANInput.d.ts +95 -0
- package/dist/lib/forms/MaskedInput/MaskedInput.d.ts +46 -0
- package/dist/lib/forms/Numeric/NumberInput.d.ts +16 -0
- package/dist/lib/forms/Numeric/RangeInput.d.ts +21 -0
- package/dist/lib/forms/Others/ColorInput.d.ts +56 -0
- package/dist/lib/forms/Others/HiddenInput.d.ts +29 -0
- package/dist/lib/forms/Others/TelephoneInput.d.ts +14 -0
- package/dist/lib/forms/Others/URLInput.d.ts +14 -0
- package/dist/lib/forms/Periodes/MonthInput.d.ts +43 -0
- package/dist/lib/forms/Periodes/WeekInput.d.ts +43 -0
- package/dist/lib/forms/Radio/Radio.d.ts +97 -0
- package/dist/lib/forms/Select/Select.d.ts +136 -0
- package/dist/lib/forms/TagsInput/TagsInput.d.ts +44 -0
- package/dist/lib/forms/Text/EmailInput.d.ts +14 -0
- package/dist/lib/forms/Text/FormattedInput.d.ts +54 -0
- package/dist/lib/forms/Text/PasswordInput.d.ts +19 -0
- package/dist/lib/forms/Text/TextArea.d.ts +31 -0
- package/dist/lib/forms/Text/TextEditor.d.ts +36 -0
- package/dist/lib/forms/Text/TextInput.d.ts +30 -0
- package/dist/lib/hooks/useCaretPosition.d.ts +8 -0
- package/dist/lib/hooks/useClickOutside.d.ts +15 -0
- package/dist/lib/hooks/useClipboard.d.ts +21 -0
- package/dist/lib/hooks/useContextMenu.d.ts +29 -0
- package/dist/lib/hooks/useCookieState.d.ts +37 -0
- package/dist/lib/hooks/useDebounced.hooks.d.ts +85 -0
- package/dist/lib/hooks/useFetchApi.d.ts +65 -0
- package/dist/lib/hooks/useHotkeys.d.ts +96 -0
- package/dist/lib/hooks/useIndexedDb.d.ts +90 -0
- package/dist/lib/hooks/useLocalStoredState.d.ts +36 -0
- package/dist/lib/hooks/useMediaQuery.d.ts +154 -0
- package/dist/lib/hooks/usePagination.d.ts +25 -0
- package/dist/lib/hooks/usePropState.d.ts +16 -0
- package/dist/lib/hooks/useScrollIntoView.d.ts +59 -0
- package/dist/lib/hooks/useSessionStoredState.d.ts +38 -0
- package/dist/lib/hooks/useThrottle.hooks.d.ts +99 -0
- package/dist/lib/hooks/useToggle.d.ts +16 -0
- package/dist/lib/hooks/useUncontrolled.d.ts +44 -0
- package/dist/lib/hooks/useValidatedState.d.ts +21 -0
- package/dist/lib/index.d.ts +174 -0
- package/dist/lib/internal_functions/createIconsInternal.d.ts +36 -0
- package/dist/lib/internal_functions/getAlignmentClass.d.ts +16 -0
- package/dist/lib/internal_functions/getColorClass.d.ts +23 -0
- package/dist/lib/internal_functions/getPositionClass.d.ts +2 -0
- package/dist/lib/internal_functions/getSizeClass.d.ts +23 -0
- package/dist/lib/internal_functions/index.d.ts +8 -0
- package/dist/lib/shims/useSyncExternalStoreShim.d.ts +1 -0
- package/dist/lib/shims/useSyncExternalStoreWithSelector.d.ts +5 -0
- package/dist/lib/test-data.d.ts +9 -0
- package/dist/lib/types/index.d.ts +104 -0
- package/dist/lib/utils/BSN.functions.d.ts +57 -0
- package/dist/lib/utils/IBAN.functions.d.ts +138 -0
- package/dist/lib/utils/JSDateTime.class.d.ts +512 -0
- package/dist/lib/utils/JSDuration.class.d.ts +184 -0
- package/dist/lib/utils/colors.d.ts +54 -0
- package/dist/lib/utils/compare.d.ts +7 -0
- package/dist/lib/utils/deserialize.function.d.ts +2 -0
- package/dist/lib/utils/flattenChildren.function.d.ts +49 -0
- package/dist/lib/utils/math.d.ts +22 -0
- package/dist/lib/utils/object.functions.d.ts +37 -0
- package/dist/lib/utils/operators.d.ts +195 -0
- package/dist/lib/utils/serialize.function.d.ts +2 -0
- package/dist/lib/utils/sorting.d.ts +34 -0
- package/dist/lib/utils/string.utils.d.ts +125 -0
- package/package.json +51 -51
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AlignmentProp, SizeProp } from './../../types';
|
|
3
|
+
type DataTableColumnProp<T extends unknown = unknown> = {
|
|
4
|
+
/** Instellen van de volgorde van de kolommen. Kolommen worden gesorteerd obv de waarde. De default waarde = `0`
|
|
5
|
+
* - `positive`: de kolom wordt naar rechts verplaatst, hoogste waarde meest rechts
|
|
6
|
+
* - `negative`: de kolom wordt naar links verplaatst, laagste waarde meest links
|
|
7
|
+
*/
|
|
8
|
+
order?: number;
|
|
9
|
+
/** Is deze kolom zichtbaar? (default = false) */
|
|
10
|
+
hidden?: boolean;
|
|
11
|
+
/** sorteer-functie voor deze kolom. Als niet gedefinieerd kan je niet op deze kolom sorteren */
|
|
12
|
+
sort?: (a: T, b: T) => -1 | 0 | 1 | number;
|
|
13
|
+
/** de waarde van de kolom. Een fucnction of een property van object van type `T` (string) */
|
|
14
|
+
value: keyof T | ((item: T, hovered?: boolean) => React.ReactNode);
|
|
15
|
+
/** manier om deze cel te identificeren */
|
|
16
|
+
cellIdentifier?: keyof T | ((item: T) => string);
|
|
17
|
+
/** header voor de kolom. Als niet gedefinieerd wordt de `value` gebruikt, Dus als `value` een `function` is, **moet** je deze setten */
|
|
18
|
+
header?: string | React.ReactNode;
|
|
19
|
+
/** alignment van deze kolom (default = `l` */
|
|
20
|
+
alignment?: AlignmentProp;
|
|
21
|
+
/** className voor de kolom, om een cel te stylen afhankelijk van de waarde */
|
|
22
|
+
columnClass?: string | ((item: T) => string);
|
|
23
|
+
};
|
|
24
|
+
type DatatablePaginationOptionsProp = {
|
|
25
|
+
/** tonen we paginatie? */
|
|
26
|
+
hidden?: boolean;
|
|
27
|
+
/** vanaf wel aantal rijen is paginatie actief */
|
|
28
|
+
threshold?: number;
|
|
29
|
+
/** initiele pagination number. default = 1 (first) */
|
|
30
|
+
initialPage?: number;
|
|
31
|
+
/** Default aantal rijen per pagina (Infinity voor alles)*/
|
|
32
|
+
initialRowsPerPage?: number;
|
|
33
|
+
/** Opties voor aantal rijen per pagina (gebruik `Infinity` voor alles) */
|
|
34
|
+
rowsPerPageOptions?: {
|
|
35
|
+
label: string;
|
|
36
|
+
value: number;
|
|
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;
|
|
43
|
+
};
|
|
44
|
+
/** Data Table API - voor programatische toegang tot de DataTable */
|
|
45
|
+
type DataTableApi<T extends unknown = unknown> = {
|
|
46
|
+
/** Geef de index terug binnen de complete gesorteerde lijst (incl. zoekfilter, excl. paginatie-slice). */
|
|
47
|
+
getIndexForRowID: (rowIdentifier: string | number) => number;
|
|
48
|
+
/** Geef een item terug op basis van index binnen de complete gesorteerde lijst (incl. zoekfilter). */
|
|
49
|
+
getItemForIndex: (index: number) => T | undefined;
|
|
50
|
+
/** Geef de complete gesorteerde lijst terug (incl. zoekfilter, excl. paginatie-slice). */
|
|
51
|
+
getSortedData: () => T[];
|
|
52
|
+
/** Navigeer de paginatie naar de pagina die het item bevat. */
|
|
53
|
+
navigateToItem: (item: T) => void;
|
|
54
|
+
/** Navigeer de paginatie naar de pagina die het item bevat op basis van de gesorteerde index. */
|
|
55
|
+
navigateToIndex: (sortedIndex: number) => void;
|
|
56
|
+
/** Navigeer de paginatie naar de pagina die het item bevat op basis van de rowIdentifier. */
|
|
57
|
+
navigateToRowId: (rowId: string | number) => void;
|
|
58
|
+
};
|
|
59
|
+
type DataTableProps<T extends unknown = unknown> = {
|
|
60
|
+
/** De kolommen voor de DataTable
|
|
61
|
+
* @param sort een functie die twee items vergelijkt en -1, 0, 1 of een `number` teruggeeft. Als er geen sort-function is, kan de tabel **niet** op deze kolom gesorteerd worden.
|
|
62
|
+
* @param value De waarde voor in de tabel: een `keyof T` of een functie die een `React.ReactNode` teruggeeft.
|
|
63
|
+
* - `keyof T`: de property op het object van type `T`
|
|
64
|
+
* - `function`: een function die een `React.ReactNode` returned om te renderen in de cell.
|
|
65
|
+
* @param cellIdentifier een `keyof T` of een functie die een `string` teruggeeft. Deze waarde wordt gebruikt om de cell te identificeren. Als er geen `cellIdentifier` is, wordt de `value` gebruikt.
|
|
66
|
+
* @param header De header voor de kolom. Als er geen `header` is, wordt de `value` gebruikt.
|
|
67
|
+
* @param alignment De uitlijning van de cellen in de kolom. Standaard is dit `l` (links).
|
|
68
|
+
* @param columnClass een `string` of een functie die een `string` teruggeeft. Deze waarde wordt gebruikt om de cell te stylen afhankelijk van de value.
|
|
69
|
+
* @example // Een DataTable met een kolom met een `keyof T` als `value`:
|
|
70
|
+
* const columns: Array<DataTableColumnProp<{firstName: string, active: boolean, lastName: string}>> = [
|
|
71
|
+
* ..{ value: 'firstName', header: 'Naam' }, // value is een `keyof T`
|
|
72
|
+
* ..{ value: (u) => `${u.firstName} ${u.lastName}`, header: 'Achternaam'}, // value samengesteld met een function
|
|
73
|
+
* ..{ value: 'active', // true or false
|
|
74
|
+
* .. sort: (a,b) => a.active === b.active ? 0 : a.active ? -1 : 1 // sortable kolom
|
|
75
|
+
* ..},
|
|
76
|
+
* ];
|
|
77
|
+
*/
|
|
78
|
+
columns: Array<DataTableColumnProp<T>>;
|
|
79
|
+
/** het kolom-nummer waarop default gesorteerd moet worden. **LET OP: de 1e kolom heeft nr 1! ** */
|
|
80
|
+
defaultSortColNum?: number;
|
|
81
|
+
/** data-array in de tabel */
|
|
82
|
+
data?: Array<T>;
|
|
83
|
+
/** moet de tabel compact wwergegevens worden (voorheen `narrow`, default = `false`) */
|
|
84
|
+
compact?: boolean;
|
|
85
|
+
/** moet de tabel smaller worden weergegeven? */
|
|
86
|
+
narrow?: boolean;
|
|
87
|
+
/** moet de tabel borders hebben? (default = `false`) */
|
|
88
|
+
bordered?: boolean;
|
|
89
|
+
/** moet het kleurverschil tussen even en oneven rijen verdwijnen? */
|
|
90
|
+
noStripes?: boolean;
|
|
91
|
+
/** is de header van de tabel sticky ? (default = `none`)
|
|
92
|
+
* - none: geen sticky header
|
|
93
|
+
* - header: alleen de kolom-namen zijn sticky
|
|
94
|
+
* - all: de hele header is sticky, inclusief search en de `headerContent`
|
|
95
|
+
* */
|
|
96
|
+
sticky?: 'none' | 'header' | 'all';
|
|
97
|
+
/** is de tabel is de tabel hoverbaar (en is dat ook zichtbaar?) hebben? (default = `false`) */
|
|
98
|
+
hoverable?: boolean;
|
|
99
|
+
/** bepaal grootte van paginatie en zoek-input in de tabel */
|
|
100
|
+
size?: SizeProp;
|
|
101
|
+
/** moet het zoeken verborgen zijn? (default = `false`) */
|
|
102
|
+
hideSearch?: boolean;
|
|
103
|
+
/** placeholder voor zoek-input (default = 'Zoek ...') */
|
|
104
|
+
searchPlaceholder?: string;
|
|
105
|
+
/** zoek-function voor de datatable. Default gebruikt `JSON.stringify` op het object om te controleren of de zoekterm in een row voorkomt
|
|
106
|
+
* @param searchTerm de zoekterm
|
|
107
|
+
* @param data de data-array
|
|
108
|
+
* @returns een array van de data die overeenkomen met de zoekterm
|
|
109
|
+
*/
|
|
110
|
+
onSearch?: (searchTerm: string, data: T[]) => T[];
|
|
111
|
+
/** opmaak voor informatie over het zoeken
|
|
112
|
+
* @param fc aantal items dat voldoet aan de zoekterm
|
|
113
|
+
* @param tc totaal aantal items in de tabel
|
|
114
|
+
* @param term de zoekterm
|
|
115
|
+
*/
|
|
116
|
+
searchInfoMessage?: (fc: number, tc: number, term: string) => string;
|
|
117
|
+
/**
|
|
118
|
+
* callback voor geselecteerde rij
|
|
119
|
+
* @param item het item (als object van type `T`)
|
|
120
|
+
* @param row click-event met row-item (HTMLTableRowElement)
|
|
121
|
+
*/
|
|
122
|
+
onRowSelected?: (item: T, row?: React.MouseEvent<HTMLTableRowElement>) => void;
|
|
123
|
+
/** callback voor als de sorteerkolom wijzigt. __LET OP: deze is 1-based, niet 0-based (1e kolom heeft i=1)__ */
|
|
124
|
+
onSortColumnChanged?: (colNum: number | 1 | 2 | 3) => void;
|
|
125
|
+
/** Wat voor component moet er gerendered worden in het context menu van een rij? */
|
|
126
|
+
onRowRightClick?: (item: T) => React.ReactNode;
|
|
127
|
+
/** wat moet er in de tabel getoont worden als er **GEEN** data is
|
|
128
|
+
* @param isSearchAction is de tabel leeg omdat er gezocht is en er geen resultaten zijn of omdat er gewoon geen data is?
|
|
129
|
+
*/
|
|
130
|
+
renderWhenNoData?: (isSearchAction: boolean) => React.ReactNode;
|
|
131
|
+
/** een `string` of een functie die een `string` teruggeeft. Deze waarde wordt gebruikt om de row te stylen afhankelijk van de value. */
|
|
132
|
+
rowClass?: string | ((item: T) => string);
|
|
133
|
+
/** een `keyof T` of een functie die een `string` teruggeeft. Deze waarde wordt gebruikt om de row te identificeren.
|
|
134
|
+
* - string: de property op het object van type `T`
|
|
135
|
+
* - function: een function die een `string` returned om te gebruiken als `key` voor de row.
|
|
136
|
+
*/
|
|
137
|
+
rowIdentifier: keyof T | ((item: T) => string);
|
|
138
|
+
/** extra content boven de tabel, links van het zoekveld. Deze content wordt automatisch gewrapped met een `<td>...</td>` */
|
|
139
|
+
headerContent?: React.ReactNode;
|
|
140
|
+
/** extra content onder de tabel. Een ReactNode.
|
|
141
|
+
* Deze content **MOET** een `<tr><td>...</td></tr>` bevatten!
|
|
142
|
+
*/
|
|
143
|
+
footerContent?: React.ReactNode;
|
|
144
|
+
itemRef?: React.RefObject<any> | null;
|
|
145
|
+
id?: string;
|
|
146
|
+
/** opties voor paginatie */
|
|
147
|
+
paginationOptions?: DatatablePaginationOptionsProp | undefined;
|
|
148
|
+
/** Vul lege rijen op tot het aantal rijen per pagina op de laatste pagina (default = false). Alleen als er paginatie is */
|
|
149
|
+
fillEmptyRows?: boolean;
|
|
150
|
+
/** Expose helper-functies naar de parent om op elk moment de huidige sorted-data volgorde te lezen. */
|
|
151
|
+
apiRef?: React.MutableRefObject<DataTableApi<T> | null>;
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* Maak een tabel voor grote hoeveelheden data. De tabel is doorzoekbaar en heeft paginatie. Dat is allemaal uit te zetten.
|
|
155
|
+
* Het sorteren moet per kolom ingesteld worden.
|
|
156
|
+
* @description
|
|
157
|
+
* ⚠️ __LET OP__: Als je een dropdown binnen een DataTable gebruikt, gebruik dan altijd `DataTable.Dropdown` in plaats van de gewone `Dropdown` component.
|
|
158
|
+
* Het gaat alleen fout als je de table-container voor horizontaal scrollen in de tabel gebruikt, maar toch.
|
|
159
|
+
*
|
|
160
|
+
* @example
|
|
161
|
+
* const naamSort = (a: User, B: User) => { a.first_name < b.first_name ? -1 : 1; }
|
|
162
|
+
* const searchFn = (searchTerm: string, data: User[]) => data.filter((u) => u.first_name.includes(searchTerm));
|
|
163
|
+
* const columns: Array<DataTableColumnProp<User>> = [
|
|
164
|
+
* ..{ value: 'first_name', header: 'Naam', sort: naamSort },
|
|
165
|
+
* ..{ value: 'last_name', header: 'Achternaam' },
|
|
166
|
+
* ]
|
|
167
|
+
* const data: Array<User> = [ ... ];
|
|
168
|
+
* return (
|
|
169
|
+
* ..<DataTable<User>
|
|
170
|
+
* .. columns={columns}
|
|
171
|
+
* .. data={data}
|
|
172
|
+
* .. onSearch={searchFn}
|
|
173
|
+
* .. defaultSortColNum={1}
|
|
174
|
+
* .. maxRows={10}
|
|
175
|
+
* .. onRowSelected={(u) => console.log(u)}
|
|
176
|
+
* .. renderWhenNoData={(isSearchAction) => isSearchAction ? 'Geen resultaten' : 'Geen data'}
|
|
177
|
+
* ../>
|
|
178
|
+
*
|
|
179
|
+
* @param data de data-array
|
|
180
|
+
* @param columns de kolommen van het type `DataTableColumnProp<T>`
|
|
181
|
+
* @param defaultSortColNum het kolom-nummer waarop default gesorteerd moet worden. **LET OP: de 1e kolom heeft nr 1! **
|
|
182
|
+
* @param headerContent extra content boven de tabel, links van het zoekveld. Deze content wordt automatisch gewrapped met een `<td>...</td>`
|
|
183
|
+
* @param footerContent extra content onder de tabel. Een ReactNode. Deze content **MOET** een `<tr><td>...</td></tr>` bevatten!
|
|
184
|
+
* @param maxRows maximaal aantal rijen in de tabel voor paginatie aangaat. (default = 20)
|
|
185
|
+
* - 0: geen maximum, alle rijen worden getoond
|
|
186
|
+
* - number: maximum aantal rijen voor paginatie
|
|
187
|
+
* @param rowIdentifier welke `keyof T` is de unieke identifier van een row? (default = `id`). Mag ook een functie zijn die een string returned
|
|
188
|
+
* @param onSearch zoek-function voor de datatable. Default gebruikt `JSON.stringify` op het object om te controleren of de zoekterm in een row voorkomt
|
|
189
|
+
* @param onRowSelected callback voor geselecteerde rij
|
|
190
|
+
* @param rowClass een `string` of een functie die een `string` teruggeeft. Deze waarde wordt gebruikt om de row te stylen afhankelijk van de value.
|
|
191
|
+
* @param renderWhenNoData wat moet er in de tabel getoont worden als er **GEEN** data is, of als er geen zoek-resultaten zijn.
|
|
192
|
+
* @param searchInfoMessage opmaak voor informatie over het zoeken (default: 'Toon XXX rijen' bij geen zoekopdracht, 'Toon XXX van de YYY rijen' bij een zoekopdracht)
|
|
193
|
+
* @param compact moet de tabel compact weergegeven worden (voorheen `narrow`, default = `false`)
|
|
194
|
+
* @param striped moet de tabel om-en-om gestreept weergegeven worden ? (default = `false`)
|
|
195
|
+
* @param bordered moet de tabel borders hebben? (default = `false`)
|
|
196
|
+
* @param hoverable is de tabel is de tabel hoverbaar (en is dat ook zichtbaar?) hebben? (default = `false`)
|
|
197
|
+
* @param hidePagination paginatie verstoppen? (default = `false`)
|
|
198
|
+
* @param hideSearch moet het zoeken verborgen zijn? (default = `false`)
|
|
199
|
+
* @param size bepaal grootte van paginatie en zoek-input in de tabel (default ='s')
|
|
200
|
+
* @param searchPlaceholder placeholder voor zoek-input (default = 'Zoek ...')
|
|
201
|
+
* @returns
|
|
202
|
+
*/
|
|
203
|
+
declare function DataTable<T extends unknown = unknown>({ data, columns: cols, defaultSortColNum, compact, noStripes, narrow, bordered, hoverable, sticky, hideSearch, headerContent, footerContent, size, searchPlaceholder, rowIdentifier, rowClass, id: tableID, itemRef, paginationOptions: paginationOptionsProp, fillEmptyRows, apiRef, onSearch, onRowSelected, onRowRightClick, renderWhenNoData, searchInfoMessage, onSortColumnChanged, }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
204
|
+
declare namespace DataTable {
|
|
205
|
+
var Dropdown: {
|
|
206
|
+
({ onHover, id, children: childrenProp, trigger: triggerProp, disabled, alignment, dropUp, startOpen, className: classNameProp, keepOpenAfterClick, }: import("./DataTableDropdown").DataTableDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
207
|
+
Trigger({ children }: {
|
|
208
|
+
children: React.ReactNode;
|
|
209
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
210
|
+
Divider(): import("react/jsx-runtime").JSX.Element;
|
|
211
|
+
Item({ children, onClick, onItemClick, disabled, ...props }: {
|
|
212
|
+
children: React.ReactNode;
|
|
213
|
+
disabled?: boolean;
|
|
214
|
+
onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
215
|
+
onItemClick?: (isClickable: boolean) => void;
|
|
216
|
+
} & React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
217
|
+
Link({ children, onItemClick, disabled, ...props }: {
|
|
218
|
+
children: React.ReactNode;
|
|
219
|
+
onItemClick?: (isClickable: boolean) => void;
|
|
220
|
+
disabled?: boolean;
|
|
221
|
+
} & React.AnchorHTMLAttributes<HTMLAnchorElement>): import("react/jsx-runtime").JSX.Element;
|
|
222
|
+
};
|
|
223
|
+
var Container: typeof DataTableContainer;
|
|
224
|
+
}
|
|
225
|
+
declare function DataTableContainer({ className: classNameProp, ...props }: {} & React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
226
|
+
export { DataTable };
|
|
227
|
+
export type { DataTableProps, DataTableColumnProp as DataTableColumn, DataTableApi };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type DataTableDropdownProps = {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
trigger?: string | React.ReactNode | ((open: boolean, disabled?: boolean | undefined) => string | React.ReactNode);
|
|
5
|
+
disabled?: boolean | undefined;
|
|
6
|
+
startOpen?: boolean | undefined;
|
|
7
|
+
onHover?: boolean | undefined;
|
|
8
|
+
id?: string | undefined;
|
|
9
|
+
alignment?: 'l' | 'r' | undefined;
|
|
10
|
+
dropUp?: boolean | undefined;
|
|
11
|
+
className?: string | undefined;
|
|
12
|
+
keepOpenAfterClick?: boolean | undefined;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* DataTable.Dropdown - A specialized dropdown component for use within DataTable.
|
|
16
|
+
* This component always uses a portal to render outside the table-container,
|
|
17
|
+
* preventing clipping issues caused by overflow properties on the table container.
|
|
18
|
+
* WIEHOE
|
|
19
|
+
*/
|
|
20
|
+
declare const DataTableDropdown: {
|
|
21
|
+
({ onHover, id, children: childrenProp, trigger: triggerProp, disabled, alignment, dropUp, startOpen, className: classNameProp, keepOpenAfterClick, }: DataTableDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
Trigger({ children }: {
|
|
23
|
+
children: React.ReactNode;
|
|
24
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
Divider(): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
Item({ children, onClick, onItemClick, disabled, ...props }: {
|
|
27
|
+
children: React.ReactNode;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
30
|
+
onItemClick?: (isClickable: boolean) => void;
|
|
31
|
+
} & React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
Link({ children, onItemClick, disabled, ...props }: {
|
|
33
|
+
children: React.ReactNode;
|
|
34
|
+
onItemClick?: (isClickable: boolean) => void;
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
} & React.AnchorHTMLAttributes<HTMLAnchorElement>): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
};
|
|
38
|
+
export { DataTableDropdown };
|
|
39
|
+
export type { DataTableDropdownProps };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ColorProp, StrictOmit } from './../../types';
|
|
2
|
+
type DividerProps = {
|
|
3
|
+
color?: ColorProp | 'default' | undefined;
|
|
4
|
+
className?: string | undefined;
|
|
5
|
+
style?: React.CSSProperties | undefined;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Divider component for separating content
|
|
9
|
+
* @param param0 - Props for the divider
|
|
10
|
+
* @returns Divider element
|
|
11
|
+
*/
|
|
12
|
+
declare const Divider: {
|
|
13
|
+
({ color, style, className: cnProp }: DividerProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
Primary(props: StrictOmit<DividerProps, "color">): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
Info(props: StrictOmit<DividerProps, "color">): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
Link(props: StrictOmit<DividerProps, "color">): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
Success(props: StrictOmit<DividerProps, "color">): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
Warning(props: StrictOmit<DividerProps, "color">): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
Danger(props: StrictOmit<DividerProps, "color">): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
Light(props: StrictOmit<DividerProps, "color">): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
Dark(props: StrictOmit<DividerProps, "color">): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
};
|
|
23
|
+
export { Divider };
|
|
@@ -0,0 +1,97 @@
|
|
|
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
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Props voor de DragDropList component
|
|
23
|
+
* @template T - Het type van de items in de lijst
|
|
24
|
+
*/
|
|
25
|
+
type DragDropListProps<T> = {
|
|
26
|
+
/** De array van items die getoond en herschikt kunnen worden */
|
|
27
|
+
items: T[];
|
|
28
|
+
/** Callback functie die wordt aangeroepen wanneer de volgorde van items verandert */
|
|
29
|
+
onReorder: (items: T[]) => void;
|
|
30
|
+
/** Functie die bepaalt hoe elk item gerenderd wordt */
|
|
31
|
+
renderItem: (item: T, info: RenderItemInfo) => React.ReactNode;
|
|
32
|
+
/** Functie of property naam die de unieke key voor elk item bepaalt */
|
|
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;
|
|
36
|
+
/** Optionele CSS class voor de lijst container */
|
|
37
|
+
className?: string;
|
|
38
|
+
/** Optionele CSS class voor elk list item */
|
|
39
|
+
itemClassName?: string;
|
|
40
|
+
/** Children moeten DragDropList.Handle en/of DragDropList.Buttons zijn om de layout te bepalen */
|
|
41
|
+
children?: React.ReactNode;
|
|
42
|
+
/** Callback wanneer een item wordt gesleept */
|
|
43
|
+
onDragStart?: (item: T, index: number) => void;
|
|
44
|
+
/** Callback wanneer het slepen eindigt */
|
|
45
|
+
onDragEnd?: (draggedItem: T | null, droppedSuccessfully: boolean) => void;
|
|
46
|
+
/** Callback wanneer over an item wordt gesleept */
|
|
47
|
+
onDragOver?: (item: T, index: number) => void;
|
|
48
|
+
/** Callback wanneer het slepen een item verlaat */
|
|
49
|
+
onDragLeave?: () => void;
|
|
50
|
+
/** Callback wanneer een item wordt gedropt */
|
|
51
|
+
onDrop?: (draggedItem: T, targetItem: T, draggedIndex: number, targetIndex: number) => void;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Een drag-and-drop lijst component waarmee items verticaal herschikt kunnen worden.
|
|
55
|
+
* @template T - Het type van de items in de lijst
|
|
56
|
+
* @example
|
|
57
|
+
* ```tsx
|
|
58
|
+
* const [items, setItems] = useState([
|
|
59
|
+
* { id: 1, name: 'Item 1', locked: false },
|
|
60
|
+
* { id: 2, name: 'Item 2', locked: true },
|
|
61
|
+
* ]);
|
|
62
|
+
*
|
|
63
|
+
* <DragDropList
|
|
64
|
+
* items={items}
|
|
65
|
+
* onReorder={setItems}
|
|
66
|
+
* keyExtractor="id"
|
|
67
|
+
* isDisabled="locked"
|
|
68
|
+
* className='container-class'
|
|
69
|
+
* itemClassName='item-class'
|
|
70
|
+
* renderItem={(item, info) => (
|
|
71
|
+
* <div>
|
|
72
|
+
* {item.name}
|
|
73
|
+
* {info.isFirstItem && ' (eerste)'}
|
|
74
|
+
* {info.isDisabled && ' (vergrendeld)'}
|
|
75
|
+
* </div>
|
|
76
|
+
* )}
|
|
77
|
+
* >
|
|
78
|
+
* <DragDropList.Handle>
|
|
79
|
+
* <Icon icon={faGripVertical} />
|
|
80
|
+
* </DragDropList.Handle>
|
|
81
|
+
* <DragDropList.Buttons />
|
|
82
|
+
* </DragDropList>
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
export declare function DragDropList<T>({ items, onReorder, renderItem, keyExtractor, isDisabled, className, itemClassName, children, onDragStart, onDragEnd, onDragOver, onDragLeave, onDrop, }: DragDropListProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
86
|
+
export declare namespace DragDropList {
|
|
87
|
+
var Handle: ({ children }: {
|
|
88
|
+
children?: React.ReactNode;
|
|
89
|
+
className?: string;
|
|
90
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
91
|
+
var Buttons: ({ children }: {
|
|
92
|
+
children?: React.ReactNode;
|
|
93
|
+
className?: string;
|
|
94
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
95
|
+
var Item: () => import("react/jsx-runtime").JSX.Element;
|
|
96
|
+
}
|
|
97
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type DropDownProps = {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
trigger?: string | React.ReactNode | ((open: boolean, disabled?: boolean | undefined) => string | React.ReactNode);
|
|
5
|
+
disabled?: boolean | undefined;
|
|
6
|
+
startOpen?: boolean | undefined;
|
|
7
|
+
onHover?: boolean | undefined;
|
|
8
|
+
id?: string | undefined;
|
|
9
|
+
alignment?: 'l' | 'r' | undefined;
|
|
10
|
+
dropUp?: boolean | undefined;
|
|
11
|
+
className?: string | undefined;
|
|
12
|
+
keepOpenAfterClick?: boolean | undefined;
|
|
13
|
+
usePortal?: boolean | undefined;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Dropdown component for creating dropdown menus.
|
|
17
|
+
* @description
|
|
18
|
+
* ⚠️ __LET OP__: Als je een dropdown binnen een DataTable gebruikt, gebruik dan altijd `DataTable.Dropdown` in plaats van deze `Dropdown` component.
|
|
19
|
+
* Het gaat alleen fout als je de table-container voor horizontaal scrollen in de tabel gebruikt, maar toch.
|
|
20
|
+
*
|
|
21
|
+
* @see DataTable.Dropdown for table-specific dropdown usage
|
|
22
|
+
*/
|
|
23
|
+
declare const Dropdown: {
|
|
24
|
+
({ onHover, id, children: childrenProp, trigger: triggerProp, disabled, alignment, dropUp, startOpen, className: classNameProp, keepOpenAfterClick, usePortal, }: DropDownProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
Trigger({ children }: {
|
|
26
|
+
children: React.ReactNode;
|
|
27
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
Divider(): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
Item({ children, onClick, onItemClick, disabled, ...props }: {
|
|
30
|
+
children: React.ReactNode;
|
|
31
|
+
onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
32
|
+
onItemClick?: (isClickable: boolean) => void;
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
} & React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
Link({ children, onItemClick, disabled, ...props }: {
|
|
36
|
+
children: React.ReactNode;
|
|
37
|
+
onItemClick?: (isClickable: boolean) => void;
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
} & React.AnchorHTMLAttributes<HTMLAnchorElement>): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
};
|
|
41
|
+
export { Dropdown };
|
|
42
|
+
export type { DropDownProps };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AlignmentProp } from './../../types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export type FooterProps = {
|
|
4
|
+
/** De content voor de footer */
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
/** Alignment bij de footer. (default = 'c') */
|
|
7
|
+
alignment?: AlignmentProp;
|
|
8
|
+
/** Extra classes voor op de footer */
|
|
9
|
+
className?: string;
|
|
10
|
+
/** Custom styles voor de footer */
|
|
11
|
+
styles?: React.CSSProperties;
|
|
12
|
+
itemRef?: React.RefObject<any> | null;
|
|
13
|
+
id?: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Maak een footer voor onderaan de pagina.
|
|
17
|
+
* - de footer bevat een container waarvan de text default 'centered' is.
|
|
18
|
+
* @param props
|
|
19
|
+
* @returns een footer met daarin de content.
|
|
20
|
+
* @example <Footer>This is a footer</Footer>
|
|
21
|
+
*/
|
|
22
|
+
export declare function Footer({ children, alignment, className: cn, styles, id, itemRef }: FooterProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ColorProp, StrictOmit } from './../../types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
type HelpTxtProps = {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
color?: ColorProp;
|
|
7
|
+
};
|
|
8
|
+
type HelpTxtPropsNoColor = StrictOmit<HelpTxtProps, 'color'>;
|
|
9
|
+
declare const HelpTxt: {
|
|
10
|
+
({ color, className: cn, children }: HelpTxtProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
Info(props: HelpTxtPropsNoColor): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
Link(props: HelpTxtPropsNoColor): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
Primary(props: HelpTxtPropsNoColor): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
Danger(props: HelpTxtPropsNoColor): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
Success(props: HelpTxtPropsNoColor): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
Warning(props: HelpTxtPropsNoColor): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
};
|
|
18
|
+
export { HelpTxt };
|
|
19
|
+
export type { HelpTxtProps };
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { SizeProp, AnchorTargetProp, AnchorRelProp } from './../../types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
type HeroProps = {
|
|
4
|
+
itemRef?: React.RefObject<any> | null;
|
|
5
|
+
id?: string;
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* force dark of light hero
|
|
9
|
+
* @ignore werkt nog niet. */
|
|
10
|
+
forceScheme?: 'dark' | 'light' | undefined;
|
|
11
|
+
/** Type hero */
|
|
12
|
+
heroColorFor?: 'werknemer' | 'werkgever' | 'klant' | 'admin' | 'primary' | undefined;
|
|
13
|
+
/** De grootte van de hero (default = small ('s')) */
|
|
14
|
+
size?: SizeProp | undefined;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Maak een schermbrede hero aan. Optionele top-buttons en/of tabs voor navigatie
|
|
18
|
+
* @param props
|
|
19
|
+
* @returns een Hero
|
|
20
|
+
* @example
|
|
21
|
+
*/
|
|
22
|
+
declare const Hero: {
|
|
23
|
+
({ children: nodes, heroColorFor, size, itemRef, id, forceScheme }: HeroProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
Body({ children }: {
|
|
25
|
+
children: React.ReactNode;
|
|
26
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
/**
|
|
28
|
+
* Hero foot with navigation
|
|
29
|
+
* @param props props
|
|
30
|
+
* @returns hero foot with navigation
|
|
31
|
+
* @example
|
|
32
|
+
* <Hero.Foot>
|
|
33
|
+
* <ul>
|
|
34
|
+
* <li className="is-active"><a href="">Active Navigation Link </a></li>
|
|
35
|
+
* <li><a href="">Another Navigation Link</a></li>
|
|
36
|
+
* </ul>
|
|
37
|
+
* </Hero.Foot>
|
|
38
|
+
*
|
|
39
|
+
* <Hero.NavList>
|
|
40
|
+
* <Hero.NavItem to="/">Navigation Link</Hero.NavItem>
|
|
41
|
+
* </Hero.NavList>
|
|
42
|
+
*/
|
|
43
|
+
Foot: {
|
|
44
|
+
({ children, narrow }: {
|
|
45
|
+
children: React.ReactNode;
|
|
46
|
+
narrow?: boolean;
|
|
47
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
NavList({ children }: {
|
|
49
|
+
children: React.ReactNode;
|
|
50
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
NavItem: typeof FootNavItem;
|
|
52
|
+
/** Navigation Item voor in een Hero Foot. Parent should be <Hero.Foot.NavList>
|
|
53
|
+
* @param props props
|
|
54
|
+
* @returns Navigation Item for Hero's
|
|
55
|
+
* @example <Hero.Foot.NavItem to="/">URL</Hero.Foot.NavItem>
|
|
56
|
+
*/
|
|
57
|
+
NavLink: typeof FootNavLink;
|
|
58
|
+
};
|
|
59
|
+
/** Top-bar van de hero met
|
|
60
|
+
* - een BurgerMenu voor de navigatie-items
|
|
61
|
+
* - items aan de rechterkant van het scherm
|
|
62
|
+
* @param props props
|
|
63
|
+
* @returns een HeroHead met daarin optionele links of buttons
|
|
64
|
+
* @example
|
|
65
|
+
* <Hero.Head>
|
|
66
|
+
* <Hero.Head.Button onClick={handleClickNotify}>Notify</Hero.Head.Button>
|
|
67
|
+
* <Hero.Head.Button onClick={handleClickClear}>Clear</Hero.Head.Button>
|
|
68
|
+
* <Hero.Head.Link to="https://www.bulma.io">Bulma</Hero.Head.Link>
|
|
69
|
+
* <Hero.Head.Link to="https://www.nodeJS.org">NodeJS</Hero.Head.Link>
|
|
70
|
+
* </Hero.Head>
|
|
71
|
+
*/
|
|
72
|
+
Head: {
|
|
73
|
+
({ children }: {
|
|
74
|
+
children: React.ReactNode;
|
|
75
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
76
|
+
Button({ children, title, onClick }: {
|
|
77
|
+
children: React.ReactNode;
|
|
78
|
+
title?: string;
|
|
79
|
+
onClick?: (e: any) => void;
|
|
80
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
81
|
+
Link({ children, title, to, target, rel, }: {
|
|
82
|
+
children: React.ReactNode;
|
|
83
|
+
title?: string;
|
|
84
|
+
to?: string;
|
|
85
|
+
target?: AnchorTargetProp;
|
|
86
|
+
rel?: AnchorRelProp;
|
|
87
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
declare function FootNavItem({ children, active, title }: {
|
|
91
|
+
children: React.ReactNode;
|
|
92
|
+
active?: boolean;
|
|
93
|
+
title?: string;
|
|
94
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
95
|
+
declare function FootNavLink({ children, active, title, to, target, rel, }: {
|
|
96
|
+
children: React.ReactNode;
|
|
97
|
+
active?: boolean;
|
|
98
|
+
title?: string;
|
|
99
|
+
to?: string;
|
|
100
|
+
target?: AnchorTargetProp;
|
|
101
|
+
rel?: AnchorRelProp;
|
|
102
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
103
|
+
export { Hero };
|
|
104
|
+
export type { HeroProps };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
2
|
+
import { SizeProp, ColorProp } from './../../types';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
type IconProps = {
|
|
5
|
+
/** React font-awesome icon
|
|
6
|
+
* - `string`: geef de gehele font-awesome-class op. 'flip', 'animate', 'rotation' worden dan al gebruikt in deze class.
|
|
7
|
+
* - `IconProp (fontawesome)`: geef een react IconProp object door.
|
|
8
|
+
*/
|
|
9
|
+
icon: string | IconProp;
|
|
10
|
+
/** De icon-grootte (default = `m` */
|
|
11
|
+
size?: SizeProp;
|
|
12
|
+
/** De kleur voor het icoon (default = `p`) */
|
|
13
|
+
color?: ColorProp;
|
|
14
|
+
/** Hoeveel graden moet het icoon gedraait zijn (default = 0) */
|
|
15
|
+
rotation?: 0 | 90 | 180 | 270;
|
|
16
|
+
/** Horizontaal, verticaal of beiden gespiegeld */
|
|
17
|
+
flip?: 'horizontal' | 'vertical' | 'both';
|
|
18
|
+
/** Moet het icon spinnen of pulseren */
|
|
19
|
+
animate?: 'spin' | 'pulse';
|
|
20
|
+
/** extra classes voor op de icon-container */
|
|
21
|
+
className?: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Toon een Font Awesome Icon
|
|
25
|
+
* default: 1.5rem x 1.5rem, de font-size is inherited.
|
|
26
|
+
* @returns een Icon element
|
|
27
|
+
* @example
|
|
28
|
+
* <Icon icon="fas fa-flag" />
|
|
29
|
+
* <Icon icon={faFlag} /> // import { faFlag } from '@fortawesome/free-solid-svg-icons';
|
|
30
|
+
*/
|
|
31
|
+
declare function Icon({ color, size, rotation, icon, flip, animate, className: classNameProp }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
type IconTextProps = {
|
|
33
|
+
/** React font-awesome icon
|
|
34
|
+
* - `string`: geef de gehele font-awesome-class op. 'flip', 'animate', 'rotation' worden dan al gebruikt in deze class.
|
|
35
|
+
* - `IconProp (fontawesome)`: geef een react IconProp object door.
|
|
36
|
+
*/
|
|
37
|
+
icon: string | IconProp;
|
|
38
|
+
/** De icon-grootte */
|
|
39
|
+
size?: SizeProp;
|
|
40
|
+
/** De kleur voor het icoon */
|
|
41
|
+
color?: ColorProp;
|
|
42
|
+
/** De kleur voor het icoon - als die anders moet zijn dan de kleur van de tekst */
|
|
43
|
+
iconColor?: ColorProp;
|
|
44
|
+
/** Hoeveel graden moet het icoon gedraait zijn (0 - 360) */
|
|
45
|
+
rotation?: 0 | 90 | 180 | 270;
|
|
46
|
+
/** Horizontaal, verticaal of beiden geflipt */
|
|
47
|
+
flip?: 'horizontal' | 'vertical' | 'both';
|
|
48
|
+
/** Moet het icon spinnen of pulseren */
|
|
49
|
+
animate?: 'spin' | 'pulse';
|
|
50
|
+
/** Tekst bij het icon */
|
|
51
|
+
children: React.ReactNode;
|
|
52
|
+
/** mag dit item wrappen? text op volgende regel? (default = 'false') */
|
|
53
|
+
allowWrap?: boolean;
|
|
54
|
+
/** extra classes voor op de icon-container */
|
|
55
|
+
className?: string;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Toon een Font Awesome Icon met bijhorende tekst. De tekst krijgt dezeflde kleur als de icon
|
|
59
|
+
* IconText is een inline-flex element dus kan in een paragraaf worden gebruikt.
|
|
60
|
+
* default: 1.5rem x 1.5rem, de font-size is inherited.
|
|
61
|
+
* @returns een Icon met tekst in dezelfde kleur als het icon
|
|
62
|
+
* @example
|
|
63
|
+
* <IconText icon="fas fa-flag">Flag</IconText>
|
|
64
|
+
* <IconText icon={faFlag}>Flag</IconText> // import { faFlag } from '@fortawesome/free-solid-svg-icons';
|
|
65
|
+
*/
|
|
66
|
+
declare function IconText({ icon, size, color, iconColor, rotation, flip, animate, allowWrap, children, className: classNameProp }: IconTextProps): import("react/jsx-runtime").JSX.Element;
|
|
67
|
+
type IconStackProps = {
|
|
68
|
+
colors?: ColorProp[];
|
|
69
|
+
icons: string[] | IconProp[];
|
|
70
|
+
sizes?: SizeProp[];
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Stapel een x aantal icoontjes op elkaar, om ze visueel samen te voegen. Het 1e item is de onderste, de laatste de bovenste.
|
|
74
|
+
* @example <IconStack icons={[faHorseHead, faSlash]} />
|
|
75
|
+
* @example <IconStack icons={[faHorseHead, faSlash]} colors={['p', 'd']} />
|
|
76
|
+
* @example <IconStack icons={[faHorseHead, faSlash]} colors={['p', 'd']} sizes={['m', 'l']} />
|
|
77
|
+
* @param colors: array van kleuren voor de iconen. (default = ['p',...])
|
|
78
|
+
* @param sizes: array van grootte voor de iconen. (default = ['s',...])
|
|
79
|
+
* @param icons: array van iconen. (default = [faHorseHead, faSlash])
|
|
80
|
+
* @returns
|
|
81
|
+
*/
|
|
82
|
+
declare function IconStack({ colors: clrs, icons, sizes: szs }: IconStackProps): import("react/jsx-runtime").JSX.Element;
|
|
83
|
+
export { Icon, IconText, IconStack };
|
|
84
|
+
export type { IconProps, IconTextProps, IconStackProps };
|