@ngx-smz/core 21.1.1 → 21.1.3
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.
|
@@ -21,7 +21,7 @@ import { ObjectUtils, ZIndexUtils, UniqueComponentId } from 'primeng/utils';
|
|
|
21
21
|
import * as i1$8 from '@angular/common/http';
|
|
22
22
|
import { HttpClient, provideHttpClient, withInterceptorsFromDi, HttpErrorResponse, HttpHeaders, HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
23
23
|
import { cloneDeep, uniqBy, flatten as flatten$1, sortBy, isBoolean as isBoolean$1, isEmpty as isEmpty$2, isEqual } from 'lodash-es';
|
|
24
|
-
import { BehaviorSubject, firstValueFrom, debounceTime, tap, of, take as take$1, Subject, throwError, map as map$1, throttleTime, switchMap, Observable, takeUntil as takeUntil$2, merge, filter as filter$1 } from 'rxjs';
|
|
24
|
+
import { Subscription, BehaviorSubject, firstValueFrom, debounceTime, tap, of, take as take$1, Subject, throwError, map as map$1, throttleTime, switchMap, Observable, takeUntil as takeUntil$2, merge, filter as filter$1 } from 'rxjs';
|
|
25
25
|
import * as i1$2 from 'primeng/datepicker';
|
|
26
26
|
import { DatePickerModule } from 'primeng/datepicker';
|
|
27
27
|
import * as i1 from 'primeng/tooltip';
|
|
@@ -79,7 +79,6 @@ import * as i3$9 from 'primeng/progressbar';
|
|
|
79
79
|
import { ProgressBarModule } from 'primeng/progressbar';
|
|
80
80
|
import cloneDeep$1 from 'lodash-es/cloneDeep';
|
|
81
81
|
import { JwtHelperService } from '@auth0/angular-jwt';
|
|
82
|
-
import { cloneDeep as cloneDeep$2 } from 'lodash';
|
|
83
82
|
import * as i19 from 'primeng/skeleton';
|
|
84
83
|
import { SkeletonModule } from 'primeng/skeleton';
|
|
85
84
|
import * as i1$9 from '@angular/router';
|
|
@@ -1978,6 +1977,7 @@ class SmzFormViewdata {
|
|
|
1978
1977
|
form;
|
|
1979
1978
|
manager;
|
|
1980
1979
|
cdf;
|
|
1980
|
+
validationMessagesService;
|
|
1981
1981
|
isValid = false;
|
|
1982
1982
|
isCustomValidationValid = true;
|
|
1983
1983
|
// Is the data different from the original state?
|
|
@@ -1991,11 +1991,12 @@ class SmzFormViewdata {
|
|
|
1991
1991
|
_hasChangesFromLastKnownState = false;
|
|
1992
1992
|
previousState = '';
|
|
1993
1993
|
cachedResponse = null;
|
|
1994
|
-
constructor(config, form, manager, cdf) {
|
|
1994
|
+
constructor(config, form, manager, cdf, validationMessagesService) {
|
|
1995
1995
|
this.config = config;
|
|
1996
1996
|
this.form = form;
|
|
1997
1997
|
this.manager = manager;
|
|
1998
1998
|
this.cdf = cdf;
|
|
1999
|
+
this.validationMessagesService = validationMessagesService;
|
|
1999
2000
|
}
|
|
2000
2001
|
/** Retorna o objeto com os valores dos inputs; Esse objeto seguirá a nomemclatura do campo name de cada inputConfig */
|
|
2001
2002
|
getData() {
|
|
@@ -2004,7 +2005,12 @@ class SmzFormViewdata {
|
|
|
2004
2005
|
console.log('-------- getData ---------');
|
|
2005
2006
|
}
|
|
2006
2007
|
const data = {};
|
|
2007
|
-
const response = {
|
|
2008
|
+
const response = {
|
|
2009
|
+
data,
|
|
2010
|
+
isValid: true,
|
|
2011
|
+
hasUnsavedChanges: false,
|
|
2012
|
+
validationMessagesByField: {}
|
|
2013
|
+
};
|
|
2008
2014
|
const formFlattenResponse = this.config.behaviors?.flattenResponse ?? false;
|
|
2009
2015
|
for (const group of this.config.groups) {
|
|
2010
2016
|
for (const input of group.children) {
|
|
@@ -2068,8 +2074,10 @@ class SmzFormViewdata {
|
|
|
2068
2074
|
}
|
|
2069
2075
|
// console.log('response.isValid', response.isValid);
|
|
2070
2076
|
this.isValid = response.isValid;
|
|
2077
|
+
const validationMessagesByField = this.validationMessagesService.getMessagesByPropertyName();
|
|
2078
|
+
const finalResponse = { ...response, validationMessagesByField };
|
|
2071
2079
|
// console.log('Final isValid', this.isValid);
|
|
2072
|
-
this.cachedResponse =
|
|
2080
|
+
this.cachedResponse = finalResponse;
|
|
2073
2081
|
return this.cachedResponse;
|
|
2074
2082
|
}
|
|
2075
2083
|
/** Atualiza os valores dos inputs com seus dados default */
|
|
@@ -2168,6 +2176,93 @@ class SmzFormViewdata {
|
|
|
2168
2176
|
}
|
|
2169
2177
|
}
|
|
2170
2178
|
|
|
2179
|
+
class SmzFormValidationMessagesService {
|
|
2180
|
+
form = null;
|
|
2181
|
+
subscriptions = new Subscription();
|
|
2182
|
+
controlToPropertyName = new WeakMap();
|
|
2183
|
+
validationMessagesByPropertyName = new Map();
|
|
2184
|
+
messagesByPropertyNameSignal = signal({}, ...(ngDevMode ? [{ debugName: "messagesByPropertyNameSignal" }] : []));
|
|
2185
|
+
controlMessagesSignals = new WeakMap();
|
|
2186
|
+
messagesByPropertyName = this.messagesByPropertyNameSignal.asReadonly();
|
|
2187
|
+
initialize(config, form) {
|
|
2188
|
+
this.resetState();
|
|
2189
|
+
this.form = form;
|
|
2190
|
+
for (const group of config.groups) {
|
|
2191
|
+
for (const input of group.children) {
|
|
2192
|
+
const control = this.form.controls[input.propertyName];
|
|
2193
|
+
if (control == null) {
|
|
2194
|
+
continue;
|
|
2195
|
+
}
|
|
2196
|
+
this.controlToPropertyName.set(control, input.propertyName);
|
|
2197
|
+
this.validationMessagesByPropertyName.set(input.propertyName, input.advancedSettings?.validationMessages ?? []);
|
|
2198
|
+
}
|
|
2199
|
+
}
|
|
2200
|
+
this.refreshAllMessages();
|
|
2201
|
+
this.subscriptions.add(this.form.statusChanges.subscribe(() => {
|
|
2202
|
+
this.refreshAllMessages();
|
|
2203
|
+
}));
|
|
2204
|
+
}
|
|
2205
|
+
getMessagesSignalByControl(control) {
|
|
2206
|
+
if (control == null) {
|
|
2207
|
+
return computed(() => []);
|
|
2208
|
+
}
|
|
2209
|
+
const cachedSignal = this.controlMessagesSignals.get(control);
|
|
2210
|
+
if (cachedSignal != null) {
|
|
2211
|
+
return cachedSignal;
|
|
2212
|
+
}
|
|
2213
|
+
const controlMessagesSignal = computed(() => {
|
|
2214
|
+
const propertyName = this.controlToPropertyName.get(control);
|
|
2215
|
+
if (propertyName == null) {
|
|
2216
|
+
return [];
|
|
2217
|
+
}
|
|
2218
|
+
return this.messagesByPropertyNameSignal()[propertyName] ?? [];
|
|
2219
|
+
}, ...(ngDevMode ? [{ debugName: "controlMessagesSignal" }] : []));
|
|
2220
|
+
this.controlMessagesSignals.set(control, controlMessagesSignal);
|
|
2221
|
+
return controlMessagesSignal;
|
|
2222
|
+
}
|
|
2223
|
+
getMessagesByPropertyName() {
|
|
2224
|
+
return this.messagesByPropertyNameSignal();
|
|
2225
|
+
}
|
|
2226
|
+
refreshAllMessages() {
|
|
2227
|
+
const nextMessagesByPropertyName = {};
|
|
2228
|
+
this.validationMessagesByPropertyName.forEach((validationMessages, propertyName) => {
|
|
2229
|
+
const control = this.form.controls[propertyName];
|
|
2230
|
+
if (control != null) {
|
|
2231
|
+
nextMessagesByPropertyName[propertyName] = this.resolveValidationMessages(control.errors, validationMessages);
|
|
2232
|
+
}
|
|
2233
|
+
});
|
|
2234
|
+
this.messagesByPropertyNameSignal.set(nextMessagesByPropertyName);
|
|
2235
|
+
}
|
|
2236
|
+
resolveValidationMessages(errors, messages) {
|
|
2237
|
+
if (errors == null) {
|
|
2238
|
+
return [];
|
|
2239
|
+
}
|
|
2240
|
+
const resolvedMessages = [];
|
|
2241
|
+
for (const errorType of Object.keys(errors)) {
|
|
2242
|
+
const matchedMessage = messages.find(message => message.type === errorType);
|
|
2243
|
+
if (matchedMessage != null) {
|
|
2244
|
+
resolvedMessages.push(matchedMessage.message);
|
|
2245
|
+
}
|
|
2246
|
+
else {
|
|
2247
|
+
resolvedMessages.push(`Erro desconhecido: ${errorType}`);
|
|
2248
|
+
}
|
|
2249
|
+
}
|
|
2250
|
+
return resolvedMessages;
|
|
2251
|
+
}
|
|
2252
|
+
resetState() {
|
|
2253
|
+
this.subscriptions.unsubscribe();
|
|
2254
|
+
this.subscriptions = new Subscription();
|
|
2255
|
+
this.validationMessagesByPropertyName.clear();
|
|
2256
|
+
this.messagesByPropertyNameSignal.set({});
|
|
2257
|
+
this.form = null;
|
|
2258
|
+
}
|
|
2259
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzFormValidationMessagesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2260
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzFormValidationMessagesService });
|
|
2261
|
+
}
|
|
2262
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzFormValidationMessagesService, decorators: [{
|
|
2263
|
+
type: Injectable
|
|
2264
|
+
}] });
|
|
2265
|
+
|
|
2171
2266
|
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-return, @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type, @typescript-eslint/typedef, no-console, no-underscore-dangle, eqeqeq, max-len */
|
|
2172
2267
|
class SmzFormsDropdownService {
|
|
2173
2268
|
dependsOn;
|
|
@@ -2633,7 +2728,7 @@ class LabelComponent {
|
|
|
2633
2728
|
@if(showLabel) {
|
|
2634
2729
|
<label [for]="propertyName" [innerHTML]="text"></label>
|
|
2635
2730
|
|
|
2636
|
-
@if(warning != null) {
|
|
2731
|
+
@if(warning != null && warning.value != null) {
|
|
2637
2732
|
<i class="ml-2" [ngClass]="warning.styleClass" [pTooltip]="warning.value" [tooltipPosition]="warning.position"></i>
|
|
2638
2733
|
}
|
|
2639
2734
|
|
|
@@ -2664,7 +2759,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
2664
2759
|
@if(showLabel) {
|
|
2665
2760
|
<label [for]="propertyName" [innerHTML]="text"></label>
|
|
2666
2761
|
|
|
2667
|
-
@if(warning != null) {
|
|
2762
|
+
@if(warning != null && warning.value != null) {
|
|
2668
2763
|
<i class="ml-2" [ngClass]="warning.styleClass" [pTooltip]="warning.value" [tooltipPosition]="warning.position"></i>
|
|
2669
2764
|
}
|
|
2670
2765
|
|
|
@@ -2756,52 +2851,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
2756
2851
|
type: Injectable
|
|
2757
2852
|
}] });
|
|
2758
2853
|
|
|
2759
|
-
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-return, @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type, @typescript-eslint/typedef, no-useless-escape, max-len, @typescript-eslint/no-useless-constructor */
|
|
2760
|
-
let ValidationMessagesPipe$1 = class ValidationMessagesPipe {
|
|
2761
|
-
constructor() {
|
|
2762
|
-
}
|
|
2763
|
-
transform(errors, messages) {
|
|
2764
|
-
if (errors == null)
|
|
2765
|
-
return [];
|
|
2766
|
-
const result = [];
|
|
2767
|
-
for (const error of Object.keys(errors)) {
|
|
2768
|
-
const match = messages.find(x => x.type === error);
|
|
2769
|
-
if (match != null) {
|
|
2770
|
-
result.push(match.message);
|
|
2771
|
-
}
|
|
2772
|
-
else {
|
|
2773
|
-
result.push(`Erro desconhecido: ${error}`);
|
|
2774
|
-
}
|
|
2775
|
-
}
|
|
2776
|
-
return result;
|
|
2777
|
-
}
|
|
2778
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ValidationMessagesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2779
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.1", ngImport: i0, type: ValidationMessagesPipe, isStandalone: false, name: "validationMessages", pure: false });
|
|
2780
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ValidationMessagesPipe });
|
|
2781
|
-
};
|
|
2782
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ValidationMessagesPipe$1, decorators: [{
|
|
2783
|
-
type: Pipe,
|
|
2784
|
-
args: [{
|
|
2785
|
-
name: 'validationMessages',
|
|
2786
|
-
pure: false,
|
|
2787
|
-
standalone: false
|
|
2788
|
-
}]
|
|
2789
|
-
}, {
|
|
2790
|
-
type: Injectable
|
|
2791
|
-
}], ctorParameters: () => [] });
|
|
2792
|
-
|
|
2793
2854
|
class ValidationMessagesComponent {
|
|
2855
|
+
validationMessagesService = inject(SmzFormValidationMessagesService);
|
|
2856
|
+
formControl;
|
|
2794
2857
|
input;
|
|
2795
|
-
control
|
|
2858
|
+
set control(value) {
|
|
2859
|
+
this.formControl = value;
|
|
2860
|
+
this.controlMessages = this.validationMessagesService.getMessagesSignalByControl(value);
|
|
2861
|
+
}
|
|
2862
|
+
get control() {
|
|
2863
|
+
return this.formControl;
|
|
2864
|
+
}
|
|
2796
2865
|
behaviors;
|
|
2797
2866
|
extraMessages = [];
|
|
2867
|
+
controlMessages = signal([], ...(ngDevMode ? [{ debugName: "controlMessages" }] : []));
|
|
2798
2868
|
uiConfig = GlobalInjector.config;
|
|
2799
2869
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ValidationMessagesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2800
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: ValidationMessagesComponent, isStandalone: false, selector: "smz-validation-messages", inputs: { input: "input", control: "control", behaviors: "behaviors", extraMessages: "extraMessages" }, ngImport: i0, template: "@if (behaviors?.showErrorsMethod != null ? control[behaviors.showErrorsMethod] : control[uiConfig.dialogs.forms.behaviors.showErrorsMethod]) {\r\n @if ((
|
|
2870
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: ValidationMessagesComponent, isStandalone: false, selector: "smz-validation-messages", inputs: { input: "input", control: "control", behaviors: "behaviors", extraMessages: "extraMessages" }, ngImport: i0, template: "@if (behaviors?.showErrorsMethod != null ? control[behaviors.showErrorsMethod] : control[uiConfig.dialogs.forms.behaviors.showErrorsMethod]) {\r\n @if (controlMessages() | join : extraMessages; as messages) {\r\n @if (messages.length === 1) {\r\n @for (message of messages; track message) {\r\n <span class=\"col-12 error-message\">{{ message }}</span>\r\n }\r\n }\r\n\r\n @if (messages.length > 1) {\r\n @if (behaviors.showMultipleErrorMessages) {\r\n <span class=\"col-12 error-message asterisk\">{{ messages | describeArray }}</span>\r\n }\r\n\r\n @if (!behaviors.showMultipleErrorMessages) {\r\n <span class=\"col-12 error-message asterisk\" [pTooltip]=\"messages | describeArray\">{{ uiConfig.dialogs.forms.multipleErrorMessagesLabel }} *</span>\r\n }\r\n }\r\n }\r\n}", dependencies: [{ kind: "directive", type: i1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }, { kind: "pipe", type: DescribeArrayPipe, name: "describeArray" }, { kind: "pipe", type: JoinPipe, name: "join" }] });
|
|
2801
2871
|
}
|
|
2802
2872
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ValidationMessagesComponent, decorators: [{
|
|
2803
2873
|
type: Component,
|
|
2804
|
-
args: [{ selector: 'smz-validation-messages', standalone: false, template: "@if (behaviors?.showErrorsMethod != null ? control[behaviors.showErrorsMethod] : control[uiConfig.dialogs.forms.behaviors.showErrorsMethod]) {\r\n @if ((
|
|
2874
|
+
args: [{ selector: 'smz-validation-messages', standalone: false, template: "@if (behaviors?.showErrorsMethod != null ? control[behaviors.showErrorsMethod] : control[uiConfig.dialogs.forms.behaviors.showErrorsMethod]) {\r\n @if (controlMessages() | join : extraMessages; as messages) {\r\n @if (messages.length === 1) {\r\n @for (message of messages; track message) {\r\n <span class=\"col-12 error-message\">{{ message }}</span>\r\n }\r\n }\r\n\r\n @if (messages.length > 1) {\r\n @if (behaviors.showMultipleErrorMessages) {\r\n <span class=\"col-12 error-message asterisk\">{{ messages | describeArray }}</span>\r\n }\r\n\r\n @if (!behaviors.showMultipleErrorMessages) {\r\n <span class=\"col-12 error-message asterisk\" [pTooltip]=\"messages | describeArray\">{{ uiConfig.dialogs.forms.multipleErrorMessagesLabel }} *</span>\r\n }\r\n }\r\n }\r\n}" }]
|
|
2805
2875
|
}], propDecorators: { input: [{
|
|
2806
2876
|
type: Input
|
|
2807
2877
|
}], control: [{
|
|
@@ -4796,11 +4866,11 @@ class InputTreeComponent {
|
|
|
4796
4866
|
}
|
|
4797
4867
|
}
|
|
4798
4868
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: InputTreeComponent, deps: [{ token: SmzFormsDropdownService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4799
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: InputTreeComponent, isStandalone: false, selector: "smz-input-tree", inputs: { input: "input", formId: "formId", control: "control", behaviors: "behaviors" }, ngImport: i0, template: "@if (nodes$ | async; as nodes) {\
|
|
4869
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: InputTreeComponent, isStandalone: false, selector: "smz-input-tree", inputs: { input: "input", formId: "formId", control: "control", behaviors: "behaviors" }, ngImport: i0, template: "@if (nodes$ | async; as nodes) {\n <smz-label\n class=\"smz__input_name\"\n [text]=\"input.name\"\n [propertyName]=\"input.propertyName\"\n [showLabel]=\"input.hideLabel != true\"\n [warning]=\"input.warning?.()\"\n [help]=\"input.tooltip?.()\"\n [popover]=\"input.popover?.()\">\n </smz-label>\n <div class=\"input_inner__wrapper grid grid-nogutter\">\n <p-treeSelect\n class=\"col-12 grid-nogutter smz__input_value flex-1\"\n containerStyleClass=\"w-full\"\n [formControl]=\"control\"\n [options]=\"nodes\"\n [placeholder]=\"input.name\"\n appendTo=\"body\"\n [filter]=\"input.showFilter ? true : false\"\n [selectionMode]=\"input.selectionMode\"\n [filterInputAutoFocus]=\"input.autofocusFilter\"\n [emptyMessage]=\"input.emptyMessage\"\n [showClear]=\"input.showClear\"\n [filterPlaceholder]=\"input.emptyFilterMessage\"\n [scrollHeight]=\"input.scrollHeight\"\n [display]=\"input.display\"\n >\n @for (inputType of input.allTypes; track inputType) {\n <ng-template let-node [pTemplate]=\"inputType\">\n @if (node != null) {\n <div [innerHTML]=\"node.label | safeHtml\" [pTooltip]=\"node.tooltip\"></div>\n }\n </ng-template>\n }\n </p-treeSelect>\n <smz-validation-messages [input]=\"input\" [control]=\"control\" [behaviors]=\"behaviors\"></smz-validation-messages>\n </div>\n}", dependencies: [{ kind: "directive", type: i1$7.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }, { kind: "component", type: i5.TreeSelect, selector: "p-treeSelect, p-treeselect, p-tree-select", inputs: ["inputId", "scrollHeight", "metaKeySelection", "display", "selectionMode", "tabindex", "ariaLabel", "ariaLabelledBy", "placeholder", "panelClass", "panelStyle", "panelStyleClass", "containerStyle", "containerStyleClass", "labelStyle", "labelStyleClass", "overlayOptions", "emptyMessage", "filter", "filterBy", "filterMode", "filterPlaceholder", "filterLocale", "filterInputAutoFocus", "propagateSelectionDown", "propagateSelectionUp", "showClear", "resetFilterOnHide", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "autofocus", "options", "loading", "loadingMode", "size", "variant", "fluid", "appendTo", "motionOptions"], outputs: ["onNodeExpand", "onNodeCollapse", "onShow", "onHide", "onClear", "onFilter", "onFocus", "onBlur", "onNodeUnselect", "onNodeSelect"] }, { kind: "component", type: LabelComponent, selector: "smz-label", inputs: ["text", "propertyName", "showLabel", "warning", "help", "popover"] }, { kind: "component", type: ValidationMessagesComponent, selector: "smz-validation-messages", inputs: ["input", "control", "behaviors", "extraMessages"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: SafeHtmlPipe$2, name: "safeHtml" }] });
|
|
4800
4870
|
}
|
|
4801
4871
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: InputTreeComponent, decorators: [{
|
|
4802
4872
|
type: Component,
|
|
4803
|
-
args: [{ selector: 'smz-input-tree', standalone: false, template: "@if (nodes$ | async; as nodes) {\
|
|
4873
|
+
args: [{ selector: 'smz-input-tree', standalone: false, template: "@if (nodes$ | async; as nodes) {\n <smz-label\n class=\"smz__input_name\"\n [text]=\"input.name\"\n [propertyName]=\"input.propertyName\"\n [showLabel]=\"input.hideLabel != true\"\n [warning]=\"input.warning?.()\"\n [help]=\"input.tooltip?.()\"\n [popover]=\"input.popover?.()\">\n </smz-label>\n <div class=\"input_inner__wrapper grid grid-nogutter\">\n <p-treeSelect\n class=\"col-12 grid-nogutter smz__input_value flex-1\"\n containerStyleClass=\"w-full\"\n [formControl]=\"control\"\n [options]=\"nodes\"\n [placeholder]=\"input.name\"\n appendTo=\"body\"\n [filter]=\"input.showFilter ? true : false\"\n [selectionMode]=\"input.selectionMode\"\n [filterInputAutoFocus]=\"input.autofocusFilter\"\n [emptyMessage]=\"input.emptyMessage\"\n [showClear]=\"input.showClear\"\n [filterPlaceholder]=\"input.emptyFilterMessage\"\n [scrollHeight]=\"input.scrollHeight\"\n [display]=\"input.display\"\n >\n @for (inputType of input.allTypes; track inputType) {\n <ng-template let-node [pTemplate]=\"inputType\">\n @if (node != null) {\n <div [innerHTML]=\"node.label | safeHtml\" [pTooltip]=\"node.tooltip\"></div>\n }\n </ng-template>\n }\n </p-treeSelect>\n <smz-validation-messages [input]=\"input\" [control]=\"control\" [behaviors]=\"behaviors\"></smz-validation-messages>\n </div>\n}" }]
|
|
4804
4874
|
}], ctorParameters: () => [{ type: SmzFormsDropdownService }], propDecorators: { input: [{
|
|
4805
4875
|
type: Input
|
|
4806
4876
|
}], formId: [{
|
|
@@ -6158,6 +6228,7 @@ class FormGroupComponent {
|
|
|
6158
6228
|
cdf;
|
|
6159
6229
|
manager;
|
|
6160
6230
|
repository;
|
|
6231
|
+
validationMessagesService;
|
|
6161
6232
|
loggingService = inject(LoggingService);
|
|
6162
6233
|
logger = this.loggingService.scoped(LoggingScope.Forms);
|
|
6163
6234
|
isComponentActive = true;
|
|
@@ -6184,11 +6255,12 @@ class FormGroupComponent {
|
|
|
6184
6255
|
controlTypes = SmzControlType;
|
|
6185
6256
|
isInitialized = false;
|
|
6186
6257
|
configHasErrors = false;
|
|
6187
|
-
constructor(fb, cdf, manager, repository) {
|
|
6258
|
+
constructor(fb, cdf, manager, repository, validationMessagesService) {
|
|
6188
6259
|
this.fb = fb;
|
|
6189
6260
|
this.cdf = cdf;
|
|
6190
6261
|
this.manager = manager;
|
|
6191
6262
|
this.repository = repository;
|
|
6263
|
+
this.validationMessagesService = validationMessagesService;
|
|
6192
6264
|
}
|
|
6193
6265
|
ngOnInit() {
|
|
6194
6266
|
if (this.config != null) {
|
|
@@ -6270,7 +6342,9 @@ class FormGroupComponent {
|
|
|
6270
6342
|
}
|
|
6271
6343
|
}
|
|
6272
6344
|
const options = { updateOn: this.config?.behaviors?.updateOn ?? 'change' };
|
|
6273
|
-
|
|
6345
|
+
const formGroup = this.fb.group(controlsConfig, options);
|
|
6346
|
+
this.validationMessagesService.initialize(this.config, formGroup);
|
|
6347
|
+
this.viewdata = new SmzFormViewdata(this.config, formGroup, this.manager, this.cdf, this.validationMessagesService);
|
|
6274
6348
|
if (this.config.context == null) {
|
|
6275
6349
|
this.config.context = {
|
|
6276
6350
|
applyGlobalStyles: null,
|
|
@@ -6561,13 +6635,13 @@ class FormGroupComponent {
|
|
|
6561
6635
|
this.isComponentActive = false;
|
|
6562
6636
|
this.repository.remove(this.config);
|
|
6563
6637
|
}
|
|
6564
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: FormGroupComponent, deps: [{ token: i1$3.UntypedFormBuilder }, { token: i0.ChangeDetectorRef }, { token: SmzFormsManagerService }, { token: SmzFormsRepositoryService }], target: i0.ɵɵFactoryTarget.Component });
|
|
6565
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: FormGroupComponent, isStandalone: false, selector: "smz-form-group", inputs: { config: "config" }, outputs: { statusChanges: "statusChanges", initialStateChanged: "initialStateChanged", previousStateChanged: "previousStateChanged", submit: "submit" }, usesOnChanges: true, ngImport: i0, template: "@if (config != null) {\r\n <div class=\"smz_form_grid_container\">\r\n @if (viewdata?.form != null && !configHasErrors) {\r\n <form focusFirstInput [focus]=\"!config.behaviors.avoidFocusOnLoad\" [formGroup]=\"viewdata.form\" class=\"smz_form__wrapper\" (submit)=\"$event.preventDefault()\" (keydown.enter)=\"onEnter($event)\">\r\n <ng-container *ngTemplateOutlet=\"groupTemplate\"></ng-container>\r\n </form>\r\n }\r\n @if (configHasErrors) {\r\n <div>Error</div>\r\n }\r\n </div>\r\n}\r\n\r\n<ng-template #groupTemplate>\r\n\r\n <div class=\"w-full px-0 mx-auto\">\r\n <div class=\"grid grid-nogutter flex-wrap items-start justify-start flex-gap-2\" [ngClass]=\"config.template | setTemplateClasses : ['horizontalAlignment', 'verticalAlignment']\">\r\n @for (group of config.groups; track group) {\r\n @if (!group.isHide) {\r\n <div class=\"col\" [ngClass]=\"group.template | setTemplateClasses : ['row']\">\r\n @if (group.showName) {\r\n <div class=\"smz__group_name\">{{ group.name }}</div>\r\n }\r\n <div [ngClass]=\"group.styleClass ?? 'grid grid-nogutter flex-wrap items-start justify-start flex-gap-2'\">\r\n @for (input of group.children; track input) {\r\n @if (input.isVisible) {\r\n <div class=\"input__control__wrapper col relative\" [ngClass]=\"input.template | setTemplateClasses : ['row'] : [input.styleClass, group.inputStyleClass]\">\r\n <ng-container *ngTemplateOutlet=\"inputTemplate; context: { $implicit: input }\"></ng-container>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n\r\n</ng-template>\r\n\r\n<ng-template #inputTemplate let-input>\r\n\r\n @if (input.type == controlTypes.PASSWORD) {\r\n <smz-input-password [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-password>\r\n }\r\n\r\n @if (input.type == controlTypes.TEXT_MASK) {\r\n <smz-input-mask [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-mask>\r\n }\r\n\r\n @if (input.type == controlTypes.TEXT) {\r\n <smz-input-text [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-text>\r\n }\r\n\r\n @if (input.type == controlTypes.LIST) {\r\n <smz-input-list [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-list>\r\n }\r\n\r\n @if (input.type == controlTypes.NUMBER) {\r\n <smz-input-number [input]=\"input\" [form]=\"viewdata.form\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-number>\r\n }\r\n\r\n @if (input.type == controlTypes.TEXT_AREA) {\r\n <smz-input-text-area [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-text-area>\r\n }\r\n\r\n @if (input.type == controlTypes.CONTENT_MASK) {\r\n <smz-input-content-mask [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-content-mask>\r\n }\r\n\r\n @if (input.type == controlTypes.TAG_AREA) {\r\n <input-tag-area [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></input-tag-area>\r\n }\r\n\r\n @if (input.type == controlTypes.AUTOCOMPLETE_TAG_AREA) {\r\n <smz-input-autocomplete-tag-area [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-autocomplete-tag-area>\r\n }\r\n\r\n @if (input.type == controlTypes.RADIO) {\r\n <smz-radio-button [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [formId]=\"config.formId\" [behaviors]=\"config.behaviors\"></smz-radio-button>\r\n }\r\n\r\n @if (input.type == controlTypes.SWITCH) {\r\n <smz-input-switch [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-switch>\r\n }\r\n\r\n @if (input.type == controlTypes.CHECKBOX) {\r\n <smz-checkbox [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [formId]=\"config.formId\" [behaviors]=\"config.behaviors\"></smz-checkbox>\r\n }\r\n\r\n @if (input.type == controlTypes.CHECKBOX_GROUP) {\r\n <smz-checkbox-group [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-checkbox-group>\r\n }\r\n\r\n @if (input.type == controlTypes.CALENDAR) {\r\n <smz-calendar [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-calendar>\r\n }\r\n\r\n @if (input.type == controlTypes.DROPDOWN) {\r\n <smz-dropdown [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [formId]=\"config.formId\" [behaviors]=\"config.behaviors\"></smz-dropdown>\r\n }\r\n\r\n @if (input.type == controlTypes.LINKED_DROPDOWN) {\r\n <smz-linked-dropdown [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [formId]=\"config.formId\" [behaviors]=\"config.behaviors\"></smz-linked-dropdown>\r\n }\r\n\r\n @if (input.type == controlTypes.FILE) {\r\n <smz-file-upload [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [form]=\"viewdata.form\" [behaviors]=\"config.behaviors\"></smz-file-upload>\r\n }\r\n\r\n @if (input.type == controlTypes.CURRENCY) {\r\n <smz-input-currency [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-currency>\r\n }\r\n\r\n @if (input.type == controlTypes.MULTI_SELECT) {\r\n <smz-multi-select [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [formId]=\"config.formId\" [behaviors]=\"config.behaviors\"></smz-multi-select>\r\n }\r\n\r\n @if (input.type == controlTypes.LINKED_MULTISELECT) {\r\n <smz-linked-multi-select [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [formId]=\"config.formId\" [behaviors]=\"config.behaviors\"></smz-linked-multi-select>\r\n }\r\n\r\n @if (input.type == controlTypes.COLOR_PICKER) {\r\n <smz-color-picker [input]=\"input\" [control]=\"$any(viewdata.form.controls[input.propertyName])\" [behaviors]=\"config.behaviors\"></smz-color-picker>\r\n }\r\n\r\n @if (input.type == controlTypes.TEXT_BUTTON) {\r\n <smz-input-text-button [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [viewdata]=\"viewdata\" [behaviors]=\"config.behaviors\"></smz-input-text-button>\r\n }\r\n\r\n @if (input.type == controlTypes.TREE) {\r\n <smz-input-tree [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [formId]=\"config.formId\" [behaviors]=\"config.behaviors\"></smz-input-tree>\r\n }\r\n\r\n</ng-template>\r\n", dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: CalendarComponent, selector: "smz-calendar", inputs: ["input", "control", "behaviors"] }, { kind: "component", type: CheckBoxComponent, selector: "smz-checkbox", inputs: ["input", "formId", "control", "behaviors"] }, { kind: "component", type: CheckBoxGroupComponent, selector: "smz-checkbox-group", inputs: ["input", "control", "behaviors"] }, { kind: "component", type: ColorPickerComponent, selector: "smz-color-picker", inputs: ["input", "control", "behaviors"] }, { kind: "component", type: DropdownComponent, selector: "smz-dropdown", inputs: ["input", "formId", "control", "behaviors"] }, { kind: "component", type: FileUploadComponent, selector: "smz-file-upload", inputs: ["input", "form", "control", "behaviors"], outputs: ["selectChange"] }, { kind: "directive", type: FormFocusFirstInputDirective, selector: "[focusFirstInput]", inputs: ["focus"] }, { kind: "component", type: InputCurrencyComponent, selector: "smz-input-currency", inputs: ["input", "control", "behaviors"] }, { kind: "component", type: InputListComponent, selector: "smz-input-list", inputs: ["input", "control", "behaviors"] }, { kind: "component", type: InputMaskComponent, selector: "smz-input-mask", inputs: ["input", "control", "behaviors"] }, { kind: "component", type: InputNumberComponent, selector: "smz-input-number", inputs: ["input", "control", "behaviors", "form"] }, { kind: "component", type: InputPasswordComponent, selector: "smz-input-password", inputs: ["input", "control", "behaviors"] }, { kind: "component", type: InputSwitchComponent, selector: "smz-input-switch", inputs: ["input", "control", "behaviors"] }, { kind: "component", type: InputTextAreaComponent, selector: "smz-input-text-area", inputs: ["input", "control", "behaviors"] }, { kind: "component", type: SmzInputAutocompleteTagArea, selector: "smz-input-autocomplete-tag-area", inputs: ["input", "control", "behaviors"] }, { kind: "component", type: InputTextComponent, selector: "smz-input-text", inputs: ["input", "control", "behaviors"] }, { kind: "component", type: InputTreeComponent, selector: "smz-input-tree", inputs: ["input", "formId", "control", "behaviors"] }, { kind: "component", type: LinkedDropdownComponent, selector: "smz-linked-dropdown", inputs: ["input", "formId", "control", "behaviors"] }, { kind: "component", type: LinkedMultiSelectComponent, selector: "smz-linked-multi-select", inputs: ["input", "formId", "control", "behaviors"] }, { kind: "component", type: MultiSelectComponent, selector: "smz-multi-select", inputs: ["input", "formId", "control", "behaviors"] }, { kind: "component", type: RadioButtonComponent, selector: "smz-radio-button", inputs: ["input", "formId", "control", "behaviors"] }, { kind: "component", type: InputTagAreaComponent, selector: "input-tag-area", inputs: ["input", "control", "behaviors"] }, { kind: "component", type: InputContentMaskComponent, selector: "smz-input-content-mask", inputs: ["input", "control", "behaviors"] }, { kind: "component", type: InputTextButtonComponent, selector: "smz-input-text-button", inputs: ["input", "control", "viewdata", "behaviors"] }, { kind: "pipe", type: SetTemplateClassesPipe, name: "setTemplateClasses" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
6638
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: FormGroupComponent, deps: [{ token: i1$3.UntypedFormBuilder }, { token: i0.ChangeDetectorRef }, { token: SmzFormsManagerService }, { token: SmzFormsRepositoryService }, { token: SmzFormValidationMessagesService }], target: i0.ɵɵFactoryTarget.Component });
|
|
6639
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: FormGroupComponent, isStandalone: false, selector: "smz-form-group", inputs: { config: "config" }, outputs: { statusChanges: "statusChanges", initialStateChanged: "initialStateChanged", previousStateChanged: "previousStateChanged", submit: "submit" }, providers: [SmzFormValidationMessagesService], usesOnChanges: true, ngImport: i0, template: "@if (config != null) {\r\n <div class=\"smz_form_grid_container\">\r\n @if (viewdata?.form != null && !configHasErrors) {\r\n <form focusFirstInput [focus]=\"!config.behaviors.avoidFocusOnLoad\" [formGroup]=\"viewdata.form\" class=\"smz_form__wrapper\" (submit)=\"$event.preventDefault()\" (keydown.enter)=\"onEnter($event)\">\r\n <ng-container *ngTemplateOutlet=\"groupTemplate\"></ng-container>\r\n </form>\r\n }\r\n @if (configHasErrors) {\r\n <div>Error</div>\r\n }\r\n </div>\r\n}\r\n\r\n<ng-template #groupTemplate>\r\n\r\n <div class=\"w-full px-0 mx-auto\">\r\n <div class=\"grid grid-nogutter flex-wrap items-start justify-start flex-gap-2\" [ngClass]=\"config.template | setTemplateClasses : ['horizontalAlignment', 'verticalAlignment']\">\r\n @for (group of config.groups; track group) {\r\n @if (!group.isHide) {\r\n <div class=\"col\" [ngClass]=\"group.template | setTemplateClasses : ['row']\">\r\n @if (group.showName) {\r\n <div class=\"smz__group_name\">{{ group.name }}</div>\r\n }\r\n <div [ngClass]=\"group.styleClass ?? 'grid grid-nogutter flex-wrap items-start justify-start flex-gap-2'\">\r\n @for (input of group.children; track input) {\r\n @if (input.isVisible) {\r\n <div class=\"input__control__wrapper col relative\" [ngClass]=\"input.template | setTemplateClasses : ['row'] : [input.styleClass, group.inputStyleClass]\">\r\n <ng-container *ngTemplateOutlet=\"inputTemplate; context: { $implicit: input }\"></ng-container>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n\r\n</ng-template>\r\n\r\n<ng-template #inputTemplate let-input>\r\n\r\n @if (input.type == controlTypes.PASSWORD) {\r\n <smz-input-password [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-password>\r\n }\r\n\r\n @if (input.type == controlTypes.TEXT_MASK) {\r\n <smz-input-mask [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-mask>\r\n }\r\n\r\n @if (input.type == controlTypes.TEXT) {\r\n <smz-input-text [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-text>\r\n }\r\n\r\n @if (input.type == controlTypes.LIST) {\r\n <smz-input-list [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-list>\r\n }\r\n\r\n @if (input.type == controlTypes.NUMBER) {\r\n <smz-input-number [input]=\"input\" [form]=\"viewdata.form\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-number>\r\n }\r\n\r\n @if (input.type == controlTypes.TEXT_AREA) {\r\n <smz-input-text-area [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-text-area>\r\n }\r\n\r\n @if (input.type == controlTypes.CONTENT_MASK) {\r\n <smz-input-content-mask [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-content-mask>\r\n }\r\n\r\n @if (input.type == controlTypes.TAG_AREA) {\r\n <input-tag-area [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></input-tag-area>\r\n }\r\n\r\n @if (input.type == controlTypes.AUTOCOMPLETE_TAG_AREA) {\r\n <smz-input-autocomplete-tag-area [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-autocomplete-tag-area>\r\n }\r\n\r\n @if (input.type == controlTypes.RADIO) {\r\n <smz-radio-button [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [formId]=\"config.formId\" [behaviors]=\"config.behaviors\"></smz-radio-button>\r\n }\r\n\r\n @if (input.type == controlTypes.SWITCH) {\r\n <smz-input-switch [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-switch>\r\n }\r\n\r\n @if (input.type == controlTypes.CHECKBOX) {\r\n <smz-checkbox [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [formId]=\"config.formId\" [behaviors]=\"config.behaviors\"></smz-checkbox>\r\n }\r\n\r\n @if (input.type == controlTypes.CHECKBOX_GROUP) {\r\n <smz-checkbox-group [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-checkbox-group>\r\n }\r\n\r\n @if (input.type == controlTypes.CALENDAR) {\r\n <smz-calendar [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-calendar>\r\n }\r\n\r\n @if (input.type == controlTypes.DROPDOWN) {\r\n <smz-dropdown [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [formId]=\"config.formId\" [behaviors]=\"config.behaviors\"></smz-dropdown>\r\n }\r\n\r\n @if (input.type == controlTypes.LINKED_DROPDOWN) {\r\n <smz-linked-dropdown [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [formId]=\"config.formId\" [behaviors]=\"config.behaviors\"></smz-linked-dropdown>\r\n }\r\n\r\n @if (input.type == controlTypes.FILE) {\r\n <smz-file-upload [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [form]=\"viewdata.form\" [behaviors]=\"config.behaviors\"></smz-file-upload>\r\n }\r\n\r\n @if (input.type == controlTypes.CURRENCY) {\r\n <smz-input-currency [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-currency>\r\n }\r\n\r\n @if (input.type == controlTypes.MULTI_SELECT) {\r\n <smz-multi-select [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [formId]=\"config.formId\" [behaviors]=\"config.behaviors\"></smz-multi-select>\r\n }\r\n\r\n @if (input.type == controlTypes.LINKED_MULTISELECT) {\r\n <smz-linked-multi-select [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [formId]=\"config.formId\" [behaviors]=\"config.behaviors\"></smz-linked-multi-select>\r\n }\r\n\r\n @if (input.type == controlTypes.COLOR_PICKER) {\r\n <smz-color-picker [input]=\"input\" [control]=\"$any(viewdata.form.controls[input.propertyName])\" [behaviors]=\"config.behaviors\"></smz-color-picker>\r\n }\r\n\r\n @if (input.type == controlTypes.TEXT_BUTTON) {\r\n <smz-input-text-button [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [viewdata]=\"viewdata\" [behaviors]=\"config.behaviors\"></smz-input-text-button>\r\n }\r\n\r\n @if (input.type == controlTypes.TREE) {\r\n <smz-input-tree [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [formId]=\"config.formId\" [behaviors]=\"config.behaviors\"></smz-input-tree>\r\n }\r\n\r\n</ng-template>\r\n", dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: CalendarComponent, selector: "smz-calendar", inputs: ["input", "control", "behaviors"] }, { kind: "component", type: CheckBoxComponent, selector: "smz-checkbox", inputs: ["input", "formId", "control", "behaviors"] }, { kind: "component", type: CheckBoxGroupComponent, selector: "smz-checkbox-group", inputs: ["input", "control", "behaviors"] }, { kind: "component", type: ColorPickerComponent, selector: "smz-color-picker", inputs: ["input", "control", "behaviors"] }, { kind: "component", type: DropdownComponent, selector: "smz-dropdown", inputs: ["input", "formId", "control", "behaviors"] }, { kind: "component", type: FileUploadComponent, selector: "smz-file-upload", inputs: ["input", "form", "control", "behaviors"], outputs: ["selectChange"] }, { kind: "directive", type: FormFocusFirstInputDirective, selector: "[focusFirstInput]", inputs: ["focus"] }, { kind: "component", type: InputCurrencyComponent, selector: "smz-input-currency", inputs: ["input", "control", "behaviors"] }, { kind: "component", type: InputListComponent, selector: "smz-input-list", inputs: ["input", "control", "behaviors"] }, { kind: "component", type: InputMaskComponent, selector: "smz-input-mask", inputs: ["input", "control", "behaviors"] }, { kind: "component", type: InputNumberComponent, selector: "smz-input-number", inputs: ["input", "control", "behaviors", "form"] }, { kind: "component", type: InputPasswordComponent, selector: "smz-input-password", inputs: ["input", "control", "behaviors"] }, { kind: "component", type: InputSwitchComponent, selector: "smz-input-switch", inputs: ["input", "control", "behaviors"] }, { kind: "component", type: InputTextAreaComponent, selector: "smz-input-text-area", inputs: ["input", "control", "behaviors"] }, { kind: "component", type: SmzInputAutocompleteTagArea, selector: "smz-input-autocomplete-tag-area", inputs: ["input", "control", "behaviors"] }, { kind: "component", type: InputTextComponent, selector: "smz-input-text", inputs: ["input", "control", "behaviors"] }, { kind: "component", type: InputTreeComponent, selector: "smz-input-tree", inputs: ["input", "formId", "control", "behaviors"] }, { kind: "component", type: LinkedDropdownComponent, selector: "smz-linked-dropdown", inputs: ["input", "formId", "control", "behaviors"] }, { kind: "component", type: LinkedMultiSelectComponent, selector: "smz-linked-multi-select", inputs: ["input", "formId", "control", "behaviors"] }, { kind: "component", type: MultiSelectComponent, selector: "smz-multi-select", inputs: ["input", "formId", "control", "behaviors"] }, { kind: "component", type: RadioButtonComponent, selector: "smz-radio-button", inputs: ["input", "formId", "control", "behaviors"] }, { kind: "component", type: InputTagAreaComponent, selector: "input-tag-area", inputs: ["input", "control", "behaviors"] }, { kind: "component", type: InputContentMaskComponent, selector: "smz-input-content-mask", inputs: ["input", "control", "behaviors"] }, { kind: "component", type: InputTextButtonComponent, selector: "smz-input-text-button", inputs: ["input", "control", "viewdata", "behaviors"] }, { kind: "pipe", type: SetTemplateClassesPipe, name: "setTemplateClasses" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
6566
6640
|
}
|
|
6567
6641
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: FormGroupComponent, decorators: [{
|
|
6568
6642
|
type: Component,
|
|
6569
|
-
args: [{ selector: 'smz-form-group', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "@if (config != null) {\r\n <div class=\"smz_form_grid_container\">\r\n @if (viewdata?.form != null && !configHasErrors) {\r\n <form focusFirstInput [focus]=\"!config.behaviors.avoidFocusOnLoad\" [formGroup]=\"viewdata.form\" class=\"smz_form__wrapper\" (submit)=\"$event.preventDefault()\" (keydown.enter)=\"onEnter($event)\">\r\n <ng-container *ngTemplateOutlet=\"groupTemplate\"></ng-container>\r\n </form>\r\n }\r\n @if (configHasErrors) {\r\n <div>Error</div>\r\n }\r\n </div>\r\n}\r\n\r\n<ng-template #groupTemplate>\r\n\r\n <div class=\"w-full px-0 mx-auto\">\r\n <div class=\"grid grid-nogutter flex-wrap items-start justify-start flex-gap-2\" [ngClass]=\"config.template | setTemplateClasses : ['horizontalAlignment', 'verticalAlignment']\">\r\n @for (group of config.groups; track group) {\r\n @if (!group.isHide) {\r\n <div class=\"col\" [ngClass]=\"group.template | setTemplateClasses : ['row']\">\r\n @if (group.showName) {\r\n <div class=\"smz__group_name\">{{ group.name }}</div>\r\n }\r\n <div [ngClass]=\"group.styleClass ?? 'grid grid-nogutter flex-wrap items-start justify-start flex-gap-2'\">\r\n @for (input of group.children; track input) {\r\n @if (input.isVisible) {\r\n <div class=\"input__control__wrapper col relative\" [ngClass]=\"input.template | setTemplateClasses : ['row'] : [input.styleClass, group.inputStyleClass]\">\r\n <ng-container *ngTemplateOutlet=\"inputTemplate; context: { $implicit: input }\"></ng-container>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n\r\n</ng-template>\r\n\r\n<ng-template #inputTemplate let-input>\r\n\r\n @if (input.type == controlTypes.PASSWORD) {\r\n <smz-input-password [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-password>\r\n }\r\n\r\n @if (input.type == controlTypes.TEXT_MASK) {\r\n <smz-input-mask [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-mask>\r\n }\r\n\r\n @if (input.type == controlTypes.TEXT) {\r\n <smz-input-text [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-text>\r\n }\r\n\r\n @if (input.type == controlTypes.LIST) {\r\n <smz-input-list [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-list>\r\n }\r\n\r\n @if (input.type == controlTypes.NUMBER) {\r\n <smz-input-number [input]=\"input\" [form]=\"viewdata.form\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-number>\r\n }\r\n\r\n @if (input.type == controlTypes.TEXT_AREA) {\r\n <smz-input-text-area [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-text-area>\r\n }\r\n\r\n @if (input.type == controlTypes.CONTENT_MASK) {\r\n <smz-input-content-mask [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-content-mask>\r\n }\r\n\r\n @if (input.type == controlTypes.TAG_AREA) {\r\n <input-tag-area [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></input-tag-area>\r\n }\r\n\r\n @if (input.type == controlTypes.AUTOCOMPLETE_TAG_AREA) {\r\n <smz-input-autocomplete-tag-area [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-autocomplete-tag-area>\r\n }\r\n\r\n @if (input.type == controlTypes.RADIO) {\r\n <smz-radio-button [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [formId]=\"config.formId\" [behaviors]=\"config.behaviors\"></smz-radio-button>\r\n }\r\n\r\n @if (input.type == controlTypes.SWITCH) {\r\n <smz-input-switch [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-switch>\r\n }\r\n\r\n @if (input.type == controlTypes.CHECKBOX) {\r\n <smz-checkbox [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [formId]=\"config.formId\" [behaviors]=\"config.behaviors\"></smz-checkbox>\r\n }\r\n\r\n @if (input.type == controlTypes.CHECKBOX_GROUP) {\r\n <smz-checkbox-group [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-checkbox-group>\r\n }\r\n\r\n @if (input.type == controlTypes.CALENDAR) {\r\n <smz-calendar [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-calendar>\r\n }\r\n\r\n @if (input.type == controlTypes.DROPDOWN) {\r\n <smz-dropdown [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [formId]=\"config.formId\" [behaviors]=\"config.behaviors\"></smz-dropdown>\r\n }\r\n\r\n @if (input.type == controlTypes.LINKED_DROPDOWN) {\r\n <smz-linked-dropdown [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [formId]=\"config.formId\" [behaviors]=\"config.behaviors\"></smz-linked-dropdown>\r\n }\r\n\r\n @if (input.type == controlTypes.FILE) {\r\n <smz-file-upload [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [form]=\"viewdata.form\" [behaviors]=\"config.behaviors\"></smz-file-upload>\r\n }\r\n\r\n @if (input.type == controlTypes.CURRENCY) {\r\n <smz-input-currency [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-currency>\r\n }\r\n\r\n @if (input.type == controlTypes.MULTI_SELECT) {\r\n <smz-multi-select [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [formId]=\"config.formId\" [behaviors]=\"config.behaviors\"></smz-multi-select>\r\n }\r\n\r\n @if (input.type == controlTypes.LINKED_MULTISELECT) {\r\n <smz-linked-multi-select [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [formId]=\"config.formId\" [behaviors]=\"config.behaviors\"></smz-linked-multi-select>\r\n }\r\n\r\n @if (input.type == controlTypes.COLOR_PICKER) {\r\n <smz-color-picker [input]=\"input\" [control]=\"$any(viewdata.form.controls[input.propertyName])\" [behaviors]=\"config.behaviors\"></smz-color-picker>\r\n }\r\n\r\n @if (input.type == controlTypes.TEXT_BUTTON) {\r\n <smz-input-text-button [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [viewdata]=\"viewdata\" [behaviors]=\"config.behaviors\"></smz-input-text-button>\r\n }\r\n\r\n @if (input.type == controlTypes.TREE) {\r\n <smz-input-tree [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [formId]=\"config.formId\" [behaviors]=\"config.behaviors\"></smz-input-tree>\r\n }\r\n\r\n</ng-template>\r\n" }]
|
|
6570
|
-
}], ctorParameters: () => [{ type: i1$3.UntypedFormBuilder }, { type: i0.ChangeDetectorRef }, { type: SmzFormsManagerService }, { type: SmzFormsRepositoryService }], propDecorators: { config: [{
|
|
6643
|
+
args: [{ selector: 'smz-form-group', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [SmzFormValidationMessagesService], standalone: false, template: "@if (config != null) {\r\n <div class=\"smz_form_grid_container\">\r\n @if (viewdata?.form != null && !configHasErrors) {\r\n <form focusFirstInput [focus]=\"!config.behaviors.avoidFocusOnLoad\" [formGroup]=\"viewdata.form\" class=\"smz_form__wrapper\" (submit)=\"$event.preventDefault()\" (keydown.enter)=\"onEnter($event)\">\r\n <ng-container *ngTemplateOutlet=\"groupTemplate\"></ng-container>\r\n </form>\r\n }\r\n @if (configHasErrors) {\r\n <div>Error</div>\r\n }\r\n </div>\r\n}\r\n\r\n<ng-template #groupTemplate>\r\n\r\n <div class=\"w-full px-0 mx-auto\">\r\n <div class=\"grid grid-nogutter flex-wrap items-start justify-start flex-gap-2\" [ngClass]=\"config.template | setTemplateClasses : ['horizontalAlignment', 'verticalAlignment']\">\r\n @for (group of config.groups; track group) {\r\n @if (!group.isHide) {\r\n <div class=\"col\" [ngClass]=\"group.template | setTemplateClasses : ['row']\">\r\n @if (group.showName) {\r\n <div class=\"smz__group_name\">{{ group.name }}</div>\r\n }\r\n <div [ngClass]=\"group.styleClass ?? 'grid grid-nogutter flex-wrap items-start justify-start flex-gap-2'\">\r\n @for (input of group.children; track input) {\r\n @if (input.isVisible) {\r\n <div class=\"input__control__wrapper col relative\" [ngClass]=\"input.template | setTemplateClasses : ['row'] : [input.styleClass, group.inputStyleClass]\">\r\n <ng-container *ngTemplateOutlet=\"inputTemplate; context: { $implicit: input }\"></ng-container>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n\r\n</ng-template>\r\n\r\n<ng-template #inputTemplate let-input>\r\n\r\n @if (input.type == controlTypes.PASSWORD) {\r\n <smz-input-password [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-password>\r\n }\r\n\r\n @if (input.type == controlTypes.TEXT_MASK) {\r\n <smz-input-mask [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-mask>\r\n }\r\n\r\n @if (input.type == controlTypes.TEXT) {\r\n <smz-input-text [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-text>\r\n }\r\n\r\n @if (input.type == controlTypes.LIST) {\r\n <smz-input-list [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-list>\r\n }\r\n\r\n @if (input.type == controlTypes.NUMBER) {\r\n <smz-input-number [input]=\"input\" [form]=\"viewdata.form\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-number>\r\n }\r\n\r\n @if (input.type == controlTypes.TEXT_AREA) {\r\n <smz-input-text-area [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-text-area>\r\n }\r\n\r\n @if (input.type == controlTypes.CONTENT_MASK) {\r\n <smz-input-content-mask [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-content-mask>\r\n }\r\n\r\n @if (input.type == controlTypes.TAG_AREA) {\r\n <input-tag-area [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></input-tag-area>\r\n }\r\n\r\n @if (input.type == controlTypes.AUTOCOMPLETE_TAG_AREA) {\r\n <smz-input-autocomplete-tag-area [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-autocomplete-tag-area>\r\n }\r\n\r\n @if (input.type == controlTypes.RADIO) {\r\n <smz-radio-button [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [formId]=\"config.formId\" [behaviors]=\"config.behaviors\"></smz-radio-button>\r\n }\r\n\r\n @if (input.type == controlTypes.SWITCH) {\r\n <smz-input-switch [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-switch>\r\n }\r\n\r\n @if (input.type == controlTypes.CHECKBOX) {\r\n <smz-checkbox [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [formId]=\"config.formId\" [behaviors]=\"config.behaviors\"></smz-checkbox>\r\n }\r\n\r\n @if (input.type == controlTypes.CHECKBOX_GROUP) {\r\n <smz-checkbox-group [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-checkbox-group>\r\n }\r\n\r\n @if (input.type == controlTypes.CALENDAR) {\r\n <smz-calendar [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-calendar>\r\n }\r\n\r\n @if (input.type == controlTypes.DROPDOWN) {\r\n <smz-dropdown [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [formId]=\"config.formId\" [behaviors]=\"config.behaviors\"></smz-dropdown>\r\n }\r\n\r\n @if (input.type == controlTypes.LINKED_DROPDOWN) {\r\n <smz-linked-dropdown [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [formId]=\"config.formId\" [behaviors]=\"config.behaviors\"></smz-linked-dropdown>\r\n }\r\n\r\n @if (input.type == controlTypes.FILE) {\r\n <smz-file-upload [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [form]=\"viewdata.form\" [behaviors]=\"config.behaviors\"></smz-file-upload>\r\n }\r\n\r\n @if (input.type == controlTypes.CURRENCY) {\r\n <smz-input-currency [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [behaviors]=\"config.behaviors\"></smz-input-currency>\r\n }\r\n\r\n @if (input.type == controlTypes.MULTI_SELECT) {\r\n <smz-multi-select [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [formId]=\"config.formId\" [behaviors]=\"config.behaviors\"></smz-multi-select>\r\n }\r\n\r\n @if (input.type == controlTypes.LINKED_MULTISELECT) {\r\n <smz-linked-multi-select [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [formId]=\"config.formId\" [behaviors]=\"config.behaviors\"></smz-linked-multi-select>\r\n }\r\n\r\n @if (input.type == controlTypes.COLOR_PICKER) {\r\n <smz-color-picker [input]=\"input\" [control]=\"$any(viewdata.form.controls[input.propertyName])\" [behaviors]=\"config.behaviors\"></smz-color-picker>\r\n }\r\n\r\n @if (input.type == controlTypes.TEXT_BUTTON) {\r\n <smz-input-text-button [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [viewdata]=\"viewdata\" [behaviors]=\"config.behaviors\"></smz-input-text-button>\r\n }\r\n\r\n @if (input.type == controlTypes.TREE) {\r\n <smz-input-tree [input]=\"input\" [control]=\"getFormControl(input.propertyName)\" [formId]=\"config.formId\" [behaviors]=\"config.behaviors\"></smz-input-tree>\r\n }\r\n\r\n</ng-template>\r\n" }]
|
|
6644
|
+
}], ctorParameters: () => [{ type: i1$3.UntypedFormBuilder }, { type: i0.ChangeDetectorRef }, { type: SmzFormsManagerService }, { type: SmzFormsRepositoryService }, { type: SmzFormValidationMessagesService }], propDecorators: { config: [{
|
|
6571
6645
|
type: Input
|
|
6572
6646
|
}], statusChanges: [{
|
|
6573
6647
|
type: Output
|
|
@@ -7969,7 +8043,6 @@ class NgxSmzFormsModule {
|
|
|
7969
8043
|
MultiSelectComponent,
|
|
7970
8044
|
RadioButtonComponent,
|
|
7971
8045
|
ValidationMessagesComponent,
|
|
7972
|
-
ValidationMessagesPipe$1,
|
|
7973
8046
|
FileDragDropDirective,
|
|
7974
8047
|
FileNameShortenPipe,
|
|
7975
8048
|
InputTagAreaComponent,
|
|
@@ -8102,7 +8175,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
8102
8175
|
MultiSelectComponent,
|
|
8103
8176
|
RadioButtonComponent,
|
|
8104
8177
|
ValidationMessagesComponent,
|
|
8105
|
-
ValidationMessagesPipe$1,
|
|
8106
8178
|
FileDragDropDirective,
|
|
8107
8179
|
FileNameShortenPipe,
|
|
8108
8180
|
InputTagAreaComponent,
|
|
@@ -12276,7 +12348,7 @@ class TableHelperService {
|
|
|
12276
12348
|
return this.tables[key];
|
|
12277
12349
|
}
|
|
12278
12350
|
else {
|
|
12279
|
-
const resultCloned = cloneDeep
|
|
12351
|
+
const resultCloned = cloneDeep(result);
|
|
12280
12352
|
synchronizeTable(resultCloned, this.tables[key]);
|
|
12281
12353
|
this.tables[key] = resultCloned;
|
|
12282
12354
|
return this.tables[key];
|
|
@@ -25097,6 +25169,47 @@ class SmzFormTooltipHelpBuilder {
|
|
|
25097
25169
|
}
|
|
25098
25170
|
}
|
|
25099
25171
|
|
|
25172
|
+
class SmzFormConditionalTooltipBuilder {
|
|
25173
|
+
inputBuilder;
|
|
25174
|
+
inputRef;
|
|
25175
|
+
resolveMessage;
|
|
25176
|
+
styleClass = 'fa-solid fa-exclamation-triangle text-red-500';
|
|
25177
|
+
position = 'top';
|
|
25178
|
+
constructor(inputBuilder, inputRef, resolveMessage) {
|
|
25179
|
+
this.inputBuilder = inputBuilder;
|
|
25180
|
+
this.inputRef = inputRef;
|
|
25181
|
+
this.resolveMessage = resolveMessage;
|
|
25182
|
+
this.inputRef.warningFunction = this.resolveMessage;
|
|
25183
|
+
this.initializeTooltip();
|
|
25184
|
+
}
|
|
25185
|
+
initializeTooltip() {
|
|
25186
|
+
this.inputRef.warning = signal({
|
|
25187
|
+
value: null,
|
|
25188
|
+
styleClass: this.styleClass,
|
|
25189
|
+
position: this.position
|
|
25190
|
+
}, ...(ngDevMode ? [{ debugName: "warning" }] : []));
|
|
25191
|
+
}
|
|
25192
|
+
withStyleClass(styleClass) {
|
|
25193
|
+
this.styleClass = styleClass;
|
|
25194
|
+
this.inputRef.warning?.update((previous) => ({
|
|
25195
|
+
...previous,
|
|
25196
|
+
styleClass: this.styleClass
|
|
25197
|
+
}));
|
|
25198
|
+
return this;
|
|
25199
|
+
}
|
|
25200
|
+
withPosition(position) {
|
|
25201
|
+
this.position = position;
|
|
25202
|
+
this.inputRef.warning?.update((previous) => ({
|
|
25203
|
+
...previous,
|
|
25204
|
+
position: this.position
|
|
25205
|
+
}));
|
|
25206
|
+
return this;
|
|
25207
|
+
}
|
|
25208
|
+
get input() {
|
|
25209
|
+
return this.inputBuilder;
|
|
25210
|
+
}
|
|
25211
|
+
}
|
|
25212
|
+
|
|
25100
25213
|
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-return, @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type, @typescript-eslint/typedef, no-underscore-dangle, no-console, eqeqeq, @typescript-eslint/no-unused-vars, @typescript-eslint/no-useless-constructor, @typescript-eslint/explicit-member-accessibility, max-len, no-prototype-builtins, @typescript-eslint/no-shadow, @typescript-eslint/no-empty-object-type */
|
|
25101
25214
|
class SmzFormGroupBuilder extends SmzBuilderUtilities {
|
|
25102
25215
|
formBuilderRef;
|
|
@@ -25735,10 +25848,8 @@ class SmzFormInputBuilder {
|
|
|
25735
25848
|
this.inputRef.advancedSettings.overrideResponseFormat = format;
|
|
25736
25849
|
return this.that;
|
|
25737
25850
|
}
|
|
25738
|
-
|
|
25739
|
-
this.inputRef
|
|
25740
|
-
this.inputRef.warning = signal({ value: null, styleClass, position }, ...(ngDevMode ? [{ debugName: "warning" }] : []));
|
|
25741
|
-
return this.that;
|
|
25851
|
+
withConditionalTooltip(resolveMessage) {
|
|
25852
|
+
return new SmzFormConditionalTooltipBuilder(this.that, this.inputRef, resolveMessage);
|
|
25742
25853
|
}
|
|
25743
25854
|
withHelp(message) {
|
|
25744
25855
|
return new SmzFormTooltipHelpBuilder(this.that, this.inputRef, message);
|
|
@@ -26952,13 +27063,24 @@ class SmzFormTreeBuilder extends SmzFormInputBuilder {
|
|
|
26952
27063
|
function extractUniqueTypesFromNodes(nodes) {
|
|
26953
27064
|
const types = [];
|
|
26954
27065
|
function traverseAndCollectTypes(currentNode) {
|
|
26955
|
-
|
|
26956
|
-
|
|
27066
|
+
const templateKey = currentNode.type != null && String(currentNode.type).length > 0
|
|
27067
|
+
? currentNode.type
|
|
27068
|
+
: 'default';
|
|
27069
|
+
if (!types.includes(templateKey)) {
|
|
27070
|
+
types.push(templateKey);
|
|
26957
27071
|
}
|
|
26958
|
-
currentNode.children?.forEach(childNode =>
|
|
27072
|
+
currentNode.children?.forEach(childNode => {
|
|
27073
|
+
if (childNode != null) {
|
|
27074
|
+
traverseAndCollectTypes(childNode);
|
|
27075
|
+
}
|
|
27076
|
+
});
|
|
26959
27077
|
}
|
|
26960
27078
|
// Inicia a travessia para cada nodo raiz no array
|
|
26961
|
-
nodes.forEach(node =>
|
|
27079
|
+
nodes.forEach(node => {
|
|
27080
|
+
if (node != null) {
|
|
27081
|
+
traverseAndCollectTypes(node);
|
|
27082
|
+
}
|
|
27083
|
+
});
|
|
26962
27084
|
return types;
|
|
26963
27085
|
}
|
|
26964
27086
|
|
|
@@ -44327,7 +44449,7 @@ class TreeHelperService {
|
|
|
44327
44449
|
this.add(key, result);
|
|
44328
44450
|
}
|
|
44329
44451
|
else {
|
|
44330
|
-
const resultCloned = cloneDeep
|
|
44452
|
+
const resultCloned = cloneDeep(result);
|
|
44331
44453
|
synchronizeTrees(resultCloned, this.trees[key]);
|
|
44332
44454
|
this.trees[key] = resultCloned;
|
|
44333
44455
|
}
|