@ngx-formly/core 5.10.28 → 5.10.29

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.
Files changed (35) hide show
  1. package/bundles/ngx-formly-core-json-schema.umd.js +6 -2
  2. package/bundles/ngx-formly-core-json-schema.umd.js.map +1 -1
  3. package/bundles/ngx-formly-core-json-schema.umd.min.js +1 -1
  4. package/bundles/ngx-formly-core-json-schema.umd.min.js.map +1 -1
  5. package/bundles/ngx-formly-core.umd.js +20 -47
  6. package/bundles/ngx-formly-core.umd.js.map +1 -1
  7. package/bundles/ngx-formly-core.umd.min.js +1 -1
  8. package/bundles/ngx-formly-core.umd.min.js.map +1 -1
  9. package/esm2015/json-schema/formly-json-schema.service.js +8 -4
  10. package/esm2015/lib/core.js +2 -2
  11. package/esm2015/lib/extensions/core/core.js +2 -1
  12. package/esm2015/lib/templates/formly.validation-message.js +14 -3
  13. package/esm2015/lib/utils.js +1 -22
  14. package/esm2015/ngx-formly-core.js +2 -2
  15. package/esm2015/public_api.js +2 -2
  16. package/esm5/json-schema/formly-json-schema.service.js +8 -4
  17. package/esm5/lib/core.js +2 -2
  18. package/esm5/lib/extensions/core/core.js +2 -1
  19. package/esm5/lib/templates/formly.validation-message.js +15 -3
  20. package/esm5/lib/utils.js +4 -36
  21. package/esm5/ngx-formly-core.js +2 -2
  22. package/esm5/public_api.js +2 -2
  23. package/fesm2015/ngx-formly-core-json-schema.js +7 -3
  24. package/fesm2015/ngx-formly-core-json-schema.js.map +1 -1
  25. package/fesm2015/ngx-formly-core.js +16 -26
  26. package/fesm2015/ngx-formly-core.js.map +1 -1
  27. package/fesm5/ngx-formly-core-json-schema.js +7 -3
  28. package/fesm5/ngx-formly-core-json-schema.js.map +1 -1
  29. package/fesm5/ngx-formly-core.js +19 -39
  30. package/fesm5/ngx-formly-core.js.map +1 -1
  31. package/json-schema/ngx-formly-core-json-schema.metadata.json +1 -1
  32. package/lib/core.d.ts +1 -1
  33. package/lib/utils.d.ts +0 -1
  34. package/ngx-formly-core.metadata.json +1 -1
  35. package/package.json +1 -1
@@ -196,50 +196,12 @@
196
196
  }
197
197
  model[paths[paths.length - 1]] = clone(value);
198
198
  }
199
- /**
200
- * @param {?} field
201
- * @return {?}
202
- */
203
- function getFieldInitialValue(field) {
204
- var e_1, _a;
205
- /** @type {?} */
206
- var value = field.options['_initialModel'];
207
- /** @type {?} */
208
- var paths = getKeyPath(field);
209
- while (field.parent) {
210
- field = field.parent;
211
- paths = __spread(getKeyPath(field), paths);
212
- }
213
- try {
214
- for (var paths_1 = __values(paths), paths_1_1 = paths_1.next(); !paths_1_1.done; paths_1_1 = paths_1.next()) {
215
- var path = paths_1_1.value;
216
- if (!value) {
217
- return undefined;
218
- }
219
- value = value[path];
220
- }
221
- }
222
- catch (e_1_1) {
223
- e_1 = { error: e_1_1 };
224
- }
225
- finally {
226
- try {
227
- if (paths_1_1 && !paths_1_1.done && (_a = paths_1.return))
228
- _a.call(paths_1);
229
- }
230
- finally {
231
- if (e_1)
232
- throw e_1.error;
233
- }
234
- }
235
- return value;
236
- }
237
199
  /**
238
200
  * @param {?} field
239
201
  * @return {?}
240
202
  */
241
203
  function getFieldValue(field) {
242
- var e_2, _a;
204
+ var e_1, _a;
243
205
  /** @type {?} */
244
206
  var model = field.parent.model;
245
207
  try {
@@ -251,8 +213,8 @@
251
213
  model = model[path];
252
214
  }
253
215
  }
254
- catch (e_2_1) {
255
- e_2 = { error: e_2_1 };
216
+ catch (e_1_1) {
217
+ e_1 = { error: e_1_1 };
256
218
  }
257
219
  finally {
258
220
  try {
@@ -260,8 +222,8 @@
260
222
  _a.call(_b);
261
223
  }
262
224
  finally {
263
- if (e_2)
264
- throw e_2.error;
225
+ if (e_1)
226
+ throw e_1.error;
265
227
  }
266
228
  }
267
229
  return model;
@@ -2570,9 +2532,19 @@
2570
2532
  */
2571
2533
  function () {
2572
2534
  var _this = this;
2573
- this.errorMessage$ = this.field.formControl.statusChanges.pipe(operators.startWith(null), operators.switchMap(( /**
2574
- * @return {?}
2575
- */function () {
2535
+ this.errorMessage$ = rxjs.merge(this.field.formControl.statusChanges, (!this.field.options
2536
+ ? rxjs.of(null)
2537
+ : this.field.options.fieldChanges.pipe(operators.filter(( /**
2538
+ * @param {?} __0
2539
+ * @return {?}
2540
+ */function (_a) {
2541
+ var field = _a.field, type = _a.type, property = _a.property;
2542
+ return (field === _this.field)
2543
+ && (type === 'expressionChanges')
2544
+ && (property.indexOf('validation') !== -1);
2545
+ }))))).pipe(operators.startWith(null), operators.switchMap(( /**
2546
+ * @return {?}
2547
+ */function () {
2576
2548
  return rxjs.isObservable(_this.errorMessage)
2577
2549
  ? _this.errorMessage
2578
2550
  : rxjs.of(_this.errorMessage);
@@ -3819,6 +3791,7 @@
3819
3791
  id: getFieldId("formly_" + this.formId, field, field['index']),
3820
3792
  hooks: {},
3821
3793
  modelOptions: {},
3794
+ validation: { messages: {} },
3822
3795
  templateOptions: !field.type || !field.key ? {} : {
3823
3796
  label: '',
3824
3797
  placeholder: '',
@@ -4063,7 +4036,7 @@
4063
4036
  exports.FormlyModule = FormlyModule;
4064
4037
  exports.ɵdefineHiddenProp = defineHiddenProp;
4065
4038
  exports.ɵreverseDeepMerge = reverseDeepMerge;
4066
- exports.ɵgetFieldInitialValue = getFieldInitialValue;
4039
+ exports.ɵgetFieldValue = getFieldValue;
4067
4040
  exports.ɵclone = clone;
4068
4041
  exports.ɵwrapProperty = wrapProperty;
4069
4042
  exports.ɵa = defaultFormlyConfig;