@michalrakus/x-react-web-lib 1.37.0 → 1.37.1
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.
|
@@ -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));
|
|
@@ -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;
|