file-uploader.js 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805
  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 file_uploader_1 = require("devextreme/ui/file_uploader");
  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 iterable_differ_helper_1 = require("../core/iterable-differ-helper");
  37. var CUSTOM_VALUE_ACCESSOR_PROVIDER = {
  38. provide: forms_1.NG_VALUE_ACCESSOR,
  39. useExisting: core_1.forwardRef(function () { return DxFileUploaderComponent; }),
  40. multi: true
  41. };
  42. /**
  43. * The FileUploader widget enables an end user to upload files to the server. An end user can select files in the file explorer or drag and drop files to the FileUploader area on the page.
  44. */
  45. var DxFileUploaderComponent = (function (_super) {
  46. __extends(DxFileUploaderComponent, _super);
  47. function DxFileUploaderComponent(elementRef, ngZone, templateHost, _watcherHelper, _idh, optionHost, transferState, platformId) {
  48. var _this = _super.call(this, elementRef, ngZone, templateHost, _watcherHelper, transferState, platformId) || this;
  49. _this._watcherHelper = _watcherHelper;
  50. _this._idh = _idh;
  51. _this.touched = function (_) { };
  52. _this._createEventEmitters([
  53. { subscribe: 'contentReady', emit: 'onContentReady' },
  54. { subscribe: 'disposing', emit: 'onDisposing' },
  55. { subscribe: 'initialized', emit: 'onInitialized' },
  56. { subscribe: 'optionChanged', emit: 'onOptionChanged' },
  57. { subscribe: 'progress', emit: 'onProgress' },
  58. { subscribe: 'uploadAborted', emit: 'onUploadAborted' },
  59. { subscribe: 'uploaded', emit: 'onUploaded' },
  60. { subscribe: 'uploadError', emit: 'onUploadError' },
  61. { subscribe: 'uploadStarted', emit: 'onUploadStarted' },
  62. { subscribe: 'valueChanged', emit: 'onValueChanged' },
  63. { emit: 'acceptChange' },
  64. { emit: 'accessKeyChange' },
  65. { emit: 'activeStateEnabledChange' },
  66. { emit: 'allowCancelingChange' },
  67. { emit: 'allowedFileExtensionsChange' },
  68. { emit: 'chunkSizeChange' },
  69. { emit: 'disabledChange' },
  70. { emit: 'elementAttrChange' },
  71. { emit: 'focusStateEnabledChange' },
  72. { emit: 'heightChange' },
  73. { emit: 'hintChange' },
  74. { emit: 'hoverStateEnabledChange' },
  75. { emit: 'invalidFileExtensionMessageChange' },
  76. { emit: 'invalidMaxFileSizeMessageChange' },
  77. { emit: 'invalidMinFileSizeMessageChange' },
  78. { emit: 'isValidChange' },
  79. { emit: 'labelTextChange' },
  80. { emit: 'maxFileSizeChange' },
  81. { emit: 'minFileSizeChange' },
  82. { emit: 'multipleChange' },
  83. { emit: 'nameChange' },
  84. { emit: 'progressChange' },
  85. { emit: 'readOnlyChange' },
  86. { emit: 'readyToUploadMessageChange' },
  87. { emit: 'rtlEnabledChange' },
  88. { emit: 'selectButtonTextChange' },
  89. { emit: 'showFileListChange' },
  90. { emit: 'tabIndexChange' },
  91. { emit: 'uploadButtonTextChange' },
  92. { emit: 'uploadedMessageChange' },
  93. { emit: 'uploadFailedMessageChange' },
  94. { emit: 'uploadHeadersChange' },
  95. { emit: 'uploadMethodChange' },
  96. { emit: 'uploadModeChange' },
  97. { emit: 'uploadUrlChange' },
  98. { emit: 'validationErrorChange' },
  99. { emit: 'valueChange' },
  100. { emit: 'visibleChange' },
  101. { emit: 'widthChange' },
  102. { emit: 'onBlur' }
  103. ]);
  104. _this._idh.setHost(_this);
  105. optionHost.setHost(_this);
  106. return _this;
  107. }
  108. Object.defineProperty(DxFileUploaderComponent.prototype, "accept", {
  109. get: /**
  110. * Specifies a file type or several types accepted by the widget.
  111. */
  112. function () {
  113. return this._getOption('accept');
  114. },
  115. set: function (value) {
  116. this._setOption('accept', value);
  117. },
  118. enumerable: true,
  119. configurable: true
  120. });
  121. Object.defineProperty(DxFileUploaderComponent.prototype, "accessKey", {
  122. get: /**
  123. * Specifies the shortcut key that sets focus on the widget.
  124. */
  125. function () {
  126. return this._getOption('accessKey');
  127. },
  128. set: function (value) {
  129. this._setOption('accessKey', value);
  130. },
  131. enumerable: true,
  132. configurable: true
  133. });
  134. Object.defineProperty(DxFileUploaderComponent.prototype, "activeStateEnabled", {
  135. get: /**
  136. * Specifies whether or not the widget changes its state when interacting with a user.
  137. */
  138. function () {
  139. return this._getOption('activeStateEnabled');
  140. },
  141. set: function (value) {
  142. this._setOption('activeStateEnabled', value);
  143. },
  144. enumerable: true,
  145. configurable: true
  146. });
  147. Object.defineProperty(DxFileUploaderComponent.prototype, "allowCanceling", {
  148. get: /**
  149. * Specifies if an end user can remove a file from the selection and interrupt uploading.
  150. */
  151. function () {
  152. return this._getOption('allowCanceling');
  153. },
  154. set: function (value) {
  155. this._setOption('allowCanceling', value);
  156. },
  157. enumerable: true,
  158. configurable: true
  159. });
  160. Object.defineProperty(DxFileUploaderComponent.prototype, "allowedFileExtensions", {
  161. get: /**
  162. * Restricts file extensions that can be uploaded to the server.
  163. */
  164. function () {
  165. return this._getOption('allowedFileExtensions');
  166. },
  167. set: function (value) {
  168. this._setOption('allowedFileExtensions', value);
  169. },
  170. enumerable: true,
  171. configurable: true
  172. });
  173. Object.defineProperty(DxFileUploaderComponent.prototype, "chunkSize", {
  174. get: /**
  175. * Specifies the chunk size in bytes. Applies only if uploadMode is "instantly" or "useButtons". Requires a server that can process file chunks.
  176. */
  177. function () {
  178. return this._getOption('chunkSize');
  179. },
  180. set: function (value) {
  181. this._setOption('chunkSize', value);
  182. },
  183. enumerable: true,
  184. configurable: true
  185. });
  186. Object.defineProperty(DxFileUploaderComponent.prototype, "disabled", {
  187. get: /**
  188. * Specifies whether the widget responds to user interaction.
  189. */
  190. function () {
  191. return this._getOption('disabled');
  192. },
  193. set: function (value) {
  194. this._setOption('disabled', value);
  195. },
  196. enumerable: true,
  197. configurable: true
  198. });
  199. Object.defineProperty(DxFileUploaderComponent.prototype, "elementAttr", {
  200. get: /**
  201. * Specifies the attributes to be attached to the widget's root element.
  202. */
  203. function () {
  204. return this._getOption('elementAttr');
  205. },
  206. set: function (value) {
  207. this._setOption('elementAttr', value);
  208. },
  209. enumerable: true,
  210. configurable: true
  211. });
  212. Object.defineProperty(DxFileUploaderComponent.prototype, "focusStateEnabled", {
  213. get: /**
  214. * Specifies whether the widget can be focused using keyboard navigation.
  215. */
  216. function () {
  217. return this._getOption('focusStateEnabled');
  218. },
  219. set: function (value) {
  220. this._setOption('focusStateEnabled', value);
  221. },
  222. enumerable: true,
  223. configurable: true
  224. });
  225. Object.defineProperty(DxFileUploaderComponent.prototype, "height", {
  226. get: /**
  227. * Specifies the widget's height.
  228. */
  229. function () {
  230. return this._getOption('height');
  231. },
  232. set: function (value) {
  233. this._setOption('height', value);
  234. },
  235. enumerable: true,
  236. configurable: true
  237. });
  238. Object.defineProperty(DxFileUploaderComponent.prototype, "hint", {
  239. get: /**
  240. * Specifies text for a hint that appears when a user pauses on the widget.
  241. */
  242. function () {
  243. return this._getOption('hint');
  244. },
  245. set: function (value) {
  246. this._setOption('hint', value);
  247. },
  248. enumerable: true,
  249. configurable: true
  250. });
  251. Object.defineProperty(DxFileUploaderComponent.prototype, "hoverStateEnabled", {
  252. get: /**
  253. * Specifies whether the widget changes its state when a user pauses on it.
  254. */
  255. function () {
  256. return this._getOption('hoverStateEnabled');
  257. },
  258. set: function (value) {
  259. this._setOption('hoverStateEnabled', value);
  260. },
  261. enumerable: true,
  262. configurable: true
  263. });
  264. Object.defineProperty(DxFileUploaderComponent.prototype, "invalidFileExtensionMessage", {
  265. get: /**
  266. * The text displayed when the extension of the file being uploaded is not an allowed file extension.
  267. */
  268. function () {
  269. return this._getOption('invalidFileExtensionMessage');
  270. },
  271. set: function (value) {
  272. this._setOption('invalidFileExtensionMessage', value);
  273. },
  274. enumerable: true,
  275. configurable: true
  276. });
  277. Object.defineProperty(DxFileUploaderComponent.prototype, "invalidMaxFileSizeMessage", {
  278. get: /**
  279. * The text displayed when the size of the file being uploaded is greater than the maxFileSize.
  280. */
  281. function () {
  282. return this._getOption('invalidMaxFileSizeMessage');
  283. },
  284. set: function (value) {
  285. this._setOption('invalidMaxFileSizeMessage', value);
  286. },
  287. enumerable: true,
  288. configurable: true
  289. });
  290. Object.defineProperty(DxFileUploaderComponent.prototype, "invalidMinFileSizeMessage", {
  291. get: /**
  292. * The text displayed when the size of the file being uploaded is less than the minFileSize.
  293. */
  294. function () {
  295. return this._getOption('invalidMinFileSizeMessage');
  296. },
  297. set: function (value) {
  298. this._setOption('invalidMinFileSizeMessage', value);
  299. },
  300. enumerable: true,
  301. configurable: true
  302. });
  303. Object.defineProperty(DxFileUploaderComponent.prototype, "isValid", {
  304. get: /**
  305. * Specifies whether the editor's value is valid.
  306. */
  307. function () {
  308. return this._getOption('isValid');
  309. },
  310. set: function (value) {
  311. this._setOption('isValid', value);
  312. },
  313. enumerable: true,
  314. configurable: true
  315. });
  316. Object.defineProperty(DxFileUploaderComponent.prototype, "labelText", {
  317. get: /**
  318. * Specifies the text displayed on the area to which an end-user can drop a file.
  319. */
  320. function () {
  321. return this._getOption('labelText');
  322. },
  323. set: function (value) {
  324. this._setOption('labelText', value);
  325. },
  326. enumerable: true,
  327. configurable: true
  328. });
  329. Object.defineProperty(DxFileUploaderComponent.prototype, "maxFileSize", {
  330. get: /**
  331. * Specifies the maximum file size (in bytes) allowed for uploading. Applies only if uploadMode is "instantly" or "useButtons".
  332. */
  333. function () {
  334. return this._getOption('maxFileSize');
  335. },
  336. set: function (value) {
  337. this._setOption('maxFileSize', value);
  338. },
  339. enumerable: true,
  340. configurable: true
  341. });
  342. Object.defineProperty(DxFileUploaderComponent.prototype, "minFileSize", {
  343. get: /**
  344. * Specifies the minimum file size (in bytes) allowed for uploading. Applies only if uploadMode is "instantly" or "useButtons".
  345. */
  346. function () {
  347. return this._getOption('minFileSize');
  348. },
  349. set: function (value) {
  350. this._setOption('minFileSize', value);
  351. },
  352. enumerable: true,
  353. configurable: true
  354. });
  355. Object.defineProperty(DxFileUploaderComponent.prototype, "multiple", {
  356. get: /**
  357. * Specifies whether the widget enables an end-user to select a single file or multiple files.
  358. */
  359. function () {
  360. return this._getOption('multiple');
  361. },
  362. set: function (value) {
  363. this._setOption('multiple', value);
  364. },
  365. enumerable: true,
  366. configurable: true
  367. });
  368. Object.defineProperty(DxFileUploaderComponent.prototype, "name", {
  369. get: /**
  370. * Specifies the value passed to the name attribute of the underlying input element. Required to access uploaded files on the server.
  371. */
  372. function () {
  373. return this._getOption('name');
  374. },
  375. set: function (value) {
  376. this._setOption('name', value);
  377. },
  378. enumerable: true,
  379. configurable: true
  380. });
  381. Object.defineProperty(DxFileUploaderComponent.prototype, "progress", {
  382. get: /**
  383. * Gets the current progress in percentages.
  384. */
  385. function () {
  386. return this._getOption('progress');
  387. },
  388. set: function (value) {
  389. this._setOption('progress', value);
  390. },
  391. enumerable: true,
  392. configurable: true
  393. });
  394. Object.defineProperty(DxFileUploaderComponent.prototype, "readOnly", {
  395. get: /**
  396. * Specifies whether the editor is read-only.
  397. */
  398. function () {
  399. return this._getOption('readOnly');
  400. },
  401. set: function (value) {
  402. this._setOption('readOnly', value);
  403. },
  404. enumerable: true,
  405. configurable: true
  406. });
  407. Object.defineProperty(DxFileUploaderComponent.prototype, "readyToUploadMessage", {
  408. get: /**
  409. * The message displayed by the widget when it is ready to upload the specified files.
  410. */
  411. function () {
  412. return this._getOption('readyToUploadMessage');
  413. },
  414. set: function (value) {
  415. this._setOption('readyToUploadMessage', value);
  416. },
  417. enumerable: true,
  418. configurable: true
  419. });
  420. Object.defineProperty(DxFileUploaderComponent.prototype, "rtlEnabled", {
  421. get: /**
  422. * Switches the widget to a right-to-left representation.
  423. */
  424. function () {
  425. return this._getOption('rtlEnabled');
  426. },
  427. set: function (value) {
  428. this._setOption('rtlEnabled', value);
  429. },
  430. enumerable: true,
  431. configurable: true
  432. });
  433. Object.defineProperty(DxFileUploaderComponent.prototype, "selectButtonText", {
  434. get: /**
  435. * The text displayed on the button that opens the file browser.
  436. */
  437. function () {
  438. return this._getOption('selectButtonText');
  439. },
  440. set: function (value) {
  441. this._setOption('selectButtonText', value);
  442. },
  443. enumerable: true,
  444. configurable: true
  445. });
  446. Object.defineProperty(DxFileUploaderComponent.prototype, "showFileList", {
  447. get: /**
  448. * Specifies whether or not the widget displays the list of selected files.
  449. */
  450. function () {
  451. return this._getOption('showFileList');
  452. },
  453. set: function (value) {
  454. this._setOption('showFileList', value);
  455. },
  456. enumerable: true,
  457. configurable: true
  458. });
  459. Object.defineProperty(DxFileUploaderComponent.prototype, "tabIndex", {
  460. get: /**
  461. * Specifies the number of the element when the Tab key is used for navigating.
  462. */
  463. function () {
  464. return this._getOption('tabIndex');
  465. },
  466. set: function (value) {
  467. this._setOption('tabIndex', value);
  468. },
  469. enumerable: true,
  470. configurable: true
  471. });
  472. Object.defineProperty(DxFileUploaderComponent.prototype, "uploadButtonText", {
  473. get: /**
  474. * The text displayed on the button that starts uploading.
  475. */
  476. function () {
  477. return this._getOption('uploadButtonText');
  478. },
  479. set: function (value) {
  480. this._setOption('uploadButtonText', value);
  481. },
  482. enumerable: true,
  483. configurable: true
  484. });
  485. Object.defineProperty(DxFileUploaderComponent.prototype, "uploadedMessage", {
  486. get: /**
  487. * The message displayed by the widget when uploading is finished.
  488. */
  489. function () {
  490. return this._getOption('uploadedMessage');
  491. },
  492. set: function (value) {
  493. this._setOption('uploadedMessage', value);
  494. },
  495. enumerable: true,
  496. configurable: true
  497. });
  498. Object.defineProperty(DxFileUploaderComponent.prototype, "uploadFailedMessage", {
  499. get: /**
  500. * The message displayed by the widget on uploading failure.
  501. */
  502. function () {
  503. return this._getOption('uploadFailedMessage');
  504. },
  505. set: function (value) {
  506. this._setOption('uploadFailedMessage', value);
  507. },
  508. enumerable: true,
  509. configurable: true
  510. });
  511. Object.defineProperty(DxFileUploaderComponent.prototype, "uploadHeaders", {
  512. get: /**
  513. * Specifies headers for the upload request.
  514. */
  515. function () {
  516. return this._getOption('uploadHeaders');
  517. },
  518. set: function (value) {
  519. this._setOption('uploadHeaders', value);
  520. },
  521. enumerable: true,
  522. configurable: true
  523. });
  524. Object.defineProperty(DxFileUploaderComponent.prototype, "uploadMethod", {
  525. get: /**
  526. * Specifies the method for the upload request.
  527. */
  528. function () {
  529. return this._getOption('uploadMethod');
  530. },
  531. set: function (value) {
  532. this._setOption('uploadMethod', value);
  533. },
  534. enumerable: true,
  535. configurable: true
  536. });
  537. Object.defineProperty(DxFileUploaderComponent.prototype, "uploadMode", {
  538. get: /**
  539. * Specifies how the widget uploads files.
  540. */
  541. function () {
  542. return this._getOption('uploadMode');
  543. },
  544. set: function (value) {
  545. this._setOption('uploadMode', value);
  546. },
  547. enumerable: true,
  548. configurable: true
  549. });
  550. Object.defineProperty(DxFileUploaderComponent.prototype, "uploadUrl", {
  551. get: /**
  552. * Specifies a target Url for the upload request.
  553. */
  554. function () {
  555. return this._getOption('uploadUrl');
  556. },
  557. set: function (value) {
  558. this._setOption('uploadUrl', value);
  559. },
  560. enumerable: true,
  561. configurable: true
  562. });
  563. Object.defineProperty(DxFileUploaderComponent.prototype, "validationError", {
  564. get: /**
  565. * Specifies information on the validation error when using a custom validation engine. Should be changed at runtime along with the isValid option.
  566. */
  567. function () {
  568. return this._getOption('validationError');
  569. },
  570. set: function (value) {
  571. this._setOption('validationError', value);
  572. },
  573. enumerable: true,
  574. configurable: true
  575. });
  576. Object.defineProperty(DxFileUploaderComponent.prototype, "value", {
  577. get: /**
  578. * Specifies a File instance representing the selected file. Read-only when uploadMode is "useForm".
  579. */
  580. function () {
  581. return this._getOption('value');
  582. },
  583. set: function (value) {
  584. this._setOption('value', value);
  585. },
  586. enumerable: true,
  587. configurable: true
  588. });
  589. Object.defineProperty(DxFileUploaderComponent.prototype, "visible", {
  590. get: /**
  591. * Specifies whether the widget is visible.
  592. */
  593. function () {
  594. return this._getOption('visible');
  595. },
  596. set: function (value) {
  597. this._setOption('visible', value);
  598. },
  599. enumerable: true,
  600. configurable: true
  601. });
  602. Object.defineProperty(DxFileUploaderComponent.prototype, "width", {
  603. get: /**
  604. * Specifies the widget's width.
  605. */
  606. function () {
  607. return this._getOption('width');
  608. },
  609. set: function (value) {
  610. this._setOption('width', value);
  611. },
  612. enumerable: true,
  613. configurable: true
  614. });
  615. DxFileUploaderComponent.prototype.change = function (_) { };
  616. DxFileUploaderComponent.prototype._createInstance = function (element, options) {
  617. return new file_uploader_1.default(element, options);
  618. };
  619. DxFileUploaderComponent.prototype.writeValue = function (value) {
  620. this.eventHelper.lockedValueChangeEvent = true;
  621. this.value = value;
  622. this.eventHelper.lockedValueChangeEvent = false;
  623. };
  624. DxFileUploaderComponent.prototype.setDisabledState = function (isDisabled) {
  625. this.disabled = isDisabled;
  626. };
  627. DxFileUploaderComponent.prototype.registerOnChange = function (fn) { this.change = fn; };
  628. DxFileUploaderComponent.prototype.registerOnTouched = function (fn) { this.touched = fn; };
  629. DxFileUploaderComponent.prototype._createWidget = function (element) {
  630. var _this = this;
  631. _super.prototype._createWidget.call(this, element);
  632. this.instance.on('focusOut', function (e) {
  633. _this.eventHelper.fireNgEvent('onBlur', [e]);
  634. });
  635. };
  636. DxFileUploaderComponent.prototype.ngOnDestroy = function () {
  637. this._destroyWidget();
  638. };
  639. DxFileUploaderComponent.prototype.ngOnChanges = function (changes) {
  640. _super.prototype.ngOnChanges.call(this, changes);
  641. this.setupChanges('allowedFileExtensions', changes);
  642. this.setupChanges('value', changes);
  643. };
  644. DxFileUploaderComponent.prototype.setupChanges = function (prop, changes) {
  645. if (!(prop in this._optionsToUpdate)) {
  646. this._idh.setup(prop, changes);
  647. }
  648. };
  649. DxFileUploaderComponent.prototype.ngDoCheck = function () {
  650. this._idh.doCheck('allowedFileExtensions');
  651. this._idh.doCheck('value');
  652. this._watcherHelper.checkWatchers();
  653. _super.prototype.ngDoCheck.call(this);
  654. _super.prototype.clearChangedOptions.call(this);
  655. };
  656. DxFileUploaderComponent.prototype._setOption = function (name, value) {
  657. var isSetup = this._idh.setupSingle(name, value);
  658. var isChanged = this._idh.getChanges(name, value) !== null;
  659. if (isSetup || isChanged) {
  660. _super.prototype._setOption.call(this, name, value);
  661. }
  662. };
  663. DxFileUploaderComponent.decorators = [
  664. { type: core_1.Component, args: [{
  665. selector: 'dx-file-uploader',
  666. template: '',
  667. providers: [
  668. template_host_1.DxTemplateHost,
  669. watcher_helper_1.WatcherHelper,
  670. CUSTOM_VALUE_ACCESSOR_PROVIDER,
  671. nested_option_1.NestedOptionHost,
  672. iterable_differ_helper_1.IterableDifferHelper
  673. ]
  674. },] },
  675. ];
  676. /** @nocollapse */
  677. DxFileUploaderComponent.ctorParameters = function () { return [
  678. { type: core_1.ElementRef, },
  679. { type: core_1.NgZone, },
  680. { type: template_host_1.DxTemplateHost, },
  681. { type: watcher_helper_1.WatcherHelper, },
  682. { type: iterable_differ_helper_1.IterableDifferHelper, },
  683. { type: nested_option_1.NestedOptionHost, },
  684. { type: platform_browser_2.TransferState, },
  685. { type: undefined, decorators: [{ type: core_1.Inject, args: [core_1.PLATFORM_ID,] },] },
  686. ]; };
  687. DxFileUploaderComponent.propDecorators = {
  688. "accept": [{ type: core_1.Input },],
  689. "accessKey": [{ type: core_1.Input },],
  690. "activeStateEnabled": [{ type: core_1.Input },],
  691. "allowCanceling": [{ type: core_1.Input },],
  692. "allowedFileExtensions": [{ type: core_1.Input },],
  693. "chunkSize": [{ type: core_1.Input },],
  694. "disabled": [{ type: core_1.Input },],
  695. "elementAttr": [{ type: core_1.Input },],
  696. "focusStateEnabled": [{ type: core_1.Input },],
  697. "height": [{ type: core_1.Input },],
  698. "hint": [{ type: core_1.Input },],
  699. "hoverStateEnabled": [{ type: core_1.Input },],
  700. "invalidFileExtensionMessage": [{ type: core_1.Input },],
  701. "invalidMaxFileSizeMessage": [{ type: core_1.Input },],
  702. "invalidMinFileSizeMessage": [{ type: core_1.Input },],
  703. "isValid": [{ type: core_1.Input },],
  704. "labelText": [{ type: core_1.Input },],
  705. "maxFileSize": [{ type: core_1.Input },],
  706. "minFileSize": [{ type: core_1.Input },],
  707. "multiple": [{ type: core_1.Input },],
  708. "name": [{ type: core_1.Input },],
  709. "progress": [{ type: core_1.Input },],
  710. "readOnly": [{ type: core_1.Input },],
  711. "readyToUploadMessage": [{ type: core_1.Input },],
  712. "rtlEnabled": [{ type: core_1.Input },],
  713. "selectButtonText": [{ type: core_1.Input },],
  714. "showFileList": [{ type: core_1.Input },],
  715. "tabIndex": [{ type: core_1.Input },],
  716. "uploadButtonText": [{ type: core_1.Input },],
  717. "uploadedMessage": [{ type: core_1.Input },],
  718. "uploadFailedMessage": [{ type: core_1.Input },],
  719. "uploadHeaders": [{ type: core_1.Input },],
  720. "uploadMethod": [{ type: core_1.Input },],
  721. "uploadMode": [{ type: core_1.Input },],
  722. "uploadUrl": [{ type: core_1.Input },],
  723. "validationError": [{ type: core_1.Input },],
  724. "value": [{ type: core_1.Input },],
  725. "visible": [{ type: core_1.Input },],
  726. "width": [{ type: core_1.Input },],
  727. "onContentReady": [{ type: core_1.Output },],
  728. "onDisposing": [{ type: core_1.Output },],
  729. "onInitialized": [{ type: core_1.Output },],
  730. "onOptionChanged": [{ type: core_1.Output },],
  731. "onProgress": [{ type: core_1.Output },],
  732. "onUploadAborted": [{ type: core_1.Output },],
  733. "onUploaded": [{ type: core_1.Output },],
  734. "onUploadError": [{ type: core_1.Output },],
  735. "onUploadStarted": [{ type: core_1.Output },],
  736. "onValueChanged": [{ type: core_1.Output },],
  737. "acceptChange": [{ type: core_1.Output },],
  738. "accessKeyChange": [{ type: core_1.Output },],
  739. "activeStateEnabledChange": [{ type: core_1.Output },],
  740. "allowCancelingChange": [{ type: core_1.Output },],
  741. "allowedFileExtensionsChange": [{ type: core_1.Output },],
  742. "chunkSizeChange": [{ type: core_1.Output },],
  743. "disabledChange": [{ type: core_1.Output },],
  744. "elementAttrChange": [{ type: core_1.Output },],
  745. "focusStateEnabledChange": [{ type: core_1.Output },],
  746. "heightChange": [{ type: core_1.Output },],
  747. "hintChange": [{ type: core_1.Output },],
  748. "hoverStateEnabledChange": [{ type: core_1.Output },],
  749. "invalidFileExtensionMessageChange": [{ type: core_1.Output },],
  750. "invalidMaxFileSizeMessageChange": [{ type: core_1.Output },],
  751. "invalidMinFileSizeMessageChange": [{ type: core_1.Output },],
  752. "isValidChange": [{ type: core_1.Output },],
  753. "labelTextChange": [{ type: core_1.Output },],
  754. "maxFileSizeChange": [{ type: core_1.Output },],
  755. "minFileSizeChange": [{ type: core_1.Output },],
  756. "multipleChange": [{ type: core_1.Output },],
  757. "nameChange": [{ type: core_1.Output },],
  758. "progressChange": [{ type: core_1.Output },],
  759. "readOnlyChange": [{ type: core_1.Output },],
  760. "readyToUploadMessageChange": [{ type: core_1.Output },],
  761. "rtlEnabledChange": [{ type: core_1.Output },],
  762. "selectButtonTextChange": [{ type: core_1.Output },],
  763. "showFileListChange": [{ type: core_1.Output },],
  764. "tabIndexChange": [{ type: core_1.Output },],
  765. "uploadButtonTextChange": [{ type: core_1.Output },],
  766. "uploadedMessageChange": [{ type: core_1.Output },],
  767. "uploadFailedMessageChange": [{ type: core_1.Output },],
  768. "uploadHeadersChange": [{ type: core_1.Output },],
  769. "uploadMethodChange": [{ type: core_1.Output },],
  770. "uploadModeChange": [{ type: core_1.Output },],
  771. "uploadUrlChange": [{ type: core_1.Output },],
  772. "validationErrorChange": [{ type: core_1.Output },],
  773. "valueChange": [{ type: core_1.Output },],
  774. "visibleChange": [{ type: core_1.Output },],
  775. "widthChange": [{ type: core_1.Output },],
  776. "onBlur": [{ type: core_1.Output },],
  777. "change": [{ type: core_1.HostListener, args: ['valueChange', ['$event'],] },],
  778. "touched": [{ type: core_1.HostListener, args: ['onBlur', ['$event'],] },],
  779. };
  780. return DxFileUploaderComponent;
  781. }(component_1.DxComponent));
  782. exports.DxFileUploaderComponent = DxFileUploaderComponent;
  783. var DxFileUploaderModule = (function () {
  784. function DxFileUploaderModule() {
  785. }
  786. DxFileUploaderModule.decorators = [
  787. { type: core_1.NgModule, args: [{
  788. imports: [
  789. integration_1.DxIntegrationModule,
  790. template_1.DxTemplateModule,
  791. platform_browser_1.BrowserTransferStateModule
  792. ],
  793. declarations: [
  794. DxFileUploaderComponent
  795. ],
  796. exports: [
  797. DxFileUploaderComponent,
  798. template_1.DxTemplateModule
  799. ]
  800. },] },
  801. ];
  802. return DxFileUploaderModule;
  803. }());
  804. exports.DxFileUploaderModule = DxFileUploaderModule;
  805. //# sourceMappingURL=file-uploader.js.map