ember-headless-form 1.1.0 → 1.1.1

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 (28) hide show
  1. package/dist/-private/components/control/checkbox-group/checkbox/input.js +1 -1
  2. package/dist/-private/components/control/checkbox-group/checkbox/input.js.map +1 -1
  3. package/dist/-private/components/control/checkbox-group/checkbox.js +1 -1
  4. package/dist/-private/components/control/checkbox-group/checkbox.js.map +1 -1
  5. package/dist/-private/components/control/checkbox-group/label.js.map +1 -1
  6. package/dist/-private/components/control/checkbox-group.js.map +1 -1
  7. package/dist/-private/components/control/checkbox.js +1 -1
  8. package/dist/-private/components/control/checkbox.js.map +1 -1
  9. package/dist/-private/components/control/input.js +1 -1
  10. package/dist/-private/components/control/input.js.map +1 -1
  11. package/dist/-private/components/control/radio-group/label.js.map +1 -1
  12. package/dist/-private/components/control/radio-group/radio/input.js.map +1 -1
  13. package/dist/-private/components/control/radio-group/radio.js.map +1 -1
  14. package/dist/-private/components/control/radio-group.js.map +1 -1
  15. package/dist/-private/components/control/select/option.js.map +1 -1
  16. package/dist/-private/components/control/select.js +1 -1
  17. package/dist/-private/components/control/select.js.map +1 -1
  18. package/dist/-private/components/control/textarea.js +1 -1
  19. package/dist/-private/components/control/textarea.js.map +1 -1
  20. package/dist/-private/components/errors.js.map +1 -1
  21. package/dist/-private/components/field.js +1 -1
  22. package/dist/-private/components/field.js.map +1 -1
  23. package/dist/-private/components/label.js.map +1 -1
  24. package/dist/-private/modifiers/capture-events.js.map +1 -1
  25. package/dist/-private/utils.js.map +1 -1
  26. package/dist/components/headless-form.js +10 -4
  27. package/dist/components/headless-form.js.map +1 -1
  28. package/package.json +3 -2
@@ -32,14 +32,14 @@ let FieldData = (_class = class FieldData {
32
32
  _defineProperty(this, "validate", void 0);
33
33
  this.validate = fieldRegistration.validate;
34
34
  }
35
- }, (_descriptor = _applyDecoratedDescriptor(_class.prototype, "validationEnabled", [tracked], {
35
+ }, _descriptor = _applyDecoratedDescriptor(_class.prototype, "validationEnabled", [tracked], {
36
36
  configurable: true,
37
37
  enumerable: true,
38
38
  writable: true,
39
39
  initializer: function () {
40
40
  return false;
41
41
  }
42
- })), _class);
42
+ }), _class);
43
43
  /**
44
44
  * Headless form component.
45
45
  *
@@ -294,6 +294,12 @@ let HeadlessFormComponent = setComponentTemplate(precompileTemplate(`
294
294
  }
295
295
  async onSubmit(e) {
296
296
  e?.preventDefault();
297
+ if (this.validationState?.isPending) {
298
+ warn('Async validation is pending, form will not be submitted', {
299
+ id: 'headless-form.prevent-submit-pending-async-validation'
300
+ });
301
+ return;
302
+ }
297
303
  await this._validate();
298
304
  this.showAllValidations = true;
299
305
  if (!this.hasValidationErrors) {
@@ -379,7 +385,7 @@ let HeadlessFormComponent = setComponentTemplate(precompileTemplate(`
379
385
  });
380
386
  }
381
387
  }
382
- }, (_applyDecoratedDescriptor(_class3.prototype, "effectiveData", [cached], Object.getOwnPropertyDescriptor(_class3.prototype, "effectiveData"), _class3.prototype), _descriptor2 = _applyDecoratedDescriptor(_class3.prototype, "validationState", [tracked], {
388
+ }, _applyDecoratedDescriptor(_class3.prototype, "effectiveData", [cached], Object.getOwnPropertyDescriptor(_class3.prototype, "effectiveData"), _class3.prototype), _descriptor2 = _applyDecoratedDescriptor(_class3.prototype, "validationState", [tracked], {
383
389
  configurable: true,
384
390
  enumerable: true,
385
391
  writable: true,
@@ -396,7 +402,7 @@ let HeadlessFormComponent = setComponentTemplate(precompileTemplate(`
396
402
  initializer: function () {
397
403
  return false;
398
404
  }
399
- }), _applyDecoratedDescriptor(_class3.prototype, "onSubmit", [action], Object.getOwnPropertyDescriptor(_class3.prototype, "onSubmit"), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, "onReset", [action], Object.getOwnPropertyDescriptor(_class3.prototype, "onReset"), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, "registerField", [action], Object.getOwnPropertyDescriptor(_class3.prototype, "registerField"), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, "unregisterField", [action], Object.getOwnPropertyDescriptor(_class3.prototype, "unregisterField"), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, "set", [action], Object.getOwnPropertyDescriptor(_class3.prototype, "set"), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, "handleFieldValidation", [action], Object.getOwnPropertyDescriptor(_class3.prototype, "handleFieldValidation"), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, "handleFieldRevalidation", [action], Object.getOwnPropertyDescriptor(_class3.prototype, "handleFieldRevalidation"), _class3.prototype)), _class3));
405
+ }), _applyDecoratedDescriptor(_class3.prototype, "onSubmit", [action], Object.getOwnPropertyDescriptor(_class3.prototype, "onSubmit"), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, "onReset", [action], Object.getOwnPropertyDescriptor(_class3.prototype, "onReset"), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, "registerField", [action], Object.getOwnPropertyDescriptor(_class3.prototype, "registerField"), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, "unregisterField", [action], Object.getOwnPropertyDescriptor(_class3.prototype, "unregisterField"), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, "set", [action], Object.getOwnPropertyDescriptor(_class3.prototype, "set"), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, "handleFieldValidation", [action], Object.getOwnPropertyDescriptor(_class3.prototype, "handleFieldValidation"), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, "handleFieldRevalidation", [action], Object.getOwnPropertyDescriptor(_class3.prototype, "handleFieldRevalidation"), _class3.prototype), _class3));
400
406
 
401
407
  export { HeadlessFormComponent as default };
402
408
  //# sourceMappingURL=headless-form.js.map