loon-bulma-react 2023.0.25 → 2023.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Modal/Modal.d.ts +1 -0
- package/dist/forms/Checkbox/CB.d.ts +2 -2
- package/dist/forms/FormBuilder/FormBuilderProps.d.ts +4 -2
- package/dist/forms/Input.d.ts +87 -49
- package/dist/forms/Numeric/MultiRangeInput.d.ts +2 -1
- package/dist/forms/Radio/RB.d.ts +1 -1
- package/dist/forms/Radio/Radio.d.ts +2 -0
- package/dist/forms/Text/TextInput.d.ts +1 -1
- package/dist/forms/index.d.ts +1 -1
- package/dist/forms/shared/BaseInputProps.d.ts +4 -0
- package/dist/hooks/useCaretPosition.d.ts +3 -0
- package/dist/index.js +280 -148
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +45372 -0
- package/dist/index.modern.js +280 -148
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +1080 -0
- package/package.json +18 -18
- package/styles/checkradio.scss +1 -1
- package/dist/components/Calendar/Fourweeks/DayContainer.d.ts +0 -22
- package/dist/components/Calendar/Fourweeks/MonthView.d.ts +0 -23
- package/dist/components/Calendar/Month/DayContainer.d.ts +0 -22
- package/dist/components/DataTable/DataTableProps.d.ts +0 -102
- package/dist/components/Form/Checkbox/Checkbox.d.ts +0 -49
- package/dist/components/Form/Datetimes/DateInput.d.ts +0 -43
- package/dist/components/Form/Datetimes/DateTimeInput.d.ts +0 -43
- package/dist/components/Form/Datetimes/TimeInput.d.ts +0 -46
- package/dist/components/Form/File/FileInput.d.ts +0 -65
- package/dist/components/Form/Form.d.ts +0 -186
- package/dist/components/Form/FormBuilder/FormBuilder.d.ts +0 -9
- package/dist/components/Form/FormBuilder/FormBuilderProps.d.ts +0 -94
- package/dist/components/Form/Input.d.ts +0 -56
- package/dist/components/Form/Numeric/MultiRangeInput.d.ts +0 -44
- package/dist/components/Form/Numeric/NumberInput.d.ts +0 -46
- package/dist/components/Form/Numeric/RangeInput.d.ts +0 -45
- package/dist/components/Form/Others/ColorInput.d.ts +0 -42
- package/dist/components/Form/Others/HiddenInput.d.ts +0 -29
- package/dist/components/Form/Radio/Radio.d.ts +0 -120
- package/dist/components/Form/Selects/BaseSelectProps.d.ts +0 -21
- package/dist/components/Form/Selects/MultiSelect.d.ts +0 -56
- package/dist/components/Form/Selects/Select.d.ts +0 -56
- package/dist/components/Form/Text/EmailInput.d.ts +0 -49
- package/dist/components/Form/Text/PasswordInput.d.ts +0 -49
- package/dist/components/Form/Text/TextArea.d.ts +0 -46
- package/dist/components/Form/Text/TextInput.d.ts +0 -61
- package/dist/components/Form/shared/Base.Input.Container.d.ts +0 -13
- package/dist/components/Form/shared/BaseInputProps.d.ts +0 -105
- package/dist/components/Form/shared/InputError.d.ts +0 -12
- package/dist/components/Form/shared/InputIcons.d.ts +0 -13
- package/dist/components/Form/shared/index.d.ts +0 -4
- package/dist/components/Layout/AspectRatio/AspectRatio.d.ts +0 -28
- package/dist/components/Layout/Box/Box.d.ts +0 -19
- package/dist/components/Layout/Columns/Column.d.ts +0 -153
- package/dist/components/Layout/Columns/Columns.d.ts +0 -29
- package/dist/components/Layout/Container/Container.d.ts +0 -78
- package/dist/components/Layout/Content/Content.d.ts +0 -16
- package/dist/components/Layout/Footer/Footer.d.ts +0 -18
- package/dist/components/Layout/Hero/Hero.d.ts +0 -120
- package/dist/components/Layout/Image/Image.d.ts +0 -27
- package/dist/components/Layout/ScrollArea/ScrollArea.d.ts +0 -72
- package/dist/components/Layout/Section/Section.d.ts +0 -15
- package/dist/contexts/Confirm/Confirm.d.ts +0 -20
- package/dist/contexts/Confirm/ConfirmDialog.d.ts +0 -2
- package/dist/forms/RichTextArea/RichTextArea.d.ts +0 -5
- package/dist/functions/calculateTxtColor.function.d.ts +0 -15
- package/dist/functions/hasBSN.d.ts +0 -15
- package/dist/functions/index.d.ts +0 -1
- package/dist/functions/txtColorDecision.d.ts +0 -15
- package/dist/test-data.d.ts +0 -9
- package/dist/utils/JSDuration.d.ts +0 -82
- package/dist/utils/date-utils.d.ts +0 -312
|
@@ -41,6 +41,6 @@ declare type CBInputProps = Omit<BaseInputProps, 'keyboardType' | 'icons' | 'dir
|
|
|
41
41
|
* | onValueChanged() | `function` | | (value: boolean, valid?: boolean) => void |
|
|
42
42
|
* | onKeyDown() | `function` | | (event: React.KeyboardEvent) => void |
|
|
43
43
|
*/
|
|
44
|
-
declare function
|
|
45
|
-
export {
|
|
44
|
+
declare function CB({ checked, label, name, id, size, color, styling, textAlign, disabled, errorMessage, helpTag, onValueChanged, onKeyDown, onFocus, }: CBInputProps): JSX.Element;
|
|
45
|
+
export { CB };
|
|
46
46
|
export type { CBInputProps };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ColorProp, DirectionProp } from '~/loon-react-bulma-types';
|
|
3
|
+
import { FormValidationType } from '../shared';
|
|
3
4
|
import { SelectOptionType, SelectOptionGroupType } from './../Selects/BaseSelectProps';
|
|
4
5
|
/** Props voor de Form-component */
|
|
5
6
|
export declare type FormBuilderProps = {
|
|
@@ -36,6 +37,7 @@ export declare type FormBuilderProps = {
|
|
|
36
37
|
};
|
|
37
38
|
/** Props voor de fields in een form van de Form-Component */
|
|
38
39
|
export declare type FormBuilderFieldProps = {
|
|
40
|
+
onFocus?: (e: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>, helpTag?: string) => void;
|
|
39
41
|
/** de naam voor het field. gebruikt in input en in <label> als geen label gedefinieerd.
|
|
40
42
|
* <input name="..." /> */
|
|
41
43
|
name: string;
|
package/dist/forms/Input.d.ts
CHANGED
|
@@ -1,56 +1,94 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
declare type
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { AlignmentProp, AutoCompleteType, DirectionProp, KeyboardTypeProp, SizeProp } from '..';
|
|
4
|
+
import { InputTypeProp } from './shared';
|
|
5
|
+
declare type InputValueType = string | number | readonly string[] | undefined;
|
|
6
|
+
declare type InputStylingPropsType = {
|
|
7
|
+
/** grootte van de input (default = `m`, medium)*/ size?: SizeProp;
|
|
8
|
+
/** alignment van de input (default = `l`, left) */ alignment?: AlignmentProp;
|
|
9
|
+
/** label boven (`v`) of voor (`h`) de input, (default = `h`, horizontal) */ direction?: DirectionProp;
|
|
10
|
+
/** (optioneel) icon op de input */ iconLeft?: IconProp | string;
|
|
11
|
+
/** (optioneel) icon aan einde op de input */ iconRight?: IconProp | string;
|
|
12
|
+
};
|
|
13
|
+
declare type InputPropsType<T = InputValueType> = {
|
|
14
|
+
/** label bij de input. Als geen label, dan wordt de `name`-property gebruikt */ label?: string;
|
|
15
|
+
/** foutmelding bij de input*/ errorMessage?: string;
|
|
16
|
+
/** helptag in Loon bij de input (`:HOOFDGROEP:SUBGROEP:`)*/ helpTag?: string;
|
|
17
|
+
/** type input (default = `text`)*/ type?: InputTypeProp;
|
|
18
|
+
/** (optioneel) tooltip-title voor de input*/ title?: string;
|
|
19
|
+
/** (optioneel) id voor de input. Als geen id, dan wordt de `name`-property gebruikt */ id?: string;
|
|
20
|
+
/** name-property voor de input */ name: string;
|
|
21
|
+
/** waarde voor de input */ value?: T;
|
|
22
|
+
/** gebruikt deze input de spellchecked (default = `false`) */ spellCheck?: boolean;
|
|
23
|
+
/** is deze input required (default= `false`)*/ required?: boolean;
|
|
24
|
+
/** autocomplete voor deze input (default = `off`)*/ autoComplete?: AutoCompleteType;
|
|
25
|
+
/** type toetsenbord (voor smartphones) voor deze input (default = `text`)*/ keyboardType?: KeyboardTypeProp;
|
|
26
|
+
/** placeholder in de input */ placeholder?: string;
|
|
27
|
+
/** is deze input disabled 9default = `false`)*/ disabled?: boolean;
|
|
28
|
+
/** bij welk form hoort deze input?*/ form?: string;
|
|
29
|
+
/**
|
|
30
|
+
* max waarde of max lengte voor de input
|
|
31
|
+
* _(altijd hoger dan de `min`-prop)_
|
|
32
|
+
* @example // voor max waarde
|
|
33
|
+
* <Input type="number" max="100"/>
|
|
34
|
+
* <Input type="range" max="100"/>
|
|
35
|
+
* <Input type="date" max="2019-12-25"/>
|
|
36
|
+
* <Input type="month" max="2019-12"/>
|
|
37
|
+
* <Input type="week" max="2019-W23"/>
|
|
38
|
+
* <Input type="time" max="17:30"/>
|
|
39
|
+
* <Input type="datetime-local" max="29-12-25T23:59"/>
|
|
40
|
+
* @example //strings: voor max length, altijd 0 of hoger
|
|
41
|
+
* <Input type="text" max="100"/>
|
|
42
|
+
* <Input type="password" max="50"/>
|
|
43
|
+
*/
|
|
44
|
+
max?: number;
|
|
16
45
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* @
|
|
46
|
+
* min waarde of min lengte voor de input
|
|
47
|
+
* _(altijd lager dan de `max`-prop)_
|
|
48
|
+
* @example <Input type="number" min="1"/>
|
|
49
|
+
* <Input type="range" min="1"/>
|
|
50
|
+
* <Input type="date" min="2019-01-01"/>
|
|
51
|
+
* <Input type="month" min="2019-01-01"/>
|
|
52
|
+
* <Input type="week" min="2019-W01"/>
|
|
53
|
+
* <Input type="time" min="08:30"/>
|
|
54
|
+
* <Input type="datetime-local" max="2019-01-01T00:00"/>
|
|
55
|
+
* @example //strings: voor max length, altijd 0 of hoger
|
|
56
|
+
* <Input type="text" min="100"/>
|
|
57
|
+
* <Input type="password" min="50"/>*/
|
|
58
|
+
min?: number;
|
|
59
|
+
/** stapgrootte voor groter/kleiner aanpassingen
|
|
60
|
+
* | type| value | Example|
|
|
61
|
+
* |----------------|----------------|---------------------------------------------|
|
|
62
|
+
* | number | `1` | `<Input type="number" step="2"/>` |
|
|
63
|
+
* | range | `1` | `<Input type="range" step="2"/>` |
|
|
64
|
+
* | date | `1` (day) | `<Input type="date" step="2"/>` |
|
|
65
|
+
* | month | `1` (month) | `<Input type="month" step="2"/>` |
|
|
66
|
+
* | week | `1` (week) | `<Input type="week" step="2"/>` |
|
|
67
|
+
* | time | `60` (seconds) | `<Input type="time" step="2"/>` |
|
|
68
|
+
* | datetime-local | `1` (second) | `<Input type="datetime-local" step="900"/>` |
|
|
20
69
|
*/
|
|
21
|
-
|
|
70
|
+
step?: number;
|
|
71
|
+
/** Is deze input readonly (default = `false`). Bij `true` zie je alleen nog maar de content van de input*/
|
|
72
|
+
readonly?: boolean;
|
|
73
|
+
/** moet deze input de focus krijgen? (default = `false`)*/ autofocus?: boolean;
|
|
74
|
+
/** (optionele) `ref` voor gebruik met `React.useRef`*/ ref?: React.Ref<HTMLInputElement>;
|
|
75
|
+
/** callback voor unfocus (blur), zet OOK de input op `touched`*/
|
|
76
|
+
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
77
|
+
/** callback voor onChange*/
|
|
78
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
79
|
+
/** callback voor focus */
|
|
80
|
+
onFocus?: (e: React.FocusEvent<HTMLInputElement>, helpTag?: string) => void;
|
|
81
|
+
/** callback voor typen */
|
|
82
|
+
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
83
|
+
/** callback voor typen */
|
|
84
|
+
onKeyUp?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
22
85
|
};
|
|
86
|
+
declare function BaseInput<T extends InputValueType = string>({ placeholder, helpTag, errorMessage, label, disabled, keyboardType, type, title, name, value, required, spellCheck, id, autoComplete, max, min, readonly, step, autofocus, form, onBlur, onChange, onFocus, onKeyDown, onKeyUp, size, alignment, }: InputPropsType<T> & Omit<InputStylingPropsType, 'direction' | 'iconLeft' | 'iconRight'>): JSX.Element;
|
|
23
87
|
/**
|
|
24
|
-
*
|
|
25
|
-
* LET OP: Voor validatie kan ALLEEN de onValidate() function gebruikt
|
|
88
|
+
*
|
|
26
89
|
* @param props
|
|
27
|
-
* @returns
|
|
28
|
-
* @example <Input<T> type="text" placeholder="placeholder" name="name" id="id" value={value} {...props}/>
|
|
29
|
-
* @description alle props voor Input<T> component
|
|
30
|
-
* | prop | type | default | description |
|
|
31
|
-
* |-------------------|---------------------------|---------|--------------------------------------------|
|
|
32
|
-
* | name | `string` | | de naam voor de input (REQUIRED) |
|
|
33
|
-
* | type | `InputTypeProp` | | type voor de input (REQUIRED) |
|
|
34
|
-
* | label | `string` | `name` | de label voor de input |
|
|
35
|
-
* | id | `string` | `name` | de id voor de input |
|
|
36
|
-
* | icon | `string`, `IconProp` | | Optioneel icon voor de input |
|
|
37
|
-
* | tooltip | `string` | | tooltip voor de input |
|
|
38
|
-
* | autocomplete | `AutoCompleteType` | | autocomplete voor de input |
|
|
39
|
-
* | labelHidden | `boolean` | `false` | de label is verborgen (screenreaders) |
|
|
40
|
-
* | disabled | `boolean` | `false` | de input is disabled |
|
|
41
|
-
* | textAlign | `l`, `c`, `r` | `l` | de text-align van de input |
|
|
42
|
-
* | keyboardType | `search`, `text`, | `text ` | de type van de keyboard (touch-devices) |
|
|
43
|
-
* | | `email`,`tel`,`url` | | |
|
|
44
|
-
* | | `numeric`, `decimal` | | |
|
|
45
|
-
* | validation | `FormValidationType` | `{}` | de validatie voor de input |
|
|
46
|
-
* | value | `T` | | de waarde, generic<T> |
|
|
47
|
-
* | size | `s`,`m`,`l`,`xl` | `m` | de grootte van de input |
|
|
48
|
-
* | direction | `h`,`v` | `h` | de form-richting voor de input |
|
|
49
|
-
* | errorMessage | `string`, `function` | | een error message (van buiten setbaar) |
|
|
50
|
-
* | placeholder | `string` | | de placeholder voor de input |
|
|
51
|
-
* | onValueChanged() | `function` | | (value: T, valid?: boolean) => void |
|
|
52
|
-
* | onKeyDown() | `function` | | (event: React.KeyboardEvent) => void |
|
|
90
|
+
* @returns
|
|
53
91
|
*/
|
|
54
|
-
declare function Input<T extends InputValueType>(props:
|
|
55
|
-
export { Input };
|
|
56
|
-
export type {
|
|
92
|
+
declare function Input<T extends InputValueType = string>({ errorMessage, label, name, id, iconLeft, iconRight, direction, onBlur, ...props }: InputPropsType<T> & InputStylingPropsType): JSX.Element;
|
|
93
|
+
export { BaseInput, Input };
|
|
94
|
+
export type { InputPropsType, InputStylingPropsType, InputValueType };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { BaseInputProps } from '../shared';
|
|
3
|
-
declare type MultiRangeInputProps = Omit<BaseInputProps, 'icons' | 'spellCheck'> & {
|
|
3
|
+
declare type MultiRangeInputProps = Omit<BaseInputProps, 'icons' | 'spellCheck' | 'helpTag'> & {
|
|
4
|
+
helpTag?: [string, string];
|
|
4
5
|
/** Stap-grootte voor de input (optional, default = 1) */
|
|
5
6
|
step?: number;
|
|
6
7
|
/** De start-waarde voor de input (optional) */
|
package/dist/forms/Radio/RB.d.ts
CHANGED
|
@@ -46,6 +46,6 @@ declare type RBInputProps<T = string> = Omit<BaseInputProps, 'keyboardType' | 'i
|
|
|
46
46
|
* | errorMessage | `string ` | | een error message (van buiten setbaar) |
|
|
47
47
|
* | setValueFn() | `function` | | (newVal: T) => void. Gebruik om een React-useState-setfunction aan te roepen |
|
|
48
48
|
*/
|
|
49
|
-
declare function JustARadioButon<T = string>({ value, checked, label, groupName: name, id, size, color, styling, textAlign, disabled, errorMessage, onValueChanged, }: RBInputProps<T>): JSX.Element;
|
|
49
|
+
declare function JustARadioButon<T = string>({ value, checked, label, groupName: name, id, size, color, styling, textAlign, disabled, errorMessage, helpTag, onValueChanged, onFocus, }: RBInputProps<T>): JSX.Element;
|
|
50
50
|
export { JustARadioButon as RB };
|
|
51
51
|
export type { RBInputProps };
|
|
@@ -89,7 +89,9 @@ declare const RadioGroup: {
|
|
|
89
89
|
declare function InternRadioItem(props: RadioItemProps & {
|
|
90
90
|
name: string;
|
|
91
91
|
selectedItem: string;
|
|
92
|
+
helpTag?: string;
|
|
92
93
|
setter: (identifier: string) => void;
|
|
94
|
+
onFocus?: (e: React.FocusEvent<HTMLInputElement>, ht?: string) => void;
|
|
93
95
|
}): JSX.Element;
|
|
94
96
|
/**
|
|
95
97
|
* Een losstaand radio-item om zelf de groep te maken
|
|
@@ -15,7 +15,7 @@ declare type TextInputProps = BaseInputProps & {
|
|
|
15
15
|
* - `A-Z`: alleen uppercase letters. lowercase maken we uppercase
|
|
16
16
|
* - `a-Z`: alleen lowercase en uppercase letters
|
|
17
17
|
* - `0-Z`: lowercase, uppercase & numeriek
|
|
18
|
-
* - `RegExp`: geef een regex op met alle toegestande karakters om NIET te replacen
|
|
18
|
+
* - `RegExp`: geef een regex op met alle toegestande karakters om **NIET** te replacen
|
|
19
19
|
*/
|
|
20
20
|
characters?: CharType;
|
|
21
21
|
/**
|
package/dist/forms/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export type { ColorInputProps } from './Others/ColorInput';
|
|
|
16
16
|
export { HiddenInput } from './Others/HiddenInput';
|
|
17
17
|
export type { HiddenInputProps } from './Others/HiddenInput';
|
|
18
18
|
export { Input } from './Input';
|
|
19
|
-
export type {
|
|
19
|
+
export type { InputPropsType, InputStylingPropsType, InputValueType } from './Input';
|
|
20
20
|
export { RadioGroup, Radio } from './Radio/Radio';
|
|
21
21
|
export { RB } from './Radio/RB';
|
|
22
22
|
export type { RBInputProps } from './Radio/RB';
|
|
@@ -2,6 +2,8 @@ import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { TextAlignmentProp, DirectionProp, KeyboardTypeProp, SizeProp } from '../../loon-react-bulma-types';
|
|
4
4
|
export declare type BaseInputProps<T extends any = void> = {
|
|
5
|
+
/** De help-tag van een input (ion loon gebruikt voor help */
|
|
6
|
+
helpTag?: string;
|
|
5
7
|
/** Is dit veld disabled ? (optioneel) */
|
|
6
8
|
disabled?: boolean;
|
|
7
9
|
/** Name input: gebruikt voor een `<label>` als er geen label gedefinieerd is & de name-attribuut `<input>` */
|
|
@@ -32,6 +34,8 @@ export declare type BaseInputProps<T extends any = void> = {
|
|
|
32
34
|
keyboardType?: KeyboardTypeProp;
|
|
33
35
|
/** `onKeyDown`-event-callback, bijvoorbeeld voor het gebruik van Hotkeys als dit element focused is */
|
|
34
36
|
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
37
|
+
/** `onFocus`-event-callback, met optionele helpTag (als opgegeven) */
|
|
38
|
+
onFocus?: (e: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>, helpTag?: string) => void;
|
|
35
39
|
/** (optionele) Andere icoontjes voor op de inputs. Anders worden de default-waarden gebruikt. */
|
|
36
40
|
icons?: {
|
|
37
41
|
/** Icon aan start van een input */
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Voor gebruik met inputs waarbij je ene bewerking doet en de positie van de cursor wilt onthouden.
|
|
4
|
+
*/
|
|
2
5
|
export declare function useCaretPosition<T extends HTMLInputElement | HTMLTextAreaElement = HTMLInputElement>(): {
|
|
3
6
|
start: number;
|
|
4
7
|
end: number;
|