@michalrakus/x-react-web-lib 1.35.2 → 1.36.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/lib/administration/XBrowseMetaForm.js +1 -2
- package/lib/administration/XParamForm.js +1 -2
- package/lib/administration/XUserForm.js +1 -2
- package/lib/components/XAutoCompleteBase.js +1 -2
- package/lib/components/XEditor.js +1 -2
- package/lib/components/XEnvVars.js +2 -2
- package/lib/components/XFieldSet/XFieldSetBase.js +3 -3
- package/lib/components/XFormDataTable2.js +1 -2
- package/lib/components/XInputFileList.js +1 -2
- package/lib/components/XInputTextarea.js +1 -2
- package/lib/components/XLazyDataTable/XLazyDataTable.js +1 -1
- package/lib/components/XMultiSelectBase.js +1 -2
- package/lib/components/XUtils.js +3 -4
- package/lib/components/XUtilsMetadata.js +1 -2
- package/lib/serverApi/ExportImportParam.js +6 -6
- package/lib/serverApi/FindParam.js +3 -3
- package/lib/serverApi/XUtilsCommon.d.ts +0 -1
- package/lib/serverApi/XUtilsCommon.js +15 -16
- package/lib/serverApi/XUtilsConversions.d.ts +2 -0
- package/lib/serverApi/XUtilsConversions.js +41 -17
- package/package.json +16 -15
|
@@ -31,7 +31,7 @@ var XInputText_1 = require("../components/XInputText");
|
|
|
31
31
|
var react_1 = __importDefault(require("react"));
|
|
32
32
|
var XFormDataTable2_1 = require("../components/XFormDataTable2");
|
|
33
33
|
var XFormFooter_1 = require("../components/XFormFooter");
|
|
34
|
-
var XBrowseMetaForm = /** @class */ (function (_super) {
|
|
34
|
+
var XBrowseMetaForm = exports.XBrowseMetaForm = /** @class */ (function (_super) {
|
|
35
35
|
__extends(XBrowseMetaForm, _super);
|
|
36
36
|
function XBrowseMetaForm() {
|
|
37
37
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
@@ -60,4 +60,3 @@ var XBrowseMetaForm = /** @class */ (function (_super) {
|
|
|
60
60
|
], XBrowseMetaForm);
|
|
61
61
|
return XBrowseMetaForm;
|
|
62
62
|
}(XFormBase_1.XFormBase));
|
|
63
|
-
exports.XBrowseMetaForm = XBrowseMetaForm;
|
|
@@ -33,7 +33,7 @@ var XInputDate_1 = require("../components/XInputDate");
|
|
|
33
33
|
var XInputText_1 = require("../components/XInputText");
|
|
34
34
|
var XFormFooter_1 = require("../components/XFormFooter");
|
|
35
35
|
var XFormHeader_1 = require("../components/XFormHeader");
|
|
36
|
-
var XParamForm = /** @class */ (function (_super) {
|
|
36
|
+
var XParamForm = exports.XParamForm = /** @class */ (function (_super) {
|
|
37
37
|
__extends(XParamForm, _super);
|
|
38
38
|
function XParamForm() {
|
|
39
39
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
@@ -59,4 +59,3 @@ var XParamForm = /** @class */ (function (_super) {
|
|
|
59
59
|
], XParamForm);
|
|
60
60
|
return XParamForm;
|
|
61
61
|
}(XFormBaseModif_1.XFormBaseModif));
|
|
62
|
-
exports.XParamForm = XParamForm;
|
|
@@ -76,7 +76,7 @@ var XEnvVars_1 = require("../components/XEnvVars");
|
|
|
76
76
|
var XFormBaseModif_1 = require("../components/XFormBaseModif");
|
|
77
77
|
var XInputDate_1 = require("../components/XInputDate");
|
|
78
78
|
var XFormHeader_1 = require("../components/XFormHeader");
|
|
79
|
-
var XUserForm = /** @class */ (function (_super) {
|
|
79
|
+
var XUserForm = exports.XUserForm = /** @class */ (function (_super) {
|
|
80
80
|
__extends(XUserForm, _super);
|
|
81
81
|
function XUserForm(props) {
|
|
82
82
|
var _this = _super.call(this, props) || this;
|
|
@@ -188,4 +188,3 @@ var XUserForm = /** @class */ (function (_super) {
|
|
|
188
188
|
], XUserForm);
|
|
189
189
|
return XUserForm;
|
|
190
190
|
}(XFormBaseModif_1.XFormBaseModif));
|
|
191
|
-
exports.XUserForm = XUserForm;
|
|
@@ -131,7 +131,7 @@ var button_1 = require("primereact/button");
|
|
|
131
131
|
var XUtilsCommon_1 = require("../serverApi/XUtilsCommon");
|
|
132
132
|
var XUtilsMetadataCommon_1 = require("../serverApi/XUtilsMetadataCommon");
|
|
133
133
|
var XFormDialog_1 = require("./XFormDialog");
|
|
134
|
-
var XAutoCompleteBase = /** @class */ (function (_super) {
|
|
134
|
+
var XAutoCompleteBase = exports.XAutoCompleteBase = /** @class */ (function (_super) {
|
|
135
135
|
__extends(XAutoCompleteBase, _super);
|
|
136
136
|
function XAutoCompleteBase(props) {
|
|
137
137
|
var _this = _super.call(this, props) || this;
|
|
@@ -762,4 +762,3 @@ var XAutoCompleteBase = /** @class */ (function (_super) {
|
|
|
762
762
|
};
|
|
763
763
|
return XAutoCompleteBase;
|
|
764
764
|
}(react_1.Component));
|
|
765
|
-
exports.XAutoCompleteBase = XAutoCompleteBase;
|
|
@@ -23,7 +23,7 @@ var react_1 = __importDefault(require("react"));
|
|
|
23
23
|
var XInput_1 = require("./XInput");
|
|
24
24
|
var XUtils_1 = require("./XUtils");
|
|
25
25
|
var XEditorBase_1 = require("./XEditorBase");
|
|
26
|
-
var XEditor = /** @class */ (function (_super) {
|
|
26
|
+
var XEditor = exports.XEditor = /** @class */ (function (_super) {
|
|
27
27
|
__extends(XEditor, _super);
|
|
28
28
|
function XEditor(props) {
|
|
29
29
|
var _this = _super.call(this, props) || this;
|
|
@@ -61,4 +61,3 @@ var XEditor = /** @class */ (function (_super) {
|
|
|
61
61
|
};
|
|
62
62
|
return XEditor;
|
|
63
63
|
}(XInput_1.XInput));
|
|
64
|
-
exports.XEditor = XEditor;
|
|
@@ -14,7 +14,7 @@ var XEnvVar;
|
|
|
14
14
|
XEnvVar["REACT_APP_MS_ENTRA_ID_TENANT_ID"] = "REACT_APP_MS_ENTRA_ID_TENANT_ID";
|
|
15
15
|
XEnvVar["REACT_APP_MS_ENTRA_ID_CLIENT_ID"] = "REACT_APP_MS_ENTRA_ID_CLIENT_ID";
|
|
16
16
|
XEnvVar["REACT_APP_MS_ENTRA_ID_BACKEND_SCOPE"] = "REACT_APP_MS_ENTRA_ID_BACKEND_SCOPE";
|
|
17
|
-
})(XEnvVar
|
|
17
|
+
})(XEnvVar || (exports.XEnvVar = XEnvVar = {}));
|
|
18
18
|
// enum for values of the environment variable REACT_APP_AUTH
|
|
19
19
|
var XReactAppAuth;
|
|
20
20
|
(function (XReactAppAuth) {
|
|
@@ -22,4 +22,4 @@ var XReactAppAuth;
|
|
|
22
22
|
XReactAppAuth["LOCAL"] = "LOCAL";
|
|
23
23
|
XReactAppAuth["AUTH0"] = "AUTH0";
|
|
24
24
|
XReactAppAuth["MS_ENTRA_ID"] = "MS_ENTRA_ID";
|
|
25
|
-
})(XReactAppAuth
|
|
25
|
+
})(XReactAppAuth || (exports.XReactAppAuth = XReactAppAuth = {}));
|
|
@@ -38,7 +38,7 @@ var XFieldType;
|
|
|
38
38
|
XFieldType["checkboxNullable"] = "checkboxNullable";
|
|
39
39
|
XFieldType["inputText"] = "inputText";
|
|
40
40
|
XFieldType["inputDecimal"] = "inputDecimal";
|
|
41
|
-
})(XFieldType
|
|
41
|
+
})(XFieldType || (exports.XFieldType = XFieldType = {}));
|
|
42
42
|
// children layout sa da nastavit len na type, ktory ma children - rootField, fieldGroup
|
|
43
43
|
var XChildrenLayout;
|
|
44
44
|
(function (XChildrenLayout) {
|
|
@@ -46,7 +46,7 @@ var XChildrenLayout;
|
|
|
46
46
|
XChildrenLayout["row"] = "row";
|
|
47
47
|
XChildrenLayout["tabView"] = "tabView";
|
|
48
48
|
XChildrenLayout["tabViewWithHeaderGroup"] = "tabViewWithHeaderGroup"; // to iste co tabView ale prvy fieldGroup (0-ty tab) zobrazi nad tabView (aby bol vzdy pristupny)
|
|
49
|
-
})(XChildrenLayout
|
|
49
|
+
})(XChildrenLayout || (exports.XChildrenLayout = XChildrenLayout = {}));
|
|
50
50
|
// poznamka - tabView a tabViewWithHeaderGroup odignoruju bezne simple children - ak take budu existovat, zobrazi sa uzivatelovi warning pri nastaveni tabView
|
|
51
51
|
// pouzijeme len checkbox supressFieldGroupPanel
|
|
52
52
|
// pouziva sa len pre typ fieldGroup a len v pripade ak dany fieldGroup nie je vyrenderovany v nejakej tab-ke (jeho parent ma nastaveny layout tabView*)
|
|
@@ -58,7 +58,7 @@ var XFieldPropValuesFrom;
|
|
|
58
58
|
(function (XFieldPropValuesFrom) {
|
|
59
59
|
XFieldPropValuesFrom["parent"] = "parent";
|
|
60
60
|
XFieldPropValuesFrom["this"] = "this"; // field prop values preberame z current fieldu
|
|
61
|
-
})(XFieldPropValuesFrom
|
|
61
|
+
})(XFieldPropValuesFrom || (exports.XFieldPropValuesFrom = XFieldPropValuesFrom = {}));
|
|
62
62
|
// zatial provizorne len na staticke metody
|
|
63
63
|
var XFieldSetBase = /** @class */ (function () {
|
|
64
64
|
function XFieldSetBase() {
|
|
@@ -84,7 +84,7 @@ var XLocale_1 = require("./XLocale");
|
|
|
84
84
|
var XInputIntervalDT_1 = require("./XInputIntervalDT");
|
|
85
85
|
var XUtilsMetadataCommon_1 = require("../serverApi/XUtilsMetadataCommon");
|
|
86
86
|
var XInputTextareaDT_1 = require("./XInputTextareaDT");
|
|
87
|
-
var XFormDataTable2 = /** @class */ (function (_super) {
|
|
87
|
+
var XFormDataTable2 = exports.XFormDataTable2 = /** @class */ (function (_super) {
|
|
88
88
|
__extends(XFormDataTable2, _super);
|
|
89
89
|
function XFormDataTable2(props) {
|
|
90
90
|
var e_1, _a;
|
|
@@ -728,7 +728,6 @@ var XFormDataTable2 = /** @class */ (function (_super) {
|
|
|
728
728
|
};
|
|
729
729
|
return XFormDataTable2;
|
|
730
730
|
}(react_1.Component));
|
|
731
|
-
exports.XFormDataTable2 = XFormDataTable2;
|
|
732
731
|
// default props for XFormColumnBaseProps
|
|
733
732
|
var XFormColumnBase_defaultProps = {
|
|
734
733
|
columnViewStatus: true
|
|
@@ -76,7 +76,7 @@ var XUtilsConversions_1 = require("../serverApi/XUtilsConversions");
|
|
|
76
76
|
var XLocale_1 = require("./XLocale");
|
|
77
77
|
var XUtilsMetadataCommon_1 = require("../serverApi/XUtilsMetadataCommon");
|
|
78
78
|
// notice: in skch there is new version XInputFileList2 and that version don´t use fetch api because fetch api does not support progress bar
|
|
79
|
-
var XInputFileList = /** @class */ (function (_super) {
|
|
79
|
+
var XInputFileList = exports.XInputFileList = /** @class */ (function (_super) {
|
|
80
80
|
__extends(XInputFileList, _super);
|
|
81
81
|
function XInputFileList(props) {
|
|
82
82
|
var _this = _super.call(this, props) || this;
|
|
@@ -227,4 +227,3 @@ var XInputFileList = /** @class */ (function (_super) {
|
|
|
227
227
|
};
|
|
228
228
|
return XInputFileList;
|
|
229
229
|
}(react_2.Component));
|
|
230
|
-
exports.XInputFileList = XInputFileList;
|
|
@@ -24,7 +24,7 @@ var XInput_1 = require("./XInput");
|
|
|
24
24
|
var XUtils_1 = require("./XUtils");
|
|
25
25
|
var XInputTextareaBase_1 = require("./XInputTextareaBase");
|
|
26
26
|
var tooltip_1 = require("primereact/tooltip");
|
|
27
|
-
var XInputTextarea = /** @class */ (function (_super) {
|
|
27
|
+
var XInputTextarea = exports.XInputTextarea = /** @class */ (function (_super) {
|
|
28
28
|
__extends(XInputTextarea, _super);
|
|
29
29
|
function XInputTextarea(props) {
|
|
30
30
|
var _this = _super.call(this, props) || this;
|
|
@@ -107,4 +107,3 @@ var XInputTextarea = /** @class */ (function (_super) {
|
|
|
107
107
|
};
|
|
108
108
|
return XInputTextarea;
|
|
109
109
|
}(XInput_1.XInput));
|
|
110
|
-
exports.XInputTextarea = XInputTextarea;
|
|
@@ -159,7 +159,7 @@ var XStateKeySuffix;
|
|
|
159
159
|
XStateKeySuffix["pagingFirst"] = "paging-first";
|
|
160
160
|
XStateKeySuffix["selectedRow"] = "selected-row";
|
|
161
161
|
XStateKeySuffix["multilineSwitchValue"] = "multiline-switch-value";
|
|
162
|
-
})(XStateKeySuffix
|
|
162
|
+
})(XStateKeySuffix || (exports.XStateKeySuffix = XStateKeySuffix = {}));
|
|
163
163
|
exports.XLazyDataTable = (0, react_1.forwardRef)(function (_a, ref) {
|
|
164
164
|
var _b;
|
|
165
165
|
var _c = _a.paginator, paginator = _c === void 0 ? true : _c, _d = _a.rows, rows = _d === void 0 ? 30 : _d, _e = _a.filterDisplay, filterDisplay = _e === void 0 ? "row" : _e, _f = _a.autoFilter, autoFilter = _f === void 0 ? false : _f, _g = _a.showFilterButtons, showFilterButtons = _g === void 0 ? true : _g, _h = _a.fullTextSearch, fullTextSearch = _h === void 0 ? true : _h, _j = _a.multilineSwitch, multilineSwitch = _j === void 0 ? false : _j, _k = _a.multilineSwitchInitValue, multilineSwitchInitValue = _k === void 0 ? "allLines" : _k, _l = _a.multilineSwitchFewLinesCount, multilineSwitchFewLinesCount = _l === void 0 ? 2 : _l, _m = _a.scrollable, scrollable = _m === void 0 ? true : _m, _o = _a.scrollWidth, scrollWidth = _o === void 0 ? 'viewport' : _o, // nastavi sirku tabulky na (100vw - nieco) (ak bude obsah sirsi, zapne horizontalny scrollbar)
|
|
@@ -90,7 +90,7 @@ var react_1 = __importStar(require("react"));
|
|
|
90
90
|
var XUtils_1 = require("./XUtils");
|
|
91
91
|
var XUtilsMetadataCommon_1 = require("../serverApi/XUtilsMetadataCommon");
|
|
92
92
|
var multiselect_1 = require("primereact/multiselect");
|
|
93
|
-
var XMultiSelectBase = /** @class */ (function (_super) {
|
|
93
|
+
var XMultiSelectBase = exports.XMultiSelectBase = /** @class */ (function (_super) {
|
|
94
94
|
__extends(XMultiSelectBase, _super);
|
|
95
95
|
function XMultiSelectBase(props) {
|
|
96
96
|
var _this = _super.call(this, props) || this;
|
|
@@ -142,4 +142,3 @@ var XMultiSelectBase = /** @class */ (function (_super) {
|
|
|
142
142
|
};
|
|
143
143
|
return XMultiSelectBase;
|
|
144
144
|
}(react_1.Component));
|
|
145
|
-
exports.XMultiSelectBase = XMultiSelectBase;
|
package/lib/components/XUtils.js
CHANGED
|
@@ -88,14 +88,14 @@ var OperationType;
|
|
|
88
88
|
OperationType[OperationType["Insert"] = 1] = "Insert";
|
|
89
89
|
OperationType[OperationType["Update"] = 2] = "Update";
|
|
90
90
|
OperationType[OperationType["Remove"] = 3] = "Remove";
|
|
91
|
-
})(OperationType
|
|
91
|
+
})(OperationType || (exports.OperationType = OperationType = {}));
|
|
92
92
|
var XViewStatus;
|
|
93
93
|
(function (XViewStatus) {
|
|
94
94
|
XViewStatus["ReadWrite"] = "readWrite";
|
|
95
95
|
XViewStatus["ReadOnly"] = "readOnly";
|
|
96
96
|
XViewStatus["Hidden"] = "hidden";
|
|
97
|
-
})(XViewStatus
|
|
98
|
-
var XUtils = /** @class */ (function () {
|
|
97
|
+
})(XViewStatus || (exports.XViewStatus = XViewStatus = {}));
|
|
98
|
+
var XUtils = exports.XUtils = /** @class */ (function () {
|
|
99
99
|
function XUtils() {
|
|
100
100
|
}
|
|
101
101
|
XUtils.demo = function () {
|
|
@@ -903,4 +903,3 @@ var XUtils = /** @class */ (function () {
|
|
|
903
903
|
XUtils.VERSION_CHECK_PERIOD = 10 * 60 * 1000; // 10 minutes in milliseconds
|
|
904
904
|
return XUtils;
|
|
905
905
|
}());
|
|
906
|
-
exports.XUtils = XUtils;
|
|
@@ -42,7 +42,7 @@ var XUtilsMetadataCommon_1 = require("../serverApi/XUtilsMetadataCommon");
|
|
|
42
42
|
// idelany nazov: UtilsEntityMetadata - ale strasne dlhy
|
|
43
43
|
// tato funkcionalita by mala ist bud do tried XEntity, XField alebo lepsie do nejakeho servisu
|
|
44
44
|
// ekvivalentna funkcionalita sa nachadza aj na servri v servise XEntityMetadataService.ts (TODO - v buducnosti spravit spolocnu triedu/servis)
|
|
45
|
-
var XUtilsMetadata = /** @class */ (function () {
|
|
45
|
+
var XUtilsMetadata = exports.XUtilsMetadata = /** @class */ (function () {
|
|
46
46
|
function XUtilsMetadata() {
|
|
47
47
|
}
|
|
48
48
|
XUtilsMetadata.fetchAndSetXEntityMap = function () {
|
|
@@ -275,4 +275,3 @@ var XUtilsMetadata = /** @class */ (function () {
|
|
|
275
275
|
XUtilsMetadata.CHAR_SIZE = 0.5; // 0.5rem (7px) - skusime
|
|
276
276
|
return XUtilsMetadata;
|
|
277
277
|
}());
|
|
278
|
-
exports.XUtilsMetadata = XUtilsMetadata;
|
|
@@ -7,27 +7,27 @@ var ExportType;
|
|
|
7
7
|
ExportType["Excel"] = "excel";
|
|
8
8
|
ExportType["Csv"] = "csv";
|
|
9
9
|
ExportType["Json"] = "json";
|
|
10
|
-
})(ExportType
|
|
10
|
+
})(ExportType || (exports.ExportType = ExportType = {}));
|
|
11
11
|
// exportovanie hodnot z toMany asociacii, pripadne viacriadkovych textov
|
|
12
12
|
var XMultilineExportType;
|
|
13
13
|
(function (XMultilineExportType) {
|
|
14
14
|
XMultilineExportType["Singleline"] = "singleline";
|
|
15
15
|
XMultilineExportType["Multiline"] = "multiline";
|
|
16
16
|
XMultilineExportType["Off"] = "off"; // stlpce obsahujuce viac hodnot/riadkov sa vynechaju z exportu
|
|
17
|
-
})(XMultilineExportType
|
|
17
|
+
})(XMultilineExportType || (exports.XMultilineExportType = XMultilineExportType = {}));
|
|
18
18
|
// vo windowse zavisi od regionalnych nastaveni, default nastavenie je ";" a preto vecsinou aj excel produkuje csv s ";" (menej sa to bije s decimalmi)
|
|
19
19
|
// takze primarne pouzivame ";" a sekundarne "," napr. pri generickom exporte do csv davame uzivatelovi na vyber
|
|
20
20
|
var CsvSeparator;
|
|
21
21
|
(function (CsvSeparator) {
|
|
22
22
|
CsvSeparator["Semicolon"] = ";";
|
|
23
23
|
CsvSeparator["Comma"] = ",";
|
|
24
|
-
})(CsvSeparator
|
|
24
|
+
})(CsvSeparator || (exports.CsvSeparator = CsvSeparator = {}));
|
|
25
25
|
// decimal format pouzivany pri exporte do csv
|
|
26
26
|
var CsvDecimalFormat;
|
|
27
27
|
(function (CsvDecimalFormat) {
|
|
28
28
|
CsvDecimalFormat["Comma"] = "123456,78";
|
|
29
29
|
CsvDecimalFormat["Dot"] = "123456.78";
|
|
30
|
-
})(CsvDecimalFormat
|
|
30
|
+
})(CsvDecimalFormat || (exports.CsvDecimalFormat = CsvDecimalFormat = {}));
|
|
31
31
|
// zatial len tieto 2, ak bude treba, tak pridat napr. win1252 (Western Europe)
|
|
32
32
|
// win1250 pouzivame ako default, lebo Excel automaticky predpoklada kodovanie win1250
|
|
33
33
|
// konstanty sa pouzivaju priamo v kniznici iconv-lite
|
|
@@ -35,10 +35,10 @@ var CsvEncoding;
|
|
|
35
35
|
(function (CsvEncoding) {
|
|
36
36
|
CsvEncoding["Utf8"] = "utf-8";
|
|
37
37
|
CsvEncoding["Win1250"] = "win1250";
|
|
38
|
-
})(CsvEncoding
|
|
38
|
+
})(CsvEncoding || (exports.CsvEncoding = CsvEncoding = {}));
|
|
39
39
|
// ************** import ***************
|
|
40
40
|
var ImportType;
|
|
41
41
|
(function (ImportType) {
|
|
42
42
|
ImportType["Csv"] = "csv";
|
|
43
43
|
ImportType["Json"] = "json";
|
|
44
|
-
})(ImportType
|
|
44
|
+
})(ImportType || (exports.ImportType = ImportType = {}));
|
|
@@ -7,17 +7,17 @@ var ResultType;
|
|
|
7
7
|
ResultType[ResultType["OnlyPagedRows"] = 1] = "OnlyPagedRows";
|
|
8
8
|
ResultType[ResultType["RowCountAndPagedRows"] = 2] = "RowCountAndPagedRows";
|
|
9
9
|
ResultType[ResultType["AllRows"] = 3] = "AllRows";
|
|
10
|
-
})(ResultType
|
|
10
|
+
})(ResultType || (exports.ResultType = ResultType = {}));
|
|
11
11
|
// additional match modes (extension to primereact enum FilterMatchMode)
|
|
12
12
|
var XFilterMatchMode;
|
|
13
13
|
(function (XFilterMatchMode) {
|
|
14
14
|
XFilterMatchMode["X_AUTO_COMPLETE"] = "xAutoComplete";
|
|
15
15
|
XFilterMatchMode["X_FILTER_ELEMENT"] = "xFilterElement"; // custom filter element (defined in filterElement property)
|
|
16
|
-
})(XFilterMatchMode
|
|
16
|
+
})(XFilterMatchMode || (exports.XFilterMatchMode = XFilterMatchMode = {}));
|
|
17
17
|
var XAggregateFunction;
|
|
18
18
|
(function (XAggregateFunction) {
|
|
19
19
|
XAggregateFunction["Min"] = "MIN";
|
|
20
20
|
XAggregateFunction["Max"] = "MAX";
|
|
21
21
|
XAggregateFunction["Sum"] = "SUM";
|
|
22
22
|
XAggregateFunction["Avg"] = "AVG";
|
|
23
|
-
})(XAggregateFunction
|
|
23
|
+
})(XAggregateFunction || (exports.XAggregateFunction = XAggregateFunction = {}));
|
|
@@ -36,16 +36,17 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
36
36
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.
|
|
39
|
+
exports.XUtilsCommon = void 0;
|
|
40
40
|
var XUtilsMetadataCommon_1 = require("./XUtilsMetadataCommon");
|
|
41
41
|
var XUtilsConversions_1 = require("./XUtilsConversions");
|
|
42
|
-
//
|
|
43
|
-
var XUtilsCommon = /** @class */ (function () {
|
|
42
|
+
// common functions for frontend and backend
|
|
43
|
+
var XUtilsCommon = exports.XUtilsCommon = /** @class */ (function () {
|
|
44
44
|
function XUtilsCommon() {
|
|
45
45
|
}
|
|
46
46
|
// TODO - toto by sme mohli doplnit o kontrolu ak programator urobil preklep
|
|
47
47
|
XUtilsCommon.getValueByPath = function (object, path) {
|
|
48
|
-
var _a
|
|
48
|
+
var _a;
|
|
49
|
+
var field = (_a = __read(XUtilsCommon.getFieldAndRestPath(path), 2), _a[0]), restPath = _a[1];
|
|
49
50
|
if (restPath === null) {
|
|
50
51
|
return object[field];
|
|
51
52
|
}
|
|
@@ -63,8 +64,8 @@ var XUtilsCommon = /** @class */ (function () {
|
|
|
63
64
|
// vseobecnejsia verzia, ktora funguje aj pre *toMany asociacie
|
|
64
65
|
// TODO - toto by sme mohli doplnit o kontrolu ak programator urobil preklep
|
|
65
66
|
XUtilsCommon.getValueOrValueListByPath = function (object, path) {
|
|
66
|
-
var e_1,
|
|
67
|
-
var
|
|
67
|
+
var _a, e_1, _b;
|
|
68
|
+
var field = (_a = __read(XUtilsCommon.getFieldAndRestPath(path), 2), _a[0]), restPath = _a[1];
|
|
68
69
|
if (restPath === null) {
|
|
69
70
|
return object[field];
|
|
70
71
|
}
|
|
@@ -93,7 +94,7 @@ var XUtilsCommon = /** @class */ (function () {
|
|
|
93
94
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
94
95
|
finally {
|
|
95
96
|
try {
|
|
96
|
-
if (assocObject_1_1 && !assocObject_1_1.done && (
|
|
97
|
+
if (assocObject_1_1 && !assocObject_1_1.done && (_b = assocObject_1.return)) _b.call(assocObject_1);
|
|
97
98
|
}
|
|
98
99
|
finally { if (e_1) throw e_1.error; }
|
|
99
100
|
}
|
|
@@ -111,7 +112,8 @@ var XUtilsCommon = /** @class */ (function () {
|
|
|
111
112
|
}
|
|
112
113
|
};
|
|
113
114
|
XUtilsCommon.setValueByPath = function (object, path, value) {
|
|
114
|
-
var _a
|
|
115
|
+
var _a;
|
|
116
|
+
var pathToAssoc = (_a = __read(XUtilsCommon.getPathToAssocAndField(path), 2), _a[0]), field = _a[1];
|
|
115
117
|
if (pathToAssoc !== null) {
|
|
116
118
|
var assocObject = XUtilsCommon.getValueByPath(object, pathToAssoc);
|
|
117
119
|
// if null or undefined or is not object, then error
|
|
@@ -195,10 +197,10 @@ var XUtilsCommon = /** @class */ (function () {
|
|
|
195
197
|
return displayValue;
|
|
196
198
|
};
|
|
197
199
|
XUtilsCommon.createDisplayValueForField = function (object, xEntity, field) {
|
|
198
|
-
var e_3,
|
|
200
|
+
var _a, e_3, _b;
|
|
199
201
|
// pouziva sa podobny algoritmus ako v XLazyDataTable - metoda bodyTemplate
|
|
200
202
|
// (ale nie je to take komplexne ako v XLazyDataTable - nevie renderovat napr. html (rich text))
|
|
201
|
-
var
|
|
203
|
+
var prefix = (_a = __read(XUtilsCommon.getPrefixAndField(field), 2), _a[0]), fieldOnly = _a[1];
|
|
202
204
|
var xField = undefined;
|
|
203
205
|
if (xEntity) {
|
|
204
206
|
xField = XUtilsMetadataCommon_1.XUtilsMetadataCommon.getXFieldByPath(xEntity, fieldOnly);
|
|
@@ -223,7 +225,7 @@ var XUtilsCommon = /** @class */ (function () {
|
|
|
223
225
|
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
224
226
|
finally {
|
|
225
227
|
try {
|
|
226
|
-
if (valueOrValueList_1_1 && !valueOrValueList_1_1.done && (
|
|
228
|
+
if (valueOrValueList_1_1 && !valueOrValueList_1_1.done && (_b = valueOrValueList_1.return)) _b.call(valueOrValueList_1);
|
|
227
229
|
}
|
|
228
230
|
finally { if (e_3) throw e_3.error; }
|
|
229
231
|
}
|
|
@@ -259,11 +261,11 @@ var XUtilsCommon = /** @class */ (function () {
|
|
|
259
261
|
// TODO - ak pre datetime nastavime vsetky zlozky casu na 00:00:00, tak sformatuje hodnotu ako datum a spravi chybu pri zapise do DB - zapise 1:00:00
|
|
260
262
|
var dateStr;
|
|
261
263
|
if (this.getHours() === 0 && this.getMinutes() === 0 && this.getSeconds() === 0) {
|
|
262
|
-
dateStr = (0,
|
|
264
|
+
dateStr = (0, XUtilsConversions_1.dateFormat)(this, 'yyyy-MM-dd');
|
|
263
265
|
}
|
|
264
266
|
else {
|
|
265
267
|
// jedna sa o datetime
|
|
266
|
-
dateStr = (0,
|
|
268
|
+
dateStr = (0, XUtilsConversions_1.datetimeFormat)(this, 'yyyy-MM-dd HH:mm:ss');
|
|
267
269
|
}
|
|
268
270
|
return dateStr;
|
|
269
271
|
};
|
|
@@ -558,6 +560,3 @@ var XUtilsCommon = /** @class */ (function () {
|
|
|
558
560
|
XUtilsCommon.newLine = '\n';
|
|
559
561
|
return XUtilsCommon;
|
|
560
562
|
}());
|
|
561
|
-
exports.XUtilsCommon = XUtilsCommon;
|
|
562
|
-
// nevedel som importnut dateFormat, tak som to dal sem aby som nemusel vsade pouzivat require("dateformat")
|
|
563
|
-
exports.dateFormat = require("dateformat");
|
|
@@ -17,7 +17,9 @@ export declare function dateFromUI(valueString: string, dateScale?: XDateScale):
|
|
|
17
17
|
export declare function dateAsUI(value: Date | null, dateScale?: XDateScale): string;
|
|
18
18
|
export declare function dateAsYYYY_MM_DD(date: Date): string;
|
|
19
19
|
export declare function dateAsDB(date: Date | null): string;
|
|
20
|
+
export declare function dateFormat(date: Date, format: string): string;
|
|
20
21
|
export declare function datetimeAsUI(value: Date | null): string;
|
|
22
|
+
export declare function datetimeFormat(date: Date, format: string): string;
|
|
21
23
|
export declare function timeFromModel(value: any): Date | null;
|
|
22
24
|
export declare function dateFormatUI(dateScale?: XDateScale): string;
|
|
23
25
|
export declare function dateFormatCalendar(dateScale?: XDateScale): string;
|
|
@@ -27,7 +27,7 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
27
27
|
return ar;
|
|
28
28
|
};
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.convertValueBase = exports.convertValue = exports.convertObject = exports.AsUIType = exports.booleanAsUIText = exports.intervalAsUI = exports.intervalFromUI = exports.datetimeFormatUI = exports.dateFormatCalendar = exports.dateFormatUI = exports.timeFromModel = exports.datetimeAsUI = exports.dateAsDB = exports.dateAsYYYY_MM_DD = exports.dateAsUI = exports.dateFromUI = exports.dateFromModel = exports.XDateScale = exports.numberFromString = exports.numberFromModel = exports.numberAsUI = exports.intFromUI = exports.stringAsDB = exports.stringAsUI = exports.stringFromUI = void 0;
|
|
30
|
+
exports.convertValueBase = exports.convertValue = exports.convertObject = exports.AsUIType = exports.booleanAsUIText = exports.intervalAsUI = exports.intervalFromUI = exports.datetimeFormatUI = exports.dateFormatCalendar = exports.dateFormatUI = exports.timeFromModel = exports.datetimeFormat = exports.datetimeAsUI = exports.dateFormat = exports.dateAsDB = exports.dateAsYYYY_MM_DD = exports.dateAsUI = exports.dateFromUI = exports.dateFromModel = exports.XDateScale = exports.numberFromString = exports.numberFromModel = exports.numberAsUI = exports.intFromUI = exports.stringAsDB = exports.stringAsUI = exports.stringFromUI = void 0;
|
|
31
31
|
var XUtilsCommon_1 = require("./XUtilsCommon");
|
|
32
32
|
var XLocale_1 = require("../components/XLocale");
|
|
33
33
|
var XUtilsMetadataCommon_1 = require("./XUtilsMetadataCommon");
|
|
@@ -110,7 +110,7 @@ var XDateScale;
|
|
|
110
110
|
XDateScale[XDateScale["Date"] = 1] = "Date";
|
|
111
111
|
XDateScale[XDateScale["Month"] = 2] = "Month";
|
|
112
112
|
XDateScale[XDateScale["Year"] = 3] = "Year"; // yyyy
|
|
113
|
-
})(XDateScale
|
|
113
|
+
})(XDateScale || (exports.XDateScale = XDateScale = {}));
|
|
114
114
|
//export type XDateType = "month" | "year" | "date";
|
|
115
115
|
// v modeli na klientovi by mal byt vzdy Date, teraz je tam niekedy string (z json-u zo servera) a niekedy Date (z komponentu)
|
|
116
116
|
// provizorne zatial takato konverzia
|
|
@@ -208,7 +208,7 @@ exports.dateFromUI = dateFromUI;
|
|
|
208
208
|
function dateAsUI(value, dateScale) {
|
|
209
209
|
if (dateScale === void 0) { dateScale = XDateScale.Date; }
|
|
210
210
|
if (value !== null) {
|
|
211
|
-
return
|
|
211
|
+
return dateFormat(value, dateFormatUI(dateScale));
|
|
212
212
|
}
|
|
213
213
|
else {
|
|
214
214
|
return "";
|
|
@@ -217,30 +217,54 @@ function dateAsUI(value, dateScale) {
|
|
|
217
217
|
exports.dateAsUI = dateAsUI;
|
|
218
218
|
// specialna funkcia - konvertuje Date na string YYYY-MM-DD
|
|
219
219
|
function dateAsYYYY_MM_DD(date) {
|
|
220
|
-
|
|
221
|
-
if (monthStr.length < 2) {
|
|
222
|
-
monthStr = "0" + monthStr;
|
|
223
|
-
}
|
|
224
|
-
var dayStr = date.getDate().toString();
|
|
225
|
-
if (dayStr.length < 2) {
|
|
226
|
-
dayStr = "0" + dayStr;
|
|
227
|
-
}
|
|
228
|
-
return "".concat(date.getFullYear(), "-").concat(monthStr, "-").concat(dayStr);
|
|
220
|
+
return dateFormat(date, 'yyyy-MM-dd');
|
|
229
221
|
}
|
|
230
222
|
exports.dateAsYYYY_MM_DD = dateAsYYYY_MM_DD;
|
|
231
223
|
function dateAsDB(date) {
|
|
232
224
|
return date !== null ? "'".concat(dateAsYYYY_MM_DD(date), "'::DATE") : "NULL::DATE";
|
|
233
225
|
}
|
|
234
226
|
exports.dateAsDB = dateAsDB;
|
|
227
|
+
// the same like function format(this, 'yyyy-MM-dd');
|
|
228
|
+
function dateFormat(date, format) {
|
|
229
|
+
var pad = function (num) { return num.toString().padStart(2, '0'); };
|
|
230
|
+
var year = date.getFullYear();
|
|
231
|
+
var month = pad(date.getMonth() + 1); // Months are zero-based
|
|
232
|
+
var day = pad(date.getDate());
|
|
233
|
+
var value = format;
|
|
234
|
+
value = value.replace('yyyy', "".concat(year));
|
|
235
|
+
value = value.replace('MM', month);
|
|
236
|
+
value = value.replace('dd', day);
|
|
237
|
+
return value;
|
|
238
|
+
}
|
|
239
|
+
exports.dateFormat = dateFormat;
|
|
235
240
|
function datetimeAsUI(value) {
|
|
236
241
|
if (value !== null) {
|
|
237
|
-
return (
|
|
242
|
+
return datetimeFormat(value, datetimeFormatUI());
|
|
238
243
|
}
|
|
239
244
|
else {
|
|
240
245
|
return "";
|
|
241
246
|
}
|
|
242
247
|
}
|
|
243
248
|
exports.datetimeAsUI = datetimeAsUI;
|
|
249
|
+
// the same like function format(this, 'yyyy-MM-dd HH:mm:ss');
|
|
250
|
+
function datetimeFormat(date, format) {
|
|
251
|
+
var pad = function (num) { return num.toString().padStart(2, '0'); };
|
|
252
|
+
var year = date.getFullYear();
|
|
253
|
+
var month = pad(date.getMonth() + 1); // Months are zero-based
|
|
254
|
+
var day = pad(date.getDate());
|
|
255
|
+
var hours = pad(date.getHours());
|
|
256
|
+
var minutes = pad(date.getMinutes());
|
|
257
|
+
var seconds = pad(date.getSeconds());
|
|
258
|
+
var value = format;
|
|
259
|
+
value = value.replace('yyyy', "".concat(year));
|
|
260
|
+
value = value.replace('MM', month);
|
|
261
|
+
value = value.replace('dd', day);
|
|
262
|
+
value = value.replace('HH', hours);
|
|
263
|
+
value = value.replace('mm', minutes);
|
|
264
|
+
value = value.replace('ss', seconds);
|
|
265
|
+
return value;
|
|
266
|
+
}
|
|
267
|
+
exports.datetimeFormat = datetimeFormat;
|
|
244
268
|
// provizorne zatial takato konverzia
|
|
245
269
|
function timeFromModel(value) {
|
|
246
270
|
var timeValue = null;
|
|
@@ -272,10 +296,10 @@ function dateFormatUI(dateScale) {
|
|
|
272
296
|
if (dateScale === void 0) { dateScale = XDateScale.Date; }
|
|
273
297
|
var format;
|
|
274
298
|
if (dateScale === XDateScale.Date) {
|
|
275
|
-
format = "dd.
|
|
299
|
+
format = "dd.MM.yyyy";
|
|
276
300
|
}
|
|
277
301
|
else if (dateScale === XDateScale.Month) {
|
|
278
|
-
format = "
|
|
302
|
+
format = "MM.yyyy";
|
|
279
303
|
}
|
|
280
304
|
else if (dateScale === XDateScale.Year) {
|
|
281
305
|
format = "yyyy";
|
|
@@ -305,7 +329,7 @@ function dateFormatCalendar(dateScale) {
|
|
|
305
329
|
}
|
|
306
330
|
exports.dateFormatCalendar = dateFormatCalendar;
|
|
307
331
|
function datetimeFormatUI() {
|
|
308
|
-
return "dd.
|
|
332
|
+
return "dd.MM.yyyy HH:mm:ss";
|
|
309
333
|
}
|
|
310
334
|
exports.datetimeFormatUI = datetimeFormatUI;
|
|
311
335
|
function intervalFromUI(valueString) {
|
|
@@ -374,7 +398,7 @@ var AsUIType;
|
|
|
374
398
|
AsUIType[AsUIType["Form"] = 1] = "Form";
|
|
375
399
|
AsUIType[AsUIType["Text"] = 2] = "Text";
|
|
376
400
|
AsUIType[AsUIType["Excel"] = 3] = "Excel"; // excel - nie vsetko konvertujeme do string-u, vecsinou zostavame pri typoch number, Date
|
|
377
|
-
})(AsUIType
|
|
401
|
+
})(AsUIType || (exports.AsUIType = AsUIType = {}));
|
|
378
402
|
/**
|
|
379
403
|
* converts values of object
|
|
380
404
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@michalrakus/x-react-web-lib",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.36.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"clean": "rimraf lib",
|
|
@@ -19,28 +19,29 @@
|
|
|
19
19
|
},
|
|
20
20
|
"author": "Michal Rakus",
|
|
21
21
|
"license": "MIT",
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=20"
|
|
24
|
+
},
|
|
22
25
|
"dependencies": {
|
|
23
|
-
"dateformat": "^4.6.3",
|
|
24
26
|
"lodash": "^4.17.21"
|
|
25
27
|
},
|
|
26
28
|
"devDependencies": {
|
|
27
|
-
"@testing-library/jest-dom": "^
|
|
28
|
-
"@testing-library/react": "^14.
|
|
29
|
-
"@testing-library/user-event": "^14.
|
|
30
|
-
"@types/
|
|
31
|
-
"@types/
|
|
32
|
-
"@types/
|
|
33
|
-
"@types/react": "^18.3.
|
|
34
|
-
"@types/react-
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"typescript": "^4.9.5"
|
|
29
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
30
|
+
"@testing-library/react": "^14.1.2",
|
|
31
|
+
"@testing-library/user-event": "^14.5.2",
|
|
32
|
+
"@types/lodash": "^4.17.16",
|
|
33
|
+
"@types/node": "^22.7.4",
|
|
34
|
+
"@types/react": "^18.3.12",
|
|
35
|
+
"@types/react-dom": "^18.3.0",
|
|
36
|
+
"@types/react-transition-group": "^4.4.11",
|
|
37
|
+
"gulp": "^5.0.0",
|
|
38
|
+
"rimraf": "^6.0.1",
|
|
39
|
+
"typescript": "5.1.6"
|
|
39
40
|
},
|
|
40
41
|
"peerDependencies": {
|
|
41
42
|
"primeflex": "^3.3.1",
|
|
42
43
|
"primeicons": "^7.0.0",
|
|
43
|
-
"primereact": "10.
|
|
44
|
+
"primereact": "10.9.4",
|
|
44
45
|
"quill": "^2.0.3",
|
|
45
46
|
"react": "^18.3.1",
|
|
46
47
|
"react-dom": "^18.3.1",
|