@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
@@ -0,0 +1,216 @@
1
+ import { EntityAttributeDefinition, EntityPermissions, EntityType, PersistentObject, PersistentObjectAttribute, QueryColumn, SparkDeletedFilter, comparableValue } 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
+ /** The shown attributes whose content differs between `revision` and `current`, in display order. */
64
+ export declare function diffRevision(entityType: EntityType | null | undefined, revision: PersistentObject | null | undefined, current: PersistentObject | null | undefined): SparkRevisionChange[];
65
+ type HistoryView = 'view' | 'diff';
66
+ /** One attribute of one object, ready for `<spark-grid-cell>`. */
67
+ interface HistoryCell {
68
+ column: QueryColumn;
69
+ display: unknown;
70
+ rendererValue: unknown;
71
+ chips: ReferenceChip[];
72
+ }
73
+ /**
74
+ * A row's revision history (#460, History package): the revision list, a read-only view of one
75
+ * revision, its field diff against the current object, and Revert.
76
+ *
77
+ * Standalone — bind it anywhere — and also what the History detail panel
78
+ * (`provideSparkHistory()`) renders on every routed detail page.
79
+ *
80
+ * Rights come from `permissions`: nothing is listed without `canViewHistory`, and Revert is offered
81
+ * only with `canRevert` (the server's `Revert/T` together with `Edit/T`), never for the current
82
+ * revision, a delete revision, or a row opened from the recycle bin (Revert saves through the live
83
+ * pipeline, which does not see a deleted row). The server enforces all of it again.
84
+ */
85
+ export declare class SparkPoHistoryComponent {
86
+ private readonly history;
87
+ protected readonly lang: SparkLanguageService;
88
+ /** Entity type id or alias, as the endpoints take it. */
89
+ type: import("@angular/core").InputSignal<string>;
90
+ id: import("@angular/core").InputSignal<string>;
91
+ entityType: import("@angular/core").InputSignal<EntityType>;
92
+ /** The object as it is now — the right-hand side of every diff. */
93
+ current: import("@angular/core").InputSignal<PersistentObject | null>;
94
+ permissions: import("@angular/core").InputSignal<EntityPermissions | null>;
95
+ /** The mode the row was opened with (`only` = from the recycle bin). */
96
+ deleted: import("@angular/core").InputSignal<SparkDeletedFilter | null>;
97
+ /** Rows per request (server default 50, at most 200). */
98
+ pageSize: import("@angular/core").InputSignal<number>;
99
+ /** Emitted with the saved object after a successful Revert. */
100
+ reverted: import("@angular/core").OutputEmitterRef<PersistentObject>;
101
+ protected readonly colors: typeof Color;
102
+ protected readonly revisions: import("@angular/core").WritableSignal<SparkRevision[]>;
103
+ protected readonly loading: import("@angular/core").WritableSignal<boolean>;
104
+ protected readonly hasMore: import("@angular/core").WritableSignal<boolean>;
105
+ protected readonly error: import("@angular/core").WritableSignal<string | null>;
106
+ protected readonly selected: import("@angular/core").WritableSignal<SparkRevision | null>;
107
+ protected readonly selectedObject: import("@angular/core").WritableSignal<PersistentObject | null>;
108
+ protected readonly selectedLoading: import("@angular/core").WritableSignal<boolean>;
109
+ protected readonly view: import("@angular/core").WritableSignal<HistoryView>;
110
+ protected readonly reverting: import("@angular/core").WritableSignal<boolean>;
111
+ protected readonly canView: import("@angular/core").Signal<boolean>;
112
+ protected readonly attributes: import("@angular/core").Signal<EntityAttributeDefinition[]>;
113
+ protected readonly changes: import("@angular/core").Signal<import("@mintplayer/ng-spark/history").SparkRevisionChange[]>;
114
+ private readonly gridRenderers;
115
+ /** Lookup-reference labels for the shown attributes, so a lookup value reads as its label. */
116
+ private readonly lookupOptions;
117
+ /**
118
+ * The read-only view: every shown attribute of the selected revision, rendered by the same
119
+ * `<spark-grid-cell>` (and custom renderers) as a query grid — a reference as its label, a date in
120
+ * the viewer's culture and zone, a boolean as a checkbox — instead of the raw wire value.
121
+ */
122
+ protected readonly viewCells: import("@angular/core").Signal<{
123
+ attribute: EntityAttributeDefinition;
124
+ cell: HistoryCell;
125
+ }[]>;
126
+ /** The diff rows, both sides rendered like {@link viewCells}. */
127
+ protected readonly changeCells: import("@angular/core").Signal<{
128
+ change: import("@mintplayer/ng-spark/history").SparkRevisionChange;
129
+ old: HistoryCell;
130
+ now: HistoryCell;
131
+ }[]>;
132
+ protected readonly canRevertSelected: import("@angular/core").Signal<boolean>;
133
+ constructor();
134
+ /** Reloads the list from the top, dropping the selection. */
135
+ refresh(): Promise<void>;
136
+ loadMore(): Promise<void>;
137
+ private loadPage;
138
+ select(revision: SparkRevision): Promise<void>;
139
+ clearSelection(): void;
140
+ revert(): Promise<void>;
141
+ /**
142
+ * One attribute of `po` for `<spark-grid-cell>`. A persistent object is a row the grid pipes read
143
+ * (`valueFor` understands both shapes), so the value resolution is the grid's, not a copy of it.
144
+ */
145
+ private cell;
146
+ protected who(revision: SparkRevision): string;
147
+ private describe;
148
+ static ɵfac: i0.ɵɵFactoryDeclaration<SparkPoHistoryComponent, never>;
149
+ static ɵcmp: i0.ɵɵComponentDeclaration<SparkPoHistoryComponent, "spark-po-history", never, {
150
+ "type": {
151
+ "alias": "type";
152
+ "required": true;
153
+ "isSignal": true;
154
+ };
155
+ "id": {
156
+ "alias": "id";
157
+ "required": true;
158
+ "isSignal": true;
159
+ };
160
+ "entityType": {
161
+ "alias": "entityType";
162
+ "required": true;
163
+ "isSignal": true;
164
+ };
165
+ "current": {
166
+ "alias": "current";
167
+ "required": false;
168
+ "isSignal": true;
169
+ };
170
+ "permissions": {
171
+ "alias": "permissions";
172
+ "required": false;
173
+ "isSignal": true;
174
+ };
175
+ "deleted": {
176
+ "alias": "deleted";
177
+ "required": false;
178
+ "isSignal": true;
179
+ };
180
+ "pageSize": {
181
+ "alias": "pageSize";
182
+ "required": false;
183
+ "isSignal": true;
184
+ };
185
+ }, {
186
+ "reverted": "reverted";
187
+ }, never, never, true, never>;
188
+ }
189
+ /**
190
+ * The History card on the routed detail page (#460). Registered by {@link provideSparkHistory} as a
191
+ * `SPARK_DETAIL_PANELS` entry; renders nothing for a caller without `History/T`.
192
+ * After a Revert it asks the page to reload, so the attributes above show the reverted values.
193
+ */
194
+ export declare class SparkHistoryPanelComponent {
195
+ context: import("@angular/core").InputSignal<SparkDetailContext>;
196
+ protected readonly visible: import("@angular/core").Signal<boolean>;
197
+ static ɵfac: i0.ɵɵFactoryDeclaration<SparkHistoryPanelComponent, never>;
198
+ static ɵcmp: i0.ɵɵComponentDeclaration<SparkHistoryPanelComponent, "spark-history-panel", never, {
199
+ "context": {
200
+ "alias": "context";
201
+ "required": true;
202
+ "isSignal": true;
203
+ };
204
+ }, {}, never, never, true, never>;
205
+ }
206
+ /**
207
+ * Adds a History card (`<spark-po-history>`: revision list, read-only view, diff, Revert) to every
208
+ * detail page `sparkRoutes()` routes to, for holders of `History/T` (#460). Needs the server package
209
+ * `MintPlayer.Spark.History` and revisions enabled for the type in its model.
210
+ *
211
+ * `providers: [provideSpark(...), provideSparkHistory()]`
212
+ */
213
+ export declare function provideSparkHistory(options?: {
214
+ order?: number;
215
+ }): Provider[];
216
+ export { comparableValue };
@@ -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
+ }