@up-group/react-controls
Version:
We know that there are a ton of react UI library projects to choose from. Our hope with this one is to provide the next generation of react components that you can use to bootstrap your next project, or as a reference for building a UIKit. Read on to get
72 lines • 3.74 kB
JavaScript
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
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) || 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;
};
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
t[p[i]] = s[p[i]];
return t;
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = require("react");
var classNames = require("classnames");
var assign = require("object-assign");
var UpCol = (function (_super) {
__extends(UpCol, _super);
function UpCol() {
return _super !== null && _super.apply(this, arguments) || this;
}
UpCol.prototype.render = function () {
var props = this.props;
var span = props.span, order = props.order, offset = props.offset, xs = props.xs, sm = props.sm, md = props.md, lg = props.lg, xl = props.xl, push = props.push, pull = props.pull, className = props.className, children = props.children, _a = props.prefixCls, prefixCls = _a === void 0 ? 'up-col' : _a, others = __rest(props, ["span", "order", "offset", "xs", "sm", "md", "lg", "xl", "push", "pull", "className", "children", "prefixCls"]);
var sizeClassObj = {};
['xs', 'sm', 'md', 'lg', 'xl'].forEach(function (size) {
var sizeProps = {};
if (typeof props[size] === 'number') {
sizeProps.span = props[size];
}
else if (typeof props[size] === 'object') {
sizeProps = props[size] || {};
}
sizeClassObj = assign({}, sizeClassObj, (_a = {},
_a[prefixCls + "-" + size + "-" + sizeProps.span] = sizeProps.span !== undefined,
_a[prefixCls + "-" + size + "-order-" + sizeProps.order] = sizeProps.order || sizeProps.order === 0,
_a[prefixCls + "-" + size + "-offset-" + sizeProps.offset] = sizeProps.offset || sizeProps.offset === 0,
_a[prefixCls + "-" + size + "-push-" + sizeProps.push] = sizeProps.push || sizeProps.push === 0,
_a[prefixCls + "-" + size + "-pull-" + sizeProps.pull] = sizeProps.pull || sizeProps.pull === 0,
_a));
var _a;
});
var classes = classNames((_b = {},
_b[prefixCls + "-" + span] = span !== undefined,
_b[prefixCls + "-order-" + order] = order,
_b[prefixCls + "-offset-" + offset] = offset,
_b[prefixCls + "-push-" + push] = push,
_b[prefixCls + "-pull-" + pull] = pull,
_b), className, sizeClassObj);
return React.createElement("div", __assign({}, others, { className: classes }), children);
var _b;
};
return UpCol;
}(React.Component));
exports.default = UpCol;
//# sourceMappingURL=UpCol.js.map
;