igniteui-webcomponents-grids
Version:
Ignite UI Web Components grid components.
400 lines (399 loc) • 16 kB
JavaScript
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.
*/
export let IgcDataGridFilterDialogComponent = /*@__PURE__*/ (() => {
class IgcDataGridFilterDialogComponent extends IgcHTMLElement {
createImplementation() {
return new GridFilterDialog();
}
/**
* @hidden
*/
get i() {
return this._implementation;
} /**
* @hidden
*/
static _createFromInternal(internal) {
if (!internal) {
return null;
}
if (!internal.$type) {
return null;
}
let name = internal.$type.name;
let externalName = "Igc" + name + "Component";
if (!TypeRegistrar.isRegistered(externalName)) {
return null;
}
return TypeRegistrar.create(externalName);
}
onImplementationCreated() {
}
constructor() {
super();
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();
}
}
_enqueueSetAttribute(attrName, attrValue) {
this._queuedSetAttributes.push({ attrName: attrName, attrValue: attrValue });
}
_flushQueuedAttributes() {
this._settingAttributes = true;
for (let i = 0; i < this._queuedSetAttributes.length; i++) {
this.setAttribute(this._queuedSetAttributes[i].attrName, this._queuedSetAttributes[i].attrValue);
}
this._settingAttributes = false;
this._queuedSetAttributes.length = 0;
}
_a(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;
}
connectedCallback() {
if (super["connectedCallback"]) {
super["connectedCallback"]();
}
if (this.i.connectedCallback) {
this.i.connectedCallback();
}
if (!this._attached) {
this._attached = true;
this._flushQueuedAttributes();
}
}
disconnectedCallback() {
if (super["disconnectedCallback"]) {
super["disconnectedCallback"]();
}
if (this.i.disconnectedCallback) {
this.i.disconnectedCallback();
}
if (this._attached) {
this._attached = false;
}
}
static get observedAttributes() {
if (IgcDataGridFilterDialogComponent._observedAttributesIgcDataGridFilterDialogComponent == null) {
let names = getAllPropertyNames(IgcDataGridFilterDialogComponent);
for (let i = 0; i < names.length; i++) {
names[i] = toSpinal(names[i]);
}
IgcDataGridFilterDialogComponent._observedAttributesIgcDataGridFilterDialogComponent = names;
}
return IgcDataGridFilterDialogComponent._observedAttributesIgcDataGridFilterDialogComponent;
}
attributeChangedCallback(name, oldValue, newValue) {
if (this._settingAttributes) {
return;
}
let setName = fromSpinal(name);
this._updatingFromAttribute = true;
this[setName] = newValue;
this._updatingFromAttribute = false;
}
static register() {
if (!IgcDataGridFilterDialogComponent._isElementRegistered) {
IgcDataGridFilterDialogComponent._isElementRegistered = true;
RegisterElementHelper.registerElement(IgcDataGridFilterDialogComponent.htmlTagName, IgcDataGridFilterDialogComponent);
}
}
get isAnimationEnabled() {
return this.i.ab;
}
set isAnimationEnabled(v) {
this.i.ab = ensureBool(v);
this._a("isAnimationEnabled", this.i.ab);
}
/**
* 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 pixelScalingRatio() {
return this.i.aj;
}
set pixelScalingRatio(v) {
this.i.aj = +v;
this._a("pixelScalingRatio", this.i.aj);
}
/**
* 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 actualPixelScalingRatio() {
return this.i.ai;
}
set actualPixelScalingRatio(v) {
this.i.ai = +v;
this._a("actualPixelScalingRatio", this.i.ai);
}
get iconColor() {
return brushToString(this.i.bw);
}
set iconColor(v) {
this.i.bw = stringToBrush(v);
this._a("iconColor", brushToString(this.i.bw));
}
get viewSize() {
return this.i.ak;
}
set viewSize(v) {
this.i.ak = +v;
this._a("viewSize", this.i.ak);
}
get isOpen() {
return this.i.ac;
}
get commandCompleted() {
return this.i.commandCompleted;
}
set commandCompleted(v) {
this.i.commandCompleted = v;
}
get invalidateActions() {
return this.i.invalidateActions;
}
set invalidateActions(v) {
this.i.invalidateActions = v;
}
findByName(name) {
if (this.findEphemera) {
if (name && name.indexOf("@@e:") == 0) {
return this.findEphemera(name);
}
}
return null;
}
get hasUserValues() {
return this._hasUserValues;
}
__m(propertyName) {
if (!this._inStyling) {
this._hasUserValues.add(propertyName);
}
}
_styling(container, component, parent) {
if (this._inStyling) {
return;
}
this._inStyling = true;
this._stylingContainer = container;
this._stylingParent = component;
let genericPrefix = "";
let typeName = this.i.$type.name;
if (typeName.indexOf("Xam") === 0) {
typeName = typeName.substring(3);
}
genericPrefix = toSpinal("DataGridFilterDialogComponent");
let additionalPrefixes = [];
let prefix = toSpinal(typeName);
additionalPrefixes.push(prefix + "-");
let 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);
}
let basePrefix = toSpinal(typeName);
additionalPrefixes.push(basePrefix + "-");
b = b.baseType;
}
if (parent) {
let parentTypeName = parent.i.$type.name;
if (parentTypeName.indexOf("Xam") === 0) {
parentTypeName = parentTypeName.substring(3);
}
let 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;
}
notifySizeChanged(width, height) {
this.i.be(width, height);
}
notifyCellSizeChanged() {
this.i.bd();
}
showIcon() {
this.i.br();
}
hideIcon() {
this.i.bb();
}
getDesiredToolbarActions() {
let iv = this.i.getDesiredToolbarActions();
return (iv);
}
addCommandAvailabilityListener(listener) {
this.i.addCommandAvailabilityListener(listener);
}
removeCommandAvailabilityListener(listener) {
this.i.removeCommandAvailabilityListener(listener);
}
addCommandStateChangedListener(listener) {
this.i.addCommandStateChangedListener(listener);
}
removeCommandStateChangedListener(listener) {
this.i.removeCommandStateChangedListener(listener);
}
provideContextAccessor(accessor) {
this.i.provideContextAccessor(accessor);
}
dismissContextAccessor(accessor) {
this.i.dismissContextAccessor(accessor);
}
get dialogOpening() {
return this._dialogOpening;
}
set dialogOpening(ev) {
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 = (o, e) => {
let 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);
;
}
get filterChanging() {
return this._filterChanging;
}
set filterChanging(ev) {
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 = (o, e) => {
let 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);
;
}
get filterChanged() {
return this._filterChanged;
}
set filterChanged(ev) {
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 = (o, e) => {
let 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);
;
}
get renderCompleted() {
return this._renderCompleted;
}
set renderCompleted(ev) {
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 = (o, e) => {
let 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);
;
}
}
IgcDataGridFilterDialogComponent._observedAttributesIgcDataGridFilterDialogComponent = null;
IgcDataGridFilterDialogComponent.htmlTagName = "igc-data-grid-filter-dialog";
IgcDataGridFilterDialogComponent._isElementRegistered = false;
return IgcDataGridFilterDialogComponent;
})();