@stemy/ngx-dynamic-form 19.9.33 → 19.9.35
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 +62 -72
- package/fesm2022/stemy-ngx-dynamic-form.mjs.map +1 -1
- package/ngx-dynamic-form/common-types.d.ts +15 -13
- package/ngx-dynamic-form/components/dynamic-form-date/dynamic-form-date.component.d.ts +6 -0
- package/ngx-dynamic-form/ngx-dynamic-form.module.d.ts +20 -19
- package/ngx-dynamic-form/services/dynamic-form-builder.service.d.ts +2 -1
- package/ngx-dynamic-form/services/dynamic-form-schema.service.d.ts +1 -1
- package/ngx-dynamic-form/utils/decorators.d.ts +2 -1
- package/ngx-dynamic-form/utils/misc.d.ts +0 -12
- package/package.json +2 -2
- package/public_api.d.ts +4 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { InjectionToken, inject, Inject, Injectable, untracked, input, Renderer2, ElementRef, computed, signal, effect, HostBinding, Directive, Input, Optional, Pipe, Type, Component, Injector, output, ChangeDetectionStrategy, ViewEncapsulation, viewChild, makeEnvironmentProviders, NgModule } from '@angular/core';
|
|
3
3
|
import * as i2 from '@stemy/ngx-utils';
|
|
4
|
-
import { cachedFactory, ReflectUtils, ObjectUtils, LANGUAGE_SERVICE, ForbiddenZone, SetUtils, ArrayUtils, API_SERVICE, StringUtils, AsyncMethodBase, EventsService, NgxUtilsModule } from '@stemy/ngx-utils';
|
|
4
|
+
import { cachedFactory, ReflectUtils, ObjectUtils, convertToDateFormat, LANGUAGE_SERVICE, convertToDate, ForbiddenZone, SetUtils, ArrayUtils, API_SERVICE, StringUtils, AsyncMethodBase, EventsService, NgxUtilsModule } from '@stemy/ngx-utils';
|
|
5
5
|
import { of, merge, Observable, firstValueFrom, BehaviorSubject, combineLatestWith, switchMap, distinctUntilChanged, first, Subject, map, filter } from 'rxjs';
|
|
6
6
|
import { debounceTime } from 'rxjs/operators';
|
|
7
7
|
import * as i1 from '@angular/forms';
|
|
@@ -77,6 +77,12 @@ function FormSelect(data) {
|
|
|
77
77
|
defineFormControl(target, key, (fb, path, options) => fb.createFormSelect(key, data, path, options));
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
|
+
function FormDate(data) {
|
|
81
|
+
data = data || {};
|
|
82
|
+
return (target, key) => {
|
|
83
|
+
defineFormControl(target, key, (fb, path, options) => fb.createFormDate(key, data, path, options));
|
|
84
|
+
};
|
|
85
|
+
}
|
|
80
86
|
function FormUpload(data) {
|
|
81
87
|
data = data || {};
|
|
82
88
|
return (target, key) => {
|
|
@@ -140,31 +146,6 @@ function controlStatus(control, timeout = 10) {
|
|
|
140
146
|
const changes$ = control.statusChanges.pipe(debounceTime(timeout));
|
|
141
147
|
return merge(initial$, changes$);
|
|
142
148
|
}
|
|
143
|
-
/**
|
|
144
|
-
* Convert value to a string with corrected date format (date, date-time)
|
|
145
|
-
* @param value Value to convert to date string
|
|
146
|
-
* @param format Expected date format (date, date-time)
|
|
147
|
-
*/
|
|
148
|
-
function convertToDateFormat(value, format) {
|
|
149
|
-
if (!ObjectUtils.isDefined(value) || !format?.includes("date"))
|
|
150
|
-
return value;
|
|
151
|
-
value = ObjectUtils.isDate(value) ? value : new Date(value);
|
|
152
|
-
const date = isNaN(value) ? new Date() : value;
|
|
153
|
-
const target = new Date(date.getTime() - date.getTimezoneOffset() * 60000).toISOString();
|
|
154
|
-
return format === "datetime-local" || format === "date-time"
|
|
155
|
-
? target.slice(0, 16)
|
|
156
|
-
: target.slice(0, 10);
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Convert value to date object with format (date, date-time)
|
|
160
|
-
* @param value Value to convert to date
|
|
161
|
-
* @param format Expected date format (date, date-time)
|
|
162
|
-
*/
|
|
163
|
-
function convertToDate(value, format) {
|
|
164
|
-
return (!ObjectUtils.isDefined(value) || !format?.includes("date"))
|
|
165
|
-
? value
|
|
166
|
-
: new Date(convertToDateFormat(value, format));
|
|
167
|
-
}
|
|
168
149
|
/**
|
|
169
150
|
* Convert potential number value to an actual number
|
|
170
151
|
* @param value Value to convert to number
|
|
@@ -311,7 +292,7 @@ function isFieldHidden(field) {
|
|
|
311
292
|
const MIN_INPUT_NUM = -1999999999;
|
|
312
293
|
const MAX_INPUT_NUM = 1999999999;
|
|
313
294
|
const EDITOR_TYPES = ["php", "json", "html", "css", "scss"];
|
|
314
|
-
const CUSTOM_INPUT_TYPES = ["checkbox", "textarea", "wysiwyg", "password"];
|
|
295
|
+
const CUSTOM_INPUT_TYPES = ["checkbox", "textarea", "wysiwyg", "date", "password"];
|
|
315
296
|
|
|
316
297
|
function validationMessage(errorKey) {
|
|
317
298
|
const key = `form.error.${errorKey}`;
|
|
@@ -826,16 +807,20 @@ class DynamicFormBuilderService {
|
|
|
826
807
|
style: data.style === "list" ? "list" : "table"
|
|
827
808
|
}, parent, options);
|
|
828
809
|
}
|
|
810
|
+
createFormDate(key, data, parent, options) {
|
|
811
|
+
data = data || {};
|
|
812
|
+
return this.createFormField(key, "date", data, {
|
|
813
|
+
min: convertToDateFormat(data.min),
|
|
814
|
+
max: convertToDateFormat(data.max),
|
|
815
|
+
disabledDays: Array.isArray(data.disabledDays)
|
|
816
|
+
? data.disabledDays.map(n => convertToNumber(n)) : [],
|
|
817
|
+
disabledDates: Array.isArray(data.disabledDates)
|
|
818
|
+
? data.disabledDates.map(n => convertToDate(n)) : [],
|
|
819
|
+
strict: data.strict !== false,
|
|
820
|
+
}, parent, options);
|
|
821
|
+
}
|
|
829
822
|
createFormUpload(key, data, parent, options) {
|
|
830
823
|
data = data || {};
|
|
831
|
-
if (data.asFile) {
|
|
832
|
-
data.inline = true;
|
|
833
|
-
console.warn(`File upload property "asFile" is deprecated. Use "inline" instead.`);
|
|
834
|
-
}
|
|
835
|
-
if (data.multi) {
|
|
836
|
-
data.multiple = true;
|
|
837
|
-
console.warn(`File upload property "multi" is deprecated. Use "multiple" instead.`);
|
|
838
|
-
}
|
|
839
824
|
const baseUrl = data.url?.startsWith("http") ? data.url : this.api.url(data.url || "assets");
|
|
840
825
|
return this.createFormField(key, "upload", data, {
|
|
841
826
|
inline: data.inline === true,
|
|
@@ -844,10 +829,7 @@ class DynamicFormBuilderService {
|
|
|
844
829
|
url: baseUrl,
|
|
845
830
|
uploadUrl: data.url?.startsWith("http")
|
|
846
831
|
? data.uploadUrl
|
|
847
|
-
: (data.uploadUrl ? this.api.url(data.uploadUrl || "assets") : baseUrl)
|
|
848
|
-
maxSize: isNaN(data.maxSize) ? MAX_INPUT_NUM : data.maxSize,
|
|
849
|
-
uploadOptions: data.uploadOptions || {},
|
|
850
|
-
createUploadData: data.createUploadData
|
|
832
|
+
: (data.uploadUrl ? this.api.url(data.uploadUrl || "assets") : baseUrl)
|
|
851
833
|
}, parent, options);
|
|
852
834
|
}
|
|
853
835
|
createFormGroup(key, fields, data, parent, options) {
|
|
@@ -1212,20 +1194,9 @@ class DynamicFormSchemaService {
|
|
|
1212
1194
|
return !field ? [] : options.customize(field, property, schema);
|
|
1213
1195
|
}
|
|
1214
1196
|
async getFormFieldForProp(property, options, parent) {
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
return this.getFormGroupConfig(property, options, parent);
|
|
1219
|
-
}
|
|
1220
|
-
// Then check the property type
|
|
1221
|
-
switch (property.type) {
|
|
1222
|
-
case "object":
|
|
1223
|
-
return this.getFormEditorConfig(property, options, parent);
|
|
1224
|
-
case "file":
|
|
1225
|
-
case "upload":
|
|
1226
|
-
return this.getFormUploadConfig(property, options, parent);
|
|
1227
|
-
case "boolean":
|
|
1228
|
-
return this.getFormCheckboxConfig(property, options, parent);
|
|
1197
|
+
if (property.type === "boolean") {
|
|
1198
|
+
// Handle boolean first
|
|
1199
|
+
return this.getFormCheckboxConfig(property, options, parent);
|
|
1229
1200
|
}
|
|
1230
1201
|
const $enum = property.items?.enum || property.enum;
|
|
1231
1202
|
if (Array.isArray($enum) || ObjectUtils.isStringWithValue(property.optionsPath) || ObjectUtils.isStringWithValue(property.endpoint)) {
|
|
@@ -1243,17 +1214,23 @@ class DynamicFormSchemaService {
|
|
|
1243
1214
|
return this.getFormTextareaConfig(property, options, parent);
|
|
1244
1215
|
}
|
|
1245
1216
|
if (property.format == "date" || property.format == "date-time") {
|
|
1246
|
-
return this.
|
|
1217
|
+
return this.getFormDateConfig(property, options, parent);
|
|
1218
|
+
}
|
|
1219
|
+
// First check property references, because a dynamic schema can be a type of object which we use for editor
|
|
1220
|
+
const refs = await this.openApi.getReferences(property, options.schema);
|
|
1221
|
+
if (refs.length > 0) {
|
|
1222
|
+
return this.getFormGroupConfig(property, options, parent);
|
|
1247
1223
|
}
|
|
1224
|
+
// Then check if it might be an editor property
|
|
1248
1225
|
if (this.checkIsEditorProperty(property)) {
|
|
1249
1226
|
return this.getFormEditorConfig(property, options, parent);
|
|
1250
1227
|
}
|
|
1251
1228
|
return this.getFormInputConfig(property, options, parent);
|
|
1252
1229
|
}
|
|
1253
1230
|
checkIsEditorProperty(property) {
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1231
|
+
return property.type === "object"
|
|
1232
|
+
|| EDITOR_TYPES.indexOf(property.format) >= 0
|
|
1233
|
+
|| property.format?.endsWith("script");
|
|
1257
1234
|
}
|
|
1258
1235
|
getFormFieldData(property, options) {
|
|
1259
1236
|
const validators = {};
|
|
@@ -1370,13 +1347,16 @@ class DynamicFormSchemaService {
|
|
|
1370
1347
|
type: property.format || "json"
|
|
1371
1348
|
}, parent, options);
|
|
1372
1349
|
}
|
|
1373
|
-
|
|
1374
|
-
const type = property.format == "date-time" ? "datetime-local" : "date";
|
|
1375
|
-
|
|
1350
|
+
getFormDateConfig(property, options, parent) {
|
|
1351
|
+
// const type = property.format == "date-time" ? "datetime-local" : "date";
|
|
1352
|
+
// TODO: Support date-time also
|
|
1353
|
+
return this.builder.createFormDate(property.id, {
|
|
1376
1354
|
...this.getFormFieldData(property, options),
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1355
|
+
min: convertToDate(property.minimum ?? property.min, property.format),
|
|
1356
|
+
max: convertToDate(property.maximum ?? property.max, property.format),
|
|
1357
|
+
disabledDays: property.disabledDays,
|
|
1358
|
+
disabledDates: property.disabledDates,
|
|
1359
|
+
strict: property.strict,
|
|
1380
1360
|
}, parent, options);
|
|
1381
1361
|
}
|
|
1382
1362
|
getFormSelectConfig($enum, property, options, parent) {
|
|
@@ -1398,8 +1378,7 @@ class DynamicFormSchemaService {
|
|
|
1398
1378
|
inline: property.inline,
|
|
1399
1379
|
accept: property.accept,
|
|
1400
1380
|
url: property.url,
|
|
1401
|
-
|
|
1402
|
-
uploadOptions: property.uploadOptions
|
|
1381
|
+
uploadUrl: property.uploadUrl,
|
|
1403
1382
|
}, parent, options);
|
|
1404
1383
|
}
|
|
1405
1384
|
getFormCheckboxConfig(property, options, parent) {
|
|
@@ -2234,6 +2213,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImpo
|
|
|
2234
2213
|
args: [{ standalone: false, selector: "dynamic-form-chips", encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, 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 [strict]=\"props.strict\"\n [options]=\"props.options | formlySelectOptions | async\"\n [testId]=\"field.testId\"\n [formlyAttributes]=\"field\">\n</chips>\n" }]
|
|
2235
2214
|
}] });
|
|
2236
2215
|
|
|
2216
|
+
class DynamicFormDateComponent extends DynamicFieldType {
|
|
2217
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: DynamicFormDateComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2218
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.22", type: DynamicFormDateComponent, isStandalone: false, selector: "dynamic-form-date", usesInheritance: true, ngImport: i0, template: "<date-picker [formControl]=\"formControl\"\n [min]=\"$any(props.min)\"\n [max]=\"$any(props.max)\"\n [disabledDays]=\"props.daysDisabled\"\n [disabledDates]=\"\"></date-picker>\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.DatePickerComponent, selector: "date-picker" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
2219
|
+
}
|
|
2220
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: DynamicFormDateComponent, decorators: [{
|
|
2221
|
+
type: Component,
|
|
2222
|
+
args: [{ standalone: false, selector: "dynamic-form-date", encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<date-picker [formControl]=\"formControl\"\n [min]=\"$any(props.min)\"\n [max]=\"$any(props.max)\"\n [disabledDays]=\"props.daysDisabled\"\n [disabledDates]=\"\"></date-picker>\n" }]
|
|
2223
|
+
}] });
|
|
2224
|
+
|
|
2237
2225
|
class DynamicFormEditorComponent extends DynamicFieldType {
|
|
2238
2226
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: DynamicFormEditorComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2239
2227
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.22", type: DynamicFormEditorComponent, isStandalone: false, selector: "dynamic-form-editor", usesInheritance: true, ngImport: i0, template: "<code-editor [lang]=\"props.type\"\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\">\n</code-editor>\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.CodeEditorComponent, selector: "code-editor", inputs: ["value", "lang", "disabled"], outputs: ["valueChange"] }, { kind: "directive", type: i3.LegacyFormlyAttributes, selector: "[formlyAttributes]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
@@ -2306,11 +2294,11 @@ class DynamicFormTranslationComponent extends DynamicFormArrayComponent {
|
|
|
2306
2294
|
this.currentTab.set(index);
|
|
2307
2295
|
}
|
|
2308
2296
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: DynamicFormTranslationComponent, deps: [{ token: i2.EventsService }, { token: LANGUAGE_SERVICE }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2309
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.22", type: DynamicFormTranslationComponent, isStandalone: false, selector: "dynamic-form-translation", 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 @if (props.markRequired) {\n <span class=\"field-required\" aria-hidden=\"true\">*</span>\n }\n </label>\n }\n <div class=\"field-container\">\n @for (itemField of field.fieldGroup; track itemField.key; let ix = $index) {\n @if (ix === currentTab()) {\n <formly-field [field]=\"itemField\"></formly-field>\n }\n }\n\n <div *ngIf=\"showError\" class=\"field-errors invalid-feedback\">\n <formly-validation-message\n [field]=\"field\"\n id=\"
|
|
2297
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.22", type: DynamicFormTranslationComponent, isStandalone: false, selector: "dynamic-form-translation", 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 @if (props.markRequired) {\n <span class=\"field-required\" aria-hidden=\"true\">*</span>\n }\n </label>\n }\n <div class=\"field-container\">\n @for (itemField of field.fieldGroup; track itemField.key; let ix = $index) {\n @if (ix === currentTab()) {\n <formly-field [field]=\"itemField\"></formly-field>\n }\n }\n\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}\n", styles: [".form-array-item.hidden-tab{display:none}.form-array-buttons{display:flex;gap:5px;margin-bottom:5px}.field-errors.invalid-feedback{display:block}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.LegacyFormlyField, selector: "formly-field" }, { kind: "component", type: i3.LegacyFormlyValidationMessage, selector: "formly-validation-message" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
2310
2298
|
}
|
|
2311
2299
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: DynamicFormTranslationComponent, decorators: [{
|
|
2312
2300
|
type: Component,
|
|
2313
|
-
args: [{ standalone: false, selector: "dynamic-form-translation", encapsulation: ViewEncapsulation.None, 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 @if (props.markRequired) {\n <span class=\"field-required\" aria-hidden=\"true\">*</span>\n }\n </label>\n }\n <div class=\"field-container\">\n @for (itemField of field.fieldGroup; track itemField.key; let ix = $index) {\n @if (ix === currentTab()) {\n <formly-field [field]=\"itemField\"></formly-field>\n }\n }\n\n <div *ngIf=\"showError\" class=\"field-errors invalid-feedback\">\n <formly-validation-message\n [field]=\"field\"\n id=\"
|
|
2301
|
+
args: [{ standalone: false, selector: "dynamic-form-translation", encapsulation: ViewEncapsulation.None, 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 @if (props.markRequired) {\n <span class=\"field-required\" aria-hidden=\"true\">*</span>\n }\n </label>\n }\n <div class=\"field-container\">\n @for (itemField of field.fieldGroup; track itemField.key; let ix = $index) {\n @if (ix === currentTab()) {\n <formly-field [field]=\"itemField\"></formly-field>\n }\n }\n\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}\n", styles: [".form-array-item.hidden-tab{display:none}.form-array-buttons{display:flex;gap:5px;margin-bottom:5px}.field-errors.invalid-feedback{display:block}\n"] }]
|
|
2314
2302
|
}], ctorParameters: () => [{ type: i2.EventsService }, { type: undefined, decorators: [{
|
|
2315
2303
|
type: Inject,
|
|
2316
2304
|
args: [LANGUAGE_SERVICE]
|
|
@@ -2369,11 +2357,11 @@ class DynamicFormGroupComponent extends FieldWrapper {
|
|
|
2369
2357
|
return this.field?.parent;
|
|
2370
2358
|
}
|
|
2371
2359
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: DynamicFormGroupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2372
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.22", type: DynamicFormGroupComponent, isStandalone: false, selector: "dynamic-form-group", usesInheritance: true, ngImport: i0, template: "<ng-template #innerLabelTemplate let-label=\"label\">\r\n <label class=\"field-label\" [for]=\"id\">\r\n <span [innerHTML]=\"label | safe: 'html'\"></span>\r\n @if (props.markRequired) {\r\n <span class=\"field-required\" aria-hidden=\"true\">*</span>\r\n }\r\n @if (props.description) {\r\n <p class=\"field-description\" [innerHTML]=\"props.description | translate | safe: 'html'\"></p>\r\n }\r\n </label>\r\n</ng-template>\r\n<ng-template #labelTemplate>\r\n @let label = !props.label || props.hideLabel || parent?.props?.useTabs ? null : props.label | translate;\r\n @if (label) {\r\n <ng-container [ngxTemplateOutlet]=\"(field | dynamicFormTemplate : 'label') || innerLabelTemplate\"\r\n [context]=\"field\"\r\n [additionalContext]=\"{label: label}\"></ng-container>\r\n }\r\n</ng-template>\r\n@if (field.display) {\r\n @if (props.labelAlign === \"before\") {\r\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\r\n }\r\n <tabs class=\"field-container\" [testId]=\"(field.testId || 'form') + '-tab'\">\r\n @for (itemField of field.fieldGroup; track itemField) {\r\n @if (itemField.display) {\r\n @if (props.useTabs && itemField.fieldGroup) {\r\n <div class=\"form-fieldset-item\"\r\n [tabsItem]=\"itemField.id\"\r\n [classes]=\"['form-fieldset-tab', itemField.valid === false ? 'invalid' : 'valid']\"\r\n [label]=\"itemField.props.label\">\r\n <formly-field [field]=\"itemField\"></formly-field>\r\n </div>\r\n } @else {\r\n <formly-field [field]=\"itemField\"></formly-field>\r\n }\r\n }\r\n }\r\n @if (showError && field.key !== null) {\r\n <div *ngIf=\"showError\" class=\"field-errors invalid-feedback\">\r\n <formly-validation-message\r\n [field]=\"field\"\r\n id=\"
|
|
2360
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.22", type: DynamicFormGroupComponent, isStandalone: false, selector: "dynamic-form-group", usesInheritance: true, ngImport: i0, template: "<ng-template #innerLabelTemplate let-label=\"label\">\r\n <label class=\"field-label\" [for]=\"id\">\r\n <span [innerHTML]=\"label | safe: 'html'\"></span>\r\n @if (props.markRequired) {\r\n <span class=\"field-required\" aria-hidden=\"true\">*</span>\r\n }\r\n @if (props.description) {\r\n <p class=\"field-description\" [innerHTML]=\"props.description | translate | safe: 'html'\"></p>\r\n }\r\n </label>\r\n</ng-template>\r\n<ng-template #labelTemplate>\r\n @let label = !props.label || props.hideLabel || parent?.props?.useTabs ? null : props.label | translate;\r\n @if (label) {\r\n <ng-container [ngxTemplateOutlet]=\"(field | dynamicFormTemplate : 'label') || innerLabelTemplate\"\r\n [context]=\"field\"\r\n [additionalContext]=\"{label: label}\"></ng-container>\r\n }\r\n</ng-template>\r\n@if (field.display) {\r\n @if (props.labelAlign === \"before\") {\r\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\r\n }\r\n <tabs class=\"field-container\" [testId]=\"(field.testId || 'form') + '-tab'\">\r\n @for (itemField of field.fieldGroup; track itemField) {\r\n @if (itemField.display) {\r\n @if (props.useTabs && itemField.fieldGroup) {\r\n <div class=\"form-fieldset-item\"\r\n [tabsItem]=\"itemField.id\"\r\n [classes]=\"['form-fieldset-tab', itemField.valid === false ? 'invalid' : 'valid']\"\r\n [label]=\"itemField.props.label\">\r\n <formly-field [field]=\"itemField\"></formly-field>\r\n </div>\r\n } @else {\r\n <formly-field [field]=\"itemField\"></formly-field>\r\n }\r\n }\r\n }\r\n @if (showError && field.key !== null) {\r\n <div *ngIf=\"showError\" class=\"field-errors invalid-feedback\">\r\n <formly-validation-message\r\n [field]=\"field\"\r\n [id]=\"id + '-formly-validation-error'\"\r\n role=\"alert\"\r\n ></formly-validation-message>\r\n </div>\r\n }\r\n </tabs>\r\n @if (props.labelAlign === \"after\") {\r\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\r\n }\r\n}\r\n", styles: [".dynamic-form-group>.field-container{overflow:hidden}.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: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.NgxTemplateOutletDirective, selector: "[ngxTemplateOutlet]", inputs: ["context", "additionalContext", "ngxTemplateOutlet"] }, { kind: "directive", type: i2.TabsItemDirective, selector: "[tabsItem]", inputs: ["tabsItem", "label", "tooltip", "icon", "disabled", "path", "classes"] }, { kind: "component", type: i2.TabsComponent, selector: "tabs", inputs: ["value", "options", "type", "size", "testId", "tabsClass"], outputs: ["valueChange", "selectedChange"] }, { kind: "component", type: i3.LegacyFormlyField, selector: "formly-field" }, { kind: "component", type: i3.LegacyFormlyValidationMessage, selector: "formly-validation-message" }, { kind: "pipe", type: i2.SafeHtmlPipe, name: "safe" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "pipe", type: DynamicFormTemplatePipe, name: "dynamicFormTemplate" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
2373
2361
|
}
|
|
2374
2362
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: DynamicFormGroupComponent, decorators: [{
|
|
2375
2363
|
type: Component,
|
|
2376
|
-
args: [{ standalone: false, selector: "dynamic-form-group", encapsulation: ViewEncapsulation.None, template: "<ng-template #innerLabelTemplate let-label=\"label\">\r\n <label class=\"field-label\" [for]=\"id\">\r\n <span [innerHTML]=\"label | safe: 'html'\"></span>\r\n @if (props.markRequired) {\r\n <span class=\"field-required\" aria-hidden=\"true\">*</span>\r\n }\r\n @if (props.description) {\r\n <p class=\"field-description\" [innerHTML]=\"props.description | translate | safe: 'html'\"></p>\r\n }\r\n </label>\r\n</ng-template>\r\n<ng-template #labelTemplate>\r\n @let label = !props.label || props.hideLabel || parent?.props?.useTabs ? null : props.label | translate;\r\n @if (label) {\r\n <ng-container [ngxTemplateOutlet]=\"(field | dynamicFormTemplate : 'label') || innerLabelTemplate\"\r\n [context]=\"field\"\r\n [additionalContext]=\"{label: label}\"></ng-container>\r\n }\r\n</ng-template>\r\n@if (field.display) {\r\n @if (props.labelAlign === \"before\") {\r\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\r\n }\r\n <tabs class=\"field-container\" [testId]=\"(field.testId || 'form') + '-tab'\">\r\n @for (itemField of field.fieldGroup; track itemField) {\r\n @if (itemField.display) {\r\n @if (props.useTabs && itemField.fieldGroup) {\r\n <div class=\"form-fieldset-item\"\r\n [tabsItem]=\"itemField.id\"\r\n [classes]=\"['form-fieldset-tab', itemField.valid === false ? 'invalid' : 'valid']\"\r\n [label]=\"itemField.props.label\">\r\n <formly-field [field]=\"itemField\"></formly-field>\r\n </div>\r\n } @else {\r\n <formly-field [field]=\"itemField\"></formly-field>\r\n }\r\n }\r\n }\r\n @if (showError && field.key !== null) {\r\n <div *ngIf=\"showError\" class=\"field-errors invalid-feedback\">\r\n <formly-validation-message\r\n [field]=\"field\"\r\n id=\"
|
|
2364
|
+
args: [{ standalone: false, selector: "dynamic-form-group", encapsulation: ViewEncapsulation.None, template: "<ng-template #innerLabelTemplate let-label=\"label\">\r\n <label class=\"field-label\" [for]=\"id\">\r\n <span [innerHTML]=\"label | safe: 'html'\"></span>\r\n @if (props.markRequired) {\r\n <span class=\"field-required\" aria-hidden=\"true\">*</span>\r\n }\r\n @if (props.description) {\r\n <p class=\"field-description\" [innerHTML]=\"props.description | translate | safe: 'html'\"></p>\r\n }\r\n </label>\r\n</ng-template>\r\n<ng-template #labelTemplate>\r\n @let label = !props.label || props.hideLabel || parent?.props?.useTabs ? null : props.label | translate;\r\n @if (label) {\r\n <ng-container [ngxTemplateOutlet]=\"(field | dynamicFormTemplate : 'label') || innerLabelTemplate\"\r\n [context]=\"field\"\r\n [additionalContext]=\"{label: label}\"></ng-container>\r\n }\r\n</ng-template>\r\n@if (field.display) {\r\n @if (props.labelAlign === \"before\") {\r\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\r\n }\r\n <tabs class=\"field-container\" [testId]=\"(field.testId || 'form') + '-tab'\">\r\n @for (itemField of field.fieldGroup; track itemField) {\r\n @if (itemField.display) {\r\n @if (props.useTabs && itemField.fieldGroup) {\r\n <div class=\"form-fieldset-item\"\r\n [tabsItem]=\"itemField.id\"\r\n [classes]=\"['form-fieldset-tab', itemField.valid === false ? 'invalid' : 'valid']\"\r\n [label]=\"itemField.props.label\">\r\n <formly-field [field]=\"itemField\"></formly-field>\r\n </div>\r\n } @else {\r\n <formly-field [field]=\"itemField\"></formly-field>\r\n }\r\n }\r\n }\r\n @if (showError && field.key !== null) {\r\n <div *ngIf=\"showError\" class=\"field-errors invalid-feedback\">\r\n <formly-validation-message\r\n [field]=\"field\"\r\n [id]=\"id + '-formly-validation-error'\"\r\n role=\"alert\"\r\n ></formly-validation-message>\r\n </div>\r\n }\r\n </tabs>\r\n @if (props.labelAlign === \"after\") {\r\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\r\n }\r\n}\r\n", styles: [".dynamic-form-group>.field-container{overflow:hidden}.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"] }]
|
|
2377
2365
|
}] });
|
|
2378
2366
|
|
|
2379
2367
|
// --- Components ---
|
|
@@ -2382,6 +2370,7 @@ const components = [
|
|
|
2382
2370
|
DynamicFormComponent,
|
|
2383
2371
|
DynamicFormArrayComponent,
|
|
2384
2372
|
DynamicFormChipsComponent,
|
|
2373
|
+
DynamicFormDateComponent,
|
|
2385
2374
|
DynamicFormEditorComponent,
|
|
2386
2375
|
DynamicFormPasswordComponent,
|
|
2387
2376
|
DynamicFormStaticComponent,
|
|
@@ -2411,6 +2400,7 @@ class NgxDynamicFormModule {
|
|
|
2411
2400
|
types: [
|
|
2412
2401
|
{ name: "array", component: DynamicFormArrayComponent },
|
|
2413
2402
|
{ name: "chips", component: DynamicFormChipsComponent },
|
|
2403
|
+
{ name: "date", component: DynamicFormDateComponent },
|
|
2414
2404
|
{ name: "editor", component: DynamicFormEditorComponent },
|
|
2415
2405
|
{ name: "password", component: DynamicFormPasswordComponent },
|
|
2416
2406
|
{ name: "static", component: DynamicFormStaticComponent },
|
|
@@ -2452,12 +2442,12 @@ class NgxDynamicFormModule {
|
|
|
2452
2442
|
return makeEnvironmentProviders(NgxDynamicFormModule.getProviders(config));
|
|
2453
2443
|
}
|
|
2454
2444
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: NgxDynamicFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2455
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.22", ngImport: i0, type: NgxDynamicFormModule, declarations: [DynamicFieldType, DynamicFormComponent, DynamicFormArrayComponent, DynamicFormChipsComponent, DynamicFormEditorComponent, DynamicFormPasswordComponent, DynamicFormStaticComponent, DynamicFormTranslationComponent, DynamicFormUploadComponent, DynamicFormWysiwygComponent, DynamicFormAlertComponent, DynamicFormFieldComponent, DynamicFormFieldsetComponent, DynamicFormGroupComponent, AsyncSubmitDirective, DynamicFormTemplateDirective, DynamicFormTemplatePipe], imports: [CommonModule,
|
|
2445
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.22", ngImport: i0, type: NgxDynamicFormModule, declarations: [DynamicFieldType, DynamicFormComponent, DynamicFormArrayComponent, DynamicFormChipsComponent, DynamicFormDateComponent, DynamicFormEditorComponent, DynamicFormPasswordComponent, DynamicFormStaticComponent, DynamicFormTranslationComponent, DynamicFormUploadComponent, DynamicFormWysiwygComponent, DynamicFormAlertComponent, DynamicFormFieldComponent, DynamicFormFieldsetComponent, DynamicFormGroupComponent, AsyncSubmitDirective, DynamicFormTemplateDirective, DynamicFormTemplatePipe], imports: [CommonModule,
|
|
2456
2446
|
FormsModule,
|
|
2457
2447
|
ReactiveFormsModule,
|
|
2458
2448
|
NgxUtilsModule,
|
|
2459
2449
|
FormlyModule,
|
|
2460
|
-
FormlySelectModule], exports: [DynamicFieldType, DynamicFormComponent, DynamicFormArrayComponent, DynamicFormChipsComponent, DynamicFormEditorComponent, DynamicFormPasswordComponent, DynamicFormStaticComponent, DynamicFormTranslationComponent, DynamicFormUploadComponent, DynamicFormWysiwygComponent, DynamicFormAlertComponent, DynamicFormFieldComponent, DynamicFormFieldsetComponent, DynamicFormGroupComponent, AsyncSubmitDirective, DynamicFormTemplateDirective, DynamicFormTemplatePipe, FormsModule,
|
|
2450
|
+
FormlySelectModule], exports: [DynamicFieldType, DynamicFormComponent, DynamicFormArrayComponent, DynamicFormChipsComponent, DynamicFormDateComponent, DynamicFormEditorComponent, DynamicFormPasswordComponent, DynamicFormStaticComponent, DynamicFormTranslationComponent, DynamicFormUploadComponent, DynamicFormWysiwygComponent, DynamicFormAlertComponent, DynamicFormFieldComponent, DynamicFormFieldsetComponent, DynamicFormGroupComponent, AsyncSubmitDirective, DynamicFormTemplateDirective, DynamicFormTemplatePipe, FormsModule,
|
|
2461
2451
|
ReactiveFormsModule,
|
|
2462
2452
|
NgxUtilsModule,
|
|
2463
2453
|
FormlyModule,
|
|
@@ -2511,5 +2501,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImpo
|
|
|
2511
2501
|
* Generated bundle index. Do not edit.
|
|
2512
2502
|
*/
|
|
2513
2503
|
|
|
2514
|
-
export { AsyncSubmitDirective, DEFAULT_NUMERIC_STEP, DynamicFieldType, DynamicFormAlertComponent, DynamicFormArrayComponent, DynamicFormBuilderService, DynamicFormChipsComponent, DynamicFormComponent, DynamicFormEditorComponent, DynamicFormFieldComponent, DynamicFormFieldsetComponent, DynamicFormGroupComponent, DynamicFormPasswordComponent, DynamicFormSchemaService, DynamicFormService, DynamicFormStaticComponent, DynamicFormTemplateDirective, DynamicFormTemplatePipe, DynamicFormTemplateService, DynamicFormTranslationComponent, DynamicFormUploadComponent, DynamicFormWysiwygComponent, EDITOR_TYPES, FORM_ROOT_ID, FormArray, FormFieldSet, FormGroup, FormInput, FormSelect, FormSerializable, FormStatic, FormUpload, MAX_INPUT_NUM, MIN_INPUT_NUM, NgxDynamicFormModule, RichTranslationModel, TranslationModel, addFieldValidators, arrayLengthValidation, clearFieldArray, controlStatus, controlValues,
|
|
2504
|
+
export { AsyncSubmitDirective, DEFAULT_NUMERIC_STEP, DynamicFieldType, DynamicFormAlertComponent, DynamicFormArrayComponent, DynamicFormBuilderService, DynamicFormChipsComponent, DynamicFormComponent, DynamicFormDateComponent, DynamicFormEditorComponent, DynamicFormFieldComponent, DynamicFormFieldsetComponent, DynamicFormGroupComponent, DynamicFormPasswordComponent, DynamicFormSchemaService, DynamicFormService, DynamicFormStaticComponent, DynamicFormTemplateDirective, DynamicFormTemplatePipe, DynamicFormTemplateService, DynamicFormTranslationComponent, DynamicFormUploadComponent, DynamicFormWysiwygComponent, EDITOR_TYPES, FORM_ROOT_ID, FormArray, FormDate, FormFieldSet, FormGroup, FormInput, FormSelect, FormSerializable, FormStatic, FormUpload, MAX_INPUT_NUM, MIN_INPUT_NUM, NgxDynamicFormModule, RichTranslationModel, TranslationModel, addFieldValidators, arrayLengthValidation, clearFieldArray, controlStatus, controlValues, convertToNumber, customizeFormField, emailValidation, enumValidation, equalsValidation, getFieldByPath, getFieldsByKey, getFieldsByPredicate, getSelectOptions, insertToFieldArray, isFieldHidden, isFieldVisible, jsonValidation, maxLengthValidation, maxValueValidation, minLengthValidation, minValueValidation, phoneValidation, removeFieldValidators, removeFromFieldArray, replaceFieldArray, replaceSpecialChars, requiredValidation, setFieldDefault, setFieldDisabled, setFieldHidden, setFieldHooks, setFieldMinDate, setFieldProp, setFieldProps, setFieldSerialize, setFieldValue, translationValidation };
|
|
2515
2505
|
//# sourceMappingURL=stemy-ngx-dynamic-form.mjs.map
|