@protobase/schema 0.19.13 → 0.19.14
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/index.d.ts +2 -2
- package/dist/layout.d.ts +12 -2
- package/dist/layout.js +15 -6
- package/dist/model.d.ts +20 -0
- package/dist/view-field.d.ts +6 -1
- package/dist/view-field.js +7 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FileOptions, FileProcessor, FileProcessorInput, ImageFormat, ImageVariant, ImageVariantOptions, imageFormats } from "./files/file-options.js";
|
|
2
|
-
import { ActionModel, ActionRun, AppAddress, BadgeShape, BottomBarItemModel, BottomBarModel, CardFavoriteModel, CardPhotosModel, ChartGranularity, ChartModel, ChartRange, CheckedFilter, CompareOp, CreateModel, CustomSectionModel, DatePreset, DurationLiteral, DurationUnit, EventModel, EventOperation, ExportModel, FieldFormat, FieldModel, FieldPath, FieldType, FieldViewModel, FieldWidgetModel, FileFieldModel, FilterError, FilterErrorCode, FilterExpr, FilterLayout, FilterOf, FilterValue, FilterWidgetModel, GalleryModel, HelpWhen, JsonValue, KeyValue, LayoutItemModel, ListDisplayModel, ListModel, ListQuery, Literal, MapSectionModel, MapView, NavModel, NavRecentModel, NowValue, OrderByItem, RecordMode, RelatedColumnModel, RelatedModel, ResourceModel, SaveFeedback, SaveSearchModel, SearchMatch, SearchResultModel, SearchesOfModel, SectionPresentation, SignInPromptModel, SignInViewModel, SortSpec, Span, StatusTone, UserMenuItemModel, UserMenuModel, ViewModel } from "./model.js";
|
|
2
|
+
import { ActionModel, ActionRun, AppAddress, BadgeShape, BottomBarItemModel, BottomBarModel, CardFavoriteModel, CardPhotosModel, ChartGranularity, ChartModel, ChartRange, CheckedFilter, CompareOp, CreateModel, CustomSectionModel, DatePreset, DurationLiteral, DurationUnit, EventModel, EventOperation, ExportModel, FieldFormat, FieldModel, FieldPath, FieldType, FieldViewModel, FieldWidgetModel, FileFieldModel, FilterError, FilterErrorCode, FilterExpr, FilterLayout, FilterOf, FilterValue, FilterWidgetModel, GalleryModel, HelpWhen, JsonValue, KeyValue, LayoutItemModel, ListDisplayModel, ListModel, ListQuery, Literal, MapSectionModel, MapView, NavModel, NavRecentModel, NowValue, OrderByItem, RecordMode, RelatedColumnModel, RelatedModel, ResourceModel, SaveFeedback, SaveSearchModel, SearchMatch, SearchResultModel, SearchesOfModel, SectionPresentation, ShowWhen, SignInPromptModel, SignInViewModel, SortSpec, Span, StatusTone, UserMenuItemModel, UserMenuModel, ViewModel } from "./model.js";
|
|
3
3
|
import { AccessAction, AccessContext, AccessFn, AccessResult, AccessUser, FieldAccess, FieldRule } from "./access/types.js";
|
|
4
4
|
import { AnyField, Constraint, Field, FieldMeta, FieldTypeDef } from "./field.js";
|
|
5
5
|
import { RelationField } from "./relation-field.js";
|
|
@@ -38,4 +38,4 @@ import { AccessSource, ResolveOptions, ResolvedAccess, RowFilterOperation, acces
|
|
|
38
38
|
import { restrictModel } from "./access/restrict.js";
|
|
39
39
|
import "./access/index.js";
|
|
40
40
|
import { AssistantAction, AssistantActionRequest, AssistantCardPart, AssistantDiff, AssistantEvent, AssistantMessage, AssistantMessageRequest, AssistantPart, AssistantState, AssistantStep, AssistantStepState, AssistantTablePart, AssistantTextPart, AssistantTone, AssistantWidgetPart } from "./assistant/protocol.js";
|
|
41
|
-
export { type Access, type AccessAction, type AccessContext, type AccessFn, type AccessResult, type AccessSource, type AccessUser, type ActionModel, type ActionRun, type AnyField, type AppAddress, type AssistantAction, type AssistantActionRequest, type AssistantCardPart, type AssistantDiff, type AssistantEvent, type AssistantMessage, type AssistantMessageRequest, type AssistantPart, type AssistantState, type AssistantStep, type AssistantStepState, type AssistantTablePart, type AssistantTextPart, type AssistantTone, type AssistantWidgetPart, type BadgeShape, type BottomBarItemModel, type BottomBarModel, type BottomBarNames, type BottomBarSource, type Capability, type CapabilityAction, type CapabilityLimit, type CapabilityScope, type CardFavoriteModel, type CardPhotosModel, type ChartGranularity, type ChartModel, type ChartRange, type CheckResult, type CheckedFilter, type CompareOp, type ComponentRef, type Constraint, type CreateModel, type CreatedOptions, type CustomSectionModel, type DatePreset, type DeletedOptions, type DurationLiteral, type DurationUnit, type EvaluateOptions, type EventActor, type EventContext, type EventHelpers, type EventMatch, type EventModel, type EventOperation, type EventSpec, type ExportModel, type Field, type FieldAccess, type FieldFormat, type FieldMeta, type FieldModel, type FieldPath, type FieldRefValue, type FieldRefs, type FieldRule, type FieldType, type FieldTypeDef, type FieldView, type FieldViewModel, type FieldViews, type FieldWidgetModel, type FieldsInput, type FileField, type FileFieldModel, type FileOptions, type FileProcessor, type FileProcessorInput, type FilterError, type FilterErrorCode, type FilterExpr, type FilterLayout, type FilterLimits, type FilterOf, type FilterParse, type FilterValue, type FilterWidgetModel, type GalleryModel, type Grant, type HeldCapability, type HelpWhen, type ImageFormat, type ImageVariant, type ImageVariantOptions, type InferRecord, type Issue, type JsonValue, type KeyOf, type KeyRefs, type KeyType, type KeyValue, type LayoutItemModel, type ListColumn, type ListDisplayModel, type ListModel, type ListQuery, type Literal, type MapSectionModel, type MapView, type NavModel, type NavRecentModel, type NowValue, type OrderByCheck, type OrderByItem, type OrderByParse, type RecordKey, type RecordMode, type RecordOf, type Ref, type Refs, type RelatedColumnModel, type RelatedModel, type RelationField, type ResolveOptions, type ResolvedAccess, type ResourceBuilder, type ResourceModel, type RoleEntry, type RoleLimit, type Roles, type RolesOptions, type RowFilterOperation, type Rule, type SaveFeedback, type SaveSearchModel, type SearchMatch, type SearchRef, type SearchRefs, type SearchResultModel, type SearchesOfModel, type SectionPresentation, type SignInAddress, type SignInPromptModel, type SignInStep, type SignInViewModel, type SortSpec, type Span, type StatusTone, type UndeletedOptions, type UpdatedOptions, type UserMenuItemModel, type UserMenuModel, type UserMenuSource, type Validator, type ViewBuilder, type ViewModel, type ViewProps, accessWarnings, addressWords, anonymousRole, appPath, bottomBar, bottomBarErrors, checkFilter, checkOrderBy, checkRecord, createWhere, defineRoles, enumLabel, evaluateFilter, f, fieldRef, fieldsUsedBy, imageFormats, keyTypes, layout as l, maxBottomBarItems, parseFilter, parseOrderBy, pickView, printFilter, printOrderBy, readAppPath, readSignInAddress, resolveAccess, resource, restrictModel, rule, signInParams, signInPath, signInRoute, signInSteps, userMenu, view, where };
|
|
41
|
+
export { type Access, type AccessAction, type AccessContext, type AccessFn, type AccessResult, type AccessSource, type AccessUser, type ActionModel, type ActionRun, type AnyField, type AppAddress, type AssistantAction, type AssistantActionRequest, type AssistantCardPart, type AssistantDiff, type AssistantEvent, type AssistantMessage, type AssistantMessageRequest, type AssistantPart, type AssistantState, type AssistantStep, type AssistantStepState, type AssistantTablePart, type AssistantTextPart, type AssistantTone, type AssistantWidgetPart, type BadgeShape, type BottomBarItemModel, type BottomBarModel, type BottomBarNames, type BottomBarSource, type Capability, type CapabilityAction, type CapabilityLimit, type CapabilityScope, type CardFavoriteModel, type CardPhotosModel, type ChartGranularity, type ChartModel, type ChartRange, type CheckResult, type CheckedFilter, type CompareOp, type ComponentRef, type Constraint, type CreateModel, type CreatedOptions, type CustomSectionModel, type DatePreset, type DeletedOptions, type DurationLiteral, type DurationUnit, type EvaluateOptions, type EventActor, type EventContext, type EventHelpers, type EventMatch, type EventModel, type EventOperation, type EventSpec, type ExportModel, type Field, type FieldAccess, type FieldFormat, type FieldMeta, type FieldModel, type FieldPath, type FieldRefValue, type FieldRefs, type FieldRule, type FieldType, type FieldTypeDef, type FieldView, type FieldViewModel, type FieldViews, type FieldWidgetModel, type FieldsInput, type FileField, type FileFieldModel, type FileOptions, type FileProcessor, type FileProcessorInput, type FilterError, type FilterErrorCode, type FilterExpr, type FilterLayout, type FilterLimits, type FilterOf, type FilterParse, type FilterValue, type FilterWidgetModel, type GalleryModel, type Grant, type HeldCapability, type HelpWhen, type ImageFormat, type ImageVariant, type ImageVariantOptions, type InferRecord, type Issue, type JsonValue, type KeyOf, type KeyRefs, type KeyType, type KeyValue, type LayoutItemModel, type ListColumn, type ListDisplayModel, type ListModel, type ListQuery, type Literal, type MapSectionModel, type MapView, type NavModel, type NavRecentModel, type NowValue, type OrderByCheck, type OrderByItem, type OrderByParse, type RecordKey, type RecordMode, type RecordOf, type Ref, type Refs, type RelatedColumnModel, type RelatedModel, type RelationField, type ResolveOptions, type ResolvedAccess, type ResourceBuilder, type ResourceModel, type RoleEntry, type RoleLimit, type Roles, type RolesOptions, type RowFilterOperation, type Rule, type SaveFeedback, type SaveSearchModel, type SearchMatch, type SearchRef, type SearchRefs, type SearchResultModel, type SearchesOfModel, type SectionPresentation, type ShowWhen, type SignInAddress, type SignInPromptModel, type SignInStep, type SignInViewModel, type SortSpec, type Span, type StatusTone, type UndeletedOptions, type UpdatedOptions, type UserMenuItemModel, type UserMenuModel, type UserMenuSource, type Validator, type ViewBuilder, type ViewModel, type ViewProps, accessWarnings, addressWords, anonymousRole, appPath, bottomBar, bottomBarErrors, checkFilter, checkOrderBy, checkRecord, createWhere, defineRoles, enumLabel, evaluateFilter, f, fieldRef, fieldsUsedBy, imageFormats, keyTypes, layout as l, maxBottomBarItems, parseFilter, parseOrderBy, pickView, printFilter, printOrderBy, readAppPath, readSignInAddress, resolveAccess, resource, restrictModel, rule, signInParams, signInPath, signInRoute, signInSteps, userMenu, view, where };
|
package/dist/layout.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CardPhotosModel, HelpWhen, LayoutItemModel, RelatedModel, SectionPresentation } from "./model.js";
|
|
1
|
+
import { CardPhotosModel, HelpWhen, LayoutItemModel, RelatedModel, SectionPresentation, ShowWhen } from "./model.js";
|
|
2
2
|
import { Ref } from "./refs.js";
|
|
3
3
|
import { ComponentRef, ViewProps } from "./view-displays.js";
|
|
4
4
|
//#region src/layout.d.ts
|
|
@@ -14,6 +14,10 @@ import { ComponentRef, ViewProps } from "./view-displays.js";
|
|
|
14
14
|
* l.related('Parts used', { resource: 'repair_parts', field: 'repair_id' }),
|
|
15
15
|
* ])
|
|
16
16
|
* ```
|
|
17
|
+
*
|
|
18
|
+
* Every item shows on both the form and the read view unless its `when` says `editing` (the form and the create form)
|
|
19
|
+
* or `reading` (the read view and the locked form). See
|
|
20
|
+
* [Form and read view](website/src/content/docs/reference/ui-config.mdx#form-and-read-view).
|
|
17
21
|
*/
|
|
18
22
|
export declare const layout: {
|
|
19
23
|
/**
|
|
@@ -27,6 +31,7 @@ export declare const layout: {
|
|
|
27
31
|
help?: string;
|
|
28
32
|
helpWhen?: HelpWhen;
|
|
29
33
|
presentation?: SectionPresentation;
|
|
34
|
+
when?: ShowWhen;
|
|
30
35
|
}) => LayoutItemModel;
|
|
31
36
|
/**
|
|
32
37
|
* The record's photos as tiles in the main column, one large and the next four smaller, the last saying how many more
|
|
@@ -39,9 +44,12 @@ export declare const layout: {
|
|
|
39
44
|
gallery: (title: string, o: {
|
|
40
45
|
image?: Ref;
|
|
41
46
|
photos?: CardPhotosModel;
|
|
47
|
+
when?: ShowWhen;
|
|
42
48
|
}) => LayoutItemModel;
|
|
43
49
|
/** A read-only summary card of fields beside the main column. */
|
|
44
|
-
sidebar: (fields: Ref[]
|
|
50
|
+
sidebar: (fields: Ref[], o?: {
|
|
51
|
+
when?: ShowWhen;
|
|
52
|
+
}) => LayoutItemModel;
|
|
45
53
|
/** A table of the records of another resource that point at this one, directly or through a join table. */
|
|
46
54
|
related: (title: string, o: Omit<RelatedModel, "kind" | "title">) => LayoutItemModel;
|
|
47
55
|
/**
|
|
@@ -54,6 +62,7 @@ export declare const layout: {
|
|
|
54
62
|
longitude: Ref;
|
|
55
63
|
zoom?: number;
|
|
56
64
|
sidebar?: boolean;
|
|
65
|
+
when?: ShowWhen;
|
|
57
66
|
}) => LayoutItemModel;
|
|
58
67
|
/**
|
|
59
68
|
* A component of the project, registered in `protobase.ui.tsx` under its name, drawn where it is listed: in the main
|
|
@@ -64,6 +73,7 @@ export declare const layout: {
|
|
|
64
73
|
title?: string;
|
|
65
74
|
props?: ViewProps<P>;
|
|
66
75
|
sidebar?: boolean;
|
|
76
|
+
when?: ShowWhen;
|
|
67
77
|
}) => LayoutItemModel;
|
|
68
78
|
};
|
|
69
79
|
//#endregion
|
package/dist/layout.js
CHANGED
|
@@ -13,6 +13,10 @@ import { customComponent } from "./view-displays.js";
|
|
|
13
13
|
* l.related('Parts used', { resource: 'repair_parts', field: 'repair_id' }),
|
|
14
14
|
* ])
|
|
15
15
|
* ```
|
|
16
|
+
*
|
|
17
|
+
* Every item shows on both the form and the read view unless its `when` says `editing` (the form and the create form)
|
|
18
|
+
* or `reading` (the read view and the locked form). See
|
|
19
|
+
* [Form and read view](website/src/content/docs/reference/ui-config.mdx#form-and-read-view).
|
|
16
20
|
*/
|
|
17
21
|
const layout = {
|
|
18
22
|
/**
|
|
@@ -28,7 +32,8 @@ const layout = {
|
|
|
28
32
|
fields: fields.map((ref) => ref.name),
|
|
29
33
|
...o.help !== void 0 && { help: o.help },
|
|
30
34
|
...o.helpWhen !== void 0 && { helpWhen: o.helpWhen },
|
|
31
|
-
...o.presentation !== void 0 && { presentation: o.presentation }
|
|
35
|
+
...o.presentation !== void 0 && { presentation: o.presentation },
|
|
36
|
+
...o.when !== void 0 && { when: o.when }
|
|
32
37
|
}),
|
|
33
38
|
/**
|
|
34
39
|
* The record's photos as tiles in the main column, one large and the next four smaller, the last saying how many more
|
|
@@ -44,13 +49,15 @@ const layout = {
|
|
|
44
49
|
kind: "gallery",
|
|
45
50
|
title,
|
|
46
51
|
...o.image && { image: o.image.name },
|
|
47
|
-
...o.photos && { photos: { ...o.photos } }
|
|
52
|
+
...o.photos && { photos: { ...o.photos } },
|
|
53
|
+
...o.when !== void 0 && { when: o.when }
|
|
48
54
|
};
|
|
49
55
|
},
|
|
50
56
|
/** A read-only summary card of fields beside the main column. */
|
|
51
|
-
sidebar: (fields) => ({
|
|
57
|
+
sidebar: (fields, o = {}) => ({
|
|
52
58
|
kind: "sidebar",
|
|
53
|
-
fields: fields.map((ref) => ref.name)
|
|
59
|
+
fields: fields.map((ref) => ref.name),
|
|
60
|
+
...o.when !== void 0 && { when: o.when }
|
|
54
61
|
}),
|
|
55
62
|
/** A table of the records of another resource that point at this one, directly or through a join table. */
|
|
56
63
|
related: (title, o) => ({
|
|
@@ -69,7 +76,8 @@ const layout = {
|
|
|
69
76
|
latitude: o.latitude.name,
|
|
70
77
|
longitude: o.longitude.name,
|
|
71
78
|
...o.zoom !== void 0 && { zoom: o.zoom },
|
|
72
|
-
...o.sidebar && { sidebar: true }
|
|
79
|
+
...o.sidebar && { sidebar: true },
|
|
80
|
+
...o.when !== void 0 && { when: o.when }
|
|
73
81
|
}),
|
|
74
82
|
/**
|
|
75
83
|
* A component of the project, registered in `protobase.ui.tsx` under its name, drawn where it is listed: in the main
|
|
@@ -81,7 +89,8 @@ const layout = {
|
|
|
81
89
|
component: customComponent(component, "l.custom"),
|
|
82
90
|
...o.title !== void 0 && { title: o.title },
|
|
83
91
|
...o.props && { props: markFieldRefs(o.props) },
|
|
84
|
-
...o.sidebar && { sidebar: true }
|
|
92
|
+
...o.sidebar && { sidebar: true },
|
|
93
|
+
...o.when !== void 0 && { when: o.when }
|
|
85
94
|
})
|
|
86
95
|
};
|
|
87
96
|
//#endregion
|
package/dist/model.d.ts
CHANGED
|
@@ -219,6 +219,8 @@ export type FieldViewModel = {
|
|
|
219
219
|
help?: string;
|
|
220
220
|
/** When `help` shows: always, or only while the record is edited; the view's `helpWhen` when omitted. */
|
|
221
221
|
helpWhen?: HelpWhen;
|
|
222
|
+
/** When the field shows on the record page: always, the default, only on its form or only on its read view. */
|
|
223
|
+
when?: ShowWhen;
|
|
222
224
|
/** How the value is shown. */
|
|
223
225
|
format?: FieldFormat;
|
|
224
226
|
/** A text that runs over several lines: forms edit it in a box that grows with it, and its line breaks show. */
|
|
@@ -254,6 +256,12 @@ export type FieldViewModel = {
|
|
|
254
256
|
* [The record page](website/src/content/docs/reference/ui-config.mdx#the-record-page).
|
|
255
257
|
*/
|
|
256
258
|
export type HelpWhen = 'always' | 'editing';
|
|
259
|
+
/**
|
|
260
|
+
* When a record page's field or layout item shows: `always`, the default; only while the record is `editing`, on its
|
|
261
|
+
* form and the create form; or only while `reading` it, on the read view and the locked form. See
|
|
262
|
+
* [Form and read view](website/src/content/docs/reference/ui-config.mdx#form-and-read-view).
|
|
263
|
+
*/
|
|
264
|
+
export type ShowWhen = 'always' | 'editing' | 'reading';
|
|
257
265
|
/** How a field's badges are drawn: `arrow` points them right, as on a rating scale. */
|
|
258
266
|
export type BadgeShape = 'arrow';
|
|
259
267
|
/** A field type by the name a plugin registers it under, and the plain data it is given. */
|
|
@@ -560,6 +568,8 @@ export type RelatedModel = {
|
|
|
560
568
|
display?: string;
|
|
561
569
|
/** The text when nothing matches. */
|
|
562
570
|
empty?: string;
|
|
571
|
+
/** Whether it shows on the form, the read view or both. */
|
|
572
|
+
when?: ShowWhen;
|
|
563
573
|
};
|
|
564
574
|
/**
|
|
565
575
|
* A project component drawn on the record page where it is listed, in the main column or with `sidebar` in the
|
|
@@ -576,6 +586,8 @@ export type CustomSectionModel = {
|
|
|
576
586
|
props?: Record<string, JsonValue>;
|
|
577
587
|
/** Drawn as a sidebar card instead of in the main column. */
|
|
578
588
|
sidebar?: true;
|
|
589
|
+
/** Whether it shows on the form, the read view or both. */
|
|
590
|
+
when?: ShowWhen;
|
|
579
591
|
};
|
|
580
592
|
/**
|
|
581
593
|
* A map of the record's position, its `latitude` and `longitude` fields in decimal degrees (WGS84), centred on a marker
|
|
@@ -595,6 +607,8 @@ export type MapSectionModel = {
|
|
|
595
607
|
zoom?: number;
|
|
596
608
|
/** Drawn as a sidebar card instead of in the main column. */
|
|
597
609
|
sidebar?: true;
|
|
610
|
+
/** Whether it shows on the form, the read view or both. */
|
|
611
|
+
when?: ShowWhen;
|
|
598
612
|
};
|
|
599
613
|
/** How a section shows its fields on the read view: `facts` as a row of key facts; label/value rows when omitted. */
|
|
600
614
|
export type SectionPresentation = 'facts';
|
|
@@ -615,11 +629,15 @@ export type LayoutItemModel = {
|
|
|
615
629
|
* label/value rows; the form edits them as any section's.
|
|
616
630
|
*/
|
|
617
631
|
presentation?: SectionPresentation;
|
|
632
|
+
/** Whether it shows on the form, the read view or both. */
|
|
633
|
+
when?: ShowWhen;
|
|
618
634
|
} | {
|
|
619
635
|
/** A read-only summary card beside the main column. */
|
|
620
636
|
kind: 'sidebar';
|
|
621
637
|
/** The fields it shows, in order. */
|
|
622
638
|
fields: string[];
|
|
639
|
+
/** Whether it shows on the form, the read view or both. */
|
|
640
|
+
when?: ShowWhen;
|
|
623
641
|
} | RelatedModel | CustomSectionModel | MapSectionModel | GalleryModel;
|
|
624
642
|
/**
|
|
625
643
|
* A record's photos as tiles in the main column under `title`, one large and the next few smaller, opening a lightbox
|
|
@@ -636,6 +654,8 @@ export type GalleryModel = {
|
|
|
636
654
|
image?: string;
|
|
637
655
|
/** The records holding the further photos. */
|
|
638
656
|
photos?: CardPhotosModel;
|
|
657
|
+
/** Whether it shows on the form, the read view or both. */
|
|
658
|
+
when?: ShowWhen;
|
|
639
659
|
};
|
|
640
660
|
/** How far back a list's chart reaches. */
|
|
641
661
|
export type ChartRange = '7d' | '30d' | '90d' | '1y' | 'all';
|
package/dist/view-field.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BadgeShape, FieldFormat, FieldViewModel, HelpWhen, JsonValue } from "./model.js";
|
|
1
|
+
import { BadgeShape, FieldFormat, FieldViewModel, HelpWhen, JsonValue, ShowWhen } from "./model.js";
|
|
2
2
|
//#region src/view-field.d.ts
|
|
3
3
|
/** How a view shows one field, as `.fields((r) => ...)` hands it out: each hint returns a new field view. */
|
|
4
4
|
export declare class FieldView<N extends string = string, V = unknown> {
|
|
@@ -21,6 +21,11 @@ export declare class FieldView<N extends string = string, V = unknown> {
|
|
|
21
21
|
help(help: string, o?: {
|
|
22
22
|
when?: HelpWhen;
|
|
23
23
|
}): FieldView<N, V>;
|
|
24
|
+
/**
|
|
25
|
+
* When the field shows on the record page: `editing` only on its form and the create form, `reading` only on its read
|
|
26
|
+
* view and locked form; `always` when omitted. Its lists, cards and filters show it either way.
|
|
27
|
+
*/
|
|
28
|
+
when(when: ShowWhen): FieldView<N, V>;
|
|
24
29
|
/** How the value shows: `badge` for statuses, `code` in monospace, `percent` with a % sign. */
|
|
25
30
|
format(format: FieldFormat): FieldView<N, V>;
|
|
26
31
|
/**
|
package/dist/view-field.js
CHANGED
|
@@ -23,6 +23,13 @@ var FieldView = class FieldView {
|
|
|
23
23
|
...o.when !== void 0 && { helpWhen: o.when }
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* When the field shows on the record page: `editing` only on its form and the create form, `reading` only on its read
|
|
28
|
+
* view and locked form; `always` when omitted. Its lists, cards and filters show it either way.
|
|
29
|
+
*/
|
|
30
|
+
when(when) {
|
|
31
|
+
return this.with({ when });
|
|
32
|
+
}
|
|
26
33
|
/** How the value shows: `badge` for statuses, `code` in monospace, `percent` with a % sign. */
|
|
27
34
|
format(format) {
|
|
28
35
|
return this.with({ format });
|