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
@@ -0,0 +1,38 @@
1
+ declare type UseSessionStoredState<T = string> = {
2
+ /** Key to store the value with in Session Storage */
3
+ key: string;
4
+ /** Initial value (if its non-existent in Session 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
+ };
11
+ /**
12
+ * Hook die werkt als `React.useState<T|undefined>()`, maar waarbij de waarde ook wordt opgeslagen in Session Storage.
13
+ * De waarde blijft dan bij het refreshen van de pagina aanwezig.
14
+ * Als de pagina dan ververst wordt, word de al bestaande waarde gebruikt, niet de initialValue.
15
+ * Maar als de tab of de browser gesloten wordt, dan wordt de inhoud van de session storage gewist.
16
+ * Om de waarde te bewaren bij afsluiten van de browser, gebruik je de hook `{@link useLocalStoredState}`.
17
+ * @param {UseSessionStoredState} params voor de hook
18
+ * @returns {[T, (value: T) => void]} tuple met een `value` en een `setValue`-function (net als `React.useState`)
19
+ * @description
20
+ * | Property | Type | Description |
21
+ * |--------------|------------|---------------------------------------------------------------|
22
+ * | key | `string` | De key waaronder de waarde in Session Storage wordt opgeslagen. |
23
+ * | initialValue | `T` | De initiale waarde. |
24
+ * | serialize | `function` | (optional) functie om de waarde om te zetten naar een string. Implementeer als de waarde __GEEN__ gebruik kan maken van `JSON.stringify()`! |
25
+ * | deserialize | `function` | (optional) De functie die een string omzet naar de waarde. Implementeer als de waarde __GEEN__ gebruik kan maken van `JSON.parse()`! |
26
+ * @example
27
+ * import { useSessionStoredState } from 'loon-bulma-react';
28
+ * const [ value, setValue, removeFromSessionStorage ] = useSessionStoredState({ key: 'myKey', initialValue: 'Oompa Loompa' });
29
+ * // 1. value is 'Oompa Loompa', put it somewhere on the screen
30
+ * // 2. change the value to something else
31
+ * // 3. refresh the page.
32
+ * // 4. see te new value on the page.
33
+ * // 5. you can also check the value in Local Storage in devtools.
34
+ * // 6. close the browser / tab
35
+ * // 7. check the value in session storage. it should be gone.
36
+ */
37
+ declare function useSessionStoredState<T extends unknown>({ key, initialValue, deserialize, serialize }: UseSessionStoredState<T>): readonly [T | undefined, (value: T) => void, () => void];
38
+ export { useSessionStoredState };