@adins/ucsearch 2.2.24 → 2.2.26

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.
@@ -179,6 +179,28 @@ ExportTypeConstant.EXP_TYPE_XLSX = 2;
179
179
  ExportTypeConstant.EXP_TYPE_DOC = 3;
180
180
  ExportTypeConstant.EXP_TYPE_DOCX = 4;
181
181
 
182
+ /**
183
+ * @fileoverview added by tsickle
184
+ * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
185
+ */
186
+ class ListKeyValueMonth {
187
+ constructor() {
188
+ this.ListOfMonth = new Array();
189
+ this.ListOfMonth.push({ key: 1, value: "January" });
190
+ this.ListOfMonth.push({ key: 2, value: "February" });
191
+ this.ListOfMonth.push({ key: 3, value: "March" });
192
+ this.ListOfMonth.push({ key: 4, value: "April" });
193
+ this.ListOfMonth.push({ key: 5, value: "May" });
194
+ this.ListOfMonth.push({ key: 6, value: "June" });
195
+ this.ListOfMonth.push({ key: 7, value: "July" });
196
+ this.ListOfMonth.push({ key: 8, value: "August" });
197
+ this.ListOfMonth.push({ key: 9, value: "September" });
198
+ this.ListOfMonth.push({ key: 10, value: "October" });
199
+ this.ListOfMonth.push({ key: 11, value: "November" });
200
+ this.ListOfMonth.push({ key: 12, value: "December" });
201
+ }
202
+ }
203
+
182
204
  /**
183
205
  * @fileoverview added by tsickle
184
206
  * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -228,10 +250,13 @@ class UCSearchComponent {
228
250
  value: "Document XML"
229
251
  },
230
252
  ];
253
+ this.ListOfMonth = new ListKeyValueMonth();
254
+ this.ListOfYear = new Array();
231
255
  this.ExportType = 0;
232
256
  this.pageNow = 1;
233
257
  this.isDataLoaded = false;
234
258
  this.isHidden = false;
259
+ this.BusinessDt = new Date();
235
260
  this.dateWrong = false;
236
261
  this.currentState = 'initial';
237
262
  this.countForm = 0;
@@ -277,6 +302,7 @@ class UCSearchComponent {
277
302
  /** @type {?} */
278
303
  let value = this.cookieService.get('BusinessDateRaw');
279
304
  this.BisDt = this.DecryptString(value, "AdInsFOU12345678");
305
+ this.BusinessDt = new Date(this.BisDt);
280
306
  this.initiateForm();
281
307
  }
282
308
  /**
@@ -347,6 +373,23 @@ class UCSearchComponent {
347
373
  if (data.component[i].type == "numeric") {
348
374
  data.component[i].value = parseFloat(data.component[i].value).toLocaleString('en');
349
375
  }
376
+ //pengecekan ddl
377
+ if (data.component[i].type == "dropdown") {
378
+ if (data.component[i].dtmType != undefined) {
379
+ if (data.component[i].dtmType == "month") {
380
+ if (data.component[i].value != undefined && data.component[i].value.includes("BD")) {
381
+ data.component[i].value = this.BusinessDt.getMonth() + 1;
382
+ }
383
+ data.component[i].items = this.ListOfMonth;
384
+ }
385
+ if (data.component[i].dtmType.includes("year")) {
386
+ if (data.component[i].value != undefined && data.component[i].value.includes("BD")) {
387
+ data.component[i].value = this.BusinessDt.getFullYear();
388
+ }
389
+ data.component[i].items = this.setYearDDL(data.component[i].dtmType);
390
+ }
391
+ }
392
+ }
350
393
  //pengecekan tanggal
351
394
  if (data.component[i].type == "datepicker") {
352
395
  if (data.component[i].value.includes("BD")) {
@@ -378,17 +421,19 @@ class UCSearchComponent {
378
421
  var dateText = formatDate(dateShow, 'yyyy-MM-dd', 'en-US');
379
422
  data.component[i].value = dateText;
380
423
  }
381
- if (data.component[i].restriction.toUpperCase() == "GT") {
382
- /** @type {?} */
383
- let minDate = new Date(this.datePipe.transform(data.component[i].minDate, 'yyyy-MM-dd'));
384
- minDate.setDate(minDate.getDate() + 1);
385
- data.component[i].minDate = minDate;
386
- }
387
- else if (data.component[i].restriction.toUpperCase() == "LT") {
388
- /** @type {?} */
389
- let maxDate = new Date(this.datePipe.transform(data.component[i].maxDate, 'yyyy-MM-dd'));
390
- maxDate.setDate(maxDate.getDate() - 1);
391
- data.component[i].maxDate = maxDate;
424
+ if (data.component[i].restriction != undefined && data.component[i].restriction != "") {
425
+ if (data.component[i].restriction.toUpperCase() == "GT") {
426
+ /** @type {?} */
427
+ let minDate = new Date(this.datePipe.transform(data.component[i].minDate, 'yyyy-MM-dd'));
428
+ minDate.setDate(minDate.getDate() + 1);
429
+ data.component[i].minDate = minDate;
430
+ }
431
+ else if (data.component[i].restriction.toUpperCase() == "LT") {
432
+ /** @type {?} */
433
+ let maxDate = new Date(this.datePipe.transform(data.component[i].maxDate, 'yyyy-MM-dd'));
434
+ maxDate.setDate(maxDate.getDate() - 1);
435
+ data.component[i].maxDate = maxDate;
436
+ }
392
437
  }
393
438
  }
394
439
  }
@@ -404,6 +449,46 @@ class UCSearchComponent {
404
449
  }), 1000);
405
450
  }));
406
451
  }
452
+ /**
453
+ * @param {?} year
454
+ * @return {?}
455
+ */
456
+ setYearDDL(year) {
457
+ this.ListOfYear = new Array();
458
+ /** @type {?} */
459
+ let equation = year.match("[\\/+][-]|[-][\\/+]|\\/+|-");
460
+ /** @type {?} */
461
+ let toMin = this.BusinessDt.getFullYear();
462
+ /** @type {?} */
463
+ let toMax = this.BusinessDt.getFullYear();
464
+ /** @type {?} */
465
+ let minMax = parseInt(year.substring(equation.index + equation[0].length));
466
+ this.ListOfYear.push({ key: this.BusinessDt.getFullYear(), value: this.BusinessDt.getFullYear().toString() });
467
+ for (let q = 0; q < minMax; q++) {
468
+ if (equation[0] == "-+" || equation[0] == "+-") {
469
+ toMin--;
470
+ toMax++;
471
+ this.ListOfYear.push({ key: toMin, value: toMin.toString() }, { key: toMax, value: toMax.toString() });
472
+ }
473
+ else if (equation[0] == "-") {
474
+ toMin--;
475
+ this.ListOfYear.push({ key: toMin, value: toMin.toString() });
476
+ }
477
+ else if (equation[0] == "+") {
478
+ toMax++;
479
+ this.ListOfYear.push({ key: toMax, value: toMax.toString() });
480
+ }
481
+ }
482
+ this.ListOfYear.sort((/**
483
+ * @param {?} a
484
+ * @param {?} b
485
+ * @return {?}
486
+ */
487
+ (a, b) => {
488
+ return a.key - b.key;
489
+ }));
490
+ return this.ListOfYear;
491
+ }
407
492
  /**
408
493
  * @param {?} url
409
494
  * @return {?}
@@ -958,14 +1043,16 @@ class UCSearchComponent {
958
1043
  */
959
1044
  x => x.name == component.name && (x.restriction.toUpperCase() == "GTE")));
960
1045
  if (MinComponent != undefined) {
961
- minDateVal = new Date(this.myForm.nativeElement[MinComponent.id].min);
1046
+ minDateVal = this.myForm.nativeElement[MinComponent.id].min == "" ? null : new Date(this.myForm.nativeElement[MinComponent.id].min);
962
1047
  label = MinComponent.label.split(">", 2);
963
- if (MinComponent.restriction.toUpperCase() == "GT") {
964
- minDateVal.setDate(minDateVal.getDate() - 1);
965
- errorMessage.push(" must be greater than ");
966
- }
967
- else if (MinComponent.restriction.toUpperCase() == "GTE") {
968
- errorMessage.push(" must be greater than or equals to ");
1048
+ if (minDateVal != null) {
1049
+ if (MinComponent.restriction.toUpperCase() == "GT") {
1050
+ minDateVal.setDate(minDateVal.getDate() - 1);
1051
+ errorMessage.push(" must be greater than ");
1052
+ }
1053
+ else if (MinComponent.restriction.toUpperCase() == "GTE") {
1054
+ errorMessage.push(" must be greater than or equals to ");
1055
+ }
969
1056
  }
970
1057
  }
971
1058
  /** @type {?} */
@@ -983,25 +1070,27 @@ class UCSearchComponent {
983
1070
  */
984
1071
  x => x.name == component.name && (x.restriction.toUpperCase() == "LTE")));
985
1072
  if (MaxComponent != undefined) {
986
- maxDateVal = new Date(this.myForm.nativeElement[MaxComponent.id].max);
1073
+ maxDateVal = this.myForm.nativeElement[MaxComponent.id].max == "" ? null : new Date(this.myForm.nativeElement[MaxComponent.id].max);
987
1074
  label = MaxComponent.label.split("<", 2);
988
- if (MaxComponent.restriction.toUpperCase() == "LT") {
989
- maxDateVal.setDate(maxDateVal.getDate() + 1);
990
- errorMessage.push(" must be less than ");
991
- }
992
- else if (MaxComponent.restriction.toUpperCase() == "LTE") {
993
- errorMessage.push(" must be less than or equals to ");
1075
+ if (maxDateVal != null) {
1076
+ if (MaxComponent.restriction.toUpperCase() == "LT") {
1077
+ maxDateVal.setDate(maxDateVal.getDate() + 1);
1078
+ errorMessage.push(" must be less than ");
1079
+ }
1080
+ else if (MaxComponent.restriction.toUpperCase() == "LTE") {
1081
+ errorMessage.push(" must be less than or equals to ");
1082
+ }
994
1083
  }
995
1084
  }
996
- if (MinComponent != undefined && MaxComponent == undefined && this.myForm.nativeElement[MinComponent.id].value < minDateVal) {
1085
+ if (minDateVal != null && maxDateVal == null && new Date(this.myForm.nativeElement[MinComponent.id].value) < minDateVal) {
997
1086
  this.toastr.warning(label[0] + errorMessage[0] + formatDate(minDateVal, 'dd MMMM yyyy', 'en-US') + ".");
998
1087
  this.dateWrong = true;
999
1088
  }
1000
- else if (MaxComponent != undefined && MinComponent == undefined && this.myForm.nativeElement[MaxComponent.id].value > maxDateVal) {
1001
- this.toastr.warning(label[0] + errorMessage[0] + maxDateVal + ".");
1089
+ else if (maxDateVal != null && minDateVal == null && new Date(this.myForm.nativeElement[MaxComponent.id].value) > maxDateVal) {
1090
+ this.toastr.warning(label[0] + errorMessage[0] + formatDate(maxDateVal, 'dd MMMM yyyy', 'en-US') + ".");
1002
1091
  this.dateWrong = true;
1003
1092
  }
1004
- else if (MinComponent != undefined && MaxComponent != undefined) {
1093
+ else if (minDateVal != null && maxDateVal != null) {
1005
1094
  if (new Date(this.myForm.nativeElement[MaxComponent.id].value) > maxDateVal || new Date(this.myForm.nativeElement[MinComponent.id].value) < minDateVal) {
1006
1095
  this.toastr.warning(label[0] + errorMessage[0] + formatDate(minDateVal, 'dd MMMM yyyy', 'en-US') + " and" + errorMessage[1] + formatDate(maxDateVal, 'dd MMMM yyyy', 'en-US') + ".");
1007
1096
  this.dateWrong = true;
@@ -1010,12 +1099,15 @@ class UCSearchComponent {
1010
1099
  this.dateWrong = false;
1011
1100
  }
1012
1101
  }
1102
+ else {
1103
+ this.dateWrong = false;
1104
+ }
1013
1105
  }
1014
1106
  }
1015
1107
  UCSearchComponent.decorators = [
1016
1108
  { type: Component, args: [{
1017
1109
  selector: 'lib-UCSearch',
1018
- template: "<!-- Basic form layout section start -->\r\n<section id=\"horizontal-form-layouts\">\r\n <div class=\"row text-left\">\r\n <div class=\"col-md-12\">\r\n <div class=\"card\">\r\n <div class=\"pl-3 mb-2 mt-2\" *ngIf=\"configuration?.title != undefined && configuration?.title != ''\">\r\n <h4 class=\"card-title ucSearch-title\" translate>{{configuration.title}}</h4>\r\n </div>\r\n <div class=\"card-body\">\r\n <div class=\"px-3\">\r\n <form class=\"form form-horizontal\" id=\"formSearch\" #formIdSearch #enjiForm=\"ngForm\"\r\n (ngSubmit)=\"enjiForm.valid && searchClick()\">\r\n <div class=\"form-body\">\r\n <h4 class=\"form-section font-weight-bold\">\r\n <div (click)=\"changeState()\" class=\"btn no-padding cursor-pointer flip\">\r\n <i class=\"fa\" style=\"font-size: 15px; margin: 0px 0px 5px -15px;\"\r\n [ngClass]=\"isHidden ? 'fa-chevron-right' : 'fa-chevron-down'\"></i>\r\n </div>\r\n <span\r\n *ngIf=\"configuration?.sectionTitle != undefined && configuration?.sectionTitle != ''; then inputSectionTitle else defaultSectionTitle\"></span>\r\n <ng-template #inputSectionTitle>\r\n {{configuration?.sectionTitle}}\r\n </ng-template>\r\n <ng-template #defaultSectionTitle>\r\n Paging\r\n </ng-template>\r\n </h4>\r\n <!-- Ini Digunakan untuk Generate Dynamic Component -->\r\n <!-- [hidden]=\"isHidden\" -->\r\n <div class=\"panel-active\" [@changeDivSize]=currentState>\r\n <div class=\"row\">\r\n <div class=\"col-md-6 form-group\" *ngFor=\"let question of configuration?.component\">\r\n <div class=\"col-md-12\">\r\n <div class=\"row\">\r\n <label class=\"col-md-5 no-padding\" for=\"{{question.id}}\"\r\n [ngClass]=\"{'adins-required-label': (question.isRequired || (question?.ddlType != undefined && question.ddlType == 'one'))}\"\r\n translate>{{question.label}}</label>\r\n <div class=\"col-md-7 no-padding\">\r\n <div *ngIf=\"question.type=='textbox'\">\r\n <input type=\"text\" id=\"{{question.id}}\" class=\"form-control search-form-control\" [ngModel]=\"question.value\"\r\n [required]=\"question.isRequired\" name=\"{{question.name}}\"\r\n attr.data-required=\"{{question.isRequired}}\" value=\"{{question.value}}\"\r\n (keyup.enter)=\"searchClick()\" attr.data-type=\"{{question.datatype}}\"\r\n attr.data-name=\"{{question.name}}\" attr.data-restriction=\"{{question.restriction}}\" attr.label=\"{{question.label}}\"\r\n [ngClass]=\"{ 'is-invalid':(enjiForm.submitted || enjiForm.form.controls[question.name]?.touched || enjiForm.form.controls[question.name]?.dirty) && enjiForm.form.controls[question.name]?.invalid }\">\r\n </div>\r\n <div *ngIf=\"question.type=='textarea'\">\r\n <textarea type=\"text\" id=\"{{question.id}}\" class=\"form-control search-form-control\" [ngModel]=\"question.value\"\r\n [required]=\"question.isRequired\" name=\"{{question.name}}\" attr.data-required=\"{{question.isRequired}}\"\r\n attr.data-type=\"{{question.datatype}}\" attr.data-name=\"{{question.name}}\"\r\n value=\"{{question.value}}\" attr.label=\"{{question.label}}\"\r\n [ngClass]=\"{ 'is-invalid':(enjiForm.submitted || enjiForm.form.controls[question.name]?.touched || enjiForm.form.controls[question.name]?.dirty) && enjiForm.form.controls[question.name]?.invalid }\"></textarea>\r\n </div>\r\n <div *ngIf=\"question.type=='numeric'\">\r\n <input type=\"number\" id=\"{{question.id}}\" (focus)=\"transformToDecimal($event)\"\r\n (blur)=\"transformAmount($event)\" class=\"form-control search-form-control\" [ngModel]=\"question.value\"\r\n [required]=\"question.isRequired\" name=\"{{question.name}}\" attr.data-required=\"{{question.isRequired}}\"\r\n value=\"{{question.value}}\" (keyup.enter)=\"searchClick()\"\r\n attr.data-restriction=\"{{question.restriction}}\" attr.data-type=\"{{question.datatype}}\"\r\n attr.data-name=\"{{question.name}}\" attr.label=\"{{question.label}}\"\r\n [ngClass]=\"{ 'is-invalid':(enjiForm.submitted || enjiForm.form.controls[question.name]?.touched || enjiForm.form.controls[question.name]?.dirty) && enjiForm.form.controls[question.name]?.invalid }\">\r\n </div>\r\n <div *ngIf=\"question.type=='currency'\">\r\n <div *ngIf=\"question?.isCustom != undefined && question?.isCustom\">\r\n <input type=\"\" id=\"{{question.id}}\" class=\"form-control search-form-control\"\r\n [required]=\"question.isRequired\" name=\"{{question.name}}\" (keyup.enter)=\"searchClick()\"\r\n attr.data-restriction=\"{{question.restriction}}\"\r\n attr.data-type=\"{{question.datatype}}\" attr.data-name=\"{{question.name}}\"\r\n attr.data-required=\"{{question.isRequired}}\" currencyMask [ngModel]=\"question.value\"\r\n [(ngModel)]=\"question.value\" [ngModelOptions]=\"{standalone: true}\" attr.label=\"{{question.label}}\"\r\n [options]=\"{ thousands: question.thousands, decimal: question.decimal, align: question.align, allowNegative: question.allowNegative, allowZero: question.allowZero, precision: question.precision, nullable: question.nullable }\"\r\n [ngClass]=\"{ 'is-invalid':(enjiForm.submitted || enjiForm.form.controls[question.name]?.touched || enjiForm.form.controls[question.name]?.dirty) && enjiForm.form.controls[question.name]?.invalid }\">\r\n </div>\r\n <div *ngIf=\"question?.isCustom == undefined || !question?.isCustom\">\r\n <input type=\"text\" id=\"{{question.id}}\" class=\"form-control search-form-control\"\r\n [required]=\"question.isRequired\" name=\"{{question.name}}\" (keyup.enter)=\"searchClick()\"\r\n attr.data-restriction=\"{{question.restriction}}\"\r\n attr.data-type=\"{{question.datatype}}\" attr.data-name=\"{{question.name}}\"\r\n attr.data-required=\"{{question.isRequired}}\" currencyMask [ngModel]=\"question.value\"\r\n [(ngModel)]=\"question.value\" [ngModelOptions]=\"{standalone: true}\" attr.label=\"{{question.label}}\"\r\n [options]=\"{ thousands: ',', decimal: '.', align: 'right', allowNegative: false, allowZero:true, precision: 2, nullable: false }\"\r\n [ngClass]=\"{ 'is-invalid':(enjiForm.submitted || enjiForm.form.controls[question.name]?.touched || enjiForm.form.controls[question.name]?.dirty) && enjiForm.form.controls[question.name]?.invalid }\">\r\n </div>\r\n </div>\r\n\r\n <!-- End Hardcode Lookup didalem-->\r\n <div *ngIf=\"question.type=='datepicker'\">\r\n <input type=\"date\" id=\"{{question.id}}\"\r\n class=\"form-control search-form-control btn-lookup\" name=\"{{question.id}}\" [ngModel]=\"question.value\"\r\n [required]=\"question.isRequired\" attr.data-required=\"{{question.isRequired}}\" value=\"{{question.value}}\"\r\n attr.data-type=\"{{question.datatype}}\" attr.data-name=\"{{question.name}}\"\r\n (keyup.enter)=\"searchClick()\" attr.data-restriction=\"{{question.restriction}}\" attr.label=\"{{question.label}}\"\r\n min=\"{{question.minDate | date:'yyyy-MM-dd'}}\" max=\"{{question.maxDate | date:'yyyy-MM-dd'}}\" (focusout)=\"checkInputDate(question)\"\r\n [ngClass]=\"{ 'is-invalid':(enjiForm.submitted || enjiForm.form.controls[question.id]?.touched || enjiForm.form.controls[question.id]?.dirty) && enjiForm.form.controls[question.id]?.invalid }\">\r\n </div>\r\n <div *ngIf=\"question.type=='dropdown'\">\r\n <!-- Ini kalau datanya tidak di load dari URL -->\r\n <div *ngIf=\"!question.isFromURL\">\r\n <select name=\"{{question.name}}\" attr.data-required=\"{{question.isRequired}}\"\r\n [required]=\"question.isRequired\" class=\"form-control search-form-control\" attr.query-in=\"{{question.isQueryIn}}\"\r\n attr.data-type=\"{{question.datatype}}\" attr.data-name=\"{{question.name}}\" attr.label=\"{{question.label}}\"\r\n [hidden]=\"question?.items.length == 1\"\r\n [ngClass]=\"{ 'is-invalid':(enjiForm.submitted || enjiForm.form.controls[question.name]?.touched || enjiForm.form.controls[question.name]?.dirty) && enjiForm.form.controls[question.name]?.invalid }\">\r\n <option *ngIf=\"question.ddlType == 'one' && question?.items.length != 1\" value=\"one\">\r\n Select One</option>\r\n <option\r\n *ngIf=\"(question?.ddlType == undefined || question.ddlType == 'all') && question?.items.length != 1\"\r\n value=\"all\">All</option>\r\n <option *ngFor=\"let item of question?.items\" value=\"{{item.key}}\">\r\n {{item.value}}\r\n </option>\r\n </select>\r\n <label *ngIf=\"question?.items.length == 1\">{{question.items[0].value}}</label>\r\n </div>\r\n <!-- Ini kalau datanya di load dari URL -->\r\n <div *ngIf=\"question.isFromURL\">\r\n <div *ngIf=\"question.isEvent\">\r\n <select name=\"{{question.name}}\" attr.data-required=\"{{question.isRequired}}\"\r\n [required]=\"question.isRequired\" class=\"form-control search-form-control\" attr.query-in=\"{{question.isQueryIn}}\"\r\n attr.data-type=\"{{question.datatype}}\" attr.data-name=\"{{question.name}}\" attr.label=\"{{question.label}}\"\r\n (change)=\"onChangeEvent($event.target.value, question)\"\r\n [hidden]=\"question?.itemsUrl.length == 1\"\r\n [ngClass]=\"{ 'is-invalid':(enjiForm.submitted || enjiForm.form.controls[question.name]?.touched || enjiForm.form.controls[question.name]?.dirty) && enjiForm.form.controls[question.name]?.invalid }\">\r\n <option *ngIf=\"question.ddlType == 'one' && question?.itemsUrl.length != 1\"\r\n value=\"one\">Select One</option>\r\n <option\r\n *ngIf=\"(question?.ddlType == undefined || question.ddlType == 'all') && question?.itemsUrl.length != 1\"\r\n value=\"all\">All</option>\r\n <option *ngFor=\"let item of question?.itemsUrl\" value=\"{{item.Key}}\">\r\n {{item.Value}}\r\n </option>\r\n </select>\r\n <label *ngIf=\"question?.itemsUrl.length == 1\">{{question.itemsUrl[0].Value}}</label>\r\n </div>\r\n <div *ngIf=\"!question.isEvent\">\r\n <select name=\"{{question.name}}\" attr.data-required=\"{{question.isRequired}}\"\r\n [required]=\"question.isRequired\" class=\"form-control search-form-control\" attr.query-in=\"{{question.isQueryIn}}\"\r\n attr.data-type=\"{{question.datatype}}\" attr.label=\"{{question.label}}\"\r\n [hidden]=\"question?.itemsUrl.length == 1\"\r\n [ngClass]=\"{ 'is-invalid':(enjiForm.submitted || enjiForm.form.controls[question.name]?.touched || enjiForm.form.controls[question.name]?.dirty) && enjiForm.form.controls[question.name]?.invalid }\">\r\n <option *ngIf=\"question.ddlType == 'one' && question?.itemsUrl.length != 1\"\r\n value=\"one\">Select One</option>\r\n <option\r\n *ngIf=\"(question?.ddlType == undefined || question.ddlType == 'all') && question?.itemsUrl.length != 1\"\r\n value=\"all\">All</option>\r\n <option *ngFor=\"let item of question?.itemsUrl\" value=\"{{item.Key}}\">\r\n {{item.Value}}\r\n </option>\r\n </select>\r\n <label *ngIf=\"question?.itemsUrl.length == 1\">{{question.itemsUrl[0].Value}}</label>\r\n </div>\r\n </div>\r\n </div>\r\n <lib-uc-show-errors *ngIf=\"question.type!='datepicker'\" [control]=\"enjiForm.form.controls[question.name]\"\r\n [submit]=\"enjiForm.submitted\">\r\n </lib-uc-show-errors>\r\n <lib-uc-show-errors *ngIf=\"question.type=='datepicker'\" [control]=\"enjiForm.form.controls[question.id]\"\r\n [submit]=\"enjiForm.submitted\">\r\n </lib-uc-show-errors>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-md-6 form-group\" *ngIf=\"(isReport != undefined && isReport)\">\r\n <div class=\"col-md-12\">\r\n <div class=\"row\">\r\n <label class=\"col-md-5 no-padding\" translate>Report Type</label>\r\n <div class=\"col-md-7 no-padding\">\r\n <select name=\"ExportType\" [(ngModel)]=\"ExportType\" class=\"form-control search-form-control\"\r\n attr.data-type=\"text\">\r\n <option *ngFor=\"let item of ExportTypeList\" [value]=\"item.key\">{{item.value}}</option>\r\n </select>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-md-12 no-padding\">\r\n <div class=\"form-actions right\">\r\n <button *ngIf=\"exportData == true\" type=\"button\" (click)=\"exportAsXLSX()\"\r\n class=\"btn btn-raised btn-success mr-1\" translate>\r\n <i class=\"fa ft-download\"></i> Export Excel\r\n </button>\r\n <button type=\"button\" (click)=\"reset()\" class=\"btn btn-raised btn-warning mr-1\" translate>\r\n <i class=\"fa fa-times\"></i> Reset\r\n </button>\r\n <button *ngIf=\"(isReport == undefined || !isReport)\" type=\"submit\"\r\n class=\"btn btn-raised btn-primary\" #UCSearchClick translate>\r\n <i class=\"fa fa-search\"></i> Search\r\n </button>\r\n <button *ngIf=\"(isReport != undefined && isReport)\" type=\"button\" (click)=\"GenerateReport()\"\r\n class=\"btn btn-raised btn-primary\" translate>\r\n <i class=\"fa ft-download\"></i> Generate Report\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</section>\r\n<br>\r\n<!-- // Basic form layout section end -->",
1110
+ template: "<!-- Basic form layout section start -->\r\n<section id=\"horizontal-form-layouts\">\r\n <div class=\"row text-left\">\r\n <div class=\"col-md-12\">\r\n <div class=\"card\">\r\n <div class=\"pl-3 mb-2 mt-2\" *ngIf=\"configuration?.title != undefined && configuration?.title != ''\">\r\n <h4 class=\"card-title ucSearch-title\" translate>{{configuration.title}}</h4>\r\n </div>\r\n <div class=\"card-body\">\r\n <div class=\"px-3\">\r\n <form class=\"form form-horizontal\" id=\"formSearch\" #formIdSearch #enjiForm=\"ngForm\"\r\n (ngSubmit)=\"enjiForm.valid && searchClick()\">\r\n <div class=\"form-body\">\r\n <h4 class=\"form-section font-weight-bold\">\r\n <div (click)=\"changeState()\" class=\"btn no-padding cursor-pointer flip\">\r\n <i class=\"fa\" style=\"font-size: 15px; margin: 0px 0px 5px -15px;\"\r\n [ngClass]=\"isHidden ? 'fa-chevron-right' : 'fa-chevron-down'\"></i>\r\n </div>\r\n <span\r\n *ngIf=\"configuration?.sectionTitle != undefined && configuration?.sectionTitle != ''; then inputSectionTitle else defaultSectionTitle\"></span>\r\n <ng-template #inputSectionTitle>\r\n {{configuration?.sectionTitle}}\r\n </ng-template>\r\n <ng-template #defaultSectionTitle>\r\n Paging\r\n </ng-template>\r\n </h4>\r\n <!-- Ini Digunakan untuk Generate Dynamic Component -->\r\n <!-- [hidden]=\"isHidden\" -->\r\n <div class=\"panel-active\" [@changeDivSize]=currentState>\r\n <div class=\"row\">\r\n <div class=\"col-md-6 form-group\" *ngFor=\"let question of configuration?.component; let i = index\">\r\n <div class=\"col-md-12\">\r\n <div class=\"row\">\r\n <label class=\"col-md-5 no-padding\" for=\"{{question.id}}\"\r\n [ngClass]=\"{'adins-required-label': (question.isRequired || (question?.ddlType != undefined && question.ddlType == 'one'))}\"\r\n translate>{{question.label}}</label>\r\n <div class=\"col-md-7 no-padding\">\r\n <div *ngIf=\"question.type=='textbox'\">\r\n <input type=\"text\" id=\"{{question.id}}\" class=\"form-control search-form-control\" [ngModel]=\"question.value\"\r\n [required]=\"question.isRequired\" name=\"{{question.name}}\"\r\n attr.data-required=\"{{question.isRequired}}\" value=\"{{question.value}}\"\r\n (keyup.enter)=\"searchClick()\" attr.data-type=\"{{question.datatype}}\"\r\n attr.data-name=\"{{question.name}}\" attr.data-restriction=\"{{question.restriction}}\" attr.label=\"{{question.label}}\"\r\n [ngClass]=\"{ 'is-invalid':(enjiForm.submitted || enjiForm.form.controls[question.name]?.touched || enjiForm.form.controls[question.name]?.dirty) && enjiForm.form.controls[question.name]?.invalid }\">\r\n </div>\r\n <div *ngIf=\"question.type=='textarea'\">\r\n <textarea type=\"text\" id=\"{{question.id}}\" class=\"form-control search-form-control\" [ngModel]=\"question.value\"\r\n [required]=\"question.isRequired\" name=\"{{question.name}}\" attr.data-required=\"{{question.isRequired}}\"\r\n attr.data-type=\"{{question.datatype}}\" attr.data-name=\"{{question.name}}\"\r\n value=\"{{question.value}}\" attr.label=\"{{question.label}}\"\r\n [ngClass]=\"{ 'is-invalid':(enjiForm.submitted || enjiForm.form.controls[question.name]?.touched || enjiForm.form.controls[question.name]?.dirty) && enjiForm.form.controls[question.name]?.invalid }\"></textarea>\r\n </div>\r\n <div *ngIf=\"question.type=='numeric'\">\r\n <input type=\"number\" id=\"{{question.id}}\" (focus)=\"transformToDecimal($event)\"\r\n (blur)=\"transformAmount($event)\" class=\"form-control search-form-control\" [ngModel]=\"question.value\"\r\n [required]=\"question.isRequired\" name=\"{{question.name+[i]}}\" attr.data-required=\"{{question.isRequired}}\"\r\n value=\"{{question.value}}\" (keyup.enter)=\"searchClick()\"\r\n attr.data-restriction=\"{{question.restriction}}\" attr.data-type=\"{{question.datatype}}\"\r\n attr.data-name=\"{{question.name}}\" attr.label=\"{{question.label}}\"\r\n [ngClass]=\"{ 'is-invalid':(enjiForm.submitted || enjiForm.form.controls[question.name+[i]]?.touched || enjiForm.form.controls[question.name+[i]]?.dirty) && enjiForm.form.controls[question.name+[i]]?.invalid }\">\r\n </div>\r\n <div *ngIf=\"question.type=='currency'\">\r\n <div *ngIf=\"question?.isCustom != undefined && question?.isCustom\">\r\n <input type=\"\" id=\"{{question.id}}\" class=\"form-control search-form-control\"\r\n [required]=\"question.isRequired\" name=\"{{question.name}}\" (keyup.enter)=\"searchClick()\"\r\n attr.data-restriction=\"{{question.restriction}}\"\r\n attr.data-type=\"{{question.datatype}}\" attr.data-name=\"{{question.name}}\"\r\n attr.data-required=\"{{question.isRequired}}\" currencyMask [ngModel]=\"question.value\"\r\n [(ngModel)]=\"question.value\" [ngModelOptions]=\"{standalone: true}\" attr.label=\"{{question.label}}\"\r\n [options]=\"{ thousands: question.thousands, decimal: question.decimal, align: question.align, allowNegative: question.allowNegative, allowZero: question.allowZero, precision: question.precision, nullable: question.nullable }\"\r\n [ngClass]=\"{ 'is-invalid':(enjiForm.submitted || enjiForm.form.controls[question.name]?.touched || enjiForm.form.controls[question.name]?.dirty) && enjiForm.form.controls[question.name]?.invalid }\">\r\n </div>\r\n <div *ngIf=\"question?.isCustom == undefined || !question?.isCustom\">\r\n <input type=\"text\" id=\"{{question.id}}\" class=\"form-control search-form-control\"\r\n [required]=\"question.isRequired\" name=\"{{question.name}}\" (keyup.enter)=\"searchClick()\"\r\n attr.data-restriction=\"{{question.restriction}}\"\r\n attr.data-type=\"{{question.datatype}}\" attr.data-name=\"{{question.name}}\"\r\n attr.data-required=\"{{question.isRequired}}\" currencyMask [ngModel]=\"question.value\"\r\n [(ngModel)]=\"question.value\" [ngModelOptions]=\"{standalone: true}\" attr.label=\"{{question.label}}\"\r\n [options]=\"{ thousands: ',', decimal: '.', align: 'right', allowNegative: false, allowZero:true, precision: 2, nullable: false }\"\r\n [ngClass]=\"{ 'is-invalid':(enjiForm.submitted || enjiForm.form.controls[question.name]?.touched || enjiForm.form.controls[question.name]?.dirty) && enjiForm.form.controls[question.name]?.invalid }\">\r\n </div>\r\n </div>\r\n\r\n <!-- End Hardcode Lookup didalem-->\r\n <div *ngIf=\"question.type=='datepicker'\">\r\n <input type=\"date\" id=\"{{question.id}}\"\r\n class=\"form-control search-form-control btn-lookup\" name=\"{{question.name+[i]}}\" [ngModel]=\"question.value\"\r\n [required]=\"question.isRequired\" attr.data-required=\"{{question.isRequired}}\" value=\"{{question.value}}\"\r\n attr.data-type=\"{{question.datatype}}\" attr.data-name=\"{{question.name}}\"\r\n (keyup.enter)=\"searchClick()\" attr.data-restriction=\"{{question.restriction}}\" attr.label=\"{{question.label}}\"\r\n min=\"{{question.minDate | date:'yyyy-MM-dd'}}\" max=\"{{question.maxDate | date:'yyyy-MM-dd'}}\" (focusout)=\"checkInputDate(question)\"\r\n [ngClass]=\"{ 'is-invalid':(enjiForm.submitted || enjiForm.form.controls[question.name+[i]]?.touched || enjiForm.form.controls[question.name+[i]]?.dirty) && enjiForm.form.controls[question.name+[i]]?.invalid }\">\r\n </div>\r\n <div *ngIf=\"question.type=='dropdown'\">\r\n <!-- Ini kalau datanya tidak di load dari URL -->\r\n <div *ngIf=\"!question.isFromURL\">\r\n <select name=\"{{question.name}}\" attr.data-required=\"{{question.isRequired}}\"\r\n [required]=\"question.isRequired\" class=\"form-control search-form-control\" attr.query-in=\"{{question.isQueryIn}}\"\r\n attr.data-type=\"{{question.datatype}}\" attr.data-name=\"{{question.name}}\" attr.label=\"{{question.label}}\"\r\n [hidden]=\"question?.items.length == 1\" [(ngModel)]=\"question.value\"\r\n [ngClass]=\"{ 'is-invalid':(enjiForm.submitted || enjiForm.form.controls[question.name]?.touched || enjiForm.form.controls[question.name]?.dirty) && enjiForm.form.controls[question.name]?.invalid }\">\r\n <option *ngIf=\"question.ddlType == 'one' && question?.items.length != 1\" value=\"one\">\r\n Select One</option>\r\n <option\r\n *ngIf=\"(question?.ddlType == undefined || question.ddlType == 'all') && question?.items.length != 1\"\r\n value=\"all\">All</option>\r\n <option *ngFor=\"let item of question?.items\" value=\"{{item.key}}\">\r\n {{item.value}}\r\n </option>\r\n </select>\r\n <label *ngIf=\"question?.items.length == 1\">{{question.items[0].value}}</label>\r\n </div>\r\n <!-- Ini kalau datanya di load dari URL -->\r\n <div *ngIf=\"question.isFromURL\">\r\n <div *ngIf=\"question.isEvent\">\r\n <select name=\"{{question.name}}\" attr.data-required=\"{{question.isRequired}}\"\r\n [required]=\"question.isRequired\" class=\"form-control search-form-control\" attr.query-in=\"{{question.isQueryIn}}\"\r\n attr.data-type=\"{{question.datatype}}\" attr.data-name=\"{{question.name}}\" attr.label=\"{{question.label}}\"\r\n (change)=\"onChangeEvent($event.target.value, question)\"\r\n [hidden]=\"question?.itemsUrl.length == 1\" [(ngModel)]=\"question.value\"\r\n [ngClass]=\"{ 'is-invalid':(enjiForm.submitted || enjiForm.form.controls[question.name]?.touched || enjiForm.form.controls[question.name]?.dirty) && enjiForm.form.controls[question.name]?.invalid }\">\r\n <option *ngIf=\"question.ddlType == 'one' && question?.itemsUrl.length != 1\"\r\n value=\"one\">Select One</option>\r\n <option\r\n *ngIf=\"(question?.ddlType == undefined || question.ddlType == 'all') && question?.itemsUrl.length != 1\"\r\n value=\"all\">All</option>\r\n <option *ngFor=\"let item of question?.itemsUrl\" value=\"{{item.Key}}\">\r\n {{item.Value}}\r\n </option>\r\n </select>\r\n <label *ngIf=\"question?.itemsUrl.length == 1\">{{question.itemsUrl[0].Value}}</label>\r\n </div>\r\n <div *ngIf=\"!question.isEvent\">\r\n <select name=\"{{question.name}}\" attr.data-required=\"{{question.isRequired}}\"\r\n [required]=\"question.isRequired\" class=\"form-control search-form-control\" attr.query-in=\"{{question.isQueryIn}}\"\r\n attr.data-type=\"{{question.datatype}}\" attr.label=\"{{question.label}}\"\r\n [hidden]=\"question?.itemsUrl.length == 1\" [(ngModel)]=\"question.value\"\r\n [ngClass]=\"{ 'is-invalid':(enjiForm.submitted || enjiForm.form.controls[question.name]?.touched || enjiForm.form.controls[question.name]?.dirty) && enjiForm.form.controls[question.name]?.invalid }\">\r\n <option *ngIf=\"question.ddlType == 'one' && question?.itemsUrl.length != 1\"\r\n value=\"one\">Select One</option>\r\n <option\r\n *ngIf=\"(question?.ddlType == undefined || question.ddlType == 'all') && question?.itemsUrl.length != 1\"\r\n value=\"all\">All</option>\r\n <option *ngFor=\"let item of question?.itemsUrl\" value=\"{{item.Key}}\">\r\n {{item.Value}}\r\n </option>\r\n </select>\r\n <label *ngIf=\"question?.itemsUrl.length == 1\">{{question.itemsUrl[0].Value}}</label>\r\n </div>\r\n </div>\r\n </div>\r\n <lib-uc-show-errors *ngIf=\"question.type!='datepicker'\" [control]=\"enjiForm.form.controls[question.name]\"\r\n [submit]=\"enjiForm.submitted\">\r\n </lib-uc-show-errors>\r\n <lib-uc-show-errors *ngIf=\"question.type=='datepicker'\" [control]=\"enjiForm.form.controls[question.name+[i]]\"\r\n [submit]=\"enjiForm.submitted\">\r\n </lib-uc-show-errors>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-md-6 form-group\" *ngIf=\"(isReport != undefined && isReport)\">\r\n <div class=\"col-md-12\">\r\n <div class=\"row\">\r\n <label class=\"col-md-5 no-padding\" translate>Report Type</label>\r\n <div class=\"col-md-7 no-padding\">\r\n <select name=\"ExportType\" [(ngModel)]=\"ExportType\" class=\"form-control search-form-control\"\r\n attr.data-type=\"text\">\r\n <option *ngFor=\"let item of ExportTypeList\" [value]=\"item.key\">{{item.value}}</option>\r\n </select>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-md-12 no-padding\">\r\n <div class=\"form-actions right\">\r\n <button *ngIf=\"exportData == true\" type=\"button\" (click)=\"exportAsXLSX()\"\r\n class=\"btn btn-raised btn-success mr-1\" translate>\r\n <i class=\"fa ft-download\"></i> Export Excel\r\n </button>\r\n <button type=\"button\" (click)=\"reset()\" class=\"btn btn-raised btn-warning mr-1\" translate>\r\n <i class=\"fa fa-times\"></i> Reset\r\n </button>\r\n <button *ngIf=\"(isReport == undefined || !isReport)\" type=\"submit\"\r\n class=\"btn btn-raised btn-primary\" #UCSearchClick translate>\r\n <i class=\"fa fa-search\"></i> Search\r\n </button>\r\n <button *ngIf=\"(isReport != undefined && isReport)\" type=\"button\" (click)=\"GenerateReport()\"\r\n class=\"btn btn-raised btn-primary\" translate>\r\n <i class=\"fa ft-download\"></i> Generate Report\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</section>\r\n<br>\r\n<!-- // Basic form layout section end -->",
1019
1111
  providers: [ExcelService, DatePipe],
1020
1112
  animations: [
1021
1113
  trigger('changeDivSize', [