@rxap/forms 12.7.3 → 13.0.0-next.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 (172) hide show
  1. package/esm2020/index.mjs +53 -0
  2. package/esm2020/lib/control-actions.mjs +77 -0
  3. package/esm2020/lib/control-value-accessor.mjs +14 -0
  4. package/esm2020/lib/decorators/control-async-validator.mjs +10 -0
  5. package/esm2020/lib/decorators/control-change.mjs +10 -0
  6. package/esm2020/lib/decorators/control-set-value.mjs +11 -0
  7. package/esm2020/lib/decorators/control-validator.mjs +10 -0
  8. package/esm2020/lib/decorators/form.mjs +7 -0
  9. package/esm2020/lib/decorators/metadata-keys.mjs +12 -0
  10. package/esm2020/lib/decorators/use-form-array.mjs +13 -0
  11. package/esm2020/lib/decorators/use-form-control.mjs +8 -0
  12. package/esm2020/lib/decorators/use-form-group.mjs +8 -0
  13. package/esm2020/lib/directives/form-control-error.directive.mjs +59 -0
  14. package/esm2020/lib/directives/form-control-mark-dirty.directive.mjs +31 -0
  15. package/esm2020/lib/directives/form-control-mark-pristine.directive.mjs +31 -0
  16. package/esm2020/lib/directives/form-control-mark-touched.directive.mjs +24 -0
  17. package/esm2020/lib/directives/form-control-mark-untouched.directive.mjs +31 -0
  18. package/esm2020/lib/directives/form-control-name.directive.mjs +64 -0
  19. package/esm2020/lib/directives/form-group-name.directive.mjs +61 -0
  20. package/esm2020/lib/directives/form-loaded.directive.mjs +41 -0
  21. package/esm2020/lib/directives/form-loading-error.directive.mjs +41 -0
  22. package/esm2020/lib/directives/form-loading.directive.mjs +41 -0
  23. package/esm2020/lib/directives/form-submit-failed.directive.mjs +41 -0
  24. package/esm2020/lib/directives/form-submit-invalid.directive.mjs +39 -0
  25. package/esm2020/lib/directives/form-submit-successful.directive.mjs +39 -0
  26. package/esm2020/lib/directives/form-submit.directive.mjs +74 -0
  27. package/esm2020/lib/directives/form-submitting.directive.mjs +41 -0
  28. package/esm2020/lib/directives/form.directive.mjs +541 -0
  29. package/esm2020/lib/directives/forms.module.mjs +100 -0
  30. package/esm2020/lib/directives/models.mjs +12 -0
  31. package/esm2020/lib/directives/parent-control-container.directive.mjs +25 -0
  32. package/esm2020/lib/directives/tokens.mjs +10 -0
  33. package/esm2020/lib/form-array.mjs +225 -0
  34. package/esm2020/lib/form-builder.mjs +374 -0
  35. package/esm2020/lib/form-control.mjs +169 -0
  36. package/esm2020/lib/form-group.mjs +181 -0
  37. package/esm2020/lib/model.mjs +2 -0
  38. package/esm2020/lib/tokens.mjs +4 -0
  39. package/esm2020/lib/types.mjs +2 -0
  40. package/esm2020/lib/validators/index.mjs +29 -0
  41. package/esm2020/lib/validators/is-array.mjs +18 -0
  42. package/esm2020/lib/validators/is-boolean.mjs +18 -0
  43. package/esm2020/lib/validators/is-complex.mjs +87 -0
  44. package/esm2020/lib/validators/is-date.mjs +18 -0
  45. package/esm2020/lib/validators/is-email.mjs +19 -0
  46. package/esm2020/lib/validators/is-enum.mjs +18 -0
  47. package/esm2020/lib/validators/is-int.mjs +19 -0
  48. package/esm2020/lib/validators/is-ip.mjs +19 -0
  49. package/esm2020/lib/validators/is-number.mjs +56 -0
  50. package/esm2020/lib/validators/is-object.mjs +18 -0
  51. package/esm2020/lib/validators/is-phone-number.mjs +19 -0
  52. package/esm2020/lib/validators/is-string.mjs +18 -0
  53. package/esm2020/lib/validators/is-url.mjs +19 -0
  54. package/esm2020/rxap-forms.mjs +5 -0
  55. package/fesm2015/rxap-forms.mjs +2721 -0
  56. package/fesm2015/rxap-forms.mjs.map +1 -0
  57. package/{fesm2015/rxap-forms.js → fesm2020/rxap-forms.mjs} +161 -147
  58. package/fesm2020/rxap-forms.mjs.map +1 -0
  59. package/package.json +35 -21
  60. package/src/schematics/ng-add/index.js +1 -1
  61. package/src/schematics/ng-add/index.js.map +1 -1
  62. package/bundles/rxap-forms.umd.js +0 -3521
  63. package/bundles/rxap-forms.umd.js.map +0 -1
  64. package/esm2015/index.js +0 -53
  65. package/esm2015/index.js.map +0 -1
  66. package/esm2015/lib/control-actions.js +0 -80
  67. package/esm2015/lib/control-actions.js.map +0 -1
  68. package/esm2015/lib/control-value-accessor.js +0 -14
  69. package/esm2015/lib/control-value-accessor.js.map +0 -1
  70. package/esm2015/lib/decorators/control-async-validator.js +0 -10
  71. package/esm2015/lib/decorators/control-async-validator.js.map +0 -1
  72. package/esm2015/lib/decorators/control-change.js +0 -10
  73. package/esm2015/lib/decorators/control-change.js.map +0 -1
  74. package/esm2015/lib/decorators/control-set-value.js +0 -8
  75. package/esm2015/lib/decorators/control-set-value.js.map +0 -1
  76. package/esm2015/lib/decorators/control-validator.js +0 -10
  77. package/esm2015/lib/decorators/control-validator.js.map +0 -1
  78. package/esm2015/lib/decorators/form.js +0 -7
  79. package/esm2015/lib/decorators/form.js.map +0 -1
  80. package/esm2015/lib/decorators/metadata-keys.js +0 -12
  81. package/esm2015/lib/decorators/metadata-keys.js.map +0 -1
  82. package/esm2015/lib/decorators/use-form-array.js +0 -13
  83. package/esm2015/lib/decorators/use-form-array.js.map +0 -1
  84. package/esm2015/lib/decorators/use-form-control.js +0 -8
  85. package/esm2015/lib/decorators/use-form-control.js.map +0 -1
  86. package/esm2015/lib/decorators/use-form-group.js +0 -8
  87. package/esm2015/lib/decorators/use-form-group.js.map +0 -1
  88. package/esm2015/lib/directives/form-control-error.directive.js +0 -61
  89. package/esm2015/lib/directives/form-control-error.directive.js.map +0 -1
  90. package/esm2015/lib/directives/form-control-mark-dirty.directive.js +0 -31
  91. package/esm2015/lib/directives/form-control-mark-dirty.directive.js.map +0 -1
  92. package/esm2015/lib/directives/form-control-mark-pristine.directive.js +0 -31
  93. package/esm2015/lib/directives/form-control-mark-pristine.directive.js.map +0 -1
  94. package/esm2015/lib/directives/form-control-mark-touched.directive.js +0 -25
  95. package/esm2015/lib/directives/form-control-mark-touched.directive.js.map +0 -1
  96. package/esm2015/lib/directives/form-control-mark-untouched.directive.js +0 -31
  97. package/esm2015/lib/directives/form-control-mark-untouched.directive.js.map +0 -1
  98. package/esm2015/lib/directives/form-control-name.directive.js +0 -64
  99. package/esm2015/lib/directives/form-control-name.directive.js.map +0 -1
  100. package/esm2015/lib/directives/form-group-name.directive.js +0 -61
  101. package/esm2015/lib/directives/form-group-name.directive.js.map +0 -1
  102. package/esm2015/lib/directives/form-loaded.directive.js +0 -42
  103. package/esm2015/lib/directives/form-loaded.directive.js.map +0 -1
  104. package/esm2015/lib/directives/form-loading-error.directive.js +0 -42
  105. package/esm2015/lib/directives/form-loading-error.directive.js.map +0 -1
  106. package/esm2015/lib/directives/form-loading.directive.js +0 -42
  107. package/esm2015/lib/directives/form-loading.directive.js.map +0 -1
  108. package/esm2015/lib/directives/form-submit-failed.directive.js +0 -42
  109. package/esm2015/lib/directives/form-submit-failed.directive.js.map +0 -1
  110. package/esm2015/lib/directives/form-submit-invalid.directive.js +0 -40
  111. package/esm2015/lib/directives/form-submit-invalid.directive.js.map +0 -1
  112. package/esm2015/lib/directives/form-submit-successful.directive.js +0 -40
  113. package/esm2015/lib/directives/form-submit-successful.directive.js.map +0 -1
  114. package/esm2015/lib/directives/form-submit.directive.js +0 -75
  115. package/esm2015/lib/directives/form-submit.directive.js.map +0 -1
  116. package/esm2015/lib/directives/form-submitting.directive.js +0 -42
  117. package/esm2015/lib/directives/form-submitting.directive.js.map +0 -1
  118. package/esm2015/lib/directives/form.directive.js +0 -544
  119. package/esm2015/lib/directives/form.directive.js.map +0 -1
  120. package/esm2015/lib/directives/forms.module.js +0 -100
  121. package/esm2015/lib/directives/forms.module.js.map +0 -1
  122. package/esm2015/lib/directives/models.js +0 -12
  123. package/esm2015/lib/directives/models.js.map +0 -1
  124. package/esm2015/lib/directives/parent-control-container.directive.js +0 -25
  125. package/esm2015/lib/directives/parent-control-container.directive.js.map +0 -1
  126. package/esm2015/lib/directives/tokens.js +0 -10
  127. package/esm2015/lib/directives/tokens.js.map +0 -1
  128. package/esm2015/lib/form-array.js +0 -217
  129. package/esm2015/lib/form-array.js.map +0 -1
  130. package/esm2015/lib/form-builder.js +0 -349
  131. package/esm2015/lib/form-builder.js.map +0 -1
  132. package/esm2015/lib/form-control.js +0 -170
  133. package/esm2015/lib/form-control.js.map +0 -1
  134. package/esm2015/lib/form-group.js +0 -183
  135. package/esm2015/lib/form-group.js.map +0 -1
  136. package/esm2015/lib/model.js +0 -2
  137. package/esm2015/lib/model.js.map +0 -1
  138. package/esm2015/lib/tokens.js +0 -4
  139. package/esm2015/lib/tokens.js.map +0 -1
  140. package/esm2015/lib/types.js +0 -2
  141. package/esm2015/lib/types.js.map +0 -1
  142. package/esm2015/lib/validators/index.js +0 -29
  143. package/esm2015/lib/validators/index.js.map +0 -1
  144. package/esm2015/lib/validators/is-array.js +0 -18
  145. package/esm2015/lib/validators/is-array.js.map +0 -1
  146. package/esm2015/lib/validators/is-boolean.js +0 -18
  147. package/esm2015/lib/validators/is-boolean.js.map +0 -1
  148. package/esm2015/lib/validators/is-complex.js +0 -87
  149. package/esm2015/lib/validators/is-complex.js.map +0 -1
  150. package/esm2015/lib/validators/is-date.js +0 -18
  151. package/esm2015/lib/validators/is-date.js.map +0 -1
  152. package/esm2015/lib/validators/is-email.js +0 -19
  153. package/esm2015/lib/validators/is-email.js.map +0 -1
  154. package/esm2015/lib/validators/is-enum.js +0 -18
  155. package/esm2015/lib/validators/is-enum.js.map +0 -1
  156. package/esm2015/lib/validators/is-int.js +0 -19
  157. package/esm2015/lib/validators/is-int.js.map +0 -1
  158. package/esm2015/lib/validators/is-ip.js +0 -19
  159. package/esm2015/lib/validators/is-ip.js.map +0 -1
  160. package/esm2015/lib/validators/is-number.js +0 -57
  161. package/esm2015/lib/validators/is-number.js.map +0 -1
  162. package/esm2015/lib/validators/is-object.js +0 -18
  163. package/esm2015/lib/validators/is-object.js.map +0 -1
  164. package/esm2015/lib/validators/is-phone-number.js +0 -19
  165. package/esm2015/lib/validators/is-phone-number.js.map +0 -1
  166. package/esm2015/lib/validators/is-string.js +0 -18
  167. package/esm2015/lib/validators/is-string.js.map +0 -1
  168. package/esm2015/lib/validators/is-url.js +0 -19
  169. package/esm2015/lib/validators/is-url.js.map +0 -1
  170. package/esm2015/rxap-forms.js +0 -5
  171. package/esm2015/rxap-forms.js.map +0 -1
  172. package/fesm2015/rxap-forms.js.map +0 -1
@@ -1,61 +0,0 @@
1
- import { Directive, Inject, SkipSelf, Optional, Self, Input, forwardRef } from '@angular/core';
2
- import { FormGroupName, NG_ASYNC_VALIDATORS, ControlContainer, NG_VALIDATORS } from '@angular/forms';
3
- import * as i0 from "@angular/core";
4
- import * as i1 from "@angular/forms";
5
- /**
6
- * A full exertion of FormGroupName from @angular/forms. The only change is the
7
- * ability to access the control container outside of the current component
8
- *
9
- * @deprecated use the ParentControlContainerDirective
10
- */
11
- export class FormGroupNameDirective extends FormGroupName {
12
- constructor(parent, validators, asyncValidators) {
13
- super(parent, validators, asyncValidators);
14
- }
15
- get control() {
16
- // TODO : add type check
17
- return this.formDirective.getFormGroup(this);
18
- }
19
- }
20
- FormGroupNameDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: FormGroupNameDirective, deps: [{ token: i1.ControlContainer, optional: true, skipSelf: true }, { token: NG_VALIDATORS, optional: true, self: true }, { token: NG_ASYNC_VALIDATORS, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Directive });
21
- FormGroupNameDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.1", type: FormGroupNameDirective, selector: "[rxapFormGroupName]", inputs: { name: ["rxapFormGroupName", "name"] }, providers: [
22
- {
23
- provide: ControlContainer,
24
- useExisting: forwardRef(() => FormGroupNameDirective)
25
- }
26
- ], exportAs: ["rxapFormGroup"], usesInheritance: true, ngImport: i0 });
27
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: FormGroupNameDirective, decorators: [{
28
- type: Directive,
29
- args: [{
30
- selector: '[rxapFormGroupName]',
31
- providers: [
32
- {
33
- provide: ControlContainer,
34
- useExisting: forwardRef(() => FormGroupNameDirective)
35
- }
36
- ],
37
- exportAs: 'rxapFormGroup'
38
- }]
39
- }], ctorParameters: function () { return [{ type: i1.ControlContainer, decorators: [{
40
- type: Optional
41
- }, {
42
- type: SkipSelf
43
- }] }, { type: undefined, decorators: [{
44
- type: Optional
45
- }, {
46
- type: Self
47
- }, {
48
- type: Inject,
49
- args: [NG_VALIDATORS]
50
- }] }, { type: undefined, decorators: [{
51
- type: Optional
52
- }, {
53
- type: Self
54
- }, {
55
- type: Inject,
56
- args: [NG_ASYNC_VALIDATORS]
57
- }] }]; }, propDecorators: { name: [{
58
- type: Input,
59
- args: ['rxapFormGroupName']
60
- }] } });
61
- //# sourceMappingURL=form-group-name.directive.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"form-group-name.directive.js","sourceRoot":"","sources":["../../../../../../libs/forms/src/lib/directives/form-group-name.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,UAAU,EACX,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,EACd,MAAM,gBAAgB,CAAC;;;AAGxB;;;;;GAKG;AAWH,MAAM,OAAO,sBAAuB,SAAQ,aAAa;IAUvD,YAC0B,MAAwB,EACL,UAAiB,EACX,eAAsB;QACvE,KAAK,CAAC,MAAM,EAAE,UAAU,EAAE,eAAe,CAAC,CAAC;IAC7C,CAAC;IAVD,IAAW,OAAO;QAChB,wBAAwB;QACxB,OAAO,IAAI,CAAC,aAAc,CAAC,YAAY,CAAC,IAAI,CAAQ,CAAC;IACvD,CAAC;;mHARU,sBAAsB,kFAYH,aAAa,yCACb,mBAAmB;uGAbtC,sBAAsB,+FARtB;QACT;YACE,OAAO,EAAE,gBAAgB;YACzB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,sBAAsB,CAAC;SACtD;KACF;2FAGU,sBAAsB;kBAVlC,SAAS;mBAAC;oBACT,QAAQ,EAAE,qBAAqB;oBAC/B,SAAS,EAAE;wBACT;4BACE,OAAO,EAAE,gBAAgB;4BACzB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,uBAAuB,CAAC;yBACtD;qBACF;oBACD,QAAQ,EAAE,eAAe;iBAC1B;;0BAYI,QAAQ;;0BAAI,QAAQ;;0BACpB,QAAQ;;0BAAI,IAAI;;0BAAI,MAAM;2BAAC,aAAa;;0BACxC,QAAQ;;0BAAI,IAAI;;0BAAI,MAAM;2BAAC,mBAAmB;4CAV1C,IAAI;sBADV,KAAK;uBAAC,mBAAmB","sourcesContent":["import {\n Directive,\n Inject,\n SkipSelf,\n Optional,\n Self,\n Input,\n forwardRef\n} from '@angular/core';\nimport {\n FormGroupName,\n NG_ASYNC_VALIDATORS,\n ControlContainer,\n NG_VALIDATORS\n} from '@angular/forms';\nimport { RxapFormGroup } from '../form-group';\n\n/**\n * A full exertion of FormGroupName from @angular/forms. The only change is the\n * ability to access the control container outside of the current component\n *\n * @deprecated use the ParentControlContainerDirective\n */\n@Directive({\n selector: '[rxapFormGroupName]',\n providers: [\n {\n provide: ControlContainer,\n useExisting: forwardRef(() => FormGroupNameDirective)\n }\n ],\n exportAs: 'rxapFormGroup'\n})\nexport class FormGroupNameDirective extends FormGroupName {\n\n @Input('rxapFormGroupName')\n public name!: string|number|null;\n\n public get control(): RxapFormGroup {\n // TODO : add type check\n return this.formDirective!.getFormGroup(this) as any;\n }\n\n constructor(\n @Optional() @SkipSelf() parent: ControlContainer,\n @Optional() @Self() @Inject(NG_VALIDATORS) validators: any[],\n @Optional() @Self() @Inject(NG_ASYNC_VALIDATORS) asyncValidators: any[]) {\n super(parent, validators, asyncValidators);\n }\n\n}\n"]}
@@ -1,42 +0,0 @@
1
- import { Directive, Inject, TemplateRef, ViewContainerRef } from '@angular/core';
2
- import { FormDirective } from './form.directive';
3
- import { tap, distinctUntilChanged } from 'rxjs/operators';
4
- import * as i0 from "@angular/core";
5
- import * as i1 from "./form.directive";
6
- export class FormLoadedDirective {
7
- constructor(formDirective, template, viewContainerRef) {
8
- this.formDirective = formDirective;
9
- this.template = template;
10
- this.viewContainerRef = viewContainerRef;
11
- }
12
- ngAfterViewInit() {
13
- this.subscription = this.formDirective.loaded$.pipe(distinctUntilChanged(), tap(loading => {
14
- this.viewContainerRef.clear();
15
- if (loading) {
16
- this.viewContainerRef.createEmbeddedView(this.template);
17
- }
18
- })).subscribe();
19
- }
20
- ngOnDestroy() {
21
- var _a;
22
- (_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
23
- }
24
- }
25
- FormLoadedDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: FormLoadedDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
26
- FormLoadedDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.1", type: FormLoadedDirective, selector: "[rxapFormLoaded]", ngImport: i0 });
27
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: FormLoadedDirective, decorators: [{
28
- type: Directive,
29
- args: [{
30
- selector: '[rxapFormLoaded]'
31
- }]
32
- }], ctorParameters: function () { return [{ type: i1.FormDirective, decorators: [{
33
- type: Inject,
34
- args: [FormDirective]
35
- }] }, { type: i0.TemplateRef, decorators: [{
36
- type: Inject,
37
- args: [TemplateRef]
38
- }] }, { type: i0.ViewContainerRef, decorators: [{
39
- type: Inject,
40
- args: [ViewContainerRef]
41
- }] }]; } });
42
- //# sourceMappingURL=form-loaded.directive.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"form-loaded.directive.js","sourceRoot":"","sources":["../../../../../../libs/forms/src/lib/directives/form-loaded.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,MAAM,EACN,WAAW,EACX,gBAAgB,EAGjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EACL,GAAG,EACH,oBAAoB,EACrB,MAAM,gBAAgB,CAAC;;;AAKxB,MAAM,OAAO,mBAAmB;IAI9B,YAC0C,aAA4B,EAC9B,QAA2B,EACtB,gBAAkC;QAFrC,kBAAa,GAAb,aAAa,CAAe;QAC9B,aAAQ,GAAR,QAAQ,CAAmB;QACtB,qBAAgB,GAAhB,gBAAgB,CAAkB;IAC5E,CAAC;IAEG,eAAe;QACpB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CACjD,oBAAoB,EAAE,EACtB,GAAG,CAAC,OAAO,CAAC,EAAE;YACZ,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,CAAC;YAC9B,IAAI,OAAO,EAAE;gBACX,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;aACzD;QACH,CAAC,CAAC,CACH,CAAC,SAAS,EAAE,CAAC;IAChB,CAAC;IAEM,WAAW;;QAChB,MAAA,IAAI,CAAC,YAAY,0CAAE,WAAW,EAAE,CAAC;IACnC,CAAC;;gHAxBU,mBAAmB,kBAKpB,aAAa,aACb,WAAW,aACX,gBAAgB;oGAPf,mBAAmB;2FAAnB,mBAAmB;kBAH/B,SAAS;mBAAC;oBACT,QAAQ,EAAE,kBAAkB;iBAC7B;;0BAMI,MAAM;2BAAC,aAAa;;0BACpB,MAAM;2BAAC,WAAW;;0BAClB,MAAM;2BAAC,gBAAgB","sourcesContent":["import {\n Directive,\n Inject,\n TemplateRef,\n ViewContainerRef,\n OnDestroy,\n AfterViewInit\n} from '@angular/core';\nimport { FormDirective } from './form.directive';\nimport { Subscription } from 'rxjs';\nimport {\n tap,\n distinctUntilChanged\n} from 'rxjs/operators';\n\n@Directive({\n selector: '[rxapFormLoaded]'\n})\nexport class FormLoadedDirective implements AfterViewInit, OnDestroy {\n\n private subscription?: Subscription;\n\n constructor(\n @Inject(FormDirective) private readonly formDirective: FormDirective,\n @Inject(TemplateRef) private readonly template: TemplateRef<void>,\n @Inject(ViewContainerRef) private readonly viewContainerRef: ViewContainerRef\n ) {}\n\n public ngAfterViewInit() {\n this.subscription = this.formDirective.loaded$.pipe(\n distinctUntilChanged(),\n tap(loading => {\n this.viewContainerRef.clear();\n if (loading) {\n this.viewContainerRef.createEmbeddedView(this.template);\n }\n })\n ).subscribe();\n }\n\n public ngOnDestroy() {\n this.subscription?.unsubscribe();\n }\n\n}\n"]}
@@ -1,42 +0,0 @@
1
- import { Directive, Inject, TemplateRef, ViewContainerRef } from '@angular/core';
2
- import { FormDirective } from './form.directive';
3
- import { tap } from 'rxjs/operators';
4
- import * as i0 from "@angular/core";
5
- import * as i1 from "./form.directive";
6
- export class FormLoadingErrorDirective {
7
- constructor(formDirective, template, viewContainerRef) {
8
- this.formDirective = formDirective;
9
- this.template = template;
10
- this.viewContainerRef = viewContainerRef;
11
- }
12
- ngAfterViewInit() {
13
- this.subscription = this.formDirective.loadingError$.pipe(tap(error => {
14
- this.viewContainerRef.clear();
15
- if (error !== null) {
16
- this.viewContainerRef.createEmbeddedView(this.template, { $implicit: error });
17
- }
18
- })).subscribe();
19
- }
20
- ngOnDestroy() {
21
- var _a;
22
- (_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
23
- }
24
- }
25
- FormLoadingErrorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: FormLoadingErrorDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
26
- FormLoadingErrorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.1", type: FormLoadingErrorDirective, selector: "[rxapFormLoadingError]", ngImport: i0 });
27
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: FormLoadingErrorDirective, decorators: [{
28
- type: Directive,
29
- args: [{
30
- selector: '[rxapFormLoadingError]'
31
- }]
32
- }], ctorParameters: function () { return [{ type: i1.FormDirective, decorators: [{
33
- type: Inject,
34
- args: [FormDirective]
35
- }] }, { type: i0.TemplateRef, decorators: [{
36
- type: Inject,
37
- args: [TemplateRef]
38
- }] }, { type: i0.ViewContainerRef, decorators: [{
39
- type: Inject,
40
- args: [ViewContainerRef]
41
- }] }]; } });
42
- //# sourceMappingURL=form-loading-error.directive.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"form-loading-error.directive.js","sourceRoot":"","sources":["../../../../../../libs/forms/src/lib/directives/form-loading-error.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,MAAM,EACN,WAAW,EACX,gBAAgB,EAGjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;;;AAKrC,MAAM,OAAO,yBAAyB;IAIpC,YAC0C,aAA4B,EAC9B,QAA2C,EACtC,gBAAkC;QAFrC,kBAAa,GAAb,aAAa,CAAe;QAC9B,aAAQ,GAAR,QAAQ,CAAmC;QACtC,qBAAgB,GAAhB,gBAAgB,CAAkB;IAC5E,CAAC;IAEG,eAAe;QACpB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,IAAI,CACvD,GAAG,CAAC,KAAK,CAAC,EAAE;YACV,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,CAAC;YAC9B,IAAI,KAAK,KAAK,IAAI,EAAE;gBAClB,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;aAC/E;QACH,CAAC,CAAC,CACH,CAAC,SAAS,EAAE,CAAC;IAChB,CAAC;IAEM,WAAW;;QAChB,MAAA,IAAI,CAAC,YAAY,0CAAE,WAAW,EAAE,CAAC;IACnC,CAAC;;sHAvBU,yBAAyB,kBAK1B,aAAa,aACb,WAAW,aACX,gBAAgB;0GAPf,yBAAyB;2FAAzB,yBAAyB;kBAHrC,SAAS;mBAAC;oBACT,QAAQ,EAAE,wBAAwB;iBACnC;;0BAMI,MAAM;2BAAC,aAAa;;0BACpB,MAAM;2BAAC,WAAW;;0BAClB,MAAM;2BAAC,gBAAgB","sourcesContent":["import {\n Directive,\n Inject,\n TemplateRef,\n ViewContainerRef,\n OnDestroy,\n AfterViewInit\n} from '@angular/core';\nimport { FormDirective } from './form.directive';\nimport { Subscription } from 'rxjs';\nimport { tap } from 'rxjs/operators';\n\n@Directive({\n selector: '[rxapFormLoadingError]'\n})\nexport class FormLoadingErrorDirective implements AfterViewInit, OnDestroy {\n\n private subscription?: Subscription;\n\n constructor(\n @Inject(FormDirective) private readonly formDirective: FormDirective,\n @Inject(TemplateRef) private readonly template: TemplateRef<{ $implicit: Error }>,\n @Inject(ViewContainerRef) private readonly viewContainerRef: ViewContainerRef\n ) {}\n\n public ngAfterViewInit() {\n this.subscription = this.formDirective.loadingError$.pipe(\n tap(error => {\n this.viewContainerRef.clear();\n if (error !== null) {\n this.viewContainerRef.createEmbeddedView(this.template, { $implicit: error });\n }\n })\n ).subscribe();\n }\n\n public ngOnDestroy() {\n this.subscription?.unsubscribe();\n }\n\n}\n"]}
@@ -1,42 +0,0 @@
1
- import { Directive, Inject, TemplateRef, ViewContainerRef } from '@angular/core';
2
- import { FormDirective } from './form.directive';
3
- import { tap, distinctUntilChanged } from 'rxjs/operators';
4
- import * as i0 from "@angular/core";
5
- import * as i1 from "./form.directive";
6
- export class FormLoadingDirective {
7
- constructor(formDirective, template, viewContainerRef) {
8
- this.formDirective = formDirective;
9
- this.template = template;
10
- this.viewContainerRef = viewContainerRef;
11
- }
12
- ngAfterViewInit() {
13
- this.subscription = this.formDirective.loading$.pipe(distinctUntilChanged(), tap(loading => {
14
- this.viewContainerRef.clear();
15
- if (loading) {
16
- this.viewContainerRef.createEmbeddedView(this.template);
17
- }
18
- })).subscribe();
19
- }
20
- ngOnDestroy() {
21
- var _a;
22
- (_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
23
- }
24
- }
25
- FormLoadingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: FormLoadingDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
26
- FormLoadingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.1", type: FormLoadingDirective, selector: "[rxapFormLoading]", ngImport: i0 });
27
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: FormLoadingDirective, decorators: [{
28
- type: Directive,
29
- args: [{
30
- selector: '[rxapFormLoading]'
31
- }]
32
- }], ctorParameters: function () { return [{ type: i1.FormDirective, decorators: [{
33
- type: Inject,
34
- args: [FormDirective]
35
- }] }, { type: i0.TemplateRef, decorators: [{
36
- type: Inject,
37
- args: [TemplateRef]
38
- }] }, { type: i0.ViewContainerRef, decorators: [{
39
- type: Inject,
40
- args: [ViewContainerRef]
41
- }] }]; } });
42
- //# sourceMappingURL=form-loading.directive.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"form-loading.directive.js","sourceRoot":"","sources":["../../../../../../libs/forms/src/lib/directives/form-loading.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,MAAM,EACN,WAAW,EACX,gBAAgB,EAGjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EACL,GAAG,EACH,oBAAoB,EACrB,MAAM,gBAAgB,CAAC;;;AAKxB,MAAM,OAAO,oBAAoB;IAI/B,YAC0C,aAA4B,EAC9B,QAA2B,EACtB,gBAAkC;QAFrC,kBAAa,GAAb,aAAa,CAAe;QAC9B,aAAQ,GAAR,QAAQ,CAAmB;QACtB,qBAAgB,GAAhB,gBAAgB,CAAkB;IAC5E,CAAC;IAEG,eAAe;QACpB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,CAClD,oBAAoB,EAAE,EACtB,GAAG,CAAC,OAAO,CAAC,EAAE;YACZ,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,CAAC;YAC9B,IAAI,OAAO,EAAE;gBACX,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;aACzD;QACH,CAAC,CAAC,CACH,CAAC,SAAS,EAAE,CAAC;IAChB,CAAC;IAEM,WAAW;;QAChB,MAAA,IAAI,CAAC,YAAY,0CAAE,WAAW,EAAE,CAAC;IACnC,CAAC;;iHAxBU,oBAAoB,kBAKrB,aAAa,aACb,WAAW,aACX,gBAAgB;qGAPf,oBAAoB;2FAApB,oBAAoB;kBAHhC,SAAS;mBAAC;oBACT,QAAQ,EAAE,mBAAmB;iBAC9B;;0BAMI,MAAM;2BAAC,aAAa;;0BACpB,MAAM;2BAAC,WAAW;;0BAClB,MAAM;2BAAC,gBAAgB","sourcesContent":["import {\n Directive,\n Inject,\n TemplateRef,\n ViewContainerRef,\n OnDestroy,\n AfterViewInit\n} from '@angular/core';\nimport { FormDirective } from './form.directive';\nimport { Subscription } from 'rxjs';\nimport {\n tap,\n distinctUntilChanged\n} from 'rxjs/operators';\n\n@Directive({\n selector: '[rxapFormLoading]'\n})\nexport class FormLoadingDirective implements AfterViewInit, OnDestroy {\n\n private subscription?: Subscription;\n\n constructor(\n @Inject(FormDirective) private readonly formDirective: FormDirective,\n @Inject(TemplateRef) private readonly template: TemplateRef<void>,\n @Inject(ViewContainerRef) private readonly viewContainerRef: ViewContainerRef\n ) {}\n\n public ngAfterViewInit() {\n this.subscription = this.formDirective.loading$.pipe(\n distinctUntilChanged(),\n tap(loading => {\n this.viewContainerRef.clear();\n if (loading) {\n this.viewContainerRef.createEmbeddedView(this.template);\n }\n })\n ).subscribe();\n }\n\n public ngOnDestroy() {\n this.subscription?.unsubscribe();\n }\n\n}\n"]}
@@ -1,42 +0,0 @@
1
- import { Directive, Inject, TemplateRef, ViewContainerRef } from '@angular/core';
2
- import { FormDirective } from './form.directive';
3
- import { tap } from 'rxjs/operators';
4
- import * as i0 from "@angular/core";
5
- import * as i1 from "./form.directive";
6
- export class FormSubmitFailedDirective {
7
- constructor(formDirective, template, viewContainerRef) {
8
- this.formDirective = formDirective;
9
- this.template = template;
10
- this.viewContainerRef = viewContainerRef;
11
- }
12
- ngAfterViewInit() {
13
- this.subscription = this.formDirective.submitError$.pipe(tap(error => {
14
- this.viewContainerRef.clear();
15
- if (error !== null) {
16
- this.viewContainerRef.createEmbeddedView(this.template, { $implicit: error });
17
- }
18
- })).subscribe();
19
- }
20
- ngOnDestroy() {
21
- var _a;
22
- (_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
23
- }
24
- }
25
- FormSubmitFailedDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: FormSubmitFailedDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
26
- FormSubmitFailedDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.1", type: FormSubmitFailedDirective, selector: "[rxapFormSubmitFailed]", ngImport: i0 });
27
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: FormSubmitFailedDirective, decorators: [{
28
- type: Directive,
29
- args: [{
30
- selector: '[rxapFormSubmitFailed]'
31
- }]
32
- }], ctorParameters: function () { return [{ type: i1.FormDirective, decorators: [{
33
- type: Inject,
34
- args: [FormDirective]
35
- }] }, { type: i0.TemplateRef, decorators: [{
36
- type: Inject,
37
- args: [TemplateRef]
38
- }] }, { type: i0.ViewContainerRef, decorators: [{
39
- type: Inject,
40
- args: [ViewContainerRef]
41
- }] }]; } });
42
- //# sourceMappingURL=form-submit-failed.directive.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"form-submit-failed.directive.js","sourceRoot":"","sources":["../../../../../../libs/forms/src/lib/directives/form-submit-failed.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,MAAM,EACN,WAAW,EACX,gBAAgB,EAGjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;;;AAKrC,MAAM,OAAO,yBAAyB;IAIpC,YAC0C,aAA4B,EAC9B,QAA2C,EACtC,gBAAkC;QAFrC,kBAAa,GAAb,aAAa,CAAe;QAC9B,aAAQ,GAAR,QAAQ,CAAmC;QACtC,qBAAgB,GAAhB,gBAAgB,CAAkB;IAC5E,CAAC;IAEG,eAAe;QACpB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,IAAI,CACtD,GAAG,CAAC,KAAK,CAAC,EAAE;YACV,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,CAAC;YAC9B,IAAI,KAAK,KAAK,IAAI,EAAE;gBAClB,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;aAC/E;QACH,CAAC,CAAC,CACH,CAAC,SAAS,EAAE,CAAC;IAChB,CAAC;IAEM,WAAW;;QAChB,MAAA,IAAI,CAAC,YAAY,0CAAE,WAAW,EAAE,CAAC;IACnC,CAAC;;sHAvBU,yBAAyB,kBAK1B,aAAa,aACb,WAAW,aACX,gBAAgB;0GAPf,yBAAyB;2FAAzB,yBAAyB;kBAHrC,SAAS;mBAAC;oBACT,QAAQ,EAAE,wBAAwB;iBACnC;;0BAMI,MAAM;2BAAC,aAAa;;0BACpB,MAAM;2BAAC,WAAW;;0BAClB,MAAM;2BAAC,gBAAgB","sourcesContent":["import {\n Directive,\n Inject,\n TemplateRef,\n ViewContainerRef,\n OnDestroy,\n AfterViewInit\n} from '@angular/core';\nimport { FormDirective } from './form.directive';\nimport { Subscription } from 'rxjs';\nimport { tap } from 'rxjs/operators';\n\n@Directive({\n selector: '[rxapFormSubmitFailed]'\n})\nexport class FormSubmitFailedDirective implements AfterViewInit, OnDestroy {\n\n private subscription?: Subscription;\n\n constructor(\n @Inject(FormDirective) private readonly formDirective: FormDirective,\n @Inject(TemplateRef) private readonly template: TemplateRef<{ $implicit: Error }>,\n @Inject(ViewContainerRef) private readonly viewContainerRef: ViewContainerRef\n ) {}\n\n public ngAfterViewInit() {\n this.subscription = this.formDirective.submitError$.pipe(\n tap(error => {\n this.viewContainerRef.clear();\n if (error !== null) {\n this.viewContainerRef.createEmbeddedView(this.template, { $implicit: error });\n }\n })\n ).subscribe();\n }\n\n public ngOnDestroy() {\n this.subscription?.unsubscribe();\n }\n\n}\n"]}
@@ -1,40 +0,0 @@
1
- import { Directive, Inject, TemplateRef, ViewContainerRef } from '@angular/core';
2
- import { FormDirective } from './form.directive';
3
- import { tap } from 'rxjs/operators';
4
- import * as i0 from "@angular/core";
5
- import * as i1 from "./form.directive";
6
- export class FormSubmitInvalidDirective {
7
- constructor(formDirective, template, viewContainerRef) {
8
- this.formDirective = formDirective;
9
- this.template = template;
10
- this.viewContainerRef = viewContainerRef;
11
- }
12
- ngAfterViewInit() {
13
- this.subscription = this.formDirective.invalidSubmit.pipe(tap(result => {
14
- this.viewContainerRef.clear();
15
- this.viewContainerRef.createEmbeddedView(this.template, { $implicit: result });
16
- })).subscribe();
17
- }
18
- ngOnDestroy() {
19
- var _a;
20
- (_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
21
- }
22
- }
23
- FormSubmitInvalidDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: FormSubmitInvalidDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
24
- FormSubmitInvalidDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.1", type: FormSubmitInvalidDirective, selector: "[rxapFormSubmitInvalid]", ngImport: i0 });
25
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: FormSubmitInvalidDirective, decorators: [{
26
- type: Directive,
27
- args: [{
28
- selector: '[rxapFormSubmitInvalid]'
29
- }]
30
- }], ctorParameters: function () { return [{ type: i1.FormDirective, decorators: [{
31
- type: Inject,
32
- args: [FormDirective]
33
- }] }, { type: i0.TemplateRef, decorators: [{
34
- type: Inject,
35
- args: [TemplateRef]
36
- }] }, { type: i0.ViewContainerRef, decorators: [{
37
- type: Inject,
38
- args: [ViewContainerRef]
39
- }] }]; } });
40
- //# sourceMappingURL=form-submit-invalid.directive.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"form-submit-invalid.directive.js","sourceRoot":"","sources":["../../../../../../libs/forms/src/lib/directives/form-submit-invalid.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,MAAM,EACN,WAAW,EACX,gBAAgB,EAGjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;;;AAKrC,MAAM,OAAO,0BAA0B;IAIrC,YAC0C,aAA4B,EAC9B,QAAyC,EACpC,gBAAkC;QAFrC,kBAAa,GAAb,aAAa,CAAe;QAC9B,aAAQ,GAAR,QAAQ,CAAiC;QACpC,qBAAgB,GAAhB,gBAAgB,CAAkB;IAC5E,CAAC;IAEG,eAAe;QACpB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,IAAI,CACvD,GAAG,CAAC,MAAM,CAAC,EAAE;YACX,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,CAAC;YAC9B,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC;QACjF,CAAC,CAAC,CACH,CAAC,SAAS,EAAE,CAAC;IAChB,CAAC;IAEM,WAAW;;QAChB,MAAA,IAAI,CAAC,YAAY,0CAAE,WAAW,EAAE,CAAC;IACnC,CAAC;;uHArBU,0BAA0B,kBAK3B,aAAa,aACb,WAAW,aACX,gBAAgB;2GAPf,0BAA0B;2FAA1B,0BAA0B;kBAHtC,SAAS;mBAAC;oBACT,QAAQ,EAAE,yBAAyB;iBACpC;;0BAMI,MAAM;2BAAC,aAAa;;0BACpB,MAAM;2BAAC,WAAW;;0BAClB,MAAM;2BAAC,gBAAgB","sourcesContent":["import {\n Directive,\n Inject,\n TemplateRef,\n ViewContainerRef,\n OnDestroy,\n AfterViewInit\n} from '@angular/core';\nimport { FormDirective } from './form.directive';\nimport { Subscription } from 'rxjs';\nimport { tap } from 'rxjs/operators';\n\n@Directive({\n selector: '[rxapFormSubmitInvalid]'\n})\nexport class FormSubmitInvalidDirective implements AfterViewInit, OnDestroy {\n\n private subscription?: Subscription;\n\n constructor(\n @Inject(FormDirective) private readonly formDirective: FormDirective,\n @Inject(TemplateRef) private readonly template: TemplateRef<{ $implicit: any }>,\n @Inject(ViewContainerRef) private readonly viewContainerRef: ViewContainerRef\n ) {}\n\n public ngAfterViewInit() {\n this.subscription = this.formDirective.invalidSubmit.pipe(\n tap(result => {\n this.viewContainerRef.clear();\n this.viewContainerRef.createEmbeddedView(this.template, { $implicit: result });\n })\n ).subscribe();\n }\n\n public ngOnDestroy() {\n this.subscription?.unsubscribe();\n }\n\n}\n"]}
@@ -1,40 +0,0 @@
1
- import { Directive, Inject, TemplateRef, ViewContainerRef } from '@angular/core';
2
- import { FormDirective } from './form.directive';
3
- import { tap } from 'rxjs/operators';
4
- import * as i0 from "@angular/core";
5
- import * as i1 from "./form.directive";
6
- export class FormSubmitSuccessfulDirective {
7
- constructor(formDirective, template, viewContainerRef) {
8
- this.formDirective = formDirective;
9
- this.template = template;
10
- this.viewContainerRef = viewContainerRef;
11
- }
12
- ngAfterViewInit() {
13
- this.subscription = this.formDirective.submitSuccessful$.pipe(tap(result => {
14
- this.viewContainerRef.clear();
15
- this.viewContainerRef.createEmbeddedView(this.template, { $implicit: result });
16
- })).subscribe();
17
- }
18
- ngOnDestroy() {
19
- var _a;
20
- (_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
21
- }
22
- }
23
- FormSubmitSuccessfulDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: FormSubmitSuccessfulDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
24
- FormSubmitSuccessfulDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.1", type: FormSubmitSuccessfulDirective, selector: "[rxapFormSubmitSuccessful]", ngImport: i0 });
25
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: FormSubmitSuccessfulDirective, decorators: [{
26
- type: Directive,
27
- args: [{
28
- selector: '[rxapFormSubmitSuccessful]'
29
- }]
30
- }], ctorParameters: function () { return [{ type: i1.FormDirective, decorators: [{
31
- type: Inject,
32
- args: [FormDirective]
33
- }] }, { type: i0.TemplateRef, decorators: [{
34
- type: Inject,
35
- args: [TemplateRef]
36
- }] }, { type: i0.ViewContainerRef, decorators: [{
37
- type: Inject,
38
- args: [ViewContainerRef]
39
- }] }]; } });
40
- //# sourceMappingURL=form-submit-successful.directive.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"form-submit-successful.directive.js","sourceRoot":"","sources":["../../../../../../libs/forms/src/lib/directives/form-submit-successful.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,MAAM,EACN,WAAW,EACX,gBAAgB,EAGjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;;;AAKrC,MAAM,OAAO,6BAA6B;IAIxC,YAC0C,aAA4B,EAC9B,QAAyC,EACpC,gBAAkC;QAFrC,kBAAa,GAAb,aAAa,CAAe;QAC9B,aAAQ,GAAR,QAAQ,CAAiC;QACpC,qBAAgB,GAAhB,gBAAgB,CAAkB;IAC5E,CAAC;IAEG,eAAe;QACpB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,IAAI,CAC3D,GAAG,CAAC,MAAM,CAAC,EAAE;YACX,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,CAAC;YAC9B,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC;QACjF,CAAC,CAAC,CACH,CAAC,SAAS,EAAE,CAAC;IAChB,CAAC;IAEM,WAAW;;QAChB,MAAA,IAAI,CAAC,YAAY,0CAAE,WAAW,EAAE,CAAC;IACnC,CAAC;;0HArBU,6BAA6B,kBAK9B,aAAa,aACb,WAAW,aACX,gBAAgB;8GAPf,6BAA6B;2FAA7B,6BAA6B;kBAHzC,SAAS;mBAAC;oBACT,QAAQ,EAAE,4BAA4B;iBACvC;;0BAMI,MAAM;2BAAC,aAAa;;0BACpB,MAAM;2BAAC,WAAW;;0BAClB,MAAM;2BAAC,gBAAgB","sourcesContent":["import {\n Directive,\n Inject,\n TemplateRef,\n ViewContainerRef,\n OnDestroy,\n AfterViewInit\n} from '@angular/core';\nimport { FormDirective } from './form.directive';\nimport { Subscription } from 'rxjs';\nimport { tap } from 'rxjs/operators';\n\n@Directive({\n selector: '[rxapFormSubmitSuccessful]'\n})\nexport class FormSubmitSuccessfulDirective implements AfterViewInit, OnDestroy {\n\n private subscription?: Subscription;\n\n constructor(\n @Inject(FormDirective) private readonly formDirective: FormDirective,\n @Inject(TemplateRef) private readonly template: TemplateRef<{ $implicit: any }>,\n @Inject(ViewContainerRef) private readonly viewContainerRef: ViewContainerRef\n ) {}\n\n public ngAfterViewInit() {\n this.subscription = this.formDirective.submitSuccessful$.pipe(\n tap(result => {\n this.viewContainerRef.clear();\n this.viewContainerRef.createEmbeddedView(this.template, { $implicit: result });\n })\n ).subscribe();\n }\n\n public ngOnDestroy() {\n this.subscription?.unsubscribe();\n }\n\n}\n"]}
@@ -1,75 +0,0 @@
1
- import { Directive, Inject, Input, Optional, HostBinding, EventEmitter, Output } from '@angular/core';
2
- import { coerceBoolean } from '@rxap/utilities';
3
- import { FormDirective } from './form.directive';
4
- import { tap, take } from 'rxjs/operators';
5
- import { Router } from '@angular/router';
6
- import { ConfirmClick } from '@rxap/directives';
7
- import * as i0 from "@angular/core";
8
- import * as i1 from "./form.directive";
9
- import * as i2 from "@angular/router";
10
- export class FormSubmitDirective extends ConfirmClick {
11
- constructor(formDirective, router = null) {
12
- super();
13
- this.formDirective = formDirective;
14
- this.router = router;
15
- this.type = 'button';
16
- this.afterSubmit = new EventEmitter();
17
- this._resetAfterSubmit = false;
18
- }
19
- set resetAfterSubmit(value) {
20
- this._resetAfterSubmit = coerceBoolean(value);
21
- }
22
- execute() {
23
- this.subscription = this.formDirective.rxapSubmit.pipe(take(1), tap(event => {
24
- this.afterSubmit.emit(event);
25
- if (this._resetAfterSubmit) {
26
- this.formDirective.reset();
27
- }
28
- if (this.navigateAfterSubmit) {
29
- if (!this.router) {
30
- throw new Error('Could not resolve the router!');
31
- }
32
- return this.router.navigate(this.navigateAfterSubmit);
33
- }
34
- return Promise.resolve();
35
- })).subscribe();
36
- this.formDirective.onSubmit(new Event('submit'));
37
- }
38
- ngOnDestroy() {
39
- var _a;
40
- (_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
41
- }
42
- }
43
- FormSubmitDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: FormSubmitDirective, deps: [{ token: FormDirective }, { token: Router, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
44
- FormSubmitDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.1", type: FormSubmitDirective, selector: "[rxapFormSubmit]", inputs: { type: "type", resetAfterSubmit: "resetAfterSubmit", navigateAfterSubmit: "navigateAfterSubmit" }, outputs: { afterSubmit: "afterSubmit" }, host: { listeners: { "click": "onClick()", "confirmed": "onConfirm()" }, properties: { "type": "this.type" } }, usesInheritance: true, ngImport: i0 });
45
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: FormSubmitDirective, decorators: [{
46
- type: Directive,
47
- args: [{
48
- selector: '[rxapFormSubmit]',
49
- host: {
50
- '(click)': 'onClick()',
51
- '(confirmed)': 'onConfirm()',
52
- }
53
- }]
54
- }], ctorParameters: function () { return [{ type: i1.FormDirective, decorators: [{
55
- type: Inject,
56
- args: [FormDirective]
57
- }] }, { type: i2.Router, decorators: [{
58
- type: Optional
59
- }, {
60
- type: Inject,
61
- args: [Router]
62
- }] }]; }, propDecorators: { type: [{
63
- type: HostBinding,
64
- args: ['type']
65
- }, {
66
- type: Input
67
- }], resetAfterSubmit: [{
68
- type: Input,
69
- args: ['resetAfterSubmit']
70
- }], navigateAfterSubmit: [{
71
- type: Input
72
- }], afterSubmit: [{
73
- type: Output
74
- }] } });
75
- //# sourceMappingURL=form-submit.directive.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"form-submit.directive.js","sourceRoot":"","sources":["../../../../../../libs/forms/src/lib/directives/form-submit.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,MAAM,EACN,KAAK,EAEL,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,MAAM,EACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EACL,GAAG,EACH,IAAI,EACL,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;;;;AAShD,MAAM,OAAO,mBAAoB,SAAQ,YAAY;IAqBnD,YAC0C,aAA4B,EAGnD,SAAwB,IAAI;QAE7C,KAAK,EAAE,CAAA;QALiC,kBAAa,GAAb,aAAa,CAAe;QAGnD,WAAM,GAAN,MAAM,CAAsB;QArBxC,SAAI,GAAW,QAAQ,CAAA;QAWvB,gBAAW,GAAG,IAAI,YAAY,EAAE,CAAC;QAEhC,sBAAiB,GAAY,KAAK,CAAC;IAW3C,CAAC;IAtBD,IACW,gBAAgB,CAAC,KAAmB;QAC7C,IAAI,CAAC,iBAAiB,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IAChD,CAAC;IAqBS,OAAO;QACf,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,IAAI,CACpD,IAAI,CAAC,CAAC,CAAC,EACP,GAAG,CAAC,KAAK,CAAC,EAAE;YACV,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC7B,IAAI,IAAI,CAAC,iBAAiB,EAAE;gBAC1B,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;aAC5B;YACD,IAAI,IAAI,CAAC,mBAAmB,EAAE;gBAE5B,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;oBAChB,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;iBAClD;gBAED,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;aACvD;YACD,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;QAC3B,CAAC,CAAC,CACH,CAAC,SAAS,EAAE,CAAC;QACd,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;IACnD,CAAC;IAEM,WAAW;;QAChB,MAAA,IAAI,CAAC,YAAY,0CAAE,WAAW,EAAE,CAAC;IACnC,CAAC;;gHAtDU,mBAAmB,kBAsBpB,aAAa,aAEb,MAAM;oGAxBL,mBAAmB;2FAAnB,mBAAmB;kBAP/B,SAAS;mBAAC;oBACT,QAAQ,EAAE,kBAAkB;oBAC5B,IAAI,EAAE;wBACJ,SAAS,EAAE,WAAW;wBACtB,aAAa,EAAE,aAAa;qBAC7B;iBACF;;0BAuBI,MAAM;2BAAC,aAAa;;0BACpB,QAAQ;;0BACR,MAAM;2BAAC,MAAM;4CApBT,IAAI;sBAFV,WAAW;uBAAC,MAAM;;sBAClB,KAAK;gBAIK,gBAAgB;sBAD1B,KAAK;uBAAC,kBAAkB;gBAMlB,mBAAmB;sBADzB,KAAK;gBAIC,WAAW;sBADjB,MAAM","sourcesContent":["import {\n Directive,\n Inject,\n Input,\n OnDestroy,\n Optional,\n HostBinding,\n EventEmitter,\n Output\n} from '@angular/core';\nimport { coerceBoolean } from '@rxap/utilities';\nimport { FormDirective } from './form.directive';\nimport {\n tap,\n take\n} from 'rxjs/operators';\nimport { Subscription } from 'rxjs';\nimport { Router } from '@angular/router';\nimport { ConfirmClick } from '@rxap/directives';\n\n@Directive({\n selector: '[rxapFormSubmit]',\n host: {\n '(click)': 'onClick()',\n '(confirmed)': 'onConfirm()',\n }\n})\nexport class FormSubmitDirective extends ConfirmClick implements OnDestroy {\n\n @HostBinding('type')\n @Input()\n public type: string = 'button'\n\n @Input('resetAfterSubmit')\n public set resetAfterSubmit(value: boolean | '') {\n this._resetAfterSubmit = coerceBoolean(value);\n }\n\n @Input()\n public navigateAfterSubmit?: string[];\n\n @Output()\n public afterSubmit = new EventEmitter();\n\n private _resetAfterSubmit: boolean = false;\n\n private subscription?: Subscription;\n\n constructor(\n @Inject(FormDirective) private readonly formDirective: FormDirective,\n @Optional()\n @Inject(Router)\n private readonly router: Router | null = null\n ) {\n super()\n }\n\n protected execute() {\n this.subscription = this.formDirective.rxapSubmit.pipe(\n take(1),\n tap(event => {\n this.afterSubmit.emit(event);\n if (this._resetAfterSubmit) {\n this.formDirective.reset();\n }\n if (this.navigateAfterSubmit) {\n\n if (!this.router) {\n throw new Error('Could not resolve the router!');\n }\n\n return this.router.navigate(this.navigateAfterSubmit);\n }\n return Promise.resolve();\n })\n ).subscribe();\n this.formDirective.onSubmit(new Event('submit'));\n }\n\n public ngOnDestroy() {\n this.subscription?.unsubscribe();\n }\n\n}\n"]}
@@ -1,42 +0,0 @@
1
- import { Directive, Inject, TemplateRef, ViewContainerRef } from '@angular/core';
2
- import { FormDirective } from './form.directive';
3
- import { tap, distinctUntilChanged } from 'rxjs/operators';
4
- import * as i0 from "@angular/core";
5
- import * as i1 from "./form.directive";
6
- export class FormSubmittingDirective {
7
- constructor(formDirective, template, viewContainerRef) {
8
- this.formDirective = formDirective;
9
- this.template = template;
10
- this.viewContainerRef = viewContainerRef;
11
- }
12
- ngAfterViewInit() {
13
- this.subscription = this.formDirective.submitting$.pipe(distinctUntilChanged(), tap(loading => {
14
- this.viewContainerRef.clear();
15
- if (loading) {
16
- this.viewContainerRef.createEmbeddedView(this.template);
17
- }
18
- })).subscribe();
19
- }
20
- ngOnDestroy() {
21
- var _a;
22
- (_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
23
- }
24
- }
25
- FormSubmittingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: FormSubmittingDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
26
- FormSubmittingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.1", type: FormSubmittingDirective, selector: "[rxapFormSubmitting]", ngImport: i0 });
27
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: FormSubmittingDirective, decorators: [{
28
- type: Directive,
29
- args: [{
30
- selector: '[rxapFormSubmitting]'
31
- }]
32
- }], ctorParameters: function () { return [{ type: i1.FormDirective, decorators: [{
33
- type: Inject,
34
- args: [FormDirective]
35
- }] }, { type: i0.TemplateRef, decorators: [{
36
- type: Inject,
37
- args: [TemplateRef]
38
- }] }, { type: i0.ViewContainerRef, decorators: [{
39
- type: Inject,
40
- args: [ViewContainerRef]
41
- }] }]; } });
42
- //# sourceMappingURL=form-submitting.directive.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"form-submitting.directive.js","sourceRoot":"","sources":["../../../../../../libs/forms/src/lib/directives/form-submitting.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,MAAM,EACN,WAAW,EACX,gBAAgB,EAGjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EACL,GAAG,EACH,oBAAoB,EACrB,MAAM,gBAAgB,CAAC;;;AAKxB,MAAM,OAAO,uBAAuB;IAIlC,YAC0C,aAA4B,EAC9B,QAA2B,EACtB,gBAAkC;QAFrC,kBAAa,GAAb,aAAa,CAAe;QAC9B,aAAQ,GAAR,QAAQ,CAAmB;QACtB,qBAAgB,GAAhB,gBAAgB,CAAkB;IAC5E,CAAC;IAEG,eAAe;QACpB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,CACrD,oBAAoB,EAAE,EACtB,GAAG,CAAC,OAAO,CAAC,EAAE;YACZ,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,CAAC;YAC9B,IAAI,OAAO,EAAE;gBACX,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;aACzD;QACH,CAAC,CAAC,CACH,CAAC,SAAS,EAAE,CAAC;IAChB,CAAC;IAEM,WAAW;;QAChB,MAAA,IAAI,CAAC,YAAY,0CAAE,WAAW,EAAE,CAAC;IACnC,CAAC;;oHAxBU,uBAAuB,kBAKxB,aAAa,aACb,WAAW,aACX,gBAAgB;wGAPf,uBAAuB;2FAAvB,uBAAuB;kBAHnC,SAAS;mBAAC;oBACT,QAAQ,EAAE,sBAAsB;iBACjC;;0BAMI,MAAM;2BAAC,aAAa;;0BACpB,MAAM;2BAAC,WAAW;;0BAClB,MAAM;2BAAC,gBAAgB","sourcesContent":["import {\n Directive,\n Inject,\n TemplateRef,\n ViewContainerRef,\n OnDestroy,\n AfterViewInit\n} from '@angular/core';\nimport { FormDirective } from './form.directive';\nimport { Subscription } from 'rxjs';\nimport {\n tap,\n distinctUntilChanged\n} from 'rxjs/operators';\n\n@Directive({\n selector: '[rxapFormSubmitting]'\n})\nexport class FormSubmittingDirective implements AfterViewInit, OnDestroy {\n\n private subscription?: Subscription;\n\n constructor(\n @Inject(FormDirective) private readonly formDirective: FormDirective,\n @Inject(TemplateRef) private readonly template: TemplateRef<void>,\n @Inject(ViewContainerRef) private readonly viewContainerRef: ViewContainerRef\n ) {}\n\n public ngAfterViewInit() {\n this.subscription = this.formDirective.submitting$.pipe(\n distinctUntilChanged(),\n tap(loading => {\n this.viewContainerRef.clear();\n if (loading) {\n this.viewContainerRef.createEmbeddedView(this.template);\n }\n })\n ).subscribe();\n }\n\n public ngOnDestroy() {\n this.subscription?.unsubscribe();\n }\n\n}\n"]}