resizable.js 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  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 resizable_1 = require("devextreme/ui/resizable");
  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 Resizable widget enables its content to be resizable in the UI.
  37. */
  38. var DxResizableComponent = (function (_super) {
  39. __extends(DxResizableComponent, _super);
  40. function DxResizableComponent(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: 'resize', emit: 'onResize' },
  47. { subscribe: 'resizeEnd', emit: 'onResizeEnd' },
  48. { subscribe: 'resizeStart', emit: 'onResizeStart' },
  49. { emit: 'elementAttrChange' },
  50. { emit: 'handlesChange' },
  51. { emit: 'heightChange' },
  52. { emit: 'maxHeightChange' },
  53. { emit: 'maxWidthChange' },
  54. { emit: 'minHeightChange' },
  55. { emit: 'minWidthChange' },
  56. { emit: 'rtlEnabledChange' },
  57. { emit: 'widthChange' }
  58. ]);
  59. optionHost.setHost(_this);
  60. return _this;
  61. }
  62. Object.defineProperty(DxResizableComponent.prototype, "elementAttr", {
  63. get: /**
  64. * Specifies the attributes to be attached to the widget's root element.
  65. */
  66. function () {
  67. return this._getOption('elementAttr');
  68. },
  69. set: function (value) {
  70. this._setOption('elementAttr', value);
  71. },
  72. enumerable: true,
  73. configurable: true
  74. });
  75. Object.defineProperty(DxResizableComponent.prototype, "handles", {
  76. get: /**
  77. * Specifies which borders of the widget element are used as a handle.
  78. */
  79. function () {
  80. return this._getOption('handles');
  81. },
  82. set: function (value) {
  83. this._setOption('handles', value);
  84. },
  85. enumerable: true,
  86. configurable: true
  87. });
  88. Object.defineProperty(DxResizableComponent.prototype, "height", {
  89. get: /**
  90. * Specifies the widget's height.
  91. */
  92. function () {
  93. return this._getOption('height');
  94. },
  95. set: function (value) {
  96. this._setOption('height', value);
  97. },
  98. enumerable: true,
  99. configurable: true
  100. });
  101. Object.defineProperty(DxResizableComponent.prototype, "maxHeight", {
  102. get: /**
  103. * Specifies the upper height boundary for resizing.
  104. */
  105. function () {
  106. return this._getOption('maxHeight');
  107. },
  108. set: function (value) {
  109. this._setOption('maxHeight', value);
  110. },
  111. enumerable: true,
  112. configurable: true
  113. });
  114. Object.defineProperty(DxResizableComponent.prototype, "maxWidth", {
  115. get: /**
  116. * Specifies the upper width boundary for resizing.
  117. */
  118. function () {
  119. return this._getOption('maxWidth');
  120. },
  121. set: function (value) {
  122. this._setOption('maxWidth', value);
  123. },
  124. enumerable: true,
  125. configurable: true
  126. });
  127. Object.defineProperty(DxResizableComponent.prototype, "minHeight", {
  128. get: /**
  129. * Specifies the lower height boundary for resizing.
  130. */
  131. function () {
  132. return this._getOption('minHeight');
  133. },
  134. set: function (value) {
  135. this._setOption('minHeight', value);
  136. },
  137. enumerable: true,
  138. configurable: true
  139. });
  140. Object.defineProperty(DxResizableComponent.prototype, "minWidth", {
  141. get: /**
  142. * Specifies the lower width boundary for resizing.
  143. */
  144. function () {
  145. return this._getOption('minWidth');
  146. },
  147. set: function (value) {
  148. this._setOption('minWidth', value);
  149. },
  150. enumerable: true,
  151. configurable: true
  152. });
  153. Object.defineProperty(DxResizableComponent.prototype, "rtlEnabled", {
  154. get: /**
  155. * Switches the widget to a right-to-left representation.
  156. */
  157. function () {
  158. return this._getOption('rtlEnabled');
  159. },
  160. set: function (value) {
  161. this._setOption('rtlEnabled', value);
  162. },
  163. enumerable: true,
  164. configurable: true
  165. });
  166. Object.defineProperty(DxResizableComponent.prototype, "width", {
  167. get: /**
  168. * Specifies the widget's width.
  169. */
  170. function () {
  171. return this._getOption('width');
  172. },
  173. set: function (value) {
  174. this._setOption('width', value);
  175. },
  176. enumerable: true,
  177. configurable: true
  178. });
  179. DxResizableComponent.prototype._createInstance = function (element, options) {
  180. return new resizable_1.default(element, options);
  181. };
  182. DxResizableComponent.prototype.ngOnDestroy = function () {
  183. this._destroyWidget();
  184. };
  185. DxResizableComponent.decorators = [
  186. { type: core_1.Component, args: [{
  187. selector: 'dx-resizable',
  188. template: '<ng-content></ng-content>',
  189. providers: [
  190. template_host_1.DxTemplateHost,
  191. watcher_helper_1.WatcherHelper,
  192. nested_option_1.NestedOptionHost
  193. ]
  194. },] },
  195. ];
  196. /** @nocollapse */
  197. DxResizableComponent.ctorParameters = function () { return [
  198. { type: core_1.ElementRef, },
  199. { type: core_1.NgZone, },
  200. { type: template_host_1.DxTemplateHost, },
  201. { type: watcher_helper_1.WatcherHelper, },
  202. { type: nested_option_1.NestedOptionHost, },
  203. { type: platform_browser_2.TransferState, },
  204. { type: undefined, decorators: [{ type: core_1.Inject, args: [core_1.PLATFORM_ID,] },] },
  205. ]; };
  206. DxResizableComponent.propDecorators = {
  207. "elementAttr": [{ type: core_1.Input },],
  208. "handles": [{ type: core_1.Input },],
  209. "height": [{ type: core_1.Input },],
  210. "maxHeight": [{ type: core_1.Input },],
  211. "maxWidth": [{ type: core_1.Input },],
  212. "minHeight": [{ type: core_1.Input },],
  213. "minWidth": [{ type: core_1.Input },],
  214. "rtlEnabled": [{ type: core_1.Input },],
  215. "width": [{ type: core_1.Input },],
  216. "onDisposing": [{ type: core_1.Output },],
  217. "onInitialized": [{ type: core_1.Output },],
  218. "onOptionChanged": [{ type: core_1.Output },],
  219. "onResize": [{ type: core_1.Output },],
  220. "onResizeEnd": [{ type: core_1.Output },],
  221. "onResizeStart": [{ type: core_1.Output },],
  222. "elementAttrChange": [{ type: core_1.Output },],
  223. "handlesChange": [{ type: core_1.Output },],
  224. "heightChange": [{ type: core_1.Output },],
  225. "maxHeightChange": [{ type: core_1.Output },],
  226. "maxWidthChange": [{ type: core_1.Output },],
  227. "minHeightChange": [{ type: core_1.Output },],
  228. "minWidthChange": [{ type: core_1.Output },],
  229. "rtlEnabledChange": [{ type: core_1.Output },],
  230. "widthChange": [{ type: core_1.Output },],
  231. };
  232. return DxResizableComponent;
  233. }(component_1.DxComponent));
  234. exports.DxResizableComponent = DxResizableComponent;
  235. var DxResizableModule = (function () {
  236. function DxResizableModule() {
  237. }
  238. DxResizableModule.decorators = [
  239. { type: core_1.NgModule, args: [{
  240. imports: [
  241. integration_1.DxIntegrationModule,
  242. template_1.DxTemplateModule,
  243. platform_browser_1.BrowserTransferStateModule
  244. ],
  245. declarations: [
  246. DxResizableComponent
  247. ],
  248. exports: [
  249. DxResizableComponent,
  250. template_1.DxTemplateModule
  251. ]
  252. },] },
  253. ];
  254. return DxResizableModule;
  255. }());
  256. exports.DxResizableModule = DxResizableModule;
  257. //# sourceMappingURL=resizable.js.map