@adins/ucsearch 2.9.4 → 2.9.6

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