@ng-simplicity/forms-core 1.0.1 → 1.1.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.
- package/README.md +100 -22
- package/fesm2022/ng-simplicity-forms-core.mjs +97 -33
- package/fesm2022/ng-simplicity-forms-core.mjs.map +1 -1
- package/index.d.ts +25 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -148,19 +148,22 @@ export class AppComponent implements OnInit {
|
|
|
148
148
|
// Construct the schema configuration
|
|
149
149
|
const formConfig: NgsFormsFormConfig = {
|
|
150
150
|
inputUpdateDebounce: 100,
|
|
151
|
-
root: NgsFormsFormGroupComponent.create({
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
151
|
+
root: NgsFormsFormGroupComponent.create({
|
|
152
|
+
name: 'profileForm',
|
|
153
|
+
items: [
|
|
154
|
+
CustomFancyInputComponent.create({
|
|
155
|
+
name: 'nickname',
|
|
156
|
+
label: 'Nickname',
|
|
157
|
+
placeholder: 'Enter cool nickname...',
|
|
158
|
+
customColor: 'purple',
|
|
159
|
+
validators: [Validators.required, Validators.minLength(3)],
|
|
160
|
+
errorMessageMap: {
|
|
161
|
+
required: 'Nickname is required.',
|
|
162
|
+
minlength: 'Nickname must be at least 3 characters.'
|
|
163
|
+
}
|
|
164
|
+
})
|
|
165
|
+
]
|
|
166
|
+
})
|
|
164
167
|
};
|
|
165
168
|
|
|
166
169
|
// Set the configuration to initialize the form control tree
|
|
@@ -203,7 +206,7 @@ Most controls and layout structures support a standard set of core properties th
|
|
|
203
206
|
1. **Visibility**:
|
|
204
207
|
- `visible` (boolean): Controls whether the item is mounted in the DOM.
|
|
205
208
|
- `visible$` (`Observable<boolean>`): Stream version to dynamically show/hide components.
|
|
206
|
-
- *Note: Visibility is configured at the
|
|
209
|
+
- *Note: Visibility is configured at the inner config level (`NgsFormsFormItemConfigBase`).*
|
|
207
210
|
|
|
208
211
|
2. **Disabled Status**:
|
|
209
212
|
- `disabled` (boolean): Sets the initial disabled state of the form control.
|
|
@@ -225,6 +228,82 @@ Most controls and layout structures support a standard set of core properties th
|
|
|
225
228
|
|
|
226
229
|
---
|
|
227
230
|
|
|
231
|
+
## Dynamic Form Arrays (`form-array`)
|
|
232
|
+
|
|
233
|
+
Form Arrays in `@ng-simplicity/forms-core` allow for dynamic lists of repeating items (such as adding multiple emergency contacts or addresses). Managing form arrays requires three distinct components working in harmony:
|
|
234
|
+
|
|
235
|
+
1. **`NgsFormsFormArrayContainerComponent` (Container)**:
|
|
236
|
+
- Manages the outer `FormArray` control and acts as the shell.
|
|
237
|
+
- Requires setting `name` (the control name), `initialItemCount` (minimum display elements), and boundaries (`minItems`, `maxItems`).
|
|
238
|
+
2. **`NgsFormsFormArrayListComponent` (Repeater)**:
|
|
239
|
+
- Resides inside the `items` array of the container.
|
|
240
|
+
- Defines a `templateItem` property containing the layout / controls to clone for each dynamic item.
|
|
241
|
+
- **Crucial Pattern**: The `templateItem` should wrap the inputs inside a layout structure (like a `form-row` or `column`). The engine will dynamically register these repeated fields inside a dedicated `FormGroup` *per array item* under the hood (e.g. `contacts: [{ name: '', phone: '' }]`), isolating the control states.
|
|
242
|
+
3. **Array Mutation Buttons (`form-array-add-item` / `form-array-remove-item`)**:
|
|
243
|
+
- `NgsFormsFormArrayAddItemComponent`: Placed inside the container's items array (outside the repeater component) to trigger appending a new form group cloned from the `templateItem`.
|
|
244
|
+
- `NgsFormsFormArrayRemoveItemComponent`: Placed inside the `templateItem` template (next to the form inputs) so each item row contains a button to delete itself.
|
|
245
|
+
|
|
246
|
+
### Example Schema Configuration
|
|
247
|
+
|
|
248
|
+
Here is a complete setup illustrating how these components work together:
|
|
249
|
+
|
|
250
|
+
```typescript
|
|
251
|
+
import {
|
|
252
|
+
NgsFormsFormArrayContainerComponent,
|
|
253
|
+
NgsFormsFormArrayListComponent,
|
|
254
|
+
NgsFormsRowComponent,
|
|
255
|
+
NgsFormsFormArrayRemoveItemComponent,
|
|
256
|
+
NgsFormsFormArrayAddItemComponent
|
|
257
|
+
} from '@ng-simplicity/forms-core';
|
|
258
|
+
|
|
259
|
+
const contactArray = NgsFormsFormArrayContainerComponent.create({
|
|
260
|
+
name: 'contacts',
|
|
261
|
+
initialItemCount: 1,
|
|
262
|
+
minItems: 1,
|
|
263
|
+
maxItems: 3,
|
|
264
|
+
containerClass: 'contacts-container',
|
|
265
|
+
itemContainerClass: 'contact-row-card',
|
|
266
|
+
items: [
|
|
267
|
+
// 1. The Repeater Component containing the repeated schema structure
|
|
268
|
+
NgsFormsFormArrayListComponent.create({
|
|
269
|
+
templateItem: NgsFormsRowComponent.create({
|
|
270
|
+
containerClass: 'row align-items-center',
|
|
271
|
+
items: [
|
|
272
|
+
// Input fields per array item
|
|
273
|
+
SomeInputComponent.create({
|
|
274
|
+
name: 'contactName',
|
|
275
|
+
label: 'Contact Name',
|
|
276
|
+
validators: [Validators.required]
|
|
277
|
+
}),
|
|
278
|
+
SomeInputComponent.create({
|
|
279
|
+
name: 'contactPhone',
|
|
280
|
+
label: 'Phone Number',
|
|
281
|
+
validators: [Validators.required]
|
|
282
|
+
}),
|
|
283
|
+
// 2. The Remove Button placed inside the templateItem row to delete this specific row
|
|
284
|
+
NgsFormsFormArrayRemoveItemComponent.create({
|
|
285
|
+
buttonText: 'Remove',
|
|
286
|
+
buttonClass: 'btn btn-danger'
|
|
287
|
+
})
|
|
288
|
+
]
|
|
289
|
+
})
|
|
290
|
+
}),
|
|
291
|
+
|
|
292
|
+
// 3. The Add Button placed outside the repeater but inside the container to append rows
|
|
293
|
+
NgsFormsRowComponent.create({
|
|
294
|
+
items: [
|
|
295
|
+
NgsFormsFormArrayAddItemComponent.create({
|
|
296
|
+
buttonText: 'Add Additional Contact',
|
|
297
|
+
buttonClass: 'btn btn-primary'
|
|
298
|
+
})
|
|
299
|
+
]
|
|
300
|
+
})
|
|
301
|
+
]
|
|
302
|
+
});
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
228
307
|
## Core Layout & Structural Components
|
|
229
308
|
|
|
230
309
|
`@ng-simplicity/forms-core` provides all non-styling-specific components and layout containers. Here is the list of available core components and how to construct them:
|
|
@@ -238,15 +317,13 @@ Creates a nested `FormGroup` control.
|
|
|
238
317
|
```typescript
|
|
239
318
|
import { NgsFormsFormGroupComponent } from '@ng-simplicity/forms-core';
|
|
240
319
|
|
|
241
|
-
const group = NgsFormsFormGroupComponent.create(
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
},
|
|
246
|
-
[
|
|
320
|
+
const group = NgsFormsFormGroupComponent.create({
|
|
321
|
+
name: 'profileDetails',
|
|
322
|
+
disabled: false,
|
|
323
|
+
items: [
|
|
247
324
|
// Array of child NgsFormsFormItem<any> components
|
|
248
325
|
]
|
|
249
|
-
);
|
|
326
|
+
});
|
|
250
327
|
```
|
|
251
328
|
|
|
252
329
|
### 2. Form Array Container (`form-array`)
|
|
@@ -406,8 +483,9 @@ All base classes are exported from `@ng-simplicity/forms-core`:
|
|
|
406
483
|
### Available Configuration Interfaces
|
|
407
484
|
Ensure your custom configuration type extends one of these core interfaces for full TypeScript safety:
|
|
408
485
|
|
|
409
|
-
* **`NgsFormsFormItemConfigBase`**: Standard base structure containing
|
|
486
|
+
* **`NgsFormsFormItemConfigBase`**: Standard base structure containing optional `uuid?: string`, `visible?: boolean`, `visible$?: Observable<boolean>`, and `initialState?: any`.
|
|
410
487
|
* **`NgsFormsFormItemConfigBaseItemWithNameAndValidators`**: Core interface for registerable form controls. Adds `name: string`, `errorMessageMap?: NgsFormsFormErrorKeyValueMap`, `disabled?`/`disabled$?`, and `validators?`/`validators$?`.
|
|
488
|
+
* **`NgsFormsFormGroupConfig`**: Extends both the name/validators base and the items container base. Used for FormGroup configurations.
|
|
411
489
|
* **`NgsFormsFormItemConfigBaseInput`**: Extends the name/validators base. Adds common interactive input properties: `id?: string`, `label: string`, and `value?: unknown`.
|
|
412
490
|
* **`NgsFormsFormItemConfigBaseTextInput`**: Extends the input base. Adds text-specific options: `placeholder?: string` and `type?: 'text' | 'email' | 'password'`.
|
|
413
491
|
* **`NgsFormsFormItemConfigBaseInputWithOptions`**: Extends the input base. Adds selection fields: `options?: Array<NgsFormsFormInputOption>` and `options$?: Observable<Array<NgsFormsFormInputOption>>`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Subject, takeUntil, BehaviorSubject, map, filter, of } from 'rxjs';
|
|
1
|
+
import { Subject, takeUntil, BehaviorSubject, map, filter, merge, of } from 'rxjs';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { Directive, InjectionToken, inject, Injectable, Injector, ViewContainerRef, Input, ChangeDetectionStrategy, Component, Sanitizer, SecurityContext, NgModule } from '@angular/core';
|
|
3
|
+
import { Directive, InjectionToken, inject, Injectable, ChangeDetectorRef, Injector, ViewContainerRef, Input, ChangeDetectionStrategy, Component, ElementRef, Sanitizer, SecurityContext, NgModule } from '@angular/core';
|
|
4
4
|
import { v4 } from 'uuid';
|
|
5
5
|
import { toSignal } from '@angular/core/rxjs-interop';
|
|
6
6
|
import { UntypedFormGroup, FormControl, UntypedFormArray, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
@@ -187,9 +187,14 @@ class NgsFormsInternalService {
|
|
|
187
187
|
updateComponentState(componentKey, state) {
|
|
188
188
|
this.mergeState(componentKey, state);
|
|
189
189
|
}
|
|
190
|
-
subscribeToState(
|
|
190
|
+
subscribeToState(uuid, name) {
|
|
191
191
|
let last = '';
|
|
192
|
-
return this.state.pipe(map((allState) =>
|
|
192
|
+
return this.state.pipe(map((allState) => {
|
|
193
|
+
const stateByUuid = allState[uuid] || {};
|
|
194
|
+
const stateByName = name ? (allState[name] || {}) : {};
|
|
195
|
+
const globalState = allState['global'] || {};
|
|
196
|
+
return ngsDefaults(stateByUuid, ngsDefaults(stateByName, globalState));
|
|
197
|
+
}), filter((currentState) => {
|
|
193
198
|
const stringifiedState = JSON.stringify(currentState);
|
|
194
199
|
const isUpdated = stringifiedState !== last;
|
|
195
200
|
last = stringifiedState;
|
|
@@ -208,13 +213,40 @@ class NgsFormsFormItemWithVisibleAndValidatorsBase extends NgsFormsBaseClassForm
|
|
|
208
213
|
errorMessage = '';
|
|
209
214
|
formAddRemoveFns = inject(NGS_FORMS_CONTROL_ADD_REMOVE_FN);
|
|
210
215
|
privateService = inject(NgsFormsInternalService);
|
|
216
|
+
changeDetectorRef = inject(ChangeDetectorRef);
|
|
211
217
|
submitted = toSignal(this.privateService.isSubmitted$, { initialValue: false });
|
|
212
218
|
ngOnInit() {
|
|
213
|
-
this.control
|
|
219
|
+
if (!this.control) {
|
|
220
|
+
this.control = new FormControl(undefined, { validators: [] });
|
|
221
|
+
}
|
|
214
222
|
//this.bindVisible();
|
|
215
223
|
this.bindValidators();
|
|
216
224
|
//this.bindControlValidityChange();
|
|
217
225
|
this.formAddRemoveFns.add(this.control, this.config.name);
|
|
226
|
+
// Listen to changes and update error message dynamically
|
|
227
|
+
this.subscribe(merge(this.control.valueChanges, this.control.statusChanges, this.privateService.isSubmitted$), () => {
|
|
228
|
+
this.updateErrorMessage();
|
|
229
|
+
this.changeDetectorRef.markForCheck();
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
updateErrorMessage() {
|
|
233
|
+
if (!this.control) {
|
|
234
|
+
this.errorMessage = '';
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
const showErrors = this.control.invalid && (this.control.touched || this.control.dirty || this.submitted());
|
|
238
|
+
if (!showErrors) {
|
|
239
|
+
this.errorMessage = '';
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
const errors = this.control.errors;
|
|
243
|
+
if (!errors) {
|
|
244
|
+
this.errorMessage = '';
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
const firstErrorKey = Object.keys(errors)[0];
|
|
248
|
+
const map = this.config.errorMessageMap;
|
|
249
|
+
this.errorMessage = map?.[firstErrorKey] || `Field is invalid: ${firstErrorKey}`;
|
|
218
250
|
}
|
|
219
251
|
ngOnDestroy() {
|
|
220
252
|
super.ngOnDestroy();
|
|
@@ -242,7 +274,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
242
274
|
class NgsFormsBaseClassFormInputComponent extends NgsFormsFormItemWithVisibleAndValidatorsBase {
|
|
243
275
|
myFormService = inject(NgsFormsService);
|
|
244
276
|
internalService = inject(NgsFormsInternalService);
|
|
245
|
-
commonState = toSignal(this.internalService.subscribeToState(this.config.name), { initialValue: {} });
|
|
277
|
+
commonState = toSignal(this.internalService.subscribeToState(this.itemData.uuid || '', this.config.name), { initialValue: {} });
|
|
246
278
|
toggleDisplayMode(setTo) {
|
|
247
279
|
}
|
|
248
280
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: NgsFormsBaseClassFormInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
@@ -277,16 +309,18 @@ class NgsFormItemController extends NgsSubscriber {
|
|
|
277
309
|
itemData;
|
|
278
310
|
addRemoveControlFn;
|
|
279
311
|
index;
|
|
312
|
+
changeDetectorRef;
|
|
280
313
|
componentRef;
|
|
281
314
|
parentVisibility = new BehaviorSubject(false);
|
|
282
315
|
lastVisible;
|
|
283
|
-
constructor(injector, viewContainerRef, itemData, addRemoveControlFn, index) {
|
|
316
|
+
constructor(injector, viewContainerRef, itemData, addRemoveControlFn, index, changeDetectorRef) {
|
|
284
317
|
super();
|
|
285
318
|
this.injector = injector;
|
|
286
319
|
this.viewContainerRef = viewContainerRef;
|
|
287
320
|
this.itemData = itemData;
|
|
288
321
|
this.addRemoveControlFn = addRemoveControlFn;
|
|
289
322
|
this.index = index;
|
|
323
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
290
324
|
this.bindVisibility();
|
|
291
325
|
}
|
|
292
326
|
destroy() {
|
|
@@ -294,16 +328,16 @@ class NgsFormItemController extends NgsSubscriber {
|
|
|
294
328
|
super.ngOnDestroy();
|
|
295
329
|
}
|
|
296
330
|
bindVisibility() {
|
|
297
|
-
if (!this.itemData.visible$) {
|
|
298
|
-
this.create();
|
|
331
|
+
if (!this.itemData.config.visible$) {
|
|
332
|
+
Promise.resolve().then(() => this.create());
|
|
299
333
|
return;
|
|
300
334
|
}
|
|
301
|
-
this.subscribe(this.itemData.visible$, (visible) => {
|
|
335
|
+
this.subscribe(this.itemData.config.visible$, (visible) => {
|
|
302
336
|
if (this.lastVisible === visible)
|
|
303
337
|
return;
|
|
304
338
|
this.lastVisible = visible;
|
|
305
339
|
if (visible) {
|
|
306
|
-
this.create();
|
|
340
|
+
Promise.resolve().then(() => this.create());
|
|
307
341
|
return;
|
|
308
342
|
}
|
|
309
343
|
this.detach();
|
|
@@ -327,11 +361,14 @@ class NgsFormItemController extends NgsSubscriber {
|
|
|
327
361
|
return;
|
|
328
362
|
}
|
|
329
363
|
this.componentRef = this.viewContainerRef.createComponent(componentType, { injector: myInjector });
|
|
364
|
+
this.componentRef.changeDetectorRef?.detectChanges();
|
|
365
|
+
this.changeDetectorRef?.markForCheck();
|
|
330
366
|
this.parentVisibility.next(true);
|
|
331
367
|
}
|
|
332
368
|
detach() {
|
|
333
369
|
this.parentVisibility.next(false);
|
|
334
370
|
this.componentRef?.destroy();
|
|
371
|
+
this.changeDetectorRef?.markForCheck();
|
|
335
372
|
}
|
|
336
373
|
}
|
|
337
374
|
|
|
@@ -343,6 +380,7 @@ class NgsFormsFormItemDirective {
|
|
|
343
380
|
controller;
|
|
344
381
|
viewContainerRef = inject(ViewContainerRef);
|
|
345
382
|
injector = inject(Injector);
|
|
383
|
+
changeDetectorRef = inject(ChangeDetectorRef);
|
|
346
384
|
formComponentRegistryService = inject(NgsFormsComponentRegistryService);
|
|
347
385
|
ngOnInit() {
|
|
348
386
|
if (!this.itemData) {
|
|
@@ -355,7 +393,7 @@ class NgsFormsFormItemDirective {
|
|
|
355
393
|
if (this.formGroup) {
|
|
356
394
|
addRemoveFn = NgsFormsFormControlAddRemoveFunctions.formGroup(this.formGroup);
|
|
357
395
|
}
|
|
358
|
-
this.controller = new NgsFormItemController(this.injector, this.viewContainerRef, this.itemData, addRemoveFn, this.index);
|
|
396
|
+
this.controller = new NgsFormItemController(this.injector, this.viewContainerRef, this.itemData, addRemoveFn, this.index, this.changeDetectorRef);
|
|
359
397
|
}
|
|
360
398
|
ngOnDestroy() {
|
|
361
399
|
this.controller?.destroy();
|
|
@@ -403,7 +441,7 @@ class NgsFormsColumnComponent extends NgsFormsBaseClassItemsContainerBase {
|
|
|
403
441
|
static key = 'column';
|
|
404
442
|
static create(config) {
|
|
405
443
|
return {
|
|
406
|
-
uuid: v4(),
|
|
444
|
+
uuid: config.uuid || v4(),
|
|
407
445
|
type: NgsFormsColumnComponent.key,
|
|
408
446
|
config,
|
|
409
447
|
};
|
|
@@ -434,7 +472,7 @@ class NgsFormsRowComponent extends NgsFormsBaseClassFormComponent {
|
|
|
434
472
|
}
|
|
435
473
|
static create(config) {
|
|
436
474
|
return {
|
|
437
|
-
uuid: v4(),
|
|
475
|
+
uuid: config.uuid || v4(),
|
|
438
476
|
type: NgsFormsRowComponent.key,
|
|
439
477
|
config: config,
|
|
440
478
|
};
|
|
@@ -449,12 +487,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
449
487
|
|
|
450
488
|
class NgsFormsFormGroupComponent extends NgsFormsFormItemWithVisibleAndValidatorsBase {
|
|
451
489
|
static key = 'form-group';
|
|
452
|
-
static create(config
|
|
490
|
+
static create(config) {
|
|
453
491
|
return {
|
|
454
|
-
uuid: v4(),
|
|
492
|
+
uuid: config.uuid || v4(),
|
|
455
493
|
type: NgsFormsFormGroupComponent.key,
|
|
456
494
|
config,
|
|
457
|
-
items,
|
|
458
495
|
};
|
|
459
496
|
}
|
|
460
497
|
get formGroupControl() {
|
|
@@ -465,19 +502,18 @@ class NgsFormsFormGroupComponent extends NgsFormsFormItemWithVisibleAndValidator
|
|
|
465
502
|
this.control = new UntypedFormGroup({});
|
|
466
503
|
}
|
|
467
504
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: NgsFormsFormGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
468
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: NgsFormsFormGroupComponent, isStandalone: true, selector: "ngs-forms-form-group", usesInheritance: true, ngImport: i0, template: "@if (
|
|
505
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: NgsFormsFormGroupComponent, isStandalone: true, selector: "ngs-forms-form-group", usesInheritance: true, ngImport: i0, template: "@if (config.items) {\n @for (item of config.items; track item.uuid) {\n <ng-container [ngs-form-item]=\"item\" [ngs-form-group]=\"formGroupControl\"></ng-container>\n }\n}\n", dependencies: [{ kind: "directive", type: NgsFormsFormItemDirective, selector: "[ngs-form-item]", inputs: ["ngs-form-item", "ngs-form-group", "ngs-form-array", "ngs-form-index"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
469
506
|
}
|
|
470
507
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: NgsFormsFormGroupComponent, decorators: [{
|
|
471
508
|
type: Component,
|
|
472
|
-
args: [{ selector: 'ngs-forms-form-group', imports: [NgsFormsFormItemDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (
|
|
509
|
+
args: [{ selector: 'ngs-forms-form-group', imports: [NgsFormsFormItemDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (config.items) {\n @for (item of config.items; track item.uuid) {\n <ng-container [ngs-form-item]=\"item\" [ngs-form-group]=\"formGroupControl\"></ng-container>\n }\n}\n" }]
|
|
473
510
|
}], ctorParameters: () => [] });
|
|
474
511
|
|
|
475
512
|
class NgsFormsFormArrayInternalService {
|
|
476
513
|
config = inject(NGS_FORMS_ITEM_DATA).config;
|
|
477
514
|
formArray = new UntypedFormArray([]);
|
|
478
|
-
|
|
515
|
+
itemsChanged = new Subject();
|
|
479
516
|
constructor() {
|
|
480
|
-
this.addRemoveFn.add(this.formArray, this.config.name);
|
|
481
517
|
if (this.config.initialItemCount) {
|
|
482
518
|
for (let i = 0; i < this.config.initialItemCount; i++) {
|
|
483
519
|
this.addItem();
|
|
@@ -485,7 +521,6 @@ class NgsFormsFormArrayInternalService {
|
|
|
485
521
|
}
|
|
486
522
|
}
|
|
487
523
|
ngOnDestroy() {
|
|
488
|
-
this.addRemoveFn.remove(this.formArray, this.config.name);
|
|
489
524
|
}
|
|
490
525
|
removeAt(index) {
|
|
491
526
|
if (this.config?.minItems && this.formArray.controls.length <= this.config.minItems) {
|
|
@@ -495,12 +530,14 @@ class NgsFormsFormArrayInternalService {
|
|
|
495
530
|
return;
|
|
496
531
|
}
|
|
497
532
|
this.formArray.removeAt(index);
|
|
533
|
+
this.itemsChanged.next();
|
|
498
534
|
}
|
|
499
535
|
addItem() {
|
|
500
536
|
if (this.config?.maxItems && this.formArray.controls.length >= this.config.maxItems) {
|
|
501
537
|
return;
|
|
502
538
|
}
|
|
503
|
-
this.formArray.
|
|
539
|
+
this.formArray.push(new UntypedFormGroup({}));
|
|
540
|
+
this.itemsChanged.next();
|
|
504
541
|
}
|
|
505
542
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: NgsFormsFormArrayInternalService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
506
543
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: NgsFormsFormArrayInternalService });
|
|
@@ -514,7 +551,7 @@ class NgsFormsFormArrayAddItemComponent extends NgsFormsBaseClassFormComponent {
|
|
|
514
551
|
internalArrayService = inject(NgsFormsFormArrayInternalService);
|
|
515
552
|
static create(config) {
|
|
516
553
|
return {
|
|
517
|
-
uuid: v4(),
|
|
554
|
+
uuid: config.uuid || v4(),
|
|
518
555
|
type: NgsFormsFormArrayAddItemComponent.key,
|
|
519
556
|
config: config,
|
|
520
557
|
};
|
|
@@ -531,29 +568,41 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
531
568
|
}] });
|
|
532
569
|
|
|
533
570
|
class NgsFormsFormArrayContainerComponent extends NgsFormsFormItemWithVisibleAndValidatorsBase {
|
|
571
|
+
formArrayService;
|
|
534
572
|
static key = 'form-array';
|
|
573
|
+
constructor(formArrayService) {
|
|
574
|
+
super();
|
|
575
|
+
this.formArrayService = formArrayService;
|
|
576
|
+
this.control = this.formArrayService.formArray;
|
|
577
|
+
}
|
|
535
578
|
static create(config) {
|
|
536
579
|
return {
|
|
537
|
-
uuid: v4(),
|
|
580
|
+
uuid: config.uuid || v4(),
|
|
538
581
|
type: NgsFormsFormArrayContainerComponent.key,
|
|
539
582
|
config: config,
|
|
540
583
|
};
|
|
541
584
|
}
|
|
542
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: NgsFormsFormArrayContainerComponent, deps:
|
|
585
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: NgsFormsFormArrayContainerComponent, deps: [{ token: NgsFormsFormArrayInternalService }], target: i0.ɵɵFactoryTarget.Component });
|
|
543
586
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: NgsFormsFormArrayContainerComponent, isStandalone: true, selector: "ngs-forms-form-array", providers: [NgsFormsFormArrayInternalService], usesInheritance: true, ngImport: i0, template: "<div [class]=\"config.containerClass || ''\">\n @for (item of config.items; track item.uuid) {\n <ng-container [ngs-form-item]=\"item\"></ng-container>\n }\n</div>\n", dependencies: [{ kind: "directive", type: NgsFormsFormItemDirective, selector: "[ngs-form-item]", inputs: ["ngs-form-item", "ngs-form-group", "ngs-form-array", "ngs-form-index"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
544
587
|
}
|
|
545
588
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: NgsFormsFormArrayContainerComponent, decorators: [{
|
|
546
589
|
type: Component,
|
|
547
590
|
args: [{ selector: 'ngs-forms-form-array', imports: [NgsFormsFormItemDirective], providers: [NgsFormsFormArrayInternalService], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"config.containerClass || ''\">\n @for (item of config.items; track item.uuid) {\n <ng-container [ngs-form-item]=\"item\"></ng-container>\n }\n</div>\n" }]
|
|
548
|
-
}] });
|
|
591
|
+
}], ctorParameters: () => [{ type: NgsFormsFormArrayInternalService }] });
|
|
549
592
|
|
|
550
593
|
class NgsFormsFormArrayListComponent extends NgsFormsBaseClassFormComponent {
|
|
551
594
|
static key = 'form-array-list';
|
|
552
595
|
internalArrayService = inject(NgsFormsFormArrayInternalService);
|
|
553
596
|
myFormArray = this.internalArrayService.formArray;
|
|
597
|
+
changeDetectorRef = inject(ChangeDetectorRef);
|
|
598
|
+
ngOnInit() {
|
|
599
|
+
this.subscribe(this.internalArrayService.itemsChanged, () => {
|
|
600
|
+
this.changeDetectorRef.markForCheck();
|
|
601
|
+
});
|
|
602
|
+
}
|
|
554
603
|
static create(config) {
|
|
555
604
|
return {
|
|
556
|
-
uuid: v4(),
|
|
605
|
+
uuid: config.uuid || v4(),
|
|
557
606
|
type: NgsFormsFormArrayListComponent.key,
|
|
558
607
|
config: config,
|
|
559
608
|
};
|
|
@@ -572,13 +621,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
572
621
|
class NgsFormsFormArrayRemoveItemComponent extends NgsFormsBaseClassFormComponent {
|
|
573
622
|
static key = 'form-array-remove-item';
|
|
574
623
|
internalArrayService = inject(NgsFormsFormArrayInternalService);
|
|
575
|
-
|
|
624
|
+
elementRef = inject(ElementRef);
|
|
625
|
+
indexFromDi = inject(NGS_FORMS_ITEM_INDEX, { optional: true });
|
|
626
|
+
get myIndex() {
|
|
627
|
+
if (this.indexFromDi !== null && this.indexFromDi !== undefined) {
|
|
628
|
+
return this.indexFromDi;
|
|
629
|
+
}
|
|
630
|
+
const el = this.elementRef.nativeElement;
|
|
631
|
+
const container = el.closest('[data-index]');
|
|
632
|
+
if (container) {
|
|
633
|
+
const idxAttr = container.getAttribute('data-index');
|
|
634
|
+
if (idxAttr !== null) {
|
|
635
|
+
return parseInt(idxAttr, 10);
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
return 0;
|
|
639
|
+
}
|
|
576
640
|
constructor() {
|
|
577
641
|
super();
|
|
578
642
|
}
|
|
579
643
|
static create(config) {
|
|
580
644
|
return {
|
|
581
|
-
uuid: v4(),
|
|
645
|
+
uuid: config.uuid || v4(),
|
|
582
646
|
type: NgsFormsFormArrayRemoveItemComponent.key,
|
|
583
647
|
config,
|
|
584
648
|
};
|
|
@@ -598,7 +662,7 @@ class NgsFormsTextDivComponent extends NgsFormsBaseClassFormComponent {
|
|
|
598
662
|
static key = 'text-div';
|
|
599
663
|
static create(config) {
|
|
600
664
|
return {
|
|
601
|
-
uuid: v4(),
|
|
665
|
+
uuid: config.uuid || v4(),
|
|
602
666
|
type: NgsFormsTextDivComponent.key,
|
|
603
667
|
config: config,
|
|
604
668
|
};
|
|
@@ -630,7 +694,7 @@ class NgsFormsHtmlContentComponent extends NgsFormsBaseClassFormComponent {
|
|
|
630
694
|
}
|
|
631
695
|
static create(config) {
|
|
632
696
|
return {
|
|
633
|
-
uuid: v4(),
|
|
697
|
+
uuid: config.uuid || v4(),
|
|
634
698
|
type: NgsFormsHtmlContentComponent.key,
|
|
635
699
|
config,
|
|
636
700
|
};
|
|
@@ -652,7 +716,7 @@ class NgsFormsFormSectionComponent extends NgsFormsBaseClassItemsContainerBase {
|
|
|
652
716
|
static key = 'section';
|
|
653
717
|
static create(config) {
|
|
654
718
|
return {
|
|
655
|
-
uuid: v4(),
|
|
719
|
+
uuid: config.uuid || v4(),
|
|
656
720
|
type: NgsFormsFormSectionComponent.key,
|
|
657
721
|
config: config,
|
|
658
722
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-simplicity-forms-core.mjs","sources":["../../../../libs/forms-core/src/classes/base/subscriber.class.ts","../../../../libs/forms-core/src/misc/injection-tokens.constants.ts","../../../../libs/forms-core/src/misc/defaults.ts","../../../../libs/forms-core/src/classes/form-component-base/form-component.class.ts","../../../../libs/forms-core/src/services/form-component-registry/form-component-registry.service.ts","../../../../libs/forms-core/src/services/forms/forms.service.ts","../../../../libs/forms-core/src/services/internal/internal-forms.service.ts","../../../../libs/forms-core/src/classes/form-component-base/form-component-item-with-visible-and-validators-base.class.ts","../../../../libs/forms-core/src/classes/form-component-base/form-component-input.class.ts","../../../../libs/forms-core/src/classes/form-component-base/form-component-items-container.class.ts","../../../../libs/forms-core/src/classes/form-component-base/form-component-input-with-options-base.class.ts","../../../../libs/forms-core/src/controllers/form-item/form-item.controller.ts","../../../../libs/forms-core/src/components/core/form-item/form-item.component.ts","../../../../libs/forms-core/src/components/core/form/form.component.ts","../../../../libs/forms-core/src/components/core/form/form.component.html","../../../../libs/forms-core/src/components/shared-form-components/column/form-column.component.ts","../../../../libs/forms-core/src/components/shared-form-components/column/form-column.component.html","../../../../libs/forms-core/src/models/item-config-bases/form-item-config-base.model.ts","../../../../libs/forms-core/src/components/shared-form-components/row/form-row.component.ts","../../../../libs/forms-core/src/components/shared-form-components/row/form-row.component.html","../../../../libs/forms-core/src/components/shared-form-components/form-group/form-group.component.ts","../../../../libs/forms-core/src/components/shared-form-components/form-group/form-group.component.html","../../../../libs/forms-core/src/components/shared-form-components/form-array/service/form-array-internal.service.ts","../../../../libs/forms-core/src/components/shared-form-components/form-array/add-item/form-array-add-item.component.ts","../../../../libs/forms-core/src/components/shared-form-components/form-array/add-item/form-array-add-item.component.html","../../../../libs/forms-core/src/components/shared-form-components/form-array/container/form-array.component.ts","../../../../libs/forms-core/src/components/shared-form-components/form-array/container/form-array.component.html","../../../../libs/forms-core/src/components/shared-form-components/form-array/list/form-array-list.component.ts","../../../../libs/forms-core/src/components/shared-form-components/form-array/list/form-array-list.component.html","../../../../libs/forms-core/src/components/shared-form-components/form-array/remove-item/form-array-remove-item.component.ts","../../../../libs/forms-core/src/components/shared-form-components/form-array/remove-item/form-array-remove-item.component.html","../../../../libs/forms-core/src/components/shared-form-components/text-div/text-div.component.ts","../../../../libs/forms-core/src/components/shared-form-components/text-div/text-div.component.html","../../../../libs/forms-core/src/components/shared-form-components/html-content/html-content.component.ts","../../../../libs/forms-core/src/components/shared-form-components/html-content/html-content.component.html","../../../../libs/forms-core/src/components/shared-form-components/section/section-config.interface.ts","../../../../libs/forms-core/src/components/shared-form-components/section/section.component.ts","../../../../libs/forms-core/src/components/shared-form-components/section/section.component.html","../../../../libs/forms-core/src/forms-core.module.ts","../../../../libs/forms-core/src/ng-simplicity-forms-core.ts"],"sourcesContent":["import { Observable, Subject, Subscription, takeUntil } from 'rxjs';\nimport { Directive } from '@angular/core';\n\n@Directive() // No-op, just for Angular compiler\nexport abstract class NgsSubscriber {\n protected readonly destroy$ = new Subject<void>();\n\n protected subscriptions: Subscription[] = [];\n\n subscribe<T>(subscribeTo: Observable<T>, nextObserver: (value: T) => void): void {\n subscribeTo.pipe(takeUntil(this.destroy$)).subscribe(nextObserver);\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n this.subscriptions.forEach((subscriber) => subscriber.unsubscribe());\n }\n}\n","import { InjectionToken } from '@angular/core';\nimport { AbstractControl, UntypedFormArray, UntypedFormGroup } from '@angular/forms';\n\nexport const NGS_FORMS_ITEM_DATA = new InjectionToken('ngs-forms-item-data');\nexport const NGS_FORMS_CONTROL_ADD_REMOVE_FN = new InjectionToken('ngs-form-control-remove-fn');\nexport const NGS_FORMS_ITEM_INDEX = new InjectionToken('ngs-forms-item-index');\n\ntype FormControlAddRemoveFn = (control: AbstractControl, controlName: string) => void;\n\nexport interface INgsFormsFormControlAddRemove {\n add: FormControlAddRemoveFn;\n remove: FormControlAddRemoveFn;\n}\ninterface IControlAddRemoveFunctionsBuilder {\n formGroup: (formGroup: UntypedFormGroup) => INgsFormsFormControlAddRemove;\n formArray: (formArray: UntypedFormArray) => INgsFormsFormControlAddRemove;\n}\nexport const NgsFormsFormControlAddRemoveFunctions: IControlAddRemoveFunctionsBuilder = {\n formGroup: (formGroup) => ({\n add: (control, controlName) => formGroup.addControl(controlName, control),\n remove: (control, controlName) => formGroup.removeControl(controlName),\n }),\n formArray: (formArray: UntypedFormArray) => ({\n add: (control, controlName) => formArray.controls.push(control),\n remove: (control, controlName) => {\n const index = formArray.controls.indexOf(control);\n formArray.controls.splice(index, 1);\n },\n }),\n};\n","/**\n * Simple alternative to lodash.defaults.\n * Returns a new object with properties from source assigned to target\n * if the properties are undefined or missing on target.\n */\nexport function ngsDefaults<T extends object, U extends object>(target: T, source: U): T & U;\nexport function ngsDefaults(target: any, ...sources: any[]): any {\n const result = target ? { ...target } : {};\n for (const source of sources) {\n if (!source) continue;\n for (const key of Object.keys(source)) {\n if (result[key] === undefined) {\n result[key] = source[key];\n }\n }\n }\n return result;\n}\n","import { Directive, inject, Injector } from '@angular/core';\nimport { v4 as uuidv4 } from 'uuid';\nimport { NgsSubscriber } from '../base/subscriber.class';\nimport { NGS_FORMS_ITEM_DATA } from '../../misc';\nimport { NgsFormsFormItem, NgsFormsFormItemConfigBase } from '../../models';\n\n@Directive({})\nexport abstract class NgsFormsBaseClassFormComponent<T extends NgsFormsFormItemConfigBase> extends NgsSubscriber {\n static key: string;\n id = uuidv4();\n protected config: T;\n protected readonly itemData: NgsFormsFormItem<T>;\n constructor() {\n super();\n this.itemData = inject<NgsFormsFormItem<T>>(NGS_FORMS_ITEM_DATA);\n this.config = this.itemData.config;\n }\n}\n","import { Injectable, Type } from '@angular/core';\n\n@Injectable({ providedIn: 'platform' })\nexport class NgsFormsComponentRegistryService {\n private readonly itemComponentRegistry: TItemComponentRegistry = {};\n getComponentTypeForKey(key: string): Type<unknown> | undefined {\n return this.itemComponentRegistry[key];\n }\n register(key: string, component: Type<unknown>): void {\n this.itemComponentRegistry[key] = component;\n }\n}\n\ntype TItemComponentRegistry = { [key: string]: Type<unknown> };\n","import { UntypedFormGroup } from '@angular/forms';\nimport { BehaviorSubject, Subject, Subscription } from 'rxjs';\nimport { NgsFormsFormConfig } from '../../models';\nimport { NgsFormsInternalService } from '../internal/internal-forms.service';\nimport { Injectable, OnDestroy } from '@angular/core';\n\n@Injectable()\nexport class NgsFormsService implements OnDestroy {\n attempt = 0;\n formValue$ = new BehaviorSubject<any>({});\n formValue: any = {};\n private internalFormService: NgsFormsInternalService | undefined;\n private formGroupSubscriptions: Array<Subscription> = [];\n private formGroup = new UntypedFormGroup({});\n\n get dirty(): boolean {\n return this.formGroup?.dirty ?? false;\n }\n get isValid(): boolean {\n if (!this.internalServiceIsSet) return false;\n return this.internalFormService!.checkIsValid();\n }\n get internalServiceIsSet(): boolean {\n return !!this.internalFormService;\n }\n\n setFormConfig(formConfig: NgsFormsFormConfig): void {\n if (!this.internalServiceIsSet) {\n if (this.attempt > 20) {\n console.error('Internal form service is unavailable. Is the ngs-form root tag added to the page?');\n return;\n }\n this.attempt++;\n setTimeout(() => this.setFormConfig(formConfig), 25);\n return;\n }\n this.internalFormService!.setFormData(formConfig);\n }\n\n setInternalService(internalFormsService: NgsFormsInternalService): void {\n this.internalFormService = internalFormsService;\n this.bindFormGroup();\n }\n\n setIsSubmitted(isSubmitted: boolean): void {\n if (!this.internalServiceIsSet) return;\n this.internalFormService!.setIsSubmitted(isSubmitted);\n }\n\n private bindFormGroup(): void {\n this.internalFormService!.formGroup$.subscribe((fg) => {\n this.formGroup = fg;\n this.formGroupSubscriptions.forEach((subscription) => subscription.unsubscribe());\n\n this.formGroupSubscriptions.push(\n this.formGroup.valueChanges.subscribe((v) => {\n this.formValue = v;\n this.formValue$.next(v);\n })\n );\n });\n }\n updateComponentState(componentKey: string, state: any): void {\n this.internalFormService?.updateComponentState(componentKey, state);\n }\n updateGlobalState(state: any): void {\n this.internalFormService?.updateGlobalState(state);\n }\n ngOnDestroy() {\n this.formGroupSubscriptions.forEach((subscription) => subscription.unsubscribe());\n }\n\n patchValue(entityData: any) {\n this.formGroup.patchValue(entityData);\n }\n}\n","import { BehaviorSubject, filter, map } from 'rxjs';\nimport { FormGroup, UntypedFormGroup } from '@angular/forms';\nimport { NgsFormsFormConfig } from '../../models';\nimport { Injectable } from '@angular/core';\nimport { NgsFormsGlobalFormState } from '../../models/global-state.interface';\nimport { ngsDefaults } from '../../misc/defaults';\n\n@Injectable()\nexport class NgsFormsInternalService {\n formGroup$ = new BehaviorSubject<FormGroup>(new UntypedFormGroup({}));\n formConfig$ = new BehaviorSubject<NgsFormsFormConfig | undefined>(undefined);\n isSubmitted$ = new BehaviorSubject<boolean>(false);\n state = new BehaviorSubject<{ [key: string]: any }>({});\n setIsSubmitted(isSubmitted: boolean): void {\n this.isSubmitted$.next(isSubmitted);\n }\n\n checkIsValid(): boolean {\n if (!this.formGroup$.value) return false;\n return this.formGroup$.value.valid;\n }\n\n setFormData(formConfig: NgsFormsFormConfig) {\n this.formGroup$.next(new UntypedFormGroup({}));\n this.formConfig$.next(formConfig);\n this.isSubmitted$.next(false);\n }\n private mergeState(key: string, update: any): void {\n const obj = this.state.value[key] || {};\n const updated = ngsDefaults(update, obj);\n this.state.value[key] = updated;\n this.state.next(this.state.value);\n }\n updateGlobalState(state: NgsFormsGlobalFormState) {\n this.mergeState('global', state);\n }\n updateComponentState(componentKey: string, state: any) {\n this.mergeState(componentKey, state);\n }\n\n subscribeToState(fieldName: string) {\n let last = '';\n return this.state.pipe(\n map((allState) => ngsDefaults(allState[fieldName], allState['global'])),\n filter((currentState) => {\n const stringifiedState = JSON.stringify(currentState);\n const isUpdated = stringifiedState !== last;\n last = stringifiedState;\n return isUpdated;\n })\n );\n }\n}\n","import { Directive, inject, OnDestroy, OnInit, Signal } from '@angular/core';\nimport { FormControl, UntypedFormControl, ValidatorFn } from '@angular/forms';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { INgsFormsFormControlAddRemove, NGS_FORMS_CONTROL_ADD_REMOVE_FN } from '../../misc';\nimport { NgsFormsInternalService } from '../../services';\nimport { NgsFormsFormItemConfigBaseItemWithNameAndValidators } from '../../models/item-config-bases/';\nimport { NgsFormsBaseClassFormComponent } from '../../classes/index';\n\n@Directive({})\nexport class NgsFormsFormItemWithVisibleAndValidatorsBase<T extends NgsFormsFormItemConfigBaseItemWithNameAndValidators> extends NgsFormsBaseClassFormComponent<T> implements OnInit, OnDestroy {\n control: UntypedFormControl | undefined;\n errorMessage = '';\n private formAddRemoveFns = inject<INgsFormsFormControlAddRemove>(NGS_FORMS_CONTROL_ADD_REMOVE_FN);\n private privateService = inject<NgsFormsInternalService>(NgsFormsInternalService);\n readonly submitted: Signal<boolean> = toSignal(this.privateService.isSubmitted$, { initialValue: false });\n\n ngOnInit() {\n this.control = new FormControl(undefined, { validators: [] });\n //this.bindVisible();\n this.bindValidators();\n //this.bindControlValidityChange();\n this.formAddRemoveFns.add(this.control, this.config.name);\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n this.formAddRemoveFns.remove(this.control!, this.config.name);\n }\n\n private bindValidators() {\n if (!this.config.validators && !this.config.validators$) return;\n if (this.config.validators) {\n this.control!.setValidators(this.config.validators);\n return;\n }\n if (this.config.validators$) {\n this.subscribe(this.config.validators$!, (validators: Array<ValidatorFn>) => this.control!.setValidators(validators));\n }\n }\n\n /*\n private bindVisible() {\n this.subscribe(this.parentVisibility$, (isVisible) => {\n if (this.isVisible === isVisible) return;\n this.isVisible = isVisible;\n if (isVisible) {\n this.formGroup.addControl(this.config.name, this.control);\n return;\n }\n this.formGroup.removeControl(this.config.name);\n });\n }\n */\n}\n\n","import { NgsFormsCommonComponentState, NgsFormsFormItemConfigBaseInput } from '../../models';\nimport { Directive, inject, Signal } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\n\nimport { NgsFormsFormItemWithVisibleAndValidatorsBase } from './form-component-item-with-visible-and-validators-base.class';\nimport { NgsFormsInternalService, NgsFormsService } from '../../services';\n\n@Directive({}) // for compiler\nexport abstract class NgsFormsBaseClassFormInputComponent<T extends NgsFormsFormItemConfigBaseInput> extends NgsFormsFormItemWithVisibleAndValidatorsBase<T> {\n readonly myFormService = inject(NgsFormsService);\n private readonly internalService = inject(NgsFormsInternalService);\n\n readonly commonState: Signal<NgsFormsCommonComponentState> = toSignal(\n this.internalService.subscribeToState(this.config.name),\n { initialValue: {} as NgsFormsCommonComponentState }\n );\n\n toggleDisplayMode(setTo: 'summary' | 'input'){\n\n }\n}\n\n","import { NgsFormsFormItemContainerConfigBase } from '../../models';\n\nimport { NgsFormsBaseClassFormComponent } from './form-component.class';\nimport { Directive, OnDestroy } from '@angular/core';\n\n@Directive({}) // no op for compiler\nexport class NgsFormsBaseClassItemsContainerBase<T extends NgsFormsFormItemContainerConfigBase> extends NgsFormsBaseClassFormComponent<T> implements OnDestroy {}\n","import { Directive, Signal } from '@angular/core';\nimport { NgsFormsBaseClassFormInputComponent } from './form-component-input.class';\nimport { NgsFormsFormInputOption, NgsFormsFormItemConfigBaseInputWithOptions } from '../../models';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { of } from 'rxjs';\n\n@Directive()\nexport class NgsFormsBaseClassFormItemInputWithOptionsComponent<T extends NgsFormsFormItemConfigBaseInputWithOptions> extends NgsFormsBaseClassFormInputComponent<T> {\n options: Signal<Array<NgsFormsFormInputOption>> = toSignal(\n this.config.options$ ?? of(this.config.options ?? []),\n { initialValue: this.config.options ?? [] }\n );\n}\n\n","import { ComponentRef, Injector, Provider, ViewContainerRef } from '@angular/core';\nimport { NgsFormsFormItem } from '../../models';\nimport { NgsSubscriber } from '../../classes/base/subscriber.class';\nimport { INgsFormsFormControlAddRemove, NGS_FORMS_CONTROL_ADD_REMOVE_FN, NGS_FORMS_ITEM_DATA, NGS_FORMS_ITEM_INDEX } from '../../misc';\nimport { BehaviorSubject } from 'rxjs';\nimport { NgsFormsComponentRegistryService } from '../../services/form-component-registry/form-component-registry.service';\n\nexport class NgsFormItemController extends NgsSubscriber {\n private componentRef: ComponentRef<unknown> | undefined;\n private parentVisibility = new BehaviorSubject<boolean>(false);\n private lastVisible: boolean | undefined;\n\n constructor(\n private readonly injector: Injector,\n private readonly viewContainerRef: ViewContainerRef,\n private readonly itemData: NgsFormsFormItem<any>,\n private readonly addRemoveControlFn?: INgsFormsFormControlAddRemove,\n private readonly index?: number\n ) {\n super();\n this.bindVisibility();\n }\n\n destroy() {\n this.detach();\n super.ngOnDestroy();\n }\n\n private bindVisibility() {\n if (!this.itemData.visible$) {\n this.create();\n return;\n }\n this.subscribe(this.itemData.visible$, (visible) => {\n if (this.lastVisible === visible) return;\n\n this.lastVisible = visible;\n if (visible) {\n this.create();\n return;\n }\n this.detach();\n });\n }\n\n private create() {\n const providers: Provider[] = [{ provide: NGS_FORMS_ITEM_DATA, useValue: this.itemData }];\n if (this.index !== undefined) {\n providers.push({ provide: NGS_FORMS_ITEM_INDEX, useValue: this.index });\n }\n if (this.addRemoveControlFn) {\n providers.push({ provide: NGS_FORMS_CONTROL_ADD_REMOVE_FN, useValue: this.addRemoveControlFn });\n }\n const myInjector = Injector.create({\n parent: this.injector,\n providers,\n });\n const componentType = this.injector.get(NgsFormsComponentRegistryService).getComponentTypeForKey(this.itemData.type);\n if (!componentType) {\n console.error(`Ngs form component type ${this.itemData.type} not registered.`);\n return;\n }\n this.componentRef = this.viewContainerRef.createComponent(componentType, { injector: myInjector });\n this.parentVisibility.next(true);\n }\n\n private detach() {\n this.parentVisibility.next(false);\n this.componentRef?.destroy();\n }\n}\n","import { Directive, inject, Injector, Input, OnDestroy, OnInit, ViewContainerRef } from '@angular/core';\nimport { UntypedFormArray, UntypedFormGroup } from '@angular/forms';\nimport { NgsFormItemController } from '../../../controllers';\nimport { INgsFormsFormControlAddRemove, NgsFormsFormControlAddRemoveFunctions } from '../../../misc';\nimport { NgsFormsComponentRegistryService } from '../../../services/form-component-registry/form-component-registry.service';\nimport { NgsFormsFormItem } from '../../../models';\n\n@Directive({\n selector: '[ngs-form-item]',\n //templateUrl: \"./form-item.component.html\",\n})\n\nexport class NgsFormsFormItemDirective implements OnInit, OnDestroy {\n @Input('ngs-form-item')\n itemData: NgsFormsFormItem<any> | undefined = undefined;\n\n @Input('ngs-form-group')\n formGroup?: UntypedFormGroup;\n\n @Input('ngs-form-array')\n formArray?: UntypedFormArray;\n\n @Input('ngs-form-index')\n index?: number;\n\n controller: NgsFormItemController | undefined;\n\n private readonly viewContainerRef = inject(ViewContainerRef);\n private readonly injector = inject(Injector);\n\n private readonly formComponentRegistryService = inject(NgsFormsComponentRegistryService);\n\n ngOnInit(): void {\n if (!this.itemData) {\n return console.error('Form item without form data');\n }\n let addRemoveFn: INgsFormsFormControlAddRemove | undefined = undefined;\n if (this.formArray) {\n addRemoveFn = NgsFormsFormControlAddRemoveFunctions.formArray(this.formArray);\n }\n if (this.formGroup) {\n addRemoveFn = NgsFormsFormControlAddRemoveFunctions.formGroup(this.formGroup);\n }\n this.controller = new NgsFormItemController(this.injector, this.viewContainerRef, this.itemData, addRemoveFn, this.index);\n }\n\n ngOnDestroy() {\n this.controller?.destroy();\n }\n}\n","import { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { NgsFormsService } from '../../../services/forms/forms.service';\nimport { NgsFormsInternalService } from '../../../services/internal/internal-forms.service';\nimport { NgsFormsFormItemDirective } from '../form-item/form-item.component';\n\n@Component({\n selector: 'ngs-form',\n templateUrl: './form.component.html',\n providers: [NgsFormsInternalService],\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormComponent {\n private readonly ngsInternalFormsService = inject(NgsFormsInternalService);\n readonly ngsFormsService = inject(NgsFormsService);\n\n readonly formGroup = toSignal(this.ngsInternalFormsService.formGroup$);\n readonly formConfig = toSignal(this.ngsInternalFormsService.formConfig$);\n\n constructor() {\n this.ngsFormsService.setInternalService(this.ngsInternalFormsService);\n }\n}\n\n","@if (formConfig()?.root && formGroup()) {\n <ng-container [ngs-form-group]=\"formGroup()!\" [ngs-form-item]=\"formConfig()!.root\"></ng-container>\n}\n\n","import { NgsFormsBaseClassItemsContainerBase } from '../../../classes/form-component-base/form-component-items-container.class';\nimport { NgsFormsFormItem, NgsFormsFormItemContainerConfigBase } from '../../../models';\nimport { Component, ChangeDetectionStrategy } from '@angular/core';\n\nimport { v4 } from 'uuid';\nimport { NgsFormsFormItemDirective } from '../../core';\n\n@Component({\n selector: 'ngs-form-component-column',\n templateUrl: './form-column.component.html',\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsColumnComponent extends NgsFormsBaseClassItemsContainerBase<NgsFormsFormItemContainerConfigBase> {\n static override key = 'column';\n\n static create(config: NgsFormsFormItemContainerConfigBase): NgsFormsFormItem<NgsFormsFormItemContainerConfigBase> {\n return {\n uuid: v4(),\n type: NgsFormsColumnComponent.key,\n config,\n };\n }\n}\n","@for (item of config.items; track item.uuid) {\n <ng-container [ngs-form-item]=\"item\"></ng-container>\n}\n","// eslint-disable-next-line @typescript-eslint/no-empty-interface\nimport { NgsFormsFormErrorKeyValueMap } from '../errors';\nimport { Observable } from 'rxjs';\nimport { ValidatorFn } from '@angular/forms';\nimport { NgsFormsFormInputOption } from './form-item-option.model';\nimport { NgsFormsFormItem } from '../form-config';\n\nexport interface NgsFormsFormItemConfigBase {\n uuid?: string;\n}\n\nexport interface NgsFormsFormItemContainerConfigBase extends NgsFormsFormItemConfigBase {\n items: Array<NgsFormsFormItem<any>>\n}\n\nexport interface NgsFormsFormItemConfigBaseItemWithNameAndValidators extends NgsFormsFormItemConfigBase{\n name: string;\n errorMessageMap?: NgsFormsFormErrorKeyValueMap;\n disabled?: boolean;\n disabled$?: Observable<boolean>;\n validators?: Array<ValidatorFn>;\n validators$? :Observable<Array<ValidatorFn>>;\n}\n\n// ---\n\nexport interface NgsFormsFormItemConfigBaseInput extends NgsFormsFormItemConfigBaseItemWithNameAndValidators {\n id?: string;\n label: string;\n value?: unknown;\n}\n\n// ---\n\nexport interface NgsFormsFormItemConfigBaseTextInput extends NgsFormsFormItemConfigBaseInput {\n placeholder?: string;\n type?: 'text' | 'email' | 'password'\n}\n\n\nexport interface NgsFormsFormItemConfigBaseInputWithOptions extends NgsFormsFormItemConfigBaseInput {\n options?: Array<NgsFormsFormInputOption>;\n options$?: Observable<Array<NgsFormsFormInputOption>>;\n}\n// --\n","import { Component, Injector, ChangeDetectionStrategy } from '@angular/core';\nimport { NgsFormItemRowConfig } from './form-row-config.model';\nimport { NgsFormsFormItem } from '../../../models';\nimport { v4 } from 'uuid';\nimport { NgsFormsFormItemDirective, NgsFormsBaseClassFormComponent } from '../../../internal';\n\n@Component({\n selector: 'ngs-forms-row-component',\n templateUrl: './form-row.component.html',\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\n\nexport class NgsFormsRowComponent extends NgsFormsBaseClassFormComponent<NgsFormItemRowConfig> {\n static override key = 'form-row';\n constructor(\n ) {\n super();\n }\n getIndividualRowDivClass(index: number) {\n if (this.config.columnClass) {\n return this.config.columnClass;\n }\n if (!this.config.columnClasses?.length) {\n return '';\n }\n return this.config.columnClasses[index];\n }\n static create(config: NgsFormItemRowConfig): NgsFormsFormItem<NgsFormItemRowConfig> {\n return {\n uuid: v4(),\n type: NgsFormsRowComponent.key,\n config: config,\n };\n }\n}\n","<div class=\"{{config.containerClass}}\">\n @for(item of config.items; track item; let i = $index){\n <div class=\"{{getIndividualRowDivClass(i)}}\">\n <ng-container [ngs-form-item]=\"item\"></ng-container>\n </div>\n }\n</div>\n","import { Component, ChangeDetectionStrategy, inject, Injector, OnInit, ViewContainerRef } from '@angular/core';\nimport {\n UntypedFormControl,\n UntypedFormGroup,\n} from '@angular/forms';\nimport { v4 } from 'uuid';\n\nimport { NgsFormsFormItem, NgsFormsFormItemConfigBaseItemWithNameAndValidators } from '../../../models';\nimport { NgsFormsFormItemWithVisibleAndValidatorsBase } from '../../../classes/form-component-base/form-component-item-with-visible-and-validators-base.class';\n\nimport { NgsFormsFormItemDirective } from '../../core';\n\n\n@Component({\n selector: 'ngs-forms-form-group',\n templateUrl: './form-group.component.html',\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormGroupComponent\n extends NgsFormsFormItemWithVisibleAndValidatorsBase<NgsFormsFormItemConfigBaseItemWithNameAndValidators>\n implements OnInit\n{\n static override key = 'form-group';\n\n static create(\n config: NgsFormsFormItemConfigBaseItemWithNameAndValidators,\n items?: Array<NgsFormsFormItem<any>>\n ): NgsFormsFormItem<NgsFormsFormItemConfigBaseItemWithNameAndValidators> {\n return {\n uuid: v4(),\n type: NgsFormsFormGroupComponent.key,\n config,\n items,\n };\n }\n\n get formGroupControl(): UntypedFormGroup {\n return this.control as unknown as UntypedFormGroup;\n }\n\n constructor() {\n super();\n this.control = new UntypedFormGroup({}) as unknown as UntypedFormControl;\n }\n}\n\n","@if (itemData.items) {\n @for (item of itemData.items; track item.uuid) {\n <ng-container [ngs-form-item]=\"item\" [ngs-form-group]=\"formGroupControl\"></ng-container>\n }\n}\n","import { inject, Injectable, OnDestroy } from '@angular/core';\n\nimport { UntypedFormArray, UntypedFormGroup } from '@angular/forms';\nimport { NgsFormItemArrayConfig } from '../container';\n\nimport { INgsFormsFormControlAddRemove, NGS_FORMS_CONTROL_ADD_REMOVE_FN, NGS_FORMS_ITEM_DATA } from '../../../../misc';\nimport { NgsFormsFormItem } from '../../../../models/index';\n\n@Injectable()\nexport class NgsFormsFormArrayInternalService implements OnDestroy {\n config = inject<NgsFormsFormItem<NgsFormItemArrayConfig>>(NGS_FORMS_ITEM_DATA).config;\n\n readonly formArray = new UntypedFormArray([]);\n addRemoveFn = inject<INgsFormsFormControlAddRemove>(NGS_FORMS_CONTROL_ADD_REMOVE_FN);\n constructor() {\n this.addRemoveFn.add(this.formArray, this.config.name);\n if (this.config.initialItemCount) {\n for (let i = 0; i < this.config.initialItemCount; i++) {\n this.addItem();\n }\n }\n }\n\n ngOnDestroy() {\n this.addRemoveFn.remove(this.formArray, this.config.name);\n }\n\n removeAt(index: number) {\n if (this.config?.minItems && this.formArray.controls.length <= this.config!.minItems!) {\n return;\n }\n if (!this.formArray.controls.length) {\n return;\n }\n this.formArray.removeAt(index);\n }\n addItem() {\n if (this.config?.maxItems && this.formArray.controls.length >= this.config!.maxItems) {\n return;\n }\n this.formArray.controls.push(new UntypedFormGroup({}));\n }\n}\n","import { Component, inject, ChangeDetectionStrategy } from '@angular/core';\nimport { NgsFormsBaseClassFormComponent } from '../../../../classes/form-component-base/form-component.class';\nimport { NgsFormsFormItem } from '../../../../models';\nimport { NgsFormItemArrayAddItemConfig } from './form-array-add-item-config.model';\nimport { NgsFormsFormArrayInternalService } from '../service/form-array-internal.service';\nimport { v4 } from 'uuid';\n\n@Component({\n selector: 'ngs-forms-form-array-add-item',\n templateUrl: './form-array-add-item.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormArrayAddItemComponent extends NgsFormsBaseClassFormComponent<NgsFormItemArrayAddItemConfig> {\n static override key = 'form-array-add-item';\n internalArrayService = inject(NgsFormsFormArrayInternalService);\n\n static create(config: NgsFormItemArrayAddItemConfig): NgsFormsFormItem<NgsFormItemArrayAddItemConfig> {\n return {\n uuid: v4(),\n type: NgsFormsFormArrayAddItemComponent.key,\n config: config,\n };\n }\n\n addItem() {\n this.internalArrayService.addItem();\n }\n}\n","<button\n (click)=\"addItem()\"\n [class]=\"config.buttonClass || 'btn btn-outline-primary'\"\n type=\"button\">\n @if (config.buttonIcon) {\n <i [class]=\"config.buttonIcon\" aria-hidden=\"true\"></i>\n }\n {{ config.buttonText || 'Add Item' }}\n</button>\n","import { Component, ChangeDetectionStrategy } from '@angular/core';\nimport { NgsFormsFormItem } from '../../../../models';\nimport { NgsFormsFormItemDirective } from '../../../core/index';\nimport { NgsFormItemArrayConfig } from './form-array-config.model';\nimport { NgsFormsFormItemWithVisibleAndValidatorsBase } from '../../../../classes/form-component-base/form-component-item-with-visible-and-validators-base.class';\nimport { NgsFormsFormArrayInternalService } from '../service/form-array-internal.service';\nimport { v4 } from 'uuid';\n\n@Component({\n selector: 'ngs-forms-form-array',\n imports: [NgsFormsFormItemDirective],\n templateUrl: './form-array.component.html',\n providers: [NgsFormsFormArrayInternalService],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormArrayContainerComponent extends NgsFormsFormItemWithVisibleAndValidatorsBase<NgsFormItemArrayConfig> {\n static override key = 'form-array';\n static create(\n config: NgsFormItemArrayConfig\n ): NgsFormsFormItem<NgsFormItemArrayConfig> {\n return {\n uuid: v4(),\n type: NgsFormsFormArrayContainerComponent.key,\n config: config,\n };\n }\n}\n","<div [class]=\"config.containerClass || ''\">\n @for (item of config.items; track item.uuid) {\n <ng-container [ngs-form-item]=\"item\"></ng-container>\n }\n</div>\n","import { Component, inject, ChangeDetectionStrategy } from '@angular/core';\nimport { NgsFormsFormArrayInternalService } from '../service';\nimport { AbstractControl, FormArray, UntypedFormGroup } from '@angular/forms';\n\nimport { v4 } from 'uuid';\nimport { NgsFormsFormArrayListConfig } from './form-array-list.config';\nimport { NgsFormsFormItemDirective, NgsFormsBaseClassFormComponent, NgsFormsFormItem } from '../../../../internal';\n\n@Component({\n selector: 'ngs-forms-form-array-list',\n templateUrl: './form-array-list.component.html',\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormArrayListComponent extends NgsFormsBaseClassFormComponent<NgsFormsFormArrayListConfig> {\n static override key = 'form-array-list';\n public internalArrayService = inject<NgsFormsFormArrayInternalService>(\n NgsFormsFormArrayInternalService\n );\n public myFormArray: FormArray<any> = this.internalArrayService.formArray;\n\n static create(\n config: NgsFormsFormArrayListConfig\n ): NgsFormsFormItem<NgsFormsFormArrayListConfig> {\n return {\n uuid: v4(),\n type: NgsFormsFormArrayListComponent.key,\n config: config,\n };\n }\n\n castToFormGroup(control: AbstractControl): UntypedFormGroup {\n return control as UntypedFormGroup;\n }\n}\n","@for (formGroup of myFormArray.controls; track formGroup; let i = $index) {\n <div [attr.data-index]=\"$index\" [class]=\"config.containerClass || ''\">\n <ng-container [ngs-form-group]=\"castToFormGroup(formGroup)\" [ngs-form-index]=\"i\"\n [ngs-form-item]=\"config.templateItem\"></ng-container>\n </div>\n}\n","import { Component, inject, ChangeDetectionStrategy } from '@angular/core';\nimport { NgsFormsBaseClassFormComponent } from '../../../../classes/form-component-base/form-component.class';\nimport { NgsFormsFormItem } from '../../../../models';\nimport { NgsFormItemArrayRemoveItemConfig } from './form-array-remove-item-config.model';\nimport { NgsFormsFormArrayInternalService } from '../service';\nimport { NGS_FORMS_ITEM_INDEX } from '../../../../misc';\nimport { v4 } from 'uuid';\n\n@Component({\n selector: 'ngs-forms-form-array-remove-item',\n templateUrl: './form-array-remove-item.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormArrayRemoveItemComponent extends NgsFormsBaseClassFormComponent<NgsFormItemArrayRemoveItemConfig> {\n static override key = 'form-array-remove-item';\n internalArrayService = inject(NgsFormsFormArrayInternalService);\n myIndex = inject<number>(NGS_FORMS_ITEM_INDEX);\n\n constructor() {\n super();\n }\n\n static create(config: NgsFormItemArrayRemoveItemConfig): NgsFormsFormItem<NgsFormItemArrayRemoveItemConfig> {\n return {\n uuid: v4(),\n type: NgsFormsFormArrayRemoveItemComponent.key,\n config,\n };\n }\n\n removeItem() {\n this.internalArrayService.removeAt(this.myIndex);\n }\n}\n","<button\n (click)=\"removeItem()\"\n [class]=\"config.buttonClass || 'btn btn-outline-danger btn-sm'\"\n type=\"button\">\n @if (config.buttonIcon) {\n <i [class]=\"config.buttonIcon\" aria-hidden=\"true\"></i>\n }\n {{ config.buttonText || 'Remove' }}\n index:{{ myIndex }}\n</button>\n","import { Component, ChangeDetectionStrategy } from '@angular/core';\nimport { NgsFormsBaseClassFormComponent } from '../../../classes/form-component-base/form-component.class';\nimport { NgsFormsTextDivConfig } from './text-div-config.model';\nimport { NgsFormsFormItem } from '../../../models';\nimport { v4 } from 'uuid';\n\n@Component({\n selector: 'ngs-form-component-text-div',\n imports: [],\n templateUrl: './text-div.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsTextDivComponent extends NgsFormsBaseClassFormComponent<NgsFormsTextDivConfig> {\n static override key = 'text-div';\n\n static create(\n config: NgsFormsTextDivConfig\n ): NgsFormsFormItem<NgsFormsTextDivConfig> {\n return {\n uuid: v4(),\n type: NgsFormsTextDivComponent.key,\n config: config,\n };\n }\n static title(\n title: string,\n divClass = 'h2'\n ): NgsFormsFormItem<NgsFormsTextDivConfig> {\n return NgsFormsTextDivComponent.create({\n text: title,\n classes: divClass,\n });\n }\n}\n","<div class=\"{{config.classes\">{{ config.text }}</div>\n","import { Component, ChangeDetectionStrategy, inject, Sanitizer, SecurityContext } from '@angular/core';\nimport { NgsFormsBaseClassFormComponent } from '../../../classes/form-component-base/form-component.class';\nimport { NgsFormItemHtmlContentConfig } from './html-content-config.model';\nimport { NgsFormsFormItem } from '../../../models';\nimport { v4 } from 'uuid';\n\n@Component({\n selector: 'ngs-form-component-html-content',\n imports: [],\n templateUrl: './html-content.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsHtmlContentComponent extends NgsFormsBaseClassFormComponent<NgsFormItemHtmlContentConfig> {\n static override key = 'content-html';\n contentConfig = this.config as NgsFormItemHtmlContentConfig;\n html: string;\n\n constructor() {\n super();\n const sanitizer = inject(Sanitizer);\n this.html =\n sanitizer.sanitize(SecurityContext.HTML, this.contentConfig.html) ||\n '';\n }\n\n static create(\n config: NgsFormItemHtmlContentConfig\n ): NgsFormsFormItem<NgsFormItemHtmlContentConfig> {\n return {\n uuid: v4(),\n type: NgsFormsHtmlContentComponent.key,\n config,\n };\n }\n}\n","<div [innerHTML]=\"html\"></div>\n","import { NgsFormsFormItemContainerConfigBase } from '../../../models/index';\n\nexport interface NgsFormsFormSectionConfig extends NgsFormsFormItemContainerConfigBase {\n title: string;\n titleClass?: string;\n subtitle?: string;\n subtitleClass?: string;\n}\n\nexport const sectionConfigDefaults: Partial<NgsFormsFormSectionConfig> = {\n titleClass: 'h3',\n subtitleClass: 'lead',\n};\n","import { NgsFormsBaseClassItemsContainerBase } from '../../../classes/form-component-base/form-component-items-container.class';\nimport { NgsFormsFormSectionConfig, sectionConfigDefaults } from './section-config.interface';\nimport { Component, ChangeDetectionStrategy, OnInit } from '@angular/core';\nimport { ngsDefaults } from '../../../misc/defaults';\nimport { v4 } from 'uuid';\nimport { NgsFormsFormItemDirective } from '../../core';\nimport { NgsFormsFormItem } from '../../../models';\n\n@Component({\n selector: 'ngs-forms-form-section',\n templateUrl: './section.component.html',\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormSectionComponent extends NgsFormsBaseClassItemsContainerBase<NgsFormsFormSectionConfig> implements OnInit {\n static override key = 'section';\n\n static create(config: NgsFormsFormSectionConfig): NgsFormsFormItem<NgsFormsFormSectionConfig> {\n return {\n uuid: v4(),\n type: NgsFormsFormSectionComponent.key,\n config: config,\n };\n }\n\n ngOnInit() {\n this.config = ngsDefaults(this.config, sectionConfigDefaults);\n }\n}\n","<div class=\"form-section\">\n <div class=\"form-section-title {{config.titleClass}}\">{{ config.title }}</div>\n @if (config.subtitle) {\n <div class=\"form-section-subtitle {{config.subtitleClass}}\">{{ config.subtitle }}</div>\n }\n @if (config.items.length) {\n <div class=\"form-section-items\">\n @for (item of config.items; track item.uuid) {\n <ng-container [ngs-form-item]=\"item\"></ng-container>\n }\n </div>\n }\n</div>\n","import { NgModule } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { CommonModule } from '@angular/common';\nimport { NgsFormsColumnComponent } from './components/shared-form-components/column';\nimport { NgsFormsComponentRegistryService } from './services/form-component-registry/form-component-registry.service';\nimport { NgsFormsFormArrayAddItemComponent } from './components/shared-form-components/form-array/add-item';\nimport { NgsFormsFormArrayContainerComponent } from './components/shared-form-components/form-array/container';\nimport { NgsFormsFormArrayListComponent } from './components/shared-form-components/form-array/list';\nimport { NgsFormsFormArrayRemoveItemComponent } from './components/shared-form-components/form-array/remove-item';\nimport { NgsFormsFormSectionComponent } from './components/shared-form-components/section/section.component';\nimport { NgsFormsRowComponent } from './components/shared-form-components/row';\nimport { NgsFormsTextDivComponent } from './components/shared-form-components/text-div';\nimport { NgsFormsFormGroupComponent } from './components/shared-form-components/form-group';\n\n\n@NgModule({\n imports: [CommonModule, FormsModule, ReactiveFormsModule],\n})\nexport class NgsFormsCoreModule {\n static registerCoreNgsFormComponents(\n registryService: NgsFormsComponentRegistryService\n ) {\n registryService.register(NgsFormsFormGroupComponent.key, NgsFormsFormGroupComponent);\n registryService.register(NgsFormsRowComponent.key, NgsFormsRowComponent);\n registryService.register(\n NgsFormsColumnComponent.key,\n NgsFormsColumnComponent\n );\n registryService.register(\n NgsFormsFormArrayContainerComponent.key,\n NgsFormsFormArrayContainerComponent\n );\n registryService.register(\n NgsFormsFormArrayAddItemComponent.key,\n NgsFormsFormArrayAddItemComponent\n );\n registryService.register(\n NgsFormsFormArrayRemoveItemComponent.key,\n NgsFormsFormArrayRemoveItemComponent\n );\n registryService.register(\n NgsFormsFormArrayListComponent.key,\n NgsFormsFormArrayListComponent\n );\n registryService.register(\n NgsFormsTextDivComponent.key,\n NgsFormsTextDivComponent\n );\n //registryService.register('content-html', NgsFormsHtmlContentComponent);\n registryService.register(\n NgsFormsFormSectionComponent.key,\n NgsFormsFormSectionComponent\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["uuidv4"],"mappings":";;;;;;;;MAIsB,aAAa,CAAA;AACd,IAAA,QAAQ,GAAG,IAAI,OAAO,EAAQ;IAEvC,aAAa,GAAmB,EAAE;IAE5C,SAAS,CAAI,WAA0B,EAAE,YAAgC,EAAA;AACvE,QAAA,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC;IACpE;IAEA,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE;AACpB,QAAA,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE;AACxB,QAAA,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,UAAU,KAAK,UAAU,CAAC,WAAW,EAAE,CAAC;IACtE;wGAboB,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAAb,aAAa,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;4FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBADlC;;;MCAY,mBAAmB,GAAG,IAAI,cAAc,CAAC,qBAAqB;MAC9D,+BAA+B,GAAG,IAAI,cAAc,CAAC,4BAA4B;MACjF,oBAAoB,GAAG,IAAI,cAAc,CAAC,sBAAsB;AAYtE,MAAM,qCAAqC,GAAsC;AACtF,IAAA,SAAS,EAAE,CAAC,SAAS,MAAM;AACzB,QAAA,GAAG,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,SAAS,CAAC,UAAU,CAAC,WAAW,EAAE,OAAO,CAAC;AACzE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AA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,EAAA,OAAA,EAAA,CAFnB,YAAY,EAAE,WAAW,EAAE,mBAAmB,CAAA,EAAA,CAAA;AAE7C,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,EAAA,OAAA,EAAA,CAFnB,YAAY,EAAE,WAAW,EAAE,mBAAmB,CAAA,EAAA,CAAA;;4FAE7C,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAH9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,mBAAmB,CAAC;AAC1D,iBAAA;;;ACjBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-simplicity-forms-core.mjs","sources":["../../../../libs/forms-core/src/classes/base/subscriber.class.ts","../../../../libs/forms-core/src/misc/injection-tokens.constants.ts","../../../../libs/forms-core/src/misc/defaults.ts","../../../../libs/forms-core/src/classes/form-component-base/form-component.class.ts","../../../../libs/forms-core/src/services/form-component-registry/form-component-registry.service.ts","../../../../libs/forms-core/src/services/forms/forms.service.ts","../../../../libs/forms-core/src/services/internal/internal-forms.service.ts","../../../../libs/forms-core/src/classes/form-component-base/form-component-item-with-visible-and-validators-base.class.ts","../../../../libs/forms-core/src/classes/form-component-base/form-component-input.class.ts","../../../../libs/forms-core/src/classes/form-component-base/form-component-items-container.class.ts","../../../../libs/forms-core/src/classes/form-component-base/form-component-input-with-options-base.class.ts","../../../../libs/forms-core/src/controllers/form-item/form-item.controller.ts","../../../../libs/forms-core/src/components/core/form-item/form-item.component.ts","../../../../libs/forms-core/src/components/core/form/form.component.ts","../../../../libs/forms-core/src/components/core/form/form.component.html","../../../../libs/forms-core/src/components/shared-form-components/column/form-column.component.ts","../../../../libs/forms-core/src/components/shared-form-components/column/form-column.component.html","../../../../libs/forms-core/src/models/item-config-bases/form-item-config-base.model.ts","../../../../libs/forms-core/src/components/shared-form-components/row/form-row.component.ts","../../../../libs/forms-core/src/components/shared-form-components/row/form-row.component.html","../../../../libs/forms-core/src/components/shared-form-components/form-group/form-group.component.ts","../../../../libs/forms-core/src/components/shared-form-components/form-group/form-group.component.html","../../../../libs/forms-core/src/components/shared-form-components/form-array/service/form-array-internal.service.ts","../../../../libs/forms-core/src/components/shared-form-components/form-array/add-item/form-array-add-item.component.ts","../../../../libs/forms-core/src/components/shared-form-components/form-array/add-item/form-array-add-item.component.html","../../../../libs/forms-core/src/components/shared-form-components/form-array/container/form-array.component.ts","../../../../libs/forms-core/src/components/shared-form-components/form-array/container/form-array.component.html","../../../../libs/forms-core/src/components/shared-form-components/form-array/list/form-array-list.component.ts","../../../../libs/forms-core/src/components/shared-form-components/form-array/list/form-array-list.component.html","../../../../libs/forms-core/src/components/shared-form-components/form-array/remove-item/form-array-remove-item.component.ts","../../../../libs/forms-core/src/components/shared-form-components/form-array/remove-item/form-array-remove-item.component.html","../../../../libs/forms-core/src/components/shared-form-components/text-div/text-div.component.ts","../../../../libs/forms-core/src/components/shared-form-components/text-div/text-div.component.html","../../../../libs/forms-core/src/components/shared-form-components/html-content/html-content.component.ts","../../../../libs/forms-core/src/components/shared-form-components/html-content/html-content.component.html","../../../../libs/forms-core/src/components/shared-form-components/section/section-config.interface.ts","../../../../libs/forms-core/src/components/shared-form-components/section/section.component.ts","../../../../libs/forms-core/src/components/shared-form-components/section/section.component.html","../../../../libs/forms-core/src/forms-core.module.ts","../../../../libs/forms-core/src/ng-simplicity-forms-core.ts"],"sourcesContent":["import { Observable, Subject, Subscription, takeUntil } from 'rxjs';\nimport { Directive } from '@angular/core';\n\n@Directive() // No-op, just for Angular compiler\nexport abstract class NgsSubscriber {\n protected readonly destroy$ = new Subject<void>();\n\n protected subscriptions: Subscription[] = [];\n\n subscribe<T>(subscribeTo: Observable<T>, nextObserver: (value: T) => void): void {\n subscribeTo.pipe(takeUntil(this.destroy$)).subscribe(nextObserver);\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n this.subscriptions.forEach((subscriber) => subscriber.unsubscribe());\n }\n}\n","import { InjectionToken } from '@angular/core';\nimport { AbstractControl, UntypedFormArray, UntypedFormGroup } from '@angular/forms';\n\nexport const NGS_FORMS_ITEM_DATA = new InjectionToken('ngs-forms-item-data');\nexport const NGS_FORMS_CONTROL_ADD_REMOVE_FN = new InjectionToken('ngs-form-control-remove-fn');\nexport const NGS_FORMS_ITEM_INDEX = new InjectionToken('ngs-forms-item-index');\n\ntype FormControlAddRemoveFn = (control: AbstractControl, controlName: string) => void;\n\nexport interface INgsFormsFormControlAddRemove {\n add: FormControlAddRemoveFn;\n remove: FormControlAddRemoveFn;\n}\ninterface IControlAddRemoveFunctionsBuilder {\n formGroup: (formGroup: UntypedFormGroup) => INgsFormsFormControlAddRemove;\n formArray: (formArray: UntypedFormArray) => INgsFormsFormControlAddRemove;\n}\nexport const NgsFormsFormControlAddRemoveFunctions: IControlAddRemoveFunctionsBuilder = {\n formGroup: (formGroup) => ({\n add: (control, controlName) => formGroup.addControl(controlName, control),\n remove: (control, controlName) => formGroup.removeControl(controlName),\n }),\n formArray: (formArray: UntypedFormArray) => ({\n add: (control, controlName) => formArray.controls.push(control),\n remove: (control, controlName) => {\n const index = formArray.controls.indexOf(control);\n formArray.controls.splice(index, 1);\n },\n }),\n};\n","/**\n * Simple alternative to lodash.defaults.\n * Returns a new object with properties from source assigned to target\n * if the properties are undefined or missing on target.\n */\nexport function ngsDefaults<T extends object, U extends object>(target: T, source: U): T & U;\nexport function ngsDefaults(target: any, ...sources: any[]): any {\n const result = target ? { ...target } : {};\n for (const source of sources) {\n if (!source) continue;\n for (const key of Object.keys(source)) {\n if (result[key] === undefined) {\n result[key] = source[key];\n }\n }\n }\n return result;\n}\n","import { Directive, inject, Injector } from '@angular/core';\nimport { v4 as uuidv4 } from 'uuid';\nimport { NgsSubscriber } from '../base/subscriber.class';\nimport { NGS_FORMS_ITEM_DATA } from '../../misc';\nimport { NgsFormsFormItem, NgsFormsFormItemConfigBase } from '../../models';\n\n@Directive({})\nexport abstract class NgsFormsBaseClassFormComponent<T extends NgsFormsFormItemConfigBase> extends NgsSubscriber {\n static key: string;\n id = uuidv4();\n protected config: T;\n protected readonly itemData: NgsFormsFormItem<T>;\n constructor() {\n super();\n this.itemData = inject<NgsFormsFormItem<T>>(NGS_FORMS_ITEM_DATA);\n this.config = this.itemData.config;\n }\n}\n","import { Injectable, Type } from '@angular/core';\n\n@Injectable({ providedIn: 'platform' })\nexport class NgsFormsComponentRegistryService {\n private readonly itemComponentRegistry: TItemComponentRegistry = {};\n getComponentTypeForKey(key: string): Type<unknown> | undefined {\n return this.itemComponentRegistry[key];\n }\n register(key: string, component: Type<unknown>): void {\n this.itemComponentRegistry[key] = component;\n }\n}\n\ntype TItemComponentRegistry = { [key: string]: Type<unknown> };\n","import { UntypedFormGroup } from '@angular/forms';\nimport { BehaviorSubject, Subject, Subscription } from 'rxjs';\nimport { NgsFormsFormConfig } from '../../models';\nimport { NgsFormsInternalService } from '../internal/internal-forms.service';\nimport { Injectable, OnDestroy } from '@angular/core';\n\n@Injectable()\nexport class NgsFormsService implements OnDestroy {\n attempt = 0;\n formValue$ = new BehaviorSubject<any>({});\n formValue: any = {};\n private internalFormService: NgsFormsInternalService | undefined;\n private formGroupSubscriptions: Array<Subscription> = [];\n private formGroup = new UntypedFormGroup({});\n\n get dirty(): boolean {\n return this.formGroup?.dirty ?? false;\n }\n get isValid(): boolean {\n if (!this.internalServiceIsSet) return false;\n return this.internalFormService!.checkIsValid();\n }\n get internalServiceIsSet(): boolean {\n return !!this.internalFormService;\n }\n\n setFormConfig(formConfig: NgsFormsFormConfig): void {\n if (!this.internalServiceIsSet) {\n if (this.attempt > 20) {\n console.error('Internal form service is unavailable. Is the ngs-form root tag added to the page?');\n return;\n }\n this.attempt++;\n setTimeout(() => this.setFormConfig(formConfig), 25);\n return;\n }\n this.internalFormService!.setFormData(formConfig);\n }\n\n setInternalService(internalFormsService: NgsFormsInternalService): void {\n this.internalFormService = internalFormsService;\n this.bindFormGroup();\n }\n\n setIsSubmitted(isSubmitted: boolean): void {\n if (!this.internalServiceIsSet) return;\n this.internalFormService!.setIsSubmitted(isSubmitted);\n }\n\n private bindFormGroup(): void {\n this.internalFormService!.formGroup$.subscribe((fg) => {\n this.formGroup = fg;\n this.formGroupSubscriptions.forEach((subscription) => subscription.unsubscribe());\n\n this.formGroupSubscriptions.push(\n this.formGroup.valueChanges.subscribe((v) => {\n this.formValue = v;\n this.formValue$.next(v);\n })\n );\n });\n }\n updateComponentState(componentKey: string, state: any): void {\n this.internalFormService?.updateComponentState(componentKey, state);\n }\n updateGlobalState(state: any): void {\n this.internalFormService?.updateGlobalState(state);\n }\n ngOnDestroy() {\n this.formGroupSubscriptions.forEach((subscription) => subscription.unsubscribe());\n }\n\n patchValue(entityData: any) {\n this.formGroup.patchValue(entityData);\n }\n}\n","import { BehaviorSubject, filter, map } from 'rxjs';\nimport { FormGroup, UntypedFormGroup } from '@angular/forms';\nimport { NgsFormsFormConfig } from '../../models';\nimport { Injectable } from '@angular/core';\nimport { NgsFormsGlobalFormState } from '../../models/global-state.interface';\nimport { ngsDefaults } from '../../misc/defaults';\n\n@Injectable()\nexport class NgsFormsInternalService {\n formGroup$ = new BehaviorSubject<FormGroup>(new UntypedFormGroup({}));\n formConfig$ = new BehaviorSubject<NgsFormsFormConfig | undefined>(undefined);\n isSubmitted$ = new BehaviorSubject<boolean>(false);\n state = new BehaviorSubject<{ [key: string]: any }>({});\n setIsSubmitted(isSubmitted: boolean): void {\n this.isSubmitted$.next(isSubmitted);\n }\n\n checkIsValid(): boolean {\n if (!this.formGroup$.value) return false;\n return this.formGroup$.value.valid;\n }\n\n setFormData(formConfig: NgsFormsFormConfig) {\n this.formGroup$.next(new UntypedFormGroup({}));\n this.formConfig$.next(formConfig);\n this.isSubmitted$.next(false);\n }\n private mergeState(key: string, update: any): void {\n const obj = this.state.value[key] || {};\n const updated = ngsDefaults(update, obj);\n this.state.value[key] = updated;\n this.state.next(this.state.value);\n }\n updateGlobalState(state: NgsFormsGlobalFormState) {\n this.mergeState('global', state);\n }\n updateComponentState(componentKey: string, state: any) {\n this.mergeState(componentKey, state);\n }\n\n subscribeToState(uuid: string, name?: string) {\n let last = '';\n return this.state.pipe(\n map((allState) => {\n const stateByUuid = allState[uuid] || {};\n const stateByName = name ? (allState[name] || {}) : {};\n const globalState = allState['global'] || {};\n return ngsDefaults(stateByUuid, ngsDefaults(stateByName, globalState));\n }),\n filter((currentState) => {\n const stringifiedState = JSON.stringify(currentState);\n const isUpdated = stringifiedState !== last;\n last = stringifiedState;\n return isUpdated;\n })\n );\n }\n}\n","import { Directive, inject, OnDestroy, OnInit, Signal, ChangeDetectorRef } from '@angular/core';\nimport { FormControl, UntypedFormControl, ValidatorFn } from '@angular/forms';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { INgsFormsFormControlAddRemove, NGS_FORMS_CONTROL_ADD_REMOVE_FN } from '../../misc';\nimport { NgsFormsInternalService } from '../../services';\nimport { NgsFormsFormItemConfigBaseItemWithNameAndValidators } from '../../models/item-config-bases/';\nimport { NgsFormsBaseClassFormComponent } from '../../classes/index';\nimport { merge } from 'rxjs';\n\n@Directive({})\nexport class NgsFormsFormItemWithVisibleAndValidatorsBase<T extends NgsFormsFormItemConfigBaseItemWithNameAndValidators> extends NgsFormsBaseClassFormComponent<T> implements OnInit, OnDestroy {\n control: UntypedFormControl | undefined;\n errorMessage = '';\n private formAddRemoveFns = inject<INgsFormsFormControlAddRemove>(NGS_FORMS_CONTROL_ADD_REMOVE_FN);\n private privateService = inject<NgsFormsInternalService>(NgsFormsInternalService);\n private changeDetectorRef = inject(ChangeDetectorRef);\n readonly submitted: Signal<boolean> = toSignal(this.privateService.isSubmitted$, { initialValue: false });\n\n ngOnInit() {\n if (!this.control) {\n this.control = new FormControl(undefined, { validators: [] });\n }\n //this.bindVisible();\n this.bindValidators();\n //this.bindControlValidityChange();\n this.formAddRemoveFns.add(this.control, this.config.name);\n\n // Listen to changes and update error message dynamically\n this.subscribe(\n merge(\n this.control.valueChanges,\n this.control.statusChanges,\n this.privateService.isSubmitted$\n ),\n () => {\n this.updateErrorMessage();\n this.changeDetectorRef.markForCheck();\n }\n );\n }\n\n private updateErrorMessage() {\n if (!this.control) {\n this.errorMessage = '';\n return;\n }\n const showErrors = this.control.invalid && (this.control.touched || this.control.dirty || this.submitted());\n if (!showErrors) {\n this.errorMessage = '';\n return;\n }\n const errors = this.control.errors;\n if (!errors) {\n this.errorMessage = '';\n return;\n }\n const firstErrorKey = Object.keys(errors)[0];\n const map = this.config.errorMessageMap;\n this.errorMessage = map?.[firstErrorKey] || `Field is invalid: ${firstErrorKey}`;\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n this.formAddRemoveFns.remove(this.control!, this.config.name);\n }\n\n private bindValidators() {\n if (!this.config.validators && !this.config.validators$) return;\n if (this.config.validators) {\n this.control!.setValidators(this.config.validators);\n return;\n }\n if (this.config.validators$) {\n this.subscribe(this.config.validators$!, (validators: Array<ValidatorFn>) => this.control!.setValidators(validators));\n }\n }\n\n /*\n private bindVisible() {\n this.subscribe(this.parentVisibility$, (isVisible) => {\n if (this.isVisible === isVisible) return;\n this.isVisible = isVisible;\n if (isVisible) {\n this.formGroup.addControl(this.config.name, this.control);\n return;\n }\n this.formGroup.removeControl(this.config.name);\n });\n }\n */\n}\n\n","import { NgsFormsCommonComponentState, NgsFormsFormItemConfigBaseInput } from '../../models';\nimport { Directive, inject, Signal } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\n\nimport { NgsFormsFormItemWithVisibleAndValidatorsBase } from './form-component-item-with-visible-and-validators-base.class';\nimport { NgsFormsInternalService, NgsFormsService } from '../../services';\n\n@Directive({}) // for compiler\nexport abstract class NgsFormsBaseClassFormInputComponent<T extends NgsFormsFormItemConfigBaseInput> extends NgsFormsFormItemWithVisibleAndValidatorsBase<T> {\n readonly myFormService = inject(NgsFormsService);\n private readonly internalService = inject(NgsFormsInternalService);\n\n readonly commonState: Signal<NgsFormsCommonComponentState> = toSignal(\n this.internalService.subscribeToState(this.itemData.uuid || '', this.config.name),\n { initialValue: {} as NgsFormsCommonComponentState }\n );\n\n toggleDisplayMode(setTo: 'summary' | 'input'){\n\n }\n}\n\n","import { NgsFormsFormItemContainerConfigBase } from '../../models';\n\nimport { NgsFormsBaseClassFormComponent } from './form-component.class';\nimport { Directive, OnDestroy } from '@angular/core';\n\n@Directive({}) // no op for compiler\nexport class NgsFormsBaseClassItemsContainerBase<T extends NgsFormsFormItemContainerConfigBase> extends NgsFormsBaseClassFormComponent<T> implements OnDestroy {}\n","import { Directive, Signal } from '@angular/core';\nimport { NgsFormsBaseClassFormInputComponent } from './form-component-input.class';\nimport { NgsFormsFormInputOption, NgsFormsFormItemConfigBaseInputWithOptions } from '../../models';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { of } from 'rxjs';\n\n@Directive()\nexport class NgsFormsBaseClassFormItemInputWithOptionsComponent<T extends NgsFormsFormItemConfigBaseInputWithOptions> extends NgsFormsBaseClassFormInputComponent<T> {\n options: Signal<Array<NgsFormsFormInputOption>> = toSignal(\n this.config.options$ ?? of(this.config.options ?? []),\n { initialValue: this.config.options ?? [] }\n );\n}\n\n","import { ChangeDetectorRef, ComponentRef, Injector, Provider, ViewContainerRef } from '@angular/core';\nimport { NgsFormsFormItem } from '../../models';\nimport { NgsSubscriber } from '../../classes/base/subscriber.class';\nimport { INgsFormsFormControlAddRemove, NGS_FORMS_CONTROL_ADD_REMOVE_FN, NGS_FORMS_ITEM_DATA, NGS_FORMS_ITEM_INDEX } from '../../misc';\nimport { BehaviorSubject } from 'rxjs';\nimport { NgsFormsComponentRegistryService } from '../../services/form-component-registry/form-component-registry.service';\n\nexport class NgsFormItemController extends NgsSubscriber {\n private componentRef: ComponentRef<unknown> | undefined;\n private parentVisibility = new BehaviorSubject<boolean>(false);\n private lastVisible: boolean | undefined;\n\n constructor(\n private readonly injector: Injector,\n private readonly viewContainerRef: ViewContainerRef,\n private readonly itemData: NgsFormsFormItem<any>,\n private readonly addRemoveControlFn?: INgsFormsFormControlAddRemove,\n private readonly index?: number,\n private readonly changeDetectorRef?: ChangeDetectorRef\n ) {\n super();\n this.bindVisibility();\n }\n\n destroy() {\n this.detach();\n super.ngOnDestroy();\n }\n\n private bindVisibility() {\n if (!this.itemData.config.visible$) {\n Promise.resolve().then(() => this.create());\n return;\n }\n this.subscribe(this.itemData.config.visible$, (visible: any) => {\n if (this.lastVisible === visible) return;\n\n this.lastVisible = visible;\n if (visible) {\n Promise.resolve().then(() => this.create());\n return;\n }\n this.detach();\n });\n }\n\n private create() {\n const providers: Provider[] = [{ provide: NGS_FORMS_ITEM_DATA, useValue: this.itemData }];\n if (this.index !== undefined) {\n providers.push({ provide: NGS_FORMS_ITEM_INDEX, useValue: this.index });\n }\n if (this.addRemoveControlFn) {\n providers.push({ provide: NGS_FORMS_CONTROL_ADD_REMOVE_FN, useValue: this.addRemoveControlFn });\n }\n const myInjector = Injector.create({\n parent: this.injector,\n providers,\n });\n const componentType = this.injector.get(NgsFormsComponentRegistryService).getComponentTypeForKey(this.itemData.type);\n if (!componentType) {\n console.error(`Ngs form component type ${this.itemData.type} not registered.`);\n return;\n }\n this.componentRef = this.viewContainerRef.createComponent(componentType, { injector: myInjector });\n this.componentRef.changeDetectorRef?.detectChanges();\n this.changeDetectorRef?.markForCheck();\n this.parentVisibility.next(true);\n }\n\n private detach() {\n this.parentVisibility.next(false);\n this.componentRef?.destroy();\n this.changeDetectorRef?.markForCheck();\n }\n}\n","import { ChangeDetectorRef, Directive, inject, Injector, Input, OnDestroy, OnInit, ViewContainerRef } from '@angular/core';\nimport { UntypedFormArray, UntypedFormGroup } from '@angular/forms';\nimport { NgsFormItemController } from '../../../controllers';\nimport { INgsFormsFormControlAddRemove, NgsFormsFormControlAddRemoveFunctions } from '../../../misc';\nimport { NgsFormsComponentRegistryService } from '../../../services/form-component-registry/form-component-registry.service';\nimport { NgsFormsFormItem } from '../../../models';\n\n@Directive({\n selector: '[ngs-form-item]',\n //templateUrl: \"./form-item.component.html\",\n})\n\nexport class NgsFormsFormItemDirective implements OnInit, OnDestroy {\n @Input('ngs-form-item')\n itemData: NgsFormsFormItem<any> | undefined = undefined;\n\n @Input('ngs-form-group')\n formGroup?: UntypedFormGroup;\n\n @Input('ngs-form-array')\n formArray?: UntypedFormArray;\n\n @Input('ngs-form-index')\n index?: number;\n\n controller: NgsFormItemController | undefined;\n\n private readonly viewContainerRef = inject(ViewContainerRef);\n private readonly injector = inject(Injector);\n private readonly changeDetectorRef = inject(ChangeDetectorRef);\n\n private readonly formComponentRegistryService = inject(NgsFormsComponentRegistryService);\n\n ngOnInit(): void {\n if (!this.itemData) {\n return console.error('Form item without form data');\n }\n let addRemoveFn: INgsFormsFormControlAddRemove | undefined = undefined;\n if (this.formArray) {\n addRemoveFn = NgsFormsFormControlAddRemoveFunctions.formArray(this.formArray);\n }\n if (this.formGroup) {\n addRemoveFn = NgsFormsFormControlAddRemoveFunctions.formGroup(this.formGroup);\n }\n this.controller = new NgsFormItemController(\n this.injector,\n this.viewContainerRef,\n this.itemData,\n addRemoveFn,\n this.index,\n this.changeDetectorRef\n );\n }\n\n ngOnDestroy() {\n this.controller?.destroy();\n }\n}\n","import { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { NgsFormsService } from '../../../services/forms/forms.service';\nimport { NgsFormsInternalService } from '../../../services/internal/internal-forms.service';\nimport { NgsFormsFormItemDirective } from '../form-item/form-item.component';\n\n@Component({\n selector: 'ngs-form',\n templateUrl: './form.component.html',\n providers: [NgsFormsInternalService],\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormComponent {\n private readonly ngsInternalFormsService = inject(NgsFormsInternalService);\n readonly ngsFormsService = inject(NgsFormsService);\n\n readonly formGroup = toSignal(this.ngsInternalFormsService.formGroup$);\n readonly formConfig = toSignal(this.ngsInternalFormsService.formConfig$);\n\n constructor() {\n this.ngsFormsService.setInternalService(this.ngsInternalFormsService);\n }\n}\n\n","@if (formConfig()?.root && formGroup()) {\n <ng-container [ngs-form-group]=\"formGroup()!\" [ngs-form-item]=\"formConfig()!.root\"></ng-container>\n}\n\n","import { NgsFormsBaseClassItemsContainerBase } from '../../../classes/form-component-base/form-component-items-container.class';\nimport { NgsFormsFormItem, NgsFormsFormItemContainerConfigBase } from '../../../models';\nimport { Component, ChangeDetectionStrategy } from '@angular/core';\n\nimport { v4 } from 'uuid';\nimport { NgsFormsFormItemDirective } from '../../core';\n\n@Component({\n selector: 'ngs-form-component-column',\n templateUrl: './form-column.component.html',\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsColumnComponent extends NgsFormsBaseClassItemsContainerBase<NgsFormsFormItemContainerConfigBase> {\n static override key = 'column';\n\n static create(config: NgsFormsFormItemContainerConfigBase): NgsFormsFormItem<NgsFormsFormItemContainerConfigBase> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsColumnComponent.key,\n config,\n };\n }\n}\n","@for (item of config.items; track item.uuid) {\n <ng-container [ngs-form-item]=\"item\"></ng-container>\n}\n","// eslint-disable-next-line @typescript-eslint/no-empty-interface\nimport { NgsFormsFormErrorKeyValueMap } from '../errors';\nimport { Observable } from 'rxjs';\nimport { ValidatorFn } from '@angular/forms';\nimport { NgsFormsFormInputOption } from './form-item-option.model';\nimport { NgsFormsFormItem } from '../form-config';\n\nexport interface NgsFormsFormItemConfigBase {\n uuid?: string;\n visible?: boolean;\n visible$?: Observable<boolean>;\n initialState?: any;\n}\n\nexport interface NgsFormsFormItemContainerConfigBase extends NgsFormsFormItemConfigBase {\n items: Array<NgsFormsFormItem<any>>\n}\n\nexport interface NgsFormsFormGroupConfig extends NgsFormsFormItemConfigBaseItemWithNameAndValidators, NgsFormsFormItemContainerConfigBase {}\n\nexport interface NgsFormsFormItemConfigBaseItemWithNameAndValidators extends NgsFormsFormItemConfigBase{\n name: string;\n errorMessageMap?: NgsFormsFormErrorKeyValueMap;\n disabled?: boolean;\n disabled$?: Observable<boolean>;\n validators?: Array<ValidatorFn>;\n validators$? :Observable<Array<ValidatorFn>>;\n}\n\n// ---\n\nexport interface NgsFormsFormItemConfigBaseInput extends NgsFormsFormItemConfigBaseItemWithNameAndValidators {\n id?: string;\n label: string;\n value?: unknown;\n}\n\n// ---\n\nexport interface NgsFormsFormItemConfigBaseTextInput extends NgsFormsFormItemConfigBaseInput {\n placeholder?: string;\n type?: 'text' | 'email' | 'password'\n}\n\n\nexport interface NgsFormsFormItemConfigBaseInputWithOptions extends NgsFormsFormItemConfigBaseInput {\n options?: Array<NgsFormsFormInputOption>;\n options$?: Observable<Array<NgsFormsFormInputOption>>;\n}\n// --\n","import { Component, Injector, ChangeDetectionStrategy } from '@angular/core';\nimport { NgsFormItemRowConfig } from './form-row-config.model';\nimport { NgsFormsFormItem } from '../../../models';\nimport { v4 } from 'uuid';\nimport { NgsFormsFormItemDirective, NgsFormsBaseClassFormComponent } from '../../../internal';\n\n@Component({\n selector: 'ngs-forms-row-component',\n templateUrl: './form-row.component.html',\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\n\nexport class NgsFormsRowComponent extends NgsFormsBaseClassFormComponent<NgsFormItemRowConfig> {\n static override key = 'form-row';\n constructor(\n ) {\n super();\n }\n getIndividualRowDivClass(index: number) {\n if (this.config.columnClass) {\n return this.config.columnClass;\n }\n if (!this.config.columnClasses?.length) {\n return '';\n }\n return this.config.columnClasses[index];\n }\n static create(config: NgsFormItemRowConfig): NgsFormsFormItem<NgsFormItemRowConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsRowComponent.key,\n config: config,\n };\n }\n}\n","<div class=\"{{config.containerClass}}\">\n @for(item of config.items; track item; let i = $index){\n <div class=\"{{getIndividualRowDivClass(i)}}\">\n <ng-container [ngs-form-item]=\"item\"></ng-container>\n </div>\n }\n</div>\n","import { Component, ChangeDetectionStrategy, inject, Injector, OnInit, ViewContainerRef } from '@angular/core';\nimport {\n UntypedFormControl,\n UntypedFormGroup,\n} from '@angular/forms';\nimport { v4 } from 'uuid';\n\nimport { NgsFormsFormItem, NgsFormsFormGroupConfig } from '../../../models';\nimport { NgsFormsFormItemWithVisibleAndValidatorsBase } from '../../../classes/form-component-base/form-component-item-with-visible-and-validators-base.class';\n\nimport { NgsFormsFormItemDirective } from '../../core';\n\n\n@Component({\n selector: 'ngs-forms-form-group',\n templateUrl: './form-group.component.html',\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormGroupComponent\n extends NgsFormsFormItemWithVisibleAndValidatorsBase<NgsFormsFormGroupConfig>\n implements OnInit\n{\n static override key = 'form-group';\n\n static create(\n config: NgsFormsFormGroupConfig\n ): NgsFormsFormItem<NgsFormsFormGroupConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsFormGroupComponent.key,\n config,\n };\n }\n\n get formGroupControl(): UntypedFormGroup {\n return this.control as unknown as UntypedFormGroup;\n }\n\n constructor() {\n super();\n this.control = new UntypedFormGroup({}) as unknown as UntypedFormControl;\n }\n}\n\n","@if (config.items) {\n @for (item of config.items; track item.uuid) {\n <ng-container [ngs-form-item]=\"item\" [ngs-form-group]=\"formGroupControl\"></ng-container>\n }\n}\n","import { inject, Injectable, OnDestroy } from '@angular/core';\nimport { UntypedFormArray, UntypedFormGroup } from '@angular/forms';\nimport { NgsFormItemArrayConfig } from '../container';\nimport { NGS_FORMS_ITEM_DATA } from '../../../../misc';\nimport { NgsFormsFormItem } from '../../../../models/index';\nimport { Subject } from 'rxjs';\n\n@Injectable()\nexport class NgsFormsFormArrayInternalService implements OnDestroy {\n config = inject<NgsFormsFormItem<NgsFormItemArrayConfig>>(NGS_FORMS_ITEM_DATA).config;\n\n readonly formArray = new UntypedFormArray([]);\n readonly itemsChanged = new Subject<void>();\n\n constructor() {\n if (this.config.initialItemCount) {\n for (let i = 0; i < this.config.initialItemCount; i++) {\n this.addItem();\n }\n }\n }\n\n ngOnDestroy() {\n }\n\n removeAt(index: number) {\n if (this.config?.minItems && this.formArray.controls.length <= this.config!.minItems!) {\n return;\n }\n if (!this.formArray.controls.length) {\n return;\n }\n this.formArray.removeAt(index);\n this.itemsChanged.next();\n }\n addItem() {\n if (this.config?.maxItems && this.formArray.controls.length >= this.config!.maxItems) {\n return;\n }\n this.formArray.push(new UntypedFormGroup({}));\n this.itemsChanged.next();\n }\n}\n","import { Component, inject, ChangeDetectionStrategy } from '@angular/core';\nimport { NgsFormsBaseClassFormComponent } from '../../../../classes/form-component-base/form-component.class';\nimport { NgsFormsFormItem } from '../../../../models';\nimport { NgsFormItemArrayAddItemConfig } from './form-array-add-item-config.model';\nimport { NgsFormsFormArrayInternalService } from '../service/form-array-internal.service';\nimport { v4 } from 'uuid';\n\n@Component({\n selector: 'ngs-forms-form-array-add-item',\n templateUrl: './form-array-add-item.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormArrayAddItemComponent extends NgsFormsBaseClassFormComponent<NgsFormItemArrayAddItemConfig> {\n static override key = 'form-array-add-item';\n internalArrayService = inject(NgsFormsFormArrayInternalService);\n\n static create(config: NgsFormItemArrayAddItemConfig): NgsFormsFormItem<NgsFormItemArrayAddItemConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsFormArrayAddItemComponent.key,\n config: config,\n };\n }\n\n addItem() {\n this.internalArrayService.addItem();\n }\n}\n","<button\n (click)=\"addItem()\"\n [class]=\"config.buttonClass || 'btn btn-outline-primary'\"\n type=\"button\">\n @if (config.buttonIcon) {\n <i [class]=\"config.buttonIcon\" aria-hidden=\"true\"></i>\n }\n {{ config.buttonText || 'Add Item' }}\n</button>\n","import { Component, ChangeDetectionStrategy } from '@angular/core';\nimport { UntypedFormControl } from '@angular/forms';\nimport { NgsFormsFormItem } from '../../../../models';\nimport { NgsFormsFormItemDirective } from '../../../core/index';\nimport { NgsFormItemArrayConfig } from './form-array-config.model';\nimport { NgsFormsFormItemWithVisibleAndValidatorsBase } from '../../../../classes/form-component-base/form-component-item-with-visible-and-validators-base.class';\nimport { NgsFormsFormArrayInternalService } from '../service/form-array-internal.service';\nimport { v4 } from 'uuid';\n\n@Component({\n selector: 'ngs-forms-form-array',\n imports: [NgsFormsFormItemDirective],\n templateUrl: './form-array.component.html',\n providers: [NgsFormsFormArrayInternalService],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormArrayContainerComponent extends NgsFormsFormItemWithVisibleAndValidatorsBase<NgsFormItemArrayConfig> {\n static override key = 'form-array';\n\n constructor(private formArrayService: NgsFormsFormArrayInternalService) {\n super();\n this.control = this.formArrayService.formArray as unknown as UntypedFormControl;\n }\n\n static create(\n config: NgsFormItemArrayConfig\n ): NgsFormsFormItem<NgsFormItemArrayConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsFormArrayContainerComponent.key,\n config: config,\n };\n }\n}\n","<div [class]=\"config.containerClass || ''\">\n @for (item of config.items; track item.uuid) {\n <ng-container [ngs-form-item]=\"item\"></ng-container>\n }\n</div>\n","import { Component, inject, ChangeDetectionStrategy, ChangeDetectorRef, OnInit } from '@angular/core';\nimport { NgsFormsFormArrayInternalService } from '../service';\nimport { AbstractControl, FormArray, UntypedFormGroup } from '@angular/forms';\n\nimport { v4 } from 'uuid';\nimport { NgsFormsFormArrayListConfig } from './form-array-list.config';\nimport { NgsFormsFormItemDirective, NgsFormsBaseClassFormComponent, NgsFormsFormItem } from '../../../../internal';\n\n@Component({\n selector: 'ngs-forms-form-array-list',\n templateUrl: './form-array-list.component.html',\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormArrayListComponent extends NgsFormsBaseClassFormComponent<NgsFormsFormArrayListConfig> implements OnInit {\n static override key = 'form-array-list';\n public internalArrayService = inject<NgsFormsFormArrayInternalService>(\n NgsFormsFormArrayInternalService\n );\n public myFormArray: FormArray<any> = this.internalArrayService.formArray;\n private changeDetectorRef = inject(ChangeDetectorRef);\n\n ngOnInit() {\n this.subscribe(this.internalArrayService.itemsChanged, () => {\n this.changeDetectorRef.markForCheck();\n });\n }\n\n static create(\n config: NgsFormsFormArrayListConfig\n ): NgsFormsFormItem<NgsFormsFormArrayListConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsFormArrayListComponent.key,\n config: config,\n };\n }\n\n castToFormGroup(control: AbstractControl): UntypedFormGroup {\n return control as UntypedFormGroup;\n }\n}\n","@for (formGroup of myFormArray.controls; track formGroup; let i = $index) {\n <div [attr.data-index]=\"$index\" [class]=\"config.containerClass || ''\">\n <ng-container [ngs-form-group]=\"castToFormGroup(formGroup)\" [ngs-form-index]=\"i\"\n [ngs-form-item]=\"config.templateItem\"></ng-container>\n </div>\n}\n","import { Component, inject, ChangeDetectionStrategy, ElementRef } from '@angular/core';\nimport { NgsFormsBaseClassFormComponent } from '../../../../classes/form-component-base/form-component.class';\nimport { NgsFormsFormItem } from '../../../../models';\nimport { NgsFormItemArrayRemoveItemConfig } from './form-array-remove-item-config.model';\nimport { NgsFormsFormArrayInternalService } from '../service';\nimport { NGS_FORMS_ITEM_INDEX } from '../../../../misc';\nimport { v4 } from 'uuid';\n\n@Component({\n selector: 'ngs-forms-form-array-remove-item',\n templateUrl: './form-array-remove-item.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormArrayRemoveItemComponent extends NgsFormsBaseClassFormComponent<NgsFormItemArrayRemoveItemConfig> {\n static override key = 'form-array-remove-item';\n internalArrayService = inject(NgsFormsFormArrayInternalService);\n private elementRef = inject(ElementRef);\n private indexFromDi = inject<number>(NGS_FORMS_ITEM_INDEX, { optional: true });\n\n get myIndex(): number {\n if (this.indexFromDi !== null && this.indexFromDi !== undefined) {\n return this.indexFromDi;\n }\n const el = this.elementRef.nativeElement as HTMLElement;\n const container = el.closest('[data-index]');\n if (container) {\n const idxAttr = container.getAttribute('data-index');\n if (idxAttr !== null) {\n return parseInt(idxAttr, 10);\n }\n }\n return 0;\n }\n\n constructor() {\n super();\n }\n\n static create(config: NgsFormItemArrayRemoveItemConfig): NgsFormsFormItem<NgsFormItemArrayRemoveItemConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsFormArrayRemoveItemComponent.key,\n config,\n };\n }\n\n removeItem() {\n this.internalArrayService.removeAt(this.myIndex);\n }\n}\n","<button\n (click)=\"removeItem()\"\n [class]=\"config.buttonClass || 'btn btn-outline-danger btn-sm'\"\n type=\"button\">\n @if (config.buttonIcon) {\n <i [class]=\"config.buttonIcon\" aria-hidden=\"true\"></i>\n }\n {{ config.buttonText || 'Remove' }}\n index:{{ myIndex }}\n</button>\n","import { Component, ChangeDetectionStrategy } from '@angular/core';\nimport { NgsFormsBaseClassFormComponent } from '../../../classes/form-component-base/form-component.class';\nimport { NgsFormsTextDivConfig } from './text-div-config.model';\nimport { NgsFormsFormItem } from '../../../models';\nimport { v4 } from 'uuid';\n\n@Component({\n selector: 'ngs-form-component-text-div',\n imports: [],\n templateUrl: './text-div.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsTextDivComponent extends NgsFormsBaseClassFormComponent<NgsFormsTextDivConfig> {\n static override key = 'text-div';\n\n static create(\n config: NgsFormsTextDivConfig\n ): NgsFormsFormItem<NgsFormsTextDivConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsTextDivComponent.key,\n config: config,\n };\n }\n static title(\n title: string,\n divClass = 'h2'\n ): NgsFormsFormItem<NgsFormsTextDivConfig> {\n return NgsFormsTextDivComponent.create({\n text: title,\n classes: divClass,\n });\n }\n}\n","<div class=\"{{config.classes\">{{ config.text }}</div>\n","import { Component, ChangeDetectionStrategy, inject, Sanitizer, SecurityContext } from '@angular/core';\nimport { NgsFormsBaseClassFormComponent } from '../../../classes/form-component-base/form-component.class';\nimport { NgsFormItemHtmlContentConfig } from './html-content-config.model';\nimport { NgsFormsFormItem } from '../../../models';\nimport { v4 } from 'uuid';\n\n@Component({\n selector: 'ngs-form-component-html-content',\n imports: [],\n templateUrl: './html-content.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsHtmlContentComponent extends NgsFormsBaseClassFormComponent<NgsFormItemHtmlContentConfig> {\n static override key = 'content-html';\n contentConfig = this.config as NgsFormItemHtmlContentConfig;\n html: string;\n\n constructor() {\n super();\n const sanitizer = inject(Sanitizer);\n this.html =\n sanitizer.sanitize(SecurityContext.HTML, this.contentConfig.html) ||\n '';\n }\n\n static create(\n config: NgsFormItemHtmlContentConfig\n ): NgsFormsFormItem<NgsFormItemHtmlContentConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsHtmlContentComponent.key,\n config,\n };\n }\n}\n","<div [innerHTML]=\"html\"></div>\n","import { NgsFormsFormItemContainerConfigBase } from '../../../models/index';\n\nexport interface NgsFormsFormSectionConfig extends NgsFormsFormItemContainerConfigBase {\n title: string;\n titleClass?: string;\n subtitle?: string;\n subtitleClass?: string;\n}\n\nexport const sectionConfigDefaults: Partial<NgsFormsFormSectionConfig> = {\n titleClass: 'h3',\n subtitleClass: 'lead',\n};\n","import { NgsFormsBaseClassItemsContainerBase } from '../../../classes/form-component-base/form-component-items-container.class';\nimport { NgsFormsFormSectionConfig, sectionConfigDefaults } from './section-config.interface';\nimport { Component, ChangeDetectionStrategy, OnInit } from '@angular/core';\nimport { ngsDefaults } from '../../../misc/defaults';\nimport { v4 } from 'uuid';\nimport { NgsFormsFormItemDirective } from '../../core';\nimport { NgsFormsFormItem } from '../../../models';\n\n@Component({\n selector: 'ngs-forms-form-section',\n templateUrl: './section.component.html',\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormSectionComponent extends NgsFormsBaseClassItemsContainerBase<NgsFormsFormSectionConfig> implements OnInit {\n static override key = 'section';\n\n static create(config: NgsFormsFormSectionConfig): NgsFormsFormItem<NgsFormsFormSectionConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsFormSectionComponent.key,\n config: config,\n };\n }\n\n ngOnInit() {\n this.config = ngsDefaults(this.config, sectionConfigDefaults);\n }\n}\n","<div class=\"form-section\">\n <div class=\"form-section-title {{config.titleClass}}\">{{ config.title }}</div>\n @if (config.subtitle) {\n <div class=\"form-section-subtitle {{config.subtitleClass}}\">{{ config.subtitle }}</div>\n }\n @if (config.items.length) {\n <div class=\"form-section-items\">\n @for (item of config.items; track item.uuid) {\n <ng-container [ngs-form-item]=\"item\"></ng-container>\n }\n </div>\n }\n</div>\n","import { NgModule } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { CommonModule } from '@angular/common';\nimport { NgsFormsColumnComponent } from './components/shared-form-components/column';\nimport { NgsFormsComponentRegistryService } from './services/form-component-registry/form-component-registry.service';\nimport { NgsFormsFormArrayAddItemComponent } from './components/shared-form-components/form-array/add-item';\nimport { NgsFormsFormArrayContainerComponent } from './components/shared-form-components/form-array/container';\nimport { NgsFormsFormArrayListComponent } from './components/shared-form-components/form-array/list';\nimport { NgsFormsFormArrayRemoveItemComponent } from './components/shared-form-components/form-array/remove-item';\nimport { NgsFormsFormSectionComponent } from './components/shared-form-components/section/section.component';\nimport { NgsFormsRowComponent } from './components/shared-form-components/row';\nimport { NgsFormsTextDivComponent } from './components/shared-form-components/text-div';\nimport { NgsFormsFormGroupComponent } from './components/shared-form-components/form-group';\n\n\n@NgModule({\n imports: [CommonModule, FormsModule, ReactiveFormsModule],\n})\nexport class NgsFormsCoreModule {\n static registerCoreNgsFormComponents(\n registryService: NgsFormsComponentRegistryService\n ) {\n registryService.register(NgsFormsFormGroupComponent.key, NgsFormsFormGroupComponent);\n registryService.register(NgsFormsRowComponent.key, NgsFormsRowComponent);\n registryService.register(\n NgsFormsColumnComponent.key,\n NgsFormsColumnComponent\n );\n registryService.register(\n NgsFormsFormArrayContainerComponent.key,\n NgsFormsFormArrayContainerComponent\n );\n registryService.register(\n NgsFormsFormArrayAddItemComponent.key,\n NgsFormsFormArrayAddItemComponent\n );\n registryService.register(\n NgsFormsFormArrayRemoveItemComponent.key,\n NgsFormsFormArrayRemoveItemComponent\n );\n registryService.register(\n NgsFormsFormArrayListComponent.key,\n NgsFormsFormArrayListComponent\n );\n registryService.register(\n NgsFormsTextDivComponent.key,\n NgsFormsTextDivComponent\n );\n //registryService.register('content-html', NgsFormsHtmlContentComponent);\n registryService.register(\n NgsFormsFormSectionComponent.key,\n NgsFormsFormSectionComponent\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["uuidv4","i1.NgsFormsFormArrayInternalService"],"mappings":";;;;;;;;MAIsB,aAAa,CAAA;AACd,IAAA,QAAQ,GAAG,IAAI,OAAO,EAAQ;IAEvC,aAAa,GAAmB,EAAE;IAE5C,SAAS,CAAI,WAA0B,EAAE,YAAgC,EAAA;AACvE,QAAA,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC;IACpE;IAEA,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE;AACpB,QAAA,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE;AACxB,QAAA,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,UAAU,KAAK,UAAU,CAAC,WAAW,EAAE,CAAC;IACtE;wGAboB,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAAb,aAAa,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,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,IAAA,EAAA,kBAAkB,EAAA,OAAA,EAAA,CAFnB,YAAY,EAAE,WAAW,EAAE,mBAAmB,CAAA,EAAA,CAAA;;4FAE7C,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAH9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,mBAAmB,CAAC;AAC1D,iBAAA;;;ACjBD;;AAEG;;;;"}
|
package/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as rxjs from 'rxjs';
|
|
2
2
|
import { Subject, Subscription, Observable, BehaviorSubject } from 'rxjs';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { OnInit, OnDestroy, Signal, Type, InjectionToken, Injector, ViewContainerRef } from '@angular/core';
|
|
4
|
+
import { OnInit, OnDestroy, Signal, Type, InjectionToken, Injector, ViewContainerRef, ChangeDetectorRef } from '@angular/core';
|
|
5
5
|
import * as i2 from '@angular/forms';
|
|
6
6
|
import { ValidatorFn, UntypedFormControl, FormGroup, AbstractControl, UntypedFormGroup, UntypedFormArray, FormArray } from '@angular/forms';
|
|
7
7
|
import * as _ng_simplicity_forms_core from '@ng-simplicity/forms-core';
|
|
@@ -31,15 +31,20 @@ type NgsFormsFormErrorKeyValueMap = {
|
|
|
31
31
|
interface NgsFormsFormInputOption {
|
|
32
32
|
id: string;
|
|
33
33
|
label: string;
|
|
34
|
-
disabled
|
|
34
|
+
disabled?: boolean;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
interface NgsFormsFormItemConfigBase {
|
|
38
38
|
uuid?: string;
|
|
39
|
+
visible?: boolean;
|
|
40
|
+
visible$?: Observable<boolean>;
|
|
41
|
+
initialState?: any;
|
|
39
42
|
}
|
|
40
43
|
interface NgsFormsFormItemContainerConfigBase extends NgsFormsFormItemConfigBase {
|
|
41
44
|
items: Array<NgsFormsFormItem<any>>;
|
|
42
45
|
}
|
|
46
|
+
interface NgsFormsFormGroupConfig extends NgsFormsFormItemConfigBaseItemWithNameAndValidators, NgsFormsFormItemContainerConfigBase {
|
|
47
|
+
}
|
|
43
48
|
interface NgsFormsFormItemConfigBaseItemWithNameAndValidators extends NgsFormsFormItemConfigBase {
|
|
44
49
|
name: string;
|
|
45
50
|
errorMessageMap?: NgsFormsFormErrorKeyValueMap;
|
|
@@ -66,10 +71,6 @@ interface NgsFormsFormItem<T extends NgsFormsFormItemConfigBase> {
|
|
|
66
71
|
uuid?: string;
|
|
67
72
|
type: string;
|
|
68
73
|
config: T;
|
|
69
|
-
visible?: boolean;
|
|
70
|
-
visible$?: Observable<boolean>;
|
|
71
|
-
items?: NgsFormsFormItem<any>[];
|
|
72
|
-
initialState?: any;
|
|
73
74
|
}
|
|
74
75
|
|
|
75
76
|
interface NgsFormsCommonComponentState {
|
|
@@ -102,8 +103,10 @@ declare class NgsFormsFormItemWithVisibleAndValidatorsBase<T extends NgsFormsFor
|
|
|
102
103
|
errorMessage: string;
|
|
103
104
|
private formAddRemoveFns;
|
|
104
105
|
private privateService;
|
|
106
|
+
private changeDetectorRef;
|
|
105
107
|
readonly submitted: Signal<boolean>;
|
|
106
108
|
ngOnInit(): void;
|
|
109
|
+
private updateErrorMessage;
|
|
107
110
|
ngOnDestroy(): void;
|
|
108
111
|
private bindValidators;
|
|
109
112
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgsFormsFormItemWithVisibleAndValidatorsBase<any>, never>;
|
|
@@ -131,7 +134,7 @@ declare class NgsFormsInternalService {
|
|
|
131
134
|
private mergeState;
|
|
132
135
|
updateGlobalState(state: NgsFormsGlobalFormState): void;
|
|
133
136
|
updateComponentState(componentKey: string, state: any): void;
|
|
134
|
-
subscribeToState(
|
|
137
|
+
subscribeToState(uuid: string, name?: string): rxjs.Observable<any>;
|
|
135
138
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgsFormsInternalService, never>;
|
|
136
139
|
static ɵprov: i0.ɵɵInjectableDeclaration<NgsFormsInternalService>;
|
|
137
140
|
}
|
|
@@ -224,10 +227,11 @@ declare class NgsFormItemController extends NgsSubscriber {
|
|
|
224
227
|
private readonly itemData;
|
|
225
228
|
private readonly addRemoveControlFn?;
|
|
226
229
|
private readonly index?;
|
|
230
|
+
private readonly changeDetectorRef?;
|
|
227
231
|
private componentRef;
|
|
228
232
|
private parentVisibility;
|
|
229
233
|
private lastVisible;
|
|
230
|
-
constructor(injector: Injector, viewContainerRef: ViewContainerRef, itemData: NgsFormsFormItem<any>, addRemoveControlFn?: INgsFormsFormControlAddRemove | undefined, index?: number | undefined);
|
|
234
|
+
constructor(injector: Injector, viewContainerRef: ViewContainerRef, itemData: NgsFormsFormItem<any>, addRemoveControlFn?: INgsFormsFormControlAddRemove | undefined, index?: number | undefined, changeDetectorRef?: ChangeDetectorRef | undefined);
|
|
231
235
|
destroy(): void;
|
|
232
236
|
private bindVisibility;
|
|
233
237
|
private create;
|
|
@@ -242,6 +246,7 @@ declare class NgsFormsFormItemDirective implements OnInit, OnDestroy {
|
|
|
242
246
|
controller: NgsFormItemController | undefined;
|
|
243
247
|
private readonly viewContainerRef;
|
|
244
248
|
private readonly injector;
|
|
249
|
+
private readonly changeDetectorRef;
|
|
245
250
|
private readonly formComponentRegistryService;
|
|
246
251
|
ngOnInit(): void;
|
|
247
252
|
ngOnDestroy(): void;
|
|
@@ -272,9 +277,9 @@ declare class NgsFormsRowComponent extends NgsFormsBaseClassFormComponent<NgsFor
|
|
|
272
277
|
static ɵcmp: i0.ɵɵComponentDeclaration<NgsFormsRowComponent, "ngs-forms-row-component", never, {}, {}, never, never, true, never>;
|
|
273
278
|
}
|
|
274
279
|
|
|
275
|
-
declare class NgsFormsFormGroupComponent extends NgsFormsFormItemWithVisibleAndValidatorsBase<
|
|
280
|
+
declare class NgsFormsFormGroupComponent extends NgsFormsFormItemWithVisibleAndValidatorsBase<NgsFormsFormGroupConfig> implements OnInit {
|
|
276
281
|
static key: string;
|
|
277
|
-
static create(config:
|
|
282
|
+
static create(config: NgsFormsFormGroupConfig): NgsFormsFormItem<NgsFormsFormGroupConfig>;
|
|
278
283
|
get formGroupControl(): UntypedFormGroup;
|
|
279
284
|
constructor();
|
|
280
285
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgsFormsFormGroupComponent, never>;
|
|
@@ -298,7 +303,9 @@ interface NgsFormItemArrayConfig extends NgsFormsFormItemConfigBaseItemWithNameA
|
|
|
298
303
|
}
|
|
299
304
|
|
|
300
305
|
declare class NgsFormsFormArrayContainerComponent extends NgsFormsFormItemWithVisibleAndValidatorsBase<NgsFormItemArrayConfig> {
|
|
306
|
+
private formArrayService;
|
|
301
307
|
static key: string;
|
|
308
|
+
constructor(formArrayService: NgsFormsFormArrayInternalService);
|
|
302
309
|
static create(config: NgsFormItemArrayConfig): NgsFormsFormItem<NgsFormItemArrayConfig>;
|
|
303
310
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgsFormsFormArrayContainerComponent, never>;
|
|
304
311
|
static ɵcmp: i0.ɵɵComponentDeclaration<NgsFormsFormArrayContainerComponent, "ngs-forms-form-array", never, {}, {}, never, never, true, never>;
|
|
@@ -307,7 +314,7 @@ declare class NgsFormsFormArrayContainerComponent extends NgsFormsFormItemWithVi
|
|
|
307
314
|
declare class NgsFormsFormArrayInternalService implements OnDestroy {
|
|
308
315
|
config: NgsFormItemArrayConfig;
|
|
309
316
|
readonly formArray: UntypedFormArray;
|
|
310
|
-
|
|
317
|
+
readonly itemsChanged: Subject<void>;
|
|
311
318
|
constructor();
|
|
312
319
|
ngOnDestroy(): void;
|
|
313
320
|
removeAt(index: number): void;
|
|
@@ -330,10 +337,12 @@ interface NgsFormsFormArrayListConfig extends NgsFormsFormItemConfigBase {
|
|
|
330
337
|
containerClass?: string;
|
|
331
338
|
}
|
|
332
339
|
|
|
333
|
-
declare class NgsFormsFormArrayListComponent extends NgsFormsBaseClassFormComponent<NgsFormsFormArrayListConfig> {
|
|
340
|
+
declare class NgsFormsFormArrayListComponent extends NgsFormsBaseClassFormComponent<NgsFormsFormArrayListConfig> implements OnInit {
|
|
334
341
|
static key: string;
|
|
335
342
|
internalArrayService: NgsFormsFormArrayInternalService;
|
|
336
343
|
myFormArray: FormArray<any>;
|
|
344
|
+
private changeDetectorRef;
|
|
345
|
+
ngOnInit(): void;
|
|
337
346
|
static create(config: NgsFormsFormArrayListConfig): NgsFormsFormItem<NgsFormsFormArrayListConfig>;
|
|
338
347
|
castToFormGroup(control: AbstractControl): UntypedFormGroup;
|
|
339
348
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgsFormsFormArrayListComponent, never>;
|
|
@@ -350,7 +359,9 @@ interface NgsFormItemArrayRemoveItemConfig extends NgsFormsFormItemConfigBase {
|
|
|
350
359
|
declare class NgsFormsFormArrayRemoveItemComponent extends NgsFormsBaseClassFormComponent<NgsFormItemArrayRemoveItemConfig> {
|
|
351
360
|
static key: string;
|
|
352
361
|
internalArrayService: NgsFormsFormArrayInternalService;
|
|
353
|
-
|
|
362
|
+
private elementRef;
|
|
363
|
+
private indexFromDi;
|
|
364
|
+
get myIndex(): number;
|
|
354
365
|
constructor();
|
|
355
366
|
static create(config: NgsFormItemArrayRemoveItemConfig): NgsFormsFormItem<NgsFormItemArrayRemoveItemConfig>;
|
|
356
367
|
removeItem(): void;
|
|
@@ -409,4 +420,4 @@ declare class NgsFormsCoreModule {
|
|
|
409
420
|
}
|
|
410
421
|
|
|
411
422
|
export { NGS_FORMS_CONTROL_ADD_REMOVE_FN, NGS_FORMS_ITEM_DATA, NGS_FORMS_ITEM_INDEX, NgsFormComponent, NgsFormsBaseClassFormComponent, NgsFormsBaseClassFormInputComponent, NgsFormsBaseClassFormItemInputWithOptionsComponent, NgsFormsBaseClassItemsContainerBase, NgsFormsColumnComponent, NgsFormsComponentRegistryService, NgsFormsCoreModule, NgsFormsFormArrayAddItemComponent, NgsFormsFormArrayContainerComponent, NgsFormsFormArrayInternalService, NgsFormsFormArrayListComponent, NgsFormsFormArrayRemoveItemComponent, NgsFormsFormControlAddRemoveFunctions, NgsFormsFormGroupComponent, NgsFormsFormItemDirective, NgsFormsFormItemWithVisibleAndValidatorsBase, NgsFormsFormSectionComponent, NgsFormsHtmlContentComponent, NgsFormsInternalService, NgsFormsRowComponent, NgsFormsService, NgsFormsTextDivComponent, NgsSubscriber, ngsDefaults };
|
|
412
|
-
export type { INgsFormsFormControlAddRemove, NgsFormDisableFn, NgsFormItemArrayAddItemConfig, NgsFormItemArrayConfig, NgsFormItemArrayRemoveItemConfig, NgsFormItemHtmlContentConfig, NgsFormItemRowConfig, NgsFormItemVisibilityFn, NgsFormValidatorArrayBuilderFn, NgsFormsFormArrayListConfig, NgsFormsFormConfig, NgsFormsFormErrorKeyValueMap, NgsFormsFormInputOption, NgsFormsFormItem, NgsFormsFormItemConfigBase, NgsFormsFormItemConfigBaseInput, NgsFormsFormItemConfigBaseInputWithOptions, NgsFormsFormItemConfigBaseItemWithNameAndValidators, NgsFormsFormItemConfigBaseTextInput, NgsFormsFormItemContainerConfigBase, NgsFormsFunctionParameters, NgsServerSideValidationErrorObjectType };
|
|
423
|
+
export type { INgsFormsFormControlAddRemove, NgsFormDisableFn, NgsFormItemArrayAddItemConfig, NgsFormItemArrayConfig, NgsFormItemArrayRemoveItemConfig, NgsFormItemHtmlContentConfig, NgsFormItemRowConfig, NgsFormItemVisibilityFn, NgsFormValidatorArrayBuilderFn, NgsFormsFormArrayListConfig, NgsFormsFormConfig, NgsFormsFormErrorKeyValueMap, NgsFormsFormGroupConfig, NgsFormsFormInputOption, NgsFormsFormItem, NgsFormsFormItemConfigBase, NgsFormsFormItemConfigBaseInput, NgsFormsFormItemConfigBaseInputWithOptions, NgsFormsFormItemConfigBaseItemWithNameAndValidators, NgsFormsFormItemConfigBaseTextInput, NgsFormsFormItemContainerConfigBase, NgsFormsFunctionParameters, NgsServerSideValidationErrorObjectType };
|