UNPKG

igniteui-webcomponents-grids

Version:

Ignite UI Web Components grid components.

466 lines (465 loc) 19.1 kB
import { __extends } from "tslib"; import { IgcHTMLElement } from "igniteui-webcomponents-core"; import { delegateCombine, delegateRemove } from "igniteui-webcomponents-core"; import { IgcGridFilterDialogOpeningEventArgs } from "./igc-grid-filter-dialog-opening-event-args"; import { IgcGridFilterDialogFilterChangeEventArgs } from "./igc-grid-filter-dialog-filter-change-event-args"; import { IgcFilterDialogRenderCompletedEventArgs } from "./igc-filter-dialog-render-completed-event-args"; import { GridFilterDialog } from "./GridFilterDialog"; import { TypeRegistrar } from "igniteui-webcomponents-core"; import { NamePatcher, getAllPropertyNames, fromSpinal, toSpinal, ensureBool, brushToString, stringToBrush, initializePropertiesFromCss } from "igniteui-webcomponents-core"; import { RegisterElementHelper } from "igniteui-webcomponents-core"; /** * An advanced grid for displaying data. */ var IgcDataGridFilterDialogComponent = /** @class */ /*@__PURE__*/ (function (_super) { __extends(IgcDataGridFilterDialogComponent, _super); function IgcDataGridFilterDialogComponent() { var _this = _super.call(this) || this; _this._settingAttributes = false; _this._attached = false; _this._queuedSetAttributes = []; _this._updatingFromAttribute = 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; } IgcDataGridFilterDialogComponent.prototype.createImplementation = function () { return new GridFilterDialog(); }; Object.defineProperty(IgcDataGridFilterDialogComponent.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; } /** * @hidden */, enumerable: false, configurable: true }); IgcDataGridFilterDialogComponent._createFromInternal = function (internal) { if (!internal) { return null; } if (!internal.$type) { return null; } var name = internal.$type.name; var externalName = "Igc" + name + "Component"; if (!TypeRegistrar.isRegistered(externalName)) { return null; } return TypeRegistrar.create(externalName); }; IgcDataGridFilterDialogComponent.prototype.onImplementationCreated = function () { }; IgcDataGridFilterDialogComponent.prototype._enqueueSetAttribute = function (attrName, attrValue) { this._queuedSetAttributes.push({ attrName: attrName, attrValue: attrValue }); }; IgcDataGridFilterDialogComponent.prototype._flushQueuedAttributes = function () { this._settingAttributes = true; for (var i = 0; i < this._queuedSetAttributes.length; i++) { this.setAttribute(this._queuedSetAttributes[i].attrName, this._queuedSetAttributes[i].attrValue); } this._settingAttributes = false; this._queuedSetAttributes.length = 0; }; IgcDataGridFilterDialogComponent.prototype._a = function (attrName, attrValue) { if (this._updatingFromAttribute) { return; } if (attrValue) { attrValue = attrValue.toString(); } this._settingAttributes = true; attrName = toSpinal(attrName); if (this._attached) { this.setAttribute(attrName, attrValue); } else { this._enqueueSetAttribute(attrName, attrValue); } this._settingAttributes = false; }; IgcDataGridFilterDialogComponent.prototype.connectedCallback = function () { if (_super.prototype["connectedCallback"]) { _super.prototype["connectedCallback"].call(this); } if (this.i.connectedCallback) { this.i.connectedCallback(); } if (!this._attached) { this._attached = true; this._flushQueuedAttributes(); } }; IgcDataGridFilterDialogComponent.prototype.disconnectedCallback = function () { if (_super.prototype["disconnectedCallback"]) { _super.prototype["disconnectedCallback"].call(this); } if (this.i.disconnectedCallback) { this.i.disconnectedCallback(); } if (this._attached) { this._attached = false; } }; Object.defineProperty(IgcDataGridFilterDialogComponent, "observedAttributes", { get: function () { if (IgcDataGridFilterDialogComponent._observedAttributesIgcDataGridFilterDialogComponent == null) { var names = getAllPropertyNames(IgcDataGridFilterDialogComponent); for (var i = 0; i < names.length; i++) { names[i] = toSpinal(names[i]); } IgcDataGridFilterDialogComponent._observedAttributesIgcDataGridFilterDialogComponent = names; } return IgcDataGridFilterDialogComponent._observedAttributesIgcDataGridFilterDialogComponent; }, enumerable: false, configurable: true }); IgcDataGridFilterDialogComponent.prototype.attributeChangedCallback = function (name, oldValue, newValue) { if (this._settingAttributes) { return; } var setName = fromSpinal(name); this._updatingFromAttribute = true; this[setName] = newValue; this._updatingFromAttribute = false; }; IgcDataGridFilterDialogComponent.register = function () { if (!IgcDataGridFilterDialogComponent._isElementRegistered) { IgcDataGridFilterDialogComponent._isElementRegistered = true; RegisterElementHelper.registerElement(IgcDataGridFilterDialogComponent.htmlTagName, IgcDataGridFilterDialogComponent); } }; Object.defineProperty(IgcDataGridFilterDialogComponent.prototype, "isAnimationEnabled", { get: function () { return this.i.ab; }, set: function (v) { this.i.ab = ensureBool(v); this._a("isAnimationEnabled", this.i.ab); }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataGridFilterDialogComponent.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; this._a("pixelScalingRatio", this.i.aj); }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataGridFilterDialogComponent.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; this._a("actualPixelScalingRatio", this.i.ai); }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataGridFilterDialogComponent.prototype, "iconColor", { get: function () { return brushToString(this.i.bw); }, set: function (v) { this.i.bw = stringToBrush(v); this._a("iconColor", brushToString(this.i.bw)); }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataGridFilterDialogComponent.prototype, "viewSize", { get: function () { return this.i.ak; }, set: function (v) { this.i.ak = +v; this._a("viewSize", this.i.ak); }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataGridFilterDialogComponent.prototype, "isOpen", { get: function () { return this.i.ac; }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataGridFilterDialogComponent.prototype, "commandCompleted", { get: function () { return this.i.commandCompleted; }, set: function (v) { this.i.commandCompleted = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataGridFilterDialogComponent.prototype, "invalidateActions", { get: function () { return this.i.invalidateActions; }, set: function (v) { this.i.invalidateActions = v; }, enumerable: false, configurable: true }); IgcDataGridFilterDialogComponent.prototype.findByName = function (name) { if (this.findEphemera) { if (name && name.indexOf("@@e:") == 0) { return this.findEphemera(name); } } return null; }; Object.defineProperty(IgcDataGridFilterDialogComponent.prototype, "hasUserValues", { get: function () { return this._hasUserValues; }, enumerable: false, configurable: true }); IgcDataGridFilterDialogComponent.prototype.__m = function (propertyName) { if (!this._inStyling) { this._hasUserValues.add(propertyName); } }; IgcDataGridFilterDialogComponent.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("DataGridFilterDialogComponent"); 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; }; IgcDataGridFilterDialogComponent.prototype.notifySizeChanged = function (width, height) { this.i.be(width, height); }; IgcDataGridFilterDialogComponent.prototype.notifyCellSizeChanged = function () { this.i.bd(); }; IgcDataGridFilterDialogComponent.prototype.showIcon = function () { this.i.br(); }; IgcDataGridFilterDialogComponent.prototype.hideIcon = function () { this.i.bb(); }; IgcDataGridFilterDialogComponent.prototype.getDesiredToolbarActions = function () { var iv = this.i.getDesiredToolbarActions(); return (iv); }; IgcDataGridFilterDialogComponent.prototype.addCommandAvailabilityListener = function (listener) { this.i.addCommandAvailabilityListener(listener); }; IgcDataGridFilterDialogComponent.prototype.removeCommandAvailabilityListener = function (listener) { this.i.removeCommandAvailabilityListener(listener); }; IgcDataGridFilterDialogComponent.prototype.addCommandStateChangedListener = function (listener) { this.i.addCommandStateChangedListener(listener); }; IgcDataGridFilterDialogComponent.prototype.removeCommandStateChangedListener = function (listener) { this.i.removeCommandStateChangedListener(listener); }; IgcDataGridFilterDialogComponent.prototype.provideContextAccessor = function (accessor) { this.i.provideContextAccessor(accessor); }; IgcDataGridFilterDialogComponent.prototype.dismissContextAccessor = function (accessor) { this.i.dismissContextAccessor(accessor); }; Object.defineProperty(IgcDataGridFilterDialogComponent.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 IgcGridFilterDialogOpeningEventArgs(); 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(IgcDataGridFilterDialogComponent.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 IgcGridFilterDialogFilterChangeEventArgs(); 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(IgcDataGridFilterDialogComponent.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 IgcGridFilterDialogFilterChangeEventArgs(); 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(IgcDataGridFilterDialogComponent.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 IgcFilterDialogRenderCompletedEventArgs(); 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 }); IgcDataGridFilterDialogComponent._observedAttributesIgcDataGridFilterDialogComponent = null; IgcDataGridFilterDialogComponent.htmlTagName = "igc-data-grid-filter-dialog"; IgcDataGridFilterDialogComponent._isElementRegistered = false; return IgcDataGridFilterDialogComponent; }(IgcHTMLElement)); export { IgcDataGridFilterDialogComponent };