@antelopejs/interface-dms 0.7.4 → 0.8.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/CHANGELOG.md +107 -0
- package/dist/auth/index.d.ts +3 -3
- package/dist/auth/index.js +11 -9
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/internal/jwt-auth-decorator.d.ts +20 -0
- package/dist/auth/internal/jwt-auth-decorator.js +51 -0
- package/dist/auth/internal/jwt-auth-decorator.js.map +1 -0
- package/dist/auth/internal/request-authenticators.d.ts +12 -0
- package/dist/auth/internal/request-authenticators.js +22 -0
- package/dist/auth/internal/request-authenticators.js.map +1 -1
- package/dist/base/activity-feed.d.ts +6 -6
- package/dist/base/block-registry/types.d.ts +16 -0
- package/dist/base/block-types.d.ts +1 -0
- package/dist/base/block-types.js +1 -0
- package/dist/base/block-types.js.map +1 -1
- package/dist/base/chart-card.d.ts +15 -0
- package/dist/base/chart-card.js +4 -0
- package/dist/base/chart-card.js.map +1 -1
- package/dist/base/chart-schemas.d.ts +26 -26
- package/dist/base/code-block.d.ts +3 -3
- package/dist/base/data-types/compare-types.js +19 -13
- package/dist/base/data-types/compare-types.js.map +1 -1
- package/dist/base/data-types/core.d.ts +11 -0
- package/dist/base/data-types/core.js +14 -1
- package/dist/base/data-types/core.js.map +1 -1
- package/dist/base/data-types/default-types.d.ts +112 -2
- package/dist/base/data-types/default-types.js +90 -19
- package/dist/base/data-types/default-types.js.map +1 -1
- package/dist/base/data-types/field-types.d.ts +10 -4
- package/dist/base/data-types/field-types.js +12 -2
- package/dist/base/data-types/field-types.js.map +1 -1
- package/dist/base/data-types/internal/compare-types.d.ts +3 -0
- package/dist/base/data-types/internal/compare-types.js +7 -0
- package/dist/base/data-types/internal/compare-types.js.map +1 -1
- package/dist/base/empty-state.d.ts +4 -4
- package/dist/base/form-block-schema.d.ts +59 -3
- package/dist/base/form-block-schema.js +12 -2
- package/dist/base/form-block-schema.js.map +1 -1
- package/dist/base/form-schema.d.ts +46 -1
- package/dist/base/form-schema.js.map +1 -1
- package/dist/base/form-types.d.ts +56 -13
- package/dist/base/form-types.js +12 -4
- package/dist/base/form-types.js.map +1 -1
- package/dist/base/guard.d.ts +6 -6
- package/dist/base/helpers/archive-mode-helpers.js +6 -2
- package/dist/base/helpers/archive-mode-helpers.js.map +1 -1
- package/dist/base/index.d.ts +1 -0
- package/dist/base/index.js +1 -0
- package/dist/base/index.js.map +1 -1
- package/dist/base/internal/form-schema.js +2 -0
- package/dist/base/internal/form-schema.js.map +1 -1
- package/dist/base/internal/layouts.d.ts +4 -0
- package/dist/base/key-value-list.d.ts +12 -9
- package/dist/base/key-value-list.js +1 -1
- package/dist/base/key-value-list.js.map +1 -1
- package/dist/base/kpi-card.d.ts +39 -5
- package/dist/base/kpi-card.js +18 -6
- package/dist/base/kpi-card.js.map +1 -1
- package/dist/base/layouts.d.ts +24 -0
- package/dist/base/layouts.js.map +1 -1
- package/dist/base/live-toggle.d.ts +11 -0
- package/dist/base/live-toggle.js +8 -1
- package/dist/base/live-toggle.js.map +1 -1
- package/dist/base/page-toolbar.d.ts +158 -0
- package/dist/base/page-toolbar.js +198 -0
- package/dist/base/page-toolbar.js.map +1 -0
- package/dist/base/period-selector.d.ts +9 -2
- package/dist/base/period-selector.js.map +1 -1
- package/dist/base/placeholder.d.ts +2 -2
- package/dist/base/section.d.ts +2 -2
- package/dist/base/stack.d.ts +2 -2
- package/dist/base/stat-group.d.ts +18 -6
- package/dist/base/stat-group.js +9 -0
- package/dist/base/stat-group.js.map +1 -1
- package/dist/base/table-view/column-display.d.ts +9 -5
- package/dist/base/table-view/column-display.js +1 -1
- package/dist/base/table-view/column-display.js.map +1 -1
- package/dist/base/table-view/data-functions.d.ts +26 -7
- package/dist/base/table-view/data-functions.js +10 -6
- package/dist/base/table-view/data-functions.js.map +1 -1
- package/dist/base/table-view/factory.js +24 -13
- package/dist/base/table-view/factory.js.map +1 -1
- package/dist/base/table-view/internal/auth.d.ts +2 -0
- package/dist/base/table-view/internal/auth.js +3 -1
- package/dist/base/table-view/internal/auth.js.map +1 -1
- package/dist/base/table-view/internal/factory-helpers.d.ts +5 -0
- package/dist/base/table-view/internal/factory-helpers.js +55 -11
- package/dist/base/table-view/internal/factory-helpers.js.map +1 -1
- package/dist/base/table-view/internal/guards.js +19 -2
- package/dist/base/table-view/internal/guards.js.map +1 -1
- package/dist/base/table-view/internal/realtime.js +17 -0
- package/dist/base/table-view/internal/realtime.js.map +1 -1
- package/dist/base/table-view/internal/resource-form.js +1 -0
- package/dist/base/table-view/internal/resource-form.js.map +1 -1
- package/dist/base/table-view/internal/row-actions-schema.d.ts +296 -0
- package/dist/base/table-view/internal/row-actions-schema.js +62 -0
- package/dist/base/table-view/internal/row-actions-schema.js.map +1 -0
- package/dist/base/table-view/internal/validation.d.ts +15 -3
- package/dist/base/table-view/internal/validation.js +70 -2
- package/dist/base/table-view/internal/validation.js.map +1 -1
- package/dist/base/table-view/meta.d.ts +8 -0
- package/dist/base/table-view/meta.js +25 -3
- package/dist/base/table-view/meta.js.map +1 -1
- package/dist/base/table-view/options.d.ts +90 -16
- package/dist/base/table-view/options.js.map +1 -1
- package/dist/base/table-view/realtime.d.ts +8 -0
- package/dist/base/table-view/realtime.js.map +1 -1
- package/dist/base/table-view/routes.js +5 -2
- package/dist/base/table-view/routes.js.map +1 -1
- package/dist/base/table-view/schema.d.ts +36 -30
- package/dist/base/table-view/schema.js +11 -57
- package/dist/base/table-view/schema.js.map +1 -1
- package/dist/base/table-view/source.d.ts +1 -1
- package/dist/base/table-view/source.js +4 -1
- package/dist/base/table-view/source.js.map +1 -1
- package/dist/base/table-view.d.ts +2 -2
- package/dist/base/table-view.js.map +1 -1
- package/dist/base/top-list-card.d.ts +5 -5
- package/dist/base/types/action-target.d.ts +77 -20
- package/dist/base/types/confirm-dialog.d.ts +5 -1
- package/dist/base/types/custom-button.d.ts +5 -3
- package/dist/base/types/field-config.d.ts +4 -4
- package/dist/base/types/guards.d.ts +10 -0
- package/dist/base/types/row-action.d.ts +6 -1
- package/dist/base/types/size.d.ts +3 -1
- package/dist/client-ip.d.ts +6 -2
- package/dist/client-ip.js +4 -2
- package/dist/client-ip.js.map +1 -1
- package/dist/component.d.ts +8 -0
- package/dist/component.js.map +1 -1
- package/dist/data-controllers/members.d.ts +0 -3
- package/dist/data-controllers/members.js +30 -8
- package/dist/data-controllers/members.js.map +1 -1
- package/dist/db/internal/tenantLifecycle.model.js +5 -2
- package/dist/db/internal/tenantLifecycle.model.js.map +1 -1
- package/dist/guards.js +2 -3
- package/dist/guards.js.map +1 -1
- package/dist/hooks.d.ts +41 -5
- package/dist/hooks.js +5 -1
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/internal/invite-membership.d.ts +9 -0
- package/dist/internal/invite-membership.js +25 -7
- package/dist/internal/invite-membership.js.map +1 -1
- package/dist/internal/member-changes.d.ts +24 -0
- package/dist/internal/member-changes.js +66 -0
- package/dist/internal/member-changes.js.map +1 -0
- package/dist/internal/tenant-ownership.d.ts +4 -1
- package/dist/internal/tenant-ownership.js +4 -10
- package/dist/internal/tenant-ownership.js.map +1 -1
- package/dist/invite-extensions.d.ts +0 -9
- package/dist/invite-extensions.js +1 -36
- package/dist/invite-extensions.js.map +1 -1
- package/dist/invite-resolution.js +6 -2
- package/dist/invite-resolution.js.map +1 -1
- package/dist/invites.js +36 -22
- package/dist/invites.js.map +1 -1
- package/dist/layout-banners.d.ts +40 -4
- package/dist/layout-banners.js +25 -3
- package/dist/layout-banners.js.map +1 -1
- package/dist/notifications/internal.d.ts +2 -2
- package/dist/notifications/internal.js.map +1 -1
- package/dist/notifications/sendable.d.ts +3 -2
- package/dist/notifications/sendable.js +2 -1
- package/dist/notifications/sendable.js.map +1 -1
- package/dist/notifications/types.d.ts +9 -0
- package/dist/page/controllers.d.ts +44 -0
- package/dist/page/controllers.js +14 -1
- package/dist/page/controllers.js.map +1 -1
- package/dist/page/internal/layout-filter.d.ts +2 -1
- package/dist/page/internal/layout-filter.js +3 -1
- package/dist/page/internal/layout-filter.js.map +1 -1
- package/dist/page/internal/metadata-helpers.d.ts +7 -0
- package/dist/page/internal/metadata-helpers.js +13 -2
- package/dist/page/internal/metadata-helpers.js.map +1 -1
- package/dist/page/internal/page-registration.d.ts +2 -0
- package/dist/page/internal/page-registration.js.map +1 -1
- package/dist/page/layout-filter.js +31 -10
- package/dist/page/layout-filter.js.map +1 -1
- package/dist/page/metadata.js +29 -24
- package/dist/page/metadata.js.map +1 -1
- package/dist/page/types.d.ts +39 -4
- package/dist/page/types.js.map +1 -1
- package/dist/page.d.ts +1 -1
- package/dist/page.js +2 -1
- package/dist/page.js.map +1 -1
- package/dist/permissions-resolver.d.ts +26 -3
- package/dist/permissions-resolver.js +2 -1
- package/dist/permissions-resolver.js.map +1 -1
- package/dist/permissions.d.ts +7 -3
- package/dist/permissions.js +8 -6
- package/dist/permissions.js.map +1 -1
- package/dist/realtime.d.ts +24 -1
- package/dist/realtime.js +7 -1
- package/dist/realtime.js.map +1 -1
- package/dist/request-tenant.d.ts +17 -13
- package/dist/request-tenant.js +54 -42
- package/dist/request-tenant.js.map +1 -1
- package/dist/tenant-members.d.ts +26 -0
- package/dist/tenant-members.js +29 -0
- package/dist/tenant-members.js.map +1 -0
- package/dist/tenant-ownership.d.ts +4 -1
- package/dist/tenant-ownership.js +12 -17
- package/dist/tenant-ownership.js.map +1 -1
- package/dist/tenant-scoped-model.d.ts +2 -1
- package/dist/tenant-scoped-model.js +4 -3
- package/dist/tenant-scoped-model.js.map +1 -1
- package/docs/1.core/10.layout-banners.md +57 -2
- package/docs/1.core/2.pages-and-modules.md +20 -11
- package/docs/1.core/4.permissions.md +34 -1
- package/docs/1.core/5.tenancy.md +37 -6
- package/docs/1.core/7.hooks.md +12 -2
- package/docs/1.core/8.realtime.md +24 -3
- package/docs/2.auth/2.authentication.md +3 -3
- package/docs/3.base/1.introduction.md +1 -0
- package/docs/3.base/10.display-blocks.md +20 -2
- package/docs/3.base/2.types.md +7 -5
- package/docs/3.base/3.forms.md +21 -6
- package/docs/3.base/4.tables.md +14 -9
- package/docs/3.base/5.charts-and-widgets.md +8 -4
- package/docs/3.base/6.layout.md +38 -1
- package/docs/3.base/8.data-types.md +14 -7
- package/docs/4.notifications/3.sending.md +4 -3
- package/docs/5.html-render/1.introduction.md +5 -7
- package/package.json +3 -7
|
@@ -7,9 +7,11 @@ export declare namespace FormEvents {
|
|
|
7
7
|
const SUBMIT_SUCCESS = "DmsComponent.Form.SubmitSuccess";
|
|
8
8
|
const SUBMIT_ERROR = "DmsComponent.Form.SubmitError";
|
|
9
9
|
/**
|
|
10
|
-
* A field's value, as `{ fieldId, value }`: once for each field
|
|
11
|
-
* values the form starts from (defaults, loaded record), then on
|
|
12
|
-
* change. A watch keyed on `fieldId` alone therefore runs at load.
|
|
10
|
+
* A field's value, as `{ fieldId, value, initial }`: once for each field
|
|
11
|
+
* with the values the form starts from (defaults, loaded record), then on
|
|
12
|
+
* each change. A watch keyed on `fieldId` alone therefore runs at load.
|
|
13
|
+
* `initial` is `true` while the field still holds the value it started
|
|
14
|
+
* from and never held another.
|
|
13
15
|
*/
|
|
14
16
|
const FIELD_CHANGE = "DmsComponent.Form.FieldChange";
|
|
15
17
|
const RESET = "DmsComponent.Form.Reset";
|
|
@@ -18,6 +20,28 @@ export declare namespace FormFunctions {
|
|
|
18
20
|
const SET_FIELD_DISABLED = "DmsComponent.Form.SetFieldDisabled";
|
|
19
21
|
const SET_FIELD_HIDDEN = "DmsComponent.Form.SetFieldHidden";
|
|
20
22
|
const SET_FIELD_REQUIRED = "DmsComponent.Form.SetFieldRequired";
|
|
23
|
+
/**
|
|
24
|
+
* Writes a field's value: `value`, or the entry of `valueMap` named by
|
|
25
|
+
* the value of the field that changed. Never on the values the form
|
|
26
|
+
* starts from (see {@link SetFieldValueParams}).
|
|
27
|
+
*/
|
|
28
|
+
const SET_FIELD_VALUE = "DmsComponent.Form.SetFieldValue";
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* What {@link FormFunctions.SET_FIELD_VALUE} writes, and where. Set `value`
|
|
32
|
+
* for a fixed value, or `valueMap` to pick one by the value of the field
|
|
33
|
+
* the event names (`{ won: 100, lost: 0 }` on a stage change); a value the
|
|
34
|
+
* map has no entry for writes nothing.
|
|
35
|
+
*
|
|
36
|
+
* It runs on a change only: a `FIELD_CHANGE` the form sends for a value it
|
|
37
|
+
* started from (a default, the loaded record) writes nothing, so a record
|
|
38
|
+
* keeps its stored values as it opens and a field nobody edited is never
|
|
39
|
+
* sent as changed.
|
|
40
|
+
*/
|
|
41
|
+
export interface SetFieldValueParams {
|
|
42
|
+
targetField: string;
|
|
43
|
+
value?: unknown;
|
|
44
|
+
valueMap?: Record<string, unknown>;
|
|
21
45
|
}
|
|
22
46
|
/** A pill shown beside a read-only field's value. */
|
|
23
47
|
export interface FormFieldBadge {
|
|
@@ -51,12 +75,23 @@ export interface FormField {
|
|
|
51
75
|
* link to where it is changed (`link`).
|
|
52
76
|
*/
|
|
53
77
|
readonly?: boolean | FormFieldReadonly;
|
|
54
|
-
required?: boolean;
|
|
55
78
|
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
79
|
+
* A form creating a record leaves out a read-only field (`disabled` or
|
|
80
|
+
* `readonly`) that holds nothing yet, a value the server sets once the
|
|
81
|
+
* record exists: `true` shows it empty all the same.
|
|
58
82
|
*/
|
|
83
|
+
showEmptyOnCreate?: boolean;
|
|
84
|
+
required?: boolean;
|
|
85
|
+
/** The value of a new record: the field starts with it. */
|
|
59
86
|
defaultValue?: DefaultValue;
|
|
87
|
+
/**
|
|
88
|
+
* `defaultValue` is the module's default for a setting, not only a new
|
|
89
|
+
* record's starting value: while the field holds something else, it shows
|
|
90
|
+
* "Module default: X" with "Use default", which puts it back. Off unless
|
|
91
|
+
* set, so a record form (a table view's) never presents a column's initial
|
|
92
|
+
* value as a default the user strayed from.
|
|
93
|
+
*/
|
|
94
|
+
offersDefault?: boolean;
|
|
60
95
|
localized?: boolean;
|
|
61
96
|
}
|
|
62
97
|
export interface FormFieldSerialized extends Omit<FormField, "type" | "inputComponent"> {
|
|
@@ -115,7 +150,7 @@ export interface FormSectionSerialized extends Omit<FormSection, "fields"> {
|
|
|
115
150
|
fieldIds: string[];
|
|
116
151
|
}
|
|
117
152
|
/** What a form edits: see `FormProps.kind`. */
|
|
118
|
-
export declare const FORM_KINDS: readonly ["record", "action"];
|
|
153
|
+
export declare const FORM_KINDS: readonly ["record", "create", "action"];
|
|
119
154
|
export type FormKind = (typeof FORM_KINDS)[number];
|
|
120
155
|
/** The options `Form` takes. */
|
|
121
156
|
export interface FormProps extends BaseComponentProps {
|
|
@@ -164,18 +199,26 @@ export interface FormProps extends BaseComponentProps {
|
|
|
164
199
|
saveMode?: FormSaveMode;
|
|
165
200
|
/**
|
|
166
201
|
* What the form edits. `record` (the default): a record, a settings page,
|
|
167
|
-
* a table view's form; it keeps its values once saved, and offers
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
202
|
+
* a table view's edit form; it keeps its values once saved, and offers
|
|
203
|
+
* Cancel when it has somewhere to go back to (`backTo`, the drawer or
|
|
204
|
+
* modal it sits in, or the page of the app the user came from): changes or
|
|
205
|
+
* not, Cancel drops them and leaves, in one click. `create`: a form that
|
|
206
|
+
* makes a new record (a table view's add form and the duplicate it opens,
|
|
207
|
+
* a relation's add form); its submit reads "Create" and shows from the
|
|
208
|
+
* start, and its fields list no changes, since all it holds is new.
|
|
209
|
+
* Declared, never guessed from the method: a settings page posting the
|
|
210
|
+
* record it read stays a `record`. `action`: a form that does something
|
|
211
|
+
* each time it is sent — send a message, invite someone, run a job; its `submitLabel`
|
|
171
212
|
* shows from the start, so its defaults can be sent as they are, with
|
|
172
213
|
* Reset once a value changes (in a drawer or a modal, Cancel before that),
|
|
173
214
|
* and it empties after a successful submit.
|
|
174
215
|
*/
|
|
175
216
|
kind?: FormKind;
|
|
176
217
|
/**
|
|
177
|
-
* Where Cancel leads a `record` form placed on a page
|
|
178
|
-
*
|
|
218
|
+
* Where Cancel leads a `record` form placed on a page opened directly (a
|
|
219
|
+
* link from outside the app, a bookmark); reached from another page of the
|
|
220
|
+
* app, Cancel goes back to it. Without either, the form offers no Cancel.
|
|
221
|
+
* Table views set it on their form pages, to the list.
|
|
179
222
|
* Takes the page URL tokens (`{{params.X}}`, `{{query.X}}`).
|
|
180
223
|
*/
|
|
181
224
|
backTo?: string;
|
package/dist/base/form-types.js
CHANGED
|
@@ -9,9 +9,11 @@ var FormEvents;
|
|
|
9
9
|
FormEvents.SUBMIT_SUCCESS = "DmsComponent.Form.SubmitSuccess";
|
|
10
10
|
FormEvents.SUBMIT_ERROR = "DmsComponent.Form.SubmitError";
|
|
11
11
|
/**
|
|
12
|
-
* A field's value, as `{ fieldId, value }`: once for each field
|
|
13
|
-
* values the form starts from (defaults, loaded record), then on
|
|
14
|
-
* change. A watch keyed on `fieldId` alone therefore runs at load.
|
|
12
|
+
* A field's value, as `{ fieldId, value, initial }`: once for each field
|
|
13
|
+
* with the values the form starts from (defaults, loaded record), then on
|
|
14
|
+
* each change. A watch keyed on `fieldId` alone therefore runs at load.
|
|
15
|
+
* `initial` is `true` while the field still holds the value it started
|
|
16
|
+
* from and never held another.
|
|
15
17
|
*/
|
|
16
18
|
FormEvents.FIELD_CHANGE = "DmsComponent.Form.FieldChange";
|
|
17
19
|
FormEvents.RESET = "DmsComponent.Form.Reset";
|
|
@@ -21,6 +23,12 @@ var FormFunctions;
|
|
|
21
23
|
FormFunctions.SET_FIELD_DISABLED = "DmsComponent.Form.SetFieldDisabled";
|
|
22
24
|
FormFunctions.SET_FIELD_HIDDEN = "DmsComponent.Form.SetFieldHidden";
|
|
23
25
|
FormFunctions.SET_FIELD_REQUIRED = "DmsComponent.Form.SetFieldRequired";
|
|
26
|
+
/**
|
|
27
|
+
* Writes a field's value: `value`, or the entry of `valueMap` named by
|
|
28
|
+
* the value of the field that changed. Never on the values the form
|
|
29
|
+
* starts from (see {@link SetFieldValueParams}).
|
|
30
|
+
*/
|
|
31
|
+
FormFunctions.SET_FIELD_VALUE = "DmsComponent.Form.SetFieldValue";
|
|
24
32
|
})(FormFunctions || (exports.FormFunctions = FormFunctions = {}));
|
|
25
33
|
function isFieldGroup(item) {
|
|
26
34
|
return "fields" in item && Array.isArray(item.fields);
|
|
@@ -33,5 +41,5 @@ exports.FORM_SAVE_MODES = ["bar", "footer", "none", "instant"];
|
|
|
33
41
|
/** How a sectioned form lists its sections: see `FormProps.sectionNav`. */
|
|
34
42
|
exports.FORM_SECTION_NAVS = ["side", "jump", "none"];
|
|
35
43
|
/** What a form edits: see `FormProps.kind`. */
|
|
36
|
-
exports.FORM_KINDS = ["record", "action"];
|
|
44
|
+
exports.FORM_KINDS = ["record", "create", "action"];
|
|
37
45
|
//# sourceMappingURL=form-types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-types.js","sourceRoot":"","sources":["../../src/base/form-types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"form-types.js","sourceRoot":"","sources":["../../src/base/form-types.ts"],"names":[],"mappings":";;;AA2IA,oCAEC;AAED,wDAIC;AAzID,IAAiB,UAAU,CAa1B;AAbD,WAAiB,UAAU;IACZ,iBAAM,GAAG,0BAA0B,CAAC;IACpC,yBAAc,GAAG,iCAAiC,CAAC;IACnD,uBAAY,GAAG,+BAA+B,CAAC;IAC5D;;;;;;OAMG;IACU,uBAAY,GAAG,+BAA+B,CAAC;IAC/C,gBAAK,GAAG,yBAAyB,CAAC;AACjD,CAAC,EAbgB,UAAU,0BAAV,UAAU,QAa1B;AAED,IAAiB,aAAa,CAU7B;AAVD,WAAiB,aAAa;IACf,gCAAkB,GAAG,oCAAoC,CAAC;IAC1D,8BAAgB,GAAG,kCAAkC,CAAC;IACtD,gCAAkB,GAAG,oCAAoC,CAAC;IACvE;;;;OAIG;IACU,6BAAe,GAAG,iCAAiC,CAAC;AACnE,CAAC,EAVgB,aAAa,6BAAb,aAAa,QAU7B;AAwGD,SAAgB,YAAY,CAAC,IAAsB;IACjD,OAAO,QAAQ,IAAI,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACxD,CAAC;AAED,SAAgB,sBAAsB,CACpC,IAAgC;IAEhC,OAAO,QAAQ,IAAI,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACxD,CAAC;AAED,2DAA2D;AAC9C,QAAA,eAAe,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAU,CAAC;AAI7E,2EAA2E;AAC9D,QAAA,iBAAiB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AAgCnE,+CAA+C;AAClC,QAAA,UAAU,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAU,CAAC"}
|
package/dist/base/guard.d.ts
CHANGED
|
@@ -82,11 +82,11 @@ export declare const GuardSchema: z.ZodObject<{
|
|
|
82
82
|
copy: z.ZodOptional<z.ZodBoolean>;
|
|
83
83
|
}, "strip", z.ZodTypeAny, {
|
|
84
84
|
content: string;
|
|
85
|
-
language?: "text" | "json" | "sql" | "html" | "javascript" | "
|
|
85
|
+
language?: "text" | "json" | "sql" | "html" | "javascript" | "typescript" | "shell" | undefined;
|
|
86
86
|
copy?: boolean | undefined;
|
|
87
87
|
}, {
|
|
88
88
|
content: string;
|
|
89
|
-
language?: "text" | "json" | "sql" | "html" | "javascript" | "
|
|
89
|
+
language?: "text" | "json" | "sql" | "html" | "javascript" | "typescript" | "shell" | undefined;
|
|
90
90
|
copy?: boolean | undefined;
|
|
91
91
|
}>>>;
|
|
92
92
|
variant: z.ZodOptional<z.ZodDefault<z.ZodEnum<["no-data", "no-result", "no-access", "error"]>>>;
|
|
@@ -98,7 +98,7 @@ export declare const GuardSchema: z.ZodObject<{
|
|
|
98
98
|
}, "strip", z.ZodTypeAny, {
|
|
99
99
|
code?: {
|
|
100
100
|
content: string;
|
|
101
|
-
language?: "text" | "json" | "sql" | "html" | "javascript" | "
|
|
101
|
+
language?: "text" | "json" | "sql" | "html" | "javascript" | "typescript" | "shell" | undefined;
|
|
102
102
|
copy?: boolean | undefined;
|
|
103
103
|
} | undefined;
|
|
104
104
|
description?: string | undefined;
|
|
@@ -119,7 +119,7 @@ export declare const GuardSchema: z.ZodObject<{
|
|
|
119
119
|
}, {
|
|
120
120
|
code?: {
|
|
121
121
|
content: string;
|
|
122
|
-
language?: "text" | "json" | "sql" | "html" | "javascript" | "
|
|
122
|
+
language?: "text" | "json" | "sql" | "html" | "javascript" | "typescript" | "shell" | undefined;
|
|
123
123
|
copy?: boolean | undefined;
|
|
124
124
|
} | undefined;
|
|
125
125
|
description?: string | undefined;
|
|
@@ -147,7 +147,7 @@ export declare const GuardSchema: z.ZodObject<{
|
|
|
147
147
|
fallback?: {
|
|
148
148
|
code?: {
|
|
149
149
|
content: string;
|
|
150
|
-
language?: "text" | "json" | "sql" | "html" | "javascript" | "
|
|
150
|
+
language?: "text" | "json" | "sql" | "html" | "javascript" | "typescript" | "shell" | undefined;
|
|
151
151
|
copy?: boolean | undefined;
|
|
152
152
|
} | undefined;
|
|
153
153
|
description?: string | undefined;
|
|
@@ -175,7 +175,7 @@ export declare const GuardSchema: z.ZodObject<{
|
|
|
175
175
|
fallback?: {
|
|
176
176
|
code?: {
|
|
177
177
|
content: string;
|
|
178
|
-
language?: "text" | "json" | "sql" | "html" | "javascript" | "
|
|
178
|
+
language?: "text" | "json" | "sql" | "html" | "javascript" | "typescript" | "shell" | undefined;
|
|
179
179
|
copy?: boolean | undefined;
|
|
180
180
|
} | undefined;
|
|
181
181
|
description?: string | undefined;
|
|
@@ -31,10 +31,14 @@ function applyArchiveModeDefaultRules(rowActions, archiveField) {
|
|
|
31
31
|
};
|
|
32
32
|
continue;
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
// A rule of the table's own narrows the archive one, never lifts it: an
|
|
35
|
+
// archived row stays out of reach of edit, a live one of delete.
|
|
36
|
+
if (typeof userConfig === "object") {
|
|
35
37
|
result[actionKey] = {
|
|
36
38
|
...userConfig,
|
|
37
|
-
rule:
|
|
39
|
+
rule: userConfig.rule
|
|
40
|
+
? { and: [defaultRule, userConfig.rule] }
|
|
41
|
+
: defaultRule,
|
|
38
42
|
};
|
|
39
43
|
}
|
|
40
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"archive-mode-helpers.js","sourceRoot":"","sources":["../../../src/base/helpers/archive-mode-helpers.ts"],"names":[],"mappings":";;AAGA,
|
|
1
|
+
{"version":3,"file":"archive-mode-helpers.js","sourceRoot":"","sources":["../../../src/base/helpers/archive-mode-helpers.ts"],"names":[],"mappings":";;AAGA,oEAsDC;AAtDD,SAAgB,4BAA4B,CAC1C,UAAoD,EACpD,YAAoB;IAEpB,MAAM,MAAM,GAAiC,EAAE,GAAG,UAAU,EAAE,CAAC;IAE/D,MAAM,KAAK,GAAG;QACZ,IAAI,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE;QAC9C,SAAS,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE;QACnD,OAAO,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE;QACjD,OAAO,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE;QAC9C,MAAM,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE;KAC9C,CAAC;IAEF,KAAK,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1D,MAAM,SAAS,GAAG,MAA4B,CAAC;QAC/C,MAAM,UAAU,GAAG,UAAU,EAAE,CAAC,SAAS,CAAC,CAAC;QAE3C,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC7B,MAAM,CAAC,SAAS,CAAC,GAAG;gBAClB,SAAS,EAAE,IAAI;gBACf,IAAI,EAAE,WAA+B;aACT,CAAC;YAC/B,SAAS;QACX,CAAC;QAED,IACE,UAAU,KAAK,KAAK;YACpB,CAAC,OAAO,UAAU,KAAK,QAAQ,IAAI,UAAU,CAAC,SAAS,KAAK,KAAK,CAAC,EAClE,CAAC;YACD,SAAS;QACX,CAAC;QAED,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;YACxB,MAAM,CAAC,SAAS,CAAC,GAAG;gBAClB,SAAS,EAAE,IAAI;gBACf,IAAI,EAAE,WAA+B;aACT,CAAC;YAC/B,SAAS;QACX,CAAC;QAED,wEAAwE;QACxE,iEAAiE;QACjE,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;YACnC,MAAM,CAAC,SAAS,CAAC,GAAG;gBAClB,GAAG,UAAU;gBACb,IAAI,EAAE,UAAU,CAAC,IAAI;oBACnB,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,WAA+B,EAAE,UAAU,CAAC,IAAI,CAAC,EAAE;oBAC7D,CAAC,CAAE,WAAgC;aACT,CAAC;QACjC,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/base/index.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export * from "./layouts";
|
|
|
23
23
|
export * from "./live-toggle";
|
|
24
24
|
export * from "./meter";
|
|
25
25
|
export * from "./nav-card-grid";
|
|
26
|
+
export * from "./page-toolbar";
|
|
26
27
|
export * from "./period-selector";
|
|
27
28
|
export * from "./placeholder";
|
|
28
29
|
export * from "./resource-form-schema";
|
package/dist/base/index.js
CHANGED
|
@@ -44,6 +44,7 @@ __exportStar(require("./layouts"), exports);
|
|
|
44
44
|
__exportStar(require("./live-toggle"), exports);
|
|
45
45
|
__exportStar(require("./meter"), exports);
|
|
46
46
|
__exportStar(require("./nav-card-grid"), exports);
|
|
47
|
+
__exportStar(require("./page-toolbar"), exports);
|
|
47
48
|
__exportStar(require("./period-selector"), exports);
|
|
48
49
|
__exportStar(require("./placeholder"), exports);
|
|
49
50
|
__exportStar(require("./resource-form-schema"), exports);
|
package/dist/base/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/base/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8EAA8E;AAC9E,6EAA6E;AAC7E,2EAA2E;AAC3E,uEAAuE;AACvE,mEAAmE;AACnE,sCAAoC;AACpC,oCAAkC;AAElC,kDAAgC;AAChC,gDAA8B;AAC9B,iDAA+B;AAC/B,mDAAiC;AACjC,2CAAyB;AACzB,yCAAuB;AACvB,0CAAwB;AACxB,+CAA6B;AAC7B,kDAAgC;AAChC,+CAA6B;AAC7B,mDAAiC;AACjC,4CAA0B;AAC1B,gDAA8B;AAC9B,gDAA8B;AAC9B,yCAAuB;AACvB,yCAAuB;AACvB,0CAAwB;AACxB,mDAAiC;AACjC,6CAA2B;AAC3B,4CAA0B;AAC1B,gDAA8B;AAC9B,0CAAwB;AACxB,kDAAgC;AAChC,oDAAkC;AAClC,gDAA8B;AAC9B,yDAAuC;AACvC,+CAA6B;AAC7B,4CAA0B;AAC1B,0CAAwB;AACxB,+CAA6B;AAC7B,wCAAsB;AACtB,+CAA6B;AAC7B,0DAAwC;AACxC,kDAAgC;AAChC,0CAAwB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/base/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8EAA8E;AAC9E,6EAA6E;AAC7E,2EAA2E;AAC3E,uEAAuE;AACvE,mEAAmE;AACnE,sCAAoC;AACpC,oCAAkC;AAElC,kDAAgC;AAChC,gDAA8B;AAC9B,iDAA+B;AAC/B,mDAAiC;AACjC,2CAAyB;AACzB,yCAAuB;AACvB,0CAAwB;AACxB,+CAA6B;AAC7B,kDAAgC;AAChC,+CAA6B;AAC7B,mDAAiC;AACjC,4CAA0B;AAC1B,gDAA8B;AAC9B,gDAA8B;AAC9B,yCAAuB;AACvB,yCAAuB;AACvB,0CAAwB;AACxB,mDAAiC;AACjC,6CAA2B;AAC3B,4CAA0B;AAC1B,gDAA8B;AAC9B,0CAAwB;AACxB,kDAAgC;AAChC,iDAA+B;AAC/B,oDAAkC;AAClC,gDAA8B;AAC9B,yDAAuC;AACvC,+CAA6B;AAC7B,4CAA0B;AAC1B,0CAAwB;AACxB,+CAA6B;AAC7B,wCAAsB;AACtB,+CAA6B;AAC7B,0DAAwC;AACxC,kDAAgC;AAChC,0CAAwB"}
|
|
@@ -17,9 +17,11 @@ function serializeFormField(field) {
|
|
|
17
17
|
component: field.inputComponent || field.type.inputComponent(),
|
|
18
18
|
disabled: field.disabled,
|
|
19
19
|
readonly: field.readonly,
|
|
20
|
+
showEmptyOnCreate: field.showEmptyOnCreate,
|
|
20
21
|
type: typeId,
|
|
21
22
|
required: field.required,
|
|
22
23
|
defaultValue: field.defaultValue,
|
|
24
|
+
offersDefault: field.offersDefault,
|
|
23
25
|
localized: field.localized,
|
|
24
26
|
};
|
|
25
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-schema.js","sourceRoot":"","sources":["../../../src/base/internal/form-schema.ts"],"names":[],"mappings":";;AAQA,
|
|
1
|
+
{"version":3,"file":"form-schema.js","sourceRoot":"","sources":["../../../src/base/internal/form-schema.ts"],"names":[],"mappings":";;AAQA,gDAkBC;AA1BD,6CAAmD;AAGnD;;;;GAIG;AACH,SAAgB,kBAAkB,CAAC,KAAgB;IACjD,MAAM,MAAM,GAAG,IAAA,oBAAa,EAAC,KAAK,CAAC,IAAI,CAAC,IAAI,SAAS,CAAC;IAEtD,OAAO;QACL,EAAE,EAAE,KAAK,CAAC,EAAE;QACZ,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,SAAS,EAAE,KAAK,CAAC,cAAc,IAAI,KAAK,CAAC,IAAI,CAAC,cAAc,EAAE;QAC9D,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,iBAAiB,EAAE,KAAK,CAAC,iBAAiB;QAC1C,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,YAAY,EAAE,KAAK,CAAC,YAAY;QAChC,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,SAAS,EAAE,KAAK,CAAC,SAAS;KAC3B,CAAC;AACJ,CAAC"}
|
|
@@ -20,6 +20,8 @@ export interface PageHeaderButtonSerialized extends Omit<CustomButtonSerialized,
|
|
|
20
20
|
buttonId?: string;
|
|
21
21
|
/** Place among the header's buttons (`PageHeaderButton.order`). */
|
|
22
22
|
order?: number;
|
|
23
|
+
/** Acts on the page's record (`PageHeaderButton.requiresRecord`). */
|
|
24
|
+
requiresRecord?: boolean;
|
|
23
25
|
}
|
|
24
26
|
/**
|
|
25
27
|
* A header button as the layout holds it until a request is served: its
|
|
@@ -44,4 +46,6 @@ export interface DefaultLayoutSerializedOptions extends Omit<DefaultLayoutOption
|
|
|
44
46
|
* buttons again when the page URL's query no longer matches it.
|
|
45
47
|
*/
|
|
46
48
|
headerActionsQuery?: Readonly<Record<string, string>>;
|
|
49
|
+
/** The route parameters (`:id`) of the page URL, likewise. */
|
|
50
|
+
headerActionsParams?: Readonly<Record<string, string>>;
|
|
47
51
|
}
|
|
@@ -49,7 +49,10 @@ export interface KeyValueListProps extends BaseComponentProps, BlockItemsSource
|
|
|
49
49
|
items?: KeyValueListItem[];
|
|
50
50
|
/** Tighter rows, for side panels. */
|
|
51
51
|
dense?: boolean;
|
|
52
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* Columns (1–3) once the list itself is wide enough: two from 560px, three
|
|
54
|
+
* from 840px of its own width (a drawer, a card), one below.
|
|
55
|
+
*/
|
|
53
56
|
columns?: number;
|
|
54
57
|
/** Default ISO 4217 code of `money` values. */
|
|
55
58
|
currency?: string;
|
|
@@ -114,10 +117,10 @@ export declare const KeyValueListSchema: z.ZodObject<{
|
|
|
114
117
|
value?: number | BlockText | null | undefined;
|
|
115
118
|
id?: string | undefined;
|
|
116
119
|
to?: string | undefined;
|
|
117
|
-
copy?: boolean | undefined;
|
|
118
|
-
detail?: BlockText | undefined;
|
|
119
120
|
tone?: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral" | undefined;
|
|
120
121
|
currency?: string | undefined;
|
|
122
|
+
detail?: BlockText | undefined;
|
|
123
|
+
copy?: boolean | undefined;
|
|
121
124
|
copyValue?: string | undefined;
|
|
122
125
|
}, {
|
|
123
126
|
label: BlockText;
|
|
@@ -125,10 +128,10 @@ export declare const KeyValueListSchema: z.ZodObject<{
|
|
|
125
128
|
value?: number | BlockText | null | undefined;
|
|
126
129
|
id?: string | undefined;
|
|
127
130
|
to?: string | undefined;
|
|
128
|
-
copy?: boolean | undefined;
|
|
129
|
-
detail?: BlockText | undefined;
|
|
130
131
|
tone?: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral" | undefined;
|
|
131
132
|
currency?: string | undefined;
|
|
133
|
+
detail?: BlockText | undefined;
|
|
134
|
+
copy?: boolean | undefined;
|
|
132
135
|
copyValue?: string | undefined;
|
|
133
136
|
}>, "many">>;
|
|
134
137
|
card: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -144,10 +147,10 @@ export declare const KeyValueListSchema: z.ZodObject<{
|
|
|
144
147
|
value?: number | BlockText | null | undefined;
|
|
145
148
|
id?: string | undefined;
|
|
146
149
|
to?: string | undefined;
|
|
147
|
-
copy?: boolean | undefined;
|
|
148
|
-
detail?: BlockText | undefined;
|
|
149
150
|
tone?: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral" | undefined;
|
|
150
151
|
currency?: string | undefined;
|
|
152
|
+
detail?: BlockText | undefined;
|
|
153
|
+
copy?: boolean | undefined;
|
|
151
154
|
copyValue?: string | undefined;
|
|
152
155
|
}[] | undefined;
|
|
153
156
|
title?: string | undefined;
|
|
@@ -169,10 +172,10 @@ export declare const KeyValueListSchema: z.ZodObject<{
|
|
|
169
172
|
value?: number | BlockText | null | undefined;
|
|
170
173
|
id?: string | undefined;
|
|
171
174
|
to?: string | undefined;
|
|
172
|
-
copy?: boolean | undefined;
|
|
173
|
-
detail?: BlockText | undefined;
|
|
174
175
|
tone?: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral" | undefined;
|
|
175
176
|
currency?: string | undefined;
|
|
177
|
+
detail?: BlockText | undefined;
|
|
178
|
+
copy?: boolean | undefined;
|
|
176
179
|
copyValue?: string | undefined;
|
|
177
180
|
}[] | undefined;
|
|
178
181
|
title?: string | undefined;
|
|
@@ -97,7 +97,7 @@ exports.KeyValueListSchema = zod_1.z.object({
|
|
|
97
97
|
.min(1)
|
|
98
98
|
.max(3)
|
|
99
99
|
.default(KEY_VALUE_LIST_DEFAULTS.columns)
|
|
100
|
-
.describe("How many columns
|
|
100
|
+
.describe("How many columns once the list is wide enough."), { label: "Columns", group: "layout", widget: "number", min: 1, max: 3 }),
|
|
101
101
|
currency: (0, block_registry_1.ui)(zod_1.z
|
|
102
102
|
.string()
|
|
103
103
|
.optional()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key-value-list.js","sourceRoot":"","sources":["../../src/base/key-value-list.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"key-value-list.js","sourceRoot":"","sources":["../../src/base/key-value-list.ts"],"names":[],"mappings":";;;AA4GA,oCAYC;AAxHD,4CAAgD;AAChD,6BAAwB;AACxB,qDAA+E;AAC/E,uCAImB;AACnB,gDAA8C;AAC9C,uCAAgD;AAChD,4DAA2D;AAG3D,gEAAsE;AAEtE;;;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kBAAkB;QACxB,IAAI,EAAE,mBAAmB;QACzB,WAAW,EAAE,qDAAqD;QAClE,KAAK,EAAE,SAAS;KACjB;CACF,CAAC,CAAC"}
|
package/dist/base/kpi-card.d.ts
CHANGED
|
@@ -15,18 +15,43 @@ export interface KpiCardProps extends BaseComponentProps {
|
|
|
15
15
|
*/
|
|
16
16
|
fetchUrl?: string;
|
|
17
17
|
fetchUrlMethod?: EnumOption<HttpMethod>;
|
|
18
|
+
/**
|
|
19
|
+
* Id of the `PeriodSelector` driving the card. The comparison it selects
|
|
20
|
+
* names the card's change ("vs previous year"), and "no comparison" hides
|
|
21
|
+
* the change, the comparison value and the comparison label.
|
|
22
|
+
*/
|
|
18
23
|
periodScope?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Topics the backend publishes on (`PublishMessage`) when the figure moves:
|
|
26
|
+
* the card reads `fetchUrl` again on each event, keeping what it shows,
|
|
27
|
+
* through the page's `live` gate. The page registers them.
|
|
28
|
+
*/
|
|
29
|
+
realtimeTopic?: string | string[];
|
|
19
30
|
valueFormat?: ValueFormat;
|
|
20
31
|
currencyCode?: string;
|
|
21
32
|
valuePrecision?: ValuePrecision;
|
|
22
33
|
showDelta?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Shows the figure the value is compared against ("vs €42,900"), formatted
|
|
36
|
+
* as the value, when the data carries `previousValue`. Defaults to `true`;
|
|
37
|
+
* `false` keeps a card compact.
|
|
38
|
+
*/
|
|
39
|
+
showPreviousValue?: boolean;
|
|
23
40
|
showSparkline?: boolean;
|
|
24
41
|
sparklineAccent?: ChartColorValue | "auto";
|
|
25
42
|
invert?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* The caption of the change. Optional: a card with a `periodScope` and no
|
|
45
|
+
* `description` names the comparison its selector applies on its own, so
|
|
46
|
+
* set it only for a wording of your own. Shown with the change only:
|
|
47
|
+
* without a comparison, `description` shows in its place.
|
|
48
|
+
*/
|
|
26
49
|
compareLabel?: string;
|
|
27
50
|
staticValue?: number;
|
|
28
51
|
/** The change in percent, as a fetched `delta`: 12.5 reads +12.5 %. */
|
|
29
52
|
staticDelta?: number;
|
|
53
|
+
/** The figure compared against, as a fetched `previousValue`. */
|
|
54
|
+
staticPreviousValue?: number;
|
|
30
55
|
staticSparkline?: number[];
|
|
31
56
|
}
|
|
32
57
|
/**
|
|
@@ -45,15 +70,18 @@ export declare const KpiCardSchema: z.ZodObject<{
|
|
|
45
70
|
fetchUrl: z.ZodOptional<z.ZodString>;
|
|
46
71
|
fetchUrlMethod: z.ZodOptional<z.ZodNativeEnum<typeof HttpMethod>>;
|
|
47
72
|
periodScope: z.ZodOptional<z.ZodString>;
|
|
73
|
+
realtimeTopic: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
48
74
|
valueFormat: z.ZodOptional<z.ZodEnum<["number", "currency", "percent", "compact"]>>;
|
|
49
75
|
currencyCode: z.ZodOptional<z.ZodString>;
|
|
50
76
|
showDelta: z.ZodOptional<z.ZodBoolean>;
|
|
77
|
+
showPreviousValue: z.ZodOptional<z.ZodBoolean>;
|
|
51
78
|
showSparkline: z.ZodOptional<z.ZodBoolean>;
|
|
52
|
-
sparklineAccent: z.ZodOptional<z.ZodType<"auto"
|
|
79
|
+
sparklineAccent: z.ZodOptional<z.ZodType<ChartColorValue | "auto", z.ZodTypeDef, ChartColorValue | "auto">>;
|
|
53
80
|
invert: z.ZodOptional<z.ZodBoolean>;
|
|
54
81
|
compareLabel: z.ZodOptional<z.ZodString>;
|
|
55
82
|
staticValue: z.ZodOptional<z.ZodNumber>;
|
|
56
83
|
staticDelta: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
staticPreviousValue: z.ZodOptional<z.ZodNumber>;
|
|
57
85
|
staticSparkline: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
58
86
|
}, "strip", z.ZodTypeAny, {
|
|
59
87
|
title: string;
|
|
@@ -63,15 +91,18 @@ export declare const KpiCardSchema: z.ZodObject<{
|
|
|
63
91
|
fetchUrl?: string | undefined;
|
|
64
92
|
fetchUrlMethod?: HttpMethod | undefined;
|
|
65
93
|
periodScope?: string | undefined;
|
|
94
|
+
realtimeTopic?: string | string[] | undefined;
|
|
66
95
|
valueFormat?: "number" | "percent" | "compact" | "currency" | undefined;
|
|
67
96
|
currencyCode?: string | undefined;
|
|
68
97
|
showDelta?: boolean | undefined;
|
|
69
|
-
showSparkline?: boolean | undefined;
|
|
70
|
-
sparklineAccent?: "auto" | ChartColorValue | undefined;
|
|
71
98
|
invert?: boolean | undefined;
|
|
99
|
+
showPreviousValue?: boolean | undefined;
|
|
100
|
+
showSparkline?: boolean | undefined;
|
|
101
|
+
sparklineAccent?: ChartColorValue | "auto" | undefined;
|
|
72
102
|
compareLabel?: string | undefined;
|
|
73
103
|
staticValue?: number | undefined;
|
|
74
104
|
staticDelta?: number | undefined;
|
|
105
|
+
staticPreviousValue?: number | undefined;
|
|
75
106
|
staticSparkline?: number[] | undefined;
|
|
76
107
|
}, {
|
|
77
108
|
title: string;
|
|
@@ -81,14 +112,17 @@ export declare const KpiCardSchema: z.ZodObject<{
|
|
|
81
112
|
fetchUrl?: string | undefined;
|
|
82
113
|
fetchUrlMethod?: HttpMethod | undefined;
|
|
83
114
|
periodScope?: string | undefined;
|
|
115
|
+
realtimeTopic?: string | string[] | undefined;
|
|
84
116
|
valueFormat?: "number" | "percent" | "compact" | "currency" | undefined;
|
|
85
117
|
currencyCode?: string | undefined;
|
|
86
118
|
showDelta?: boolean | undefined;
|
|
87
|
-
showSparkline?: boolean | undefined;
|
|
88
|
-
sparklineAccent?: "auto" | ChartColorValue | undefined;
|
|
89
119
|
invert?: boolean | undefined;
|
|
120
|
+
showPreviousValue?: boolean | undefined;
|
|
121
|
+
showSparkline?: boolean | undefined;
|
|
122
|
+
sparklineAccent?: ChartColorValue | "auto" | undefined;
|
|
90
123
|
compareLabel?: string | undefined;
|
|
91
124
|
staticValue?: number | undefined;
|
|
92
125
|
staticDelta?: number | undefined;
|
|
126
|
+
staticPreviousValue?: number | undefined;
|
|
93
127
|
staticSparkline?: number[] | undefined;
|
|
94
128
|
}>;
|
package/dist/base/kpi-card.js
CHANGED
|
@@ -5,6 +5,8 @@ exports.KpiCard = KpiCard;
|
|
|
5
5
|
const component_1 = require("../component");
|
|
6
6
|
const zod_1 = require("zod");
|
|
7
7
|
const block_registry_1 = require("./block-registry");
|
|
8
|
+
const display_1 = require("./display");
|
|
9
|
+
const realtime_topics_1 = require("./internal/realtime-topics");
|
|
8
10
|
const chart_1 = require("./chart");
|
|
9
11
|
const http_1 = require("./types/http");
|
|
10
12
|
const KPI_CARD_COMPONENT_NAME = "dms-kpi-card";
|
|
@@ -15,12 +17,12 @@ const KPI_CARD_COMPONENT_NAME = "dms-kpi-card";
|
|
|
15
17
|
* on every edit — so a block with nothing set yet has to be a legal call.
|
|
16
18
|
*/
|
|
17
19
|
function KpiCard(options) {
|
|
18
|
-
return new component_1.ComponentBuilder(KPI_CARD_COMPONENT_NAME)
|
|
20
|
+
return (0, realtime_topics_1.attachRealtimeTopicsHook)(new component_1.ComponentBuilder(KPI_CARD_COMPONENT_NAME)
|
|
19
21
|
.options({ ...options })
|
|
20
22
|
.meta({
|
|
21
23
|
name: options?.title || "KPI card",
|
|
22
24
|
icon: options?.icon || "i-ph-trend-up",
|
|
23
|
-
});
|
|
25
|
+
}), options?.realtimeTopic);
|
|
24
26
|
}
|
|
25
27
|
/** The options `KpiCard` accepts. */
|
|
26
28
|
exports.KpiCardSchema = zod_1.z.object({
|
|
@@ -54,6 +56,7 @@ exports.KpiCardSchema = zod_1.z.object({
|
|
|
54
56
|
.string()
|
|
55
57
|
.optional()
|
|
56
58
|
.describe("Id of the PeriodSelector driving this card."), { label: "Period scope", group: "advanced" }),
|
|
59
|
+
realtimeTopic: (0, display_1.blockRealtimeTopicOption)(),
|
|
57
60
|
valueFormat: (0, block_registry_1.ui)(zod_1.z.enum(chart_1.VALUE_FORMATS).optional(), {
|
|
58
61
|
label: "Value format",
|
|
59
62
|
group: "appearance",
|
|
@@ -68,6 +71,10 @@ exports.KpiCardSchema = zod_1.z.object({
|
|
|
68
71
|
group: "appearance",
|
|
69
72
|
widget: "switch",
|
|
70
73
|
}),
|
|
74
|
+
showPreviousValue: (0, block_registry_1.ui)(zod_1.z
|
|
75
|
+
.boolean()
|
|
76
|
+
.optional()
|
|
77
|
+
.describe("Show the figure the value is compared against."), { label: "Show comparison value", group: "appearance", widget: "switch" }),
|
|
71
78
|
showSparkline: (0, block_registry_1.ui)(zod_1.z.boolean().optional(), {
|
|
72
79
|
label: "Show sparkline",
|
|
73
80
|
group: "appearance",
|
|
@@ -82,16 +89,21 @@ exports.KpiCardSchema = zod_1.z.object({
|
|
|
82
89
|
.boolean()
|
|
83
90
|
.optional()
|
|
84
91
|
.describe("Treat a falling value as the good outcome."), { label: "Invert variation", group: "behavior", widget: "switch" }),
|
|
85
|
-
compareLabel: (0, block_registry_1.ui)(zod_1.z
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
92
|
+
compareLabel: (0, block_registry_1.ui)(zod_1.z
|
|
93
|
+
.string()
|
|
94
|
+
.optional()
|
|
95
|
+
.describe("Caption of the variation; follows the period selector's comparison when empty."), { label: "Comparison label", group: "content" }),
|
|
89
96
|
staticValue: (0, block_registry_1.ui)(zod_1.z.number().optional().describe("Value shown when no data source is set."), { label: "Static value", group: "advanced", widget: "number" }),
|
|
90
97
|
staticDelta: (0, block_registry_1.ui)(zod_1.z.number().optional(), {
|
|
91
98
|
label: "Static variation",
|
|
92
99
|
group: "advanced",
|
|
93
100
|
widget: "number",
|
|
94
101
|
}),
|
|
102
|
+
staticPreviousValue: (0, block_registry_1.ui)(zod_1.z.number().optional(), {
|
|
103
|
+
label: "Static comparison value",
|
|
104
|
+
group: "advanced",
|
|
105
|
+
widget: "number",
|
|
106
|
+
}),
|
|
95
107
|
staticSparkline: (0, block_registry_1.ui)(zod_1.z.array(zod_1.z.number()).optional(), {
|
|
96
108
|
label: "Static sparkline",
|
|
97
109
|
group: "advanced",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kpi-card.js","sourceRoot":"","sources":["../../src/base/kpi-card.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"kpi-card.js","sourceRoot":"","sources":["../../src/base/kpi-card.ts"],"names":[],"mappings":";;;AA+EA,0BAYC;AA3FD,4CAAgD;AAChD,6BAAwB;AACxB,qDAK0B;AAC1B,uCAAqD;AACrD,gEAAsE;AACtE,mCAKiB;AAEjB,uCAA0C;AAsD1C,MAAM,uBAAuB,GAAG,cAAc,CAAC;AAE/C;;;;;GAKG;AACH,SAAgB,OAAO,CACrB,OAAsB;IAEtB,OAAO,IAAA,0CAAwB,EAC7B,IAAI,4BAAgB,CAAe,uBAAuB,CAAC;SACxD,OAAO,CAAC,EAAE,GAAG,OAAO,EAAkB,CAAC;SACvC,IAAI,CAAC;QACJ,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,UAAU;QAClC,IAAI,EAAE,OAAO,EAAE,IAAI,IAAI,eAAe;KACvC,CAAC,EACJ,OAAO,EAAE,aAAa,CACvB,CAAC;AACJ,CAAC;AAED,qCAAqC;AACxB,QAAA,aAAa,GAAG,OAAC,CAAC,MAAM,CAAC;IACpC,KAAK,EAAE,IAAA,mBAAE,EAAC,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE;QAC9C,KAAK,EAAE,OAAO;QACd,KAAK,EAAE,SAAS;KACjB,CAAC;IACF,WAAW,EAAE,IAAA,mBAAE,EACb,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC,EACjE,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,CAC/D;IACD,IAAI,EAAE,IAAA,mBAAE,EAAC,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,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AChD;IACD,WAAW,EAAE,IAAA,mBAAE,EACb,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yCAAyC,CAAC,EACzE,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,CAC/D;IACD,WAAW,EAAE,IAAA,mBAAE,EAAC,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE;QACrC,KAAK,EAAE,kBAAkB;QACzB,KAAK,EAAE,UAAU;QACjB,MAAM,EAAE,QAAQ;KACjB,CAAC;IACF,mBAAmB,EAAE,IAAA,mBAAE,EAAC,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE;QAC7C,KAAK,EAAE,yBAAyB;QAChC,KAAK,EAAE,UAAU;QACjB,MAAM,EAAE,QAAQ;KACjB,CAAC;IACF,eAAe,EAAE,IAAA,mBAAE,EAAC,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE;QAClD,KAAK,EAAE,kBAAkB;QACzB,KAAK,EAAE,UAAU;QACjB,MAAM,EAAE,MAAM;KACf,CAAC;CACH,CAAyC,CAAC;AAE3C,IAAA,kCAAiB,EAAC;IAChB,IAAI,EAAE,SAAS;IACf,aAAa,EAAE,uBAAuB;IACtC,MAAM,EAAE,qBAAa;IACrB,IAAI,EAAE;QACJ,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,4CAA4C;QACzD,KAAK,EAAE,eAAe;KACvB;CACF,CAAC,CAAC"}
|
package/dist/base/layouts.d.ts
CHANGED
|
@@ -11,6 +11,24 @@ export interface PageHeaderButton extends CustomButton {
|
|
|
11
11
|
* "header"`) take `0`.
|
|
12
12
|
*/
|
|
13
13
|
order?: number;
|
|
14
|
+
/**
|
|
15
|
+
* The button acts on the record the page shows (the layout's `record`): it
|
|
16
|
+
* is disabled while the record loads, and left out of a page whose record
|
|
17
|
+
* cannot be read (not found). A target naming `{{record.X}}` implies it.
|
|
18
|
+
*/
|
|
19
|
+
requiresRecord?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The record a page shows, which its header buttons read: a target may name
|
|
23
|
+
* its fields as `{{record.X}}` (an address in a maps link).
|
|
24
|
+
*/
|
|
25
|
+
export interface PageRecordSource {
|
|
26
|
+
/**
|
|
27
|
+
* URL answering the record, typically its controller's `get` route;
|
|
28
|
+
* `{{params.X}}` and `{{query.X}}` are filled in from the page URL.
|
|
29
|
+
* @example "/api/sites/get?id={{params.id}}"
|
|
30
|
+
*/
|
|
31
|
+
fetchUrl: string;
|
|
14
32
|
}
|
|
15
33
|
export interface DefaultLayoutOptions {
|
|
16
34
|
/**
|
|
@@ -40,6 +58,12 @@ export interface DefaultLayoutOptions {
|
|
|
40
58
|
* An `availability` disables a button for one request, or hides it.
|
|
41
59
|
*/
|
|
42
60
|
headerActions?: PageHeaderButton[];
|
|
61
|
+
/**
|
|
62
|
+
* The record the page shows, for the header buttons that act on it
|
|
63
|
+
* (`requiresRecord`, or a `{{record.X}}` in their target). Read once per
|
|
64
|
+
* page: a block reading the same `fetchUrl` shares the request.
|
|
65
|
+
*/
|
|
66
|
+
record?: PageRecordSource;
|
|
43
67
|
}
|
|
44
68
|
export declare function DefaultLayout(options?: DefaultLayoutOptions): ComponentInfo;
|
|
45
69
|
/**
|
package/dist/base/layouts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layouts.js","sourceRoot":"","sources":["../../src/base/layouts.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"layouts.js","sourceRoot":"","sources":["../../src/base/layouts.ts"],"names":[],"mappings":";;AA0GA,sCAKC;AAMD,wCAIC;AAQD,wCAIC;AAED,kCAKC;AA3ID,8DAAmE;AACnE,kEAAuE;AA2EvE,8DAA8D;AAC9D,MAAM,uBAAuB,GAAG,S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