@mintplayer/ng-spark 22.23.0 → 22.25.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.
Files changed (71) hide show
  1. package/README.md +196 -0
  2. package/fesm2022/mintplayer-ng-spark-attribute-description.mjs +100 -47
  3. package/fesm2022/mintplayer-ng-spark-attribute-description.mjs.map +1 -1
  4. package/fesm2022/mintplayer-ng-spark-client-operations.mjs +310 -329
  5. package/fesm2022/mintplayer-ng-spark-client-operations.mjs.map +1 -1
  6. package/fesm2022/mintplayer-ng-spark-column-filter.mjs +175 -135
  7. package/fesm2022/mintplayer-ng-spark-column-filter.mjs.map +1 -1
  8. package/fesm2022/mintplayer-ng-spark-contributions.mjs +721 -0
  9. package/fesm2022/mintplayer-ng-spark-contributions.mjs.map +1 -0
  10. package/fesm2022/mintplayer-ng-spark-grid.mjs +2385 -1118
  11. package/fesm2022/mintplayer-ng-spark-grid.mjs.map +1 -1
  12. package/fesm2022/mintplayer-ng-spark-history.mjs +598 -0
  13. package/fesm2022/mintplayer-ng-spark-history.mjs.map +1 -0
  14. package/fesm2022/mintplayer-ng-spark-icon.mjs +64 -27
  15. package/fesm2022/mintplayer-ng-spark-icon.mjs.map +1 -1
  16. package/fesm2022/mintplayer-ng-spark-models.mjs +405 -762
  17. package/fesm2022/mintplayer-ng-spark-models.mjs.map +1 -1
  18. package/fesm2022/mintplayer-ng-spark-moderation.mjs +1212 -0
  19. package/fesm2022/mintplayer-ng-spark-moderation.mjs.map +1 -0
  20. package/fesm2022/mintplayer-ng-spark-panels.mjs +60 -0
  21. package/fesm2022/mintplayer-ng-spark-panels.mjs.map +1 -0
  22. package/fesm2022/mintplayer-ng-spark-pipes.mjs +1158 -765
  23. package/fesm2022/mintplayer-ng-spark-pipes.mjs.map +1 -1
  24. package/fesm2022/mintplayer-ng-spark-po-create.mjs +273 -169
  25. package/fesm2022/mintplayer-ng-spark-po-create.mjs.map +1 -1
  26. package/fesm2022/mintplayer-ng-spark-po-detail.mjs +795 -410
  27. package/fesm2022/mintplayer-ng-spark-po-detail.mjs.map +1 -1
  28. package/fesm2022/mintplayer-ng-spark-po-edit.mjs +1196 -280
  29. package/fesm2022/mintplayer-ng-spark-po-edit.mjs.map +1 -1
  30. package/fesm2022/mintplayer-ng-spark-po-form.mjs +2244 -1224
  31. package/fesm2022/mintplayer-ng-spark-po-form.mjs.map +1 -1
  32. package/fesm2022/mintplayer-ng-spark-query-list.mjs +571 -303
  33. package/fesm2022/mintplayer-ng-spark-query-list.mjs.map +1 -1
  34. package/fesm2022/mintplayer-ng-spark-renderers.mjs +44 -55
  35. package/fesm2022/mintplayer-ng-spark-renderers.mjs.map +1 -1
  36. package/fesm2022/mintplayer-ng-spark-retry-action-modal.mjs +216 -177
  37. package/fesm2022/mintplayer-ng-spark-retry-action-modal.mjs.map +1 -1
  38. package/fesm2022/mintplayer-ng-spark-routes.mjs +24 -28
  39. package/fesm2022/mintplayer-ng-spark-routes.mjs.map +1 -1
  40. package/fesm2022/mintplayer-ng-spark-services.mjs +625 -640
  41. package/fesm2022/mintplayer-ng-spark-services.mjs.map +1 -1
  42. package/fesm2022/mintplayer-ng-spark-shell.mjs +1031 -397
  43. package/fesm2022/mintplayer-ng-spark-shell.mjs.map +1 -1
  44. package/fesm2022/mintplayer-ng-spark-soft-delete.mjs +294 -0
  45. package/fesm2022/mintplayer-ng-spark-soft-delete.mjs.map +1 -0
  46. package/fesm2022/mintplayer-ng-spark.mjs +14 -48
  47. package/fesm2022/mintplayer-ng-spark.mjs.map +1 -1
  48. package/package.json +23 -2
  49. package/types/mintplayer-ng-spark-attribute-description.d.ts +25 -18
  50. package/types/mintplayer-ng-spark-client-operations.d.ts +139 -160
  51. package/types/mintplayer-ng-spark-column-filter.d.ts +73 -55
  52. package/types/mintplayer-ng-spark-contributions.d.ts +231 -0
  53. package/types/mintplayer-ng-spark-grid.d.ts +917 -448
  54. package/types/mintplayer-ng-spark-history.d.ts +216 -0
  55. package/types/mintplayer-ng-spark-icon.d.ts +15 -13
  56. package/types/mintplayer-ng-spark-models.d.ts +681 -573
  57. package/types/mintplayer-ng-spark-moderation.d.ts +402 -0
  58. package/types/mintplayer-ng-spark-panels.d.ts +143 -0
  59. package/types/mintplayer-ng-spark-pipes.d.ts +131 -149
  60. package/types/mintplayer-ng-spark-po-create.d.ts +46 -37
  61. package/types/mintplayer-ng-spark-po-detail.d.ts +180 -117
  62. package/types/mintplayer-ng-spark-po-edit.d.ts +367 -64
  63. package/types/mintplayer-ng-spark-po-form.d.ts +558 -373
  64. package/types/mintplayer-ng-spark-query-list.d.ts +143 -82
  65. package/types/mintplayer-ng-spark-renderers.d.ts +121 -85
  66. package/types/mintplayer-ng-spark-retry-action-modal.d.ts +31 -34
  67. package/types/mintplayer-ng-spark-routes.d.ts +7 -11
  68. package/types/mintplayer-ng-spark-services.d.ts +377 -261
  69. package/types/mintplayer-ng-spark-shell.d.ts +228 -132
  70. package/types/mintplayer-ng-spark-soft-delete.d.ts +90 -0
  71. package/types/mintplayer-ng-spark.d.ts +19 -12
@@ -1,117 +1,180 @@
1
- import * as _angular_core from '@angular/core';
2
- import { TemplateRef, Type } from '@angular/core';
3
- import { Color } from '@mintplayer/ng-bootstrap';
4
- import { SparkLanguageService } from '@mintplayer/ng-spark/services';
5
- import { PersistentObject, EntityType, CustomActionDefinition, LookupReference, QueryResultItem, EntityAttributeDefinition, AttributeTab, AttributeGroup } from '@mintplayer/ng-spark/models';
6
-
7
- declare class SparkPoDetailComponent {
8
- private readonly route;
9
- private readonly router;
10
- private readonly sparkService;
11
- private readonly queryRefresh;
12
- private readonly attributeRefresh;
13
- protected readonly lang: SparkLanguageService;
14
- private readonly rendererRegistry;
15
- showCustomActions: _angular_core.InputSignal<boolean>;
16
- extraActionsTemplate: _angular_core.InputSignal<TemplateRef<void> | null>;
17
- extraContentTemplate: _angular_core.InputSignal<TemplateRef<{
18
- $implicit: PersistentObject;
19
- entityType: EntityType;
20
- }> | null>;
21
- /**
22
- * Header slots forwarded to every sub-query card on this page.
23
- *
24
- * A structural directive cannot cross a component boundary, and this component is created by
25
- * the router — in a default app there is no `<spark-po-detail>` tag to project content into.
26
- * So an app that wants slotted chrome on its sub-queries substitutes its own route component
27
- * via `SparkRouteConfig.poDetail` and forwards the templates through here. Forwarding a
28
- * `TemplateRef` as an input is already this component's idiom; see the two above.
29
- *
30
- * Each slot may target one query by alias, so a single forwarded set serves a page rendering
31
- * several sub-queries.
32
- */
33
- queryIconTemplate: _angular_core.InputSignal<TemplateRef<any> | null>;
34
- queryCaptionTemplate: _angular_core.InputSignal<TemplateRef<any> | null>;
35
- queryActionsTemplate: _angular_core.InputSignal<TemplateRef<any> | null>;
36
- edited: _angular_core.OutputEmitterRef<void>;
37
- deleted: _angular_core.OutputEmitterRef<void>;
38
- customActionExecuted: _angular_core.OutputEmitterRef<{
39
- action: CustomActionDefinition;
40
- item: PersistentObject;
41
- }>;
42
- colors: typeof Color;
43
- errorMessage: _angular_core.WritableSignal<string | null>;
44
- entityType: _angular_core.WritableSignal<EntityType | null>;
45
- allEntityTypes: _angular_core.WritableSignal<EntityType[]>;
46
- item: _angular_core.WritableSignal<PersistentObject | null>;
47
- lookupReferenceOptions: _angular_core.WritableSignal<Record<string, LookupReference>>;
48
- asDetailTypes: _angular_core.WritableSignal<Record<string, EntityType>>;
49
- asDetailReferenceOptions: _angular_core.WritableSignal<Record<string, Record<string, QueryResultItem[]>>>;
50
- type: string;
51
- id: string;
52
- canEdit: _angular_core.WritableSignal<boolean>;
53
- canDelete: _angular_core.WritableSignal<boolean>;
54
- customActions: _angular_core.WritableSignal<CustomActionDefinition[]>;
55
- /**
56
- * The actions actually offered for the object on screen.
57
- *
58
- * The catalogue at `/spark/actions/{objectTypeId}` is per TYPE -- the server is never told which
59
- * row is open -- so an action that applies to only some rows cannot be filtered there. The
60
- * entity's actions hook decides while it has the entity in hand and withholds what does not
61
- * apply, and the object arrives carrying that answer.
62
- *
63
- * An affordance, not a permission: the endpoint stays reachable and the action handler still
64
- * refuses on its own terms. What this prevents is offering a destructive action where it cannot
65
- * possibly apply -- Coverage showed an irreversible red "Delete data" button on every repository
66
- * page, healthy ones included, and only admitted it would refuse after the confirmation prompt.
67
- */
68
- visibleCustomActions: _angular_core.Signal<CustomActionDefinition[]>;
69
- constructor();
70
- /**
71
- * Applies patched attribute values in place, without a re-fetch.
72
- *
73
- * The operation carries the value the server computed after its own write, so this is both
74
- * cheaper and more correct than re-reading: a re-read goes through a RavenDB index that may
75
- * still be stale from the very write that produced the patch, and would show the old value.
76
- */
77
- private applyAttributePatches;
78
- private onParamsChange;
79
- visibleAttributes: _angular_core.Signal<EntityAttributeDefinition[]>;
80
- private static readonly DEFAULT_TAB;
81
- ungroupedAttributes: _angular_core.Signal<EntityAttributeDefinition[]>;
82
- resolvedTabs: _angular_core.Signal<AttributeTab[]>;
83
- groupsForTab(tab: AttributeTab): AttributeGroup[];
84
- attrsForGroup(group: AttributeGroup): EntityAttributeDefinition[];
85
- getDetailRendererComponent(attr: EntityAttributeDefinition): Type<any> | null;
86
- getDetailRendererInputs(component: Type<any>, attr: EntityAttributeDefinition, item: PersistentObject): Record<string, any>;
87
- /** Column renderer for a cell of an AsDetail sub-table (so embedded rows honor `col.renderer` too). */
88
- getAsDetailCellRendererComponent(col: EntityAttributeDefinition): Type<any> | null;
89
- getAsDetailCellRendererInputs(component: Type<any>, row: Record<string, any>, col: EntityAttributeDefinition): Record<string, any>;
90
- private loadLookupReferenceOptions;
91
- private loadAsDetailTypes;
92
- /**
93
- * The bootstrap classes for a custom action's button. Outline-primary stays the default, so
94
- * every existing action looks exactly as it did; a server-declared variant opts one action into
95
- * a louder style. Restricted to a known set rather than interpolated, because the value arrives
96
- * from a JSON file and must not be able to put arbitrary classes on the button.
97
- */
98
- protected customActionClass(action: CustomActionDefinition): string;
99
- /**
100
- * The action currently running, or null. Drives the disabled state on every custom-action
101
- * button.
102
- *
103
- * A custom action is not necessarily quick: Coverage's Resync makes paged GitHub App calls for
104
- * every account the caller manages, inside the request. Without this the button stayed live and
105
- * looked inert for several seconds, and a second click queued a second full run -- which is how
106
- * a slow action and a broken one became indistinguishable.
107
- */
108
- runningAction: _angular_core.WritableSignal<string | null>;
109
- onCustomAction(action: CustomActionDefinition): Promise<void>;
110
- onEdit(): void;
111
- onDelete(): Promise<void>;
112
- onBack(): void;
113
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<SparkPoDetailComponent, never>;
114
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<SparkPoDetailComponent, "spark-po-detail", never, { "showCustomActions": { "alias": "showCustomActions"; "required": false; "isSignal": true; }; "extraActionsTemplate": { "alias": "extraActionsTemplate"; "required": false; "isSignal": true; }; "extraContentTemplate": { "alias": "extraContentTemplate"; "required": false; "isSignal": true; }; "queryIconTemplate": { "alias": "queryIconTemplate"; "required": false; "isSignal": true; }; "queryCaptionTemplate": { "alias": "queryCaptionTemplate"; "required": false; "isSignal": true; }; "queryActionsTemplate": { "alias": "queryActionsTemplate"; "required": false; "isSignal": true; }; }, { "edited": "edited"; "deleted": "deleted"; "customActionExecuted": "customActionExecuted"; }, never, never, true, never>;
115
- }
116
-
117
- export { SparkPoDetailComponent };
1
+ import * as i0 from "@angular/core";
2
+ import { TemplateRef, Type } from "@angular/core";
3
+ import { Color } from "@mintplayer/ng-bootstrap";
4
+ import { SparkLanguageService } from "@mintplayer/ng-spark/services";
5
+ import { SparkResolvedRowRenderer } from "@mintplayer/ng-spark/renderers";
6
+ import { AttributeGroup, AttributeTab, CustomActionDefinition, EntityAttributeDefinition, EntityPermissions, EntityType, LookupReference, PersistentObject, QueryResultItem, SparkDeletedFilter } from "@mintplayer/ng-spark/models";
7
+ import { SparkDetailContext } from "@mintplayer/ng-spark/panels";
8
+ export declare class SparkPoDetailComponent {
9
+ private readonly route;
10
+ private readonly router;
11
+ private readonly sparkService;
12
+ private readonly returnNavigation;
13
+ private readonly queryRefresh;
14
+ private readonly attributeRefresh;
15
+ protected readonly lang: SparkLanguageService;
16
+ protected readonly rendererRegistry: import("@mintplayer/ng-spark/renderers").SparkAttributeRendererRegistration[];
17
+ /**
18
+ * Add-on panels and action-bar buttons (#460, `SPARK_DETAIL_PANELS` / `SPARK_DETAIL_ACTIONS`).
19
+ * Multi-provided, so History, SoftDelete and Moderation can each add theirs to the page
20
+ * `sparkRoutes()` routes to, which is created by the router and takes no templates.
21
+ */
22
+ protected readonly detailPanels: import("@mintplayer/ng-spark/panels").SparkDetailPanel[];
23
+ protected readonly detailActions: import("@mintplayer/ng-spark/panels").SparkDetailAction[];
24
+ showCustomActions: import("@angular/core").InputSignal<boolean>;
25
+ extraActionsTemplate: import("@angular/core").InputSignal<TemplateRef<void> | null>;
26
+ extraContentTemplate: import("@angular/core").InputSignal<TemplateRef<{
27
+ $implicit: PersistentObject;
28
+ entityType: EntityType;
29
+ }> | null>;
30
+ /**
31
+ * Header slots forwarded to every sub-query card on this page.
32
+ *
33
+ * A structural directive cannot cross a component boundary, and this component is created by
34
+ * the router — in a default app there is no `<spark-po-detail>` tag to project content into.
35
+ * So an app that wants slotted chrome on its sub-queries substitutes its own route component
36
+ * via `SparkRouteConfig.poDetail` and forwards the templates through here. Forwarding a
37
+ * `TemplateRef` as an input is already this component's idiom; see the two above.
38
+ *
39
+ * Each slot may target one query by alias, so a single forwarded set serves a page rendering
40
+ * several sub-queries.
41
+ */
42
+ queryIconTemplate: import("@angular/core").InputSignal<TemplateRef<any> | null>;
43
+ queryCaptionTemplate: import("@angular/core").InputSignal<TemplateRef<any> | null>;
44
+ queryActionsTemplate: import("@angular/core").InputSignal<TemplateRef<any> | null>;
45
+ edited: import("@angular/core").OutputEmitterRef<void>;
46
+ deleted: import("@angular/core").OutputEmitterRef<void>;
47
+ customActionExecuted: import("@angular/core").OutputEmitterRef<{
48
+ action: CustomActionDefinition;
49
+ item: PersistentObject;
50
+ }>;
51
+ colors: typeof Color;
52
+ errorMessage: import("@angular/core").WritableSignal<string | null>;
53
+ entityType: import("@angular/core").WritableSignal<EntityType | null>;
54
+ /** The sub-queries rendered as cards below the form, in object form (#460, D17). */
55
+ protected readonly subQueries: import("@angular/core").Signal<import("@mintplayer/ng-spark/models").SparkSubQuery[]>;
56
+ allEntityTypes: import("@angular/core").WritableSignal<EntityType[]>;
57
+ item: import("@angular/core").WritableSignal<PersistentObject | null>;
58
+ lookupReferenceOptions: import("@angular/core").WritableSignal<Record<string, LookupReference>>;
59
+ asDetailTypes: import("@angular/core").WritableSignal<Record<string, EntityType>>;
60
+ asDetailReferenceOptions: import("@angular/core").WritableSignal<Record<string, Record<string, QueryResultItem[]>>>;
61
+ type: string;
62
+ id: string;
63
+ canEdit: import("@angular/core").WritableSignal<boolean>;
64
+ canDelete: import("@angular/core").WritableSignal<boolean>;
65
+ customActions: import("@angular/core").WritableSignal<CustomActionDefinition[]>;
66
+ /** Type-level rights, kept for the add-on context; null until loaded. */
67
+ permissions: import("@angular/core").WritableSignal<EntityPermissions | null>;
68
+ /**
69
+ * The route's `?deleted=` mode (#460, T2): `only` when the row was opened from the recycle bin.
70
+ * Sent with every load of this object; the server honours it only for `ViewDeleted` holders, so
71
+ * for anyone else a deleted row stays a 404.
72
+ */
73
+ deletedMode: import("@angular/core").WritableSignal<SparkDeletedFilter | null>;
74
+ /** True when the page shows a soft-deleted row: nothing but Restore/Purge applies to it. */
75
+ protected readonly isDeletedView: import("@angular/core").Signal<boolean>;
76
+ /** What every add-on panel and action receives; rebuilt whenever the object or rights change. */
77
+ protected readonly detailContext: import("@angular/core").Signal<SparkDetailContext | null>;
78
+ /**
79
+ * The actions actually offered for the object on screen.
80
+ *
81
+ * The catalogue at `/spark/actions/{objectTypeId}` is per TYPE -- the server is never told which
82
+ * row is open -- so an action that applies to only some rows cannot be filtered there. The
83
+ * entity's actions hook decides while it has the entity in hand and withholds what does not
84
+ * apply, and the object arrives carrying that answer.
85
+ *
86
+ * Since #460 (D13) the server asks the same hook again when the action is submitted and refuses a
87
+ * disabled one with 403, so hiding it here matches what the server will do. What this prevents is
88
+ * offering a destructive action where it cannot possibly apply -- Coverage showed an irreversible
89
+ * red "Delete data" button on every repository page, healthy ones included, and only admitted it
90
+ * would refuse after the confirmation prompt.
91
+ */
92
+ visibleCustomActions: import("@angular/core").Signal<CustomActionDefinition[]>;
93
+ constructor();
94
+ /**
95
+ * Applies patched attribute values in place, without a re-fetch.
96
+ *
97
+ * The operation carries the value the server computed after its own write, so this is both
98
+ * cheaper and more correct than re-reading: a re-read goes through a RavenDB index that may
99
+ * still be stale from the very write that produced the patch, and would show the old value.
100
+ */
101
+ private applyAttributePatches;
102
+ private onParamsChange;
103
+ /** The object as the page's current mode sees it. Only a set mode is sent. */
104
+ private loadItem;
105
+ /** (Re)loads the object, its type, rights and actions. Also what add-ons call via `context.reload()`. */
106
+ load(): Promise<void>;
107
+ visibleAttributes: import("@angular/core").Signal<EntityAttributeDefinition[]>;
108
+ private static readonly DEFAULT_TAB;
109
+ ungroupedAttributes: import("@angular/core").Signal<EntityAttributeDefinition[]>;
110
+ resolvedTabs: import("@angular/core").Signal<AttributeTab[]>;
111
+ groupsForTab(tab: AttributeTab): AttributeGroup[];
112
+ attrsForGroup(group: AttributeGroup): EntityAttributeDefinition[];
113
+ getDetailRendererComponent(attr: EntityAttributeDefinition): Type<any> | null;
114
+ /** Inputs of an AsDetail row renderer (`rowComponent`): the row and the object that owns it. */
115
+ getRowRendererInputs(renderer: SparkResolvedRowRenderer, row: Record<string, any>, item: PersistentObject): Record<string, any>;
116
+ getDetailRendererInputs(component: Type<any>, attr: EntityAttributeDefinition, item: PersistentObject): Record<string, any>;
117
+ /** Column renderer for a cell of an AsDetail sub-table (so embedded rows honor `col.renderer` too). */
118
+ getAsDetailCellRendererComponent(col: EntityAttributeDefinition): Type<any> | null;
119
+ getAsDetailCellRendererInputs(component: Type<any>, row: Record<string, any>, col: EntityAttributeDefinition): Record<string, any>;
120
+ private loadLookupReferenceOptions;
121
+ private loadAsDetailTypes;
122
+ /**
123
+ * The bootstrap classes for a custom action's button. Outline-primary stays the default, so
124
+ * every existing action looks exactly as it did; a server-declared variant opts one action into
125
+ * a louder style. Restricted to a known set rather than interpolated, because the value arrives
126
+ * from a JSON file and must not be able to put arbitrary classes on the button.
127
+ */
128
+ protected customActionClass(action: CustomActionDefinition): string;
129
+ /**
130
+ * The action currently running, or null. Drives the disabled state on every custom-action
131
+ * button.
132
+ *
133
+ * A custom action is not necessarily quick: Coverage's Resync makes paged GitHub App calls for
134
+ * every account the caller manages, inside the request. Without this the button stayed live and
135
+ * looked inert for several seconds, and a second click queued a second full run -- which is how
136
+ * a slow action and a broken one became indistinguishable.
137
+ */
138
+ runningAction: import("@angular/core").WritableSignal<string | null>;
139
+ onCustomAction(action: CustomActionDefinition): Promise<void>;
140
+ onEdit(): void;
141
+ onDelete(): Promise<void>;
142
+ onBack(): void;
143
+ static ɵfac: i0.ɵɵFactoryDeclaration<SparkPoDetailComponent, never>;
144
+ static ɵcmp: i0.ɵɵComponentDeclaration<SparkPoDetailComponent, "spark-po-detail", never, {
145
+ "showCustomActions": {
146
+ "alias": "showCustomActions";
147
+ "required": false;
148
+ "isSignal": true;
149
+ };
150
+ "extraActionsTemplate": {
151
+ "alias": "extraActionsTemplate";
152
+ "required": false;
153
+ "isSignal": true;
154
+ };
155
+ "extraContentTemplate": {
156
+ "alias": "extraContentTemplate";
157
+ "required": false;
158
+ "isSignal": true;
159
+ };
160
+ "queryIconTemplate": {
161
+ "alias": "queryIconTemplate";
162
+ "required": false;
163
+ "isSignal": true;
164
+ };
165
+ "queryCaptionTemplate": {
166
+ "alias": "queryCaptionTemplate";
167
+ "required": false;
168
+ "isSignal": true;
169
+ };
170
+ "queryActionsTemplate": {
171
+ "alias": "queryActionsTemplate";
172
+ "required": false;
173
+ "isSignal": true;
174
+ };
175
+ }, {
176
+ "edited": "edited";
177
+ "deleted": "deleted";
178
+ "customActionExecuted": "customActionExecuted";
179
+ }, never, never, true, never>;
180
+ }