loon-bulma-react 2023.1.0 → 2023.1.1
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/README.md +1 -0
- package/dist/index.d.ts +4348 -6
- package/dist/index.js +153 -15819
- package/package.json +12 -10
- package/dist/components/AspectRatio/AspectRatio.d.ts +0 -28
- package/dist/components/Box/Box.d.ts +0 -19
- package/dist/components/Button/Button.d.ts +0 -61
- package/dist/components/Button/ButtonProps.d.ts +0 -31
- package/dist/components/ButtonGroup/ButtonGroup.d.ts +0 -30
- package/dist/components/Calendar/CalendarItems/CalendarColoredItem.d.ts +0 -18
- package/dist/components/Calendar/CalendarItems/CalendarItem.d.ts +0 -18
- package/dist/components/Calendar/DayContainer.d.ts +0 -26
- package/dist/components/Calendar/Fourweeks/FourweeksView.d.ts +0 -23
- package/dist/components/Calendar/Fourweeks/MoreEvents.d.ts +0 -20
- package/dist/components/Calendar/Month/MonthView.d.ts +0 -23
- package/dist/components/Calendar/Month/MoreEvents.d.ts +0 -20
- package/dist/components/Calendar/Week/AlldayContainer.d.ts +0 -18
- package/dist/components/Calendar/Week/HourRow.d.ts +0 -27
- package/dist/components/Calendar/Week/WeekView.d.ts +0 -24
- package/dist/components/Calendar/base-styles.d.ts +0 -17
- package/dist/components/Calendar/index.d.ts +0 -10
- package/dist/components/Columns/Column.d.ts +0 -153
- package/dist/components/Columns/Columns.d.ts +0 -29
- package/dist/components/Container/Container.d.ts +0 -79
- package/dist/components/Content/Content.d.ts +0 -20
- package/dist/components/DataTable/DataTable.d.ts +0 -129
- package/dist/components/Footer/Footer.d.ts +0 -20
- package/dist/components/Hero/Hero.d.ts +0 -119
- package/dist/components/Icon/Icon.d.ts +0 -60
- package/dist/components/Image/Image.d.ts +0 -29
- package/dist/components/Indicator/Indicator.d.ts +0 -29
- package/dist/components/Kbd/Kbd.d.ts +0 -28
- package/dist/components/Link/Link.d.ts +0 -48
- package/dist/components/Menu/Menu.d.ts +0 -80
- package/dist/components/Message/Message.d.ts +0 -57
- package/dist/components/Modal/Modal.d.ts +0 -62
- package/dist/components/Notification/Notification.d.ts +0 -62
- package/dist/components/ProgressBar/ProgressBar.d.ts +0 -27
- package/dist/components/ScrollArea/ScrollArea.d.ts +0 -72
- package/dist/components/Section/Section.d.ts +0 -15
- package/dist/components/SimpleTable/SimpleTable.d.ts +0 -62
- package/dist/components/Steps/Steps.d.ts +0 -67
- package/dist/components/TabBar/TabBar.d.ts +0 -50
- package/dist/components/Tag/Tag.d.ts +0 -51
- package/dist/components/TimeLine/TimeLine.d.ts +0 -74
- package/dist/components/Titles/Titles.d.ts +0 -61
- package/dist/components/ToggleBar/ToggleBar.d.ts +0 -90
- package/dist/components/Tooltip/Tooltip.d.ts +0 -23
- package/dist/components/index.d.ts +0 -58
- package/dist/contexts/Confirm/ConfirmContextProvider.d.ts +0 -56
- package/dist/contexts/Notifier/Notifier.d.ts +0 -9
- package/dist/contexts/Notifier/NotifierProps.d.ts +0 -35
- package/dist/contexts/Notifier/NotifierProvider.d.ts +0 -35
- package/dist/contexts/index.d.ts +0 -4
- package/dist/forms/Checkbox/CB.d.ts +0 -46
- package/dist/forms/Checkbox/Checkbox.d.ts +0 -49
- package/dist/forms/Currency/CurrencyInput.d.ts +0 -50
- package/dist/forms/Datetimes/DateInput.d.ts +0 -44
- package/dist/forms/Datetimes/DateTimeInput.d.ts +0 -44
- package/dist/forms/Datetimes/TimeInput.d.ts +0 -47
- package/dist/forms/File/FileInput.d.ts +0 -63
- package/dist/forms/Form.d.ts +0 -186
- package/dist/forms/FormBuilder/FormBuilder.d.ts +0 -9
- package/dist/forms/FormBuilder/FormBuilderProps.d.ts +0 -96
- package/dist/forms/Input.d.ts +0 -94
- package/dist/forms/Numeric/MultiRangeInput.d.ts +0 -48
- package/dist/forms/Numeric/NumberInput.d.ts +0 -47
- package/dist/forms/Numeric/RangeInput.d.ts +0 -48
- package/dist/forms/Others/ColorInput.d.ts +0 -43
- package/dist/forms/Others/HiddenInput.d.ts +0 -29
- package/dist/forms/Radio/RB.d.ts +0 -51
- package/dist/forms/Radio/Radio.d.ts +0 -122
- package/dist/forms/Selects/BaseSelectProps.d.ts +0 -21
- package/dist/forms/Selects/MultiSelect.d.ts +0 -56
- package/dist/forms/Selects/Select.d.ts +0 -56
- package/dist/forms/Text/EmailInput.d.ts +0 -50
- package/dist/forms/Text/PasswordInput.d.ts +0 -50
- package/dist/forms/Text/TextArea.d.ts +0 -47
- package/dist/forms/Text/TextEditor.d.ts +0 -21
- package/dist/forms/Text/TextInput.d.ts +0 -62
- package/dist/forms/index.d.ts +0 -47
- package/dist/forms/shared/Base.Input.Container.d.ts +0 -14
- package/dist/forms/shared/BaseInputProps.d.ts +0 -111
- package/dist/forms/shared/InputError.d.ts +0 -12
- package/dist/forms/shared/InputIcons.d.ts +0 -13
- package/dist/forms/shared/index.d.ts +0 -4
- package/dist/hooks/index.d.ts +0 -9
- package/dist/hooks/useCaretPosition.d.ts +0 -10
- package/dist/hooks/useClipboard.d.ts +0 -21
- package/dist/hooks/useDebouncedValue.d.ts +0 -19
- package/dist/hooks/useEventListener.d.ts +0 -1
- package/dist/hooks/useHotkeys.d.ts +0 -43
- package/dist/hooks/useLocalStoredState.d.ts +0 -36
- package/dist/hooks/usePagination.d.ts +0 -25
- package/dist/hooks/useSessionStoredState.d.ts +0 -38
- package/dist/hooks/useToggle.d.ts +0 -16
- package/dist/hooks/useUncontrolled.d.ts +0 -45
- package/dist/hooks/useValidatedState.d.ts +0 -22
- package/dist/index.js.map +0 -1
- package/dist/index.modern.js +0 -15738
- package/dist/index.modern.js.map +0 -1
- package/dist/loon-react-bulma-types.d.ts +0 -65
- package/dist/utils/JSDateTime.class.d.ts +0 -504
- package/dist/utils/JSDuration.class.d.ts +0 -79
- package/dist/utils/calculateTxtColor.function.d.ts +0 -15
- package/dist/utils/deserialize.function.d.ts +0 -2
- package/dist/utils/hasBSN.function.d.ts +0 -15
- package/dist/utils/index.d.ts +0 -5
- package/dist/utils/isIBAN.function.d.ts +0 -25
- package/dist/utils/serialize.function.d.ts +0 -2
- package/dist/utils/warn-dev-util.d.ts +0 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,4348 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import React$1, { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
3
|
+
import { JSONContent } from '@tiptap/react';
|
|
4
|
+
|
|
5
|
+
/** Types waar de size van een component van belang is (default is meestal Medium (`'m'`))
|
|
6
|
+
* - De `<Tag>`-component gebruikt een speciale `TagSizeProp`. Er is voor tags geen `xl`-size
|
|
7
|
+
* - In bulma bestaat `'xl'` niet. Daarom is `'l'` in bulma `'medium'` en `'xl'` in in bulma `'large'`
|
|
8
|
+
*/
|
|
9
|
+
type SizeProp = 's' | 'm' | 'l' | 'xl';
|
|
10
|
+
/** Type waarbij je de alignment van (meestal de content) kan instellen: (l)eft, (c)enter, (r)ight.
|
|
11
|
+
* Default is meestal left (l)) */
|
|
12
|
+
type AlignmentProp = 'l' | 'c' | 'r';
|
|
13
|
+
/** Type voor de bulma-kleuren: (p)rimary, (i)nfo, (s)uccess, (d)anger, (w)arning, (l)ink.
|
|
14
|
+
* Als bulma niet alleen de default kleuren gebruikt, kan je ook andere kleuren uit bulma
|
|
15
|
+
* gebruiken met een string (structuur `is-${string}`) optie.
|
|
16
|
+
* TODO: Als microbundle de typescript-versie update: gebruik de template literal ipv een string
|
|
17
|
+
*/
|
|
18
|
+
type ColorProp = 'p' | 'i' | 's' | 'd' | 'w' | 'l' | string;
|
|
19
|
+
/** Type voor het instellen van de alignment van tekst: (l)eft, (c)enter, (r)ight. Default is meestal left (l))
|
|
20
|
+
*/
|
|
21
|
+
type TextAlignmentProp = 'l' | 'c' | 'r';
|
|
22
|
+
/** Positie voor items: (l)eft, (r)ight, (t)op, (b)ottom */
|
|
23
|
+
type PositionProp$1 = 'l' | 'r' | 't' | 'b';
|
|
24
|
+
/** Input modus voor virtuele toetsenborden (smartphones, tablets) */
|
|
25
|
+
type KeyboardTypeProp = 'numeric' | 'decimal' | 'tel' | 'search' | 'url' | 'email' | 'text';
|
|
26
|
+
/** Coordinaten - gebruikt voor ContextMenu */
|
|
27
|
+
type CoordinatesProp = {
|
|
28
|
+
x: number;
|
|
29
|
+
y: number;
|
|
30
|
+
z?: number;
|
|
31
|
+
};
|
|
32
|
+
/** Rectangle - gebruikt voor ContextMenu */
|
|
33
|
+
type RectProp = {
|
|
34
|
+
width: number;
|
|
35
|
+
height: number;
|
|
36
|
+
};
|
|
37
|
+
/** Tags gebruiken andere sizes dan de gewone sizes van de `SizeProp`. Er is geen `'xl'`-variant */
|
|
38
|
+
type TagSizeProp = 's' | 'm' | 'l';
|
|
39
|
+
/** Direction prop voor inputs */
|
|
40
|
+
type DirectionProp = 'h' | 'horizontal' | 'v' | 'vertical';
|
|
41
|
+
/** Link Relationship types */
|
|
42
|
+
type RelationshipProp = 'external' | 'help' | 'license' | 'next' | 'nofollow' | 'noreferrer' | 'prefetch' | 'prev' | 'search';
|
|
43
|
+
/** Check Radio styling types */
|
|
44
|
+
type CheckradioStylingType = 'rounded' | 'noborder' | 'colored' | 'blocky';
|
|
45
|
+
/** Indicator positie
|
|
46
|
+
* - `tl` = `top-left`
|
|
47
|
+
* - `tr` = `top-right`
|
|
48
|
+
* - `tc` = `top-center`
|
|
49
|
+
* - `bl` = `bottom-left`
|
|
50
|
+
* - `br` = `bottom-right`
|
|
51
|
+
* - `bc` = `bottom-center`
|
|
52
|
+
* - `lc` = `left-center`
|
|
53
|
+
* - `rc` = `right-center`
|
|
54
|
+
*/
|
|
55
|
+
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';
|
|
56
|
+
/** Autocomplete-types voor bijvoorbeeld password-managers.
|
|
57
|
+
* Programma's zoals bijvoorbeeld 1Password gebruiken deze om te bepalen waar dit veld mee gevuld moet worden.
|
|
58
|
+
* **LET OP:** `off` wordt door sommige browsers genegeerd (eikels). Gebruik `nope` als je *ECHT* geen autocomplete wil.
|
|
59
|
+
* */
|
|
60
|
+
type AutoCompleteType = 'on' | 'off' | 'nope' | 'current-password' | 'new-password' | 'username' | 'given-name' | 'additional-name' | 'family-name' | 'nickname' | 'email' | 'name' | 'one-time-code' | 'organization' | 'street-address' | 'tel' | 'bday' | 'language' | 'country' | 'postal-code';
|
|
61
|
+
/** Vaste (per jaar verschillende) kleuren die gebruikt worden binnen `loon-bulma-react` voor als we GEEN css kunnen gebruiken. */
|
|
62
|
+
declare const enum DefinedHexColors {
|
|
63
|
+
Primary = "#0089b6",
|
|
64
|
+
Info = "#3b59ec",
|
|
65
|
+
Link = "2f47bc",
|
|
66
|
+
Success = "#519c43",
|
|
67
|
+
Danger = "#d91000",
|
|
68
|
+
Warning = "#eea720"
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** Props voor een aspect-ratio */
|
|
72
|
+
type AspectRatioProps = {
|
|
73
|
+
/** De ratio (width x height) van het gewenste element */
|
|
74
|
+
ratio: '1by1' | '5by4' | '4by5' | '4by3' | '3by4' | '3by2' | '2by3' | '5by3' | '3by5' | '16by9' | '9by16' | '2by1' | '1by2' | '3by1' | '1by3';
|
|
75
|
+
/** Het item dat aan de aspect-ratio moet voldoen */
|
|
76
|
+
children: React$1.ReactNode;
|
|
77
|
+
/** ? */
|
|
78
|
+
caption?: {
|
|
79
|
+
placement: 'top' | 'bottom';
|
|
80
|
+
text: string;
|
|
81
|
+
};
|
|
82
|
+
/** Extra classes on aspect-ratio-element */
|
|
83
|
+
className?: string;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Gebruik een aspect-ratio voor een bepaald resizable element, waar een width en height bij hoort.
|
|
87
|
+
* Zoals bijvoorbeeld een iframe, img, etc
|
|
88
|
+
* @param props
|
|
89
|
+
* @returns een aspect-ratio'd element.
|
|
90
|
+
* @example
|
|
91
|
+
* <AspectRatio ratio="16by9" >
|
|
92
|
+
* <iframe src="https://www.youtube.com/embed/dQw4w9WgXcQ">
|
|
93
|
+
* </AspectRatio>
|
|
94
|
+
*/
|
|
95
|
+
declare function AspectRatio({ ratio, children, caption, className }: AspectRatioProps): JSX.Element;
|
|
96
|
+
|
|
97
|
+
type BoxProps = {
|
|
98
|
+
/** De children van de box */
|
|
99
|
+
children: React$1.ReactNode;
|
|
100
|
+
/** Andere classes om op de box toe te passen */
|
|
101
|
+
className?: string;
|
|
102
|
+
/** Style props direct op de box */
|
|
103
|
+
styles?: CSSProperties;
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Maak een witte box om andere elementen heen. Voor forms of modals. Heeft een beetje schaduw.
|
|
107
|
+
* @see {@link https://bulma.io/documentation/elements/box/}
|
|
108
|
+
* @param {{children: any, classes?: string|string[]}} props
|
|
109
|
+
* @returns een witte box om elementen.
|
|
110
|
+
* @example <Box>This is a box</Box>
|
|
111
|
+
*/
|
|
112
|
+
declare const Box: ({ children, className: classes, styles }: BoxProps) => JSX.Element;
|
|
113
|
+
|
|
114
|
+
type ColumnsProps = {
|
|
115
|
+
/** Children van de Columns. Moeten van het type @see Column zijn */
|
|
116
|
+
children: React$1.ReactNode;
|
|
117
|
+
/** De gap-grootte (stappen van .25rem), een margin tussen kolommen (default = 3, 0.75rem) */
|
|
118
|
+
gap?: '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | undefined;
|
|
119
|
+
/** Mogen de kolommen over meerdere rijen verdeeld worden */
|
|
120
|
+
multiline?: boolean;
|
|
121
|
+
/** Moeten de kolom centraal aligned worden */
|
|
122
|
+
centered?: boolean;
|
|
123
|
+
/** Extra classes voor dit element */
|
|
124
|
+
className?: string;
|
|
125
|
+
/** Set de styling direct */
|
|
126
|
+
styles?: CSSProperties;
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* Verdeel een pagina in kolommen, children zijn van het type {@link Column } voor het maken van de kolommen.
|
|
130
|
+
*
|
|
131
|
+
* Kijk op {@link https://bulma.io/documentation/columns/sizes/} voor de bulma-uitleg.
|
|
132
|
+
* @param {ColumnProps} props
|
|
133
|
+
* @returns Columns component which can be used to create a column layout.
|
|
134
|
+
* @example
|
|
135
|
+
* <Columns>
|
|
136
|
+
* <Column>This is a column</Column>
|
|
137
|
+
* <Column>This is a column</Column>
|
|
138
|
+
* <Column narrow>This is a narrow column</Column>
|
|
139
|
+
* </Columns>
|
|
140
|
+
*/
|
|
141
|
+
declare function Columns({ children, gap, multiline, centered, className: classes, styles }: ColumnsProps): JSX.Element;
|
|
142
|
+
|
|
143
|
+
type ColumnProps = {
|
|
144
|
+
/** De inhoud van de column */
|
|
145
|
+
children: React$1.ReactNode;
|
|
146
|
+
/** Extra classes op deze kolom */
|
|
147
|
+
className?: string;
|
|
148
|
+
/** Zet de styling direct */
|
|
149
|
+
styles?: CSSProperties;
|
|
150
|
+
};
|
|
151
|
+
type ExpandedColumnProps = ColumnProps & {
|
|
152
|
+
/** Is deze kolom zo smal mogelijk of vanaf welke schermmaat */
|
|
153
|
+
narrow?: boolean | 'mobile' | 'tablet' | 'touch' | 'desktop' | 'widescreen' | 'fullhd';
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* Standaard kolom voor gebruik in {@link Columns}.
|
|
157
|
+
* Als voor narrow een waarde is meegegeven, wordt de minimale ruimte voor deze kolom aangehouden: https://bulma.io/documentation/columns/sizes/
|
|
158
|
+
* @return Een kolom
|
|
159
|
+
* @example
|
|
160
|
+
* <Column>This is a column</Column>
|
|
161
|
+
* <Column narrow>This is a narrow column</Column>
|
|
162
|
+
*/
|
|
163
|
+
declare const Column: {
|
|
164
|
+
(props: ExpandedColumnProps): JSX.Element;
|
|
165
|
+
/** Column full width of parent
|
|
166
|
+
* @returns een kolom met de maximale breedte van de parent 'Columns'
|
|
167
|
+
* @example <Column.Full>This is a full column</Column.Full>
|
|
168
|
+
*/
|
|
169
|
+
Full(props: ColumnProps): JSX.Element;
|
|
170
|
+
/** Column 1/2 width of parent
|
|
171
|
+
* @returns een kolom met de halve breedte van de parent 'Columns'
|
|
172
|
+
* @example <Column.Half>This is a half column</Column.Half>
|
|
173
|
+
*/
|
|
174
|
+
Half(props: ColumnProps): JSX.Element;
|
|
175
|
+
/** Spread columns based on thirds (1/3, 2/3) */
|
|
176
|
+
Thirds: {
|
|
177
|
+
/** Column 1/3 width of parent
|
|
178
|
+
* @returns een kolom met 1/3 breedte van de parent 'Columns'
|
|
179
|
+
* @example <Column.Thirds.One>This is a first third column</Column.Thirds.One>
|
|
180
|
+
*/
|
|
181
|
+
One: (props: ColumnProps) => JSX.Element;
|
|
182
|
+
/** Column 2/3 width of parent
|
|
183
|
+
* @returns een kolom met 2/3 breedte van de parent 'Columns'
|
|
184
|
+
* @example <Column.Thirds.Two>This is a second third column</Column.Thirds.Two>
|
|
185
|
+
*/
|
|
186
|
+
Two: (props: ColumnProps) => JSX.Element;
|
|
187
|
+
};
|
|
188
|
+
/** Spread columns based on quarters (1/4, 2/4, 3/4) */
|
|
189
|
+
Quarters: {
|
|
190
|
+
/** Column 1/4 width of parent
|
|
191
|
+
* @returns een kolom met 1/4 breedte van de parent 'Columns'
|
|
192
|
+
* @example <Column.Quarters.One>This is a 1/4 column</Column.Quarters.One>
|
|
193
|
+
*/
|
|
194
|
+
One: (props: ColumnProps) => JSX.Element;
|
|
195
|
+
/** Column 2/4 width of parent
|
|
196
|
+
* @returns een kolom met 2/4 breedte van de parent 'Columns'
|
|
197
|
+
* @example <Column.Quarters.Two>This is a 2/4 column</Column.Quarters.Two>
|
|
198
|
+
*/
|
|
199
|
+
Two: (props: ColumnProps) => JSX.Element;
|
|
200
|
+
/** Column 3/4 width of parent
|
|
201
|
+
* @returns een kolom met 3/4 breedte van de parent 'Columns'
|
|
202
|
+
* @example <Column.Quarters.Three>This is a 3/4 column</Column.Quarters.Three>
|
|
203
|
+
*/
|
|
204
|
+
Three: (props: ColumnProps) => JSX.Element;
|
|
205
|
+
};
|
|
206
|
+
/** Spread columns based on fifths (1/5, 2/5, 3/5, 4/5) */
|
|
207
|
+
Fifths: {
|
|
208
|
+
/** Column 1/5 width of parent
|
|
209
|
+
* @returns een kolom met 1/5 breedte van de parent 'Columns'
|
|
210
|
+
* @example <Column.Fifths.One>This is a 1/5 column</Column.Fifths.One>
|
|
211
|
+
*/
|
|
212
|
+
One: (props: ColumnProps) => JSX.Element;
|
|
213
|
+
/** Column 2/5 width of parent
|
|
214
|
+
* @returns een kolom met 2/5 breedte van de parent 'Columns'
|
|
215
|
+
* @example <Column.Fifths.Two>This is a 2/5 column</Column.Fifths.Two>
|
|
216
|
+
*/
|
|
217
|
+
Two: (props: ColumnProps) => JSX.Element;
|
|
218
|
+
/** Column 3/5 width of parent
|
|
219
|
+
* @returns een kolom met 3/5 breedte van de parent 'Columns'
|
|
220
|
+
* @example <Column.Fifths.Three>This is a 3/5 column</Column.Fifths.Three>
|
|
221
|
+
*/
|
|
222
|
+
Three: (props: ColumnProps) => JSX.Element;
|
|
223
|
+
/** Column 4/5 width of parent
|
|
224
|
+
* @returns een kolom met 4/5 breedte van de parent 'Columns'
|
|
225
|
+
* @example <Column.Fifths.Four>This is a 4/5 column</Column.Fifths.Four>
|
|
226
|
+
*/
|
|
227
|
+
Four: (props: ColumnProps) => JSX.Element;
|
|
228
|
+
};
|
|
229
|
+
Twelves: {
|
|
230
|
+
/** Column 1/12 width of parent
|
|
231
|
+
* @returns een kolom met 1/12 breedte van de parent 'Columns'
|
|
232
|
+
* @example <Column.Twelves.One>This is a 1/12 column</Column.Twelves.One>
|
|
233
|
+
*/
|
|
234
|
+
One: (props: ColumnProps) => JSX.Element;
|
|
235
|
+
/** Column 2/12 width of parent
|
|
236
|
+
* @returns een kolom met 2/12 breedte van de parent 'Columns'
|
|
237
|
+
* @example <Column.Twelves.Two>This is a 2/12 column</Column.Twelves.Two>
|
|
238
|
+
*/
|
|
239
|
+
Two: (props: ColumnProps) => JSX.Element;
|
|
240
|
+
/** Column 3/12 width of parent
|
|
241
|
+
* @returns een kolom met 3/12 breedte van de parent 'Columns'
|
|
242
|
+
* @example <Column.Twelves.Three>This is a 3/12 column</Column.Twelves.Three>
|
|
243
|
+
*/
|
|
244
|
+
Three: (props: ColumnProps) => JSX.Element;
|
|
245
|
+
/** Column 4/12 width of parent
|
|
246
|
+
* @returns een kolom met 4/12 breedte van de parent 'Columns'
|
|
247
|
+
* @example <Column.Twelves.Four>This is a 4/12 column</Column.Twelves.Four>
|
|
248
|
+
*/
|
|
249
|
+
Four: (props: ColumnProps) => JSX.Element;
|
|
250
|
+
/** Column 5/12 width of parent
|
|
251
|
+
* @returns een kolom met 5/12 breedte van de parent 'Columns'
|
|
252
|
+
* @example <Column.Twelves.Five>This is a 5/12 column</Column.Twelves.Five>
|
|
253
|
+
*/
|
|
254
|
+
Five: (props: ColumnProps) => JSX.Element;
|
|
255
|
+
/** Column 6/12 width of parent
|
|
256
|
+
* @returns een kolom met 6/12 breedte van de parent 'Columns'
|
|
257
|
+
* @example <Column.Twelves.Six>This is a 6/12 column</Column.Twelves.Six>
|
|
258
|
+
*/
|
|
259
|
+
Six: (props: ColumnProps) => JSX.Element;
|
|
260
|
+
/** Column 7/12 width of parent
|
|
261
|
+
* @returns een kolom met 7/12 breedte van de parent 'Columns'
|
|
262
|
+
* @example <Column.Twelves.Seven>This is a 7/12 column</Column.Twelves.Seven>
|
|
263
|
+
*/
|
|
264
|
+
Seven: (props: ColumnProps) => JSX.Element;
|
|
265
|
+
/** Column 8/12 width of parent
|
|
266
|
+
* @returns een kolom met 8/12 breedte van de parent 'Columns'
|
|
267
|
+
* @example <Column.Twelves.Eight>This is a 8/12 column</Column.Twelves.Eight>
|
|
268
|
+
*/
|
|
269
|
+
Eight: (props: ColumnProps) => JSX.Element;
|
|
270
|
+
/** Column 9/12 width of parent
|
|
271
|
+
* @returns een kolom met 9/12 breedte van de parent 'Columns'
|
|
272
|
+
* @example <Column.Twelves.Nine>This is a 9/12 column</Column.Twelves.Nine>
|
|
273
|
+
*/
|
|
274
|
+
Nine: (props: ColumnProps) => JSX.Element;
|
|
275
|
+
/** Column 10/12 width of parent
|
|
276
|
+
* @returns een kolom met 10/12 breedte van de parent 'Columns'
|
|
277
|
+
* @example <Column.Twelves.Ten>This is a 10/12 column</Column.Twelves.Ten>
|
|
278
|
+
*/
|
|
279
|
+
Ten: (props: ColumnProps) => JSX.Element;
|
|
280
|
+
/** Column 11/12 width of parent
|
|
281
|
+
* @returns een kolom met 11/12 breedte van de parent 'Columns'
|
|
282
|
+
* @example <Column.Twelves.Eleven>This is a 11/12 column</Column.Twelves.Eleven>
|
|
283
|
+
*/
|
|
284
|
+
Eleven: (props: ColumnProps) => JSX.Element;
|
|
285
|
+
/** Column 12/12 width of parent
|
|
286
|
+
* @returns een kolom met 12/12 breedte van de parent 'Columns'
|
|
287
|
+
* @example <Column.Twelves.Twelve>This is a 12/12 column</Column.Twelves.Twelve>
|
|
288
|
+
*/
|
|
289
|
+
Twelve: (props: ColumnProps) => JSX.Element;
|
|
290
|
+
};
|
|
291
|
+
displayName: string;
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
type ContainerProps = {
|
|
295
|
+
/** Container content */
|
|
296
|
+
children: React$1.ReactNode;
|
|
297
|
+
/** Extra classes */
|
|
298
|
+
className?: string;
|
|
299
|
+
/** Set styling directly on container */
|
|
300
|
+
styles?: CSSProperties;
|
|
301
|
+
};
|
|
302
|
+
/**
|
|
303
|
+
* Een container om content horizontaal te centreren in grote viewports.
|
|
304
|
+
* @param props
|
|
305
|
+
* @return een default container
|
|
306
|
+
*
|
|
307
|
+
* @description De width van de container is afhankelijk van de maximale viewport width:
|
|
308
|
+
* | | Component | tot 1023px | tot 1216px | tot 1408px | groter |
|
|
309
|
+
* |----|----------------------|------------|------------|------------|-----------|
|
|
310
|
+
* | >> | `<Container>` | max-width | 960px | 1152px | 1344px |
|
|
311
|
+
* | | `<Container.Wide>` | max-width | max-width | 1152px | 1344px |
|
|
312
|
+
* | | `<Container.Widest>` | max-width | max-width | max-width | 1344px |
|
|
313
|
+
* | | `<Container.Max>` | max-width | max-width | max-width | max-width |
|
|
314
|
+
*
|
|
315
|
+
* @example <Container>This is a container</Container>
|
|
316
|
+
*/
|
|
317
|
+
declare const Container: {
|
|
318
|
+
({ className, children, styles }: ContainerProps): JSX.Element;
|
|
319
|
+
/**
|
|
320
|
+
* Een container om content horizontaal te centreren in grote viewports.
|
|
321
|
+
* @param props
|
|
322
|
+
* @returns een iets bredere container
|
|
323
|
+
*
|
|
324
|
+
* @description De width van de container is afhankelijk van de maximale viewport width:
|
|
325
|
+
* | | Component | tot 1023px | tot 1216px | tot 1408px | groter |
|
|
326
|
+
* |----|----------------------|------------|------------|------------|-----------|
|
|
327
|
+
* | | `<Container>` | max-width | 960px | 1152px | 1344px |
|
|
328
|
+
* | >> | `<Container.Wide>` | max-width | max-width | 1152px | 1344px |
|
|
329
|
+
* | | `<Container.Widest>` | max-width | max-width | max-width | 1344px |
|
|
330
|
+
* | | `<Container.Max>` | max-width | max-width | max-width | max-width |
|
|
331
|
+
*
|
|
332
|
+
* @example <Container.Wide>This is a somewhat wider container</Container.Wide>
|
|
333
|
+
*/
|
|
334
|
+
Wide({ className, children, styles }: ContainerProps): JSX.Element;
|
|
335
|
+
/**
|
|
336
|
+
* Een container om content horizontaal te centreren in grote viewports.
|
|
337
|
+
* @param props
|
|
338
|
+
* @returns een hele brede container
|
|
339
|
+
*
|
|
340
|
+
* @description De width van de container is afhankelijk van de maximale viewport width:
|
|
341
|
+
* | | Component | tot 1023px | tot 1216px | tot 1408px | groter |
|
|
342
|
+
* |----|----------------------|------------|------------|------------|-----------|
|
|
343
|
+
* | | `<Container>` | max-width | 960px | 1152px | 1344px |
|
|
344
|
+
* | | `<Container.Wide>` | max-width | max-width | 1152px | 1344px |
|
|
345
|
+
* | >> | `<Container.Widest>` | max-width | max-width | max-width | 1344px |
|
|
346
|
+
* | | `<Container.Max>` | max-width | max-width | max-width | max-width |
|
|
347
|
+
*
|
|
348
|
+
* @example <Container.Widest>This is a wide container</Container.Widest>
|
|
349
|
+
*/
|
|
350
|
+
Widest({ className, children, styles }: ContainerProps): JSX.Element;
|
|
351
|
+
/**
|
|
352
|
+
* Een container om content horizontaal te centreren in grote viewports.
|
|
353
|
+
* De width van de container is afhankelijk van de maximale viewport width.
|
|
354
|
+
* Aan de linker- en rechter-zijde wordt een margin van 32px behouden.
|
|
355
|
+
* @param props
|
|
356
|
+
* @returns een container die de gehele breedte van de viewport gebruikt.
|
|
357
|
+
*
|
|
358
|
+
* @description De width van de container is afhankelijk van de maximale viewport width:
|
|
359
|
+
* | | Component | tot 1023px | tot 1216px | tot 1408px | groter |
|
|
360
|
+
* |----|----------------------|------------|------------|------------|-----------|
|
|
361
|
+
* | | `<Container>` | max-width | 960px | 1152px | 1344px |
|
|
362
|
+
* | | `<Container.Wide>` | max-width | max-width | 1152px | 1344px |
|
|
363
|
+
* | | `<Container.Widest>` | max-width | max-width | max-width | 1344px |
|
|
364
|
+
* | >> | `<Container.Max>` | max-width | max-width | max-width | max-width |
|
|
365
|
+
*
|
|
366
|
+
* @example <Container.Max>This is an almost-fullwidth container </Container.Max>
|
|
367
|
+
*/
|
|
368
|
+
Max({ className, children, styles }: ContainerProps): JSX.Element;
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
type ContentPropsType = {
|
|
372
|
+
/** Size van de content (default = 'm') */
|
|
373
|
+
size?: SizeProp;
|
|
374
|
+
/** Content voor het content-element */
|
|
375
|
+
children: React$1.ReactNode;
|
|
376
|
+
/** Extra classes */
|
|
377
|
+
className?: string;
|
|
378
|
+
/** Extra inline styles */
|
|
379
|
+
styles?: CSSProperties;
|
|
380
|
+
};
|
|
381
|
+
/**
|
|
382
|
+
* Een Content component voor generated content. De meeste html tags kunnen hier worden gebruikt.
|
|
383
|
+
* @param props size: de tekstgrootte, children: de content van de content
|
|
384
|
+
* @returns een div geschikt voor content. WYSIWYG ofzo.
|
|
385
|
+
* @example <Content>This is a content which can contain lists, <strong>strong</strong> and <em>italic</em> tags</Content>
|
|
386
|
+
*/
|
|
387
|
+
declare function Content({ size, className, styles, children }: ContentPropsType): JSX.Element;
|
|
388
|
+
|
|
389
|
+
type FooterProps = {
|
|
390
|
+
/** De content voor de footer */
|
|
391
|
+
children: React$1.ReactNode;
|
|
392
|
+
/** Alignment bij de footer. (default = 'c') */
|
|
393
|
+
alignment?: AlignmentProp;
|
|
394
|
+
/** Extra classes voor op de footer */
|
|
395
|
+
className?: string;
|
|
396
|
+
/** Custom styles voor de footer */
|
|
397
|
+
styles?: React$1.CSSProperties;
|
|
398
|
+
};
|
|
399
|
+
/**
|
|
400
|
+
* Maak een footer voor onderaan de pagina.
|
|
401
|
+
* - de footer bevat een container waarvan de text default 'centered' is.
|
|
402
|
+
* @param props
|
|
403
|
+
* @returns een footer met daarin de content.
|
|
404
|
+
* @example <Footer>This is a footer</Footer>
|
|
405
|
+
*/
|
|
406
|
+
declare function Footer({ children, alignment, className, styles }: FooterProps): JSX.Element;
|
|
407
|
+
|
|
408
|
+
type HeroProps = {
|
|
409
|
+
children?: React$1.ReactNode;
|
|
410
|
+
/** Type hero */
|
|
411
|
+
heroColorFor?: 'werknemer' | 'werkgever' | 'klant' | 'admin' | 'primary' | undefined;
|
|
412
|
+
/** De grootte van de hero (default = small ('s')) */
|
|
413
|
+
size?: SizeProp | undefined;
|
|
414
|
+
};
|
|
415
|
+
/**
|
|
416
|
+
* Maak een schermbrede hero aan. Optionele top-buttons en/of tabs voor navigatie
|
|
417
|
+
* @param props
|
|
418
|
+
* @returns een Hero
|
|
419
|
+
* @example
|
|
420
|
+
*/
|
|
421
|
+
declare const Hero: {
|
|
422
|
+
(props: HeroProps): JSX.Element;
|
|
423
|
+
/** Top-bar van de hero met
|
|
424
|
+
* - een BurgerMenu voor de navigatie-items
|
|
425
|
+
* - items aan de rechterkant van het scherm
|
|
426
|
+
* @param props props
|
|
427
|
+
* @returns een HeroHead met daarin optionele links of buttons
|
|
428
|
+
* @example
|
|
429
|
+
* <Hero.Head>
|
|
430
|
+
* <Hero.Head.Button onClick={handleClickNotify}>Notify</Hero.Head.Button>
|
|
431
|
+
* <Hero.Head.Button onClick={handleClickClear}>Clear</Hero.Head.Button>
|
|
432
|
+
* <Hero.Head.Link to="https://www.bulma.io">Bulma</Hero.Head.Link>
|
|
433
|
+
* <Hero.Head.Link to="https://www.nodeJS.org">NodeJS</Hero.Head.Link>
|
|
434
|
+
* </Hero.Head>
|
|
435
|
+
*/
|
|
436
|
+
Head: {
|
|
437
|
+
(props: {
|
|
438
|
+
children: React$1.ReactNode;
|
|
439
|
+
}): JSX.Element;
|
|
440
|
+
/** Een button in de hero head
|
|
441
|
+
* @param props props
|
|
442
|
+
* @returns een button in de hero head
|
|
443
|
+
* @example <Hero.Head.Button onClick={handleClick}>Button</Hero.Head.Button>
|
|
444
|
+
*/
|
|
445
|
+
Button(props: {
|
|
446
|
+
children: React$1.ReactNode;
|
|
447
|
+
tooltip?: string | undefined;
|
|
448
|
+
onClick?: ((e: any) => void) | undefined;
|
|
449
|
+
}): JSX.Element;
|
|
450
|
+
/** Een link in de hero head
|
|
451
|
+
* @param props props
|
|
452
|
+
* @returns een link in de hero head
|
|
453
|
+
* @example <Hero.Head.Link to="https://www.loon.be" tooltip="Loon.be">Loon.be</Hero.Head.Link>
|
|
454
|
+
*/
|
|
455
|
+
Link(props: {
|
|
456
|
+
children: React$1.ReactNode;
|
|
457
|
+
tooltip?: string;
|
|
458
|
+
to?: string;
|
|
459
|
+
target?: '_blank' | '_self' | '_parent' | '_top';
|
|
460
|
+
rel?: 'alternat' | 'author' | 'bookmark' | 'external' | 'help' | 'license' | 'next' | 'nofollow' | 'noreferrer' | 'noopener' | 'prev' | 'search' | 'tag';
|
|
461
|
+
}): JSX.Element;
|
|
462
|
+
};
|
|
463
|
+
/**
|
|
464
|
+
* Body of the hero, which could contain a title and/or subtitle
|
|
465
|
+
* @param props props
|
|
466
|
+
* @returns hero body with content
|
|
467
|
+
* @example
|
|
468
|
+
* <Hero.Body>
|
|
469
|
+
* <Title>Title</Title>
|
|
470
|
+
* <Subtitle>Subtitle</Subtitle>
|
|
471
|
+
* </Hero.Body>
|
|
472
|
+
*/
|
|
473
|
+
Body(props: {
|
|
474
|
+
children: React$1.ReactNode;
|
|
475
|
+
}): JSX.Element;
|
|
476
|
+
/**
|
|
477
|
+
* Hero foot with navigation
|
|
478
|
+
* @param props props
|
|
479
|
+
* @returns hero foot with navigation
|
|
480
|
+
* @example
|
|
481
|
+
* <Hero.Foot>
|
|
482
|
+
* <ul>
|
|
483
|
+
* <li className="is-active"><a href="">Active Navigation Link </a></li>
|
|
484
|
+
* <li><a href="">Another Navigation Link</a></li>
|
|
485
|
+
* </ul>
|
|
486
|
+
* </Hero.Foot>
|
|
487
|
+
|
|
488
|
+
* <Hero.NavList>
|
|
489
|
+
* <Hero.NavItem to="/">Navigation Link</Hero.NavItem>
|
|
490
|
+
* </Hero.NavList>
|
|
491
|
+
*/
|
|
492
|
+
Foot: {
|
|
493
|
+
(props: {
|
|
494
|
+
children: React$1.ReactNode;
|
|
495
|
+
}): JSX.Element;
|
|
496
|
+
/** Navigation ItemList voor In een Hero Foot. Parent should be <Hero.Foot> and children should be <Hero.Foot.NavItem>
|
|
497
|
+
* @param props props
|
|
498
|
+
* @returns Navigation Item List for Hero's
|
|
499
|
+
* @example
|
|
500
|
+
* <Hero.Foot.NavList>
|
|
501
|
+
* <Hero.Foot.NavItem to="/">URL </Hero.Foot.NavItem>
|
|
502
|
+
* <Hero.Foot.NavItem to="/">URL </Hero.Foot.NavItem>
|
|
503
|
+
* </Hero.Foot.NavList>
|
|
504
|
+
*/
|
|
505
|
+
NavList(props: {
|
|
506
|
+
children: React$1.ReactNode;
|
|
507
|
+
}): JSX.Element;
|
|
508
|
+
/** Navigation Item voor in een Hero Foot. Parent should be <Hero.Foot.NavList>
|
|
509
|
+
* @param props props
|
|
510
|
+
* @returns Navigation Item for Hero's
|
|
511
|
+
* @example <Hero.Foot.NavItem to="/">URL</Hero.Foot.NavItem>
|
|
512
|
+
*/
|
|
513
|
+
NavItem(props: {
|
|
514
|
+
children: React$1.ReactNode;
|
|
515
|
+
to: string;
|
|
516
|
+
active?: boolean;
|
|
517
|
+
target?: '_blank' | '_self' | '_parent' | '_top';
|
|
518
|
+
tooltip?: string;
|
|
519
|
+
rel?: 'alternat' | 'author' | 'bookmark' | 'external' | 'help' | 'license' | 'next' | 'nofollow' | 'noreferrer' | 'noopener' | 'prev' | 'search' | 'tag';
|
|
520
|
+
}): JSX.Element;
|
|
521
|
+
};
|
|
522
|
+
};
|
|
523
|
+
|
|
524
|
+
type ImageProps = {
|
|
525
|
+
/** De ratio (width x height) van de afbeelding */
|
|
526
|
+
ratio: '1by1' | '5by4' | '4by5' | '4by3' | '3by4' | '3by2' | '2by3' | '5by3' | '3by5' | '16by9' | '9by16' | '2by1' | '1by2' | '3by1' | '1by3' | 'square';
|
|
527
|
+
/** Geef een gewenste width op in geval van een ratio. Als er geen waarde is, wordt de parent gevuld
|
|
528
|
+
* voor ratio='square' MOETEN de string literal waarden worden gebruikt */
|
|
529
|
+
imgWidth?: '16' | '24' | '32' | '48' | '64' | '96' | '128' | string;
|
|
530
|
+
/** Wordt de afbeelding rond ? LET OP: Alleen voor ratio == 'square'! */
|
|
531
|
+
isRounded?: boolean;
|
|
532
|
+
/** `src`-Attribuut van image tag */
|
|
533
|
+
src: string;
|
|
534
|
+
/** `alt`-Attribuut van image tag */
|
|
535
|
+
alt: string;
|
|
536
|
+
/** Een optionele figcaption */
|
|
537
|
+
figCaption?: string;
|
|
538
|
+
/** extra classNames voor de omringende div */
|
|
539
|
+
className?: string;
|
|
540
|
+
};
|
|
541
|
+
/**
|
|
542
|
+
* Een afbeelding met een vastgestelde aspect ratio.
|
|
543
|
+
* Voor de ratio 'square' kan er een size worden opgegeven.
|
|
544
|
+
* De andere ratio's nemen de gehele width van de parent-container in.
|
|
545
|
+
* @param props
|
|
546
|
+
* @returns an image with a fixed aspect ratio
|
|
547
|
+
* @example <Image ratio="1by1" src="https://www.loon.be/images/logo.png" alt="Loon.be" />
|
|
548
|
+
*/
|
|
549
|
+
declare function Image({ ratio, imgWidth, alt, figCaption, className, isRounded, src }: ImageProps): JSX.Element;
|
|
550
|
+
|
|
551
|
+
type SectionPropsType = {
|
|
552
|
+
children: React$1.ReactNode;
|
|
553
|
+
className?: string;
|
|
554
|
+
styles?: CSSProperties;
|
|
555
|
+
};
|
|
556
|
+
/**
|
|
557
|
+
* Maak een simpele container m een pagina te verdelen in secties.
|
|
558
|
+
* Een section heeft een responsive padding.
|
|
559
|
+
* @param props alleen de children van de section
|
|
560
|
+
* @returns een sectie voor op de pagina, met ruimte eromheen
|
|
561
|
+
* @example <Section>This is a section</Section>
|
|
562
|
+
*/
|
|
563
|
+
declare function Section({ children, className: classes, styles }: SectionPropsType): JSX.Element;
|
|
564
|
+
|
|
565
|
+
/**
|
|
566
|
+
* Maak een ScrollArea om in een bepaalde richting te kunnen scrollen. De scrollareas maken gebruik van flexbox.
|
|
567
|
+
*/
|
|
568
|
+
declare const ScrollArea: {
|
|
569
|
+
/** Maak een horizontale flexbox container om items naast elkaar (default: van links naar rechts) neer te zetten, met of zonder wrappen
|
|
570
|
+
* @param props
|
|
571
|
+
* @returns ScrollArea in horizontale richting
|
|
572
|
+
* @example <ScrollArea.Horizontal>...</ScrollArea.Horizontal>
|
|
573
|
+
*/
|
|
574
|
+
Horizontal: (props: {
|
|
575
|
+
/** Wat moet er in de flexbox container komen */
|
|
576
|
+
children: React$1.ReactNode;
|
|
577
|
+
/** Moeten de items gewrapped worden (meerdere rijen/kolommen) (default = false) */
|
|
578
|
+
wrap?: boolean;
|
|
579
|
+
/** Moeten de items van eind tot begin of begin tot eind komen? (default = false) */
|
|
580
|
+
reverse?: boolean;
|
|
581
|
+
/** De ruimte tussen items (default = 0px):
|
|
582
|
+
* - `number`: aantal px
|
|
583
|
+
* - `string`: '16px', '1em', '1rem', etc
|
|
584
|
+
* Kan voor kolom/rij anders worden aangegeven
|
|
585
|
+
*/
|
|
586
|
+
gap?: number | string | {
|
|
587
|
+
/** Gap voor row */
|
|
588
|
+
row: number | string;
|
|
589
|
+
/** Gap voor column */
|
|
590
|
+
col: number | string;
|
|
591
|
+
};
|
|
592
|
+
/** Alignment van de items (default = 'l') */
|
|
593
|
+
alignment?: AlignmentProp;
|
|
594
|
+
/** Max width van een item in de horizontal scroll area
|
|
595
|
+
* - `number`: aantal px
|
|
596
|
+
* - `string`: '160x', '10em', etc.
|
|
597
|
+
*/
|
|
598
|
+
maxItemWidth?: number | string;
|
|
599
|
+
/** Max width van een item in de horizontal scroll area
|
|
600
|
+
* - `number`: aantal px
|
|
601
|
+
* - `string`: '160x', '10em', etc.
|
|
602
|
+
*/
|
|
603
|
+
minItemWidth?: number | string;
|
|
604
|
+
}) => JSX.Element;
|
|
605
|
+
/** Maak een verticale flexbox container om items onder elkaar (default van boven naar beneden) neer te zetten, met of zonder wrappen
|
|
606
|
+
* @param props
|
|
607
|
+
* @returns ScrollArea in verticale richting
|
|
608
|
+
* @example <ScrollArea.Vertical>...</ScrollArea.Vertical>
|
|
609
|
+
*/
|
|
610
|
+
Vertical: (props: {
|
|
611
|
+
/** Wat moet er in de flexbox container komen */
|
|
612
|
+
children: React$1.ReactNode;
|
|
613
|
+
/** Moeten de items gewrapped worden (meerdere rijen/kolommen) (default = false) */
|
|
614
|
+
wrap?: boolean;
|
|
615
|
+
/** Moeten de items van eind tot begin of begin tot eind komen? (default = false) */
|
|
616
|
+
reverse?: boolean;
|
|
617
|
+
/** De ruimte tussen items (default = 0px):
|
|
618
|
+
* - `number`: aantal px
|
|
619
|
+
* - `string`: '16px', '1em', '1rem', etc
|
|
620
|
+
* Kan voor kolom/rij anders worden aangegeven
|
|
621
|
+
*/
|
|
622
|
+
gap?: number | string | {
|
|
623
|
+
/** Gap voor row */
|
|
624
|
+
row: number | string;
|
|
625
|
+
/** Gap voor column */
|
|
626
|
+
col: number | string;
|
|
627
|
+
};
|
|
628
|
+
/** Alignment van de items (default = 'l') */
|
|
629
|
+
alignment?: AlignmentProp;
|
|
630
|
+
/** Alleen voor verticale flexboxen: een met een maximale hoogte waarna de container gaat scrollen */
|
|
631
|
+
maxHeight?: number | string;
|
|
632
|
+
}) => JSX.Element;
|
|
633
|
+
};
|
|
634
|
+
|
|
635
|
+
/** De props voor de DataTable Component zelf. */
|
|
636
|
+
type DataTableProps<T extends unknown> = {
|
|
637
|
+
/** Titels voor de kolommen als die afwijken van de object-properties */
|
|
638
|
+
columns: DataTableColumn<T>[];
|
|
639
|
+
/** Header-name van de default-sorteer-kolom (default: 1e kolom die 'sortable' is) */
|
|
640
|
+
defaultSortCol?: string;
|
|
641
|
+
/** (optionele) Content voor de header. Verschijnt links van de search-bar */
|
|
642
|
+
headerContent?: React$1.ReactNode;
|
|
643
|
+
/** De array met daarin de data voor de datatabel */
|
|
644
|
+
data: T[];
|
|
645
|
+
/** Welke data-object-property is uniek? Anders wordt de index gebruikt (liever niet, react-performance-reasons)
|
|
646
|
+
* - als string: de property die uniek is: obj.<string>
|
|
647
|
+
* - als function: stel een string samen die uniek is.
|
|
648
|
+
*/
|
|
649
|
+
rowIdentifier?: string | ((item: T) => string);
|
|
650
|
+
/** Een functie om de classes op een row te zetten, op basis van het object */
|
|
651
|
+
rowClasses?: (item: T, index?: number) => string;
|
|
652
|
+
/** Moet de tabel zichzelf wat kleiner maken ? */
|
|
653
|
+
narrow?: boolean;
|
|
654
|
+
/** Is de tabel gestreept? (om-en-om wit/grijze rijen) */
|
|
655
|
+
striped?: boolean;
|
|
656
|
+
/** Is de tabel fullwidth ? (default true) */
|
|
657
|
+
fullwidth?: boolean;
|
|
658
|
+
/** Is de tabel bordered? */
|
|
659
|
+
bordered?: boolean;
|
|
660
|
+
/** Is de tabel hoverbaar (verkleuring rij waar de muis op hangt) */
|
|
661
|
+
hoverable?: boolean;
|
|
662
|
+
/** Wat is het maximaal aantal rijen dat zichtbaar is zonder paginatie? Als 0 is er geen maximum aantal rijen (default 0) */
|
|
663
|
+
maxRows?: number;
|
|
664
|
+
/** Placeholder voor zoekveld. Als er geen placeholder is (undefined or emptystring), is er geen zoek-veld */
|
|
665
|
+
searchPlaceholder?: string;
|
|
666
|
+
/**
|
|
667
|
+
* (Optionele) Eigen zoek-functie. De default-zoek-functie wordt dan vervangen.
|
|
668
|
+
* @param searchTerm de content van het zoekveld
|
|
669
|
+
* @param items de items waarbinnen gezocht moet worden
|
|
670
|
+
* @returns een array met de gefilterde items
|
|
671
|
+
*/
|
|
672
|
+
onSearch?: (searchTerm: string, items: T[]) => T[];
|
|
673
|
+
/** Terugkoppeling voor een geselecteerde rij.
|
|
674
|
+
* @param item: Het geselecteerde item
|
|
675
|
+
* @param row: de tabel-rij waarop geklikt is (<tr> tag). Om de row 'selected' te laten lijken: toggle de 'is-selected' class
|
|
676
|
+
*/
|
|
677
|
+
onRowSelected?(item: T, row: HTMLTableRowElement): void;
|
|
678
|
+
/**
|
|
679
|
+
* Als er geen rijen zijn om te renderen, wordt de ReactNode van deze functie gerendered. Er wordt dan geen lege tabel gerendered, maar een boodschap
|
|
680
|
+
* @param isSearchResult is de no-rows het resultaat van een zoek-actie?
|
|
681
|
+
* @example (isSearch:boolean) => isSearch ? <div>Er zijn geen rijen die voldoen aan uw zoek-opdracht</div> : <div>U heeft geen of een lege data-array opgegeven</div>
|
|
682
|
+
*/
|
|
683
|
+
onNoRowsToRender?(isSearchResult: boolean): React$1.ReactNode;
|
|
684
|
+
};
|
|
685
|
+
/** Props voor het samenstellen van de kolommen van de tabel */
|
|
686
|
+
type DataTableColumn<T extends unknown> = {
|
|
687
|
+
/** Naam voor de kolom, als die anders is dan de key-value */
|
|
688
|
+
header?: string;
|
|
689
|
+
/** Sorteren op deze kolom mogelijk? zo ja:
|
|
690
|
+
* - `string`: sorteer alfabetisch
|
|
691
|
+
* - `number`: sorteer numeriek
|
|
692
|
+
* - `boolean`: sorteer op true/false
|
|
693
|
+
* - `function`: een eigen sorteermechanisme
|
|
694
|
+
*/
|
|
695
|
+
sort?: true | false | ((a: T, B: T) => -1 | 0 | 1 | number);
|
|
696
|
+
/** Wat is de object property die bij deze kolom hoort als je wil sorteren
|
|
697
|
+
* - `string`: de object-property-key --> obj['colValue']
|
|
698
|
+
* - `function`: samenstellen van de waarde.
|
|
699
|
+
*/
|
|
700
|
+
value: string | JSX.Element | ((e: T) => string | JSX.Element);
|
|
701
|
+
/** Moet de kolom-content link, rechts of centraal aligned worden (default = 'l') */
|
|
702
|
+
alignment?: AlignmentProp;
|
|
703
|
+
/** Een functie om een class per cell toe te voegen */
|
|
704
|
+
columnClasses?: (item: T, index?: number) => string;
|
|
705
|
+
};
|
|
706
|
+
/**
|
|
707
|
+
* Maak een datatable voor grote hoeveelheden data. Voor kleinere hoeveelheden: gebruik @see{@link Table}.
|
|
708
|
+
* Een DataTable heeft pagination, zoekfunctie en sortering ingebouwd.
|
|
709
|
+
* @param props
|
|
710
|
+
* @returns een datatable.
|
|
711
|
+
* @example
|
|
712
|
+
* const nameSortFn = (a: IUser, b: IUser) => {
|
|
713
|
+
* const aNaam = a.first_name + ' ' + a.last_name;
|
|
714
|
+
* const bNaam = b.first_name + ' ' + b.last_name;
|
|
715
|
+
* return (aNaam < bNaam) ? -1 : 1;
|
|
716
|
+
* };
|
|
717
|
+
*
|
|
718
|
+
* const columns = [
|
|
719
|
+
* { sort: true, value: 'id' },
|
|
720
|
+
* { header: 'Naam', sort: nameSortFn, value: (v: IUser) => `${v.first_name} ${v.last_name}`, },
|
|
721
|
+
* { header: 'Voornaam', sort: false, value: 'first_name' },
|
|
722
|
+
* { header: 'Achternaam', sort: true value: 'last_name' },
|
|
723
|
+
*
|
|
724
|
+
* ];
|
|
725
|
+
*
|
|
726
|
+
* const [data, setData] = useState(tableData);
|
|
727
|
+
* const handleRowClick = (item: IPersoon, rowEl: HTMLTableRowElement) => {
|
|
728
|
+
* console.log(item, rowEl);
|
|
729
|
+
* rowEl.classList.toggle('is-selected');
|
|
730
|
+
* };
|
|
731
|
+
* return (
|
|
732
|
+
* <DataTable<IUser>
|
|
733
|
+
* data={data}
|
|
734
|
+
* columns={columns}
|
|
735
|
+
* onSearch={(term: string, users: IUser[]) => users.filter((u) => u.language.startsWith(term))}
|
|
736
|
+
* onRowSelected={(i, r) => handleRowClick(i, r)}
|
|
737
|
+
* defaultSortCol="Naam"
|
|
738
|
+
* rowClasses={(item: IUser) => (item.first_name.startsWith('C') ? 'is-dangerous' : '')}
|
|
739
|
+
* searchPlaceholder="Zoek een persoon ..."
|
|
740
|
+
* rowIdentifier="id"
|
|
741
|
+
* striped={true}
|
|
742
|
+
* hoverable={true}
|
|
743
|
+
* narrow={false}
|
|
744
|
+
* maxRows={20}
|
|
745
|
+
* bordered={false}
|
|
746
|
+
* onNoRowsToRender={(isSearch:boolean) => isSearch ?
|
|
747
|
+
* <div>Er zijn geen rijen die voldoen aan uw zoek-opdracht</div> :
|
|
748
|
+
* <div>U heeft geen of een lege data-array opgegeven</div>
|
|
749
|
+
* }
|
|
750
|
+
* headerContent={
|
|
751
|
+
* <Button.Primary>Add</Button.Primary>
|
|
752
|
+
* <Button.Warning>Change</Button.Warning>
|
|
753
|
+
* <Button.Success>Refresh</Button.Success>
|
|
754
|
+
* }
|
|
755
|
+
* />
|
|
756
|
+
* );
|
|
757
|
+
*
|
|
758
|
+
*/
|
|
759
|
+
declare function DataTable<T extends unknown>({ fullwidth, bordered, narrow, striped, hoverable, defaultSortCol, data, maxRows, columns, rowIdentifier, headerContent, searchPlaceholder, onSearch, rowClasses, onRowSelected, onNoRowsToRender, }: DataTableProps<T>): JSX.Element;
|
|
760
|
+
|
|
761
|
+
type IconProps = {
|
|
762
|
+
/** React font-awesome icon
|
|
763
|
+
* - `string`: geef de gehele font-awesome-class op. 'flip', 'animate', 'rotation' worden dan al gebruikt in deze class.
|
|
764
|
+
* - `IconProp (fontawesome)`: geef een react IconProp object door.
|
|
765
|
+
*/
|
|
766
|
+
icon: string | IconProp;
|
|
767
|
+
/** De icon-grootte */
|
|
768
|
+
size?: SizeProp;
|
|
769
|
+
/** De kleur voor het icoon */
|
|
770
|
+
color?: ColorProp;
|
|
771
|
+
/** Hoeveel graden moet het icoon gedraait zijn (0 - 360) */
|
|
772
|
+
rotation?: 90 | 180 | 270;
|
|
773
|
+
/** Horizontaal, verticaal of beiden gespiegeld */
|
|
774
|
+
flip?: 'horizontal' | 'vertical' | 'both';
|
|
775
|
+
/** Moet het icon spinnen of pulseren */
|
|
776
|
+
animate?: 'spin' | 'pulse';
|
|
777
|
+
};
|
|
778
|
+
/**
|
|
779
|
+
* Toon een Font Awesome Icon
|
|
780
|
+
* default: 1.5rem x 1.5rem, de font-size is inherited.
|
|
781
|
+
* @returns een Icon element
|
|
782
|
+
* @example
|
|
783
|
+
* <Icon icon="fas fa-flag" />
|
|
784
|
+
* <Icon icon={faFlag} /> // import { faFlag } from '@fortawesome/free-solid-svg-icons';
|
|
785
|
+
*/
|
|
786
|
+
declare const Icon: ({ color, size, rotation, icon, flip, animate }: IconProps) => JSX.Element;
|
|
787
|
+
type IconTextProps = {
|
|
788
|
+
/** React font-awesome icon
|
|
789
|
+
* - `string`: geef de gehele font-awesome-class op. 'flip', 'animate', 'rotation' worden dan al gebruikt in deze class.
|
|
790
|
+
* - `IconProp (fontawesome)`: geef een react IconProp object door.
|
|
791
|
+
*/
|
|
792
|
+
icon: string | IconProp;
|
|
793
|
+
/** De icon-grootte */
|
|
794
|
+
size?: SizeProp;
|
|
795
|
+
/** De kleur voor het icoon */
|
|
796
|
+
color?: ColorProp;
|
|
797
|
+
/** Hoeveel graden moet het icoon gedraait zijn (0 - 360) */
|
|
798
|
+
rotation?: 90 | 180 | 270;
|
|
799
|
+
/** Horizontaal, verticaal of beiden geflipt */
|
|
800
|
+
flip?: 'horizontal' | 'vertical' | 'both';
|
|
801
|
+
/** Moet het icon spinnen of pulseren */
|
|
802
|
+
animate?: 'spin' | 'pulse';
|
|
803
|
+
/** Tekst bij het icon */
|
|
804
|
+
children: React$1.ReactNode;
|
|
805
|
+
};
|
|
806
|
+
/**
|
|
807
|
+
* Toon een Font Awesome Icon met bijhorende tekst. De tekst krijgt dezeflde kleur als de icon
|
|
808
|
+
* IconText is een inline-flex element dus kan in een paragraaf worden gebruikt.
|
|
809
|
+
* default: 1.5rem x 1.5rem, de font-size is inherited.
|
|
810
|
+
* @returns een Icon met tekst in dezelfde kleur als het icon
|
|
811
|
+
* @example
|
|
812
|
+
* <IconText icon="fas fa-flag">Flag</IconText>
|
|
813
|
+
* <IconText icon={faFlag}>Flag</IconText> // import { faFlag } from '@fortawesome/free-solid-svg-icons';
|
|
814
|
+
*/
|
|
815
|
+
declare const IconText: ({ icon, size, color, rotation, flip, animate, children }: IconTextProps) => JSX.Element;
|
|
816
|
+
|
|
817
|
+
type IndicatorProps = {
|
|
818
|
+
/** Positie van de indicator (default = 'tr' (top-right)) */
|
|
819
|
+
position?: IndicatorPositionProp;
|
|
820
|
+
/** Het element waar de indicator op moet */
|
|
821
|
+
children: React$1.ReactNode;
|
|
822
|
+
/** Label voor op de indicator (optioneel) */
|
|
823
|
+
label?: string | React$1.ReactNode;
|
|
824
|
+
/** Kleur van de indicator (default = 'l' ('link')) */
|
|
825
|
+
color?: ColorProp;
|
|
826
|
+
/** Extra classes voor de indicator container (element waar indicator & target-element inzitten) (optioneel) */
|
|
827
|
+
className?: string;
|
|
828
|
+
/** Tooltip voor indicator (optioneel) */
|
|
829
|
+
tooltip?: string;
|
|
830
|
+
};
|
|
831
|
+
/**
|
|
832
|
+
* Een indicator toont een badge op een ander element. Er zijn meerdere posities. De indicator moet als wrapper voor het gewenste element gebruikt worden.
|
|
833
|
+
* @param props Indicator Props
|
|
834
|
+
* @returns Een element met een indicator
|
|
835
|
+
* @example
|
|
836
|
+
* <Indicator position="tl" color="p" tooltip="There are 5 new messages">
|
|
837
|
+
* <Button>Check messages</Button>
|
|
838
|
+
* 5
|
|
839
|
+
* </Indicator>
|
|
840
|
+
*/
|
|
841
|
+
declare function Indicator({ label, className, position, color, tooltip, children }: IndicatorProps): JSX.Element;
|
|
842
|
+
|
|
843
|
+
/**
|
|
844
|
+
* Toon een Keyboard-Key als een 'key' op een keyboard.
|
|
845
|
+
* @param params
|
|
846
|
+
* @returns een element dat lijkt op een keyboard-key
|
|
847
|
+
* @example <Kbd>A</Kbd>
|
|
848
|
+
*/
|
|
849
|
+
declare function Kbd({ children, className, }: {
|
|
850
|
+
/** Optionele extra class */
|
|
851
|
+
className?: string;
|
|
852
|
+
/** Content van de key */
|
|
853
|
+
children: React$1.ReactNode;
|
|
854
|
+
}): JSX.Element;
|
|
855
|
+
/**
|
|
856
|
+
* Toont meerdere keyboard-keys, gescheiden door een teken (deafult = '+')
|
|
857
|
+
* @param props
|
|
858
|
+
* @returns een rijtje keyboard-keys
|
|
859
|
+
* @example <Kbds keys={['ctrl+S', 'shift+D']} />
|
|
860
|
+
*/
|
|
861
|
+
declare function Kbds({ keys, separator, className, }: {
|
|
862
|
+
/** Weer te geven keys als string */
|
|
863
|
+
keys: string[];
|
|
864
|
+
/** De separator van de keys, default '+' */
|
|
865
|
+
separator?: string;
|
|
866
|
+
/** Optionele className */
|
|
867
|
+
className?: string;
|
|
868
|
+
}): JSX.Element;
|
|
869
|
+
|
|
870
|
+
type MenuProps = {
|
|
871
|
+
/** Welk item is het initiële geselecteerde item */
|
|
872
|
+
initialItem?: string;
|
|
873
|
+
/** De content van het menu (<MenuItem>, <ExpandableMenuItem> or <MenuItemGroup>) */
|
|
874
|
+
children: React$1.ReactNode;
|
|
875
|
+
/** Callback voor menu-item selectie */
|
|
876
|
+
onMenuItemClicked: (item: string) => void;
|
|
877
|
+
};
|
|
878
|
+
type MenuItemProps = {
|
|
879
|
+
/** (optional) Naam voor menu-item dat geselecteert wordt. Als niet opgegevens, wordt de string-content van het item gebruikt */
|
|
880
|
+
name?: string;
|
|
881
|
+
/** Content van het item */
|
|
882
|
+
children: React$1.ReactNode;
|
|
883
|
+
};
|
|
884
|
+
type MenuItemGroupProps = {
|
|
885
|
+
/** Label voor een groep MenuItems */
|
|
886
|
+
label: string;
|
|
887
|
+
/** Items in de ze groep (<MenuItem> or <ExpandableMenuItem>) */
|
|
888
|
+
children: React$1.ReactNode;
|
|
889
|
+
};
|
|
890
|
+
type ExpandableMenuItemProps = {
|
|
891
|
+
/** De content van het menu-item (MenuItem components) */
|
|
892
|
+
children: React$1.ReactNode;
|
|
893
|
+
/** Label voor exapnd/collapse */
|
|
894
|
+
label: string;
|
|
895
|
+
/** Begint de lijst expanded? */
|
|
896
|
+
startExpanded?: boolean;
|
|
897
|
+
/** Click handler */
|
|
898
|
+
onClick?: (label: string, e?: React$1.MouseEvent) => void;
|
|
899
|
+
};
|
|
900
|
+
/**
|
|
901
|
+
* Render een Menu met <Menu.ItemGroup>, <Menu.Item> en <Menu.ExpandableItem> children
|
|
902
|
+
* @param props
|
|
903
|
+
* @returns een Menu
|
|
904
|
+
* @example
|
|
905
|
+
* <Menu initialItem="1">
|
|
906
|
+
* <Menu.ItemGroup label="Groep 1">
|
|
907
|
+
* <Menu.Item name="1">Item 1</Menu.Item>
|
|
908
|
+
* <Menu.Item name="2">Item 2</Menu.Item>
|
|
909
|
+
* </Menu.ItemGroup>
|
|
910
|
+
* <Menu.ItemGroup label="Groep 2">
|
|
911
|
+
* ...
|
|
912
|
+
* </Menu.ItemGroup>
|
|
913
|
+
* </Menu>
|
|
914
|
+
*/
|
|
915
|
+
declare const Menu: {
|
|
916
|
+
(props: MenuProps): JSX.Element;
|
|
917
|
+
/**
|
|
918
|
+
* Een selecteerbaar menu-item in het Menu
|
|
919
|
+
* @param props
|
|
920
|
+
* @return een selecteerbaar menu-item
|
|
921
|
+
* @example <Menu.Item name="1">Item 1</Menu.Item>
|
|
922
|
+
*/
|
|
923
|
+
Item: ({ name, children }: MenuItemProps) => JSX.Element;
|
|
924
|
+
/**
|
|
925
|
+
* Groepeer Menu Items in een lijstje met een label om te laten weten dat ze bij elkaar horen
|
|
926
|
+
* @param props
|
|
927
|
+
* @returns een MenuItemGroup
|
|
928
|
+
* @example
|
|
929
|
+
* <Menu.ItemGroup label="Groep 1">
|
|
930
|
+
* <Menu.Item name="1">Item 1</Menu.Item>
|
|
931
|
+
* <Menu.Item name="2">Item 2</Menu.Item>
|
|
932
|
+
* </Menu.ItemGroup>
|
|
933
|
+
*/
|
|
934
|
+
ItemGroup: ({ label, children }: MenuItemGroupProps) => JSX.Element;
|
|
935
|
+
/**
|
|
936
|
+
* Een niet-selecteerbare, maar wel collapsable / expandable menu item met een lijstje children
|
|
937
|
+
* @param props
|
|
938
|
+
* @returns een collapsible menu item
|
|
939
|
+
* @example
|
|
940
|
+
* <Menu.ExpandableItem label="Groep 1">
|
|
941
|
+
* <Menu.Item name="1">Item 1</Menu.Item>
|
|
942
|
+
* <Menu.Item name="2">Item 2</Menu.Item>
|
|
943
|
+
* </Menu.ExpandableItem>
|
|
944
|
+
*/
|
|
945
|
+
ExpandableItem: (props: ExpandableMenuItemProps) => JSX.Element;
|
|
946
|
+
};
|
|
947
|
+
|
|
948
|
+
type MessageProps = {
|
|
949
|
+
/** Content van de message */
|
|
950
|
+
children: React$1.ReactNode;
|
|
951
|
+
/** Optionele titel voor de message */
|
|
952
|
+
title?: string | undefined;
|
|
953
|
+
/** De grootte van de tekst in de messages (default = 'm') */
|
|
954
|
+
size?: SizeProp;
|
|
955
|
+
};
|
|
956
|
+
/** Zelf regelbare message.
|
|
957
|
+
* @returns een message
|
|
958
|
+
* @example <Message color="p" size="l" tooltip="This is a tooltip">This is a message</Message>
|
|
959
|
+
*/
|
|
960
|
+
declare const Message: {
|
|
961
|
+
({ children, title, size, color, }: MessageProps & {
|
|
962
|
+
color?: string | undefined;
|
|
963
|
+
}): JSX.Element;
|
|
964
|
+
/** Een primary-colored message
|
|
965
|
+
* @param props props
|
|
966
|
+
* @returns een primary-colored message
|
|
967
|
+
* @example <Message color="p" size="l" tooltip="This is a tooltip">This is a primary message</Message>
|
|
968
|
+
*/
|
|
969
|
+
Primary(props: MessageProps): JSX.Element;
|
|
970
|
+
/** Een success-colored message
|
|
971
|
+
* @param props props
|
|
972
|
+
* @returns een success-colored message
|
|
973
|
+
* @example <Message color="s" size="l" tooltip="This is a tooltip">This is a success message</Message>
|
|
974
|
+
*/
|
|
975
|
+
Success(props: MessageProps): JSX.Element;
|
|
976
|
+
/** Een danger-colored message
|
|
977
|
+
* @param props props
|
|
978
|
+
* @returns een danger-colored message
|
|
979
|
+
* @example <Message color="d" size="l" tooltip="This is a tooltip">This is a danger message</Message>
|
|
980
|
+
*/
|
|
981
|
+
Danger(props: MessageProps): JSX.Element;
|
|
982
|
+
/** Een warning-colored message
|
|
983
|
+
* @param props props
|
|
984
|
+
* @returns een warning-colored message
|
|
985
|
+
* @example <Message color="w" size="l" tooltip="This is a tooltip">This is a warning message</Message>
|
|
986
|
+
*/
|
|
987
|
+
Warning(props: MessageProps): JSX.Element;
|
|
988
|
+
/** Een info-colored message (OOK de default)
|
|
989
|
+
* @param props props
|
|
990
|
+
* @returns een info-colored message
|
|
991
|
+
* @example <Message color="i" size="l" tooltip="This is a tooltip">This is a info message</Message>
|
|
992
|
+
*/
|
|
993
|
+
Info(props: MessageProps): JSX.Element;
|
|
994
|
+
/** Een link-colored message
|
|
995
|
+
* @param props props
|
|
996
|
+
* @returns een link-colored message
|
|
997
|
+
* @example <Message color="l" size="l" tooltip="This is a tooltip">This is a link message</Message>
|
|
998
|
+
*/
|
|
999
|
+
Link(props: MessageProps): JSX.Element;
|
|
1000
|
+
};
|
|
1001
|
+
|
|
1002
|
+
type ModalProps = {
|
|
1003
|
+
/** Content van de modal. Als deze te lang wordt, wordt hij scrollable */
|
|
1004
|
+
children: React$1.ReactNode;
|
|
1005
|
+
/**
|
|
1006
|
+
* Afhandeling van de dismiss van de modal
|
|
1007
|
+
* @param e event
|
|
1008
|
+
*/
|
|
1009
|
+
onDismiss(e?: any): any;
|
|
1010
|
+
/** De grootte van de modal: met SizeProp of een string. ( DEFAULT = 'm', 800px)
|
|
1011
|
+
* - `SizeProp`: s: 600px, m: 800px, l: 1000px, xl: 1200px
|
|
1012
|
+
* - `string`: '834px', '50%, 60em', '100%'
|
|
1013
|
+
*/
|
|
1014
|
+
size?: SizeProp | string;
|
|
1015
|
+
helpTag?: string;
|
|
1016
|
+
};
|
|
1017
|
+
/**
|
|
1018
|
+
* Een modal-component. Als een modal ene Foot en een Head heeft, wordt de rest automatisch toegevoegd in een Body
|
|
1019
|
+
* @param props modal props
|
|
1020
|
+
* @returns een modal
|
|
1021
|
+
* @example
|
|
1022
|
+
* <Modal onDismiss={handleDismiss}>Modal without head and foot, all body</Modal>
|
|
1023
|
+
*
|
|
1024
|
+
* <Modal onDismiss={handleDismissModal} size="m">
|
|
1025
|
+
* <Modal.Head>Optional Modal Head</Modal.Head>
|
|
1026
|
+
* <Modal.Body>Optional Modal Body</Modal.Body>
|
|
1027
|
+
* <Modal.Foot>Optional Modal Foot</Modal.Foot>
|
|
1028
|
+
* </Modal>
|
|
1029
|
+
*/
|
|
1030
|
+
declare const Modal: {
|
|
1031
|
+
(props: ModalProps): JSX.Element;
|
|
1032
|
+
/**
|
|
1033
|
+
* Een niet-scrollende, altijd zichtbare head voor de modal
|
|
1034
|
+
* @param props
|
|
1035
|
+
* @returns modal head
|
|
1036
|
+
* @example <Modal.Head>Optional Modal Head</Modal.Head>
|
|
1037
|
+
*/
|
|
1038
|
+
Head: (props: {
|
|
1039
|
+
children: React$1.ReactNode;
|
|
1040
|
+
}) => JSX.Element;
|
|
1041
|
+
/**
|
|
1042
|
+
* Een scrollende body voor de modal
|
|
1043
|
+
* @param props
|
|
1044
|
+
* @returns modal body
|
|
1045
|
+
* @example <Modal.Body>Modal Body</Modal.Body>
|
|
1046
|
+
*/
|
|
1047
|
+
Body: (props: {
|
|
1048
|
+
children: React$1.ReactNode;
|
|
1049
|
+
}) => JSX.Element;
|
|
1050
|
+
/**
|
|
1051
|
+
* Een niet-scrollende, altijd zichtbare foot voor de modal
|
|
1052
|
+
* @param props props
|
|
1053
|
+
* @returns modal foot
|
|
1054
|
+
* @example <Modal.Foot>Optional Modal Foot</Modal.Foot>
|
|
1055
|
+
*/
|
|
1056
|
+
Foot: (props: {
|
|
1057
|
+
children: React$1.ReactNode;
|
|
1058
|
+
}) => JSX.Element;
|
|
1059
|
+
};
|
|
1060
|
+
|
|
1061
|
+
/** Props voor een Notification */
|
|
1062
|
+
type NotificationProps = {
|
|
1063
|
+
/** Content van de notificatie */
|
|
1064
|
+
children: React$1.ReactNode;
|
|
1065
|
+
/**
|
|
1066
|
+
* Afhandeling van dismiss-click notificatie
|
|
1067
|
+
* @param e event
|
|
1068
|
+
*/
|
|
1069
|
+
onDismiss(e?: any): void;
|
|
1070
|
+
/** Roep de @see onDismiss() automatisch aan na ... milliseconden */
|
|
1071
|
+
autoDismissAfter?: number;
|
|
1072
|
+
};
|
|
1073
|
+
/**
|
|
1074
|
+
* Een instelbare notificatie. Default is een info-notificatie
|
|
1075
|
+
* @param props
|
|
1076
|
+
* @returns notificatie
|
|
1077
|
+
* @example <Notification>Hello World</Notification>
|
|
1078
|
+
*/
|
|
1079
|
+
declare const Notification: {
|
|
1080
|
+
({ children, onDismiss, autoDismissAfter, color, }: NotificationProps & {
|
|
1081
|
+
color?: string | undefined;
|
|
1082
|
+
}): JSX.Element;
|
|
1083
|
+
/** Een primary-colored notificatie
|
|
1084
|
+
* @param props
|
|
1085
|
+
* @returns een primary-colored notificatie
|
|
1086
|
+
* @example <Notification.Primary>Hello World</Notification.Primary>
|
|
1087
|
+
*/
|
|
1088
|
+
Primary(props: NotificationProps): JSX.Element;
|
|
1089
|
+
/** Een danger-colored notificatie
|
|
1090
|
+
* @param props
|
|
1091
|
+
* @returns een danger-colored notificatie
|
|
1092
|
+
* @example <Notification.Danger>Hello World</Notification.Danger>
|
|
1093
|
+
*/
|
|
1094
|
+
Danger(props: NotificationProps): JSX.Element;
|
|
1095
|
+
/** Een warning-colored notificatie
|
|
1096
|
+
* @param props
|
|
1097
|
+
* @returns een warning-colored notificatie
|
|
1098
|
+
* @example <Notification.Warning>Hello World</Notification.Warning>
|
|
1099
|
+
*/
|
|
1100
|
+
Warning(props: NotificationProps): JSX.Element;
|
|
1101
|
+
/** Een success-colored notificatie
|
|
1102
|
+
* @param props
|
|
1103
|
+
* @returns een success-colored notificatie
|
|
1104
|
+
* @example <Notification.Success>Hello World</Notification.Success>
|
|
1105
|
+
*/
|
|
1106
|
+
Success(props: NotificationProps): JSX.Element;
|
|
1107
|
+
/** Een link-colored notificatie
|
|
1108
|
+
* @param props
|
|
1109
|
+
* @returns een link-colored notificatie
|
|
1110
|
+
* @example <Notification.Link>Hello World</Notification.Link>
|
|
1111
|
+
*/
|
|
1112
|
+
Link(props: NotificationProps): JSX.Element;
|
|
1113
|
+
/** Een info-colored notificatie (OOK DE DEFAULT)
|
|
1114
|
+
* @param props
|
|
1115
|
+
* @returns een info-colored notificatie
|
|
1116
|
+
* @example <Notification.Info>Hello World</Notification.Info>
|
|
1117
|
+
*/
|
|
1118
|
+
Info(props: NotificationProps): JSX.Element;
|
|
1119
|
+
};
|
|
1120
|
+
|
|
1121
|
+
type ProgressBarProps = {
|
|
1122
|
+
/** Grootte van de progressbar */
|
|
1123
|
+
size?: SizeProp;
|
|
1124
|
+
/** De maximale waarde, default = 100 */
|
|
1125
|
+
max?: number;
|
|
1126
|
+
/** De waarde waarop de progressbar staat. Vul niet in voor een onbepaalde, loopende progressbar */
|
|
1127
|
+
value?: number;
|
|
1128
|
+
/** Waarde-extensie (default = '%') */
|
|
1129
|
+
extension?: '%' | 'pct' | '$' | string;
|
|
1130
|
+
/** De kleur van de progressbar (default = 'i') */
|
|
1131
|
+
color?: ColorProp;
|
|
1132
|
+
};
|
|
1133
|
+
/**
|
|
1134
|
+
* Maak een progress-bar met de <progress> tag.
|
|
1135
|
+
* Door de attribut 'value' leeg te laten, krijg je een looping progress bar
|
|
1136
|
+
* @param props
|
|
1137
|
+
* @returns een progress bar
|
|
1138
|
+
* @example
|
|
1139
|
+
* <ProgressBar value={50} />
|
|
1140
|
+
* <ProgressBar value={50} extension="%" />
|
|
1141
|
+
* <ProgressBar size='xl' />
|
|
1142
|
+
*/
|
|
1143
|
+
declare function ProgressBar({ color, size, extension, max, value }: ProgressBarProps): JSX.Element;
|
|
1144
|
+
|
|
1145
|
+
type SimpleTableProps<T extends unknown> = {
|
|
1146
|
+
/**
|
|
1147
|
+
* Zichtbare kolommen:
|
|
1148
|
+
* - `string[]`: object keys
|
|
1149
|
+
* - `TableColProps`: naam van de kolom en de object-key die daarbij hoort. Als name undefined, wordt de key genomen
|
|
1150
|
+
* - `undefined`: alle object keys worden gebruikt en getoont
|
|
1151
|
+
*/
|
|
1152
|
+
columns?: string[] | SimpleTableColProps<T>[] | undefined;
|
|
1153
|
+
/** De data van tabel: een array objects */
|
|
1154
|
+
data: T[];
|
|
1155
|
+
/** Waarmee moet een rij worden geidentificeerd. Anders wordt index gebruikt, liever niet: react-performance */
|
|
1156
|
+
rowIdentifier?: string | number | ((item: T) => string | number);
|
|
1157
|
+
/** Is de tabel narrow ? (default false) */
|
|
1158
|
+
narrow?: boolean;
|
|
1159
|
+
/** Is de tabel striped ? (default false) */
|
|
1160
|
+
striped?: boolean;
|
|
1161
|
+
/** Is de tabel bordered ? (default false) */
|
|
1162
|
+
bordered?: boolean;
|
|
1163
|
+
/** Is de tabel hovered (default false) */
|
|
1164
|
+
hoverable?: boolean;
|
|
1165
|
+
/** Is de tabel fullwidth (default false) */
|
|
1166
|
+
fullwidth?: boolean;
|
|
1167
|
+
/** Moet de inhoud van de table-header ook onderaan verschijnen ? (default false) */
|
|
1168
|
+
hasFooter?: boolean;
|
|
1169
|
+
/** Terugkoppeling voor een geselecteerde rij.
|
|
1170
|
+
* @param item: Het geselecteerde item
|
|
1171
|
+
* @param row: de tabel-rij waarop geklikt is (<tr> tag). Om de row 'selected' te laten lijken: toggle de 'is-selected' class
|
|
1172
|
+
*/
|
|
1173
|
+
onRowSelected?(item: T, row: HTMLTableRowElement): void;
|
|
1174
|
+
};
|
|
1175
|
+
type SimpleTableColProps<T> = {
|
|
1176
|
+
/** De naam van de kolom
|
|
1177
|
+
* - Als niet opgegeven wordt de obj key gebruikt uit de 'value'prop (als dat een string is)
|
|
1178
|
+
* - Als je geen header wil tonen, zet dan een lege string als header
|
|
1179
|
+
*/
|
|
1180
|
+
header?: string;
|
|
1181
|
+
/** De obj-property die gebruikt moet worden in de kolom
|
|
1182
|
+
* - Als string: object[value] geeft de waarde
|
|
1183
|
+
* - Als function: eigen function om de value te zetten
|
|
1184
|
+
*/
|
|
1185
|
+
value: string | ((v: T) => string);
|
|
1186
|
+
};
|
|
1187
|
+
/**
|
|
1188
|
+
* Render een tabel. Als je een tabel met zoekfunctie, pagination en sorteren wil, moet je een @see DataTable nemen.
|
|
1189
|
+
* @param props
|
|
1190
|
+
* @returns een tabel gestyled met bulma
|
|
1191
|
+
* @example
|
|
1192
|
+
* <SimpleTable
|
|
1193
|
+
* data={customTableData}
|
|
1194
|
+
* columns={['id', 'first_name', 'last_name', 'email']}
|
|
1195
|
+
* rowIdentifier="id"
|
|
1196
|
+
* striped={true}
|
|
1197
|
+
* fullwidth={true}
|
|
1198
|
+
* hoverable={true}
|
|
1199
|
+
* narrow={true}
|
|
1200
|
+
* bordered={false}
|
|
1201
|
+
* />
|
|
1202
|
+
*/
|
|
1203
|
+
declare function SimpleTable<T extends {}>(props: SimpleTableProps<T>): JSX.Element;
|
|
1204
|
+
|
|
1205
|
+
type StatusType = 'active' | 'completed' | 'error' | 'pending';
|
|
1206
|
+
type StepChoiceType = 'disabled' | 'up' | 'down' | 'allowed';
|
|
1207
|
+
type StepsProps = {
|
|
1208
|
+
/** Extra classes voor de steps-container */
|
|
1209
|
+
className?: string;
|
|
1210
|
+
/** Alleen <Steps.Item> componenten */
|
|
1211
|
+
children: React$1.ReactNode;
|
|
1212
|
+
/** Grootte van de steps (default = 'm') */
|
|
1213
|
+
size?: SizeProp;
|
|
1214
|
+
/** Wat is de actieve step @deprecated use activeStepindex */
|
|
1215
|
+
activeStep?: number;
|
|
1216
|
+
/** Wat is de actieve step */
|
|
1217
|
+
activeStepIndex?: number;
|
|
1218
|
+
/** Change-step callback */
|
|
1219
|
+
onChangeStep?: (step: number) => void;
|
|
1220
|
+
/** FreeStepChoice:
|
|
1221
|
+
* - `disabled`: alleen links/recht selecteren
|
|
1222
|
+
* - `up`: alleen naar rechts vrij selecteren
|
|
1223
|
+
* - `down`: alleen links beneden vrij selecteren
|
|
1224
|
+
* - `allowed`: alles vrij selecteerbaar */
|
|
1225
|
+
freeStepChoice?: StepChoiceType;
|
|
1226
|
+
};
|
|
1227
|
+
type StepItemProps = {
|
|
1228
|
+
/** Step status */
|
|
1229
|
+
status?: StatusType;
|
|
1230
|
+
/** Title van de step */
|
|
1231
|
+
title?: string;
|
|
1232
|
+
/** Details bij de step */
|
|
1233
|
+
details?: string;
|
|
1234
|
+
/** Een makering van de step (default = stepnr) */
|
|
1235
|
+
marker?: React$1.ReactNode | ((s?: StatusType) => React$1.ReactNode);
|
|
1236
|
+
/** Tooltip voor deze step */
|
|
1237
|
+
tooltip?: string;
|
|
1238
|
+
};
|
|
1239
|
+
/**
|
|
1240
|
+
* Maak een stappen-paneel voor een set van stappen.
|
|
1241
|
+
* @param props
|
|
1242
|
+
* @returns een stappen-paneel
|
|
1243
|
+
* @example
|
|
1244
|
+
* <Steps activeStep={1} onChangeStep={handleStepChange}>
|
|
1245
|
+
* <Steps.Item title="Step 1" marker={1} />
|
|
1246
|
+
* <Steps.Item title="" marker={<Icon icon={faFlask} />} />
|
|
1247
|
+
* <Steps.Item title="Step 2" details="dit zijn de details voor deze stap" />
|
|
1248
|
+
* <Steps.Item title="" marker={<Icon icon={faBomb} />} status="error" />
|
|
1249
|
+
* <Steps.Item
|
|
1250
|
+
* title="Step 3"
|
|
1251
|
+
* marker={(status) => (status == 'pending' ? <Icon icon={faFlag} /> : <Icon icon={faFire} />)}
|
|
1252
|
+
* />
|
|
1253
|
+
* <Steps.Item title="Step 4" marker="A" />
|
|
1254
|
+
* </Steps>
|
|
1255
|
+
*/
|
|
1256
|
+
declare const Steps: {
|
|
1257
|
+
(props: StepsProps): JSX.Element;
|
|
1258
|
+
/**
|
|
1259
|
+
* Een stap in een stappen-paneel.
|
|
1260
|
+
* @param props
|
|
1261
|
+
* @returns een stap voor de <Steps> component
|
|
1262
|
+
* @example
|
|
1263
|
+
* <Steps.Item title="Step 1" marker={1} />
|
|
1264
|
+
* <Steps.Item title="Step 2" marker={2} tooltip="step 2" status="error" />
|
|
1265
|
+
*/
|
|
1266
|
+
Item(props: StepItemProps): JSX.Element;
|
|
1267
|
+
};
|
|
1268
|
+
|
|
1269
|
+
type TabBarProps = {
|
|
1270
|
+
/** Tab grootte. (default = 'm') */
|
|
1271
|
+
size?: SizeProp;
|
|
1272
|
+
/** Style van de tabs */
|
|
1273
|
+
styling?: 'boxed' | 'toggle' | undefined;
|
|
1274
|
+
/** Links, rechts of centered uilijnen (default = 'l') */
|
|
1275
|
+
alignment?: AlignmentProp | undefined;
|
|
1276
|
+
/** Is de tabbar fullwidth */
|
|
1277
|
+
fullwidth?: boolean;
|
|
1278
|
+
/** Initial active tab (default 1e item) */
|
|
1279
|
+
initialTab?: number | string | undefined;
|
|
1280
|
+
/** Active tab, change the current tab AND sets the initial tab, (default 1e item) */
|
|
1281
|
+
activeTab?: number | string | undefined;
|
|
1282
|
+
/**
|
|
1283
|
+
* Afhandeling van een tab geselecteerd.
|
|
1284
|
+
* @param index index selected tab
|
|
1285
|
+
*/
|
|
1286
|
+
onTabChange(index: number | string): void;
|
|
1287
|
+
/** De tab items: Allemaal TabItem-Components */
|
|
1288
|
+
children: React$1.ReactNode;
|
|
1289
|
+
};
|
|
1290
|
+
type TabBarItemProps = {
|
|
1291
|
+
/** Tooltip voor dit tabbar item */ tooltip?: string;
|
|
1292
|
+
/** Content voor dit tabbar item */ children: React$1.ReactNode;
|
|
1293
|
+
/** ID van dit item */ tabId: number | string;
|
|
1294
|
+
};
|
|
1295
|
+
/**
|
|
1296
|
+
* Maak een tabs-lijst. Zichtbare content moet zelf geregeld worden.
|
|
1297
|
+
* @param props
|
|
1298
|
+
* @returns tabs component
|
|
1299
|
+
* @example
|
|
1300
|
+
* <TabBar onTabChange={handleTabChange} activeTab={activePage}>
|
|
1301
|
+
* <TabBar.Item tabId={1}>Tab 1</TabBar.Item>
|
|
1302
|
+
* <TabBar.Item tabId={2}><Icon icon={faFLag} />Tab 2</TabBar.Item>
|
|
1303
|
+
* <TabBar.Item tabId={3}>Tab 3</TabBar.Item>
|
|
1304
|
+
* </TabBar>
|
|
1305
|
+
*/
|
|
1306
|
+
declare const TabBar: {
|
|
1307
|
+
(props: TabBarProps): JSX.Element;
|
|
1308
|
+
/** Een item in deen <TabBar> component
|
|
1309
|
+
* @param props
|
|
1310
|
+
* @returns tab item component
|
|
1311
|
+
* @example <TabBar.Item tabId={1}>Tab 1</TabBar.Item>
|
|
1312
|
+
*/
|
|
1313
|
+
Item: typeof TabBarItem;
|
|
1314
|
+
};
|
|
1315
|
+
declare function TabBarItem({ children, tabId, tooltip }: TabBarItemProps): JSX.Element;
|
|
1316
|
+
|
|
1317
|
+
type TagProps = {
|
|
1318
|
+
/** Content van de tag */
|
|
1319
|
+
children: React$1.ReactNode;
|
|
1320
|
+
/** Kleur van de tag, de standaard kleuren + dark & light en `is-${`string`}`-waardes */
|
|
1321
|
+
color?: ColorProp | 'dark' | 'light';
|
|
1322
|
+
/** Sizes van de tag. (default = 's'). LET OP 3 verschillende sizes ipv 4! */
|
|
1323
|
+
size?: TagSizeProp;
|
|
1324
|
+
/** Moet de light-colored versie van de tag getoont worden */
|
|
1325
|
+
light?: boolean;
|
|
1326
|
+
/** Zijn de tags rounded ? */
|
|
1327
|
+
rounded?: boolean;
|
|
1328
|
+
/** Moet er een dismiss-knop op de tag, en zo ja, definieer daar een functie voor */
|
|
1329
|
+
onDismiss?: (e: any) => void;
|
|
1330
|
+
/** Tooltip voor de tag */
|
|
1331
|
+
tooltip?: string;
|
|
1332
|
+
};
|
|
1333
|
+
type TagsProps = {
|
|
1334
|
+
/** De content van de tags-div */
|
|
1335
|
+
children: React$1.ReactNode;
|
|
1336
|
+
/** Moeten de tags aan elkaar geplakt worden? */
|
|
1337
|
+
merged?: boolean;
|
|
1338
|
+
/** De grootte van alle tags , overschrijfbaar per tag (default = 's'). LET OP: 3 sizes ipv 4 */
|
|
1339
|
+
size?: TagSizeProp;
|
|
1340
|
+
/** Alignment van de tags (default = 'l') */
|
|
1341
|
+
alignment?: AlignmentProp;
|
|
1342
|
+
/** Extra classes op de tags container */
|
|
1343
|
+
className?: string;
|
|
1344
|
+
};
|
|
1345
|
+
/**
|
|
1346
|
+
* Maak een tag
|
|
1347
|
+
* @param props Tag Props
|
|
1348
|
+
* @returns een tag
|
|
1349
|
+
* @example
|
|
1350
|
+
* <Tag>Hello</Tag>
|
|
1351
|
+
* <Tag color='d'>Danger</Tag>
|
|
1352
|
+
*/
|
|
1353
|
+
declare function Tag({ children, color, size, light, rounded, tooltip, onDismiss }: TagProps): JSX.Element;
|
|
1354
|
+
/**
|
|
1355
|
+
* Maak een tag-container aan. De tags kunnen aan elkaar geplakt worden of niet.
|
|
1356
|
+
* De grootte van de tags kan ook ingesteld worden
|
|
1357
|
+
* @param props
|
|
1358
|
+
* @returns een groep van tags
|
|
1359
|
+
* @example
|
|
1360
|
+
* <Tags size="m">
|
|
1361
|
+
* <Tag>Tag 1</Tag>
|
|
1362
|
+
* <Tag color="i">Tag 2</Tag>
|
|
1363
|
+
* </Tags>
|
|
1364
|
+
*/
|
|
1365
|
+
declare function Tags({ children, merged, size, alignment, className }: TagsProps): JSX.Element;
|
|
1366
|
+
|
|
1367
|
+
type TimeLineProps = {
|
|
1368
|
+
/** Alignment van de timeline (default = 'l', left) */
|
|
1369
|
+
alignment?: AlignmentProp;
|
|
1370
|
+
/** Children van de timeline, dus TimeLine.Item & TimeLine.Point */
|
|
1371
|
+
children: React$1.ReactNode;
|
|
1372
|
+
/** Extra classname op de timeline container */
|
|
1373
|
+
className?: string;
|
|
1374
|
+
};
|
|
1375
|
+
type TimeLineItemProps = {
|
|
1376
|
+
/** Aanpassingen aan de default grijze marker op de timeline. Los van elkaar instelbaar */
|
|
1377
|
+
marker?: {
|
|
1378
|
+
/** Icon op de timeline */
|
|
1379
|
+
icon?: string | IconProp;
|
|
1380
|
+
/** Aangepaste kleur */
|
|
1381
|
+
color?: ColorProp;
|
|
1382
|
+
};
|
|
1383
|
+
/** Een title voor omschrijving van het item */
|
|
1384
|
+
heading?: string;
|
|
1385
|
+
/** Content bij dit timeline item */
|
|
1386
|
+
children: React$1.ReactNode;
|
|
1387
|
+
/** Een tooltip voor een timeline item */
|
|
1388
|
+
tooltip?: string;
|
|
1389
|
+
/** onClick() callback voor timeline content */
|
|
1390
|
+
onClick?: (heading?: string) => void;
|
|
1391
|
+
};
|
|
1392
|
+
type TimeLinePointProps = {
|
|
1393
|
+
/** De content van het Point */
|
|
1394
|
+
children: React$1.ReactNode;
|
|
1395
|
+
/** De kleur van het point (default = 'l', link) */
|
|
1396
|
+
color?: ColorProp;
|
|
1397
|
+
/** De grotte van het point (default = 's', small) */
|
|
1398
|
+
size?: TagSizeProp;
|
|
1399
|
+
/** Een optionele tooltip voor dit point */
|
|
1400
|
+
tooltip?: string;
|
|
1401
|
+
/** onClick() callback voor timeline content */
|
|
1402
|
+
onClick?: () => void;
|
|
1403
|
+
};
|
|
1404
|
+
/**
|
|
1405
|
+
* Een timeline is een lijst van items met een marker op een lijn.
|
|
1406
|
+
* @param props
|
|
1407
|
+
* @returns een Timeline component
|
|
1408
|
+
* @example
|
|
1409
|
+
* <TimeLine alignment="c">
|
|
1410
|
+
* <TimeLine.Point>Start</TimeLine.Point>
|
|
1411
|
+
* <TimeLine.Point color="l">2016</TimeLine.Point>
|
|
1412
|
+
* <TimeLine.Item heading="March 2016">nothing happened</TimeLine.Item>
|
|
1413
|
+
* <TimeLine.Item marker={{ color: 's' }} heading="August 2016">
|
|
1414
|
+
* Als nothing happened
|
|
1415
|
+
* </TimeLine.Item>
|
|
1416
|
+
* <TimeLine.Point color="d" size="m"> 2017</TimeLine.Point>
|
|
1417
|
+
* </TimeLine>
|
|
1418
|
+
*/
|
|
1419
|
+
declare const TimeLine: {
|
|
1420
|
+
({ alignment, children, className }: TimeLineProps): JSX.Element;
|
|
1421
|
+
/**
|
|
1422
|
+
* Een punt op de timeline, bijvoorbeeld een jaartal of een datum. Er wordt een <Tag> gebruikt
|
|
1423
|
+
* @param props
|
|
1424
|
+
* @returns een punt (Tag-component) op de timeline
|
|
1425
|
+
* @example <TimeLine.Point color="l">2016</TimeLine.Point>
|
|
1426
|
+
*/
|
|
1427
|
+
Point({ children, color, size, tooltip, onClick }: TimeLinePointProps): JSX.Element;
|
|
1428
|
+
/**
|
|
1429
|
+
* Een item met een omschrijving, heading en icon op de timeline
|
|
1430
|
+
* @param props
|
|
1431
|
+
* @returns een Item op de timeline
|
|
1432
|
+
* @example <TimeLine.Item heading="March 2016">nothing happened</TimeLine.Item>
|
|
1433
|
+
*/
|
|
1434
|
+
Item({ marker, heading, children, tooltip, onClick }: TimeLineItemProps): JSX.Element;
|
|
1435
|
+
};
|
|
1436
|
+
|
|
1437
|
+
type TitleProps = {
|
|
1438
|
+
/** Content van de title. Kan ook met `txt`-prop gezet worden */
|
|
1439
|
+
children?: React$1.ReactNode;
|
|
1440
|
+
/** Content van de title. Kan ook met `children` gezet worden */
|
|
1441
|
+
txt?: string;
|
|
1442
|
+
/** De bulma-grootte die gebruikt wordt */
|
|
1443
|
+
bulmaSize?: '1' | '2' | '3' | '4' | '5' | '6' | number;
|
|
1444
|
+
/** De heading grootte: h1, h2, h3, h4, h5 of h6 */
|
|
1445
|
+
headingSize?: '1' | '2' | '3' | '4' | '5' | '6' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | undefined | number;
|
|
1446
|
+
};
|
|
1447
|
+
type SubtitleProps = {
|
|
1448
|
+
/** Content van de title. Kan ook met `txt`-prop gezet worden */
|
|
1449
|
+
children?: React$1.ReactNode;
|
|
1450
|
+
/** Content van de title. Kan ook met `children` gezet worden */
|
|
1451
|
+
txt?: string;
|
|
1452
|
+
/** De bulma-grootte die gebruikt wordt */
|
|
1453
|
+
bulmaSize?: '3' | '4' | '5' | '6' | number;
|
|
1454
|
+
/** De heading grootte: h1, h2, h3, h4, h5 of h6 */
|
|
1455
|
+
headingSize?: '1' | '2' | '3' | '4' | '5' | '6' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | undefined | number;
|
|
1456
|
+
};
|
|
1457
|
+
type TitleWithSubtitleProps = {
|
|
1458
|
+
/** Content van de title */
|
|
1459
|
+
titleTxt: string;
|
|
1460
|
+
/** Content van de subtitle */
|
|
1461
|
+
subtitleTxt: string;
|
|
1462
|
+
/** De bulma-grootte die gebruikt wordt */
|
|
1463
|
+
bulmaSize?: '1' | '2' | '3' | '4' | '5' | '6' | number;
|
|
1464
|
+
/** De heading grootte: h1, h2, h3, h4, h5 of h6 */
|
|
1465
|
+
headingSize?: '1' | '2' | '3' | '4' | '5' | '6' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | undefined | number;
|
|
1466
|
+
/** (optional) Classes op de omringende container */
|
|
1467
|
+
className?: string;
|
|
1468
|
+
};
|
|
1469
|
+
/**
|
|
1470
|
+
* Maak een heading. @see {@link TitleWithSubtitle} voor een combinatie met een subtitle.
|
|
1471
|
+
* @param props txt as string, size voor bulma (is-1 t/m is-6) en een heading-waarde (h1-h6)
|
|
1472
|
+
* @returns een heading (h1-h6) met class 'title'
|
|
1473
|
+
* @example
|
|
1474
|
+
* <Title txt="Default title" />
|
|
1475
|
+
* <Title txt="Title" bulmaSize={1} headingSize={4} />
|
|
1476
|
+
*/
|
|
1477
|
+
declare function Title(props: TitleProps): JSX.Element;
|
|
1478
|
+
/**
|
|
1479
|
+
* Maak een subtitle voor een heading. @see {@link TitleWithSubtitle} voor een combinatie van deze 2.
|
|
1480
|
+
* @param props text as string, size voor bulma (is-3 t/m is-6) en een heading-waarde (h2-h6)
|
|
1481
|
+
* @returns een heading (h1-h6) met class 'subtitle'.
|
|
1482
|
+
* @example
|
|
1483
|
+
* <Subtitle txt="Default subtitle" />
|
|
1484
|
+
* <Subtitle txt="Subtitle" bulmaSize={3} headingSize={4} />
|
|
1485
|
+
*/
|
|
1486
|
+
declare function Subtitle(props: SubtitleProps): JSX.Element;
|
|
1487
|
+
/**
|
|
1488
|
+
* Combineer een title en een subtitle
|
|
1489
|
+
* @param props titleTxt as string, subtitleTxt as string, bulmaSize as number (1-4) en headingSize as number (1-4)
|
|
1490
|
+
* De subtitle sizes worden +2 gedaan, dus bij title bulmaSize = 1 en headingSize = 3 (<h3 class="title is-1">) komt een subtitle van (<h6 class="subtitle is-4">)
|
|
1491
|
+
* @returns een title met daaronder een subtitle.
|
|
1492
|
+
* @example <TitleWithSubtitle titleTxt="Title" subtitleTxt="Subtitle" bulmaSize={1} headingSize={3} />
|
|
1493
|
+
*/
|
|
1494
|
+
declare function TitleWithSubtitle({ bulmaSize: bulmaSizeVal, headingSize, titleTxt, subtitleTxt, className, }: TitleWithSubtitleProps): JSX.Element;
|
|
1495
|
+
|
|
1496
|
+
type ToggleBarProps = {
|
|
1497
|
+
/** De beginwaarde (default = undefined)
|
|
1498
|
+
* Deze property wordt alleen voor ToggleItems gebruikt. voor OnOffToggleItems kan dat per item geset worden
|
|
1499
|
+
* Om een waarde van buitenaf te zete, gebruik je de 'value'-prop
|
|
1500
|
+
*/
|
|
1501
|
+
initialValue?: string;
|
|
1502
|
+
/** De beginwaarde, alsd ie van buitenaf aangepast mag worden. gebruik 'initialValue' voor alleen een beginwaarde */
|
|
1503
|
+
value?: string;
|
|
1504
|
+
/** ToggleItems */
|
|
1505
|
+
children: React$1.ReactNode;
|
|
1506
|
+
/** Callback voor toggelen */
|
|
1507
|
+
onToggle?: (toggledItem: string) => void;
|
|
1508
|
+
/** Zijn de randen afgerond of vierkant (default true) */
|
|
1509
|
+
rounded?: boolean;
|
|
1510
|
+
/** Alignment van de container */
|
|
1511
|
+
alignment?: AlignmentProp;
|
|
1512
|
+
/** Size van de buttons (default = 's') */
|
|
1513
|
+
size?: SizeProp;
|
|
1514
|
+
/** Color van de toggles (default = 's', success), (kan per item overschreven worden) */
|
|
1515
|
+
onColor?: ColorProp;
|
|
1516
|
+
/** Color van de toggles (default = 'd', danger), (kan per item overschreven worden) */
|
|
1517
|
+
offColor?: ColorProp;
|
|
1518
|
+
/** Zijn de toggles light of niet (default = true) */
|
|
1519
|
+
light?: boolean;
|
|
1520
|
+
/** Zijn de toggles outlined of niet (default = false) */
|
|
1521
|
+
outlined?: boolean;
|
|
1522
|
+
/** Extra classes voor de toggle-bar */
|
|
1523
|
+
className?: string;
|
|
1524
|
+
};
|
|
1525
|
+
type ToggleItemProps = {
|
|
1526
|
+
/** Content van een Toggle Item */
|
|
1527
|
+
children: React$1.ReactNode;
|
|
1528
|
+
/** Is dit item disabled? */
|
|
1529
|
+
disabled?: boolean;
|
|
1530
|
+
/** Selectie-naam voor dit toggle-item. ALs undefined wordt de children-string-content gebruikt */
|
|
1531
|
+
identifier?: string;
|
|
1532
|
+
/** Tooltip voor dit toggle-item */
|
|
1533
|
+
tooltip?: string;
|
|
1534
|
+
/** Color voor on-status */
|
|
1535
|
+
onColor?: ColorProp;
|
|
1536
|
+
/** Color voor off-status */
|
|
1537
|
+
offColor?: ColorProp;
|
|
1538
|
+
};
|
|
1539
|
+
type OnOffToggleItemProps = ToggleItemProps & {
|
|
1540
|
+
/** Set de initiele waarde van dit toggle item */
|
|
1541
|
+
toggled?: boolean;
|
|
1542
|
+
/** onToggle callback, deze 'cancelt' de OnToggle van de <ItemToggleBar> voor dit item */
|
|
1543
|
+
onToggle?: (on: boolean, item: string) => void;
|
|
1544
|
+
};
|
|
1545
|
+
/**
|
|
1546
|
+
* Een groep van bij-elkaar-horende buttons waar er maar 1 van actief kan zijn.
|
|
1547
|
+
* Om elk toggle-item APART te kunnen togglen, gebruik je de ItemToggleBar Component
|
|
1548
|
+
* @param props
|
|
1549
|
+
* @returns een Toggle bar
|
|
1550
|
+
* @example
|
|
1551
|
+
* <ToggleBar onToggle={handleToggle} initialValue={calendarView}>
|
|
1552
|
+
* <ToggleBar.Item>WeekView</ToggleBar.Item>
|
|
1553
|
+
* <ToggleBar.Item>MonthView</ToggleBar.Item>
|
|
1554
|
+
* </ToggleBar>
|
|
1555
|
+
*
|
|
1556
|
+
* <ToggleBar >
|
|
1557
|
+
* <ToggleBar.OnOffItem onToggle={handleToggle2} identifier="1">
|
|
1558
|
+
* Toggle 2
|
|
1559
|
+
* </ToggleBar.OnOffItem>
|
|
1560
|
+
* <ToggleBar.OnOffItem toggled={true} onToggle={handleToggle3} identifier="2">
|
|
1561
|
+
* Toggle 3
|
|
1562
|
+
* </ToggleBar.OnOffItem>
|
|
1563
|
+
* </ToggleBar>
|
|
1564
|
+
*/
|
|
1565
|
+
declare const ToggleBar: {
|
|
1566
|
+
(props: ToggleBarProps): JSX.Element;
|
|
1567
|
+
/**
|
|
1568
|
+
* Item binnen de ToggleBar. Een van de ToggleItems in een ToggleBar kan maar actief zijn.
|
|
1569
|
+
* @param props
|
|
1570
|
+
* @returns een item in de togglebar waarvan er maar 1 actief kan zijn
|
|
1571
|
+
* @example <ToggleBar.Item>Item 2</ToggleBar.Item>
|
|
1572
|
+
*/
|
|
1573
|
+
Item: (props: ToggleItemProps) => JSX.Element;
|
|
1574
|
+
/**
|
|
1575
|
+
* Een zelf-toggelend item in een ToggleBar. OnOffToggleItems regelen zelf de toggle-state.
|
|
1576
|
+
* @param props
|
|
1577
|
+
* @returns een losstaand toggle-baar item.
|
|
1578
|
+
* @example <ToggleBar.OnoffItem onToggle={handleToggle} identifier="1">Toggle 1</ToggleBar.OnoffItem>
|
|
1579
|
+
*/
|
|
1580
|
+
OnOffItem: (props: OnOffToggleItemProps) => JSX.Element;
|
|
1581
|
+
};
|
|
1582
|
+
|
|
1583
|
+
type ButtonGroupProps = {
|
|
1584
|
+
/** Een buttongroup kan alleen Buttons als children hebben! */
|
|
1585
|
+
children?: React$1.ReactNode;
|
|
1586
|
+
/** Moeten de buttons aan elkaar vast gezet worden (default = false) */
|
|
1587
|
+
hasAddons?: boolean;
|
|
1588
|
+
/** Aan welke kant moeten de buttons aligned worden (default = l) */
|
|
1589
|
+
alignment?: AlignmentProp | undefined;
|
|
1590
|
+
/** Voeg extra classes aan de buttons-container toe */
|
|
1591
|
+
className?: string;
|
|
1592
|
+
};
|
|
1593
|
+
/**
|
|
1594
|
+
* Groupeer buttons in een groep. Ze krijgen allemala dezelfde grootte en worden als gewenst anders aligned.
|
|
1595
|
+
* Een ButtonGroup mag ALLEEN buttons bevatten!
|
|
1596
|
+
* sizes: small, medium, large
|
|
1597
|
+
* alignment: l(eft), c(entered), r(ight)
|
|
1598
|
+
* merge: voeg de buttons samen tot een buttonbar
|
|
1599
|
+
* @param props
|
|
1600
|
+
* @returns een button groep
|
|
1601
|
+
* @example
|
|
1602
|
+
* <ButtonGroup hasAddons alignment="r">
|
|
1603
|
+
* <Button>Left</Button>
|
|
1604
|
+
* <Button>Middle</Button>
|
|
1605
|
+
* <Button>Right</Button>
|
|
1606
|
+
* </ButtonGroup>
|
|
1607
|
+
*/
|
|
1608
|
+
declare const ButtonGroup: ({ children, hasAddons, alignment, className }: ButtonGroupProps) => JSX.Element;
|
|
1609
|
+
|
|
1610
|
+
type ButtonTypes = 'button' | 'submit' | 'reset' | undefined;
|
|
1611
|
+
type ButtonStyles = 'static' | 's' | 'light' | 'l' | 'outlined' | 'o' | 'inverted' | 'i' | 'light-outlined' | 'lo' | 'default';
|
|
1612
|
+
type ButtonProps = {
|
|
1613
|
+
/** Is de button loading ? */
|
|
1614
|
+
loading?: boolean | undefined;
|
|
1615
|
+
/** Heeft de button afgeronde hoeken ? */
|
|
1616
|
+
rounded?: boolean | undefined;
|
|
1617
|
+
/** Wat moet er op de button komen (text, icons etc.) */
|
|
1618
|
+
children?: ReactNode;
|
|
1619
|
+
/** Button type: <button type="..."> */
|
|
1620
|
+
type?: ButtonTypes;
|
|
1621
|
+
/** Styling voor de button */
|
|
1622
|
+
styling?: ButtonStyles;
|
|
1623
|
+
/** De grootte van de button */
|
|
1624
|
+
size?: SizeProp;
|
|
1625
|
+
/** Is de buttton disabled? */
|
|
1626
|
+
disabled?: boolean | undefined;
|
|
1627
|
+
/** Een tooltip voor de button */
|
|
1628
|
+
tooltip?: string;
|
|
1629
|
+
/** ID voor de button (id="...") */
|
|
1630
|
+
id?: string;
|
|
1631
|
+
/** Function voor onclick event */
|
|
1632
|
+
onClick?(e: MouseEvent): void;
|
|
1633
|
+
};
|
|
1634
|
+
type BaseButtonProps = ButtonProps & {
|
|
1635
|
+
/** De kleur van de button */
|
|
1636
|
+
color?: ColorProp;
|
|
1637
|
+
};
|
|
1638
|
+
|
|
1639
|
+
/**
|
|
1640
|
+
* Button is helemaal instelbaar. Maak de button. Alle button instellingen worden hier verwerkt.
|
|
1641
|
+
* @param props
|
|
1642
|
+
* @returns een default button
|
|
1643
|
+
* @example <Button>Button</Button>
|
|
1644
|
+
* @description Alle mogelijke props voor de Button-component
|
|
1645
|
+
* | Prop | Value | Default | Description |
|
|
1646
|
+
* |----------|-------------------------|----------|-----------------------------------------|
|
|
1647
|
+
* | children | | | De content van de button (icon, text) |
|
|
1648
|
+
* | color | `p`, `l`, `i`, `w`, `d`,| `p` | Kleuren voor de button |
|
|
1649
|
+
* | | `s`, `is-${string}` | | |
|
|
1650
|
+
* | styling | `l` , light | | Light style voor de button |
|
|
1651
|
+
* | | `o` , outlined | | Outlined style voor de button |
|
|
1652
|
+
* | | `i` , inverted | | Inverted style voor de button |
|
|
1653
|
+
* | | `lo`, light-outlined | | Light & outlined style voor de button |
|
|
1654
|
+
* | | `s` , static | | static style voor de button (grey) |
|
|
1655
|
+
* | size | `s, m, l, xl` | | sizes voor de button |
|
|
1656
|
+
* | rounded | `true, false` | `false` | Afgeronde hoeken voor de button |
|
|
1657
|
+
* | loading | `true, false` | `false` | heeft button de loading state |
|
|
1658
|
+
* | disabled | `true, false` | `false` | is de button disabled |
|
|
1659
|
+
* | tooltip | string | | tooltip voor de button |
|
|
1660
|
+
* | id | string | | id voor de button |
|
|
1661
|
+
* | onClick | function | | onClick voor de button |
|
|
1662
|
+
* | type | `button, reset, submit` | `button` | type 'button' voor de button |
|
|
1663
|
+
*/
|
|
1664
|
+
declare const Button: {
|
|
1665
|
+
({ color, size, rounded, loading, disabled, type, styling, onClick, children: chldrn, tooltip, id, }: BaseButtonProps): JSX.Element;
|
|
1666
|
+
/**
|
|
1667
|
+
* Een Static Button
|
|
1668
|
+
* Een static button is niet interactief, maar wordt bijvoorbeeld gebruikt als scheiding voor add-ons
|
|
1669
|
+
* @example <Button.Static>Static Button</Button.Static>
|
|
1670
|
+
*/
|
|
1671
|
+
Static(props: ButtonProps): JSX.Element;
|
|
1672
|
+
/** Een Button in de primary kleur
|
|
1673
|
+
* @example <Button.Primary>Primary Button</Button.Primary>
|
|
1674
|
+
*/
|
|
1675
|
+
Primary(props: ButtonProps): JSX.Element;
|
|
1676
|
+
/** Een Button in de success kleur
|
|
1677
|
+
* @example <Button.Success>Success Button</Button.Success>
|
|
1678
|
+
*/
|
|
1679
|
+
Success(props: ButtonProps): JSX.Element;
|
|
1680
|
+
/** Een Button in de danger kleur
|
|
1681
|
+
* @example <Button.Danger>Danger Button</Button.Danger>
|
|
1682
|
+
*/
|
|
1683
|
+
Danger(props: ButtonProps): JSX.Element;
|
|
1684
|
+
/** Een Button in de warning kleur
|
|
1685
|
+
* @example <Button.Warning>Warning Button</Button.Warning>
|
|
1686
|
+
*/
|
|
1687
|
+
Warning(props: ButtonProps): JSX.Element;
|
|
1688
|
+
/** Een Button in de info kleur
|
|
1689
|
+
* @example <Button.Info>Info Button</Button.Info>
|
|
1690
|
+
*/
|
|
1691
|
+
Info(props: ButtonProps): JSX.Element;
|
|
1692
|
+
/** Een Button in de link kleur
|
|
1693
|
+
* @example <Button.Link>Link Button</Button.Link>
|
|
1694
|
+
*/
|
|
1695
|
+
Link(props: ButtonProps): JSX.Element;
|
|
1696
|
+
};
|
|
1697
|
+
|
|
1698
|
+
type LinkButtonProps = {
|
|
1699
|
+
/** De content van de button */
|
|
1700
|
+
children?: React$1.ReactNode;
|
|
1701
|
+
/** `onClick` voor de button */
|
|
1702
|
+
onClick: (e: any) => any | void;
|
|
1703
|
+
/** Een tooltip voor de button */
|
|
1704
|
+
tooltip?: string;
|
|
1705
|
+
id?: string;
|
|
1706
|
+
};
|
|
1707
|
+
/**
|
|
1708
|
+
* Een button die er uit ziet als een link. Om een link te maken met een onClick() ipv een href.
|
|
1709
|
+
* @param props
|
|
1710
|
+
* @returns een button die er uit ziet als een link
|
|
1711
|
+
* @example <LinkButton onClick={handleClick}>Click me!</LinkButton>
|
|
1712
|
+
*/
|
|
1713
|
+
declare const LinkButton: ({ children, onClick, tooltip, id }: LinkButtonProps) => JSX.Element;
|
|
1714
|
+
type LinkProps = {
|
|
1715
|
+
/** link / URL */
|
|
1716
|
+
href: string;
|
|
1717
|
+
/** open target
|
|
1718
|
+
* - `default`: _blank
|
|
1719
|
+
* - `string`: naam van een <iframe>
|
|
1720
|
+
*/
|
|
1721
|
+
target?: '_blank' | '_self' | '_parent' | '_top' | string;
|
|
1722
|
+
/** Relatie tussen het huidige document en het gelinkte document */
|
|
1723
|
+
rel?: 'alternat' | 'author' | 'bookmark' | 'external' | 'help' | 'license' | 'next' | 'nofollow' | 'noreferrer' | 'noopener' | 'prev' | 'search' | 'tag';
|
|
1724
|
+
/** MIME type van een evt download */
|
|
1725
|
+
type?: string;
|
|
1726
|
+
/** De taal van het gelinkte document */
|
|
1727
|
+
hreflang?: string;
|
|
1728
|
+
/** Is dit een downloadlink? */
|
|
1729
|
+
download?: boolean;
|
|
1730
|
+
/** De inhoud van de link: wat is er te lezen / zien */
|
|
1731
|
+
children?: React$1.ReactNode;
|
|
1732
|
+
/** Een tooltip voor de button */
|
|
1733
|
+
tooltip?: string;
|
|
1734
|
+
id?: string;
|
|
1735
|
+
};
|
|
1736
|
+
/**
|
|
1737
|
+
* Een link (duh) die er hetzelfde uit ziet als de linkbutton.
|
|
1738
|
+
* @param props
|
|
1739
|
+
* @returns een link
|
|
1740
|
+
* @example <Link href="https://www.google.com">Google</Link>
|
|
1741
|
+
*/
|
|
1742
|
+
declare const Link: ({ href, target, tooltip, id, rel, children }: LinkProps) => JSX.Element;
|
|
1743
|
+
|
|
1744
|
+
/** type equal to Intl.DateTimeFormatOptions, but with a typed timeZone */
|
|
1745
|
+
type JSDateTimeFormatOptions = Intl.DateTimeFormatOptions & {
|
|
1746
|
+
timeZone?: JSDateTimeZoneType;
|
|
1747
|
+
};
|
|
1748
|
+
/** Type used for setting values in a JSDateTime */
|
|
1749
|
+
type JSDateSetterType = {
|
|
1750
|
+
/** Set the year value to ... */ year?: number;
|
|
1751
|
+
/** Set the month value to ... (1 - 12, 0 automatic to 1)*/ month?: number;
|
|
1752
|
+
/** Set the day value to ... (1 - 31) */ day?: number;
|
|
1753
|
+
/** Set the hour value to ... (0 - 23) */ hour?: number;
|
|
1754
|
+
/** Set the minute value to ... (0 - 59) */ minute?: number;
|
|
1755
|
+
/** Set the second value to ... (0 - 59) */ second?: number;
|
|
1756
|
+
/** Set the millisecond value to ... (0 - 999) */ millisecond?: number;
|
|
1757
|
+
};
|
|
1758
|
+
/** Type used for changing values in a JSDateTime */
|
|
1759
|
+
type JSChangeDateTimeType = {
|
|
1760
|
+
/** Number of years to add or subtract */ years?: number;
|
|
1761
|
+
/** Number of months to add or subtract */ months?: number;
|
|
1762
|
+
/** Number of weeks to add or subtract */ weeks?: number;
|
|
1763
|
+
/** Number of days to add or subtract */ days?: number;
|
|
1764
|
+
/** Number of hours to add or subtract */ hours?: number;
|
|
1765
|
+
/** Number of minutes to add or subtract */ minutes?: number;
|
|
1766
|
+
/** Number of seconds to add or subtract */ seconds?: number;
|
|
1767
|
+
/** Number of milliseconds to add or subtract */ milliseconds?: number;
|
|
1768
|
+
};
|
|
1769
|
+
type JSDateTimeInfoType = {
|
|
1770
|
+
year: JSDateTimeYearInfoType;
|
|
1771
|
+
month: JSDateTimeMonthInfoType;
|
|
1772
|
+
};
|
|
1773
|
+
type JSDateTimeYearInfoType = JSDateTimeMonthInfoType & {
|
|
1774
|
+
isLeapYear: boolean;
|
|
1775
|
+
};
|
|
1776
|
+
type JSDateTimeMonthInfoType = {
|
|
1777
|
+
days: number;
|
|
1778
|
+
hours: number;
|
|
1779
|
+
minutes: number;
|
|
1780
|
+
seconds: number;
|
|
1781
|
+
milliseconds: number;
|
|
1782
|
+
};
|
|
1783
|
+
/**
|
|
1784
|
+
* @class JSDateTime
|
|
1785
|
+
* @summary
|
|
1786
|
+
* JSDateTime is een class voor het werken met datum & tijd in JavaScript. Elk JSDateTime object is een immutable object.
|
|
1787
|
+
* Het is niet echt een vervanging voor andere Datum-libraries, maar meer een kleine wrapper rond gewone Javascript Dates, want Dates gebruiken is lastig.
|
|
1788
|
+
* Kijk onder de description-tag van deze uitleg wat de functies zijn.
|
|
1789
|
+
*
|
|
1790
|
+
* @example // creating JSDateTime - all methods return a NEW JSDateTime object
|
|
1791
|
+
* const date1 = JSDateTime.now(); // timestamp of now
|
|
1792
|
+
* const date2 = JSDateTime.fromISO('2020-01-01T00:00:00.000Z'); // 01-01-2020
|
|
1793
|
+
* const date3 = JSDateTime.fromDate(new Date()); // timestamp of now
|
|
1794
|
+
* const date4 = JSDateTime.fromMillis(0); // 01-01-1970
|
|
1795
|
+
* const date5 = JSDateTime.from({ year: 2020, month: 1, day: 1 }) // 01-01-2020
|
|
1796
|
+
*
|
|
1797
|
+
* @example // changing & chaining JSDateTime - All methods return a NEW JSDateTime object
|
|
1798
|
+
* const date1 = JSDateTime.fromISO('2020-06-01T00:00:00.000Z'); // date1: 01-06-2020
|
|
1799
|
+
* const date2 = date1.set({ year: 2022, month: 1, day: 1 }); // date2: 01-06-2022, date1: 01-06-2020
|
|
1800
|
+
* const date3 = date1.plus({ years: 2, days: 15 }); // date3: 16-06-2022, date1: 01-06-2020
|
|
1801
|
+
* const date4 = date1.startOf('year'); // date4: 01-01-2020, date1: 01-06-2020
|
|
1802
|
+
* const date5 = date1.endOf('year').startOf('month') // date5: 01-12-2020, date1: 01-06-2020
|
|
1803
|
+
*
|
|
1804
|
+
* @example // formatting dates
|
|
1805
|
+
* const date = JSDateTime.from({year: 2022, month: 6, day: 18}); // date: 18-06-2022
|
|
1806
|
+
* date.ISO; // 2020-06-18T00:00:00.000Z
|
|
1807
|
+
* date.UTC // Mon, 18 Jul 2022 07:14:08 GMT
|
|
1808
|
+
* date.timeHM; // 07:14
|
|
1809
|
+
* date.timeHMS; // 07:14:08
|
|
1810
|
+
* date.monthLong; // Juli
|
|
1811
|
+
* date.monthShort; // Jul
|
|
1812
|
+
* date.dayLong; // Monday
|
|
1813
|
+
* date.dayShort; // Mon
|
|
1814
|
+
* date.toFormat('yyyy-MM-dd'); // 2020-01-01
|
|
1815
|
+
*
|
|
1816
|
+
* @example // comparing JSDateTimes
|
|
1817
|
+
* const date1 = JSDateTime.now(); // date1: 18-06-2022
|
|
1818
|
+
* const date2 = JSDateTime.epoch(); // date2: 01-01-1970
|
|
1819
|
+
* date1.isBetween(new Date(1970,0,1), new Date(2222, 0,1)) // true
|
|
1820
|
+
* date1.isBetween(JSDateTime.fromDate(new Date(1970,0,1), JSDateTime.fromDate(new Date(1900, 0, 1)))) // false
|
|
1821
|
+
* date1.isAfter(new Date(1970,0,1)) // true
|
|
1822
|
+
* date1.isBefore(new Date(2222, 0,1)) // true
|
|
1823
|
+
* date1.hasSame(new Date(2020, 0, 1), 'year') // true
|
|
1824
|
+
* date1.hasSame(new Date(2020, 0, 1), 'month') // false
|
|
1825
|
+
* const beforeEpoch: boolean = date2 < date1; // true
|
|
1826
|
+
*
|
|
1827
|
+
* @description Static values & methods on JSDateTime - used for creating JSDateTimes
|
|
1828
|
+
* | Value / Method | Description |
|
|
1829
|
+
* |------------------------|------------------------------------------------------------------------------------|
|
|
1830
|
+
* | `defaultLocale` | Default locale to use. Based on client locale |
|
|
1831
|
+
* | `defaultTimeZone` | Default Timezone to use. Based on client timezone |
|
|
1832
|
+
* | `MAX_DATE` | (readonly) Max and Min date as Date that can be used in JSDateTime |
|
|
1833
|
+
* | `MAX_DATE_NUM` | (readonly) Max and Min millis from 01-01-1970 00:00:00 that can be used |
|
|
1834
|
+
* | `defaultFormatOptions` | (readonly) Default format options to use when formatting dates |
|
|
1835
|
+
* | `fromISO()` | Creates a new JSDateTime from an ISO string. |
|
|
1836
|
+
* | `fromUTC()` | Creates a new JSDateTime from a UTC string. |
|
|
1837
|
+
* | `fromDate()` | Creates a new JSDateTime from a Date object. |
|
|
1838
|
+
* | `fromMillis()` | Creates a new JSDateTime based on milliseconds since 01-01-1970 00:00:00 |
|
|
1839
|
+
* | `from({})` | Creates a new JSDateTime object from a set of values. |
|
|
1840
|
+
* | `now()` | Creates a new JSDateTime object from the current timestamp. |
|
|
1841
|
+
* | `epoch()` | Creates a new JSDateTime on 01-01-1970 00:00:00. |
|
|
1842
|
+
*
|
|
1843
|
+
* @description values & methods on JSDateTime instances - used for changing, chaining and comparing JSDateTimes
|
|
1844
|
+
* | Value / Method | returns | type | Description |
|
|
1845
|
+
* |--------------------------|--------------|------------|-----------------------------------------------------------------------|
|
|
1846
|
+
* | `valueOf()` | `number ` | `(method)` |Returns the number of milliseconds since 01-01-1970 00:00:00 |
|
|
1847
|
+
* | `isLeapYear` | `boolean` | `(get)` |Returns true if the year is a leap year |
|
|
1848
|
+
* | `isAM` | `boolean` | `(get)` |Returns true if the time is AM |
|
|
1849
|
+
* | `isPM` | `boolean` | `(get)` |Returns true if the time is PM |
|
|
1850
|
+
* | `isDST` | `boolean` | `(get)` |Returns true if the time is in DST |
|
|
1851
|
+
* | `JSDate` | `Date ` | `(get)` |Returns the Date as a Javascript Date |
|
|
1852
|
+
* | `ISO` | `string ` | `(get)` |Returns the date as an ISO string |
|
|
1853
|
+
* | `UTC` | `string ` | `(get)` |Returns the date as an UTC string |
|
|
1854
|
+
* | `locale` | `string ` | `(get)` |Returns the locale used for formatting |
|
|
1855
|
+
* | `timeZoneLong` | `string ` | `(get)` |Returns a long timezone name (Central European Standard Time) |
|
|
1856
|
+
* | `timeZoneShort` | `string ` | `(get)` |Returns a short timezone name (CEST) |
|
|
1857
|
+
* | `timezoneOffsetLongStr` | `number ` | `(get)` |Returns the timezone offset as a long string (GMT+02:00) |
|
|
1858
|
+
* | `timezoneOffsetShortStr` | `string ` | `(get)` |Returns the timezone offset as a long string (+02:00) |
|
|
1859
|
+
* | `timezoneOffset` | `number ` | `(get)` |Returns the timezone offset as a number |
|
|
1860
|
+
* | `timeHM` | `string ` | `(get)` |Returns the time as a string (07:14) |
|
|
1861
|
+
* | `timeHMS` | `string ` | `(get)` |Returns the time as a string (07:14:08) |
|
|
1862
|
+
* | `monthLong` | `string ` | `(get)` |Returns the month as a long string (January) |
|
|
1863
|
+
* | `monthShort` | `string ` | `(get)` |Returns the month as a short string (Jan) |
|
|
1864
|
+
* | `dayLong` | `string ` | `(get)` |Returns the day as a long string (Monday) |
|
|
1865
|
+
* | `dayShort` | `string ` | `(get)` |Returns the day as a short string (Mon) |
|
|
1866
|
+
* | `dateLong` | `string ` | `(get)` |Returns the date as a long string (friday 7 september 1990) |
|
|
1867
|
+
* | `dateShort` | `string ` | `(get)` |Returns the date as a short string (07-09-1990) |
|
|
1868
|
+
* | `yr`, `year` | `number ` | `(get)` |Returns the year |
|
|
1869
|
+
* | `qr`, `quarter` | `number ` | `(get)` |Returns the quarter |
|
|
1870
|
+
* | `m`, `month` | `number ` | `(get)` |Returns the month |
|
|
1871
|
+
* | `d`, `day` | `number ` | `(get)` |Returns the number of the day in the month |
|
|
1872
|
+
* | `h`, `hour` | `number ` | `(get)` |Returns the hour |
|
|
1873
|
+
* | `min`, `minute` | `number ` | `(get)` |Returns the minute |
|
|
1874
|
+
* | `s`, `second` | `number ` | `(get)` |Returns the second |
|
|
1875
|
+
* | `ms`, `millisecond` | `number ` | `(get)` |Returns the millisecond |
|
|
1876
|
+
* | `weekNr` | `number ` | `(get)` |Returns the week number |
|
|
1877
|
+
* | `daysInMonth` | `number ` | `(get)` |Returns the number of days in the month |
|
|
1878
|
+
* | `daysInYear` | `number ` | `(get)` |Returns the number of days in the year |
|
|
1879
|
+
* | `millis` | `number ` | `(get)` |Returns the number of milliseconds since 01-01-1970 00:00:00 |
|
|
1880
|
+
* | `yearToDate` | `number ` | `(get)` |Returns the number of days since the start of the year |
|
|
1881
|
+
* | `set()` | `JSDateTime` | `(method)` |Sets the date and time from a set of values. |
|
|
1882
|
+
* | `startOf()` | `JSDateTime` | `(method)` |Sets the date and time to the start of the given unit. |
|
|
1883
|
+
* | `endOf()` | `JSDateTime` | `(method)` |Sets the date and time to the end of the given unit. |
|
|
1884
|
+
* | `plus()` | `JSDateTime` | `(method)` |Adds a set of values to the date and time. |
|
|
1885
|
+
* | `isBetween()` | `boolean` | `(method)` |true if this JSDateTime is between the given dates. |
|
|
1886
|
+
* | `hasSame()` | `boolean` | `(method)` |true if this JSDateTime has te same value for the period (same year, same month, same day, etc). See `hasSame()` description for more |
|
|
1887
|
+
* | `isAfter()` | `boolean` | `(method)` |true if this JSDateTime is after the given date. |
|
|
1888
|
+
* | `isBefore()` | `boolean` | `(method)` |true if this JSDateTime is before the given date. |
|
|
1889
|
+
* | `toFormat()` | `string` | `(method)` |Returns the date and time as a string using the given format. See `toFormat()` description for more |
|
|
1890
|
+
* | `toString()` | `string` | `(method)` |Returns the date and time as a string using the default Intl.DateTimeFormat. See `toString()` description for more |
|
|
1891
|
+
*/
|
|
1892
|
+
declare class JSDateTime {
|
|
1893
|
+
/** Default locale for JSDateTime classes, based on clients browser & location */
|
|
1894
|
+
static defaultLocale: string;
|
|
1895
|
+
/** Default Timezone for JSDateTime classes, based on clients browser & location */
|
|
1896
|
+
static defaultTimezone: JSDateTimeZoneType;
|
|
1897
|
+
/** Max number of millies since epoch (01-01-1970) or before epoch */
|
|
1898
|
+
static readonly MAX_DATE_NUM = 8640000000000000;
|
|
1899
|
+
/** Max date based on @see MAX_DATE_NUM */
|
|
1900
|
+
static readonly MAX_DATE: Date;
|
|
1901
|
+
/** Default formatting options for JSDateTime */
|
|
1902
|
+
private static readonly defaultFormatOptions;
|
|
1903
|
+
private readonly IGNORE_SIGN;
|
|
1904
|
+
/** Date on this JSDateTime object. everything based on this one */
|
|
1905
|
+
protected readonly _date: Date;
|
|
1906
|
+
/** Setted locale on this JSDateTime */
|
|
1907
|
+
protected readonly _locale: string;
|
|
1908
|
+
/** Setted format options on this JSDateTime */
|
|
1909
|
+
private readonly formatOptions;
|
|
1910
|
+
protected constructor(date: Date, locale: string, formatOptions?: JSDateTimeFormatOptions);
|
|
1911
|
+
/** @returns datetime string based on the default format options of this JSDateTime */
|
|
1912
|
+
toString(formatOptions?: JSDateTimeFormatOptions): string;
|
|
1913
|
+
/** To compare JSDates with each other with <, >, <= and >= @returns nu,ber of milliseconds since epoch */
|
|
1914
|
+
valueOf(): number;
|
|
1915
|
+
/**
|
|
1916
|
+
* Use DateTimeFormat to get a date string
|
|
1917
|
+
* @param dtfOptions
|
|
1918
|
+
* @return
|
|
1919
|
+
*/
|
|
1920
|
+
private intlDtf;
|
|
1921
|
+
/** @return Information about this date's year or month. Information like numver of days, hours, etc */
|
|
1922
|
+
get info(): JSDateTimeInfoType;
|
|
1923
|
+
/** @return Is JSDateTime in a leap-year (true/false) */
|
|
1924
|
+
get isLeapYear(): boolean;
|
|
1925
|
+
/** @return Is JSDateTime AM (true) or PM (false) */
|
|
1926
|
+
get isAM(): boolean;
|
|
1927
|
+
/** @return Is JSDateTime AM (false) or PM (true) */
|
|
1928
|
+
get isPM(): boolean;
|
|
1929
|
+
/** @returns Is DST (Daylight Saving Time) observed */
|
|
1930
|
+
get isDST(): boolean;
|
|
1931
|
+
/** @returns Is this JSDateTime today? */
|
|
1932
|
+
get isToday(): boolean;
|
|
1933
|
+
/** @return JSDate-date as Javascript Date object */
|
|
1934
|
+
get JSDate(): Date;
|
|
1935
|
+
/** @return Date as ISO string ('1990-09-07T12:30:55.666Z') */
|
|
1936
|
+
get ISO(): string;
|
|
1937
|
+
/** @return Date as UTC string ('Fri, 08 Jul 2022 13:34:47 GMT') */
|
|
1938
|
+
get UTC(): string;
|
|
1939
|
+
/** @return The locale ('nl-NL') */
|
|
1940
|
+
get locale(): string;
|
|
1941
|
+
/** @return A long timezone description (Midden-Europese zomertijd, Australian Standard Time) */
|
|
1942
|
+
get timezoneLong(): string;
|
|
1943
|
+
/** @return A short timezone descriptn (CEST, CET, AEST) */
|
|
1944
|
+
get timezoneShort(): string;
|
|
1945
|
+
/** @return Current timezone offset as a string (+02:00) */
|
|
1946
|
+
get timezoneOffsetShortStr(): string;
|
|
1947
|
+
/** @return Current timezone offset as a string (GMT+02:00) */
|
|
1948
|
+
get timezoneOffsetLongStr(): string;
|
|
1949
|
+
/** @return Current timezone offset (+2) */
|
|
1950
|
+
get timezoneOffset(): number;
|
|
1951
|
+
/** @return A time string (12:30) */
|
|
1952
|
+
get timeHM(): string;
|
|
1953
|
+
/** @return A time string (12:30:45) */
|
|
1954
|
+
get timeHMS(): string;
|
|
1955
|
+
/** @return The whole month name (september) */
|
|
1956
|
+
get monthLong(): string;
|
|
1957
|
+
/** @return An abbreviated month name (sep) */
|
|
1958
|
+
get monthShort(): string;
|
|
1959
|
+
/** @return The whole day name (friday) */
|
|
1960
|
+
get dayLong(): string;
|
|
1961
|
+
/** @return An abbreviated day name (fri) */
|
|
1962
|
+
get dayShort(): string;
|
|
1963
|
+
/** @return A long date string (friday 7 september 1990) */
|
|
1964
|
+
get dateLong(): string;
|
|
1965
|
+
/** @return A short date string (07-09-1990) */
|
|
1966
|
+
get dateShort(): string;
|
|
1967
|
+
/** @return Year (1990) */
|
|
1968
|
+
get yr(): number;
|
|
1969
|
+
/** @return Year (1990) */
|
|
1970
|
+
get year(): number;
|
|
1971
|
+
/** @return Quarter (1990) */
|
|
1972
|
+
get qr(): number;
|
|
1973
|
+
/** @return Quearter (1990) */
|
|
1974
|
+
get quarter(): number;
|
|
1975
|
+
/** @return Month number (1-12) */
|
|
1976
|
+
get m(): number;
|
|
1977
|
+
/** @return Month number (1-12) */
|
|
1978
|
+
get month(): number;
|
|
1979
|
+
get d(): number;
|
|
1980
|
+
/** @return Day of the month number (1-31) */
|
|
1981
|
+
get day(): number;
|
|
1982
|
+
/** @return Day of the week number (1-7, ma = 1, di = 2, ... zo = 7) */
|
|
1983
|
+
get weekDay(): number;
|
|
1984
|
+
/** @return Hour (0-23) */
|
|
1985
|
+
get hr(): number;
|
|
1986
|
+
/** @return Hour (0-23) */
|
|
1987
|
+
get hour(): number;
|
|
1988
|
+
/** @return Minute (0-59) */
|
|
1989
|
+
get min(): number;
|
|
1990
|
+
/** @return Minute (0-59) */
|
|
1991
|
+
get minute(): number;
|
|
1992
|
+
/** @return Second (0-59) */
|
|
1993
|
+
get sec(): number;
|
|
1994
|
+
/** g@return Second (0-59) */
|
|
1995
|
+
get second(): number;
|
|
1996
|
+
/** @return MilliSecond (0-999) */
|
|
1997
|
+
get ms(): number;
|
|
1998
|
+
/** @return MilliSecond (0-999) */
|
|
1999
|
+
get millisecond(): number;
|
|
2000
|
+
/** @return Week number (1-53) */
|
|
2001
|
+
get weekNr(): number;
|
|
2002
|
+
/** @return Number of milliseconds since epoch (01-01-1970 00:00:00) */
|
|
2003
|
+
get millis(): number;
|
|
2004
|
+
/** @return Number of days in a month (28, 29, 30 or 31) */
|
|
2005
|
+
get daysInMonth(): number;
|
|
2006
|
+
/** @return Number of days in year of this JSDateTime */
|
|
2007
|
+
get daysInYear(): number;
|
|
2008
|
+
get yearToDate(): number;
|
|
2009
|
+
/**
|
|
2010
|
+
* Return a new JSDateTime object with the given data, based on this JSDateTime object.
|
|
2011
|
+
* The old value is NOT changed
|
|
2012
|
+
* @param val the new values. if no values are given, the current values are used
|
|
2013
|
+
* @param locale a new locale, if not given, the current locale is used
|
|
2014
|
+
* @return a new JSDateTime with updated values
|
|
2015
|
+
* @example
|
|
2016
|
+
* const date = JSDateTime.fromDate(new Date(2020, 0, 1)); // 01-01-2020
|
|
2017
|
+
* const date2 = date.set({year: 1990, month: 12, day: 1}); // 01-12-1990
|
|
2018
|
+
*/
|
|
2019
|
+
set(val: JSDateSetterType, locale?: string): JSDateTime;
|
|
2020
|
+
/**
|
|
2021
|
+
* Returns a new JSDateTime object where the date is set to the start of a period.
|
|
2022
|
+
* The old value is NOT changed
|
|
2023
|
+
* @param period the period
|
|
2024
|
+
* @return a new readonly JSDateTime object
|
|
2025
|
+
* @example
|
|
2026
|
+
* const date = JSDateTime.fromDate(new Date(2020, 11, 31)); // 31-12-2020
|
|
2027
|
+
* const date2 = date.startof('year'); // 01-01-2020
|
|
2028
|
+
*/
|
|
2029
|
+
startOf(period: 'year' | 'quarter' | 'month' | 'week' | 'day' | 'hour'): JSDateTime;
|
|
2030
|
+
/**
|
|
2031
|
+
* Returns a new JSDateTime object where the date is set to the end of a period.
|
|
2032
|
+
* The old value is NOT changed.
|
|
2033
|
+
* @param period the period
|
|
2034
|
+
* @return a new readonly JSDateTime object
|
|
2035
|
+
* @example
|
|
2036
|
+
* const date = JSDateTime.fromDate(new Date(2020, 0, 1)); // 01-01-2020
|
|
2037
|
+
* const date2 = date.endOf('year'); // 31-12-2020
|
|
2038
|
+
*/
|
|
2039
|
+
endOf(period: 'year' | 'quarter' | 'month' | 'week' | 'day' | 'hour'): JSDateTime;
|
|
2040
|
+
/**
|
|
2041
|
+
* Add values to a date. Starting with the biggest unit (year) to the smallest (millisecond).
|
|
2042
|
+
* The old value is NOT changed.
|
|
2043
|
+
* @param addVals object with values to add to the date
|
|
2044
|
+
* @return a new readonly JSDateTime object
|
|
2045
|
+
* @example
|
|
2046
|
+
* const date = JSDateTime.fromDate(new Date(2020, 0, 1)); // 01-01-2020
|
|
2047
|
+
* const date2 = date.add({ years: 1, months: 1, days: 1 }); // 02-02-2021
|
|
2048
|
+
*/
|
|
2049
|
+
plus({ years, months, weeks, days, hours, minutes, seconds, milliseconds }: JSChangeDateTimeType): JSDateTime;
|
|
2050
|
+
/**
|
|
2051
|
+
* Check if this JSDateTime object is between two other JSDates or Dates
|
|
2052
|
+
* @param dates a tuple with two JSDateTime|Date instances
|
|
2053
|
+
* @param included if the start and end date should be included (default: false)
|
|
2054
|
+
* @return is this JSDateTime between the two dates (true|false)
|
|
2055
|
+
* @example
|
|
2056
|
+
* const date = JSDateTime.fromDate(new Date(2020, 0, 1)); // 01-01-2020
|
|
2057
|
+
* date.isBetween([new Date(2030, 0, 1), new Date(2010, 0, 1)]); // true
|
|
2058
|
+
* date.isBetween([new Date(2010, 0, 1), new Date(2015, 0, 1)]); // false
|
|
2059
|
+
* @example examples for the include-parameter
|
|
2060
|
+
* const date = JSDateTime.fromDate(new Date(2020, 0, 1)); // 01-01-2020
|
|
2061
|
+
* date.isBetween([new Date(2020, 0, 1), new Date(2010, 0, 1)]); // false
|
|
2062
|
+
* date.isBetween([new Date(2020, 0, 1), new Date(2010, 0, 1), true]); // true
|
|
2063
|
+
* date.isBetween([new Date(2020, 0, 1), new Date(2010, 0, 1), [true, false]]); // true
|
|
2064
|
+
*/
|
|
2065
|
+
isBetween(dates: [JSDateTime | Date, JSDateTime | Date], included?: boolean | [boolean, boolean]): boolean;
|
|
2066
|
+
/**
|
|
2067
|
+
* Is this JSDateTime before another Date or JSDateTime.
|
|
2068
|
+
* JSDateTime implements the .valueOf() method of objects, so it is possible to compare JSDateTime objects and Date objects through <, >, ==, <= and >=.
|
|
2069
|
+
* @param date the date to compare to
|
|
2070
|
+
* @param includeEqual if the dates are equal, return true or false? (default: false)
|
|
2071
|
+
* @return is the given date before this JSDateTime (true/false)
|
|
2072
|
+
* @example
|
|
2073
|
+
* const date = JSDateTime.fromDate(new Date(2020, 0, 1)); // 01-01-2020
|
|
2074
|
+
* date.isBefore(new Date(2021, 0, 1)); // true
|
|
2075
|
+
* date.isBefore(new Date(2019, 0, 1)); // false
|
|
2076
|
+
*/
|
|
2077
|
+
isBefore(date: Date | JSDateTime, includeEqual?: boolean): boolean;
|
|
2078
|
+
/**
|
|
2079
|
+
* Is this JSDateTime after another Date or JSDateTime.
|
|
2080
|
+
* JSDateTime implements the .valueOf() method of objects, so it is possible to compare JSDateTime objects and Date objects through <, >, ==, <= and >=.
|
|
2081
|
+
* @param date the date to compare to
|
|
2082
|
+
* @param includeEqual if the dates are equal, return true or false? (default: false)
|
|
2083
|
+
* @return is the given date after this JSDateTime (true/false)
|
|
2084
|
+
* @example
|
|
2085
|
+
* const date = JSDateTime.fromDate(new Date(2020, 0, 1)); // 01-01-2020
|
|
2086
|
+
* date.isAfter(new Date(2021, 0, 1)); // false
|
|
2087
|
+
* date.isAfter(new Date(2019, 0, 1)); // true
|
|
2088
|
+
*/
|
|
2089
|
+
isAfter(date: Date | JSDateTime, includeEqual?: boolean): boolean;
|
|
2090
|
+
/**
|
|
2091
|
+
* Checks if a Date or JSDateTime is equal on some level to this JSDateTime. The method checks until given period-level.
|
|
2092
|
+
* If hasSame('xxx', 'day') returns true, the year, month and day are the same. hours, minutes, seconds and milliseconds are not checked
|
|
2093
|
+
*
|
|
2094
|
+
* @param date Date or JSDateTime object to compare with
|
|
2095
|
+
* @param period the perio that should be the same (default = 'millisecond')
|
|
2096
|
+
* @return if the dates share the same period (true/false)
|
|
2097
|
+
* @example
|
|
2098
|
+
* const jsDate = JSDateTime.fromDate(new Date(2020, 0, 1)); // 01-01-2020
|
|
2099
|
+
* jsDate.hasSame(new Date(2020, 7, 17)), 'year') // true
|
|
2100
|
+
* jsDate.hasSame(new Date(2020, 7, 17)), 'month') // true
|
|
2101
|
+
* jsDate.hasSame(new Date(2020, 7, 17)), 'day') // false
|
|
2102
|
+
* jsDate.hasSame(new Date(2021, 0, 01)), 'year') // false
|
|
2103
|
+
*/
|
|
2104
|
+
hasSame(date: Date | JSDateTime, period?: 'year' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second' | 'millisecond'): boolean;
|
|
2105
|
+
/**
|
|
2106
|
+
* Checks if a JSDateTime, Date or millis-since-epoch number is equal to this JSDateTime, since you cannot compare two JSDateTime items with '==' or '===', even with .valueOf() implemented.
|
|
2107
|
+
* This method compares the time and date of the values, not if they are the same objects.
|
|
2108
|
+
*
|
|
2109
|
+
* method `hasSame(date: Date|JSDateTime)` with default period 'millisecond' has the same functionality.
|
|
2110
|
+
*
|
|
2111
|
+
* @param val the value to compare to
|
|
2112
|
+
* @returns is the given value equal to this JSDateTime
|
|
2113
|
+
* @example
|
|
2114
|
+
* const jsDate = JSDateTime.fromDate(new Date(2020, 0, 1)); // 01-01-2020
|
|
2115
|
+
* jsDate.equals(new Date(2020, 0, 1)); // true
|
|
2116
|
+
* jsDate.equals(new Date(2020, 0, 2)); // false
|
|
2117
|
+
* jsDate.equals(JSDateTime.epoch); // false
|
|
2118
|
+
* jsDate.equals(0); // false
|
|
2119
|
+
* JSDateTime.epoch().is(0); // true
|
|
2120
|
+
*/
|
|
2121
|
+
equals(val: Date | JSDateTime | number): boolean;
|
|
2122
|
+
/**
|
|
2123
|
+
* Clone this JSDateTIme to a new object.
|
|
2124
|
+
* @returns new JSDateTime object with the same time and date as this one
|
|
2125
|
+
*/
|
|
2126
|
+
clone(): JSDateTime;
|
|
2127
|
+
/**
|
|
2128
|
+
* A new JSDateTime object with the current date and time
|
|
2129
|
+
* @param locale locale, if different from default (JSData.defaultLocale)
|
|
2130
|
+
* @param formatOptions format options, if different from default (JSData.defaultFormatOptions)
|
|
2131
|
+
* @return readonly JSDateTime object
|
|
2132
|
+
* @example JSDateTime.now() // current Date & time
|
|
2133
|
+
*/
|
|
2134
|
+
static now(locale?: string, formatOptions?: JSDateTimeFormatOptions): JSDateTime;
|
|
2135
|
+
/**
|
|
2136
|
+
* A new JSDateTime object on 01 januari 1970 00:00:00
|
|
2137
|
+
* @param locale locale, if different from default (JSData.defaultLocale)
|
|
2138
|
+
* @param formatOptions format options, if different from default (JSData.defaultFormatOptions)
|
|
2139
|
+
* @param formatOptions
|
|
2140
|
+
* @returns readonly JSDateTime object with the date 01-01-1970 00:00:00
|
|
2141
|
+
* @example JSDateTime.epoch() // 01-01-1970 00:00:00
|
|
2142
|
+
*/
|
|
2143
|
+
static epoch(locale?: string, formatOptions?: JSDateTimeFormatOptions): JSDateTime;
|
|
2144
|
+
/**
|
|
2145
|
+
* A new JSDateTime object for a given date (Date)
|
|
2146
|
+
* @param date Javascript Date object for a date
|
|
2147
|
+
* @param locale locale, if different from default (JSData.defaultLocale)
|
|
2148
|
+
* @param formatOptions format options, if different from default (JSData.defaultFormatOptions)
|
|
2149
|
+
* @return readonly JSDateTime object
|
|
2150
|
+
* @example JSDateTime.fromDate(new Date(2020, 0, 1)) // 01-01-2020
|
|
2151
|
+
*/
|
|
2152
|
+
static fromDate(date: Date, locale?: string, formatOptions?: JSDateTimeFormatOptions): JSDateTime;
|
|
2153
|
+
/**
|
|
2154
|
+
* A new JSDateTime object based on a @see JSDateSetterType.
|
|
2155
|
+
* @param value object with values for a date, like year, month, day, hour, minute, second, millisecond
|
|
2156
|
+
* @param locale locale, if different from default (JSData.defaultLocale)
|
|
2157
|
+
* @param formatOptions format options, if different from default (JSData.defaultFormatOptions)
|
|
2158
|
+
* @return readonly JSDateTime object
|
|
2159
|
+
* @example JSDateTime.from({ year: 2020, month: 1, day: 1 }) // 01-01-2020
|
|
2160
|
+
*/
|
|
2161
|
+
static from(value: JSDateSetterType, locale?: string, formatOptions?: JSDateTimeFormatOptions): JSDateTime;
|
|
2162
|
+
/**
|
|
2163
|
+
* A new JSDateTime object based on an ISO string
|
|
2164
|
+
* @param iso a date in ISO format (1990-09-07T12:30:55.666Z)
|
|
2165
|
+
* @param locale locale, if different from default (JSData.defaultLocale)
|
|
2166
|
+
* @return readonly JSDateTime object
|
|
2167
|
+
* @example JSDateTime.fromISO('1990-09-07T12:30:55.666Z')
|
|
2168
|
+
*/
|
|
2169
|
+
static fromISO(iso: string, locale?: string, formatOptions?: JSDateTimeFormatOptions): JSDateTime;
|
|
2170
|
+
/**
|
|
2171
|
+
* A new JSDateTime object based on an ISO string
|
|
2172
|
+
* @param utc a date in UTC format (Fri, 08 Jul 2022 13:34:47 GMT)
|
|
2173
|
+
* @param locale locale, if different from default (JSData.defaultLocale)
|
|
2174
|
+
* @param formatOptions format options, if different from default (JSData.defaultFormatOptions)
|
|
2175
|
+
* @return readonly JSDateTime object
|
|
2176
|
+
* @example JSDateTime.fromUTC('Fri, 08 Jul 2022 13:34:47 GMT')
|
|
2177
|
+
*/
|
|
2178
|
+
static fromUTC(utc: string, locale?: string, formatOptions?: JSDateTimeFormatOptions): JSDateTime;
|
|
2179
|
+
/**
|
|
2180
|
+
* A new JSDateTime object based on milliseconds sinde 1970-01-01T00:00:00.000Z
|
|
2181
|
+
* @param ms number of milliseconds
|
|
2182
|
+
* @param locale locale if different from default (JSData.defaultLocale)
|
|
2183
|
+
* @param formatOptions if different from default (JSData.defaultFormatOptions)
|
|
2184
|
+
* @return readonly JSDateTime object
|
|
2185
|
+
* @example JSDateTime.fromMillis(0) // 01-01-1970 00:00:00
|
|
2186
|
+
* @example JSDateTime.fromMillis(1000) // 01-01-1970 00:00:01
|
|
2187
|
+
*/
|
|
2188
|
+
static fromMillis(ms: number | string, locale?: string, formatOptions?: JSDateTimeFormatOptions): JSDateTime;
|
|
2189
|
+
/**
|
|
2190
|
+
* Formatten van een datum mbv keys. Onderaan deze uitleg staan deze keys
|
|
2191
|
+
* new JSDateTime(2022, 1, 1, 3, 4, 5, 6,789).fo() // "Tue, 01 Feb 2021 03:04:05.678 GMT, 01-02-2011"
|
|
2192
|
+
*
|
|
2193
|
+
* @param format string, like "dddd dd MMMM yyyy HH:mm:ss.SSS" or DateTimeFormatOptions
|
|
2194
|
+
* @return date-string based on format
|
|
2195
|
+
*
|
|
2196
|
+
* @description Accepted patterns and characters:
|
|
2197
|
+
* | Unit | Pattern | Example-Output | Description |
|
|
2198
|
+
* |--------------|-----------|------------------------------|------------------------------------------------|
|
|
2199
|
+
* | IGNORE CHAR | `^...^` | `^HADIHO^` | txt between 1st ^ and 2nd ^ are ignored |
|
|
2200
|
+
* | day of month | `d` | `7`, `14` | Day of the month as digits; no leading zero. |
|
|
2201
|
+
* | | `dd` | `07`, `14` | Day of the month as digits; leading zero |
|
|
2202
|
+
* | day of week | `ddd` | `thu` | Day of the week as a three-letter abbr. |
|
|
2203
|
+
* | | `dddd` | `thursday` | Day of the week as its full name. |
|
|
2204
|
+
* | month | `m` | `1`, `12` | Month as digits; no leading zero. |
|
|
2205
|
+
* | | `mm` | `01`, `12` | Month as digits; leading zero |
|
|
2206
|
+
* | | `mmm` | `Aug` | Month as a three-letter abbr. |
|
|
2207
|
+
* | | `mmmm` | `August` | Month as its full name. |
|
|
2208
|
+
* | year | `yy` | `22`, `19`, `07` | Year as last two digits. |
|
|
2209
|
+
* | | `yyyy` | `2022`, `2019`, `2007` | Year as four digits. |
|
|
2210
|
+
* | hour | `H` | `0`, `13` | Hour as digits (0-23); no leading zero. |
|
|
2211
|
+
* | | `HH` | `00`, `13` | Hour as digits (0-23); leading zero |
|
|
2212
|
+
* | | `h` | `1`, `12` | Hour as digits (0-12); no leading zero. |
|
|
2213
|
+
* | | `hh` | `01`, `12` | Hour as digits (0-12); leading zero |
|
|
2214
|
+
* | minute | `M` | `0`, `59` | Minute as digits; no leading zero. |
|
|
2215
|
+
* | | `MM` | `00`, `59` | Minute as digits; leading zero |
|
|
2216
|
+
* | second | `s` | `0`, `59` | Second as digits; no leading zero. |
|
|
2217
|
+
* | | `ss` | `00`, `59` | Second as digits; leading zero |
|
|
2218
|
+
* | millisecond | `S` | `0`, `999` | Millisecond as digits; no leading zero |
|
|
2219
|
+
* | | `SSS` | `000`, `999` | Millisecond as digits; leading zero's |
|
|
2220
|
+
* | am/pm | `T` | `A`, `P` | AM or PM, 1 character |
|
|
2221
|
+
* | | `TT` | `am`, `pm` | AM or PM, 2 characters |
|
|
2222
|
+
* | timezone | `Z` | `CEST`, `AEST` | Timezone name - short version |
|
|
2223
|
+
* | | `ZZ` | `Central Europe Summer Time` | Timezone name - long version |
|
|
2224
|
+
* | tz offset | `O` | `+2`, `-4` | Timezone offset in hours and minutes (short) |
|
|
2225
|
+
* | | `OO` | `+02:00` | Timezone offset in hours and minutes (longer) |
|
|
2226
|
+
* | | `OOO` | `GMT+02:00` | Timezone offset in hours and minutes (longest) |
|
|
2227
|
+
*
|
|
2228
|
+
* @example
|
|
2229
|
+
* // example for donderdag 7 oktober 1999 04:30:45.678 (AM), week 40
|
|
2230
|
+
* const dt = JSDateTime.fromDate(new Date());
|
|
2231
|
+
* dt.toFormat('dddd dd mmmm yyyy HH:mm:ss.SSS tt'); // 'donderdag 7 oktober 1999 04:30:45.678 AM'
|
|
2232
|
+
* dt.toFormat('ddd d mmm yy') // 'do 7 okt 99'
|
|
2233
|
+
* dt.toFormat('DD-mm-yyyy') // '07-10-1990'
|
|
2234
|
+
* dt.toFormat('HH:MM:ss.SSS') // '04:30:45.678'
|
|
2235
|
+
* dt.toFormat('hh:MM tt') // '04:30 AM'
|
|
2236
|
+
* dt.toFormat('HH:MM OO') // '04:30 +02:00'
|
|
2237
|
+
* dt.toFormat('HH:MM Z') // '04:30 CEST'
|
|
2238
|
+
* dt.toFormat('^HH:MM ZZ^') // 'HH:MM ZZ'
|
|
2239
|
+
*/
|
|
2240
|
+
toFormat(format: string | JSDateTimeFormatOptions): string;
|
|
2241
|
+
/** Converteer een format naar een bruikbare replaceable string */
|
|
2242
|
+
private formatBuilder;
|
|
2243
|
+
}
|
|
2244
|
+
|
|
2245
|
+
/** Type for timezones (<Continent>/<Location>), Is on the bottom side because its very long and just a lot of strings */
|
|
2246
|
+
type JSDateTimeZoneType = 'Africa/Abidjan' | 'Africa/Accra' | 'Africa/Algiers' | 'Africa/Bissau' | 'Africa/Cairo' | 'Africa/Casablanca' | 'Africa/Ceuta' | 'Africa/El_Aaiun' | 'Africa/Johannesburg' | 'Africa/Juba' | 'Africa/Khartoum' | 'Africa/Lagos' | 'Africa/Maputo' | 'Africa/Monrovia' | 'Africa/Nairobi' | 'Africa/Ndjamena' | 'Africa/Sao_Tome' | 'Africa/Tripoli' | 'Africa/Tunis' | 'Africa/Windhoek' | 'America/Adak' | 'America/Anchorage' | 'America/Araguaina' | 'America/Argentina/Buenos_Aires' | 'America/Argentina/Catamarca' | 'America/Argentina/Cordoba' | 'America/Argentina/Jujuy' | 'America/Argentina/La_Rioja' | 'America/Argentina/Mendoza' | 'America/Argentina/Rio_Gallegos' | 'America/Argentina/Salta' | 'America/Argentina/San_Juan' | 'America/Argentina/San_Luis' | 'America/Argentina/Tucuman' | 'America/Argentina/Ushuaia' | 'America/Asuncion' | 'America/Atikokan' | 'America/Bahia' | 'America/Bahia_Banderas' | 'America/Barbados' | 'America/Belem' | 'America/Belize' | 'America/Blanc-Sablon' | 'America/Boa_Vista' | 'America/Bogota' | 'America/Boise' | 'America/Cambridge_Bay' | 'America/Campo_Grande' | 'America/Cancun' | 'America/Caracas' | 'America/Cayenne' | 'America/Chicago' | 'America/Chihuahua' | 'America/Costa_Rica' | 'America/Creston' | 'America/Cuiaba' | 'America/Curacao' | 'America/Danmarkshavn' | 'America/Dawson' | 'America/Dawson_Creek' | 'America/Denver' | 'America/Detroit' | 'America/Edmonton' | 'America/Eirunepe' | 'America/El_Salvador' | 'America/Fort_Nelson' | 'America/Fortaleza' | 'America/Glace_Bay' | 'America/Godthab' | 'America/Goose_Bay' | 'America/Grand_Turk' | 'America/Guatemala' | 'America/Guayaquil' | 'America/Guyana' | 'America/Halifax' | 'America/Havana' | 'America/Hermosillo' | 'America/Indiana/Indianapolis' | 'America/Indiana/Knox' | 'America/Indiana/Marengo' | 'America/Indiana/Petersburg' | 'America/Indiana/Tell_City' | 'America/Indiana/Vevay' | 'America/Indiana/Vincennes' | 'America/Indiana/Winamac' | 'America/Inuvik' | 'America/Iqaluit' | 'America/Jamaica' | 'America/Juneau' | 'America/Kentucky/Louisville' | 'America/Kentucky/Monticello' | 'America/La_Paz' | 'America/Lima' | 'America/Los_Angeles' | 'America/Maceio' | 'America/Managua' | 'America/Manaus' | 'America/Martinique' | 'America/Matamoros' | 'America/Mazatlan' | 'America/Menominee' | 'America/Merida' | 'America/Metlakatla' | 'America/Mexico_City' | 'America/Miquelon' | 'America/Moncton' | 'America/Monterrey' | 'America/Montevideo' | 'America/Nassau' | 'America/New_York' | 'America/Nipigon' | 'America/Nome' | 'America/Noronha' | 'America/North_Dakota/Beulah' | 'America/North_Dakota/Center' | 'America/North_Dakota/New_Salem' | 'America/Ojinaga' | 'America/Panama' | 'America/Pangnirtung' | 'America/Paramaribo' | 'America/Phoenix' | 'America/Port-au-Prince' | 'America/Port_of_Spain' | 'America/Porto_Velho' | 'America/Puerto_Rico' | 'America/Punta_Arenas' | 'America/Rainy_River' | 'America/Rankin_Inlet' | 'America/Recife' | 'America/Regina' | 'America/Resolute' | 'America/Rio_Branco' | 'America/Santarem' | 'America/Santiago' | 'America/Santo_Domingo' | 'America/Sao_Paulo' | 'America/Scoresbysund' | 'America/Sitka' | 'America/St_Johns' | 'America/Swift_Current' | 'America/Tegucigalpa' | 'America/Thule' | 'America/Thunder_Bay' | 'America/Tijuana' | 'America/Toronto' | 'America/Vancouver' | 'America/Whitehorse' | 'America/Winnipeg' | 'America/Yakutat' | 'America/Yellowknife' | 'Antarctica/Casey' | 'Antarctica/Davis' | 'Antarctica/DumontDUrville' | 'Antarctica/Macquarie' | 'Antarctica/Mawson' | 'Antarctica/Palmer' | 'Antarctica/Rothera' | 'Antarctica/Syowa' | 'Antarctica/Troll' | 'Antarctica/Vostok' | 'Asia/Almaty' | 'Asia/Amman' | 'Asia/Anadyr' | 'Asia/Aqtau' | 'Asia/Aqtobe' | 'Asia/Ashgabat' | 'Asia/Atyrau' | 'Asia/Baghdad' | 'Asia/Baku' | 'Asia/Bangkok' | 'Asia/Barnaul' | 'Asia/Beirut' | 'Asia/Bishkek' | 'Asia/Brunei' | 'Asia/Chita' | 'Asia/Choibalsan' | 'Asia/Colombo' | 'Asia/Damascus' | 'Asia/Dhaka' | 'Asia/Dili' | 'Asia/Dubai' | 'Asia/Dushanbe' | 'Asia/Famagusta' | 'Asia/Gaza' | 'Asia/Hebron' | 'Asia/Ho_Chi_Minh' | 'Asia/Hong_Kong' | 'Asia/Hovd' | 'Asia/Irkutsk' | 'Asia/Jakarta' | 'Asia/Jayapura' | 'Asia/Jerusalem' | 'Asia/Kabul' | 'Asia/Kamchatka' | 'Asia/Karachi' | 'Asia/Kathmandu' | 'Asia/Khandyga' | 'Asia/Kolkata' | 'Asia/Krasnoyarsk' | 'Asia/Kuala_Lumpur' | 'Asia/Kuching' | 'Asia/Macau' | 'Asia/Magadan' | 'Asia/Makassar' | 'Asia/Manila' | 'Asia/Nicosia' | 'Asia/Novokuznetsk' | 'Asia/Novosibirsk' | 'Asia/Omsk' | 'Asia/Oral' | 'Asia/Pontianak' | 'Asia/Pyongyang' | 'Asia/Qatar' | 'Asia/Qostanay' | 'Asia/Qyzylorda' | 'Asia/Riyadh' | 'Asia/Sakhalin' | 'Asia/Samarkand' | 'Asia/Seoul' | 'Asia/Shanghai' | 'Asia/Singapore' | 'Asia/Srednekolymsk' | 'Asia/Taipei' | 'Asia/Tashkent' | 'Asia/Tbilisi' | 'Asia/Tehran' | 'Asia/Thimphu' | 'Asia/Tokyo' | 'Asia/Tomsk' | 'Asia/Ulaanbaatar' | 'Asia/Urumqi' | 'Asia/Ust-Nera' | 'Asia/Vladivostok' | 'Asia/Yakutsk' | 'Asia/Yangon' | 'Asia/Yekaterinburg' | 'Asia/Yerevan' | 'Atlantic/Azores' | 'Atlantic/Bermuda' | 'Atlantic/Canary' | 'Atlantic/Cape_Verde' | 'Atlantic/Faroe' | 'Atlantic/Madeira' | 'Atlantic/Reykjavik' | 'Atlantic/South_Georgia' | 'Atlantic/Stanley' | 'Australia/Adelaide' | 'Australia/Brisbane' | 'Australia/Broken_Hill' | 'Australia/Currie' | 'Australia/Darwin' | 'Australia/Eucla' | 'Australia/Hobart' | 'Australia/Lindeman' | 'Australia/Lord_Howe' | 'Australia/Melbourne' | 'Australia/Perth' | 'Australia/Sydney' | 'Europe/Amsterdam' | 'Europe/Andorra' | 'Europe/Astrakhan' | 'Europe/Athens' | 'Europe/Belgrade' | 'Europe/Berlin' | 'Europe/Brussels' | 'Europe/Bucharest' | 'Europe/Budapest' | 'Europe/Chisinau' | 'Europe/Copenhagen' | 'Europe/Dublin' | 'Europe/Gibraltar' | 'Europe/Helsinki' | 'Europe/Istanbul' | 'Europe/Kaliningrad' | 'Europe/Kiev' | 'Europe/Kirov' | 'Europe/Lisbon' | 'Europe/London' | 'Europe/Luxembourg' | 'Europe/Madrid' | 'Europe/Malta' | 'Europe/Minsk' | 'Europe/Monaco' | 'Europe/Moscow' | 'Europe/Oslo' | 'Europe/Paris' | 'Europe/Prague' | 'Europe/Riga' | 'Europe/Rome' | 'Europe/Samara' | 'Europe/Saratov' | 'Europe/Simferopol' | 'Europe/Sofia' | 'Europe/Stockholm' | 'Europe/Tallinn' | 'Europe/Tirane' | 'Europe/Ulyanovsk' | 'Europe/Uzhgorod' | 'Europe/Vienna' | 'Europe/Vilnius' | 'Europe/Volgograd' | 'Europe/Warsaw' | 'Europe/Zaporozhye' | 'Europe/Zurich' | 'Indian/Chagos' | 'Indian/Christmas' | 'Indian/Cocos' | 'Indian/Kerguelen' | 'Indian/Mahe' | 'Indian/Maldives' | 'Indian/Mauritius' | 'Indian/Reunion' | 'Pacific/Apia' | 'Pacific/Auckland' | 'Pacific/Bougainville' | 'Pacific/Chatham' | 'Pacific/Chuuk' | 'Pacific/Easter' | 'Pacific/Efate' | 'Pacific/Enderbury' | 'Pacific/Fakaofo' | 'Pacific/Fiji' | 'Pacific/Funafuti' | 'Pacific/Galapagos' | 'Pacific/Gambier' | 'Pacific/Guadalcanal' | 'Pacific/Guam' | 'Pacific/Honolulu' | 'Pacific/Kiritimati' | 'Pacific/Kosrae' | 'Pacific/Kwajalein' | 'Pacific/Majuro' | 'Pacific/Marquesas' | 'Pacific/Nauru' | 'Pacific/Niue' | 'Pacific/Norfolk' | 'Pacific/Noumea' | 'Pacific/Pago_Pago' | 'Pacific/Palau' | 'Pacific/Pitcairn' | 'Pacific/Pohnpei' | 'Pacific/Port_Moresby' | 'Pacific/Rarotonga' | 'Pacific/Tahiti' | 'Pacific/Tarawa' | 'Pacific/Tongatapu' | 'Pacific/Wake' | 'Pacific/Wallis';
|
|
2247
|
+
|
|
2248
|
+
declare class JSDuration {
|
|
2249
|
+
/** Een van de 2 JSDateTimes om te vergelijken */ private jsdate1;
|
|
2250
|
+
/** Een van de 2 JSDateTimes om te vergelijken */ private jsdate2;
|
|
2251
|
+
/**
|
|
2252
|
+
* Constructor voor een JSDuration. Gebruik om het verschil in tijd tussen 2 JSDateTimes of Dates te berekenen.
|
|
2253
|
+
*
|
|
2254
|
+
* @param jsd1 de 1e JSDateTime/Date om het verschil mee uit te rekenen.
|
|
2255
|
+
* @param jsd2 (optioneel) de andere JSDateTime/Date om het verschil mee te berekenen (default = Date.now())
|
|
2256
|
+
*
|
|
2257
|
+
* @example
|
|
2258
|
+
* // verschil tussen 01-01-1970 & NU
|
|
2259
|
+
* const dur = new JSDuration(JSDateTime.epoch());
|
|
2260
|
+
* @example
|
|
2261
|
+
* // verschil tussen nu en 1 dag, 30min later
|
|
2262
|
+
* let dur = new JSDuration(JSDateTime.now(), JSDateTime.now().plus({ days: 1, minutes: 30 }));
|
|
2263
|
+
* console.log(dur.inDays); // 1
|
|
2264
|
+
* console.log(dur.differenceIn(['hours', 'minutes'])); // { hours: 24, minutes: 30 }
|
|
2265
|
+
*
|
|
2266
|
+
* let dur = new JSDuration(JSDateTime.now(), JSDateTime.now().plus({ days: 1, minutes: 30, seconds: 30 }));
|
|
2267
|
+
* console.log(dur.differenceIn(['hours', 'minutes'])) // { hours: 24, minutes: 30, rest: 30_000 }
|
|
2268
|
+
*/
|
|
2269
|
+
constructor(jsd1: Date | JSDateTime, jsd2?: Date | JSDateTime);
|
|
2270
|
+
/** @returns Aantal absolute milliseconden tussen de twee JSDateTimes van deze duration (altijd positief) */
|
|
2271
|
+
private get ms();
|
|
2272
|
+
/** @returns Aantal milliseconden tussen de twee datums. */
|
|
2273
|
+
get inMillis(): number;
|
|
2274
|
+
/** @returns Aantal HELE seconden tussen de twee datums. */
|
|
2275
|
+
get inSeconds(): number;
|
|
2276
|
+
/** @returns Aantal HELE minuten tussen de twee datums. */
|
|
2277
|
+
get inMinutes(): number;
|
|
2278
|
+
/** @returns Aantal HELE uren tussen de twee datums. */
|
|
2279
|
+
get inHours(): number;
|
|
2280
|
+
/** @returns Aantal HELE dagen tussen de twee datums. */
|
|
2281
|
+
get inDays(): number;
|
|
2282
|
+
/** @returns Aantal HELE weken tussen de twee datums. */
|
|
2283
|
+
get inWeeks(): number;
|
|
2284
|
+
/** @returns Een overzicht van alle gehele waarden tussen de twee datums */
|
|
2285
|
+
get inAllTypes(): {
|
|
2286
|
+
milliseconds: number;
|
|
2287
|
+
seconds: number;
|
|
2288
|
+
minutes: number;
|
|
2289
|
+
hours: number;
|
|
2290
|
+
days: number;
|
|
2291
|
+
weeks: number;
|
|
2292
|
+
};
|
|
2293
|
+
/**
|
|
2294
|
+
* Bereken het verschil tussen de twee datums in de gewenste types.
|
|
2295
|
+
* Dat is het verschil tov de inXXX-get-functions, die geven alleen het verschil in gehele eenheden van dat type
|
|
2296
|
+
* @todo: TODO: maanden en jaren nog niet goed
|
|
2297
|
+
* @param types een array van de gewenste types
|
|
2298
|
+
* @returns {DiffReturnType}een object met daarin de waarden van de gewenste types
|
|
2299
|
+
* @example
|
|
2300
|
+
* const dur = new JSDuration(JSDateTime.now(), JSDateTime.now().plus({ days: 1, minutes: 30 }));
|
|
2301
|
+
* dur.differenceIn(['hours', 'minutes']); // { hours: 24, minutes: 30 }
|
|
2302
|
+
* dur.differenceIn(['days', 'minutes']); // { days: 1, minutes: 30 }
|
|
2303
|
+
* dur.differenceIn(['hours']); // { hours: 24, rest: 1_800_000 }
|
|
2304
|
+
*/
|
|
2305
|
+
differenceIn(types: DiffFnType[]): DiffReturnType;
|
|
2306
|
+
}
|
|
2307
|
+
type DiffFnType = 'weeks' | 'days' | 'hours' | 'minutes' | 'seconds' | 'milliseconds';
|
|
2308
|
+
type DiffReturnType = {
|
|
2309
|
+
/** Number of milliseconds in this difference */
|
|
2310
|
+
milliseconds?: number;
|
|
2311
|
+
/** Number of seconds in this difference */
|
|
2312
|
+
seconds?: number;
|
|
2313
|
+
/** Number of minutes in this difference */
|
|
2314
|
+
minutes?: number;
|
|
2315
|
+
/** Number of hours in this difference */
|
|
2316
|
+
hours?: number;
|
|
2317
|
+
/** Number of days in this difference */
|
|
2318
|
+
days?: number;
|
|
2319
|
+
/** Number of weeks in this difference */
|
|
2320
|
+
weeks?: number;
|
|
2321
|
+
/** Number of milliseconds left after subtracting all other wanted date-parts */
|
|
2322
|
+
rest?: number;
|
|
2323
|
+
};
|
|
2324
|
+
|
|
2325
|
+
/**
|
|
2326
|
+
* Controleer of een string een BSN bevat. Om dat te doen worden alle karakters, behalve letters en getallen gewist.
|
|
2327
|
+
* Als er een of meer BSNs aangetroffen worden, worden ze allemaal teruggeven in een array.
|
|
2328
|
+
* @param txt a string which could contain a BSN
|
|
2329
|
+
* @returns false when there is no BSN or a tuple [true, Array<string>] where the string-array contains all found BSNs
|
|
2330
|
+
* @example
|
|
2331
|
+
* hasBSN('123456789') // [false, []]
|
|
2332
|
+
* hasBSN('200644440') // [true, ['200644440']]
|
|
2333
|
+
* hasBSN('xxx200644440xxx') // [true, ['200644440']]
|
|
2334
|
+
* hasBSN('xxx123456789xxx') // [false, []]
|
|
2335
|
+
* hasBSN('200x644x440') // [false, []]
|
|
2336
|
+
* hasBSN('200644440, 200644440, 200644440') // [true, ['200644440','200644440','200644440']]
|
|
2337
|
+
*/
|
|
2338
|
+
declare function hasBSN(txt: string): [boolean, Array<string>];
|
|
2339
|
+
|
|
2340
|
+
type RGBType = [number, number, number, number?];
|
|
2341
|
+
/**
|
|
2342
|
+
* Bepaal op basis van de achtergrondkleur wat de kleur van de tekst moet zijn (zwart of wit).
|
|
2343
|
+
* - alpha-channel wordt genegeerd.
|
|
2344
|
+
* - gebaseerd op WCAG-guidelines
|
|
2345
|
+
* @param bgColor de achtergrondkleur van de tekst. string? hex colors (#abc of #abcdef). tuple? [r, g, b]
|
|
2346
|
+
* @returns zwart of wit (hex-color of rgb-tuple)
|
|
2347
|
+
* @example
|
|
2348
|
+
* txtColorDecision('#ffffff'); // '#000000'
|
|
2349
|
+
* txtColorDecision('#000000'); // '#ffffff'
|
|
2350
|
+
* txtColorDecision([0, 0, 0]); // [255, 255, 255]
|
|
2351
|
+
* txtColorDecision([255, 255, 255]); // [0, 0, 0]
|
|
2352
|
+
*/
|
|
2353
|
+
declare function calculateTxtColor(bgColor: string | RGBType): '#ffffff' | '#000000' | [0, 0, 0] | [255, 255, 255];
|
|
2354
|
+
|
|
2355
|
+
/**
|
|
2356
|
+
* Controleer of een opgegeven rekeningnummer wel een IBAN, nummer is.
|
|
2357
|
+
* @param rekNr het rekeningsnummer dat gecontroleerd moet worden
|
|
2358
|
+
* @returns een tuple met een boolean en een string
|
|
2359
|
+
* - `[true, 'LAND']` als het een geldige IBAN is
|
|
2360
|
+
* - `[false, 'invalid format']` als het niet voldoet aan het IBAN-formaat
|
|
2361
|
+
* - `[false, 'invalid landcode']` als de landcode niet bestaat (in onze gegevens)
|
|
2362
|
+
* - `[false, 'invalid length']` als het niet voldoet aan de lengte-eis die hoort bij de landcode
|
|
2363
|
+
* - `[false, 'invalid restgetal']` als het niet voldoet aan de mod-97 berekening voor IBAN
|
|
2364
|
+
* @example
|
|
2365
|
+
* const [bool, msg] = isIBAN('NL28 ASNB 0709 1665 92'); // [true, 'Nederland']
|
|
2366
|
+
* const [bool, msg] = isIBAN('NL28 ASNB 0709 1665 922'); // [false, 'invalid length']
|
|
2367
|
+
* const [bool, msg] = isIBAN('NL28 ASNB 0709 1665 93'); // [false, 'invalid restgetal']
|
|
2368
|
+
* const [bool, msg] = isIBAN('ABCDEFG'); // [false, 'invalid format']
|
|
2369
|
+
* const [bool, msg] = isIBAN('QQ28 ASNB 0709 1665 93'); // [false, 'invalid landcode']
|
|
2370
|
+
*/
|
|
2371
|
+
declare function isIBAN(rekNr: string): [boolean, string];
|
|
2372
|
+
/** Een array van landen met de landcode en de lengte van een IBAN. Ook een voorbeeld-IBAN */
|
|
2373
|
+
declare const IBAN_GEGEVENS_MET_TEST_PER_LAND: Readonly<Array<{
|
|
2374
|
+
/** landnaam waar deze settings van toepassing zijn */ land: string;
|
|
2375
|
+
/** code voor het land zoals dat in een IBAN voorkomt */ code: string;
|
|
2376
|
+
/** de totale lengte van het IBAN-rekeningnummer */ length: number;
|
|
2377
|
+
/** een voorbeeld-IBAN-nummer */ IBAN: string;
|
|
2378
|
+
}>>;
|
|
2379
|
+
|
|
2380
|
+
type BaseEventProps = {
|
|
2381
|
+
/** ID van een event */
|
|
2382
|
+
id: number | string | (() => number | string);
|
|
2383
|
+
/** Title van een event */
|
|
2384
|
+
title: string | (() => string);
|
|
2385
|
+
/** Start datetime or date event */
|
|
2386
|
+
startDateTime: Date | JSDateTime;
|
|
2387
|
+
/** (optional) End datetime */
|
|
2388
|
+
endDateTime?: Date | JSDateTime;
|
|
2389
|
+
/** Is event an allday-event (hide starttime) */
|
|
2390
|
+
allDay?: boolean;
|
|
2391
|
+
/** Event description */
|
|
2392
|
+
description?: React$1.ReactNode | (() => React$1.ReactNode);
|
|
2393
|
+
/** Background-color for event (hexColors, default = #ee8000) */
|
|
2394
|
+
evtColor?: HexColor | ColorProp | ((hovered?: boolean) => HexColor | ColorProp);
|
|
2395
|
+
/** (optional) Tooltip tekst */
|
|
2396
|
+
tooltip?: React$1.ReactNode;
|
|
2397
|
+
};
|
|
2398
|
+
type CalendarOptions<T> = {
|
|
2399
|
+
/** De locale voor de calendar. default = 'nl-NL' */
|
|
2400
|
+
locale?: string;
|
|
2401
|
+
/** Zichtbare dagen als set (default 1,2,3,4,5,6,7 (ma = 1, di = 2,... zo = 7)) @deprecated */
|
|
2402
|
+
visibleDays?: Set<number>;
|
|
2403
|
+
/** Settings for events */
|
|
2404
|
+
event?: {
|
|
2405
|
+
/** Settings for allday events */
|
|
2406
|
+
allday?: EventOptions<T>;
|
|
2407
|
+
/** Settings for timed events */
|
|
2408
|
+
timed?: EventOptions<T>;
|
|
2409
|
+
};
|
|
2410
|
+
/** Settings for today */
|
|
2411
|
+
today?: {
|
|
2412
|
+
/** Background color for today (HexColors, default = #3b59ec) */
|
|
2413
|
+
bgColor?: (hovered: boolean, date?: Date | JSDateTime) => HexColor | ColorProp;
|
|
2414
|
+
/** Do not show which day is today */
|
|
2415
|
+
doNotMarkToday: boolean;
|
|
2416
|
+
};
|
|
2417
|
+
tooltipColor?: ColorProp;
|
|
2418
|
+
};
|
|
2419
|
+
type EventOptions<T> = {
|
|
2420
|
+
/** Dackground color for event (hex color, default = #ff8000) */
|
|
2421
|
+
evtColor?: (evt: T, hovered: boolean) => HexColor | ColorProp;
|
|
2422
|
+
};
|
|
2423
|
+
type HexColor = `#${string}`;
|
|
2424
|
+
|
|
2425
|
+
type FourweekViewProps<T extends BaseEventProps> = {
|
|
2426
|
+
/** Events voor deze view */
|
|
2427
|
+
events: T[];
|
|
2428
|
+
/** Opties voor deze view */
|
|
2429
|
+
options?: CalendarOptions<T>;
|
|
2430
|
+
/** Event aangeklikt */
|
|
2431
|
+
onEventClick?: (e: T, event: React$1.MouseEvent<HTMLElement>) => void;
|
|
2432
|
+
/** Dag-datum geklikt? */
|
|
2433
|
+
onDayClick?: (date: JSDateTime, event: React$1.MouseEvent<HTMLElement>) => void;
|
|
2434
|
+
/** Huidige geselecteerde datum */
|
|
2435
|
+
viewDate: Date | JSDateTime;
|
|
2436
|
+
};
|
|
2437
|
+
/**
|
|
2438
|
+
* Maak een vierweken-view (grid) met events
|
|
2439
|
+
* @param props
|
|
2440
|
+
* @returns
|
|
2441
|
+
*/
|
|
2442
|
+
declare function FourweeksView<T extends BaseEventProps>({ viewDate: vd, options, onEventClick, onDayClick, events: orgEvents, }: FourweekViewProps<T>): JSX.Element;
|
|
2443
|
+
|
|
2444
|
+
type MonthViewProps<T extends BaseEventProps> = {
|
|
2445
|
+
/** Events voor deze view */
|
|
2446
|
+
events: T[];
|
|
2447
|
+
/** Opties voor deze view */
|
|
2448
|
+
options?: CalendarOptions<T>;
|
|
2449
|
+
/** Event aangeklikt */
|
|
2450
|
+
onEventClick?: (e: T, event: React$1.MouseEvent<HTMLElement>) => void;
|
|
2451
|
+
/** Dag-datum geklikt? */
|
|
2452
|
+
onDayClick?: (date: JSDateTime, event: React$1.MouseEvent<HTMLElement>) => void;
|
|
2453
|
+
/** Huidige geselecteerde datum */
|
|
2454
|
+
viewDate: Date | JSDateTime;
|
|
2455
|
+
};
|
|
2456
|
+
/**
|
|
2457
|
+
* Maak een maand-view (grid) met events
|
|
2458
|
+
* @param props
|
|
2459
|
+
* @returns
|
|
2460
|
+
*/
|
|
2461
|
+
declare function MonthView<T extends BaseEventProps>({ viewDate: vd, options, onEventClick, onDayClick, events: orgEvents, }: MonthViewProps<T>): JSX.Element;
|
|
2462
|
+
|
|
2463
|
+
type WeekViewProps<T extends BaseEventProps> = {
|
|
2464
|
+
/** Events voor deze view */
|
|
2465
|
+
events: T[];
|
|
2466
|
+
/** Opties voor deze view */
|
|
2467
|
+
options?: CalendarOptions<T>;
|
|
2468
|
+
/** Event aangeklikt */
|
|
2469
|
+
onEventClick?: (e: T, event: React$1.MouseEvent<HTMLElement>) => void;
|
|
2470
|
+
/** Dag-datum geklikt? */
|
|
2471
|
+
onDayClick?: (date: JSDateTime, event: React$1.MouseEvent<HTMLElement>) => void;
|
|
2472
|
+
/** Huidige geselecteerde datum */
|
|
2473
|
+
viewDate: Date | JSDateTime;
|
|
2474
|
+
};
|
|
2475
|
+
/**
|
|
2476
|
+
* Maak een week-view (grid) met events
|
|
2477
|
+
* @param props
|
|
2478
|
+
* @returns een weekview (grid) met de events
|
|
2479
|
+
* @ex
|
|
2480
|
+
*/
|
|
2481
|
+
declare function WeekView<T extends BaseEventProps>({ viewDate: vd, options, onEventClick, events: orgEvents, onDayClick, }: WeekViewProps<T>): JSX.Element;
|
|
2482
|
+
|
|
2483
|
+
declare const Calendar: {
|
|
2484
|
+
Month: typeof MonthView;
|
|
2485
|
+
Week: typeof WeekView;
|
|
2486
|
+
Fourweeks: typeof FourweeksView;
|
|
2487
|
+
};
|
|
2488
|
+
|
|
2489
|
+
type PositionProp = 'bottom';
|
|
2490
|
+
declare class Tooltip extends React$1.Component<{
|
|
2491
|
+
content?: React$1.ReactNode;
|
|
2492
|
+
color?: ColorProp;
|
|
2493
|
+
children: React$1.ReactNode;
|
|
2494
|
+
display?: 'block' | 'inline';
|
|
2495
|
+
}> {
|
|
2496
|
+
static defaultProps: {
|
|
2497
|
+
position: PositionProp;
|
|
2498
|
+
color: ColorProp;
|
|
2499
|
+
content: React$1.ReactNode;
|
|
2500
|
+
display: 'block' | 'inline';
|
|
2501
|
+
};
|
|
2502
|
+
state: {
|
|
2503
|
+
active: boolean;
|
|
2504
|
+
};
|
|
2505
|
+
show: () => void;
|
|
2506
|
+
hide: () => void;
|
|
2507
|
+
render(): JSX.Element;
|
|
2508
|
+
}
|
|
2509
|
+
|
|
2510
|
+
type BaseInputProps<T extends any = void> = {
|
|
2511
|
+
/** De help-tag van een input (ion loon gebruikt voor help */
|
|
2512
|
+
helpTag?: string;
|
|
2513
|
+
/** Is dit veld disabled ? (optioneel) */
|
|
2514
|
+
disabled?: boolean;
|
|
2515
|
+
/** Name input: gebruikt voor een `<label>` als er geen label gedefinieerd is & de name-attribuut `<input>` */
|
|
2516
|
+
name: string;
|
|
2517
|
+
/** ID voor de input: gebruikt voor een `<label for="*id*">`. default wordt anders de `name`-prop gebruik */
|
|
2518
|
+
id?: string;
|
|
2519
|
+
/** Een tooltip voor de button */
|
|
2520
|
+
tooltip?: string;
|
|
2521
|
+
/** Label voor de input, als dat afwijkt van de name-attribuut */
|
|
2522
|
+
label?: string;
|
|
2523
|
+
/** Label wordt alleen gebruikt voor accessibility, dus is onzichtbaar op het scherm. (default `false`) */
|
|
2524
|
+
labelHidden?: boolean;
|
|
2525
|
+
/** Grootte van de input (default = `m`, normal) */
|
|
2526
|
+
size?: SizeProp;
|
|
2527
|
+
/** Waar moet de tekst van de input uitgelijnd worden (default = `l`, links) */
|
|
2528
|
+
textAlign?: TextAlignmentProp;
|
|
2529
|
+
/** De input is horizontaal, label & input op 1 lijn. (default = `horizontal`) */
|
|
2530
|
+
direction?: DirectionProp;
|
|
2531
|
+
/** Een object met validatie-regels */
|
|
2532
|
+
validation?: FormValidationType<T>;
|
|
2533
|
+
/** Moet de spell-checker van de browser aanstaan voor deze input? (default `false`) */
|
|
2534
|
+
spellCheck?: boolean;
|
|
2535
|
+
/** Eigen errorMessage voor validatie buiten component om */
|
|
2536
|
+
errorMessage?: string | ((value: T | string | string[] | number | number[] | boolean | Date | FileList | any) => string);
|
|
2537
|
+
/** Placeholder in input (optioneel) */
|
|
2538
|
+
placeholder?: string;
|
|
2539
|
+
/** Welk (virtueel) toetsenbord moet er gebruikt worden? (smartphones, tablets) */
|
|
2540
|
+
keyboardType?: KeyboardTypeProp;
|
|
2541
|
+
/** `onKeyDown`-event-callback, bijvoorbeeld voor het gebruik van Hotkeys als dit element focused is */
|
|
2542
|
+
onKeyDown?: (e: React$1.KeyboardEvent<HTMLInputElement>) => void;
|
|
2543
|
+
/** `onFocus`-event-callback, met optionele helpTag (als opgegeven) */
|
|
2544
|
+
onFocus?: (e: React$1.FocusEvent<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>, helpTag?: string) => void;
|
|
2545
|
+
/** (optionele) Andere icoontjes voor op de inputs. Anders worden de default-waarden gebruikt. */
|
|
2546
|
+
icons?: {
|
|
2547
|
+
/** Icon aan start van een input */
|
|
2548
|
+
start?: IconProp | string;
|
|
2549
|
+
/**
|
|
2550
|
+
* Icon aan eind van een input
|
|
2551
|
+
* @param v: valid
|
|
2552
|
+
* @returns een fontawesome icon-prop of een fontawesome icon string
|
|
2553
|
+
*/
|
|
2554
|
+
end?: (v: boolean) => IconProp | string;
|
|
2555
|
+
};
|
|
2556
|
+
};
|
|
2557
|
+
type FormValidationType<T extends any = void> = {
|
|
2558
|
+
/** Is een value required? */
|
|
2559
|
+
required?: boolean;
|
|
2560
|
+
/**
|
|
2561
|
+
* - Min value voor numbers
|
|
2562
|
+
* - Min-length voor strings
|
|
2563
|
+
* - Min-waarde voor ranges,
|
|
2564
|
+
* - Minimaal aantal selected in multiselect,
|
|
2565
|
+
* - Min-date voor datum/tijd ("YYYY-MM-DD", "HH:mm" of "YYYY-MM-DDT:HH:mm").
|
|
2566
|
+
* GEBRUIKT VOOR VALIDATIE */
|
|
2567
|
+
min?: number | string;
|
|
2568
|
+
/**
|
|
2569
|
+
* - Max value voor numbers,
|
|
2570
|
+
* - Max-length voor strings,
|
|
2571
|
+
* - Max-waarde voor ranges,
|
|
2572
|
+
* - Maximaal aantal selected in multiselect,
|
|
2573
|
+
* - Max-date voor datum/tijd ("YYYY-MM-DD", "HH:mm" of "YYYY-MM-DDT:HH:mm").
|
|
2574
|
+
* GEBRUIKT VOOR VALIDATIE */
|
|
2575
|
+
max?: number | string;
|
|
2576
|
+
/** Voor <input type="multirange">: het minimale verschil tussen 2 waarden. */
|
|
2577
|
+
minDiff?: number;
|
|
2578
|
+
/** Voor <input type="multirange">: het maximale verschil tussen 2 waarden. */
|
|
2579
|
+
maxDiff?: number;
|
|
2580
|
+
/** Een pattern voor string-validatie */
|
|
2581
|
+
pattern?: string | RegExp;
|
|
2582
|
+
/**
|
|
2583
|
+
* een extra validatie-methode
|
|
2584
|
+
* @param val de nieuwe te valideren waarde
|
|
2585
|
+
* @returns een string met daarin de foutmelding OF een lege string voor een valid waarde.
|
|
2586
|
+
*/
|
|
2587
|
+
onValidate?: (val: T | string | string[] | number | number[] | boolean | Date | FileList | any) => string;
|
|
2588
|
+
};
|
|
2589
|
+
type InputTypeProp = 'text' | 'password' | 'number' | 'email' | 'tel' | 'url' | 'range' | 'date' | 'datetime-local' | 'datetime' | 'month' | 'week' | 'time' | 'color' | 'search' | 'multirange' | 'multiselect' | 'select' | 'textarea';
|
|
2590
|
+
|
|
2591
|
+
type RadioInputProps = Omit<BaseInputProps, 'icons' | 'labelHidden' | 'spellCheck'> & {
|
|
2592
|
+
value?: string;
|
|
2593
|
+
children?: React$1.ReactNode;
|
|
2594
|
+
onValueChanged?(newVal: string, isValid?: boolean): any | void;
|
|
2595
|
+
};
|
|
2596
|
+
type RadioItemProps = {
|
|
2597
|
+
/** ID van radio item */
|
|
2598
|
+
id?: string;
|
|
2599
|
+
/** Radio item value */
|
|
2600
|
+
value: string;
|
|
2601
|
+
/** Is disabled */
|
|
2602
|
+
disabled?: boolean;
|
|
2603
|
+
/** Tootlip */
|
|
2604
|
+
tooltip?: string;
|
|
2605
|
+
/** Content */
|
|
2606
|
+
children?: React$1.ReactNode;
|
|
2607
|
+
/** Grootte van de radiobutton (defaulkt = 'm', normal) */
|
|
2608
|
+
size?: SizeProp;
|
|
2609
|
+
/** Kleur van de radiobutton (default = 'l', link) */
|
|
2610
|
+
color?: ColorProp;
|
|
2611
|
+
/** Speciale styling van de radiobutton */
|
|
2612
|
+
styling?: CheckradioStylingType;
|
|
2613
|
+
/** Verticaal of horizontall weergeven? */
|
|
2614
|
+
direction?: DirectionProp;
|
|
2615
|
+
/** Waar moet de tekst van de input uitgelijnd worden (default = 'l', links) */
|
|
2616
|
+
textAlign?: TextAlignmentProp;
|
|
2617
|
+
};
|
|
2618
|
+
/**
|
|
2619
|
+
* Een groep radio-buttons voor een <input type="radio" />
|
|
2620
|
+
* @param props
|
|
2621
|
+
* @returns een radio-group
|
|
2622
|
+
* @example
|
|
2623
|
+
* <RadioGroup name="radioGroup" value="1" onValueChanged={change}>
|
|
2624
|
+
* <RadioGroup.Item value="1">Radio 1</RadioGroup.Item>
|
|
2625
|
+
* <RadioGroup.Item value="2">Radio 2</RadioGroup.Item>
|
|
2626
|
+
* </RadioGroup>
|
|
2627
|
+
* @description alle props voor RadioGroup component
|
|
2628
|
+
* | prop | type | default | description |
|
|
2629
|
+
* |-------------------|----------------------|---------|--------------------------------------------|
|
|
2630
|
+
* | name | `string ` | | de naam voor de input (REQUIRED) |
|
|
2631
|
+
* | label | `string ` | `name` | de label voor de input |
|
|
2632
|
+
* | id | `string ` | `name` | de id voor de input |
|
|
2633
|
+
* | tooltip | `string ` | | tooltip voor de input |
|
|
2634
|
+
* | labelHidden | `boolean` | `false` | de label is verborgen (screenreaders) |
|
|
2635
|
+
* | disabled | `boolean` | `false` | de input is disabled |
|
|
2636
|
+
* | textAlign | `l`, `c`, `r` | `l` | de text-align van de input |
|
|
2637
|
+
* | keyboardType | `search`, `text`, | `text ` | de type van de keyboard (touch-devices) |
|
|
2638
|
+
* | | `email`,`tel`,`url` | | |
|
|
2639
|
+
* | | `numeric`, `decimal` | | |
|
|
2640
|
+
* | validation | `FormValidationType` | `{}` | de validatie voor de input |
|
|
2641
|
+
* | value | `string` | | de waarde |
|
|
2642
|
+
* | size | `s`,`m`,`l`,`xl` | `m` | de grootte van de input |
|
|
2643
|
+
* | direction | `h`,`v` | `h` | de form-richting voor de input |
|
|
2644
|
+
* | errorMessage | `string ` | | een error message (van buiten setbaar) |
|
|
2645
|
+
* | placeholder | `string ` | | de placeholder voor de input |
|
|
2646
|
+
* | onValueChanged() | `function` | | (value: string, valid?: boolean) => void |
|
|
2647
|
+
* | onKeyDown() | `function` | | (event: React.KeyboardEvent) => void |
|
|
2648
|
+
*/
|
|
2649
|
+
declare const RadioGroup: {
|
|
2650
|
+
(props: RadioInputProps): JSX.Element;
|
|
2651
|
+
/**
|
|
2652
|
+
* Een Radio-button voor in de RadioGroup
|
|
2653
|
+
* @param props
|
|
2654
|
+
* @returns een radio-item
|
|
2655
|
+
* @example
|
|
2656
|
+
* <RadioGroup.Item name="item 1" value="item1">Radio item 1</RadioGroup.Item>
|
|
2657
|
+
* @description alle props voor RadioGroup.Item component
|
|
2658
|
+
* | prop | type | default | description |
|
|
2659
|
+
* |-------------------|----------------------|---------|--------------------------------------------|
|
|
2660
|
+
* | id | `string ` | `name` | de id voor het radioitem |
|
|
2661
|
+
* | tooltip | `string ` | | tooltip voor het item |
|
|
2662
|
+
* | labelHidden | `boolean` | false | de label is verborgen (screenreaders) |
|
|
2663
|
+
* | disabled | `boolean` | false | de input is disabled |
|
|
2664
|
+
* | value | `string ` | #000000 | de waarde (REQUIRED) |
|
|
2665
|
+
* | children | `React.ReactNode` | | de tekst van het item (REQUIRED) |
|
|
2666
|
+
* | size | `s`,`m`,`l`,`xl` | `m` | de grootte van de input |
|
|
2667
|
+
* | color | `w`,`d`,`i`,`s`,`p` | `l` | de kleur van de input |
|
|
2668
|
+
* | styling | `rounded`,`noborder` | | de styling van de checkbox |
|
|
2669
|
+
* | | `colored`, `blocky` | | |
|
|
2670
|
+
* | direction | `h`,`v` | `h` | de form-richting voor de input |
|
|
2671
|
+
* | icons | | | RADIOGROUP HEEFT GEEN ICONS |
|
|
2672
|
+
*/
|
|
2673
|
+
Item: (props: RadioItemProps) => JSX.Element;
|
|
2674
|
+
};
|
|
2675
|
+
/** DO NOT EXPORT -- INTERN USE ONLY */
|
|
2676
|
+
declare function InternRadioItem(props: RadioItemProps & {
|
|
2677
|
+
name: string;
|
|
2678
|
+
selectedItem: string;
|
|
2679
|
+
helpTag?: string;
|
|
2680
|
+
setter: (identifier: string) => void;
|
|
2681
|
+
onFocus?: (e: React$1.FocusEvent<HTMLInputElement>, ht?: string) => void;
|
|
2682
|
+
}): JSX.Element;
|
|
2683
|
+
/**
|
|
2684
|
+
* Een losstaand radio-item om zelf de groep te maken
|
|
2685
|
+
* @param props
|
|
2686
|
+
* @returns een radio-item
|
|
2687
|
+
* @example
|
|
2688
|
+
* <RadioItem name="item 1" value="item1" selecteditem={radioItem}>Radio item 1</RadioItem>
|
|
2689
|
+
* @description alle props voor RadioItem component
|
|
2690
|
+
* | prop | type | default | description |
|
|
2691
|
+
* |-------------------|----------------------|---------|--------------------------------------------|
|
|
2692
|
+
* | name | `string ` | | de naam voor de input (REQUIRED) |
|
|
2693
|
+
* | selectedItem | `string ` | | de naam voor de input (REQUIRED) |
|
|
2694
|
+
* | id | `string ` | `name` | de id voor het radioitem |
|
|
2695
|
+
* | tooltip | `string ` | | tooltip voor het item |
|
|
2696
|
+
* | labelHidden | `boolean` | false | de label is verborgen (screenreaders) |
|
|
2697
|
+
* | disabled | `boolean` | false | de input is disabled |
|
|
2698
|
+
* | value | `string ` | | de waarde (REQUIRED) |
|
|
2699
|
+
* | children | `React.ReactNode` | | de tekst van het item (REQUIRED) |
|
|
2700
|
+
* | size | `s`,`m`,`l`,`xl` | `m` | de grootte van de input |
|
|
2701
|
+
* | color | `w`,`d`,`i`,`s`,`p` | `l` | de kleur van de input |
|
|
2702
|
+
* | styling | `rounded`,`noborder` | | de styling van de checkbox |
|
|
2703
|
+
* | | `colored`, `blocky` | | |
|
|
2704
|
+
* | direction | `h`,`v` | `h` | de form-richting voor de input |
|
|
2705
|
+
* | setter() | `function` | | (val: string) => void |
|
|
2706
|
+
*/
|
|
2707
|
+
declare const Radio: typeof InternRadioItem;
|
|
2708
|
+
|
|
2709
|
+
type CheckboxInputProps = Omit<BaseInputProps, 'icons' | 'labelHidden' | 'spellCheck'> & {
|
|
2710
|
+
/** Kleur van de checkbox (default = 'l', link) */
|
|
2711
|
+
color?: ColorProp;
|
|
2712
|
+
/** Speciale styling van de checkbox */
|
|
2713
|
+
styling?: CheckradioStylingType;
|
|
2714
|
+
/** De waarde */
|
|
2715
|
+
value?: boolean;
|
|
2716
|
+
/** Wat te doen als de waarde is veranderd
|
|
2717
|
+
* @param newVal: de nieuwe waarde
|
|
2718
|
+
* @param isValid is de waarde gevalideerd en geldig?
|
|
2719
|
+
*/
|
|
2720
|
+
onValueChanged?(newVal: boolean, isValid?: boolean): any | void;
|
|
2721
|
+
};
|
|
2722
|
+
/**
|
|
2723
|
+
* Maak een checkbox input
|
|
2724
|
+
* @param props
|
|
2725
|
+
* @returns een checkbox
|
|
2726
|
+
* @example <Checkbox value={true} {...props}/>
|
|
2727
|
+
* @description alle props voor Checkbox component
|
|
2728
|
+
* | prop | type | default | description |
|
|
2729
|
+
* |-------------------|----------------------|---------|--------------------------------------------|
|
|
2730
|
+
* | name | `string ` | | de naam voor de input (REQUIRED) |
|
|
2731
|
+
* | label | `string ` | `name` | de label voor de input |
|
|
2732
|
+
* | id | `string ` | `name` | de id voor de input |
|
|
2733
|
+
* | tooltip | `string ` | | tooltip voor de input |
|
|
2734
|
+
* | labelHidden | `boolean` | `false` | de label is verborgen (screenreaders) |
|
|
2735
|
+
* | disabled | `boolean` | `false` | de input is disabled |
|
|
2736
|
+
* | validation | `FormValidationType` | `{} ` | de validatie voor de input |
|
|
2737
|
+
* | textAlign | `l`, `c`, `r` | `l` | de text-uitlijning van de input |
|
|
2738
|
+
* | keyboardType | `search`, `text`, | `text` | de type van de keyboard (touch-devices) |
|
|
2739
|
+
* | | `email`,`tel`,`url` | | |
|
|
2740
|
+
* | | `numeric`, `decimal` | | |
|
|
2741
|
+
* | value | `boolean` | `false` | de waarde |
|
|
2742
|
+
* | color | `l`,`p`,`s` | `l` | de kleur van de checkbox |
|
|
2743
|
+
* | | `d`,`w`,`i` | | |
|
|
2744
|
+
* | size | `s`,`m`,`l`,`xl` | `m` | de grootte van de input |
|
|
2745
|
+
* | direction | `h`,`v` | `h` | de form-richting voor de input |
|
|
2746
|
+
* | styling | `rounded`,`noborder` | | de styling van de checkbox |
|
|
2747
|
+
* | | `colored`, `blocky` | | |
|
|
2748
|
+
* | errorMessage | `string ` | | een error message (van buiten setbaar) |
|
|
2749
|
+
* | onValueChanged() | `function` | | (value: boolean, valid?: boolean) => void |
|
|
2750
|
+
* | onKeyDown() | `function` | | (event: React.KeyboardEvent) => void |
|
|
2751
|
+
*/
|
|
2752
|
+
declare function CheckBox(props: CheckboxInputProps): JSX.Element;
|
|
2753
|
+
|
|
2754
|
+
type DateInputProps = BaseInputProps & {
|
|
2755
|
+
/** Start value voor deze input (optional) FORMAT: YYYY-MM-DD */
|
|
2756
|
+
value?: string | Date;
|
|
2757
|
+
/**
|
|
2758
|
+
* Wat te doen als de waarde is veranderd
|
|
2759
|
+
* @param newVal: de nieuwe waarde
|
|
2760
|
+
* @param valid: is de nieuwe waarde geldig?
|
|
2761
|
+
*/
|
|
2762
|
+
onValueChanged?(newVal: string, valid: boolean): any | void;
|
|
2763
|
+
};
|
|
2764
|
+
/**
|
|
2765
|
+
* Input voor het opgeven van een datum
|
|
2766
|
+
* @param props
|
|
2767
|
+
* @returns input met als value een datum
|
|
2768
|
+
* @example
|
|
2769
|
+
* <DateInput value="2020-01-01" {...props}/>
|
|
2770
|
+
* <DateInput value={new Date()} {...props}/>
|
|
2771
|
+
* @description alle props voor Date component
|
|
2772
|
+
* | prop | type | default | description |
|
|
2773
|
+
* |-------------------|----------------------|---------|--------------------------------------------|
|
|
2774
|
+
* | name | `string ` | | de naam voor de input (REQUIRED) |
|
|
2775
|
+
* | label | `string ` | `name` | de label voor de input |
|
|
2776
|
+
* | id | `string ` | `name` | de id voor de input |
|
|
2777
|
+
* | tooltip | `string ` | | tooltip voor de input |
|
|
2778
|
+
* | labelHidden | `boolean` | `false` | de label is verborgen (screenreaders) |
|
|
2779
|
+
* | spellCheck | `boolean` | `false` | Moet de browser deze input spell-checken? |
|
|
2780
|
+
* | disabled | `boolean` | `false` | de input is disabled |
|
|
2781
|
+
* | textAlign | `l`, `c`, `r` | `l` | de text-uitlijning van de input |
|
|
2782
|
+
* | keyboardType | `search`, `text`, | `text` | de type van de keyboard (touch-devices) |
|
|
2783
|
+
* | | `email`,`tel`,`url` | | |
|
|
2784
|
+
* | | `numeric`, `decimal` | | |
|
|
2785
|
+
* | validation | `FormValidationType` | `{}` | de validatie voor de input |
|
|
2786
|
+
* | value | `string`, `Date` | `now()` | de waarde |
|
|
2787
|
+
* | size | `s`,`m`,`l`,`xl` | `m` | de grootte van de input |
|
|
2788
|
+
* | direction | `h`,`v` | `h` | de form-richting voor de input |
|
|
2789
|
+
* | errorMessage | `string ` | | een error message (van buiten setbaar) |
|
|
2790
|
+
* | placeholder | `string ` | | de placeholder voor de input |
|
|
2791
|
+
* | onValueChanged() | `function` | | (value: string, valid?: boolean) => void |
|
|
2792
|
+
* | onKeyDown() | `function` | | (event: React.KeyboardEvent) => void ` */
|
|
2793
|
+
declare function DateInput(props: DateInputProps): JSX.Element;
|
|
2794
|
+
|
|
2795
|
+
type DateTimeInputProps = BaseInputProps & {
|
|
2796
|
+
/** Start value voor deze input (optional) FORMAT: YYYY-MM-DDTHH:mm */
|
|
2797
|
+
value?: string | Date;
|
|
2798
|
+
/**
|
|
2799
|
+
* Wat te doen als de waarde is veranderd
|
|
2800
|
+
* @param newVal: de nieuwe waarde
|
|
2801
|
+
* @param valid: is de nieuwe waarde geldig?
|
|
2802
|
+
*/
|
|
2803
|
+
onValueChanged?(newVal: string, valid: boolean): any | void;
|
|
2804
|
+
};
|
|
2805
|
+
/** Input voor het opgeven van een datum-tijd combinatie
|
|
2806
|
+
* @param props
|
|
2807
|
+
* @returns Een input voor een Datum en Tijd combinatie
|
|
2808
|
+
* @example
|
|
2809
|
+
* <DateTimeInput value="2020-01-01T00:00" {...props}/>
|
|
2810
|
+
* <DateTimeInput value={new Date()} {...props}/>
|
|
2811
|
+
* @description alle props voor DateTime component
|
|
2812
|
+
* | prop | type | default | description |
|
|
2813
|
+
* |-------------------|----------------------|---------|--------------------------------------------|
|
|
2814
|
+
* | name | `string ` | | de naam voor de input (REQUIRED) |
|
|
2815
|
+
* | label | `string ` | `name` | de label voor de input |
|
|
2816
|
+
* | id | `string ` | `name` | de id voor de input |
|
|
2817
|
+
* | tooltip | `string ` | | tooltip voor de input |
|
|
2818
|
+
* | labelHidden | `boolean` | `false` | de label is verborgen (screenreaders) |
|
|
2819
|
+
* | spellCheck | `boolean` | `false` | Moet de browser deze input spell-checken? |
|
|
2820
|
+
* | disabled | `boolean` | `false` | de input is disabled |
|
|
2821
|
+
* | textAlign | `l`, `c`, `r` | `l` | de text-uitlijning van de input |
|
|
2822
|
+
* | keyboardType | `search`, `text`, | `text ` | de type van de keyboard (touch-devices) |
|
|
2823
|
+
* | | `email`,`tel`,`url` | | |
|
|
2824
|
+
* | | `numeric`, `decimal` | | |
|
|
2825
|
+
* | validation | `FormValidationType` | `{}` | de validatie voor de input |
|
|
2826
|
+
* | value | `string`, `Date` | `now()` | de waarde |
|
|
2827
|
+
* | size | `s`,`m`,`l`,`xl` | `m` | de grootte van de input |
|
|
2828
|
+
* | direction | `h`,`v` | `h` | de form-richting voor de input |
|
|
2829
|
+
* | errorMessage | `string ` | | een error message (van buiten setbaar) |
|
|
2830
|
+
* | placeholder | `string ` | | de placeholder voor de input |
|
|
2831
|
+
* | onValueChanged() | `function` | | (value: string, valid?: boolean) => void |
|
|
2832
|
+
* | onKeyDown() | `function` | | (event: React.KeyboardEvent) => void |
|
|
2833
|
+
*/
|
|
2834
|
+
declare function DateTimeInput(props: DateTimeInputProps): JSX.Element;
|
|
2835
|
+
|
|
2836
|
+
type TimeInputProps = BaseInputProps & {
|
|
2837
|
+
/** Start value voor deze input (optional) FORMAT: HH:mm:SS */
|
|
2838
|
+
value?: string | Date;
|
|
2839
|
+
/** Grootte van een stap verzetten. het aantal secondes om de klok te verzetten, default = 60 (1 minuut) */
|
|
2840
|
+
step?: number;
|
|
2841
|
+
/**
|
|
2842
|
+
* Wat te doen als de waarde is veranderd
|
|
2843
|
+
* @param newVal: de nieuwe waarde
|
|
2844
|
+
* @param valid: is de nieuwe waarde geldig?
|
|
2845
|
+
*/
|
|
2846
|
+
onValueChanged?(newVal: string, valid: boolean): void;
|
|
2847
|
+
};
|
|
2848
|
+
/**
|
|
2849
|
+
* Input om een tijd op te geven (HH:mm OF HH:mm:SS) met optionele validatie
|
|
2850
|
+
* @param props
|
|
2851
|
+
* @returns
|
|
2852
|
+
* @example
|
|
2853
|
+
* <TimeInput value="12:30" {...props}>
|
|
2854
|
+
* <TimeInput value={new Date()} {...props}>
|
|
2855
|
+
* * @description alle props voor Time component
|
|
2856
|
+
* | prop | type | default | description |
|
|
2857
|
+
* |-------------------|----------------------|---------|--------------------------------------------|
|
|
2858
|
+
* | name | `string ` | | de naam voor de input (REQUIRED) |
|
|
2859
|
+
* | label | `string ` | `name` | de label voor de input |
|
|
2860
|
+
* | id | `string ` | `name` | de id voor de input |
|
|
2861
|
+
* | spellCheck | `boolean` | `false` | Moet de browser deze input spell-checken? |
|
|
2862
|
+
* | tooltip | `string ` | | tooltip voor de input |
|
|
2863
|
+
* | labelHidden | `boolean` | `false` | de label is verborgen (screenreaders) |
|
|
2864
|
+
* | disabled | `boolean` | `false` | de input is disabled |
|
|
2865
|
+
* | textAlign | `l`, `c`, `r` | `l` | de text-uitlijning van de input |
|
|
2866
|
+
* | keyboardType | `search`, `text`, | `text ` | de type van de keyboard (touch-devices) |
|
|
2867
|
+
* | | `email`,`tel`,`url` | | |
|
|
2868
|
+
* | | `numeric`, `decimal` | | |
|
|
2869
|
+
* | validation | `FormValidationType` | `{} ` | de validatie voor de input |
|
|
2870
|
+
* | value | `string`, `Date` | `now()` | de waarde |
|
|
2871
|
+
* | size | `s`,`m`,`l`,`xl` | `m` | de grootte van de input |
|
|
2872
|
+
* | direction | `h`,`v` | `h` | de form-richting voor de input |
|
|
2873
|
+
* | errorMessage | `string ` | | een error message (van buiten setbaar) |
|
|
2874
|
+
* | placeholder | `string ` | | de placeholder voor de input |
|
|
2875
|
+
* | onValueChanged() | `function` | | (value: string, valid?: boolean) => void |
|
|
2876
|
+
* | onKeyDown() | `function` | | (event: React.KeyboardEvent) => void |
|
|
2877
|
+
*/
|
|
2878
|
+
declare function TimeInput(props: TimeInputProps): JSX.Element;
|
|
2879
|
+
|
|
2880
|
+
type MultiRangeInputProps = Omit<BaseInputProps, 'icons' | 'spellCheck' | 'helpTag'> & {
|
|
2881
|
+
helpTag?: [string, string];
|
|
2882
|
+
/** Stap-grootte voor de input (optional, default = 1) */
|
|
2883
|
+
step?: number;
|
|
2884
|
+
/** De start-waarde voor de input (optional) */
|
|
2885
|
+
value?: [number, number];
|
|
2886
|
+
/** een eenheid voor de waardes van de input (`%`, `kg/m3`, etc) */
|
|
2887
|
+
unit?: string;
|
|
2888
|
+
/**
|
|
2889
|
+
* Wat te doen als de waarde is veranderd
|
|
2890
|
+
* @param newVal: de nieuwe waarde
|
|
2891
|
+
* @param valid: is de nieuwe waarde geldig?
|
|
2892
|
+
*/
|
|
2893
|
+
onValueChanged?(newVal: [number, number], valid: boolean): any | void;
|
|
2894
|
+
};
|
|
2895
|
+
/**
|
|
2896
|
+
* Gebruik een input met een range-selector; <input type="range" ... />
|
|
2897
|
+
* De min- en max-waarden zijn instelbaar via props.validatie. Default zijn dit (0 en 100)
|
|
2898
|
+
* @param props
|
|
2899
|
+
* @returns een range input met als value een array van twee waarden
|
|
2900
|
+
* @example <MultiRangeInput value={[valueA, valueB]} validation={{min: 10, max: 110}} {...props}/>
|
|
2901
|
+
* @description alle props voor MultiRange component
|
|
2902
|
+
* | prop | type | default | description |
|
|
2903
|
+
* |-------------------|----------------------|---------|--------------------------------------------|
|
|
2904
|
+
* | name | `string ` | | de naam voor de input (REQUIRED) |
|
|
2905
|
+
* | label | `string ` | `name` | de label voor de input |
|
|
2906
|
+
* | id | `string ` | `name` | de id voor de input |
|
|
2907
|
+
* | tooltip | `string ` | | tooltip voor de input |
|
|
2908
|
+
* | step | `number ` | `1 ` | stapgrootte voor verschuiving |
|
|
2909
|
+
* | labelHidden | `boolean` | `false` | de label is verborgen (screenreaders) |
|
|
2910
|
+
* | disabled | `boolean` | `false` | de input is disabled |
|
|
2911
|
+
* | unit | `string` | `''` | Een eenheid voor de waardes uit de range |
|
|
2912
|
+
* | keyboardType | `search`, `text`, | `text ` | de type van de keyboard (touch-devices) |
|
|
2913
|
+
* | | `email`,`tel`,`url` | | |
|
|
2914
|
+
* | | `numeric`, `decimal` | | |
|
|
2915
|
+
* | validation | `FormValidationType` | `{}` | de validatie voor de input |
|
|
2916
|
+
* | value | `[number, number]` |`[0, 100]`| de waarde als number-tuple |
|
|
2917
|
+
* | direction | `h`,`v` | `h` | de form-richting voor de input |
|
|
2918
|
+
* | errorMessage | `string ` | | een error message (van buiten setbaar) |
|
|
2919
|
+
* | placeholder | `string ` | | de placeholder voor de input |
|
|
2920
|
+
* | onValueChanged() | `function` | | (value: [number, number], valid?: boolean) => void |
|
|
2921
|
+
* | onKeyDown() | `function` | | (event: React.KeyboardEvent) => void |
|
|
2922
|
+
*/
|
|
2923
|
+
declare function MultiRangeInput(props: MultiRangeInputProps): JSX.Element;
|
|
2924
|
+
|
|
2925
|
+
type NumberInputProps = BaseInputProps & {
|
|
2926
|
+
/** Stap-grootte voor de input (optional, default = 1) */
|
|
2927
|
+
step?: number;
|
|
2928
|
+
/** De start-waarde voor de input (optional) */
|
|
2929
|
+
value?: number;
|
|
2930
|
+
/**
|
|
2931
|
+
* Wat te doen als de waarde is veranderd
|
|
2932
|
+
* @param newVal: de nieuwe waarde
|
|
2933
|
+
* @param valid: is de nieuwe waarde geldig?
|
|
2934
|
+
*/
|
|
2935
|
+
onValueChanged?(newVal: number, valid: boolean): any | void;
|
|
2936
|
+
};
|
|
2937
|
+
/**
|
|
2938
|
+
* Maak een input van type number met optionele validation.
|
|
2939
|
+
* @see RangeInput voor een input van type range die ook numbers oplevert.
|
|
2940
|
+
* @param props
|
|
2941
|
+
* @returns input with numeric values
|
|
2942
|
+
* @example <NumberInput value={10} onValueChanged={handleChange} {...props} />
|
|
2943
|
+
* @description alle props voor Number component
|
|
2944
|
+
* | prop | type | default | description |
|
|
2945
|
+
* |-------------------|----------------------|---------|--------------------------------------------|
|
|
2946
|
+
* | name | `string ` | | de naam voor de input (REQUIRED) |
|
|
2947
|
+
* | label | `string ` | `name` | de label voor de input |
|
|
2948
|
+
* | id | `string ` | `name` | de id voor de input |
|
|
2949
|
+
* | step | `number ` | `1` | stapgrootte voor de input (+ & - aansturen)|
|
|
2950
|
+
* | tooltip | `string ` | | tooltip voor de input |
|
|
2951
|
+
* | spellCheck | `boolean` | `false` | Moet de browser deze input spell-checken? |
|
|
2952
|
+
* | labelHidden | `boolean` | `false` | de label is verborgen (screenreaders) |
|
|
2953
|
+
* | disabled | `boolean` | `false` | de input is disabled |
|
|
2954
|
+
* | textAlign | `l`, `c`, `r` | `l` | de text-align van de input |
|
|
2955
|
+
* | keyboardType | `search`, `text`, | `text` | de type van de keyboard (touch-devices) |
|
|
2956
|
+
* | | `email`,`tel`,`url` | | |
|
|
2957
|
+
* | | `numeric`, `decimal` | | |
|
|
2958
|
+
* | validation | `FormValidationType` | `{}` | de validatie voor de input |
|
|
2959
|
+
* | value | `number` | | de waarde |
|
|
2960
|
+
* | size | `s`,`m`,`l`,`xl` | `m` | de grootte van de input |
|
|
2961
|
+
* | direction | `h`,`v` | `h` | de form-richting voor de input |
|
|
2962
|
+
* | errorMessage | `string ` | | een error message (van buiten setbaar) |
|
|
2963
|
+
* | placeholder | `string ` | | de placeholder voor de input |
|
|
2964
|
+
* | onValueChanged() | `function` | | (value: number, valid?: boolean) => void |
|
|
2965
|
+
* | onKeyDown() | `function` | | (event: React.KeyboardEvent) => void |
|
|
2966
|
+
*/
|
|
2967
|
+
declare function NumberInput(props: NumberInputProps): JSX.Element;
|
|
2968
|
+
|
|
2969
|
+
type RangeInputProps = Omit<BaseInputProps, 'icons' | 'spellCheck'> & {
|
|
2970
|
+
/** Stap-grootte voor de input (optional, default = 1) */
|
|
2971
|
+
step?: number;
|
|
2972
|
+
/** een getals-unit (`%`, `kg/m3`, etc) om weer te geven op de range-input */
|
|
2973
|
+
unit?: string;
|
|
2974
|
+
/** De start-waarde voor de input (optional) */
|
|
2975
|
+
value?: number;
|
|
2976
|
+
/**
|
|
2977
|
+
* Wat te doen als de waarde is veranderd
|
|
2978
|
+
* @param newVal: de nieuwe waarde
|
|
2979
|
+
* @param valid: is de nieuwe waarde geldig?
|
|
2980
|
+
*/
|
|
2981
|
+
onValueChanged?(newVal: number, valid: boolean): any | void;
|
|
2982
|
+
};
|
|
2983
|
+
/**
|
|
2984
|
+
* Gebruik een input met een range-selector; <input type="range" ... />
|
|
2985
|
+
* De min- en max-waarden zijn instelbaar via props.validatie. Default zijn dit (0 en 100)
|
|
2986
|
+
* @see NumberInput om een nimerieke waarde in te typen
|
|
2987
|
+
* @param props
|
|
2988
|
+
* @returns een input om een range te selecteren
|
|
2989
|
+
* @example <RangeInput value={value} validation={{min: 10, max: 110}} {...props}/>
|
|
2990
|
+
* @description alle props voor Range component
|
|
2991
|
+
* | prop | type | default | description |
|
|
2992
|
+
* |-------------------|----------------------|---------|--------------------------------------------|
|
|
2993
|
+
* | name | `string ` | | de naam voor de input (REQUIRED) |
|
|
2994
|
+
* | label | `string ` | `name` | de label voor de input |
|
|
2995
|
+
* | id | `string ` | `name` | de id voor de input |
|
|
2996
|
+
* | tooltip | `string ` | | tooltip voor de input |
|
|
2997
|
+
* | step | `number ` | `1 ` | stapgrootte voor verschuiving |
|
|
2998
|
+
* | labelHidden | `boolean` | `false` | de label is verborgen (screenreaders) |
|
|
2999
|
+
* | disabled | `boolean` | `false` | de input is disabled |
|
|
3000
|
+
* | unit | `string ` | '' | een eenheid voor de input |
|
|
3001
|
+
* | keyboardType | `search`, `text`, | `text ` | de type van de keyboard (touch-devices) |
|
|
3002
|
+
* | | `email`,`tel`,`url` | | |
|
|
3003
|
+
* | | `numeric`, `decimal` | | |
|
|
3004
|
+
* | validation | `FormValidationType` | `{}` | de validatie voor de input |
|
|
3005
|
+
* | value | `number ` | | de waarde |
|
|
3006
|
+
* | direction | `h`,`v` | `h` | de form-richting voor de input |
|
|
3007
|
+
* | errorMessage | `string ` | | een error message (van buiten setbaar) |
|
|
3008
|
+
* | placeholder | `string ` | | de placeholder voor de input |
|
|
3009
|
+
* | onValueChanged() | `function` | | (value: string, valid?: boolean) => void |
|
|
3010
|
+
* | onKeyDown() | `function` | | (event: React.KeyboardEvent) => void |
|
|
3011
|
+
*/
|
|
3012
|
+
declare function RangeInput(props: RangeInputProps): JSX.Element;
|
|
3013
|
+
|
|
3014
|
+
type ColorInputProps = BaseInputProps & {
|
|
3015
|
+
/** Start value voor deze input (optioneel) */
|
|
3016
|
+
value?: string;
|
|
3017
|
+
/**
|
|
3018
|
+
* Wat te doen als de waarde is veranderd
|
|
3019
|
+
* @param newVal: de nieuwe waarde
|
|
3020
|
+
* @param valid: is de nieuwe waarde geldig?
|
|
3021
|
+
*/
|
|
3022
|
+
onValueChanged?(newVal: string, isValid?: boolean): any | void;
|
|
3023
|
+
};
|
|
3024
|
+
/**
|
|
3025
|
+
* Maak een input voor hexadecimale kleuren.
|
|
3026
|
+
* altijd: #000000 t/m #ffffff
|
|
3027
|
+
* @param props
|
|
3028
|
+
* @returns input om een color te selecteren
|
|
3029
|
+
* @example <ColorInput value="#FF8000" {...props}/>
|
|
3030
|
+
* @description alle props voor Color component
|
|
3031
|
+
* | prop | type | default | description |
|
|
3032
|
+
* |-------------------|----------------------|---------|--------------------------------------------|
|
|
3033
|
+
* | name | `string` | | de naam voor de input (REQUIRED) |
|
|
3034
|
+
* | label | `string` | `name` | de label voor de input |
|
|
3035
|
+
* | id | `string` | `name` | de id voor de input |
|
|
3036
|
+
* | tooltip | `string` | | tooltip voor de input |
|
|
3037
|
+
* | labelHidden | `boolean` | `false` | de label is verborgen (screenreaders) |
|
|
3038
|
+
* | spellCheck | `boolean` | `false` | Moet de browser deze input spell-checken? |
|
|
3039
|
+
* | disabled | `boolean` | `false` | de input is disabled |
|
|
3040
|
+
* | keyboardType | `search`, `text`, | `text ` | de type van de keyboard (touch-devices) |
|
|
3041
|
+
* | | `email`,`tel`,`url` | | |
|
|
3042
|
+
* | | `numeric`, `decimal` | | |
|
|
3043
|
+
* | validation | `FormValidationType` | `{}` | de validatie voor de input |
|
|
3044
|
+
* | value | `string` |`#000000`| de waarde |
|
|
3045
|
+
* | size | `s`,`m`,`l`,`xl` | `m` | de grootte van de input |
|
|
3046
|
+
* | direction | `h`,`v` | `h` | de form-richting voor de input |
|
|
3047
|
+
* | errorMessage | `string` | | een error message (van buiten setbaar) |
|
|
3048
|
+
* | placeholder | `string` | | de placeholder voor de input |
|
|
3049
|
+
* | onValueChanged() | `function` | | (value: string, valid?: boolean) => void |
|
|
3050
|
+
* | onKeyDown() | `function` | | (event: React.KeyboardEvent) => void |
|
|
3051
|
+
*/
|
|
3052
|
+
declare function ColorInput(props: ColorInputProps): JSX.Element;
|
|
3053
|
+
|
|
3054
|
+
type HiddenInputProps = {
|
|
3055
|
+
/** Start value voor deze input (optioneel) */
|
|
3056
|
+
value?: string;
|
|
3057
|
+
/** Name input: gebruikt voor een <label> als er geen label gedefinieerd is & de name-attribuut <input> */
|
|
3058
|
+
name: string;
|
|
3059
|
+
/** ID voor de input: gebruikt voor een <label for="*id*}"> */
|
|
3060
|
+
id: string;
|
|
3061
|
+
/** Moet dit verborgen field worden ingevoerd */
|
|
3062
|
+
required?: boolean;
|
|
3063
|
+
/** (optional) Tooltip voor een hidden input ??? vooral voor test-doeleinden */
|
|
3064
|
+
tooltip?: string;
|
|
3065
|
+
};
|
|
3066
|
+
/**
|
|
3067
|
+
* Maak een input die verborgen is maar wel een waarde moet hebben.
|
|
3068
|
+
* @param props
|
|
3069
|
+
* @returns een hidden input
|
|
3070
|
+
* @example <HiddenInput value={value} {...props} />
|
|
3071
|
+
* @description alle props voor Hidden component
|
|
3072
|
+
* | prop | type | default | description |
|
|
3073
|
+
* |-------------------|----------------------|---------|--------------------------------------------|
|
|
3074
|
+
* | name | `string ` | | de naam voor de input (REQUIRED) |
|
|
3075
|
+
* | id | `string ` | `name` | de id voor de input | |
|
|
3076
|
+
* | value | `string ` | '' | de waarde |
|
|
3077
|
+
* | required | `boolean` | | |
|
|
3078
|
+
*/
|
|
3079
|
+
declare function HiddenInput(props: HiddenInputProps): JSX.Element;
|
|
3080
|
+
|
|
3081
|
+
type SelectOptionType = {
|
|
3082
|
+
/** De waarde van een option */
|
|
3083
|
+
value: number | string;
|
|
3084
|
+
/** Is deze select option disabled */
|
|
3085
|
+
disabled?: boolean;
|
|
3086
|
+
/** De naam van een option (optioneel, bij undefined wordt de waarde gebruikt) */
|
|
3087
|
+
label?: string;
|
|
3088
|
+
};
|
|
3089
|
+
type SelectOptionGroupType = {
|
|
3090
|
+
/** De naam van de <optgroup> */
|
|
3091
|
+
label: string;
|
|
3092
|
+
/** De options */
|
|
3093
|
+
selectOptions: SelectOptionType[];
|
|
3094
|
+
};
|
|
3095
|
+
|
|
3096
|
+
type MultiSelectInputProps = Omit<BaseInputProps, 'icons' | 'spellCheck'> & {
|
|
3097
|
+
/** De waarde */
|
|
3098
|
+
value?: string[];
|
|
3099
|
+
/** De values voor de options. DEZE MOETEN UNIEK ZIJN! */
|
|
3100
|
+
options: string[] | SelectOptionType[] | SelectOptionGroupType[];
|
|
3101
|
+
/** Aantal zichtbare rijen zonder scrollen */
|
|
3102
|
+
rows?: number;
|
|
3103
|
+
/**
|
|
3104
|
+
* Wat te doen als de waarde is veranderd
|
|
3105
|
+
* @param newVal: de nieuwe waarde
|
|
3106
|
+
* @param valid: is de nieuwe waarde geldig?
|
|
3107
|
+
*/
|
|
3108
|
+
onValueChanged?(newVal: string[], valid: boolean): void;
|
|
3109
|
+
};
|
|
3110
|
+
/**
|
|
3111
|
+
* Maak een select waarin meerdere opties geselecteerd kunnen worden.
|
|
3112
|
+
* Wordt weergegeven als een lijstje waarin met ctrl-click, shift-click of cmd-click 2 of meer waarden geselecteerd kunnen worden.
|
|
3113
|
+
* - lijstje van strings
|
|
3114
|
+
* - lijstje van {value: string, label: string, disabled: boolean}
|
|
3115
|
+
* - lijstje van {value: string, label: string, disabled: boolean} per group (<optgroup>)
|
|
3116
|
+
* @see Select voor een select waarin maar 1 waarde geselecteerd kan worden.
|
|
3117
|
+
* @param props
|
|
3118
|
+
* @returns Een MultiSelect waarvan de value ALTIJD een string[] is. Ook als er 1 optie geselecteerd is.
|
|
3119
|
+
* @example <MultiSelect value={['a', 'b']} options={['a', 'b', 'c']} {...props}/>
|
|
3120
|
+
* @description alle props voor MultiSelect component
|
|
3121
|
+
* | prop | type | default | description |
|
|
3122
|
+
* |-------------------|---------------------------|---------|--------------------------------------------|
|
|
3123
|
+
* | name | `string` | | de naam voor de input (REQUIRED) |
|
|
3124
|
+
* | label | `string` | `name` | de label voor de input |
|
|
3125
|
+
* | rows | `number` | `6` | zichtbare rijen in de select |
|
|
3126
|
+
* | id | `string` | `name` | de id voor de input |
|
|
3127
|
+
* | tooltip | `string` | | tooltip voor de input |
|
|
3128
|
+
* | labelHidden | `boolean` | `false` | de label is verborgen (screenreaders) |
|
|
3129
|
+
* | disabled | `boolean` | `false` | de input is disabled |
|
|
3130
|
+
* | textAlign | `l`, `c`, `r` | `l` | de text-align van de input |
|
|
3131
|
+
* | keyboardType | `search`, `text`, | `text ` | de type van de keyboard (touch-devices) |
|
|
3132
|
+
* | | `email`,`tel`,`url` | | |
|
|
3133
|
+
* | | `numeric`, `decimal` | | |
|
|
3134
|
+
* | validation | `FormValidationType` | `{}` | de validatie voor de input |
|
|
3135
|
+
* | value | `string[]` | `[]` | de waarde |
|
|
3136
|
+
* | options | `string[]` | `[]` | de opties |
|
|
3137
|
+
* | | `SelectOptionType[]` | | |
|
|
3138
|
+
* | | `SelectOptionGroupType[]` | | |
|
|
3139
|
+
* | size | `s`,`m`,`l`,`xl` | `m` | de grootte van de input |
|
|
3140
|
+
* | direction | `h`,`v` | `h` | de form-richting voor de input |
|
|
3141
|
+
* | errorMessage | `string`, `function` | | een error message (van buiten setbaar) |
|
|
3142
|
+
* | placeholder | `string` | | de placeholder voor de input |
|
|
3143
|
+
* | onValueChanged() | `function` | | (value: string[], valid?: boolean) => void |
|
|
3144
|
+
* | onKeyDown() | `function` | | (event: React.KeyboardEvent) => void |
|
|
3145
|
+
*/
|
|
3146
|
+
declare function MultiSelect(props: MultiSelectInputProps): JSX.Element;
|
|
3147
|
+
|
|
3148
|
+
type SelectInputProps = Omit<BaseInputProps, 'icons' | 'spellCheck'> & {
|
|
3149
|
+
/** De waarde */
|
|
3150
|
+
value?: number | string;
|
|
3151
|
+
/** De values voor de options. DEZE MOETEN UNIEK ZIJN! */
|
|
3152
|
+
options: string[] | SelectOptionType[] | SelectOptionGroupType[];
|
|
3153
|
+
/** Grootte input (optioneel) */
|
|
3154
|
+
size?: SizeProp;
|
|
3155
|
+
/**
|
|
3156
|
+
* Wat te doen als de waarde is veranderd
|
|
3157
|
+
* @param newVal: de nieuwe waarde
|
|
3158
|
+
* @param valid: is de nieuwe waarde geldig?
|
|
3159
|
+
*/
|
|
3160
|
+
onValueChanged?(newVal: string | number, valid: boolean): void;
|
|
3161
|
+
};
|
|
3162
|
+
/**
|
|
3163
|
+
* Een select-input om een waarde te selecteren uit een lijstje
|
|
3164
|
+
* - lijstje van strings
|
|
3165
|
+
* - lijstje van `{value: string, label: string, disabled: boolean}`
|
|
3166
|
+
* - lijstje van `{value: string, label: string, disabled: boolean}` per group (`<optgroup>`)
|
|
3167
|
+
* @see MultiSelect voor een select waar meerdere waarden mogelijk zijn.
|
|
3168
|
+
* @param props
|
|
3169
|
+
* @returns een Select component
|
|
3170
|
+
* @example <Select {...props}/>
|
|
3171
|
+
* @description alle props voor Number component
|
|
3172
|
+
* | prop | type | default | description |
|
|
3173
|
+
* |-------------------|---------------------------|---------|--------------------------------------------|
|
|
3174
|
+
* | name | `string` | | de naam voor de input (REQUIRED) |
|
|
3175
|
+
* | label | `string` | `name` | de label voor de input |
|
|
3176
|
+
* | rows | `number` | `6` | zichtbare rijen in de select |
|
|
3177
|
+
* | id | `string` | `name` | de id voor de input |
|
|
3178
|
+
* | tooltip | `string` | | tooltip voor de input |
|
|
3179
|
+
* | labelHidden | `boolean` | `false` | de label is verborgen (screenreaders) |
|
|
3180
|
+
* | disabled | `boolean` | `false` | de input is disabled |
|
|
3181
|
+
* | textAlign | `l`, `c`, `r` | `l` | de text-align van de input |
|
|
3182
|
+
* | keyboardType | `search`, `text`, | `text ` | de type van de keyboard (touch-devices) |
|
|
3183
|
+
* | | `email`,`tel`,`url` | | |
|
|
3184
|
+
* | | `numeric`, `decimal` | | |
|
|
3185
|
+
* | validation | `FormValidationType` | `{}` | de validatie voor de input |
|
|
3186
|
+
* | value | `string` | | de waarde |
|
|
3187
|
+
* | options | `string[]` | `[]` | de opties |
|
|
3188
|
+
* | | `SelectOptionType[]` | | |
|
|
3189
|
+
* | | `SelectOptionGroupType[]` | | |
|
|
3190
|
+
* | size | `s`,`m`,`l`,`xl` | `m` | de grootte van de input |
|
|
3191
|
+
* | direction | `h`,`v` | `h` | de form-richting voor de input |
|
|
3192
|
+
* | errorMessage | `string`, `function` | | een error message (van buiten setbaar) |
|
|
3193
|
+
* | placeholder | `string` | | de placeholder voor de input |
|
|
3194
|
+
* | onValueChanged() | `function` | | (value: string, valid?: boolean) => void |
|
|
3195
|
+
* | onKeyDown() | `function` | | (event: React.KeyboardEvent) => void |
|
|
3196
|
+
*/
|
|
3197
|
+
declare function Select(props: SelectInputProps): JSX.Element;
|
|
3198
|
+
|
|
3199
|
+
type EmailInputProps = BaseInputProps & {
|
|
3200
|
+
/** Start value voor deze input (optioneel) */
|
|
3201
|
+
value?: string;
|
|
3202
|
+
/** Speciaal voor password-managers. Wat is de functie van deze input */
|
|
3203
|
+
autocomplete?: AutoCompleteType;
|
|
3204
|
+
/**
|
|
3205
|
+
* Wat te doen als de waarde is veranderd
|
|
3206
|
+
* @param newVal: de nieuwe waarde
|
|
3207
|
+
* @param isValid: is de nieuwe waarde geldig?
|
|
3208
|
+
*/
|
|
3209
|
+
onValueChanged?(newVal: string, isValid?: boolean): any | void;
|
|
3210
|
+
};
|
|
3211
|
+
/**
|
|
3212
|
+
* Maak een input van een tekst-type met optionele validation.
|
|
3213
|
+
* een ingevoerd e-mailadres wordt al automatisch gevalideert met een regex.
|
|
3214
|
+
* Onder validatie kan zo nodig een ander pattern worden opgegeven.
|
|
3215
|
+
* @param props
|
|
3216
|
+
* @returns een input met als type e-mail
|
|
3217
|
+
* @example <EmailInput value=" {...props} />
|
|
3218
|
+
* @description alle props voor Email component
|
|
3219
|
+
* | prop | type | default | description |
|
|
3220
|
+
* |-------------------|----------------------|---------|--------------------------------------------|
|
|
3221
|
+
* | name | `string` | | de naam voor de input (REQUIRED) |
|
|
3222
|
+
* | label | `string` | `name` | de label voor de input |
|
|
3223
|
+
* | id | `string` | `name` | de id voor de input |
|
|
3224
|
+
* | spellCheck | `boolean` | `false` | Moet de browser deze input spell-checken? |
|
|
3225
|
+
* | autoComplete | `AutoCompleteType` | `email` | de autocomplete type (password managers) |
|
|
3226
|
+
* | tooltip | `string` | | tooltip voor de input |
|
|
3227
|
+
* | labelHidden | `boolean` | `false` | de label is verborgen (screenreaders) |
|
|
3228
|
+
* | disabled | `boolean` | `false` | de input is disabled |
|
|
3229
|
+
* | textAlign | `l`, `c`, `r` | `l` | de text-align van de input |
|
|
3230
|
+
* | keyboardType | `search`, `text`, | `text ` | de type van de keyboard (touch-devices) |
|
|
3231
|
+
* | | `email`,`tel`,`url` | | |
|
|
3232
|
+
* | | `numeric`, `decimal` | | |
|
|
3233
|
+
* | validation | `FormValidationType` | `{}` | de validatie voor de input |
|
|
3234
|
+
* | value | `string` | | de waarde |
|
|
3235
|
+
* | size | `s`,`m`,`l`,`xl` | `m` | de grootte van de input |
|
|
3236
|
+
* | direction | `h`,`v` | `h` | de form-richting voor de input |
|
|
3237
|
+
* | errorMessage | `string` | | een error message (van buiten setbaar) |
|
|
3238
|
+
* | placeholder | `string` | | de placeholder voor de input |
|
|
3239
|
+
* | onValueChanged() | `function` | | (value: string, valid?: boolean) => void |
|
|
3240
|
+
* | onKeyDown() | `function` | | (event: React.KeyboardEvent) => void |
|
|
3241
|
+
*
|
|
3242
|
+
*/
|
|
3243
|
+
declare function EmailInput(props: EmailInputProps): JSX.Element;
|
|
3244
|
+
|
|
3245
|
+
type PasswordInputProps = BaseInputProps & {
|
|
3246
|
+
/** Start value voor deze input (optioneel) */
|
|
3247
|
+
value?: string;
|
|
3248
|
+
/** Speciaal voor password-managers. Wat is de functie van deze input */
|
|
3249
|
+
autocomplete?: AutoCompleteType;
|
|
3250
|
+
/**
|
|
3251
|
+
* Wat te doen als de waarde is veranderd
|
|
3252
|
+
* @param newVal: de nieuwe waarde
|
|
3253
|
+
* @param valid: is de nieuwe waarde geldig?
|
|
3254
|
+
*/
|
|
3255
|
+
onValueChanged?(newVal: string, isValid?: boolean): any | void;
|
|
3256
|
+
revealPasswordTooltip?: string;
|
|
3257
|
+
};
|
|
3258
|
+
/**
|
|
3259
|
+
* Maak een input van een tekst-type met optionele validation.
|
|
3260
|
+
* Het wachtwoord wordt door **** verborgen.
|
|
3261
|
+
* @param props
|
|
3262
|
+
* @returns een input met type password
|
|
3263
|
+
* @example <PasswordInput {...props}/>
|
|
3264
|
+
* @description alle props voor Password component
|
|
3265
|
+
* | prop | type | default | description |
|
|
3266
|
+
* |-----------------------|----------------------|---------|--------------------------------------------|
|
|
3267
|
+
* | name | `string` | | de naam voor de input (REQUIRED) |
|
|
3268
|
+
* | label | `string` | `name` | de label voor de input |
|
|
3269
|
+
* | id | `string` | `name` | de id voor de input |
|
|
3270
|
+
* | autoComplete | `AutoCompleteType` | | de autocomplete type (password managers) |
|
|
3271
|
+
* | spellCheck | `boolean` | `false` | Moet de browser deze input spell-checken? |
|
|
3272
|
+
* | tooltip | `string` | | tooltip voor de input |
|
|
3273
|
+
* | labelHidden | `boolean` | `false` | de label is verborgen (screenreaders) |
|
|
3274
|
+
* | disabled | `boolean` | `false` | de input is disabled |
|
|
3275
|
+
* | revealPasswordTooltip | `string` | | tooltip voor show-password-button |
|
|
3276
|
+
* | textAlign | `l`, `c`, `r` | `l` | de text-align van de input |
|
|
3277
|
+
* | keyboardType | `search`, `text`, | `text ` | de type van de keyboard (touch-devices) |
|
|
3278
|
+
* | | `email`,`tel`,`url` | | |
|
|
3279
|
+
* | | `numeric`, `decimal` | | |
|
|
3280
|
+
* | validation | `FormValidationType` | `{}` | de validatie voor de input |
|
|
3281
|
+
* | value | `string` | | de waarde |
|
|
3282
|
+
* | size | `s`,`m`,`l`,`xl` | `m` | de grootte van de input |
|
|
3283
|
+
* | direction | `h`,`v` | `h` | de form-richting voor de input |
|
|
3284
|
+
* | errorMessage | `string`, `function` | | een error message (van buiten setbaar) |
|
|
3285
|
+
* | placeholder | `string` | | de placeholder voor de input |
|
|
3286
|
+
* | onValueChanged() | `function` | | (value: string, valid?: boolean) => void |
|
|
3287
|
+
* | onKeyDown() | `function` | | (event: React.KeyboardEvent) => void |
|
|
3288
|
+
*/
|
|
3289
|
+
declare function PasswordInput(props: PasswordInputProps): JSX.Element;
|
|
3290
|
+
|
|
3291
|
+
type TextAreaProps = Omit<BaseInputProps, 'icons'> & {
|
|
3292
|
+
/** Value van een texarea kan via de children of de value-prop */
|
|
3293
|
+
value?: string;
|
|
3294
|
+
/**
|
|
3295
|
+
* Wat te doen als de waarde is veranderd
|
|
3296
|
+
* @param newVal: de nieuwe waarde
|
|
3297
|
+
* @param valid: is de nieuwe waarde geldig?
|
|
3298
|
+
*/
|
|
3299
|
+
onValueChanged?(newVal: string, valid: boolean): any | void;
|
|
3300
|
+
/** Eigen onKeyDown voor TextAreas */
|
|
3301
|
+
onKeyDown?(e: React$1.KeyboardEvent<HTMLTextAreaElement>): void;
|
|
3302
|
+
};
|
|
3303
|
+
/**
|
|
3304
|
+
* Maak een textarea met optionele validation.
|
|
3305
|
+
* @param props
|
|
3306
|
+
* @returns een textarea
|
|
3307
|
+
* @example <TextArea {...props}/>
|
|
3308
|
+
* @description alle props voor TextArea component
|
|
3309
|
+
* | prop | type | default | description |
|
|
3310
|
+
* |-------------------|---------------------------|---------|--------------------------------------------|
|
|
3311
|
+
* | name | `string` | | de naam voor de input (REQUIRED) |
|
|
3312
|
+
* | type | `InputTypeProp` | | type voor de input (REQUIRED) |
|
|
3313
|
+
* | label | `string` | `name` | de label voor de input |
|
|
3314
|
+
* | id | `string` | `name` | de id voor de input |
|
|
3315
|
+
* | tooltip | `string` | | tooltip voor de input |
|
|
3316
|
+
* | spellCheck | `boolean` | `false` | Moet de browser deze input spell-checken? |
|
|
3317
|
+
* | autocomplete | `AutoCompleteType` | | autocomplete voor de input |
|
|
3318
|
+
* | labelHidden | `boolean` | `false` | de label is verborgen (screenreaders) |
|
|
3319
|
+
* | disabled | `boolean` | `false` | de input is disabled |
|
|
3320
|
+
* | textAlign | `l`, `c`, `r` | `l` | de text-align van de input |
|
|
3321
|
+
* | keyboardType | `search`, `text`, | `text ` | de type van de keyboard (touch-devices) |
|
|
3322
|
+
* | | `email`,`tel`,`url` | | |
|
|
3323
|
+
* | | `numeric`, `decimal` | | |
|
|
3324
|
+
* | validation | `FormValidationType` | `{}` | de validatie voor de input |
|
|
3325
|
+
* | value | `string` | | de waarde |
|
|
3326
|
+
* | size | `s`,`m`,`l`,`xl` | `m` | de grootte van de input |
|
|
3327
|
+
* | direction | `h`,`v` | `h` | de form-richting voor de input |
|
|
3328
|
+
* | errorMessage | `string`, `function` | | een error message (van buiten setbaar) |
|
|
3329
|
+
* | placeholder | `string` | | de placeholder voor de input |
|
|
3330
|
+
* | onValueChanged() | `function` | | (value: string, valid?: boolean) => void |
|
|
3331
|
+
* | onKeyDown() | `function` | | (event: React.KeyboardEvent) => void |
|
|
3332
|
+
*/
|
|
3333
|
+
declare function TextArea(props: TextAreaProps): JSX.Element;
|
|
3334
|
+
|
|
3335
|
+
type CharType = '0-9' | 'a-z' | 'A-Z' | 'a-Z' | '0-Z' | string | RegExp;
|
|
3336
|
+
type TextInputProps = BaseInputProps & {
|
|
3337
|
+
/** Type van de tekst input (default = 'text') */
|
|
3338
|
+
type?: 'text' | 'tel' | 'url';
|
|
3339
|
+
/** Start value voor deze input (optioneel) */
|
|
3340
|
+
value?: string;
|
|
3341
|
+
/** Speciaal voor password-managers. Wat is de functie van deze input */
|
|
3342
|
+
autocomplete?: AutoCompleteType;
|
|
3343
|
+
/** Toegestane karakters in de input
|
|
3344
|
+
* - `0-9`: alleen numeriek
|
|
3345
|
+
* - `a-z`: alleen lowercase letters. Uppercase maken we lowercase
|
|
3346
|
+
* - `A-Z`: alleen uppercase letters. lowercase maken we uppercase
|
|
3347
|
+
* - `a-Z`: alleen lowercase en uppercase letters
|
|
3348
|
+
* - `0-Z`: lowercase, uppercase & numeriek
|
|
3349
|
+
* - `RegExp`: geef een regex op met alle toegestande karakters om **NIET** te replacen
|
|
3350
|
+
*/
|
|
3351
|
+
characters?: CharType;
|
|
3352
|
+
/**
|
|
3353
|
+
* Wat te doen als de waarde is veranderd
|
|
3354
|
+
* @param newVal: de nieuwe waarde
|
|
3355
|
+
* @param isValid: is de nieuwe waarde geldig?
|
|
3356
|
+
*/
|
|
3357
|
+
onValueChanged?(newVal: string, isValid?: boolean): any | void;
|
|
3358
|
+
};
|
|
3359
|
+
/**
|
|
3360
|
+
* Maak een input van een tekst-type met optionele validation.
|
|
3361
|
+
* @param props
|
|
3362
|
+
* @returns En TextInput met validatie en karakter-checking
|
|
3363
|
+
* @example <TextInput value="oompa loompa dooba di dee" {...props} />
|
|
3364
|
+
* @description alle props voor TextArea component
|
|
3365
|
+
* | prop | type | default | description |
|
|
3366
|
+
* |-------------------|---------------------------|---------|--------------------------------------------|
|
|
3367
|
+
* | name | `string` | | de naam voor de input (REQUIRED) |
|
|
3368
|
+
* | type | `text`, `tel`, `url` | `text` | type voor de input (REQUIRED) |
|
|
3369
|
+
* | label | `string` | `name` | de label voor de input |
|
|
3370
|
+
* | characters | `string`, `RegExp`, `0-Z`,| | de toegestane karakters in de input |
|
|
3371
|
+
* | | `0-9`, `a-z`, `A-Z`, `a-Z`| | |
|
|
3372
|
+
* | spellCheck | `boolean` | `false` | Moet de browser deze input spell-checken? |
|
|
3373
|
+
* | autocomplete | `AutoCompleteType` | | de autocomplete type voor de input |
|
|
3374
|
+
* | id | `string` | `name` | de id voor de input |
|
|
3375
|
+
* | tooltip | `string` | | tooltip voor de input |
|
|
3376
|
+
* | labelHidden | `boolean` | `false` | de label is verborgen (screenreaders) |
|
|
3377
|
+
* | disabled | `boolean` | `false` | de input is disabled |
|
|
3378
|
+
* | textAlign | `l`, `c`, `r` | `l` | de text-align van de input |
|
|
3379
|
+
* | keyboardType | `search`, `text`, | `text ` | de type van de keyboard (touch-devices) |
|
|
3380
|
+
* | | `email`,`tel`,`url` | | |
|
|
3381
|
+
* | | `numeric`, `decimal` | | |
|
|
3382
|
+
* | validation | `FormValidationType` | `{}` | de validatie voor de input |
|
|
3383
|
+
* | value | `string` | | de waarde |
|
|
3384
|
+
* | size | `s`,`m`,`l`,`xl` | `m` | de grootte van de input |
|
|
3385
|
+
* | direction | `h`,`v` | `h` | de form-richting voor de input |
|
|
3386
|
+
* | errorMessage | `string`, `function` | | een error message (van buiten setbaar) |
|
|
3387
|
+
* | placeholder | `string` | | de placeholder voor de input |
|
|
3388
|
+
* | onValueChanged() | `function` | | (value: string, valid?: boolean) => void |
|
|
3389
|
+
* | onKeyDown() | `function` | | (event: React.KeyboardEvent) => void |
|
|
3390
|
+
*/
|
|
3391
|
+
declare function TextInput(props: TextInputProps): JSX.Element;
|
|
3392
|
+
|
|
3393
|
+
type InputValueType = string | number | readonly string[] | undefined;
|
|
3394
|
+
type InputStylingPropsType = {
|
|
3395
|
+
/** grootte van de input (default = `m`, medium)*/ size?: SizeProp;
|
|
3396
|
+
/** alignment van de input (default = `l`, left) */ alignment?: AlignmentProp;
|
|
3397
|
+
/** label boven (`v`) of voor (`h`) de input, (default = `h`, horizontal) */ direction?: DirectionProp;
|
|
3398
|
+
/** (optioneel) icon op de input */ iconLeft?: IconProp | string;
|
|
3399
|
+
/** (optioneel) icon aan einde op de input */ iconRight?: IconProp | string;
|
|
3400
|
+
};
|
|
3401
|
+
type InputPropsType<T = InputValueType> = {
|
|
3402
|
+
/** label bij de input. Als geen label, dan wordt de `name`-property gebruikt */ label?: string;
|
|
3403
|
+
/** foutmelding bij de input*/ errorMessage?: string | ((v: InputValueType) => string);
|
|
3404
|
+
/** helptag in Loon bij de input (`:HOOFDGROEP:SUBGROEP:`)*/ helpTag?: string;
|
|
3405
|
+
/** type input (default = `text`)*/ type?: InputTypeProp;
|
|
3406
|
+
/** (optioneel) tooltip-title voor de input*/ title?: string;
|
|
3407
|
+
/** (optioneel) id voor de input. Als geen id, dan wordt de `name`-property gebruikt */ id?: string;
|
|
3408
|
+
/** name-property voor de input */ name: string;
|
|
3409
|
+
/** waarde voor de input */ value?: T;
|
|
3410
|
+
/** gebruikt deze input de spellchecked (default = `false`) */ spellCheck?: boolean;
|
|
3411
|
+
/** is deze input required (default= `false`)*/ required?: boolean;
|
|
3412
|
+
/** autocomplete voor deze input (default = `off`)*/ autoComplete?: AutoCompleteType;
|
|
3413
|
+
/** type toetsenbord (voor smartphones) voor deze input (default = `text`)*/ keyboardType?: KeyboardTypeProp;
|
|
3414
|
+
/** placeholder in de input */ placeholder?: string;
|
|
3415
|
+
/** is deze input disabled 9default = `false`)*/ disabled?: boolean;
|
|
3416
|
+
/** bij welk form hoort deze input?*/ form?: string;
|
|
3417
|
+
/**
|
|
3418
|
+
* max waarde of max lengte voor de input
|
|
3419
|
+
* _(altijd hoger dan de `min`-prop)_
|
|
3420
|
+
* @example // voor max waarde
|
|
3421
|
+
* <Input type="number" max="100"/>
|
|
3422
|
+
* <Input type="range" max="100"/>
|
|
3423
|
+
* <Input type="date" max="2019-12-25"/>
|
|
3424
|
+
* <Input type="month" max="2019-12"/>
|
|
3425
|
+
* <Input type="week" max="2019-W23"/>
|
|
3426
|
+
* <Input type="time" max="17:30"/>
|
|
3427
|
+
* <Input type="datetime-local" max="29-12-25T23:59"/>
|
|
3428
|
+
* @example //strings: voor max length, altijd 0 of hoger
|
|
3429
|
+
* <Input type="text" max="100"/>
|
|
3430
|
+
* <Input type="password" max="50"/>
|
|
3431
|
+
*/
|
|
3432
|
+
max?: number;
|
|
3433
|
+
/**
|
|
3434
|
+
* min waarde of min lengte voor de input
|
|
3435
|
+
* _(altijd lager dan de `max`-prop)_
|
|
3436
|
+
* @example <Input type="number" min="1"/>
|
|
3437
|
+
* <Input type="range" min="1"/>
|
|
3438
|
+
* <Input type="date" min="2019-01-01"/>
|
|
3439
|
+
* <Input type="month" min="2019-01-01"/>
|
|
3440
|
+
* <Input type="week" min="2019-W01"/>
|
|
3441
|
+
* <Input type="time" min="08:30"/>
|
|
3442
|
+
* <Input type="datetime-local" max="2019-01-01T00:00"/>
|
|
3443
|
+
* @example //strings: voor max length, altijd 0 of hoger
|
|
3444
|
+
* <Input type="text" min="100"/>
|
|
3445
|
+
* <Input type="password" min="50"/>*/
|
|
3446
|
+
min?: number;
|
|
3447
|
+
/** stapgrootte voor groter/kleiner aanpassingen
|
|
3448
|
+
* | type| value | Example|
|
|
3449
|
+
* |----------------|----------------|---------------------------------------------|
|
|
3450
|
+
* | number | `1` | `<Input type="number" step="2"/>` |
|
|
3451
|
+
* | range | `1` | `<Input type="range" step="2"/>` |
|
|
3452
|
+
* | date | `1` (day) | `<Input type="date" step="2"/>` |
|
|
3453
|
+
* | month | `1` (month) | `<Input type="month" step="2"/>` |
|
|
3454
|
+
* | week | `1` (week) | `<Input type="week" step="2"/>` |
|
|
3455
|
+
* | time | `60` (seconds) | `<Input type="time" step="2"/>` |
|
|
3456
|
+
* | datetime-local | `1` (second) | `<Input type="datetime-local" step="900"/>` |
|
|
3457
|
+
*/
|
|
3458
|
+
step?: number;
|
|
3459
|
+
/** Is deze input readonly (default = `false`). Bij `true` zie je alleen nog maar de content van de input*/
|
|
3460
|
+
readonly?: boolean;
|
|
3461
|
+
/** moet deze input de focus krijgen? (default = `false`)*/ autofocus?: boolean;
|
|
3462
|
+
/** (optionele) `ref` voor gebruik met `React.useRef`*/ ref?: React$1.Ref<HTMLInputElement>;
|
|
3463
|
+
/** callback voor unfocus (blur), zet OOK de input op `touched`*/
|
|
3464
|
+
onBlur?: (e: React$1.FocusEvent<HTMLInputElement>) => void;
|
|
3465
|
+
/** callback voor onChange*/
|
|
3466
|
+
onChange?: (e: React$1.ChangeEvent<HTMLInputElement>) => void;
|
|
3467
|
+
/** callback voor focus */
|
|
3468
|
+
onFocus?: (e: React$1.FocusEvent<HTMLInputElement>, helpTag?: string) => void;
|
|
3469
|
+
/** callback voor typen */
|
|
3470
|
+
onKeyDown?: (e: React$1.KeyboardEvent<HTMLInputElement>) => void;
|
|
3471
|
+
/** callback voor typen */
|
|
3472
|
+
onKeyUp?: (e: React$1.KeyboardEvent<HTMLInputElement>) => void;
|
|
3473
|
+
};
|
|
3474
|
+
/**
|
|
3475
|
+
*
|
|
3476
|
+
* @param props
|
|
3477
|
+
* @returns
|
|
3478
|
+
*/
|
|
3479
|
+
declare function Input<T extends InputValueType = string>({ errorMessage, label, name, id, iconLeft, iconRight, direction, onBlur, ...props }: InputPropsType<T> & InputStylingPropsType): JSX.Element;
|
|
3480
|
+
|
|
3481
|
+
type FileInputProps = Omit<BaseInputProps, 'icons'> & {
|
|
3482
|
+
/** File types die een file-input zou moeten accepteren. Komma-gescheiden lijst van unieke file-type-specificaties (zie MDN: @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file) */
|
|
3483
|
+
accept?: string;
|
|
3484
|
+
/** Welke camera moet er gebruikt maken voor afbeelding/video data, als dat via de accept-prop is toegestaan */
|
|
3485
|
+
capture?: 'user' | 'environment';
|
|
3486
|
+
/** Toon de input als een block */
|
|
3487
|
+
boxed?: boolean;
|
|
3488
|
+
/** Mag een gebruik meerdere files selecteren */
|
|
3489
|
+
multiple?: boolean;
|
|
3490
|
+
/** Tekst voor op selecteer-file-button. (default = `name`-prop) */
|
|
3491
|
+
kiesLabel?: string;
|
|
3492
|
+
/** Tekst voor 'er-is-nog-geen-bestand'. default = '' */
|
|
3493
|
+
nogGeenBestandLabel?: string;
|
|
3494
|
+
/** Value van de input *__(LET OP: MOET `''` ZIJN BIJ INITIALISATIE!)__* */
|
|
3495
|
+
value?: string;
|
|
3496
|
+
/**
|
|
3497
|
+
* Wat te doen als de waarde is veranderd
|
|
3498
|
+
* @param files: De nieuwe waarde
|
|
3499
|
+
* @param isValid: Is de nieuwe waarde geldig?
|
|
3500
|
+
*/
|
|
3501
|
+
onValueChanged?(files: FileList, isValid?: boolean): any | void;
|
|
3502
|
+
/** Formatteer de weergegeven filenaam volgens een eigen functie */
|
|
3503
|
+
filenameFormatter?(val: string, files: FileList): string;
|
|
3504
|
+
};
|
|
3505
|
+
/**
|
|
3506
|
+
* Maak een file input. __De value MOET bij initialisatie `''` zijn. React heeft geen toegang tot het file system__
|
|
3507
|
+
* @param props
|
|
3508
|
+
* @returns an input for files
|
|
3509
|
+
* @example <FileInput name="file" {...props}/>
|
|
3510
|
+
* @description alle props voor File component
|
|
3511
|
+
* | prop | type | default | description |
|
|
3512
|
+
* |-------------------|----------------------|-----------|--------------------------------------------|
|
|
3513
|
+
* | name | `string` | | de naam voor de input (REQUIRED) |
|
|
3514
|
+
* | label | `string` | `name` | de label voor de input |
|
|
3515
|
+
* | kiesLabel | `string` | | de tekst voor de selecteer-file-button |
|
|
3516
|
+
* | spellCheck | `boolean` | `false` | Moet de browser deze input spell-checken? |
|
|
3517
|
+
* | multiple | `boolean` | `false` | of er meerdere files geselecteerd moeten |
|
|
3518
|
+
* | boxed | `boolean` | `false` | of de input als een block moet worden |
|
|
3519
|
+
* | accept | `string` | | de file-types die geselecteerd mogen worden|
|
|
3520
|
+
* | capture | `user`, `environment`|`undefined`| de camera die gebruikt moet worden |
|
|
3521
|
+
* | id | `string` | `name` | de id voor de input |
|
|
3522
|
+
* | icon | `string`, `IconProp` | | de icon voor de input |
|
|
3523
|
+
* | tooltip | `string` | | tooltip voor de input |
|
|
3524
|
+
* | labelHidden | `boolean` | `false` | de label is verborgen (screenreaders) |
|
|
3525
|
+
* | disabled | `boolean` | `false` | de input is disabled |
|
|
3526
|
+
* | keyboardType | `search`, `text`, | `text ` | de type van de keyboard (touch-devices) |
|
|
3527
|
+
* | | `email`,`tel`,`url` | | |
|
|
3528
|
+
* | | `numeric`, `decimal` | | |
|
|
3529
|
+
* | validation | `FormValidationType` | `{}` | de validatie voor de input |
|
|
3530
|
+
* | value | `string` | FORBIDDEN | de waarde, mag NIET default geset worden |
|
|
3531
|
+
* | size | `s`,`m`,`l`,`xl` | `m` | de grootte van de input |
|
|
3532
|
+
* | direction | `h`,`v` | `h` | de form-richting voor de input |
|
|
3533
|
+
* | errorMessage | `string` | | een error message (van buiten setbaar) |
|
|
3534
|
+
* | placeholder | `string` | | de placeholder voor de input |
|
|
3535
|
+
* | onValueChanged() | `function` | | (value: FileList, valid?: boolean) => void |
|
|
3536
|
+
* | onKeyDown() | `function` | | (event: React.KeyboardEvent) => void |
|
|
3537
|
+
* | filenameFormatter | `function` | | (value: string, files: FileList) => string |
|
|
3538
|
+
*/
|
|
3539
|
+
declare function FileInput(props: FileInputProps): JSX.Element;
|
|
3540
|
+
|
|
3541
|
+
type FormProps = {
|
|
3542
|
+
/** De inputs voor dit form */
|
|
3543
|
+
children: React$1.ReactNode;
|
|
3544
|
+
/** Form attribuut \<form action="..." > */
|
|
3545
|
+
action?: string;
|
|
3546
|
+
/** Form attribuut \<form name="..." > */
|
|
3547
|
+
name?: string;
|
|
3548
|
+
/** Form attribuut \<form method="..." > */
|
|
3549
|
+
method?: 'post' | 'get';
|
|
3550
|
+
/** Form attribuut <form target="..." > */
|
|
3551
|
+
target?: '_self' | '_blank' | '_parent' | '_top';
|
|
3552
|
+
/** Form onsubmit handler */
|
|
3553
|
+
onSubmit?: (event: React$1.FormEvent<HTMLFormElement>) => void;
|
|
3554
|
+
/** Size voor alle form-elementen (default = 'm') */
|
|
3555
|
+
size?: SizeProp;
|
|
3556
|
+
/** Form attribuut\ <form autocomplete="..." >. */
|
|
3557
|
+
autocomplete?: 'on' | 'off';
|
|
3558
|
+
/** Direction voor form-elementen (horizontaal (1 lijn, default) of vertical (label boven, input onder)) */
|
|
3559
|
+
direction?: DirectionProp;
|
|
3560
|
+
/** Form attribuut \<form novalidate="..." > */
|
|
3561
|
+
novalidate?: boolean;
|
|
3562
|
+
/** Extra classnames voor de form */
|
|
3563
|
+
className?: string;
|
|
3564
|
+
};
|
|
3565
|
+
/**
|
|
3566
|
+
* Maak een form met verschillende inputs. De inputs zelf zijn hetzelfde als de losse inputs.
|
|
3567
|
+
* @param props
|
|
3568
|
+
* @returns een form
|
|
3569
|
+
* @example
|
|
3570
|
+
* <Form action="POST" name="formpie">
|
|
3571
|
+
* <TextInput name="name" label="Naam" />
|
|
3572
|
+
* <TextInput name="email" label="Email" />
|
|
3573
|
+
* <PasswordInput name="password" label="Wachtwoord" />
|
|
3574
|
+
* </Form>
|
|
3575
|
+
*/
|
|
3576
|
+
declare const Form: {
|
|
3577
|
+
(props: FormProps): JSX.Element;
|
|
3578
|
+
/** Een zelf-configureerbare base input
|
|
3579
|
+
* @see Input
|
|
3580
|
+
*/
|
|
3581
|
+
Input: typeof Input;
|
|
3582
|
+
/** Input voor type url, text of tel
|
|
3583
|
+
* @see TextInput
|
|
3584
|
+
*/
|
|
3585
|
+
Text: typeof TextInput;
|
|
3586
|
+
/** Password input
|
|
3587
|
+
* @see PasswordInput
|
|
3588
|
+
*/
|
|
3589
|
+
Password: typeof PasswordInput;
|
|
3590
|
+
/** Email input
|
|
3591
|
+
* @see EmailInput
|
|
3592
|
+
*/
|
|
3593
|
+
Email: typeof EmailInput;
|
|
3594
|
+
/** Text area input
|
|
3595
|
+
* @see TextArea
|
|
3596
|
+
*/
|
|
3597
|
+
TextArea: typeof TextArea;
|
|
3598
|
+
/** Select input
|
|
3599
|
+
* @see Select
|
|
3600
|
+
*/
|
|
3601
|
+
Select: typeof Select;
|
|
3602
|
+
/** Multi-select input
|
|
3603
|
+
* @see MultiSelect
|
|
3604
|
+
*/
|
|
3605
|
+
MultiSelect: typeof MultiSelect;
|
|
3606
|
+
/** Color input
|
|
3607
|
+
* @see ColorInput
|
|
3608
|
+
*/
|
|
3609
|
+
Color: typeof ColorInput;
|
|
3610
|
+
/** Hidden input
|
|
3611
|
+
* @see HiddenInput
|
|
3612
|
+
*/
|
|
3613
|
+
Hidden: typeof HiddenInput;
|
|
3614
|
+
/** Number input
|
|
3615
|
+
* @see NumberInput
|
|
3616
|
+
*/
|
|
3617
|
+
Number: typeof NumberInput;
|
|
3618
|
+
/** Range input (als a number input)
|
|
3619
|
+
* @see RangeInput
|
|
3620
|
+
*/
|
|
3621
|
+
Range: typeof RangeInput;
|
|
3622
|
+
/** Multi-range input (2 numbers)
|
|
3623
|
+
* @see MultiRangeInput
|
|
3624
|
+
*/
|
|
3625
|
+
MultiRange: typeof MultiRangeInput;
|
|
3626
|
+
/** Input for dates
|
|
3627
|
+
* @see DateInput
|
|
3628
|
+
*/
|
|
3629
|
+
Date: typeof DateInput;
|
|
3630
|
+
/** Input for date & time combinations
|
|
3631
|
+
* @see DateTimeInput
|
|
3632
|
+
*/
|
|
3633
|
+
DateTime: typeof DateTimeInput;
|
|
3634
|
+
/** Time input
|
|
3635
|
+
* @see TimeInput
|
|
3636
|
+
*/
|
|
3637
|
+
Time: typeof TimeInput;
|
|
3638
|
+
/** Checkbox input
|
|
3639
|
+
* @see CheckBox
|
|
3640
|
+
*/
|
|
3641
|
+
CheckBox: typeof CheckBox;
|
|
3642
|
+
/** Radio input
|
|
3643
|
+
* @see RadioGroup
|
|
3644
|
+
*/
|
|
3645
|
+
RadioGroup: {
|
|
3646
|
+
(props: RadioInputProps): JSX.Element;
|
|
3647
|
+
Item: (props: {
|
|
3648
|
+
id?: string | undefined;
|
|
3649
|
+
value: string;
|
|
3650
|
+
disabled?: boolean | undefined;
|
|
3651
|
+
tooltip?: string | undefined;
|
|
3652
|
+
children?: React$1.ReactNode;
|
|
3653
|
+
size?: SizeProp | undefined;
|
|
3654
|
+
color?: string | undefined;
|
|
3655
|
+
styling?: CheckradioStylingType | undefined;
|
|
3656
|
+
direction?: DirectionProp | undefined;
|
|
3657
|
+
textAlign?: TextAlignmentProp | undefined;
|
|
3658
|
+
}) => JSX.Element;
|
|
3659
|
+
};
|
|
3660
|
+
/** Een file-input
|
|
3661
|
+
* @see FileInput
|
|
3662
|
+
*/
|
|
3663
|
+
File: typeof FileInput;
|
|
3664
|
+
/**
|
|
3665
|
+
* Gebruik om de richting (direction-attribuut) van meerdere inputs te wijzigen.
|
|
3666
|
+
* @return een aantal inputs op een lijn
|
|
3667
|
+
* @example
|
|
3668
|
+
* <Form.Line>
|
|
3669
|
+
* <Form.Date name={`date-${i}-${ii}`} id={`date-${direction}-${size}-1`} direction="vertical" />
|
|
3670
|
+
* <Form.Time name={`time-${i}-${ii}`} id={`date-${direction}-${size}-2`} direction="vertical" />
|
|
3671
|
+
* </Form.Line>
|
|
3672
|
+
*/
|
|
3673
|
+
Line: ({ children }: {
|
|
3674
|
+
children: React$1.ReactNode;
|
|
3675
|
+
}) => JSX.Element;
|
|
3676
|
+
/** Open ruimte voor eigen content, die zich aan de direction van het form houdt.
|
|
3677
|
+
* @return eigen componenten of content.
|
|
3678
|
+
* @example
|
|
3679
|
+
* <Form.Space>
|
|
3680
|
+
* <Message size={size} color="w">
|
|
3681
|
+
* Met de component <strong>{'<Form.Line>'}</strong> kan je twee inputs achter elkaar kwijt. Dan
|
|
3682
|
+
* moet je wel zelf nog de direction instellen (default = 'horizontal')
|
|
3683
|
+
* </Message>
|
|
3684
|
+
* </Form.Space>
|
|
3685
|
+
*/
|
|
3686
|
+
Space: ({ children }: {
|
|
3687
|
+
children: React$1.ReactNode;
|
|
3688
|
+
}) => JSX.Element;
|
|
3689
|
+
/** container voor de buttons van het form. Grootte van de buttons kan onafhankelijk worden ingesteld */
|
|
3690
|
+
/**
|
|
3691
|
+
* Buttons container voor het form. Mag alleen buttons bevatten. Grootte van de buttons kan onafhankelijk worden ingesteld, maar ook voor allemaal.
|
|
3692
|
+
* @return een buttons-container
|
|
3693
|
+
* @example
|
|
3694
|
+
* <Form.Buttons>
|
|
3695
|
+
* <Button.Success type="submit">Verstuur</Button.Success>
|
|
3696
|
+
* <Button.Danger>Reset</Button.Danger>
|
|
3697
|
+
* <Button.Info>Meer...</Button.Info>
|
|
3698
|
+
* </Form.Buttons>
|
|
3699
|
+
*/
|
|
3700
|
+
Buttons: ({ children, size, alignment, }: {
|
|
3701
|
+
children: React$1.ReactNode;
|
|
3702
|
+
size?: SizeProp | undefined;
|
|
3703
|
+
alignment?: AlignmentProp | undefined;
|
|
3704
|
+
}) => JSX.Element;
|
|
3705
|
+
};
|
|
3706
|
+
|
|
3707
|
+
/** Props voor de Form-component */
|
|
3708
|
+
type FormBuilderProps = {
|
|
3709
|
+
/** definieer een onSubmit voor het form
|
|
3710
|
+
* <form onSubmit="onSubmit(e)"
|
|
3711
|
+
* @param e: data
|
|
3712
|
+
* @returns: het resultaat van het form: GET: URLSearchParams string, POST: key-values van fields
|
|
3713
|
+
*/
|
|
3714
|
+
onSubmit(e: any | undefined): void;
|
|
3715
|
+
/** Moet het form in een modal verschijnen */
|
|
3716
|
+
useModal?: boolean;
|
|
3717
|
+
/** wat te doen om de modal te sluiten. ALLEEN ALS useModal 'true' IS, IS DEZE NODIG */
|
|
3718
|
+
onDismiss?(e: any): void;
|
|
3719
|
+
/** buttons voor onderaan het form */
|
|
3720
|
+
buttons: {
|
|
3721
|
+
/** de tekst voor de (groene) submit button, deze is VERPLICHT */
|
|
3722
|
+
submit: string;
|
|
3723
|
+
/** 0 of emerdere (blauw) buttons */
|
|
3724
|
+
other?: FormBuilderButton[];
|
|
3725
|
+
};
|
|
3726
|
+
/** Een array van fields voor het form */
|
|
3727
|
+
fields: FormBuilderFieldProps[];
|
|
3728
|
+
/** autocomplete on or off? */
|
|
3729
|
+
autocomplete?: 'on' | 'off' | null;
|
|
3730
|
+
/** de form name */
|
|
3731
|
+
name: string;
|
|
3732
|
+
/** de GET / POST methode voor het form
|
|
3733
|
+
* <form method="get"></form>
|
|
3734
|
+
*/
|
|
3735
|
+
method: 'post' | 'get';
|
|
3736
|
+
/** target voor het form */
|
|
3737
|
+
target?: '_self' | '_blank' | '_parent' | '_top' | null;
|
|
3738
|
+
direction?: DirectionProp;
|
|
3739
|
+
};
|
|
3740
|
+
/** Props voor de fields in een form van de Form-Component */
|
|
3741
|
+
type FormBuilderFieldProps = {
|
|
3742
|
+
onFocus?: (e: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>, helpTag?: string) => void;
|
|
3743
|
+
/** de naam voor het field. gebruikt in input en in <label> als geen label gedefinieerd.
|
|
3744
|
+
* <input name="..." /> */
|
|
3745
|
+
name: string;
|
|
3746
|
+
/** een tooltip voor de button */
|
|
3747
|
+
tooltip?: string;
|
|
3748
|
+
/** label voor het field, als die afwijkt van de name-attribuut. gebruikt in <label> (optional) */
|
|
3749
|
+
label?: string;
|
|
3750
|
+
/** is het field gevalideerd en wat is daar de uitkomst van. */
|
|
3751
|
+
placeholder?: string;
|
|
3752
|
+
/** (optioneel) id van een field. Anders wordt de "name" gebruikt */
|
|
3753
|
+
id?: string;
|
|
3754
|
+
valid?: boolean;
|
|
3755
|
+
/** de waarde van de input.
|
|
3756
|
+
* Voor multi-range-inputs: een number[] van twee waarden: [valueA, valueB]
|
|
3757
|
+
* Voor Datum/Tijd inputs:
|
|
3758
|
+
* - type 'date': YYYY-MM-DD
|
|
3759
|
+
* - type 'time': HH:mm
|
|
3760
|
+
* - type 'datetime': YYYY-MM-DD HH:mm OF YYYY-MM-DDTHH:mm
|
|
3761
|
+
*/
|
|
3762
|
+
value?: ValueTypes;
|
|
3763
|
+
/** object gebruikt voot validatie */
|
|
3764
|
+
validation?: FormValidationType;
|
|
3765
|
+
/** input type: <input type="..." /> */
|
|
3766
|
+
type: 'text' | 'number' | 'email' | 'password' | 'date' | 'datetime' | 'time' | 'textarea' | 'select' | 'multiselect' | 'checkbox' | 'tel' | 'url' | 'range' | 'multirange' | 'hidden';
|
|
3767
|
+
/** voor type 'number', 'time', 'range' en 'multirange' kan er een step-grootte worden opgegeven */
|
|
3768
|
+
step?: number;
|
|
3769
|
+
/** autocomplete voor gebruik met wachtwoorden, usernames & wachtwoordmanagers */
|
|
3770
|
+
autocomplete?: 'on' | 'off' | 'current-password' | 'new-password' | 'username' | undefined;
|
|
3771
|
+
/** voor een <select> input: welke options moeten er zijn */
|
|
3772
|
+
selectOptions?: string[] | SelectOptionType[] | SelectOptionGroupType[];
|
|
3773
|
+
};
|
|
3774
|
+
/** Props voor het Button-object van de Form-component */
|
|
3775
|
+
type FormBuilderButton = {
|
|
3776
|
+
/** tekst op de button */
|
|
3777
|
+
txt: string;
|
|
3778
|
+
/** moet de formdata gevalideert zijn voor je de button kan gebruiken? */
|
|
3779
|
+
mustValidate?: boolean;
|
|
3780
|
+
/** button type <button type="..." */
|
|
3781
|
+
type: 'submit' | 'reset' | 'button';
|
|
3782
|
+
/** button color: s: success-button, d: danger-button, n: primarycolor button */
|
|
3783
|
+
color?: ColorProp;
|
|
3784
|
+
/** wat als er op de button geklikt wordt? (optional) */
|
|
3785
|
+
onClick(e: MouseEvent): any | void;
|
|
3786
|
+
};
|
|
3787
|
+
type ValueTypes = number | [number, number] | string | string[] | boolean | null | undefined;
|
|
3788
|
+
|
|
3789
|
+
/**
|
|
3790
|
+
* stel een form samen op basis van een array van fields, met een submit-button en optionele extra buttons.
|
|
3791
|
+
* Kan ook in een modal getoont worden.
|
|
3792
|
+
* @param props
|
|
3793
|
+
* @returns een object voor POST requests OF een URLPARAMS string voor GET requests
|
|
3794
|
+
*/
|
|
3795
|
+
declare function FormBuilder(props: FormBuilderProps): JSX.Element;
|
|
3796
|
+
|
|
3797
|
+
type CBInputProps = Omit<BaseInputProps, 'keyboardType' | 'icons' | 'direction' | 'validation' | 'labelHidden' | 'label' | 'spellCheck'> & {
|
|
3798
|
+
/** Speciale styling van de checkbox */
|
|
3799
|
+
styling?: CheckradioStylingType;
|
|
3800
|
+
/** Is de checkbox checked */
|
|
3801
|
+
checked?: boolean;
|
|
3802
|
+
/** Kleur van de checkbox (default = 'l', link) */
|
|
3803
|
+
color?: ColorProp | ((checked: boolean) => ColorProp);
|
|
3804
|
+
/** Verplicht label voor een gewone checkbox */
|
|
3805
|
+
label: string | React$1.ReactNode;
|
|
3806
|
+
/** Wat te doen als de waarde is veranderd
|
|
3807
|
+
* @param checked: is de checkbox checked ?
|
|
3808
|
+
*/
|
|
3809
|
+
onValueChanged?(checked: boolean): void;
|
|
3810
|
+
};
|
|
3811
|
+
/**
|
|
3812
|
+
* Maak een kale checkbox input met een label, dus ZONDER alle form-functies met controls, fields en directions.
|
|
3813
|
+
* **LET OP**: Zelf de checked-state bijhouden!
|
|
3814
|
+
* @param props
|
|
3815
|
+
* @returns een checkbox
|
|
3816
|
+
* @example <CB checked={true} {...props}/>
|
|
3817
|
+
* @description alle props voor de CB component
|
|
3818
|
+
* | prop | type | default | description |
|
|
3819
|
+
* |-------------------|----------------------|---------|--------------------------------------------|
|
|
3820
|
+
* | name | `string ` | | de naam voor de input (REQUIRED) |
|
|
3821
|
+
* | label | `string?` | `name` | de label voor de input |
|
|
3822
|
+
* | id | `string?` | `name` | de id voor de input |
|
|
3823
|
+
* | tooltip | `string?` | `''` | tooltip voor de input |
|
|
3824
|
+
* | labelHidden | `boolean` | `false` | de label is verborgen (screenreaders) |
|
|
3825
|
+
* | disabled | `boolean` | `false` | de input is disabled |
|
|
3826
|
+
* | textAlign | `l`, `c`, `r` | `l` | de text-uitlijning van de input |
|
|
3827
|
+
* | checked | `boolean` | `false` | is de checkbox `checked` of niet |
|
|
3828
|
+
* | color | `l`,`p`,`s`,`d`,`w`, | `l` | de kleur van de checkbox |
|
|
3829
|
+
* | | `i`,`is-${string}` | | |
|
|
3830
|
+
* | size | `s`,`m`,`l`,`xl` | `m` | de grootte van de input |
|
|
3831
|
+
* | styling | `rounded`,`noborder` | | de styling van de checkbox |
|
|
3832
|
+
* | | `colored`, `blocky` | | |
|
|
3833
|
+
* | errorMessage | `string ` | | een error message (van buiten setbaar) |
|
|
3834
|
+
* | onValueChanged() | `function` | | (value: boolean, valid?: boolean) => void |
|
|
3835
|
+
* | onKeyDown() | `function` | | (event: React.KeyboardEvent) => void |
|
|
3836
|
+
*/
|
|
3837
|
+
declare function CB({ checked, label, name, id, size, color, styling, textAlign, disabled, errorMessage, helpTag, onValueChanged, onKeyDown, onFocus, }: CBInputProps): JSX.Element;
|
|
3838
|
+
|
|
3839
|
+
type RBInputProps<T = string> = Omit<BaseInputProps, 'keyboardType' | 'icons' | 'direction' | 'validation' | 'labelHidden' | 'label' | 'id' | 'name' | 'spellCheck'> & {
|
|
3840
|
+
/** de group-name voor deze inputs. Radiobuttons werken daar iets anders mee */
|
|
3841
|
+
groupName: string;
|
|
3842
|
+
/** Speciale styling van de checkbox */
|
|
3843
|
+
styling?: CheckradioStylingType;
|
|
3844
|
+
/** de te emitten waarde als deze radiobutton checked moet worden */
|
|
3845
|
+
value: T;
|
|
3846
|
+
/** Is deze radio-button checked */
|
|
3847
|
+
checked: boolean;
|
|
3848
|
+
/** Kleur van de checkbox (default = 'l', link) */
|
|
3849
|
+
color?: ColorProp | ((value: T) => ColorProp);
|
|
3850
|
+
/** Verplicht label voor een gewone checkbox */
|
|
3851
|
+
label: string | React$1.ReactNode;
|
|
3852
|
+
/** Wat te doen als de waarde is veranderd
|
|
3853
|
+
* @param checked: is de checkbox checked ?
|
|
3854
|
+
*/
|
|
3855
|
+
onValueChanged?(value: T): void;
|
|
3856
|
+
/** ID voor het item. Bij radio-buttons is deze VERPLICHT! */
|
|
3857
|
+
id: string;
|
|
3858
|
+
};
|
|
3859
|
+
/**
|
|
3860
|
+
* Maak een kale radiobutton input met een label, dus ZONDER alle form-functies met controls, fields en directions.
|
|
3861
|
+
* **LET OP**: Zelf de checked-state bijhouden!
|
|
3862
|
+
* @param props
|
|
3863
|
+
* @returns een radiobutton
|
|
3864
|
+
* @example <RB checked={true} groupName="radio-button-group-name" {...props}/>
|
|
3865
|
+
* @description alle props voor de CB component
|
|
3866
|
+
* | prop | type | default | description |
|
|
3867
|
+
* |-------------------|----------------------|---------|--------------------------------------------|
|
|
3868
|
+
* | groupName | `string` | | de naam voor de input (REQUIRED) |
|
|
3869
|
+
* | label | `string?` | `name` | de label voor de input |
|
|
3870
|
+
* | id | `string` | `name` | de id voor de input |
|
|
3871
|
+
* | tooltip | `string?` | `''` | tooltip voor de input |
|
|
3872
|
+
* | labelHidden | `boolean` | `false` | de label is verborgen (screenreaders) |
|
|
3873
|
+
* | disabled | `boolean` | `false` | de input is disabled |
|
|
3874
|
+
* | textAlign | `l`, `c`, `r` | `l` | de text-uitlijning van de input |
|
|
3875
|
+
* | checked | `boolean` | `false` | is de checkbox `checked` of niet |
|
|
3876
|
+
* | color | `l`,`p`,`s`,`d`,`w`, | `l` | de kleur van de checkbox |
|
|
3877
|
+
* | | `i`,`is-${string}` | | |
|
|
3878
|
+
* | size | `s`,`m`,`l`,`xl` | `m` | de grootte van de input |
|
|
3879
|
+
* | styling | `rounded`,`noborder` | | de styling van de checkbox |
|
|
3880
|
+
* | | `colored`, `blocky` | | |
|
|
3881
|
+
* | errorMessage | `string ` | | een error message (van buiten setbaar) |
|
|
3882
|
+
* | setValueFn() | `function` | | (newVal: T) => void. Gebruik om een React-useState-setfunction aan te roepen |
|
|
3883
|
+
*/
|
|
3884
|
+
declare function JustARadioButon<T = string>({ value, checked, label, groupName: name, id, size, color, styling, textAlign, disabled, errorMessage, helpTag, onValueChanged, onFocus, }: RBInputProps<T>): JSX.Element;
|
|
3885
|
+
|
|
3886
|
+
/**
|
|
3887
|
+
* Een Rich Text Editor, dus een uitgebreide vorm van een `<textarea>`, want je kan dingen **bold**, *italic*, enz. maken.
|
|
3888
|
+
* De output is in HTML-vorm of in JSON-vorm. Je kan er ook gewoon platte tekst uitkrijgen, maar dan vervalt de opmaak.
|
|
3889
|
+
* @url https://tiptap.dev/ voor de documentatie van hoe deze component in elkaar steekt.
|
|
3890
|
+
* @returns een component voor het maken van rich text met HTML of JSON output
|
|
3891
|
+
* @description
|
|
3892
|
+
* | prop | type | uitleg |
|
|
3893
|
+
* |--------------|----------------------------|-------------------------|
|
|
3894
|
+
* | content | `string` | de inhoud van de editor |
|
|
3895
|
+
* | onChangeHtml | `(c: string) => void` | een callback die wordt aangeroepen als de inhoud van de editor verandert. De inhoud wordt dan als HTML meegegeven. |
|
|
3896
|
+
* | onChangeText | `(c: string) => void` | een callback die wordt aangeroepen als de inhoud van de editor verandert. De inhoud wordt dan als platte tekst meegegeven. |
|
|
3897
|
+
* | onChangeJson | `(c: JSONContent) => void` | een callback die wordt aangeroepen als de inhoud van de editor verandert. De inhoud wordt dan als JSON meegegeven. |
|
|
3898
|
+
*/
|
|
3899
|
+
declare function TextEditor({ content, onChangeHtml, onChangeText, onChangeJson, }: {
|
|
3900
|
+
content?: string;
|
|
3901
|
+
onChangeHtml?: (content: string) => void;
|
|
3902
|
+
onChangeText?: (content: string) => void;
|
|
3903
|
+
onChangeJson?: (content: JSONContent) => void;
|
|
3904
|
+
}): JSX.Element;
|
|
3905
|
+
|
|
3906
|
+
type CurrencyInputProps = BaseInputProps & {
|
|
3907
|
+
/** Start value voor deze input (optional) */
|
|
3908
|
+
value?: number;
|
|
3909
|
+
/**
|
|
3910
|
+
* Wat te doen als de waarde is veranderd.
|
|
3911
|
+
* @param newVal: De nieuwe waarde. `[0]` = het bedrag in centen, `[1]` = het bedrag als string
|
|
3912
|
+
* @param isValid: Is de nieuwe waarde geldig?
|
|
3913
|
+
*/
|
|
3914
|
+
onValueChanged?(newVal: [number, string], isValid?: boolean): void;
|
|
3915
|
+
/** Scheidingsteken gehele getallen en decimalen (default = `','` ) */
|
|
3916
|
+
decimalSeparator?: string;
|
|
3917
|
+
/** Scheidingsteken per duizend (default = `'.'`) */
|
|
3918
|
+
thousandsSeparator?: string;
|
|
3919
|
+
/** Altijd de centen tonen, ook als dat '0' is (default = `true`) */
|
|
3920
|
+
alwaysShowCents?: boolean;
|
|
3921
|
+
};
|
|
3922
|
+
/**
|
|
3923
|
+
* Een input voor een bedrag.
|
|
3924
|
+
* @param props
|
|
3925
|
+
* @returns Een CurrencyInput
|
|
3926
|
+
* @example <CurrencyInput value="12" {...props} />
|
|
3927
|
+
* @description alle props voor CurencyInput component
|
|
3928
|
+
* | prop | type | default | description |
|
|
3929
|
+
* |-------------------|---------------------------|---------|--------------------------------------------|
|
|
3930
|
+
* | name | `string` | | de naam voor de input (REQUIRED) |
|
|
3931
|
+
* | label | `string` | `name` | de label voor de input |
|
|
3932
|
+
* | autocomplete | `AutoCompleteType` | | de autocomplete type voor de input |
|
|
3933
|
+
* | id | `string` | `name` | de id voor de input |
|
|
3934
|
+
* | tooltip | `string` | | tooltip voor de input |
|
|
3935
|
+
* | labelHidden | `boolean` | `false` | de label is verborgen (screenreaders) |
|
|
3936
|
+
* | disabled | `boolean` | `false` | de input is disabled |
|
|
3937
|
+
* | textAlign | `l`, `c`, `r` | `l` | de text-align van de input |
|
|
3938
|
+
* | spellCheck | `boolean` | `false` | Moet de browser deze input spell-checken? |
|
|
3939
|
+
* | keyboardType | `search`, `text`, | `text ` | de type van de keyboard (touch-devices) |
|
|
3940
|
+
* | | `email`,`tel`,`url` | | |
|
|
3941
|
+
* | | `numeric`, `decimal` | | |
|
|
3942
|
+
* | validation | `FormValidationType` | `{}` | de validatie voor de input |
|
|
3943
|
+
* | value | `string`|`number` | | de waarde |
|
|
3944
|
+
* | size | `s`,`m`,`l`,`xl` | `m` | de grootte van de input |
|
|
3945
|
+
* | direction | `h`,`v` | `h` | de form-richting voor de input |
|
|
3946
|
+
* | errorMessage | `string`, `function` | | een error message (van buiten setbaar) |
|
|
3947
|
+
* | placeholder | `string` | | de placeholder voor de input |
|
|
3948
|
+
* | onValueChanged() | `function` | | (value: string, valid?: boolean) => void |
|
|
3949
|
+
* | onKeyDown() | `function` | | (event: React.KeyboardEvent) => void |
|
|
3950
|
+
*/
|
|
3951
|
+
declare function LbrCurrencyInput({ label, name, id, value, validation, errorMessage, size, textAlign, disabled, placeholder, keyboardType, tooltip, direction, labelHidden, onValueChanged, onKeyDown, decimalSeparator, alwaysShowCents, ...props }: CurrencyInputProps): JSX.Element;
|
|
3952
|
+
|
|
3953
|
+
type NotifierProviderProps = {
|
|
3954
|
+
/** De child-components die de notifier mogen gebruiken */
|
|
3955
|
+
children: React.ReactNode;
|
|
3956
|
+
/** Waar moet de notifier getoont worden? (default = 'top') */
|
|
3957
|
+
location?: 'top' | 'bottom';
|
|
3958
|
+
/** De tijd (in ms) waarna een notificatie automatisch moet dismissen */
|
|
3959
|
+
defaultAutoDismiss?: number;
|
|
3960
|
+
};
|
|
3961
|
+
type NotifierProps = {
|
|
3962
|
+
next?: NotifierItemProps;
|
|
3963
|
+
del?: number;
|
|
3964
|
+
clearTime: Date;
|
|
3965
|
+
/** De standaard-tijd om notificaties te sluiten in milliseconden. (default = 5000 (ms)) */
|
|
3966
|
+
defaultDismissTime?: number;
|
|
3967
|
+
/** Notificaties komen altijd aan de rechterkant, kies uit bovenkant of onderkant (default = 'top') */
|
|
3968
|
+
location?: 'top' | 'bottom';
|
|
3969
|
+
};
|
|
3970
|
+
type NotifierItemProps = {
|
|
3971
|
+
/** Optioneel id voor notificatie, als niet gedefinieerd wordt het een random integer */
|
|
3972
|
+
id?: number;
|
|
3973
|
+
/** Type notificatie I(info), S(success), D(danger), W(warning) */
|
|
3974
|
+
type?: ColorProp;
|
|
3975
|
+
/** De content voor de notificatie */
|
|
3976
|
+
content?: React.ReactNode;
|
|
3977
|
+
/** Tijd voor automatisch sluiten.
|
|
3978
|
+
* - `0`:niet automatisch te sluiten. Dan is de notificatie alleen te sluiten met een 'click'
|
|
3979
|
+
* - `number`: aantal milliseconden voor automatisch sluiten */
|
|
3980
|
+
dismissAfter?: 0 | number;
|
|
3981
|
+
/** Wat te doen als er geklikt wordt. Bij een 'click' wordt de notificatie ook gesloten. */
|
|
3982
|
+
onClick?: (e: any) => void;
|
|
3983
|
+
/** Payload voor de notification */
|
|
3984
|
+
payload?: any;
|
|
3985
|
+
};
|
|
3986
|
+
|
|
3987
|
+
/**
|
|
3988
|
+
* Een component om notificaties in weer te geven, die na verloop van tijd weer verdwijnen. Dat is per notificatie instelbaar.
|
|
3989
|
+
* Notificaties hebben ook een click-handler om een onClick() actie uit te voeren. De notificatie wordt dan ook gesloten.
|
|
3990
|
+
* @param props
|
|
3991
|
+
* @returns een Notificatie-component die (tijdelijke) berichtjes weergeeft aan de rechterkant van het scherm.
|
|
3992
|
+
*/
|
|
3993
|
+
declare function Notifier(props: NotifierProps): JSX.Element;
|
|
3994
|
+
|
|
3995
|
+
type NotifierContextType = {
|
|
3996
|
+
/** Toon een notificatie
|
|
3997
|
+
* @param notification de notificatie-data
|
|
3998
|
+
* @returns ID van de notificatie (om te kunnen verwijderen)
|
|
3999
|
+
*/
|
|
4000
|
+
notify: (notification: NotifierItemProps) => number;
|
|
4001
|
+
/** Cerwijder een notificatie
|
|
4002
|
+
* @param id ID van de notificatie
|
|
4003
|
+
*/
|
|
4004
|
+
remove: (id: number) => void;
|
|
4005
|
+
/**
|
|
4006
|
+
* Verwijder ALLE notificaties
|
|
4007
|
+
*/
|
|
4008
|
+
clear: () => void;
|
|
4009
|
+
};
|
|
4010
|
+
/** Provider voor de notifier.
|
|
4011
|
+
* De inhoud van de app moet binnen deze <NotifierProvider>...</NotifierProvider vallen.
|
|
4012
|
+
* De notifier is dan via de hook @see useNotifier te gebruiken in child-components van de App zelf, niet in APP!
|
|
4013
|
+
* @param props: bevat alleen de children van de notifier, dus ook van de app.
|
|
4014
|
+
* @example
|
|
4015
|
+
* <NotifierProvider>
|
|
4016
|
+
* <App />
|
|
4017
|
+
* </NotifierProvider>
|
|
4018
|
+
* */
|
|
4019
|
+
declare const NotifierProvider: (props: NotifierProviderProps) => JSX.Element;
|
|
4020
|
+
/** React Hook om notificaties in de notifier te beïnvloeden
|
|
4021
|
+
* @function notify(n: NotifierItemProps): toon een notificatie, returns ID
|
|
4022
|
+
* @function remove(id: number): verwijder een notificatie obv ID
|
|
4023
|
+
* @function clear(): verwijder alle notificaties
|
|
4024
|
+
* @example
|
|
4025
|
+
* const { notify, remove, clear } = useNotifier();
|
|
4026
|
+
*/
|
|
4027
|
+
declare function useNotifier(): NotifierContextType;
|
|
4028
|
+
|
|
4029
|
+
type State = {
|
|
4030
|
+
show: boolean;
|
|
4031
|
+
content: string | React$1.ReactNode;
|
|
4032
|
+
ok: string;
|
|
4033
|
+
cancel: string;
|
|
4034
|
+
others?: React$1.ReactNode;
|
|
4035
|
+
};
|
|
4036
|
+
/**
|
|
4037
|
+
* Confirm provider om `useConfirm`-hook te kunnen gebruiken.
|
|
4038
|
+
* @param children de children
|
|
4039
|
+
* @returns
|
|
4040
|
+
* @example // index.tsx of App.tsx
|
|
4041
|
+
* root.render(
|
|
4042
|
+
* <ConfirmProvider>
|
|
4043
|
+
* <>
|
|
4044
|
+
* // ...
|
|
4045
|
+
* </>
|
|
4046
|
+
* </ConfirmProvider>)
|
|
4047
|
+
*/
|
|
4048
|
+
declare function ConfirmProvider({ children }: {
|
|
4049
|
+
children: React$1.ReactNode;
|
|
4050
|
+
}): JSX.Element;
|
|
4051
|
+
/**
|
|
4052
|
+
* Hook voor de confirmation
|
|
4053
|
+
* @param ok tekst voor op de OK-button (default = 'Ok')
|
|
4054
|
+
* @param cancel tekst voor opd e cancel-button (default = 'Annuleren')
|
|
4055
|
+
* @param others eventuele andere buttons (default = undefined)
|
|
4056
|
+
* @returns onConfirm-fn, onCancel-fn, confirm-fn, confirmState
|
|
4057
|
+
* @example
|
|
4058
|
+
* const { confirm } = useConfirm("Ja", "Nee", <Button>Extra</Button>);
|
|
4059
|
+
* const confirmSomethingFromString = (msg: string) => {
|
|
4060
|
+
* const isConfirmed = await (confirm(msg))
|
|
4061
|
+
* }
|
|
4062
|
+
* @example
|
|
4063
|
+
* const { confirm } = useConfirm("Ja", "Nee", <Button>Extra</Button>);
|
|
4064
|
+
* const confirmSomethingFromFragment = (fragment: React.ReactNode) => {
|
|
4065
|
+
* const isConfirmed = await (confirm(fragment))
|
|
4066
|
+
* }
|
|
4067
|
+
*/
|
|
4068
|
+
declare function useConfirm(ok?: string, cancel?: string, others?: React$1.ReactNode): {
|
|
4069
|
+
/** INTERNAL USE ONLY - DO NOT USE */
|
|
4070
|
+
onConfirm: () => void;
|
|
4071
|
+
/** INTERNAL USE ONLY - DO NOT USE */
|
|
4072
|
+
onCancel: () => void;
|
|
4073
|
+
/**
|
|
4074
|
+
* awaitable confirm function. Geef een string of Fragment op om iets in de confirm-modal te tonen
|
|
4075
|
+
* @param content string of Fragment met de boodschap voor de confirm
|
|
4076
|
+
* @returns Promise<boolean> met true als de gebruiker op OK heeft geklikt, false als anders
|
|
4077
|
+
* @example const isConfirmed = await confirm("Weet je het zeker?")
|
|
4078
|
+
*/
|
|
4079
|
+
confirm: (content: string | React$1.ReactNode) => Promise<boolean>;
|
|
4080
|
+
/** INTERNAL USE ONLY - DO NOT USE */
|
|
4081
|
+
confirmState: State;
|
|
4082
|
+
};
|
|
4083
|
+
|
|
4084
|
+
type CopyType = {
|
|
4085
|
+
/**
|
|
4086
|
+
* Kopieer een waarde naar het clipboard, om die daarna ergens te kunnen plakken.
|
|
4087
|
+
* @param valueToCopy De waarde omte copy-pasten
|
|
4088
|
+
*/
|
|
4089
|
+
copy: (valueToCopy: any) => void;
|
|
4090
|
+
/** Clear de time-out en reset "copied" naar "false" */
|
|
4091
|
+
reset: () => void;
|
|
4092
|
+
/** Als er bij het kopiëren iets mis gaat, is de error != null */
|
|
4093
|
+
error: Error | null;
|
|
4094
|
+
/** Is de waarde gekopieerd? Is "true" als een item gekopieerd is, totdat reset() wordt aangeroepen of de timeout over is */
|
|
4095
|
+
copied: boolean;
|
|
4096
|
+
};
|
|
4097
|
+
/**
|
|
4098
|
+
* Hook om een waarde naar de navigator.clipboard te kopiëren en die daarna ergens te plakken.
|
|
4099
|
+
* @param timeout timeout in ms voordat de copy-reset gebeurt (default = 2000)
|
|
4100
|
+
* @returns een object met de functies copy() en reset(), een boolean copied en een error
|
|
4101
|
+
* @example const { copy, reset, copied, error } = useClipboard();
|
|
4102
|
+
*/
|
|
4103
|
+
declare function useClipboard(timeout?: number): CopyType;
|
|
4104
|
+
|
|
4105
|
+
/** Opties voor de useDebounce Hook */
|
|
4106
|
+
type useDebounceHookOptions = {
|
|
4107
|
+
/** Moet er wel een value-update zijn na de 1e wijziging (Default: false) */
|
|
4108
|
+
leading?: boolean;
|
|
4109
|
+
/** Vertraging (in ms) voor het updaten van de debounced waarde (Default: 500ms) */
|
|
4110
|
+
delay: number;
|
|
4111
|
+
};
|
|
4112
|
+
/**
|
|
4113
|
+
* Debounce-hook voor een value. Kan handig zijn om een zware operatie uit
|
|
4114
|
+
* te voeren, bijvoorbeeld op zoeken in een lijst van objecten, gebaseerd op react state.
|
|
4115
|
+
* Met de cancel-function kan een value-update worden geannuleerd.
|
|
4116
|
+
* @param value de debounceable value
|
|
4117
|
+
* @param options extra opties
|
|
4118
|
+
* @returns de waarde en een cancel-functie
|
|
4119
|
+
* @example const { value, cancel } = useDebounce(value, { delay: 1000 });
|
|
4120
|
+
*/
|
|
4121
|
+
declare function useDebouncedValue<T = unknown>(value: T, options?: useDebounceHookOptions): readonly [T, () => void];
|
|
4122
|
+
|
|
4123
|
+
type KeyboardModifiers = {
|
|
4124
|
+
alt: boolean;
|
|
4125
|
+
ctrl: boolean;
|
|
4126
|
+
meta: boolean;
|
|
4127
|
+
mod: boolean;
|
|
4128
|
+
shift: boolean;
|
|
4129
|
+
};
|
|
4130
|
+
type Hotkey = KeyboardModifiers & {
|
|
4131
|
+
key?: string;
|
|
4132
|
+
};
|
|
4133
|
+
type CheckHotkeyMatch = (event: KeyboardEvent) => boolean;
|
|
4134
|
+
type ReactHotkeyItem = [string, (event: React$1.KeyboardEvent<HTMLElement>) => void];
|
|
4135
|
+
type HotkeyItem = [string, (event: KeyboardEvent) => void];
|
|
4136
|
+
/** Parse een key-combi naar een Hotkey object */
|
|
4137
|
+
declare function parseHotkey(hotkey: string): Hotkey;
|
|
4138
|
+
/** Match hotkeys */
|
|
4139
|
+
declare function getHotkeyMatcher(hotkey: string): CheckHotkeyMatch;
|
|
4140
|
+
/** `getHotkeyHandler` kan bijvoorbeeld op een `onKeyDown()` handler gebruikt worden. Om bijvoorbeeld hotkeys aan inputs toe te voegen
|
|
4141
|
+
* @param hotkeys een array van keyboard-combinaties met een handler.
|
|
4142
|
+
* @example
|
|
4143
|
+
* <input type="text" onKeyDown={getHotkeyHandler(['alt+shift+l'])} />
|
|
4144
|
+
*/
|
|
4145
|
+
declare function getHotkeyHandler(hotkeys: ReactHotkeyItem[]): (event: React$1.KeyboardEvent<HTMLElement>) => void;
|
|
4146
|
+
/**
|
|
4147
|
+
* Hook om te luisteren naar keyboard-combinaties op het document.
|
|
4148
|
+
* formats:
|
|
4149
|
+
* `"mod+s"` = Cmd + s op macOS, Ctrl + S op Windows,
|
|
4150
|
+
* `"ctrl+shift+x"` = Ctrl + Shift + x,
|
|
4151
|
+
* `"alt + shiftt + L"` = Alt + Shfit + l, spaties zijn toegestaan,
|
|
4152
|
+
* `"ArrowLeft"` = @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values voor speciale keys
|
|
4153
|
+
*
|
|
4154
|
+
* @param hotkeys een array van keyboard-combinaties met een handler.
|
|
4155
|
+
* @example
|
|
4156
|
+
* const hks: HotkeyItem[] = [
|
|
4157
|
+
* ['mod+J', () => console.log('mod + J pressed')],
|
|
4158
|
+
* ['shift+L', () => console.log('Shift and L pressed')],
|
|
4159
|
+
* ];
|
|
4160
|
+
* useHotkeys(hks);
|
|
4161
|
+
*/
|
|
4162
|
+
declare function useHotkeys(hotkeys: HotkeyItem[]): void;
|
|
4163
|
+
|
|
4164
|
+
type UseLocalStoredStateFn<T = string> = {
|
|
4165
|
+
/** Key to store the value with in Local Storage */
|
|
4166
|
+
key: string;
|
|
4167
|
+
/** Initial value (if its non-existent in Local Storage) */
|
|
4168
|
+
initialValue: T;
|
|
4169
|
+
/** Your own serializing-function. Implement when you cannot use `JSON.stringify` */
|
|
4170
|
+
serialize?: (value: T, replacer?: (key: string, value: any) => any, space?: string | number) => string;
|
|
4171
|
+
/** Your own deserializing-funtion. Implement when you cannot use `JSON.parse` */
|
|
4172
|
+
deserialize?: (value: string, reviver?: (key: string, value: any) => any) => T;
|
|
4173
|
+
};
|
|
4174
|
+
/**
|
|
4175
|
+
* Hook die werkt als `React.useState<T|undefined>()`, maar waarbij de waarde ook wordt opgeslagen in Local Storage.
|
|
4176
|
+
* De waarde blijft dan bij het refreshen van de pagina aanwezig. Als de pagina dan ververst wordt, word de al bestaande waarde gebruikt, niet de initialValue.
|
|
4177
|
+
* Om de waarde te bewaren bij afsluiten van de browser, gebruik je de hook `{@link useSessionStoredState}`.
|
|
4178
|
+
* @param {UseLocalStoredStateFn} params voor de hook
|
|
4179
|
+
* @returns {[T, (value: T) => void]} tuple met een value en een setValue-function (net als React.useState)
|
|
4180
|
+
* @description
|
|
4181
|
+
* | Property | Type | Description |
|
|
4182
|
+
* |--------------|------------|---------------------------------------------------------------|
|
|
4183
|
+
* | key | `string` | De key waaronder de waarde in Local Storage wordt opgeslagen. |
|
|
4184
|
+
* | initialValue | `T` | De initiale waarde. |
|
|
4185
|
+
* | serialize | `function` | (optional) functie om de waarde om te zetten naar een string. Implementeer als de waarde __GEEN__ gebruik kan maken van `JSON.stringify()`! |
|
|
4186
|
+
* | deserialize | `function` | (optional) De functie die een string omzet naar de waarde. Implementeer als de waarde __GEEN__ gebruik kan maken van `JSON.parse()`! |
|
|
4187
|
+
* @example
|
|
4188
|
+
* import { useLocalStoredState } from 'loon-bulma-react';
|
|
4189
|
+
* const [ value, setValue, removeFromLocalStorage ] = useLocalStoredState({ key: 'myKey', initialValue: 'Oompa Loompa' });
|
|
4190
|
+
* // 1. value is 'Oompa Loompa', put it somewhere on the screen
|
|
4191
|
+
* // 2. change the value to something else
|
|
4192
|
+
* // 3. refresh the page.
|
|
4193
|
+
* // 4. see te new value on the page.
|
|
4194
|
+
* // 5. you can also check the value in Local Storage in devtools.
|
|
4195
|
+
* // 6. close the browser / tab
|
|
4196
|
+
* // 7. check the value in session storage. it should still be there.
|
|
4197
|
+
*/
|
|
4198
|
+
declare function useLocalStoredState<T extends unknown>({ key, initialValue, deserialize, serialize }: UseLocalStoredStateFn<T>): readonly [T | undefined, (value: T) => void, () => void];
|
|
4199
|
+
|
|
4200
|
+
type PaginationParams = {
|
|
4201
|
+
/** Geselecteerde pagina op 1e render, default = 1 */
|
|
4202
|
+
initialPage?: number;
|
|
4203
|
+
/** Controlled actieve page number */
|
|
4204
|
+
page?: number;
|
|
4205
|
+
/** Totaal aantal pages */
|
|
4206
|
+
total: number;
|
|
4207
|
+
/** Aantal directe buren van de geselecteerde pagina (default = 1) */
|
|
4208
|
+
siblings?: number;
|
|
4209
|
+
/** Aantal zichtbare pagina's aan de uiteinden van de paginatie (default = 1) */
|
|
4210
|
+
boundaries?: number;
|
|
4211
|
+
/** Callback voor het wijzigigen van de pagina */
|
|
4212
|
+
onChange: (page: number | null | undefined) => void;
|
|
4213
|
+
};
|
|
4214
|
+
declare const DOTS = "dots";
|
|
4215
|
+
declare function usePagination({ total, siblings, boundaries, page, initialPage, onChange, }: PaginationParams): {
|
|
4216
|
+
range: (number | "dots")[];
|
|
4217
|
+
active: number | null | undefined;
|
|
4218
|
+
setPage: (pageNumber: number) => void;
|
|
4219
|
+
next: () => void;
|
|
4220
|
+
prev: () => void;
|
|
4221
|
+
first: () => void;
|
|
4222
|
+
last: () => void;
|
|
4223
|
+
};
|
|
4224
|
+
|
|
4225
|
+
/**
|
|
4226
|
+
* Een toggle tussen twee state-opties. de state switched tussen de twee.
|
|
4227
|
+
* @param initialState startwaarde
|
|
4228
|
+
* @param options 2 toggle-opties
|
|
4229
|
+
* @returns een state-toggle function
|
|
4230
|
+
* @example const [state, toggle] = useToggle("yes", ["yes", "no"]);
|
|
4231
|
+
*/
|
|
4232
|
+
declare function useToggle<T extends unknown>(initialState: T, options: [T, T]): readonly [T, (value?: T) => void];
|
|
4233
|
+
/**
|
|
4234
|
+
* useToggle voor booleans
|
|
4235
|
+
* @param initialState initia
|
|
4236
|
+
* @returns een state-toggle met booleans
|
|
4237
|
+
* @example const [state, toggle] = useBoolToggle(true);
|
|
4238
|
+
*/
|
|
4239
|
+
declare function useBoolToggle(initialState?: boolean): readonly [boolean, (value?: boolean) => void];
|
|
4240
|
+
|
|
4241
|
+
type UncontrolledMode = 'initial' | 'controlled' | 'uncontrolled';
|
|
4242
|
+
type UncontrolledOptions<T> = {
|
|
4243
|
+
value: T | null | undefined;
|
|
4244
|
+
defaultValue: T | null | undefined;
|
|
4245
|
+
finalValue: T | null | undefined;
|
|
4246
|
+
onChange(value: T | null | undefined): void;
|
|
4247
|
+
onValueUpdate?(value: T | null | undefined): void;
|
|
4248
|
+
rule: (value: T | null | undefined) => boolean;
|
|
4249
|
+
};
|
|
4250
|
+
/** Hook voor het managen van state voor 'controlled' en 'uncontrolled' componenten (inputs etc).
|
|
4251
|
+
* Het is met deze hook mogelijk om een component als 'controlled' EN 'uncontrolled' te gebruiken.
|
|
4252
|
+
* @param options.value waarde
|
|
4253
|
+
* @param options.defaultValue default waarde
|
|
4254
|
+
* @param options.finalValue eindwaarde
|
|
4255
|
+
* @param options.onChange callback voor waarde verandering
|
|
4256
|
+
* @param options.onValueUpdate callback voor waarde update
|
|
4257
|
+
* @param options.rule bepaal welke waarde initieel gebruikt wordt. zie examples
|
|
4258
|
+
* @returns [value, setalue, controllerMode]
|
|
4259
|
+
*
|
|
4260
|
+
* @example
|
|
4261
|
+
* const [_value, handleChange] = useUncontrolled({
|
|
4262
|
+
* value: VALUE,
|
|
4263
|
+
* defaultValue: DEFAULT,
|
|
4264
|
+
* finalValue: 'final',
|
|
4265
|
+
* onChange: (v) => {console.log(v)},
|
|
4266
|
+
* rule: (v) => typeof v === 'string'
|
|
4267
|
+
* });
|
|
4268
|
+
*
|
|
4269
|
+
* return <input type="text" value={_value} onChange={(evt) => handleChange(evt.target.value)} />
|
|
4270
|
+
*
|
|
4271
|
+
* // als VALUE = 'oi' && DEFAULT = 'there': defaultValue & finalValue ignored in controlled components, _value == VALUE == 'oi'
|
|
4272
|
+
* // als VALUE = null && DEFAULT = 'there': rule() returns 'false', defaultValue is used, _value == defaultValue == 'there'
|
|
4273
|
+
* // als VALUE = null && DEFAULT = null: rule() returns 'false' voor beiden, finalValue is used, _value == defaultValue == 'final'
|
|
4274
|
+
*
|
|
4275
|
+
* @example - uncontrolled & controlled
|
|
4276
|
+
* // Uncontrolled
|
|
4277
|
+
* <input />
|
|
4278
|
+
* <input defaultValue="hello" />
|
|
4279
|
+
* <input onChange={() => {}} /> // still possible since value is stored in internal state
|
|
4280
|
+
*
|
|
4281
|
+
* // Controlled
|
|
4282
|
+
* <input value="Hello" onChange={() => {}} />
|
|
4283
|
+
|
|
4284
|
+
*/
|
|
4285
|
+
declare function useUncontrolled<T>({ value, defaultValue, finalValue, rule, onChange, onValueUpdate, }: UncontrolledOptions<T>): readonly [T | null | undefined, (nextValue: T | null | undefined) => void, UncontrolledMode];
|
|
4286
|
+
|
|
4287
|
+
/**
|
|
4288
|
+
* Hook voor gebruik van een gevalideerde waarde.
|
|
4289
|
+
* @param initialValue de beginwaarde (optioneel)
|
|
4290
|
+
* @param validation validatie-functie (optioneel)
|
|
4291
|
+
* @returns een uitgebreid useState hook met een gevalideerde waarde
|
|
4292
|
+
* @example
|
|
4293
|
+
* const validation = (value?: string): [boolean, string] => {
|
|
4294
|
+
* console.log(value);
|
|
4295
|
+
* if (!value) return [false, 'required'];
|
|
4296
|
+
* else if (value.length < 3) return [false, 'too short'];
|
|
4297
|
+
* return [true, ''];
|
|
4298
|
+
* };
|
|
4299
|
+
* const [{ value, lastValidValue, valid, invalidMsg }, onChange] = useValidatedState<string>('', validation);
|
|
4300
|
+
*
|
|
4301
|
+
* <input onChange={onChange} value={value} />
|
|
4302
|
+
*/
|
|
4303
|
+
declare function useValidatedState<T extends unknown>(initialValue?: T, validation?: (value?: T) => [boolean, string]): readonly [{
|
|
4304
|
+
readonly value: T | undefined;
|
|
4305
|
+
readonly lastValidValue: T | undefined;
|
|
4306
|
+
readonly valid: boolean;
|
|
4307
|
+
readonly invalidMsg: string;
|
|
4308
|
+
}, (val: T) => void];
|
|
4309
|
+
|
|
4310
|
+
type UseSessionStoredState<T = string> = {
|
|
4311
|
+
/** Key to store the value with in Session Storage */
|
|
4312
|
+
key: string;
|
|
4313
|
+
/** Initial value (if its non-existent in Session Storage) */
|
|
4314
|
+
initialValue: T;
|
|
4315
|
+
/** Your own serializing-function. Implement when you cannot use `JSON.stringify` */
|
|
4316
|
+
serialize?: (value: T, replacer?: (key: string, value: any) => any, space?: string | number) => string;
|
|
4317
|
+
/** Your own deserializing-funtion. Implement when you cannot use `JSON.parse` */
|
|
4318
|
+
deserialize?: (value: string, reviver?: (key: string, value: any) => any) => T;
|
|
4319
|
+
};
|
|
4320
|
+
/**
|
|
4321
|
+
* Hook die werkt als `React.useState<T|undefined>()`, maar waarbij de waarde ook wordt opgeslagen in Session Storage.
|
|
4322
|
+
* De waarde blijft dan bij het refreshen van de pagina aanwezig.
|
|
4323
|
+
* Als de pagina dan ververst wordt, word de al bestaande waarde gebruikt, niet de initialValue.
|
|
4324
|
+
* Maar als de tab of de browser gesloten wordt, dan wordt de inhoud van de session storage gewist.
|
|
4325
|
+
* Om de waarde te bewaren bij afsluiten van de browser, gebruik je de hook `{@link useLocalStoredState}`.
|
|
4326
|
+
* @param {UseSessionStoredState} params voor de hook
|
|
4327
|
+
* @returns {[T, (value: T) => void]} tuple met een `value` en een `setValue`-function (net als `React.useState`)
|
|
4328
|
+
* @description
|
|
4329
|
+
* | Property | Type | Description |
|
|
4330
|
+
* |--------------|------------|---------------------------------------------------------------|
|
|
4331
|
+
* | key | `string` | De key waaronder de waarde in Session Storage wordt opgeslagen. |
|
|
4332
|
+
* | initialValue | `T` | De initiale waarde. |
|
|
4333
|
+
* | serialize | `function` | (optional) functie om de waarde om te zetten naar een string. Implementeer als de waarde __GEEN__ gebruik kan maken van `JSON.stringify()`! |
|
|
4334
|
+
* | deserialize | `function` | (optional) De functie die een string omzet naar de waarde. Implementeer als de waarde __GEEN__ gebruik kan maken van `JSON.parse()`! |
|
|
4335
|
+
* @example
|
|
4336
|
+
* import { useSessionStoredState } from 'loon-bulma-react';
|
|
4337
|
+
* const [ value, setValue, removeFromSessionStorage ] = useSessionStoredState({ key: 'myKey', initialValue: 'Oompa Loompa' });
|
|
4338
|
+
* // 1. value is 'Oompa Loompa', put it somewhere on the screen
|
|
4339
|
+
* // 2. change the value to something else
|
|
4340
|
+
* // 3. refresh the page.
|
|
4341
|
+
* // 4. see te new value on the page.
|
|
4342
|
+
* // 5. you can also check the value in Local Storage in devtools.
|
|
4343
|
+
* // 6. close the browser / tab
|
|
4344
|
+
* // 7. check the value in session storage. it should be gone.
|
|
4345
|
+
*/
|
|
4346
|
+
declare function useSessionStoredState<T extends unknown>({ key, initialValue, deserialize, serialize }: UseSessionStoredState<T>): readonly [T | undefined, (value: T) => void, () => void];
|
|
4347
|
+
|
|
4348
|
+
export { AlignmentProp, AspectRatio, AspectRatioProps, AutoCompleteType, BaseEventProps, Box, BoxProps, Button, ButtonGroup, ButtonGroupProps, ButtonProps, CB, CBInputProps, Calendar, CalendarOptions, CheckBox, CheckboxInputProps, CheckradioStylingType, ColorInput, ColorInputProps, ColorProp, Column, ColumnProps, Columns, ConfirmProvider, Container, Content, CoordinatesProp, LbrCurrencyInput as CurrencyInput, CurrencyInputProps, DOTS, DataTable, DataTableColumn, DataTableProps, DateInput, DateInputProps, DateTimeInput, DateTimeInputProps, DefinedHexColors, DiffFnType, DirectionProp, EmailInput, EmailInputProps, ExpandedColumnProps, FileInput, FileInputProps, Footer, Form, FormBuilder, FormBuilderButton, FormBuilderFieldProps, FormBuilderProps, FormProps, Hero, HeroProps, HiddenInput, HiddenInputProps, Hotkey, HotkeyItem, IBAN_GEGEVENS_MET_TEST_PER_LAND as IbanDetailsPerLand, Icon, IconProps, IconText, IconTextProps, Image, ImageProps, Indicator, IndicatorPositionProp, IndicatorProps, Input, InputPropsType, InputStylingPropsType, InputValueType, JSChangeDateTimeType, JSDateSetterType, JSDateTime, JSDateTimeZoneType, JSDuration, Kbd, Kbds, KeyboardTypeProp, Link, LinkButton, LinkButtonProps, LinkProps, Menu, MenuItemGroupProps, MenuItemProps, MenuProps, Message, MessageProps, Modal, ModalProps, MonthViewProps, MultiRangeInput, MultiRangeInputProps, MultiSelect, MultiSelectInputProps, Notification, NotificationProps, Notifier, NotifierContextType, NotifierItemProps, NotifierProps, NotifierProvider, NotifierProviderProps, NumberInput, NumberInputProps, OnOffToggleItemProps, PasswordInput, PasswordInputProps, PositionProp$1 as PositionProp, ProgressBar, ProgressBarProps, JustARadioButon as RB, RBInputProps, Radio, RadioGroup, RangeInput, RangeInputProps, RectProp, RelationshipProp, ScrollArea, Section, Select, SelectInputProps, SelectOptionGroupType, SelectOptionType, SimpleTable, SimpleTableColProps, SimpleTableProps, SizeProp, StepItemProps, Steps, StepsProps, Subtitle, TabBar, TabBarItemProps, TabBarProps, Tag, TagProps, TagSizeProp, Tags, TagsProps, TextAlignmentProp, TextArea, TextAreaProps, TextEditor, TextInput, TextInputProps, TimeInput, TimeInputProps, TimeLine, TimeLineItemProps, TimeLinePointProps, TimeLineProps, Title, TitleProps, TitleWithSubtitle, TitleWithSubtitleProps, ToggleBar, ToggleBarProps, ToggleItemProps, Tooltip, UncontrolledMode, UncontrolledOptions, WeekViewProps, calculateTxtColor, getHotkeyHandler, getHotkeyMatcher, hasBSN, isIBAN, parseHotkey, useBoolToggle, useClipboard, useConfirm, useDebounceHookOptions, useDebouncedValue, useHotkeys, useLocalStoredState, useNotifier, usePagination, useSessionStoredState, useToggle, useUncontrolled, useValidatedState };
|