UNPKG

igniteui-react-grids

Version:

Ignite UI React grid components.

128 lines (127 loc) 4.69 kB
import { __extends, __values } from "tslib"; import * as React from 'react'; import { NamePatcher, isValidProp, getModifiedProps } from "igniteui-react-core"; import { ReactRenderer } from "igniteui-react-core"; import { DataGridStylingDefaults } from './DataGridStylingDefaults'; import { GridColumnGroupOptions } from './GridColumnGroupOptions'; import { IgrGridColumnOptionsSimpleSectionBase } from "./igr-grid-column-options-simple-section-base"; var IgrGridColumnGroupOptions = /** @class */ /*@__PURE__*/ (function (_super) { __extends(IgrGridColumnGroupOptions, _super); function IgrGridColumnGroupOptions(props) { var _this = _super.call(this, props) || this; _this._reactRenderer = null; if (_this._styling) { NamePatcher.ensureStylablePatched(Object.getPrototypeOf(_this)); } _this._getMainRef = _this._getMainRef.bind(_this); if (document) { _this._mainDiv = document.createElement("div"); _this._mainDiv.style.display = "block"; _this._mainDiv.style.width = "100%"; _this._mainDiv.style.height = "100%"; } var ren = new ReactRenderer(_this._mainDiv, document, true, DataGridStylingDefaults); _this._reactRenderer = ren; var gridColumnGroupOptions = _this.i; gridColumnGroupOptions.provideRenderer(ren); if (props) { _this.initializeProperties(); } return _this; } IgrGridColumnGroupOptions.prototype._getMainRef = function (ref) { this._elRef = ref; }; IgrGridColumnGroupOptions.prototype.render = function () { var children = []; React.Children.forEach(this.props.children, function (ch) { children.push(ch); }); var div = React.createElement("div", { className: "ig-grid-column-group-options igr-grid-column-group-options", ref: this._getMainRef, children: children }); return div; }; IgrGridColumnGroupOptions.prototype.shouldComponentUpdate = function (nextProps, nextState) { var e_1, _a; var mod = getModifiedProps(this.props, nextProps); try { for (var _b = __values(Object.keys(mod)), _c = _b.next(); !_c.done; _c = _b.next()) { var p = _c.value; if (isValidProp(this, p)) { this[p] = mod[p]; } } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_1) throw e_1.error; } } return true; }; IgrGridColumnGroupOptions.prototype.initializeProperties = function () { var e_2, _a; try { for (var _b = __values(Object.keys(this.props)), _c = _b.next(); !_c.done; _c = _b.next()) { var p = _c.value; if (isValidProp(this, p)) { this[p] = this.props[p]; } } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_2) throw e_2.error; } } }; // supports angular themes or custom properties set in CSS IgrGridColumnGroupOptions.prototype.updateStyle = function () { this._styling(this._mainDiv, this); }; IgrGridColumnGroupOptions.prototype.destroy = function () { this.i.destroy(); this._reactRenderer.destroy(); }; IgrGridColumnGroupOptions.prototype.componentWillUnmount = function () { }; IgrGridColumnGroupOptions.prototype.componentDidMount = function () { this._elRef.appendChild(this._mainDiv); this.initializeContent(); }; IgrGridColumnGroupOptions.prototype.initializeContent = function () { this._styling(this._mainDiv, this); this.updateStyle(); }; IgrGridColumnGroupOptions.prototype.createImplementation = function () { return new GridColumnGroupOptions(); }; Object.defineProperty(IgrGridColumnGroupOptions.prototype, "i", { get: function () { return this._implementation; }, enumerable: false, configurable: true }); return IgrGridColumnGroupOptions; }(IgrGridColumnOptionsSimpleSectionBase)); export { IgrGridColumnGroupOptions };