@rxap/forms 12.5.1-next.3 → 12.7.0

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.
@@ -1696,6 +1696,7 @@
1696
1696
  */
1697
1697
  _this.rxapSubmit = new i0.EventEmitter();
1698
1698
  _this.invalidSubmit = new i0.EventEmitter();
1699
+ _this.submitSuccessful$ = new i0.EventEmitter();
1699
1700
  _this.submitting$ = new rxjs$1.ToggleSubject();
1700
1701
  _this.submitError$ = new rxjs.BehaviorSubject(null);
1701
1702
  _this.loading$ = new rxjs$1.ToggleSubject();
@@ -2006,6 +2007,7 @@
2006
2007
  }
2007
2008
  };
2008
2009
  FormDirective.prototype.submitSuccessful = function (value) {
2010
+ this.submitSuccessful$.next(value);
2009
2011
  if (this.submitSuccessfulMethod) {
2010
2012
  this.submitSuccessfulMethod.call(value);
2011
2013
  }
@@ -2028,7 +2030,7 @@
2028
2030
  return FormDirective;
2029
2031
  }(i1.FormGroupDirective));
2030
2032
  FormDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: FormDirective, deps: [{ token: i0.ChangeDetectorRef }, { token: RXAP_FORM_DEFINITION, optional: true }, { token: RXAP_FORM_SUBMIT_METHOD, optional: true, skipSelf: true }, { token: RXAP_FORM_LOAD_METHOD, optional: true, skipSelf: true }, { token: RXAP_FORM_LOAD_FAILED_METHOD, optional: true, skipSelf: true }, { token: RXAP_FORM_LOAD_SUCCESSFUL_METHOD, optional: true, skipSelf: true }, { token: RXAP_FORM_SUBMIT_FAILED_METHOD, optional: true, skipSelf: true }, { token: RXAP_FORM_SUBMIT_SUCCESSFUL_METHOD, optional: true, skipSelf: true }, { token: RXAP_FORM_DEFINITION_BUILDER, optional: true, skipSelf: true }, { token: i2.LoadingIndicatorService, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Directive });
2031
- FormDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.1", type: FormDirective, selector: "form[rxapForm]:not([formGroup]):not([ngForm]),rxap-form,form[rxapForm]", inputs: { initial: "initial", useFormDefinition: ["rxapForm", "useFormDefinition"], submitMethod: "submitMethod" }, outputs: { ngSubmit: "ngSubmit", rxapSubmit: "rxapSubmit", invalidSubmit: "invalidSubmit" }, host: { listeners: { "reset": "onReset()" }, properties: { "class.rxap-submitting": "this.submitting", "class.rxap-submit-error": "this.submitError", "class.rxap-loading": "this.loading", "class.rxap-loaded": "this.loaded", "class.rxap-loading-error": "this.loadingError" } }, providers: [
2033
+ FormDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.1", type: FormDirective, selector: "form[rxapForm]:not([formGroup]):not([ngForm]),rxap-form,form[rxapForm]", inputs: { initial: "initial", useFormDefinition: ["rxapForm", "useFormDefinition"], submitMethod: "submitMethod" }, outputs: { ngSubmit: "ngSubmit", rxapSubmit: "rxapSubmit", invalidSubmit: "invalidSubmit", submitSuccessful$: "submitSuccessful" }, host: { listeners: { "reset": "onReset()" }, properties: { "class.rxap-submitting": "this.submitting", "class.rxap-submit-error": "this.submitError", "class.rxap-loading": "this.loading", "class.rxap-loaded": "this.loaded", "class.rxap-loading-error": "this.loadingError" } }, providers: [
2032
2034
  {
2033
2035
  provide: i1.ControlContainer,
2034
2036
  // ignore coverage
@@ -2196,6 +2198,9 @@
2196
2198
  type: i0.Output
2197
2199
  }], invalidSubmit: [{
2198
2200
  type: i0.Output
2201
+ }], submitSuccessful$: [{
2202
+ type: i0.Output,
2203
+ args: ['submitSuccessful']
2199
2204
  }], submitting: [{
2200
2205
  type: i0.HostBinding,
2201
2206
  args: ['class.rxap-submitting']
@@ -2815,6 +2820,84 @@
2815
2820
  }]
2816
2821
  }] });
2817
2822
 
2823
+ var FormSubmitSuccessfulDirective = /** @class */ (function () {
2824
+ function FormSubmitSuccessfulDirective(formDirective, template, viewContainerRef) {
2825
+ this.formDirective = formDirective;
2826
+ this.template = template;
2827
+ this.viewContainerRef = viewContainerRef;
2828
+ }
2829
+ FormSubmitSuccessfulDirective.prototype.ngAfterViewInit = function () {
2830
+ var _this = this;
2831
+ this.subscription = this.formDirective.submitSuccessful$.pipe(operators.tap(function (result) {
2832
+ _this.viewContainerRef.clear();
2833
+ _this.viewContainerRef.createEmbeddedView(_this.template, { $implicit: result });
2834
+ })).subscribe();
2835
+ };
2836
+ FormSubmitSuccessfulDirective.prototype.ngOnDestroy = function () {
2837
+ var _a;
2838
+ (_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
2839
+ };
2840
+ return FormSubmitSuccessfulDirective;
2841
+ }());
2842
+ FormSubmitSuccessfulDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: FormSubmitSuccessfulDirective, deps: [{ token: FormDirective }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
2843
+ FormSubmitSuccessfulDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.1", type: FormSubmitSuccessfulDirective, selector: "[rxapFormSubmitSuccessful]", ngImport: i0__namespace });
2844
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: FormSubmitSuccessfulDirective, decorators: [{
2845
+ type: i0.Directive,
2846
+ args: [{
2847
+ selector: '[rxapFormSubmitSuccessful]'
2848
+ }]
2849
+ }], ctorParameters: function () {
2850
+ return [{ type: FormDirective, decorators: [{
2851
+ type: i0.Inject,
2852
+ args: [FormDirective]
2853
+ }] }, { type: i0__namespace.TemplateRef, decorators: [{
2854
+ type: i0.Inject,
2855
+ args: [i0.TemplateRef]
2856
+ }] }, { type: i0__namespace.ViewContainerRef, decorators: [{
2857
+ type: i0.Inject,
2858
+ args: [i0.ViewContainerRef]
2859
+ }] }];
2860
+ } });
2861
+
2862
+ var FormSubmitInvalidDirective = /** @class */ (function () {
2863
+ function FormSubmitInvalidDirective(formDirective, template, viewContainerRef) {
2864
+ this.formDirective = formDirective;
2865
+ this.template = template;
2866
+ this.viewContainerRef = viewContainerRef;
2867
+ }
2868
+ FormSubmitInvalidDirective.prototype.ngAfterViewInit = function () {
2869
+ var _this = this;
2870
+ this.subscription = this.formDirective.invalidSubmit.pipe(operators.tap(function (result) {
2871
+ _this.viewContainerRef.clear();
2872
+ _this.viewContainerRef.createEmbeddedView(_this.template, { $implicit: result });
2873
+ })).subscribe();
2874
+ };
2875
+ FormSubmitInvalidDirective.prototype.ngOnDestroy = function () {
2876
+ var _a;
2877
+ (_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
2878
+ };
2879
+ return FormSubmitInvalidDirective;
2880
+ }());
2881
+ FormSubmitInvalidDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: FormSubmitInvalidDirective, deps: [{ token: FormDirective }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
2882
+ FormSubmitInvalidDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.1", type: FormSubmitInvalidDirective, selector: "[rxapFormSubmitInvalid]", ngImport: i0__namespace });
2883
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: FormSubmitInvalidDirective, decorators: [{
2884
+ type: i0.Directive,
2885
+ args: [{
2886
+ selector: '[rxapFormSubmitInvalid]'
2887
+ }]
2888
+ }], ctorParameters: function () {
2889
+ return [{ type: FormDirective, decorators: [{
2890
+ type: i0.Inject,
2891
+ args: [FormDirective]
2892
+ }] }, { type: i0__namespace.TemplateRef, decorators: [{
2893
+ type: i0.Inject,
2894
+ args: [i0.TemplateRef]
2895
+ }] }, { type: i0__namespace.ViewContainerRef, decorators: [{
2896
+ type: i0.Inject,
2897
+ args: [i0.ViewContainerRef]
2898
+ }] }];
2899
+ } });
2900
+
2818
2901
  var RxapFormsModule = /** @class */ (function () {
2819
2902
  function RxapFormsModule() {
2820
2903
  }
@@ -2835,7 +2918,9 @@
2835
2918
  FormSubmitDirective,
2836
2919
  FormGroupNameDirective,
2837
2920
  FormControlNameDirective,
2838
- ParentControlContainerDirective], exports: [FormDirective,
2921
+ ParentControlContainerDirective,
2922
+ FormSubmitSuccessfulDirective,
2923
+ FormSubmitInvalidDirective], exports: [FormDirective,
2839
2924
  FormSubmitFailedDirective,
2840
2925
  FormLoadingDirective,
2841
2926
  FormSubmittingDirective,
@@ -2849,7 +2934,9 @@
2849
2934
  FormSubmitDirective,
2850
2935
  FormGroupNameDirective,
2851
2936
  FormControlNameDirective,
2852
- ParentControlContainerDirective] });
2937
+ ParentControlContainerDirective,
2938
+ FormSubmitSuccessfulDirective,
2939
+ FormSubmitInvalidDirective] });
2853
2940
  RxapFormsModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: RxapFormsModule });
2854
2941
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: RxapFormsModule, decorators: [{
2855
2942
  type: i0.NgModule,
@@ -2869,7 +2956,9 @@
2869
2956
  FormSubmitDirective,
2870
2957
  FormGroupNameDirective,
2871
2958
  FormControlNameDirective,
2872
- ParentControlContainerDirective
2959
+ ParentControlContainerDirective,
2960
+ FormSubmitSuccessfulDirective,
2961
+ FormSubmitInvalidDirective,
2873
2962
  ],
2874
2963
  exports: [
2875
2964
  FormDirective,
@@ -2886,7 +2975,9 @@
2886
2975
  FormSubmitDirective,
2887
2976
  FormGroupNameDirective,
2888
2977
  FormControlNameDirective,
2889
- ParentControlContainerDirective
2978
+ ParentControlContainerDirective,
2979
+ FormSubmitSuccessfulDirective,
2980
+ FormSubmitInvalidDirective,
2890
2981
  ]
2891
2982
  }]
2892
2983
  }] });
@@ -3320,6 +3411,8 @@
3320
3411
  exports.FormLoadingErrorDirective = FormLoadingErrorDirective;
3321
3412
  exports.FormSubmitDirective = FormSubmitDirective;
3322
3413
  exports.FormSubmitFailedDirective = FormSubmitFailedDirective;
3414
+ exports.FormSubmitInvalidDirective = FormSubmitInvalidDirective;
3415
+ exports.FormSubmitSuccessfulDirective = FormSubmitSuccessfulDirective;
3323
3416
  exports.FormSubmittingDirective = FormSubmittingDirective;
3324
3417
  exports.IsArray = IsArray;
3325
3418
  exports.IsBoolean = IsBoolean;