@adins/ucsearch 2.9.23 → 2.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/README.md +3 -82
  2. package/adins-ucsearch.d.ts +2 -1
  3. package/adins-ucsearch.metadata.json +1 -0
  4. package/bundles/adins-ucsearch.umd.js +1604 -0
  5. package/bundles/adins-ucsearch.umd.js.map +1 -0
  6. package/bundles/adins-ucsearch.umd.min.js +2 -0
  7. package/bundles/adins-ucsearch.umd.min.js.map +1 -0
  8. package/esm2015/adins-ucsearch.js +11 -0
  9. package/esm2015/lib/model/adins-constant.js +68 -0
  10. package/esm2015/lib/model/criteria-obj.model.js +31 -0
  11. package/esm2015/lib/model/input-search-obj.model.js +105 -0
  12. package/esm2015/lib/model/integration-obj.model.js +30 -0
  13. package/esm2015/lib/model/key-value-report.model.js +36 -0
  14. package/esm2015/lib/model/key-value-uc-search.model.js +54 -0
  15. package/esm2015/lib/model/request-criteria-obj.model.js +42 -0
  16. package/esm2015/lib/pipe/text-search.pipe.js +33 -0
  17. package/esm2015/lib/services/excel-service/excel-service.js +49 -0
  18. package/esm2015/lib/ucsearch.component.js +1273 -0
  19. package/esm2015/lib/ucsearch.module.js +43 -0
  20. package/esm2015/lib/ucsearch.service.js +18 -0
  21. package/esm2015/public-api.js +11 -0
  22. package/esm5/adins-ucsearch.js +11 -0
  23. package/esm5/lib/model/adins-constant.js +72 -0
  24. package/esm5/lib/model/criteria-obj.model.js +33 -0
  25. package/esm5/lib/model/input-search-obj.model.js +117 -0
  26. package/esm5/lib/model/integration-obj.model.js +32 -0
  27. package/esm5/lib/model/key-value-report.model.js +42 -0
  28. package/esm5/lib/model/key-value-uc-search.model.js +58 -0
  29. package/esm5/lib/model/request-criteria-obj.model.js +44 -0
  30. package/esm5/lib/pipe/text-search.pipe.js +42 -0
  31. package/esm5/lib/services/excel-service/excel-service.js +63 -0
  32. package/esm5/lib/ucsearch.component.js +1390 -0
  33. package/esm5/lib/ucsearch.module.js +47 -0
  34. package/esm5/lib/ucsearch.service.js +21 -0
  35. package/esm5/public-api.js +11 -0
  36. package/fesm2015/adins-ucsearch.js +1461 -0
  37. package/fesm2015/adins-ucsearch.js.map +1 -0
  38. package/fesm5/adins-ucsearch.js +1614 -0
  39. package/fesm5/adins-ucsearch.js.map +1 -0
  40. package/lib/model/adins-constant.d.ts +0 -21
  41. package/lib/model/key-value-report.model.d.ts +0 -1
  42. package/lib/pipe/text-search.pipe.d.ts +0 -3
  43. package/lib/services/excel-service/excel-service.d.ts +5 -0
  44. package/lib/ucsearch.component.d.ts +18 -26
  45. package/lib/ucsearch.module.d.ts +0 -12
  46. package/lib/ucsearch.service.d.ts +0 -3
  47. package/package.json +13 -24
  48. package/esm2020/adins-ucsearch.mjs +0 -5
  49. package/esm2020/lib/model/adins-constant.mjs +0 -52
  50. package/esm2020/lib/model/criteria-obj.model.mjs +0 -9
  51. package/esm2020/lib/model/input-search-obj.model.mjs +0 -45
  52. package/esm2020/lib/model/integration-obj.model.mjs +0 -12
  53. package/esm2020/lib/model/key-value-report.model.mjs +0 -15
  54. package/esm2020/lib/model/key-value-uc-search.model.mjs +0 -38
  55. package/esm2020/lib/model/request-criteria-obj.model.mjs +0 -14
  56. package/esm2020/lib/pipe/text-search.pipe.mjs +0 -24
  57. package/esm2020/lib/services/export-file.service.mjs +0 -61
  58. package/esm2020/lib/ucsearch.component.mjs +0 -1043
  59. package/esm2020/lib/ucsearch.module.mjs +0 -55
  60. package/esm2020/lib/ucsearch.service.mjs +0 -14
  61. package/esm2020/public-api.mjs +0 -7
  62. package/fesm2015/adins-ucsearch.mjs +0 -1371
  63. package/fesm2015/adins-ucsearch.mjs.map +0 -1
  64. package/fesm2020/adins-ucsearch.mjs +0 -1360
  65. package/fesm2020/adins-ucsearch.mjs.map +0 -1
  66. package/lib/services/export-file.service.d.ts +0 -12
@@ -1,1360 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Injectable, Pipe, EventEmitter, Component, Inject, ViewChild, Input, Output, NgModule } from '@angular/core';
3
- import * as i1 from '@angular/common/http';
4
- import * as i9 from '@angular/forms';
5
- import { FormsModule } from '@angular/forms';
6
- import * as i4 from '@angular/common';
7
- import { formatDate, DOCUMENT, DatePipe, CommonModule } from '@angular/common';
8
- import { trigger, state, style, transition, animate } from '@angular/animations';
9
- import * as i2 from 'ngx-toastr';
10
- import * as i3 from 'ngx-cookie';
11
- import * as CryptoJS from 'crypto-js';
12
- import * as FileSaver from 'file-saver';
13
- import * as XLSX from 'xlsx';
14
- import * as i6 from '@angular/router';
15
- import * as i7 from '@adins/uc-show-errors';
16
- import { UcShowErrorsModule } from '@adins/uc-show-errors';
17
- import * as i8 from '@ngx-translate/core';
18
- import { TranslateModule } from '@ngx-translate/core';
19
- import * as i10 from '@adins/uc-directive-upper-case';
20
- import { UcDirectiveUpperCaseModule } from '@adins/uc-directive-upper-case';
21
- import * as i11 from 'ngx-currency';
22
- import { CurrencyMaskInputMode, NgxCurrencyModule } from 'ngx-currency';
23
-
24
- class UCSearchService {
25
- constructor() { }
26
- }
27
- /** @nocollapse */ /** @nocollapse */ UCSearchService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: UCSearchService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
28
- /** @nocollapse */ /** @nocollapse */ UCSearchService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: UCSearchService, providedIn: 'root' });
29
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: UCSearchService, decorators: [{
30
- type: Injectable,
31
- args: [{
32
- providedIn: 'root'
33
- }]
34
- }], ctorParameters: function () { return []; } });
35
-
36
- class AdInsConstant {
37
- }
38
- AdInsConstant.RestrictionBetween = "Between";
39
- AdInsConstant.RestrictionLike = "Like";
40
- AdInsConstant.RestrictionEq = "Eq";
41
- AdInsConstant.RestrictionNeq = "NEQ";
42
- AdInsConstant.RestrictionGt = "GT";
43
- AdInsConstant.RestrictionGte = "GTE";
44
- AdInsConstant.RestrictionLt = "LT";
45
- AdInsConstant.RestrictionLte = "LTE";
46
- AdInsConstant.RestrictionIn = "IN";
47
- AdInsConstant.RestrictionNotIn = "NotIn";
48
- AdInsConstant.RestrictionOr = "Or"; //pastikan ada 1 criteria sebelumnya
49
- AdInsConstant.RestrictionOrNeq = "OrNeq"; //pastikan ada 1 criteria sebelumnya
50
- AdInsConstant.RestrictionIsNull = "ISNULL";
51
- AdInsConstant.RestrictionIsNotNull = "ISNOTNULL";
52
- AdInsConstant.RestrictionGTE = "GTE";
53
- AdInsConstant.RestrictionLTE = "LTE";
54
- AdInsConstant.showData = "10,50,100";
55
- AdInsConstant.JoinTypeInner = "INNER";
56
- AdInsConstant.JoinTypeLeft = "LEFT";
57
- const MIME_TYPES = {
58
- csv: 'text/csv;charset=UTF-8',
59
- excel: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8',
60
- json: 'text/json;charset=UTF-8',
61
- };
62
- const EXPORT_DATA_TYPES = {
63
- csv: 'csv',
64
- excel: 'excel',
65
- json: 'json',
66
- };
67
- const EXTENSION_TYPE = {
68
- csv: '.csv',
69
- excel: '.xlsx',
70
- json: '.json',
71
- };
72
- const ALLOWED_MIME_TYPES = [
73
- MIME_TYPES.csv,
74
- MIME_TYPES.excel,
75
- MIME_TYPES.json,
76
- ];
77
- const ALLOWED_EXPORT_DATA_TYPES = [
78
- EXPORT_DATA_TYPES.csv,
79
- EXPORT_DATA_TYPES.excel,
80
- EXPORT_DATA_TYPES.json,
81
- ];
82
- const ALLOWED_EXTENSION_TYPE = [
83
- EXTENSION_TYPE.csv,
84
- EXTENSION_TYPE.excel,
85
- EXTENSION_TYPE.json,
86
- ];
87
-
88
- class IntegrationObj {
89
- constructor() {
90
- this.baseUrl = "";
91
- this.apiPath = "";
92
- this.requestObj = new Object();
93
- this.leftColumnToJoin = "";
94
- this.rightColumnToJoin = "";
95
- this.joinType = AdInsConstant.JoinTypeInner;
96
- }
97
- }
98
-
99
- class InputSearchObj {
100
- constructor() {
101
- this._url = "";
102
- this.enviromentUrl = "";
103
- this.title = "";
104
- this.apiQryPaging = "";
105
- this.arrCritObj = null;
106
- this.addCritInput = new Array();
107
- this.listEnvironments = new Array();
108
- this.whereValue = new Array();
109
- this.fromValue = new Array();
110
- this.switchValue = new Array();
111
- this.integrationObj = new IntegrationObj();
112
- this.isJoinExAPI = false;
113
- }
114
- }
115
- class EnviObj {
116
- constructor() {
117
- this.name = "";
118
- this.environment = "";
119
- }
120
- }
121
- class WhereValueObj {
122
- constructor() {
123
- this.property = "";
124
- }
125
- }
126
- class FromValueObj {
127
- constructor() {
128
- this.property = "";
129
- }
130
- }
131
- class SwitchValueObj {
132
- constructor() {
133
- this.property = "";
134
- }
135
- }
136
- class EnvisObj {
137
- constructor() {
138
- this.environment = "";
139
- this.url = "";
140
- }
141
- }
142
-
143
- class CriteriaObj {
144
- constructor() {
145
- this.low = 0;
146
- this.high = 0;
147
- this.DataType = 'Text';
148
- this.isCriteriaDataTable = false;
149
- }
150
- }
151
-
152
- class RequestCriteriaObj {
153
- constructor() {
154
- this.includeCount = true;
155
- this.includeData = true;
156
- this.isLoading = true;
157
- this.queryString = '';
158
- this.rowVersion = '';
159
- this.integrationObj = new IntegrationObj();
160
- this.joinType = AdInsConstant.JoinTypeInner;
161
- }
162
- }
163
-
164
- class KeyValueReportObj {
165
- constructor() {
166
- this.key = 0;
167
- this.value = "";
168
- }
169
- }
170
- class ExportTypeConstant {
171
- }
172
- ExportTypeConstant.EXP_TYPE_PDF = 0;
173
- ExportTypeConstant.EXP_TYPE_XLS = 1;
174
- ExportTypeConstant.EXP_TYPE_XLSX = 2;
175
- ExportTypeConstant.EXP_TYPE_DOC = 3;
176
- ExportTypeConstant.EXP_TYPE_DOCX = 4;
177
- ExportTypeConstant.EXP_TYPE_JPDF = 5;
178
-
179
- class KeyValueUCSearchObj {
180
- constructor() {
181
- this.key = 0;
182
- this.value = "";
183
- }
184
- }
185
- class ListKeyValueMonth {
186
- constructor() {
187
- this.DictOfMonth = {};
188
- this.ListOfMonth = new Array();
189
- this.DictOfMonth = {};
190
- this.ListOfMonth.push({ key: 1, value: "January" });
191
- this.DictOfMonth[1] = "January";
192
- this.ListOfMonth.push({ key: 2, value: "February" });
193
- this.DictOfMonth[2] = "February";
194
- this.ListOfMonth.push({ key: 3, value: "March" });
195
- this.DictOfMonth[3] = "March";
196
- this.ListOfMonth.push({ key: 4, value: "April" });
197
- this.DictOfMonth[4] = "April";
198
- this.ListOfMonth.push({ key: 5, value: "May" });
199
- this.DictOfMonth[5] = "May";
200
- this.ListOfMonth.push({ key: 6, value: "June" });
201
- this.DictOfMonth[6] = "June";
202
- this.ListOfMonth.push({ key: 7, value: "July" });
203
- this.DictOfMonth[7] = "July";
204
- this.ListOfMonth.push({ key: 8, value: "August" });
205
- this.DictOfMonth[8] = "August";
206
- this.ListOfMonth.push({ key: 9, value: "September" });
207
- this.DictOfMonth[9] = "September";
208
- this.ListOfMonth.push({ key: 10, value: "October" });
209
- this.DictOfMonth[10] = "October";
210
- this.ListOfMonth.push({ key: 11, value: "November" });
211
- this.DictOfMonth[11] = "November";
212
- this.ListOfMonth.push({ key: 12, value: "December" });
213
- this.DictOfMonth[12] = "December";
214
- }
215
- }
216
-
217
- class ExportFileService {
218
- exportFileAsExcel(json, fileName) {
219
- const buffer = this.genExcelBuffer(json);
220
- const mimeType = MIME_TYPES.excel;
221
- const extType = EXTENSION_TYPE.excel;
222
- this.saveAsFile(buffer, fileName, mimeType, extType);
223
- }
224
- exportFileAsJson(json, fileName) {
225
- const buffer = this.genJsonBuffer(json);
226
- const mimeType = MIME_TYPES.json;
227
- const extType = EXTENSION_TYPE.json;
228
- this.saveAsFile(buffer, fileName, mimeType, extType);
229
- }
230
- exportFileAsCsv(json, fileName) {
231
- const buffer = this.genCsvBuffer(json);
232
- const mimeType = MIME_TYPES.csv;
233
- const extType = EXTENSION_TYPE.csv;
234
- this.saveAsFile(buffer, fileName, mimeType, extType);
235
- }
236
- genExcelBuffer(json) {
237
- const worksheet = XLSX.utils.json_to_sheet(json);
238
- const workbook = { Sheets: { 'data': worksheet }, SheetNames: ['data'] };
239
- const excelBuffer = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' });
240
- return excelBuffer;
241
- }
242
- genJsonBuffer(json) {
243
- return JSON.stringify(json, null, 2);
244
- }
245
- genCsvBuffer(json) {
246
- const titleKeys = Object.keys(json[0]);
247
- const refinedData = [];
248
- refinedData.push(titleKeys);
249
- json.forEach(item => {
250
- refinedData.push(Object.values(item));
251
- });
252
- let csvContent = '';
253
- refinedData.forEach(row => {
254
- csvContent += row.join(',') + '\n';
255
- });
256
- return csvContent;
257
- }
258
- saveAsFile(buffer, fileName, mimeType, extType) {
259
- const data = new Blob([buffer], {
260
- type: mimeType
261
- });
262
- const _id = new Date().getTime();
263
- const _filename = `${fileName}_export_${_id}${extType}`;
264
- FileSaver.saveAs(data, _filename);
265
- }
266
- }
267
- /** @nocollapse */ /** @nocollapse */ ExportFileService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: ExportFileService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
268
- /** @nocollapse */ /** @nocollapse */ ExportFileService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: ExportFileService });
269
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: ExportFileService, decorators: [{
270
- type: Injectable
271
- }] });
272
-
273
- class TextSearchPipe {
274
- transform(items, text) {
275
- if (!text) {
276
- return items;
277
- }
278
- return items.filter((item) => {
279
- if (item.Value && typeof item.Value === 'string') {
280
- return item.Value.toLowerCase().indexOf(text.toLowerCase()) > -1;
281
- }
282
- return false;
283
- });
284
- }
285
- }
286
- /** @nocollapse */ /** @nocollapse */ TextSearchPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: TextSearchPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
287
- /** @nocollapse */ /** @nocollapse */ TextSearchPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: TextSearchPipe, name: "textSearch" });
288
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: TextSearchPipe, decorators: [{
289
- type: Pipe,
290
- args: [{
291
- name: 'textSearch'
292
- }]
293
- }] });
294
-
295
- class UCSearchComponent {
296
- constructor(http, _renderer2, _document, toastr, cookieService, datePipe, elemRef, exportFileService, route) {
297
- this.http = http;
298
- this._renderer2 = _renderer2;
299
- this._document = _document;
300
- this.toastr = toastr;
301
- this.cookieService = cookieService;
302
- this.datePipe = datePipe;
303
- this.elemRef = elemRef;
304
- this.exportFileService = exportFileService;
305
- this.route = route;
306
- this.searchInput = new InputSearchObj();
307
- this.pageSize = 10;
308
- this.isReport = false;
309
- this.result = new EventEmitter();
310
- this.genRpt = new EventEmitter();
311
- this.reqGetAllData = new EventEmitter();
312
- this.ExportTypeList = [
313
- {
314
- key: ExportTypeConstant.EXP_TYPE_PDF,
315
- value: "PDF"
316
- },
317
- {
318
- key: ExportTypeConstant.EXP_TYPE_XLSX,
319
- value: "Excel 2007"
320
- },
321
- {
322
- key: ExportTypeConstant.EXP_TYPE_DOCX,
323
- value: "Document XML"
324
- },
325
- {
326
- key: ExportTypeConstant.EXP_TYPE_JPDF,
327
- value: "Justify PDF"
328
- }
329
- ];
330
- this.ListOfMonth = new ListKeyValueMonth();
331
- this.ListOfYear = new Array();
332
- this.ClaimList = [
333
- {
334
- Key: AdInsConstant.RestrictionIsNotNull,
335
- Value: "CLAIMED"
336
- },
337
- {
338
- Key: AdInsConstant.RestrictionIsNull,
339
- Value: "UNCLAIMED"
340
- },
341
- ];
342
- this.ExportType = 0;
343
- this.pageNow = 1;
344
- this.isDataLoaded = false;
345
- this.isHidden = false;
346
- this.BusinessDt = new Date();
347
- this.dateWrong = false;
348
- this.readonly = false;
349
- this.isSearch = false;
350
- this.currentState = 'initial';
351
- this.countForm = 0;
352
- this.formattedAmount = '';
353
- this.amount = 0;
354
- this.route.queryParams.subscribe(params => {
355
- this.queryParam = params;
356
- });
357
- }
358
- // isListHide: boolean = true;
359
- // @HostListener('document:click', ['$event'])
360
- // onClick(ev: MouseEvent) {
361
- // const clickInside = this.elemRef.nativeElement.contains(ev.target);
362
- // if (!clickInside) {
363
- // this.isListHide = true;
364
- // }
365
- // }
366
- set content(content) {
367
- if (content) { // initially setter gets called with undefined
368
- this.searchForm = content;
369
- }
370
- }
371
- changeState() {
372
- this.currentState = this.currentState == 'initial' ? 'final' : 'initial';
373
- this.isHidden = !this.isHidden ? true : false;
374
- }
375
- async ngOnInit() {
376
- console.log("ucsearch");
377
- this.apiUrl = this.searchInput.enviromentUrl + this.searchInput.apiQryPaging;
378
- this.arrCrit = this.searchInput.arrCritObj;
379
- let js = this._renderer2.createElement('script');
380
- js.text = `
381
- $(document).ready(function(){
382
- $("#flip").click(function(){
383
- $("#panel").slideToggle("slow");
384
- });
385
- });
386
- `;
387
- this._renderer2.appendChild(this._document.body, js);
388
- let value = this.cookieService.get('BusinessDateRaw');
389
- this.BisDt = this.DecryptString(value, "AdInsFOU12345678");
390
- this.BusinessDt = new Date(this.BisDt);
391
- await this.initiateForm();
392
- }
393
- async initiateForm() {
394
- await this.getJSON(this.searchInput._url).subscribe(data => {
395
- this.configuration = data;
396
- this.exportData = data.exportExcel;
397
- if (data.exportTypeList != undefined && data.exportTypeList.length != 0) {
398
- this.ExportTypeList = data.exportTypeList;
399
- this.ExportType = this.ExportTypeList[0].key;
400
- }
401
- this.countForm = data.component.length;
402
- this.isDataLoaded = true;
403
- if (this.searchInput.title != undefined && this.searchInput.title != "") {
404
- this.configuration.title = this.searchInput.title;
405
- }
406
- for (let i = 0; i < this.countForm; i++) {
407
- //ini kalau datanya di load dari URL
408
- if (data.component[i].isFromURL) {
409
- let request = new RequestCriteriaObj();
410
- let arrayCrit = new Array();
411
- let criteriaObject = new CriteriaObj();
412
- criteriaObject.DataType = "text";
413
- criteriaObject.propName = data.component[i].criteriaPropName;
414
- criteriaObject.value = data.component[i].criteriaPropValue;
415
- criteriaObject.restriction = "eq";
416
- arrayCrit.push(criteriaObject);
417
- request.criteria = arrayCrit;
418
- request[data.component[i].criteriaPropName] = data.component[i].criteriaPropValue;
419
- // Pengecekan penggunaan url atau path
420
- if (data.component[i].path != undefined && data.component[i].path != "") {
421
- if (this.searchInput.listEnvironments != undefined && this.searchInput.listEnvironments.length != 0) {
422
- for (let y = 0; y < this.searchInput.listEnvironments.length; y++) {
423
- if (data.component[i].environment == this.searchInput.listEnvironments[y].environment) {
424
- data.component[i].fullpath = this.searchInput.listEnvironments[y].url + data.component[i].path;
425
- break;
426
- }
427
- }
428
- }
429
- else {
430
- data.component[i].fullpath = data.component[i].url;
431
- }
432
- }
433
- else {
434
- data.component[i].fullpath = data.component[i].url;
435
- }
436
- //lempar objectnya sekalian sama urlnya, nnti di bind di dalem karena masalah di asyncnya
437
- //biar tiap function ada state2nya sendiri
438
- this.resolveObject(data.component[i], data.component[i].fullpath, request);
439
- }
440
- if (data.component[i].type == "numeric") {
441
- data.component[i].value = parseFloat(data.component[i].value).toLocaleString('en');
442
- }
443
- //pengecekan ddl
444
- if (data.component[i].type == "dropdown") {
445
- if (data.component[i].dtmType != undefined) {
446
- if (data.component[i].dtmType.includes("month")) {
447
- if (data.component[i].value != undefined && data.component[i].value.includes("BD")) {
448
- data.component[i].value = this.setDefaultValueMonth(data.component[i].value);
449
- }
450
- data.component[i].items = this.setMonthDDL(data.component[i].dtmType);
451
- }
452
- if (data.component[i].dtmType.includes("year")) {
453
- if (data.component[i].value != undefined && data.component[i].value.includes("BD")) {
454
- data.component[i].value = this.setDefaultValueYear(data.component[i].value);
455
- }
456
- data.component[i].items = this.setYearDDL(data.component[i].dtmType);
457
- }
458
- }
459
- }
460
- // if (data.component[i].type == "dropdownSearch" && !data.component[i].isFromURL && data.component[i].items?.length != 1) {
461
- // if (data.component[i].ddsType == undefined || data.component[i].ddsType == "all") {
462
- // data.component[i].value = "all";
463
- // data.component[i].descr = "All";
464
- // } else if (data.component[i].ddsType == "one") {
465
- // data.component[i].value = "one";
466
- // data.component[i].descr = "Select One";
467
- // }
468
- // }
469
- if (data.component[i].type == "dropdownSearch" && !data.component[i].isFromURL && data.component[i].items.length == 1) {
470
- data.component[i].value = data.component[i].items[0].Key;
471
- data.component[i].descr = data.component[i].items[0].Value;
472
- }
473
- if (data.component[i].type != "dropdownSearch" && !data.component[i].value) {
474
- data.component[i].value = "";
475
- if (data.component[i].ddlType == 'all')
476
- data.component[i].value = "all";
477
- if (data.component[i].ddlType == 'one')
478
- data.component[i].value = "one";
479
- }
480
- //pengecekan tanggal
481
- if (data.component[i].type == "datepicker") {
482
- this.readonly = data.component[i].readonly;
483
- if (data.component[i].value.includes("BD")) {
484
- let businessDate = new Date();
485
- if (this.BisDt != null) {
486
- businessDate = new Date(this.BisDt);
487
- }
488
- let operator = data.component[i].value.charAt(2);
489
- let dateShow = new Date();
490
- if (operator == "-") {
491
- let tempMinus = data.component[i].value.split("-", 2);
492
- let numDay = parseInt(tempMinus[1]);
493
- businessDate.setDate(businessDate.getDate() - numDay);
494
- }
495
- else if (operator == "+") {
496
- let tempMinus = data.component[i].value.split("+", 2);
497
- let numDay = parseInt(tempMinus[1]);
498
- businessDate.setDate(businessDate.getDate() + numDay);
499
- }
500
- dateShow = businessDate;
501
- let dateText = formatDate(dateShow, 'yyyy-MM-dd', 'en-US');
502
- data.component[i].value = dateText;
503
- }
504
- if (this.readonly = false) {
505
- if (data.component[i].restriction != undefined && data.component[i].restriction != "") {
506
- if (data.component[i].restriction.toUpperCase() == "GT") {
507
- let minDate = new Date(this.datePipe.transform(data.component[i].minDate, 'yyyy-MM-dd'));
508
- minDate.setDate(minDate.getDate() + 1);
509
- data.component[i].minDate = minDate;
510
- }
511
- else if (data.component[i].restriction.toUpperCase() == "LT") {
512
- let maxDate = new Date(this.datePipe.transform(data.component[i].maxDate, 'yyyy-MM-dd'));
513
- maxDate.setDate(maxDate.getDate() - 1);
514
- data.component[i].maxDate = maxDate;
515
- }
516
- }
517
- }
518
- }
519
- if (data.component[i].type == "textbox") {
520
- this.configuration.component[i].value = this.autofill(data.component[i]);
521
- }
522
- }
523
- setTimeout(() => {
524
- for (let j = 0; j < this.countForm; j++) {
525
- if (data.component[j].isEvent && this.configuration.component[j].itemsUrl.length == 1) {
526
- this.onChangeEvent(data.component[j].itemsUrl[0].Key, data.component[j]);
527
- }
528
- if (data.component[j].type == "officeRoleCodes" && this.configuration.component[j].itemsUrl.length > 0) {
529
- this.SetRoleOfficeCodes(j);
530
- }
531
- }
532
- }, 1000);
533
- });
534
- }
535
- autofill(data) {
536
- if (data.value != "")
537
- return data.value;
538
- const autofill = data.autofill;
539
- if (autofill == undefined)
540
- return data.value;
541
- if (this.queryParam[autofill.key] == undefined)
542
- return data.value;
543
- if (autofill.source == "param") {
544
- return this.queryParam[autofill.key];
545
- }
546
- return data.value;
547
- }
548
- SetRoleOfficeCodes(i) {
549
- let value = this.cookieService.get("UserAccess");
550
- let userAccess = JSON.parse(this.DecryptString(value, "AdInsFOU12345678"));
551
- let roleCode = userAccess["RoleCode"];
552
- let listOfficeRoleCodes = new Array();
553
- listOfficeRoleCodes.push(roleCode);
554
- let component = this.myForm.nativeElement[i];
555
- let ddl = component.options;
556
- let text = ddl[ddl.selectedIndex].value.trim();
557
- if (this.configuration.component[i].itemsUrl.length == 1 || (this.configuration.component[i].ddlType == 'all' && text == 'all')) {
558
- for (let index = 0; index < this.configuration.component[i].itemsUrl.length; index++) {
559
- const element = this.configuration.component[i].itemsUrl[index];
560
- listOfficeRoleCodes.push(element.Key);
561
- listOfficeRoleCodes.push(roleCode + "-" + element.Key);
562
- }
563
- }
564
- else {
565
- listOfficeRoleCodes.push(text);
566
- listOfficeRoleCodes.push(roleCode + "-" + text);
567
- }
568
- this.searchInput.integrationObj.requestObj["OfficeRoleCodes"] = listOfficeRoleCodes;
569
- }
570
- setDefaultValueMonth(value) {
571
- let businessDate = new Date(this.BusinessDt);
572
- let operator = value.charAt(2);
573
- let tempValue = value.split(operator, 2);
574
- let numMonth = parseInt(tempValue[1]);
575
- if (!numMonth)
576
- numMonth = 1;
577
- if (operator == "-") {
578
- businessDate.setMonth(businessDate.getMonth() - numMonth);
579
- }
580
- else if (operator == "+") {
581
- businessDate.setMonth(businessDate.getMonth() + numMonth);
582
- }
583
- return businessDate.getMonth();
584
- }
585
- setMonthDDL(month) {
586
- if (month == "month")
587
- return this.ListOfMonth.ListOfMonth;
588
- let ListOfMonth = new Array();
589
- let equation = month.match("[\\+][-]|[-][\\+]|\\+|-");
590
- let toMin = this.BusinessDt.getMonth();
591
- let toMax = this.BusinessDt.getMonth();
592
- let minMax = parseInt(month.substring(equation.index + equation[0].length));
593
- if (minMax >= 12)
594
- return this.ListOfMonth.ListOfMonth;
595
- if ((equation[0] == "+-" || equation[0] == "-+") && minMax >= 6)
596
- return this.ListOfMonth.ListOfMonth;
597
- let dictOfMonth = this.ListOfMonth.DictOfMonth;
598
- ListOfMonth.push({ key: toMin, value: dictOfMonth[toMin] });
599
- for (let q = 0; q < minMax; q++) {
600
- if (equation[0].includes("-")) {
601
- toMin--;
602
- if (toMin == 0)
603
- toMin = 12;
604
- ListOfMonth.push({ key: toMin, value: dictOfMonth[toMin] });
605
- }
606
- if (equation[0].includes("+")) {
607
- toMax++;
608
- if (toMax == 13)
609
- toMax = 1;
610
- ListOfMonth.push({ key: toMax, value: dictOfMonth[toMax] });
611
- }
612
- }
613
- ListOfMonth.sort((a, b) => {
614
- return a.key - b.key;
615
- });
616
- return ListOfMonth;
617
- }
618
- setDefaultValueYear(value) {
619
- let businessDate = new Date(this.BusinessDt);
620
- let operator = value.charAt(2);
621
- let tempValue = value.split(operator, 2);
622
- let numYear = parseInt(tempValue[1]);
623
- if (!numYear)
624
- numYear = 1;
625
- if (operator == "-") {
626
- businessDate.setFullYear(businessDate.getFullYear() - numYear);
627
- }
628
- else if (operator == "+") {
629
- businessDate.setFullYear(businessDate.getFullYear() + numYear);
630
- }
631
- return businessDate.getFullYear();
632
- }
633
- setYearDDL(year) {
634
- this.ListOfYear = new Array();
635
- let equation = year.match("[\\+][-]|[-][\\+]|\\+|-");
636
- let toMin = this.BusinessDt.getFullYear();
637
- let toMax = this.BusinessDt.getFullYear();
638
- let minMax = parseInt(year.substring(equation.index + equation[0].length));
639
- this.ListOfYear.push({ key: this.BusinessDt.getFullYear(), value: this.BusinessDt.getFullYear().toString() });
640
- for (let q = 0; q < minMax; q++) {
641
- if (equation[0] == "-+" || equation[0] == "+-") {
642
- toMin--;
643
- toMax++;
644
- this.ListOfYear.push({ key: toMin, value: toMin.toString() }, { key: toMax, value: toMax.toString() });
645
- }
646
- else if (equation[0] == "-") {
647
- toMin--;
648
- this.ListOfYear.push({ key: toMin, value: toMin.toString() });
649
- }
650
- else if (equation[0] == "+") {
651
- toMax++;
652
- this.ListOfYear.push({ key: toMax, value: toMax.toString() });
653
- }
654
- }
655
- this.ListOfYear.sort((a, b) => {
656
- return a.key - b.key;
657
- });
658
- return this.ListOfYear;
659
- }
660
- getJSON(url) {
661
- return this.http.get(url);
662
- }
663
- postJSON(url, criteria = null) {
664
- return this.http.post(url, criteria);
665
- }
666
- searchClick(IsExportExcel = false, ExtFile = "") {
667
- let filtered = this.configuration.component.filter((item, i, arr) => arr.findIndex((x) => (x.name === item.name)) === i);
668
- for (let i = 0; i < filtered.length; i++) {
669
- if (filtered[i].type == "numeric") {
670
- if (!this.checkValueGteLte(filtered[i]))
671
- return;
672
- }
673
- }
674
- let order = null;
675
- if (this.configuration.orderby != null) {
676
- order = {
677
- key: this.configuration.orderby.key,
678
- value: this.configuration.orderby.value
679
- };
680
- }
681
- this.pageNow = 1;
682
- let rowPerPage = this.pageSize;
683
- if (IsExportExcel)
684
- rowPerPage = 9999;
685
- this.search(this.apiUrl, this.pageNow, rowPerPage, order, true, this.arrCrit, IsExportExcel, ExtFile);
686
- }
687
- async reset() {
688
- this.searchForm.resetForm({
689
- ExportType: this.ExportTypeList[0].key
690
- });
691
- await this.initiateForm();
692
- }
693
- async search(apiUrl, pageNo, rowPerPage, orderBy, isClickSearch, addCrit = new Array(), IsExportExcel = false, extFile = "") {
694
- let request = new RequestCriteriaObj();
695
- let arrCrit = new Array();
696
- let IsQueryIn = false;
697
- let IsBreak = false;
698
- let bodyList = new Array();
699
- let headerList = new Array();
700
- let fileName;
701
- let bodyData = new Array();
702
- let dataFile = new Array();
703
- // Inject whereQuery for where criteria
704
- if (this.searchInput.whereValue != undefined && this.searchInput.whereValue.length != 0) {
705
- this.configuration.querystring.whereQuery = new Array();
706
- for (let x = 0; x < this.searchInput.whereValue.length; x++) {
707
- this.configuration.querystring.whereQuery.push(this.searchInput.whereValue[x].value);
708
- }
709
- }
710
- if (this.searchInput.fromValue != undefined && this.searchInput.fromValue.length != 0) {
711
- this.configuration.querystring.fromQuery = new Array();
712
- for (let x = 0; x < this.searchInput.fromValue.length; x++) {
713
- this.configuration.querystring.fromQuery.push(this.searchInput.fromValue[x].value);
714
- }
715
- }
716
- request.pageNo = pageNo;
717
- request.rowPerPage = rowPerPage;
718
- request.orderBy = orderBy;
719
- request.queryString = this.configuration.querystring;
720
- let formSeq = -1;
721
- for (let i = 0; i < this.countForm; i++) {
722
- let critObj = new CriteriaObj();
723
- if (this.configuration.component[i].type == "dropdownSearch") {
724
- formSeq += 3;
725
- }
726
- else {
727
- formSeq++;
728
- }
729
- let component = this.myForm.nativeElement[formSeq];
730
- // // popup message if required
731
- // if (component.getAttribute('data-required') != null && component.getAttribute('data-required') == "true") {
732
- // let val = component.value.trim();
733
- // if (val == "") {
734
- // IsBreak = true;
735
- // let label = component.getAttribute('label');
736
- // this.toastr.warning("Please input " + label);
737
- // break;
738
- // }
739
- // }
740
- critObj.DataType = component.getAttribute('data-type');
741
- if (!critObj.DataType)
742
- critObj.DataType = "";
743
- //Ini khusus kalau dari Drop Down
744
- if (component.getAttribute('query-in') != null && component.getAttribute('query-in') == "true") {
745
- IsQueryIn = true;
746
- }
747
- else {
748
- IsQueryIn = false;
749
- }
750
- if (component.value != "") {
751
- if (component.nodeName == 'SELECT') {
752
- let ddl = component.options;
753
- let text = ddl[ddl.selectedIndex].value.trim();
754
- if (text == "one") {
755
- IsBreak = true;
756
- let label = component.getAttribute('label');
757
- this.toastr.warning("Please select " + label);
758
- break;
759
- }
760
- if (component.getAttribute('data-crit-datatable') != "" && component.getAttribute('data-crit-datatable') != null) {
761
- critObj.isCriteriaDataTable = component.getAttribute('data-crit-datatable');
762
- }
763
- if (this.configuration.component[i].type == "taskDefinitionKey" ||
764
- this.configuration.component[i].type == "processKey")
765
- continue;
766
- if (this.configuration.component[i].type == "claim") {
767
- critObj.propName = component.getAttribute('data-name');
768
- critObj.restriction = text;
769
- critObj.value = null;
770
- arrCrit.push(critObj);
771
- }
772
- else {
773
- if (text != "all" && text != "one") {
774
- //Kalau Dari Dropdown udah pasti pake Eq
775
- critObj.restriction = AdInsConstant.RestrictionEq;
776
- if (component.name != "") {
777
- critObj.propName = component.name;
778
- }
779
- else {
780
- critObj.propName = component.getAttribute('data-name');
781
- }
782
- critObj.value = text;
783
- arrCrit.push(critObj);
784
- }
785
- else if (text == "all" && IsQueryIn && component.options.length != 0) {
786
- let ddlList = new Array();
787
- for (let x = 0; x < component.options.length; x++) {
788
- if (x != 0) {
789
- ddlList.push(component.options[x].value);
790
- }
791
- }
792
- if (ddlList.length != 0) {
793
- critObj.restriction = AdInsConstant.RestrictionIn;
794
- if (component.name != "") {
795
- critObj.propName = component.name;
796
- }
797
- else {
798
- critObj.propName = component.getAttribute('data-name');
799
- }
800
- critObj.listValue = ddlList;
801
- arrCrit.push(critObj);
802
- }
803
- }
804
- }
805
- }
806
- else {
807
- //Kalau ada Percent maka yang dipake nnti adalah Restrictions Like
808
- if (component.name != "") {
809
- critObj.propName = component.name;
810
- }
811
- else {
812
- critObj.propName = component.getAttribute('data-name');
813
- }
814
- critObj.value = component.value.trim();
815
- if (component.value.includes("%")) {
816
- critObj.restriction = AdInsConstant.RestrictionLike;
817
- }
818
- //kalau componentnya Date, restrictionsnya lgsg ambil dari property JSONnya
819
- else if (component.getAttribute('data-restriction') != "" && component.getAttribute('data-restriction') != null) {
820
- critObj.restriction = component.getAttribute('data-restriction');
821
- if (component.getAttribute('data-type') == 'numeric') {
822
- critObj.value = parseFloat(component.value.replace(/,/g, '')).toString();
823
- }
824
- if (critObj.restriction.toUpperCase() == "LIKE") {
825
- critObj.value = "%" + component.value.trim() + "%";
826
- critObj.restriction = AdInsConstant.RestrictionLike;
827
- }
828
- }
829
- else {
830
- critObj.restriction = AdInsConstant.RestrictionEq;
831
- }
832
- if (component.getAttribute('data-crit-datatable') != "" && component.getAttribute('data-crit-datatable') != null) {
833
- critObj.isCriteriaDataTable = component.getAttribute('data-crit-datatable');
834
- }
835
- arrCrit.push(critObj);
836
- }
837
- }
838
- }
839
- if (IsBreak) {
840
- return;
841
- }
842
- if (addCrit != null && addCrit != undefined) {
843
- if (addCrit.length != 0) {
844
- for (let i = 0; i < addCrit.length; i++) {
845
- arrCrit.push(addCrit[i]);
846
- }
847
- }
848
- else if (this.searchInput.addCritInput != null || this.searchInput.addCritInput != undefined) {
849
- for (let i = 0; i < this.searchInput.addCritInput.length; i++) {
850
- arrCrit.push(this.searchInput.addCritInput[i]);
851
- }
852
- }
853
- }
854
- else if (this.searchInput.addCritInput != null || this.searchInput.addCritInput != undefined) {
855
- for (let i = 0; i < this.searchInput.addCritInput.length; i++) {
856
- arrCrit.push(this.searchInput.addCritInput[i]);
857
- }
858
- }
859
- if (isClickSearch) {
860
- this.persistCrit = arrCrit;
861
- }
862
- request.criteria = this.persistCrit;
863
- request.integrationObj = null;
864
- if (this.searchInput.isJoinExAPI) {
865
- request.integrationObj = this.searchInput.integrationObj;
866
- }
867
- this.isSearch = true;
868
- await this.getJSON(this.searchInput._url).subscribe(data => {
869
- bodyList = data.bodyList;
870
- fileName = data.title;
871
- headerList = data.headerList;
872
- });
873
- this.http.post(apiUrl, request).subscribe((response) => {
874
- if (IsExportExcel) {
875
- bodyData = response["Data"];
876
- dataFile = this.mapDataFile(bodyList, bodyData, headerList);
877
- if (extFile === EXPORT_DATA_TYPES.excel) {
878
- this.exportFileService.exportFileAsExcel(dataFile, fileName);
879
- }
880
- if (extFile === EXPORT_DATA_TYPES.json) {
881
- this.exportFileService.exportFileAsJson(dataFile, fileName);
882
- }
883
- if (extFile === EXPORT_DATA_TYPES.csv) {
884
- this.exportFileService.exportFileAsCsv(dataFile, fileName);
885
- }
886
- return;
887
- }
888
- let qryPaging = {
889
- response: response,
890
- pageNow: pageNo
891
- };
892
- console.log(qryPaging);
893
- this.result.emit(qryPaging);
894
- this.reqGetAllData.emit(request);
895
- return response;
896
- });
897
- }
898
- checkValueGteLte(component) {
899
- //cek yg pakai restriction gte/lte/gt/lt
900
- let MinComponent = this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == "GTE"));
901
- if (!MinComponent) {
902
- MinComponent = this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == "GT"));
903
- }
904
- let MaxComponent = this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == "LTE"));
905
- if (!MaxComponent) {
906
- MaxComponent = this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == "LT"));
907
- }
908
- if (MinComponent && MaxComponent) {
909
- let minValue = this.myForm.nativeElement[MinComponent.id].valueAsNumber;
910
- let maxValue = this.myForm.nativeElement[MaxComponent.id].valueAsNumber;
911
- if (minValue > maxValue) {
912
- this.toastr.warning(MinComponent.label + " must be less than " + MaxComponent.label);
913
- return false;
914
- }
915
- }
916
- return true;
917
- }
918
- mapDataFile(bodyListData, bodyDataArr, headerListData) {
919
- let dataExcel = new Array();
920
- let bodyDataTemp = new Array();
921
- let headerDataTemp = new Array();
922
- for (let i = 0; i < bodyListData.length; i++) {
923
- const [isNeedToPush, bodyData, headerData] = this.checkNeedDataToExport(bodyListData, headerListData, i);
924
- if (isNeedToPush) {
925
- bodyDataTemp.push(bodyData);
926
- headerDataTemp.push(headerData);
927
- }
928
- }
929
- for (let i = 0; i < bodyDataArr.length; i++) {
930
- let finalData = {};
931
- for (const [key, value] of Object.entries(bodyDataArr[i])) {
932
- const _idx = bodyDataTemp.indexOf(key);
933
- if (_idx != -1) {
934
- finalData[headerDataTemp[_idx]] = value;
935
- }
936
- }
937
- dataExcel.push(finalData);
938
- }
939
- return dataExcel;
940
- }
941
- checkNeedDataToExport(bodyListData, headerListData, idx) {
942
- // add json checker for data to export here
943
- if (bodyListData[idx]['type'] != 'action') {
944
- return [
945
- true,
946
- bodyListData[idx]['property'],
947
- headerListData[idx]['label']
948
- ];
949
- }
950
- if (bodyListData[idx]['type'] == 'action' && bodyListData[idx]['action'][0]['case'][0]['result']['type'] == 'link') {
951
- return [
952
- true,
953
- bodyListData[idx]['action'][0]['case'][0]['result']['property'],
954
- headerListData[idx]['label']
955
- ];
956
- }
957
- return [false, [], []];
958
- }
959
- GenerateReport(enjiForm) {
960
- enjiForm.form.markAllAsTouched();
961
- if (!enjiForm.form.valid)
962
- return;
963
- this.genRpt.emit({ ExportType: this.ExportType, ElRef: this.myForm });
964
- }
965
- lessThanFour() {
966
- if (this.countForm > 3) {
967
- return false;
968
- }
969
- else {
970
- return true;
971
- }
972
- }
973
- resolveObject(obj, url, crit = null) {
974
- const val = this.postJSON(url, crit);
975
- val.subscribe(tempData => {
976
- obj.itemsUrl = new Array();
977
- obj.itemsUrl = tempData.ReturnObject;
978
- if (obj.exclude != undefined && obj.exclude != "") {
979
- obj.itemsUrl = obj.itemsUrl.filter((value) => !obj.exclude.includes(value.Key));
980
- }
981
- if (obj.type == "dropdownSearch" && obj.itemsUrl.length == 1) {
982
- obj.value = obj.itemsUrl[0].Key;
983
- obj.descr = obj.itemsUrl[0].Value;
984
- }
985
- if (obj.affectedFilter && obj.itemsUrl.length == 1) {
986
- this.onChangeEvent(obj.itemsUrl[0].Key, obj);
987
- }
988
- });
989
- }
990
- transformToDecimal(element) {
991
- element.target.value = parseFloat(element.target.value.toString().replace(/,/g, ''));
992
- }
993
- exportAsFile(extFile) {
994
- this.searchClick(true, extFile);
995
- }
996
- onChangeEvent(optValue, afFilter) {
997
- let jsonComp = this.configuration.component;
998
- for (let i = 0; i < afFilter.affectedFilter.length; i++) {
999
- for (let j = 0; j < jsonComp.length; j++) {
1000
- if (jsonComp[j].name == afFilter.affectedFilter[i]) {
1001
- let request = new RequestCriteriaObj();
1002
- let arrayCrit = new Array();
1003
- if (optValue != "all" && optValue != "one") {
1004
- let critObj = new CriteriaObj();
1005
- critObj.DataType = afFilter.datatype;
1006
- if (afFilter.filterPropName != undefined || afFilter.filterPropName != "") {
1007
- request[afFilter.filterPropName] = optValue;
1008
- critObj.propName = afFilter.filterPropName;
1009
- }
1010
- else {
1011
- critObj.propName = afFilter.name;
1012
- request[afFilter.name] = optValue;
1013
- }
1014
- critObj.value = optValue;
1015
- critObj.restriction = AdInsConstant.RestrictionEq;
1016
- arrayCrit.push(critObj);
1017
- }
1018
- request.criteria = arrayCrit;
1019
- if (jsonComp[j].path != undefined && jsonComp[j].path != "") {
1020
- if (this.searchInput.listEnvironments != undefined && this.searchInput.listEnvironments.length != 0) {
1021
- for (let y = 0; y < this.searchInput.listEnvironments.length; y++) {
1022
- if (jsonComp[j].environment == this.searchInput.listEnvironments[y].environment) {
1023
- jsonComp[j].fullpath = this.searchInput.listEnvironments[y].url + jsonComp[j].path;
1024
- break;
1025
- }
1026
- }
1027
- }
1028
- else {
1029
- jsonComp[j].fullpath = jsonComp[j].url;
1030
- }
1031
- }
1032
- else {
1033
- jsonComp[j].fullpath = jsonComp[j].url;
1034
- }
1035
- this.resolveObject(jsonComp[j], jsonComp[j].fullpath, request);
1036
- }
1037
- }
1038
- }
1039
- }
1040
- SetProcessKey(idx, wfKeyFilter) {
1041
- let component = this.myForm.nativeElement[idx];
1042
- let ddl = component.options;
1043
- let text = ddl[ddl.selectedIndex].value.trim();
1044
- let listValue = text.split(';');
1045
- let listWfKey = wfKeyFilter.split(';');
1046
- for (let i = 0; i < listValue.length; i++) {
1047
- this.searchInput.integrationObj.requestObj[listWfKey[i]] = listValue[i];
1048
- }
1049
- }
1050
- switchCase(condList) {
1051
- let condition = false;
1052
- for (let i = 0; i < condList.conditions.length; i++) {
1053
- let idx = this.searchInput.switchValue.findIndex(x => x.property == condList.conditions[i].property);
1054
- if (condList.conditions[i].restriction == "EQ") {
1055
- if (!condList.conditions[i].isUser) {
1056
- if (this.searchInput.switchValue[idx].value == condList.conditions[i].value) {
1057
- condition = true;
1058
- }
1059
- else {
1060
- condition = false;
1061
- break;
1062
- }
1063
- }
1064
- else {
1065
- let username = localStorage.getItem("Username");
1066
- if (this.searchInput.switchValue[idx].value == username) {
1067
- condition = true;
1068
- }
1069
- else {
1070
- condition = false;
1071
- break;
1072
- }
1073
- }
1074
- }
1075
- else if (condList.conditions[i].restriction == "NEQ") {
1076
- if (condList.conditions[i].isUser != true) {
1077
- if (this.searchInput.switchValue[idx].value != condList.conditions[i].value) {
1078
- condition = true;
1079
- }
1080
- else {
1081
- condition = false;
1082
- break;
1083
- }
1084
- }
1085
- else {
1086
- let username = localStorage.getItem("Username");
1087
- if (this.searchInput.switchValue[idx].value != username) {
1088
- condition = true;
1089
- }
1090
- else {
1091
- condition = false;
1092
- break;
1093
- }
1094
- }
1095
- }
1096
- else if (condList.conditions[i].restriction == "GT") {
1097
- if (!condList.conditions[i].isUser) {
1098
- if (this.searchInput.switchValue[idx].value > condList.conditions[i].value) {
1099
- condition = true;
1100
- }
1101
- else {
1102
- condition = false;
1103
- break;
1104
- }
1105
- }
1106
- else {
1107
- let username = localStorage.getItem("Username");
1108
- if (this.searchInput.switchValue[idx].value > username) {
1109
- condition = true;
1110
- }
1111
- else {
1112
- condition = false;
1113
- break;
1114
- }
1115
- }
1116
- }
1117
- else if (condList.conditions[i].restriction == "GTE") {
1118
- if (!condList.conditions[i].isUser) {
1119
- if (this.searchInput.switchValue[idx].value >= condList.conditions[i].value) {
1120
- condition = true;
1121
- }
1122
- else {
1123
- condition = false;
1124
- break;
1125
- }
1126
- }
1127
- else {
1128
- let username = localStorage.getItem("Username");
1129
- if (this.searchInput.switchValue[idx].value >= username) {
1130
- condition = true;
1131
- }
1132
- else {
1133
- condition = false;
1134
- break;
1135
- }
1136
- }
1137
- }
1138
- else if (condList.conditions[i].restriction == "LT") {
1139
- if (!condList.conditions[i].isUser) {
1140
- if (this.searchInput.switchValue[idx].value < condList.conditions[i].value) {
1141
- condition = true;
1142
- }
1143
- else {
1144
- condition = false;
1145
- break;
1146
- }
1147
- }
1148
- else {
1149
- let username = localStorage.getItem("Username");
1150
- if (this.searchInput.switchValue[idx].value < username) {
1151
- condition = true;
1152
- }
1153
- else {
1154
- condition = false;
1155
- break;
1156
- }
1157
- }
1158
- }
1159
- else if (condList.conditions[i].restriction == "LTE") {
1160
- if (!condList.conditions[i].isUser) {
1161
- if (this.searchInput.switchValue[idx].value <= condList.conditions[i].value) {
1162
- condition = true;
1163
- }
1164
- else {
1165
- condition = false;
1166
- break;
1167
- }
1168
- }
1169
- else {
1170
- let username = localStorage.getItem("Username");
1171
- if (this.searchInput.switchValue[idx].value <= username) {
1172
- condition = true;
1173
- }
1174
- else {
1175
- condition = false;
1176
- break;
1177
- }
1178
- }
1179
- }
1180
- }
1181
- return condition;
1182
- }
1183
- DecryptString(chipperText, chipperKey) {
1184
- if (chipperKey == undefined || chipperKey.trim() == '' ||
1185
- chipperText == undefined || chipperText.trim() == '')
1186
- return chipperText;
1187
- let chipperKeyArr = CryptoJS.enc.Utf8.parse(chipperKey);
1188
- let iv = CryptoJS.lib.WordArray.create([0x00, 0x00, 0x00, 0x00]);
1189
- let decrypted = CryptoJS.AES.decrypt(chipperText, chipperKeyArr, { iv: iv });
1190
- let plainText = decrypted.toString(CryptoJS.enc.Utf8);
1191
- return plainText;
1192
- }
1193
- checkInputDate(component) {
1194
- let minDateVal;
1195
- let maxDateVal;
1196
- let label;
1197
- let errorMessage = new Array();
1198
- let MinComponent = this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == "GTE")) == undefined ? this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == "GT")) : this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == "GTE"));
1199
- if (MinComponent != undefined) {
1200
- minDateVal = this.myForm.nativeElement[MinComponent.id].min == "" ? null : new Date(this.myForm.nativeElement[MinComponent.id].min);
1201
- label = MinComponent.label.split(">", 2);
1202
- if (minDateVal != null) {
1203
- if (MinComponent.restriction.toUpperCase() == "GT") {
1204
- minDateVal.setDate(minDateVal.getDate() - 1);
1205
- errorMessage.push(" must be greater than ");
1206
- }
1207
- else if (MinComponent.restriction.toUpperCase() == "GTE") {
1208
- errorMessage.push(" must be greater than or equals to ");
1209
- }
1210
- }
1211
- }
1212
- let MaxComponent = this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == "LTE")) == undefined ? this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == "LT")) : this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == "LTE"));
1213
- if (MaxComponent != undefined) {
1214
- maxDateVal = this.myForm.nativeElement[MaxComponent.id].max == "" ? null : new Date(this.myForm.nativeElement[MaxComponent.id].max);
1215
- label = MaxComponent.label.split("<", 2);
1216
- if (maxDateVal != null) {
1217
- if (MaxComponent.restriction.toUpperCase() == "LT") {
1218
- maxDateVal.setDate(maxDateVal.getDate() + 1);
1219
- errorMessage.push(" must be less than ");
1220
- }
1221
- else if (MaxComponent.restriction.toUpperCase() == "LTE") {
1222
- errorMessage.push(" must be less than or equals to ");
1223
- }
1224
- }
1225
- }
1226
- if (minDateVal != null && maxDateVal == null && new Date(this.myForm.nativeElement[MinComponent.id].value) < minDateVal) {
1227
- this.toastr.warning(label[0] + errorMessage[0] + formatDate(minDateVal, 'dd MMMM yyyy', 'en-US') + ".");
1228
- this.dateWrong = true;
1229
- }
1230
- else if (maxDateVal != null && minDateVal == null && new Date(this.myForm.nativeElement[MaxComponent.id].value) > maxDateVal) {
1231
- this.toastr.warning(label[0] + errorMessage[0] + formatDate(maxDateVal, 'dd MMMM yyyy', 'en-US') + ".");
1232
- this.dateWrong = true;
1233
- }
1234
- else if (minDateVal != null && maxDateVal != null) {
1235
- if (new Date(this.myForm.nativeElement[MaxComponent.id].value) > maxDateVal || new Date(this.myForm.nativeElement[MinComponent.id].value) < minDateVal) {
1236
- this.toastr.warning(label[0] + errorMessage[0] + formatDate(minDateVal, 'dd MMMM yyyy', 'en-US') + " and" + errorMessage[1] + formatDate(maxDateVal, 'dd MMMM yyyy', 'en-US') + ".");
1237
- this.dateWrong = true;
1238
- }
1239
- else {
1240
- this.dateWrong = false;
1241
- }
1242
- }
1243
- else {
1244
- this.dateWrong = false;
1245
- }
1246
- }
1247
- selectedOption(item, crit) {
1248
- crit.descr = item.Value;
1249
- crit.isListHide = true;
1250
- }
1251
- }
1252
- /** @nocollapse */ /** @nocollapse */ UCSearchComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: UCSearchComponent, deps: [{ token: i1.HttpClient }, { token: i0.Renderer2 }, { token: DOCUMENT }, { token: i2.ToastrService }, { token: i3.CookieService }, { token: i4.DatePipe }, { token: i0.ElementRef }, { token: ExportFileService }, { token: i6.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
1253
- /** @nocollapse */ /** @nocollapse */ UCSearchComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.2", type: UCSearchComponent, selector: "lib-UCSearch", inputs: { searchInput: "searchInput", pageSize: "pageSize", isReport: "isReport" }, outputs: { result: "result", genRpt: "genRpt", reqGetAllData: "reqGetAllData" }, providers: [DatePipe, ExportFileService], viewQueries: [{ propertyName: "content", first: true, predicate: ["enjiForm"], descendants: true }, { propertyName: "myForm", first: true, predicate: ["formIdSearch"], descendants: true }], ngImport: i0, 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)=\"transformToDecimal($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 <ng-container class=\"btn-group\" *ngIf=\"exportData == true && isSearch\">\r\n <button type=\"button\"\r\n class=\"btn btn-raised btn-success mr-1 dropdown-toggle\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\" translate>\r\n <i class=\"fa ft-download\"></i>&nbsp;<span translate>Export File</span>\r\n </button>\r\n <div class=\"dropdown-menu\">\r\n <a class=\"dropdown-item\" (click)=\"exportAsFile('csv')\">as CSV</a>\r\n <a class=\"dropdown-item\" (click)=\"exportAsFile('excel')\">as EXCEL</a>\r\n <a class=\"dropdown-item\" (click)=\"exportAsFile('json')\">as JSON</a>\r\n </div>\r\n </ng-container>\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(enjiForm)\"\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 -->", 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}\n"], components: [{ type: i7.UcShowErrorsComponent, selector: "lib-uc-show-errors", inputs: ["customPattern", "control", "submit", "fieldName"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { type: i9.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i9.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i9.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10.UpperCaseDirective, selector: "input[type=text], input", inputs: ["IsUpperCase"] }, { type: i9.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i9.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i9.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i9.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i9.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { type: i11.CurrencyMaskDirective, selector: "[currencyMask]", inputs: ["options"] }, { type: i9.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i9.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i9.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }], pipes: { "date": i4.DatePipe, "textSearch": TextSearchPipe }, animations: [
1254
- trigger('changeDivSize', [
1255
- state('initial', style({
1256
- height: '*',
1257
- opacity: '1',
1258
- })),
1259
- state('final', style({
1260
- height: '0px',
1261
- opacity: '0',
1262
- overflow: 'hidden',
1263
- })),
1264
- transition('initial=>final', animate('300ms')),
1265
- transition('final=>initial', animate('300ms'))
1266
- ]),
1267
- ] });
1268
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: UCSearchComponent, decorators: [{
1269
- type: Component,
1270
- args: [{ selector: 'lib-UCSearch', providers: [DatePipe, ExportFileService], animations: [
1271
- trigger('changeDivSize', [
1272
- state('initial', style({
1273
- height: '*',
1274
- opacity: '1',
1275
- })),
1276
- state('final', style({
1277
- height: '0px',
1278
- opacity: '0',
1279
- overflow: 'hidden',
1280
- })),
1281
- transition('initial=>final', animate('300ms')),
1282
- transition('final=>initial', animate('300ms'))
1283
- ]),
1284
- ], 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)=\"transformToDecimal($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 <ng-container class=\"btn-group\" *ngIf=\"exportData == true && isSearch\">\r\n <button type=\"button\"\r\n class=\"btn btn-raised btn-success mr-1 dropdown-toggle\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\" translate>\r\n <i class=\"fa ft-download\"></i>&nbsp;<span translate>Export File</span>\r\n </button>\r\n <div class=\"dropdown-menu\">\r\n <a class=\"dropdown-item\" (click)=\"exportAsFile('csv')\">as CSV</a>\r\n <a class=\"dropdown-item\" (click)=\"exportAsFile('excel')\">as EXCEL</a>\r\n <a class=\"dropdown-item\" (click)=\"exportAsFile('json')\">as JSON</a>\r\n </div>\r\n </ng-container>\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(enjiForm)\"\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 -->", 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}\n"] }]
1285
- }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: i0.Renderer2 }, { type: undefined, decorators: [{
1286
- type: Inject,
1287
- args: [DOCUMENT]
1288
- }] }, { type: i2.ToastrService }, { type: i3.CookieService }, { type: i4.DatePipe }, { type: i0.ElementRef }, { type: ExportFileService }, { type: i6.ActivatedRoute }]; }, propDecorators: { content: [{
1289
- type: ViewChild,
1290
- args: ['enjiForm']
1291
- }], myForm: [{
1292
- type: ViewChild,
1293
- args: ['formIdSearch']
1294
- }], searchInput: [{
1295
- type: Input
1296
- }], pageSize: [{
1297
- type: Input
1298
- }], isReport: [{
1299
- type: Input
1300
- }], result: [{
1301
- type: Output
1302
- }], genRpt: [{
1303
- type: Output
1304
- }], reqGetAllData: [{
1305
- type: Output
1306
- }] } });
1307
-
1308
- const customCurrencyMaskConfig = {
1309
- align: "right",
1310
- allowNegative: false,
1311
- allowZero: true,
1312
- decimal: ".",
1313
- precision: 2,
1314
- prefix: "",
1315
- suffix: "",
1316
- thousands: ",",
1317
- nullable: false,
1318
- inputMode: CurrencyMaskInputMode.NATURAL
1319
- };
1320
- class UCSearchModule {
1321
- }
1322
- /** @nocollapse */ /** @nocollapse */ UCSearchModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: UCSearchModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1323
- /** @nocollapse */ /** @nocollapse */ UCSearchModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: UCSearchModule, declarations: [UCSearchComponent, TextSearchPipe], imports: [CommonModule,
1324
- FormsModule,
1325
- UcShowErrorsModule,
1326
- UcDirectiveUpperCaseModule, i11.NgxCurrencyModule, i8.TranslateModule], exports: [UCSearchComponent] });
1327
- /** @nocollapse */ /** @nocollapse */ UCSearchModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: UCSearchModule, imports: [[
1328
- CommonModule,
1329
- FormsModule,
1330
- UcShowErrorsModule,
1331
- UcDirectiveUpperCaseModule,
1332
- NgxCurrencyModule.forRoot(customCurrencyMaskConfig),
1333
- TranslateModule.forChild()
1334
- ]] });
1335
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: UCSearchModule, decorators: [{
1336
- type: NgModule,
1337
- args: [{
1338
- declarations: [UCSearchComponent, TextSearchPipe],
1339
- imports: [
1340
- CommonModule,
1341
- FormsModule,
1342
- UcShowErrorsModule,
1343
- UcDirectiveUpperCaseModule,
1344
- NgxCurrencyModule.forRoot(customCurrencyMaskConfig),
1345
- TranslateModule.forChild()
1346
- ],
1347
- exports: [UCSearchComponent]
1348
- }]
1349
- }] });
1350
-
1351
- /*
1352
- * Public API Surface of ucsearch
1353
- */
1354
-
1355
- /**
1356
- * Generated bundle index. Do not edit.
1357
- */
1358
-
1359
- export { UCSearchComponent, UCSearchModule, UCSearchService, customCurrencyMaskConfig };
1360
- //# sourceMappingURL=adins-ucsearch.mjs.map