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