@abpjs/ui 0.2.0-next.4 → 0.2.0-next.41
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 +435 -0
- package/dist/agent.d.ts +800 -0
- package/dist/agent.js +2468 -0
- package/dist/agent.js.map +1 -0
- package/dist/ai.d.ts +1 -1
- package/dist/ai.js +25 -9
- package/dist/ai.js.map +1 -1
- package/dist/guard.d.ts +1686 -0
- package/dist/guard.js +4194 -0
- package/dist/guard.js.map +1 -0
- package/dist/index.d.ts +740 -41
- package/dist/index.js +4062 -1376
- package/dist/index.js.map +1 -1
- package/dist/languages.d.ts +162 -0
- package/dist/languages.js +771 -0
- package/dist/languages.js.map +1 -0
- package/dist/rules.d.ts +23 -1
- package/dist/rules.js +35 -0
- package/dist/rules.js.map +1 -1
- package/dist/storage.d.ts +102 -0
- package/dist/storage.js +315 -0
- package/dist/storage.js.map +1 -0
- package/package.json +24 -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;
|
|
@@ -180,6 +227,23 @@ interface QueryListLabels {
|
|
|
180
227
|
exporting: string;
|
|
181
228
|
/** "The file holds {rows} of {total} rows: an export stops at {limit}." */
|
|
182
229
|
exportCut: string;
|
|
230
|
+
/** The export dialog (UI round 10 step 76). Optional: English by default. `exportFound` takes `{count}`. */
|
|
231
|
+
exportTitleCsv?: string;
|
|
232
|
+
exportTitleExcel?: string;
|
|
233
|
+
exportRows?: string;
|
|
234
|
+
exportFound?: string;
|
|
235
|
+
exportAll?: string;
|
|
236
|
+
exportColumns?: string;
|
|
237
|
+
exportSeparator?: string;
|
|
238
|
+
exportComma?: string;
|
|
239
|
+
exportSemicolon?: string;
|
|
240
|
+
exportTab?: string;
|
|
241
|
+
exportPreview?: string;
|
|
242
|
+
exportRun?: string;
|
|
243
|
+
exportCancel?: string;
|
|
244
|
+
/** The toast while the file is made, and once it's downloaded. */
|
|
245
|
+
exportPreparing?: string;
|
|
246
|
+
exportReady?: string;
|
|
183
247
|
exportFailed: string;
|
|
184
248
|
dismiss: string;
|
|
185
249
|
/** Operator names by JSON-form op: eq, ne, in, notIn, contains… */
|
|
@@ -191,8 +255,30 @@ interface QueryListLabels {
|
|
|
191
255
|
}
|
|
192
256
|
declare const defaultQueryListLabels: QueryListLabels;
|
|
193
257
|
declare const defaultLabels: AbpLabels;
|
|
258
|
+
/**
|
|
259
|
+
* The labels a host gives: any of them, and any of a group's (the query list's, the pickers', the translations'); the
|
|
260
|
+
* rest are the defaults, so a group the package adds later needs nothing from a host that doesn't use it.
|
|
261
|
+
*/
|
|
262
|
+
type AbpLabelsInput = Partial<Omit<AbpLabels, 'queryList' | 'translations' | 'picker'>> & {
|
|
263
|
+
queryList?: Partial<QueryListLabels>;
|
|
264
|
+
translations?: Partial<TranslationsLabels>;
|
|
265
|
+
picker?: Partial<PickerLabels>;
|
|
266
|
+
};
|
|
194
267
|
declare function useAbpLabels(): AbpLabels;
|
|
195
268
|
|
|
269
|
+
/** A framework's hook for HTML to put in the page's head while it streams (Next's `useServerInsertedHTML`). */
|
|
270
|
+
type ServerInsertedHTML = (callback: () => ReactNode) => void;
|
|
271
|
+
/**
|
|
272
|
+
* Emotion's styles in the page's head on the server, so the first render matches the client's. Without it, a style
|
|
273
|
+
* Emotion writes during the server render (Chakra's global styles) lands inside the body where the client expects
|
|
274
|
+
* something else (next-themes' script), and React's hydration fails. The framework's hook comes from the host, so the
|
|
275
|
+
* package names no framework.
|
|
276
|
+
*/
|
|
277
|
+
declare function EmotionRegistry({ useServerInsertedHTML, children }: {
|
|
278
|
+
useServerInsertedHTML: ServerInsertedHTML;
|
|
279
|
+
children: ReactNode;
|
|
280
|
+
}): react.JSX.Element;
|
|
281
|
+
|
|
196
282
|
/**
|
|
197
283
|
* An answer the server refused, in ABP's error shape (`{ error: { code, message, details, validationErrors } }`), or
|
|
198
284
|
* a problem's title, or the status. Read as JSON whatever the content type says, as file routes answer refusals so.
|
|
@@ -218,6 +304,37 @@ declare function readAbpError(res: Response): Promise<AbpApiError>;
|
|
|
218
304
|
/** An error as a person reads it. */
|
|
219
305
|
declare function errorText(e: unknown): string;
|
|
220
306
|
declare const isStepUp: (e: unknown) => boolean;
|
|
307
|
+
/** A strong step-up asked of someone with no strong factor yet (AbpGuard 0.7.0): they set one up, then step up. */
|
|
308
|
+
declare const STRONG_FACTOR_REQUIRED = "strong_factor_required";
|
|
309
|
+
/** A refusal the step-up dialog answers: a step-up, or a strong factor to set up first. */
|
|
310
|
+
declare const needsStepUp: (e: unknown) => e is AbpApiError;
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* 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
|
|
314
|
+
* person's ways best first, or a strong factor they don't have yet. Older servers send no level: the password level.
|
|
315
|
+
*/
|
|
316
|
+
interface StepUpNeed {
|
|
317
|
+
/** `step_up_required`, or `strong_factor_required` when a strong step-up is asked of someone with no strong factor. */
|
|
318
|
+
code: string;
|
|
319
|
+
/** `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). */
|
|
320
|
+
level: 'password' | 'strong';
|
|
321
|
+
category: string | null;
|
|
322
|
+
/** The person's ways at that level, best first: `passkey`, `app`, `password`, `email`… Empty when the server doesn't say. */
|
|
323
|
+
methods: string[];
|
|
324
|
+
/** An authenticator code alone passes (the operator's setting, AbpGuard's `appCodeAlone`); else it goes with the password. */
|
|
325
|
+
appCodeAlone: boolean;
|
|
326
|
+
}
|
|
327
|
+
/** What asks the person to confirm who they are: true once confirmed (or a strong factor set up), false if they gave up. */
|
|
328
|
+
type StepUpHandler = (need: StepUpNeed) => Promise<boolean>;
|
|
329
|
+
/** The step-up dialog registers itself here (`StepUpDialog`, drawn by `AbpProvider`); null when it goes. */
|
|
330
|
+
declare function setStepUpHandler(next: StepUpHandler | null): void;
|
|
331
|
+
/** The need an error carries: its code, and the level and methods in its data. */
|
|
332
|
+
declare function stepUpNeedOf(code: string, data: Record<string, unknown> | null | undefined): StepUpNeed;
|
|
333
|
+
/**
|
|
334
|
+
* Asks the person to confirm who they are, once however many calls are waiting for it (ADR 0109 amendment). False when
|
|
335
|
+
* nothing is registered to ask with: the call then fails with the server's refusal, as it would without.
|
|
336
|
+
*/
|
|
337
|
+
declare function requestStepUp(need?: StepUpNeed): Promise<boolean>;
|
|
221
338
|
|
|
222
339
|
/** What a call sends: its method, a JSON body (or FormData as is), headers, and a way to stop it. */
|
|
223
340
|
interface HostRequestInit {
|
|
@@ -227,6 +344,8 @@ interface HostRequestInit {
|
|
|
227
344
|
signal?: AbortSignal;
|
|
228
345
|
/** The answer as a file (a Blob and the name Content-Disposition gives) rather than JSON. */
|
|
229
346
|
as?: 'json' | 'file';
|
|
347
|
+
/** False: a refusal that asks for a step-up is thrown, not asked (the step-up dialog's own calls). */
|
|
348
|
+
stepUp?: false;
|
|
230
349
|
}
|
|
231
350
|
/** A file the server answered with. */
|
|
232
351
|
interface HostFile {
|
|
@@ -250,7 +369,7 @@ interface HostRequestOptions {
|
|
|
250
369
|
* A 403 `step_up_required`: the host confirms the person again; true retries the call once. By default the step-up
|
|
251
370
|
* dialog `AbpProvider` draws asks (`requestStepUp`), and without one the call fails as the server answered.
|
|
252
371
|
*/
|
|
253
|
-
stepUp?: () => Promise<boolean>;
|
|
372
|
+
stepUp?: (need: StepUpNeed) => Promise<boolean>;
|
|
254
373
|
/** More headers on every call (a development user, a tenant). */
|
|
255
374
|
headers?: () => Record<string, string>;
|
|
256
375
|
fetch?: typeof fetch;
|
|
@@ -276,7 +395,7 @@ type HostEvents = (path: string, onEvent: HostEventHandler, options?: {
|
|
|
276
395
|
}) => Promise<string | null>;
|
|
277
396
|
/** Reads a response's server-sent events to its end. */
|
|
278
397
|
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,
|
|
398
|
+
/** 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
399
|
declare function createHostEvents(options?: Pick<HostRequestOptions, 'onUnauthorized' | 'stepUp' | 'headers' | 'fetch'>): HostEvents;
|
|
281
400
|
|
|
282
401
|
/** A scope as a host knows it: a project, an org unit. */
|
|
@@ -290,9 +409,18 @@ interface HostScope {
|
|
|
290
409
|
/** One of the site's languages, for names by language. */
|
|
291
410
|
interface HostLanguage {
|
|
292
411
|
code: string;
|
|
412
|
+
/** Its name in itself ("العربية"). */
|
|
293
413
|
name: string;
|
|
414
|
+
/** Its name in English, shown beside `name` where they differ. */
|
|
415
|
+
englishName?: string;
|
|
294
416
|
direction?: 'ltr' | 'rtl';
|
|
295
417
|
}
|
|
418
|
+
/** A name someone already translated (a text of the host's, a setting's name): every language at once. */
|
|
419
|
+
interface NameSuggestion {
|
|
420
|
+
names: Record<string, string>;
|
|
421
|
+
/** Where it comes from, as the host words it ("Status · FIN"). */
|
|
422
|
+
source?: string;
|
|
423
|
+
}
|
|
296
424
|
/**
|
|
297
425
|
* What a host gives the screens (ADR 0109 amendment): how to call its server, where each package's API is, how to
|
|
298
426
|
* move, what the person may do, its scopes and people, its languages, its words for any text, and the slots it fills.
|
|
@@ -321,6 +449,8 @@ interface AbpHost {
|
|
|
321
449
|
names?: (accountIds: string[]) => Promise<Record<string, string>>;
|
|
322
450
|
/** The site's languages, the first the default. */
|
|
323
451
|
languages?: HostLanguage[];
|
|
452
|
+
/** Names already translated that start with what's typed, so a name is translated the same way everywhere. */
|
|
453
|
+
suggestNames?: (text: string, signal: AbortSignal) => Promise<NameSuggestion[]>;
|
|
324
454
|
/** The host's words for any area's text, by area then language then key: `{ ai: { en: { 'models.title': 'AI models' } } }`. */
|
|
325
455
|
texts?: Record<string, Record<string, Record<string, string>>>;
|
|
326
456
|
/**
|
|
@@ -415,7 +545,7 @@ interface AbpProviderProps {
|
|
|
415
545
|
/** BCP 47 locale ("en", "ar"). Sets direction for every component, portals included. */
|
|
416
546
|
locale?: string;
|
|
417
547
|
/** Translated strings for the components' own text (close, cancel, sort ...). */
|
|
418
|
-
labels?:
|
|
548
|
+
labels?: AbpLabelsInput;
|
|
419
549
|
/** The host router's link component (next/link in the shell). */
|
|
420
550
|
linkComponent?: LinkComponent;
|
|
421
551
|
/** Initial colour mode when the user has not chosen one. */
|
|
@@ -428,6 +558,12 @@ interface AbpProviderProps {
|
|
|
428
558
|
timeZone?: string;
|
|
429
559
|
/** How much the interface moves for the person (ADR 0058); as their system says when it's not given. */
|
|
430
560
|
motion?: MotionSetting;
|
|
561
|
+
/**
|
|
562
|
+
* The framework's hook for HTML in the page's head while it streams (Next's `useServerInsertedHTML`): with it, Emotion's
|
|
563
|
+
* styles go there on the server, so the first render hydrates without a mismatch. A host that renders on the client
|
|
564
|
+
* only leaves it out.
|
|
565
|
+
*/
|
|
566
|
+
useServerInsertedHTML?: ServerInsertedHTML;
|
|
431
567
|
}
|
|
432
568
|
/**
|
|
433
569
|
* Chakra (with the host's system), colour mode (next-themes, class on <html>), locale and
|
|
@@ -436,7 +572,7 @@ interface AbpProviderProps {
|
|
|
436
572
|
*
|
|
437
573
|
* The host must also set `<html lang dir>` and `suppressHydrationWarning` on <html>.
|
|
438
574
|
*/
|
|
439
|
-
declare function AbpProvider({ children,
|
|
575
|
+
declare function AbpProvider({ children, useServerInsertedHTML, ...props }: AbpProviderProps): react.JSX.Element;
|
|
440
576
|
|
|
441
577
|
type ColorMode = 'light' | 'dark';
|
|
442
578
|
/** next-themes, configured the way Chakra v3 expects: a `light`/`dark` class on <html>. */
|
|
@@ -451,6 +587,226 @@ declare function ColorModeToggle({ size }: {
|
|
|
451
587
|
size?: 'xs' | 'sm' | 'md';
|
|
452
588
|
}): react.JSX.Element;
|
|
453
589
|
|
|
590
|
+
type NamesValue = Record<string, string>;
|
|
591
|
+
interface TranslatedInputProps {
|
|
592
|
+
/** Names by language code. */
|
|
593
|
+
value: NamesValue;
|
|
594
|
+
onChange: (value: NamesValue) => void;
|
|
595
|
+
/** Shown when nothing is given in a language, and the last resort for what shows (usually the object's key). */
|
|
596
|
+
fallback?: string;
|
|
597
|
+
'aria-label'?: string;
|
|
598
|
+
placeholder?: string;
|
|
599
|
+
size?: 'xs' | 'sm' | 'md';
|
|
600
|
+
disabled?: boolean;
|
|
601
|
+
autoFocus?: boolean;
|
|
602
|
+
onBlur?: () => void;
|
|
603
|
+
/** Offer names already translated while typing (the host's `suggestNames`; default on where the host has it). */
|
|
604
|
+
suggest?: boolean;
|
|
605
|
+
}
|
|
606
|
+
/**
|
|
607
|
+
* A name in every language the site offers (the host's `languages`): the reader's language inline, the others behind a
|
|
608
|
+
* button that shows how many are filled in. Each language is typed in its own direction, and one left empty says which
|
|
609
|
+
* name shows instead. Where the host offers names already translated (`suggestNames`), typing lists them, and picking
|
|
610
|
+
* one fills in every language at once, so a name is translated the same way everywhere. A host with no languages gets
|
|
611
|
+
* one field.
|
|
612
|
+
*/
|
|
613
|
+
declare function TranslatedInput({ value, onChange, fallback, 'aria-label': ariaLabel, placeholder, size, disabled, autoFocus, onBlur, suggest, }: TranslatedInputProps): react.JSX.Element;
|
|
614
|
+
|
|
615
|
+
/** What a list shows: a page of rows, sorted and narrowed (ADR 0109 amendment). */
|
|
616
|
+
interface ListQuery {
|
|
617
|
+
/** From 1. */
|
|
618
|
+
page: number;
|
|
619
|
+
pageSize: number;
|
|
620
|
+
/** A column's id and its direction; null for the list's own order. */
|
|
621
|
+
sort: {
|
|
622
|
+
columnId: string;
|
|
623
|
+
direction: 'asc' | 'desc';
|
|
624
|
+
} | null;
|
|
625
|
+
/** What's typed in the list's search. */
|
|
626
|
+
search: string;
|
|
627
|
+
/** The list's other filters by name (a status, a directory); an empty value is no filter. */
|
|
628
|
+
filters: Record<string, string>;
|
|
629
|
+
}
|
|
630
|
+
/** A page of a list: its rows and how many there are in all. */
|
|
631
|
+
interface ListPage<T> {
|
|
632
|
+
items: T[];
|
|
633
|
+
total: number;
|
|
634
|
+
}
|
|
635
|
+
/**
|
|
636
|
+
* Where a list's rows come from: the server package's own paging, or the host's (its query engine), which a host gives
|
|
637
|
+
* an area in place of the package's. `key` names what it lists: a different key is a different list, read afresh.
|
|
638
|
+
*/
|
|
639
|
+
interface ListSource<T> {
|
|
640
|
+
key: string;
|
|
641
|
+
load: (query: ListQuery, signal: AbortSignal) => Promise<ListPage<T>>;
|
|
642
|
+
}
|
|
643
|
+
declare const DEFAULT_PAGE_SIZE = 25;
|
|
644
|
+
declare function emptyQuery(initial?: Partial<ListQuery>): ListQuery;
|
|
645
|
+
/** How a list's query maps onto a server's: the search's parameter, and each sortable column's field. */
|
|
646
|
+
interface AbpListOptions {
|
|
647
|
+
/** The parameter the search goes in (ABP's lists: `filter`). */
|
|
648
|
+
searchParam?: string;
|
|
649
|
+
/** A column's id to the server's field for `sorting`; a column not here sorts by its id. */
|
|
650
|
+
sortFields?: Record<string, string>;
|
|
651
|
+
/** Parameters every page asks with (a fixed scope, a kind). */
|
|
652
|
+
fixed?: Record<string, string>;
|
|
653
|
+
}
|
|
654
|
+
/** ABP's paging parameters for a query: `skipCount`, `maxResultCount`, `sorting` ("username desc"), the search and filters. */
|
|
655
|
+
declare function abpListParams(query: ListQuery, options?: AbpListOptions): URLSearchParams;
|
|
656
|
+
/** A list served in ABP's shape (`PagedAndSortedResultRequestDto` in, `{ totalCount, items }` out) at a path. */
|
|
657
|
+
declare function abpListSource<T>(request: HostRequest, path: string, options?: AbpListOptions): ListSource<T>;
|
|
658
|
+
/** How many pages a list has (at least one). */
|
|
659
|
+
declare const pageCount: (total: number, pageSize: number) => number;
|
|
660
|
+
|
|
661
|
+
interface ListState<T> {
|
|
662
|
+
/** The list's place: its page, size, sort, filters, and what's typed in its search (asked once typing settles). */
|
|
663
|
+
query: ListQuery;
|
|
664
|
+
/** The page's rows; undefined until the first page comes. */
|
|
665
|
+
rows: T[] | undefined;
|
|
666
|
+
total: number;
|
|
667
|
+
pages: number;
|
|
668
|
+
/** The first page is coming. */
|
|
669
|
+
loading: boolean;
|
|
670
|
+
/** Another page or a new search is coming: the rows shown are the last ones until it does. */
|
|
671
|
+
refreshing: boolean;
|
|
672
|
+
error: string | null;
|
|
673
|
+
setSearch: (search: string) => void;
|
|
674
|
+
/** One filter by name; null or '' removes it. */
|
|
675
|
+
setFilter: (name: string, value: string | null) => void;
|
|
676
|
+
setSort: (sort: ListQuery['sort']) => void;
|
|
677
|
+
setPage: (page: number) => void;
|
|
678
|
+
setPageSize: (pageSize: number) => void;
|
|
679
|
+
/** Reads the page again (after a change made elsewhere). */
|
|
680
|
+
reload: () => void;
|
|
681
|
+
/** For `DataTable`: the rows, the first load's placeholders, the error, and the sort, which the source applies. */
|
|
682
|
+
table: {
|
|
683
|
+
rows: T[] | undefined;
|
|
684
|
+
loading: boolean;
|
|
685
|
+
error: string | null;
|
|
686
|
+
sort: ListQuery['sort'];
|
|
687
|
+
onSortChange: (sort: ListQuery['sort']) => void;
|
|
688
|
+
sortMode: 'manual';
|
|
689
|
+
};
|
|
690
|
+
/** For `Pagination`: the page and how many. */
|
|
691
|
+
pagination: {
|
|
692
|
+
page: number;
|
|
693
|
+
pages: number;
|
|
694
|
+
onPage: (page: number) => void;
|
|
695
|
+
};
|
|
696
|
+
}
|
|
697
|
+
/**
|
|
698
|
+
* A list's page, search, filters and sort, read from its source (ADR 0109 amendment): a change of search, filters, sort
|
|
699
|
+
* or page size goes back to the first page; typing waits `searchDelay` ms; only the latest answer counts; a different
|
|
700
|
+
* source (its `key`) starts empty. `onQueryChange` hears every change, for a screen that keeps the list's place in its
|
|
701
|
+
* address.
|
|
702
|
+
*/
|
|
703
|
+
declare function useListState<T>(source: ListSource<T>, options?: {
|
|
704
|
+
initial?: Partial<ListQuery>;
|
|
705
|
+
searchDelay?: number;
|
|
706
|
+
onQueryChange?: (query: ListQuery) => void;
|
|
707
|
+
}): ListState<T>;
|
|
708
|
+
/** An area's list served in ABP's shape at a path on this host (`/accounts/page`): the same source while the path is. */
|
|
709
|
+
declare function useAreaListSource<T>(area: string, path: string, options?: AbpListOptions): ListSource<T>;
|
|
710
|
+
|
|
711
|
+
/**
|
|
712
|
+
* How a pagination reads (UI round 10, step 73): `simple` (the default for lists: which rows of how many, then previous
|
|
713
|
+
* and next; people narrow a long list with search and filters, not by jumping to a page), `numbered` (the pages
|
|
714
|
+
* themselves, for long reports) or `compact` ("Page 3 of 200" between previous and next, for narrow places).
|
|
715
|
+
*/
|
|
716
|
+
type PaginationForm = 'simple' | 'numbered' | 'compact';
|
|
717
|
+
/** The page buttons a form shows between its arrows: only the numbered form has any. */
|
|
718
|
+
declare function pagesShown(form: PaginationForm, page: number, pages: number): (number | 'gap')[];
|
|
719
|
+
/**
|
|
720
|
+
* The pages a pagination shows (UI round 9, step 67): the first and the last, the current one and its neighbours, and
|
|
721
|
+
* near either end the first or last four, in order, with 'gap' where pages are left out.
|
|
722
|
+
*/
|
|
723
|
+
declare function pageList(page: number, pages: number): (number | 'gap')[];
|
|
724
|
+
|
|
725
|
+
/**
|
|
726
|
+
* A paged list's foot (`useListState`): which rows of how many show ("26–50 of 112") and the way to the others, in the
|
|
727
|
+
* labels' `queryList` words. `form` is `Pagination`'s, `simple` when left out (the range, then previous and next,
|
|
728
|
+
* centred); `numbered` puts the pages at the start and the range at the end. Nothing until the first page comes, or
|
|
729
|
+
* when the list is empty.
|
|
730
|
+
*/
|
|
731
|
+
declare function ListFooter<T>({ list, form }: {
|
|
732
|
+
list: ListState<T>;
|
|
733
|
+
form?: PaginationForm;
|
|
734
|
+
}): react.JSX.Element | null;
|
|
735
|
+
|
|
736
|
+
/** A value that follows another once it has stood still for `ms` (what's typed in a search box, before it asks). */
|
|
737
|
+
declare function useSettledValue<T>(value: T, ms?: number): T;
|
|
738
|
+
|
|
739
|
+
/**
|
|
740
|
+
* A text with the part matching what was typed in bold, every match, ignoring case; as it was when nothing is typed or
|
|
741
|
+
* nothing matches.
|
|
742
|
+
*/
|
|
743
|
+
declare function Highlight({ text, query }: {
|
|
744
|
+
text: string;
|
|
745
|
+
query: string;
|
|
746
|
+
}): react.JSX.Element;
|
|
747
|
+
interface SearchPickerMessages {
|
|
748
|
+
placeholder: string;
|
|
749
|
+
searching: string;
|
|
750
|
+
noMatches: string;
|
|
751
|
+
noKnown: string;
|
|
752
|
+
/** Under the list when nothing can be searched and only `known` is offered. */
|
|
753
|
+
limitedHint?: string;
|
|
754
|
+
}
|
|
755
|
+
interface SearchPickerProps<T> {
|
|
756
|
+
value: T | null;
|
|
757
|
+
onChange: (item: T | null) => void;
|
|
758
|
+
/** Searches as the person types; null when there's nothing to search, and only `known` is offered. */
|
|
759
|
+
search: ((text: string) => Promise<T[]>) | null;
|
|
760
|
+
/** Items to offer without searching (people on the page…), filtered by the text typed. */
|
|
761
|
+
known?: T[];
|
|
762
|
+
getId: (item: T) => string;
|
|
763
|
+
/** The text the input shows for the chosen item, and what typing filters `known` by. */
|
|
764
|
+
label: (item: T) => string;
|
|
765
|
+
/** How an option reads in the list (with what's typed, to bold its match: `Highlight`); the label, its match bold, by default. */
|
|
766
|
+
renderOption?: (item: T, query: string) => ReactNode;
|
|
767
|
+
/**
|
|
768
|
+
* Making a new item from the text typed, offered last when no option is called just that ("Add “Acme” as a new
|
|
769
|
+
* vendor"); it resolves with the item made, which is then picked, or null when it wasn't.
|
|
770
|
+
*/
|
|
771
|
+
create?: {
|
|
772
|
+
label: (text: string) => string;
|
|
773
|
+
onCreate: (text: string) => Promise<T | null>;
|
|
774
|
+
};
|
|
775
|
+
/** Offer an empty choice ("Unassigned"). */
|
|
776
|
+
clearLabel?: string;
|
|
777
|
+
/** With nothing picked, the closed input shows the placeholder rather than the empty choice's words. */
|
|
778
|
+
emptyShowsPlaceholder?: boolean;
|
|
779
|
+
/** The picker's words; the labels' `picker` defaults where not given. */
|
|
780
|
+
messages?: Partial<SearchPickerMessages>;
|
|
781
|
+
disabled?: boolean;
|
|
782
|
+
size?: 'sm' | 'md';
|
|
783
|
+
'aria-label'?: string;
|
|
784
|
+
id?: string;
|
|
785
|
+
}
|
|
786
|
+
/** One item picked from a searchable list: an ARIA combobox with keyboard support. */
|
|
787
|
+
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;
|
|
788
|
+
/** A person to pick: an account's id, username and name, and whether it's an agent's. */
|
|
789
|
+
interface PickerPerson {
|
|
790
|
+
id: string;
|
|
791
|
+
username: string;
|
|
792
|
+
displayName?: string | null;
|
|
793
|
+
}
|
|
794
|
+
/** A group (a team) to pick. */
|
|
795
|
+
interface PickerGroup {
|
|
796
|
+
id: string;
|
|
797
|
+
name: string;
|
|
798
|
+
}
|
|
799
|
+
declare const personLabel: (p: PickerPerson | null | undefined) => string;
|
|
800
|
+
/**
|
|
801
|
+
* Picks one person: their name and @username, searched by `search` (the area's call, or the host's); without one, the
|
|
802
|
+
* people already `known` on the page. `badge` marks a person where the host has something to say (an agent's account).
|
|
803
|
+
*/
|
|
804
|
+
declare function PersonPicker<P extends PickerPerson>({ badge, messages, ...rest }: Omit<SearchPickerProps<P>, 'getId' | 'label' | 'renderOption'> & {
|
|
805
|
+
badge?: (person: P) => ReactNode;
|
|
806
|
+
}): react.JSX.Element;
|
|
807
|
+
/** Picks one group, searched by `search` (the area's call, or the host's). */
|
|
808
|
+
declare function GroupPicker<G extends PickerGroup>({ messages, ...rest }: Omit<SearchPickerProps<G>, 'getId' | 'label'>): react.JSX.Element;
|
|
809
|
+
|
|
454
810
|
type Direction = 'ltr' | 'rtl';
|
|
455
811
|
/** Text direction for a BCP 47 locale ("ar", "ar-SA" -> rtl). */
|
|
456
812
|
declare function directionOf(locale: string): Direction;
|
|
@@ -800,8 +1156,15 @@ interface AppShellNavItem {
|
|
|
800
1156
|
icon?: ReactNode;
|
|
801
1157
|
/** Marks the item as the current page (aria-current). */
|
|
802
1158
|
current?: boolean;
|
|
803
|
-
/**
|
|
1159
|
+
/**
|
|
1160
|
+
* Pages under this one (a person's favourite views under Views), indented below it; hidden in the rail. In the top bar
|
|
1161
|
+
* they open from a small menu beside its name.
|
|
1162
|
+
*/
|
|
804
1163
|
children?: AppShellNavItem[];
|
|
1164
|
+
/** The heading over the pages under it in the top bar's menu ("Starred"). */
|
|
1165
|
+
childrenTitle?: string;
|
|
1166
|
+
/** The top bar's menu button, named for screen readers ("Starred projects"); the item's name unless given. */
|
|
1167
|
+
childrenLabel?: string;
|
|
805
1168
|
}
|
|
806
1169
|
interface AppShellNavSection {
|
|
807
1170
|
id: string;
|
|
@@ -884,12 +1247,19 @@ interface PaginationProps {
|
|
|
884
1247
|
/** A page button's name: "Page 4". */
|
|
885
1248
|
pageLabel: (page: number) => string;
|
|
886
1249
|
disabled?: boolean;
|
|
1250
|
+
/** How it reads; `numbered` when left out (step 67's pages). */
|
|
1251
|
+
form?: PaginationForm;
|
|
1252
|
+
/** Which rows of how many ("26–50 of 112"), drawn before the arrows in the simple form. */
|
|
1253
|
+
range?: string;
|
|
1254
|
+
/** "Page 3 of 200", drawn between the arrows in the compact form. */
|
|
1255
|
+
pageOf?: string;
|
|
887
1256
|
}
|
|
888
1257
|
/**
|
|
889
|
-
* Pages of a list, centred under it (the canvas's v12
|
|
890
|
-
* ones around the current one (gaps as "…"), next
|
|
1258
|
+
* Pages of a list, centred under it (the canvas's v12). Numbered (UI round 9 step 67): previous, the first and last pages
|
|
1259
|
+
* and the ones around the current one (gaps as "…"), next, the current page filled. Simple (round 10 step 73): the
|
|
1260
|
+
* range, then previous and next. Compact: "Page 3 of 200" between them. One page: only the simple form's range, if any.
|
|
891
1261
|
*/
|
|
892
|
-
declare function Pagination({ page, pages, onPage, label, previous, next, pageLabel, disabled }: PaginationProps): react.JSX.Element | null;
|
|
1262
|
+
declare function Pagination({ page, pages, onPage, label, previous, next, pageLabel, disabled, form, range, pageOf }: PaginationProps): react.JSX.Element | null;
|
|
893
1263
|
|
|
894
1264
|
interface CommandItem {
|
|
895
1265
|
id: string;
|
|
@@ -933,12 +1303,6 @@ declare function HighlightText({ text, query }: {
|
|
|
933
1303
|
*/
|
|
934
1304
|
declare function CommandPalette({ open, onOpenChange, search, labels }: CommandPaletteProps): react.JSX.Element;
|
|
935
1305
|
|
|
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
1306
|
interface AvatarPerson {
|
|
943
1307
|
id: string;
|
|
944
1308
|
name: string;
|
|
@@ -979,9 +1343,10 @@ declare function AvatarStack({ 'aria-label': ariaLabel, people, max, moreLabel,
|
|
|
979
1343
|
* secondary every other action (outlined neutral); the default
|
|
980
1344
|
* ghost low-emphasis actions in toolbars and table rows
|
|
981
1345
|
* link inline text action
|
|
1346
|
+
* cancel every Cancel (a dialog's, a form's, a composer's): one quiet gray fill, no border
|
|
982
1347
|
* `danger` turns any of them red for destructive actions.
|
|
983
1348
|
*/
|
|
984
|
-
type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'link';
|
|
1349
|
+
type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'link' | 'cancel';
|
|
985
1350
|
type ButtonSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
986
1351
|
interface AbpButtonProps {
|
|
987
1352
|
variant?: ButtonVariant;
|
|
@@ -994,14 +1359,57 @@ type ButtonProps = Omit<ButtonProps$1, 'variant' | 'size' | 'colorPalette'> & Ab
|
|
|
994
1359
|
* `loading` is Chakra's: an action is running.
|
|
995
1360
|
*/
|
|
996
1361
|
declare const Button: react.ForwardRefExoticComponent<Omit<ButtonProps$1, "colorPalette" | "size" | "variant"> & AbpButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1362
|
+
type AddButtonProps = Omit<ButtonProps, 'variant' | 'danger'>;
|
|
1363
|
+
/**
|
|
1364
|
+
* The one look for every add action (Add filter, Add column, Add condition, Add member, a create row): link-coloured
|
|
1365
|
+
* bold text after a plus, no fill, no border, no chevron, underlined on hover. A page's one main action stays a
|
|
1366
|
+
* `primary` Button; this is for the adds inside a page, a panel or a dialog.
|
|
1367
|
+
*/
|
|
1368
|
+
declare const AddButton: react.ForwardRefExoticComponent<AddButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
997
1369
|
type IconButtonProps = Omit<IconButtonProps$1, 'variant' | 'size' | 'colorPalette'> & AbpButtonProps & {
|
|
998
1370
|
'aria-label': string;
|
|
1371
|
+
/** Removing something from a list or a form (not deleting it): gray at rest, red only on hover. */
|
|
1372
|
+
remove?: boolean;
|
|
999
1373
|
};
|
|
1000
|
-
/**
|
|
1374
|
+
/**
|
|
1375
|
+
* Square icon-only button. `aria-label` is required; it is also shown as the native tooltip. A delete (trash) icon is
|
|
1376
|
+
* `danger`, red at all times; taking a row out of a list is `remove`, gray until hovered.
|
|
1377
|
+
*/
|
|
1001
1378
|
declare const IconButton: react.ForwardRefExoticComponent<Omit<IconButtonProps$1, "colorPalette" | "size" | "variant"> & AbpButtonProps & {
|
|
1002
1379
|
'aria-label': string;
|
|
1380
|
+
/** Removing something from a list or a form (not deleting it): gray at rest, red only on hover. */
|
|
1381
|
+
remove?: boolean;
|
|
1003
1382
|
} & react.RefAttributes<HTMLButtonElement>>;
|
|
1004
1383
|
|
|
1384
|
+
/** One thing a row's ⋯ menu can do. */
|
|
1385
|
+
interface RowMenuItem {
|
|
1386
|
+
id: string;
|
|
1387
|
+
label: ReactNode;
|
|
1388
|
+
icon?: ReactNode;
|
|
1389
|
+
onSelect?: () => void;
|
|
1390
|
+
/** Red text and icon: delete, and other acts that can't be taken back. */
|
|
1391
|
+
danger?: boolean;
|
|
1392
|
+
/** Shown but not chosen: the person may not do it here (say why in a `note`). */
|
|
1393
|
+
disabled?: boolean;
|
|
1394
|
+
}
|
|
1395
|
+
/** An entry of a row's menu: an item, a line between groups, or a quiet note (why some items are off). */
|
|
1396
|
+
type RowMenuEntry = RowMenuItem | {
|
|
1397
|
+
separator: true;
|
|
1398
|
+
} | {
|
|
1399
|
+
note: ReactNode;
|
|
1400
|
+
};
|
|
1401
|
+
interface RowMenuProps {
|
|
1402
|
+
/** The trigger's name, with the row in it ("More for Finance"). */
|
|
1403
|
+
label: string;
|
|
1404
|
+
items: RowMenuEntry[];
|
|
1405
|
+
size?: 'xs' | 'sm';
|
|
1406
|
+
}
|
|
1407
|
+
/**
|
|
1408
|
+
* A row's ⋯ menu (the design canvas's row menu): Open, Star, Edit, then Archive and a red Delete apart. Items the
|
|
1409
|
+
* person may not use stay listed, turned off, with a note saying who can.
|
|
1410
|
+
*/
|
|
1411
|
+
declare function RowMenu({ label, items, size }: RowMenuProps): react.JSX.Element;
|
|
1412
|
+
|
|
1005
1413
|
interface ConfirmOptions {
|
|
1006
1414
|
title: ReactNode;
|
|
1007
1415
|
description?: ReactNode;
|
|
@@ -1009,6 +1417,11 @@ interface ConfirmOptions {
|
|
|
1009
1417
|
cancelLabel?: ReactNode;
|
|
1010
1418
|
/** Red confirm button for destructive actions. */
|
|
1011
1419
|
danger?: boolean;
|
|
1420
|
+
/**
|
|
1421
|
+
* A word the person types before the confirm turns on (a project's key, to delete it): for acts that can't be taken
|
|
1422
|
+
* back and reach a lot. Matched exactly, ignoring spaces around it.
|
|
1423
|
+
*/
|
|
1424
|
+
typeToConfirm?: string;
|
|
1012
1425
|
}
|
|
1013
1426
|
interface ConfirmDialogProps extends ConfirmOptions {
|
|
1014
1427
|
open: boolean;
|
|
@@ -1018,7 +1431,7 @@ interface ConfirmDialogProps extends ConfirmOptions {
|
|
|
1018
1431
|
busy?: boolean;
|
|
1019
1432
|
}
|
|
1020
1433
|
/** 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;
|
|
1434
|
+
declare function ConfirmDialog({ open, onOpenChange, onConfirm, busy, title, description, confirmLabel, cancelLabel, danger, typeToConfirm, }: ConfirmDialogProps): react.JSX.Element;
|
|
1022
1435
|
type ConfirmFn = (options: ConfirmOptions) => Promise<boolean>;
|
|
1023
1436
|
/** Provides `useConfirm()`. AbpProvider renders it; you rarely need it directly. */
|
|
1024
1437
|
declare function ConfirmProvider({ children }: {
|
|
@@ -1317,6 +1730,139 @@ declare function placeItem(items: GridItem[], w: number, h: number, columns?: nu
|
|
|
1317
1730
|
*/
|
|
1318
1731
|
declare function DashboardGrid<T extends GridItem>({ items, columns, rowHeight, editing, onLayoutChange, renderItem, labels, 'aria-label': ariaLabel, loading: own, }: DashboardGridProps<T>): react.JSX.Element;
|
|
1319
1732
|
|
|
1733
|
+
/** A file's rows as cells, the header first. Empty lines are skipped. */
|
|
1734
|
+
declare function parseCsv(text: string): string[][];
|
|
1735
|
+
/** The separator the first line uses most: comma, semicolon or tab (outside quotes). */
|
|
1736
|
+
declare function guessSeparator(text: string): string;
|
|
1737
|
+
/** Rows as CSV with commas, CRLF line ends, fields quoted when they must be. */
|
|
1738
|
+
declare function writeCsv(rows: string[][]): string;
|
|
1739
|
+
/**
|
|
1740
|
+
* The rows with their columns renamed and some left out: `targets[i]` is column i's new header, or null to leave it
|
|
1741
|
+
* out. Columns past the header's length are dropped; short rows are padded.
|
|
1742
|
+
*/
|
|
1743
|
+
declare function remapCsv(rows: string[][], targets: (string | null)[]): string[][];
|
|
1744
|
+
/** The media type of an Excel workbook (.xlsx). */
|
|
1745
|
+
declare const XLSX_TYPE = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
1746
|
+
/** What kind of table a file is, by its name and type: a CSV, an Excel workbook, an older Excel file, or neither. */
|
|
1747
|
+
declare function tableKind(file: {
|
|
1748
|
+
name: string;
|
|
1749
|
+
type?: string;
|
|
1750
|
+
}): 'csv' | 'xlsx' | 'old' | null;
|
|
1751
|
+
|
|
1752
|
+
/** Why a file can't be read: an older .xls or one with a password, not a zip, too big unpacked, or no sheet. */
|
|
1753
|
+
type XlsxProblem = 'old' | 'broken' | 'tooBig' | 'noSheet';
|
|
1754
|
+
declare class XlsxError extends Error {
|
|
1755
|
+
readonly problem: XlsxProblem;
|
|
1756
|
+
constructor(problem: XlsxProblem);
|
|
1757
|
+
}
|
|
1758
|
+
interface XlsxSheet {
|
|
1759
|
+
/** The sheet read: the workbook's first visible one. */
|
|
1760
|
+
sheet: string;
|
|
1761
|
+
/** How many visible sheets the workbook has. */
|
|
1762
|
+
sheets: number;
|
|
1763
|
+
rows: string[][];
|
|
1764
|
+
}
|
|
1765
|
+
/** The first visible sheet's rows as text: numbers as Excel shows them to 15 digits, dates as yyyy-MM-dd. */
|
|
1766
|
+
declare function readXlsx(data: ArrayBuffer | Uint8Array): Promise<XlsxSheet>;
|
|
1767
|
+
|
|
1768
|
+
/**
|
|
1769
|
+
* A file's rows as text cells, the header first, from a CSV or an Excel workbook (its first visible sheet, named in
|
|
1770
|
+
* `sheet` when the workbook has several). Throws `XlsxError` for a workbook it can't read, and an Error for a file
|
|
1771
|
+
* that is neither.
|
|
1772
|
+
*/
|
|
1773
|
+
declare function readTable(file: File): Promise<{
|
|
1774
|
+
rows: string[][];
|
|
1775
|
+
sheet?: Pick<XlsxSheet, 'sheet' | 'sheets'>;
|
|
1776
|
+
}>;
|
|
1777
|
+
|
|
1778
|
+
declare const TRACKS = 60;
|
|
1779
|
+
/** Width presets in tracks: half, two-thirds, full. */
|
|
1780
|
+
declare const PRESETS: {
|
|
1781
|
+
readonly half: 30;
|
|
1782
|
+
readonly two: 40;
|
|
1783
|
+
readonly full: 60;
|
|
1784
|
+
};
|
|
1785
|
+
interface BoardItem {
|
|
1786
|
+
id: string;
|
|
1787
|
+
x: number;
|
|
1788
|
+
y: number;
|
|
1789
|
+
w: number;
|
|
1790
|
+
}
|
|
1791
|
+
/**
|
|
1792
|
+
* The items with `y` renumbered 0, 1, 2… in (y, x) order, no gaps and no halves, so a stored layout never drifts.
|
|
1793
|
+
* Widths and starts are kept (an expanded or narrow view isn't saved). The items keep their order in the array.
|
|
1794
|
+
*/
|
|
1795
|
+
declare function renumber<T extends BoardItem>(items: T[]): T[];
|
|
1796
|
+
/** Where a new item `w` tracks wide goes: after everything, beside the last one when it fits there, else at the start. */
|
|
1797
|
+
declare function appendAt(items: BoardItem[], w?: number): {
|
|
1798
|
+
x: number;
|
|
1799
|
+
y: number;
|
|
1800
|
+
};
|
|
1801
|
+
/** A 12-column layout (DashboardGrid's) read on 60 tracks: five tracks a column, its (y, x) order kept. */
|
|
1802
|
+
declare function fromTwelve<T extends BoardItem>(items: T[]): T[];
|
|
1803
|
+
|
|
1804
|
+
interface WidgetBoardLabels {
|
|
1805
|
+
/** The grip's name: "Move Open bugs". */
|
|
1806
|
+
move: (title: string) => string;
|
|
1807
|
+
/** The resize handle's name: "Width of Open bugs". */
|
|
1808
|
+
resize: (title: string) => string;
|
|
1809
|
+
/** The ⋯ menu's name: "Actions for Open bugs". */
|
|
1810
|
+
actions: (title: string) => string;
|
|
1811
|
+
expand: string;
|
|
1812
|
+
restore: string;
|
|
1813
|
+
half: string;
|
|
1814
|
+
twoThirds: string;
|
|
1815
|
+
full: string;
|
|
1816
|
+
moveUp: string;
|
|
1817
|
+
moveDown: string;
|
|
1818
|
+
/** How to use the grip and the handle from the keyboard, read with them. */
|
|
1819
|
+
instructions: string;
|
|
1820
|
+
/** Said after a move: "Open bugs moved: 2 of 5, column 1". */
|
|
1821
|
+
moved: (title: string, place: number, count: number, column: number) => string;
|
|
1822
|
+
/** Said after a width change: "Open bugs: 40 of 60 tracks". */
|
|
1823
|
+
resized: (title: string, tracks: number) => string;
|
|
1824
|
+
}
|
|
1825
|
+
interface WidgetBoardProps<T extends BoardItem> {
|
|
1826
|
+
/**
|
|
1827
|
+
* The widgets: `x` the start column and `w` the width, in 60 tracks counted from the start edge (right to left
|
|
1828
|
+
* mirrors itself); `y` only their place in the order (0, 1, 2…), never a height: each widget is as tall as its
|
|
1829
|
+
* content, and the board packs them in (y, x) order as high as they fit.
|
|
1830
|
+
*/
|
|
1831
|
+
items: T[];
|
|
1832
|
+
/** Whether the layout may change: the grip, the resize handle, the width presets and Move up / down. Expand is for everyone. */
|
|
1833
|
+
editable?: boolean;
|
|
1834
|
+
/**
|
|
1835
|
+
* The layout after a finished gesture: a drop, the end of a resize, one keyboard move or a menu choice; never on each
|
|
1836
|
+
* pointer move, so a host can save it as it comes. `y` comes renumbered 0, 1, 2… with no gaps.
|
|
1837
|
+
*/
|
|
1838
|
+
onLayoutChange?: (items: T[]) => void;
|
|
1839
|
+
/** A widget's title, at the start of its header. */
|
|
1840
|
+
title: (item: T) => string;
|
|
1841
|
+
/** A widget's body. `expanded` while it's stretched across the board. */
|
|
1842
|
+
renderItem: (item: T, state: {
|
|
1843
|
+
expanded: boolean;
|
|
1844
|
+
}) => ReactNode;
|
|
1845
|
+
/** The host's own ⋯ items (Edit settings, Duplicate, Remove); the board adds the width presets and moves when editable. */
|
|
1846
|
+
menu?: (item: T) => RowMenuEntry[];
|
|
1847
|
+
/** The narrowest a widget may be made, in px (its readable minimum); 200 when not given. */
|
|
1848
|
+
minWidth?: (item: T) => number;
|
|
1849
|
+
labels: WidgetBoardLabels;
|
|
1850
|
+
'aria-label': string;
|
|
1851
|
+
/** Its widgets are coming (ADR 0061): placeholder tiles. The nearest `Loading` scope's when not given. */
|
|
1852
|
+
loading?: boolean;
|
|
1853
|
+
}
|
|
1854
|
+
/**
|
|
1855
|
+
* A dashboard's widgets on 60 tracks (the design canvas's shared widget container and its rules). Every widget sits in
|
|
1856
|
+
* one container: its title at the start, then a move grip, Expand / Restore width and the ⋯ menu (grip and Expand show
|
|
1857
|
+
* on hover, focus, touch or while moving; their space is kept). Expand stretches it across the board in place, for as
|
|
1858
|
+
* long as the page is open. A handle on the end edge sets its width, with the pointer or the arrow keys, Home and End.
|
|
1859
|
+
* Dragging from the grip shows the widget following the pointer and a dashed slot where it will land, snapped to its
|
|
1860
|
+
* neighbours' edges; Escape cancels. With the grip focused, Left and Right move it 5 tracks (Shift: 1), Up and Down past
|
|
1861
|
+
* the neighbour above or below, Home to the top, End to the end; each move is announced. Below 720 px every widget is
|
|
1862
|
+
* full width, in order, without handles, and the saved layout is left alone.
|
|
1863
|
+
*/
|
|
1864
|
+
declare function WidgetBoard<T extends BoardItem>({ items, editable, onLayoutChange, title, renderItem, menu, minWidth, labels, 'aria-label': ariaLabel, loading: own, }: WidgetBoardProps<T>): react.JSX.Element;
|
|
1865
|
+
|
|
1320
1866
|
interface CategoryProgressProps {
|
|
1321
1867
|
todo: number;
|
|
1322
1868
|
inProgress: number;
|
|
@@ -1339,6 +1885,32 @@ declare function CategoryProgress({ todo, inProgress, done, size, loading: own,
|
|
|
1339
1885
|
*/
|
|
1340
1886
|
declare const DirectionalIcon: _chakra_ui_react.ChakraComponent<"span", {}>;
|
|
1341
1887
|
|
|
1888
|
+
/**
|
|
1889
|
+
* The empty state's drawings (the design canvas's EmptyState): a page-level illustration of the feature the empty page
|
|
1890
|
+
* belongs to, and small flat pieces of art for empty lists in panels and settings. Both are decorative (aria-hidden),
|
|
1891
|
+
* abstract (no numbers, no names) and static, and draw only with the theme's tokens, so they follow the host's brand
|
|
1892
|
+
* and the colour mode.
|
|
1893
|
+
*/
|
|
1894
|
+
/** The feature an empty page belongs to; it picks the three cards. */
|
|
1895
|
+
type EmptyIllustration = 'records' | 'board' | 'views' | 'dashboards' | 'dashboard' | 'reports' | 'calendar' | 'timeline' | 'gantt' | 'backlog' | 'queue' | 'comments' | 'files';
|
|
1896
|
+
/**
|
|
1897
|
+
* The page-level illustration. `searching` adds a small search mark (nothing matches); `compact` shows the middle card
|
|
1898
|
+
* alone. The drawing is laid out left to right in either direction: it is a picture, not text.
|
|
1899
|
+
*/
|
|
1900
|
+
declare function PageIllustration({ of, searching, scale }: {
|
|
1901
|
+
of: EmptyIllustration;
|
|
1902
|
+
searching?: boolean;
|
|
1903
|
+
scale?: number;
|
|
1904
|
+
}): react.JSX.Element;
|
|
1905
|
+
/** Small drawings in place of the icon: first use, no results, all done, nothing new, away, agents, couldn't load. */
|
|
1906
|
+
type EmptyArt = 'records' | 'search' | 'done' | 'bell' | 'handover' | 'agent' | 'error';
|
|
1907
|
+
/** One of the small drawings, `width` × `height` (its viewBox is 120 × 96). */
|
|
1908
|
+
declare function EmptyArtDrawing({ art, width, height }: {
|
|
1909
|
+
art: EmptyArt;
|
|
1910
|
+
width: string;
|
|
1911
|
+
height: string;
|
|
1912
|
+
}): react.JSX.Element;
|
|
1913
|
+
|
|
1342
1914
|
interface EmptyStateProps {
|
|
1343
1915
|
title: ReactNode;
|
|
1344
1916
|
description?: ReactNode;
|
|
@@ -1361,9 +1933,21 @@ interface EmptyStateProps {
|
|
|
1361
1933
|
size?: 'xs' | 'sm' | 'md';
|
|
1362
1934
|
/** Its drawing's colour: `neutral` (the default, calm), `accent` (a place that invites a first step) or `danger`. */
|
|
1363
1935
|
tone?: 'neutral' | 'accent' | 'danger';
|
|
1936
|
+
/**
|
|
1937
|
+
* `page`: the whole main content of a page is empty (no records yet, a dashboard with no widgets, nothing matches on
|
|
1938
|
+
* the whole page). It draws `illustration`, the feature the page is about, in place of the icon. Leave it out
|
|
1939
|
+
* everywhere else (panels, columns, widgets, sections), and errors never get it.
|
|
1940
|
+
*/
|
|
1941
|
+
variant?: 'page';
|
|
1942
|
+
/** With `variant="page"`: what the empty page is about. Defaults to `records`. */
|
|
1943
|
+
illustration?: EmptyIllustration;
|
|
1944
|
+
/** A small flat drawing in place of the icon, for an empty list in a panel or a settings card. */
|
|
1945
|
+
art?: EmptyArt;
|
|
1946
|
+
/** `inline`: the drawing, the words and the action on one line, on a quiet surface (an empty list inside a settings card). */
|
|
1947
|
+
layout?: 'inline';
|
|
1364
1948
|
}
|
|
1365
1949
|
/** 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;
|
|
1950
|
+
declare function EmptyState({ title, description, icon, action, secondaryAction, kind, size, tone: own, variant, illustration, art, layout, }: EmptyStateProps): react.JSX.Element;
|
|
1367
1951
|
|
|
1368
1952
|
interface AttentionChipProps {
|
|
1369
1953
|
count: number;
|
|
@@ -1520,27 +2104,39 @@ declare function useSlotSaves(): {
|
|
|
1520
2104
|
run: () => Promise<void>;
|
|
1521
2105
|
};
|
|
1522
2106
|
|
|
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
2107
|
/** Whether what was typed can be a code yet: six digits (spaces between are fine), or a recovery code's ten characters. */
|
|
1534
2108
|
declare function looksLikeCode(value: string, recovery: boolean): boolean;
|
|
1535
2109
|
/**
|
|
1536
|
-
*
|
|
1537
|
-
*
|
|
1538
|
-
*
|
|
1539
|
-
* the
|
|
1540
|
-
*
|
|
2110
|
+
* Confirms the person before a sensitive action (ADR 0109 amendment, on AbpGuard's step-up): the server answers 403
|
|
2111
|
+
* `step_up_required`, the host's request asks here, and the call is tried again once confirmed.
|
|
2112
|
+
*
|
|
2113
|
+
* - At the password level: the password, and a code of their second factor when they have one (their app, a recovery
|
|
2114
|
+
* code, or one the site sends).
|
|
2115
|
+
* - At the strong level (AbpGuard 0.7.0): a passkey first when they have one, or an authenticator code: alone where the
|
|
2116
|
+
* server says one passes alone (`appCodeAlone`, the operator's setting), else with the password. Where a code passes
|
|
2117
|
+
* alone it's offered at the password level too.
|
|
2118
|
+
* - Asked for a strong step-up with no strong factor (`strong_factor_required`): the password, then setting up a passkey
|
|
2119
|
+
* or the app here (with recovery codes, shown once, for a first factor); the call then asks again, and they confirm
|
|
2120
|
+
* with what they set up.
|
|
2121
|
+
*
|
|
2122
|
+
* Too many wrong passwords end the session (401), which the host's request hands to the host. `AbpProvider` draws it
|
|
2123
|
+
* when the host gives `paths.guard`; a host with its own dialog sets `stepUpDialog: false`.
|
|
1541
2124
|
*/
|
|
1542
2125
|
declare function StepUpDialog(): react.JSX.Element;
|
|
1543
2126
|
|
|
2127
|
+
/**
|
|
2128
|
+
* Passkeys in the browser (WebAuthn), in the browser's own JSON both ways, as AbpGuard 0.7.0 speaks it: the options come
|
|
2129
|
+
* as `PublicKeyCredentialCreationOptionsJSON` / `PublicKeyCredentialRequestOptionsJSON`, and the answer goes back as the
|
|
2130
|
+
* credential's `toJSON()`. Browsers without the JSON methods get the same through base64url here.
|
|
2131
|
+
*/
|
|
2132
|
+
type Json = Record<string, unknown>;
|
|
2133
|
+
/** Whether this browser can use passkeys at all (a secure page with WebAuthn). */
|
|
2134
|
+
declare function passkeysSupported(): boolean;
|
|
2135
|
+
/** Makes a passkey on this device from the server's creation options; null when the person cancelled. */
|
|
2136
|
+
declare function createPasskey(options: Json, signal?: AbortSignal): Promise<Json | null>;
|
|
2137
|
+
/** Proves a passkey from the server's request options; null when the person cancelled or had none here. */
|
|
2138
|
+
declare function getPasskey(options: Json, signal?: AbortSignal): Promise<Json | null>;
|
|
2139
|
+
|
|
1544
2140
|
/**
|
|
1545
2141
|
* A text with its values filled, in the subset of ICU message syntax the screens' texts use: `{name}`, plurals
|
|
1546
2142
|
* (`{count, plural, =0 {none} one {# item} other {# items}}`, with Arabic's zero, two, few and many) and choices
|
|
@@ -1569,11 +2165,28 @@ interface FormDialogProps {
|
|
|
1569
2165
|
onSubmit: () => void | Promise<void>;
|
|
1570
2166
|
busy?: boolean;
|
|
1571
2167
|
error?: string | null;
|
|
1572
|
-
|
|
2168
|
+
/** `wide` is the two-pane dialog with a preview: 920 px, the fields beside what they make. */
|
|
2169
|
+
size?: 'sm' | 'md' | 'lg' | 'xl' | 'wide';
|
|
1573
2170
|
/** No submit button (the form inside has its own, e.g. a plugin's create view). */
|
|
1574
2171
|
hideSubmit?: boolean;
|
|
1575
2172
|
/** The submit button is off until what the form needs is filled in. */
|
|
1576
2173
|
submitDisabled?: boolean;
|
|
2174
|
+
/**
|
|
2175
|
+
* What the form makes, drawn as it's filled in (a `PreviewCard`, usually): an aside at the end side beside the fields,
|
|
2176
|
+
* under them below `md`. With it the dialog is `wide` unless a size is given.
|
|
2177
|
+
*/
|
|
2178
|
+
preview?: ReactNode;
|
|
2179
|
+
/** The aside's heading: the `preview` label ("Preview") unless given. */
|
|
2180
|
+
previewTitle?: ReactNode;
|
|
2181
|
+
/**
|
|
2182
|
+
* A destructive action at the footer's start, as a red link (Delete account). It doesn't submit the form; asking
|
|
2183
|
+
* whether they're sure is the caller's (a `ConfirmDialog`).
|
|
2184
|
+
*/
|
|
2185
|
+
dangerAction?: {
|
|
2186
|
+
label: ReactNode;
|
|
2187
|
+
onClick: () => void;
|
|
2188
|
+
disabled?: boolean;
|
|
2189
|
+
};
|
|
1577
2190
|
children: ReactNode;
|
|
1578
2191
|
}
|
|
1579
2192
|
/**
|
|
@@ -1581,7 +2194,50 @@ interface FormDialogProps {
|
|
|
1581
2194
|
* and empty, or not in its shape) is marked when the person leaves it, not while they type; submitting with any wrong
|
|
1582
2195
|
* lists them at the top, each a link to its field, and sends nothing.
|
|
1583
2196
|
*/
|
|
1584
|
-
declare function FormDialog({ open, onOpenChange, title, description, submitLabel, onSubmit, busy, error, size, hideSubmit, submitDisabled, children }: FormDialogProps): react.JSX.Element;
|
|
2197
|
+
declare function FormDialog({ open, onOpenChange, title, description, submitLabel, onSubmit, busy, error, size, hideSubmit, submitDisabled, preview, previewTitle, dangerAction, children, }: FormDialogProps): react.JSX.Element;
|
|
2198
|
+
interface PreviewCardProps {
|
|
2199
|
+
/** An avatar or the thing's tile, at the start of the card's head. */
|
|
2200
|
+
media?: ReactNode;
|
|
2201
|
+
/** Its name, as typed so far. */
|
|
2202
|
+
title: ReactNode;
|
|
2203
|
+
/** A line under the name: a username or a key, which may be a `RecordKey`. */
|
|
2204
|
+
subtitle?: ReactNode;
|
|
2205
|
+
/** Its values, label then value; an empty value shows as the empty mark. `wrap` lets a long one (a description) run
|
|
2206
|
+
* to three lines instead of one. */
|
|
2207
|
+
items?: {
|
|
2208
|
+
label: ReactNode;
|
|
2209
|
+
value?: ReactNode;
|
|
2210
|
+
wrap?: boolean;
|
|
2211
|
+
}[];
|
|
2212
|
+
}
|
|
2213
|
+
/** What a form makes, in a `FormDialog`'s preview: a head (media, name, sub-line) and its values in a list. */
|
|
2214
|
+
declare function PreviewCard({ media, title, subtitle, items }: PreviewCardProps): react.JSX.Element;
|
|
2215
|
+
|
|
2216
|
+
interface SaveBarProps {
|
|
2217
|
+
/** Whether there's something to save: the bar rises at the foot of the window while there is, and goes when not. */
|
|
2218
|
+
open: boolean;
|
|
2219
|
+
onSave: () => void;
|
|
2220
|
+
/** Puts the form back as it was saved. */
|
|
2221
|
+
onDiscard: () => void;
|
|
2222
|
+
/** How many changes wait, for the line under the question ("1 change isn't saved yet"); 1 unless given. */
|
|
2223
|
+
count?: number;
|
|
2224
|
+
/** The line under the question in the host's words, instead of the count's. */
|
|
2225
|
+
message?: ReactNode;
|
|
2226
|
+
/** The question: the `saveBar` label ("Save your changes?") unless given. */
|
|
2227
|
+
title?: ReactNode;
|
|
2228
|
+
/** The save button: the `save` label ("Save") unless given. */
|
|
2229
|
+
saveLabel?: ReactNode;
|
|
2230
|
+
/** Saving: the save button spins and Discard waits. */
|
|
2231
|
+
busy?: boolean;
|
|
2232
|
+
/** Save is off (what's typed can't be saved yet); Discard still works. */
|
|
2233
|
+
saveDisabled?: boolean;
|
|
2234
|
+
}
|
|
2235
|
+
/**
|
|
2236
|
+
* A settings page's unsaved changes: a bar on the selected tint floating at the foot of the window, centred, with the
|
|
2237
|
+
* question, how many changes wait, Discard and Save. For a page edited in place (sign-up, a portal's settings), where
|
|
2238
|
+
* there's no dialog to save from; a form in a dialog saves from its own footer.
|
|
2239
|
+
*/
|
|
2240
|
+
declare function SaveBar({ open, onSave, onDiscard, count, message, title, saveLabel, busy, saveDisabled }: SaveBarProps): react.JSX.Element;
|
|
1585
2241
|
|
|
1586
2242
|
/** A section of a settings area (Administration, a project's settings): the host's own, or one a package or plugin adds. */
|
|
1587
2243
|
interface SettingsSection {
|
|
@@ -1998,6 +2654,19 @@ interface PanelProps extends Omit<HTMLChakraProps<'section'>, 'title'> {
|
|
|
1998
2654
|
loading?: boolean;
|
|
1999
2655
|
/** `card` (the bordered surface) or `section` (a heading over a rule, no box); the nearest `PanelTone`'s when not given. */
|
|
2000
2656
|
tone?: 'card' | 'section';
|
|
2657
|
+
/**
|
|
2658
|
+
* The header folds and unfolds the panel: it becomes a button with a chevron before the title (pointing to the end
|
|
2659
|
+
* when folded, down when open). The actions stay where they are and work while it's folded; the description, the
|
|
2660
|
+
* body and the footer go.
|
|
2661
|
+
*/
|
|
2662
|
+
collapsible?: boolean;
|
|
2663
|
+
/** Folded when it first draws (`collapsible`, not controlled). */
|
|
2664
|
+
defaultCollapsed?: boolean;
|
|
2665
|
+
/** Folded or open, when the host keeps it (`collapsible`); with `onCollapsedChange`. */
|
|
2666
|
+
collapsed?: boolean;
|
|
2667
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
2668
|
+
/** A line of what's inside, shown in the header while it's folded ("Arabic · Riyadh", "2 groups"); hidden on narrow screens. */
|
|
2669
|
+
summary?: ReactNode;
|
|
2001
2670
|
}
|
|
2002
2671
|
/** The look of every Panel inside it that doesn't ask for its own (the record page's main column: `section`). */
|
|
2003
2672
|
declare function PanelTone({ tone, children }: {
|
|
@@ -2122,6 +2791,18 @@ interface QueryableListView {
|
|
|
2122
2791
|
}
|
|
2123
2792
|
/** The files an export can be: CSV, or an Excel workbook. */
|
|
2124
2793
|
type QueryExportFormat = 'csv' | 'xlsx';
|
|
2794
|
+
/** A CSV's separator (UI round 10 step 76's export dialog). */
|
|
2795
|
+
type QueryExportSeparator = 'comma' | 'semicolon' | 'tab';
|
|
2796
|
+
/** What the person chose in the export dialog, and the signal that their Cancel aborts. */
|
|
2797
|
+
interface QueryExportOptions {
|
|
2798
|
+
/** The columns to write, in order. */
|
|
2799
|
+
columns: string[];
|
|
2800
|
+
/** Every row the list reaches, not only those its query finds. */
|
|
2801
|
+
all: boolean;
|
|
2802
|
+
/** A CSV's separator; Excel ignores it. */
|
|
2803
|
+
separator: QueryExportSeparator;
|
|
2804
|
+
signal: AbortSignal;
|
|
2805
|
+
}
|
|
2125
2806
|
/** What an export held (from the response's headers): rows in the file, rows that matched, and the limit that cut it. */
|
|
2126
2807
|
interface QueryableListExport {
|
|
2127
2808
|
rows: number;
|
|
@@ -2174,6 +2855,17 @@ interface QueryableListProps {
|
|
|
2174
2855
|
countMatches?: (conditions: QueryConditionJson[]) => Promise<number>;
|
|
2175
2856
|
/** A column before the fields' (the checkboxes of rows picked for a change, UI round 9 step 56). */
|
|
2176
2857
|
leadingColumn?: DataTableColumn<QueryRow>;
|
|
2858
|
+
/** A column after the fields' (a row's ⋯ menu). */
|
|
2859
|
+
trailingColumn?: DataTableColumn<QueryRow>;
|
|
2860
|
+
/**
|
|
2861
|
+
* The rows as cards in a grid instead of a table (a projects directory's Cards view): `layout="cards"` draws each row
|
|
2862
|
+
* with `cards.render`. Filters, sort, saved views and pages work the same; grouping and the tree apply to the table.
|
|
2863
|
+
*/
|
|
2864
|
+
cards?: {
|
|
2865
|
+
render: (row: QueryRow) => ReactNode;
|
|
2866
|
+
minWidth?: string;
|
|
2867
|
+
};
|
|
2868
|
+
layout?: 'list' | 'cards';
|
|
2177
2869
|
/** A row under the toolbar, across it (picking rows, changing them). */
|
|
2178
2870
|
toolbarFooter?: ReactNode;
|
|
2179
2871
|
/** RQL autocomplete at the caret; without it the RQL box is a plain input. */
|
|
@@ -2183,16 +2875,23 @@ interface QueryableListProps {
|
|
|
2183
2875
|
skip: number;
|
|
2184
2876
|
take: number;
|
|
2185
2877
|
onSkipChange: (skip: number) => void;
|
|
2878
|
+
/**
|
|
2879
|
+
* How its pages read (`Pagination`'s form): `simple` when left out (the range, then previous and next, centred);
|
|
2880
|
+
* `numbered` for a long report people page through; `compact` for a narrow place.
|
|
2881
|
+
*/
|
|
2882
|
+
pagination?: PaginationForm;
|
|
2186
2883
|
views?: QueryableListView[];
|
|
2187
2884
|
activeViewId?: string | null;
|
|
2188
2885
|
onSelectView?: (id: string | null) => void;
|
|
2189
2886
|
onSaveView?: (name: string, replaceId: string | null) => void;
|
|
2190
2887
|
onDeleteView?: (id: string) => void;
|
|
2191
2888
|
/**
|
|
2192
|
-
* Downloads what the list shows
|
|
2193
|
-
*
|
|
2889
|
+
* Downloads what the list shows as a file; without it there's no Export menu. The menu's format opens a dialog where
|
|
2890
|
+
* the person picks the rows (what the query finds, or all), the columns and a CSV's separator, then this runs with
|
|
2891
|
+
* their choice; their Cancel aborts `options.signal`. Resolves with what the file held, so the list can say when it
|
|
2892
|
+
* was cut short; a rejection is shown as an error.
|
|
2194
2893
|
*/
|
|
2195
|
-
onExport?: (format: QueryExportFormat) => Promise<QueryableListExport | void>;
|
|
2894
|
+
onExport?: (format: QueryExportFormat, options?: QueryExportOptions) => Promise<QueryableListExport | void>;
|
|
2196
2895
|
/** Extra buttons on the toolbar (e.g. "Create record"). */
|
|
2197
2896
|
actions?: ReactNode;
|
|
2198
2897
|
empty?: ReactNode;
|
|
@@ -2267,7 +2966,7 @@ declare function basicConditions(where: QueryNodeJson | null | undefined): Query
|
|
|
2267
2966
|
* counts, saved views and paging, over any entity the query engine serves. Controlled: the host runs the query and
|
|
2268
2967
|
* keeps the state in the URL.
|
|
2269
2968
|
*/
|
|
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;
|
|
2969
|
+
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
2970
|
|
|
2272
2971
|
interface RecordKeyProps extends Omit<HTMLChakraProps<'span'>, 'children'> {
|
|
2273
2972
|
/** The key, e.g. "PAY-41". Children win when both are given. */
|
|
@@ -2763,4 +3462,4 @@ interface TooltipProps extends Omit<Tooltip$1.RootProps, 'children'> {
|
|
|
2763
3462
|
*/
|
|
2764
3463
|
declare const Tooltip: react.ForwardRefExoticComponent<TooltipProps & react.RefAttributes<HTMLDivElement>>;
|
|
2765
3464
|
|
|
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 };
|
|
3465
|
+
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, type BoardItem, 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 QueryExportOptions, type QueryExportSeparator, 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, TRACKS as WIDGET_TRACKS, PRESETS as WIDGET_WIDTHS, WidgetBoard, type WidgetBoardLabels, type WidgetBoardProps, XLSX_TYPE, XlsxError, type XlsxProblem, type XlsxSheet, abpConfig, abpListParams, abpListSource, appendAt, 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, fromTwelve, getPasskey, ghostCss, groupKey, guessSeparator, heavierFirst, hiddenPose, inSections, isStepUp, looksLikeCode, durations as motionDurations, needsStepUp, notify, pageCount, pageList, pagesShown, parseCsv, partsOf, passkeysSupported, pastedName, personLabel, placeCards, placeItem, priorityLevel, progressOf, readAbpError, readEvents, readTable, readXlsx, refusal, remapCsv, renumber, requestStepUp, setStepUpHandler, settingsArea, shineCss, springs, staggerDelay, stepUpNeedOf, tableKind, 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, writeCsv };
|