wt-front-shared 19.1.0 → 19.2.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 (41) hide show
  1. package/entities/README.md +46 -0
  2. package/entities/index.d.ts +5 -0
  3. package/entities/lib/guards/entity-sections.guard.d.ts +11 -0
  4. package/entities/lib/guards/route-wait.service.d.ts +10 -0
  5. package/entities/lib/services/entities-adapter.service.d.ts +72 -0
  6. package/entities/lib/services/entities-api.service.d.ts +13 -0
  7. package/entities/lib/services/entities-events.service.d.ts +9 -0
  8. package/entities/lib/services/entities-sections.service.d.ts +42 -0
  9. package/entities/lib/settings/code-editor.component.d.ts +24 -0
  10. package/entities/lib/settings/code-lint.util.d.ts +11 -0
  11. package/entities/lib/settings/entities-settings.component.d.ts +27 -0
  12. package/entities/lib/settings/entities-settings.facade.d.ts +23 -0
  13. package/entities/lib/settings/entities-settings.models.d.ts +99 -0
  14. package/entities/lib/settings/entities-settings.util.d.ts +122 -0
  15. package/entities/lib/settings/entity-form.component.d.ts +256 -0
  16. package/entities/lib/settings/entity-plan-dialog.component.d.ts +15 -0
  17. package/entities/lib/state/entities.actions.d.ts +35 -0
  18. package/entities/lib/state/entities.effects.d.ts +34 -0
  19. package/entities/lib/state/entities.facade.d.ts +17 -0
  20. package/entities/lib/state/entities.models.d.ts +157 -0
  21. package/entities/lib/state/entities.reducer.d.ts +13 -0
  22. package/entities/lib/state/entities.selectors.d.ts +15 -0
  23. package/entities/lib/tokens.d.ts +8 -0
  24. package/entities/lib/ui/confirm-dialog.component.d.ts +13 -0
  25. package/entities/lib/ui/empty-state.component.d.ts +8 -0
  26. package/entities/lib/ui/index.d.ts +5 -0
  27. package/entities/lib/ui/inline-alert.component.d.ts +11 -0
  28. package/entities/lib/ui/page-header.component.d.ts +8 -0
  29. package/entities/lib/ui/status-chip.component.d.ts +8 -0
  30. package/entities/public-api.d.ts +19 -0
  31. package/fesm2022/wt-front-shared-auto-form.mjs +83 -83
  32. package/fesm2022/wt-front-shared-auto-form.mjs.map +1 -1
  33. package/fesm2022/wt-front-shared-entities.mjs +2850 -0
  34. package/fesm2022/wt-front-shared-entities.mjs.map +1 -0
  35. package/fesm2022/wt-front-shared-panel-ui.mjs +119 -119
  36. package/fesm2022/wt-front-shared-panel-ui.mjs.map +1 -1
  37. package/fesm2022/wt-front-shared-static-data.mjs +86 -86
  38. package/fesm2022/wt-front-shared-static-data.mjs.map +1 -1
  39. package/fesm2022/wt-front-shared.mjs +284 -284
  40. package/fesm2022/wt-front-shared.mjs.map +1 -1
  41. package/package.json +32 -6
@@ -0,0 +1,256 @@
1
+ import { OnDestroy, OnInit } from '@angular/core';
2
+ import { CdkDragDrop } from '@angular/cdk/drag-drop';
3
+ import { CodeDiagnostic, CodeLang, DraftField, EntityDraft, SchemaLogItem, SettingsEntity, SnippetKind, SnippetRef, EntityGroup } from './entities-settings.models';
4
+ import { defaultToText, diagnosticText, showIfValueText, snippetLabel, HookMeta, snippetSignature, tableNamePreview } from './entities-settings.util';
5
+ import * as i0 from "@angular/core";
6
+ export type EntityFormState = 'loading' | 'ready' | 'error' | 'forbidden' | 'notfound';
7
+ /** UI-only pseudo type: the field is computed on read from its code (stored in code.calculated[key]). */
8
+ export declare const CALCULATED_TYPE = "calculated";
9
+ export type FormTab = 'settings' | 'fields' | 'events';
10
+ export type SettingsTab = 'general' | 'view' | 'list' | 'boards' | 'buttons' | 'preload';
11
+ export declare class EntityFormComponent implements OnInit, OnDestroy {
12
+ private readonly facade;
13
+ private readonly route;
14
+ private readonly router;
15
+ private readonly dialog;
16
+ private readonly toast;
17
+ private readonly events;
18
+ private readonly cdr;
19
+ readonly fieldTypes: {
20
+ value: import("./entities-settings.models").EntityFieldType;
21
+ label: string;
22
+ }[];
23
+ readonly calcType = "calculated";
24
+ readonly showIfOps: {
25
+ value: string;
26
+ label: string;
27
+ }[];
28
+ readonly maxFields = 100;
29
+ readonly maxGroups = 20;
30
+ readonly tableName: typeof tableNamePreview;
31
+ readonly snippetId: (s: SnippetRef) => string;
32
+ readonly snippetLabel: typeof snippetLabel;
33
+ readonly snippetSignature: typeof snippetSignature;
34
+ readonly isRel: (type: string | undefined) => boolean;
35
+ readonly diagText: typeof diagnosticText;
36
+ readonly defaultText: typeof defaultToText;
37
+ readonly showIfText: typeof showIfValueText;
38
+ readonly activationHint = "\u041E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u0435 \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u043E, \u043D\u043E \u0441\u0443\u0449\u043D\u043E\u0441\u0442\u044C \u043F\u043E\u043A\u0430 \u043D\u0435 \u0430\u043A\u0442\u0438\u0432\u043D\u0430 \u043D\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 (\u0433\u0435\u043D\u0435\u0440\u0430\u0446\u0438\u044F \u0438\u043B\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u043C\u043E\u0434\u0435\u043B\u0438 \u043D\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043B\u0438\u0441\u044C). \u041D\u0430\u0436\u043C\u0438\u0442\u0435 \u00AB\u041F\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0434\u0430\u043D\u043D\u044B\u0435\u00BB \u0438\u043B\u0438 \u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435 \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u0435; \u0441\u0435\u0440\u0432\u0435\u0440 \u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442 \u0430\u043A\u0442\u0438\u0432\u0430\u0446\u0438\u044E \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438, \u043E\u0448\u0438\u0431\u043A\u0430 \u0437\u0430\u043F\u0438\u0441\u0430\u043D\u0430 \u0432 \u0436\u0443\u0440\u043D\u0430\u043B\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430.";
39
+ state: EntityFormState;
40
+ isNew: boolean;
41
+ private loadedKey;
42
+ readOnly: boolean;
43
+ draft: EntityDraft;
44
+ entity: SettingsEntity | null;
45
+ targets: SettingsEntity[];
46
+ expanded: Set<string>;
47
+ /** Top tabs of the form (all panels stay in the DOM, so form state and validation survive a tab switch). */
48
+ readonly tabs: {
49
+ id: FormTab;
50
+ title: string;
51
+ icon: string;
52
+ }[];
53
+ tab: FormTab;
54
+ clientErrors: Record<string, string>;
55
+ serverErrors: Record<string, string>;
56
+ diagnostics: Record<string, CodeDiagnostic[]>;
57
+ globalDiagnostics: CodeDiagnostic[];
58
+ pendingChecks: Set<string>;
59
+ newSnippet: {
60
+ kind: SnippetKind;
61
+ name: string;
62
+ };
63
+ /** last non-empty key of a field whose key input was cleared (so retyping a key keeps its code) */
64
+ private keyMemo;
65
+ saving: boolean;
66
+ saveError: string;
67
+ conflict: boolean;
68
+ remoteChanged: boolean;
69
+ /** save succeeded but the server could not activate the entity (response `activation.status==='failed'`) */
70
+ activationFailed: boolean;
71
+ schemaLog: SchemaLogItem[];
72
+ schemaLogState: 'idle' | 'loading' | 'ready' | 'error';
73
+ schemaLogTotal: number;
74
+ private timers;
75
+ private sub;
76
+ ngOnInit(): void;
77
+ ngOnDestroy(): void;
78
+ get key(): string;
79
+ load(): void;
80
+ back(): void;
81
+ secVal(path: string): any;
82
+ /** Writes `draft.options.<path>`; an empty value removes the key. */
83
+ setSec(path: string, value: any): void;
84
+ setSecNumber(path: string, raw: any): void;
85
+ /** Tri-state: boards/presets are ON unless explicitly switched off. */
86
+ secOn(path: string): boolean;
87
+ get filteringFields(): {
88
+ field: string;
89
+ title?: string;
90
+ type?: any;
91
+ }[];
92
+ addFilteringField(): void;
93
+ removeFilteringField(i: number): void;
94
+ get preloadList(): string[];
95
+ /** `<slug>(paging:{perPage:-1})` for a relation target (code targets use their static-data slug, UI targets their key). */
96
+ private preloadEntry;
97
+ private preloadName;
98
+ /** Adds the section of a relation target unless the list already preloads it (the user may have tuned or removed other entries). */
99
+ private ensurePreload;
100
+ addPreloadFromRelations(): void;
101
+ addPreload(): void;
102
+ setPreload(i: number, value: string): void;
103
+ removePreload(i: number): void;
104
+ /** Fields offered for kanban / ordering / filtering. */
105
+ get sectionFieldKeys(): {
106
+ key: string;
107
+ title: string;
108
+ }[];
109
+ addGroup(): void;
110
+ /** Group key edit: fields that belong to the group follow the new key. */
111
+ onGroupKeyChange(g: EntityGroup, next: string): void;
112
+ fieldsInGroup(key: string): number;
113
+ /** New field that belongs to the group; its details are opened (group is optional and can be changed there). */
114
+ addFieldToGroup(groupKey: string): void;
115
+ /** Deleting a group deletes its fields (and their data on save) — always behind a confirmation. */
116
+ removeGroup(i: number): void;
117
+ removeGroupByKey(key: string): void;
118
+ moveGroup(i: number, delta: number): void;
119
+ addField(): void;
120
+ removeField(i: number): void;
121
+ private removeFieldRef;
122
+ /** Blocks of the fields list: one per group, then the ungrouped fields (no headers while there are no groups). */
123
+ get fieldBlocks(): {
124
+ key: string;
125
+ title: string;
126
+ header: boolean;
127
+ }[];
128
+ /** Fields of a group; key '' = fields without a (known) group. */
129
+ fieldsOf(key: string): DraftField[];
130
+ private siblings;
131
+ isFirstInBlock(f: DraftField): boolean;
132
+ isLastInBlock(f: DraftField): boolean;
133
+ /** Up/down moves the field among the fields of its own group. */
134
+ moveField(i: number, delta: number): void;
135
+ /** Drag and drop between the group blocks: the target block's key becomes the field's group. */
136
+ dropField(ev: CdkDragDrop<string>): void;
137
+ toggleExpand(f: DraftField): void;
138
+ isCalculated(f: DraftField): boolean;
139
+ hasValidator(f: DraftField): boolean;
140
+ /** Value of the type select: calculated fields show the pseudo type. */
141
+ typeValue(f: DraftField): string;
142
+ onTypeSelect(f: DraftField, value: string): void;
143
+ toggleValidator(f: DraftField, on: boolean): void;
144
+ private setFieldCode;
145
+ /** Key edit: calculated/validator code is stored under the field key, so it moves with a rename. */
146
+ onKeyChange(f: DraftField, next: string): void;
147
+ fieldSnippets(f: DraftField): SnippetRef[];
148
+ onTypeChange(f: DraftField): void;
149
+ /** Form width in grid columns (1..12); empty clears it. */
150
+ setCol(f: DraftField, raw: any): void;
151
+ /** Responsive widths (colSm … colXxl) share the 1..12 handling of `col`. */
152
+ readonly widthKeys: {
153
+ key: 'colSm' | 'colMd' | 'colLg' | 'colXl' | 'colXxl';
154
+ label: string;
155
+ }[];
156
+ setWidth(f: DraftField, key: string, raw: any): void;
157
+ private subTabs;
158
+ private readonly allSubTabs;
159
+ /** Tabs with content for this field (calculated fields have no stored column; some types have no validators). */
160
+ fieldTabs(f: DraftField): {
161
+ id: string;
162
+ title: string;
163
+ icon: string;
164
+ }[];
165
+ subTab(f: DraftField): string;
166
+ setSubTab(f: DraftField, id: string): void;
167
+ /** Errors of field `i` that belong to a sub-tab (badge on the tab, so an error on a hidden tab is not missed). */
168
+ subTabErrors(i: number, id: string): number;
169
+ readonly asyncValidatorOptions: {
170
+ value: string;
171
+ title: string;
172
+ }[];
173
+ syncValidatorOptions(f: DraftField): {
174
+ value: string;
175
+ title: string;
176
+ }[];
177
+ canAsyncValidate(f: DraftField): boolean;
178
+ /** The selected validators are the settings themselves: required <-> "Обяз.", requiredTrue <-> mustBeTrue, minLength/pattern <-> their parameters. */
179
+ selectedValidators(f: DraftField): string[];
180
+ private validatorSelections;
181
+ readonly noValidators: string[];
182
+ setValidators(f: DraftField, names: string[]): void;
183
+ setAsyncValidators(f: DraftField, names: string[]): void;
184
+ /** Numeric field option (minLength, minSearchLength): empty clears it. */
185
+ setOptNumber(f: DraftField, key: string, raw: any): void;
186
+ addFilterOption(f: DraftField): void;
187
+ removeFilterOption(f: DraftField, j: number): void;
188
+ /** Filter value text -> boolean / number / string (the server stores the typed value). */
189
+ setFilterValue(item: {
190
+ field: string;
191
+ value: string | number | boolean;
192
+ }, raw: string): void;
193
+ setColumn(f: DraftField, text: string): void;
194
+ setDefault(f: DraftField, raw: string): void;
195
+ setShowIfField(f: DraftField, key: string): void;
196
+ setShowIfOp(f: DraftField, op: string): void;
197
+ setShowIfValue(f: DraftField, text: string): void;
198
+ /** Other fields usable in conditions / relation filters. */
199
+ otherFields(f: DraftField): DraftField[];
200
+ targetEntity(f: DraftField): SettingsEntity | undefined;
201
+ targetFieldKeys(f: DraftField): string[];
202
+ setRelationTarget(f: DraftField, key: string): void;
203
+ setRelationFilter(f: DraftField, patch: {
204
+ field?: string;
205
+ byField?: string;
206
+ }): void;
207
+ get snippets(): SnippetRef[];
208
+ codeMeta(s: SnippetRef): HookMeta | null;
209
+ /** Actions section: hooks only (calculated/validator code lives in the field rows). */
210
+ get hookSnippets(): SnippetRef[];
211
+ get orphans(): SnippetRef[];
212
+ get namesForNewSnippet(): string[];
213
+ onNewKindChange(): void;
214
+ addSnippet(): void;
215
+ removeSnippet(s: SnippetRef): void;
216
+ snippetValue(s: SnippetRef): string;
217
+ setLang(lang: CodeLang): void;
218
+ onSnippetChange(s: SnippetRef, source: string): void;
219
+ private clearDiagnostics;
220
+ runAllChecks(): void;
221
+ /** JS: instant local parse. TS: debounced POST /check-code (nothing is executed on the server either). */
222
+ checkSnippet(s: SnippetRef, immediate?: boolean): void;
223
+ private snippetValueSafe;
224
+ diagFor(s: SnippetRef): CodeDiagnostic[];
225
+ get allDiagnosticCount(): number;
226
+ get codeBlocked(): boolean;
227
+ err(path: string): string;
228
+ readonly settingsTabs: {
229
+ id: SettingsTab;
230
+ title: string;
231
+ icon: string;
232
+ }[];
233
+ settingsTab: SettingsTab;
234
+ private settingsTabOfPath;
235
+ settingsTabErrors(id: SettingsTab): number;
236
+ /** Tab that owns a validation path. */
237
+ tabOfPath(path: string): FormTab;
238
+ /** Number of current errors on a tab (shown as a badge so errors on a hidden tab are not missed). */
239
+ tabErrors(id: FormTab): number;
240
+ private showFirstErrorTab;
241
+ get errorList(): {
242
+ path: string;
243
+ message: string;
244
+ }[];
245
+ get canSave(): boolean;
246
+ save(): void;
247
+ private afterPlan;
248
+ private askConfirm;
249
+ private persist;
250
+ handleError(err: any, body?: any): void;
251
+ private applyServerDiagnostics;
252
+ loadSchemaLog(): void;
253
+ trackField: (_: number, f: DraftField) => string;
254
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntityFormComponent, never>;
255
+ static ɵcmp: i0.ɵɵComponentDeclaration<EntityFormComponent, "shared-entity-form", never, {}, {}, never, never, true, never>;
256
+ }
@@ -0,0 +1,15 @@
1
+ import { PlanDialogData } from './entities-settings.models';
2
+ import { destructiveItemText, isStatementDestructive } from './entities-settings.util';
3
+ import * as i0 from "@angular/core";
4
+ export type PlanDialogResult = {
5
+ confirmed: boolean;
6
+ };
7
+ /** DDL preview before save. A destructive plan needs the explicit checkbox before "Применить" is enabled. */
8
+ export declare class EntityPlanDialogComponent {
9
+ data: PlanDialogData;
10
+ confirmed: boolean;
11
+ isDestructive: typeof isStatementDestructive;
12
+ itemText: typeof destructiveItemText;
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntityPlanDialogComponent, never>;
14
+ static ɵcmp: i0.ɵɵComponentDeclaration<EntityPlanDialogComponent, "shared-ent-plan-dialog", never, {}, {}, never, never, true, never>;
15
+ }
@@ -0,0 +1,35 @@
1
+ import { EntityDefinition, EntityEventPayload } from './entities.models';
2
+ export declare const EntitiesLoad: import("@ngrx/store").ActionCreator<"[ Entities ] Load", () => import("@ngrx/store").Action<"[ Entities ] Load">>;
3
+ export declare const EntitiesLoadSuccess: import("@ngrx/store").ActionCreator<"[ Entities ] Load Success", (props: {
4
+ payload: {
5
+ data: EntityDefinition[];
6
+ };
7
+ }) => {
8
+ payload: {
9
+ data: EntityDefinition[];
10
+ };
11
+ } & import("@ngrx/store").Action<"[ Entities ] Load Success">>;
12
+ export declare const EntitiesLoadFail: import("@ngrx/store").ActionCreator<"[ Entities ] Load Fail", (props: {
13
+ payload: {
14
+ error?: any;
15
+ };
16
+ }) => {
17
+ payload: {
18
+ error?: any;
19
+ };
20
+ } & import("@ngrx/store").Action<"[ Entities ] Load Fail">>;
21
+ export declare const EntitiesRemove: import("@ngrx/store").ActionCreator<"[ Entities ] Remove", (props: {
22
+ payload: {
23
+ key: string;
24
+ };
25
+ }) => {
26
+ payload: {
27
+ key: string;
28
+ };
29
+ } & import("@ngrx/store").Action<"[ Entities ] Remove">>;
30
+ export declare const EntitiesClear: import("@ngrx/store").ActionCreator<"[ Entities ] Clear", () => import("@ngrx/store").Action<"[ Entities ] Clear">>;
31
+ export declare const EntitiesEventReceived: import("@ngrx/store").ActionCreator<"[ Entities ] Event Received", (props: {
32
+ payload: EntityEventPayload;
33
+ }) => {
34
+ payload: EntityEventPayload;
35
+ } & import("@ngrx/store").Action<"[ Entities ] Event Received">>;
@@ -0,0 +1,34 @@
1
+ import { Actions } from '@ngrx/effects';
2
+ import { Store } from '@ngrx/store';
3
+ import { AuthenticationService } from 'wt-front-shared';
4
+ import { EntitiesApiService } from '../services/entities-api.service';
5
+ import { EntitiesEventsService } from '../services/entities-events.service';
6
+ import * as i0 from "@angular/core";
7
+ export declare class EntitiesEffects {
8
+ private actions$;
9
+ private store;
10
+ private api;
11
+ private events;
12
+ private authenticationService;
13
+ onAuth$: import("rxjs").Observable<import("@ngrx/store").Action<"[ Entities ] Load"> | import("@ngrx/store").Action<"[ Entities ] Clear">> & import("@ngrx/effects").CreateEffectMetadata;
14
+ load$: import("rxjs").Observable<({
15
+ payload: {
16
+ data: import("wt-front-shared/entities").EntityDefinition[];
17
+ };
18
+ } & import("@ngrx/store").Action<"[ Entities ] Load Success">) | ({
19
+ payload: {
20
+ error?: any;
21
+ };
22
+ } & import("@ngrx/store").Action<"[ Entities ] Load Fail">)> & import("@ngrx/effects").CreateEffectMetadata;
23
+ wsToAction$: import("rxjs").Observable<{
24
+ payload: import("wt-front-shared/entities").EntityEventPayload;
25
+ } & import("@ngrx/store").Action<"[ Entities ] Event Received">> & import("@ngrx/effects").CreateEffectMetadata;
26
+ onEvent$: import("rxjs").Observable<NonNullable<import("@ngrx/store").Action<"[ Entities ] Load"> | ({
27
+ payload: {
28
+ key: string;
29
+ };
30
+ } & import("@ngrx/store").Action<"[ Entities ] Remove">)>> & import("@ngrx/effects").CreateEffectMetadata;
31
+ constructor(actions$: Actions, store: Store<any>, api: EntitiesApiService, events: EntitiesEventsService, authenticationService: AuthenticationService);
32
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntitiesEffects, never>;
33
+ static ɵprov: i0.ɵɵInjectableDeclaration<EntitiesEffects>;
34
+ }
@@ -0,0 +1,17 @@
1
+ import { Store } from '@ngrx/store';
2
+ import { Observable } from 'rxjs';
3
+ import { EntityDefinition } from './entities.models';
4
+ import * as i0 from "@angular/core";
5
+ export declare class EntitiesFacade {
6
+ private store;
7
+ all$: Observable<EntityDefinition[]>;
8
+ active$: Observable<EntityDefinition[]>;
9
+ uiOnly$: Observable<EntityDefinition[]>;
10
+ status$: Observable<import("wt-front-shared/entities").EntitiesStatus>;
11
+ loaded$: Observable<boolean>;
12
+ constructor(store: Store<any>);
13
+ byKey$(key: string): Observable<EntityDefinition | undefined>;
14
+ reload(): void;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntitiesFacade, never>;
16
+ static ɵprov: i0.ɵɵInjectableDeclaration<EntitiesFacade>;
17
+ }
@@ -0,0 +1,157 @@
1
+ export type EntityFieldType = 'string' | 'text' | 'integer' | 'boolean' | 'date' | 'json' | 'select-one' | 'select-many' | 'string-list';
2
+ export type EntitySource = 'ui' | 'code';
3
+ export interface EntityGroup {
4
+ key: string;
5
+ title: string;
6
+ order?: number;
7
+ }
8
+ export interface EntityFieldOptions {
9
+ hidden?: boolean;
10
+ notEditable?: boolean;
11
+ searchable?: boolean;
12
+ rich?: boolean;
13
+ datetime?: boolean;
14
+ listColumn?: boolean;
15
+ calculated?: boolean;
16
+ /** help text shown under the field (IFormField.description) */
17
+ description?: string;
18
+ example?: string;
19
+ col?: number;
20
+ colSm?: number;
21
+ colMd?: number;
22
+ colLg?: number;
23
+ colXl?: number;
24
+ colXxl?: number;
25
+ isSortable?: boolean;
26
+ /** client-side checks (validators minLength / pattern / requiredTrue of the form engine) */
27
+ minLength?: number;
28
+ pattern?: string;
29
+ patternMessage?: string;
30
+ /** Form-engine async validators: 'item-uniq-value' | 'item-value-exists' (checked on the server against the entity's own table). */
31
+ asyncValidators?: string[];
32
+ mustBeTrue?: boolean;
33
+ /** boolean toggle captions */
34
+ trueTitle?: string;
35
+ falseTitle?: string;
36
+ /** relation pickers */
37
+ selectShowAllOptions?: boolean;
38
+ innerSearch?: boolean;
39
+ lazyLoading?: boolean;
40
+ minSearchLength?: number;
41
+ filterOptions?: {
42
+ field: string;
43
+ value: string | number | boolean;
44
+ }[];
45
+ hint?: string;
46
+ placeholder?: string;
47
+ separator?: string;
48
+ }
49
+ export interface EntityFieldRelation {
50
+ type?: 'one' | 'many';
51
+ target: string;
52
+ targetSource?: EntitySource;
53
+ displayField?: string;
54
+ activeOnly?: boolean;
55
+ filter?: {
56
+ field: string;
57
+ byField: string;
58
+ };
59
+ }
60
+ export interface EntityFieldCondition {
61
+ field: string;
62
+ op?: 'equals' | 'in';
63
+ value?: any;
64
+ }
65
+ export interface EntityFieldDefinition {
66
+ key: string;
67
+ title: string;
68
+ type: EntityFieldType | string;
69
+ column?: string;
70
+ required?: boolean;
71
+ unique?: boolean;
72
+ default?: any;
73
+ rules?: string[];
74
+ options?: EntityFieldOptions;
75
+ group?: string;
76
+ order?: number;
77
+ relation?: EntityFieldRelation;
78
+ showIf?: EntityFieldCondition;
79
+ dependsOn?: EntityFieldCondition;
80
+ }
81
+ /** Section settings of an entity (subset of StaticDataSection that is plain data). Stored in definition.options. */
82
+ export interface EntitySectionOptions {
83
+ showSettings?: boolean;
84
+ showpresets?: boolean;
85
+ boards?: boolean;
86
+ allItems?: boolean;
87
+ search?: boolean;
88
+ kanbanColumnField?: string;
89
+ kanbanField?: string;
90
+ orderByField?: string;
91
+ filteringType?: 'modal' | 'left-block';
92
+ filtering?: {
93
+ fields?: {
94
+ field: string;
95
+ title?: string;
96
+ type?: 'input' | 'between' | 'toggle' | 'select';
97
+ }[];
98
+ };
99
+ /** Sections loaded before the form opens (`slug(paging:{perPage:-1})`); when set it replaces the list derived from the relation fields. */
100
+ preLoadSections?: string[];
101
+ texts?: {
102
+ list?: {
103
+ topText?: string;
104
+ bottomText?: string;
105
+ };
106
+ details?: {
107
+ topText?: string;
108
+ bottomText?: string;
109
+ };
110
+ };
111
+ viewSettings?: {
112
+ listMode?: {
113
+ hideAddAction?: boolean;
114
+ hideEditAction?: boolean;
115
+ hideDeleteAction?: boolean;
116
+ hideViewAction?: boolean;
117
+ mainBlockCols?: number;
118
+ filterBlockCols?: number;
119
+ menuBlockCols?: number;
120
+ };
121
+ viewMode?: {
122
+ mainBlockCols?: number;
123
+ menuBlockCols?: number;
124
+ };
125
+ };
126
+ actions?: {
127
+ isNoViewAction?: boolean;
128
+ isNoDeleteAction?: boolean;
129
+ isNoEditAction?: boolean;
130
+ defaultListAction?: 'edit' | 'view';
131
+ };
132
+ }
133
+ export interface EntityDefinition {
134
+ id: number | null;
135
+ key: string;
136
+ title: string;
137
+ storageMode?: 'physical';
138
+ isActive: boolean;
139
+ version: number | null;
140
+ source: EntitySource;
141
+ readOnly?: boolean;
142
+ tableName?: string | null;
143
+ /** UI entities: entity-level display field of relation pickers (default `name`). */
144
+ displayField?: string | null;
145
+ /** Code entities (descriptors): static-data url slug of the hand-written service (null = not served by static-data). UI entities: slug = key. */
146
+ slug?: string | null;
147
+ /** UI entities: section settings (texts, boards, filtering, view/action flags). */
148
+ options?: EntitySectionOptions;
149
+ groups: EntityGroup[];
150
+ fields: EntityFieldDefinition[];
151
+ }
152
+ export type EntityEventName = 'entity.created' | 'entity.updated' | 'entity.deleted' | 'entities.reload';
153
+ export interface EntityEventPayload {
154
+ type: EntityEventName | string;
155
+ key?: string;
156
+ version?: number | null;
157
+ }
@@ -0,0 +1,13 @@
1
+ import { EntityDefinition } from './entities.models';
2
+ export declare const ENTITIES_FEATURE_KEY = "entities";
3
+ export type EntitiesStatus = 'idle' | 'loading' | 'loaded' | 'error';
4
+ export interface EntitiesState {
5
+ ids: string[];
6
+ byKey: {
7
+ [key: string]: EntityDefinition;
8
+ };
9
+ status: EntitiesStatus;
10
+ error?: any;
11
+ }
12
+ export declare const initialEntitiesState: EntitiesState;
13
+ export declare function entitiesReducer(state: EntitiesState | undefined, action: any): EntitiesState;
@@ -0,0 +1,15 @@
1
+ import { EntitiesState } from './entities.reducer';
2
+ export declare const entitiesQuery: {
3
+ getState: import("@ngrx/store").MemoizedSelector<object, EntitiesState, import("@ngrx/store").DefaultProjectorFn<EntitiesState>>;
4
+ getAll: import("@ngrx/store").MemoizedSelector<object, import("wt-front-shared/entities").EntityDefinition[], (s1: EntitiesState) => import("wt-front-shared/entities").EntityDefinition[]>;
5
+ getActive: import("@ngrx/store").MemoizedSelector<object, import("wt-front-shared/entities").EntityDefinition[], (s1: import("wt-front-shared/entities").EntityDefinition[]) => import("wt-front-shared/entities").EntityDefinition[]>;
6
+ getUiOnly: import("@ngrx/store").MemoizedSelector<object, import("wt-front-shared/entities").EntityDefinition[], (s1: import("wt-front-shared/entities").EntityDefinition[]) => import("wt-front-shared/entities").EntityDefinition[]>;
7
+ getByKey: (key: string) => import("@ngrx/store").MemoizedSelector<object, import("wt-front-shared/entities").EntityDefinition, (s1: EntitiesState) => import("wt-front-shared/entities").EntityDefinition>;
8
+ getStatus: import("@ngrx/store").MemoizedSelector<object, import("./entities.reducer").EntitiesStatus, (s1: EntitiesState) => import("./entities.reducer").EntitiesStatus>;
9
+ getLoaded: import("@ngrx/store").MemoizedSelector<object, boolean, (s1: import("./entities.reducer").EntitiesStatus) => boolean>;
10
+ getVersions: import("@ngrx/store").MemoizedSelector<object, {
11
+ [key: string]: number;
12
+ }, (s1: EntitiesState) => {
13
+ [key: string]: number;
14
+ }>;
15
+ };
@@ -0,0 +1,8 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ /** What the entity screens need from the host to show messages (the host maps it to its toast / snackbar). Default: console. */
3
+ export interface EntitiesNotifier {
4
+ success(message: string): void;
5
+ warning(message: string): void;
6
+ error(message: string): void;
7
+ }
8
+ export declare const ENTITIES_NOTIFIER: InjectionToken<EntitiesNotifier>;
@@ -0,0 +1,13 @@
1
+ import * as i0 from "@angular/core";
2
+ export interface ConfirmDialogData {
3
+ title: string;
4
+ message?: string;
5
+ confirmLabel?: string;
6
+ cancelLabel?: string;
7
+ danger?: boolean;
8
+ }
9
+ export declare class ConfirmDialogComponent {
10
+ data: ConfirmDialogData;
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<ConfirmDialogComponent, never>;
12
+ static ɵcmp: i0.ɵɵComponentDeclaration<ConfirmDialogComponent, "shared-ent-confirm-dialog", never, {}, {}, never, never, true, never>;
13
+ }
@@ -0,0 +1,8 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class EmptyStateComponent {
3
+ icon: import("@angular/core").InputSignal<string>;
4
+ title: import("@angular/core").InputSignal<string>;
5
+ text: import("@angular/core").InputSignal<string>;
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<EmptyStateComponent, never>;
7
+ static ɵcmp: i0.ɵɵComponentDeclaration<EmptyStateComponent, "shared-ent-empty-state", never, { "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "text": { "alias": "text"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
8
+ }
@@ -0,0 +1,5 @@
1
+ export * from './page-header.component';
2
+ export * from './status-chip.component';
3
+ export * from './inline-alert.component';
4
+ export * from './empty-state.component';
5
+ export * from './confirm-dialog.component';
@@ -0,0 +1,11 @@
1
+ import * as i0 from "@angular/core";
2
+ export type InlineAlertTone = 'info' | 'success' | 'warning' | 'error';
3
+ export declare class InlineAlertComponent {
4
+ tone: import("@angular/core").InputSignal<InlineAlertTone>;
5
+ dismissible: import("@angular/core").InputSignal<boolean>;
6
+ dismissed: import("@angular/core").OutputEmitterRef<void>;
7
+ iconName: import("@angular/core").Signal<string>;
8
+ role: import("@angular/core").Signal<"alert" | "status">;
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<InlineAlertComponent, never>;
10
+ static ɵcmp: i0.ɵɵComponentDeclaration<InlineAlertComponent, "shared-ent-inline-alert", never, { "tone": { "alias": "tone"; "required": false; "isSignal": true; }; "dismissible": { "alias": "dismissible"; "required": false; "isSignal": true; }; }, { "dismissed": "dismissed"; }, never, ["*"], true, never>;
11
+ }
@@ -0,0 +1,8 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class PageHeaderComponent {
3
+ title: import("@angular/core").InputSignal<string>;
4
+ subtitle: import("@angular/core").InputSignal<string>;
5
+ icon: import("@angular/core").InputSignal<string>;
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<PageHeaderComponent, never>;
7
+ static ɵcmp: i0.ɵɵComponentDeclaration<PageHeaderComponent, "shared-ent-page-header", never, { "title": { "alias": "title"; "required": true; "isSignal": true; }; "subtitle": { "alias": "subtitle"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
8
+ }
@@ -0,0 +1,8 @@
1
+ import * as i0 from "@angular/core";
2
+ export type StatusChipTone = 'neutral' | 'info' | 'success' | 'warning' | 'error';
3
+ export declare class StatusChipComponent {
4
+ tone: import("@angular/core").InputSignal<StatusChipTone>;
5
+ icon: import("@angular/core").InputSignal<string>;
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<StatusChipComponent, never>;
7
+ static ɵcmp: i0.ɵɵComponentDeclaration<StatusChipComponent, "shared-ent-status-chip", never, { "tone": { "alias": "tone"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
8
+ }
@@ -0,0 +1,19 @@
1
+ export * from './lib/tokens';
2
+ export * from './lib/state/entities.models';
3
+ export * from './lib/state/entities.actions';
4
+ export * from './lib/state/entities.reducer';
5
+ export * from './lib/state/entities.selectors';
6
+ export * from './lib/state/entities.facade';
7
+ export * from './lib/state/entities.effects';
8
+ export * from './lib/services/entities-adapter.service';
9
+ export * from './lib/services/entities-api.service';
10
+ export * from './lib/services/entities-events.service';
11
+ export * from './lib/services/entities-sections.service';
12
+ export * from './lib/guards/entity-sections.guard';
13
+ export * from './lib/guards/route-wait.service';
14
+ export * from './lib/settings/entities-settings.component';
15
+ export * from './lib/settings/entity-form.component';
16
+ export * from './lib/settings/entities-settings.facade';
17
+ export * from './lib/settings/entities-settings.models';
18
+ export * from './lib/settings/entities-settings.util';
19
+ export * from './lib/ui';