@sincpro/web-framework 3.1.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/copy.d.ts +2 -0
- package/dist/core/copy.js +2 -0
- package/dist/core/list.d.ts +3 -0
- package/dist/react/context.d.ts +3 -0
- package/dist/react/context.js +5 -0
- package/dist/web/index.d.ts +4 -2
- package/dist/web/index.js +4 -2
- package/dist/web/list/EntityList.d.ts +4 -1
- package/dist/web/list/EntityList.js +21 -12
- package/dist/web/list/EntitySearchBar.d.ts +6 -2
- package/dist/web/list/EntitySearchBar.js +11 -3
- package/dist/web/list/columns.js +29 -2
- package/dist/web/list/presentation.d.ts +30 -0
- package/dist/web/list/presentation.js +24 -0
- package/dist/web/list/search.d.ts +14 -5
- package/dist/web/list/search.js +29 -14
- package/dist/web/record/ActionButton.d.ts +26 -4
- package/dist/web/record/ActionButton.js +62 -3
- package/dist/web/record/CommandButton.d.ts +13 -1
- package/dist/web/record/CommandButton.js +24 -5
- package/dist/web/record/ServiceButton.d.ts +22 -4
- package/dist/web/record/ServiceButton.js +31 -6
- package/dist/web/record/ask.d.ts +72 -0
- package/dist/web/record/ask.js +63 -0
- package/dist/web/record/control.d.ts +2 -2
- package/dist/web/record/control.js +7 -3
- package/dist/web/record/edit.d.ts +1 -1
- package/dist/web/record/edit.js +11 -3
- package/dist/web/record/lines.d.ts +4 -0
- package/dist/web/record/lines.js +18 -3
- package/dist/web/record/record.d.ts +25 -1
- package/dist/web/record/record.js +38 -4
- package/dist/web/workspace/composer.d.ts +7 -2
- package/dist/web/workspace/composer.js +24 -4
- package/dist/web/workspace/record.d.ts +1 -1
- package/package.json +3 -3
package/dist/core/copy.d.ts
CHANGED
|
@@ -94,6 +94,8 @@ export type FrameworkCopy = {
|
|
|
94
94
|
cancel: string;
|
|
95
95
|
/** While the dry run is asked. */
|
|
96
96
|
rehearsing: string;
|
|
97
|
+
/** Sends what an action asked for (`ask`). */
|
|
98
|
+
send: string;
|
|
97
99
|
};
|
|
98
100
|
failure: {
|
|
99
101
|
/** The server could not be reached at all — nothing it said is known. */
|
package/dist/core/copy.js
CHANGED
|
@@ -53,6 +53,7 @@ export const ENGLISH_FRAMEWORK_COPY = {
|
|
|
53
53
|
confirm: "Do it",
|
|
54
54
|
cancel: "Cancel",
|
|
55
55
|
rehearsing: "Checking what it would do…",
|
|
56
|
+
send: "Confirm",
|
|
56
57
|
},
|
|
57
58
|
failure: {
|
|
58
59
|
unreachable: "The server could not be reached",
|
|
@@ -141,6 +142,7 @@ export const SPANISH_FRAMEWORK_COPY = {
|
|
|
141
142
|
confirm: "Hacerlo",
|
|
142
143
|
cancel: "Cancelar",
|
|
143
144
|
rehearsing: "Revisando qué haría…",
|
|
145
|
+
send: "Confirmar",
|
|
144
146
|
},
|
|
145
147
|
failure: {
|
|
146
148
|
unreachable: "No se pudo hablar con el servidor",
|
package/dist/core/list.d.ts
CHANGED
|
@@ -40,6 +40,9 @@ export type ListDefinition<T extends AnyRecord = AnyRecord> = {
|
|
|
40
40
|
columns?: readonly string[];
|
|
41
41
|
/** The cuts it offers by name in the search bar. */
|
|
42
42
|
filters?: readonly NamedFilter<T>[];
|
|
43
|
+
/** The fields the search bar offers to look a typed text up in, in order — «Buscar Nombres:
|
|
44
|
+
* Excel». Without it, the ones the entity's search template names, else its display. */
|
|
45
|
+
facets?: readonly string[];
|
|
43
46
|
/** The faces it offers, the first one shown. */
|
|
44
47
|
views?: readonly ("table" | "rows" | "board" | "sheet" | "pivot")[];
|
|
45
48
|
/** Grouped from the start — the server counts the groups. */
|
package/dist/react/context.d.ts
CHANGED
|
@@ -81,6 +81,9 @@ export declare function FrameworkProvider({ transport, locale, metas: seed, enti
|
|
|
81
81
|
children: ReactNode;
|
|
82
82
|
}): import("react").JSX.Element;
|
|
83
83
|
export declare function useFramework(): FrameworkContextValue;
|
|
84
|
+
/** The provider's values, or `null` outside one: for a piece that works without it
|
|
85
|
+
* (`ServiceButton` runs a use case, which needs no provider). */
|
|
86
|
+
export declare function useFrameworkIfAny(): FrameworkContextValue | null;
|
|
84
87
|
/** The declared entity a relation points at (`"Cliente"`), or `undefined`. */
|
|
85
88
|
export declare function useEntityFor(target: string | undefined): Entity | undefined;
|
|
86
89
|
export {};
|
package/dist/react/context.js
CHANGED
|
@@ -91,6 +91,11 @@ export function useFramework() {
|
|
|
91
91
|
throw new Error("useFramework outside a FrameworkProvider");
|
|
92
92
|
return value;
|
|
93
93
|
}
|
|
94
|
+
/** The provider's values, or `null` outside one: for a piece that works without it
|
|
95
|
+
* (`ServiceButton` runs a use case, which needs no provider). */
|
|
96
|
+
export function useFrameworkIfAny() {
|
|
97
|
+
return useContext(FrameworkContext);
|
|
98
|
+
}
|
|
94
99
|
/** The declared entity a relation points at (`"Cliente"`), or `undefined`. */
|
|
95
100
|
export function useEntityFor(target) {
|
|
96
101
|
const { entities, metas } = useFramework();
|
package/dist/web/index.d.ts
CHANGED
|
@@ -7,9 +7,11 @@ export { EntitySearchBar } from "./list/EntitySearchBar.js";
|
|
|
7
7
|
export { groupableOf, pilesOf } from "./list/groups.js";
|
|
8
8
|
export { OpenInMenu } from "./list/openIn.js";
|
|
9
9
|
export { pivotOf } from "./list/pivot.js";
|
|
10
|
-
export { type CardLook, type ChoiceTones, type OptionLook, type Presentation, presentationOf, type Presented, presented, type RowLook, } from "./list/presentation.js";
|
|
10
|
+
export { type CardLook, type ChoiceTones, type OptionLook, type PartLook, partLookOf, type PartLooks, type PartOf, type Presentation, presentationOf, type Presented, presented, type RowLook, tonesOver, } from "./list/presentation.js";
|
|
11
11
|
export { type RowCommand, type RowCommands, useRowCommands, } from "./list/rowCommands.js";
|
|
12
12
|
export { facetsOf, modelOf } from "./list/search.js";
|
|
13
|
+
export { type ActionDialog, type Asked, } from "./record/ActionButton.js";
|
|
14
|
+
export { type AskedField, type AskField, type AskForm, askFormOf, } from "./record/ask.js";
|
|
13
15
|
export { CommandButton } from "./record/CommandButton.js";
|
|
14
16
|
export { RelationPicker } from "./record/control.js";
|
|
15
17
|
export { dirtyOf, type FieldControl, RecordField, } from "./record/edit.js";
|
|
@@ -17,7 +19,7 @@ export { EntityPicker } from "./record/EntityPicker.js";
|
|
|
17
19
|
export { EntityTags } from "./record/EntityTags.js";
|
|
18
20
|
export { type LineColumn, type LineControl, type LinesLook, RecordLinesEditor, } from "./record/lines.js";
|
|
19
21
|
export { type RecordOpening, RecordOpeningProvider, useRecordOpening, } from "./record/opening.js";
|
|
20
|
-
export { countOf, factsOf, RecordLines } from "./record/record.js";
|
|
22
|
+
export { countOf, factsOf, RecordLines, usePartLook, } from "./record/record.js";
|
|
21
23
|
export { RecordLifecycle } from "./record/RecordLifecycle.js";
|
|
22
24
|
export { RelatedList } from "./record/RelatedList.js";
|
|
23
25
|
export { ServiceButton } from "./record/ServiceButton.js";
|
package/dist/web/index.js
CHANGED
|
@@ -7,9 +7,11 @@ export { EntitySearchBar } from "./list/EntitySearchBar.js";
|
|
|
7
7
|
export { groupableOf, pilesOf } from "./list/groups.js";
|
|
8
8
|
export { OpenInMenu } from "./list/openIn.js";
|
|
9
9
|
export { pivotOf } from "./list/pivot.js";
|
|
10
|
-
export { presentationOf, presented, } from "./list/presentation.js";
|
|
10
|
+
export { partLookOf, presentationOf, presented, tonesOver, } from "./list/presentation.js";
|
|
11
11
|
export { useRowCommands, } from "./list/rowCommands.js";
|
|
12
12
|
export { facetsOf, modelOf } from "./list/search.js";
|
|
13
|
+
export {} from "./record/ActionButton.js";
|
|
14
|
+
export { askFormOf, } from "./record/ask.js";
|
|
13
15
|
export { CommandButton } from "./record/CommandButton.js";
|
|
14
16
|
export { RelationPicker } from "./record/control.js";
|
|
15
17
|
export { dirtyOf, RecordField, } from "./record/edit.js";
|
|
@@ -17,7 +19,7 @@ export { EntityPicker } from "./record/EntityPicker.js";
|
|
|
17
19
|
export { EntityTags } from "./record/EntityTags.js";
|
|
18
20
|
export { RecordLinesEditor, } from "./record/lines.js";
|
|
19
21
|
export { RecordOpeningProvider, useRecordOpening, } from "./record/opening.js";
|
|
20
|
-
export { countOf, factsOf, RecordLines } from "./record/record.js";
|
|
22
|
+
export { countOf, factsOf, RecordLines, usePartLook, } from "./record/record.js";
|
|
21
23
|
export { RecordLifecycle } from "./record/RecordLifecycle.js";
|
|
22
24
|
export { RelatedList } from "./record/RelatedList.js";
|
|
23
25
|
export { ServiceButton } from "./record/ServiceButton.js";
|
|
@@ -89,6 +89,9 @@ export type EntityListProps<T extends AnyRecord, C extends CommandBodies = Comma
|
|
|
89
89
|
sums?: readonly string[] | false;
|
|
90
90
|
/** The cuts this list offers by name: «sólo pagadas», «vencidas». */
|
|
91
91
|
filters?: readonly NamedFilter<T>[];
|
|
92
|
+
/** The fields the search bar offers to look a typed text up in. Without it, the list
|
|
93
|
+
* definition's, else the entity's search template's, else its display (`facetsOf`). */
|
|
94
|
+
facets?: readonly string[];
|
|
92
95
|
/** The fields «Group by» offers, in this order — among those the model lets split the set.
|
|
93
96
|
* Without it, the list definition's, else every one the model does. */
|
|
94
97
|
groupable?: readonly string[];
|
|
@@ -132,4 +135,4 @@ export type EntityFace<T> = {
|
|
|
132
135
|
render: (set: ListSet<T>) => ReactNode;
|
|
133
136
|
};
|
|
134
137
|
export type View = "table" | "rows" | "board" | "sheet" | "pivot";
|
|
135
|
-
export declare function EntityList<T extends AnyRecord, C extends CommandBodies = CommandBodies>({ listing, api, columns: askedColumns, cells, views: askedViews, title: askedTitle, description: askedDescription, crumbs, actions, onOpen, onPeek, openTargets, onOpenIn, pivot: pivotAsked, empty, search, sums, filters: askedFilters, groupable: askedGroupable, selectable, selectionActions, embedded, create, commands, rowActions: askedRowActions, faces, }: EntityListProps<T, C>): import("react").JSX.Element;
|
|
138
|
+
export declare function EntityList<T extends AnyRecord, C extends CommandBodies = CommandBodies>({ listing, api, columns: askedColumns, cells, views: askedViews, title: askedTitle, description: askedDescription, crumbs, actions, onOpen, onPeek, openTargets, onOpenIn, pivot: pivotAsked, empty, search, sums, filters: askedFilters, facets: askedFacets, groupable: askedGroupable, selectable, selectionActions, embedded, create, commands, rowActions: askedRowActions, faces, }: EntityListProps<T, C>): import("react").JSX.Element;
|
|
@@ -33,7 +33,7 @@ const TRAILS = 50;
|
|
|
33
33
|
const NO_COMMANDS = [];
|
|
34
34
|
/** What a list offers when nobody said: every face that needs no configuration. */
|
|
35
35
|
const EVERY_VIEW = ["table", "rows", "board", "sheet"];
|
|
36
|
-
export function EntityList({ listing, api, columns: askedColumns, cells, views: askedViews, title: askedTitle, description: askedDescription, crumbs, actions, onOpen, onPeek, openTargets, onOpenIn, pivot: pivotAsked, empty, search = "bar", sums, filters: askedFilters, groupable: askedGroupable, selectable = false, selectionActions, embedded = false, create = true, commands = NO_COMMANDS, rowActions: askedRowActions, faces, }) {
|
|
36
|
+
export function EntityList({ listing, api, columns: askedColumns, cells, views: askedViews, title: askedTitle, description: askedDescription, crumbs, actions, onOpen, onPeek, openTargets, onOpenIn, pivot: pivotAsked, empty, search = "bar", sums, filters: askedFilters, facets: askedFacets, groupable: askedGroupable, selectable = false, selectionActions, embedded = false, create = true, commands = NO_COMMANDS, rowActions: askedRowActions, faces, }) {
|
|
37
37
|
// A named list (`defineList`) brings its own columns, filters, faces and words; what the
|
|
38
38
|
// screen passes wins.
|
|
39
39
|
const definition = listing.definition;
|
|
@@ -45,6 +45,7 @@ export function EntityList({ listing, api, columns: askedColumns, cells, views:
|
|
|
45
45
|
(embedded ? ["table"] : pivotAsked === undefined ? EVERY_VIEW : [...EVERY_VIEW, "pivot"]);
|
|
46
46
|
const filters = askedFilters ?? definition?.filters ?? [];
|
|
47
47
|
const groupable = askedGroupable ?? definition?.groupable;
|
|
48
|
+
const facets = askedFacets ?? definition?.facets;
|
|
48
49
|
const title = askedTitle ?? definition?.title;
|
|
49
50
|
const description = askedDescription ?? definition?.description;
|
|
50
51
|
const copy = frameworkCopy().list;
|
|
@@ -323,12 +324,15 @@ export function EntityList({ listing, api, columns: askedColumns, cells, views:
|
|
|
323
324
|
// grouped set (each group says its own, counted by the server). While the rows are not the
|
|
324
325
|
// whole set the list says the figures are this page's (`pageTotals`): the server's total over
|
|
325
326
|
// everything filtered waits on a reading of measures (sincpro_framework, PRD_09).
|
|
326
|
-
const totalled = !grouped &&
|
|
327
|
-
listing.rows.length > 0 &&
|
|
328
|
-
shown.some((column) => column.aggregate !== undefined && !column.defaultHidden);
|
|
329
327
|
const partial = listing.paging === "pages"
|
|
330
328
|
? page.hasPrev || page.hasNext
|
|
331
329
|
: listing.hasMore || listing.capped;
|
|
330
|
+
// Inside a record or a panel a list is its rows: a page's sum there reads as THE total, so an
|
|
331
|
+
// embedded list adds up only when every row is in hand.
|
|
332
|
+
const totalled = !grouped &&
|
|
333
|
+
!(embedded && partial) &&
|
|
334
|
+
listing.rows.length > 0 &&
|
|
335
|
+
shown.some((column) => column.aggregate !== undefined && !column.defaultHidden);
|
|
332
336
|
// A row's actions: the entity's Commands, then whatever else the screen offers.
|
|
333
337
|
// The trash (`trashOf`): each row is brought back from where it is, with the entity's own
|
|
334
338
|
// `restore` — it can be undone, so it runs on the click; the list reads again after.
|
|
@@ -348,13 +352,20 @@ export function EntityList({ listing, api, columns: askedColumns, cells, views:
|
|
|
348
352
|
? undefined
|
|
349
353
|
: (row) => [...rowCommands.rowActions(row), ...(askedRowActions?.(row) ?? [])];
|
|
350
354
|
const refused = rowCommands.error === null ? null : explain(rowCommands.error);
|
|
355
|
+
// The way through the set. Inside a record or a panel, only while there is more than what is
|
|
356
|
+
// on screen: «1–5 / 5» repeats the rows.
|
|
357
|
+
const fits = embedded && !partial;
|
|
358
|
+
const through = grouped ? (groups.status !== "ready" ? null : (_jsx("span", { className: "text-meta text-muted", children: groups.capped
|
|
359
|
+
? copy.groupsCapped(groups.buckets.length)
|
|
360
|
+
: copy.groups(groups.buckets.length, records) }))) : fits ? null : listing.paging === "pages" ? (page.from === 0 ? null : (_jsx(Pagination, { from: page.from, to: page.to, total: count?.value ?? page.to, ...(page.hasPrev ? { onPrev: listing.prev } : {}), ...(page.hasNext ? { onNext: listing.next } : {}) }))) : (_jsxs(_Fragment, { children: [count === null ? null : (_jsx("span", { className: "text-meta text-muted", children: copy.shown(listing.rows.length, count.value, count.exact) })), listing.capped ? (_jsx("span", { className: "text-meta text-muted", children: copy.capped(listing.rows.length) })) : listing.hasMore ? (_jsx(Button, { size: "sm", role: "secondary", disabled: listing.status === "loadingMore", onClick: listing.more, children: listing.status === "loadingMore" ? copy.loading : copy.loadMore })) : null] }));
|
|
361
|
+
const pageTotals = totalled && partial && present === "table";
|
|
362
|
+
// Written only when it says something: web-ui draws an embedded list's bar for any slot
|
|
363
|
+
// written, an empty one too.
|
|
364
|
+
const paging = !pageTotals && dropped.length === 0 && through === null ? null : (_jsxs(_Fragment, { children: [pageTotals ? _jsx("span", { className: "text-meta text-muted", children: copy.pageTotals }) : null, dropped.length === 0 ? null : (_jsx(Tag, { tone: "warn", title: copy.dropped(dropped), children: copy.dropped(dropped) })), through] }));
|
|
351
365
|
return (_jsxs(List, { items: listing.rows, keyOf: idOf, embedded: embedded, present: present, onPresentChange: setPresent, ...grouping,
|
|
352
366
|
// The whole order, as web-ui 1.7 shows and sets it: ⇧-click on a header adds a field,
|
|
353
367
|
// the sort menu reorders them — the same list the criteria builder writes.
|
|
354
|
-
sort: sortStates,
|
|
355
|
-
// The faces with no headers (rows, board) sort too, by the fields the model marks
|
|
356
|
-
// sortable — on the server, so no `value` is given.
|
|
357
|
-
sortable: sortable, onSortChange: (next) => listing.orderBy(next.map((one) => ({ field: one.key, descending: one.direction === "desc" }))), state: {
|
|
368
|
+
sort: sortStates, ...(embedded ? {} : { sortable }), onSortChange: (next) => listing.orderBy(next.map((one) => ({ field: one.key, descending: one.direction === "desc" }))), state: {
|
|
358
369
|
// Only the FIRST reading shows the skeleton. Refining (typing, a filter, the next
|
|
359
370
|
// page) keeps the rows on screen until the server answers: web-ui swaps the body for
|
|
360
371
|
// a skeleton while `loading`, and a row that vanished under the pointer lost a click.
|
|
@@ -371,14 +382,12 @@ export function EntityList({ listing, api, columns: askedColumns, cells, views:
|
|
|
371
382
|
}, filtered: listing.selection !== undefined || listing.text !== "", empty: {
|
|
372
383
|
sentence: empty ?? copy.empty,
|
|
373
384
|
whenFiltered: { sentence: copy.emptyFiltered },
|
|
374
|
-
}, ...(selection === undefined ? {} : { selection }), ...(opening === undefined ? {} : { onOpen: opening }), ...(peeking === undefined ? {} : { onPeek: peeking, rowClick: "open" }), children: [_jsxs(List.Bar, { children: [trail === undefined || trail.length === 0 ? null : _jsx(List.Crumbs, { crumbs: trail }), embedded ? null : (_jsx(List.Identity, { title: title ?? nameOf(meta, locale), ...(description === undefined ? {} : { description }) })), search === "bar" ? (_jsx(List.Search, { children: _jsx(EntitySearchBar, { listing: listing, filters: filters, groups: groups, ...(groupable === undefined ? {} : { groupable }), ...(asked === "" ? {} : { seed: asked }) }) })) : null, search === "box" && meta?.search != null ? (_jsx(List.Search, { children: _jsx(SearchField, { value: draft, onChange: (next) => {
|
|
385
|
+
}, ...(selection === undefined ? {} : { selection }), ...(opening === undefined ? {} : { onOpen: opening }), ...(peeking === undefined ? {} : { onPeek: peeking, rowClick: "open" }), children: [_jsxs(List.Bar, { children: [trail === undefined || trail.length === 0 ? null : _jsx(List.Crumbs, { crumbs: trail }), embedded ? null : (_jsx(List.Identity, { title: title ?? nameOf(meta, locale), ...(description === undefined ? {} : { description }) })), search === "bar" ? (_jsx(List.Search, { children: _jsx(EntitySearchBar, { listing: listing, filters: filters, groups: groups, ...(groupable === undefined ? {} : { groupable }), ...(facets === undefined ? {} : { facets }), ...(asked === "" ? {} : { seed: asked }) }) })) : null, search === "box" && meta?.search != null ? (_jsx(List.Search, { children: _jsx(SearchField, { value: draft, onChange: (next) => {
|
|
375
386
|
setDraft(next);
|
|
376
387
|
// Emptied (or cleared with ×): the whole set again, at once.
|
|
377
388
|
if (next === "" && listing.text !== "")
|
|
378
389
|
listing.search("", { now: true });
|
|
379
|
-
}, onSubmit: (text) => listing.search(text, { now: true }), placeholder: copy.search, "aria-label": copy.search }) })) : null, actions === undefined && creating === undefined ? null : (_jsxs(List.Actions, { children: [actions, creating === undefined ? null : (_jsx(Button, { role: "primary", size: "sm", onClick: creating, children: frameworkCopy().record.create }))] })),
|
|
380
|
-
? copy.groupsCapped(groups.buckets.length)
|
|
381
|
-
: copy.groups(groups.buckets.length, records) }))) : listing.paging === "pages" ? (page.from === 0 ? null : (_jsx(Pagination, { from: page.from, to: page.to, total: count?.value ?? page.to, ...(page.hasPrev ? { onPrev: listing.prev } : {}), ...(page.hasNext ? { onNext: listing.next } : {}) }))) : (_jsxs(_Fragment, { children: [count === null ? null : (_jsx("span", { className: "text-meta text-muted", children: copy.shown(listing.rows.length, count.value, count.exact) })), listing.capped ? (_jsx("span", { className: "text-meta text-muted", children: copy.capped(listing.rows.length) })) : listing.hasMore ? (_jsx(Button, { size: "sm", role: "secondary", disabled: listing.status === "loadingMore", onClick: listing.more, children: listing.status === "loadingMore" ? copy.loading : copy.loadMore })) : null] }))] })] }), views.includes("table") ? (_jsx(List.Table, { columns: shown, ...(totalled ? { totals: true } : {}), ...(rowActions === undefined ? {} : { rowActions }) })) : null, _jsx(List.Rows, { row: rowOf }), views.includes("sheet") ? (_jsx(List.Sheet, { columns: sheetColumns, cell: (row, column) => {
|
|
390
|
+
}, onSubmit: (text) => listing.search(text, { now: true }), placeholder: copy.search, "aria-label": copy.search }) })) : null, actions === undefined && creating === undefined ? null : (_jsxs(List.Actions, { children: [actions, creating === undefined ? null : (_jsx(Button, { role: "primary", size: "sm", onClick: creating, children: frameworkCopy().record.create }))] })), paging === null ? null : _jsx(List.Pagination, { children: paging })] }), views.includes("table") ? (_jsx(List.Table, { columns: shown, ...(totalled ? { totals: true } : {}), ...(rowActions === undefined ? {} : { rowActions }) })) : null, _jsx(List.Rows, { row: rowOf }), views.includes("sheet") ? (_jsx(List.Sheet, { columns: sheetColumns, cell: (row, column) => {
|
|
382
391
|
const value = row[column.id];
|
|
383
392
|
return value === null || value === undefined
|
|
384
393
|
? null
|
|
@@ -12,7 +12,8 @@ import type { Listing } from "../../react/useListing.js";
|
|
|
12
12
|
* - a free text is the entity's LITERAL search — its whole template, every field at once
|
|
13
13
|
* (sincpro_framework's `LiteralSearch`, the same question a many2one and ⌘K ask): it is
|
|
14
14
|
* what Enter puts, unless the model reads the text as a question of its own;
|
|
15
|
-
* - «search by name»: facets are the fields the
|
|
15
|
+
* - «search by name»: facets are the fields the screen names (`facets`), else the ones the
|
|
16
|
+
* entity's search template names — never every text field;
|
|
16
17
|
* - a typed question («total > 5000») is checked against each field's operators;
|
|
17
18
|
* - a named filter is one click; the builder writes what nobody foresaw (all/any/not);
|
|
18
19
|
* - everything put becomes ONE `selection` the SERVER answers (`listing.filter`) — web-ui
|
|
@@ -23,7 +24,7 @@ import type { Listing } from "../../react/useListing.js";
|
|
|
23
24
|
* <List.Search><EntitySearchBar listing={listing} filters={…} /></List.Search>
|
|
24
25
|
*/
|
|
25
26
|
export type { NamedFilter };
|
|
26
|
-
export declare function EntitySearchBar<T extends AnyRecord>({ listing, filters, groups, groupable: only, seed, }: {
|
|
27
|
+
export declare function EntitySearchBar<T extends AnyRecord>({ listing, filters, groups, groupable: only, facets: named, seed, }: {
|
|
27
28
|
listing: Listing<T>;
|
|
28
29
|
/** The cuts this set offers by name: «sólo pagadas», «vencidas». */
|
|
29
30
|
filters?: readonly NamedFilter<T>[];
|
|
@@ -32,6 +33,9 @@ export declare function EntitySearchBar<T extends AnyRecord>({ listing, filters,
|
|
|
32
33
|
/** The fields «Group by» offers, in this order — among those the model lets split the set.
|
|
33
34
|
* Without it, every one it does. */
|
|
34
35
|
groupable?: readonly string[];
|
|
36
|
+
/** The fields a typed text is offered to be looked up in, in order. Without it, the ones the
|
|
37
|
+
* entity's search template names, else its display (`facetsOf`). */
|
|
38
|
+
facets?: readonly string[];
|
|
35
39
|
/** A text to start on, put as the literal search chip — what was typed in a picker whose
|
|
36
40
|
* «Buscar más…» opened this list. */
|
|
37
41
|
seed?: string;
|
|
@@ -8,13 +8,21 @@ import { CriteriaBuilder, describeFilter, Dialog, fillCopy, filterCriteria, Grou
|
|
|
8
8
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
9
9
|
/** No grouping: one constant, so the control is not handed a new array on every render. */
|
|
10
10
|
const NO_LEVELS = [];
|
|
11
|
-
export function EntitySearchBar({ listing, filters = [], groups, groupable: only, seed, }) {
|
|
11
|
+
export function EntitySearchBar({ listing, filters = [], groups, groupable: only, facets: named, seed, }) {
|
|
12
12
|
const copy = frameworkCopy().list;
|
|
13
13
|
const { meta, locale } = listing;
|
|
14
14
|
const [put, setPut] = useState([]);
|
|
15
15
|
const [building, setBuilding] = useState(false);
|
|
16
16
|
const model = useMemo(() => (meta ? modelOf(meta, locale) : undefined), [meta, locale]);
|
|
17
|
-
|
|
17
|
+
// Compared by content: a screen usually writes the list inline.
|
|
18
|
+
const naming = named?.join("\u0000");
|
|
19
|
+
const facets = useMemo(() => (meta ? facetsOf(meta, locale, named) : []),
|
|
20
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
21
|
+
[meta, locale, naming]);
|
|
22
|
+
// The bar's model: its text fields are only the facets — every other one is the builder's.
|
|
23
|
+
const asked = useMemo(() => meta
|
|
24
|
+
? modelOf(meta, locale, facets.map((one) => one.id))
|
|
25
|
+
: undefined, [meta, locale, facets]);
|
|
18
26
|
const groupable = useMemo(() => groupableOf(meta, locale, only), [meta, locale, only]);
|
|
19
27
|
const ui = useUiCopy();
|
|
20
28
|
const seeded = useRef(false);
|
|
@@ -43,7 +51,7 @@ export function EntitySearchBar({ listing, filters = [], groups, groupable: only
|
|
|
43
51
|
};
|
|
44
52
|
// What the bar holds, as one selection: what the builder opens on.
|
|
45
53
|
const current = selectionOf(put);
|
|
46
|
-
return (_jsxs(_Fragment, { children: [_jsx(SearchBar, { facets: facets, model: model, criteria: put, onCriteriaChange: place, placeholder: copy.searchBar, ...(filters.length === 0
|
|
54
|
+
return (_jsxs(_Fragment, { children: [_jsx(SearchBar, { facets: facets, model: asked ?? model, criteria: put, onCriteriaChange: place, placeholder: copy.searchBar, ...(filters.length === 0
|
|
47
55
|
? {}
|
|
48
56
|
: {
|
|
49
57
|
filters: [
|
package/dist/web/list/columns.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
3
|
import { frameworkCopy } from "../../core/copy.js";
|
|
3
4
|
import { totalOf } from "../../core/measure.js";
|
|
4
5
|
import { BOOKKEEPING, defaultFields, fieldMetaOf, sortKeyOf, textOf, valueAt, viewOf, } from "../../core/present.js";
|
|
6
|
+
import { relationFieldOf } from "../../core/relation.js";
|
|
7
|
+
import { useEntityFor } from "../../react/context.js";
|
|
8
|
+
import { useNameOf } from "../../react/useNameOf.js";
|
|
5
9
|
import { Tag } from "@sincpro/web-ui";
|
|
6
10
|
import { Check } from "lucide-react";
|
|
7
11
|
/**
|
|
@@ -14,7 +18,9 @@ import { Check } from "lucide-react";
|
|
|
14
18
|
* can be ordered is what the server said (`sortable`). A cell is drawn by its TYPE: a choice is a
|
|
15
19
|
* tag in the tone the application declared for its value (`presented(entity, { tones })`), a
|
|
16
20
|
* yes/no a check, an amount the model draws as money is money. A cell that needs more — a link,
|
|
17
|
-
* a figure of its own — is the one thing a screen writes (`cells`).
|
|
21
|
+
* a figure of its own — is the one thing a screen writes (`cells`). A column that holds a key of
|
|
22
|
+
* another record (`organo_id`, an `EntityID`) reads the record's name, as its picker does: every
|
|
23
|
+
* key of the page asked in ONE request per entity (`useNameOf`), the key until it answers.
|
|
18
24
|
*
|
|
19
25
|
* A column the model adds up at a list's foot (`total`: `sum`, `avg`, `min`, `max`) declares it
|
|
20
26
|
* (`aggregate`), with its own format: the foot reads «Bs 1.204,50» like the cells above it.
|
|
@@ -36,6 +42,11 @@ export function aggregateOf(meta, name) {
|
|
|
36
42
|
const total = totalOf(meta, name);
|
|
37
43
|
return total === undefined ? undefined : AGGREGATES[total];
|
|
38
44
|
}
|
|
45
|
+
/** A key's cell: the name of the record it points at, the key until it answers or when the
|
|
46
|
+
* application declared no entity for it. */
|
|
47
|
+
function KeyName({ target, id }) {
|
|
48
|
+
return _jsx(_Fragment, { children: useNameOf(useEntityFor(target), id) ?? id });
|
|
49
|
+
}
|
|
39
50
|
function columnOf(meta, name, options, hidden) {
|
|
40
51
|
const view = viewOf(meta, name, options.locale);
|
|
41
52
|
const field = fieldMetaOf(meta, name);
|
|
@@ -48,12 +59,28 @@ function columnOf(meta, name, options, hidden) {
|
|
|
48
59
|
const tones = options.tones?.[name];
|
|
49
60
|
const choice = (field?.choices?.length ?? 0) > 0;
|
|
50
61
|
const aggregate = aggregateOf(meta, name);
|
|
62
|
+
// The column IS a key of another record: `customer_id` beside its relation, or a key alone.
|
|
63
|
+
const relation = relationFieldOf(meta, name);
|
|
64
|
+
const pointing = relation !== undefined && !relation.many && relation.key === name ? relation : undefined;
|
|
65
|
+
const named = pointing === undefined
|
|
66
|
+
? undefined
|
|
67
|
+
: (row) => {
|
|
68
|
+
const key = raw(row);
|
|
69
|
+
if (key === null || key === undefined || key === "")
|
|
70
|
+
return null;
|
|
71
|
+
// Held beside its key, the record names itself; a key alone asks its name.
|
|
72
|
+
const held = pointing.relation === name
|
|
73
|
+
? null
|
|
74
|
+
: textOf(meta, pointing.relation, row[pointing.relation], options.locale);
|
|
75
|
+
return held ?? _jsx(KeyName, { target: pointing.target, id: String(key) });
|
|
76
|
+
};
|
|
51
77
|
return {
|
|
52
78
|
id: name,
|
|
53
79
|
header: view.label,
|
|
54
80
|
field: name,
|
|
55
81
|
value: (row) => sortKeyOf(meta, name, raw(row)),
|
|
56
82
|
cell: own ??
|
|
83
|
+
named ??
|
|
57
84
|
(choice
|
|
58
85
|
? // A state reads at a glance: its word in a tag, in the tone the application gave it.
|
|
59
86
|
(row) => {
|
|
@@ -58,6 +58,28 @@ export type Presentation<T> = {
|
|
|
58
58
|
/** The fields a table of its records shows when the screen names none — on its own list and
|
|
59
59
|
* inside another record (a one2many) alike. Without it, every field but the stamps. */
|
|
60
60
|
columns?: readonly (keyof T & string)[];
|
|
61
|
+
/**
|
|
62
|
+
* How the parts its records hold look — the rows of a relation with no entity of its own (an
|
|
63
|
+
* issue's runs, a tenant's members), by the relation's name, typed by the part:
|
|
64
|
+
*
|
|
65
|
+
* presented(issues, { tones: { status: ISSUE_TONE }, parts: { runs: { tones: { status: RUN_TONE } } } })
|
|
66
|
+
*
|
|
67
|
+
* Context: a part has no route, so there is no `presented(runs, …)` to declare it with; its
|
|
68
|
+
* look belongs to the record that holds it. Declared here, every place that draws those rows
|
|
69
|
+
* reads it — `RecordLines`, the lines editor, a `RecordField` — and a screen passes its own
|
|
70
|
+
* only to change it.
|
|
71
|
+
*/
|
|
72
|
+
parts?: PartLooks<T>;
|
|
73
|
+
};
|
|
74
|
+
/** How a record's part looks: what `Presentation` says of an entity, for a row it holds. */
|
|
75
|
+
export type PartLook<P> = Pick<Presentation<P>, "tones" | "columns">;
|
|
76
|
+
/** The record a field holds many of — an `EntityCollection<Run>`, a `Run[]` — or `never`. */
|
|
77
|
+
export type PartOf<V> = unknown extends V ? AnyRecord : NonNullable<V> extends {
|
|
78
|
+
readonly items: readonly (infer P)[];
|
|
79
|
+
} ? P : NonNullable<V> extends readonly (infer P)[] ? P : never;
|
|
80
|
+
/** A part's look by the name of the field that holds it — only fields that hold many. */
|
|
81
|
+
export type PartLooks<T> = {
|
|
82
|
+
readonly [K in keyof T & string as [PartOf<T[K]>] extends [never] ? never : K]?: PartLook<PartOf<T[K]>>;
|
|
61
83
|
};
|
|
62
84
|
export type Presented<T extends AnyRecord, C extends CommandBodies = CommandBodies, A extends CommandAnswers = CommandAnswers> = Entity<T, C, A> & {
|
|
63
85
|
readonly presentation: Presentation<T>;
|
|
@@ -66,5 +88,13 @@ export type Presented<T extends AnyRecord, C extends CommandBodies = CommandBodi
|
|
|
66
88
|
export declare function presented<T extends AnyRecord, C extends CommandBodies = CommandBodies, A extends CommandAnswers = CommandAnswers>(entity: Entity<T, C, A>, presentation: Presentation<T>): Presented<T, C, A>;
|
|
67
89
|
/** The presentation an entity — or the entity of a named list — was declared with; none is `{}`. */
|
|
68
90
|
export declare function presentationOf<T extends AnyRecord>(source: Entity<T> | ListDefinition<T>): Presentation<T>;
|
|
91
|
+
/** How the parts an entity's records hold under `name` look; `{}` when it declares nothing. */
|
|
92
|
+
export declare function partLookOf(entity: Entity | ListDefinition<AnyRecord> | undefined, name: string): PartLook<AnyRecord>;
|
|
93
|
+
/**
|
|
94
|
+
* The tones of each layer over the one before, value by value — the entity's, then a part's
|
|
95
|
+
* declaration, then the screen's: a screen that colours `failed` keeps the declared `done`.
|
|
96
|
+
* `undefined` when no layer says anything.
|
|
97
|
+
*/
|
|
98
|
+
export declare function tonesOver<T>(...layers: readonly (ChoiceTones<T> | undefined)[]): ChoiceTones<T> | undefined;
|
|
69
99
|
/** `look` over `base`, leaving out what `look` sets to `undefined`: «no tags» is not a hole. */
|
|
70
100
|
export declare function over<B extends object, L extends object>(base: B, look: L | undefined): B;
|
|
@@ -10,6 +10,30 @@ export function presentationOf(source) {
|
|
|
10
10
|
const base = isList(source) ? source.entity : source;
|
|
11
11
|
return "presentation" in base ? base.presentation : {};
|
|
12
12
|
}
|
|
13
|
+
/** How the parts an entity's records hold under `name` look; `{}` when it declares nothing. */
|
|
14
|
+
export function partLookOf(entity, name) {
|
|
15
|
+
if (entity === undefined)
|
|
16
|
+
return {};
|
|
17
|
+
const parts = presentationOf(entity).parts;
|
|
18
|
+
return parts?.[name] ?? {};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The tones of each layer over the one before, value by value — the entity's, then a part's
|
|
22
|
+
* declaration, then the screen's: a screen that colours `failed` keeps the declared `done`.
|
|
23
|
+
* `undefined` when no layer says anything.
|
|
24
|
+
*/
|
|
25
|
+
export function tonesOver(...layers) {
|
|
26
|
+
const said = layers.filter((one) => one !== undefined);
|
|
27
|
+
if (said.length === 0)
|
|
28
|
+
return undefined;
|
|
29
|
+
if (said.length === 1)
|
|
30
|
+
return said[0];
|
|
31
|
+
const out = {};
|
|
32
|
+
for (const layer of said)
|
|
33
|
+
for (const [field, tones] of Object.entries(layer))
|
|
34
|
+
out[field] = { ...out[field], ...tones };
|
|
35
|
+
return out;
|
|
36
|
+
}
|
|
13
37
|
/** `look` over `base`, leaving out what `look` sets to `undefined`: «no tags» is not a hole. */
|
|
14
38
|
export function over(base, look) {
|
|
15
39
|
if (look === undefined)
|
|
@@ -11,11 +11,20 @@ import type { ModelDefinition, SearchFacet } from "@sincpro/web-ui";
|
|
|
11
11
|
*
|
|
12
12
|
* Known gap: web-ui's field has `choices` but no word for each choice, so the bar offers an
|
|
13
13
|
* enum's raw values («paid») where a cell says «Pagada». Fixing it is web-ui's.
|
|
14
|
+
*
|
|
15
|
+
* `texts` keeps only those plain text fields: web-ui's bar offers a typed word in EVERY text
|
|
16
|
+
* field of the model it is handed (its `facets` are read only without one), so the bar is handed
|
|
17
|
+
* the model with the text fields a person types into (`facetsOf`) — and the criteria builder the
|
|
18
|
+
* whole one.
|
|
14
19
|
*/
|
|
15
|
-
export declare function modelOf(meta: Meta, locale?: string): ModelDefinition;
|
|
20
|
+
export declare function modelOf(meta: Meta, locale?: string, texts?: readonly string[]): ModelDefinition;
|
|
16
21
|
/**
|
|
17
|
-
* Where a typed text can be looked for: the fields the
|
|
18
|
-
*
|
|
19
|
-
*
|
|
22
|
+
* Where a typed text can be looked for: the fields the screen names (`defineList facets`), else
|
|
23
|
+
* the ones the entity's search template names — what a typed text already means for it —, else
|
|
24
|
+
* its display field.
|
|
25
|
+
*
|
|
26
|
+
* Context: it used to append every text field that takes `like`, and «Excel» in a list of
|
|
27
|
+
* enrollments offered sixteen places to look, «ID» and a storage key among them. Which fields a
|
|
28
|
+
* person types into is the screen's decision; every other field is still in the criteria builder.
|
|
20
29
|
*/
|
|
21
|
-
export declare function facetsOf(meta: Meta, locale?: string): SearchFacet[];
|
|
30
|
+
export declare function facetsOf(meta: Meta, locale?: string, named?: readonly string[]): SearchFacet[];
|
package/dist/web/list/search.js
CHANGED
|
@@ -10,13 +10,25 @@ import { labelOf } from "@sincpro/criteria";
|
|
|
10
10
|
*
|
|
11
11
|
* Known gap: web-ui's field has `choices` but no word for each choice, so the bar offers an
|
|
12
12
|
* enum's raw values («paid») where a cell says «Pagada». Fixing it is web-ui's.
|
|
13
|
+
*
|
|
14
|
+
* `texts` keeps only those plain text fields: web-ui's bar offers a typed word in EVERY text
|
|
15
|
+
* field of the model it is handed (its `facets` are read only without one), so the bar is handed
|
|
16
|
+
* the model with the text fields a person types into (`facetsOf`) — and the criteria builder the
|
|
17
|
+
* whole one.
|
|
13
18
|
*/
|
|
14
|
-
export function modelOf(meta, locale) {
|
|
15
|
-
const
|
|
19
|
+
export function modelOf(meta, locale, texts) {
|
|
20
|
+
const kept = (name) => {
|
|
21
|
+
const field = meta.fields[name];
|
|
22
|
+
const text = field?.type === "text" && !field.choices?.length;
|
|
23
|
+
return texts === undefined || !text || texts.includes(name);
|
|
24
|
+
};
|
|
25
|
+
const names = Object.keys(meta.fields).filter(kept);
|
|
16
26
|
return {
|
|
17
27
|
aggregate: meta.aggregate,
|
|
18
28
|
identity: meta.identity,
|
|
19
|
-
fields: Object.fromEntries(Object.entries(meta.fields)
|
|
29
|
+
fields: Object.fromEntries(Object.entries(meta.fields)
|
|
30
|
+
.filter(([name]) => kept(name))
|
|
31
|
+
.map(([name, field]) => [
|
|
20
32
|
name,
|
|
21
33
|
{
|
|
22
34
|
type: field.type,
|
|
@@ -26,7 +38,9 @@ export function modelOf(meta, locale) {
|
|
|
26
38
|
kind: field.kind,
|
|
27
39
|
...(field.many === undefined ? {} : { many: field.many }),
|
|
28
40
|
...(field.relation === undefined ? {} : { relation: field.relation }),
|
|
29
|
-
...(field.identified_by === undefined
|
|
41
|
+
...(field.identified_by === undefined
|
|
42
|
+
? {}
|
|
43
|
+
: { identifiedBy: field.identified_by }),
|
|
30
44
|
...(field.choices && field.choices.length > 0 ? { choices: field.choices } : {}),
|
|
31
45
|
},
|
|
32
46
|
])),
|
|
@@ -58,15 +72,16 @@ function searchedFields(meta) {
|
|
|
58
72
|
return found;
|
|
59
73
|
}
|
|
60
74
|
/**
|
|
61
|
-
* Where a typed text can be looked for: the fields the
|
|
62
|
-
*
|
|
63
|
-
*
|
|
75
|
+
* Where a typed text can be looked for: the fields the screen names (`defineList facets`), else
|
|
76
|
+
* the ones the entity's search template names — what a typed text already means for it —, else
|
|
77
|
+
* its display field.
|
|
78
|
+
*
|
|
79
|
+
* Context: it used to append every text field that takes `like`, and «Excel» in a list of
|
|
80
|
+
* enrollments offered sixteen places to look, «ID» and a storage key among them. Which fields a
|
|
81
|
+
* person types into is the screen's decision; every other field is still in the criteria builder.
|
|
64
82
|
*/
|
|
65
|
-
export function facetsOf(meta, locale) {
|
|
66
|
-
const
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
.map(([name]) => name);
|
|
70
|
-
const order = [...new Set([...first, ...texts])];
|
|
71
|
-
return order.map((name) => ({ id: name, label: labelOf(meta, name, locale) }));
|
|
83
|
+
export function facetsOf(meta, locale, named) {
|
|
84
|
+
const searched = [...new Set(searchedFields(meta))];
|
|
85
|
+
const fields = named ?? (searched.length > 0 ? searched : meta.display ? [meta.display] : []);
|
|
86
|
+
return fields.map((name) => ({ id: name, label: labelOf(meta, name, locale) }));
|
|
72
87
|
}
|
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
import type { Rehearsal } from "../../react/useCommand.js";
|
|
2
|
+
import type { AskForm } from "./ask.js";
|
|
3
|
+
/** What a person filled in before the action runs, by field name. */
|
|
4
|
+
export type Asked = Readonly<Record<string, unknown>>;
|
|
5
|
+
/** What an action's window says, when the screen says it its way. */
|
|
6
|
+
export type ActionDialog = {
|
|
7
|
+
/** Its title — the button's label without the «…» that said a window would open. */
|
|
8
|
+
title?: string;
|
|
9
|
+
/** One sentence under the title: what the action does, or what it takes. */
|
|
10
|
+
subtitle?: string;
|
|
11
|
+
};
|
|
2
12
|
/**
|
|
3
13
|
* What a button needs of an action to draw it — whatever runs behind: an entity's Command
|
|
4
14
|
* (`useCommand`) or one of the application's use cases (`useService`).
|
|
5
15
|
*/
|
|
6
16
|
export type ButtonAction<R> = {
|
|
7
|
-
/** Does it
|
|
8
|
-
|
|
17
|
+
/** Does it — with what was asked, when it asks —; `undefined` when it failed: the failure is
|
|
18
|
+
* in `error`. */
|
|
19
|
+
run: (asked?: Asked) => Promise<R | undefined>;
|
|
9
20
|
/** Asks first what it would do — a dry run: the action destroys something. */
|
|
10
|
-
rehearse?: () => Promise<Rehearsal | undefined>;
|
|
21
|
+
rehearse?: (asked?: Asked) => Promise<Rehearsal | undefined>;
|
|
11
22
|
busy: boolean;
|
|
12
23
|
error: unknown;
|
|
13
24
|
/** What the last dry run said it would do. */
|
|
@@ -23,12 +34,23 @@ export type ButtonAction<R> = {
|
|
|
23
34
|
* confirmation is the consequence, in the server's words, not a question. A refusal is shown
|
|
24
35
|
* where it happened, with what to do. Off while it runs: a click twice is one action.
|
|
25
36
|
*
|
|
37
|
+
* One that needs input (`ask`) opens its fields first, filled from the record, and sends them on
|
|
38
|
+
* «Confirmar»; when it can rehearse, the first «Confirmar» asks what it would do with them and
|
|
39
|
+
* the second does it. A refusal stays in the dialog over the fields, so they can be put right.
|
|
40
|
+
*
|
|
41
|
+
* Its window is titled by the label without its «…», and says more only when the screen does
|
|
42
|
+
* (`dialog`: its own title, a sentence under it).
|
|
43
|
+
*
|
|
26
44
|
* Internal: the gesture is drawn here once; what runs behind is each button's own.
|
|
27
45
|
*/
|
|
28
|
-
export declare function ActionButton<R>({ action, label, role, disabled, onDone, }: {
|
|
46
|
+
export declare function ActionButton<R>({ action, label, role, disabled, ask: form, dialog, onDone, }: {
|
|
29
47
|
action: ButtonAction<R>;
|
|
30
48
|
label: string;
|
|
31
49
|
role?: "primary" | "secondary" | "ghost";
|
|
32
50
|
disabled?: boolean;
|
|
51
|
+
/** What it asks for before it runs — `askFormOf`. */
|
|
52
|
+
ask?: AskForm;
|
|
53
|
+
/** What its window says, over the default. */
|
|
54
|
+
dialog?: ActionDialog;
|
|
33
55
|
onDone?: (answer: R) => void;
|
|
34
56
|
}): import("react").JSX.Element;
|