igniteui-react-grids
Version:
Ignite UI React grid components.
362 lines (361 loc) • 11.9 kB
JavaScript
import { IgrFilteringExpressionsTree } from "./igr-filtering-expressions-tree";
import { IgrPivotConfiguration } from "./igr-pivot-configuration";
import { GridStateInfoDetail as GridStateInfoDetail_internal } from "./GridStateInfoDetail";
import { interfaceToInternal, ensureBool } from "igniteui-react-core";
import { PagingState } from "./PagingState";
import { GroupingState } from "./GroupingState";
import { PinningConfig } from "./PinningConfig";
import { IgrGridStateCollection } from "./igr-grid-state-collection";
var IgrGridStateInfoDetail = /** @class */ /*@__PURE__*/ (function () {
function IgrGridStateInfoDetail() {
this.mounted = false;
this._implementation = this.createImplementation();
this._implementation.externalObject = this;
this.onImplementationCreated();
if (this._initializeAdapters) {
this._initializeAdapters();
}
}
IgrGridStateInfoDetail.prototype.createImplementation = function () {
return new GridStateInfoDetail_internal();
};
Object.defineProperty(IgrGridStateInfoDetail.prototype, "nativeElement", {
get: function () {
return this._implementation.nativeElement;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrGridStateInfoDetail.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
IgrGridStateInfoDetail.prototype.onImplementationCreated = function () {
};
IgrGridStateInfoDetail.prototype._provideImplementation = function (i) {
this._implementation = i;
this._implementation.externalObject = this;
this.onImplementationCreated();
if (this._initializeAdapters) {
this._initializeAdapters();
}
};
Object.defineProperty(IgrGridStateInfoDetail.prototype, "columns", {
get: function () {
if (!this.i.b) {
return undefined;
}
var ret = [];
for (var i = 0; i < this.i.b.length; i++) {
var impl = this.i.b[i];
ret.push(impl.nativeElement);
}
return ret;
},
set: function (v) {
var arr = [];
for (var i = 0; i < v.length; i++) {
arr.push(v[i]);
}
this.i.b = arr;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrGridStateInfoDetail.prototype, "filtering", {
get: function () {
var r = this.i.j;
if (r == null) {
return null;
}
if (!r.externalObject) {
var e = new IgrFilteringExpressionsTree();
if (r.$type) {
e._implementation = r;
}
else {
if (e.i.setNativeElement) {
e.i.setNativeElement(r);
}
}
r.externalObject = e;
}
return r.externalObject;
},
set: function (v) {
v == null ? this.i.j = null : this.i.j = v.i;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrGridStateInfoDetail.prototype, "advancedFiltering", {
get: function () {
var r = this.i.i;
if (r == null) {
return null;
}
if (!r.externalObject) {
var e = new IgrFilteringExpressionsTree();
if (r.$type) {
e._implementation = r;
}
else {
if (e.i.setNativeElement) {
e.i.setNativeElement(r);
}
}
r.externalObject = e;
}
return r.externalObject;
},
set: function (v) {
v == null ? this.i.i = null : this.i.i = v.i;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrGridStateInfoDetail.prototype, "paging", {
get: function () {
return this.i.l.nativeElement;
},
set: function (v) {
this.i.l = interfaceToInternal(v, function () { return new PagingState(); });
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrGridStateInfoDetail.prototype, "moving", {
get: function () {
return this.i.q;
},
set: function (v) {
this.i.q = ensureBool(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrGridStateInfoDetail.prototype, "sorting", {
get: function () {
if (!this.i.h) {
return undefined;
}
var ret = [];
for (var i = 0; i < this.i.h.length; i++) {
var impl = this.i.h[i];
ret.push(impl.nativeElement);
}
return ret;
},
set: function (v) {
var arr = [];
for (var i = 0; i < v.length; i++) {
arr.push(v[i]);
}
this.i.h = arr;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrGridStateInfoDetail.prototype, "groupBy", {
get: function () {
return this.i.k.nativeElement;
},
set: function (v) {
this.i.k = interfaceToInternal(v, function () { return new GroupingState(); });
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrGridStateInfoDetail.prototype, "cellSelection", {
get: function () {
if (!this.i.a) {
return undefined;
}
var ret = [];
for (var i = 0; i < this.i.a.length; i++) {
var impl = this.i.a[i];
ret.push(impl.nativeElement);
}
return ret;
},
set: function (v) {
var arr = [];
for (var i = 0; i < v.length; i++) {
arr.push(v[i]);
}
this.i.a = arr;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrGridStateInfoDetail.prototype, "rowSelection", {
get: function () {
return this.i.g;
},
set: function (v) {
if (v && !Array.isArray(v) && typeof (v) == "string") {
var re = /\s*(?:,|\s|$)\s*/gm;
v = v.split(re);
}
this.i.g = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrGridStateInfoDetail.prototype, "columnSelection", {
get: function () {
return this.i.c;
},
set: function (v) {
if (v && !Array.isArray(v) && typeof (v) == "string") {
var re = /\s*(?:,|\s|$)\s*/gm;
v = v.split(re);
}
this.i.c = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrGridStateInfoDetail.prototype, "rowPinning", {
get: function () {
return this.i.f;
},
set: function (v) {
if (v && !Array.isArray(v) && typeof (v) == "string") {
var re = /\s*(?:,|\s|$)\s*/gm;
v = v.split(re);
}
this.i.f = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrGridStateInfoDetail.prototype, "pinningConfig", {
get: function () {
return this.i.m.nativeElement;
},
set: function (v) {
this.i.m = interfaceToInternal(v, function () { return new PinningConfig(); });
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrGridStateInfoDetail.prototype, "expansion", {
get: function () {
return this.i.d;
},
set: function (v) {
if (v && !Array.isArray(v) && typeof (v) == "string") {
var re = /\s*(?:,|\s|$)\s*/gm;
v = v.split(re);
}
this.i.d = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrGridStateInfoDetail.prototype, "rowIslands", {
get: function () {
if (!this.i.e) {
return undefined;
}
var ret = [];
for (var i = 0; i < this.i.e.length; i++) {
var impl = this.i.e[i];
if (!impl.externalObject) {
if (impl instanceof IgrGridStateCollection) {
ret.push(impl);
continue;
}
var e = new IgrGridStateCollection();
e._implementation = impl;
impl.externalObject = e;
}
ret.push(impl.externalObject);
}
return ret;
},
set: function (v) {
var arr = [];
for (var i = 0; i < v.length; i++) {
arr.push(v[i].i);
}
this.i.e = arr;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrGridStateInfoDetail.prototype, "id", {
get: function () {
return this.i.t;
},
set: function (v) {
this.i.t = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrGridStateInfoDetail.prototype, "pivotConfiguration", {
get: function () {
var r = this.i.n;
if (r == null) {
return null;
}
if (!r.externalObject) {
var e = new IgrPivotConfiguration();
if (r.$type) {
e._implementation = r;
}
else {
if (e.i.setNativeElement) {
e.i.setNativeElement(r);
}
}
r.externalObject = e;
}
return r.externalObject;
},
set: function (v) {
v == null ? this.i.n = null : this.i.n = v.i;
},
enumerable: false,
configurable: true
});
IgrGridStateInfoDetail.prototype.findByName = function (name) {
if (this.findEphemera) {
if (name && name.indexOf("@@e:") == 0) {
return this.findEphemera(name);
}
}
if (this.filtering && this.filtering.name && this.filtering.name == name) {
return this.filtering;
}
if (this.advancedFiltering && this.advancedFiltering.name && this.advancedFiltering.name == name) {
return this.advancedFiltering;
}
if (this.paging && this.paging.name && this.paging.name == name) {
return this.paging;
}
if (this.groupBy && this.groupBy.name && this.groupBy.name == name) {
return this.groupBy;
}
if (this.pinningConfig && this.pinningConfig.name && this.pinningConfig.name == name) {
return this.pinningConfig;
}
if (this.pivotConfiguration && this.pivotConfiguration.name && this.pivotConfiguration.name == name) {
return this.pivotConfiguration;
}
return null;
};
IgrGridStateInfoDetail.prototype.setNativeElement = function (element) {
this.i.setNativeElement(element);
};
return IgrGridStateInfoDetail;
}());
export { IgrGridStateInfoDetail };