@webority/ui-react 0.7.7 → 0.7.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/dist/types/components/AppAlert.d.ts +6 -2
- package/dist/types/components/AppConfirmDialog.d.ts +3 -1
- package/dist/types/components/AppInfoTip.d.ts +2 -1
- package/dist/types/components/AppPopover.d.ts +8 -4
- package/dist/types/components/AppShell.d.ts +6 -1
- package/dist/types/components/AppSwitch.d.ts +2 -0
- package/dist/types/components/AppTablePagination.d.ts +3 -1
- package/dist/types/components/AppToast.d.ts +17 -0
- package/dist/types/components/AppTooltip.d.ts +11 -2
- package/dist/types/components/AppWizard.d.ts +35 -0
- package/dist/types/components/AppWorkspaceSwitcher.d.ts +59 -0
- package/dist/types/components/toast.d.ts +2 -0
- package/dist/types/components/toastStore.d.ts +3 -0
- package/dist/types/components/useWuiControl.d.ts +17 -1
- package/dist/types/index.d.ts +4 -2
- package/dist/types/lib/CheckField.d.ts +6 -0
- package/dist/types/lib/emptyValue.d.ts +13 -0
- package/dist/ui-react.js +2603 -1996
- package/package.json +3 -3
- package/dist/types/components/AppToastContainer.d.ts +0 -17
|
@@ -5,15 +5,19 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @param {object} props
|
|
7
7
|
* @param {"info"|"success"|"warning"|"danger"} [props.variant="info"]
|
|
8
|
-
* @param {import('react').ReactNode} props.children
|
|
8
|
+
* @param {import('react').ReactNode} props.children The alert body.
|
|
9
|
+
* @param {import('react').ReactNode} [props.title] A bold heading line above the body (`.alert-heading`).
|
|
10
|
+
* @param {string|import('react').ReactNode} [props.icon] A leading glyph — a Bootstrap Icons name or a node.
|
|
9
11
|
* @param {string} [props.className]
|
|
10
12
|
* @param {() => void} [props.onClose] Called when dismissed
|
|
11
13
|
* @param {boolean} [props.dismissible] Show the close button (defaults to true when onClose is set)
|
|
12
14
|
* @param {"alert"|"status"} [props.role="alert"] Use "status" for non-assertive notices
|
|
13
15
|
*/
|
|
14
|
-
export default function AppAlert({ variant, children, className, onClose, dismissible, role, ...rest }: {
|
|
16
|
+
export default function AppAlert({ variant, children, title, icon, className, onClose, dismissible, role, ...rest }: {
|
|
15
17
|
variant?: "info" | "success" | "warning" | "danger";
|
|
16
18
|
children: import('react').ReactNode;
|
|
19
|
+
title?: import('react').ReactNode;
|
|
20
|
+
icon?: string | import('react').ReactNode;
|
|
17
21
|
className?: string;
|
|
18
22
|
onClose?: () => void;
|
|
19
23
|
dismissible?: boolean;
|
|
@@ -19,8 +19,9 @@
|
|
|
19
19
|
* click and Escape no longer close the dialog.
|
|
20
20
|
* @param {'center'|'top'} [props.placement='center'] Vertical placement of the card,
|
|
21
21
|
* forwarded to AppModal — centred (default) or pinned near the top.
|
|
22
|
+
* @param {string} [props.className] Merged with the dialog's own wui-confirm class.
|
|
22
23
|
*/
|
|
23
|
-
export default function AppConfirmDialog({ open, title, message, confirmLabel, cancelLabel, danger, tone, confirmPhrase, onConfirm, onClose, loading, staticBackdrop, placement, ...rest }: {
|
|
24
|
+
export default function AppConfirmDialog({ open, title, message, confirmLabel, cancelLabel, danger, tone, confirmPhrase, onConfirm, onClose, loading, staticBackdrop, placement, className, ...rest }: {
|
|
24
25
|
open: boolean;
|
|
25
26
|
title: string;
|
|
26
27
|
message?: import('react').ReactNode;
|
|
@@ -34,4 +35,5 @@ export default function AppConfirmDialog({ open, title, message, confirmLabel, c
|
|
|
34
35
|
loading?: boolean;
|
|
35
36
|
staticBackdrop?: boolean;
|
|
36
37
|
placement?: 'center' | 'top';
|
|
38
|
+
className?: string;
|
|
37
39
|
}): import("react").JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export default function AppInfoTip({ label, children, placement, ...rest }: {
|
|
1
|
+
export default function AppInfoTip({ label, children, placement, className, ...rest }: {
|
|
2
2
|
[x: string]: any;
|
|
3
3
|
children: any;
|
|
4
|
+
className?: string;
|
|
4
5
|
label: any;
|
|
5
6
|
placement?: string;
|
|
6
7
|
}): import("react").JSX.Element;
|
|
@@ -8,19 +8,23 @@
|
|
|
8
8
|
* @param {object} props
|
|
9
9
|
* @param {import('react').ReactElement} props.trigger The anchor element the panel opens from.
|
|
10
10
|
* Must be a single element that forwards a ref (a DOM element, or a react-bootstrap-based
|
|
11
|
-
* App* like AppButton/ActionIcon). It renders as written; clicking
|
|
11
|
+
* App* like AppButton/ActionIcon). It renders as written; clicking (or hovering/focusing) it
|
|
12
|
+
* toggles the panel.
|
|
12
13
|
* @param {import('react').ReactNode} props.children The panel body.
|
|
13
14
|
* @param {string} [props.title] Optional panel heading.
|
|
14
15
|
* @param {'top'|'bottom'|'start'|'end'|'auto'} [props.placement='bottom'] Where it opens; `auto`
|
|
15
16
|
* flips to stay in view.
|
|
16
|
-
* @param {'click'|'hover'|'focus'} [props.triggerType='click'] What
|
|
17
|
+
* @param {'click'|'hover'|'focus'|('click'|'hover'|'focus')[]} [props.triggerType='click'] What
|
|
18
|
+
* opens it; pass an array for multiple (e.g. ['hover', 'focus']).
|
|
19
|
+
* @param {(show: boolean) => void} [props.onToggle] Callback fired when the panel opens/closes.
|
|
17
20
|
* @param {string} [props.className] Class on the popover panel.
|
|
18
21
|
*/
|
|
19
|
-
export default function AppPopover({ trigger, children, title, placement, triggerType, className, ...rest }: {
|
|
22
|
+
export default function AppPopover({ trigger, children, title, placement, triggerType, onToggle, className, ...rest }: {
|
|
20
23
|
trigger: import('react').ReactElement;
|
|
21
24
|
children: import('react').ReactNode;
|
|
22
25
|
title?: string;
|
|
23
26
|
placement?: 'top' | 'bottom' | 'start' | 'end' | 'auto';
|
|
24
|
-
triggerType?: 'click' | 'hover' | 'focus';
|
|
27
|
+
triggerType?: 'click' | 'hover' | 'focus' | ('click' | 'hover' | 'focus')[];
|
|
28
|
+
onToggle?: (show: boolean) => void;
|
|
25
29
|
className?: string;
|
|
26
30
|
}): import("react").JSX.Element;
|
|
@@ -59,6 +59,10 @@ export type NavItemShape = {
|
|
|
59
59
|
* @param {import('react').ReactNode} [props.brand] The logo row at the top of the sidebar.
|
|
60
60
|
* @param {import('react').ReactNode} [props.sidebarStart] Between the brand row and the nav —
|
|
61
61
|
* a workspace/tenant switcher, an environment badge. Hidden on the collapsed rail.
|
|
62
|
+
* @param {import('react').ReactNode} [props.sidebarStartCompact] Same slot for the collapsed
|
|
63
|
+
* rail — typically a compact monogram control (e.g. `AppWorkspaceSwitcher compact`). Shown
|
|
64
|
+
* only on the desktop collapsed rail; the expanded `sidebarStart` stays hidden there. Omit
|
|
65
|
+
* to keep today's behaviour (nothing in that slot when collapsed).
|
|
62
66
|
* @param {import('react').ReactNode} [props.sidebarFooter] Pinned below the scrolling nav.
|
|
63
67
|
* @param {import('react').ReactNode} [props.topbarStart] Leading topbar slot — page title, crumbs.
|
|
64
68
|
* @param {import('react').ReactNode} [props.topbarEnd] Trailing topbar slot — search, account menu.
|
|
@@ -70,13 +74,14 @@ export type NavItemShape = {
|
|
|
70
74
|
* @param {string} [props.navLabel='Main navigation']
|
|
71
75
|
* @param {string} [props.className]
|
|
72
76
|
*/
|
|
73
|
-
export default function AppShell({ groups, brand, sidebarStart, sidebarFooter, topbarStart, topbarEnd, footer, children, collapsed, onCollapsedChange, noSidebar, navLabel, linkComponent: Link, className, ...rest }: {
|
|
77
|
+
export default function AppShell({ groups, brand, sidebarStart, sidebarStartCompact, sidebarFooter, topbarStart, topbarEnd, footer, children, collapsed, onCollapsedChange, noSidebar, navLabel, linkComponent: Link, className, ...rest }: {
|
|
74
78
|
groups: {
|
|
75
79
|
label?: string;
|
|
76
80
|
items: NavItemShape[];
|
|
77
81
|
}[];
|
|
78
82
|
brand?: import('react').ReactNode;
|
|
79
83
|
sidebarStart?: import('react').ReactNode;
|
|
84
|
+
sidebarStartCompact?: import('react').ReactNode;
|
|
80
85
|
sidebarFooter?: import('react').ReactNode;
|
|
81
86
|
topbarStart?: import('react').ReactNode;
|
|
82
87
|
topbarEnd?: import('react').ReactNode;
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
* @param {string} [props.name]
|
|
13
13
|
* @param {string} [props.error] Error message, rendered below the control. Replaces the hint.
|
|
14
14
|
* @param {string} [props.hint] Helper text below the control. Hidden while an error is shown.
|
|
15
|
+
* @param {'pill'|'circle'} [props.shape] Track shape — `pill` (default) is the sliding
|
|
16
|
+
* pill; `circle` is a compact round on/off button.
|
|
15
17
|
* @param {string} [props.className]
|
|
16
18
|
* @param {import('react').Ref<HTMLInputElement>} [ref]
|
|
17
19
|
*/
|
|
@@ -21,8 +21,9 @@
|
|
|
21
21
|
* any run of hidden pages — between the arrows.
|
|
22
22
|
* @param {boolean} [props.showPageSize=true] Show the "Rows per page" selector. Set false for a
|
|
23
23
|
* compact pager that pages but doesn't expose page size (e.g. a dense numbered table).
|
|
24
|
+
* @param {string} [props.className] Merged with the component's own table-pagination class.
|
|
24
25
|
*/
|
|
25
|
-
export default function AppTablePagination({ page, totalPages, pageSize, total, firstRow, lastRow, onPageChange, onPageSizeChange, pageSizes, mode, showPageSize, ...rest }: {
|
|
26
|
+
export default function AppTablePagination({ page, totalPages, pageSize, total, firstRow, lastRow, onPageChange, onPageSizeChange, pageSizes, mode, showPageSize, className, ...rest }: {
|
|
26
27
|
page: number;
|
|
27
28
|
totalPages: number;
|
|
28
29
|
pageSize: number;
|
|
@@ -34,4 +35,5 @@ export default function AppTablePagination({ page, totalPages, pageSize, total,
|
|
|
34
35
|
pageSizes?: number[];
|
|
35
36
|
mode?: 'prev-next' | 'numbered';
|
|
36
37
|
showPageSize?: boolean;
|
|
38
|
+
className?: string;
|
|
37
39
|
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mounts once near the app root and renders whatever toast()/errorToast() raise — surface cards
|
|
3
|
+
* with a variant accent + icon, an auto-dismiss progress bar (pauses on hover/focus), and
|
|
4
|
+
* swipe-to-dismiss. There is no toast library; the look is Bootstrap utilities + the shared theme.
|
|
5
|
+
* The Razor counterpart is <app-toast> + WUI.toast, kept structurally identical.
|
|
6
|
+
*
|
|
7
|
+
* Toast options (from toast()/errorToast()): title, duration (0 = sticky), action {label,onClick},
|
|
8
|
+
* id (replace/refresh), and a string OR React-node message (rich body).
|
|
9
|
+
*
|
|
10
|
+
* @param {object} props
|
|
11
|
+
* @param {'top-start'|'top-center'|'top-end'|'middle-center'|'bottom-start'|'bottom-center'|'bottom-end'} [props.position='bottom-end']
|
|
12
|
+
* @param {number} [props.maxVisible=4] Most toasts shown at once; older ones collapse to a "+N more" chip.
|
|
13
|
+
*/
|
|
14
|
+
export default function AppToast({ position, maxVisible }: {
|
|
15
|
+
position?: 'top-start' | 'top-center' | 'top-end' | 'middle-center' | 'bottom-start' | 'bottom-center' | 'bottom-end';
|
|
16
|
+
maxVisible?: number;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
@@ -11,11 +11,20 @@
|
|
|
11
11
|
* renders as written; hovering or focusing it reveals the tooltip.
|
|
12
12
|
* @param {'top'|'bottom'|'start'|'end'} [props.placement='top'] Where the tooltip appears;
|
|
13
13
|
* prefers the given direction, flips if needed to stay in view.
|
|
14
|
-
* @param {
|
|
14
|
+
* @param {'default'|'dark'|'primary'|'success'|'warning'|'danger'} [props.tone='default'] Preset
|
|
15
|
+
* colour of the tooltip. `default` is the light surface look; the others are solid tints. For
|
|
16
|
+
* a fully custom colour, pass a `className` whose rule sets the `--wui-tooltip-bg` /
|
|
17
|
+
* `--wui-tooltip-color` / `--wui-tooltip-border` / `--wui-tooltip-radius` CSS vars.
|
|
18
|
+
* @param {'sm'|'md'|'lg'} [props.size='md'] Preset size (font-size + padding + max-width). For a
|
|
19
|
+
* fully custom size, pass a `className` that sets the `--wui-tooltip-font-size` /
|
|
20
|
+
* `--wui-tooltip-padding-y` / `--wui-tooltip-padding-x` / `--wui-tooltip-max-width` CSS vars.
|
|
21
|
+
* @param {string} [props.className] Extra class on the tooltip element.
|
|
15
22
|
*/
|
|
16
|
-
export default function AppTooltip({ content, children, placement, className, ...rest }: {
|
|
23
|
+
export default function AppTooltip({ content, children, placement, tone, size, className, ...rest }: {
|
|
17
24
|
content: import('react').ReactNode;
|
|
18
25
|
children: import('react').ReactElement;
|
|
19
26
|
placement?: 'top' | 'bottom' | 'start' | 'end';
|
|
27
|
+
tone?: 'default' | 'dark' | 'primary' | 'success' | 'warning' | 'danger';
|
|
28
|
+
size?: 'sm' | 'md' | 'lg';
|
|
20
29
|
className?: string;
|
|
21
30
|
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import '@webority/ui-elements';
|
|
2
|
+
/**
|
|
3
|
+
* A multi-step flow over the shared `<wui-wizard>` element — a stepper progress
|
|
4
|
+
* header, one visible step panel at a time, and a sticky Back / Skip / Next / Finish
|
|
5
|
+
* footer. Give it `steps` metadata and one panel per step as children (in order).
|
|
6
|
+
*
|
|
7
|
+
* Uncontrolled by default (it owns the current step); pass `active` + `onStepChange`
|
|
8
|
+
* to drive it. `beforeNext` gates advancing — return `false` (or a rejecting promise)
|
|
9
|
+
* to block Next, e.g. until a form validates. An `optional` step shows the Skip button.
|
|
10
|
+
*
|
|
11
|
+
* @param {object} props
|
|
12
|
+
* @param {{ key?: string, label: string, description?: string, optional?: boolean, icon?: string, status?: 'done'|'active'|'pending'|'error' }[]} props.steps
|
|
13
|
+
* @param {import('react').ReactNode} props.children One panel per step, in step order.
|
|
14
|
+
* @param {number} [props.active] Controlled current-step index (with `onStepChange`).
|
|
15
|
+
* @param {number} [props.defaultActive=0] Initial step when uncontrolled.
|
|
16
|
+
* @param {(index: number, detail: { previous: number, reason: 'next'|'back'|'skip'|'step'|'set' }) => void} [props.onStepChange]
|
|
17
|
+
* @param {(detail: { index: number }) => void} [props.onFinish] Fired when Finish is pressed on the last step.
|
|
18
|
+
* @param {(index: number) => void} [props.onSkip] Fired when an optional step is skipped.
|
|
19
|
+
* @param {(index: number) => boolean | Promise<boolean>} [props.beforeNext] Validation gate run before advancing on Next — return false (or a rejecting promise) to block; the blocked step turns red.
|
|
20
|
+
* @param {(index: number) => void} [props.onInvalid] Fired when advancing is blocked by beforeNext (the step is marked invalid).
|
|
21
|
+
* @param {'steps'|'journey'|'icons'} [props.variant='steps'] Stepper header style — compact circles, the wide journey bar, or large connected icon badges with a "STEP n" eyebrow.
|
|
22
|
+
* @param {'primary'|'success'|'warning'|'danger'|'info'} [props.tone] Recolour the whole stepper accent (active fill, done rail, ring, done tint) to a semantic ramp. Unset keeps the variant's default (primary for steps/journey, success/green for icons). For any other colour, override the `--wui-step-accent` / `--wui-step-soft` CSS variables via `style` or a `className` instead.
|
|
23
|
+
* @param {'horizontal'|'vertical'} [props.orientation='horizontal']
|
|
24
|
+
* @param {boolean} [props.nonLinear=false] Allow jumping to any step, not only completed ones.
|
|
25
|
+
* @param {boolean} [props.hideStepper=false] Hide the progress header.
|
|
26
|
+
* @param {boolean} [props.disabled=false] Disable all navigation.
|
|
27
|
+
* @param {string} [props.label='Progress'] Accessible name for the stepper.
|
|
28
|
+
* @param {string} [props.backLabel='Back']
|
|
29
|
+
* @param {string} [props.nextLabel='Next']
|
|
30
|
+
* @param {string} [props.skipLabel='Skip']
|
|
31
|
+
* @param {string} [props.finishLabel='Finish']
|
|
32
|
+
* @param {string} [props.className]
|
|
33
|
+
*/
|
|
34
|
+
declare const AppWizard: import("react").ForwardRefExoticComponent<import("react").RefAttributes<any>>;
|
|
35
|
+
export default AppWizard;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tenant / workspace switcher — a react-bootstrap Dropdown wearing an identity card.
|
|
3
|
+
*
|
|
4
|
+
* Selection is a CALLBACK, never navigation: products own where a workspace switch goes
|
|
5
|
+
* (a route change, a reload, an API call), so `onSelect(tenant)` is all the library does.
|
|
6
|
+
* The footer action stays router-decoupled the same way `AppDropdown`/`AppBreadcrumbs` are —
|
|
7
|
+
* an `{ href }` renders through `linkComponent` when one is supplied, otherwise a plain
|
|
8
|
+
* anchor, and the library never imports a router.
|
|
9
|
+
*
|
|
10
|
+
* Tenant logos use `loading="lazy"` so a closed menu (renderOnMount) does not force every
|
|
11
|
+
* logo network fetch on first paint — the browser defers off-screen images.
|
|
12
|
+
*
|
|
13
|
+
* NOTE: the exported component must stay the FIRST destructured function in this file —
|
|
14
|
+
* the parity check reads the first signature it finds as the component's public props.
|
|
15
|
+
*
|
|
16
|
+
* @param {object} props
|
|
17
|
+
* @param {{ id: string, name: string, logoUrl?: string, badge?: string }[]} [props.tenants]
|
|
18
|
+
* The switchable workspaces. Razor composes the same list from `<app-workspace-option>` children.
|
|
19
|
+
* @param {string} [props.currentId] Id of the active workspace — drives the trigger and the tick.
|
|
20
|
+
* @param {(tenant: object) => void} [props.onSelect] Fired with the chosen tenant. No navigation.
|
|
21
|
+
* @param {string} [props.menuLabel] Optional header label above the list ("Workspaces").
|
|
22
|
+
* @param {import('react').ReactNode | { label: string, icon?: string, href?: string }} [props.footerAction]
|
|
23
|
+
* A pinned row under the list — a node rendered as-is, or a descriptor the library renders
|
|
24
|
+
* as a menu row (through `linkComponent` when it carries an `href`).
|
|
25
|
+
* @param {import('react').ElementType} [props.linkComponent] Component for `href` rows (e.g. Link).
|
|
26
|
+
* @param {boolean} [props.searchable=false] Client-side filter over the list. Only earns its
|
|
27
|
+
* place past roughly eight workspaces.
|
|
28
|
+
* @param {() => void} [props.onCreate] Fired by the create row.
|
|
29
|
+
* @param {boolean} [props.canCreate=false] Renders the create row. Hidden by default because
|
|
30
|
+
* most members cannot create a workspace.
|
|
31
|
+
* @param {string} [props.createLabel="Create workspace"] Copy for the create row.
|
|
32
|
+
* @param {boolean} [props.compact=false] Renders the 36px monogram button instead of the full
|
|
33
|
+
* card — the shape a collapsed rail slot wants. Same menu either way.
|
|
34
|
+
* @param {string} [props.ariaLabel] Accessible name for the trigger. Defaults to
|
|
35
|
+
* "Workspace <name>".
|
|
36
|
+
*/
|
|
37
|
+
export default function AppWorkspaceSwitcher({ tenants, currentId, onSelect, menuLabel, footerAction, linkComponent, searchable, onCreate, canCreate, createLabel, compact, ariaLabel, ...rest }: {
|
|
38
|
+
tenants?: {
|
|
39
|
+
id: string;
|
|
40
|
+
name: string;
|
|
41
|
+
logoUrl?: string;
|
|
42
|
+
badge?: string;
|
|
43
|
+
}[];
|
|
44
|
+
currentId?: string;
|
|
45
|
+
onSelect?: (tenant: object) => void;
|
|
46
|
+
menuLabel?: string;
|
|
47
|
+
footerAction?: import('react').ReactNode | {
|
|
48
|
+
label: string;
|
|
49
|
+
icon?: string;
|
|
50
|
+
href?: string;
|
|
51
|
+
};
|
|
52
|
+
linkComponent?: import('react').ElementType;
|
|
53
|
+
searchable?: boolean;
|
|
54
|
+
onCreate?: () => void;
|
|
55
|
+
canCreate?: boolean;
|
|
56
|
+
createLabel?: string;
|
|
57
|
+
compact?: boolean;
|
|
58
|
+
ariaLabel?: string;
|
|
59
|
+
}): import("react").JSX.Element;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/** Clear every toast at once — e.g. on route change or logout. */
|
|
2
|
+
export declare function dismissAll(): void;
|
|
1
3
|
export declare function toast(message: any, variantOrOptions?: string): void;
|
|
2
4
|
export declare namespace toast {
|
|
3
5
|
var promise: (promise: Promise<any>, messages: object, opts?: object) => Promise<any>;
|
|
@@ -4,7 +4,10 @@ export declare function subscribeToasts(listener: any): () => boolean;
|
|
|
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
6
|
* `duration` of 0 is sticky (no timer); any other duration schedules its own expiry here.
|
|
7
|
+
* `message` may be a string or a React node (rich body); string-dedupe only applies to strings.
|
|
7
8
|
*/
|
|
8
9
|
export declare function pushToast(message: any, variant: any, opts?: {}): void;
|
|
9
10
|
/** Remove a toast — its auto-dismiss timer fired, or the user closed it. */
|
|
10
11
|
export declare function dismissToast(id: any): void;
|
|
12
|
+
/** Clear every toast at once — e.g. on route change or logout. No-op when already empty. */
|
|
13
|
+
export declare function dismissAllToasts(): void;
|
|
@@ -18,16 +18,21 @@
|
|
|
18
18
|
* (default: `el => el.value`). Dual-thumb / multi-select wrappers pass a custom reader.
|
|
19
19
|
* @param {(el: HTMLElement, value: unknown) => void} [opts.writeValue] How to write the
|
|
20
20
|
* controlled value (default: `el.value = value ?? ''`).
|
|
21
|
+
* @param {string[]} [opts.events=['change']] DOM events that call onChange. Use
|
|
22
|
+
* `['input','change']` for controls that fire `input` live and `change` only on commit
|
|
23
|
+
* (phone) so React controlled state stays current; values are de-duped so both events in
|
|
24
|
+
* one gesture do not double-call with the same value.
|
|
21
25
|
* @param {unknown[]} [opts.syncDeps] Extra deps that should re-run the write effect
|
|
22
26
|
* (rarely needed — prefer baking state into `value`).
|
|
23
27
|
* @returns {{ setRef: (el: HTMLElement | null) => void, innerRef: import('react').MutableRefObject<HTMLElement | null> }}
|
|
24
28
|
*/
|
|
25
|
-
export default function useWuiControl({ ref, value, onChange, readValue, writeValue, syncDeps, }?: {
|
|
29
|
+
export default function useWuiControl({ ref, value, onChange, readValue, writeValue, events, syncDeps, }?: {
|
|
26
30
|
ref?: import('react').Ref<HTMLElement>;
|
|
27
31
|
value?: unknown;
|
|
28
32
|
onChange?: (value: unknown) => void;
|
|
29
33
|
readValue?: (el: HTMLElement) => unknown;
|
|
30
34
|
writeValue?: (el: HTMLElement, value: unknown) => void;
|
|
35
|
+
events?: string[];
|
|
31
36
|
syncDeps?: unknown[];
|
|
32
37
|
}): {
|
|
33
38
|
setRef: (el: HTMLElement | null) => void;
|
|
@@ -53,3 +58,14 @@ export declare function optionsEqual(next?: {
|
|
|
53
58
|
value: unknown;
|
|
54
59
|
label: string;
|
|
55
60
|
}[]): boolean;
|
|
61
|
+
/** Module-stable reader for multi-value elements (`el.values`). */
|
|
62
|
+
export declare function readValues(el: any): any;
|
|
63
|
+
/** Module-stable writer for multi-value elements — skips no-op array reassignment. */
|
|
64
|
+
export declare function writeValues(el: any, next: any): void;
|
|
65
|
+
/** Module-stable range reader for dual-thumb sliders. */
|
|
66
|
+
export declare function readRange(el: any): {
|
|
67
|
+
start: any;
|
|
68
|
+
end: any;
|
|
69
|
+
};
|
|
70
|
+
/** Module-stable single-thumb numeric writer. */
|
|
71
|
+
export declare function writeNumberValue(el: any, v: any): void;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -71,10 +71,12 @@ export { default as AppTagInput } from './components/AppTagInput.jsx';
|
|
|
71
71
|
export { default as AppTextarea } from './components/AppTextarea.jsx';
|
|
72
72
|
export { default as AppTimeline } from './components/AppTimeline.jsx';
|
|
73
73
|
export { default as AppTimePicker } from './components/AppTimePicker.jsx';
|
|
74
|
-
export { default as AppToastContainer } from './components/
|
|
74
|
+
export { default as AppToast, default as AppToastContainer } from './components/AppToast.jsx';
|
|
75
75
|
export { default as AppTooltip } from './components/AppTooltip.jsx';
|
|
76
|
+
export { default as AppWizard } from './components/AppWizard.jsx';
|
|
77
|
+
export { default as AppWorkspaceSwitcher } from './components/AppWorkspaceSwitcher.jsx';
|
|
76
78
|
export { default as Icon, iconNames, registerIcons } from './components/Icon.jsx';
|
|
77
79
|
export { MODAL_ICONS } from './components/ModalIcons.jsx';
|
|
78
80
|
export { default as RequiredMark } from './components/RequiredMark.jsx';
|
|
79
|
-
export { errorToast, toast } from './components/toast.js';
|
|
81
|
+
export { dismissAll, errorToast, toast } from './components/toast.js';
|
|
80
82
|
export { usePagination } from './lib/usePagination.js';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check if a value is considered empty (null, undefined, or empty string).
|
|
3
|
+
* @param {*} value
|
|
4
|
+
* @returns {boolean}
|
|
5
|
+
*/
|
|
6
|
+
export declare function isEmpty(value: any): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Get the display value for a potentially empty field.
|
|
9
|
+
* Returns an em-dash for empty values, otherwise returns the value as-is.
|
|
10
|
+
* @param {*} value
|
|
11
|
+
* @returns {string|*}
|
|
12
|
+
*/
|
|
13
|
+
export declare function emptyValue(value: any): string | any;
|