loon-bulma-react 2026.0.39 → 2026.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/DragDrop/DragDropList.d.ts +6 -4
- package/dist/forms/Select/Select.d.ts +1 -1
- package/dist/hooks/useClipboard.d.ts +3 -3
- package/dist/index.js +1257 -1249
- package/dist/internal_functions/createIconsInternal.d.ts +2 -1
- package/dist/lib/classes/Console.d.ts +29 -0
- package/dist/lib/classes/FetchWrapper.d.ts +124 -0
- package/dist/lib/components/AspectRatio/AspectRatio.d.ts +28 -0
- package/dist/lib/components/Block/Block.d.ts +9 -0
- package/dist/lib/components/Box/BorderBox.d.ts +29 -0
- package/dist/lib/components/Box/Box.d.ts +20 -0
- package/dist/lib/components/Button/Button.d.ts +87 -0
- package/dist/lib/components/ButtonGroup/ButtonGroup.d.ts +26 -0
- package/dist/lib/components/Calendar/CalendarItems/CalendarColoredItem.d.ts +18 -0
- package/dist/lib/components/Calendar/CalendarItems/CalendarItem.d.ts +18 -0
- package/dist/lib/components/Calendar/DayContainer.d.ts +25 -0
- package/dist/lib/components/Calendar/EventDescriptions.d.ts +33 -0
- package/dist/lib/components/Calendar/Fourweeks/FourweeksView.d.ts +23 -0
- package/dist/lib/components/Calendar/Mini/MiniView.d.ts +24 -0
- package/dist/lib/components/Calendar/Month/MonthView.d.ts +23 -0
- package/dist/lib/components/Calendar/Planning/PlanningView.d.ts +41 -0
- package/dist/lib/components/Calendar/Props.d.ts +58 -0
- package/dist/lib/components/Calendar/Week/AlldayContainer.d.ts +19 -0
- package/dist/lib/components/Calendar/Week/HourRow.d.ts +30 -0
- package/dist/lib/components/Calendar/Week/WeekView.d.ts +24 -0
- package/dist/lib/components/Calendar/calendar.functions.d.ts +10 -0
- package/dist/lib/components/Calendar/index.d.ts +15 -0
- package/dist/lib/components/CodeBlock/CodeBlock.d.ts +49 -0
- package/dist/lib/components/Columns/Column.d.ts +207 -0
- package/dist/lib/components/Columns/Columns.d.ts +35 -0
- package/dist/lib/components/Container/Container.d.ts +45 -0
- package/dist/lib/components/Content/Content.d.ts +22 -0
- package/dist/lib/components/DataTable/DataTable.d.ts +227 -0
- package/dist/lib/components/DataTable/DataTableDropdown.d.ts +39 -0
- package/dist/lib/components/Divider/Divider.d.ts +23 -0
- package/dist/lib/components/DragDrop/DragDropList.d.ts +97 -0
- package/dist/lib/components/Dropdown/Dropdown.d.ts +42 -0
- package/dist/lib/components/Footer/Footer.d.ts +22 -0
- package/dist/lib/components/Help/Help.d.ts +19 -0
- package/dist/lib/components/Hero/Hero.d.ts +104 -0
- package/dist/lib/components/Icon/Icon.d.ts +84 -0
- package/dist/lib/components/Image/Image.d.ts +28 -0
- package/dist/lib/components/Indicator/Indicator.d.ts +25 -0
- package/dist/lib/components/Kbd/Kbd.d.ts +30 -0
- package/dist/lib/components/Label/Label.d.ts +11 -0
- package/dist/lib/components/Link/Link.d.ts +44 -0
- package/dist/lib/components/Menu/Menu.d.ts +64 -0
- package/dist/lib/components/Message/Message.d.ts +49 -0
- package/dist/lib/components/Modal/Modal.d.ts +89 -0
- package/dist/lib/components/Notification/Notification.d.ts +38 -0
- package/dist/lib/components/Pagination/Pagination.d.ts +58 -0
- package/dist/lib/components/Panel/Panel.d.ts +99 -0
- package/dist/lib/components/ProgressBar/ProgressBar.d.ts +28 -0
- package/dist/lib/components/QuickView/QuickView.d.ts +61 -0
- package/dist/lib/components/ScrollArea/ScrollArea.d.ts +76 -0
- package/dist/lib/components/Section/Section.d.ts +21 -0
- package/dist/lib/components/SimpleTable/SimpleTable.d.ts +130 -0
- package/dist/lib/components/Steps/Steps.d.ts +61 -0
- package/dist/lib/components/TabBar/TabBar.d.ts +47 -0
- package/dist/lib/components/Tag/Tag.d.ts +54 -0
- package/dist/lib/components/TimeLine/TimeLine.d.ts +62 -0
- package/dist/lib/components/Titles/Titles.d.ts +71 -0
- package/dist/lib/components/ToggleBar/ToggleBar.d.ts +80 -0
- package/dist/lib/components/Tooltip/Tooltip.d.ts +50 -0
- package/dist/lib/components/TreeView/TreeView.d.ts +185 -0
- package/dist/lib/contexts/ActionSheet/ActionSheetContextProvider.d.ts +76 -0
- package/dist/lib/contexts/AppProvider/AppProviders.d.ts +17 -0
- package/dist/lib/contexts/ColorSchemeProvider/ColorSchemeProvider.d.ts +15 -0
- package/dist/lib/contexts/Confirm/ConfirmContextProvider.d.ts +60 -0
- package/dist/lib/contexts/DefaultsProvider/DefaultsProvider.d.ts +100 -0
- package/dist/lib/contexts/DialogsProvider/DialogsProvider.d.ts +4 -0
- package/dist/lib/contexts/KeysProvider/KeysProvider.d.ts +52 -0
- package/dist/lib/contexts/ModalProvider/ModalProvider.d.ts +11 -0
- package/dist/lib/contexts/ModeProvider/ModeProvider.d.ts +16 -0
- package/dist/lib/contexts/Notifier/Notifier.d.ts +81 -0
- package/dist/lib/contexts/Prompt/PromptContextProvider.d.ts +71 -0
- package/dist/lib/forms/Checkbox/Checkbox.d.ts +48 -0
- package/dist/lib/forms/ComboBox/ComboBox.d.ts +44 -0
- package/dist/lib/forms/ComboBox/MultiComboBox.d.ts +44 -0
- package/dist/lib/forms/ComboBox/useComboBoxScroll.d.ts +4 -0
- package/dist/lib/forms/Currency/CurrencyInput.d.ts +50 -0
- package/dist/lib/forms/Datetimes/DateInput.d.ts +37 -0
- package/dist/lib/forms/Datetimes/DateTimeInput.d.ts +44 -0
- package/dist/lib/forms/Datetimes/TimeInput.d.ts +42 -0
- package/dist/lib/forms/File/FileInput.d.ts +71 -0
- package/dist/lib/forms/Input.d.ts +248 -0
- package/dist/lib/forms/MaskedInput/IBANInput.d.ts +95 -0
- package/dist/lib/forms/MaskedInput/MaskedInput.d.ts +46 -0
- package/dist/lib/forms/Numeric/NumberInput.d.ts +16 -0
- package/dist/lib/forms/Numeric/RangeInput.d.ts +21 -0
- package/dist/lib/forms/Others/ColorInput.d.ts +56 -0
- package/dist/lib/forms/Others/HiddenInput.d.ts +29 -0
- package/dist/lib/forms/Others/TelephoneInput.d.ts +14 -0
- package/dist/lib/forms/Others/URLInput.d.ts +14 -0
- package/dist/lib/forms/Periodes/MonthInput.d.ts +43 -0
- package/dist/lib/forms/Periodes/WeekInput.d.ts +43 -0
- package/dist/lib/forms/Radio/Radio.d.ts +97 -0
- package/dist/lib/forms/Select/Select.d.ts +136 -0
- package/dist/lib/forms/TagsInput/TagsInput.d.ts +44 -0
- package/dist/lib/forms/Text/EmailInput.d.ts +14 -0
- package/dist/lib/forms/Text/FormattedInput.d.ts +54 -0
- package/dist/lib/forms/Text/PasswordInput.d.ts +19 -0
- package/dist/lib/forms/Text/TextArea.d.ts +31 -0
- package/dist/lib/forms/Text/TextEditor.d.ts +36 -0
- package/dist/lib/forms/Text/TextInput.d.ts +30 -0
- package/dist/lib/hooks/useCaretPosition.d.ts +8 -0
- package/dist/lib/hooks/useClickOutside.d.ts +15 -0
- package/dist/lib/hooks/useClipboard.d.ts +21 -0
- package/dist/lib/hooks/useContextMenu.d.ts +29 -0
- package/dist/lib/hooks/useCookieState.d.ts +37 -0
- package/dist/lib/hooks/useDebounced.hooks.d.ts +85 -0
- package/dist/lib/hooks/useFetchApi.d.ts +65 -0
- package/dist/lib/hooks/useHotkeys.d.ts +96 -0
- package/dist/lib/hooks/useIndexedDb.d.ts +90 -0
- package/dist/lib/hooks/useLocalStoredState.d.ts +36 -0
- package/dist/lib/hooks/useMediaQuery.d.ts +154 -0
- package/dist/lib/hooks/usePagination.d.ts +25 -0
- package/dist/lib/hooks/usePropState.d.ts +16 -0
- package/dist/lib/hooks/useScrollIntoView.d.ts +59 -0
- package/dist/lib/hooks/useSessionStoredState.d.ts +38 -0
- package/dist/lib/hooks/useThrottle.hooks.d.ts +99 -0
- package/dist/lib/hooks/useToggle.d.ts +16 -0
- package/dist/lib/hooks/useUncontrolled.d.ts +44 -0
- package/dist/lib/hooks/useValidatedState.d.ts +21 -0
- package/dist/lib/index.d.ts +174 -0
- package/dist/lib/internal_functions/createIconsInternal.d.ts +36 -0
- package/dist/lib/internal_functions/getAlignmentClass.d.ts +16 -0
- package/dist/lib/internal_functions/getColorClass.d.ts +23 -0
- package/dist/lib/internal_functions/getPositionClass.d.ts +2 -0
- package/dist/lib/internal_functions/getSizeClass.d.ts +23 -0
- package/dist/lib/internal_functions/index.d.ts +8 -0
- package/dist/lib/shims/useSyncExternalStoreShim.d.ts +1 -0
- package/dist/lib/shims/useSyncExternalStoreWithSelector.d.ts +5 -0
- package/dist/lib/test-data.d.ts +9 -0
- package/dist/lib/types/index.d.ts +104 -0
- package/dist/lib/utils/BSN.functions.d.ts +57 -0
- package/dist/lib/utils/IBAN.functions.d.ts +138 -0
- package/dist/lib/utils/JSDateTime.class.d.ts +512 -0
- package/dist/lib/utils/JSDuration.class.d.ts +184 -0
- package/dist/lib/utils/colors.d.ts +54 -0
- package/dist/lib/utils/compare.d.ts +7 -0
- package/dist/lib/utils/deserialize.function.d.ts +2 -0
- package/dist/lib/utils/flattenChildren.function.d.ts +49 -0
- package/dist/lib/utils/math.d.ts +22 -0
- package/dist/lib/utils/object.functions.d.ts +37 -0
- package/dist/lib/utils/operators.d.ts +195 -0
- package/dist/lib/utils/serialize.function.d.ts +2 -0
- package/dist/lib/utils/sorting.d.ts +34 -0
- package/dist/lib/utils/string.utils.d.ts +125 -0
- package/package.json +51 -51
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { StrictOmit, DirectionProp, ColorProp } from './../../types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { InputValueType, InputStylingPropsType, InputErrorProps, InputPropsType } from '../Input';
|
|
4
|
+
type RBValueType = InputValueType | {};
|
|
5
|
+
type RadioGroupProps<T extends RBValueType = string> = StrictOmit<InputStylingPropsType, 'icon'> & {
|
|
6
|
+
/** id voor de container van de radio-items */ id?: string;
|
|
7
|
+
/** label bij de radio-group. Als geen label, dan wordt de `name`-property gebruikt */ label?: string;
|
|
8
|
+
/** name-property voor de input. Deze hoort bij **alle** radio-buttons in de groep */ name: string;
|
|
9
|
+
/** huidige waarde voor de radio-group. Dus de geselecteerde RadioButton */ value: T;
|
|
10
|
+
/** help-tag voor deze radio-group */ helpTag?: string | undefined;
|
|
11
|
+
/** is deze input required (default= `false`) */ required?: boolean;
|
|
12
|
+
/** Wordt er een rood sterretje bij het label getoond als een Radiogroup item required is ? (default = `false`) */ showRequiredOnLabel?: boolean;
|
|
13
|
+
/** is deze input disabled (default= `false`) */ disabled?: boolean;
|
|
14
|
+
itemsDirection?: DirectionProp;
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
/** foutmelding bij de input */ errorMessage?: string | ((s: InputErrorProps<T>) => string) | undefined;
|
|
17
|
+
/** info-melding bij de input */ infoMessage?: string | ((v: T) => string) | undefined;
|
|
18
|
+
/** callback voor unfocus (blur), zet OOK de input op `touched` */
|
|
19
|
+
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void | Promise<void>;
|
|
20
|
+
/** callback voor onChange */
|
|
21
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void | Promise<void>;
|
|
22
|
+
/** value-changed callback met de nieuwe waarde van de input. Kan direct met de `setX()` van `const [x, setX] = React.useState()` worden gebruikt
|
|
23
|
+
* @example
|
|
24
|
+
* const [x, setX] = React.useState('');
|
|
25
|
+
* return <Input value={x} onValueChange={setX} {...props} />
|
|
26
|
+
*/
|
|
27
|
+
onValueChanged?: (e: T) => void | Promise<void>;
|
|
28
|
+
/** callback voor focus */
|
|
29
|
+
onFocus?: (e: React.FocusEvent<HTMLInputElement>, helpTag?: string) => void | Promise<void>;
|
|
30
|
+
/** callback voor typen */
|
|
31
|
+
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void | Promise<void>;
|
|
32
|
+
/** callback voor typen */
|
|
33
|
+
onKeyUp?: (e: React.KeyboardEvent<HTMLInputElement>) => void | Promise<void>;
|
|
34
|
+
};
|
|
35
|
+
type RadioInputProps<T extends RBValueType = string> = StrictOmit<InputPropsType<number | string>, 'id' | 'label' | 'name' | 'type' | 'value' | 'onValueChanged' | 'step' | 'pattern' | 'errorMessage' | 'infoMessage' | 'min' | 'max' | 'placeholder' | 'showRequiredOnLabel' | 'iconRight'> & StrictOmit<InputStylingPropsType, 'labelHidden' | 'direction' | 'icon'> & {
|
|
36
|
+
/** label van de Radio Button. Als niet gedefinieerd, wordt de `name`-prop gebruikt */
|
|
37
|
+
children: React.ReactNode;
|
|
38
|
+
/** de waarde van de radiobutton */
|
|
39
|
+
value: T;
|
|
40
|
+
/** callback voor value changed */
|
|
41
|
+
onValueChanged?(val: T): void | Promise<void>;
|
|
42
|
+
/** id voor de container van de radio-button-items. */
|
|
43
|
+
id?: string;
|
|
44
|
+
/** worden meerdere radiobuttons gestapeld (v) of naast elkaar weergegeven (default = `h`) */
|
|
45
|
+
itemsDirection?: DirectionProp;
|
|
46
|
+
/** `name`-prop die door alle RB-items in deze groep wordt gedeeld */
|
|
47
|
+
name: string;
|
|
48
|
+
/** is deze radio-button checked ? */
|
|
49
|
+
checked?: boolean;
|
|
50
|
+
/** kleur voor de checkbox. (default = `p`, primary) */
|
|
51
|
+
color?: ColorProp;
|
|
52
|
+
};
|
|
53
|
+
/** RB (**R**adio**B**utton) is een losstaande radio-button. Alles moet je daaraan zelf regelen. Gebruik `RadioGroup` voor een groep radio-buttons met direction etc..
|
|
54
|
+
* `RB` is een wrapper voor de HTML `<input type="radio">`-element. de `name`-prop moet voor alle items in een groep hetzelfde zijn.
|
|
55
|
+
* Ook of een button `checked` is moet je zelf regelen.
|
|
56
|
+
*
|
|
57
|
+
* @param value de waarde van de radiobutton, dus de value die met `onValueChanged` naar buiten komt
|
|
58
|
+
* @param checked is deze radio-button checked ?
|
|
59
|
+
* @param color kleur voor de checkbox. (default = `p`, primary)
|
|
60
|
+
* @param itemsDirection worden meerdere radiobuttons gestapeld (v) of naast elkaar weergegeven (default = `h`)
|
|
61
|
+
* @param name `name`-prop die door alle RB-items in deze groep **moet** wordt gedeeld
|
|
62
|
+
* @param onValueChanged value-changed callback met de nieuwe waarde van de input. Kan direct met de `setX()` van `const [x, setX] = React.useState()` worden gebruikt
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* const [x, setX] = React.useState('');
|
|
66
|
+
* <div>
|
|
67
|
+
* ..<RB name="input-rb-2" onValueChanged={setRBItem2} value="Y" checked={RBItem2 === 'Y'}>
|
|
68
|
+
* .. set to Y
|
|
69
|
+
* ..</RB>
|
|
70
|
+
* ..<RB name="input-rb-2" onValueChanged={setRBItem2} value="Z" checked={RBItem2 === 'Z'}>
|
|
71
|
+
* .. set to Z
|
|
72
|
+
* ..</RB>
|
|
73
|
+
* </div>
|
|
74
|
+
*/
|
|
75
|
+
declare function RB<T extends RBValueType = string>({ helpTag, disabled, keyboardType, title, name, value, checked, required, spellCheck, id, autoComplete, readonly, autofocus, form, inputRef: ref, onBlur, onChange, onFocus, onKeyDown, onKeyUp, onValueChanged, size: sizeProp, alignment: alignmentProp, itemsDirection: itemsDirectionProp, color, children, infoData, }: RadioInputProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
76
|
+
/** RadioGroup is een groep radio-buttons met direction, alignment, etc. Gebruik `RB` voor een losstaande radio-button, **dus niet `<RadioGroup.Item>` daarvoor**
|
|
77
|
+
* De RadioGroup kan je vullen met `RadioGroup.Item`-componenten, of met `RB`-componenten.
|
|
78
|
+
* @param value de geselecteerde waarde van de input
|
|
79
|
+
* @param name `name`-prop die door alle RB-items in deze groep wordt gedeeld
|
|
80
|
+
* @param onValueChanged callback voor value changed
|
|
81
|
+
* @param itemsDirection worden meerdere radiobuttons gestapeld (v) of naast elkaar weergegeven (default = `h`)
|
|
82
|
+
* @example
|
|
83
|
+
* const [RBItem2, setRBItem2] = React.useState('Y');
|
|
84
|
+
* <RadioGroup name="input-rb-2" onValueChanged={setRBItem2} value={RBItem2} itemsDirection="v">
|
|
85
|
+
* ..<RB value="Y">set to Y</RB>
|
|
86
|
+
* ..<RB value="Z">set to Z</RB>
|
|
87
|
+
* </RadioGroup>
|
|
88
|
+
*/
|
|
89
|
+
declare function RadioGroup<T extends RBValueType = string>({ children: childrenProp, id: _id, label, disabled, labelHidden, name, value, required, showRequiredOnLabel, size: sizeProp, direction: directionProp, itemsDirection: itemsDirectionProp, alignment: alignmentProp, errorMessage, infoMessage, infoData, helpTag, color, onValueChanged, onBlur, onChange, onFocus, onKeyDown, onKeyUp, }: RadioGroupProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
90
|
+
declare namespace RadioGroup {
|
|
91
|
+
var Item: typeof SpecialRadioItem;
|
|
92
|
+
}
|
|
93
|
+
declare function SpecialRadioItem<T extends RBValueType = string>({ checked, id, value, children, ...props }: {
|
|
94
|
+
children?: React.ReactNode;
|
|
95
|
+
} & StrictOmit<RadioInputProps<T>, 'name'>): import("react/jsx-runtime").JSX.Element;
|
|
96
|
+
export { RadioGroup, RB };
|
|
97
|
+
export type { RadioInputProps, RadioGroupProps };
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { StrictOmit } from './../../types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { InputPropsType, InputStylingPropsType } from '../Input';
|
|
4
|
+
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
5
|
+
type SelectInputProps<T extends number | string | string[]> = StrictOmit<InputPropsType<number | string | string[]>, 'type' | 'step' | 'iconRight' | 'inputRef' | 'value' | 'onValueChanged' | 'onBlur' | 'onFocus' | 'onChange' | 'onKeyDown' | 'onKeyUp' | 'min' | 'max' | 'readonly' | 'pattern' | 'placeholder'> & InputStylingPropsType & {
|
|
6
|
+
/** De waarde van de select
|
|
7
|
+
* - bij `multiple` is dit een array van strings
|
|
8
|
+
* - bij `gewoon` is dit een string (defsault)
|
|
9
|
+
* Om het type te setten:
|
|
10
|
+
* @example <Select<string[]> value={x} onValueChanged={setX} />
|
|
11
|
+
* @example <Select<string> value={x} onValueChanged={setX} /> // string
|
|
12
|
+
* @example <Select value={x} onValueChanged={setX} /> // string is default
|
|
13
|
+
*/
|
|
14
|
+
value?: T;
|
|
15
|
+
/**
|
|
16
|
+
* moeten er meerdere opties selecteerbaar zijn (default = `false`)
|
|
17
|
+
* - `false`: Gewone select, 1 optie selecteerbaar in een dropdown
|
|
18
|
+
* - `number`: Meerdere opties selecteerbaar in een lijst van 'X' hoog.
|
|
19
|
+
*/
|
|
20
|
+
multiple?: false | number;
|
|
21
|
+
/**
|
|
22
|
+
* Moeten de items gegroupeerd wewergegeven worden (voor als de `options`-prop een array van objecten is met een `group`-property)
|
|
23
|
+
*/
|
|
24
|
+
grouped?: boolean;
|
|
25
|
+
useCssArrow?: boolean;
|
|
26
|
+
iconOpen?: IconProp | undefined;
|
|
27
|
+
iconClosed?: IconProp | undefined;
|
|
28
|
+
/** De opties van de select. Kan een array van strings zijn, of een array van objecten met een `value`-property en een `label`-property.
|
|
29
|
+
* - `string`: is het label EN de value van de `<Select.Option>`
|
|
30
|
+
* - `object`: Een object met de volgende properties
|
|
31
|
+
* - `label`: Het label, (optioneel, default = `value`)
|
|
32
|
+
* - `value`: De value (REQUIRED)
|
|
33
|
+
* - `disabled`: Is deze disabled? (optioneel, default = `false`)
|
|
34
|
+
* - `group`: De groep, voor als `grouping` aan staat (optioneel, default = `''`)
|
|
35
|
+
* */
|
|
36
|
+
options?: Array<string> | Array<number> | Array<{
|
|
37
|
+
label?: string;
|
|
38
|
+
value: string | number;
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
group?: string;
|
|
41
|
+
}>;
|
|
42
|
+
/**
|
|
43
|
+
* Je kan ook gewoon een lijst van `<Select.Option>`-elementen meegeven als children.
|
|
44
|
+
*
|
|
45
|
+
* **Ondersteund zijn:**
|
|
46
|
+
* - `<Select.Option>`
|
|
47
|
+
* - `<Select.OptGroup>`
|
|
48
|
+
* - `<Select.Option>`
|
|
49
|
+
* - `<optgroup>`
|
|
50
|
+
*/
|
|
51
|
+
children?: React.ReactNode;
|
|
52
|
+
/** referentie naar het `<select>`-element */
|
|
53
|
+
inputRef?: React.Ref<HTMLSelectElement>;
|
|
54
|
+
/** value-changed callback met de nieuwe waarde van de input. Kan direct met de `setX()` van `const [x, setX] = React.useState()` worden gebruikt
|
|
55
|
+
* @example
|
|
56
|
+
* const [x, setX] = React.useState('');
|
|
57
|
+
* return <Input value={x} onValueChange={setX} {...props} />
|
|
58
|
+
*/
|
|
59
|
+
onValueChanged?: (e: T) => void | Promise<void>;
|
|
60
|
+
/** callback voor unfocus (blur), zet OOK de input op `touched` */
|
|
61
|
+
onBlur?: (e: React.FocusEvent<HTMLSelectElement>) => void | Promise<void>;
|
|
62
|
+
/** callback voor onChange */
|
|
63
|
+
onChange?: (e: React.ChangeEvent<HTMLSelectElement>) => void | Promise<void>;
|
|
64
|
+
/** callback voor focus */
|
|
65
|
+
onFocus?: (e: React.FocusEvent<HTMLSelectElement>, helpTag?: string) => void | Promise<void>;
|
|
66
|
+
/** callback voor typen */
|
|
67
|
+
onKeyDown?: (e: React.KeyboardEvent<HTMLSelectElement>) => void | Promise<void>;
|
|
68
|
+
/** callback voor typen */
|
|
69
|
+
onKeyUp?: (e: React.KeyboardEvent<HTMLSelectElement>) => void | Promise<void>;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Select input component (single of multiple). Kan via de `options`-prop, maar ook via `children` worden opgebouwd. Dat gaat met `<Select.Option>` en `<Select.OptGroup>` kan je de opties opbouwen. Dat kan ook gewoon met `<option>` en `<optgroup>`.
|
|
73
|
+
* @message **LET OP:** *`options` en `children` mengen ?* De children worden als eerste getoond. Zo kan je een van de children als `placeholder` gebruiken.
|
|
74
|
+
* @param value De waarde van de select. Bij `multiple` is dit een array van strings. Bij `gewoon` is dit een string (default)
|
|
75
|
+
* @param multiple moeten er meerdere opties selecteerbaar zijn (default = `false`).
|
|
76
|
+
* - `false`: Gewone select, 1 optie selecteerbaar in een dropdown.
|
|
77
|
+
* - `number`: Meerdere opties selecteerbaar in een lijst van 'X' hoog.
|
|
78
|
+
* @param grouped Moeten de items gegroupeerd weergegeven worden (voor als de `options`-prop een array van objecten is met een `group`-property)
|
|
79
|
+
* @param options De opties van de select. Kan een array van strings zijn, of een array van objecten met een `value`-property en een `label`-property.
|
|
80
|
+
* - `string`: is het label EN de value van de `<Select.Option>`
|
|
81
|
+
* - `object`: Een object met de volgende properties:
|
|
82
|
+
* - - `label`: Het label, (optioneel, default = `value`),
|
|
83
|
+
* - - `value`: De value (REQUIRED),
|
|
84
|
+
* - - `disabled`: Is deze disabled? (optioneel, default = `false`),
|
|
85
|
+
* - - `group`: De groep, voor als `grouping` aan staat (optioneel, default = `''`),
|
|
86
|
+
* @param children Je kan ook gewoon een lijst van `<Select.Option>`-elementen meegeven als children. Deze worden gerendered **voor** de waardes in `options`. Dus hier kan je een placeholder mee maken.
|
|
87
|
+
* @example //type is een string
|
|
88
|
+
* const [x, setX] = React.useState<string>('');
|
|
89
|
+
* <Select value={x} onValueChanged={setX} options={[...]}/>
|
|
90
|
+
* @example // multiple geeft een array
|
|
91
|
+
* const [x, setX] = React.useState<string[]>([]);
|
|
92
|
+
* <Select<string[]> value={x} onValueChanged={setX} multiple={3} options={[...]}/>
|
|
93
|
+
* @example // single geeft een string, ook default is het een string
|
|
94
|
+
* const [x, setX] = React.useState<string>('');
|
|
95
|
+
* <Select<string> value={x} onValueChanged={setX} options={[...]}/>
|
|
96
|
+
*@example // met options en children
|
|
97
|
+
* const [x, setX] = React.useState<string>('');
|
|
98
|
+
* <Select value={x} onValueChanged={setX} options={['1', '2']}>
|
|
99
|
+
* .. <Select.Option value="3">3</Select.Option>
|
|
100
|
+
* .. <Select.Option value="4">4</Select.Option>
|
|
101
|
+
* </Select>
|
|
102
|
+
* @example // met children
|
|
103
|
+
* const [x, setX] = React.useState<string>('');
|
|
104
|
+
* <Select value={x} onValueChanged={setX}>
|
|
105
|
+
* .. <Select.Option value="1">1</Select.Option>
|
|
106
|
+
* .. <Select.Option value="2">2</Select.Option>
|
|
107
|
+
* </Select>
|
|
108
|
+
* @example // met children en optgroups
|
|
109
|
+
* const [x, setX] = React.useState<string>('');
|
|
110
|
+
* <Select value={x} onValueChanged={setX}>
|
|
111
|
+
* ..<Select.OptGroup label="groep 1">
|
|
112
|
+
* .. ..<Select.Option value="1">1</Select.Option>
|
|
113
|
+
* .. ..<Select.Option value="2">2</Select.Option>
|
|
114
|
+
* ..</Select.OptGroup>
|
|
115
|
+
* </Select>
|
|
116
|
+
*/
|
|
117
|
+
declare function Select<T extends number | string | string[] = string>({ value, id, name, label, grouped, required, showRequiredOnLabel, errorMessage, infoMessage, multiple, alignment: alignmentProp, size: sizeProp, direction: directionProp, options, children: nodes, helpTag, disabled, keyboardType, title, spellCheck, loading, autoComplete, autofocus, form, inputRef: ref, labelHidden, icon, iconOpen, iconClosed, infoData, useCssArrow, color, onBlur, onFocus, onChange, onKeyDown, onKeyUp, onValueChanged, }: SelectInputProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
118
|
+
declare namespace Select {
|
|
119
|
+
var Option: ({ value, disabled, id, children }: {
|
|
120
|
+
id?: string;
|
|
121
|
+
value?: number | string;
|
|
122
|
+
disabled?: boolean;
|
|
123
|
+
children: React.ReactNode;
|
|
124
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
125
|
+
var OptGroup: ({ label, children, disabled }: {
|
|
126
|
+
label: string;
|
|
127
|
+
disabled?: boolean;
|
|
128
|
+
children: React.ReactNode;
|
|
129
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
130
|
+
var Divider: ({ dividerChar, repeat }: {
|
|
131
|
+
dividerChar?: string;
|
|
132
|
+
repeat?: number;
|
|
133
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
134
|
+
}
|
|
135
|
+
export { Select };
|
|
136
|
+
export type { SelectInputProps };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { StrictOmit, ColorProp } from './../../types';
|
|
2
|
+
import { InputPropsType, InputStylingPropsType, InputErrorProps } from '../Input';
|
|
3
|
+
type TagsInputProps = StrictOmit<InputPropsType<string[]>, 'type' | 'step' | 'onChange' | 'value' | 'onValueChanged' | 'max' | 'min' | 'inputRef' | 'errorMessage'> & StrictOmit<InputStylingPropsType, 'color'> & {
|
|
4
|
+
/** de values (dus de tags) van het input field */
|
|
5
|
+
value?: string[] | undefined;
|
|
6
|
+
/** mogen tags meerdere keren voorkomen (2 tags met dezelfde tekst). default = `false` */
|
|
7
|
+
allowDuplicates?: boolean;
|
|
8
|
+
/** mogen tags niet verwijderd worden? (default = false) */
|
|
9
|
+
disableRemove?: boolean;
|
|
10
|
+
/** welke kleur moeten de tags worden (default = `'p'`). Dit zijn de gewone Color Props, maar kan ook op `random` gezet worden.
|
|
11
|
+
* Dan wordt een willekeurge kleur van de tag colors gekozen
|
|
12
|
+
* */
|
|
13
|
+
color?: ColorProp | 'random';
|
|
14
|
+
/** lijst van kleuren om te gebruiken bij random colors */
|
|
15
|
+
randomColors?: Array<ColorProp | `#${string}`>;
|
|
16
|
+
/** value changed callback */
|
|
17
|
+
onValueChanged?: (v: string[]) => void | Promise<void>;
|
|
18
|
+
/** max length van de tag-tekst */
|
|
19
|
+
maxLength?: number;
|
|
20
|
+
/** min length van de tag-tekst */
|
|
21
|
+
minLength?: number;
|
|
22
|
+
/** maximaal aantal tags */
|
|
23
|
+
maxTags?: number;
|
|
24
|
+
/** foutmelding bij de input */
|
|
25
|
+
errorMessage?: string | ((s: InputErrorProps<string[]>) => string);
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Tags Input component, je kan meerdere tags intypen, die dan onder de input verschijnen als tags. Je kan ze verwijderen door op het kruisje te klikken.
|
|
29
|
+
* De `onValueChanged`-callback geeft een array van strings van de tags.
|
|
30
|
+
* @example // zonder beginwaarden
|
|
31
|
+
* <Section>
|
|
32
|
+
* <TagsInput name="Tag Input" value={value} onValueChanged={setValue} direction={direction} size={size} />
|
|
33
|
+
* <HelpTxt>De tags zijn: {value.join(', ')}</HelpTxt>
|
|
34
|
+
* </Section>
|
|
35
|
+
* @example // met beginwaarden en random colors
|
|
36
|
+
* <Section>
|
|
37
|
+
* <TagsInput name="Tag Input met value" value={value2} onValueChanged={setValue2} color="random" direction={direction} size={size} />
|
|
38
|
+
* <HelpTxt>De tags zijn: {value2.join(', ')}</HelpTxt>
|
|
39
|
+
* </Section>
|
|
40
|
+
* @returns
|
|
41
|
+
*/
|
|
42
|
+
declare function TagsInput({ value, allowDuplicates, disableRemove, disabled, id, name, label, color: colorProp, direction: directionProp, errorMessage, infoMessage, showRequiredOnLabel, icon, labelHidden, required, loading, size: sizeProp, alignment: alignmentProp, autoComplete, optionListId, autofocus, form, helpTag, keyboardType, maxLength, minLength, pattern, placeholder, readonly, spellCheck, iconRight, title, className: extraClasses, styles, randomColors, maxTags, infoData, onBlur, onFocus, onValueChanged, onKeyDown, onKeyUp, }: TagsInputProps): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
export { TagsInput };
|
|
44
|
+
export type { TagsInputProps };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StrictOmit } from './../../types';
|
|
2
|
+
import { InputPropsType, InputStylingPropsType } from '../Input';
|
|
3
|
+
type EmailInputProps = StrictOmit<InputPropsType<string>, 'type' | 'step'> & InputStylingPropsType & {
|
|
4
|
+
pattern?: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Een input voor een e-mailadres. Deze input heeft een default `pattern` voor validatie op form-verzending. Deze kan worden overschreven. Ook wordt de autocomplete op `email` gezet.
|
|
8
|
+
* @example <EmailInput name="email" value={email} onValueChanged={setEmail} pattern="/^@ \t\r\n]+@[^@ \t\r\n]+.[^@ \t\r\n]+/" />
|
|
9
|
+
* @param pattern het pattern voor validatie, (default = `/^@ \t\r\n]+@[^@ \t\r\n]+.[^@ \t\r\n]+/`)
|
|
10
|
+
* @param autoComplete de autocomplete type (password managers) (default = `email`)
|
|
11
|
+
*/
|
|
12
|
+
declare function EmailInput({ value, icon, pattern, autoComplete, onValueChanged, ...props }: EmailInputProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export { EmailInput };
|
|
14
|
+
export type { EmailInputProps };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { InputPropsType, InputStylingPropsType } from '../Input';
|
|
2
|
+
import { StrictOmit } from './../../types';
|
|
3
|
+
type FormattedInputProps = StrictOmit<InputPropsType<string>, 'type' | 'step' | 'inputRef'> & InputStylingPropsType & {
|
|
4
|
+
/**
|
|
5
|
+
* De groepen bij de input, kan een string zijn, een nummer of een array van nummers
|
|
6
|
+
* - `string`: de groepen worden bepaald door de string, de groepen worden gescheiden door de divider
|
|
7
|
+
* - `nummer`: de groepen worden bepaald door het aantal karakters per groep, de groepen worden gescheiden door de divider
|
|
8
|
+
* - `number[]`: de groepen worden bepaald door de nummers in de array, de groepen worden gescheiden door de divider. De nummers in de array worden herhaald totdat de `value` eindigd.
|
|
9
|
+
*/
|
|
10
|
+
groupBy?: string | number | number[] | undefined;
|
|
11
|
+
/** Het teken dat tussen de groepen moet komen */
|
|
12
|
+
divider?: string | undefined;
|
|
13
|
+
/** Bepaal de casing van de formatter: default is `ignore`
|
|
14
|
+
* - `uppercase`: wordt de waarde omgezet naar hoofdletters.
|
|
15
|
+
* - `lowercase`: wordt de waarde omgezet naar kleine letters.
|
|
16
|
+
* - `capitalize`: wordt de eerste letter van elk woord een hoofdletter.
|
|
17
|
+
* - `default` of `ignore`: wordt de waarde niet aangepast. Dit is de default
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
casing?: 'uppercase' | 'upper' | 'lowercase' | 'lower' | 'default' | 'ignore' | 'capitalize';
|
|
21
|
+
/** Functie die de geformatteerde waarde nog verder kan aanpassen als het grouperen van de karakters gebeurd is. */
|
|
22
|
+
onFormat?: (v: string) => string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Een input die de waarde formatteert op basis van de groepen die je meegeeft. De groepen kan je opgeven met een voorbeeldstring, een nummer (aantal chars per groep) of een array van nummers (aantal chars per groep)
|
|
26
|
+
* @param groupBy - De groepen waarin de waarde moet worden verdeeld. Groepen kan je opgeven met een voorbeeldstring, een nummer (aantal chars per groep) of een array van nummers (aantal chars per groep)
|
|
27
|
+
* @param divider - Het teken dat tussen de groepen moet komen
|
|
28
|
+
* @param casing - regel wat de casing van de waarde moet zijn.
|
|
29
|
+
* - `uppercase`: wordt de waarde omgezet naar hoofdletters.
|
|
30
|
+
* - `lowercase`: wordt de waarde omgezet naar kleine letters.
|
|
31
|
+
* - `capitalize`: wordt de eerste letter van elk woord een hoofdletter.
|
|
32
|
+
* - `ignore`: wordt de waarde niet aangepast. Dit is de default
|
|
33
|
+
* @param onFormat - Functie die de geformatteerde waarde nog verder kan aanpassen als het grouperen van de karakters gebeurd is.
|
|
34
|
+
* @example export function VB() {
|
|
35
|
+
* let [v, setV] = React.useState('nl29INGB1234567890');
|
|
36
|
+
*
|
|
37
|
+
* const onFormat = (v) => v.toLowerCase().replaceAll(' ', '_');
|
|
38
|
+
* return (
|
|
39
|
+
* <>
|
|
40
|
+
* // NL29 INGB 1234 5678 90
|
|
41
|
+
* <FormattedInput name="numeric" value={v} groupBy={4} divider=" " onValueChanged={setV} />
|
|
42
|
+
* // nl 29 ingb 1234 5678 90
|
|
43
|
+
* <FormattedInput name="num-array" value={v} groupBy={[2, 2, 4]} divider=" " onValueChanged={setV} casing='lower' />
|
|
44
|
+
* // NL29 INGB 1234 5678 90
|
|
45
|
+
* <FormattedInput name="with-string" value={v} groupBy="NL00 ASNB 4444 3333" divider=" " onValueChanged={setV} casing='uppercase' />
|
|
46
|
+
* // Nl29 ingb 1234 5678 90
|
|
47
|
+
* <FormattedInput name="with-string" value={v} groupBy={5} divider=" " onValueChanged={setV} casing='capitalize' />
|
|
48
|
+
* </>
|
|
49
|
+
* );
|
|
50
|
+
*}
|
|
51
|
+
*/
|
|
52
|
+
declare function FormattedInput({ placeholder, helpTag, errorMessage, infoMessage, disabled, title, required, showRequiredOnLabel, spellCheck, autoComplete, max, min, readonly, autofocus, infoData, form, onBlur, onChange, onFocus, onKeyDown, onKeyUp, size: sizeProp, alignment: alignmentProp, direction: directionProp, iconRight, labelHidden, loading, value, icon, groupBy, divider, name, label, id, color, casing, onValueChanged, onFormat, }: FormattedInputProps): import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
export { FormattedInput };
|
|
54
|
+
export type { FormattedInputProps };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
2
|
+
import { StrictOmit } from './../../types';
|
|
3
|
+
import { InputPropsType, InputStylingPropsType } from '../Input';
|
|
4
|
+
type PasswordInputProps = StrictOmit<InputPropsType<string>, 'type' | 'step'> & InputStylingPropsType & {
|
|
5
|
+
revealPasswordAllowed?: boolean;
|
|
6
|
+
revealPasswordMsg?: string;
|
|
7
|
+
iconRevealed?: IconProp | string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Input voor een wachtwoord. Het type is al op wachtwoord gezet, en autocomplete op 'current-password'. Dat is voor password managers.
|
|
11
|
+
* @example <PasswordInput name="wachtwoord" value={pw} onValueChanged={setPw} />
|
|
12
|
+
* @param autocomplete speciaal voor password managers. Wat is de functie van deze input. Default is `current-password`
|
|
13
|
+
* @param revealPasswordAllowed mag de toon-ww checkbox getoond worden? Default is `false`
|
|
14
|
+
* @param revealPasswordMsg boodschap bij de checkbox. Default is `Toon wachtwoord`
|
|
15
|
+
* @param iconRevealed icon voor ww revealed. Default is `faEye`
|
|
16
|
+
*/
|
|
17
|
+
declare function PasswordInput({ value, autoComplete, icon, name, id, label, required, loading, showRequiredOnLabel, labelHidden, size: sizeProp, direction: directionProp, revealPasswordAllowed, disabled, readonly, iconRight, revealPasswordMsg, iconRevealed, errorMessage, infoMessage, infoData, helpTag, onValueChanged, onBlur, onFocus, ...props }: PasswordInputProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export { PasswordInput };
|
|
19
|
+
export type { PasswordInputProps };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { StrictOmit } from './../../types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { InputPropsType, InputStylingPropsType } from '../Input';
|
|
4
|
+
type TextAreaProps = StrictOmit<InputPropsType<string>, 'type' | 'inputRef' | 'keyboardType' | 'step' | 'pattern' | 'onBlur' | 'onChange' | 'onFocus' | 'onKeyDown' | 'onKeyUp' | 'iconRight'> & StrictOmit<InputStylingPropsType, 'icon'> & {
|
|
5
|
+
/** (optionele) `ref` voor gebruik met `React.useRef<HTMLTextAreaElement>` */
|
|
6
|
+
inputRef?: React.RefObject<HTMLTextAreaElement>;
|
|
7
|
+
/** aantal rijen voor de textarea */ rows?: number;
|
|
8
|
+
/** aantal kolommen voor de textarea.
|
|
9
|
+
* **werkt niet in Bulma! de breedte is altijd maximaal!**
|
|
10
|
+
*/ cols?: number;
|
|
11
|
+
/** callback voor onChange. Voor de echte waarde, gebruik je `onValueChanged` */
|
|
12
|
+
onChange?: (val: React.ChangeEvent<HTMLTextAreaElement>) => void | Promise<void>;
|
|
13
|
+
/** callback voor unfocus (blur), zet OOK de input op `touched` */
|
|
14
|
+
onBlur?: (val: React.FocusEvent<HTMLTextAreaElement>) => void | Promise<void>;
|
|
15
|
+
/** callback voor focus, MET daarbij de helptag */
|
|
16
|
+
onFocus?: (val: React.FocusEvent<HTMLTextAreaElement>, ht?: string) => void | Promise<void>;
|
|
17
|
+
/** callback voor typen */
|
|
18
|
+
onKeyDown?: (val: React.KeyboardEvent<HTMLTextAreaElement>) => void | Promise<void>;
|
|
19
|
+
/** callback voor typen */
|
|
20
|
+
onKeyUp?: (val: React.KeyboardEvent<HTMLTextAreaElement>) => void | Promise<void>;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Een textarea input met Bulma styling. De textarea kan een label hebben en een help tag.
|
|
24
|
+
* De callbacks maken allemaal gebruik van het HTMLTextAreaElement type.
|
|
25
|
+
* @example <TextArea label="Type wat" value={txt} onValueChanged={setTxt} />
|
|
26
|
+
* @param rows aantal rijen voor de textarea (default: 4)
|
|
27
|
+
* @param cols aantal kolommen voor de textarea. **werkt niet in Bulma! de breedte is altijd maximaal!**
|
|
28
|
+
*/
|
|
29
|
+
declare function TextArea({ value, label, errorMessage, infoMessage, helpTag, id, name, spellCheck, required, showRequiredOnLabel, autoComplete, placeholder, disabled, form, readonly, autofocus, inputRef, max, min, title, size: sizeProp, alignment: alignmentProp, direction: directionProp, cols, rows, labelHidden, loading, infoData, color, onValueChanged, onChange, onBlur, onFocus, onKeyDown, onKeyUp, }: TextAreaProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export { TextArea };
|
|
31
|
+
export type { TextAreaProps };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { JSONContent } from '@tiptap/react';
|
|
2
|
+
import { SizeProp } from './../../types';
|
|
3
|
+
type TextEditorPropsType = {
|
|
4
|
+
content?: string;
|
|
5
|
+
/** De tag-selector (headers of paragraaf) verbergen? */ hideTagSelector?: boolean;
|
|
6
|
+
/** De highlight-kleur-selectie voor tekst verbergen? */ hideHighlightColor?: boolean;
|
|
7
|
+
/** De tekst-kleur-selectie verbergen? */ hideFontColor?: boolean;
|
|
8
|
+
/** De alignment-opties verbergen? */ hideAlignment?: boolean;
|
|
9
|
+
/** De list-opties verbergen? */ hideLists?: boolean;
|
|
10
|
+
/** NewLine en Lijn verbergen? */ hideLines?: boolean;
|
|
11
|
+
/** De undo- en redo-opties verbergen? */ hideUndoRedo?: boolean;
|
|
12
|
+
/** De tabel-opties verbergen? */ hideTables?: boolean;
|
|
13
|
+
/** ID voor de editor, gebruiken als je meerdere editors op 1 pagina hebt. */ id?: string;
|
|
14
|
+
/** Help-tag voor de editor */ helpTag?: string;
|
|
15
|
+
/** */ /** */ /** De Bold-, Italic-, Underline-, Strikethrough-, Subscript- en Supersscript-opties verbergen? */ hideFontStyling?: boolean;
|
|
16
|
+
/** Converteer ingetypte links automatisch naar anchor-tags? `<a href="..." target="_blank">` */ autoUrlConversion?: boolean;
|
|
17
|
+
/** grootte van de knoppen, default = ''s */ size?: SizeProp;
|
|
18
|
+
/** html-content callback */ onChangeHtml?: (content: string) => void;
|
|
19
|
+
/** platte text-content callback */ onChangeText?: (content: string) => void;
|
|
20
|
+
/** json-object-callback */ onChangeJson?: (content: JSONContent) => void;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Een Rich Text Editor, dus een uitgebreide vorm van een `<textarea>`, want je kan dingen **bold**, *italic*, enz. maken.
|
|
24
|
+
* De output is in HTML-vorm of in JSON-vorm. Je kan er ook gewoon platte tekst uitkrijgen, maar dan vervalt de opmaak.
|
|
25
|
+
* @url https://tiptap.dev/ voor de documentatie van hoe deze component in elkaar steekt.
|
|
26
|
+
* @returns een component voor het maken van rich text met HTML of JSON output
|
|
27
|
+
* @description
|
|
28
|
+
* | prop | type | uitleg |
|
|
29
|
+
* |--------------|----------------------------|-------------------------|
|
|
30
|
+
* | content | `string` | de inhoud van de editor |
|
|
31
|
+
* | onChangeHtml | `(c: string) => void` | een callback die wordt aangeroepen als de inhoud van de editor verandert. De inhoud wordt dan als HTML meegegeven. |
|
|
32
|
+
* | onChangeText | `(c: string) => void` | een callback die wordt aangeroepen als de inhoud van de editor verandert. De inhoud wordt dan als platte tekst meegegeven. |
|
|
33
|
+
* | onChangeJson | `(c: JSONContent) => void` | een callback die wordt aangeroepen als de inhoud van de editor verandert. De inhoud wordt dan als JSON meegegeven. |
|
|
34
|
+
*/
|
|
35
|
+
export declare function TextEditor({ content, hideTagSelector, hideAlignment, hideLists, hideLines, hideFontColor, hideHighlightColor, hideUndoRedo, hideFontStyling, hideTables, autoUrlConversion, size, id: editorID, onChangeHtml, onChangeText, onChangeJson, }: TextEditorPropsType): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { StrictOmit } from './../../types';
|
|
2
|
+
import { InputPropsType, InputStylingPropsType } from '../Input';
|
|
3
|
+
type CharType = '0-9' | 'a-z' | 'A-Z' | 'a-Z' | '0-Z' | (string & {}) | RegExp;
|
|
4
|
+
type TextInputProps = StrictOmit<InputPropsType<string>, 'type' | 'step'> & InputStylingPropsType & {
|
|
5
|
+
pattern?: string;
|
|
6
|
+
/** Toegestane karakters in de input
|
|
7
|
+
* - `undefined`: alle karakters toegestaan
|
|
8
|
+
* - `string`: string met alle toegestane karakters
|
|
9
|
+
* - `0-9`: alleen numeriek
|
|
10
|
+
* - `a-z`: alleen lowercase letters. Uppercase maken we lowercase
|
|
11
|
+
* - `A-Z`: alleen uppercase letters. lowercase maken we uppercase
|
|
12
|
+
* - `a-Z`: alleen lowercase en uppercase letters
|
|
13
|
+
* - `0-Z`: lowercase, uppercase & numeriek
|
|
14
|
+
* - `RegExp`: geef een regex op met alle toegestande karakters om **NIET** te replacen
|
|
15
|
+
*/
|
|
16
|
+
characters?: CharType;
|
|
17
|
+
};
|
|
18
|
+
/** Een text input component, met optionele toegetsande karakters en een patroon voor de input.
|
|
19
|
+
* @param characters Toegestane karakters in de input
|
|
20
|
+
* @example // met `characters` kan je vertellen welke karakters zijn toegestaan.
|
|
21
|
+
* <TextInput characters="0-9" /> // alleen numeriek
|
|
22
|
+
* <TextInput characters="a-z" /> // alleen lowercase letters
|
|
23
|
+
* <TextInput characters="A-Z" /> // alleen uppercase letters
|
|
24
|
+
* <TextInput characters="a-Z" /> // lowercase en uppercase letters
|
|
25
|
+
* <TextInput characters="0-Z" /> // lowercase, uppercase & numeriek
|
|
26
|
+
* <TextInput characters={rgx} /> // replace alle karakters die niet in de regex zitten
|
|
27
|
+
*/
|
|
28
|
+
declare function TextInput({ value, characters, icon, onValueChanged, ...props }: TextInputProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export { TextInput };
|
|
30
|
+
export type { TextInputProps };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/** Voor gebruik met inputs waarbij je ene bewerking doet en de positie van de cursor wilt onthouden. */
|
|
3
|
+
export declare function useCaretPosition<T extends HTMLInputElement | HTMLTextAreaElement = HTMLInputElement>(): {
|
|
4
|
+
start: number;
|
|
5
|
+
end: number;
|
|
6
|
+
ref: React.RefObject<T | null>;
|
|
7
|
+
updateCaret: (diff?: number) => void;
|
|
8
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Gebruikt om clicks en touches buiten een element te detecteren. Bijvoorbeeld bij de `QuickView` en de `Modal componenten`. Daar KAN hij gebruikt worden via de `itemRef`-prop.
|
|
4
|
+
* @param handler de callback voor de outside-click
|
|
5
|
+
* @param events optionele list van events die een outside-click definieren
|
|
6
|
+
* @param nodes optionele list van nodes die genegeerd moeten worden
|
|
7
|
+
* @returns de ref naar het element
|
|
8
|
+
* @example
|
|
9
|
+
* const ref = useClickOutside(() => console.log('clicked outside'));
|
|
10
|
+
* return <div ref={ref}>...</div>
|
|
11
|
+
* @example
|
|
12
|
+
* const ref = useClickOutside(() => console.log('clicked outside'), ['mousedown']);
|
|
13
|
+
* return <QuickView itemRef={ref}>...</QuickView>
|
|
14
|
+
*/
|
|
15
|
+
export declare function useClickOutside<T extends HTMLElement = any>(handler: () => void, events?: string[] | null, nodes?: (HTMLElement | null)[]): React.RefObject<T | null>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
type CopyType = {
|
|
2
|
+
/**
|
|
3
|
+
* Kopieer een waarde naar het clipboard, om die daarna ergens te kunnen plakken.
|
|
4
|
+
* @param valueToCopy De waarde omte copy-pasten
|
|
5
|
+
*/
|
|
6
|
+
copy: (valueToCopy: any) => void;
|
|
7
|
+
/** Clear de time-out en reset "copied" naar "false" */
|
|
8
|
+
reset: () => void;
|
|
9
|
+
/** Als er bij het kopiëren iets mis gaat, is de error != null */
|
|
10
|
+
error: Error | null;
|
|
11
|
+
/** Is de waarde gekopieerd? Is "true" als een item gekopieerd is, totdat reset() wordt aangeroepen of de timeout over is */
|
|
12
|
+
copied: boolean;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Hook om een waarde naar de navigator.clipboard te kopiëren en die daarna ergens te plakken.
|
|
16
|
+
* @param timeout timeout in ms voordat de copy-reset gebeurt (default = 2000)
|
|
17
|
+
* @returns een object met de functies copy() en reset(), een boolean copied en een error
|
|
18
|
+
* @example const { copy, reset, copied, error } = useClipboard();
|
|
19
|
+
*/
|
|
20
|
+
declare function useClipboard(timeout?: number): CopyType;
|
|
21
|
+
export { useClipboard };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Overschrijf de default right-click actie van een element met de meegegeven ref. Dit kan je gebruiken om je EIGEN context-menu systematiek te maken. Gebruik `<ContextMenu />`-component voor de standaard contextmenu implementatie.
|
|
4
|
+
* @example
|
|
5
|
+
* ```tsx
|
|
6
|
+
* // some component
|
|
7
|
+
* const outerRef = React.useRef<HTMLDivElement>(null);
|
|
8
|
+
* const { x, y, show } = useContextMenu(outerRef);
|
|
9
|
+
*
|
|
10
|
+
* return
|
|
11
|
+
* <div ref={outerRef}> bla di bla
|
|
12
|
+
* {show && <div style={{ top: y, left: x }}>context menu</div>}
|
|
13
|
+
* </div>
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
declare function useContextMenu<T extends HTMLElement = HTMLElement>(outerRef: React.RefObject<T>): {
|
|
17
|
+
x: `${number}px`;
|
|
18
|
+
y: `${number}px`;
|
|
19
|
+
show: boolean;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Standaard contextmenu component. Gebruik deze om een standaard contextmenu te tonen.
|
|
23
|
+
* @returns
|
|
24
|
+
*/
|
|
25
|
+
declare function ContextMenu({ outerRef, children }: {
|
|
26
|
+
outerRef: React.RefObject<HTMLElement | null> | null;
|
|
27
|
+
children: React.ReactNode | (() => React.ReactNode);
|
|
28
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export { useContextMenu, useContextMenu as useRightClick, ContextMenu, ContextMenu as RightClickMenu };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
type UseCookieStoredStateFn<T = string> = {
|
|
2
|
+
/** Key to store the value with in Local Storage */
|
|
3
|
+
key: string;
|
|
4
|
+
/** Initial value (if its non-existent in Local Storage) */
|
|
5
|
+
initialValue: T;
|
|
6
|
+
/** Your own serializing-function. Implement when you cannot use `JSON.stringify` */
|
|
7
|
+
serialize?: (value: T, replacer?: (key: string, value: any) => any, space?: string | number) => string;
|
|
8
|
+
/** Your own deserializing-funtion. Implement when you cannot use `JSON.parse` */
|
|
9
|
+
deserialize?: (value: string, reviver?: (key: string, value: any) => any) => T;
|
|
10
|
+
/** expiration date voor cookie */
|
|
11
|
+
expires?: Date | string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Hook die werkt als `React.useState<T|undefined>()`, maar waarbij de waarde ook wordt opgeslagen in een Cookie.
|
|
15
|
+
* 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.
|
|
16
|
+
* @param {UseCookieStoredStateFn} params voor de hook
|
|
17
|
+
* @returns {[T, (value: T) => void]} tuple met een value en een setValue-function (net als React.useState)
|
|
18
|
+
* @description
|
|
19
|
+
* | Property | Type | Description |
|
|
20
|
+
* |--------------|------------|---------------------------------------------------------------|
|
|
21
|
+
* | key | `string` | De key waaronder de waarde in een cookie wordt opgeslagen. |
|
|
22
|
+
* | initialValue | `T` | De initiale waarde. |
|
|
23
|
+
* | serialize | `function` | (optional) functie om de waarde om te zetten naar een string. Implementeer als de waarde __GEEN__ gebruik kan maken van `JSON.stringify()`! |
|
|
24
|
+
* | deserialize | `function` | (optional) De functie die een string omzet naar de waarde. Implementeer als de waarde __GEEN__ gebruik kan maken van `JSON.parse()`! |
|
|
25
|
+
* @example
|
|
26
|
+
* import { useCookieStoredState } from 'loon-bulma-react';
|
|
27
|
+
* const [ value, setValue, remove ] = useCookieStoredState({ key: 'myKey', initialValue: 'Oompa Loompa' });
|
|
28
|
+
* // 1. value is 'Oompa Loompa', put it somewhere on the screen
|
|
29
|
+
* // 2. change the value to something else
|
|
30
|
+
* // 3. refresh the page.
|
|
31
|
+
* // 4. see te new value on the page.
|
|
32
|
+
* // 5. you can also check the value in Cookies in devtools.
|
|
33
|
+
* // 6. close the browser / tab
|
|
34
|
+
* // 7. check the value in cookie storage. it should still be there.
|
|
35
|
+
*/
|
|
36
|
+
declare function useCookieStoredState<T extends unknown>({ key, initialValue, expires, deserialize, serialize, }: UseCookieStoredStateFn<T>): readonly [T, (value: T) => void, () => void];
|
|
37
|
+
export { useCookieStoredState };
|