@sumaris-net/ngx-components 2.7.6 → 2.8.0-rc1
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/doc/changelog.md +7 -0
- package/esm2022/public_api.mjs +5 -3
- package/esm2022/src/app/admin/users/users.mjs +3 -3
- package/esm2022/src/app/core/account/new-token.modal.mjs +4 -4
- package/esm2022/src/app/core/auth/auth.form.mjs +2 -2
- package/esm2022/src/app/core/form/entity/editor.class.mjs +33 -487
- package/esm2022/src/app/core/form/entity/entity-editor-modal.class.mjs +14 -26
- package/esm2022/src/app/core/form/entity/entity-editor.class.mjs +5 -4
- package/esm2022/src/app/core/form/entity/tab-editor.class.mjs +194 -0
- package/esm2022/src/app/core/form/form-container.class.mjs +312 -0
- package/esm2022/src/app/core/form/form.class.mjs +27 -36
- package/esm2022/src/app/core/form/form.utils.mjs +1 -1
- package/esm2022/src/app/core/menu/testing/menu.testing.mjs +2 -2
- package/esm2022/src/app/core/settings/settings.page.mjs +5 -9
- package/esm2022/src/app/shared/validator/validators.mjs +3 -2
- package/fesm2022/sumaris-net.ngx-components.mjs +283 -268
- package/fesm2022/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/public_api.d.ts +4 -2
- package/src/app/core/account/new-token.modal.d.ts +1 -1
- package/src/app/core/form/entity/editor.class.d.ts +18 -177
- package/src/app/core/form/entity/entity-editor-modal.class.d.ts +9 -12
- package/src/app/core/form/entity/entity-editor.class.d.ts +10 -6
- package/src/app/core/form/entity/tab-editor.class.d.ts +70 -0
- package/src/app/core/form/form-container.class.d.ts +123 -0
- package/src/app/core/form/form.class.d.ts +11 -21
- package/src/app/core/form/form.utils.d.ts +38 -23
- package/src/app/core/menu/testing/menu.testing.d.ts +1 -1
- package/src/app/core/settings/settings.page.d.ts +1 -2
- package/src/app/shared/validator/validators.d.ts +1 -0
- package/src/assets/manifest.json +1 -1
|
@@ -8,38 +8,22 @@ import { FormErrorTranslator, FormErrorTranslatorOptions, IFormControlPathTransl
|
|
|
8
8
|
import { TranslateService } from '@ngx-translate/core';
|
|
9
9
|
import { MatAutocompleteConfigHolder, MatAutocompleteFieldAddOptions, MatAutocompleteFieldConfig } from '../../shared/material/autocomplete/material.autocomplete.config';
|
|
10
10
|
import * as i0 from "@angular/core";
|
|
11
|
-
export declare class AppForm<T> implements IAppForm
|
|
11
|
+
export declare class AppForm<T> implements IAppForm<T>, OnInit, OnDestroy, IFormControlPathTranslator {
|
|
12
12
|
private _subscription;
|
|
13
13
|
protected _form: UntypedFormGroup;
|
|
14
|
-
protected
|
|
14
|
+
protected _enabled: boolean;
|
|
15
15
|
protected errorTranslator: FormErrorTranslator;
|
|
16
16
|
protected i18nFieldPrefix: string;
|
|
17
17
|
protected readonly translate: TranslateService;
|
|
18
18
|
protected readonly settings: LocalSettingsService;
|
|
19
19
|
protected readonly destroySubject: Subject<void>;
|
|
20
|
+
readonly readySubject: BehaviorSubject<boolean>;
|
|
21
|
+
readonly loadingSubject: BehaviorSubject<boolean>;
|
|
22
|
+
readonly errorSubject: BehaviorSubject<string>;
|
|
20
23
|
readonly autocompleteHelper: MatAutocompleteConfigHolder;
|
|
21
24
|
readonly autocompleteFields: {
|
|
22
25
|
[key: string]: MatAutocompleteFieldConfig;
|
|
23
26
|
};
|
|
24
|
-
readonly readySubject: BehaviorSubject<boolean>;
|
|
25
|
-
readonly loadingSubject: BehaviorSubject<boolean>;
|
|
26
|
-
readonly errorSubject: BehaviorSubject<string>;
|
|
27
|
-
/**
|
|
28
|
-
* @deprecated
|
|
29
|
-
*/
|
|
30
|
-
protected set _loading(value: boolean);
|
|
31
|
-
/**
|
|
32
|
-
* @deprecated
|
|
33
|
-
*/
|
|
34
|
-
protected get _loading(): boolean;
|
|
35
|
-
/**
|
|
36
|
-
* @deprecated
|
|
37
|
-
*/
|
|
38
|
-
protected get _$ready(): BehaviorSubject<boolean>;
|
|
39
|
-
/**
|
|
40
|
-
* @deprecated
|
|
41
|
-
*/
|
|
42
|
-
protected get _$loading(): BehaviorSubject<boolean>;
|
|
43
27
|
get error(): string;
|
|
44
28
|
set error(error: string);
|
|
45
29
|
get loading(): boolean;
|
|
@@ -55,6 +39,11 @@ export declare class AppForm<T> implements IAppForm, OnInit, OnDestroy, IFormCon
|
|
|
55
39
|
get untouched(): boolean;
|
|
56
40
|
get enabled(): boolean;
|
|
57
41
|
get disabled(): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* @deprecated
|
|
44
|
+
*/
|
|
45
|
+
protected get _enable(): boolean;
|
|
46
|
+
protected set _enable(value: boolean);
|
|
58
47
|
disable(opts?: {
|
|
59
48
|
onlySelf?: boolean;
|
|
60
49
|
emitEvent?: boolean;
|
|
@@ -84,6 +73,7 @@ export declare class AppForm<T> implements IAppForm, OnInit, OnDestroy, IFormCon
|
|
|
84
73
|
checkValid?: boolean;
|
|
85
74
|
}): Promise<void>;
|
|
86
75
|
setForm(form: UntypedFormGroup): void;
|
|
76
|
+
getValue(): Promise<T> | T;
|
|
87
77
|
setValue(data: T, opts?: {
|
|
88
78
|
emitEvent?: boolean;
|
|
89
79
|
onlySelf?: boolean;
|
|
@@ -7,7 +7,7 @@ export declare type IAppFormGetter = () => IAppForm;
|
|
|
7
7
|
export declare interface OnReady {
|
|
8
8
|
ngOnReady(): any;
|
|
9
9
|
}
|
|
10
|
-
export interface IAppForm {
|
|
10
|
+
export interface IAppForm<T = any> {
|
|
11
11
|
invalid: boolean;
|
|
12
12
|
valid: boolean;
|
|
13
13
|
dirty: boolean;
|
|
@@ -17,49 +17,64 @@ export interface IAppForm {
|
|
|
17
17
|
disabled: boolean;
|
|
18
18
|
touched: boolean;
|
|
19
19
|
untouched: boolean;
|
|
20
|
+
disable(opts?: {
|
|
21
|
+
onlySelf?: boolean;
|
|
22
|
+
emitEvent?: boolean;
|
|
23
|
+
}): void;
|
|
24
|
+
enable(opts?: {
|
|
25
|
+
onlySelf?: boolean;
|
|
26
|
+
emitEvent?: boolean;
|
|
27
|
+
}): void;
|
|
20
28
|
empty?: boolean;
|
|
21
29
|
loading?: boolean;
|
|
30
|
+
loaded?: boolean;
|
|
31
|
+
destroyed?: boolean;
|
|
22
32
|
ready(): Promise<void>;
|
|
23
33
|
waitIdle(opts?: WaitForOptions): Promise<any>;
|
|
24
|
-
|
|
34
|
+
setValue?: (data: T, opts?: {
|
|
25
35
|
onlySelf?: boolean;
|
|
26
36
|
emitEvent?: boolean;
|
|
27
|
-
})
|
|
28
|
-
|
|
37
|
+
}) => Promise<void> | void;
|
|
38
|
+
patchValue?: (data: T, opts?: {
|
|
39
|
+
onlySelf?: boolean;
|
|
40
|
+
emitEvent?: boolean;
|
|
41
|
+
}) => Promise<void> | void;
|
|
42
|
+
reset?: (data?: T, opts?: {
|
|
29
43
|
onlySelf?: boolean;
|
|
30
44
|
emitEvent?: boolean;
|
|
31
|
-
})
|
|
45
|
+
}) => void;
|
|
46
|
+
getValue?: () => Promise<T> | T;
|
|
32
47
|
markAsPristine(opts?: {
|
|
33
48
|
onlySelf?: boolean;
|
|
34
49
|
emitEvent?: boolean;
|
|
35
|
-
}):
|
|
50
|
+
}): void;
|
|
36
51
|
markAsUntouched(opts?: {
|
|
37
52
|
onlySelf?: boolean;
|
|
38
53
|
emitEvent?: boolean;
|
|
39
|
-
}):
|
|
54
|
+
}): void;
|
|
40
55
|
markAsTouched(opts?: {
|
|
41
56
|
onlySelf?: boolean;
|
|
42
57
|
emitEvent?: boolean;
|
|
43
|
-
}):
|
|
58
|
+
}): void;
|
|
44
59
|
markAllAsTouched(opts?: {
|
|
45
60
|
emitEvent?: boolean;
|
|
46
|
-
}):
|
|
61
|
+
}): void;
|
|
47
62
|
markAsDirty(opts?: {
|
|
48
63
|
onlySelf?: boolean;
|
|
49
64
|
emitEvent?: boolean;
|
|
50
|
-
}):
|
|
65
|
+
}): void;
|
|
51
66
|
markAsLoading(opts?: {
|
|
52
67
|
onlySelf?: boolean;
|
|
53
68
|
emitEvent?: boolean;
|
|
54
|
-
}):
|
|
69
|
+
}): void;
|
|
55
70
|
markAsLoaded(opts?: {
|
|
56
71
|
onlySelf?: boolean;
|
|
57
72
|
emitEvent?: boolean;
|
|
58
|
-
}):
|
|
73
|
+
}): void;
|
|
59
74
|
markAsReady(opts?: {
|
|
60
75
|
onlySelf?: boolean;
|
|
61
76
|
emitEvent?: boolean;
|
|
62
|
-
}):
|
|
77
|
+
}): void;
|
|
63
78
|
}
|
|
64
79
|
/**
|
|
65
80
|
* A form that do nothing
|
|
@@ -140,42 +155,42 @@ export declare class AppFormProvider<F extends IAppForm = IAppForm> implements I
|
|
|
140
155
|
disable(opts?: {
|
|
141
156
|
onlySelf?: boolean;
|
|
142
157
|
emitEvent?: boolean;
|
|
143
|
-
}):
|
|
158
|
+
}): void;
|
|
144
159
|
enable(opts?: {
|
|
145
160
|
onlySelf?: boolean;
|
|
146
161
|
emitEvent?: boolean;
|
|
147
|
-
}):
|
|
162
|
+
}): void;
|
|
148
163
|
markAsPristine(opts?: {
|
|
149
164
|
onlySelf?: boolean;
|
|
150
165
|
emitEvent?: boolean;
|
|
151
|
-
}):
|
|
166
|
+
}): void;
|
|
152
167
|
markAsUntouched(opts?: {
|
|
153
168
|
onlySelf?: boolean;
|
|
154
169
|
emitEvent?: boolean;
|
|
155
|
-
}):
|
|
170
|
+
}): void;
|
|
156
171
|
markAsTouched(opts?: {
|
|
157
172
|
onlySelf?: boolean;
|
|
158
173
|
emitEvent?: boolean;
|
|
159
|
-
}):
|
|
174
|
+
}): void;
|
|
160
175
|
markAllAsTouched(opts?: {
|
|
161
176
|
emitEvent?: boolean;
|
|
162
|
-
}):
|
|
177
|
+
}): void;
|
|
163
178
|
markAsDirty(opts?: {
|
|
164
179
|
onlySelf?: boolean;
|
|
165
180
|
emitEvent?: boolean;
|
|
166
|
-
}):
|
|
181
|
+
}): void;
|
|
167
182
|
markAsLoading(opts?: {
|
|
168
183
|
onlySelf?: boolean;
|
|
169
184
|
emitEvent?: boolean;
|
|
170
|
-
}):
|
|
185
|
+
}): void;
|
|
171
186
|
markAsLoaded(opts?: {
|
|
172
187
|
onlySelf?: boolean;
|
|
173
188
|
emitEvent?: boolean;
|
|
174
|
-
}):
|
|
189
|
+
}): void;
|
|
175
190
|
markAsReady(opts?: {
|
|
176
191
|
onlySelf?: boolean;
|
|
177
192
|
emitEvent?: boolean;
|
|
178
|
-
}):
|
|
193
|
+
}): void;
|
|
179
194
|
}
|
|
180
195
|
export interface FormArrayHelperOptions {
|
|
181
196
|
allowEmptyArray: boolean;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AfterViewInit, EventEmitter, OnDestroy, OnInit } from '@angular/core';
|
|
2
2
|
import { MenuService } from '../menu.service';
|
|
3
|
-
import { AppTabEditor } from '../../form/entity/editor.class';
|
|
4
3
|
import { ActivatedRoute, Router } from '@angular/router';
|
|
5
4
|
import { AlertController, NavController } from '@ionic/angular';
|
|
6
5
|
import { TranslateService } from '@ngx-translate/core';
|
|
7
6
|
import { Subject } from 'rxjs';
|
|
8
7
|
import { MatTabGroup } from '@angular/material/tabs';
|
|
8
|
+
import { AppTabEditor } from '../../form/entity/tab-editor.class';
|
|
9
9
|
import * as i0 from "@angular/core";
|
|
10
10
|
export declare class MenuTestingPage extends AppTabEditor implements OnInit, OnDestroy, AfterViewInit {
|
|
11
11
|
protected menuService: MenuService;
|
|
@@ -61,8 +61,7 @@ export declare class SettingsPage extends AppForm<LocalSettings> implements OnIn
|
|
|
61
61
|
close(_?: Event): Promise<boolean>;
|
|
62
62
|
clearCache(event?: Event): Promise<void>;
|
|
63
63
|
executeAction(event: Event, item: IMenuItem): Promise<void>;
|
|
64
|
-
|
|
65
|
-
protected getJsonValueToSave(): Promise<any>;
|
|
64
|
+
getValue(): Promise<LocalSettings>;
|
|
66
65
|
protected toggleDarkMode(): Promise<void>;
|
|
67
66
|
protected markForCheck(): void;
|
|
68
67
|
static ɵfac: i0.ɵɵFactoryDeclaration<SettingsPage, [null, null, null, null, null, null, null, null, null, null, null, null, { optional: true; }]>;
|
|
@@ -65,6 +65,7 @@ export declare class SharedFormGroupValidators {
|
|
|
65
65
|
static dateMinDuration(startDateField: string, endDateField: string, minDuration: number, durationUnit?: moment.unitOfTime.Diff): ValidatorFn;
|
|
66
66
|
static requiredIf(fieldName: string, anotherFieldToCheck: string | AbstractControl, opts?: {
|
|
67
67
|
fieldOnly?: boolean;
|
|
68
|
+
predicate?: (control: AbstractControl) => boolean;
|
|
68
69
|
}): ValidatorFn;
|
|
69
70
|
static requiredIfTrue(fieldName: string, anotherFieldToCheck: string | AbstractControl, opts?: {
|
|
70
71
|
fieldOnly?: boolean;
|
package/src/assets/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "ngx-sumaris-components",
|
|
3
3
|
"short_name": "ngx-sumaris-components",
|
|
4
4
|
"manifest_version": 1,
|
|
5
|
-
"version": "2.
|
|
5
|
+
"version": "2.8.0-rc1",
|
|
6
6
|
"default_locale": "fr",
|
|
7
7
|
"description": "Angular components for building beautiful and responsive Apps",
|
|
8
8
|
"icons": [{
|