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