@sftech/ng-shared 0.0.20 → 0.0.23
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/fesm2022/sftech-ng-shared.mjs +141 -72
- package/fesm2022/sftech-ng-shared.mjs.map +1 -1
- package/index.d.ts +408 -31
- package/package.json +8 -8
- package/lib/components/forms/form-error-display/form-error-display.component.d.ts +0 -8
- package/lib/components/pages/base-display/base-display-modal/base-display-modal.component.d.ts +0 -7
- package/lib/components/pages/base-display/base-display.component.d.ts +0 -43
- package/lib/components/pages/base-list.component.d.ts +0 -32
- package/lib/components/paginator/paginator.component.d.ts +0 -11
- package/lib/core/configuration/app-config.interface.d.ts +0 -3
- package/lib/core/configuration/app-config.loader.d.ts +0 -2
- package/lib/core/dtos/api-response.dto.d.ts +0 -9
- package/lib/core/dtos/base-db-create.dto.d.ts +0 -2
- package/lib/core/dtos/base-db-response.dto.d.ts +0 -5
- package/lib/core/dtos/base-db-update.dto.d.ts +0 -2
- package/lib/core/dtos/base-response.dto.d.ts +0 -1
- package/lib/core/dtos/odata-response.dto.d.ts +0 -13
- package/lib/core/models/base-db.model.d.ts +0 -24
- package/lib/core/models/mapped-api-response.model.d.ts +0 -19
- package/lib/core/models/mapped-odata-response.model.d.ts +0 -12
- package/lib/core/models/odata/filter/filter.enums.d.ts +0 -16
- package/lib/core/models/odata/odata-expands.model.d.ts +0 -7
- package/lib/core/models/odata/odata-filter-collection.model.d.ts +0 -14
- package/lib/core/models/odata/odata-filter.model.d.ts +0 -13
- package/lib/core/models/odata/odata-order.model.d.ts +0 -10
- package/lib/core/models/odata/odata-pagination.model.d.ts +0 -10
- package/lib/core/models/odata/odata.interface.d.ts +0 -3
- package/lib/core/models/odata/odata.model.d.ts +0 -12
- package/lib/core/services/base-db-api.service.d.ts +0 -29
- package/lib/providers/icon.provider.d.ts +0 -21
- package/lib/ui/layouts/base-dialog/base-dialog.component.d.ts +0 -20
- package/lib/ui/layouts/head-main-footer-with-canvas/head-main-footer-with-canvas.component.d.ts +0 -20
- package/lib/ui/layouts/sidebar-navigation/sidebar-navigation.component.d.ts +0 -18
- package/lib/ui/pages/not-permitted/not-permitted.component.d.ts +0 -5
- package/lib/ui/styles/themes/sftech.preset.d.ts +0 -1
package/index.d.ts
CHANGED
|
@@ -1,31 +1,408 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EventEmitter, TemplateRef, OnInit } from '@angular/core';
|
|
3
|
+
import { Drawer } from 'primeng/drawer';
|
|
4
|
+
import * as _fortawesome_free_solid_svg_icons from '@fortawesome/free-solid-svg-icons';
|
|
5
|
+
import { DynamicDialogRef } from 'primeng/dynamicdialog';
|
|
6
|
+
import { Router, ActivatedRoute } from '@angular/router';
|
|
7
|
+
import { HttpClient, HttpErrorResponse } from '@angular/common/http';
|
|
8
|
+
import { Observable } from 'rxjs';
|
|
9
|
+
import { FormGroup, FormControl, AbstractControl } from '@angular/forms';
|
|
10
|
+
import { MessageService } from 'primeng/api';
|
|
11
|
+
import { PaginatorState } from 'primeng/paginator';
|
|
12
|
+
|
|
13
|
+
declare const SfTechPreset: any;
|
|
14
|
+
|
|
15
|
+
declare class IconProvider {
|
|
16
|
+
static readonly add: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
17
|
+
static readonly agent: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
18
|
+
static readonly arrowRight: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
19
|
+
static readonly back: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
20
|
+
static readonly bolt: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
21
|
+
static readonly brain: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
22
|
+
static readonly calendar: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
23
|
+
static readonly chat: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
24
|
+
static readonly close: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
25
|
+
static readonly cloud: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
26
|
+
static readonly delete: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
27
|
+
static readonly database: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
28
|
+
static readonly document: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
29
|
+
static readonly documentAdd: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
30
|
+
static readonly exchange: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
31
|
+
static readonly externalLink: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
32
|
+
static readonly filter: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
33
|
+
static readonly filterSettings: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
34
|
+
static readonly globe: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
35
|
+
static readonly chevronDown: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
36
|
+
static readonly chevronUp: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
37
|
+
static readonly help: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
38
|
+
static readonly inbox: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
39
|
+
static readonly info: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
40
|
+
static readonly lightbulb: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
41
|
+
static readonly loading: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
42
|
+
static readonly menu: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
43
|
+
static readonly message: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
44
|
+
static readonly notFound: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
45
|
+
static readonly robot: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
46
|
+
static readonly rocket: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
47
|
+
static readonly search: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
48
|
+
static readonly shield: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
49
|
+
static readonly sparkles: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
50
|
+
static readonly tag: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
51
|
+
static readonly tools: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
52
|
+
static readonly unknown: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
53
|
+
static readonly upload: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
54
|
+
static readonly window: _fortawesome_free_solid_svg_icons.IconDefinition;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
declare class SidebarNavigationComponent {
|
|
58
|
+
closeDrawer: EventEmitter<void>;
|
|
59
|
+
navigation: i0.InputSignal<ISidebarNavigationCategory[]>;
|
|
60
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SidebarNavigationComponent, never>;
|
|
61
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SidebarNavigationComponent, "sftech-sidebar-navigation", never, { "navigation": { "alias": "navigation"; "required": false; "isSignal": true; }; }, { "closeDrawer": "closeDrawer"; }, never, never, true, never>;
|
|
62
|
+
}
|
|
63
|
+
interface ISidebarNavigationCategory {
|
|
64
|
+
categoryName: string;
|
|
65
|
+
icon?: string;
|
|
66
|
+
links: ISidebarNavigationLink[];
|
|
67
|
+
}
|
|
68
|
+
interface ISidebarNavigationLink {
|
|
69
|
+
name: string;
|
|
70
|
+
icon?: string;
|
|
71
|
+
routerLink: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
declare class HeadMainFooterWithCanvasComponent {
|
|
75
|
+
title: string;
|
|
76
|
+
maxWidth: string;
|
|
77
|
+
navigationItems: ISidebarNavigationCategory[];
|
|
78
|
+
hasDrawer: boolean;
|
|
79
|
+
protected drawerVisible: boolean;
|
|
80
|
+
header: TemplateRef<unknown> | null;
|
|
81
|
+
main: TemplateRef<unknown> | null;
|
|
82
|
+
footer: TemplateRef<unknown> | null;
|
|
83
|
+
drawerRef: Drawer;
|
|
84
|
+
protected iconProvider: typeof IconProvider;
|
|
85
|
+
closeCallback(e: Event): void;
|
|
86
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HeadMainFooterWithCanvasComponent, never>;
|
|
87
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HeadMainFooterWithCanvasComponent, "sftech-head-main-footer-with-canvas", never, { "title": { "alias": "title"; "required": false; }; "maxWidth": { "alias": "maxWidth"; "required": false; }; "navigationItems": { "alias": "navigationItems"; "required": false; }; "hasDrawer": { "alias": "hasDrawer"; "required": false; }; }, {}, ["header", "main", "footer"], never, true, never>;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
declare class BaseDialogComponent {
|
|
91
|
+
hasHeader: i0.InputSignal<boolean>;
|
|
92
|
+
hasFooter: i0.InputSignal<boolean>;
|
|
93
|
+
showButtons: i0.InputSignal<boolean>;
|
|
94
|
+
headerText: i0.InputSignal<string | undefined>;
|
|
95
|
+
closed: EventEmitter<void>;
|
|
96
|
+
header: TemplateRef<unknown> | null;
|
|
97
|
+
body: TemplateRef<unknown> | null;
|
|
98
|
+
footer: TemplateRef<unknown> | null;
|
|
99
|
+
iconProvider: typeof IconProvider;
|
|
100
|
+
protected ref: DynamicDialogRef<any>;
|
|
101
|
+
constructor();
|
|
102
|
+
close(retVal?: unknown): void;
|
|
103
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaseDialogComponent, never>;
|
|
104
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BaseDialogComponent, "sftech-base-dialog", never, { "hasHeader": { "alias": "hasHeader"; "required": false; "isSignal": true; }; "hasFooter": { "alias": "hasFooter"; "required": false; "isSignal": true; }; "showButtons": { "alias": "showButtons"; "required": false; "isSignal": true; }; "headerText": { "alias": "headerText"; "required": false; "isSignal": true; }; }, { "closed": "closed"; }, ["header", "body", "footer"], never, true, never>;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
interface IAppConfig {
|
|
108
|
+
[key: string]: string | boolean | number;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
declare function loadConfig<TConfig extends IAppConfig>(configPath: string): Promise<TConfig>;
|
|
112
|
+
|
|
113
|
+
interface IBaseDbUpdateDto {
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
interface IBaseDbCreateDto {
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
type IBaseResponseDto = object;
|
|
120
|
+
|
|
121
|
+
interface IBaseDbResponseDto extends IBaseResponseDto {
|
|
122
|
+
id: number;
|
|
123
|
+
createdAt: Date;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
interface IOdataResponsePaginationDto {
|
|
127
|
+
totalPages: number;
|
|
128
|
+
pageSize: number;
|
|
129
|
+
totalElements: number;
|
|
130
|
+
page: number;
|
|
131
|
+
isFirstPage: boolean;
|
|
132
|
+
isLastPage: boolean;
|
|
133
|
+
}
|
|
134
|
+
interface IOdataResponseDto<TDbDto extends IBaseDbResponseDto | unknown> {
|
|
135
|
+
items: TDbDto[];
|
|
136
|
+
pagination: IOdataResponsePaginationDto;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
interface IApiResponse<TDto extends unknown> {
|
|
140
|
+
status: number;
|
|
141
|
+
messages?: string[];
|
|
142
|
+
data?: TDto | TDto[];
|
|
143
|
+
}
|
|
144
|
+
interface IApiErrorResponse {
|
|
145
|
+
status: number;
|
|
146
|
+
messages: string[] | undefined;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
declare enum EFilterTypes {
|
|
150
|
+
NUMERIC = "numeric",
|
|
151
|
+
STRING = "string",
|
|
152
|
+
DATE = "date",
|
|
153
|
+
TIME = "time",
|
|
154
|
+
PACE = "pace"
|
|
155
|
+
}
|
|
156
|
+
declare enum EFilterOperator {
|
|
157
|
+
EQUALS = "=",
|
|
158
|
+
GREATER = ">",
|
|
159
|
+
LESS = "<",
|
|
160
|
+
GREATEREQUALS = ">=",
|
|
161
|
+
LESSEQUALS = "<=",
|
|
162
|
+
BETWEEN = "zwischen",
|
|
163
|
+
CONTAINS = "enth\u00E4lt"
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
interface IBaseDbModel {
|
|
167
|
+
id?: number;
|
|
168
|
+
createdAt?: Date;
|
|
169
|
+
propertiesToShow?: string[];
|
|
170
|
+
propertyUINames?: Map<string, string>;
|
|
171
|
+
getFilterTypeForProperty(propertyName: string): EFilterTypes | undefined;
|
|
172
|
+
getUiNameForProperty(propertyName: string): string;
|
|
173
|
+
}
|
|
174
|
+
declare class BaseDbModel implements IBaseDbModel {
|
|
175
|
+
id?: number;
|
|
176
|
+
createdAt?: Date;
|
|
177
|
+
propertiesToShow: string[];
|
|
178
|
+
propertyFilterType: Map<string, EFilterTypes>;
|
|
179
|
+
propertyUINames: Map<string, string>;
|
|
180
|
+
getUiNameForProperty(propertyName: string): string;
|
|
181
|
+
getFilterTypeForProperty(propertyName: string): EFilterTypes | undefined;
|
|
182
|
+
getPropertyValue(propertyName: string): unknown;
|
|
183
|
+
static fromDto(dto: IBaseDbResponseDto): IBaseDbModel;
|
|
184
|
+
static fromDtos(dtos: IBaseDbResponseDto[]): IBaseDbModel[];
|
|
185
|
+
fromDto(dto: IBaseDbResponseDto): IBaseDbModel;
|
|
186
|
+
fromDtos(dtos: IBaseDbResponseDto[]): IBaseDbModel[];
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
declare class MappedApiResponse<TModel extends BaseDbModel> {
|
|
190
|
+
status: number;
|
|
191
|
+
data: TModel | TModel[] | undefined;
|
|
192
|
+
messages: string[];
|
|
193
|
+
isError: boolean;
|
|
194
|
+
}
|
|
195
|
+
declare class MappedApiResponseRaw<TModel> {
|
|
196
|
+
status: number;
|
|
197
|
+
data: TModel | undefined;
|
|
198
|
+
messages: string[];
|
|
199
|
+
isError: boolean;
|
|
200
|
+
}
|
|
201
|
+
declare class MappedApiError {
|
|
202
|
+
status: number;
|
|
203
|
+
data: undefined;
|
|
204
|
+
messages: string[];
|
|
205
|
+
isError: boolean;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
interface IOdata {
|
|
209
|
+
toGetParameter(): string;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
declare class ODataPagination implements IOdata {
|
|
213
|
+
pageSize: number;
|
|
214
|
+
totalPages: number;
|
|
215
|
+
totalElements: number;
|
|
216
|
+
page: number;
|
|
217
|
+
static fromDto(dto: IOdataResponsePaginationDto): ODataPagination;
|
|
218
|
+
toGetParameter(): string;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
declare class MappedOdataResponse<TModel extends BaseDbModel> {
|
|
222
|
+
status: number;
|
|
223
|
+
data: MappedOdataResponseData<TModel>;
|
|
224
|
+
messages: string[];
|
|
225
|
+
isError: boolean;
|
|
226
|
+
}
|
|
227
|
+
declare class MappedOdataResponseData<TModel extends BaseDbModel> {
|
|
228
|
+
items: TModel[];
|
|
229
|
+
pagination: ODataPagination;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
declare class OdataExpands implements IOdata {
|
|
233
|
+
expands: string[];
|
|
234
|
+
constructor(expands?: string[]);
|
|
235
|
+
addField(field: string): void;
|
|
236
|
+
toGetParameter(): string;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
declare class OdataFilter implements IOdata {
|
|
240
|
+
field?: string | undefined;
|
|
241
|
+
value?: string | number | undefined;
|
|
242
|
+
operator?: EFilterOperator | undefined;
|
|
243
|
+
type?: EFilterTypes | undefined;
|
|
244
|
+
constructor(field?: string | undefined, value?: string | number | undefined, operator?: EFilterOperator | undefined, type?: EFilterTypes | undefined);
|
|
245
|
+
/**
|
|
246
|
+
* Escapes a string value for safe use in OData queries.
|
|
247
|
+
* Prevents OData injection attacks by escaping single quotes.
|
|
248
|
+
*/
|
|
249
|
+
private escapeODataString;
|
|
250
|
+
toGetParameter(): string;
|
|
251
|
+
static availableOperators(type: EFilterTypes | undefined): EFilterOperator[];
|
|
252
|
+
private _getTypeDependentValue;
|
|
253
|
+
private _getODataOperator;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
declare enum FilterConcatenation {
|
|
257
|
+
OR = " or ",
|
|
258
|
+
AND = " and "
|
|
259
|
+
}
|
|
260
|
+
declare class OdataFilterCollection implements IOdata {
|
|
261
|
+
andFilters: OdataFilter[];
|
|
262
|
+
/**
|
|
263
|
+
* Raw filter strings that are added directly to the OData query.
|
|
264
|
+
* Useful for complex filters that can't be expressed with OdataFilter (e.g., OR conditions).
|
|
265
|
+
*/
|
|
266
|
+
rawFilters: string[];
|
|
267
|
+
toGetParameter(): string;
|
|
268
|
+
addAnd(andFilter: OdataFilter): void;
|
|
269
|
+
/**
|
|
270
|
+
* Adds a raw OData filter string.
|
|
271
|
+
* Use this for complex filters like OR conditions.
|
|
272
|
+
* Example: "((publishedAt ne null and publishedAt ge '2024-01-01') or (publishedAt eq null and createdAt ge '2024-01-01'))"
|
|
273
|
+
*/
|
|
274
|
+
addRaw(rawFilter: string): void;
|
|
275
|
+
remove(field: string | undefined): void;
|
|
276
|
+
hasValidFilters(): boolean;
|
|
277
|
+
private _isFilterValid;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
declare enum ESortDirection {
|
|
281
|
+
ASC = "asc",
|
|
282
|
+
DESC = "desc"
|
|
283
|
+
}
|
|
284
|
+
declare class ODataOrder implements IOdata {
|
|
285
|
+
column: string;
|
|
286
|
+
direction: ESortDirection;
|
|
287
|
+
static create(column: string, direction: ESortDirection): ODataOrder;
|
|
288
|
+
toGetParameter(): string;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
declare class OData implements IOdata {
|
|
292
|
+
pagination: ODataPagination;
|
|
293
|
+
filter: OdataFilterCollection;
|
|
294
|
+
expands: OdataExpands;
|
|
295
|
+
order: ODataOrder;
|
|
296
|
+
toGetParameter(): string;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
declare abstract class BaseDbApiService<TModel extends BaseDbModel, TCreateDto extends IBaseDbCreateDto, TUpdateDto extends IBaseDbUpdateDto, TResponseDto extends IBaseDbResponseDto> {
|
|
300
|
+
protected readonly http: HttpClient;
|
|
301
|
+
protected readonly config: IAppConfig;
|
|
302
|
+
protected url: string;
|
|
303
|
+
constructor(http: HttpClient, config: IAppConfig);
|
|
304
|
+
get(id: number, detailed?: boolean): Observable<MappedApiResponse<TModel> | MappedApiError>;
|
|
305
|
+
getAll(): Observable<MappedOdataResponse<TModel> | MappedApiError>;
|
|
306
|
+
odata(odataQuery: OData): Observable<MappedOdataResponse<TModel> | MappedApiError>;
|
|
307
|
+
insert(dto: TCreateDto): Observable<MappedApiResponse<TModel> | MappedApiError>;
|
|
308
|
+
update(id: number, dto: TUpdateDto): Observable<MappedApiResponse<TModel> | MappedApiError>;
|
|
309
|
+
delete(id: number): Observable<MappedApiResponse<TModel> | MappedApiError>;
|
|
310
|
+
protected abstract getNewModel(): TModel;
|
|
311
|
+
protected responseOdataMapping(response: IApiResponse<IOdataResponseDto<TResponseDto>>): MappedOdataResponse<TModel>;
|
|
312
|
+
protected responseMapping(response: IApiResponse<TResponseDto>): MappedApiResponse<TModel> | MappedApiError;
|
|
313
|
+
protected errorHandling(statusCode: number, messages: string[] | undefined): MappedApiError;
|
|
314
|
+
protected httpErrorToApiResponse(error: HttpErrorResponse): Observable<MappedApiError>;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
declare class BaseDisplayModalComponent {
|
|
318
|
+
id: number | undefined;
|
|
319
|
+
canEdit: boolean;
|
|
320
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaseDisplayModalComponent, never>;
|
|
321
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BaseDisplayModalComponent, "lib-prompt-display-modal", never, {}, {}, never, never, true, never>;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
declare abstract class BaseListComponent<TDbModel extends BaseDbModel, TCreateDto extends IBaseDbCreateDto, TUpdateDto extends IBaseDbUpdateDto, TResponseDto extends IBaseDbResponseDto> implements OnInit {
|
|
325
|
+
odata: i0.ModelSignal<OData>;
|
|
326
|
+
showPageTitle: i0.InputSignal<boolean>;
|
|
327
|
+
canEdit: i0.InputSignal<boolean>;
|
|
328
|
+
openDisplayAsModal: i0.InputSignal<boolean>;
|
|
329
|
+
modalWidth: string;
|
|
330
|
+
data: i0.WritableSignal<TDbModel[] | undefined>;
|
|
331
|
+
loading: i0.WritableSignal<boolean>;
|
|
332
|
+
protected router: Router;
|
|
333
|
+
private modalService;
|
|
334
|
+
protected abstract _repo: BaseDbApiService<TDbModel, TCreateDto, TUpdateDto, TResponseDto>;
|
|
335
|
+
protected abstract _route: string;
|
|
336
|
+
protected detailModalHeaderText: string;
|
|
337
|
+
protected _modalComponent?: typeof BaseDisplayModalComponent;
|
|
338
|
+
constructor();
|
|
339
|
+
ngOnInit(): void;
|
|
340
|
+
updatePagination($event: ODataPagination): void;
|
|
341
|
+
protected updateOdata(changes: {
|
|
342
|
+
pagination?: ODataPagination;
|
|
343
|
+
filter?: OdataFilterCollection;
|
|
344
|
+
order?: ODataOrder;
|
|
345
|
+
expands?: OdataExpands;
|
|
346
|
+
resetPaginationToFirstPage?: boolean;
|
|
347
|
+
}): void;
|
|
348
|
+
openDisplay(id?: number): void;
|
|
349
|
+
protected _loadData(): void;
|
|
350
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaseListComponent<any, any, any, any>, never>;
|
|
351
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BaseListComponent<any, any, any, any>, "sftech-pages-base-list", never, { "odata": { "alias": "odata"; "required": false; "isSignal": true; }; "showPageTitle": { "alias": "showPageTitle"; "required": false; "isSignal": true; }; "canEdit": { "alias": "canEdit"; "required": false; "isSignal": true; }; "openDisplayAsModal": { "alias": "openDisplayAsModal"; "required": false; "isSignal": true; }; }, { "odata": "odataChange"; }, never, never, true, never>;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
declare abstract class BaseDisplayComponent<TDbModel extends BaseDbModel, TCreateDto extends IBaseDbCreateDto, TUpdateDto extends IBaseDbUpdateDto, TResponseDto extends IBaseDbResponseDto> extends BaseDialogComponent implements OnInit {
|
|
355
|
+
id: undefined | number;
|
|
356
|
+
openedAsModal: boolean;
|
|
357
|
+
canEdit: boolean;
|
|
358
|
+
redirectAfterSave: boolean;
|
|
359
|
+
form: FormGroup;
|
|
360
|
+
model: i0.WritableSignal<TDbModel | undefined>;
|
|
361
|
+
isNew: i0.WritableSignal<boolean>;
|
|
362
|
+
protected abstract _repo: BaseDbApiService<TDbModel, TCreateDto, TUpdateDto, TResponseDto>;
|
|
363
|
+
protected abstract _route: string;
|
|
364
|
+
protected router: Router;
|
|
365
|
+
protected activatedRoute: ActivatedRoute;
|
|
366
|
+
protected toastr: MessageService;
|
|
367
|
+
protected constructor();
|
|
368
|
+
ngOnInit(): void;
|
|
369
|
+
submitForm(): Promise<void>;
|
|
370
|
+
deleteData(): void;
|
|
371
|
+
getFormControl(property: string): FormControl | undefined;
|
|
372
|
+
goBack(retVal?: IDisplayModalReturnObject): void;
|
|
373
|
+
private _loadData;
|
|
374
|
+
protected abstract initializeForm(): FormGroup;
|
|
375
|
+
protected abstract getNewModel(): TDbModel;
|
|
376
|
+
protected abstract mapFormToUpdateDto(): TUpdateDto;
|
|
377
|
+
protected abstract mapFormToCreateDto(): TCreateDto;
|
|
378
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaseDisplayComponent<any, any, any, any>, never>;
|
|
379
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BaseDisplayComponent<any, any, any, any>, "lib-core-base-display", never, { "id": { "alias": "id"; "required": false; }; "openedAsModal": { "alias": "openedAsModal"; "required": false; }; "canEdit": { "alias": "canEdit"; "required": false; }; }, {}, never, never, true, never>;
|
|
380
|
+
}
|
|
381
|
+
interface IDisplayModalReturnObject {
|
|
382
|
+
operation: 'create' | 'update' | 'delete' | 'aborted';
|
|
383
|
+
data?: IBaseDbModel;
|
|
384
|
+
id?: number;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
declare class FormErrorDisplayComponent {
|
|
388
|
+
control: i0.InputSignal<AbstractControl<any, any, any> | undefined>;
|
|
389
|
+
label: i0.InputSignal<string | undefined>;
|
|
390
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormErrorDisplayComponent, never>;
|
|
391
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormErrorDisplayComponent, "sftech-form-error-display", never, { "control": { "alias": "control"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
declare class PaginatorComponent {
|
|
395
|
+
pagination: ODataPagination;
|
|
396
|
+
odataChanged: EventEmitter<ODataPagination>;
|
|
397
|
+
onPageChange(event: PaginatorState): void;
|
|
398
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PaginatorComponent, never>;
|
|
399
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PaginatorComponent, "sftech-paginator", never, { "pagination": { "alias": "pagination"; "required": false; }; }, { "odataChanged": "odataChanged"; }, never, never, true, never>;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
declare class NotPermittedComponent {
|
|
403
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NotPermittedComponent, never>;
|
|
404
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NotPermittedComponent, "sftech-not-permitted", never, {}, {}, never, never, true, never>;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
export { BaseDbApiService, BaseDbModel, BaseDialogComponent, BaseDisplayComponent, BaseDisplayModalComponent, BaseListComponent, EFilterOperator, EFilterTypes, ESortDirection, FilterConcatenation, FormErrorDisplayComponent, HeadMainFooterWithCanvasComponent, IconProvider, MappedApiError, MappedApiResponse, MappedApiResponseRaw, MappedOdataResponse, MappedOdataResponseData, NotPermittedComponent, OData, ODataOrder, ODataPagination, OdataExpands, OdataFilter, OdataFilterCollection, PaginatorComponent, SfTechPreset, SidebarNavigationComponent, loadConfig };
|
|
408
|
+
export type { IApiErrorResponse, IApiResponse, IAppConfig, IBaseDbCreateDto, IBaseDbModel, IBaseDbResponseDto, IBaseDbUpdateDto, IBaseResponseDto, IDisplayModalReturnObject, IOdata, IOdataResponseDto, IOdataResponsePaginationDto, ISidebarNavigationCategory, ISidebarNavigationLink };
|
package/package.json
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sftech/ng-shared",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"dependencies": {
|
|
5
|
-
"@fortawesome/angular-fontawesome": "^1.0.0",
|
|
6
|
-
"@fortawesome/free-solid-svg-icons": "^6.7.2",
|
|
7
|
-
"tslib": "^2.3.0"
|
|
8
|
-
},
|
|
3
|
+
"version": "0.0.23",
|
|
9
4
|
"peerDependencies": {
|
|
10
|
-
"@angular/common": ">=
|
|
11
|
-
"@angular/core": ">=
|
|
5
|
+
"@angular/common": ">=20.3.0",
|
|
6
|
+
"@angular/core": ">=20.3.0",
|
|
7
|
+
"@fortawesome/angular-fontawesome": ">=3.0.0",
|
|
8
|
+
"@fortawesome/free-solid-svg-icons": ">=6.7.0"
|
|
12
9
|
},
|
|
13
10
|
"sideEffects": false,
|
|
14
11
|
"module": "fesm2022/sftech-ng-shared.mjs",
|
|
@@ -21,5 +18,8 @@
|
|
|
21
18
|
"types": "./index.d.ts",
|
|
22
19
|
"default": "./fesm2022/sftech-ng-shared.mjs"
|
|
23
20
|
}
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"tslib": "^2.3.0"
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { AbstractControl } from '@angular/forms';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class FormErrorDisplayComponent {
|
|
4
|
-
control: import("@angular/core").InputSignal<AbstractControl<any, any> | undefined>;
|
|
5
|
-
label: import("@angular/core").InputSignal<string | undefined>;
|
|
6
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<FormErrorDisplayComponent, never>;
|
|
7
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FormErrorDisplayComponent, "sftech-form-error-display", never, { "control": { "alias": "control"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
8
|
-
}
|
package/lib/components/pages/base-display/base-display-modal/base-display-modal.component.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
export declare class BaseDisplayModalComponent {
|
|
3
|
-
id: number | undefined;
|
|
4
|
-
canEdit: boolean;
|
|
5
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<BaseDisplayModalComponent, never>;
|
|
6
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<BaseDisplayModalComponent, "lib-prompt-display-modal", never, {}, {}, never, never, true, never>;
|
|
7
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { OnInit } from '@angular/core';
|
|
2
|
-
import { FormControl, FormGroup } from '@angular/forms';
|
|
3
|
-
import { ActivatedRoute, Router } from '@angular/router';
|
|
4
|
-
import { MessageService } from 'primeng/api';
|
|
5
|
-
import { IBaseDbCreateDto } from '../../../core/dtos/base-db-create.dto';
|
|
6
|
-
import { IBaseDbResponseDto } from '../../../core/dtos/base-db-response.dto';
|
|
7
|
-
import { IBaseDbUpdateDto } from '../../../core/dtos/base-db-update.dto';
|
|
8
|
-
import { BaseDbModel, IBaseDbModel } from '../../../core/models/base-db.model';
|
|
9
|
-
import { BaseDbApiService } from '../../../core/services/base-db-api.service';
|
|
10
|
-
import { BaseDialogComponent } from '../../../ui/layouts/base-dialog/base-dialog.component';
|
|
11
|
-
import * as i0 from "@angular/core";
|
|
12
|
-
export declare abstract class BaseDisplayComponent<TDbModel extends BaseDbModel, TCreateDto extends IBaseDbCreateDto, TUpdateDto extends IBaseDbUpdateDto, TResponseDto extends IBaseDbResponseDto> extends BaseDialogComponent implements OnInit {
|
|
13
|
-
id: undefined | number;
|
|
14
|
-
openedAsModal: boolean;
|
|
15
|
-
canEdit: boolean;
|
|
16
|
-
redirectAfterSave: boolean;
|
|
17
|
-
form: FormGroup;
|
|
18
|
-
model: import("@angular/core").WritableSignal<TDbModel | undefined>;
|
|
19
|
-
isNew: import("@angular/core").WritableSignal<boolean>;
|
|
20
|
-
protected abstract _repo: BaseDbApiService<TDbModel, TCreateDto, TUpdateDto, TResponseDto>;
|
|
21
|
-
protected abstract _route: string;
|
|
22
|
-
protected router: Router;
|
|
23
|
-
protected activatedRoute: ActivatedRoute;
|
|
24
|
-
protected toastr: MessageService;
|
|
25
|
-
protected constructor();
|
|
26
|
-
ngOnInit(): void;
|
|
27
|
-
submitForm(): Promise<void>;
|
|
28
|
-
deleteData(): void;
|
|
29
|
-
getFormControl(property: string): FormControl | undefined;
|
|
30
|
-
goBack(retVal?: IDisplayModalReturnObject): void;
|
|
31
|
-
private _loadData;
|
|
32
|
-
protected abstract initializeForm(): FormGroup;
|
|
33
|
-
protected abstract getNewModel(): TDbModel;
|
|
34
|
-
protected abstract mapFormToUpdateDto(): TUpdateDto;
|
|
35
|
-
protected abstract mapFormToCreateDto(): TCreateDto;
|
|
36
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<BaseDisplayComponent<any, any, any, any>, never>;
|
|
37
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<BaseDisplayComponent<any, any, any, any>, "lib-core-base-display", never, { "id": { "alias": "id"; "required": false; }; "openedAsModal": { "alias": "openedAsModal"; "required": false; }; "canEdit": { "alias": "canEdit"; "required": false; }; }, {}, never, never, true, never>;
|
|
38
|
-
}
|
|
39
|
-
export interface IDisplayModalReturnObject {
|
|
40
|
-
operation: 'create' | 'update' | 'delete' | 'aborted';
|
|
41
|
-
data?: IBaseDbModel;
|
|
42
|
-
id?: number;
|
|
43
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { OnInit } from '@angular/core';
|
|
2
|
-
import { Router } from '@angular/router';
|
|
3
|
-
import { IBaseDbCreateDto } from '../../core/dtos/base-db-create.dto';
|
|
4
|
-
import { IBaseDbResponseDto } from '../../core/dtos/base-db-response.dto';
|
|
5
|
-
import { IBaseDbUpdateDto } from '../../core/dtos/base-db-update.dto';
|
|
6
|
-
import { BaseDbModel } from '../../core/models/base-db.model';
|
|
7
|
-
import { ODataPagination } from '../../core/models/odata/odata-pagination.model';
|
|
8
|
-
import { OData } from '../../core/models/odata/odata.model';
|
|
9
|
-
import { BaseDbApiService } from '../../core/services/base-db-api.service';
|
|
10
|
-
import { BaseDisplayModalComponent } from './base-display/base-display-modal/base-display-modal.component';
|
|
11
|
-
import * as i0 from "@angular/core";
|
|
12
|
-
export declare abstract class BaseListComponent<TDbModel extends BaseDbModel, TCreateDto extends IBaseDbCreateDto, TUpdateDto extends IBaseDbUpdateDto, TResponseDto extends IBaseDbResponseDto> implements OnInit {
|
|
13
|
-
odata: import("@angular/core").ModelSignal<OData>;
|
|
14
|
-
showPageTitle: import("@angular/core").InputSignal<boolean>;
|
|
15
|
-
canEdit: import("@angular/core").InputSignal<boolean>;
|
|
16
|
-
openDisplayAsModal: import("@angular/core").InputSignal<boolean>;
|
|
17
|
-
modalWidth: string;
|
|
18
|
-
data: import("@angular/core").WritableSignal<TDbModel[] | undefined>;
|
|
19
|
-
protected router: Router;
|
|
20
|
-
private modalService;
|
|
21
|
-
protected abstract _repo: BaseDbApiService<TDbModel, TCreateDto, TUpdateDto, TResponseDto>;
|
|
22
|
-
protected abstract _route: string;
|
|
23
|
-
protected detailModalHeaderText: string;
|
|
24
|
-
protected _modalComponent?: typeof BaseDisplayModalComponent;
|
|
25
|
-
constructor();
|
|
26
|
-
ngOnInit(): void;
|
|
27
|
-
updatePagination($event: ODataPagination): void;
|
|
28
|
-
openDisplay(id?: number): void;
|
|
29
|
-
private _loadData;
|
|
30
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<BaseListComponent<any, any, any, any>, never>;
|
|
31
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<BaseListComponent<any, any, any, any>, "sftech-pages-base-list", never, { "odata": { "alias": "odata"; "required": false; "isSignal": true; }; "showPageTitle": { "alias": "showPageTitle"; "required": false; "isSignal": true; }; "canEdit": { "alias": "canEdit"; "required": false; "isSignal": true; }; "openDisplayAsModal": { "alias": "openDisplayAsModal"; "required": false; "isSignal": true; }; }, { "odata": "odataChange"; }, never, never, true, never>;
|
|
32
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from '@angular/core';
|
|
2
|
-
import { PaginatorState } from 'primeng/paginator';
|
|
3
|
-
import { ODataPagination } from '../../core/models/odata/odata-pagination.model';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class PaginatorComponent {
|
|
6
|
-
pagination: ODataPagination;
|
|
7
|
-
odataChanged: EventEmitter<ODataPagination>;
|
|
8
|
-
onPageChange(event: PaginatorState): void;
|
|
9
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<PaginatorComponent, never>;
|
|
10
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<PaginatorComponent, "sftech-paginator", never, { "pagination": { "alias": "pagination"; "required": false; }; }, { "odataChanged": "odataChanged"; }, never, never, true, never>;
|
|
11
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type IBaseResponseDto = object;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { IBaseDbResponseDto } from "./base-db-response.dto";
|
|
2
|
-
export interface IOdataResponsePaginationDto {
|
|
3
|
-
totalPages: number;
|
|
4
|
-
pageSize: number;
|
|
5
|
-
totalElements: number;
|
|
6
|
-
page: number;
|
|
7
|
-
isFirstPage: boolean;
|
|
8
|
-
isLastPage: boolean;
|
|
9
|
-
}
|
|
10
|
-
export interface IOdataResponseDto<TDbDto extends IBaseDbResponseDto | unknown> {
|
|
11
|
-
items: TDbDto[];
|
|
12
|
-
pagination: IOdataResponsePaginationDto;
|
|
13
|
-
}
|