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