igniteui-react-grids
Version:
Ignite UI React grid components.
278 lines (277 loc) • 9.67 kB
JavaScript
/*
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 { GridBaseDirective } from "./GridBaseDirective";
import { markType } from "igniteui-react-core";
import { GridMasterDetailContext } from "./GridMasterDetailContext";
import { GroupByRecord } from "./GroupByRecord";
import { GroupingExpression } from "./GroupingExpression";
import { GroupByExpandState } from "./GroupByExpandState";
import { GridGroupingStrategy } from "./GridGroupingStrategy";
import { GroupByRowSelectorTemplateContext } from "./GroupByRowSelectorTemplateContext";
import { GroupByRowTemplateContext } from "./GroupByRowTemplateContext";
import { CellType } from "./CellType";
import { ForOfStateEventArgs } from "./ForOfStateEventArgs";
import { GroupingDoneEventArgs } from "./GroupingDoneEventArgs";
import { RowType } from "./RowType";
import { stringStartsWith } from "igniteui-react-core";
import { parseBool } from "igniteui-react-core";
/**
* @hidden
*/
export let Grid = /*@__PURE__*/ (() => {
class Grid extends GridBaseDirective {
constructor() {
super(...arguments);
this.hm = null;
this.hl = null;
this.hn = null;
this.ho = null;
this.dataPreLoad = null;
this.groupingDone = null;
}
get hd() {
let ret_ = this.b9.n("groupsExpanded");
return ret_;
}
set hd(a) {
let value_ = a;
this.b9.w("groupsExpanded", value_);
}
get hq() {
return this.hm;
}
set hq(a) {
this.hm = a;
this.b9.t("dropAreaTemplate", (b) => b, this.hm);
}
get hp() {
return this.hl;
}
set hp(a) {
this.hl = a;
this.b9.t("detailTemplate", (b) => new GridMasterDetailContext(), this.hl);
}
get hu() {
let ret_ = this.b9.n("id");
return ret_;
}
set hu(a) {
let value_ = a;
this.b9.w("id", value_);
}
get g4() {
let ret_ = this.b9.m("groupsRecords", (a) => new GroupByRecord());
return ret_;
}
get g0() {
let ret_ = this.b9.n("data");
return ret_;
}
set g0(a) {
let value_ = a;
this.b9.w("data", value_);
}
get hj() {
let ret_ = this.b9.n("totalItemCount");
return ret_;
}
set hj(a) {
let value_ = a;
this.b9.w("totalItemCount", value_);
}
get g3() {
let ret_ = this.b9.m("groupingExpressions", (a) => new GroupingExpression());
return ret_;
}
set g3(a) {
let value_ = a;
this.b9.w("groupingExpressions", value_);
}
get g2() {
let ret_ = this.b9.m("groupingExpansionState", (a) => new GroupByExpandState());
return ret_;
}
set g2(a) {
let value_ = a;
this.b9.w("groupingExpansionState", value_);
}
get he() {
let ret_ = this.b9.n("hideGroupedColumns");
return ret_;
}
set he(a) {
let value_ = a;
this.b9.w("hideGroupedColumns", value_);
}
get g9() {
let ret_ = this.b9.m("groupStrategy", (a) => new GridGroupingStrategy());
return ret_;
}
set g9(a) {
let value_ = a;
this.b9.w("groupStrategy", value_);
}
get ht() {
let ret_ = this.b9.n("dropAreaMessage");
return ret_;
}
set ht(a) {
let value_ = a;
this.b9.w("dropAreaMessage", value_);
}
get hr() {
return this.hn;
}
set hr(a) {
this.hn = a;
this.b9.t("groupByRowSelectorTemplate", (b) => new GroupByRowSelectorTemplateContext(), this.hn);
}
get hs() {
return this.ho;
}
set hs(a) {
this.ho = a;
this.b9.t("groupRowTemplate", (b) => new GroupByRowTemplateContext(), this.ho);
}
get hh() {
let ret_ = this.b9.n("showGroupArea");
return ret_;
}
set hh(a) {
let value_ = a;
this.b9.w("showGroupArea", value_);
}
get g5() {
let ret_ = this.b9.m("selectedCells", (a) => new CellType());
return ret_;
}
dataPreLoadChanged() {
if (this.dataPreLoad != null) {
this.b9.s("dataPreLoad", (a) => this.dataPreLoad(this, ForOfStateEventArgs.b(a)), false);
}
else {
this.b9.v("dataPreLoad");
}
}
groupingDoneChanged() {
if (this.groupingDone != null) {
this.b9.s("groupingDone", (a) => this.groupingDone(this, GroupingDoneEventArgs.a(a)), false);
}
else {
this.b9.v("groupingDone");
}
}
h2(a) {
this.nativeElement.groupBy(this.b9.i(a));
}
hy(a) {
this.nativeElement.clearGrouping(this.b9.i(a));
}
hf(a) {
return (this.nativeElement.isExpandedGroup(this.b9.i(a)));
}
h6(a) {
this.nativeElement.toggleGroup(this.b9.i(a));
}
h4(a, b = false) {
this.nativeElement.selectRowsInGroup(this.b9.i(a), this.b9.i(b));
}
h0(a) {
this.nativeElement.deselectRowsInGroup(this.b9.i(a));
}
h1(a) {
this.nativeElement.fullyExpandGroup(this.b9.i(a));
}
h5() {
this.nativeElement.toggleAllGroupRows();
}
g1(a = false, b = false) {
return (this.nativeElement.getSelectedData(this.b9.i(a), this.b9.i(b)));
}
hb(a) {
return this.b9.g(this.nativeElement.getRowByIndex(this.b9.i(a)), (b) => new RowType());
}
hc(a) {
return this.b9.g(this.nativeElement.getRowByKey(this.b9.i(a)), (b) => new RowType());
}
g6(a, b) {
return this.b9.g(this.nativeElement.getCellByColumn(this.b9.i(a), this.b9.i(b)), (c) => new CellType());
}
g7(a, b) {
return this.b9.g(this.nativeElement.getCellByKey(this.b9.i(a), this.b9.i(b)), (c) => new CellType());
}
hg(a, b = -1) {
return (this.nativeElement.pinRow(this.b9.i(a), this.b9.i(b)));
}
hi(a) {
return (this.nativeElement.unpinRow(this.b9.i(a)));
}
beforeColumnInit(a, b) {
var _a;
let c = a;
let d = b;
let e = (_a = c.combinedColumnList) === null || _a === void 0 ? void 0 : _a.find(x => x.nativeElement === d.externalObject.detail.nativeElement);
let f = (d.externalObject);
if (e != null) {
f.a = e;
}
}
hk(a) {
if (a == null) {
return null;
}
if (!stringStartsWith(a, "@@e:")) {
return null;
}
a = a.substr(4);
let b = a.split('@');
let c = b[0];
let d = b[1];
switch (c) {
case "RowType":
if (stringStartsWith(d, "Index:")) {
d = d.substr(6);
return this.externalObject.getRowByIndex(parseInt(d));
}
else if (stringStartsWith(d, "Key:")) {
d = d.substr(4);
let g = this.g0;
for (let f = 0; f < g.length; f++) {
let e = g[f];
let h = e[this.ee];
if (h != null) {
if ((typeof h == "string")) {
return this.externalObject.getRowByKey(d);
}
if ((typeof h == "number")) {
return this.externalObject.getRowByKey(parseFloat(d));
}
if ((typeof h == "boolean")) {
return this.externalObject.getRowByKey(parseBool(d));
}
if ((h instanceof Date)) {
return this.externalObject.getRowByKey(new Date(d));
}
break;
}
}
return this.externalObject.getRowByKey(d);
}
return null;
}
return null;
}
hv(a) {
this.nativeElement.addRow(a);
}
hx(a) {
this.nativeElement.beginAddRowByIndex(a);
}
}
Grid.$t = /*@__PURE__*/ markType(Grid, 'Grid', GridBaseDirective.$);
return Grid;
})();