igniteui-react-grids
Version:
Ignite UI React grid components.
1,085 lines (1,080 loc) • 37.3 kB
JavaScript
import { __extends, __values } from "tslib";
import * as React from 'react';
import { delegateCombine, delegateRemove } from "igniteui-react-core";
import { CellContentHorizontalAlignment_$type } from "./CellContentHorizontalAlignment";
import { CellContentVerticalAlignment_$type } from "./CellContentVerticalAlignment";
import { TextCellLineBreakMode_$type } from "./TextCellLineBreakMode";
import { IgrDataBindingEventArgs } from "./igr-data-binding-event-args";
import { IgrCellStyleRequestedEventArgs } from "./igr-cell-style-requested-event-args";
import { ensureBool, getModifiedProps, isValidProp, brushToString, stringToBrush, ensureEnum, initializePropertiesFromCss, NamePatcher, toSpinal, CollectionAdapter } from "igniteui-react-core";
import { FontInfo } from "igniteui-react-core";
import { ColumnPropertyUpdatingAnimationMode } from './ColumnPropertyUpdatingAnimationMode';
import { TypeRegistrar } from "igniteui-react-core";
import { IgrGridConditionalStyleCollection } from './igr-grid-conditional-style-collection';
import { GridConditionalStyle } from './GridConditionalStyle';
import { NotifyCollectionChangedAction } from "igniteui-react-core";
import { ContentChildrenManager } from "igniteui-react-core";
/**
* Base class for various definition types for the grid.
*/
var IgrDefinitionBase = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgrDefinitionBase, _super);
function IgrDefinitionBase(props) {
var _this = _super.call(this, props) || this;
_this.mounted = false;
_this.__p = null;
_this._hasUserValues = new Set();
_this._stylingContainer = null;
_this._stylingParent = null;
_this._inStyling = false;
_this._renderer = null;
_this._conditionalStyles = null;
_this._dataBinding = null;
_this._dataBinding_wrapped = null;
_this._dataBound = null;
_this._dataBound_wrapped = null;
_this._cellStyleKeyRequested = null;
_this._cellStyleKeyRequested_wrapped = null;
if (_this._styling) {
NamePatcher.ensureStylablePatched(Object.getPrototypeOf(_this));
}
_this._implementation = _this.createImplementation();
_this._implementation.externalObject = _this;
_this.onImplementationCreated();
if (_this._initializeAdapters) {
_this._initializeAdapters();
}
return _this;
}
IgrDefinitionBase.prototype.createImplementation = function () {
return null;
};
Object.defineProperty(IgrDefinitionBase.prototype, "nativeElement", {
get: function () {
return this._implementation.nativeElement;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
} /**
* @hidden
*/,
enumerable: false,
configurable: true
});
IgrDefinitionBase._createFromInternal = function (internal) {
if (!internal) {
return null;
}
if (!internal.$type) {
return null;
}
var name = internal.$type.name;
var externalName = "Igr" + name;
if (!TypeRegistrar.isRegistered(externalName)) {
return null;
}
return TypeRegistrar.create(externalName);
};
IgrDefinitionBase.prototype.componentDidMount = function () {
var e_1, _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_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;
}
}
};
IgrDefinitionBase.prototype.onImplementationCreated = function () {
};
IgrDefinitionBase.prototype._initializeAdapters = function () {
var _this = this;
if (!this._contentChildrenManager) {
var resolveNested_1 = (function (props, propName, nestedPropName) {
var _a;
var prop = props[propName];
if (Array.isArray(prop)) {
return prop.map(function (x) {
var _a;
return (_a = x[nestedPropName]) !== null && _a !== void 0 ? _a : resolveNested_1(x.props, propName, nestedPropName);
}).join("_");
}
else if (prop) {
return (_a = prop.props[nestedPropName]) !== null && _a !== void 0 ? _a : resolveNested_1(prop.props, propName, nestedPropName);
}
else {
return props[nestedPropName];
}
});
this._contentChildrenManager = new ContentChildrenManager(function (ch) {
var key = ch.key || ch.props.name;
if (!key) {
var type = (ch.type);
var instance = new type;
var name_1 = instance.i.$type.name;
switch (name_1) {
default: return undefined;
}
}
return key;
}, function (ch) {
var key = ch.key || ch.props.name;
if (!key) {
var type = (ch.type);
var instance = new type;
var name_2 = instance.i.$type.name;
switch (name_2) {
default: return undefined;
}
}
return key;
}, function () {
if (_this._updateContentChildren) {
_this._updateContentChildren();
}
else if (_this._updateAdapters) {
_this._updateAdapters();
}
});
}
this._conditionalStylesAdapter = new CollectionAdapter(this.contentConditionalStyles, this.i.conditionalStyles, this.actualConditionalStyles, function (c) { return c.i; }, function (i) {
if (_this._initializeElement) {
_this._initializeElement(i);
}
}, function (i) {
if (_this._destroyElement) {
_this._destroyElement(i);
}
});
if (_super.prototype["_initializeAdapters"]) {
_super.prototype["_initializeAdapters"].call(this);
}
};
IgrDefinitionBase.prototype._updateAdapters = function () {
if (_super.prototype["_updateAdapters"]) {
_super.prototype["_updateAdapters"].call(this);
}
var contentChildrenActual = this._contentChildrenManager.contentChildrenActual;
this.contentConditionalStyles.length = 0;
for (var i = 0; i < contentChildrenActual.length; i++) {
if ((GridConditionalStyle.$type).isAssignableFrom(contentChildrenActual[i].i.$type)) {
this.contentConditionalStyles.push(contentChildrenActual[i]);
}
}
if (this._conditionalStylesAdapter != null) {
this._conditionalStylesAdapter.notifyContentChanged();
}
};
Object.defineProperty(IgrDefinitionBase.prototype, "hasUserValues", {
get: function () {
return this._hasUserValues;
},
enumerable: false,
configurable: true
});
IgrDefinitionBase.prototype.__m = function (propertyName) {
if (!this._inStyling) {
this._hasUserValues.add(propertyName);
}
};
IgrDefinitionBase.prototype._styling = function (container, component, parent) {
this._stylingContainer = container;
this._stylingParent = component;
if (this._inStyling) {
return;
}
this._inStyling = true;
var grid = component._grid;
var prev;
if (grid) {
prev = grid.columnPropertyUpdatingAnimationMode;
grid.columnPropertyUpdatingAnimationMode = ColumnPropertyUpdatingAnimationMode.None;
}
var genericPrefix = "";
var typeName = this.i.$type.name;
var lowerTypeName = typeName.toLowerCase();
if (lowerTypeName.indexOf("column") >= 0) {
genericPrefix = "column";
}
else if (lowerTypeName.indexOf("sectionheader") >= 0) {
genericPrefix = "section-header";
}
else if (lowerTypeName.indexOf("sectionfooter") >= 0) {
genericPrefix = "section-footer";
}
else if (lowerTypeName.indexOf("rowseparator") >= 0) {
genericPrefix = "row-separator";
}
else if (lowerTypeName.indexOf("summaryrowroot") >= 0) {
genericPrefix = "summary-row-root";
}
else if (lowerTypeName.indexOf("summaryrowsection") >= 0) {
genericPrefix = "summary-row-section";
}
else if (lowerTypeName.indexOf("headerseparator") >= 0) {
genericPrefix = "header-separator";
}
else {
genericPrefix = "header";
}
var additionalPrefixes = [];
var prefix = toSpinal(typeName);
additionalPrefixes.push(prefix + "-");
if (parent) {
var parentTypeName = parent.i.$type.name;
if (parentTypeName == "Grid") {
parentTypeName = "DataGrid";
}
var parentPrefix = toSpinal(parentTypeName);
additionalPrefixes.push(parentPrefix + "-" + genericPrefix + "-");
additionalPrefixes.push(parentPrefix + "-" + prefix + "-");
}
initializePropertiesFromCss(container, this, genericPrefix + "-", this.hasUserValues, false, additionalPrefixes);
if (grid) {
grid.columnPropertyUpdatingAnimationMode = prev;
}
this._inStyling = false;
};
IgrDefinitionBase.prototype._provideRenderer = function (renderer) {
this._renderer = renderer;
};
IgrDefinitionBase.prototype.shouldComponentUpdate = function (nextProps, nextState) {
var e_2, _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_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;
}
}
return true;
};
IgrDefinitionBase.prototype.render = function () {
var children = this._contentChildrenManager.getChildren(this.props.children);
var div = React.createElement("div", {
children: children
});
return div;
};
Object.defineProperty(IgrDefinitionBase.prototype, "background", {
/**
* Gets or sets the background color to use.
*/
get: function () {
return brushToString(this.i.ge);
},
set: function (v) {
this.i.ge = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "actualConditionalStyles", {
get: function () {
if (!this._actualConditionalStyles) {
this._actualConditionalStyles = [];
}
return this._actualConditionalStyles;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "contentConditionalStyles", {
get: function () {
if (!this._contentConditionalStyles) {
this._contentConditionalStyles = [];
}
return this._contentConditionalStyles;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "conditionalStyles", {
/**
* Gets the style key information to use for judging when a property will be set later by a style
*/
get: function () {
var _this = this;
if (this._conditionalStyles === null) {
var coll = new IgrGridConditionalStyleCollection();
var inner = coll._innerColl;
this._conditionalStyles = coll;
inner.addListener(function (sender, e) {
switch (e.action) {
case NotifyCollectionChangedAction.Add:
_this._conditionalStylesAdapter.insertManualItem(e.newStartingIndex, e.newItems.item(0));
break;
case NotifyCollectionChangedAction.Remove:
_this._conditionalStylesAdapter.removeManualItemAt(e.oldStartingIndex);
break;
case NotifyCollectionChangedAction.Replace:
_this._conditionalStylesAdapter.removeManualItemAt(e.oldStartingIndex);
_this._conditionalStylesAdapter.insertManualItem(e.newStartingIndex, e.newItems.item(0));
break;
case NotifyCollectionChangedAction.Reset:
_this._conditionalStylesAdapter.clearManualItems();
break;
}
});
;
}
return this._conditionalStyles;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "border", {
/**
* Gets or sets the background color to use.
*/
get: function () {
return brushToString(this.i.gh);
},
set: function (v) {
this.i.gh = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "activationBorder", {
/**
* Gets or sets the background color to use.
*/
get: function () {
return brushToString(this.i.f3);
},
set: function (v) {
this.i.f3 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "errorBorder", {
/**
* Gets or sets the error border color to use.
*/
get: function () {
return brushToString(this.i.gi);
},
set: function (v) {
this.i.gi = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "actualBorder", {
/**
* Gets the actual border color that will be used.
*/
get: function () {
return brushToString(this.i.f8);
},
set: function (v) {
this.i.f8 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "borderLeftWidth", {
/**
* Gets or sets the amount of left border to use for the cell content for this column.
*/
get: function () {
return this.i.cc;
},
set: function (v) {
this.i.cc = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "borderTopWidth", {
/**
* Gets or sets the amount of top border to use for the cell content for this column.
*/
get: function () {
return this.i.ce;
},
set: function (v) {
this.i.ce = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "borderRightWidth", {
/**
* Gets or sets the amount of right border to use for the cell content of this column.
*/
get: function () {
return this.i.cd;
},
set: function (v) {
this.i.cd = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "borderBottomWidth", {
/**
* Gets or sets the amount of bottom border to use for the cell content of this column.
*/
get: function () {
return this.i.cb;
},
set: function (v) {
this.i.cb = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "activationBorderLeftWidth", {
/**
* Gets or sets the amount of left activation border to use for the cell content for this column.
*/
get: function () {
return this.i.b4;
},
set: function (v) {
this.i.b4 = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "activationBorderTopWidth", {
/**
* Gets or sets the amount of top activation border to use for the cell content for this column.
*/
get: function () {
return this.i.b6;
},
set: function (v) {
this.i.b6 = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "activationBorderRightWidth", {
/**
* Gets or sets the amount of right activation border to use for the cell content of this column.
*/
get: function () {
return this.i.b5;
},
set: function (v) {
this.i.b5 = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "activationBorderBottomWidth", {
/**
* Gets or sets the amount of bottom activation border to use for the cell content of this column.
*/
get: function () {
return this.i.b3;
},
set: function (v) {
this.i.b3 = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "errorBorderLeftWidth", {
get: function () {
return this.i.cg;
},
set: function (v) {
this.i.cg = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "errorBorderTopWidth", {
get: function () {
return this.i.ci;
},
set: function (v) {
this.i.ci = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "errorBorderRightWidth", {
get: function () {
return this.i.ch;
},
set: function (v) {
this.i.ch = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "errorBorderBottomWidth", {
get: function () {
return this.i.cf;
},
set: function (v) {
this.i.cf = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "actualBackground", {
/**
* Gets the actual background color that will be used.
*/
get: function () {
return brushToString(this.i.f5);
},
set: function (v) {
this.i.f5 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "actualActivationBorder", {
/**
* Gets the actual background color that will be used.
*/
get: function () {
return brushToString(this.i.f4);
},
set: function (v) {
this.i.f4 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "actualErrorBorder", {
/**
* Gets the actual error border color that will be used.
*/
get: function () {
return brushToString(this.i.f9);
},
set: function (v) {
this.i.f9 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "stickyRowBackground", {
/**
* Gets or sets the background color for content that sticks to the top of the grid.
*/
get: function () {
return brushToString(this.i.gw);
},
set: function (v) {
this.i.gw = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "actualStickyRowBackground", {
/**
* Gets the actual background color for content that sticks to the top of the grid.
*/
get: function () {
return brushToString(this.i.gc);
},
set: function (v) {
this.i.gc = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "pinnedRowBackground", {
/**
* Gets or sets the background color for cells belonging to rows marked as pinned.
*/
get: function () {
return brushToString(this.i.gv);
},
set: function (v) {
this.i.gv = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "actualPinnedRowBackground", {
/**
* Gets the actual background color for cells belonging to rows marked as pinned.
*/
get: function () {
return brushToString(this.i.gb);
},
set: function (v) {
this.i.gb = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "lastStickyRowBackground", {
/**
* Gets or sets the color for the last row in the sticky row area.
*/
get: function () {
return brushToString(this.i.gu);
},
set: function (v) {
this.i.gu = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "actualLastStickyRowBackground", {
/**
* Gets the actual color for the last row in the sticky row area.
*/
get: function () {
return brushToString(this.i.ga);
},
set: function (v) {
this.i.ga = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "contentOpacity", {
/**
* Gets or sets the opacity of the content.
*/
get: function () {
return this.i.bh;
},
set: function (v) {
this.i.bh = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "horizontalAlignment", {
/**
* Gets or sets the horizontal alignment to use for the cell content.
*/
get: function () {
return this.i.g;
},
set: function (v) {
this.i.g = ensureEnum(CellContentHorizontalAlignment_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "verticalAlignment", {
/**
* Gets or sets the vertical alignment to use for the cell content.
*/
get: function () {
return this.i.l;
},
set: function (v) {
this.i.l = ensureEnum(CellContentVerticalAlignment_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "lineBreakMode", {
/**
* Gets or sets the line breaking mode to use if text is present in the cell.
*/
get: function () {
return this.i.ac;
},
set: function (v) {
this.i.ac = ensureEnum(TextCellLineBreakMode_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "actualLineBreakMode", {
/**
* Gets the actual line break mode which will be used if text is present in the cell.
*/
get: function () {
return this.i.ab;
},
set: function (v) {
this.i.ab = ensureEnum(TextCellLineBreakMode_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "textColor", {
/**
* Gets or sets the color to use for displaying text.
*/
get: function () {
return brushToString(this.i.gx);
},
set: function (v) {
this.i.gx = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "actualTextColor", {
/**
* Gets the actual color used for displaying text.
*/
get: function () {
return brushToString(this.i.gd);
},
set: function (v) {
this.i.gd = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "isBarSupported", {
/**
* Gets or sets whether the bar is supported.
*/
get: function () {
return this.i.ar;
},
set: function (v) {
this.i.ar = ensureBool(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "barBackground", {
/**
* Gets or sets the color to use for value bars.
*/
get: function () {
return brushToString(this.i.gf);
},
set: function (v) {
this.i.gf = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "actualBarBackground", {
/**
* Gets the actual color used for value bars.
*/
get: function () {
return brushToString(this.i.f6);
},
set: function (v) {
this.i.f6 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "barOutline", {
/**
* Gets or sets the Outline color to use for value bars.
*/
get: function () {
return brushToString(this.i.gg);
},
set: function (v) {
this.i.gg = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "actualBarOutline", {
/**
* Gets the actual Outline color used for value bars.
*/
get: function () {
return brushToString(this.i.f7);
},
set: function (v) {
this.i.f7 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "barStrokeThickness", {
/**
* Gets or sets the stroke thickness to use for value bars.
*/
get: function () {
return this.i.ca;
},
set: function (v) {
this.i.ca = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "actualBarStrokeThickness", {
/**
* Gets the actual stroke thickness used for value bars.
*/
get: function () {
return this.i.b8;
},
set: function (v) {
this.i.b8 = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "barCornerRadius", {
/**
* Gets or sets the stroke thickness to use for value bars.
*/
get: function () {
return this.i.b9;
},
set: function (v) {
this.i.b9 = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "actualBarCornerRadius", {
/**
* Gets the actual stroke thickness used for value bars.
*/
get: function () {
return this.i.b7;
},
set: function (v) {
this.i.b7 = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "pinnedRowOpacity", {
/**
* Gets or sets the color to use for displaying text.
*/
get: function () {
return this.i.bm;
},
set: function (v) {
this.i.bm = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "actualPinnedRowOpacity", {
/**
* Gets or sets the color to use for displaying text.
*/
get: function () {
return this.i.bf;
},
set: function (v) {
this.i.bf = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "textStyle", {
get: function () {
if (this.i.textStyle == null) {
return null;
}
return this.i.textStyle.fontString;
},
set: function (v) {
var fi = new FontInfo();
fi.fontString = v;
this.i.textStyle = fi;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "isBarRequired", {
get: function () {
return this.i.aq;
},
enumerable: false,
configurable: true
});
IgrDefinitionBase.prototype.findByName = function (name) {
if (this.findEphemera) {
if (name && name.indexOf("@@e:") == 0) {
return this.findEphemera(name);
}
}
if (this.conditionalStyles != null && this.conditionalStyles.findByName && this.conditionalStyles.findByName(name)) {
return this.conditionalStyles.findByName(name);
}
return null;
};
IgrDefinitionBase.prototype.transitionStyleOut = function (style) {
this.i.e3((style == null ? null : style.i));
};
IgrDefinitionBase.prototype.transitionStyleIn = function (style) {
this.i.e2((style == null ? null : style.i));
};
IgrDefinitionBase.prototype.isStyleTransitioningOut = function (style) {
var iv = this.i.as((style == null ? null : style.i));
return (iv);
};
IgrDefinitionBase.prototype.setNamedValue = function (valueName, animationType, value) {
this.i.e1(valueName, (animationType == null ? null : animationType), value);
};
/**
* Returns if this definition has named value.
*/
IgrDefinitionBase.prototype.hasNamedValues = function () {
var iv = this.i.ap();
return (iv);
};
/**
* Returns if this definition has a named value with a given name.
* @param valueName * The named value name to check for.
*/
IgrDefinitionBase.prototype.hasNamedValue = function (valueName) {
var iv = this.i.ao(valueName);
return (iv);
};
/**
* Removes the named value from this definition by name.
* @param valueName * The named value name to remove.
*/
IgrDefinitionBase.prototype.removeNamedValue = function (valueName) {
this.i.ew(valueName);
};
/**
* Gets the value for a named value from this definition.
* @param valueName * The named value name to check for.
*/
IgrDefinitionBase.prototype.getNamedValue = function (valueName) {
var iv = this.i.co(valueName);
return (iv);
};
Object.defineProperty(IgrDefinitionBase.prototype, "dataBinding", {
/**
* Called when a cell is data binding.
*/
get: function () {
return this._dataBinding;
},
set: function (ev) {
var _this = this;
if (this._dataBinding_wrapped !== null) {
this.i.dataBinding = delegateRemove(this.i.dataBinding, this._dataBinding_wrapped);
this._dataBinding_wrapped = null;
this._dataBinding = null;
}
this._dataBinding = ev;
this._dataBinding_wrapped = function (o, e) {
var outerArgs = new IgrDataBindingEventArgs();
outerArgs._provideImplementation(e);
if (_this.beforeDataBinding) {
_this.beforeDataBinding(_this, outerArgs);
}
if (_this._dataBinding) {
_this._dataBinding(_this, outerArgs);
}
};
this.i.dataBinding = delegateCombine(this.i.dataBinding, this._dataBinding_wrapped);
;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "dataBound", {
/**
* Called when a cell has been data bound.
*/
get: function () {
return this._dataBound;
},
set: function (ev) {
var _this = this;
if (this._dataBound_wrapped !== null) {
this.i.dataBound = delegateRemove(this.i.dataBound, this._dataBound_wrapped);
this._dataBound_wrapped = null;
this._dataBound = null;
}
this._dataBound = ev;
this._dataBound_wrapped = function (o, e) {
var outerArgs = new IgrDataBindingEventArgs();
outerArgs._provideImplementation(e);
if (_this.beforeDataBound) {
_this.beforeDataBound(_this, outerArgs);
}
if (_this._dataBound) {
_this._dataBound(_this, outerArgs);
}
};
this.i.dataBound = delegateCombine(this.i.dataBound, this._dataBound_wrapped);
;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDefinitionBase.prototype, "cellStyleKeyRequested", {
/**
* Called when the style key for a cell is needed. Used for recycling the cell.
*/
get: function () {
return this._cellStyleKeyRequested;
},
set: function (ev) {
var _this = this;
if (this._cellStyleKeyRequested_wrapped !== null) {
this.i.cellStyleKeyRequested = delegateRemove(this.i.cellStyleKeyRequested, this._cellStyleKeyRequested_wrapped);
this._cellStyleKeyRequested_wrapped = null;
this._cellStyleKeyRequested = null;
}
this._cellStyleKeyRequested = ev;
this._cellStyleKeyRequested_wrapped = function (o, e) {
var outerArgs = new IgrCellStyleRequestedEventArgs();
outerArgs._provideImplementation(e);
if (_this.beforeCellStyleKeyRequested) {
_this.beforeCellStyleKeyRequested(_this, outerArgs);
}
if (_this._cellStyleKeyRequested) {
_this._cellStyleKeyRequested(_this, outerArgs);
}
};
this.i.cellStyleKeyRequested = delegateCombine(this.i.cellStyleKeyRequested, this._cellStyleKeyRequested_wrapped);
;
},
enumerable: false,
configurable: true
});
return IgrDefinitionBase;
}(React.Component));
export { IgrDefinitionBase };