loon-bulma-react 2023.0.7 → 2023.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -18
- package/dist/components/DataTable/DataTable.d.ts +4 -2
- package/dist/contexts/Notifier/NotifierProps.d.ts +3 -1
- package/dist/forms/Currency/CurrencyInput.d.ts +3 -1
- package/dist/forms/shared/InputError.d.ts +1 -1
- package/dist/hooks/useDebouncedValue.d.ts +1 -1
- package/dist/hooks/useLocalStoredState.d.ts +2 -2
- package/dist/hooks/useToggle.d.ts +1 -1
- package/dist/hooks/useValidatedState.d.ts +1 -1
- package/dist/index.js +169 -414
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +170 -384
- package/dist/index.modern.js.map +1 -1
- package/dist/utils/JSDateTime.class.d.ts +7 -7
- package/dist/utils/index.d.ts +0 -1
- package/package.json +10 -9
package/README.md
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
> ## Aanpassingen
|
|
4
4
|
>
|
|
5
|
-
> DataTable: als er geen rijen zijn, kan je met de `onNoRowsToRender`-prop vertellen wat er dan WEL gerendered moet worden
|
|
6
|
-
> DataTable: striped-color & hover-color zijn anders
|
|
7
|
-
> DataTable: search-bar smaller en maximaal helft van de beschikbare ruimte
|
|
8
|
-
> DataTable: wrapping van header elementen aangepast
|
|
9
|
-
> Currency Input: gemaakt - probeer maar
|
|
5
|
+
> - DataTable: als er geen rijen zijn, kan je met de `onNoRowsToRender`-prop vertellen wat er dan WEL gerendered moet worden
|
|
6
|
+
> - DataTable: striped-color & hover-color zijn anders
|
|
7
|
+
> - DataTable: search-bar smaller en maximaal helft van de beschikbare ruimte
|
|
8
|
+
> - DataTable: wrapping van header elementen aangepast
|
|
9
|
+
> - Currency Input: gemaakt - probeer maar
|
|
10
10
|
|
|
11
11
|
## [Bulma](https://bulma.io/) & [React](https://reactjs.org/) componenten voor Loon Salarissoftware.
|
|
12
12
|
|
|
@@ -16,19 +16,16 @@
|
|
|
16
16
|
- [Confirmation](#confirmation)
|
|
17
17
|
- [Componenten](#components)
|
|
18
18
|
|
|
19
|
-
- [
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
- [Section](#layout-section)
|
|
30
|
-
- [ScrollArea](#layout-scrollarea)
|
|
31
|
-
|
|
19
|
+
- [AspectRatio](#layout-aspectratio)
|
|
20
|
+
- [Box](#layout-box)
|
|
21
|
+
- [Columns](#layout-columns)
|
|
22
|
+
- [Container](#layout-container)
|
|
23
|
+
- [Content](#layout-content)
|
|
24
|
+
- [Footer](#component-footer)
|
|
25
|
+
- [Hero](#layout-hero)
|
|
26
|
+
- [Image](#layout-image)
|
|
27
|
+
- [Section](#layout-section)
|
|
28
|
+
- [ScrollArea](#layout-scrollarea)
|
|
32
29
|
- [Button & ButtonGroup](#component-button)
|
|
33
30
|
- [Calendar](#components-calendar)
|
|
34
31
|
- [MonthView](#components-calendar-monthview)
|
|
@@ -30,6 +30,8 @@ declare type DataTableProps<T extends unknown> = {
|
|
|
30
30
|
/** wat is het maximaal aantal rijen dat zichtbaar is zonder paginatie? Als 0 is er geen maximum aantal rijen (default 0) */
|
|
31
31
|
maxRows?: number;
|
|
32
32
|
/** placeholder voor zoekveld. Als er geen placeholder is (undefined or emptystring), is er geen zoek-veld */
|
|
33
|
+
searchPlaceholder?: string;
|
|
34
|
+
/** placeholder voor zoekveld. Als er geen placeholder is (undefined or emptystring), is er geen zoek-veld @deprecated: use `searchPlaceholder` */
|
|
33
35
|
searchTxt?: string;
|
|
34
36
|
/**
|
|
35
37
|
* (Optionele) eigen zoek-functie. De default-zoek-functie wordt dan vervangen.
|
|
@@ -104,7 +106,7 @@ declare type DataTableColumn<T extends unknown> = {
|
|
|
104
106
|
* onRowSelected={(i, r) => handleRowClick(i, r)}
|
|
105
107
|
* defaultSortCol="Naam"
|
|
106
108
|
* rowClasses={(item: IUser) => (item.first_name.startsWith('C') ? 'is-dangerous' : '')}
|
|
107
|
-
*
|
|
109
|
+
* searchPlaceholder="Zoek een persoon ..."
|
|
108
110
|
* rowIdentifier="id"
|
|
109
111
|
* striped={true}
|
|
110
112
|
* hoverable={true}
|
|
@@ -124,6 +126,6 @@ declare type DataTableColumn<T extends unknown> = {
|
|
|
124
126
|
* );
|
|
125
127
|
*
|
|
126
128
|
*/
|
|
127
|
-
declare function DataTable<T extends unknown>(
|
|
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;
|
|
128
130
|
export { DataTable };
|
|
129
131
|
export type { DataTableProps, DataTableColumn };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { ColorProp } from '~/loon-react-bulma-types';
|
|
3
3
|
export declare type NotifierProviderProps = {
|
|
4
4
|
/** de child-components die de notifier mogen gebruiken */
|
|
5
|
-
children:
|
|
5
|
+
children: React.ReactNode;
|
|
6
6
|
/** waar moet de notifier getoont worden? (default = 'top') */
|
|
7
7
|
location?: 'top' | 'bottom';
|
|
8
8
|
/** de tijd (in ms) waarna een notificatie automatisch moet dismissen */
|
|
@@ -29,4 +29,6 @@ export declare type NotifierItemProps = {
|
|
|
29
29
|
dismissAfter?: 0 | number;
|
|
30
30
|
/** wat te doen als er geklikt wordt. Bij een 'click' wordt de notificatie ook gesloten. */
|
|
31
31
|
onClick?: (e: any) => void;
|
|
32
|
+
/** payload voor de notification */
|
|
33
|
+
payload?: any;
|
|
32
34
|
};
|
|
@@ -13,6 +13,8 @@ declare type CurrencyInputProps = Omit<BaseInputProps, 'labelHidden'> & {
|
|
|
13
13
|
decimalSeparator?: string;
|
|
14
14
|
/** scheidingsteken per duizend (default = '.') */
|
|
15
15
|
thousandsSeparator?: string;
|
|
16
|
+
/** altijd de centen tonen, ook als dat '0' is (default = true) */
|
|
17
|
+
alwaysShowCents?: boolean;
|
|
16
18
|
};
|
|
17
19
|
/**
|
|
18
20
|
* Maak een input van een tekst-type met optionele validation.
|
|
@@ -42,6 +44,6 @@ declare type CurrencyInputProps = Omit<BaseInputProps, 'labelHidden'> & {
|
|
|
42
44
|
* | onValueChanged() | `function` | | (value: string, valid?: boolean) => void |
|
|
43
45
|
* | onKeyDown() | `function` | | (event: React.KeyboardEvent) => void |
|
|
44
46
|
*/
|
|
45
|
-
declare function LbrCurrencyInput({ label, name, id, value, validation, errorMessage, size, textAlign, disabled, placeholder, keyboardType, tooltip, direction, onValueChanged, onKeyDown, decimalSeparator, ...props }: CurrencyInputProps): JSX.Element;
|
|
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;
|
|
46
48
|
export { LbrCurrencyInput as CurrencyInput };
|
|
47
49
|
export type { CurrencyInputProps };
|
|
@@ -8,5 +8,5 @@ declare type InputErrorProps = {
|
|
|
8
8
|
touched?: boolean;
|
|
9
9
|
};
|
|
10
10
|
/** Toon een erorr bij een input */
|
|
11
|
-
declare const InputError: (
|
|
11
|
+
declare const InputError: ({ stateError, outsideError, touched }: InputErrorProps) => JSX.Element | null;
|
|
12
12
|
export { InputError };
|
|
@@ -14,6 +14,6 @@ declare type useDebounceHookOptions = {
|
|
|
14
14
|
* @returns de waarde en een cancel-functie
|
|
15
15
|
* @example const { value, cancel } = useDebounce(value, { delay: 1000 });
|
|
16
16
|
*/
|
|
17
|
-
declare function useDebouncedValue<T =
|
|
17
|
+
declare function useDebouncedValue<T = unknown>(value: T, options?: useDebounceHookOptions): readonly [T, () => void];
|
|
18
18
|
export { useDebouncedValue };
|
|
19
19
|
export type { useDebounceHookOptions };
|
|
@@ -26,12 +26,12 @@ declare type UseLocalStoredStateFn<T = string> = {
|
|
|
26
26
|
* | deserialize | `function` | De functie die een string omzet naar de waarde. Implementeer als de waarde __GEEN__ gebruik kan maken van `JSON.parse()`! |
|
|
27
27
|
* @example
|
|
28
28
|
* import { useLocalStoredState } from 'loon-bulma-react';
|
|
29
|
-
* const
|
|
29
|
+
* const [ value, setValue, removeFromLocalStorage ] = useLocalStoredState({ key: 'myKey', initialValue: 'Oompa Loompa' });
|
|
30
30
|
* // 1. value is 'Oompa Loompa', put it somewhere on the screen
|
|
31
31
|
* // 2. change the value to something else
|
|
32
32
|
* // 3. refresh the page.
|
|
33
33
|
* // 4. see te new value on the page.
|
|
34
34
|
* // 5. you can also check the value in Local Storage in devtools.
|
|
35
35
|
*/
|
|
36
|
-
declare function useLocalStoredState<T
|
|
36
|
+
declare function useLocalStoredState<T extends unknown>({ key, initialValue, deserialize, serialize }: UseLocalStoredStateFn<T>): readonly [T | undefined, (value: T) => void, () => void];
|
|
37
37
|
export { useLocalStoredState, serializeJSON, deserializeJSON };
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @returns een state-toggle function
|
|
6
6
|
* @example const [state, toggle] = useToggle("yes", ["yes", "no"]);
|
|
7
7
|
*/
|
|
8
|
-
declare function useToggle<T>(initialState: T, options: [T, T]): readonly [T, (value?: T) => void];
|
|
8
|
+
declare function useToggle<T extends unknown>(initialState: T, options: [T, T]): readonly [T, (value?: T) => void];
|
|
9
9
|
/**
|
|
10
10
|
* useToggle voor booleans
|
|
11
11
|
* @param initialState initia
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* <input onChange={onChange} value={value} />
|
|
16
16
|
*/
|
|
17
|
-
export declare function useValidatedState<T>(initialValue?: T, validation?: (value?: T) => [boolean, string]): readonly [{
|
|
17
|
+
export declare function useValidatedState<T extends unknown>(initialValue?: T, validation?: (value?: T) => [boolean, string]): readonly [{
|
|
18
18
|
readonly value: T | undefined;
|
|
19
19
|
readonly lastValidValue: T | undefined;
|
|
20
20
|
readonly valid: boolean;
|