@michalrakus/x-react-web-lib 1.37.0 → 1.37.2
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/components/XFormDataTable2.js +1 -1
- package/lib/components/XFtsInput.js +2 -1
- package/lib/components/XInput.d.ts +1 -0
- package/lib/components/XInputTextarea.js +1 -1
- package/lib/components/XInputTextareaBase.d.ts +1 -0
- package/lib/components/XInputTextareaBase.js +1 -1
- package/lib/components/XLazyDataTable/XLazyDataTable.d.ts +2 -0
- package/lib/components/XLazyDataTable/XLazyDataTable.js +4 -1
- package/lib/components/XUtils.d.ts +1 -1
- package/lib/components/XUtils.js +7 -5
- package/lib/components/locale/x-en.json +1 -0
- package/package.json +1 -1
|
@@ -284,7 +284,7 @@ var XFormDataTable2 = exports.XFormDataTable2 = /** @class */ (function (_super)
|
|
|
284
284
|
filterMatchMode = api_1.FilterMatchMode.CONTAINS;
|
|
285
285
|
}
|
|
286
286
|
// zatial vsetky ostatne EQUALS
|
|
287
|
-
else if (xField.type === "decimal" || xField.type === "number" || xField.type === "date" || xField.type === "datetime" || xField.type === "boolean") {
|
|
287
|
+
else if (xField.type === "decimal" || xField.type === "number" || xField.type === "interval" || xField.type === "date" || xField.type === "datetime" || xField.type === "boolean") {
|
|
288
288
|
filterMatchMode = api_1.FilterMatchMode.EQUALS;
|
|
289
289
|
}
|
|
290
290
|
else {
|
|
@@ -18,6 +18,7 @@ exports.XFtsInput = void 0;
|
|
|
18
18
|
var react_1 = __importDefault(require("react"));
|
|
19
19
|
var XInputTextBase_1 = require("./XInputTextBase");
|
|
20
20
|
var XUtils_1 = require("./XUtils");
|
|
21
|
+
var XLocale_1 = require("./XLocale");
|
|
21
22
|
var XFtsInput = function (props) {
|
|
22
23
|
var onChange = function (value) {
|
|
23
24
|
props.value.value = value;
|
|
@@ -25,6 +26,6 @@ var XFtsInput = function (props) {
|
|
|
25
26
|
};
|
|
26
27
|
// TODO - pridat input na zmenu matchMode
|
|
27
28
|
// we use XInputTextBase - we save onChange calls
|
|
28
|
-
return (react_1.default.createElement(XInputTextBase_1.XInputTextBase, { value: props.value.value, onChange: onChange, style: { height: '2.5rem', width: XUtils_1.XUtils.isMobile() ? '7rem' : '17rem' }, className: "m-1" }));
|
|
29
|
+
return (react_1.default.createElement(XInputTextBase_1.XInputTextBase, { value: props.value.value, onChange: onChange, style: { height: '2.5rem', width: XUtils_1.XUtils.isMobile() ? '7rem' : '17rem' }, className: "m-1", placeholder: (0, XLocale_1.xLocaleOption)('searchInAllFields') }));
|
|
29
30
|
};
|
|
30
31
|
exports.XFtsInput = XFtsInput;
|
|
@@ -4,6 +4,7 @@ import { XField } from "../serverApi/XEntityMetadata";
|
|
|
4
4
|
export interface XInputProps<T> extends XFormComponentProps<T> {
|
|
5
5
|
field: string;
|
|
6
6
|
inputStyle?: React.CSSProperties;
|
|
7
|
+
inputClassName?: string;
|
|
7
8
|
}
|
|
8
9
|
export declare abstract class XInput<T, P extends XInputProps<T>> extends XFormComponent<T, P> {
|
|
9
10
|
protected xField: XField;
|
|
@@ -99,7 +99,7 @@ var XInputTextarea = exports.XInputTextarea = /** @class */ (function (_super) {
|
|
|
99
99
|
react_1.default.createElement("label", { id: labelElemId, htmlFor: this.props.field, className: !this.labelOnTop ? 'col-fixed' : undefined, style: labelStyle }, this.getLabel()),
|
|
100
100
|
labelTooltip ? react_1.default.createElement(tooltip_1.Tooltip, { target: "#".concat(labelElemId), content: labelTooltip }) : null,
|
|
101
101
|
this.props.form.state.object ?
|
|
102
|
-
react_1.default.createElement(XInputTextareaBase_1.XInputTextareaBase, { ref: this.xInputTextareaBaseRef, id: this.props.field, value: value, onChange: this.onValueChange, readOnly: this.isReadOnly(), maxLength: this.xField.length, style: inputStyle, rows: this.props.rows, cols: cols, autoResize: this.props.autoResize, error: this.getError(), tooltip: this.props.tooltip, placeholder: (_b = this.props.placeholder) !== null && _b !== void 0 ? _b : this.props.desc })
|
|
102
|
+
react_1.default.createElement(XInputTextareaBase_1.XInputTextareaBase, { ref: this.xInputTextareaBaseRef, id: this.props.field, value: value, onChange: this.onValueChange, readOnly: this.isReadOnly(), maxLength: this.xField.length, style: inputStyle, className: this.props.inputClassName, rows: this.props.rows, cols: cols, autoResize: this.props.autoResize, error: this.getError(), tooltip: this.props.tooltip, placeholder: (_b = this.props.placeholder) !== null && _b !== void 0 ? _b : this.props.desc })
|
|
103
103
|
: null));
|
|
104
104
|
};
|
|
105
105
|
XInputTextarea.defaultProps = {
|
|
@@ -99,7 +99,7 @@ var XInputTextareaBase = /** @class */ (function (_super) {
|
|
|
99
99
|
}
|
|
100
100
|
};
|
|
101
101
|
XInputTextareaBase.prototype.render = function () {
|
|
102
|
-
return (react_1.default.createElement(inputtextarea_1.InputTextarea, __assign({ ref: this.inputTextareaRef, id: this.props.id, value: this.getInputValue(), onChange: this.onChange, onBlur: this.onBlur, readOnly: this.props.readOnly, maxLength: this.props.maxLength, style: this.props.style, rows: this.props.rows, cols: this.props.cols, autoResize: this.props.autoResize }, XUtils_1.XUtils.createTooltipOrErrorProps(this.props.error, this.props.tooltip), { placeholder: this.props.placeholder })));
|
|
102
|
+
return (react_1.default.createElement(inputtextarea_1.InputTextarea, __assign({ ref: this.inputTextareaRef, id: this.props.id, value: this.getInputValue(), onChange: this.onChange, onBlur: this.onBlur, readOnly: this.props.readOnly, maxLength: this.props.maxLength, style: this.props.style, rows: this.props.rows, cols: this.props.cols, autoResize: this.props.autoResize }, XUtils_1.XUtils.addClassName(XUtils_1.XUtils.createTooltipOrErrorProps(this.props.error, this.props.tooltip), this.props.className), { placeholder: this.props.placeholder })));
|
|
103
103
|
};
|
|
104
104
|
return XInputTextareaBase;
|
|
105
105
|
}(react_1.Component));
|
|
@@ -96,6 +96,8 @@ export interface XLazyDataTableProps {
|
|
|
96
96
|
multilineSwitchInitValue?: XMultilineRenderType;
|
|
97
97
|
multilineSwitchFewLinesCount?: number;
|
|
98
98
|
multilineSwitchValue?: [XMultilineRenderType, React.Dispatch<React.SetStateAction<XMultilineRenderType>>];
|
|
99
|
+
headerBodyTop?: React.ReactNode;
|
|
100
|
+
headerBodyLeft?: React.ReactNode;
|
|
99
101
|
headerBodyRight?: React.ReactNode;
|
|
100
102
|
searchBrowseParams?: XSearchBrowseParams;
|
|
101
103
|
width?: string;
|
|
@@ -243,7 +243,7 @@ exports.XLazyDataTable = (0, react_1.forwardRef)(function (_a, ref) {
|
|
|
243
243
|
filterMatchMode = api_1.FilterMatchMode.CONTAINS;
|
|
244
244
|
}
|
|
245
245
|
// zatial vsetky ostatne EQUALS
|
|
246
|
-
else if (xField.type === "decimal" || xField.type === "number" || xField.type === "date" || xField.type === "datetime" || xField.type === "boolean") {
|
|
246
|
+
else if (xField.type === "decimal" || xField.type === "number" || xField.type === "interval" || xField.type === "date" || xField.type === "datetime" || xField.type === "boolean") {
|
|
247
247
|
filterMatchMode = api_1.FilterMatchMode.EQUALS;
|
|
248
248
|
}
|
|
249
249
|
else {
|
|
@@ -1449,8 +1449,11 @@ exports.XLazyDataTable = (0, react_1.forwardRef)(function (_a, ref) {
|
|
|
1449
1449
|
// align-items-center centruje vertikalne (posuva smerom dolu do stredu)
|
|
1450
1450
|
// x-lazy-datatable-label-right-compensation - vyvazuje label, aby item-y v strede isli aspon priblizne do stredu
|
|
1451
1451
|
return (react_1.default.createElement("div", null,
|
|
1452
|
+
props.headerBodyTop ?
|
|
1453
|
+
react_1.default.createElement("div", { className: "flex justify-content-center align-items-center" }, props.headerBodyTop) : null,
|
|
1452
1454
|
react_1.default.createElement("div", { className: "flex justify-content-center align-items-center" },
|
|
1453
1455
|
props.label ? react_1.default.createElement("div", { className: "x-lazy-datatable-label", style: props.labelStyle }, props.label) : null,
|
|
1456
|
+
props.headerBodyLeft,
|
|
1454
1457
|
ftsInputValue ? react_1.default.createElement(XFtsInput_1.XFtsInput, { value: ftsInputValue, onChange: function (value) { return setFtsInputValue(value); } }) : null,
|
|
1455
1458
|
props.showFilterButtons ? react_1.default.createElement(XButton_1.XButton, { key: "filter", icon: isMobile ? "pi pi-search" : undefined, label: !isMobile ? (0, XLocale_1.xLocaleOption)('filter') : undefined, onClick: onClickFilter }) : null,
|
|
1456
1459
|
props.showFilterButtons ? react_1.default.createElement(XButton_1.XButton, { key: "resetTable", icon: isMobile ? "pi pi-ban" : undefined, label: !isMobile ? (0, XLocale_1.xLocaleOption)('resetTable') : undefined, onClick: onClickResetTable }) : null,
|
|
@@ -101,7 +101,7 @@ export declare class XUtils {
|
|
|
101
101
|
static createTooltipOrErrorProps(error: string | undefined, tooltip?: string | undefined): object;
|
|
102
102
|
static addClassName(props: {
|
|
103
103
|
[key: string]: any;
|
|
104
|
-
}, className: string): {
|
|
104
|
+
}, className: string | undefined): {
|
|
105
105
|
[key: string]: any;
|
|
106
106
|
};
|
|
107
107
|
static getErrorMessages(xErrorMap: XErrorMap): string;
|
package/lib/components/XUtils.js
CHANGED
|
@@ -617,11 +617,13 @@ var XUtils = exports.XUtils = /** @class */ (function () {
|
|
|
617
617
|
// pouzivame ju, lebo XUtils.createErrorProps nam prebijal className
|
|
618
618
|
XUtils.addClassName = function (props, className) {
|
|
619
619
|
var propsClassName = props.className;
|
|
620
|
-
if (
|
|
621
|
-
propsClassName
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
620
|
+
if (className !== undefined) {
|
|
621
|
+
if (propsClassName !== undefined) {
|
|
622
|
+
propsClassName += " " + className;
|
|
623
|
+
}
|
|
624
|
+
else {
|
|
625
|
+
propsClassName = className;
|
|
626
|
+
}
|
|
625
627
|
}
|
|
626
628
|
props.className = propsClassName;
|
|
627
629
|
return props;
|