@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 = {
@@ -9,6 +9,7 @@ export interface XInputTextareaBaseProps {
9
9
  readOnly?: boolean;
10
10
  error?: string;
11
11
  style?: React.CSSProperties;
12
+ className?: string;
12
13
  maxLength?: number;
13
14
  tooltip?: string;
14
15
  placeholder?: string;
@@ -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;
@@ -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 (propsClassName !== undefined) {
621
- propsClassName += " " + className;
622
- }
623
- else {
624
- propsClassName = className;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@michalrakus/x-react-web-lib",
3
- "version": "1.37.0",
3
+ "version": "1.37.1",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "clean": "rimraf lib",