loon-bulma-react 2022.3.17 → 2022.3.18
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 +24 -14
- package/dist/components/Calendar/CalendarItems/CalendarColoredItem.d.ts +9 -7
- package/dist/components/Calendar/CalendarItems/CalendarItem.d.ts +9 -7
- package/dist/components/Calendar/Month/DayContainer.d.ts +9 -7
- package/dist/components/Calendar/Month/MonthView.d.ts +1 -1
- package/dist/components/Calendar/Month/MoreEvents.d.ts +9 -7
- package/dist/components/Calendar/Week/AlldayContainer.d.ts +9 -7
- package/dist/components/Calendar/Week/HourRow.d.ts +10 -5
- package/dist/components/Form/Base.Input.Container.d.ts +1 -1
- package/dist/components/Form/Checkbox/Checkbox.d.ts +2 -2
- package/dist/components/Form/Datetimes/DateInput.d.ts +1 -1
- package/dist/components/Form/Datetimes/DateTimeInput.d.ts +1 -1
- package/dist/components/Form/Datetimes/TimeInput.d.ts +1 -1
- package/dist/components/Form/File/FileInput.d.ts +2 -2
- package/dist/components/Form/Input.d.ts +4 -2
- package/dist/components/Form/Numeric/MultiRangeInput.d.ts +2 -2
- package/dist/components/Form/Numeric/NumberInput.d.ts +1 -1
- package/dist/components/Form/Numeric/RangeInput.d.ts +2 -2
- package/dist/components/Form/Others/ColorInput.d.ts +1 -1
- package/dist/components/Form/Radio/Radio.d.ts +3 -2
- package/dist/components/Form/Selects/MultiSelect.d.ts +2 -2
- package/dist/components/Form/Selects/Select.d.ts +2 -2
- package/dist/components/Form/Text/EmailInput.d.ts +1 -1
- package/dist/components/Form/Text/PasswordInput.d.ts +1 -1
- package/dist/components/Form/Text/TextArea.d.ts +2 -3
- package/dist/components/Form/Text/TextInput.d.ts +1 -1
- package/dist/components/Form/shared/Base.Input.Container.d.ts +13 -0
- package/dist/components/Form/shared/BaseInputProps.d.ts +105 -0
- package/dist/components/Form/shared/InputError.d.ts +12 -0
- package/dist/components/Form/shared/InputIcons.d.ts +13 -0
- package/dist/components/Form/shared/index.d.ts +4 -0
- package/dist/index.js +163 -170
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +163 -170
- package/dist/index.modern.js.map +1 -1
- package/dist/loon-react-bulma-types.d.ts +1 -2
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -2,12 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> ## Aanpassingen
|
|
4
4
|
>
|
|
5
|
-
>
|
|
6
|
-
> README voor `usePagination`, `useEventListener`, `useUncontrolled`<br />
|
|
7
|
-
|
|
8
|
-
<!-- ## Nog te doen
|
|
9
|
-
|
|
10
|
-
> TODO: usePagination Hook -->
|
|
5
|
+
> - Inputs: voor inputs waarbij je moet typen: de `icons`-prop om een eigen icoontje in te kunnen stellen.
|
|
11
6
|
|
|
12
7
|
## [Bulma](https://bulma.io/) & [React](https://reactjs.org/) componenten voor Loon Salarissoftware.
|
|
13
8
|
|
|
@@ -94,10 +89,12 @@
|
|
|
94
89
|
|
|
95
90
|
### Voor de laatste versie:
|
|
96
91
|
|
|
97
|
-
Dat kan zonder toevoeging van versienummer. Je gebruikt dan de laatste versie (dus ook laatste jaar-tag) van de componenten. De tag `latest`
|
|
92
|
+
Dat kan zonder toevoeging van versienummer. Je gebruikt dan de laatste versie (dus ook laatste jaar-tag) van de componenten. De tag `latest` moet je dan wel even toevoegen. Als je deze tag niet toevoegd, installeert npm de in de `package.json` opgegeven versie.
|
|
98
93
|
|
|
99
94
|
```bash
|
|
100
|
-
|
|
95
|
+
# installeer de meest recente versie van de package. (& update de package.json)
|
|
96
|
+
npm install --save bulma loon-bulma-react@latest
|
|
97
|
+
# installeer de versie die in package.json is gedefinieerd
|
|
101
98
|
```
|
|
102
99
|
|
|
103
100
|
### Voor een versie die hoort bij een bepaald jaar (Bijvoorbeeld in Loon-2021).
|
|
@@ -105,17 +102,18 @@ npm install --save bulma loon-bulma-react
|
|
|
105
102
|
Het jaar wordt bepaald door tags: voor elk jaar is er een tag van de vorm `y[jaar]`. De 'y' is nodig omdat alleen een jaartal geen geldige tag is.
|
|
106
103
|
|
|
107
104
|
```bash
|
|
108
|
-
npm install --save loon-bulma-react@
|
|
105
|
+
npm install --save loon-bulma-react@y2022
|
|
109
106
|
```
|
|
110
107
|
|
|
111
108
|
Om vast te leggen welke tag je wil gebruiken, moet je in de `package.json` het versie-nummer aanpassen tot de tag.
|
|
112
|
-
Dan wordt altijd de laatste versie van die tag geïnstalleerd, in plaats van de laatste versie.
|
|
109
|
+
Dan wordt altijd de laatste versie van die tag geïnstalleerd, in plaats van de laatste versie die is gepubliceerd.
|
|
110
|
+
Voor het meeste recente Loon-jaar kan je _wel_ `npm install loon-bulma-react@latest` gebruiken.
|
|
113
111
|
|
|
114
112
|
```json
|
|
115
113
|
{
|
|
116
114
|
"devDependencies": {
|
|
117
115
|
// ...
|
|
118
|
-
"loon-bulma-react": "
|
|
116
|
+
"loon-bulma-react": "y2023"
|
|
119
117
|
// ...
|
|
120
118
|
}
|
|
121
119
|
}
|
|
@@ -128,7 +126,8 @@ Dan wordt altijd de laatste versie van die tag geïnstalleerd, in plaats van de
|
|
|
128
126
|
>
|
|
129
127
|
> - `@y2020` --> Testversie voor **2020**, installeren met `npm install loon-bulma-react@y2021`.
|
|
130
128
|
> - `@y2021` --> Versie voor **2021**, installeren met `npm install loon-bulma-react@y2021`.
|
|
131
|
-
> - `@y2022` --> Versie voor **2022**, installeren met `npm install loon-bulma-react@y2022`.
|
|
129
|
+
> - `@y2022` --> Versie voor **2022**, installeren met `npm install loon-bulma-react@y2022`.
|
|
130
|
+
> - `@y2023` --> Versie voor **2023**, installeren met `npm install loon-bulma-react@y2023`. Zelfde als `latest`
|
|
132
131
|
> - `@latest` --> Default versie die geïnstalleerd wordt met `npm install loon-bulma-react`
|
|
133
132
|
|
|
134
133
|
## Gebruik <a id="gebruik"></a>
|
|
@@ -478,9 +477,8 @@ Een ScrollArea is een horizontaal of verticaal scrollbare `<div>` met flexbox-ei
|
|
|
478
477
|
|
|
479
478
|
#### Button & ButtonGroup <a id="component-button"></a>
|
|
480
479
|
|
|
481
|
-
Gebruikt de [Bulma-button](https://bulma.io/documentation/elements/button/) Er zijn meerdere soorten button-types. Van elke soort zijn er 6 beschikbaar: _Primary_, _Danger_, _Warning_, _Success_, _Link_, _Info_
|
|
480
|
+
Gebruikt de [Bulma-button](https://bulma.io/documentation/elements/button/) Er zijn meerdere soorten button-types. Van elke soort zijn er 6 beschikbaar: _Primary_, _Danger_, _Warning_, _Success_, _Link_, _Info_.
|
|
482
481
|
|
|
483
|
-
- _**Bttn**: een default button (met instelbare `color`-props) -> bestaat niett meer_
|
|
484
482
|
- **Button**: Voorheen `Bttn`
|
|
485
483
|
- `<Button.Primary>` Een button in de primary kleur
|
|
486
484
|
- `<Button.Success>` Een button in de success kleur
|
|
@@ -1365,6 +1363,7 @@ Er zijn verschillende soorten inputs voor de afhandeling van input-types. Er zij
|
|
|
1365
1363
|
- `placeholder`: placeholder-tekst voor een input.
|
|
1366
1364
|
- `tooltip`: tooltip voor een input (`<input title="..." />`)
|
|
1367
1365
|
- `disabled`: input disabled
|
|
1366
|
+
|
|
1368
1367
|
- `errorMessage`: een errormessage van buiten de component. Voor als je validatie anders wilt oplossen. Wordt altijd getoont
|
|
1369
1368
|
- `validatie`: een object met wat standaard-validatie-opties en een onValidate-function input. Een validatie-error wordt alleen getoont als de input 'touched' is.
|
|
1370
1369
|
- `required`: input is verplicht
|
|
@@ -1385,6 +1384,17 @@ Er zijn verschillende soorten inputs voor de afhandeling van input-types. Er zij
|
|
|
1385
1384
|
- `size`: de grootte van een input
|
|
1386
1385
|
- `textAlign`: waar komt de tekst in de input (default = 'l', left)
|
|
1387
1386
|
|
|
1387
|
+
Voor een aantal inputs (waar je moet typen) Is er ook nog de `icons`-prop. Deze prop ziet er zo uit:
|
|
1388
|
+
|
|
1389
|
+
```ts
|
|
1390
|
+
type Icons = {
|
|
1391
|
+
start: IconProp | string;
|
|
1392
|
+
end: (valid: boolean) => IconProp | string;
|
|
1393
|
+
};
|
|
1394
|
+
```
|
|
1395
|
+
|
|
1396
|
+
Deze `icons`-prop kan gebruikt worden voor het instellen van de icoontjes aan het begin(start) en einde (end) van de input. De `start`-property wordt gebruikt ipv de default start-icons. De `end`-property wordt dan gebruikt in plaats van de default valid/invalid icons. Daarom is de `end`-property ook een function.
|
|
1397
|
+
|
|
1388
1398
|
```tsx
|
|
1389
1399
|
<div>
|
|
1390
1400
|
<BasicInput name="something" type="text">
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { MouseEvent } from 'react';
|
|
2
2
|
import { EventOptions, BaseEventProps } from '../Props';
|
|
3
|
-
|
|
4
|
-
* Component voor een event dat de hele dag duurt
|
|
5
|
-
* @param props
|
|
6
|
-
* @returns
|
|
7
|
-
*/
|
|
8
|
-
export declare function CalendarColoredItem<T extends BaseEventProps>(props: {
|
|
3
|
+
declare type CalendarColoredItemProps<T extends BaseEventProps> = {
|
|
9
4
|
/** het event */
|
|
10
5
|
desc: (event: T) => JSX.Element;
|
|
11
6
|
event: T;
|
|
@@ -13,4 +8,11 @@ export declare function CalendarColoredItem<T extends BaseEventProps>(props: {
|
|
|
13
8
|
options?: EventOptions<T>;
|
|
14
9
|
/** onclick handler voor het event */
|
|
15
10
|
onClick?: (event: T, clickEvent: MouseEvent<HTMLElement>) => void;
|
|
16
|
-
}
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Component voor een event dat de hele dag duurt
|
|
14
|
+
* @param props
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
17
|
+
export declare function CalendarColoredItem<T extends BaseEventProps>({ event, options, onClick, desc, }: CalendarColoredItemProps<T>): JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { MouseEvent } from 'react';
|
|
2
2
|
import { EventOptions, BaseEventProps } from '../Props';
|
|
3
|
-
|
|
4
|
-
* Component voor een event met een tijdstip en NIET de hele dag duurt
|
|
5
|
-
* @param props
|
|
6
|
-
* @returns
|
|
7
|
-
*/
|
|
8
|
-
export declare function CalendarItem<T extends BaseEventProps>(props: {
|
|
3
|
+
declare type CalendarItemProps<T extends BaseEventProps> = {
|
|
9
4
|
desc: (event: T) => JSX.Element;
|
|
10
5
|
/** het event */
|
|
11
6
|
event: T;
|
|
@@ -13,4 +8,11 @@ export declare function CalendarItem<T extends BaseEventProps>(props: {
|
|
|
13
8
|
options?: EventOptions<T>;
|
|
14
9
|
/** onclick handler */
|
|
15
10
|
onClick?: (event: T, clickEvent: MouseEvent<HTMLElement>) => void;
|
|
16
|
-
}
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Component voor een event met een tijdstip en NIET de hele dag duurt
|
|
14
|
+
* @param props
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
17
|
+
export declare function CalendarItem<T extends BaseEventProps>({ event, options, onClick, desc, }: CalendarItemProps<T>): JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BaseEventProps, CalendarOptions } from '../Props';
|
|
3
3
|
import { JSDateTime } from '../../../utils/JSDateTime.class';
|
|
4
|
-
|
|
5
|
-
* Component voor de dag-container in de maand-view
|
|
6
|
-
* @param props
|
|
7
|
-
* @returns
|
|
8
|
-
*/
|
|
9
|
-
export declare function DayContainer<T extends BaseEventProps>(props: {
|
|
4
|
+
declare type DayContainerProps<T extends BaseEventProps> = {
|
|
10
5
|
/** events op deze dag */
|
|
11
6
|
events: T[];
|
|
12
7
|
/** wat te doen als een event aangeklikt wordt */
|
|
@@ -17,4 +12,11 @@ export declare function DayContainer<T extends BaseEventProps>(props: {
|
|
|
17
12
|
options?: CalendarOptions<T>;
|
|
18
13
|
/** de datum voor de container */
|
|
19
14
|
date: JSDateTime;
|
|
20
|
-
}
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Component voor de dag-container in de maand-view
|
|
18
|
+
* @param props
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
export declare function DayContainer<T extends BaseEventProps>({ options, date, onDayClick, onEventClick, events, }: DayContainerProps<T>): JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -18,6 +18,6 @@ declare type MonthViewProps<T extends BaseEventProps> = {
|
|
|
18
18
|
* @param props
|
|
19
19
|
* @returns
|
|
20
20
|
*/
|
|
21
|
-
declare function MonthView<T extends BaseEventProps>(
|
|
21
|
+
declare function MonthView<T extends BaseEventProps>({ viewDate: vd, options, onEventClick, onDayClick, events: orgEvents, }: MonthViewProps<T>): JSX.Element;
|
|
22
22
|
export { MonthView };
|
|
23
23
|
export type { MonthViewProps };
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { MouseEvent } from 'react';
|
|
2
2
|
import { BaseEventProps, EventOptions } from '../Props';
|
|
3
|
-
|
|
4
|
-
* expandable events als er meer dan 5 events op een dag vallen
|
|
5
|
-
* @param props
|
|
6
|
-
* @returns
|
|
7
|
-
*/
|
|
8
|
-
export declare function MoreEventsView<T extends BaseEventProps>(props: {
|
|
3
|
+
declare type MoreEventsViewProps<T extends BaseEventProps> = {
|
|
9
4
|
/** de events op deze dag */
|
|
10
5
|
events: T[];
|
|
11
6
|
/** event-click handling */
|
|
@@ -15,4 +10,11 @@ export declare function MoreEventsView<T extends BaseEventProps>(props: {
|
|
|
15
10
|
allday?: EventOptions<T>;
|
|
16
11
|
timed?: EventOptions<T>;
|
|
17
12
|
};
|
|
18
|
-
}
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* expandable events als er meer dan 5 events op een dag vallen
|
|
16
|
+
* @param props
|
|
17
|
+
* @returns
|
|
18
|
+
*/
|
|
19
|
+
export declare function MoreEventsView<T extends BaseEventProps>({ events, onEventClick, options, }: MoreEventsViewProps<T>): JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BaseEventProps, CalendarOptions } from '../Props';
|
|
3
|
-
|
|
4
|
-
* Component voor allday objects in de calendar
|
|
5
|
-
* @param props
|
|
6
|
-
* @returns
|
|
7
|
-
*/
|
|
8
|
-
export declare function AlldayContainer<T extends BaseEventProps>({ options, events, onEventClick, }: {
|
|
3
|
+
declare type AlldayContainerProps<T extends BaseEventProps> = {
|
|
9
4
|
events: T[];
|
|
10
5
|
/** wat te doen als een event aangeklikt wordt */
|
|
11
6
|
onEventClick?: (event: T, clickEvent: React.MouseEvent<HTMLElement>) => void;
|
|
12
7
|
/** wat te doen als een dag aangeklikt wordt */
|
|
13
8
|
options?: CalendarOptions<T>;
|
|
14
|
-
}
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Component voor allday objects in de calendar
|
|
12
|
+
* @param props
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
export declare function AlldayContainer<T extends BaseEventProps>({ options, events, onEventClick }: AlldayContainerProps<T>): JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -8,13 +8,18 @@ import { BaseEventProps, CalendarOptions } from '../Props';
|
|
|
8
8
|
export declare function HourNumber({ hour }: {
|
|
9
9
|
hour: number;
|
|
10
10
|
}): JSX.Element;
|
|
11
|
+
declare type HourSlotProps<T extends BaseEventProps> = {
|
|
12
|
+
/** de events voor deze HourProp */
|
|
13
|
+
events: T[];
|
|
14
|
+
/** event-selected callback Fn */
|
|
15
|
+
onEventClick?: (event: T, clickEvent: React.MouseEvent<HTMLElement>) => void;
|
|
16
|
+
/** options bij de calendar */
|
|
17
|
+
options?: CalendarOptions<T>;
|
|
18
|
+
};
|
|
11
19
|
/**
|
|
12
20
|
* Component voor een uur-slot.
|
|
13
21
|
* @param param0
|
|
14
22
|
* @returns
|
|
15
23
|
*/
|
|
16
|
-
export declare function HourSlot<T extends BaseEventProps>({ events, onEventClick, options
|
|
17
|
-
|
|
18
|
-
onEventClick?: (event: T, clickEvent: React.MouseEvent<HTMLElement>) => void;
|
|
19
|
-
options?: CalendarOptions<T>;
|
|
20
|
-
}): JSX.Element;
|
|
24
|
+
export declare function HourSlot<T extends BaseEventProps>({ events, onEventClick, options }: HourSlotProps<T>): JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -8,6 +8,6 @@ export declare const InputContainer: ({ label, children: input, error, size, dir
|
|
|
8
8
|
} | undefined;
|
|
9
9
|
children: React.ReactNode;
|
|
10
10
|
error?: React.ReactNode;
|
|
11
|
-
size?: "s" | "
|
|
11
|
+
size?: "s" | "m" | "l" | "xl" | undefined;
|
|
12
12
|
direction: DirectionProp;
|
|
13
13
|
}) => JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CheckradioStylingType, ColorProp } from '../../../loon-react-bulma-types';
|
|
3
|
-
import { BaseInputProps } from '../
|
|
4
|
-
declare type CheckboxInputProps = BaseInputProps & {
|
|
3
|
+
import { BaseInputProps } from '../shared';
|
|
4
|
+
declare type CheckboxInputProps = Omit<BaseInputProps, 'icons'> & {
|
|
5
5
|
/** kleur van de checkbox (default = 'l', link) */
|
|
6
6
|
color?: ColorProp;
|
|
7
7
|
/** speciale styling van de checkbox */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { BaseInputProps } from '../
|
|
2
|
+
import { BaseInputProps } from '../shared';
|
|
3
3
|
declare type DateInputProps = BaseInputProps & {
|
|
4
4
|
/** start value voor deze input (optioneel) FORMAT: YYYY-MM-DD */
|
|
5
5
|
value?: string | Date;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { BaseInputProps } from '../
|
|
2
|
+
import { BaseInputProps } from '../shared';
|
|
3
3
|
declare type DateTimeInputProps = BaseInputProps & {
|
|
4
4
|
/** start value voor deze input (optioneel) FORMAT: YYYY-MM-DDTHH:mm */
|
|
5
5
|
value?: string | Date;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { BaseInputProps } from '../
|
|
2
|
+
import { BaseInputProps } from '../shared';
|
|
3
3
|
declare type TimeInputProps = BaseInputProps & {
|
|
4
4
|
/** start value voor deze input (optioneel) FORMAT: HH:mm:SS */
|
|
5
5
|
value?: string | Date;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
3
|
-
import { BaseInputProps } from '../
|
|
4
|
-
declare type FileInputProps = BaseInputProps & {
|
|
3
|
+
import { BaseInputProps } from '../shared';
|
|
4
|
+
declare type FileInputProps = Omit<BaseInputProps, 'icons'> & {
|
|
5
5
|
/** file types die een file-input zou moeten accepteren. Komma-gescheiden lijst van unieke file-type-specificaties (zie MDN: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file) */
|
|
6
6
|
accept?: string;
|
|
7
7
|
/** welke camera moet er gebruikt maken voor afbeelding/video data, als dat via de accept-prop is toegestaan */
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
3
3
|
import { AutoCompleteType } from './../../loon-react-bulma-types';
|
|
4
|
-
import { BaseInputProps, InputTypeProp } from './
|
|
4
|
+
import { BaseInputProps, InputTypeProp } from './shared';
|
|
5
5
|
declare type InputValueType = string | number | readonly string[] | Date | undefined;
|
|
6
6
|
declare type InputProps<T extends InputValueType> = BaseInputProps<T> & {
|
|
7
|
-
icon
|
|
7
|
+
/** default icon voor aan begin van de input
|
|
8
|
+
*/
|
|
9
|
+
icon?: string | IconProp;
|
|
8
10
|
/** type van de tekst input (default = 'text') */
|
|
9
11
|
type: InputTypeProp;
|
|
10
12
|
/** start value voor deze input (optioneel) */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { BaseInputProps } from '../
|
|
3
|
-
declare type MultiRangeInputProps = BaseInputProps & {
|
|
2
|
+
import { BaseInputProps } from '../shared';
|
|
3
|
+
declare type MultiRangeInputProps = Omit<BaseInputProps, 'icons'> & {
|
|
4
4
|
/** stap-grootte voor de input (optioneel, default = 1) */
|
|
5
5
|
step?: number;
|
|
6
6
|
/** de start-waarde voor de input (optioneel) */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { BaseInputProps } from '../
|
|
3
|
-
declare type RangeInputProps = BaseInputProps & {
|
|
2
|
+
import { BaseInputProps } from '../shared';
|
|
3
|
+
declare type RangeInputProps = Omit<BaseInputProps, 'icons'> & {
|
|
4
4
|
/** stap-grootte voor de input (optioneel, default = 1) */
|
|
5
5
|
step?: number;
|
|
6
6
|
/** de start-waarde voor de input (optioneel) */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CheckradioStylingType, ColorProp, DirectionProp, SizeProp, TextAlignmentProp } from '../../../loon-react-bulma-types';
|
|
3
|
-
import { BaseInputProps } from '../
|
|
4
|
-
declare type RadioInputProps = BaseInputProps & {
|
|
3
|
+
import { BaseInputProps } from '../shared';
|
|
4
|
+
declare type RadioInputProps = Omit<BaseInputProps, 'icons'> & {
|
|
5
5
|
value?: string;
|
|
6
6
|
children?: React.ReactNode;
|
|
7
7
|
onValueChanged?(newVal: string, isValid?: boolean): any | void;
|
|
@@ -81,6 +81,7 @@ declare const RadioGroup: {
|
|
|
81
81
|
* | styling | `rounded`,`noborder` | | de styling van de checkbox |
|
|
82
82
|
* | | `colored`, `blocky` | | |
|
|
83
83
|
* | direction | `h`,`v` | `h` | de form-richting voor de input |
|
|
84
|
+
* | icons | | | RADIOGROUP HEEFT GEEN ICONS |
|
|
84
85
|
*/
|
|
85
86
|
Item: (props: RadioItemProps) => JSX.Element;
|
|
86
87
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { BaseInputProps } from '../
|
|
2
|
+
import { BaseInputProps } from '../shared';
|
|
3
3
|
import { SelectOptionType, SelectOptionGroupType } from './BaseSelectProps';
|
|
4
|
-
declare type MultiSelectInputProps = BaseInputProps & {
|
|
4
|
+
declare type MultiSelectInputProps = Omit<BaseInputProps, 'icons'> & {
|
|
5
5
|
/** de waarde */
|
|
6
6
|
value?: string[];
|
|
7
7
|
/** de values voor de options. DEZE MOETEN UNIEK ZIJN! */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { SizeProp } from '../../../loon-react-bulma-types';
|
|
3
|
-
import { BaseInputProps } from '../
|
|
3
|
+
import { BaseInputProps } from '../shared';
|
|
4
4
|
import { SelectOptionType, SelectOptionGroupType } from './BaseSelectProps';
|
|
5
|
-
declare type SelectInputProps = BaseInputProps & {
|
|
5
|
+
declare type SelectInputProps = Omit<BaseInputProps, 'icons'> & {
|
|
6
6
|
/** de waarde */
|
|
7
7
|
value?: number | string;
|
|
8
8
|
/** de values voor de options. DEZE MOETEN UNIEK ZIJN! */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { AutoCompleteType } from '../../../loon-react-bulma-types';
|
|
3
|
-
import { BaseInputProps } from '../
|
|
3
|
+
import { BaseInputProps } from '../shared';
|
|
4
4
|
declare type EmailInputProps = BaseInputProps & {
|
|
5
5
|
/** start value voor deze input (optioneel) */
|
|
6
6
|
value?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { AutoCompleteType } from '../../../loon-react-bulma-types';
|
|
3
|
-
import { BaseInputProps } from '../
|
|
3
|
+
import { BaseInputProps } from '../shared';
|
|
4
4
|
declare type PasswordInputProps = BaseInputProps & {
|
|
5
5
|
/** start value voor deze input (optioneel) */
|
|
6
6
|
value?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { BaseInputProps } from '../
|
|
3
|
-
declare type TextAreaProps = BaseInputProps & {
|
|
2
|
+
import { BaseInputProps } from '../shared';
|
|
3
|
+
declare type TextAreaProps = Omit<BaseInputProps, 'icons'> & {
|
|
4
4
|
/** value van een texarea kan via de children of de value-prop */
|
|
5
5
|
value?: string;
|
|
6
6
|
/**
|
|
@@ -24,7 +24,6 @@ declare type TextAreaProps = BaseInputProps & {
|
|
|
24
24
|
* | type | `InputTypeProp` | | type voor de input (REQUIRED) |
|
|
25
25
|
* | label | `string` | `name` | de label voor de input |
|
|
26
26
|
* | id | `string` | `name` | de id voor de input |
|
|
27
|
-
* | icon | `string`, `IconProp` | | Optioneel icon voor de input |
|
|
28
27
|
* | tooltip | `string` | | tooltip voor de input |
|
|
29
28
|
* | autocomplete | `AutoCompleteType` | | autocomplete voor de input |
|
|
30
29
|
* | labelHidden | `boolean` | `false` | de label is verborgen (screenreaders) |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { AutoCompleteType } from '../../../loon-react-bulma-types';
|
|
3
|
-
import { BaseInputProps } from '../
|
|
3
|
+
import { BaseInputProps } from '../shared';
|
|
4
4
|
declare type CharType = '0-9' | 'a-z' | 'A-Z' | 'a-Z' | '0-Z' | string | RegExp;
|
|
5
5
|
declare type TextInputProps = BaseInputProps & {
|
|
6
6
|
/** type van de tekst input (default = 'text') */
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DirectionProp, SizeProp } from '../../../loon-react-bulma-types';
|
|
3
|
+
/** een wrapper voor een input component, om te zorgen dat ze allemaal op dezelfde manier horizontaal of verticaal aligned worden. */
|
|
4
|
+
export declare const InputContainer: ({ label, children: input, error, size, direction, }: {
|
|
5
|
+
label?: {
|
|
6
|
+
txt: string;
|
|
7
|
+
id: string;
|
|
8
|
+
} | undefined;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
error?: React.ReactNode;
|
|
11
|
+
size?: "s" | "l" | "m" | "xl" | undefined;
|
|
12
|
+
direction: DirectionProp;
|
|
13
|
+
}) => JSX.Element;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { TextAlignmentProp, DirectionProp, KeyboardTypeProp, SizeProp } from '../../../loon-react-bulma-types';
|
|
4
|
+
export declare type BaseInputProps<T extends any = void> = {
|
|
5
|
+
/** is dit veld disabled ? (optioneel) */
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
/** name input: gebruikt voor een <label> als er geen label gedefinieerd is & de name-attribuut <input> */
|
|
8
|
+
name: string;
|
|
9
|
+
/** id voor de input: gebruikt voor een <label for="*id*}">. default wordt anders de 'name'-prop gebruik */
|
|
10
|
+
id?: string;
|
|
11
|
+
/** een tooltip voor de button */
|
|
12
|
+
tooltip?: string;
|
|
13
|
+
/** label voor de input, als dat afwijkt van de name-attribuut */
|
|
14
|
+
label?: string;
|
|
15
|
+
/** label wordt alleen gebruikt voor accessibility, dus is onzichtbaar op het scherm. (default = false) */
|
|
16
|
+
labelHidden?: boolean;
|
|
17
|
+
/** grootte van de input (default = 'm', normal) */
|
|
18
|
+
size?: SizeProp;
|
|
19
|
+
/** Waar moet de tekst van de input uitgelijnd worden (default = 'l', links) */
|
|
20
|
+
textAlign?: TextAlignmentProp;
|
|
21
|
+
/** de input is horizontaal, label & input op 1 lijn. (default = 'horizontal') */
|
|
22
|
+
direction?: DirectionProp;
|
|
23
|
+
/** een object met validatie-regels */
|
|
24
|
+
validation?: FormValidationType<T>;
|
|
25
|
+
/** eigen errorMessage voor validatie buiten component om */
|
|
26
|
+
errorMessage?: string | ((value: T | string | string[] | number | number[] | boolean | Date | FileList | any) => string);
|
|
27
|
+
/** placeholder in input (optioneel) */
|
|
28
|
+
placeholder?: string;
|
|
29
|
+
/** Welk (virtueel) toetsenbord moet er gebruikt worden? (smartphones, tablets) */
|
|
30
|
+
keyboardType?: KeyboardTypeProp;
|
|
31
|
+
/** on-key-down-event, bijvoorbeeld voor het gebruik van Hotkeys als dit element focused is */
|
|
32
|
+
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
33
|
+
/** (optionele) andere icoontjes voor op de inputs. Anders worden de default-waarden gebruikt. */
|
|
34
|
+
icons?: {
|
|
35
|
+
/** Icon aan start van een input */
|
|
36
|
+
start?: IconProp | string;
|
|
37
|
+
/**
|
|
38
|
+
* Icon aan eind van een input
|
|
39
|
+
* @param v: valid
|
|
40
|
+
* @returns een fontawesome icon-prop of een fontawesome icon string
|
|
41
|
+
*/
|
|
42
|
+
end?: (v: boolean) => IconProp | string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
export declare type FormValidationType<T extends any = void> = {
|
|
46
|
+
/** is een value required? */
|
|
47
|
+
required?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* min value voor numbers
|
|
50
|
+
* min-length voor strings
|
|
51
|
+
* min-waarde voor ranges,
|
|
52
|
+
* minimaal aantal selected in multiselect,
|
|
53
|
+
* min-date voor datum/tijd ("YYYY-MM-DD", "HH:mm" of "YYYY-MM-DDT:HH:mm").
|
|
54
|
+
* GEBRUIKT VOOR VALIDATIE */
|
|
55
|
+
min?: number | string;
|
|
56
|
+
/**
|
|
57
|
+
* max value voor numbers,
|
|
58
|
+
* max-length voor strings,
|
|
59
|
+
* max-waarde voor ranges,
|
|
60
|
+
* maximaal aantal selected in multiselect,
|
|
61
|
+
* max-date voor datum/tijd ("YYYY-MM-DD", "HH:mm" of "YYYY-MM-DDT:HH:mm").
|
|
62
|
+
* GEBRUIKT VOOR VALIDATIE */
|
|
63
|
+
max?: number | string;
|
|
64
|
+
/** voor <input type="multirange">: het minimale verschil tussen 2 waarden. */
|
|
65
|
+
minDiff?: number;
|
|
66
|
+
/** voor <input type="multirange">: het maximale verschil tussen 2 waarden. */
|
|
67
|
+
maxDiff?: number;
|
|
68
|
+
/** een pattern voor string-validatie */
|
|
69
|
+
pattern?: string | RegExp;
|
|
70
|
+
/**
|
|
71
|
+
* een extra validatie-methode
|
|
72
|
+
* @param val de nieuwe te valideren waarde
|
|
73
|
+
* @returns een string met daarin de foutmelding OF een lege string voor een valid waarde.
|
|
74
|
+
*/
|
|
75
|
+
onValidate?: (val: T | string | string[] | number | number[] | boolean | Date | FileList | any) => string;
|
|
76
|
+
};
|
|
77
|
+
export declare type BaseState<T extends any = void> = {
|
|
78
|
+
/** de naam die in foutmeldingen komt */
|
|
79
|
+
description: string;
|
|
80
|
+
/** de fout-melding, '' voor valid */
|
|
81
|
+
invalidMsg: string;
|
|
82
|
+
/** is de waarde invalid */
|
|
83
|
+
valid: boolean;
|
|
84
|
+
/** is de input aangeraakt */
|
|
85
|
+
touched: boolean;
|
|
86
|
+
/** validatie-object voor deze input */
|
|
87
|
+
validation?: FormValidationType<T>;
|
|
88
|
+
};
|
|
89
|
+
export declare type BaseChangeStateType = {
|
|
90
|
+
type: 'CHANGE';
|
|
91
|
+
invalidMsg: string;
|
|
92
|
+
};
|
|
93
|
+
export declare type BaseTouchStateType = {
|
|
94
|
+
type: 'TOUCH';
|
|
95
|
+
touched: boolean;
|
|
96
|
+
};
|
|
97
|
+
export declare type BaseSetStateType<T extends any = void> = {
|
|
98
|
+
type: 'SET';
|
|
99
|
+
validation?: FormValidationType<T>;
|
|
100
|
+
};
|
|
101
|
+
export declare type BaseFocusStateType = {
|
|
102
|
+
type: 'FOCUS';
|
|
103
|
+
focus: boolean;
|
|
104
|
+
};
|
|
105
|
+
export declare type InputTypeProp = 'text' | 'password' | 'number' | 'email' | 'tel' | 'url' | 'range' | 'date' | 'datetime-local' | 'datetime' | 'month' | 'week' | 'time' | 'color' | 'search' | 'multirange' | 'multiselect' | 'select' | 'textarea';
|
|
@@ -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 };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
3
|
+
declare type InputIconProps = {
|
|
4
|
+
icons?: {
|
|
5
|
+
start?: IconProp | string;
|
|
6
|
+
end?: (v: boolean) => IconProp | string;
|
|
7
|
+
};
|
|
8
|
+
touched: boolean;
|
|
9
|
+
valid: boolean;
|
|
10
|
+
defaultIcon: IconProp | string;
|
|
11
|
+
};
|
|
12
|
+
declare function InputIcons({ icons, touched, valid, defaultIcon }: InputIconProps): JSX.Element;
|
|
13
|
+
export { InputIcons };
|