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