@michalrakus/x-react-web-lib 1.21.0 → 1.23.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/XFormHeader.d.ts +3 -0
- package/XFormHeader.js +5 -0
- package/XMultiSelect.d.ts +3 -0
- package/XMultiSelect.js +5 -0
- package/XMultiSelectBase.d.ts +3 -0
- package/XMultiSelectBase.js +5 -0
- package/gulpfile.js +3 -0
- package/lib/administration/XBrowseMetaBrowse.d.ts +2 -2
- package/lib/administration/XBrowseMetaForm.d.ts +2 -2
- package/lib/administration/XParamBrowse.d.ts +2 -2
- package/lib/administration/XParamBrowse.js +1 -1
- package/lib/administration/XParamForm.d.ts +2 -2
- package/lib/administration/XParamForm.js +2 -0
- package/lib/administration/XUserBrowse.d.ts +2 -2
- package/lib/administration/XUserBrowse.js +1 -1
- package/lib/administration/XUserForm.d.ts +2 -2
- package/lib/administration/XUserForm.js +12 -9
- package/lib/components/SourceCodeLinkEntity.d.ts +2 -2
- package/lib/components/XAutoComplete.d.ts +2 -1
- package/lib/components/XAutoComplete.js +2 -2
- package/lib/components/XAutoCompleteBase.d.ts +5 -11
- package/lib/components/XAutoCompleteBase.js +28 -11
- package/lib/components/XAutoCompleteDT.d.ts +1 -1
- package/lib/components/XButton.d.ts +1 -1
- package/lib/components/XButtonIconMedium.d.ts +1 -1
- package/lib/components/XButtonIconNarrow.d.ts +1 -1
- package/lib/components/XButtonIconSmall.d.ts +1 -1
- package/lib/components/XCalendar.d.ts +16 -9
- package/lib/components/XCalendar.js +21 -2
- package/lib/components/XChangePasswordForm.d.ts +2 -2
- package/lib/components/XCheckboxDT.d.ts +2 -2
- package/lib/components/XDataTable.d.ts +2 -2
- package/lib/components/XDropdown.d.ts +2 -2
- package/lib/components/XDropdown.js +1 -1
- package/lib/components/XDropdownDT.d.ts +2 -2
- package/lib/components/XDropdownDTFilter.d.ts +2 -2
- package/lib/components/XDropdownForEntity.d.ts +2 -2
- package/lib/components/XDropdownForEntity.js +1 -1
- package/lib/components/XDropdownFormDTFilter.d.ts +2 -2
- package/lib/components/XEditBrowse.d.ts +2 -2
- package/lib/components/XEditColumnDialog.d.ts +2 -2
- package/lib/components/XEditor.d.ts +1 -1
- package/lib/components/XEditorBase.d.ts +1 -1
- package/lib/components/XEditorBase.js +1 -1
- package/lib/components/XFieldSelector.d.ts +2 -2
- package/lib/components/XFormComponent.d.ts +1 -0
- package/lib/components/XFormDataTable2.d.ts +1 -1
- package/lib/components/XFormFooter.d.ts +2 -2
- package/lib/components/XFormHeader.d.ts +4 -0
- package/lib/components/XFormHeader.js +11 -0
- package/lib/components/XFormNavigator3.d.ts +2 -2
- package/lib/components/XFormRowCol/XFormCol.d.ts +1 -1
- package/lib/components/XFormRowCol/XFormInlineRow.d.ts +1 -1
- package/lib/components/XFormRowCol/XFormRow.d.ts +1 -1
- package/lib/components/XFormRowCol/XFormRowCol.d.ts +1 -1
- package/lib/components/XFtsInput.d.ts +2 -2
- package/lib/components/XHolders.d.ts +3 -3
- package/lib/components/XInputDate.d.ts +2 -2
- package/lib/components/XInputDate.js +1 -1
- package/lib/components/XInputDateDT.d.ts +2 -2
- package/lib/components/XInputDateDT.js +1 -1
- package/lib/components/XInputDecimal.d.ts +1 -1
- package/lib/components/XInputDecimalBase.d.ts +2 -2
- package/lib/components/XInputDecimalDT.d.ts +2 -2
- package/lib/components/XInputDecimalDT.js +1 -1
- package/lib/components/XInputFileList.d.ts +2 -1
- package/lib/components/XInputInterval.d.ts +1 -1
- package/lib/components/XInputIntervalBase.d.ts +2 -2
- package/lib/components/XInputIntervalBase.js +1 -1
- package/lib/components/XInputIntervalDT.d.ts +2 -2
- package/lib/components/XInputText.d.ts +2 -2
- package/lib/components/XInputText.js +14 -3
- package/lib/components/XInputTextDT.d.ts +2 -2
- package/lib/components/XInputTextarea.d.ts +1 -1
- package/lib/components/XInputTextarea.js +13 -3
- package/lib/components/XInputTextareaBase.d.ts +3 -1
- package/lib/components/XInputTextareaBase.js +1 -1
- package/lib/components/XInputTextareaDT.d.ts +2 -2
- package/lib/components/XLazyDataTable/XExportRowsDialog.d.ts +12 -7
- package/lib/components/XLazyDataTable/XExportRowsDialog.js +79 -44
- package/lib/components/XLazyDataTable/XLazyDataTable.d.ts +2 -1
- package/lib/components/XLazyDataTable/XLazyDataTable.js +55 -24
- package/lib/components/XLazyDataTable/XMultilineSwitch.d.ts +2 -2
- package/lib/components/XLazyDataTable/XMultilineSwitch.js +1 -1
- package/lib/components/XLazyDataTable/XOcfDropdown.d.ts +2 -2
- package/lib/components/XLazyDataTable/XOcfDropdown.js +1 -0
- package/lib/components/XLoginDialog.d.ts +2 -2
- package/lib/components/XLoginForm.d.ts +2 -2
- package/lib/components/XMultiSelect.d.ts +25 -0
- package/lib/components/XMultiSelect.js +97 -0
- package/lib/components/XMultiSelectBase.d.ts +27 -0
- package/lib/components/XMultiSelectBase.js +145 -0
- package/lib/components/XSearchBrowseParams.d.ts +1 -1
- package/lib/components/XSearchButton.d.ts +1 -1
- package/lib/components/XSearchButtonDT.d.ts +2 -2
- package/lib/components/XSearchButtonOld.d.ts +1 -1
- package/lib/components/XToOneAssocButton.d.ts +2 -2
- package/lib/components/XToken.d.ts +1 -1
- package/lib/components/XUtils.d.ts +12 -3
- package/lib/components/XUtils.js +83 -31
- package/lib/components/locale/x-en.json +1 -0
- package/lib/serverApi/ExportImportParam.d.ts +28 -11
- package/lib/serverApi/ExportImportParam.js +11 -1
- package/lib/serverApi/XUtilsCommon.d.ts +1 -0
- package/lib/serverApi/XUtilsCommon.js +12 -0
- package/lib/serverApi/XUtilsConversions.d.ts +11 -5
- package/lib/serverApi/XUtilsConversions.js +95 -24
- package/lib/serverApi/XUtilsMetadataCommon.d.ts +4 -1
- package/lib/serverApi/XUtilsMetadataCommon.js +26 -3
- package/package.json +3 -3
package/XFormHeader.d.ts
ADDED
package/XFormHeader.js
ADDED
package/XMultiSelect.js
ADDED
package/gulpfile.js
CHANGED
|
@@ -53,6 +53,7 @@ function generateApi(cb) {
|
|
|
53
53
|
"./lib/components/XFormBaseT",
|
|
54
54
|
"./lib/components/XFormDataTable2",
|
|
55
55
|
"./lib/components/XFormFooter",
|
|
56
|
+
"./lib/components/XFormHeader",
|
|
56
57
|
"./lib/components/XFormNavigator3",
|
|
57
58
|
"./lib/components/XHolders",
|
|
58
59
|
"./lib/components/XInputDate",
|
|
@@ -67,6 +68,8 @@ function generateApi(cb) {
|
|
|
67
68
|
"./lib/components/XLocale",
|
|
68
69
|
"./lib/components/XLoginDialog",
|
|
69
70
|
"./lib/components/XLoginForm",
|
|
71
|
+
"./lib/components/XMultiSelect",
|
|
72
|
+
"./lib/components/XMultiSelectBase",
|
|
70
73
|
"./lib/components/XObject",
|
|
71
74
|
"./lib/components/XSearchButton",
|
|
72
75
|
"./lib/components/XToken",
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { XBrowseProps } from "../components/XLazyDataTable/XLazyDataTable";
|
|
3
|
-
|
|
2
|
+
import React from "react";
|
|
3
|
+
export declare const XBrowseMetaBrowse: (props: XBrowseProps) => React.JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { XBrowseProps } from "../components/XLazyDataTable/XLazyDataTable";
|
|
3
3
|
import { XCustomFilter } from "../serverApi/FindParam";
|
|
4
4
|
export declare const XParamBrowse: (props: XBrowseProps & {
|
|
5
5
|
customFilter?: XCustomFilter;
|
|
6
|
-
}) => JSX.Element;
|
|
6
|
+
}) => React.JSX.Element;
|
|
@@ -16,7 +16,7 @@ var XParamBrowse = function (props) {
|
|
|
16
16
|
// openForm pridavame automaticky v XFormNavigator3 pri renderovani komponentu
|
|
17
17
|
props.openForm(react_1.default.createElement(XParamForm_1.XParamForm, { id: selectedRow.id }));
|
|
18
18
|
};
|
|
19
|
-
return (react_1.default.createElement(XLazyDataTable_1.XLazyDataTable, { entity: "XParam", sortField: "id", rows: 30, customFilter: props.customFilter, onAddRow: onAddRow, onEdit: onEdit, removeRow: true, displayed: props.displayed },
|
|
19
|
+
return (react_1.default.createElement(XLazyDataTable_1.XLazyDataTable, { entity: "XParam", label: "Parameters", sortField: "id", rows: 30, customFilter: props.customFilter, onAddRow: onAddRow, onEdit: onEdit, removeRow: true, displayed: props.displayed },
|
|
20
20
|
react_1.default.createElement(XLazyDataTable_1.XLazyColumn, { field: "id", header: "ID", width: "8rem" }),
|
|
21
21
|
react_1.default.createElement(XLazyDataTable_1.XLazyColumn, { field: "code", header: "Code", width: "16rem" }),
|
|
22
22
|
react_1.default.createElement(XLazyDataTable_1.XLazyColumn, { field: "name", header: "Name", width: "45rem" }),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { XFormBaseModif } from "../components/XFormBaseModif";
|
|
3
3
|
import { XObject } from "../components/XObject";
|
|
4
4
|
export declare class XParamForm extends XFormBaseModif {
|
|
5
5
|
createNewObject(): XObject;
|
|
6
|
-
render(): JSX.Element;
|
|
6
|
+
render(): React.JSX.Element;
|
|
7
7
|
}
|
|
@@ -32,6 +32,7 @@ var XInputDecimal_1 = require("../components/XInputDecimal");
|
|
|
32
32
|
var XInputDate_1 = require("../components/XInputDate");
|
|
33
33
|
var XInputText_1 = require("../components/XInputText");
|
|
34
34
|
var XFormFooter_1 = require("../components/XFormFooter");
|
|
35
|
+
var XFormHeader_1 = require("../components/XFormHeader");
|
|
35
36
|
var XParamForm = /** @class */ (function (_super) {
|
|
36
37
|
__extends(XParamForm, _super);
|
|
37
38
|
function XParamForm() {
|
|
@@ -42,6 +43,7 @@ var XParamForm = /** @class */ (function (_super) {
|
|
|
42
43
|
};
|
|
43
44
|
XParamForm.prototype.render = function () {
|
|
44
45
|
return (react_1.default.createElement("div", null,
|
|
46
|
+
react_1.default.createElement(XFormHeader_1.XFormHeader, { label: "Parameter" }),
|
|
45
47
|
react_1.default.createElement("div", { className: "x-form-row" },
|
|
46
48
|
react_1.default.createElement("div", { className: "x-form-col" },
|
|
47
49
|
react_1.default.createElement(XInputDecimal_1.XInputDecimal, { form: this, field: "id", label: "ID", readOnly: true }),
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { XBrowseProps } from "../components/XLazyDataTable/XLazyDataTable";
|
|
3
|
-
|
|
2
|
+
import React from "react";
|
|
3
|
+
export declare const XUserBrowse: (props: XBrowseProps) => React.JSX.Element;
|
|
@@ -75,7 +75,7 @@ var XUserBrowse = function (props) {
|
|
|
75
75
|
}
|
|
76
76
|
});
|
|
77
77
|
}); };
|
|
78
|
-
return (react_1.default.createElement(XLazyDataTable_1.XLazyDataTable, { entity: "XUser", rows: 10, onAddRow: onAddRow, onEdit: onEdit, removeRow: onRemoveRow, displayed: props.displayed },
|
|
78
|
+
return (react_1.default.createElement(XLazyDataTable_1.XLazyDataTable, { entity: "XUser", label: "Users", rows: 10, onAddRow: onAddRow, onEdit: onEdit, removeRow: onRemoveRow, displayed: props.displayed },
|
|
79
79
|
react_1.default.createElement(XLazyDataTable_1.XLazyColumn, { field: "id", header: "ID" }),
|
|
80
80
|
react_1.default.createElement(XLazyDataTable_1.XLazyColumn, { field: "username", header: "Username", width: "17rem" }),
|
|
81
81
|
react_1.default.createElement(XLazyDataTable_1.XLazyColumn, { field: "name", header: "Name", width: "17rem" }),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { XFormProps } from "../components/XFormBase";
|
|
2
|
+
import React from "react";
|
|
3
3
|
import { OperationType } from "../components/XUtils";
|
|
4
4
|
import { XFormBaseModif } from "../components/XFormBaseModif";
|
|
5
5
|
import { XObject } from "../components/XObject";
|
|
@@ -8,5 +8,5 @@ export declare class XUserForm extends XFormBaseModif {
|
|
|
8
8
|
createNewObject(): XObject;
|
|
9
9
|
preInitForm(object: XObject, operationType: OperationType.Insert | OperationType.Update): void;
|
|
10
10
|
onClickSave(): Promise<void>;
|
|
11
|
-
render(): JSX.Element;
|
|
11
|
+
render(): React.JSX.Element;
|
|
12
12
|
}
|
|
@@ -75,6 +75,7 @@ var XCheckbox_1 = require("../components/XCheckbox");
|
|
|
75
75
|
var XEnvVars_1 = require("../components/XEnvVars");
|
|
76
76
|
var XFormBaseModif_1 = require("../components/XFormBaseModif");
|
|
77
77
|
var XInputDate_1 = require("../components/XInputDate");
|
|
78
|
+
var XFormHeader_1 = require("../components/XFormHeader");
|
|
78
79
|
var XUserForm = /** @class */ (function (_super) {
|
|
79
80
|
__extends(XUserForm, _super);
|
|
80
81
|
function XUserForm(props) {
|
|
@@ -100,8 +101,9 @@ var XUserForm = /** @class */ (function (_super) {
|
|
|
100
101
|
var e_1;
|
|
101
102
|
return __generator(this, function (_a) {
|
|
102
103
|
switch (_a.label) {
|
|
103
|
-
case 0:
|
|
104
|
-
|
|
104
|
+
case 0: return [4 /*yield*/, this.validateSave()];
|
|
105
|
+
case 1:
|
|
106
|
+
if (!(_a.sent())) {
|
|
105
107
|
return [2 /*return*/];
|
|
106
108
|
}
|
|
107
109
|
// v deme nedovolime zmenit uzivatelov ktori sa pouzivaju na skusanie dema
|
|
@@ -134,18 +136,18 @@ var XUserForm = /** @class */ (function (_super) {
|
|
|
134
136
|
}
|
|
135
137
|
}
|
|
136
138
|
this.preSave(this.state.object);
|
|
137
|
-
_a.label =
|
|
138
|
-
case 1:
|
|
139
|
-
_a.trys.push([1, 3, , 4]);
|
|
140
|
-
return [4 /*yield*/, XUtils_1.XUtils.post('userSaveRow', { entity: this.getEntity(), object: this.state.object })];
|
|
139
|
+
_a.label = 2;
|
|
141
140
|
case 2:
|
|
142
|
-
_a.
|
|
143
|
-
return [
|
|
141
|
+
_a.trys.push([2, 4, , 5]);
|
|
142
|
+
return [4 /*yield*/, XUtils_1.XUtils.post('userSaveRow', { entity: this.getEntity(), object: this.state.object })];
|
|
144
143
|
case 3:
|
|
144
|
+
_a.sent();
|
|
145
|
+
return [3 /*break*/, 5];
|
|
146
|
+
case 4:
|
|
145
147
|
e_1 = _a.sent();
|
|
146
148
|
XUtils_1.XUtils.showErrorMessage("Save row failed.", e_1);
|
|
147
149
|
return [2 /*return*/]; // zostavame vo formulari
|
|
148
|
-
case
|
|
150
|
+
case 5:
|
|
149
151
|
this.props.openForm(null); // save zbehol, ideme naspet do browsu
|
|
150
152
|
return [2 /*return*/];
|
|
151
153
|
}
|
|
@@ -167,6 +169,7 @@ var XUserForm = /** @class */ (function (_super) {
|
|
|
167
169
|
];
|
|
168
170
|
}
|
|
169
171
|
return (react_1.default.createElement("div", null,
|
|
172
|
+
react_1.default.createElement(XFormHeader_1.XFormHeader, { label: "User" }),
|
|
170
173
|
react_1.default.createElement("div", { className: "x-form-row" },
|
|
171
174
|
react_1.default.createElement("div", { className: "x-form-col" },
|
|
172
175
|
react_1.default.createElement(XInputDecimal_1.XInputDecimal, { form: this, field: "id", label: "ID", readOnly: true, labelStyle: { width: '14rem' } }),
|
|
@@ -24,6 +24,7 @@ export interface XAutoCompleteProps extends XFormComponentProps<XObject> {
|
|
|
24
24
|
scrollHeight?: string;
|
|
25
25
|
inputClassName?: string;
|
|
26
26
|
inputStyle?: React.CSSProperties;
|
|
27
|
+
setFocusOnCreate?: boolean;
|
|
27
28
|
}
|
|
28
29
|
export declare class XAutoComplete extends XFormComponent<XObject, XAutoCompleteProps> {
|
|
29
30
|
protected xAssoc: XAssoc;
|
|
@@ -39,5 +40,5 @@ export declare class XAutoComplete extends XFormComponent<XObject, XAutoComplete
|
|
|
39
40
|
field: string;
|
|
40
41
|
xError: XError;
|
|
41
42
|
} | undefined;
|
|
42
|
-
render(): JSX.Element;
|
|
43
|
+
render(): React.JSX.Element;
|
|
43
44
|
}
|
|
@@ -27,7 +27,7 @@ var XAutoComplete = /** @class */ (function (_super) {
|
|
|
27
27
|
__extends(XAutoComplete, _super);
|
|
28
28
|
function XAutoComplete(props) {
|
|
29
29
|
var _this = _super.call(this, props) || this;
|
|
30
|
-
_this.xAssoc = XUtilsMetadataCommon_1.XUtilsMetadataCommon.
|
|
30
|
+
_this.xAssoc = XUtilsMetadataCommon_1.XUtilsMetadataCommon.getXAssocToOneByPath(XUtilsMetadataCommon_1.XUtilsMetadataCommon.getXEntity(props.form.getEntity()), props.assocField);
|
|
31
31
|
_this.errorInBase = undefined;
|
|
32
32
|
_this.onChangeAutoCompleteBase = _this.onChangeAutoCompleteBase.bind(_this);
|
|
33
33
|
_this.onErrorChangeAutoCompleteBase = _this.onErrorChangeAutoCompleteBase.bind(_this);
|
|
@@ -70,7 +70,7 @@ var XAutoComplete = /** @class */ (function (_super) {
|
|
|
70
70
|
// div className="col" nam zabezpeci aby XAutoCompleteBase nezaberal celu dlzku grid-u (ma nastaveny width=100% vdaka "formgroup-inline")
|
|
71
71
|
return (react_1.default.createElement("div", { className: "field grid" },
|
|
72
72
|
react_1.default.createElement("label", { htmlFor: this.props.assocField, className: "col-fixed", style: this.getLabelStyle() }, this.getLabel()),
|
|
73
|
-
react_1.default.createElement(XAutoCompleteBase_1.XAutoCompleteBase, { value: this.getValue(), onChange: this.onChangeAutoCompleteBase, field: this.props.displayField, itemTemplate: this.props.itemTemplate, searchBrowse: this.props.searchBrowse, valueForm: this.props.assocForm, idField: xEntityAssoc.idField, readOnly: this.isReadOnly(), error: this.getError(), onErrorChange: this.onErrorChangeAutoCompleteBase, width: this.props.width, scrollHeight: this.props.scrollHeight, suggestions: this.props.suggestions, suggestionsLoad: this.props.suggestionsLoad, lazyLoadMaxRows: this.props.lazyLoadMaxRows, splitQueryValue: this.props.splitQueryValue, minLength: this.props.minLength, suggestionsQuery: { entity: this.xAssoc.entityName, filter: function () { return _this.getFilterBase(_this.props.filter); }, sortField: this.props.sortField, fields: this.props.fields }, inputClassName: this.props.inputClassName })));
|
|
73
|
+
react_1.default.createElement(XAutoCompleteBase_1.XAutoCompleteBase, { value: this.getValue(), onChange: this.onChangeAutoCompleteBase, field: this.props.displayField, itemTemplate: this.props.itemTemplate, searchBrowse: this.props.searchBrowse, valueForm: this.props.assocForm, idField: xEntityAssoc.idField, readOnly: this.isReadOnly(), error: this.getError(), onErrorChange: this.onErrorChangeAutoCompleteBase, width: this.props.width, scrollHeight: this.props.scrollHeight, suggestions: this.props.suggestions, suggestionsLoad: this.props.suggestionsLoad, lazyLoadMaxRows: this.props.lazyLoadMaxRows, splitQueryValue: this.props.splitQueryValue, minLength: this.props.minLength, suggestionsQuery: { entity: this.xAssoc.entityName, filter: function () { return _this.getFilterBase(_this.props.filter); }, sortField: this.props.sortField, fields: this.props.fields }, inputClassName: this.props.inputClassName, setFocusOnCreate: this.props.setFocusOnCreate })));
|
|
74
74
|
};
|
|
75
75
|
return XAutoComplete;
|
|
76
76
|
}(XFormComponent_1.XFormComponent));
|
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
import React, { Component } from "react";
|
|
2
2
|
import { AutoCompleteChangeEvent } from "primereact/autocomplete";
|
|
3
|
-
import { OperationType } from "./XUtils";
|
|
3
|
+
import { OperationType, XQuery } from "./XUtils";
|
|
4
4
|
import { MenuItem } from "primereact/menuitem";
|
|
5
5
|
import { XSearchBrowseParams } from "./XSearchBrowseParams";
|
|
6
|
-
import { XCustomFilter } from "../serverApi/FindParam";
|
|
7
6
|
import { DataTableSortMeta } from "primereact/datatable";
|
|
8
7
|
export type XSuggestionsLoadProp = "eager" | "onSearchStart" | "lazy";
|
|
9
8
|
export type XSuggestionsLoadType = "suggestions" | XSuggestionsLoadProp;
|
|
10
|
-
export type XFilterOrFunction = XCustomFilter | (() => XCustomFilter | undefined);
|
|
11
|
-
export interface XQuery {
|
|
12
|
-
entity: string;
|
|
13
|
-
filter?: XFilterOrFunction;
|
|
14
|
-
sortField?: string | DataTableSortMeta[];
|
|
15
|
-
fields?: string[];
|
|
16
|
-
}
|
|
17
9
|
export interface XAutoCompleteBaseProps {
|
|
18
10
|
value: any;
|
|
19
11
|
onChange: (object: any, objectChange: OperationType) => void;
|
|
@@ -27,6 +19,7 @@ export interface XAutoCompleteBaseProps {
|
|
|
27
19
|
searchBrowse?: JSX.Element;
|
|
28
20
|
valueForm?: JSX.Element;
|
|
29
21
|
idField?: string;
|
|
22
|
+
onAddRow?: (inputValue: string) => void;
|
|
30
23
|
minLength?: number;
|
|
31
24
|
width?: string;
|
|
32
25
|
scrollHeight?: string;
|
|
@@ -79,7 +72,8 @@ export declare class XAutoCompleteBase extends Component<XAutoCompleteBaseProps>
|
|
|
79
72
|
formDialogOnHide(): void;
|
|
80
73
|
searchDialogOnChoose(chosenRow: any): void;
|
|
81
74
|
searchDialogOnHide(): void;
|
|
82
|
-
|
|
75
|
+
createInsertItem(splitButtonItems: MenuItem[]): void;
|
|
76
|
+
createUpdateItem(splitButtonItems: MenuItem[]): void;
|
|
83
77
|
createSearchItem(splitButtonItems: MenuItem[]): void;
|
|
84
78
|
createDropdownItem(splitButtonItems: MenuItem[]): void;
|
|
85
79
|
onOpenDropdown(e: any): void;
|
|
@@ -92,5 +86,5 @@ export declare class XAutoCompleteBase extends Component<XAutoCompleteBaseProps>
|
|
|
92
86
|
computeDefaultDisplayValue(suggestion: any): string;
|
|
93
87
|
static isMoreSuggestions(suggestion: any): boolean;
|
|
94
88
|
createSearchBrowseParams(): XSearchBrowseParams;
|
|
95
|
-
render(): JSX.Element;
|
|
89
|
+
render(): React.JSX.Element;
|
|
96
90
|
}
|
|
@@ -487,21 +487,35 @@ var XAutoCompleteBase = /** @class */ (function (_super) {
|
|
|
487
487
|
this.setFocusToInput();
|
|
488
488
|
}
|
|
489
489
|
};
|
|
490
|
-
XAutoCompleteBase.prototype.
|
|
490
|
+
XAutoCompleteBase.prototype.createInsertItem = function (splitButtonItems) {
|
|
491
491
|
var _this = this;
|
|
492
492
|
splitButtonItems.push({
|
|
493
493
|
icon: 'pi pi-plus',
|
|
494
494
|
command: function (e) {
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
495
|
+
if (_this.props.onAddRow) {
|
|
496
|
+
// mame custom handler pre "plus" button
|
|
497
|
+
// ak mame nevalidnu hodnotu, tak ju odovzdame (snaha o user friendly) - TODO - ak nie sme v nevalidnom stave
|
|
498
|
+
var inputValue = "";
|
|
499
|
+
if (_this.state.inputChanged) {
|
|
500
|
+
inputValue = _this.state.inputValueState;
|
|
501
|
+
}
|
|
502
|
+
_this.props.onAddRow(inputValue);
|
|
503
|
+
}
|
|
504
|
+
else {
|
|
505
|
+
// otvorime dialog na insert
|
|
506
|
+
_this.formDialogObjectId = undefined;
|
|
507
|
+
_this.formDialogInitValuesForInsert = {};
|
|
508
|
+
// ak mame nevalidnu hodnotu, tak ju predplnime (snaha o user friendly)
|
|
509
|
+
if (_this.state.inputChanged) {
|
|
510
|
+
_this.formDialogInitValuesForInsert[_this.getFirstField()] = _this.state.inputValueState;
|
|
511
|
+
}
|
|
512
|
+
_this.setState({ formDialogOpened: true });
|
|
501
513
|
}
|
|
502
|
-
_this.setState({ formDialogOpened: true });
|
|
503
514
|
}
|
|
504
515
|
});
|
|
516
|
+
};
|
|
517
|
+
XAutoCompleteBase.prototype.createUpdateItem = function (splitButtonItems) {
|
|
518
|
+
var _this = this;
|
|
505
519
|
splitButtonItems.push({
|
|
506
520
|
icon: 'pi pi-pencil',
|
|
507
521
|
command: function (e) {
|
|
@@ -642,11 +656,14 @@ var XAutoCompleteBase = /** @class */ (function (_super) {
|
|
|
642
656
|
var readOnly = (_a = this.props.readOnly) !== null && _a !== void 0 ? _a : false;
|
|
643
657
|
var dropdownButton;
|
|
644
658
|
if (!readOnly) {
|
|
645
|
-
if (this.props.searchBrowse || this.props.valueForm) {
|
|
659
|
+
if (this.props.searchBrowse || this.props.valueForm || this.props.onAddRow) {
|
|
646
660
|
// mame searchBrowse alebo CRUD operacie, potrebujeme SplitButton
|
|
647
661
|
var splitButtonItems = [];
|
|
662
|
+
if (this.props.valueForm || this.props.onAddRow) {
|
|
663
|
+
this.createInsertItem(splitButtonItems);
|
|
664
|
+
}
|
|
648
665
|
if (this.props.valueForm) {
|
|
649
|
-
this.
|
|
666
|
+
this.createUpdateItem(splitButtonItems);
|
|
650
667
|
}
|
|
651
668
|
if (this.props.searchBrowse && !readOnly) {
|
|
652
669
|
this.createSearchItem(splitButtonItems);
|
|
@@ -684,7 +701,7 @@ var XAutoCompleteBase = /** @class */ (function (_super) {
|
|
|
684
701
|
// <DobrovolnikForm id={this.formDialogObjectId} object={this.formDialogInitValuesForInsert} onSaveOrCancel={this.formDialogOnSaveOrCancel}/>
|
|
685
702
|
// formgroup-inline lepi SplitButton na autocomplete a zarovna jeho vysku
|
|
686
703
|
return (react_1.default.createElement("div", { className: "x-auto-complete-base", style: { width: this.props.width } },
|
|
687
|
-
react_1.default.createElement(autocomplete_1.AutoComplete, __assign({ value: inputValue, suggestions: this.state.filteredSuggestions, completeMethod: this.completeMethod, itemTemplate: this.itemTemplate, onChange: this.onChange, onSelect: this.onSelect, onBlur: this.onBlur, minLength: this.props.minLength, scrollHeight: this.props.scrollHeight, ref: this.autoCompleteRef, readOnly: readOnly, disabled: readOnly }, XUtils_1.XUtils.
|
|
704
|
+
react_1.default.createElement(autocomplete_1.AutoComplete, __assign({ value: inputValue, suggestions: this.state.filteredSuggestions, completeMethod: this.completeMethod, itemTemplate: this.itemTemplate, onChange: this.onChange, onSelect: this.onSelect, onBlur: this.onBlur, minLength: this.props.minLength, scrollHeight: this.props.scrollHeight, ref: this.autoCompleteRef, readOnly: readOnly, disabled: readOnly }, XUtils_1.XUtils.createTooltipOrErrorProps(error), { inputClassName: this.props.inputClassName })),
|
|
688
705
|
dropdownButton,
|
|
689
706
|
this.props.valueForm != undefined ?
|
|
690
707
|
react_1.default.createElement(dialog_1.Dialog, { visible: this.state.formDialogOpened, onHide: this.formDialogOnHide, header: this.formDialogObjectId ? 'Modification' : 'New row' }, react_1.default.cloneElement(this.props.valueForm, {
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { XDateScale } from "../serverApi/XUtilsConversions";
|
|
3
|
+
export declare const XCalendar: {
|
|
4
|
+
(props: {
|
|
5
|
+
id?: string | undefined;
|
|
6
|
+
value: Date | null;
|
|
7
|
+
onChange: (value: Date | null) => void;
|
|
8
|
+
readOnly?: boolean | undefined;
|
|
9
|
+
error?: string | undefined;
|
|
10
|
+
scale: XDateScale;
|
|
11
|
+
datetime?: boolean | undefined;
|
|
12
|
+
}): React.JSX.Element;
|
|
13
|
+
defaultProps: {
|
|
14
|
+
scale: XDateScale;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -84,7 +84,7 @@ var XCalendar = function (props) {
|
|
|
84
84
|
var onBlur = function (e) {
|
|
85
85
|
if (inputChanged) {
|
|
86
86
|
// poznamka: e.target.value aj inputValueState obsahuju tu istu string hodnotu
|
|
87
|
-
var value = (0, XUtilsConversions_1.dateFromUI)(e.target.value);
|
|
87
|
+
var value = (0, XUtilsConversions_1.dateFromUI)(e.target.value, props.scale);
|
|
88
88
|
props.onChange(value !== null && value !== void 0 ? value : null); // nekorektnu hodnotu reprezentovanu cez undefined budeme riesit akokeby user zadal null (field sa vyprazdni)
|
|
89
89
|
setInputChanged(false);
|
|
90
90
|
setInputValueState(undefined); // pre poriadok
|
|
@@ -100,9 +100,28 @@ var XCalendar = function (props) {
|
|
|
100
100
|
}
|
|
101
101
|
return inputValue;
|
|
102
102
|
};
|
|
103
|
+
var getView = function (dateScale) {
|
|
104
|
+
var view;
|
|
105
|
+
if (dateScale === XUtilsConversions_1.XDateScale.Date) {
|
|
106
|
+
view = "date";
|
|
107
|
+
}
|
|
108
|
+
else if (dateScale === XUtilsConversions_1.XDateScale.Month) {
|
|
109
|
+
view = "month";
|
|
110
|
+
}
|
|
111
|
+
else if (dateScale === XUtilsConversions_1.XDateScale.Year) {
|
|
112
|
+
view = "year";
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
throw "Unimplemented dateScale = " + dateScale;
|
|
116
|
+
}
|
|
117
|
+
return view;
|
|
118
|
+
};
|
|
103
119
|
var datetime = (_a = props.datetime) !== null && _a !== void 0 ? _a : false;
|
|
104
120
|
// poznamka: parseDateTime nerobi ziadny parse, nechceme aby Calendar "rusil" uzivatela pri typovani datumu
|
|
105
121
|
// konverzia (a volanie props.onChange) sa robi az pri onBlur
|
|
106
|
-
return (react_1.default.createElement(calendar_1.Calendar, __assign({ id: props.id, value: getInputValue(), onChange: onChange, disabled: props.readOnly, showIcon: true, showOnFocus: false, dateFormat: (0, XUtilsConversions_1.dateFormatCalendar)(), keepInvalid: true, parseDateTime: function (text) { return text; }, showTime: datetime, showSeconds: datetime, inputClassName: datetime ? 'x-input-datetime' : 'x-input-date', onSelect: onSelect, onBlur: onBlur }, XUtils_1.XUtils.
|
|
122
|
+
return (react_1.default.createElement(calendar_1.Calendar, __assign({ id: props.id, value: getInputValue(), onChange: onChange, disabled: props.readOnly, showIcon: true, showOnFocus: false, view: getView(props.scale), dateFormat: (0, XUtilsConversions_1.dateFormatCalendar)(props.scale), keepInvalid: true, parseDateTime: function (text) { return text; }, showTime: datetime, showSeconds: datetime, inputClassName: datetime ? 'x-input-datetime' : 'x-input-date', onSelect: onSelect, onBlur: onBlur }, XUtils_1.XUtils.createTooltipOrErrorProps(props.error))));
|
|
107
123
|
};
|
|
108
124
|
exports.XCalendar = XCalendar;
|
|
125
|
+
exports.XCalendar.defaultProps = {
|
|
126
|
+
scale: XUtilsConversions_1.XDateScale.Date
|
|
127
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { XFormBase } from "./XFormBase";
|
|
2
|
+
import React from "react";
|
|
3
3
|
import { XField } from "../serverApi/XEntityMetadata";
|
|
4
4
|
import { XTableFieldReadOnlyProp } from "./XFormDataTable2";
|
|
5
5
|
export declare const XCheckboxDT: (props: {
|
|
@@ -8,4 +8,4 @@ export declare const XCheckboxDT: (props: {
|
|
|
8
8
|
field: string;
|
|
9
9
|
rowData: any;
|
|
10
10
|
readOnly?: XTableFieldReadOnlyProp | undefined;
|
|
11
|
-
}) => JSX.Element;
|
|
11
|
+
}) => React.JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ReactChild } from "react";
|
|
1
|
+
import React, { ReactChild } from "react";
|
|
2
2
|
export declare const XDataTable: (props: {
|
|
3
3
|
entity: string;
|
|
4
4
|
dataKey: string;
|
|
5
5
|
onSelect: (selectedRow: any) => void;
|
|
6
6
|
children: ReactChild[];
|
|
7
|
-
}) => JSX.Element;
|
|
7
|
+
}) => React.JSX.Element;
|
|
8
8
|
export declare const XColumn: (props: {
|
|
9
9
|
field: string;
|
|
10
10
|
header?: any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { XFilterProp, XFormComponent, XFormComponentProps } from "./XFormComponent";
|
|
3
3
|
import { XAssoc } from "../serverApi/XEntityMetadata";
|
|
4
4
|
import { XObject } from "./XObject";
|
|
@@ -14,5 +14,5 @@ export declare class XDropdown extends XFormComponent<XObject, XDropdownProps> {
|
|
|
14
14
|
getField(): string;
|
|
15
15
|
isNotNull(): boolean;
|
|
16
16
|
getValue(): any | null;
|
|
17
|
-
render(): JSX.Element;
|
|
17
|
+
render(): React.JSX.Element;
|
|
18
18
|
}
|
|
@@ -27,7 +27,7 @@ var XDropdown = /** @class */ (function (_super) {
|
|
|
27
27
|
__extends(XDropdown, _super);
|
|
28
28
|
function XDropdown(props) {
|
|
29
29
|
var _this = _super.call(this, props) || this;
|
|
30
|
-
_this.xAssoc = XUtilsMetadataCommon_1.XUtilsMetadataCommon.
|
|
30
|
+
_this.xAssoc = XUtilsMetadataCommon_1.XUtilsMetadataCommon.getXAssocToOneByPath(XUtilsMetadataCommon_1.XUtilsMetadataCommon.getXEntity(props.form.getEntity()), props.assocField);
|
|
31
31
|
props.form.addField(props.assocField + '.' + props.displayField);
|
|
32
32
|
return _this;
|
|
33
33
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { XFormBase } from "./XFormBase";
|
|
2
|
+
import React from "react";
|
|
3
3
|
import { XDropdownOptionsMap, XTableFieldReadOnlyProp } from "./XFormDataTable2";
|
|
4
4
|
import { XCustomFilter } from "../serverApi/FindParam";
|
|
5
5
|
export declare const XDropdownDT: (props: {
|
|
@@ -13,4 +13,4 @@ export declare const XDropdownDT: (props: {
|
|
|
13
13
|
onDropdownOptionsMapChange: (dropdownOptionsMap: XDropdownOptionsMap) => void;
|
|
14
14
|
rowData: any;
|
|
15
15
|
readOnly?: XTableFieldReadOnlyProp | undefined;
|
|
16
|
-
}) => JSX.Element;
|
|
16
|
+
}) => React.JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { XCustomFilter } from "../serverApi/FindParam";
|
|
3
3
|
export declare const XDropdownDTFilter: (props: {
|
|
4
4
|
entity: string;
|
|
@@ -7,4 +7,4 @@ export declare const XDropdownDTFilter: (props: {
|
|
|
7
7
|
onValueChange: (field: string, displayValue: any) => void;
|
|
8
8
|
filter?: XCustomFilter | undefined;
|
|
9
9
|
sortField?: string | undefined;
|
|
10
|
-
}) => JSX.Element;
|
|
10
|
+
}) => React.JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component } from "react";
|
|
1
|
+
import React, { Component } from "react";
|
|
2
2
|
import { DropdownChangeEvent } from "primereact/dropdown";
|
|
3
3
|
import { XCustomFilter } from "../serverApi/FindParam";
|
|
4
4
|
export interface XDropdownForEntityProps {
|
|
@@ -22,5 +22,5 @@ export declare class XDropdownForEntity extends Component<XDropdownForEntityProp
|
|
|
22
22
|
componentDidMount(): void;
|
|
23
23
|
loadOptions(): Promise<void>;
|
|
24
24
|
onChange(e: DropdownChangeEvent): void;
|
|
25
|
-
render(): JSX.Element;
|
|
25
|
+
render(): React.JSX.Element;
|
|
26
26
|
}
|
|
@@ -144,7 +144,7 @@ var XDropdownForEntity = /** @class */ (function (_super) {
|
|
|
144
144
|
XDropdownForEntity.prototype.render = function () {
|
|
145
145
|
// TODO - mozno by nebolo od veci pouzivat InputText ak readOnly === true (chybala by len sipka (rozbalovac)) a dalo by sa copy-paste-ovat
|
|
146
146
|
// propertiesy na Dropdown-e: readOnly vyseduje, disabled znemoznuje vyber polozky
|
|
147
|
-
return (react_1.default.createElement(dropdown_1.Dropdown, __assign({ id: this.props.id, options: this.state.options, optionLabel: this.props.displayField, dataKey: this.idField, value: this.props.value, onChange: this.onChange, readOnly: this.props.readOnly, disabled: this.props.readOnly }, XUtils_1.XUtils.
|
|
147
|
+
return (react_1.default.createElement(dropdown_1.Dropdown, __assign({ id: this.props.id, options: this.state.options, optionLabel: this.props.displayField, dataKey: this.idField, value: this.props.value, onChange: this.onChange, readOnly: this.props.readOnly, disabled: this.props.readOnly }, XUtils_1.XUtils.createTooltipOrErrorProps(this.props.error))));
|
|
148
148
|
};
|
|
149
149
|
return XDropdownForEntity;
|
|
150
150
|
}(react_1.Component));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { XFormDataTable2 } from "./XFormDataTable2";
|
|
3
3
|
export declare const XDropdownFormDTFilter: (props: {
|
|
4
4
|
dataTable: XFormDataTable2;
|
|
5
5
|
assocField: string;
|
|
6
6
|
displayField: string;
|
|
7
|
-
}) => JSX.Element;
|
|
7
|
+
}) => React.JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component } from "react";
|
|
1
|
+
import React, { Component } from "react";
|
|
2
2
|
import { XEditColumnDialogValues } from "./XEditColumnDialog";
|
|
3
3
|
import { XBrowseMeta } from "../serverApi/XBrowseMetadata";
|
|
4
4
|
export interface XEditBrowseProps {
|
|
@@ -29,5 +29,5 @@ export declare class XEditBrowse extends Component<XEditBrowseProps> {
|
|
|
29
29
|
moveColumn(field: string, offset: -1 | 1): void;
|
|
30
30
|
getIndexForColumn(field: string): number | undefined;
|
|
31
31
|
onEdit(selectedRow: any): void;
|
|
32
|
-
render(): JSX.Element;
|
|
32
|
+
render(): React.JSX.Element;
|
|
33
33
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
export interface XEditColumnDialogValues {
|
|
3
3
|
field: string;
|
|
4
4
|
header: string;
|
|
@@ -10,4 +10,4 @@ export declare const XEditColumnDialog: (props: {
|
|
|
10
10
|
entity: string;
|
|
11
11
|
xEditColumnDialogValues?: XEditColumnDialogValues | undefined;
|
|
12
12
|
onHideDialog: (xEditColumnDialogValues: XEditColumnDialogValues | null) => void;
|
|
13
|
-
}) => JSX.Element;
|
|
13
|
+
}) => React.JSX.Element;
|