@webority/ui-react 0.9.14 → 0.9.15
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/types/components/AppAutocomplete.d.ts +1 -0
- package/dist/types/components/AppFileAttachment.d.ts +1 -1
- package/dist/types/components/AppFilePicker.d.ts +5 -3
- package/dist/types/components/AppMultiSelect.d.ts +1 -0
- package/dist/types/components/AppRepeater.d.ts +7 -1
- package/dist/types/components/toastStore.d.ts +6 -3
- package/dist/types/components/useWuiControl.d.ts +5 -10
- package/dist/ui-react.js +1060 -970
- package/package.json +3 -3
|
@@ -26,6 +26,7 @@ import "@webority/ui-elements";
|
|
|
26
26
|
* once picked, commits that raw text as the value with `onChange`'s second argument
|
|
27
27
|
* reporting `{ isCustom: true }`.
|
|
28
28
|
* @param {string} [props.name]
|
|
29
|
+
* @param {string} [props.id] DOM id for the control and the label's `for` target.
|
|
29
30
|
* @param {import('react').ReactNode} [props.label]
|
|
30
31
|
* @param {string} [props.error]
|
|
31
32
|
* @param {string} [props.hint]
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* @param {(file: File|null) => void | (files: File[]) => void} props.onChange single-mode → File|null; multiple → File[]
|
|
18
18
|
* @param {boolean} [props.multiple=false]
|
|
19
19
|
* @param {string} [props.accept] Defaults to images; pass e.g. "image/*,application/pdf" for mixed.
|
|
20
|
-
* @param {number} [props.maxSizeMb
|
|
20
|
+
* @param {number} [props.maxSizeMb] Defaults to the shared DEFAULT_MAX_SIZE_MB.
|
|
21
21
|
* @param {boolean} [props.optional=false]
|
|
22
22
|
* @param {string} [props.error]
|
|
23
23
|
* @param {string} [props.id]
|
|
@@ -11,19 +11,20 @@
|
|
|
11
11
|
* @param {object} props
|
|
12
12
|
* @param {string} [props.label]
|
|
13
13
|
* @param {File|{ url: string, name?: string }|Array<File|{ url: string, name?: string }>|null} [props.value]
|
|
14
|
-
* @param {string} [props.name] Form field name
|
|
14
|
+
* @param {string} [props.name] Form field name.
|
|
15
|
+
* @param {string} [props.id] DOM id for the file input and its labels' `for` target.
|
|
15
16
|
* @param {(file: File|null) => void | (files: File[]) => void} props.onPick single → File|null; multiple → File[]
|
|
16
17
|
* @param {boolean} [props.multiple=false]
|
|
17
18
|
* @param {number} [props.maxFiles] Cap on total files in multiple mode.
|
|
18
19
|
* @param {string} [props.accept=".jpg,.jpeg,.png"] Accepted file types (the `accept` attribute).
|
|
19
|
-
* @param {number} [props.maxSizeMb
|
|
20
|
+
* @param {number} [props.maxSizeMb] Defaults to the shared DEFAULT_MAX_SIZE_MB.
|
|
20
21
|
* @param {boolean} [props.required]
|
|
21
22
|
* @param {string} [props.error]
|
|
22
23
|
* @param {string} [props.className] Class to apply to the control element — the preview or dropzone shell.
|
|
23
24
|
* @param {string} [props.fieldClassName] Class to apply to the wrapper field div — e.g. a `file-w-*` width preset.
|
|
24
25
|
* @param {object} [props.style] Inline style; lands on the control with `className`.
|
|
25
26
|
*/
|
|
26
|
-
export default function AppFilePicker({ label, value, name, onPick, multiple, maxFiles, accept, maxSizeMb, required, error, className, fieldClassName, style, ...rest }: {
|
|
27
|
+
export default function AppFilePicker({ label, value, name, id, onPick, multiple, maxFiles, accept, maxSizeMb, required, error, className, fieldClassName, style, ...rest }: {
|
|
27
28
|
label?: string;
|
|
28
29
|
value?: File | {
|
|
29
30
|
url: string;
|
|
@@ -33,6 +34,7 @@ export default function AppFilePicker({ label, value, name, onPick, multiple, ma
|
|
|
33
34
|
name?: string;
|
|
34
35
|
}> | null;
|
|
35
36
|
name?: string;
|
|
37
|
+
id?: string;
|
|
36
38
|
onPick: (file: File | null) => void | ((files: File[]) => void);
|
|
37
39
|
multiple?: boolean;
|
|
38
40
|
maxFiles?: number;
|
|
@@ -16,6 +16,7 @@ import "@webority/ui-elements";
|
|
|
16
16
|
* @param {boolean} [props.collapseChips=false] Keep the chosen chips on one row and fold the
|
|
17
17
|
* overflow into a "+N" counter, rather than letting the control grow.
|
|
18
18
|
* @param {string} [props.name]
|
|
19
|
+
* @param {string} [props.id] DOM id for the control and the label's `for` target.
|
|
19
20
|
* @param {import('react').ReactNode} [props.label]
|
|
20
21
|
* @param {string} [props.error]
|
|
21
22
|
* @param {string} [props.hint]
|
|
@@ -13,6 +13,11 @@
|
|
|
13
13
|
* @param {object} props
|
|
14
14
|
* @param {{ id?: string|number }[]} props.rows
|
|
15
15
|
* @param {(row: object, index: number) => import('react').ReactNode} props.renderRow
|
|
16
|
+
* @param {(row: object, index: number) => import('react').ReactNode} [props.rowLabel] Optional
|
|
17
|
+
* per-row label shown in the row's top-left header band (opposite the remove control). Return a
|
|
18
|
+
* falsy value to leave a row unlabelled — the band is then kept only when the row is removable,
|
|
19
|
+
* as an empty gap that stops the fields overlapping the remove control. Razor's counterpart is
|
|
20
|
+
* `<app-repeater-row label="…">`.
|
|
16
21
|
* @param {() => void} props.onAdd
|
|
17
22
|
* @param {(index: number) => void} [props.onRemove] Omit to make rows non-removable.
|
|
18
23
|
* @param {string} [props.addLabel='Add another']
|
|
@@ -23,11 +28,12 @@
|
|
|
23
28
|
* @param {boolean} [props.numbered=true] Show the row index.
|
|
24
29
|
* @param {string} [props.className]
|
|
25
30
|
*/
|
|
26
|
-
export default function AppRepeater({ rows, renderRow, onAdd, onRemove, addLabel, removeLabel, emptyText, min, max, numbered, className, ...rest }: {
|
|
31
|
+
export default function AppRepeater({ rows, renderRow, rowLabel, onAdd, onRemove, addLabel, removeLabel, emptyText, min, max, numbered, className, ...rest }: {
|
|
27
32
|
rows: {
|
|
28
33
|
id?: string | number;
|
|
29
34
|
}[];
|
|
30
35
|
renderRow: (row: object, index: number) => import('react').ReactNode;
|
|
36
|
+
rowLabel?: (row: object, index: number) => import('react').ReactNode;
|
|
31
37
|
onAdd: () => void;
|
|
32
38
|
onRemove?: (index: number) => void;
|
|
33
39
|
addLabel?: string;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
/** Subscribe to the active-toast list. Calls back immediately, and returns an unsubscribe fn. */
|
|
2
|
-
export declare function subscribeToasts(listener: any): () =>
|
|
2
|
+
export declare function subscribeToasts(listener: any): () => void;
|
|
3
3
|
/**
|
|
4
4
|
* Raise a toast. De-duped by `variant:message` while one is still on screen, or by explicit `id`.
|
|
5
5
|
* When `opts.id` is provided, a toast with that id replaces any existing one (refresh/update).
|
|
6
|
-
* `duration` of 0 is sticky (no timer); any other duration
|
|
6
|
+
* `duration` of 0 is sticky (no timer); any other duration is covered by the store clock until
|
|
7
|
+
* a rendered ToastItem adopts the toast (see adoptToast) or by it permanently if none does.
|
|
7
8
|
* `message` may be a string or a React node (rich body); string-dedupe only applies to strings.
|
|
8
9
|
*/
|
|
9
10
|
export declare function pushToast(message: any, variant: any, opts?: {}): void;
|
|
10
|
-
/**
|
|
11
|
+
/** Hand a toast's dismissal over from the store clock to its rendered CSS countdown. */
|
|
12
|
+
export declare function adoptToast(id: any): void;
|
|
13
|
+
/** Remove a toast — its countdown ended, the store clock fired, or the user closed it. */
|
|
11
14
|
export declare function dismissToast(id: any): void;
|
|
12
15
|
/** Clear every toast at once — e.g. on route change or logout. No-op when already empty. */
|
|
13
16
|
export declare function dismissAllToasts(): void;
|
|
@@ -53,7 +53,8 @@ export default function useWuiControl({ ref, value, onChange, readValue, writeVa
|
|
|
53
53
|
innerRef: import('react').MutableRefObject<HTMLElement | null>;
|
|
54
54
|
};
|
|
55
55
|
/**
|
|
56
|
-
* Shallow
|
|
56
|
+
* Shallow equality for two option arrays, over each option object's own enumerable keys
|
|
57
|
+
* (value, label, icon, disabled — whatever the caller's option shape carries).
|
|
57
58
|
*
|
|
58
59
|
* The select/multiselect/autocomplete wrappers re-map their `options` prop into a fresh
|
|
59
60
|
* array every render (even when the caller's underlying data hasn't changed), and assigning
|
|
@@ -62,16 +63,10 @@ export default function useWuiControl({ ref, value, onChange, readValue, writeVa
|
|
|
62
63
|
* parent re-render. Comparing before assigning keeps the element's own array identity (and
|
|
63
64
|
* its open menu) whenever the option set is actually unchanged.
|
|
64
65
|
*
|
|
65
|
-
* @param {
|
|
66
|
-
* @param {
|
|
66
|
+
* @param {Record<string, unknown>[]} [next]
|
|
67
|
+
* @param {Record<string, unknown>[]} [cur]
|
|
67
68
|
*/
|
|
68
|
-
export declare function optionsEqual(next?:
|
|
69
|
-
value: unknown;
|
|
70
|
-
label: string;
|
|
71
|
-
}[], cur?: {
|
|
72
|
-
value: unknown;
|
|
73
|
-
label: string;
|
|
74
|
-
}[]): boolean;
|
|
69
|
+
export declare function optionsEqual(next?: Record<string, unknown>[], cur?: Record<string, unknown>[]): boolean;
|
|
75
70
|
/** Module-stable reader for multi-value elements (`el.values`). */
|
|
76
71
|
export declare function readValues(el: any): any;
|
|
77
72
|
/** Module-stable writer for multi-value elements — skips no-op array reassignment. */
|