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