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,38 @@
|
|
|
1
|
+
type UseSessionStoredState<T = string> = {
|
|
2
|
+
/** Key to store the value with in Session Storage */
|
|
3
|
+
key: string;
|
|
4
|
+
/** Initial value (if its non-existent in Session Storage) */
|
|
5
|
+
initialValue: T;
|
|
6
|
+
/** Your own serializing-function. Implement when you cannot use `JSON.stringify` */
|
|
7
|
+
serialize?: (value: T, replacer?: (key: string, value: any) => any, space?: string | number) => string;
|
|
8
|
+
/** Your own deserializing-funtion. Implement when you cannot use `JSON.parse` */
|
|
9
|
+
deserialize?: (value: string, reviver?: (key: string, value: any) => any) => T;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Hook die werkt als `React.useState<T|undefined>()`, maar waarbij de waarde ook wordt opgeslagen in Session Storage.
|
|
13
|
+
* De waarde blijft dan bij het refreshen van de pagina aanwezig.
|
|
14
|
+
* Als de pagina dan ververst wordt, word de al bestaande waarde gebruikt, niet de initialValue.
|
|
15
|
+
* Maar als de tab of de browser gesloten wordt, dan wordt de inhoud van de session storage gewist.
|
|
16
|
+
* Om de waarde te bewaren bij afsluiten van de browser, gebruik je de hook `{@link useLocalStoredState}`.
|
|
17
|
+
* @param {UseSessionStoredState} params voor de hook
|
|
18
|
+
* @returns {[T, (value: T) => void]} tuple met een `value` en een `setValue`-function (net als `React.useState`)
|
|
19
|
+
* @description
|
|
20
|
+
* | Property | Type | Description |
|
|
21
|
+
* |--------------|------------|---------------------------------------------------------------|
|
|
22
|
+
* | key | `string` | De key waaronder de waarde in Session Storage wordt opgeslagen. |
|
|
23
|
+
* | initialValue | `T` | De initiale waarde. |
|
|
24
|
+
* | serialize | `function` | (optional) functie om de waarde om te zetten naar een string. Implementeer als de waarde __GEEN__ gebruik kan maken van `JSON.stringify()`! |
|
|
25
|
+
* | deserialize | `function` | (optional) De functie die een string omzet naar de waarde. Implementeer als de waarde __GEEN__ gebruik kan maken van `JSON.parse()`! |
|
|
26
|
+
* @example
|
|
27
|
+
* import { useSessionStoredState } from 'loon-bulma-react';
|
|
28
|
+
* const [ value, setValue, removeFromSessionStorage ] = useSessionStoredState({ key: 'myKey', initialValue: 'Oompa Loompa' });
|
|
29
|
+
* // 1. value is 'Oompa Loompa', put it somewhere on the screen
|
|
30
|
+
* // 2. change the value to something else
|
|
31
|
+
* // 3. refresh the page.
|
|
32
|
+
* // 4. see te new value on the page.
|
|
33
|
+
* // 5. you can also check the value in Local Storage in devtools.
|
|
34
|
+
* // 6. close the browser / tab
|
|
35
|
+
* // 7. check the value in session storage. it should be gone.
|
|
36
|
+
*/
|
|
37
|
+
declare function useSessionStoredState<T extends unknown = {}>({ key, initialValue, deserialize, serialize, }: UseSessionStoredState<T>): readonly [T, (value: T) => void, () => void];
|
|
38
|
+
export { useSessionStoredState };
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Throttle-hook voor een externe value (bijv. prop of state van elders).
|
|
3
|
+
* Neemt een externe waarde en retourneert een throttled versie ervan.
|
|
4
|
+
* Handig voor performance bij events die vaak worden getriggerd zoals scroll, resize, of mousemove,
|
|
5
|
+
* waarbij je wilt dat updates maximaal één keer per interval plaatsvinden.
|
|
6
|
+
* @example
|
|
7
|
+
* const [scrollY, setScrollY] = React.useState(0);
|
|
8
|
+
* const [throttledScrollY, cancel] = useThrottledValue(scrollY, { interval: 200 });
|
|
9
|
+
*
|
|
10
|
+
* React.useEffect(() => {
|
|
11
|
+
* const handleScroll = () => setScrollY(window.scrollY);
|
|
12
|
+
* window.addEventListener('scroll', handleScroll);
|
|
13
|
+
* return () => window.removeEventListener('scroll', handleScroll);
|
|
14
|
+
* }, []);
|
|
15
|
+
*
|
|
16
|
+
* return <div>
|
|
17
|
+
* <p>Huidige scroll positie: {scrollY}</p>
|
|
18
|
+
* <p>Throttled scroll positie: {throttledScrollY}</p>
|
|
19
|
+
* </div>
|
|
20
|
+
* @description Belangrijkste verschillen met debouncing:
|
|
21
|
+
* - Throttling: Voert updates uit met regelmatige intervallen tijdens activiteit
|
|
22
|
+
* - Debouncing: Wacht tot activiteit stopt voordat update wordt uitgevoerd
|
|
23
|
+
* - Throttle is ideaal voor scroll handlers, mousemove, resize events
|
|
24
|
+
* - Debounce is ideaal voor search inputs, form validation
|
|
25
|
+
* @description Verschillen met `useThrottledState`:
|
|
26
|
+
* - Neemt externe waarde als input (geen eigen state management)
|
|
27
|
+
* - Geeft toegang tot zowel originele als throttled waarde
|
|
28
|
+
* - Bevat cancel-functie om pending updates te annuleren
|
|
29
|
+
* - Gebruikt voor controlled inputs waar je state elders beheert
|
|
30
|
+
* - Werkt met props, context, of andere state providers
|
|
31
|
+
* @param valueParam de externe waarde die throttled moet worden
|
|
32
|
+
* @param options extra opties
|
|
33
|
+
* - leading: Direct updaten bij eerste wijziging (Default: true)
|
|
34
|
+
* - trailing: Update aan het einde van interval met laatste waarde (Default: true)
|
|
35
|
+
* - interval: Minimum tijd in ms tussen updates (Default: 200ms)
|
|
36
|
+
* @returns [throttledValue, cancelFunction] - de throttled waarde en een annuleer-functie
|
|
37
|
+
*/
|
|
38
|
+
export declare function useThrottledValue<T = unknown>(valueParam: T, options?: {
|
|
39
|
+
leading?: boolean;
|
|
40
|
+
trailing?: boolean;
|
|
41
|
+
interval?: number;
|
|
42
|
+
}): readonly [T, () => void];
|
|
43
|
+
/**
|
|
44
|
+
* Throttle-hook die zijn eigen interne state beheert.
|
|
45
|
+
* Creëert en beheert een throttled state waarde met bijbehorende setter functie.
|
|
46
|
+
* Handig voor het beperken van update-frequentie bij events zoals window resize,
|
|
47
|
+
* scroll tracking, of real-time input waar je updates wilt limiteren maar niet wilt wachten
|
|
48
|
+
* tot de gebruiker stopt (zoals bij debounce).
|
|
49
|
+
* @param defaultValue de standaard waarde voor de throttled state
|
|
50
|
+
* @param options extra opties
|
|
51
|
+
* - `leading`: Direct updaten bij eerste wijziging na een rustige periode (Default: true)
|
|
52
|
+
* - `trailing`: Update aan het einde van het interval met laatste waarde (Default: true)
|
|
53
|
+
* - `interval`: Minimum tijd in ms tussen throttled updates (Default: 200ms)
|
|
54
|
+
* - `onThrottledChange`: Callback die wordt aangeroepen bij wijzigingen van throttled waarde (niet bij initiële waarde). Wordt ook overgeslagen bij `setSilent`
|
|
55
|
+
* @returns [immediateValue, throttledValue, setValue, setSilent] - directe waarde, throttled waarde, normale setter en stille setter
|
|
56
|
+
* - `immediateValue`: De directe waarde die onmiddellijk wordt bijgewerkt bij elke aanroep van `setValue`. (gebruik in input)
|
|
57
|
+
* - `throttledValue`: De throttled waarde die maximaal één keer per interval wordt bijgewerkt. (dat is dus de throttled waarde)
|
|
58
|
+
* - `setValue(newValue)`: Stelt de directe waarde in en plant een throttled update indien nodig. (gebruik in event handlers)
|
|
59
|
+
* - `setSilent(newValue)`: Stelt zowel de directe als de throttled waarde onmiddellijk in zonder throttling en zonder het aanroepen van de onThrottledChange callback.
|
|
60
|
+
* @example
|
|
61
|
+
* const [immediateValue, throttledValue, setValue, setSilent] = useThrottledState(0, {
|
|
62
|
+
* interval: 200,
|
|
63
|
+
* onThrottledChange: (value) => {
|
|
64
|
+
* console.log('Throttled update:', value);
|
|
65
|
+
* updateServerSideTracking(value);
|
|
66
|
+
* }
|
|
67
|
+
* });
|
|
68
|
+
*
|
|
69
|
+
* // Voor scroll tracking (triggert onChange max 1x per 200ms)
|
|
70
|
+
* const handleScroll = () => setValue(window.scrollY);
|
|
71
|
+
*
|
|
72
|
+
* // Voor programmatische updates (triggert NIET de onThrottledChange)
|
|
73
|
+
* const resetScroll = () => setSilent(0);
|
|
74
|
+
*
|
|
75
|
+
* return <div onScroll={handleScroll}>
|
|
76
|
+
* <p>Current scroll: {immediateValue}</p>
|
|
77
|
+
* <p>Throttled scroll: {throttledValue}</p>
|
|
78
|
+
* </div>
|
|
79
|
+
* @description Belangrijkste verschillen met `useThrottledValue`:
|
|
80
|
+
* - Beheert eigen interne state (geen externe waarde nodig)
|
|
81
|
+
* - Geeft toegang tot zowel directe als throttled waarde
|
|
82
|
+
* - Geen cancel-functie beschikbaar
|
|
83
|
+
* - Gebruikt voor controlled inputs met directe feedback
|
|
84
|
+
* - Werkt alleen met interne useState, niet met externe state providers
|
|
85
|
+
* - Eenvoudigere API dan useThrottledValue
|
|
86
|
+
* - Optionele onChange callback voor side-effects
|
|
87
|
+
* - setSilent functie voor programmatische updates zonder onChange
|
|
88
|
+
* @description Leading vs Trailing:
|
|
89
|
+
* - `leading: true, trailing: false`: Update alleen aan het begin van elke interval periode
|
|
90
|
+
* - `leading: false, trailing: true`: Update alleen aan het einde van elke interval periode
|
|
91
|
+
* - `leading: true, trailing: true` (default): Update aan begin én einde als er wijzigingen waren
|
|
92
|
+
* - `leading: false, trailing: false`: Geen updates (niet nuttig in de praktijk)
|
|
93
|
+
*/
|
|
94
|
+
export declare function useThrottledState<T = unknown>(defaultValue: T, options?: {
|
|
95
|
+
leading?: boolean;
|
|
96
|
+
trailing?: boolean;
|
|
97
|
+
interval?: number;
|
|
98
|
+
onThrottledChange?: (value: T) => void;
|
|
99
|
+
}): readonly [T, T, (newValue: T) => void, (newValue: T) => void];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Een toggle tussen twee state-opties. de state switched tussen de twee.
|
|
3
|
+
* @param initialState startwaarde
|
|
4
|
+
* @param options 2 toggle-opties
|
|
5
|
+
* @returns een state-toggle function
|
|
6
|
+
* @example const [state, toggle] = useToggle("yes", ["yes", "no"]);
|
|
7
|
+
*/
|
|
8
|
+
declare function useToggle<T extends unknown>(initialState: T, options: [T, T]): readonly [T, (value?: T) => void];
|
|
9
|
+
/**
|
|
10
|
+
* useToggle voor booleans
|
|
11
|
+
* @param initialState initia
|
|
12
|
+
* @returns een state-toggle met booleans
|
|
13
|
+
* @example const [state, toggle] = useBoolToggle(true);
|
|
14
|
+
*/
|
|
15
|
+
declare function useBoolToggle(initialState?: boolean): readonly [boolean, (value?: boolean) => void];
|
|
16
|
+
export { useToggle, useBoolToggle };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export type UncontrolledMode = 'initial' | 'controlled' | 'uncontrolled';
|
|
2
|
+
export type UncontrolledOptions<T extends unknown> = {
|
|
3
|
+
value?: T;
|
|
4
|
+
defaultValue?: T;
|
|
5
|
+
finalValue?: T;
|
|
6
|
+
onChange?: (value: T) => void;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Hook voor het managen van state voor 'controlled' en 'uncontrolled' componenten (inputs etc).
|
|
10
|
+
* Het is met deze hook mogelijk om een component als 'controlled' EN 'uncontrolled' te gebruiken.
|
|
11
|
+
* @param options.value waarde
|
|
12
|
+
* @param options.defaultValue default waarde
|
|
13
|
+
* @param options.finalValue eindwaarde
|
|
14
|
+
* @param options.onChange callback voor waarde verandering
|
|
15
|
+
* @param options.onValueUpdate callback voor waarde update
|
|
16
|
+
* @param options.rule bepaal welke waarde initieel gebruikt wordt. zie examples
|
|
17
|
+
* @returns [value, setalue, controllerMode]
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* const [_value, handleChange] = useUncontrolled({
|
|
21
|
+
* value: VALUE,
|
|
22
|
+
* defaultValue: DEFAULT,
|
|
23
|
+
* finalValue: 'final',
|
|
24
|
+
* onChange: (v) => {console.log(v)},
|
|
25
|
+
* rule: (v) => typeof v === 'string'
|
|
26
|
+
* });
|
|
27
|
+
*
|
|
28
|
+
* return <input type="text" value={_value} onChange={(evt) => handleChange(evt.target.value)} />
|
|
29
|
+
*
|
|
30
|
+
* // als VALUE = 'oi' && DEFAULT = 'there': defaultValue & finalValue ignored in controlled components, _value == VALUE == 'oi'
|
|
31
|
+
* // als VALUE = null && DEFAULT = 'there': rule() returns 'false', defaultValue is used, _value == defaultValue == 'there'
|
|
32
|
+
* // als VALUE = null && DEFAULT = null: rule() returns 'false' voor beiden, finalValue is used, _value == defaultValue == 'final'
|
|
33
|
+
*
|
|
34
|
+
* @example - uncontrolled & controlled
|
|
35
|
+
* // Uncontrolled
|
|
36
|
+
* <input />
|
|
37
|
+
* <input defaultValue="hello" />
|
|
38
|
+
* <input onChange={() => {}} /> // still possible since value is stored in internal state
|
|
39
|
+
*
|
|
40
|
+
* // Controlled
|
|
41
|
+
* <input value="Hello" onChange={() => {}} />
|
|
42
|
+
|
|
43
|
+
*/
|
|
44
|
+
export declare function useUncontrolled<T extends unknown>({ value, defaultValue, finalValue, onChange, }: UncontrolledOptions<T>): readonly [T, (nextValue: T) => void, boolean];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook voor gebruik van een gevalideerde waarde.
|
|
3
|
+
* @param initialValue de beginwaarde (optioneel)
|
|
4
|
+
* @param validation validatie-functie (optioneel)
|
|
5
|
+
* @returns een uitgebreid useState hook met een gevalideerde waarde
|
|
6
|
+
* @example
|
|
7
|
+
* const validation = (value?: string): [boolean, string] => {
|
|
8
|
+
* console.log(value);
|
|
9
|
+
* if (!value) return [false, 'required'];
|
|
10
|
+
* else if (value.length < 3) return [false, 'too short'];
|
|
11
|
+
* return [true, ''];
|
|
12
|
+
* };
|
|
13
|
+
* const [{ value, lastValidValue, valid, invalidMsg }, onChange] = useValidatedState<string>('', validation);
|
|
14
|
+
* <input onChange={onChange} value={value} />
|
|
15
|
+
*/
|
|
16
|
+
export declare function useValidatedState<T extends unknown>(initialValue?: T, validation?: (value?: T) => [boolean, string]): readonly [{
|
|
17
|
+
readonly value: T | undefined;
|
|
18
|
+
readonly lastValidValue: T | undefined;
|
|
19
|
+
readonly valid: boolean;
|
|
20
|
+
readonly invalidMsg: string;
|
|
21
|
+
}, (val: T) => void];
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
export * from './types';
|
|
2
|
+
export { AspectRatio } from './components/AspectRatio/AspectRatio';
|
|
3
|
+
export type { AspectRatioProps } from './components/AspectRatio/AspectRatio';
|
|
4
|
+
export { Block } from './components/Block/Block';
|
|
5
|
+
export { Box } from './components/Box/Box';
|
|
6
|
+
export { BorderBox } from './components/Box/BorderBox';
|
|
7
|
+
export type { BoxProps } from './components/Box/Box';
|
|
8
|
+
export { Columns } from './components/Columns/Columns';
|
|
9
|
+
export type { ColumnProps, ExpandedColumnProps } from './components/Columns/Column';
|
|
10
|
+
export { Column } from './components/Columns/Column';
|
|
11
|
+
export { Container } from './components/Container/Container';
|
|
12
|
+
export { Content } from './components/Content/Content';
|
|
13
|
+
export { Divider } from './components/Divider/Divider';
|
|
14
|
+
export { Footer } from './components/Footer/Footer';
|
|
15
|
+
export { Hero } from './components/Hero/Hero';
|
|
16
|
+
export type { HeroProps } from './components/Hero/Hero';
|
|
17
|
+
export { Image } from './components/Image/Image';
|
|
18
|
+
export type { ImageProps } from './components/Image/Image';
|
|
19
|
+
export { Section } from './components/Section/Section';
|
|
20
|
+
export { ScrollArea } from './components/ScrollArea/ScrollArea';
|
|
21
|
+
export { CodeBlock } from './components/CodeBlock/CodeBlock';
|
|
22
|
+
export type { CodeBlockProps, CodeLanguage } from './components/CodeBlock/CodeBlock';
|
|
23
|
+
export { DataTable } from './components/DataTable/DataTable';
|
|
24
|
+
export type { DataTableApi, DataTableColumn, DataTableProps } from './components/DataTable/DataTable';
|
|
25
|
+
export { DragDropList } from './components/DragDrop/DragDropList';
|
|
26
|
+
export { Dropdown } from './components/Dropdown/Dropdown';
|
|
27
|
+
export { HelpTxt } from './components/Help/Help';
|
|
28
|
+
export type { HelpTxtProps } from './components/Help/Help';
|
|
29
|
+
export { Icon, IconText, IconStack } from './components/Icon/Icon';
|
|
30
|
+
export type { IconProps, IconTextProps } from './components/Icon/Icon';
|
|
31
|
+
export { Indicator } from './components/Indicator/Indicator';
|
|
32
|
+
export type { IndicatorProps } from './components/Indicator/Indicator';
|
|
33
|
+
export { Kbd, Kbds } from './components/Kbd/Kbd';
|
|
34
|
+
export { Label } from './components/Label/Label';
|
|
35
|
+
export type { LabelProps } from './components/Label/Label';
|
|
36
|
+
export { Menu } from './components/Menu/Menu';
|
|
37
|
+
export type { MenuProps, MenuItemProps, MenuItemGroupProps } from './components/Menu/Menu';
|
|
38
|
+
export { Message } from './components/Message/Message';
|
|
39
|
+
export type { MessageProps } from './components/Message/Message';
|
|
40
|
+
export { Modal } from './components/Modal/Modal';
|
|
41
|
+
export type { ModalProps } from './components/Modal/Modal';
|
|
42
|
+
export { Notification } from './components/Notification/Notification';
|
|
43
|
+
export type { NotificationProps } from './components/Notification/Notification';
|
|
44
|
+
export { Panel } from './components/Panel/Panel';
|
|
45
|
+
export type { PanelProps } from './components/Panel/Panel';
|
|
46
|
+
export { ProgressBar } from './components/ProgressBar/ProgressBar';
|
|
47
|
+
export type { ProgressBarProps } from './components/ProgressBar/ProgressBar';
|
|
48
|
+
export { SimpleTable, Table } from './components/SimpleTable/SimpleTable';
|
|
49
|
+
export type { SimpleTableProps, SimpleTableColProps } from './components/SimpleTable/SimpleTable';
|
|
50
|
+
export { Steps } from './components/Steps/Steps';
|
|
51
|
+
export type { StepsProps, StepItemProps } from './components/Steps/Steps';
|
|
52
|
+
export { TabBar } from './components/TabBar/TabBar';
|
|
53
|
+
export type { TabBarProps, TabBarItemProps } from './components/TabBar/TabBar';
|
|
54
|
+
export { Tag, Tags } from './components/Tag/Tag';
|
|
55
|
+
export type { TagProps, TagsProps } from './components/Tag/Tag';
|
|
56
|
+
export { TimeLine } from './components/TimeLine/TimeLine';
|
|
57
|
+
export type { TimeLineProps, TimeLineItemProps, TimeLinePointProps } from './components/TimeLine/TimeLine';
|
|
58
|
+
export { TreeView } from './components/TreeView/TreeView';
|
|
59
|
+
export { useTreeViewControls } from './components/TreeView/TreeView';
|
|
60
|
+
export type { TreeViewProps, TreeViewNode, TreeViewRef } from './components/TreeView/TreeView';
|
|
61
|
+
export { H1, H2, H3, H4, H5, H6 } from './components/Titles/Titles';
|
|
62
|
+
export { QuickView } from './components/QuickView/QuickView';
|
|
63
|
+
export type { QuickViewProps } from './components/QuickView/QuickView';
|
|
64
|
+
export { ToggleBar } from './components/ToggleBar/ToggleBar';
|
|
65
|
+
export type { ToggleBarProps, ToggleItemProps, OnOffToggleItemProps } from './components/ToggleBar/ToggleBar';
|
|
66
|
+
export { Buttons, ButtonGroup } from './components/ButtonGroup/ButtonGroup';
|
|
67
|
+
export type { ButtonGroupProps } from './components/ButtonGroup/ButtonGroup';
|
|
68
|
+
export type { ButtonProps } from './components/Button/Button';
|
|
69
|
+
export { Button } from './components/Button/Button';
|
|
70
|
+
export { Link, LinkButton } from './components/Link/Link';
|
|
71
|
+
export type { LinkProps, LinkButtonProps } from './components/Link/Link';
|
|
72
|
+
export * from './components/Calendar';
|
|
73
|
+
export type { BaseEventProps, CalendarOptions, CalendarType } from './components/Calendar/Props';
|
|
74
|
+
export type { MonthViewProps } from './components/Calendar/Month/MonthView';
|
|
75
|
+
export type { WeekViewProps } from './components/Calendar/Week/WeekView';
|
|
76
|
+
export { Tooltip } from './components/Tooltip/Tooltip';
|
|
77
|
+
export { Pagination } from './components/Pagination/Pagination';
|
|
78
|
+
export type { PaginationProps } from './components/Pagination/Pagination';
|
|
79
|
+
export { CheckBox, CB } from './forms/Checkbox/Checkbox';
|
|
80
|
+
export type { CheckboxInputProps } from './forms/Checkbox/Checkbox';
|
|
81
|
+
export { Select } from './forms/Select/Select';
|
|
82
|
+
export type { SelectInputProps } from './forms/Select/Select';
|
|
83
|
+
export { ComboBox } from './forms/ComboBox/ComboBox';
|
|
84
|
+
export type { ComboBoxProps } from './forms/ComboBox/ComboBox';
|
|
85
|
+
export { MultiComboBox } from './forms/ComboBox/MultiComboBox';
|
|
86
|
+
export type { MultiComboBoxProps } from './forms/ComboBox/MultiComboBox';
|
|
87
|
+
export { ColorInput } from './forms/Others/ColorInput';
|
|
88
|
+
export type { ColorInputProps } from './forms/Others/ColorInput';
|
|
89
|
+
export { HiddenInput } from './forms/Others/HiddenInput';
|
|
90
|
+
export type { HiddenInputProps } from './forms/Others/HiddenInput';
|
|
91
|
+
export { BaseInput, Input, InputContainer } from './forms/Input';
|
|
92
|
+
export type { InputPropsType, InputStylingPropsType, InputValueType } from './forms/Input';
|
|
93
|
+
export { RadioGroup, RB } from './forms/Radio/Radio';
|
|
94
|
+
export type { RadioInputProps } from './forms/Radio/Radio';
|
|
95
|
+
export { TagsInput } from './forms/TagsInput/TagsInput';
|
|
96
|
+
export type { TagsInputProps } from './forms/TagsInput/TagsInput';
|
|
97
|
+
export { EmailInput } from './forms/Text/EmailInput';
|
|
98
|
+
export type { EmailInputProps } from './forms/Text/EmailInput';
|
|
99
|
+
export { TelephoneInput } from './forms/Others/TelephoneInput';
|
|
100
|
+
export type { TelephoneInputProps } from './forms/Others/TelephoneInput';
|
|
101
|
+
export { URLInput } from './forms/Others/URLInput';
|
|
102
|
+
export type { URLInputProps } from './forms/Others/URLInput';
|
|
103
|
+
export { PasswordInput } from './forms/Text/PasswordInput';
|
|
104
|
+
export type { PasswordInputProps } from './forms/Text/PasswordInput';
|
|
105
|
+
export { TextEditor } from './forms/Text/TextEditor';
|
|
106
|
+
export { TextArea } from './forms/Text/TextArea';
|
|
107
|
+
export type { TextAreaProps } from './forms/Text/TextArea';
|
|
108
|
+
export { TextInput } from './forms/Text/TextInput';
|
|
109
|
+
export type { TextInputProps } from './forms/Text/TextInput';
|
|
110
|
+
export { FormattedInput } from './forms/Text/FormattedInput';
|
|
111
|
+
export type { FormattedInputProps } from './forms/Text/FormattedInput';
|
|
112
|
+
export { NumberInput } from './forms/Numeric/NumberInput';
|
|
113
|
+
export type { NumberInputProps } from './forms/Numeric/NumberInput';
|
|
114
|
+
export { RangeInput } from './forms/Numeric/RangeInput';
|
|
115
|
+
export type { RangeInputProps } from './forms/Numeric/RangeInput';
|
|
116
|
+
export { DateInput } from './forms/Datetimes/DateInput';
|
|
117
|
+
export type { DateInputProps } from './forms/Datetimes/DateInput';
|
|
118
|
+
export { DateTimeInput } from './forms/Datetimes/DateTimeInput';
|
|
119
|
+
export type { DateTimeInputProps } from './forms/Datetimes/DateTimeInput';
|
|
120
|
+
export { TimeInput } from './forms/Datetimes/TimeInput';
|
|
121
|
+
export type { TimeInputProps } from './forms/Datetimes/TimeInput';
|
|
122
|
+
export { FileInput } from './forms/File/FileInput';
|
|
123
|
+
export type { FileInputProps, FileInputValue } from './forms/File/FileInput';
|
|
124
|
+
export { CurrencyInput } from './forms/Currency/CurrencyInput';
|
|
125
|
+
export type { CurrencyInputProps } from './forms/Currency/CurrencyInput';
|
|
126
|
+
export { IBANInput } from './forms/MaskedInput/IBANInput';
|
|
127
|
+
export type { IBANInputProps } from './forms/MaskedInput/IBANInput';
|
|
128
|
+
export { WeekInput } from './forms/Periodes/WeekInput';
|
|
129
|
+
export type { WeekInputProps, WeekInputString } from './forms/Periodes/WeekInput';
|
|
130
|
+
export { MonthInput } from './forms/Periodes/MonthInput';
|
|
131
|
+
export type { MonthInputProps, MonthInputString } from './forms/Periodes/MonthInput';
|
|
132
|
+
export * from './contexts/Notifier/Notifier';
|
|
133
|
+
export * from './contexts/Confirm/ConfirmContextProvider';
|
|
134
|
+
export * from './contexts/Prompt/PromptContextProvider';
|
|
135
|
+
export * from './contexts/ActionSheet/ActionSheetContextProvider';
|
|
136
|
+
export * from './contexts/DialogsProvider/DialogsProvider';
|
|
137
|
+
export * from './contexts/ColorSchemeProvider/ColorSchemeProvider';
|
|
138
|
+
export * from './contexts/ModalProvider/ModalProvider';
|
|
139
|
+
export * from './contexts/DefaultsProvider/DefaultsProvider';
|
|
140
|
+
export * from './contexts/KeysProvider/KeysProvider';
|
|
141
|
+
export * from './contexts/ModeProvider/ModeProvider';
|
|
142
|
+
export * from './contexts/AppProvider/AppProviders';
|
|
143
|
+
export * from './contexts/DialogsProvider/DialogsProvider';
|
|
144
|
+
export * from './hooks/useClipboard';
|
|
145
|
+
export * from './hooks/useDebounced.hooks';
|
|
146
|
+
export * from './hooks/useThrottle.hooks';
|
|
147
|
+
export * from './hooks/useMediaQuery';
|
|
148
|
+
export * from './hooks/useHotkeys';
|
|
149
|
+
export * from './hooks/useLocalStoredState';
|
|
150
|
+
export * from './hooks/useCookieState';
|
|
151
|
+
export * from './hooks/usePagination';
|
|
152
|
+
export * from './hooks/useToggle';
|
|
153
|
+
export * from './hooks/useUncontrolled';
|
|
154
|
+
export * from './hooks/useValidatedState';
|
|
155
|
+
export * from './hooks/useSessionStoredState';
|
|
156
|
+
export * from './hooks/useClickOutside';
|
|
157
|
+
export * from './hooks/useScrollIntoView';
|
|
158
|
+
export * from './hooks/useFetchApi';
|
|
159
|
+
export * from './hooks/useContextMenu';
|
|
160
|
+
export * from './hooks/usePropState';
|
|
161
|
+
export * from './hooks/useIndexedDb';
|
|
162
|
+
export * from './utils/JSDateTime.class';
|
|
163
|
+
export * from './utils/JSDuration.class';
|
|
164
|
+
export * from './utils/BSN.functions';
|
|
165
|
+
export * from './utils/IBAN.functions';
|
|
166
|
+
export * from './utils/colors';
|
|
167
|
+
export * from './utils/math';
|
|
168
|
+
export * from './utils/sorting';
|
|
169
|
+
export * from './utils/colors';
|
|
170
|
+
export * from './utils/operators';
|
|
171
|
+
export * from './utils/string.utils';
|
|
172
|
+
export * from './utils/flattenChildren.function';
|
|
173
|
+
export * from './classes/Console';
|
|
174
|
+
export * from './classes/FetchWrapper';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
2
|
+
import { InputValueType } from 'lib';
|
|
3
|
+
import { InputIconRightFn } from 'lib/forms/Input';
|
|
4
|
+
type ParamType<T extends InputValueType = InputValueType> = {
|
|
5
|
+
icon: IconProp | string | undefined | null;
|
|
6
|
+
hovered: boolean;
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
loading: boolean;
|
|
9
|
+
focused: boolean;
|
|
10
|
+
value?: T | undefined;
|
|
11
|
+
error?: string;
|
|
12
|
+
showInfo?: boolean | undefined;
|
|
13
|
+
infoData?: React.ReactNode | (() => void) | undefined;
|
|
14
|
+
inputId?: string | undefined;
|
|
15
|
+
helpTag?: string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* `hidden`: geen icon rechts
|
|
18
|
+
* `visible`: standaard gedrag, een check of een error icoon, of een info icoon als showInfo/infoData is meegegeven
|
|
19
|
+
* De functie is raar. Die returned een tuple. __LET OP: ALS JE DEZE GEBRUIKT, HEB JE NIET MEER DE NORMALE HELP-FUNCTIONALITEIT__
|
|
20
|
+
* - 1e item een ReactNode teruggeven van het type `<Icon icon={...} />`, voor het icon.
|
|
21
|
+
* - 2e item (optioneel) een onClick functie, als het icon klikbaar moet zijn. Die __MOET__ op de container
|
|
22
|
+
* @param v: de value van de input
|
|
23
|
+
* @param hovered: is de input momenteel hovered?
|
|
24
|
+
* @param disabled: is de input momenteel disabled?
|
|
25
|
+
* @param loading: is de input momenteel loading?
|
|
26
|
+
* @param focused: is de input momenteel focused?
|
|
27
|
+
* @param onClick: (optionele) functie die wordt aangeroepen bij click van het icon
|
|
28
|
+
*/
|
|
29
|
+
iconRight?: 'hidden' | 'visible' | InputIconRightFn<T> | undefined;
|
|
30
|
+
};
|
|
31
|
+
/** functie voor inputs om de juiste icons te maken
|
|
32
|
+
* INTERN GEBRUIK!
|
|
33
|
+
*/
|
|
34
|
+
export declare function createInputIcons_INTERNAL<T extends InputValueType = InputValueType>({ icon, error, showInfo, infoData, inputId, helpTag, focused, hovered, disabled, loading, value, iconRight, }: ParamType<T>): [containerClass: string, iconLeft: React.ReactNode | undefined, iconRight: React.ReactNode | undefined];
|
|
35
|
+
export declare function createShowInfo_INTERNAL(infoData?: React.ReactNode | ((helpTag?: string) => void) | undefined, restoreFocus?: Function | undefined, helpTag?: string | undefined): React.ReactNode;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AlignmentProp } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* @param alignment - The alignment of the element.
|
|
4
|
+
* @returns The appropriate Bulma class for the element alignment.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getAlignmentClass(alignment: AlignmentProp, trim?: boolean): string;
|
|
7
|
+
/**
|
|
8
|
+
* @param alignment - The alignment of the element or the text
|
|
9
|
+
* @returns The appropriate Bulma class for the element alignment.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getTextAlignmentClass(alignment: AlignmentProp, trim?: boolean): string;
|
|
12
|
+
/**
|
|
13
|
+
* @param alignment - The alignment of the element-group
|
|
14
|
+
* @returns The appropriate Bulma class for the element-grosup alignment.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getGroupAlignmentClass(alignment: AlignmentProp, trim?: boolean): string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BaseEventProps, EventOptions, CalendarOptions } from "./../components/Calendar/Props";
|
|
2
|
+
import { ColorProp, HexColor } from "./../types";
|
|
3
|
+
import { JSDateTime } from "./../utils/JSDateTime.class";
|
|
4
|
+
/**
|
|
5
|
+
* @param color de kleur die je wilt gebruiken als ColorProp
|
|
6
|
+
* @returns een string met de juiste kleurclass
|
|
7
|
+
*/
|
|
8
|
+
export declare function getClassForColorProp(color?: ColorProp | 'none', trim?: boolean): string | HexColor;
|
|
9
|
+
/**
|
|
10
|
+
* @param event het event waarvoor je de kleur wilt bepalen
|
|
11
|
+
* @param isHovered of de muis eroverheen hangt
|
|
12
|
+
* @param options (optionele) options voor het event
|
|
13
|
+
* @param def (optionele) default kleur
|
|
14
|
+
* @returns een string met de juiste kleur
|
|
15
|
+
*/
|
|
16
|
+
export declare function getCalendarEventColorClass<T extends BaseEventProps>(event: T, isHovered: boolean, options?: EventOptions<T>): string | HexColor;
|
|
17
|
+
/**
|
|
18
|
+
* @param date de datum waarvoor je de kleur wilt bepalen
|
|
19
|
+
* @param isHovered of de muis eroverheen hangt
|
|
20
|
+
* @param options (optionele) options voor de kalender
|
|
21
|
+
* @returns een string met de juiste kleur
|
|
22
|
+
*/
|
|
23
|
+
export declare function getCalendarColorClass<T extends BaseEventProps>(date: JSDateTime | Date, isHovered: boolean, options?: CalendarOptions<T>): string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SizeProp, TagSizeProp } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* @param size the preferred size of the element
|
|
4
|
+
* @returns The appropriate Bulma class for the element size.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getSizeClass(size: SizeProp, trim?: boolean): string;
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @param size icon size
|
|
10
|
+
* @returns The appropriate Font Awesome icon size.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getFAIconSize(size: SizeProp, trim?: boolean): string;
|
|
13
|
+
/**
|
|
14
|
+
* @param size - The size of the tag.
|
|
15
|
+
* @param single - Whether the tag is a single tag or a group of tags.
|
|
16
|
+
* @returns The appropriate Bulma class for the tag size.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getTagSizeClass(size: TagSizeProp, single: boolean, trim?: boolean): string;
|
|
19
|
+
/**
|
|
20
|
+
* @param size the preferred size of the element
|
|
21
|
+
* @returns The appropriate Bulma class for the element size.
|
|
22
|
+
*/
|
|
23
|
+
export declare function getTextSizeClass(size: SizeProp, trim?: boolean): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useSyncExternalStore } from 'react';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
type Subscribe = (onStoreChange: () => void) => () => void;
|
|
2
|
+
type GetSnapshot<T> = () => T;
|
|
3
|
+
type IsEqual<T> = (left: T, right: T) => boolean;
|
|
4
|
+
export declare function useSyncExternalStoreWithSelector<TSnapshot, TSelection>(subscribe: Subscribe, getSnapshot: GetSnapshot<TSnapshot>, getServerSnapshot: GetSnapshot<TSnapshot> | undefined, selector: (snapshot: TSnapshot) => TSelection, isEqual?: IsEqual<TSelection>): TSelection;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/** Color scheme type */
|
|
2
|
+
export type ColorSchemeType = 'light' | 'dark';
|
|
3
|
+
/**
|
|
4
|
+
* Type om een ander type beter leestbaar te maken, meer niet
|
|
5
|
+
*/
|
|
6
|
+
export type PrettierType<T> = {
|
|
7
|
+
[P in keyof T]: T[P];
|
|
8
|
+
} & {};
|
|
9
|
+
/** voor het maken van van ene partial, maar dan OOK voor nested objects */
|
|
10
|
+
export type DeepPartial<T> = {
|
|
11
|
+
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
12
|
+
};
|
|
13
|
+
/** Strict Omit, controleert ook of K wel een key van T is. */
|
|
14
|
+
export type StrictOmit<T, K extends keyof T> = Omit<T, K>;
|
|
15
|
+
/** wrapper voor `keyof T` */
|
|
16
|
+
export type KeyOf<T> = keyof T;
|
|
17
|
+
/** bepaal het type van een `Set` */
|
|
18
|
+
export type TypeOfSet<T extends Set<any>> = T extends Set<infer U> ? U : never;
|
|
19
|
+
/** extend een string met autocomplete opties voor de DEVELOPER
|
|
20
|
+
* @example:
|
|
21
|
+
* type Color = 'primary'|'white'|'black'|string // een string met een aantal voorgebakken opties. De VSCode autocomplete werkt
|
|
22
|
+
* type ColorWithAutocomplete = StringWithAutocomplete<'primary'|'white'|'black'> // zelfde, maar de VSCode autocomplete werkt nu op de opgegeven waarden
|
|
23
|
+
*/
|
|
24
|
+
export type StringWithAutocomplete<TOptions extends string> = TOptions | (string & {});
|
|
25
|
+
/**
|
|
26
|
+
* Types waar de size van een component van belang is (default is meestal Medium (`'m'`))
|
|
27
|
+
* - De `<Tag>`-component gebruikt een speciale `TagSizeProp`. Er is voor tags geen `xl`-size
|
|
28
|
+
* - In bulma bestaat `'xl'` niet. Daarom is `'l'` in bulma `'medium'` en `'xl'` in in bulma `'large'`
|
|
29
|
+
*/
|
|
30
|
+
export type SizeProp = 's' | 'm' | 'l' | 'xl';
|
|
31
|
+
/**
|
|
32
|
+
* Type waarbij je de alignment van (meestal de content) kan instellen: (l)eft, (c)enter, (r)ight.
|
|
33
|
+
* Default is meestal left (l))
|
|
34
|
+
*/
|
|
35
|
+
export type AlignmentProp = 'l' | 'c' | 'r';
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* String template literal type voor een Hex Color, gebruikt in de `ColorInput`.
|
|
39
|
+
* Kan als hex-kleur met 3 of 6 karakters worden opgegeven. Dus `#fff` of `#ffffff`.
|
|
40
|
+
*/
|
|
41
|
+
export type HexColor = `#${string}`;
|
|
42
|
+
/**
|
|
43
|
+
* String template literal type voor een Hex Color, gebruikt in de `ColorInput`.
|
|
44
|
+
* - Tuple[0] r: red (0-255)
|
|
45
|
+
* - Tuple[1] g: green (0-255)
|
|
46
|
+
* - Tuple[2] b: blue (0-255)
|
|
47
|
+
*/
|
|
48
|
+
export type RGBColor = readonly [r: number, g: number, b: number, a?: number];
|
|
49
|
+
/**
|
|
50
|
+
* Tuple type voor een hsl Color, gebruikt in de `ColorInput`.
|
|
51
|
+
* - Tuple[0] h: hue (0-360)
|
|
52
|
+
* - Tuple[1] s: saturation (0-100)
|
|
53
|
+
* - Tuple[2] l: lightness (0-100)
|
|
54
|
+
*/
|
|
55
|
+
export type HSLColor = readonly [h: number, s: number, l: number, a?: number];
|
|
56
|
+
/**
|
|
57
|
+
* Type voor de bulma-kleuren: (p)rimary, (i)nfo, (s)uccess, (d)anger, (w)arning, (l)ink.
|
|
58
|
+
* Als bulma niet alleen de default kleuren gebruikt, kan je ook andere kleuren uit bulma
|
|
59
|
+
* gebruiken met een string (structuur `is-${string}`) optie.
|
|
60
|
+
*/
|
|
61
|
+
export type ColorProp = 'p' | 'i' | 's' | 'd' | 'w' | 'l' | 'light' | 'dark' | `is-${string}`;
|
|
62
|
+
/** Type voor het instellen van de alignment van tekst: (l)eft, (c)enter, (r)ight. Default is meestal left (l)) */
|
|
63
|
+
export type TextAlignmentProp = 'l' | 'c' | 'r';
|
|
64
|
+
/** Positie voor items: (l)eft, (r)ight, (t)op, (b)ottom */
|
|
65
|
+
export type PositionProp = 'l' | 'r' | 't' | 'b';
|
|
66
|
+
/** Input modus voor virtuele toetsenborden (smartphones, tablets) */
|
|
67
|
+
export type KeyboardTypeProp = 'none' | 'numeric' | 'decimal' | 'tel' | 'search' | 'url' | 'email' | 'text';
|
|
68
|
+
/** Coordinaten - gebruikt voor ContextMenu */
|
|
69
|
+
export type CoordinatesProp = {
|
|
70
|
+
x: number;
|
|
71
|
+
y: number;
|
|
72
|
+
z?: number;
|
|
73
|
+
};
|
|
74
|
+
/** Rectangle - gebruikt voor ContextMenu */
|
|
75
|
+
export type RectProp = {
|
|
76
|
+
width: number;
|
|
77
|
+
height: number;
|
|
78
|
+
};
|
|
79
|
+
/** Tags gebruiken andere sizes dan de gewone sizes van de `SizeProp`. Er is geen `'xl'`-variant */
|
|
80
|
+
export type TagSizeProp = 's' | 'm' | 'l';
|
|
81
|
+
/** Direction prop voor inputs */
|
|
82
|
+
export type DirectionProp = 'h' | 'horizontal' | 'v' | 'vertical';
|
|
83
|
+
/** Link Relationship types */
|
|
84
|
+
export type RelationshipProp = 'external' | 'help' | 'license' | 'next' | 'nofollow' | 'noreferrer' | 'prefetch' | 'prev' | 'search';
|
|
85
|
+
export type AnchorTargetProp = '_blank' | '_self' | '_parent' | '_top' | string;
|
|
86
|
+
export type AnchorRelProp = 'alternate' | 'author' | 'bookmark' | 'external' | 'help' | 'license' | 'next' | 'nofollow' | 'noreferrer' | 'noopener' | 'prev' | 'search' | 'tag' | string;
|
|
87
|
+
/**
|
|
88
|
+
* Indicator positie
|
|
89
|
+
* - `tl` = `top-left`
|
|
90
|
+
* - `tr` = `top-right`
|
|
91
|
+
* - `tc` = `top-center`
|
|
92
|
+
* - `bl` = `bottom-left`
|
|
93
|
+
* - `br` = `bottom-right`
|
|
94
|
+
* - `bc` = `bottom-center`
|
|
95
|
+
* - `lc` = `left-center`
|
|
96
|
+
* - `rc` = `right-center`
|
|
97
|
+
*/
|
|
98
|
+
export type IndicatorPositionProp = 'tl' | 'tr' | 'tc' | 'bl' | 'br' | 'bc' | 'lc' | 'rc' | 'top-left' | 'top-right' | 'top-center' | 'bottom-left' | 'bottom-right' | 'bottom-center' | 'left-center' | 'right-center';
|
|
99
|
+
/**
|
|
100
|
+
* Autocomplete-types voor bijvoorbeeld password-managers.
|
|
101
|
+
* Programma's zoals bijvoorbeeld 1Password gebruiken deze om te bepalen waar dit veld mee gevuld moet worden.
|
|
102
|
+
* **LET OP:** `off` wordt door sommige browsers genegeerd (eikels). Gebruik `nope` als je *ECHT* geen autocomplete wil.
|
|
103
|
+
* */
|
|
104
|
+
export type AutoCompleteProp = 'on' | 'off' | 'nope' | 'current-password' | 'new-password' | 'username' | 'given-name' | 'additional-name' | 'family-name' | 'nickname' | 'email' | 'name' | 'one-time-code' | 'organization' | 'street-address' | 'tel' | 'url' | 'bday' | 'language' | 'country' | 'postal-code' | 'cc-name' | 'cc-number' | 'cc-exp' | 'cc-csc' | 'cc-type' | (string & {});
|