@adins/ucsearch 2.15.1 → 3.0.1

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