@stemy/ngx-dynamic-form 19.5.8 → 19.5.10
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/fesm2022/stemy-ngx-dynamic-form.mjs +132 -112
- package/fesm2022/stemy-ngx-dynamic-form.mjs.map +1 -1
- package/ngx-dynamic-form/common-types.d.ts +2 -2
- package/ngx-dynamic-form/components/dynamic-form/dynamic-form.component.d.ts +2 -2
- package/ngx-dynamic-form/directives/async-submit.directive.d.ts +1 -1
- package/ngx-dynamic-form/utils/misc.d.ts +7 -1
- package/package.json +1 -1
- package/public_api.d.ts +2 -2
|
@@ -231,6 +231,16 @@ function controlValues(control, timeout = 500) {
|
|
|
231
231
|
const changes$ = control.valueChanges.pipe(debounceTime(timeout));
|
|
232
232
|
return merge(initial$, changes$);
|
|
233
233
|
}
|
|
234
|
+
/**
|
|
235
|
+
* Creates a new observable that always starts with the controls current status.
|
|
236
|
+
* @param control AbstractControl to retrieve status changes from
|
|
237
|
+
* @param timeout Additional timeout
|
|
238
|
+
*/
|
|
239
|
+
function controlStatus(control, timeout = 10) {
|
|
240
|
+
const initial$ = of(control.status); // Emit immediately
|
|
241
|
+
const changes$ = control.statusChanges.pipe(debounceTime(timeout));
|
|
242
|
+
return merge(initial$, changes$);
|
|
243
|
+
}
|
|
234
244
|
function getFieldByPath(field, path) {
|
|
235
245
|
if (field.path === path) {
|
|
236
246
|
return field;
|
|
@@ -319,13 +329,17 @@ function additionalFieldValue(field, path) {
|
|
|
319
329
|
}
|
|
320
330
|
function additionalFieldValues(field, values) {
|
|
321
331
|
const additional = field.props?.additional || {};
|
|
322
|
-
setFieldProp(field, "additional", additional);
|
|
332
|
+
setFieldProp(field, "additional", ObjectUtils.assign(additional, values || {}));
|
|
323
333
|
}
|
|
324
334
|
const MIN_INPUT_NUM = -1999999999;
|
|
325
335
|
const MAX_INPUT_NUM = 1999999999;
|
|
326
336
|
const EDITOR_FORMATS = ["php", "json", "html", "css", "scss"];
|
|
327
337
|
|
|
328
338
|
class ConfigForSchemaWrap {
|
|
339
|
+
opts;
|
|
340
|
+
mode;
|
|
341
|
+
injector;
|
|
342
|
+
schema;
|
|
329
343
|
get labelPrefix() {
|
|
330
344
|
return this.opts.labelPrefix;
|
|
331
345
|
}
|
|
@@ -338,6 +352,7 @@ class ConfigForSchemaWrap {
|
|
|
338
352
|
get context() {
|
|
339
353
|
return this.opts.context;
|
|
340
354
|
}
|
|
355
|
+
fieldCustomizer;
|
|
341
356
|
constructor(opts, mode, injector, schema) {
|
|
342
357
|
this.opts = opts;
|
|
343
358
|
this.mode = mode;
|
|
@@ -444,6 +459,11 @@ function getFormValidationErrors(controls, parentPath = "") {
|
|
|
444
459
|
}
|
|
445
460
|
|
|
446
461
|
class DynamicFormBuilderService {
|
|
462
|
+
injector;
|
|
463
|
+
events;
|
|
464
|
+
api;
|
|
465
|
+
languages;
|
|
466
|
+
language;
|
|
447
467
|
constructor(injector, events, api, languages) {
|
|
448
468
|
this.injector = injector;
|
|
449
469
|
this.events = events;
|
|
@@ -730,7 +750,6 @@ class DynamicFormBuilderService {
|
|
|
730
750
|
modelOptions: {
|
|
731
751
|
updateOn: "change"
|
|
732
752
|
},
|
|
733
|
-
fieldGroupClassName: "field-container",
|
|
734
753
|
hooks: {},
|
|
735
754
|
expressions: {
|
|
736
755
|
serializer: () => data.serializer,
|
|
@@ -803,8 +822,8 @@ class DynamicFormBuilderService {
|
|
|
803
822
|
}
|
|
804
823
|
});
|
|
805
824
|
}
|
|
806
|
-
static
|
|
807
|
-
static
|
|
825
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicFormBuilderService, deps: [{ token: i0.Injector }, { token: i2.EventsService }, { token: API_SERVICE }, { token: LANGUAGE_SERVICE }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
826
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicFormBuilderService });
|
|
808
827
|
}
|
|
809
828
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicFormBuilderService, decorators: [{
|
|
810
829
|
type: Injectable
|
|
@@ -817,6 +836,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
817
836
|
}] }] });
|
|
818
837
|
|
|
819
838
|
class DynamicFormSchemaService {
|
|
839
|
+
openApi;
|
|
840
|
+
injector;
|
|
841
|
+
builder;
|
|
820
842
|
get api() {
|
|
821
843
|
return this.openApi.api;
|
|
822
844
|
}
|
|
@@ -1169,14 +1191,18 @@ class DynamicFormSchemaService {
|
|
|
1169
1191
|
validators.itemsMaxValue = maxValueValidation(items.maximum, true);
|
|
1170
1192
|
}
|
|
1171
1193
|
}
|
|
1172
|
-
static
|
|
1173
|
-
static
|
|
1194
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicFormSchemaService, deps: [{ token: i2.OpenApiService }, { token: i0.Injector }, { token: DynamicFormBuilderService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1195
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicFormSchemaService });
|
|
1174
1196
|
}
|
|
1175
1197
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicFormSchemaService, decorators: [{
|
|
1176
1198
|
type: Injectable
|
|
1177
1199
|
}], ctorParameters: () => [{ type: i2.OpenApiService }, { type: i0.Injector }, { type: DynamicFormBuilderService }] });
|
|
1178
1200
|
|
|
1179
1201
|
class DynamicFormService {
|
|
1202
|
+
fs;
|
|
1203
|
+
fb;
|
|
1204
|
+
injector;
|
|
1205
|
+
api;
|
|
1180
1206
|
constructor(fs, fb, injector, api) {
|
|
1181
1207
|
this.fs = fs;
|
|
1182
1208
|
this.fb = fb;
|
|
@@ -1308,8 +1334,8 @@ class DynamicFormService {
|
|
|
1308
1334
|
}
|
|
1309
1335
|
});
|
|
1310
1336
|
}
|
|
1311
|
-
static
|
|
1312
|
-
static
|
|
1337
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicFormService, deps: [{ token: DynamicFormSchemaService }, { token: DynamicFormBuilderService }, { token: i0.Injector }, { token: API_SERVICE }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1338
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicFormService });
|
|
1313
1339
|
}
|
|
1314
1340
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicFormService, decorators: [{
|
|
1315
1341
|
type: Injectable
|
|
@@ -1319,6 +1345,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
1319
1345
|
}] }] });
|
|
1320
1346
|
|
|
1321
1347
|
class AsyncSubmitDirective {
|
|
1348
|
+
method = input(null, { alias: "async-submit" });
|
|
1349
|
+
mode = input("click");
|
|
1350
|
+
form = input();
|
|
1351
|
+
context = input();
|
|
1352
|
+
onSuccess = output();
|
|
1353
|
+
onError = output();
|
|
1354
|
+
toaster = inject(TOASTER_SERVICE);
|
|
1355
|
+
renderer = inject(Renderer2);
|
|
1356
|
+
elem = inject(ElementRef);
|
|
1357
|
+
status = computed(() => {
|
|
1358
|
+
const form = this.form();
|
|
1359
|
+
return form?.status() || null;
|
|
1360
|
+
});
|
|
1361
|
+
group = computed(() => {
|
|
1362
|
+
const form = this.form();
|
|
1363
|
+
return form?.group() || null;
|
|
1364
|
+
});
|
|
1365
|
+
loading = signal(false);
|
|
1366
|
+
callback = signal(null);
|
|
1322
1367
|
get isDisabled() {
|
|
1323
1368
|
return this.status() !== "VALID";
|
|
1324
1369
|
}
|
|
@@ -1326,25 +1371,6 @@ class AsyncSubmitDirective {
|
|
|
1326
1371
|
return this.loading();
|
|
1327
1372
|
}
|
|
1328
1373
|
constructor() {
|
|
1329
|
-
this.method = input(null, { alias: "async-submit" });
|
|
1330
|
-
this.mode = input("click");
|
|
1331
|
-
this.form = input();
|
|
1332
|
-
this.context = input();
|
|
1333
|
-
this.onSuccess = output();
|
|
1334
|
-
this.onError = output();
|
|
1335
|
-
this.toaster = inject(TOASTER_SERVICE);
|
|
1336
|
-
this.renderer = inject(Renderer2);
|
|
1337
|
-
this.elem = inject(ElementRef);
|
|
1338
|
-
this.status = computed(() => {
|
|
1339
|
-
const form = this.form();
|
|
1340
|
-
return form?.status() || null;
|
|
1341
|
-
});
|
|
1342
|
-
this.group = computed(() => {
|
|
1343
|
-
const form = this.form();
|
|
1344
|
-
return form?.group() || null;
|
|
1345
|
-
});
|
|
1346
|
-
this.loading = signal(false);
|
|
1347
|
-
this.callback = signal(null);
|
|
1348
1374
|
if (this.elem.nativeElement.tagName === "BUTTON") {
|
|
1349
1375
|
this.renderer.setAttribute(this.elem.nativeElement, "type", "button");
|
|
1350
1376
|
}
|
|
@@ -1399,8 +1425,8 @@ class AsyncSubmitDirective {
|
|
|
1399
1425
|
this.toaster.error(reason.message, reason.context);
|
|
1400
1426
|
});
|
|
1401
1427
|
}
|
|
1402
|
-
static
|
|
1403
|
-
static
|
|
1428
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AsyncSubmitDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1429
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.14", type: AsyncSubmitDirective, isStandalone: false, selector: "[async-submit]", inputs: { method: { classPropertyName: "method", publicName: "async-submit", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onSuccess: "onSuccess", onError: "onError" }, host: { listeners: { "click": "click()" }, properties: { "class.disabled": "this.isDisabled", "class.loading": "this.isLoading" } }, exportAs: ["async-submit"], ngImport: i0 });
|
|
1404
1430
|
}
|
|
1405
1431
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AsyncSubmitDirective, decorators: [{
|
|
1406
1432
|
type: Directive,
|
|
@@ -1421,12 +1447,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
1421
1447
|
}] } });
|
|
1422
1448
|
|
|
1423
1449
|
class DynamicFieldType extends FieldType {
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
this._errorState = false;
|
|
1428
|
-
this._focused = false;
|
|
1429
|
-
}
|
|
1450
|
+
stateChanges = new Subject();
|
|
1451
|
+
_errorState = false;
|
|
1452
|
+
_focused = false;
|
|
1430
1453
|
ngOnDestroy() {
|
|
1431
1454
|
delete this.formField?._control;
|
|
1432
1455
|
this.stateChanges.complete();
|
|
@@ -1513,8 +1536,8 @@ class DynamicFieldType extends FieldType {
|
|
|
1513
1536
|
};
|
|
1514
1537
|
}
|
|
1515
1538
|
}
|
|
1516
|
-
static
|
|
1517
|
-
static
|
|
1539
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicFieldType, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1540
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DynamicFieldType, isStandalone: false, selector: "dynamic-field-type", usesInheritance: true, ngImport: i0, template: "", isInline: true });
|
|
1518
1541
|
}
|
|
1519
1542
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicFieldType, decorators: [{
|
|
1520
1543
|
type: Component,
|
|
@@ -1526,58 +1549,58 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
1526
1549
|
}] });
|
|
1527
1550
|
|
|
1528
1551
|
class DynamicFormComponent {
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
testId: this.testId(),
|
|
1551
|
-
};
|
|
1552
|
-
const fields = this.fields() || this.builder.resolveFormFields(this.data()?.constructor, null, options);
|
|
1553
|
-
return [
|
|
1554
|
-
this.builder.createFormGroup(null, () => fields, {
|
|
1555
|
-
label: "",
|
|
1556
|
-
useTabs: this.useTabs(),
|
|
1557
|
-
hidden: false,
|
|
1558
|
-
additional: {
|
|
1559
|
-
className: "dynamic-form-root-group"
|
|
1560
|
-
}
|
|
1561
|
-
}, null, options)
|
|
1562
|
-
];
|
|
1563
|
-
});
|
|
1564
|
-
this.group = computed(() => {
|
|
1565
|
-
this.config();
|
|
1566
|
-
return new FormGroup$1({});
|
|
1567
|
-
});
|
|
1568
|
-
this.status$ = rxResource({
|
|
1569
|
-
request: () => this.group(),
|
|
1570
|
-
loader: p => p.request.statusChanges,
|
|
1571
|
-
defaultValue: "PENDING"
|
|
1572
|
-
});
|
|
1573
|
-
this.status = computed(() => this.status$.value());
|
|
1574
|
-
this.onSubmit = output();
|
|
1575
|
-
this.options = {
|
|
1576
|
-
fieldChanges: this.fieldChanges,
|
|
1577
|
-
formState: {
|
|
1578
|
-
injector: inject(Injector)
|
|
1579
|
-
}
|
|
1552
|
+
builder = inject(DynamicFormBuilderService);
|
|
1553
|
+
events = inject(EventsService);
|
|
1554
|
+
languages = inject(LANGUAGE_SERVICE);
|
|
1555
|
+
labelPrefix = input("label");
|
|
1556
|
+
labelCustomizer = input(null);
|
|
1557
|
+
testId = input("");
|
|
1558
|
+
useTabs = input(false);
|
|
1559
|
+
data = input({});
|
|
1560
|
+
fields = input(null);
|
|
1561
|
+
fieldChanges = new Subject();
|
|
1562
|
+
language = toSignal(this.events.languageChanged, {
|
|
1563
|
+
initialValue: this.languages.currentLanguage
|
|
1564
|
+
});
|
|
1565
|
+
enableTranslations = toSignal(this.events.translationsEnabled, {
|
|
1566
|
+
initialValue: this.languages.enableTranslations
|
|
1567
|
+
});
|
|
1568
|
+
config = computed(() => {
|
|
1569
|
+
const options = {
|
|
1570
|
+
labelPrefix: this.labelPrefix(),
|
|
1571
|
+
labelCustomizer: this.labelCustomizer(),
|
|
1572
|
+
testId: this.testId(),
|
|
1580
1573
|
};
|
|
1574
|
+
const fields = this.fields() || this.builder.resolveFormFields(this.data()?.constructor, null, options);
|
|
1575
|
+
return [
|
|
1576
|
+
this.builder.createFormGroup(null, () => fields, {
|
|
1577
|
+
label: "",
|
|
1578
|
+
useTabs: this.useTabs(),
|
|
1579
|
+
hidden: false,
|
|
1580
|
+
additional: {
|
|
1581
|
+
className: "dynamic-form-root-group"
|
|
1582
|
+
}
|
|
1583
|
+
}, null, options)
|
|
1584
|
+
];
|
|
1585
|
+
});
|
|
1586
|
+
group = computed(() => {
|
|
1587
|
+
this.config();
|
|
1588
|
+
return new FormGroup$1({});
|
|
1589
|
+
});
|
|
1590
|
+
status$ = rxResource({
|
|
1591
|
+
request: () => this.group(),
|
|
1592
|
+
loader: p => controlStatus(p.request),
|
|
1593
|
+
defaultValue: "PENDING"
|
|
1594
|
+
});
|
|
1595
|
+
status = computed(() => this.status$.value());
|
|
1596
|
+
onSubmit = output();
|
|
1597
|
+
options = {
|
|
1598
|
+
fieldChanges: this.fieldChanges,
|
|
1599
|
+
formState: {
|
|
1600
|
+
injector: inject(Injector)
|
|
1601
|
+
}
|
|
1602
|
+
};
|
|
1603
|
+
constructor() {
|
|
1581
1604
|
effect(() => {
|
|
1582
1605
|
this.language();
|
|
1583
1606
|
this.enableTranslations();
|
|
@@ -1594,8 +1617,8 @@ class DynamicFormComponent {
|
|
|
1594
1617
|
reset() {
|
|
1595
1618
|
this.options?.resetModel?.();
|
|
1596
1619
|
}
|
|
1597
|
-
static
|
|
1598
|
-
static
|
|
1620
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1621
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: DynamicFormComponent, isStandalone: false, selector: "dynamic-form", inputs: { labelPrefix: { classPropertyName: "labelPrefix", publicName: "labelPrefix", isSignal: true, isRequired: false, transformFunction: null }, labelCustomizer: { classPropertyName: "labelCustomizer", publicName: "labelCustomizer", isSignal: true, isRequired: false, transformFunction: null }, testId: { classPropertyName: "testId", publicName: "testId", isSignal: true, isRequired: false, transformFunction: null }, useTabs: { classPropertyName: "useTabs", publicName: "useTabs", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, fields: { classPropertyName: "fields", publicName: "fields", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onSubmit: "onSubmit" }, ngImport: i0, template: "@if (config() && group()) {\n <form [formGroup]=\"group()\" (ngSubmit)=\"submit()\" autocomplete=\"off\" role=\"presentation\">\n <input type=\"submit\" [hidden]=\"true\" />\n <formly-form [model]=\"data()\"\n [fields]=\"config()\"\n [form]=\"group()\"\n [options]=\"options\"></formly-form>\n <ng-content></ng-content>\n </form>\n}\n", styles: [".dynamic-form-field.dynamic-form-hidden{display:none}\n"], dependencies: [{ kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i3.LegacyFormlyForm, selector: "formly-form" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1599
1622
|
}
|
|
1600
1623
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicFormComponent, decorators: [{
|
|
1601
1624
|
type: Component,
|
|
@@ -1603,10 +1626,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
1603
1626
|
}], ctorParameters: () => [] });
|
|
1604
1627
|
|
|
1605
1628
|
class DynamicFormArrayComponent extends FieldArrayType {
|
|
1606
|
-
|
|
1607
|
-
super(...arguments);
|
|
1608
|
-
this.currentTab = signal(0);
|
|
1609
|
-
}
|
|
1629
|
+
currentTab = signal(0);
|
|
1610
1630
|
clearItems() {
|
|
1611
1631
|
const control = this.formControl;
|
|
1612
1632
|
while (control.length > 0) {
|
|
@@ -1624,8 +1644,8 @@ class DynamicFormArrayComponent extends FieldArrayType {
|
|
|
1624
1644
|
const length = this.field.fieldGroup.length;
|
|
1625
1645
|
this.currentTab.set(Math.min(this.currentTab(), length - 1));
|
|
1626
1646
|
}
|
|
1627
|
-
static
|
|
1628
|
-
static
|
|
1647
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicFormArrayComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1648
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: DynamicFormArrayComponent, isStandalone: false, selector: "dynamic-form-array", usesInheritance: true, ngImport: i0, template: "@if (field.display) {\n @if (props.label && props.hideLabel !== true) {\n <label class=\"field-label\">\n {{ props.label | translate }}\n <p class=\"field-description\" *ngIf=\"props.description\">{{ props.description | translate }}</p>\n </label>\n }\n <div class=\"field-container\">\n <tabs class=\"form-array-items\" [(value)]=\"currentTab\">\n @for (itemField of field.fieldGroup; track itemField.key; let ix = $index) {\n <ng-template #fieldContent>\n <div class=\"form-array-buttons\">\n @if (itemField.removeItem) {\n <btn icon=\"trash\" (click)=\"removeItem(ix)\"></btn>\n }\n @if (itemField.insertItem) {\n <btn icon=\"plus\" (click)=\"addItem(ix)\"></btn>\n }\n </div>\n <formly-field [field]=\"itemField\"></formly-field>\n </ng-template>\n @if (props.useTabs) {\n <div class=\"form-array-item\"\n [tabsItem]=\"ix\"\n [label]=\"(itemField.formControl.value | getValue : props.tabsLabel) || ix + 1\">\n <ng-container [ngTemplateOutlet]=\"fieldContent\"></ng-container>\n </div>\n } @else {\n <div class=\"form-array-item\">\n <ng-container [ngTemplateOutlet]=\"fieldContent\"></ng-container>\n </div>\n }\n }\n </tabs>\n\n <div class=\"form-array-buttons\">\n @if (props.clearItems) {\n <btn icon=\"trash\" label=\"button.clear-items\" (click)=\"clearItems()\"></btn>\n }\n @if (props.addItem) {\n <btn icon=\"plus\" label=\"button.insert-item\" (click)=\"addItem()\"></btn>\n }\n </div>\n </div>\n}\n", styles: [".form-array-item.hidden-tab{display:none}.form-array-buttons{display:flex;gap:5px;margin-bottom:5px}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.TabsItemDirective, selector: "[tabsItem]", inputs: ["tabsItem", "label", "tooltip", "icon", "disabled", "classes"] }, { kind: "component", type: i2.BtnComponent, selector: "btn", inputs: ["label", "tooltip", "icon", "disabled", "type", "size"] }, { kind: "component", type: i2.TabsComponent, selector: "tabs", inputs: ["value", "options", "type", "size"], outputs: ["valueChange"] }, { kind: "component", type: i3.LegacyFormlyField, selector: "formly-field" }, { kind: "pipe", type: i2.GetValuePipe, name: "getValue" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
|
|
1629
1649
|
}
|
|
1630
1650
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicFormArrayComponent, decorators: [{
|
|
1631
1651
|
type: Component,
|
|
@@ -1633,8 +1653,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
1633
1653
|
}] });
|
|
1634
1654
|
|
|
1635
1655
|
class DynamicFormChipsComponent extends DynamicFieldType {
|
|
1636
|
-
static
|
|
1637
|
-
static
|
|
1656
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicFormChipsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1657
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DynamicFormChipsComponent, isStandalone: false, selector: "dynamic-form-chips", usesInheritance: true, ngImport: i0, template: "<chips [formControl]=\"formControl\"\n [type]=\"props.type\"\n [step]=\"props.step\"\n [minLength]=\"props.minLength\"\n [maxLength]=\"props.maxLength\"\n [min]=\"props.min\"\n [max]=\"props.max\"\n [multiple]=\"props.multiple\"\n [formlyAttributes]=\"field\">\n</chips>\n", dependencies: [{ kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i2.ChipsComponent, selector: "chips", inputs: ["value", "multiple", "disabled", "type", "min", "max", "minLength", "maxLength", "step", "placeholder", "unique", "options"], outputs: ["valueChange"] }, { kind: "directive", type: i3.LegacyFormlyAttributes, selector: "[formlyAttributes]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1638
1658
|
}
|
|
1639
1659
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicFormChipsComponent, decorators: [{
|
|
1640
1660
|
type: Component,
|
|
@@ -1642,8 +1662,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
1642
1662
|
}] });
|
|
1643
1663
|
|
|
1644
1664
|
class DynamicFormFieldComponent extends FieldWrapper {
|
|
1645
|
-
static
|
|
1646
|
-
static
|
|
1665
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicFormFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1666
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: DynamicFormFieldComponent, isStandalone: false, selector: "dynamic-form-field", usesInheritance: true, ngImport: i0, template: "@if (props.label && props.hideLabel !== true) {\n <label class=\"field-label\" [for]=\"id\">\n {{ props.label | translate }}\n <p class=\"field-description\" *ngIf=\"props.description\">{{ props.description | translate }}</p>\n @if (props.required && props.hideRequiredMarker !== true) {\n <span class=\"field-required\" aria-hidden=\"true\">*</span>\n }\n </label>\n}\n<div class=\"field-container\">\n <ng-container #fieldComponent></ng-container>\n <div *ngIf=\"showError\" class=\"field-errors invalid-feedback\">\n <formly-validation-message\n [field]=\"field\"\n id=\"{{ id }}-formly-validation-error\"\n role=\"alert\"\n ></formly-validation-message>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.LegacyFormlyValidationMessage, selector: "formly-validation-message" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
|
|
1647
1667
|
}
|
|
1648
1668
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicFormFieldComponent, decorators: [{
|
|
1649
1669
|
type: Component,
|
|
@@ -1651,8 +1671,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
1651
1671
|
}] });
|
|
1652
1672
|
|
|
1653
1673
|
class DynamicFormFieldsetComponent extends FieldWrapper {
|
|
1654
|
-
static
|
|
1655
|
-
static
|
|
1674
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicFormFieldsetComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1675
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: DynamicFormFieldsetComponent, isStandalone: false, selector: "dynamic-form-fieldset", usesInheritance: true, ngImport: i0, template: "@if (field.display) {\n <legend class=\"field-legend\" *ngIf=\"props.label && !field.parent.props.useTabs\">\n {{ props.label | translate }}\n </legend>\n <div class=\"field-container\">\n @for (itemField of field.fieldGroup; track itemField) {\n @if (itemField.display) {\n <formly-field [field]=\"itemField\"></formly-field>\n }\n }\n </div>\n}\n", dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.LegacyFormlyField, selector: "formly-field" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
|
|
1656
1676
|
}
|
|
1657
1677
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicFormFieldsetComponent, decorators: [{
|
|
1658
1678
|
type: Component,
|
|
@@ -1660,8 +1680,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
1660
1680
|
}] });
|
|
1661
1681
|
|
|
1662
1682
|
class DynamicFormGroupComponent extends FieldWrapper {
|
|
1663
|
-
static
|
|
1664
|
-
static
|
|
1683
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicFormGroupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1684
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: DynamicFormGroupComponent, isStandalone: false, selector: "dynamic-form-group", usesInheritance: true, ngImport: i0, template: "@if (field.display) {\n @if (props.label && props.hideLabel !== true) {\n <label class=\"field-label\">\n {{ props.label | translate }}\n <p class=\"field-description\" *ngIf=\"props.description\">{{ props.description | translate }}</p>\n </label>\n }\n <tabs class=\"field-container\">\n @for (itemField of field.fieldGroup; track itemField; let ix = $index) {\n @if (itemField.display) {\n @if (props.useTabs && itemField.wrappers | includes: 'form-fieldset') {\n <div class=\"form-fieldset-item\"\n [tabsItem]=\"ix\"\n [classes]=\"['form-fieldset-tab', itemField.valid ? 'valid' : 'invalid']\"\n [label]=\"itemField.props.label\">\n <formly-field [field]=\"itemField\"></formly-field>\n </div>\n } @else {\n <formly-field [field]=\"itemField\"></formly-field>\n }\n }\n }\n </tabs>\n}\n", styles: [".form-fieldset-item.hidden-tab{display:none}.form-fieldset-tab{position:relative;--invalid-bg: rgba(184, 38, 38, 1);--invalid-border: rgba(184, 38, 38, .6);--invalid-color: #ececec;--invalid-box-size: 15px;--invalid-box-pull: -3px}.form-fieldset-tab.invalid>btn .async-target{border:1px solid var(--invalid-border)}.form-fieldset-tab.invalid:after{background:var(--invalid-bg);color:var(--invalid-color);font-size:10px;line-height:var(--invalid-box-size);width:var(--invalid-box-size);height:var(--invalid-box-size);text-align:center;border-radius:5px;content:\"!\";display:block;position:absolute;top:var(--invalid-box-pull);right:var(--invalid-box-pull)}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.TabsItemDirective, selector: "[tabsItem]", inputs: ["tabsItem", "label", "tooltip", "icon", "disabled", "classes"] }, { kind: "component", type: i2.TabsComponent, selector: "tabs", inputs: ["value", "options", "type", "size"], outputs: ["valueChange"] }, { kind: "component", type: i3.LegacyFormlyField, selector: "formly-field" }, { kind: "pipe", type: i2.IncludesPipe, name: "includes" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
|
|
1665
1685
|
}
|
|
1666
1686
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicFormGroupComponent, decorators: [{
|
|
1667
1687
|
type: Component,
|
|
@@ -1669,8 +1689,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
1669
1689
|
}] });
|
|
1670
1690
|
|
|
1671
1691
|
class DynamicFormUploadComponent extends DynamicFieldType {
|
|
1672
|
-
static
|
|
1673
|
-
static
|
|
1692
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicFormUploadComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1693
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DynamicFormUploadComponent, isStandalone: false, selector: "dynamic-form-upload", usesInheritance: true, ngImport: i0, template: "<upload [formControl]=\"formControl\"\n [multiple]=\"props.multiple\"\n [inline]=\"props.inline\"\n [accept]=\"props.accept\"\n [baseUrl]=\"props.url\"\n [makeUpload]=\"props.createUploadData\"\n [formlyAttributes]=\"field\">\n</upload>\n", dependencies: [{ kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i2.UploadComponent, selector: "upload", inputs: ["value", "disabled", "inline", "accept", "baseUrl", "message", "multiple", "buttonText", "makeUpload", "preProcess"], outputs: ["onUploaded", "onRemove"] }, { kind: "directive", type: i3.LegacyFormlyAttributes, selector: "[formlyAttributes]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1674
1694
|
}
|
|
1675
1695
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicFormUploadComponent, decorators: [{
|
|
1676
1696
|
type: Component,
|
|
@@ -1730,16 +1750,16 @@ class NgxDynamicFormModule {
|
|
|
1730
1750
|
static provideForms(config) {
|
|
1731
1751
|
return makeEnvironmentProviders(NgxDynamicFormModule.getProviders(config));
|
|
1732
1752
|
}
|
|
1733
|
-
static
|
|
1734
|
-
static
|
|
1753
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgxDynamicFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1754
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: NgxDynamicFormModule, declarations: [DynamicFieldType, DynamicFormComponent, DynamicFormArrayComponent, DynamicFormChipsComponent, DynamicFormFieldComponent, DynamicFormFieldsetComponent, DynamicFormGroupComponent, DynamicFormUploadComponent, AsyncSubmitDirective], imports: [CommonModule,
|
|
1735
1755
|
FormsModule,
|
|
1736
1756
|
ReactiveFormsModule,
|
|
1737
1757
|
NgxUtilsModule,
|
|
1738
1758
|
FormlyModule], exports: [DynamicFieldType, DynamicFormComponent, DynamicFormArrayComponent, DynamicFormChipsComponent, DynamicFormFieldComponent, DynamicFormFieldsetComponent, DynamicFormGroupComponent, DynamicFormUploadComponent, AsyncSubmitDirective, FormsModule,
|
|
1739
1759
|
ReactiveFormsModule,
|
|
1740
1760
|
NgxUtilsModule,
|
|
1741
|
-
FormlyModule] });
|
|
1742
|
-
static
|
|
1761
|
+
FormlyModule] });
|
|
1762
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgxDynamicFormModule, providers: [
|
|
1743
1763
|
...pipes
|
|
1744
1764
|
], imports: [CommonModule,
|
|
1745
1765
|
FormsModule,
|
|
@@ -1748,7 +1768,7 @@ class NgxDynamicFormModule {
|
|
|
1748
1768
|
FormlyModule, FormsModule,
|
|
1749
1769
|
ReactiveFormsModule,
|
|
1750
1770
|
NgxUtilsModule,
|
|
1751
|
-
FormlyModule] });
|
|
1771
|
+
FormlyModule] });
|
|
1752
1772
|
}
|
|
1753
1773
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgxDynamicFormModule, decorators: [{
|
|
1754
1774
|
type: NgModule,
|
|
@@ -1784,5 +1804,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
1784
1804
|
* Generated bundle index. Do not edit.
|
|
1785
1805
|
*/
|
|
1786
1806
|
|
|
1787
|
-
export { AsyncSubmitDirective, DynamicFieldType, DynamicFormArrayComponent, DynamicFormBuilderService, DynamicFormChipsComponent, DynamicFormComponent, DynamicFormFieldComponent, DynamicFormFieldsetComponent, DynamicFormGroupComponent, DynamicFormSchemaService, DynamicFormService, DynamicFormUploadComponent, EDITOR_FORMATS, FORM_ROOT_ID, FormFile, FormGroup, FormInput, FormModel, FormSelect, FormSerializable, FormUpload, MAX_INPUT_NUM, MIN_INPUT_NUM, NgxDynamicFormModule, addFieldValidators, additionalFieldValue, additionalFieldValues, clearFieldArray, controlValues, customizeFormField, emailValidation, getFieldByPath, getFieldsByKey, getFieldsByPredicate, getSelectOptions, insertToFieldArray, jsonValidation, maxLengthValidation, maxValueValidation, minLengthValidation, minValueValidation, phoneValidation, removeFieldValidators, removeFromFieldArray, replaceFieldArray, replaceSpecialChars, requiredValidation, setFieldDisabled, setFieldHidden, setFieldHooks, setFieldProp, translationValidation };
|
|
1807
|
+
export { AsyncSubmitDirective, DynamicFieldType, DynamicFormArrayComponent, DynamicFormBuilderService, DynamicFormChipsComponent, DynamicFormComponent, DynamicFormFieldComponent, DynamicFormFieldsetComponent, DynamicFormGroupComponent, DynamicFormSchemaService, DynamicFormService, DynamicFormUploadComponent, EDITOR_FORMATS, FORM_ROOT_ID, FormFile, FormGroup, FormInput, FormModel, FormSelect, FormSerializable, FormUpload, MAX_INPUT_NUM, MIN_INPUT_NUM, NgxDynamicFormModule, addFieldValidators, additionalFieldValue, additionalFieldValues, clearFieldArray, controlStatus, controlValues, customizeFormField, emailValidation, getFieldByPath, getFieldsByKey, getFieldsByPredicate, getSelectOptions, insertToFieldArray, jsonValidation, maxLengthValidation, maxValueValidation, minLengthValidation, minValueValidation, phoneValidation, removeFieldValidators, removeFromFieldArray, replaceFieldArray, replaceSpecialChars, requiredValidation, setFieldDisabled, setFieldHidden, setFieldHooks, setFieldProp, translationValidation };
|
|
1788
1808
|
//# sourceMappingURL=stemy-ngx-dynamic-form.mjs.map
|