loon-bulma-react 2023.0.23 → 2023.0.25

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.
Files changed (52) hide show
  1. package/README.md +31 -16
  2. package/dist/components/AspectRatio/AspectRatio.d.ts +1 -1
  3. package/dist/components/ButtonGroup/ButtonGroup.d.ts +1 -1
  4. package/dist/components/Container/Container.d.ts +4 -4
  5. package/dist/components/DataTable/DataTable.d.ts +1 -3
  6. package/dist/components/Icon/Icon.d.ts +2 -2
  7. package/dist/components/Image/Image.d.ts +1 -1
  8. package/dist/components/Link/Link.d.ts +1 -1
  9. package/dist/components/Notification/Notification.d.ts +14 -14
  10. package/dist/forms/Checkbox/CB.d.ts +1 -1
  11. package/dist/forms/Checkbox/Checkbox.d.ts +1 -1
  12. package/dist/forms/Currency/CurrencyInput.d.ts +3 -2
  13. package/dist/forms/Datetimes/DateInput.d.ts +1 -0
  14. package/dist/forms/Datetimes/DateTimeInput.d.ts +1 -0
  15. package/dist/forms/Datetimes/TimeInput.d.ts +1 -0
  16. package/dist/forms/File/FileInput.d.ts +1 -0
  17. package/dist/forms/Input.d.ts +2 -1
  18. package/dist/forms/Numeric/MultiRangeInput.d.ts +1 -1
  19. package/dist/forms/Numeric/NumberInput.d.ts +1 -0
  20. package/dist/forms/Numeric/RangeInput.d.ts +1 -1
  21. package/dist/forms/Others/ColorInput.d.ts +1 -0
  22. package/dist/forms/Radio/RB.d.ts +1 -1
  23. package/dist/forms/Radio/Radio.d.ts +1 -1
  24. package/dist/forms/RichTextArea/RichTextArea.d.ts +5 -0
  25. package/dist/forms/Selects/MultiSelect.d.ts +1 -1
  26. package/dist/forms/Selects/Select.d.ts +1 -1
  27. package/dist/forms/Text/EmailInput.d.ts +1 -0
  28. package/dist/forms/Text/PasswordInput.d.ts +1 -0
  29. package/dist/forms/Text/TextArea.d.ts +1 -0
  30. package/dist/forms/Text/TextEditor.d.ts +21 -0
  31. package/dist/forms/Text/TextInput.d.ts +1 -0
  32. package/dist/forms/index.d.ts +1 -0
  33. package/dist/forms/shared/Base.Input.Container.d.ts +1 -0
  34. package/dist/forms/shared/BaseInputProps.d.ts +8 -6
  35. package/dist/hooks/index.d.ts +1 -0
  36. package/dist/hooks/useCaretPosition.d.ts +7 -0
  37. package/dist/hooks/useLocalStoredState.d.ts +5 -6
  38. package/dist/hooks/useSessionStoredState.d.ts +38 -0
  39. package/dist/index.js +8276 -245
  40. package/dist/index.js.map +1 -1
  41. package/dist/index.modern.js +8278 -245
  42. package/dist/index.modern.js.map +1 -1
  43. package/dist/loon-react-bulma-types.d.ts +2 -1
  44. package/dist/utils/JSDateTime.class.d.ts +10 -4
  45. package/dist/utils/JSDuration.class.d.ts +3 -5
  46. package/dist/utils/deserialize.function.d.ts +2 -0
  47. package/dist/utils/index.d.ts +1 -0
  48. package/dist/utils/isIBAN.function.d.ts +25 -0
  49. package/dist/utils/serialize.function.d.ts +2 -0
  50. package/package.json +44 -19
  51. package/styles/_all.scss +1 -0
  52. package/styles/tiptap-editor.scss +11 -0
package/README.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  > ## Aanpassingen
4
4
  >
5
+ > - `spellCheck`-property op de meeste `<input`-componenten. Default = `false`
6
+ > - `<TextInput />` onthoudt nu de caret-positie, als je typt.
7
+ > - `useCaretPosition`-hook gemaakt voor hierbovengenoemde gebruik.
8
+ > - `<TekstEditor>` -component gemaakt. Eigenlijk ene tekst-editor met wat opmaak-opties die HTML of JSON kan genereren om de opmaak te bewaren (of gewoon platte tekst kan gebruiken). Intern gebruikt met [tiptap](https://tiptap.dev/). Component was nodig voor de Help-In-Loon-prakker.
9
+ > - `useSessionStoredState()`-hook gemaakt. Gebruik session-storage in plaats van local-storage om gegevens te verwijderen bij het sluiten van de tab/browser.
5
10
  > - `<CB>`-component gemaakt. Een kale checkbox met een label. Geen wrapper, geen direction, geen form.
6
11
  > - `<RB>`-component gemaakt. Een Radio-button met een label. Geen wrapper, geen direction, geen form.
7
12
  > - `ColorProp` uitgebreid met `"is-${`_string_`}"`-template literal. Als _Bulma_ nog andere kleuren gebruikt dan de standaard-kleuren, kan je die op die manier gebruiken.
@@ -80,7 +85,7 @@
80
85
  - [useDebouncedValue](#hooks-use-debounced-value)
81
86
  - [useEventListener](#hooks-use-event-listener)
82
87
  - [useHotkeys](#hooks-use-hotkeys)
83
- - [useLocalStoredState](#hooks-use-local-stored-state)
88
+ - [useLocalStoredState & useSessionStoredState](#hooks-use-local-stored-state)
84
89
  - [usePagination](#hooks-use-pagination)
85
90
  - [useToggle & useBoolToggle](#hooks-use-toggle)
86
91
  - [useUncontrolled](#hooks-use-uncontrolled)
@@ -1934,7 +1939,7 @@ Het resultaat van deze form komt via de `onSubmit()` methode naar buiten. Als de
1934
1939
  - [useDebouncedValue](#hooks-use-debounced-value)
1935
1940
  - [useEventListener](#hooks-use-event-listener)
1936
1941
  - [useHotkeys](#hooks-use-hotkeys)
1937
- - [useLocalStoredState](#hooks-use-local-stored-state)
1942
+ - [useLocalStoredState & useSessionStoredState](#hooks-use-local-stored-state)
1938
1943
  - [usePagination](#hooks-use-pagination)
1939
1944
  - [useToggle & useBoolToggle](#hooks-use-toggle)
1940
1945
  - [useUncontrolled](#hooks-use-uncontrolled)
@@ -2085,19 +2090,35 @@ function HotkeysExample() {
2085
2090
  }
2086
2091
  ```
2087
2092
 
2088
- #### useLocalStoredState() <a id="hooks-use-local-stored-state"></a>
2093
+ #### useLocalStoredState() en useSessionStoredState() <a id="hooks-use-local-stored-state"></a>
2089
2094
 
2090
- de `useLocalStoredState()`-hook werkt hetzelfde als de `React.useState()`-hook. Het enige verschil is dat de state **ook** in _Local Storage_ wordt opgeslagen, zodat de waarde na een refresh nog steeds beschikbaar is. Data wordt in _Local Storage_ opgeslagen in JSON-formaat. De return-waarde is een tuple met 3 variabelen: `[value, setValue, remove]`
2091
-
2092
- - `value`: de waarde van type `T`
2093
- - `setValue(val: T)`: een functie die de waarde als parameter ontvangt.
2094
- - `remove()`: verwijder de waarde (als die nog bestaat) uit _Local Storage_
2095
+ De `useLocalStoredState()`- en de `useSessionStoredState()`-hook werkt hetzelfde als de `React.useState()`-hook. Het enige verschil is dat de state **ook** in _Local Storage_ of de _Session Storage_ wordt opgeslagen, zodat de waarde na een refresh nog steeds beschikbaar is. Data wordt in _Local Storage_ of de _Session Storage_ opgeslagen in JSON-formaat. De return-waarde is een tuple met 3 variabelen: `[value, setValue, remove]`
2095
2096
 
2096
2097
  De hook gebruik je op bijna dezelfde manier als `useState()`:
2098
+ | Property | Type | Description |
2099
+ |----------------|----------------------|-----------------------------------------------------------------------------------------|
2100
+ | `key` | `string` | de key waar de waarde in _Local Storage_ wordt opgeslagen |
2101
+ | `defaultValue` | `T` | de waarde die gebruikt wordt als default |
2102
+ | `serialize` | `(val: T) => string` | (optioneel) de functie die de waarde `T` omzet naar een string om die te kunnen opslaan |
2103
+ | `deserialize` | `(val: string) => T` | (optioneel) de functie die eenstring uit _Local Storage_ omzet naar een waarde `T` |
2104
+
2105
+ Het verschil tussen de _Local Storage_ en de _Session Storage_ is simpel:
2106
+
2107
+ - _Local Storage_:de data blijft bewaard tot deze wordt verwijderd.
2108
+ - _Session Storage_: de data wordt verwijderd als de **browser** of de **tab** wordt gesloten.
2097
2109
 
2098
2110
  ```tsx
2099
2111
  function UseLocalStoredStateDemo() {
2100
- const [value, setValue, remove] = useLocalStoredState({ key: 'my-special-key', defaultValue: '' });
2112
+ const [value, setValue, remove] = useLocalStoredState({ key: 'my-special-key-local-storage', defaultValue: '' });
2113
+ return (
2114
+ <>
2115
+ <Input value={value} onChange={(e) => setValue(e.target.value)} />
2116
+ <Button.Primary onClick={() => remove()}>Remove value</Button.Primary>
2117
+ </>
2118
+ );
2119
+
2120
+ function UseSessionStoredStateDemo() {
2121
+ const [value, setValue, remove] = useSessionStoredState({ key: 'my-special-key-session-storage', defaultValue: '' });
2101
2122
  return (
2102
2123
  <>
2103
2124
  <Input value={value} onChange={(e) => setValue(e.target.value)} />
@@ -2107,13 +2128,7 @@ function UseLocalStoredStateDemo() {
2107
2128
  }
2108
2129
  ```
2109
2130
 
2110
- Om te zien dat de waarde in _Local Storage_ bewaard blijft, moet je de pagina refreshen nadat je de waarde hebt gewijzigd. Dan wordt de waarde uit _Local Storage_ gevuld. Anders wordt de `defaultValue` gebruikt. Het object dat als parameter wordt meegegeven aan de `useLocalStoredState()`-hook is een object met de volgende properties:
2111
- | Property | Type | Description |
2112
- |----------------|----------------------|--------------------------------------------------------------------------|
2113
- | `key` | `string` | de key waar de waarde in _Local Storage_ wordt opgeslagen |
2114
- | `defaultValue` | `T` | de waarde die gebruikt wordt als default |
2115
- | `serialize` | `(val: T) => string` | (optioneel) de functie die de waarde `T` omzet naar een string om die te kunnen opslaan |
2116
- | `deserialize` | `(val: string) => T` | (optioneel) de functie die eenstring uit _Local Storage_ omzet naar een waarde `T` |
2131
+ Om te zien dat de waarde in de _Storage_ bewaard blijft, moet je de pagina refreshen nadat je de waarde hebt gewijzigd. Dan wordt de waarde uit _Storage_ gevuld. Anders wordt de `defaultValue` gebruikt. Als je de waarde wilt verwijderen, dan kan dat met de `remove()`-functie. Om het verschil tussen _Local_ en _Session_ te zien, moet je de tab of de browser sluiten. De waarde in _Local Storage_ blijft bewaard, de waarde in _Session Storage_ wordt verwijderd.
2117
2132
 
2118
2133
  De functies `serialize` en `deserialize` hoef je alleen te implementeren als je een waarde hebt die geen gebruik van `JSON.stringify()` en `JSON.parse()` kan maken, of als er meer nodig is om dat te kunnen doen.
2119
2134
 
@@ -23,6 +23,6 @@ declare type AspectRatioProps = {
23
23
  * <iframe src="https://www.youtube.com/embed/dQw4w9WgXcQ">
24
24
  * </AspectRatio>
25
25
  */
26
- declare function AspectRatio(props: AspectRatioProps): JSX.Element;
26
+ declare function AspectRatio({ ratio, children, caption, className }: AspectRatioProps): JSX.Element;
27
27
  export { AspectRatio };
28
28
  export type { AspectRatioProps };
@@ -25,6 +25,6 @@ declare type ButtonGroupProps = {
25
25
  * <Button>Right</Button>
26
26
  * </ButtonGroup>
27
27
  */
28
- declare const ButtonGroup: (props: ButtonGroupProps) => JSX.Element;
28
+ declare const ButtonGroup: ({ children, hasAddons, alignment, className }: ButtonGroupProps) => JSX.Element;
29
29
  export { ButtonGroup };
30
30
  export type { ButtonGroupProps };
@@ -23,7 +23,7 @@ declare type ContainerProps = {
23
23
  * @example <Container>This is a container</Container>
24
24
  */
25
25
  declare const Container: {
26
- (props: ContainerProps): JSX.Element;
26
+ ({ className, children, styles }: ContainerProps): JSX.Element;
27
27
  /**
28
28
  * Een container om content horizontaal te centreren in grote viewports.
29
29
  * @param props
@@ -39,7 +39,7 @@ declare const Container: {
39
39
  *
40
40
  * @example <Container.Wide>This is a somewhat wider container</Container.Wide>
41
41
  */
42
- Wide(props: ContainerProps): JSX.Element;
42
+ Wide({ className, children, styles }: ContainerProps): JSX.Element;
43
43
  /**
44
44
  * Een container om content horizontaal te centreren in grote viewports.
45
45
  * @param props
@@ -55,7 +55,7 @@ declare const Container: {
55
55
  *
56
56
  * @example <Container.Widest>This is a wide container</Container.Widest>
57
57
  */
58
- Widest(props: ContainerProps): JSX.Element;
58
+ Widest({ className, children, styles }: ContainerProps): JSX.Element;
59
59
  /**
60
60
  * Een container om content horizontaal te centreren in grote viewports.
61
61
  * De width van de container is afhankelijk van de maximale viewport width.
@@ -73,7 +73,7 @@ declare const Container: {
73
73
  *
74
74
  * @example <Container.Max>This is an almost-fullwidth container </Container.Max>
75
75
  */
76
- Max(props: ContainerProps): JSX.Element;
76
+ Max({ className, children, styles }: ContainerProps): JSX.Element;
77
77
  };
78
78
  export { Container };
79
79
  export type { ContainerProps };
@@ -31,8 +31,6 @@ declare type DataTableProps<T extends unknown> = {
31
31
  maxRows?: number;
32
32
  /** Placeholder voor zoekveld. Als er geen placeholder is (undefined or emptystring), is er geen zoek-veld */
33
33
  searchPlaceholder?: string;
34
- /** Placeholder voor zoekveld. Als er geen placeholder is (undefined or emptystring), is er geen zoek-veld @deprecated: use `searchPlaceholder` */
35
- searchTxt?: string;
36
34
  /**
37
35
  * (Optionele) Eigen zoek-functie. De default-zoek-functie wordt dan vervangen.
38
36
  * @param searchTerm de content van het zoekveld
@@ -126,6 +124,6 @@ declare type DataTableColumn<T extends unknown> = {
126
124
  * );
127
125
  *
128
126
  */
129
- declare function DataTable<T extends unknown>({ fullwidth, bordered, narrow, striped, hoverable, defaultSortCol, data, maxRows, columns, rowIdentifier, headerContent, searchTxt, searchPlaceholder, onSearch, rowClasses, onRowSelected, onNoRowsToRender, }: DataTableProps<T>): JSX.Element;
127
+ declare function DataTable<T extends unknown>({ fullwidth, bordered, narrow, striped, hoverable, defaultSortCol, data, maxRows, columns, rowIdentifier, headerContent, searchPlaceholder, onSearch, rowClasses, onRowSelected, onNoRowsToRender, }: DataTableProps<T>): JSX.Element;
130
128
  export { DataTable };
131
129
  export type { DataTableProps, DataTableColumn };
@@ -26,7 +26,7 @@ declare type IconProps = {
26
26
  * <Icon icon="fas fa-flag" />
27
27
  * <Icon icon={faFlag} /> // import { faFlag } from '@fortawesome/free-solid-svg-icons';
28
28
  */
29
- declare const Icon: (props: IconProps) => JSX.Element;
29
+ declare const Icon: ({ color, size, rotation, icon, flip, animate }: IconProps) => JSX.Element;
30
30
  declare type IconTextProps = {
31
31
  /** React font-awesome icon
32
32
  * - `string`: geef de gehele font-awesome-class op. 'flip', 'animate', 'rotation' worden dan al gebruikt in deze class.
@@ -55,6 +55,6 @@ declare type IconTextProps = {
55
55
  * <IconText icon="fas fa-flag">Flag</IconText>
56
56
  * <IconText icon={faFlag}>Flag</IconText> // import { faFlag } from '@fortawesome/free-solid-svg-icons';
57
57
  */
58
- declare const IconText: (props: IconTextProps) => JSX.Element;
58
+ declare const IconText: ({ icon, size, color, rotation, flip, animate, children }: IconTextProps) => JSX.Element;
59
59
  export { Icon, IconText };
60
60
  export type { IconProps, IconTextProps };
@@ -24,6 +24,6 @@ declare type ImageProps = {
24
24
  * @returns an image with a fixed aspect ratio
25
25
  * @example <Image ratio="1by1" src="https://www.loon.be/images/logo.png" alt="Loon.be" />
26
26
  */
27
- declare function Image(props: ImageProps): JSX.Element;
27
+ declare function Image({ ratio, imgWidth, alt, figCaption, className, isRounded, src }: ImageProps): JSX.Element;
28
28
  export { Image };
29
29
  export type { ImageProps };
@@ -43,6 +43,6 @@ declare type LinkProps = {
43
43
  * @returns een link
44
44
  * @example <Link href="https://www.google.com">Google</Link>
45
45
  */
46
- declare const Link: (props: LinkProps) => JSX.Element;
46
+ declare const Link: ({ href, target, tooltip, id, rel, children }: LinkProps) => JSX.Element;
47
47
  export { Link, LinkButton };
48
48
  export type { LinkProps, LinkButtonProps };
@@ -1,5 +1,17 @@
1
1
  import React from 'react';
2
2
  import { ColorProp } from '../../loon-react-bulma-types';
3
+ /** Props voor een Notification */
4
+ export declare type NotificationProps = {
5
+ /** Content van de notificatie */
6
+ children: React.ReactNode;
7
+ /**
8
+ * Afhandeling van dismiss-click notificatie
9
+ * @param e event
10
+ */
11
+ onDismiss(e?: any): void;
12
+ /** Roep de @see onDismiss() automatisch aan na ... milliseconden */
13
+ autoDismissAfter?: number;
14
+ };
3
15
  /**
4
16
  * Een instelbare notificatie. Default is een info-notificatie
5
17
  * @param props
@@ -7,8 +19,8 @@ import { ColorProp } from '../../loon-react-bulma-types';
7
19
  * @example <Notification>Hello World</Notification>
8
20
  */
9
21
  declare const Notification: {
10
- (props: NotificationProps & {
11
- color?: ColorProp;
22
+ ({ children, onDismiss, autoDismissAfter, color, }: NotificationProps & {
23
+ color?: string | undefined;
12
24
  }): JSX.Element;
13
25
  /** Een primary-colored notificatie
14
26
  * @param props
@@ -48,15 +60,3 @@ declare const Notification: {
48
60
  Info(props: NotificationProps): JSX.Element;
49
61
  };
50
62
  export { Notification };
51
- /** Props voor een Notification */
52
- export declare type NotificationProps = {
53
- /** Content van de notificatie */
54
- children: React.ReactNode;
55
- /**
56
- * Afhandeling van dismiss-click notificatie
57
- * @param e event
58
- */
59
- onDismiss(e?: any): void;
60
- /** Roep de @see onDismiss() automatisch aan na ... milliseconden */
61
- autoDismissAfter?: number;
62
- };
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { CheckradioStylingType, ColorProp } from '../../loon-react-bulma-types';
3
3
  import { BaseInputProps } from '../shared';
4
- declare type CBInputProps = Omit<BaseInputProps, 'keyboardType' | 'icons' | 'direction' | 'validation' | 'labelHidden' | 'label'> & {
4
+ declare type CBInputProps = Omit<BaseInputProps, 'keyboardType' | 'icons' | 'direction' | 'validation' | 'labelHidden' | 'label' | 'spellCheck'> & {
5
5
  /** Speciale styling van de checkbox */
6
6
  styling?: CheckradioStylingType;
7
7
  /** Is de checkbox checked */
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { CheckradioStylingType, ColorProp } from '../../loon-react-bulma-types';
3
3
  import { BaseInputProps } from '../shared';
4
- declare type CheckboxInputProps = Omit<BaseInputProps, 'icons'> & {
4
+ declare type CheckboxInputProps = Omit<BaseInputProps, 'icons' | 'labelHidden' | 'spellCheck'> & {
5
5
  /** Kleur van de checkbox (default = 'l', link) */
6
6
  color?: ColorProp;
7
7
  /** Speciale styling van de checkbox */
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { BaseInputProps } from '../shared';
3
- declare type CurrencyInputProps = Omit<BaseInputProps, 'labelHidden'> & {
3
+ declare type CurrencyInputProps = BaseInputProps & {
4
4
  /** Start value voor deze input (optional) */
5
5
  value?: number;
6
6
  /**
@@ -32,6 +32,7 @@ declare type CurrencyInputProps = Omit<BaseInputProps, 'labelHidden'> & {
32
32
  * | labelHidden | `boolean` | `false` | de label is verborgen (screenreaders) |
33
33
  * | disabled | `boolean` | `false` | de input is disabled |
34
34
  * | textAlign | `l`, `c`, `r` | `l` | de text-align van de input |
35
+ * | spellCheck | `boolean` | `false` | Moet de browser deze input spell-checken? |
35
36
  * | keyboardType | `search`, `text`, | `text ` | de type van de keyboard (touch-devices) |
36
37
  * | | `email`,`tel`,`url` | | |
37
38
  * | | `numeric`, `decimal` | | |
@@ -44,6 +45,6 @@ declare type CurrencyInputProps = Omit<BaseInputProps, 'labelHidden'> & {
44
45
  * | onValueChanged() | `function` | | (value: string, valid?: boolean) => void |
45
46
  * | onKeyDown() | `function` | | (event: React.KeyboardEvent) => void |
46
47
  */
47
- declare function LbrCurrencyInput({ label, name, id, value, validation, errorMessage, size, textAlign, disabled, placeholder, keyboardType, tooltip, direction, onValueChanged, onKeyDown, decimalSeparator, alwaysShowCents, ...props }: CurrencyInputProps): JSX.Element;
48
+ declare function LbrCurrencyInput({ label, name, id, value, validation, errorMessage, size, textAlign, disabled, placeholder, keyboardType, tooltip, direction, labelHidden, onValueChanged, onKeyDown, decimalSeparator, alwaysShowCents, ...props }: CurrencyInputProps): JSX.Element;
48
49
  export { LbrCurrencyInput as CurrencyInput };
49
50
  export type { CurrencyInputProps };
@@ -25,6 +25,7 @@ declare type DateInputProps = BaseInputProps & {
25
25
  * | id | `string ` | `name` | de id voor de input |
26
26
  * | tooltip | `string ` | | tooltip voor de input |
27
27
  * | labelHidden | `boolean` | `false` | de label is verborgen (screenreaders) |
28
+ * | spellCheck | `boolean` | `false` | Moet de browser deze input spell-checken? |
28
29
  * | disabled | `boolean` | `false` | de input is disabled |
29
30
  * | textAlign | `l`, `c`, `r` | `l` | de text-uitlijning van de input |
30
31
  * | keyboardType | `search`, `text`, | `text` | de type van de keyboard (touch-devices) |
@@ -24,6 +24,7 @@ declare type DateTimeInputProps = BaseInputProps & {
24
24
  * | id | `string ` | `name` | de id voor de input |
25
25
  * | tooltip | `string ` | | tooltip voor de input |
26
26
  * | labelHidden | `boolean` | `false` | de label is verborgen (screenreaders) |
27
+ * | spellCheck | `boolean` | `false` | Moet de browser deze input spell-checken? |
27
28
  * | disabled | `boolean` | `false` | de input is disabled |
28
29
  * | textAlign | `l`, `c`, `r` | `l` | de text-uitlijning van de input |
29
30
  * | keyboardType | `search`, `text`, | `text ` | de type van de keyboard (touch-devices) |
@@ -25,6 +25,7 @@ declare type TimeInputProps = BaseInputProps & {
25
25
  * | name | `string ` | | de naam voor de input (REQUIRED) |
26
26
  * | label | `string ` | `name` | de label voor de input |
27
27
  * | id | `string ` | `name` | de id voor de input |
28
+ * | spellCheck | `boolean` | `false` | Moet de browser deze input spell-checken? |
28
29
  * | tooltip | `string ` | | tooltip voor de input |
29
30
  * | labelHidden | `boolean` | `false` | de label is verborgen (screenreaders) |
30
31
  * | disabled | `boolean` | `false` | de input is disabled |
@@ -35,6 +35,7 @@ declare type FileInputProps = Omit<BaseInputProps, 'icons'> & {
35
35
  * | name | `string` | | de naam voor de input (REQUIRED) |
36
36
  * | label | `string` | `name` | de label voor de input |
37
37
  * | kiesLabel | `string` | | de tekst voor de selecteer-file-button |
38
+ * | spellCheck | `boolean` | `false` | Moet de browser deze input spell-checken? |
38
39
  * | multiple | `boolean` | `false` | of er meerdere files geselecteerd moeten |
39
40
  * | boxed | `boolean` | `false` | of de input als een block moet worden |
40
41
  * | accept | `string` | | de file-types die geselecteerd mogen worden|
@@ -4,6 +4,7 @@ import { AutoCompleteType } from '../loon-react-bulma-types';
4
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
+ required?: boolean;
7
8
  /** Default icon voor aan begin van de input */
8
9
  icon?: string | IconProp;
9
10
  /** Type van de tekst input (default = 'text') */
@@ -11,7 +12,7 @@ declare type InputProps<T extends InputValueType> = BaseInputProps<T> & {
11
12
  /** Start value voor deze input (optioneel) */
12
13
  value?: T;
13
14
  /** Speciaal voor autocomplete-managers, zoals password-managers. Wat is de functie van deze input */
14
- autocomplete?: AutoCompleteType;
15
+ autoComplete?: AutoCompleteType;
15
16
  /**
16
17
  * Wat te doen als de waarde is veranderd
17
18
  * @param newVal: de nieuwe waarde
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { BaseInputProps } from '../shared';
3
- declare type MultiRangeInputProps = Omit<BaseInputProps, 'icons'> & {
3
+ declare type MultiRangeInputProps = Omit<BaseInputProps, 'icons' | 'spellCheck'> & {
4
4
  /** Stap-grootte voor de input (optional, default = 1) */
5
5
  step?: number;
6
6
  /** De start-waarde voor de input (optional) */
@@ -26,6 +26,7 @@ declare type NumberInputProps = BaseInputProps & {
26
26
  * | id | `string ` | `name` | de id voor de input |
27
27
  * | step | `number ` | `1` | stapgrootte voor de input (+ & - aansturen)|
28
28
  * | tooltip | `string ` | | tooltip voor de input |
29
+ * | spellCheck | `boolean` | `false` | Moet de browser deze input spell-checken? |
29
30
  * | labelHidden | `boolean` | `false` | de label is verborgen (screenreaders) |
30
31
  * | disabled | `boolean` | `false` | de input is disabled |
31
32
  * | textAlign | `l`, `c`, `r` | `l` | de text-align van de input |
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { BaseInputProps } from '../shared';
3
- declare type RangeInputProps = Omit<BaseInputProps, 'icons'> & {
3
+ declare type RangeInputProps = Omit<BaseInputProps, 'icons' | 'spellCheck'> & {
4
4
  /** Stap-grootte voor de input (optional, default = 1) */
5
5
  step?: number;
6
6
  /** een getals-unit (`%`, `kg/m3`, etc) om weer te geven op de range-input */
@@ -24,6 +24,7 @@ declare type ColorInputProps = BaseInputProps & {
24
24
  * | id | `string` | `name` | de id voor de input |
25
25
  * | tooltip | `string` | | tooltip voor de input |
26
26
  * | labelHidden | `boolean` | `false` | de label is verborgen (screenreaders) |
27
+ * | spellCheck | `boolean` | `false` | Moet de browser deze input spell-checken? |
27
28
  * | disabled | `boolean` | `false` | de input is disabled |
28
29
  * | keyboardType | `search`, `text`, | `text ` | de type van de keyboard (touch-devices) |
29
30
  * | | `email`,`tel`,`url` | | |
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { CheckradioStylingType, ColorProp } from '../../loon-react-bulma-types';
3
3
  import { BaseInputProps } from '../shared';
4
- declare type RBInputProps<T = string> = Omit<BaseInputProps, 'keyboardType' | 'icons' | 'direction' | 'validation' | 'labelHidden' | 'label' | 'id' | 'name'> & {
4
+ declare type RBInputProps<T = string> = Omit<BaseInputProps, 'keyboardType' | 'icons' | 'direction' | 'validation' | 'labelHidden' | 'label' | 'id' | 'name' | 'spellCheck'> & {
5
5
  /** de group-name voor deze inputs. Radiobuttons werken daar iets anders mee */
6
6
  groupName: string;
7
7
  /** Speciale styling van de checkbox */
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { CheckradioStylingType, ColorProp, DirectionProp, SizeProp, TextAlignmentProp } from '../../loon-react-bulma-types';
3
3
  import { BaseInputProps } from '../shared';
4
- declare type RadioInputProps = Omit<BaseInputProps, 'icons'> & {
4
+ declare type RadioInputProps = Omit<BaseInputProps, 'icons' | 'labelHidden' | 'spellCheck'> & {
5
5
  value?: string;
6
6
  children?: React.ReactNode;
7
7
  onValueChanged?(newVal: string, isValid?: boolean): any | void;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export declare function TekstEditor({ content, onChange, }: {
3
+ content?: string;
4
+ onChange: (content: string) => void;
5
+ }): JSX.Element;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { BaseInputProps } from '../shared';
3
3
  import { SelectOptionType, SelectOptionGroupType } from './BaseSelectProps';
4
- declare type MultiSelectInputProps = Omit<BaseInputProps, 'icons'> & {
4
+ declare type MultiSelectInputProps = Omit<BaseInputProps, 'icons' | 'spellCheck'> & {
5
5
  /** De waarde */
6
6
  value?: string[];
7
7
  /** De values voor de options. DEZE MOETEN UNIEK ZIJN! */
@@ -2,7 +2,7 @@
2
2
  import { SizeProp } from '../../loon-react-bulma-types';
3
3
  import { BaseInputProps } from '../shared';
4
4
  import { SelectOptionType, SelectOptionGroupType } from './BaseSelectProps';
5
- declare type SelectInputProps = Omit<BaseInputProps, 'icons'> & {
5
+ declare type SelectInputProps = Omit<BaseInputProps, 'icons' | 'spellCheck'> & {
6
6
  /** De waarde */
7
7
  value?: number | string;
8
8
  /** De values voor de options. DEZE MOETEN UNIEK ZIJN! */
@@ -26,6 +26,7 @@ declare type EmailInputProps = BaseInputProps & {
26
26
  * | name | `string` | | de naam voor de input (REQUIRED) |
27
27
  * | label | `string` | `name` | de label voor de input |
28
28
  * | id | `string` | `name` | de id voor de input |
29
+ * | spellCheck | `boolean` | `false` | Moet de browser deze input spell-checken? |
29
30
  * | autoComplete | `AutoCompleteType` | `email` | de autocomplete type (password managers) |
30
31
  * | tooltip | `string` | | tooltip voor de input |
31
32
  * | labelHidden | `boolean` | `false` | de label is verborgen (screenreaders) |
@@ -27,6 +27,7 @@ declare type PasswordInputProps = BaseInputProps & {
27
27
  * | label | `string` | `name` | de label voor de input |
28
28
  * | id | `string` | `name` | de id voor de input |
29
29
  * | autoComplete | `AutoCompleteType` | | de autocomplete type (password managers) |
30
+ * | spellCheck | `boolean` | `false` | Moet de browser deze input spell-checken? |
30
31
  * | tooltip | `string` | | tooltip voor de input |
31
32
  * | labelHidden | `boolean` | `false` | de label is verborgen (screenreaders) |
32
33
  * | disabled | `boolean` | `false` | de input is disabled |
@@ -25,6 +25,7 @@ declare type TextAreaProps = Omit<BaseInputProps, 'icons'> & {
25
25
  * | label | `string` | `name` | de label voor de input |
26
26
  * | id | `string` | `name` | de id voor de input |
27
27
  * | tooltip | `string` | | tooltip voor de input |
28
+ * | spellCheck | `boolean` | `false` | Moet de browser deze input spell-checken? |
28
29
  * | autocomplete | `AutoCompleteType` | | autocomplete voor de input |
29
30
  * | labelHidden | `boolean` | `false` | de label is verborgen (screenreaders) |
30
31
  * | disabled | `boolean` | `false` | de input is disabled |
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ import { JSONContent } from '@tiptap/react';
3
+ /**
4
+ * Een Rich Text Editor, dus een uitgebreide vorm van een `<textarea>`, want je kan dingen **bold**, *italic*, enz. maken.
5
+ * De output is in HTML-vorm of in JSON-vorm. Je kan er ook gewoon platte tekst uitkrijgen, maar dan vervalt de opmaak.
6
+ * @url https://tiptap.dev/ voor de documentatie van hoe deze component in elkaar steekt.
7
+ * @returns een component voor het maken van rich text met HTML of JSON output
8
+ * @description
9
+ * | prop | type | uitleg |
10
+ * |--------------|----------------------------|-------------------------|
11
+ * | content | `string` | de inhoud van de editor |
12
+ * | onChangeHtml | `(c: string) => void` | een callback die wordt aangeroepen als de inhoud van de editor verandert. De inhoud wordt dan als HTML meegegeven. |
13
+ * | onChangeText | `(c: string) => void` | een callback die wordt aangeroepen als de inhoud van de editor verandert. De inhoud wordt dan als platte tekst meegegeven. |
14
+ * | onChangeJson | `(c: JSONContent) => void` | een callback die wordt aangeroepen als de inhoud van de editor verandert. De inhoud wordt dan als JSON meegegeven. |
15
+ */
16
+ export declare function TextEditor({ content, onChangeHtml, onChangeText, onChangeJson, }: {
17
+ content?: string;
18
+ onChangeHtml?: (content: string) => void;
19
+ onChangeText?: (content: string) => void;
20
+ onChangeJson?: (content: JSONContent) => void;
21
+ }): JSX.Element;
@@ -38,6 +38,7 @@ declare type TextInputProps = BaseInputProps & {
38
38
  * | label | `string` | `name` | de label voor de input |
39
39
  * | characters | `string`, `RegExp`, `0-Z`,| | de toegestane karakters in de input |
40
40
  * | | `0-9`, `a-z`, `A-Z`, `a-Z`| | |
41
+ * | spellCheck | `boolean` | `false` | Moet de browser deze input spell-checken? |
41
42
  * | autocomplete | `AutoCompleteType` | | de autocomplete type voor de input |
42
43
  * | id | `string` | `name` | de id voor de input |
43
44
  * | tooltip | `string` | | tooltip voor de input |
@@ -24,6 +24,7 @@ export { EmailInput } from './Text/EmailInput';
24
24
  export type { EmailInputProps } from './Text/EmailInput';
25
25
  export { PasswordInput } from './Text/PasswordInput';
26
26
  export type { PasswordInputProps } from './Text/PasswordInput';
27
+ export { TextEditor } from './Text/TextEditor';
27
28
  export { TextArea } from './Text/TextArea';
28
29
  export type { TextAreaProps } from './Text/TextArea';
29
30
  export { TextInput } from './Text/TextInput';
@@ -5,6 +5,7 @@ export declare const InputContainer: ({ label, children: input, error, size, dir
5
5
  label?: {
6
6
  txt: string;
7
7
  id: string;
8
+ hidden: boolean;
8
9
  } | undefined;
9
10
  children: React.ReactNode;
10
11
  error?: React.ReactNode;
@@ -4,24 +4,26 @@ import { TextAlignmentProp, DirectionProp, KeyboardTypeProp, SizeProp } from '..
4
4
  export declare type BaseInputProps<T extends any = void> = {
5
5
  /** Is dit veld disabled ? (optioneel) */
6
6
  disabled?: boolean;
7
- /** Name input: gebruikt voor een <label> als er geen label gedefinieerd is & de name-attribuut <input> */
7
+ /** Name input: gebruikt voor een `<label>` als er geen label gedefinieerd is & de name-attribuut `<input>` */
8
8
  name: string;
9
- /** ID voor de input: gebruikt voor een <label for="*id*}">. default wordt anders de 'name'-prop gebruik */
9
+ /** ID voor de input: gebruikt voor een `<label for="*id*">`. default wordt anders de `name`-prop gebruik */
10
10
  id?: string;
11
11
  /** Een tooltip voor de button */
12
12
  tooltip?: string;
13
13
  /** Label voor de input, als dat afwijkt van de name-attribuut */
14
14
  label?: string;
15
- /** Label wordt alleen gebruikt voor accessibility, dus is onzichtbaar op het scherm. (default = false) */
15
+ /** Label wordt alleen gebruikt voor accessibility, dus is onzichtbaar op het scherm. (default `false`) */
16
16
  labelHidden?: boolean;
17
- /** Grootte van de input (default = 'm', normal) */
17
+ /** Grootte van de input (default = `m`, normal) */
18
18
  size?: SizeProp;
19
- /** Waar moet de tekst van de input uitgelijnd worden (default = 'l', links) */
19
+ /** Waar moet de tekst van de input uitgelijnd worden (default = `l`, links) */
20
20
  textAlign?: TextAlignmentProp;
21
- /** De input is horizontaal, label & input op 1 lijn. (default = 'horizontal') */
21
+ /** De input is horizontaal, label & input op 1 lijn. (default = `horizontal`) */
22
22
  direction?: DirectionProp;
23
23
  /** Een object met validatie-regels */
24
24
  validation?: FormValidationType<T>;
25
+ /** Moet de spell-checker van de browser aanstaan voor deze input? (default `false`) */
26
+ spellCheck?: boolean;
25
27
  /** Eigen errorMessage voor validatie buiten component om */
26
28
  errorMessage?: string | ((value: T | string | string[] | number | number[] | boolean | Date | FileList | any) => string);
27
29
  /** Placeholder in input (optioneel) */
@@ -6,3 +6,4 @@ export * from './usePagination';
6
6
  export * from './useToggle';
7
7
  export * from './useUncontrolled';
8
8
  export * from './useValidatedState';
9
+ export * from './useSessionStoredState';
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ export declare function useCaretPosition<T extends HTMLInputElement | HTMLTextAreaElement = HTMLInputElement>(): {
3
+ start: number;
4
+ end: number;
5
+ ref: React.RefObject<T>;
6
+ updateCaret: () => void;
7
+ };
@@ -1,7 +1,3 @@
1
- /** Default serializer met `JSON.stringify` van de waar `T` naar een `string` */
2
- declare function serializeJSON<T>(value: T): string;
3
- /** Default deserializer met `JSON.parse` van een `string` naar de waarde `T` */
4
- declare function deserializeJSON<T>(value: string): T;
5
1
  declare type UseLocalStoredStateFn<T = string> = {
6
2
  /** Key to store the value with in Local Storage */
7
3
  key: string;
@@ -15,6 +11,7 @@ declare type UseLocalStoredStateFn<T = string> = {
15
11
  /**
16
12
  * Hook die werkt als `React.useState<T|undefined>()`, maar waarbij de waarde ook wordt opgeslagen in Local Storage.
17
13
  * 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.
14
+ * Om de waarde te bewaren bij afsluiten van de browser, gebruik je de hook `{@link useSessionStoredState}`.
18
15
  * @param {UseLocalStoredStateFn} params voor de hook
19
16
  * @returns {[T, (value: T) => void]} tuple met een value en een setValue-function (net als React.useState)
20
17
  * @description
@@ -23,7 +20,7 @@ declare type UseLocalStoredStateFn<T = string> = {
23
20
  * | key | `string` | De key waaronder de waarde in Local Storage wordt opgeslagen. |
24
21
  * | initialValue | `T` | De initiale waarde. |
25
22
  * | serialize | `function` | (optional) functie om de waarde om te zetten naar een string. Implementeer als de waarde __GEEN__ gebruik kan maken van `JSON.stringify()`! |
26
- * | deserialize | `function` | De functie die een string omzet naar de waarde. Implementeer als de waarde __GEEN__ gebruik kan maken van `JSON.parse()`! |
23
+ * | deserialize | `function` | (optional) De functie die een string omzet naar de waarde. Implementeer als de waarde __GEEN__ gebruik kan maken van `JSON.parse()`! |
27
24
  * @example
28
25
  * import { useLocalStoredState } from 'loon-bulma-react';
29
26
  * const [ value, setValue, removeFromLocalStorage ] = useLocalStoredState({ key: 'myKey', initialValue: 'Oompa Loompa' });
@@ -32,6 +29,8 @@ declare type UseLocalStoredStateFn<T = string> = {
32
29
  * // 3. refresh the page.
33
30
  * // 4. see te new value on the page.
34
31
  * // 5. you can also check the value in Local Storage in devtools.
32
+ * // 6. close the browser / tab
33
+ * // 7. check the value in session storage. it should still be there.
35
34
  */
36
35
  declare function useLocalStoredState<T extends unknown>({ key, initialValue, deserialize, serialize }: UseLocalStoredStateFn<T>): readonly [T | undefined, (value: T) => void, () => void];
37
- export { useLocalStoredState, serializeJSON, deserializeJSON };
36
+ export { useLocalStoredState };