@michalrakus/x-react-web-lib 1.22.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/XMultiSelect.d.ts +3 -0
- package/XMultiSelect.js +5 -0
- package/XMultiSelectBase.d.ts +3 -0
- package/XMultiSelectBase.js +5 -0
- package/gulpfile.js +2 -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/XParamForm.d.ts +2 -2
- package/lib/administration/XUserBrowse.d.ts +2 -2
- package/lib/administration/XUserForm.d.ts +2 -2
- 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 +2 -2
- package/lib/components/XCalendar.js +1 -1
- 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 +2 -2
- 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/XInputDateDT.d.ts +2 -2
- 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 +2 -2
- package/lib/components/XLazyDataTable/XLazyDataTable.d.ts +1 -1
- package/lib/components/XLazyDataTable/XMultilineSwitch.d.ts +2 -2
- package/lib/components/XLazyDataTable/XOcfDropdown.d.ts +2 -2
- 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 +9 -2
- package/lib/components/XUtils.js +41 -21
- package/lib/serverApi/XUtilsMetadataCommon.d.ts +3 -1
- package/lib/serverApi/XUtilsMetadataCommon.js +9 -3
- package/package.json +3 -3
package/XMultiSelect.js
ADDED
package/gulpfile.js
CHANGED
|
@@ -68,6 +68,8 @@ function generateApi(cb) {
|
|
|
68
68
|
"./lib/components/XLocale",
|
|
69
69
|
"./lib/components/XLoginDialog",
|
|
70
70
|
"./lib/components/XLoginForm",
|
|
71
|
+
"./lib/components/XMultiSelect",
|
|
72
|
+
"./lib/components/XMultiSelectBase",
|
|
71
73
|
"./lib/components/XObject",
|
|
72
74
|
"./lib/components/XSearchButton",
|
|
73
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;
|
|
@@ -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
|
}
|
|
@@ -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;
|
|
@@ -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
|
}
|
|
@@ -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,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { XDateScale } from "../serverApi/XUtilsConversions";
|
|
3
3
|
export declare const XCalendar: {
|
|
4
4
|
(props: {
|
|
@@ -9,7 +9,7 @@ export declare const XCalendar: {
|
|
|
9
9
|
error?: string | undefined;
|
|
10
10
|
scale: XDateScale;
|
|
11
11
|
datetime?: boolean | undefined;
|
|
12
|
-
}): JSX.Element;
|
|
12
|
+
}): React.JSX.Element;
|
|
13
13
|
defaultProps: {
|
|
14
14
|
scale: XDateScale;
|
|
15
15
|
};
|
|
@@ -119,7 +119,7 @@ var XCalendar = function (props) {
|
|
|
119
119
|
var datetime = (_a = props.datetime) !== null && _a !== void 0 ? _a : false;
|
|
120
120
|
// poznamka: parseDateTime nerobi ziadny parse, nechceme aby Calendar "rusil" uzivatela pri typovani datumu
|
|
121
121
|
// konverzia (a volanie props.onChange) sa robi az pri onBlur
|
|
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.
|
|
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))));
|
|
123
123
|
};
|
|
124
124
|
exports.XCalendar = XCalendar;
|
|
125
125
|
exports.XCalendar.defaultProps = {
|
|
@@ -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;
|
|
@@ -86,6 +86,6 @@ var XEditorBase = function (props) {
|
|
|
86
86
|
}
|
|
87
87
|
return htmlValue !== null ? htmlValue : undefined; // value v Editor nechce null, chce undefined
|
|
88
88
|
};
|
|
89
|
-
return (react_1.default.createElement(editor_1.Editor, __assign({ id: props.id, value: getValue(), onTextChange: onTextChange, onBlur: onBlur, readOnly: props.readOnly, style: props.style }, XUtils_1.XUtils.
|
|
89
|
+
return (react_1.default.createElement(editor_1.Editor, __assign({ id: props.id, value: getValue(), onTextChange: onTextChange, onBlur: onBlur, readOnly: props.readOnly, style: props.style }, XUtils_1.XUtils.createTooltipOrErrorProps(props.error))));
|
|
90
90
|
};
|
|
91
91
|
exports.XEditorBase = XEditorBase;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
export declare const XFieldSelector: (props: {
|
|
3
3
|
entity: string;
|
|
4
4
|
assocSelectable: boolean;
|
|
5
5
|
selectionField?: string | undefined;
|
|
6
6
|
onSelectionChange: (selectedField: string) => void;
|
|
7
|
-
}) => JSX.Element;
|
|
7
|
+
}) => React.JSX.Element;
|
|
@@ -86,7 +86,7 @@ export declare class XFormDataTable2 extends Component<XFormDataTableProps> {
|
|
|
86
86
|
removeRow(row: any): void;
|
|
87
87
|
validate(): void;
|
|
88
88
|
isReadOnly(): boolean;
|
|
89
|
-
render(): JSX.Element;
|
|
89
|
+
render(): React.JSX.Element;
|
|
90
90
|
}
|
|
91
91
|
export type XTableFieldOnChange = (e: XTableFieldChangeEvent<any, any>) => void;
|
|
92
92
|
export type XTableFieldReadOnlyProp = boolean | ((object: any, tableRow: any) => boolean);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component } from "react";
|
|
1
|
+
import React, { Component } from "react";
|
|
2
2
|
export interface XFormNavigator3Props {
|
|
3
3
|
rootFormElement?: JSX.Element;
|
|
4
4
|
}
|
|
@@ -8,5 +8,5 @@ export declare class XFormNavigator3 extends Component<XFormNavigator3Props> {
|
|
|
8
8
|
};
|
|
9
9
|
constructor(props: XFormNavigator3Props);
|
|
10
10
|
openForm(newFormElement: JSX.Element | null): void;
|
|
11
|
-
render(): JSX.Element;
|
|
11
|
+
render(): React.JSX.Element;
|
|
12
12
|
}
|
|
@@ -6,4 +6,4 @@ export interface XFormInlineRowProps {
|
|
|
6
6
|
style?: React.CSSProperties;
|
|
7
7
|
children: JSX.Element | JSX.Element[];
|
|
8
8
|
}
|
|
9
|
-
export declare const XFormInlineRow: (props: XFormInlineRowProps) => JSX.Element;
|
|
9
|
+
export declare const XFormInlineRow: (props: XFormInlineRowProps) => React.JSX.Element;
|
|
@@ -7,4 +7,4 @@ export interface XFormRowColProps {
|
|
|
7
7
|
style?: React.CSSProperties;
|
|
8
8
|
children: JSX.Element | JSX.Element[];
|
|
9
9
|
}
|
|
10
|
-
export declare const XFormRowCol: (props: XFormRowColProps) => JSX.Element;
|
|
10
|
+
export declare const XFormRowCol: (props: XFormRowColProps) => React.JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
export interface XFtsInputValue {
|
|
3
3
|
value: string | null;
|
|
4
4
|
matchMode: 'startsWith' | 'contains' | 'endsWith' | 'equals';
|
|
@@ -6,4 +6,4 @@ export interface XFtsInputValue {
|
|
|
6
6
|
export declare const XFtsInput: (props: {
|
|
7
7
|
value: XFtsInputValue;
|
|
8
8
|
onChange: (value: XFtsInputValue) => void;
|
|
9
|
-
}) => JSX.Element;
|
|
9
|
+
}) => React.JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
export declare const XHolder1: (props: {
|
|
3
3
|
element: any;
|
|
4
|
-
}) => JSX.Element;
|
|
4
|
+
}) => React.JSX.Element;
|
|
5
5
|
export declare const XHolder2: (props: {
|
|
6
6
|
element: any;
|
|
7
|
-
}) => JSX.Element;
|
|
7
|
+
}) => React.JSX.Element;
|