ngx-histaff-alpha 5.1.1 → 5.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.
@@ -7,7 +7,7 @@ import * as i1$1 from '@angular/common/http';
7
7
  import { HttpHeaders, HttpClient, HttpResponse, HTTP_INTERCEPTORS } from '@angular/common/http';
8
8
  import { last, map, tap, finalize, first, filter as filter$1, debounceTime as debounceTime$1, distinctUntilChanged as distinctUntilChanged$1, switchMap as switchMap$1 } from 'rxjs/operators';
9
9
  import * as i3 from '@angular/common';
10
- import { CommonModule, NgStyle, UpperCasePipe, AsyncPipe, LowerCasePipe, NgIf, NgTemplateOutlet } from '@angular/common';
10
+ import { CommonModule, NgStyle, UpperCasePipe, AsyncPipe, NgTemplateOutlet, LowerCasePipe, NgIf } from '@angular/common';
11
11
  import * as i1$4 from '@angular/forms';
12
12
  import { NG_VALUE_ACCESSOR, FormsModule, NgControl, ReactiveFormsModule, FormControl, FormGroup, Validators, FormArray } from '@angular/forms';
13
13
  import * as i1$2 from '@angular/router';
@@ -1668,6 +1668,7 @@ var EnumFormBaseContolType;
1668
1668
  EnumFormBaseContolType["SHIFTCOLLECTION"] = "SHIFTCOLLECTION";
1669
1669
  EnumFormBaseContolType["ORG_PARAM_DROPDOWN"] = "ORG_PARAM_DROPDOWN";
1670
1670
  EnumFormBaseContolType["REPORT_FORMAT"] = "REPORT_FORMAT";
1671
+ EnumFormBaseContolType["TOPICPICKER"] = "TOPICPICKER";
1671
1672
  })(EnumFormBaseContolType || (EnumFormBaseContolType = {}));
1672
1673
 
1673
1674
  class HubConnectionService {
@@ -8629,6 +8630,7 @@ var EnumCoreFormControlSeekerSourceType;
8629
8630
  EnumCoreFormControlSeekerSourceType["POSITION_SEEK"] = "POSITION_SEEK";
8630
8631
  EnumCoreFormControlSeekerSourceType["POSITION_CONCURRENT_SEEK"] = "POSITION_CONCURRENT_SEEK";
8631
8632
  EnumCoreFormControlSeekerSourceType["ORGANIZATION_UNIT_SEEK"] = "ORGANIZATION_UNIT_SEEK";
8633
+ EnumCoreFormControlSeekerSourceType["TOPICPICKER"] = "TOPICPICKER";
8632
8634
  })(EnumCoreFormControlSeekerSourceType || (EnumCoreFormControlSeekerSourceType = {}));
8633
8635
 
8634
8636
  class CoreReducerIconComponent {
@@ -19815,860 +19817,1406 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImpor
19815
19817
  ], template: "<div #container class=\"core-shift-cell-container\">\r\n @for (shift$ of shifts$$!; track $index) {\r\n <div #shiftSticker>\r\n <core-shift-sticker [shift$]=\"shift$\" [$shiftCellId]=\"shiftCellId\" [$width]=\"228\"\r\n [parentShifts$]=\"shifts$\" [$readOnly]=\"$readOnly()\"></core-shift-sticker>\r\n </div>\r\n }\r\n\r\n @if (!value?.length) {\r\n @if (!$hideStarterPlusSign()) {\r\n <div #firstAddWrapper class=\"first-add-wrapper\" (click)=\"onAdd($event)\" [class.pointer]=\"!$readOnly()\">\r\n <div class=\"icon-wrapper\" [class.hidden]=\"$readOnly()\">\r\n <i class=\"feather-plus\"></i>\r\n </div>\r\n </div>\r\n } @else {\r\n <div #firstAddWrapper class=\"first-add-wrapper\">\r\n {{ 'DROP_A_SHIFT_HERE' | translate: lang }}\r\n </div>\r\n }\r\n }\r\n\r\n\r\n\r\n</div>", styles: [".core-shift-cell-container{--first-add-height: 36.59px;--first-add-width: 228px;--first-add-border: 1px solid #E6EBED;--first-add-opacity: 1;--first-add-icon-width: 15px;--first-add-icon-height: 15px;--first-add-icon-border-radius: 50%;--first-add-icon-color: white;--first-add-icon-background-color: #3DC65A;--first-add-color: gray;padding:15px;background-color:transparent;animation:fadeIn .2s ease-in}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.core-shift-cell-container .first-add-wrapper{display:flex;align-items:center;justify-content:center;height:var(--first-add-height);box-sizing:border-box;min-width:105px;max-width:228px;opacity:var(--first-add-opacity);border:var(--first-add-border)}.core-shift-cell-container .first-add-wrapper .icon-wrapper{width:var(--first-add-icon-width);height:var(--first-add-icon-height);color:var(--first-add-icon-color);background-color:var(--first-add-icon-background-color);border-radius:var(--first-add-icon-border-radius)}.core-shift-cell-container .first-add-wrapper .icon-wrapper.hidden{display:none}.core-shift-cell-container .pointer{cursor:pointer}.core-shift-cell-container.valid-drop{background-color:#dff6dd}.core-shift-cell-container.invalid-drop{background-color:#f08080}\n"] }]
19816
19818
  }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: WorkShiftDndService }, { type: DialogService }, { type: MultiLanguageService }, { type: DndService }] });
19817
19819
 
19818
- class CoreControlComponent extends BaseComponent {
19819
- constructor(mls, alertService) {
19820
- super(mls);
19821
- this.mls = mls;
19822
- this.alertService = alertService;
19823
- this.errors = [];
19824
- this.isDevMode = isDevMode();
19825
- this.coreOrgTreeDefaultAccessorMode = EnumCoreOrgTreeaAccessorMode.CHECKED;
19826
- }
19827
- displayValidatorNameMathchingError() {
19828
- if (isDevMode()) {
19829
- this.alertService.error(`
19830
- '${this.control.field}' validator array definition error: validator name must equal Validators.&lt;key&gt;
19831
- `, noneAutoClosedAlertOptions);
19832
- }
19833
- }
19834
- checkError() {
19835
- if (!!this.rawControl?.errors) {
19836
- const newErrors = [];
19837
- Object.keys(this.form.controls[this.control.field].errors).forEach(key => {
19838
- /*
19839
- tanleica:
19840
- By custom design, custom error is an array
19841
- while built-in validator should produce an object error if any
19842
- */
19843
- if (this.form.controls[this.control.field].errors[key] instanceof Array) {
19844
- newErrors.push({
19845
- key: key,
19846
- errorMessage: this.form.controls[this.control.field].errors[key][1]
19820
+ var EnumCoreArticleCategoryTreeaAccessorMode;
19821
+ (function (EnumCoreArticleCategoryTreeaAccessorMode) {
19822
+ EnumCoreArticleCategoryTreeaAccessorMode["ACTIVATED_SINGLE"] = "ACTIVATED_SINGLE";
19823
+ EnumCoreArticleCategoryTreeaAccessorMode["ACTIVATED_INHERITANCE"] = "ACTIVATED_INHERITANCE";
19824
+ EnumCoreArticleCategoryTreeaAccessorMode["CHECKED"] = "CHECKED";
19825
+ })(EnumCoreArticleCategoryTreeaAccessorMode || (EnumCoreArticleCategoryTreeaAccessorMode = {}));
19826
+ class CoreTopicTreeComponent extends CoreFormControlBaseComponent {
19827
+ writeValue(obj) {
19828
+ this.value = obj;
19829
+ switch (this.accessorMode) {
19830
+ case EnumCoreArticleCategoryTreeaAccessorMode.CHECKED:
19831
+ if (!!obj) {
19832
+ const checkedKeys = [];
19833
+ this.checkedIds = obj; // <=== 24/10/2023
19834
+ obj.map(x => checkedKeys.push(x.toString()));
19835
+ this.loading = true;
19836
+ this.recursiveService.writeValueChecked(checkedKeys, this.data, this.disabledLoopExpand).subscribe(_ => {
19837
+ this.loading = false;
19838
+ if (!!this.data && !!this.data?.length)
19839
+ this.data[0].tree$Expanded = true;
19847
19840
  });
19848
19841
  }
19849
- else {
19850
- if (!!this.control.validators) {
19851
- const filter = this.control.validators?.filter(x => x.name.toLowerCase() === key.toLowerCase());
19852
- if (!!filter.length) {
19853
- newErrors.push({
19854
- key: key,
19855
- errorMessage: filter[0].errorMessage
19856
- });
19857
- }
19858
- else {
19859
- this.displayValidatorNameMathchingError();
19860
- }
19861
- }
19862
- else {
19863
- this.displayValidatorNameMathchingError();
19864
- }
19842
+ break;
19843
+ case EnumCoreArticleCategoryTreeaAccessorMode.ACTIVATED_SINGLE:
19844
+ case EnumCoreArticleCategoryTreeaAccessorMode.ACTIVATED_INHERITANCE:
19845
+ if (!!obj) {
19846
+ const activatedKeys = [];
19847
+ obj.map(x => activatedKeys.push(x.toString()));
19848
+ this.loading = true;
19849
+ this.recursiveService.writeValueActivated(activatedKeys, this.data, this.disabledLoopExpand).subscribe(_ => {
19850
+ this.loading = false;
19851
+ if (!!this.data && !!this.data?.length)
19852
+ this.data[0].tree$Expanded = true;
19853
+ });
19865
19854
  }
19866
- });
19867
- this.errors = newErrors;
19855
+ break;
19856
+ default:
19857
+ break;
19868
19858
  }
19869
- else {
19870
- this.errors = [];
19859
+ if (this.accessorMode === EnumCoreArticleCategoryTreeaAccessorMode.CHECKED) {
19871
19860
  }
19872
- }
19873
- resetError() {
19874
- this.errors = [];
19875
- }
19876
- ngOnInit() {
19877
- this.subscriptions.push(this.mls.lang$.subscribe(x => this.lang = x));
19878
- this.controlType = this.control.controlType;
19879
- this.required = !!this.control.validators?.filter(x => x.validator.name === 'required').length;
19880
- this.rawControl = this.form.get(this.control.field);
19881
- this.subscriptions.push(this.rawControl?.statusChanges.subscribe(_ => {
19882
- this.checkError();
19883
- }));
19884
- if (!!this.checkError$) {
19885
- this.subscriptions.push(this.checkError$.subscribe(x => {
19886
- if (x) {
19887
- this.checkError();
19888
- }
19889
- else {
19890
- this.resetError();
19891
- }
19892
- }));
19861
+ else /* EnumCoreOrgTreeaAccessorMode.ACTIVATED_SINGLE or EnumCoreOrgTreeaAccessorMode.ACTIVATED_INHERITANCE */ {
19893
19862
  }
19894
19863
  }
19895
- get isValid() { return this.form.controls[this.control.field].valid; }
19896
- onFocus(e) {
19897
- this.control.focus$?.next(e);
19898
- }
19899
- onBlur(e) {
19900
- this.control.blur$?.next(e);
19901
- }
19902
- oHandleClick(e) {
19903
- this.control.click$?.next(e);
19864
+ setDisabledState(disabled) {
19865
+ this.disabled = disabled;
19904
19866
  }
19905
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreControlComponent, deps: [{ token: MultiLanguageService }, { token: AlertService }], target: i0.ɵɵFactoryTarget.Component }); }
19906
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: CoreControlComponent, isStandalone: true, selector: "core-control", inputs: { control: "control", form: "form", checkError$: "checkError$", rangeLimit: "rangeLimit" }, usesInheritance: true, ngImport: i0, template: "<div class=\"core-control-container\">\r\n <div [formGroup]=\"form\" [class.hidden]=\"!!control.hidden\">\r\n\r\n <!-- START: LABEL SESSION-->\r\n <label [class]=\"'control-label' + (required ? ' required' : '')\" [attr.for]=\"control.field\"\r\n [class.avatar-label]=\"control.uploadFileType==='IMAGE_AVATAR'\" [appTooltip]=\"control.tooltip! | translate: lang\" [ngStyle]=\"{\r\n display: 'inline-block'\r\n }\">\r\n {{(control.controlType!=='CHECKBOX' && control.controlType!=='BUTTON') ? (control.label | translate: lang) : ''}}\r\n </label>\r\n\r\n @if (!!control.hint! && control.controlType !== 'CHECKBOX') {\r\n <i class=\"feather-help-circle\" [appTooltip]=\"control.hint!\" [ngStyle]=\"{\r\n display: 'inline-block',\r\n marginLeft: '2px'\r\n }\"></i>\r\n }\r\n\r\n <!-- START: LABEL SESSION-->\r\n\r\n <!-- START: FORM-CONTROL SESSION-->\r\n\r\n <ng-container>\r\n @switch (control.controlType) {\r\n @case (\"TEXTBOX\") {\r\n <input *ngIf=\"control.type==='date'\" [formControlName]=\"control.field\" [type]=\"control.type\"\r\n class=\"form-control\" [readonly]=\"control.readonly!\" useValueAsDate>\r\n \r\n <input *ngIf=\"control.type==='number'\" [formControlName]=\"control.field\" [type]=\"control.type\"\r\n class=\"form-control\" [readonly]=\"control.readonly\" [step]=\"control.step || '1'\">\r\n \r\n <input *ngIf=\"control.type!=='date' && control.type!=='number'\" [formControlName]=\"control.field\"\r\n [value]=\"form.get(control.field)?.value | tableCell: control.pipe : lang\" [type]=\"control.type\"\r\n class=\"form-control\" [readonly]=\"control.readonly\"\r\n [appTooltip]=\"form.get(control.field)?.value\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n >\r\n }\r\n @case (\"CURRENCY\") {\r\n <core-currency-input [formControlName]=\"control.field\"></core-currency-input>\r\n }\r\n @case (\"TEXTAREA\") {\r\n <textarea [rows]=\"control.textareaRows?.toString() || '3'\" [ngStyle]=\"{ height: 'unset' }\"\r\n [formControlName]=\"control.field\" class=\"form-control\" [readonly]=\"control.readonly\"></textarea>\r\n }\r\n @case (\"CHECKBOX\") {\r\n <core-checkbox [formControlName]=\"control.field\" [text]=\"control.label\"\r\n [inputValue]=\"control.value\"></core-checkbox>\r\n }\r\n @case (\"MCC\") {\r\n <core-mcc [formControlName]=\"control.field\" [columns]=\"control.columns!\" [shownFrom]=\"control.shownFrom!\" \r\n [apiDefinition]=\"control.apiDefinition!\" [getByIdApi]=\"control.getByIdApi!\" [selectedRow$]=\"control.selectedRow$!\"\r\n [outerParam$]=\"control.outerParam$!\"\r\n ></core-mcc>\r\n }\r\n @case (\"DATEPICKER\") {\r\n <core-date-picker [formControlName]=\"control.field\" [rangeLimit]=\"control.rangeLimit!\" [popupAlign]=\"control.popupAlign!\"></core-date-picker>\r\n }\r\n @case (\"DROPDOWN\") {\r\n @if (!!control.dropdownOptions$) {\r\n <core-dropdown [formControlName]=\"control.field\" [options$]=\"control.dropdownOptions$!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\" [shownFrom]=\"control.shownFrom!\"></core-dropdown>\r\n }\r\n }\r\n @case (\"LIST\") {\r\n <core-list [formControlName]=\"control.field\" [options]=\"control.listOptions!\"></core-list>\r\n }\r\n @case (\"CHECKLIST\") {\r\n @if (!!control.checklistOptions$) {\r\n <core-checklist [formControlName]=\"control.field\" [options$]=\"control.checklistOptions$!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\" [shownFrom]=\"control.shownFrom!\"></core-checklist>\r\n }\r\n }\r\n @case (\"FILEUPLOADER\") {\r\n @if (!!control.uploadFileType) {\r\n <core-file-uploader [formControlName]=\"control.field\" [uploadFileType]=\"control.uploadFileType\"\r\n [fileDataControlName]=\"control.fileDataControlName!\"\r\n [fileNameControlName]=\"control.fileNameControlName!\"\r\n [fileTypeControlName]=\"control.fileTypeControlName!\"\r\n [verticalMode]=\"control.verticalMode!\"></core-file-uploader>\r\n }\r\n }\r\n @case (\"ATTACHMENT\") {\r\n <core-attachment ngDefaultControl [formControlName]=\"control.field\" [assignTo]=\"control.assignTo!\"\r\n [valueToShow]=\"control.valueToShow!\"></core-attachment>\r\n }\r\n @case (\"GRIDBUFFER\") {\r\n @if (!!control.gridBufferFormSections && !!control.gridBufferTableColumns) {\r\n <core-grid-buffer [formControlName]=\"control.field\" [formSections]=\"control.gridBufferFormSections\"\r\n [gridColumns]=\"control.gridBufferTableColumns\"\r\n (onBufferFormCreated)=\"!!control.onBufferFormCreated ? control.onBufferFormCreated($event) : null\"></core-grid-buffer>\r\n }\r\n }\r\n @case (\"ORGTREECHECK\") {\r\n <core-org-tree [formControlName]=\"control.field\"\r\n [accessorMode]=\"coreOrgTreeDefaultAccessorMode\" [height]=\"control.height!\"></core-org-tree>\r\n }\r\n @case (\"RADIOGROUP\") {\r\n <core-radio-group [formControlName]=\"control.field\"\r\n [options$]=\"control.radioGroupOptions$!\"\r\n [vertical]=\"control.verticalMode!\"\r\n ></core-radio-group>\r\n }\r\n @case (\"MONTHSELECTOR\") {\r\n <core-month-selector [formControlName]=\"control.field\"></core-month-selector>\r\n }\r\n @case (\"SHIFTCELL\") {\r\n <core-shift-cell [formControlName]=\"control.field\"></core-shift-cell>\r\n }\r\n @case (\"SHIFTCOLLECTION\") {\r\n <core-shift-collection [relativeMode]=\"true\" [height]=\"control.height || 800\"></core-shift-collection>\r\n }\r\n @case (\"SEEKER\") {\r\n @switch(control.seekerSourceType) {\r\n @case(\"JOB_SEEK\") {\r\n <core-form-control-seeker\r\n [excludeExistingList]=\"control.excludeExistingList!\"\r\n [multiMode]=\"control.multiMode!\" [multiModeTableHeight]=\"control.multiModeTableHeight!\" [multiModeRowHeight]=\"control.multiModeRowHeight!\"\r\n [objectList$]=\"control.objectList$!\" [formControlName]=\"control.field\"\r\n [seekerSourceType]=\"control.seekerSourceType!\" \r\n [preDefinedOuterParam$]=\"control.preDefinedOuterParam$!\"\r\n [preDefinedOuterFilter$]=\"control.preDefinedOuterFilter$!\"\r\n [boundFrom]=\"control.boundFrom!\" [shownFrom]=\"control.shownFrom!\" [alsoBindTo]=\"control.alsoBindTo!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\"\r\n [click$]=\"control.click$\"\r\n [multiModeExtendedColumns]=\"control.multiModeExtendedColumns!\"\r\n [multiModeExtendedSections]=\"control.multiModeExtendedSections!\"\r\n [editBufferData$]=\"control.editBufferData$!\"\r\n [indirectBinding]=\"control.indirectBinding!\"\r\n [bindGridIdTo]=\"control.bindGridIdTo!\"\r\n [useTheseColumns]=\"control.useTheseColumns!\"\r\n [hideOrgTree]=\"control.hideOrgTree!\"\r\n [sourceSpaceHeight]=\"control.sourceSpaceHeight!\"\r\n ></core-form-control-seeker>\r\n }\r\n @case(\"EMPLOYEE_SEEK\") {\r\n <core-form-control-seeker\r\n [excludeExistingList]=\"control.excludeExistingList!\"\r\n [multiMode]=\"control.multiMode!\" [multiModeTableHeight]=\"control.multiModeTableHeight!\" [multiModeRowHeight]=\"control.multiModeRowHeight!\"\r\n [objectList$]=\"control.objectList$!\" [formControlName]=\"control.field\"\r\n [seekerSourceType]=\"control.seekerSourceType!\" \r\n [preDefinedOuterParam$]=\"control.preDefinedOuterParam$!\"\r\n [preDefinedOuterFilter$]=\"control.preDefinedOuterFilter$!\"\r\n [boundFrom]=\"control.boundFrom!\" [shownFrom]=\"control.shownFrom!\" [alsoBindTo]=\"control.alsoBindTo!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\"\r\n [click$]=\"control.click$\"\r\n [multiModeExtendedColumns]=\"control.multiModeExtendedColumns!\"\r\n [multiModeExtendedSections]=\"control.multiModeExtendedSections!\"\r\n [editBufferData$]=\"control.editBufferData$!\"\r\n [indirectBinding]=\"control.indirectBinding!\"\r\n [bindGridIdTo]=\"control.bindGridIdTo!\"\r\n [useTheseColumns]=\"control.useTheseColumns!\"\r\n [hideOrgTree]=\"control.hideOrgTree!\"\r\n [sourceSpaceHeight]=\"control.sourceSpaceHeight!\"\r\n ></core-form-control-seeker>\r\n }\r\n @case(\"CONTRACT_SEEK\") {\r\n <core-form-control-seeker\r\n [excludeExistingList]=\"control.excludeExistingList!\"\r\n [multiMode]=\"control.multiMode!\" [multiModeTableHeight]=\"control.multiModeTableHeight!\" [multiModeRowHeight]=\"control.multiModeRowHeight!\"\r\n [objectList$]=\"control.objectList$!\" [formControlName]=\"control.field\"\r\n [seekerSourceType]=\"control.seekerSourceType!\" [boundFrom]=\"control.boundFrom!\"\r\n [preDefinedOuterParam$]=\"control.preDefinedOuterParam$!\" \r\n [preDefinedOuterFilter$]=\"control.preDefinedOuterFilter$!\"\r\n [shownFrom]=\"control.shownFrom!\"\r\n [alsoBindTo]=\"control.alsoBindTo!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\"\r\n [multiModeExtendedColumns]=\"control.multiModeExtendedColumns!\"\r\n [multiModeExtendedSections]=\"control.multiModeExtendedSections!\"\r\n [click$]=\"control.click$\"\r\n [useTheseColumns]=\"control.useTheseColumns!\"\r\n [hideOrgTree]=\"control.hideOrgTree!\"\r\n [sourceSpaceHeight]=\"control.sourceSpaceHeight!\"\r\n ></core-form-control-seeker>\r\n }\r\n @case(\"WORKING_SEEK\") {\r\n <core-form-control-seeker \r\n [excludeExistingList]=\"control.excludeExistingList!\"\r\n [multiMode]=\"control.multiMode!\" [multiModeTableHeight]=\"control.multiModeTableHeight!\" [multiModeRowHeight]=\"control.multiModeRowHeight!\"\r\n [objectList$]=\"control.objectList$!\" [formControlName]=\"control.field\"\r\n [seekerSourceType]=\"control.seekerSourceType!\" \r\n [preDefinedOuterParam$]=\"control.preDefinedOuterParam$!\"\r\n [preDefinedOuterFilter$]=\"control.preDefinedOuterFilter$!\"\r\n [boundFrom]=\"control.boundFrom!\" [shownFrom]=\"control.shownFrom!\" [alsoBindTo]=\"control.alsoBindTo!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\"\r\n [multiModeExtendedColumns]=\"control.multiModeExtendedColumns!\"\r\n [multiModeExtendedSections]=\"control.multiModeExtendedSections!\"\r\n [click$]=\"control.click$\"\r\n [useTheseColumns]=\"control.useTheseColumns!\"\r\n [hideOrgTree]=\"control.hideOrgTree!\"\r\n [sourceSpaceHeight]=\"control.sourceSpaceHeight!\"\r\n ></core-form-control-seeker>\r\n }\r\n @case(\"WAGE_SEEK\") {\r\n <core-form-control-seeker \r\n [excludeExistingList]=\"control.excludeExistingList!\"\r\n [formControlName]=\"control.field\"\r\n [multiMode]=\"control.multiMode!\" [multiModeTableHeight]=\"control.multiModeTableHeight!\" [multiModeRowHeight]=\"control.multiModeRowHeight!\"\r\n [objectList$]=\"control.objectList$!\"\r\n [seekerSourceType]=\"control.seekerSourceType!\" \r\n [preDefinedOuterParam$]=\"control.preDefinedOuterParam$!\"\r\n [preDefinedOuterFilter$]=\"control.preDefinedOuterFilter$!\"\r\n [boundFrom]=\"control.boundFrom!\" [shownFrom]=\"control.shownFrom!\" [alsoBindTo]=\"control.alsoBindTo!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\"\r\n [multiModeExtendedColumns]=\"control.multiModeExtendedColumns!\"\r\n [multiModeExtendedSections]=\"control.multiModeExtendedSections!\"\r\n [click$]=\"control.click$\"\r\n [useTheseColumns]=\"control.useTheseColumns!\"\r\n [hideOrgTree]=\"control.hideOrgTree!\"\r\n [sourceSpaceHeight]=\"control.sourceSpaceHeight!\"\r\n ></core-form-control-seeker>\r\n }\r\n @case(\"POSITION_SEEK\") {\r\n <core-form-control-seeker \r\n [excludeExistingList]=\"control.excludeExistingList!\"\r\n [objectList$]=\"control.objectList$!\"\r\n [multiMode]=\"control.multiMode!\" [multiModeTableHeight]=\"control.multiModeTableHeight!\" [multiModeRowHeight]=\"control.multiModeRowHeight!\"\r\n [formControlName]=\"control.field\" [alsoBindTo]=\"control.alsoBindTo!\"\r\n [seekerSourceType]=\"control.seekerSourceType!\" \r\n [preDefinedOuterParam$]=\"control.preDefinedOuterParam$!\"\r\n [preDefinedOuterFilter$]=\"control.preDefinedOuterFilter$!\"\r\n [boundFrom]=\"control.boundFrom!\" [shownFrom]=\"control.shownFrom!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\"\r\n [multiModeExtendedColumns]=\"control.multiModeExtendedColumns!\"\r\n [multiModeExtendedSections]=\"control.multiModeExtendedSections!\"\r\n [seekerVerifyIgnore]=\"control.seekerVerifyIgnore!\"\r\n [click$]=\"control.click$\"\r\n [useTheseColumns]=\"control.useTheseColumns!\"\r\n [hideOrgTree]=\"control.hideOrgTree!\"\r\n [sourceSpaceHeight]=\"control.sourceSpaceHeight!\"\r\n ></core-form-control-seeker>\r\n }\r\n @case(\"POSITION_CONCURRENT_SEEK\") {\r\n <core-form-control-seeker\r\n [excludeExistingList]=\"control.excludeExistingList!\"\r\n [multiMode]=\"control.multiMode!\" [multiModeTableHeight]=\"control.multiModeTableHeight!\" [multiModeRowHeight]=\"control.multiModeRowHeight!\"\r\n [formControlName]=\"control.field\" [alsoBindTo]=\"control.alsoBindTo!\"\r\n [seekerSourceType]=\"control.seekerSourceType!\" \r\n [preDefinedOuterParam$]=\"control.preDefinedOuterParam$!\"\r\n [preDefinedOuterFilter$]=\"control.preDefinedOuterFilter$!\"\r\n [boundFrom]=\"control.boundFrom!\" [shownFrom]=\"control.shownFrom!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\"\r\n [multiModeExtendedColumns]=\"control.multiModeExtendedColumns!\"\r\n [multiModeExtendedSections]=\"control.multiModeExtendedSections!\"\r\n [multiModeTableHeight]=\"control.multiModeTableHeight!\"\r\n [click$]=\"control.click$\"\r\n [useTheseColumns]=\"control.useTheseColumns!\"\r\n [hideOrgTree]=\"control.hideOrgTree!\"\r\n [sourceSpaceHeight]=\"control.sourceSpaceHeight!\"\r\n ></core-form-control-seeker>\r\n }\r\n @case(\"ORGANIZATION_UNIT_SEEK\") {\r\n <core-form-control-seeker\r\n [formControlName]=\"control.field\" [seekerSourceType]=\"control.seekerSourceType!\"\r\n [boundFrom]=\"control.boundFrom!\" [alsoBindTo]=\"control.alsoBindTo!\" [shownFrom]=\"control.shownFrom!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\"\r\n [click$]=\"control.click$\"\r\n ></core-form-control-seeker>\r\n }\r\n }\r\n }\r\n }\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"control.controlType==='BUTTON'\">\r\n <button type=\"button\" class=\"btn btn-secondary text\" (click)=\"oHandleClick($event)\">{{control.label| translate: lang}}</button>\r\n </ng-container>\r\n <!-- END: FORM-CONTROL SESSION-->\r\n\r\n <!-- START: ERROR SESSION-->\r\n <div *ngIf=\"!!errors!.length\">\r\n <div class=\"form-control-error\" *ngFor=\"let error of errors\">\r\n {{ error.errorMessage | translate: lang }}\r\n </div>\r\n </div>\r\n <div *ngIf=\"!!!errors!.length && !!checkError$.value\">\r\n <div>\r\n {{ '&nbsp;' }}\r\n </div>\r\n </div>\r\n <!-- END: ERROR SESSION-->\r\n\r\n </div>\r\n</div>", styles: [".core-control-container{font-size:var(--typo-basic-font-size)!important}.core-control-container .control-label{color:#848484}.core-control-container>div.hidden{display:none}.core-control-container label{color:#464646}.core-control-container label.required:after{content:\"*\";color:#ff040b}.core-control-container label.avatar-label{width:var(--size-file-uploader);display:flex;align-items:center;justify-content:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "pipe", type: TableCellPipe, name: "tableCell" }, { kind: "component", type: CoreDropdownComponent, selector: "core-dropdown", inputs: ["getByIdObject$", "paramMode", "shownFrom", "options$", "height", "placeholder", "loading", "warningDisable", "clearDisable", "fitHeightWithItemCount", "itemHeight"] }, { kind: "component", type: CoreListComponent, selector: "core-list", inputs: ["title", "height", "options"] }, { kind: "component", type: CoreChecklistComponent, selector: "core-checklist", inputs: ["paramMode", "getByIdObject$", "shownFrom", "options$", "height", "placeholder", "loading", "readonly", "disabled"] }, { kind: "component", type: CoreFormControlSeekerComponent, selector: "core-form-control-seeker", inputs: ["title", "showPageHeader", "preDefinedOuterParam$", "preDefinedOuterFilter$", "click$", "getByIdObject$", "getByIdApi", "paramMode", "multiMode", "objectList$", "useTheseColumns", "hideOrgTree", "excludedColumns", "excludeExistingList", "sourceSpaceHeight", "indirectBinding", "bindGridIdTo", "multiModeExtendedColumns", "multiModeExtendedSections", "editBufferData$", "multiModeTableHeight", "multiModeRowHeight", "seekerSourceType", "boundFrom", "shownFrom", "alsoBindTo", "seekerVerifyIgnore"], outputs: ["onDoubleClick"] }, { kind: "component", type: CoreCheckboxComponent, selector: "core-checkbox", inputs: ["text", "tooltipPosition", "tooltip", "inputValue", "disabled"], outputs: ["onClick"] }, { kind: "component", type: CoreFileUploaderComponent, selector: "core-file-uploader", inputs: ["uploadFileType", "fileDataControlName", "fileNameControlName", "fileTypeControlName", "avatarSize", "defaultAvatar", "hidePreview", "verticalMode"] }, { kind: "component", type: CoreAttachmentComponent, selector: "core-attachment", inputs: ["assignTo", "readonly", "valueToShow"] }, { kind: "component", type: CoreGridBufferComponent, selector: "core-grid-buffer", inputs: ["formSections", "gridColumns"], outputs: ["onBufferFormCreated"] }, { kind: "component", type: CoreDatePickerComponent, selector: "core-date-picker", inputs: ["enableTimeZoneConverter", "showPlaceholder", "popupWidth", "popupXPadding", "popupAlign", "rangeLimit", "readonly", "disabled"] }, { kind: "component", type: CoreOrgTreeComponent, selector: "core-org-tree", inputs: ["lineColor", "fullWidthMode", "accessorMode", "searchMode", "fullRendering", "height", "disabledLoopExpand", "showCheckInheritance", "excludedIds$", "stateIsolated$"], outputs: ["itemDoubleClick", "itemClick"] }, { kind: "component", type: CoreRadioGroupComponent, selector: "core-radio-group", inputs: ["options$", "vertical"] }, { kind: "component", type: CoreMccComponent, selector: "core-mcc", inputs: ["height", "columns", "shownFrom", "apiDefinition", "getByIdApi", "outerParam$", "selectedRow$", "outerFilterOperators", "outerInOperators"] }, { kind: "component", type: CoreMonthSelectorComponent, selector: "core-month-selector", inputs: ["align"], outputs: ["onYearClick"] }, { kind: "directive", type: TooltipDirective, selector: "[appTooltip]", inputs: ["color", "backgroundColor", "appTooltip", "showAnyway", "position"] }, { kind: "component", type: CoreCurrencyInputComponent, selector: "core-currency-input", inputs: ["currencySign"], outputs: ["onLeftFocus"] }, { kind: "component", type: CoreShiftCellComponent, selector: "core-shift-cell", inputs: ["$readOnly", "$hideStarterPlusSign", "$hideStickersWhileDragover", "$backgroundColor"] }, { kind: "component", type: CoreShiftCollectionComponent, selector: "core-shift-collection", inputs: ["height", "relativeMode"] }] }); }
19907
- }
19908
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreControlComponent, decorators: [{
19909
- type: Component,
19910
- args: [{ selector: 'core-control', imports: [
19911
- CommonModule,
19912
- ReactiveFormsModule,
19913
- TranslatePipe,
19914
- TableCellPipe,
19915
- CoreDropdownComponent,
19916
- CoreListComponent,
19917
- CoreChecklistComponent,
19918
- CoreFormControlSeekerComponent,
19919
- CoreCheckboxComponent,
19920
- CoreFileUploaderComponent,
19921
- CoreAttachmentComponent,
19922
- CoreGridBufferComponent,
19923
- CoreDatePickerComponent,
19924
- CoreOrgTreeComponent,
19925
- CoreRadioGroupComponent,
19926
- CoreMccComponent,
19927
- CoreMonthSelectorComponent,
19928
- TooltipDirective,
19929
- CoreCurrencyInputComponent,
19930
- CoreShiftCellComponent,
19931
- CoreShiftCollectionComponent
19932
- ], template: "<div class=\"core-control-container\">\r\n <div [formGroup]=\"form\" [class.hidden]=\"!!control.hidden\">\r\n\r\n <!-- START: LABEL SESSION-->\r\n <label [class]=\"'control-label' + (required ? ' required' : '')\" [attr.for]=\"control.field\"\r\n [class.avatar-label]=\"control.uploadFileType==='IMAGE_AVATAR'\" [appTooltip]=\"control.tooltip! | translate: lang\" [ngStyle]=\"{\r\n display: 'inline-block'\r\n }\">\r\n {{(control.controlType!=='CHECKBOX' && control.controlType!=='BUTTON') ? (control.label | translate: lang) : ''}}\r\n </label>\r\n\r\n @if (!!control.hint! && control.controlType !== 'CHECKBOX') {\r\n <i class=\"feather-help-circle\" [appTooltip]=\"control.hint!\" [ngStyle]=\"{\r\n display: 'inline-block',\r\n marginLeft: '2px'\r\n }\"></i>\r\n }\r\n\r\n <!-- START: LABEL SESSION-->\r\n\r\n <!-- START: FORM-CONTROL SESSION-->\r\n\r\n <ng-container>\r\n @switch (control.controlType) {\r\n @case (\"TEXTBOX\") {\r\n <input *ngIf=\"control.type==='date'\" [formControlName]=\"control.field\" [type]=\"control.type\"\r\n class=\"form-control\" [readonly]=\"control.readonly!\" useValueAsDate>\r\n \r\n <input *ngIf=\"control.type==='number'\" [formControlName]=\"control.field\" [type]=\"control.type\"\r\n class=\"form-control\" [readonly]=\"control.readonly\" [step]=\"control.step || '1'\">\r\n \r\n <input *ngIf=\"control.type!=='date' && control.type!=='number'\" [formControlName]=\"control.field\"\r\n [value]=\"form.get(control.field)?.value | tableCell: control.pipe : lang\" [type]=\"control.type\"\r\n class=\"form-control\" [readonly]=\"control.readonly\"\r\n [appTooltip]=\"form.get(control.field)?.value\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n >\r\n }\r\n @case (\"CURRENCY\") {\r\n <core-currency-input [formControlName]=\"control.field\"></core-currency-input>\r\n }\r\n @case (\"TEXTAREA\") {\r\n <textarea [rows]=\"control.textareaRows?.toString() || '3'\" [ngStyle]=\"{ height: 'unset' }\"\r\n [formControlName]=\"control.field\" class=\"form-control\" [readonly]=\"control.readonly\"></textarea>\r\n }\r\n @case (\"CHECKBOX\") {\r\n <core-checkbox [formControlName]=\"control.field\" [text]=\"control.label\"\r\n [inputValue]=\"control.value\"></core-checkbox>\r\n }\r\n @case (\"MCC\") {\r\n <core-mcc [formControlName]=\"control.field\" [columns]=\"control.columns!\" [shownFrom]=\"control.shownFrom!\" \r\n [apiDefinition]=\"control.apiDefinition!\" [getByIdApi]=\"control.getByIdApi!\" [selectedRow$]=\"control.selectedRow$!\"\r\n [outerParam$]=\"control.outerParam$!\"\r\n ></core-mcc>\r\n }\r\n @case (\"DATEPICKER\") {\r\n <core-date-picker [formControlName]=\"control.field\" [rangeLimit]=\"control.rangeLimit!\" [popupAlign]=\"control.popupAlign!\"></core-date-picker>\r\n }\r\n @case (\"DROPDOWN\") {\r\n @if (!!control.dropdownOptions$) {\r\n <core-dropdown [formControlName]=\"control.field\" [options$]=\"control.dropdownOptions$!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\" [shownFrom]=\"control.shownFrom!\"></core-dropdown>\r\n }\r\n }\r\n @case (\"LIST\") {\r\n <core-list [formControlName]=\"control.field\" [options]=\"control.listOptions!\"></core-list>\r\n }\r\n @case (\"CHECKLIST\") {\r\n @if (!!control.checklistOptions$) {\r\n <core-checklist [formControlName]=\"control.field\" [options$]=\"control.checklistOptions$!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\" [shownFrom]=\"control.shownFrom!\"></core-checklist>\r\n }\r\n }\r\n @case (\"FILEUPLOADER\") {\r\n @if (!!control.uploadFileType) {\r\n <core-file-uploader [formControlName]=\"control.field\" [uploadFileType]=\"control.uploadFileType\"\r\n [fileDataControlName]=\"control.fileDataControlName!\"\r\n [fileNameControlName]=\"control.fileNameControlName!\"\r\n [fileTypeControlName]=\"control.fileTypeControlName!\"\r\n [verticalMode]=\"control.verticalMode!\"></core-file-uploader>\r\n }\r\n }\r\n @case (\"ATTACHMENT\") {\r\n <core-attachment ngDefaultControl [formControlName]=\"control.field\" [assignTo]=\"control.assignTo!\"\r\n [valueToShow]=\"control.valueToShow!\"></core-attachment>\r\n }\r\n @case (\"GRIDBUFFER\") {\r\n @if (!!control.gridBufferFormSections && !!control.gridBufferTableColumns) {\r\n <core-grid-buffer [formControlName]=\"control.field\" [formSections]=\"control.gridBufferFormSections\"\r\n [gridColumns]=\"control.gridBufferTableColumns\"\r\n (onBufferFormCreated)=\"!!control.onBufferFormCreated ? control.onBufferFormCreated($event) : null\"></core-grid-buffer>\r\n }\r\n }\r\n @case (\"ORGTREECHECK\") {\r\n <core-org-tree [formControlName]=\"control.field\"\r\n [accessorMode]=\"coreOrgTreeDefaultAccessorMode\" [height]=\"control.height!\"></core-org-tree>\r\n }\r\n @case (\"RADIOGROUP\") {\r\n <core-radio-group [formControlName]=\"control.field\"\r\n [options$]=\"control.radioGroupOptions$!\"\r\n [vertical]=\"control.verticalMode!\"\r\n ></core-radio-group>\r\n }\r\n @case (\"MONTHSELECTOR\") {\r\n <core-month-selector [formControlName]=\"control.field\"></core-month-selector>\r\n }\r\n @case (\"SHIFTCELL\") {\r\n <core-shift-cell [formControlName]=\"control.field\"></core-shift-cell>\r\n }\r\n @case (\"SHIFTCOLLECTION\") {\r\n <core-shift-collection [relativeMode]=\"true\" [height]=\"control.height || 800\"></core-shift-collection>\r\n }\r\n @case (\"SEEKER\") {\r\n @switch(control.seekerSourceType) {\r\n @case(\"JOB_SEEK\") {\r\n <core-form-control-seeker\r\n [excludeExistingList]=\"control.excludeExistingList!\"\r\n [multiMode]=\"control.multiMode!\" [multiModeTableHeight]=\"control.multiModeTableHeight!\" [multiModeRowHeight]=\"control.multiModeRowHeight!\"\r\n [objectList$]=\"control.objectList$!\" [formControlName]=\"control.field\"\r\n [seekerSourceType]=\"control.seekerSourceType!\" \r\n [preDefinedOuterParam$]=\"control.preDefinedOuterParam$!\"\r\n [preDefinedOuterFilter$]=\"control.preDefinedOuterFilter$!\"\r\n [boundFrom]=\"control.boundFrom!\" [shownFrom]=\"control.shownFrom!\" [alsoBindTo]=\"control.alsoBindTo!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\"\r\n [click$]=\"control.click$\"\r\n [multiModeExtendedColumns]=\"control.multiModeExtendedColumns!\"\r\n [multiModeExtendedSections]=\"control.multiModeExtendedSections!\"\r\n [editBufferData$]=\"control.editBufferData$!\"\r\n [indirectBinding]=\"control.indirectBinding!\"\r\n [bindGridIdTo]=\"control.bindGridIdTo!\"\r\n [useTheseColumns]=\"control.useTheseColumns!\"\r\n [hideOrgTree]=\"control.hideOrgTree!\"\r\n [sourceSpaceHeight]=\"control.sourceSpaceHeight!\"\r\n ></core-form-control-seeker>\r\n }\r\n @case(\"EMPLOYEE_SEEK\") {\r\n <core-form-control-seeker\r\n [excludeExistingList]=\"control.excludeExistingList!\"\r\n [multiMode]=\"control.multiMode!\" [multiModeTableHeight]=\"control.multiModeTableHeight!\" [multiModeRowHeight]=\"control.multiModeRowHeight!\"\r\n [objectList$]=\"control.objectList$!\" [formControlName]=\"control.field\"\r\n [seekerSourceType]=\"control.seekerSourceType!\" \r\n [preDefinedOuterParam$]=\"control.preDefinedOuterParam$!\"\r\n [preDefinedOuterFilter$]=\"control.preDefinedOuterFilter$!\"\r\n [boundFrom]=\"control.boundFrom!\" [shownFrom]=\"control.shownFrom!\" [alsoBindTo]=\"control.alsoBindTo!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\"\r\n [click$]=\"control.click$\"\r\n [multiModeExtendedColumns]=\"control.multiModeExtendedColumns!\"\r\n [multiModeExtendedSections]=\"control.multiModeExtendedSections!\"\r\n [editBufferData$]=\"control.editBufferData$!\"\r\n [indirectBinding]=\"control.indirectBinding!\"\r\n [bindGridIdTo]=\"control.bindGridIdTo!\"\r\n [useTheseColumns]=\"control.useTheseColumns!\"\r\n [hideOrgTree]=\"control.hideOrgTree!\"\r\n [sourceSpaceHeight]=\"control.sourceSpaceHeight!\"\r\n ></core-form-control-seeker>\r\n }\r\n @case(\"CONTRACT_SEEK\") {\r\n <core-form-control-seeker\r\n [excludeExistingList]=\"control.excludeExistingList!\"\r\n [multiMode]=\"control.multiMode!\" [multiModeTableHeight]=\"control.multiModeTableHeight!\" [multiModeRowHeight]=\"control.multiModeRowHeight!\"\r\n [objectList$]=\"control.objectList$!\" [formControlName]=\"control.field\"\r\n [seekerSourceType]=\"control.seekerSourceType!\" [boundFrom]=\"control.boundFrom!\"\r\n [preDefinedOuterParam$]=\"control.preDefinedOuterParam$!\" \r\n [preDefinedOuterFilter$]=\"control.preDefinedOuterFilter$!\"\r\n [shownFrom]=\"control.shownFrom!\"\r\n [alsoBindTo]=\"control.alsoBindTo!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\"\r\n [multiModeExtendedColumns]=\"control.multiModeExtendedColumns!\"\r\n [multiModeExtendedSections]=\"control.multiModeExtendedSections!\"\r\n [click$]=\"control.click$\"\r\n [useTheseColumns]=\"control.useTheseColumns!\"\r\n [hideOrgTree]=\"control.hideOrgTree!\"\r\n [sourceSpaceHeight]=\"control.sourceSpaceHeight!\"\r\n ></core-form-control-seeker>\r\n }\r\n @case(\"WORKING_SEEK\") {\r\n <core-form-control-seeker \r\n [excludeExistingList]=\"control.excludeExistingList!\"\r\n [multiMode]=\"control.multiMode!\" [multiModeTableHeight]=\"control.multiModeTableHeight!\" [multiModeRowHeight]=\"control.multiModeRowHeight!\"\r\n [objectList$]=\"control.objectList$!\" [formControlName]=\"control.field\"\r\n [seekerSourceType]=\"control.seekerSourceType!\" \r\n [preDefinedOuterParam$]=\"control.preDefinedOuterParam$!\"\r\n [preDefinedOuterFilter$]=\"control.preDefinedOuterFilter$!\"\r\n [boundFrom]=\"control.boundFrom!\" [shownFrom]=\"control.shownFrom!\" [alsoBindTo]=\"control.alsoBindTo!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\"\r\n [multiModeExtendedColumns]=\"control.multiModeExtendedColumns!\"\r\n [multiModeExtendedSections]=\"control.multiModeExtendedSections!\"\r\n [click$]=\"control.click$\"\r\n [useTheseColumns]=\"control.useTheseColumns!\"\r\n [hideOrgTree]=\"control.hideOrgTree!\"\r\n [sourceSpaceHeight]=\"control.sourceSpaceHeight!\"\r\n ></core-form-control-seeker>\r\n }\r\n @case(\"WAGE_SEEK\") {\r\n <core-form-control-seeker \r\n [excludeExistingList]=\"control.excludeExistingList!\"\r\n [formControlName]=\"control.field\"\r\n [multiMode]=\"control.multiMode!\" [multiModeTableHeight]=\"control.multiModeTableHeight!\" [multiModeRowHeight]=\"control.multiModeRowHeight!\"\r\n [objectList$]=\"control.objectList$!\"\r\n [seekerSourceType]=\"control.seekerSourceType!\" \r\n [preDefinedOuterParam$]=\"control.preDefinedOuterParam$!\"\r\n [preDefinedOuterFilter$]=\"control.preDefinedOuterFilter$!\"\r\n [boundFrom]=\"control.boundFrom!\" [shownFrom]=\"control.shownFrom!\" [alsoBindTo]=\"control.alsoBindTo!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\"\r\n [multiModeExtendedColumns]=\"control.multiModeExtendedColumns!\"\r\n [multiModeExtendedSections]=\"control.multiModeExtendedSections!\"\r\n [click$]=\"control.click$\"\r\n [useTheseColumns]=\"control.useTheseColumns!\"\r\n [hideOrgTree]=\"control.hideOrgTree!\"\r\n [sourceSpaceHeight]=\"control.sourceSpaceHeight!\"\r\n ></core-form-control-seeker>\r\n }\r\n @case(\"POSITION_SEEK\") {\r\n <core-form-control-seeker \r\n [excludeExistingList]=\"control.excludeExistingList!\"\r\n [objectList$]=\"control.objectList$!\"\r\n [multiMode]=\"control.multiMode!\" [multiModeTableHeight]=\"control.multiModeTableHeight!\" [multiModeRowHeight]=\"control.multiModeRowHeight!\"\r\n [formControlName]=\"control.field\" [alsoBindTo]=\"control.alsoBindTo!\"\r\n [seekerSourceType]=\"control.seekerSourceType!\" \r\n [preDefinedOuterParam$]=\"control.preDefinedOuterParam$!\"\r\n [preDefinedOuterFilter$]=\"control.preDefinedOuterFilter$!\"\r\n [boundFrom]=\"control.boundFrom!\" [shownFrom]=\"control.shownFrom!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\"\r\n [multiModeExtendedColumns]=\"control.multiModeExtendedColumns!\"\r\n [multiModeExtendedSections]=\"control.multiModeExtendedSections!\"\r\n [seekerVerifyIgnore]=\"control.seekerVerifyIgnore!\"\r\n [click$]=\"control.click$\"\r\n [useTheseColumns]=\"control.useTheseColumns!\"\r\n [hideOrgTree]=\"control.hideOrgTree!\"\r\n [sourceSpaceHeight]=\"control.sourceSpaceHeight!\"\r\n ></core-form-control-seeker>\r\n }\r\n @case(\"POSITION_CONCURRENT_SEEK\") {\r\n <core-form-control-seeker\r\n [excludeExistingList]=\"control.excludeExistingList!\"\r\n [multiMode]=\"control.multiMode!\" [multiModeTableHeight]=\"control.multiModeTableHeight!\" [multiModeRowHeight]=\"control.multiModeRowHeight!\"\r\n [formControlName]=\"control.field\" [alsoBindTo]=\"control.alsoBindTo!\"\r\n [seekerSourceType]=\"control.seekerSourceType!\" \r\n [preDefinedOuterParam$]=\"control.preDefinedOuterParam$!\"\r\n [preDefinedOuterFilter$]=\"control.preDefinedOuterFilter$!\"\r\n [boundFrom]=\"control.boundFrom!\" [shownFrom]=\"control.shownFrom!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\"\r\n [multiModeExtendedColumns]=\"control.multiModeExtendedColumns!\"\r\n [multiModeExtendedSections]=\"control.multiModeExtendedSections!\"\r\n [multiModeTableHeight]=\"control.multiModeTableHeight!\"\r\n [click$]=\"control.click$\"\r\n [useTheseColumns]=\"control.useTheseColumns!\"\r\n [hideOrgTree]=\"control.hideOrgTree!\"\r\n [sourceSpaceHeight]=\"control.sourceSpaceHeight!\"\r\n ></core-form-control-seeker>\r\n }\r\n @case(\"ORGANIZATION_UNIT_SEEK\") {\r\n <core-form-control-seeker\r\n [formControlName]=\"control.field\" [seekerSourceType]=\"control.seekerSourceType!\"\r\n [boundFrom]=\"control.boundFrom!\" [alsoBindTo]=\"control.alsoBindTo!\" [shownFrom]=\"control.shownFrom!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\"\r\n [click$]=\"control.click$\"\r\n ></core-form-control-seeker>\r\n }\r\n }\r\n }\r\n }\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"control.controlType==='BUTTON'\">\r\n <button type=\"button\" class=\"btn btn-secondary text\" (click)=\"oHandleClick($event)\">{{control.label| translate: lang}}</button>\r\n </ng-container>\r\n <!-- END: FORM-CONTROL SESSION-->\r\n\r\n <!-- START: ERROR SESSION-->\r\n <div *ngIf=\"!!errors!.length\">\r\n <div class=\"form-control-error\" *ngFor=\"let error of errors\">\r\n {{ error.errorMessage | translate: lang }}\r\n </div>\r\n </div>\r\n <div *ngIf=\"!!!errors!.length && !!checkError$.value\">\r\n <div>\r\n {{ '&nbsp;' }}\r\n </div>\r\n </div>\r\n <!-- END: ERROR SESSION-->\r\n\r\n </div>\r\n</div>", styles: [".core-control-container{font-size:var(--typo-basic-font-size)!important}.core-control-container .control-label{color:#848484}.core-control-container>div.hidden{display:none}.core-control-container label{color:#464646}.core-control-container label.required:after{content:\"*\";color:#ff040b}.core-control-container label.avatar-label{width:var(--size-file-uploader);display:flex;align-items:center;justify-content:center}\n"] }]
19933
- }], ctorParameters: () => [{ type: MultiLanguageService }, { type: AlertService }], propDecorators: { control: [{
19934
- type: Input
19935
- }], form: [{
19936
- type: Input
19937
- }], checkError$: [{
19938
- type: Input
19939
- }], rangeLimit: [{
19940
- type: Input
19941
- }] } });
19942
-
19943
- class CoreFormComponent {
19944
- constructor(coreControlService, multiLanguageService, alertService, coreFormService, appConfigService) {
19945
- this.coreControlService = coreControlService;
19946
- this.multiLanguageService = multiLanguageService;
19867
+ constructor(
19868
+ //public override injector: Injector,
19869
+ authService, recursiveService, mls, layoutService, topicTreeService, alertService) {
19870
+ super( /*injector*/);
19871
+ this.authService = authService;
19872
+ this.recursiveService = recursiveService;
19873
+ this.mls = mls;
19874
+ this.layoutService = layoutService;
19875
+ this.topicTreeService = topicTreeService;
19947
19876
  this.alertService = alertService;
19948
- this.coreFormService = coreFormService;
19949
- this.appConfigService = appConfigService;
19950
- this.checkError$ = new BehaviorSubject(false);
19951
- this.onFormCreated = new EventEmitter();
19952
- this.onFormRefCreated = new EventEmitter();
19953
- this.onSubmit = new EventEmitter();
19954
- this.onSave = new EventEmitter();
19955
- this.onCancal = new EventEmitter();
19956
- this.buttonClick = new EventEmitter();
19877
+ this.lineColor = 'transparent';
19878
+ this.itemDoubleClick = new EventEmitter();
19879
+ this.itemClick = new EventEmitter();
19880
+ this.activeIds = [];
19881
+ this.checkedIds = [];
19957
19882
  this.subscriptions = [];
19958
- this.payLoad = '';
19959
- this.isDevMode = isDevMode();
19960
- }
19961
- updateSections(newSections) {
19962
- this.sections.map((section, sectionIndex) => {
19963
- const newSection = newSections[sectionIndex];
19964
- section.rows.map((row, rowIndex) => {
19965
- const newRow = newSection.rows[rowIndex];
19966
- row.map((control, controlIndex) => {
19967
- const newControl = newRow[controlIndex];
19968
- /* THE ONLY PROP TO BE UDATED IS 'hidden', THE OTHERS SHOULD BE MANIPULATED THROUGH this.form.get(YOUR_CONTROL_NAME)... */
19969
- control.hidden = newControl?.hidden;
19970
- /************************************************************************************************************************/
19971
- });
19972
- });
19973
- /* #region Oct the 11th 2023 */
19974
- /* Some sections was posibly have renderOff=true from previous state and their controls must be created/remove */
19975
- /*
19976
- BUT THIS TASK IS HARD SO FAR
19977
- */
19978
- /* #endregion Oct the 11th 2023 */
19979
- });
19883
+ this.search$ = new Subject();
19884
+ this.searchPlaceholder = EnumTranslateKey.UI_COMMON_PLACE_HOLDER_SEARCH_HERE;
19885
+ this.checkInheritance = true; // default value is true
19886
+ this.showDissolved = true; // default value is false
19887
+ this.initializing = true;
19888
+ // this.reduced$ = this.coreOrgTreeState.coreOrgTreeReduced$;
19889
+ this.initializing = false;
19980
19890
  }
19981
19891
  ngOnChanges(changes) {
19982
- if (changes['inputSections']) {
19983
- let newSections = changes['inputSections'].currentValue;
19984
- if (!!!this.form) {
19985
- this.sections = newSections;
19986
- let leftGroup;
19987
- let form;
19988
- const mainGroup = this.coreControlService.toGroup(this.sections);
19989
- if (!!this.leftInputSections) {
19990
- leftGroup = this.coreControlService.toGroup(this.leftInputSections);
19991
- form = new FormGroup({ ...leftGroup, ...mainGroup });
19992
- }
19993
- else {
19994
- form = new FormGroup(mainGroup);
19995
- }
19996
- this.form = form;
19997
- }
19998
- else {
19999
- this.updateSections(newSections);
20000
- }
20001
- this.onFormCreated.emit({
20002
- formName: this.formName,
20003
- formGroup: this.form,
20004
- });
19892
+ if (changes['height']) {
19893
+ this.resizeHeight();
20005
19894
  }
20006
19895
  }
20007
19896
  ngOnInit() {
20008
- /*
20009
- if (this.appConfigService.APP_TYPE === "WEBAPP") {
20010
- */
20011
- if (!this.disableSaveButton && !this.disableCancelButton) {
20012
- this.buttonItems = [
20013
- EnumCoreButtonVNSCode.NONE_HEADER_SAVE,
20014
- EnumCoreButtonVNSCode.NONE_HEADER_CANCEL,
20015
- ];
20016
- }
20017
- else if (!!this.disableCancelButton) {
20018
- this.buttonItems = [
20019
- EnumCoreButtonVNSCode.NONE_HEADER_SAVE,
20020
- ];
20021
- }
20022
- else if (!!this.disableSaveButton) {
20023
- this.buttonItems = [
20024
- EnumCoreButtonVNSCode.NONE_HEADER_CANCEL,
20025
- ];
20026
- }
20027
- /*
20028
- } else if (this.appConfigService.APP_TYPE === "PORTAL") {
20029
- if (!this.disableSaveButton) {
20030
- this.buttonItems = [
20031
- EnumCoreButtonVNSCode.SEND,
20032
- EnumCoreButtonVNSCode.CANCEL,
20033
- EnumCoreButtonVNSCode.SAVE,
20034
- ]
20035
- } else {
20036
- this.buttonItems = [
20037
- EnumCoreButtonVNSCode.SEND,
20038
- EnumCoreButtonVNSCode.CANCEL,
20039
- ]
20040
- }
20041
- }
20042
- */
20043
- if (!!this.customFormButtonItems) {
20044
- this.buttonItems = this.customFormButtonItems;
20045
- }
20046
- this.subscriptions.push(this.mode$.subscribe((x) => (this.isUpdateMode = x === EnumCorePageEditMode.UPDATE)));
20047
- console.log(this.mode$);
20048
- /* START: Check if id field is available */
20049
- if (!!!this.form.get('id') && isDevMode()) {
20050
- this.alertService.error(`
20051
- Control "id" is mandatory. Please define one in your bussiness component. You can assign its "hidden" property to true if needed.
20052
- `, noneAutoClosedAlertOptions);
19897
+ this.instanceNumber = new Date().getTime();
19898
+ const newInstance = {
19899
+ instanceNumber: this.instanceNumber,
19900
+ selectedKey$: new BehaviorSubject(undefined),
19901
+ activeKeys$: new BehaviorSubject([]),
19902
+ checkedKeys$: new BehaviorSubject([]),
19903
+ expandedKeys$: new BehaviorSubject([]),
19904
+ checkInheritance$: new BehaviorSubject(true)
19905
+ };
19906
+ this.topicTreeService.instances.push(newInstance);
19907
+ // Check xem chiều cao height có được truyền vào hay không
19908
+ if (this.height === undefined) {
19909
+ if (isDevMode()) {
19910
+ //this.alertService.warn("CoreOrgTree không nhận được chiều cao (height) truyền vào từ lớp ngoài. Chiều cao mặc định sẽ được tính toán dựa vào bố cục chính.", alertOptions);
19911
+ }
19912
+ this.subscriptions.push(this.layoutService.contentContainerHeight$.subscribe(x => {
19913
+ // basicSpacing là paddingBottom của lớp content-container
19914
+ this.height = x - this.layoutService.corePageHeaderHeight - this.layoutService.basicSpacing;
19915
+ }));
20053
19916
  }
20054
- /* END: Check if id field is available */
20055
- if (isDevMode()) {
20056
- /* START: Check if each field is unique */
20057
- const fields = this.coreFormService.getAllFormBaseControlNames(this.sections);
20058
- fields.reduce((p, c) => {
20059
- if (c === '') {
20060
- this.alertService.error(`Form control name must be definded, '${c}' is invalid form control name!!!`, noneAutoClosedAlertOptions);
20061
- }
20062
- else {
20063
- if (p === c) {
20064
- this.alertService.error(`Duplicate form control name: '${c}'. Consider to predefine one ONLY!!!.`, noneAutoClosedAlertOptions);
20065
- }
20066
- }
20067
- return c;
19917
+ this.subscriptions.push(this.topicTreeService.linearData$.subscribe((x) => {
19918
+ this.linearArticleCategoryArray = x;
19919
+ }));
19920
+ this.subscriptions.push(this.topicTreeService.status$.subscribe((x) => {
19921
+ console.log("this.TopicTreeService.status$ changes", x);
19922
+ const newActiveIds = [];
19923
+ x.activeKeys.map((k) => {
19924
+ newActiveIds.push(Number(k));
20068
19925
  });
20069
- /* END: Check if each field is unique */
20070
- }
20071
- this.subscriptions.push(this.multiLanguageService.lang$.subscribe((x) => (this.lang = x)));
20072
- }
20073
- ngAfterViewInit() {
20074
- this.onFormRefCreated.emit(this.formRef);
19926
+ this.activeIds = newActiveIds;
19927
+ if (this.accessorMode !== EnumCoreArticleCategoryTreeaAccessorMode.CHECKED) {
19928
+ this.value = this.activeIds;
19929
+ this.onChange(this.activeIds);
19930
+ }
19931
+ this.selectedKey = x.selectedKey;
19932
+ }));
19933
+ this.subscriptions.push(this.search$
19934
+ .pipe(filter((x) => x !== null), debounceTime(500), distinctUntilChanged(), switchMap((text) => {
19935
+ console.log('switchMap works');
19936
+ this.loading = true;
19937
+ return this.recursiveService.findItem(text, this.data);
19938
+ }))
19939
+ .subscribe((x) => {
19940
+ this.loading = false;
19941
+ }));
19942
+ this.subscriptions.push(this.topicTreeService.status$
19943
+ .pipe(filter((value) => !!!this.initializing && !!value))
19944
+ .subscribe((x) => {
19945
+ if (!!localStorage) {
19946
+ localStorage.setItem('coreOrgTreeStatus', JSON.stringify(x));
19947
+ }
19948
+ }));
19949
+ this.subscriptions.push(this.mls.lang$.subscribe((x) => (this.lang = x)));
20075
19950
  }
20076
- onFormSubmit() {
20077
- this.checkError$.next(true);
20078
- if (!!this.form.valid) {
20079
- this.payLoad = JSON.stringify(this.form?.getRawValue(), null, 2);
20080
- this.onSubmit.emit(this.form?.getRawValue());
19951
+ resizeHeight() {
19952
+ // height is not given and the tree resize as standard
19953
+ if (!!!this.height) {
19954
+ const sizeHeaderHeight = Number(getComputedStyle(document.documentElement)
19955
+ .getPropertyValue('--size-header-height')
19956
+ .replace('px', ''));
19957
+ const sizeCorePageHeaderHeight = Number(getComputedStyle(document.documentElement)
19958
+ .getPropertyValue('--size-core-page-header-height')
19959
+ .replace('px', ''));
19960
+ const containerHeight = window.innerHeight - sizeHeaderHeight - sizeCorePageHeaderHeight;
19961
+ const pageHeaderHeight = Number(getComputedStyle(document.documentElement)
19962
+ .getPropertyValue('--size-core-page-header-height')
19963
+ .replace('px', ''));
19964
+ const paginationHeight = Number(getComputedStyle(document.documentElement)
19965
+ .getPropertyValue('--size-core-pagination-height')
19966
+ .replace('px', ''));
19967
+ const sizeMarginCorePaginationFull = Number(getComputedStyle(document.documentElement)
19968
+ .getPropertyValue('--size-margin-core-pagination')
19969
+ .replace('px', ''));
19970
+ const height = containerHeight - pageHeaderHeight - paginationHeight + sizeMarginCorePaginationFull;
19971
+ console.log(height);
19972
+ this.container?.nativeElement.style.setProperty('--height', height + 'px');
20081
19973
  }
20082
- }
20083
- onFormSave() {
20084
- this.checkError$.next(true);
20085
- if (!!this.form.valid) {
20086
- this.payLoad = JSON.stringify(this.form?.getRawValue(), null, 2);
20087
- this.onSave.emit(this.form?.getRawValue());
19974
+ else {
19975
+ this.container?.nativeElement.style.setProperty('--height', this.height + 'px');
20088
19976
  }
20089
- setTimeout(() => this.checkError$.next(false), 3000);
20090
19977
  }
20091
- onCancelLocal() {
20092
- this.onCancal.emit(null);
19978
+ ngAfterViewInit() {
19979
+ setTimeout(() => {
19980
+ this.subscriptions.push(this.topicTreeService.topicTreeData$.subscribe((x) => {
19981
+ this.data = x;
19982
+ console.log("new Data coming", this.data, new Date().getTime());
19983
+ if (!!this.data) {
19984
+ if (!!this.data.length)
19985
+ this.data[0].tree$Expanded = true;
19986
+ }
19987
+ }));
19988
+ });
20093
19989
  }
20094
- updatePayload() {
20095
- if (this.payLoad === '') {
20096
- this.payLoad = JSON.stringify(this.form?.getRawValue(), null, 2);
20097
- }
20098
- else {
20099
- this.payLoad = '';
19990
+ onItemClickLocal(e) {
19991
+ this.linearArticleCategoryArray.map((x) => (x.active = false));
19992
+ setTimeout(() => this.buildTreeData());
19993
+ }
19994
+ onToggleItem(e) {
19995
+ const cloneCopy = JSON.parse(JSON.stringify(this.linearArticleCategoryArray));
19996
+ const filter = cloneCopy.filter((x) => x.id === e.id);
19997
+ if (filter.length === 1) {
19998
+ filter[0].expanded = !!!e.expanded;
20100
19999
  }
20000
+ this.linearArticleCategoryArray = cloneCopy;
20001
+ setTimeout(() => this.buildTreeData());
20101
20002
  }
20102
- updateValidorOverview() {
20103
- if (this.validatorOverview === undefined) {
20104
- const result = [];
20105
- Object.keys(this.form.controls).forEach((key) => {
20106
- const control = this.form.get(key);
20107
- const errors = [];
20108
- if (!!control.invalid) {
20109
- Object.keys(control.errors).forEach((key) => {
20110
- errors.push(key);
20111
- });
20112
- }
20113
- result.push({
20114
- key,
20115
- errors,
20116
- });
20003
+ buildTreeData() {
20004
+ this.loading = true;
20005
+ const cloneCopy = JSON.parse(JSON.stringify(this.linearArticleCategoryArray));
20006
+ if (typeof Worker !== 'undefined') {
20007
+ // Create a new
20008
+ console.log("🟢🟢 Worker works");
20009
+ const worker = new Worker(liner_to_nested_array_script);
20010
+ worker.addEventListener('message', ({ data }) => {
20011
+ this.data = data.list;
20012
+ if (!!this.data && !!this.data?.length)
20013
+ this.data[0].tree$Expanded = true;
20014
+ this.loading = false;
20015
+ });
20016
+ worker.postMessage({
20017
+ list: cloneCopy,
20018
+ keyField: 'id',
20019
+ titleField: 'name',
20020
+ parentField: 'parentId',
20021
+ activeField: 'active',
20022
+ //inheritantActiveField: 'inheritantActive',
20023
+ checkedField: 'checked',
20024
+ expandedField: 'expand',
20117
20025
  });
20118
- this.validatorOverview = JSON.stringify(result, null, 2);
20119
20026
  }
20120
20027
  else {
20121
- this.validatorOverview = undefined;
20028
+ // Web workers are not supported in this environment.
20029
+ // You should add a fallback so that your program still executes correctly.
20030
+ const status = this.topicTreeService.status$.value;
20031
+ this.subscriptions.push(this.recursiveService
20032
+ .linerArrayToNestedArray(cloneCopy, 'id', 'name', 'parentId', 'active', 'checked', 'expand')
20033
+ .subscribe((obj) => {
20034
+ this.data = obj.list;
20035
+ if (!!this.data && !!this.data?.length)
20036
+ this.data[0].tree$Expanded = true;
20037
+ this.loading = false;
20038
+ }));
20122
20039
  }
20123
20040
  }
20124
- ngOnDestroy() {
20125
- this.subscriptions.map((x) => x?.unsubscribe());
20126
- }
20127
- onButtonClick(e) {
20128
- switch (e.code) {
20129
- case EnumCoreButtonVNSCode.NONE_HEADER_CANCEL:
20130
- case EnumCoreButtonVNSCode.CANCEL:
20131
- this.onCancelLocal();
20132
- break;
20133
- case EnumCoreButtonVNSCode.NONE_HEADER_SAVE:
20134
- case EnumCoreButtonVNSCode.SEND:
20135
- case EnumCoreButtonVNSCode.NONE_HEADER_DELETE:
20136
- case EnumCoreButtonVNSCode.NONE_HEADER_LIQUIDATE_CONTRACT:
20137
- case EnumCoreButtonVNSCode.ONFORMDELETE:
20138
- case EnumCoreButtonVNSCode.SAVE_PASSWORD:
20139
- this.onFormSubmit();
20140
- break;
20141
- case EnumCoreButtonVNSCode.SAVE:
20142
- this.onFormSave();
20143
- break;
20144
- default:
20145
- break;
20041
+ onExpandTogglerClick(e, event) {
20042
+ event.stopPropagation();
20043
+ const newValue = !e.tree$Expanded;
20044
+ e.tree$Expanded = newValue;
20045
+ // updating status with newValue
20046
+ const currentExpandedIds = this.topicTreeService.status$.value?.expandedKeys;
20047
+ let newExpandedIds = currentExpandedIds?.filter((_) => !!!currentExpandedIds.includes(e.id.toString()));
20048
+ if (newValue) {
20049
+ newExpandedIds?.push(e.id.toString());
20146
20050
  }
20147
- this.buttonClick.emit(e);
20051
+ newExpandedIds?.sort();
20052
+ const newExpandedKeys = [];
20053
+ newExpandedIds.map((x) => newExpandedKeys.push(x.toString()));
20054
+ this.topicTreeService.status$.next({
20055
+ ...this.topicTreeService.status$.value,
20056
+ expandedKeys: newExpandedKeys,
20057
+ });
20148
20058
  }
20149
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreFormComponent, deps: [{ token: CoreControlService }, { token: MultiLanguageService }, { token: AlertService }, { token: CoreFormService }, { token: AppConfigService }], target: i0.ɵɵFactoryTarget.Component }); }
20150
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: CoreFormComponent, isStandalone: true, selector: "core-form", inputs: { formName: "formName", width: "width", submitText: "submitText", leftInputSections: "leftInputSections", leftInputSectionsFlexSize: "leftInputSectionsFlexSize", inputSections: "inputSections", mode$: "mode$", bottomTemplateRef: "bottomTemplateRef", customFormButtonItems: "customFormButtonItems", showCaptionButton: "showCaptionButton", disableSaveButton: "disableSaveButton", disableCancelButton: "disableCancelButton", checkError$: "checkError$" }, outputs: { onFormCreated: "onFormCreated", onFormRefCreated: "onFormRefCreated", onSubmit: "onSubmit", onSave: "onSave", onCancal: "onCancal", buttonClick: "buttonClick" }, viewQueries: [{ propertyName: "formRef", first: true, predicate: ["formRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "@if (!!form) {\r\n<div class=\"core-form-container\" [ngStyle]=\"{\r\n width: !!width ? width + 'px' : 'auto'\r\n}\">\r\n\r\n <form #formRef (ngSubmit)=\"onFormSubmit()\" [formGroup]=\"form\" autocomplete=\"off\">\r\n\r\n <div class=\"row\">\r\n\r\n @if (!!leftInputSections) {\r\n <div [class]=\"'col-md-' + (leftInputSectionsFlexSize || 0)\">\r\n\r\n @for (section of leftInputSections; track $index) {\r\n <div class=\"section\"\r\n [class.d-none]=\"(!!isUpdateMode && section.addModeOnly) || (!!!isUpdateMode && section.updateModeOnly) || !!section.hidden\">\r\n\r\n @if (!!section.caption) {\r\n <div class=\"section-header-label\">\r\n <div class=\"section-img-wrapper\">\r\n <div class=\"section-img\"></div>\r\n </div>\r\n <div class=\"section-caption\">{{ section.caption | translate: lang }}</div>\r\n </div>\r\n }\r\n\r\n @for (row of section.rows; track $index) {\r\n <div class=\"row mb15\">\r\n @for (col of row; track $index) {\r\n <div [class]=\"'col-md-' + col.flexSize\" [class.grid-buffer]=\"col.controlType==='GRIDBUFFER'\"\r\n [class.button-control]=\"col.controlType==='BUTTON'\">\r\n <core-control [control]=\"col\" [form]=\"form\" [checkError$]=\"checkError$\"></core-control>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n </div>\r\n\r\n }\r\n\r\n </div>\r\n }\r\n\r\n <div [class]=\"'col-md-' + (12 - (leftInputSectionsFlexSize || 0))\">\r\n\r\n @for (section of sections; track $index) {\r\n <div class=\"section\"\r\n [class.d-none]=\"(!!isUpdateMode && section.addModeOnly) || (!!!isUpdateMode && section.updateModeOnly) || !!section.hidden\" [ngStyle]=\"{\r\n maxWidth: !!section.maxWidth ? section.maxWidth + 'px' : 'none'\r\n }\">\r\n\r\n @if (!!section.caption) {\r\n <div class=\"section-header-label\">\r\n <div class=\"section-img-wrapper\">\r\n <div class=\"section-img\"></div>\r\n </div>\r\n <div class=\"section-caption\">{{ section.caption | translate: lang }}</div>\r\n </div>\r\n }\r\n\r\n @for (row of section.rows; track $index) {\r\n <div class=\"row mb15\">\r\n @for (col of row; track $index) {\r\n <div [class]=\"'col-md-' + col.flexSize\" [class.grid-buffer]=\"col.controlType==='GRIDBUFFER'\"\r\n [class.button-control]=\"col.controlType==='BUTTON'\">\r\n <core-control [control]=\"col\" [form]=\"form\" [checkError$]=\"checkError$\"></core-control>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n </div>\r\n }\r\n\r\n </div>\r\n\r\n @if (!!bottomTemplateRef) {\r\n <div class=\"col-md-12\">\r\n <div class=\"bottom-template-wrapper\">\r\n <ng-container *ngTemplateOutlet=\"bottomTemplateRef\"></ng-container>\r\n </div>\r\n </div>\r\n }\r\n\r\n </div>\r\n\r\n <div class=\"h10\"></div>\r\n\r\n <div class=\"form-row\">\r\n <div class=\"d-flex d-flex-end w-100 pr18\">\r\n <core-button-group-vns [showCaption]=\"showCaptionButton\" [forHeader]=\"false\"\r\n (buttonClick)=\"onButtonClick($event)\" [shownItems]=\"buttonItems\"\r\n class=\"buttonGroupCustom\"></core-button-group-vns>\r\n </div>\r\n </div>\r\n @if (isDevMode) {\r\n <div class=\"form-row d-flex d-flex-center\">\r\n <div class=\"dev-button\" (click)=\"updatePayload()\">Show\r\n values</div>\r\n <div class=\"dev-button\" (click)=\"updateValidorOverview()\">Show\r\n validators</div>\r\n </div>\r\n }\r\n\r\n </form>\r\n\r\n @if (!!payLoad && isDevMode) {\r\n <div class=\"form-row payload-preview\">\r\n <strong>Current values</strong><br>{{payLoad}}\r\n </div>\r\n }\r\n\r\n @if (!!validatorOverview && isDevMode) {\r\n <div class=\"form-row payload-preview validator-preview\">\r\n <strong>Current errors</strong><br>{{validatorOverview}}\r\n </div>\r\n }\r\n\r\n</div>\r\n}", styles: [".core-form-container{overflow-x:visible}.core-form-container>form .section{margin-top:var(--size-layout-block-cell-spacing)}.core-form-container>form .section:not(:first-child){margin-top:calc(var(--size-layout-block-cell-spacing) * 2)}.core-form-container>form .section .section-header-label{display:block;height:34px;line-height:34px;margin-bottom:15px;margin-left:12px}.core-form-container>form .section .section-header-label .section-img-wrapper{position:relative}.core-form-container>form .section .section-header-label .section-img-wrapper .section-img{position:absolute;width:34px;height:34px;border-radius:50%;background-color:#d3d3d3;float:left;background-image:url(/assets/images/info.svg);background-repeat:no-repeat;background-position:center}.core-form-container>form .section .section-header-label .section-caption{padding-left:40px;font-weight:700;color:#696969}.core-form-container .row{margin-left:var(--size-layout-block-cell-spacing) 0px;margin-right:var(--size-layout-block-cell-spacing) 0px}.core-form-container .row .grid-buffer{border:dotted 2px darkgray}.core-form-container .row .button-control{display:flex;align-items:flex-end}.core-form-container .form-row{margin:var(--size-layout-block-cell-spacing) 0px;display:flex;align-items:center;justify-content:center}.core-form-container .form-row>button{cursor:pointer;border-radius:0}.core-form-container .form-row>button:not(:first-child){margin-left:var(--size-layout-block-cell-spacing)}.core-form-container .dev-button{cursor:pointer;display:flex;align-items:center;border:1px gray solid;font-size:13px;padding:8px}.core-form-container .payload-preview{display:block;width:calc(100% - 48px);height:200px;white-space:pre-wrap;overflow-x:hidden;overflow-y:auto;color:gray!important;background-color:#dff6dd;padding:24px;margin:24px}.core-form-container .payload-preview.validator-preview{background-color:#fff4ce}.core-form-container .bottom-template-wrapper{padding-left:12px;padding-right:12px}.core-form-container .w-100{width:100%}.core-form-container .pr18{padding-right:18px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: CoreControlComponent, selector: "core-control", inputs: ["control", "form", "checkError$", "rangeLimit"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "component", type: CoreButtonGroupVnsComponent, selector: "core-button-group-vns", inputs: ["height", "instanceNumber", "forHeader", "fixedShow", "shownItems", "showCaption", "lastChildEffectOff"], outputs: ["buttonClick"] }] }); }
20151
- }
20152
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreFormComponent, decorators: [{
20153
- type: Component,
20154
- args: [{ selector: 'core-form', imports: [
20155
- CommonModule,
20059
+ onItemCheck(e, newValue) {
20060
+ this.itemClick?.emit(e);
20061
+ if (this.accessorMode !== EnumCoreArticleCategoryTreeaAccessorMode.CHECKED)
20062
+ return;
20063
+ // We have this var to hold nodes that are being changed
20064
+ let toggledIds;
20065
+ // We should calculate a new state into this var:
20066
+ const newCheckedIds = JSON.parse(JSON.stringify(this.checkedIds));
20067
+ // We will call this function after toggledIds changed
20068
+ const changeValue = () => {
20069
+ // If newValue === true, we will disctintly push changed ids to the state
20070
+ // Otherwise we will remove them from the state
20071
+ if (!!newValue) {
20072
+ toggledIds.map(x => {
20073
+ if (!!!newCheckedIds.includes(x)) {
20074
+ newCheckedIds.push(x);
20075
+ }
20076
+ });
20077
+ // Then asign the state to the newCheckedIds
20078
+ this.checkedIds = newCheckedIds;
20079
+ }
20080
+ else {
20081
+ const filter = newCheckedIds.filter(x => !!!toggledIds.includes(x));
20082
+ // Then asign the state to the filter
20083
+ this.checkedIds = filter;
20084
+ }
20085
+ // After the cases of if/else, make the control change with onChange
20086
+ this.value = this.checkedIds;
20087
+ this.onChange(this.checkedIds);
20088
+ this.markAsTouched();
20089
+ };
20090
+ /* start: THIS CODE SCOPE calculates toggledIds */
20091
+ if (this.checkInheritance) {
20092
+ // If true, all the nested items will be checked/unchecked
20093
+ this.recursiveService
20094
+ .nestedToggleCheck(e, newValue)
20095
+ .then((x) => {
20096
+ // The ids have been changed
20097
+ toggledIds = x;
20098
+ // Now toggledIds were set. We call the function we declared
20099
+ changeValue();
20100
+ })
20101
+ .catch((x) => {
20102
+ console.error(x);
20103
+ });
20104
+ }
20105
+ else {
20106
+ // Otherwise we simply toggle check for current item only
20107
+ toggledIds = [e.id];
20108
+ // Now toggledIds were set. We call the function we declared
20109
+ changeValue();
20110
+ }
20111
+ /* end: THIS CODE SCOPE calculates toggledIds */
20112
+ // That is. Happy debugging!
20113
+ }
20114
+ onCheckIncludeDissolvedChange(value) {
20115
+ console.log("onCheckIncludeDissolvedChange", value);
20116
+ }
20117
+ onCheckInheritanceChange(value) {
20118
+ this.topicTreeService.status$.next({
20119
+ ...this.topicTreeService.status$.value,
20120
+ checkInheritance: value,
20121
+ });
20122
+ }
20123
+ onObjectClick(e, event) {
20124
+ // remove highlight class
20125
+ // TO DO
20126
+ if (!!e.protected)
20127
+ return;
20128
+ this.itemClick?.emit(e);
20129
+ if (this.accessorMode === EnumCoreArticleCategoryTreeaAccessorMode.CHECKED)
20130
+ return;
20131
+ let activeIds = [];
20132
+ this.recursiveService.nestedResetActive(this.data, false).then(falseAll => {
20133
+ console.log("falseAll", falseAll);
20134
+ if (this.accessorMode ===
20135
+ EnumCoreArticleCategoryTreeaAccessorMode.ACTIVATED_INHERITANCE || !this.accessorMode) {
20136
+ // If true, all the nested items will be active, the others are inactive
20137
+ this.recursiveService
20138
+ .nestedResetActive(e, true)
20139
+ .then((x) => {
20140
+ activeIds = x;
20141
+ activeIds.sort();
20142
+ const newActiveKeys = [];
20143
+ activeIds.map((x) => newActiveKeys.push(x.toString()));
20144
+ this.topicTreeService.status$.next({
20145
+ ...this.topicTreeService.status$.value,
20146
+ activeKeys: newActiveKeys,
20147
+ selectedKey: e.id.toString()
20148
+ });
20149
+ this.activeIds = activeIds;
20150
+ console.log(this.activeIds);
20151
+ this.onChange(activeIds);
20152
+ })
20153
+ .catch((x) => {
20154
+ console.error(x);
20155
+ });
20156
+ }
20157
+ else {
20158
+ // ACTIVATED_SINGLE
20159
+ // Otherwise we simply set current item to be active only
20160
+ activeIds = [e.id];
20161
+ this.activeIds = activeIds;
20162
+ this.topicTreeService.status$.next({
20163
+ ...this.topicTreeService.status$.value,
20164
+ activeKeys: [e.id.toString()],
20165
+ selectedKey: e.id.toString(),
20166
+ });
20167
+ this.onChange(activeIds);
20168
+ }
20169
+ });
20170
+ const { detail } = event;
20171
+ if (detail === 2) {
20172
+ console.log('This was a dblclick');
20173
+ this.itemDoubleClick.emit(e);
20174
+ }
20175
+ this.selectedItem = e;
20176
+ }
20177
+ onSearchChange(text) {
20178
+ this.search$.next(text);
20179
+ }
20180
+ ngAfterContentInit() {
20181
+ console.log("ngAfterContentInit");
20182
+ }
20183
+ ngOnDestroy() {
20184
+ this.subscriptions.map((x) => x?.unsubscribe());
20185
+ if (!!this.instanceNumber) {
20186
+ const tryToFind = this.topicTreeService.instances.filter((x) => x.instanceNumber === this.instanceNumber);
20187
+ if (!!tryToFind.length) {
20188
+ const newInstances = this.topicTreeService.instances.filter((x) => x.instanceNumber !== this.instanceNumber);
20189
+ this.topicTreeService.instances = newInstances;
20190
+ }
20191
+ }
20192
+ }
20193
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreTopicTreeComponent, deps: [{ token: AuthService }, { token: RecursiveService }, { token: MultiLanguageService }, { token: LayoutService }, { token: TopicTreeService }, { token: AlertService }], target: i0.ɵɵFactoryTarget.Component }); }
20194
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: CoreTopicTreeComponent, isStandalone: true, selector: "core-topic-tree", inputs: { lineColor: "lineColor", translateText: "translateText", fullWidthMode: "fullWidthMode", accessorMode: "accessorMode", fullRendering: "fullRendering", height: "height", disabledLoopExpand: "disabledLoopExpand", showCheckInheritance: "showCheckInheritance", inlineExtraTemplateRef: "inlineExtraTemplateRef" }, outputs: { itemDoubleClick: "itemDoubleClick", itemClick: "itemClick" }, providers: [
20195
+ {
20196
+ provide: NG_VALUE_ACCESSOR,
20197
+ multi: true,
20198
+ useExisting: CoreTopicTreeComponent,
20199
+ },
20200
+ ], viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true }, { propertyName: "displayContent", first: true, predicate: ["displayContent"], descendants: true }, { propertyName: "reducedIconWrapper", first: true, predicate: ["reducedIconWrapper"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div #container class=\"core-topic-tree-container\" [class.full-width]=\"!!fullWidthMode\" *ngIf=\"!!data\"\n [ngStyle]=\"{\n position : 'relative',\n width: '100%',\n height: height + 'px'\n }\">\n <div #displayContent class=\"custom-org-tree\">\n <div class=\"core-org-tree-header d-flex-between\">\n <div>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"search\" (ngModelChange)=\"onSearchChange($event)\"\n [placeholder]=\"searchPlaceholder | translate: lang\" [class.full-width]=\"!!fullWidthMode\">\n </div>\n </div>\n\n <ng-container>\n\n <div class=\"scroll-container\" [ngStyle]=\"{\n height: height - layoutService.coreOrgTreeTopHeight - layoutService.coreOrgTreeBottomHeight + 'px'\n }\">\n <core-loading-surface [loading]=\"loading\" [height]=\"scrollContainerHeight\"></core-loading-surface>\n @for (root of data; track $index) {\n <ul class=\"root\" [class.collapsed]=\"!!!root.tree$Expanded\">\n <ng-container *ngTemplateOutlet=\"item; context: { context: root }\"></ng-container>\n </ul>\n }\n </div>\n\n\n <div [ngStyle]=\"{\n display: 'block',\n position: 'absolute',\n bottom: '0px',\n left: '0px',\n right: '0px',\n height: layoutService.corePaginationHeight + 'px',\n paddingLeft: layoutService.basicSpacing + 'px',\n paddingRight: layoutService.basicSpacing + 'px',\n lineHeight: layoutService.corePaginationHeight + 'px',\n overflow: 'hidden'\n }\">\n <div [ngStyle]=\"{\n height: layoutService.corePaginationHeight + 'px',\n position: 'relative',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between'\n }\">\n <!-- <div>\n <core-checkbox [(ngModel)]=\"showDissolved\"\n (ngModelChange)=\"onCheckIncludeDissolvedChange($event)\"\n [text]=\"'UI.CORE_ORG_TREE.SHOW_OUTDATED_UNITS_ABBREVIATED'\"\n [tooltip]=\"'UI.CORE_ORG_TREE.SHOW_OUTDATED_UNITS'\" tooltipPosition=\"above\"></core-checkbox>\n </div> -->\n <div class=\"check-inheritance-wrapper\" *ngIf=\"accessorMode === 'CHECKED'\">\n <core-checkbox *ngIf=\"showCheckInheritance\" [(ngModel)]=\"checkInheritance\"\n (ngModelChange)=\"onCheckInheritanceChange($event)\"\n [text]=\"'UI.CORE_ORG_TREE.CHECK_INHERITANCE'\"></core-checkbox>\n </div>\n </div>\n </div>\n\n <ng-template #item let-context=\"context\" let-id=\"context.id\" let-title=\"context.tree$Title\"\n let-highlighted=\"context.tree$Highlighted\" let-hasChildren=\"context.tree$HasChildren\"\n let-hasActiveChildren=\"context.tree$HasActiveChildren\" let-children=\"context.tree$Children\"\n let-expanded=\"context.tree$Expanded\" let-isActive=\"context.isActive\" let-active=\"context.tree$Active\"\n let-checked=\"context.tree$Checked\" let-protected=\"context.protected\">\n\n @if ((!showDissolved && !!isActive) || (!!showDissolved)) {\n <li [class.has-children]=\"!!hasChildren\" [class.collapsed]=\"!!hasChildren && !!!expanded\">\n <span (click)=\"onObjectClick(context, $event)\">\n @if ((!!showDissolved && !!hasChildren) || (!showDissolved && !!hasActiveChildren)) {\n <i class=\"expand-toggler feather-chevron-down\"\n (click)=\"onExpandTogglerClick(context, $event)\"></i>\n }\n @if (accessorMode === 'CHECKED' && !!!protected) {\n <core-checkbox (onClick)=\"onItemCheck(context, $event)\" [inputValue]=\"checked\"\n [disabled]=\"disabled\"></core-checkbox>\n }\n <object [class.active]=\"activeIds.includes(id)\" [class.highlighted]=\"highlighted\"\n [class.dissolved]=\"!isActive\" [class.protected]=\"protected\"\n [appTooltip]=\"title\">\n {{ title | translate: lang }}\n </object>\n\n @if (!!inlineExtraTemplateRef) {\n <ng-container *ngTemplateOutlet=\"inlineExtraTemplateRef; context: { context: context }\">\n </ng-container>\n }\n\n </span>\n @if (children.length) {\n <ul [class.collapsed]=\" !!!expanded\">\n @for (child of children; track $index) {\n @if (!!expanded || !!fullRendering) {\n <ng-container *ngTemplateOutlet=\"item; context: { context: child }\"></ng-container>\n }\n }\n </ul>\n }\n </li>\n }\n\n </ng-template>\n\n </ng-container>\n </div>\n\n\n</div>", styles: [".core-topic-tree-container{--background: var(--color-bg-core-org-tree);--height: 545px;border-radius:5px;--item-height: 50px;--ul-padding: 20px;--display: \"block\";--square-color: darkgray;--square-size: 30px;--line-color: \"transparent\";--active-item-color: var(--color-bg-pagination-button);--line-size: 1px;--reduced-icon-wrapper-height: 50px;--reduced-panel-height: calc(var(--height) - var(--reduced-icon-wrapper-height));--scroll-container-height: calc(var(--height) - var(--size-core-reducer-icon-wrapper-height) - var(--size-pagination-height));color:#000;background-color:var(--color-bg-core-org-tree)!important;height:var(--height);background:var(--background);width:var(--size-core-org-tree-width);transition:width .5s ease-out}@keyframes reducedPanelOn{0%{opacity:0;transform:rotate(-90deg)}to{opacity:1;transform:rotate(0)}}.core-topic-tree-container .custom-org-tree{display:var(--display)}.core-topic-tree-container .core-org-tree-header{height:var(--size-core-org-tree-header-height)}.core-topic-tree-container .core-org-tree-header input{width:calc(var(--size-core-org-tree-width) - var(--size-layout-block-cell-spacing) * 2 - var(--size-scrollbar-width) + 6px)}.core-topic-tree-container .core-org-tree-header input.full-width{width:calc(var(--size-core-org-tree-width) - var(--size-layout-block-cell-spacing) * 2)}.core-topic-tree-container .check-inheritance-wrapper{padding:15px}.core-topic-tree-container .form-control{border:none}.core-topic-tree-container .core-reducer-icon-wrapper{height:var(--size-core-reducer-icon-wrapper-height);padding:var(--size-layout-block-cell-spacing)}.core-topic-tree-container .scroll-container{background:var(--background);height:var(--scroll-container-height);overflow-y:auto;overflow-x:auto;position:relative;width:100%;border-radius:5px}.core-topic-tree-container .scroll-container *{box-sizing:border-box;padding:0;margin:0}@media (max-width: 575px){.core-topic-tree-container .scroll-container ::-webkit-slider-runnable-track{width:0px}}.core-topic-tree-container .scroll-container ul{display:table;vertical-align:top;padding-left:var(--ul-padding);transition:all .5s ease-out;width:100%}.core-topic-tree-container .scroll-container ul>li>span:hover{background-color:#fff;width:100%}.core-topic-tree-container .scroll-container ul>li>span:active{background-color:#f1f1f1}.core-topic-tree-container .scroll-container ul>li>span>object.active{color:var(--active-item-color)}.core-topic-tree-container .scroll-container ul .highlighted{color:var(--color-core-org-tree-highlighted);font-weight:700}.core-topic-tree-container .scroll-container ul .dissolved{color:#848484;text-decoration:line-through dashed}.core-topic-tree-container .scroll-container ul .dissolved.active{color:#c9252b!important}.core-topic-tree-container .scroll-container ul>li{display:block;position:relative}.core-topic-tree-container .scroll-container ul>li:before{content:\"\";display:block;position:absolute;width:var(--ul-padding);left:calc(var(--ul-padding) * -1);top:calc(var(--item-height) / 2);height:calc(var(--item-height) / 2);border-top:solid var(--line-size) var(--line-color);border-right:none;border-bottom:none;border-left:solid var(--line-size) var(--line-color);z-index:0}.core-topic-tree-container .scroll-container ul>li>span{display:flex;align-items:center;height:var(--item-height);white-space:nowrap;padding-left:8px;cursor:pointer}.core-topic-tree-container .scroll-container ul>li>span>i{color:var(--square-color);cursor:pointer;font-size:var(--square-size);width:var(--square-size);height:var(--square-size)}.core-topic-tree-container .scroll-container ul>li>span>.expand-toggler{position:absolute;z-index:1;transform:translate(-100%) rotate(0);transition:.5s ease-out;display:flex;align-items:center;justify-content:center}.core-topic-tree-container .scroll-container ul>li>span>.check-toggler{margin-left:5px;margin-right:5px}.core-topic-tree-container .scroll-container ul>li>ul>li>span:before{content:\"\";display:block;position:absolute;width:var(--ul-padding);left:calc(var(--ul-padding) * -2);top:calc(var(--item-height) / 2);height:var(--line-size);border-top:solid var(--line-size) var(--line-color);z-index:0}.core-topic-tree-container .scroll-container ul>li.collapsed>span>.expand-toggler{transform:translate(-100%) rotate(-90deg);transition:.5s ease-out}.core-topic-tree-container .scroll-container ul>li.collapsed:before{border-left:none}.core-topic-tree-container .scroll-container ul>li:not(.collapsed):not(.has-children):before{border-left:none}.core-topic-tree-container .scroll-container ul:not(.root):before{content:\"\";display:block;position:absolute;width:var(--line-size);left:calc(var(--ul-padding) * -1);height:calc(100% - var(--item-height) * 1.5);border-left:solid var(--line-size) var(--line-color);z-index:0}.core-topic-tree-container .scroll-container ul:not(.root)>li:last-child:not(.collapsed).has-children:after{content:\"\";display:block;position:absolute;height:calc(100% - var(--item-height));width:calc(var(--ul-padding) / 2);left:calc(var(--ul-padding) * -2);top:calc(var(--item-height) / 2);border-left:solid var(--line-size) var(--background);z-index:0}.core-topic-tree-container .scroll-container ul.collapsed:not(.root){display:none}.core-topic-tree-container .collapsed>li:before{display:none!important}.core-org-tree-container.full-width .scroll-container{width:auto}.core-org-tree-container.reduced{width:50px;padding:0;transition:width .5s ease-out}.core-org-tree-container.reduced .scroll-container{overflow:hidden}.core-org-tree-container.reduced .scroll-container>ul.root{display:none}.core-org-tree-container.reduced .scroll-container>.reduced-panel{color:var(--active-item-color);width:50px;height:var(--reduced-panel-height);writing-mode:vertical-rl;text-orientation:mixed;display:flex;align-items:center;justify-content:center;font-weight:700;animation:reducedPanelOn .5s ease-out}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: CoreLoadingSurfaceComponent, selector: "core-loading-surface", inputs: ["loading", "height"] }, { kind: "component", type: CoreCheckboxComponent, selector: "core-checkbox", inputs: ["text", "tooltipPosition", "tooltip", "inputValue", "disabled"], outputs: ["onClick"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "directive", type: TooltipDirective, selector: "[appTooltip]", inputs: ["color", "backgroundColor", "appTooltip", "showAnyway", "position"] }] }); }
20201
+ }
20202
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreTopicTreeComponent, decorators: [{
20203
+ type: Component,
20204
+ args: [{ selector: 'core-topic-tree', imports: [
20205
+ CommonModule,
20156
20206
  FormsModule,
20157
- ReactiveFormsModule,
20158
- CoreControlComponent,
20207
+ CoreLoadingSurfaceComponent,
20208
+ CoreReducerIconComponent,
20209
+ CoreCheckboxComponent,
20159
20210
  TranslatePipe,
20160
- CoreButtonGroupVnsComponent
20161
- ], template: "@if (!!form) {\r\n<div class=\"core-form-container\" [ngStyle]=\"{\r\n width: !!width ? width + 'px' : 'auto'\r\n}\">\r\n\r\n <form #formRef (ngSubmit)=\"onFormSubmit()\" [formGroup]=\"form\" autocomplete=\"off\">\r\n\r\n <div class=\"row\">\r\n\r\n @if (!!leftInputSections) {\r\n <div [class]=\"'col-md-' + (leftInputSectionsFlexSize || 0)\">\r\n\r\n @for (section of leftInputSections; track $index) {\r\n <div class=\"section\"\r\n [class.d-none]=\"(!!isUpdateMode && section.addModeOnly) || (!!!isUpdateMode && section.updateModeOnly) || !!section.hidden\">\r\n\r\n @if (!!section.caption) {\r\n <div class=\"section-header-label\">\r\n <div class=\"section-img-wrapper\">\r\n <div class=\"section-img\"></div>\r\n </div>\r\n <div class=\"section-caption\">{{ section.caption | translate: lang }}</div>\r\n </div>\r\n }\r\n\r\n @for (row of section.rows; track $index) {\r\n <div class=\"row mb15\">\r\n @for (col of row; track $index) {\r\n <div [class]=\"'col-md-' + col.flexSize\" [class.grid-buffer]=\"col.controlType==='GRIDBUFFER'\"\r\n [class.button-control]=\"col.controlType==='BUTTON'\">\r\n <core-control [control]=\"col\" [form]=\"form\" [checkError$]=\"checkError$\"></core-control>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n </div>\r\n\r\n }\r\n\r\n </div>\r\n }\r\n\r\n <div [class]=\"'col-md-' + (12 - (leftInputSectionsFlexSize || 0))\">\r\n\r\n @for (section of sections; track $index) {\r\n <div class=\"section\"\r\n [class.d-none]=\"(!!isUpdateMode && section.addModeOnly) || (!!!isUpdateMode && section.updateModeOnly) || !!section.hidden\" [ngStyle]=\"{\r\n maxWidth: !!section.maxWidth ? section.maxWidth + 'px' : 'none'\r\n }\">\r\n\r\n @if (!!section.caption) {\r\n <div class=\"section-header-label\">\r\n <div class=\"section-img-wrapper\">\r\n <div class=\"section-img\"></div>\r\n </div>\r\n <div class=\"section-caption\">{{ section.caption | translate: lang }}</div>\r\n </div>\r\n }\r\n\r\n @for (row of section.rows; track $index) {\r\n <div class=\"row mb15\">\r\n @for (col of row; track $index) {\r\n <div [class]=\"'col-md-' + col.flexSize\" [class.grid-buffer]=\"col.controlType==='GRIDBUFFER'\"\r\n [class.button-control]=\"col.controlType==='BUTTON'\">\r\n <core-control [control]=\"col\" [form]=\"form\" [checkError$]=\"checkError$\"></core-control>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n </div>\r\n }\r\n\r\n </div>\r\n\r\n @if (!!bottomTemplateRef) {\r\n <div class=\"col-md-12\">\r\n <div class=\"bottom-template-wrapper\">\r\n <ng-container *ngTemplateOutlet=\"bottomTemplateRef\"></ng-container>\r\n </div>\r\n </div>\r\n }\r\n\r\n </div>\r\n\r\n <div class=\"h10\"></div>\r\n\r\n <div class=\"form-row\">\r\n <div class=\"d-flex d-flex-end w-100 pr18\">\r\n <core-button-group-vns [showCaption]=\"showCaptionButton\" [forHeader]=\"false\"\r\n (buttonClick)=\"onButtonClick($event)\" [shownItems]=\"buttonItems\"\r\n class=\"buttonGroupCustom\"></core-button-group-vns>\r\n </div>\r\n </div>\r\n @if (isDevMode) {\r\n <div class=\"form-row d-flex d-flex-center\">\r\n <div class=\"dev-button\" (click)=\"updatePayload()\">Show\r\n values</div>\r\n <div class=\"dev-button\" (click)=\"updateValidorOverview()\">Show\r\n validators</div>\r\n </div>\r\n }\r\n\r\n </form>\r\n\r\n @if (!!payLoad && isDevMode) {\r\n <div class=\"form-row payload-preview\">\r\n <strong>Current values</strong><br>{{payLoad}}\r\n </div>\r\n }\r\n\r\n @if (!!validatorOverview && isDevMode) {\r\n <div class=\"form-row payload-preview validator-preview\">\r\n <strong>Current errors</strong><br>{{validatorOverview}}\r\n </div>\r\n }\r\n\r\n</div>\r\n}", styles: [".core-form-container{overflow-x:visible}.core-form-container>form .section{margin-top:var(--size-layout-block-cell-spacing)}.core-form-container>form .section:not(:first-child){margin-top:calc(var(--size-layout-block-cell-spacing) * 2)}.core-form-container>form .section .section-header-label{display:block;height:34px;line-height:34px;margin-bottom:15px;margin-left:12px}.core-form-container>form .section .section-header-label .section-img-wrapper{position:relative}.core-form-container>form .section .section-header-label .section-img-wrapper .section-img{position:absolute;width:34px;height:34px;border-radius:50%;background-color:#d3d3d3;float:left;background-image:url(/assets/images/info.svg);background-repeat:no-repeat;background-position:center}.core-form-container>form .section .section-header-label .section-caption{padding-left:40px;font-weight:700;color:#696969}.core-form-container .row{margin-left:var(--size-layout-block-cell-spacing) 0px;margin-right:var(--size-layout-block-cell-spacing) 0px}.core-form-container .row .grid-buffer{border:dotted 2px darkgray}.core-form-container .row .button-control{display:flex;align-items:flex-end}.core-form-container .form-row{margin:var(--size-layout-block-cell-spacing) 0px;display:flex;align-items:center;justify-content:center}.core-form-container .form-row>button{cursor:pointer;border-radius:0}.core-form-container .form-row>button:not(:first-child){margin-left:var(--size-layout-block-cell-spacing)}.core-form-container .dev-button{cursor:pointer;display:flex;align-items:center;border:1px gray solid;font-size:13px;padding:8px}.core-form-container .payload-preview{display:block;width:calc(100% - 48px);height:200px;white-space:pre-wrap;overflow-x:hidden;overflow-y:auto;color:gray!important;background-color:#dff6dd;padding:24px;margin:24px}.core-form-container .payload-preview.validator-preview{background-color:#fff4ce}.core-form-container .bottom-template-wrapper{padding-left:12px;padding-right:12px}.core-form-container .w-100{width:100%}.core-form-container .pr18{padding-right:18px}\n"] }]
20162
- }], ctorParameters: () => [{ type: CoreControlService }, { type: MultiLanguageService }, { type: AlertService }, { type: CoreFormService }, { type: AppConfigService }], propDecorators: { formName: [{
20163
- type: Input
20164
- }], width: [{
20165
- type: Input
20166
- }], submitText: [{
20167
- type: Input
20168
- }], leftInputSections: [{
20169
- type: Input
20170
- }], leftInputSectionsFlexSize: [{
20211
+ TooltipDirective,
20212
+ NgTemplateOutlet
20213
+ ], providers: [
20214
+ {
20215
+ provide: NG_VALUE_ACCESSOR,
20216
+ multi: true,
20217
+ useExisting: CoreTopicTreeComponent,
20218
+ },
20219
+ ], template: "<div #container class=\"core-topic-tree-container\" [class.full-width]=\"!!fullWidthMode\" *ngIf=\"!!data\"\n [ngStyle]=\"{\n position : 'relative',\n width: '100%',\n height: height + 'px'\n }\">\n <div #displayContent class=\"custom-org-tree\">\n <div class=\"core-org-tree-header d-flex-between\">\n <div>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"search\" (ngModelChange)=\"onSearchChange($event)\"\n [placeholder]=\"searchPlaceholder | translate: lang\" [class.full-width]=\"!!fullWidthMode\">\n </div>\n </div>\n\n <ng-container>\n\n <div class=\"scroll-container\" [ngStyle]=\"{\n height: height - layoutService.coreOrgTreeTopHeight - layoutService.coreOrgTreeBottomHeight + 'px'\n }\">\n <core-loading-surface [loading]=\"loading\" [height]=\"scrollContainerHeight\"></core-loading-surface>\n @for (root of data; track $index) {\n <ul class=\"root\" [class.collapsed]=\"!!!root.tree$Expanded\">\n <ng-container *ngTemplateOutlet=\"item; context: { context: root }\"></ng-container>\n </ul>\n }\n </div>\n\n\n <div [ngStyle]=\"{\n display: 'block',\n position: 'absolute',\n bottom: '0px',\n left: '0px',\n right: '0px',\n height: layoutService.corePaginationHeight + 'px',\n paddingLeft: layoutService.basicSpacing + 'px',\n paddingRight: layoutService.basicSpacing + 'px',\n lineHeight: layoutService.corePaginationHeight + 'px',\n overflow: 'hidden'\n }\">\n <div [ngStyle]=\"{\n height: layoutService.corePaginationHeight + 'px',\n position: 'relative',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between'\n }\">\n <!-- <div>\n <core-checkbox [(ngModel)]=\"showDissolved\"\n (ngModelChange)=\"onCheckIncludeDissolvedChange($event)\"\n [text]=\"'UI.CORE_ORG_TREE.SHOW_OUTDATED_UNITS_ABBREVIATED'\"\n [tooltip]=\"'UI.CORE_ORG_TREE.SHOW_OUTDATED_UNITS'\" tooltipPosition=\"above\"></core-checkbox>\n </div> -->\n <div class=\"check-inheritance-wrapper\" *ngIf=\"accessorMode === 'CHECKED'\">\n <core-checkbox *ngIf=\"showCheckInheritance\" [(ngModel)]=\"checkInheritance\"\n (ngModelChange)=\"onCheckInheritanceChange($event)\"\n [text]=\"'UI.CORE_ORG_TREE.CHECK_INHERITANCE'\"></core-checkbox>\n </div>\n </div>\n </div>\n\n <ng-template #item let-context=\"context\" let-id=\"context.id\" let-title=\"context.tree$Title\"\n let-highlighted=\"context.tree$Highlighted\" let-hasChildren=\"context.tree$HasChildren\"\n let-hasActiveChildren=\"context.tree$HasActiveChildren\" let-children=\"context.tree$Children\"\n let-expanded=\"context.tree$Expanded\" let-isActive=\"context.isActive\" let-active=\"context.tree$Active\"\n let-checked=\"context.tree$Checked\" let-protected=\"context.protected\">\n\n @if ((!showDissolved && !!isActive) || (!!showDissolved)) {\n <li [class.has-children]=\"!!hasChildren\" [class.collapsed]=\"!!hasChildren && !!!expanded\">\n <span (click)=\"onObjectClick(context, $event)\">\n @if ((!!showDissolved && !!hasChildren) || (!showDissolved && !!hasActiveChildren)) {\n <i class=\"expand-toggler feather-chevron-down\"\n (click)=\"onExpandTogglerClick(context, $event)\"></i>\n }\n @if (accessorMode === 'CHECKED' && !!!protected) {\n <core-checkbox (onClick)=\"onItemCheck(context, $event)\" [inputValue]=\"checked\"\n [disabled]=\"disabled\"></core-checkbox>\n }\n <object [class.active]=\"activeIds.includes(id)\" [class.highlighted]=\"highlighted\"\n [class.dissolved]=\"!isActive\" [class.protected]=\"protected\"\n [appTooltip]=\"title\">\n {{ title | translate: lang }}\n </object>\n\n @if (!!inlineExtraTemplateRef) {\n <ng-container *ngTemplateOutlet=\"inlineExtraTemplateRef; context: { context: context }\">\n </ng-container>\n }\n\n </span>\n @if (children.length) {\n <ul [class.collapsed]=\" !!!expanded\">\n @for (child of children; track $index) {\n @if (!!expanded || !!fullRendering) {\n <ng-container *ngTemplateOutlet=\"item; context: { context: child }\"></ng-container>\n }\n }\n </ul>\n }\n </li>\n }\n\n </ng-template>\n\n </ng-container>\n </div>\n\n\n</div>", styles: [".core-topic-tree-container{--background: var(--color-bg-core-org-tree);--height: 545px;border-radius:5px;--item-height: 50px;--ul-padding: 20px;--display: \"block\";--square-color: darkgray;--square-size: 30px;--line-color: \"transparent\";--active-item-color: var(--color-bg-pagination-button);--line-size: 1px;--reduced-icon-wrapper-height: 50px;--reduced-panel-height: calc(var(--height) - var(--reduced-icon-wrapper-height));--scroll-container-height: calc(var(--height) - var(--size-core-reducer-icon-wrapper-height) - var(--size-pagination-height));color:#000;background-color:var(--color-bg-core-org-tree)!important;height:var(--height);background:var(--background);width:var(--size-core-org-tree-width);transition:width .5s ease-out}@keyframes reducedPanelOn{0%{opacity:0;transform:rotate(-90deg)}to{opacity:1;transform:rotate(0)}}.core-topic-tree-container .custom-org-tree{display:var(--display)}.core-topic-tree-container .core-org-tree-header{height:var(--size-core-org-tree-header-height)}.core-topic-tree-container .core-org-tree-header input{width:calc(var(--size-core-org-tree-width) - var(--size-layout-block-cell-spacing) * 2 - var(--size-scrollbar-width) + 6px)}.core-topic-tree-container .core-org-tree-header input.full-width{width:calc(var(--size-core-org-tree-width) - var(--size-layout-block-cell-spacing) * 2)}.core-topic-tree-container .check-inheritance-wrapper{padding:15px}.core-topic-tree-container .form-control{border:none}.core-topic-tree-container .core-reducer-icon-wrapper{height:var(--size-core-reducer-icon-wrapper-height);padding:var(--size-layout-block-cell-spacing)}.core-topic-tree-container .scroll-container{background:var(--background);height:var(--scroll-container-height);overflow-y:auto;overflow-x:auto;position:relative;width:100%;border-radius:5px}.core-topic-tree-container .scroll-container *{box-sizing:border-box;padding:0;margin:0}@media (max-width: 575px){.core-topic-tree-container .scroll-container ::-webkit-slider-runnable-track{width:0px}}.core-topic-tree-container .scroll-container ul{display:table;vertical-align:top;padding-left:var(--ul-padding);transition:all .5s ease-out;width:100%}.core-topic-tree-container .scroll-container ul>li>span:hover{background-color:#fff;width:100%}.core-topic-tree-container .scroll-container ul>li>span:active{background-color:#f1f1f1}.core-topic-tree-container .scroll-container ul>li>span>object.active{color:var(--active-item-color)}.core-topic-tree-container .scroll-container ul .highlighted{color:var(--color-core-org-tree-highlighted);font-weight:700}.core-topic-tree-container .scroll-container ul .dissolved{color:#848484;text-decoration:line-through dashed}.core-topic-tree-container .scroll-container ul .dissolved.active{color:#c9252b!important}.core-topic-tree-container .scroll-container ul>li{display:block;position:relative}.core-topic-tree-container .scroll-container ul>li:before{content:\"\";display:block;position:absolute;width:var(--ul-padding);left:calc(var(--ul-padding) * -1);top:calc(var(--item-height) / 2);height:calc(var(--item-height) / 2);border-top:solid var(--line-size) var(--line-color);border-right:none;border-bottom:none;border-left:solid var(--line-size) var(--line-color);z-index:0}.core-topic-tree-container .scroll-container ul>li>span{display:flex;align-items:center;height:var(--item-height);white-space:nowrap;padding-left:8px;cursor:pointer}.core-topic-tree-container .scroll-container ul>li>span>i{color:var(--square-color);cursor:pointer;font-size:var(--square-size);width:var(--square-size);height:var(--square-size)}.core-topic-tree-container .scroll-container ul>li>span>.expand-toggler{position:absolute;z-index:1;transform:translate(-100%) rotate(0);transition:.5s ease-out;display:flex;align-items:center;justify-content:center}.core-topic-tree-container .scroll-container ul>li>span>.check-toggler{margin-left:5px;margin-right:5px}.core-topic-tree-container .scroll-container ul>li>ul>li>span:before{content:\"\";display:block;position:absolute;width:var(--ul-padding);left:calc(var(--ul-padding) * -2);top:calc(var(--item-height) / 2);height:var(--line-size);border-top:solid var(--line-size) var(--line-color);z-index:0}.core-topic-tree-container .scroll-container ul>li.collapsed>span>.expand-toggler{transform:translate(-100%) rotate(-90deg);transition:.5s ease-out}.core-topic-tree-container .scroll-container ul>li.collapsed:before{border-left:none}.core-topic-tree-container .scroll-container ul>li:not(.collapsed):not(.has-children):before{border-left:none}.core-topic-tree-container .scroll-container ul:not(.root):before{content:\"\";display:block;position:absolute;width:var(--line-size);left:calc(var(--ul-padding) * -1);height:calc(100% - var(--item-height) * 1.5);border-left:solid var(--line-size) var(--line-color);z-index:0}.core-topic-tree-container .scroll-container ul:not(.root)>li:last-child:not(.collapsed).has-children:after{content:\"\";display:block;position:absolute;height:calc(100% - var(--item-height));width:calc(var(--ul-padding) / 2);left:calc(var(--ul-padding) * -2);top:calc(var(--item-height) / 2);border-left:solid var(--line-size) var(--background);z-index:0}.core-topic-tree-container .scroll-container ul.collapsed:not(.root){display:none}.core-topic-tree-container .collapsed>li:before{display:none!important}.core-org-tree-container.full-width .scroll-container{width:auto}.core-org-tree-container.reduced{width:50px;padding:0;transition:width .5s ease-out}.core-org-tree-container.reduced .scroll-container{overflow:hidden}.core-org-tree-container.reduced .scroll-container>ul.root{display:none}.core-org-tree-container.reduced .scroll-container>.reduced-panel{color:var(--active-item-color);width:50px;height:var(--reduced-panel-height);writing-mode:vertical-rl;text-orientation:mixed;display:flex;align-items:center;justify-content:center;font-weight:700;animation:reducedPanelOn .5s ease-out}\n"] }]
20220
+ }], ctorParameters: () => [{ type: AuthService }, { type: RecursiveService }, { type: MultiLanguageService }, { type: LayoutService }, { type: TopicTreeService }, { type: AlertService }], propDecorators: { lineColor: [{
20171
20221
  type: Input
20172
- }], inputSections: [{
20222
+ }], translateText: [{
20173
20223
  type: Input
20174
- }], mode$: [{
20224
+ }], fullWidthMode: [{
20175
20225
  type: Input
20176
- }], bottomTemplateRef: [{
20226
+ }], accessorMode: [{
20177
20227
  type: Input
20178
- }], customFormButtonItems: [{
20228
+ }], fullRendering: [{
20179
20229
  type: Input
20180
- }], showCaptionButton: [{
20230
+ }], height: [{
20181
20231
  type: Input
20182
- }], disableSaveButton: [{
20232
+ }], disabledLoopExpand: [{
20183
20233
  type: Input
20184
- }], disableCancelButton: [{
20234
+ }], showCheckInheritance: [{
20185
20235
  type: Input
20186
- }], checkError$: [{
20236
+ }], inlineExtraTemplateRef: [{
20187
20237
  type: Input
20188
- }], onFormCreated: [{
20189
- type: Output
20190
- }], onFormRefCreated: [{
20191
- type: Output
20192
- }], onSubmit: [{
20193
- type: Output
20194
- }], onSave: [{
20195
- type: Output
20196
- }], onCancal: [{
20238
+ }], itemDoubleClick: [{
20197
20239
  type: Output
20198
- }], buttonClick: [{
20240
+ }], itemClick: [{
20199
20241
  type: Output
20200
- }], formRef: [{
20242
+ }], container: [{
20201
20243
  type: ViewChild,
20202
- args: ['formRef']
20244
+ args: ['container']
20245
+ }], displayContent: [{
20246
+ type: ViewChild,
20247
+ args: ['displayContent']
20248
+ }], reducedIconWrapper: [{
20249
+ type: ViewChild,
20250
+ args: ['reducedIconWrapper']
20203
20251
  }] } });
20204
20252
 
20205
- class CorePageEditComponent {
20206
- constructor(router, route, corePageEditService, commonHttpRequestService, animatedTextService, mls, coreFormService, corePageListService, hubConnectionService, authService, alertService, urlService, routingService, responseService, appConfigService) {
20207
- this.router = router;
20208
- this.route = route;
20209
- this.corePageEditService = corePageEditService;
20210
- this.commonHttpRequestService = commonHttpRequestService;
20211
- this.animatedTextService = animatedTextService;
20212
- this.mls = mls;
20213
- this.coreFormService = coreFormService;
20214
- this.corePageListService = corePageListService;
20215
- this.hubConnectionService = hubConnectionService;
20216
- this.authService = authService;
20217
- this.alertService = alertService;
20218
- this.urlService = urlService;
20219
- this.routingService = routingService;
20253
+ class CoreTopicPickerComponent extends CoreFormControlBaseComponent {
20254
+ constructor(domService, renderer, appService, responseService, alertService, mls) {
20255
+ super();
20256
+ this.domService = domService;
20257
+ this.renderer = renderer;
20258
+ this.appService = appService;
20220
20259
  this.responseService = responseService;
20221
- this.appConfigService = appConfigService;
20222
- this.checkError$ = new BehaviorSubject(false);
20223
- this.submitLogic = new EventEmitter();
20224
- this.onFormCreated = new EventEmitter();
20225
- this.onSubmitSuccess = new EventEmitter();
20226
- this.onButtonClick = new EventEmitter();
20227
- this.cancelLogic = new EventEmitter();
20228
- this.entityUniqueIndexs = []; /* For ex: [['id'], ['provinceId', 'districCode']] etc... */
20229
- this.onInitialValueStringReady = new EventEmitter();
20230
- this.mode$ = new BehaviorSubject(EnumCorePageEditMode.CREATE);
20260
+ this.alertService = alertService;
20261
+ this.mls = mls;
20231
20262
  this.subscriptions = [];
20232
- this.showCaptionButton = true;
20233
- this.fromUrl = this.corePageEditService.fromUrl;
20234
- this.listInstance = Number(this.route.snapshot.paramMap.get('listInstance'));
20235
- }
20236
- sendSignal(data) {
20237
- const connection = this.hubConnectionService.hubConnection$.value;
20238
- if (!!connection) {
20239
- const message = {
20240
- sid: this.authService.data$.value?.id,
20241
- username: this.authService.data$.value?.fullName,
20242
- avatar: this.authService.data$.value?.avatar,
20243
- signalType: EnumSignalRType.ENTITY_CHANGED,
20244
- message: `${this.authService.data$.value
20245
- ?.userName} has changed entity ${this.entityTable}`,
20246
- loginTime: this.authService.data$.value?.loginTime,
20247
- data: null,
20248
- };
20249
- connection.invoke('SendMessage', message);
20250
- }
20251
20263
  }
20252
20264
  ngOnInit() {
20253
- this.sections$ = new BehaviorSubject(this.sections);
20254
- if (!!!this.entityTable) {
20255
- alert('Property entityTable (name) is required for component ' +
20256
- this.captionCode);
20257
- console.error('Property entityTable (name) is required for component ' +
20258
- this.captionCode);
20265
+ this.subscriptions.push(this.mls.lang$.subscribe(x => this.lang = x));
20266
+ }
20267
+ toggleExpanded() {
20268
+ if (!this.disabled) {
20269
+ this.expandState = !!!this.expandState;
20259
20270
  }
20260
20271
  }
20261
- ngAfterViewInit() {
20262
- if (!!this.normalMode) {
20263
- console.log(this.container);
20264
- this.container.nativeElement.style.setProperty('--width', '100%');
20272
+ onTreeItemClick(event) {
20273
+ if (this.value !== event['id'])
20274
+ this.markAsTouched();
20275
+ this.value = event['id'];
20276
+ this.onChange(event['id']);
20277
+ this.shownText = event['nameCode'];
20278
+ this.toggleExpanded();
20279
+ }
20280
+ writeValue(obj) {
20281
+ this.value = obj;
20282
+ if (!!!obj) {
20283
+ this.shownText = "";
20265
20284
  }
20266
20285
  else {
20267
- if (!!this.width) {
20268
- this.container.nativeElement.style.setProperty('--width', this.width + 'px');
20269
- }
20270
- this.containerBigger.nativeElement.style.setProperty('--height', '95%');
20271
- }
20272
- setTimeout(() => {
20273
- this.scroll = this.container.nativeElement.scrollHeight > this.container.nativeElement.offsetHeight;
20274
- });
20275
- setTimeout(() => {
20276
- if (!!!this.mixedMode) {
20277
- this.subscriptions.push(this.route.params.subscribe(x => {
20278
- console.log("this.route.params.subscribe", x);
20279
- let id = '0';
20280
- if (this.hasIdOfStringType) {
20281
- try {
20282
- id = atob(x['id']);
20283
- }
20284
- catch {
20285
- return;
20286
- }
20287
- }
20288
- else {
20289
- try {
20290
- id = Number(atob(x['id'])).toString();
20291
- }
20292
- catch {
20293
- return;
20294
- }
20295
- }
20296
- if (id !== '0') {
20297
- this.mode$.next(EnumCorePageEditMode.UPDATE);
20298
- this.submitText = EnumTranslateKey.UI_EDIT_FORM_BUTTON_SAVE;
20299
- if (!!!this.autoGetByIdOff) {
20300
- this.loading = true;
20301
- this.subscriptions.push(this.corePageEditService.getById(id, this.crud.r).subscribe((x) => {
20302
- this.loading = false;
20303
- const body = x.body;
20304
- //this.responseService.resolve(body);
20305
- if ((body.statusCode = 200)) {
20306
- /* #region Exclude sections with flag addModeOnly=true */
20307
- if (!!body.innerBody.id) {
20308
- // remove relevant controls from form group
20309
- const addModeOnlySections = this.sections.filter((x) => !!x.addModeOnly);
20310
- addModeOnlySections.map((addModeOnlySection) => {
20311
- addModeOnlySection.rows.map((addModeOnlyRow) => {
20312
- addModeOnlyRow.map((addModeOnlyControl) => {
20313
- this.form.removeControl(addModeOnlyControl.field);
20314
- });
20315
- });
20316
- });
20317
- // remove relevant controls from form sections
20318
- const newSections = this.sections.filter((x) => !!!x.addModeOnly);
20319
- this.sections = newSections;
20320
- this.sections$.next(this.sections);
20321
- }
20322
- /* #endregion Exclude sections with flag addModeOnly=true */
20323
- /* #region: Assign value to attachment fields when controlType = ATTACHMENT */
20324
- this.sections.map((section) => {
20325
- section.rows.map((row) => {
20326
- row.map((control) => {
20327
- if (control.controlType === EnumFormBaseContolType.ATTACHMENT) {
20328
- control.valueToShow = body.innerBody[control.assignTo];
20329
- }
20330
- });
20331
- });
20332
- });
20333
- /* #endregion: Assign value to basic fields when controlType = ATTACHMENT */
20334
- /* #region: Using PatchValue instead of setValue */
20335
- // Forms often have extra helper fields
20336
- // thus, if we use setValue method, the helper fields will be lost:
20337
- // this.form.setValue(body.innerBody)
20338
- // so, we use patchValue method :
20339
- this.currentValue = body.innerBody;
20340
- this.form.patchValue(this.currentValue);
20341
- this.sections.map((section) => {
20342
- section.rows.map((row) => {
20343
- row.map((control) => {
20344
- if ([
20345
- EnumFormBaseContolType.SEEKER,
20346
- EnumFormBaseContolType.DROPDOWN,
20347
- EnumFormBaseContolType.CHECKLIST,
20348
- ].includes(control.controlType)) {
20349
- if (!!this.currentValue[control.field]) {
20350
- if (isDevMode() && !!!control.getByIdApi) {
20351
- switch (control.controlType) {
20352
- case EnumFormBaseContolType.SEEKER:
20353
- if (!control.multiMode) {
20354
- this.alertService.error(`getByIdApi not provided for '${control.field}'`, noneAutoClosedAlertOptions);
20355
- }
20356
- break;
20357
- case EnumFormBaseContolType.DROPDOWN:
20358
- if (!!!control.dropdownOptions$?.value) {
20359
- this.alertService.error(`getByIdApi not provided for '${control.field}'`, noneAutoClosedAlertOptions);
20360
- }
20361
- break;
20362
- case EnumFormBaseContolType.CHECKLIST:
20363
- if (!!!control.checklistOptions$?.value) {
20364
- this.alertService.error(`getByIdApi not provided for '${control.field}'`, noneAutoClosedAlertOptions);
20365
- }
20366
- break;
20367
- default:
20368
- this.alertService.error(`getByIdApi not provided for '${control.field}'`, noneAutoClosedAlertOptions);
20369
- break;
20370
- }
20371
- }
20372
- this.subscriptions.push(this.commonHttpRequestService
20373
- .makeGetRequest('getById', control.getByIdApi +
20374
- `?id=${this.currentValue[control.field]}`)
20375
- .subscribe((x) => {
20376
- console.log("form getById result: ", this.currentValue);
20377
- if (x.ok && x.status === 200) {
20378
- const body = x.body;
20379
- if (body.statusCode === 200) {
20380
- control.getByIdObject$?.next(body.innerBody);
20381
- }
20382
- else {
20383
- control.getByIdObject$?.next(null);
20384
- }
20385
- }
20386
- }));
20387
- }
20388
- }
20389
- if (control.controlType === EnumFormBaseContolType.SEEKER && control.multiMode) {
20390
- control.objectList$?.next(body.innerBody[control.getObjectListFrom]);
20391
- }
20392
- });
20393
- });
20394
- });
20395
- this.sections$.next(this.sections);
20396
- /* #endregion: Using PatchValue instead of setValue */
20397
- }
20398
- // return initFormValueString to the caller
20399
- this.onInitialValueStringReady.emit(JSON.stringify(this.form.getRawValue()));
20400
- }));
20401
- }
20286
+ this.loading = true;
20287
+ this.subscriptions.push(this.appService.get(this.getByIdApi + "?id=" + obj.toString()).subscribe(x => {
20288
+ this.loading = false;
20289
+ if (x.ok && x.status === 200) {
20290
+ const body = x.body;
20291
+ //this.responseService.resolve(body);
20292
+ if (body.statusCode === 200) {
20293
+ this.shownText = body.innerBody['nameCode'];
20402
20294
  }
20403
20295
  else {
20404
- this.mode$.next(EnumCorePageEditMode.CREATE);
20405
- this.submitText = EnumTranslateKey.UI_EDIT_FORM_BUTTON_ADD;
20296
+ this.alertService.error(this.mls.trans(body.messageCode, this.lang), alertOptions);
20406
20297
  }
20407
- }));
20298
+ }
20299
+ else {
20300
+ //this.alertService.error(JSON.stringify(x, null, 2), noneAutoClosedAlertOptions)
20301
+ }
20302
+ }));
20303
+ }
20304
+ }
20305
+ onClickClear() {
20306
+ this.writeValue(null);
20307
+ this.onChange(null);
20308
+ this.shownText = "";
20309
+ }
20310
+ ngAfterViewInit() {
20311
+ /**
20312
+ * This events get called by all clicks on the page
20313
+ */
20314
+ this.listenerFn = this.renderer.listen('window', 'click', (e) => {
20315
+ /*
20316
+ * handle click outside
20317
+ */
20318
+ if (this.container && !!!this.container.nativeElement.contains(e.target)) {
20319
+ this.expandState = false;
20408
20320
  }
20409
- this.subscriptions.push(this.mls.lang$.subscribe(x => this.lang = x));
20410
20321
  });
20322
+ const maxZIndex = this.domService.getMaxZIndex();
20323
+ this.container.nativeElement.style.setProperty('--max-z-index', maxZIndex + 1);
20324
+ if (!!this.popupHeight)
20325
+ this.container.nativeElement.style.setProperty('--popup-height', this.popupHeight);
20411
20326
  }
20412
- toggleReloadFlagForTheCaller(id) {
20413
- const instancesFilter = this.corePageListService.instances.filter((x) => x.instanceNumber === this.listInstance);
20414
- if (!!instancesFilter.length) {
20415
- const instance = instancesFilter[0];
20416
- instance.id$.next(id);
20417
- //if (!!!this.normalMode) instance.reloadFlag$?.next(!instance.reloadFlag$.value);
20418
- if (isDevMode()) {
20419
- this.alertService.info(`CorePageList instance number ${this.listInstance} current id is: ${instance.id$.value}`, alertOptions);
20420
- }
20421
- }
20422
- else {
20423
- if (isDevMode()) {
20424
- this.alertService.info(`CorePageList instances do not include number ${this.listInstance}`, alertOptions);
20425
- }
20426
- }
20327
+ ngOnDestroy() {
20328
+ if (this.listenerFn)
20329
+ this.listenerFn();
20330
+ this.subscriptions.map((x) => x?.unsubscribe());
20427
20331
  }
20428
- onNotOk200Response(x) {
20429
- if (isDevMode()) {
20430
- if (Object.keys(x).length === 0) {
20431
- this.alertService.error("No response content. It was possibly a CORS error.", noneAutoClosedAlertOptions);
20432
- }
20433
- else {
20434
- //this.alertService.error(JSON.stringify(x, null, 2), noneAutoClosedAlertOptions)
20332
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreTopicPickerComponent, deps: [{ token: DomService }, { token: i0.Renderer2 }, { token: AppService }, { token: ResponseService }, { token: AlertService }, { token: MultiLanguageService }], target: i0.ɵɵFactoryTarget.Component }); }
20333
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: CoreTopicPickerComponent, isStandalone: true, selector: "core-topic-picker", inputs: { popupHeight: "popupHeight", getByIdApi: "getByIdApi" }, providers: [
20334
+ {
20335
+ provide: NG_VALUE_ACCESSOR,
20336
+ multi: true,
20337
+ useExisting: CoreTopicPickerComponent
20435
20338
  }
20436
- }
20437
- }
20438
- onSubmit() {
20439
- /* IF id is falsy => CREAT, otherwise UPDATE */
20440
- /* FOR CONTROL OF TYPE GRIDBUFFER, SET EVERY id TO NULL */
20441
- this.sections.map(section => {
20442
- section.rows.map(row => {
20443
- row.map(control => {
20444
- console.log(control.controlType);
20445
- if (control.controlType === EnumFormBaseContolType.GRIDBUFFER) {
20446
- const abstractControl = this.form.get(control.field)?.value;
20447
- // TO DO 17/08/2023 ===========
20448
- abstractControl?.value?.map((x) => x.id = null);
20449
- // =========================
20450
- }
20451
- });
20452
- });
20453
- });
20454
- if (!!this.mixedMode) {
20455
- this.submitLogic.emit({
20456
- mode: this.form.get('editMode')?.value,
20457
- formValue: this.form.getRawValue()
20458
- });
20459
- return;
20460
- }
20461
- if (!!this.autoSubmitLogicOff) {
20462
- // DO your logic here
20463
- this.submitLogic.emit(JSON.stringify(this.form.getRawValue()));
20464
- return;
20465
- }
20466
- else if (!!!this.form.get('id').value) {
20467
- this.loading = true;
20468
- const sysMutationLogBeforeAfterRequest = {
20469
- sysFunctionCode: this.routingService.currentFunction$.value?.code || 'UNDEFINED',
20470
- sysActionCode: EnumCoreButtonVNSCode.HEADER_CREATE,
20471
- before: JSON.stringify(this.currentValue) ?? '""',
20472
- after: JSON.stringify(this.form.getRawValue()),
20473
- username: this.authService.data$.value?.userName
20474
- };
20475
- this.animatedTextService.text$.next(this.mls.trans(EnumTranslateKey.UI_DIALOG_ADDING_PLEASE_WAIT));
20476
- this.commonHttpRequestService
20477
- .makePostRequest('create ' + this.entityTable, this.crud.c, {
20478
- ...this.form.getRawValue(),
20479
- sysMutationLogBeforeAfterRequest,
20480
- })
20481
- .subscribe((x) => {
20482
- this.loading = false;
20483
- if (x.ok && x.status === 200) {
20484
- const body = x.body;
20485
- //this.responseService.resolve(body);
20486
- if (body.statusCode === 200) {
20487
- if (isDevMode()) {
20488
- this.sendSignal(body.innerBody);
20339
+ ], viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true }], usesInheritance: true, ngImport: i0, template: "@if (loading) {\n <app-threedots></app-threedots>\n}\n<div #container class=\"core-topic-picker-container\" [class.d-none]=\"loading\">\n <input type=\"checkbox\" class=\"expand-state\" [(ngModel)]=\"expandState\">\n <input class=\"value\" [value]=\"value\">\n <label type=\"text\" class=\"text form-control\" [class.form-control-disabled]=\"disabled\">\n <span [appTooltip]=\"shownText\">{{ !!loading ? \"...\" : shownText }}</span>\n <div class=\"icon\" (click)=\"toggleExpanded()\">\n <i class=\"feather-chevrons-down\"></i>\n </div>\n\n <div class=\"clear-icon-wrapper\" [class.d-none]=\"!!disabled || !!!value\" (click)=\"onClickClear()\">\n <div class=\"flex-wrapper\" [appTooltip]=\"'UI.CORE_CONTOL_COMMON_CLEAR' | translate: lang\">\n <i class=\"feather-x\"></i>\n </div>\n </div>\n \n </label>\n @if (!!expandState) {\n <div class=\"dropdown\" [class.form-control-disabled]=\"disabled\">\n <core-topic-tree [translateText]=\"true\" (itemClick)=\"onTreeItemClick($event)\"></core-topic-tree>\n </div>\n }\n\n</div>", styles: [".core-topic-picker-container{position:relative;display:block;--indicator-height: 0px;--search-bg-color: white;--search-border-color: #D1D1D1;--search-item-hover-bg: #358ccb;--search-item-hover-color: white;--dropdown-bg: lightyellow;--arrow-color: #358ccb;--height: var(--size-form-control-height);--item-height: 50px;--max-z-index: 0;--search-height: 38px;--popup-height: 460px}.core-topic-picker-container input.expand-state,.core-topic-picker-container .value{display:none}.core-topic-picker-container label.text{width:100%;height:var(--height);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;display:flex;align-items:center;justify-content:space-between}.core-topic-picker-container label.text .clear-icon-wrapper{display:none;position:absolute;background-color:transparent;right:45px;top:2px;width:44px;height:44px;border-radius:.375rem;cursor:pointer}.core-topic-picker-container label.text .clear-icon-wrapper>.flex-wrapper{width:44px;height:44px;display:flex;align-items:center;justify-content:center}.core-topic-picker-container label.text .clear-icon-wrapper>.flex-wrapper>i{color:#848484;font-size:20px}.core-topic-picker-container label.text:hover>.clear-icon-wrapper{display:block}.core-topic-picker-container label.text span{width:calc(100% - var(--height));overflow-x:hidden;text-overflow:ellipsis;color:inherit}.core-topic-picker-container label.text div.icon{display:flex;align-items:center;justify-content:center;position:absolute;right:3px;top:3px;width:calc(var(--height) - 6px);height:calc(var(--height) - 6px);background-color:#e9e9e9;border-radius:3px;cursor:pointer}.core-topic-picker-container label.text div.icon i{width:28px;height:28px;font-size:28px;color:#848484}.core-topic-picker-container .dropdown{display:block;position:absolute;width:800px;min-width:100%;max-height:0px;overflow-x:auto;overflow-y:hidden;background-color:#fff;font-size:15px;box-shadow:0 1rem 3rem #0000002e;transition:.25s linear;z-index:calc(var(--max-z-index) + 1)}.core-topic-picker-container .dropdown ul{padding-left:6px}.core-topic-picker-container .dropdown ul>li{display:flex;align-items:center;cursor:pointer;padding:0px var(--size-scrollbar-width);transition:.25s linear}.core-topic-picker-container .dropdown ul>li>label{width:100%}.core-topic-picker-container .dropdown ul>li:hover{background-color:var(--search-item-hover-bg);color:var(--search-item-hover-color);transition:.25s linear}.core-topic-picker-container input.expand-state:checked~.dropdown{border:1px solid #ced4da;margin-top:2px;max-height:var(--popup-height);border-bottom-left-radius:.375rem;border-bottom-right-radius:.375rem;transition:.25s linear}.core-topic-picker-container input.search{margin:0;width:100%;border:0;border-bottom:1px solid var(--search-border-color);background-color:var(--search-bg-color);position:sticky;top:0;height:38px;padding:6px 12px;font-size:15px}.core-topic-picker-container input.search:focus{outline:none}\n"], dependencies: [{ kind: "directive", type: TooltipDirective, selector: "[appTooltip]", inputs: ["color", "backgroundColor", "appTooltip", "showAnyway", "position"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$4.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ThreedotsComponent, selector: "app-threedots" }, { kind: "component", type: CoreTopicTreeComponent, selector: "core-topic-tree", inputs: ["lineColor", "translateText", "fullWidthMode", "accessorMode", "fullRendering", "height", "disabledLoopExpand", "showCheckInheritance", "inlineExtraTemplateRef"], outputs: ["itemDoubleClick", "itemClick"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
20340
+ }
20341
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreTopicPickerComponent, decorators: [{
20342
+ type: Component,
20343
+ args: [{ selector: 'core-topic-picker', imports: [
20344
+ TooltipDirective,
20345
+ FormsModule,
20346
+ ThreedotsComponent,
20347
+ CoreTopicTreeComponent,
20348
+ TranslatePipe,
20349
+ ], providers: [
20350
+ {
20351
+ provide: NG_VALUE_ACCESSOR,
20352
+ multi: true,
20353
+ useExisting: CoreTopicPickerComponent
20489
20354
  }
20490
- this.onSubmitSuccess.emit(true);
20491
- this.onInitialValueStringReady.emit(JSON.stringify(this.form.getRawValue()));
20492
- /*
20493
- Transfer newly created record id
20494
- */
20495
- this.toggleReloadFlagForTheCaller(body.innerBody.id || 0);
20496
- if (this.forceListRefreshOnCreateOrUpdate) {
20497
- this.corePageListService.instanceRequery(this.listInstance);
20355
+ ], template: "@if (loading) {\n <app-threedots></app-threedots>\n}\n<div #container class=\"core-topic-picker-container\" [class.d-none]=\"loading\">\n <input type=\"checkbox\" class=\"expand-state\" [(ngModel)]=\"expandState\">\n <input class=\"value\" [value]=\"value\">\n <label type=\"text\" class=\"text form-control\" [class.form-control-disabled]=\"disabled\">\n <span [appTooltip]=\"shownText\">{{ !!loading ? \"...\" : shownText }}</span>\n <div class=\"icon\" (click)=\"toggleExpanded()\">\n <i class=\"feather-chevrons-down\"></i>\n </div>\n\n <div class=\"clear-icon-wrapper\" [class.d-none]=\"!!disabled || !!!value\" (click)=\"onClickClear()\">\n <div class=\"flex-wrapper\" [appTooltip]=\"'UI.CORE_CONTOL_COMMON_CLEAR' | translate: lang\">\n <i class=\"feather-x\"></i>\n </div>\n </div>\n \n </label>\n @if (!!expandState) {\n <div class=\"dropdown\" [class.form-control-disabled]=\"disabled\">\n <core-topic-tree [translateText]=\"true\" (itemClick)=\"onTreeItemClick($event)\"></core-topic-tree>\n </div>\n }\n\n</div>", styles: [".core-topic-picker-container{position:relative;display:block;--indicator-height: 0px;--search-bg-color: white;--search-border-color: #D1D1D1;--search-item-hover-bg: #358ccb;--search-item-hover-color: white;--dropdown-bg: lightyellow;--arrow-color: #358ccb;--height: var(--size-form-control-height);--item-height: 50px;--max-z-index: 0;--search-height: 38px;--popup-height: 460px}.core-topic-picker-container input.expand-state,.core-topic-picker-container .value{display:none}.core-topic-picker-container label.text{width:100%;height:var(--height);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;display:flex;align-items:center;justify-content:space-between}.core-topic-picker-container label.text .clear-icon-wrapper{display:none;position:absolute;background-color:transparent;right:45px;top:2px;width:44px;height:44px;border-radius:.375rem;cursor:pointer}.core-topic-picker-container label.text .clear-icon-wrapper>.flex-wrapper{width:44px;height:44px;display:flex;align-items:center;justify-content:center}.core-topic-picker-container label.text .clear-icon-wrapper>.flex-wrapper>i{color:#848484;font-size:20px}.core-topic-picker-container label.text:hover>.clear-icon-wrapper{display:block}.core-topic-picker-container label.text span{width:calc(100% - var(--height));overflow-x:hidden;text-overflow:ellipsis;color:inherit}.core-topic-picker-container label.text div.icon{display:flex;align-items:center;justify-content:center;position:absolute;right:3px;top:3px;width:calc(var(--height) - 6px);height:calc(var(--height) - 6px);background-color:#e9e9e9;border-radius:3px;cursor:pointer}.core-topic-picker-container label.text div.icon i{width:28px;height:28px;font-size:28px;color:#848484}.core-topic-picker-container .dropdown{display:block;position:absolute;width:800px;min-width:100%;max-height:0px;overflow-x:auto;overflow-y:hidden;background-color:#fff;font-size:15px;box-shadow:0 1rem 3rem #0000002e;transition:.25s linear;z-index:calc(var(--max-z-index) + 1)}.core-topic-picker-container .dropdown ul{padding-left:6px}.core-topic-picker-container .dropdown ul>li{display:flex;align-items:center;cursor:pointer;padding:0px var(--size-scrollbar-width);transition:.25s linear}.core-topic-picker-container .dropdown ul>li>label{width:100%}.core-topic-picker-container .dropdown ul>li:hover{background-color:var(--search-item-hover-bg);color:var(--search-item-hover-color);transition:.25s linear}.core-topic-picker-container input.expand-state:checked~.dropdown{border:1px solid #ced4da;margin-top:2px;max-height:var(--popup-height);border-bottom-left-radius:.375rem;border-bottom-right-radius:.375rem;transition:.25s linear}.core-topic-picker-container input.search{margin:0;width:100%;border:0;border-bottom:1px solid var(--search-border-color);background-color:var(--search-bg-color);position:sticky;top:0;height:38px;padding:6px 12px;font-size:15px}.core-topic-picker-container input.search:focus{outline:none}\n"] }]
20356
+ }], ctorParameters: () => [{ type: DomService }, { type: i0.Renderer2 }, { type: AppService }, { type: ResponseService }, { type: AlertService }, { type: MultiLanguageService }], propDecorators: { popupHeight: [{
20357
+ type: Input
20358
+ }], getByIdApi: [{
20359
+ type: Input
20360
+ }], container: [{
20361
+ type: ViewChild,
20362
+ args: ['container']
20363
+ }] } });
20364
+
20365
+ class CoreControlComponent extends BaseComponent {
20366
+ constructor(mls, alertService) {
20367
+ super(mls);
20368
+ this.mls = mls;
20369
+ this.alertService = alertService;
20370
+ this.errors = [];
20371
+ this.isDevMode = isDevMode();
20372
+ this.coreOrgTreeDefaultAccessorMode = EnumCoreOrgTreeaAccessorMode.CHECKED;
20373
+ }
20374
+ displayValidatorNameMathchingError() {
20375
+ if (isDevMode()) {
20376
+ this.alertService.error(`
20377
+ '${this.control.field}' validator array definition error: validator name must equal Validators.&lt;key&gt;
20378
+ `, noneAutoClosedAlertOptions);
20379
+ }
20380
+ }
20381
+ checkError() {
20382
+ if (!!this.rawControl?.errors) {
20383
+ const newErrors = [];
20384
+ Object.keys(this.form.controls[this.control.field].errors).forEach(key => {
20385
+ /*
20386
+ tanleica:
20387
+ By custom design, custom error is an array
20388
+ while built-in validator should produce an object error if any
20389
+ */
20390
+ if (this.form.controls[this.control.field].errors[key] instanceof Array) {
20391
+ newErrors.push({
20392
+ key: key,
20393
+ errorMessage: this.form.controls[this.control.field].errors[key][1]
20394
+ });
20395
+ }
20396
+ else {
20397
+ if (!!this.control.validators) {
20398
+ const filter = this.control.validators?.filter(x => x.name.toLowerCase() === key.toLowerCase());
20399
+ if (!!filter.length) {
20400
+ newErrors.push({
20401
+ key: key,
20402
+ errorMessage: filter[0].errorMessage
20403
+ });
20498
20404
  }
20499
- if (!this.stayAfterSubmit) {
20500
- this.router.navigate(['../'], { /* experiment*/ replaceUrl: true, relativeTo: this.route, state: { id: body.innerBody.id || 0, instanceNumber: this.listInstance } });
20405
+ else {
20406
+ this.displayValidatorNameMathchingError();
20501
20407
  }
20502
20408
  }
20503
- }
20504
- else {
20505
- this.onNotOk200Response(x);
20409
+ else {
20410
+ this.displayValidatorNameMathchingError();
20411
+ }
20506
20412
  }
20507
20413
  });
20414
+ this.errors = newErrors;
20508
20415
  }
20509
20416
  else {
20510
- this.loading = true;
20511
- const sysMutationLogBeforeAfterRequest = {
20512
- sysFunctionCode: this.routingService.currentFunction$.value?.code || 'UNDEFINED',
20513
- sysActionCode: EnumCoreButtonVNSCode.HEADER_SAVE,
20514
- before: JSON.stringify(this.currentValue) ?? '""',
20515
- after: JSON.stringify(this.form.getRawValue()),
20516
- username: this.authService.data$.value?.userName
20517
- };
20518
- const a1 = this.coreFormService.getAllFormBaseControlNames(this.leftInputSections?.filter(x => !x.hidden));
20519
- const a2 = this.coreFormService.getAllFormBaseControlNames(this.sections?.filter(x => !x.hidden));
20520
- const actualFormDeclaredFields = [...a1, ...a2];
20521
- this.animatedTextService.text$.next(this.mls.trans(EnumTranslateKey.UI_DIALOG_UPDATING_PLEASE_WAIT));
20522
- this.commonHttpRequestService
20523
- .makePostRequest('update ' + this.entityTable, this.crud.u, {
20524
- ...this.form.getRawValue(),
20525
- sysMutationLogBeforeAfterRequest,
20526
- actualFormDeclaredFields
20527
- })
20528
- .subscribe((x) => {
20529
- this.loading = false;
20530
- if (x.ok && x.status === 200) {
20531
- const body = x.body;
20532
- //this.responseService.resolve(body);
20533
- if (body.statusCode === 200) {
20534
- if (isDevMode()) {
20535
- this.sendSignal(body.innerBody);
20536
- }
20537
- this.onSubmitSuccess.emit(true);
20538
- this.onInitialValueStringReady.emit(JSON.stringify(this.form.getRawValue()));
20539
- /*
20540
- Transfer current record id
20541
- */
20542
- this.toggleReloadFlagForTheCaller(body.innerBody.id);
20543
- if (this.forceListRefreshOnCreateOrUpdate) {
20544
- this.corePageListService.instanceRequery(this.listInstance);
20545
- }
20546
- if (!this.stayAfterSubmit) {
20547
- if (this.appConfigService.APP_TYPE === "MOBILE") {
20548
- this.router.navigate(['../'], { /* experiment*/ replaceUrl: true, relativeTo: this.route, state: { id: body.innerBody.id, instanceNumber: this.listInstance } });
20549
- }
20550
- else if (this.appConfigService.APP_TYPE === "WEBAPP") {
20551
- this.router.navigate(['../'], { relativeTo: this.route, state: { id: body.innerBody.id, instanceNumber: this.listInstance } });
20552
- }
20553
- }
20554
- }
20417
+ this.errors = [];
20418
+ }
20419
+ }
20420
+ resetError() {
20421
+ this.errors = [];
20422
+ }
20423
+ ngOnInit() {
20424
+ this.subscriptions.push(this.mls.lang$.subscribe(x => this.lang = x));
20425
+ this.controlType = this.control.controlType;
20426
+ this.required = !!this.control.validators?.filter(x => x.validator.name === 'required').length;
20427
+ this.rawControl = this.form.get(this.control.field);
20428
+ this.subscriptions.push(this.rawControl?.statusChanges.subscribe(_ => {
20429
+ this.checkError();
20430
+ }));
20431
+ if (!!this.checkError$) {
20432
+ this.subscriptions.push(this.checkError$.subscribe(x => {
20433
+ if (x) {
20434
+ this.checkError();
20555
20435
  }
20556
20436
  else {
20557
- this.onNotOk200Response(x);
20437
+ this.resetError();
20438
+ }
20439
+ }));
20440
+ }
20441
+ }
20442
+ get isValid() { return this.form.controls[this.control.field].valid; }
20443
+ onFocus(e) {
20444
+ this.control.focus$?.next(e);
20445
+ }
20446
+ onBlur(e) {
20447
+ this.control.blur$?.next(e);
20448
+ }
20449
+ oHandleClick(e) {
20450
+ this.control.click$?.next(e);
20451
+ }
20452
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreControlComponent, deps: [{ token: MultiLanguageService }, { token: AlertService }], target: i0.ɵɵFactoryTarget.Component }); }
20453
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: CoreControlComponent, isStandalone: true, selector: "core-control", inputs: { control: "control", form: "form", checkError$: "checkError$", rangeLimit: "rangeLimit" }, usesInheritance: true, ngImport: i0, template: "<div class=\"core-control-container\">\r\n <div [formGroup]=\"form\" [class.hidden]=\"!!control.hidden\">\r\n\r\n <!-- START: LABEL SESSION-->\r\n <label [class]=\"'control-label' + (required ? ' required' : '')\" [attr.for]=\"control.field\"\r\n [class.avatar-label]=\"control.uploadFileType==='IMAGE_AVATAR'\" [appTooltip]=\"control.tooltip! | translate: lang\" [ngStyle]=\"{\r\n display: 'inline-block'\r\n }\">\r\n {{(control.controlType!=='CHECKBOX' && control.controlType!=='BUTTON') ? (control.label | translate: lang) : ''}}\r\n </label>\r\n\r\n @if (!!control.hint! && control.controlType !== 'CHECKBOX') {\r\n <i class=\"feather-help-circle\" [appTooltip]=\"control.hint!\" [ngStyle]=\"{\r\n display: 'inline-block',\r\n marginLeft: '2px'\r\n }\"></i>\r\n }\r\n\r\n <!-- START: LABEL SESSION-->\r\n\r\n <!-- START: FORM-CONTROL SESSION-->\r\n\r\n <ng-container>\r\n @switch (control.controlType) {\r\n @case (\"TEXTBOX\") {\r\n <input *ngIf=\"control.type==='date'\" [formControlName]=\"control.field\" [type]=\"control.type\"\r\n class=\"form-control\" [readonly]=\"control.readonly!\" useValueAsDate>\r\n \r\n <input *ngIf=\"control.type==='number'\" [formControlName]=\"control.field\" [type]=\"control.type\"\r\n class=\"form-control\" [readonly]=\"control.readonly\" [step]=\"control.step || '1'\">\r\n \r\n <input *ngIf=\"control.type!=='date' && control.type!=='number'\" [formControlName]=\"control.field\"\r\n [value]=\"form.get(control.field)?.value | tableCell: control.pipe : lang\" [type]=\"control.type\"\r\n class=\"form-control\" [readonly]=\"control.readonly\"\r\n [appTooltip]=\"form.get(control.field)?.value\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n >\r\n }\r\n @case (\"CURRENCY\") {\r\n <core-currency-input [formControlName]=\"control.field\"></core-currency-input>\r\n }\r\n @case (\"TEXTAREA\") {\r\n <textarea [rows]=\"control.textareaRows?.toString() || '3'\" [ngStyle]=\"{ height: 'unset' }\"\r\n [formControlName]=\"control.field\" class=\"form-control\" [readonly]=\"control.readonly\"></textarea>\r\n }\r\n @case (\"CHECKBOX\") {\r\n <core-checkbox [formControlName]=\"control.field\" [text]=\"control.label\"\r\n [inputValue]=\"control.value\"></core-checkbox>\r\n }\r\n @case (\"MCC\") {\r\n <core-mcc [formControlName]=\"control.field\" [columns]=\"control.columns!\" [shownFrom]=\"control.shownFrom!\" \r\n [apiDefinition]=\"control.apiDefinition!\" [getByIdApi]=\"control.getByIdApi!\" [selectedRow$]=\"control.selectedRow$!\"\r\n [outerParam$]=\"control.outerParam$!\"\r\n ></core-mcc>\r\n }\r\n @case (\"DATEPICKER\") {\r\n <core-date-picker [formControlName]=\"control.field\" [rangeLimit]=\"control.rangeLimit!\" [popupAlign]=\"control.popupAlign!\"></core-date-picker>\r\n }\r\n @case (\"DROPDOWN\") {\r\n @if (!!control.dropdownOptions$) {\r\n <core-dropdown [formControlName]=\"control.field\" [options$]=\"control.dropdownOptions$!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\" [shownFrom]=\"control.shownFrom!\"></core-dropdown>\r\n }\r\n }\r\n @case (\"LIST\") {\r\n <core-list [formControlName]=\"control.field\" [options]=\"control.listOptions!\"></core-list>\r\n }\r\n @case (\"CHECKLIST\") {\r\n @if (!!control.checklistOptions$) {\r\n <core-checklist [formControlName]=\"control.field\" [options$]=\"control.checklistOptions$!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\" [shownFrom]=\"control.shownFrom!\"></core-checklist>\r\n }\r\n }\r\n @case (\"FILEUPLOADER\") {\r\n @if (!!control.uploadFileType) {\r\n <core-file-uploader [formControlName]=\"control.field\" [uploadFileType]=\"control.uploadFileType\"\r\n [fileDataControlName]=\"control.fileDataControlName!\"\r\n [fileNameControlName]=\"control.fileNameControlName!\"\r\n [fileTypeControlName]=\"control.fileTypeControlName!\"\r\n [verticalMode]=\"control.verticalMode!\"></core-file-uploader>\r\n }\r\n }\r\n @case (\"ATTACHMENT\") {\r\n <core-attachment ngDefaultControl [formControlName]=\"control.field\" [assignTo]=\"control.assignTo!\"\r\n [valueToShow]=\"control.valueToShow!\"></core-attachment>\r\n }\r\n @case (\"GRIDBUFFER\") {\r\n @if (!!control.gridBufferFormSections && !!control.gridBufferTableColumns) {\r\n <core-grid-buffer [formControlName]=\"control.field\" [formSections]=\"control.gridBufferFormSections\"\r\n [gridColumns]=\"control.gridBufferTableColumns\"\r\n (onBufferFormCreated)=\"!!control.onBufferFormCreated ? control.onBufferFormCreated($event) : null\"></core-grid-buffer>\r\n }\r\n }\r\n @case (\"ORGTREECHECK\") {\r\n <core-org-tree [formControlName]=\"control.field\"\r\n [accessorMode]=\"coreOrgTreeDefaultAccessorMode\" [height]=\"control.height!\"></core-org-tree>\r\n }\r\n @case (\"RADIOGROUP\") {\r\n <core-radio-group [formControlName]=\"control.field\"\r\n [options$]=\"control.radioGroupOptions$!\"\r\n [vertical]=\"control.verticalMode!\"\r\n ></core-radio-group>\r\n }\r\n @case (\"MONTHSELECTOR\") {\r\n <core-month-selector [formControlName]=\"control.field\"></core-month-selector>\r\n }\r\n @case (\"SHIFTCELL\") {\r\n <core-shift-cell [formControlName]=\"control.field\"></core-shift-cell>\r\n }\r\n @case (\"SHIFTCOLLECTION\") {\r\n <core-shift-collection [relativeMode]=\"true\" [height]=\"control.height || 800\"></core-shift-collection>\r\n }\r\n @case (\"SEEKER\") {\r\n @switch(control.seekerSourceType) {\r\n @case(\"JOB_SEEK\") {\r\n <core-form-control-seeker\r\n [excludeExistingList]=\"control.excludeExistingList!\"\r\n [multiMode]=\"control.multiMode!\" [multiModeTableHeight]=\"control.multiModeTableHeight!\" [multiModeRowHeight]=\"control.multiModeRowHeight!\"\r\n [objectList$]=\"control.objectList$!\" [formControlName]=\"control.field\"\r\n [seekerSourceType]=\"control.seekerSourceType!\" \r\n [preDefinedOuterParam$]=\"control.preDefinedOuterParam$!\"\r\n [preDefinedOuterFilter$]=\"control.preDefinedOuterFilter$!\"\r\n [boundFrom]=\"control.boundFrom!\" [shownFrom]=\"control.shownFrom!\" [alsoBindTo]=\"control.alsoBindTo!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\"\r\n [click$]=\"control.click$\"\r\n [multiModeExtendedColumns]=\"control.multiModeExtendedColumns!\"\r\n [multiModeExtendedSections]=\"control.multiModeExtendedSections!\"\r\n [editBufferData$]=\"control.editBufferData$!\"\r\n [indirectBinding]=\"control.indirectBinding!\"\r\n [bindGridIdTo]=\"control.bindGridIdTo!\"\r\n [useTheseColumns]=\"control.useTheseColumns!\"\r\n [hideOrgTree]=\"control.hideOrgTree!\"\r\n [sourceSpaceHeight]=\"control.sourceSpaceHeight!\"\r\n ></core-form-control-seeker>\r\n }\r\n @case(\"EMPLOYEE_SEEK\") {\r\n <core-form-control-seeker\r\n [excludeExistingList]=\"control.excludeExistingList!\"\r\n [multiMode]=\"control.multiMode!\" [multiModeTableHeight]=\"control.multiModeTableHeight!\" [multiModeRowHeight]=\"control.multiModeRowHeight!\"\r\n [objectList$]=\"control.objectList$!\" [formControlName]=\"control.field\"\r\n [seekerSourceType]=\"control.seekerSourceType!\" \r\n [preDefinedOuterParam$]=\"control.preDefinedOuterParam$!\"\r\n [preDefinedOuterFilter$]=\"control.preDefinedOuterFilter$!\"\r\n [boundFrom]=\"control.boundFrom!\" [shownFrom]=\"control.shownFrom!\" [alsoBindTo]=\"control.alsoBindTo!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\"\r\n [click$]=\"control.click$\"\r\n [multiModeExtendedColumns]=\"control.multiModeExtendedColumns!\"\r\n [multiModeExtendedSections]=\"control.multiModeExtendedSections!\"\r\n [editBufferData$]=\"control.editBufferData$!\"\r\n [indirectBinding]=\"control.indirectBinding!\"\r\n [bindGridIdTo]=\"control.bindGridIdTo!\"\r\n [useTheseColumns]=\"control.useTheseColumns!\"\r\n [hideOrgTree]=\"control.hideOrgTree!\"\r\n [sourceSpaceHeight]=\"control.sourceSpaceHeight!\"\r\n ></core-form-control-seeker>\r\n }\r\n @case(\"CONTRACT_SEEK\") {\r\n <core-form-control-seeker\r\n [excludeExistingList]=\"control.excludeExistingList!\"\r\n [multiMode]=\"control.multiMode!\" [multiModeTableHeight]=\"control.multiModeTableHeight!\" [multiModeRowHeight]=\"control.multiModeRowHeight!\"\r\n [objectList$]=\"control.objectList$!\" [formControlName]=\"control.field\"\r\n [seekerSourceType]=\"control.seekerSourceType!\" [boundFrom]=\"control.boundFrom!\"\r\n [preDefinedOuterParam$]=\"control.preDefinedOuterParam$!\" \r\n [preDefinedOuterFilter$]=\"control.preDefinedOuterFilter$!\"\r\n [shownFrom]=\"control.shownFrom!\"\r\n [alsoBindTo]=\"control.alsoBindTo!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\"\r\n [multiModeExtendedColumns]=\"control.multiModeExtendedColumns!\"\r\n [multiModeExtendedSections]=\"control.multiModeExtendedSections!\"\r\n [click$]=\"control.click$\"\r\n [useTheseColumns]=\"control.useTheseColumns!\"\r\n [hideOrgTree]=\"control.hideOrgTree!\"\r\n [sourceSpaceHeight]=\"control.sourceSpaceHeight!\"\r\n ></core-form-control-seeker>\r\n }\r\n @case(\"WORKING_SEEK\") {\r\n <core-form-control-seeker \r\n [excludeExistingList]=\"control.excludeExistingList!\"\r\n [multiMode]=\"control.multiMode!\" [multiModeTableHeight]=\"control.multiModeTableHeight!\" [multiModeRowHeight]=\"control.multiModeRowHeight!\"\r\n [objectList$]=\"control.objectList$!\" [formControlName]=\"control.field\"\r\n [seekerSourceType]=\"control.seekerSourceType!\" \r\n [preDefinedOuterParam$]=\"control.preDefinedOuterParam$!\"\r\n [preDefinedOuterFilter$]=\"control.preDefinedOuterFilter$!\"\r\n [boundFrom]=\"control.boundFrom!\" [shownFrom]=\"control.shownFrom!\" [alsoBindTo]=\"control.alsoBindTo!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\"\r\n [multiModeExtendedColumns]=\"control.multiModeExtendedColumns!\"\r\n [multiModeExtendedSections]=\"control.multiModeExtendedSections!\"\r\n [click$]=\"control.click$\"\r\n [useTheseColumns]=\"control.useTheseColumns!\"\r\n [hideOrgTree]=\"control.hideOrgTree!\"\r\n [sourceSpaceHeight]=\"control.sourceSpaceHeight!\"\r\n ></core-form-control-seeker>\r\n }\r\n @case(\"WAGE_SEEK\") {\r\n <core-form-control-seeker \r\n [excludeExistingList]=\"control.excludeExistingList!\"\r\n [formControlName]=\"control.field\"\r\n [multiMode]=\"control.multiMode!\" [multiModeTableHeight]=\"control.multiModeTableHeight!\" [multiModeRowHeight]=\"control.multiModeRowHeight!\"\r\n [objectList$]=\"control.objectList$!\"\r\n [seekerSourceType]=\"control.seekerSourceType!\" \r\n [preDefinedOuterParam$]=\"control.preDefinedOuterParam$!\"\r\n [preDefinedOuterFilter$]=\"control.preDefinedOuterFilter$!\"\r\n [boundFrom]=\"control.boundFrom!\" [shownFrom]=\"control.shownFrom!\" [alsoBindTo]=\"control.alsoBindTo!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\"\r\n [multiModeExtendedColumns]=\"control.multiModeExtendedColumns!\"\r\n [multiModeExtendedSections]=\"control.multiModeExtendedSections!\"\r\n [click$]=\"control.click$\"\r\n [useTheseColumns]=\"control.useTheseColumns!\"\r\n [hideOrgTree]=\"control.hideOrgTree!\"\r\n [sourceSpaceHeight]=\"control.sourceSpaceHeight!\"\r\n ></core-form-control-seeker>\r\n }\r\n @case(\"POSITION_SEEK\") {\r\n <core-form-control-seeker \r\n [excludeExistingList]=\"control.excludeExistingList!\"\r\n [objectList$]=\"control.objectList$!\"\r\n [multiMode]=\"control.multiMode!\" [multiModeTableHeight]=\"control.multiModeTableHeight!\" [multiModeRowHeight]=\"control.multiModeRowHeight!\"\r\n [formControlName]=\"control.field\" [alsoBindTo]=\"control.alsoBindTo!\"\r\n [seekerSourceType]=\"control.seekerSourceType!\" \r\n [preDefinedOuterParam$]=\"control.preDefinedOuterParam$!\"\r\n [preDefinedOuterFilter$]=\"control.preDefinedOuterFilter$!\"\r\n [boundFrom]=\"control.boundFrom!\" [shownFrom]=\"control.shownFrom!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\"\r\n [multiModeExtendedColumns]=\"control.multiModeExtendedColumns!\"\r\n [multiModeExtendedSections]=\"control.multiModeExtendedSections!\"\r\n [seekerVerifyIgnore]=\"control.seekerVerifyIgnore!\"\r\n [click$]=\"control.click$\"\r\n [useTheseColumns]=\"control.useTheseColumns!\"\r\n [hideOrgTree]=\"control.hideOrgTree!\"\r\n [sourceSpaceHeight]=\"control.sourceSpaceHeight!\"\r\n ></core-form-control-seeker>\r\n }\r\n @case(\"POSITION_CONCURRENT_SEEK\") {\r\n <core-form-control-seeker\r\n [excludeExistingList]=\"control.excludeExistingList!\"\r\n [multiMode]=\"control.multiMode!\" [multiModeTableHeight]=\"control.multiModeTableHeight!\" [multiModeRowHeight]=\"control.multiModeRowHeight!\"\r\n [formControlName]=\"control.field\" [alsoBindTo]=\"control.alsoBindTo!\"\r\n [seekerSourceType]=\"control.seekerSourceType!\" \r\n [preDefinedOuterParam$]=\"control.preDefinedOuterParam$!\"\r\n [preDefinedOuterFilter$]=\"control.preDefinedOuterFilter$!\"\r\n [boundFrom]=\"control.boundFrom!\" [shownFrom]=\"control.shownFrom!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\"\r\n [multiModeExtendedColumns]=\"control.multiModeExtendedColumns!\"\r\n [multiModeExtendedSections]=\"control.multiModeExtendedSections!\"\r\n [multiModeTableHeight]=\"control.multiModeTableHeight!\"\r\n [click$]=\"control.click$\"\r\n [useTheseColumns]=\"control.useTheseColumns!\"\r\n [hideOrgTree]=\"control.hideOrgTree!\"\r\n [sourceSpaceHeight]=\"control.sourceSpaceHeight!\"\r\n ></core-form-control-seeker>\r\n }\r\n @case(\"ORGANIZATION_UNIT_SEEK\") {\r\n <core-form-control-seeker\r\n [formControlName]=\"control.field\" [seekerSourceType]=\"control.seekerSourceType!\"\r\n [boundFrom]=\"control.boundFrom!\" [alsoBindTo]=\"control.alsoBindTo!\" [shownFrom]=\"control.shownFrom!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\"\r\n [click$]=\"control.click$\"\r\n ></core-form-control-seeker>\r\n }\r\n @case(\"TOPICPICKER\") {\r\n <core-topic-picker [formControlName]=\"control.field\" [popupHeight]=\"control.popupHeight!\" [getByIdApi]=\"control.getByIdApi!\"></core-topic-picker>\r\n }\r\n }\r\n }\r\n }\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"control.controlType==='BUTTON'\">\r\n <button type=\"button\" class=\"btn btn-secondary text\" (click)=\"oHandleClick($event)\">{{control.label| translate: lang}}</button>\r\n </ng-container>\r\n <!-- END: FORM-CONTROL SESSION-->\r\n\r\n <!-- START: ERROR SESSION-->\r\n <div *ngIf=\"!!errors!.length\">\r\n <div class=\"form-control-error\" *ngFor=\"let error of errors\">\r\n {{ error.errorMessage | translate: lang }}\r\n </div>\r\n </div>\r\n <div *ngIf=\"!!!errors!.length && !!checkError$.value\">\r\n <div>\r\n {{ '&nbsp;' }}\r\n </div>\r\n </div>\r\n <!-- END: ERROR SESSION-->\r\n\r\n </div>\r\n</div>", styles: [".core-control-container{font-size:var(--typo-basic-font-size)!important}.core-control-container .control-label{color:#848484}.core-control-container>div.hidden{display:none}.core-control-container label{color:#464646}.core-control-container label.required:after{content:\"*\";color:#ff040b}.core-control-container label.avatar-label{width:var(--size-file-uploader);display:flex;align-items:center;justify-content:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "pipe", type: TableCellPipe, name: "tableCell" }, { kind: "component", type: CoreDropdownComponent, selector: "core-dropdown", inputs: ["getByIdObject$", "paramMode", "shownFrom", "options$", "height", "placeholder", "loading", "warningDisable", "clearDisable", "fitHeightWithItemCount", "itemHeight"] }, { kind: "component", type: CoreListComponent, selector: "core-list", inputs: ["title", "height", "options"] }, { kind: "component", type: CoreChecklistComponent, selector: "core-checklist", inputs: ["paramMode", "getByIdObject$", "shownFrom", "options$", "height", "placeholder", "loading", "readonly", "disabled"] }, { kind: "component", type: CoreFormControlSeekerComponent, selector: "core-form-control-seeker", inputs: ["title", "showPageHeader", "preDefinedOuterParam$", "preDefinedOuterFilter$", "click$", "getByIdObject$", "getByIdApi", "paramMode", "multiMode", "objectList$", "useTheseColumns", "hideOrgTree", "excludedColumns", "excludeExistingList", "sourceSpaceHeight", "indirectBinding", "bindGridIdTo", "multiModeExtendedColumns", "multiModeExtendedSections", "editBufferData$", "multiModeTableHeight", "multiModeRowHeight", "seekerSourceType", "boundFrom", "shownFrom", "alsoBindTo", "seekerVerifyIgnore"], outputs: ["onDoubleClick"] }, { kind: "component", type: CoreCheckboxComponent, selector: "core-checkbox", inputs: ["text", "tooltipPosition", "tooltip", "inputValue", "disabled"], outputs: ["onClick"] }, { kind: "component", type: CoreFileUploaderComponent, selector: "core-file-uploader", inputs: ["uploadFileType", "fileDataControlName", "fileNameControlName", "fileTypeControlName", "avatarSize", "defaultAvatar", "hidePreview", "verticalMode"] }, { kind: "component", type: CoreAttachmentComponent, selector: "core-attachment", inputs: ["assignTo", "readonly", "valueToShow"] }, { kind: "component", type: CoreGridBufferComponent, selector: "core-grid-buffer", inputs: ["formSections", "gridColumns"], outputs: ["onBufferFormCreated"] }, { kind: "component", type: CoreDatePickerComponent, selector: "core-date-picker", inputs: ["enableTimeZoneConverter", "showPlaceholder", "popupWidth", "popupXPadding", "popupAlign", "rangeLimit", "readonly", "disabled"] }, { kind: "component", type: CoreOrgTreeComponent, selector: "core-org-tree", inputs: ["lineColor", "fullWidthMode", "accessorMode", "searchMode", "fullRendering", "height", "disabledLoopExpand", "showCheckInheritance", "excludedIds$", "stateIsolated$"], outputs: ["itemDoubleClick", "itemClick"] }, { kind: "component", type: CoreRadioGroupComponent, selector: "core-radio-group", inputs: ["options$", "vertical"] }, { kind: "component", type: CoreMccComponent, selector: "core-mcc", inputs: ["height", "columns", "shownFrom", "apiDefinition", "getByIdApi", "outerParam$", "selectedRow$", "outerFilterOperators", "outerInOperators"] }, { kind: "component", type: CoreMonthSelectorComponent, selector: "core-month-selector", inputs: ["align"], outputs: ["onYearClick"] }, { kind: "directive", type: TooltipDirective, selector: "[appTooltip]", inputs: ["color", "backgroundColor", "appTooltip", "showAnyway", "position"] }, { kind: "component", type: CoreCurrencyInputComponent, selector: "core-currency-input", inputs: ["currencySign"], outputs: ["onLeftFocus"] }, { kind: "component", type: CoreShiftCellComponent, selector: "core-shift-cell", inputs: ["$readOnly", "$hideStarterPlusSign", "$hideStickersWhileDragover", "$backgroundColor"] }, { kind: "component", type: CoreShiftCollectionComponent, selector: "core-shift-collection", inputs: ["height", "relativeMode"] }, { kind: "component", type: CoreTopicPickerComponent, selector: "core-topic-picker", inputs: ["popupHeight", "getByIdApi"] }] }); }
20454
+ }
20455
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreControlComponent, decorators: [{
20456
+ type: Component,
20457
+ args: [{ selector: 'core-control', imports: [
20458
+ CommonModule,
20459
+ ReactiveFormsModule,
20460
+ TranslatePipe,
20461
+ TableCellPipe,
20462
+ CoreDropdownComponent,
20463
+ CoreListComponent,
20464
+ CoreChecklistComponent,
20465
+ CoreFormControlSeekerComponent,
20466
+ CoreCheckboxComponent,
20467
+ CoreFileUploaderComponent,
20468
+ CoreAttachmentComponent,
20469
+ CoreGridBufferComponent,
20470
+ CoreDatePickerComponent,
20471
+ CoreOrgTreeComponent,
20472
+ CoreRadioGroupComponent,
20473
+ CoreMccComponent,
20474
+ CoreMonthSelectorComponent,
20475
+ TooltipDirective,
20476
+ CoreCurrencyInputComponent,
20477
+ CoreShiftCellComponent,
20478
+ CoreShiftCollectionComponent,
20479
+ CoreTopicPickerComponent
20480
+ ], template: "<div class=\"core-control-container\">\r\n <div [formGroup]=\"form\" [class.hidden]=\"!!control.hidden\">\r\n\r\n <!-- START: LABEL SESSION-->\r\n <label [class]=\"'control-label' + (required ? ' required' : '')\" [attr.for]=\"control.field\"\r\n [class.avatar-label]=\"control.uploadFileType==='IMAGE_AVATAR'\" [appTooltip]=\"control.tooltip! | translate: lang\" [ngStyle]=\"{\r\n display: 'inline-block'\r\n }\">\r\n {{(control.controlType!=='CHECKBOX' && control.controlType!=='BUTTON') ? (control.label | translate: lang) : ''}}\r\n </label>\r\n\r\n @if (!!control.hint! && control.controlType !== 'CHECKBOX') {\r\n <i class=\"feather-help-circle\" [appTooltip]=\"control.hint!\" [ngStyle]=\"{\r\n display: 'inline-block',\r\n marginLeft: '2px'\r\n }\"></i>\r\n }\r\n\r\n <!-- START: LABEL SESSION-->\r\n\r\n <!-- START: FORM-CONTROL SESSION-->\r\n\r\n <ng-container>\r\n @switch (control.controlType) {\r\n @case (\"TEXTBOX\") {\r\n <input *ngIf=\"control.type==='date'\" [formControlName]=\"control.field\" [type]=\"control.type\"\r\n class=\"form-control\" [readonly]=\"control.readonly!\" useValueAsDate>\r\n \r\n <input *ngIf=\"control.type==='number'\" [formControlName]=\"control.field\" [type]=\"control.type\"\r\n class=\"form-control\" [readonly]=\"control.readonly\" [step]=\"control.step || '1'\">\r\n \r\n <input *ngIf=\"control.type!=='date' && control.type!=='number'\" [formControlName]=\"control.field\"\r\n [value]=\"form.get(control.field)?.value | tableCell: control.pipe : lang\" [type]=\"control.type\"\r\n class=\"form-control\" [readonly]=\"control.readonly\"\r\n [appTooltip]=\"form.get(control.field)?.value\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n >\r\n }\r\n @case (\"CURRENCY\") {\r\n <core-currency-input [formControlName]=\"control.field\"></core-currency-input>\r\n }\r\n @case (\"TEXTAREA\") {\r\n <textarea [rows]=\"control.textareaRows?.toString() || '3'\" [ngStyle]=\"{ height: 'unset' }\"\r\n [formControlName]=\"control.field\" class=\"form-control\" [readonly]=\"control.readonly\"></textarea>\r\n }\r\n @case (\"CHECKBOX\") {\r\n <core-checkbox [formControlName]=\"control.field\" [text]=\"control.label\"\r\n [inputValue]=\"control.value\"></core-checkbox>\r\n }\r\n @case (\"MCC\") {\r\n <core-mcc [formControlName]=\"control.field\" [columns]=\"control.columns!\" [shownFrom]=\"control.shownFrom!\" \r\n [apiDefinition]=\"control.apiDefinition!\" [getByIdApi]=\"control.getByIdApi!\" [selectedRow$]=\"control.selectedRow$!\"\r\n [outerParam$]=\"control.outerParam$!\"\r\n ></core-mcc>\r\n }\r\n @case (\"DATEPICKER\") {\r\n <core-date-picker [formControlName]=\"control.field\" [rangeLimit]=\"control.rangeLimit!\" [popupAlign]=\"control.popupAlign!\"></core-date-picker>\r\n }\r\n @case (\"DROPDOWN\") {\r\n @if (!!control.dropdownOptions$) {\r\n <core-dropdown [formControlName]=\"control.field\" [options$]=\"control.dropdownOptions$!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\" [shownFrom]=\"control.shownFrom!\"></core-dropdown>\r\n }\r\n }\r\n @case (\"LIST\") {\r\n <core-list [formControlName]=\"control.field\" [options]=\"control.listOptions!\"></core-list>\r\n }\r\n @case (\"CHECKLIST\") {\r\n @if (!!control.checklistOptions$) {\r\n <core-checklist [formControlName]=\"control.field\" [options$]=\"control.checklistOptions$!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\" [shownFrom]=\"control.shownFrom!\"></core-checklist>\r\n }\r\n }\r\n @case (\"FILEUPLOADER\") {\r\n @if (!!control.uploadFileType) {\r\n <core-file-uploader [formControlName]=\"control.field\" [uploadFileType]=\"control.uploadFileType\"\r\n [fileDataControlName]=\"control.fileDataControlName!\"\r\n [fileNameControlName]=\"control.fileNameControlName!\"\r\n [fileTypeControlName]=\"control.fileTypeControlName!\"\r\n [verticalMode]=\"control.verticalMode!\"></core-file-uploader>\r\n }\r\n }\r\n @case (\"ATTACHMENT\") {\r\n <core-attachment ngDefaultControl [formControlName]=\"control.field\" [assignTo]=\"control.assignTo!\"\r\n [valueToShow]=\"control.valueToShow!\"></core-attachment>\r\n }\r\n @case (\"GRIDBUFFER\") {\r\n @if (!!control.gridBufferFormSections && !!control.gridBufferTableColumns) {\r\n <core-grid-buffer [formControlName]=\"control.field\" [formSections]=\"control.gridBufferFormSections\"\r\n [gridColumns]=\"control.gridBufferTableColumns\"\r\n (onBufferFormCreated)=\"!!control.onBufferFormCreated ? control.onBufferFormCreated($event) : null\"></core-grid-buffer>\r\n }\r\n }\r\n @case (\"ORGTREECHECK\") {\r\n <core-org-tree [formControlName]=\"control.field\"\r\n [accessorMode]=\"coreOrgTreeDefaultAccessorMode\" [height]=\"control.height!\"></core-org-tree>\r\n }\r\n @case (\"RADIOGROUP\") {\r\n <core-radio-group [formControlName]=\"control.field\"\r\n [options$]=\"control.radioGroupOptions$!\"\r\n [vertical]=\"control.verticalMode!\"\r\n ></core-radio-group>\r\n }\r\n @case (\"MONTHSELECTOR\") {\r\n <core-month-selector [formControlName]=\"control.field\"></core-month-selector>\r\n }\r\n @case (\"SHIFTCELL\") {\r\n <core-shift-cell [formControlName]=\"control.field\"></core-shift-cell>\r\n }\r\n @case (\"SHIFTCOLLECTION\") {\r\n <core-shift-collection [relativeMode]=\"true\" [height]=\"control.height || 800\"></core-shift-collection>\r\n }\r\n @case (\"SEEKER\") {\r\n @switch(control.seekerSourceType) {\r\n @case(\"JOB_SEEK\") {\r\n <core-form-control-seeker\r\n [excludeExistingList]=\"control.excludeExistingList!\"\r\n [multiMode]=\"control.multiMode!\" [multiModeTableHeight]=\"control.multiModeTableHeight!\" [multiModeRowHeight]=\"control.multiModeRowHeight!\"\r\n [objectList$]=\"control.objectList$!\" [formControlName]=\"control.field\"\r\n [seekerSourceType]=\"control.seekerSourceType!\" \r\n [preDefinedOuterParam$]=\"control.preDefinedOuterParam$!\"\r\n [preDefinedOuterFilter$]=\"control.preDefinedOuterFilter$!\"\r\n [boundFrom]=\"control.boundFrom!\" [shownFrom]=\"control.shownFrom!\" [alsoBindTo]=\"control.alsoBindTo!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\"\r\n [click$]=\"control.click$\"\r\n [multiModeExtendedColumns]=\"control.multiModeExtendedColumns!\"\r\n [multiModeExtendedSections]=\"control.multiModeExtendedSections!\"\r\n [editBufferData$]=\"control.editBufferData$!\"\r\n [indirectBinding]=\"control.indirectBinding!\"\r\n [bindGridIdTo]=\"control.bindGridIdTo!\"\r\n [useTheseColumns]=\"control.useTheseColumns!\"\r\n [hideOrgTree]=\"control.hideOrgTree!\"\r\n [sourceSpaceHeight]=\"control.sourceSpaceHeight!\"\r\n ></core-form-control-seeker>\r\n }\r\n @case(\"EMPLOYEE_SEEK\") {\r\n <core-form-control-seeker\r\n [excludeExistingList]=\"control.excludeExistingList!\"\r\n [multiMode]=\"control.multiMode!\" [multiModeTableHeight]=\"control.multiModeTableHeight!\" [multiModeRowHeight]=\"control.multiModeRowHeight!\"\r\n [objectList$]=\"control.objectList$!\" [formControlName]=\"control.field\"\r\n [seekerSourceType]=\"control.seekerSourceType!\" \r\n [preDefinedOuterParam$]=\"control.preDefinedOuterParam$!\"\r\n [preDefinedOuterFilter$]=\"control.preDefinedOuterFilter$!\"\r\n [boundFrom]=\"control.boundFrom!\" [shownFrom]=\"control.shownFrom!\" [alsoBindTo]=\"control.alsoBindTo!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\"\r\n [click$]=\"control.click$\"\r\n [multiModeExtendedColumns]=\"control.multiModeExtendedColumns!\"\r\n [multiModeExtendedSections]=\"control.multiModeExtendedSections!\"\r\n [editBufferData$]=\"control.editBufferData$!\"\r\n [indirectBinding]=\"control.indirectBinding!\"\r\n [bindGridIdTo]=\"control.bindGridIdTo!\"\r\n [useTheseColumns]=\"control.useTheseColumns!\"\r\n [hideOrgTree]=\"control.hideOrgTree!\"\r\n [sourceSpaceHeight]=\"control.sourceSpaceHeight!\"\r\n ></core-form-control-seeker>\r\n }\r\n @case(\"CONTRACT_SEEK\") {\r\n <core-form-control-seeker\r\n [excludeExistingList]=\"control.excludeExistingList!\"\r\n [multiMode]=\"control.multiMode!\" [multiModeTableHeight]=\"control.multiModeTableHeight!\" [multiModeRowHeight]=\"control.multiModeRowHeight!\"\r\n [objectList$]=\"control.objectList$!\" [formControlName]=\"control.field\"\r\n [seekerSourceType]=\"control.seekerSourceType!\" [boundFrom]=\"control.boundFrom!\"\r\n [preDefinedOuterParam$]=\"control.preDefinedOuterParam$!\" \r\n [preDefinedOuterFilter$]=\"control.preDefinedOuterFilter$!\"\r\n [shownFrom]=\"control.shownFrom!\"\r\n [alsoBindTo]=\"control.alsoBindTo!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\"\r\n [multiModeExtendedColumns]=\"control.multiModeExtendedColumns!\"\r\n [multiModeExtendedSections]=\"control.multiModeExtendedSections!\"\r\n [click$]=\"control.click$\"\r\n [useTheseColumns]=\"control.useTheseColumns!\"\r\n [hideOrgTree]=\"control.hideOrgTree!\"\r\n [sourceSpaceHeight]=\"control.sourceSpaceHeight!\"\r\n ></core-form-control-seeker>\r\n }\r\n @case(\"WORKING_SEEK\") {\r\n <core-form-control-seeker \r\n [excludeExistingList]=\"control.excludeExistingList!\"\r\n [multiMode]=\"control.multiMode!\" [multiModeTableHeight]=\"control.multiModeTableHeight!\" [multiModeRowHeight]=\"control.multiModeRowHeight!\"\r\n [objectList$]=\"control.objectList$!\" [formControlName]=\"control.field\"\r\n [seekerSourceType]=\"control.seekerSourceType!\" \r\n [preDefinedOuterParam$]=\"control.preDefinedOuterParam$!\"\r\n [preDefinedOuterFilter$]=\"control.preDefinedOuterFilter$!\"\r\n [boundFrom]=\"control.boundFrom!\" [shownFrom]=\"control.shownFrom!\" [alsoBindTo]=\"control.alsoBindTo!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\"\r\n [multiModeExtendedColumns]=\"control.multiModeExtendedColumns!\"\r\n [multiModeExtendedSections]=\"control.multiModeExtendedSections!\"\r\n [click$]=\"control.click$\"\r\n [useTheseColumns]=\"control.useTheseColumns!\"\r\n [hideOrgTree]=\"control.hideOrgTree!\"\r\n [sourceSpaceHeight]=\"control.sourceSpaceHeight!\"\r\n ></core-form-control-seeker>\r\n }\r\n @case(\"WAGE_SEEK\") {\r\n <core-form-control-seeker \r\n [excludeExistingList]=\"control.excludeExistingList!\"\r\n [formControlName]=\"control.field\"\r\n [multiMode]=\"control.multiMode!\" [multiModeTableHeight]=\"control.multiModeTableHeight!\" [multiModeRowHeight]=\"control.multiModeRowHeight!\"\r\n [objectList$]=\"control.objectList$!\"\r\n [seekerSourceType]=\"control.seekerSourceType!\" \r\n [preDefinedOuterParam$]=\"control.preDefinedOuterParam$!\"\r\n [preDefinedOuterFilter$]=\"control.preDefinedOuterFilter$!\"\r\n [boundFrom]=\"control.boundFrom!\" [shownFrom]=\"control.shownFrom!\" [alsoBindTo]=\"control.alsoBindTo!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\"\r\n [multiModeExtendedColumns]=\"control.multiModeExtendedColumns!\"\r\n [multiModeExtendedSections]=\"control.multiModeExtendedSections!\"\r\n [click$]=\"control.click$\"\r\n [useTheseColumns]=\"control.useTheseColumns!\"\r\n [hideOrgTree]=\"control.hideOrgTree!\"\r\n [sourceSpaceHeight]=\"control.sourceSpaceHeight!\"\r\n ></core-form-control-seeker>\r\n }\r\n @case(\"POSITION_SEEK\") {\r\n <core-form-control-seeker \r\n [excludeExistingList]=\"control.excludeExistingList!\"\r\n [objectList$]=\"control.objectList$!\"\r\n [multiMode]=\"control.multiMode!\" [multiModeTableHeight]=\"control.multiModeTableHeight!\" [multiModeRowHeight]=\"control.multiModeRowHeight!\"\r\n [formControlName]=\"control.field\" [alsoBindTo]=\"control.alsoBindTo!\"\r\n [seekerSourceType]=\"control.seekerSourceType!\" \r\n [preDefinedOuterParam$]=\"control.preDefinedOuterParam$!\"\r\n [preDefinedOuterFilter$]=\"control.preDefinedOuterFilter$!\"\r\n [boundFrom]=\"control.boundFrom!\" [shownFrom]=\"control.shownFrom!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\"\r\n [multiModeExtendedColumns]=\"control.multiModeExtendedColumns!\"\r\n [multiModeExtendedSections]=\"control.multiModeExtendedSections!\"\r\n [seekerVerifyIgnore]=\"control.seekerVerifyIgnore!\"\r\n [click$]=\"control.click$\"\r\n [useTheseColumns]=\"control.useTheseColumns!\"\r\n [hideOrgTree]=\"control.hideOrgTree!\"\r\n [sourceSpaceHeight]=\"control.sourceSpaceHeight!\"\r\n ></core-form-control-seeker>\r\n }\r\n @case(\"POSITION_CONCURRENT_SEEK\") {\r\n <core-form-control-seeker\r\n [excludeExistingList]=\"control.excludeExistingList!\"\r\n [multiMode]=\"control.multiMode!\" [multiModeTableHeight]=\"control.multiModeTableHeight!\" [multiModeRowHeight]=\"control.multiModeRowHeight!\"\r\n [formControlName]=\"control.field\" [alsoBindTo]=\"control.alsoBindTo!\"\r\n [seekerSourceType]=\"control.seekerSourceType!\" \r\n [preDefinedOuterParam$]=\"control.preDefinedOuterParam$!\"\r\n [preDefinedOuterFilter$]=\"control.preDefinedOuterFilter$!\"\r\n [boundFrom]=\"control.boundFrom!\" [shownFrom]=\"control.shownFrom!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\"\r\n [multiModeExtendedColumns]=\"control.multiModeExtendedColumns!\"\r\n [multiModeExtendedSections]=\"control.multiModeExtendedSections!\"\r\n [multiModeTableHeight]=\"control.multiModeTableHeight!\"\r\n [click$]=\"control.click$\"\r\n [useTheseColumns]=\"control.useTheseColumns!\"\r\n [hideOrgTree]=\"control.hideOrgTree!\"\r\n [sourceSpaceHeight]=\"control.sourceSpaceHeight!\"\r\n ></core-form-control-seeker>\r\n }\r\n @case(\"ORGANIZATION_UNIT_SEEK\") {\r\n <core-form-control-seeker\r\n [formControlName]=\"control.field\" [seekerSourceType]=\"control.seekerSourceType!\"\r\n [boundFrom]=\"control.boundFrom!\" [alsoBindTo]=\"control.alsoBindTo!\" [shownFrom]=\"control.shownFrom!\"\r\n [getByIdObject$]=\"control.getByIdObject$!\"\r\n [click$]=\"control.click$\"\r\n ></core-form-control-seeker>\r\n }\r\n @case(\"TOPICPICKER\") {\r\n <core-topic-picker [formControlName]=\"control.field\" [popupHeight]=\"control.popupHeight!\" [getByIdApi]=\"control.getByIdApi!\"></core-topic-picker>\r\n }\r\n }\r\n }\r\n }\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"control.controlType==='BUTTON'\">\r\n <button type=\"button\" class=\"btn btn-secondary text\" (click)=\"oHandleClick($event)\">{{control.label| translate: lang}}</button>\r\n </ng-container>\r\n <!-- END: FORM-CONTROL SESSION-->\r\n\r\n <!-- START: ERROR SESSION-->\r\n <div *ngIf=\"!!errors!.length\">\r\n <div class=\"form-control-error\" *ngFor=\"let error of errors\">\r\n {{ error.errorMessage | translate: lang }}\r\n </div>\r\n </div>\r\n <div *ngIf=\"!!!errors!.length && !!checkError$.value\">\r\n <div>\r\n {{ '&nbsp;' }}\r\n </div>\r\n </div>\r\n <!-- END: ERROR SESSION-->\r\n\r\n </div>\r\n</div>", styles: [".core-control-container{font-size:var(--typo-basic-font-size)!important}.core-control-container .control-label{color:#848484}.core-control-container>div.hidden{display:none}.core-control-container label{color:#464646}.core-control-container label.required:after{content:\"*\";color:#ff040b}.core-control-container label.avatar-label{width:var(--size-file-uploader);display:flex;align-items:center;justify-content:center}\n"] }]
20481
+ }], ctorParameters: () => [{ type: MultiLanguageService }, { type: AlertService }], propDecorators: { control: [{
20482
+ type: Input
20483
+ }], form: [{
20484
+ type: Input
20485
+ }], checkError$: [{
20486
+ type: Input
20487
+ }], rangeLimit: [{
20488
+ type: Input
20489
+ }] } });
20490
+
20491
+ class CoreFormComponent {
20492
+ constructor(coreControlService, multiLanguageService, alertService, coreFormService, appConfigService) {
20493
+ this.coreControlService = coreControlService;
20494
+ this.multiLanguageService = multiLanguageService;
20495
+ this.alertService = alertService;
20496
+ this.coreFormService = coreFormService;
20497
+ this.appConfigService = appConfigService;
20498
+ this.checkError$ = new BehaviorSubject(false);
20499
+ this.onFormCreated = new EventEmitter();
20500
+ this.onFormRefCreated = new EventEmitter();
20501
+ this.onSubmit = new EventEmitter();
20502
+ this.onSave = new EventEmitter();
20503
+ this.onCancal = new EventEmitter();
20504
+ this.buttonClick = new EventEmitter();
20505
+ this.subscriptions = [];
20506
+ this.payLoad = '';
20507
+ this.isDevMode = isDevMode();
20508
+ }
20509
+ updateSections(newSections) {
20510
+ this.sections.map((section, sectionIndex) => {
20511
+ const newSection = newSections[sectionIndex];
20512
+ section.rows.map((row, rowIndex) => {
20513
+ const newRow = newSection.rows[rowIndex];
20514
+ row.map((control, controlIndex) => {
20515
+ const newControl = newRow[controlIndex];
20516
+ /* THE ONLY PROP TO BE UDATED IS 'hidden', THE OTHERS SHOULD BE MANIPULATED THROUGH this.form.get(YOUR_CONTROL_NAME)... */
20517
+ control.hidden = newControl?.hidden;
20518
+ /************************************************************************************************************************/
20519
+ });
20520
+ });
20521
+ /* #region Oct the 11th 2023 */
20522
+ /* Some sections was posibly have renderOff=true from previous state and their controls must be created/remove */
20523
+ /*
20524
+ BUT THIS TASK IS HARD SO FAR
20525
+ */
20526
+ /* #endregion Oct the 11th 2023 */
20527
+ });
20528
+ }
20529
+ ngOnChanges(changes) {
20530
+ if (changes['inputSections']) {
20531
+ let newSections = changes['inputSections'].currentValue;
20532
+ if (!!!this.form) {
20533
+ this.sections = newSections;
20534
+ let leftGroup;
20535
+ let form;
20536
+ const mainGroup = this.coreControlService.toGroup(this.sections);
20537
+ if (!!this.leftInputSections) {
20538
+ leftGroup = this.coreControlService.toGroup(this.leftInputSections);
20539
+ form = new FormGroup({ ...leftGroup, ...mainGroup });
20558
20540
  }
20541
+ else {
20542
+ form = new FormGroup(mainGroup);
20543
+ }
20544
+ this.form = form;
20545
+ }
20546
+ else {
20547
+ this.updateSections(newSections);
20548
+ }
20549
+ this.onFormCreated.emit({
20550
+ formName: this.formName,
20551
+ formGroup: this.form,
20559
20552
  });
20560
20553
  }
20561
20554
  }
20562
- /**
20563
- *
20564
- * PHƯƠNG THỨC NÀY ĐƯỢC TẠO RA KHI DEV VNS-PORTAL
20565
- */
20566
- onSave(e) {
20567
- this.loading = true;
20568
- this.animatedTextService.text$.next(this.mls.trans(EnumTranslateKey.UI_DIALOG_ADDING_PLEASE_WAIT));
20569
- if (!!this.appConfigService.DEBUG_ENABLED) {
20570
- alert(JSON.stringify(e, null, 2));
20555
+ ngOnInit() {
20556
+ /*
20557
+ if (this.appConfigService.APP_TYPE === "WEBAPP") {
20558
+ */
20559
+ if (!this.disableSaveButton && !this.disableCancelButton) {
20560
+ this.buttonItems = [
20561
+ EnumCoreButtonVNSCode.NONE_HEADER_SAVE,
20562
+ EnumCoreButtonVNSCode.NONE_HEADER_CANCEL,
20563
+ ];
20571
20564
  }
20572
- this.commonHttpRequestService
20573
- .makePostRequest('create ' + this.entityTable, this.crud.s, e)
20574
- .subscribe((x) => {
20575
- this.loading = false;
20576
- const body = x.body;
20577
- this.responseService.resolve(body);
20578
- if (x.ok && x.status === 200 && body.statusCode === 200) {
20579
- if (isDevMode()) {
20580
- this.sendSignal(body.innerBody);
20565
+ else if (!!this.disableCancelButton) {
20566
+ this.buttonItems = [
20567
+ EnumCoreButtonVNSCode.NONE_HEADER_SAVE,
20568
+ ];
20569
+ }
20570
+ else if (!!this.disableSaveButton) {
20571
+ this.buttonItems = [
20572
+ EnumCoreButtonVNSCode.NONE_HEADER_CANCEL,
20573
+ ];
20574
+ }
20575
+ /*
20576
+ } else if (this.appConfigService.APP_TYPE === "PORTAL") {
20577
+ if (!this.disableSaveButton) {
20578
+ this.buttonItems = [
20579
+ EnumCoreButtonVNSCode.SEND,
20580
+ EnumCoreButtonVNSCode.CANCEL,
20581
+ EnumCoreButtonVNSCode.SAVE,
20582
+ ]
20583
+ } else {
20584
+ this.buttonItems = [
20585
+ EnumCoreButtonVNSCode.SEND,
20586
+ EnumCoreButtonVNSCode.CANCEL,
20587
+ ]
20588
+ }
20589
+ }
20590
+ */
20591
+ if (!!this.customFormButtonItems) {
20592
+ this.buttonItems = this.customFormButtonItems;
20593
+ }
20594
+ this.subscriptions.push(this.mode$.subscribe((x) => (this.isUpdateMode = x === EnumCorePageEditMode.UPDATE)));
20595
+ console.log(this.mode$);
20596
+ /* START: Check if id field is available */
20597
+ if (!!!this.form.get('id') && isDevMode()) {
20598
+ this.alertService.error(`
20599
+ Control "id" is mandatory. Please define one in your bussiness component. You can assign its "hidden" property to true if needed.
20600
+ `, noneAutoClosedAlertOptions);
20601
+ }
20602
+ /* END: Check if id field is available */
20603
+ if (isDevMode()) {
20604
+ /* START: Check if each field is unique */
20605
+ const fields = this.coreFormService.getAllFormBaseControlNames(this.sections);
20606
+ fields.reduce((p, c) => {
20607
+ if (c === '') {
20608
+ this.alertService.error(`Form control name must be definded, '${c}' is invalid form control name!!!`, noneAutoClosedAlertOptions);
20581
20609
  }
20582
- this.onInitialValueStringReady.emit(JSON.stringify(e));
20583
- /*
20584
- Transfer newly created record id
20585
- */
20586
- this.toggleReloadFlagForTheCaller(body.innerBody.id);
20587
- this.router.navigateByUrl(this.urlService.previousRouteUrl$.value);
20588
- }
20589
- });
20610
+ else {
20611
+ if (p === c) {
20612
+ this.alertService.error(`Duplicate form control name: '${c}'. Consider to predefine one ONLY!!!.`, noneAutoClosedAlertOptions);
20613
+ }
20614
+ }
20615
+ return c;
20616
+ });
20617
+ /* END: Check if each field is unique */
20618
+ }
20619
+ this.subscriptions.push(this.multiLanguageService.lang$.subscribe((x) => (this.lang = x)));
20590
20620
  }
20591
- onCancel() {
20592
- if (!!this.autoCancelLogicOff) {
20593
- this.cancelLogic.emit(true);
20594
- return;
20621
+ ngAfterViewInit() {
20622
+ this.onFormRefCreated.emit(this.formRef);
20623
+ }
20624
+ onFormSubmit() {
20625
+ this.checkError$.next(true);
20626
+ if (!!this.form.valid) {
20627
+ this.payLoad = JSON.stringify(this.form?.getRawValue(), null, 2);
20628
+ this.onSubmit.emit(this.form?.getRawValue());
20595
20629
  }
20596
- if (!!this.urlService.previousRouteUrl$.value.length) {
20597
- this.router.navigateByUrl(this.urlService.previousRouteUrl$.value);
20630
+ }
20631
+ onFormSave() {
20632
+ this.checkError$.next(true);
20633
+ if (!!this.form.valid) {
20634
+ this.payLoad = JSON.stringify(this.form?.getRawValue(), null, 2);
20635
+ this.onSave.emit(this.form?.getRawValue());
20636
+ }
20637
+ setTimeout(() => this.checkError$.next(false), 3000);
20638
+ }
20639
+ onCancelLocal() {
20640
+ this.onCancal.emit(null);
20641
+ }
20642
+ updatePayload() {
20643
+ if (this.payLoad === '') {
20644
+ this.payLoad = JSON.stringify(this.form?.getRawValue(), null, 2);
20598
20645
  }
20599
20646
  else {
20600
- this.router.navigate(['../'], { relativeTo: this.route });
20647
+ this.payLoad = '';
20601
20648
  }
20602
20649
  }
20603
- buttonClick(e) {
20604
- this.onButtonClick.emit(e);
20650
+ updateValidorOverview() {
20651
+ if (this.validatorOverview === undefined) {
20652
+ const result = [];
20653
+ Object.keys(this.form.controls).forEach((key) => {
20654
+ const control = this.form.get(key);
20655
+ const errors = [];
20656
+ if (!!control.invalid) {
20657
+ Object.keys(control.errors).forEach((key) => {
20658
+ errors.push(key);
20659
+ });
20660
+ }
20661
+ result.push({
20662
+ key,
20663
+ errors,
20664
+ });
20665
+ });
20666
+ this.validatorOverview = JSON.stringify(result, null, 2);
20667
+ }
20668
+ else {
20669
+ this.validatorOverview = undefined;
20670
+ }
20605
20671
  }
20606
- onFormCreatedLocal(e) {
20607
- this.form = e.formGroup;
20608
- this.form.patchValue(this.currentValue);
20609
- this.onFormCreated.emit(this.form);
20610
- // Now we can return initFormValueString to the caller
20611
- this.onInitialValueStringReady.emit(JSON.stringify(this.form.getRawValue()));
20672
+ ngOnDestroy() {
20673
+ this.subscriptions.map((x) => x?.unsubscribe());
20612
20674
  }
20613
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CorePageEditComponent, deps: [{ token: i1$2.Router }, { token: i1$2.ActivatedRoute }, { token: CorePageEditService }, { token: CommonHttpRequestService }, { token: AnimatedTextService }, { token: MultiLanguageService }, { token: CoreFormService }, { token: CorePageListService }, { token: HubConnectionService }, { token: AuthService }, { token: AlertService }, { token: UrlService }, { token: RoutingService }, { token: ResponseService }, { token: AppConfigService }], target: i0.ɵɵFactoryTarget.Component }); }
20614
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: CorePageEditComponent, isStandalone: true, selector: "core-page-edit", inputs: { stayAfterSubmit: "stayAfterSubmit", width: "width", entityTable: "entityTable", hasIdOfStringType: "hasIdOfStringType", captionCode: "captionCode", leftInputSections: "leftInputSections", leftInputSectionsFlexSize: "leftInputSectionsFlexSize", sections: "sections", normalMode: "normalMode", bottomTemplateRef: "bottomTemplateRef", autoGetByIdOff: "autoGetByIdOff", autoSubmitLogicOff: "autoSubmitLogicOff", autoCancelLogicOff: "autoCancelLogicOff", customFormButtonItems: "customFormButtonItems", mixedMode: "mixedMode", checkError$: "checkError$", showSaveButton: "showSaveButton", disableSaveButton: "disableSaveButton", disableCancelButton: "disableCancelButton", forceListRefreshOnCreateOrUpdate: "forceListRefreshOnCreateOrUpdate", crud: "crud", entityUniqueIndexs: "entityUniqueIndexs" }, outputs: { submitLogic: "submitLogic", onFormCreated: "onFormCreated", onSubmitSuccess: "onSubmitSuccess", onButtonClick: "onButtonClick", cancelLogic: "cancelLogic", onInitialValueStringReady: "onInitialValueStringReady" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true }, { propertyName: "containerBigger", first: true, predicate: ["containerBigger"], descendants: true }], ngImport: i0, template: "@if (!!normalMode) {\r\n<div #container class=\"core-page-edit-container\">\r\n <div [ngStyle]=\"{ margin: '0px 24px' }\">\r\n <core-page-header [title]=\"captionCode\" [hideButtonGroup]=\"true\"></core-page-header>\r\n </div>\r\n @if (!!sections.length) {\r\n <core-form [width]=\"width\" [formName]=\"'form'\" [submitText]=\"submitText\" [showCaptionButton]=\"showCaptionButton\"\r\n [leftInputSections]=\"leftInputSections\" [leftInputSectionsFlexSize]=\"leftInputSectionsFlexSize\"\r\n [inputSections]=\"sections\" [mode$]=\"mode$\" [bottomTemplateRef]=\"bottomTemplateRef\"\r\n [customFormButtonItems]=\"customFormButtonItems\" [disableSaveButton]=\"disableSaveButton\" [disableCancelButton]=\"disableCancelButton\"\r\n [checkError$]=\"checkError$\" (onFormCreated)=\"onFormCreatedLocal($event)\" (onSubmit)=\"onSubmit()\"\r\n (onSave)=\"onSave($event)\" (buttonClick)=\"buttonClick($event)\" (onCancal)=\"onCancel()\"></core-form>\r\n }\r\n</div>\r\n} @else {\r\n<div class=\"modal-container\" [ngStyle]=\"{\r\n overflowY: 'scroll'\r\n }\">\r\n <div #containerBigger class=\"modal-content\">\r\n <div class=\"custom-header-popup\">\r\n <i class=\"feather-x\" (click)=\"onCancel()\"></i>\r\n <div [ngStyle]=\"{ margin: '0px 24px' }\">\r\n <core-page-header [title]=\"captionCode\" [hideButtonGroup]=\"true\"></core-page-header>\r\n </div>\r\n </div>\r\n <div #container class=\"core-page-edit-container not-normal-mode\" [ngStyle]=\"{\r\n overflow: 'visible'\r\n }\">\r\n @if (!!sections.length) {\r\n <core-form [formName]=\"'form'\" [submitText]=\"submitText\" [showCaptionButton]=\"showCaptionButton\"\r\n [leftInputSections]=\"leftInputSections\" [leftInputSectionsFlexSize]=\"leftInputSectionsFlexSize\"\r\n [inputSections]=\"sections\" [mode$]=\"mode$\" [bottomTemplateRef]=\"bottomTemplateRef\" [customFormButtonItems]=\"customFormButtonItems\"\r\n [disableSaveButton]=\"disableSaveButton\" [disableCancelButton]=\"disableCancelButton\" [checkError$]=\"checkError$\"\r\n (onFormCreated)=\"onFormCreatedLocal($event)\" (onSubmit)=\"onSubmit()\" (onSave)=\"onSave($event)\"\r\n (buttonClick)=\"buttonClick($event)\" (onCancal)=\"onCancel()\"></core-form>\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n}\r\n@if (loading) {\r\n<app-fullscreen-modal-loader></app-fullscreen-modal-loader>\r\n}", styles: ["@charset \"UTF-8\";.core-page-edit-container{--width: 50vw;background-color:#fff;padding:0,var(--size-layout-block-cell-spacing),var(--size-layout-block-cell-spacing),var(--size-layout-block-cell-spacing);width:var(--width)}@media (max-width: 992px){.core-page-edit-container{width:100%}}.core-page-edit-container>.custom-header-popup{display:flex}.core-page-edit-container>i{display:block;float:right;font-size:24px;cursor:pointer;margin:10px}.core-page-edit-container>caption{display:block;width:100%;color:#464646;font-weight:400}.modal-content{--height: 100%;height:var(--height);border-radius:10px}.modal-content i{display:block;float:right;font-size:24px;cursor:pointer;margin:10px}.modal-content caption{display:block;width:100%;color:#000}.custom-header-popup{background:#fff}.captionText{margin-left:24px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "component", type: CoreFormComponent, selector: "core-form", inputs: ["formName", "width", "submitText", "leftInputSections", "leftInputSectionsFlexSize", "inputSections", "mode$", "bottomTemplateRef", "customFormButtonItems", "showCaptionButton", "disableSaveButton", "disableCancelButton", "checkError$"], outputs: ["onFormCreated", "onFormRefCreated", "onSubmit", "onSave", "onCancal", "buttonClick"] }, { kind: "component", type: FullscreenModalLoaderComponent, selector: "app-fullscreen-modal-loader", inputs: ["content"] }, { kind: "component", type: CorePageHeaderComponent, selector: "core-page-header", inputs: ["instanceNumber", "shownItems", "title", "hideButtonGroup"], outputs: ["buttonClick"] }] }); }
20675
+ onButtonClick(e) {
20676
+ switch (e.code) {
20677
+ case EnumCoreButtonVNSCode.NONE_HEADER_CANCEL:
20678
+ case EnumCoreButtonVNSCode.CANCEL:
20679
+ this.onCancelLocal();
20680
+ break;
20681
+ case EnumCoreButtonVNSCode.NONE_HEADER_SAVE:
20682
+ case EnumCoreButtonVNSCode.SEND:
20683
+ case EnumCoreButtonVNSCode.NONE_HEADER_DELETE:
20684
+ case EnumCoreButtonVNSCode.NONE_HEADER_LIQUIDATE_CONTRACT:
20685
+ case EnumCoreButtonVNSCode.ONFORMDELETE:
20686
+ case EnumCoreButtonVNSCode.SAVE_PASSWORD:
20687
+ this.onFormSubmit();
20688
+ break;
20689
+ case EnumCoreButtonVNSCode.SAVE:
20690
+ this.onFormSave();
20691
+ break;
20692
+ default:
20693
+ break;
20694
+ }
20695
+ this.buttonClick.emit(e);
20696
+ }
20697
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreFormComponent, deps: [{ token: CoreControlService }, { token: MultiLanguageService }, { token: AlertService }, { token: CoreFormService }, { token: AppConfigService }], target: i0.ɵɵFactoryTarget.Component }); }
20698
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: CoreFormComponent, isStandalone: true, selector: "core-form", inputs: { formName: "formName", width: "width", submitText: "submitText", leftInputSections: "leftInputSections", leftInputSectionsFlexSize: "leftInputSectionsFlexSize", inputSections: "inputSections", mode$: "mode$", bottomTemplateRef: "bottomTemplateRef", customFormButtonItems: "customFormButtonItems", showCaptionButton: "showCaptionButton", disableSaveButton: "disableSaveButton", disableCancelButton: "disableCancelButton", checkError$: "checkError$" }, outputs: { onFormCreated: "onFormCreated", onFormRefCreated: "onFormRefCreated", onSubmit: "onSubmit", onSave: "onSave", onCancal: "onCancal", buttonClick: "buttonClick" }, viewQueries: [{ propertyName: "formRef", first: true, predicate: ["formRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "@if (!!form) {\r\n<div class=\"core-form-container\" [ngStyle]=\"{\r\n width: !!width ? width + 'px' : 'auto'\r\n}\">\r\n\r\n <form #formRef (ngSubmit)=\"onFormSubmit()\" [formGroup]=\"form\" autocomplete=\"off\">\r\n\r\n <div class=\"row\">\r\n\r\n @if (!!leftInputSections) {\r\n <div [class]=\"'col-md-' + (leftInputSectionsFlexSize || 0)\">\r\n\r\n @for (section of leftInputSections; track $index) {\r\n <div class=\"section\"\r\n [class.d-none]=\"(!!isUpdateMode && section.addModeOnly) || (!!!isUpdateMode && section.updateModeOnly) || !!section.hidden\">\r\n\r\n @if (!!section.caption) {\r\n <div class=\"section-header-label\">\r\n <div class=\"section-img-wrapper\">\r\n <div class=\"section-img\"></div>\r\n </div>\r\n <div class=\"section-caption\">{{ section.caption | translate: lang }}</div>\r\n </div>\r\n }\r\n\r\n @for (row of section.rows; track $index) {\r\n <div class=\"row mb15\">\r\n @for (col of row; track $index) {\r\n <div [class]=\"'col-md-' + col.flexSize\" [class.grid-buffer]=\"col.controlType==='GRIDBUFFER'\"\r\n [class.button-control]=\"col.controlType==='BUTTON'\">\r\n <core-control [control]=\"col\" [form]=\"form\" [checkError$]=\"checkError$\"></core-control>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n </div>\r\n\r\n }\r\n\r\n </div>\r\n }\r\n\r\n <div [class]=\"'col-md-' + (12 - (leftInputSectionsFlexSize || 0))\">\r\n\r\n @for (section of sections; track $index) {\r\n <div class=\"section\"\r\n [class.d-none]=\"(!!isUpdateMode && section.addModeOnly) || (!!!isUpdateMode && section.updateModeOnly) || !!section.hidden\" [ngStyle]=\"{\r\n maxWidth: !!section.maxWidth ? section.maxWidth + 'px' : 'none'\r\n }\">\r\n\r\n @if (!!section.caption) {\r\n <div class=\"section-header-label\">\r\n <div class=\"section-img-wrapper\">\r\n <div class=\"section-img\"></div>\r\n </div>\r\n <div class=\"section-caption\">{{ section.caption | translate: lang }}</div>\r\n </div>\r\n }\r\n\r\n @for (row of section.rows; track $index) {\r\n <div class=\"row mb15\">\r\n @for (col of row; track $index) {\r\n <div [class]=\"'col-md-' + col.flexSize\" [class.grid-buffer]=\"col.controlType==='GRIDBUFFER'\"\r\n [class.button-control]=\"col.controlType==='BUTTON'\">\r\n <core-control [control]=\"col\" [form]=\"form\" [checkError$]=\"checkError$\"></core-control>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n </div>\r\n }\r\n\r\n </div>\r\n\r\n @if (!!bottomTemplateRef) {\r\n <div class=\"col-md-12\">\r\n <div class=\"bottom-template-wrapper\">\r\n <ng-container *ngTemplateOutlet=\"bottomTemplateRef\"></ng-container>\r\n </div>\r\n </div>\r\n }\r\n\r\n </div>\r\n\r\n <div class=\"h10\"></div>\r\n\r\n <div class=\"form-row\">\r\n <div class=\"d-flex d-flex-end w-100 pr18\">\r\n <core-button-group-vns [showCaption]=\"showCaptionButton\" [forHeader]=\"false\"\r\n (buttonClick)=\"onButtonClick($event)\" [shownItems]=\"buttonItems\"\r\n class=\"buttonGroupCustom\"></core-button-group-vns>\r\n </div>\r\n </div>\r\n @if (isDevMode) {\r\n <div class=\"form-row d-flex d-flex-center\">\r\n <div class=\"dev-button\" (click)=\"updatePayload()\">Show\r\n values</div>\r\n <div class=\"dev-button\" (click)=\"updateValidorOverview()\">Show\r\n validators</div>\r\n </div>\r\n }\r\n\r\n </form>\r\n\r\n @if (!!payLoad && isDevMode) {\r\n <div class=\"form-row payload-preview\">\r\n <strong>Current values</strong><br>{{payLoad}}\r\n </div>\r\n }\r\n\r\n @if (!!validatorOverview && isDevMode) {\r\n <div class=\"form-row payload-preview validator-preview\">\r\n <strong>Current errors</strong><br>{{validatorOverview}}\r\n </div>\r\n }\r\n\r\n</div>\r\n}", styles: [".core-form-container{overflow-x:visible}.core-form-container>form .section{margin-top:var(--size-layout-block-cell-spacing)}.core-form-container>form .section:not(:first-child){margin-top:calc(var(--size-layout-block-cell-spacing) * 2)}.core-form-container>form .section .section-header-label{display:block;height:34px;line-height:34px;margin-bottom:15px;margin-left:12px}.core-form-container>form .section .section-header-label .section-img-wrapper{position:relative}.core-form-container>form .section .section-header-label .section-img-wrapper .section-img{position:absolute;width:34px;height:34px;border-radius:50%;background-color:#d3d3d3;float:left;background-image:url(/assets/images/info.svg);background-repeat:no-repeat;background-position:center}.core-form-container>form .section .section-header-label .section-caption{padding-left:40px;font-weight:700;color:#696969}.core-form-container .row{margin-left:var(--size-layout-block-cell-spacing) 0px;margin-right:var(--size-layout-block-cell-spacing) 0px}.core-form-container .row .grid-buffer{border:dotted 2px darkgray}.core-form-container .row .button-control{display:flex;align-items:flex-end}.core-form-container .form-row{margin:var(--size-layout-block-cell-spacing) 0px;display:flex;align-items:center;justify-content:center}.core-form-container .form-row>button{cursor:pointer;border-radius:0}.core-form-container .form-row>button:not(:first-child){margin-left:var(--size-layout-block-cell-spacing)}.core-form-container .dev-button{cursor:pointer;display:flex;align-items:center;border:1px gray solid;font-size:13px;padding:8px}.core-form-container .payload-preview{display:block;width:calc(100% - 48px);height:200px;white-space:pre-wrap;overflow-x:hidden;overflow-y:auto;color:gray!important;background-color:#dff6dd;padding:24px;margin:24px}.core-form-container .payload-preview.validator-preview{background-color:#fff4ce}.core-form-container .bottom-template-wrapper{padding-left:12px;padding-right:12px}.core-form-container .w-100{width:100%}.core-form-container .pr18{padding-right:18px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: CoreControlComponent, selector: "core-control", inputs: ["control", "form", "checkError$", "rangeLimit"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "component", type: CoreButtonGroupVnsComponent, selector: "core-button-group-vns", inputs: ["height", "instanceNumber", "forHeader", "fixedShow", "shownItems", "showCaption", "lastChildEffectOff"], outputs: ["buttonClick"] }] }); }
20615
20699
  }
20616
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CorePageEditComponent, decorators: [{
20700
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreFormComponent, decorators: [{
20617
20701
  type: Component,
20618
- args: [{ selector: 'core-page-edit', imports: [
20702
+ args: [{ selector: 'core-form', imports: [
20619
20703
  CommonModule,
20620
20704
  FormsModule,
20621
20705
  ReactiveFormsModule,
20622
- CoreFormComponent,
20706
+ CoreControlComponent,
20623
20707
  TranslatePipe,
20624
- FullscreenModalLoaderComponent,
20625
- CorePageHeaderComponent
20626
- ], template: "@if (!!normalMode) {\r\n<div #container class=\"core-page-edit-container\">\r\n <div [ngStyle]=\"{ margin: '0px 24px' }\">\r\n <core-page-header [title]=\"captionCode\" [hideButtonGroup]=\"true\"></core-page-header>\r\n </div>\r\n @if (!!sections.length) {\r\n <core-form [width]=\"width\" [formName]=\"'form'\" [submitText]=\"submitText\" [showCaptionButton]=\"showCaptionButton\"\r\n [leftInputSections]=\"leftInputSections\" [leftInputSectionsFlexSize]=\"leftInputSectionsFlexSize\"\r\n [inputSections]=\"sections\" [mode$]=\"mode$\" [bottomTemplateRef]=\"bottomTemplateRef\"\r\n [customFormButtonItems]=\"customFormButtonItems\" [disableSaveButton]=\"disableSaveButton\" [disableCancelButton]=\"disableCancelButton\"\r\n [checkError$]=\"checkError$\" (onFormCreated)=\"onFormCreatedLocal($event)\" (onSubmit)=\"onSubmit()\"\r\n (onSave)=\"onSave($event)\" (buttonClick)=\"buttonClick($event)\" (onCancal)=\"onCancel()\"></core-form>\r\n }\r\n</div>\r\n} @else {\r\n<div class=\"modal-container\" [ngStyle]=\"{\r\n overflowY: 'scroll'\r\n }\">\r\n <div #containerBigger class=\"modal-content\">\r\n <div class=\"custom-header-popup\">\r\n <i class=\"feather-x\" (click)=\"onCancel()\"></i>\r\n <div [ngStyle]=\"{ margin: '0px 24px' }\">\r\n <core-page-header [title]=\"captionCode\" [hideButtonGroup]=\"true\"></core-page-header>\r\n </div>\r\n </div>\r\n <div #container class=\"core-page-edit-container not-normal-mode\" [ngStyle]=\"{\r\n overflow: 'visible'\r\n }\">\r\n @if (!!sections.length) {\r\n <core-form [formName]=\"'form'\" [submitText]=\"submitText\" [showCaptionButton]=\"showCaptionButton\"\r\n [leftInputSections]=\"leftInputSections\" [leftInputSectionsFlexSize]=\"leftInputSectionsFlexSize\"\r\n [inputSections]=\"sections\" [mode$]=\"mode$\" [bottomTemplateRef]=\"bottomTemplateRef\" [customFormButtonItems]=\"customFormButtonItems\"\r\n [disableSaveButton]=\"disableSaveButton\" [disableCancelButton]=\"disableCancelButton\" [checkError$]=\"checkError$\"\r\n (onFormCreated)=\"onFormCreatedLocal($event)\" (onSubmit)=\"onSubmit()\" (onSave)=\"onSave($event)\"\r\n (buttonClick)=\"buttonClick($event)\" (onCancal)=\"onCancel()\"></core-form>\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n}\r\n@if (loading) {\r\n<app-fullscreen-modal-loader></app-fullscreen-modal-loader>\r\n}", styles: ["@charset \"UTF-8\";.core-page-edit-container{--width: 50vw;background-color:#fff;padding:0,var(--size-layout-block-cell-spacing),var(--size-layout-block-cell-spacing),var(--size-layout-block-cell-spacing);width:var(--width)}@media (max-width: 992px){.core-page-edit-container{width:100%}}.core-page-edit-container>.custom-header-popup{display:flex}.core-page-edit-container>i{display:block;float:right;font-size:24px;cursor:pointer;margin:10px}.core-page-edit-container>caption{display:block;width:100%;color:#464646;font-weight:400}.modal-content{--height: 100%;height:var(--height);border-radius:10px}.modal-content i{display:block;float:right;font-size:24px;cursor:pointer;margin:10px}.modal-content caption{display:block;width:100%;color:#000}.custom-header-popup{background:#fff}.captionText{margin-left:24px}\n"] }]
20627
- }], ctorParameters: () => [{ type: i1$2.Router }, { type: i1$2.ActivatedRoute }, { type: CorePageEditService }, { type: CommonHttpRequestService }, { type: AnimatedTextService }, { type: MultiLanguageService }, { type: CoreFormService }, { type: CorePageListService }, { type: HubConnectionService }, { type: AuthService }, { type: AlertService }, { type: UrlService }, { type: RoutingService }, { type: ResponseService }, { type: AppConfigService }], propDecorators: { stayAfterSubmit: [{
20708
+ CoreButtonGroupVnsComponent
20709
+ ], template: "@if (!!form) {\r\n<div class=\"core-form-container\" [ngStyle]=\"{\r\n width: !!width ? width + 'px' : 'auto'\r\n}\">\r\n\r\n <form #formRef (ngSubmit)=\"onFormSubmit()\" [formGroup]=\"form\" autocomplete=\"off\">\r\n\r\n <div class=\"row\">\r\n\r\n @if (!!leftInputSections) {\r\n <div [class]=\"'col-md-' + (leftInputSectionsFlexSize || 0)\">\r\n\r\n @for (section of leftInputSections; track $index) {\r\n <div class=\"section\"\r\n [class.d-none]=\"(!!isUpdateMode && section.addModeOnly) || (!!!isUpdateMode && section.updateModeOnly) || !!section.hidden\">\r\n\r\n @if (!!section.caption) {\r\n <div class=\"section-header-label\">\r\n <div class=\"section-img-wrapper\">\r\n <div class=\"section-img\"></div>\r\n </div>\r\n <div class=\"section-caption\">{{ section.caption | translate: lang }}</div>\r\n </div>\r\n }\r\n\r\n @for (row of section.rows; track $index) {\r\n <div class=\"row mb15\">\r\n @for (col of row; track $index) {\r\n <div [class]=\"'col-md-' + col.flexSize\" [class.grid-buffer]=\"col.controlType==='GRIDBUFFER'\"\r\n [class.button-control]=\"col.controlType==='BUTTON'\">\r\n <core-control [control]=\"col\" [form]=\"form\" [checkError$]=\"checkError$\"></core-control>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n </div>\r\n\r\n }\r\n\r\n </div>\r\n }\r\n\r\n <div [class]=\"'col-md-' + (12 - (leftInputSectionsFlexSize || 0))\">\r\n\r\n @for (section of sections; track $index) {\r\n <div class=\"section\"\r\n [class.d-none]=\"(!!isUpdateMode && section.addModeOnly) || (!!!isUpdateMode && section.updateModeOnly) || !!section.hidden\" [ngStyle]=\"{\r\n maxWidth: !!section.maxWidth ? section.maxWidth + 'px' : 'none'\r\n }\">\r\n\r\n @if (!!section.caption) {\r\n <div class=\"section-header-label\">\r\n <div class=\"section-img-wrapper\">\r\n <div class=\"section-img\"></div>\r\n </div>\r\n <div class=\"section-caption\">{{ section.caption | translate: lang }}</div>\r\n </div>\r\n }\r\n\r\n @for (row of section.rows; track $index) {\r\n <div class=\"row mb15\">\r\n @for (col of row; track $index) {\r\n <div [class]=\"'col-md-' + col.flexSize\" [class.grid-buffer]=\"col.controlType==='GRIDBUFFER'\"\r\n [class.button-control]=\"col.controlType==='BUTTON'\">\r\n <core-control [control]=\"col\" [form]=\"form\" [checkError$]=\"checkError$\"></core-control>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n </div>\r\n }\r\n\r\n </div>\r\n\r\n @if (!!bottomTemplateRef) {\r\n <div class=\"col-md-12\">\r\n <div class=\"bottom-template-wrapper\">\r\n <ng-container *ngTemplateOutlet=\"bottomTemplateRef\"></ng-container>\r\n </div>\r\n </div>\r\n }\r\n\r\n </div>\r\n\r\n <div class=\"h10\"></div>\r\n\r\n <div class=\"form-row\">\r\n <div class=\"d-flex d-flex-end w-100 pr18\">\r\n <core-button-group-vns [showCaption]=\"showCaptionButton\" [forHeader]=\"false\"\r\n (buttonClick)=\"onButtonClick($event)\" [shownItems]=\"buttonItems\"\r\n class=\"buttonGroupCustom\"></core-button-group-vns>\r\n </div>\r\n </div>\r\n @if (isDevMode) {\r\n <div class=\"form-row d-flex d-flex-center\">\r\n <div class=\"dev-button\" (click)=\"updatePayload()\">Show\r\n values</div>\r\n <div class=\"dev-button\" (click)=\"updateValidorOverview()\">Show\r\n validators</div>\r\n </div>\r\n }\r\n\r\n </form>\r\n\r\n @if (!!payLoad && isDevMode) {\r\n <div class=\"form-row payload-preview\">\r\n <strong>Current values</strong><br>{{payLoad}}\r\n </div>\r\n }\r\n\r\n @if (!!validatorOverview && isDevMode) {\r\n <div class=\"form-row payload-preview validator-preview\">\r\n <strong>Current errors</strong><br>{{validatorOverview}}\r\n </div>\r\n }\r\n\r\n</div>\r\n}", styles: [".core-form-container{overflow-x:visible}.core-form-container>form .section{margin-top:var(--size-layout-block-cell-spacing)}.core-form-container>form .section:not(:first-child){margin-top:calc(var(--size-layout-block-cell-spacing) * 2)}.core-form-container>form .section .section-header-label{display:block;height:34px;line-height:34px;margin-bottom:15px;margin-left:12px}.core-form-container>form .section .section-header-label .section-img-wrapper{position:relative}.core-form-container>form .section .section-header-label .section-img-wrapper .section-img{position:absolute;width:34px;height:34px;border-radius:50%;background-color:#d3d3d3;float:left;background-image:url(/assets/images/info.svg);background-repeat:no-repeat;background-position:center}.core-form-container>form .section .section-header-label .section-caption{padding-left:40px;font-weight:700;color:#696969}.core-form-container .row{margin-left:var(--size-layout-block-cell-spacing) 0px;margin-right:var(--size-layout-block-cell-spacing) 0px}.core-form-container .row .grid-buffer{border:dotted 2px darkgray}.core-form-container .row .button-control{display:flex;align-items:flex-end}.core-form-container .form-row{margin:var(--size-layout-block-cell-spacing) 0px;display:flex;align-items:center;justify-content:center}.core-form-container .form-row>button{cursor:pointer;border-radius:0}.core-form-container .form-row>button:not(:first-child){margin-left:var(--size-layout-block-cell-spacing)}.core-form-container .dev-button{cursor:pointer;display:flex;align-items:center;border:1px gray solid;font-size:13px;padding:8px}.core-form-container .payload-preview{display:block;width:calc(100% - 48px);height:200px;white-space:pre-wrap;overflow-x:hidden;overflow-y:auto;color:gray!important;background-color:#dff6dd;padding:24px;margin:24px}.core-form-container .payload-preview.validator-preview{background-color:#fff4ce}.core-form-container .bottom-template-wrapper{padding-left:12px;padding-right:12px}.core-form-container .w-100{width:100%}.core-form-container .pr18{padding-right:18px}\n"] }]
20710
+ }], ctorParameters: () => [{ type: CoreControlService }, { type: MultiLanguageService }, { type: AlertService }, { type: CoreFormService }, { type: AppConfigService }], propDecorators: { formName: [{
20628
20711
  type: Input
20629
20712
  }], width: [{
20630
20713
  type: Input
20631
- }], entityTable: [{
20632
- type: Input
20633
- }], hasIdOfStringType: [{
20634
- type: Input
20635
- }], captionCode: [{
20714
+ }], submitText: [{
20636
20715
  type: Input
20637
20716
  }], leftInputSections: [{
20638
20717
  type: Input
20639
20718
  }], leftInputSectionsFlexSize: [{
20640
20719
  type: Input
20641
- }], sections: [{
20720
+ }], inputSections: [{
20642
20721
  type: Input
20643
- }], normalMode: [{
20722
+ }], mode$: [{
20644
20723
  type: Input
20645
20724
  }], bottomTemplateRef: [{
20646
20725
  type: Input
20647
- }], autoGetByIdOff: [{
20648
- type: Input
20649
- }], autoSubmitLogicOff: [{
20650
- type: Input
20651
- }], autoCancelLogicOff: [{
20652
- type: Input
20653
20726
  }], customFormButtonItems: [{
20654
20727
  type: Input
20655
- }], mixedMode: [{
20656
- type: Input
20657
- }], checkError$: [{
20658
- type: Input
20659
- }], showSaveButton: [{
20728
+ }], showCaptionButton: [{
20660
20729
  type: Input
20661
20730
  }], disableSaveButton: [{
20662
20731
  type: Input
20663
20732
  }], disableCancelButton: [{
20664
20733
  type: Input
20665
- }], forceListRefreshOnCreateOrUpdate: [{
20734
+ }], checkError$: [{
20666
20735
  type: Input
20667
- }], submitLogic: [{
20668
- type: Output
20669
20736
  }], onFormCreated: [{
20670
20737
  type: Output
20671
- }], onSubmitSuccess: [{
20738
+ }], onFormRefCreated: [{
20739
+ type: Output
20740
+ }], onSubmit: [{
20741
+ type: Output
20742
+ }], onSave: [{
20743
+ type: Output
20744
+ }], onCancal: [{
20745
+ type: Output
20746
+ }], buttonClick: [{
20747
+ type: Output
20748
+ }], formRef: [{
20749
+ type: ViewChild,
20750
+ args: ['formRef']
20751
+ }] } });
20752
+
20753
+ class CorePageEditComponent {
20754
+ constructor(router, route, corePageEditService, commonHttpRequestService, animatedTextService, mls, coreFormService, corePageListService, hubConnectionService, authService, alertService, urlService, routingService, responseService, appConfigService) {
20755
+ this.router = router;
20756
+ this.route = route;
20757
+ this.corePageEditService = corePageEditService;
20758
+ this.commonHttpRequestService = commonHttpRequestService;
20759
+ this.animatedTextService = animatedTextService;
20760
+ this.mls = mls;
20761
+ this.coreFormService = coreFormService;
20762
+ this.corePageListService = corePageListService;
20763
+ this.hubConnectionService = hubConnectionService;
20764
+ this.authService = authService;
20765
+ this.alertService = alertService;
20766
+ this.urlService = urlService;
20767
+ this.routingService = routingService;
20768
+ this.responseService = responseService;
20769
+ this.appConfigService = appConfigService;
20770
+ this.checkError$ = new BehaviorSubject(false);
20771
+ this.submitLogic = new EventEmitter();
20772
+ this.onFormCreated = new EventEmitter();
20773
+ this.onSubmitSuccess = new EventEmitter();
20774
+ this.onButtonClick = new EventEmitter();
20775
+ this.cancelLogic = new EventEmitter();
20776
+ this.entityUniqueIndexs = []; /* For ex: [['id'], ['provinceId', 'districCode']] etc... */
20777
+ this.onInitialValueStringReady = new EventEmitter();
20778
+ this.mode$ = new BehaviorSubject(EnumCorePageEditMode.CREATE);
20779
+ this.subscriptions = [];
20780
+ this.showCaptionButton = true;
20781
+ this.fromUrl = this.corePageEditService.fromUrl;
20782
+ this.listInstance = Number(this.route.snapshot.paramMap.get('listInstance'));
20783
+ }
20784
+ sendSignal(data) {
20785
+ const connection = this.hubConnectionService.hubConnection$.value;
20786
+ if (!!connection) {
20787
+ const message = {
20788
+ sid: this.authService.data$.value?.id,
20789
+ username: this.authService.data$.value?.fullName,
20790
+ avatar: this.authService.data$.value?.avatar,
20791
+ signalType: EnumSignalRType.ENTITY_CHANGED,
20792
+ message: `${this.authService.data$.value
20793
+ ?.userName} has changed entity ${this.entityTable}`,
20794
+ loginTime: this.authService.data$.value?.loginTime,
20795
+ data: null,
20796
+ };
20797
+ connection.invoke('SendMessage', message);
20798
+ }
20799
+ }
20800
+ ngOnInit() {
20801
+ this.sections$ = new BehaviorSubject(this.sections);
20802
+ if (!!!this.entityTable) {
20803
+ alert('Property entityTable (name) is required for component ' +
20804
+ this.captionCode);
20805
+ console.error('Property entityTable (name) is required for component ' +
20806
+ this.captionCode);
20807
+ }
20808
+ }
20809
+ ngAfterViewInit() {
20810
+ if (!!this.normalMode) {
20811
+ console.log(this.container);
20812
+ this.container.nativeElement.style.setProperty('--width', '100%');
20813
+ }
20814
+ else {
20815
+ if (!!this.width) {
20816
+ this.container.nativeElement.style.setProperty('--width', this.width + 'px');
20817
+ }
20818
+ this.containerBigger.nativeElement.style.setProperty('--height', '95%');
20819
+ }
20820
+ setTimeout(() => {
20821
+ this.scroll = this.container.nativeElement.scrollHeight > this.container.nativeElement.offsetHeight;
20822
+ });
20823
+ setTimeout(() => {
20824
+ if (!!!this.mixedMode) {
20825
+ this.subscriptions.push(this.route.params.subscribe(x => {
20826
+ console.log("this.route.params.subscribe", x);
20827
+ let id = '0';
20828
+ if (this.hasIdOfStringType) {
20829
+ try {
20830
+ id = atob(x['id']);
20831
+ }
20832
+ catch {
20833
+ return;
20834
+ }
20835
+ }
20836
+ else {
20837
+ try {
20838
+ id = Number(atob(x['id'])).toString();
20839
+ }
20840
+ catch {
20841
+ return;
20842
+ }
20843
+ }
20844
+ if (id !== '0') {
20845
+ this.mode$.next(EnumCorePageEditMode.UPDATE);
20846
+ this.submitText = EnumTranslateKey.UI_EDIT_FORM_BUTTON_SAVE;
20847
+ if (!!!this.autoGetByIdOff) {
20848
+ this.loading = true;
20849
+ this.subscriptions.push(this.corePageEditService.getById(id, this.crud.r).subscribe((x) => {
20850
+ this.loading = false;
20851
+ const body = x.body;
20852
+ //this.responseService.resolve(body);
20853
+ if ((body.statusCode = 200)) {
20854
+ /* #region Exclude sections with flag addModeOnly=true */
20855
+ if (!!body.innerBody.id) {
20856
+ // remove relevant controls from form group
20857
+ const addModeOnlySections = this.sections.filter((x) => !!x.addModeOnly);
20858
+ addModeOnlySections.map((addModeOnlySection) => {
20859
+ addModeOnlySection.rows.map((addModeOnlyRow) => {
20860
+ addModeOnlyRow.map((addModeOnlyControl) => {
20861
+ this.form.removeControl(addModeOnlyControl.field);
20862
+ });
20863
+ });
20864
+ });
20865
+ // remove relevant controls from form sections
20866
+ const newSections = this.sections.filter((x) => !!!x.addModeOnly);
20867
+ this.sections = newSections;
20868
+ this.sections$.next(this.sections);
20869
+ }
20870
+ /* #endregion Exclude sections with flag addModeOnly=true */
20871
+ /* #region: Assign value to attachment fields when controlType = ATTACHMENT */
20872
+ this.sections.map((section) => {
20873
+ section.rows.map((row) => {
20874
+ row.map((control) => {
20875
+ if (control.controlType === EnumFormBaseContolType.ATTACHMENT) {
20876
+ control.valueToShow = body.innerBody[control.assignTo];
20877
+ }
20878
+ });
20879
+ });
20880
+ });
20881
+ /* #endregion: Assign value to basic fields when controlType = ATTACHMENT */
20882
+ /* #region: Using PatchValue instead of setValue */
20883
+ // Forms often have extra helper fields
20884
+ // thus, if we use setValue method, the helper fields will be lost:
20885
+ // this.form.setValue(body.innerBody)
20886
+ // so, we use patchValue method :
20887
+ this.currentValue = body.innerBody;
20888
+ this.form.patchValue(this.currentValue);
20889
+ this.sections.map((section) => {
20890
+ section.rows.map((row) => {
20891
+ row.map((control) => {
20892
+ if ([
20893
+ EnumFormBaseContolType.SEEKER,
20894
+ EnumFormBaseContolType.DROPDOWN,
20895
+ EnumFormBaseContolType.CHECKLIST,
20896
+ ].includes(control.controlType)) {
20897
+ if (!!this.currentValue[control.field]) {
20898
+ if (isDevMode() && !!!control.getByIdApi) {
20899
+ switch (control.controlType) {
20900
+ case EnumFormBaseContolType.SEEKER:
20901
+ if (!control.multiMode) {
20902
+ this.alertService.error(`getByIdApi not provided for '${control.field}'`, noneAutoClosedAlertOptions);
20903
+ }
20904
+ break;
20905
+ case EnumFormBaseContolType.DROPDOWN:
20906
+ if (!!!control.dropdownOptions$?.value) {
20907
+ this.alertService.error(`getByIdApi not provided for '${control.field}'`, noneAutoClosedAlertOptions);
20908
+ }
20909
+ break;
20910
+ case EnumFormBaseContolType.CHECKLIST:
20911
+ if (!!!control.checklistOptions$?.value) {
20912
+ this.alertService.error(`getByIdApi not provided for '${control.field}'`, noneAutoClosedAlertOptions);
20913
+ }
20914
+ break;
20915
+ default:
20916
+ this.alertService.error(`getByIdApi not provided for '${control.field}'`, noneAutoClosedAlertOptions);
20917
+ break;
20918
+ }
20919
+ }
20920
+ this.subscriptions.push(this.commonHttpRequestService
20921
+ .makeGetRequest('getById', control.getByIdApi +
20922
+ `?id=${this.currentValue[control.field]}`)
20923
+ .subscribe((x) => {
20924
+ console.log("form getById result: ", this.currentValue);
20925
+ if (x.ok && x.status === 200) {
20926
+ const body = x.body;
20927
+ if (body.statusCode === 200) {
20928
+ control.getByIdObject$?.next(body.innerBody);
20929
+ }
20930
+ else {
20931
+ control.getByIdObject$?.next(null);
20932
+ }
20933
+ }
20934
+ }));
20935
+ }
20936
+ }
20937
+ if (control.controlType === EnumFormBaseContolType.SEEKER && control.multiMode) {
20938
+ control.objectList$?.next(body.innerBody[control.getObjectListFrom]);
20939
+ }
20940
+ });
20941
+ });
20942
+ });
20943
+ this.sections$.next(this.sections);
20944
+ /* #endregion: Using PatchValue instead of setValue */
20945
+ }
20946
+ // return initFormValueString to the caller
20947
+ this.onInitialValueStringReady.emit(JSON.stringify(this.form.getRawValue()));
20948
+ }));
20949
+ }
20950
+ }
20951
+ else {
20952
+ this.mode$.next(EnumCorePageEditMode.CREATE);
20953
+ this.submitText = EnumTranslateKey.UI_EDIT_FORM_BUTTON_ADD;
20954
+ }
20955
+ }));
20956
+ }
20957
+ this.subscriptions.push(this.mls.lang$.subscribe(x => this.lang = x));
20958
+ });
20959
+ }
20960
+ toggleReloadFlagForTheCaller(id) {
20961
+ const instancesFilter = this.corePageListService.instances.filter((x) => x.instanceNumber === this.listInstance);
20962
+ if (!!instancesFilter.length) {
20963
+ const instance = instancesFilter[0];
20964
+ instance.id$.next(id);
20965
+ //if (!!!this.normalMode) instance.reloadFlag$?.next(!instance.reloadFlag$.value);
20966
+ if (isDevMode()) {
20967
+ this.alertService.info(`CorePageList instance number ${this.listInstance} current id is: ${instance.id$.value}`, alertOptions);
20968
+ }
20969
+ }
20970
+ else {
20971
+ if (isDevMode()) {
20972
+ this.alertService.info(`CorePageList instances do not include number ${this.listInstance}`, alertOptions);
20973
+ }
20974
+ }
20975
+ }
20976
+ onNotOk200Response(x) {
20977
+ if (isDevMode()) {
20978
+ if (Object.keys(x).length === 0) {
20979
+ this.alertService.error("No response content. It was possibly a CORS error.", noneAutoClosedAlertOptions);
20980
+ }
20981
+ else {
20982
+ //this.alertService.error(JSON.stringify(x, null, 2), noneAutoClosedAlertOptions)
20983
+ }
20984
+ }
20985
+ }
20986
+ onSubmit() {
20987
+ /* IF id is falsy => CREAT, otherwise UPDATE */
20988
+ /* FOR CONTROL OF TYPE GRIDBUFFER, SET EVERY id TO NULL */
20989
+ this.sections.map(section => {
20990
+ section.rows.map(row => {
20991
+ row.map(control => {
20992
+ console.log(control.controlType);
20993
+ if (control.controlType === EnumFormBaseContolType.GRIDBUFFER) {
20994
+ const abstractControl = this.form.get(control.field)?.value;
20995
+ // TO DO 17/08/2023 ===========
20996
+ abstractControl?.value?.map((x) => x.id = null);
20997
+ // =========================
20998
+ }
20999
+ });
21000
+ });
21001
+ });
21002
+ if (!!this.mixedMode) {
21003
+ this.submitLogic.emit({
21004
+ mode: this.form.get('editMode')?.value,
21005
+ formValue: this.form.getRawValue()
21006
+ });
21007
+ return;
21008
+ }
21009
+ if (!!this.autoSubmitLogicOff) {
21010
+ // DO your logic here
21011
+ this.submitLogic.emit(JSON.stringify(this.form.getRawValue()));
21012
+ return;
21013
+ }
21014
+ else if (!!!this.form.get('id').value) {
21015
+ this.loading = true;
21016
+ const sysMutationLogBeforeAfterRequest = {
21017
+ sysFunctionCode: this.routingService.currentFunction$.value?.code || 'UNDEFINED',
21018
+ sysActionCode: EnumCoreButtonVNSCode.HEADER_CREATE,
21019
+ before: JSON.stringify(this.currentValue) ?? '""',
21020
+ after: JSON.stringify(this.form.getRawValue()),
21021
+ username: this.authService.data$.value?.userName
21022
+ };
21023
+ this.animatedTextService.text$.next(this.mls.trans(EnumTranslateKey.UI_DIALOG_ADDING_PLEASE_WAIT));
21024
+ this.commonHttpRequestService
21025
+ .makePostRequest('create ' + this.entityTable, this.crud.c, {
21026
+ ...this.form.getRawValue(),
21027
+ sysMutationLogBeforeAfterRequest,
21028
+ })
21029
+ .subscribe((x) => {
21030
+ this.loading = false;
21031
+ if (x.ok && x.status === 200) {
21032
+ const body = x.body;
21033
+ //this.responseService.resolve(body);
21034
+ if (body.statusCode === 200) {
21035
+ if (isDevMode()) {
21036
+ this.sendSignal(body.innerBody);
21037
+ }
21038
+ this.onSubmitSuccess.emit(true);
21039
+ this.onInitialValueStringReady.emit(JSON.stringify(this.form.getRawValue()));
21040
+ /*
21041
+ Transfer newly created record id
21042
+ */
21043
+ this.toggleReloadFlagForTheCaller(body.innerBody.id || 0);
21044
+ if (this.forceListRefreshOnCreateOrUpdate) {
21045
+ this.corePageListService.instanceRequery(this.listInstance);
21046
+ }
21047
+ if (!this.stayAfterSubmit) {
21048
+ this.router.navigate(['../'], { /* experiment*/ replaceUrl: true, relativeTo: this.route, state: { id: body.innerBody.id || 0, instanceNumber: this.listInstance } });
21049
+ }
21050
+ }
21051
+ }
21052
+ else {
21053
+ this.onNotOk200Response(x);
21054
+ }
21055
+ });
21056
+ }
21057
+ else {
21058
+ this.loading = true;
21059
+ const sysMutationLogBeforeAfterRequest = {
21060
+ sysFunctionCode: this.routingService.currentFunction$.value?.code || 'UNDEFINED',
21061
+ sysActionCode: EnumCoreButtonVNSCode.HEADER_SAVE,
21062
+ before: JSON.stringify(this.currentValue) ?? '""',
21063
+ after: JSON.stringify(this.form.getRawValue()),
21064
+ username: this.authService.data$.value?.userName
21065
+ };
21066
+ const a1 = this.coreFormService.getAllFormBaseControlNames(this.leftInputSections?.filter(x => !x.hidden));
21067
+ const a2 = this.coreFormService.getAllFormBaseControlNames(this.sections?.filter(x => !x.hidden));
21068
+ const actualFormDeclaredFields = [...a1, ...a2];
21069
+ this.animatedTextService.text$.next(this.mls.trans(EnumTranslateKey.UI_DIALOG_UPDATING_PLEASE_WAIT));
21070
+ this.commonHttpRequestService
21071
+ .makePostRequest('update ' + this.entityTable, this.crud.u, {
21072
+ ...this.form.getRawValue(),
21073
+ sysMutationLogBeforeAfterRequest,
21074
+ actualFormDeclaredFields
21075
+ })
21076
+ .subscribe((x) => {
21077
+ this.loading = false;
21078
+ if (x.ok && x.status === 200) {
21079
+ const body = x.body;
21080
+ //this.responseService.resolve(body);
21081
+ if (body.statusCode === 200) {
21082
+ if (isDevMode()) {
21083
+ this.sendSignal(body.innerBody);
21084
+ }
21085
+ this.onSubmitSuccess.emit(true);
21086
+ this.onInitialValueStringReady.emit(JSON.stringify(this.form.getRawValue()));
21087
+ /*
21088
+ Transfer current record id
21089
+ */
21090
+ this.toggleReloadFlagForTheCaller(body.innerBody.id);
21091
+ if (this.forceListRefreshOnCreateOrUpdate) {
21092
+ this.corePageListService.instanceRequery(this.listInstance);
21093
+ }
21094
+ if (!this.stayAfterSubmit) {
21095
+ if (this.appConfigService.APP_TYPE === "MOBILE") {
21096
+ this.router.navigate(['../'], { /* experiment*/ replaceUrl: true, relativeTo: this.route, state: { id: body.innerBody.id, instanceNumber: this.listInstance } });
21097
+ }
21098
+ else if (this.appConfigService.APP_TYPE === "WEBAPP") {
21099
+ this.router.navigate(['../'], { relativeTo: this.route, state: { id: body.innerBody.id, instanceNumber: this.listInstance } });
21100
+ }
21101
+ }
21102
+ }
21103
+ }
21104
+ else {
21105
+ this.onNotOk200Response(x);
21106
+ }
21107
+ });
21108
+ }
21109
+ }
21110
+ /**
21111
+ *
21112
+ * PHƯƠNG THỨC NÀY ĐƯỢC TẠO RA KHI DEV VNS-PORTAL
21113
+ */
21114
+ onSave(e) {
21115
+ this.loading = true;
21116
+ this.animatedTextService.text$.next(this.mls.trans(EnumTranslateKey.UI_DIALOG_ADDING_PLEASE_WAIT));
21117
+ if (!!this.appConfigService.DEBUG_ENABLED) {
21118
+ alert(JSON.stringify(e, null, 2));
21119
+ }
21120
+ this.commonHttpRequestService
21121
+ .makePostRequest('create ' + this.entityTable, this.crud.s, e)
21122
+ .subscribe((x) => {
21123
+ this.loading = false;
21124
+ const body = x.body;
21125
+ this.responseService.resolve(body);
21126
+ if (x.ok && x.status === 200 && body.statusCode === 200) {
21127
+ if (isDevMode()) {
21128
+ this.sendSignal(body.innerBody);
21129
+ }
21130
+ this.onInitialValueStringReady.emit(JSON.stringify(e));
21131
+ /*
21132
+ Transfer newly created record id
21133
+ */
21134
+ this.toggleReloadFlagForTheCaller(body.innerBody.id);
21135
+ this.router.navigateByUrl(this.urlService.previousRouteUrl$.value);
21136
+ }
21137
+ });
21138
+ }
21139
+ onCancel() {
21140
+ if (!!this.autoCancelLogicOff) {
21141
+ this.cancelLogic.emit(true);
21142
+ return;
21143
+ }
21144
+ if (!!this.urlService.previousRouteUrl$.value.length) {
21145
+ this.router.navigateByUrl(this.urlService.previousRouteUrl$.value);
21146
+ }
21147
+ else {
21148
+ this.router.navigate(['../'], { relativeTo: this.route });
21149
+ }
21150
+ }
21151
+ buttonClick(e) {
21152
+ this.onButtonClick.emit(e);
21153
+ }
21154
+ onFormCreatedLocal(e) {
21155
+ this.form = e.formGroup;
21156
+ this.form.patchValue(this.currentValue);
21157
+ this.onFormCreated.emit(this.form);
21158
+ // Now we can return initFormValueString to the caller
21159
+ this.onInitialValueStringReady.emit(JSON.stringify(this.form.getRawValue()));
21160
+ }
21161
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CorePageEditComponent, deps: [{ token: i1$2.Router }, { token: i1$2.ActivatedRoute }, { token: CorePageEditService }, { token: CommonHttpRequestService }, { token: AnimatedTextService }, { token: MultiLanguageService }, { token: CoreFormService }, { token: CorePageListService }, { token: HubConnectionService }, { token: AuthService }, { token: AlertService }, { token: UrlService }, { token: RoutingService }, { token: ResponseService }, { token: AppConfigService }], target: i0.ɵɵFactoryTarget.Component }); }
21162
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: CorePageEditComponent, isStandalone: true, selector: "core-page-edit", inputs: { stayAfterSubmit: "stayAfterSubmit", width: "width", entityTable: "entityTable", hasIdOfStringType: "hasIdOfStringType", captionCode: "captionCode", leftInputSections: "leftInputSections", leftInputSectionsFlexSize: "leftInputSectionsFlexSize", sections: "sections", normalMode: "normalMode", bottomTemplateRef: "bottomTemplateRef", autoGetByIdOff: "autoGetByIdOff", autoSubmitLogicOff: "autoSubmitLogicOff", autoCancelLogicOff: "autoCancelLogicOff", customFormButtonItems: "customFormButtonItems", mixedMode: "mixedMode", checkError$: "checkError$", showSaveButton: "showSaveButton", disableSaveButton: "disableSaveButton", disableCancelButton: "disableCancelButton", forceListRefreshOnCreateOrUpdate: "forceListRefreshOnCreateOrUpdate", crud: "crud", entityUniqueIndexs: "entityUniqueIndexs" }, outputs: { submitLogic: "submitLogic", onFormCreated: "onFormCreated", onSubmitSuccess: "onSubmitSuccess", onButtonClick: "onButtonClick", cancelLogic: "cancelLogic", onInitialValueStringReady: "onInitialValueStringReady" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true }, { propertyName: "containerBigger", first: true, predicate: ["containerBigger"], descendants: true }], ngImport: i0, template: "@if (!!normalMode) {\r\n<div #container class=\"core-page-edit-container\">\r\n <div [ngStyle]=\"{ margin: '0px 24px' }\">\r\n <core-page-header [title]=\"captionCode\" [hideButtonGroup]=\"true\"></core-page-header>\r\n </div>\r\n @if (!!sections.length) {\r\n <core-form [width]=\"width\" [formName]=\"'form'\" [submitText]=\"submitText\" [showCaptionButton]=\"showCaptionButton\"\r\n [leftInputSections]=\"leftInputSections\" [leftInputSectionsFlexSize]=\"leftInputSectionsFlexSize\"\r\n [inputSections]=\"sections\" [mode$]=\"mode$\" [bottomTemplateRef]=\"bottomTemplateRef\"\r\n [customFormButtonItems]=\"customFormButtonItems\" [disableSaveButton]=\"disableSaveButton\" [disableCancelButton]=\"disableCancelButton\"\r\n [checkError$]=\"checkError$\" (onFormCreated)=\"onFormCreatedLocal($event)\" (onSubmit)=\"onSubmit()\"\r\n (onSave)=\"onSave($event)\" (buttonClick)=\"buttonClick($event)\" (onCancal)=\"onCancel()\"></core-form>\r\n }\r\n</div>\r\n} @else {\r\n<div class=\"modal-container\" [ngStyle]=\"{\r\n overflowY: 'scroll'\r\n }\">\r\n <div #containerBigger class=\"modal-content\">\r\n <div class=\"custom-header-popup\">\r\n <i class=\"feather-x\" (click)=\"onCancel()\"></i>\r\n <div [ngStyle]=\"{ margin: '0px 24px' }\">\r\n <core-page-header [title]=\"captionCode\" [hideButtonGroup]=\"true\"></core-page-header>\r\n </div>\r\n </div>\r\n <div #container class=\"core-page-edit-container not-normal-mode\" [ngStyle]=\"{\r\n overflow: 'visible'\r\n }\">\r\n @if (!!sections.length) {\r\n <core-form [formName]=\"'form'\" [submitText]=\"submitText\" [showCaptionButton]=\"showCaptionButton\"\r\n [leftInputSections]=\"leftInputSections\" [leftInputSectionsFlexSize]=\"leftInputSectionsFlexSize\"\r\n [inputSections]=\"sections\" [mode$]=\"mode$\" [bottomTemplateRef]=\"bottomTemplateRef\" [customFormButtonItems]=\"customFormButtonItems\"\r\n [disableSaveButton]=\"disableSaveButton\" [disableCancelButton]=\"disableCancelButton\" [checkError$]=\"checkError$\"\r\n (onFormCreated)=\"onFormCreatedLocal($event)\" (onSubmit)=\"onSubmit()\" (onSave)=\"onSave($event)\"\r\n (buttonClick)=\"buttonClick($event)\" (onCancal)=\"onCancel()\"></core-form>\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n}\r\n@if (loading) {\r\n<app-fullscreen-modal-loader></app-fullscreen-modal-loader>\r\n}", styles: ["@charset \"UTF-8\";.core-page-edit-container{--width: 50vw;background-color:#fff;padding:0,var(--size-layout-block-cell-spacing),var(--size-layout-block-cell-spacing),var(--size-layout-block-cell-spacing);width:var(--width)}@media (max-width: 992px){.core-page-edit-container{width:100%}}.core-page-edit-container>.custom-header-popup{display:flex}.core-page-edit-container>i{display:block;float:right;font-size:24px;cursor:pointer;margin:10px}.core-page-edit-container>caption{display:block;width:100%;color:#464646;font-weight:400}.modal-content{--height: 100%;height:var(--height);border-radius:10px}.modal-content i{display:block;float:right;font-size:24px;cursor:pointer;margin:10px}.modal-content caption{display:block;width:100%;color:#000}.custom-header-popup{background:#fff}.captionText{margin-left:24px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "component", type: CoreFormComponent, selector: "core-form", inputs: ["formName", "width", "submitText", "leftInputSections", "leftInputSectionsFlexSize", "inputSections", "mode$", "bottomTemplateRef", "customFormButtonItems", "showCaptionButton", "disableSaveButton", "disableCancelButton", "checkError$"], outputs: ["onFormCreated", "onFormRefCreated", "onSubmit", "onSave", "onCancal", "buttonClick"] }, { kind: "component", type: FullscreenModalLoaderComponent, selector: "app-fullscreen-modal-loader", inputs: ["content"] }, { kind: "component", type: CorePageHeaderComponent, selector: "core-page-header", inputs: ["instanceNumber", "shownItems", "title", "hideButtonGroup"], outputs: ["buttonClick"] }] }); }
21163
+ }
21164
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CorePageEditComponent, decorators: [{
21165
+ type: Component,
21166
+ args: [{ selector: 'core-page-edit', imports: [
21167
+ CommonModule,
21168
+ FormsModule,
21169
+ ReactiveFormsModule,
21170
+ CoreFormComponent,
21171
+ TranslatePipe,
21172
+ FullscreenModalLoaderComponent,
21173
+ CorePageHeaderComponent
21174
+ ], template: "@if (!!normalMode) {\r\n<div #container class=\"core-page-edit-container\">\r\n <div [ngStyle]=\"{ margin: '0px 24px' }\">\r\n <core-page-header [title]=\"captionCode\" [hideButtonGroup]=\"true\"></core-page-header>\r\n </div>\r\n @if (!!sections.length) {\r\n <core-form [width]=\"width\" [formName]=\"'form'\" [submitText]=\"submitText\" [showCaptionButton]=\"showCaptionButton\"\r\n [leftInputSections]=\"leftInputSections\" [leftInputSectionsFlexSize]=\"leftInputSectionsFlexSize\"\r\n [inputSections]=\"sections\" [mode$]=\"mode$\" [bottomTemplateRef]=\"bottomTemplateRef\"\r\n [customFormButtonItems]=\"customFormButtonItems\" [disableSaveButton]=\"disableSaveButton\" [disableCancelButton]=\"disableCancelButton\"\r\n [checkError$]=\"checkError$\" (onFormCreated)=\"onFormCreatedLocal($event)\" (onSubmit)=\"onSubmit()\"\r\n (onSave)=\"onSave($event)\" (buttonClick)=\"buttonClick($event)\" (onCancal)=\"onCancel()\"></core-form>\r\n }\r\n</div>\r\n} @else {\r\n<div class=\"modal-container\" [ngStyle]=\"{\r\n overflowY: 'scroll'\r\n }\">\r\n <div #containerBigger class=\"modal-content\">\r\n <div class=\"custom-header-popup\">\r\n <i class=\"feather-x\" (click)=\"onCancel()\"></i>\r\n <div [ngStyle]=\"{ margin: '0px 24px' }\">\r\n <core-page-header [title]=\"captionCode\" [hideButtonGroup]=\"true\"></core-page-header>\r\n </div>\r\n </div>\r\n <div #container class=\"core-page-edit-container not-normal-mode\" [ngStyle]=\"{\r\n overflow: 'visible'\r\n }\">\r\n @if (!!sections.length) {\r\n <core-form [formName]=\"'form'\" [submitText]=\"submitText\" [showCaptionButton]=\"showCaptionButton\"\r\n [leftInputSections]=\"leftInputSections\" [leftInputSectionsFlexSize]=\"leftInputSectionsFlexSize\"\r\n [inputSections]=\"sections\" [mode$]=\"mode$\" [bottomTemplateRef]=\"bottomTemplateRef\" [customFormButtonItems]=\"customFormButtonItems\"\r\n [disableSaveButton]=\"disableSaveButton\" [disableCancelButton]=\"disableCancelButton\" [checkError$]=\"checkError$\"\r\n (onFormCreated)=\"onFormCreatedLocal($event)\" (onSubmit)=\"onSubmit()\" (onSave)=\"onSave($event)\"\r\n (buttonClick)=\"buttonClick($event)\" (onCancal)=\"onCancel()\"></core-form>\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n}\r\n@if (loading) {\r\n<app-fullscreen-modal-loader></app-fullscreen-modal-loader>\r\n}", styles: ["@charset \"UTF-8\";.core-page-edit-container{--width: 50vw;background-color:#fff;padding:0,var(--size-layout-block-cell-spacing),var(--size-layout-block-cell-spacing),var(--size-layout-block-cell-spacing);width:var(--width)}@media (max-width: 992px){.core-page-edit-container{width:100%}}.core-page-edit-container>.custom-header-popup{display:flex}.core-page-edit-container>i{display:block;float:right;font-size:24px;cursor:pointer;margin:10px}.core-page-edit-container>caption{display:block;width:100%;color:#464646;font-weight:400}.modal-content{--height: 100%;height:var(--height);border-radius:10px}.modal-content i{display:block;float:right;font-size:24px;cursor:pointer;margin:10px}.modal-content caption{display:block;width:100%;color:#000}.custom-header-popup{background:#fff}.captionText{margin-left:24px}\n"] }]
21175
+ }], ctorParameters: () => [{ type: i1$2.Router }, { type: i1$2.ActivatedRoute }, { type: CorePageEditService }, { type: CommonHttpRequestService }, { type: AnimatedTextService }, { type: MultiLanguageService }, { type: CoreFormService }, { type: CorePageListService }, { type: HubConnectionService }, { type: AuthService }, { type: AlertService }, { type: UrlService }, { type: RoutingService }, { type: ResponseService }, { type: AppConfigService }], propDecorators: { stayAfterSubmit: [{
21176
+ type: Input
21177
+ }], width: [{
21178
+ type: Input
21179
+ }], entityTable: [{
21180
+ type: Input
21181
+ }], hasIdOfStringType: [{
21182
+ type: Input
21183
+ }], captionCode: [{
21184
+ type: Input
21185
+ }], leftInputSections: [{
21186
+ type: Input
21187
+ }], leftInputSectionsFlexSize: [{
21188
+ type: Input
21189
+ }], sections: [{
21190
+ type: Input
21191
+ }], normalMode: [{
21192
+ type: Input
21193
+ }], bottomTemplateRef: [{
21194
+ type: Input
21195
+ }], autoGetByIdOff: [{
21196
+ type: Input
21197
+ }], autoSubmitLogicOff: [{
21198
+ type: Input
21199
+ }], autoCancelLogicOff: [{
21200
+ type: Input
21201
+ }], customFormButtonItems: [{
21202
+ type: Input
21203
+ }], mixedMode: [{
21204
+ type: Input
21205
+ }], checkError$: [{
21206
+ type: Input
21207
+ }], showSaveButton: [{
21208
+ type: Input
21209
+ }], disableSaveButton: [{
21210
+ type: Input
21211
+ }], disableCancelButton: [{
21212
+ type: Input
21213
+ }], forceListRefreshOnCreateOrUpdate: [{
21214
+ type: Input
21215
+ }], submitLogic: [{
21216
+ type: Output
21217
+ }], onFormCreated: [{
21218
+ type: Output
21219
+ }], onSubmitSuccess: [{
20672
21220
  type: Output
20673
21221
  }], onButtonClick: [{
20674
21222
  type: Output
@@ -31947,956 +32495,411 @@ class CoreQueryBuilderComponent {
31947
32495
  }
31948
32496
  if (filter.filters[i] && !!filter.filters[i]?.hasOwnProperty('filters')) {
31949
32497
  if (filter.filters[i]?.filters.length !== 0) {
31950
- str += this.computed(filter.filters[i]);
31951
- }
31952
- }
31953
- else {
31954
- str +=
31955
- filter.filters[i].name +
31956
- " " +
31957
- this.htmlEntities(filter.filters[i].relationalOperator) +
31958
- " " +
31959
- filter.filters[i].value;
31960
- }
31961
- }
31962
- return str + ")";
31963
- }
31964
- setValueType(event, childFilter) {
31965
- this.columnType = this.totalCols.filter(x => x.netType === event)[0].columnType;
31966
- if (!!childFilter) {
31967
- childFilter.get('type').setValue(this.columnType);
31968
- const value = this.mainForm.getRawValue();
31969
- this.filterString = this.computed(value);
31970
- this.expressionEmitter.emit(this.filterString);
31971
- this.filterFormJsonString = JSON.stringify(this.mainForm.getRawValue(), null, 2);
31972
- this.jsonEmitter.emit(this.filterFormJsonString);
31973
- }
31974
- }
31975
- setValueChange(event, childFilter) {
31976
- // console.log(this.mainForm)
31977
- if (!!event) {
31978
- const value = this.mainForm.getRawValue();
31979
- this.filterString = this.computed(value);
31980
- this.expressionEmitter.emit(this.filterString);
31981
- this.filterFormJsonString = JSON.stringify(this.mainForm.getRawValue(), null, 2);
31982
- this.jsonEmitter.emit(this.filterFormJsonString);
31983
- }
31984
- }
31985
- setRelationalChange(event, childFilter) {
31986
- // console.log(this.mainForm)
31987
- if (!!event) {
31988
- const value = this.mainForm.getRawValue();
31989
- this.filterString = this.computed(value);
31990
- this.expressionEmitter.emit(this.filterString);
31991
- this.filterFormJsonString = JSON.stringify(this.mainForm.getRawValue(), null, 2);
31992
- this.jsonEmitter.emit(this.filterFormJsonString);
31993
- }
31994
- }
31995
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreQueryBuilderComponent, deps: [{ token: i1$4.FormBuilder }, { token: MultiLanguageService }], target: i0.ɵɵFactoryTarget.Component }); }
31996
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.1", type: CoreQueryBuilderComponent, isStandalone: true, selector: "core-query-builder", inputs: { totalCols: "totalCols", mainForm: "mainForm", filterStringInput: "filterStringInput", expressionInput: "expressionInput" }, outputs: { jsonEmitter: "jsonEmitter", expressionEmitter: "expressionEmitter" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"core-query-builder-container\">\r\n <div *ngIf=\"isDevMode\" class=\"alert alert-primary\">\r\n Expression = {{ filterString ? filterString : '()' }}\r\n </div>\r\n <div class=\"p-relative\">\r\n\r\n <form [formGroup]=\"mainForm\" (ngSubmit)=\"onSubmit()\">\r\n\r\n <ng-template #queryTemplateRef let-filter=\"filter\" let-groupToRemove=\"groupToRemove\">\r\n\r\n <div class=\"alert alert-dark\" role=\"alert\">\r\n\r\n <!-- Main Form Controls -->\r\n <div class=\"row\">\r\n <div class=\"col\">\r\n <!-- <input class=\"form-control\" type=\"text\" [formControl]=\"filter.get('logicalOperator')\" /> -->\r\n <select class=\"form-control\" [formControl]=\"filter.get('logicalOperator')\" value=\"AND\">\r\n <option value=\"AND\">{{'AND' | translate : lang}}</option>\r\n <option value=\"OR\">{{'OR' | translate : lang}}</option>\r\n </select>\r\n </div>\r\n <div class=\"col p-0\">\r\n <i [appTooltip]=\"'ADD_CONDITION_DYNAMIC_REPORT'| translate: lang\" style=\"margin-left: 5px\" (click)=\"addField(filter)\" class=\"btn btn-sm btn-success feather-file-plus\">\r\n <!-- <span class=\"glyphicon glyphicon-plus-sign\"></span>\r\n Add Field -->\r\n </i>\r\n </div>\r\n <div class=\"col p-0\">\r\n <i [appTooltip]=\"'ADD_GROUP_CONDITION_DYNAMIC_REPORT'| translate: lang\" style=\"margin-left: 5px\" (click)=\"addGroup(filter)\" class=\"btn btn-sm btn-success feather-folder-plus\">\r\n <!-- <span class=\"glyphicon glyphicon-plus-sign\"></span>\r\n Add Group -->\r\n </i>\r\n </div>\r\n <div class=\"col p-0\">\r\n <i *ngIf=\"groupToRemove\" [appTooltip]=\"'REMOVE_GROUP_CONDITON_DYNAMIC_REPORT'| translate: lang\" style=\"margin-left: 2px;margin-top:5px\" (click)=\"removeGroup(groupToRemove)\"\r\n class=\"btn btn-sm btn-danger feather-trash-2\">\r\n <!-- <span class=\"glyphicon glyphicon-minus-sign\"></span>\r\n Remove Group -->\r\n </i>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"filter.value.filters && filter.value.filters.length > 0 \" class=\"child-query\"\r\n formArrayName=\"filters\">\r\n <!-- field condition -->\r\n <div *ngFor=\"let childFilter of filter.get('filters').controls; let fieldGroup = index;\">\r\n <div class=\"row mt-1\" *ngIf=\"!childFilter.value.logicalOperator; else nestedFilter\"\r\n style=\"margin-left: 2%;\" [formGroup]=\"childFilter\">\r\n <input hidden=\"true\" [value]=\"columnType\" class=\"form-control\" type=\"text\" formControlName=\"type\" />\r\n <div class=\"col\" style=\"margin-right: 5px;\">\r\n \r\n\r\n <select class=\"form-control\" formControlName=\"name\" (ngModelChange)=\"setValueType($event,childFilter)\">\r\n <option *ngFor=\"let item of totalCols\" [value]=\"item.netType\">\r\n {{item.columnName | translate: lang}}\r\n <!-- <input hidden=\"true\" [value]=\"item.columnType\" class=\"form-control input-sm\" type=\"text\" formControlName=\"type\"> -->\r\n </option>\r\n </select>\r\n </div>\r\n <!-- <input class=\"form-control input-sm\" type=\"text\" formControlName=\"type\"> -->\r\n <div class=\"col\" style=\"margin-right: 5px;\">\r\n <!-- <input class=\"form-control\" type=\"text\" formControlName=\"relationalOperator\" /> -->\r\n <select class=\"form-control\" formControlName=\"relationalOperator\" (ngModelChange)=\"setRelationalChange($event,childFilter)\">\r\n <option *ngFor=\"let item of relationalOperator\" [value]=\"item.value\" [appTooltip]=\"item.value | translate : lang\">\r\n {{item.value | translate : lang}}\r\n </option>\r\n </select>\r\n </div>\r\n <div class=\"col\" style=\"margin-right: 5px;\">\r\n <input class=\"form-control\" type=\"text\" formControlName=\"value\" (ngModelChange)=\"setValueChange($event,childFilter)\"/>\r\n </div>\r\n <div class=\"col\" style=\"margin-right: 5px;\">\r\n <i [appTooltip]=\"'REMOVE_CONDITON_DYNAMIC_REPORT'| translate: lang\" style=\"margin-left: 5px;margin-top:5px\" (click)=\"removeField(filter, fieldGroup)\"\r\n class=\"btn btn-sm btn-danger feather-trash-2\">\r\n <!-- <span class=\"glyphicon glyphicon-minus-sign\"></span>\r\n Remove -->\r\n </i>\r\n </div>\r\n </div>\r\n\r\n <ng-template #nestedFilter>\r\n <div class=\"mt-2\" [formGroup]=\"childFilter\">\r\n <ng-container\r\n *ngTemplateOutlet=\"queryTemplateRef; context: { filter: childFilter, groupToRemove: { group: filter, index: fieldGroup} }\">\r\n </ng-container>\r\n </div>\r\n </ng-template>\r\n\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-container [ngTemplateOutlet]=\"queryTemplateRef\"\r\n [ngTemplateOutletContext]=\"{ filter: mainForm, groupToRemove: null }\">\r\n </ng-container>\r\n\r\n </form>\r\n </div>\r\n <div>\r\n <div *ngIf=\"isDevMode\" [ngStyle]=\"{\r\n display: 'block',\r\n width: '100%',\r\n height: 'auto',\r\n whiteSpace: 'pre-wrap',\r\n overflowX: 'hidden',\r\n overflowY: 'auto'\r\n }\">\r\n {{filterFormJsonString}}\r\n </div>\r\n </div>\r\n</div>", styles: [".alert{float:left;margin-top:10px;width:100%}.col.p-0>i{margin-top:5px}.core-query-builder-container{max-height:600px;overflow-y:auto;padding:10px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$4.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: TooltipDirective, selector: "[appTooltip]", inputs: ["color", "backgroundColor", "appTooltip", "showAnyway", "position"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
31997
- }
31998
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreQueryBuilderComponent, decorators: [{
31999
- type: Component,
32000
- args: [{ selector: 'core-query-builder', imports: [
32001
- CommonModule,
32002
- FormsModule,
32003
- ReactiveFormsModule,
32004
- CoreDropdownComponent,
32005
- TooltipDirective,
32006
- TranslatePipe
32007
- ], template: "<div class=\"core-query-builder-container\">\r\n <div *ngIf=\"isDevMode\" class=\"alert alert-primary\">\r\n Expression = {{ filterString ? filterString : '()' }}\r\n </div>\r\n <div class=\"p-relative\">\r\n\r\n <form [formGroup]=\"mainForm\" (ngSubmit)=\"onSubmit()\">\r\n\r\n <ng-template #queryTemplateRef let-filter=\"filter\" let-groupToRemove=\"groupToRemove\">\r\n\r\n <div class=\"alert alert-dark\" role=\"alert\">\r\n\r\n <!-- Main Form Controls -->\r\n <div class=\"row\">\r\n <div class=\"col\">\r\n <!-- <input class=\"form-control\" type=\"text\" [formControl]=\"filter.get('logicalOperator')\" /> -->\r\n <select class=\"form-control\" [formControl]=\"filter.get('logicalOperator')\" value=\"AND\">\r\n <option value=\"AND\">{{'AND' | translate : lang}}</option>\r\n <option value=\"OR\">{{'OR' | translate : lang}}</option>\r\n </select>\r\n </div>\r\n <div class=\"col p-0\">\r\n <i [appTooltip]=\"'ADD_CONDITION_DYNAMIC_REPORT'| translate: lang\" style=\"margin-left: 5px\" (click)=\"addField(filter)\" class=\"btn btn-sm btn-success feather-file-plus\">\r\n <!-- <span class=\"glyphicon glyphicon-plus-sign\"></span>\r\n Add Field -->\r\n </i>\r\n </div>\r\n <div class=\"col p-0\">\r\n <i [appTooltip]=\"'ADD_GROUP_CONDITION_DYNAMIC_REPORT'| translate: lang\" style=\"margin-left: 5px\" (click)=\"addGroup(filter)\" class=\"btn btn-sm btn-success feather-folder-plus\">\r\n <!-- <span class=\"glyphicon glyphicon-plus-sign\"></span>\r\n Add Group -->\r\n </i>\r\n </div>\r\n <div class=\"col p-0\">\r\n <i *ngIf=\"groupToRemove\" [appTooltip]=\"'REMOVE_GROUP_CONDITON_DYNAMIC_REPORT'| translate: lang\" style=\"margin-left: 2px;margin-top:5px\" (click)=\"removeGroup(groupToRemove)\"\r\n class=\"btn btn-sm btn-danger feather-trash-2\">\r\n <!-- <span class=\"glyphicon glyphicon-minus-sign\"></span>\r\n Remove Group -->\r\n </i>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"filter.value.filters && filter.value.filters.length > 0 \" class=\"child-query\"\r\n formArrayName=\"filters\">\r\n <!-- field condition -->\r\n <div *ngFor=\"let childFilter of filter.get('filters').controls; let fieldGroup = index;\">\r\n <div class=\"row mt-1\" *ngIf=\"!childFilter.value.logicalOperator; else nestedFilter\"\r\n style=\"margin-left: 2%;\" [formGroup]=\"childFilter\">\r\n <input hidden=\"true\" [value]=\"columnType\" class=\"form-control\" type=\"text\" formControlName=\"type\" />\r\n <div class=\"col\" style=\"margin-right: 5px;\">\r\n \r\n\r\n <select class=\"form-control\" formControlName=\"name\" (ngModelChange)=\"setValueType($event,childFilter)\">\r\n <option *ngFor=\"let item of totalCols\" [value]=\"item.netType\">\r\n {{item.columnName | translate: lang}}\r\n <!-- <input hidden=\"true\" [value]=\"item.columnType\" class=\"form-control input-sm\" type=\"text\" formControlName=\"type\"> -->\r\n </option>\r\n </select>\r\n </div>\r\n <!-- <input class=\"form-control input-sm\" type=\"text\" formControlName=\"type\"> -->\r\n <div class=\"col\" style=\"margin-right: 5px;\">\r\n <!-- <input class=\"form-control\" type=\"text\" formControlName=\"relationalOperator\" /> -->\r\n <select class=\"form-control\" formControlName=\"relationalOperator\" (ngModelChange)=\"setRelationalChange($event,childFilter)\">\r\n <option *ngFor=\"let item of relationalOperator\" [value]=\"item.value\" [appTooltip]=\"item.value | translate : lang\">\r\n {{item.value | translate : lang}}\r\n </option>\r\n </select>\r\n </div>\r\n <div class=\"col\" style=\"margin-right: 5px;\">\r\n <input class=\"form-control\" type=\"text\" formControlName=\"value\" (ngModelChange)=\"setValueChange($event,childFilter)\"/>\r\n </div>\r\n <div class=\"col\" style=\"margin-right: 5px;\">\r\n <i [appTooltip]=\"'REMOVE_CONDITON_DYNAMIC_REPORT'| translate: lang\" style=\"margin-left: 5px;margin-top:5px\" (click)=\"removeField(filter, fieldGroup)\"\r\n class=\"btn btn-sm btn-danger feather-trash-2\">\r\n <!-- <span class=\"glyphicon glyphicon-minus-sign\"></span>\r\n Remove -->\r\n </i>\r\n </div>\r\n </div>\r\n\r\n <ng-template #nestedFilter>\r\n <div class=\"mt-2\" [formGroup]=\"childFilter\">\r\n <ng-container\r\n *ngTemplateOutlet=\"queryTemplateRef; context: { filter: childFilter, groupToRemove: { group: filter, index: fieldGroup} }\">\r\n </ng-container>\r\n </div>\r\n </ng-template>\r\n\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-container [ngTemplateOutlet]=\"queryTemplateRef\"\r\n [ngTemplateOutletContext]=\"{ filter: mainForm, groupToRemove: null }\">\r\n </ng-container>\r\n\r\n </form>\r\n </div>\r\n <div>\r\n <div *ngIf=\"isDevMode\" [ngStyle]=\"{\r\n display: 'block',\r\n width: '100%',\r\n height: 'auto',\r\n whiteSpace: 'pre-wrap',\r\n overflowX: 'hidden',\r\n overflowY: 'auto'\r\n }\">\r\n {{filterFormJsonString}}\r\n </div>\r\n </div>\r\n</div>", styles: [".alert{float:left;margin-top:10px;width:100%}.col.p-0>i{margin-top:5px}.core-query-builder-container{max-height:600px;overflow-y:auto;padding:10px}\n"] }]
32008
- }], ctorParameters: () => [{ type: i1$4.FormBuilder }, { type: MultiLanguageService }], propDecorators: { totalCols: [{
32009
- type: Input
32010
- }], mainForm: [{
32011
- type: Input
32012
- }], filterStringInput: [{
32013
- type: Input
32014
- }], expressionInput: [{
32015
- type: Input
32016
- }], jsonEmitter: [{
32017
- type: Output
32018
- }], expressionEmitter: [{
32019
- type: Output
32020
- }] } });
32021
-
32022
- class CoreRouteAccumulatorComponent {
32023
- constructor(router) {
32024
- this.router = router;
32025
- this.processedRoutes = new Set(); // Store unique routes to prevent duplicates
32026
- this.subscriptions = [];
32027
- this.subscriptions.push(this.router.events
32028
- .pipe(filter(event => event instanceof RoutesRecognized || event instanceof RouteConfigLoadEnd))
32029
- .subscribe(event => {
32030
- console.log("subscribe event", event);
32031
- if (event instanceof RoutesRecognized) {
32032
- // Handle eager-loaded routes
32033
- this.onEagerModuleLoaded(event);
32034
- }
32035
- else if (event instanceof RouteConfigLoadEnd) {
32036
- // Handle lazy-loaded modules
32037
- this.onLazyModuleLoaded(event);
32038
- }
32039
- }));
32040
- }
32041
- mapActivatedRouteToRouteData(activatedRoute) {
32042
- const path = activatedRoute.url.map((segment) => segment.path).join('/'); // Construct path from segments
32043
- return {
32044
- path,
32045
- children: activatedRoute.children.map((childRoute) => this.mapActivatedRouteToRouteData(childRoute)),
32046
- };
32047
- }
32048
- onLazyModuleLoaded(event) {
32049
- console.log("CoreRouteAccumulatorComponent onLazyModuleLoaded", event);
32050
- return;
32051
- /*
32052
- const accumulatedPath = event.route.path || ''; // Start with the current path
32053
-
32054
- if (event.route.loadChildren) {
32055
- event.route
32056
- .loadChildren()
32057
- .then((module: any) => {
32058
- const routes = Array.isArray(module) ? module : module.routes || [];
32059
- this.processRoutes(routes, accumulatedPath);
32060
- })
32061
- .catch((error) => {
32062
- console.error('Error loading module:', error);
32063
- });
32064
- } else if (event.route._loadedRoutes) {
32065
- this.processRoutes(event.route._loadedRoutes, accumulatedPath);
32066
- } else if (event.route.children) {
32067
- const mappedRoutes = event.route.children.map((child) =>
32068
- child instanceof ActivatedRouteSnapshot
32069
- ? this.mapActivatedRouteToRouteData(child)
32070
- : { path: child.path, children: child.children || [] }
32071
- );
32072
- this.processRoutes(mappedRoutes, accumulatedPath);
32073
- } else {
32074
- this.saveRouteToDatabase({
32075
- routePath: accumulatedPath,
32076
- parentPath: null, // Root path has no parent
32077
- });
32078
- }
32079
- */
32080
- }
32081
- onEagerModuleLoaded(event) {
32082
- console.log("CoreRouteAccumulatorComponent onEagerModuleLoaded", event);
32083
- this.saveRouteToDatabase({
32084
- routePath: event.url,
32085
- parentPath: "" // pending. will be updated accumulately on lazy loaded event, based on path and children
32086
- });
32087
- /*
32088
- const accumulatedPath = event.state.url || ''; // Start with the current URL
32089
-
32090
- const mappedRoutes = event.state.root.children.map((child) =>
32091
- this.mapActivatedRouteToRouteData(child)
32092
- );
32093
-
32094
- this.processRoutes(mappedRoutes, accumulatedPath);
32095
- */
32096
- }
32097
- // Save route to the database, ensuring uniqueness with processedRoutes
32098
- saveRouteToDatabase(routeData) {
32099
- if (!this.processedRoutes.has(routeData.routePath)) {
32100
- this.processedRoutes.add(routeData.routePath); // Mark as processed
32101
- console.log(`Saving route: ${routeData.routePath}, Parent: ${routeData.parentPath}`);
32102
- // Implement actual DB logic here
32103
- }
32104
- }
32105
- processRoutes(routes, accumulatedPath) {
32106
- for (const route of routes) {
32107
- let fullPath = route.path || ''; // Current route path
32108
- // Handle true root modules
32109
- if (this.isRootModule(route)) {
32110
- fullPath = `/${fullPath}`.replace(/\/+/g, '/'); // Root modules start a new hierarchy
32111
- accumulatedPath = fullPath; // Reset the accumulated path
32112
- }
32113
- else if (accumulatedPath) {
32114
- // Append the current route to the accumulated path
32115
- fullPath = `${accumulatedPath}/${route.path}`.replace(/\/+/g, '/');
32116
- }
32117
- else {
32118
- // Fallback for non-root routes without accumulatedPath
32119
- fullPath = `/${route.path}`.replace(/\/+/g, '/');
32120
- }
32121
- // Avoid duplicate processing
32122
- if (this.processedRoutes.has(fullPath)) {
32123
- continue;
32124
- }
32125
- // Save the route
32126
- this.saveRouteToDatabase({
32127
- routePath: fullPath,
32128
- parentPath: accumulatedPath || null,
32129
- });
32130
- this.processedRoutes.add(fullPath);
32131
- // Recursively process children, if any
32132
- if (route.children) {
32133
- this.processRoutes(route.children, fullPath);
32134
- }
32135
- }
32136
- }
32137
- // Helper method to identify root modules
32138
- isRootModule(route) {
32139
- const ROOT_MODULES = ['oauth-callback', 'root', 'cms', 'developer-doc', 'online-users', 'menu', 'home', 'auth', 'sys']; // Add other known root modules or patterns here
32140
- return ROOT_MODULES.some(rootModule => route.path.startsWith(rootModule));
32141
- }
32142
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreRouteAccumulatorComponent, deps: [{ token: i1$2.Router }], target: i0.ɵɵFactoryTarget.Component }); }
32143
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.1", type: CoreRouteAccumulatorComponent, isStandalone: true, selector: "core-route-accumulator", ngImport: i0, template: "<p>core-route-accumulator works!</p>\r\n", styles: [""] }); }
32144
- }
32145
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreRouteAccumulatorComponent, decorators: [{
32146
- type: Component,
32147
- args: [{ selector: 'core-route-accumulator', imports: [], template: "<p>core-route-accumulator works!</p>\r\n" }]
32148
- }], ctorParameters: () => [{ type: i1$2.Router }] });
32149
-
32150
- class CoreRoutingHistoryComponent extends BaseComponent {
32151
- constructor(mls, routingService) {
32152
- super(mls);
32153
- this.mls = mls;
32154
- this.routingService = routingService;
32155
- this.items = [];
32156
- this.subscriptions.push(this.routingService.routingHistory$.subscribe(x => this.items = x.reverse()));
32157
- }
32158
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreRoutingHistoryComponent, deps: [{ token: MultiLanguageService }, { token: RoutingService }], target: i0.ɵɵFactoryTarget.Component }); }
32159
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.1", type: CoreRoutingHistoryComponent, isStandalone: true, selector: "core-routing-history", usesInheritance: true, ngImport: i0, template: "<div class=\"core-routing-history-container\">\r\n <ul>\r\n <li *ngFor=\"let item of items; let i = index\">\r\n <span>\r\n {{ i + 1 }}\r\n </span>\r\n </li>\r\n </ul>\r\n</div>", styles: [".core-routing-history-container{width:100%;height:auto}.core-routing-history-container>ul{overflow-x:auto;overflow-y:hidden;display:flex;align-items:center;justify-content:flex-end;height:40px}.core-routing-history-container>ul>li>span{display:flex;align-items:center;justify-content:center;width:40px;height:40px;overflow:hidden;text-overflow:ellipsis;cursor:pointer;margin:0 5px;border:solid 1px darkgray}.core-routing-history-container>ul>li>span:hover{background-color:#a9a9a9}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] }); }
32160
- }
32161
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreRoutingHistoryComponent, decorators: [{
32162
- type: Component,
32163
- args: [{ selector: 'core-routing-history', imports: [
32164
- CommonModule
32165
- ], template: "<div class=\"core-routing-history-container\">\r\n <ul>\r\n <li *ngFor=\"let item of items; let i = index\">\r\n <span>\r\n {{ i + 1 }}\r\n </span>\r\n </li>\r\n </ul>\r\n</div>", styles: [".core-routing-history-container{width:100%;height:auto}.core-routing-history-container>ul{overflow-x:auto;overflow-y:hidden;display:flex;align-items:center;justify-content:flex-end;height:40px}.core-routing-history-container>ul>li>span{display:flex;align-items:center;justify-content:center;width:40px;height:40px;overflow:hidden;text-overflow:ellipsis;cursor:pointer;margin:0 5px;border:solid 1px darkgray}.core-routing-history-container>ul>li>span:hover{background-color:#a9a9a9}\n"] }]
32166
- }], ctorParameters: () => [{ type: MultiLanguageService }, { type: RoutingService }] });
32167
-
32168
- class CoreSalaryPolicyPickerComponent extends CoreFormControlBaseComponent {
32169
- writeValue(e) {
32170
- this.value = e;
32171
- }
32172
- constructor(appService) {
32173
- super();
32174
- this.appService = appService;
32175
- this.items = [];
32176
- this.subscriptions = [];
32177
- }
32178
- ngAfterViewInit() {
32179
- setTimeout(() => {
32180
- this.subscriptions.push(this.appService.get('/api/PaSalaryPolicy/ScanSalaryPolicys').subscribe(x => {
32181
- if (x.ok && x.status === 200 && x.body?.statusCode === 200) {
32182
- this.items = x.body?.innerBody;
32183
- }
32184
- }));
32185
- });
32186
- }
32187
- onClick(item, e) {
32188
- e.stopPropagation();
32189
- this.writeValue(item.id);
32190
- this.onChange(item.id);
32191
- }
32192
- ngOnDestroy() {
32193
- this.subscriptions.forEach(x => x?.unsubscribe());
32194
- }
32195
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreSalaryPolicyPickerComponent, deps: [{ token: AppService }], target: i0.ɵɵFactoryTarget.Component }); }
32196
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: CoreSalaryPolicyPickerComponent, isStandalone: true, selector: "core-salary-policy-picker", providers: [
32197
- {
32198
- provide: NG_VALUE_ACCESSOR,
32199
- multi: true,
32200
- useExisting: CoreSalaryPolicyPickerComponent
32201
- }
32202
- ], usesInheritance: true, ngImport: i0, template: "<div class=\"core-salary-policy-picker-container\">\r\n @for(item of items; track $index) {\r\n <div class=\"policy-code-wrapper d-flex d-flex-between\">\r\n <div class=\"d-flex d-flex-center policy-code\" [class.default]=\"!!item.isDefault\" [class.active]=\"item.id === value\" (click)=\"onClick(item, $event)\">{{ item.code }}</div>\r\n </div>\r\n }\r\n</div>", styles: [".core-salary-policy-picker-container .policy-code-wrapper{max-width:56px}.core-salary-policy-picker-container .policy-code{width:24px;height:24px;border-radius:50%;background-color:#5f9ea0;color:#fff;cursor:pointer;opacity:.2}.core-salary-policy-picker-container .policy-code.default{background-color:var(--color-basic-orange)}.core-salary-policy-picker-container .policy-code.active{opacity:1}\n"] }); }
32203
- }
32204
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreSalaryPolicyPickerComponent, decorators: [{
32205
- type: Component,
32206
- args: [{ selector: 'core-salary-policy-picker', imports: [], providers: [
32207
- {
32208
- provide: NG_VALUE_ACCESSOR,
32209
- multi: true,
32210
- useExisting: CoreSalaryPolicyPickerComponent
32211
- }
32212
- ], template: "<div class=\"core-salary-policy-picker-container\">\r\n @for(item of items; track $index) {\r\n <div class=\"policy-code-wrapper d-flex d-flex-between\">\r\n <div class=\"d-flex d-flex-center policy-code\" [class.default]=\"!!item.isDefault\" [class.active]=\"item.id === value\" (click)=\"onClick(item, $event)\">{{ item.code }}</div>\r\n </div>\r\n }\r\n</div>", styles: [".core-salary-policy-picker-container .policy-code-wrapper{max-width:56px}.core-salary-policy-picker-container .policy-code{width:24px;height:24px;border-radius:50%;background-color:#5f9ea0;color:#fff;cursor:pointer;opacity:.2}.core-salary-policy-picker-container .policy-code.default{background-color:var(--color-basic-orange)}.core-salary-policy-picker-container .policy-code.active{opacity:1}\n"] }]
32213
- }], ctorParameters: () => [{ type: AppService }] });
32214
-
32215
- class CoreSeenByComponent extends CoreFormControlBaseComponent {
32216
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreSeenByComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
32217
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: CoreSeenByComponent, isStandalone: true, selector: "core-seen-by", providers: [
32218
- {
32219
- provide: NG_VALUE_ACCESSOR,
32220
- multi: true,
32221
- useExisting: CoreSeenByComponent
32222
- }
32223
- ], usesInheritance: true, ngImport: i0, template: "<div class=\"core-seen-by-container\">\n @if (value) {\n @for (item of value; track $index) {\n <div class=\"avatar-wrapper\" [ngStyle]=\"{\n zIndex: $index,\n left: (36 + 2) * $index + 'px'\n }\">\n <img [src]=\"item.avatar | mapAvatarToServer\" appImageErrorResolver>\n </div>\n }\n }\n</div>", styles: [".core-seen-by-container{display:block;position:relative;max-width:100%;overflow-x:auto;height:36px}.core-seen-by-container>.avatar-wrapper{display:block;position:absolute;width:36px;height:36px;border-radius:50%;top:0;cursor:pointer}.core-seen-by-container>.avatar-wrapper>img{width:36px;height:36px;border-radius:50%;transform:none!important}.core-seen-by-container>.avatar-wrapper>img :hover{transform:none!important}\n"], dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "pipe", type: MapAvatarToServerPipe, name: "mapAvatarToServer" }, { kind: "directive", type: ImageErrorResolverDirective, selector: "[appImageErrorResolver]", inputs: ["type", "isFemale"] }] }); }
32224
- }
32225
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreSeenByComponent, decorators: [{
32226
- type: Component,
32227
- args: [{ selector: 'core-seen-by', imports: [
32228
- NgStyle,
32229
- MapAvatarToServerPipe,
32230
- ImageErrorResolverDirective
32231
- ], providers: [
32232
- {
32233
- provide: NG_VALUE_ACCESSOR,
32234
- multi: true,
32235
- useExisting: CoreSeenByComponent
32236
- }
32237
- ], template: "<div class=\"core-seen-by-container\">\n @if (value) {\n @for (item of value; track $index) {\n <div class=\"avatar-wrapper\" [ngStyle]=\"{\n zIndex: $index,\n left: (36 + 2) * $index + 'px'\n }\">\n <img [src]=\"item.avatar | mapAvatarToServer\" appImageErrorResolver>\n </div>\n }\n }\n</div>", styles: [".core-seen-by-container{display:block;position:relative;max-width:100%;overflow-x:auto;height:36px}.core-seen-by-container>.avatar-wrapper{display:block;position:absolute;width:36px;height:36px;border-radius:50%;top:0;cursor:pointer}.core-seen-by-container>.avatar-wrapper>img{width:36px;height:36px;border-radius:50%;transform:none!important}.core-seen-by-container>.avatar-wrapper>img :hover{transform:none!important}\n"] }]
32238
- }] });
32239
-
32240
- class CoreSubFormGroupComponent extends CorePageEditComponent {
32241
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreSubFormGroupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
32242
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.1", type: CoreSubFormGroupComponent, isStandalone: true, selector: "core-sub-form-group", usesInheritance: true, ngImport: i0, template: "<core-form *ngIf=\"!!sections.length\" [formName]=\"'form'\" [inputSections]=\"sections\" [mode$]=\"mode$\" (onFormCreated)=\"onFormCreatedLocal($event)\"></core-form>\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CoreFormComponent, selector: "core-form", inputs: ["formName", "width", "submitText", "leftInputSections", "leftInputSectionsFlexSize", "inputSections", "mode$", "bottomTemplateRef", "customFormButtonItems", "showCaptionButton", "disableSaveButton", "disableCancelButton", "checkError$"], outputs: ["onFormCreated", "onFormRefCreated", "onSubmit", "onSave", "onCancal", "buttonClick"] }] }); }
32243
- }
32244
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreSubFormGroupComponent, decorators: [{
32245
- type: Component,
32246
- args: [{ selector: 'core-sub-form-group', imports: [
32247
- CommonModule,
32248
- CoreFormComponent
32249
- ], template: "<core-form *ngIf=\"!!sections.length\" [formName]=\"'form'\" [inputSections]=\"sections\" [mode$]=\"mode$\" (onFormCreated)=\"onFormCreatedLocal($event)\"></core-form>\r\n" }]
32250
- }] });
32251
-
32252
- class CoreTabListComponent extends BaseComponent {
32253
- constructor(mls, appService) {
32254
- super(mls);
32255
- this.mls = mls;
32256
- this.appService = appService;
32257
- this.rowClick = new EventEmitter();
32258
- this.rowDoubleClick = new EventEmitter();
32259
- this.selectedIdsChange = new EventEmitter();
32260
- this.corePageHeaderButtonClick = new EventEmitter();
32261
- this.headers = []; // based on statuses
32262
- this.contents = []; // based on statuses, constructed from core-table ref instances
32263
- this.selectedIds = [];
32264
- }
32265
- onCoreTabsHeaderClick(event) {
32266
- }
32267
- ngAfterViewInit() {
32268
- setTimeout(() => {
32269
- if (!!this.statusOptionsApi) {
32270
- this.subscriptions.push(this.mls.lang$.subscribe(x => {
32271
- this.subscriptions.push(this.appService.get(this.statusOptionsApi + '?lang=' + x).subscribe((x) => {
32272
- if (x.ok && x.status === 200 && x.body?.statusCode === 200) {
32273
- const body = x.body;
32274
- const newHeaders = [];
32275
- body.innerBody.forEach((m) => newHeaders.push(m.text));
32276
- this.headers = newHeaders;
32277
- }
32278
- }));
32279
- }));
32280
- }
32281
- });
32282
- }
32283
- onSelectedIdsChange(e) {
32284
- this.selectedIds = e;
32285
- console.log(this.selectedIds);
32286
- }
32287
- onCorePageHeaderButtonClick(e) {
32288
- this.corePageHeaderButtonClick.emit(e);
32289
- }
32290
- onRowClick(e) {
32291
- this.rowClick.emit(e);
32292
- }
32293
- onRowDoubleClick(event) {
32294
- this.rowDoubleClick.emit(event);
32295
- }
32296
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreTabListComponent, deps: [{ token: MultiLanguageService }, { token: AppService }], target: i0.ɵɵFactoryTarget.Component }); }
32297
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.1", type: CoreTabListComponent, isStandalone: true, selector: "core-tab-list", inputs: { title: "title", height: "height", headerLineHeight: "headerLineHeight", apiDefinition: "apiDefinition", columns: "columns", editRoute: "editRoute", crud: "crud", frozen: "frozen", generateTemplateRequest: "generateTemplateRequest", importPreviewPath: "importPreviewPath", outerSort: "outerSort", outerInOperators: "outerInOperators", outerParam$: "outerParam$", datePeriodComparisonFor: "datePeriodComparisonFor", datePeriodComparisonForLabelKey: "datePeriodComparisonForLabelKey", statusInclusionFor: "statusInclusionFor", statusOptionsApi: "statusOptionsApi" }, outputs: { rowClick: "rowClick", rowDoubleClick: "rowDoubleClick", selectedIdsChange: "selectedIdsChange", corePageHeaderButtonClick: "corePageHeaderButtonClick" }, viewQueries: [{ propertyName: "corePageList", first: true, predicate: ["corePageList"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<core-tabs [headers]=\"headers\" [contents]=\"[]\" [height]=\"55\" [headerLineHeight]=\"headerLineHeight\"\r\n (onHeaderClick)=\"onCoreTabsHeaderClick($event)\">\r\n</core-tabs>\r\n\r\n\r\n<core-page-list [height]=\"height\" [hideHeader]=\"true\" [apiDefinition]=\"apiDefinition\" [columns]=\"columns\"\r\n [editRoute]=\"editRoute\" [crud]=\"crud\" [title]=\"title\" *ngIf=\"!!avatar\" [outerParam$]=\"outerParam$\"\r\n [outerInOperators]=\"outerInOperators\" [autoResizeWithWindow]=\"true\" [selfResolveCorePageHeaderButtonClick]=\"true\"\r\n (rowDoubleClick)=\"onRowDoubleClick($event)\" (rowClick)=\"onRowClick($event)\"\r\n (corePageHeaderButtonClick)=\"onCorePageHeaderButtonClick($event)\" (selectedIdsChange)=\"onSelectedIdsChange($event)\"\r\n [frozen]=\"3\" [outerSort]=\"outerSort\" [generateTemplateRequest]=\"generateTemplateRequest\"\r\n [importPreviewPath]=\"'staffprofile-import'\"></core-page-list>\r\n\r\n\r\n<ng-template #avatar let-avatar=\"context.avatar\">\r\n <img [src]=\"avatar | mapAvatarToServer\" class=\"in-table-avatar\" appImageErrorResolver>\r\n</ng-template>\r\n\r\n<!-- [showParamKit]=\"true\"\r\n[datePeriodComparisonFor]=\"datePeriodComparisonFor\"\r\n[datePeriodComparisonForLabelKey]=\"datePeriodComparisonForLabelKey\"\r\n[hideStatusInclusion]=\"false\"\r\n[statusInclusionFor]=\"statusInclusionFor\"\r\n[statusInclusionForLabelKey]=\"statusInclusionForLabelKey\"\r\n[statusOptionsApi]=\"statusOptionsApi\" -->", styles: [""], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CoreTabsComponent, selector: "core-tabs", inputs: ["headers", "contents", "headerTools", "height", "headerLineHeight"], outputs: ["onHeaderClick", "onToolItemClick"] }, { kind: "component", type: CorePageListComponent, selector: "core-page-list", inputs: ["normalMode", "hideHeader", "hideButtonGroup", "seekerMode", "mccMode", "height", "headerWrap", "headerFirstRowHeight", "enableTimeZoneConverterForDateTimePeriodParameters", "showParamKit", "enableFilterKit", "datePeriodComparisonFor", "datePeriodComparisonForLabelKey", "statusInclusionFor", "statusInclusionForLabelKey", "statusOptionsApi", "statusOptions$", "showOrgParam", "showOrgParamDropdown", "hideGeneralSearch", "hideDatePeriodComparison", "hideStatusInclusion", "filterOperators$", "camelCaseDtoStatusIdField", "gridStatusColumn", "title", "hasIdOfStringType", "hideCheck", "apiDefinition", "columns", "useTheseColumns", "hideOrgTree", "frozen", "inlineTools", "inlineToolItems", "editRoute", "crud", "showListInlineTools", "top", "left", "hideLeft", "outerParam$", "outerFilter$", "outerSort", "outerFilterOperators", "outerInOperators", "autoResizeWithWindow", "extraManualOffset", "wrap", "rowHeight", "selfResolveCorePageHeaderButtonClick", "clearData$", "deleteValidateFn", "generateTemplateRequest", "importPreviewPath", "columnSearchDefaultOpen", "fixedPageSize", "disableDoubleClick", "noPaddingCell", "disableHighlightOnClick", "loading$", "excludedIds$", "disableDialogInformationLines", "changeTracking", "primaryKey", "changedItems$", "tabMode", "paramRows", "disableFilterHub", "autoColumnFitAvailableSpace", "ignoredDefaultActions", "checkboxExplicity"], outputs: ["corePageHeaderButtonClick", "rowClick", "rowDoubleClick", "selectedIdsChange", "selectedDataChange", "onInstanceCreated", "onInputFileBase64DataReady", "listChange"] }, { kind: "pipe", type: MapAvatarToServerPipe, name: "mapAvatarToServer" }, { kind: "directive", type: ImageErrorResolverDirective, selector: "[appImageErrorResolver]", inputs: ["type", "isFemale"] }] }); }
32298
- }
32299
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreTabListComponent, decorators: [{
32300
- type: Component,
32301
- args: [{ selector: 'core-tab-list', imports: [
32302
- NgIf,
32303
- CoreTabsComponent,
32304
- CorePageListComponent,
32305
- MapAvatarToServerPipe,
32306
- ImageErrorResolverDirective
32307
- ], template: "<core-tabs [headers]=\"headers\" [contents]=\"[]\" [height]=\"55\" [headerLineHeight]=\"headerLineHeight\"\r\n (onHeaderClick)=\"onCoreTabsHeaderClick($event)\">\r\n</core-tabs>\r\n\r\n\r\n<core-page-list [height]=\"height\" [hideHeader]=\"true\" [apiDefinition]=\"apiDefinition\" [columns]=\"columns\"\r\n [editRoute]=\"editRoute\" [crud]=\"crud\" [title]=\"title\" *ngIf=\"!!avatar\" [outerParam$]=\"outerParam$\"\r\n [outerInOperators]=\"outerInOperators\" [autoResizeWithWindow]=\"true\" [selfResolveCorePageHeaderButtonClick]=\"true\"\r\n (rowDoubleClick)=\"onRowDoubleClick($event)\" (rowClick)=\"onRowClick($event)\"\r\n (corePageHeaderButtonClick)=\"onCorePageHeaderButtonClick($event)\" (selectedIdsChange)=\"onSelectedIdsChange($event)\"\r\n [frozen]=\"3\" [outerSort]=\"outerSort\" [generateTemplateRequest]=\"generateTemplateRequest\"\r\n [importPreviewPath]=\"'staffprofile-import'\"></core-page-list>\r\n\r\n\r\n<ng-template #avatar let-avatar=\"context.avatar\">\r\n <img [src]=\"avatar | mapAvatarToServer\" class=\"in-table-avatar\" appImageErrorResolver>\r\n</ng-template>\r\n\r\n<!-- [showParamKit]=\"true\"\r\n[datePeriodComparisonFor]=\"datePeriodComparisonFor\"\r\n[datePeriodComparisonForLabelKey]=\"datePeriodComparisonForLabelKey\"\r\n[hideStatusInclusion]=\"false\"\r\n[statusInclusionFor]=\"statusInclusionFor\"\r\n[statusInclusionForLabelKey]=\"statusInclusionForLabelKey\"\r\n[statusOptionsApi]=\"statusOptionsApi\" -->" }]
32308
- }], ctorParameters: () => [{ type: MultiLanguageService }, { type: AppService }], propDecorators: { corePageList: [{
32309
- type: ViewChild,
32310
- args: ['corePageList']
32311
- }], title: [{
32312
- type: Input
32313
- }], height: [{
32314
- type: Input
32315
- }], headerLineHeight: [{
32316
- type: Input
32317
- }], apiDefinition: [{
32318
- type: Input,
32319
- args: [{ required: true }]
32320
- }], columns: [{
32321
- type: Input,
32322
- args: [{ required: true }]
32323
- }], editRoute: [{
32324
- type: Input
32325
- }], crud: [{
32326
- type: Input
32327
- }], frozen: [{
32328
- type: Input
32329
- }], generateTemplateRequest: [{
32330
- type: Input
32331
- }], importPreviewPath: [{
32332
- type: Input
32333
- }], outerSort: [{
32334
- type: Input
32335
- }], outerInOperators: [{
32336
- type: Input
32337
- }], outerParam$: [{
32338
- type: Input
32339
- }], datePeriodComparisonFor: [{
32340
- type: Input
32341
- }], datePeriodComparisonForLabelKey: [{
32342
- type: Input
32343
- }], statusInclusionFor: [{
32344
- type: Input
32345
- }], statusOptionsApi: [{
32346
- type: Input
32347
- }], rowClick: [{
32348
- type: Output
32349
- }], rowDoubleClick: [{
32350
- type: Output
32351
- }], selectedIdsChange: [{
32352
- type: Output
32353
- }], corePageHeaderButtonClick: [{
32354
- type: Output
32355
- }] } });
32356
-
32357
- var EnumCoreArticleCategoryTreeaAccessorMode;
32358
- (function (EnumCoreArticleCategoryTreeaAccessorMode) {
32359
- EnumCoreArticleCategoryTreeaAccessorMode["ACTIVATED_SINGLE"] = "ACTIVATED_SINGLE";
32360
- EnumCoreArticleCategoryTreeaAccessorMode["ACTIVATED_INHERITANCE"] = "ACTIVATED_INHERITANCE";
32361
- EnumCoreArticleCategoryTreeaAccessorMode["CHECKED"] = "CHECKED";
32362
- })(EnumCoreArticleCategoryTreeaAccessorMode || (EnumCoreArticleCategoryTreeaAccessorMode = {}));
32363
- class CoreTopicTreeComponent extends CoreFormControlBaseComponent {
32364
- writeValue(obj) {
32365
- this.value = obj;
32366
- switch (this.accessorMode) {
32367
- case EnumCoreArticleCategoryTreeaAccessorMode.CHECKED:
32368
- if (!!obj) {
32369
- const checkedKeys = [];
32370
- this.checkedIds = obj; // <=== 24/10/2023
32371
- obj.map(x => checkedKeys.push(x.toString()));
32372
- this.loading = true;
32373
- this.recursiveService.writeValueChecked(checkedKeys, this.data, this.disabledLoopExpand).subscribe(_ => {
32374
- this.loading = false;
32375
- if (!!this.data && !!this.data?.length)
32376
- this.data[0].tree$Expanded = true;
32377
- });
32378
- }
32379
- break;
32380
- case EnumCoreArticleCategoryTreeaAccessorMode.ACTIVATED_SINGLE:
32381
- case EnumCoreArticleCategoryTreeaAccessorMode.ACTIVATED_INHERITANCE:
32382
- if (!!obj) {
32383
- const activatedKeys = [];
32384
- obj.map(x => activatedKeys.push(x.toString()));
32385
- this.loading = true;
32386
- this.recursiveService.writeValueActivated(activatedKeys, this.data, this.disabledLoopExpand).subscribe(_ => {
32387
- this.loading = false;
32388
- if (!!this.data && !!this.data?.length)
32389
- this.data[0].tree$Expanded = true;
32390
- });
32391
- }
32392
- break;
32393
- default:
32394
- break;
32395
- }
32396
- if (this.accessorMode === EnumCoreArticleCategoryTreeaAccessorMode.CHECKED) {
32397
- }
32398
- else /* EnumCoreOrgTreeaAccessorMode.ACTIVATED_SINGLE or EnumCoreOrgTreeaAccessorMode.ACTIVATED_INHERITANCE */ {
32399
- }
32400
- }
32401
- setDisabledState(disabled) {
32402
- this.disabled = disabled;
32403
- }
32404
- constructor(
32405
- //public override injector: Injector,
32406
- authService, recursiveService, mls, layoutService, topicTreeService, alertService) {
32407
- super( /*injector*/);
32408
- this.authService = authService;
32409
- this.recursiveService = recursiveService;
32410
- this.mls = mls;
32411
- this.layoutService = layoutService;
32412
- this.topicTreeService = topicTreeService;
32413
- this.alertService = alertService;
32414
- this.lineColor = 'transparent';
32415
- this.itemDoubleClick = new EventEmitter();
32416
- this.itemClick = new EventEmitter();
32417
- this.activeIds = [];
32418
- this.checkedIds = [];
32419
- this.subscriptions = [];
32420
- this.search$ = new Subject();
32421
- this.searchPlaceholder = EnumTranslateKey.UI_COMMON_PLACE_HOLDER_SEARCH_HERE;
32422
- this.checkInheritance = true; // default value is true
32423
- this.showDissolved = true; // default value is false
32424
- this.initializing = true;
32425
- // this.reduced$ = this.coreOrgTreeState.coreOrgTreeReduced$;
32426
- this.initializing = false;
32427
- }
32428
- ngOnChanges(changes) {
32429
- if (changes['height']) {
32430
- this.resizeHeight();
32431
- }
32432
- }
32433
- ngOnInit() {
32434
- this.instanceNumber = new Date().getTime();
32435
- const newInstance = {
32436
- instanceNumber: this.instanceNumber,
32437
- selectedKey$: new BehaviorSubject(undefined),
32438
- activeKeys$: new BehaviorSubject([]),
32439
- checkedKeys$: new BehaviorSubject([]),
32440
- expandedKeys$: new BehaviorSubject([]),
32441
- checkInheritance$: new BehaviorSubject(true)
32442
- };
32443
- this.topicTreeService.instances.push(newInstance);
32444
- // Check xem chiều cao height có được truyền vào hay không
32445
- if (this.height === undefined) {
32446
- if (isDevMode()) {
32447
- //this.alertService.warn("CoreOrgTree không nhận được chiều cao (height) truyền vào từ lớp ngoài. Chiều cao mặc định sẽ được tính toán dựa vào bố cục chính.", alertOptions);
32448
- }
32449
- this.subscriptions.push(this.layoutService.contentContainerHeight$.subscribe(x => {
32450
- // basicSpacing là paddingBottom của lớp content-container
32451
- this.height = x - this.layoutService.corePageHeaderHeight - this.layoutService.basicSpacing;
32452
- }));
32453
- }
32454
- this.subscriptions.push(this.topicTreeService.linearData$.subscribe((x) => {
32455
- this.linearArticleCategoryArray = x;
32456
- }));
32457
- this.subscriptions.push(this.topicTreeService.status$.subscribe((x) => {
32458
- console.log("this.TopicTreeService.status$ changes", x);
32459
- const newActiveIds = [];
32460
- x.activeKeys.map((k) => {
32461
- newActiveIds.push(Number(k));
32462
- });
32463
- this.activeIds = newActiveIds;
32464
- if (this.accessorMode !== EnumCoreArticleCategoryTreeaAccessorMode.CHECKED) {
32465
- this.value = this.activeIds;
32466
- this.onChange(this.activeIds);
32467
- }
32468
- this.selectedKey = x.selectedKey;
32469
- }));
32470
- this.subscriptions.push(this.search$
32471
- .pipe(filter((x) => x !== null), debounceTime(500), distinctUntilChanged(), switchMap((text) => {
32472
- console.log('switchMap works');
32473
- this.loading = true;
32474
- return this.recursiveService.findItem(text, this.data);
32475
- }))
32476
- .subscribe((x) => {
32477
- this.loading = false;
32478
- }));
32479
- this.subscriptions.push(this.topicTreeService.status$
32480
- .pipe(filter((value) => !!!this.initializing && !!value))
32481
- .subscribe((x) => {
32482
- if (!!localStorage) {
32483
- localStorage.setItem('coreOrgTreeStatus', JSON.stringify(x));
32484
- }
32485
- }));
32486
- this.subscriptions.push(this.mls.lang$.subscribe((x) => (this.lang = x)));
32487
- }
32488
- resizeHeight() {
32489
- // height is not given and the tree resize as standard
32490
- if (!!!this.height) {
32491
- const sizeHeaderHeight = Number(getComputedStyle(document.documentElement)
32492
- .getPropertyValue('--size-header-height')
32493
- .replace('px', ''));
32494
- const sizeCorePageHeaderHeight = Number(getComputedStyle(document.documentElement)
32495
- .getPropertyValue('--size-core-page-header-height')
32496
- .replace('px', ''));
32497
- const containerHeight = window.innerHeight - sizeHeaderHeight - sizeCorePageHeaderHeight;
32498
- const pageHeaderHeight = Number(getComputedStyle(document.documentElement)
32499
- .getPropertyValue('--size-core-page-header-height')
32500
- .replace('px', ''));
32501
- const paginationHeight = Number(getComputedStyle(document.documentElement)
32502
- .getPropertyValue('--size-core-pagination-height')
32503
- .replace('px', ''));
32504
- const sizeMarginCorePaginationFull = Number(getComputedStyle(document.documentElement)
32505
- .getPropertyValue('--size-margin-core-pagination')
32506
- .replace('px', ''));
32507
- const height = containerHeight - pageHeaderHeight - paginationHeight + sizeMarginCorePaginationFull;
32508
- console.log(height);
32509
- this.container?.nativeElement.style.setProperty('--height', height + 'px');
32510
- }
32511
- else {
32512
- this.container?.nativeElement.style.setProperty('--height', this.height + 'px');
32513
- }
32514
- }
32515
- ngAfterViewInit() {
32516
- setTimeout(() => {
32517
- this.subscriptions.push(this.topicTreeService.topicTreeData$.subscribe((x) => {
32518
- this.data = x;
32519
- console.log("new Data coming", this.data, new Date().getTime());
32520
- if (!!this.data) {
32521
- if (!!this.data.length)
32522
- this.data[0].tree$Expanded = true;
32523
- }
32524
- }));
32525
- });
32526
- }
32527
- onItemClickLocal(e) {
32528
- this.linearArticleCategoryArray.map((x) => (x.active = false));
32529
- setTimeout(() => this.buildTreeData());
32530
- }
32531
- onToggleItem(e) {
32532
- const cloneCopy = JSON.parse(JSON.stringify(this.linearArticleCategoryArray));
32533
- const filter = cloneCopy.filter((x) => x.id === e.id);
32534
- if (filter.length === 1) {
32535
- filter[0].expanded = !!!e.expanded;
32536
- }
32537
- this.linearArticleCategoryArray = cloneCopy;
32538
- setTimeout(() => this.buildTreeData());
32539
- }
32540
- buildTreeData() {
32541
- this.loading = true;
32542
- const cloneCopy = JSON.parse(JSON.stringify(this.linearArticleCategoryArray));
32543
- if (typeof Worker !== 'undefined') {
32544
- // Create a new
32545
- console.log("🟢🟢 Worker works");
32546
- const worker = new Worker(liner_to_nested_array_script);
32547
- worker.addEventListener('message', ({ data }) => {
32548
- this.data = data.list;
32549
- if (!!this.data && !!this.data?.length)
32550
- this.data[0].tree$Expanded = true;
32551
- this.loading = false;
32552
- });
32553
- worker.postMessage({
32554
- list: cloneCopy,
32555
- keyField: 'id',
32556
- titleField: 'name',
32557
- parentField: 'parentId',
32558
- activeField: 'active',
32559
- //inheritantActiveField: 'inheritantActive',
32560
- checkedField: 'checked',
32561
- expandedField: 'expand',
32562
- });
32563
- }
32564
- else {
32565
- // Web workers are not supported in this environment.
32566
- // You should add a fallback so that your program still executes correctly.
32567
- const status = this.topicTreeService.status$.value;
32568
- this.subscriptions.push(this.recursiveService
32569
- .linerArrayToNestedArray(cloneCopy, 'id', 'name', 'parentId', 'active', 'checked', 'expand')
32570
- .subscribe((obj) => {
32571
- this.data = obj.list;
32572
- if (!!this.data && !!this.data?.length)
32573
- this.data[0].tree$Expanded = true;
32574
- this.loading = false;
32575
- }));
32576
- }
32577
- }
32578
- onExpandTogglerClick(e, event) {
32579
- event.stopPropagation();
32580
- const newValue = !e.tree$Expanded;
32581
- e.tree$Expanded = newValue;
32582
- // updating status with newValue
32583
- const currentExpandedIds = this.topicTreeService.status$.value?.expandedKeys;
32584
- let newExpandedIds = currentExpandedIds?.filter((_) => !!!currentExpandedIds.includes(e.id.toString()));
32585
- if (newValue) {
32586
- newExpandedIds?.push(e.id.toString());
32587
- }
32588
- newExpandedIds?.sort();
32589
- const newExpandedKeys = [];
32590
- newExpandedIds.map((x) => newExpandedKeys.push(x.toString()));
32591
- this.topicTreeService.status$.next({
32592
- ...this.topicTreeService.status$.value,
32593
- expandedKeys: newExpandedKeys,
32594
- });
32595
- }
32596
- onItemCheck(e, newValue) {
32597
- this.itemClick?.emit(e);
32598
- if (this.accessorMode !== EnumCoreArticleCategoryTreeaAccessorMode.CHECKED)
32599
- return;
32600
- // We have this var to hold nodes that are being changed
32601
- let toggledIds;
32602
- // We should calculate a new state into this var:
32603
- const newCheckedIds = JSON.parse(JSON.stringify(this.checkedIds));
32604
- // We will call this function after toggledIds changed
32605
- const changeValue = () => {
32606
- // If newValue === true, we will disctintly push changed ids to the state
32607
- // Otherwise we will remove them from the state
32608
- if (!!newValue) {
32609
- toggledIds.map(x => {
32610
- if (!!!newCheckedIds.includes(x)) {
32611
- newCheckedIds.push(x);
32612
- }
32613
- });
32614
- // Then asign the state to the newCheckedIds
32615
- this.checkedIds = newCheckedIds;
32616
- }
32617
- else {
32618
- const filter = newCheckedIds.filter(x => !!!toggledIds.includes(x));
32619
- // Then asign the state to the filter
32620
- this.checkedIds = filter;
32621
- }
32622
- // After the cases of if/else, make the control change with onChange
32623
- this.value = this.checkedIds;
32624
- this.onChange(this.checkedIds);
32625
- this.markAsTouched();
32626
- };
32627
- /* start: THIS CODE SCOPE calculates toggledIds */
32628
- if (this.checkInheritance) {
32629
- // If true, all the nested items will be checked/unchecked
32630
- this.recursiveService
32631
- .nestedToggleCheck(e, newValue)
32632
- .then((x) => {
32633
- // The ids have been changed
32634
- toggledIds = x;
32635
- // Now toggledIds were set. We call the function we declared
32636
- changeValue();
32637
- })
32638
- .catch((x) => {
32639
- console.error(x);
32640
- });
32641
- }
32642
- else {
32643
- // Otherwise we simply toggle check for current item only
32644
- toggledIds = [e.id];
32645
- // Now toggledIds were set. We call the function we declared
32646
- changeValue();
32647
- }
32648
- /* end: THIS CODE SCOPE calculates toggledIds */
32649
- // That is. Happy debugging!
32650
- }
32651
- onCheckIncludeDissolvedChange(value) {
32652
- console.log("onCheckIncludeDissolvedChange", value);
32653
- }
32654
- onCheckInheritanceChange(value) {
32655
- this.topicTreeService.status$.next({
32656
- ...this.topicTreeService.status$.value,
32657
- checkInheritance: value,
32658
- });
32659
- }
32660
- onObjectClick(e, event) {
32661
- // remove highlight class
32662
- // TO DO
32663
- if (!!e.protected)
32664
- return;
32665
- this.itemClick?.emit(e);
32666
- if (this.accessorMode === EnumCoreArticleCategoryTreeaAccessorMode.CHECKED)
32667
- return;
32668
- let activeIds = [];
32669
- this.recursiveService.nestedResetActive(this.data, false).then(falseAll => {
32670
- console.log("falseAll", falseAll);
32671
- if (this.accessorMode ===
32672
- EnumCoreArticleCategoryTreeaAccessorMode.ACTIVATED_INHERITANCE || !this.accessorMode) {
32673
- // If true, all the nested items will be active, the others are inactive
32674
- this.recursiveService
32675
- .nestedResetActive(e, true)
32676
- .then((x) => {
32677
- activeIds = x;
32678
- activeIds.sort();
32679
- const newActiveKeys = [];
32680
- activeIds.map((x) => newActiveKeys.push(x.toString()));
32681
- this.topicTreeService.status$.next({
32682
- ...this.topicTreeService.status$.value,
32683
- activeKeys: newActiveKeys,
32684
- selectedKey: e.id.toString()
32685
- });
32686
- this.activeIds = activeIds;
32687
- console.log(this.activeIds);
32688
- this.onChange(activeIds);
32689
- })
32690
- .catch((x) => {
32691
- console.error(x);
32692
- });
32498
+ str += this.computed(filter.filters[i]);
32499
+ }
32693
32500
  }
32694
32501
  else {
32695
- // ACTIVATED_SINGLE
32696
- // Otherwise we simply set current item to be active only
32697
- activeIds = [e.id];
32698
- this.activeIds = activeIds;
32699
- this.topicTreeService.status$.next({
32700
- ...this.topicTreeService.status$.value,
32701
- activeKeys: [e.id.toString()],
32702
- selectedKey: e.id.toString(),
32703
- });
32704
- this.onChange(activeIds);
32502
+ str +=
32503
+ filter.filters[i].name +
32504
+ " " +
32505
+ this.htmlEntities(filter.filters[i].relationalOperator) +
32506
+ " " +
32507
+ filter.filters[i].value;
32705
32508
  }
32706
- });
32707
- const { detail } = event;
32708
- if (detail === 2) {
32709
- console.log('This was a dblclick');
32710
- this.itemDoubleClick.emit(e);
32711
32509
  }
32712
- this.selectedItem = e;
32510
+ return str + ")";
32713
32511
  }
32714
- onSearchChange(text) {
32715
- this.search$.next(text);
32512
+ setValueType(event, childFilter) {
32513
+ this.columnType = this.totalCols.filter(x => x.netType === event)[0].columnType;
32514
+ if (!!childFilter) {
32515
+ childFilter.get('type').setValue(this.columnType);
32516
+ const value = this.mainForm.getRawValue();
32517
+ this.filterString = this.computed(value);
32518
+ this.expressionEmitter.emit(this.filterString);
32519
+ this.filterFormJsonString = JSON.stringify(this.mainForm.getRawValue(), null, 2);
32520
+ this.jsonEmitter.emit(this.filterFormJsonString);
32521
+ }
32716
32522
  }
32717
- ngAfterContentInit() {
32718
- console.log("ngAfterContentInit");
32523
+ setValueChange(event, childFilter) {
32524
+ // console.log(this.mainForm)
32525
+ if (!!event) {
32526
+ const value = this.mainForm.getRawValue();
32527
+ this.filterString = this.computed(value);
32528
+ this.expressionEmitter.emit(this.filterString);
32529
+ this.filterFormJsonString = JSON.stringify(this.mainForm.getRawValue(), null, 2);
32530
+ this.jsonEmitter.emit(this.filterFormJsonString);
32531
+ }
32719
32532
  }
32720
- ngOnDestroy() {
32721
- this.subscriptions.map((x) => x?.unsubscribe());
32722
- if (!!this.instanceNumber) {
32723
- const tryToFind = this.topicTreeService.instances.filter((x) => x.instanceNumber === this.instanceNumber);
32724
- if (!!tryToFind.length) {
32725
- const newInstances = this.topicTreeService.instances.filter((x) => x.instanceNumber !== this.instanceNumber);
32726
- this.topicTreeService.instances = newInstances;
32727
- }
32533
+ setRelationalChange(event, childFilter) {
32534
+ // console.log(this.mainForm)
32535
+ if (!!event) {
32536
+ const value = this.mainForm.getRawValue();
32537
+ this.filterString = this.computed(value);
32538
+ this.expressionEmitter.emit(this.filterString);
32539
+ this.filterFormJsonString = JSON.stringify(this.mainForm.getRawValue(), null, 2);
32540
+ this.jsonEmitter.emit(this.filterFormJsonString);
32728
32541
  }
32729
32542
  }
32730
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreTopicTreeComponent, deps: [{ token: AuthService }, { token: RecursiveService }, { token: MultiLanguageService }, { token: LayoutService }, { token: TopicTreeService }, { token: AlertService }], target: i0.ɵɵFactoryTarget.Component }); }
32731
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: CoreTopicTreeComponent, isStandalone: true, selector: "core-topic-tree", inputs: { lineColor: "lineColor", translateText: "translateText", fullWidthMode: "fullWidthMode", accessorMode: "accessorMode", fullRendering: "fullRendering", height: "height", disabledLoopExpand: "disabledLoopExpand", showCheckInheritance: "showCheckInheritance", inlineExtraTemplateRef: "inlineExtraTemplateRef" }, outputs: { itemDoubleClick: "itemDoubleClick", itemClick: "itemClick" }, providers: [
32732
- {
32733
- provide: NG_VALUE_ACCESSOR,
32734
- multi: true,
32735
- useExisting: CoreTopicTreeComponent,
32736
- },
32737
- ], viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true }, { propertyName: "displayContent", first: true, predicate: ["displayContent"], descendants: true }, { propertyName: "reducedIconWrapper", first: true, predicate: ["reducedIconWrapper"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div #container class=\"core-topic-tree-container\" [class.full-width]=\"!!fullWidthMode\" *ngIf=\"!!data\"\n [ngStyle]=\"{\n position : 'relative',\n width: '100%',\n height: height + 'px'\n }\">\n <div #displayContent class=\"custom-org-tree\">\n <div class=\"core-org-tree-header d-flex-between\">\n <div>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"search\" (ngModelChange)=\"onSearchChange($event)\"\n [placeholder]=\"searchPlaceholder | translate: lang\" [class.full-width]=\"!!fullWidthMode\">\n </div>\n </div>\n\n <ng-container>\n\n <div class=\"scroll-container\" [ngStyle]=\"{\n height: height - layoutService.coreOrgTreeTopHeight - layoutService.coreOrgTreeBottomHeight + 'px'\n }\">\n <core-loading-surface [loading]=\"loading\" [height]=\"scrollContainerHeight\"></core-loading-surface>\n @for (root of data; track $index) {\n <ul class=\"root\" [class.collapsed]=\"!!!root.tree$Expanded\">\n <ng-container *ngTemplateOutlet=\"item; context: { context: root }\"></ng-container>\n </ul>\n }\n </div>\n\n\n <div [ngStyle]=\"{\n display: 'block',\n position: 'absolute',\n bottom: '0px',\n left: '0px',\n right: '0px',\n height: layoutService.corePaginationHeight + 'px',\n paddingLeft: layoutService.basicSpacing + 'px',\n paddingRight: layoutService.basicSpacing + 'px',\n lineHeight: layoutService.corePaginationHeight + 'px',\n overflow: 'hidden'\n }\">\n <div [ngStyle]=\"{\n height: layoutService.corePaginationHeight + 'px',\n position: 'relative',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between'\n }\">\n <!-- <div>\n <core-checkbox [(ngModel)]=\"showDissolved\"\n (ngModelChange)=\"onCheckIncludeDissolvedChange($event)\"\n [text]=\"'UI.CORE_ORG_TREE.SHOW_OUTDATED_UNITS_ABBREVIATED'\"\n [tooltip]=\"'UI.CORE_ORG_TREE.SHOW_OUTDATED_UNITS'\" tooltipPosition=\"above\"></core-checkbox>\n </div> -->\n <div class=\"check-inheritance-wrapper\" *ngIf=\"accessorMode === 'CHECKED'\">\n <core-checkbox *ngIf=\"showCheckInheritance\" [(ngModel)]=\"checkInheritance\"\n (ngModelChange)=\"onCheckInheritanceChange($event)\"\n [text]=\"'UI.CORE_ORG_TREE.CHECK_INHERITANCE'\"></core-checkbox>\n </div>\n </div>\n </div>\n\n <ng-template #item let-context=\"context\" let-id=\"context.id\" let-title=\"context.tree$Title\"\n let-highlighted=\"context.tree$Highlighted\" let-hasChildren=\"context.tree$HasChildren\"\n let-hasActiveChildren=\"context.tree$HasActiveChildren\" let-children=\"context.tree$Children\"\n let-expanded=\"context.tree$Expanded\" let-isActive=\"context.isActive\" let-active=\"context.tree$Active\"\n let-checked=\"context.tree$Checked\" let-protected=\"context.protected\">\n\n @if ((!showDissolved && !!isActive) || (!!showDissolved)) {\n <li [class.has-children]=\"!!hasChildren\" [class.collapsed]=\"!!hasChildren && !!!expanded\">\n <span (click)=\"onObjectClick(context, $event)\">\n @if ((!!showDissolved && !!hasChildren) || (!showDissolved && !!hasActiveChildren)) {\n <i class=\"expand-toggler feather-chevron-down\"\n (click)=\"onExpandTogglerClick(context, $event)\"></i>\n }\n @if (accessorMode === 'CHECKED' && !!!protected) {\n <core-checkbox (onClick)=\"onItemCheck(context, $event)\" [inputValue]=\"checked\"\n [disabled]=\"disabled\"></core-checkbox>\n }\n <object [class.active]=\"activeIds.includes(id)\" [class.highlighted]=\"highlighted\"\n [class.dissolved]=\"!isActive\" [class.protected]=\"protected\"\n [appTooltip]=\"title\">\n {{ title | translate: lang }}\n </object>\n\n @if (!!inlineExtraTemplateRef) {\n <ng-container *ngTemplateOutlet=\"inlineExtraTemplateRef; context: { context: context }\">\n </ng-container>\n }\n\n </span>\n @if (children.length) {\n <ul [class.collapsed]=\" !!!expanded\">\n @for (child of children; track $index) {\n @if (!!expanded || !!fullRendering) {\n <ng-container *ngTemplateOutlet=\"item; context: { context: child }\"></ng-container>\n }\n }\n </ul>\n }\n </li>\n }\n\n </ng-template>\n\n </ng-container>\n </div>\n\n\n</div>", styles: [".core-topic-tree-container{--background: var(--color-bg-core-org-tree);--height: 545px;border-radius:5px;--item-height: 50px;--ul-padding: 20px;--display: \"block\";--square-color: darkgray;--square-size: 30px;--line-color: \"transparent\";--active-item-color: var(--color-bg-pagination-button);--line-size: 1px;--reduced-icon-wrapper-height: 50px;--reduced-panel-height: calc(var(--height) - var(--reduced-icon-wrapper-height));--scroll-container-height: calc(var(--height) - var(--size-core-reducer-icon-wrapper-height) - var(--size-pagination-height));color:#000;background-color:var(--color-bg-core-org-tree)!important;height:var(--height);background:var(--background);width:var(--size-core-org-tree-width);transition:width .5s ease-out}@keyframes reducedPanelOn{0%{opacity:0;transform:rotate(-90deg)}to{opacity:1;transform:rotate(0)}}.core-topic-tree-container .custom-org-tree{display:var(--display)}.core-topic-tree-container .core-org-tree-header{height:var(--size-core-org-tree-header-height)}.core-topic-tree-container .core-org-tree-header input{width:calc(var(--size-core-org-tree-width) - var(--size-layout-block-cell-spacing) * 2 - var(--size-scrollbar-width) + 6px)}.core-topic-tree-container .core-org-tree-header input.full-width{width:calc(var(--size-core-org-tree-width) - var(--size-layout-block-cell-spacing) * 2)}.core-topic-tree-container .check-inheritance-wrapper{padding:15px}.core-topic-tree-container .form-control{border:none}.core-topic-tree-container .core-reducer-icon-wrapper{height:var(--size-core-reducer-icon-wrapper-height);padding:var(--size-layout-block-cell-spacing)}.core-topic-tree-container .scroll-container{background:var(--background);height:var(--scroll-container-height);overflow-y:auto;overflow-x:auto;position:relative;width:100%;border-radius:5px}.core-topic-tree-container .scroll-container *{box-sizing:border-box;padding:0;margin:0}@media (max-width: 575px){.core-topic-tree-container .scroll-container ::-webkit-slider-runnable-track{width:0px}}.core-topic-tree-container .scroll-container ul{display:table;vertical-align:top;padding-left:var(--ul-padding);transition:all .5s ease-out;width:100%}.core-topic-tree-container .scroll-container ul>li>span:hover{background-color:#fff;width:100%}.core-topic-tree-container .scroll-container ul>li>span:active{background-color:#f1f1f1}.core-topic-tree-container .scroll-container ul>li>span>object.active{color:var(--active-item-color)}.core-topic-tree-container .scroll-container ul .highlighted{color:var(--color-core-org-tree-highlighted);font-weight:700}.core-topic-tree-container .scroll-container ul .dissolved{color:#848484;text-decoration:line-through dashed}.core-topic-tree-container .scroll-container ul .dissolved.active{color:#c9252b!important}.core-topic-tree-container .scroll-container ul>li{display:block;position:relative}.core-topic-tree-container .scroll-container ul>li:before{content:\"\";display:block;position:absolute;width:var(--ul-padding);left:calc(var(--ul-padding) * -1);top:calc(var(--item-height) / 2);height:calc(var(--item-height) / 2);border-top:solid var(--line-size) var(--line-color);border-right:none;border-bottom:none;border-left:solid var(--line-size) var(--line-color);z-index:0}.core-topic-tree-container .scroll-container ul>li>span{display:flex;align-items:center;height:var(--item-height);white-space:nowrap;padding-left:8px;cursor:pointer}.core-topic-tree-container .scroll-container ul>li>span>i{color:var(--square-color);cursor:pointer;font-size:var(--square-size);width:var(--square-size);height:var(--square-size)}.core-topic-tree-container .scroll-container ul>li>span>.expand-toggler{position:absolute;z-index:1;transform:translate(-100%) rotate(0);transition:.5s ease-out;display:flex;align-items:center;justify-content:center}.core-topic-tree-container .scroll-container ul>li>span>.check-toggler{margin-left:5px;margin-right:5px}.core-topic-tree-container .scroll-container ul>li>ul>li>span:before{content:\"\";display:block;position:absolute;width:var(--ul-padding);left:calc(var(--ul-padding) * -2);top:calc(var(--item-height) / 2);height:var(--line-size);border-top:solid var(--line-size) var(--line-color);z-index:0}.core-topic-tree-container .scroll-container ul>li.collapsed>span>.expand-toggler{transform:translate(-100%) rotate(-90deg);transition:.5s ease-out}.core-topic-tree-container .scroll-container ul>li.collapsed:before{border-left:none}.core-topic-tree-container .scroll-container ul>li:not(.collapsed):not(.has-children):before{border-left:none}.core-topic-tree-container .scroll-container ul:not(.root):before{content:\"\";display:block;position:absolute;width:var(--line-size);left:calc(var(--ul-padding) * -1);height:calc(100% - var(--item-height) * 1.5);border-left:solid var(--line-size) var(--line-color);z-index:0}.core-topic-tree-container .scroll-container ul:not(.root)>li:last-child:not(.collapsed).has-children:after{content:\"\";display:block;position:absolute;height:calc(100% - var(--item-height));width:calc(var(--ul-padding) / 2);left:calc(var(--ul-padding) * -2);top:calc(var(--item-height) / 2);border-left:solid var(--line-size) var(--background);z-index:0}.core-topic-tree-container .scroll-container ul.collapsed:not(.root){display:none}.core-topic-tree-container .collapsed>li:before{display:none!important}.core-org-tree-container.full-width .scroll-container{width:auto}.core-org-tree-container.reduced{width:50px;padding:0;transition:width .5s ease-out}.core-org-tree-container.reduced .scroll-container{overflow:hidden}.core-org-tree-container.reduced .scroll-container>ul.root{display:none}.core-org-tree-container.reduced .scroll-container>.reduced-panel{color:var(--active-item-color);width:50px;height:var(--reduced-panel-height);writing-mode:vertical-rl;text-orientation:mixed;display:flex;align-items:center;justify-content:center;font-weight:700;animation:reducedPanelOn .5s ease-out}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: CoreLoadingSurfaceComponent, selector: "core-loading-surface", inputs: ["loading", "height"] }, { kind: "component", type: CoreCheckboxComponent, selector: "core-checkbox", inputs: ["text", "tooltipPosition", "tooltip", "inputValue", "disabled"], outputs: ["onClick"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "directive", type: TooltipDirective, selector: "[appTooltip]", inputs: ["color", "backgroundColor", "appTooltip", "showAnyway", "position"] }] }); }
32543
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreQueryBuilderComponent, deps: [{ token: i1$4.FormBuilder }, { token: MultiLanguageService }], target: i0.ɵɵFactoryTarget.Component }); }
32544
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.1", type: CoreQueryBuilderComponent, isStandalone: true, selector: "core-query-builder", inputs: { totalCols: "totalCols", mainForm: "mainForm", filterStringInput: "filterStringInput", expressionInput: "expressionInput" }, outputs: { jsonEmitter: "jsonEmitter", expressionEmitter: "expressionEmitter" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"core-query-builder-container\">\r\n <div *ngIf=\"isDevMode\" class=\"alert alert-primary\">\r\n Expression = {{ filterString ? filterString : '()' }}\r\n </div>\r\n <div class=\"p-relative\">\r\n\r\n <form [formGroup]=\"mainForm\" (ngSubmit)=\"onSubmit()\">\r\n\r\n <ng-template #queryTemplateRef let-filter=\"filter\" let-groupToRemove=\"groupToRemove\">\r\n\r\n <div class=\"alert alert-dark\" role=\"alert\">\r\n\r\n <!-- Main Form Controls -->\r\n <div class=\"row\">\r\n <div class=\"col\">\r\n <!-- <input class=\"form-control\" type=\"text\" [formControl]=\"filter.get('logicalOperator')\" /> -->\r\n <select class=\"form-control\" [formControl]=\"filter.get('logicalOperator')\" value=\"AND\">\r\n <option value=\"AND\">{{'AND' | translate : lang}}</option>\r\n <option value=\"OR\">{{'OR' | translate : lang}}</option>\r\n </select>\r\n </div>\r\n <div class=\"col p-0\">\r\n <i [appTooltip]=\"'ADD_CONDITION_DYNAMIC_REPORT'| translate: lang\" style=\"margin-left: 5px\" (click)=\"addField(filter)\" class=\"btn btn-sm btn-success feather-file-plus\">\r\n <!-- <span class=\"glyphicon glyphicon-plus-sign\"></span>\r\n Add Field -->\r\n </i>\r\n </div>\r\n <div class=\"col p-0\">\r\n <i [appTooltip]=\"'ADD_GROUP_CONDITION_DYNAMIC_REPORT'| translate: lang\" style=\"margin-left: 5px\" (click)=\"addGroup(filter)\" class=\"btn btn-sm btn-success feather-folder-plus\">\r\n <!-- <span class=\"glyphicon glyphicon-plus-sign\"></span>\r\n Add Group -->\r\n </i>\r\n </div>\r\n <div class=\"col p-0\">\r\n <i *ngIf=\"groupToRemove\" [appTooltip]=\"'REMOVE_GROUP_CONDITON_DYNAMIC_REPORT'| translate: lang\" style=\"margin-left: 2px;margin-top:5px\" (click)=\"removeGroup(groupToRemove)\"\r\n class=\"btn btn-sm btn-danger feather-trash-2\">\r\n <!-- <span class=\"glyphicon glyphicon-minus-sign\"></span>\r\n Remove Group -->\r\n </i>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"filter.value.filters && filter.value.filters.length > 0 \" class=\"child-query\"\r\n formArrayName=\"filters\">\r\n <!-- field condition -->\r\n <div *ngFor=\"let childFilter of filter.get('filters').controls; let fieldGroup = index;\">\r\n <div class=\"row mt-1\" *ngIf=\"!childFilter.value.logicalOperator; else nestedFilter\"\r\n style=\"margin-left: 2%;\" [formGroup]=\"childFilter\">\r\n <input hidden=\"true\" [value]=\"columnType\" class=\"form-control\" type=\"text\" formControlName=\"type\" />\r\n <div class=\"col\" style=\"margin-right: 5px;\">\r\n \r\n\r\n <select class=\"form-control\" formControlName=\"name\" (ngModelChange)=\"setValueType($event,childFilter)\">\r\n <option *ngFor=\"let item of totalCols\" [value]=\"item.netType\">\r\n {{item.columnName | translate: lang}}\r\n <!-- <input hidden=\"true\" [value]=\"item.columnType\" class=\"form-control input-sm\" type=\"text\" formControlName=\"type\"> -->\r\n </option>\r\n </select>\r\n </div>\r\n <!-- <input class=\"form-control input-sm\" type=\"text\" formControlName=\"type\"> -->\r\n <div class=\"col\" style=\"margin-right: 5px;\">\r\n <!-- <input class=\"form-control\" type=\"text\" formControlName=\"relationalOperator\" /> -->\r\n <select class=\"form-control\" formControlName=\"relationalOperator\" (ngModelChange)=\"setRelationalChange($event,childFilter)\">\r\n <option *ngFor=\"let item of relationalOperator\" [value]=\"item.value\" [appTooltip]=\"item.value | translate : lang\">\r\n {{item.value | translate : lang}}\r\n </option>\r\n </select>\r\n </div>\r\n <div class=\"col\" style=\"margin-right: 5px;\">\r\n <input class=\"form-control\" type=\"text\" formControlName=\"value\" (ngModelChange)=\"setValueChange($event,childFilter)\"/>\r\n </div>\r\n <div class=\"col\" style=\"margin-right: 5px;\">\r\n <i [appTooltip]=\"'REMOVE_CONDITON_DYNAMIC_REPORT'| translate: lang\" style=\"margin-left: 5px;margin-top:5px\" (click)=\"removeField(filter, fieldGroup)\"\r\n class=\"btn btn-sm btn-danger feather-trash-2\">\r\n <!-- <span class=\"glyphicon glyphicon-minus-sign\"></span>\r\n Remove -->\r\n </i>\r\n </div>\r\n </div>\r\n\r\n <ng-template #nestedFilter>\r\n <div class=\"mt-2\" [formGroup]=\"childFilter\">\r\n <ng-container\r\n *ngTemplateOutlet=\"queryTemplateRef; context: { filter: childFilter, groupToRemove: { group: filter, index: fieldGroup} }\">\r\n </ng-container>\r\n </div>\r\n </ng-template>\r\n\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-container [ngTemplateOutlet]=\"queryTemplateRef\"\r\n [ngTemplateOutletContext]=\"{ filter: mainForm, groupToRemove: null }\">\r\n </ng-container>\r\n\r\n </form>\r\n </div>\r\n <div>\r\n <div *ngIf=\"isDevMode\" [ngStyle]=\"{\r\n display: 'block',\r\n width: '100%',\r\n height: 'auto',\r\n whiteSpace: 'pre-wrap',\r\n overflowX: 'hidden',\r\n overflowY: 'auto'\r\n }\">\r\n {{filterFormJsonString}}\r\n </div>\r\n </div>\r\n</div>", styles: [".alert{float:left;margin-top:10px;width:100%}.col.p-0>i{margin-top:5px}.core-query-builder-container{max-height:600px;overflow-y:auto;padding:10px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$4.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: TooltipDirective, selector: "[appTooltip]", inputs: ["color", "backgroundColor", "appTooltip", "showAnyway", "position"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
32738
32545
  }
32739
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreTopicTreeComponent, decorators: [{
32546
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreQueryBuilderComponent, decorators: [{
32740
32547
  type: Component,
32741
- args: [{ selector: 'core-topic-tree', imports: [
32548
+ args: [{ selector: 'core-query-builder', imports: [
32742
32549
  CommonModule,
32743
32550
  FormsModule,
32744
- CoreLoadingSurfaceComponent,
32745
- CoreReducerIconComponent,
32746
- CoreCheckboxComponent,
32747
- TranslatePipe,
32551
+ ReactiveFormsModule,
32552
+ CoreDropdownComponent,
32748
32553
  TooltipDirective,
32749
- NgTemplateOutlet
32750
- ], providers: [
32751
- {
32752
- provide: NG_VALUE_ACCESSOR,
32753
- multi: true,
32754
- useExisting: CoreTopicTreeComponent,
32755
- },
32756
- ], template: "<div #container class=\"core-topic-tree-container\" [class.full-width]=\"!!fullWidthMode\" *ngIf=\"!!data\"\n [ngStyle]=\"{\n position : 'relative',\n width: '100%',\n height: height + 'px'\n }\">\n <div #displayContent class=\"custom-org-tree\">\n <div class=\"core-org-tree-header d-flex-between\">\n <div>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"search\" (ngModelChange)=\"onSearchChange($event)\"\n [placeholder]=\"searchPlaceholder | translate: lang\" [class.full-width]=\"!!fullWidthMode\">\n </div>\n </div>\n\n <ng-container>\n\n <div class=\"scroll-container\" [ngStyle]=\"{\n height: height - layoutService.coreOrgTreeTopHeight - layoutService.coreOrgTreeBottomHeight + 'px'\n }\">\n <core-loading-surface [loading]=\"loading\" [height]=\"scrollContainerHeight\"></core-loading-surface>\n @for (root of data; track $index) {\n <ul class=\"root\" [class.collapsed]=\"!!!root.tree$Expanded\">\n <ng-container *ngTemplateOutlet=\"item; context: { context: root }\"></ng-container>\n </ul>\n }\n </div>\n\n\n <div [ngStyle]=\"{\n display: 'block',\n position: 'absolute',\n bottom: '0px',\n left: '0px',\n right: '0px',\n height: layoutService.corePaginationHeight + 'px',\n paddingLeft: layoutService.basicSpacing + 'px',\n paddingRight: layoutService.basicSpacing + 'px',\n lineHeight: layoutService.corePaginationHeight + 'px',\n overflow: 'hidden'\n }\">\n <div [ngStyle]=\"{\n height: layoutService.corePaginationHeight + 'px',\n position: 'relative',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between'\n }\">\n <!-- <div>\n <core-checkbox [(ngModel)]=\"showDissolved\"\n (ngModelChange)=\"onCheckIncludeDissolvedChange($event)\"\n [text]=\"'UI.CORE_ORG_TREE.SHOW_OUTDATED_UNITS_ABBREVIATED'\"\n [tooltip]=\"'UI.CORE_ORG_TREE.SHOW_OUTDATED_UNITS'\" tooltipPosition=\"above\"></core-checkbox>\n </div> -->\n <div class=\"check-inheritance-wrapper\" *ngIf=\"accessorMode === 'CHECKED'\">\n <core-checkbox *ngIf=\"showCheckInheritance\" [(ngModel)]=\"checkInheritance\"\n (ngModelChange)=\"onCheckInheritanceChange($event)\"\n [text]=\"'UI.CORE_ORG_TREE.CHECK_INHERITANCE'\"></core-checkbox>\n </div>\n </div>\n </div>\n\n <ng-template #item let-context=\"context\" let-id=\"context.id\" let-title=\"context.tree$Title\"\n let-highlighted=\"context.tree$Highlighted\" let-hasChildren=\"context.tree$HasChildren\"\n let-hasActiveChildren=\"context.tree$HasActiveChildren\" let-children=\"context.tree$Children\"\n let-expanded=\"context.tree$Expanded\" let-isActive=\"context.isActive\" let-active=\"context.tree$Active\"\n let-checked=\"context.tree$Checked\" let-protected=\"context.protected\">\n\n @if ((!showDissolved && !!isActive) || (!!showDissolved)) {\n <li [class.has-children]=\"!!hasChildren\" [class.collapsed]=\"!!hasChildren && !!!expanded\">\n <span (click)=\"onObjectClick(context, $event)\">\n @if ((!!showDissolved && !!hasChildren) || (!showDissolved && !!hasActiveChildren)) {\n <i class=\"expand-toggler feather-chevron-down\"\n (click)=\"onExpandTogglerClick(context, $event)\"></i>\n }\n @if (accessorMode === 'CHECKED' && !!!protected) {\n <core-checkbox (onClick)=\"onItemCheck(context, $event)\" [inputValue]=\"checked\"\n [disabled]=\"disabled\"></core-checkbox>\n }\n <object [class.active]=\"activeIds.includes(id)\" [class.highlighted]=\"highlighted\"\n [class.dissolved]=\"!isActive\" [class.protected]=\"protected\"\n [appTooltip]=\"title\">\n {{ title | translate: lang }}\n </object>\n\n @if (!!inlineExtraTemplateRef) {\n <ng-container *ngTemplateOutlet=\"inlineExtraTemplateRef; context: { context: context }\">\n </ng-container>\n }\n\n </span>\n @if (children.length) {\n <ul [class.collapsed]=\" !!!expanded\">\n @for (child of children; track $index) {\n @if (!!expanded || !!fullRendering) {\n <ng-container *ngTemplateOutlet=\"item; context: { context: child }\"></ng-container>\n }\n }\n </ul>\n }\n </li>\n }\n\n </ng-template>\n\n </ng-container>\n </div>\n\n\n</div>", styles: [".core-topic-tree-container{--background: var(--color-bg-core-org-tree);--height: 545px;border-radius:5px;--item-height: 50px;--ul-padding: 20px;--display: \"block\";--square-color: darkgray;--square-size: 30px;--line-color: \"transparent\";--active-item-color: var(--color-bg-pagination-button);--line-size: 1px;--reduced-icon-wrapper-height: 50px;--reduced-panel-height: calc(var(--height) - var(--reduced-icon-wrapper-height));--scroll-container-height: calc(var(--height) - var(--size-core-reducer-icon-wrapper-height) - var(--size-pagination-height));color:#000;background-color:var(--color-bg-core-org-tree)!important;height:var(--height);background:var(--background);width:var(--size-core-org-tree-width);transition:width .5s ease-out}@keyframes reducedPanelOn{0%{opacity:0;transform:rotate(-90deg)}to{opacity:1;transform:rotate(0)}}.core-topic-tree-container .custom-org-tree{display:var(--display)}.core-topic-tree-container .core-org-tree-header{height:var(--size-core-org-tree-header-height)}.core-topic-tree-container .core-org-tree-header input{width:calc(var(--size-core-org-tree-width) - var(--size-layout-block-cell-spacing) * 2 - var(--size-scrollbar-width) + 6px)}.core-topic-tree-container .core-org-tree-header input.full-width{width:calc(var(--size-core-org-tree-width) - var(--size-layout-block-cell-spacing) * 2)}.core-topic-tree-container .check-inheritance-wrapper{padding:15px}.core-topic-tree-container .form-control{border:none}.core-topic-tree-container .core-reducer-icon-wrapper{height:var(--size-core-reducer-icon-wrapper-height);padding:var(--size-layout-block-cell-spacing)}.core-topic-tree-container .scroll-container{background:var(--background);height:var(--scroll-container-height);overflow-y:auto;overflow-x:auto;position:relative;width:100%;border-radius:5px}.core-topic-tree-container .scroll-container *{box-sizing:border-box;padding:0;margin:0}@media (max-width: 575px){.core-topic-tree-container .scroll-container ::-webkit-slider-runnable-track{width:0px}}.core-topic-tree-container .scroll-container ul{display:table;vertical-align:top;padding-left:var(--ul-padding);transition:all .5s ease-out;width:100%}.core-topic-tree-container .scroll-container ul>li>span:hover{background-color:#fff;width:100%}.core-topic-tree-container .scroll-container ul>li>span:active{background-color:#f1f1f1}.core-topic-tree-container .scroll-container ul>li>span>object.active{color:var(--active-item-color)}.core-topic-tree-container .scroll-container ul .highlighted{color:var(--color-core-org-tree-highlighted);font-weight:700}.core-topic-tree-container .scroll-container ul .dissolved{color:#848484;text-decoration:line-through dashed}.core-topic-tree-container .scroll-container ul .dissolved.active{color:#c9252b!important}.core-topic-tree-container .scroll-container ul>li{display:block;position:relative}.core-topic-tree-container .scroll-container ul>li:before{content:\"\";display:block;position:absolute;width:var(--ul-padding);left:calc(var(--ul-padding) * -1);top:calc(var(--item-height) / 2);height:calc(var(--item-height) / 2);border-top:solid var(--line-size) var(--line-color);border-right:none;border-bottom:none;border-left:solid var(--line-size) var(--line-color);z-index:0}.core-topic-tree-container .scroll-container ul>li>span{display:flex;align-items:center;height:var(--item-height);white-space:nowrap;padding-left:8px;cursor:pointer}.core-topic-tree-container .scroll-container ul>li>span>i{color:var(--square-color);cursor:pointer;font-size:var(--square-size);width:var(--square-size);height:var(--square-size)}.core-topic-tree-container .scroll-container ul>li>span>.expand-toggler{position:absolute;z-index:1;transform:translate(-100%) rotate(0);transition:.5s ease-out;display:flex;align-items:center;justify-content:center}.core-topic-tree-container .scroll-container ul>li>span>.check-toggler{margin-left:5px;margin-right:5px}.core-topic-tree-container .scroll-container ul>li>ul>li>span:before{content:\"\";display:block;position:absolute;width:var(--ul-padding);left:calc(var(--ul-padding) * -2);top:calc(var(--item-height) / 2);height:var(--line-size);border-top:solid var(--line-size) var(--line-color);z-index:0}.core-topic-tree-container .scroll-container ul>li.collapsed>span>.expand-toggler{transform:translate(-100%) rotate(-90deg);transition:.5s ease-out}.core-topic-tree-container .scroll-container ul>li.collapsed:before{border-left:none}.core-topic-tree-container .scroll-container ul>li:not(.collapsed):not(.has-children):before{border-left:none}.core-topic-tree-container .scroll-container ul:not(.root):before{content:\"\";display:block;position:absolute;width:var(--line-size);left:calc(var(--ul-padding) * -1);height:calc(100% - var(--item-height) * 1.5);border-left:solid var(--line-size) var(--line-color);z-index:0}.core-topic-tree-container .scroll-container ul:not(.root)>li:last-child:not(.collapsed).has-children:after{content:\"\";display:block;position:absolute;height:calc(100% - var(--item-height));width:calc(var(--ul-padding) / 2);left:calc(var(--ul-padding) * -2);top:calc(var(--item-height) / 2);border-left:solid var(--line-size) var(--background);z-index:0}.core-topic-tree-container .scroll-container ul.collapsed:not(.root){display:none}.core-topic-tree-container .collapsed>li:before{display:none!important}.core-org-tree-container.full-width .scroll-container{width:auto}.core-org-tree-container.reduced{width:50px;padding:0;transition:width .5s ease-out}.core-org-tree-container.reduced .scroll-container{overflow:hidden}.core-org-tree-container.reduced .scroll-container>ul.root{display:none}.core-org-tree-container.reduced .scroll-container>.reduced-panel{color:var(--active-item-color);width:50px;height:var(--reduced-panel-height);writing-mode:vertical-rl;text-orientation:mixed;display:flex;align-items:center;justify-content:center;font-weight:700;animation:reducedPanelOn .5s ease-out}\n"] }]
32757
- }], ctorParameters: () => [{ type: AuthService }, { type: RecursiveService }, { type: MultiLanguageService }, { type: LayoutService }, { type: TopicTreeService }, { type: AlertService }], propDecorators: { lineColor: [{
32758
- type: Input
32759
- }], translateText: [{
32760
- type: Input
32761
- }], fullWidthMode: [{
32762
- type: Input
32763
- }], accessorMode: [{
32764
- type: Input
32765
- }], fullRendering: [{
32766
- type: Input
32767
- }], height: [{
32554
+ TranslatePipe
32555
+ ], template: "<div class=\"core-query-builder-container\">\r\n <div *ngIf=\"isDevMode\" class=\"alert alert-primary\">\r\n Expression = {{ filterString ? filterString : '()' }}\r\n </div>\r\n <div class=\"p-relative\">\r\n\r\n <form [formGroup]=\"mainForm\" (ngSubmit)=\"onSubmit()\">\r\n\r\n <ng-template #queryTemplateRef let-filter=\"filter\" let-groupToRemove=\"groupToRemove\">\r\n\r\n <div class=\"alert alert-dark\" role=\"alert\">\r\n\r\n <!-- Main Form Controls -->\r\n <div class=\"row\">\r\n <div class=\"col\">\r\n <!-- <input class=\"form-control\" type=\"text\" [formControl]=\"filter.get('logicalOperator')\" /> -->\r\n <select class=\"form-control\" [formControl]=\"filter.get('logicalOperator')\" value=\"AND\">\r\n <option value=\"AND\">{{'AND' | translate : lang}}</option>\r\n <option value=\"OR\">{{'OR' | translate : lang}}</option>\r\n </select>\r\n </div>\r\n <div class=\"col p-0\">\r\n <i [appTooltip]=\"'ADD_CONDITION_DYNAMIC_REPORT'| translate: lang\" style=\"margin-left: 5px\" (click)=\"addField(filter)\" class=\"btn btn-sm btn-success feather-file-plus\">\r\n <!-- <span class=\"glyphicon glyphicon-plus-sign\"></span>\r\n Add Field -->\r\n </i>\r\n </div>\r\n <div class=\"col p-0\">\r\n <i [appTooltip]=\"'ADD_GROUP_CONDITION_DYNAMIC_REPORT'| translate: lang\" style=\"margin-left: 5px\" (click)=\"addGroup(filter)\" class=\"btn btn-sm btn-success feather-folder-plus\">\r\n <!-- <span class=\"glyphicon glyphicon-plus-sign\"></span>\r\n Add Group -->\r\n </i>\r\n </div>\r\n <div class=\"col p-0\">\r\n <i *ngIf=\"groupToRemove\" [appTooltip]=\"'REMOVE_GROUP_CONDITON_DYNAMIC_REPORT'| translate: lang\" style=\"margin-left: 2px;margin-top:5px\" (click)=\"removeGroup(groupToRemove)\"\r\n class=\"btn btn-sm btn-danger feather-trash-2\">\r\n <!-- <span class=\"glyphicon glyphicon-minus-sign\"></span>\r\n Remove Group -->\r\n </i>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"filter.value.filters && filter.value.filters.length > 0 \" class=\"child-query\"\r\n formArrayName=\"filters\">\r\n <!-- field condition -->\r\n <div *ngFor=\"let childFilter of filter.get('filters').controls; let fieldGroup = index;\">\r\n <div class=\"row mt-1\" *ngIf=\"!childFilter.value.logicalOperator; else nestedFilter\"\r\n style=\"margin-left: 2%;\" [formGroup]=\"childFilter\">\r\n <input hidden=\"true\" [value]=\"columnType\" class=\"form-control\" type=\"text\" formControlName=\"type\" />\r\n <div class=\"col\" style=\"margin-right: 5px;\">\r\n \r\n\r\n <select class=\"form-control\" formControlName=\"name\" (ngModelChange)=\"setValueType($event,childFilter)\">\r\n <option *ngFor=\"let item of totalCols\" [value]=\"item.netType\">\r\n {{item.columnName | translate: lang}}\r\n <!-- <input hidden=\"true\" [value]=\"item.columnType\" class=\"form-control input-sm\" type=\"text\" formControlName=\"type\"> -->\r\n </option>\r\n </select>\r\n </div>\r\n <!-- <input class=\"form-control input-sm\" type=\"text\" formControlName=\"type\"> -->\r\n <div class=\"col\" style=\"margin-right: 5px;\">\r\n <!-- <input class=\"form-control\" type=\"text\" formControlName=\"relationalOperator\" /> -->\r\n <select class=\"form-control\" formControlName=\"relationalOperator\" (ngModelChange)=\"setRelationalChange($event,childFilter)\">\r\n <option *ngFor=\"let item of relationalOperator\" [value]=\"item.value\" [appTooltip]=\"item.value | translate : lang\">\r\n {{item.value | translate : lang}}\r\n </option>\r\n </select>\r\n </div>\r\n <div class=\"col\" style=\"margin-right: 5px;\">\r\n <input class=\"form-control\" type=\"text\" formControlName=\"value\" (ngModelChange)=\"setValueChange($event,childFilter)\"/>\r\n </div>\r\n <div class=\"col\" style=\"margin-right: 5px;\">\r\n <i [appTooltip]=\"'REMOVE_CONDITON_DYNAMIC_REPORT'| translate: lang\" style=\"margin-left: 5px;margin-top:5px\" (click)=\"removeField(filter, fieldGroup)\"\r\n class=\"btn btn-sm btn-danger feather-trash-2\">\r\n <!-- <span class=\"glyphicon glyphicon-minus-sign\"></span>\r\n Remove -->\r\n </i>\r\n </div>\r\n </div>\r\n\r\n <ng-template #nestedFilter>\r\n <div class=\"mt-2\" [formGroup]=\"childFilter\">\r\n <ng-container\r\n *ngTemplateOutlet=\"queryTemplateRef; context: { filter: childFilter, groupToRemove: { group: filter, index: fieldGroup} }\">\r\n </ng-container>\r\n </div>\r\n </ng-template>\r\n\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-container [ngTemplateOutlet]=\"queryTemplateRef\"\r\n [ngTemplateOutletContext]=\"{ filter: mainForm, groupToRemove: null }\">\r\n </ng-container>\r\n\r\n </form>\r\n </div>\r\n <div>\r\n <div *ngIf=\"isDevMode\" [ngStyle]=\"{\r\n display: 'block',\r\n width: '100%',\r\n height: 'auto',\r\n whiteSpace: 'pre-wrap',\r\n overflowX: 'hidden',\r\n overflowY: 'auto'\r\n }\">\r\n {{filterFormJsonString}}\r\n </div>\r\n </div>\r\n</div>", styles: [".alert{float:left;margin-top:10px;width:100%}.col.p-0>i{margin-top:5px}.core-query-builder-container{max-height:600px;overflow-y:auto;padding:10px}\n"] }]
32556
+ }], ctorParameters: () => [{ type: i1$4.FormBuilder }, { type: MultiLanguageService }], propDecorators: { totalCols: [{
32768
32557
  type: Input
32769
- }], disabledLoopExpand: [{
32558
+ }], mainForm: [{
32770
32559
  type: Input
32771
- }], showCheckInheritance: [{
32560
+ }], filterStringInput: [{
32772
32561
  type: Input
32773
- }], inlineExtraTemplateRef: [{
32562
+ }], expressionInput: [{
32774
32563
  type: Input
32775
- }], itemDoubleClick: [{
32564
+ }], jsonEmitter: [{
32776
32565
  type: Output
32777
- }], itemClick: [{
32566
+ }], expressionEmitter: [{
32778
32567
  type: Output
32779
- }], container: [{
32780
- type: ViewChild,
32781
- args: ['container']
32782
- }], displayContent: [{
32783
- type: ViewChild,
32784
- args: ['displayContent']
32785
- }], reducedIconWrapper: [{
32786
- type: ViewChild,
32787
- args: ['reducedIconWrapper']
32788
32568
  }] } });
32789
32569
 
32790
- class CoreTopicPickerComponent extends CoreFormControlBaseComponent {
32791
- constructor(domService, renderer, appService, responseService, alertService, mls) {
32792
- super();
32793
- this.domService = domService;
32794
- this.renderer = renderer;
32795
- this.appService = appService;
32796
- this.responseService = responseService;
32797
- this.alertService = alertService;
32798
- this.mls = mls;
32570
+ class CoreRouteAccumulatorComponent {
32571
+ constructor(router) {
32572
+ this.router = router;
32573
+ this.processedRoutes = new Set(); // Store unique routes to prevent duplicates
32799
32574
  this.subscriptions = [];
32575
+ this.subscriptions.push(this.router.events
32576
+ .pipe(filter(event => event instanceof RoutesRecognized || event instanceof RouteConfigLoadEnd))
32577
+ .subscribe(event => {
32578
+ console.log("subscribe event", event);
32579
+ if (event instanceof RoutesRecognized) {
32580
+ // Handle eager-loaded routes
32581
+ this.onEagerModuleLoaded(event);
32582
+ }
32583
+ else if (event instanceof RouteConfigLoadEnd) {
32584
+ // Handle lazy-loaded modules
32585
+ this.onLazyModuleLoaded(event);
32586
+ }
32587
+ }));
32800
32588
  }
32801
- ngOnInit() {
32802
- this.subscriptions.push(this.mls.lang$.subscribe(x => this.lang = x));
32589
+ mapActivatedRouteToRouteData(activatedRoute) {
32590
+ const path = activatedRoute.url.map((segment) => segment.path).join('/'); // Construct path from segments
32591
+ return {
32592
+ path,
32593
+ children: activatedRoute.children.map((childRoute) => this.mapActivatedRouteToRouteData(childRoute)),
32594
+ };
32803
32595
  }
32804
- toggleExpanded() {
32805
- if (!this.disabled) {
32806
- this.expandState = !!!this.expandState;
32596
+ onLazyModuleLoaded(event) {
32597
+ console.log("CoreRouteAccumulatorComponent onLazyModuleLoaded", event);
32598
+ return;
32599
+ /*
32600
+ const accumulatedPath = event.route.path || ''; // Start with the current path
32601
+
32602
+ if (event.route.loadChildren) {
32603
+ event.route
32604
+ .loadChildren()
32605
+ .then((module: any) => {
32606
+ const routes = Array.isArray(module) ? module : module.routes || [];
32607
+ this.processRoutes(routes, accumulatedPath);
32608
+ })
32609
+ .catch((error) => {
32610
+ console.error('Error loading module:', error);
32611
+ });
32612
+ } else if (event.route._loadedRoutes) {
32613
+ this.processRoutes(event.route._loadedRoutes, accumulatedPath);
32614
+ } else if (event.route.children) {
32615
+ const mappedRoutes = event.route.children.map((child) =>
32616
+ child instanceof ActivatedRouteSnapshot
32617
+ ? this.mapActivatedRouteToRouteData(child)
32618
+ : { path: child.path, children: child.children || [] }
32619
+ );
32620
+ this.processRoutes(mappedRoutes, accumulatedPath);
32621
+ } else {
32622
+ this.saveRouteToDatabase({
32623
+ routePath: accumulatedPath,
32624
+ parentPath: null, // Root path has no parent
32625
+ });
32807
32626
  }
32627
+ */
32808
32628
  }
32809
- onTreeItemClick(event) {
32810
- if (this.value !== event['id'])
32811
- this.markAsTouched();
32812
- this.value = event['id'];
32813
- this.onChange(event['id']);
32814
- this.shownText = event['nameCode'];
32815
- this.toggleExpanded();
32629
+ onEagerModuleLoaded(event) {
32630
+ console.log("CoreRouteAccumulatorComponent onEagerModuleLoaded", event);
32631
+ this.saveRouteToDatabase({
32632
+ routePath: event.url,
32633
+ parentPath: "" // pending. will be updated accumulately on lazy loaded event, based on path and children
32634
+ });
32635
+ /*
32636
+ const accumulatedPath = event.state.url || ''; // Start with the current URL
32637
+
32638
+ const mappedRoutes = event.state.root.children.map((child) =>
32639
+ this.mapActivatedRouteToRouteData(child)
32640
+ );
32641
+
32642
+ this.processRoutes(mappedRoutes, accumulatedPath);
32643
+ */
32816
32644
  }
32817
- writeValue(obj) {
32818
- this.value = obj;
32819
- if (!!!obj) {
32820
- this.shownText = "";
32645
+ // Save route to the database, ensuring uniqueness with processedRoutes
32646
+ saveRouteToDatabase(routeData) {
32647
+ if (!this.processedRoutes.has(routeData.routePath)) {
32648
+ this.processedRoutes.add(routeData.routePath); // Mark as processed
32649
+ console.log(`Saving route: ${routeData.routePath}, Parent: ${routeData.parentPath}`);
32650
+ // Implement actual DB logic here
32821
32651
  }
32822
- else {
32823
- this.loading = true;
32824
- this.subscriptions.push(this.appService.get(this.getByIdApi + "?id=" + obj.toString()).subscribe(x => {
32825
- this.loading = false;
32826
- if (x.ok && x.status === 200) {
32827
- const body = x.body;
32828
- //this.responseService.resolve(body);
32829
- if (body.statusCode === 200) {
32830
- this.shownText = body.innerBody['nameCode'];
32831
- }
32832
- else {
32833
- this.alertService.error(this.mls.trans(body.messageCode, this.lang), alertOptions);
32834
- }
32835
- }
32836
- else {
32837
- //this.alertService.error(JSON.stringify(x, null, 2), noneAutoClosedAlertOptions)
32838
- }
32839
- }));
32652
+ }
32653
+ processRoutes(routes, accumulatedPath) {
32654
+ for (const route of routes) {
32655
+ let fullPath = route.path || ''; // Current route path
32656
+ // Handle true root modules
32657
+ if (this.isRootModule(route)) {
32658
+ fullPath = `/${fullPath}`.replace(/\/+/g, '/'); // Root modules start a new hierarchy
32659
+ accumulatedPath = fullPath; // Reset the accumulated path
32660
+ }
32661
+ else if (accumulatedPath) {
32662
+ // Append the current route to the accumulated path
32663
+ fullPath = `${accumulatedPath}/${route.path}`.replace(/\/+/g, '/');
32664
+ }
32665
+ else {
32666
+ // Fallback for non-root routes without accumulatedPath
32667
+ fullPath = `/${route.path}`.replace(/\/+/g, '/');
32668
+ }
32669
+ // Avoid duplicate processing
32670
+ if (this.processedRoutes.has(fullPath)) {
32671
+ continue;
32672
+ }
32673
+ // Save the route
32674
+ this.saveRouteToDatabase({
32675
+ routePath: fullPath,
32676
+ parentPath: accumulatedPath || null,
32677
+ });
32678
+ this.processedRoutes.add(fullPath);
32679
+ // Recursively process children, if any
32680
+ if (route.children) {
32681
+ this.processRoutes(route.children, fullPath);
32682
+ }
32840
32683
  }
32841
32684
  }
32842
- onClickClear() {
32843
- this.writeValue(null);
32844
- this.onChange(null);
32845
- this.shownText = "";
32685
+ // Helper method to identify root modules
32686
+ isRootModule(route) {
32687
+ const ROOT_MODULES = ['oauth-callback', 'root', 'cms', 'developer-doc', 'online-users', 'menu', 'home', 'auth', 'sys']; // Add other known root modules or patterns here
32688
+ return ROOT_MODULES.some(rootModule => route.path.startsWith(rootModule));
32689
+ }
32690
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreRouteAccumulatorComponent, deps: [{ token: i1$2.Router }], target: i0.ɵɵFactoryTarget.Component }); }
32691
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.1", type: CoreRouteAccumulatorComponent, isStandalone: true, selector: "core-route-accumulator", ngImport: i0, template: "<p>core-route-accumulator works!</p>\r\n", styles: [""] }); }
32692
+ }
32693
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreRouteAccumulatorComponent, decorators: [{
32694
+ type: Component,
32695
+ args: [{ selector: 'core-route-accumulator', imports: [], template: "<p>core-route-accumulator works!</p>\r\n" }]
32696
+ }], ctorParameters: () => [{ type: i1$2.Router }] });
32697
+
32698
+ class CoreRoutingHistoryComponent extends BaseComponent {
32699
+ constructor(mls, routingService) {
32700
+ super(mls);
32701
+ this.mls = mls;
32702
+ this.routingService = routingService;
32703
+ this.items = [];
32704
+ this.subscriptions.push(this.routingService.routingHistory$.subscribe(x => this.items = x.reverse()));
32705
+ }
32706
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreRoutingHistoryComponent, deps: [{ token: MultiLanguageService }, { token: RoutingService }], target: i0.ɵɵFactoryTarget.Component }); }
32707
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.1", type: CoreRoutingHistoryComponent, isStandalone: true, selector: "core-routing-history", usesInheritance: true, ngImport: i0, template: "<div class=\"core-routing-history-container\">\r\n <ul>\r\n <li *ngFor=\"let item of items; let i = index\">\r\n <span>\r\n {{ i + 1 }}\r\n </span>\r\n </li>\r\n </ul>\r\n</div>", styles: [".core-routing-history-container{width:100%;height:auto}.core-routing-history-container>ul{overflow-x:auto;overflow-y:hidden;display:flex;align-items:center;justify-content:flex-end;height:40px}.core-routing-history-container>ul>li>span{display:flex;align-items:center;justify-content:center;width:40px;height:40px;overflow:hidden;text-overflow:ellipsis;cursor:pointer;margin:0 5px;border:solid 1px darkgray}.core-routing-history-container>ul>li>span:hover{background-color:#a9a9a9}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] }); }
32708
+ }
32709
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreRoutingHistoryComponent, decorators: [{
32710
+ type: Component,
32711
+ args: [{ selector: 'core-routing-history', imports: [
32712
+ CommonModule
32713
+ ], template: "<div class=\"core-routing-history-container\">\r\n <ul>\r\n <li *ngFor=\"let item of items; let i = index\">\r\n <span>\r\n {{ i + 1 }}\r\n </span>\r\n </li>\r\n </ul>\r\n</div>", styles: [".core-routing-history-container{width:100%;height:auto}.core-routing-history-container>ul{overflow-x:auto;overflow-y:hidden;display:flex;align-items:center;justify-content:flex-end;height:40px}.core-routing-history-container>ul>li>span{display:flex;align-items:center;justify-content:center;width:40px;height:40px;overflow:hidden;text-overflow:ellipsis;cursor:pointer;margin:0 5px;border:solid 1px darkgray}.core-routing-history-container>ul>li>span:hover{background-color:#a9a9a9}\n"] }]
32714
+ }], ctorParameters: () => [{ type: MultiLanguageService }, { type: RoutingService }] });
32715
+
32716
+ class CoreSalaryPolicyPickerComponent extends CoreFormControlBaseComponent {
32717
+ writeValue(e) {
32718
+ this.value = e;
32719
+ }
32720
+ constructor(appService) {
32721
+ super();
32722
+ this.appService = appService;
32723
+ this.items = [];
32724
+ this.subscriptions = [];
32846
32725
  }
32847
32726
  ngAfterViewInit() {
32848
- /**
32849
- * This events get called by all clicks on the page
32850
- */
32851
- this.listenerFn = this.renderer.listen('window', 'click', (e) => {
32852
- /*
32853
- * handle click outside
32854
- */
32855
- if (this.container && !!!this.container.nativeElement.contains(e.target)) {
32856
- this.expandState = false;
32857
- }
32727
+ setTimeout(() => {
32728
+ this.subscriptions.push(this.appService.get('/api/PaSalaryPolicy/ScanSalaryPolicys').subscribe(x => {
32729
+ if (x.ok && x.status === 200 && x.body?.statusCode === 200) {
32730
+ this.items = x.body?.innerBody;
32731
+ }
32732
+ }));
32858
32733
  });
32859
- const maxZIndex = this.domService.getMaxZIndex();
32860
- this.container.nativeElement.style.setProperty('--max-z-index', maxZIndex + 1);
32861
- if (!!this.popupHeight)
32862
- this.container.nativeElement.style.setProperty('--popup-height', this.popupHeight);
32734
+ }
32735
+ onClick(item, e) {
32736
+ e.stopPropagation();
32737
+ this.writeValue(item.id);
32738
+ this.onChange(item.id);
32863
32739
  }
32864
32740
  ngOnDestroy() {
32865
- if (this.listenerFn)
32866
- this.listenerFn();
32867
- this.subscriptions.map((x) => x?.unsubscribe());
32741
+ this.subscriptions.forEach(x => x?.unsubscribe());
32868
32742
  }
32869
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreTopicPickerComponent, deps: [{ token: DomService }, { token: i0.Renderer2 }, { token: AppService }, { token: ResponseService }, { token: AlertService }, { token: MultiLanguageService }], target: i0.ɵɵFactoryTarget.Component }); }
32870
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: CoreTopicPickerComponent, isStandalone: true, selector: "core-topic-picker", inputs: { popupHeight: "popupHeight", getByIdApi: "getByIdApi" }, providers: [
32743
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreSalaryPolicyPickerComponent, deps: [{ token: AppService }], target: i0.ɵɵFactoryTarget.Component }); }
32744
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: CoreSalaryPolicyPickerComponent, isStandalone: true, selector: "core-salary-policy-picker", providers: [
32871
32745
  {
32872
32746
  provide: NG_VALUE_ACCESSOR,
32873
32747
  multi: true,
32874
- useExisting: CoreTopicPickerComponent
32748
+ useExisting: CoreSalaryPolicyPickerComponent
32875
32749
  }
32876
- ], viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true }], usesInheritance: true, ngImport: i0, template: "@if (loading) {\n <app-threedots></app-threedots>\n}\n<div #container class=\"core-topic-picker-container\" [class.d-none]=\"loading\">\n <input type=\"checkbox\" class=\"expand-state\" [(ngModel)]=\"expandState\">\n <input class=\"value\" [value]=\"value\">\n <label type=\"text\" class=\"text form-control\" [class.form-control-disabled]=\"disabled\">\n <span [appTooltip]=\"shownText\">{{ !!loading ? \"...\" : shownText }}</span>\n <div class=\"icon\" (click)=\"toggleExpanded()\">\n <i class=\"feather-chevrons-down\"></i>\n </div>\n\n <div class=\"clear-icon-wrapper\" [class.d-none]=\"!!disabled || !!!value\" (click)=\"onClickClear()\">\n <div class=\"flex-wrapper\" [appTooltip]=\"'UI.CORE_CONTOL_COMMON_CLEAR' | translate: lang\">\n <i class=\"feather-x\"></i>\n </div>\n </div>\n \n </label>\n @if (!!expandState) {\n <div class=\"dropdown\" [class.form-control-disabled]=\"disabled\">\n <core-topic-tree [translateText]=\"true\" (itemClick)=\"onTreeItemClick($event)\"></core-topic-tree>\n </div>\n }\n\n</div>", styles: [".core-topic-picker-container{position:relative;display:block;--indicator-height: 0px;--search-bg-color: white;--search-border-color: #D1D1D1;--search-item-hover-bg: #358ccb;--search-item-hover-color: white;--dropdown-bg: lightyellow;--arrow-color: #358ccb;--height: var(--size-form-control-height);--item-height: 50px;--max-z-index: 0;--search-height: 38px;--popup-height: 460px}.core-topic-picker-container input.expand-state,.core-topic-picker-container .value{display:none}.core-topic-picker-container label.text{width:100%;height:var(--height);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;display:flex;align-items:center;justify-content:space-between}.core-topic-picker-container label.text .clear-icon-wrapper{display:none;position:absolute;background-color:transparent;right:45px;top:2px;width:44px;height:44px;border-radius:.375rem;cursor:pointer}.core-topic-picker-container label.text .clear-icon-wrapper>.flex-wrapper{width:44px;height:44px;display:flex;align-items:center;justify-content:center}.core-topic-picker-container label.text .clear-icon-wrapper>.flex-wrapper>i{color:#848484;font-size:20px}.core-topic-picker-container label.text:hover>.clear-icon-wrapper{display:block}.core-topic-picker-container label.text span{width:calc(100% - var(--height));overflow-x:hidden;text-overflow:ellipsis;color:inherit}.core-topic-picker-container label.text div.icon{display:flex;align-items:center;justify-content:center;position:absolute;right:3px;top:3px;width:calc(var(--height) - 6px);height:calc(var(--height) - 6px);background-color:#e9e9e9;border-radius:3px;cursor:pointer}.core-topic-picker-container label.text div.icon i{width:28px;height:28px;font-size:28px;color:#848484}.core-topic-picker-container .dropdown{display:block;position:absolute;width:800px;min-width:100%;max-height:0px;overflow-x:auto;overflow-y:hidden;background-color:#fff;font-size:15px;box-shadow:0 1rem 3rem #0000002e;transition:.25s linear;z-index:calc(var(--max-z-index) + 1)}.core-topic-picker-container .dropdown ul{padding-left:6px}.core-topic-picker-container .dropdown ul>li{display:flex;align-items:center;cursor:pointer;padding:0px var(--size-scrollbar-width);transition:.25s linear}.core-topic-picker-container .dropdown ul>li>label{width:100%}.core-topic-picker-container .dropdown ul>li:hover{background-color:var(--search-item-hover-bg);color:var(--search-item-hover-color);transition:.25s linear}.core-topic-picker-container input.expand-state:checked~.dropdown{border:1px solid #ced4da;margin-top:2px;max-height:var(--popup-height);border-bottom-left-radius:.375rem;border-bottom-right-radius:.375rem;transition:.25s linear}.core-topic-picker-container input.search{margin:0;width:100%;border:0;border-bottom:1px solid var(--search-border-color);background-color:var(--search-bg-color);position:sticky;top:0;height:38px;padding:6px 12px;font-size:15px}.core-topic-picker-container input.search:focus{outline:none}\n"], dependencies: [{ kind: "directive", type: TooltipDirective, selector: "[appTooltip]", inputs: ["color", "backgroundColor", "appTooltip", "showAnyway", "position"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$4.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ThreedotsComponent, selector: "app-threedots" }, { kind: "component", type: CoreTopicTreeComponent, selector: "core-topic-tree", inputs: ["lineColor", "translateText", "fullWidthMode", "accessorMode", "fullRendering", "height", "disabledLoopExpand", "showCheckInheritance", "inlineExtraTemplateRef"], outputs: ["itemDoubleClick", "itemClick"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
32750
+ ], usesInheritance: true, ngImport: i0, template: "<div class=\"core-salary-policy-picker-container\">\r\n @for(item of items; track $index) {\r\n <div class=\"policy-code-wrapper d-flex d-flex-between\">\r\n <div class=\"d-flex d-flex-center policy-code\" [class.default]=\"!!item.isDefault\" [class.active]=\"item.id === value\" (click)=\"onClick(item, $event)\">{{ item.code }}</div>\r\n </div>\r\n }\r\n</div>", styles: [".core-salary-policy-picker-container .policy-code-wrapper{max-width:56px}.core-salary-policy-picker-container .policy-code{width:24px;height:24px;border-radius:50%;background-color:#5f9ea0;color:#fff;cursor:pointer;opacity:.2}.core-salary-policy-picker-container .policy-code.default{background-color:var(--color-basic-orange)}.core-salary-policy-picker-container .policy-code.active{opacity:1}\n"] }); }
32877
32751
  }
32878
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreTopicPickerComponent, decorators: [{
32752
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreSalaryPolicyPickerComponent, decorators: [{
32879
32753
  type: Component,
32880
- args: [{ selector: 'core-topic-picker', imports: [
32881
- TooltipDirective,
32882
- FormsModule,
32883
- ThreedotsComponent,
32884
- CoreTopicTreeComponent,
32885
- TranslatePipe,
32754
+ args: [{ selector: 'core-salary-policy-picker', imports: [], providers: [
32755
+ {
32756
+ provide: NG_VALUE_ACCESSOR,
32757
+ multi: true,
32758
+ useExisting: CoreSalaryPolicyPickerComponent
32759
+ }
32760
+ ], template: "<div class=\"core-salary-policy-picker-container\">\r\n @for(item of items; track $index) {\r\n <div class=\"policy-code-wrapper d-flex d-flex-between\">\r\n <div class=\"d-flex d-flex-center policy-code\" [class.default]=\"!!item.isDefault\" [class.active]=\"item.id === value\" (click)=\"onClick(item, $event)\">{{ item.code }}</div>\r\n </div>\r\n }\r\n</div>", styles: [".core-salary-policy-picker-container .policy-code-wrapper{max-width:56px}.core-salary-policy-picker-container .policy-code{width:24px;height:24px;border-radius:50%;background-color:#5f9ea0;color:#fff;cursor:pointer;opacity:.2}.core-salary-policy-picker-container .policy-code.default{background-color:var(--color-basic-orange)}.core-salary-policy-picker-container .policy-code.active{opacity:1}\n"] }]
32761
+ }], ctorParameters: () => [{ type: AppService }] });
32762
+
32763
+ class CoreSeenByComponent extends CoreFormControlBaseComponent {
32764
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreSeenByComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
32765
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: CoreSeenByComponent, isStandalone: true, selector: "core-seen-by", providers: [
32766
+ {
32767
+ provide: NG_VALUE_ACCESSOR,
32768
+ multi: true,
32769
+ useExisting: CoreSeenByComponent
32770
+ }
32771
+ ], usesInheritance: true, ngImport: i0, template: "<div class=\"core-seen-by-container\">\n @if (value) {\n @for (item of value; track $index) {\n <div class=\"avatar-wrapper\" [ngStyle]=\"{\n zIndex: $index,\n left: (36 + 2) * $index + 'px'\n }\">\n <img [src]=\"item.avatar | mapAvatarToServer\" appImageErrorResolver>\n </div>\n }\n }\n</div>", styles: [".core-seen-by-container{display:block;position:relative;max-width:100%;overflow-x:auto;height:36px}.core-seen-by-container>.avatar-wrapper{display:block;position:absolute;width:36px;height:36px;border-radius:50%;top:0;cursor:pointer}.core-seen-by-container>.avatar-wrapper>img{width:36px;height:36px;border-radius:50%;transform:none!important}.core-seen-by-container>.avatar-wrapper>img :hover{transform:none!important}\n"], dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "pipe", type: MapAvatarToServerPipe, name: "mapAvatarToServer" }, { kind: "directive", type: ImageErrorResolverDirective, selector: "[appImageErrorResolver]", inputs: ["type", "isFemale"] }] }); }
32772
+ }
32773
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreSeenByComponent, decorators: [{
32774
+ type: Component,
32775
+ args: [{ selector: 'core-seen-by', imports: [
32776
+ NgStyle,
32777
+ MapAvatarToServerPipe,
32778
+ ImageErrorResolverDirective
32886
32779
  ], providers: [
32887
32780
  {
32888
32781
  provide: NG_VALUE_ACCESSOR,
32889
32782
  multi: true,
32890
- useExisting: CoreTopicPickerComponent
32783
+ useExisting: CoreSeenByComponent
32891
32784
  }
32892
- ], template: "@if (loading) {\n <app-threedots></app-threedots>\n}\n<div #container class=\"core-topic-picker-container\" [class.d-none]=\"loading\">\n <input type=\"checkbox\" class=\"expand-state\" [(ngModel)]=\"expandState\">\n <input class=\"value\" [value]=\"value\">\n <label type=\"text\" class=\"text form-control\" [class.form-control-disabled]=\"disabled\">\n <span [appTooltip]=\"shownText\">{{ !!loading ? \"...\" : shownText }}</span>\n <div class=\"icon\" (click)=\"toggleExpanded()\">\n <i class=\"feather-chevrons-down\"></i>\n </div>\n\n <div class=\"clear-icon-wrapper\" [class.d-none]=\"!!disabled || !!!value\" (click)=\"onClickClear()\">\n <div class=\"flex-wrapper\" [appTooltip]=\"'UI.CORE_CONTOL_COMMON_CLEAR' | translate: lang\">\n <i class=\"feather-x\"></i>\n </div>\n </div>\n \n </label>\n @if (!!expandState) {\n <div class=\"dropdown\" [class.form-control-disabled]=\"disabled\">\n <core-topic-tree [translateText]=\"true\" (itemClick)=\"onTreeItemClick($event)\"></core-topic-tree>\n </div>\n }\n\n</div>", styles: [".core-topic-picker-container{position:relative;display:block;--indicator-height: 0px;--search-bg-color: white;--search-border-color: #D1D1D1;--search-item-hover-bg: #358ccb;--search-item-hover-color: white;--dropdown-bg: lightyellow;--arrow-color: #358ccb;--height: var(--size-form-control-height);--item-height: 50px;--max-z-index: 0;--search-height: 38px;--popup-height: 460px}.core-topic-picker-container input.expand-state,.core-topic-picker-container .value{display:none}.core-topic-picker-container label.text{width:100%;height:var(--height);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;display:flex;align-items:center;justify-content:space-between}.core-topic-picker-container label.text .clear-icon-wrapper{display:none;position:absolute;background-color:transparent;right:45px;top:2px;width:44px;height:44px;border-radius:.375rem;cursor:pointer}.core-topic-picker-container label.text .clear-icon-wrapper>.flex-wrapper{width:44px;height:44px;display:flex;align-items:center;justify-content:center}.core-topic-picker-container label.text .clear-icon-wrapper>.flex-wrapper>i{color:#848484;font-size:20px}.core-topic-picker-container label.text:hover>.clear-icon-wrapper{display:block}.core-topic-picker-container label.text span{width:calc(100% - var(--height));overflow-x:hidden;text-overflow:ellipsis;color:inherit}.core-topic-picker-container label.text div.icon{display:flex;align-items:center;justify-content:center;position:absolute;right:3px;top:3px;width:calc(var(--height) - 6px);height:calc(var(--height) - 6px);background-color:#e9e9e9;border-radius:3px;cursor:pointer}.core-topic-picker-container label.text div.icon i{width:28px;height:28px;font-size:28px;color:#848484}.core-topic-picker-container .dropdown{display:block;position:absolute;width:800px;min-width:100%;max-height:0px;overflow-x:auto;overflow-y:hidden;background-color:#fff;font-size:15px;box-shadow:0 1rem 3rem #0000002e;transition:.25s linear;z-index:calc(var(--max-z-index) + 1)}.core-topic-picker-container .dropdown ul{padding-left:6px}.core-topic-picker-container .dropdown ul>li{display:flex;align-items:center;cursor:pointer;padding:0px var(--size-scrollbar-width);transition:.25s linear}.core-topic-picker-container .dropdown ul>li>label{width:100%}.core-topic-picker-container .dropdown ul>li:hover{background-color:var(--search-item-hover-bg);color:var(--search-item-hover-color);transition:.25s linear}.core-topic-picker-container input.expand-state:checked~.dropdown{border:1px solid #ced4da;margin-top:2px;max-height:var(--popup-height);border-bottom-left-radius:.375rem;border-bottom-right-radius:.375rem;transition:.25s linear}.core-topic-picker-container input.search{margin:0;width:100%;border:0;border-bottom:1px solid var(--search-border-color);background-color:var(--search-bg-color);position:sticky;top:0;height:38px;padding:6px 12px;font-size:15px}.core-topic-picker-container input.search:focus{outline:none}\n"] }]
32893
- }], ctorParameters: () => [{ type: DomService }, { type: i0.Renderer2 }, { type: AppService }, { type: ResponseService }, { type: AlertService }, { type: MultiLanguageService }], propDecorators: { popupHeight: [{
32785
+ ], template: "<div class=\"core-seen-by-container\">\n @if (value) {\n @for (item of value; track $index) {\n <div class=\"avatar-wrapper\" [ngStyle]=\"{\n zIndex: $index,\n left: (36 + 2) * $index + 'px'\n }\">\n <img [src]=\"item.avatar | mapAvatarToServer\" appImageErrorResolver>\n </div>\n }\n }\n</div>", styles: [".core-seen-by-container{display:block;position:relative;max-width:100%;overflow-x:auto;height:36px}.core-seen-by-container>.avatar-wrapper{display:block;position:absolute;width:36px;height:36px;border-radius:50%;top:0;cursor:pointer}.core-seen-by-container>.avatar-wrapper>img{width:36px;height:36px;border-radius:50%;transform:none!important}.core-seen-by-container>.avatar-wrapper>img :hover{transform:none!important}\n"] }]
32786
+ }] });
32787
+
32788
+ class CoreSubFormGroupComponent extends CorePageEditComponent {
32789
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreSubFormGroupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
32790
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.1", type: CoreSubFormGroupComponent, isStandalone: true, selector: "core-sub-form-group", usesInheritance: true, ngImport: i0, template: "<core-form *ngIf=\"!!sections.length\" [formName]=\"'form'\" [inputSections]=\"sections\" [mode$]=\"mode$\" (onFormCreated)=\"onFormCreatedLocal($event)\"></core-form>\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CoreFormComponent, selector: "core-form", inputs: ["formName", "width", "submitText", "leftInputSections", "leftInputSectionsFlexSize", "inputSections", "mode$", "bottomTemplateRef", "customFormButtonItems", "showCaptionButton", "disableSaveButton", "disableCancelButton", "checkError$"], outputs: ["onFormCreated", "onFormRefCreated", "onSubmit", "onSave", "onCancal", "buttonClick"] }] }); }
32791
+ }
32792
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreSubFormGroupComponent, decorators: [{
32793
+ type: Component,
32794
+ args: [{ selector: 'core-sub-form-group', imports: [
32795
+ CommonModule,
32796
+ CoreFormComponent
32797
+ ], template: "<core-form *ngIf=\"!!sections.length\" [formName]=\"'form'\" [inputSections]=\"sections\" [mode$]=\"mode$\" (onFormCreated)=\"onFormCreatedLocal($event)\"></core-form>\r\n" }]
32798
+ }] });
32799
+
32800
+ class CoreTabListComponent extends BaseComponent {
32801
+ constructor(mls, appService) {
32802
+ super(mls);
32803
+ this.mls = mls;
32804
+ this.appService = appService;
32805
+ this.rowClick = new EventEmitter();
32806
+ this.rowDoubleClick = new EventEmitter();
32807
+ this.selectedIdsChange = new EventEmitter();
32808
+ this.corePageHeaderButtonClick = new EventEmitter();
32809
+ this.headers = []; // based on statuses
32810
+ this.contents = []; // based on statuses, constructed from core-table ref instances
32811
+ this.selectedIds = [];
32812
+ }
32813
+ onCoreTabsHeaderClick(event) {
32814
+ }
32815
+ ngAfterViewInit() {
32816
+ setTimeout(() => {
32817
+ if (!!this.statusOptionsApi) {
32818
+ this.subscriptions.push(this.mls.lang$.subscribe(x => {
32819
+ this.subscriptions.push(this.appService.get(this.statusOptionsApi + '?lang=' + x).subscribe((x) => {
32820
+ if (x.ok && x.status === 200 && x.body?.statusCode === 200) {
32821
+ const body = x.body;
32822
+ const newHeaders = [];
32823
+ body.innerBody.forEach((m) => newHeaders.push(m.text));
32824
+ this.headers = newHeaders;
32825
+ }
32826
+ }));
32827
+ }));
32828
+ }
32829
+ });
32830
+ }
32831
+ onSelectedIdsChange(e) {
32832
+ this.selectedIds = e;
32833
+ console.log(this.selectedIds);
32834
+ }
32835
+ onCorePageHeaderButtonClick(e) {
32836
+ this.corePageHeaderButtonClick.emit(e);
32837
+ }
32838
+ onRowClick(e) {
32839
+ this.rowClick.emit(e);
32840
+ }
32841
+ onRowDoubleClick(event) {
32842
+ this.rowDoubleClick.emit(event);
32843
+ }
32844
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreTabListComponent, deps: [{ token: MultiLanguageService }, { token: AppService }], target: i0.ɵɵFactoryTarget.Component }); }
32845
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.1", type: CoreTabListComponent, isStandalone: true, selector: "core-tab-list", inputs: { title: "title", height: "height", headerLineHeight: "headerLineHeight", apiDefinition: "apiDefinition", columns: "columns", editRoute: "editRoute", crud: "crud", frozen: "frozen", generateTemplateRequest: "generateTemplateRequest", importPreviewPath: "importPreviewPath", outerSort: "outerSort", outerInOperators: "outerInOperators", outerParam$: "outerParam$", datePeriodComparisonFor: "datePeriodComparisonFor", datePeriodComparisonForLabelKey: "datePeriodComparisonForLabelKey", statusInclusionFor: "statusInclusionFor", statusOptionsApi: "statusOptionsApi" }, outputs: { rowClick: "rowClick", rowDoubleClick: "rowDoubleClick", selectedIdsChange: "selectedIdsChange", corePageHeaderButtonClick: "corePageHeaderButtonClick" }, viewQueries: [{ propertyName: "corePageList", first: true, predicate: ["corePageList"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<core-tabs [headers]=\"headers\" [contents]=\"[]\" [height]=\"55\" [headerLineHeight]=\"headerLineHeight\"\r\n (onHeaderClick)=\"onCoreTabsHeaderClick($event)\">\r\n</core-tabs>\r\n\r\n\r\n<core-page-list [height]=\"height\" [hideHeader]=\"true\" [apiDefinition]=\"apiDefinition\" [columns]=\"columns\"\r\n [editRoute]=\"editRoute\" [crud]=\"crud\" [title]=\"title\" *ngIf=\"!!avatar\" [outerParam$]=\"outerParam$\"\r\n [outerInOperators]=\"outerInOperators\" [autoResizeWithWindow]=\"true\" [selfResolveCorePageHeaderButtonClick]=\"true\"\r\n (rowDoubleClick)=\"onRowDoubleClick($event)\" (rowClick)=\"onRowClick($event)\"\r\n (corePageHeaderButtonClick)=\"onCorePageHeaderButtonClick($event)\" (selectedIdsChange)=\"onSelectedIdsChange($event)\"\r\n [frozen]=\"3\" [outerSort]=\"outerSort\" [generateTemplateRequest]=\"generateTemplateRequest\"\r\n [importPreviewPath]=\"'staffprofile-import'\"></core-page-list>\r\n\r\n\r\n<ng-template #avatar let-avatar=\"context.avatar\">\r\n <img [src]=\"avatar | mapAvatarToServer\" class=\"in-table-avatar\" appImageErrorResolver>\r\n</ng-template>\r\n\r\n<!-- [showParamKit]=\"true\"\r\n[datePeriodComparisonFor]=\"datePeriodComparisonFor\"\r\n[datePeriodComparisonForLabelKey]=\"datePeriodComparisonForLabelKey\"\r\n[hideStatusInclusion]=\"false\"\r\n[statusInclusionFor]=\"statusInclusionFor\"\r\n[statusInclusionForLabelKey]=\"statusInclusionForLabelKey\"\r\n[statusOptionsApi]=\"statusOptionsApi\" -->", styles: [""], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CoreTabsComponent, selector: "core-tabs", inputs: ["headers", "contents", "headerTools", "height", "headerLineHeight"], outputs: ["onHeaderClick", "onToolItemClick"] }, { kind: "component", type: CorePageListComponent, selector: "core-page-list", inputs: ["normalMode", "hideHeader", "hideButtonGroup", "seekerMode", "mccMode", "height", "headerWrap", "headerFirstRowHeight", "enableTimeZoneConverterForDateTimePeriodParameters", "showParamKit", "enableFilterKit", "datePeriodComparisonFor", "datePeriodComparisonForLabelKey", "statusInclusionFor", "statusInclusionForLabelKey", "statusOptionsApi", "statusOptions$", "showOrgParam", "showOrgParamDropdown", "hideGeneralSearch", "hideDatePeriodComparison", "hideStatusInclusion", "filterOperators$", "camelCaseDtoStatusIdField", "gridStatusColumn", "title", "hasIdOfStringType", "hideCheck", "apiDefinition", "columns", "useTheseColumns", "hideOrgTree", "frozen", "inlineTools", "inlineToolItems", "editRoute", "crud", "showListInlineTools", "top", "left", "hideLeft", "outerParam$", "outerFilter$", "outerSort", "outerFilterOperators", "outerInOperators", "autoResizeWithWindow", "extraManualOffset", "wrap", "rowHeight", "selfResolveCorePageHeaderButtonClick", "clearData$", "deleteValidateFn", "generateTemplateRequest", "importPreviewPath", "columnSearchDefaultOpen", "fixedPageSize", "disableDoubleClick", "noPaddingCell", "disableHighlightOnClick", "loading$", "excludedIds$", "disableDialogInformationLines", "changeTracking", "primaryKey", "changedItems$", "tabMode", "paramRows", "disableFilterHub", "autoColumnFitAvailableSpace", "ignoredDefaultActions", "checkboxExplicity"], outputs: ["corePageHeaderButtonClick", "rowClick", "rowDoubleClick", "selectedIdsChange", "selectedDataChange", "onInstanceCreated", "onInputFileBase64DataReady", "listChange"] }, { kind: "pipe", type: MapAvatarToServerPipe, name: "mapAvatarToServer" }, { kind: "directive", type: ImageErrorResolverDirective, selector: "[appImageErrorResolver]", inputs: ["type", "isFemale"] }] }); }
32846
+ }
32847
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoreTabListComponent, decorators: [{
32848
+ type: Component,
32849
+ args: [{ selector: 'core-tab-list', imports: [
32850
+ NgIf,
32851
+ CoreTabsComponent,
32852
+ CorePageListComponent,
32853
+ MapAvatarToServerPipe,
32854
+ ImageErrorResolverDirective
32855
+ ], template: "<core-tabs [headers]=\"headers\" [contents]=\"[]\" [height]=\"55\" [headerLineHeight]=\"headerLineHeight\"\r\n (onHeaderClick)=\"onCoreTabsHeaderClick($event)\">\r\n</core-tabs>\r\n\r\n\r\n<core-page-list [height]=\"height\" [hideHeader]=\"true\" [apiDefinition]=\"apiDefinition\" [columns]=\"columns\"\r\n [editRoute]=\"editRoute\" [crud]=\"crud\" [title]=\"title\" *ngIf=\"!!avatar\" [outerParam$]=\"outerParam$\"\r\n [outerInOperators]=\"outerInOperators\" [autoResizeWithWindow]=\"true\" [selfResolveCorePageHeaderButtonClick]=\"true\"\r\n (rowDoubleClick)=\"onRowDoubleClick($event)\" (rowClick)=\"onRowClick($event)\"\r\n (corePageHeaderButtonClick)=\"onCorePageHeaderButtonClick($event)\" (selectedIdsChange)=\"onSelectedIdsChange($event)\"\r\n [frozen]=\"3\" [outerSort]=\"outerSort\" [generateTemplateRequest]=\"generateTemplateRequest\"\r\n [importPreviewPath]=\"'staffprofile-import'\"></core-page-list>\r\n\r\n\r\n<ng-template #avatar let-avatar=\"context.avatar\">\r\n <img [src]=\"avatar | mapAvatarToServer\" class=\"in-table-avatar\" appImageErrorResolver>\r\n</ng-template>\r\n\r\n<!-- [showParamKit]=\"true\"\r\n[datePeriodComparisonFor]=\"datePeriodComparisonFor\"\r\n[datePeriodComparisonForLabelKey]=\"datePeriodComparisonForLabelKey\"\r\n[hideStatusInclusion]=\"false\"\r\n[statusInclusionFor]=\"statusInclusionFor\"\r\n[statusInclusionForLabelKey]=\"statusInclusionForLabelKey\"\r\n[statusOptionsApi]=\"statusOptionsApi\" -->" }]
32856
+ }], ctorParameters: () => [{ type: MultiLanguageService }, { type: AppService }], propDecorators: { corePageList: [{
32857
+ type: ViewChild,
32858
+ args: ['corePageList']
32859
+ }], title: [{
32894
32860
  type: Input
32895
- }], getByIdApi: [{
32861
+ }], height: [{
32896
32862
  type: Input
32897
- }], container: [{
32898
- type: ViewChild,
32899
- args: ['container']
32863
+ }], headerLineHeight: [{
32864
+ type: Input
32865
+ }], apiDefinition: [{
32866
+ type: Input,
32867
+ args: [{ required: true }]
32868
+ }], columns: [{
32869
+ type: Input,
32870
+ args: [{ required: true }]
32871
+ }], editRoute: [{
32872
+ type: Input
32873
+ }], crud: [{
32874
+ type: Input
32875
+ }], frozen: [{
32876
+ type: Input
32877
+ }], generateTemplateRequest: [{
32878
+ type: Input
32879
+ }], importPreviewPath: [{
32880
+ type: Input
32881
+ }], outerSort: [{
32882
+ type: Input
32883
+ }], outerInOperators: [{
32884
+ type: Input
32885
+ }], outerParam$: [{
32886
+ type: Input
32887
+ }], datePeriodComparisonFor: [{
32888
+ type: Input
32889
+ }], datePeriodComparisonForLabelKey: [{
32890
+ type: Input
32891
+ }], statusInclusionFor: [{
32892
+ type: Input
32893
+ }], statusOptionsApi: [{
32894
+ type: Input
32895
+ }], rowClick: [{
32896
+ type: Output
32897
+ }], rowDoubleClick: [{
32898
+ type: Output
32899
+ }], selectedIdsChange: [{
32900
+ type: Output
32901
+ }], corePageHeaderButtonClick: [{
32902
+ type: Output
32900
32903
  }] } });
32901
32904
 
32902
32905
  class CoreTreeComponent {