@rxdi/forms 0.7.146 → 0.7.147

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.
@@ -43,7 +43,7 @@ export declare class FormGroup<T = FormInputOptions, E = {
43
43
  set value(value: T);
44
44
  unsubscribe(): void;
45
45
  getValue(name: keyof T): T[keyof T];
46
- setValue(name: keyof T, value: string | boolean | number): T;
46
+ setValue(name: keyof T, value: any): void;
47
47
  setFormValue(value: T): void;
48
48
  setFormElement(form: HTMLFormElement): this;
49
49
  setInputs(inputs: AbstractInput[]): void;
@@ -271,10 +271,11 @@ class FormGroup {
271
271
  return this.value[name];
272
272
  }
273
273
  setValue(name, value) {
274
+ const input = this.get(name);
275
+ input.value = value;
274
276
  const values = this.value;
275
277
  values[name] = value;
276
278
  this.value = values;
277
- return values;
278
279
  }
279
280
  setFormValue(value) {
280
281
  this.value = value;
@@ -284,7 +285,10 @@ class FormGroup {
284
285
  return this;
285
286
  }
286
287
  setInputs(inputs) {
287
- this.inputs = new Map(inputs.map(e => [e.name, e]));
288
+ this.inputs = new Map(inputs.map(e => {
289
+ e.value = this.getValue(e.name);
290
+ return [e.name, e];
291
+ }));
288
292
  }
289
293
  getFormElement() {
290
294
  return this.form;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rxdi/forms",
3
- "version": "0.7.146",
3
+ "version": "0.7.147",
4
4
  "main": "./dist/index.js",
5
5
  "author": "Kristiyan Tachev",
6
6
  "license": "MIT",
@@ -12,7 +12,7 @@
12
12
  "build": "tsc || true"
13
13
  },
14
14
  "devDependencies": {
15
- "@rxdi/lit-html": "^0.7.145",
15
+ "@rxdi/lit-html": "^0.7.146",
16
16
  "@types/node": "^12.0.10",
17
17
  "rxjs": "^6.5.3",
18
18
  "typescript": "^4.3.5"