"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); /*! * devextreme-angular * Version: 19.1.16 * Build date: Tue Oct 18 2022 * * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file in the root of the project for details. * * https://github.com/DevExpress/devextreme-angular */ Object.defineProperty(exports, "__esModule", { value: true }); var platform_browser_1 = require("@angular/platform-browser"); var platform_browser_2 = require("@angular/platform-browser"); var core_1 = require("@angular/core"); var action_sheet_1 = require("devextreme/ui/action_sheet"); var component_1 = require("../core/component"); var template_host_1 = require("../core/template-host"); var integration_1 = require("../core/integration"); var template_1 = require("../core/template"); var nested_option_1 = require("../core/nested-option"); var watcher_helper_1 = require("../core/watcher-helper"); var iterable_differ_helper_1 = require("../core/iterable-differ-helper"); var item_dxi_1 = require("./nested/item-dxi"); var item_dxi_2 = require("./nested/item-dxi"); /** * The ActionSheet widget is a sheet containing a set of buttons located one under the other. These buttons usually represent several choices relating to a single task. */ var DxActionSheetComponent = (function (_super) { __extends(DxActionSheetComponent, _super); function DxActionSheetComponent(elementRef, ngZone, templateHost, _watcherHelper, _idh, optionHost, transferState, platformId) { var _this = _super.call(this, elementRef, ngZone, templateHost, _watcherHelper, transferState, platformId) || this; _this._watcherHelper = _watcherHelper; _this._idh = _idh; _this._createEventEmitters([ { subscribe: 'cancelClick', emit: 'onCancelClick' }, { subscribe: 'contentReady', emit: 'onContentReady' }, { subscribe: 'disposing', emit: 'onDisposing' }, { subscribe: 'initialized', emit: 'onInitialized' }, { subscribe: 'itemClick', emit: 'onItemClick' }, { subscribe: 'itemContextMenu', emit: 'onItemContextMenu' }, { subscribe: 'itemHold', emit: 'onItemHold' }, { subscribe: 'itemRendered', emit: 'onItemRendered' }, { subscribe: 'optionChanged', emit: 'onOptionChanged' }, { emit: 'cancelTextChange' }, { emit: 'dataSourceChange' }, { emit: 'disabledChange' }, { emit: 'elementAttrChange' }, { emit: 'heightChange' }, { emit: 'hintChange' }, { emit: 'hoverStateEnabledChange' }, { emit: 'itemHoldTimeoutChange' }, { emit: 'itemsChange' }, { emit: 'itemTemplateChange' }, { emit: 'rtlEnabledChange' }, { emit: 'showCancelButtonChange' }, { emit: 'showTitleChange' }, { emit: 'targetChange' }, { emit: 'titleChange' }, { emit: 'usePopoverChange' }, { emit: 'visibleChange' }, { emit: 'widthChange' } ]); _this._idh.setHost(_this); optionHost.setHost(_this); return _this; } Object.defineProperty(DxActionSheetComponent.prototype, "cancelText", { get: /** * The text displayed in the button that closes the action sheet. */ function () { return this._getOption('cancelText'); }, set: function (value) { this._setOption('cancelText', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxActionSheetComponent.prototype, "dataSource", { get: /** * Binds the widget to data. */ function () { return this._getOption('dataSource'); }, set: function (value) { this._setOption('dataSource', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxActionSheetComponent.prototype, "disabled", { get: /** * Specifies whether the widget responds to user interaction. */ function () { return this._getOption('disabled'); }, set: function (value) { this._setOption('disabled', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxActionSheetComponent.prototype, "elementAttr", { get: /** * Specifies the attributes to be attached to the widget's root element. */ function () { return this._getOption('elementAttr'); }, set: function (value) { this._setOption('elementAttr', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxActionSheetComponent.prototype, "height", { get: /** * Specifies the widget's height. */ function () { return this._getOption('height'); }, set: function (value) { this._setOption('height', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxActionSheetComponent.prototype, "hint", { get: /** * Specifies text for a hint that appears when a user pauses on the widget. */ function () { return this._getOption('hint'); }, set: function (value) { this._setOption('hint', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxActionSheetComponent.prototype, "hoverStateEnabled", { get: /** * Specifies whether the widget changes its state when a user pauses on it. */ function () { return this._getOption('hoverStateEnabled'); }, set: function (value) { this._setOption('hoverStateEnabled', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxActionSheetComponent.prototype, "itemHoldTimeout", { get: /** * The time period in milliseconds before the onItemHold event is raised. */ function () { return this._getOption('itemHoldTimeout'); }, set: function (value) { this._setOption('itemHoldTimeout', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxActionSheetComponent.prototype, "items", { get: /** * An array of items displayed by the widget. */ function () { return this._getOption('items'); }, set: function (value) { this._setOption('items', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxActionSheetComponent.prototype, "itemTemplate", { get: /** * Specifies a custom template for items. */ function () { return this._getOption('itemTemplate'); }, set: function (value) { this._setOption('itemTemplate', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxActionSheetComponent.prototype, "rtlEnabled", { get: /** * Switches the widget to a right-to-left representation. */ function () { return this._getOption('rtlEnabled'); }, set: function (value) { this._setOption('rtlEnabled', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxActionSheetComponent.prototype, "showCancelButton", { get: /** * Specifies whether or not to display the Cancel button in action sheet. */ function () { return this._getOption('showCancelButton'); }, set: function (value) { this._setOption('showCancelButton', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxActionSheetComponent.prototype, "showTitle", { get: /** * A Boolean value specifying whether or not the title of the action sheet is visible. */ function () { return this._getOption('showTitle'); }, set: function (value) { this._setOption('showTitle', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxActionSheetComponent.prototype, "target", { get: /** * Specifies the element the action sheet popover points at. Applies only if usePopover is true. */ function () { return this._getOption('target'); }, set: function (value) { this._setOption('target', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxActionSheetComponent.prototype, "title", { get: /** * The title of the action sheet. */ function () { return this._getOption('title'); }, set: function (value) { this._setOption('title', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxActionSheetComponent.prototype, "usePopover", { get: /** * Specifies whether or not to show the action sheet within a Popover widget. */ function () { return this._getOption('usePopover'); }, set: function (value) { this._setOption('usePopover', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxActionSheetComponent.prototype, "visible", { get: /** * A Boolean value specifying whether or not the ActionSheet widget is visible. */ function () { return this._getOption('visible'); }, set: function (value) { this._setOption('visible', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxActionSheetComponent.prototype, "width", { get: /** * Specifies the widget's width. */ function () { return this._getOption('width'); }, set: function (value) { this._setOption('width', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxActionSheetComponent.prototype, "itemsChildren", { get: function () { return this._getOption('items'); }, set: function (value) { this.setChildren('items', value); }, enumerable: true, configurable: true }); DxActionSheetComponent.prototype._createInstance = function (element, options) { return new action_sheet_1.default(element, options); }; DxActionSheetComponent.prototype.ngOnDestroy = function () { this._destroyWidget(); }; DxActionSheetComponent.prototype.ngOnChanges = function (changes) { _super.prototype.ngOnChanges.call(this, changes); this.setupChanges('dataSource', changes); this.setupChanges('items', changes); }; DxActionSheetComponent.prototype.setupChanges = function (prop, changes) { if (!(prop in this._optionsToUpdate)) { this._idh.setup(prop, changes); } }; DxActionSheetComponent.prototype.ngDoCheck = function () { this._idh.doCheck('dataSource'); this._idh.doCheck('items'); this._watcherHelper.checkWatchers(); _super.prototype.ngDoCheck.call(this); _super.prototype.clearChangedOptions.call(this); }; DxActionSheetComponent.prototype._setOption = function (name, value) { var isSetup = this._idh.setupSingle(name, value); var isChanged = this._idh.getChanges(name, value) !== null; if (isSetup || isChanged) { _super.prototype._setOption.call(this, name, value); } }; DxActionSheetComponent.decorators = [ { type: core_1.Component, args: [{ selector: 'dx-action-sheet', template: '', providers: [ template_host_1.DxTemplateHost, watcher_helper_1.WatcherHelper, nested_option_1.NestedOptionHost, iterable_differ_helper_1.IterableDifferHelper ] },] }, ]; /** @nocollapse */ DxActionSheetComponent.ctorParameters = function () { return [ { type: core_1.ElementRef, }, { type: core_1.NgZone, }, { type: template_host_1.DxTemplateHost, }, { type: watcher_helper_1.WatcherHelper, }, { type: iterable_differ_helper_1.IterableDifferHelper, }, { type: nested_option_1.NestedOptionHost, }, { type: platform_browser_2.TransferState, }, { type: undefined, decorators: [{ type: core_1.Inject, args: [core_1.PLATFORM_ID,] },] }, ]; }; DxActionSheetComponent.propDecorators = { "cancelText": [{ type: core_1.Input },], "dataSource": [{ type: core_1.Input },], "disabled": [{ type: core_1.Input },], "elementAttr": [{ type: core_1.Input },], "height": [{ type: core_1.Input },], "hint": [{ type: core_1.Input },], "hoverStateEnabled": [{ type: core_1.Input },], "itemHoldTimeout": [{ type: core_1.Input },], "items": [{ type: core_1.Input },], "itemTemplate": [{ type: core_1.Input },], "rtlEnabled": [{ type: core_1.Input },], "showCancelButton": [{ type: core_1.Input },], "showTitle": [{ type: core_1.Input },], "target": [{ type: core_1.Input },], "title": [{ type: core_1.Input },], "usePopover": [{ type: core_1.Input },], "visible": [{ type: core_1.Input },], "width": [{ type: core_1.Input },], "onCancelClick": [{ type: core_1.Output },], "onContentReady": [{ type: core_1.Output },], "onDisposing": [{ type: core_1.Output },], "onInitialized": [{ type: core_1.Output },], "onItemClick": [{ type: core_1.Output },], "onItemContextMenu": [{ type: core_1.Output },], "onItemHold": [{ type: core_1.Output },], "onItemRendered": [{ type: core_1.Output },], "onOptionChanged": [{ type: core_1.Output },], "cancelTextChange": [{ type: core_1.Output },], "dataSourceChange": [{ type: core_1.Output },], "disabledChange": [{ type: core_1.Output },], "elementAttrChange": [{ type: core_1.Output },], "heightChange": [{ type: core_1.Output },], "hintChange": [{ type: core_1.Output },], "hoverStateEnabledChange": [{ type: core_1.Output },], "itemHoldTimeoutChange": [{ type: core_1.Output },], "itemsChange": [{ type: core_1.Output },], "itemTemplateChange": [{ type: core_1.Output },], "rtlEnabledChange": [{ type: core_1.Output },], "showCancelButtonChange": [{ type: core_1.Output },], "showTitleChange": [{ type: core_1.Output },], "targetChange": [{ type: core_1.Output },], "titleChange": [{ type: core_1.Output },], "usePopoverChange": [{ type: core_1.Output },], "visibleChange": [{ type: core_1.Output },], "widthChange": [{ type: core_1.Output },], "itemsChildren": [{ type: core_1.ContentChildren, args: [item_dxi_2.DxiItemComponent,] },], }; return DxActionSheetComponent; }(component_1.DxComponent)); exports.DxActionSheetComponent = DxActionSheetComponent; var DxActionSheetModule = (function () { function DxActionSheetModule() { } DxActionSheetModule.decorators = [ { type: core_1.NgModule, args: [{ imports: [ item_dxi_1.DxiItemModule, integration_1.DxIntegrationModule, template_1.DxTemplateModule, platform_browser_1.BrowserTransferStateModule ], declarations: [ DxActionSheetComponent ], exports: [ DxActionSheetComponent, item_dxi_1.DxiItemModule, template_1.DxTemplateModule ] },] }, ]; return DxActionSheetModule; }()); exports.DxActionSheetModule = DxActionSheetModule; //# sourceMappingURL=action-sheet.js.map