@ngxs/form-plugin 3.8.1-dev.master-5828e37 → 3.8.1-dev.master-98beeea

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.
@@ -0,0 +1,334 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Directive, Input, NgModule, makeEnvironmentProviders } from '@angular/core';
3
+ import * as i1 from '@ngxs/store';
4
+ import { getActionTypeFromInstance, setValue, getValue, ofActionDispatched, NGXS_PLUGINS, withNgxsPlugin } from '@ngxs/store';
5
+ import * as i2 from '@angular/forms';
6
+ import { Subject } from 'rxjs';
7
+ import { filter, takeUntil, distinctUntilChanged, debounceTime } from 'rxjs/operators';
8
+
9
+ class UpdateFormStatus {
10
+ constructor(payload) {
11
+ this.payload = payload;
12
+ }
13
+ }
14
+ UpdateFormStatus.type = '[Forms] Update Form Status';
15
+ class UpdateFormValue {
16
+ constructor(payload) {
17
+ this.payload = payload;
18
+ }
19
+ }
20
+ UpdateFormValue.type = '[Forms] Update Form Value';
21
+ class UpdateForm {
22
+ constructor(payload) {
23
+ this.payload = payload;
24
+ }
25
+ }
26
+ UpdateForm.type = '[Forms] Update Form';
27
+ class UpdateFormDirty {
28
+ constructor(payload) {
29
+ this.payload = payload;
30
+ }
31
+ }
32
+ UpdateFormDirty.type = '[Forms] Update Form Dirty';
33
+ class SetFormDirty {
34
+ constructor(payload) {
35
+ this.payload = payload;
36
+ }
37
+ }
38
+ SetFormDirty.type = '[Forms] Set Form Dirty';
39
+ class SetFormPristine {
40
+ constructor(payload) {
41
+ this.payload = payload;
42
+ }
43
+ }
44
+ SetFormPristine.type = '[Forms] Set Form Pristine';
45
+ class UpdateFormErrors {
46
+ constructor(payload) {
47
+ this.payload = payload;
48
+ }
49
+ }
50
+ UpdateFormErrors.type = '[Forms] Update Form Errors';
51
+ class SetFormDisabled {
52
+ constructor(payload) {
53
+ this.payload = payload;
54
+ }
55
+ }
56
+ SetFormDisabled.type = '[Forms] Set Form Disabled';
57
+ class SetFormEnabled {
58
+ constructor(payload) {
59
+ this.payload = payload;
60
+ }
61
+ }
62
+ SetFormEnabled.type = '[Forms] Set Form Enabled';
63
+ class ResetForm {
64
+ constructor(payload) {
65
+ this.payload = payload;
66
+ }
67
+ }
68
+ ResetForm.type = '[Forms] Reset Form';
69
+
70
+ class NgxsFormPlugin {
71
+ handle(state, event, next) {
72
+ const type = getActionTypeFromInstance(event);
73
+ let nextState = state;
74
+ if (type === UpdateFormValue.type || type === UpdateForm.type || type === ResetForm.type) {
75
+ const { value } = event.payload;
76
+ const payloadValue = Array.isArray(value)
77
+ ? value.slice()
78
+ : isObjectLike(value)
79
+ ? { ...value }
80
+ : value;
81
+ const path = this.joinPathWithPropertyPath(event);
82
+ nextState = setValue(nextState, path, payloadValue);
83
+ }
84
+ if (type === ResetForm.type) {
85
+ const model = getValue(nextState, `${event.payload.path}.model`);
86
+ nextState = setValue(nextState, `${event.payload.path}`, { model: model });
87
+ }
88
+ if (type === UpdateFormStatus.type || type === UpdateForm.type) {
89
+ nextState = setValue(nextState, `${event.payload.path}.status`, event.payload.status);
90
+ }
91
+ if (type === UpdateFormErrors.type || type === UpdateForm.type) {
92
+ nextState = setValue(nextState, `${event.payload.path}.errors`, {
93
+ ...event.payload.errors
94
+ });
95
+ }
96
+ if (type === UpdateFormDirty.type || type === UpdateForm.type) {
97
+ nextState = setValue(nextState, `${event.payload.path}.dirty`, event.payload.dirty);
98
+ }
99
+ if (type === SetFormDirty.type) {
100
+ nextState = setValue(nextState, `${event.payload}.dirty`, true);
101
+ }
102
+ if (type === SetFormPristine.type) {
103
+ nextState = setValue(nextState, `${event.payload}.dirty`, false);
104
+ }
105
+ if (type === SetFormDisabled.type) {
106
+ nextState = setValue(nextState, `${event.payload}.disabled`, true);
107
+ }
108
+ if (type === SetFormEnabled.type) {
109
+ nextState = setValue(nextState, `${event.payload}.disabled`, false);
110
+ }
111
+ return next(nextState, event);
112
+ }
113
+ joinPathWithPropertyPath({ payload }) {
114
+ let path = `${payload.path}.model`;
115
+ if (payload.propertyPath) {
116
+ path += `.${payload.propertyPath}`;
117
+ }
118
+ return path;
119
+ }
120
+ }
121
+ /** @nocollapse */ NgxsFormPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: NgxsFormPlugin, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
122
+ /** @nocollapse */ NgxsFormPlugin.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: NgxsFormPlugin });
123
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: NgxsFormPlugin, decorators: [{
124
+ type: Injectable
125
+ }] });
126
+ function isObjectLike(target) {
127
+ return target !== null && typeof target === 'object';
128
+ }
129
+
130
+ class NgxsFormDirective {
131
+ constructor(_actions$, _store, _formGroupDirective, _cd) {
132
+ this._actions$ = _actions$;
133
+ this._store = _store;
134
+ this._formGroupDirective = _formGroupDirective;
135
+ this._cd = _cd;
136
+ this.path = null;
137
+ this._debounce = 100;
138
+ this._clearDestroy = false;
139
+ this._updating = false;
140
+ this._destroy$ = new Subject();
141
+ }
142
+ set debounce(debounce) {
143
+ this._debounce = Number(debounce);
144
+ }
145
+ get debounce() {
146
+ return this._debounce;
147
+ }
148
+ set clearDestroy(val) {
149
+ this._clearDestroy = val != null && `${val}` !== 'false';
150
+ }
151
+ get clearDestroy() {
152
+ return this._clearDestroy;
153
+ }
154
+ ngOnInit() {
155
+ this._actions$
156
+ .pipe(ofActionDispatched(ResetForm), filter((action) => action.payload.path === this.path), takeUntil(this._destroy$))
157
+ .subscribe(({ payload: { value } }) => {
158
+ this.form.reset(value);
159
+ this.updateFormStateWithRawValue(true);
160
+ this._cd.markForCheck();
161
+ });
162
+ this.getStateStream(`${this.path}.model`).subscribe(model => {
163
+ if (this._updating || !model) {
164
+ return;
165
+ }
166
+ this.form.patchValue(model);
167
+ this._cd.markForCheck();
168
+ });
169
+ this.getStateStream(`${this.path}.dirty`).subscribe(dirty => {
170
+ if (this.form.dirty === dirty || typeof dirty !== 'boolean') {
171
+ return;
172
+ }
173
+ if (dirty) {
174
+ this.form.markAsDirty();
175
+ }
176
+ else {
177
+ this.form.markAsPristine();
178
+ }
179
+ this._cd.markForCheck();
180
+ });
181
+ // On first state change, sync form model, status and dirty with state
182
+ this._store
183
+ .selectOnce(state => getValue(state, this.path))
184
+ .subscribe(() => {
185
+ this._store.dispatch([
186
+ new UpdateFormValue({
187
+ path: this.path,
188
+ value: this.form.getRawValue()
189
+ }),
190
+ new UpdateFormStatus({
191
+ path: this.path,
192
+ status: this.form.status
193
+ }),
194
+ new UpdateFormDirty({
195
+ path: this.path,
196
+ dirty: this.form.dirty
197
+ })
198
+ ]);
199
+ });
200
+ this.getStateStream(`${this.path}.disabled`).subscribe(disabled => {
201
+ if (this.form.disabled === disabled || typeof disabled !== 'boolean') {
202
+ return;
203
+ }
204
+ if (disabled) {
205
+ this.form.disable();
206
+ }
207
+ else {
208
+ this.form.enable();
209
+ }
210
+ this._cd.markForCheck();
211
+ });
212
+ this._formGroupDirective
213
+ .valueChanges.pipe(distinctUntilChanged((a, b) => JSON.stringify(a) === JSON.stringify(b)), this.debounceChange())
214
+ .subscribe(() => {
215
+ this.updateFormStateWithRawValue();
216
+ });
217
+ this._formGroupDirective
218
+ .statusChanges.pipe(distinctUntilChanged(), this.debounceChange())
219
+ .subscribe((status) => {
220
+ this._store.dispatch(new UpdateFormStatus({
221
+ status,
222
+ path: this.path
223
+ }));
224
+ });
225
+ }
226
+ updateFormStateWithRawValue(withFormStatus) {
227
+ if (this._updating)
228
+ return;
229
+ const value = this._formGroupDirective.control.getRawValue();
230
+ const actions = [
231
+ new UpdateFormValue({
232
+ path: this.path,
233
+ value
234
+ }),
235
+ new UpdateFormDirty({
236
+ path: this.path,
237
+ dirty: this._formGroupDirective.dirty
238
+ }),
239
+ new UpdateFormErrors({
240
+ path: this.path,
241
+ errors: this._formGroupDirective.errors
242
+ })
243
+ ];
244
+ if (withFormStatus) {
245
+ actions.push(new UpdateFormStatus({
246
+ path: this.path,
247
+ status: this._formGroupDirective.status
248
+ }));
249
+ }
250
+ this._updating = true;
251
+ this._store.dispatch(actions).subscribe({
252
+ error: () => (this._updating = false),
253
+ complete: () => (this._updating = false)
254
+ });
255
+ }
256
+ ngOnDestroy() {
257
+ this._destroy$.next();
258
+ if (this.clearDestroy) {
259
+ this._store.dispatch(new UpdateForm({
260
+ path: this.path,
261
+ value: null,
262
+ dirty: null,
263
+ status: null,
264
+ errors: null
265
+ }));
266
+ }
267
+ }
268
+ debounceChange() {
269
+ const skipDebounceTime = this._formGroupDirective.control.updateOn !== 'change' || this._debounce < 0;
270
+ return skipDebounceTime
271
+ ? (change) => change.pipe(takeUntil(this._destroy$))
272
+ : (change) => change.pipe(debounceTime(this._debounce), takeUntil(this._destroy$));
273
+ }
274
+ get form() {
275
+ return this._formGroupDirective.form;
276
+ }
277
+ getStateStream(path) {
278
+ return this._store.select(state => getValue(state, path)).pipe(takeUntil(this._destroy$));
279
+ }
280
+ }
281
+ /** @nocollapse */ NgxsFormDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: NgxsFormDirective, deps: [{ token: i1.Actions }, { token: i1.Store }, { token: i2.FormGroupDirective }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
282
+ /** @nocollapse */ NgxsFormDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.4", type: NgxsFormDirective, isStandalone: true, selector: "[ngxsForm]", inputs: { path: ["ngxsForm", "path"], debounce: ["ngxsFormDebounce", "debounce"], clearDestroy: ["ngxsFormClearOnDestroy", "clearDestroy"] }, ngImport: i0 });
283
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: NgxsFormDirective, decorators: [{
284
+ type: Directive,
285
+ args: [{ selector: '[ngxsForm]', standalone: true }]
286
+ }], ctorParameters: function () { return [{ type: i1.Actions }, { type: i1.Store }, { type: i2.FormGroupDirective }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { path: [{
287
+ type: Input,
288
+ args: ['ngxsForm']
289
+ }], debounce: [{
290
+ type: Input,
291
+ args: ['ngxsFormDebounce']
292
+ }], clearDestroy: [{
293
+ type: Input,
294
+ args: ['ngxsFormClearOnDestroy']
295
+ }] } });
296
+
297
+ class NgxsFormPluginModule {
298
+ static forRoot() {
299
+ return {
300
+ ngModule: NgxsFormPluginModule,
301
+ providers: [
302
+ {
303
+ provide: NGXS_PLUGINS,
304
+ useClass: NgxsFormPlugin,
305
+ multi: true
306
+ }
307
+ ]
308
+ };
309
+ }
310
+ }
311
+ /** @nocollapse */ NgxsFormPluginModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: NgxsFormPluginModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
312
+ /** @nocollapse */ NgxsFormPluginModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.4", ngImport: i0, type: NgxsFormPluginModule, imports: [NgxsFormDirective], exports: [NgxsFormDirective] });
313
+ /** @nocollapse */ NgxsFormPluginModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: NgxsFormPluginModule });
314
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: NgxsFormPluginModule, decorators: [{
315
+ type: NgModule,
316
+ args: [{
317
+ imports: [NgxsFormDirective],
318
+ exports: [NgxsFormDirective]
319
+ }]
320
+ }] });
321
+ function withNgxsFormPlugin() {
322
+ return makeEnvironmentProviders([withNgxsPlugin(NgxsFormPlugin)]);
323
+ }
324
+
325
+ /**
326
+ * The public api for consumers of @ngxs/form-plugin
327
+ */
328
+
329
+ /**
330
+ * Generated bundle index. Do not edit.
331
+ */
332
+
333
+ export { NgxsFormDirective, NgxsFormPlugin, NgxsFormPluginModule, ResetForm, SetFormDirty, SetFormDisabled, SetFormEnabled, SetFormPristine, UpdateForm, UpdateFormDirty, UpdateFormErrors, UpdateFormStatus, UpdateFormValue, withNgxsFormPlugin };
334
+ //# sourceMappingURL=ngxs-form-plugin.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngxs-form-plugin.mjs","sources":["../../../packages/form-plugin/src/actions.ts","../../../packages/form-plugin/src/form.plugin.ts","../../../packages/form-plugin/src/directive.ts","../../../packages/form-plugin/src/form.module.ts","../../../packages/form-plugin/index.ts","../../../packages/form-plugin/ngxs-form-plugin.ts"],"sourcesContent":["export class UpdateFormStatus {\n static readonly type = '[Forms] Update Form Status';\n\n constructor(\n public payload: {\n status: string | null;\n path: string;\n }\n ) {}\n}\n\nexport class UpdateFormValue {\n static readonly type = '[Forms] Update Form Value';\n\n constructor(public payload: { value: any; path: string; propertyPath?: string }) {}\n}\n\nexport class UpdateForm {\n static readonly type = '[Forms] Update Form';\n\n constructor(\n public payload: {\n value: any;\n errors: { [k: string]: string } | null;\n dirty: boolean | null;\n status: string | null;\n path: string;\n }\n ) {}\n}\n\nexport class UpdateFormDirty {\n static readonly type = '[Forms] Update Form Dirty';\n\n constructor(public payload: { dirty: boolean | null; path: string }) {}\n}\n\nexport class SetFormDirty {\n static readonly type = '[Forms] Set Form Dirty';\n\n constructor(public payload: string) {}\n}\n\nexport class SetFormPristine {\n static readonly type = '[Forms] Set Form Pristine';\n\n constructor(public payload: string) {}\n}\n\nexport class UpdateFormErrors {\n static readonly type = '[Forms] Update Form Errors';\n\n constructor(public payload: { errors: { [k: string]: string } | null; path: string }) {}\n}\n\nexport class SetFormDisabled {\n static readonly type = '[Forms] Set Form Disabled';\n\n constructor(public payload: string) {}\n}\n\nexport class SetFormEnabled {\n static readonly type = '[Forms] Set Form Enabled';\n\n constructor(public payload: string) {}\n}\n\nexport class ResetForm {\n static readonly type = '[Forms] Reset Form';\n\n constructor(public payload: { path: string; value?: any }) {}\n}\n","import { Injectable } from '@angular/core';\nimport {\n getActionTypeFromInstance,\n getValue,\n NgxsNextPluginFn,\n NgxsPlugin,\n setValue\n} from '@ngxs/store';\nimport {\n ResetForm,\n SetFormDirty,\n SetFormDisabled,\n SetFormEnabled,\n SetFormPristine,\n UpdateForm,\n UpdateFormDirty,\n UpdateFormErrors,\n UpdateFormStatus,\n UpdateFormValue\n} from './actions';\n\n@Injectable()\nexport class NgxsFormPlugin implements NgxsPlugin {\n handle(state: any, event: any, next: NgxsNextPluginFn) {\n const type = getActionTypeFromInstance(event);\n\n let nextState = state;\n\n if (type === UpdateFormValue.type || type === UpdateForm.type || type === ResetForm.type) {\n const { value } = event.payload;\n const payloadValue = Array.isArray(value)\n ? value.slice()\n : isObjectLike(value)\n ? { ...value }\n : value;\n const path = this.joinPathWithPropertyPath(event);\n nextState = setValue(nextState, path, payloadValue);\n }\n\n if (type === ResetForm.type) {\n const model = getValue(nextState, `${event.payload.path}.model`);\n nextState = setValue(nextState, `${event.payload.path}`, { model: model });\n }\n\n if (type === UpdateFormStatus.type || type === UpdateForm.type) {\n nextState = setValue(nextState, `${event.payload.path}.status`, event.payload.status);\n }\n\n if (type === UpdateFormErrors.type || type === UpdateForm.type) {\n nextState = setValue(nextState, `${event.payload.path}.errors`, {\n ...event.payload.errors\n });\n }\n\n if (type === UpdateFormDirty.type || type === UpdateForm.type) {\n nextState = setValue(nextState, `${event.payload.path}.dirty`, event.payload.dirty);\n }\n\n if (type === SetFormDirty.type) {\n nextState = setValue(nextState, `${event.payload}.dirty`, true);\n }\n\n if (type === SetFormPristine.type) {\n nextState = setValue(nextState, `${event.payload}.dirty`, false);\n }\n\n if (type === SetFormDisabled.type) {\n nextState = setValue(nextState, `${event.payload}.disabled`, true);\n }\n\n if (type === SetFormEnabled.type) {\n nextState = setValue(nextState, `${event.payload}.disabled`, false);\n }\n\n return next(nextState, event);\n }\n\n private joinPathWithPropertyPath({ payload }: UpdateFormValue): string {\n let path = `${payload.path}.model`;\n\n if (payload.propertyPath) {\n path += `.${payload.propertyPath}`;\n }\n\n return path;\n }\n}\n\nfunction isObjectLike(target: unknown): target is object {\n return target !== null && typeof target === 'object';\n}\n","import { ChangeDetectorRef, Directive, Input, OnDestroy, OnInit } from '@angular/core';\nimport { FormGroup, FormGroupDirective } from '@angular/forms';\nimport { Actions, getValue, ofActionDispatched, Store } from '@ngxs/store';\nimport { Observable, Subject } from 'rxjs';\nimport { debounceTime, distinctUntilChanged, filter, takeUntil } from 'rxjs/operators';\nimport {\n ResetForm,\n UpdateForm,\n UpdateFormDirty,\n UpdateFormErrors,\n UpdateFormStatus,\n UpdateFormValue\n} from './actions';\n\n@Directive({ selector: '[ngxsForm]', standalone: true })\nexport class NgxsFormDirective implements OnInit, OnDestroy {\n @Input('ngxsForm')\n path: string = null!;\n\n @Input('ngxsFormDebounce')\n set debounce(debounce: string | number) {\n this._debounce = Number(debounce);\n }\n get debounce() {\n return this._debounce;\n }\n private _debounce = 100;\n\n @Input('ngxsFormClearOnDestroy')\n set clearDestroy(val: boolean) {\n this._clearDestroy = val != null && `${val}` !== 'false';\n }\n get clearDestroy(): boolean {\n return this._clearDestroy;\n }\n private _clearDestroy = false;\n\n private _updating = false;\n\n private readonly _destroy$ = new Subject<void>();\n\n constructor(\n private _actions$: Actions,\n private _store: Store,\n private _formGroupDirective: FormGroupDirective,\n private _cd: ChangeDetectorRef\n ) {}\n\n ngOnInit() {\n this._actions$\n .pipe(\n ofActionDispatched(ResetForm),\n filter((action: ResetForm) => action.payload.path === this.path),\n takeUntil(this._destroy$)\n )\n .subscribe(({ payload: { value } }: ResetForm) => {\n this.form.reset(value);\n this.updateFormStateWithRawValue(true);\n this._cd.markForCheck();\n });\n\n this.getStateStream(`${this.path}.model`).subscribe(model => {\n if (this._updating || !model) {\n return;\n }\n\n this.form.patchValue(model);\n this._cd.markForCheck();\n });\n\n this.getStateStream(`${this.path}.dirty`).subscribe(dirty => {\n if (this.form.dirty === dirty || typeof dirty !== 'boolean') {\n return;\n }\n\n if (dirty) {\n this.form.markAsDirty();\n } else {\n this.form.markAsPristine();\n }\n\n this._cd.markForCheck();\n });\n\n // On first state change, sync form model, status and dirty with state\n this._store\n .selectOnce(state => getValue(state, this.path))\n .subscribe(() => {\n this._store.dispatch([\n new UpdateFormValue({\n path: this.path,\n value: this.form.getRawValue()\n }),\n new UpdateFormStatus({\n path: this.path,\n status: this.form.status\n }),\n new UpdateFormDirty({\n path: this.path,\n dirty: this.form.dirty\n })\n ]);\n });\n\n this.getStateStream(`${this.path}.disabled`).subscribe(disabled => {\n if (this.form.disabled === disabled || typeof disabled !== 'boolean') {\n return;\n }\n\n if (disabled) {\n this.form.disable();\n } else {\n this.form.enable();\n }\n\n this._cd.markForCheck();\n });\n\n this._formGroupDirective\n .valueChanges!.pipe(\n distinctUntilChanged((a, b) => JSON.stringify(a) === JSON.stringify(b)),\n this.debounceChange()\n )\n .subscribe(() => {\n this.updateFormStateWithRawValue();\n });\n\n this._formGroupDirective\n .statusChanges!.pipe(distinctUntilChanged(), this.debounceChange())\n .subscribe((status: string) => {\n this._store.dispatch(\n new UpdateFormStatus({\n status,\n path: this.path\n })\n );\n });\n }\n\n updateFormStateWithRawValue(withFormStatus?: boolean) {\n if (this._updating) return;\n\n const value = this._formGroupDirective.control.getRawValue();\n\n const actions: any[] = [\n new UpdateFormValue({\n path: this.path,\n value\n }),\n new UpdateFormDirty({\n path: this.path,\n dirty: this._formGroupDirective.dirty\n }),\n new UpdateFormErrors({\n path: this.path,\n errors: this._formGroupDirective.errors\n })\n ];\n\n if (withFormStatus) {\n actions.push(\n new UpdateFormStatus({\n path: this.path,\n status: this._formGroupDirective.status\n })\n );\n }\n\n this._updating = true;\n this._store.dispatch(actions).subscribe({\n error: () => (this._updating = false),\n complete: () => (this._updating = false)\n });\n }\n\n ngOnDestroy() {\n this._destroy$.next();\n\n if (this.clearDestroy) {\n this._store.dispatch(\n new UpdateForm({\n path: this.path,\n value: null,\n dirty: null,\n status: null,\n errors: null\n })\n );\n }\n }\n\n private debounceChange() {\n const skipDebounceTime =\n this._formGroupDirective.control.updateOn !== 'change' || this._debounce < 0;\n\n return skipDebounceTime\n ? (change: Observable<any>) => change.pipe(takeUntil(this._destroy$))\n : (change: Observable<any>) =>\n change.pipe(debounceTime(this._debounce), takeUntil(this._destroy$));\n }\n\n private get form(): FormGroup {\n return this._formGroupDirective.form;\n }\n\n private getStateStream(path: string) {\n return this._store.select(state => getValue(state, path)).pipe(takeUntil(this._destroy$));\n }\n}\n","import {\n NgModule,\n ModuleWithProviders,\n EnvironmentProviders,\n makeEnvironmentProviders\n} from '@angular/core';\nimport { NGXS_PLUGINS, withNgxsPlugin } from '@ngxs/store';\n\nimport { NgxsFormPlugin } from './form.plugin';\nimport { NgxsFormDirective } from './directive';\n\n@NgModule({\n imports: [NgxsFormDirective],\n exports: [NgxsFormDirective]\n})\nexport class NgxsFormPluginModule {\n static forRoot(): ModuleWithProviders<NgxsFormPluginModule> {\n return {\n ngModule: NgxsFormPluginModule,\n providers: [\n {\n provide: NGXS_PLUGINS,\n useClass: NgxsFormPlugin,\n multi: true\n }\n ]\n };\n }\n}\n\nexport function withNgxsFormPlugin(): EnvironmentProviders {\n return makeEnvironmentProviders([withNgxsPlugin(NgxsFormPlugin)]);\n}\n","/**\n * The public api for consumers of @ngxs/form-plugin\n */\nexport * from './src/public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;MAAa,gBAAgB,CAAA;AAG3B,IAAA,WAAA,CACS,OAGN,EAAA;QAHM,IAAO,CAAA,OAAA,GAAP,OAAO,CAGb;KACC;;AAPY,gBAAI,CAAA,IAAA,GAAG,4BAA4B,CAAC;MAUzC,eAAe,CAAA;AAG1B,IAAA,WAAA,CAAmB,OAA4D,EAAA;QAA5D,IAAO,CAAA,OAAA,GAAP,OAAO,CAAqD;KAAI;;AAFnE,e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AAE,CAAC,iBAAiB,CAAC;oBAC5B,OAAO,EAAE,CAAC,iBAAiB,CAAC;AAC7B,iBAAA,CAAA;;SAgBe,kBAAkB,GAAA;IAChC,OAAO,wBAAwB,CAAC,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;AACpE;;AChCA;;AAEG;;ACFH;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,23 +1,35 @@
1
1
  {
2
- "$schema": "../../node_modules/ng-packagr/package.schema.json",
3
2
  "name": "@ngxs/form-plugin",
4
3
  "description": "form plugin for @ngxs/store",
5
- "version": "3.8.1-dev.master-5828e37",
6
- "sideEffects": true,
4
+ "version": "3.8.1-dev.master-98beeea",
5
+ "sideEffects": false,
7
6
  "peerDependencies": {
8
7
  "@angular/core": ">=12.0.0 <17.0.0",
9
8
  "@angular/forms": ">=12.0.0 <17.0.0",
10
9
  "@ngxs/store": "^3.8.1 || ^3.8.1-dev",
11
10
  "rxjs": ">=6.5.5"
12
11
  },
13
- "main": "bundles/ngxs-form-plugin.umd.js",
14
- "module": "fesm2015/ngxs-form-plugin.js",
15
- "es2015": "fesm2015/ngxs-form-plugin.js",
16
- "esm2015": "esm2015/ngxs-form-plugin.js",
17
- "fesm2015": "fesm2015/ngxs-form-plugin.js",
18
- "typings": "ngxs-form-plugin.d.ts",
12
+ "module": "fesm2015/ngxs-form-plugin.mjs",
13
+ "es2020": "fesm2020/ngxs-form-plugin.mjs",
14
+ "esm2020": "esm2020/ngxs-form-plugin.mjs",
15
+ "fesm2020": "fesm2020/ngxs-form-plugin.mjs",
16
+ "fesm2015": "fesm2015/ngxs-form-plugin.mjs",
17
+ "typings": "index.d.ts",
18
+ "exports": {
19
+ "./package.json": {
20
+ "default": "./package.json"
21
+ },
22
+ ".": {
23
+ "types": "./index.d.ts",
24
+ "esm2020": "./esm2020/ngxs-form-plugin.mjs",
25
+ "es2020": "./fesm2020/ngxs-form-plugin.mjs",
26
+ "es2015": "./fesm2015/ngxs-form-plugin.mjs",
27
+ "node": "./fesm2015/ngxs-form-plugin.mjs",
28
+ "default": "./fesm2020/ngxs-form-plugin.mjs"
29
+ }
30
+ },
19
31
  "dependencies": {
20
- "tslib": "^2.2.0"
32
+ "tslib": "^2.3.0"
21
33
  },
22
34
  "repository": {
23
35
  "type": "git",
@@ -2,7 +2,7 @@ import { ChangeDetectorRef, OnDestroy, OnInit } from '@angular/core';
2
2
  import { FormGroupDirective } from '@angular/forms';
3
3
  import { Actions, Store } from '@ngxs/store';
4
4
  import * as i0 from "@angular/core";
5
- export declare class FormDirective implements OnInit, OnDestroy {
5
+ export declare class NgxsFormDirective implements OnInit, OnDestroy {
6
6
  private _actions$;
7
7
  private _store;
8
8
  private _formGroupDirective;
@@ -23,6 +23,6 @@ export declare class FormDirective implements OnInit, OnDestroy {
23
23
  private debounceChange;
24
24
  private get form();
25
25
  private getStateStream;
26
- static ɵfac: i0.ɵɵFactoryDeclaration<FormDirective, never>;
27
- static ɵdir: i0.ɵɵDirectiveDeclaration<FormDirective, "[ngxsForm]", never, { "path": "ngxsForm"; "debounce": "ngxsFormDebounce"; "clearDestroy": "ngxsFormClearOnDestroy"; }, {}, never>;
26
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxsFormDirective, never>;
27
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NgxsFormDirective, "[ngxsForm]", never, { "path": "ngxsForm"; "debounce": "ngxsFormDebounce"; "clearDestroy": "ngxsFormClearOnDestroy"; }, {}, never, never, true, never>;
28
28
  }
@@ -1,10 +1,10 @@
1
- import { ModuleWithProviders } from '@angular/core';
1
+ import { ModuleWithProviders, EnvironmentProviders } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
3
  import * as i1 from "./directive";
4
- import * as i2 from "@angular/forms";
5
4
  export declare class NgxsFormPluginModule {
6
5
  static forRoot(): ModuleWithProviders<NgxsFormPluginModule>;
7
6
  static ɵfac: i0.ɵɵFactoryDeclaration<NgxsFormPluginModule, never>;
8
- static ɵmod: i0.ɵɵNgModuleDeclaration<NgxsFormPluginModule, [typeof i1.FormDirective], [typeof i2.ReactiveFormsModule], [typeof i1.FormDirective]>;
7
+ static ɵmod: i0.ɵɵNgModuleDeclaration<NgxsFormPluginModule, never, [typeof i1.NgxsFormDirective], [typeof i1.NgxsFormDirective]>;
9
8
  static ɵinj: i0.ɵɵInjectorDeclaration<NgxsFormPluginModule>;
10
9
  }
10
+ export declare function withNgxsFormPlugin(): EnvironmentProviders;
@@ -1,4 +1,4 @@
1
- export { NgxsFormPluginModule } from './form.module';
1
+ export { NgxsFormPluginModule, withNgxsFormPlugin } from './form.module';
2
2
  export { NgxsFormPlugin } from './form.plugin';
3
- export { FormDirective as ɵFormDirective } from './directive';
3
+ export { NgxsFormDirective } from './directive';
4
4
  export * from './actions';