@eqproject/eqp-dynamic-module 2.6.54 → 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/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/package.json +1 -1
|
@@ -1928,8 +1928,8 @@ var LogicOperatorBoolean;
|
|
|
1928
1928
|
})(LogicOperatorBoolean || (LogicOperatorBoolean = {}));
|
|
1929
1929
|
var LogicOperatorListValue;
|
|
1930
1930
|
(function (LogicOperatorListValue) {
|
|
1931
|
-
LogicOperatorListValue[LogicOperatorListValue["
|
|
1932
|
-
LogicOperatorListValue[LogicOperatorListValue["
|
|
1931
|
+
LogicOperatorListValue[LogicOperatorListValue["CONTIENE ALMENO UNO"] = 11] = "CONTIENE ALMENO UNO";
|
|
1932
|
+
LogicOperatorListValue[LogicOperatorListValue["CONTIENE TUTTI"] = 12] = "CONTIENE TUTTI";
|
|
1933
1933
|
})(LogicOperatorListValue || (LogicOperatorListValue = {}));
|
|
1934
1934
|
var LogicOperatorImageSelector;
|
|
1935
1935
|
(function (LogicOperatorImageSelector) {
|
|
@@ -1948,6 +1948,8 @@ var LogicOperator;
|
|
|
1948
1948
|
LogicOperator[LogicOperator["<="] = 8] = "<=";
|
|
1949
1949
|
LogicOperator[LogicOperator["Si"] = 9] = "Si";
|
|
1950
1950
|
LogicOperator[LogicOperator["No"] = 10] = "No";
|
|
1951
|
+
LogicOperator[LogicOperator["CONTIENE ALMENO UNO"] = 11] = "CONTIENE ALMENO UNO";
|
|
1952
|
+
LogicOperator[LogicOperator["CONTIENE TUTTI"] = 12] = "CONTIENE TUTTI";
|
|
1951
1953
|
})(LogicOperator || (LogicOperator = {}));
|
|
1952
1954
|
|
|
1953
1955
|
class Trigger {
|
|
@@ -5443,24 +5445,36 @@ class AddFormRecordComponent {
|
|
|
5443
5445
|
this.logTrigger(trigger, condition, record);
|
|
5444
5446
|
return;
|
|
5445
5447
|
}
|
|
5448
|
+
if (logicOperator == LogicOperator['CONTIENE ALMENO UNO'] && !conditionValue.some(c => recordValue.includes(c))) {
|
|
5449
|
+
fireTrigger = false;
|
|
5450
|
+
this.logTrigger(trigger, condition, record);
|
|
5451
|
+
return;
|
|
5452
|
+
}
|
|
5453
|
+
if (logicOperator == LogicOperator['CONTIENE TUTTI'] && !conditionValue.every(c => recordValue.includes(c))) {
|
|
5454
|
+
fireTrigger = false;
|
|
5455
|
+
this.logTrigger(trigger, condition, record);
|
|
5456
|
+
return;
|
|
5457
|
+
}
|
|
5446
5458
|
});
|
|
5447
5459
|
GlobalService.debugLog("checkTriggers - fireTrigger? ", fireTrigger);
|
|
5448
5460
|
if (fireTrigger) {
|
|
5449
5461
|
// Il trigger va sparato. Valuto le funzioni interne
|
|
5450
5462
|
var formulas = JSON.parse(JSON.stringify(trigger.formulas));
|
|
5451
5463
|
GlobalService.debugLog("checkTriggers - evaluate formulas ", formulas);
|
|
5452
|
-
|
|
5453
|
-
|
|
5454
|
-
|
|
5455
|
-
|
|
5456
|
-
|
|
5457
|
-
|
|
5458
|
-
|
|
5459
|
-
|
|
5460
|
-
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
+
if (formulas != null && formulas.length > 0) {
|
|
5465
|
+
Object.keys(formulas).forEach((key) => {
|
|
5466
|
+
var formula = formulas[key].value;
|
|
5467
|
+
GlobalService.debugLog("checkTriggers - formulas[key] ", formulas[key]);
|
|
5468
|
+
var temp;
|
|
5469
|
+
if (formulas[key].type == TriggerPropertyTypeEnum.DMMODULE) {
|
|
5470
|
+
temp = formula;
|
|
5471
|
+
}
|
|
5472
|
+
else {
|
|
5473
|
+
temp = UtilityHelperService.EvaluateFieldFormula(formula, record, null);
|
|
5474
|
+
}
|
|
5475
|
+
formulas[key] = temp;
|
|
5476
|
+
});
|
|
5477
|
+
}
|
|
5464
5478
|
// Sparo il trigger all'esterno
|
|
5465
5479
|
var triggerToFire = new FireTrigger();
|
|
5466
5480
|
triggerToFire.form = this.form; // Il form che ha provocato il trigger
|
|
@@ -5468,7 +5482,7 @@ class AddFormRecordComponent {
|
|
|
5468
5482
|
triggerToFire.trigger = trigger; // Il trigger
|
|
5469
5483
|
triggerToFire.formulas = formulas; // Le formule inviate in input al modulo dinamico, valutate nel contesto del trigger e del record
|
|
5470
5484
|
triggerToFire.userPatient = this.userID; // UserID
|
|
5471
|
-
|
|
5485
|
+
console.log("checkTriggers - Trigger Fired ", triggerToFire.trigger.description, triggerToFire);
|
|
5472
5486
|
this.fireTrigger.emit(triggerToFire);
|
|
5473
5487
|
}
|
|
5474
5488
|
});
|
|
@@ -10839,6 +10853,67 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
10839
10853
|
type: Output
|
|
10840
10854
|
}] } });
|
|
10841
10855
|
|
|
10856
|
+
class ListValueTriggerTemplateComponent {
|
|
10857
|
+
constructor() {
|
|
10858
|
+
this.recordChange = new EventEmitter();
|
|
10859
|
+
this.triggerChange = new EventEmitter();
|
|
10860
|
+
this.logicOperatorListValue = LogicOperatorListValue;
|
|
10861
|
+
this.selectedLogicOperatorListValue = LogicOperatorListValue['CONTIENE ALMENO UNO'];
|
|
10862
|
+
this.booleanLogicOperatorType = BooleanLogicOperatorType;
|
|
10863
|
+
this.selectedBooleanLogicOperator = BooleanLogicOperatorType.AND;
|
|
10864
|
+
this.ListPresentationEnum = ListPresentationEnum;
|
|
10865
|
+
this.arrayData = [];
|
|
10866
|
+
}
|
|
10867
|
+
ngOnInit() {
|
|
10868
|
+
this.field = this.condition.Field;
|
|
10869
|
+
this.initStyles();
|
|
10870
|
+
this.setArrayData();
|
|
10871
|
+
console.log("CONDITION", this.condition, "ARRAYDATA", this.arrayData);
|
|
10872
|
+
}
|
|
10873
|
+
initStyles() {
|
|
10874
|
+
//Funzione per parsare il campo stylecss dell'oggetto field ed applicarlo all'html
|
|
10875
|
+
if (this.field.FieldstyleCSS != null || this.field.FieldstyleCSS != undefined)
|
|
10876
|
+
this.FieldstyleObj = UtilityHelperService.initStyles(this.field.FieldstyleCSS);
|
|
10877
|
+
if (this.field.LabelstyleCSS != null || this.field.LabelstyleCSS != undefined)
|
|
10878
|
+
this.LabelstyleObj = UtilityHelperService.initStyles(this.field.LabelstyleCSS);
|
|
10879
|
+
}
|
|
10880
|
+
/**
|
|
10881
|
+
* Metodo per emettere l'evento che il valore del record è cambiato.
|
|
10882
|
+
*/
|
|
10883
|
+
onTriggerChange() {
|
|
10884
|
+
let output = new Condition();
|
|
10885
|
+
output = {
|
|
10886
|
+
key: this.field.Name,
|
|
10887
|
+
value: this.condition.record[this.field.Name],
|
|
10888
|
+
logicoperator: this.selectedLogicOperatorListValue,
|
|
10889
|
+
fieldType: this.field.FieldType,
|
|
10890
|
+
booleanlogicoperator: this.selectedBooleanLogicOperator
|
|
10891
|
+
};
|
|
10892
|
+
this.triggerChange.emit(output);
|
|
10893
|
+
}
|
|
10894
|
+
setArrayData() {
|
|
10895
|
+
if (this.field.ValueString != null) {
|
|
10896
|
+
var arrayParts = this.field.ValueString.split(";");
|
|
10897
|
+
arrayParts.forEach((row) => {
|
|
10898
|
+
var values = row.split("|");
|
|
10899
|
+
this.arrayData.push({ Key: values[0], Value: values[1], Selected: false });
|
|
10900
|
+
});
|
|
10901
|
+
}
|
|
10902
|
+
}
|
|
10903
|
+
}
|
|
10904
|
+
ListValueTriggerTemplateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ListValueTriggerTemplateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
10905
|
+
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"] }] });
|
|
10906
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ListValueTriggerTemplateComponent, decorators: [{
|
|
10907
|
+
type: Component,
|
|
10908
|
+
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"] }]
|
|
10909
|
+
}], propDecorators: { condition: [{
|
|
10910
|
+
type: Input
|
|
10911
|
+
}], recordChange: [{
|
|
10912
|
+
type: Output
|
|
10913
|
+
}], triggerChange: [{
|
|
10914
|
+
type: Output
|
|
10915
|
+
}] } });
|
|
10916
|
+
|
|
10842
10917
|
class TextareaTriggerTemplateComponent {
|
|
10843
10918
|
constructor(voiceservice) {
|
|
10844
10919
|
this.voiceservice = voiceservice;
|
|
@@ -10976,10 +11051,10 @@ class DynamicModuleTriggerFixComponent {
|
|
|
10976
11051
|
}
|
|
10977
11052
|
}
|
|
10978
11053
|
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 });
|
|
10979
|
-
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"] }] });
|
|
11054
|
+
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"] }] });
|
|
10980
11055
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DynamicModuleTriggerFixComponent, decorators: [{
|
|
10981
11056
|
type: Component,
|
|
10982
|
-
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>" }]
|
|
11057
|
+
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>" }]
|
|
10983
11058
|
}], ctorParameters: function () { return [{ type: i1$3.MatDialog }]; }, propDecorators: { condition: [{
|
|
10984
11059
|
type: Input
|
|
10985
11060
|
}], form: [{
|
|
@@ -12434,134 +12509,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
12434
12509
|
args: ['listInnerFormRecords']
|
|
12435
12510
|
}] } });
|
|
12436
12511
|
|
|
12437
|
-
class ListValueTriggerTemplateComponent {
|
|
12438
|
-
constructor() {
|
|
12439
|
-
this.filterChange = new EventEmitter();
|
|
12440
|
-
this.validatorsArray = [];
|
|
12441
|
-
this.logicOperatorListValue = LogicOperatorListValue;
|
|
12442
|
-
this.activeCondition = false;
|
|
12443
|
-
this.booleanLogicOperatorType = BooleanLogicOperatorType;
|
|
12444
|
-
this.selectedBooleanLogicOperator = BooleanLogicOperatorType.AND;
|
|
12445
|
-
this.arrayData = [];
|
|
12446
|
-
}
|
|
12447
|
-
ngOnInit() {
|
|
12448
|
-
this.configureControllers();
|
|
12449
|
-
this.initStyles();
|
|
12450
|
-
this.setArrayData();
|
|
12451
|
-
}
|
|
12452
|
-
//Funzione per parsare il campo stylecss dell'oggetto field ed applicarlo all'html
|
|
12453
|
-
initStyles() {
|
|
12454
|
-
if (this.field.FieldstyleCSS != null || this.field.FieldstyleCSS != undefined)
|
|
12455
|
-
this.FieldstyleObj = UtilityHelperService.initStyles(this.field.FieldstyleCSS);
|
|
12456
|
-
}
|
|
12457
|
-
/**
|
|
12458
|
-
* Metodo per emettere l'evento che il valore del record è cambiato.
|
|
12459
|
-
*/
|
|
12460
|
-
onTriggerChange() {
|
|
12461
|
-
if (this.selectedLogicOperator != null) {
|
|
12462
|
-
this.activeCondition = true;
|
|
12463
|
-
this.filterChange.emit(this.generateCondition("active"));
|
|
12464
|
-
}
|
|
12465
|
-
if (this.activeCondition && this.selectedLogicOperator == null) {
|
|
12466
|
-
this.activeCondition = false;
|
|
12467
|
-
this.filterChange.emit(this.generateCondition("deactivated"));
|
|
12468
|
-
}
|
|
12469
|
-
}
|
|
12470
|
-
/**
|
|
12471
|
-
* Metodo che genera l'oggetto da inviare all'esterno
|
|
12472
|
-
*/
|
|
12473
|
-
generateCondition(mode) {
|
|
12474
|
-
let output = new Statistic();
|
|
12475
|
-
if (mode == "active") {
|
|
12476
|
-
output = {
|
|
12477
|
-
key: this.field.Name,
|
|
12478
|
-
value: this.record[this.field.Name],
|
|
12479
|
-
logicoperator: this.selectedLogicOperator,
|
|
12480
|
-
fieldtype: this.field.FieldType
|
|
12481
|
-
};
|
|
12482
|
-
}
|
|
12483
|
-
else {
|
|
12484
|
-
output = {
|
|
12485
|
-
key: this.field.Name,
|
|
12486
|
-
value: null,
|
|
12487
|
-
logicoperator: null,
|
|
12488
|
-
fieldtype: null
|
|
12489
|
-
};
|
|
12490
|
-
}
|
|
12491
|
-
return output;
|
|
12492
|
-
}
|
|
12493
|
-
/**
|
|
12494
|
-
* Metodo di aggiunta dei validator dell'input
|
|
12495
|
-
*/
|
|
12496
|
-
configureControllers() {
|
|
12497
|
-
this.validatorsArray = [];
|
|
12498
|
-
this.field.FormFormGroup.get([this.field.Name]).setValidators(this.validatorsArray);
|
|
12499
|
-
}
|
|
12500
|
-
/**
|
|
12501
|
-
* Metodo per creare un array di oggetti del tipo { Key: string, Value: any } da usare come sorgente dati per la eqp-select.
|
|
12502
|
-
*/
|
|
12503
|
-
setArrayData() {
|
|
12504
|
-
this.prepareValuePairs();
|
|
12505
|
-
if (this.field.ValuePairs != null) {
|
|
12506
|
-
if (UtilityHelperService.isNumeric(this.field.ValuePairs[Object.keys(this.field.ValuePairs)[0]])) {
|
|
12507
|
-
Object.keys(this.field.ValuePairs).forEach(k => this.createNumberArrayDataElement(k, Number(this.field.ValuePairs[k])));
|
|
12508
|
-
}
|
|
12509
|
-
else {
|
|
12510
|
-
Object.keys(this.field.ValuePairs).forEach(k => this.createArrayDataElement(k, this.field.ValuePairs[k]));
|
|
12511
|
-
}
|
|
12512
|
-
}
|
|
12513
|
-
}
|
|
12514
|
-
prepareValuePairs() {
|
|
12515
|
-
if (this.field.Formula) {
|
|
12516
|
-
this.field.ValuePairs = {};
|
|
12517
|
-
const temp = UtilityHelperService.EvaluateFieldFormula(this.field.Formula, this.record, null);
|
|
12518
|
-
// temp dovrebbe essere una stringa del tipo "chiave1! valore 1 ; chiave2 | valore 2 "
|
|
12519
|
-
// dobbiamo ottenere un dizionario di quei valori
|
|
12520
|
-
this.field.ValuePairs = GlobalService.stringToValuePairs(temp);
|
|
12521
|
-
//this.record[this.field.Name] = UtilityHelperService.EvaluateFieldFormula(this.field.Formula, this.record, null);
|
|
12522
|
-
}
|
|
12523
|
-
else if (this.field.ValuePairs != null && this.field.ValuePairs.lenght > 0) {
|
|
12524
|
-
// va bene così
|
|
12525
|
-
}
|
|
12526
|
-
else if (this.field.ValueString != null && this.field.ValueString != "") {
|
|
12527
|
-
// va presa la strigna e rimappata nel diario
|
|
12528
|
-
this.field.ValuePairs = GlobalService.stringToValuePairs(this.field.ValueString);
|
|
12529
|
-
}
|
|
12530
|
-
}
|
|
12531
|
-
createArrayDataElement(key, value, imgUrl = null) {
|
|
12532
|
-
let isOptionSelected;
|
|
12533
|
-
if (this.field.IsMultiChoiche && this.record[this.field.Name] && this.record[this.field.Name].length > 0) {
|
|
12534
|
-
isOptionSelected = !!this.record[this.field.Name].find(v => v == value);
|
|
12535
|
-
}
|
|
12536
|
-
else {
|
|
12537
|
-
isOptionSelected = this.record[this.field.Name] === value;
|
|
12538
|
-
}
|
|
12539
|
-
this.arrayData.push({ Key: key, Value: value, Selected: isOptionSelected, ImgUrl: imgUrl });
|
|
12540
|
-
}
|
|
12541
|
-
createNumberArrayDataElement(key, value, imgUrl = null) {
|
|
12542
|
-
let isOptionSelected;
|
|
12543
|
-
if (this.field.IsMultiChoiche && this.record[this.field.Name] && this.record[this.field.Name].length > 0) {
|
|
12544
|
-
isOptionSelected = !!this.record[this.field.Name].find(v => v == value);
|
|
12545
|
-
}
|
|
12546
|
-
else {
|
|
12547
|
-
isOptionSelected = this.record[this.field.Name] === value;
|
|
12548
|
-
}
|
|
12549
|
-
this.arrayData.push({ Key: key, Value: value, Selected: isOptionSelected, ImgUrl: imgUrl });
|
|
12550
|
-
}
|
|
12551
|
-
}
|
|
12552
|
-
ListValueTriggerTemplateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ListValueTriggerTemplateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
12553
|
-
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"] }] });
|
|
12554
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ListValueTriggerTemplateComponent, decorators: [{
|
|
12555
|
-
type: Component,
|
|
12556
|
-
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"] }]
|
|
12557
|
-
}], ctorParameters: function () { return []; }, propDecorators: { field: [{
|
|
12558
|
-
type: Input
|
|
12559
|
-
}], record: [{
|
|
12560
|
-
type: Input
|
|
12561
|
-
}], filterChange: [{
|
|
12562
|
-
type: Output
|
|
12563
|
-
}] } });
|
|
12564
|
-
|
|
12565
12512
|
class ListFormRecordTriggerTemplateComponent {
|
|
12566
12513
|
constructor() {
|
|
12567
12514
|
this.filterChange = new EventEmitter();
|