@adins/ucsearch 2.15.1 → 3.0.0

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