@mintplayer/ng-spark 22.22.0 → 22.24.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 (68) hide show
  1. package/README.md +181 -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 +308 -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-grid.mjs +2259 -1117
  9. package/fesm2022/mintplayer-ng-spark-grid.mjs.map +1 -1
  10. package/fesm2022/mintplayer-ng-spark-history.mjs +611 -0
  11. package/fesm2022/mintplayer-ng-spark-history.mjs.map +1 -0
  12. package/fesm2022/mintplayer-ng-spark-icon.mjs +64 -27
  13. package/fesm2022/mintplayer-ng-spark-icon.mjs.map +1 -1
  14. package/fesm2022/mintplayer-ng-spark-models.mjs +365 -753
  15. package/fesm2022/mintplayer-ng-spark-models.mjs.map +1 -1
  16. package/fesm2022/mintplayer-ng-spark-moderation.mjs +1212 -0
  17. package/fesm2022/mintplayer-ng-spark-moderation.mjs.map +1 -0
  18. package/fesm2022/mintplayer-ng-spark-panels.mjs +52 -0
  19. package/fesm2022/mintplayer-ng-spark-panels.mjs.map +1 -0
  20. package/fesm2022/mintplayer-ng-spark-pipes.mjs +1122 -765
  21. package/fesm2022/mintplayer-ng-spark-pipes.mjs.map +1 -1
  22. package/fesm2022/mintplayer-ng-spark-po-create.mjs +273 -169
  23. package/fesm2022/mintplayer-ng-spark-po-create.mjs.map +1 -1
  24. package/fesm2022/mintplayer-ng-spark-po-detail.mjs +786 -410
  25. package/fesm2022/mintplayer-ng-spark-po-detail.mjs.map +1 -1
  26. package/fesm2022/mintplayer-ng-spark-po-edit.mjs +292 -284
  27. package/fesm2022/mintplayer-ng-spark-po-edit.mjs.map +1 -1
  28. package/fesm2022/mintplayer-ng-spark-po-form.mjs +2187 -1225
  29. package/fesm2022/mintplayer-ng-spark-po-form.mjs.map +1 -1
  30. package/fesm2022/mintplayer-ng-spark-query-list.mjs +516 -303
  31. package/fesm2022/mintplayer-ng-spark-query-list.mjs.map +1 -1
  32. package/fesm2022/mintplayer-ng-spark-renderers.mjs +17 -55
  33. package/fesm2022/mintplayer-ng-spark-renderers.mjs.map +1 -1
  34. package/fesm2022/mintplayer-ng-spark-retry-action-modal.mjs +216 -177
  35. package/fesm2022/mintplayer-ng-spark-retry-action-modal.mjs.map +1 -1
  36. package/fesm2022/mintplayer-ng-spark-routes.mjs +24 -28
  37. package/fesm2022/mintplayer-ng-spark-routes.mjs.map +1 -1
  38. package/fesm2022/mintplayer-ng-spark-services.mjs +625 -640
  39. package/fesm2022/mintplayer-ng-spark-services.mjs.map +1 -1
  40. package/fesm2022/mintplayer-ng-spark-shell.mjs +1013 -397
  41. package/fesm2022/mintplayer-ng-spark-shell.mjs.map +1 -1
  42. package/fesm2022/mintplayer-ng-spark-soft-delete.mjs +294 -0
  43. package/fesm2022/mintplayer-ng-spark-soft-delete.mjs.map +1 -0
  44. package/fesm2022/mintplayer-ng-spark.mjs +13 -50
  45. package/fesm2022/mintplayer-ng-spark.mjs.map +1 -1
  46. package/package.json +17 -1
  47. package/types/mintplayer-ng-spark-attribute-description.d.ts +25 -18
  48. package/types/mintplayer-ng-spark-client-operations.d.ts +133 -160
  49. package/types/mintplayer-ng-spark-column-filter.d.ts +73 -55
  50. package/types/mintplayer-ng-spark-grid.d.ts +885 -448
  51. package/types/mintplayer-ng-spark-history.d.ts +223 -0
  52. package/types/mintplayer-ng-spark-icon.d.ts +15 -13
  53. package/types/mintplayer-ng-spark-models.d.ts +624 -573
  54. package/types/mintplayer-ng-spark-moderation.d.ts +402 -0
  55. package/types/mintplayer-ng-spark-panels.d.ts +108 -0
  56. package/types/mintplayer-ng-spark-pipes.d.ts +120 -149
  57. package/types/mintplayer-ng-spark-po-create.d.ts +46 -37
  58. package/types/mintplayer-ng-spark-po-detail.d.ts +177 -117
  59. package/types/mintplayer-ng-spark-po-edit.d.ts +64 -65
  60. package/types/mintplayer-ng-spark-po-form.d.ts +507 -371
  61. package/types/mintplayer-ng-spark-query-list.d.ts +118 -82
  62. package/types/mintplayer-ng-spark-renderers.d.ts +79 -85
  63. package/types/mintplayer-ng-spark-retry-action-modal.d.ts +31 -34
  64. package/types/mintplayer-ng-spark-routes.d.ts +7 -11
  65. package/types/mintplayer-ng-spark-services.d.ts +377 -261
  66. package/types/mintplayer-ng-spark-shell.d.ts +209 -128
  67. package/types/mintplayer-ng-spark-soft-delete.d.ts +90 -0
  68. package/types/mintplayer-ng-spark.d.ts +7 -12
@@ -0,0 +1,223 @@
1
+ import { EntityAttributeDefinition, EntityPermissions, EntityType, PersistentObject, PersistentObjectAttribute, QueryColumn, SparkDeletedFilter } from "@mintplayer/ng-spark/models";
2
+ import * as i0 from "@angular/core";
3
+ import { Provider } from "@angular/core";
4
+ import { Color } from "@mintplayer/ng-bootstrap";
5
+ import { ReferenceChip } from "@mintplayer/ng-spark/pipes";
6
+ import { SparkLanguageService } from "@mintplayer/ng-spark/services";
7
+ import { SparkDetailContext } from "@mintplayer/ng-spark/panels";
8
+ /** One revision of a row, newest first (`MintPlayer.Spark.History.SparkRevision`). */
9
+ export interface SparkRevision {
10
+ changeVector: string;
11
+ /** When the revision was written (ISO 8601 with offset); null when the server does not know. */
12
+ lastModified?: string | null;
13
+ /** Who wrote it — an id (D8: audit fields hold ids only). */
14
+ userId?: string | null;
15
+ /** The id resolved to a name at read time, when the app registered an `IHistoryUserNameResolver`. */
16
+ userName?: string | null;
17
+ /** The revision RavenDB writes when the document is deleted (a purge-free hard delete). */
18
+ isDeleteRevision?: boolean;
19
+ /** The revision the document currently is. Reverting to it changes nothing. */
20
+ isCurrent?: boolean;
21
+ }
22
+ export interface SparkRevisionListOptions {
23
+ skip?: number;
24
+ /** Server default 50, at most 200. */
25
+ take?: number;
26
+ /** `include` / `only` to read the history of a soft-deleted row (`ViewDeleted` holders only). */
27
+ deleted?: SparkDeletedFilter | null;
28
+ }
29
+ /**
30
+ * Client for the History package's endpoints (`MintPlayer.Spark.History`, #460 T1). Every read is
31
+ * gated on the CURRENT row (a row the caller can no longer see has no readable history) and on
32
+ * `History/T`; old revisions come back redacted like the live object.
33
+ */
34
+ export declare class SparkHistoryService {
35
+ private readonly spark;
36
+ /** `POST /spark/po/revisions` → the row's revisions, newest first. */
37
+ list(type: string, id: string, options?: SparkRevisionListOptions): Promise<SparkRevision[]>;
38
+ /** `POST /spark/po/revision` → the revision as a read-only, redacted persistent object. */
39
+ get(type: string, id: string, changeVector: string, options?: {
40
+ deleted?: SparkDeletedFilter | null;
41
+ }): Promise<PersistentObject>;
42
+ /**
43
+ * `POST /spark/po/revert` → the reverted row. Requires `History/T`, `Revert/T` and `Edit/T`; saved
44
+ * through the normal pipeline. 403 = the revert is disabled for this row, 409 = the row changed
45
+ * since it was loaded, 400 = an interceptor refused (e.g. the row is locked).
46
+ */
47
+ revert(type: string, id: string, changeVector: string): Promise<PersistentObject>;
48
+ static ɵfac: i0.ɵɵFactoryDeclaration<SparkHistoryService, never>;
49
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
50
+ }
51
+ /** One attribute that differs between a revision and the current object. */
52
+ export interface SparkRevisionChange {
53
+ attribute: EntityAttributeDefinition;
54
+ /** Absent when the attribute did not exist on that side (added or removed since). */
55
+ revision: PersistentObjectAttribute | undefined;
56
+ current: PersistentObjectAttribute | undefined;
57
+ }
58
+ /**
59
+ * The attributes a revision is compared on: the ones the detail page shows, in its order. Redacted
60
+ * attributes are simply absent from what the server sends, so they never appear as a difference.
61
+ */
62
+ export declare function revisionAttributes(entityType: EntityType | null | undefined): EntityAttributeDefinition[];
63
+ /**
64
+ * A comparable form of an attribute's content.
65
+ *
66
+ * Nested objects (AsDetail rows, references rendered as objects) are reduced to their attributes'
67
+ * values: their envelopes carry per-read fields (etags, breadcrumbs, row keys) that differ between two
68
+ * reads of identical content and would report every AsDetail attribute as changed.
69
+ */
70
+ export declare function comparableValue(attribute: PersistentObjectAttribute | undefined): string;
71
+ /** The shown attributes whose content differs between `revision` and `current`, in display order. */
72
+ export declare function diffRevision(entityType: EntityType | null | undefined, revision: PersistentObject | null | undefined, current: PersistentObject | null | undefined): SparkRevisionChange[];
73
+ type HistoryView = 'view' | 'diff';
74
+ /** One attribute of one object, ready for `<spark-grid-cell>`. */
75
+ interface HistoryCell {
76
+ column: QueryColumn;
77
+ display: unknown;
78
+ rendererValue: unknown;
79
+ chips: ReferenceChip[];
80
+ }
81
+ /**
82
+ * A row's revision history (#460, History package): the revision list, a read-only view of one
83
+ * revision, its field diff against the current object, and Revert.
84
+ *
85
+ * Standalone — bind it anywhere — and also what the History detail panel
86
+ * (`provideSparkHistory()`) renders on every routed detail page.
87
+ *
88
+ * Rights come from `permissions`: nothing is listed without `canViewHistory`, and Revert is offered
89
+ * only with `canRevert` (the server's `Revert/T` together with `Edit/T`), never for the current
90
+ * revision, a delete revision, or a row opened from the recycle bin (Revert saves through the live
91
+ * pipeline, which does not see a deleted row). The server enforces all of it again.
92
+ */
93
+ export declare class SparkPoHistoryComponent {
94
+ private readonly history;
95
+ protected readonly lang: SparkLanguageService;
96
+ /** Entity type id or alias, as the endpoints take it. */
97
+ type: import("@angular/core").InputSignal<string>;
98
+ id: import("@angular/core").InputSignal<string>;
99
+ entityType: import("@angular/core").InputSignal<EntityType>;
100
+ /** The object as it is now — the right-hand side of every diff. */
101
+ current: import("@angular/core").InputSignal<PersistentObject | null>;
102
+ permissions: import("@angular/core").InputSignal<EntityPermissions | null>;
103
+ /** The mode the row was opened with (`only` = from the recycle bin). */
104
+ deleted: import("@angular/core").InputSignal<SparkDeletedFilter | null>;
105
+ /** Rows per request (server default 50, at most 200). */
106
+ pageSize: import("@angular/core").InputSignal<number>;
107
+ /** Emitted with the saved object after a successful Revert. */
108
+ reverted: import("@angular/core").OutputEmitterRef<PersistentObject>;
109
+ protected readonly colors: typeof Color;
110
+ protected readonly revisions: import("@angular/core").WritableSignal<SparkRevision[]>;
111
+ protected readonly loading: import("@angular/core").WritableSignal<boolean>;
112
+ protected readonly hasMore: import("@angular/core").WritableSignal<boolean>;
113
+ protected readonly error: import("@angular/core").WritableSignal<string | null>;
114
+ protected readonly selected: import("@angular/core").WritableSignal<SparkRevision | null>;
115
+ protected readonly selectedObject: import("@angular/core").WritableSignal<PersistentObject | null>;
116
+ protected readonly selectedLoading: import("@angular/core").WritableSignal<boolean>;
117
+ protected readonly view: import("@angular/core").WritableSignal<HistoryView>;
118
+ protected readonly reverting: import("@angular/core").WritableSignal<boolean>;
119
+ protected readonly canView: import("@angular/core").Signal<boolean>;
120
+ protected readonly attributes: import("@angular/core").Signal<EntityAttributeDefinition[]>;
121
+ protected readonly changes: import("@angular/core").Signal<import("@mintplayer/ng-spark/history").SparkRevisionChange[]>;
122
+ private readonly gridRenderers;
123
+ /** Lookup-reference labels for the shown attributes, so a lookup value reads as its label. */
124
+ private readonly lookupOptions;
125
+ /**
126
+ * The read-only view: every shown attribute of the selected revision, rendered by the same
127
+ * `<spark-grid-cell>` (and custom renderers) as a query grid — a reference as its label, a date in
128
+ * the viewer's culture and zone, a boolean as a checkbox — instead of the raw wire value.
129
+ */
130
+ protected readonly viewCells: import("@angular/core").Signal<{
131
+ attribute: EntityAttributeDefinition;
132
+ cell: HistoryCell;
133
+ }[]>;
134
+ /** The diff rows, both sides rendered like {@link viewCells}. */
135
+ protected readonly changeCells: import("@angular/core").Signal<{
136
+ change: import("@mintplayer/ng-spark/history").SparkRevisionChange;
137
+ old: HistoryCell;
138
+ now: HistoryCell;
139
+ }[]>;
140
+ protected readonly canRevertSelected: import("@angular/core").Signal<boolean>;
141
+ constructor();
142
+ /** Reloads the list from the top, dropping the selection. */
143
+ refresh(): Promise<void>;
144
+ loadMore(): Promise<void>;
145
+ private loadPage;
146
+ select(revision: SparkRevision): Promise<void>;
147
+ clearSelection(): void;
148
+ revert(): Promise<void>;
149
+ /**
150
+ * One attribute of `po` for `<spark-grid-cell>`. A persistent object is a row the grid pipes read
151
+ * (`valueFor` understands both shapes), so the value resolution is the grid's, not a copy of it.
152
+ */
153
+ private cell;
154
+ protected who(revision: SparkRevision): string;
155
+ private describe;
156
+ static ɵfac: i0.ɵɵFactoryDeclaration<SparkPoHistoryComponent, never>;
157
+ static ɵcmp: i0.ɵɵComponentDeclaration<SparkPoHistoryComponent, "spark-po-history", never, {
158
+ "type": {
159
+ "alias": "type";
160
+ "required": true;
161
+ "isSignal": true;
162
+ };
163
+ "id": {
164
+ "alias": "id";
165
+ "required": true;
166
+ "isSignal": true;
167
+ };
168
+ "entityType": {
169
+ "alias": "entityType";
170
+ "required": true;
171
+ "isSignal": true;
172
+ };
173
+ "current": {
174
+ "alias": "current";
175
+ "required": false;
176
+ "isSignal": true;
177
+ };
178
+ "permissions": {
179
+ "alias": "permissions";
180
+ "required": false;
181
+ "isSignal": true;
182
+ };
183
+ "deleted": {
184
+ "alias": "deleted";
185
+ "required": false;
186
+ "isSignal": true;
187
+ };
188
+ "pageSize": {
189
+ "alias": "pageSize";
190
+ "required": false;
191
+ "isSignal": true;
192
+ };
193
+ }, {
194
+ "reverted": "reverted";
195
+ }, never, never, true, never>;
196
+ }
197
+ /**
198
+ * The History card on the routed detail page (#460). Registered by {@link provideSparkHistory} as a
199
+ * `SPARK_DETAIL_PANELS` entry; renders nothing for a caller without `History/T`.
200
+ * After a Revert it asks the page to reload, so the attributes above show the reverted values.
201
+ */
202
+ export declare class SparkHistoryPanelComponent {
203
+ context: import("@angular/core").InputSignal<SparkDetailContext>;
204
+ protected readonly visible: import("@angular/core").Signal<boolean>;
205
+ static ɵfac: i0.ɵɵFactoryDeclaration<SparkHistoryPanelComponent, never>;
206
+ static ɵcmp: i0.ɵɵComponentDeclaration<SparkHistoryPanelComponent, "spark-history-panel", never, {
207
+ "context": {
208
+ "alias": "context";
209
+ "required": true;
210
+ "isSignal": true;
211
+ };
212
+ }, {}, never, never, true, never>;
213
+ }
214
+ /**
215
+ * Adds a History card (`<spark-po-history>`: revision list, read-only view, diff, Revert) to every
216
+ * detail page `sparkRoutes()` routes to, for holders of `History/T` (#460). Needs the server package
217
+ * `MintPlayer.Spark.History` and revisions enabled for the type in its model.
218
+ *
219
+ * `providers: [provideSpark(...), provideSparkHistory()]`
220
+ */
221
+ export declare function provideSparkHistory(options?: {
222
+ order?: number;
223
+ }): Provider[];
@@ -1,13 +1,15 @@
1
- import * as _angular_platform_browser from '@angular/platform-browser';
2
- import * as _angular_core from '@angular/core';
3
-
4
- declare class SparkIconComponent {
5
- private registry;
6
- name: _angular_core.InputSignal<string>;
7
- iconHtml: _angular_core.Signal<_angular_platform_browser.SafeHtml | undefined>;
8
- cssFallbackClass: _angular_core.Signal<string>;
9
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<SparkIconComponent, never>;
10
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<SparkIconComponent, "spark-icon", never, { "name": { "alias": "name"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
11
- }
12
-
13
- export { SparkIconComponent };
1
+ import * as i0 from "@angular/core";
2
+ export declare class SparkIconComponent {
3
+ private registry;
4
+ name: import("@angular/core").InputSignal<string>;
5
+ iconHtml: import("@angular/core").Signal<import("@angular/platform-browser").SafeHtml | undefined>;
6
+ cssFallbackClass: import("@angular/core").Signal<string>;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<SparkIconComponent, never>;
8
+ static ɵcmp: i0.ɵɵComponentDeclaration<SparkIconComponent, "spark-icon", never, {
9
+ "name": {
10
+ "alias": "name";
11
+ "required": true;
12
+ "isSignal": true;
13
+ };
14
+ }, {}, never, never, true, never>;
15
+ }