UNPKG

igniteui-webcomponents-grids

Version:

Ignite UI Web Components grid components.

168 lines (167 loc) 7.71 kB
import { NamePatcher, toSpinal, getAllPropertyNames } from "igniteui-webcomponents-core"; import { WebComponentRenderer } from "igniteui-webcomponents-core"; import { delegateCombine, delegateRemove } from "igniteui-webcomponents-core"; import { DataGridStylingDefaults } from './DataGridStylingDefaults'; import { RegisterElementHelper } from "igniteui-webcomponents-core"; import { GridColumnButtonOptions } from "./GridColumnButtonOptions"; import { IgcGridColumnOptionsSectionBaseComponent } from "./igc-grid-column-options-section-base-component"; import { IgcApplyButtonClickEventArgs } from './igc-apply-button-click-event-args'; import { IgcCancelButtonClickEventArgs } from './igc-cancel-button-click-event-args'; export let IgcGridColumnButtonOptionsComponent = /*@__PURE__*/ (() => { class IgcGridColumnButtonOptionsComponent 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; this._applyButtonClick = null; this._applyButtonClick_wrapped = null; this._cancelButtonClick = null; this._cancelButtonClick_wrapped = null; 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 GridColumnButtonOptions(); } get i() { return this._implementation; } disconnectedCallback() { this._disconnected = true; } connectedCallback() { if (this._disconnected) { this._disconnected = false; return; } this.classList.add("ig-grid-column-button-options"); this.classList.add("igc-grid-column-button-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 buttonsSection = document.createElement("div"); buttonsSection.setAttribute("key", "buttonsSection"); rootElement.appendChild(buttonsSection); var buttonsSectionWrapper = this._webComponentRenderer.getWrapper(buttonsSection); this.i.provideButtonSection(buttonsSectionWrapper); this._flushQueuedAttributes(); // supports themes or custom properties set in CSS this._styling(this, this); this.afterContentInit(); } afterContentInit() { } static get observedAttributes() { if (IgcGridColumnButtonOptionsComponent._observedAttributesIgcGridColumnButtonOptionsComponent == null) { let names = getAllPropertyNames(IgcGridColumnButtonOptionsComponent); for (let i = 0; i < names.length; i++) { names[i] = toSpinal(names[i]); } IgcGridColumnButtonOptionsComponent._observedAttributesIgcGridColumnButtonOptionsComponent = names; } return IgcGridColumnButtonOptionsComponent._observedAttributesIgcGridColumnButtonOptionsComponent; } static register() { if (!IgcGridColumnButtonOptionsComponent._isElementRegistered) { IgcGridColumnButtonOptionsComponent._isElementRegistered = true; RegisterElementHelper.registerElement(IgcGridColumnButtonOptionsComponent.htmlTagName, IgcGridColumnButtonOptionsComponent); } } get applyButtonCaption() { return this.i.bz; } set applyButtonCaption(v) { this.i.bz = v; } get cancelButtonCaption() { return this.i.b3; } set cancelButtonCaption(v) { this.i.b3 = v; } get applyButtonClick() { return this._applyButtonClick; } set applyButtonClick(ev) { if (this._applyButtonClick_wrapped !== null) { this.i.applyButtonClick = delegateRemove(this.i.applyButtonClick, this._applyButtonClick_wrapped); this._applyButtonClick_wrapped = null; this._applyButtonClick = null; } this._applyButtonClick = ev; this._applyButtonClick_wrapped = (o, e) => { let outerArgs = new IgcApplyButtonClickEventArgs(); outerArgs._provideImplementation(e); if (this.beforeApplyButtonClick) { this.beforeApplyButtonClick(this, outerArgs); } if (this._applyButtonClick) { this._applyButtonClick(this, outerArgs); } }; this.i.applyButtonClick = delegateCombine(this.i.applyButtonClick, this._applyButtonClick_wrapped); ; } get cancelButtonClick() { return this._cancelButtonClick; } set cancelButtonClick(ev) { if (this._cancelButtonClick_wrapped !== null) { this.i.cancelButtonClick = delegateRemove(this.i.cancelButtonClick, this._cancelButtonClick_wrapped); this._cancelButtonClick_wrapped = null; this._cancelButtonClick = null; } this._cancelButtonClick = ev; this._cancelButtonClick_wrapped = (o, e) => { let outerArgs = new IgcCancelButtonClickEventArgs(); outerArgs._provideImplementation(e); if (this.beforeCancelButtonClick) { this.beforeCancelButtonClick(this, outerArgs); } if (this._cancelButtonClick) { this._cancelButtonClick(this, outerArgs); } }; this.i.cancelButtonClick = delegateCombine(this.i.cancelButtonClick, this._cancelButtonClick_wrapped); ; } } IgcGridColumnButtonOptionsComponent._observedAttributesIgcGridColumnButtonOptionsComponent = null; IgcGridColumnButtonOptionsComponent.htmlTagName = "igc-grid-column-button-options"; IgcGridColumnButtonOptionsComponent._isElementRegistered = false; return IgcGridColumnButtonOptionsComponent; })();