UNPKG

react-application-core

Version:

A react-based application core for the business applications.

51 lines 2.17 kB
"use strict"; 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 __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.Switch = void 0; var React = require("react"); var checkbox_1 = require("../checkbox"); var util_1 = require("../../../util"); var thumb_1 = require("../../thumb"); var definition_1 = require("../../../definition"); /** * @component-impl * @stable [26.10.2020] */ var Switch = /** @class */ (function (_super) { __extends(Switch, _super); function Switch() { return _super !== null && _super.apply(this, arguments) || this; } /** * @stable [26.10.2020] * @protected */ Switch.prototype.getInputElement = function () { var thumbClassName = this.originalProps.thumbClassName; return (React.createElement(React.Fragment, null, React.createElement(thumb_1.Thumb, { className: util_1.ClsUtils.joinClassName(definition_1.SwitchClassesEnum.THUMB, util_1.CalcUtils.calc(thumbClassName)), disabled: this.isDisabled, value: this.value }), _super.prototype.getInputElement.call(this))); }; /** * @stable [26.10.2020] */ Switch.prototype.getFieldClassName = function () { return util_1.ClsUtils.joinClassName(_super.prototype.getFieldClassName.call(this), definition_1.SwitchClassesEnum.SWITCH); }; Switch.defaultProps = util_1.PropsUtils.mergeWithParentDefaultProps({}, checkbox_1.BaseCheckbox); return Switch; }(checkbox_1.BaseCheckbox)); exports.Switch = Switch; //# sourceMappingURL=switch.component.js.map