scroll-view.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  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 scroll_view_1 = require("devextreme/ui/scroll_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 ScrollView is a widget that enables a user to scroll its content.
  37. */
  38. var DxScrollViewComponent = (function (_super) {
  39. __extends(DxScrollViewComponent, _super);
  40. function DxScrollViewComponent(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. { subscribe: 'pullDown', emit: 'onPullDown' },
  47. { subscribe: 'reachBottom', emit: 'onReachBottom' },
  48. { subscribe: 'scroll', emit: 'onScroll' },
  49. { subscribe: 'updated', emit: 'onUpdated' },
  50. { emit: 'bounceEnabledChange' },
  51. { emit: 'directionChange' },
  52. { emit: 'disabledChange' },
  53. { emit: 'elementAttrChange' },
  54. { emit: 'heightChange' },
  55. { emit: 'pulledDownTextChange' },
  56. { emit: 'pullingDownTextChange' },
  57. { emit: 'reachBottomTextChange' },
  58. { emit: 'refreshingTextChange' },
  59. { emit: 'rtlEnabledChange' },
  60. { emit: 'scrollByContentChange' },
  61. { emit: 'scrollByThumbChange' },
  62. { emit: 'showScrollbarChange' },
  63. { emit: 'useNativeChange' },
  64. { emit: 'widthChange' }
  65. ]);
  66. optionHost.setHost(_this);
  67. return _this;
  68. }
  69. Object.defineProperty(DxScrollViewComponent.prototype, "bounceEnabled", {
  70. get: /**
  71. * A Boolean value specifying whether to enable or disable the bounce-back effect.
  72. */
  73. function () {
  74. return this._getOption('bounceEnabled');
  75. },
  76. set: function (value) {
  77. this._setOption('bounceEnabled', value);
  78. },
  79. enumerable: true,
  80. configurable: true
  81. });
  82. Object.defineProperty(DxScrollViewComponent.prototype, "direction", {
  83. get: /**
  84. * A string value specifying the available scrolling directions.
  85. */
  86. function () {
  87. return this._getOption('direction');
  88. },
  89. set: function (value) {
  90. this._setOption('direction', value);
  91. },
  92. enumerable: true,
  93. configurable: true
  94. });
  95. Object.defineProperty(DxScrollViewComponent.prototype, "disabled", {
  96. get: /**
  97. * A Boolean value specifying whether or not the widget can respond to user interaction.
  98. */
  99. function () {
  100. return this._getOption('disabled');
  101. },
  102. set: function (value) {
  103. this._setOption('disabled', value);
  104. },
  105. enumerable: true,
  106. configurable: true
  107. });
  108. Object.defineProperty(DxScrollViewComponent.prototype, "elementAttr", {
  109. get: /**
  110. * Specifies the attributes to be attached to the widget's root element.
  111. */
  112. function () {
  113. return this._getOption('elementAttr');
  114. },
  115. set: function (value) {
  116. this._setOption('elementAttr', value);
  117. },
  118. enumerable: true,
  119. configurable: true
  120. });
  121. Object.defineProperty(DxScrollViewComponent.prototype, "height", {
  122. get: /**
  123. * Specifies the widget's height.
  124. */
  125. function () {
  126. return this._getOption('height');
  127. },
  128. set: function (value) {
  129. this._setOption('height', value);
  130. },
  131. enumerable: true,
  132. configurable: true
  133. });
  134. Object.defineProperty(DxScrollViewComponent.prototype, "pulledDownText", {
  135. get: /**
  136. * Specifies the text shown in the pullDown panel when pulling the content down lowers the refresh threshold.
  137. */
  138. function () {
  139. return this._getOption('pulledDownText');
  140. },
  141. set: function (value) {
  142. this._setOption('pulledDownText', value);
  143. },
  144. enumerable: true,
  145. configurable: true
  146. });
  147. Object.defineProperty(DxScrollViewComponent.prototype, "pullingDownText", {
  148. get: /**
  149. * Specifies the text shown in the pullDown panel while pulling the content down to the refresh threshold.
  150. */
  151. function () {
  152. return this._getOption('pullingDownText');
  153. },
  154. set: function (value) {
  155. this._setOption('pullingDownText', value);
  156. },
  157. enumerable: true,
  158. configurable: true
  159. });
  160. Object.defineProperty(DxScrollViewComponent.prototype, "reachBottomText", {
  161. get: /**
  162. * Specifies the text shown in the pullDown panel displayed when content is scrolled to the bottom.
  163. */
  164. function () {
  165. return this._getOption('reachBottomText');
  166. },
  167. set: function (value) {
  168. this._setOption('reachBottomText', value);
  169. },
  170. enumerable: true,
  171. configurable: true
  172. });
  173. Object.defineProperty(DxScrollViewComponent.prototype, "refreshingText", {
  174. get: /**
  175. * Specifies the text shown in the pullDown panel displayed when the content is being refreshed.
  176. */
  177. function () {
  178. return this._getOption('refreshingText');
  179. },
  180. set: function (value) {
  181. this._setOption('refreshingText', value);
  182. },
  183. enumerable: true,
  184. configurable: true
  185. });
  186. Object.defineProperty(DxScrollViewComponent.prototype, "rtlEnabled", {
  187. get: /**
  188. * Switches the widget to a right-to-left representation.
  189. */
  190. function () {
  191. return this._getOption('rtlEnabled');
  192. },
  193. set: function (value) {
  194. this._setOption('rtlEnabled', value);
  195. },
  196. enumerable: true,
  197. configurable: true
  198. });
  199. Object.defineProperty(DxScrollViewComponent.prototype, "scrollByContent", {
  200. get: /**
  201. * A Boolean value specifying whether or not an end-user can scroll the widget content swiping it up or down. Applies only if useNative is false
  202. */
  203. function () {
  204. return this._getOption('scrollByContent');
  205. },
  206. set: function (value) {
  207. this._setOption('scrollByContent', value);
  208. },
  209. enumerable: true,
  210. configurable: true
  211. });
  212. Object.defineProperty(DxScrollViewComponent.prototype, "scrollByThumb", {
  213. get: /**
  214. * A Boolean value specifying whether or not an end-user can scroll the widget content using the scrollbar.
  215. */
  216. function () {
  217. return this._getOption('scrollByThumb');
  218. },
  219. set: function (value) {
  220. this._setOption('scrollByThumb', value);
  221. },
  222. enumerable: true,
  223. configurable: true
  224. });
  225. Object.defineProperty(DxScrollViewComponent.prototype, "showScrollbar", {
  226. get: /**
  227. * Specifies when the widget shows the scrollbar.
  228. */
  229. function () {
  230. return this._getOption('showScrollbar');
  231. },
  232. set: function (value) {
  233. this._setOption('showScrollbar', value);
  234. },
  235. enumerable: true,
  236. configurable: true
  237. });
  238. Object.defineProperty(DxScrollViewComponent.prototype, "useNative", {
  239. get: /**
  240. * Indicates whether to use native or simulated scrolling.
  241. */
  242. function () {
  243. return this._getOption('useNative');
  244. },
  245. set: function (value) {
  246. this._setOption('useNative', value);
  247. },
  248. enumerable: true,
  249. configurable: true
  250. });
  251. Object.defineProperty(DxScrollViewComponent.prototype, "width", {
  252. get: /**
  253. * Specifies the widget's width.
  254. */
  255. function () {
  256. return this._getOption('width');
  257. },
  258. set: function (value) {
  259. this._setOption('width', value);
  260. },
  261. enumerable: true,
  262. configurable: true
  263. });
  264. DxScrollViewComponent.prototype._createInstance = function (element, options) {
  265. return new scroll_view_1.default(element, options);
  266. };
  267. DxScrollViewComponent.prototype.ngOnDestroy = function () {
  268. this._destroyWidget();
  269. };
  270. DxScrollViewComponent.decorators = [
  271. { type: core_1.Component, args: [{
  272. selector: 'dx-scroll-view',
  273. template: '<ng-content></ng-content>',
  274. providers: [
  275. template_host_1.DxTemplateHost,
  276. watcher_helper_1.WatcherHelper,
  277. nested_option_1.NestedOptionHost
  278. ]
  279. },] },
  280. ];
  281. /** @nocollapse */
  282. DxScrollViewComponent.ctorParameters = function () { return [
  283. { type: core_1.ElementRef, },
  284. { type: core_1.NgZone, },
  285. { type: template_host_1.DxTemplateHost, },
  286. { type: watcher_helper_1.WatcherHelper, },
  287. { type: nested_option_1.NestedOptionHost, },
  288. { type: platform_browser_2.TransferState, },
  289. { type: undefined, decorators: [{ type: core_1.Inject, args: [core_1.PLATFORM_ID,] },] },
  290. ]; };
  291. DxScrollViewComponent.propDecorators = {
  292. "bounceEnabled": [{ type: core_1.Input },],
  293. "direction": [{ type: core_1.Input },],
  294. "disabled": [{ type: core_1.Input },],
  295. "elementAttr": [{ type: core_1.Input },],
  296. "height": [{ type: core_1.Input },],
  297. "pulledDownText": [{ type: core_1.Input },],
  298. "pullingDownText": [{ type: core_1.Input },],
  299. "reachBottomText": [{ type: core_1.Input },],
  300. "refreshingText": [{ type: core_1.Input },],
  301. "rtlEnabled": [{ type: core_1.Input },],
  302. "scrollByContent": [{ type: core_1.Input },],
  303. "scrollByThumb": [{ type: core_1.Input },],
  304. "showScrollbar": [{ type: core_1.Input },],
  305. "useNative": [{ type: core_1.Input },],
  306. "width": [{ type: core_1.Input },],
  307. "onDisposing": [{ type: core_1.Output },],
  308. "onInitialized": [{ type: core_1.Output },],
  309. "onOptionChanged": [{ type: core_1.Output },],
  310. "onPullDown": [{ type: core_1.Output },],
  311. "onReachBottom": [{ type: core_1.Output },],
  312. "onScroll": [{ type: core_1.Output },],
  313. "onUpdated": [{ type: core_1.Output },],
  314. "bounceEnabledChange": [{ type: core_1.Output },],
  315. "directionChange": [{ type: core_1.Output },],
  316. "disabledChange": [{ type: core_1.Output },],
  317. "elementAttrChange": [{ type: core_1.Output },],
  318. "heightChange": [{ type: core_1.Output },],
  319. "pulledDownTextChange": [{ type: core_1.Output },],
  320. "pullingDownTextChange": [{ type: core_1.Output },],
  321. "reachBottomTextChange": [{ type: core_1.Output },],
  322. "refreshingTextChange": [{ type: core_1.Output },],
  323. "rtlEnabledChange": [{ type: core_1.Output },],
  324. "scrollByContentChange": [{ type: core_1.Output },],
  325. "scrollByThumbChange": [{ type: core_1.Output },],
  326. "showScrollbarChange": [{ type: core_1.Output },],
  327. "useNativeChange": [{ type: core_1.Output },],
  328. "widthChange": [{ type: core_1.Output },],
  329. };
  330. return DxScrollViewComponent;
  331. }(component_1.DxComponent));
  332. exports.DxScrollViewComponent = DxScrollViewComponent;
  333. var DxScrollViewModule = (function () {
  334. function DxScrollViewModule() {
  335. }
  336. DxScrollViewModule.decorators = [
  337. { type: core_1.NgModule, args: [{
  338. imports: [
  339. integration_1.DxIntegrationModule,
  340. template_1.DxTemplateModule,
  341. platform_browser_1.BrowserTransferStateModule
  342. ],
  343. declarations: [
  344. DxScrollViewComponent
  345. ],
  346. exports: [
  347. DxScrollViewComponent,
  348. template_1.DxTemplateModule
  349. ]
  350. },] },
  351. ];
  352. return DxScrollViewModule;
  353. }());
  354. exports.DxScrollViewModule = DxScrollViewModule;
  355. //# sourceMappingURL=scroll-view.js.map