igniteui-react-grids
Version:
Ignite UI React grid components.
144 lines (143 loc) • 5.07 kB
JavaScript
import { __extends } from "tslib";
import { GridColumnDataType_$type } from "./GridColumnDataType";
import { IgrPivotDimension } from "./igr-pivot-dimension";
import { IgcPivotDateDimension } from "./../../grids/combined";
import { PivotDateDimension as PivotDateDimension_internal } from "./PivotDateDimension";
import { ensureBool, ensureEnum, interfaceToInternal } from "igniteui-react-core";
import { GridResourceStrings } from "./GridResourceStrings";
import { PivotDateDimensionOptions } from "./PivotDateDimensionOptions";
var IgrPivotDateDimension = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgrPivotDateDimension, _super);
function IgrPivotDateDimension() {
return _super.call(this) || this;
}
IgrPivotDateDimension.prototype.createImplementation = function () {
var impl = new PivotDateDimension_internal();
if (impl.setNativeElement) {
impl.setNativeElement(new IgcPivotDateDimension());
}
return impl;
};
Object.defineProperty(IgrPivotDateDimension.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrPivotDateDimension.prototype, "enabled", {
/**
* Enables/Disables a particular dimension from pivot structure.
*/
get: function () {
return this.i.w;
},
set: function (v) {
this.i.w = ensureBool(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrPivotDateDimension.prototype, "dataType", {
/**
* Gets/Sets data type
*/
get: function () {
return this.i.s;
},
set: function (v) {
this.i.s = ensureEnum(GridColumnDataType_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrPivotDateDimension.prototype, "resourceStrings", {
/**
* Gets/Sets the resource strings.
* @remarks
* By default it uses EN resources.
*/
get: function () {
return this.i.t.nativeElement;
},
set: function (v) {
this.i.t = interfaceToInternal(v, function () { return new GridResourceStrings(); });
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrPivotDateDimension.prototype, "baseDimension", {
/**
* Gets/Sets the base dimension that is used by this class to determine the other dimensions and their values.
* Having base dimension set is required in order for the Date Dimensions to show.
*/
get: function () {
var r = this.i.v;
if (r == null) {
return null;
}
if (!r.externalObject) {
var e = new IgrPivotDimension();
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.v = null : this.i.v = v.i;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrPivotDateDimension.prototype, "options", {
/**
* Gets/Sets the options for the predefined date dimensions whether to show quarter, years and etc.
*/
get: function () {
return this.i.u.nativeElement;
},
set: function (v) {
this.i.u = interfaceToInternal(v, function () { return new PivotDateDimensionOptions(); });
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrPivotDateDimension.prototype, "displayName", {
get: function () {
return this.i.x;
},
set: function (v) {
this.i.x = v;
},
enumerable: false,
configurable: true
});
IgrPivotDateDimension.prototype.findByName = function (name) {
var baseResult = _super.prototype.findByName.call(this, name);
if (baseResult) {
return baseResult;
}
if (this.resourceStrings && this.resourceStrings.name && this.resourceStrings.name == name) {
return this.resourceStrings;
}
if (this.baseDimension && this.baseDimension.name && this.baseDimension.name == name) {
return this.baseDimension;
}
if (this.options && this.options.name && this.options.name == name) {
return this.options;
}
return null;
};
return IgrPivotDateDimension;
}(IgrPivotDimension));
export { IgrPivotDateDimension };