igniteui-react-grids
Version:
Ignite UI React grid components.
435 lines (434 loc) • 16.4 kB
JavaScript
import { __extends, __values } from "tslib";
import * as React from 'react';
import { delegateCombine, delegateRemove } from "igniteui-react-core";
import { IgrGridFilterDialogOpeningEventArgs } from "./igr-grid-filter-dialog-opening-event-args";
import { IgrGridFilterDialogFilterChangeEventArgs } from "./igr-grid-filter-dialog-filter-change-event-args";
import { IgrFilterDialogRenderCompletedEventArgs } from "./igr-filter-dialog-render-completed-event-args";
import { GridFilterDialog } from "./GridFilterDialog";
import { TypeRegistrar } from "igniteui-react-core";
import { NamePatcher, getModifiedProps, isValidProp, ensureBool, brushToString, stringToBrush, toSpinal, initializePropertiesFromCss } from "igniteui-react-core";
/**
* An advanced grid for displaying data.
*/
var IgrDataGridFilterDialog = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgrDataGridFilterDialog, _super);
function IgrDataGridFilterDialog(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._dialogOpening = null;
_this._dialogOpening_wrapped = null;
_this._filterChanging = null;
_this._filterChanging_wrapped = null;
_this._filterChanged = null;
_this._filterChanged_wrapped = null;
_this._renderCompleted = null;
_this._renderCompleted_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;
}
IgrDataGridFilterDialog.prototype.createImplementation = function () {
return new GridFilterDialog();
};
Object.defineProperty(IgrDataGridFilterDialog.prototype, "nativeElement", {
get: function () {
return this._implementation.nativeElement;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDataGridFilterDialog.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
} /**
* @hidden
*/,
enumerable: false,
configurable: true
});
IgrDataGridFilterDialog._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);
};
IgrDataGridFilterDialog.prototype.onImplementationCreated = function () {
};
IgrDataGridFilterDialog.prototype.componentDidMount = function () {
var e_1, _a;
this.mounted = true;
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;
}
}
};
IgrDataGridFilterDialog.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;
};
IgrDataGridFilterDialog.prototype.render = function () {
return null;
};
Object.defineProperty(IgrDataGridFilterDialog.prototype, "isAnimationEnabled", {
get: function () {
return this.i.ab;
},
set: function (v) {
this.i.ab = ensureBool(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDataGridFilterDialog.prototype, "pixelScalingRatio", {
/**
* Gets or sets the scaling value used to affect the pixel density of the control.
* A higher scaling ratio will produce crisper visuals at the expense of memory. Lower values will cause the control
* to appear blurry.
*/
get: function () {
return this.i.aj;
},
set: function (v) {
this.i.aj = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDataGridFilterDialog.prototype, "actualPixelScalingRatio", {
/**
* Gets the actual pixel scaling ratio used to affect the pixel density of the control.
* A higher scaling ratio will produce crisper visuals at the expense of memory. Lower values will cause the control
* to appear blurry.
*/
get: function () {
return this.i.ai;
},
set: function (v) {
this.i.ai = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDataGridFilterDialog.prototype, "iconColor", {
get: function () {
return brushToString(this.i.bw);
},
set: function (v) {
this.i.bw = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDataGridFilterDialog.prototype, "viewSize", {
get: function () {
return this.i.ak;
},
set: function (v) {
this.i.ak = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDataGridFilterDialog.prototype, "isOpen", {
get: function () {
return this.i.ac;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDataGridFilterDialog.prototype, "commandCompleted", {
get: function () {
return this.i.commandCompleted;
},
set: function (v) {
this.i.commandCompleted = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDataGridFilterDialog.prototype, "invalidateActions", {
get: function () {
return this.i.invalidateActions;
},
set: function (v) {
this.i.invalidateActions = v;
},
enumerable: false,
configurable: true
});
IgrDataGridFilterDialog.prototype.findByName = function (name) {
if (this.findEphemera) {
if (name && name.indexOf("@@e:") == 0) {
return this.findEphemera(name);
}
}
return null;
};
Object.defineProperty(IgrDataGridFilterDialog.prototype, "hasUserValues", {
get: function () {
return this._hasUserValues;
},
enumerable: false,
configurable: true
});
IgrDataGridFilterDialog.prototype.__m = function (propertyName) {
if (!this._inStyling) {
this._hasUserValues.add(propertyName);
}
};
IgrDataGridFilterDialog.prototype._styling = function (container, component, parent) {
if (this._inStyling) {
return;
}
this._inStyling = true;
this._stylingContainer = container;
this._stylingParent = component;
var genericPrefix = "";
var typeName = this.i.$type.name;
if (typeName.indexOf("Xam") === 0) {
typeName = typeName.substring(3);
}
genericPrefix = toSpinal("DataGridFilterDialog");
var additionalPrefixes = [];
var prefix = toSpinal(typeName);
additionalPrefixes.push(prefix + "-");
var b = this.i.$type.baseType;
while (b && b.name != "Object" &&
b.name != "Base" &&
b.name != "Control" &&
b.Name != "DependencyObject" &&
b.Name != "FrameworkElement") {
typeName = b.name;
if (typeName.indexOf("Xam") === 0) {
typeName = typeName.substring(3);
}
var basePrefix = toSpinal(typeName);
additionalPrefixes.push(basePrefix + "-");
b = b.baseType;
}
if (parent) {
var parentTypeName = parent.i.$type.name;
if (parentTypeName.indexOf("Xam") === 0) {
parentTypeName = parentTypeName.substring(3);
}
var parentPrefix = toSpinal(parentTypeName);
additionalPrefixes.push(parentPrefix + "-" + genericPrefix + "-");
additionalPrefixes.push(parentPrefix + "-" + prefix + "-");
}
initializePropertiesFromCss(container, this, genericPrefix + "-", this.hasUserValues, false, additionalPrefixes);
if (this._otherStyling) {
this._otherStyling(container, component, parent);
}
this._inStyling = false;
};
IgrDataGridFilterDialog.prototype.notifySizeChanged = function (width, height) {
this.i.be(width, height);
};
IgrDataGridFilterDialog.prototype.notifyCellSizeChanged = function () {
this.i.bd();
};
IgrDataGridFilterDialog.prototype.showIcon = function () {
this.i.br();
};
IgrDataGridFilterDialog.prototype.hideIcon = function () {
this.i.bb();
};
IgrDataGridFilterDialog.prototype.getDesiredToolbarActions = function () {
var iv = this.i.getDesiredToolbarActions();
return (iv);
};
IgrDataGridFilterDialog.prototype.addCommandAvailabilityListener = function (listener) {
this.i.addCommandAvailabilityListener(listener);
};
IgrDataGridFilterDialog.prototype.removeCommandAvailabilityListener = function (listener) {
this.i.removeCommandAvailabilityListener(listener);
};
IgrDataGridFilterDialog.prototype.addCommandStateChangedListener = function (listener) {
this.i.addCommandStateChangedListener(listener);
};
IgrDataGridFilterDialog.prototype.removeCommandStateChangedListener = function (listener) {
this.i.removeCommandStateChangedListener(listener);
};
IgrDataGridFilterDialog.prototype.provideContextAccessor = function (accessor) {
this.i.provideContextAccessor(accessor);
};
IgrDataGridFilterDialog.prototype.dismissContextAccessor = function (accessor) {
this.i.dismissContextAccessor(accessor);
};
Object.defineProperty(IgrDataGridFilterDialog.prototype, "dialogOpening", {
get: function () {
return this._dialogOpening;
},
set: function (ev) {
var _this = this;
if (this._dialogOpening_wrapped !== null) {
this.i.dialogOpening = delegateRemove(this.i.dialogOpening, this._dialogOpening_wrapped);
this._dialogOpening_wrapped = null;
this._dialogOpening = null;
}
this._dialogOpening = ev;
this._dialogOpening_wrapped = function (o, e) {
var outerArgs = new IgrGridFilterDialogOpeningEventArgs();
outerArgs._provideImplementation(e);
if (_this.beforeDialogOpening) {
_this.beforeDialogOpening(_this, outerArgs);
}
if (_this._dialogOpening) {
_this._dialogOpening(_this, outerArgs);
}
};
this.i.dialogOpening = delegateCombine(this.i.dialogOpening, this._dialogOpening_wrapped);
;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDataGridFilterDialog.prototype, "filterChanging", {
get: function () {
return this._filterChanging;
},
set: function (ev) {
var _this = this;
if (this._filterChanging_wrapped !== null) {
this.i.filterChanging = delegateRemove(this.i.filterChanging, this._filterChanging_wrapped);
this._filterChanging_wrapped = null;
this._filterChanging = null;
}
this._filterChanging = ev;
this._filterChanging_wrapped = function (o, e) {
var outerArgs = new IgrGridFilterDialogFilterChangeEventArgs();
outerArgs._provideImplementation(e);
if (_this.beforeFilterChanging) {
_this.beforeFilterChanging(_this, outerArgs);
}
if (_this._filterChanging) {
_this._filterChanging(_this, outerArgs);
}
};
this.i.filterChanging = delegateCombine(this.i.filterChanging, this._filterChanging_wrapped);
;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDataGridFilterDialog.prototype, "filterChanged", {
get: function () {
return this._filterChanged;
},
set: function (ev) {
var _this = this;
if (this._filterChanged_wrapped !== null) {
this.i.filterChanged = delegateRemove(this.i.filterChanged, this._filterChanged_wrapped);
this._filterChanged_wrapped = null;
this._filterChanged = null;
}
this._filterChanged = ev;
this._filterChanged_wrapped = function (o, e) {
var outerArgs = new IgrGridFilterDialogFilterChangeEventArgs();
outerArgs._provideImplementation(e);
if (_this.beforeFilterChanged) {
_this.beforeFilterChanged(_this, outerArgs);
}
if (_this._filterChanged) {
_this._filterChanged(_this, outerArgs);
}
};
this.i.filterChanged = delegateCombine(this.i.filterChanged, this._filterChanged_wrapped);
;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDataGridFilterDialog.prototype, "renderCompleted", {
get: function () {
return this._renderCompleted;
},
set: function (ev) {
var _this = this;
if (this._renderCompleted_wrapped !== null) {
this.i.renderCompleted = delegateRemove(this.i.renderCompleted, this._renderCompleted_wrapped);
this._renderCompleted_wrapped = null;
this._renderCompleted = null;
}
this._renderCompleted = ev;
this._renderCompleted_wrapped = function (o, e) {
var outerArgs = new IgrFilterDialogRenderCompletedEventArgs();
outerArgs._provideImplementation(e);
if (_this.beforeRenderCompleted) {
_this.beforeRenderCompleted(_this, outerArgs);
}
if (_this._renderCompleted) {
_this._renderCompleted(_this, outerArgs);
}
};
this.i.renderCompleted = delegateCombine(this.i.renderCompleted, this._renderCompleted_wrapped);
;
},
enumerable: false,
configurable: true
});
return IgrDataGridFilterDialog;
}(React.Component));
export { IgrDataGridFilterDialog };