UNPKG

igniteui-webcomponents-grids

Version:

Ignite UI Web Components grid components.

159 lines (158 loc) 6.64 kB
import { ensureEnum, brushToString, stringToBrush, NamePatcher, toSpinal, enumToString, getAllPropertyNames } from "igniteui-webcomponents-core"; import { WebComponentRenderer, PortalManager } from "igniteui-webcomponents-core"; import { DataGridStylingDefaults } from './DataGridStylingDefaults'; import { RegisterElementHelper } from "igniteui-webcomponents-core"; import { GridColumnSummaryOptions } from "./GridColumnSummaryOptions"; import { IgcGridColumnOptionsSectionBaseComponent } from "./igc-grid-column-options-section-base-component"; import { ControlDisplayDensity_$type } from "igniteui-webcomponents-core"; export let IgcGridColumnSummaryOptionsComponent = /*@__PURE__*/ (() => { class IgcGridColumnSummaryOptionsComponent 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._portalManager = new PortalManager("summarySubMenu"); this._webComponentRenderer = new WebComponentRenderer(this, document, true, DataGridStylingDefaults, this._portalManager); 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 GridColumnSummaryOptions(); } get i() { return this._implementation; } disconnectedCallback() { this._disconnected = true; } connectedCallback() { if (this._disconnected) { this._disconnected = false; return; } this.classList.add("ig-grid-column-summary-options"); this.classList.add("igc-grid-column-summary-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; this._flushQueuedAttributes(); // supports themes or custom properties set in CSS this._styling(this, this); this.afterContentInit(); } afterContentInit() { } static get observedAttributes() { if (IgcGridColumnSummaryOptionsComponent._observedAttributesIgcGridColumnSummaryOptionsComponent == null) { let names = getAllPropertyNames(IgcGridColumnSummaryOptionsComponent); for (let i = 0; i < names.length; i++) { names[i] = toSpinal(names[i]); } IgcGridColumnSummaryOptionsComponent._observedAttributesIgcGridColumnSummaryOptionsComponent = names; } return IgcGridColumnSummaryOptionsComponent._observedAttributesIgcGridColumnSummaryOptionsComponent; } static register() { if (!IgcGridColumnSummaryOptionsComponent._isElementRegistered) { IgcGridColumnSummaryOptionsComponent._isElementRegistered = true; RegisterElementHelper.registerElement(IgcGridColumnSummaryOptionsComponent.htmlTagName, IgcGridColumnSummaryOptionsComponent); } } /** * Gets or sets the text inside the summary button. */ get summaryCaption() { return this.i.cd; } set summaryCaption(v) { this.i.cd = v; } /** * Gets or sets the display density used for the summary list. */ get summaryListDensity() { return this.i.b5; } set summaryListDensity(v) { this.i.b5 = ensureEnum(ControlDisplayDensity_$type, v); this._a("summaryListDensity", enumToString(ControlDisplayDensity_$type, this.i.b5)); } /** * Gets the actual display density used for the summary list. */ get actualSummaryListDensity() { return this.i.b3; } set actualSummaryListDensity(v) { this.i.b3 = ensureEnum(ControlDisplayDensity_$type, v); this._a("actualSummaryListDensity", enumToString(ControlDisplayDensity_$type, this.i.b3)); } get activeCount() { return this.i.b7; } set activeCount(v) { this.i.b7 = +v; this._a("activeCount", this.i.b7); } get summaryListTextColor() { return brushToString(this.i.cv); } set summaryListTextColor(v) { this.i.cv = stringToBrush(v); this._a("summaryListTextColor", brushToString(this.i.cv)); } get summaryListBackground() { return brushToString(this.i.cu); } set summaryListBackground(v) { this.i.cu = stringToBrush(v); this._a("summaryListBackground", brushToString(this.i.cu)); } onApply() { this.i.bt(); } onCancel() { this.i.bu(); } closeMenu() { this.i.cj(); } } IgcGridColumnSummaryOptionsComponent._observedAttributesIgcGridColumnSummaryOptionsComponent = null; IgcGridColumnSummaryOptionsComponent.htmlTagName = "igc-grid-column-summary-options"; IgcGridColumnSummaryOptionsComponent._isElementRegistered = false; return IgcGridColumnSummaryOptionsComponent; })();