igniteui-webcomponents-grids
Version:
Ignite UI Web Components grid components.
160 lines (159 loc) • 7.49 kB
JavaScript
import { ensureEnum, NamePatcher, toSpinal, enumToString, getAllPropertyNames } from "igniteui-webcomponents-core";
import { WebComponentRenderer } from "igniteui-webcomponents-core";
import { DataGridStylingDefaults } from './DataGridStylingDefaults';
import { RegisterElementHelper } from "igniteui-webcomponents-core";
import { GridColumnFilterOptions } from "./GridColumnFilterOptions";
import { IgcGridColumnOptionsSectionBaseComponent } from "./igc-grid-column-options-section-base-component";
import { ControlDisplayDensity_$type } from "igniteui-webcomponents-core";
export let IgcGridColumnFilterOptionsComponent = /*@__PURE__*/ (() => {
class IgcGridColumnFilterOptionsComponent extends IgcGridColumnOptionsSectionBaseComponent {
set height(value) {
this._height = value;
this.style.height = value;
}
get height() {
return this._height;
}
set width(value) {
this._width = value;
this.style.width = value;
}
get width() {
return this._width;
}
constructor() {
super();
this._disconnected = false;
if (this._styling) {
NamePatcher.ensureStylablePatched(Object.getPrototypeOf(this));
}
this._webComponentRenderer = new WebComponentRenderer(this, document, true, DataGridStylingDefaults);
this._webComponentWrapper = this._webComponentRenderer.createElement("div");
this._webComponentRenderer.updateRoot(this._webComponentWrapper);
//this._webComponentRenderer.rootWrapper.append(this._webComponentWrapper);
this._webComponentWrapper.setStyleProperty("display", "block");
this._webComponentWrapper.setStyleProperty("width", "100%");
this._webComponentWrapper.setStyleProperty("height", "100%");
this.i.provideRenderer(this._webComponentRenderer);
}
// supports angular themes or custom properties set in CSS
updateStyle() {
this._styling(this, this);
}
destroy() {
this._implementation.destroy();
this._webComponentRenderer.destroy();
}
createImplementation() {
return new GridColumnFilterOptions();
}
get i() {
return this._implementation;
}
disconnectedCallback() {
this._disconnected = true;
}
connectedCallback() {
if (this._disconnected) {
this._disconnected = false;
return;
}
this.classList.add("ig-grid-column-filter-options");
this.classList.add("igc-grid-column-filter-options");
var rootWrapper = this._webComponentRenderer.rootWrapper;
var rootElement = rootWrapper.getNativeElement();
this.appendChild(rootElement);
this._attached = true;
this.style.display = "block";
this.style.height = this._height;
this.style.width = this._width;
var clearFiltersSection = document.createElement("div");
clearFiltersSection.setAttribute("key", "clearFiltersSection");
rootElement.appendChild(clearFiltersSection);
var clearFiltersSectionWrapper = this._webComponentRenderer.getWrapper(clearFiltersSection);
this.i.provideClearFiltersSection(clearFiltersSectionWrapper);
var filtersSection = document.createElement("div");
filtersSection.setAttribute("key", "filtersSection");
rootElement.appendChild(filtersSection);
var filtersSectionWrapper = this._webComponentRenderer.getWrapper(filtersSection);
this.i.provideFilterSection(filtersSectionWrapper);
var filterCheckboxListSection = this._webComponentRenderer.createElement("igc-checkbox-list");
filterCheckboxListSection.setAttribute("key", "filterCheckboxListSection");
filterCheckboxListSection.setAttribute("height", "195px");
rootWrapper.append(filterCheckboxListSection);
this.i.provideFilterCheckboxListSection(filterCheckboxListSection.getNativeElement().i);
var filterButtonsSection = document.createElement("div");
filterButtonsSection.setAttribute("key", "filterButtonsSection");
rootElement.appendChild(filterButtonsSection);
var filterButtonsSectionWrapper = this._webComponentRenderer.getWrapper(filterButtonsSection);
this.i.provideFilterButtonSection(filterButtonsSectionWrapper);
this._flushQueuedAttributes();
// supports themes or custom properties set in CSS
this._styling(this, this);
this.afterContentInit();
}
afterContentInit() {
}
static get observedAttributes() {
if (IgcGridColumnFilterOptionsComponent._observedAttributesIgcGridColumnFilterOptionsComponent == null) {
let names = getAllPropertyNames(IgcGridColumnFilterOptionsComponent);
for (let i = 0; i < names.length; i++) {
names[i] = toSpinal(names[i]);
}
IgcGridColumnFilterOptionsComponent._observedAttributesIgcGridColumnFilterOptionsComponent = names;
}
return IgcGridColumnFilterOptionsComponent._observedAttributesIgcGridColumnFilterOptionsComponent;
}
static register() {
if (!IgcGridColumnFilterOptionsComponent._isElementRegistered) {
IgcGridColumnFilterOptionsComponent._isElementRegistered = true;
RegisterElementHelper.registerElement(IgcGridColumnFilterOptionsComponent.htmlTagName, IgcGridColumnFilterOptionsComponent);
}
}
get clearColumnFiltersCaption() {
return this.i.b7;
}
set clearColumnFiltersCaption(v) {
this.i.b7 = v;
}
get filterListPlaceholderText() {
return this.i.cc;
}
set filterListPlaceholderText(v) {
this.i.cc = v;
}
/**
* Gets or sets the display Density to use for the buttons in the component.
*/
get filterListDensity() {
return this.i.b2;
}
set filterListDensity(v) {
this.i.b2 = ensureEnum(ControlDisplayDensity_$type, v);
this._a("filterListDensity", enumToString(ControlDisplayDensity_$type, this.i.b2));
}
/**
* Gets the actual display filterListDensity to use for the component.
*/
get actualFilterListDensity() {
return this.i.b0;
}
set actualFilterListDensity(v) {
this.i.b0 = ensureEnum(ControlDisplayDensity_$type, v);
this._a("actualFilterListDensity", enumToString(ControlDisplayDensity_$type, this.i.b0));
}
get textFilterCaption() {
return this.i.cg;
}
set textFilterCaption(v) {
this.i.cg = v;
}
onApply() {
this.i.bt();
}
}
IgcGridColumnFilterOptionsComponent._observedAttributesIgcGridColumnFilterOptionsComponent = null;
IgcGridColumnFilterOptionsComponent.htmlTagName = "igc-grid-column-filter-options";
IgcGridColumnFilterOptionsComponent._isElementRegistered = false;
return IgcGridColumnFilterOptionsComponent;
})();