loon-bulma-react 2022.3.5 → 2022.3.8
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 +102 -8
- package/dist/components/ButtonGroup/ButtonGroup.d.ts +2 -2
- package/dist/components/Calendar/Month/DayContainer.d.ts +3 -3
- package/dist/components/Calendar/Month/MonthView.d.ts +3 -3
- package/dist/components/Calendar/Week/AlldayContainer.d.ts +2 -2
- package/dist/components/Calendar/Week/HourRow.d.ts +2 -2
- package/dist/components/Calendar/Week/WeekView.d.ts +3 -3
- package/dist/components/Form/BaseInputProps.d.ts +8 -3
- package/dist/components/Form/InputError.d.ts +12 -0
- package/dist/components/Form/Text/TextArea.d.ts +3 -1
- package/dist/components/Icon/Icon.d.ts +2 -2
- package/dist/components/Kbd/Kbd.d.ts +18 -0
- package/dist/components/Layout/AspectRatio/AspectRatio.d.ts +2 -2
- package/dist/components/Layout/Box/Box.d.ts +2 -2
- package/dist/components/Layout/Columns/Columns.d.ts +2 -2
- package/dist/components/Layout/Container/Container.d.ts +2 -2
- package/dist/components/Layout/Content/Content.d.ts +2 -2
- package/dist/components/Layout/Footer/Footer.d.ts +2 -2
- package/dist/components/Layout/ScrollArea/ScrollArea.d.ts +3 -3
- package/dist/components/Layout/Section/Section.d.ts +2 -2
- package/dist/components/Link/Link.d.ts +3 -3
- package/dist/components/Message/Message.d.ts +2 -2
- package/dist/components/Notification/Notification.d.ts +2 -2
- package/dist/components/Tag/Tag.d.ts +3 -3
- package/dist/contexts/Notifier/NotifierProps.d.ts +2 -2
- package/dist/hooks/useDebouncedValue.d.ts +27 -0
- package/dist/hooks/useHotkeys.d.ts +37 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +454 -201
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +451 -203
- package/dist/index.modern.js.map +1 -1
- package/package.json +19 -23
- package/example/README.md +0 -5
- package/example/package.json +0 -43
- package/example/public/favicon.ico +0 -0
- package/example/public/index.css +0 -0
- package/example/public/index.html +0 -45
- package/example/public/manifest.json +0 -15
- package/example/src/App.tsx +0 -51
- package/example/src/AppHero.tsx +0 -70
- package/example/src/MOCK_DATA.ts +0 -10014
- package/example/src/Tabs/AspectRatioTab.tsx +0 -279
- package/example/src/Tabs/CalendarTab.tsx +0 -172
- package/example/src/Tabs/DataTableTab.tsx +0 -106
- package/example/src/Tabs/FormTab.tsx +0 -66
- package/example/src/Tabs/NotificationTab.tsx +0 -78
- package/example/src/Tabs/TitleFormsButtonsTab.tsx +0 -1313
- package/example/src/Tabs/datatable.css +0 -7
- package/example/src/date-utils.ts +0 -275
- package/example/src/index.tsx +0 -5
- package/example/src/react-app-env.d.ts +0 -1
- package/example/src/setupTests.ts +0 -5
- package/example/tsconfig.json +0 -31
package/README.md
CHANGED
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
- [DataTable](#component-datatable)
|
|
25
25
|
- [Footer](#component-footer)
|
|
26
26
|
- [Icons (FontAwesome)](#component-icons)
|
|
27
|
+
- [Kbd & Kbds](#component-kbd) (KeyBoarD)
|
|
27
28
|
- [Link & LinkButon](#component-linkbutton)
|
|
28
29
|
- [Menu](#component-menu-2)
|
|
29
30
|
- [Messages & Notificaties](#component-messages)
|
|
@@ -46,6 +47,8 @@
|
|
|
46
47
|
- TimeInput
|
|
47
48
|
- DateTimeInput
|
|
48
49
|
- TextAreaInput
|
|
50
|
+
- FileInput
|
|
51
|
+
- BasicInput
|
|
49
52
|
- [CheckBox](#form-checkbox)
|
|
50
53
|
- [Ranges](#form-ranges)
|
|
51
54
|
- Range
|
|
@@ -54,6 +57,7 @@
|
|
|
54
57
|
- Select
|
|
55
58
|
- MultiSelect
|
|
56
59
|
- [Validatie](#form-validatie)
|
|
60
|
+
- [Form](#form-form)
|
|
57
61
|
- [Form-builder](#form-component)
|
|
58
62
|
- [Publiceren](#publiceren)
|
|
59
63
|
|
|
@@ -742,6 +746,22 @@ Daar kan wel meer worden opgegeven. Voor de IconText component wordt ook de kleu
|
|
|
742
746
|
</p>
|
|
743
747
|
```
|
|
744
748
|
|
|
749
|
+
### Kbd & Kbds (Keyboard Key, Keyboard Key group) <a id="component-kbd"></a>
|
|
750
|
+
|
|
751
|
+
Een `<Kbd>` is de weergave van een Keyboard Key. Dus toon bijvoorbeeld een 'S' als een S op een toetsenbord. Bijvoorbeeld voor het weergeven van hotkeys.
|
|
752
|
+
|
|
753
|
+
De `<Kbds>`-component gebruikt je om emerdere keyboard-keys bij elkaar te zetten, gescheiden door (default) een +-teken of een ander teken met de `separator`-prop.
|
|
754
|
+
|
|
755
|
+
```tsx
|
|
756
|
+
<>
|
|
757
|
+
<Kdb>Shift</Kdb>
|
|
758
|
+
<Kbd className="custom class">enter</Kbd>
|
|
759
|
+
|
|
760
|
+
<Kbds keys={['ctrl', 'shift', 'x']} />
|
|
761
|
+
<Kbds keys={['ctrl', 'shift', 'alt', 'S']} separator=" and " />
|
|
762
|
+
</>
|
|
763
|
+
```
|
|
764
|
+
|
|
745
765
|
### Link & LinkButton <a id="component-linkbutton"></a>
|
|
746
766
|
|
|
747
767
|
Link en LinkButton zijn bedoelt om links (`<a>`) en buttons (`<button>`) er, bijvoorbeeld in een tekst, hetzelfde er uit te laten zien. Een Link bevat een url, target etc. die je ook in de `<a>`-tag aantreft, de LinkButton bevat een `onClick()`-methode. Ze zien er wel hetzelfde uit.
|
|
@@ -774,9 +794,9 @@ Andere elementen worden **niet** gerendered.
|
|
|
774
794
|
<Menu.Item>Grover</Menu.Item>
|
|
775
795
|
<Menu.Item>Oscar</Menu.Item>
|
|
776
796
|
<Menu.ExpandableItem label="Sesamstraat" startExpanded={true}>
|
|
777
|
-
<
|
|
778
|
-
<
|
|
779
|
-
<
|
|
797
|
+
<Menu.Item>Ieniemienie</Menu.Item>
|
|
798
|
+
<Menu.Item>Pino</Menu.Item>
|
|
799
|
+
<Menu.Item>Tommy</Menu.Item>
|
|
780
800
|
</Menu.ExpandableItem>
|
|
781
801
|
|
|
782
802
|
<Menu.ItemGroup label="Stuff...">
|
|
@@ -1152,26 +1172,30 @@ De library bevat componenten om als losse inputs, selects, ranges of checkboxes
|
|
|
1152
1172
|
- _TimeInput_: invoeren van een tijd
|
|
1153
1173
|
- _DateTimeInput_: invoeren van een datum & een tijd als combi
|
|
1154
1174
|
- _TextAreaInput_: invoer van een tekst
|
|
1175
|
+
- _FileInput_: invoer van een file
|
|
1176
|
+
- _BasicInput_: zelf in te stellen input
|
|
1155
1177
|
- [Checkbox](#form-checkbox)
|
|
1156
1178
|
- [Ranges](#form-ranges)
|
|
1157
1179
|
- _Range_: een getal selecteren
|
|
1158
1180
|
- _MultiRange_: 2 getallen selecteren (een range)
|
|
1159
1181
|
- [Select](#form-select)
|
|
1160
1182
|
- [Validatie](#form-validatie)
|
|
1183
|
+
- [Form](#form-form)
|
|
1161
1184
|
- [Form-builder](#form-component)
|
|
1162
1185
|
|
|
1163
1186
|
### Input Types<a id="form-input"></a>
|
|
1164
1187
|
|
|
1165
1188
|
Er zijn verschillende soorten inputs voor de afhandeling van input-types. Er zijn een aantal props die op alle inputs voorkomen:
|
|
1166
1189
|
|
|
1167
|
-
- `name`: input name voor in een form
|
|
1168
|
-
- `id`: id van de input
|
|
1190
|
+
- `name`: input name voor in een form (_required_)
|
|
1191
|
+
- `id`: id van de input, als niet opgegeven wordt de `name` gebruikt
|
|
1169
1192
|
- `label`: label-tekst voor een input, voor als dat afwijkt van de `name`-prop
|
|
1170
1193
|
- `labelHidden`: boolean, verbergt het label als die alleen voor screenreaders beschikbaar moet zijn.
|
|
1171
1194
|
- `placeholder`: placeholder-tekst voor een input.
|
|
1172
1195
|
- `tooltip`: tooltip voor een input (`<input title="..." />`)
|
|
1173
1196
|
- `disabled`: input disabled
|
|
1174
|
-
- `
|
|
1197
|
+
- `errorMessage`: een errormessage van buiten de component. Voor als je validatie anders wilt oplossen. Wordt altijd getoont
|
|
1198
|
+
- `validatie`: een object met wat standaard-validatie-opties en een onValidate-function input. Een validatie-error wordt alleen getoont als de input 'touched' is.
|
|
1175
1199
|
- `required`: input is verplicht
|
|
1176
1200
|
- `max`: maximale waarde
|
|
1177
1201
|
- text: input max length
|
|
@@ -1187,6 +1211,7 @@ Er zijn verschillende soorten inputs voor de afhandeling van input-types. Er zij
|
|
|
1187
1211
|
- `onValidate()`: een eigen function opgeven voor validatie
|
|
1188
1212
|
- `keyboardType`: wat voor toetsenbord moet er op een smartphone of tablet gebruikt worden
|
|
1189
1213
|
- `direction`: orientatie van de input (horizontaal of vertical, default = 'horizontal')
|
|
1214
|
+
- `size`: de grootte van een input
|
|
1190
1215
|
|
|
1191
1216
|
- Tekst:
|
|
1192
1217
|
- **TextInput:** invoeren van tekst, urls, etc.
|
|
@@ -1202,11 +1227,14 @@ Er zijn verschillende soorten inputs voor de afhandeling van input-types. Er zij
|
|
|
1202
1227
|
- **TimeInput:** invoer van een tijdstip. De value kan als `string` of `Date` worden opgegeven
|
|
1203
1228
|
- **DateTimeInput:** invoer-combi voor een datum & tijd. De value kan als `string` of `Date` worden opgegeven
|
|
1204
1229
|
- Overig
|
|
1230
|
+
- **BasicInput** een input om helemaal zelf te kunnen instellen
|
|
1205
1231
|
- **ColorInput** een invoer voor een kleur. Altijd een hex-waarde, de echte selectie is afhankelijk van de browser
|
|
1206
1232
|
- **HiddenInput** een invoer die wel belangrijk is, maar niet gezien en niet bewerkt mag worden. Heeft vanzelfsprekend geen styling
|
|
1233
|
+
- **FileInput** invoer van een (of meer) files
|
|
1207
1234
|
|
|
1208
1235
|
```tsx
|
|
1209
1236
|
<div>
|
|
1237
|
+
<BasicInput name="something" type="text">
|
|
1210
1238
|
<TextInput type="text" name="TextInput" id="textinput" validatie={{required: true}}/>
|
|
1211
1239
|
<EmailInput name="EmailInput" id="emailinput" validatie={{required: true}}/>
|
|
1212
1240
|
<PasswordInput type="password" name="PasswordInput" id="passwordinput" validatie={{min: 10}}/>
|
|
@@ -1214,11 +1242,12 @@ Er zijn verschillende soorten inputs voor de afhandeling van input-types. Er zij
|
|
|
1214
1242
|
|
|
1215
1243
|
<DateInput name="DateInput" id="dateinput" value={new Date()} validatie={{min: '2021-01-01', max: '2021-12-31'}}/>
|
|
1216
1244
|
<TimeInput name="TimeInput" id="timeinput" value="15:30"/>
|
|
1217
|
-
<DateTimeInput name="DateTimeInput" id="datetimeinput" />
|
|
1245
|
+
<DateTimeInput name="DateTimeInput" id="datetimeinput" errorMessage="Kiekeboe" />
|
|
1218
1246
|
|
|
1219
1247
|
<NumberInput name="NumberInput" id="numberinput" validatie={{required: true, min:-10, max: 10}}/>
|
|
1220
1248
|
|
|
1221
1249
|
<ColorInput name="ColorInput" id="colorinput" value="#ff8000" direction="vertical">
|
|
1250
|
+
<FileInput name="file" direction="horizontal">
|
|
1222
1251
|
|
|
1223
1252
|
<HiddenInput name="HiddenInput" value="bazinga!" id="hiddenInput" required={true}/>
|
|
1224
1253
|
|
|
@@ -1227,10 +1256,16 @@ Er zijn verschillende soorten inputs voor de afhandeling van input-types. Er zij
|
|
|
1227
1256
|
|
|
1228
1257
|
### CheckBox <a id="form-checkbox"></a>
|
|
1229
1258
|
|
|
1230
|
-
|
|
1259
|
+
<<<<<<< HEAD
|
|
1260
|
+
Wat anders is aan deze input, is dat de `size`-prop geen effect heeft. Er is maar 1 grootte.Een checkbox werkt zoals je verwacht:
|
|
1261
|
+
=======
|
|
1262
|
+
|
|
1263
|
+
> Was voorheen Checkbox (lowercase B), maar hebben we nu CheckBox van gemaakt. Wat anders is aan deze input, is dat de `size`-prop geen effect heeft. Er is maar 1 grootte.
|
|
1231
1264
|
|
|
1232
1265
|
Een checkbox werkt zoals je verwacht:
|
|
1233
1266
|
|
|
1267
|
+
> > > > > > > e2a755af447d47404c4b0a4017dbc02ec903de5e
|
|
1268
|
+
|
|
1234
1269
|
```tsx
|
|
1235
1270
|
<div>
|
|
1236
1271
|
<CheckBox name="CheckboxInput" id="checkboxinput" label="Dit is een checkbox" validatie={{ required: true }} />
|
|
@@ -1390,6 +1425,65 @@ export type FormValidatie = {
|
|
|
1390
1425
|
- `pattern`: voor tekst-inputs: voldoet de waarde aan deze regex. In EmailInput overschrijft deze de default e-mail-validatie regex.
|
|
1391
1426
|
- `onValidate()`: een eigen validatie-methode (als gewenst). Wordt aangeroepen als het veld wordt gevalideerd. De methode met een lege string als _geldig_ of een foutmelding als _ongeldig_ returnen.
|
|
1392
1427
|
|
|
1428
|
+
### Form <a id="form-form"></a>
|
|
1429
|
+
|
|
1430
|
+
De `<Form>`-component is een wrapper voor een gewone `<form>`-tag. Hij bevat (als het goed is) alle normale attributen die ook bij een gewone `<form>`-tag te vinden zijn. Deze component maakt het mogelijk om voor alle inputs in het form de `direction`- en de `size`-attributen in te stellen. Hij exporteert de inputs nogmaals in de vorm `<Form.XXX>` (zie onder).
|
|
1431
|
+
|
|
1432
|
+
##### Alle verschillende inputs in een Form
|
|
1433
|
+
|
|
1434
|
+
- `<Form.Inpu>`: een geheel zelf in te stellen `<input>`-tag, zelfde als `<BasicInput>`.
|
|
1435
|
+
- `<Form.Text>`: een input met type `text`, zelfde als `<TextInput>`.
|
|
1436
|
+
- `<Form.Password>`: een input met type `password`, zelfde als `<PasswordInput>`.
|
|
1437
|
+
- `<Form.Email>`: een input met type `email`, zelfde als `<EmailInput>`.
|
|
1438
|
+
- `<Form.TextArea>`: een `<textarea>` input, zelfde als `<TextArea>`.
|
|
1439
|
+
- `<Form.Color>`: een input met type `color`, zelfde als `<ColorInput>`.
|
|
1440
|
+
- `<Form.Number>`: een input met type `number`, zelfde als `<NumberInput>`.
|
|
1441
|
+
- `<Form.Range>`: een input met type `range`, zelfde als `<RangeInput>`.
|
|
1442
|
+
- `<Form.MultiRange>`: een input voor 2 numerieke waarden, zelfde als `<MultiRangeInput>`.
|
|
1443
|
+
- `<Form.Select>`: een input met type `select`, zelfde als `<Select>`.
|
|
1444
|
+
- `<Form.MultiSelect>`: een input met type `select`, zelfde als `<MultiSelect>`.
|
|
1445
|
+
- `<Form.Checkbox>`: een input met type `checkbox`, zelfde als `<Checkbox>`.
|
|
1446
|
+
- `<Form.Date>`: een input met type `date`, zelfde als `<DateInput>`.
|
|
1447
|
+
- `<Form.Time>`: een input met type `time`, zelfde als `<TimeInput>`.
|
|
1448
|
+
- `<Form.DateTime>`: een input met type `datetime-local`, zelfde als `<DateTimeInput>`.
|
|
1449
|
+
- `<Form.File>`: een input met type `file`, zelfde als `<FileInput>`.
|
|
1450
|
+
- `<Form.Hidden>`: een input met type `hidden`, zelfde als `<HiddenInput>`.
|
|
1451
|
+
|
|
1452
|
+
##### Andere componenten binnen `<Form>`
|
|
1453
|
+
|
|
1454
|
+
- `<Form.Line>` Een wrapper voor meerdere inputs, om deze op een lijn te kunnen zetten (achter elkaar). Dan moet je \__wel_ zelf de direction instellen als die afwijkt van de normale form-direction.
|
|
1455
|
+
- `Form.Space`: een container voor vrije ruimte. Hier kan je helemaal losgaan met eigen componenten. Deze container houdt zich wel aan de form-direction voor de positie.
|
|
1456
|
+
- `<Form.Buttons`: een container voor de buttons. Werkt hetzelfde als `<ButtonGroup>`. Voor bijvoorbeeld de submit-button voor een form.
|
|
1457
|
+
|
|
1458
|
+
##### Voorbeeld
|
|
1459
|
+
|
|
1460
|
+
```tsx
|
|
1461
|
+
<>
|
|
1462
|
+
<Form direction={direction} size={size}>
|
|
1463
|
+
<Form.Text name="text" placeholder="Name" />
|
|
1464
|
+
|
|
1465
|
+
<Form.Space>
|
|
1466
|
+
<img src="#" alt="it's free real estate" />
|
|
1467
|
+
</Form.Space>
|
|
1468
|
+
|
|
1469
|
+
<Form.Select name="select" options={['Option 1', 'Option 2', 'Option 3']} />
|
|
1470
|
+
<Form.CheckBox name="checkbox" />
|
|
1471
|
+
|
|
1472
|
+
<Form.Line>
|
|
1473
|
+
<Form.Date name="startDate" />
|
|
1474
|
+
<Form.Date name="endDate" />
|
|
1475
|
+
</Form.Line>
|
|
1476
|
+
|
|
1477
|
+
<Form.TextArea name="comments" />
|
|
1478
|
+
|
|
1479
|
+
<Form.Buttons>
|
|
1480
|
+
<Button.Success type="submit">Send</Button.Success>
|
|
1481
|
+
<Button.Danger>Reset</Button.Danger>
|
|
1482
|
+
</Form.Buttons>
|
|
1483
|
+
</Form>
|
|
1484
|
+
</>
|
|
1485
|
+
```
|
|
1486
|
+
|
|
1393
1487
|
### Form-Builder <a id="form-component"></a>
|
|
1394
1488
|
|
|
1395
1489
|
Een **Form** is ook beschikbaar als component. Om te werken heeft die nodig:
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { AlignmentProp, SizeProp } from '../../loon-react-bulma-types';
|
|
3
3
|
declare type ButtonGroupProps = {
|
|
4
4
|
/** Een buttongroup kan alleen Buttons als children hebben! */
|
|
5
|
-
children?: ReactNode;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
6
|
/** Moeten de buttons aan elkaar vast gezet worden (default = false)
|
|
7
7
|
* @deprecated: use 'attach' instead */
|
|
8
8
|
merge?: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { BaseEventProps, CalendarOptions } from '../Props';
|
|
3
3
|
/**
|
|
4
4
|
* Component voor de dag-container in de maand-view
|
|
@@ -11,9 +11,9 @@ export declare function DayContainer<T extends BaseEventProps>(props: {
|
|
|
11
11
|
/** de namen van de maanden */
|
|
12
12
|
monthNames: string[];
|
|
13
13
|
/** wat te doen als een event aangeklikt wordt */
|
|
14
|
-
onEventClick?: (event: T, clickEvent: MouseEvent<HTMLElement>) => void;
|
|
14
|
+
onEventClick?: (event: T, clickEvent: React.MouseEvent<HTMLElement>) => void;
|
|
15
15
|
/** wat te doen als een dag aangeklikt wordt */
|
|
16
|
-
onDayClick?: (date: Date, clickEvent: MouseEvent<HTMLElement>) => void;
|
|
16
|
+
onDayClick?: (date: Date, clickEvent: React.MouseEvent<HTMLElement>) => void;
|
|
17
17
|
/** opties voor deze container */
|
|
18
18
|
options?: CalendarOptions<T>;
|
|
19
19
|
/** de datum voor de container */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { BaseEventProps, CalendarOptions } from '../Props';
|
|
3
3
|
declare type MonthViewProps<T> = {
|
|
4
4
|
/** events voor deze view */
|
|
@@ -6,9 +6,9 @@ declare type MonthViewProps<T> = {
|
|
|
6
6
|
/** opties voor deze view */
|
|
7
7
|
options?: CalendarOptions<T>;
|
|
8
8
|
/** event aangeklikt */
|
|
9
|
-
onEventClick?: (e: T, event: MouseEvent<HTMLElement>) => void;
|
|
9
|
+
onEventClick?: (e: T, event: React.MouseEvent<HTMLElement>) => void;
|
|
10
10
|
/** dag-datum geklikt? */
|
|
11
|
-
onDayClick?: (date: Date, event: MouseEvent<HTMLElement>) => void;
|
|
11
|
+
onDayClick?: (date: Date, event: React.MouseEvent<HTMLElement>) => void;
|
|
12
12
|
/** huidige geselecteerde datum */
|
|
13
13
|
viewDate: Date;
|
|
14
14
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { BaseEventProps, CalendarOptions } from '../Props';
|
|
3
3
|
/**
|
|
4
4
|
* Component voor de dag-container in de maand-view
|
|
@@ -8,7 +8,7 @@ import { BaseEventProps, CalendarOptions } from '../Props';
|
|
|
8
8
|
export declare function AlldayContainer<T extends BaseEventProps>(props: {
|
|
9
9
|
events: T[];
|
|
10
10
|
/** wat te doen als een event aangeklikt wordt */
|
|
11
|
-
onEventClick?: (event: T, clickEvent: MouseEvent<HTMLElement>) => void;
|
|
11
|
+
onEventClick?: (event: T, clickEvent: React.MouseEvent<HTMLElement>) => void;
|
|
12
12
|
/** wat te doen als een dag aangeklikt wordt */
|
|
13
13
|
options?: CalendarOptions<T>;
|
|
14
14
|
}): JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { BaseEventProps, CalendarOptions } from '../Props';
|
|
3
3
|
/**
|
|
4
4
|
* Component voor de dag-container in de maand-view
|
|
@@ -10,7 +10,7 @@ export declare function HourRow<T extends BaseEventProps>(props: {
|
|
|
10
10
|
hour: number;
|
|
11
11
|
events: T[];
|
|
12
12
|
/** wat te doen als een event aangeklikt wordt */
|
|
13
|
-
onEventClick?: (event: T, clickEvent: MouseEvent<HTMLElement>) => void;
|
|
13
|
+
onEventClick?: (event: T, clickEvent: React.MouseEvent<HTMLElement>) => void;
|
|
14
14
|
/** wat te doen als een dag aangeklikt wordt */
|
|
15
15
|
options?: CalendarOptions<T>;
|
|
16
16
|
}): JSX.Element;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { BaseEventProps, CalendarOptions } from '../Props';
|
|
2
|
-
import
|
|
2
|
+
import React from 'react';
|
|
3
3
|
declare type WeekViewProps<T> = {
|
|
4
4
|
/** events voor deze view */
|
|
5
5
|
events: T[] | (() => T[]);
|
|
6
6
|
/** opties voor deze view */
|
|
7
7
|
options?: CalendarOptions<T>;
|
|
8
8
|
/** event aangeklikt */
|
|
9
|
-
onEventClick?: (e: T, event: MouseEvent<HTMLElement>) => void;
|
|
9
|
+
onEventClick?: (e: T, event: React.MouseEvent<HTMLElement>) => void;
|
|
10
10
|
/** dag-datum geklikt? */
|
|
11
|
-
onDayClick?: (date: Date, event: MouseEvent<HTMLElement>) => void;
|
|
11
|
+
onDayClick?: (date: Date, event: React.MouseEvent<HTMLElement>) => void;
|
|
12
12
|
/** huidige geselecteerde datum */
|
|
13
13
|
viewDate: Date;
|
|
14
14
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { DirectionProp, KeyboardTypeProp } from '../../loon-react-bulma-types';
|
|
2
3
|
export declare type BaseInputProps<T extends any = void> = {
|
|
3
4
|
/** is dit veld disabled ? (optioneel) */
|
|
@@ -16,10 +17,14 @@ export declare type BaseInputProps<T extends any = void> = {
|
|
|
16
17
|
direction?: DirectionProp;
|
|
17
18
|
/** een object met validatie-regels */
|
|
18
19
|
validation?: FormValidationType<T>;
|
|
20
|
+
/** eigen errorMessage voor validatie buiten component om */
|
|
21
|
+
errorMessage?: string | ((value: T | string | string[] | number | number[] | boolean | Date | FileList | any) => string);
|
|
19
22
|
/** placeholder in input (optioneel) */
|
|
20
23
|
placeholder?: string;
|
|
21
24
|
/** Welk (virtueel) toetsenbord moet er gebruikt worden? (smartphones, tablets) */
|
|
22
25
|
keyboardType?: KeyboardTypeProp;
|
|
26
|
+
/** on-key-down-event, bijvoorbeeld voor het gebruik van Hotkeys als dit element focused is */
|
|
27
|
+
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
23
28
|
};
|
|
24
29
|
export declare type FormValidationType<T extends any = void> = {
|
|
25
30
|
/** is een value required? */
|
|
@@ -29,7 +34,7 @@ export declare type FormValidationType<T extends any = void> = {
|
|
|
29
34
|
* min-length voor strings
|
|
30
35
|
* min-waarde voor ranges,
|
|
31
36
|
* minimaal aantal selected in multiselect,
|
|
32
|
-
* min-date voor datum/tijd (YYYY-MM-DD, HH:mm
|
|
37
|
+
* min-date voor datum/tijd ("YYYY-MM-DD", "HH:mm" of "YYYY-MM-DDT:HH:mm").
|
|
33
38
|
* GEBRUIKT VOOR VALIDATIE */
|
|
34
39
|
min?: number | string;
|
|
35
40
|
/**
|
|
@@ -37,7 +42,7 @@ export declare type FormValidationType<T extends any = void> = {
|
|
|
37
42
|
* max-length voor strings,
|
|
38
43
|
* max-waarde voor ranges,
|
|
39
44
|
* maximaal aantal selected in multiselect,
|
|
40
|
-
* max-date voor datum/tijd (YYYY-MM-DD, HH:mm
|
|
45
|
+
* max-date voor datum/tijd ("YYYY-MM-DD", "HH:mm" of "YYYY-MM-DDT:HH:mm").
|
|
41
46
|
* GEBRUIKT VOOR VALIDATIE */
|
|
42
47
|
max?: number | string;
|
|
43
48
|
/** voor <input type="multirange">: het minimale verschil tussen 2 waarden. */
|
|
@@ -51,7 +56,7 @@ export declare type FormValidationType<T extends any = void> = {
|
|
|
51
56
|
* @param val de nieuwe te valideren waarde
|
|
52
57
|
* @returns een string met daarin de foutmelding OF een lege string voor een valid waarde.
|
|
53
58
|
*/
|
|
54
|
-
onValidate?: (val: T | string | string[] | number | number[] | boolean | Date | FileList) => string;
|
|
59
|
+
onValidate?: (val: T | string | string[] | number | number[] | boolean | Date | FileList | any) => string;
|
|
55
60
|
};
|
|
56
61
|
export declare type BaseState<T extends any = void> = {
|
|
57
62
|
/** de naam die in foutmeldingen komt */
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type InputErrorProps = {
|
|
3
|
+
/** error gegenereerd door input-validation */
|
|
4
|
+
stateError?: string;
|
|
5
|
+
/** error van buitenaf opgegeven */
|
|
6
|
+
outsideError?: string;
|
|
7
|
+
/** is het field touched ? dan WEL een stateError opgeven */
|
|
8
|
+
touched?: boolean;
|
|
9
|
+
};
|
|
10
|
+
/** Toon een erorr bij een input */
|
|
11
|
+
declare const InputError: (props: InputErrorProps) => JSX.Element | null;
|
|
12
|
+
export { InputError };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { SizeProp } from '../../../loon-react-bulma-types';
|
|
3
3
|
import { BaseInputProps } from '../BaseInputProps';
|
|
4
4
|
declare type TextAreaProps = BaseInputProps & {
|
|
@@ -12,6 +12,8 @@ declare type TextAreaProps = BaseInputProps & {
|
|
|
12
12
|
* @param valid: is de nieuwe waarde geldig?
|
|
13
13
|
*/
|
|
14
14
|
onValueChanged?(newVal: string, valid: boolean): any | void;
|
|
15
|
+
/** eigen onKeyDown voor TextAreas */
|
|
16
|
+
onKeyDown?(e: React.KeyboardEvent<HTMLTextAreaElement>): void;
|
|
15
17
|
};
|
|
16
18
|
/**
|
|
17
19
|
* Maak een textarea met optionele validation.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
2
|
-
import
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import { ColorProp, SizeProp } from '../../loon-react-bulma-types';
|
|
4
4
|
declare type IconProps = {
|
|
5
5
|
/** react font-awesome icon
|
|
@@ -37,7 +37,7 @@ declare type IconTextProps = {
|
|
|
37
37
|
/** moet het icon spinnen of pulseren */
|
|
38
38
|
animate?: 'spin' | 'pulse';
|
|
39
39
|
/** tekst bij het icon */
|
|
40
|
-
children: ReactNode;
|
|
40
|
+
children: React.ReactNode;
|
|
41
41
|
};
|
|
42
42
|
/**
|
|
43
43
|
* Toon een Font Awesome Icon met bijhorende tekst.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/** Toon een Keyboard-Key als een 'key' */
|
|
3
|
+
declare const Kbd: ({ children, className, }: {
|
|
4
|
+
/** optionele extra class */
|
|
5
|
+
className?: string | undefined;
|
|
6
|
+
/** content van de key */
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}) => JSX.Element;
|
|
9
|
+
/** Toont meerdere keyboard-keys, gescheiden door een teken */
|
|
10
|
+
declare const Kbds: ({ keys, separator, className, }: {
|
|
11
|
+
/** weer te geven keys als string */
|
|
12
|
+
keys: string[];
|
|
13
|
+
/** de separator van de keys, default '+' */
|
|
14
|
+
separator?: string | undefined;
|
|
15
|
+
/** optionele className */
|
|
16
|
+
className?: string | undefined;
|
|
17
|
+
}) => JSX.Element;
|
|
18
|
+
export { Kbd, Kbds };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
/** Props voor een aspect-ratio */
|
|
3
3
|
declare type AspectRatioProps = {
|
|
4
4
|
/** de ratio (width x height) van het gewenste element */
|
|
5
5
|
ratio: '1by1' | '5by4' | '4by5' | '4by3' | '3by4' | '3by2' | '2by3' | '5by3' | '3by5' | '16by9' | '9by16' | '2by1' | '1by2' | '3by1' | '1by3';
|
|
6
6
|
/** het item dat aan de aspect-ratio moet voldoen */
|
|
7
|
-
children: ReactNode;
|
|
7
|
+
children: React.ReactNode;
|
|
8
8
|
/** */
|
|
9
9
|
caption?: {
|
|
10
10
|
placement: 'top' | 'bottom';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
export declare type ColumnsProps = {
|
|
3
3
|
/** Children van de Columns. Moeten van het type @see Column zijn */
|
|
4
|
-
children: ReactNode;
|
|
4
|
+
children: React.ReactNode;
|
|
5
5
|
/** de gap-grootte (stappen van .25rem), een margin tussen kolommen (default = 3, 0.75rem) */
|
|
6
6
|
gap?: '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | undefined;
|
|
7
7
|
/** mogen de kolommen over meerdere rijen verdeeld worden */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { SizeProp } from '../../../loon-react-bulma-types';
|
|
3
3
|
/**
|
|
4
4
|
* Een Content component voor generated content. De meeste html tags kunnen hier worden gebruikt.
|
|
@@ -7,6 +7,6 @@ import { SizeProp } from '../../../loon-react-bulma-types';
|
|
|
7
7
|
*/
|
|
8
8
|
export declare function Content(props: {
|
|
9
9
|
size?: SizeProp;
|
|
10
|
-
children: ReactNode;
|
|
10
|
+
children: React.ReactNode;
|
|
11
11
|
classes?: string;
|
|
12
12
|
}): JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { AlignmentProp } from '../../../loon-react-bulma-types';
|
|
3
3
|
export declare type FooterProps = {
|
|
4
4
|
/** de content voor de footer */
|
|
5
|
-
children: ReactNode;
|
|
5
|
+
children: React.ReactNode;
|
|
6
6
|
/** alignment bij de footer. (default = 'c') */
|
|
7
7
|
alignment?: AlignmentProp;
|
|
8
8
|
classes?: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { AlignmentProp } from '../../..';
|
|
3
3
|
declare const ScrollArea: {
|
|
4
4
|
Horizontal: (props: {
|
|
5
5
|
/** wat moet er in de flexbox container komen */
|
|
6
|
-
children: ReactNode;
|
|
6
|
+
children: React.ReactNode;
|
|
7
7
|
/** moeten de items gewrapped worden (meerdere rijen/kolommen) (default = false) */
|
|
8
8
|
wrap?: boolean;
|
|
9
9
|
/** moeten de items van eind tot begin of begin tot eind komen? (default = false) */
|
|
@@ -34,7 +34,7 @@ declare const ScrollArea: {
|
|
|
34
34
|
}) => JSX.Element;
|
|
35
35
|
Vertical: (props: {
|
|
36
36
|
/** wat moet er in de flexbox container komen */
|
|
37
|
-
children: ReactNode;
|
|
37
|
+
children: React.ReactNode;
|
|
38
38
|
/** moeten de items gewrapped worden (meerdere rijen/kolommen) (default = false) */
|
|
39
39
|
wrap?: boolean;
|
|
40
40
|
/** moeten de items van eind tot begin of begin tot eind komen? (default = false) */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* Maak een simpele container m een pagina te verdelen in secties.
|
|
4
4
|
* een section heeft een responsive padding.
|
|
@@ -6,6 +6,6 @@ import { ReactNode } from 'react';
|
|
|
6
6
|
* @returns <div class="section">
|
|
7
7
|
*/
|
|
8
8
|
export declare function Section(props: {
|
|
9
|
-
children: ReactNode;
|
|
9
|
+
children: React.ReactNode;
|
|
10
10
|
classes?: string;
|
|
11
11
|
}): JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
declare type LinkButtonProps = {
|
|
3
3
|
/** de content van de button */
|
|
4
|
-
children?: ReactNode;
|
|
4
|
+
children?: React.ReactNode;
|
|
5
5
|
/** onClick voor de button */
|
|
6
6
|
onClick: (e: any) => any | void;
|
|
7
7
|
/** een tooltip voor de button */
|
|
@@ -31,7 +31,7 @@ declare type LinkProps = {
|
|
|
31
31
|
/** is dit een downloadlink? */
|
|
32
32
|
download?: boolean;
|
|
33
33
|
/** de inhoud van de link: wat is er te lezen / zien */
|
|
34
|
-
children?: ReactNode;
|
|
34
|
+
children?: React.ReactNode;
|
|
35
35
|
/** een tooltip voor de button */
|
|
36
36
|
tooltip?: string;
|
|
37
37
|
id?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { ColorProp, SizeProp } from '../../loon-react-bulma-types';
|
|
3
3
|
/** maak de uiteindelijke message */
|
|
4
4
|
declare const Message: {
|
|
@@ -21,7 +21,7 @@ declare const Message: {
|
|
|
21
21
|
export { Message };
|
|
22
22
|
export declare type MessageProps = {
|
|
23
23
|
/** content van de message */
|
|
24
|
-
children: ReactNode;
|
|
24
|
+
children: React.ReactNode;
|
|
25
25
|
/** Optionele titel voor de message */
|
|
26
26
|
title?: string | undefined;
|
|
27
27
|
/** de grootte van de tekst in de messages (default = undefined|'m') */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { ColorProp } from '../../loon-react-bulma-types';
|
|
3
3
|
/**
|
|
4
4
|
* Een instelbare notificatie. Default is een info-notificatie
|
|
@@ -26,7 +26,7 @@ export { Notification };
|
|
|
26
26
|
/** Props voor een Notification */
|
|
27
27
|
export declare type NotificationProps = {
|
|
28
28
|
/** content van de notificatie */
|
|
29
|
-
children: ReactNode;
|
|
29
|
+
children: React.ReactNode;
|
|
30
30
|
/**
|
|
31
31
|
* afhandeling van dismiss-click notificatie
|
|
32
32
|
* @param e event
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { AlignmentProp } from '../..';
|
|
3
3
|
import { ColorProp, TagSizeProp } from '../../loon-react-bulma-types';
|
|
4
4
|
export declare type TagProps = {
|
|
5
5
|
/** content van de tag */
|
|
6
|
-
children: ReactNode;
|
|
6
|
+
children: React.ReactNode;
|
|
7
7
|
/** kleur van de tag, de standaard kleuren + dark & light */
|
|
8
8
|
color?: ColorProp | 'dark' | 'light';
|
|
9
9
|
/** sizes van de tag. (default = 's'). LET OP 3 verschillende sizes ipv 4! */
|
|
@@ -19,7 +19,7 @@ export declare type TagProps = {
|
|
|
19
19
|
};
|
|
20
20
|
export declare type TagsProps = {
|
|
21
21
|
/** de content van de tags-div */
|
|
22
|
-
children: ReactNode;
|
|
22
|
+
children: React.ReactNode;
|
|
23
23
|
/** moeten de tags aan elkaar geplakt worden */
|
|
24
24
|
merged?: boolean;
|
|
25
25
|
/** de grootte van alle tags , overschrijfbaar per tag (default = 's'). LET OP: 3 sizes ipv 4 */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { ColorProp } from '../../loon-react-bulma-types';
|
|
3
3
|
export declare type NotifierProviderProps = {
|
|
4
4
|
/** de child-components die de notifier mogen gebruiken */
|
|
@@ -23,7 +23,7 @@ export declare type NotifierItemProps = {
|
|
|
23
23
|
/** type notificatie I(info), S(success), D(danger), W(warning) */
|
|
24
24
|
type?: ColorProp;
|
|
25
25
|
/** de content voor de notificatie */
|
|
26
|
-
content?: ReactNode;
|
|
26
|
+
content?: React.ReactNode;
|
|
27
27
|
/** tijd voor automatisch sluiten in milliseconden.
|
|
28
28
|
* 0 om niet automatisch te sluiten. Dan is de notificatie alleen te sluiten met een 'click' */
|
|
29
29
|
dismissAfter?: 0 | number;
|