@marktiderman/genesis-core 2.16.0 → 2.17.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/README.md +3 -2
- package/dist/{aggregate-Y5IJ5aPn.d.ts → aggregate-v_r-nZbH.d.ts} +1 -1
- package/dist/{chunk-M5IX7C6U.js → chunk-24X4HWL5.js} +4 -4
- package/dist/{chunk-M5IX7C6U.js.map → chunk-24X4HWL5.js.map} +1 -1
- package/dist/chunk-2ORQLYVW.js +115 -0
- package/dist/chunk-2ORQLYVW.js.map +1 -0
- package/dist/{chunk-XPBS5YE4.js → chunk-4POVYF6P.js} +4 -4
- package/dist/{chunk-XPBS5YE4.js.map → chunk-4POVYF6P.js.map} +1 -1
- package/dist/{chunk-IYGVJFCV.js → chunk-5KLIFJYG.js} +3 -3
- package/dist/{chunk-IYGVJFCV.js.map → chunk-5KLIFJYG.js.map} +1 -1
- package/dist/{chunk-ALLWIK62.js → chunk-6B4CN2TC.js} +8 -6
- package/dist/chunk-6B4CN2TC.js.map +1 -0
- package/dist/chunk-6JOWGO2X.js +266 -0
- package/dist/chunk-6JOWGO2X.js.map +1 -0
- package/dist/{chunk-E3K2A3PK.js → chunk-6SHGMEA6.js} +3 -3
- package/dist/{chunk-E3K2A3PK.js.map → chunk-6SHGMEA6.js.map} +1 -1
- package/dist/chunk-6VNM6KAX.js +59 -0
- package/dist/chunk-6VNM6KAX.js.map +1 -0
- package/dist/{chunk-SOO54YYY.js → chunk-AQX5HQD6.js} +3 -3
- package/dist/{chunk-SOO54YYY.js.map → chunk-AQX5HQD6.js.map} +1 -1
- package/dist/chunk-BNKP2H7J.js +11 -0
- package/dist/chunk-BNKP2H7J.js.map +1 -0
- package/dist/{chunk-FXPODKCK.js → chunk-FBMKI22S.js} +6 -6
- package/dist/{chunk-FXPODKCK.js.map → chunk-FBMKI22S.js.map} +1 -1
- package/dist/{chunk-POUI7GAI.js → chunk-JF7FXSQB.js} +5 -5
- package/dist/{chunk-POUI7GAI.js.map → chunk-JF7FXSQB.js.map} +1 -1
- package/dist/chunk-JNWTHDGF.js +892 -0
- package/dist/chunk-JNWTHDGF.js.map +1 -0
- package/dist/chunk-K33LWVUF.js +31 -0
- package/dist/chunk-K33LWVUF.js.map +1 -0
- package/dist/chunk-KRRESUXT.js +192 -0
- package/dist/chunk-KRRESUXT.js.map +1 -0
- package/dist/{chunk-LB6FMQQM.js → chunk-KV2HW4G4.js} +3 -11
- package/dist/chunk-KV2HW4G4.js.map +1 -0
- package/dist/{chunk-42NVJJTT.js → chunk-MMMC37AP.js} +3 -3
- package/dist/{chunk-42NVJJTT.js.map → chunk-MMMC37AP.js.map} +1 -1
- package/dist/chunk-MZVFOTAE.js +96 -0
- package/dist/chunk-MZVFOTAE.js.map +1 -0
- package/dist/{chunk-R3YXYVWF.js → chunk-OIZNABG4.js} +5 -4
- package/dist/chunk-OIZNABG4.js.map +1 -0
- package/dist/{chunk-QGWQ6LK3.js → chunk-QJOKZZKY.js} +9 -6
- package/dist/chunk-QJOKZZKY.js.map +1 -0
- package/dist/chunk-TWLPC4S3.js +53 -0
- package/dist/chunk-TWLPC4S3.js.map +1 -0
- package/dist/{chunk-7EFTWOMA.js → chunk-UNEZF3ZP.js} +73 -15
- package/dist/chunk-UNEZF3ZP.js.map +1 -0
- package/dist/chunk-WNOCPV4A.js +220 -0
- package/dist/chunk-WNOCPV4A.js.map +1 -0
- package/dist/{chunk-ZYOJWU62.js → chunk-XIBQ5BTZ.js} +12 -53
- package/dist/chunk-XIBQ5BTZ.js.map +1 -0
- package/dist/chunk-YMFJLBIZ.js +159 -0
- package/dist/chunk-YMFJLBIZ.js.map +1 -0
- package/dist/{chunk-UDSTWXXZ.js → chunk-ZKLB2HB5.js} +3 -3
- package/dist/{chunk-UDSTWXXZ.js.map → chunk-ZKLB2HB5.js.map} +1 -1
- package/dist/csv.d.ts +12 -3
- package/dist/csv.js +4 -4
- package/dist/csv.js.map +1 -1
- package/dist/form-types.d.ts +1 -1
- package/dist/headless/index.d.ts +1 -1
- package/dist/hooks/index.d.ts +16 -6
- package/dist/hooks/index.js +27 -15
- package/dist/hooks/mutation-mode.d.ts +1 -1
- package/dist/hooks/mutation-mode.js +3 -3
- package/dist/hooks/related-keys.d.ts +1 -1
- package/dist/hooks/use-aggregate.d.ts +2 -2
- package/dist/hooks/use-aggregate.js +3 -3
- package/dist/hooks/use-board-columns.d.ts +79 -0
- package/dist/hooks/use-board-columns.js +4 -0
- package/dist/hooks/use-board-columns.js.map +1 -0
- package/dist/hooks/use-capabilities.d.ts +1 -1
- package/dist/hooks/use-capabilities.js +2 -2
- package/dist/hooks/use-infinite-resource.d.ts +1 -1
- package/dist/hooks/use-infinite-resource.js +3 -3
- package/dist/hooks/use-link-options.d.ts +1 -1
- package/dist/hooks/use-link-options.js +5 -5
- package/dist/hooks/use-list-state.d.ts +103 -0
- package/dist/hooks/use-list-state.js +21 -0
- package/dist/hooks/use-list-state.js.map +1 -0
- package/dist/hooks/use-live.d.ts +1 -1
- package/dist/hooks/use-live.js +2 -2
- package/dist/hooks/use-one.d.ts +7 -1
- package/dist/hooks/use-one.js +3 -3
- package/dist/hooks/use-persisted-ui-state.js +2 -2
- package/dist/hooks/use-relation-label.d.ts +1 -1
- package/dist/hooks/use-relation-label.js +2 -2
- package/dist/hooks/use-resource-form.d.ts +1 -1
- package/dist/hooks/use-resource-form.js +7 -7
- package/dist/hooks/use-resource.d.ts +7 -1
- package/dist/hooks/use-resource.js +5 -5
- package/dist/hooks/use-segment-counts.d.ts +23 -0
- package/dist/hooks/use-segment-counts.js +19 -0
- package/dist/hooks/use-segment-counts.js.map +1 -0
- package/dist/hooks/use-view-board.d.ts +120 -0
- package/dist/hooks/use-view-board.js +29 -0
- package/dist/hooks/use-view-board.js.map +1 -0
- package/dist/hooks/use-view-calendar-range.d.ts +91 -0
- package/dist/hooks/use-view-calendar-range.js +22 -0
- package/dist/hooks/use-view-calendar-range.js.map +1 -0
- package/dist/hooks/use-write.d.ts +1 -1
- package/dist/index.d.ts +41 -11
- package/dist/index.js +119 -26
- package/dist/index.js.map +1 -1
- package/dist/provider/index.d.ts +61 -8
- package/dist/provider/index.js +2 -2
- package/dist/resource-view/index.d.ts +162 -757
- package/dist/resource-view/index.js +31 -686
- package/dist/resource-view/index.js.map +1 -1
- package/dist/saved-views-C45lRm7i.d.ts +155 -0
- package/dist/schema/index.d.ts +3 -3
- package/dist/schema/index.js +2 -1
- package/dist/testing/index.d.ts +2 -2
- package/dist/types-BAhcze_-.d.ts +1063 -0
- package/dist/{types-BriIV4e_.d.ts → types-CiQY6hUy.d.ts} +11 -1
- package/dist/{viewer-scope-Dx0N9AYk.d.ts → viewer-oOk0ZZk9.d.ts} +36 -34
- package/dist/{workspaces-CxpiFu2-.d.ts → workspaces-DeaFix5Z.d.ts} +1 -1
- package/dist/workspaces.d.ts +2 -2
- package/dist/{write-outcome-CkQXgtJq.d.ts → write-outcome-DuwfsnyO.d.ts} +1 -1
- package/package.json +11 -1
- package/dist/chunk-7EFTWOMA.js.map +0 -1
- package/dist/chunk-ALLWIK62.js.map +0 -1
- package/dist/chunk-LB6FMQQM.js.map +0 -1
- package/dist/chunk-QGWQ6LK3.js.map +0 -1
- package/dist/chunk-R3YXYVWF.js.map +0 -1
- package/dist/chunk-ZYOJWU62.js.map +0 -1
|
@@ -1,762 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { R as
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { F as FieldSchema, R as ResourceContract, e as DataRow, l as RowOf, a as FilterParam, k as AggregateMetric, S as SortParam, A as AggregateParams } from '../types-CiQY6hUy.js';
|
|
2
|
+
import { V as ViewBoard, e as ViewCalendar, f as ViewDefinition, R as ResourceView, D as DisplayHint, g as ViewGallery, h as ViewInbox, i as RowSummary, j as RowPicture, L as LinkFilter, A as Allowed, k as ViewCalendarDurationUnit } from '../types-BAhcze_-.js';
|
|
3
|
+
export { l as AnyRecordView, B as BulkTarget, C as ComputedColumn, F as FieldNameOf, I as InboxRow, m as LinkOrder, n as LinkedView, o as RECORD_OPEN_MODES, p as RecordOpen, q as RecordPageTemplate, r as RecordView, s as RecordViewDefinition, t as RecordViewDocument, u as RecordViewFilter, v as RecordViewHeader, w as RecordViewHeaderAction, x as RecordViewHeaderOptions, y as RecordViewListSection, z as RecordViewReadinessItem, E as RecordViewSection, G as RecordViewSettingsSection, H as RecordViewSlotSection, J as ResolvedColumn, d as ResolvedFilter, K as ResolvedFormField, M as ResolvedLink, N as ResolvedReadinessItem, O as ResolvedRecordViewSection, P as ResolvedSegment, Q as ResolvedViewAction, T as ResourceWorkspace, U as RowImage, S as SegmentWhere, W as TimeZoneName, X as ViewAction, Y as ViewBreakpoint, Z as ViewBulkAction, _ as ViewCalendarLayout, $ as ViewColumn, a0 as ViewCopy, a1 as ViewEmphasis, a2 as ViewExport, a3 as ViewField, a4 as ViewFilter, c as ViewFilterKind, b as ViewFilterValue, a5 as ViewFormItem, a6 as ViewGuards, a7 as ViewLink, a8 as ViewPreset, a9 as ViewSegment, aa as ViewTimeZone, a as ViewTone, ab as ViewTotal, ac as WorkspaceDefinition, ad as WorkspaceHeaderAction, ae as WorkspaceSection, af as defineRecordView, ag as defineWorkspace, ah as isRecordView, ai as isWorkspace, aj as sameFormValue } from '../types-BAhcze_-.js';
|
|
4
|
+
export { a as LIST_URL_KEYS, L as ListState, b as SavedView, c as SavedViewInput, S as SavedViewStore, d as applicableListState, e as createLocalSavedViewStore, f as decodeFilterValue, g as encodeFilterValue, h as filterOptionLabel, i as filterValueFor, j as isFilterSet, l as listUrlParams, r as readListUrl, w as whereParams } from '../saved-views-C45lRm7i.js';
|
|
5
|
+
import { R as ResourceScope, V as Viewer } from '../viewer-oOk0ZZk9.js';
|
|
6
|
+
export { G as GenesisViewerRoles, N as NO_VIEWER } from '../viewer-oOk0ZZk9.js';
|
|
7
|
+
import { Day, DayRange } from '../dates.js';
|
|
8
|
+
import '../status-BXRokZD9.js';
|
|
9
|
+
import '../gallery/index.js';
|
|
10
|
+
import '../types-DKcxHXxq.js';
|
|
7
11
|
import 'react';
|
|
8
12
|
import '@tanstack/react-query';
|
|
9
13
|
|
|
10
|
-
type AnyView = ResourceView<ResourceContract<any>, any>;
|
|
11
|
-
/** Equality filters for a child list, sent to the server: `{ brand_id: brand.id }`. `null` is "is empty". */
|
|
12
|
-
type RecordViewFilter = Readonly<Record<string, string | number | boolean | null>>;
|
|
13
|
-
interface SectionBase {
|
|
14
|
-
/** Unique in the record view; the screen's route segment or slot key. */
|
|
15
|
-
id: string;
|
|
16
|
-
label: string;
|
|
17
|
-
}
|
|
18
|
-
/** A child list: another view, filtered by this record. */
|
|
19
|
-
interface RecordViewListSection<Row extends DataRow = DataRow> extends SectionBase {
|
|
20
|
-
list: {
|
|
21
|
-
view: AnyView;
|
|
22
|
-
filter: (row: Row) => RecordViewFilter;
|
|
23
|
-
};
|
|
24
|
-
settings?: never;
|
|
25
|
-
}
|
|
26
|
-
/** A few of this record's own fields, edited in place. Each must be in `view.writable("edit")`. */
|
|
27
|
-
interface RecordViewSettingsSection<Name extends string = string> extends SectionBase {
|
|
28
|
-
settings: readonly Name[];
|
|
29
|
-
list?: never;
|
|
30
|
-
}
|
|
31
|
-
/** A section the screen fills itself, through a slot keyed by `id`. */
|
|
32
|
-
interface RecordViewSlotSection extends SectionBase {
|
|
33
|
-
list?: never;
|
|
34
|
-
settings?: never;
|
|
35
|
-
}
|
|
36
|
-
type RecordViewSection<Row extends DataRow = DataRow, Name extends string = string> = RecordViewListSection<Row> | RecordViewSettingsSection<Name> | RecordViewSlotSection;
|
|
37
|
-
/** One readiness check: "Has a logo", ok or not, and why not. */
|
|
38
|
-
interface RecordViewReadinessItem {
|
|
39
|
-
/** A stable key for the check; default its position and title. */
|
|
40
|
-
id?: string;
|
|
41
|
-
title: string;
|
|
42
|
-
ok: boolean;
|
|
43
|
-
reason?: string;
|
|
44
|
-
/** Genesis chip tones only. Default `success` when ok, `warning` when not. */
|
|
45
|
-
tone?: ViewTone;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* A record page template (ADR 0021): `standard` (a header with the summary and actions, then the
|
|
49
|
-
* sections) or `document` (a cover, an icon, a large title, the properties, then the body, like
|
|
50
|
-
* a page in a notes app).
|
|
51
|
-
*
|
|
52
|
-
* @stability Beta
|
|
53
|
-
*/
|
|
54
|
-
type RecordPageTemplate = "standard" | "document";
|
|
55
|
-
/**
|
|
56
|
-
* Where a `document` template finds its parts, by field name. Each is optional; a part whose
|
|
57
|
-
* field is empty on a row isn't drawn.
|
|
58
|
-
*
|
|
59
|
-
* @stability Beta
|
|
60
|
-
*/
|
|
61
|
-
interface RecordViewDocument<Name extends string = string> {
|
|
62
|
-
/** A text field holding the cover image's URL. */
|
|
63
|
-
cover?: Name;
|
|
64
|
-
/** A text field holding the icon: an emoji or a short text, or an image's URL. */
|
|
65
|
-
icon?: Name;
|
|
66
|
-
/** The fields listed under the title, as label and value, in order. */
|
|
67
|
-
properties?: readonly Name[];
|
|
68
|
-
/** The long text below the properties. */
|
|
69
|
-
body?: Name;
|
|
70
|
-
}
|
|
71
|
-
/** What `defineRecordView` accepts. */
|
|
72
|
-
interface RecordViewDefinition<C extends ResourceContract, Row extends DataRow = RowOf<C>> {
|
|
73
|
-
/** The view actions the header offers, by name, in order. Default: every view action. */
|
|
74
|
-
header?: {
|
|
75
|
-
actions?: readonly string[];
|
|
76
|
-
};
|
|
77
|
-
/** The sections. A `document` template may have none (the document is the page). */
|
|
78
|
-
sections: readonly RecordViewSection<Row, FieldNameOf<C>>[];
|
|
79
|
-
readiness?: (row: Row) => readonly RecordViewReadinessItem[];
|
|
80
|
-
/** The record page template. Default `standard`, the page as before. */
|
|
81
|
-
template?: RecordPageTemplate;
|
|
82
|
-
/** With `template: "document"`: the fields its cover, icon, properties and body show. */
|
|
83
|
-
document?: RecordViewDocument<FieldNameOf<C>>;
|
|
84
|
-
}
|
|
85
|
-
/** A section as a renderer draws it. */
|
|
86
|
-
type ResolvedRecordViewSection = {
|
|
87
|
-
readonly id: string;
|
|
88
|
-
readonly label: string;
|
|
89
|
-
readonly kind: "list";
|
|
90
|
-
readonly view: AnyView;
|
|
91
|
-
} | {
|
|
92
|
-
readonly id: string;
|
|
93
|
-
readonly label: string;
|
|
94
|
-
readonly kind: "settings";
|
|
95
|
-
readonly settings: readonly string[];
|
|
96
|
-
} | {
|
|
97
|
-
readonly id: string;
|
|
98
|
-
readonly label: string;
|
|
99
|
-
readonly kind: "slot";
|
|
100
|
-
};
|
|
101
|
-
/** A header action with whether this row allows it. */
|
|
102
|
-
interface RecordViewHeaderAction {
|
|
103
|
-
readonly name: string;
|
|
104
|
-
readonly label: string;
|
|
105
|
-
readonly confirm?: string;
|
|
106
|
-
readonly description?: string;
|
|
107
|
-
readonly destructive?: boolean;
|
|
108
|
-
/** `true`, or the view guard's reason. Only narrows what the server allows. */
|
|
109
|
-
readonly allowed: Allowed;
|
|
110
|
-
}
|
|
111
|
-
/** The header for one row: the view's summary plus the header's actions. */
|
|
112
|
-
interface RecordViewHeader {
|
|
113
|
-
readonly title: string;
|
|
114
|
-
readonly subtitle?: string;
|
|
115
|
-
readonly chips: readonly {
|
|
116
|
-
label: string;
|
|
117
|
-
tone?: ViewTone;
|
|
118
|
-
}[];
|
|
119
|
-
readonly actions: readonly RecordViewHeaderAction[];
|
|
120
|
-
}
|
|
121
|
-
/** What a screen and its provider add to the header: they only narrow the view's guards. */
|
|
122
|
-
interface RecordViewHeaderOptions<Row extends DataRow = DataRow> {
|
|
123
|
-
/** The screen's own rule: `false` hides the action, a sentence refuses it with that reason. */
|
|
124
|
-
can?: (action: string, row: Row) => Allowed | boolean;
|
|
125
|
-
/** Whether anything can run actions here (the screen's `onAction`, or the provider's `runAction`). `false` hides them all. */
|
|
126
|
-
runnable?: boolean;
|
|
127
|
-
/** The action names the provider reports serving (`ResourceSchema.actions`), when it reports them. Others are hidden. */
|
|
128
|
-
served?: readonly string[];
|
|
129
|
-
/** Who is looking (`useViewer()`), for the view's action guards. Without it they get no one. */
|
|
130
|
-
viewer?: Viewer;
|
|
131
|
-
}
|
|
132
|
-
/** A readiness check with its tone resolved. */
|
|
133
|
-
interface ResolvedReadinessItem {
|
|
134
|
-
/** Stable, for list keys: the check's `id`, or its position and title. */
|
|
135
|
-
readonly key: string;
|
|
136
|
-
readonly title: string;
|
|
137
|
-
readonly ok: boolean;
|
|
138
|
-
readonly reason?: string;
|
|
139
|
-
readonly tone: ViewTone;
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Any record view, whatever its contract: the type a view's `recordView` returns. Name it on that
|
|
143
|
-
* function (`recordView: (): AnyRecordView => brandRecordView`), since the record view is defined
|
|
144
|
-
* from the view and TypeScript can't infer one from the other.
|
|
145
|
-
*
|
|
146
|
-
* @stability Beta
|
|
147
|
-
*/
|
|
148
|
-
type AnyRecordView = RecordView<ResourceContract<any>, any>;
|
|
149
|
-
/** What `defineRecordView` returns: frozen, with pure helpers for the renderers. */
|
|
150
|
-
interface RecordView<C extends ResourceContract = ResourceContract, Row extends DataRow = RowOf<C>> {
|
|
151
|
-
readonly view: ResourceView<C, Row>;
|
|
152
|
-
readonly sections: readonly ResolvedRecordViewSection[];
|
|
153
|
-
/** The header's action names, in order. */
|
|
154
|
-
readonly headerActions: readonly string[];
|
|
155
|
-
readonly hasReadiness: boolean;
|
|
156
|
-
/** The record page template: `standard` unless the definition says `document`. */
|
|
157
|
-
readonly template: RecordPageTemplate;
|
|
158
|
-
/** The document template's fields (frozen); empty for `standard`. */
|
|
159
|
-
readonly document: Readonly<RecordViewDocument>;
|
|
160
|
-
section(id: string): ResolvedRecordViewSection | undefined;
|
|
161
|
-
/** The record's address for the provider: its key fields (`keyFields`), composite keys encoded. */
|
|
162
|
-
recordId(row: Row): Identifier;
|
|
163
|
-
/**
|
|
164
|
-
* Why settings can't be saved for this row and viewer: the view's `can("update", row, viewer)`
|
|
165
|
-
* reason, or `null` when they can. Renderers then show the settings read-only with the reason.
|
|
166
|
-
* Without a viewer the guard gets no one, so one that needs the viewer locks them.
|
|
167
|
-
*/
|
|
168
|
-
settingsLocked(row: Row, viewer?: Viewer): string | null;
|
|
169
|
-
headerFor(row: Row, options?: RecordViewHeaderOptions<Row>): RecordViewHeader;
|
|
170
|
-
/**
|
|
171
|
-
* Settings fields as the view's form resolves them (`view.form("edit")`), in the order listed:
|
|
172
|
-
* one section's, or every settings section's without an id.
|
|
173
|
-
*/
|
|
174
|
-
settingsFields(sectionId?: string): readonly ResolvedFormField[];
|
|
175
|
-
/** Only the section's listed keys that `values` has: what a save sends. */
|
|
176
|
-
settingsPatch(sectionId: string, values: Readonly<Record<string, unknown>>): Record<string, unknown>;
|
|
177
|
-
/**
|
|
178
|
-
* A list section's filter for this row. In development, a filter with no key, or a value that
|
|
179
|
-
* isn't a string, number, boolean or null, throws: it would show every child row.
|
|
180
|
-
*/
|
|
181
|
-
listFilter(sectionId: string, row: Row): RecordViewFilter;
|
|
182
|
-
/** The readiness checks for this row, tones resolved; empty without `readiness`. */
|
|
183
|
-
readinessFor(row: Row): readonly ResolvedReadinessItem[];
|
|
184
|
-
/**
|
|
185
|
-
* The checks in one chip's terms (genesis-core/resource's `readinessOf`): an unmet `danger`
|
|
186
|
-
* check is a problem, any other unmet check one to look at. `null` without `readiness`. Draw
|
|
187
|
-
* it with `readinessChip`.
|
|
188
|
-
*/
|
|
189
|
-
readinessSummary(row: Row): Readiness | null;
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* Whether two values are the same as a settings form holds them: 2 and "2", and null, undefined
|
|
193
|
-
* and "", are the same. A settings section compares an edit with the row through it, so an edit
|
|
194
|
-
* back to the stored value isn't a change (web and native RecordView).
|
|
195
|
-
*/
|
|
196
|
-
declare function sameFormValue(a: unknown, b: unknown): boolean;
|
|
197
|
-
/** Whether a value is a record view (`defineRecordView`'s result). */
|
|
198
|
-
declare function isRecordView(value: unknown): value is RecordView;
|
|
199
|
-
/**
|
|
200
|
-
* One record's screen from its view:
|
|
201
|
-
*
|
|
202
|
-
* ```ts
|
|
203
|
-
* export const brandRecordView = defineRecordView(brandsView, {
|
|
204
|
-
* header: { actions: ["archive"] },
|
|
205
|
-
* sections: [
|
|
206
|
-
* { id: "products", label: "Products", list: { view: productsView, filter: (b) => ({ brand_id: b.id }) } },
|
|
207
|
-
* { id: "settings", label: "Settings", settings: ["name", "website"] },
|
|
208
|
-
* { id: "activity", label: "Activity" }, // the screen fills it
|
|
209
|
-
* ],
|
|
210
|
-
* readiness: (b) => [{ title: "Has a website", ok: !!b.website, reason: "Add the website." }],
|
|
211
|
-
* });
|
|
212
|
-
* ```
|
|
213
|
-
*
|
|
214
|
-
* Throws {@link ViewDefinitionError} for a settings field the view can't write, a header action
|
|
215
|
-
* the view doesn't define, a repeated section id, or a section that holds another record view.
|
|
216
|
-
*/
|
|
217
|
-
declare function defineRecordView<C extends ResourceContract, Row extends DataRow = RowOf<C>>(view: ResourceView<C, Row>, definition: RecordViewDefinition<C, Row>): RecordView<C, Row>;
|
|
218
|
-
/** @deprecated Renamed `defineRecordView`. Removed in the next major. @stability Deprecated */
|
|
219
|
-
declare const defineWorkspace: typeof defineRecordView;
|
|
220
|
-
/** @deprecated Renamed `isRecordView`. Removed in the next major. @stability Deprecated */
|
|
221
|
-
declare const isWorkspace: typeof isRecordView;
|
|
222
|
-
/** @deprecated Renamed `RecordView`. Removed in the next major. @stability Deprecated */
|
|
223
|
-
type ResourceWorkspace<C extends ResourceContract = ResourceContract, Row extends DataRow = RowOf<C>> = RecordView<C, Row>;
|
|
224
|
-
/** @deprecated Renamed `RecordViewDefinition`. */
|
|
225
|
-
type WorkspaceDefinition<C extends ResourceContract, Row extends DataRow = RowOf<C>> = RecordViewDefinition<C, Row>;
|
|
226
|
-
/** @deprecated Renamed `RecordViewSection`. */
|
|
227
|
-
type WorkspaceSection<Row extends DataRow = DataRow, Name extends string = string> = RecordViewSection<Row, Name>;
|
|
228
|
-
/** @deprecated Renamed `RecordViewHeaderAction`. */
|
|
229
|
-
type WorkspaceHeaderAction = RecordViewHeaderAction;
|
|
230
|
-
|
|
231
|
-
/** A chip's colour: the one Genesis tone set (`ChipTone`, genesis-core/resource). */
|
|
232
|
-
type ViewTone = ChipTone;
|
|
233
|
-
/**
|
|
234
|
-
* How a value is shown. A hint: each platform registers one renderer per hint, so the shared view
|
|
235
|
-
* never imports a platform. Derived from the field when the view doesn't say.
|
|
236
|
-
*/
|
|
237
|
-
type DisplayHint = "text" | "longText" | "number" | "currency" | "percent" | "boolean" | "badge" | "date" | "datetime" | "relation" | "url" | "email" | "image" | "json";
|
|
238
|
-
/** The field names a contract declares; `string` when the contract isn't a literal. */
|
|
239
|
-
type FieldNameOf<C extends ResourceContract> = C["fields"][number]["name"];
|
|
240
|
-
/** What a view says about one field. Every key is optional; the contract fills the rest. */
|
|
241
|
-
interface ViewField<Row extends DataRow = DataRow> {
|
|
242
|
-
/** The field's label. Default: the contract's label, then the name in title case. */
|
|
243
|
-
label?: string;
|
|
244
|
-
display?: DisplayHint;
|
|
245
|
-
/** A badge's tone per value, e.g. `{ active: "success", archived: "muted" }`. */
|
|
246
|
-
tones?: Readonly<Record<string, ViewTone>>;
|
|
247
|
-
/**
|
|
248
|
-
* The words for a value, e.g. `{ draft: "In progress" }`: badges, form choices, group titles.
|
|
249
|
-
* A value without one shows in title case. Keys must be the field's enum values, if it has any.
|
|
250
|
-
*/
|
|
251
|
-
labels?: Readonly<Record<string, string>>;
|
|
252
|
-
/**
|
|
253
|
-
* For a link (`relation`): the linked row's field that names it, e.g. `"full_name"`. Default:
|
|
254
|
-
* the linked resource's `labelField` (`provider.describe`), else a `name`/`title`-like field.
|
|
255
|
-
*/
|
|
256
|
-
labelField?: string;
|
|
257
|
-
/**
|
|
258
|
-
* For a link: the words when the linked row is hidden from this viewer or gone, e.g.
|
|
259
|
-
* `"Someone you can't see"`. Default: the catalogue's `common.hiddenLink`. Never the raw id.
|
|
260
|
-
*/
|
|
261
|
-
missingLabel?: string;
|
|
262
|
-
/**
|
|
263
|
-
* For a link: edit it in the view's forms with a picker, and how the picker lists the rows it
|
|
264
|
-
* can point at. Setting it (`{}` is enough) opts the link in; without it (or the view's
|
|
265
|
-
* `editLinks`) a link stays read-only. `view` narrows it to the linked view's rules (its scope
|
|
266
|
-
* and default filter); `filter` adds more.
|
|
267
|
-
*/
|
|
268
|
-
link?: ViewLink;
|
|
269
|
-
/** Longest text a form accepts. Feeds the derived validation. */
|
|
270
|
-
max?: number;
|
|
271
|
-
/**
|
|
272
|
-
* In a form: the browser's autofill token (`email`, `tel`, `given-name`, `one-time-code`,
|
|
273
|
-
* `off`, ...). Unset, the input carries no `autocomplete` attribute and gets no token from its
|
|
274
|
-
* type, so the browser applies its own heuristics (it may still offer to fill it). Set a token
|
|
275
|
-
* where the form is about the viewer, and `off` on a form about someone else (an admin editing
|
|
276
|
-
* a member) to ask the browser not to fill in the person at the keyboard.
|
|
277
|
-
*/
|
|
278
|
-
autoComplete?: string;
|
|
279
|
-
/** In a form: which on-screen keyboard a phone shows. Unset, it follows the field's type. */
|
|
280
|
-
inputMode?: "none" | "text" | "decimal" | "numeric" | "tel" | "search" | "email" | "url";
|
|
281
|
-
/** In a form: the label on the keyboard's Return key (`next`, `done`, `go`, `search`, `send`). */
|
|
282
|
-
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send";
|
|
283
|
-
/** Shown read-only even where the server would accept a write. Never widens. */
|
|
284
|
-
readOnly?: boolean;
|
|
285
|
-
/**
|
|
286
|
-
* Show the cell only when the row (and the viewer) say so: for values a server function masks
|
|
287
|
-
* by policy (`(row) => row.author_visible`). The masking itself is the server's. It hides
|
|
288
|
-
* table cells and the peek only: not workspace settings, an edit form's prefilled values, a
|
|
289
|
-
* view's `summary` or header, or sorting and searching on the column.
|
|
290
|
-
*/
|
|
291
|
-
when?: (row: Row, viewer: Viewer) => boolean;
|
|
292
|
-
/** In a form: show the field only while this holds for the form's values. A hidden field isn't saved. */
|
|
293
|
-
visible?: (values: Readonly<Record<string, unknown>>) => boolean;
|
|
294
|
-
/**
|
|
295
|
-
* A timestamp's clock: the viewer's (default), the scope's (the zone of whatever the screen is
|
|
296
|
-
* scoped to: ViewerScope's `scopeTimeZone`, or NativeResourceView's prop), or a fixed IANA zone.
|
|
297
|
-
* Closed: any other word (the removed `"practice"`) is a type error, and `defineView` refuses a
|
|
298
|
-
* zone the runtime doesn't know.
|
|
299
|
-
*/
|
|
300
|
-
timeZone?: ViewTimeZone;
|
|
301
|
-
}
|
|
302
|
-
/**
|
|
303
|
-
* A picker's filter: equality per field. `null` is "is empty", a list is "any of". Sent to the
|
|
304
|
-
* server with the list request, never applied to loaded rows.
|
|
305
|
-
*/
|
|
306
|
-
type LinkFilter = Readonly<Record<string, string | number | boolean | null | readonly (string | number)[]>>;
|
|
307
|
-
/** The parts of the linked resource's view a picker reads. */
|
|
308
|
-
type LinkedView = Pick<ResourceView<any, any>, "resource" | "definition" | "labelField">;
|
|
309
|
-
/**
|
|
310
|
-
* How a link's picker lists the linked rows (`fields.owner_id.link`). The list always goes through
|
|
311
|
-
* the provider, so row-level security decides what the viewer can pick; these only narrow it.
|
|
312
|
-
*/
|
|
313
|
-
interface ViewLink {
|
|
314
|
-
/**
|
|
315
|
-
* The linked resource's view. Its `scope` keys (read from the viewer's scope, as its own lists
|
|
316
|
-
* do), its `default` preset's filter (or `preset`'s) and its `labelField` apply to the picker.
|
|
317
|
-
* A function for two views that link each other (`() => usersView`).
|
|
318
|
-
*/
|
|
319
|
-
view?: LinkedView | (() => LinkedView);
|
|
320
|
-
/** One of the linked view's presets whose filter the picker uses. Default: its `default` preset. */
|
|
321
|
-
preset?: string;
|
|
322
|
-
/**
|
|
323
|
-
* More filters: fixed, or from the form's values, for a picker that follows another field
|
|
324
|
-
* (`(values) => ({ project_id: values.project_id })`, the tasks of the chosen project).
|
|
325
|
-
*/
|
|
326
|
-
filter?: LinkFilter | ((values: Readonly<Record<string, unknown>>) => LinkFilter);
|
|
327
|
-
/** The linked fields a search matches. Default: the naming field (`labelField`). */
|
|
328
|
-
searchFields?: readonly string[];
|
|
329
|
-
/**
|
|
330
|
-
* The order the picker lists rows in. Default: by the naming field, then the key. `"view"`
|
|
331
|
-
* uses the linked view's own `orderBy` (a `position` its list is sorted by) and needs `view`;
|
|
332
|
-
* a linked view without one keeps the default. `{ field, direction }` names a linked field.
|
|
333
|
-
*/
|
|
334
|
-
orderBy?: "view" | LinkOrder;
|
|
335
|
-
}
|
|
336
|
-
/** A picker's order: a field of the linked resource, ascending unless it says so. */
|
|
337
|
-
interface LinkOrder {
|
|
338
|
-
field: string;
|
|
339
|
-
direction?: "asc" | "desc";
|
|
340
|
-
/** Where rows with no value go. Unset, the store decides. */
|
|
341
|
-
nulls?: "first" | "last";
|
|
342
|
-
}
|
|
343
|
-
/** A link's picker, resolved: what to list, what names a row, and the filters to send. */
|
|
344
|
-
interface ResolvedLink {
|
|
345
|
-
/** The linked resource. */
|
|
346
|
-
resource: string;
|
|
347
|
-
/** The linked field the link stores (its key, usually `id`). */
|
|
348
|
-
field: string;
|
|
349
|
-
/** The linked field that names a row: the view field's, else the linked view's. Undefined: the provider's `describe`. */
|
|
350
|
-
readonly labelField: string | undefined;
|
|
351
|
-
/** The linked fields a search matches. Unset: the naming field. */
|
|
352
|
-
searchFields?: readonly string[];
|
|
353
|
-
/**
|
|
354
|
-
* The order the picker lists rows in (`link.orderBy`, or the linked view's `orderBy` for
|
|
355
|
-
* `"view"`), then the key. Undefined: by the naming field, then the key.
|
|
356
|
-
*/
|
|
357
|
-
readonly orderBy?: {
|
|
358
|
-
readonly field: string;
|
|
359
|
-
readonly direction: "asc" | "desc";
|
|
360
|
-
readonly nulls?: "first" | "last" | undefined;
|
|
361
|
-
} | undefined;
|
|
362
|
-
/**
|
|
363
|
-
* The filters a picker sends: the linked view's scope keys from `scope` (as its own lists apply
|
|
364
|
-
* them), its preset's filter, then the link's own `filter` for these form values.
|
|
365
|
-
*/
|
|
366
|
-
filters(scope?: ResourceScope | null, values?: Readonly<Record<string, unknown>>): FilterParam[];
|
|
367
|
-
}
|
|
368
|
-
/**
|
|
369
|
-
* An IANA zone name as written: `"UTC"`, `"GMT"` or `Area/Location` (`"Europe/Berlin"`). The
|
|
370
|
-
* type keeps a bare word out; `defineView` checks the runtime knows the zone.
|
|
371
|
-
*/
|
|
372
|
-
type TimeZoneName = "UTC" | "GMT" | `${string}/${string}`;
|
|
373
|
-
/** A view field's clock: the viewer's, the scope's, or a fixed zone. */
|
|
374
|
-
type ViewTimeZone = "viewer" | "scope" | TimeZoneName;
|
|
375
|
-
/** A column computed from the row, never stored or sent. */
|
|
376
|
-
interface ComputedColumn<Row extends DataRow = DataRow> {
|
|
377
|
-
/** The column's key; must not clash with a field name. */
|
|
378
|
-
key: string;
|
|
379
|
-
label: string;
|
|
380
|
-
value: (row: Row) => unknown;
|
|
381
|
-
display?: DisplayHint;
|
|
382
|
-
}
|
|
383
|
-
/** One entry in a column list: a field by name, or a computed column. */
|
|
384
|
-
type ViewColumn<Name extends string, Row extends DataRow> = Name | ComputedColumn<Row>;
|
|
385
|
-
/** A form laid out in order: fields, and fields under a heading. */
|
|
386
|
-
type ViewFormItem<Name extends string> = Name | {
|
|
387
|
-
section: string;
|
|
388
|
-
title?: string;
|
|
389
|
-
fields: readonly Name[];
|
|
390
|
-
};
|
|
391
|
-
/**
|
|
392
|
-
* A named tab of the list: which columns, and which rows (`{ status: "open" }` is an equality
|
|
393
|
-
* filter, sent to the server, never applied to loaded rows).
|
|
394
|
-
*/
|
|
395
|
-
interface ViewPreset<Name extends string> {
|
|
396
|
-
label?: string;
|
|
397
|
-
columns?: string;
|
|
398
|
-
filter?: Readonly<Partial<Record<Name, string | number | boolean | null>>>;
|
|
399
|
-
}
|
|
400
|
-
/** `true` when allowed, or the reason it isn't, in one sentence for the disabled control. */
|
|
401
|
-
type Allowed = true | string;
|
|
402
|
-
/**
|
|
403
|
-
* Row rules the server can't cheaply express ("the default brand can't be deleted"). They only
|
|
404
|
-
* narrow: the effective right is the server's AND these. An invariant goes in the database too.
|
|
405
|
-
*
|
|
406
|
-
* Each gets the viewer (`useViewer()`: id, scope, roles). Outside a ViewerScope it is
|
|
407
|
-
* `{ id: null, scope: {} }`, so a guard that needs it refuses with its reason. Pure and
|
|
408
|
-
* synchronous; never a security check (row-level security is the boundary).
|
|
409
|
-
*/
|
|
410
|
-
interface ViewGuards<Row extends DataRow> {
|
|
411
|
-
create?: (viewer: Viewer) => Allowed;
|
|
412
|
-
update?: (row: Row, viewer: Viewer) => Allowed;
|
|
413
|
-
delete?: (row: Row, viewer: Viewer) => Allowed;
|
|
414
|
-
}
|
|
415
|
-
/**
|
|
416
|
-
* A named operation on one row, shaped like core's {@link RowAction} (which a provider reports),
|
|
417
|
-
* plus a guard. The guard only narrows: the server still decides whether the action runs.
|
|
418
|
-
*
|
|
419
|
-
* ```ts
|
|
420
|
-
* actions: [{ name: "archive", label: "Archive", confirm: "Archive this brand?", can: (r) => (r.is_default ? "The default brand stays." : true) }]
|
|
421
|
-
* ```
|
|
422
|
-
*/
|
|
423
|
-
interface ViewAction<Row extends DataRow = DataRow> extends RowAction {
|
|
424
|
-
/** Drawn as destructive (red, the menu's destructive style). */
|
|
425
|
-
destructive?: boolean;
|
|
426
|
-
can?: (row: Row, viewer: Viewer) => Allowed;
|
|
427
|
-
}
|
|
428
|
-
/** An action as a renderer lists it: the words only. Ask `view.canAction` whether a row allows it. */
|
|
429
|
-
type ResolvedViewAction = RowAction & {
|
|
430
|
-
readonly destructive?: boolean;
|
|
431
|
-
};
|
|
432
|
-
/** A row in one line, for pickers, notifications and page bars. */
|
|
433
|
-
interface RowSummary {
|
|
434
|
-
title: string;
|
|
435
|
-
subtitle?: string;
|
|
436
|
-
chips?: readonly {
|
|
437
|
-
label: string;
|
|
438
|
-
tone?: ViewTone;
|
|
439
|
-
}[];
|
|
440
|
-
/**
|
|
441
|
-
* A picture beside the row: `src` is shown only when `isSafeUrl` accepts it; otherwise the
|
|
442
|
-
* initials of `name`. `alt` defaults to empty (decorative). Resolve it with `rowPicture`.
|
|
443
|
-
*/
|
|
444
|
-
image?: RowImage;
|
|
445
|
-
}
|
|
446
|
-
/** A row's picture, as a view's `summary` gives it. */
|
|
447
|
-
interface RowImage {
|
|
448
|
-
src?: string;
|
|
449
|
-
/** Whose picture: the initials come from it when there is no safe `src`. */
|
|
450
|
-
name?: string;
|
|
451
|
-
/** Alternative text. Default empty: the picture is decorative (the row's title names it). */
|
|
452
|
-
alt?: string;
|
|
453
|
-
}
|
|
454
|
-
/** A row's picture, ready to draw: an image (with initials for when it fails to load), or initials. */
|
|
455
|
-
type RowPicture = {
|
|
456
|
-
readonly kind: "image";
|
|
457
|
-
readonly src: string;
|
|
458
|
-
readonly alt: string;
|
|
459
|
-
readonly fallback: string;
|
|
460
|
-
} | {
|
|
461
|
-
readonly kind: "initials";
|
|
462
|
-
readonly text: string;
|
|
463
|
-
};
|
|
464
|
-
/**
|
|
465
|
-
* The words a view shows. Each one is a step in a chain, and each step overrides the one before:
|
|
466
|
-
* words derived from the resource's name, then the contract's (`noun`, `nounPlural`, `label`, which
|
|
467
|
-
* `genesis introspect` reads from the table comment's `@genesis {...}`), then these, then the
|
|
468
|
-
* screen's own props. Templates take `{noun}`, `{nouns}`, `{count}` and `{total}`.
|
|
469
|
-
*/
|
|
470
|
-
interface ViewCopy {
|
|
471
|
-
/** One row, in a sentence: "brand". Default: the contract's `noun`, then the table name's singular. */
|
|
472
|
-
noun?: string;
|
|
473
|
-
/**
|
|
474
|
-
* Several: "brands". Default: the contract's `nounPlural`, then the plural of a `noun` the view or
|
|
475
|
-
* contract gives ("entry" → "entries"); with only a noun derived from the name, the contract's
|
|
476
|
-
* label when it reads as a plural ("People"), else the table name.
|
|
477
|
-
*/
|
|
478
|
-
nounPlural?: string;
|
|
479
|
-
/** The page title. Default: the contract's label, then the plural noun in title case. */
|
|
480
|
-
title?: string;
|
|
481
|
-
subtitle?: string;
|
|
482
|
-
empty?: {
|
|
483
|
-
title?: string;
|
|
484
|
-
body?: string;
|
|
485
|
-
};
|
|
486
|
-
/** The create button. Default "New". */
|
|
487
|
-
create?: string;
|
|
488
|
-
/**
|
|
489
|
-
* The form's words. Titles: default "New {noun}" and "Edit {noun}" (the UI catalogue's `form`).
|
|
490
|
-
* Submit buttons: default "Create" and "Save". Descriptions (read out with the title): default
|
|
491
|
-
* the UI catalogue's `form.createDescription` and `form.editDescription`.
|
|
492
|
-
*/
|
|
493
|
-
form?: {
|
|
494
|
-
createTitle?: string;
|
|
495
|
-
editTitle?: string;
|
|
496
|
-
createSubmit?: string;
|
|
497
|
-
editSubmit?: string;
|
|
498
|
-
createDescription?: string;
|
|
499
|
-
editDescription?: string;
|
|
500
|
-
};
|
|
501
|
-
/**
|
|
502
|
-
* The count beside the title. Default "{count} {noun}" for one, "{count} {nouns}" for more, and
|
|
503
|
-
* "{count} of {total}" when filtered (the UI catalogue's `page.count*`).
|
|
504
|
-
*/
|
|
505
|
-
count?: {
|
|
506
|
-
one?: string;
|
|
507
|
-
other?: string;
|
|
508
|
-
filtered?: string;
|
|
509
|
-
};
|
|
510
|
-
}
|
|
511
|
-
/** How a calendar lays out its window: a month grid, 1–4 weeks, a day-by-day agenda, or a row per lane. */
|
|
512
|
-
type ViewCalendarLayout = "month" | "weeks" | "agenda" | "lanes";
|
|
513
|
-
/** What a calendar's `durationField` counts. */
|
|
514
|
-
type ViewCalendarDurationUnit = "minutes" | "hours" | "days";
|
|
515
|
-
/**
|
|
516
|
-
* How the view's rows show as a calendar: ResourceView's `mode="calendar"` on the web,
|
|
517
|
-
* NativeResourceView's later. Plain values only, so every platform reads the same block; a screen
|
|
518
|
-
* overrides the layout, weeks and anchor, and adds functions (dot colours, `onSelect`).
|
|
519
|
-
*/
|
|
520
|
-
interface ViewCalendar<Name extends string = string> {
|
|
521
|
-
/** The date or timestamp field that places each row. */
|
|
522
|
-
field: Name;
|
|
523
|
-
/** Where a row ends: its last day for a date field, its end instant for a timestamp. */
|
|
524
|
-
endField?: Name;
|
|
525
|
-
/**
|
|
526
|
-
* A number field holding how long a row runs, for a row with no end column: its end is the
|
|
527
|
-
* start plus this many `durationUnit`s. A row whose `endField` has a value keeps that end.
|
|
528
|
-
*/
|
|
529
|
-
durationField?: Name;
|
|
530
|
-
/** What `durationField` counts. Default `minutes`. */
|
|
531
|
-
durationUnit?: ViewCalendarDurationUnit;
|
|
532
|
-
/** A yes/no field: the row is all day, its timestamp shown without a time. */
|
|
533
|
-
allDayField?: Name;
|
|
534
|
-
/** The field whose value (or list of values) names a row's lanes: a dot each, a lane each. */
|
|
535
|
-
laneBy?: Name;
|
|
536
|
-
/** Default `month`. */
|
|
537
|
-
layout?: ViewCalendarLayout;
|
|
538
|
-
/**
|
|
539
|
-
* The layout on a phone (below 768px), until the person picks one from the layout switch:
|
|
540
|
-
* `"agenda"` turns a month grid too narrow to read into a day-by-day list. Unset, a phone shows
|
|
541
|
-
* `layout`, as before.
|
|
542
|
-
*/
|
|
543
|
-
phoneLayout?: ViewCalendarLayout;
|
|
544
|
-
/** For `weeks`, `agenda` and `lanes`: 1 to 4. Default 2. */
|
|
545
|
-
weeks?: 1 | 2 | 3 | 4;
|
|
546
|
-
/** 0 Sunday or 1 Monday (default). */
|
|
547
|
-
weekStartsOn?: 0 | 1;
|
|
548
|
-
}
|
|
549
|
-
/**
|
|
550
|
-
* How the view's rows show as a board: a column per value of one field, a card per row.
|
|
551
|
-
* ResourceView's `mode="board"` draws it, and moving a card between columns writes the field
|
|
552
|
-
* through the provider. Plain values only, so every platform reads the same block.
|
|
553
|
-
*/
|
|
554
|
-
interface ViewBoard<Name extends string = string> {
|
|
555
|
-
/** The field whose value is a card's column: a field with choices (an enum) or a yes/no one. */
|
|
556
|
-
field: Name;
|
|
557
|
-
/**
|
|
558
|
-
* The columns, in order, as values of `field`. Default: its choices in the contract's order,
|
|
559
|
-
* then a "No value" column when it can be empty. Listing them shows only those.
|
|
560
|
-
*/
|
|
561
|
-
columns?: readonly string[];
|
|
562
|
-
/** The fields a card shows under its title, in order. Default none: the title alone. */
|
|
563
|
-
cardFields?: readonly Name[];
|
|
564
|
-
/**
|
|
565
|
-
* The most cards a column should hold, by value (`{ doing: 3 }`): a work-in-progress limit.
|
|
566
|
-
* A column over its limit says so; nothing stops a move into it.
|
|
567
|
-
*/
|
|
568
|
-
limits?: Readonly<Record<string, number>>;
|
|
569
|
-
}
|
|
570
|
-
/**
|
|
571
|
-
* How the view's rows show as a gallery: ResourceView's `mode="grid"` draws a photo per row in
|
|
572
|
-
* justified rows (the layout `GalleryGrid` uses, from `@marktiderman/genesis-core/gallery`) in
|
|
573
|
-
* place of cards. Plain field names only, so every platform reads the same block.
|
|
574
|
-
*/
|
|
575
|
-
interface ViewGallery<Name extends string = string> {
|
|
576
|
-
/** The field holding the image's URL. */
|
|
577
|
-
image: Name;
|
|
578
|
-
/** The image's width and height in pixels, when the rows store them: rows pack by their ratio, 4:3 without. */
|
|
579
|
-
width?: Name;
|
|
580
|
-
height?: Name;
|
|
581
|
-
/** A short line under the photo in the viewer. Default none. */
|
|
582
|
-
caption?: Name;
|
|
583
|
-
/** The photo's text alternative. Default the row's label (the view's `labelField`). */
|
|
584
|
-
alt?: Name;
|
|
585
|
-
/** The target row height, px on the web and points on a phone. Default 180, as `GalleryGrid`. */
|
|
586
|
-
rowHeight?: number;
|
|
587
|
-
}
|
|
588
|
-
/**
|
|
589
|
-
* How a record opens from a view (a record page, ADR 0021): a **side peek** (a panel at the edge,
|
|
590
|
-
* the list still beside it), a **center peek** (a dialog over the list) or a full **page** (the
|
|
591
|
-
* record's own route).
|
|
592
|
-
*
|
|
593
|
-
* @stability Beta
|
|
594
|
-
*/
|
|
595
|
-
type RecordOpen = "side-peek" | "center-peek" | "page";
|
|
596
|
-
/** The open modes, in the order a picker lists them. @stability Beta */
|
|
597
|
-
declare const RECORD_OPEN_MODES: readonly RecordOpen[];
|
|
598
|
-
/** What `defineView` accepts. */
|
|
599
|
-
interface ViewDefinition<C extends ResourceContract, Row extends DataRow = RowOf<C>> {
|
|
600
|
-
copy?: ViewCopy;
|
|
601
|
-
fields?: {
|
|
602
|
-
readonly [K in FieldNameOf<C>]?: ViewField<Row>;
|
|
603
|
-
};
|
|
604
|
-
/**
|
|
605
|
-
* Column lists by preset name. `default` is the full list; others (`compact`) are what a screen
|
|
606
|
-
* picks. Without `default`: every field that isn't sensitive, generated-only or the key.
|
|
607
|
-
*/
|
|
608
|
-
columns?: {
|
|
609
|
-
readonly default?: readonly ViewColumn<FieldNameOf<C>, Row>[];
|
|
610
|
-
} & {
|
|
611
|
-
readonly [preset: string]: readonly ViewColumn<FieldNameOf<C>, Row>[] | undefined;
|
|
612
|
-
};
|
|
613
|
-
/** Tabs: columns plus filters. */
|
|
614
|
-
presets?: Readonly<Record<string, ViewPreset<FieldNameOf<C>>>>;
|
|
615
|
-
/** The record form. Default: every writable field, in contract order. */
|
|
616
|
-
form?: readonly ViewFormItem<FieldNameOf<C>>[];
|
|
617
|
-
/**
|
|
618
|
-
* Edit every link in this view's forms with a picker. Default false: a link is read-only (and
|
|
619
|
-
* never sent) unless its `fields.<link>.link` is set (`{}` is enough). The default flips in 3.0.
|
|
620
|
-
*/
|
|
621
|
-
editLinks?: boolean;
|
|
622
|
-
can?: ViewGuards<Row>;
|
|
623
|
-
/** Named operations on one row, in the order a menu shows them. Names are unique. */
|
|
624
|
-
actions?: readonly ViewAction<Row>[];
|
|
625
|
-
summary?: (row: Row) => RowSummary;
|
|
626
|
-
/** The scope keys this view needs above it (`["org_id"]`). They stay out of forms. */
|
|
627
|
-
scope?: readonly FieldNameOf<C>[];
|
|
628
|
-
/** How the rows show as a calendar (`mode="calendar"`). */
|
|
629
|
-
calendar?: ViewCalendar<FieldNameOf<C>>;
|
|
630
|
-
/** How the rows show as a board (`mode="board"`). */
|
|
631
|
-
board?: ViewBoard<FieldNameOf<C>>;
|
|
632
|
-
/** How the rows show as a gallery of photos (`mode="grid"`), in place of cards. */
|
|
633
|
-
gallery?: ViewGallery<FieldNameOf<C>>;
|
|
634
|
-
/** Group rows under headers by this field. */
|
|
635
|
-
groupBy?: FieldNameOf<C>;
|
|
636
|
-
/**
|
|
637
|
-
* How a record opens from every view type of this view (ADR 0021): `side-peek` (default),
|
|
638
|
-
* `center-peek` or `page`. A screen's own `open` (or ResourcePage's older `detail`) wins.
|
|
639
|
-
*/
|
|
640
|
-
open?: RecordOpen;
|
|
641
|
-
/**
|
|
642
|
-
* The record view a peek renders: a function, because the record view is defined from this
|
|
643
|
-
* view, with its return type named so TypeScript needn't infer one from the other:
|
|
644
|
-
* `recordView: (): AnyRecordView => brandRecordView`. Without one, a peek shows the view's
|
|
645
|
-
* columns as today.
|
|
646
|
-
*/
|
|
647
|
-
recordView?: () => AnyRecordView;
|
|
648
|
-
/**
|
|
649
|
-
* Default order; `manual: true` turns on drag to reorder, writing this field. `nulls` says where
|
|
650
|
-
* rows with no value go (unset, the store decides: Postgres puts them first on a descending sort).
|
|
651
|
-
*/
|
|
652
|
-
orderBy?: {
|
|
653
|
-
field: FieldNameOf<C>;
|
|
654
|
-
direction?: "asc" | "desc";
|
|
655
|
-
nulls?: "first" | "last";
|
|
656
|
-
manual?: boolean;
|
|
657
|
-
};
|
|
658
|
-
/** Bumped when stored preferences (saved views, column order) change shape. */
|
|
659
|
-
version?: number;
|
|
660
|
-
}
|
|
661
|
-
/** A column as a renderer draws it: everything resolved. */
|
|
662
|
-
interface ResolvedColumn<Row extends DataRow = DataRow> {
|
|
663
|
-
key: string;
|
|
664
|
-
label: string;
|
|
665
|
-
display: DisplayHint;
|
|
666
|
-
/** The field behind it; absent for a computed column. */
|
|
667
|
-
field?: FieldSchema;
|
|
668
|
-
value: (row: Row) => unknown;
|
|
669
|
-
tones?: Readonly<Record<string, ViewTone>>;
|
|
670
|
-
/** The words for a value (`ViewField.labels`); `valueText` reads them. */
|
|
671
|
-
labels?: Readonly<Record<string, string>>;
|
|
672
|
-
/** For a link: the linked row's field that names it (`ViewField.labelField`). */
|
|
673
|
-
labelField?: string;
|
|
674
|
-
/** For a link: the words when its row is hidden or gone (`ViewField.missingLabel`). */
|
|
675
|
-
missingLabel?: string;
|
|
676
|
-
/** Whether to show the cell. Without a viewer it answers for no one (fail closed). */
|
|
677
|
-
when?: (row: Row, viewer?: Viewer) => boolean;
|
|
678
|
-
timeZone?: ViewField["timeZone"];
|
|
679
|
-
}
|
|
680
|
-
/** A form field as a renderer draws it. */
|
|
681
|
-
interface ResolvedFormField {
|
|
682
|
-
field: FieldSchema;
|
|
683
|
-
label: string;
|
|
684
|
-
display: DisplayHint;
|
|
685
|
-
required: boolean;
|
|
686
|
-
readOnly: boolean;
|
|
687
|
-
max?: number;
|
|
688
|
-
/** The input's autofill token (`ViewField.autoComplete`). */
|
|
689
|
-
autoComplete?: string;
|
|
690
|
-
/** The keyboard a phone shows (`ViewField.inputMode`). */
|
|
691
|
-
inputMode?: ViewField["inputMode"];
|
|
692
|
-
/** The Return key's label (`ViewField.enterKeyHint`). */
|
|
693
|
-
enterKeyHint?: ViewField["enterKeyHint"];
|
|
694
|
-
/** For a link: the linked row's field that names it (`ViewField.labelField`). */
|
|
695
|
-
labelField?: string;
|
|
696
|
-
/** For a link: the words when its row is hidden or gone (`ViewField.missingLabel`). */
|
|
697
|
-
missingLabel?: string;
|
|
698
|
-
/** An enum field's choices, in the contract's order, with the view's words. */
|
|
699
|
-
options?: readonly {
|
|
700
|
-
value: string;
|
|
701
|
-
label: string;
|
|
702
|
-
}[];
|
|
703
|
-
/** For a link the view opted in (`fields.<link>.link`, `editLinks`): how its picker lists the linked rows. */
|
|
704
|
-
link?: ResolvedLink;
|
|
705
|
-
/** The heading it sits under, or null for none. */
|
|
706
|
-
section: string | null;
|
|
707
|
-
sectionTitle: string | null;
|
|
708
|
-
visible?: (values: Readonly<Record<string, unknown>>) => boolean;
|
|
709
|
-
}
|
|
710
|
-
/** What `defineView` returns: frozen, with everything the renderers need resolved. */
|
|
711
|
-
interface ResourceView<C extends ResourceContract = ResourceContract, Row extends DataRow = RowOf<C>> {
|
|
712
|
-
readonly contract: C;
|
|
713
|
-
readonly definition: Readonly<ViewDefinition<C, Row>>;
|
|
714
|
-
/** The resource name the provider addresses. */
|
|
715
|
-
readonly resource: string;
|
|
716
|
-
readonly noun: string;
|
|
717
|
-
readonly nounPlural: string;
|
|
718
|
-
readonly title: string;
|
|
719
|
-
/** The field that names a row, for links, pickers and the peek's title. */
|
|
720
|
-
readonly labelField: string | undefined;
|
|
721
|
-
/** The column presets this view has, `default` first. */
|
|
722
|
-
readonly presets: readonly string[];
|
|
723
|
-
field(name: string): FieldSchema | undefined;
|
|
724
|
-
label(name: string): string;
|
|
725
|
-
display(name: string): DisplayHint;
|
|
726
|
-
/** A value in words: the field's `labels`, else title case. For badges, choices and group titles. */
|
|
727
|
-
valueLabel(name: string, value: unknown): string;
|
|
728
|
-
columns(preset?: string): readonly ResolvedColumn<Row>[];
|
|
729
|
-
/**
|
|
730
|
-
* One field as a column, resolved as a preset lists it (a board card's fields, say). Undefined
|
|
731
|
-
* for a name that isn't a field or one the viewer can't read (`permissions.read: false`).
|
|
732
|
-
*/
|
|
733
|
-
column(name: string): ResolvedColumn<Row> | undefined;
|
|
734
|
-
form(mode: "create" | "edit"): readonly ResolvedFormField[];
|
|
735
|
-
/** Fields a writer may send: the form's, never generated, read-only, key or scope fields. */
|
|
736
|
-
writable(mode: "create" | "edit"): readonly string[];
|
|
737
|
-
/**
|
|
738
|
-
* Whether the view's guard allows it for this viewer: `true`, or the guard's reason. Without a
|
|
739
|
-
* viewer, guards get `NO_VIEWER` (no one), so one that needs the viewer refuses.
|
|
740
|
-
*/
|
|
741
|
-
can(action: "create", viewer?: Viewer): Allowed;
|
|
742
|
-
can(action: "update" | "delete", row: Row, viewer?: Viewer): Allowed;
|
|
743
|
-
/** The view's actions, in order, frozen. */
|
|
744
|
-
actions(): readonly ResolvedViewAction[];
|
|
745
|
-
/**
|
|
746
|
-
* Whether this row allows the named action: `true`, or the guard's reason. Only narrows what the
|
|
747
|
-
* server allows. Throws {@link ViewDefinitionError} for a name the view doesn't define.
|
|
748
|
-
*/
|
|
749
|
-
canAction(name: string, row: Row, viewer?: Viewer): Allowed;
|
|
750
|
-
summary(row: Row): RowSummary;
|
|
751
|
-
/**
|
|
752
|
-
* The row as a gallery photo, by the view's `gallery` block and any `override` a screen passes
|
|
753
|
-
* (ResourceView's `gallery`): undefined without a gallery block. Its `id` is the row's key, its
|
|
754
|
-
* `alt` the row's label unless the block names a field; a row without an image has an empty `src`,
|
|
755
|
-
* which GalleryGrid and NativeGalleryGrid draw as a placeholder tile; leave those out of a Lightbox.
|
|
756
|
-
*/
|
|
757
|
-
galleryItem(row: Row, override?: Partial<ViewGallery>): GalleryItem | undefined;
|
|
758
|
-
}
|
|
759
|
-
|
|
760
14
|
/** A view that names a field, preset or section its contract doesn't have. */
|
|
761
15
|
declare class ViewDefinitionError extends Error {
|
|
762
16
|
readonly problems: readonly string[];
|
|
@@ -786,6 +40,12 @@ declare function calendarProblems(fields: readonly Pick<FieldSchema, "name" | "t
|
|
|
786
40
|
* @stability Beta
|
|
787
41
|
*/
|
|
788
42
|
declare function boardChoices(field: Pick<FieldSchema, "type" | "array" | "enumValues"> | undefined): readonly string[] | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* What's wrong with an inbox block for these fields, one sentence each (empty when it's fine).
|
|
45
|
+
*
|
|
46
|
+
* @stability Beta
|
|
47
|
+
*/
|
|
48
|
+
declare function inboxProblems(fields: readonly Pick<FieldSchema, "name" | "type" | "array">[], inbox: Partial<ViewInbox>, actions?: readonly string[]): string[];
|
|
789
49
|
/**
|
|
790
50
|
* What's wrong with a gallery block for these fields, one sentence each (empty when it's fine).
|
|
791
51
|
*
|
|
@@ -875,6 +135,18 @@ interface GroupRowsOptions {
|
|
|
875
135
|
* @stability Beta
|
|
876
136
|
*/
|
|
877
137
|
declare function groupRows<Row extends DataRow>(view: ResourceView<ResourceContract<any>, Row>, rows: readonly Row[], options?: GroupRowsOptions): RowGroup<Row>[];
|
|
138
|
+
/**
|
|
139
|
+
* The view's `totals` over some rows (a group's, or every loaded row for a footer): per field, its
|
|
140
|
+
* sum, average, lowest, highest or count, `null` when no row has a number. Fields the view names
|
|
141
|
+
* no total for are left out.
|
|
142
|
+
*
|
|
143
|
+
* ```ts
|
|
144
|
+
* groupTotals(tasksView, group.rows); // { estimate_hours: 12.5 }
|
|
145
|
+
* ```
|
|
146
|
+
*
|
|
147
|
+
* @stability Beta
|
|
148
|
+
*/
|
|
149
|
+
declare function groupTotals<Row extends DataRow>(view: ResourceView<ResourceContract<any>, Row>, rows: readonly Row[]): Readonly<Record<string, number | null>>;
|
|
878
150
|
|
|
879
151
|
type ScopeValue = string | number | boolean | null;
|
|
880
152
|
/**
|
|
@@ -1188,4 +460,137 @@ declare function toWidgetText(value: number | null | undefined, format?: WidgetF
|
|
|
1188
460
|
*/
|
|
1189
461
|
declare function resolveProgress(value: number | null | undefined, goal: number | null | undefined): number | null;
|
|
1190
462
|
|
|
1191
|
-
|
|
463
|
+
/** A development-only hint, once per message: a bad URL value or override that fell back. @stability Beta */
|
|
464
|
+
declare function warnOnce(message: string): void;
|
|
465
|
+
/** How a calendar lays out its window. @stability Beta */
|
|
466
|
+
type CalendarLayout = "month" | "weeks" | "agenda" | "lanes";
|
|
467
|
+
/** Weeks a `weeks`, `agenda` or `lanes` layout shows. @stability Beta */
|
|
468
|
+
type CalendarWeeks = 1 | 2 | 3 | 4;
|
|
469
|
+
/**
|
|
470
|
+
* One event. An all-day event's `start` and `end` are days, `end` the last day it covers
|
|
471
|
+
* (inclusive: a weekend away is Saturday to Sunday). A timed event's are instants, `end`
|
|
472
|
+
* exclusive; without one it is a moment.
|
|
473
|
+
*
|
|
474
|
+
* @stability Beta
|
|
475
|
+
*/
|
|
476
|
+
interface CalendarEvent<T = unknown> {
|
|
477
|
+
key: string;
|
|
478
|
+
title: string;
|
|
479
|
+
start: Day | Date;
|
|
480
|
+
end?: Day | Date | undefined;
|
|
481
|
+
/** Default: true when `start` is a day. */
|
|
482
|
+
allDay?: boolean | undefined;
|
|
483
|
+
/** The lanes (people) it belongs to: one dot each, and a place in each lane of a `lanes` layout. */
|
|
484
|
+
lanes?: readonly string[] | undefined;
|
|
485
|
+
/** Dot colours, when not the lanes' own. Any CSS colour. */
|
|
486
|
+
colors?: readonly string[] | undefined;
|
|
487
|
+
/**
|
|
488
|
+
* Classes for the event's item, on the grid and the printed agenda: `line-through opacity-60`
|
|
489
|
+
* strikes out a cancelled event rather than dropping it. Pair a look with `status`, so it isn't
|
|
490
|
+
* the only cue.
|
|
491
|
+
*/
|
|
492
|
+
className?: string | undefined;
|
|
493
|
+
/** Words read out after the title ("Cancelled"), for what `className` shows. Visually hidden. */
|
|
494
|
+
status?: string | undefined;
|
|
495
|
+
/** The record it came from, handed back on select. */
|
|
496
|
+
row?: T;
|
|
497
|
+
}
|
|
498
|
+
/** A lane: one person (or room, or team) a `lanes` layout gives a row. @stability Beta */
|
|
499
|
+
interface CalendarLane {
|
|
500
|
+
key: string;
|
|
501
|
+
label: string;
|
|
502
|
+
/** Its dot colour, any CSS colour. */
|
|
503
|
+
color?: string | undefined;
|
|
504
|
+
}
|
|
505
|
+
/** An event on one of its days. @stability Beta */
|
|
506
|
+
interface PlacedEvent<T = unknown> {
|
|
507
|
+
event: CalendarEvent<T>;
|
|
508
|
+
day: Day;
|
|
509
|
+
allDay: boolean;
|
|
510
|
+
/** It started on an earlier day. */
|
|
511
|
+
continued: boolean;
|
|
512
|
+
/** It runs on past this day. */
|
|
513
|
+
continues: boolean;
|
|
514
|
+
}
|
|
515
|
+
/** What a layout's window depends on. */
|
|
516
|
+
interface CalendarWindowOptions {
|
|
517
|
+
weeks?: CalendarWeeks | undefined;
|
|
518
|
+
/** 0 Sunday or 1 Monday (default). */
|
|
519
|
+
weekStartsOn?: 0 | 1 | undefined;
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* The days a layout shows around `anchor`: a month grid's whole weeks, or `weeks` weeks from the
|
|
523
|
+
* week `anchor` is in. This is the window a calendar asks its data for. @stability Beta
|
|
524
|
+
*/
|
|
525
|
+
declare function calendarWindow(layout: CalendarLayout, anchor: Day, options?: CalendarWindowOptions): DayRange;
|
|
526
|
+
/** The anchor one step back (−1) or on (1): a month for `month`, else the window's weeks. @stability Beta */
|
|
527
|
+
declare function shiftAnchor(layout: CalendarLayout, anchor: Day, step: number, weeks?: CalendarWeeks): Day;
|
|
528
|
+
/** The first and last day an event covers on `zone`'s clock. */
|
|
529
|
+
declare function eventDays(event: CalendarEvent<unknown>, zone: string): {
|
|
530
|
+
first: Day;
|
|
531
|
+
last: Day;
|
|
532
|
+
};
|
|
533
|
+
/**
|
|
534
|
+
* Each day of `range` with the events on it: an event that spans days is on each one, all-day
|
|
535
|
+
* events (and the middle days of a long timed one) come first, then timed ones by start, then by
|
|
536
|
+
* title. @stability Beta
|
|
537
|
+
*/
|
|
538
|
+
declare function placeEvents<T>(events: readonly CalendarEvent<T>[], range: DayRange, zone: string): Map<Day, PlacedEvent<T>[]>;
|
|
539
|
+
/**
|
|
540
|
+
* The lanes a `lanes` layout draws: the ones given, in order, then any an event names that
|
|
541
|
+
* weren't given (labelled by key). @stability Beta
|
|
542
|
+
*/
|
|
543
|
+
declare function calendarLanes(events: readonly CalendarEvent<unknown>[], lanes?: readonly CalendarLane[]): CalendarLane[];
|
|
544
|
+
/** An event's dots: its own colours, else its lanes' colours. @stability Beta */
|
|
545
|
+
declare function eventDots(event: CalendarEvent<unknown>, lanes: readonly CalendarLane[]): {
|
|
546
|
+
color: string;
|
|
547
|
+
label?: string;
|
|
548
|
+
}[];
|
|
549
|
+
/**
|
|
550
|
+
* How a column stores time: `date` (a calendar day), `zoned` (an instant, `timestamptz`) or
|
|
551
|
+
* `wall` (a wall time with no zone, `timestamp without time zone`). @stability Beta
|
|
552
|
+
*/
|
|
553
|
+
type TimeStorage = "date" | "zoned" | "wall";
|
|
554
|
+
/** How a field stores time, from its database type (an unknown type with a time counts as an instant). @stability Beta */
|
|
555
|
+
declare function timeStorage(field: {
|
|
556
|
+
dbType?: string | undefined;
|
|
557
|
+
control?: string | undefined;
|
|
558
|
+
widget?: string | undefined;
|
|
559
|
+
} | undefined): TimeStorage;
|
|
560
|
+
/**
|
|
561
|
+
* A window as filter values for a column: days for a date column, ISO instants of `zone`'s
|
|
562
|
+
* midnights for a timestamp, and wall-clock midnights (no zone) for a timestamp without one.
|
|
563
|
+
* `[from, to)`; `lead` widens the start by days. @stability Beta
|
|
564
|
+
*/
|
|
565
|
+
declare function windowBounds(range: DayRange, storage: TimeStorage, zone: string, lead?: number): {
|
|
566
|
+
from: string;
|
|
567
|
+
to: string;
|
|
568
|
+
};
|
|
569
|
+
/** The clock a field's cells use: its own zone, the scope's, the viewer's, the device's. @stability Beta */
|
|
570
|
+
declare function displayZone(own: string | undefined, viewer: string | undefined, scope: string | undefined): string;
|
|
571
|
+
/** A lane field's value as lane keys. */
|
|
572
|
+
declare function laneKeys(value: unknown): string[];
|
|
573
|
+
/** How a view's rows become events: its calendar block's fields, and the screen's look per row. @stability Beta */
|
|
574
|
+
interface CalendarEventOptions<T> extends Pick<ViewCalendar, "field"> {
|
|
575
|
+
endField?: string | undefined;
|
|
576
|
+
durationField?: string | undefined;
|
|
577
|
+
durationUnit?: ViewCalendarDurationUnit | undefined;
|
|
578
|
+
allDayField?: string | undefined;
|
|
579
|
+
laneBy?: string | undefined;
|
|
580
|
+
/** The clock the rows are read on. */
|
|
581
|
+
timeZone: string;
|
|
582
|
+
lanesOf?: ((row: T) => readonly string[]) | undefined;
|
|
583
|
+
colorsOf?: ((row: T) => readonly string[]) | undefined;
|
|
584
|
+
classNameOf?: ((row: T) => string | undefined) | undefined;
|
|
585
|
+
statusOf?: ((row: T) => string | undefined) | undefined;
|
|
586
|
+
}
|
|
587
|
+
/**
|
|
588
|
+
* A view's rows as calendar events: each row's start (and its end, or start plus its duration),
|
|
589
|
+
* all day or timed, its title from the view's summary and its lanes. A row without a start is
|
|
590
|
+
* left out. The web's calendar and the phone's read rows through it.
|
|
591
|
+
*
|
|
592
|
+
* @stability Beta
|
|
593
|
+
*/
|
|
594
|
+
declare function calendarEvents<T extends Record<string, unknown>>(view: ResourceView<ResourceContract<any>, T & DataRow>, rows: readonly T[], options: CalendarEventOptions<T>): CalendarEvent<T>[];
|
|
595
|
+
|
|
596
|
+
export { Allowed, type CalendarEvent, type CalendarEventOptions, type CalendarLane, type CalendarLayout, type CalendarWeeks, type CalendarWindowOptions, type ChartPoint, type ChartWidget, type DefinedWidget, DisplayHint, type GroupRowsOptions, LinkFilter, type ListWidget, type NumberWidget, type PlacedEvent, type ProgressWidget, type ResourceTree, ResourceView, type RowGroup, RowOf, RowPicture, RowSummary, type Streak, type StreakWidget, type TimeStorage, type TreeNode, type TreeOptions, type TreeResult, ViewBoard, ViewCalendar, ViewCalendarDurationUnit, ViewDefinition, ViewDefinitionError, ViewGallery, ViewInbox, Viewer, type WidgetBase, type WidgetDefinition, type WidgetFilter, type WidgetFormat, type WidgetKind, type WidgetRequest, boardChoices, boardProblems, calendarEvents, calendarLanes, calendarProblems, calendarWindow, cascadeSelection, defineView, defineWidget, deriveDisplay, displayZone, eventDays, eventDots, filterParams, galleryProblems, groupRows, groupTotals, inboxProblems, initialExpanded, initialsOf, isWidget, laneKeys, placeEvents, plural, resolveChartSeries, resolveProgress, resolveStreak, resolveWidgetAccess, resolveWidgetRequest, rowPicture, scopeFilter, scopeValues, setExpanded, shiftAnchor, singular, timeStorage, toWidgetText, treeRows, valueText, warnOnce, widgetProblems, windowBounds };
|