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,185 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DeepPartial, StrictOmit } from './../../types';
|
|
3
|
+
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
4
|
+
type InitialStateParams = 'expanded' | 'collapsed' | 'auto';
|
|
5
|
+
type GlobalExpandStateParams = 'expanded' | 'collapsed';
|
|
6
|
+
type SearchBehaviorParams = 'hide' | 'dim';
|
|
7
|
+
type GlobalExpandCommand = {
|
|
8
|
+
state: GlobalExpandStateParams | 'expandToLevel';
|
|
9
|
+
nonce: number;
|
|
10
|
+
level?: number;
|
|
11
|
+
};
|
|
12
|
+
type TreeViewRef = {
|
|
13
|
+
expandAll: () => void;
|
|
14
|
+
collapseAll: () => void;
|
|
15
|
+
expandToLevel: (depth: number) => void;
|
|
16
|
+
};
|
|
17
|
+
/** icon-set voor de treeview */
|
|
18
|
+
type IconSet = {
|
|
19
|
+
/** icon voor node die je kan expanden (default: chevron Down) */
|
|
20
|
+
expand: IconProp;
|
|
21
|
+
/** icon voor node die momenteel is uitgebreid (default: chevron Up) */
|
|
22
|
+
collapse: IconProp;
|
|
23
|
+
/** icon voor node zonder kinderen (default: Min-teken) */
|
|
24
|
+
noChildren: IconProp;
|
|
25
|
+
};
|
|
26
|
+
/** De basis-props voor de nodes en de items */
|
|
27
|
+
type BaseProps = {
|
|
28
|
+
/** het path naar deze node*/
|
|
29
|
+
path: string;
|
|
30
|
+
/** het nu gehoverde path */
|
|
31
|
+
hoveredPath: string;
|
|
32
|
+
/** hovered-path setter */
|
|
33
|
+
setHoveredPath: (path: string) => void;
|
|
34
|
+
/** het nu geselecteerde path */
|
|
35
|
+
selectedPath: string;
|
|
36
|
+
/** selected-path setter */
|
|
37
|
+
setSelectedPath: (path: string) => void;
|
|
38
|
+
};
|
|
39
|
+
type InternTreeViewProps<T extends unknown = string> = BaseProps & {
|
|
40
|
+
/** (optionele) class prop voor de tree */
|
|
41
|
+
className?: string;
|
|
42
|
+
/** (optionele) style-prop */
|
|
43
|
+
style?: React.CSSProperties;
|
|
44
|
+
/** Data in de treeview */
|
|
45
|
+
nodes?: Array<TreeViewNode<T>>;
|
|
46
|
+
expanded: boolean;
|
|
47
|
+
/** internal command for expand/collapse actions */
|
|
48
|
+
globalExpandCommand?: GlobalExpandCommand;
|
|
49
|
+
/** initial path to select/open */
|
|
50
|
+
initialPath?: string;
|
|
51
|
+
/** initial expanded/collapsed state of parent */
|
|
52
|
+
parentInitialState?: InitialStateParams;
|
|
53
|
+
/** search term to filter nodes */
|
|
54
|
+
searchTerm?: string;
|
|
55
|
+
/** how to display search results */
|
|
56
|
+
searchBehavior?: SearchBehaviorParams;
|
|
57
|
+
/** Custom search function to determine if a node matches the search term */
|
|
58
|
+
searchFn?: (node: TreeViewNode<T>, searchTerm: string) => boolean;
|
|
59
|
+
/** expand/collapse/noChildren icons */
|
|
60
|
+
icons: IconSet;
|
|
61
|
+
};
|
|
62
|
+
type TreeViewNode<T extends unknown = string> = {
|
|
63
|
+
/** de value van deze node (default een string, maar generic) */
|
|
64
|
+
value: T;
|
|
65
|
+
/** het label op deze node. string of functie die een string oplevert */
|
|
66
|
+
label: React.ReactNode | ((v: T) => React.ReactNode);
|
|
67
|
+
/**
|
|
68
|
+
* hoe moeten we het item identificeren (te gebruiken als `key` in `.map()`).
|
|
69
|
+
* Default ='value', die werkt alleen voor strings, booleans en numbers. Voor een ander type moet je een key of een functie geven.
|
|
70
|
+
* Het resultaat MOET altijd een string opleveren. Wordt gebruikt om het item te identificeren EN in het path dat we exporteren
|
|
71
|
+
* - `value`: gebruik de value zelf (werkt alleen als value een string, number, boolean is)
|
|
72
|
+
* - `keyof T`: gebruik de property van T met deze key als identificatie (werkt alleen als die property een string, number, boolean is)
|
|
73
|
+
* - `(item: T) => string`: een functie die een unieke string oplevert voor deze value. In combinatie met de rest van het path dus uniek
|
|
74
|
+
*/
|
|
75
|
+
childIdentifier?: 'value' | keyof T | ((item: T) => string);
|
|
76
|
+
/** de child-items van deze tree node */
|
|
77
|
+
items?: Array<TreeViewNode<T>>;
|
|
78
|
+
/** onclick-callback van de node
|
|
79
|
+
* @param value de value van de node
|
|
80
|
+
* @param path het path naar deze node
|
|
81
|
+
*/
|
|
82
|
+
onClick?: (value: T, path: string) => void;
|
|
83
|
+
/** initial expansion state of the node */
|
|
84
|
+
initialState?: InitialStateParams;
|
|
85
|
+
/**
|
|
86
|
+
* Optionele zoek-string of function die een zoek-string oplevert.
|
|
87
|
+
* Wanneer opgegeven, wordt deze gebruikt in plaats van te proberen tekst uit het label
|
|
88
|
+
* of de value te extraheren voor zoekmatching. Dus werkt beter voor complexere Nodes.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* // Static searchable content
|
|
92
|
+
* searchable: "Item 1 horse icon"
|
|
93
|
+
* // Dynamic searchable content based on node value
|
|
94
|
+
* searchable: (value) => `${value} custom searchable text`
|
|
95
|
+
*/
|
|
96
|
+
searchable?: string | ((value: T) => string);
|
|
97
|
+
};
|
|
98
|
+
/** Props voor de TreeView */
|
|
99
|
+
type TreeViewRootProps<T extends unknown = string> = StrictOmit<InternTreeViewProps<T>, 'path' | 'hoveredPath' | 'setHoveredPath' | 'selectedPath' | 'setSelectedPath' | 'expanded' | 'icons'> & {
|
|
100
|
+
/** initial path to expand */
|
|
101
|
+
initialPath?: string;
|
|
102
|
+
/** Zoekterm om de nodes te doorzoeken */
|
|
103
|
+
searchTerm?: string;
|
|
104
|
+
/**
|
|
105
|
+
* Weergave-gedrag bij zoeken:
|
|
106
|
+
* 'hide' - verberg niet-overeenkomende nodes
|
|
107
|
+
* 'dim' - dim niet-overeenkomende nodes (standaard)
|
|
108
|
+
*/
|
|
109
|
+
searchBehavior?: SearchBehaviorParams;
|
|
110
|
+
/**
|
|
111
|
+
* Zoekfunctie om te bepalen of een node overeenkomt met de zoekterm.
|
|
112
|
+
* @param node - The tree node to check
|
|
113
|
+
* @param searchTerm - The current search term
|
|
114
|
+
* @returns true if the node matches the search term
|
|
115
|
+
*/
|
|
116
|
+
searchFn?: (node: TreeViewNode<T>, searchTerm: string) => boolean;
|
|
117
|
+
/** Icon set for the TreeView: 3 properties:
|
|
118
|
+
* - `expand`: icon voor node die je kan expanden (default: chevron Down)
|
|
119
|
+
* - `collapse`: icon voor node die momenteel is uitgebreid (default: chevron Up)
|
|
120
|
+
* - `noChildren`: icon voor node zonder kinderen (default: Min-teken)
|
|
121
|
+
*/
|
|
122
|
+
icons?: DeepPartial<IconSet>;
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* TreeView component om hiërarchische data weer te geven.
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* <input type="text" value={term} onChange={(e) => setTerm(e.target.value)} placeholder="Zoek term" />
|
|
129
|
+
* <select value={behavior} onChange={(e) => setBehavior(e.target.value as 'hide' | 'dim')}>
|
|
130
|
+
* <option value="dim">Dim niet-overeenkomende items</option>
|
|
131
|
+
* <option value="hide">Verberg niet-overeenkomende items</option>
|
|
132
|
+
* </select>
|
|
133
|
+
*
|
|
134
|
+
* return <TreeView
|
|
135
|
+
* nodes={data}
|
|
136
|
+
* initialPath="/Root/Item 1/Item 1.1/Item 1.1.2"
|
|
137
|
+
* searchTerm={term}
|
|
138
|
+
* searchBehavior={behavior} />
|
|
139
|
+
* @example // Gebruik van useTreeViewControls hook voor expandAll/collapseAll
|
|
140
|
+
* function Demo() {
|
|
141
|
+
* const { treeRef, expandAll, collapseAll } = useTreeViewControls();
|
|
142
|
+
*
|
|
143
|
+
* return (
|
|
144
|
+
* <>
|
|
145
|
+
* <Buttons>
|
|
146
|
+
* <Button onClick={expandAll}>Expand all</Button>
|
|
147
|
+
* <Button onClick={collapseAll}>Collapse all</Button>
|
|
148
|
+
* </Buttons>
|
|
149
|
+
*
|
|
150
|
+
* <TreeView ref={treeRef} nodes={data} />
|
|
151
|
+
* </>
|
|
152
|
+
* );
|
|
153
|
+
* }
|
|
154
|
+
|
|
155
|
+
*/
|
|
156
|
+
declare const TreeViewRoot: <T extends unknown = string>(props: TreeViewRootProps<T> & React.RefAttributes<TreeViewRef>) => React.ReactElement;
|
|
157
|
+
declare function TreeViewNode<T extends unknown = string>({ className: cnProp, style, path, expanded, globalExpandCommand, initialPath, hoveredPath, setHoveredPath, selectedPath, setSelectedPath, nodes, parentInitialState, searchTerm, searchBehavior, icons, searchFn, }: InternTreeViewProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
158
|
+
/**
|
|
159
|
+
* Hook om de `TreeView` imperatief aan te sturen met `expandAll`, `collapseAll`, en `expandToLevel`.
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
* function Demo() {
|
|
163
|
+
* const { treeRef, expandAll, collapseAll, expandToLevel } = useTreeViewControls();
|
|
164
|
+
*
|
|
165
|
+
* return (
|
|
166
|
+
* <>
|
|
167
|
+
* <Buttons>
|
|
168
|
+
* <Button onClick={expandAll}>Expand all</Button>
|
|
169
|
+
* <Button onClick={collapseAll}>Collapse all</Button>
|
|
170
|
+
* <Button onClick={() => expandToLevel(2)}>Show 2 levels</Button>
|
|
171
|
+
* </Buttons>
|
|
172
|
+
*
|
|
173
|
+
* <TreeView ref={treeRef} nodes={data} />
|
|
174
|
+
* </>
|
|
175
|
+
* );
|
|
176
|
+
* }
|
|
177
|
+
*/
|
|
178
|
+
declare function useTreeViewControls(): {
|
|
179
|
+
treeRef: React.RefObject<TreeViewRef | null>;
|
|
180
|
+
expandAll: () => void;
|
|
181
|
+
collapseAll: () => void;
|
|
182
|
+
expandToLevel: (depth: number) => void;
|
|
183
|
+
};
|
|
184
|
+
export type { TreeViewRootProps as TreeViewProps, TreeViewNode, TreeViewRef };
|
|
185
|
+
export { TreeViewRoot as TreeView, useTreeViewControls };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
2
|
+
import { ColorProp } from './../../types';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
type ActionSheetButton<T extends unknown = {}> = string | {
|
|
5
|
+
txt?: string | ((v: T) => string);
|
|
6
|
+
icon?: string | IconProp;
|
|
7
|
+
value: T | string;
|
|
8
|
+
color?: ColorProp;
|
|
9
|
+
key?: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
type State<T extends unknown = {}> = {
|
|
12
|
+
show: boolean;
|
|
13
|
+
content: string | React.ReactNode;
|
|
14
|
+
buttons: Array<ActionSheetButton<T>>;
|
|
15
|
+
value?: ActionSheetButton<T>;
|
|
16
|
+
modalID: number;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* ActionSheet provider om `useActionSheet`-hook te kunnen gebruiken.
|
|
20
|
+
* @param children de children
|
|
21
|
+
* @returns
|
|
22
|
+
* @example // index.tsx of App.tsx
|
|
23
|
+
* root.render(
|
|
24
|
+
* <ActionSheetProvider>
|
|
25
|
+
* <>
|
|
26
|
+
* // ...
|
|
27
|
+
* </>
|
|
28
|
+
* </ActionSheetProvider>)
|
|
29
|
+
*/
|
|
30
|
+
declare function ActionSheetProvider({ children }: {
|
|
31
|
+
children: React.ReactNode;
|
|
32
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
/**
|
|
34
|
+
* Hook voor de confirmation
|
|
35
|
+
* @param buttons tekst voor op de OK-button (default = 'OK')
|
|
36
|
+
* @returns onAction-fn, actionSheet-fn, confirmState
|
|
37
|
+
* @example
|
|
38
|
+
* const { actionSheet } = useActionSheet(['1', '2', '3', '4']);
|
|
39
|
+
* // ...
|
|
40
|
+
* const onClick = async () => {
|
|
41
|
+
* let value = await actionSheetObjects(<p>Wooooot</p>);
|
|
42
|
+
* };
|
|
43
|
+
* @example
|
|
44
|
+
* const { actionSheet } = useActionSheet<{ num: number } | string>();
|
|
45
|
+
* const onClick = async () => {
|
|
46
|
+
* let value = await actionSheet({
|
|
47
|
+
* content:<p>Wooooot</p>,
|
|
48
|
+
* buttons:[
|
|
49
|
+
* { value: '1', txt: 'een', color: 'i' },
|
|
50
|
+
* { value: '2', txt: 'twee', color: 's', icon: faHorseHead },
|
|
51
|
+
* { value: { num: 3 }, color: 'd' },
|
|
52
|
+
* { value: '4', txt: 'vier', color: 'w', icon: faShareNodes },
|
|
53
|
+
* ]
|
|
54
|
+
* });
|
|
55
|
+
* }
|
|
56
|
+
*/
|
|
57
|
+
declare function useActionSheet<T extends unknown = string>(): {
|
|
58
|
+
/**
|
|
59
|
+
* awaitable actionsheet function. Geef een string of Fragment op om iets in de actionsheet-modal te tonen
|
|
60
|
+
* @param content string of Fragment met de boodschap voor de actionsheet
|
|
61
|
+
* @param buttons array van ActionSheetButton-objecten
|
|
62
|
+
* @returns `Promise<string|ActionSheetButton>` met true als de gebruiker op een action heeft geklikt,
|
|
63
|
+
*/
|
|
64
|
+
actionSheet: ({ content, buttons }: {
|
|
65
|
+
content: string | React.ReactNode;
|
|
66
|
+
buttons: ActionSheetButton<T>[];
|
|
67
|
+
}) => Promise<T>;
|
|
68
|
+
/** INTERNAL USE ONLY - DO NOT USE */
|
|
69
|
+
actionSheetState: State<T>;
|
|
70
|
+
/** INTERNAL USE ONLY - DO NOT USE */
|
|
71
|
+
onAction: (val: ActionSheetButton<T>) => void;
|
|
72
|
+
/** INTERNAL USE ONLY - DO NOT USE */
|
|
73
|
+
onCancel: () => void;
|
|
74
|
+
};
|
|
75
|
+
export { ActionSheetProvider, useActionSheet };
|
|
76
|
+
export type { ActionSheetButton };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ColorSchemeType } from './../../types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { OptionalDefaultsType } from '../DefaultsProvider/DefaultsProvider';
|
|
4
|
+
type AppProviderProps = {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
notifierLocation?: 'top' | 'bottom';
|
|
7
|
+
initialTheme?: ColorSchemeType;
|
|
8
|
+
defaults?: OptionalDefaultsType;
|
|
9
|
+
onThemeChanged?: (v: ColorSchemeType) => void;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Provider-wrapper die alle LoonBulmaReact providers bevat.
|
|
13
|
+
* @param param0
|
|
14
|
+
* @returns
|
|
15
|
+
*/
|
|
16
|
+
export declare function LoonBulmaReactProviders({ children, initialTheme, notifierLocation, defaults, onThemeChanged }: AppProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ColorSchemeType } from './../../types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare const ColorSchemeContext: React.Context<{
|
|
4
|
+
scheme: ColorSchemeType;
|
|
5
|
+
setScheme: (v: ColorSchemeType) => void;
|
|
6
|
+
}>;
|
|
7
|
+
export declare function ColorSchemeProvider({ children, initialScheme, onThemeChanged, }: {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
initialScheme?: ColorSchemeType | undefined;
|
|
10
|
+
onThemeChanged?: (t: ColorSchemeType) => void;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function useColorScheme(): {
|
|
13
|
+
scheme: ColorSchemeType;
|
|
14
|
+
setScheme: (v: ColorSchemeType) => void;
|
|
15
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
3
|
+
type State = {
|
|
4
|
+
show: boolean;
|
|
5
|
+
content: string | React.ReactNode;
|
|
6
|
+
ok: string;
|
|
7
|
+
okIcon?: IconProp | undefined;
|
|
8
|
+
cancel: string;
|
|
9
|
+
cancelIcon?: IconProp | undefined;
|
|
10
|
+
otherButtons?: React.ReactNode[];
|
|
11
|
+
modalID: number;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Confirm provider om `useConfirm`-hook te kunnen gebruiken.
|
|
15
|
+
* @param children de children
|
|
16
|
+
* @returns
|
|
17
|
+
* @example // index.tsx of App.tsx
|
|
18
|
+
* root.render(
|
|
19
|
+
* <ConfirmProvider>
|
|
20
|
+
* <>
|
|
21
|
+
* // ...
|
|
22
|
+
* </>
|
|
23
|
+
* </ConfirmProvider>)
|
|
24
|
+
*/
|
|
25
|
+
declare function ConfirmProvider({ children }: {
|
|
26
|
+
children: React.ReactNode;
|
|
27
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
/**
|
|
29
|
+
* Hook voor de confirmation
|
|
30
|
+
* @param ok tekst voor op de OK-button (default = 'OK')
|
|
31
|
+
* @param cancel tekst voor opd e cancel-button (default = 'Annuleren')
|
|
32
|
+
* @param others eventuele andere buttons (default = undefined)
|
|
33
|
+
* @returns onConfirm-fn, onCancel-fn, confirm-fn, confirmState
|
|
34
|
+
* @example
|
|
35
|
+
* const { confirm } = useConfirm();
|
|
36
|
+
* const confirmSomethingFromString = (msg: string) => {
|
|
37
|
+
* const isConfirmed = await (confirm(msg), "OKeeeee", "Annuleeeeren")
|
|
38
|
+
* }
|
|
39
|
+
* @example // met default ok & annuleren
|
|
40
|
+
* const { confirm } = useConfirm();
|
|
41
|
+
* const confirmSomethingFromFragment = (fragment: React.ReactNode) => {
|
|
42
|
+
* const isConfirmed = await (confirm(fragment)) // OK = "OK", Cancel = "Annuleren" (defaults)
|
|
43
|
+
* }
|
|
44
|
+
*/
|
|
45
|
+
declare function useConfirm(): {
|
|
46
|
+
/** INTERNAL USE ONLY - DO NOT USE */
|
|
47
|
+
onConfirm: () => void;
|
|
48
|
+
/** INTERNAL USE ONLY - DO NOT USE */
|
|
49
|
+
onCancel: () => void;
|
|
50
|
+
/**
|
|
51
|
+
* awaitable confirm function. Geef een string of Fragment op om iets in de confirm-modal te tonen
|
|
52
|
+
* @param content string of Fragment met de boodschap voor de confirm
|
|
53
|
+
* @returns Promise<boolean> met true als de gebruiker op OK heeft geklikt, false als anders
|
|
54
|
+
* @example const isConfirmed = await confirm("Weet je het zeker?")
|
|
55
|
+
*/
|
|
56
|
+
confirm: (content: string | React.ReactNode, okText: string | undefined, cancelText: string | undefined, okIcon?: IconProp | undefined, cancelIcon?: IconProp | undefined, ...otherButtons: React.ReactNode[]) => Promise<boolean>;
|
|
57
|
+
/** INTERNAL USE ONLY - DO NOT USE */
|
|
58
|
+
confirmState: State;
|
|
59
|
+
};
|
|
60
|
+
export { ConfirmProvider, useConfirm };
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { SizeProp, DirectionProp, AlignmentProp, ColorProp, TagSizeProp } from './../../types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
type InputSettings = {
|
|
4
|
+
/** default size setting (`m`) */
|
|
5
|
+
size: SizeProp;
|
|
6
|
+
/** default direction setting (`v`) */
|
|
7
|
+
direction: DirectionProp;
|
|
8
|
+
/** default alignment setting (`l`) */
|
|
9
|
+
alignment: AlignmentProp;
|
|
10
|
+
/** default direction setting for radio-button-items (`v`) */
|
|
11
|
+
rbDirection: DirectionProp;
|
|
12
|
+
};
|
|
13
|
+
type ButtonSettings = {
|
|
14
|
+
/** default size setting (`m`) */
|
|
15
|
+
size: SizeProp;
|
|
16
|
+
/** default color setting (`p`) , voor als er geen color is opgegeven*/
|
|
17
|
+
color: ColorProp;
|
|
18
|
+
};
|
|
19
|
+
type TabSettings = {
|
|
20
|
+
/** default size setting (`m`) */
|
|
21
|
+
size: SizeProp;
|
|
22
|
+
/** default tab type setting (`lined`) */
|
|
23
|
+
type: 'page' | 'lined' | 'toggle' | 'pill';
|
|
24
|
+
};
|
|
25
|
+
type TagSettings = {
|
|
26
|
+
/** default size setting (`m`) */
|
|
27
|
+
size: TagSizeProp;
|
|
28
|
+
};
|
|
29
|
+
type DefaultsType = {
|
|
30
|
+
/** default settings for inputs */
|
|
31
|
+
input: InputSettings;
|
|
32
|
+
/** default button settings*/
|
|
33
|
+
button: ButtonSettings;
|
|
34
|
+
/** default tabbar settings */
|
|
35
|
+
tabs: TabSettings;
|
|
36
|
+
/** default tag settings */
|
|
37
|
+
tags: TagSettings;
|
|
38
|
+
/** default alignment settings */
|
|
39
|
+
alignment: AlignmentProp;
|
|
40
|
+
/** default settings voor de datatable paginatie */
|
|
41
|
+
datatablePagination: DatatablePaginationOptions;
|
|
42
|
+
};
|
|
43
|
+
export type DatatablePaginationOptions = {
|
|
44
|
+
/** tonen we pagination? */
|
|
45
|
+
hidden: boolean;
|
|
46
|
+
/** vanaf wel aantal rijen is paginatie actief */
|
|
47
|
+
threshold: number;
|
|
48
|
+
/** initiele pagination number. default = 1 (first) */
|
|
49
|
+
initialPage: number;
|
|
50
|
+
/** Default aantal rijen per pagina (Infinity voor alles)*/
|
|
51
|
+
initialRowsPerPage: number;
|
|
52
|
+
/** Opties voor aantal rijen per pagina (gebruik value `Infinity` voor alles) */
|
|
53
|
+
rowsPerPageOptions: {
|
|
54
|
+
label: string;
|
|
55
|
+
value: number;
|
|
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;
|
|
62
|
+
};
|
|
63
|
+
/** Partial type voor het updaten van een of meer enkele settings.
|
|
64
|
+
* Alle properties zijn optioneel, en kunnen dus ook weggelaten worden.
|
|
65
|
+
*/
|
|
66
|
+
export type OptionalDefaultsType = Partial<{
|
|
67
|
+
/** default settings for inputs */
|
|
68
|
+
input: Partial<InputSettings>;
|
|
69
|
+
/** default button settings*/
|
|
70
|
+
button: Partial<ButtonSettings>;
|
|
71
|
+
/** default tabbar settings */
|
|
72
|
+
tabs: Partial<TabSettings>;
|
|
73
|
+
/** default tag settings */
|
|
74
|
+
tags: Partial<TagSettings>;
|
|
75
|
+
/** default alignment settings */
|
|
76
|
+
alignment: Partial<AlignmentProp>;
|
|
77
|
+
datatablePagination: Partial<DatatablePaginationOptions>;
|
|
78
|
+
}>;
|
|
79
|
+
/**
|
|
80
|
+
* Context voor het bijhouden van de default waardes voor de LoonBulmaReact componenten
|
|
81
|
+
* @param defaults de defaults zoals geconfigureerd: een merge van de standaard-defaults en de opgegeven defaults in de provider.
|
|
82
|
+
* @param update: update functie voor de defaults
|
|
83
|
+
* @param reset: reset functie voor de defaults. Zet de defaults terug naar de custom defaults.
|
|
84
|
+
* @returns een context met de default waardes en een functie om deze te updaten
|
|
85
|
+
*/
|
|
86
|
+
export declare const DefaultsContext: React.Context<{
|
|
87
|
+
defaults: DefaultsType;
|
|
88
|
+
update: (d: OptionalDefaultsType) => void;
|
|
89
|
+
reset: () => void;
|
|
90
|
+
}>;
|
|
91
|
+
/** Provider voor de DefaultsContext
|
|
92
|
+
* @param children de children van de provider
|
|
93
|
+
* @param defaults de custom defaults die de standaard defaults overschrijven
|
|
94
|
+
* @returns de provider met de defaults en de update en reset functies
|
|
95
|
+
*/
|
|
96
|
+
export declare function DefaultsProvider({ children, defaults: customDefaults }: {
|
|
97
|
+
children: React.ReactNode;
|
|
98
|
+
defaults?: OptionalDefaultsType;
|
|
99
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
100
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type HotkeyItem } from '../../hooks/useHotkeys';
|
|
3
|
+
type HotkeyRegistration = {
|
|
4
|
+
id: string;
|
|
5
|
+
hotkeys: HotkeyItem[];
|
|
6
|
+
tagsToIgnore: string[];
|
|
7
|
+
triggerOnContentEditable: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type RegisteredHotkeyMatch = {
|
|
10
|
+
id: string;
|
|
11
|
+
hotkey: string;
|
|
12
|
+
};
|
|
13
|
+
type KeysContextType = {
|
|
14
|
+
/** Welke functietoetsen (F1, F2, ...) ingedrukt */
|
|
15
|
+
fnKeys: Set<FnKey>;
|
|
16
|
+
/** Welke speciale toetsen ingedrukt */
|
|
17
|
+
specialKeys: Set<SpecialKey>;
|
|
18
|
+
digitKeys: Set<DigitKey>;
|
|
19
|
+
charKeys: Set<CharKey>;
|
|
20
|
+
otherKeys: Set<OtherKey>;
|
|
21
|
+
keys: Set<Key>;
|
|
22
|
+
modifiers: {
|
|
23
|
+
ctrl: boolean;
|
|
24
|
+
shift: boolean;
|
|
25
|
+
alt: boolean;
|
|
26
|
+
meta: boolean;
|
|
27
|
+
escape: boolean;
|
|
28
|
+
enter: boolean;
|
|
29
|
+
};
|
|
30
|
+
/** Register hotkeys to be handled by the provider */
|
|
31
|
+
registerHotkeys: (registration: HotkeyRegistration) => void;
|
|
32
|
+
/** Unregister hotkeys */
|
|
33
|
+
unregisterHotkeys: (id: string) => void;
|
|
34
|
+
/** Check welke registraties een bepaalde hotkey gebruiken */
|
|
35
|
+
getRegisteredHotkeys: (hotkeyToFind: string) => RegisteredHotkeyMatch[];
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* De KeysProvider zorgt ervoor dat de toetsenbordstatus (ctrl, shift, alt) beschikbaar is in de hele app.
|
|
39
|
+
*/
|
|
40
|
+
export declare const KeysContext: React.Context<KeysContextType>;
|
|
41
|
+
export declare function KeysProvider({ children }: {
|
|
42
|
+
children: React.ReactNode;
|
|
43
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
/** hook mag ook */
|
|
45
|
+
export declare const useKeyContext: () => KeysContextType;
|
|
46
|
+
type FnKey = 'F1' | 'F2' | 'F3' | 'F4' | 'F5' | 'F6' | 'F7' | 'F8' | 'F9' | 'F10' | 'F11' | 'F12' | 'F13' | 'F14' | 'F15' | 'F16' | 'F17' | 'F18' | 'F19' | 'F20' | 'F21' | 'F22' | 'F23' | 'F24';
|
|
47
|
+
type SpecialKey = 'Escape' | 'Tab' | 'Enter' | 'NumpadEnter' | 'Backspace' | 'Delete' | 'ArrowUp' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight' | 'ControlLeft' | 'ControlRight' | 'ShiftLeft' | 'ShiftRight' | 'AltLeft' | 'AltRight' | 'MetaLeft' | 'MetaRight' | 'CapsLock' | 'Home' | 'End' | 'PageUp' | 'PageDown';
|
|
48
|
+
type DigitKey = 'Digit0' | 'Digit1' | 'Digit2' | 'Digit3' | 'Digit4' | 'Digit5' | 'Digit6' | 'Digit7' | 'Digit8' | 'Digit9' | 'Numpad0' | 'Numpad1' | 'Numpad2' | 'Numpad3' | 'Numpad4' | 'Numpad5' | 'Numpad6' | 'Numpad7' | 'Numpad8' | 'Numpad9';
|
|
49
|
+
type CharKey = 'KeyA' | 'KeyB' | 'KeyC' | 'KeyD' | 'KeyE' | 'KeyF' | 'KeyG' | 'KeyH' | 'KeyI' | 'KeyJ' | 'KeyK' | 'KeyL' | 'KeyM' | 'KeyN' | 'KeyO' | 'KeyP' | 'KeyQ' | 'KeyR' | 'KeyS' | 'KeyT' | 'KeyU' | 'KeyV' | 'KeyW' | 'KeyX' | 'KeyY' | 'KeyZ';
|
|
50
|
+
type OtherKey = 'Equal' | 'Minus' | 'NumpadEqual' | 'NumpadMinus' | 'NumpadPlus' | 'NumpadMultiply' | 'NumpadDivide' | 'NumpadDecimal' | 'NumpadComma' | 'NumpadPeriod' | 'NumpadSeparator' | 'BracketRight' | 'BracketLeft' | 'Backslash' | 'Quote' | 'Semicolon' | 'Comma' | 'Period' | 'Slash' | 'Backquote';
|
|
51
|
+
type Key = FnKey | SpecialKey | DigitKey | CharKey | OtherKey;
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type ModalContextType = {
|
|
3
|
+
push: (id?: number | undefined) => number;
|
|
4
|
+
pop: (id: number) => boolean;
|
|
5
|
+
remove: (id: number) => void;
|
|
6
|
+
};
|
|
7
|
+
export declare const ModalContext: React.Context<ModalContextType>;
|
|
8
|
+
export declare function ModalProvider({ children }: {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type ContextType = {
|
|
3
|
+
/** is de special mode van Loon-Bulma-React aan? */
|
|
4
|
+
specialMode: boolean;
|
|
5
|
+
/** zet de special mode van Loon-Bulma-React aan of uit */
|
|
6
|
+
setSpecialMode: (isSpecialMode: boolean) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare const ModeContext: React.Context<ContextType>;
|
|
9
|
+
/** Zet een specifieke modus aan voor de loon-bulma-react-componenten
|
|
10
|
+
* @deprecated - deze gaat er uit!
|
|
11
|
+
*/
|
|
12
|
+
export declare function ModeProvider({ children, isSpecialMode }: {
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
isSpecialMode?: boolean | undefined;
|
|
15
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { ColorProp } from './../../types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export type NotifierProviderProps = {
|
|
4
|
+
/** De child-components die de notifier mogen gebruiken */
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
/** Waar moet de notifier getoont worden? (default = 'top') */
|
|
7
|
+
location?: 'top' | 'bottom';
|
|
8
|
+
/** De tijd (in ms) waarna een notificatie automatisch moet dismissen */
|
|
9
|
+
defaultAutoDismiss?: number;
|
|
10
|
+
};
|
|
11
|
+
export type NotifierProps = {
|
|
12
|
+
next?: NotifierItemProps;
|
|
13
|
+
del?: number;
|
|
14
|
+
clearTime: Date;
|
|
15
|
+
/** De standaard-tijd om notificaties te sluiten in milliseconden. (default = 5000 (ms)) */
|
|
16
|
+
defaultDismissTime?: number;
|
|
17
|
+
/** Notificaties komen altijd aan de rechterkant, kies uit bovenkant of onderkant (default = 'top') */
|
|
18
|
+
location?: 'top' | 'bottom';
|
|
19
|
+
/** de breedte van de notification-bar. Default = `20vw` (20% schermbreedte) */
|
|
20
|
+
width?: `${number}%` | `${number}px` | `${number}em` | `${number}vw` | `${number}vh`;
|
|
21
|
+
};
|
|
22
|
+
export type NotifierItemProps = {
|
|
23
|
+
/** Optioneel id voor notificatie, als niet gedefinieerd wordt het een random integer */
|
|
24
|
+
id?: number;
|
|
25
|
+
/** Type notificatie I(info), S(success), D(danger), W(warning)
|
|
26
|
+
* @deprecated use `color` instead
|
|
27
|
+
*/
|
|
28
|
+
type?: ColorProp;
|
|
29
|
+
/** Kleur van de notificatie */
|
|
30
|
+
color?: ColorProp;
|
|
31
|
+
/** De content voor de notificatie */
|
|
32
|
+
content?: React.ReactNode;
|
|
33
|
+
/** Tijd voor automatisch sluiten.
|
|
34
|
+
* - `0`:niet automatisch te sluiten. Dan is de notificatie alleen te sluiten met een 'click'
|
|
35
|
+
* - `number`: aantal milliseconden voor automatisch sluiten */
|
|
36
|
+
dismissAfter?: 0 | number;
|
|
37
|
+
/** Wat te doen als er geklikt wordt. Bij een 'click' wordt de notificatie ook gesloten. */
|
|
38
|
+
onClick?: (e: any) => void;
|
|
39
|
+
/** Payload voor de notification */
|
|
40
|
+
payload?: any;
|
|
41
|
+
};
|
|
42
|
+
export type NotifierContextType = {
|
|
43
|
+
/** Toon een notificatie
|
|
44
|
+
* @param notification de notificatie-data
|
|
45
|
+
* @returns ID van de notificatie (om te kunnen verwijderen)
|
|
46
|
+
*/
|
|
47
|
+
notify: (notification: NotifierItemProps) => number;
|
|
48
|
+
/** Cerwijder een notificatie
|
|
49
|
+
* @param id ID van de notificatie
|
|
50
|
+
*/
|
|
51
|
+
remove: (id: number) => void;
|
|
52
|
+
/**
|
|
53
|
+
* Verwijder ALLE notificaties
|
|
54
|
+
*/
|
|
55
|
+
clear: () => void;
|
|
56
|
+
};
|
|
57
|
+
/** Provider voor de notifier.
|
|
58
|
+
* De inhoud van de app moet binnen deze <NotifierProvider>...</NotifierProvider vallen.
|
|
59
|
+
* De notifier is dan via de hook @see useNotifier te gebruiken in child-components van de App zelf, niet in APP!
|
|
60
|
+
* @param props: bevat alleen de children van de notifier, dus ook van de app.
|
|
61
|
+
* @example
|
|
62
|
+
* <NotifierProvider>
|
|
63
|
+
* <App />
|
|
64
|
+
* </NotifierProvider>
|
|
65
|
+
* */
|
|
66
|
+
export declare const NotifierProvider: (props: NotifierProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
67
|
+
/** React Hook om notificaties in de notifier te beïnvloeden
|
|
68
|
+
* @function notify(n: NotifierItemProps): toon een notificatie, returns ID
|
|
69
|
+
* @function remove(id: number): verwijder een notificatie obv ID
|
|
70
|
+
* @function clear(): verwijder alle notificaties
|
|
71
|
+
* @example
|
|
72
|
+
* const { notify, remove, clear } = useNotifier();
|
|
73
|
+
*/
|
|
74
|
+
export declare function useNotifier(): NotifierContextType;
|
|
75
|
+
/**
|
|
76
|
+
* Een component om notificaties in weer te geven, die na verloop van tijd weer verdwijnen. Dat is per notificatie instelbaar.
|
|
77
|
+
* Notificaties hebben ook een click-handler om een onClick() actie uit te voeren. De notificatie wordt dan ook gesloten.
|
|
78
|
+
* @param props
|
|
79
|
+
* @returns een Notificatie-component die (tijdelijke) berichtjes weergeeft aan de rechterkant van het scherm.
|
|
80
|
+
*/
|
|
81
|
+
export declare function Notifier({ next, clearTime, del, defaultDismissTime, location, width: containerWidth }: NotifierProps): import("react/jsx-runtime").JSX.Element;
|