@adins/ucsearch 2.15.1 → 3.0.0

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