@protobase/schema 0.53.8 → 0.54.1
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/model.d.ts +4 -4
- package/dist/nav-recent.js +3 -2
- package/dist/view.d.ts +7 -3
- package/package.json +1 -1
package/dist/model.d.ts
CHANGED
|
@@ -1105,11 +1105,11 @@ export type ActionInputModel = {
|
|
|
1105
1105
|
export type StatusTone = 'neutral' | 'info' | 'success' | 'warning' | 'danger';
|
|
1106
1106
|
/** A collapsible list of a few records under the resource's sidebar entry, each with a status dot. */
|
|
1107
1107
|
export type NavRecentModel = {
|
|
1108
|
-
/** The field whose value picks each record's dot. */
|
|
1109
|
-
status
|
|
1108
|
+
/** The field whose value picks each record's dot; without it, each record is its title alone, with no dot. */
|
|
1109
|
+
status?: string;
|
|
1110
1110
|
/** Dot colour per status value; values not listed are `neutral`. */
|
|
1111
|
-
tones
|
|
1112
|
-
/** Status values whose dot pulses, for states that are in progress
|
|
1111
|
+
tones?: Record<string, StatusTone>;
|
|
1112
|
+
/** Status values whose dot pulses, for states that are in progress; needs `status`. */
|
|
1113
1113
|
pulse?: string[];
|
|
1114
1114
|
/** AIP-160 filter choosing the records that qualify, as the list API takes it. */
|
|
1115
1115
|
filter?: string;
|
package/dist/nav-recent.js
CHANGED
|
@@ -27,8 +27,9 @@ const orderByErrors = (model, source) => {
|
|
|
27
27
|
};
|
|
28
28
|
/** What is wrong with a sidebar group's config for this model; empty when the group can be shown. */
|
|
29
29
|
const navRecentErrors = (recent, model) => [
|
|
30
|
-
...Object.hasOwn(model.fields, recent.status) ? [] : [`status field "${recent.status}" does not exist`],
|
|
31
|
-
...
|
|
30
|
+
...recent.status === void 0 || Object.hasOwn(model.fields, recent.status) ? [] : [`status field "${recent.status}" does not exist`],
|
|
31
|
+
...recent.status === void 0 && recent.pulse !== void 0 ? ["pulse needs a status field"] : [],
|
|
32
|
+
...Object.entries(recent.tones ?? {}).filter(([, tone]) => !statusTones.includes(tone)).map(([value, tone]) => `tone "${tone}" for "${value}" is not one of ${statusTones.join(", ")}`),
|
|
32
33
|
...recent.limit === void 0 || Number.isInteger(recent.limit) && recent.limit >= 1 && recent.limit <= maxLimit ? [] : [`limit must be a whole number from 1 to ${maxLimit}`],
|
|
33
34
|
...recent.filter === void 0 ? [] : filterErrors(model, recent.filter).map((error) => `filter: ${error.message}`),
|
|
34
35
|
...recent.orderBy === void 0 ? [] : orderByErrors(model, recent.orderBy).map((error) => `orderBy: ${error.message}`)
|
package/dist/view.d.ts
CHANGED
|
@@ -12,16 +12,20 @@ type FieldsOf<R extends {
|
|
|
12
12
|
readonly $fields: unknown;
|
|
13
13
|
}> = R['$fields'];
|
|
14
14
|
/**
|
|
15
|
-
* `nav(...)` with `recent.status` limited to the resource's fields.
|
|
15
|
+
* `nav(...)` with `recent.status` limited to the resource's fields, and `recent.pulse` only beside a status.
|
|
16
16
|
*
|
|
17
17
|
* @inline
|
|
18
18
|
*/
|
|
19
19
|
type NavInput<R extends {
|
|
20
20
|
readonly $fields: unknown;
|
|
21
21
|
}> = Omit<NavModel, 'recent'> & {
|
|
22
|
-
recent?: Omit<NavRecentModel, 'status'> & {
|
|
22
|
+
recent?: Omit<NavRecentModel, 'status' | 'pulse'> & ({
|
|
23
23
|
status: keyof FieldsOf<R> & string;
|
|
24
|
-
|
|
24
|
+
pulse?: string[];
|
|
25
|
+
} | {
|
|
26
|
+
status?: never;
|
|
27
|
+
pulse?: never;
|
|
28
|
+
});
|
|
25
29
|
};
|
|
26
30
|
/** The `r` of `.fields((r) => ...)`: a field view per field of the resource, to give hints such as `.label()`. */
|
|
27
31
|
export type FieldViews<R extends {
|