@abpjs/ui 0.2.0-next.3 → 0.2.0-next.31
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/CHANGELOG.md +285 -0
- package/dist/agent.d.ts +742 -0
- package/dist/agent.js +2136 -0
- package/dist/agent.js.map +1 -0
- package/dist/ai.d.ts +6 -3
- package/dist/ai.js +34 -12
- package/dist/ai.js.map +1 -1
- package/dist/guard.d.ts +1678 -0
- package/dist/guard.js +3831 -0
- package/dist/guard.js.map +1 -0
- package/dist/index.d.ts +550 -37
- package/dist/index.js +3021 -1348
- package/dist/index.js.map +1 -1
- package/dist/rules.d.ts +23 -1
- package/dist/rules.js +35 -0
- package/dist/rules.js.map +1 -1
- package/package.json +14 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _chakra_ui_react from '@chakra-ui/react';
|
|
2
2
|
import { SystemConfig, SystemContext, LinkProps, HTMLChakraProps, SystemStyleObject, chakra, ButtonProps as ButtonProps$1, IconButtonProps as IconButtonProps$1, TableRowProps, Checkbox, Field as Field$1, NativeSelect, Switch, Alert, BoxProps as BoxProps$1, InputProps, Tooltip as Tooltip$1 } from '@chakra-ui/react';
|
|
3
3
|
import * as react from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { ReactNode, ComponentType, ElementType, AnchorHTMLAttributes, ComponentProps, RefObject, ReactElement } from 'react';
|
|
5
5
|
import { ThemeProviderProps } from 'next-themes';
|
|
6
6
|
import { Announcements } from '@dnd-kit/core';
|
|
7
7
|
import * as _ark_ui_react from '@ark-ui/react';
|
|
@@ -68,6 +68,15 @@ interface AbpLabels {
|
|
|
68
68
|
close: string;
|
|
69
69
|
cancel: string;
|
|
70
70
|
confirm: string;
|
|
71
|
+
/** A confirm that needs a word typed first (deleting a project), `{value}` being the word. Optional: English by default. */
|
|
72
|
+
typeToConfirm?: string;
|
|
73
|
+
/** A wide form dialog's aside, what the form makes as it's filled in. Optional: English by default. */
|
|
74
|
+
preview?: string;
|
|
75
|
+
/** A page edited in place with unsaved changes (`SaveBar`): its question, the waiting changes (`{count}`, ICU plural), Discard and Save. Optional: English by default. */
|
|
76
|
+
saveBar?: string;
|
|
77
|
+
unsavedChanges?: string;
|
|
78
|
+
discard?: string;
|
|
79
|
+
save?: string;
|
|
71
80
|
retry: string;
|
|
72
81
|
loading: string;
|
|
73
82
|
noData: string;
|
|
@@ -90,7 +99,43 @@ interface AbpLabels {
|
|
|
90
99
|
/** Above a form with wrong fields, `{count}` of them (ICU plural). */
|
|
91
100
|
formFix: string;
|
|
92
101
|
queryList: QueryListLabels;
|
|
102
|
+
translations: TranslationsLabels;
|
|
103
|
+
picker: PickerLabels;
|
|
104
|
+
}
|
|
105
|
+
/** Strings of SearchPicker, PersonPicker and GroupPicker. `{count}` is filled in (ICU plural). */
|
|
106
|
+
interface PickerLabels {
|
|
107
|
+
placeholder: string;
|
|
108
|
+
searching: string;
|
|
109
|
+
noMatches: string;
|
|
110
|
+
/** Nothing to offer when nothing can be searched. */
|
|
111
|
+
noKnown: string;
|
|
112
|
+
/** Above the options: how many match what's typed. */
|
|
113
|
+
matches: string;
|
|
114
|
+
/** Above the options when there are more than shown. */
|
|
115
|
+
firstMatches: string;
|
|
116
|
+
searchPeople: string;
|
|
117
|
+
/** A person picker with no search: the people on the page. */
|
|
118
|
+
choosePerson: string;
|
|
119
|
+
noPeople: string;
|
|
120
|
+
noKnownPeople: string;
|
|
121
|
+
searchGroups: string;
|
|
122
|
+
noGroups: string;
|
|
123
|
+
}
|
|
124
|
+
declare const defaultPickerLabels: PickerLabels;
|
|
125
|
+
/** Strings of TranslatedInput. {name}, {filled}, {total}, {shown} are filled in by the component. */
|
|
126
|
+
interface TranslationsLabels {
|
|
127
|
+
/** Above the other languages' fields. */
|
|
128
|
+
title: string;
|
|
129
|
+
/** The button that opens them, for a screen reader. */
|
|
130
|
+
open: string;
|
|
131
|
+
/** The button's tooltip. */
|
|
132
|
+
count: string;
|
|
133
|
+
/** Under a language left empty: which name shows instead. */
|
|
134
|
+
missing: string;
|
|
135
|
+
/** The list of names already translated. */
|
|
136
|
+
suggestions: string;
|
|
93
137
|
}
|
|
138
|
+
declare const defaultTranslationsLabels: TranslationsLabels;
|
|
94
139
|
/** Strings of QueryableList. {name} placeholders are filled in by the component. */
|
|
95
140
|
interface QueryListLabels {
|
|
96
141
|
savedView: string;
|
|
@@ -173,6 +218,8 @@ interface QueryListLabels {
|
|
|
173
218
|
/** The pagination's name, and a page button's: "Page {page}". */
|
|
174
219
|
pages: string;
|
|
175
220
|
page: string;
|
|
221
|
+
/** The compact pagination's "Page {page} of {pages}". */
|
|
222
|
+
pageOf: string;
|
|
176
223
|
empty: string;
|
|
177
224
|
export: string;
|
|
178
225
|
exportCsv: string;
|
|
@@ -191,8 +238,30 @@ interface QueryListLabels {
|
|
|
191
238
|
}
|
|
192
239
|
declare const defaultQueryListLabels: QueryListLabels;
|
|
193
240
|
declare const defaultLabels: AbpLabels;
|
|
241
|
+
/**
|
|
242
|
+
* The labels a host gives: any of them, and any of a group's (the query list's, the pickers', the translations'); the
|
|
243
|
+
* rest are the defaults, so a group the package adds later needs nothing from a host that doesn't use it.
|
|
244
|
+
*/
|
|
245
|
+
type AbpLabelsInput = Partial<Omit<AbpLabels, 'queryList' | 'translations' | 'picker'>> & {
|
|
246
|
+
queryList?: Partial<QueryListLabels>;
|
|
247
|
+
translations?: Partial<TranslationsLabels>;
|
|
248
|
+
picker?: Partial<PickerLabels>;
|
|
249
|
+
};
|
|
194
250
|
declare function useAbpLabels(): AbpLabels;
|
|
195
251
|
|
|
252
|
+
/** A framework's hook for HTML to put in the page's head while it streams (Next's `useServerInsertedHTML`). */
|
|
253
|
+
type ServerInsertedHTML = (callback: () => ReactNode) => void;
|
|
254
|
+
/**
|
|
255
|
+
* Emotion's styles in the page's head on the server, so the first render matches the client's. Without it, a style
|
|
256
|
+
* Emotion writes during the server render (Chakra's global styles) lands inside the body where the client expects
|
|
257
|
+
* something else (next-themes' script), and React's hydration fails. The framework's hook comes from the host, so the
|
|
258
|
+
* package names no framework.
|
|
259
|
+
*/
|
|
260
|
+
declare function EmotionRegistry({ useServerInsertedHTML, children }: {
|
|
261
|
+
useServerInsertedHTML: ServerInsertedHTML;
|
|
262
|
+
children: ReactNode;
|
|
263
|
+
}): react.JSX.Element;
|
|
264
|
+
|
|
196
265
|
/**
|
|
197
266
|
* An answer the server refused, in ABP's error shape (`{ error: { code, message, details, validationErrors } }`), or
|
|
198
267
|
* a problem's title, or the status. Read as JSON whatever the content type says, as file routes answer refusals so.
|
|
@@ -218,6 +287,37 @@ declare function readAbpError(res: Response): Promise<AbpApiError>;
|
|
|
218
287
|
/** An error as a person reads it. */
|
|
219
288
|
declare function errorText(e: unknown): string;
|
|
220
289
|
declare const isStepUp: (e: unknown) => boolean;
|
|
290
|
+
/** A strong step-up asked of someone with no strong factor yet (AbpGuard 0.7.0): they set one up, then step up. */
|
|
291
|
+
declare const STRONG_FACTOR_REQUIRED = "strong_factor_required";
|
|
292
|
+
/** A refusal the step-up dialog answers: a step-up, or a strong factor to set up first. */
|
|
293
|
+
declare const needsStepUp: (e: unknown) => e is AbpApiError;
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* What the server asked for (AbpGuard 0.7.0, ADR 0110 in the application it came from): a step-up at a level, with the
|
|
297
|
+
* person's ways best first, or a strong factor they don't have yet. Older servers send no level: the password level.
|
|
298
|
+
*/
|
|
299
|
+
interface StepUpNeed {
|
|
300
|
+
/** `step_up_required`, or `strong_factor_required` when a strong step-up is asked of someone with no strong factor. */
|
|
301
|
+
code: string;
|
|
302
|
+
/** `password` (the password, with a code of a second factor when the person has one) or `strong` (a passkey, or the password and an authenticator code). */
|
|
303
|
+
level: 'password' | 'strong';
|
|
304
|
+
category: string | null;
|
|
305
|
+
/** The person's ways at that level, best first: `passkey`, `app`, `password`, `email`… Empty when the server doesn't say. */
|
|
306
|
+
methods: string[];
|
|
307
|
+
/** An authenticator code alone passes (the operator's setting, AbpGuard's `appCodeAlone`); else it goes with the password. */
|
|
308
|
+
appCodeAlone: boolean;
|
|
309
|
+
}
|
|
310
|
+
/** What asks the person to confirm who they are: true once confirmed (or a strong factor set up), false if they gave up. */
|
|
311
|
+
type StepUpHandler = (need: StepUpNeed) => Promise<boolean>;
|
|
312
|
+
/** The step-up dialog registers itself here (`StepUpDialog`, drawn by `AbpProvider`); null when it goes. */
|
|
313
|
+
declare function setStepUpHandler(next: StepUpHandler | null): void;
|
|
314
|
+
/** The need an error carries: its code, and the level and methods in its data. */
|
|
315
|
+
declare function stepUpNeedOf(code: string, data: Record<string, unknown> | null | undefined): StepUpNeed;
|
|
316
|
+
/**
|
|
317
|
+
* Asks the person to confirm who they are, once however many calls are waiting for it (ADR 0109 amendment). False when
|
|
318
|
+
* nothing is registered to ask with: the call then fails with the server's refusal, as it would without.
|
|
319
|
+
*/
|
|
320
|
+
declare function requestStepUp(need?: StepUpNeed): Promise<boolean>;
|
|
221
321
|
|
|
222
322
|
/** What a call sends: its method, a JSON body (or FormData as is), headers, and a way to stop it. */
|
|
223
323
|
interface HostRequestInit {
|
|
@@ -227,6 +327,8 @@ interface HostRequestInit {
|
|
|
227
327
|
signal?: AbortSignal;
|
|
228
328
|
/** The answer as a file (a Blob and the name Content-Disposition gives) rather than JSON. */
|
|
229
329
|
as?: 'json' | 'file';
|
|
330
|
+
/** False: a refusal that asks for a step-up is thrown, not asked (the step-up dialog's own calls). */
|
|
331
|
+
stepUp?: false;
|
|
230
332
|
}
|
|
231
333
|
/** A file the server answered with. */
|
|
232
334
|
interface HostFile {
|
|
@@ -250,7 +352,7 @@ interface HostRequestOptions {
|
|
|
250
352
|
* A 403 `step_up_required`: the host confirms the person again; true retries the call once. By default the step-up
|
|
251
353
|
* dialog `AbpProvider` draws asks (`requestStepUp`), and without one the call fails as the server answered.
|
|
252
354
|
*/
|
|
253
|
-
stepUp?: () => Promise<boolean>;
|
|
355
|
+
stepUp?: (need: StepUpNeed) => Promise<boolean>;
|
|
254
356
|
/** More headers on every call (a development user, a tenant). */
|
|
255
357
|
headers?: () => Record<string, string>;
|
|
256
358
|
fetch?: typeof fetch;
|
|
@@ -276,7 +378,7 @@ type HostEvents = (path: string, onEvent: HostEventHandler, options?: {
|
|
|
276
378
|
}) => Promise<string | null>;
|
|
277
379
|
/** Reads a response's server-sent events to its end. */
|
|
278
380
|
declare function readEvents(res: Response, onEvent: HostEventHandler): Promise<void>;
|
|
279
|
-
/** Server-sent events for a host without its own reader: same origin, its headers, a 401 handed back,
|
|
381
|
+
/** Server-sent events for a host without its own reader: same origin, its headers, a 401 handed back, a step-up (the dialog's by default). */
|
|
280
382
|
declare function createHostEvents(options?: Pick<HostRequestOptions, 'onUnauthorized' | 'stepUp' | 'headers' | 'fetch'>): HostEvents;
|
|
281
383
|
|
|
282
384
|
/** A scope as a host knows it: a project, an org unit. */
|
|
@@ -290,9 +392,18 @@ interface HostScope {
|
|
|
290
392
|
/** One of the site's languages, for names by language. */
|
|
291
393
|
interface HostLanguage {
|
|
292
394
|
code: string;
|
|
395
|
+
/** Its name in itself ("العربية"). */
|
|
293
396
|
name: string;
|
|
397
|
+
/** Its name in English, shown beside `name` where they differ. */
|
|
398
|
+
englishName?: string;
|
|
294
399
|
direction?: 'ltr' | 'rtl';
|
|
295
400
|
}
|
|
401
|
+
/** A name someone already translated (a text of the host's, a setting's name): every language at once. */
|
|
402
|
+
interface NameSuggestion {
|
|
403
|
+
names: Record<string, string>;
|
|
404
|
+
/** Where it comes from, as the host words it ("Status · FIN"). */
|
|
405
|
+
source?: string;
|
|
406
|
+
}
|
|
296
407
|
/**
|
|
297
408
|
* What a host gives the screens (ADR 0109 amendment): how to call its server, where each package's API is, how to
|
|
298
409
|
* move, what the person may do, its scopes and people, its languages, its words for any text, and the slots it fills.
|
|
@@ -321,6 +432,8 @@ interface AbpHost {
|
|
|
321
432
|
names?: (accountIds: string[]) => Promise<Record<string, string>>;
|
|
322
433
|
/** The site's languages, the first the default. */
|
|
323
434
|
languages?: HostLanguage[];
|
|
435
|
+
/** Names already translated that start with what's typed, so a name is translated the same way everywhere. */
|
|
436
|
+
suggestNames?: (text: string, signal: AbortSignal) => Promise<NameSuggestion[]>;
|
|
324
437
|
/** The host's words for any area's text, by area then language then key: `{ ai: { en: { 'models.title': 'AI models' } } }`. */
|
|
325
438
|
texts?: Record<string, Record<string, Record<string, string>>>;
|
|
326
439
|
/**
|
|
@@ -415,7 +528,7 @@ interface AbpProviderProps {
|
|
|
415
528
|
/** BCP 47 locale ("en", "ar"). Sets direction for every component, portals included. */
|
|
416
529
|
locale?: string;
|
|
417
530
|
/** Translated strings for the components' own text (close, cancel, sort ...). */
|
|
418
|
-
labels?:
|
|
531
|
+
labels?: AbpLabelsInput;
|
|
419
532
|
/** The host router's link component (next/link in the shell). */
|
|
420
533
|
linkComponent?: LinkComponent;
|
|
421
534
|
/** Initial colour mode when the user has not chosen one. */
|
|
@@ -428,6 +541,12 @@ interface AbpProviderProps {
|
|
|
428
541
|
timeZone?: string;
|
|
429
542
|
/** How much the interface moves for the person (ADR 0058); as their system says when it's not given. */
|
|
430
543
|
motion?: MotionSetting;
|
|
544
|
+
/**
|
|
545
|
+
* The framework's hook for HTML in the page's head while it streams (Next's `useServerInsertedHTML`): with it, Emotion's
|
|
546
|
+
* styles go there on the server, so the first render hydrates without a mismatch. A host that renders on the client
|
|
547
|
+
* only leaves it out.
|
|
548
|
+
*/
|
|
549
|
+
useServerInsertedHTML?: ServerInsertedHTML;
|
|
431
550
|
}
|
|
432
551
|
/**
|
|
433
552
|
* Chakra (with the host's system), colour mode (next-themes, class on <html>), locale and
|
|
@@ -436,7 +555,7 @@ interface AbpProviderProps {
|
|
|
436
555
|
*
|
|
437
556
|
* The host must also set `<html lang dir>` and `suppressHydrationWarning` on <html>.
|
|
438
557
|
*/
|
|
439
|
-
declare function AbpProvider({ children,
|
|
558
|
+
declare function AbpProvider({ children, useServerInsertedHTML, ...props }: AbpProviderProps): react.JSX.Element;
|
|
440
559
|
|
|
441
560
|
type ColorMode = 'light' | 'dark';
|
|
442
561
|
/** next-themes, configured the way Chakra v3 expects: a `light`/`dark` class on <html>. */
|
|
@@ -451,6 +570,226 @@ declare function ColorModeToggle({ size }: {
|
|
|
451
570
|
size?: 'xs' | 'sm' | 'md';
|
|
452
571
|
}): react.JSX.Element;
|
|
453
572
|
|
|
573
|
+
type NamesValue = Record<string, string>;
|
|
574
|
+
interface TranslatedInputProps {
|
|
575
|
+
/** Names by language code. */
|
|
576
|
+
value: NamesValue;
|
|
577
|
+
onChange: (value: NamesValue) => void;
|
|
578
|
+
/** Shown when nothing is given in a language, and the last resort for what shows (usually the object's key). */
|
|
579
|
+
fallback?: string;
|
|
580
|
+
'aria-label'?: string;
|
|
581
|
+
placeholder?: string;
|
|
582
|
+
size?: 'xs' | 'sm' | 'md';
|
|
583
|
+
disabled?: boolean;
|
|
584
|
+
autoFocus?: boolean;
|
|
585
|
+
onBlur?: () => void;
|
|
586
|
+
/** Offer names already translated while typing (the host's `suggestNames`; default on where the host has it). */
|
|
587
|
+
suggest?: boolean;
|
|
588
|
+
}
|
|
589
|
+
/**
|
|
590
|
+
* A name in every language the site offers (the host's `languages`): the reader's language inline, the others behind a
|
|
591
|
+
* button that shows how many are filled in. Each language is typed in its own direction, and one left empty says which
|
|
592
|
+
* name shows instead. Where the host offers names already translated (`suggestNames`), typing lists them, and picking
|
|
593
|
+
* one fills in every language at once, so a name is translated the same way everywhere. A host with no languages gets
|
|
594
|
+
* one field.
|
|
595
|
+
*/
|
|
596
|
+
declare function TranslatedInput({ value, onChange, fallback, 'aria-label': ariaLabel, placeholder, size, disabled, autoFocus, onBlur, suggest, }: TranslatedInputProps): react.JSX.Element;
|
|
597
|
+
|
|
598
|
+
/** What a list shows: a page of rows, sorted and narrowed (ADR 0109 amendment). */
|
|
599
|
+
interface ListQuery {
|
|
600
|
+
/** From 1. */
|
|
601
|
+
page: number;
|
|
602
|
+
pageSize: number;
|
|
603
|
+
/** A column's id and its direction; null for the list's own order. */
|
|
604
|
+
sort: {
|
|
605
|
+
columnId: string;
|
|
606
|
+
direction: 'asc' | 'desc';
|
|
607
|
+
} | null;
|
|
608
|
+
/** What's typed in the list's search. */
|
|
609
|
+
search: string;
|
|
610
|
+
/** The list's other filters by name (a status, a directory); an empty value is no filter. */
|
|
611
|
+
filters: Record<string, string>;
|
|
612
|
+
}
|
|
613
|
+
/** A page of a list: its rows and how many there are in all. */
|
|
614
|
+
interface ListPage<T> {
|
|
615
|
+
items: T[];
|
|
616
|
+
total: number;
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* Where a list's rows come from: the server package's own paging, or the host's (its query engine), which a host gives
|
|
620
|
+
* an area in place of the package's. `key` names what it lists: a different key is a different list, read afresh.
|
|
621
|
+
*/
|
|
622
|
+
interface ListSource<T> {
|
|
623
|
+
key: string;
|
|
624
|
+
load: (query: ListQuery, signal: AbortSignal) => Promise<ListPage<T>>;
|
|
625
|
+
}
|
|
626
|
+
declare const DEFAULT_PAGE_SIZE = 25;
|
|
627
|
+
declare function emptyQuery(initial?: Partial<ListQuery>): ListQuery;
|
|
628
|
+
/** How a list's query maps onto a server's: the search's parameter, and each sortable column's field. */
|
|
629
|
+
interface AbpListOptions {
|
|
630
|
+
/** The parameter the search goes in (ABP's lists: `filter`). */
|
|
631
|
+
searchParam?: string;
|
|
632
|
+
/** A column's id to the server's field for `sorting`; a column not here sorts by its id. */
|
|
633
|
+
sortFields?: Record<string, string>;
|
|
634
|
+
/** Parameters every page asks with (a fixed scope, a kind). */
|
|
635
|
+
fixed?: Record<string, string>;
|
|
636
|
+
}
|
|
637
|
+
/** ABP's paging parameters for a query: `skipCount`, `maxResultCount`, `sorting` ("username desc"), the search and filters. */
|
|
638
|
+
declare function abpListParams(query: ListQuery, options?: AbpListOptions): URLSearchParams;
|
|
639
|
+
/** A list served in ABP's shape (`PagedAndSortedResultRequestDto` in, `{ totalCount, items }` out) at a path. */
|
|
640
|
+
declare function abpListSource<T>(request: HostRequest, path: string, options?: AbpListOptions): ListSource<T>;
|
|
641
|
+
/** How many pages a list has (at least one). */
|
|
642
|
+
declare const pageCount: (total: number, pageSize: number) => number;
|
|
643
|
+
|
|
644
|
+
interface ListState<T> {
|
|
645
|
+
/** The list's place: its page, size, sort, filters, and what's typed in its search (asked once typing settles). */
|
|
646
|
+
query: ListQuery;
|
|
647
|
+
/** The page's rows; undefined until the first page comes. */
|
|
648
|
+
rows: T[] | undefined;
|
|
649
|
+
total: number;
|
|
650
|
+
pages: number;
|
|
651
|
+
/** The first page is coming. */
|
|
652
|
+
loading: boolean;
|
|
653
|
+
/** Another page or a new search is coming: the rows shown are the last ones until it does. */
|
|
654
|
+
refreshing: boolean;
|
|
655
|
+
error: string | null;
|
|
656
|
+
setSearch: (search: string) => void;
|
|
657
|
+
/** One filter by name; null or '' removes it. */
|
|
658
|
+
setFilter: (name: string, value: string | null) => void;
|
|
659
|
+
setSort: (sort: ListQuery['sort']) => void;
|
|
660
|
+
setPage: (page: number) => void;
|
|
661
|
+
setPageSize: (pageSize: number) => void;
|
|
662
|
+
/** Reads the page again (after a change made elsewhere). */
|
|
663
|
+
reload: () => void;
|
|
664
|
+
/** For `DataTable`: the rows, the first load's placeholders, the error, and the sort, which the source applies. */
|
|
665
|
+
table: {
|
|
666
|
+
rows: T[] | undefined;
|
|
667
|
+
loading: boolean;
|
|
668
|
+
error: string | null;
|
|
669
|
+
sort: ListQuery['sort'];
|
|
670
|
+
onSortChange: (sort: ListQuery['sort']) => void;
|
|
671
|
+
sortMode: 'manual';
|
|
672
|
+
};
|
|
673
|
+
/** For `Pagination`: the page and how many. */
|
|
674
|
+
pagination: {
|
|
675
|
+
page: number;
|
|
676
|
+
pages: number;
|
|
677
|
+
onPage: (page: number) => void;
|
|
678
|
+
};
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* A list's page, search, filters and sort, read from its source (ADR 0109 amendment): a change of search, filters, sort
|
|
682
|
+
* or page size goes back to the first page; typing waits `searchDelay` ms; only the latest answer counts; a different
|
|
683
|
+
* source (its `key`) starts empty. `onQueryChange` hears every change, for a screen that keeps the list's place in its
|
|
684
|
+
* address.
|
|
685
|
+
*/
|
|
686
|
+
declare function useListState<T>(source: ListSource<T>, options?: {
|
|
687
|
+
initial?: Partial<ListQuery>;
|
|
688
|
+
searchDelay?: number;
|
|
689
|
+
onQueryChange?: (query: ListQuery) => void;
|
|
690
|
+
}): ListState<T>;
|
|
691
|
+
/** An area's list served in ABP's shape at a path on this host (`/accounts/page`): the same source while the path is. */
|
|
692
|
+
declare function useAreaListSource<T>(area: string, path: string, options?: AbpListOptions): ListSource<T>;
|
|
693
|
+
|
|
694
|
+
/**
|
|
695
|
+
* How a pagination reads (UI round 10, step 73): `simple` (the default for lists: which rows of how many, then previous
|
|
696
|
+
* and next; people narrow a long list with search and filters, not by jumping to a page), `numbered` (the pages
|
|
697
|
+
* themselves, for long reports) or `compact` ("Page 3 of 200" between previous and next, for narrow places).
|
|
698
|
+
*/
|
|
699
|
+
type PaginationForm = 'simple' | 'numbered' | 'compact';
|
|
700
|
+
/** The page buttons a form shows between its arrows: only the numbered form has any. */
|
|
701
|
+
declare function pagesShown(form: PaginationForm, page: number, pages: number): (number | 'gap')[];
|
|
702
|
+
/**
|
|
703
|
+
* The pages a pagination shows (UI round 9, step 67): the first and the last, the current one and its neighbours, and
|
|
704
|
+
* near either end the first or last four, in order, with 'gap' where pages are left out.
|
|
705
|
+
*/
|
|
706
|
+
declare function pageList(page: number, pages: number): (number | 'gap')[];
|
|
707
|
+
|
|
708
|
+
/**
|
|
709
|
+
* A paged list's foot (`useListState`): which rows of how many show ("26–50 of 112") and the way to the others, in the
|
|
710
|
+
* labels' `queryList` words. `form` is `Pagination`'s, `simple` when left out (the range, then previous and next,
|
|
711
|
+
* centred); `numbered` puts the pages at the start and the range at the end. Nothing until the first page comes, or
|
|
712
|
+
* when the list is empty.
|
|
713
|
+
*/
|
|
714
|
+
declare function ListFooter<T>({ list, form }: {
|
|
715
|
+
list: ListState<T>;
|
|
716
|
+
form?: PaginationForm;
|
|
717
|
+
}): react.JSX.Element | null;
|
|
718
|
+
|
|
719
|
+
/** A value that follows another once it has stood still for `ms` (what's typed in a search box, before it asks). */
|
|
720
|
+
declare function useSettledValue<T>(value: T, ms?: number): T;
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* A text with the part matching what was typed in bold, every match, ignoring case; as it was when nothing is typed or
|
|
724
|
+
* nothing matches.
|
|
725
|
+
*/
|
|
726
|
+
declare function Highlight({ text, query }: {
|
|
727
|
+
text: string;
|
|
728
|
+
query: string;
|
|
729
|
+
}): react.JSX.Element;
|
|
730
|
+
interface SearchPickerMessages {
|
|
731
|
+
placeholder: string;
|
|
732
|
+
searching: string;
|
|
733
|
+
noMatches: string;
|
|
734
|
+
noKnown: string;
|
|
735
|
+
/** Under the list when nothing can be searched and only `known` is offered. */
|
|
736
|
+
limitedHint?: string;
|
|
737
|
+
}
|
|
738
|
+
interface SearchPickerProps<T> {
|
|
739
|
+
value: T | null;
|
|
740
|
+
onChange: (item: T | null) => void;
|
|
741
|
+
/** Searches as the person types; null when there's nothing to search, and only `known` is offered. */
|
|
742
|
+
search: ((text: string) => Promise<T[]>) | null;
|
|
743
|
+
/** Items to offer without searching (people on the page…), filtered by the text typed. */
|
|
744
|
+
known?: T[];
|
|
745
|
+
getId: (item: T) => string;
|
|
746
|
+
/** The text the input shows for the chosen item, and what typing filters `known` by. */
|
|
747
|
+
label: (item: T) => string;
|
|
748
|
+
/** How an option reads in the list (with what's typed, to bold its match: `Highlight`); the label, its match bold, by default. */
|
|
749
|
+
renderOption?: (item: T, query: string) => ReactNode;
|
|
750
|
+
/**
|
|
751
|
+
* Making a new item from the text typed, offered last when no option is called just that ("Add “Acme” as a new
|
|
752
|
+
* vendor"); it resolves with the item made, which is then picked, or null when it wasn't.
|
|
753
|
+
*/
|
|
754
|
+
create?: {
|
|
755
|
+
label: (text: string) => string;
|
|
756
|
+
onCreate: (text: string) => Promise<T | null>;
|
|
757
|
+
};
|
|
758
|
+
/** Offer an empty choice ("Unassigned"). */
|
|
759
|
+
clearLabel?: string;
|
|
760
|
+
/** With nothing picked, the closed input shows the placeholder rather than the empty choice's words. */
|
|
761
|
+
emptyShowsPlaceholder?: boolean;
|
|
762
|
+
/** The picker's words; the labels' `picker` defaults where not given. */
|
|
763
|
+
messages?: Partial<SearchPickerMessages>;
|
|
764
|
+
disabled?: boolean;
|
|
765
|
+
size?: 'sm' | 'md';
|
|
766
|
+
'aria-label'?: string;
|
|
767
|
+
id?: string;
|
|
768
|
+
}
|
|
769
|
+
/** One item picked from a searchable list: an ARIA combobox with keyboard support. */
|
|
770
|
+
declare function SearchPicker<T>({ value, onChange, search, known, getId, label, renderOption, create, clearLabel, emptyShowsPlaceholder, messages: own, disabled, size, id, 'aria-label': ariaLabel, }: SearchPickerProps<T>): react.JSX.Element;
|
|
771
|
+
/** A person to pick: an account's id, username and name, and whether it's an agent's. */
|
|
772
|
+
interface PickerPerson {
|
|
773
|
+
id: string;
|
|
774
|
+
username: string;
|
|
775
|
+
displayName?: string | null;
|
|
776
|
+
}
|
|
777
|
+
/** A group (a team) to pick. */
|
|
778
|
+
interface PickerGroup {
|
|
779
|
+
id: string;
|
|
780
|
+
name: string;
|
|
781
|
+
}
|
|
782
|
+
declare const personLabel: (p: PickerPerson | null | undefined) => string;
|
|
783
|
+
/**
|
|
784
|
+
* Picks one person: their name and @username, searched by `search` (the area's call, or the host's); without one, the
|
|
785
|
+
* people already `known` on the page. `badge` marks a person where the host has something to say (an agent's account).
|
|
786
|
+
*/
|
|
787
|
+
declare function PersonPicker<P extends PickerPerson>({ badge, messages, ...rest }: Omit<SearchPickerProps<P>, 'getId' | 'label' | 'renderOption'> & {
|
|
788
|
+
badge?: (person: P) => ReactNode;
|
|
789
|
+
}): react.JSX.Element;
|
|
790
|
+
/** Picks one group, searched by `search` (the area's call, or the host's). */
|
|
791
|
+
declare function GroupPicker<G extends PickerGroup>({ messages, ...rest }: Omit<SearchPickerProps<G>, 'getId' | 'label'>): react.JSX.Element;
|
|
792
|
+
|
|
454
793
|
type Direction = 'ltr' | 'rtl';
|
|
455
794
|
/** Text direction for a BCP 47 locale ("ar", "ar-SA" -> rtl). */
|
|
456
795
|
declare function directionOf(locale: string): Direction;
|
|
@@ -884,12 +1223,19 @@ interface PaginationProps {
|
|
|
884
1223
|
/** A page button's name: "Page 4". */
|
|
885
1224
|
pageLabel: (page: number) => string;
|
|
886
1225
|
disabled?: boolean;
|
|
1226
|
+
/** How it reads; `numbered` when left out (step 67's pages). */
|
|
1227
|
+
form?: PaginationForm;
|
|
1228
|
+
/** Which rows of how many ("26–50 of 112"), drawn before the arrows in the simple form. */
|
|
1229
|
+
range?: string;
|
|
1230
|
+
/** "Page 3 of 200", drawn between the arrows in the compact form. */
|
|
1231
|
+
pageOf?: string;
|
|
887
1232
|
}
|
|
888
1233
|
/**
|
|
889
|
-
* Pages of a list, centred under it (the canvas's v12
|
|
890
|
-
* ones around the current one (gaps as "…"), next
|
|
1234
|
+
* Pages of a list, centred under it (the canvas's v12). Numbered (UI round 9 step 67): previous, the first and last pages
|
|
1235
|
+
* and the ones around the current one (gaps as "…"), next, the current page filled. Simple (round 10 step 73): the
|
|
1236
|
+
* range, then previous and next. Compact: "Page 3 of 200" between them. One page: only the simple form's range, if any.
|
|
891
1237
|
*/
|
|
892
|
-
declare function Pagination({ page, pages, onPage, label, previous, next, pageLabel, disabled }: PaginationProps): react.JSX.Element | null;
|
|
1238
|
+
declare function Pagination({ page, pages, onPage, label, previous, next, pageLabel, disabled, form, range, pageOf }: PaginationProps): react.JSX.Element | null;
|
|
893
1239
|
|
|
894
1240
|
interface CommandItem {
|
|
895
1241
|
id: string;
|
|
@@ -933,12 +1279,6 @@ declare function HighlightText({ text, query }: {
|
|
|
933
1279
|
*/
|
|
934
1280
|
declare function CommandPalette({ open, onOpenChange, search, labels }: CommandPaletteProps): react.JSX.Element;
|
|
935
1281
|
|
|
936
|
-
/**
|
|
937
|
-
* The pages a pagination shows (UI round 9, step 67): the first and the last, the current one and its neighbours, and
|
|
938
|
-
* near either end the first or last four, in order, with 'gap' where pages are left out.
|
|
939
|
-
*/
|
|
940
|
-
declare function pageList(page: number, pages: number): (number | 'gap')[];
|
|
941
|
-
|
|
942
1282
|
interface AvatarPerson {
|
|
943
1283
|
id: string;
|
|
944
1284
|
name: string;
|
|
@@ -979,9 +1319,10 @@ declare function AvatarStack({ 'aria-label': ariaLabel, people, max, moreLabel,
|
|
|
979
1319
|
* secondary every other action (outlined neutral); the default
|
|
980
1320
|
* ghost low-emphasis actions in toolbars and table rows
|
|
981
1321
|
* link inline text action
|
|
1322
|
+
* cancel every Cancel (a dialog's, a form's, a composer's): one quiet gray fill, no border
|
|
982
1323
|
* `danger` turns any of them red for destructive actions.
|
|
983
1324
|
*/
|
|
984
|
-
type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'link';
|
|
1325
|
+
type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'link' | 'cancel';
|
|
985
1326
|
type ButtonSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
986
1327
|
interface AbpButtonProps {
|
|
987
1328
|
variant?: ButtonVariant;
|
|
@@ -994,14 +1335,57 @@ type ButtonProps = Omit<ButtonProps$1, 'variant' | 'size' | 'colorPalette'> & Ab
|
|
|
994
1335
|
* `loading` is Chakra's: an action is running.
|
|
995
1336
|
*/
|
|
996
1337
|
declare const Button: react.ForwardRefExoticComponent<Omit<ButtonProps$1, "colorPalette" | "size" | "variant"> & AbpButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1338
|
+
type AddButtonProps = Omit<ButtonProps, 'variant' | 'danger'>;
|
|
1339
|
+
/**
|
|
1340
|
+
* The one look for every add action (Add filter, Add column, Add condition, Add member, a create row): link-coloured
|
|
1341
|
+
* bold text after a plus, no fill, no border, no chevron, underlined on hover. A page's one main action stays a
|
|
1342
|
+
* `primary` Button; this is for the adds inside a page, a panel or a dialog.
|
|
1343
|
+
*/
|
|
1344
|
+
declare const AddButton: react.ForwardRefExoticComponent<AddButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
997
1345
|
type IconButtonProps = Omit<IconButtonProps$1, 'variant' | 'size' | 'colorPalette'> & AbpButtonProps & {
|
|
998
1346
|
'aria-label': string;
|
|
1347
|
+
/** Removing something from a list or a form (not deleting it): gray at rest, red only on hover. */
|
|
1348
|
+
remove?: boolean;
|
|
999
1349
|
};
|
|
1000
|
-
/**
|
|
1350
|
+
/**
|
|
1351
|
+
* Square icon-only button. `aria-label` is required; it is also shown as the native tooltip. A delete (trash) icon is
|
|
1352
|
+
* `danger`, red at all times; taking a row out of a list is `remove`, gray until hovered.
|
|
1353
|
+
*/
|
|
1001
1354
|
declare const IconButton: react.ForwardRefExoticComponent<Omit<IconButtonProps$1, "colorPalette" | "size" | "variant"> & AbpButtonProps & {
|
|
1002
1355
|
'aria-label': string;
|
|
1356
|
+
/** Removing something from a list or a form (not deleting it): gray at rest, red only on hover. */
|
|
1357
|
+
remove?: boolean;
|
|
1003
1358
|
} & react.RefAttributes<HTMLButtonElement>>;
|
|
1004
1359
|
|
|
1360
|
+
/** One thing a row's ⋯ menu can do. */
|
|
1361
|
+
interface RowMenuItem {
|
|
1362
|
+
id: string;
|
|
1363
|
+
label: ReactNode;
|
|
1364
|
+
icon?: ReactNode;
|
|
1365
|
+
onSelect?: () => void;
|
|
1366
|
+
/** Red text and icon: delete, and other acts that can't be taken back. */
|
|
1367
|
+
danger?: boolean;
|
|
1368
|
+
/** Shown but not chosen: the person may not do it here (say why in a `note`). */
|
|
1369
|
+
disabled?: boolean;
|
|
1370
|
+
}
|
|
1371
|
+
/** An entry of a row's menu: an item, a line between groups, or a quiet note (why some items are off). */
|
|
1372
|
+
type RowMenuEntry = RowMenuItem | {
|
|
1373
|
+
separator: true;
|
|
1374
|
+
} | {
|
|
1375
|
+
note: ReactNode;
|
|
1376
|
+
};
|
|
1377
|
+
interface RowMenuProps {
|
|
1378
|
+
/** The trigger's name, with the row in it ("More for Finance"). */
|
|
1379
|
+
label: string;
|
|
1380
|
+
items: RowMenuEntry[];
|
|
1381
|
+
size?: 'xs' | 'sm';
|
|
1382
|
+
}
|
|
1383
|
+
/**
|
|
1384
|
+
* A row's ⋯ menu (the design canvas's row menu): Open, Star, Edit, then Archive and a red Delete apart. Items the
|
|
1385
|
+
* person may not use stay listed, turned off, with a note saying who can.
|
|
1386
|
+
*/
|
|
1387
|
+
declare function RowMenu({ label, items, size }: RowMenuProps): react.JSX.Element;
|
|
1388
|
+
|
|
1005
1389
|
interface ConfirmOptions {
|
|
1006
1390
|
title: ReactNode;
|
|
1007
1391
|
description?: ReactNode;
|
|
@@ -1009,6 +1393,11 @@ interface ConfirmOptions {
|
|
|
1009
1393
|
cancelLabel?: ReactNode;
|
|
1010
1394
|
/** Red confirm button for destructive actions. */
|
|
1011
1395
|
danger?: boolean;
|
|
1396
|
+
/**
|
|
1397
|
+
* A word the person types before the confirm turns on (a project's key, to delete it): for acts that can't be taken
|
|
1398
|
+
* back and reach a lot. Matched exactly, ignoring spaces around it.
|
|
1399
|
+
*/
|
|
1400
|
+
typeToConfirm?: string;
|
|
1012
1401
|
}
|
|
1013
1402
|
interface ConfirmDialogProps extends ConfirmOptions {
|
|
1014
1403
|
open: boolean;
|
|
@@ -1018,7 +1407,7 @@ interface ConfirmDialogProps extends ConfirmOptions {
|
|
|
1018
1407
|
busy?: boolean;
|
|
1019
1408
|
}
|
|
1020
1409
|
/** An alert dialog asking the user to confirm an action. Focus starts on Cancel. */
|
|
1021
|
-
declare function ConfirmDialog({ open, onOpenChange, onConfirm, busy, title, description, confirmLabel, cancelLabel, danger, }: ConfirmDialogProps): react.JSX.Element;
|
|
1410
|
+
declare function ConfirmDialog({ open, onOpenChange, onConfirm, busy, title, description, confirmLabel, cancelLabel, danger, typeToConfirm, }: ConfirmDialogProps): react.JSX.Element;
|
|
1022
1411
|
type ConfirmFn = (options: ConfirmOptions) => Promise<boolean>;
|
|
1023
1412
|
/** Provides `useConfirm()`. AbpProvider renders it; you rarely need it directly. */
|
|
1024
1413
|
declare function ConfirmProvider({ children }: {
|
|
@@ -1339,6 +1728,32 @@ declare function CategoryProgress({ todo, inProgress, done, size, loading: own,
|
|
|
1339
1728
|
*/
|
|
1340
1729
|
declare const DirectionalIcon: _chakra_ui_react.ChakraComponent<"span", {}>;
|
|
1341
1730
|
|
|
1731
|
+
/**
|
|
1732
|
+
* The empty state's drawings (the design canvas's EmptyState): a page-level illustration of the feature the empty page
|
|
1733
|
+
* belongs to, and small flat pieces of art for empty lists in panels and settings. Both are decorative (aria-hidden),
|
|
1734
|
+
* abstract (no numbers, no names) and static, and draw only with the theme's tokens, so they follow the host's brand
|
|
1735
|
+
* and the colour mode.
|
|
1736
|
+
*/
|
|
1737
|
+
/** The feature an empty page belongs to; it picks the three cards. */
|
|
1738
|
+
type EmptyIllustration = 'records' | 'board' | 'views' | 'dashboards' | 'dashboard' | 'reports' | 'calendar' | 'timeline' | 'gantt' | 'backlog' | 'queue' | 'comments' | 'files';
|
|
1739
|
+
/**
|
|
1740
|
+
* The page-level illustration. `searching` adds a small search mark (nothing matches); `compact` shows the middle card
|
|
1741
|
+
* alone. The drawing is laid out left to right in either direction: it is a picture, not text.
|
|
1742
|
+
*/
|
|
1743
|
+
declare function PageIllustration({ of, searching, scale }: {
|
|
1744
|
+
of: EmptyIllustration;
|
|
1745
|
+
searching?: boolean;
|
|
1746
|
+
scale?: number;
|
|
1747
|
+
}): react.JSX.Element;
|
|
1748
|
+
/** Small drawings in place of the icon: first use, no results, all done, nothing new, away, agents, couldn't load. */
|
|
1749
|
+
type EmptyArt = 'records' | 'search' | 'done' | 'bell' | 'handover' | 'agent' | 'error';
|
|
1750
|
+
/** One of the small drawings, `width` × `height` (its viewBox is 120 × 96). */
|
|
1751
|
+
declare function EmptyArtDrawing({ art, width, height }: {
|
|
1752
|
+
art: EmptyArt;
|
|
1753
|
+
width: string;
|
|
1754
|
+
height: string;
|
|
1755
|
+
}): react.JSX.Element;
|
|
1756
|
+
|
|
1342
1757
|
interface EmptyStateProps {
|
|
1343
1758
|
title: ReactNode;
|
|
1344
1759
|
description?: ReactNode;
|
|
@@ -1361,9 +1776,21 @@ interface EmptyStateProps {
|
|
|
1361
1776
|
size?: 'xs' | 'sm' | 'md';
|
|
1362
1777
|
/** Its drawing's colour: `neutral` (the default, calm), `accent` (a place that invites a first step) or `danger`. */
|
|
1363
1778
|
tone?: 'neutral' | 'accent' | 'danger';
|
|
1779
|
+
/**
|
|
1780
|
+
* `page`: the whole main content of a page is empty (no records yet, a dashboard with no widgets, nothing matches on
|
|
1781
|
+
* the whole page). It draws `illustration`, the feature the page is about, in place of the icon. Leave it out
|
|
1782
|
+
* everywhere else (panels, columns, widgets, sections), and errors never get it.
|
|
1783
|
+
*/
|
|
1784
|
+
variant?: 'page';
|
|
1785
|
+
/** With `variant="page"`: what the empty page is about. Defaults to `records`. */
|
|
1786
|
+
illustration?: EmptyIllustration;
|
|
1787
|
+
/** A small flat drawing in place of the icon, for an empty list in a panel or a settings card. */
|
|
1788
|
+
art?: EmptyArt;
|
|
1789
|
+
/** `inline`: the drawing, the words and the action on one line, on a quiet surface (an empty list inside a settings card). */
|
|
1790
|
+
layout?: 'inline';
|
|
1364
1791
|
}
|
|
1365
1792
|
/** What a list, table or page shows when there is nothing in it: a calm drawing, what's missing, what to do, and a way on. */
|
|
1366
|
-
declare function EmptyState({ title, description, icon, action, secondaryAction, kind, size, tone: own }: EmptyStateProps): react.JSX.Element;
|
|
1793
|
+
declare function EmptyState({ title, description, icon, action, secondaryAction, kind, size, tone: own, variant, illustration, art, layout, }: EmptyStateProps): react.JSX.Element;
|
|
1367
1794
|
|
|
1368
1795
|
interface AttentionChipProps {
|
|
1369
1796
|
count: number;
|
|
@@ -1520,27 +1947,39 @@ declare function useSlotSaves(): {
|
|
|
1520
1947
|
run: () => Promise<void>;
|
|
1521
1948
|
};
|
|
1522
1949
|
|
|
1523
|
-
/** What asks the person to confirm who they are: true once confirmed, false if they gave up. */
|
|
1524
|
-
type StepUpHandler = () => Promise<boolean>;
|
|
1525
|
-
/** The step-up dialog registers itself here (`StepUpDialog`, drawn by `AbpProvider`); null when it goes. */
|
|
1526
|
-
declare function setStepUpHandler(next: StepUpHandler | null): void;
|
|
1527
|
-
/**
|
|
1528
|
-
* Asks the person to confirm who they are, once however many calls are waiting for it (ADR 0109 amendment). False when
|
|
1529
|
-
* nothing is registered to ask with: the call then fails with the server's `step_up_required`, as it would without.
|
|
1530
|
-
*/
|
|
1531
|
-
declare function requestStepUp(): Promise<boolean>;
|
|
1532
|
-
|
|
1533
1950
|
/** Whether what was typed can be a code yet: six digits (spaces between are fine), or a recovery code's ten characters. */
|
|
1534
1951
|
declare function looksLikeCode(value: string, recovery: boolean): boolean;
|
|
1535
1952
|
/**
|
|
1536
|
-
*
|
|
1537
|
-
*
|
|
1538
|
-
*
|
|
1539
|
-
* the
|
|
1540
|
-
*
|
|
1953
|
+
* Confirms the person before a sensitive action (ADR 0109 amendment, on AbpGuard's step-up): the server answers 403
|
|
1954
|
+
* `step_up_required`, the host's request asks here, and the call is tried again once confirmed.
|
|
1955
|
+
*
|
|
1956
|
+
* - At the password level: the password, and a code of their second factor when they have one (their app, a recovery
|
|
1957
|
+
* code, or one the site sends).
|
|
1958
|
+
* - At the strong level (AbpGuard 0.7.0): a passkey first when they have one, or an authenticator code: alone where the
|
|
1959
|
+
* server says one passes alone (`appCodeAlone`, the operator's setting), else with the password. Where a code passes
|
|
1960
|
+
* alone it's offered at the password level too.
|
|
1961
|
+
* - Asked for a strong step-up with no strong factor (`strong_factor_required`): the password, then setting up a passkey
|
|
1962
|
+
* or the app here (with recovery codes, shown once, for a first factor); the call then asks again, and they confirm
|
|
1963
|
+
* with what they set up.
|
|
1964
|
+
*
|
|
1965
|
+
* Too many wrong passwords end the session (401), which the host's request hands to the host. `AbpProvider` draws it
|
|
1966
|
+
* when the host gives `paths.guard`; a host with its own dialog sets `stepUpDialog: false`.
|
|
1541
1967
|
*/
|
|
1542
1968
|
declare function StepUpDialog(): react.JSX.Element;
|
|
1543
1969
|
|
|
1970
|
+
/**
|
|
1971
|
+
* Passkeys in the browser (WebAuthn), in the browser's own JSON both ways, as AbpGuard 0.7.0 speaks it: the options come
|
|
1972
|
+
* as `PublicKeyCredentialCreationOptionsJSON` / `PublicKeyCredentialRequestOptionsJSON`, and the answer goes back as the
|
|
1973
|
+
* credential's `toJSON()`. Browsers without the JSON methods get the same through base64url here.
|
|
1974
|
+
*/
|
|
1975
|
+
type Json = Record<string, unknown>;
|
|
1976
|
+
/** Whether this browser can use passkeys at all (a secure page with WebAuthn). */
|
|
1977
|
+
declare function passkeysSupported(): boolean;
|
|
1978
|
+
/** Makes a passkey on this device from the server's creation options; null when the person cancelled. */
|
|
1979
|
+
declare function createPasskey(options: Json, signal?: AbortSignal): Promise<Json | null>;
|
|
1980
|
+
/** Proves a passkey from the server's request options; null when the person cancelled or had none here. */
|
|
1981
|
+
declare function getPasskey(options: Json, signal?: AbortSignal): Promise<Json | null>;
|
|
1982
|
+
|
|
1544
1983
|
/**
|
|
1545
1984
|
* A text with its values filled, in the subset of ICU message syntax the screens' texts use: `{name}`, plurals
|
|
1546
1985
|
* (`{count, plural, =0 {none} one {# item} other {# items}}`, with Arabic's zero, two, few and many) and choices
|
|
@@ -1569,11 +2008,28 @@ interface FormDialogProps {
|
|
|
1569
2008
|
onSubmit: () => void | Promise<void>;
|
|
1570
2009
|
busy?: boolean;
|
|
1571
2010
|
error?: string | null;
|
|
1572
|
-
|
|
2011
|
+
/** `wide` is the two-pane dialog with a preview: 920 px, the fields beside what they make. */
|
|
2012
|
+
size?: 'sm' | 'md' | 'lg' | 'xl' | 'wide';
|
|
1573
2013
|
/** No submit button (the form inside has its own, e.g. a plugin's create view). */
|
|
1574
2014
|
hideSubmit?: boolean;
|
|
1575
2015
|
/** The submit button is off until what the form needs is filled in. */
|
|
1576
2016
|
submitDisabled?: boolean;
|
|
2017
|
+
/**
|
|
2018
|
+
* What the form makes, drawn as it's filled in (a `PreviewCard`, usually): an aside at the end side beside the fields,
|
|
2019
|
+
* under them below `md`. With it the dialog is `wide` unless a size is given.
|
|
2020
|
+
*/
|
|
2021
|
+
preview?: ReactNode;
|
|
2022
|
+
/** The aside's heading: the `preview` label ("Preview") unless given. */
|
|
2023
|
+
previewTitle?: ReactNode;
|
|
2024
|
+
/**
|
|
2025
|
+
* A destructive action at the footer's start, as a red link (Delete account). It doesn't submit the form; asking
|
|
2026
|
+
* whether they're sure is the caller's (a `ConfirmDialog`).
|
|
2027
|
+
*/
|
|
2028
|
+
dangerAction?: {
|
|
2029
|
+
label: ReactNode;
|
|
2030
|
+
onClick: () => void;
|
|
2031
|
+
disabled?: boolean;
|
|
2032
|
+
};
|
|
1577
2033
|
children: ReactNode;
|
|
1578
2034
|
}
|
|
1579
2035
|
/**
|
|
@@ -1581,7 +2037,48 @@ interface FormDialogProps {
|
|
|
1581
2037
|
* and empty, or not in its shape) is marked when the person leaves it, not while they type; submitting with any wrong
|
|
1582
2038
|
* lists them at the top, each a link to its field, and sends nothing.
|
|
1583
2039
|
*/
|
|
1584
|
-
declare function FormDialog({ open, onOpenChange, title, description, submitLabel, onSubmit, busy, error, size, hideSubmit, submitDisabled, children }: FormDialogProps): react.JSX.Element;
|
|
2040
|
+
declare function FormDialog({ open, onOpenChange, title, description, submitLabel, onSubmit, busy, error, size, hideSubmit, submitDisabled, preview, previewTitle, dangerAction, children, }: FormDialogProps): react.JSX.Element;
|
|
2041
|
+
interface PreviewCardProps {
|
|
2042
|
+
/** An avatar or the thing's tile, at the start of the card's head. */
|
|
2043
|
+
media?: ReactNode;
|
|
2044
|
+
/** Its name, as typed so far. */
|
|
2045
|
+
title: ReactNode;
|
|
2046
|
+
/** A line under the name: a username or a key, which may be a `RecordKey`. */
|
|
2047
|
+
subtitle?: ReactNode;
|
|
2048
|
+
/** Its values, label then value; an empty value shows as the empty mark. */
|
|
2049
|
+
items?: {
|
|
2050
|
+
label: ReactNode;
|
|
2051
|
+
value?: ReactNode;
|
|
2052
|
+
}[];
|
|
2053
|
+
}
|
|
2054
|
+
/** What a form makes, in a `FormDialog`'s preview: a head (media, name, sub-line) and its values in a list. */
|
|
2055
|
+
declare function PreviewCard({ media, title, subtitle, items }: PreviewCardProps): react.JSX.Element;
|
|
2056
|
+
|
|
2057
|
+
interface SaveBarProps {
|
|
2058
|
+
/** Whether there's something to save: the bar rises at the foot of the window while there is, and goes when not. */
|
|
2059
|
+
open: boolean;
|
|
2060
|
+
onSave: () => void;
|
|
2061
|
+
/** Puts the form back as it was saved. */
|
|
2062
|
+
onDiscard: () => void;
|
|
2063
|
+
/** How many changes wait, for the line under the question ("1 change isn't saved yet"); 1 unless given. */
|
|
2064
|
+
count?: number;
|
|
2065
|
+
/** The line under the question in the host's words, instead of the count's. */
|
|
2066
|
+
message?: ReactNode;
|
|
2067
|
+
/** The question: the `saveBar` label ("Save your changes?") unless given. */
|
|
2068
|
+
title?: ReactNode;
|
|
2069
|
+
/** The save button: the `save` label ("Save") unless given. */
|
|
2070
|
+
saveLabel?: ReactNode;
|
|
2071
|
+
/** Saving: the save button spins and Discard waits. */
|
|
2072
|
+
busy?: boolean;
|
|
2073
|
+
/** Save is off (what's typed can't be saved yet); Discard still works. */
|
|
2074
|
+
saveDisabled?: boolean;
|
|
2075
|
+
}
|
|
2076
|
+
/**
|
|
2077
|
+
* A settings page's unsaved changes: a bar on the selected tint floating at the foot of the window, centred, with the
|
|
2078
|
+
* question, how many changes wait, Discard and Save. For a page edited in place (sign-up, a portal's settings), where
|
|
2079
|
+
* there's no dialog to save from; a form in a dialog saves from its own footer.
|
|
2080
|
+
*/
|
|
2081
|
+
declare function SaveBar({ open, onSave, onDiscard, count, message, title, saveLabel, busy, saveDisabled }: SaveBarProps): react.JSX.Element;
|
|
1585
2082
|
|
|
1586
2083
|
/** A section of a settings area (Administration, a project's settings): the host's own, or one a package or plugin adds. */
|
|
1587
2084
|
interface SettingsSection {
|
|
@@ -2174,6 +2671,17 @@ interface QueryableListProps {
|
|
|
2174
2671
|
countMatches?: (conditions: QueryConditionJson[]) => Promise<number>;
|
|
2175
2672
|
/** A column before the fields' (the checkboxes of rows picked for a change, UI round 9 step 56). */
|
|
2176
2673
|
leadingColumn?: DataTableColumn<QueryRow>;
|
|
2674
|
+
/** A column after the fields' (a row's ⋯ menu). */
|
|
2675
|
+
trailingColumn?: DataTableColumn<QueryRow>;
|
|
2676
|
+
/**
|
|
2677
|
+
* The rows as cards in a grid instead of a table (a projects directory's Cards view): `layout="cards"` draws each row
|
|
2678
|
+
* with `cards.render`. Filters, sort, saved views and pages work the same; grouping and the tree apply to the table.
|
|
2679
|
+
*/
|
|
2680
|
+
cards?: {
|
|
2681
|
+
render: (row: QueryRow) => ReactNode;
|
|
2682
|
+
minWidth?: string;
|
|
2683
|
+
};
|
|
2684
|
+
layout?: 'list' | 'cards';
|
|
2177
2685
|
/** A row under the toolbar, across it (picking rows, changing them). */
|
|
2178
2686
|
toolbarFooter?: ReactNode;
|
|
2179
2687
|
/** RQL autocomplete at the caret; without it the RQL box is a plain input. */
|
|
@@ -2183,6 +2691,11 @@ interface QueryableListProps {
|
|
|
2183
2691
|
skip: number;
|
|
2184
2692
|
take: number;
|
|
2185
2693
|
onSkipChange: (skip: number) => void;
|
|
2694
|
+
/**
|
|
2695
|
+
* How its pages read (`Pagination`'s form): `simple` when left out (the range, then previous and next, centred);
|
|
2696
|
+
* `numbered` for a long report people page through; `compact` for a narrow place.
|
|
2697
|
+
*/
|
|
2698
|
+
pagination?: PaginationForm;
|
|
2186
2699
|
views?: QueryableListView[];
|
|
2187
2700
|
activeViewId?: string | null;
|
|
2188
2701
|
onSelectView?: (id: string | null) => void;
|
|
@@ -2267,7 +2780,7 @@ declare function basicConditions(where: QueryNodeJson | null | undefined): Query
|
|
|
2267
2780
|
* counts, saved views and paging, over any entity the query engine serves. Controlled: the host runs the query and
|
|
2268
2781
|
* keeps the state in the URL.
|
|
2269
2782
|
*/
|
|
2270
|
-
declare function QueryableList({ 'aria-label': ariaLabel, fields, state, onStateChange, result, loading: own, error, renderCell, renderRow, selection, leadingColumn, toolbarFooter, countMatches, suggest, renderValueEditor, skip, take, onSkipChange, views, activeViewId, onSelectView, onSaveView, onDeleteView, onExport, actions, empty, loadFailed, leading, attention, search, renderGroupFooter, renderGroupAside, moveToGroup, tree, columnLabels, exportTarget, }: QueryableListProps): react.JSX.Element;
|
|
2783
|
+
declare function QueryableList({ 'aria-label': ariaLabel, fields, state, onStateChange, result, loading: own, error, renderCell, renderRow, selection, leadingColumn, trailingColumn, cards, layout, toolbarFooter, countMatches, suggest, renderValueEditor, skip, take, onSkipChange, pagination, views, activeViewId, onSelectView, onSaveView, onDeleteView, onExport, actions, empty, loadFailed, leading, attention, search, renderGroupFooter, renderGroupAside, moveToGroup, tree, columnLabels, exportTarget, }: QueryableListProps): react.JSX.Element;
|
|
2271
2784
|
|
|
2272
2785
|
interface RecordKeyProps extends Omit<HTMLChakraProps<'span'>, 'children'> {
|
|
2273
2786
|
/** The key, e.g. "PAY-41". Children win when both are given. */
|
|
@@ -2763,4 +3276,4 @@ interface TooltipProps extends Omit<Tooltip$1.RootProps, 'children'> {
|
|
|
2763
3276
|
*/
|
|
2764
3277
|
declare const Tooltip: react.ForwardRefExoticComponent<TooltipProps & react.RefAttributes<HTMLDivElement>>;
|
|
2765
3278
|
|
|
2766
|
-
export { ABP_UI_VERSION, AbpApiError, type AbpBrand, type AbpHost, type AbpLabels, AbpProvider, type AbpProviderProps, type AbpSystemOptions, type ApiQuery, AppLink, type AppLinkProps, AppShell, type AppShellBrand, type AppShellNavItem, type AppShellNavSection, type AppShellPlace, type AppShellProps, type AppShellSidebar, type AreaTexts, type Arrival, ArriveOnChange, type ArriveOnChangeProps, AttentionChip, type AttentionChipProps, type AvatarPerson, AvatarStack, type AvatarStackProps, Bone, type BoneProps, type BreadcrumbItem, Breadcrumbs, Button, type ButtonProps, type ButtonSize, type ButtonVariant, CalendarGrid, type CalendarGridProps, type CalendarItem, type CardDates, CategoryProgress, type CategoryProgressProps, type CelebrateTarget, Chart, type ChartProps, type ChartSeries, CheckboxField, type CheckboxFieldProps, Collapse, type CollapseProps, type ColorMode, ColorModeProvider, ColorModeToggle, type CommandGroup, type CommandItem, CommandPalette, type CommandPaletteProps, ConfirmDialog, type ConfirmDialogProps, type ConfirmOptions, ConfirmProvider, CountBadge, type CountBadgeProps, Counter, type CounterProps, DashboardGrid, type DashboardGridProps, DataTable, type DataTableColumn, type DataTableProps, type DataTableSelection, type DataTableSort, type Direction, DirectionalIcon, DropHint, type DropHintProps, type DropZoneOptions, type DropZoneState, type DroppedFile, EMPTY_VALUE, EmptyState, type EmptyStateProps, FadeIn, type FadeInProps, Field, type FieldProps, FileDropArea, type FileDropAreaProps, FormDialog, type FormDialogProps, FormField, type GridItem, HighlightText, type HostEventHandler, type HostEvents, type HostFile, type HostLanguage, HostProvider, type HostRequest, type HostRequestInit, type HostRequestOptions, type HostScope, HostSlot, IconButton, type IconButtonProps, IconTile, type IconTileProps, Indicator, type IndicatorProps, InlineAlert, type InlineAlertProps, KanbanBoard, type KanbanBoardProps, type KanbanColumn, type KanbanItem, type KanbanLane, type KanbanMove, type LinkComponent, Loading, type LoadingProps, LoadingState, MotionProvider, type MotionSetting, type MotionState, Nudge, type NudgeProps, PageHeader, type PageHeaderProps, PageTitleProvider, Pagination, type PaginationProps, Panel, type PanelProps, PanelTone, type Particle, PathChips, type PathChipsProps, PersonChip, type PersonChipProps, type PlacedCard, PluginTextsProvider, type Pose, Presence, PresenceItem, type PresenceItemProps, PresenceList, type PresenceListProps, type PresenceProps, Pressable, type PressableProps, PriorityMark, type PriorityMarkProps, type PropertyItem, PropertyList, type PropertyListProps, type QueryConditionJson, type QueryExportFormat, type QueryField, type QueryGroup, type QueryJson, type QueryListLabels, type QueryNodeJson, type QueryRow, type QuerySuggestion, type QuerySuggestions, type QueryValueEditor, QueryableList, type QueryableListError, type QueryableListExport, type QueryableListProps, type QueryableListState, type QueryableListView, type QueueProgress, RecordKey, type RecordKeyProps, type RegisterSlotSave, Reveal, RevealItem, type RevealItemProps, type RevealProps, SHOWN, STEP_UP_REQUIRED, type Scale, SearchInput, type SearchInputProps, type SectionMove, SegmentedControl, type SegmentedControlProps, type SegmentedItem, SelectField, type SelectFieldProps, type SelectOption, type SettingsArea, SettingsLayout, type SettingsLayoutProps, type SettingsPage, type SettingsSection, SlideItem, type SlideItemProps, SlideList, type SlideListProps, type SlotSave, type SortDirection, type SortableSection, SortableSections, type SortableSectionsProps, type StatusCategory, StatusPill, type StatusPillProps, type StatusTone, StepUpDialog, type StepUpHandler, Swap, type SwapProps, SwitchField, type SwitchFieldProps, TITLE_SEPARATOR, TextBone, type TextBoneProps, TextSlot, type TextSlotProps, type TimelineCardItem, TimelineCards, type TimelineCardsProps, TimelineChart, type TimelineChartProps, type TimelineItem, type TimelineRow, type TimelineScale, type TitleParts, Toaster, Tooltip, type TooltipProps, UPLOADS_AT_ONCE, type UploadJob, UploadList, type UploadListProps, type UploadRow, type UploadState, abpConfig, arriveCss, asMotionSetting, avatarPalette, basicConditions, boneWidth, burst, compactLayout, compareOrdinal, composeTitle, covers, createAbpSystem, createAreaTexts, createHostEvents, createHostRequest, curves, defaultBrand, defaultLabels, defaultQueryListLabels, directionOf, droppedFiles, errorText, fileNameOf, findSettingsPage, folderOf, foldersFor, formatDateTime, formatMessage, formatNumber, ghostCss, groupKey, heavierFirst, hiddenPose, inSections, isStepUp, looksLikeCode, durations as motionDurations, notify, pageList, partsOf, pastedName, placeCards, placeItem, priorityLevel, progressOf, readAbpError, readEvents, refusal, requestStepUp, setStepUpHandler, settingsArea, shineCss, springs, staggerDelay, targetOf, toStart, toaster, useAbpLabels, useAbpLocale, useAbpTimeZone, useApiAction, useApiDownload, useApiQuery, useAreaEvents, useAreaRequest, useArriving, useCan, useCelebrate, useColorMode, useConfirm, useDropZone, useFilesOverPage, useFormatters, useHost, useHostLanguages, useLinkComponent, useLoading, useMe, useMotionSetting, useNames, useNavigate, useOptionalHost, usePageDrop, usePageTitle, usePageTitleParts, usePageTitleSite, usePastedFiles, usePluginTexts, useProductName, useSlotSaves, useTokenVar };
|
|
3279
|
+
export { ABP_UI_VERSION, AbpApiError, type AbpBrand, type AbpHost, type AbpLabels, type AbpLabelsInput, type AbpListOptions, AbpProvider, type AbpProviderProps, type AbpSystemOptions, AddButton, type AddButtonProps, type ApiQuery, AppLink, type AppLinkProps, AppShell, type AppShellBrand, type AppShellNavItem, type AppShellNavSection, type AppShellPlace, type AppShellProps, type AppShellSidebar, type AreaTexts, type Arrival, ArriveOnChange, type ArriveOnChangeProps, AttentionChip, type AttentionChipProps, type AvatarPerson, AvatarStack, type AvatarStackProps, Bone, type BoneProps, type BreadcrumbItem, Breadcrumbs, Button, type ButtonProps, type ButtonSize, type ButtonVariant, CalendarGrid, type CalendarGridProps, type CalendarItem, type CardDates, CategoryProgress, type CategoryProgressProps, type CelebrateTarget, Chart, type ChartProps, type ChartSeries, CheckboxField, type CheckboxFieldProps, Collapse, type CollapseProps, type ColorMode, ColorModeProvider, ColorModeToggle, type CommandGroup, type CommandItem, CommandPalette, type CommandPaletteProps, ConfirmDialog, type ConfirmDialogProps, type ConfirmOptions, ConfirmProvider, CountBadge, type CountBadgeProps, Counter, type CounterProps, DEFAULT_PAGE_SIZE, DashboardGrid, type DashboardGridProps, DataTable, type DataTableColumn, type DataTableProps, type DataTableSelection, type DataTableSort, type Direction, DirectionalIcon, DropHint, type DropHintProps, type DropZoneOptions, type DropZoneState, type DroppedFile, EMPTY_VALUE, EmotionRegistry, type EmptyArt, EmptyArtDrawing, type EmptyIllustration, EmptyState, type EmptyStateProps, FadeIn, type FadeInProps, Field, type FieldProps, FileDropArea, type FileDropAreaProps, FormDialog, type FormDialogProps, FormField, type GridItem, GroupPicker, Highlight, HighlightText, type HostEventHandler, type HostEvents, type HostFile, type HostLanguage, HostProvider, type HostRequest, type HostRequestInit, type HostRequestOptions, type HostScope, HostSlot, IconButton, type IconButtonProps, IconTile, type IconTileProps, Indicator, type IndicatorProps, InlineAlert, type InlineAlertProps, KanbanBoard, type KanbanBoardProps, type KanbanColumn, type KanbanItem, type KanbanLane, type KanbanMove, type LinkComponent, ListFooter, type ListPage, type ListQuery, type ListSource, type ListState, Loading, type LoadingProps, LoadingState, MotionProvider, type MotionSetting, type MotionState, type NameSuggestion, type NamesValue, Nudge, type NudgeProps, PageHeader, type PageHeaderProps, PageIllustration, PageTitleProvider, Pagination, type PaginationForm, type PaginationProps, Panel, type PanelProps, PanelTone, type Particle, PathChips, type PathChipsProps, PersonChip, type PersonChipProps, PersonPicker, type PickerGroup, type PickerLabels, type PickerPerson, type PlacedCard, PluginTextsProvider, type Pose, Presence, PresenceItem, type PresenceItemProps, PresenceList, type PresenceListProps, type PresenceProps, Pressable, type PressableProps, PreviewCard, type PreviewCardProps, PriorityMark, type PriorityMarkProps, type PropertyItem, PropertyList, type PropertyListProps, type QueryConditionJson, type QueryExportFormat, type QueryField, type QueryGroup, type QueryJson, type QueryListLabels, type QueryNodeJson, type QueryRow, type QuerySuggestion, type QuerySuggestions, type QueryValueEditor, QueryableList, type QueryableListError, type QueryableListExport, type QueryableListProps, type QueryableListState, type QueryableListView, type QueueProgress, RecordKey, type RecordKeyProps, type RegisterSlotSave, Reveal, RevealItem, type RevealItemProps, type RevealProps, RowMenu, type RowMenuEntry, type RowMenuItem, type RowMenuProps, SHOWN, STEP_UP_REQUIRED, STRONG_FACTOR_REQUIRED, SaveBar, type SaveBarProps, type Scale, SearchInput, type SearchInputProps, SearchPicker, type SearchPickerMessages, type SearchPickerProps, type SectionMove, SegmentedControl, type SegmentedControlProps, type SegmentedItem, SelectField, type SelectFieldProps, type SelectOption, type ServerInsertedHTML, type SettingsArea, SettingsLayout, type SettingsLayoutProps, type SettingsPage, type SettingsSection, SlideItem, type SlideItemProps, SlideList, type SlideListProps, type SlotSave, type SortDirection, type SortableSection, SortableSections, type SortableSectionsProps, type StatusCategory, StatusPill, type StatusPillProps, type StatusTone, StepUpDialog, type StepUpHandler, type StepUpNeed, Swap, type SwapProps, SwitchField, type SwitchFieldProps, TITLE_SEPARATOR, TextBone, type TextBoneProps, TextSlot, type TextSlotProps, type TimelineCardItem, TimelineCards, type TimelineCardsProps, TimelineChart, type TimelineChartProps, type TimelineItem, type TimelineRow, type TimelineScale, type TitleParts, Toaster, Tooltip, type TooltipProps, TranslatedInput, type TranslatedInputProps, type TranslationsLabels, UPLOADS_AT_ONCE, type UploadJob, UploadList, type UploadListProps, type UploadRow, type UploadState, abpConfig, abpListParams, abpListSource, arriveCss, asMotionSetting, avatarPalette, basicConditions, boneWidth, burst, compactLayout, compareOrdinal, composeTitle, covers, createAbpSystem, createAreaTexts, createHostEvents, createHostRequest, createPasskey, curves, defaultBrand, defaultLabels, defaultPickerLabels, defaultQueryListLabels, defaultTranslationsLabels, directionOf, droppedFiles, emptyQuery, errorText, fileNameOf, findSettingsPage, folderOf, foldersFor, formatDateTime, formatMessage, formatNumber, getPasskey, ghostCss, groupKey, heavierFirst, hiddenPose, inSections, isStepUp, looksLikeCode, durations as motionDurations, needsStepUp, notify, pageCount, pageList, pagesShown, partsOf, passkeysSupported, pastedName, personLabel, placeCards, placeItem, priorityLevel, progressOf, readAbpError, readEvents, refusal, requestStepUp, setStepUpHandler, settingsArea, shineCss, springs, staggerDelay, stepUpNeedOf, targetOf, toStart, toaster, useAbpLabels, useAbpLocale, useAbpTimeZone, useApiAction, useApiDownload, useApiQuery, useAreaEvents, useAreaListSource, useAreaRequest, useArriving, useCan, useCelebrate, useColorMode, useConfirm, useDropZone, useFilesOverPage, useFormatters, useHost, useHostLanguages, useLinkComponent, useListState, useLoading, useMe, useMotionSetting, useNames, useNavigate, useOptionalHost, usePageDrop, usePageTitle, usePageTitleParts, usePageTitleSite, usePastedFiles, usePluginTexts, useProductName, useSettledValue, useSlotSaves, useTokenVar };
|