angular-base-lib 19.0.5 → 20.0.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.
- package/fesm2022/angular-base-lib.mjs +98 -14
- package/fesm2022/angular-base-lib.mjs.map +1 -1
- package/index.d.ts +274 -1
- package/package.json +5 -5
- package/lib/auth/base-auth.service.d.ts +0 -24
- package/lib/auth/guards/index.d.ts +0 -2
- package/lib/auth/guards/logged-in.guard.d.ts +0 -2
- package/lib/auth/guards/logged-out.guard.d.ts +0 -2
- package/lib/auth/index.d.ts +0 -3
- package/lib/auth/models/base-auth-state.d.ts +0 -5
- package/lib/auth/models/index.d.ts +0 -5
- package/lib/auth/models/logged-in-auth-state.d.ts +0 -7
- package/lib/auth/models/login-state.type.d.ts +0 -1
- package/lib/auth/models/not-logged-in-auth-state.d.ts +0 -6
- package/lib/auth/models/pending-auth-state.d.ts +0 -6
- package/lib/base/base-control-value-accessor.d.ts +0 -18
- package/lib/base/index.d.ts +0 -2
- package/lib/base/signal-base-control-value-accessor.d.ts +0 -20
- package/lib/dao/converted-http-base-dao.d.ts +0 -16
- package/lib/dao/converted-promise-http-base-dao.d.ts +0 -15
- package/lib/dao/converter.d.ts +0 -4
- package/lib/dao/dao-id.d.ts +0 -1
- package/lib/dao/http-base-dao-options.d.ts +0 -6
- package/lib/dao/http-base-dao.d.ts +0 -12
- package/lib/dao/index.d.ts +0 -8
- package/lib/dao/interfaces/identifiable.d.ts +0 -4
- package/lib/dao/interfaces/index.d.ts +0 -1
- package/lib/dao/internal/internal-http-base-dao.d.ts +0 -16
- package/lib/dao/promise-http-base-dao.d.ts +0 -11
- package/lib/forms/form-util.d.ts +0 -6
- package/lib/forms/index.d.ts +0 -1
- package/lib/index.d.ts +0 -8
- package/lib/model-component/action/index.d.ts +0 -2
- package/lib/model-component/action/model-action.d.ts +0 -5
- package/lib/model-component/action/model-action.type.d.ts +0 -1
- package/lib/model-component/base-model-detail.component.d.ts +0 -17
- package/lib/model-component/base-model-edit.component.d.ts +0 -5
- package/lib/model-component/base-model-list.component.d.ts +0 -11
- package/lib/model-component/base-model.component.d.ts +0 -10
- package/lib/model-component/base.component.d.ts +0 -6
- package/lib/model-component/index.d.ts +0 -5
- package/lib/navigation/back-button.directive.d.ts +0 -7
- package/lib/navigation/index.d.ts +0 -2
- package/lib/navigation/navigation.service.d.ts +0 -11
- package/lib/types/index.d.ts +0 -1
- package/lib/types/value-change-callback.type.d.ts +0 -1
- package/lib/util/index.d.ts +0 -3
- package/lib/util/is-nil.d.ts +0 -1
- package/lib/util/prepare-optional-string.d.ts +0 -1
- package/lib/util/remove-nil-values-recursively.d.ts +0 -1
package/index.d.ts
CHANGED
|
@@ -1 +1,274 @@
|
|
|
1
|
-
|
|
1
|
+
import { Router, CanActivateFn } from '@angular/router';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { AfterViewInit, OnDestroy } from '@angular/core';
|
|
4
|
+
import { Identifiable as Identifiable$1, DaoId as DaoId$1 } from 'angular-base-dao';
|
|
5
|
+
import { FormGroup, ControlValueAccessor } from '@angular/forms';
|
|
6
|
+
import { Observable } from 'rxjs';
|
|
7
|
+
import { HttpHeaders, HttpClient } from '@angular/common/http';
|
|
8
|
+
|
|
9
|
+
declare class NavigationService {
|
|
10
|
+
private history;
|
|
11
|
+
private readonly router;
|
|
12
|
+
private readonly location;
|
|
13
|
+
constructor();
|
|
14
|
+
reset(): void;
|
|
15
|
+
back(fallbackRoute?: string): void;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NavigationService, never>;
|
|
17
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<NavigationService>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
type ModelActionType = 'show' | 'delete' | 'edit' | 'download' | 'back_to-list';
|
|
21
|
+
|
|
22
|
+
interface ModelAction<T> {
|
|
23
|
+
readonly action: ModelActionType;
|
|
24
|
+
readonly model: T;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
declare abstract class BaseModelDetailComponent<TM extends Identifiable$1> {
|
|
28
|
+
protected baseRoute: string;
|
|
29
|
+
model: TM | null;
|
|
30
|
+
protected readonly router: Router;
|
|
31
|
+
protected readonly navigationService: NavigationService;
|
|
32
|
+
protected constructor(baseRoute: string);
|
|
33
|
+
handleModelAction(modelAction: ModelAction<TM>): void;
|
|
34
|
+
showList(): void;
|
|
35
|
+
editModel(): Promise<void>;
|
|
36
|
+
deleteModel(): Promise<void>;
|
|
37
|
+
goBack(): void;
|
|
38
|
+
abstract handleDeleteModel(model: TM): Promise<boolean>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
declare abstract class BaseComponent {
|
|
42
|
+
backRoute: string;
|
|
43
|
+
protected readonly navigationService: NavigationService;
|
|
44
|
+
goBack(): void;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
declare abstract class BaseModelComponent<TM> extends BaseComponent {
|
|
48
|
+
protected baseRoute: string;
|
|
49
|
+
protected readonly router: Router;
|
|
50
|
+
protected constructor(baseRoute: string);
|
|
51
|
+
showList(): void;
|
|
52
|
+
handleModelAction(modelAction: ModelAction<TM>): void;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
declare abstract class BaseModelEditComponent<TM extends Identifiable$1> extends BaseModelComponent<TM> {
|
|
56
|
+
model: TM | null;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
declare abstract class BaseModelListComponent<TM extends Identifiable$1> extends BaseModelComponent<TM> {
|
|
60
|
+
protected constructor(baseRoute: string);
|
|
61
|
+
handleModelAction(modelAction: ModelAction<TM>): void;
|
|
62
|
+
showDetail(id: DaoId$1): void;
|
|
63
|
+
editModel(id: DaoId$1): void;
|
|
64
|
+
createModel(): void;
|
|
65
|
+
abstract deleteModel(model: TM): Promise<boolean>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
declare class BackButtonDirective {
|
|
69
|
+
private readonly navigation;
|
|
70
|
+
onClick(): void;
|
|
71
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BackButtonDirective, never>;
|
|
72
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BackButtonDirective, "[ngBackButton]", never, {}, {}, never, never, true, never>;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
declare class FormUtil {
|
|
76
|
+
static markAllControlsAsTouched(formGroup: FormGroup, recursive?: boolean): void;
|
|
77
|
+
static getUpdatedFormData(objectToAdd: any, oldData: any, newData: any): any;
|
|
78
|
+
static getDifferenceRecursively(oldData: any, newData: any): [any, boolean];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
type ValueChangeCallback<T> = (value: T) => void;
|
|
82
|
+
|
|
83
|
+
declare const prepareOptionalString: (value: string | null | undefined) => string | undefined;
|
|
84
|
+
|
|
85
|
+
declare const isNil: (obj: unknown) => boolean;
|
|
86
|
+
|
|
87
|
+
declare const removeNullValuesRecursively: (object: any) => any;
|
|
88
|
+
|
|
89
|
+
type LoginState = 'pending' | 'logged-in' | 'logged-out';
|
|
90
|
+
|
|
91
|
+
interface BaseAuthState<T> {
|
|
92
|
+
loginState: LoginState;
|
|
93
|
+
user: T | null;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
declare class PendingAuthState implements BaseAuthState<unknown> {
|
|
97
|
+
readonly loginState: LoginState;
|
|
98
|
+
readonly user: null;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
declare class LoggedInAuthState<T> implements BaseAuthState<T> {
|
|
102
|
+
readonly loginState: LoginState;
|
|
103
|
+
readonly user: T;
|
|
104
|
+
constructor(user: T);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
declare class NotLoggedInAuthState implements BaseAuthState<unknown> {
|
|
108
|
+
readonly loginState: LoginState;
|
|
109
|
+
readonly user: null;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
declare abstract class BaseAuthService<T> {
|
|
113
|
+
private readonly authStateSubject;
|
|
114
|
+
private readonly _authState$;
|
|
115
|
+
private readonly _loginState$;
|
|
116
|
+
private readonly _readyLoginState$;
|
|
117
|
+
private readonly _readyAuthState$;
|
|
118
|
+
private readonly _user$;
|
|
119
|
+
private readonly _readyUser$;
|
|
120
|
+
private readonly _isLoggedIn$;
|
|
121
|
+
private readonly defaultLoginRoute;
|
|
122
|
+
get authState$(): Observable<BaseAuthState<T>>;
|
|
123
|
+
get loginState$(): Observable<LoginState>;
|
|
124
|
+
get readyLoginState$(): Observable<LoginState>;
|
|
125
|
+
get readyAuthState$(): Observable<BaseAuthState<T>>;
|
|
126
|
+
get user$(): Observable<T | null>;
|
|
127
|
+
get readyUser$(): Observable<T | null>;
|
|
128
|
+
get isLoggedIn$(): Observable<boolean>;
|
|
129
|
+
get loginRoute(): string;
|
|
130
|
+
protected constructor();
|
|
131
|
+
protected userLoggedIn(user: T): void;
|
|
132
|
+
protected userLoggedOut(): void;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
declare const loggedInGuardFn: CanActivateFn;
|
|
136
|
+
|
|
137
|
+
declare const loggedOutGuardFn: CanActivateFn;
|
|
138
|
+
|
|
139
|
+
interface HttpBaseDaoOptions {
|
|
140
|
+
withCredentials?: boolean;
|
|
141
|
+
headers?: HttpHeaders;
|
|
142
|
+
}
|
|
143
|
+
declare const DEFAULT_OPTIONS: HttpBaseDaoOptions;
|
|
144
|
+
|
|
145
|
+
type DaoId = string | number;
|
|
146
|
+
|
|
147
|
+
declare abstract class InternalHttpBaseDao<TI> {
|
|
148
|
+
protected readonly http: HttpClient;
|
|
149
|
+
protected readonly options: HttpBaseDaoOptions;
|
|
150
|
+
protected readonly routeUrl: string;
|
|
151
|
+
protected constructor(routeUrl: string, options?: HttpBaseDaoOptions);
|
|
152
|
+
protected listInternal(customOptions?: HttpBaseDaoOptions): Observable<TI[]>;
|
|
153
|
+
protected createInternal(data: object, customOptions?: HttpBaseDaoOptions): Observable<TI>;
|
|
154
|
+
protected updateInternal(id: DaoId, data: object, customOptions?: HttpBaseDaoOptions): Observable<TI>;
|
|
155
|
+
protected deleteInternal(id: DaoId, customOptions?: HttpBaseDaoOptions): Observable<TI>;
|
|
156
|
+
protected readInternal(id: DaoId, customOptions?: HttpBaseDaoOptions): Observable<TI>;
|
|
157
|
+
private mergeCustomOptions;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
declare abstract class HttpBaseDao<TI> extends InternalHttpBaseDao<TI> {
|
|
161
|
+
protected constructor(routeUrl: string, options?: HttpBaseDaoOptions);
|
|
162
|
+
list(customOptions?: HttpBaseDaoOptions): Observable<TI[]>;
|
|
163
|
+
create(entry: Partial<TI>, customOptions?: HttpBaseDaoOptions): Observable<TI>;
|
|
164
|
+
update(id: DaoId, entry: Partial<TI>, customOptions?: HttpBaseDaoOptions): Observable<TI>;
|
|
165
|
+
delete(id: DaoId, customOptions?: HttpBaseDaoOptions): Observable<TI>;
|
|
166
|
+
read(id: DaoId, customOptions?: HttpBaseDaoOptions): Observable<TI>;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
declare abstract class PromiseHttpBaseDao<TI> extends InternalHttpBaseDao<TI> {
|
|
170
|
+
protected constructor(routeUrl: string, options?: HttpBaseDaoOptions);
|
|
171
|
+
list(customOptions?: HttpBaseDaoOptions): Promise<TI[]>;
|
|
172
|
+
create(data: object, customOptions?: HttpBaseDaoOptions): Promise<TI>;
|
|
173
|
+
update(id: DaoId, data: object, customOptions?: HttpBaseDaoOptions): Promise<TI>;
|
|
174
|
+
delete(id: DaoId, customOptions?: HttpBaseDaoOptions): Promise<TI>;
|
|
175
|
+
read(id: DaoId, customOptions?: HttpBaseDaoOptions): Promise<TI>;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
declare abstract class Converter<TI, TM> {
|
|
179
|
+
abstract fromJson(response: TI): TM;
|
|
180
|
+
abstract toJson(model: Partial<TM>): Partial<TI>;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
declare abstract class ConvertedHttpBaseDao<TI, TM> extends InternalHttpBaseDao<TI> {
|
|
184
|
+
protected readonly converter: Converter<TI, TM>;
|
|
185
|
+
protected constructor(routeUrl: string, converter: Converter<TI, TM>, options?: HttpBaseDaoOptions);
|
|
186
|
+
list(customOptions?: HttpBaseDaoOptions): Observable<TM[]>;
|
|
187
|
+
create(entry: TM, customOptions?: HttpBaseDaoOptions): Observable<TM>;
|
|
188
|
+
update(id: DaoId, entry: Partial<TM>, customOptions?: HttpBaseDaoOptions): Observable<TM>;
|
|
189
|
+
delete(id: DaoId, customOptions?: HttpBaseDaoOptions): Observable<TM>;
|
|
190
|
+
read(id: DaoId, customOptions?: HttpBaseDaoOptions): Observable<TM>;
|
|
191
|
+
private mapServerInterfaceListToModelList;
|
|
192
|
+
private mapServerInterfaceToModel;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
declare abstract class ConvertedPromiseHttpBaseDao<TI, TM> extends InternalHttpBaseDao<TI> {
|
|
196
|
+
protected readonly converter: Converter<TI, TM>;
|
|
197
|
+
protected constructor(routeUrl: string, converter: Converter<TI, TM>, options?: HttpBaseDaoOptions);
|
|
198
|
+
list(customOptions?: HttpBaseDaoOptions): Promise<TM[]>;
|
|
199
|
+
create(entry: TM, customOptions?: HttpBaseDaoOptions): Promise<TM>;
|
|
200
|
+
update(id: DaoId, entry: Partial<TM>, customOptions?: HttpBaseDaoOptions): Promise<TM>;
|
|
201
|
+
delete(id: DaoId, customOptions?: HttpBaseDaoOptions): Promise<TM>;
|
|
202
|
+
read(id: DaoId, customOptions?: HttpBaseDaoOptions): Promise<TM>;
|
|
203
|
+
private mapServerInterfaceListToModelList;
|
|
204
|
+
private mapServerInterfaceToModel;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
interface Identifiable<T extends DaoId = DaoId> {
|
|
208
|
+
id: T;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
declare abstract class BaseControlValueAccessor<T = string> implements ControlValueAccessor {
|
|
212
|
+
valueChanged: i0.OutputEmitterRef<T>;
|
|
213
|
+
onChange: ValueChangeCallback<T> | null;
|
|
214
|
+
onTouched: VoidFunction | null;
|
|
215
|
+
disabled: boolean;
|
|
216
|
+
protected _value: T;
|
|
217
|
+
get value(): T;
|
|
218
|
+
set value(value: T);
|
|
219
|
+
writeValue(value: T): void;
|
|
220
|
+
registerOnChange(onChange: ValueChangeCallback<T>): void;
|
|
221
|
+
registerOnTouched(onTouched: VoidFunction): void;
|
|
222
|
+
setDisabledState(isDisabled: boolean): void;
|
|
223
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaseControlValueAccessor<any>, never>;
|
|
224
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseControlValueAccessor<any>, never, never, { "value": { "alias": "value"; "required": false; }; }, { "valueChanged": "valueChanged"; }, never, never, true, never>;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
declare abstract class SignalBaseControlValueAccessor<T = string> implements ControlValueAccessor {
|
|
228
|
+
protected onChange: ValueChangeCallback<T> | null;
|
|
229
|
+
protected onTouched: VoidFunction | null;
|
|
230
|
+
value: i0.ModelSignal<T | undefined>;
|
|
231
|
+
readonly disabled: i0.WritableSignal<boolean>;
|
|
232
|
+
/**
|
|
233
|
+
* Function that will be called by the input to update the value of the form-control and the model
|
|
234
|
+
* @param value The new input value passed by $event in the template
|
|
235
|
+
*/
|
|
236
|
+
valueChanged(value: T): void;
|
|
237
|
+
writeValue(value: T): void;
|
|
238
|
+
registerOnChange(onChange: ValueChangeCallback<T>): void;
|
|
239
|
+
registerOnTouched(onTouched: VoidFunction): void;
|
|
240
|
+
setDisabledState(disabled: boolean): void;
|
|
241
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SignalBaseControlValueAccessor<any>, never>;
|
|
242
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SignalBaseControlValueAccessor<any>, never, never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
type SizingMode = 'fit-content' | 'match-parent';
|
|
246
|
+
|
|
247
|
+
declare class NgAspectRatioDirective implements AfterViewInit, OnDestroy {
|
|
248
|
+
private readonly renderer;
|
|
249
|
+
private readonly hostElem;
|
|
250
|
+
private readonly observer;
|
|
251
|
+
ngAspectRatio: i0.InputSignal<number>;
|
|
252
|
+
sizingMode: i0.InputSignal<SizingMode>;
|
|
253
|
+
containerWidthChanged: i0.OutputEmitterRef<number>;
|
|
254
|
+
containerHeightChanged: i0.OutputEmitterRef<number>;
|
|
255
|
+
private readonly targetRatio;
|
|
256
|
+
constructor();
|
|
257
|
+
ngAfterViewInit(): void;
|
|
258
|
+
ngOnDestroy(): void;
|
|
259
|
+
calculateAndSetAspect(): void;
|
|
260
|
+
private setAcInnerWidth;
|
|
261
|
+
private setAcInnerHeight;
|
|
262
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgAspectRatioDirective, never>;
|
|
263
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgAspectRatioDirective, "[ngAspectRatio]", never, { "ngAspectRatio": { "alias": "ngAspectRatio"; "required": true; "isSignal": true; }; "sizingMode": { "alias": "sizingMode"; "required": false; "isSignal": true; }; }, { "containerWidthChanged": "containerWidthChanged"; "containerHeightChanged": "containerHeightChanged"; }, never, never, true, never>;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
type VerticalAlignment = 'center' | 'top' | 'bottom';
|
|
267
|
+
|
|
268
|
+
type HorizontalAlignment = 'center' | 'left' | 'right';
|
|
269
|
+
|
|
270
|
+
type FlexAlignment = 'center' | 'flex-start' | 'flex-end';
|
|
271
|
+
declare const alignmentFlexMapping: Map<"center" | "top" | "bottom" | "left" | "right", FlexAlignment>;
|
|
272
|
+
|
|
273
|
+
export { BackButtonDirective, BaseAuthService, BaseComponent, BaseControlValueAccessor, BaseModelComponent, BaseModelDetailComponent, BaseModelEditComponent, BaseModelListComponent, ConvertedHttpBaseDao, ConvertedPromiseHttpBaseDao, Converter, DEFAULT_OPTIONS, FormUtil, HttpBaseDao, LoggedInAuthState, NavigationService, NgAspectRatioDirective, NotLoggedInAuthState, PendingAuthState, PromiseHttpBaseDao, SignalBaseControlValueAccessor, alignmentFlexMapping, isNil, loggedInGuardFn, loggedOutGuardFn, prepareOptionalString, removeNullValuesRecursively };
|
|
274
|
+
export type { BaseAuthState, DaoId, FlexAlignment, HorizontalAlignment, HttpBaseDaoOptions, Identifiable, LoginState, SizingMode, ValueChangeCallback, VerticalAlignment };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "angular-base-lib",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "20.0.0",
|
|
4
4
|
"description": "Angular dao-feature, auth, model-components, navigation-service and other abstract helpers",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"directory": "libs/angular-base"
|
|
10
10
|
},
|
|
11
11
|
"peerDependencies": {
|
|
12
|
-
"@angular/common": "^
|
|
13
|
-
"@angular/core": "^
|
|
14
|
-
"@angular/router": "^
|
|
15
|
-
"@angular/forms": "^
|
|
12
|
+
"@angular/common": "^20.0.0",
|
|
13
|
+
"@angular/core": "^20.0.0",
|
|
14
|
+
"@angular/router": "^20.0.0",
|
|
15
|
+
"@angular/forms": "^20.0.0",
|
|
16
16
|
"rxjs": "~7.8.1"
|
|
17
17
|
},
|
|
18
18
|
"sideEffects": false,
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { BaseAuthState, LoginState } from './models';
|
|
3
|
-
export declare abstract class BaseAuthService<T> {
|
|
4
|
-
private readonly authStateSubject;
|
|
5
|
-
private readonly _authState$;
|
|
6
|
-
private readonly _loginState$;
|
|
7
|
-
private readonly _readyLoginState$;
|
|
8
|
-
private readonly _readyAuthState$;
|
|
9
|
-
private readonly _user$;
|
|
10
|
-
private readonly _readyUser$;
|
|
11
|
-
private readonly _isLoggedIn$;
|
|
12
|
-
private readonly defaultLoginRoute;
|
|
13
|
-
get authState$(): Observable<BaseAuthState<T>>;
|
|
14
|
-
get loginState$(): Observable<LoginState>;
|
|
15
|
-
get readyLoginState$(): Observable<LoginState>;
|
|
16
|
-
get readyAuthState$(): Observable<BaseAuthState<T>>;
|
|
17
|
-
get user$(): Observable<T | null>;
|
|
18
|
-
get readyUser$(): Observable<T | null>;
|
|
19
|
-
get isLoggedIn$(): Observable<boolean>;
|
|
20
|
-
get loginRoute(): string;
|
|
21
|
-
protected constructor();
|
|
22
|
-
protected userLoggedIn(user: T): void;
|
|
23
|
-
protected userLoggedOut(): void;
|
|
24
|
-
}
|
package/lib/auth/index.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { BaseAuthState } from './base-auth-state';
|
|
2
|
-
export { LoginState } from './login-state.type';
|
|
3
|
-
export { PendingAuthState } from './pending-auth-state';
|
|
4
|
-
export { LoggedInAuthState } from './logged-in-auth-state';
|
|
5
|
-
export { NotLoggedInAuthState } from './not-logged-in-auth-state';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type LoginState = 'pending' | 'logged-in' | 'logged-out';
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ControlValueAccessor } from '@angular/forms';
|
|
2
|
-
import { ValueChangeCallback } from '../types/value-change-callback.type';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare abstract class BaseControlValueAccessor<T = string> implements ControlValueAccessor {
|
|
5
|
-
valueChanged: import("@angular/core").OutputEmitterRef<T>;
|
|
6
|
-
onChange: ValueChangeCallback<T> | null;
|
|
7
|
-
onTouched: VoidFunction | null;
|
|
8
|
-
disabled: boolean;
|
|
9
|
-
protected _value: T;
|
|
10
|
-
get value(): T;
|
|
11
|
-
set value(value: T);
|
|
12
|
-
writeValue(value: T): void;
|
|
13
|
-
registerOnChange(onChange: ValueChangeCallback<T>): void;
|
|
14
|
-
registerOnTouched(onTouched: VoidFunction): void;
|
|
15
|
-
setDisabledState(isDisabled: boolean): void;
|
|
16
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<BaseControlValueAccessor<any>, never>;
|
|
17
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseControlValueAccessor<any>, never, never, { "value": { "alias": "value"; "required": false; }; }, { "valueChanged": "valueChanged"; }, never, never, true, never>;
|
|
18
|
-
}
|
package/lib/base/index.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ControlValueAccessor } from '@angular/forms';
|
|
2
|
-
import { ValueChangeCallback } from '../types/value-change-callback.type';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare abstract class SignalBaseControlValueAccessor<T = string> implements ControlValueAccessor {
|
|
5
|
-
protected onChange: ValueChangeCallback<T> | null;
|
|
6
|
-
protected onTouched: VoidFunction | null;
|
|
7
|
-
value: import("@angular/core").ModelSignal<T | undefined>;
|
|
8
|
-
readonly disabled: import("@angular/core").WritableSignal<boolean>;
|
|
9
|
-
/**
|
|
10
|
-
* Function that will be called by the input to update the value of the form-control and the model
|
|
11
|
-
* @param value The new input value passed by $event in the template
|
|
12
|
-
*/
|
|
13
|
-
valueChanged(value: T): void;
|
|
14
|
-
writeValue(value: T): void;
|
|
15
|
-
registerOnChange(onChange: ValueChangeCallback<T>): void;
|
|
16
|
-
registerOnTouched(onTouched: VoidFunction): void;
|
|
17
|
-
setDisabledState(disabled: boolean): void;
|
|
18
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<SignalBaseControlValueAccessor<any>, never>;
|
|
19
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<SignalBaseControlValueAccessor<any>, never, never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
|
|
20
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { HttpBaseDaoOptions } from './http-base-dao-options';
|
|
3
|
-
import { DaoId } from './dao-id';
|
|
4
|
-
import { InternalHttpBaseDao } from './internal/internal-http-base-dao';
|
|
5
|
-
import { Converter } from './converter';
|
|
6
|
-
export declare abstract class ConvertedHttpBaseDao<TI, TM> extends InternalHttpBaseDao<TI> {
|
|
7
|
-
protected readonly converter: Converter<TI, TM>;
|
|
8
|
-
protected constructor(routeUrl: string, converter: Converter<TI, TM>, options?: HttpBaseDaoOptions);
|
|
9
|
-
list(customOptions?: HttpBaseDaoOptions): Observable<TM[]>;
|
|
10
|
-
create(entry: TM, customOptions?: HttpBaseDaoOptions): Observable<TM>;
|
|
11
|
-
update(id: DaoId, entry: Partial<TM>, customOptions?: HttpBaseDaoOptions): Observable<TM>;
|
|
12
|
-
delete(id: DaoId, customOptions?: HttpBaseDaoOptions): Observable<TM>;
|
|
13
|
-
read(id: DaoId, customOptions?: HttpBaseDaoOptions): Observable<TM>;
|
|
14
|
-
private mapServerInterfaceListToModelList;
|
|
15
|
-
private mapServerInterfaceToModel;
|
|
16
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { HttpBaseDaoOptions } from './http-base-dao-options';
|
|
2
|
-
import { DaoId } from './dao-id';
|
|
3
|
-
import { InternalHttpBaseDao } from './internal/internal-http-base-dao';
|
|
4
|
-
import { Converter } from './converter';
|
|
5
|
-
export declare abstract class ConvertedPromiseHttpBaseDao<TI, TM> extends InternalHttpBaseDao<TI> {
|
|
6
|
-
protected readonly converter: Converter<TI, TM>;
|
|
7
|
-
protected constructor(routeUrl: string, converter: Converter<TI, TM>, options?: HttpBaseDaoOptions);
|
|
8
|
-
list(customOptions?: HttpBaseDaoOptions): Promise<TM[]>;
|
|
9
|
-
create(entry: TM, customOptions?: HttpBaseDaoOptions): Promise<TM>;
|
|
10
|
-
update(id: DaoId, entry: Partial<TM>, customOptions?: HttpBaseDaoOptions): Promise<TM>;
|
|
11
|
-
delete(id: DaoId, customOptions?: HttpBaseDaoOptions): Promise<TM>;
|
|
12
|
-
read(id: DaoId, customOptions?: HttpBaseDaoOptions): Promise<TM>;
|
|
13
|
-
private mapServerInterfaceListToModelList;
|
|
14
|
-
private mapServerInterfaceToModel;
|
|
15
|
-
}
|
package/lib/dao/converter.d.ts
DELETED
package/lib/dao/dao-id.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type DaoId = string | number;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { HttpBaseDaoOptions } from './http-base-dao-options';
|
|
3
|
-
import { DaoId } from './dao-id';
|
|
4
|
-
import { InternalHttpBaseDao } from './internal/internal-http-base-dao';
|
|
5
|
-
export declare abstract class HttpBaseDao<TI> extends InternalHttpBaseDao<TI> {
|
|
6
|
-
protected constructor(routeUrl: string, options?: HttpBaseDaoOptions);
|
|
7
|
-
list(customOptions?: HttpBaseDaoOptions): Observable<TI[]>;
|
|
8
|
-
create(entry: Partial<TI>, customOptions?: HttpBaseDaoOptions): Observable<TI>;
|
|
9
|
-
update(id: DaoId, entry: Partial<TI>, customOptions?: HttpBaseDaoOptions): Observable<TI>;
|
|
10
|
-
delete(id: DaoId, customOptions?: HttpBaseDaoOptions): Observable<TI>;
|
|
11
|
-
read(id: DaoId, customOptions?: HttpBaseDaoOptions): Observable<TI>;
|
|
12
|
-
}
|
package/lib/dao/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { DEFAULT_OPTIONS, HttpBaseDaoOptions } from './http-base-dao-options';
|
|
2
|
-
export { HttpBaseDao } from './http-base-dao';
|
|
3
|
-
export { PromiseHttpBaseDao } from './promise-http-base-dao';
|
|
4
|
-
export { ConvertedHttpBaseDao } from './converted-http-base-dao';
|
|
5
|
-
export { ConvertedPromiseHttpBaseDao } from './converted-promise-http-base-dao';
|
|
6
|
-
export { Converter } from './converter';
|
|
7
|
-
export { DaoId } from './dao-id';
|
|
8
|
-
export * from './interfaces';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Identifiable } from './identifiable';
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { HttpClient } from '@angular/common/http';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { HttpBaseDaoOptions } from '../http-base-dao-options';
|
|
4
|
-
import { DaoId } from '../dao-id';
|
|
5
|
-
export declare abstract class InternalHttpBaseDao<TI> {
|
|
6
|
-
protected readonly http: HttpClient;
|
|
7
|
-
protected readonly options: HttpBaseDaoOptions;
|
|
8
|
-
protected readonly routeUrl: string;
|
|
9
|
-
protected constructor(routeUrl: string, options?: HttpBaseDaoOptions);
|
|
10
|
-
protected listInternal(customOptions?: HttpBaseDaoOptions): Observable<TI[]>;
|
|
11
|
-
protected createInternal(data: object, customOptions?: HttpBaseDaoOptions): Observable<TI>;
|
|
12
|
-
protected updateInternal(id: DaoId, data: object, customOptions?: HttpBaseDaoOptions): Observable<TI>;
|
|
13
|
-
protected deleteInternal(id: DaoId, customOptions?: HttpBaseDaoOptions): Observable<TI>;
|
|
14
|
-
protected readInternal(id: DaoId, customOptions?: HttpBaseDaoOptions): Observable<TI>;
|
|
15
|
-
private mergeCustomOptions;
|
|
16
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { HttpBaseDaoOptions } from './http-base-dao-options';
|
|
2
|
-
import { DaoId } from './dao-id';
|
|
3
|
-
import { InternalHttpBaseDao } from './internal/internal-http-base-dao';
|
|
4
|
-
export declare abstract class PromiseHttpBaseDao<TI> extends InternalHttpBaseDao<TI> {
|
|
5
|
-
protected constructor(routeUrl: string, options?: HttpBaseDaoOptions);
|
|
6
|
-
list(customOptions?: HttpBaseDaoOptions): Promise<TI[]>;
|
|
7
|
-
create(data: object, customOptions?: HttpBaseDaoOptions): Promise<TI>;
|
|
8
|
-
update(id: DaoId, data: object, customOptions?: HttpBaseDaoOptions): Promise<TI>;
|
|
9
|
-
delete(id: DaoId, customOptions?: HttpBaseDaoOptions): Promise<TI>;
|
|
10
|
-
read(id: DaoId, customOptions?: HttpBaseDaoOptions): Promise<TI>;
|
|
11
|
-
}
|
package/lib/forms/form-util.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { FormGroup } from '@angular/forms';
|
|
2
|
-
export declare class FormUtil {
|
|
3
|
-
static markAllControlsAsTouched(formGroup: FormGroup, recursive?: boolean): void;
|
|
4
|
-
static getUpdatedFormData(objectToAdd: any, oldData: any, newData: any): any;
|
|
5
|
-
static getDifferenceRecursively(oldData: any, newData: any): [any, boolean];
|
|
6
|
-
}
|
package/lib/forms/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { FormUtil } from './form-util';
|
package/lib/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type ModelActionType = 'show' | 'delete' | 'edit' | 'download' | 'back_to-list';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Router } from '@angular/router';
|
|
2
|
-
import { NavigationService } from '../navigation/navigation.service';
|
|
3
|
-
import { ModelAction } from './action';
|
|
4
|
-
import { Identifiable } from 'angular-base-dao';
|
|
5
|
-
export declare abstract class BaseModelDetailComponent<TM extends Identifiable> {
|
|
6
|
-
protected baseRoute: string;
|
|
7
|
-
model: TM | null;
|
|
8
|
-
protected readonly router: Router;
|
|
9
|
-
protected readonly navigationService: NavigationService;
|
|
10
|
-
protected constructor(baseRoute: string);
|
|
11
|
-
handleModelAction(modelAction: ModelAction<TM>): void;
|
|
12
|
-
showList(): void;
|
|
13
|
-
editModel(): Promise<void>;
|
|
14
|
-
deleteModel(): Promise<void>;
|
|
15
|
-
goBack(): void;
|
|
16
|
-
abstract handleDeleteModel(model: TM): Promise<boolean>;
|
|
17
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { BaseModelComponent } from './base-model.component';
|
|
2
|
-
import { ModelAction } from './action';
|
|
3
|
-
import { DaoId, Identifiable } from 'angular-base-dao';
|
|
4
|
-
export declare abstract class BaseModelListComponent<TM extends Identifiable> extends BaseModelComponent<TM> {
|
|
5
|
-
protected constructor(baseRoute: string);
|
|
6
|
-
handleModelAction(modelAction: ModelAction<TM>): void;
|
|
7
|
-
showDetail(id: DaoId): void;
|
|
8
|
-
editModel(id: DaoId): void;
|
|
9
|
-
createModel(): void;
|
|
10
|
-
abstract deleteModel(model: TM): Promise<boolean>;
|
|
11
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Router } from '@angular/router';
|
|
2
|
-
import { BaseComponent } from './base.component';
|
|
3
|
-
import { ModelAction } from './action';
|
|
4
|
-
export declare abstract class BaseModelComponent<TM> extends BaseComponent {
|
|
5
|
-
protected baseRoute: string;
|
|
6
|
-
protected readonly router: Router;
|
|
7
|
-
protected constructor(baseRoute: string);
|
|
8
|
-
showList(): void;
|
|
9
|
-
handleModelAction(modelAction: ModelAction<TM>): void;
|
|
10
|
-
}
|