@michalrakus/x-react-web-lib 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/FindParam.d.ts +3 -0
- package/FindParam.js +5 -0
- package/XButtonIconNarrow.d.ts +3 -0
- package/XButtonIconNarrow.js +5 -0
- package/XButtonIconSmall.d.ts +3 -0
- package/XButtonIconSmall.js +5 -0
- package/XFieldChangeEvent.d.ts +3 -0
- package/XFieldChangeEvent.js +5 -0
- package/gulpfile.js +4 -0
- package/lib/components/SearchTableParams.d.ts +8 -2
- package/lib/components/XAutoComplete.d.ts +7 -4
- package/lib/components/XAutoComplete.js +21 -6
- package/lib/components/XAutoCompleteBase.d.ts +7 -4
- package/lib/components/XAutoCompleteBase.js +65 -26
- package/lib/components/XAutoCompleteDT.d.ts +33 -0
- package/lib/components/XAutoCompleteDT.js +141 -0
- package/lib/components/XButton.d.ts +3 -1
- package/lib/components/XButton.js +1 -1
- package/lib/components/XButtonIconNarrow.d.ts +10 -0
- package/lib/components/XButtonIconNarrow.js +25 -0
- package/lib/components/XButtonIconSmall.d.ts +3 -1
- package/lib/components/XCheckbox.d.ts +2 -2
- package/lib/components/XDropdown.d.ts +3 -2
- package/lib/components/XDropdown.js +1 -1
- package/lib/components/XFieldChangeEvent.d.ts +11 -0
- package/lib/components/XFieldChangeEvent.js +2 -0
- package/lib/components/XFormBase.d.ts +17 -9
- package/lib/components/XFormBase.js +85 -34
- package/lib/components/XFormComponent.d.ts +11 -3
- package/lib/components/XFormComponent.js +29 -3
- package/lib/components/XFormComponentDT.d.ts +30 -0
- package/lib/components/XFormComponentDT.js +119 -0
- package/lib/components/XFormDataTable2.d.ts +46 -6
- package/lib/components/XFormDataTable2.js +170 -40
- package/lib/components/XInput.d.ts +2 -2
- package/lib/components/XInputDT.d.ts +11 -0
- package/lib/components/XInputDT.js +37 -0
- package/lib/components/XInputDate.d.ts +2 -1
- package/lib/components/XInputDate.js +4 -2
- package/lib/components/XInputDecimal.d.ts +9 -2
- package/lib/components/XInputDecimal.js +62 -45
- package/lib/components/XInputDecimalDT.d.ts +10 -8
- package/lib/components/XInputDecimalDT.js +58 -36
- package/lib/components/XInputText.d.ts +3 -2
- package/lib/components/XInputText.js +7 -1
- package/lib/components/XInputTextarea.d.ts +2 -2
- package/lib/components/XLazyDataTable.d.ts +5 -0
- package/lib/components/XLazyDataTable.js +38 -23
- package/lib/components/XSearchButton.d.ts +6 -4
- package/lib/components/XSearchButton.js +19 -17
- package/lib/components/XSearchButtonDT.js +3 -3
- package/lib/components/XUtils.d.ts +12 -2
- package/lib/components/XUtils.js +94 -1
- package/lib/components/XUtilsConversions.d.ts +1 -0
- package/lib/components/XUtilsConversions.js +14 -1
- package/lib/components/XUtilsMetadata.d.ts +4 -1
- package/lib/components/XUtilsMetadata.js +46 -7
- package/lib/serverApi/FindParam.d.ts +10 -2
- package/lib/serverApi/XUtilsCommon.d.ts +1 -0
- package/lib/serverApi/XUtilsCommon.js +4 -0
- package/package.json +1 -1
package/lib/components/XUtils.js
CHANGED
|
@@ -79,6 +79,7 @@ var XUtilsMetadata_1 = require("./XUtilsMetadata");
|
|
|
79
79
|
var XUtilsCommon_1 = require("../serverApi/XUtilsCommon");
|
|
80
80
|
var ExportImportParam_1 = require("../serverApi/ExportImportParam");
|
|
81
81
|
var XResponseError_1 = require("./XResponseError");
|
|
82
|
+
var FindParam_1 = require("../serverApi/FindParam");
|
|
82
83
|
var OperationType;
|
|
83
84
|
(function (OperationType) {
|
|
84
85
|
OperationType[OperationType["None"] = 0] = "None";
|
|
@@ -252,6 +253,22 @@ var XUtils = /** @class */ (function () {
|
|
|
252
253
|
XUtils.fetchMany = function (path, value, usePublicToken) {
|
|
253
254
|
return XUtils.fetch(path, value, usePublicToken);
|
|
254
255
|
};
|
|
256
|
+
// pomocna metodka pouzivajuca lazyDataTable service
|
|
257
|
+
XUtils.fetchRows = function (entity, customFilter, sortField) {
|
|
258
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
259
|
+
var findParam, rowList;
|
|
260
|
+
return __generator(this, function (_a) {
|
|
261
|
+
switch (_a.label) {
|
|
262
|
+
case 0:
|
|
263
|
+
findParam = { resultType: FindParam_1.ResultType.AllRows, entity: entity, customFilter: customFilter, multiSortMeta: sortField ? [{ field: sortField, order: 1 }] : undefined };
|
|
264
|
+
return [4 /*yield*/, XUtils.fetchOne('lazyDataTableFindRows', findParam)];
|
|
265
|
+
case 1:
|
|
266
|
+
rowList = (_a.sent()).rowList;
|
|
267
|
+
return [2 /*return*/, rowList];
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
});
|
|
271
|
+
};
|
|
255
272
|
XUtils.fetchOne = function (path, value, usePublicToken) {
|
|
256
273
|
return XUtils.fetch(path, value, usePublicToken);
|
|
257
274
|
};
|
|
@@ -443,6 +460,29 @@ var XUtils = /** @class */ (function () {
|
|
|
443
460
|
array.splice(positionNew, 0, element);
|
|
444
461
|
}
|
|
445
462
|
};
|
|
463
|
+
// helper function
|
|
464
|
+
XUtils.arraySort = function (array, fieldOrStringFunction) {
|
|
465
|
+
var stringFunction;
|
|
466
|
+
if (typeof fieldOrStringFunction === 'string') {
|
|
467
|
+
stringFunction = function (item) { return item[fieldOrStringFunction]; };
|
|
468
|
+
}
|
|
469
|
+
else {
|
|
470
|
+
stringFunction = fieldOrStringFunction;
|
|
471
|
+
}
|
|
472
|
+
return array.sort(function (suggestion1, suggestion2) {
|
|
473
|
+
var value1 = stringFunction(suggestion1);
|
|
474
|
+
var value2 = stringFunction(suggestion2);
|
|
475
|
+
if (value1 > value2) {
|
|
476
|
+
return 1;
|
|
477
|
+
}
|
|
478
|
+
else if (value1 < value2) {
|
|
479
|
+
return -1;
|
|
480
|
+
}
|
|
481
|
+
else {
|
|
482
|
+
return 0;
|
|
483
|
+
}
|
|
484
|
+
});
|
|
485
|
+
};
|
|
446
486
|
// helper
|
|
447
487
|
XUtils.isReadOnly = function (path, readOnlyInit) {
|
|
448
488
|
// ak mame path dlzky 2 a viac, field je vzdy readOnly
|
|
@@ -477,8 +517,46 @@ var XUtils = /** @class */ (function () {
|
|
|
477
517
|
XUtils.createErrorProps = function (error) {
|
|
478
518
|
return error ? { className: "p-invalid", tooltip: error, tooltipOptions: { className: 'pink-tooltip', position: 'bottom' } } : {};
|
|
479
519
|
};
|
|
520
|
+
// pomocna metodka - prida className do props, ak uz className v props existuje tak len pripoji dalsiu hodnotu
|
|
521
|
+
// pouzivame ju, lebo XUtils.createErrorProps nam prebijal className
|
|
522
|
+
XUtils.addClassName = function (props, className) {
|
|
523
|
+
var propsClassName = props.className;
|
|
524
|
+
if (propsClassName !== undefined) {
|
|
525
|
+
propsClassName += " " + className;
|
|
526
|
+
}
|
|
527
|
+
else {
|
|
528
|
+
propsClassName = className;
|
|
529
|
+
}
|
|
530
|
+
props.className = propsClassName;
|
|
531
|
+
return props;
|
|
532
|
+
};
|
|
480
533
|
// pomocna metodka
|
|
481
|
-
|
|
534
|
+
// ak nie su v xErrorMap ziadne chyby, vrati ""
|
|
535
|
+
XUtils.getErrorMessages = function (xErrorMap) {
|
|
536
|
+
var e_5, _a;
|
|
537
|
+
var _b;
|
|
538
|
+
var msg = "";
|
|
539
|
+
try {
|
|
540
|
+
for (var _c = __values(Object.entries(xErrorMap)), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
541
|
+
var _e = __read(_d.value, 2), field = _e[0], xError = _e[1];
|
|
542
|
+
if (xError) {
|
|
543
|
+
var errorMessage = XUtils.getErrorMessage(xError);
|
|
544
|
+
if (errorMessage) {
|
|
545
|
+
msg += "".concat((_b = xError.fieldLabel) !== null && _b !== void 0 ? _b : field, ": ").concat(errorMessage).concat(XUtilsCommon_1.XUtilsCommon.newLine);
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
551
|
+
finally {
|
|
552
|
+
try {
|
|
553
|
+
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
554
|
+
}
|
|
555
|
+
finally { if (e_5) throw e_5.error; }
|
|
556
|
+
}
|
|
557
|
+
return msg;
|
|
558
|
+
};
|
|
559
|
+
XUtils.getErrorMessage = function (xError) {
|
|
482
560
|
if (xError.onChange || xError.onBlur || xError.form) {
|
|
483
561
|
var message = '';
|
|
484
562
|
if (xError.onChange) {
|
|
@@ -508,6 +586,21 @@ var XUtils = /** @class */ (function () {
|
|
|
508
586
|
}
|
|
509
587
|
return value;
|
|
510
588
|
};
|
|
589
|
+
// pomocna metodka
|
|
590
|
+
XUtils.filterAnd = function (filter1, filter2) {
|
|
591
|
+
if (filter1 && filter2) {
|
|
592
|
+
return { filter: "(".concat(filter1.filter, ") AND (").concat(filter2.filter, ")"), values: __assign(__assign({}, filter1.values), filter2.values) };
|
|
593
|
+
}
|
|
594
|
+
else if (filter1 && filter2 === undefined) {
|
|
595
|
+
return filter1;
|
|
596
|
+
}
|
|
597
|
+
else if (filter1 === undefined && filter2) {
|
|
598
|
+
return filter2;
|
|
599
|
+
}
|
|
600
|
+
else {
|
|
601
|
+
return undefined;
|
|
602
|
+
}
|
|
603
|
+
};
|
|
511
604
|
XUtils.dropdownEmptyOptionValue = " ";
|
|
512
605
|
XUtils.xBackendUrl = undefined;
|
|
513
606
|
// nacachovany XToken - na rozlicnych miestach potrebujeme vediet uzivatela
|
|
@@ -2,6 +2,7 @@ export declare function stringFromUI(stringValue: string): string | null;
|
|
|
2
2
|
export declare function stringAsUI(value: string | null): string;
|
|
3
3
|
export declare function numberFromUI(stringValue: string): number | null;
|
|
4
4
|
export declare function numberAsUI(value: number | null, fractionDigits?: number): string;
|
|
5
|
+
export declare function numberFromModel(value: any): number | null;
|
|
5
6
|
export declare function dateFromModel(value: any): Date | null;
|
|
6
7
|
export declare function dateAsUI(value: Date | null): string;
|
|
7
8
|
export declare function datetimeAsUI(value: Date | null): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.datetimeFormatUI = exports.dateFormatCalendar = exports.dateFormatUI = exports.timeFromModel = exports.datetimeAsUI = exports.dateAsUI = exports.dateFromModel = exports.numberAsUI = exports.numberFromUI = exports.stringAsUI = exports.stringFromUI = void 0;
|
|
3
|
+
exports.datetimeFormatUI = exports.dateFormatCalendar = exports.dateFormatUI = exports.timeFromModel = exports.datetimeAsUI = exports.dateAsUI = exports.dateFromModel = exports.numberFromModel = exports.numberAsUI = exports.numberFromUI = exports.stringAsUI = exports.stringFromUI = void 0;
|
|
4
4
|
var XUtilsCommon_1 = require("../serverApi/XUtilsCommon");
|
|
5
5
|
function stringFromUI(stringValue) {
|
|
6
6
|
var value;
|
|
@@ -40,6 +40,19 @@ function numberAsUI(value, fractionDigits) {
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
exports.numberAsUI = numberAsUI;
|
|
43
|
+
// v modeli na klientovi by mal byt vzdy number, teraz je tam niekedy string (z json-u zo servera) a niekedy number (z komponentu)
|
|
44
|
+
// provizorne zatial takato konverzia
|
|
45
|
+
function numberFromModel(value) {
|
|
46
|
+
var numberValue = null;
|
|
47
|
+
if (typeof value === 'string') {
|
|
48
|
+
numberValue = parseFloat(value);
|
|
49
|
+
}
|
|
50
|
+
else if (typeof value === 'number') {
|
|
51
|
+
numberValue = value;
|
|
52
|
+
}
|
|
53
|
+
return numberValue;
|
|
54
|
+
}
|
|
55
|
+
exports.numberFromModel = numberFromModel;
|
|
43
56
|
// v modeli na klientovi by mal byt vzdy Date, teraz je tam niekedy string (z json-u zo servera) a niekedy Date (z komponentu)
|
|
44
57
|
// provizorne zatial takato konverzia
|
|
45
58
|
function dateFromModel(value) {
|
|
@@ -11,6 +11,8 @@ export declare class XUtilsMetadata {
|
|
|
11
11
|
static getXFieldByPathStr(entity: string, path: string): XField;
|
|
12
12
|
static getXAssocToOne(xEntity: XEntity, assocField: string): XAssoc;
|
|
13
13
|
static getXAssocToMany(xEntity: XEntity, assocField: string): XAssoc;
|
|
14
|
+
static getXAssocToOneByAssocEntity(xEntity: XEntity, assocEntityName: string): XAssoc;
|
|
15
|
+
static getXAssocToManyByAssocEntity(xEntity: XEntity, assocEntityName: string): XAssoc;
|
|
14
16
|
static getXEntityForAssocToOne(xEntity: XEntity, assocField: string): XEntity;
|
|
15
17
|
static getXEntityForAssocToMany(xEntity: XEntity, assocField: string): XEntity;
|
|
16
18
|
static getXFieldList(xEntity: XEntity): XField[];
|
|
@@ -22,11 +24,12 @@ export declare class XUtilsMetadata {
|
|
|
22
24
|
size?: number;
|
|
23
25
|
};
|
|
24
26
|
static CHAR_SIZE: number;
|
|
25
|
-
static computeColumnWidth(xField: XField, filterMenuInFilterRow: boolean, formColumnType: string | undefined, header: string | undefined, filterButtonInHeader: boolean): string | undefined;
|
|
27
|
+
static computeColumnWidth(xField: XField, filterMenuInFilterRow: boolean, formColumnType: string | undefined, header: string | undefined, sortableButtonInHeader: boolean, filterButtonInHeader: boolean): string | undefined;
|
|
26
28
|
static computeColumnWidthBase(charSize?: number, paddingAndOther?: number): number | undefined;
|
|
27
29
|
static getXBrowseMeta(entity: string, browseId?: string): XBrowseMeta;
|
|
28
30
|
static setXBrowseMeta(entity: string, browseId: string | undefined, xBrowseMeta: XBrowseMeta): void;
|
|
29
31
|
static getXBrowseFormMetaKey(entity: string, browseId?: string): string;
|
|
30
32
|
private static getXAssoc;
|
|
33
|
+
private static getXAssocByAssocEntity;
|
|
31
34
|
private static getXEntityForAssoc;
|
|
32
35
|
}
|
|
@@ -141,6 +141,12 @@ var XUtilsMetadata = /** @class */ (function () {
|
|
|
141
141
|
XUtilsMetadata.getXAssocToMany = function (xEntity, assocField) {
|
|
142
142
|
return XUtilsMetadata.getXAssoc(xEntity, xEntity.assocToManyMap, assocField);
|
|
143
143
|
};
|
|
144
|
+
XUtilsMetadata.getXAssocToOneByAssocEntity = function (xEntity, assocEntityName) {
|
|
145
|
+
return XUtilsMetadata.getXAssocByAssocEntity(xEntity, xEntity.assocToOneMap, assocEntityName);
|
|
146
|
+
};
|
|
147
|
+
XUtilsMetadata.getXAssocToManyByAssocEntity = function (xEntity, assocEntityName) {
|
|
148
|
+
return XUtilsMetadata.getXAssocByAssocEntity(xEntity, xEntity.assocToManyMap, assocEntityName);
|
|
149
|
+
};
|
|
144
150
|
XUtilsMetadata.getXEntityForAssocToOne = function (xEntity, assocField) {
|
|
145
151
|
return XUtilsMetadata.getXEntityForAssoc(XUtilsMetadata.getXAssocToOne(xEntity, assocField));
|
|
146
152
|
};
|
|
@@ -203,7 +209,7 @@ var XUtilsMetadata = /** @class */ (function () {
|
|
|
203
209
|
}
|
|
204
210
|
return { useGrouping: useGrouping, fractionDigits: fractionDigits, min: min, max: max, size: size };
|
|
205
211
|
};
|
|
206
|
-
XUtilsMetadata.computeColumnWidth = function (xField, filterMenuInFilterRow, formColumnType, header, filterButtonInHeader) {
|
|
212
|
+
XUtilsMetadata.computeColumnWidth = function (xField, filterMenuInFilterRow, formColumnType, header, sortableButtonInHeader, filterButtonInHeader) {
|
|
207
213
|
var width;
|
|
208
214
|
if (formColumnType === undefined) {
|
|
209
215
|
// lazy datatable (no inputs, no buttons, only text and padding)
|
|
@@ -251,7 +257,7 @@ var XUtilsMetadata = /** @class */ (function () {
|
|
|
251
257
|
throw "XField ".concat(xField.name, ": unknown xField.type = ").concat(xField.type);
|
|
252
258
|
}
|
|
253
259
|
}
|
|
254
|
-
else if (formColumnType === "dropdown" || formColumnType === "
|
|
260
|
+
else if (formColumnType === "dropdown" || formColumnType === "autoComplete" || formColumnType === "searchButton") {
|
|
255
261
|
// vyratame sirku inputu
|
|
256
262
|
var padding = 0.21 + 0.07 + 0.5; // padding is 2.94px + 1px border + 7px padding in input
|
|
257
263
|
if (xField.type === "string") {
|
|
@@ -268,7 +274,7 @@ var XUtilsMetadata = /** @class */ (function () {
|
|
|
268
274
|
width = XUtilsMetadata.computeColumnWidthBase(10 + 9, padding + padding); // napr. 31.12.2021 03:03:00
|
|
269
275
|
}
|
|
270
276
|
else {
|
|
271
|
-
throw "XField ".concat(xField.name, ": xField.type = ").concat(xField.type, " not implemented for dropdown/searchButton
|
|
277
|
+
throw "XField ".concat(xField.name, ": xField.type = ").concat(xField.type, " not implemented for dropdown/autoComplete/searchButton");
|
|
272
278
|
}
|
|
273
279
|
// pridame sirku buttonu
|
|
274
280
|
if (formColumnType === "dropdown") {
|
|
@@ -276,14 +282,16 @@ var XUtilsMetadata = /** @class */ (function () {
|
|
|
276
282
|
width += 2; // button for dropdown
|
|
277
283
|
}
|
|
278
284
|
}
|
|
285
|
+
else if (formColumnType === "autoComplete") {
|
|
286
|
+
if (width !== undefined) {
|
|
287
|
+
width += 1.56; // button for auto complete
|
|
288
|
+
}
|
|
289
|
+
}
|
|
279
290
|
else if (formColumnType === "searchButton") {
|
|
280
291
|
if (width !== undefined) {
|
|
281
292
|
width += 2.18; // button for search button
|
|
282
293
|
}
|
|
283
294
|
}
|
|
284
|
-
else if (formColumnType === "autoComplete") {
|
|
285
|
-
throw "XField ".concat(xField.name, ": computing button width not implemented for autoComplete");
|
|
286
|
-
}
|
|
287
295
|
}
|
|
288
296
|
else {
|
|
289
297
|
throw "Unknown prop type = " + formColumnType;
|
|
@@ -297,7 +305,10 @@ var XUtilsMetadata = /** @class */ (function () {
|
|
|
297
305
|
}
|
|
298
306
|
// ak je label dlhsi ako sirka stlpca, tak sirka stlpca bude podla label-u
|
|
299
307
|
if (header !== undefined) {
|
|
300
|
-
var widthHeader = XUtilsMetadata.computeColumnWidthBase(header.length, 0.5
|
|
308
|
+
var widthHeader = XUtilsMetadata.computeColumnWidthBase(header.length, 0.5); // padding (7px)
|
|
309
|
+
if (sortableButtonInHeader && widthHeader !== undefined) {
|
|
310
|
+
widthHeader += 0.5 + 1.28; // sort icon (25px = 7px (space/margin) + 18px (icon body))
|
|
311
|
+
}
|
|
301
312
|
if (filterButtonInHeader && widthHeader !== undefined) {
|
|
302
313
|
widthHeader += 1.5; // filter icon (21px = 14px (icon body) + 7px (right padding))
|
|
303
314
|
}
|
|
@@ -342,6 +353,34 @@ var XUtilsMetadata = /** @class */ (function () {
|
|
|
342
353
|
}
|
|
343
354
|
return xAssoc;
|
|
344
355
|
};
|
|
356
|
+
XUtilsMetadata.getXAssocByAssocEntity = function (xEntity, assocMap, assocEntityName) {
|
|
357
|
+
var e_2, _a;
|
|
358
|
+
var xAssocFound = undefined;
|
|
359
|
+
try {
|
|
360
|
+
for (var _b = __values(Object.entries(assocMap)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
361
|
+
var _d = __read(_c.value, 2), key = _d[0], xAssoc = _d[1];
|
|
362
|
+
if (xAssoc.entityName === assocEntityName) {
|
|
363
|
+
if (xAssocFound === undefined) {
|
|
364
|
+
xAssocFound = xAssoc;
|
|
365
|
+
}
|
|
366
|
+
else {
|
|
367
|
+
throw "In entity ".concat(xEntity.name, " found more then 1 assoc for assocEntityName = ").concat(assocEntityName);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
373
|
+
finally {
|
|
374
|
+
try {
|
|
375
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
376
|
+
}
|
|
377
|
+
finally { if (e_2) throw e_2.error; }
|
|
378
|
+
}
|
|
379
|
+
if (xAssocFound === undefined) {
|
|
380
|
+
throw "Assoc for assocEntityName = ".concat(assocEntityName, " not found in entity ").concat(xEntity.name);
|
|
381
|
+
}
|
|
382
|
+
return xAssocFound;
|
|
383
|
+
};
|
|
345
384
|
XUtilsMetadata.getXEntityForAssoc = function (xAssoc) {
|
|
346
385
|
return XUtilsMetadata.getXEntity(xAssoc.entityName);
|
|
347
386
|
};
|
|
@@ -4,12 +4,20 @@ export declare enum ResultType {
|
|
|
4
4
|
RowCountAndPagedRows = 1,
|
|
5
5
|
AllRows = 2
|
|
6
6
|
}
|
|
7
|
+
export interface XCustomFilterValues {
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}
|
|
10
|
+
export interface XCustomFilter {
|
|
11
|
+
filter: string;
|
|
12
|
+
values: XCustomFilterValues;
|
|
13
|
+
}
|
|
7
14
|
export interface FindParam {
|
|
8
15
|
resultType: ResultType;
|
|
9
16
|
first?: number;
|
|
10
17
|
rows?: number;
|
|
11
|
-
filters
|
|
18
|
+
filters?: DataTableFilterMeta;
|
|
19
|
+
customFilter?: XCustomFilter;
|
|
12
20
|
multiSortMeta?: DataTableSortMeta[];
|
|
13
21
|
entity: string;
|
|
14
|
-
fields
|
|
22
|
+
fields?: string[];
|
|
15
23
|
}
|
|
@@ -7,5 +7,6 @@ export declare class XUtilsCommon {
|
|
|
7
7
|
static objectAsJSON(value: any): string;
|
|
8
8
|
static getDayName(date: Date | null | undefined): string | undefined;
|
|
9
9
|
static dateAddDays(date: Date | null, days: number): Date | null;
|
|
10
|
+
static findFirstMatch(pattern: RegExp, value: string): string | null;
|
|
10
11
|
}
|
|
11
12
|
export declare const dateFormat: any;
|
|
@@ -89,6 +89,10 @@ var XUtilsCommon = /** @class */ (function () {
|
|
|
89
89
|
}
|
|
90
90
|
return result;
|
|
91
91
|
};
|
|
92
|
+
XUtilsCommon.findFirstMatch = function (pattern, value) {
|
|
93
|
+
var match = pattern.exec(value);
|
|
94
|
+
return match != null ? match[0] : null;
|
|
95
|
+
};
|
|
92
96
|
XUtilsCommon.newLine = '\n';
|
|
93
97
|
return XUtilsCommon;
|
|
94
98
|
}());
|