@stemy/ngx-dynamic-form 19.9.33 → 19.9.34
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 +63 -48
- 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.imports.d.ts +2 -2
- 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 +2 -2
- package/package.json +2 -2
- package/public_api.d.ts +3 -2
|
@@ -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) => {
|
|
@@ -145,7 +151,7 @@ function controlStatus(control, timeout = 10) {
|
|
|
145
151
|
* @param value Value to convert to date string
|
|
146
152
|
* @param format Expected date format (date, date-time)
|
|
147
153
|
*/
|
|
148
|
-
function convertToDateFormat(value, format) {
|
|
154
|
+
function convertToDateFormat(value, format = "date") {
|
|
149
155
|
if (!ObjectUtils.isDefined(value) || !format?.includes("date"))
|
|
150
156
|
return value;
|
|
151
157
|
value = ObjectUtils.isDate(value) ? value : new Date(value);
|
|
@@ -160,7 +166,7 @@ function convertToDateFormat(value, format) {
|
|
|
160
166
|
* @param value Value to convert to date
|
|
161
167
|
* @param format Expected date format (date, date-time)
|
|
162
168
|
*/
|
|
163
|
-
function convertToDate(value, format) {
|
|
169
|
+
function convertToDate(value, format = "date") {
|
|
164
170
|
return (!ObjectUtils.isDefined(value) || !format?.includes("date"))
|
|
165
171
|
? value
|
|
166
172
|
: new Date(convertToDateFormat(value, format));
|
|
@@ -311,7 +317,7 @@ function isFieldHidden(field) {
|
|
|
311
317
|
const MIN_INPUT_NUM = -1999999999;
|
|
312
318
|
const MAX_INPUT_NUM = 1999999999;
|
|
313
319
|
const EDITOR_TYPES = ["php", "json", "html", "css", "scss"];
|
|
314
|
-
const CUSTOM_INPUT_TYPES = ["checkbox", "textarea", "wysiwyg", "password"];
|
|
320
|
+
const CUSTOM_INPUT_TYPES = ["checkbox", "textarea", "wysiwyg", "date", "password"];
|
|
315
321
|
|
|
316
322
|
function validationMessage(errorKey) {
|
|
317
323
|
const key = `form.error.${errorKey}`;
|
|
@@ -826,16 +832,20 @@ class DynamicFormBuilderService {
|
|
|
826
832
|
style: data.style === "list" ? "list" : "table"
|
|
827
833
|
}, parent, options);
|
|
828
834
|
}
|
|
835
|
+
createFormDate(key, data, parent, options) {
|
|
836
|
+
data = data || {};
|
|
837
|
+
return this.createFormField(key, "date", data, {
|
|
838
|
+
min: convertToDateFormat(data.min),
|
|
839
|
+
max: convertToDateFormat(data.max),
|
|
840
|
+
disabledDays: Array.isArray(data.disabledDays)
|
|
841
|
+
? data.disabledDays.map(n => convertToNumber(n)) : [],
|
|
842
|
+
disabledDates: Array.isArray(data.disabledDates)
|
|
843
|
+
? data.disabledDates.map(n => convertToDate(n)) : [],
|
|
844
|
+
strict: data.strict !== false,
|
|
845
|
+
}, parent, options);
|
|
846
|
+
}
|
|
829
847
|
createFormUpload(key, data, parent, options) {
|
|
830
848
|
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
849
|
const baseUrl = data.url?.startsWith("http") ? data.url : this.api.url(data.url || "assets");
|
|
840
850
|
return this.createFormField(key, "upload", data, {
|
|
841
851
|
inline: data.inline === true,
|
|
@@ -844,10 +854,7 @@ class DynamicFormBuilderService {
|
|
|
844
854
|
url: baseUrl,
|
|
845
855
|
uploadUrl: data.url?.startsWith("http")
|
|
846
856
|
? 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
|
|
857
|
+
: (data.uploadUrl ? this.api.url(data.uploadUrl || "assets") : baseUrl)
|
|
851
858
|
}, parent, options);
|
|
852
859
|
}
|
|
853
860
|
createFormGroup(key, fields, data, parent, options) {
|
|
@@ -1212,20 +1219,9 @@ class DynamicFormSchemaService {
|
|
|
1212
1219
|
return !field ? [] : options.customize(field, property, schema);
|
|
1213
1220
|
}
|
|
1214
1221
|
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);
|
|
1222
|
+
if (property.type === "boolean") {
|
|
1223
|
+
// Handle boolean first
|
|
1224
|
+
return this.getFormCheckboxConfig(property, options, parent);
|
|
1229
1225
|
}
|
|
1230
1226
|
const $enum = property.items?.enum || property.enum;
|
|
1231
1227
|
if (Array.isArray($enum) || ObjectUtils.isStringWithValue(property.optionsPath) || ObjectUtils.isStringWithValue(property.endpoint)) {
|
|
@@ -1243,17 +1239,23 @@ class DynamicFormSchemaService {
|
|
|
1243
1239
|
return this.getFormTextareaConfig(property, options, parent);
|
|
1244
1240
|
}
|
|
1245
1241
|
if (property.format == "date" || property.format == "date-time") {
|
|
1246
|
-
return this.
|
|
1242
|
+
return this.getFormDateConfig(property, options, parent);
|
|
1247
1243
|
}
|
|
1244
|
+
// First check property references, because a dynamic schema can be a type of object which we use for editor
|
|
1245
|
+
const refs = await this.openApi.getReferences(property, options.schema);
|
|
1246
|
+
if (refs.length > 0) {
|
|
1247
|
+
return this.getFormGroupConfig(property, options, parent);
|
|
1248
|
+
}
|
|
1249
|
+
// Then check if it might be an editor property
|
|
1248
1250
|
if (this.checkIsEditorProperty(property)) {
|
|
1249
1251
|
return this.getFormEditorConfig(property, options, parent);
|
|
1250
1252
|
}
|
|
1251
1253
|
return this.getFormInputConfig(property, options, parent);
|
|
1252
1254
|
}
|
|
1253
1255
|
checkIsEditorProperty(property) {
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1256
|
+
return property.type === "object"
|
|
1257
|
+
|| EDITOR_TYPES.indexOf(property.format) >= 0
|
|
1258
|
+
|| property.format?.endsWith("script");
|
|
1257
1259
|
}
|
|
1258
1260
|
getFormFieldData(property, options) {
|
|
1259
1261
|
const validators = {};
|
|
@@ -1370,13 +1372,16 @@ class DynamicFormSchemaService {
|
|
|
1370
1372
|
type: property.format || "json"
|
|
1371
1373
|
}, parent, options);
|
|
1372
1374
|
}
|
|
1373
|
-
|
|
1374
|
-
const type = property.format == "date-time" ? "datetime-local" : "date";
|
|
1375
|
-
|
|
1375
|
+
getFormDateConfig(property, options, parent) {
|
|
1376
|
+
// const type = property.format == "date-time" ? "datetime-local" : "date";
|
|
1377
|
+
// TODO: Support date-time also
|
|
1378
|
+
return this.builder.createFormDate(property.id, {
|
|
1376
1379
|
...this.getFormFieldData(property, options),
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
+
min: convertToDate(property.minimum ?? property.min, property.format),
|
|
1381
|
+
max: convertToDate(property.maximum ?? property.max, property.format),
|
|
1382
|
+
disabledDays: property.disabledDays,
|
|
1383
|
+
disabledDates: property.disabledDates,
|
|
1384
|
+
strict: property.strict,
|
|
1380
1385
|
}, parent, options);
|
|
1381
1386
|
}
|
|
1382
1387
|
getFormSelectConfig($enum, property, options, parent) {
|
|
@@ -1398,8 +1403,7 @@ class DynamicFormSchemaService {
|
|
|
1398
1403
|
inline: property.inline,
|
|
1399
1404
|
accept: property.accept,
|
|
1400
1405
|
url: property.url,
|
|
1401
|
-
|
|
1402
|
-
uploadOptions: property.uploadOptions
|
|
1406
|
+
uploadUrl: property.uploadUrl,
|
|
1403
1407
|
}, parent, options);
|
|
1404
1408
|
}
|
|
1405
1409
|
getFormCheckboxConfig(property, options, parent) {
|
|
@@ -2234,6 +2238,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImpo
|
|
|
2234
2238
|
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
2239
|
}] });
|
|
2236
2240
|
|
|
2241
|
+
class DynamicFormDateComponent extends DynamicFieldType {
|
|
2242
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: DynamicFormDateComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2243
|
+
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 }); }
|
|
2244
|
+
}
|
|
2245
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: DynamicFormDateComponent, decorators: [{
|
|
2246
|
+
type: Component,
|
|
2247
|
+
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" }]
|
|
2248
|
+
}] });
|
|
2249
|
+
|
|
2237
2250
|
class DynamicFormEditorComponent extends DynamicFieldType {
|
|
2238
2251
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: DynamicFormEditorComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2239
2252
|
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 +2319,11 @@ class DynamicFormTranslationComponent extends DynamicFormArrayComponent {
|
|
|
2306
2319
|
this.currentTab.set(index);
|
|
2307
2320
|
}
|
|
2308
2321
|
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=\"
|
|
2322
|
+
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
2323
|
}
|
|
2311
2324
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: DynamicFormTranslationComponent, decorators: [{
|
|
2312
2325
|
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=\"
|
|
2326
|
+
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
2327
|
}], ctorParameters: () => [{ type: i2.EventsService }, { type: undefined, decorators: [{
|
|
2315
2328
|
type: Inject,
|
|
2316
2329
|
args: [LANGUAGE_SERVICE]
|
|
@@ -2369,11 +2382,11 @@ class DynamicFormGroupComponent extends FieldWrapper {
|
|
|
2369
2382
|
return this.field?.parent;
|
|
2370
2383
|
}
|
|
2371
2384
|
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=\"
|
|
2385
|
+
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
2386
|
}
|
|
2374
2387
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: DynamicFormGroupComponent, decorators: [{
|
|
2375
2388
|
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=\"
|
|
2389
|
+
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
2390
|
}] });
|
|
2378
2391
|
|
|
2379
2392
|
// --- Components ---
|
|
@@ -2382,6 +2395,7 @@ const components = [
|
|
|
2382
2395
|
DynamicFormComponent,
|
|
2383
2396
|
DynamicFormArrayComponent,
|
|
2384
2397
|
DynamicFormChipsComponent,
|
|
2398
|
+
DynamicFormDateComponent,
|
|
2385
2399
|
DynamicFormEditorComponent,
|
|
2386
2400
|
DynamicFormPasswordComponent,
|
|
2387
2401
|
DynamicFormStaticComponent,
|
|
@@ -2411,6 +2425,7 @@ class NgxDynamicFormModule {
|
|
|
2411
2425
|
types: [
|
|
2412
2426
|
{ name: "array", component: DynamicFormArrayComponent },
|
|
2413
2427
|
{ name: "chips", component: DynamicFormChipsComponent },
|
|
2428
|
+
{ name: "date", component: DynamicFormDateComponent },
|
|
2414
2429
|
{ name: "editor", component: DynamicFormEditorComponent },
|
|
2415
2430
|
{ name: "password", component: DynamicFormPasswordComponent },
|
|
2416
2431
|
{ name: "static", component: DynamicFormStaticComponent },
|
|
@@ -2452,12 +2467,12 @@ class NgxDynamicFormModule {
|
|
|
2452
2467
|
return makeEnvironmentProviders(NgxDynamicFormModule.getProviders(config));
|
|
2453
2468
|
}
|
|
2454
2469
|
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,
|
|
2470
|
+
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
2471
|
FormsModule,
|
|
2457
2472
|
ReactiveFormsModule,
|
|
2458
2473
|
NgxUtilsModule,
|
|
2459
2474
|
FormlyModule,
|
|
2460
|
-
FormlySelectModule], exports: [DynamicFieldType, DynamicFormComponent, DynamicFormArrayComponent, DynamicFormChipsComponent, DynamicFormEditorComponent, DynamicFormPasswordComponent, DynamicFormStaticComponent, DynamicFormTranslationComponent, DynamicFormUploadComponent, DynamicFormWysiwygComponent, DynamicFormAlertComponent, DynamicFormFieldComponent, DynamicFormFieldsetComponent, DynamicFormGroupComponent, AsyncSubmitDirective, DynamicFormTemplateDirective, DynamicFormTemplatePipe, FormsModule,
|
|
2475
|
+
FormlySelectModule], exports: [DynamicFieldType, DynamicFormComponent, DynamicFormArrayComponent, DynamicFormChipsComponent, DynamicFormDateComponent, DynamicFormEditorComponent, DynamicFormPasswordComponent, DynamicFormStaticComponent, DynamicFormTranslationComponent, DynamicFormUploadComponent, DynamicFormWysiwygComponent, DynamicFormAlertComponent, DynamicFormFieldComponent, DynamicFormFieldsetComponent, DynamicFormGroupComponent, AsyncSubmitDirective, DynamicFormTemplateDirective, DynamicFormTemplatePipe, FormsModule,
|
|
2461
2476
|
ReactiveFormsModule,
|
|
2462
2477
|
NgxUtilsModule,
|
|
2463
2478
|
FormlyModule,
|
|
@@ -2511,5 +2526,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImpo
|
|
|
2511
2526
|
* Generated bundle index. Do not edit.
|
|
2512
2527
|
*/
|
|
2513
2528
|
|
|
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, convertToDate, convertToDateFormat, 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 };
|
|
2529
|
+
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, convertToDate, convertToDateFormat, 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
2530
|
//# sourceMappingURL=stemy-ngx-dynamic-form.mjs.map
|