@tft/crispr-forms 13.0.15 → 13.0.18

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.
@@ -1,12 +1,13 @@
1
- import { ViewContainerRef, Renderer2, OnInit } from '@angular/core';
1
+ import { ViewContainerRef, Renderer2, OnInit, ChangeDetectorRef } from '@angular/core';
2
2
  import { FormGroup } from '@angular/forms';
3
- import type { AnyFieldConfig, ControlValue } from './models';
3
+ import { AnyFieldConfig, ControlValue } from './models';
4
4
  import { CrisprFieldComponent } from './field-component-map.const';
5
5
  import * as i0 from "@angular/core";
6
6
  import * as i1 from "@angular/common";
7
7
  export declare class CrisprFieldDirective implements OnInit {
8
8
  private container;
9
9
  private renderer;
10
+ private cdr;
10
11
  config: AnyFieldConfig;
11
12
  group: FormGroup;
12
13
  /**
@@ -16,8 +17,9 @@ export declare class CrisprFieldDirective implements OnInit {
16
17
  set value(value: ControlValue | any[]);
17
18
  get value(): ControlValue | any[];
18
19
  component: CrisprFieldComponent;
19
- constructor(container: ViewContainerRef, renderer: Renderer2);
20
+ constructor(container: ViewContainerRef, renderer: Renderer2, cdr: ChangeDetectorRef);
20
21
  ngOnInit(): Promise<void>;
22
+ updateComponentValue(value: ControlValue | any[]): void;
21
23
  static ɵfac: i0.ɵɵFactoryDeclaration<CrisprFieldDirective, never>;
22
24
  static ɵdir: i0.ɵɵDirectiveDeclaration<CrisprFieldDirective, "[crisprField]", never, { "config": "config"; "group": "group"; "value": "value"; }, {}, never>;
23
25
  }
@@ -1,7 +1,7 @@
1
1
  import { EventEmitter, ElementRef, OnInit } from '@angular/core';
2
2
  import { FormGroup } from '@angular/forms';
3
3
  import { ControlGroupValue, FormConfig } from '../models';
4
- import { Subscription, Observable } from 'rxjs';
4
+ import { Observable } from 'rxjs';
5
5
  import * as i0 from "@angular/core";
6
6
  export declare class CrisprFormComponent implements OnInit {
7
7
  config: FormConfig;
@@ -10,7 +10,6 @@ export declare class CrisprFormComponent implements OnInit {
10
10
  submitted: EventEmitter<FormGroup>;
11
11
  valueChanges: Observable<any>;
12
12
  statusChanges: Observable<string>;
13
- subs: Subscription[];
14
13
  submitTrigger: ElementRef<HTMLButtonElement>;
15
14
  ngOnInit(): void;
16
15
  handleSubmit(): void;
@@ -20,10 +20,16 @@ export declare class FormGroupListComponent extends FormGroupListMixin implement
20
20
  defaultConfig: Partial<FormGroupListConfig>;
21
21
  group: FormGroup;
22
22
  control: FormArray;
23
- formArray: FormArray;
23
+ /**
24
+ * By setting this to true when adding/removing items from array,
25
+ * we can block original values from overwriting form values
26
+ * */
27
+ blockValue: boolean;
24
28
  constructor(cdr: ChangeDetectorRef);
25
29
  ngOnInit(): void;
26
30
  setControlValue(values: any[]): void;
31
+ clickDelete(index: number): void;
32
+ clickAdd(): void;
27
33
  addGroup(value?: any): void;
28
34
  deleteGroup(index: number): void;
29
35
  static ɵfac: i0.ɵɵFactoryDeclaration<FormGroupListComponent, never>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tft/crispr-forms",
3
- "version": "13.0.15",
3
+ "version": "13.0.18",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^13.0.0",
6
6
  "@angular/forms": "^13.0.0",
Binary file
Binary file