react-application-core
Version:
A react-based application core for the business applications.
94 lines • 3.68 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.TextArea = void 0;
var React = require("react");
var util_1 = require("../../../util");
var definition_1 = require("../../../definition");
var text_field_1 = require("../text-field");
/**
* @component-impl
* @stable [20.06.2020]
*/
var TextArea = /** @class */ (function (_super) {
__extends(TextArea, _super);
function TextArea() {
return _super !== null && _super.apply(this, arguments) || this;
}
/**
* @stable [14.10.2020]
* @protected
*/
TextArea.prototype.getInputElementProps = function () {
var _a = this.originalProps, cols = _a.cols, rows = _a.rows;
return __assign(__assign({}, _super.prototype.getInputElementProps.call(this)), { cols: cols,
rows: rows });
};
/**
* @stable [14.10.2020]
* @protected
*/
TextArea.prototype.getInputElement = function () {
return React.createElement("textarea", __assign({}, this.getInputElementProps()));
};
Object.defineProperty(TextArea.prototype, "inputAttachmentElement", {
/**
* @stable [14.10.2020]
* @protected
*/
get: function () {
var _this = this;
var maxLength = this.mergedProps.maxLength;
var MAX_LENGTH_OF = this.settings.messages.MAX_LENGTH_OF;
return util_1.ConditionUtils.ifNotNilThanValue(maxLength, function () { return (React.createElement("label", { className: definition_1.FieldClassesEnum.INPUT_LABEL }, _this.t(MAX_LENGTH_OF, {
length: (_this.value || '').length,
maxLength: maxLength,
}))); });
},
enumerable: false,
configurable: true
});
/**
* @stable [14.10.2020]
* @protected
*/
TextArea.prototype.getFieldClassName = function () {
return util_1.ClsUtils.joinClassName(_super.prototype.getFieldClassName.call(this), definition_1.TextAreaClassesEnum.TEXT_AREA);
};
/**
* @stable [14.10.2020]
* @protected
*/
TextArea.prototype.getComponentsSettingsProps = function () {
return util_1.PropsUtils.mergeWithSystemProps(_super.prototype.getComponentsSettingsProps.call(this), this.componentsSettings.textarea);
};
TextArea.defaultProps = util_1.PropsUtils.mergeWithParentDefaultProps({
clearActionRendered: false,
}, text_field_1.BaseTextField);
return TextArea;
}(text_field_1.BaseTextField));
exports.TextArea = TextArea;
//# sourceMappingURL=text-area.component.js.map