UNPKG

igniteui-react-core

Version:
145 lines (144 loc) 5.35 kB
/* THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE: https://www.infragistics.com/legal/license/igultimate-la https://www.infragistics.com/legal/license/igultimate-eula GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company. */ import { __extends } from "tslib"; import { Base, markType } from "./type"; import { IDataSeriesAdapterRule_$type } from "./IDataSeriesAdapterRule"; /** * @hidden */ var SubCollectionsRule = /** @class */ /*@__PURE__*/ (function (_super) { __extends(SubCollectionsRule, _super); function SubCollectionsRule() { var _this = _super.call(this) || this; _this._priority = 0; _this._collectionTransformationThreshold = 0; _this.priority = 0; _this.collectionTransformationThreshold = 50; return _this; } Object.defineProperty(SubCollectionsRule.prototype, "priority", { get: function () { return this._priority; }, set: function (a) { this._priority = a; }, enumerable: false, configurable: true }); Object.defineProperty(SubCollectionsRule.prototype, "collectionTransformationThreshold", { get: function () { return this._collectionTransformationThreshold; }, set: function (a) { this._collectionTransformationThreshold = a; }, enumerable: false, configurable: true }); SubCollectionsRule.prototype.evaluate = function (a) { var b = a.getCurrentDataSource(); if (b == null) { return; } if (b.actualCount == 0 || b.actualCount > this.collectionTransformationThreshold) { return; } var c = b.getItemAtIndex(0); if (a.analyzer.isCollection(c)) { for (var d = 0; d < b.actualCount; d++) { if (a.analyzer.isCollection(b.getItemAtIndex(d))) { var e = a.analyzer.getTitleString(b.getItemAtIndex(d), null); if (e != null) { a.pushParentTitle(e); } a.ay(1); a.recurseRules(b.getItemAtIndex(d), "[" + d + "]", false); a.ay(0); if (e != null) { a.popParentTitle(); } } } } }; SubCollectionsRule.prototype.getPrimaryAxisLabelsString = function (a) { return null; }; SubCollectionsRule.prototype.getAdditionalValuePropertyStrings = function (a) { var b = a.getCurrentDataSource(); if (b == null) { return null; } if (b.actualCount == 0 || b.actualCount > this.collectionTransformationThreshold) { return null; } var c = a.analyzer; var d = b.getItemAtIndex(0); if (!c.isCollection(d)) { return null; } for (var e = 0; e < b.actualCount; e++) { if (!a.analyzer.isCollection(b.getItemAtIndex(e))) { continue; } var f = a.analyzer.getTitleString(b.getItemAtIndex(e), null); if (f != null) { a.pushParentTitle(f); } a.ay(3); a.recurseRules(b.getItemAtIndex(e), "[" + e + "]", false); a.ay(0); if (f != null) { a.popParentTitle(); } var g = b.getItemAtIndex(e); var h = a.getSubProvider(g, "[" + e + "]"); var i = h.actualSchema.propertyNames; for (var j = 0; j < i.length; j++) { var k = i[j]; var l = h.actualSchema.propertyTypes[j]; var m = l == 0 ? 0 : l == 8 || l == 9 ? 1 : 2; a.am(a.getCurrentPath(), k, m); } a.popSubProvider(); } return a.d(); }; SubCollectionsRule.prototype.getPrimaryAxisLabelsStrings = function (a) { var b = a.getCurrentDataSource(); if (b == null) { return null; } if (b.actualCount == 0 || b.actualCount > this.collectionTransformationThreshold) { return null; } var c = a.analyzer; var d = b.getItemAtIndex(0); if (!c.isCollection(d)) { return null; } for (var e = 0; e < b.actualCount; e++) { if (a.analyzer.isCollection(b.getItemAtIndex(e))) { var f = a.analyzer.getTitleString(b.getItemAtIndex(e), null); if (f != null) { a.pushParentTitle(f); } a.ay(2); a.recurseRules(b.getItemAtIndex(e), "[" + e + "]", false); a.ay(0); if (f != null) { a.popParentTitle(); } } } return a.d(); }; SubCollectionsRule.$t = markType(SubCollectionsRule, 'SubCollectionsRule', Base.$, [IDataSeriesAdapterRule_$type]); return SubCollectionsRule; }(Base)); export { SubCollectionsRule };