@sumaris-net/ngx-components 1.23.36 → 1.23.38
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/bundles/sumaris-net.ngx-components.umd.js +27 -19
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
- package/esm2015/src/app/core/form/form.utils.js +27 -19
- package/esm2015/src/app/shared/forms.js +2 -2
- package/fesm2015/sumaris-net.ngx-components.js +27 -19
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/src/app/core/form/form.utils.d.ts +16 -13
- package/src/app/shared/forms.d.ts +1 -1
- package/sumaris-net.ngx-components.metadata.json +1 -1
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import { AbstractControl, FormArray, FormBuilder, FormGroup, ValidatorFn } from
|
|
|
2
2
|
import { Entity } from '../services/model/entity.model';
|
|
3
3
|
import { filterNumberInput, selectInputContent } from '../../shared/inputs';
|
|
4
4
|
import { WaitForOptions } from '../../shared/observables';
|
|
5
|
-
import {
|
|
5
|
+
import { pushValueInArray, clearValueInArray, copyEntity2Form, disableControls, getControlFromPath, getFormErrors, getFormValueFromEntity, logFormErrors, markAllAsTouched, markAsUntouched, removeValueInArray, resizeArray, updateValueAndValidity, waitIdle, waitWhilePending } from '../../shared/forms';
|
|
6
6
|
export declare type IAppFormGetter = () => IAppForm;
|
|
7
7
|
export declare interface OnReady {
|
|
8
8
|
ngOnReady(): any;
|
|
@@ -180,22 +180,35 @@ export declare class AppFormProvider<F extends IAppForm = IAppForm> implements I
|
|
|
180
180
|
export interface FormArrayHelperOptions {
|
|
181
181
|
allowEmptyArray: boolean;
|
|
182
182
|
validators?: ValidatorFn[];
|
|
183
|
+
helperProperty?: boolean;
|
|
183
184
|
}
|
|
184
185
|
export declare class FormArrayHelper<T = Entity<any>, C extends AbstractControl = AbstractControl> {
|
|
185
186
|
private readonly _formArray;
|
|
186
187
|
private createControl;
|
|
187
188
|
private equals;
|
|
188
189
|
private isEmpty;
|
|
190
|
+
static FORMA_HELPER_PROPERTY: string;
|
|
189
191
|
static getOrCreateArray(formBuilder: FormBuilder, form: FormGroup, arrayName: string): FormArray;
|
|
192
|
+
static hasHelper(formArray: FormArray): formArray is FormArray & {
|
|
193
|
+
_helper: FormArrayHelper<any>;
|
|
194
|
+
};
|
|
190
195
|
private _allowEmptyArray;
|
|
191
196
|
private readonly _validators;
|
|
192
197
|
get allowEmptyArray(): boolean;
|
|
193
198
|
set allowEmptyArray(value: boolean);
|
|
194
199
|
get formArray(): FormArray;
|
|
195
200
|
constructor(_formArray: FormArray, createControl: (value?: T) => C, equals: (v1: T, v2: T) => boolean, isEmpty: (value: T) => boolean, options?: FormArrayHelperOptions);
|
|
201
|
+
/**
|
|
202
|
+
* @param value
|
|
203
|
+
* @param options
|
|
204
|
+
* @deprecated Use push() instead
|
|
205
|
+
*/
|
|
196
206
|
add(value?: T, options?: {
|
|
197
207
|
emitEvent: boolean;
|
|
198
208
|
}): boolean;
|
|
209
|
+
push(value?: T, options?: {
|
|
210
|
+
emitEvent: boolean;
|
|
211
|
+
}): boolean;
|
|
199
212
|
removeAt(index: number): boolean;
|
|
200
213
|
resize(length: number): boolean;
|
|
201
214
|
clearAt(index: number): boolean;
|
|
@@ -203,22 +216,12 @@ export declare class FormArrayHelper<T = Entity<any>, C extends AbstractControl
|
|
|
203
216
|
removeAllEmpty(): void;
|
|
204
217
|
size(): number;
|
|
205
218
|
at(index: number): C;
|
|
206
|
-
/**
|
|
207
|
-
* Resize the FormArray, then set values
|
|
208
|
-
* @param values
|
|
209
|
-
* @param opts
|
|
210
|
-
*/
|
|
211
|
-
setValue(values: T[], opts?: {
|
|
212
|
-
onlySelf?: boolean;
|
|
213
|
-
emitEvent?: boolean;
|
|
214
|
-
}): void;
|
|
215
219
|
/**
|
|
216
220
|
* Resize the FormArray, then patch values
|
|
217
221
|
* @param data
|
|
218
222
|
* @param opts
|
|
219
223
|
*/
|
|
220
|
-
patchValue(
|
|
221
|
-
onlySelf?: boolean;
|
|
224
|
+
patchValue(values: T[], opts?: {
|
|
222
225
|
emitEvent?: boolean;
|
|
223
226
|
}): void;
|
|
224
227
|
disable(opts?: {
|
|
@@ -256,7 +259,7 @@ export declare class AppFormUtils {
|
|
|
256
259
|
static updateValueAndValidity: typeof updateValueAndValidity;
|
|
257
260
|
static getFormErrors: typeof getFormErrors;
|
|
258
261
|
static isForm(object: any): object is IAppForm;
|
|
259
|
-
static addValueInArray: typeof
|
|
262
|
+
static addValueInArray: typeof pushValueInArray;
|
|
260
263
|
static removeValueInArray: typeof removeValueInArray;
|
|
261
264
|
static resizeArray: typeof resizeArray;
|
|
262
265
|
static clearValueInArray: typeof clearValueInArray;
|
|
@@ -36,7 +36,7 @@ export declare function disableControls(form: FormGroup, paths: string[], opts?:
|
|
|
36
36
|
onlySelf?: boolean;
|
|
37
37
|
emitEvent?: boolean;
|
|
38
38
|
}): void;
|
|
39
|
-
export declare function
|
|
39
|
+
export declare function pushValueInArray(arrayControl: FormArray, createControl: (value?: any) => AbstractControl, equals: (v1: any, v2: any) => boolean, isEmpty: (value: any) => boolean, value: any, options?: {
|
|
40
40
|
emitEvent: boolean;
|
|
41
41
|
}): boolean;
|
|
42
42
|
export declare function resizeArray(arrayControl: FormArray, createControl: () => AbstractControl, length: number): boolean;
|