@adins/ucsearch 2.9.4 → 2.9.6
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/adins-ucsearch.d.ts +1 -2
- package/esm2020/adins-ucsearch.mjs +5 -0
- package/esm2020/lib/model/adins-constant.mjs +22 -0
- package/esm2020/lib/model/criteria-obj.model.mjs +9 -0
- package/esm2020/lib/model/input-search-obj.model.mjs +45 -0
- package/esm2020/lib/model/integration-obj.model.mjs +12 -0
- package/esm2020/lib/model/key-value-report.model.mjs +14 -0
- package/esm2020/lib/model/key-value-uc-search.model.mjs +38 -0
- package/esm2020/lib/model/request-criteria-obj.model.mjs +14 -0
- package/esm2020/lib/pipe/text-search.pipe.mjs +24 -0
- package/esm2020/lib/services/excel-service/excel-service.mjs +29 -0
- package/esm2020/lib/ucsearch.component.mjs +949 -0
- package/esm2020/lib/ucsearch.module.mjs +55 -0
- package/esm2020/lib/ucsearch.service.mjs +14 -0
- package/esm2020/public-api.mjs +7 -0
- package/fesm2015/adins-ucsearch.mjs +1214 -0
- package/fesm2015/adins-ucsearch.mjs.map +1 -0
- package/fesm2020/adins-ucsearch.mjs +1205 -0
- package/fesm2020/adins-ucsearch.mjs.map +1 -0
- package/lib/pipe/text-search.pipe.d.ts +3 -0
- package/lib/services/excel-service/excel-service.d.ts +3 -0
- package/lib/ucsearch.component.d.ts +3 -0
- package/lib/ucsearch.module.d.ts +12 -0
- package/lib/ucsearch.service.d.ts +3 -0
- package/package.json +23 -12
- package/adins-ucsearch.metadata.json +0 -1
- package/bundles/adins-ucsearch.umd.js +0 -1758
- package/bundles/adins-ucsearch.umd.js.map +0 -1
- package/bundles/adins-ucsearch.umd.min.js +0 -2
- package/bundles/adins-ucsearch.umd.min.js.map +0 -1
- package/esm2015/adins-ucsearch.js +0 -11
- package/esm2015/lib/model/adins-constant.js +0 -68
- package/esm2015/lib/model/criteria-obj.model.js +0 -31
- package/esm2015/lib/model/input-search-obj.model.js +0 -105
- package/esm2015/lib/model/integration-obj.model.js +0 -30
- package/esm2015/lib/model/key-value-report.model.js +0 -36
- package/esm2015/lib/model/key-value-uc-search.model.js +0 -54
- package/esm2015/lib/model/request-criteria-obj.model.js +0 -42
- package/esm2015/lib/pipe/text-search.pipe.js +0 -33
- package/esm2015/lib/services/excel-service/excel-service.js +0 -49
- package/esm2015/lib/ucsearch.component.js +0 -1309
- package/esm2015/lib/ucsearch.module.js +0 -43
- package/esm2015/lib/ucsearch.service.js +0 -18
- package/esm2015/public-api.js +0 -11
- package/esm5/adins-ucsearch.js +0 -11
- package/esm5/lib/model/adins-constant.js +0 -72
- package/esm5/lib/model/criteria-obj.model.js +0 -33
- package/esm5/lib/model/input-search-obj.model.js +0 -117
- package/esm5/lib/model/integration-obj.model.js +0 -32
- package/esm5/lib/model/key-value-report.model.js +0 -42
- package/esm5/lib/model/key-value-uc-search.model.js +0 -58
- package/esm5/lib/model/request-criteria-obj.model.js +0 -44
- package/esm5/lib/pipe/text-search.pipe.js +0 -42
- package/esm5/lib/services/excel-service/excel-service.js +0 -63
- package/esm5/lib/ucsearch.component.js +0 -1447
- package/esm5/lib/ucsearch.module.js +0 -47
- package/esm5/lib/ucsearch.service.js +0 -21
- package/esm5/public-api.js +0 -11
- package/fesm2015/adins-ucsearch.js +0 -1491
- package/fesm2015/adins-ucsearch.js.map +0 -1
- package/fesm5/adins-ucsearch.js +0 -1665
- package/fesm5/adins-ucsearch.js.map +0 -1
|
@@ -0,0 +1,1214 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, Pipe, EventEmitter, Component, Inject, ViewChild, Input, Output, NgModule } from '@angular/core';
|
|
3
|
+
import { __awaiter } from 'tslib';
|
|
4
|
+
import * as i5 from '@angular/common';
|
|
5
|
+
import { formatDate, DOCUMENT, DatePipe, CommonModule } from '@angular/common';
|
|
6
|
+
import * as FileSaver from 'file-saver';
|
|
7
|
+
import * as XLSX from 'xlsx';
|
|
8
|
+
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
9
|
+
import * as CryptoJS from 'crypto-js';
|
|
10
|
+
import * as i1 from '@angular/common/http';
|
|
11
|
+
import * as i3 from 'ngx-toastr';
|
|
12
|
+
import * as i4 from 'ngx-cookie';
|
|
13
|
+
import * as i6 from '@adins/uc-show-errors';
|
|
14
|
+
import { UcShowErrorsModule } from '@adins/uc-show-errors';
|
|
15
|
+
import * as i7 from '@ngx-translate/core';
|
|
16
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
17
|
+
import * as i8 from '@angular/forms';
|
|
18
|
+
import { FormsModule } from '@angular/forms';
|
|
19
|
+
import * as i9 from '@adins/uc-directive-upper-case';
|
|
20
|
+
import { UcDirectiveUpperCaseModule } from '@adins/uc-directive-upper-case';
|
|
21
|
+
import * as i10 from 'ngx-currency';
|
|
22
|
+
import { CurrencyMaskInputMode, NgxCurrencyModule } from 'ngx-currency';
|
|
23
|
+
|
|
24
|
+
class UCSearchService {
|
|
25
|
+
constructor() { }
|
|
26
|
+
}
|
|
27
|
+
/** @nocollapse */ /** @nocollapse */ UCSearchService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: UCSearchService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
28
|
+
/** @nocollapse */ /** @nocollapse */ UCSearchService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: UCSearchService, providedIn: 'root' });
|
|
29
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: UCSearchService, decorators: [{
|
|
30
|
+
type: Injectable,
|
|
31
|
+
args: [{
|
|
32
|
+
providedIn: 'root'
|
|
33
|
+
}]
|
|
34
|
+
}], ctorParameters: function () { return []; } });
|
|
35
|
+
|
|
36
|
+
class AdInsConstant {
|
|
37
|
+
}
|
|
38
|
+
AdInsConstant.RestrictionBetween = "Between";
|
|
39
|
+
AdInsConstant.RestrictionLike = "Like";
|
|
40
|
+
AdInsConstant.RestrictionEq = "Eq";
|
|
41
|
+
AdInsConstant.RestrictionNeq = "NEQ";
|
|
42
|
+
AdInsConstant.RestrictionGt = "GT";
|
|
43
|
+
AdInsConstant.RestrictionGte = "GTE";
|
|
44
|
+
AdInsConstant.RestrictionLt = "LT";
|
|
45
|
+
AdInsConstant.RestrictionLte = "LTE";
|
|
46
|
+
AdInsConstant.RestrictionIn = "IN";
|
|
47
|
+
AdInsConstant.RestrictionNotIn = "NotIn";
|
|
48
|
+
AdInsConstant.RestrictionOr = "Or"; //pastikan ada 1 criteria sebelumnya
|
|
49
|
+
AdInsConstant.RestrictionOrNeq = "OrNeq"; //pastikan ada 1 criteria sebelumnya
|
|
50
|
+
AdInsConstant.RestrictionIsNull = "ISNULL";
|
|
51
|
+
AdInsConstant.RestrictionIsNotNull = "ISNOTNULL";
|
|
52
|
+
AdInsConstant.RestrictionGTE = "GTE";
|
|
53
|
+
AdInsConstant.RestrictionLTE = "LTE";
|
|
54
|
+
AdInsConstant.showData = "10,50,100";
|
|
55
|
+
AdInsConstant.JoinTypeInner = "INNER";
|
|
56
|
+
AdInsConstant.JoinTypeLeft = "LEFT";
|
|
57
|
+
|
|
58
|
+
class IntegrationObj {
|
|
59
|
+
constructor() {
|
|
60
|
+
this.baseUrl = "";
|
|
61
|
+
this.apiPath = "";
|
|
62
|
+
this.requestObj = new Object();
|
|
63
|
+
this.leftColumnToJoin = "";
|
|
64
|
+
this.rightColumnToJoin = "";
|
|
65
|
+
this.joinType = AdInsConstant.JoinTypeInner;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
class InputSearchObj {
|
|
70
|
+
constructor() {
|
|
71
|
+
this._url = "";
|
|
72
|
+
this.enviromentUrl = "";
|
|
73
|
+
this.title = "";
|
|
74
|
+
this.apiQryPaging = "";
|
|
75
|
+
this.arrCritObj = null;
|
|
76
|
+
this.addCritInput = new Array();
|
|
77
|
+
this.listEnvironments = new Array();
|
|
78
|
+
this.whereValue = new Array();
|
|
79
|
+
this.fromValue = new Array();
|
|
80
|
+
this.switchValue = new Array();
|
|
81
|
+
this.integrationObj = new IntegrationObj();
|
|
82
|
+
this.isJoinExAPI = false;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
class EnviObj {
|
|
86
|
+
constructor() {
|
|
87
|
+
this.name = "";
|
|
88
|
+
this.environment = "";
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
class WhereValueObj {
|
|
92
|
+
constructor() {
|
|
93
|
+
this.property = "";
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
class FromValueObj {
|
|
97
|
+
constructor() {
|
|
98
|
+
this.property = "";
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
class SwitchValueObj {
|
|
102
|
+
constructor() {
|
|
103
|
+
this.property = "";
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
class EnvisObj {
|
|
107
|
+
constructor() {
|
|
108
|
+
this.environment = "";
|
|
109
|
+
this.url = "";
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
class CriteriaObj {
|
|
114
|
+
constructor() {
|
|
115
|
+
this.low = 0;
|
|
116
|
+
this.high = 0;
|
|
117
|
+
this.DataType = 'Text';
|
|
118
|
+
this.isCriteriaDataTable = false;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
class RequestCriteriaObj {
|
|
123
|
+
constructor() {
|
|
124
|
+
this.includeCount = true;
|
|
125
|
+
this.includeData = true;
|
|
126
|
+
this.isLoading = true;
|
|
127
|
+
this.queryString = '';
|
|
128
|
+
this.rowVersion = '';
|
|
129
|
+
this.integrationObj = new IntegrationObj();
|
|
130
|
+
this.joinType = AdInsConstant.JoinTypeInner;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const EXCEL_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8';
|
|
135
|
+
const EXCEL_EXTENSION = '.xlsx';
|
|
136
|
+
class ExcelService {
|
|
137
|
+
constructor() { }
|
|
138
|
+
exportAsExcelFile(json, excelFileName) {
|
|
139
|
+
const worksheet = XLSX.utils.json_to_sheet(json);
|
|
140
|
+
console.log('worksheet', worksheet);
|
|
141
|
+
const workbook = { Sheets: { 'data': worksheet }, SheetNames: ['data'] };
|
|
142
|
+
const excelBuffer = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' });
|
|
143
|
+
//const excelBuffer: any = XLSX.write(workbook, { bookType: 'xlsx', type: 'buffer' });
|
|
144
|
+
this.saveAsExcelFile(excelBuffer, excelFileName);
|
|
145
|
+
}
|
|
146
|
+
saveAsExcelFile(buffer, fileName) {
|
|
147
|
+
const data = new Blob([buffer], {
|
|
148
|
+
type: EXCEL_TYPE
|
|
149
|
+
});
|
|
150
|
+
FileSaver.saveAs(data, fileName + '_export_' + new Date().getTime() + EXCEL_EXTENSION);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
/** @nocollapse */ /** @nocollapse */ ExcelService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: ExcelService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
154
|
+
/** @nocollapse */ /** @nocollapse */ ExcelService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: ExcelService });
|
|
155
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: ExcelService, decorators: [{
|
|
156
|
+
type: Injectable
|
|
157
|
+
}], ctorParameters: function () { return []; } });
|
|
158
|
+
|
|
159
|
+
class KeyValueReportObj {
|
|
160
|
+
constructor() {
|
|
161
|
+
this.key = 0;
|
|
162
|
+
this.value = "";
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
class ExportTypeConstant {
|
|
166
|
+
}
|
|
167
|
+
ExportTypeConstant.EXP_TYPE_PDF = 0;
|
|
168
|
+
ExportTypeConstant.EXP_TYPE_XLS = 1;
|
|
169
|
+
ExportTypeConstant.EXP_TYPE_XLSX = 2;
|
|
170
|
+
ExportTypeConstant.EXP_TYPE_DOC = 3;
|
|
171
|
+
ExportTypeConstant.EXP_TYPE_DOCX = 4;
|
|
172
|
+
|
|
173
|
+
class KeyValueUCSearchObj {
|
|
174
|
+
constructor() {
|
|
175
|
+
this.key = 0;
|
|
176
|
+
this.value = "";
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
class ListKeyValueMonth {
|
|
180
|
+
constructor() {
|
|
181
|
+
this.DictOfMonth = {};
|
|
182
|
+
this.ListOfMonth = new Array();
|
|
183
|
+
this.DictOfMonth = {};
|
|
184
|
+
this.ListOfMonth.push({ key: 1, value: "January" });
|
|
185
|
+
this.DictOfMonth[1] = "January";
|
|
186
|
+
this.ListOfMonth.push({ key: 2, value: "February" });
|
|
187
|
+
this.DictOfMonth[2] = "February";
|
|
188
|
+
this.ListOfMonth.push({ key: 3, value: "March" });
|
|
189
|
+
this.DictOfMonth[3] = "March";
|
|
190
|
+
this.ListOfMonth.push({ key: 4, value: "April" });
|
|
191
|
+
this.DictOfMonth[4] = "April";
|
|
192
|
+
this.ListOfMonth.push({ key: 5, value: "May" });
|
|
193
|
+
this.DictOfMonth[5] = "May";
|
|
194
|
+
this.ListOfMonth.push({ key: 6, value: "June" });
|
|
195
|
+
this.DictOfMonth[6] = "June";
|
|
196
|
+
this.ListOfMonth.push({ key: 7, value: "July" });
|
|
197
|
+
this.DictOfMonth[7] = "July";
|
|
198
|
+
this.ListOfMonth.push({ key: 8, value: "August" });
|
|
199
|
+
this.DictOfMonth[8] = "August";
|
|
200
|
+
this.ListOfMonth.push({ key: 9, value: "September" });
|
|
201
|
+
this.DictOfMonth[9] = "September";
|
|
202
|
+
this.ListOfMonth.push({ key: 10, value: "October" });
|
|
203
|
+
this.DictOfMonth[10] = "October";
|
|
204
|
+
this.ListOfMonth.push({ key: 11, value: "November" });
|
|
205
|
+
this.DictOfMonth[11] = "November";
|
|
206
|
+
this.ListOfMonth.push({ key: 12, value: "December" });
|
|
207
|
+
this.DictOfMonth[12] = "December";
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
class TextSearchPipe {
|
|
212
|
+
transform(items, text) {
|
|
213
|
+
if (!text) {
|
|
214
|
+
return items;
|
|
215
|
+
}
|
|
216
|
+
return items.filter((item) => {
|
|
217
|
+
if (item.Value && typeof item.Value === 'string') {
|
|
218
|
+
return item.Value.toLowerCase().indexOf(text.toLowerCase()) > -1;
|
|
219
|
+
}
|
|
220
|
+
return false;
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
/** @nocollapse */ /** @nocollapse */ TextSearchPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: TextSearchPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
225
|
+
/** @nocollapse */ /** @nocollapse */ TextSearchPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: TextSearchPipe, name: "textSearch" });
|
|
226
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: TextSearchPipe, decorators: [{
|
|
227
|
+
type: Pipe,
|
|
228
|
+
args: [{
|
|
229
|
+
name: 'textSearch'
|
|
230
|
+
}]
|
|
231
|
+
}] });
|
|
232
|
+
|
|
233
|
+
class UCSearchComponent {
|
|
234
|
+
constructor(http, excelService, _renderer2, _document, toastr, cookieService, datePipe, elemRef) {
|
|
235
|
+
this.http = http;
|
|
236
|
+
this.excelService = excelService;
|
|
237
|
+
this._renderer2 = _renderer2;
|
|
238
|
+
this._document = _document;
|
|
239
|
+
this.toastr = toastr;
|
|
240
|
+
this.cookieService = cookieService;
|
|
241
|
+
this.datePipe = datePipe;
|
|
242
|
+
this.elemRef = elemRef;
|
|
243
|
+
this.searchInput = new InputSearchObj();
|
|
244
|
+
this.pageSize = 10;
|
|
245
|
+
this.isReport = false;
|
|
246
|
+
this.result = new EventEmitter();
|
|
247
|
+
this.genRpt = new EventEmitter();
|
|
248
|
+
this.reqGetAllData = new EventEmitter();
|
|
249
|
+
this.ExportTypeList = [
|
|
250
|
+
{
|
|
251
|
+
key: ExportTypeConstant.EXP_TYPE_PDF,
|
|
252
|
+
value: "PDF"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
key: ExportTypeConstant.EXP_TYPE_XLS,
|
|
256
|
+
value: "Excel 2003"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
key: ExportTypeConstant.EXP_TYPE_XLSX,
|
|
260
|
+
value: "Excel 2007"
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
key: ExportTypeConstant.EXP_TYPE_DOC,
|
|
264
|
+
value: "Document"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
key: ExportTypeConstant.EXP_TYPE_DOCX,
|
|
268
|
+
value: "Document XML"
|
|
269
|
+
},
|
|
270
|
+
];
|
|
271
|
+
this.ListOfMonth = new ListKeyValueMonth();
|
|
272
|
+
this.ListOfYear = new Array();
|
|
273
|
+
this.ClaimList = [
|
|
274
|
+
{
|
|
275
|
+
Key: AdInsConstant.RestrictionIsNotNull,
|
|
276
|
+
Value: "CLAIMED"
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
Key: AdInsConstant.RestrictionIsNull,
|
|
280
|
+
Value: "UNCLAIMED"
|
|
281
|
+
},
|
|
282
|
+
];
|
|
283
|
+
this.ExportType = 0;
|
|
284
|
+
this.pageNow = 1;
|
|
285
|
+
this.isDataLoaded = false;
|
|
286
|
+
this.isHidden = false;
|
|
287
|
+
this.BusinessDt = new Date();
|
|
288
|
+
this.dateWrong = false;
|
|
289
|
+
this.readonly = false;
|
|
290
|
+
this.currentState = 'initial';
|
|
291
|
+
this.countForm = 0;
|
|
292
|
+
this.formattedAmount = '';
|
|
293
|
+
this.amount = 0;
|
|
294
|
+
}
|
|
295
|
+
// isListHide: boolean = true;
|
|
296
|
+
// @HostListener('document:click', ['$event'])
|
|
297
|
+
// onClick(ev: MouseEvent) {
|
|
298
|
+
// const clickInside = this.elemRef.nativeElement.contains(ev.target);
|
|
299
|
+
// if (!clickInside) {
|
|
300
|
+
// this.isListHide = true;
|
|
301
|
+
// }
|
|
302
|
+
// }
|
|
303
|
+
set content(content) {
|
|
304
|
+
if (content) { // initially setter gets called with undefined
|
|
305
|
+
this.searchForm = content;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
changeState() {
|
|
309
|
+
this.currentState = this.currentState == 'initial' ? 'final' : 'initial';
|
|
310
|
+
this.isHidden = !this.isHidden ? true : false;
|
|
311
|
+
}
|
|
312
|
+
ngOnInit() {
|
|
313
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
314
|
+
console.log("ucsearch");
|
|
315
|
+
this.apiUrl = this.searchInput.enviromentUrl + this.searchInput.apiQryPaging;
|
|
316
|
+
this.arrCrit = this.searchInput.arrCritObj;
|
|
317
|
+
let js = this._renderer2.createElement('script');
|
|
318
|
+
js.text = `
|
|
319
|
+
$(document).ready(function(){
|
|
320
|
+
$("#flip").click(function(){
|
|
321
|
+
$("#panel").slideToggle("slow");
|
|
322
|
+
});
|
|
323
|
+
});
|
|
324
|
+
`;
|
|
325
|
+
this._renderer2.appendChild(this._document.body, js);
|
|
326
|
+
let value = this.cookieService.get('BusinessDateRaw');
|
|
327
|
+
this.BisDt = this.DecryptString(value, "AdInsFOU12345678");
|
|
328
|
+
this.BusinessDt = new Date(this.BisDt);
|
|
329
|
+
yield this.initiateForm();
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
initiateForm() {
|
|
333
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
334
|
+
yield this.getJSON(this.searchInput._url).subscribe(data => {
|
|
335
|
+
this.configuration = data;
|
|
336
|
+
this.exportData = data.exportExcel;
|
|
337
|
+
if (data.exportTypeList != undefined && data.exportTypeList.length != 0) {
|
|
338
|
+
this.ExportTypeList = data.exportTypeList;
|
|
339
|
+
this.ExportType = this.ExportTypeList[0].key;
|
|
340
|
+
}
|
|
341
|
+
this.countForm = data.component.length;
|
|
342
|
+
this.isDataLoaded = true;
|
|
343
|
+
if (this.searchInput.title != undefined && this.searchInput.title != "") {
|
|
344
|
+
this.configuration.title = this.searchInput.title;
|
|
345
|
+
}
|
|
346
|
+
for (let i = 0; i < this.countForm; i++) {
|
|
347
|
+
//ini kalau datanya di load dari URL
|
|
348
|
+
if (data.component[i].isFromURL) {
|
|
349
|
+
let request = new RequestCriteriaObj();
|
|
350
|
+
let arrayCrit = new Array();
|
|
351
|
+
let criteriaObject = new CriteriaObj();
|
|
352
|
+
criteriaObject.DataType = "text";
|
|
353
|
+
criteriaObject.propName = data.component[i].criteriaPropName;
|
|
354
|
+
criteriaObject.value = data.component[i].criteriaPropValue;
|
|
355
|
+
criteriaObject.restriction = "eq";
|
|
356
|
+
arrayCrit.push(criteriaObject);
|
|
357
|
+
request.criteria = arrayCrit;
|
|
358
|
+
request[data.component[i].criteriaPropName] = data.component[i].criteriaPropValue;
|
|
359
|
+
// Pengecekan penggunaan url atau path
|
|
360
|
+
if (data.component[i].path != undefined && data.component[i].path != "") {
|
|
361
|
+
if (this.searchInput.listEnvironments != undefined && this.searchInput.listEnvironments.length != 0) {
|
|
362
|
+
for (let y = 0; y < this.searchInput.listEnvironments.length; y++) {
|
|
363
|
+
if (data.component[i].environment == this.searchInput.listEnvironments[y].environment) {
|
|
364
|
+
data.component[i].fullpath = this.searchInput.listEnvironments[y].url + data.component[i].path;
|
|
365
|
+
break;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
else {
|
|
370
|
+
data.component[i].fullpath = data.component[i].url;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
else {
|
|
374
|
+
data.component[i].fullpath = data.component[i].url;
|
|
375
|
+
}
|
|
376
|
+
//lempar objectnya sekalian sama urlnya, nnti di bind di dalem karena masalah di asyncnya
|
|
377
|
+
//biar tiap function ada state2nya sendiri
|
|
378
|
+
this.resolveObject(data.component[i], data.component[i].fullpath, request);
|
|
379
|
+
}
|
|
380
|
+
if (data.component[i].type == "numeric") {
|
|
381
|
+
data.component[i].value = parseFloat(data.component[i].value).toLocaleString('en');
|
|
382
|
+
}
|
|
383
|
+
//pengecekan ddl
|
|
384
|
+
if (data.component[i].type == "dropdown") {
|
|
385
|
+
if (data.component[i].dtmType != undefined) {
|
|
386
|
+
if (data.component[i].dtmType.includes("month")) {
|
|
387
|
+
if (data.component[i].value != undefined && data.component[i].value.includes("BD")) {
|
|
388
|
+
data.component[i].value = this.setDefaultValueMonth(data.component[i].value);
|
|
389
|
+
}
|
|
390
|
+
data.component[i].items = this.setMonthDDL(data.component[i].dtmType);
|
|
391
|
+
}
|
|
392
|
+
if (data.component[i].dtmType.includes("year")) {
|
|
393
|
+
if (data.component[i].value != undefined && data.component[i].value.includes("BD")) {
|
|
394
|
+
data.component[i].value = this.setDefaultValueYear(data.component[i].value);
|
|
395
|
+
}
|
|
396
|
+
data.component[i].items = this.setYearDDL(data.component[i].dtmType);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
// if (data.component[i].type == "dropdownSearch" && !data.component[i].isFromURL && data.component[i].items?.length != 1) {
|
|
401
|
+
// if (data.component[i].ddsType == undefined || data.component[i].ddsType == "all") {
|
|
402
|
+
// data.component[i].value = "all";
|
|
403
|
+
// data.component[i].descr = "All";
|
|
404
|
+
// } else if (data.component[i].ddsType == "one") {
|
|
405
|
+
// data.component[i].value = "one";
|
|
406
|
+
// data.component[i].descr = "Select One";
|
|
407
|
+
// }
|
|
408
|
+
// }
|
|
409
|
+
if (data.component[i].type == "dropdownSearch" && !data.component[i].isFromURL && data.component[i].items.length == 1) {
|
|
410
|
+
data.component[i].value = data.component[i].items[0].Key;
|
|
411
|
+
data.component[i].descr = data.component[i].items[0].Value;
|
|
412
|
+
}
|
|
413
|
+
if (data.component[i].type != "dropdownSearch" && !data.component[i].value) {
|
|
414
|
+
data.component[i].value = "";
|
|
415
|
+
if (data.component[i].ddlType == 'all')
|
|
416
|
+
data.component[i].value = "all";
|
|
417
|
+
if (data.component[i].ddlType == 'one')
|
|
418
|
+
data.component[i].value = "one";
|
|
419
|
+
}
|
|
420
|
+
//pengecekan tanggal
|
|
421
|
+
if (data.component[i].type == "datepicker") {
|
|
422
|
+
this.readonly = data.component[i].readonly;
|
|
423
|
+
if (data.component[i].value.includes("BD")) {
|
|
424
|
+
let businessDate = new Date();
|
|
425
|
+
if (this.BisDt != null) {
|
|
426
|
+
businessDate = new Date(this.BisDt);
|
|
427
|
+
}
|
|
428
|
+
let operator = data.component[i].value.charAt(2);
|
|
429
|
+
let dateShow = new Date();
|
|
430
|
+
if (operator == "-") {
|
|
431
|
+
let tempMinus = data.component[i].value.split("-", 2);
|
|
432
|
+
let numDay = parseInt(tempMinus[1]);
|
|
433
|
+
businessDate.setDate(businessDate.getDate() - numDay);
|
|
434
|
+
}
|
|
435
|
+
else if (operator == "+") {
|
|
436
|
+
let tempMinus = data.component[i].value.split("+", 2);
|
|
437
|
+
let numDay = parseInt(tempMinus[1]);
|
|
438
|
+
businessDate.setDate(businessDate.getDate() + numDay);
|
|
439
|
+
}
|
|
440
|
+
dateShow = businessDate;
|
|
441
|
+
let dateText = formatDate(dateShow, 'yyyy-MM-dd', 'en-US');
|
|
442
|
+
data.component[i].value = dateText;
|
|
443
|
+
}
|
|
444
|
+
if (this.readonly = false) {
|
|
445
|
+
if (data.component[i].restriction != undefined && data.component[i].restriction != "") {
|
|
446
|
+
if (data.component[i].restriction.toUpperCase() == "GT") {
|
|
447
|
+
let minDate = new Date(this.datePipe.transform(data.component[i].minDate, 'yyyy-MM-dd'));
|
|
448
|
+
minDate.setDate(minDate.getDate() + 1);
|
|
449
|
+
data.component[i].minDate = minDate;
|
|
450
|
+
}
|
|
451
|
+
else if (data.component[i].restriction.toUpperCase() == "LT") {
|
|
452
|
+
let maxDate = new Date(this.datePipe.transform(data.component[i].maxDate, 'yyyy-MM-dd'));
|
|
453
|
+
maxDate.setDate(maxDate.getDate() - 1);
|
|
454
|
+
data.component[i].maxDate = maxDate;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
setTimeout(() => {
|
|
461
|
+
for (let j = 0; j < this.countForm; j++) {
|
|
462
|
+
if (data.component[j].isEvent && this.configuration.component[j].itemsUrl.length == 1) {
|
|
463
|
+
this.onChangeEvent(data.component[j].itemsUrl[0].Key, data.component[j]);
|
|
464
|
+
}
|
|
465
|
+
if (data.component[j].type == "officeRoleCodes" && this.configuration.component[j].itemsUrl.length > 0) {
|
|
466
|
+
this.SetRoleOfficeCodes(j);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
}, 1000);
|
|
470
|
+
});
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
SetRoleOfficeCodes(i) {
|
|
474
|
+
let value = this.cookieService.get("UserAccess");
|
|
475
|
+
let userAccess = JSON.parse(this.DecryptString(value, "AdInsFOU12345678"));
|
|
476
|
+
let roleCode = userAccess["RoleCode"];
|
|
477
|
+
let listOfficeRoleCodes = new Array();
|
|
478
|
+
listOfficeRoleCodes.push(roleCode);
|
|
479
|
+
let component = this.myForm.nativeElement[i];
|
|
480
|
+
let ddl = component.options;
|
|
481
|
+
let text = ddl[ddl.selectedIndex].value.trim();
|
|
482
|
+
if (this.configuration.component[i].itemsUrl.length == 1 || (this.configuration.component[i].ddlType == 'all' && text == 'all')) {
|
|
483
|
+
for (let index = 0; index < this.configuration.component[i].itemsUrl.length; index++) {
|
|
484
|
+
const element = this.configuration.component[i].itemsUrl[index];
|
|
485
|
+
listOfficeRoleCodes.push(element.Key);
|
|
486
|
+
listOfficeRoleCodes.push(roleCode + "-" + element.Key);
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
else {
|
|
490
|
+
listOfficeRoleCodes.push(text);
|
|
491
|
+
listOfficeRoleCodes.push(roleCode + "-" + text);
|
|
492
|
+
}
|
|
493
|
+
this.searchInput.integrationObj.requestObj["OfficeRoleCodes"] = listOfficeRoleCodes;
|
|
494
|
+
}
|
|
495
|
+
setDefaultValueMonth(value) {
|
|
496
|
+
let businessDate = new Date(this.BusinessDt);
|
|
497
|
+
let operator = value.charAt(2);
|
|
498
|
+
let tempValue = value.split(operator, 2);
|
|
499
|
+
let numMonth = parseInt(tempValue[1]);
|
|
500
|
+
if (!numMonth)
|
|
501
|
+
numMonth = 1;
|
|
502
|
+
if (operator == "-") {
|
|
503
|
+
businessDate.setMonth(businessDate.getMonth() - numMonth);
|
|
504
|
+
}
|
|
505
|
+
else if (operator == "+") {
|
|
506
|
+
businessDate.setMonth(businessDate.getMonth() + numMonth);
|
|
507
|
+
}
|
|
508
|
+
return businessDate.getMonth();
|
|
509
|
+
}
|
|
510
|
+
setMonthDDL(month) {
|
|
511
|
+
let ListOfMonth;
|
|
512
|
+
let equation = month.match("[\\/+][-]|[-][\\/+]|\\/+|-");
|
|
513
|
+
let toMin = this.BusinessDt.getMonth();
|
|
514
|
+
let toMax = this.BusinessDt.getMonth();
|
|
515
|
+
let tempEquation = equation[0];
|
|
516
|
+
let minMax = parseInt(month.substring(equation.index + equation[0].length));
|
|
517
|
+
if (minMax >= 12)
|
|
518
|
+
return this.ListOfMonth.ListOfMonth;
|
|
519
|
+
if ((tempEquation == "+-" || tempEquation == "-+") && minMax >= 6)
|
|
520
|
+
return this.ListOfMonth.ListOfMonth;
|
|
521
|
+
let dictOfMonth = this.ListOfMonth.DictOfMonth;
|
|
522
|
+
ListOfMonth.push({ key: toMin, value: dictOfMonth[toMin] });
|
|
523
|
+
for (let q = 0; q < minMax; q++) {
|
|
524
|
+
if (tempEquation.includes("-")) {
|
|
525
|
+
toMin--;
|
|
526
|
+
if (toMin == 0)
|
|
527
|
+
toMin = 12;
|
|
528
|
+
ListOfMonth.push({ key: toMin, value: dictOfMonth[toMin] });
|
|
529
|
+
}
|
|
530
|
+
if (tempEquation.includes("+")) {
|
|
531
|
+
toMax++;
|
|
532
|
+
if (toMax == 13)
|
|
533
|
+
toMax = 1;
|
|
534
|
+
ListOfMonth.push({ key: toMax, value: dictOfMonth[toMax] });
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
ListOfMonth.sort((a, b) => {
|
|
538
|
+
return a.key - b.key;
|
|
539
|
+
});
|
|
540
|
+
return ListOfMonth;
|
|
541
|
+
}
|
|
542
|
+
setDefaultValueYear(value) {
|
|
543
|
+
let businessDate = new Date(this.BusinessDt);
|
|
544
|
+
let operator = value.charAt(2);
|
|
545
|
+
let tempValue = value.split(operator, 2);
|
|
546
|
+
let numYear = parseInt(tempValue[1]);
|
|
547
|
+
if (!numYear)
|
|
548
|
+
numYear = 1;
|
|
549
|
+
if (operator == "-") {
|
|
550
|
+
businessDate.setFullYear(businessDate.getFullYear() - numYear);
|
|
551
|
+
}
|
|
552
|
+
else if (operator == "+") {
|
|
553
|
+
businessDate.setFullYear(businessDate.getFullYear() + numYear);
|
|
554
|
+
}
|
|
555
|
+
return businessDate.getFullYear();
|
|
556
|
+
}
|
|
557
|
+
setYearDDL(year) {
|
|
558
|
+
this.ListOfYear = new Array();
|
|
559
|
+
let equation = year.match("[\\/+][-]|[-][\\/+]|\\/+|-");
|
|
560
|
+
let toMin = this.BusinessDt.getFullYear();
|
|
561
|
+
let toMax = this.BusinessDt.getFullYear();
|
|
562
|
+
let minMax = parseInt(year.substring(equation.index + equation[0].length));
|
|
563
|
+
this.ListOfYear.push({ key: this.BusinessDt.getFullYear(), value: this.BusinessDt.getFullYear().toString() });
|
|
564
|
+
for (let q = 0; q < minMax; q++) {
|
|
565
|
+
if (equation[0] == "-+" || equation[0] == "+-") {
|
|
566
|
+
toMin--;
|
|
567
|
+
toMax++;
|
|
568
|
+
this.ListOfYear.push({ key: toMin, value: toMin.toString() }, { key: toMax, value: toMax.toString() });
|
|
569
|
+
}
|
|
570
|
+
else if (equation[0] == "-") {
|
|
571
|
+
toMin--;
|
|
572
|
+
this.ListOfYear.push({ key: toMin, value: toMin.toString() });
|
|
573
|
+
}
|
|
574
|
+
else if (equation[0] == "+") {
|
|
575
|
+
toMax++;
|
|
576
|
+
this.ListOfYear.push({ key: toMax, value: toMax.toString() });
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
this.ListOfYear.sort((a, b) => {
|
|
580
|
+
return a.key - b.key;
|
|
581
|
+
});
|
|
582
|
+
return this.ListOfYear;
|
|
583
|
+
}
|
|
584
|
+
getJSON(url) {
|
|
585
|
+
return this.http.get(url);
|
|
586
|
+
}
|
|
587
|
+
postJSON(url, criteria = null) {
|
|
588
|
+
return this.http.post(url, criteria);
|
|
589
|
+
}
|
|
590
|
+
searchClick() {
|
|
591
|
+
// for(let i=0;i<this.countForm;i++){
|
|
592
|
+
// if(this.configuration.component[i].type == "datepicker"){
|
|
593
|
+
// if ((i != (this.countForm-1)) && (this.configuration.component[i].name != this.configuration.component[i+1].name)){
|
|
594
|
+
// this.checkInputDate(this.configuration.component[i]);
|
|
595
|
+
// }
|
|
596
|
+
// }
|
|
597
|
+
// }
|
|
598
|
+
// if(this.dateWrong) return;
|
|
599
|
+
let order = null;
|
|
600
|
+
if (this.configuration.orderby != null) {
|
|
601
|
+
order = {
|
|
602
|
+
key: this.configuration.orderby.key,
|
|
603
|
+
value: this.configuration.orderby.value
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
this.pageNow = 1;
|
|
607
|
+
this.search(this.apiUrl, this.pageNow, this.pageSize, order, this.arrCrit);
|
|
608
|
+
}
|
|
609
|
+
reset() {
|
|
610
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
611
|
+
this.searchForm.resetForm({
|
|
612
|
+
ExportType: this.ExportTypeList[0].key
|
|
613
|
+
});
|
|
614
|
+
yield this.initiateForm();
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
search(apiUrl, pageNo, rowPerPage, orderBy, addCrit = new Array()) {
|
|
618
|
+
let request = new RequestCriteriaObj();
|
|
619
|
+
let arrCrit = new Array();
|
|
620
|
+
let IsQueryIn = false;
|
|
621
|
+
let IsBreak = false;
|
|
622
|
+
// Inject whereQuery for where criteria
|
|
623
|
+
if (this.searchInput.whereValue != undefined && this.searchInput.whereValue.length != 0) {
|
|
624
|
+
this.configuration.querystring.whereQuery = new Array();
|
|
625
|
+
for (let x = 0; x < this.searchInput.whereValue.length; x++) {
|
|
626
|
+
this.configuration.querystring.whereQuery.push(this.searchInput.whereValue[x].value);
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
if (this.searchInput.fromValue != undefined && this.searchInput.fromValue.length != 0) {
|
|
630
|
+
this.configuration.querystring.fromQuery = new Array();
|
|
631
|
+
for (let x = 0; x < this.searchInput.fromValue.length; x++) {
|
|
632
|
+
this.configuration.querystring.fromQuery.push(this.searchInput.fromValue[x].value);
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
request.pageNo = pageNo;
|
|
636
|
+
request.rowPerPage = rowPerPage;
|
|
637
|
+
request.orderBy = orderBy;
|
|
638
|
+
request.queryString = this.configuration.querystring;
|
|
639
|
+
let formSeq = -1;
|
|
640
|
+
for (let i = 0; i < this.countForm; i++) {
|
|
641
|
+
let critObj = new CriteriaObj();
|
|
642
|
+
if (this.configuration.component[i].type == "dropdownSearch") {
|
|
643
|
+
formSeq += 3;
|
|
644
|
+
}
|
|
645
|
+
else {
|
|
646
|
+
formSeq++;
|
|
647
|
+
}
|
|
648
|
+
let component = this.myForm.nativeElement[formSeq];
|
|
649
|
+
// // popup message if required
|
|
650
|
+
// if (component.getAttribute('data-required') != null && component.getAttribute('data-required') == "true") {
|
|
651
|
+
// let val = component.value.trim();
|
|
652
|
+
// if (val == "") {
|
|
653
|
+
// IsBreak = true;
|
|
654
|
+
// let label = component.getAttribute('label');
|
|
655
|
+
// this.toastr.warning("Please input " + label);
|
|
656
|
+
// break;
|
|
657
|
+
// }
|
|
658
|
+
// }
|
|
659
|
+
critObj.DataType = component.getAttribute('data-type');
|
|
660
|
+
//Ini khusus kalau dari Drop Down
|
|
661
|
+
if (component.getAttribute('query-in') != null && component.getAttribute('query-in') == "true") {
|
|
662
|
+
IsQueryIn = true;
|
|
663
|
+
}
|
|
664
|
+
else {
|
|
665
|
+
IsQueryIn = false;
|
|
666
|
+
}
|
|
667
|
+
if (component.value != "") {
|
|
668
|
+
if (component.nodeName == 'SELECT') {
|
|
669
|
+
let ddl = component.options;
|
|
670
|
+
let text = ddl[ddl.selectedIndex].value.trim();
|
|
671
|
+
if (text == "one") {
|
|
672
|
+
IsBreak = true;
|
|
673
|
+
let label = component.getAttribute('label');
|
|
674
|
+
this.toastr.warning("Please select " + label);
|
|
675
|
+
break;
|
|
676
|
+
}
|
|
677
|
+
if (component.getAttribute('data-crit-datatable') != "" && component.getAttribute('data-crit-datatable') != null) {
|
|
678
|
+
critObj.isCriteriaDataTable = component.getAttribute('data-crit-datatable');
|
|
679
|
+
}
|
|
680
|
+
if (this.configuration.component[i].type == "taskDefinitionKey" ||
|
|
681
|
+
this.configuration.component[i].type == "processKey")
|
|
682
|
+
continue;
|
|
683
|
+
if (this.configuration.component[i].type == "claim") {
|
|
684
|
+
critObj.propName = component.getAttribute('data-name');
|
|
685
|
+
critObj.restriction = text;
|
|
686
|
+
critObj.value = null;
|
|
687
|
+
arrCrit.push(critObj);
|
|
688
|
+
}
|
|
689
|
+
else {
|
|
690
|
+
if (text != "all" && text != "one") {
|
|
691
|
+
//Kalau Dari Dropdown udah pasti pake Eq
|
|
692
|
+
critObj.restriction = AdInsConstant.RestrictionEq;
|
|
693
|
+
if (component.name != "") {
|
|
694
|
+
critObj.propName = component.name;
|
|
695
|
+
}
|
|
696
|
+
else {
|
|
697
|
+
critObj.propName = component.getAttribute('data-name');
|
|
698
|
+
}
|
|
699
|
+
critObj.value = text;
|
|
700
|
+
arrCrit.push(critObj);
|
|
701
|
+
}
|
|
702
|
+
else if (text == "all" && IsQueryIn && component.options.length != 0) {
|
|
703
|
+
let ddlList = new Array();
|
|
704
|
+
for (let x = 0; x < component.options.length; x++) {
|
|
705
|
+
if (x != 0) {
|
|
706
|
+
ddlList.push(component.options[x].value);
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
if (ddlList.length != 0) {
|
|
710
|
+
critObj.restriction = AdInsConstant.RestrictionIn;
|
|
711
|
+
if (component.name != "") {
|
|
712
|
+
critObj.propName = component.name;
|
|
713
|
+
}
|
|
714
|
+
else {
|
|
715
|
+
critObj.propName = component.getAttribute('data-name');
|
|
716
|
+
}
|
|
717
|
+
critObj.listValue = ddlList;
|
|
718
|
+
arrCrit.push(critObj);
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
else {
|
|
724
|
+
//Kalau ada Percent maka yang dipake nnti adalah Restrictions Like
|
|
725
|
+
if (component.name != "") {
|
|
726
|
+
critObj.propName = component.name;
|
|
727
|
+
}
|
|
728
|
+
else {
|
|
729
|
+
critObj.propName = component.getAttribute('data-name');
|
|
730
|
+
}
|
|
731
|
+
critObj.value = component.value.trim();
|
|
732
|
+
if (component.value.includes("%")) {
|
|
733
|
+
critObj.restriction = AdInsConstant.RestrictionLike;
|
|
734
|
+
}
|
|
735
|
+
//kalau componentnya Date, restrictionsnya lgsg ambil dari property JSONnya
|
|
736
|
+
else if (component.getAttribute('data-restriction') != "" && component.getAttribute('data-restriction') != null) {
|
|
737
|
+
critObj.restriction = component.getAttribute('data-restriction');
|
|
738
|
+
if (component.getAttribute('data-type') == 'numeric') {
|
|
739
|
+
critObj.value = parseFloat(component.value.replace(/,/g, '')).toString();
|
|
740
|
+
}
|
|
741
|
+
if (critObj.restriction.toUpperCase() == "LIKE") {
|
|
742
|
+
critObj.value = "%" + component.value.trim() + "%";
|
|
743
|
+
critObj.restriction = AdInsConstant.RestrictionLike;
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
else {
|
|
747
|
+
critObj.restriction = AdInsConstant.RestrictionEq;
|
|
748
|
+
}
|
|
749
|
+
if (component.getAttribute('data-crit-datatable') != "" && component.getAttribute('data-crit-datatable') != null) {
|
|
750
|
+
critObj.isCriteriaDataTable = component.getAttribute('data-crit-datatable');
|
|
751
|
+
}
|
|
752
|
+
arrCrit.push(critObj);
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
if (IsBreak) {
|
|
757
|
+
return;
|
|
758
|
+
}
|
|
759
|
+
if (addCrit != null && addCrit != undefined) {
|
|
760
|
+
if (addCrit.length != 0) {
|
|
761
|
+
for (let i = 0; i < addCrit.length; i++) {
|
|
762
|
+
arrCrit.push(addCrit[i]);
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
else if (this.searchInput.addCritInput != null || this.searchInput.addCritInput != undefined) {
|
|
766
|
+
for (let i = 0; i < this.searchInput.addCritInput.length; i++) {
|
|
767
|
+
arrCrit.push(this.searchInput.addCritInput[i]);
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
else if (this.searchInput.addCritInput != null || this.searchInput.addCritInput != undefined) {
|
|
772
|
+
for (let i = 0; i < this.searchInput.addCritInput.length; i++) {
|
|
773
|
+
arrCrit.push(this.searchInput.addCritInput[i]);
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
request.criteria = arrCrit;
|
|
777
|
+
if (!this.searchInput.isJoinExAPI) {
|
|
778
|
+
request.integrationObj = null;
|
|
779
|
+
}
|
|
780
|
+
else {
|
|
781
|
+
request.integrationObj = this.searchInput.integrationObj;
|
|
782
|
+
}
|
|
783
|
+
this.http.post(apiUrl, request).subscribe((response) => {
|
|
784
|
+
let qryPaging = {
|
|
785
|
+
response: response,
|
|
786
|
+
pageNow: pageNo
|
|
787
|
+
};
|
|
788
|
+
console.log(qryPaging);
|
|
789
|
+
this.result.emit(qryPaging);
|
|
790
|
+
this.reqGetAllData.emit(request);
|
|
791
|
+
return response;
|
|
792
|
+
});
|
|
793
|
+
}
|
|
794
|
+
GenerateReport() {
|
|
795
|
+
this.genRpt.emit({ ExportType: this.ExportType, ElRef: this.myForm });
|
|
796
|
+
}
|
|
797
|
+
lessThanFour() {
|
|
798
|
+
if (this.countForm > 3) {
|
|
799
|
+
return false;
|
|
800
|
+
}
|
|
801
|
+
else {
|
|
802
|
+
return true;
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
resolveObject(obj, url, crit = null) {
|
|
806
|
+
const val = this.postJSON(url, crit);
|
|
807
|
+
val.subscribe(tempData => {
|
|
808
|
+
obj.itemsUrl = new Array();
|
|
809
|
+
obj.itemsUrl = tempData.ReturnObject;
|
|
810
|
+
if (obj.exclude != undefined && obj.exclude != "") {
|
|
811
|
+
obj.itemsUrl = obj.itemsUrl.filter((value) => !obj.exclude.includes(value.Key));
|
|
812
|
+
}
|
|
813
|
+
if (obj.type == "dropdownSearch" && obj.itemsUrl.length == 1) {
|
|
814
|
+
obj.value = obj.itemsUrl[0].Key;
|
|
815
|
+
obj.descr = obj.itemsUrl[0].Value;
|
|
816
|
+
}
|
|
817
|
+
if (obj.affectedFilter && obj.itemsUrl.length == 1) {
|
|
818
|
+
this.onChangeEvent(obj.itemsUrl[0].Key, obj);
|
|
819
|
+
}
|
|
820
|
+
});
|
|
821
|
+
}
|
|
822
|
+
transformAmount(element) {
|
|
823
|
+
this.formattedAmount = parseFloat(element.target.value).toLocaleString('en');
|
|
824
|
+
// to show the formatted amount in the textbox.
|
|
825
|
+
element.target.value = this.formattedAmount;
|
|
826
|
+
}
|
|
827
|
+
transformToDecimal(element) {
|
|
828
|
+
element.target.value = parseFloat(element.target.value.toString().replace(/,/g, ''));
|
|
829
|
+
}
|
|
830
|
+
exportAsXLSX() {
|
|
831
|
+
let request = new RequestCriteriaObj();
|
|
832
|
+
request.pageNo = 1;
|
|
833
|
+
request.rowPerPage = 9999;
|
|
834
|
+
request.orderBy = null;
|
|
835
|
+
request.criteria = [];
|
|
836
|
+
request.queryString = this.configuration.querystring;
|
|
837
|
+
if (!this.searchInput.isJoinExAPI) {
|
|
838
|
+
request.integrationObj = null;
|
|
839
|
+
}
|
|
840
|
+
else {
|
|
841
|
+
request.integrationObj = this.searchInput.integrationObj;
|
|
842
|
+
}
|
|
843
|
+
this.http.post(this.apiUrl, request).subscribe(response => {
|
|
844
|
+
this.ExcelData = response["Data"];
|
|
845
|
+
this.excelService.exportAsExcelFile(this.ExcelData, 'sample');
|
|
846
|
+
}, (error) => {
|
|
847
|
+
console.log(error);
|
|
848
|
+
});
|
|
849
|
+
}
|
|
850
|
+
onChangeEvent(optValue, afFilter) {
|
|
851
|
+
let jsonComp = this.configuration.component;
|
|
852
|
+
for (let i = 0; i < afFilter.affectedFilter.length; i++) {
|
|
853
|
+
for (let j = 0; j < jsonComp.length; j++) {
|
|
854
|
+
if (jsonComp[j].name == afFilter.affectedFilter[i]) {
|
|
855
|
+
let request = new RequestCriteriaObj();
|
|
856
|
+
let arrayCrit = new Array();
|
|
857
|
+
if (optValue != "all" && optValue != "one") {
|
|
858
|
+
let critObj = new CriteriaObj();
|
|
859
|
+
critObj.DataType = afFilter.datatype;
|
|
860
|
+
if (afFilter.filterPropName != undefined || afFilter.filterPropName != "") {
|
|
861
|
+
request[afFilter.filterPropName] = optValue;
|
|
862
|
+
critObj.propName = afFilter.filterPropName;
|
|
863
|
+
}
|
|
864
|
+
else {
|
|
865
|
+
critObj.propName = afFilter.name;
|
|
866
|
+
request[afFilter.name] = optValue;
|
|
867
|
+
}
|
|
868
|
+
critObj.value = optValue;
|
|
869
|
+
critObj.restriction = AdInsConstant.RestrictionEq;
|
|
870
|
+
arrayCrit.push(critObj);
|
|
871
|
+
}
|
|
872
|
+
request.criteria = arrayCrit;
|
|
873
|
+
if (jsonComp[j].path != undefined && jsonComp[j].path != "") {
|
|
874
|
+
if (this.searchInput.listEnvironments != undefined && this.searchInput.listEnvironments.length != 0) {
|
|
875
|
+
for (let y = 0; y < this.searchInput.listEnvironments.length; y++) {
|
|
876
|
+
if (jsonComp[j].environment == this.searchInput.listEnvironments[y].environment) {
|
|
877
|
+
jsonComp[j].fullpath = this.searchInput.listEnvironments[y].url + jsonComp[j].path;
|
|
878
|
+
break;
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
else {
|
|
883
|
+
jsonComp[j].fullpath = jsonComp[j].url;
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
else {
|
|
887
|
+
jsonComp[j].fullpath = jsonComp[j].url;
|
|
888
|
+
}
|
|
889
|
+
this.resolveObject(jsonComp[j], jsonComp[j].fullpath, request);
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
SetProcessKey(idx, wfKeyFilter) {
|
|
895
|
+
let component = this.myForm.nativeElement[idx];
|
|
896
|
+
let ddl = component.options;
|
|
897
|
+
let text = ddl[ddl.selectedIndex].value.trim();
|
|
898
|
+
if (text) {
|
|
899
|
+
this.searchInput.integrationObj.requestObj[wfKeyFilter] = text;
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
switchCase(condList) {
|
|
903
|
+
let condition = false;
|
|
904
|
+
for (let i = 0; i < condList.conditions.length; i++) {
|
|
905
|
+
let idx = this.searchInput.switchValue.findIndex(x => x.property == condList.conditions[i].property);
|
|
906
|
+
if (condList.conditions[i].restriction == "EQ") {
|
|
907
|
+
if (!condList.conditions[i].isUser) {
|
|
908
|
+
if (this.searchInput.switchValue[idx].value == condList.conditions[i].value) {
|
|
909
|
+
condition = true;
|
|
910
|
+
}
|
|
911
|
+
else {
|
|
912
|
+
condition = false;
|
|
913
|
+
break;
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
else {
|
|
917
|
+
let username = localStorage.getItem("Username");
|
|
918
|
+
if (this.searchInput.switchValue[idx].value == username) {
|
|
919
|
+
condition = true;
|
|
920
|
+
}
|
|
921
|
+
else {
|
|
922
|
+
condition = false;
|
|
923
|
+
break;
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
else if (condList.conditions[i].restriction == "NEQ") {
|
|
928
|
+
if (condList.conditions[i].isUser != true) {
|
|
929
|
+
if (this.searchInput.switchValue[idx].value != condList.conditions[i].value) {
|
|
930
|
+
condition = true;
|
|
931
|
+
}
|
|
932
|
+
else {
|
|
933
|
+
condition = false;
|
|
934
|
+
break;
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
else {
|
|
938
|
+
let username = localStorage.getItem("Username");
|
|
939
|
+
if (this.searchInput.switchValue[idx].value != username) {
|
|
940
|
+
condition = true;
|
|
941
|
+
}
|
|
942
|
+
else {
|
|
943
|
+
condition = false;
|
|
944
|
+
break;
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
else if (condList.conditions[i].restriction == "GT") {
|
|
949
|
+
if (!condList.conditions[i].isUser) {
|
|
950
|
+
if (this.searchInput.switchValue[idx].value > condList.conditions[i].value) {
|
|
951
|
+
condition = true;
|
|
952
|
+
}
|
|
953
|
+
else {
|
|
954
|
+
condition = false;
|
|
955
|
+
break;
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
else {
|
|
959
|
+
let username = localStorage.getItem("Username");
|
|
960
|
+
if (this.searchInput.switchValue[idx].value > username) {
|
|
961
|
+
condition = true;
|
|
962
|
+
}
|
|
963
|
+
else {
|
|
964
|
+
condition = false;
|
|
965
|
+
break;
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
else if (condList.conditions[i].restriction == "GTE") {
|
|
970
|
+
if (!condList.conditions[i].isUser) {
|
|
971
|
+
if (this.searchInput.switchValue[idx].value >= condList.conditions[i].value) {
|
|
972
|
+
condition = true;
|
|
973
|
+
}
|
|
974
|
+
else {
|
|
975
|
+
condition = false;
|
|
976
|
+
break;
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
else {
|
|
980
|
+
let username = localStorage.getItem("Username");
|
|
981
|
+
if (this.searchInput.switchValue[idx].value >= username) {
|
|
982
|
+
condition = true;
|
|
983
|
+
}
|
|
984
|
+
else {
|
|
985
|
+
condition = false;
|
|
986
|
+
break;
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
else if (condList.conditions[i].restriction == "LT") {
|
|
991
|
+
if (!condList.conditions[i].isUser) {
|
|
992
|
+
if (this.searchInput.switchValue[idx].value < condList.conditions[i].value) {
|
|
993
|
+
condition = true;
|
|
994
|
+
}
|
|
995
|
+
else {
|
|
996
|
+
condition = false;
|
|
997
|
+
break;
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
else {
|
|
1001
|
+
let username = localStorage.getItem("Username");
|
|
1002
|
+
if (this.searchInput.switchValue[idx].value < username) {
|
|
1003
|
+
condition = true;
|
|
1004
|
+
}
|
|
1005
|
+
else {
|
|
1006
|
+
condition = false;
|
|
1007
|
+
break;
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
else if (condList.conditions[i].restriction == "LTE") {
|
|
1012
|
+
if (!condList.conditions[i].isUser) {
|
|
1013
|
+
if (this.searchInput.switchValue[idx].value <= condList.conditions[i].value) {
|
|
1014
|
+
condition = true;
|
|
1015
|
+
}
|
|
1016
|
+
else {
|
|
1017
|
+
condition = false;
|
|
1018
|
+
break;
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
else {
|
|
1022
|
+
let username = localStorage.getItem("Username");
|
|
1023
|
+
if (this.searchInput.switchValue[idx].value <= username) {
|
|
1024
|
+
condition = true;
|
|
1025
|
+
}
|
|
1026
|
+
else {
|
|
1027
|
+
condition = false;
|
|
1028
|
+
break;
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
return condition;
|
|
1034
|
+
}
|
|
1035
|
+
DecryptString(chipperText, chipperKey) {
|
|
1036
|
+
if (chipperKey == undefined || chipperKey.trim() == '' ||
|
|
1037
|
+
chipperText == undefined || chipperText.trim() == '')
|
|
1038
|
+
return chipperText;
|
|
1039
|
+
let chipperKeyArr = CryptoJS.enc.Utf8.parse(chipperKey);
|
|
1040
|
+
let iv = CryptoJS.lib.WordArray.create([0x00, 0x00, 0x00, 0x00]);
|
|
1041
|
+
let decrypted = CryptoJS.AES.decrypt(chipperText, chipperKeyArr, { iv: iv });
|
|
1042
|
+
let plainText = decrypted.toString(CryptoJS.enc.Utf8);
|
|
1043
|
+
return plainText;
|
|
1044
|
+
}
|
|
1045
|
+
checkInputDate(component) {
|
|
1046
|
+
let minDateVal;
|
|
1047
|
+
let maxDateVal;
|
|
1048
|
+
let label;
|
|
1049
|
+
let errorMessage = new Array();
|
|
1050
|
+
let MinComponent = this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == "GTE")) == undefined ? this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == "GT")) : this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == "GTE"));
|
|
1051
|
+
if (MinComponent != undefined) {
|
|
1052
|
+
minDateVal = this.myForm.nativeElement[MinComponent.id].min == "" ? null : new Date(this.myForm.nativeElement[MinComponent.id].min);
|
|
1053
|
+
label = MinComponent.label.split(">", 2);
|
|
1054
|
+
if (minDateVal != null) {
|
|
1055
|
+
if (MinComponent.restriction.toUpperCase() == "GT") {
|
|
1056
|
+
minDateVal.setDate(minDateVal.getDate() - 1);
|
|
1057
|
+
errorMessage.push(" must be greater than ");
|
|
1058
|
+
}
|
|
1059
|
+
else if (MinComponent.restriction.toUpperCase() == "GTE") {
|
|
1060
|
+
errorMessage.push(" must be greater than or equals to ");
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
let MaxComponent = this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == "LTE")) == undefined ? this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == "LT")) : this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == "LTE"));
|
|
1065
|
+
if (MaxComponent != undefined) {
|
|
1066
|
+
maxDateVal = this.myForm.nativeElement[MaxComponent.id].max == "" ? null : new Date(this.myForm.nativeElement[MaxComponent.id].max);
|
|
1067
|
+
label = MaxComponent.label.split("<", 2);
|
|
1068
|
+
if (maxDateVal != null) {
|
|
1069
|
+
if (MaxComponent.restriction.toUpperCase() == "LT") {
|
|
1070
|
+
maxDateVal.setDate(maxDateVal.getDate() + 1);
|
|
1071
|
+
errorMessage.push(" must be less than ");
|
|
1072
|
+
}
|
|
1073
|
+
else if (MaxComponent.restriction.toUpperCase() == "LTE") {
|
|
1074
|
+
errorMessage.push(" must be less than or equals to ");
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
if (minDateVal != null && maxDateVal == null && new Date(this.myForm.nativeElement[MinComponent.id].value) < minDateVal) {
|
|
1079
|
+
this.toastr.warning(label[0] + errorMessage[0] + formatDate(minDateVal, 'dd MMMM yyyy', 'en-US') + ".");
|
|
1080
|
+
this.dateWrong = true;
|
|
1081
|
+
}
|
|
1082
|
+
else if (maxDateVal != null && minDateVal == null && new Date(this.myForm.nativeElement[MaxComponent.id].value) > maxDateVal) {
|
|
1083
|
+
this.toastr.warning(label[0] + errorMessage[0] + formatDate(maxDateVal, 'dd MMMM yyyy', 'en-US') + ".");
|
|
1084
|
+
this.dateWrong = true;
|
|
1085
|
+
}
|
|
1086
|
+
else if (minDateVal != null && maxDateVal != null) {
|
|
1087
|
+
if (new Date(this.myForm.nativeElement[MaxComponent.id].value) > maxDateVal || new Date(this.myForm.nativeElement[MinComponent.id].value) < minDateVal) {
|
|
1088
|
+
this.toastr.warning(label[0] + errorMessage[0] + formatDate(minDateVal, 'dd MMMM yyyy', 'en-US') + " and" + errorMessage[1] + formatDate(maxDateVal, 'dd MMMM yyyy', 'en-US') + ".");
|
|
1089
|
+
this.dateWrong = true;
|
|
1090
|
+
}
|
|
1091
|
+
else {
|
|
1092
|
+
this.dateWrong = false;
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
else {
|
|
1096
|
+
this.dateWrong = false;
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
selectedOption(item, crit) {
|
|
1100
|
+
crit.descr = item.Value;
|
|
1101
|
+
crit.isListHide = true;
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
/** @nocollapse */ /** @nocollapse */ UCSearchComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: UCSearchComponent, deps: [{ token: i1.HttpClient }, { token: ExcelService }, { token: i0.Renderer2 }, { token: DOCUMENT }, { token: i3.ToastrService }, { token: i4.CookieService }, { token: i5.DatePipe }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1105
|
+
/** @nocollapse */ /** @nocollapse */ UCSearchComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.2", type: UCSearchComponent, selector: "lib-UCSearch", inputs: { searchInput: "searchInput", pageSize: "pageSize", isReport: "isReport" }, outputs: { result: "result", genRpt: "genRpt", reqGetAllData: "reqGetAllData" }, providers: [ExcelService, DatePipe], viewQueries: [{ propertyName: "content", first: true, predicate: ["enjiForm"], descendants: true }, { propertyName: "myForm", first: true, predicate: ["formIdSearch"], descendants: true }], ngImport: i0, 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\"\r\n [ngModel]=\"question.value\" [required]=\"question.isRequired\" name=\"{{question.name}}\"\r\n attr.data-crit-datatable=\"{{question.isCriteriaDataTable}}\"\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}}\"\r\n 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\"\r\n [ngModel]=\"question.value\" [required]=\"question.isRequired\" name=\"{{question.name}}\"\r\n attr.data-required=\"{{question.isRequired}}\" attr.data-type=\"{{question.datatype}}\"\r\n attr.data-name=\"{{question.name}}\" value=\"{{question.value}}\"\r\n 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\"\r\n [ngModel]=\"question.value\" [required]=\"question.isRequired\" name=\"{{question.name+[i]}}\"\r\n attr.data-required=\"{{question.isRequired}}\" value=\"{{question.value}}\"\r\n (keyup.enter)=\"searchClick()\" attr.data-restriction=\"{{question.restriction}}\"\r\n attr.data-type=\"{{question.datatype}}\" attr.data-name=\"{{question.name}}\"\r\n attr.data-numericpair=\"{{question.numericPair}}\"\r\n attr.data-crit-datatable=\"{{question.isCriteriaDataTable}}\"\r\n 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}}\"\r\n (keyup.enter)=\"searchClick()\" 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}\"\r\n 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}}\"\r\n (keyup.enter)=\"searchClick()\" 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}\"\r\n 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=\"{{question.isTime ? 'datetime-local' : 'date'}}\" id=\"{{question.id}}\"\r\n class=\"form-control search-form-control btn-lookup\" name=\"{{question.name+[i]}}\"\r\n [ngModel]=\"question.value\" [required]=\"question.isRequired\"\r\n attr.data-required=\"{{question.isRequired}}\" value=\"{{question.value}}\"\r\n [readonly]=\"question.readonly\" attr.data-type=\"{{question.datatype}}\"\r\n attr.data-name=\"{{question.name}}\"\r\n attr.data-datepickerpair=\"{{question.datepickerPair}}\"\r\n attr.data-crit-datatable=\"{{question.isCriteriaDataTable}}\"\r\n (keyup.enter)=\"searchClick()\" attr.data-restriction=\"{{question.restriction}}\"\r\n attr.label=\"{{question.label}}\" min=\"{{question.minDate | date:'yyyy-MM-dd'}}\"\r\n max=\"{{question.maxDate | date:'yyyy-MM-dd'}}\"\r\n (focusout)=\"question.restriction != undefined && 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\r\n *ngIf=\"question.type == 'taskDefinitionKey' || question.type == 'processKey' || question.type == 'officeRoleCodes'\">\r\n <select name=\"{{question.name}}\" attr.data-required=\"{{question.isRequired}}\"\r\n [required]=\"question.isRequired\" class=\"form-control search-form-control\"\r\n attr.query-in=\"{{question.isQueryIn}}\" attr.data-type=\"{{question.datatype}}\"\r\n attr.label=\"{{question.label}}\" [hidden]=\"question?.itemsUrl?.length == 1\"\r\n (change)=\"(question.type == 'taskDefinitionKey' || question.type == 'processKey') ? SetProcessKey(i,question.wfKeyFilter) : SetRoleOfficeCodes(i)\"\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.type=='dropdown'\">\r\n <select name=\"{{question.name}}\" attr.data-required=\"{{question.isRequired}}\"\r\n [(ngModel)]=\"question.value\" [required]=\"question.isRequired\"\r\n class=\"form-control search-form-control\" attr.query-in=\"{{question.isQueryIn}}\"\r\n attr.data-type=\"{{question.datatype}}\" attr.data-name=\"{{question.name}}\"\r\n attr.label=\"{{question.label}}\"\r\n attr.data-crit-datatable=\"{{question.isCriteriaDataTable}}\"\r\n [hidden]=\"!question.isFromURL ? question?.items?.length == 1 : question?.itemsUrl?.length == 1\"\r\n (change)=\"question.isEvent ? onChangeEvent($event.target.value, question) : ''\"\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\r\n *ngIf=\"question.ddlType == 'one' && (!question.isFromURL ? question?.items?.length != 1 : question?.itemsUrl?.length != 1)\"\r\n value=\"one\">\r\n Select One</option>\r\n <option\r\n *ngIf=\"(question?.ddlType == undefined || question.ddlType == 'all') && (!question.isFromURL ? question?.items?.length != 1 : question?.itemsUrl?.length != 1)\"\r\n value=\"all\">All</option>\r\n <option *ngFor=\"let item of !question.isFromURL ? question?.items : question?.itemsUrl\"\r\n value=\"{{!question.isFromURL ? item.key : item.Key}}\">\r\n {{!question.isFromURL ? item.value : item.Value}}\r\n </option>\r\n </select>\r\n <label\r\n *ngIf=\"!question.isFromURL ? question?.items?.length == 1 : question?.itemsUrl?.length == 1\">{{!question.isFromURL\r\n ? question.items[0].value :\r\n question.itemsUrl[0].Value}}</label>\r\n </div>\r\n <div *ngIf=\"question.type=='dropdownSearch'\">\r\n <div class=\"dds-display-item\"\r\n [hidden]=\"!question.isFromURL ? question?.items?.length == 1 : question?.itemsUrl?.length == 1\">\r\n <input type=\"text\" class=\"form-control search-form-control dds-input\"\r\n name=\"{{'ddsValue'+question.name}}\" [(ngModel)]=\"question.descr\" readonly\r\n (click)=\"question.isListHide = !question.isListHide; question.searchText=''\">\r\n </div>\r\n <label\r\n *ngIf=\"!question.isFromURL ? question?.items?.length == 1 : question?.itemsUrl?.length == 1\">{{question.descr}}</label>\r\n <div class=\"dds-list-container\" [hidden]=\"question.isListHide\">\r\n <input type=\"text\" class=\"form-control search-form-control\"\r\n name=\"{{'searchText'+question.name}}\" [(ngModel)]=\"question.searchText\"\r\n [placeholder]=\"question.placeholder\">\r\n <div class=\"dds-items-container\">\r\n <select class=\"full-width\" name=\"{{question.name}}\"\r\n attr.data-required=\"{{question.isRequired}}\" [(ngModel)]=\"question.value\"\r\n [required]=\"question.isRequired\" attr.query-in=\"{{question.isQueryIn}}\"\r\n attr.data-type=\"{{question.datatype}}\" attr.data-name=\"{{question.name}}\"\r\n attr.label=\"{{question.label}}\"\r\n attr.data-crit-datatable=\"{{question.isCriteriaDataTable}}\"\r\n (change)=\"question.isEvent ? onChangeEvent($event.target.value, question) : ''\"\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 size=\"{{question?.size == undefined ? question?.size : 10}}\">\r\n <option (click)=\"selectedOption({Key:'one',Value:'Select One'},question)\"\r\n *ngIf=\"question.ddsType == 'one' && (!question.isFromURL ? question?.items?.length != 1 : question?.itemsUrl?.length != 1)\"\r\n value=\"one\">\r\n Select One</option>\r\n <option (click)=\"selectedOption({Key:'all',Value:'All'},question)\"\r\n *ngIf=\"(question?.ddsType == undefined || question.ddsType == 'all') && (!question.isFromURL ? question?.items?.length != 1 : question?.itemsUrl?.length != 1)\"\r\n value=\"all\">All</option>\r\n <!-- <option *ngFor=\"let item of question?.items | textSearch : question.searchText; let i=index\" [value]=\"item?.key\" (click)=\"selectedOption(item,question)\">\r\n {{item?.value}}\r\n </option> -->\r\n <option\r\n *ngFor=\"let item of !question.isFromURL ? (question?.items | textSearch : question.searchText) : question?.itemsUrl | textSearch : question.searchText\"\r\n (click)=\"selectedOption(item,question)\" value=\"{{item.Key}}\">\r\n {{item.Value}}\r\n </option>\r\n </select>\r\n </div>\r\n </div>\r\n </div>\r\n <div *ngIf=\"question.type=='claim'\">\r\n <select name=\"{{'claim'+[i]}}\" class=\"form-control search-form-control\"\r\n attr.data-type=\"{{'text'}}\" attr.data-crit-datatable=\"{{question.isCriteriaDataTable}}\"\r\n attr.data-name=\"{{'Assignee'}}\" [hidden]=\"ClaimList?.length == 1\"\r\n [ngClass]=\"{ 'is-invalid':(enjiForm.submitted || enjiForm.form.controls['claim'+[i]]?.touched || enjiForm.form.controls['claim'+[i]]?.dirty) && enjiForm.form.controls['claim'+[i]]?.invalid }\">\r\n <option *ngIf=\"question.ddlType == 'one' && ClaimList?.length != 1\" value=\"one\">Select\r\n One</option>\r\n <option\r\n *ngIf=\"(question?.ddlType == undefined || question.ddlType == 'all') && ClaimList?.length != 1\"\r\n value=\"all\">All</option>\r\n <option *ngFor=\"let item of ClaimList\" value=\"{{item.Key}}\">\r\n {{item.Value}}\r\n </option>\r\n </select>\r\n </div>\r\n <lib-uc-show-errors *ngIf=\"question.type!='datepicker'\"\r\n [control]=\"enjiForm.form.controls[question.name]\" [submit]=\"enjiForm.submitted\">\r\n </lib-uc-show-errors>\r\n <lib-uc-show-errors *ngIf=\"question.type=='datepicker'\"\r\n [control]=\"enjiForm.form.controls[question.name+[i]]\" [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> <span translate>Export Excel</span>\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> <span translate>Reset</span>\r\n </button>\r\n <button *ngIf=\"(isReport == undefined || !isReport)\" type=\"submit\"\r\n class=\"btn btn-raised btn-primary\" #UCSearchClick>\r\n <i class=\"fa fa-search\"></i> <span translate>Search</span>\r\n </button>\r\n <button *ngIf=\"(isReport != undefined && isReport)\" type=\"button\" (click)=\"GenerateReport()\"\r\n class=\"btn btn-raised btn-primary\">\r\n <i class=\"fa ft-download\"></i> <span translate>Generate\r\n Report</span>\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 -->", styles: [".ucSearch-title{margin:3px}.dds-input{background-color:#fff;text-transform:uppercase}.dds-display-item:after{content:\"\\e929\";font-family:feather;font-size:1rem;display:inline-block;position:absolute;right:5px;top:5px;transform:rotate(90deg)}.dds-list-container{position:absolute;width:100%;z-index:9}\n"], components: [{ type: i6.UcShowErrorsComponent, selector: "lib-uc-show-errors", inputs: ["control", "submit", "fieldName"] }], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { type: i8.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i8.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i8.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i9.UpperCaseDirective, selector: "input[type=text], input", inputs: ["IsUpperCase"] }, { type: i8.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i8.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i8.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i8.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { type: i10.CurrencyMaskDirective, selector: "[currencyMask]", inputs: ["options"] }, { type: i8.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i8.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i8.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }], pipes: { "date": i5.DatePipe, "textSearch": TextSearchPipe }, animations: [
|
|
1106
|
+
trigger('changeDivSize', [
|
|
1107
|
+
state('initial', style({
|
|
1108
|
+
height: '*',
|
|
1109
|
+
opacity: '1',
|
|
1110
|
+
})),
|
|
1111
|
+
state('final', style({
|
|
1112
|
+
height: '0px',
|
|
1113
|
+
opacity: '0',
|
|
1114
|
+
overflow: 'hidden',
|
|
1115
|
+
})),
|
|
1116
|
+
transition('initial=>final', animate('300ms')),
|
|
1117
|
+
transition('final=>initial', animate('300ms'))
|
|
1118
|
+
]),
|
|
1119
|
+
] });
|
|
1120
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: UCSearchComponent, decorators: [{
|
|
1121
|
+
type: Component,
|
|
1122
|
+
args: [{ selector: 'lib-UCSearch', providers: [ExcelService, DatePipe], animations: [
|
|
1123
|
+
trigger('changeDivSize', [
|
|
1124
|
+
state('initial', style({
|
|
1125
|
+
height: '*',
|
|
1126
|
+
opacity: '1',
|
|
1127
|
+
})),
|
|
1128
|
+
state('final', style({
|
|
1129
|
+
height: '0px',
|
|
1130
|
+
opacity: '0',
|
|
1131
|
+
overflow: 'hidden',
|
|
1132
|
+
})),
|
|
1133
|
+
transition('initial=>final', animate('300ms')),
|
|
1134
|
+
transition('final=>initial', animate('300ms'))
|
|
1135
|
+
]),
|
|
1136
|
+
], 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\"\r\n [ngModel]=\"question.value\" [required]=\"question.isRequired\" name=\"{{question.name}}\"\r\n attr.data-crit-datatable=\"{{question.isCriteriaDataTable}}\"\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}}\"\r\n 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\"\r\n [ngModel]=\"question.value\" [required]=\"question.isRequired\" name=\"{{question.name}}\"\r\n attr.data-required=\"{{question.isRequired}}\" attr.data-type=\"{{question.datatype}}\"\r\n attr.data-name=\"{{question.name}}\" value=\"{{question.value}}\"\r\n 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\"\r\n [ngModel]=\"question.value\" [required]=\"question.isRequired\" name=\"{{question.name+[i]}}\"\r\n attr.data-required=\"{{question.isRequired}}\" value=\"{{question.value}}\"\r\n (keyup.enter)=\"searchClick()\" attr.data-restriction=\"{{question.restriction}}\"\r\n attr.data-type=\"{{question.datatype}}\" attr.data-name=\"{{question.name}}\"\r\n attr.data-numericpair=\"{{question.numericPair}}\"\r\n attr.data-crit-datatable=\"{{question.isCriteriaDataTable}}\"\r\n 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}}\"\r\n (keyup.enter)=\"searchClick()\" 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}\"\r\n 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}}\"\r\n (keyup.enter)=\"searchClick()\" 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}\"\r\n 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=\"{{question.isTime ? 'datetime-local' : 'date'}}\" id=\"{{question.id}}\"\r\n class=\"form-control search-form-control btn-lookup\" name=\"{{question.name+[i]}}\"\r\n [ngModel]=\"question.value\" [required]=\"question.isRequired\"\r\n attr.data-required=\"{{question.isRequired}}\" value=\"{{question.value}}\"\r\n [readonly]=\"question.readonly\" attr.data-type=\"{{question.datatype}}\"\r\n attr.data-name=\"{{question.name}}\"\r\n attr.data-datepickerpair=\"{{question.datepickerPair}}\"\r\n attr.data-crit-datatable=\"{{question.isCriteriaDataTable}}\"\r\n (keyup.enter)=\"searchClick()\" attr.data-restriction=\"{{question.restriction}}\"\r\n attr.label=\"{{question.label}}\" min=\"{{question.minDate | date:'yyyy-MM-dd'}}\"\r\n max=\"{{question.maxDate | date:'yyyy-MM-dd'}}\"\r\n (focusout)=\"question.restriction != undefined && 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\r\n *ngIf=\"question.type == 'taskDefinitionKey' || question.type == 'processKey' || question.type == 'officeRoleCodes'\">\r\n <select name=\"{{question.name}}\" attr.data-required=\"{{question.isRequired}}\"\r\n [required]=\"question.isRequired\" class=\"form-control search-form-control\"\r\n attr.query-in=\"{{question.isQueryIn}}\" attr.data-type=\"{{question.datatype}}\"\r\n attr.label=\"{{question.label}}\" [hidden]=\"question?.itemsUrl?.length == 1\"\r\n (change)=\"(question.type == 'taskDefinitionKey' || question.type == 'processKey') ? SetProcessKey(i,question.wfKeyFilter) : SetRoleOfficeCodes(i)\"\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.type=='dropdown'\">\r\n <select name=\"{{question.name}}\" attr.data-required=\"{{question.isRequired}}\"\r\n [(ngModel)]=\"question.value\" [required]=\"question.isRequired\"\r\n class=\"form-control search-form-control\" attr.query-in=\"{{question.isQueryIn}}\"\r\n attr.data-type=\"{{question.datatype}}\" attr.data-name=\"{{question.name}}\"\r\n attr.label=\"{{question.label}}\"\r\n attr.data-crit-datatable=\"{{question.isCriteriaDataTable}}\"\r\n [hidden]=\"!question.isFromURL ? question?.items?.length == 1 : question?.itemsUrl?.length == 1\"\r\n (change)=\"question.isEvent ? onChangeEvent($event.target.value, question) : ''\"\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\r\n *ngIf=\"question.ddlType == 'one' && (!question.isFromURL ? question?.items?.length != 1 : question?.itemsUrl?.length != 1)\"\r\n value=\"one\">\r\n Select One</option>\r\n <option\r\n *ngIf=\"(question?.ddlType == undefined || question.ddlType == 'all') && (!question.isFromURL ? question?.items?.length != 1 : question?.itemsUrl?.length != 1)\"\r\n value=\"all\">All</option>\r\n <option *ngFor=\"let item of !question.isFromURL ? question?.items : question?.itemsUrl\"\r\n value=\"{{!question.isFromURL ? item.key : item.Key}}\">\r\n {{!question.isFromURL ? item.value : item.Value}}\r\n </option>\r\n </select>\r\n <label\r\n *ngIf=\"!question.isFromURL ? question?.items?.length == 1 : question?.itemsUrl?.length == 1\">{{!question.isFromURL\r\n ? question.items[0].value :\r\n question.itemsUrl[0].Value}}</label>\r\n </div>\r\n <div *ngIf=\"question.type=='dropdownSearch'\">\r\n <div class=\"dds-display-item\"\r\n [hidden]=\"!question.isFromURL ? question?.items?.length == 1 : question?.itemsUrl?.length == 1\">\r\n <input type=\"text\" class=\"form-control search-form-control dds-input\"\r\n name=\"{{'ddsValue'+question.name}}\" [(ngModel)]=\"question.descr\" readonly\r\n (click)=\"question.isListHide = !question.isListHide; question.searchText=''\">\r\n </div>\r\n <label\r\n *ngIf=\"!question.isFromURL ? question?.items?.length == 1 : question?.itemsUrl?.length == 1\">{{question.descr}}</label>\r\n <div class=\"dds-list-container\" [hidden]=\"question.isListHide\">\r\n <input type=\"text\" class=\"form-control search-form-control\"\r\n name=\"{{'searchText'+question.name}}\" [(ngModel)]=\"question.searchText\"\r\n [placeholder]=\"question.placeholder\">\r\n <div class=\"dds-items-container\">\r\n <select class=\"full-width\" name=\"{{question.name}}\"\r\n attr.data-required=\"{{question.isRequired}}\" [(ngModel)]=\"question.value\"\r\n [required]=\"question.isRequired\" attr.query-in=\"{{question.isQueryIn}}\"\r\n attr.data-type=\"{{question.datatype}}\" attr.data-name=\"{{question.name}}\"\r\n attr.label=\"{{question.label}}\"\r\n attr.data-crit-datatable=\"{{question.isCriteriaDataTable}}\"\r\n (change)=\"question.isEvent ? onChangeEvent($event.target.value, question) : ''\"\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 size=\"{{question?.size == undefined ? question?.size : 10}}\">\r\n <option (click)=\"selectedOption({Key:'one',Value:'Select One'},question)\"\r\n *ngIf=\"question.ddsType == 'one' && (!question.isFromURL ? question?.items?.length != 1 : question?.itemsUrl?.length != 1)\"\r\n value=\"one\">\r\n Select One</option>\r\n <option (click)=\"selectedOption({Key:'all',Value:'All'},question)\"\r\n *ngIf=\"(question?.ddsType == undefined || question.ddsType == 'all') && (!question.isFromURL ? question?.items?.length != 1 : question?.itemsUrl?.length != 1)\"\r\n value=\"all\">All</option>\r\n <!-- <option *ngFor=\"let item of question?.items | textSearch : question.searchText; let i=index\" [value]=\"item?.key\" (click)=\"selectedOption(item,question)\">\r\n {{item?.value}}\r\n </option> -->\r\n <option\r\n *ngFor=\"let item of !question.isFromURL ? (question?.items | textSearch : question.searchText) : question?.itemsUrl | textSearch : question.searchText\"\r\n (click)=\"selectedOption(item,question)\" value=\"{{item.Key}}\">\r\n {{item.Value}}\r\n </option>\r\n </select>\r\n </div>\r\n </div>\r\n </div>\r\n <div *ngIf=\"question.type=='claim'\">\r\n <select name=\"{{'claim'+[i]}}\" class=\"form-control search-form-control\"\r\n attr.data-type=\"{{'text'}}\" attr.data-crit-datatable=\"{{question.isCriteriaDataTable}}\"\r\n attr.data-name=\"{{'Assignee'}}\" [hidden]=\"ClaimList?.length == 1\"\r\n [ngClass]=\"{ 'is-invalid':(enjiForm.submitted || enjiForm.form.controls['claim'+[i]]?.touched || enjiForm.form.controls['claim'+[i]]?.dirty) && enjiForm.form.controls['claim'+[i]]?.invalid }\">\r\n <option *ngIf=\"question.ddlType == 'one' && ClaimList?.length != 1\" value=\"one\">Select\r\n One</option>\r\n <option\r\n *ngIf=\"(question?.ddlType == undefined || question.ddlType == 'all') && ClaimList?.length != 1\"\r\n value=\"all\">All</option>\r\n <option *ngFor=\"let item of ClaimList\" value=\"{{item.Key}}\">\r\n {{item.Value}}\r\n </option>\r\n </select>\r\n </div>\r\n <lib-uc-show-errors *ngIf=\"question.type!='datepicker'\"\r\n [control]=\"enjiForm.form.controls[question.name]\" [submit]=\"enjiForm.submitted\">\r\n </lib-uc-show-errors>\r\n <lib-uc-show-errors *ngIf=\"question.type=='datepicker'\"\r\n [control]=\"enjiForm.form.controls[question.name+[i]]\" [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> <span translate>Export Excel</span>\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> <span translate>Reset</span>\r\n </button>\r\n <button *ngIf=\"(isReport == undefined || !isReport)\" type=\"submit\"\r\n class=\"btn btn-raised btn-primary\" #UCSearchClick>\r\n <i class=\"fa fa-search\"></i> <span translate>Search</span>\r\n </button>\r\n <button *ngIf=\"(isReport != undefined && isReport)\" type=\"button\" (click)=\"GenerateReport()\"\r\n class=\"btn btn-raised btn-primary\">\r\n <i class=\"fa ft-download\"></i> <span translate>Generate\r\n Report</span>\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 -->", styles: [".ucSearch-title{margin:3px}.dds-input{background-color:#fff;text-transform:uppercase}.dds-display-item:after{content:\"\\e929\";font-family:feather;font-size:1rem;display:inline-block;position:absolute;right:5px;top:5px;transform:rotate(90deg)}.dds-list-container{position:absolute;width:100%;z-index:9}\n"] }]
|
|
1137
|
+
}], ctorParameters: function () {
|
|
1138
|
+
return [{ type: i1.HttpClient }, { type: ExcelService }, { type: i0.Renderer2 }, { type: undefined, decorators: [{
|
|
1139
|
+
type: Inject,
|
|
1140
|
+
args: [DOCUMENT]
|
|
1141
|
+
}] }, { type: i3.ToastrService }, { type: i4.CookieService }, { type: i5.DatePipe }, { type: i0.ElementRef }];
|
|
1142
|
+
}, propDecorators: { content: [{
|
|
1143
|
+
type: ViewChild,
|
|
1144
|
+
args: ['enjiForm']
|
|
1145
|
+
}], myForm: [{
|
|
1146
|
+
type: ViewChild,
|
|
1147
|
+
args: ['formIdSearch', { static: false }]
|
|
1148
|
+
}], searchInput: [{
|
|
1149
|
+
type: Input
|
|
1150
|
+
}], pageSize: [{
|
|
1151
|
+
type: Input
|
|
1152
|
+
}], isReport: [{
|
|
1153
|
+
type: Input
|
|
1154
|
+
}], result: [{
|
|
1155
|
+
type: Output
|
|
1156
|
+
}], genRpt: [{
|
|
1157
|
+
type: Output
|
|
1158
|
+
}], reqGetAllData: [{
|
|
1159
|
+
type: Output
|
|
1160
|
+
}] } });
|
|
1161
|
+
|
|
1162
|
+
const customCurrencyMaskConfig = {
|
|
1163
|
+
align: "right",
|
|
1164
|
+
allowNegative: false,
|
|
1165
|
+
allowZero: true,
|
|
1166
|
+
decimal: ".",
|
|
1167
|
+
precision: 2,
|
|
1168
|
+
prefix: "",
|
|
1169
|
+
suffix: "",
|
|
1170
|
+
thousands: ",",
|
|
1171
|
+
nullable: false,
|
|
1172
|
+
inputMode: CurrencyMaskInputMode.NATURAL
|
|
1173
|
+
};
|
|
1174
|
+
class UCSearchModule {
|
|
1175
|
+
}
|
|
1176
|
+
/** @nocollapse */ /** @nocollapse */ UCSearchModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: UCSearchModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1177
|
+
/** @nocollapse */ /** @nocollapse */ UCSearchModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: UCSearchModule, declarations: [UCSearchComponent, TextSearchPipe], imports: [CommonModule,
|
|
1178
|
+
FormsModule,
|
|
1179
|
+
UcShowErrorsModule,
|
|
1180
|
+
UcDirectiveUpperCaseModule, i10.NgxCurrencyModule, i7.TranslateModule], exports: [UCSearchComponent] });
|
|
1181
|
+
/** @nocollapse */ /** @nocollapse */ UCSearchModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: UCSearchModule, imports: [[
|
|
1182
|
+
CommonModule,
|
|
1183
|
+
FormsModule,
|
|
1184
|
+
UcShowErrorsModule,
|
|
1185
|
+
UcDirectiveUpperCaseModule,
|
|
1186
|
+
NgxCurrencyModule.forRoot(customCurrencyMaskConfig),
|
|
1187
|
+
TranslateModule.forChild()
|
|
1188
|
+
]] });
|
|
1189
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: UCSearchModule, decorators: [{
|
|
1190
|
+
type: NgModule,
|
|
1191
|
+
args: [{
|
|
1192
|
+
declarations: [UCSearchComponent, TextSearchPipe],
|
|
1193
|
+
imports: [
|
|
1194
|
+
CommonModule,
|
|
1195
|
+
FormsModule,
|
|
1196
|
+
UcShowErrorsModule,
|
|
1197
|
+
UcDirectiveUpperCaseModule,
|
|
1198
|
+
NgxCurrencyModule.forRoot(customCurrencyMaskConfig),
|
|
1199
|
+
TranslateModule.forChild()
|
|
1200
|
+
],
|
|
1201
|
+
exports: [UCSearchComponent]
|
|
1202
|
+
}]
|
|
1203
|
+
}] });
|
|
1204
|
+
|
|
1205
|
+
/*
|
|
1206
|
+
* Public API Surface of ucsearch
|
|
1207
|
+
*/
|
|
1208
|
+
|
|
1209
|
+
/**
|
|
1210
|
+
* Generated bundle index. Do not edit.
|
|
1211
|
+
*/
|
|
1212
|
+
|
|
1213
|
+
export { UCSearchComponent, UCSearchModule, UCSearchService, customCurrencyMaskConfig };
|
|
1214
|
+
//# sourceMappingURL=adins-ucsearch.mjs.map
|