@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.
- package/README.md +11 -2
- package/adins-ucsearch.metadata.json +1 -1
- package/bundles/adins-ucsearch.umd.js +126 -30
- package/bundles/adins-ucsearch.umd.js.map +1 -1
- package/bundles/adins-ucsearch.umd.min.js +1 -1
- package/bundles/adins-ucsearch.umd.min.js.map +1 -1
- package/esm2015/lib/model/KeyValueUCSearch.model.js +38 -0
- package/esm2015/lib/ucsearch.component.js +108 -31
- package/esm5/lib/model/KeyValueUCSearch.model.js +42 -0
- package/esm5/lib/ucsearch.component.js +112 -31
- package/fesm2015/adins-ucsearch.js +122 -30
- package/fesm2015/adins-ucsearch.js.map +1 -1
- package/fesm5/adins-ucsearch.js +127 -30
- package/fesm5/adins-ucsearch.js.map +1 -1
- package/lib/model/KeyValueUCSearch.model.d.ts +9 -0
- package/lib/ucsearch.component.d.ts +5 -0
- package/package.json +1 -1
package/fesm5/adins-ucsearch.js
CHANGED
|
@@ -204,6 +204,29 @@ var ExportTypeConstant = /** @class */ (function () {
|
|
|
204
204
|
return ExportTypeConstant;
|
|
205
205
|
}());
|
|
206
206
|
|
|
207
|
+
/**
|
|
208
|
+
* @fileoverview added by tsickle
|
|
209
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
210
|
+
*/
|
|
211
|
+
var ListKeyValueMonth = /** @class */ (function () {
|
|
212
|
+
function ListKeyValueMonth() {
|
|
213
|
+
this.ListOfMonth = new Array();
|
|
214
|
+
this.ListOfMonth.push({ key: 1, value: "January" });
|
|
215
|
+
this.ListOfMonth.push({ key: 2, value: "February" });
|
|
216
|
+
this.ListOfMonth.push({ key: 3, value: "March" });
|
|
217
|
+
this.ListOfMonth.push({ key: 4, value: "April" });
|
|
218
|
+
this.ListOfMonth.push({ key: 5, value: "May" });
|
|
219
|
+
this.ListOfMonth.push({ key: 6, value: "June" });
|
|
220
|
+
this.ListOfMonth.push({ key: 7, value: "July" });
|
|
221
|
+
this.ListOfMonth.push({ key: 8, value: "August" });
|
|
222
|
+
this.ListOfMonth.push({ key: 9, value: "September" });
|
|
223
|
+
this.ListOfMonth.push({ key: 10, value: "October" });
|
|
224
|
+
this.ListOfMonth.push({ key: 11, value: "November" });
|
|
225
|
+
this.ListOfMonth.push({ key: 12, value: "December" });
|
|
226
|
+
}
|
|
227
|
+
return ListKeyValueMonth;
|
|
228
|
+
}());
|
|
229
|
+
|
|
207
230
|
/**
|
|
208
231
|
* @fileoverview added by tsickle
|
|
209
232
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
@@ -244,10 +267,13 @@ var UCSearchComponent = /** @class */ (function () {
|
|
|
244
267
|
value: "Document XML"
|
|
245
268
|
},
|
|
246
269
|
];
|
|
270
|
+
this.ListOfMonth = new ListKeyValueMonth();
|
|
271
|
+
this.ListOfYear = new Array();
|
|
247
272
|
this.ExportType = 0;
|
|
248
273
|
this.pageNow = 1;
|
|
249
274
|
this.isDataLoaded = false;
|
|
250
275
|
this.isHidden = false;
|
|
276
|
+
this.BusinessDt = new Date();
|
|
251
277
|
this.dateWrong = false;
|
|
252
278
|
this.currentState = 'initial';
|
|
253
279
|
this.countForm = 0;
|
|
@@ -301,6 +327,7 @@ var UCSearchComponent = /** @class */ (function () {
|
|
|
301
327
|
/** @type {?} */
|
|
302
328
|
var value = this.cookieService.get('BusinessDateRaw');
|
|
303
329
|
this.BisDt = this.DecryptString(value, "AdInsFOU12345678");
|
|
330
|
+
this.BusinessDt = new Date(this.BisDt);
|
|
304
331
|
this.initiateForm();
|
|
305
332
|
};
|
|
306
333
|
/**
|
|
@@ -375,6 +402,23 @@ var UCSearchComponent = /** @class */ (function () {
|
|
|
375
402
|
if (data.component[i].type == "numeric") {
|
|
376
403
|
data.component[i].value = parseFloat(data.component[i].value).toLocaleString('en');
|
|
377
404
|
}
|
|
405
|
+
//pengecekan ddl
|
|
406
|
+
if (data.component[i].type == "dropdown") {
|
|
407
|
+
if (data.component[i].dtmType != undefined) {
|
|
408
|
+
if (data.component[i].dtmType == "month") {
|
|
409
|
+
if (data.component[i].value != undefined && data.component[i].value.includes("BD")) {
|
|
410
|
+
data.component[i].value = _this.BusinessDt.getMonth() + 1;
|
|
411
|
+
}
|
|
412
|
+
data.component[i].items = _this.ListOfMonth;
|
|
413
|
+
}
|
|
414
|
+
if (data.component[i].dtmType.includes("year")) {
|
|
415
|
+
if (data.component[i].value != undefined && data.component[i].value.includes("BD")) {
|
|
416
|
+
data.component[i].value = _this.BusinessDt.getFullYear();
|
|
417
|
+
}
|
|
418
|
+
data.component[i].items = _this.setYearDDL(data.component[i].dtmType);
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}
|
|
378
422
|
//pengecekan tanggal
|
|
379
423
|
if (data.component[i].type == "datepicker") {
|
|
380
424
|
if (data.component[i].value.includes("BD")) {
|
|
@@ -406,17 +450,19 @@ var UCSearchComponent = /** @class */ (function () {
|
|
|
406
450
|
var dateText = formatDate(dateShow, 'yyyy-MM-dd', 'en-US');
|
|
407
451
|
data.component[i].value = dateText;
|
|
408
452
|
}
|
|
409
|
-
if (data.component[i].restriction.
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
453
|
+
if (data.component[i].restriction != undefined && data.component[i].restriction != "") {
|
|
454
|
+
if (data.component[i].restriction.toUpperCase() == "GT") {
|
|
455
|
+
/** @type {?} */
|
|
456
|
+
var minDate = new Date(_this.datePipe.transform(data.component[i].minDate, 'yyyy-MM-dd'));
|
|
457
|
+
minDate.setDate(minDate.getDate() + 1);
|
|
458
|
+
data.component[i].minDate = minDate;
|
|
459
|
+
}
|
|
460
|
+
else if (data.component[i].restriction.toUpperCase() == "LT") {
|
|
461
|
+
/** @type {?} */
|
|
462
|
+
var maxDate = new Date(_this.datePipe.transform(data.component[i].maxDate, 'yyyy-MM-dd'));
|
|
463
|
+
maxDate.setDate(maxDate.getDate() - 1);
|
|
464
|
+
data.component[i].maxDate = maxDate;
|
|
465
|
+
}
|
|
420
466
|
}
|
|
421
467
|
}
|
|
422
468
|
}
|
|
@@ -432,6 +478,50 @@ var UCSearchComponent = /** @class */ (function () {
|
|
|
432
478
|
}), 1000);
|
|
433
479
|
}));
|
|
434
480
|
};
|
|
481
|
+
/**
|
|
482
|
+
* @param {?} year
|
|
483
|
+
* @return {?}
|
|
484
|
+
*/
|
|
485
|
+
UCSearchComponent.prototype.setYearDDL = /**
|
|
486
|
+
* @param {?} year
|
|
487
|
+
* @return {?}
|
|
488
|
+
*/
|
|
489
|
+
function (year) {
|
|
490
|
+
this.ListOfYear = new Array();
|
|
491
|
+
/** @type {?} */
|
|
492
|
+
var equation = year.match("[\\/+][-]|[-][\\/+]|\\/+|-");
|
|
493
|
+
/** @type {?} */
|
|
494
|
+
var toMin = this.BusinessDt.getFullYear();
|
|
495
|
+
/** @type {?} */
|
|
496
|
+
var toMax = this.BusinessDt.getFullYear();
|
|
497
|
+
/** @type {?} */
|
|
498
|
+
var minMax = parseInt(year.substring(equation.index + equation[0].length));
|
|
499
|
+
this.ListOfYear.push({ key: this.BusinessDt.getFullYear(), value: this.BusinessDt.getFullYear().toString() });
|
|
500
|
+
for (var q = 0; q < minMax; q++) {
|
|
501
|
+
if (equation[0] == "-+" || equation[0] == "+-") {
|
|
502
|
+
toMin--;
|
|
503
|
+
toMax++;
|
|
504
|
+
this.ListOfYear.push({ key: toMin, value: toMin.toString() }, { key: toMax, value: toMax.toString() });
|
|
505
|
+
}
|
|
506
|
+
else if (equation[0] == "-") {
|
|
507
|
+
toMin--;
|
|
508
|
+
this.ListOfYear.push({ key: toMin, value: toMin.toString() });
|
|
509
|
+
}
|
|
510
|
+
else if (equation[0] == "+") {
|
|
511
|
+
toMax++;
|
|
512
|
+
this.ListOfYear.push({ key: toMax, value: toMax.toString() });
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
this.ListOfYear.sort((/**
|
|
516
|
+
* @param {?} a
|
|
517
|
+
* @param {?} b
|
|
518
|
+
* @return {?}
|
|
519
|
+
*/
|
|
520
|
+
function (a, b) {
|
|
521
|
+
return a.key - b.key;
|
|
522
|
+
}));
|
|
523
|
+
return this.ListOfYear;
|
|
524
|
+
};
|
|
435
525
|
/**
|
|
436
526
|
* @param {?} url
|
|
437
527
|
* @return {?}
|
|
@@ -1056,14 +1146,16 @@ var UCSearchComponent = /** @class */ (function () {
|
|
|
1056
1146
|
*/
|
|
1057
1147
|
function (x) { return x.name == component.name && (x.restriction.toUpperCase() == "GTE"); }));
|
|
1058
1148
|
if (MinComponent != undefined) {
|
|
1059
|
-
minDateVal = new Date(this.myForm.nativeElement[MinComponent.id].min);
|
|
1149
|
+
minDateVal = this.myForm.nativeElement[MinComponent.id].min == "" ? null : new Date(this.myForm.nativeElement[MinComponent.id].min);
|
|
1060
1150
|
label = MinComponent.label.split(">", 2);
|
|
1061
|
-
if (
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1151
|
+
if (minDateVal != null) {
|
|
1152
|
+
if (MinComponent.restriction.toUpperCase() == "GT") {
|
|
1153
|
+
minDateVal.setDate(minDateVal.getDate() - 1);
|
|
1154
|
+
errorMessage.push(" must be greater than ");
|
|
1155
|
+
}
|
|
1156
|
+
else if (MinComponent.restriction.toUpperCase() == "GTE") {
|
|
1157
|
+
errorMessage.push(" must be greater than or equals to ");
|
|
1158
|
+
}
|
|
1067
1159
|
}
|
|
1068
1160
|
}
|
|
1069
1161
|
/** @type {?} */
|
|
@@ -1081,25 +1173,27 @@ var UCSearchComponent = /** @class */ (function () {
|
|
|
1081
1173
|
*/
|
|
1082
1174
|
function (x) { return x.name == component.name && (x.restriction.toUpperCase() == "LTE"); }));
|
|
1083
1175
|
if (MaxComponent != undefined) {
|
|
1084
|
-
maxDateVal = new Date(this.myForm.nativeElement[MaxComponent.id].max);
|
|
1176
|
+
maxDateVal = this.myForm.nativeElement[MaxComponent.id].max == "" ? null : new Date(this.myForm.nativeElement[MaxComponent.id].max);
|
|
1085
1177
|
label = MaxComponent.label.split("<", 2);
|
|
1086
|
-
if (
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1178
|
+
if (maxDateVal != null) {
|
|
1179
|
+
if (MaxComponent.restriction.toUpperCase() == "LT") {
|
|
1180
|
+
maxDateVal.setDate(maxDateVal.getDate() + 1);
|
|
1181
|
+
errorMessage.push(" must be less than ");
|
|
1182
|
+
}
|
|
1183
|
+
else if (MaxComponent.restriction.toUpperCase() == "LTE") {
|
|
1184
|
+
errorMessage.push(" must be less than or equals to ");
|
|
1185
|
+
}
|
|
1092
1186
|
}
|
|
1093
1187
|
}
|
|
1094
|
-
if (
|
|
1188
|
+
if (minDateVal != null && maxDateVal == null && new Date(this.myForm.nativeElement[MinComponent.id].value) < minDateVal) {
|
|
1095
1189
|
this.toastr.warning(label[0] + errorMessage[0] + formatDate(minDateVal, 'dd MMMM yyyy', 'en-US') + ".");
|
|
1096
1190
|
this.dateWrong = true;
|
|
1097
1191
|
}
|
|
1098
|
-
else if (
|
|
1099
|
-
this.toastr.warning(label[0] + errorMessage[0] + maxDateVal + ".");
|
|
1192
|
+
else if (maxDateVal != null && minDateVal == null && new Date(this.myForm.nativeElement[MaxComponent.id].value) > maxDateVal) {
|
|
1193
|
+
this.toastr.warning(label[0] + errorMessage[0] + formatDate(maxDateVal, 'dd MMMM yyyy', 'en-US') + ".");
|
|
1100
1194
|
this.dateWrong = true;
|
|
1101
1195
|
}
|
|
1102
|
-
else if (
|
|
1196
|
+
else if (minDateVal != null && maxDateVal != null) {
|
|
1103
1197
|
if (new Date(this.myForm.nativeElement[MaxComponent.id].value) > maxDateVal || new Date(this.myForm.nativeElement[MinComponent.id].value) < minDateVal) {
|
|
1104
1198
|
this.toastr.warning(label[0] + errorMessage[0] + formatDate(minDateVal, 'dd MMMM yyyy', 'en-US') + " and" + errorMessage[1] + formatDate(maxDateVal, 'dd MMMM yyyy', 'en-US') + ".");
|
|
1105
1199
|
this.dateWrong = true;
|
|
@@ -1108,11 +1202,14 @@ var UCSearchComponent = /** @class */ (function () {
|
|
|
1108
1202
|
this.dateWrong = false;
|
|
1109
1203
|
}
|
|
1110
1204
|
}
|
|
1205
|
+
else {
|
|
1206
|
+
this.dateWrong = false;
|
|
1207
|
+
}
|
|
1111
1208
|
};
|
|
1112
1209
|
UCSearchComponent.decorators = [
|
|
1113
1210
|
{ type: Component, args: [{
|
|
1114
1211
|
selector: 'lib-UCSearch',
|
|
1115
|
-
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 -->",
|
|
1212
|
+
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 -->",
|
|
1116
1213
|
providers: [ExcelService, DatePipe],
|
|
1117
1214
|
animations: [
|
|
1118
1215
|
trigger('changeDivSize', [
|