validation-summary.js 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  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 validation_summary_1 = require("devextreme/ui/validation_summary");
  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. var iterable_differ_helper_1 = require("../core/iterable-differ-helper");
  36. var item_dxi_1 = require("./nested/item-dxi");
  37. var item_dxi_2 = require("./nested/item-dxi");
  38. /**
  39. * A widget for displaying the result of checking validation rules for editors.
  40. */
  41. var DxValidationSummaryComponent = (function (_super) {
  42. __extends(DxValidationSummaryComponent, _super);
  43. function DxValidationSummaryComponent(elementRef, ngZone, templateHost, _watcherHelper, _idh, optionHost, transferState, platformId) {
  44. var _this = _super.call(this, elementRef, ngZone, templateHost, _watcherHelper, transferState, platformId) || this;
  45. _this._watcherHelper = _watcherHelper;
  46. _this._idh = _idh;
  47. _this._createEventEmitters([
  48. { subscribe: 'contentReady', emit: 'onContentReady' },
  49. { subscribe: 'disposing', emit: 'onDisposing' },
  50. { subscribe: 'initialized', emit: 'onInitialized' },
  51. { subscribe: 'itemClick', emit: 'onItemClick' },
  52. { subscribe: 'optionChanged', emit: 'onOptionChanged' },
  53. { emit: 'elementAttrChange' },
  54. { emit: 'hoverStateEnabledChange' },
  55. { emit: 'itemsChange' },
  56. { emit: 'itemTemplateChange' },
  57. { emit: 'validationGroupChange' }
  58. ]);
  59. _this._idh.setHost(_this);
  60. optionHost.setHost(_this);
  61. return _this;
  62. }
  63. Object.defineProperty(DxValidationSummaryComponent.prototype, "elementAttr", {
  64. get: /**
  65. * Specifies the attributes to be attached to the widget's root element.
  66. */
  67. function () {
  68. return this._getOption('elementAttr');
  69. },
  70. set: function (value) {
  71. this._setOption('elementAttr', value);
  72. },
  73. enumerable: true,
  74. configurable: true
  75. });
  76. Object.defineProperty(DxValidationSummaryComponent.prototype, "hoverStateEnabled", {
  77. get: /**
  78. * Specifies whether the widget changes its state when a user pauses on it.
  79. */
  80. function () {
  81. return this._getOption('hoverStateEnabled');
  82. },
  83. set: function (value) {
  84. this._setOption('hoverStateEnabled', value);
  85. },
  86. enumerable: true,
  87. configurable: true
  88. });
  89. Object.defineProperty(DxValidationSummaryComponent.prototype, "items", {
  90. get: /**
  91. * An array of items displayed by the widget.
  92. */
  93. function () {
  94. return this._getOption('items');
  95. },
  96. set: function (value) {
  97. this._setOption('items', value);
  98. },
  99. enumerable: true,
  100. configurable: true
  101. });
  102. Object.defineProperty(DxValidationSummaryComponent.prototype, "itemTemplate", {
  103. get: /**
  104. * Specifies a custom template for items.
  105. */
  106. function () {
  107. return this._getOption('itemTemplate');
  108. },
  109. set: function (value) {
  110. this._setOption('itemTemplate', value);
  111. },
  112. enumerable: true,
  113. configurable: true
  114. });
  115. Object.defineProperty(DxValidationSummaryComponent.prototype, "validationGroup", {
  116. get: /**
  117. * Specifies the validation group for which summary should be generated.
  118. */
  119. function () {
  120. return this._getOption('validationGroup');
  121. },
  122. set: function (value) {
  123. this._setOption('validationGroup', value);
  124. },
  125. enumerable: true,
  126. configurable: true
  127. });
  128. Object.defineProperty(DxValidationSummaryComponent.prototype, "itemsChildren", {
  129. get: function () {
  130. return this._getOption('items');
  131. },
  132. set: function (value) {
  133. this.setChildren('items', value);
  134. },
  135. enumerable: true,
  136. configurable: true
  137. });
  138. DxValidationSummaryComponent.prototype._createInstance = function (element, options) {
  139. return new validation_summary_1.default(element, options);
  140. };
  141. DxValidationSummaryComponent.prototype.ngOnDestroy = function () {
  142. this._destroyWidget();
  143. };
  144. DxValidationSummaryComponent.prototype.ngOnChanges = function (changes) {
  145. _super.prototype.ngOnChanges.call(this, changes);
  146. this.setupChanges('items', changes);
  147. };
  148. DxValidationSummaryComponent.prototype.setupChanges = function (prop, changes) {
  149. if (!(prop in this._optionsToUpdate)) {
  150. this._idh.setup(prop, changes);
  151. }
  152. };
  153. DxValidationSummaryComponent.prototype.ngDoCheck = function () {
  154. this._idh.doCheck('items');
  155. this._watcherHelper.checkWatchers();
  156. _super.prototype.ngDoCheck.call(this);
  157. _super.prototype.clearChangedOptions.call(this);
  158. };
  159. DxValidationSummaryComponent.prototype._setOption = function (name, value) {
  160. var isSetup = this._idh.setupSingle(name, value);
  161. var isChanged = this._idh.getChanges(name, value) !== null;
  162. if (isSetup || isChanged) {
  163. _super.prototype._setOption.call(this, name, value);
  164. }
  165. };
  166. DxValidationSummaryComponent.decorators = [
  167. { type: core_1.Component, args: [{
  168. selector: 'dx-validation-summary',
  169. template: '',
  170. providers: [
  171. template_host_1.DxTemplateHost,
  172. watcher_helper_1.WatcherHelper,
  173. nested_option_1.NestedOptionHost,
  174. iterable_differ_helper_1.IterableDifferHelper
  175. ]
  176. },] },
  177. ];
  178. /** @nocollapse */
  179. DxValidationSummaryComponent.ctorParameters = function () { return [
  180. { type: core_1.ElementRef, },
  181. { type: core_1.NgZone, },
  182. { type: template_host_1.DxTemplateHost, },
  183. { type: watcher_helper_1.WatcherHelper, },
  184. { type: iterable_differ_helper_1.IterableDifferHelper, },
  185. { type: nested_option_1.NestedOptionHost, },
  186. { type: platform_browser_2.TransferState, },
  187. { type: undefined, decorators: [{ type: core_1.Inject, args: [core_1.PLATFORM_ID,] },] },
  188. ]; };
  189. DxValidationSummaryComponent.propDecorators = {
  190. "elementAttr": [{ type: core_1.Input },],
  191. "hoverStateEnabled": [{ type: core_1.Input },],
  192. "items": [{ type: core_1.Input },],
  193. "itemTemplate": [{ type: core_1.Input },],
  194. "validationGroup": [{ type: core_1.Input },],
  195. "onContentReady": [{ type: core_1.Output },],
  196. "onDisposing": [{ type: core_1.Output },],
  197. "onInitialized": [{ type: core_1.Output },],
  198. "onItemClick": [{ type: core_1.Output },],
  199. "onOptionChanged": [{ type: core_1.Output },],
  200. "elementAttrChange": [{ type: core_1.Output },],
  201. "hoverStateEnabledChange": [{ type: core_1.Output },],
  202. "itemsChange": [{ type: core_1.Output },],
  203. "itemTemplateChange": [{ type: core_1.Output },],
  204. "validationGroupChange": [{ type: core_1.Output },],
  205. "itemsChildren": [{ type: core_1.ContentChildren, args: [item_dxi_2.DxiItemComponent,] },],
  206. };
  207. return DxValidationSummaryComponent;
  208. }(component_1.DxComponent));
  209. exports.DxValidationSummaryComponent = DxValidationSummaryComponent;
  210. var DxValidationSummaryModule = (function () {
  211. function DxValidationSummaryModule() {
  212. }
  213. DxValidationSummaryModule.decorators = [
  214. { type: core_1.NgModule, args: [{
  215. imports: [
  216. item_dxi_1.DxiItemModule,
  217. integration_1.DxIntegrationModule,
  218. template_1.DxTemplateModule,
  219. platform_browser_1.BrowserTransferStateModule
  220. ],
  221. declarations: [
  222. DxValidationSummaryComponent
  223. ],
  224. exports: [
  225. DxValidationSummaryComponent,
  226. item_dxi_1.DxiItemModule,
  227. template_1.DxTemplateModule
  228. ]
  229. },] },
  230. ];
  231. return DxValidationSummaryModule;
  232. }());
  233. exports.DxValidationSummaryModule = DxValidationSummaryModule;
  234. //# sourceMappingURL=validation-summary.js.map