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,248 @@
|
|
|
1
|
+
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
2
|
+
import { AlignmentProp, DirectionProp, AutoCompleteProp, KeyboardTypeProp, StrictOmit, SizeProp, ColorProp } from './../types';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { MonthInputString } from './Periodes/MonthInput';
|
|
5
|
+
import { WeekInputString } from './Periodes/WeekInput';
|
|
6
|
+
export type InputErrorProps<T = InputValueType> = {
|
|
7
|
+
/** current value */
|
|
8
|
+
value: T | undefined;
|
|
9
|
+
/** is deze input 'touched' (gefocused en weer geblurred (unfocused)) */
|
|
10
|
+
touched: boolean;
|
|
11
|
+
/** is deze input focused? */
|
|
12
|
+
focused: boolean;
|
|
13
|
+
/** is deze input required? */
|
|
14
|
+
required: boolean;
|
|
15
|
+
/** is deze input disabled? */
|
|
16
|
+
disabled: boolean;
|
|
17
|
+
/** is deze input readonly? */
|
|
18
|
+
readonly: boolean;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Stel een icoon (met wat extra settings) samen voor gebruik aan de rechterkant van een Input.
|
|
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
|
+
* @return een tuple: `[icon: React.Reactnode]` of `[icon: React.ReactNode, onClick:() => void]`.
|
|
28
|
+
* - 1e item `ReactNode` MOET van het component-type `<Icon icon={...} />` zijn!
|
|
29
|
+
* - 2e item`onClick` is optioneel en is een callback voor een click op het icon.
|
|
30
|
+
*/
|
|
31
|
+
export type InputIconRightFn<T extends InputValueType = InputValueType> = (v: T | undefined, hovered: boolean, disabled: boolean, loading: boolean, focused: boolean) => [IconComponent: React.ReactNode, onClick?: () => void, color?: ColorProp];
|
|
32
|
+
type InputValueType = string | number | string[] | readonly string[] | undefined;
|
|
33
|
+
type InputStylingPropsType = {
|
|
34
|
+
/** grootte van de input (default = `m`, medium) */ size?: SizeProp | undefined;
|
|
35
|
+
/** alignment van de input (default = `l`, left) */ alignment?: AlignmentProp | undefined;
|
|
36
|
+
/** moet het label van de input verborgen worden? (screenreader only) (default = `false`) */ labelHidden?: boolean | undefined;
|
|
37
|
+
/** label boven (`v`) of voor (`h`) de input, (default = `v`, vertical) */ direction?: DirectionProp | undefined;
|
|
38
|
+
/** (optioneel) icon op de input */ icon?: IconProp | string | undefined | null;
|
|
39
|
+
/** (optioneel) kleur van de input - __LET OP!__ overschrijft de normale kleur EN de danger-kleur als er een error-message is! */ color?: ColorProp | undefined;
|
|
40
|
+
infoData?: string | React.ReactNode | ((helptag?: string | undefined) => void) | undefined;
|
|
41
|
+
};
|
|
42
|
+
type InputPropsType<T extends InputValueType = InputValueType> = {
|
|
43
|
+
optionList?: string[] | Array<{
|
|
44
|
+
value: string;
|
|
45
|
+
label: string;
|
|
46
|
+
}>;
|
|
47
|
+
/** label bij de input. Als geen label, dan wordt de `name`-property gebruikt */ label?: string | undefined;
|
|
48
|
+
/** Wordt er een rood sterretje getoond bij required inputs ? (default = `false`) */ showRequiredOnLabel?: boolean;
|
|
49
|
+
/** foutmelding bij de input */ errorMessage?: string | ((s: InputErrorProps<T>) => string) | undefined;
|
|
50
|
+
/** info-melding bij de input */ infoMessage?: string | ((v?: InputValueType) => string) | undefined;
|
|
51
|
+
/** helptag in Loon bij de input (`:HOOFDGROEP:SUBGROEP:`) */ helpTag?: string;
|
|
52
|
+
/** type input (default = `text`) */ type?: 'text' | 'password' | 'number' | 'email' | 'tel' | 'url' | 'range' | 'date' | 'datetime-local' | 'datetime' | 'month' | 'week' | 'time' | 'color' | 'search' | 'select' | 'file' | 'textarea';
|
|
53
|
+
/** (optioneel) tooltip-title voor de input. Bij gebruik van `pattern`, kan je hier het gewenste formaat opgeven. */ title?: string | undefined;
|
|
54
|
+
/** (optioneel) id voor de input. Als geen id, dan wordt de `name`-property gebruikt */ id?: string | undefined;
|
|
55
|
+
/** name-property voor de input */ name: string;
|
|
56
|
+
/** waarde voor de input */ value?: T;
|
|
57
|
+
/** is deze input loading (default = false) */ loading?: boolean | undefined;
|
|
58
|
+
/** gebruikt deze input de spellchecked (default = `false`) */ spellCheck?: boolean | undefined;
|
|
59
|
+
/** is deze input required (default= `false`) */ required?: boolean | undefined;
|
|
60
|
+
/** autocomplete voor deze input (default = `off`) */ autoComplete?: AutoCompleteProp | undefined;
|
|
61
|
+
/** type toetsenbord (voor smartphones) voor deze input (default = `text`) */ keyboardType?: KeyboardTypeProp | undefined;
|
|
62
|
+
/** placeholder in de input */ placeholder?: string | undefined;
|
|
63
|
+
/** is deze input disabled 9default = `false`) */ disabled?: boolean | undefined;
|
|
64
|
+
/** bij welk form hoort deze input? */ form?: string | undefined;
|
|
65
|
+
/** patroon voor de inputs (string of regex). Geef met `title` een gewenst formaat op. */ pattern?: string | undefined;
|
|
66
|
+
/** Is deze input readonly (default = `false`). Bij `true` zie je alleen nog maar de content van de input */
|
|
67
|
+
readonly?: boolean | undefined;
|
|
68
|
+
/** moet deze input de focus krijgen? (default = `false`) */ autofocus?: boolean | undefined;
|
|
69
|
+
/** (optionele) `ref` voor gebruik met `React.useRef<HTMLInputElement>` */ inputRef?: React.Ref<HTMLInputElement> | undefined;
|
|
70
|
+
/** max waarde of max lengte voor de input
|
|
71
|
+
* _(altijd hoger dan de `min`-prop)_
|
|
72
|
+
* @example // voor max waarde
|
|
73
|
+
* <Input type="number" max="100"/>
|
|
74
|
+
* <Input type="range" max="100"/>
|
|
75
|
+
* <Input type="date" max="2019-12-25"/>
|
|
76
|
+
* <Input type="month" max="2019-12"/>
|
|
77
|
+
* <Input type="week" max="2019-W23"/>
|
|
78
|
+
* <Input type="time" max="17:30"/>
|
|
79
|
+
* <Input type="datetime-local" max="29-12-25T23:59"/>
|
|
80
|
+
* @example //strings: voor max length, altijd 0 of hoger
|
|
81
|
+
* <Input type="text" max="100"/>
|
|
82
|
+
* <Input type="password" max="50"/> */
|
|
83
|
+
max?: number | WeekInputString | MonthInputString | string | undefined;
|
|
84
|
+
/** min waarde of min lengte voor de input
|
|
85
|
+
* _(altijd lager dan de `max`-prop)_
|
|
86
|
+
* @example <Input type="number" min="1"/>
|
|
87
|
+
* <Input type="range" min="1"/>
|
|
88
|
+
* <Input type="date" min="2019-01-01"/>
|
|
89
|
+
* <Input type="month" min="2019-01-01"/>
|
|
90
|
+
* <Input type="week" min="2019-W01"/>
|
|
91
|
+
* <Input type="time" min="08:30"/>
|
|
92
|
+
* <Input type="datetime-local" max="2019-01-01T00:00"/>
|
|
93
|
+
* @example //strings: voor max length, altijd 0 of hoger
|
|
94
|
+
* <Input type="text" min="100"/>
|
|
95
|
+
* <Input type="password" min="50"/> */
|
|
96
|
+
min?: number | WeekInputString | MonthInputString | string | undefined;
|
|
97
|
+
/** stapgrootte voor groter/kleiner aanpassingen
|
|
98
|
+
* | type| value | Example|
|
|
99
|
+
* |----------------|----------------|---------------------------------------------|
|
|
100
|
+
* | number | `1` | `<Input type="number" step="2"/>` |
|
|
101
|
+
* | range | `1` | `<Input type="range" step="2"/>` |
|
|
102
|
+
* | date | `1` (day) | `<Input type="date" step="2"/>` |
|
|
103
|
+
* | month | `1` (month) | `<Input type="month" step="2"/>` |
|
|
104
|
+
* | week | `1` (week) | `<Input type="week" step="2"/>` |
|
|
105
|
+
* | time | `60` (seconds) | `<Input type="time" step="2"/>` |
|
|
106
|
+
* | datetime-local | `1` (second) | `<Input type="datetime-local" step="900"/>` | */
|
|
107
|
+
step?: number | undefined;
|
|
108
|
+
/** Voeg extra styles to aan deze input */
|
|
109
|
+
styles?: React.CSSProperties | undefined;
|
|
110
|
+
/** Voeg extra classes toe aan deze input */
|
|
111
|
+
className?: string | undefined;
|
|
112
|
+
optionListId?: string | undefined;
|
|
113
|
+
/**
|
|
114
|
+
* `hidden`: geen icon rechts
|
|
115
|
+
* `visible`: standaard gedrag, een check of een error icoon, of een info icoon als showInfo/infoData is meegegeven
|
|
116
|
+
* De functie is apart. Die returned een tuple. __LET OP: ALS JE DEZE GEBRUIKT, HEB JE NIET MEER DE NORMALE HELP-FUNCTIONALITEIT__
|
|
117
|
+
* - 1e item een ReactNode teruggeven van het type `<Icon icon={...} />`, voor het icon.
|
|
118
|
+
* - 2e item (optioneel) een onClick functie, als het icon klikbaar moet zijn. Die __MOET__ op de container, daarom niet in de component zelf.
|
|
119
|
+
* De functie wordt aangeroepen met de volgende parameters:
|
|
120
|
+
* - `value`: de value van de input
|
|
121
|
+
* - `hovered`: is de input momenteel hovered?
|
|
122
|
+
* - `disabled`: is de input momenteel disabled?
|
|
123
|
+
* - `loading`: is de input momenteel loading?
|
|
124
|
+
* - `focused`: is de input momenteel focused?
|
|
125
|
+
*/
|
|
126
|
+
iconRight?: 'hidden' | 'visible' | InputIconRightFn<T> | undefined;
|
|
127
|
+
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void | Promise<void>;
|
|
128
|
+
/** callback voor onChange. Voor de echte waarde, gebruik je `onValueChanged` */
|
|
129
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void | Promise<void>;
|
|
130
|
+
/** value-changed callback met de nieuwe waarde van de input. Kan direct met de `setX()` van `const [x, setX] = React.useState()` worden gebruikt
|
|
131
|
+
* @example
|
|
132
|
+
* const [x, setX] = React.useState('');
|
|
133
|
+
* return <Input value={x} onValueChange={setX} {...props} />
|
|
134
|
+
*/
|
|
135
|
+
onValueChanged?: (e: T) => void | Promise<void>;
|
|
136
|
+
/** callback voor focus MET daarbij de helptag */
|
|
137
|
+
onFocus?: (e: React.FocusEvent<HTMLInputElement>, helpTag?: string) => void | Promise<void>;
|
|
138
|
+
/** callback voor typen */
|
|
139
|
+
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void | Promise<void>;
|
|
140
|
+
/** callback voor typen */
|
|
141
|
+
onKeyUp?: (e: React.KeyboardEvent<HTMLInputElement>) => void | Promise<void>;
|
|
142
|
+
};
|
|
143
|
+
/** Tijd voordat een input de focus verliest als je erop klikt/hovert en er is hulp. Anders is het instant. */
|
|
144
|
+
declare const FOCUS_HELP_TIMEOUT_IN_MS = 333;
|
|
145
|
+
/**
|
|
146
|
+
* Basis input component. Deze component heeft dezelfde properties als de gewone `<input ... />`-tag en de `<Input<T> ... />-tag`.
|
|
147
|
+
* Het verschil met de `Input`-tag is dat deze compionent **geen** direction, label, of icon heeft, dus je kan hem zelf inrichten
|
|
148
|
+
* Wordt door (bijna) alle andere input-componenten gebruikt. Alleen niet door de `<Select>`, <Radio>`, `<Checkbox>` en `<Textarea>` componenten.
|
|
149
|
+
* @example <BaseInput type="text" name="myInput" value={x} onValueChanged={setX} />
|
|
150
|
+
* @description callbacks.
|
|
151
|
+
* | callback | | description |
|
|
152
|
+
* |----------------|------|---------------------------------------------|
|
|
153
|
+
* | onBlur |`(e: React.FocusEvent<HTMLInputElement>)=> void` | callback voor unfocus (blur), zet OOK de input op `touched`|
|
|
154
|
+
* | onChange |`(e: React.FocusEvent<HTMLInputElement>)=> void` | callback voor onChange|
|
|
155
|
+
* | onValueChanged |`(v: T)=> void` | value-changed callback met de nieuwe waarde van de input. Kan direct met de `setX()` van `const [x, setX] = React.useState()` worden gebruikt|
|
|
156
|
+
* | onFocus |`(e: React.FocusEvent<HTMLInputElement>, ht?: string)=> void` | callback voor focus, MET de `helpTag` voor gebruik in Loon (F1) |
|
|
157
|
+
* | onKeyDown |`(e: React.KeyboardEvent<HTMLInputElement>)=> void` | callback voor typen |
|
|
158
|
+
* | onKeyUp |`(e: React.KeyboardEvent<HTMLInputElement>)=> void` | callback voor typen |
|
|
159
|
+
* @description props: ({@link InputPropsType}) voor de input.
|
|
160
|
+
* | prop | type | description |
|
|
161
|
+
* |----------------|----------------|---------------------------------------------|
|
|
162
|
+
* | alignment | `AlignmentType` | alignment van de input (default = `left`) |
|
|
163
|
+
* | autoComplete | `AutoCompleteProp` | autocomplete voor deze input (default = `off`)|
|
|
164
|
+
* | autofocus | `boolean` | moet deze input de focus krijgen? (default = `false`)|
|
|
165
|
+
* | disabled | `boolean` | is deze input disabled (default = `false`)|
|
|
166
|
+
* | errorMessage | `string`, `(v?: string) => string` | error message voor deze input (default = `''`)|
|
|
167
|
+
* | form | `string` | form waar deze input bij hoort (default = `undefined`)|
|
|
168
|
+
* | helpTag | `string` `:Hoofdgroep:Subgroep:` | help tag voor deze input (default = `undefined`). Kan gebruikt worden voor de Help In loon (F1) functionaliteit. Meegelevert in de callback voor `onFocus`|
|
|
169
|
+
* | id | `string` | id voor deze input (default = `undefined`)|
|
|
170
|
+
* | inputRef | `React.Ref<HTMLInputElement>` | `ref` voor gebruik met `React.useRef<HTMLInputElement>` (default = `undefined`)|
|
|
171
|
+
* | keyboardType | `string` | keyboard type voor deze input (default = `text`)|
|
|
172
|
+
* | max | `number`,`string` | max waarde of max lengte voor de input (default = `undefined`)|
|
|
173
|
+
* | min | `number`,`string` | min waarde of min lengte voor de input (default = `undefined`)|
|
|
174
|
+
* | name | `string` | name voor deze input (**verplicht**)|
|
|
175
|
+
* | pattern | `string` | pattern voor deze input (default = `undefined`)|
|
|
176
|
+
* | placeholder | `string` | placeholder voor deze input (default = `undefined`)|
|
|
177
|
+
* | readonly | `boolean` | is deze input readonly (default = `false`)|
|
|
178
|
+
* | required | `boolean` | is deze input required (default = `false`)|
|
|
179
|
+
* | size | `SizeProp` | size voor deze input (default = `undefined`)|
|
|
180
|
+
* | spellCheck | `boolean` | moet deze input spellcheck hebben (default = `false`)|
|
|
181
|
+
* | step | `number` | stapgrootte voor groter/kleiner aanpassingen (default = `1`)|
|
|
182
|
+
* | title | `string` | title voor deze input (default = `undefined`)|
|
|
183
|
+
* | type | `string` | type voor deze input (default = `text`)|
|
|
184
|
+
* | value | `string` | value voor deze input (default = `undefined`)|
|
|
185
|
+
*/
|
|
186
|
+
declare function BaseInput<T extends InputValueType = string>({ alignment: alignmentProp, autoComplete, optionListId, autofocus, disabled, errorMessage, infoMessage, form, helpTag, id, inputRef: ref, keyboardType, max, min, name, pattern, placeholder, readonly, required, size: sizeProp, spellCheck, step, title, type, value, className: extraClasses, styles, color, onBlur, onChange, onFocus, onKeyDown, onKeyUp, onValueChanged, }: StrictOmit<InputPropsType<T>, 'optionList'> & StrictOmit<InputStylingPropsType, 'labelHidden' | 'direction' | 'icon'>): import("react/jsx-runtime").JSX.Element;
|
|
187
|
+
/**
|
|
188
|
+
* Input component. Deze component heeft dezelfde properties als de gewone `<input ... />`-tag en de `<BaseInput<T> ... />-tag`.
|
|
189
|
+
* Het verschil met de `BaseInput`-tag is dat deze compionent **wel** direction, label, of icon heeft.
|
|
190
|
+
* @example <Input type="text" name="myInput" value={x} onValueChanged={setX} icon={faMouse} />
|
|
191
|
+
* @description callbacks.
|
|
192
|
+
* | callback | | description |
|
|
193
|
+
* |----------------|------|---------------------------------------------|
|
|
194
|
+
* | onBlur |`(e: React.FocusEvent<HTMLInputElement>)=> void` | callback voor unfocus (blur), zet OOK de input op `touched`|
|
|
195
|
+
* | onChange |`(e: React.FocusEvent<HTMLInputElement>)=> void` | callback voor onChange|
|
|
196
|
+
* | onValueChanged |`(v: T)=> void` | value-changed callback met de nieuwe waarde van de input. Kan direct met de `setX()` van `const [x, setX] = React.useState()` worden gebruikt|
|
|
197
|
+
* | onFocus |`(e: React.FocusEvent<HTMLInputElement>, ht?: string)=> void` | callback voor focus, MET de `helpTag` voor gebruik in Loon (F1) |
|
|
198
|
+
* | onKeyDown |`(e: React.KeyboardEvent<HTMLInputElement>)=> void` | callback voor typen |
|
|
199
|
+
* | onKeyUp |`(e: React.KeyboardEvent<HTMLInputElement>)=> void` | callback voor typen |
|
|
200
|
+
* @description props: {@link InputPropsType} voor de input.
|
|
201
|
+
* | prop | type | description |
|
|
202
|
+
* |----------------|----------------|---------------------------------------------|
|
|
203
|
+
* | alignment | `AlignmentType` | alignment van de input (default = `left`) |
|
|
204
|
+
* | autoComplete | `AutoCompleteProp` | autocomplete voor deze input (default = `off`)|
|
|
205
|
+
* | autofocus | `boolean` | moet deze input de focus krijgen? (default = `false`)|
|
|
206
|
+
* | disabled | `boolean` | is deze input disabled (default = `false`)|
|
|
207
|
+
* | direction | `DirectionProp` | direction voor deze input (default = `h`). Voor styling|
|
|
208
|
+
* | errorMessage | `string`, `(v?: string) => string` | error message voor deze input (default = `''`)|
|
|
209
|
+
* | form | `string` | form waar deze input bij hoort (default = `undefined`)|
|
|
210
|
+
* | helpTag | `string` | help tag voor deze input (default = `undefined`). Kan gebruikt worden voor de Help In loon (F1) functionaliteit. Meegelevert in de callback voor `onFocus`|
|
|
211
|
+
* | id | `string` | id voor deze input (default = `undefined`)|
|
|
212
|
+
* | inputRef | `React.Ref<HTMLInputElement>` | `ref` voor gebruik met `React.useRef<HTMLInputElement>` (default = `undefined`)|
|
|
213
|
+
* | keyboardType | `string` | keyboard type voor deze input (default = `text`)|
|
|
214
|
+
* | max | `number`, `string` | max waarde of max lengte voor de input (default = `undefined`)|
|
|
215
|
+
* | min | `number`, `string` | min waarde of min lengte voor de input (default = `undefined`)|
|
|
216
|
+
* | name | `string` | name voor deze input (**verplicht**)|
|
|
217
|
+
* | pattern | `string` | pattern voor deze input (default = `undefined`)|
|
|
218
|
+
* | placeholder | `string` | placeholder voor deze input (default = `undefined`)|
|
|
219
|
+
* | readonly | `boolean` | is deze input readonly (default = `false`)|
|
|
220
|
+
* | required | `boolean` | is deze input required (default = `false`)|
|
|
221
|
+
* | size | `SizeProp` | size voor deze input (default = `undefined`)|
|
|
222
|
+
* | spellCheck | `boolean` | moet deze input spellcheck hebben (default = `false`)|
|
|
223
|
+
* | step | `number` | stapgrootte voor groter/kleiner aanpassingen (default = `1`)|
|
|
224
|
+
* | title | `string` | title voor deze input (default = `undefined`)|
|
|
225
|
+
* | type | `string` | type voor deze input (default = `text`)|
|
|
226
|
+
* | value | `string` | value voor deze input (default = `undefined`)|
|
|
227
|
+
*/
|
|
228
|
+
declare function Input<T extends InputValueType = string>({ direction: directionProp, errorMessage, infoMessage, showRequiredOnLabel, iconRight, icon, id, label, labelHidden, name, required, loading, disabled, readonly, size: sizeProp, value, infoData, helpTag, optionList, onBlur, onFocus, ...props }: StrictOmit<InputPropsType<T>, 'optionListId'> & InputStylingPropsType): import("react/jsx-runtime").JSX.Element;
|
|
229
|
+
type InputContainerProps = {
|
|
230
|
+
label: string;
|
|
231
|
+
required: boolean;
|
|
232
|
+
showRequiredOnLabel: boolean;
|
|
233
|
+
inputId?: string;
|
|
234
|
+
labelHidden?: boolean;
|
|
235
|
+
loading?: boolean;
|
|
236
|
+
children: React.ReactNode;
|
|
237
|
+
size: SizeProp;
|
|
238
|
+
direction: DirectionProp;
|
|
239
|
+
controlClassName?: string;
|
|
240
|
+
infoData?: React.ReactNode | undefined;
|
|
241
|
+
setHovered?: (hovered: boolean) => void;
|
|
242
|
+
onMouseEnter?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
243
|
+
onMouseLeave?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
244
|
+
};
|
|
245
|
+
/** Een wrapper voor een input component, om te zorgen dat ze allemaal op dezelfde manier horizontaal of verticaal aligned worden. */
|
|
246
|
+
declare function InputContainer({ children, controlClassName, direction, showRequiredOnLabel, inputId, label, labelHidden, required, size, loading, infoData, setHovered, onMouseEnter, onMouseLeave, }: InputContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
247
|
+
export { BaseInput, Input, InputContainer, FOCUS_HELP_TIMEOUT_IN_MS };
|
|
248
|
+
export type { InputPropsType, InputStylingPropsType, InputValueType };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { StrictOmit } from './../../types';
|
|
2
|
+
import { IbanCountryCode, IbanGegevens } from './../../utils/IBAN.functions';
|
|
3
|
+
import { InputPropsType, InputStylingPropsType, InputErrorProps } from '../Input';
|
|
4
|
+
export type IBANInputErrorCode = '' | 'unknown_country' | 'unsupported_country' | 'incomplete' | 'invalid_format' | 'invalid_length' | 'invalid_structure' | 'invalid_checksum' | 'disallowed_country';
|
|
5
|
+
export type IBANInputValidationResult = {
|
|
6
|
+
/** De schone IBAN-waarde (uppercase, geen spaties) */
|
|
7
|
+
value: string;
|
|
8
|
+
/** De geformatteerde IBAN-waarde (met spaties elke 4 tekens) */
|
|
9
|
+
formatted: string;
|
|
10
|
+
/** Of de IBAN geldig is */
|
|
11
|
+
isValid: boolean;
|
|
12
|
+
/** Error code bij ongeldig, lege string bij geldig */
|
|
13
|
+
errorCode: IBANInputErrorCode;
|
|
14
|
+
/** ISO country code (bijv. 'NL', 'DE', '') */
|
|
15
|
+
countryCode: string;
|
|
16
|
+
/** Volledige country name (bijv. 'Netherlands', 'Germany', '') */
|
|
17
|
+
countryName: string;
|
|
18
|
+
/** Of dit land onderdeel is van SEPA */
|
|
19
|
+
isSepa: boolean;
|
|
20
|
+
/** De 2-cijferige check digits */
|
|
21
|
+
checkDigits: string;
|
|
22
|
+
/** Basic Bank Account Number (alles na country code en check digits) */
|
|
23
|
+
bban: string;
|
|
24
|
+
/** Verwachte IBAN-lengte voor dit land (0 als onbekend) */
|
|
25
|
+
expectedLength: number;
|
|
26
|
+
/** Huidige lengte van de opgeschoonde IBAN */
|
|
27
|
+
currentLength: number;
|
|
28
|
+
/** Bank code (eerste 4 tekens van BBAN voor de meeste landen, leeg indien niet van toepassing) */
|
|
29
|
+
bankCode: string;
|
|
30
|
+
/** Of de IBAN de verwachte lengte heeft bereikt */
|
|
31
|
+
isComplete: boolean;
|
|
32
|
+
/** Of volledige validatie wordt ondersteund voor dit land */
|
|
33
|
+
isSupported: boolean;
|
|
34
|
+
};
|
|
35
|
+
export type IBANInputProps = StrictOmit<InputPropsType<string>, 'type' | 'step' | 'pattern'> & InputStylingPropsType & {
|
|
36
|
+
/**
|
|
37
|
+
* Allowed countries voor IBAN validatie.
|
|
38
|
+
* Kan zijn:
|
|
39
|
+
* - Een array met country codes (uppercase of lowercase): `['NL', 'DE']` of `['nl', 'de']`
|
|
40
|
+
* - Een predicate function: `(code, details) => details.sepa`
|
|
41
|
+
* Als niet opgegeven, zijn alle landen toegestaan.
|
|
42
|
+
* @example ['NL', 'DE']
|
|
43
|
+
* @example (code, details) => details.sepa && code !== 'RU'
|
|
44
|
+
*/
|
|
45
|
+
allowCountries?: (Uppercase<IbanCountryCode> | Lowercase<IbanCountryCode>)[] | ((code: IbanCountryCode, details: IbanGegevens) => boolean);
|
|
46
|
+
/**
|
|
47
|
+
* Wordt aangeroepen bij value changes met gedetailleerde validation info
|
|
48
|
+
* @param result Object met value, formatted, isValid en errorCode
|
|
49
|
+
* @example onValueChangedObj={(result) => console.log(result.errorCode, result.isValid)}
|
|
50
|
+
*/
|
|
51
|
+
onValueChangedObj?: (result: IBANInputValidationResult) => void;
|
|
52
|
+
/**
|
|
53
|
+
* Error message om te tonen. Kan zijn:
|
|
54
|
+
* - Een string voor een vaste error message (component valideert dan niet meer zelf)
|
|
55
|
+
* - Een function die InputErrorProps ontvangt, uitgebreid met ibanErrorCode en ibanValidationResult
|
|
56
|
+
* Als niet opgegeven of als de function een lege string teruggeeft, worden default IBAN error messages getoond
|
|
57
|
+
* Let op: bij een string betekent een lege string "geen error"
|
|
58
|
+
* @example errorMessage={(props) => props.ibanErrorCode === 'incomplete' ? 'Vul het IBAN compleet in' : ''}
|
|
59
|
+
* @example errorMessage={(props) => props.ibanValidationResult?.bankName ? `Bank: ${props.ibanValidationResult.bankName}` : ''}
|
|
60
|
+
*/
|
|
61
|
+
errorMessage?: string | ((props: InputErrorProps & {
|
|
62
|
+
ibanErrorCode?: IBANInputErrorCode;
|
|
63
|
+
ibanValidationResult?: IBANInputValidationResult;
|
|
64
|
+
}) => string);
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Een input voor een IBAN. Deze input heeft validatie, formatting en country filtering.
|
|
68
|
+
* @example <IBANInput name="iban" value={iban} onValueChanged={setIban} />
|
|
69
|
+
* @example
|
|
70
|
+
* // Met custom error messages
|
|
71
|
+
* <IBANInput
|
|
72
|
+
* name="iban"
|
|
73
|
+
* value={iban}
|
|
74
|
+
* onValueChanged={setIban}
|
|
75
|
+
* errorMessage={(props) => {
|
|
76
|
+
* switch (props.ibanErrorCode) {
|
|
77
|
+
* case 'incomplete': return 'Vul het IBAN compleet in';
|
|
78
|
+
* case 'invalid_checksum': return 'Controleer de cijfers';
|
|
79
|
+
* default: return '';
|
|
80
|
+
* }
|
|
81
|
+
* }}
|
|
82
|
+
* />
|
|
83
|
+
* @example
|
|
84
|
+
* // Met toegang tot validation result
|
|
85
|
+
* <IBANInput
|
|
86
|
+
* errorMessage={(props) => {
|
|
87
|
+
* const result = props.ibanValidationResult;
|
|
88
|
+
* if (result?.bankName) return `Bank: ${result.bankName}`;
|
|
89
|
+
* if (result?.countryName) return `Land: ${result.countryName} (${result.currentLength}/${result.expectedLength})`;
|
|
90
|
+
* return '';
|
|
91
|
+
* }}
|
|
92
|
+
* />
|
|
93
|
+
* @param autoComplete de autocomplete type (password managers) (default = `cc-number`)
|
|
94
|
+
*/
|
|
95
|
+
export declare function IBANInput({ placeholder, helpTag, errorMessage, infoMessage, label, disabled, title, name, value, required, showRequiredOnLabel, spellCheck, id, autoComplete, inputRef, readonly, autofocus, iconRight, infoData, form, onBlur, onChange, onFocus, onKeyDown, onKeyUp, onValueChanged, size: sizeProp, alignment: alignmentProp, direction: directionProp, labelHidden, loading, icon, allowCountries, onValueChangedObj, ...props }: IBANInputProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface MaskedInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange' | 'onBlur'> {
|
|
3
|
+
mask: any;
|
|
4
|
+
guide?: boolean;
|
|
5
|
+
value?: string | number;
|
|
6
|
+
pipe?: any;
|
|
7
|
+
placeholderChar?: string;
|
|
8
|
+
keepCharPositions?: boolean;
|
|
9
|
+
showMask?: boolean;
|
|
10
|
+
onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
11
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
12
|
+
}
|
|
13
|
+
export type Mask = Array<string | RegExp> | ((value: string, config?: any) => Array<string | RegExp> | false);
|
|
14
|
+
export interface ConformToMaskConfig {
|
|
15
|
+
guide?: boolean;
|
|
16
|
+
previousConformedValue?: string;
|
|
17
|
+
placeholderChar?: string;
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
currentCaretPosition?: number;
|
|
20
|
+
keepCharPositions?: boolean;
|
|
21
|
+
}
|
|
22
|
+
interface ConformToMaskResult {
|
|
23
|
+
conformedValue: string;
|
|
24
|
+
meta: {
|
|
25
|
+
someCharsRejected: boolean;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export declare const MaskedInput: React.ForwardRefExoticComponent<MaskedInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
29
|
+
export declare function conformToMask(rawValue: string | undefined, mask: Mask, config?: ConformToMaskConfig): ConformToMaskResult;
|
|
30
|
+
export declare function createNumberMask({ prefix, suffix, includeThousandsSeparator, thousandsSeparatorSymbol, allowDecimal, decimalSymbol, decimalLimit, requireDecimal, allowNegative, allowLeadingZeroes, integerLimit, }?: {
|
|
31
|
+
prefix?: string | undefined;
|
|
32
|
+
suffix?: string | undefined;
|
|
33
|
+
includeThousandsSeparator?: boolean | undefined;
|
|
34
|
+
thousandsSeparatorSymbol?: string | undefined;
|
|
35
|
+
allowDecimal?: boolean | undefined;
|
|
36
|
+
decimalSymbol?: string | undefined;
|
|
37
|
+
decimalLimit?: number | undefined;
|
|
38
|
+
requireDecimal?: boolean | undefined;
|
|
39
|
+
allowNegative?: boolean | undefined;
|
|
40
|
+
allowLeadingZeroes?: boolean | undefined;
|
|
41
|
+
integerLimit?: null | undefined;
|
|
42
|
+
}): {
|
|
43
|
+
(rawValue?: string): any;
|
|
44
|
+
instanceOf: string;
|
|
45
|
+
};
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { StrictOmit } from './../../types';
|
|
2
|
+
import { InputPropsType, InputStylingPropsType } from '../Input';
|
|
3
|
+
type NumberInputProps = StrictOmit<InputPropsType<number>, 'type' | 'spellCheck'> & InputStylingPropsType & {
|
|
4
|
+
/** prefix voor de waarde (in de input zelf) */
|
|
5
|
+
prefix?: string;
|
|
6
|
+
/** suffix voor de waarde (in de input zelf) */
|
|
7
|
+
suffix?: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* NumberInput: input voor een getal
|
|
11
|
+
* @param value De waarde van de input
|
|
12
|
+
* @example <NumberInput value={1} step={3}/>
|
|
13
|
+
*/
|
|
14
|
+
declare function NumberInput({ value, prefix, suffix, icon, name, id: idProp, label, direction: directionProp, size: sizeProp, alignment: alignmentProp, required, disabled, readonly, loading, labelHidden, showRequiredOnLabel, iconRight, className: extraClasses, infoData, helpTag, errorMessage, infoMessage, min: minProp, max: maxProp, color, onValueChanged, onBlur, onFocus, ...props }: NumberInputProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export { NumberInput };
|
|
16
|
+
export type { NumberInputProps };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { StrictOmit } from './../../types';
|
|
2
|
+
import { InputPropsType, InputStylingPropsType } from '../Input';
|
|
3
|
+
type RangeInputProps = StrictOmit<InputPropsType<number>, 'autofocus' | 'autoComplete' | 'type' | 'spellCheck' | 'placeholder' | 'iconRight'> & StrictOmit<InputStylingPropsType, 'alignment' | 'icon'> & {
|
|
4
|
+
/** value-unit om __voor__ de geselecteerde waarde te zetten. (default = `''`) */
|
|
5
|
+
prefix?: string;
|
|
6
|
+
/** value-unit om __achter__ de geselecteerde waarde te zetten. (default = `''`) */
|
|
7
|
+
suffix?: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* RangeInput: input voor een getal. De range-input heeft geen placeholder, icon, autoComplete, spellCheck en autofocus. Ook size en alignment zijn niet van toepassing. Alleen op de uitlijning van het label
|
|
11
|
+
* @param value De waarde van de input
|
|
12
|
+
* @param prefix De unit (default = ''). Staat **voor** de geselecteerde waarde
|
|
13
|
+
* @param suffix De unit (default = ''). Staat **achter** de geselecteerde waarde
|
|
14
|
+
* @param min De minimale waarde van de input (default = 0)
|
|
15
|
+
* @param max De maximale waarde van de input (default = 100)
|
|
16
|
+
* @param step De stapgrootte van de input (default = 1)
|
|
17
|
+
* @example <RangeInput value={50} min={0} max={100} />
|
|
18
|
+
*/
|
|
19
|
+
declare function RangeInput({ value, min, max, step, prefix, suffix, helpTag, errorMessage, infoMessage, label, disabled, title, name, size: sizeProp, required, showRequiredOnLabel, id, readonly, form, inputRef, color, onBlur, onChange, onFocus, onKeyDown, onKeyUp, onValueChanged, direction: directionProp, labelHidden, infoData, }: RangeInputProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export { RangeInput };
|
|
21
|
+
export type { RangeInputProps };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { StrictOmit, HexColor, RGBColor, HSLColor } from './../../types';
|
|
2
|
+
import { InputPropsType, InputStylingPropsType } from '../Input';
|
|
3
|
+
type ColorInputProps = StrictOmit<InputPropsType<string>, 'type' | 'value' | 'onValueChanged' | 'step' | 'min' | 'max' | 'autoComplete' | 'spellCheck' | 'keyboardType'> & InputStylingPropsType & {
|
|
4
|
+
/** Gebruik de color-input met een hex-color, bijvooerbeeld`#ff8000` of `#fff` */
|
|
5
|
+
hexValue?: HexColor;
|
|
6
|
+
/** value-changed callback met de nieuwe waarde van de input in Hex-format. Kan direct met de `setX()` van `const [x, setX] = React.useState()` worden gebruikt
|
|
7
|
+
* @example
|
|
8
|
+
* const [x, setX] = React.useState('#ff8000');
|
|
9
|
+
* return <ColorInput hexValue={x} onHexValueChange={setX} {...props} />
|
|
10
|
+
*/
|
|
11
|
+
onHexValueChanged?: (v: HexColor) => void | Promise<void>;
|
|
12
|
+
/** Gebruik de color-input met een RGB-color, van `[0, 0, 0]` t/m `[255, 255, 255]` */
|
|
13
|
+
rgbValue?: RGBColor;
|
|
14
|
+
/** value-changed callback met de nieuwe waarde van de input in RGB-format. Kan direct met de `setX()` van `const [x, setX] = React.useState()` worden gebruikt
|
|
15
|
+
* @example
|
|
16
|
+
* const [x, setX] = React.useState([255, 128, 0]);
|
|
17
|
+
* return <ColorInput rgbValue={x} onRGBValueChange={setX} {...props} />
|
|
18
|
+
*/
|
|
19
|
+
onRGBValueChanged?: (v: RGBColor) => void | Promise<void>;
|
|
20
|
+
/** Gebruik de color-input met een HSL-color, van `[0, 0, 0]` t/m `[360, 100, 100]` */
|
|
21
|
+
hslValue?: HSLColor;
|
|
22
|
+
/** value-changed callback met de nieuwe waarde van de input in HSL-format. Kan direct met de `setX()` van `const [x, setX] = React.useState()` worden gebruikt
|
|
23
|
+
* @example
|
|
24
|
+
* const [x, setX] = React.useState([60, 100, 50]);
|
|
25
|
+
* return <ColorInput hslValue={x} onHSLValueChange={setX} {...props} />
|
|
26
|
+
*/
|
|
27
|
+
onHSLValueChanged?: (v: HSLColor) => void | Promise<void>;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Een color-input component dat een hex-color, een rgb-color of een hsl-color kan gebruiken.
|
|
31
|
+
* @description __LET OP:__ _Er zit een volgorde-afhankelijkheid in deze component: HEX gaat voor RGB en RGB gaat voor HSL._
|
|
32
|
+
* @param value deze bestaat niet. er zijn 3 verschillende manieren om de value te zetten
|
|
33
|
+
* - `hexValue` Gebruik de color-input met een hex-color, bijvooerbeeld`#ff8000` of `#fff`
|
|
34
|
+
* - `rgbValue` Gebruik de color-input met een RGB-color, van `[0, 0, 0]` t/m `[255, 255, 255]`
|
|
35
|
+
* - `hslValue` Gebruik de color-input met een HSL-color, van `[0, 0, 0]` t/m `[360, 100, 100]`
|
|
36
|
+
*
|
|
37
|
+
* @param onValueChanged deze bestaat niet. er zijn 3 verschillende manieren om de value te krijgen.
|
|
38
|
+
* - `onHexValueChanged` value-changed callback met de nieuwe waarde van de input in Hex-format.
|
|
39
|
+
* - `onRGBValueChanged` value-changed callback met de nieuwe waarde van de input in RGB-format.
|
|
40
|
+
* - `onHSLValueChanged` value-changed callback met de nieuwe waarde van de input in HSL-format.
|
|
41
|
+
* Daardoor zou je de colors ook naar elkaar kunnen omzetten. De functies daarvoor worden **ook** geexporteerd.
|
|
42
|
+
*@example
|
|
43
|
+
* // Gebruik de color-input met een hex-color, bijvooerbeeld`#ff8000` of `#fff`
|
|
44
|
+
* const [x, setX] = React.useState<HexColor>('#ff8000');
|
|
45
|
+
* <ColorInput hexValue={x} onHexValueChange={setX} {...props} />
|
|
46
|
+
* @example // Gebruik de color-input met een RGB-color, van `[0, 0, 0]` t/m `[255, 255, 255]`
|
|
47
|
+
* const [x, setX] = React.useState<RGBColor>([255, 128, 0]);
|
|
48
|
+
* <ColorInput rgbValue={x} onRGBValueChange={setX} {...props} />
|
|
49
|
+
* @example // Gebruik de color-input met een HSL-color, van `[0, 0, 0]` t/m `[360, 100, 100]`
|
|
50
|
+
* const [x, setX] = React.useState<HSLColor>([60, 100, 50]);
|
|
51
|
+
* <ColorInput hslValue={x} onHSLValueChange={setX} {...props} />
|
|
52
|
+
*
|
|
53
|
+
*/
|
|
54
|
+
declare function ColorInput({ hexValue, rgbValue, hslValue, icon, onHexValueChanged, onRGBValueChanged, onHSLValueChanged, ...props }: ColorInputProps): import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
export { ColorInput };
|
|
56
|
+
export type { ColorInputProps };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
type HiddenInputProps = {
|
|
2
|
+
/** Start value voor deze input (optioneel) */
|
|
3
|
+
value?: string;
|
|
4
|
+
/** Name input: gebruikt voor een <label> als er geen label gedefinieerd is & de name-attribuut <input> */
|
|
5
|
+
name: string;
|
|
6
|
+
/** ID voor de input: gebruikt voor een <label for="*id*}"> */
|
|
7
|
+
id: string;
|
|
8
|
+
/** Moet dit verborgen field worden ingevoerd */
|
|
9
|
+
required?: boolean;
|
|
10
|
+
/** (optional) Tooltip voor een hidden input ??? vooral voor test-doeleinden
|
|
11
|
+
* @deprecated use `title`
|
|
12
|
+
*/
|
|
13
|
+
tooltip?: string;
|
|
14
|
+
/** (optional) Tooltip voor een hidden input ??? vooral voor test-doeleinden */
|
|
15
|
+
title?: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Maak een input die verborgen is maar wel een waarde moet hebben.
|
|
19
|
+
* @param props
|
|
20
|
+
* @returns een hidden input
|
|
21
|
+
* @param name de naam voor de input (REQUIRED)
|
|
22
|
+
* @param id de id voor de input
|
|
23
|
+
* @param value de waarde
|
|
24
|
+
* @param required moet dit verborgen field worden ingevoerd
|
|
25
|
+
* @example <HiddenInput value={value} {...props} />
|
|
26
|
+
*/
|
|
27
|
+
declare function HiddenInput({ value, name, id, required, title, tooltip }: HiddenInputProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export { HiddenInput };
|
|
29
|
+
export type { HiddenInputProps };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StrictOmit } from './../../types';
|
|
2
|
+
import { InputPropsType, InputStylingPropsType } from '../Input';
|
|
3
|
+
type TelephoneInputProps = StrictOmit<InputPropsType<string>, 'type' | 'step' | 'pattern'> & InputStylingPropsType & {
|
|
4
|
+
pattern?: 'mobiel' | 'vast' | string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Een input voor een telefoonnummer. Deze input heeft een default `pattern` voor validatie op form-verzending. Deze kan worden overschreven. Ook wordt de autocomplete op `email` gezet.
|
|
8
|
+
* @example <TelephoneInput name="phonenr" value={phone} onValueChanged={setPhone} pattern='mobiel' />
|
|
9
|
+
* @param pattern het pattern voor validatie, (default = '')
|
|
10
|
+
* @param autoComplete de autocomplete type (password managers) (default = `tel`)
|
|
11
|
+
*/
|
|
12
|
+
declare function TelephoneInput({ value, icon, pattern, autoComplete, onValueChanged, ...props }: TelephoneInputProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export { TelephoneInput };
|
|
14
|
+
export type { TelephoneInputProps };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StrictOmit } from './../../types';
|
|
2
|
+
import { InputPropsType, InputStylingPropsType } from '../Input';
|
|
3
|
+
type URLInputProps = StrictOmit<InputPropsType<string>, 'type' | 'step' | 'pattern'> & InputStylingPropsType & {
|
|
4
|
+
pattern?: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Een input voor een URL. Deze input heeft een default `pattern` voor validatie op form-verzending. Deze kan worden overschreven. Ook wordt de autocomplete op `email` gezet.
|
|
8
|
+
* @example <URLInput name="url" value={url} onValueChanged={setUrl} />
|
|
9
|
+
* @param pattern het pattern voor validatie, (default = '')
|
|
10
|
+
* @param autoComplete de autocomplete type (password managers) (default = `url`)
|
|
11
|
+
*/
|
|
12
|
+
declare function URLInput({ value, icon, pattern, autoComplete, onValueChanged, ...props }: URLInputProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export { URLInput };
|
|
14
|
+
export type { URLInputProps };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { StrictOmit } from './../../types';
|
|
2
|
+
import { InputPropsType, InputStylingPropsType } from '../Input';
|
|
3
|
+
/** WeekInput: input voor een weeknummer (format: yyyy-MM)
|
|
4
|
+
* -1e getal: jaartal
|
|
5
|
+
* -2e getal: maandnummer (1-12), **met** voorloopnullen. *LET OP: NIET JavaScript Date 0-11!*
|
|
6
|
+
* @example
|
|
7
|
+
* `'2021-01'` // correct
|
|
8
|
+
* `'2021-1'` // incorrect ZONDER ERROR
|
|
9
|
+
* `'2021-001'` // incorrect ZONDER ERROR
|
|
10
|
+
* `'2021-M01'` // incorrect met error
|
|
11
|
+
*/
|
|
12
|
+
type MonthInputString = '' | `${number}-${number}`;
|
|
13
|
+
type MonthInputProps = StrictOmit<InputPropsType<string>, 'type' | 'step' | 'value' | 'onValueChanged' | 'min' | 'max'> & InputStylingPropsType & {
|
|
14
|
+
/** waarde van de month-input zetten met een string van format `yyyy-MM`.
|
|
15
|
+
*
|
|
16
|
+
* *LET OP: Niet JavaScript Date 0-11, maar gewoon 1-12*
|
|
17
|
+
* @example '2021-01'
|
|
18
|
+
*/
|
|
19
|
+
value?: MonthInputString;
|
|
20
|
+
/** minimaal toegestane waarde als MonthInputValue. MOET lager zijn dan `max`-prop */
|
|
21
|
+
min?: MonthInputString;
|
|
22
|
+
/** maximaal toegestane waarde als MonthInputValue. MOET hoger zijn dan `min`-prop */
|
|
23
|
+
max?: MonthInputString;
|
|
24
|
+
/** callback met het resultaat als string */
|
|
25
|
+
onValueChanged?(newVal: MonthInputString): void;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* MonthInput: input voor een maand in een jaar
|
|
29
|
+
*@param value De value bestaat uit 2 delen, gescheiden met een `-`-karakter
|
|
30
|
+
* - 1e getal: jaartal
|
|
31
|
+
* - 2e getal: maandnummer (01-12), **met** voorloopnullen. *LET OP: NIET JavaScript Date 0-11!*
|
|
32
|
+
* @example
|
|
33
|
+
* `'2021-01'` // correct
|
|
34
|
+
* `'2021-1'` // correct
|
|
35
|
+
* `'2021-001'` // incorrect
|
|
36
|
+
* `'2021-M01'` // incorrect
|
|
37
|
+
* @param min minimale waarde als MonthInputValue. MOET lager zijn dan `max`-prop
|
|
38
|
+
* @param max maximale waarde als MonthInputValue. MOET hoger zijn dan `min`-prop
|
|
39
|
+
* @example <MonthInput value="2021-06" min="2021-01" max="2021-12" />
|
|
40
|
+
*/
|
|
41
|
+
declare function MonthInput({ value, min, max, icon, onValueChanged, ...props }: MonthInputProps): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export { MonthInput };
|
|
43
|
+
export type { MonthInputProps, MonthInputString };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { StrictOmit } from './../../types';
|
|
2
|
+
import { InputPropsType, InputStylingPropsType } from '../Input';
|
|
3
|
+
/** WeekInput: input voor een weeknummer (format: yyyy-Www)
|
|
4
|
+
* -1e getal: jaartal
|
|
5
|
+
* -2e getal: weeknummer, **met** voorloopnullen, voorafgaan door een *'W'*
|
|
6
|
+
* @example
|
|
7
|
+
* `'2021-W01'` // correct
|
|
8
|
+
* `'2021-W1'` // incorrect ZONDER ERROR
|
|
9
|
+
* `'2021-W001'` // incorrect ZONDER ERROR
|
|
10
|
+
* `'2021-01'` // incorrect met error
|
|
11
|
+
* `'202101'` // incorrect met error
|
|
12
|
+
*/
|
|
13
|
+
type WeekInputString = '' | `${number}-W${number}`;
|
|
14
|
+
type WeekInputProps = StrictOmit<InputPropsType<string>, 'type' | 'step' | 'value' | 'onValueChanged' | 'min' | 'max'> & InputStylingPropsType & {
|
|
15
|
+
/** waarde van de weekinput zetten met een string van format `yyyy-Www`
|
|
16
|
+
* @example '2021-W01'
|
|
17
|
+
*/
|
|
18
|
+
value?: WeekInputString;
|
|
19
|
+
/** minimaal toegestane waarde als WeekInputValue. MOET lager zijn dan `max`-prop */
|
|
20
|
+
min?: WeekInputString;
|
|
21
|
+
/** maximaal toegestane waarde als WeekInputValue. MOET hoger zijn dan `min`-prop */
|
|
22
|
+
max?: WeekInputString;
|
|
23
|
+
/** callback met het resultaat als string */
|
|
24
|
+
onValueChanged?(newVal: WeekInputString): void;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* WeekInput: input voor een weeknummer in een jaar
|
|
28
|
+
* @param value De value bestaat uit 2 delen, gescheiden met een `-W`-string
|
|
29
|
+
* -1e getal: jaartal
|
|
30
|
+
* -2e getal: weeknummer, **met** voorloopnullen, voorafgaan door een *'W'*
|
|
31
|
+
* @example
|
|
32
|
+
* '2021-W01' // correct
|
|
33
|
+
* '2021-W1' // correct, geen voorloopnullen
|
|
34
|
+
* '2021-W001' // incorrect te veel voorloopnullen
|
|
35
|
+
* '2021-01' // incorrect, weeknummer heeft geen W-karakter
|
|
36
|
+
* '202101' // incorrect, geen `-W`-string
|
|
37
|
+
* @param min minimale waarde als WeekInputValue. MOET lager zijn dan `max`-prop
|
|
38
|
+
* @param max maximale waarde als WeekInputValue. MOET hoger zijn dan `min`-prop
|
|
39
|
+
* @example <WeekInput value="2021-W01" min="2021-W01" max="2021-W53" />
|
|
40
|
+
*/
|
|
41
|
+
declare function WeekInput({ value, min, max, icon, onValueChanged, ...props }: WeekInputProps): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export { WeekInput };
|
|
43
|
+
export type { WeekInputProps, WeekInputString };
|