@adins/ucsearch 5.0.1-multiversion.1 → 5.0.3-multiversion.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/adins-ucsearch.mjs +2588 -0
- package/fesm2022/adins-ucsearch.mjs.map +1 -0
- package/{adins-ucsearch.d.ts → index.d.ts} +5 -5
- package/lib/constants/month.d.ts +4 -4
- package/lib/model/adins-constant.d.ts +42 -42
- package/lib/model/criteria-obj.model.d.ts +11 -11
- package/lib/model/input-search-obj.model.d.ts +48 -48
- package/lib/model/integration-obj.model.d.ts +9 -9
- package/lib/model/key-value-report.model.d.ts +17 -17
- package/lib/model/key-value-uc-search.model.d.ts +12 -12
- package/lib/model/request-criteria-obj.model.d.ts +16 -16
- package/lib/pipe/text-search.pipe.d.ts +7 -7
- package/lib/services/export-file.service.d.ts +12 -12
- package/lib/services/ucsearch-datetime.service.d.ts +10 -10
- package/lib/services/ucsearch-form.service.d.ts +10 -10
- package/lib/ucsearch.component.d.ts +154 -154
- package/lib/ucsearch.module.d.ts +32 -32
- package/lib/ucsearch.service.d.ts +6 -6
- package/package.json +5 -13
- package/public-api.d.ts +4 -4
- package/esm2020/adins-ucsearch.mjs +0 -5
- package/esm2020/lib/constants/month.mjs +0 -51
- package/esm2020/lib/model/adins-constant.mjs +0 -52
- package/esm2020/lib/model/criteria-obj.model.mjs +0 -9
- package/esm2020/lib/model/input-search-obj.model.mjs +0 -50
- package/esm2020/lib/model/integration-obj.model.mjs +0 -12
- package/esm2020/lib/model/key-value-report.model.mjs +0 -19
- package/esm2020/lib/model/key-value-uc-search.model.mjs +0 -38
- package/esm2020/lib/model/request-criteria-obj.model.mjs +0 -14
- package/esm2020/lib/pipe/text-search.pipe.mjs +0 -24
- package/esm2020/lib/services/export-file.service.mjs +0 -61
- package/esm2020/lib/services/ucsearch-datetime.service.mjs +0 -94
- package/esm2020/lib/services/ucsearch-form.service.mjs +0 -17
- package/esm2020/lib/ucsearch.component.mjs +0 -1813
- package/esm2020/lib/ucsearch.module.mjs +0 -96
- package/esm2020/lib/ucsearch.service.mjs +0 -14
- package/esm2020/public-api.mjs +0 -8
- package/fesm2015/adins-ucsearch.mjs +0 -2346
- package/fesm2015/adins-ucsearch.mjs.map +0 -1
- package/fesm2020/adins-ucsearch.mjs +0 -2328
- package/fesm2020/adins-ucsearch.mjs.map +0 -1
|
@@ -0,0 +1,2588 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, Pipe, EventEmitter, Output, Input, ViewChild, Inject, Component, NgModule } from '@angular/core';
|
|
3
|
+
import * as i4 from '@angular/common';
|
|
4
|
+
import { DatePipe, formatDate, DOCUMENT, CommonModule } from '@angular/common';
|
|
5
|
+
import * as i1 from '@angular/common/http';
|
|
6
|
+
import * as i8 from '@angular/forms';
|
|
7
|
+
import { Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
8
|
+
import { trigger, state, transition, style, 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/fe-core';
|
|
16
|
+
import * as i11 from '@ng-bootstrap/ng-bootstrap';
|
|
17
|
+
import { NgbModule, NgbDropdownModule, NgbDropdown } from '@ng-bootstrap/ng-bootstrap';
|
|
18
|
+
import * as i12 from '@adins/uc-show-errors';
|
|
19
|
+
import { UcShowErrorsModule } from '@adins/uc-show-errors';
|
|
20
|
+
import * as i13 from '@adins/uc-directive-upper-case';
|
|
21
|
+
import { UcDirectiveUpperCaseModule } from '@adins/uc-directive-upper-case';
|
|
22
|
+
import * as i14 from '@adins/uc-directive-validate-date';
|
|
23
|
+
import { UcDirectiveValidateDateModule } from '@adins/uc-directive-validate-date';
|
|
24
|
+
import * as i15 from '@adins/cl-uclookupgeneric';
|
|
25
|
+
import { ClUclookupgenericModule } from '@adins/cl-uclookupgeneric';
|
|
26
|
+
import * as i16 from '@adins/uc-subsection';
|
|
27
|
+
import { UcSubsectionModule } from '@adins/uc-subsection';
|
|
28
|
+
import * as i17 from '@adins/ucdatepicker';
|
|
29
|
+
import { UcdatepickerModule } from '@adins/ucdatepicker';
|
|
30
|
+
import * as i18 from 'ngx-currency';
|
|
31
|
+
import { NgxCurrencyInputMode, NgxCurrencyDirective, provideEnvironmentNgxCurrency } from 'ngx-currency';
|
|
32
|
+
import * as i19 from '@ngx-translate/core';
|
|
33
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
34
|
+
|
|
35
|
+
class UCSearchService {
|
|
36
|
+
constructor() { }
|
|
37
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: UCSearchService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
38
|
+
/** @nocollapse */ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: UCSearchService, providedIn: 'root' });
|
|
39
|
+
}
|
|
40
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: UCSearchService, decorators: [{
|
|
41
|
+
type: Injectable,
|
|
42
|
+
args: [{
|
|
43
|
+
providedIn: 'root'
|
|
44
|
+
}]
|
|
45
|
+
}], ctorParameters: () => [] });
|
|
46
|
+
|
|
47
|
+
class AdInsConstant {
|
|
48
|
+
static RestrictionBetween = "Between";
|
|
49
|
+
static RestrictionLike = "Like";
|
|
50
|
+
static RestrictionEq = "Eq";
|
|
51
|
+
static RestrictionNeq = "NEQ";
|
|
52
|
+
static RestrictionGt = "GT";
|
|
53
|
+
static RestrictionGte = "GTE";
|
|
54
|
+
static RestrictionLt = "LT";
|
|
55
|
+
static RestrictionLte = "LTE";
|
|
56
|
+
static RestrictionIn = "IN";
|
|
57
|
+
static RestrictionNotIn = "NotIn";
|
|
58
|
+
static RestrictionOr = "Or"; //pastikan ada 1 criteria sebelumnya
|
|
59
|
+
static RestrictionOrNeq = "OrNeq"; //pastikan ada 1 criteria sebelumnya
|
|
60
|
+
static RestrictionIsNull = "ISNULL";
|
|
61
|
+
static RestrictionIsNotNull = "ISNOTNULL";
|
|
62
|
+
static RestrictionGTE = "GTE";
|
|
63
|
+
static RestrictionLTE = "LTE";
|
|
64
|
+
static showData = "10,50,100";
|
|
65
|
+
static JoinTypeInner = "INNER";
|
|
66
|
+
static JoinTypeLeft = "LEFT";
|
|
67
|
+
}
|
|
68
|
+
const MIME_TYPES = {
|
|
69
|
+
csv: 'text/csv;charset=UTF-8',
|
|
70
|
+
excel: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8',
|
|
71
|
+
json: 'text/json;charset=UTF-8',
|
|
72
|
+
};
|
|
73
|
+
const EXPORT_DATA_TYPES = {
|
|
74
|
+
csv: 'csv',
|
|
75
|
+
excel: 'excel',
|
|
76
|
+
json: 'json',
|
|
77
|
+
};
|
|
78
|
+
const EXTENSION_TYPE = {
|
|
79
|
+
csv: '.csv',
|
|
80
|
+
excel: '.xlsx',
|
|
81
|
+
json: '.json',
|
|
82
|
+
};
|
|
83
|
+
const ALLOWED_MIME_TYPES = [
|
|
84
|
+
MIME_TYPES.csv,
|
|
85
|
+
MIME_TYPES.excel,
|
|
86
|
+
MIME_TYPES.json,
|
|
87
|
+
];
|
|
88
|
+
const ALLOWED_EXPORT_DATA_TYPES = [
|
|
89
|
+
EXPORT_DATA_TYPES.csv,
|
|
90
|
+
EXPORT_DATA_TYPES.excel,
|
|
91
|
+
EXPORT_DATA_TYPES.json,
|
|
92
|
+
];
|
|
93
|
+
const ALLOWED_EXTENSION_TYPE = [
|
|
94
|
+
EXTENSION_TYPE.csv,
|
|
95
|
+
EXTENSION_TYPE.excel,
|
|
96
|
+
EXTENSION_TYPE.json,
|
|
97
|
+
];
|
|
98
|
+
|
|
99
|
+
class IntegrationObj {
|
|
100
|
+
baseUrl;
|
|
101
|
+
apiPath;
|
|
102
|
+
requestObj;
|
|
103
|
+
leftColumnToJoin;
|
|
104
|
+
rightColumnToJoin;
|
|
105
|
+
joinType;
|
|
106
|
+
constructor() {
|
|
107
|
+
this.baseUrl = "";
|
|
108
|
+
this.apiPath = "";
|
|
109
|
+
this.requestObj = new Object();
|
|
110
|
+
this.leftColumnToJoin = "";
|
|
111
|
+
this.rightColumnToJoin = "";
|
|
112
|
+
this.joinType = AdInsConstant.JoinTypeInner;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
class InputSearchObj {
|
|
117
|
+
_url;
|
|
118
|
+
enviromentUrl;
|
|
119
|
+
searchId;
|
|
120
|
+
title;
|
|
121
|
+
apiQryPaging;
|
|
122
|
+
arrCritObj;
|
|
123
|
+
addCritInput;
|
|
124
|
+
listEnvironments;
|
|
125
|
+
whereValue;
|
|
126
|
+
fromValue;
|
|
127
|
+
switchValue;
|
|
128
|
+
integrationObj;
|
|
129
|
+
isJoinExAPI;
|
|
130
|
+
dataInput;
|
|
131
|
+
IsSubsection;
|
|
132
|
+
dicts;
|
|
133
|
+
dictLookupObj;
|
|
134
|
+
environment;
|
|
135
|
+
constructor() {
|
|
136
|
+
this._url = "";
|
|
137
|
+
this.enviromentUrl = "";
|
|
138
|
+
this.title = "";
|
|
139
|
+
this.apiQryPaging = "";
|
|
140
|
+
this.arrCritObj = null;
|
|
141
|
+
this.addCritInput = new Array();
|
|
142
|
+
this.listEnvironments = new Array();
|
|
143
|
+
this.whereValue = new Array();
|
|
144
|
+
this.fromValue = new Array();
|
|
145
|
+
this.switchValue = new Array();
|
|
146
|
+
this.integrationObj = new IntegrationObj();
|
|
147
|
+
this.isJoinExAPI = false;
|
|
148
|
+
this.IsSubsection = true;
|
|
149
|
+
this.searchId = 'UcSearch';
|
|
150
|
+
this.dicts = {};
|
|
151
|
+
this.dictLookupObj = {};
|
|
152
|
+
this.environment = {};
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
class EnviObj {
|
|
156
|
+
name;
|
|
157
|
+
environment;
|
|
158
|
+
constructor() {
|
|
159
|
+
this.name = "";
|
|
160
|
+
this.environment = "";
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
class WhereValueObj {
|
|
164
|
+
property;
|
|
165
|
+
value;
|
|
166
|
+
constructor() {
|
|
167
|
+
this.property = "";
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
class FromValueObj {
|
|
171
|
+
property;
|
|
172
|
+
value;
|
|
173
|
+
constructor() {
|
|
174
|
+
this.property = "";
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
class SwitchValueObj {
|
|
178
|
+
property;
|
|
179
|
+
value;
|
|
180
|
+
constructor() {
|
|
181
|
+
this.property = "";
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
class EnvisObj {
|
|
185
|
+
environment;
|
|
186
|
+
url;
|
|
187
|
+
constructor() {
|
|
188
|
+
this.environment = "";
|
|
189
|
+
this.url = "";
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
class CriteriaObj {
|
|
194
|
+
propName;
|
|
195
|
+
restriction;
|
|
196
|
+
value;
|
|
197
|
+
low;
|
|
198
|
+
high;
|
|
199
|
+
DataType;
|
|
200
|
+
listValue;
|
|
201
|
+
isCriteriaDataTable;
|
|
202
|
+
constructor() {
|
|
203
|
+
this.low = 0;
|
|
204
|
+
this.high = 0;
|
|
205
|
+
this.DataType = 'Text';
|
|
206
|
+
this.isCriteriaDataTable = false;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
class RequestCriteriaObj {
|
|
211
|
+
includeCount;
|
|
212
|
+
includeData;
|
|
213
|
+
pageNo;
|
|
214
|
+
rowPerPage;
|
|
215
|
+
orderBy;
|
|
216
|
+
criteria;
|
|
217
|
+
isLoading;
|
|
218
|
+
queryString;
|
|
219
|
+
rowVersion;
|
|
220
|
+
integrationObj;
|
|
221
|
+
joinType;
|
|
222
|
+
constructor() {
|
|
223
|
+
this.includeCount = true;
|
|
224
|
+
this.includeData = true;
|
|
225
|
+
this.isLoading = true;
|
|
226
|
+
this.queryString = '';
|
|
227
|
+
this.rowVersion = '';
|
|
228
|
+
this.integrationObj = new IntegrationObj();
|
|
229
|
+
this.joinType = AdInsConstant.JoinTypeInner;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
class KeyValueReportObj {
|
|
234
|
+
key;
|
|
235
|
+
value;
|
|
236
|
+
constructor() {
|
|
237
|
+
this.key = 0;
|
|
238
|
+
this.value = "";
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
class ExportTypeConstant {
|
|
242
|
+
static EXP_TYPE_PDF = 0;
|
|
243
|
+
static EXP_TYPE_XLS = 1;
|
|
244
|
+
static EXP_TYPE_XLSX = 2;
|
|
245
|
+
static EXP_TYPE_DOC = 3;
|
|
246
|
+
static EXP_TYPE_DOCX = 4;
|
|
247
|
+
static EXP_TYPE_JPDF = 5;
|
|
248
|
+
}
|
|
249
|
+
class ReportExecTypeConstant {
|
|
250
|
+
static EXE_TYPE_SYNC = 0;
|
|
251
|
+
static EXE_TYPE_ASYNC = 1;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
class KeyValueUCSearchObj {
|
|
255
|
+
key;
|
|
256
|
+
value;
|
|
257
|
+
constructor() {
|
|
258
|
+
this.key = 0;
|
|
259
|
+
this.value = "";
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
class ListKeyValueMonth {
|
|
263
|
+
ListOfMonth;
|
|
264
|
+
DictOfMonth = {};
|
|
265
|
+
constructor() {
|
|
266
|
+
this.ListOfMonth = new Array();
|
|
267
|
+
this.DictOfMonth = {};
|
|
268
|
+
this.ListOfMonth.push({ key: 1, value: "January" });
|
|
269
|
+
this.DictOfMonth[1] = "January";
|
|
270
|
+
this.ListOfMonth.push({ key: 2, value: "February" });
|
|
271
|
+
this.DictOfMonth[2] = "February";
|
|
272
|
+
this.ListOfMonth.push({ key: 3, value: "March" });
|
|
273
|
+
this.DictOfMonth[3] = "March";
|
|
274
|
+
this.ListOfMonth.push({ key: 4, value: "April" });
|
|
275
|
+
this.DictOfMonth[4] = "April";
|
|
276
|
+
this.ListOfMonth.push({ key: 5, value: "May" });
|
|
277
|
+
this.DictOfMonth[5] = "May";
|
|
278
|
+
this.ListOfMonth.push({ key: 6, value: "June" });
|
|
279
|
+
this.DictOfMonth[6] = "June";
|
|
280
|
+
this.ListOfMonth.push({ key: 7, value: "July" });
|
|
281
|
+
this.DictOfMonth[7] = "July";
|
|
282
|
+
this.ListOfMonth.push({ key: 8, value: "August" });
|
|
283
|
+
this.DictOfMonth[8] = "August";
|
|
284
|
+
this.ListOfMonth.push({ key: 9, value: "September" });
|
|
285
|
+
this.DictOfMonth[9] = "September";
|
|
286
|
+
this.ListOfMonth.push({ key: 10, value: "October" });
|
|
287
|
+
this.DictOfMonth[10] = "October";
|
|
288
|
+
this.ListOfMonth.push({ key: 11, value: "November" });
|
|
289
|
+
this.DictOfMonth[11] = "November";
|
|
290
|
+
this.ListOfMonth.push({ key: 12, value: "December" });
|
|
291
|
+
this.DictOfMonth[12] = "December";
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
class ExportFileService {
|
|
296
|
+
exportFileAsExcel(json, fileName) {
|
|
297
|
+
const buffer = this.genExcelBuffer(json);
|
|
298
|
+
const mimeType = MIME_TYPES.excel;
|
|
299
|
+
const extType = EXTENSION_TYPE.excel;
|
|
300
|
+
this.saveAsFile(buffer, fileName, mimeType, extType);
|
|
301
|
+
}
|
|
302
|
+
exportFileAsJson(json, fileName) {
|
|
303
|
+
const buffer = this.genJsonBuffer(json);
|
|
304
|
+
const mimeType = MIME_TYPES.json;
|
|
305
|
+
const extType = EXTENSION_TYPE.json;
|
|
306
|
+
this.saveAsFile(buffer, fileName, mimeType, extType);
|
|
307
|
+
}
|
|
308
|
+
exportFileAsCsv(json, fileName) {
|
|
309
|
+
const buffer = this.genCsvBuffer(json);
|
|
310
|
+
const mimeType = MIME_TYPES.csv;
|
|
311
|
+
const extType = EXTENSION_TYPE.csv;
|
|
312
|
+
this.saveAsFile(buffer, fileName, mimeType, extType);
|
|
313
|
+
}
|
|
314
|
+
genExcelBuffer(json) {
|
|
315
|
+
const worksheet = XLSX.utils.json_to_sheet(json);
|
|
316
|
+
const workbook = { Sheets: { 'data': worksheet }, SheetNames: ['data'] };
|
|
317
|
+
const excelBuffer = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' });
|
|
318
|
+
return excelBuffer;
|
|
319
|
+
}
|
|
320
|
+
genJsonBuffer(json) {
|
|
321
|
+
return JSON.stringify(json, null, 2);
|
|
322
|
+
}
|
|
323
|
+
genCsvBuffer(json) {
|
|
324
|
+
const titleKeys = Object.keys(json[0]);
|
|
325
|
+
const refinedData = [];
|
|
326
|
+
refinedData.push(titleKeys);
|
|
327
|
+
json.forEach(item => {
|
|
328
|
+
refinedData.push(Object.values(item));
|
|
329
|
+
});
|
|
330
|
+
let csvContent = '';
|
|
331
|
+
refinedData.forEach(row => {
|
|
332
|
+
csvContent += row.join(',') + '\n';
|
|
333
|
+
});
|
|
334
|
+
return csvContent;
|
|
335
|
+
}
|
|
336
|
+
saveAsFile(buffer, fileName, mimeType, extType) {
|
|
337
|
+
const data = new Blob([buffer], {
|
|
338
|
+
type: mimeType
|
|
339
|
+
});
|
|
340
|
+
const _id = new Date().getTime();
|
|
341
|
+
const _filename = `${fileName}_export_${_id}${extType}`;
|
|
342
|
+
FileSaver.saveAs(data, _filename);
|
|
343
|
+
}
|
|
344
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ExportFileService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
345
|
+
/** @nocollapse */ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ExportFileService });
|
|
346
|
+
}
|
|
347
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ExportFileService, decorators: [{
|
|
348
|
+
type: Injectable
|
|
349
|
+
}] });
|
|
350
|
+
|
|
351
|
+
class UcsearchDatetimeService {
|
|
352
|
+
// public SetDateValue(type: DictDateType, Key: string, Code: string, Config: {BusinessDate: Date}) {
|
|
353
|
+
// const flag = this.CheckDateType(Code);
|
|
354
|
+
// const NewDate: Date = this.GetNewDate(flag, Code, Config.BusinessDate);
|
|
355
|
+
// // let NewDate: Date = null;
|
|
356
|
+
// // if (flag === 4) {
|
|
357
|
+
// // NewDate = new Date(Code);
|
|
358
|
+
// // }
|
|
359
|
+
// // else {
|
|
360
|
+
// // NewDate = this.GetNewDate(flag, Code);
|
|
361
|
+
// // }
|
|
362
|
+
// this.SetDictMinMaxDate(type, Key, NewDate);
|
|
363
|
+
// }
|
|
364
|
+
CheckDateType(code) {
|
|
365
|
+
if (!code)
|
|
366
|
+
return 0;
|
|
367
|
+
if (code.toLowerCase() === "bd" || code.toLowerCase() === "businessdate")
|
|
368
|
+
return 1;
|
|
369
|
+
const DateCode = code[0].toUpperCase();
|
|
370
|
+
const idxFoundYear = DateCode == "Y";
|
|
371
|
+
if (idxFoundYear)
|
|
372
|
+
return 2;
|
|
373
|
+
const idxFoundMonth = DateCode == "M";
|
|
374
|
+
if (idxFoundMonth)
|
|
375
|
+
return 2;
|
|
376
|
+
const idxFoundDate = DateCode == "D";
|
|
377
|
+
if (idxFoundDate)
|
|
378
|
+
return 2;
|
|
379
|
+
if (this.transformDate(code))
|
|
380
|
+
return 4;
|
|
381
|
+
return 0;
|
|
382
|
+
}
|
|
383
|
+
transformDate(value, format = "yyyy-MM-dd") {
|
|
384
|
+
const datePipe = new DatePipe('en-US');
|
|
385
|
+
return datePipe.transform(value, format);
|
|
386
|
+
}
|
|
387
|
+
GetNewDate(flag, code, initDate) {
|
|
388
|
+
switch (flag) {
|
|
389
|
+
case 0:
|
|
390
|
+
return null;
|
|
391
|
+
case 1:
|
|
392
|
+
return new Date(initDate);
|
|
393
|
+
case 2:
|
|
394
|
+
return this.CheckValidatorDate(code, initDate);
|
|
395
|
+
case 4:
|
|
396
|
+
return new Date(this.transformDate(code));
|
|
397
|
+
}
|
|
398
|
+
return new Date(initDate);
|
|
399
|
+
}
|
|
400
|
+
CheckValidatorDate(code, initDate) {
|
|
401
|
+
let NewDate = new Date(initDate);
|
|
402
|
+
const DateCode = code[0].toUpperCase();
|
|
403
|
+
const Operator = code[1];
|
|
404
|
+
let newValue = 0;
|
|
405
|
+
let valueDate = +code.substring(2);
|
|
406
|
+
if (!valueDate)
|
|
407
|
+
valueDate = 1;
|
|
408
|
+
switch (DateCode) {
|
|
409
|
+
// Year
|
|
410
|
+
case "Y":
|
|
411
|
+
const getYear = NewDate.getFullYear();
|
|
412
|
+
newValue = this.SetNewDate(Operator, getYear, valueDate);
|
|
413
|
+
NewDate.setFullYear(newValue);
|
|
414
|
+
break;
|
|
415
|
+
// Month
|
|
416
|
+
case "M":
|
|
417
|
+
const getMonth = NewDate.getMonth();
|
|
418
|
+
newValue = this.SetNewDate(Operator, getMonth, valueDate);
|
|
419
|
+
NewDate.setMonth(newValue);
|
|
420
|
+
break;
|
|
421
|
+
// Date
|
|
422
|
+
case "D":
|
|
423
|
+
const getDate = NewDate.getDate();
|
|
424
|
+
newValue = this.SetNewDate(Operator, getDate, valueDate);
|
|
425
|
+
NewDate.setDate(newValue);
|
|
426
|
+
break;
|
|
427
|
+
}
|
|
428
|
+
return NewDate;
|
|
429
|
+
}
|
|
430
|
+
SetNewDate(Operator, ValueDt, ValueToAdd) {
|
|
431
|
+
if (Operator == "+")
|
|
432
|
+
return ValueDt + ValueToAdd;
|
|
433
|
+
return ValueDt - ValueToAdd;
|
|
434
|
+
}
|
|
435
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: UcsearchDatetimeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
436
|
+
/** @nocollapse */ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: UcsearchDatetimeService });
|
|
437
|
+
}
|
|
438
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: UcsearchDatetimeService, decorators: [{
|
|
439
|
+
type: Injectable
|
|
440
|
+
}] });
|
|
441
|
+
|
|
442
|
+
const monthsKeyValue = [
|
|
443
|
+
{
|
|
444
|
+
key: 1,
|
|
445
|
+
value: "January"
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
key: 2,
|
|
449
|
+
value: "February"
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
key: 3,
|
|
453
|
+
value: "March"
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
key: 4,
|
|
457
|
+
value: "April"
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
key: 5,
|
|
461
|
+
value: "May"
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
key: 6,
|
|
465
|
+
value: "June"
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
key: 7,
|
|
469
|
+
value: "July"
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
key: 8,
|
|
473
|
+
value: "August"
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
key: 9,
|
|
477
|
+
value: "September"
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
key: 10,
|
|
481
|
+
value: "October"
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
key: 11,
|
|
485
|
+
value: "November"
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
key: 12,
|
|
489
|
+
value: "December"
|
|
490
|
+
}
|
|
491
|
+
];
|
|
492
|
+
|
|
493
|
+
class UcsearchFormService {
|
|
494
|
+
form;
|
|
495
|
+
constructor() { }
|
|
496
|
+
setForm(formGroup) {
|
|
497
|
+
this.form = formGroup;
|
|
498
|
+
}
|
|
499
|
+
getForm() {
|
|
500
|
+
return this.form;
|
|
501
|
+
}
|
|
502
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: UcsearchFormService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
503
|
+
/** @nocollapse */ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: UcsearchFormService });
|
|
504
|
+
}
|
|
505
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: UcsearchFormService, decorators: [{
|
|
506
|
+
type: Injectable
|
|
507
|
+
}], ctorParameters: () => [] });
|
|
508
|
+
|
|
509
|
+
class TextSearchPipe {
|
|
510
|
+
transform(items, text) {
|
|
511
|
+
if (!text) {
|
|
512
|
+
return items;
|
|
513
|
+
}
|
|
514
|
+
return items.filter((item) => {
|
|
515
|
+
if (item.Value && typeof item.Value === 'string') {
|
|
516
|
+
return item.Value.toLowerCase().indexOf(text.toLowerCase()) > -1;
|
|
517
|
+
}
|
|
518
|
+
return false;
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: TextSearchPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
522
|
+
/** @nocollapse */ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.5", ngImport: i0, type: TextSearchPipe, isStandalone: false, name: "textSearch" });
|
|
523
|
+
}
|
|
524
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: TextSearchPipe, decorators: [{
|
|
525
|
+
type: Pipe,
|
|
526
|
+
args: [{
|
|
527
|
+
name: 'textSearch',
|
|
528
|
+
standalone: false
|
|
529
|
+
}]
|
|
530
|
+
}] });
|
|
531
|
+
|
|
532
|
+
class UCSearchComponent {
|
|
533
|
+
http;
|
|
534
|
+
_renderer2;
|
|
535
|
+
_document;
|
|
536
|
+
toastr;
|
|
537
|
+
cookieService;
|
|
538
|
+
datePipe;
|
|
539
|
+
elemRef;
|
|
540
|
+
exportFileService;
|
|
541
|
+
route;
|
|
542
|
+
ngxRouter;
|
|
543
|
+
fb;
|
|
544
|
+
datetimeService;
|
|
545
|
+
ucSearchFormService;
|
|
546
|
+
// isListHide: boolean = true;
|
|
547
|
+
// @HostListener('document:click', ['$event'])
|
|
548
|
+
// onClick(ev: MouseEvent) {
|
|
549
|
+
// const clickInside = this.elemRef.nativeElement.contains(ev.target);
|
|
550
|
+
// if (!clickInside) {
|
|
551
|
+
// this.isListHide = true;
|
|
552
|
+
// }
|
|
553
|
+
// }
|
|
554
|
+
set content(content) {
|
|
555
|
+
if (content) {
|
|
556
|
+
// initially setter gets called with undefined
|
|
557
|
+
this.searchForm = content;
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
myForm;
|
|
561
|
+
searchInput = new InputSearchObj();
|
|
562
|
+
pageSize = 10;
|
|
563
|
+
isReport = false;
|
|
564
|
+
showRptExecType = false;
|
|
565
|
+
result = new EventEmitter();
|
|
566
|
+
genRpt = new EventEmitter();
|
|
567
|
+
reqGetAllData = new EventEmitter();
|
|
568
|
+
ExportTypeList = [
|
|
569
|
+
{
|
|
570
|
+
key: ExportTypeConstant.EXP_TYPE_PDF,
|
|
571
|
+
value: "PDF",
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
key: ExportTypeConstant.EXP_TYPE_XLSX,
|
|
575
|
+
value: "Excel 2007",
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
key: ExportTypeConstant.EXP_TYPE_DOCX,
|
|
579
|
+
value: "Document XML",
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
key: ExportTypeConstant.EXP_TYPE_JPDF,
|
|
583
|
+
value: "Justify PDF",
|
|
584
|
+
},
|
|
585
|
+
];
|
|
586
|
+
ReportExecTypeList = [
|
|
587
|
+
{
|
|
588
|
+
key: ReportExecTypeConstant.EXE_TYPE_SYNC,
|
|
589
|
+
value: "Sync",
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
key: ReportExecTypeConstant.EXE_TYPE_ASYNC,
|
|
593
|
+
value: "Async",
|
|
594
|
+
},
|
|
595
|
+
];
|
|
596
|
+
exportAsFileList = [
|
|
597
|
+
{
|
|
598
|
+
key: "csv",
|
|
599
|
+
value: "as CSV",
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
key: "excel",
|
|
603
|
+
value: "as EXCEL",
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
key: "json",
|
|
607
|
+
value: "as JSON",
|
|
608
|
+
},
|
|
609
|
+
];
|
|
610
|
+
ListOfMonth = new ListKeyValueMonth();
|
|
611
|
+
ListOfYear = new Array();
|
|
612
|
+
ClaimList = [
|
|
613
|
+
{
|
|
614
|
+
Key: AdInsConstant.RestrictionIsNotNull,
|
|
615
|
+
Value: "CLAIMED",
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
Key: AdInsConstant.RestrictionIsNull,
|
|
619
|
+
Value: "UNCLAIMED",
|
|
620
|
+
},
|
|
621
|
+
];
|
|
622
|
+
ExportType = 0;
|
|
623
|
+
RptExecType = 0;
|
|
624
|
+
pageNow = 1;
|
|
625
|
+
configuration;
|
|
626
|
+
exportData;
|
|
627
|
+
ExcelData;
|
|
628
|
+
isDataLoaded = false;
|
|
629
|
+
isHidden = false;
|
|
630
|
+
BisDt;
|
|
631
|
+
BusinessDt = new Date();
|
|
632
|
+
readonly = false;
|
|
633
|
+
isSearch = false;
|
|
634
|
+
valueDict = {}; // hold temporary value from selected dropdown, used as a payload for another search component
|
|
635
|
+
lookupDict = {}; // hold temporary value from selected lookup, used as a payload for another search component
|
|
636
|
+
currentState = "initial";
|
|
637
|
+
form;
|
|
638
|
+
countForm = 0;
|
|
639
|
+
formattedAmount = "";
|
|
640
|
+
amount = 0;
|
|
641
|
+
apiUrl;
|
|
642
|
+
arrCrit;
|
|
643
|
+
searchForm;
|
|
644
|
+
queryParam = {};
|
|
645
|
+
persistCrit = [];
|
|
646
|
+
persistAddToTempCrit;
|
|
647
|
+
lookupKeyValDict = {};
|
|
648
|
+
notifyUpdateKeyValDict = new EventEmitter();
|
|
649
|
+
months = monthsKeyValue;
|
|
650
|
+
years = [];
|
|
651
|
+
yearNow = new Date().getFullYear();
|
|
652
|
+
baseYear = 1900;
|
|
653
|
+
minMaxYear = 200;
|
|
654
|
+
useNewDatepicker = false;
|
|
655
|
+
searchBtnReady = false;
|
|
656
|
+
constructor(http, _renderer2, _document, toastr, cookieService, datePipe, elemRef, exportFileService, route, ngxRouter, fb, datetimeService, ucSearchFormService) {
|
|
657
|
+
this.http = http;
|
|
658
|
+
this._renderer2 = _renderer2;
|
|
659
|
+
this._document = _document;
|
|
660
|
+
this.toastr = toastr;
|
|
661
|
+
this.cookieService = cookieService;
|
|
662
|
+
this.datePipe = datePipe;
|
|
663
|
+
this.elemRef = elemRef;
|
|
664
|
+
this.exportFileService = exportFileService;
|
|
665
|
+
this.route = route;
|
|
666
|
+
this.ngxRouter = ngxRouter;
|
|
667
|
+
this.fb = fb;
|
|
668
|
+
this.datetimeService = datetimeService;
|
|
669
|
+
this.ucSearchFormService = ucSearchFormService;
|
|
670
|
+
this.route.queryParams.subscribe((params) => {
|
|
671
|
+
this.queryParam = this.ngxRouter.getQueryParams(params);
|
|
672
|
+
});
|
|
673
|
+
if (this.years.length === 0) {
|
|
674
|
+
for (let i = this.baseYear; i < this.baseYear + this.minMaxYear; i++) {
|
|
675
|
+
this.years.push(i);
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
if (!this.form) {
|
|
679
|
+
this.form = this.fb.group({});
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
changeState() {
|
|
683
|
+
this.currentState = this.currentState == "initial" ? "final" : "initial";
|
|
684
|
+
this.isHidden = !this.isHidden ? true : false;
|
|
685
|
+
}
|
|
686
|
+
async ngOnInit() {
|
|
687
|
+
if (this.searchInput?.environment?.experimental?.useNewDatepicker) {
|
|
688
|
+
this.useNewDatepicker =
|
|
689
|
+
this.searchInput.environment.experimental.useNewDatepicker;
|
|
690
|
+
}
|
|
691
|
+
this.apiUrl =
|
|
692
|
+
this.searchInput.enviromentUrl + this.searchInput.apiQryPaging;
|
|
693
|
+
this.arrCrit = this.searchInput.arrCritObj;
|
|
694
|
+
let js = this._renderer2.createElement("script");
|
|
695
|
+
js.text = `
|
|
696
|
+
$(document).ready(function(){
|
|
697
|
+
$("#flip").click(function(){
|
|
698
|
+
$("#panel").slideToggle("slow");
|
|
699
|
+
});
|
|
700
|
+
});
|
|
701
|
+
`;
|
|
702
|
+
this._renderer2.appendChild(this._document.body, js);
|
|
703
|
+
let value = this.cookieService.get("BusinessDateRaw");
|
|
704
|
+
this.BisDt = this.DecryptString(value, "AdInsFOU12345678");
|
|
705
|
+
this.BusinessDt = new Date(this.BisDt);
|
|
706
|
+
if (this.isValidDate(this.BusinessDt)) {
|
|
707
|
+
this.yearNow = this.BusinessDt.getFullYear();
|
|
708
|
+
}
|
|
709
|
+
await this.initiateForm(true);
|
|
710
|
+
}
|
|
711
|
+
async initiateForm(isInit) {
|
|
712
|
+
if (this.searchInput.dataInput !== undefined &&
|
|
713
|
+
Object.keys(this.searchInput.dataInput).length !== 0) {
|
|
714
|
+
this.setConfigurationData(JSON.parse(JSON.stringify(this.searchInput.dataInput)), isInit);
|
|
715
|
+
return;
|
|
716
|
+
}
|
|
717
|
+
await this.http
|
|
718
|
+
.get(this.searchInput._url)
|
|
719
|
+
.toPromise()
|
|
720
|
+
.then((data) => {
|
|
721
|
+
this.setConfigurationData(data, isInit);
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
setConfigurationData(data, isInit) {
|
|
725
|
+
this.configuration = data;
|
|
726
|
+
this.exportData = data.exportExcel;
|
|
727
|
+
if (data.exportTypeList != undefined && data.exportTypeList.length != 0) {
|
|
728
|
+
this.ExportTypeList = data.exportTypeList;
|
|
729
|
+
this.ExportType = this.ExportTypeList[0].key;
|
|
730
|
+
}
|
|
731
|
+
else {
|
|
732
|
+
this.ExportType = this.ExportTypeList[0].key;
|
|
733
|
+
}
|
|
734
|
+
if (isInit) {
|
|
735
|
+
this.form.addControl("ExportType", this.fb.control(""));
|
|
736
|
+
this.form.addControl("RptExecType", this.fb.control(""));
|
|
737
|
+
}
|
|
738
|
+
this.form.controls["ExportType"].setValue(this.ExportType);
|
|
739
|
+
this.form.controls["RptExecType"].setValue(this.RptExecType);
|
|
740
|
+
if (data.exportAsFileList != undefined &&
|
|
741
|
+
data.exportAsFileList.length != 0) {
|
|
742
|
+
this.exportAsFileList = data.exportAsFileList;
|
|
743
|
+
}
|
|
744
|
+
this.countForm = data.component.length;
|
|
745
|
+
this.isDataLoaded = true;
|
|
746
|
+
if (this.searchInput.title != undefined && this.searchInput.title != "") {
|
|
747
|
+
this.configuration.title = this.searchInput.title;
|
|
748
|
+
}
|
|
749
|
+
const userAccess = this.getUserAccess();
|
|
750
|
+
const inputEffect = [];
|
|
751
|
+
for (let i = 0; i < this.countForm; i++) {
|
|
752
|
+
//ini kalau datanya di load dari URL
|
|
753
|
+
if (data.component[i].isFromURL) {
|
|
754
|
+
let request = new RequestCriteriaObj();
|
|
755
|
+
let arrayCrit = new Array();
|
|
756
|
+
let criteriaObject = new CriteriaObj();
|
|
757
|
+
criteriaObject.DataType = "text";
|
|
758
|
+
criteriaObject.propName = data.component[i].criteriaPropName;
|
|
759
|
+
criteriaObject.value =
|
|
760
|
+
this.queryParam[data.component[i].criteriaPropValue] ||
|
|
761
|
+
data.component[i].criteriaPropValue;
|
|
762
|
+
criteriaObject.restriction = "eq";
|
|
763
|
+
arrayCrit.push(criteriaObject);
|
|
764
|
+
request.criteria = arrayCrit;
|
|
765
|
+
if (data.component[i].criteriaPropName !== null &&
|
|
766
|
+
data.component[i].criteriaPropName !== undefined) {
|
|
767
|
+
const _critPropNameArr = data.component[i].criteriaPropName.split(";");
|
|
768
|
+
const _critPropValueArr = data.component[i].criteriaPropValue.split(";");
|
|
769
|
+
for (let i = 0; i < _critPropNameArr.length; i++) {
|
|
770
|
+
request[_critPropNameArr[i]] =
|
|
771
|
+
this.queryParam[_critPropValueArr[i]] ||
|
|
772
|
+
userAccess[_critPropValueArr[i]] ||
|
|
773
|
+
_critPropValueArr[i];
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
// Pengecekan penggunaan url atau path
|
|
777
|
+
if (data.component[i].path != undefined &&
|
|
778
|
+
data.component[i].path != "") {
|
|
779
|
+
if (this.searchInput.listEnvironments != undefined &&
|
|
780
|
+
this.searchInput.listEnvironments.length != 0) {
|
|
781
|
+
for (let y = 0; y < this.searchInput.listEnvironments.length; y++) {
|
|
782
|
+
if (data.component[i].environment ==
|
|
783
|
+
this.searchInput.listEnvironments[y].environment) {
|
|
784
|
+
data.component[i].fullpath =
|
|
785
|
+
this.searchInput.listEnvironments[y].url +
|
|
786
|
+
data.component[i].path;
|
|
787
|
+
break;
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
else {
|
|
792
|
+
data.component[i].fullpath = data.component[i].url;
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
else {
|
|
796
|
+
data.component[i].fullpath = data.component[i].url;
|
|
797
|
+
}
|
|
798
|
+
//lempar objectnya sekalian sama urlnya, nnti di bind di dalem karena masalah di asyncnya
|
|
799
|
+
//biar tiap function ada state2nya sendiri
|
|
800
|
+
this.resolveObject(data.component[i], data.component[i].fullpath, request);
|
|
801
|
+
}
|
|
802
|
+
else if (!data.component[i].isFromUrl &&
|
|
803
|
+
data.component[i].type === "dropdown") {
|
|
804
|
+
if (data.component[i]?.items?.length === 1 &&
|
|
805
|
+
!data.component[i]?.keepDdl) {
|
|
806
|
+
this.lookupKeyValDict[data.component[i].name] =
|
|
807
|
+
data.component[i].items[0].key;
|
|
808
|
+
}
|
|
809
|
+
if (data.component[i]?.items?.length > 1 &&
|
|
810
|
+
data.component[i]?.useFirstValue) {
|
|
811
|
+
data.component[i].value = data.component[i].items[0].key;
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
if (data.component[i].type == "numeric") {
|
|
815
|
+
if (data.component[i].value && !isNaN(data.component[i].value)) {
|
|
816
|
+
data.component[i].value = parseFloat(data.component[i].value).toLocaleString("en");
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
//pengecekan ddl
|
|
820
|
+
if (data.component[i].type == "dropdown") {
|
|
821
|
+
if (data.component[i].dtmType != undefined) {
|
|
822
|
+
if (data.component[i].dtmType.includes("month")) {
|
|
823
|
+
if (data.component[i].value != undefined &&
|
|
824
|
+
data.component[i].value.includes("BD")) {
|
|
825
|
+
data.component[i].value = this.setDefaultValueMonth(data.component[i].value);
|
|
826
|
+
}
|
|
827
|
+
data.component[i].items = this.setMonthDDL(data.component[i].dtmType);
|
|
828
|
+
}
|
|
829
|
+
if (data.component[i].dtmType.includes("year")) {
|
|
830
|
+
if (data.component[i].value != undefined &&
|
|
831
|
+
data.component[i].value.includes("BD")) {
|
|
832
|
+
data.component[i].value = this.setDefaultValueYear(data.component[i].value);
|
|
833
|
+
}
|
|
834
|
+
data.component[i].items = this.setYearDDL(data.component[i].dtmType);
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
// if (data.component[i].type == "dropdownSearch" && !data.component[i].isFromURL && data.component[i].items?.length != 1) {
|
|
839
|
+
// if (data.component[i].ddsType == undefined || data.component[i].ddsType == "all") {
|
|
840
|
+
// data.component[i].value = "all";
|
|
841
|
+
// data.component[i].descr = "All";
|
|
842
|
+
// } else if (data.component[i].ddsType == "one") {
|
|
843
|
+
// data.component[i].value = "one";
|
|
844
|
+
// data.component[i].descr = "Select One";
|
|
845
|
+
// }
|
|
846
|
+
// }
|
|
847
|
+
if (data.component[i].type == "dropdownSearch" &&
|
|
848
|
+
!data.component[i].isFromURL &&
|
|
849
|
+
data.component[i].items.length == 1) {
|
|
850
|
+
data.component[i].value = data.component[i].items[0].Key;
|
|
851
|
+
data.component[i].descr = data.component[i].items[0].Value;
|
|
852
|
+
}
|
|
853
|
+
if (data.component[i].type != "dropdownSearch" &&
|
|
854
|
+
!data.component[i].value) {
|
|
855
|
+
data.component[i].value = "";
|
|
856
|
+
if (data.component[i].ddlType == "all")
|
|
857
|
+
data.component[i].value = "all";
|
|
858
|
+
if (data.component[i].ddlType == "one")
|
|
859
|
+
data.component[i].value = "one";
|
|
860
|
+
}
|
|
861
|
+
//pengecekan tanggal
|
|
862
|
+
if (data.component[i].type == "datepicker") {
|
|
863
|
+
this.readonly = data.component[i].readonly;
|
|
864
|
+
// Handle dynamic date values: BD, firstDayOfMonth, lastDayOfMonth with +/- operators
|
|
865
|
+
if (data.component[i].value === "firstDayOfMonth" ||
|
|
866
|
+
data.component[i].value === "lastDayOfMonth" ||
|
|
867
|
+
data.component[i].value.includes("BD") ||
|
|
868
|
+
data.component[i].value.includes("firstDayOfMonth") ||
|
|
869
|
+
data.component[i].value.includes("lastDayOfMonth")) {
|
|
870
|
+
let baseDate = this.getBusinessDate(this.BisDt);
|
|
871
|
+
// Set base date based on type
|
|
872
|
+
if (data.component[i].value.includes("firstDayOfMonth")) {
|
|
873
|
+
baseDate = this.getFirstDayOfMonth(baseDate);
|
|
874
|
+
}
|
|
875
|
+
else if (data.component[i].value.includes("lastDayOfMonth")) {
|
|
876
|
+
baseDate = this.getLastDayOfMonth(baseDate);
|
|
877
|
+
}
|
|
878
|
+
// Find operator position based on date type
|
|
879
|
+
let operator = data.component[i].value.charAt(data.component[i].value.includes("BD")
|
|
880
|
+
? 2
|
|
881
|
+
: data.component[i].value.includes("firstDayOfMonth")
|
|
882
|
+
? 15
|
|
883
|
+
: 14);
|
|
884
|
+
// Apply date arithmetic
|
|
885
|
+
if (operator == "-") {
|
|
886
|
+
let numDay = parseInt(data.component[i].value.split("-", 2)[1]);
|
|
887
|
+
baseDate.setDate(baseDate.getDate() - numDay);
|
|
888
|
+
}
|
|
889
|
+
else if (operator == "+") {
|
|
890
|
+
let numDay = parseInt(data.component[i].value.split("+", 2)[1]);
|
|
891
|
+
baseDate.setDate(baseDate.getDate() + numDay);
|
|
892
|
+
}
|
|
893
|
+
data.component[i].value = formatDate(baseDate, "yyyy-MM-dd", "en-US");
|
|
894
|
+
inputEffect.push({ key: "datepicker", value: data.component[i] });
|
|
895
|
+
}
|
|
896
|
+
if (!this.readonly) {
|
|
897
|
+
// set min date and max date
|
|
898
|
+
const _restriction = data.component[i].restriction?.toUpperCase();
|
|
899
|
+
let _minDate = data.component[i].minDate?.toLowerCase();
|
|
900
|
+
if (_minDate != undefined && _minDate != null && _minDate != "") {
|
|
901
|
+
data.component[i].confMinDate = data.component[i].minDate;
|
|
902
|
+
if (_minDate == "bd" ||
|
|
903
|
+
_minDate == "businessdate" ||
|
|
904
|
+
_minDate == "businessdt") {
|
|
905
|
+
_minDate = this.BusinessDt;
|
|
906
|
+
}
|
|
907
|
+
if (this.isValidDate(_minDate)) {
|
|
908
|
+
const _flag = this.datetimeService.CheckDateType(data.component[i]?.additionMinDateConf ?? "bd");
|
|
909
|
+
let minDate = this.datetimeService.GetNewDate(_flag, data.component[i]?.additionMinDateConf, _minDate);
|
|
910
|
+
if (_restriction == "GT" || _restriction == "LT") {
|
|
911
|
+
minDate.setDate(minDate.getDate() + 1);
|
|
912
|
+
}
|
|
913
|
+
else {
|
|
914
|
+
minDate.setDate(minDate.getDate());
|
|
915
|
+
}
|
|
916
|
+
data.component[i].minDate = minDate;
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
let _maxDate = data.component[i].maxDate?.toLowerCase();
|
|
920
|
+
if (_maxDate != undefined && _maxDate != null && _maxDate != "") {
|
|
921
|
+
data.component[i].confMaxDate = data.component[i].maxDate;
|
|
922
|
+
if (_maxDate == "bd" ||
|
|
923
|
+
_maxDate == "businessdate" ||
|
|
924
|
+
_maxDate == "businessdt") {
|
|
925
|
+
_maxDate = this.BusinessDt;
|
|
926
|
+
}
|
|
927
|
+
if (this.isValidDate(_maxDate)) {
|
|
928
|
+
const _flag = this.datetimeService.CheckDateType(data.component[i]?.additionMaxDateConf ?? "bd");
|
|
929
|
+
let maxDate = this.datetimeService.GetNewDate(_flag, data.component[i]?.additionMaxDateConf, _maxDate);
|
|
930
|
+
if (_restriction == "LT" || _restriction == "GT") {
|
|
931
|
+
maxDate.setDate(maxDate.getDate() - 1);
|
|
932
|
+
}
|
|
933
|
+
else {
|
|
934
|
+
maxDate.setDate(maxDate.getDate());
|
|
935
|
+
}
|
|
936
|
+
data.component[i].maxDate = maxDate;
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
if (data.component[i].type == "textbox") {
|
|
942
|
+
const isUppercase = data.component[i].isUppercase === undefined
|
|
943
|
+
? true
|
|
944
|
+
: data.component[i].isUppercase;
|
|
945
|
+
const _value = this.autofill(data.component[i]);
|
|
946
|
+
this.configuration.component[i].value = isUppercase
|
|
947
|
+
? _value.toUpperCase()
|
|
948
|
+
: _value;
|
|
949
|
+
}
|
|
950
|
+
if (data.component[i].type == "dropdown") {
|
|
951
|
+
const _value = this.autofill(data.component[i], false);
|
|
952
|
+
this.configuration.component[i].value = _value;
|
|
953
|
+
}
|
|
954
|
+
if (data.component[i].type === "lookup") {
|
|
955
|
+
if (!isInit) {
|
|
956
|
+
this.form.controls[data.component[i].name].get("value").setValue("");
|
|
957
|
+
this.searchInput.dictLookupObj[data.component[i].name].nameSelect =
|
|
958
|
+
"";
|
|
959
|
+
this.searchInput.dictLookupObj[data.component[i].name].idSelect = "";
|
|
960
|
+
this.form.controls["lookup_id_" + data.component[i].name].setValue("");
|
|
961
|
+
}
|
|
962
|
+
else {
|
|
963
|
+
this.form.addControl("lookup_id_" + data.component[i].name, this.fb.control(""));
|
|
964
|
+
}
|
|
965
|
+
continue;
|
|
966
|
+
}
|
|
967
|
+
let controlName = data.component[i].name;
|
|
968
|
+
let _value = data.component[i]?.value ?? "";
|
|
969
|
+
if (data.component[i].type === "datepicker" ||
|
|
970
|
+
data.component[i].type === "numeric" ||
|
|
971
|
+
data.component[i].type === "currency")
|
|
972
|
+
controlName += i;
|
|
973
|
+
if (data.component[i].type === "dropdown" && _value === "") {
|
|
974
|
+
if (data.component[i].ddlType === "one")
|
|
975
|
+
_value = "one";
|
|
976
|
+
else if (data.component[i].ddlType === "all" ||
|
|
977
|
+
data.component[i].ddlType === undefined)
|
|
978
|
+
_value = "all";
|
|
979
|
+
}
|
|
980
|
+
if (data.component[i].type === "year") {
|
|
981
|
+
_value = this.yearNow;
|
|
982
|
+
}
|
|
983
|
+
if (isInit) {
|
|
984
|
+
this.form.addControl(controlName, this.fb.control(""));
|
|
985
|
+
}
|
|
986
|
+
this.form.controls[controlName].setValue(_value);
|
|
987
|
+
if (data.component[i].isRequired) {
|
|
988
|
+
const formControl = this.form.controls[controlName];
|
|
989
|
+
const listValidators = [Validators.required];
|
|
990
|
+
formControl.setValidators(listValidators);
|
|
991
|
+
formControl.updateValueAndValidity();
|
|
992
|
+
}
|
|
993
|
+
if (data.component[i].type === "numeric" ||
|
|
994
|
+
data.component[i].type === "currency") {
|
|
995
|
+
if (data.component[i].min !== null &&
|
|
996
|
+
data.component[i].min !== undefined &&
|
|
997
|
+
data.component[i].min !== "") {
|
|
998
|
+
this.setValidatorNumber("MIN", data.component[i].min, this.form.controls[controlName]);
|
|
999
|
+
}
|
|
1000
|
+
if (data.component[i].max !== null &&
|
|
1001
|
+
data.component[i].max !== undefined &&
|
|
1002
|
+
data.component[i].max !== "") {
|
|
1003
|
+
this.setValidatorNumber("MAX", data.component[i].max, this.form.controls[controlName]);
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
setTimeout(() => {
|
|
1008
|
+
// enable search button to click and interact
|
|
1009
|
+
this.searchBtnReady = true;
|
|
1010
|
+
for (let j = 0; j < this.countForm; j++) {
|
|
1011
|
+
if (data.component[j].isEvent &&
|
|
1012
|
+
this.configuration.component[j].itemsUrl.length == 1) {
|
|
1013
|
+
this.onChangeEvent(data.component[j].itemsUrl[0].Key, data.component[j]);
|
|
1014
|
+
}
|
|
1015
|
+
if (data.component[j].type == "officeRoleCodes" &&
|
|
1016
|
+
this.configuration.component[j].itemsUrl.length > 0) {
|
|
1017
|
+
this.SetRoleOfficeCodes(j);
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
for (const [index, item] of inputEffect.entries()) {
|
|
1021
|
+
if (item.key === "datepicker") {
|
|
1022
|
+
this.checkInputDate(item.value, index);
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
}, 1000);
|
|
1026
|
+
this.setInitialLookupKeyValDict();
|
|
1027
|
+
this.ucSearchFormService.setForm(this.form);
|
|
1028
|
+
}
|
|
1029
|
+
getBusinessDate(bisDt) {
|
|
1030
|
+
return bisDt != null ? new Date(bisDt) : new Date();
|
|
1031
|
+
}
|
|
1032
|
+
getFirstDayOfMonth(date) {
|
|
1033
|
+
return new Date(date.getFullYear(), date.getMonth(), 1);
|
|
1034
|
+
}
|
|
1035
|
+
getLastDayOfMonth(date) {
|
|
1036
|
+
return new Date(date.getFullYear(), date.getMonth() + 1, 0);
|
|
1037
|
+
}
|
|
1038
|
+
setInitialLookupKeyValDict() {
|
|
1039
|
+
const arrData = this.configuration?.component ?? [];
|
|
1040
|
+
for (let item of arrData) {
|
|
1041
|
+
if (!this.lookupKeyValDict[item.name]) {
|
|
1042
|
+
this.lookupKeyValDict[item.name] = item.value;
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
getUserAccess() {
|
|
1047
|
+
const _userAccess = this.cookieService.get("UserAccess");
|
|
1048
|
+
const userAccess = JSON.parse(this.DecryptString(_userAccess, "AdInsFOU12345678"));
|
|
1049
|
+
return userAccess;
|
|
1050
|
+
}
|
|
1051
|
+
autofill(data, checkValue = true) {
|
|
1052
|
+
if (checkValue) {
|
|
1053
|
+
if (data.value != "")
|
|
1054
|
+
return data.value;
|
|
1055
|
+
}
|
|
1056
|
+
const autofill = data.autofill;
|
|
1057
|
+
if (autofill == undefined)
|
|
1058
|
+
return data.value;
|
|
1059
|
+
if (autofill.source == "param") {
|
|
1060
|
+
return this.queryParam[autofill.key];
|
|
1061
|
+
}
|
|
1062
|
+
if (autofill.source == "useraccess") {
|
|
1063
|
+
const userAccess = this.getUserAccess();
|
|
1064
|
+
return userAccess[autofill.key];
|
|
1065
|
+
}
|
|
1066
|
+
if (autofill.source == "dicts") {
|
|
1067
|
+
if (!this.searchInput.dicts) {
|
|
1068
|
+
console.log("dicts undefined...");
|
|
1069
|
+
return autofill.key;
|
|
1070
|
+
}
|
|
1071
|
+
return this.searchInput?.dicts[autofill.key] ?? autofill.key;
|
|
1072
|
+
}
|
|
1073
|
+
return data.value;
|
|
1074
|
+
}
|
|
1075
|
+
isValidDate(d) {
|
|
1076
|
+
return !isNaN(new Date(d));
|
|
1077
|
+
}
|
|
1078
|
+
SetRoleOfficeCodes(i) {
|
|
1079
|
+
let userAccess = this.getUserAccess();
|
|
1080
|
+
let roleCode = userAccess["RoleCode"];
|
|
1081
|
+
let listOfficeRoleCodes = new Array();
|
|
1082
|
+
listOfficeRoleCodes.push(roleCode);
|
|
1083
|
+
let component = this.myForm.nativeElement[i];
|
|
1084
|
+
let ddl = component.options;
|
|
1085
|
+
let text = ddl[ddl.selectedIndex].value.trim();
|
|
1086
|
+
if (this.configuration.component[i].itemsUrl.length == 1 ||
|
|
1087
|
+
(this.configuration.component[i].ddlType == "all" && text == "all")) {
|
|
1088
|
+
for (let index = 0; index < this.configuration.component[i].itemsUrl.length; index++) {
|
|
1089
|
+
const element = this.configuration.component[i].itemsUrl[index];
|
|
1090
|
+
listOfficeRoleCodes.push(element.Key);
|
|
1091
|
+
listOfficeRoleCodes.push(roleCode + "-" + element.Key);
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
else {
|
|
1095
|
+
listOfficeRoleCodes.push(text);
|
|
1096
|
+
listOfficeRoleCodes.push(roleCode + "-" + text);
|
|
1097
|
+
}
|
|
1098
|
+
this.searchInput.integrationObj.requestObj["OfficeRoleCodes"] =
|
|
1099
|
+
listOfficeRoleCodes;
|
|
1100
|
+
this.updateKeyValDict({
|
|
1101
|
+
key: this.configuration.component[i].name,
|
|
1102
|
+
value: text,
|
|
1103
|
+
});
|
|
1104
|
+
}
|
|
1105
|
+
setDefaultValueMonth(value) {
|
|
1106
|
+
let businessDate = new Date(this.BusinessDt);
|
|
1107
|
+
let operator = value.charAt(2);
|
|
1108
|
+
let tempValue = value.split(operator, 2);
|
|
1109
|
+
let numMonth = parseInt(tempValue[1]);
|
|
1110
|
+
if (!numMonth)
|
|
1111
|
+
numMonth = 1;
|
|
1112
|
+
if (operator == "-") {
|
|
1113
|
+
businessDate.setMonth(businessDate.getMonth() - numMonth);
|
|
1114
|
+
}
|
|
1115
|
+
else if (operator == "+") {
|
|
1116
|
+
businessDate.setMonth(businessDate.getMonth() + numMonth);
|
|
1117
|
+
}
|
|
1118
|
+
return businessDate.getMonth();
|
|
1119
|
+
}
|
|
1120
|
+
setMonthDDL(month) {
|
|
1121
|
+
if (month == "month")
|
|
1122
|
+
return this.ListOfMonth.ListOfMonth;
|
|
1123
|
+
let ListOfMonth = new Array();
|
|
1124
|
+
let equation = month.match("[\\+][-]|[-][\\+]|\\+|-");
|
|
1125
|
+
let toMin = this.BusinessDt.getMonth();
|
|
1126
|
+
let toMax = this.BusinessDt.getMonth();
|
|
1127
|
+
let minMax = parseInt(month.substring(equation.index + equation[0].length));
|
|
1128
|
+
if (minMax >= 12)
|
|
1129
|
+
return this.ListOfMonth.ListOfMonth;
|
|
1130
|
+
if ((equation[0] == "+-" || equation[0] == "-+") && minMax >= 6)
|
|
1131
|
+
return this.ListOfMonth.ListOfMonth;
|
|
1132
|
+
let dictOfMonth = this.ListOfMonth.DictOfMonth;
|
|
1133
|
+
ListOfMonth.push({ key: toMin, value: dictOfMonth[toMin] });
|
|
1134
|
+
for (let q = 0; q < minMax; q++) {
|
|
1135
|
+
if (equation[0].includes("-")) {
|
|
1136
|
+
toMin--;
|
|
1137
|
+
if (toMin == 0)
|
|
1138
|
+
toMin = 12;
|
|
1139
|
+
ListOfMonth.push({ key: toMin, value: dictOfMonth[toMin] });
|
|
1140
|
+
}
|
|
1141
|
+
if (equation[0].includes("+")) {
|
|
1142
|
+
toMax++;
|
|
1143
|
+
if (toMax == 13)
|
|
1144
|
+
toMax = 1;
|
|
1145
|
+
ListOfMonth.push({ key: toMax, value: dictOfMonth[toMax] });
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
ListOfMonth.sort((a, b) => {
|
|
1149
|
+
return a.key - b.key;
|
|
1150
|
+
});
|
|
1151
|
+
return ListOfMonth;
|
|
1152
|
+
}
|
|
1153
|
+
setDefaultValueYear(value) {
|
|
1154
|
+
let businessDate = new Date(this.BusinessDt);
|
|
1155
|
+
let operator = value.charAt(2);
|
|
1156
|
+
let tempValue = value.split(operator, 2);
|
|
1157
|
+
let numYear = parseInt(tempValue[1]);
|
|
1158
|
+
if (!numYear)
|
|
1159
|
+
numYear = 1;
|
|
1160
|
+
if (operator == "-") {
|
|
1161
|
+
businessDate.setFullYear(businessDate.getFullYear() - numYear);
|
|
1162
|
+
}
|
|
1163
|
+
else if (operator == "+") {
|
|
1164
|
+
businessDate.setFullYear(businessDate.getFullYear() + numYear);
|
|
1165
|
+
}
|
|
1166
|
+
return businessDate.getFullYear();
|
|
1167
|
+
}
|
|
1168
|
+
setYearDDL(year) {
|
|
1169
|
+
this.ListOfYear = new Array();
|
|
1170
|
+
let equation = year.match("[\\+][-]|[-][\\+]|\\+|-");
|
|
1171
|
+
let toMin = this.BusinessDt.getFullYear();
|
|
1172
|
+
let toMax = this.BusinessDt.getFullYear();
|
|
1173
|
+
let minMax = parseInt(year.substring(equation.index + equation[0].length));
|
|
1174
|
+
this.ListOfYear.push({
|
|
1175
|
+
key: this.BusinessDt.getFullYear(),
|
|
1176
|
+
value: this.BusinessDt.getFullYear().toString(),
|
|
1177
|
+
});
|
|
1178
|
+
for (let q = 0; q < minMax; q++) {
|
|
1179
|
+
if (equation[0] == "-+" || equation[0] == "+-") {
|
|
1180
|
+
toMin--;
|
|
1181
|
+
toMax++;
|
|
1182
|
+
this.ListOfYear.push({ key: toMin, value: toMin.toString() }, { key: toMax, value: toMax.toString() });
|
|
1183
|
+
}
|
|
1184
|
+
else if (equation[0] == "-") {
|
|
1185
|
+
toMin--;
|
|
1186
|
+
this.ListOfYear.push({ key: toMin, value: toMin.toString() });
|
|
1187
|
+
}
|
|
1188
|
+
else if (equation[0] == "+") {
|
|
1189
|
+
toMax++;
|
|
1190
|
+
this.ListOfYear.push({ key: toMax, value: toMax.toString() });
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
this.ListOfYear.sort((a, b) => {
|
|
1194
|
+
return a.key - b.key;
|
|
1195
|
+
});
|
|
1196
|
+
return this.ListOfYear;
|
|
1197
|
+
}
|
|
1198
|
+
getJSON(url) {
|
|
1199
|
+
return this.http.get(url);
|
|
1200
|
+
}
|
|
1201
|
+
postJSON(url, criteria = null) {
|
|
1202
|
+
return this.http.post(url, criteria);
|
|
1203
|
+
}
|
|
1204
|
+
searchClick(IsExportExcel = false, ExtFile = "") {
|
|
1205
|
+
// check if criteria to send is ready
|
|
1206
|
+
if (!this.searchBtnReady)
|
|
1207
|
+
return;
|
|
1208
|
+
console.log("search click enter.........");
|
|
1209
|
+
if (this.isReport != undefined && this.isReport) {
|
|
1210
|
+
this.GenerateReport(this.searchForm);
|
|
1211
|
+
return;
|
|
1212
|
+
}
|
|
1213
|
+
let filtered = this.configuration.component.filter((item, i, arr) => arr.findIndex((x) => x.name === item.name) === i);
|
|
1214
|
+
for (let i = 0; i < filtered.length; i++) {
|
|
1215
|
+
if (filtered[i].type == "numeric") {
|
|
1216
|
+
if (!this.checkValueGteLte(filtered[i]))
|
|
1217
|
+
return;
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
let order = null;
|
|
1221
|
+
if (this.configuration.orderby != null) {
|
|
1222
|
+
if (this.configuration.orderby.key !== "" &&
|
|
1223
|
+
this.configuration.orderby.value !== "") {
|
|
1224
|
+
order = {
|
|
1225
|
+
key: this.configuration.orderby.key,
|
|
1226
|
+
value: this.configuration.orderby.value,
|
|
1227
|
+
};
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
this.pageNow = 1;
|
|
1231
|
+
let rowPerPage = this.pageSize;
|
|
1232
|
+
if (IsExportExcel)
|
|
1233
|
+
rowPerPage = 9999;
|
|
1234
|
+
this.search(this.apiUrl, this.pageNow, rowPerPage, order, true, this.arrCrit, IsExportExcel, ExtFile);
|
|
1235
|
+
}
|
|
1236
|
+
async reset() {
|
|
1237
|
+
// disable button search to make sure that all criteria ready first.
|
|
1238
|
+
this.searchBtnReady = false;
|
|
1239
|
+
await this.initiateForm(false);
|
|
1240
|
+
}
|
|
1241
|
+
checkSubmitDate(component) {
|
|
1242
|
+
const _comp = this.configuration.component;
|
|
1243
|
+
const MinComponentIdx = this.configuration.component.findIndex((x) => x.datepickerPair == component.datepickerPair &&
|
|
1244
|
+
x.restriction.toUpperCase() == "GTE") === -1
|
|
1245
|
+
? this.configuration.component.findIndex((x) => x.datepickerPair == component.datepickerPair &&
|
|
1246
|
+
x.restriction.toUpperCase() == "GT")
|
|
1247
|
+
: this.configuration.component.findIndex((x) => x.datepickerPair == component.datepickerPair &&
|
|
1248
|
+
x.restriction.toUpperCase() == "GTE");
|
|
1249
|
+
const MaxComponentIdx = this.configuration.component.findIndex((x) => x.datepickerPair == component.datepickerPair &&
|
|
1250
|
+
x.restriction.toUpperCase() == "LTE") === -1
|
|
1251
|
+
? this.configuration.component.findIndex((x) => x.datepickerPair == component.datepickerPair &&
|
|
1252
|
+
x.restriction.toUpperCase() == "LT")
|
|
1253
|
+
: this.configuration.component.findIndex((x) => x.datepickerPair == component.datepickerPair &&
|
|
1254
|
+
x.restriction.toUpperCase() == "LTE");
|
|
1255
|
+
if (MinComponentIdx === -1 || MaxComponentIdx === -1)
|
|
1256
|
+
return true;
|
|
1257
|
+
if (this.form.controls[_comp[MinComponentIdx].name + MinComponentIdx].value >
|
|
1258
|
+
this.form.controls[_comp[MaxComponentIdx].name + MaxComponentIdx].value) {
|
|
1259
|
+
this.toastr.warning(_comp[MinComponentIdx].label +
|
|
1260
|
+
" must be less than " +
|
|
1261
|
+
_comp[MaxComponentIdx].label);
|
|
1262
|
+
return false;
|
|
1263
|
+
}
|
|
1264
|
+
return true;
|
|
1265
|
+
}
|
|
1266
|
+
checkNumericPair(component, myform) {
|
|
1267
|
+
// const _comp = this.configuration.component;
|
|
1268
|
+
// let MinComponentIdx = this.configuration.component.findIndex(x => x.numericPair == component.numericPair && (x.restriction.toUpperCase() == "GTE")) == undefined ? this.configuration.component.find(x => x.numericPair == component.numericPair && (x.restriction.toUpperCase() == "GT")) : this.configuration.component.find(x => x.numericPair == component.numericPair && (x.restriction.toUpperCase() == "GTE"));
|
|
1269
|
+
// let MaxComponentIdx = this.configuration.component.findIndex(x => x.numericPair == component.numericPair && (x.restriction.toUpperCase() == "LTE")) == undefined ? this.configuration.component.find(x => x.numericPair == component.numericPair && (x.restriction.toUpperCase() == "LT")) : this.configuration.component.find(x => x.numericPair == component.numericPair && (x.restriction.toUpperCase() == "LTE"));
|
|
1270
|
+
// const _min = parseFloat(this.form.controls[_comp[MinComponentIdx].name].value.replace(/,/g, ''));
|
|
1271
|
+
// const _max = parseFloat(this.form.controls[_comp[MaxComponentIdx].name].value.replace(/,/g, ''));
|
|
1272
|
+
// if (_min > _max) {
|
|
1273
|
+
// this.toastr.warning(_comp[MinComponentIdx].label + " must be less than " + _comp[MaxComponentIdx].label);
|
|
1274
|
+
// return false;
|
|
1275
|
+
// }
|
|
1276
|
+
let MinComponent = this.configuration.component.find((x) => x.numericPair == component.numericPair &&
|
|
1277
|
+
x.restriction.toUpperCase() == "GTE") == undefined
|
|
1278
|
+
? this.configuration.component.find((x) => x.numericPair == component.numericPair &&
|
|
1279
|
+
x.restriction.toUpperCase() == "GT")
|
|
1280
|
+
: this.configuration.component.find((x) => x.numericPair == component.numericPair &&
|
|
1281
|
+
x.restriction.toUpperCase() == "GTE");
|
|
1282
|
+
let MaxComponent = this.configuration.component.find((x) => x.numericPair == component.numericPair &&
|
|
1283
|
+
x.restriction.toUpperCase() == "LTE") == undefined
|
|
1284
|
+
? this.configuration.component.find((x) => x.numericPair == component.numericPair &&
|
|
1285
|
+
x.restriction.toUpperCase() == "LT")
|
|
1286
|
+
: this.configuration.component.find((x) => x.numericPair == component.numericPair &&
|
|
1287
|
+
x.restriction.toUpperCase() == "LTE");
|
|
1288
|
+
const _min = parseFloat(myform.nativeElement[MinComponent.id].value.replace(/,/g, ""));
|
|
1289
|
+
const _max = parseFloat(myform.nativeElement[MaxComponent.id].value.replace(/,/g, ""));
|
|
1290
|
+
if (_min > _max) {
|
|
1291
|
+
this.toastr.warning(MinComponent.label + " must be less than " + MaxComponent.label);
|
|
1292
|
+
return false;
|
|
1293
|
+
}
|
|
1294
|
+
return true;
|
|
1295
|
+
}
|
|
1296
|
+
async search(apiUrl, pageNo, rowPerPage, orderBy, isClickSearch, addCrit = new Array(), IsExportExcel = false, extFile = "", isAddToTemp = false, addToTempCrit = new Array()) {
|
|
1297
|
+
let request = new RequestCriteriaObj();
|
|
1298
|
+
let arrCrit = new Array();
|
|
1299
|
+
let IsQueryIn = false;
|
|
1300
|
+
let IsBreak = false;
|
|
1301
|
+
let bodyList = new Array();
|
|
1302
|
+
let headerList = new Array();
|
|
1303
|
+
let fileName;
|
|
1304
|
+
let bodyData = new Array();
|
|
1305
|
+
let dataFile = new Array();
|
|
1306
|
+
let additionalExportList = new Array();
|
|
1307
|
+
let excludeExportList = new Array();
|
|
1308
|
+
const mappedConfNameValue = {};
|
|
1309
|
+
for (let [index, val] of this.configuration.component.entries()) {
|
|
1310
|
+
let _name = val.name;
|
|
1311
|
+
if (val.type === "datepicker" ||
|
|
1312
|
+
val.type === "numeric" ||
|
|
1313
|
+
val.type === "currency")
|
|
1314
|
+
_name += index;
|
|
1315
|
+
mappedConfNameValue[_name] = {
|
|
1316
|
+
value: this.form.controls[_name].value,
|
|
1317
|
+
};
|
|
1318
|
+
}
|
|
1319
|
+
// Inject whereQuery for where criteria
|
|
1320
|
+
if (this.searchInput.whereValue != undefined &&
|
|
1321
|
+
this.searchInput.whereValue.length != 0) {
|
|
1322
|
+
this.configuration.querystring.whereQuery = new Array();
|
|
1323
|
+
for (let x = 0; x < this.searchInput.whereValue.length; x++) {
|
|
1324
|
+
// read value based on search component value - if not found, will hardcoded
|
|
1325
|
+
const _val = mappedConfNameValue[this.searchInput.whereValue[x].value]
|
|
1326
|
+
? mappedConfNameValue[this.searchInput.whereValue[x].value].value
|
|
1327
|
+
: this.searchInput.whereValue[x].value;
|
|
1328
|
+
// this.configuration.querystring.whereQuery.push(this.searchInput.whereValue[x].value);
|
|
1329
|
+
this.configuration.querystring.whereQuery.push(_val);
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
if (this.searchInput.fromValue != undefined &&
|
|
1333
|
+
this.searchInput.fromValue.length != 0) {
|
|
1334
|
+
this.configuration.querystring.fromQuery = new Array();
|
|
1335
|
+
for (let x = 0; x < this.searchInput.fromValue.length; x++) {
|
|
1336
|
+
// read value based on search component value - if not found, will hardcoded
|
|
1337
|
+
const _val = mappedConfNameValue[this.searchInput.fromValue[x].value]
|
|
1338
|
+
? mappedConfNameValue[this.searchInput.fromValue[x].value].value
|
|
1339
|
+
: this.searchInput.fromValue[x].value;
|
|
1340
|
+
// this.configuration.querystring.fromQuery.push(this.searchInput.fromValue[x].value);
|
|
1341
|
+
this.configuration.querystring.fromQuery.push(_val);
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
request.pageNo = pageNo;
|
|
1345
|
+
request.rowPerPage = rowPerPage;
|
|
1346
|
+
request.orderBy = orderBy;
|
|
1347
|
+
request.queryString = this.configuration.querystring;
|
|
1348
|
+
let filtered = this.configuration.component.filter((item, i, arr) => {
|
|
1349
|
+
if (item.datepickerPair === undefined || item.datepickerPair === "")
|
|
1350
|
+
return;
|
|
1351
|
+
return (arr.findIndex((x) => x.datepickerPair === item.datepickerPair) === i);
|
|
1352
|
+
});
|
|
1353
|
+
for (let i = 0; i < filtered.length; i++) {
|
|
1354
|
+
if (filtered[i].type == "datepicker") {
|
|
1355
|
+
if (!this.checkSubmitDate(filtered[i]))
|
|
1356
|
+
return;
|
|
1357
|
+
}
|
|
1358
|
+
}
|
|
1359
|
+
let filteredNumeric = this.configuration.component.filter((item, i, arr) => {
|
|
1360
|
+
if (item.numericPair === undefined || item.numericPair === "")
|
|
1361
|
+
return;
|
|
1362
|
+
return arr.findIndex((x) => x.numericPair === item.numericPair) === i;
|
|
1363
|
+
});
|
|
1364
|
+
for (let i = 0; i < filteredNumeric.length; i++) {
|
|
1365
|
+
0;
|
|
1366
|
+
if (filteredNumeric[i].type == "numeric" ||
|
|
1367
|
+
filteredNumeric[i].type == "currency") {
|
|
1368
|
+
if (!this.checkNumericPair(filteredNumeric[i], this.myForm))
|
|
1369
|
+
return;
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1372
|
+
let formSeq = -1;
|
|
1373
|
+
for (let i = 0; i < this.countForm; i++) {
|
|
1374
|
+
let critObj = new CriteriaObj();
|
|
1375
|
+
if (this.configuration.component[i].type == "blank")
|
|
1376
|
+
continue;
|
|
1377
|
+
if (this.configuration.component[i].type == "dropdownSearch") {
|
|
1378
|
+
formSeq += 3;
|
|
1379
|
+
}
|
|
1380
|
+
else {
|
|
1381
|
+
formSeq++;
|
|
1382
|
+
}
|
|
1383
|
+
if (this.configuration.component[i].excludeFromCrit)
|
|
1384
|
+
continue;
|
|
1385
|
+
let component = this.myForm.nativeElement[formSeq];
|
|
1386
|
+
let _componentValue = `${this.form.controls[this.configuration.component[i].name]?.value ?? ""}`;
|
|
1387
|
+
if (this.configuration.component[i].type === "lookup") {
|
|
1388
|
+
_componentValue = `${this.form.controls["lookup_id_" + this.configuration.component[i].name].value ?? ""}`;
|
|
1389
|
+
}
|
|
1390
|
+
else if (this.configuration.component[i].type === "datepicker" ||
|
|
1391
|
+
this.configuration.component[i].type === "numeric" ||
|
|
1392
|
+
this.configuration.component[i].type === "currency") {
|
|
1393
|
+
_componentValue = `${this.form.controls[this.configuration.component[i].name + i].value ??
|
|
1394
|
+
""}`;
|
|
1395
|
+
}
|
|
1396
|
+
critObj.DataType = component.getAttribute("data-type");
|
|
1397
|
+
if (!critObj.DataType)
|
|
1398
|
+
critObj.DataType = "";
|
|
1399
|
+
//Ini khusus kalau dari Drop Down
|
|
1400
|
+
if (component.getAttribute("query-in") != null &&
|
|
1401
|
+
component.getAttribute("query-in") == "true") {
|
|
1402
|
+
IsQueryIn = true;
|
|
1403
|
+
}
|
|
1404
|
+
else {
|
|
1405
|
+
IsQueryIn = false;
|
|
1406
|
+
}
|
|
1407
|
+
if (component.nodeName == "SELECT") {
|
|
1408
|
+
let ddl = component.options;
|
|
1409
|
+
if (ddl.selectedIndex === -1 &&
|
|
1410
|
+
ddl.length === 1 &&
|
|
1411
|
+
_componentValue == "") {
|
|
1412
|
+
_componentValue = "SELECT_TEMP";
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
if (_componentValue != "") {
|
|
1416
|
+
if (component.nodeName == "SELECT") {
|
|
1417
|
+
let ddl = component.options;
|
|
1418
|
+
if (ddl.selectedIndex === -1 && ddl.length === 1) {
|
|
1419
|
+
ddl.selectedIndex = 0;
|
|
1420
|
+
}
|
|
1421
|
+
let text = ddl[ddl.selectedIndex].value.trim();
|
|
1422
|
+
if (text == "one") {
|
|
1423
|
+
IsBreak = true;
|
|
1424
|
+
let label = component.getAttribute("label");
|
|
1425
|
+
this.toastr.warning("Please select " + label);
|
|
1426
|
+
break;
|
|
1427
|
+
}
|
|
1428
|
+
if (component.getAttribute("data-crit-datatable") != "" &&
|
|
1429
|
+
component.getAttribute("data-crit-datatable") != null) {
|
|
1430
|
+
critObj.isCriteriaDataTable = component.getAttribute("data-crit-datatable");
|
|
1431
|
+
}
|
|
1432
|
+
if (this.configuration.component[i].type == "taskDefinitionKey" ||
|
|
1433
|
+
this.configuration.component[i].type == "processKey") {
|
|
1434
|
+
if (ddl.length === 1) {
|
|
1435
|
+
this.SetProcessKey(i, this.configuration.component[i].wfKeyFilter);
|
|
1436
|
+
}
|
|
1437
|
+
continue;
|
|
1438
|
+
}
|
|
1439
|
+
if (this.configuration.component[i].type == "claim") {
|
|
1440
|
+
critObj.propName = component.getAttribute("data-name");
|
|
1441
|
+
critObj.restriction = text;
|
|
1442
|
+
critObj.value = null;
|
|
1443
|
+
if (!isAddToTemp) {
|
|
1444
|
+
arrCrit.push(critObj);
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
else {
|
|
1448
|
+
if (text != "all" && text != "one" && text != "others") {
|
|
1449
|
+
//Kalau Dari Dropdown udah pasti pake Eq
|
|
1450
|
+
critObj.restriction = AdInsConstant.RestrictionEq;
|
|
1451
|
+
if (component.name != "") {
|
|
1452
|
+
critObj.propName = component.name;
|
|
1453
|
+
}
|
|
1454
|
+
else {
|
|
1455
|
+
critObj.propName = component.getAttribute("data-name");
|
|
1456
|
+
}
|
|
1457
|
+
critObj.value = text;
|
|
1458
|
+
const restriction = component.getAttribute("data-restriction");
|
|
1459
|
+
if (restriction != "" && restriction != null) {
|
|
1460
|
+
// override restriction
|
|
1461
|
+
critObj.restriction = restriction;
|
|
1462
|
+
if (restriction == AdInsConstant.RestrictionLike) {
|
|
1463
|
+
critObj.value = `%${text}%`;
|
|
1464
|
+
}
|
|
1465
|
+
}
|
|
1466
|
+
if (!isAddToTemp) {
|
|
1467
|
+
arrCrit.push(critObj);
|
|
1468
|
+
}
|
|
1469
|
+
}
|
|
1470
|
+
else if (text == "all" &&
|
|
1471
|
+
IsQueryIn &&
|
|
1472
|
+
component.options.length != 0) {
|
|
1473
|
+
let ddlList = new Array();
|
|
1474
|
+
for (let x = 0; x < component.options.length; x++) {
|
|
1475
|
+
if (x != 0) {
|
|
1476
|
+
ddlList.push(component.options[x].value);
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
if (ddlList.length != 0) {
|
|
1480
|
+
critObj.restriction = AdInsConstant.RestrictionIn;
|
|
1481
|
+
if (component.name != "") {
|
|
1482
|
+
critObj.propName = component.name;
|
|
1483
|
+
}
|
|
1484
|
+
else {
|
|
1485
|
+
critObj.propName = component.getAttribute("data-name");
|
|
1486
|
+
}
|
|
1487
|
+
critObj.listValue = ddlList;
|
|
1488
|
+
if (!isAddToTemp) {
|
|
1489
|
+
arrCrit.push(critObj);
|
|
1490
|
+
}
|
|
1491
|
+
}
|
|
1492
|
+
}
|
|
1493
|
+
else if (text == "others" && component.options.length != 0) {
|
|
1494
|
+
let ddlList = new Array();
|
|
1495
|
+
for (let x = 0; x < component.options.length; x++) {
|
|
1496
|
+
if (x != 0 && x != component.options.length - 1) {
|
|
1497
|
+
ddlList.push(component.options[x].value);
|
|
1498
|
+
}
|
|
1499
|
+
}
|
|
1500
|
+
if (ddlList.length != 0) {
|
|
1501
|
+
critObj.restriction = AdInsConstant.RestrictionNotIn;
|
|
1502
|
+
if (component.name != "") {
|
|
1503
|
+
critObj.propName = component.name;
|
|
1504
|
+
}
|
|
1505
|
+
else {
|
|
1506
|
+
critObj.propName = component.getAttribute("data-name");
|
|
1507
|
+
}
|
|
1508
|
+
critObj.listValue = ddlList;
|
|
1509
|
+
if (!isAddToTemp) {
|
|
1510
|
+
arrCrit.push(critObj);
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1513
|
+
}
|
|
1514
|
+
}
|
|
1515
|
+
}
|
|
1516
|
+
else {
|
|
1517
|
+
const compDataType = component.getAttribute("data-type");
|
|
1518
|
+
if (compDataType === "lookup" ||
|
|
1519
|
+
(compDataType === "date" && this.useNewDatepicker)) {
|
|
1520
|
+
formSeq++;
|
|
1521
|
+
}
|
|
1522
|
+
//Kalau ada Percent maka yang dipake nnti adalah Restrictions Like
|
|
1523
|
+
if (component.name != "") {
|
|
1524
|
+
critObj.propName = component.name;
|
|
1525
|
+
}
|
|
1526
|
+
else {
|
|
1527
|
+
critObj.propName = component.getAttribute("data-name");
|
|
1528
|
+
}
|
|
1529
|
+
if (this.configuration.component[i].type === "datepicker" ||
|
|
1530
|
+
this.configuration.component[i].type === "numeric" ||
|
|
1531
|
+
this.configuration.component[i].type === "currency") {
|
|
1532
|
+
critObj.propName = component.getAttribute("data-name");
|
|
1533
|
+
}
|
|
1534
|
+
critObj.value = _componentValue;
|
|
1535
|
+
// normalize data type from lookup to text;
|
|
1536
|
+
if (compDataType === "lookup")
|
|
1537
|
+
critObj.DataType = "text";
|
|
1538
|
+
if (_componentValue.includes("%")) {
|
|
1539
|
+
critObj.restriction = AdInsConstant.RestrictionLike;
|
|
1540
|
+
_componentValue =
|
|
1541
|
+
this.removeTrailingBackslashesAfterPercent(_componentValue);
|
|
1542
|
+
critObj.value = _componentValue;
|
|
1543
|
+
}
|
|
1544
|
+
//kalau componentnya Date, restrictionsnya lgsg ambil dari property JSONnya
|
|
1545
|
+
else if (component.getAttribute("data-restriction") != "" &&
|
|
1546
|
+
component.getAttribute("data-restriction") != null) {
|
|
1547
|
+
critObj.restriction = component.getAttribute("data-restriction");
|
|
1548
|
+
if (component.getAttribute("data-type") == "numeric") {
|
|
1549
|
+
critObj.value = parseFloat(_componentValue.replace(/,/g, "")).toString();
|
|
1550
|
+
}
|
|
1551
|
+
if (critObj.restriction.toUpperCase() == "LIKE") {
|
|
1552
|
+
critObj.value = "%" + _componentValue.trim() + "%";
|
|
1553
|
+
critObj.restriction = AdInsConstant.RestrictionLike;
|
|
1554
|
+
}
|
|
1555
|
+
}
|
|
1556
|
+
else {
|
|
1557
|
+
critObj.restriction = AdInsConstant.RestrictionEq;
|
|
1558
|
+
}
|
|
1559
|
+
if (component.getAttribute("data-crit-datatable") != "" &&
|
|
1560
|
+
component.getAttribute("data-crit-datatable") != null) {
|
|
1561
|
+
critObj.isCriteriaDataTable = component.getAttribute("data-crit-datatable");
|
|
1562
|
+
}
|
|
1563
|
+
let skipPushToCrit = false;
|
|
1564
|
+
if (this.configuration.component[i].type === "time") {
|
|
1565
|
+
// check is standalone or not
|
|
1566
|
+
const useTimePair = this.configuration.component[i].useTimePair;
|
|
1567
|
+
if (useTimePair) {
|
|
1568
|
+
skipPushToCrit = true;
|
|
1569
|
+
const indexPair = arrCrit.findIndex((x) => x.propName === this.configuration.component[i].timePair &&
|
|
1570
|
+
x.restriction === this.configuration.component[i].restriction);
|
|
1571
|
+
if (indexPair > -1) {
|
|
1572
|
+
const _value = new Date(arrCrit[indexPair].value);
|
|
1573
|
+
// Extract the date components
|
|
1574
|
+
const year = _value.getUTCFullYear();
|
|
1575
|
+
const month = _value.getUTCMonth();
|
|
1576
|
+
const day = _value.getUTCDate();
|
|
1577
|
+
// Extract time components
|
|
1578
|
+
const [hours, minutes] = _componentValue.split(":").map(Number);
|
|
1579
|
+
const result = new Date(Date.UTC(year, month, day, hours, minutes, 0))
|
|
1580
|
+
.toISOString()
|
|
1581
|
+
.replace("T", " ")
|
|
1582
|
+
.replace("Z", "");
|
|
1583
|
+
arrCrit[indexPair].value = result;
|
|
1584
|
+
}
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
if (!isAddToTemp && !skipPushToCrit) {
|
|
1588
|
+
arrCrit.push(critObj);
|
|
1589
|
+
}
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
1592
|
+
else {
|
|
1593
|
+
const compDataType = component.getAttribute("data-type");
|
|
1594
|
+
if (compDataType === "lookup" ||
|
|
1595
|
+
(compDataType === "date" && this.useNewDatepicker)) {
|
|
1596
|
+
formSeq++;
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
if (IsBreak) {
|
|
1601
|
+
return;
|
|
1602
|
+
}
|
|
1603
|
+
if (addCrit != null && addCrit != undefined) {
|
|
1604
|
+
if (addCrit.length != 0) {
|
|
1605
|
+
for (let i = 0; i < addCrit.length; i++) {
|
|
1606
|
+
arrCrit.push(addCrit[i]);
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
else if (this.searchInput.addCritInput != null ||
|
|
1610
|
+
this.searchInput.addCritInput != undefined) {
|
|
1611
|
+
for (let i = 0; i < this.searchInput.addCritInput.length; i++) {
|
|
1612
|
+
arrCrit.push(this.searchInput.addCritInput[i]);
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
}
|
|
1616
|
+
else if (this.searchInput.addCritInput != null ||
|
|
1617
|
+
this.searchInput.addCritInput != undefined) {
|
|
1618
|
+
for (let i = 0; i < this.searchInput.addCritInput.length; i++) {
|
|
1619
|
+
arrCrit.push(this.searchInput.addCritInput[i]);
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1622
|
+
if (isClickSearch) {
|
|
1623
|
+
this.persistCrit = arrCrit;
|
|
1624
|
+
}
|
|
1625
|
+
request.criteria = this.persistCrit;
|
|
1626
|
+
if (isAddToTemp) {
|
|
1627
|
+
this.persistAddToTempCrit = addToTempCrit;
|
|
1628
|
+
}
|
|
1629
|
+
if (this.persistAddToTempCrit !== undefined) {
|
|
1630
|
+
request.criteria = request.criteria.concat(this.persistAddToTempCrit);
|
|
1631
|
+
}
|
|
1632
|
+
// filter duplicate data in array
|
|
1633
|
+
request.criteria = this.filterDuplicateData(request.criteria);
|
|
1634
|
+
// filter empty value in listValue
|
|
1635
|
+
request.criteria = this.filterListValueEmpty(request.criteria);
|
|
1636
|
+
request.integrationObj = null;
|
|
1637
|
+
if (this.searchInput.isJoinExAPI) {
|
|
1638
|
+
request.integrationObj = this.searchInput.integrationObj;
|
|
1639
|
+
}
|
|
1640
|
+
this.isSearch = true;
|
|
1641
|
+
if (this.searchInput.dataInput !== undefined &&
|
|
1642
|
+
Object.keys(this.searchInput.dataInput).length !== 0) {
|
|
1643
|
+
bodyList = this.searchInput.dataInput.bodyList;
|
|
1644
|
+
fileName = this.searchInput.dataInput.title;
|
|
1645
|
+
headerList = this.searchInput.dataInput.headerList;
|
|
1646
|
+
additionalExportList = this.searchInput.dataInput.additionalExportList;
|
|
1647
|
+
excludeExportList = this.searchInput.dataInput.excludeExportList;
|
|
1648
|
+
}
|
|
1649
|
+
else {
|
|
1650
|
+
await this.http
|
|
1651
|
+
.get(this.searchInput._url)
|
|
1652
|
+
.toPromise()
|
|
1653
|
+
.then((data) => {
|
|
1654
|
+
bodyList = data.bodyList;
|
|
1655
|
+
fileName = data.title;
|
|
1656
|
+
headerList = data.headerList;
|
|
1657
|
+
additionalExportList = data.additionalExportList;
|
|
1658
|
+
excludeExportList = data.excludeExportList;
|
|
1659
|
+
});
|
|
1660
|
+
}
|
|
1661
|
+
this.http.post(apiUrl, request).subscribe((response) => {
|
|
1662
|
+
if (IsExportExcel) {
|
|
1663
|
+
bodyData = response["Data"];
|
|
1664
|
+
[headerList, bodyList] = this.checkAdditionalExportList(headerList, bodyList, additionalExportList);
|
|
1665
|
+
[headerList, bodyList] = this.checkExcludeExportList(headerList, bodyList, excludeExportList);
|
|
1666
|
+
dataFile = this.mapDataFile(bodyList, bodyData, headerList);
|
|
1667
|
+
if (extFile === EXPORT_DATA_TYPES.excel) {
|
|
1668
|
+
this.exportFileService.exportFileAsExcel(dataFile, fileName);
|
|
1669
|
+
}
|
|
1670
|
+
if (extFile === EXPORT_DATA_TYPES.json) {
|
|
1671
|
+
this.exportFileService.exportFileAsJson(dataFile, fileName);
|
|
1672
|
+
}
|
|
1673
|
+
if (extFile === EXPORT_DATA_TYPES.csv) {
|
|
1674
|
+
this.exportFileService.exportFileAsCsv(dataFile, fileName);
|
|
1675
|
+
}
|
|
1676
|
+
const $sequence = Math.round(response["Count"] / rowPerPage);
|
|
1677
|
+
if ($sequence > 1 && $sequence > pageNo) {
|
|
1678
|
+
pageNo = pageNo + 1;
|
|
1679
|
+
setTimeout(() => this.search(apiUrl, pageNo, rowPerPage, orderBy, true, addCrit, IsExportExcel, extFile), 50);
|
|
1680
|
+
}
|
|
1681
|
+
return;
|
|
1682
|
+
}
|
|
1683
|
+
//handle if response data is null
|
|
1684
|
+
if (response["Data"] === null) {
|
|
1685
|
+
response["Data"] = [];
|
|
1686
|
+
}
|
|
1687
|
+
let qryPaging = {
|
|
1688
|
+
response: response,
|
|
1689
|
+
pageNow: pageNo,
|
|
1690
|
+
};
|
|
1691
|
+
console.log(qryPaging);
|
|
1692
|
+
this.result.emit(qryPaging);
|
|
1693
|
+
this.reqGetAllData.emit(request);
|
|
1694
|
+
return response;
|
|
1695
|
+
});
|
|
1696
|
+
}
|
|
1697
|
+
filterDuplicateData(data) {
|
|
1698
|
+
return data.filter((value, index) => {
|
|
1699
|
+
const _value = JSON.stringify(value);
|
|
1700
|
+
return (index ===
|
|
1701
|
+
data.findIndex((obj) => {
|
|
1702
|
+
return JSON.stringify(obj) === _value;
|
|
1703
|
+
}));
|
|
1704
|
+
});
|
|
1705
|
+
}
|
|
1706
|
+
filterListValueEmpty(data) {
|
|
1707
|
+
return data.filter((value) => {
|
|
1708
|
+
if (value.listValue === undefined)
|
|
1709
|
+
return value;
|
|
1710
|
+
if (value.listValue.length === 0)
|
|
1711
|
+
return;
|
|
1712
|
+
return value;
|
|
1713
|
+
});
|
|
1714
|
+
}
|
|
1715
|
+
removeTrailingBackslashesAfterPercent(str) {
|
|
1716
|
+
if (typeof str !== "string" || str?.length === 0) {
|
|
1717
|
+
return str;
|
|
1718
|
+
}
|
|
1719
|
+
return str.replace(/%(\\+)$/, "%");
|
|
1720
|
+
}
|
|
1721
|
+
checkValueGteLte(component) {
|
|
1722
|
+
//cek yg pakai restriction gte/lte/gt/lt
|
|
1723
|
+
let MinComponent = this.configuration.component.find((x) => x.name == component.name && x.restriction.toUpperCase() == "GTE");
|
|
1724
|
+
if (!MinComponent) {
|
|
1725
|
+
MinComponent = this.configuration.component.find((x) => x.name == component.name && x.restriction.toUpperCase() == "GT");
|
|
1726
|
+
}
|
|
1727
|
+
let MaxComponent = this.configuration.component.find((x) => x.name == component.name && x.restriction.toUpperCase() == "LTE");
|
|
1728
|
+
if (!MaxComponent) {
|
|
1729
|
+
MaxComponent = this.configuration.component.find((x) => x.name == component.name && x.restriction.toUpperCase() == "LT");
|
|
1730
|
+
}
|
|
1731
|
+
if (MinComponent && MaxComponent) {
|
|
1732
|
+
let minValue = this.myForm.nativeElement[MinComponent.id].valueAsNumber;
|
|
1733
|
+
let maxValue = this.myForm.nativeElement[MaxComponent.id].valueAsNumber;
|
|
1734
|
+
if (minValue > maxValue) {
|
|
1735
|
+
this.toastr.warning(MinComponent.label + " must be less than " + MaxComponent.label);
|
|
1736
|
+
return false;
|
|
1737
|
+
}
|
|
1738
|
+
}
|
|
1739
|
+
return true;
|
|
1740
|
+
}
|
|
1741
|
+
mapDataFile(bodyListData, bodyDataArr, headerListData) {
|
|
1742
|
+
let dataExcel = new Array();
|
|
1743
|
+
let bodyDataTemp = new Array();
|
|
1744
|
+
let headerDataTemp = new Array();
|
|
1745
|
+
for (let i = 0; i < bodyListData.length; i++) {
|
|
1746
|
+
const [isNeedToPush, bodyData, headerData] = this.checkNeedDataToExport(bodyListData, headerListData, i);
|
|
1747
|
+
if (isNeedToPush) {
|
|
1748
|
+
bodyDataTemp.push(bodyData);
|
|
1749
|
+
headerDataTemp.push(headerData);
|
|
1750
|
+
}
|
|
1751
|
+
}
|
|
1752
|
+
for (let i = 0; i < bodyDataArr.length; i++) {
|
|
1753
|
+
let finalData = {};
|
|
1754
|
+
for (let j = 0; j < bodyDataTemp.length; j++) {
|
|
1755
|
+
const value = bodyDataArr[i][bodyDataTemp[j]];
|
|
1756
|
+
if (value !== null && value !== undefined) {
|
|
1757
|
+
if (typeof value === "boolean") {
|
|
1758
|
+
finalData[headerDataTemp[j]] = value ? "YES" : "NO";
|
|
1759
|
+
}
|
|
1760
|
+
else {
|
|
1761
|
+
finalData[headerDataTemp[j]] = value;
|
|
1762
|
+
}
|
|
1763
|
+
}
|
|
1764
|
+
}
|
|
1765
|
+
dataExcel.push(finalData);
|
|
1766
|
+
}
|
|
1767
|
+
return dataExcel;
|
|
1768
|
+
}
|
|
1769
|
+
checkAdditionalExportList(headerListData, bodyListData, additionalExportList) {
|
|
1770
|
+
if (additionalExportList == undefined)
|
|
1771
|
+
return [headerListData, bodyListData];
|
|
1772
|
+
if (additionalExportList.length == 0)
|
|
1773
|
+
return [headerListData, bodyListData];
|
|
1774
|
+
const _headerList = [...headerListData];
|
|
1775
|
+
const _bodyList = [...bodyListData];
|
|
1776
|
+
for (let i = 0; i < additionalExportList.length; i++) {
|
|
1777
|
+
_headerList.push({ label: additionalExportList[i].label });
|
|
1778
|
+
_bodyList.push({ property: additionalExportList[i].property });
|
|
1779
|
+
}
|
|
1780
|
+
return [_headerList, _bodyList];
|
|
1781
|
+
}
|
|
1782
|
+
checkExcludeExportList(headerListData, bodyListData, excludeExportList) {
|
|
1783
|
+
if (excludeExportList == undefined)
|
|
1784
|
+
return [headerListData, bodyListData];
|
|
1785
|
+
if (excludeExportList.length == 0)
|
|
1786
|
+
return [headerListData, bodyListData];
|
|
1787
|
+
const _headerList = [...headerListData];
|
|
1788
|
+
const _bodyList = [...bodyListData];
|
|
1789
|
+
for (let i = 0; i < excludeExportList.length; i++) {
|
|
1790
|
+
let index = _bodyList.findIndex((element) => element.property == excludeExportList[i].property);
|
|
1791
|
+
if (index != -1) {
|
|
1792
|
+
_headerList.splice(index, 1);
|
|
1793
|
+
_bodyList.splice(index, 1);
|
|
1794
|
+
}
|
|
1795
|
+
}
|
|
1796
|
+
return [_headerList, _bodyList];
|
|
1797
|
+
}
|
|
1798
|
+
checkNeedDataToExport(bodyListData, headerListData, idx) {
|
|
1799
|
+
// add json checker for data to export here
|
|
1800
|
+
if (bodyListData[idx]["type"] != "action") {
|
|
1801
|
+
return [
|
|
1802
|
+
true,
|
|
1803
|
+
bodyListData[idx]["property"],
|
|
1804
|
+
headerListData[idx]["label"],
|
|
1805
|
+
];
|
|
1806
|
+
}
|
|
1807
|
+
const actions = bodyListData[idx]["action"];
|
|
1808
|
+
if (bodyListData[idx]["type"] == "action" &&
|
|
1809
|
+
actions[0]["type"] == "switch" &&
|
|
1810
|
+
Boolean(actions[0]["case"][0]["result"]["property"])) {
|
|
1811
|
+
return [
|
|
1812
|
+
true,
|
|
1813
|
+
bodyListData[idx]["action"][0]["case"][0]["result"]["property"],
|
|
1814
|
+
headerListData[idx]["label"],
|
|
1815
|
+
];
|
|
1816
|
+
}
|
|
1817
|
+
return [false, [], []];
|
|
1818
|
+
}
|
|
1819
|
+
GenerateReport(enjiForm) {
|
|
1820
|
+
this.form.markAllAsTouched();
|
|
1821
|
+
if (!this.form.valid)
|
|
1822
|
+
return;
|
|
1823
|
+
const _exportType = this.form.get("ExportType").value;
|
|
1824
|
+
const _rptExecType = this.form.get("RptExecType").value;
|
|
1825
|
+
this.genRpt.emit({
|
|
1826
|
+
ExportType: _exportType,
|
|
1827
|
+
RptExecType: _rptExecType,
|
|
1828
|
+
ElRef: this.myForm,
|
|
1829
|
+
formRaw: this.form.getRawValue(),
|
|
1830
|
+
});
|
|
1831
|
+
}
|
|
1832
|
+
lessThanFour() {
|
|
1833
|
+
if (this.countForm > 3) {
|
|
1834
|
+
return false;
|
|
1835
|
+
}
|
|
1836
|
+
else {
|
|
1837
|
+
return true;
|
|
1838
|
+
}
|
|
1839
|
+
}
|
|
1840
|
+
resolveObject(obj, url, crit = null) {
|
|
1841
|
+
const val = this.postJSON(url, crit);
|
|
1842
|
+
val.subscribe((tempData) => {
|
|
1843
|
+
if (obj.customObjName == null ||
|
|
1844
|
+
obj.customObjName == undefined ||
|
|
1845
|
+
obj.customObjName == "") {
|
|
1846
|
+
obj.customObjName = "ReturnObject";
|
|
1847
|
+
}
|
|
1848
|
+
if (obj.customKeyName == null ||
|
|
1849
|
+
obj.customKeyName == undefined ||
|
|
1850
|
+
obj.customKeyName == "") {
|
|
1851
|
+
obj.customKeyName = "Key";
|
|
1852
|
+
}
|
|
1853
|
+
if (obj.customValueName == null ||
|
|
1854
|
+
obj.customValueName == undefined ||
|
|
1855
|
+
obj.customValueName == "") {
|
|
1856
|
+
obj.customValueName = "Value";
|
|
1857
|
+
}
|
|
1858
|
+
const _data = [];
|
|
1859
|
+
for (let i = 0; i < tempData[obj.customObjName].length; i++) {
|
|
1860
|
+
_data.push({
|
|
1861
|
+
Key: tempData[obj.customObjName][i][obj.customKeyName],
|
|
1862
|
+
Value: tempData[obj.customObjName][i][obj.customValueName],
|
|
1863
|
+
});
|
|
1864
|
+
}
|
|
1865
|
+
obj.itemsUrl = new Array();
|
|
1866
|
+
const userAccess = this.getUserAccess();
|
|
1867
|
+
if (obj.type == "officeRoleCodes" &&
|
|
1868
|
+
obj.isLockHo &&
|
|
1869
|
+
userAccess["MrOfficeTypeCode"] == "HO") {
|
|
1870
|
+
let keyValueObj = {
|
|
1871
|
+
Key: userAccess["OfficeCode"],
|
|
1872
|
+
Value: userAccess["OfficeName"],
|
|
1873
|
+
};
|
|
1874
|
+
obj.itemsUrl.push(keyValueObj);
|
|
1875
|
+
}
|
|
1876
|
+
else {
|
|
1877
|
+
obj.itemsUrl = _data;
|
|
1878
|
+
}
|
|
1879
|
+
if (obj.exclude != undefined && obj.exclude != "") {
|
|
1880
|
+
obj.itemsUrl = obj.itemsUrl.filter((value) => !obj.exclude.includes(value.Key));
|
|
1881
|
+
}
|
|
1882
|
+
if (obj.itemsUrl.length == 1) {
|
|
1883
|
+
obj.value = obj.itemsUrl[0].Key;
|
|
1884
|
+
}
|
|
1885
|
+
if (obj.type == "dropdownSearch" && obj.itemsUrl.length == 1) {
|
|
1886
|
+
obj.value = obj.itemsUrl[0].Key;
|
|
1887
|
+
obj.descr = obj.itemsUrl[0].Value;
|
|
1888
|
+
}
|
|
1889
|
+
if (obj.affectedFilter && obj.itemsUrl.length == 1) {
|
|
1890
|
+
this.onChangeEvent(obj.itemsUrl[0].Key, obj);
|
|
1891
|
+
}
|
|
1892
|
+
this.updateKeyValDict({
|
|
1893
|
+
key: obj.name,
|
|
1894
|
+
value: obj.value,
|
|
1895
|
+
});
|
|
1896
|
+
if (obj.useFirstValue && obj.itemsUrl.length > 1) {
|
|
1897
|
+
this.form.controls[obj.name].setValue(obj.itemsUrl[0].Key);
|
|
1898
|
+
}
|
|
1899
|
+
});
|
|
1900
|
+
}
|
|
1901
|
+
transformToDecimal(element) {
|
|
1902
|
+
element.target.value = parseFloat(element.target.value.toString().replace(/,/g, ""));
|
|
1903
|
+
}
|
|
1904
|
+
exportAsFile(extFile) {
|
|
1905
|
+
this.searchClick(true, extFile);
|
|
1906
|
+
}
|
|
1907
|
+
onChangeEvent(optValue, afFilter) {
|
|
1908
|
+
let jsonComp = this.configuration.component;
|
|
1909
|
+
this.updateKeyValDict({ key: afFilter.name, value: afFilter.value });
|
|
1910
|
+
for (let i = 0; i < afFilter.affectedFilter.length; i++) {
|
|
1911
|
+
for (let j = 0; j < jsonComp.length; j++) {
|
|
1912
|
+
if (jsonComp[j].name == afFilter.affectedFilter[i]) {
|
|
1913
|
+
let request = new RequestCriteriaObj();
|
|
1914
|
+
let arrayCrit = new Array();
|
|
1915
|
+
if (optValue != "all" && optValue != "one") {
|
|
1916
|
+
const _critPropNameArr = jsonComp[j].criteriaPropName.split(";");
|
|
1917
|
+
if (_critPropNameArr.length > 1) {
|
|
1918
|
+
const _critPropValueArr = jsonComp[j].criteriaPropValue.split(";");
|
|
1919
|
+
for (let [index, item] of _critPropNameArr.entries()) {
|
|
1920
|
+
const critObj = new CriteriaObj();
|
|
1921
|
+
critObj.DataType = afFilter.datatype;
|
|
1922
|
+
if (item === afFilter.filterPropName) {
|
|
1923
|
+
request[item] = optValue;
|
|
1924
|
+
critObj.value = optValue;
|
|
1925
|
+
this.valueDict[item] = optValue;
|
|
1926
|
+
}
|
|
1927
|
+
else if (item.includes("dicts.")) {
|
|
1928
|
+
this.getObjData("dicts", item, afFilter, request, optValue, critObj, _critPropValueArr, index);
|
|
1929
|
+
}
|
|
1930
|
+
else if (item.includes("lookup.")) {
|
|
1931
|
+
this.getObjData("lookup", item, afFilter, request, optValue, critObj, _critPropValueArr, index);
|
|
1932
|
+
}
|
|
1933
|
+
else if (this.valueDict[item]) {
|
|
1934
|
+
request[item] = this.valueDict[item];
|
|
1935
|
+
critObj.value = this.valueDict[item];
|
|
1936
|
+
}
|
|
1937
|
+
else {
|
|
1938
|
+
request[item] = _critPropValueArr[index];
|
|
1939
|
+
critObj.value = _critPropValueArr[index];
|
|
1940
|
+
}
|
|
1941
|
+
critObj.propName = item;
|
|
1942
|
+
critObj.restriction = AdInsConstant.RestrictionEq;
|
|
1943
|
+
arrayCrit.push(critObj);
|
|
1944
|
+
}
|
|
1945
|
+
}
|
|
1946
|
+
else {
|
|
1947
|
+
const critObj = new CriteriaObj();
|
|
1948
|
+
critObj.DataType = afFilter.datatype;
|
|
1949
|
+
if (afFilter.filterPropName != undefined ||
|
|
1950
|
+
afFilter.filterPropName != "") {
|
|
1951
|
+
request[afFilter.filterPropName] = optValue;
|
|
1952
|
+
critObj.propName = afFilter.filterPropName;
|
|
1953
|
+
this.valueDict[afFilter.filterPropName] = optValue;
|
|
1954
|
+
}
|
|
1955
|
+
else {
|
|
1956
|
+
critObj.propName = afFilter.name;
|
|
1957
|
+
request[afFilter.name] = optValue;
|
|
1958
|
+
}
|
|
1959
|
+
critObj.value = optValue;
|
|
1960
|
+
critObj.restriction = AdInsConstant.RestrictionEq;
|
|
1961
|
+
arrayCrit.push(critObj);
|
|
1962
|
+
}
|
|
1963
|
+
}
|
|
1964
|
+
if (optValue == "all" || optValue == "others") {
|
|
1965
|
+
let critObj = new CriteriaObj();
|
|
1966
|
+
arrayCrit.push(critObj);
|
|
1967
|
+
jsonComp[j].value = optValue;
|
|
1968
|
+
}
|
|
1969
|
+
request.criteria = arrayCrit;
|
|
1970
|
+
if (jsonComp[j].path != undefined && jsonComp[j].path != "") {
|
|
1971
|
+
if (this.searchInput.listEnvironments != undefined &&
|
|
1972
|
+
this.searchInput.listEnvironments.length != 0) {
|
|
1973
|
+
for (let y = 0; y < this.searchInput.listEnvironments.length; y++) {
|
|
1974
|
+
if (jsonComp[j].environment ==
|
|
1975
|
+
this.searchInput.listEnvironments[y].environment) {
|
|
1976
|
+
jsonComp[j].fullpath =
|
|
1977
|
+
this.searchInput.listEnvironments[y].url + jsonComp[j].path;
|
|
1978
|
+
break;
|
|
1979
|
+
}
|
|
1980
|
+
}
|
|
1981
|
+
}
|
|
1982
|
+
else {
|
|
1983
|
+
jsonComp[j].fullpath = jsonComp[j].url;
|
|
1984
|
+
}
|
|
1985
|
+
}
|
|
1986
|
+
else {
|
|
1987
|
+
jsonComp[j].fullpath = jsonComp[j].url;
|
|
1988
|
+
}
|
|
1989
|
+
this.resolveObject(jsonComp[j], jsonComp[j].fullpath, request);
|
|
1990
|
+
}
|
|
1991
|
+
}
|
|
1992
|
+
}
|
|
1993
|
+
}
|
|
1994
|
+
getObjData(type, item, afFilter, request, optValue, critObj, _critPropValueArr, index) {
|
|
1995
|
+
let _objDicts = this.valueDict;
|
|
1996
|
+
if (type === "lookup") {
|
|
1997
|
+
_objDicts = this.lookupDict;
|
|
1998
|
+
}
|
|
1999
|
+
const _item = item.split(".");
|
|
2000
|
+
if (_item[1] === afFilter.filterPropName) {
|
|
2001
|
+
request[_item[1]] = optValue;
|
|
2002
|
+
critObj.value = optValue;
|
|
2003
|
+
_objDicts[_item[1]] = optValue;
|
|
2004
|
+
}
|
|
2005
|
+
else if (_objDicts[_item[1]]) {
|
|
2006
|
+
request[_item[1]] = _objDicts[_item[1]];
|
|
2007
|
+
critObj.value = _objDicts[_item[1]];
|
|
2008
|
+
}
|
|
2009
|
+
else {
|
|
2010
|
+
request[_item[1]] = _critPropValueArr[index];
|
|
2011
|
+
critObj.value = _critPropValueArr[index];
|
|
2012
|
+
}
|
|
2013
|
+
}
|
|
2014
|
+
SetProcessKey(idx, wfKeyFilter) {
|
|
2015
|
+
let component = this.myForm.nativeElement[idx];
|
|
2016
|
+
let ddl = component.options;
|
|
2017
|
+
let text = ddl[ddl.selectedIndex].value.trim();
|
|
2018
|
+
let listValue = text.split(";");
|
|
2019
|
+
let listWfKey = wfKeyFilter.split(";");
|
|
2020
|
+
for (let i = 0; i < listValue.length; i++) {
|
|
2021
|
+
this.searchInput.integrationObj.requestObj[listWfKey[i]] = listValue[i];
|
|
2022
|
+
}
|
|
2023
|
+
}
|
|
2024
|
+
switchCase(condList) {
|
|
2025
|
+
let condition = false;
|
|
2026
|
+
for (let i = 0; i < condList.conditions.length; i++) {
|
|
2027
|
+
let idx = this.searchInput.switchValue.findIndex((x) => x.property == condList.conditions[i].property);
|
|
2028
|
+
if (condList.conditions[i].restriction == "EQ") {
|
|
2029
|
+
if (!condList.conditions[i].isUser) {
|
|
2030
|
+
if (this.searchInput.switchValue[idx].value ==
|
|
2031
|
+
condList.conditions[i].value) {
|
|
2032
|
+
condition = true;
|
|
2033
|
+
}
|
|
2034
|
+
else {
|
|
2035
|
+
condition = false;
|
|
2036
|
+
break;
|
|
2037
|
+
}
|
|
2038
|
+
}
|
|
2039
|
+
else {
|
|
2040
|
+
let username = localStorage.getItem("Username");
|
|
2041
|
+
if (this.searchInput.switchValue[idx].value == username) {
|
|
2042
|
+
condition = true;
|
|
2043
|
+
}
|
|
2044
|
+
else {
|
|
2045
|
+
condition = false;
|
|
2046
|
+
break;
|
|
2047
|
+
}
|
|
2048
|
+
}
|
|
2049
|
+
}
|
|
2050
|
+
else if (condList.conditions[i].restriction == "NEQ") {
|
|
2051
|
+
if (condList.conditions[i].isUser != true) {
|
|
2052
|
+
if (this.searchInput.switchValue[idx].value !=
|
|
2053
|
+
condList.conditions[i].value) {
|
|
2054
|
+
condition = true;
|
|
2055
|
+
}
|
|
2056
|
+
else {
|
|
2057
|
+
condition = false;
|
|
2058
|
+
break;
|
|
2059
|
+
}
|
|
2060
|
+
}
|
|
2061
|
+
else {
|
|
2062
|
+
let username = localStorage.getItem("Username");
|
|
2063
|
+
if (this.searchInput.switchValue[idx].value != username) {
|
|
2064
|
+
condition = true;
|
|
2065
|
+
}
|
|
2066
|
+
else {
|
|
2067
|
+
condition = false;
|
|
2068
|
+
break;
|
|
2069
|
+
}
|
|
2070
|
+
}
|
|
2071
|
+
}
|
|
2072
|
+
else if (condList.conditions[i].restriction == "GT") {
|
|
2073
|
+
if (!condList.conditions[i].isUser) {
|
|
2074
|
+
if (this.searchInput.switchValue[idx].value >
|
|
2075
|
+
condList.conditions[i].value) {
|
|
2076
|
+
condition = true;
|
|
2077
|
+
}
|
|
2078
|
+
else {
|
|
2079
|
+
condition = false;
|
|
2080
|
+
break;
|
|
2081
|
+
}
|
|
2082
|
+
}
|
|
2083
|
+
else {
|
|
2084
|
+
let username = localStorage.getItem("Username");
|
|
2085
|
+
if (this.searchInput.switchValue[idx].value > username) {
|
|
2086
|
+
condition = true;
|
|
2087
|
+
}
|
|
2088
|
+
else {
|
|
2089
|
+
condition = false;
|
|
2090
|
+
break;
|
|
2091
|
+
}
|
|
2092
|
+
}
|
|
2093
|
+
}
|
|
2094
|
+
else if (condList.conditions[i].restriction == "GTE") {
|
|
2095
|
+
if (!condList.conditions[i].isUser) {
|
|
2096
|
+
if (this.searchInput.switchValue[idx].value >=
|
|
2097
|
+
condList.conditions[i].value) {
|
|
2098
|
+
condition = true;
|
|
2099
|
+
}
|
|
2100
|
+
else {
|
|
2101
|
+
condition = false;
|
|
2102
|
+
break;
|
|
2103
|
+
}
|
|
2104
|
+
}
|
|
2105
|
+
else {
|
|
2106
|
+
let username = localStorage.getItem("Username");
|
|
2107
|
+
if (this.searchInput.switchValue[idx].value >= username) {
|
|
2108
|
+
condition = true;
|
|
2109
|
+
}
|
|
2110
|
+
else {
|
|
2111
|
+
condition = false;
|
|
2112
|
+
break;
|
|
2113
|
+
}
|
|
2114
|
+
}
|
|
2115
|
+
}
|
|
2116
|
+
else if (condList.conditions[i].restriction == "LT") {
|
|
2117
|
+
if (!condList.conditions[i].isUser) {
|
|
2118
|
+
if (this.searchInput.switchValue[idx].value <
|
|
2119
|
+
condList.conditions[i].value) {
|
|
2120
|
+
condition = true;
|
|
2121
|
+
}
|
|
2122
|
+
else {
|
|
2123
|
+
condition = false;
|
|
2124
|
+
break;
|
|
2125
|
+
}
|
|
2126
|
+
}
|
|
2127
|
+
else {
|
|
2128
|
+
let username = localStorage.getItem("Username");
|
|
2129
|
+
if (this.searchInput.switchValue[idx].value < username) {
|
|
2130
|
+
condition = true;
|
|
2131
|
+
}
|
|
2132
|
+
else {
|
|
2133
|
+
condition = false;
|
|
2134
|
+
break;
|
|
2135
|
+
}
|
|
2136
|
+
}
|
|
2137
|
+
}
|
|
2138
|
+
else if (condList.conditions[i].restriction == "LTE") {
|
|
2139
|
+
if (!condList.conditions[i].isUser) {
|
|
2140
|
+
if (this.searchInput.switchValue[idx].value <=
|
|
2141
|
+
condList.conditions[i].value) {
|
|
2142
|
+
condition = true;
|
|
2143
|
+
}
|
|
2144
|
+
else {
|
|
2145
|
+
condition = false;
|
|
2146
|
+
break;
|
|
2147
|
+
}
|
|
2148
|
+
}
|
|
2149
|
+
else {
|
|
2150
|
+
let username = localStorage.getItem("Username");
|
|
2151
|
+
if (this.searchInput.switchValue[idx].value <= username) {
|
|
2152
|
+
condition = true;
|
|
2153
|
+
}
|
|
2154
|
+
else {
|
|
2155
|
+
condition = false;
|
|
2156
|
+
break;
|
|
2157
|
+
}
|
|
2158
|
+
}
|
|
2159
|
+
}
|
|
2160
|
+
}
|
|
2161
|
+
return condition;
|
|
2162
|
+
}
|
|
2163
|
+
DecryptString(chipperText, chipperKey) {
|
|
2164
|
+
if (chipperKey == undefined ||
|
|
2165
|
+
chipperKey.trim() == "" ||
|
|
2166
|
+
chipperText == undefined ||
|
|
2167
|
+
chipperText.trim() == "")
|
|
2168
|
+
return chipperText;
|
|
2169
|
+
let chipperKeyArr = CryptoJS.enc.Utf8.parse(chipperKey);
|
|
2170
|
+
let iv = CryptoJS.lib.WordArray.create([0x00, 0x00, 0x00, 0x00]);
|
|
2171
|
+
let decrypted = CryptoJS.AES.decrypt(chipperText, chipperKeyArr, {
|
|
2172
|
+
iv: iv,
|
|
2173
|
+
});
|
|
2174
|
+
let plainText = decrypted.toString(CryptoJS.enc.Utf8);
|
|
2175
|
+
return plainText;
|
|
2176
|
+
}
|
|
2177
|
+
checkInputDate(component, index) {
|
|
2178
|
+
let dateWrong = false;
|
|
2179
|
+
const _componentValue = this.form.controls[component.name + index].value;
|
|
2180
|
+
dateWrong = this.checkMinMaxValidation(component);
|
|
2181
|
+
let udpatedValue = null;
|
|
2182
|
+
if (this.isValidDate(_componentValue)) {
|
|
2183
|
+
udpatedValue = formatDate(new Date(_componentValue), "yyyy-MM-dd", "en-US");
|
|
2184
|
+
}
|
|
2185
|
+
this.updateKeyValDict({
|
|
2186
|
+
key: component.name,
|
|
2187
|
+
value: udpatedValue,
|
|
2188
|
+
});
|
|
2189
|
+
if (!dateWrong) {
|
|
2190
|
+
this.updateMinMaxDateValue({
|
|
2191
|
+
value: _componentValue,
|
|
2192
|
+
datepickerPair: component.datepickerPair,
|
|
2193
|
+
restriction: component.restriction,
|
|
2194
|
+
});
|
|
2195
|
+
}
|
|
2196
|
+
}
|
|
2197
|
+
checkMinMaxValidation(component) {
|
|
2198
|
+
let minDateVal;
|
|
2199
|
+
let maxDateVal;
|
|
2200
|
+
let label;
|
|
2201
|
+
let errorMessage = new Array();
|
|
2202
|
+
let dateWrong = false;
|
|
2203
|
+
const nativeEl = this.myForm.nativeElement.elements;
|
|
2204
|
+
const _comp = this.configuration.component;
|
|
2205
|
+
let minComponentIdx = _comp.findIndex((x) => x.name == component.name && x.restriction.toUpperCase() == "GTE") === -1
|
|
2206
|
+
? _comp.findIndex((x) => x.name == component.name && x.restriction.toUpperCase() == "GT")
|
|
2207
|
+
: _comp.findIndex((x) => x.name == component.name && x.restriction.toUpperCase() == "GTE");
|
|
2208
|
+
if (minComponentIdx !== -1) {
|
|
2209
|
+
const _minComponentName = _comp[minComponentIdx].name + minComponentIdx;
|
|
2210
|
+
minDateVal = this.isValidDate(nativeEl[_minComponentName].min)
|
|
2211
|
+
? new Date(nativeEl[_minComponentName].min)
|
|
2212
|
+
: null;
|
|
2213
|
+
label = _comp[minComponentIdx].label.split(">", 2);
|
|
2214
|
+
if (minDateVal != null) {
|
|
2215
|
+
if (_comp[minComponentIdx].restriction.toUpperCase() == "GT") {
|
|
2216
|
+
minDateVal.setDate(minDateVal.getDate() - 1);
|
|
2217
|
+
errorMessage.push(" must be greater than ");
|
|
2218
|
+
}
|
|
2219
|
+
else if (_comp[minComponentIdx].restriction.toUpperCase() == "GTE") {
|
|
2220
|
+
errorMessage.push(" must be greater than or equals to ");
|
|
2221
|
+
}
|
|
2222
|
+
}
|
|
2223
|
+
}
|
|
2224
|
+
let maxComponentIdx = _comp.findIndex((x) => x.name == component.name && x.restriction.toUpperCase() == "LTE") === -1
|
|
2225
|
+
? _comp.findIndex((x) => x.name == component.name && x.restriction.toUpperCase() == "LT")
|
|
2226
|
+
: _comp.findIndex((x) => x.name == component.name && x.restriction.toUpperCase() == "LTE");
|
|
2227
|
+
if (maxComponentIdx !== -1) {
|
|
2228
|
+
const _maxComponentName = _comp[maxComponentIdx].name + maxComponentIdx;
|
|
2229
|
+
maxDateVal = this.isValidDate(nativeEl[_maxComponentName].max)
|
|
2230
|
+
? new Date(nativeEl[_maxComponentName].max)
|
|
2231
|
+
: null;
|
|
2232
|
+
label = _comp[maxComponentIdx].label.split("<", 2);
|
|
2233
|
+
if (maxDateVal != null) {
|
|
2234
|
+
if (_comp[maxComponentIdx].restriction.toUpperCase() == "LT") {
|
|
2235
|
+
maxDateVal.setDate(maxDateVal.getDate() + 1);
|
|
2236
|
+
errorMessage.push(" must be less than ");
|
|
2237
|
+
}
|
|
2238
|
+
else if (_comp[maxComponentIdx].restriction.toUpperCase() == "LTE") {
|
|
2239
|
+
errorMessage.push(" must be less than or equals to ");
|
|
2240
|
+
}
|
|
2241
|
+
}
|
|
2242
|
+
}
|
|
2243
|
+
if (minDateVal != null &&
|
|
2244
|
+
maxDateVal == null &&
|
|
2245
|
+
new Date(this.form.controls[_comp[minComponentIdx].name + minComponentIdx].value) < minDateVal) {
|
|
2246
|
+
this.toastr.warning(label[0] +
|
|
2247
|
+
errorMessage[0] +
|
|
2248
|
+
formatDate(minDateVal, "dd MMMM yyyy", "en-US") +
|
|
2249
|
+
".");
|
|
2250
|
+
dateWrong = true;
|
|
2251
|
+
}
|
|
2252
|
+
else if (maxDateVal != null &&
|
|
2253
|
+
minDateVal == null &&
|
|
2254
|
+
new Date(this.form.controls[_comp[maxComponentIdx].name + maxComponentIdx].value) > maxDateVal) {
|
|
2255
|
+
this.toastr.warning(label[0] +
|
|
2256
|
+
errorMessage[0] +
|
|
2257
|
+
formatDate(maxDateVal, "dd MMMM yyyy", "en-US") +
|
|
2258
|
+
".");
|
|
2259
|
+
dateWrong = true;
|
|
2260
|
+
}
|
|
2261
|
+
else if (minDateVal != null && maxDateVal != null) {
|
|
2262
|
+
if (new Date(this.form.controls[_comp[maxComponentIdx].name + maxComponentIdx].value) > maxDateVal ||
|
|
2263
|
+
new Date(this.form.controls[_comp[minComponentIdx].name + minComponentIdx].value) < minDateVal) {
|
|
2264
|
+
this.toastr.warning(label[0] +
|
|
2265
|
+
errorMessage[0] +
|
|
2266
|
+
formatDate(minDateVal, "dd MMMM yyyy", "en-US") +
|
|
2267
|
+
" and" +
|
|
2268
|
+
errorMessage[1] +
|
|
2269
|
+
formatDate(maxDateVal, "dd MMMM yyyy", "en-US") +
|
|
2270
|
+
".");
|
|
2271
|
+
dateWrong = true;
|
|
2272
|
+
}
|
|
2273
|
+
else {
|
|
2274
|
+
dateWrong = false;
|
|
2275
|
+
}
|
|
2276
|
+
}
|
|
2277
|
+
else {
|
|
2278
|
+
dateWrong = false;
|
|
2279
|
+
}
|
|
2280
|
+
return dateWrong;
|
|
2281
|
+
}
|
|
2282
|
+
updateMinMaxDateValue(opts) {
|
|
2283
|
+
const { value, datepickerPair, restriction } = opts;
|
|
2284
|
+
const _minComps = [];
|
|
2285
|
+
const _maxComps = [];
|
|
2286
|
+
for (const [index, item] of this.configuration.component.entries()) {
|
|
2287
|
+
if (item.confMinDate === datepickerPair) {
|
|
2288
|
+
_minComps.push({
|
|
2289
|
+
comp: item,
|
|
2290
|
+
index,
|
|
2291
|
+
});
|
|
2292
|
+
}
|
|
2293
|
+
if (item.confMaxDate === datepickerPair) {
|
|
2294
|
+
_maxComps.push({
|
|
2295
|
+
comp: item,
|
|
2296
|
+
index,
|
|
2297
|
+
});
|
|
2298
|
+
}
|
|
2299
|
+
}
|
|
2300
|
+
if (!datepickerPair)
|
|
2301
|
+
return;
|
|
2302
|
+
for (const minComponent of _minComps) {
|
|
2303
|
+
const _value = value;
|
|
2304
|
+
const _restriction = minComponent.comp.datepickerPair === datepickerPair ? restriction : "";
|
|
2305
|
+
if (_value !== null && _value !== undefined) {
|
|
2306
|
+
this.updateComponentDate(minComponent, "confMaxDate", _value, "maxDate", datepickerPair);
|
|
2307
|
+
if (_restriction.toLowerCase() !== "gte" &&
|
|
2308
|
+
_restriction.toLowerCase() !== "gt") {
|
|
2309
|
+
this.updateComponentDate(minComponent, "confMinDate", _value, "minDate", datepickerPair);
|
|
2310
|
+
}
|
|
2311
|
+
}
|
|
2312
|
+
}
|
|
2313
|
+
for (const maxComponent of _maxComps) {
|
|
2314
|
+
const _value = value;
|
|
2315
|
+
const _restriction = maxComponent.comp.datepickerPair === datepickerPair ? restriction : "";
|
|
2316
|
+
if (_value !== null && _value !== undefined) {
|
|
2317
|
+
this.updateComponentDate(maxComponent, "confMinDate", _value, "minDate", datepickerPair);
|
|
2318
|
+
if (_restriction.toLowerCase() !== "lte" &&
|
|
2319
|
+
_restriction.toLowerCase() !== "lt") {
|
|
2320
|
+
this.updateComponentDate(maxComponent, "confMaxDate", _value, "maxDate", datepickerPair);
|
|
2321
|
+
}
|
|
2322
|
+
}
|
|
2323
|
+
}
|
|
2324
|
+
}
|
|
2325
|
+
// Helper function to update the min/max date and component value
|
|
2326
|
+
updateComponentDate(compObj, confDateKey, value, flagKey, datepickerPair) {
|
|
2327
|
+
const { comp: component, index } = compObj;
|
|
2328
|
+
if (component[confDateKey] === datepickerPair) {
|
|
2329
|
+
if (value === "") {
|
|
2330
|
+
component[flagKey] = "";
|
|
2331
|
+
}
|
|
2332
|
+
else {
|
|
2333
|
+
const _componentValue = this.form.controls[component.name + index].value;
|
|
2334
|
+
const _flag = this.datetimeService.CheckDateType(component[`addition${flagKey[0].toUpperCase()}${flagKey.slice(1)}Conf`] ?? "bd");
|
|
2335
|
+
component[flagKey] = this.datetimeService.GetNewDate(_flag, component[`addition${flagKey[0].toUpperCase()}${flagKey.slice(1)}Conf`], value);
|
|
2336
|
+
if ((flagKey === "minDate" && _componentValue < component.minDate) ||
|
|
2337
|
+
(flagKey === "maxDate" && _componentValue > component.maxDate)) {
|
|
2338
|
+
this.form.controls[component.name].setValue("");
|
|
2339
|
+
}
|
|
2340
|
+
}
|
|
2341
|
+
}
|
|
2342
|
+
}
|
|
2343
|
+
selectedOption(item, crit) {
|
|
2344
|
+
crit.descr = item.Value;
|
|
2345
|
+
crit.isListHide = true;
|
|
2346
|
+
}
|
|
2347
|
+
OnFocusCurr(ev, value) {
|
|
2348
|
+
if (value !== "" && value !== 0 && value !== "0")
|
|
2349
|
+
return;
|
|
2350
|
+
ev.target.value = "";
|
|
2351
|
+
}
|
|
2352
|
+
ValidateDefaultValue(item) {
|
|
2353
|
+
const itemValue = item.value;
|
|
2354
|
+
if (itemValue !== "" && itemValue !== 0 && itemValue !== "0")
|
|
2355
|
+
return;
|
|
2356
|
+
const _el = document.querySelector(`input[ng-reflect-name="${item.name}"]`);
|
|
2357
|
+
if (_el === null)
|
|
2358
|
+
return;
|
|
2359
|
+
let val = this.generateCurrFocElValue(item);
|
|
2360
|
+
_el["value"] = val;
|
|
2361
|
+
}
|
|
2362
|
+
getLookup(event, component) {
|
|
2363
|
+
const _eventObj = {
|
|
2364
|
+
lookup: { ...event },
|
|
2365
|
+
};
|
|
2366
|
+
this.lookupDict = { ...event };
|
|
2367
|
+
const _lookupObj = this.searchInput.dictLookupObj[component.name];
|
|
2368
|
+
this.form.controls["lookup_id_" + component.name].setValue(_lookupObj.idSelect);
|
|
2369
|
+
if (!_lookupObj.isEvent)
|
|
2370
|
+
return;
|
|
2371
|
+
const affectedCriteria = _lookupObj.affectedCriteria;
|
|
2372
|
+
for (let item of affectedCriteria) {
|
|
2373
|
+
const _updateLookupObj = this.searchInput.dictLookupObj[item.key];
|
|
2374
|
+
_updateLookupObj.isReady = false;
|
|
2375
|
+
let _value = _lookupObj.idSelect;
|
|
2376
|
+
if (item.value != null && item.value != "") {
|
|
2377
|
+
if (item.value.includes("lookup.")) {
|
|
2378
|
+
const _tempValue = item.value.split(".")[1];
|
|
2379
|
+
_value = _eventObj.lookup[_tempValue] ?? _value;
|
|
2380
|
+
}
|
|
2381
|
+
}
|
|
2382
|
+
if (!_updateLookupObj.originalAddCrit) {
|
|
2383
|
+
_updateLookupObj.originalAddCrit = [..._updateLookupObj.addCritInput];
|
|
2384
|
+
}
|
|
2385
|
+
_updateLookupObj.addedAddCrit = [];
|
|
2386
|
+
const _addedCrit = {
|
|
2387
|
+
propName: item.propName,
|
|
2388
|
+
restriction: item.restriction,
|
|
2389
|
+
value: _value,
|
|
2390
|
+
DataType: "text",
|
|
2391
|
+
high: 0,
|
|
2392
|
+
isCriteriaDataTable: false,
|
|
2393
|
+
low: 0,
|
|
2394
|
+
};
|
|
2395
|
+
_updateLookupObj.addedAddCrit.push(_addedCrit);
|
|
2396
|
+
_updateLookupObj.addCritInput = [
|
|
2397
|
+
..._updateLookupObj.originalAddCrit,
|
|
2398
|
+
..._updateLookupObj.addedAddCrit,
|
|
2399
|
+
];
|
|
2400
|
+
this.searchInput.dictLookupObj[item.key] = JSON.parse(JSON.stringify(_updateLookupObj));
|
|
2401
|
+
setTimeout(() => (this.searchInput.dictLookupObj[item.key].isReady = true), 10);
|
|
2402
|
+
}
|
|
2403
|
+
const affectedFilter = _lookupObj?.affectedFilter ?? [];
|
|
2404
|
+
if (affectedFilter.length > 0) {
|
|
2405
|
+
let _value = _lookupObj.idSelect;
|
|
2406
|
+
if (_lookupObj.filterPropValue != null &&
|
|
2407
|
+
_lookupObj.filterPropValue != "") {
|
|
2408
|
+
if (_lookupObj.filterPropValue.includes("lookup.")) {
|
|
2409
|
+
const _tempValue = _lookupObj.filterPropValue.split(".")[1];
|
|
2410
|
+
_value = _eventObj.lookup[_tempValue] ?? _value;
|
|
2411
|
+
}
|
|
2412
|
+
}
|
|
2413
|
+
this.onChangeEvent(_value, _lookupObj);
|
|
2414
|
+
}
|
|
2415
|
+
}
|
|
2416
|
+
getInputtedValue(ev, component) {
|
|
2417
|
+
this.form.controls["lookup_id_" + component.name].setValue(ev);
|
|
2418
|
+
}
|
|
2419
|
+
isCollapsed = false;
|
|
2420
|
+
onCollapse(ev) {
|
|
2421
|
+
console.log("collapse", ev);
|
|
2422
|
+
this.isCollapsed = !!ev?.isCollapsed;
|
|
2423
|
+
}
|
|
2424
|
+
updateKeyValDict(ev) {
|
|
2425
|
+
this.lookupKeyValDict[ev.key] = ev.value;
|
|
2426
|
+
this.notifyUpdateKeyValDict.emit(this.lookupKeyValDict);
|
|
2427
|
+
this.ucSearchFormService.setForm(this.form);
|
|
2428
|
+
}
|
|
2429
|
+
generateCurrFocElValue(item) {
|
|
2430
|
+
let val = "0";
|
|
2431
|
+
const precision = item?.precision || 2;
|
|
2432
|
+
for (let i = 0; i < precision; i++) {
|
|
2433
|
+
if (i === 0)
|
|
2434
|
+
val += ".";
|
|
2435
|
+
val += "0";
|
|
2436
|
+
}
|
|
2437
|
+
return val;
|
|
2438
|
+
}
|
|
2439
|
+
setValidatorNumber(typeValidator, value, control) {
|
|
2440
|
+
if (value === undefined || value === "" || value === null)
|
|
2441
|
+
return;
|
|
2442
|
+
if (typeValidator === "MIN")
|
|
2443
|
+
control.addValidators(Validators.min(value));
|
|
2444
|
+
else if (typeValidator === "MAX")
|
|
2445
|
+
control.addValidators(Validators.max(value));
|
|
2446
|
+
}
|
|
2447
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", 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 }, { token: i7.NgxRouterService }, { token: i8.FormBuilder }, { token: UcsearchDatetimeService }, { token: UcsearchFormService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2448
|
+
/** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: UCSearchComponent, isStandalone: false, selector: "lib-UCSearch", inputs: { searchInput: "searchInput", pageSize: "pageSize", isReport: "isReport", showRptExecType: "showRptExecType" }, 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: "<span hidden attr.version=\"3.8.18-canary.0\"></span>\r\n<div>\r\n <!-- Basic form layout section start -->\r\n <lib-ucSubsection [hidden]=\"!searchInput.IsSubsection\" [id]=\"searchInput.searchId+'id'\"\r\n [title]=\"configuration?.sectionTitle || 'Paging'\" [panel]=\"searchInput.searchId\" [legacy]=\"false\"\r\n (collapse)=\"onCollapse($event)\">\r\n </lib-ucSubsection>\r\n\r\n <!-- <div [id]=\"searchInput.searchId\"> -->\r\n <!-- <div class=\"row text-left\">\r\n <div class=\"col-md-12\">\r\n <div class=\"\"> -->\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\" [id]=\"searchInput.searchId\" [(ngbCollapse)]=\"isCollapsed\">\r\n <div class=\"px-3\">\r\n <form class=\"form form-horizontal\" id=\"formSearch\" #formIdSearch [formGroup]=\"form\" #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-3 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-12 no-padding search-label\" 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-12 no-padding\">\r\n <div *ngIf=\"question.type=='textbox'\">\r\n <input type=\"text\" id=\"{{question.id}}\" class=\"form-control search-input\"\r\n [IsUpperCase]=\"question.isUppercase === undefined ? true : question.isUppercase\"\r\n [required]=\"question.isRequired\" name=\"{{question.name}}\" [formControlName]=\"question.name\"\r\n attr.data-crit-datatable=\"{{question.isCriteriaDataTable}}\"\r\n [placeholder]=\"question.placeholder != undefined ? question.placeholder : ''\"\r\n attr.data-required=\"{{question.isRequired}}\" value=\"{{question.value}}\"\r\n attr.data-type=\"{{question.datatype}}\" attr.data-name=\"{{question.name}}\"\r\n attr.data-restriction=\"{{question.restriction}}\" attr.label=\"{{question.label}}\"\r\n [readonly]=\"question.isReadonly\"\r\n (focusout)=\"updateKeyValDict({key: question.name, value: question.value})\"\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-input\"\r\n [required]=\"question.isRequired\" name=\"{{question.name}}\" [formControlName]=\"question.name\"\r\n attr.data-required=\"{{question.isRequired}}\" attr.data-type=\"{{question.datatype}}\"\r\n attr.data-name=\"{{question.name}}\" value=\"{{question.value}}\" attr.label=\"{{question.label}}\"\r\n [readonly]=\"question.isReadonly\"\r\n (focusout)=\"updateKeyValDict({key: question.name, value: question.value})\"\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-input\" [placeholder]=\"'0'\"\r\n [required]=\"question.isRequired\" name=\"{{question.name+[i]}}\"\r\n [formControlName]=\"question.name+[i]\" attr.data-required=\"{{question.isRequired}}\"\r\n value=\"{{question.value}}\" 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}}\" attr.label=\"{{question.label}}\"\r\n (focusout)=\"updateKeyValDict({key: question.name, value: question.value})\"\r\n [readonly]=\"question.isReadonly\"\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-input\"\r\n [required]=\"question.isRequired\" name=\"{{question.name+[i]}}\" autocomplete=\"off\"\r\n attr.data-restriction=\"{{question.restriction}}\" attr.data-type=\"{{question.datatype}}\"\r\n attr.data-name=\"{{question.name}}\" attr.data-required=\"{{question.isRequired}}\" currencyMask\r\n [formControlName]=\"question.name+[i]\" attr.label=\"{{question.label}}\"\r\n [readonly]=\"question.isReadonly\" (focus)=\"OnFocusCurr($event, question.value)\"\r\n (blur)=\"ValidateDefaultValue(question)\"\r\n (focusout)=\"updateKeyValDict({key: question.name, value: question.value})\"\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+[i]]?.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-input\"\r\n [required]=\"question.isRequired\" name=\"{{question.name+[i]}}\" autocomplete=\"off\"\r\n attr.data-restriction=\"{{question.restriction}}\" attr.data-type=\"{{question.datatype}}\"\r\n attr.data-name=\"{{question.name}}\" attr.data-required=\"{{question.isRequired}}\" currencyMask\r\n [formControlName]=\"question.name+[i]\" attr.label=\"{{question.label}}\"\r\n (focus)=\"OnFocusCurr($event, question.value)\" (blur)=\"ValidateDefaultValue(question)\"\r\n (focusout)=\"updateKeyValDict({key: question.name, value: question.value})\"\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+[i]]?.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 <span *ngIf=\"!useNewDatepicker\">\r\n <div *ngIf=\"question.type=='datepicker' && !question.isTime\">\r\n <input type=\"date\" id=\"{{question.id}}\" class=\"form-control search-input btn-lookup\"\r\n name=\"{{question.name+[i]}}\" [formControlName]=\"question.name+[i]\"\r\n [required]=\"question.isRequired\" attr.data-required=\"{{question.isRequired}}\"\r\n value=\"{{question.value}}\" [readonly]=\"question.readonly\"\r\n attr.data-type=\"{{question.datatype}}\" attr.data-name=\"{{question.name}}\"\r\n attr.data-datepickerpair=\"{{question.datepickerPair}}\"\r\n attr.data-crit-datatable=\"{{question.isCriteriaDataTable}}\"\r\n attr.data-restriction=\"{{question.restriction}}\" attr.label=\"{{question.label}}\"\r\n [min]=\"question.minDate | date:'yyyy-MM-dd'\" [max]=\"question.maxDate | date:'yyyy-MM-dd'\"\r\n (focusout)=\"question.restriction != undefined && checkInputDate(question,i)\"\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=='datepicker' && question.isTime\">\r\n <input type=\"datetime-local\" id=\"{{question.id}}\" class=\"form-control search-input btn-lookup\"\r\n name=\"{{question.name+[i]}}\" [required]=\"question.isRequired\"\r\n [formControlName]=\"question.name\" attr.data-required=\"{{question.isRequired}}\"\r\n value=\"{{question.value}}\" [readonly]=\"question.readonly\"\r\n attr.data-type=\"{{question.datatype}}\" attr.data-name=\"{{question.name}}\"\r\n attr.data-datepickerpair=\"{{question.datepickerPair}}\"\r\n attr.data-crit-datatable=\"{{question.isCriteriaDataTable}}\"\r\n attr.data-restriction=\"{{question.restriction}}\" attr.label=\"{{question.label}}\"\r\n min=\"{{question.minDate | date:'yyyy-MM-dd'}}\" max=\"{{question.maxDate | date:'yyyy-MM-dd'}}\"\r\n (focusout)=\"question.restriction != undefined && checkInputDate(question,i)\"\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 </span>\r\n <span *ngIf=\"useNewDatepicker\">\r\n <div *ngIf=\"question.type=='datepicker'\">\r\n <lib-ucdatepicker [parentForm]=\"form\" [enjiForm]=\"enjiForm\" [identifier]=\"question.name+i\"\r\n [min]=\"question.minDate | date: 'yyyy-MM-dd'\" [max]=\"question.maxDate | date: 'yyyy-MM-dd'\"\r\n [defaultStartDate]=\"BisDt\" [attr]=\"question\"\r\n (change)=\"question.restriction != undefined && checkInputDate(question,i)\">\r\n </lib-ucdatepicker>\r\n </div>\r\n </span>\r\n\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-input\"\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\" value=\"one\">Select\r\n 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 [required]=\"question.isRequired\" class=\"form-control search-input\"\r\n [formControlName]=\"question.name\" attr.query-in=\"{{question.isQueryIn}}\"\r\n attr.data-type=\"{{question.datatype}}\" attr.data-name=\"{{question.name}}\"\r\n attr.label=\"{{question.label}}\" attr.data-crit-datatable=\"{{question.isCriteriaDataTable}}\"\r\n attr.data-restriction=\"{{ question?.restriction ?? ''}}\"\r\n [hidden]=\"!question.isFromURL ? (question?.items?.length == 1 && !question?.keepDdl) : (question?.itemsUrl?.length == 1 && !question?.keepDdl)\"\r\n (change)=\"question.isEvent ? onChangeEvent($event.target.value, question) : updateKeyValDict({key: question.name, value: $event.target.value})\"\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?.keepDdl) : (question?.itemsUrl?.length != 1 || question?.keepDdl))\"\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?.keepDdl) : (question?.itemsUrl?.length != 1 || question?.keepDdl))\"\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 <option\r\n *ngIf=\"(question?.ddlType == undefined || question.ddlType == 'all') && (!question.isFromURL ? (question?.items?.length != 1 || question?.keepDdl) : (question?.itemsUrl?.length != 1 || question?.keepDdl)) && question.useOthersSelection\"\r\n value=\"others\">Others</option>\r\n </select>\r\n <label\r\n *ngIf=\"!question.isFromURL ? (question?.items?.length == 1 && !question?.keepDdl) : (question?.itemsUrl?.length == 1 && !question?.keepDdl)\">{{!question.isFromURL\r\n ? question.items[0].value :\r\n question.itemsUrl[0].Value}}\r\n </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 dds-input\" name=\"{{'ddsValue'+question.name}}\"\r\n [(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-input\" name=\"{{'searchText'+question.name}}\"\r\n [(ngModel)]=\"question.searchText\" [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}}\" 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-input\" attr.data-type=\"{{'text'}}\"\r\n attr.data-crit-datatable=\"{{question.isCriteriaDataTable}}\" attr.data-name=\"{{'Assignee'}}\"\r\n [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 <div *ngIf=\"question.type=='lookup'\">\r\n <lib-cl-uclookupgeneric *ngIf=\"searchInput.dictLookupObj[question.name].isReady\"\r\n [lookupInput]=\"searchInput.dictLookupObj[question.name]\" [parentForm]='form'\r\n [enjiForm]='enjiForm' [identifier]=\"question.name\"\r\n [notifyUpdateKeyValDict]=\"notifyUpdateKeyValDict\" [lookupKeyValDict]=\"lookupKeyValDict\"\r\n (lookup)=\"getLookup($event, question)\"\r\n (inputtedValue)=\"getInputtedValue($event, question)\"></lib-cl-uclookupgeneric>\r\n </div>\r\n\r\n <div *ngIf=\"question.type === 'time'\">\r\n <input type=\"time\" id=\"{{question.id}}\" class=\"form-control search-input\"\r\n [IsUpperCase]=\"question.isUppercase === undefined ? true : question.isUppercase\"\r\n [required]=\"question.isRequired\" name=\"{{question.name}}\" [formControlName]=\"question.name\"\r\n attr.data-crit-datatable=\"{{question.isCriteriaDataTable}}\"\r\n [placeholder]=\"question.placeholder != undefined ? question.placeholder : ''\"\r\n attr.data-required=\"{{question.isRequired}}\" value=\"{{question.value}}\"\r\n attr.data-type=\"{{question.datatype}}\" attr.data-name=\"{{question.name}}\"\r\n attr.data-restriction=\"{{question.restriction}}\" attr.label=\"{{question.label}}\"\r\n [readonly]=\"question.isReadonly\"\r\n (focusout)=\"updateKeyValDict({key: question.name, value: question.value})\"\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\r\n <div *ngIf=\"question.type === 'month'\">\r\n <select name=\"{{question.name}}\" attr.data-required=\"{{question.isRequired}}\"\r\n [required]=\"question.isRequired\" class=\"form-control search-input\"\r\n [formControlName]=\"question.name\" attr.query-in=\"{{question.isQueryIn}}\"\r\n attr.data-type=\"{{question.datatype}}\" attr.data-name=\"{{question.name}}\"\r\n attr.label=\"{{question.label}}\" 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 <option *ngIf=\"question.ddlType == 'one'\" value=\"one\">\r\n Select One</option>\r\n <option *ngIf=\"question?.ddlType == undefined || question.ddlType == 'all'\" value=\"all\">All\r\n </option>\r\n <option *ngFor=\"let m of months\" [value]=\"m.key\">\r\n {{m.value}}\r\n </option>\r\n </select>\r\n </div>\r\n\r\n <div *ngIf=\"question.type === 'year'\">\r\n <select name=\"{{question.name}}\" attr.data-required=\"{{question.isRequired}}\"\r\n [required]=\"question.isRequired\" class=\"form-control search-input\"\r\n [formControlName]=\"question.name\" attr.query-in=\"{{question.isQueryIn}}\"\r\n attr.data-type=\"{{question.datatype}}\" attr.data-name=\"{{question.name}}\"\r\n attr.label=\"{{question.label}}\" 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 <option *ngIf=\"question.ddlType == 'one'\" value=\"one\">\r\n Select One</option>\r\n <option *ngIf=\"question?.ddlType == undefined || question.ddlType == 'all'\" value=\"all\">All\r\n </option>\r\n <option *ngFor=\"let y of years\" [value]=\"y\">\r\n {{y}}\r\n </option>\r\n </select>\r\n </div>\r\n\r\n <lib-uc-show-errors *ngIf=\"question.type !== 'datepicker'\" [control]=\"form.controls[question.name]\"\r\n [submit]=\"enjiForm.submitted\">\r\n </lib-uc-show-errors>\r\n <lib-uc-show-errors *ngIf=\"question.type === 'datepicker' || question.type === 'numeric'\"\r\n [control]=\"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-3 form-group\" *ngIf=\"(isReport != undefined && isReport)\">\r\n <div class=\"col-md-12\">\r\n <div class=\"row\">\r\n <label class=\"col-md-12 no-padding search-label\" translate>Report Type</label>\r\n <div class=\"col-md-12 no-padding\">\r\n <select name=\"ExportType\" class=\"form-control search-input\" attr.data-type=\"text\"\r\n [formControlName]=\"'ExportType'\">\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 class=\"col-md-3 form-group\"\r\n *ngIf=\"(isReport != undefined && isReport) && (showRptExecType != undefined && showRptExecType)\">\r\n <div class=\"col-md-12\">\r\n <div class=\"row\">\r\n <label class=\"col-md-12 no-padding search-label\" translate>Execution Type</label>\r\n <div class=\"col-md-12 no-padding\">\r\n <select name=\"RptExecType\" class=\"form-control search-input\" attr.data-type=\"text\"\r\n [formControlName]=\"'RptExecType'\">\r\n <option *ngFor=\"let item of ReportExecTypeList\" [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 <div ngbDropdown class=\"d-inline-block\">\r\n <button type=\"button\" class=\"btn btn-raised btn-outline-2 mr-1 dropdown-toggle\" ngbDropdownToggle\r\n id=\"exportList\" translate>\r\n <i class=\"fa ft-download button-icon-search\"></i> <span class=\"button-text-search\"\r\n translate>Export File</span>\r\n </button>\r\n <div class=\"dropdown-menu\" ngbDropdownMenu aria-labelledby=\"exportList\">\r\n <ng-container *ngFor=\"let item of exportAsFileList\">\r\n <a class=\"dropdown-item\" ngbDropdownItem (click)=\"exportAsFile(item.key)\">{{item.value}}</a>\r\n </ng-container>\r\n </div>\r\n </div>\r\n </ng-container>\r\n <button type=\"button\" (click)=\"reset()\" class=\"btn btn-raised mr-1 btn-link-2\" translate>\r\n <!-- <i class=\"fa fa-times\"></i> -->\r\n <span translate>Reset</span>\r\n </button>\r\n <button *ngIf=\"(isReport == undefined || !isReport)\" type=\"submit\" class=\"btn btn-raised btn-outline-2\"\r\n #UCSearchClick [disabled]=\"!searchBtnReady\">\r\n <i class=\"fa fa-search button-icon-search\"></i> <span class=\"button-text-search\"\r\n translate>Search</span>\r\n </button>\r\n <button *ngIf=\"(isReport != undefined && isReport)\" type=\"submit\" class=\"btn btn-raised btn-outline-2\">\r\n <i class=\"fa ft-download button-icon-search\"></i> <span class=\"button-text-search\"\r\n 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 <!-- </div> -->\r\n</div>\r\n<!-- // Basic form layout section end -->", styles: [".ucSearch-title{margin:3px}.card-body{margin-top:24px}.form-group{margin-bottom:15px!important}.search-label{color:var(--Black_1, #3A4060);font-size:14px!important}.dds-input{border-radius:7px!important;border:1px solid var(--gray-line, #DFE6E9)!important;background:var(--white-1, #FDFEFF)!important;padding:1.135rem!important;height:calc(1.5rem + 2px)!important;font-size:12px!important}.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}.search-input{border-radius:7px!important;border:1px solid var(--gray-line, #DFE6E9)!important;background:var(--white-1, #FDFEFF)!important;width:100%}select.search-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url(\"data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23246CFE' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e\")!important;background-repeat:no-repeat!important;background-position:right 1rem center!important;background-size:1.4em!important}.btn{border-radius:7px;font-size:14px;padding:.275rem 1rem}.btn-link-2{background:none;border:none;color:var(--blue-primary, #246CFE)!important}.btn-link-2:hover{background:var(--light-grey, #F4F8FB)!important;color:var(--blue-primary-darker, #0010F7)!important}.btn-outline-2{border:1px solid var(--blue-primary, #246CFE)!important;background:var(--white, #FDFEFF)!important;color:var(--blue-primary, #246CFE)!important}.btn-outline-2:hover{color:var(--blue-primary-darker, #0010F7)!important;background:var(--light-grey, #F4F8FB)!important;border:1px solid var(--blue-primary-darker, #0010F7)!important}.button-icon-search{font-size:11px;vertical-align:middle;padding-right:8px}.button-text-search{vertical-align:middle}.dropdown-toggle:after{display:inline-block;margin-left:.5em;vertical-align:middle;content:\"\";border-top:.3em solid;border-right:.3em solid transparent;border-bottom:0;border-left:.3em solid transparent}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i11.NgbCollapse, selector: "[ngbCollapse]", inputs: ["animation", "ngbCollapse", "horizontal"], outputs: ["ngbCollapseChange", "shown", "hidden"], exportAs: ["ngbCollapse"] }, { kind: "directive", type: i11.NgbDropdown, selector: "[ngbDropdown]", inputs: ["autoClose", "dropdownClass", "open", "placement", "popperOptions", "container", "display"], outputs: ["openChange"], exportAs: ["ngbDropdown"] }, { kind: "directive", type: i11.NgbDropdownToggle, selector: "[ngbDropdownToggle]" }, { kind: "directive", type: i11.NgbDropdownMenu, selector: "[ngbDropdownMenu]" }, { kind: "directive", type: i11.NgbDropdownItem, selector: "[ngbDropdownItem]", inputs: ["tabindex", "disabled"] }, { kind: "directive", type: i8.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i8.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i8.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i8.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i8.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i8.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i8.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i8.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i8.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i8.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i8.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i12.UcShowErrorsComponent, selector: "lib-uc-show-errors", inputs: ["control", "submit", "fieldName", "customPattern"] }, { kind: "directive", type: i13.UpperCaseDirective, selector: "input[type=text], input", inputs: ["IsUpperCase"] }, { kind: "directive", type: i14.ValidateDateDirective, selector: "input[type=date], input[type=datetime-local]", inputs: ["warningMsg"] }, { kind: "component", type: i15.ClUclookupgenericComponent, selector: "lib-cl-uclookupgeneric", inputs: ["lookupInput", "enjiForm", "parentForm", "identifier", "notifyUpdateKeyValDict", "lookupKeyValDict"], outputs: ["lookup", "inputtedValue", "callback"] }, { kind: "component", type: i16.UcSubsectionComponent, selector: "lib-ucSubsection", inputs: ["title", "panel", "id", "legacy", "isHidden"], outputs: ["collapse"] }, { kind: "component", type: i17.UcdatepickerComponent, selector: "lib-ucdatepicker", inputs: ["parentForm", "enjiForm", "identifier", "min", "max", "defaultStartDate", "attr", "colorLevelSetting", "confidenceLevel"], outputs: ["change"] }, { kind: "directive", type: i18.NgxCurrencyDirective, selector: "input[currencyMask]", inputs: ["currencyMask", "options"] }, { kind: "directive", type: i19.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "pipe", type: i4.DatePipe, name: "date" }, { kind: "pipe", type: TextSearchPipe, name: "textSearch" }], animations: [
|
|
2449
|
+
trigger("changeDivSize", [
|
|
2450
|
+
state("initial", style({
|
|
2451
|
+
height: "*",
|
|
2452
|
+
opacity: "1",
|
|
2453
|
+
})),
|
|
2454
|
+
state("final", style({
|
|
2455
|
+
height: "0px",
|
|
2456
|
+
opacity: "0",
|
|
2457
|
+
overflow: "hidden",
|
|
2458
|
+
})),
|
|
2459
|
+
transition("initial=>final", animate("300ms")),
|
|
2460
|
+
transition("final=>initial", animate("300ms")),
|
|
2461
|
+
]),
|
|
2462
|
+
] });
|
|
2463
|
+
}
|
|
2464
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: UCSearchComponent, decorators: [{
|
|
2465
|
+
type: Component,
|
|
2466
|
+
args: [{ selector: "lib-UCSearch", providers: [DatePipe, ExportFileService], animations: [
|
|
2467
|
+
trigger("changeDivSize", [
|
|
2468
|
+
state("initial", style({
|
|
2469
|
+
height: "*",
|
|
2470
|
+
opacity: "1",
|
|
2471
|
+
})),
|
|
2472
|
+
state("final", style({
|
|
2473
|
+
height: "0px",
|
|
2474
|
+
opacity: "0",
|
|
2475
|
+
overflow: "hidden",
|
|
2476
|
+
})),
|
|
2477
|
+
transition("initial=>final", animate("300ms")),
|
|
2478
|
+
transition("final=>initial", animate("300ms")),
|
|
2479
|
+
]),
|
|
2480
|
+
], standalone: false, template: "<span hidden attr.version=\"3.8.18-canary.0\"></span>\r\n<div>\r\n <!-- Basic form layout section start -->\r\n <lib-ucSubsection [hidden]=\"!searchInput.IsSubsection\" [id]=\"searchInput.searchId+'id'\"\r\n [title]=\"configuration?.sectionTitle || 'Paging'\" [panel]=\"searchInput.searchId\" [legacy]=\"false\"\r\n (collapse)=\"onCollapse($event)\">\r\n </lib-ucSubsection>\r\n\r\n <!-- <div [id]=\"searchInput.searchId\"> -->\r\n <!-- <div class=\"row text-left\">\r\n <div class=\"col-md-12\">\r\n <div class=\"\"> -->\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\" [id]=\"searchInput.searchId\" [(ngbCollapse)]=\"isCollapsed\">\r\n <div class=\"px-3\">\r\n <form class=\"form form-horizontal\" id=\"formSearch\" #formIdSearch [formGroup]=\"form\" #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-3 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-12 no-padding search-label\" 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-12 no-padding\">\r\n <div *ngIf=\"question.type=='textbox'\">\r\n <input type=\"text\" id=\"{{question.id}}\" class=\"form-control search-input\"\r\n [IsUpperCase]=\"question.isUppercase === undefined ? true : question.isUppercase\"\r\n [required]=\"question.isRequired\" name=\"{{question.name}}\" [formControlName]=\"question.name\"\r\n attr.data-crit-datatable=\"{{question.isCriteriaDataTable}}\"\r\n [placeholder]=\"question.placeholder != undefined ? question.placeholder : ''\"\r\n attr.data-required=\"{{question.isRequired}}\" value=\"{{question.value}}\"\r\n attr.data-type=\"{{question.datatype}}\" attr.data-name=\"{{question.name}}\"\r\n attr.data-restriction=\"{{question.restriction}}\" attr.label=\"{{question.label}}\"\r\n [readonly]=\"question.isReadonly\"\r\n (focusout)=\"updateKeyValDict({key: question.name, value: question.value})\"\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-input\"\r\n [required]=\"question.isRequired\" name=\"{{question.name}}\" [formControlName]=\"question.name\"\r\n attr.data-required=\"{{question.isRequired}}\" attr.data-type=\"{{question.datatype}}\"\r\n attr.data-name=\"{{question.name}}\" value=\"{{question.value}}\" attr.label=\"{{question.label}}\"\r\n [readonly]=\"question.isReadonly\"\r\n (focusout)=\"updateKeyValDict({key: question.name, value: question.value})\"\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-input\" [placeholder]=\"'0'\"\r\n [required]=\"question.isRequired\" name=\"{{question.name+[i]}}\"\r\n [formControlName]=\"question.name+[i]\" attr.data-required=\"{{question.isRequired}}\"\r\n value=\"{{question.value}}\" 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}}\" attr.label=\"{{question.label}}\"\r\n (focusout)=\"updateKeyValDict({key: question.name, value: question.value})\"\r\n [readonly]=\"question.isReadonly\"\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-input\"\r\n [required]=\"question.isRequired\" name=\"{{question.name+[i]}}\" autocomplete=\"off\"\r\n attr.data-restriction=\"{{question.restriction}}\" attr.data-type=\"{{question.datatype}}\"\r\n attr.data-name=\"{{question.name}}\" attr.data-required=\"{{question.isRequired}}\" currencyMask\r\n [formControlName]=\"question.name+[i]\" attr.label=\"{{question.label}}\"\r\n [readonly]=\"question.isReadonly\" (focus)=\"OnFocusCurr($event, question.value)\"\r\n (blur)=\"ValidateDefaultValue(question)\"\r\n (focusout)=\"updateKeyValDict({key: question.name, value: question.value})\"\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+[i]]?.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-input\"\r\n [required]=\"question.isRequired\" name=\"{{question.name+[i]}}\" autocomplete=\"off\"\r\n attr.data-restriction=\"{{question.restriction}}\" attr.data-type=\"{{question.datatype}}\"\r\n attr.data-name=\"{{question.name}}\" attr.data-required=\"{{question.isRequired}}\" currencyMask\r\n [formControlName]=\"question.name+[i]\" attr.label=\"{{question.label}}\"\r\n (focus)=\"OnFocusCurr($event, question.value)\" (blur)=\"ValidateDefaultValue(question)\"\r\n (focusout)=\"updateKeyValDict({key: question.name, value: question.value})\"\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+[i]]?.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 <span *ngIf=\"!useNewDatepicker\">\r\n <div *ngIf=\"question.type=='datepicker' && !question.isTime\">\r\n <input type=\"date\" id=\"{{question.id}}\" class=\"form-control search-input btn-lookup\"\r\n name=\"{{question.name+[i]}}\" [formControlName]=\"question.name+[i]\"\r\n [required]=\"question.isRequired\" attr.data-required=\"{{question.isRequired}}\"\r\n value=\"{{question.value}}\" [readonly]=\"question.readonly\"\r\n attr.data-type=\"{{question.datatype}}\" attr.data-name=\"{{question.name}}\"\r\n attr.data-datepickerpair=\"{{question.datepickerPair}}\"\r\n attr.data-crit-datatable=\"{{question.isCriteriaDataTable}}\"\r\n attr.data-restriction=\"{{question.restriction}}\" attr.label=\"{{question.label}}\"\r\n [min]=\"question.minDate | date:'yyyy-MM-dd'\" [max]=\"question.maxDate | date:'yyyy-MM-dd'\"\r\n (focusout)=\"question.restriction != undefined && checkInputDate(question,i)\"\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=='datepicker' && question.isTime\">\r\n <input type=\"datetime-local\" id=\"{{question.id}}\" class=\"form-control search-input btn-lookup\"\r\n name=\"{{question.name+[i]}}\" [required]=\"question.isRequired\"\r\n [formControlName]=\"question.name\" attr.data-required=\"{{question.isRequired}}\"\r\n value=\"{{question.value}}\" [readonly]=\"question.readonly\"\r\n attr.data-type=\"{{question.datatype}}\" attr.data-name=\"{{question.name}}\"\r\n attr.data-datepickerpair=\"{{question.datepickerPair}}\"\r\n attr.data-crit-datatable=\"{{question.isCriteriaDataTable}}\"\r\n attr.data-restriction=\"{{question.restriction}}\" attr.label=\"{{question.label}}\"\r\n min=\"{{question.minDate | date:'yyyy-MM-dd'}}\" max=\"{{question.maxDate | date:'yyyy-MM-dd'}}\"\r\n (focusout)=\"question.restriction != undefined && checkInputDate(question,i)\"\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 </span>\r\n <span *ngIf=\"useNewDatepicker\">\r\n <div *ngIf=\"question.type=='datepicker'\">\r\n <lib-ucdatepicker [parentForm]=\"form\" [enjiForm]=\"enjiForm\" [identifier]=\"question.name+i\"\r\n [min]=\"question.minDate | date: 'yyyy-MM-dd'\" [max]=\"question.maxDate | date: 'yyyy-MM-dd'\"\r\n [defaultStartDate]=\"BisDt\" [attr]=\"question\"\r\n (change)=\"question.restriction != undefined && checkInputDate(question,i)\">\r\n </lib-ucdatepicker>\r\n </div>\r\n </span>\r\n\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-input\"\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\" value=\"one\">Select\r\n 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 [required]=\"question.isRequired\" class=\"form-control search-input\"\r\n [formControlName]=\"question.name\" attr.query-in=\"{{question.isQueryIn}}\"\r\n attr.data-type=\"{{question.datatype}}\" attr.data-name=\"{{question.name}}\"\r\n attr.label=\"{{question.label}}\" attr.data-crit-datatable=\"{{question.isCriteriaDataTable}}\"\r\n attr.data-restriction=\"{{ question?.restriction ?? ''}}\"\r\n [hidden]=\"!question.isFromURL ? (question?.items?.length == 1 && !question?.keepDdl) : (question?.itemsUrl?.length == 1 && !question?.keepDdl)\"\r\n (change)=\"question.isEvent ? onChangeEvent($event.target.value, question) : updateKeyValDict({key: question.name, value: $event.target.value})\"\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?.keepDdl) : (question?.itemsUrl?.length != 1 || question?.keepDdl))\"\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?.keepDdl) : (question?.itemsUrl?.length != 1 || question?.keepDdl))\"\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 <option\r\n *ngIf=\"(question?.ddlType == undefined || question.ddlType == 'all') && (!question.isFromURL ? (question?.items?.length != 1 || question?.keepDdl) : (question?.itemsUrl?.length != 1 || question?.keepDdl)) && question.useOthersSelection\"\r\n value=\"others\">Others</option>\r\n </select>\r\n <label\r\n *ngIf=\"!question.isFromURL ? (question?.items?.length == 1 && !question?.keepDdl) : (question?.itemsUrl?.length == 1 && !question?.keepDdl)\">{{!question.isFromURL\r\n ? question.items[0].value :\r\n question.itemsUrl[0].Value}}\r\n </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 dds-input\" name=\"{{'ddsValue'+question.name}}\"\r\n [(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-input\" name=\"{{'searchText'+question.name}}\"\r\n [(ngModel)]=\"question.searchText\" [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}}\" 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-input\" attr.data-type=\"{{'text'}}\"\r\n attr.data-crit-datatable=\"{{question.isCriteriaDataTable}}\" attr.data-name=\"{{'Assignee'}}\"\r\n [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 <div *ngIf=\"question.type=='lookup'\">\r\n <lib-cl-uclookupgeneric *ngIf=\"searchInput.dictLookupObj[question.name].isReady\"\r\n [lookupInput]=\"searchInput.dictLookupObj[question.name]\" [parentForm]='form'\r\n [enjiForm]='enjiForm' [identifier]=\"question.name\"\r\n [notifyUpdateKeyValDict]=\"notifyUpdateKeyValDict\" [lookupKeyValDict]=\"lookupKeyValDict\"\r\n (lookup)=\"getLookup($event, question)\"\r\n (inputtedValue)=\"getInputtedValue($event, question)\"></lib-cl-uclookupgeneric>\r\n </div>\r\n\r\n <div *ngIf=\"question.type === 'time'\">\r\n <input type=\"time\" id=\"{{question.id}}\" class=\"form-control search-input\"\r\n [IsUpperCase]=\"question.isUppercase === undefined ? true : question.isUppercase\"\r\n [required]=\"question.isRequired\" name=\"{{question.name}}\" [formControlName]=\"question.name\"\r\n attr.data-crit-datatable=\"{{question.isCriteriaDataTable}}\"\r\n [placeholder]=\"question.placeholder != undefined ? question.placeholder : ''\"\r\n attr.data-required=\"{{question.isRequired}}\" value=\"{{question.value}}\"\r\n attr.data-type=\"{{question.datatype}}\" attr.data-name=\"{{question.name}}\"\r\n attr.data-restriction=\"{{question.restriction}}\" attr.label=\"{{question.label}}\"\r\n [readonly]=\"question.isReadonly\"\r\n (focusout)=\"updateKeyValDict({key: question.name, value: question.value})\"\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\r\n <div *ngIf=\"question.type === 'month'\">\r\n <select name=\"{{question.name}}\" attr.data-required=\"{{question.isRequired}}\"\r\n [required]=\"question.isRequired\" class=\"form-control search-input\"\r\n [formControlName]=\"question.name\" attr.query-in=\"{{question.isQueryIn}}\"\r\n attr.data-type=\"{{question.datatype}}\" attr.data-name=\"{{question.name}}\"\r\n attr.label=\"{{question.label}}\" 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 <option *ngIf=\"question.ddlType == 'one'\" value=\"one\">\r\n Select One</option>\r\n <option *ngIf=\"question?.ddlType == undefined || question.ddlType == 'all'\" value=\"all\">All\r\n </option>\r\n <option *ngFor=\"let m of months\" [value]=\"m.key\">\r\n {{m.value}}\r\n </option>\r\n </select>\r\n </div>\r\n\r\n <div *ngIf=\"question.type === 'year'\">\r\n <select name=\"{{question.name}}\" attr.data-required=\"{{question.isRequired}}\"\r\n [required]=\"question.isRequired\" class=\"form-control search-input\"\r\n [formControlName]=\"question.name\" attr.query-in=\"{{question.isQueryIn}}\"\r\n attr.data-type=\"{{question.datatype}}\" attr.data-name=\"{{question.name}}\"\r\n attr.label=\"{{question.label}}\" 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 <option *ngIf=\"question.ddlType == 'one'\" value=\"one\">\r\n Select One</option>\r\n <option *ngIf=\"question?.ddlType == undefined || question.ddlType == 'all'\" value=\"all\">All\r\n </option>\r\n <option *ngFor=\"let y of years\" [value]=\"y\">\r\n {{y}}\r\n </option>\r\n </select>\r\n </div>\r\n\r\n <lib-uc-show-errors *ngIf=\"question.type !== 'datepicker'\" [control]=\"form.controls[question.name]\"\r\n [submit]=\"enjiForm.submitted\">\r\n </lib-uc-show-errors>\r\n <lib-uc-show-errors *ngIf=\"question.type === 'datepicker' || question.type === 'numeric'\"\r\n [control]=\"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-3 form-group\" *ngIf=\"(isReport != undefined && isReport)\">\r\n <div class=\"col-md-12\">\r\n <div class=\"row\">\r\n <label class=\"col-md-12 no-padding search-label\" translate>Report Type</label>\r\n <div class=\"col-md-12 no-padding\">\r\n <select name=\"ExportType\" class=\"form-control search-input\" attr.data-type=\"text\"\r\n [formControlName]=\"'ExportType'\">\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 class=\"col-md-3 form-group\"\r\n *ngIf=\"(isReport != undefined && isReport) && (showRptExecType != undefined && showRptExecType)\">\r\n <div class=\"col-md-12\">\r\n <div class=\"row\">\r\n <label class=\"col-md-12 no-padding search-label\" translate>Execution Type</label>\r\n <div class=\"col-md-12 no-padding\">\r\n <select name=\"RptExecType\" class=\"form-control search-input\" attr.data-type=\"text\"\r\n [formControlName]=\"'RptExecType'\">\r\n <option *ngFor=\"let item of ReportExecTypeList\" [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 <div ngbDropdown class=\"d-inline-block\">\r\n <button type=\"button\" class=\"btn btn-raised btn-outline-2 mr-1 dropdown-toggle\" ngbDropdownToggle\r\n id=\"exportList\" translate>\r\n <i class=\"fa ft-download button-icon-search\"></i> <span class=\"button-text-search\"\r\n translate>Export File</span>\r\n </button>\r\n <div class=\"dropdown-menu\" ngbDropdownMenu aria-labelledby=\"exportList\">\r\n <ng-container *ngFor=\"let item of exportAsFileList\">\r\n <a class=\"dropdown-item\" ngbDropdownItem (click)=\"exportAsFile(item.key)\">{{item.value}}</a>\r\n </ng-container>\r\n </div>\r\n </div>\r\n </ng-container>\r\n <button type=\"button\" (click)=\"reset()\" class=\"btn btn-raised mr-1 btn-link-2\" translate>\r\n <!-- <i class=\"fa fa-times\"></i> -->\r\n <span translate>Reset</span>\r\n </button>\r\n <button *ngIf=\"(isReport == undefined || !isReport)\" type=\"submit\" class=\"btn btn-raised btn-outline-2\"\r\n #UCSearchClick [disabled]=\"!searchBtnReady\">\r\n <i class=\"fa fa-search button-icon-search\"></i> <span class=\"button-text-search\"\r\n translate>Search</span>\r\n </button>\r\n <button *ngIf=\"(isReport != undefined && isReport)\" type=\"submit\" class=\"btn btn-raised btn-outline-2\">\r\n <i class=\"fa ft-download button-icon-search\"></i> <span class=\"button-text-search\"\r\n 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 <!-- </div> -->\r\n</div>\r\n<!-- // Basic form layout section end -->", styles: [".ucSearch-title{margin:3px}.card-body{margin-top:24px}.form-group{margin-bottom:15px!important}.search-label{color:var(--Black_1, #3A4060);font-size:14px!important}.dds-input{border-radius:7px!important;border:1px solid var(--gray-line, #DFE6E9)!important;background:var(--white-1, #FDFEFF)!important;padding:1.135rem!important;height:calc(1.5rem + 2px)!important;font-size:12px!important}.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}.search-input{border-radius:7px!important;border:1px solid var(--gray-line, #DFE6E9)!important;background:var(--white-1, #FDFEFF)!important;width:100%}select.search-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url(\"data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23246CFE' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e\")!important;background-repeat:no-repeat!important;background-position:right 1rem center!important;background-size:1.4em!important}.btn{border-radius:7px;font-size:14px;padding:.275rem 1rem}.btn-link-2{background:none;border:none;color:var(--blue-primary, #246CFE)!important}.btn-link-2:hover{background:var(--light-grey, #F4F8FB)!important;color:var(--blue-primary-darker, #0010F7)!important}.btn-outline-2{border:1px solid var(--blue-primary, #246CFE)!important;background:var(--white, #FDFEFF)!important;color:var(--blue-primary, #246CFE)!important}.btn-outline-2:hover{color:var(--blue-primary-darker, #0010F7)!important;background:var(--light-grey, #F4F8FB)!important;border:1px solid var(--blue-primary-darker, #0010F7)!important}.button-icon-search{font-size:11px;vertical-align:middle;padding-right:8px}.button-text-search{vertical-align:middle}.dropdown-toggle:after{display:inline-block;margin-left:.5em;vertical-align:middle;content:\"\";border-top:.3em solid;border-right:.3em solid transparent;border-bottom:0;border-left:.3em solid transparent}\n"] }]
|
|
2481
|
+
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: i0.Renderer2 }, { type: undefined, decorators: [{
|
|
2482
|
+
type: Inject,
|
|
2483
|
+
args: [DOCUMENT]
|
|
2484
|
+
}] }, { type: i2.ToastrService }, { type: i3.CookieService }, { type: i4.DatePipe }, { type: i0.ElementRef }, { type: ExportFileService }, { type: i6.ActivatedRoute }, { type: i7.NgxRouterService }, { type: i8.FormBuilder }, { type: UcsearchDatetimeService }, { type: UcsearchFormService }], propDecorators: { content: [{
|
|
2485
|
+
type: ViewChild,
|
|
2486
|
+
args: ["enjiForm"]
|
|
2487
|
+
}], myForm: [{
|
|
2488
|
+
type: ViewChild,
|
|
2489
|
+
args: ["formIdSearch"]
|
|
2490
|
+
}], searchInput: [{
|
|
2491
|
+
type: Input
|
|
2492
|
+
}], pageSize: [{
|
|
2493
|
+
type: Input
|
|
2494
|
+
}], isReport: [{
|
|
2495
|
+
type: Input
|
|
2496
|
+
}], showRptExecType: [{
|
|
2497
|
+
type: Input
|
|
2498
|
+
}], result: [{
|
|
2499
|
+
type: Output
|
|
2500
|
+
}], genRpt: [{
|
|
2501
|
+
type: Output
|
|
2502
|
+
}], reqGetAllData: [{
|
|
2503
|
+
type: Output
|
|
2504
|
+
}] } });
|
|
2505
|
+
|
|
2506
|
+
const customCurrencyMaskConfig = {
|
|
2507
|
+
align: "right",
|
|
2508
|
+
allowNegative: false,
|
|
2509
|
+
allowZero: true,
|
|
2510
|
+
decimal: ".",
|
|
2511
|
+
precision: 2,
|
|
2512
|
+
prefix: "",
|
|
2513
|
+
suffix: "",
|
|
2514
|
+
thousands: ",",
|
|
2515
|
+
nullable: false,
|
|
2516
|
+
inputMode: NgxCurrencyInputMode.Natural,
|
|
2517
|
+
};
|
|
2518
|
+
class UCSearchModule {
|
|
2519
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: UCSearchModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2520
|
+
/** @nocollapse */ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.5", ngImport: i0, type: UCSearchModule, declarations: [UCSearchComponent, TextSearchPipe], imports: [CommonModule,
|
|
2521
|
+
NgbModule,
|
|
2522
|
+
FormsModule,
|
|
2523
|
+
ReactiveFormsModule,
|
|
2524
|
+
UcShowErrorsModule,
|
|
2525
|
+
UcDirectiveUpperCaseModule,
|
|
2526
|
+
UcDirectiveValidateDateModule,
|
|
2527
|
+
ClUclookupgenericModule,
|
|
2528
|
+
UcSubsectionModule,
|
|
2529
|
+
NgbDropdownModule,
|
|
2530
|
+
UcdatepickerModule,
|
|
2531
|
+
NgxCurrencyDirective, i19.TranslateModule], exports: [UCSearchComponent] });
|
|
2532
|
+
/** @nocollapse */ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: UCSearchModule, providers: [
|
|
2533
|
+
NgbDropdown,
|
|
2534
|
+
UcsearchDatetimeService,
|
|
2535
|
+
UcsearchFormService,
|
|
2536
|
+
provideEnvironmentNgxCurrency(customCurrencyMaskConfig),
|
|
2537
|
+
], imports: [CommonModule,
|
|
2538
|
+
NgbModule,
|
|
2539
|
+
FormsModule,
|
|
2540
|
+
ReactiveFormsModule,
|
|
2541
|
+
UcShowErrorsModule,
|
|
2542
|
+
UcDirectiveUpperCaseModule,
|
|
2543
|
+
UcDirectiveValidateDateModule,
|
|
2544
|
+
ClUclookupgenericModule,
|
|
2545
|
+
UcSubsectionModule,
|
|
2546
|
+
NgbDropdownModule,
|
|
2547
|
+
UcdatepickerModule,
|
|
2548
|
+
TranslateModule.forChild()] });
|
|
2549
|
+
}
|
|
2550
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: UCSearchModule, decorators: [{
|
|
2551
|
+
type: NgModule,
|
|
2552
|
+
args: [{
|
|
2553
|
+
declarations: [UCSearchComponent, TextSearchPipe],
|
|
2554
|
+
imports: [
|
|
2555
|
+
CommonModule,
|
|
2556
|
+
NgbModule,
|
|
2557
|
+
FormsModule,
|
|
2558
|
+
ReactiveFormsModule,
|
|
2559
|
+
UcShowErrorsModule,
|
|
2560
|
+
UcDirectiveUpperCaseModule,
|
|
2561
|
+
UcDirectiveValidateDateModule,
|
|
2562
|
+
ClUclookupgenericModule,
|
|
2563
|
+
UcSubsectionModule,
|
|
2564
|
+
NgbDropdownModule,
|
|
2565
|
+
UcdatepickerModule,
|
|
2566
|
+
NgxCurrencyDirective,
|
|
2567
|
+
TranslateModule.forChild(),
|
|
2568
|
+
],
|
|
2569
|
+
providers: [
|
|
2570
|
+
NgbDropdown,
|
|
2571
|
+
UcsearchDatetimeService,
|
|
2572
|
+
UcsearchFormService,
|
|
2573
|
+
provideEnvironmentNgxCurrency(customCurrencyMaskConfig),
|
|
2574
|
+
],
|
|
2575
|
+
exports: [UCSearchComponent],
|
|
2576
|
+
}]
|
|
2577
|
+
}] });
|
|
2578
|
+
|
|
2579
|
+
/*
|
|
2580
|
+
* Public API Surface of ucsearch
|
|
2581
|
+
*/
|
|
2582
|
+
|
|
2583
|
+
/**
|
|
2584
|
+
* Generated bundle index. Do not edit.
|
|
2585
|
+
*/
|
|
2586
|
+
|
|
2587
|
+
export { UCSearchComponent, UCSearchModule, UCSearchService, UcsearchFormService, customCurrencyMaskConfig };
|
|
2588
|
+
//# sourceMappingURL=adins-ucsearch.mjs.map
|