@eqproject/eqp-dynamic-module 2.6.53 → 2.6.55
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/esm2020/lib/components/private/form-records/add-form-record/add-form-record.component.mjs +26 -14
- package/esm2020/lib/components/private/trigger-creator/dynamic-module-trigger-fix/dynamic-module-trigger-fix.component.mjs +5 -4
- package/esm2020/lib/components/private/trigger-creator/trigger-templates/list-value-trigger-template/list-value-trigger-template.component.mjs +36 -105
- package/esm2020/lib/models/logicOperator.model.mjs +5 -3
- package/esm2020/lib/models/trigger.model.mjs +1 -1
- package/fesm2015/eqproject-eqp-dynamic-module.mjs +92 -145
- package/fesm2015/eqproject-eqp-dynamic-module.mjs.map +1 -1
- package/fesm2020/eqproject-eqp-dynamic-module.mjs +92 -145
- package/fesm2020/eqproject-eqp-dynamic-module.mjs.map +1 -1
- package/lib/components/private/trigger-creator/trigger-templates/list-value-trigger-template/list-value-trigger-template.component.d.ts +11 -27
- package/lib/models/logicOperator.model.d.ts +5 -3
- package/lib/models/trigger.model.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1933,8 +1933,8 @@ var LogicOperatorBoolean;
|
|
|
1933
1933
|
})(LogicOperatorBoolean || (LogicOperatorBoolean = {}));
|
|
1934
1934
|
var LogicOperatorListValue;
|
|
1935
1935
|
(function (LogicOperatorListValue) {
|
|
1936
|
-
LogicOperatorListValue[LogicOperatorListValue["
|
|
1937
|
-
LogicOperatorListValue[LogicOperatorListValue["
|
|
1936
|
+
LogicOperatorListValue[LogicOperatorListValue["CONTIENE ALMENO UNO"] = 11] = "CONTIENE ALMENO UNO";
|
|
1937
|
+
LogicOperatorListValue[LogicOperatorListValue["CONTIENE TUTTI"] = 12] = "CONTIENE TUTTI";
|
|
1938
1938
|
})(LogicOperatorListValue || (LogicOperatorListValue = {}));
|
|
1939
1939
|
var LogicOperatorImageSelector;
|
|
1940
1940
|
(function (LogicOperatorImageSelector) {
|
|
@@ -1953,6 +1953,8 @@ var LogicOperator;
|
|
|
1953
1953
|
LogicOperator[LogicOperator["<="] = 8] = "<=";
|
|
1954
1954
|
LogicOperator[LogicOperator["Si"] = 9] = "Si";
|
|
1955
1955
|
LogicOperator[LogicOperator["No"] = 10] = "No";
|
|
1956
|
+
LogicOperator[LogicOperator["CONTIENE ALMENO UNO"] = 11] = "CONTIENE ALMENO UNO";
|
|
1957
|
+
LogicOperator[LogicOperator["CONTIENE TUTTI"] = 12] = "CONTIENE TUTTI";
|
|
1956
1958
|
})(LogicOperator || (LogicOperator = {}));
|
|
1957
1959
|
|
|
1958
1960
|
class Trigger {
|
|
@@ -5461,24 +5463,36 @@ class AddFormRecordComponent {
|
|
|
5461
5463
|
this.logTrigger(trigger, condition, record);
|
|
5462
5464
|
return;
|
|
5463
5465
|
}
|
|
5466
|
+
if (logicOperator == LogicOperator['CONTIENE ALMENO UNO'] && !conditionValue.some(c => recordValue.includes(c))) {
|
|
5467
|
+
fireTrigger = false;
|
|
5468
|
+
this.logTrigger(trigger, condition, record);
|
|
5469
|
+
return;
|
|
5470
|
+
}
|
|
5471
|
+
if (logicOperator == LogicOperator['CONTIENE TUTTI'] && !conditionValue.every(c => recordValue.includes(c))) {
|
|
5472
|
+
fireTrigger = false;
|
|
5473
|
+
this.logTrigger(trigger, condition, record);
|
|
5474
|
+
return;
|
|
5475
|
+
}
|
|
5464
5476
|
});
|
|
5465
5477
|
GlobalService.debugLog("checkTriggers - fireTrigger? ", fireTrigger);
|
|
5466
5478
|
if (fireTrigger) {
|
|
5467
5479
|
// Il trigger va sparato. Valuto le funzioni interne
|
|
5468
5480
|
var formulas = JSON.parse(JSON.stringify(trigger.formulas));
|
|
5469
5481
|
GlobalService.debugLog("checkTriggers - evaluate formulas ", formulas);
|
|
5470
|
-
|
|
5471
|
-
|
|
5472
|
-
|
|
5473
|
-
|
|
5474
|
-
|
|
5475
|
-
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
+
if (formulas != null && formulas.length > 0) {
|
|
5483
|
+
Object.keys(formulas).forEach((key) => {
|
|
5484
|
+
var formula = formulas[key].value;
|
|
5485
|
+
GlobalService.debugLog("checkTriggers - formulas[key] ", formulas[key]);
|
|
5486
|
+
var temp;
|
|
5487
|
+
if (formulas[key].type == TriggerPropertyTypeEnum.DMMODULE) {
|
|
5488
|
+
temp = formula;
|
|
5489
|
+
}
|
|
5490
|
+
else {
|
|
5491
|
+
temp = UtilityHelperService.EvaluateFieldFormula(formula, record, null);
|
|
5492
|
+
}
|
|
5493
|
+
formulas[key] = temp;
|
|
5494
|
+
});
|
|
5495
|
+
}
|
|
5482
5496
|
// Sparo il trigger all'esterno
|
|
5483
5497
|
var triggerToFire = new FireTrigger();
|
|
5484
5498
|
triggerToFire.form = this.form; // Il form che ha provocato il trigger
|
|
@@ -5486,7 +5500,7 @@ class AddFormRecordComponent {
|
|
|
5486
5500
|
triggerToFire.trigger = trigger; // Il trigger
|
|
5487
5501
|
triggerToFire.formulas = formulas; // Le formule inviate in input al modulo dinamico, valutate nel contesto del trigger e del record
|
|
5488
5502
|
triggerToFire.userPatient = this.userID; // UserID
|
|
5489
|
-
|
|
5503
|
+
console.log("checkTriggers - Trigger Fired ", triggerToFire.trigger.description, triggerToFire);
|
|
5490
5504
|
this.fireTrigger.emit(triggerToFire);
|
|
5491
5505
|
}
|
|
5492
5506
|
});
|
|
@@ -10870,6 +10884,67 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
10870
10884
|
type: Output
|
|
10871
10885
|
}] } });
|
|
10872
10886
|
|
|
10887
|
+
class ListValueTriggerTemplateComponent {
|
|
10888
|
+
constructor() {
|
|
10889
|
+
this.recordChange = new EventEmitter();
|
|
10890
|
+
this.triggerChange = new EventEmitter();
|
|
10891
|
+
this.logicOperatorListValue = LogicOperatorListValue;
|
|
10892
|
+
this.selectedLogicOperatorListValue = LogicOperatorListValue['CONTIENE ALMENO UNO'];
|
|
10893
|
+
this.booleanLogicOperatorType = BooleanLogicOperatorType;
|
|
10894
|
+
this.selectedBooleanLogicOperator = BooleanLogicOperatorType.AND;
|
|
10895
|
+
this.ListPresentationEnum = ListPresentationEnum;
|
|
10896
|
+
this.arrayData = [];
|
|
10897
|
+
}
|
|
10898
|
+
ngOnInit() {
|
|
10899
|
+
this.field = this.condition.Field;
|
|
10900
|
+
this.initStyles();
|
|
10901
|
+
this.setArrayData();
|
|
10902
|
+
console.log("CONDITION", this.condition, "ARRAYDATA", this.arrayData);
|
|
10903
|
+
}
|
|
10904
|
+
initStyles() {
|
|
10905
|
+
//Funzione per parsare il campo stylecss dell'oggetto field ed applicarlo all'html
|
|
10906
|
+
if (this.field.FieldstyleCSS != null || this.field.FieldstyleCSS != undefined)
|
|
10907
|
+
this.FieldstyleObj = UtilityHelperService.initStyles(this.field.FieldstyleCSS);
|
|
10908
|
+
if (this.field.LabelstyleCSS != null || this.field.LabelstyleCSS != undefined)
|
|
10909
|
+
this.LabelstyleObj = UtilityHelperService.initStyles(this.field.LabelstyleCSS);
|
|
10910
|
+
}
|
|
10911
|
+
/**
|
|
10912
|
+
* Metodo per emettere l'evento che il valore del record è cambiato.
|
|
10913
|
+
*/
|
|
10914
|
+
onTriggerChange() {
|
|
10915
|
+
let output = new Condition();
|
|
10916
|
+
output = {
|
|
10917
|
+
key: this.field.Name,
|
|
10918
|
+
value: this.condition.record[this.field.Name],
|
|
10919
|
+
logicoperator: this.selectedLogicOperatorListValue,
|
|
10920
|
+
fieldType: this.field.FieldType,
|
|
10921
|
+
booleanlogicoperator: this.selectedBooleanLogicOperator
|
|
10922
|
+
};
|
|
10923
|
+
this.triggerChange.emit(output);
|
|
10924
|
+
}
|
|
10925
|
+
setArrayData() {
|
|
10926
|
+
if (this.field.ValueString != null) {
|
|
10927
|
+
var arrayParts = this.field.ValueString.split(";");
|
|
10928
|
+
arrayParts.forEach((row) => {
|
|
10929
|
+
var values = row.split("|");
|
|
10930
|
+
this.arrayData.push({ Key: values[0], Value: values[1], Selected: false });
|
|
10931
|
+
});
|
|
10932
|
+
}
|
|
10933
|
+
}
|
|
10934
|
+
}
|
|
10935
|
+
ListValueTriggerTemplateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ListValueTriggerTemplateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
10936
|
+
ListValueTriggerTemplateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ListValueTriggerTemplateComponent, selector: "list-value-trigger-template", inputs: { condition: "condition" }, outputs: { recordChange: "recordChange", triggerChange: "triggerChange" }, ngImport: i0, template: "<div class=\"row\">\r\n <div class=\"col-md-3 operatorCol\">\r\n <eqp-select [enumData]=\"logicOperatorListValue\" [(ngModelInput)]=\"selectedLogicOperatorListValue\" (ngModelInputChange)=\"onTriggerChange()\"></eqp-select>\r\n </div>\r\n <div class=\"col-md-6 valueCol\">\r\n\r\n <eqp-select [ngStyle]=\"FieldstyleObj\" *ngIf=\"field.PresentationMode == ListPresentationEnum['Combo box']\" [arrayData]=\"arrayData\"\r\n [arrayKeyProperty]=\"'Value'\" [showCancelButton]=\"!field.Required\" [arrayValueProperty]=\"'Key'\"\r\n [includeFullObject]=\"false\" [isRequired]=\"true\"\r\n [(ngModelInput)]=\"condition.record[field.Name]\" [isMultiSelect]=\"field.IsMultiChoiche\">\r\n </eqp-select>\r\n\r\n </div>\r\n <div class=\"col-md-3 operatorCol\">\r\n <eqp-select [enumData]=\"booleanLogicOperatorType\" [(ngModelInput)]=\"selectedBooleanLogicOperator\" (ngModelInputChange)=\"onTriggerChange()\"></eqp-select>\r\n </div> \r\n</div>", styles: [".valueCol{padding-right:0}.operatorCol{padding-left:0}::ng-deep .operatorCol .mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#a5afc0!important}::ng-deep .operatorCol .mat-mdc-select-value{color:#081c45;font-size:16px;font-weight:700;position:relative;top:-6px}::ng-deep eqp-select .mat-form-field-appearance-fill.ng-touched label.mdc-floating-label.mat-mdc-floating-label{background-color:transparent!important}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i7.EqpSelectComponent, selector: "eqp-select", inputs: ["placeholder", "enumData", "enumDataToExclude", "arrayData", "arrayKeyProperty", "arrayValueProperty", "ngModelOptions", "ngModelInput", "formGroupInput", "formControlNameInput", "isRequired", "isDisabled", "isMultiLanguage", "multilanguagePrefixKey", "isAlphabeticalOrderable", "suffixIcon", "prefixIcon", "isMultiSelect", "includeFullObject", "showCancelButton", "isSearchable", "searchText", "noResultSearchText", "data"], outputs: ["ngModelInputChange"] }] });
|
|
10937
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ListValueTriggerTemplateComponent, decorators: [{
|
|
10938
|
+
type: Component,
|
|
10939
|
+
args: [{ selector: 'list-value-trigger-template', template: "<div class=\"row\">\r\n <div class=\"col-md-3 operatorCol\">\r\n <eqp-select [enumData]=\"logicOperatorListValue\" [(ngModelInput)]=\"selectedLogicOperatorListValue\" (ngModelInputChange)=\"onTriggerChange()\"></eqp-select>\r\n </div>\r\n <div class=\"col-md-6 valueCol\">\r\n\r\n <eqp-select [ngStyle]=\"FieldstyleObj\" *ngIf=\"field.PresentationMode == ListPresentationEnum['Combo box']\" [arrayData]=\"arrayData\"\r\n [arrayKeyProperty]=\"'Value'\" [showCancelButton]=\"!field.Required\" [arrayValueProperty]=\"'Key'\"\r\n [includeFullObject]=\"false\" [isRequired]=\"true\"\r\n [(ngModelInput)]=\"condition.record[field.Name]\" [isMultiSelect]=\"field.IsMultiChoiche\">\r\n </eqp-select>\r\n\r\n </div>\r\n <div class=\"col-md-3 operatorCol\">\r\n <eqp-select [enumData]=\"booleanLogicOperatorType\" [(ngModelInput)]=\"selectedBooleanLogicOperator\" (ngModelInputChange)=\"onTriggerChange()\"></eqp-select>\r\n </div> \r\n</div>", styles: [".valueCol{padding-right:0}.operatorCol{padding-left:0}::ng-deep .operatorCol .mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#a5afc0!important}::ng-deep .operatorCol .mat-mdc-select-value{color:#081c45;font-size:16px;font-weight:700;position:relative;top:-6px}::ng-deep eqp-select .mat-form-field-appearance-fill.ng-touched label.mdc-floating-label.mat-mdc-floating-label{background-color:transparent!important}\n"] }]
|
|
10940
|
+
}], propDecorators: { condition: [{
|
|
10941
|
+
type: Input
|
|
10942
|
+
}], recordChange: [{
|
|
10943
|
+
type: Output
|
|
10944
|
+
}], triggerChange: [{
|
|
10945
|
+
type: Output
|
|
10946
|
+
}] } });
|
|
10947
|
+
|
|
10873
10948
|
class TextareaTriggerTemplateComponent {
|
|
10874
10949
|
constructor(voiceservice) {
|
|
10875
10950
|
this.voiceservice = voiceservice;
|
|
@@ -11007,10 +11082,10 @@ class DynamicModuleTriggerFixComponent {
|
|
|
11007
11082
|
}
|
|
11008
11083
|
}
|
|
11009
11084
|
DynamicModuleTriggerFixComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DynamicModuleTriggerFixComponent, deps: [{ token: i1$3.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
|
|
11010
|
-
DynamicModuleTriggerFixComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: DynamicModuleTriggerFixComponent, selector: "dynamic-module-trigger-fix", inputs: { condition: "condition", form: "form" }, outputs: { triggerChange: "triggerChange" }, viewQueries: [{ propertyName: "dialogInnerFormRecord", first: true, predicate: ["dialogInnerFormRecord"], descendants: true, static: true }, { propertyName: "fieldTemplate", predicate: ["fieldTemplate"], descendants: true }, { propertyName: "listInnerFormRecords", predicate: ["listInnerFormRecords"], descendants: true }], ngImport: i0, template: "\r\n<text-trigger-template #fieldTemplate *ngIf=\"condition.Field.FieldType == FieldTypeEnum['Campo di testo']\"\r\n [condition]=\"condition\" (triggerChange)=\"onTriggerChange($event)\">\r\n</text-trigger-template>\r\n\r\n<numeric-trigger-template #fieldTemplate *ngIf=\"condition.Field.FieldType == FieldTypeEnum['Campo numerico']\"\r\n [condition]=\"condition\" (triggerChange)=\"onTriggerChange($event)\">\r\n</numeric-trigger-template>\r\n\r\n<textarea-trigger-template #fieldTemplate *ngIf=\"condition.Field.FieldType == FieldTypeEnum['Area di testo']\"\r\n [condition]=\"condition\" (triggerChange)=\"onTriggerChange($event)\">\r\n</textarea-trigger-template>\r\n\r\n<boolean-trigger-template #fieldTemplate *ngIf=\"condition.Field.FieldType == FieldTypeEnum['Booleano']\"\r\n [condition]=\"condition\" (triggerChange)=\"onTriggerChange($event)\">\r\n</boolean-trigger-template>\r\n\r\n<date-trigger-template #fieldTemplate *ngIf=\"condition.Field.FieldType == FieldTypeEnum['Data e/o ora']\"\r\n [condition]=\"condition\" (triggerChange)=\"onTriggerChange($event)\">\r\n</date-trigger-template>", styles: [""], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: TextTriggerTemplateComponent, selector: "text-trigger-template", inputs: ["condition"], outputs: ["recordChange", "triggerChange"] }, { kind: "component", type: NumericTriggerTemplateComponent, selector: "numeric-trigger-template", inputs: ["condition"], outputs: ["triggerChange"] }, { kind: "component", type: BooleanTriggerTemplateComponent, selector: "boolean-trigger-template", inputs: ["condition"], outputs: ["triggerChange"] }, { kind: "component", type: DateTriggerTemplateComponent, selector: "date-trigger-template", inputs: ["condition"], outputs: ["triggerChange"] }, { kind: "component", type: TextareaTriggerTemplateComponent, selector: "textarea-trigger-template", inputs: ["condition"], outputs: ["recordChange", "triggerChange"] }] });
|
|
11085
|
+
DynamicModuleTriggerFixComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: DynamicModuleTriggerFixComponent, selector: "dynamic-module-trigger-fix", inputs: { condition: "condition", form: "form" }, outputs: { triggerChange: "triggerChange" }, viewQueries: [{ propertyName: "dialogInnerFormRecord", first: true, predicate: ["dialogInnerFormRecord"], descendants: true, static: true }, { propertyName: "fieldTemplate", predicate: ["fieldTemplate"], descendants: true }, { propertyName: "listInnerFormRecords", predicate: ["listInnerFormRecords"], descendants: true }], ngImport: i0, template: "\r\n<text-trigger-template #fieldTemplate *ngIf=\"condition.Field.FieldType == FieldTypeEnum['Campo di testo']\"\r\n [condition]=\"condition\" (triggerChange)=\"onTriggerChange($event)\">\r\n</text-trigger-template>\r\n\r\n<numeric-trigger-template #fieldTemplate *ngIf=\"condition.Field.FieldType == FieldTypeEnum['Campo numerico']\"\r\n [condition]=\"condition\" (triggerChange)=\"onTriggerChange($event)\">\r\n</numeric-trigger-template>\r\n\r\n<textarea-trigger-template #fieldTemplate *ngIf=\"condition.Field.FieldType == FieldTypeEnum['Area di testo']\"\r\n [condition]=\"condition\" (triggerChange)=\"onTriggerChange($event)\">\r\n</textarea-trigger-template>\r\n\r\n<boolean-trigger-template #fieldTemplate *ngIf=\"condition.Field.FieldType == FieldTypeEnum['Booleano']\"\r\n [condition]=\"condition\" (triggerChange)=\"onTriggerChange($event)\">\r\n</boolean-trigger-template>\r\n\r\n<date-trigger-template #fieldTemplate *ngIf=\"condition.Field.FieldType == FieldTypeEnum['Data e/o ora']\"\r\n [condition]=\"condition\" (triggerChange)=\"onTriggerChange($event)\">\r\n</date-trigger-template>\r\n\r\n<list-value-trigger-template #fieldTemplate *ngIf=\"condition.Field.FieldType == FieldTypeEnum['Elenco generico']\"\r\n [condition]=\"condition\" (triggerChange)=\"onTriggerChange($event)\">\r\n</list-value-trigger-template>", styles: [""], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: TextTriggerTemplateComponent, selector: "text-trigger-template", inputs: ["condition"], outputs: ["recordChange", "triggerChange"] }, { kind: "component", type: NumericTriggerTemplateComponent, selector: "numeric-trigger-template", inputs: ["condition"], outputs: ["triggerChange"] }, { kind: "component", type: BooleanTriggerTemplateComponent, selector: "boolean-trigger-template", inputs: ["condition"], outputs: ["triggerChange"] }, { kind: "component", type: DateTriggerTemplateComponent, selector: "date-trigger-template", inputs: ["condition"], outputs: ["triggerChange"] }, { kind: "component", type: ListValueTriggerTemplateComponent, selector: "list-value-trigger-template", inputs: ["condition"], outputs: ["recordChange", "triggerChange"] }, { kind: "component", type: TextareaTriggerTemplateComponent, selector: "textarea-trigger-template", inputs: ["condition"], outputs: ["recordChange", "triggerChange"] }] });
|
|
11011
11086
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DynamicModuleTriggerFixComponent, decorators: [{
|
|
11012
11087
|
type: Component,
|
|
11013
|
-
args: [{ selector: 'dynamic-module-trigger-fix', template: "\r\n<text-trigger-template #fieldTemplate *ngIf=\"condition.Field.FieldType == FieldTypeEnum['Campo di testo']\"\r\n [condition]=\"condition\" (triggerChange)=\"onTriggerChange($event)\">\r\n</text-trigger-template>\r\n\r\n<numeric-trigger-template #fieldTemplate *ngIf=\"condition.Field.FieldType == FieldTypeEnum['Campo numerico']\"\r\n [condition]=\"condition\" (triggerChange)=\"onTriggerChange($event)\">\r\n</numeric-trigger-template>\r\n\r\n<textarea-trigger-template #fieldTemplate *ngIf=\"condition.Field.FieldType == FieldTypeEnum['Area di testo']\"\r\n [condition]=\"condition\" (triggerChange)=\"onTriggerChange($event)\">\r\n</textarea-trigger-template>\r\n\r\n<boolean-trigger-template #fieldTemplate *ngIf=\"condition.Field.FieldType == FieldTypeEnum['Booleano']\"\r\n [condition]=\"condition\" (triggerChange)=\"onTriggerChange($event)\">\r\n</boolean-trigger-template>\r\n\r\n<date-trigger-template #fieldTemplate *ngIf=\"condition.Field.FieldType == FieldTypeEnum['Data e/o ora']\"\r\n [condition]=\"condition\" (triggerChange)=\"onTriggerChange($event)\">\r\n</date-trigger-template>" }]
|
|
11088
|
+
args: [{ selector: 'dynamic-module-trigger-fix', template: "\r\n<text-trigger-template #fieldTemplate *ngIf=\"condition.Field.FieldType == FieldTypeEnum['Campo di testo']\"\r\n [condition]=\"condition\" (triggerChange)=\"onTriggerChange($event)\">\r\n</text-trigger-template>\r\n\r\n<numeric-trigger-template #fieldTemplate *ngIf=\"condition.Field.FieldType == FieldTypeEnum['Campo numerico']\"\r\n [condition]=\"condition\" (triggerChange)=\"onTriggerChange($event)\">\r\n</numeric-trigger-template>\r\n\r\n<textarea-trigger-template #fieldTemplate *ngIf=\"condition.Field.FieldType == FieldTypeEnum['Area di testo']\"\r\n [condition]=\"condition\" (triggerChange)=\"onTriggerChange($event)\">\r\n</textarea-trigger-template>\r\n\r\n<boolean-trigger-template #fieldTemplate *ngIf=\"condition.Field.FieldType == FieldTypeEnum['Booleano']\"\r\n [condition]=\"condition\" (triggerChange)=\"onTriggerChange($event)\">\r\n</boolean-trigger-template>\r\n\r\n<date-trigger-template #fieldTemplate *ngIf=\"condition.Field.FieldType == FieldTypeEnum['Data e/o ora']\"\r\n [condition]=\"condition\" (triggerChange)=\"onTriggerChange($event)\">\r\n</date-trigger-template>\r\n\r\n<list-value-trigger-template #fieldTemplate *ngIf=\"condition.Field.FieldType == FieldTypeEnum['Elenco generico']\"\r\n [condition]=\"condition\" (triggerChange)=\"onTriggerChange($event)\">\r\n</list-value-trigger-template>" }]
|
|
11014
11089
|
}], ctorParameters: function () { return [{ type: i1$3.MatDialog }]; }, propDecorators: { condition: [{
|
|
11015
11090
|
type: Input
|
|
11016
11091
|
}], form: [{
|
|
@@ -12465,134 +12540,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
12465
12540
|
args: ['listInnerFormRecords']
|
|
12466
12541
|
}] } });
|
|
12467
12542
|
|
|
12468
|
-
class ListValueTriggerTemplateComponent {
|
|
12469
|
-
constructor() {
|
|
12470
|
-
this.filterChange = new EventEmitter();
|
|
12471
|
-
this.validatorsArray = [];
|
|
12472
|
-
this.logicOperatorListValue = LogicOperatorListValue;
|
|
12473
|
-
this.activeCondition = false;
|
|
12474
|
-
this.booleanLogicOperatorType = BooleanLogicOperatorType;
|
|
12475
|
-
this.selectedBooleanLogicOperator = BooleanLogicOperatorType.AND;
|
|
12476
|
-
this.arrayData = [];
|
|
12477
|
-
}
|
|
12478
|
-
ngOnInit() {
|
|
12479
|
-
this.configureControllers();
|
|
12480
|
-
this.initStyles();
|
|
12481
|
-
this.setArrayData();
|
|
12482
|
-
}
|
|
12483
|
-
//Funzione per parsare il campo stylecss dell'oggetto field ed applicarlo all'html
|
|
12484
|
-
initStyles() {
|
|
12485
|
-
if (this.field.FieldstyleCSS != null || this.field.FieldstyleCSS != undefined)
|
|
12486
|
-
this.FieldstyleObj = UtilityHelperService.initStyles(this.field.FieldstyleCSS);
|
|
12487
|
-
}
|
|
12488
|
-
/**
|
|
12489
|
-
* Metodo per emettere l'evento che il valore del record è cambiato.
|
|
12490
|
-
*/
|
|
12491
|
-
onTriggerChange() {
|
|
12492
|
-
if (this.selectedLogicOperator != null) {
|
|
12493
|
-
this.activeCondition = true;
|
|
12494
|
-
this.filterChange.emit(this.generateCondition("active"));
|
|
12495
|
-
}
|
|
12496
|
-
if (this.activeCondition && this.selectedLogicOperator == null) {
|
|
12497
|
-
this.activeCondition = false;
|
|
12498
|
-
this.filterChange.emit(this.generateCondition("deactivated"));
|
|
12499
|
-
}
|
|
12500
|
-
}
|
|
12501
|
-
/**
|
|
12502
|
-
* Metodo che genera l'oggetto da inviare all'esterno
|
|
12503
|
-
*/
|
|
12504
|
-
generateCondition(mode) {
|
|
12505
|
-
let output = new Statistic();
|
|
12506
|
-
if (mode == "active") {
|
|
12507
|
-
output = {
|
|
12508
|
-
key: this.field.Name,
|
|
12509
|
-
value: this.record[this.field.Name],
|
|
12510
|
-
logicoperator: this.selectedLogicOperator,
|
|
12511
|
-
fieldtype: this.field.FieldType
|
|
12512
|
-
};
|
|
12513
|
-
}
|
|
12514
|
-
else {
|
|
12515
|
-
output = {
|
|
12516
|
-
key: this.field.Name,
|
|
12517
|
-
value: null,
|
|
12518
|
-
logicoperator: null,
|
|
12519
|
-
fieldtype: null
|
|
12520
|
-
};
|
|
12521
|
-
}
|
|
12522
|
-
return output;
|
|
12523
|
-
}
|
|
12524
|
-
/**
|
|
12525
|
-
* Metodo di aggiunta dei validator dell'input
|
|
12526
|
-
*/
|
|
12527
|
-
configureControllers() {
|
|
12528
|
-
this.validatorsArray = [];
|
|
12529
|
-
this.field.FormFormGroup.get([this.field.Name]).setValidators(this.validatorsArray);
|
|
12530
|
-
}
|
|
12531
|
-
/**
|
|
12532
|
-
* Metodo per creare un array di oggetti del tipo { Key: string, Value: any } da usare come sorgente dati per la eqp-select.
|
|
12533
|
-
*/
|
|
12534
|
-
setArrayData() {
|
|
12535
|
-
this.prepareValuePairs();
|
|
12536
|
-
if (this.field.ValuePairs != null) {
|
|
12537
|
-
if (UtilityHelperService.isNumeric(this.field.ValuePairs[Object.keys(this.field.ValuePairs)[0]])) {
|
|
12538
|
-
Object.keys(this.field.ValuePairs).forEach(k => this.createNumberArrayDataElement(k, Number(this.field.ValuePairs[k])));
|
|
12539
|
-
}
|
|
12540
|
-
else {
|
|
12541
|
-
Object.keys(this.field.ValuePairs).forEach(k => this.createArrayDataElement(k, this.field.ValuePairs[k]));
|
|
12542
|
-
}
|
|
12543
|
-
}
|
|
12544
|
-
}
|
|
12545
|
-
prepareValuePairs() {
|
|
12546
|
-
if (this.field.Formula) {
|
|
12547
|
-
this.field.ValuePairs = {};
|
|
12548
|
-
const temp = UtilityHelperService.EvaluateFieldFormula(this.field.Formula, this.record, null);
|
|
12549
|
-
// temp dovrebbe essere una stringa del tipo "chiave1! valore 1 ; chiave2 | valore 2 "
|
|
12550
|
-
// dobbiamo ottenere un dizionario di quei valori
|
|
12551
|
-
this.field.ValuePairs = GlobalService.stringToValuePairs(temp);
|
|
12552
|
-
//this.record[this.field.Name] = UtilityHelperService.EvaluateFieldFormula(this.field.Formula, this.record, null);
|
|
12553
|
-
}
|
|
12554
|
-
else if (this.field.ValuePairs != null && this.field.ValuePairs.lenght > 0) {
|
|
12555
|
-
// va bene così
|
|
12556
|
-
}
|
|
12557
|
-
else if (this.field.ValueString != null && this.field.ValueString != "") {
|
|
12558
|
-
// va presa la strigna e rimappata nel diario
|
|
12559
|
-
this.field.ValuePairs = GlobalService.stringToValuePairs(this.field.ValueString);
|
|
12560
|
-
}
|
|
12561
|
-
}
|
|
12562
|
-
createArrayDataElement(key, value, imgUrl = null) {
|
|
12563
|
-
let isOptionSelected;
|
|
12564
|
-
if (this.field.IsMultiChoiche && this.record[this.field.Name] && this.record[this.field.Name].length > 0) {
|
|
12565
|
-
isOptionSelected = !!this.record[this.field.Name].find(v => v == value);
|
|
12566
|
-
}
|
|
12567
|
-
else {
|
|
12568
|
-
isOptionSelected = this.record[this.field.Name] === value;
|
|
12569
|
-
}
|
|
12570
|
-
this.arrayData.push({ Key: key, Value: value, Selected: isOptionSelected, ImgUrl: imgUrl });
|
|
12571
|
-
}
|
|
12572
|
-
createNumberArrayDataElement(key, value, imgUrl = null) {
|
|
12573
|
-
let isOptionSelected;
|
|
12574
|
-
if (this.field.IsMultiChoiche && this.record[this.field.Name] && this.record[this.field.Name].length > 0) {
|
|
12575
|
-
isOptionSelected = !!this.record[this.field.Name].find(v => v == value);
|
|
12576
|
-
}
|
|
12577
|
-
else {
|
|
12578
|
-
isOptionSelected = this.record[this.field.Name] === value;
|
|
12579
|
-
}
|
|
12580
|
-
this.arrayData.push({ Key: key, Value: value, Selected: isOptionSelected, ImgUrl: imgUrl });
|
|
12581
|
-
}
|
|
12582
|
-
}
|
|
12583
|
-
ListValueTriggerTemplateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ListValueTriggerTemplateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
12584
|
-
ListValueTriggerTemplateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ListValueTriggerTemplateComponent, selector: "list-value-trigger-template", inputs: { field: "field", record: "record" }, outputs: { filterChange: "filterChange" }, ngImport: i0, template: "<div class=\"row\">\r\n <div class=\"col-md-6 valueCol\">\r\n <eqp-select [ngStyle]=\"FieldstyleObj\" [arrayData]=\"arrayData\"\r\n [arrayKeyProperty]=\"'Value'\" [showCancelButton]=\"true\" [arrayValueProperty]=\"'Key'\"\r\n [placeholder]=\"field.Description\"\r\n [includeFullObject]=\"false\" [isRequired]=\"false\" [isDisabled]=\"false\"\r\n [(ngModelInput)]=\"record[field.Name]\" [isMultiSelect]=\"false\"\r\n (ngModelInputChange)=\"onTriggerChange()\">\r\n </eqp-select>\r\n </div>\r\n <div class=\"col-md-3 operatorCol\">\r\n <eqp-select [enumData]=\"logicOperatorListValue\" [(ngModel)]=\"selectedLogicOperator\" (ngModelChange)=\"onTriggerChange()\"></eqp-select>\r\n </div>\r\n <div class=\"col-md-3 operatorCol\">\r\n <eqp-select [enumData]=\"booleanLogicOperatorType\" [(ngModel)]=\"selectedBooleanLogicOperator\" (ngModelChange)=\"onTriggerChange()\"></eqp-select>\r\n </div> \r\n</div>", styles: [".valueCol{padding-right:0}.operatorCol{padding-left:0}::ng-deep .operatorCol .mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#a5afc0!important}::ng-deep .operatorCol .mat-mdc-select-value{color:#081c45;font-size:16px;font-weight:700;position:relative;top:-6px}::ng-deep eqp-select .mat-form-field-appearance-fill.ng-touched label.mdc-floating-label.mat-mdc-floating-label{background-color:transparent!important}\n"], dependencies: [{ kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i7.EqpSelectComponent, selector: "eqp-select", inputs: ["placeholder", "enumData", "enumDataToExclude", "arrayData", "arrayKeyProperty", "arrayValueProperty", "ngModelOptions", "ngModelInput", "formGroupInput", "formControlNameInput", "isRequired", "isDisabled", "isMultiLanguage", "multilanguagePrefixKey", "isAlphabeticalOrderable", "suffixIcon", "prefixIcon", "isMultiSelect", "includeFullObject", "showCancelButton", "isSearchable", "searchText", "noResultSearchText", "data"], outputs: ["ngModelInputChange"] }] });
|
|
12585
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ListValueTriggerTemplateComponent, decorators: [{
|
|
12586
|
-
type: Component,
|
|
12587
|
-
args: [{ selector: 'list-value-trigger-template', template: "<div class=\"row\">\r\n <div class=\"col-md-6 valueCol\">\r\n <eqp-select [ngStyle]=\"FieldstyleObj\" [arrayData]=\"arrayData\"\r\n [arrayKeyProperty]=\"'Value'\" [showCancelButton]=\"true\" [arrayValueProperty]=\"'Key'\"\r\n [placeholder]=\"field.Description\"\r\n [includeFullObject]=\"false\" [isRequired]=\"false\" [isDisabled]=\"false\"\r\n [(ngModelInput)]=\"record[field.Name]\" [isMultiSelect]=\"false\"\r\n (ngModelInputChange)=\"onTriggerChange()\">\r\n </eqp-select>\r\n </div>\r\n <div class=\"col-md-3 operatorCol\">\r\n <eqp-select [enumData]=\"logicOperatorListValue\" [(ngModel)]=\"selectedLogicOperator\" (ngModelChange)=\"onTriggerChange()\"></eqp-select>\r\n </div>\r\n <div class=\"col-md-3 operatorCol\">\r\n <eqp-select [enumData]=\"booleanLogicOperatorType\" [(ngModel)]=\"selectedBooleanLogicOperator\" (ngModelChange)=\"onTriggerChange()\"></eqp-select>\r\n </div> \r\n</div>", styles: [".valueCol{padding-right:0}.operatorCol{padding-left:0}::ng-deep .operatorCol .mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#a5afc0!important}::ng-deep .operatorCol .mat-mdc-select-value{color:#081c45;font-size:16px;font-weight:700;position:relative;top:-6px}::ng-deep eqp-select .mat-form-field-appearance-fill.ng-touched label.mdc-floating-label.mat-mdc-floating-label{background-color:transparent!important}\n"] }]
|
|
12588
|
-
}], ctorParameters: function () { return []; }, propDecorators: { field: [{
|
|
12589
|
-
type: Input
|
|
12590
|
-
}], record: [{
|
|
12591
|
-
type: Input
|
|
12592
|
-
}], filterChange: [{
|
|
12593
|
-
type: Output
|
|
12594
|
-
}] } });
|
|
12595
|
-
|
|
12596
12543
|
class ListFormRecordTriggerTemplateComponent {
|
|
12597
12544
|
constructor() {
|
|
12598
12545
|
this.filterChange = new EventEmitter();
|