igniteui-react-grids
Version:
Ignite UI React grid components.
77 lines (76 loc) • 2.79 kB
JavaScript
import { __assign, __extends } from "tslib";
import * as React from 'react';
import { IgrColumnGroup } from "./igr-column-group";
import { ColumnLayout } from "./ColumnLayout";
import { isValidProp } from "igniteui-react-core";
/**
* Column layout for declaration of Multi-row Layout
* @igxParent IgxGridComponent
*/
var IgrColumnLayout = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgrColumnLayout, _super);
function IgrColumnLayout(props) {
var _this = _super.call(this, props) || this;
_this._getMainRef = _this._getMainRef.bind(_this);
return _this;
}
IgrColumnLayout.prototype.createImplementation = function () {
var _a, _b;
var impl = new ColumnLayout();
var nat;
if (typeof document !== 'undefined') {
nat = document.createElement("igc-column-layout");
}
else {
nat = {
style: {}
};
}
if ((_a = this.props) === null || _a === void 0 ? void 0 : _a.className) {
nat.className = this.props.className;
}
if ((_b = this.props) === null || _b === void 0 ? void 0 : _b.id) {
nat.id = this.props.id;
}
impl.setNativeElement(nat);
return impl;
};
Object.defineProperty(IgrColumnLayout.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
IgrColumnLayout.prototype.render = function () {
var _this = this;
var nativePropsName = Object.keys(this.props).filter(function (prop) { return !isValidProp(_this, prop) && prop !== "originalRef" && prop !== "className"; });
var nativeProps = {};
nativePropsName.forEach(function (propName) {
nativeProps[propName] = _this.props[propName];
});
var visibleChildren = [];
React.Children.forEach(this.props.children, function (ch) {
if (ch) {
visibleChildren.push(ch);
}
});
var children = this._contentChildrenManager.getChildren(visibleChildren);
this._portalManager.onRender(children);
var style = {};
style.display = 'contents';
if (this.props.style) {
style = this.props.style;
}
var div = React.createElement("div", __assign(__assign({}, nativeProps), { ref: this._getMainRef, style: style, children: children }));
return div;
};
IgrColumnLayout.prototype._getMainRef = function (ref) {
this._elRef = ref;
};
return IgrColumnLayout;
}(IgrColumnGroup));
export { IgrColumnLayout };