slide-out-view.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  1. "use strict";
  2. var __extends = (this && this.__extends) || (function () {
  3. var extendStatics = Object.setPrototypeOf ||
  4. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  5. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  6. return function (d, b) {
  7. extendStatics(d, b);
  8. function __() { this.constructor = d; }
  9. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  10. };
  11. })();
  12. /*!
  13. * devextreme-angular
  14. * Version: 19.1.16
  15. * Build date: Tue Oct 18 2022
  16. *
  17. * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED
  18. *
  19. * This software may be modified and distributed under the terms
  20. * of the MIT license. See the LICENSE file in the root of the project for details.
  21. *
  22. * https://github.com/DevExpress/devextreme-angular
  23. */
  24. Object.defineProperty(exports, "__esModule", { value: true });
  25. var platform_browser_1 = require("@angular/platform-browser");
  26. var platform_browser_2 = require("@angular/platform-browser");
  27. var core_1 = require("@angular/core");
  28. var slide_out_view_1 = require("devextreme/ui/slide_out_view");
  29. var component_1 = require("../core/component");
  30. var template_host_1 = require("../core/template-host");
  31. var integration_1 = require("../core/integration");
  32. var template_1 = require("../core/template");
  33. var nested_option_1 = require("../core/nested-option");
  34. var watcher_helper_1 = require("../core/watcher-helper");
  35. /**
  36. * The SlideOutView widget is a classic slide-out menu paired with a view. This widget is very similar to the SlideOut with only one difference - the SlideOut always contains the List in the slide-out menu, while the SlideOutView can hold any collection there.
  37. */
  38. var DxSlideOutViewComponent = (function (_super) {
  39. __extends(DxSlideOutViewComponent, _super);
  40. function DxSlideOutViewComponent(elementRef, ngZone, templateHost, _watcherHelper, optionHost, transferState, platformId) {
  41. var _this = _super.call(this, elementRef, ngZone, templateHost, _watcherHelper, transferState, platformId) || this;
  42. _this._createEventEmitters([
  43. { subscribe: 'disposing', emit: 'onDisposing' },
  44. { subscribe: 'initialized', emit: 'onInitialized' },
  45. { subscribe: 'optionChanged', emit: 'onOptionChanged' },
  46. { emit: 'activeStateEnabledChange' },
  47. { emit: 'contentTemplateChange' },
  48. { emit: 'disabledChange' },
  49. { emit: 'elementAttrChange' },
  50. { emit: 'heightChange' },
  51. { emit: 'hintChange' },
  52. { emit: 'hoverStateEnabledChange' },
  53. { emit: 'menuPositionChange' },
  54. { emit: 'menuTemplateChange' },
  55. { emit: 'menuVisibleChange' },
  56. { emit: 'rtlEnabledChange' },
  57. { emit: 'swipeEnabledChange' },
  58. { emit: 'visibleChange' },
  59. { emit: 'widthChange' }
  60. ]);
  61. optionHost.setHost(_this);
  62. return _this;
  63. }
  64. Object.defineProperty(DxSlideOutViewComponent.prototype, "activeStateEnabled", {
  65. get: /**
  66. * Specifies whether or not the widget changes its state when interacting with a user.
  67. */
  68. function () {
  69. return this._getOption('activeStateEnabled');
  70. },
  71. set: function (value) {
  72. this._setOption('activeStateEnabled', value);
  73. },
  74. enumerable: true,
  75. configurable: true
  76. });
  77. Object.defineProperty(DxSlideOutViewComponent.prototype, "contentTemplate", {
  78. get: /**
  79. * Specifies a custom template for the widget content.
  80. */
  81. function () {
  82. return this._getOption('contentTemplate');
  83. },
  84. set: function (value) {
  85. this._setOption('contentTemplate', value);
  86. },
  87. enumerable: true,
  88. configurable: true
  89. });
  90. Object.defineProperty(DxSlideOutViewComponent.prototype, "disabled", {
  91. get: /**
  92. * Specifies whether the widget responds to user interaction.
  93. */
  94. function () {
  95. return this._getOption('disabled');
  96. },
  97. set: function (value) {
  98. this._setOption('disabled', value);
  99. },
  100. enumerable: true,
  101. configurable: true
  102. });
  103. Object.defineProperty(DxSlideOutViewComponent.prototype, "elementAttr", {
  104. get: /**
  105. * Specifies the attributes to be attached to the widget's root element.
  106. */
  107. function () {
  108. return this._getOption('elementAttr');
  109. },
  110. set: function (value) {
  111. this._setOption('elementAttr', value);
  112. },
  113. enumerable: true,
  114. configurable: true
  115. });
  116. Object.defineProperty(DxSlideOutViewComponent.prototype, "height", {
  117. get: /**
  118. * Specifies the widget's height.
  119. */
  120. function () {
  121. return this._getOption('height');
  122. },
  123. set: function (value) {
  124. this._setOption('height', value);
  125. },
  126. enumerable: true,
  127. configurable: true
  128. });
  129. Object.defineProperty(DxSlideOutViewComponent.prototype, "hint", {
  130. get: /**
  131. * Specifies text for a hint that appears when a user pauses on the widget.
  132. */
  133. function () {
  134. return this._getOption('hint');
  135. },
  136. set: function (value) {
  137. this._setOption('hint', value);
  138. },
  139. enumerable: true,
  140. configurable: true
  141. });
  142. Object.defineProperty(DxSlideOutViewComponent.prototype, "hoverStateEnabled", {
  143. get: /**
  144. * Specifies whether the widget changes its state when a user pauses on it.
  145. */
  146. function () {
  147. return this._getOption('hoverStateEnabled');
  148. },
  149. set: function (value) {
  150. this._setOption('hoverStateEnabled', value);
  151. },
  152. enumerable: true,
  153. configurable: true
  154. });
  155. Object.defineProperty(DxSlideOutViewComponent.prototype, "menuPosition", {
  156. get: /**
  157. * Specifies the current menu position.
  158. */
  159. function () {
  160. return this._getOption('menuPosition');
  161. },
  162. set: function (value) {
  163. this._setOption('menuPosition', value);
  164. },
  165. enumerable: true,
  166. configurable: true
  167. });
  168. Object.defineProperty(DxSlideOutViewComponent.prototype, "menuTemplate", {
  169. get: /**
  170. * Specifies a custom template for the menu content.
  171. */
  172. function () {
  173. return this._getOption('menuTemplate');
  174. },
  175. set: function (value) {
  176. this._setOption('menuTemplate', value);
  177. },
  178. enumerable: true,
  179. configurable: true
  180. });
  181. Object.defineProperty(DxSlideOutViewComponent.prototype, "menuVisible", {
  182. get: /**
  183. * Specifies whether or not the menu panel is visible.
  184. */
  185. function () {
  186. return this._getOption('menuVisible');
  187. },
  188. set: function (value) {
  189. this._setOption('menuVisible', value);
  190. },
  191. enumerable: true,
  192. configurable: true
  193. });
  194. Object.defineProperty(DxSlideOutViewComponent.prototype, "rtlEnabled", {
  195. get: /**
  196. * Switches the widget to a right-to-left representation.
  197. */
  198. function () {
  199. return this._getOption('rtlEnabled');
  200. },
  201. set: function (value) {
  202. this._setOption('rtlEnabled', value);
  203. },
  204. enumerable: true,
  205. configurable: true
  206. });
  207. Object.defineProperty(DxSlideOutViewComponent.prototype, "swipeEnabled", {
  208. get: /**
  209. * Specifies whether or not the menu is shown when a user swipes the widget content.
  210. */
  211. function () {
  212. return this._getOption('swipeEnabled');
  213. },
  214. set: function (value) {
  215. this._setOption('swipeEnabled', value);
  216. },
  217. enumerable: true,
  218. configurable: true
  219. });
  220. Object.defineProperty(DxSlideOutViewComponent.prototype, "visible", {
  221. get: /**
  222. * Specifies whether the widget is visible.
  223. */
  224. function () {
  225. return this._getOption('visible');
  226. },
  227. set: function (value) {
  228. this._setOption('visible', value);
  229. },
  230. enumerable: true,
  231. configurable: true
  232. });
  233. Object.defineProperty(DxSlideOutViewComponent.prototype, "width", {
  234. get: /**
  235. * Specifies the widget's width.
  236. */
  237. function () {
  238. return this._getOption('width');
  239. },
  240. set: function (value) {
  241. this._setOption('width', value);
  242. },
  243. enumerable: true,
  244. configurable: true
  245. });
  246. DxSlideOutViewComponent.prototype._createInstance = function (element, options) {
  247. return new slide_out_view_1.default(element, options);
  248. };
  249. DxSlideOutViewComponent.prototype.ngOnDestroy = function () {
  250. this._destroyWidget();
  251. };
  252. DxSlideOutViewComponent.decorators = [
  253. { type: core_1.Component, args: [{
  254. selector: 'dx-slide-out-view',
  255. template: '<ng-content></ng-content>',
  256. providers: [
  257. template_host_1.DxTemplateHost,
  258. watcher_helper_1.WatcherHelper,
  259. nested_option_1.NestedOptionHost
  260. ]
  261. },] },
  262. ];
  263. /** @nocollapse */
  264. DxSlideOutViewComponent.ctorParameters = function () { return [
  265. { type: core_1.ElementRef, },
  266. { type: core_1.NgZone, },
  267. { type: template_host_1.DxTemplateHost, },
  268. { type: watcher_helper_1.WatcherHelper, },
  269. { type: nested_option_1.NestedOptionHost, },
  270. { type: platform_browser_2.TransferState, },
  271. { type: undefined, decorators: [{ type: core_1.Inject, args: [core_1.PLATFORM_ID,] },] },
  272. ]; };
  273. DxSlideOutViewComponent.propDecorators = {
  274. "activeStateEnabled": [{ type: core_1.Input },],
  275. "contentTemplate": [{ type: core_1.Input },],
  276. "disabled": [{ type: core_1.Input },],
  277. "elementAttr": [{ type: core_1.Input },],
  278. "height": [{ type: core_1.Input },],
  279. "hint": [{ type: core_1.Input },],
  280. "hoverStateEnabled": [{ type: core_1.Input },],
  281. "menuPosition": [{ type: core_1.Input },],
  282. "menuTemplate": [{ type: core_1.Input },],
  283. "menuVisible": [{ type: core_1.Input },],
  284. "rtlEnabled": [{ type: core_1.Input },],
  285. "swipeEnabled": [{ type: core_1.Input },],
  286. "visible": [{ type: core_1.Input },],
  287. "width": [{ type: core_1.Input },],
  288. "onDisposing": [{ type: core_1.Output },],
  289. "onInitialized": [{ type: core_1.Output },],
  290. "onOptionChanged": [{ type: core_1.Output },],
  291. "activeStateEnabledChange": [{ type: core_1.Output },],
  292. "contentTemplateChange": [{ type: core_1.Output },],
  293. "disabledChange": [{ type: core_1.Output },],
  294. "elementAttrChange": [{ type: core_1.Output },],
  295. "heightChange": [{ type: core_1.Output },],
  296. "hintChange": [{ type: core_1.Output },],
  297. "hoverStateEnabledChange": [{ type: core_1.Output },],
  298. "menuPositionChange": [{ type: core_1.Output },],
  299. "menuTemplateChange": [{ type: core_1.Output },],
  300. "menuVisibleChange": [{ type: core_1.Output },],
  301. "rtlEnabledChange": [{ type: core_1.Output },],
  302. "swipeEnabledChange": [{ type: core_1.Output },],
  303. "visibleChange": [{ type: core_1.Output },],
  304. "widthChange": [{ type: core_1.Output },],
  305. };
  306. return DxSlideOutViewComponent;
  307. }(component_1.DxComponent));
  308. exports.DxSlideOutViewComponent = DxSlideOutViewComponent;
  309. var DxSlideOutViewModule = (function () {
  310. function DxSlideOutViewModule() {
  311. }
  312. DxSlideOutViewModule.decorators = [
  313. { type: core_1.NgModule, args: [{
  314. imports: [
  315. integration_1.DxIntegrationModule,
  316. template_1.DxTemplateModule,
  317. platform_browser_1.BrowserTransferStateModule
  318. ],
  319. declarations: [
  320. DxSlideOutViewComponent
  321. ],
  322. exports: [
  323. DxSlideOutViewComponent,
  324. template_1.DxTemplateModule
  325. ]
  326. },] },
  327. ];
  328. return DxSlideOutViewModule;
  329. }());
  330. exports.DxSlideOutViewModule = DxSlideOutViewModule;
  331. //# sourceMappingURL=slide-out-view.js.map