igniteui-webcomponents-grids
Version:
Ignite UI Web Components grid components.
116 lines (115 loc) • 5.06 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 { GridColumnSortOptions } from "./GridColumnSortOptions";
import { IgcGridColumnOptionsSimpleSectionBaseComponent } from "./igc-grid-column-options-simple-section-base-component";
import { ColumnSortDirection_$type } from "./ColumnSortDirection";
export let IgcGridColumnSortOptionsComponent = /*@__PURE__*/ (() => {
class IgcGridColumnSortOptionsComponent extends IgcGridColumnOptionsSimpleSectionBaseComponent {
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 GridColumnSortOptions();
}
get i() {
return this._implementation;
}
disconnectedCallback() {
this._disconnected = true;
}
connectedCallback() {
if (this._disconnected) {
this._disconnected = false;
return;
}
this.classList.add("ig-grid-column-sort-options");
this.classList.add("igc-grid-column-sort-options");
this.appendChild(this._webComponentRenderer.rootWrapper.getNativeElement());
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 (IgcGridColumnSortOptionsComponent._observedAttributesIgcGridColumnSortOptionsComponent == null) {
let names = getAllPropertyNames(IgcGridColumnSortOptionsComponent);
for (let i = 0; i < names.length; i++) {
names[i] = toSpinal(names[i]);
}
IgcGridColumnSortOptionsComponent._observedAttributesIgcGridColumnSortOptionsComponent = names;
}
return IgcGridColumnSortOptionsComponent._observedAttributesIgcGridColumnSortOptionsComponent;
}
static register() {
if (!IgcGridColumnSortOptionsComponent._isElementRegistered) {
IgcGridColumnSortOptionsComponent._isElementRegistered = true;
RegisterElementHelper.registerElement(IgcGridColumnSortOptionsComponent.htmlTagName, IgcGridColumnSortOptionsComponent);
}
}
get ascendingCaption() {
return this.i.b5;
}
set ascendingCaption(v) {
this.i.b5 = v;
}
get descendingCaption() {
return this.i.b9;
}
set descendingCaption(v) {
this.i.b9 = v;
}
get sortDirection() {
return this.i.b2;
}
set sortDirection(v) {
this.i.b2 = ensureEnum(ColumnSortDirection_$type, v);
this._a("sortDirection", enumToString(ColumnSortDirection_$type, this.i.b2));
}
}
IgcGridColumnSortOptionsComponent._observedAttributesIgcGridColumnSortOptionsComponent = null;
IgcGridColumnSortOptionsComponent.htmlTagName = "igc-grid-column-sort-options";
IgcGridColumnSortOptionsComponent._isElementRegistered = false;
return IgcGridColumnSortOptionsComponent;
})();