recurrence-editor.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  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 recurrence_editor_1 = require("devextreme/ui/recurrence_editor");
  29. var forms_1 = require("@angular/forms");
  30. var component_1 = require("../core/component");
  31. var template_host_1 = require("../core/template-host");
  32. var integration_1 = require("../core/integration");
  33. var template_1 = require("../core/template");
  34. var nested_option_1 = require("../core/nested-option");
  35. var watcher_helper_1 = require("../core/watcher-helper");
  36. var CUSTOM_VALUE_ACCESSOR_PROVIDER = {
  37. provide: forms_1.NG_VALUE_ACCESSOR,
  38. useExisting: core_1.forwardRef(function () { return DxRecurrenceEditorComponent; }),
  39. multi: true
  40. };
  41. /**
  42. * A base class for editors.
  43. */
  44. var DxRecurrenceEditorComponent = (function (_super) {
  45. __extends(DxRecurrenceEditorComponent, _super);
  46. function DxRecurrenceEditorComponent(elementRef, ngZone, templateHost, _watcherHelper, optionHost, transferState, platformId) {
  47. var _this = _super.call(this, elementRef, ngZone, templateHost, _watcherHelper, transferState, platformId) || this;
  48. _this.touched = function (_) { };
  49. _this._createEventEmitters([
  50. { subscribe: 'contentReady', emit: 'onContentReady' },
  51. { subscribe: 'disposing', emit: 'onDisposing' },
  52. { subscribe: 'initialized', emit: 'onInitialized' },
  53. { subscribe: 'optionChanged', emit: 'onOptionChanged' },
  54. { subscribe: 'valueChanged', emit: 'onValueChanged' },
  55. { emit: 'accessKeyChange' },
  56. { emit: 'activeStateEnabledChange' },
  57. { emit: 'disabledChange' },
  58. { emit: 'elementAttrChange' },
  59. { emit: 'focusStateEnabledChange' },
  60. { emit: 'heightChange' },
  61. { emit: 'hintChange' },
  62. { emit: 'hoverStateEnabledChange' },
  63. { emit: 'isValidChange' },
  64. { emit: 'readOnlyChange' },
  65. { emit: 'rtlEnabledChange' },
  66. { emit: 'tabIndexChange' },
  67. { emit: 'validationErrorChange' },
  68. { emit: 'validationMessageModeChange' },
  69. { emit: 'valueChange' },
  70. { emit: 'visibleChange' },
  71. { emit: 'widthChange' },
  72. { emit: 'onBlur' }
  73. ]);
  74. optionHost.setHost(_this);
  75. return _this;
  76. }
  77. Object.defineProperty(DxRecurrenceEditorComponent.prototype, "accessKey", {
  78. get: /**
  79. * Specifies the shortcut key that sets focus on the widget.
  80. */
  81. function () {
  82. return this._getOption('accessKey');
  83. },
  84. set: function (value) {
  85. this._setOption('accessKey', value);
  86. },
  87. enumerable: true,
  88. configurable: true
  89. });
  90. Object.defineProperty(DxRecurrenceEditorComponent.prototype, "activeStateEnabled", {
  91. get: /**
  92. * Specifies whether or not the widget changes its state when interacting with a user.
  93. */
  94. function () {
  95. return this._getOption('activeStateEnabled');
  96. },
  97. set: function (value) {
  98. this._setOption('activeStateEnabled', value);
  99. },
  100. enumerable: true,
  101. configurable: true
  102. });
  103. Object.defineProperty(DxRecurrenceEditorComponent.prototype, "disabled", {
  104. get: /**
  105. * Specifies whether the widget responds to user interaction.
  106. */
  107. function () {
  108. return this._getOption('disabled');
  109. },
  110. set: function (value) {
  111. this._setOption('disabled', value);
  112. },
  113. enumerable: true,
  114. configurable: true
  115. });
  116. Object.defineProperty(DxRecurrenceEditorComponent.prototype, "elementAttr", {
  117. get: /**
  118. * Specifies the attributes to be attached to the widget's root element.
  119. */
  120. function () {
  121. return this._getOption('elementAttr');
  122. },
  123. set: function (value) {
  124. this._setOption('elementAttr', value);
  125. },
  126. enumerable: true,
  127. configurable: true
  128. });
  129. Object.defineProperty(DxRecurrenceEditorComponent.prototype, "focusStateEnabled", {
  130. get: /**
  131. * Specifies whether the widget can be focused using keyboard navigation.
  132. */
  133. function () {
  134. return this._getOption('focusStateEnabled');
  135. },
  136. set: function (value) {
  137. this._setOption('focusStateEnabled', value);
  138. },
  139. enumerable: true,
  140. configurable: true
  141. });
  142. Object.defineProperty(DxRecurrenceEditorComponent.prototype, "height", {
  143. get: /**
  144. * Specifies the widget's height.
  145. */
  146. function () {
  147. return this._getOption('height');
  148. },
  149. set: function (value) {
  150. this._setOption('height', value);
  151. },
  152. enumerable: true,
  153. configurable: true
  154. });
  155. Object.defineProperty(DxRecurrenceEditorComponent.prototype, "hint", {
  156. get: /**
  157. * Specifies text for a hint that appears when a user pauses on the widget.
  158. */
  159. function () {
  160. return this._getOption('hint');
  161. },
  162. set: function (value) {
  163. this._setOption('hint', value);
  164. },
  165. enumerable: true,
  166. configurable: true
  167. });
  168. Object.defineProperty(DxRecurrenceEditorComponent.prototype, "hoverStateEnabled", {
  169. get: /**
  170. * Specifies whether the widget changes its state when a user pauses on it.
  171. */
  172. function () {
  173. return this._getOption('hoverStateEnabled');
  174. },
  175. set: function (value) {
  176. this._setOption('hoverStateEnabled', value);
  177. },
  178. enumerable: true,
  179. configurable: true
  180. });
  181. Object.defineProperty(DxRecurrenceEditorComponent.prototype, "isValid", {
  182. get: /**
  183. * Specifies whether the editor's value is valid.
  184. */
  185. function () {
  186. return this._getOption('isValid');
  187. },
  188. set: function (value) {
  189. this._setOption('isValid', value);
  190. },
  191. enumerable: true,
  192. configurable: true
  193. });
  194. Object.defineProperty(DxRecurrenceEditorComponent.prototype, "readOnly", {
  195. get: /**
  196. * Specifies whether the editor is read-only.
  197. */
  198. function () {
  199. return this._getOption('readOnly');
  200. },
  201. set: function (value) {
  202. this._setOption('readOnly', value);
  203. },
  204. enumerable: true,
  205. configurable: true
  206. });
  207. Object.defineProperty(DxRecurrenceEditorComponent.prototype, "rtlEnabled", {
  208. get: /**
  209. * Switches the widget to a right-to-left representation.
  210. */
  211. function () {
  212. return this._getOption('rtlEnabled');
  213. },
  214. set: function (value) {
  215. this._setOption('rtlEnabled', value);
  216. },
  217. enumerable: true,
  218. configurable: true
  219. });
  220. Object.defineProperty(DxRecurrenceEditorComponent.prototype, "tabIndex", {
  221. get: /**
  222. * Specifies the number of the element when the Tab key is used for navigating.
  223. */
  224. function () {
  225. return this._getOption('tabIndex');
  226. },
  227. set: function (value) {
  228. this._setOption('tabIndex', value);
  229. },
  230. enumerable: true,
  231. configurable: true
  232. });
  233. Object.defineProperty(DxRecurrenceEditorComponent.prototype, "validationError", {
  234. get: /**
  235. * Specifies information on the validation error when using a custom validation engine. Should be changed at runtime along with the isValid option.
  236. */
  237. function () {
  238. return this._getOption('validationError');
  239. },
  240. set: function (value) {
  241. this._setOption('validationError', value);
  242. },
  243. enumerable: true,
  244. configurable: true
  245. });
  246. Object.defineProperty(DxRecurrenceEditorComponent.prototype, "validationMessageMode", {
  247. get: /**
  248. * Specifies how the message about the validation rules that are not satisfied by this editor's value is displayed.
  249. */
  250. function () {
  251. return this._getOption('validationMessageMode');
  252. },
  253. set: function (value) {
  254. this._setOption('validationMessageMode', value);
  255. },
  256. enumerable: true,
  257. configurable: true
  258. });
  259. Object.defineProperty(DxRecurrenceEditorComponent.prototype, "value", {
  260. get: /**
  261. * Specifies the widget's value.
  262. */
  263. function () {
  264. return this._getOption('value');
  265. },
  266. set: function (value) {
  267. this._setOption('value', value);
  268. },
  269. enumerable: true,
  270. configurable: true
  271. });
  272. Object.defineProperty(DxRecurrenceEditorComponent.prototype, "visible", {
  273. get: /**
  274. * Specifies whether the widget is visible.
  275. */
  276. function () {
  277. return this._getOption('visible');
  278. },
  279. set: function (value) {
  280. this._setOption('visible', value);
  281. },
  282. enumerable: true,
  283. configurable: true
  284. });
  285. Object.defineProperty(DxRecurrenceEditorComponent.prototype, "width", {
  286. get: /**
  287. * Specifies the widget's width.
  288. */
  289. function () {
  290. return this._getOption('width');
  291. },
  292. set: function (value) {
  293. this._setOption('width', value);
  294. },
  295. enumerable: true,
  296. configurable: true
  297. });
  298. DxRecurrenceEditorComponent.prototype.change = function (_) { };
  299. DxRecurrenceEditorComponent.prototype._createInstance = function (element, options) {
  300. return new recurrence_editor_1.default(element, options);
  301. };
  302. DxRecurrenceEditorComponent.prototype.writeValue = function (value) {
  303. this.eventHelper.lockedValueChangeEvent = true;
  304. this.value = value;
  305. this.eventHelper.lockedValueChangeEvent = false;
  306. };
  307. DxRecurrenceEditorComponent.prototype.setDisabledState = function (isDisabled) {
  308. this.disabled = isDisabled;
  309. };
  310. DxRecurrenceEditorComponent.prototype.registerOnChange = function (fn) { this.change = fn; };
  311. DxRecurrenceEditorComponent.prototype.registerOnTouched = function (fn) { this.touched = fn; };
  312. DxRecurrenceEditorComponent.prototype._createWidget = function (element) {
  313. var _this = this;
  314. _super.prototype._createWidget.call(this, element);
  315. this.instance.on('focusOut', function (e) {
  316. _this.eventHelper.fireNgEvent('onBlur', [e]);
  317. });
  318. };
  319. DxRecurrenceEditorComponent.prototype.ngOnDestroy = function () {
  320. this._destroyWidget();
  321. };
  322. DxRecurrenceEditorComponent.decorators = [
  323. { type: core_1.Component, args: [{
  324. selector: 'dx-recurrence-editor',
  325. template: '',
  326. providers: [
  327. template_host_1.DxTemplateHost,
  328. watcher_helper_1.WatcherHelper,
  329. CUSTOM_VALUE_ACCESSOR_PROVIDER,
  330. nested_option_1.NestedOptionHost
  331. ]
  332. },] },
  333. ];
  334. /** @nocollapse */
  335. DxRecurrenceEditorComponent.ctorParameters = function () { return [
  336. { type: core_1.ElementRef, },
  337. { type: core_1.NgZone, },
  338. { type: template_host_1.DxTemplateHost, },
  339. { type: watcher_helper_1.WatcherHelper, },
  340. { type: nested_option_1.NestedOptionHost, },
  341. { type: platform_browser_2.TransferState, },
  342. { type: undefined, decorators: [{ type: core_1.Inject, args: [core_1.PLATFORM_ID,] },] },
  343. ]; };
  344. DxRecurrenceEditorComponent.propDecorators = {
  345. "accessKey": [{ type: core_1.Input },],
  346. "activeStateEnabled": [{ type: core_1.Input },],
  347. "disabled": [{ type: core_1.Input },],
  348. "elementAttr": [{ type: core_1.Input },],
  349. "focusStateEnabled": [{ type: core_1.Input },],
  350. "height": [{ type: core_1.Input },],
  351. "hint": [{ type: core_1.Input },],
  352. "hoverStateEnabled": [{ type: core_1.Input },],
  353. "isValid": [{ type: core_1.Input },],
  354. "readOnly": [{ type: core_1.Input },],
  355. "rtlEnabled": [{ type: core_1.Input },],
  356. "tabIndex": [{ type: core_1.Input },],
  357. "validationError": [{ type: core_1.Input },],
  358. "validationMessageMode": [{ type: core_1.Input },],
  359. "value": [{ type: core_1.Input },],
  360. "visible": [{ type: core_1.Input },],
  361. "width": [{ type: core_1.Input },],
  362. "onContentReady": [{ type: core_1.Output },],
  363. "onDisposing": [{ type: core_1.Output },],
  364. "onInitialized": [{ type: core_1.Output },],
  365. "onOptionChanged": [{ type: core_1.Output },],
  366. "onValueChanged": [{ type: core_1.Output },],
  367. "accessKeyChange": [{ type: core_1.Output },],
  368. "activeStateEnabledChange": [{ type: core_1.Output },],
  369. "disabledChange": [{ type: core_1.Output },],
  370. "elementAttrChange": [{ type: core_1.Output },],
  371. "focusStateEnabledChange": [{ type: core_1.Output },],
  372. "heightChange": [{ type: core_1.Output },],
  373. "hintChange": [{ type: core_1.Output },],
  374. "hoverStateEnabledChange": [{ type: core_1.Output },],
  375. "isValidChange": [{ type: core_1.Output },],
  376. "readOnlyChange": [{ type: core_1.Output },],
  377. "rtlEnabledChange": [{ type: core_1.Output },],
  378. "tabIndexChange": [{ type: core_1.Output },],
  379. "validationErrorChange": [{ type: core_1.Output },],
  380. "validationMessageModeChange": [{ type: core_1.Output },],
  381. "valueChange": [{ type: core_1.Output },],
  382. "visibleChange": [{ type: core_1.Output },],
  383. "widthChange": [{ type: core_1.Output },],
  384. "onBlur": [{ type: core_1.Output },],
  385. "change": [{ type: core_1.HostListener, args: ['valueChange', ['$event'],] },],
  386. "touched": [{ type: core_1.HostListener, args: ['onBlur', ['$event'],] },],
  387. };
  388. return DxRecurrenceEditorComponent;
  389. }(component_1.DxComponent));
  390. exports.DxRecurrenceEditorComponent = DxRecurrenceEditorComponent;
  391. var DxRecurrenceEditorModule = (function () {
  392. function DxRecurrenceEditorModule() {
  393. }
  394. DxRecurrenceEditorModule.decorators = [
  395. { type: core_1.NgModule, args: [{
  396. imports: [
  397. integration_1.DxIntegrationModule,
  398. template_1.DxTemplateModule,
  399. platform_browser_1.BrowserTransferStateModule
  400. ],
  401. declarations: [
  402. DxRecurrenceEditorComponent
  403. ],
  404. exports: [
  405. DxRecurrenceEditorComponent,
  406. template_1.DxTemplateModule
  407. ]
  408. },] },
  409. ];
  410. return DxRecurrenceEditorModule;
  411. }());
  412. exports.DxRecurrenceEditorModule = DxRecurrenceEditorModule;
  413. //# sourceMappingURL=recurrence-editor.js.map