UNPKG

igniteui-react-grids

Version:

Ignite UI React grid components.

287 lines (286 loc) 10.2 kB
import { __extends } from "tslib"; import { delegateCombine, delegateRemove } from "igniteui-react-core"; import { IgrToggleViewCancelableEventArgs } from "./igr-toggle-view-cancelable-event-args"; import { IgrToggleViewEventArgs } from "./igr-toggle-view-event-args"; import { IgrColumnToggledEventArgs } from "./igr-column-toggled-event-args"; import { IgrGridToolbarBaseAction } from "./igr-grid-toolbar-base-action"; import { interfaceToInternal } from "igniteui-react-core"; import { OverlaySettings } from "./OverlaySettings"; /** * Base class for the pinning/hiding column and exporter actions. * @hidden @internal */ var IgrBaseToolbarDirective = /** @class */ /*@__PURE__*/ (function (_super) { __extends(IgrBaseToolbarDirective, _super); function IgrBaseToolbarDirective(props) { var _this = _super.call(this, props) || this; _this._opening = null; _this._opening_wrapped = null; _this._opened = null; _this._opened_wrapped = null; _this._closing = null; _this._closing_wrapped = null; _this._closed = null; _this._closed_wrapped = null; _this._columnToggle = null; _this._columnToggle_wrapped = null; return _this; } Object.defineProperty(IgrBaseToolbarDirective.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; }, enumerable: false, configurable: true }); Object.defineProperty(IgrBaseToolbarDirective.prototype, "columnListHeight", { /** * Sets the height of the column list in the dropdown. */ get: function () { return this.i.l; }, set: function (v) { this.i.l = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrBaseToolbarDirective.prototype, "title", { /** * Title text for the column action component */ get: function () { return this.i.n; }, set: function (v) { this.i.n = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrBaseToolbarDirective.prototype, "prompt", { /** * The placeholder text for the search input. */ get: function () { return this.i.m; }, set: function (v) { this.i.m = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrBaseToolbarDirective.prototype, "overlaySettings", { /** * Sets overlay settings */ get: function () { return this.i.c.nativeElement; }, set: function (v) { this.i.c = interfaceToInternal(v, function () { return new OverlaySettings(); }); }, enumerable: false, configurable: true }); Object.defineProperty(IgrBaseToolbarDirective.prototype, "name", { get: function () { return this.i.a; }, set: function (v) { this.i.a = v; }, enumerable: false, configurable: true }); IgrBaseToolbarDirective.prototype.findByName = function (name) { var baseResult = _super.prototype.findByName.call(this, name); if (baseResult) { return baseResult; } if (this.overlaySettings && this.overlaySettings.name && this.overlaySettings.name == name) { return this.overlaySettings; } return null; }; IgrBaseToolbarDirective.prototype.setNativeElement = function (element) { this.i.setNativeElement(element); }; Object.defineProperty(IgrBaseToolbarDirective.prototype, "opening", { /** * Emits an event before the toggle container is opened. */ get: function () { return this._opening; }, set: function (ev) { var _this = this; if (this._opening_wrapped !== null) { this.i.opening = delegateRemove(this.i.opening, this._opening_wrapped); this._opening_wrapped = null; this._opening = null; } this._opening = ev; this._opening_wrapped = function (o, e) { var outerArgs = new IgrToggleViewCancelableEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeOpening) { _this.beforeOpening(_this, outerArgs); } if (_this._opening) { _this._opening(_this, outerArgs); } }; this.i.opening = delegateCombine(this.i.opening, this._opening_wrapped); if (this.i.openingChanged) { this.i.openingChanged(); } ; }, enumerable: false, configurable: true }); Object.defineProperty(IgrBaseToolbarDirective.prototype, "opened", { /** * Emits an event after the toggle container is opened. */ get: function () { return this._opened; }, set: function (ev) { var _this = this; if (this._opened_wrapped !== null) { this.i.opened = delegateRemove(this.i.opened, this._opened_wrapped); this._opened_wrapped = null; this._opened = null; } this._opened = ev; this._opened_wrapped = function (o, e) { var outerArgs = new IgrToggleViewEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeOpened) { _this.beforeOpened(_this, outerArgs); } if (_this._opened) { _this._opened(_this, outerArgs); } }; this.i.opened = delegateCombine(this.i.opened, this._opened_wrapped); if (this.i.openedChanged) { this.i.openedChanged(); } ; }, enumerable: false, configurable: true }); Object.defineProperty(IgrBaseToolbarDirective.prototype, "closing", { /** * Emits an event before the toggle container is closed. */ get: function () { return this._closing; }, set: function (ev) { var _this = this; if (this._closing_wrapped !== null) { this.i.closing = delegateRemove(this.i.closing, this._closing_wrapped); this._closing_wrapped = null; this._closing = null; } this._closing = ev; this._closing_wrapped = function (o, e) { var outerArgs = new IgrToggleViewEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeClosing) { _this.beforeClosing(_this, outerArgs); } if (_this._closing) { _this._closing(_this, outerArgs); } }; this.i.closing = delegateCombine(this.i.closing, this._closing_wrapped); if (this.i.closingChanged) { this.i.closingChanged(); } ; }, enumerable: false, configurable: true }); Object.defineProperty(IgrBaseToolbarDirective.prototype, "closed", { /** * Emits an event after the toggle container is closed. */ get: function () { return this._closed; }, set: function (ev) { var _this = this; if (this._closed_wrapped !== null) { this.i.closed = delegateRemove(this.i.closed, this._closed_wrapped); this._closed_wrapped = null; this._closed = null; } this._closed = ev; this._closed_wrapped = function (o, e) { var outerArgs = new IgrToggleViewEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeClosed) { _this.beforeClosed(_this, outerArgs); } if (_this._closed) { _this._closed(_this, outerArgs); } }; this.i.closed = delegateCombine(this.i.closed, this._closed_wrapped); if (this.i.closedChanged) { this.i.closedChanged(); } ; }, enumerable: false, configurable: true }); Object.defineProperty(IgrBaseToolbarDirective.prototype, "columnToggle", { /** * Emits when after a column's checked state is changed */ get: function () { return this._columnToggle; }, set: function (ev) { var _this = this; if (this._columnToggle_wrapped !== null) { this.i.columnToggle = delegateRemove(this.i.columnToggle, this._columnToggle_wrapped); this._columnToggle_wrapped = null; this._columnToggle = null; } this._columnToggle = ev; this._columnToggle_wrapped = function (o, e) { var outerArgs = new IgrColumnToggledEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeColumnToggle) { _this.beforeColumnToggle(_this, outerArgs); } if (_this._columnToggle) { _this._columnToggle(_this, outerArgs); } }; this.i.columnToggle = delegateCombine(this.i.columnToggle, this._columnToggle_wrapped); if (this.i.columnToggleChanged) { this.i.columnToggleChanged(); } ; }, enumerable: false, configurable: true }); return IgrBaseToolbarDirective; }(IgrGridToolbarBaseAction)); export { IgrBaseToolbarDirective };