igniteui-webcomponents-grids
Version:
Ignite UI Web Components grid components.
204 lines (203 loc) • 9.31 kB
JavaScript
import { __extends } from "tslib";
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';
var IgcGridColumnButtonOptionsComponent = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgcGridColumnButtonOptionsComponent, _super);
function IgcGridColumnButtonOptionsComponent() {
var _this = _super.call(this) || this;
_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);
return _this;
}
Object.defineProperty(IgcGridColumnButtonOptionsComponent.prototype, "height", {
get: function () {
return this._height;
},
set: function (value) {
this._height = value;
this.style.height = value;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcGridColumnButtonOptionsComponent.prototype, "width", {
get: function () {
return this._width;
},
set: function (value) {
this._width = value;
this.style.width = value;
},
enumerable: false,
configurable: true
});
// supports angular themes or custom properties set in CSS
IgcGridColumnButtonOptionsComponent.prototype.updateStyle = function () {
this._styling(this, this);
};
IgcGridColumnButtonOptionsComponent.prototype.destroy = function () {
this._implementation.destroy();
this._webComponentRenderer.destroy();
};
IgcGridColumnButtonOptionsComponent.prototype.createImplementation = function () {
return new GridColumnButtonOptions();
};
Object.defineProperty(IgcGridColumnButtonOptionsComponent.prototype, "i", {
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
IgcGridColumnButtonOptionsComponent.prototype.disconnectedCallback = function () {
this._disconnected = true;
};
IgcGridColumnButtonOptionsComponent.prototype.connectedCallback = function () {
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();
};
IgcGridColumnButtonOptionsComponent.prototype.afterContentInit = function () {
};
Object.defineProperty(IgcGridColumnButtonOptionsComponent, "observedAttributes", {
get: function () {
if (IgcGridColumnButtonOptionsComponent._observedAttributesIgcGridColumnButtonOptionsComponent == null) {
var names = getAllPropertyNames(IgcGridColumnButtonOptionsComponent);
for (var i = 0; i < names.length; i++) {
names[i] = toSpinal(names[i]);
}
IgcGridColumnButtonOptionsComponent._observedAttributesIgcGridColumnButtonOptionsComponent = names;
}
return IgcGridColumnButtonOptionsComponent._observedAttributesIgcGridColumnButtonOptionsComponent;
},
enumerable: false,
configurable: true
});
IgcGridColumnButtonOptionsComponent.register = function () {
if (!IgcGridColumnButtonOptionsComponent._isElementRegistered) {
IgcGridColumnButtonOptionsComponent._isElementRegistered = true;
RegisterElementHelper.registerElement(IgcGridColumnButtonOptionsComponent.htmlTagName, IgcGridColumnButtonOptionsComponent);
}
};
Object.defineProperty(IgcGridColumnButtonOptionsComponent.prototype, "applyButtonCaption", {
get: function () {
return this.i.bz;
},
set: function (v) {
this.i.bz = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcGridColumnButtonOptionsComponent.prototype, "cancelButtonCaption", {
get: function () {
return this.i.b3;
},
set: function (v) {
this.i.b3 = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcGridColumnButtonOptionsComponent.prototype, "applyButtonClick", {
get: function () {
return this._applyButtonClick;
},
set: function (ev) {
var _this = this;
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 = function (o, e) {
var 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);
;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcGridColumnButtonOptionsComponent.prototype, "cancelButtonClick", {
get: function () {
return this._cancelButtonClick;
},
set: function (ev) {
var _this = this;
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 = function (o, e) {
var 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);
;
},
enumerable: false,
configurable: true
});
IgcGridColumnButtonOptionsComponent._observedAttributesIgcGridColumnButtonOptionsComponent = null;
IgcGridColumnButtonOptionsComponent.htmlTagName = "igc-grid-column-button-options";
IgcGridColumnButtonOptionsComponent._isElementRegistered = false;
return IgcGridColumnButtonOptionsComponent;
}(IgcGridColumnOptionsSectionBaseComponent));
export { IgcGridColumnButtonOptionsComponent };